2 * Implementation of the Microsoft Installer (msi.dll)
4 * Copyright 2002-2005 Mike McCormack for CodeWeavers
5 * Copyright 2005 Aric Stewart for CodeWeavers
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
22 #ifndef __WINE_MSI_PRIVATE__
23 #define __WINE_MSI_PRIVATE__
37 #include "wine/list.h"
38 #include "wine/debug.h"
40 #define MSI_DATASIZEMASK 0x00ff
41 #define MSITYPE_VALID 0x0100
42 #define MSITYPE_LOCALIZABLE 0x200
43 #define MSITYPE_STRING 0x0800
44 #define MSITYPE_NULLABLE 0x1000
45 #define MSITYPE_KEY 0x2000
46 #define MSITYPE_TEMPORARY 0x4000
48 #define MAX_STREAM_NAME_LEN 62
50 /* Install UI level mask for AND operation to exclude flags */
51 #define INSTALLUILEVEL_MASK 0x0007
53 #define MSITYPE_IS_BINARY(type) (((type) & ~MSITYPE_NULLABLE) == (MSITYPE_STRING|MSITYPE_VALID))
56 typedef struct tagMSITABLE MSITABLE
;
59 typedef struct string_table string_table
;
61 struct tagMSIOBJECTHDR
;
62 typedef struct tagMSIOBJECTHDR MSIOBJECTHDR
;
64 typedef VOID (*msihandledestructor
)( MSIOBJECTHDR
* );
66 struct tagMSIOBJECTHDR
71 msihandledestructor destructor
;
74 typedef struct tagMSIDATABASE
78 string_table
*strings
;
79 UINT bytes_per_strref
;
85 struct list transforms
;
89 typedef struct tagMSIVIEW MSIVIEW
;
91 typedef struct tagMSIQUERY
100 /* maybe we can use a Variant instead of doing it ourselves? */
101 typedef struct tagMSIFIELD
113 typedef struct tagMSIRECORD
116 UINT count
; /* as passed to MsiCreateRecord */
117 MSIFIELD fields
[1]; /* nb. array size is count+1 */
120 typedef struct tagMSISOURCELISTINFO
129 typedef struct tagMSIMEDIADISK
139 typedef struct tagMSIMEDIAINFO
150 WCHAR sourcedir
[MAX_PATH
];
153 typedef struct tagMSIPATCHINFO
162 typedef struct _column_info
169 struct _column_info
*next
;
172 typedef const struct tagMSICOLUMNHASHENTRY
*MSIITERHANDLE
;
174 typedef struct tagMSIVIEWOPS
177 * fetch_int - reads one integer from {row,col} in the table
179 * This function should be called after the execute method.
180 * Data returned by the function should not change until
181 * close or delete is called.
182 * To get a string value, query the database's string table with
183 * the integer value returned from this function.
185 UINT (*fetch_int
)( struct tagMSIVIEW
*view
, UINT row
, UINT col
, UINT
*val
);
188 * fetch_stream - gets a stream from {row,col} in the table
190 * This function is similar to fetch_int, except fetches a
191 * stream instead of an integer.
193 UINT (*fetch_stream
)( struct tagMSIVIEW
*view
, UINT row
, UINT col
, IStream
**stm
);
196 * get_row - gets values from a row
199 UINT (*get_row
)( struct tagMSIVIEW
*view
, UINT row
, MSIRECORD
**rec
);
202 * set_row - sets values in a row as specified by mask
204 * Similar semantics to fetch_int
206 UINT (*set_row
)( struct tagMSIVIEW
*view
, UINT row
, MSIRECORD
*rec
, UINT mask
);
209 * Inserts a new row into the database from the records contents
211 UINT (*insert_row
)( struct tagMSIVIEW
*view
, MSIRECORD
*record
, UINT row
, BOOL temporary
);
214 * Deletes a row from the database
216 UINT (*delete_row
)( struct tagMSIVIEW
*view
, UINT row
);
219 * execute - loads the underlying data into memory so it can be read
221 UINT (*execute
)( struct tagMSIVIEW
*view
, MSIRECORD
*record
);
224 * close - clears the data read by execute from memory
226 UINT (*close
)( struct tagMSIVIEW
*view
);
229 * get_dimensions - returns the number of rows or columns in a table.
231 * The number of rows can only be queried after the execute method
232 * is called. The number of columns can be queried at any time.
234 UINT (*get_dimensions
)( struct tagMSIVIEW
*view
, UINT
*rows
, UINT
*cols
);
237 * get_column_info - returns the name and type of a specific column
239 * The name and tablename is HeapAlloc'ed by this function and should be
240 * freed by the caller.
241 * The column information can be queried at any time.
243 UINT (*get_column_info
)( struct tagMSIVIEW
*view
, UINT n
, LPWSTR
*name
, UINT
*type
, BOOL
*temporary
, LPWSTR
*tableName
);
246 * modify - not yet implemented properly
248 UINT (*modify
)( struct tagMSIVIEW
*view
, MSIMODIFY eModifyMode
, MSIRECORD
*record
, UINT row
);
251 * delete - destroys the structure completely
253 UINT (*delete)( struct tagMSIVIEW
* );
256 * find_matching_rows - iterates through rows that match a value
258 * If the column type is a string then a string ID should be passed in.
259 * If the value to be looked up is an integer then no transformation of
260 * the input value is required, except if the column is a string, in which
261 * case a string ID should be passed in.
262 * The handle is an input/output parameter that keeps track of the current
263 * position in the iteration. It must be initialised to zero before the
264 * first call and continued to be passed in to subsequent calls.
266 UINT (*find_matching_rows
)( struct tagMSIVIEW
*view
, UINT col
, UINT val
, UINT
*row
, MSIITERHANDLE
*handle
);
269 * add_ref - increases the reference count of the table
271 UINT (*add_ref
)( struct tagMSIVIEW
*view
);
274 * release - decreases the reference count of the table
276 UINT (*release
)( struct tagMSIVIEW
*view
);
279 * add_column - adds a column to the table
281 UINT (*add_column
)( struct tagMSIVIEW
*view
, LPCWSTR table
, UINT number
, LPCWSTR column
, UINT type
, BOOL hold
);
284 * remove_column - removes the column represented by table name and column number from the table
286 UINT (*remove_column
)( struct tagMSIVIEW
*view
, LPCWSTR table
, UINT number
);
289 * sort - orders the table by columns
291 UINT (*sort
)( struct tagMSIVIEW
*view
, column_info
*columns
);
294 * drop - drops the table from the database
296 UINT (*drop
)( struct tagMSIVIEW
*view
);
302 const MSIVIEWOPS
*ops
;
305 struct msi_dialog_tag
;
306 typedef struct msi_dialog_tag msi_dialog
;
315 typedef struct tagMSIPACKAGE
320 enum platform platform
;
324 struct list components
;
325 struct list features
;
327 struct list tempfiles
;
333 struct list extensions
;
338 struct tagMSISCRIPT
*script
;
340 struct list RunningActions
;
346 UINT CurrentInstallState
;
355 struct list subscriptions
;
357 struct list sourcelist_info
;
358 struct list sourcelist_media
;
360 unsigned char scheduled_action_running
: 1;
361 unsigned char commit_action_running
: 1;
362 unsigned char rollback_action_running
: 1;
363 unsigned char need_reboot
: 1;
366 typedef struct tagMSIPREVIEW
373 #define MSI_MAX_PROPS 20
375 typedef struct tagMSISUMMARYINFO
380 PROPVARIANT property
[MSI_MAX_PROPS
];
383 typedef struct tagMSIFEATURE
387 LPWSTR Feature_Parent
;
394 INSTALLSTATE Installed
;
395 INSTALLSTATE ActionRequest
;
397 struct list Children
;
398 struct list Components
;
401 typedef struct tagMSICOMPONENT
410 INSTALLSTATE Installed
;
411 INSTALLSTATE ActionRequest
;
413 BOOL ForceLocalState
;
418 LPWSTR AdvertiseString
;
420 unsigned int anyAbsent
:1;
421 unsigned int hasAdvertiseFeature
:1;
422 unsigned int hasLocalFeature
:1;
423 unsigned int hasSourceFeature
:1;
426 typedef struct tagComponentList
429 MSICOMPONENT
*component
;
432 typedef struct tagFeatureList
438 typedef struct tagMSIFOLDER
443 LPWSTR TargetDefault
;
444 LPWSTR SourceLongPath
;
445 LPWSTR SourceShortPath
;
447 LPWSTR ResolvedTarget
;
448 LPWSTR ResolvedSource
;
449 LPWSTR Property
; /* initially set property */
451 /* 0 = uninitialized */
453 /* 2 = created remove if empty */
454 /* 3 = created persist if empty */
459 typedef enum _msi_file_state
{
468 typedef struct tagMSIFILE
472 MSICOMPONENT
*Component
;
481 msi_file_state state
;
484 MSIFILEHASHINFO hash
;
488 typedef struct tagMSITEMPFILE
494 typedef struct tagMSIAPPID
497 LPWSTR AppID
; /* Primary key */
498 LPWSTR RemoteServerName
;
500 LPWSTR ServiceParameters
;
502 BOOL ActivateAtStorage
;
503 BOOL RunAsInteractiveUser
;
506 typedef struct tagMSIPROGID MSIPROGID
;
508 typedef struct tagMSICLASS
511 LPWSTR clsid
; /* Primary Key */
512 LPWSTR Context
; /* Primary Key */
513 MSICOMPONENT
*Component
;
520 LPWSTR DefInprocHandler
;
521 LPWSTR DefInprocHandler32
;
525 /* not in the table, set during installation */
529 typedef struct tagMSIMIME MSIMIME
;
531 typedef struct tagMSIEXTENSION
534 LPWSTR Extension
; /* Primary Key */
535 MSICOMPONENT
*Component
;
540 /* not in the table, set during installation */
548 LPWSTR ProgID
; /* Primary Key */
553 /* not in the table, set during installation */
556 MSIPROGID
*VersionInd
;
559 typedef struct tagMSIVERB
571 LPWSTR ContentType
; /* Primary Key */
572 MSIEXTENSION
*Extension
;
576 /* not in the table, set during installation */
587 #define SEQUENCE_UI 0x1
588 #define SEQUENCE_EXEC 0x2
589 #define SEQUENCE_INSTALL 0x10
591 typedef struct tagMSISCRIPT
593 LPWSTR
*Actions
[TOTAL_SCRIPTS
];
594 UINT ActionCount
[TOTAL_SCRIPTS
];
595 BOOL ExecuteSequenceRun
;
596 BOOL CurrentlyScripting
;
598 LPWSTR
*UniqueActions
;
599 UINT UniqueActionsCount
;
602 #define MSIHANDLETYPE_ANY 0
603 #define MSIHANDLETYPE_DATABASE 1
604 #define MSIHANDLETYPE_SUMMARYINFO 2
605 #define MSIHANDLETYPE_VIEW 3
606 #define MSIHANDLETYPE_RECORD 4
607 #define MSIHANDLETYPE_PACKAGE 5
608 #define MSIHANDLETYPE_PREVIEW 6
610 #define MSI_MAJORVERSION 4
611 #define MSI_MINORVERSION 5
612 #define MSI_BUILDNUMBER 6001
615 #define SQUISH_GUID_SIZE 33
617 #define MSIHANDLE_MAGIC 0x4d434923
619 DEFINE_GUID(CLSID_IMsiServer
, 0x000C101C,0x0000,0x0000,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x46);
620 DEFINE_GUID(CLSID_IMsiServerX1
, 0x000C103E,0x0000,0x0000,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x46);
621 DEFINE_GUID(CLSID_IMsiServerX2
, 0x000C1090,0x0000,0x0000,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x46);
622 DEFINE_GUID(CLSID_IMsiServerX3
, 0x000C1094,0x0000,0x0000,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x46);
624 DEFINE_GUID(CLSID_IMsiServerMessage
, 0x000C101D,0x0000,0x0000,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x46);
626 DEFINE_GUID(CLSID_IWineMsiRemoteCustomAction
,0xBA26E6FA,0x4F27,0x4f56,0x95,0x3A,0x3F,0x90,0x27,0x20,0x18,0xAA);
627 DEFINE_GUID(CLSID_IWineMsiRemotePackage
,0x902b3592,0x9d08,0x4dfd,0xa5,0x93,0xd0,0x7c,0x52,0x54,0x64,0x21);
629 DEFINE_GUID(CLSID_MsiTransform
, 0x000c1082,0x0000,0x0000,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x46);
630 DEFINE_GUID(CLSID_MsiDatabase
, 0x000c1084,0x0000,0x0000,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x46);
631 DEFINE_GUID(CLSID_MsiPatch
, 0x000c1086,0x0000,0x0000,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x46);
633 /* handle unicode/ascii output in the Msi* API functions */
650 UINT
msi_strcpy_to_awstring( LPCWSTR str
, awstring
*awbuf
, DWORD
*sz
);
652 /* msi server interface */
653 extern ITypeLib
*get_msi_typelib( LPWSTR
*path
);
654 extern HRESULT
create_msi_custom_remote( IUnknown
*pOuter
, LPVOID
*ppObj
);
655 extern HRESULT
create_msi_remote_package( IUnknown
*pOuter
, LPVOID
*ppObj
);
656 extern HRESULT
create_msi_remote_database( IUnknown
*pOuter
, LPVOID
*ppObj
);
657 extern IUnknown
*msi_get_remote(MSIHANDLE handle
);
659 /* handle functions */
660 extern void *msihandle2msiinfo(MSIHANDLE handle
, UINT type
);
661 extern MSIHANDLE
alloc_msihandle( MSIOBJECTHDR
* );
662 extern MSIHANDLE
alloc_msi_remote_handle( IUnknown
*unk
);
663 extern void *alloc_msiobject(UINT type
, UINT size
, msihandledestructor destroy
);
664 extern void msiobj_addref(MSIOBJECTHDR
*);
665 extern int msiobj_release(MSIOBJECTHDR
*);
666 extern void msiobj_lock(MSIOBJECTHDR
*);
667 extern void msiobj_unlock(MSIOBJECTHDR
*);
668 extern void msi_free_handle_table(void);
670 extern void free_cached_tables( MSIDATABASE
*db
);
671 extern UINT
MSI_CommitTables( MSIDATABASE
*db
);
674 /* string table functions */
675 enum StringPersistence
677 StringPersistent
= 0,
678 StringNonPersistent
= 1
681 extern BOOL
msi_addstringW( string_table
*st
, const WCHAR
*data
, int len
, USHORT refcount
, enum StringPersistence persistence
);
682 extern UINT
msi_string2idW( const string_table
*st
, LPCWSTR buffer
, UINT
*id
);
683 extern VOID
msi_destroy_stringtable( string_table
*st
);
684 extern const WCHAR
*msi_string_lookup_id( const string_table
*st
, UINT id
);
685 extern HRESULT
msi_init_string_table( IStorage
*stg
);
686 extern string_table
*msi_load_string_table( IStorage
*stg
, UINT
*bytes_per_strref
);
687 extern UINT
msi_save_string_table( const string_table
*st
, IStorage
*storage
);
689 extern BOOL
TABLE_Exists( MSIDATABASE
*db
, LPCWSTR name
);
690 extern MSICONDITION
MSI_DatabaseIsTablePersistent( MSIDATABASE
*db
, LPCWSTR table
);
692 extern UINT
read_stream_data( IStorage
*stg
, LPCWSTR stname
, BOOL table
,
693 BYTE
**pdata
, UINT
*psz
);
694 extern UINT
write_stream_data( IStorage
*stg
, LPCWSTR stname
,
695 LPCVOID data
, UINT sz
, BOOL bTable
);
697 /* transform functions */
698 extern UINT
msi_table_apply_transform( MSIDATABASE
*db
, IStorage
*stg
);
699 extern UINT
MSI_DatabaseApplyTransformW( MSIDATABASE
*db
,
700 LPCWSTR szTransformFile
, int iErrorCond
);
701 extern void append_storage_to_db( MSIDATABASE
*db
, IStorage
*stg
);
703 /* patch functions */
704 extern UINT
msi_check_patch_applicable( MSIPACKAGE
*package
, MSISUMMARYINFO
*si
);
705 extern UINT
msi_parse_patch_summary( MSISUMMARYINFO
*si
, MSIPATCHINFO
**patch
);
706 extern UINT
msi_apply_patch_db( MSIPACKAGE
*package
, MSIDATABASE
*patch_db
, MSIPATCHINFO
*patch
);
708 /* action internals */
709 extern UINT
MSI_InstallPackage( MSIPACKAGE
*, LPCWSTR
, LPCWSTR
);
710 extern UINT
ACTION_DialogBox( MSIPACKAGE
*, LPCWSTR
);
711 extern UINT
ACTION_ForceReboot(MSIPACKAGE
*package
);
712 extern UINT
MSI_Sequence( MSIPACKAGE
*package
, LPCWSTR szTable
, INT iSequenceMode
);
713 extern UINT
MSI_SetFeatureStates( MSIPACKAGE
*package
);
714 extern UINT
msi_parse_command_line( MSIPACKAGE
*package
, LPCWSTR szCommandLine
,
715 BOOL preserve_case
);
717 /* record internals */
718 extern void MSI_CloseRecord( MSIOBJECTHDR
* );
719 extern UINT
MSI_RecordSetIStream( MSIRECORD
*, UINT
, IStream
*);
720 extern UINT
MSI_RecordGetIStream( MSIRECORD
*, UINT
, IStream
**);
721 extern const WCHAR
*MSI_RecordGetString( const MSIRECORD
*, UINT
);
722 extern MSIRECORD
*MSI_CreateRecord( UINT
);
723 extern UINT
MSI_RecordSetInteger( MSIRECORD
*, UINT
, int );
724 extern UINT
MSI_RecordSetIntPtr( MSIRECORD
*, UINT
, INT_PTR
);
725 extern UINT
MSI_RecordSetStringW( MSIRECORD
*, UINT
, LPCWSTR
);
726 extern BOOL
MSI_RecordIsNull( MSIRECORD
*, UINT
);
727 extern UINT
MSI_RecordGetStringW( MSIRECORD
* , UINT
, LPWSTR
, LPDWORD
);
728 extern UINT
MSI_RecordGetStringA( MSIRECORD
*, UINT
, LPSTR
, LPDWORD
);
729 extern int MSI_RecordGetInteger( MSIRECORD
*, UINT
);
730 extern INT_PTR
MSI_RecordGetIntPtr( MSIRECORD
*, UINT
);
731 extern UINT
MSI_RecordReadStream( MSIRECORD
*, UINT
, char *, LPDWORD
);
732 extern UINT
MSI_RecordSetStream(MSIRECORD
*, UINT
, IStream
*);
733 extern UINT
MSI_RecordGetFieldCount( const MSIRECORD
*rec
);
734 extern UINT
MSI_RecordStreamToFile( MSIRECORD
*, UINT
, LPCWSTR
);
735 extern UINT
MSI_RecordSetStreamFromFileW( MSIRECORD
*, UINT
, LPCWSTR
);
736 extern UINT
MSI_RecordCopyField( MSIRECORD
*, UINT
, MSIRECORD
*, UINT
);
737 extern MSIRECORD
*MSI_CloneRecord( MSIRECORD
* );
738 extern BOOL
MSI_RecordsAreEqual( MSIRECORD
*, MSIRECORD
* );
740 /* stream internals */
741 extern void enum_stream_names( IStorage
*stg
);
742 extern LPWSTR
encode_streamname(BOOL bTable
, LPCWSTR in
);
743 extern BOOL
decode_streamname(LPCWSTR in
, LPWSTR out
);
745 /* database internals */
746 extern UINT
db_get_raw_stream( MSIDATABASE
*, LPCWSTR
, IStream
** );
747 void db_destroy_stream( MSIDATABASE
*, LPCWSTR
);
748 extern UINT
MSI_OpenDatabaseW( LPCWSTR
, LPCWSTR
, MSIDATABASE
** );
749 extern UINT
MSI_DatabaseOpenViewW(MSIDATABASE
*, LPCWSTR
, MSIQUERY
** );
750 extern UINT
MSI_OpenQuery( MSIDATABASE
*, MSIQUERY
**, LPCWSTR
, ... );
751 typedef UINT (*record_func
)( MSIRECORD
*, LPVOID
);
752 extern UINT
MSI_IterateRecords( MSIQUERY
*, LPDWORD
, record_func
, LPVOID
);
753 extern MSIRECORD
*MSI_QueryGetRecord( MSIDATABASE
*db
, LPCWSTR query
, ... );
754 extern UINT
MSI_DatabaseGetPrimaryKeys( MSIDATABASE
*, LPCWSTR
, MSIRECORD
** );
757 extern UINT
MSI_ViewExecute( MSIQUERY
*, MSIRECORD
* );
758 extern UINT
MSI_ViewFetch( MSIQUERY
*, MSIRECORD
** );
759 extern UINT
MSI_ViewClose( MSIQUERY
* );
760 extern UINT
MSI_ViewGetColumnInfo(MSIQUERY
*, MSICOLINFO
, MSIRECORD
**);
761 extern UINT
MSI_ViewModify( MSIQUERY
*, MSIMODIFY
, MSIRECORD
* );
762 extern UINT
VIEW_find_column( MSIVIEW
*, LPCWSTR
, LPCWSTR
, UINT
* );
763 extern UINT
msi_view_get_row(MSIDATABASE
*, MSIVIEW
*, UINT
, MSIRECORD
**);
765 /* install internals */
766 extern UINT
MSI_SetInstallLevel( MSIPACKAGE
*package
, int iInstallLevel
);
768 /* package internals */
769 extern MSIPACKAGE
*MSI_CreatePackage( MSIDATABASE
*, LPCWSTR
);
770 extern UINT
MSI_OpenPackageW( LPCWSTR szPackage
, MSIPACKAGE
**pPackage
);
771 extern UINT
MSI_SetTargetPathW( MSIPACKAGE
*, LPCWSTR
, LPCWSTR
);
772 extern INT
MSI_ProcessMessage( MSIPACKAGE
*, INSTALLMESSAGE
, MSIRECORD
* );
773 extern MSICONDITION
MSI_EvaluateConditionW( MSIPACKAGE
*, LPCWSTR
);
774 extern UINT
MSI_GetComponentStateW( MSIPACKAGE
*, LPCWSTR
, INSTALLSTATE
*, INSTALLSTATE
* );
775 extern UINT
MSI_GetFeatureStateW( MSIPACKAGE
*, LPCWSTR
, INSTALLSTATE
*, INSTALLSTATE
* );
776 extern UINT WINAPI
MSI_SetFeatureStateW(MSIPACKAGE
*, LPCWSTR
, INSTALLSTATE
);
777 extern UINT
msi_download_file( LPCWSTR szUrl
, LPWSTR filename
);
778 extern UINT
msi_package_add_info(MSIPACKAGE
*, DWORD
, DWORD
, LPCWSTR
, LPWSTR
);
779 extern UINT
msi_package_add_media_disk(MSIPACKAGE
*, DWORD
, DWORD
, DWORD
, LPWSTR
, LPWSTR
);
780 extern UINT
msi_clone_properties(MSIPACKAGE
*);
781 extern UINT
msi_set_context(MSIPACKAGE
*);
782 extern void msi_adjust_privilege_properties(MSIPACKAGE
*);
783 extern UINT
MSI_GetFeatureCost(MSIPACKAGE
*, MSIFEATURE
*, MSICOSTTREE
, INSTALLSTATE
, LPINT
);
785 /* for deformating */
786 extern UINT
MSI_FormatRecordW( MSIPACKAGE
*, MSIRECORD
*, LPWSTR
, LPDWORD
);
788 /* registry data encoding/decoding functions */
789 extern BOOL
unsquash_guid(LPCWSTR in
, LPWSTR out
);
790 extern BOOL
squash_guid(LPCWSTR in
, LPWSTR out
);
791 extern BOOL
encode_base85_guid(GUID
*,LPWSTR
);
792 extern BOOL
decode_base85_guid(LPCWSTR
,GUID
*);
793 extern UINT
MSIREG_OpenUninstallKey(MSIPACKAGE
*package
, HKEY
*key
, BOOL create
);
794 extern UINT
MSIREG_DeleteUninstallKey(MSIPACKAGE
*package
);
795 extern UINT
MSIREG_OpenProductKey(LPCWSTR szProduct
, LPCWSTR szUserSid
,
796 MSIINSTALLCONTEXT context
, HKEY
* key
, BOOL create
);
797 extern UINT
MSIREG_OpenFeaturesKey(LPCWSTR szProduct
, MSIINSTALLCONTEXT context
,
798 HKEY
*key
, BOOL create
);
799 extern UINT
MSIREG_OpenUserPatchesKey(LPCWSTR szPatch
, HKEY
* key
, BOOL create
);
800 UINT
MSIREG_OpenUserDataFeaturesKey(LPCWSTR szProduct
, MSIINSTALLCONTEXT context
,
801 HKEY
*key
, BOOL create
);
802 extern UINT
MSIREG_OpenUserComponentsKey(LPCWSTR szComponent
, HKEY
* key
, BOOL create
);
803 extern UINT
MSIREG_OpenUserDataComponentKey(LPCWSTR szComponent
, LPCWSTR szUserSid
,
804 HKEY
*key
, BOOL create
);
805 extern UINT
MSIREG_OpenPatchesKey(LPCWSTR szPatch
, HKEY
* key
, BOOL create
);
806 extern UINT
MSIREG_OpenUserDataProductKey(LPCWSTR szProduct
, MSIINSTALLCONTEXT dwContext
,
807 LPCWSTR szUserSid
, HKEY
*key
, BOOL create
);
808 extern UINT
MSIREG_OpenUserDataPatchKey(LPCWSTR szPatch
, MSIINSTALLCONTEXT dwContext
,
809 HKEY
*key
, BOOL create
);
810 extern UINT
MSIREG_OpenUserDataProductPatchesKey(LPCWSTR product
, MSIINSTALLCONTEXT context
,
811 HKEY
*key
, BOOL create
);
812 extern UINT
MSIREG_OpenInstallProps(LPCWSTR szProduct
, MSIINSTALLCONTEXT dwContext
,
813 LPCWSTR szUserSid
, HKEY
*key
, BOOL create
);
814 extern UINT
MSIREG_OpenUpgradeCodesKey(LPCWSTR szProduct
, HKEY
* key
, BOOL create
);
815 extern UINT
MSIREG_OpenUserUpgradeCodesKey(LPCWSTR szProduct
, HKEY
* key
, BOOL create
);
816 extern UINT
MSIREG_DeleteProductKey(LPCWSTR szProduct
);
817 extern UINT
MSIREG_DeleteUserProductKey(LPCWSTR szProduct
);
818 extern UINT
MSIREG_DeleteUserDataPatchKey(LPCWSTR patch
, MSIINSTALLCONTEXT context
);
819 extern UINT
MSIREG_DeleteUserDataProductKey(LPCWSTR szProduct
);
820 extern UINT
MSIREG_DeleteUserFeaturesKey(LPCWSTR szProduct
);
821 extern UINT
MSIREG_DeleteUserDataComponentKey(LPCWSTR szComponent
, LPCWSTR szUserSid
);
822 extern UINT
MSIREG_DeleteUserUpgradeCodesKey(LPCWSTR szUpgradeCode
);
823 extern UINT
MSIREG_OpenClassesUpgradeCodesKey(LPCWSTR szUpgradeCode
, HKEY
* key
, BOOL create
);
824 extern UINT
MSIREG_DeleteLocalClassesProductKey(LPCWSTR szProductCode
);
825 extern UINT
MSIREG_DeleteLocalClassesFeaturesKey(LPCWSTR szProductCode
);
827 extern LPWSTR
msi_reg_get_val_str( HKEY hkey
, LPCWSTR name
);
828 extern BOOL
msi_reg_get_val_dword( HKEY hkey
, LPCWSTR name
, DWORD
*val
);
830 extern DWORD
msi_version_str_to_dword(LPCWSTR p
);
831 extern void msi_parse_version_string(LPCWSTR
, PDWORD
, PDWORD
);
832 extern VS_FIXEDFILEINFO
*msi_get_disk_file_version(LPCWSTR
);
833 extern int msi_compare_file_versions(VS_FIXEDFILEINFO
*, const WCHAR
*);
836 extern LONG
msi_reg_set_val_str( HKEY hkey
, LPCWSTR name
, LPCWSTR value
);
837 extern LONG
msi_reg_set_val_multi_str( HKEY hkey
, LPCWSTR name
, LPCWSTR value
);
838 extern LONG
msi_reg_set_val_dword( HKEY hkey
, LPCWSTR name
, DWORD val
);
839 extern LONG
msi_reg_set_subkey_val( HKEY hkey
, LPCWSTR path
, LPCWSTR name
, LPCWSTR val
);
841 /* msi dialog interface */
842 typedef UINT (*msi_dialog_event_handler
)( MSIPACKAGE
*, LPCWSTR
, LPCWSTR
, msi_dialog
* );
843 extern msi_dialog
*msi_dialog_create( MSIPACKAGE
*, LPCWSTR
, msi_dialog
*, msi_dialog_event_handler
);
844 extern UINT
msi_dialog_run_message_loop( msi_dialog
* );
845 extern void msi_dialog_end_dialog( msi_dialog
* );
846 extern void msi_dialog_check_messages( HANDLE
);
847 extern void msi_dialog_do_preview( msi_dialog
* );
848 extern void msi_dialog_destroy( msi_dialog
* );
849 extern void msi_dialog_unregister_class( void );
850 extern void msi_dialog_handle_event( msi_dialog
*, LPCWSTR
, LPCWSTR
, MSIRECORD
* );
851 extern UINT
msi_dialog_reset( msi_dialog
*dialog
);
852 extern UINT
msi_dialog_directorylist_up( msi_dialog
*dialog
);
853 extern msi_dialog
*msi_dialog_get_parent( msi_dialog
*dialog
);
854 extern LPWSTR
msi_dialog_get_name( msi_dialog
*dialog
);
855 extern UINT
msi_spawn_error_dialog( MSIPACKAGE
*, LPWSTR
, LPWSTR
);
857 /* summary information */
858 extern MSISUMMARYINFO
*MSI_GetSummaryInformationW( IStorage
*stg
, UINT uiUpdateCount
);
859 extern LPWSTR
msi_suminfo_dup_string( MSISUMMARYINFO
*si
, UINT uiProperty
);
860 extern INT
msi_suminfo_get_int32( MSISUMMARYINFO
*si
, UINT uiProperty
);
861 extern LPWSTR
msi_get_suminfo_product( IStorage
*stg
);
862 extern UINT
msi_add_suminfo( MSIDATABASE
*db
, LPWSTR
**records
, int num_records
, int num_columns
);
864 /* undocumented functions */
865 UINT WINAPI
MsiCreateAndVerifyInstallerDirectory( DWORD
);
866 UINT WINAPI
MsiDecomposeDescriptorW( LPCWSTR
, LPWSTR
, LPWSTR
, LPWSTR
, LPDWORD
);
867 UINT WINAPI
MsiDecomposeDescriptorA( LPCSTR
, LPSTR
, LPSTR
, LPSTR
, LPDWORD
);
868 LANGID WINAPI
MsiLoadStringW( MSIHANDLE
, UINT
, LPWSTR
, int, LANGID
);
869 LANGID WINAPI
MsiLoadStringA( MSIHANDLE
, UINT
, LPSTR
, int, LANGID
);
872 extern INSTALLUILEVEL gUILevel
;
874 extern INSTALLUI_HANDLERA gUIHandlerA
;
875 extern INSTALLUI_HANDLERW gUIHandlerW
;
876 extern INSTALLUI_HANDLER_RECORD gUIHandlerRecord
;
877 extern DWORD gUIFilter
;
878 extern LPVOID gUIContext
;
879 extern WCHAR gszLogFile
[MAX_PATH
];
880 extern HINSTANCE msi_hInstance
;
882 /* action related functions */
883 extern UINT
ACTION_PerformAction(MSIPACKAGE
*package
, const WCHAR
*action
, UINT script
);
884 extern UINT
ACTION_PerformUIAction(MSIPACKAGE
*package
, const WCHAR
*action
, UINT script
);
885 extern void ACTION_FinishCustomActions( const MSIPACKAGE
* package
);
886 extern UINT
ACTION_CustomAction(MSIPACKAGE
*package
,const WCHAR
*action
, UINT script
, BOOL execute
);
888 static inline void msi_feature_set_state(MSIPACKAGE
*package
,
892 if (!package
->ProductCode
)
894 feature
->ActionRequest
= state
;
895 feature
->Action
= state
;
897 else if (state
== INSTALLSTATE_ABSENT
)
899 switch (feature
->Installed
)
901 case INSTALLSTATE_ABSENT
:
902 feature
->ActionRequest
= INSTALLSTATE_UNKNOWN
;
903 feature
->Action
= INSTALLSTATE_UNKNOWN
;
906 feature
->ActionRequest
= state
;
907 feature
->Action
= state
;
910 else if (state
== INSTALLSTATE_SOURCE
)
912 switch (feature
->Installed
)
914 case INSTALLSTATE_ABSENT
:
915 case INSTALLSTATE_SOURCE
:
916 feature
->ActionRequest
= state
;
917 feature
->Action
= state
;
919 case INSTALLSTATE_LOCAL
:
920 feature
->ActionRequest
= INSTALLSTATE_LOCAL
;
921 feature
->Action
= INSTALLSTATE_LOCAL
;
924 feature
->ActionRequest
= INSTALLSTATE_UNKNOWN
;
925 feature
->Action
= INSTALLSTATE_UNKNOWN
;
930 feature
->ActionRequest
= state
;
931 feature
->Action
= state
;
933 if (feature
->Attributes
& msidbFeatureAttributesUIDisallowAbsent
)
935 feature
->Action
= INSTALLSTATE_UNKNOWN
;
939 static inline void msi_component_set_state(MSIPACKAGE
*package
,
943 if (!package
->ProductCode
)
945 comp
->ActionRequest
= state
;
946 comp
->Action
= state
;
948 else if (state
== INSTALLSTATE_ABSENT
)
950 switch (comp
->Installed
)
952 case INSTALLSTATE_LOCAL
:
953 case INSTALLSTATE_SOURCE
:
954 case INSTALLSTATE_DEFAULT
:
955 comp
->ActionRequest
= state
;
956 comp
->Action
= state
;
959 comp
->ActionRequest
= INSTALLSTATE_UNKNOWN
;
960 comp
->Action
= INSTALLSTATE_UNKNOWN
;
963 else if (state
== INSTALLSTATE_SOURCE
)
965 if (comp
->Installed
== INSTALLSTATE_ABSENT
||
966 (comp
->Installed
== INSTALLSTATE_SOURCE
&& comp
->hasLocalFeature
))
968 comp
->ActionRequest
= state
;
969 comp
->Action
= state
;
973 comp
->ActionRequest
= INSTALLSTATE_UNKNOWN
;
974 comp
->Action
= INSTALLSTATE_UNKNOWN
;
979 comp
->ActionRequest
= state
;
980 comp
->Action
= state
;
984 /* actions in other modules */
985 extern UINT
ACTION_AppSearch(MSIPACKAGE
*package
);
986 extern UINT
ACTION_CCPSearch(MSIPACKAGE
*package
);
987 extern UINT
ACTION_FindRelatedProducts(MSIPACKAGE
*package
);
988 extern UINT
ACTION_InstallFiles(MSIPACKAGE
*package
);
989 extern UINT
ACTION_RemoveFiles(MSIPACKAGE
*package
);
990 extern UINT
ACTION_MoveFiles(MSIPACKAGE
*package
);
991 extern UINT
ACTION_DuplicateFiles(MSIPACKAGE
*package
);
992 extern UINT
ACTION_RemoveDuplicateFiles(MSIPACKAGE
*package
);
993 extern UINT
ACTION_RegisterClassInfo(MSIPACKAGE
*package
);
994 extern UINT
ACTION_RegisterProgIdInfo(MSIPACKAGE
*package
);
995 extern UINT
ACTION_RegisterExtensionInfo(MSIPACKAGE
*package
);
996 extern UINT
ACTION_RegisterMIMEInfo(MSIPACKAGE
*package
);
997 extern UINT
ACTION_RegisterFonts(MSIPACKAGE
*package
);
998 extern UINT
ACTION_UnregisterClassInfo(MSIPACKAGE
*package
);
999 extern UINT
ACTION_UnregisterExtensionInfo(MSIPACKAGE
*package
);
1000 extern UINT
ACTION_UnregisterFonts(MSIPACKAGE
*package
);
1001 extern UINT
ACTION_UnregisterMIMEInfo(MSIPACKAGE
*package
);
1002 extern UINT
ACTION_UnregisterProgIdInfo(MSIPACKAGE
*package
);
1005 extern DWORD
deformat_string(MSIPACKAGE
*package
, LPCWSTR ptr
, WCHAR
** data
);
1006 extern LPWSTR
msi_dup_record_field(MSIRECORD
*row
, INT index
);
1007 extern LPWSTR
msi_dup_property( MSIDATABASE
*db
, LPCWSTR prop
);
1008 extern UINT
msi_set_property( MSIDATABASE
*, LPCWSTR
, LPCWSTR
);
1009 extern UINT
msi_get_property( MSIDATABASE
*, LPCWSTR
, LPWSTR
, LPDWORD
);
1010 extern int msi_get_property_int( MSIDATABASE
*package
, LPCWSTR prop
, int def
);
1011 extern LPWSTR
resolve_folder(MSIPACKAGE
*package
, LPCWSTR name
, BOOL source
,
1012 BOOL set_prop
, BOOL load_prop
, MSIFOLDER
**folder
);
1013 extern LPWSTR
resolve_file_source(MSIPACKAGE
*package
, MSIFILE
*file
);
1014 extern void msi_reset_folders( MSIPACKAGE
*package
, BOOL source
);
1015 extern MSICOMPONENT
*get_loaded_component( MSIPACKAGE
* package
, LPCWSTR Component
);
1016 extern MSIFEATURE
*get_loaded_feature( MSIPACKAGE
* package
, LPCWSTR Feature
);
1017 extern MSIFILE
*get_loaded_file( MSIPACKAGE
* package
, LPCWSTR file
);
1018 extern MSIFOLDER
*get_loaded_folder( MSIPACKAGE
*package
, LPCWSTR dir
);
1019 extern int track_tempfile(MSIPACKAGE
*package
, LPCWSTR path
);
1020 extern UINT
schedule_action(MSIPACKAGE
*package
, UINT script
, LPCWSTR action
);
1021 extern void msi_free_action_script(MSIPACKAGE
*package
, UINT script
);
1022 extern LPWSTR
build_icon_path(MSIPACKAGE
*, LPCWSTR
);
1023 extern LPWSTR
build_directory_name(DWORD
, ...);
1024 extern BOOL
create_full_pathW(const WCHAR
*path
);
1025 extern void reduce_to_longfilename(WCHAR
*);
1026 extern LPWSTR
create_component_advertise_string(MSIPACKAGE
*, MSICOMPONENT
*, LPCWSTR
);
1027 extern void ACTION_UpdateComponentStates(MSIPACKAGE
*package
, LPCWSTR szFeature
);
1028 extern UINT
register_unique_action(MSIPACKAGE
*, LPCWSTR
);
1029 extern BOOL
check_unique_action(const MSIPACKAGE
*, LPCWSTR
);
1030 extern WCHAR
* generate_error_string(MSIPACKAGE
*, UINT
, DWORD
, ... );
1031 extern UINT
msi_set_last_used_source(LPCWSTR product
, LPCWSTR usersid
,
1032 MSIINSTALLCONTEXT context
, DWORD options
, LPCWSTR value
);
1033 extern UINT
msi_get_local_package_name(LPWSTR path
, LPCWSTR suffix
);
1034 extern UINT
msi_set_sourcedir_props(MSIPACKAGE
*package
, BOOL replace
);
1038 typedef BOOL (*PMSICABEXTRACTCB
)(MSIPACKAGE
*, LPCWSTR
, DWORD
, LPWSTR
*, DWORD
*, PVOID
);
1040 #define MSICABEXTRACT_BEGINEXTRACT 0x01
1041 #define MSICABEXTRACT_FILEEXTRACTED 0x02
1045 MSIPACKAGE
* package
;
1047 PMSICABEXTRACTCB cb
;
1052 extern UINT
ready_media(MSIPACKAGE
*package
, MSIFILE
*file
, MSIMEDIAINFO
*mi
);
1053 extern void msi_free_media_info(MSIMEDIAINFO
*mi
);
1054 extern BOOL
msi_cabextract(MSIPACKAGE
* package
, MSIMEDIAINFO
*mi
, LPVOID data
);
1056 /* control event stuff */
1057 extern VOID
ControlEvent_FireSubscribedEvent(MSIPACKAGE
*package
, LPCWSTR event
,
1059 extern VOID
ControlEvent_CleanupDialogSubscriptions(MSIPACKAGE
*package
, LPWSTR dialog
);
1060 extern VOID
ControlEvent_CleanupSubscriptions(MSIPACKAGE
*package
);
1061 extern VOID
ControlEvent_SubscribeToEvent(MSIPACKAGE
*package
, msi_dialog
*dialog
,
1062 LPCWSTR event
, LPCWSTR control
, LPCWSTR attribute
);
1064 /* OLE automation */
1065 extern HRESULT
create_msiserver(IUnknown
*pOuter
, LPVOID
*ppObj
);
1066 extern HRESULT
create_session(MSIHANDLE msiHandle
, IDispatch
*pInstaller
, IDispatch
**pDispatch
);
1067 extern HRESULT
load_type_info(IDispatch
*iface
, ITypeInfo
**pptinfo
, REFIID clsid
, LCID lcid
);
1070 extern DWORD
call_script(MSIHANDLE hPackage
, INT type
, LPCWSTR script
, LPCWSTR function
, LPCWSTR action
);
1072 /* User Interface messages from the actions */
1073 extern void ui_progress(MSIPACKAGE
*, int, int, int, int);
1074 extern void ui_actiondata(MSIPACKAGE
*, LPCWSTR
, MSIRECORD
*);
1076 /* common strings */
1077 static const WCHAR cszSourceDir
[] = {'S','o','u','r','c','e','D','i','r',0};
1078 static const WCHAR cszSOURCEDIR
[] = {'S','O','U','R','C','E','D','I','R',0};
1079 static const WCHAR cszRootDrive
[] = {'R','O','O','T','D','R','I','V','E',0};
1080 static const WCHAR szLocalSid
[] = {'S','-','1','-','5','-','1','8',0};
1081 static const WCHAR szEmpty
[] = {0};
1082 static const WCHAR szAll
[] = {'A','L','L',0};
1083 static const WCHAR szOne
[] = {'1',0};
1084 static const WCHAR szZero
[] = {'0',0};
1085 static const WCHAR szSpace
[] = {' ',0};
1086 static const WCHAR szBackSlash
[] = {'\\',0};
1087 static const WCHAR szForwardSlash
[] = {'/',0};
1088 static const WCHAR szDot
[] = {'.',0};
1089 static const WCHAR szDotDot
[] = {'.','.',0};
1090 static const WCHAR szSemiColon
[] = {';',0};
1091 static const WCHAR szPreselected
[] = {'P','r','e','s','e','l','e','c','t','e','d',0};
1092 static const WCHAR szPatches
[] = {'P','a','t','c','h','e','s',0};
1093 static const WCHAR szState
[] = {'S','t','a','t','e',0};
1094 static const WCHAR szMsi
[] = {'m','s','i',0};
1095 static const WCHAR szPatch
[] = {'P','A','T','C','H',0};
1096 static const WCHAR szSourceList
[] = {'S','o','u','r','c','e','L','i','s','t',0};
1097 static const WCHAR szInstalled
[] = {'I','n','s','t','a','l','l','e','d',0};
1098 static const WCHAR szReinstall
[] = {'R','E','I','N','S','T','A','L','L',0};
1099 static const WCHAR szReinstallMode
[] = {'R','E','I','N','S','T','A','L','L','M','O','D','E',0};
1100 static const WCHAR szRemove
[] = {'R','E','M','O','V','E',0};
1101 static const WCHAR szUserSID
[] = {'U','s','e','r','S','I','D',0};
1102 static const WCHAR szProductCode
[] = {'P','r','o','d','u','c','t','C','o','d','e',0};
1103 static const WCHAR szRegisterClassInfo
[] = {'R','e','g','i','s','t','e','r','C','l','a','s','s','I','n','f','o',0};
1104 static const WCHAR szRegisterProgIdInfo
[] = {'R','e','g','i','s','t','e','r','P','r','o','g','I','d','I','n','f','o',0};
1105 static const WCHAR szRegisterExtensionInfo
[] = {'R','e','g','i','s','t','e','r','E','x','t','e','n','s','i','o','n','I','n','f','o',0};
1106 static const WCHAR szRegisterMIMEInfo
[] = {'R','e','g','i','s','t','e','r','M','I','M','E','I','n','f','o',0};
1107 static const WCHAR szDuplicateFiles
[] = {'D','u','p','l','i','c','a','t','e','F','i','l','e','s',0};
1108 static const WCHAR szRemoveDuplicateFiles
[] = {'R','e','m','o','v','e','D','u','p','l','i','c','a','t','e','F','i','l','e','s',0};
1109 static const WCHAR szInstallFiles
[] = {'I','n','s','t','a','l','l','F','i','l','e','s',0};
1110 static const WCHAR szRemoveFiles
[] = {'R','e','m','o','v','e','F','i','l','e','s',0};
1111 static const WCHAR szFindRelatedProducts
[] = {'F','i','n','d','R','e','l','a','t','e','d','P','r','o','d','u','c','t','s',0};
1112 static const WCHAR szAllUsers
[] = {'A','L','L','U','S','E','R','S',0};
1113 static const WCHAR szCustomActionData
[] = {'C','u','s','t','o','m','A','c','t','i','o','n','D','a','t','a',0};
1114 static const WCHAR szUILevel
[] = {'U','I','L','e','v','e','l',0};
1115 static const WCHAR szProductID
[] = {'P','r','o','d','u','c','t','I','D',0};
1116 static const WCHAR szPIDTemplate
[] = {'P','I','D','T','e','m','p','l','a','t','e',0};
1117 static const WCHAR szPIDKEY
[] = {'P','I','D','K','E','Y',0};
1118 static const WCHAR szTYPELIB
[] = {'T','Y','P','E','L','I','B',0};
1119 static const WCHAR szSumInfo
[] = {5 ,'S','u','m','m','a','r','y','I','n','f','o','r','m','a','t','i','o','n',0};
1120 static const WCHAR szHCR
[] = {'H','K','E','Y','_','C','L','A','S','S','E','S','_','R','O','O','T','\\',0};
1121 static const WCHAR szHCU
[] = {'H','K','E','Y','_','C','U','R','R','E','N','T','_','U','S','E','R','\\',0};
1122 static const WCHAR szHLM
[] = {'H','K','E','Y','_','L','O','C','A','L','_','M','A','C','H','I','N','E','\\',0};
1123 static const WCHAR szHU
[] = {'H','K','E','Y','_','U','S','E','R','S','\\',0};
1124 static const WCHAR szWindowsFolder
[] = {'W','i','n','d','o','w','s','F','o','l','d','e','r',0};
1125 static const WCHAR szAppSearch
[] = {'A','p','p','S','e','a','r','c','h',0};
1126 static const WCHAR szMoveFiles
[] = {'M','o','v','e','F','i','l','e','s',0};
1127 static const WCHAR szCCPSearch
[] = {'C','C','P','S','e','a','r','c','h',0};
1128 static const WCHAR szUnregisterClassInfo
[] = {'U','n','r','e','g','i','s','t','e','r','C','l','a','s','s','I','n','f','o',0};
1129 static const WCHAR szUnregisterExtensionInfo
[] = {'U','n','r','e','g','i','s','t','e','r','E','x','t','e','n','s','i','o','n','I','n','f','o',0};
1130 static const WCHAR szUnregisterMIMEInfo
[] = {'U','n','r','e','g','i','s','t','e','r','M','I','M','E','I','n','f','o',0};
1131 static const WCHAR szUnregisterProgIdInfo
[] = {'U','n','r','e','g','i','s','t','e','r','P','r','o','g','I','d','I','n','f','o',0};
1132 static const WCHAR szRegisterFonts
[] = {'R','e','g','i','s','t','e','r','F','o','n','t','s',0};
1133 static const WCHAR szUnregisterFonts
[] = {'U','n','r','e','g','i','s','t','e','r','F','o','n','t','s',0};
1134 static const WCHAR szCLSID
[] = {'C','L','S','I','D',0};
1135 static const WCHAR szProgID
[] = {'P','r','o','g','I','D',0};
1136 static const WCHAR szVIProgID
[] = {'V','e','r','s','i','o','n','I','n','d','e','p','e','n','d','e','n','t','P','r','o','g','I','D',0};
1137 static const WCHAR szAppID
[] = {'A','p','p','I','D',0};
1138 static const WCHAR szDefaultIcon
[] = {'D','e','f','a','u','l','t','I','c','o','n',0};
1139 static const WCHAR szInprocHandler
[] = {'I','n','p','r','o','c','H','a','n','d','l','e','r',0};
1140 static const WCHAR szInprocHandler32
[] = {'I','n','p','r','o','c','H','a','n','d','l','e','r','3','2',0};
1141 static const WCHAR szMIMEDatabase
[] = {'M','I','M','E','\\','D','a','t','a','b','a','s','e','\\','C','o','n','t','e','n','t',' ','T','y','p','e','\\',0};
1142 static const WCHAR szLocalPackage
[] = {'L','o','c','a','l','P','a','c','k','a','g','e',0};
1143 static const WCHAR szOriginalDatabase
[] = {'O','r','i','g','i','n','a','l','D','a','t','a','b','a','s','e',0};
1144 static const WCHAR szUpgradeCode
[] = {'U','p','g','r','a','d','e','C','o','d','e',0};
1145 static const WCHAR szAdminUser
[] = {'A','d','m','i','n','U','s','e','r',0};
1146 static const WCHAR szIntel
[] = {'I','n','t','e','l',0};
1147 static const WCHAR szIntel64
[] = {'I','n','t','e','l','6','4',0};
1148 static const WCHAR szX64
[] = {'x','6','4',0};
1150 /* memory allocation macro functions */
1151 static void *msi_alloc( size_t len
) __WINE_ALLOC_SIZE(1);
1152 static inline void *msi_alloc( size_t len
)
1154 return HeapAlloc( GetProcessHeap(), 0, len
);
1157 static void *msi_alloc_zero( size_t len
) __WINE_ALLOC_SIZE(1);
1158 static inline void *msi_alloc_zero( size_t len
)
1160 return HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY
, len
);
1163 static void *msi_realloc( void *mem
, size_t len
) __WINE_ALLOC_SIZE(2);
1164 static inline void *msi_realloc( void *mem
, size_t len
)
1166 return HeapReAlloc( GetProcessHeap(), 0, mem
, len
);
1169 static void *msi_realloc_zero( void *mem
, size_t len
) __WINE_ALLOC_SIZE(2);
1170 static inline void *msi_realloc_zero( void *mem
, size_t len
)
1172 return HeapReAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY
, mem
, len
);
1175 static inline BOOL
msi_free( void *mem
)
1177 return HeapFree( GetProcessHeap(), 0, mem
);
1180 static inline char *strdupWtoA( LPCWSTR str
)
1185 if (!str
) return ret
;
1186 len
= WideCharToMultiByte( CP_ACP
, 0, str
, -1, NULL
, 0, NULL
, NULL
);
1187 ret
= msi_alloc( len
);
1189 WideCharToMultiByte( CP_ACP
, 0, str
, -1, ret
, len
, NULL
, NULL
);
1193 static inline LPWSTR
strdupAtoW( LPCSTR str
)
1198 if (!str
) return ret
;
1199 len
= MultiByteToWideChar( CP_ACP
, 0, str
, -1, NULL
, 0 );
1200 ret
= msi_alloc( len
* sizeof(WCHAR
) );
1202 MultiByteToWideChar( CP_ACP
, 0, str
, -1, ret
, len
);
1206 static inline LPWSTR
strdupW( LPCWSTR src
)
1209 if (!src
) return NULL
;
1210 dest
= msi_alloc( (lstrlenW(src
)+1)*sizeof(WCHAR
) );
1212 lstrcpyW(dest
, src
);
1216 #endif /* __WINE_MSI_PRIVATE__ */