2003-08-13 01:27:48 +00:00
|
|
|
/*
|
|
|
|
* Implementation of the Microsoft Installer (msi.dll)
|
|
|
|
*
|
2005-01-28 12:39:57 +00:00
|
|
|
* Copyright 2002-2005 Mike McCormack for CodeWeavers
|
2003-08-13 01:27:48 +00:00
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __WINE_MSI_PRIVATE__
|
|
|
|
#define __WINE_MSI_PRIVATE__
|
|
|
|
|
2003-09-05 23:08:26 +00:00
|
|
|
#include <stdarg.h>
|
|
|
|
|
|
|
|
#include "windef.h"
|
|
|
|
#include "winbase.h"
|
2003-08-13 01:27:48 +00:00
|
|
|
#include "msi.h"
|
|
|
|
#include "msiquery.h"
|
2004-08-22 21:38:46 +00:00
|
|
|
#include "objbase.h"
|
2003-08-13 01:27:48 +00:00
|
|
|
#include "objidl.h"
|
2005-06-01 11:02:19 +00:00
|
|
|
#include "winnls.h"
|
2005-05-23 12:08:17 +00:00
|
|
|
#include "wine/list.h"
|
2003-08-13 01:27:48 +00:00
|
|
|
|
|
|
|
#define MSI_DATASIZEMASK 0x00ff
|
|
|
|
#define MSITYPE_VALID 0x0100
|
|
|
|
#define MSITYPE_STRING 0x0800
|
|
|
|
#define MSITYPE_NULLABLE 0x1000
|
|
|
|
#define MSITYPE_KEY 0x2000
|
|
|
|
|
2004-06-29 03:44:01 +00:00
|
|
|
#define MSITYPE_BINARY 0x8900
|
|
|
|
|
2003-08-13 01:27:48 +00:00
|
|
|
struct tagMSITABLE;
|
|
|
|
typedef struct tagMSITABLE MSITABLE;
|
|
|
|
|
2004-03-17 20:49:59 +00:00
|
|
|
struct string_table;
|
|
|
|
typedef struct string_table string_table;
|
2003-08-13 01:27:48 +00:00
|
|
|
|
2004-07-09 22:25:34 +00:00
|
|
|
struct tagMSIOBJECTHDR;
|
|
|
|
typedef struct tagMSIOBJECTHDR MSIOBJECTHDR;
|
|
|
|
|
|
|
|
typedef VOID (*msihandledestructor)( MSIOBJECTHDR * );
|
|
|
|
|
|
|
|
struct tagMSIOBJECTHDR
|
|
|
|
{
|
|
|
|
UINT magic;
|
|
|
|
UINT type;
|
2005-01-20 20:34:29 +00:00
|
|
|
DWORD refcount;
|
2004-07-09 22:25:34 +00:00
|
|
|
msihandledestructor destructor;
|
|
|
|
struct tagMSIOBJECTHDR *next;
|
|
|
|
struct tagMSIOBJECTHDR *prev;
|
|
|
|
};
|
|
|
|
|
2003-08-13 01:27:48 +00:00
|
|
|
typedef struct tagMSIDATABASE
|
|
|
|
{
|
2004-07-09 22:25:34 +00:00
|
|
|
MSIOBJECTHDR hdr;
|
2003-08-13 01:27:48 +00:00
|
|
|
IStorage *storage;
|
2004-03-17 20:49:59 +00:00
|
|
|
string_table *strings;
|
2005-05-31 09:30:28 +00:00
|
|
|
LPCWSTR mode;
|
2003-08-13 01:27:48 +00:00
|
|
|
MSITABLE *first_table, *last_table;
|
|
|
|
} MSIDATABASE;
|
|
|
|
|
2004-07-09 22:25:34 +00:00
|
|
|
typedef struct tagMSIVIEW MSIVIEW;
|
|
|
|
|
|
|
|
typedef struct tagMSIQUERY
|
|
|
|
{
|
|
|
|
MSIOBJECTHDR hdr;
|
|
|
|
MSIVIEW *view;
|
|
|
|
UINT row;
|
|
|
|
MSIDATABASE *db;
|
2005-05-23 12:08:17 +00:00
|
|
|
struct list mem;
|
2004-07-09 22:25:34 +00:00
|
|
|
} MSIQUERY;
|
|
|
|
|
|
|
|
/* maybe we can use a Variant instead of doing it ourselves? */
|
|
|
|
typedef struct tagMSIFIELD
|
|
|
|
{
|
|
|
|
UINT type;
|
|
|
|
union
|
|
|
|
{
|
|
|
|
INT iVal;
|
|
|
|
LPWSTR szwVal;
|
|
|
|
IStream *stream;
|
|
|
|
} u;
|
|
|
|
} MSIFIELD;
|
|
|
|
|
|
|
|
typedef struct tagMSIRECORD
|
|
|
|
{
|
|
|
|
MSIOBJECTHDR hdr;
|
|
|
|
UINT count; /* as passed to MsiCreateRecord */
|
|
|
|
MSIFIELD fields[1]; /* nb. array size is count+1 */
|
|
|
|
} MSIRECORD;
|
2003-08-13 01:27:48 +00:00
|
|
|
|
|
|
|
typedef struct tagMSIVIEWOPS
|
|
|
|
{
|
|
|
|
/*
|
|
|
|
* fetch_int - reads one integer from {row,col} in the table
|
|
|
|
*
|
|
|
|
* This function should be called after the execute method.
|
|
|
|
* Data returned by the function should not change until
|
|
|
|
* close or delete is called.
|
|
|
|
* To get a string value, query the database's string table with
|
|
|
|
* the integer value returned from this function.
|
|
|
|
*/
|
|
|
|
UINT (*fetch_int)( struct tagMSIVIEW *, UINT row, UINT col, UINT *val );
|
|
|
|
|
2004-07-06 18:56:12 +00:00
|
|
|
/*
|
|
|
|
* fetch_int - reads one integer from {row,col} in the table
|
|
|
|
*
|
|
|
|
* This function is similar to fetch_int, except fetches a
|
|
|
|
* stream instead of an integer.
|
|
|
|
*/
|
|
|
|
UINT (*fetch_stream)( struct tagMSIVIEW *, UINT row, UINT col, IStream **stm );
|
|
|
|
|
2004-03-19 01:16:36 +00:00
|
|
|
/*
|
|
|
|
* get_int - sets one integer at {row,col} in the table
|
|
|
|
*
|
|
|
|
* Similar semantics to fetch_int
|
|
|
|
*/
|
|
|
|
UINT (*set_int)( struct tagMSIVIEW *, UINT row, UINT col, UINT val );
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Inserts a new, blank row into the database
|
|
|
|
* *row receives the number of the new row
|
|
|
|
*/
|
|
|
|
UINT (*insert_row)( struct tagMSIVIEW *, UINT *row );
|
|
|
|
|
2003-08-13 01:27:48 +00:00
|
|
|
/*
|
|
|
|
* execute - loads the underlying data into memory so it can be read
|
|
|
|
*/
|
2004-07-09 22:25:34 +00:00
|
|
|
UINT (*execute)( struct tagMSIVIEW *, MSIRECORD * );
|
2003-08-13 01:27:48 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* close - clears the data read by execute from memory
|
|
|
|
*/
|
|
|
|
UINT (*close)( struct tagMSIVIEW * );
|
|
|
|
|
|
|
|
/*
|
|
|
|
* get_dimensions - returns the number of rows or columns in a table.
|
|
|
|
*
|
|
|
|
* The number of rows can only be queried after the execute method
|
|
|
|
* is called. The number of columns can be queried at any time.
|
|
|
|
*/
|
|
|
|
UINT (*get_dimensions)( struct tagMSIVIEW *, UINT *rows, UINT *cols );
|
|
|
|
|
|
|
|
/*
|
|
|
|
* get_column_info - returns the name and type of a specific column
|
|
|
|
*
|
|
|
|
* The name is HeapAlloc'ed by this function and should be freed by
|
|
|
|
* the caller.
|
|
|
|
* The column information can be queried at any time.
|
|
|
|
*/
|
|
|
|
UINT (*get_column_info)( struct tagMSIVIEW *, UINT n, LPWSTR *name, UINT *type );
|
|
|
|
|
|
|
|
/*
|
|
|
|
* modify - not yet implemented properly
|
|
|
|
*/
|
2005-02-08 13:44:25 +00:00
|
|
|
UINT (*modify)( struct tagMSIVIEW *, MSIMODIFY, MSIRECORD * );
|
2003-08-13 01:27:48 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* delete - destroys the structure completely
|
|
|
|
*/
|
|
|
|
UINT (*delete)( struct tagMSIVIEW * );
|
|
|
|
|
|
|
|
} MSIVIEWOPS;
|
|
|
|
|
2004-07-09 22:25:34 +00:00
|
|
|
struct tagMSIVIEW
|
2003-08-13 01:27:48 +00:00
|
|
|
{
|
2004-07-09 22:25:34 +00:00
|
|
|
MSIOBJECTHDR hdr;
|
|
|
|
MSIVIEWOPS *ops;
|
|
|
|
};
|
2003-08-13 01:27:48 +00:00
|
|
|
|
2005-02-02 09:55:51 +00:00
|
|
|
struct msi_dialog_tag;
|
|
|
|
typedef struct msi_dialog_tag msi_dialog;
|
|
|
|
|
2004-07-04 00:32:48 +00:00
|
|
|
typedef struct tagMSIPACKAGE
|
|
|
|
{
|
2004-07-09 22:25:34 +00:00
|
|
|
MSIOBJECTHDR hdr;
|
|
|
|
MSIDATABASE *db;
|
2004-07-04 00:32:48 +00:00
|
|
|
struct tagMSIFEATURE *features;
|
|
|
|
UINT loaded_features;
|
|
|
|
struct tagMSIFOLDER *folders;
|
|
|
|
UINT loaded_folders;
|
|
|
|
struct tagMSICOMPONENT *components;
|
|
|
|
UINT loaded_components;
|
2004-07-04 00:35:52 +00:00
|
|
|
struct tagMSIFILE *files;
|
|
|
|
UINT loaded_files;
|
2004-12-22 15:05:07 +00:00
|
|
|
LPWSTR ActionFormat;
|
|
|
|
LPWSTR LastAction;
|
2005-01-19 19:07:40 +00:00
|
|
|
|
2005-05-26 12:24:28 +00:00
|
|
|
struct tagMSICLASS *classes;
|
|
|
|
UINT loaded_classes;
|
|
|
|
struct tagMSIEXTENSION *extensions;
|
|
|
|
UINT loaded_extensions;
|
|
|
|
struct tagMSIPROGID *progids;
|
|
|
|
UINT loaded_progids;
|
|
|
|
struct tagMSIVERB *verbs;
|
|
|
|
UINT loaded_verbs;
|
|
|
|
struct tagMSIMIME *mimes;
|
|
|
|
UINT loaded_mimes;
|
|
|
|
struct tagMSIAPPID *appids;
|
|
|
|
UINT loaded_appids;
|
|
|
|
|
2005-05-27 19:24:22 +00:00
|
|
|
struct tagMSISCRIPT *script;
|
2005-01-19 19:07:40 +00:00
|
|
|
|
2005-01-25 20:17:09 +00:00
|
|
|
struct tagMSIRUNNINGACTION *RunningAction;
|
|
|
|
UINT RunningActionCount;
|
|
|
|
|
2005-01-19 19:07:40 +00:00
|
|
|
LPWSTR PackagePath;
|
2005-01-27 11:12:56 +00:00
|
|
|
|
|
|
|
UINT CurrentInstallState;
|
2005-02-02 09:55:51 +00:00
|
|
|
msi_dialog *dialog;
|
|
|
|
LPWSTR next_dialog;
|
2005-05-27 19:24:22 +00:00
|
|
|
|
2005-05-27 09:11:18 +00:00
|
|
|
struct _subscriptions *EventSubscriptions;
|
2004-07-04 00:32:48 +00:00
|
|
|
} MSIPACKAGE;
|
|
|
|
|
2005-01-21 10:17:01 +00:00
|
|
|
typedef struct tagMSIPREVIEW
|
|
|
|
{
|
|
|
|
MSIOBJECTHDR hdr;
|
2005-01-28 12:39:57 +00:00
|
|
|
MSIPACKAGE *package;
|
2005-02-02 09:55:51 +00:00
|
|
|
msi_dialog *dialog;
|
2005-01-21 10:17:01 +00:00
|
|
|
} MSIPREVIEW;
|
|
|
|
|
2003-08-13 01:27:48 +00:00
|
|
|
#define MSIHANDLETYPE_ANY 0
|
|
|
|
#define MSIHANDLETYPE_DATABASE 1
|
|
|
|
#define MSIHANDLETYPE_SUMMARYINFO 2
|
|
|
|
#define MSIHANDLETYPE_VIEW 3
|
|
|
|
#define MSIHANDLETYPE_RECORD 4
|
2004-06-30 19:38:36 +00:00
|
|
|
#define MSIHANDLETYPE_PACKAGE 5
|
2005-01-21 10:17:01 +00:00
|
|
|
#define MSIHANDLETYPE_PREVIEW 6
|
2003-08-13 01:27:48 +00:00
|
|
|
|
2004-07-19 21:49:15 +00:00
|
|
|
#define MSI_MAJORVERSION 2
|
|
|
|
#define MSI_MINORVERSION 0
|
|
|
|
#define MSI_BUILDNUMBER 2600
|
2003-08-13 01:27:48 +00:00
|
|
|
|
|
|
|
#define GUID_SIZE 39
|
|
|
|
|
|
|
|
#define MSIHANDLE_MAGIC 0x4d434923
|
2005-01-28 12:39:57 +00:00
|
|
|
#define MSIMAXHANDLES 0xf0
|
2003-08-13 01:27:48 +00:00
|
|
|
|
|
|
|
#define MSISUMINFO_OFFSET 0x30LL
|
|
|
|
|
2004-03-30 20:42:06 +00:00
|
|
|
DEFINE_GUID(CLSID_IMsiServer, 0x000C101C,0x0000,0x0000,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x46);
|
|
|
|
DEFINE_GUID(CLSID_IMsiServerX1, 0x000C103E,0x0000,0x0000,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x46);
|
|
|
|
DEFINE_GUID(CLSID_IMsiServerX2, 0x000C1090,0x0000,0x0000,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x46);
|
|
|
|
DEFINE_GUID(CLSID_IMsiServerX3, 0x000C1094,0x0000,0x0000,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x46);
|
|
|
|
|
|
|
|
DEFINE_GUID(CLSID_IMsiServerMessage, 0x000C101D,0x0000,0x0000,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x46);
|
|
|
|
|
2003-08-13 01:27:48 +00:00
|
|
|
|
2004-07-09 22:25:34 +00:00
|
|
|
/* handle functions */
|
|
|
|
extern void *msihandle2msiinfo(MSIHANDLE handle, UINT type);
|
|
|
|
extern MSIHANDLE alloc_msihandle( MSIOBJECTHDR * );
|
|
|
|
extern void *alloc_msiobject(UINT type, UINT size, msihandledestructor destroy );
|
|
|
|
extern void msiobj_addref(MSIOBJECTHDR *);
|
|
|
|
extern int msiobj_release(MSIOBJECTHDR *);
|
2004-12-27 19:29:33 +00:00
|
|
|
extern void msiobj_lock(MSIOBJECTHDR *);
|
|
|
|
extern void msiobj_unlock(MSIOBJECTHDR *);
|
2004-07-09 22:25:34 +00:00
|
|
|
extern MSIHANDLE msiobj_findhandle( MSIOBJECTHDR *hdr );
|
2003-08-13 01:27:48 +00:00
|
|
|
|
|
|
|
/* add this table to the list of cached tables in the database */
|
|
|
|
extern void add_table(MSIDATABASE *db, MSITABLE *table);
|
|
|
|
extern void remove_table( MSIDATABASE *db, MSITABLE *table );
|
|
|
|
extern void free_table( MSIDATABASE *db, MSITABLE *table );
|
|
|
|
extern void free_cached_tables( MSIDATABASE *db );
|
|
|
|
extern UINT find_cached_table(MSIDATABASE *db, LPCWSTR name, MSITABLE **table);
|
|
|
|
extern UINT get_table(MSIDATABASE *db, LPCWSTR name, MSITABLE **table);
|
2004-03-17 20:49:59 +00:00
|
|
|
extern UINT load_string_table( MSIDATABASE *db );
|
2004-03-18 04:04:08 +00:00
|
|
|
extern UINT MSI_CommitTables( MSIDATABASE *db );
|
2004-03-19 01:16:36 +00:00
|
|
|
extern HRESULT init_string_table( IStorage *stg );
|
2004-03-18 04:04:08 +00:00
|
|
|
|
2004-03-17 20:49:59 +00:00
|
|
|
|
|
|
|
/* string table functions */
|
2004-06-30 18:24:33 +00:00
|
|
|
extern BOOL msi_addstring( string_table *st, int string_no, const CHAR *data, int len, UINT refcount );
|
|
|
|
extern BOOL msi_addstringW( string_table *st, int string_no, const WCHAR *data, int len, UINT refcount );
|
2004-03-18 04:04:08 +00:00
|
|
|
extern UINT msi_id2stringW( string_table *st, UINT string_no, LPWSTR buffer, UINT *sz );
|
|
|
|
extern UINT msi_id2stringA( string_table *st, UINT string_no, LPSTR buffer, UINT *sz );
|
2004-03-19 01:16:36 +00:00
|
|
|
|
2003-08-13 01:27:48 +00:00
|
|
|
extern LPWSTR MSI_makestring( MSIDATABASE *db, UINT stringid);
|
2004-06-30 18:18:27 +00:00
|
|
|
extern UINT msi_string2idW( string_table *st, LPCWSTR buffer, UINT *id );
|
2004-03-19 01:16:36 +00:00
|
|
|
extern UINT msi_string2idA( string_table *st, LPCSTR str, UINT *id );
|
2004-06-26 00:18:36 +00:00
|
|
|
extern string_table *msi_init_stringtable( int entries, UINT codepage );
|
2004-03-17 20:49:59 +00:00
|
|
|
extern VOID msi_destroy_stringtable( string_table *st );
|
2004-03-18 04:04:08 +00:00
|
|
|
extern UINT msi_string_count( string_table *st );
|
|
|
|
extern UINT msi_id_refcount( string_table *st, UINT i );
|
2004-06-30 18:24:33 +00:00
|
|
|
extern UINT msi_string_totalsize( string_table *st, UINT *last );
|
2004-06-26 00:11:08 +00:00
|
|
|
extern UINT msi_strcmp( string_table *st, UINT lval, UINT rval, UINT *res );
|
2004-06-30 18:18:27 +00:00
|
|
|
extern const WCHAR *msi_string_lookup_id( string_table *st, UINT id );
|
2004-06-30 18:24:33 +00:00
|
|
|
extern UINT msi_string_get_codepage( string_table *st );
|
2004-06-26 00:11:08 +00:00
|
|
|
|
2003-08-13 01:27:48 +00:00
|
|
|
|
2005-05-23 09:53:43 +00:00
|
|
|
extern UINT VIEW_find_column( MSIVIEW *view, LPCWSTR name, UINT *n );
|
2003-08-13 01:27:48 +00:00
|
|
|
|
2004-03-19 01:16:36 +00:00
|
|
|
extern BOOL TABLE_Exists( MSIDATABASE *db, LPWSTR name );
|
|
|
|
|
2004-07-09 22:25:34 +00:00
|
|
|
extern UINT read_raw_stream_data( MSIDATABASE*, LPCWSTR stname,
|
2004-06-28 20:34:35 +00:00
|
|
|
USHORT **pdata, UINT *psz );
|
2005-01-26 19:41:13 +00:00
|
|
|
|
|
|
|
/* action internals */
|
2004-07-09 22:25:34 +00:00
|
|
|
extern UINT ACTION_DoTopLevelINSTALL( MSIPACKAGE *, LPCWSTR, LPCWSTR );
|
2005-01-03 14:29:09 +00:00
|
|
|
extern void ACTION_free_package_structures( MSIPACKAGE* );
|
2005-02-02 09:55:51 +00:00
|
|
|
extern UINT ACTION_DialogBox( MSIPACKAGE*, LPCWSTR);
|
2004-06-28 20:34:35 +00:00
|
|
|
|
2004-06-30 18:18:27 +00:00
|
|
|
/* record internals */
|
2004-07-09 22:25:34 +00:00
|
|
|
extern UINT MSI_RecordSetIStream( MSIRECORD *, unsigned int, IStream *);
|
2005-04-11 12:47:20 +00:00
|
|
|
extern UINT MSI_RecordGetIStream( MSIRECORD *, unsigned int, IStream **);
|
2004-07-09 22:25:34 +00:00
|
|
|
extern const WCHAR *MSI_RecordGetString( MSIRECORD *, unsigned int );
|
|
|
|
extern MSIRECORD *MSI_CreateRecord( unsigned int );
|
|
|
|
extern UINT MSI_RecordSetInteger( MSIRECORD *, unsigned int, int );
|
|
|
|
extern UINT MSI_RecordSetStringW( MSIRECORD *, unsigned int, LPCWSTR );
|
2005-05-31 09:30:28 +00:00
|
|
|
extern UINT MSI_RecordSetStringA( MSIRECORD *, unsigned int, LPCSTR );
|
2004-07-09 22:25:34 +00:00
|
|
|
extern BOOL MSI_RecordIsNull( MSIRECORD *, unsigned int );
|
|
|
|
extern UINT MSI_RecordGetStringW( MSIRECORD * , unsigned int, LPWSTR, DWORD *);
|
2004-11-28 14:53:46 +00:00
|
|
|
extern UINT MSI_RecordGetStringA( MSIRECORD *, unsigned int, LPSTR, DWORD *);
|
2004-07-09 22:25:34 +00:00
|
|
|
extern int MSI_RecordGetInteger( MSIRECORD *, unsigned int );
|
|
|
|
extern UINT MSI_RecordReadStream( MSIRECORD *, unsigned int, char *, DWORD *);
|
|
|
|
extern unsigned int MSI_RecordGetFieldCount( MSIRECORD *rec );
|
2005-05-31 09:30:28 +00:00
|
|
|
extern UINT MSI_RecordSetStreamW( MSIRECORD *, unsigned int, LPCWSTR );
|
|
|
|
extern UINT MSI_RecordSetStreamA( MSIRECORD *, unsigned int, LPCSTR );
|
|
|
|
extern UINT MSI_RecordDataSize( MSIRECORD *, unsigned int );
|
2004-06-30 18:18:27 +00:00
|
|
|
|
|
|
|
/* stream internals */
|
2004-06-29 03:41:28 +00:00
|
|
|
extern UINT get_raw_stream( MSIHANDLE hdb, LPCWSTR stname, IStream **stm );
|
|
|
|
extern UINT db_get_raw_stream( MSIDATABASE *db, LPCWSTR stname, IStream **stm );
|
2004-06-29 03:57:39 +00:00
|
|
|
extern void enum_stream_names( IStorage *stg );
|
2004-06-29 03:41:28 +00:00
|
|
|
|
2004-07-09 22:25:34 +00:00
|
|
|
/* database internals */
|
|
|
|
extern UINT MSI_OpenDatabaseW( LPCWSTR, LPCWSTR, MSIDATABASE ** );
|
|
|
|
extern UINT MSI_DatabaseOpenViewW(MSIDATABASE *, LPCWSTR, MSIQUERY ** );
|
2005-01-21 16:19:11 +00:00
|
|
|
extern UINT MSI_OpenQuery( MSIDATABASE *, MSIQUERY **, LPCWSTR, ... );
|
2005-05-31 09:30:28 +00:00
|
|
|
typedef UINT (*record_func)( MSIRECORD *, LPVOID );
|
2005-02-02 09:55:51 +00:00
|
|
|
extern UINT MSI_IterateRecords( MSIQUERY *, DWORD *, record_func, LPVOID );
|
2005-06-02 10:29:28 +00:00
|
|
|
extern MSIRECORD *MSI_QueryGetRecord( MSIDATABASE *db, LPCWSTR query, ... );
|
2005-05-31 09:30:28 +00:00
|
|
|
extern UINT MSI_DatabaseImport( MSIDATABASE *, LPCWSTR, LPCWSTR );
|
|
|
|
extern UINT MSI_DatabaseExport( MSIDATABASE *, LPCWSTR, LPCWSTR, LPCWSTR );
|
|
|
|
extern UINT MSI_DatabaseGetPrimaryKeys( MSIDATABASE *, LPCWSTR, MSIRECORD ** );
|
2004-07-09 22:25:34 +00:00
|
|
|
|
|
|
|
/* view internals */
|
|
|
|
extern UINT MSI_ViewExecute( MSIQUERY*, MSIRECORD * );
|
|
|
|
extern UINT MSI_ViewFetch( MSIQUERY*, MSIRECORD ** );
|
|
|
|
extern UINT MSI_ViewClose( MSIQUERY* );
|
|
|
|
|
|
|
|
/* package internals */
|
2005-01-28 12:39:57 +00:00
|
|
|
extern MSIPACKAGE *MSI_CreatePackage( MSIDATABASE * );
|
|
|
|
extern UINT MSI_OpenPackageW( LPCWSTR szPackage, MSIPACKAGE ** );
|
|
|
|
extern UINT MSI_SetTargetPathW( MSIPACKAGE *, LPCWSTR, LPCWSTR );
|
2004-07-09 22:25:34 +00:00
|
|
|
extern UINT MSI_SetPropertyW( MSIPACKAGE *, LPCWSTR, LPCWSTR );
|
2005-01-28 12:39:57 +00:00
|
|
|
extern INT MSI_ProcessMessage( MSIPACKAGE *, INSTALLMESSAGE, MSIRECORD * );
|
|
|
|
extern UINT MSI_GetPropertyW( MSIPACKAGE *, LPCWSTR, LPWSTR, DWORD * );
|
2005-05-31 09:30:28 +00:00
|
|
|
extern UINT MSI_GetPropertyA(MSIPACKAGE *, LPCSTR, LPSTR, DWORD* );
|
2004-07-09 22:25:34 +00:00
|
|
|
extern MSICONDITION MSI_EvaluateConditionW( MSIPACKAGE *, LPCWSTR );
|
|
|
|
extern UINT MSI_SetPropertyW( MSIPACKAGE *, LPCWSTR, LPCWSTR );
|
2005-01-28 12:39:57 +00:00
|
|
|
extern UINT MSI_GetComponentStateW( MSIPACKAGE *, LPWSTR, INSTALLSTATE *, INSTALLSTATE * );
|
|
|
|
extern UINT MSI_GetFeatureStateW( MSIPACKAGE *, LPWSTR, INSTALLSTATE *, INSTALLSTATE * );
|
2005-05-13 13:56:39 +00:00
|
|
|
extern UINT WINAPI MSI_SetFeatureStateW(MSIPACKAGE*, LPCWSTR, INSTALLSTATE );
|
2004-07-09 22:25:34 +00:00
|
|
|
|
2005-01-25 20:17:09 +00:00
|
|
|
/* for deformating */
|
|
|
|
extern UINT MSI_FormatRecordW(MSIPACKAGE* package, MSIRECORD* record,
|
|
|
|
LPWSTR buffer, DWORD *size);
|
|
|
|
|
2004-07-09 22:25:34 +00:00
|
|
|
/* registry data encoding/decoding functions */
|
2005-01-28 12:39:57 +00:00
|
|
|
extern BOOL unsquash_guid(LPCWSTR in, LPWSTR out);
|
|
|
|
extern BOOL squash_guid(LPCWSTR in, LPWSTR out);
|
|
|
|
extern BOOL encode_base85_guid(GUID *,LPWSTR);
|
|
|
|
extern BOOL decode_base85_guid(LPCWSTR,GUID*);
|
|
|
|
extern UINT MSIREG_OpenUninstallKey(LPCWSTR szProduct, HKEY* key, BOOL create);
|
|
|
|
extern UINT MSIREG_OpenUserProductsKey(LPCWSTR szProduct, HKEY* key, BOOL create);
|
|
|
|
extern UINT MSIREG_OpenFeatures(HKEY* key);
|
|
|
|
extern UINT MSIREG_OpenFeaturesKey(LPCWSTR szProduct, HKEY* key, BOOL create);
|
|
|
|
extern UINT MSIREG_OpenComponents(HKEY* key);
|
2005-04-20 12:50:05 +00:00
|
|
|
extern UINT MSIREG_OpenUserComponentsKey(LPCWSTR szComponent, HKEY* key, BOOL create);
|
2005-01-28 12:39:57 +00:00
|
|
|
extern UINT MSIREG_OpenComponentsKey(LPCWSTR szComponent, HKEY* key, BOOL create);
|
|
|
|
extern UINT MSIREG_OpenProductsKey(LPCWSTR szProduct, HKEY* key, BOOL create);
|
|
|
|
extern UINT MSIREG_OpenUserFeaturesKey(LPCWSTR szProduct, HKEY* key, BOOL create);
|
2005-06-01 11:02:19 +00:00
|
|
|
extern UINT MSIREG_OpenUserComponentsKey(LPCWSTR szComponent, HKEY* key, BOOL create);
|
2005-03-10 17:24:05 +00:00
|
|
|
extern UINT MSIREG_OpenUpgradeCodesKey(LPCWSTR szProduct, HKEY* key, BOOL create);
|
2005-01-28 12:39:57 +00:00
|
|
|
|
|
|
|
/* msi dialog interface */
|
2005-02-02 09:55:51 +00:00
|
|
|
typedef VOID (*msi_dialog_event_handler)( MSIPACKAGE*, LPCWSTR, LPCWSTR, msi_dialog* );
|
|
|
|
extern msi_dialog *msi_dialog_create( MSIPACKAGE*, LPCWSTR, msi_dialog_event_handler );
|
|
|
|
extern UINT msi_dialog_run_message_loop( msi_dialog* );
|
|
|
|
extern void msi_dialog_end_dialog( msi_dialog* );
|
2005-04-27 10:16:57 +00:00
|
|
|
extern void msi_dialog_check_messages( HANDLE );
|
2005-02-02 09:55:51 +00:00
|
|
|
extern void msi_dialog_do_preview( msi_dialog* );
|
|
|
|
extern void msi_dialog_destroy( msi_dialog* );
|
2005-04-27 10:16:57 +00:00
|
|
|
extern BOOL msi_dialog_register_class( void );
|
2005-01-28 12:39:57 +00:00
|
|
|
extern void msi_dialog_unregister_class( void );
|
2004-07-04 00:26:54 +00:00
|
|
|
|
|
|
|
/* UI globals */
|
|
|
|
extern INSTALLUILEVEL gUILevel;
|
|
|
|
extern HWND gUIhwnd;
|
2005-01-24 12:55:31 +00:00
|
|
|
extern INSTALLUI_HANDLERA gUIHandlerA;
|
|
|
|
extern INSTALLUI_HANDLERW gUIHandlerW;
|
2004-07-04 00:31:17 +00:00
|
|
|
extern DWORD gUIFilter;
|
|
|
|
extern LPVOID gUIContext;
|
2004-07-09 19:26:30 +00:00
|
|
|
extern WCHAR gszLogFile[MAX_PATH];
|
2004-07-04 00:26:54 +00:00
|
|
|
|
2005-03-16 11:31:35 +00:00
|
|
|
inline static char *strdupWtoA( LPCWSTR str )
|
|
|
|
{
|
|
|
|
LPSTR ret = NULL;
|
|
|
|
if (str)
|
|
|
|
{
|
|
|
|
DWORD len = WideCharToMultiByte( CP_ACP, 0, str, -1, NULL, 0, NULL, NULL
|
|
|
|
);
|
|
|
|
if ((ret = HeapAlloc( GetProcessHeap(), 0, len )))
|
|
|
|
WideCharToMultiByte( CP_ACP, 0, str, -1, ret, len, NULL, NULL );
|
|
|
|
}
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
inline static LPWSTR strdupAtoW( LPCSTR str )
|
|
|
|
{
|
|
|
|
LPWSTR ret = NULL;
|
|
|
|
if (str)
|
|
|
|
{
|
|
|
|
DWORD len = MultiByteToWideChar( CP_ACP, 0, str, -1, NULL, 0 );
|
|
|
|
if ((ret = HeapAlloc( GetProcessHeap(), 0, len * sizeof(WCHAR) )))
|
|
|
|
MultiByteToWideChar( CP_ACP, 0, str, -1, ret, len );
|
|
|
|
}
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
inline static LPWSTR strdupW( LPCWSTR src )
|
|
|
|
{
|
|
|
|
LPWSTR dest;
|
|
|
|
if (!src) return NULL;
|
2005-06-01 11:02:19 +00:00
|
|
|
dest = HeapAlloc(GetProcessHeap(), 0, (lstrlenW(src)+1)*sizeof(WCHAR));
|
|
|
|
lstrcpyW(dest, src);
|
2005-03-16 11:31:35 +00:00
|
|
|
return dest;
|
|
|
|
}
|
|
|
|
|
2003-08-13 01:27:48 +00:00
|
|
|
#endif /* __WINE_MSI_PRIVATE__ */
|