Release 1.3.7.
[wine/gsoc-2012-control.git] / dlls / msi / msipriv.h
blob986097febdb5f78279f25e4bdccba99e1a58088c
1 /*
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__
25 #include <stdarg.h>
27 #include "windef.h"
28 #include "winbase.h"
29 #include "fdi.h"
30 #include "msi.h"
31 #include "msiquery.h"
32 #include "msidefs.h"
33 #include "objbase.h"
34 #include "objidl.h"
35 #include "fusion.h"
36 #include "winnls.h"
37 #include "winver.h"
38 #include "wine/list.h"
39 #include "wine/debug.h"
41 static const BOOL is_64bit = sizeof(void *) > sizeof(int);
43 #define MSI_DATASIZEMASK 0x00ff
44 #define MSITYPE_VALID 0x0100
45 #define MSITYPE_LOCALIZABLE 0x200
46 #define MSITYPE_STRING 0x0800
47 #define MSITYPE_NULLABLE 0x1000
48 #define MSITYPE_KEY 0x2000
49 #define MSITYPE_TEMPORARY 0x4000
51 #define MAX_STREAM_NAME_LEN 62
52 #define LONG_STR_BYTES 3
54 /* Install UI level mask for AND operation to exclude flags */
55 #define INSTALLUILEVEL_MASK 0x0007
57 #define MSITYPE_IS_BINARY(type) (((type) & ~MSITYPE_NULLABLE) == (MSITYPE_STRING|MSITYPE_VALID))
59 struct tagMSITABLE;
60 typedef struct tagMSITABLE MSITABLE;
62 struct string_table;
63 typedef struct string_table string_table;
65 struct tagMSIOBJECTHDR;
66 typedef struct tagMSIOBJECTHDR MSIOBJECTHDR;
68 typedef VOID (*msihandledestructor)( MSIOBJECTHDR * );
70 struct tagMSIOBJECTHDR
72 UINT magic;
73 UINT type;
74 LONG refcount;
75 msihandledestructor destructor;
78 typedef struct tagMSIDATABASE
80 MSIOBJECTHDR hdr;
81 IStorage *storage;
82 string_table *strings;
83 UINT bytes_per_strref;
84 LPWSTR path;
85 LPWSTR deletefile;
86 LPWSTR localfile;
87 LPCWSTR mode;
88 struct list tables;
89 struct list transforms;
90 struct list streams;
91 } MSIDATABASE;
93 typedef struct tagMSIVIEW MSIVIEW;
95 typedef struct tagMSIQUERY
97 MSIOBJECTHDR hdr;
98 MSIVIEW *view;
99 UINT row;
100 MSIDATABASE *db;
101 struct list mem;
102 } MSIQUERY;
104 /* maybe we can use a Variant instead of doing it ourselves? */
105 typedef struct tagMSIFIELD
107 UINT type;
108 union
110 INT iVal;
111 INT_PTR pVal;
112 LPWSTR szwVal;
113 IStream *stream;
114 } u;
115 } MSIFIELD;
117 typedef struct tagMSIRECORD
119 MSIOBJECTHDR hdr;
120 UINT count; /* as passed to MsiCreateRecord */
121 MSIFIELD fields[1]; /* nb. array size is count+1 */
122 } MSIRECORD;
124 typedef struct tagMSISOURCELISTINFO
126 struct list entry;
127 DWORD context;
128 DWORD options;
129 LPCWSTR property;
130 LPWSTR value;
131 } MSISOURCELISTINFO;
133 typedef struct tagMSIMEDIADISK
135 struct list entry;
136 DWORD context;
137 DWORD options;
138 DWORD disk_id;
139 LPWSTR volume_label;
140 LPWSTR disk_prompt;
141 } MSIMEDIADISK;
143 typedef struct tagMSIMEDIAINFO
145 UINT disk_id;
146 UINT type;
147 UINT last_sequence;
148 LPWSTR disk_prompt;
149 LPWSTR cabinet;
150 LPWSTR first_volume;
151 LPWSTR volume_label;
152 BOOL is_continuous;
153 BOOL is_extracted;
154 WCHAR sourcedir[MAX_PATH];
155 } MSIMEDIAINFO;
157 typedef struct tagMSIPATCHINFO
159 struct list entry;
160 LPWSTR patchcode;
161 LPWSTR transforms;
162 LPWSTR localfile;
163 MSIPATCHSTATE state;
164 } MSIPATCHINFO;
166 typedef struct _column_info
168 LPCWSTR table;
169 LPCWSTR column;
170 INT type;
171 BOOL temporary;
172 struct expr *val;
173 struct _column_info *next;
174 } column_info;
176 typedef const struct tagMSICOLUMNHASHENTRY *MSIITERHANDLE;
178 typedef struct tagMSIVIEWOPS
181 * fetch_int - reads one integer from {row,col} in the table
183 * This function should be called after the execute method.
184 * Data returned by the function should not change until
185 * close or delete is called.
186 * To get a string value, query the database's string table with
187 * the integer value returned from this function.
189 UINT (*fetch_int)( struct tagMSIVIEW *view, UINT row, UINT col, UINT *val );
192 * fetch_stream - gets a stream from {row,col} in the table
194 * This function is similar to fetch_int, except fetches a
195 * stream instead of an integer.
197 UINT (*fetch_stream)( struct tagMSIVIEW *view, UINT row, UINT col, IStream **stm );
200 * get_row - gets values from a row
203 UINT (*get_row)( struct tagMSIVIEW *view, UINT row, MSIRECORD **rec );
206 * set_row - sets values in a row as specified by mask
208 * Similar semantics to fetch_int
210 UINT (*set_row)( struct tagMSIVIEW *view, UINT row, MSIRECORD *rec, UINT mask );
213 * Inserts a new row into the database from the records contents
215 UINT (*insert_row)( struct tagMSIVIEW *view, MSIRECORD *record, UINT row, BOOL temporary );
218 * Deletes a row from the database
220 UINT (*delete_row)( struct tagMSIVIEW *view, UINT row );
223 * execute - loads the underlying data into memory so it can be read
225 UINT (*execute)( struct tagMSIVIEW *view, MSIRECORD *record );
228 * close - clears the data read by execute from memory
230 UINT (*close)( struct tagMSIVIEW *view );
233 * get_dimensions - returns the number of rows or columns in a table.
235 * The number of rows can only be queried after the execute method
236 * is called. The number of columns can be queried at any time.
238 UINT (*get_dimensions)( struct tagMSIVIEW *view, UINT *rows, UINT *cols );
241 * get_column_info - returns the name and type of a specific column
243 * The name and tablename is HeapAlloc'ed by this function and should be
244 * freed by the caller.
245 * The column information can be queried at any time.
247 UINT (*get_column_info)( struct tagMSIVIEW *view, UINT n, LPWSTR *name, UINT *type, BOOL *temporary, LPWSTR *tableName);
250 * modify - not yet implemented properly
252 UINT (*modify)( struct tagMSIVIEW *view, MSIMODIFY eModifyMode, MSIRECORD *record, UINT row );
255 * delete - destroys the structure completely
257 UINT (*delete)( struct tagMSIVIEW * );
260 * find_matching_rows - iterates through rows that match a value
262 * If the column type is a string then a string ID should be passed in.
263 * If the value to be looked up is an integer then no transformation of
264 * the input value is required, except if the column is a string, in which
265 * case a string ID should be passed in.
266 * The handle is an input/output parameter that keeps track of the current
267 * position in the iteration. It must be initialised to zero before the
268 * first call and continued to be passed in to subsequent calls.
270 UINT (*find_matching_rows)( struct tagMSIVIEW *view, UINT col, UINT val, UINT *row, MSIITERHANDLE *handle );
273 * add_ref - increases the reference count of the table
275 UINT (*add_ref)( struct tagMSIVIEW *view );
278 * release - decreases the reference count of the table
280 UINT (*release)( struct tagMSIVIEW *view );
283 * add_column - adds a column to the table
285 UINT (*add_column)( struct tagMSIVIEW *view, LPCWSTR table, UINT number, LPCWSTR column, UINT type, BOOL hold );
288 * remove_column - removes the column represented by table name and column number from the table
290 UINT (*remove_column)( struct tagMSIVIEW *view, LPCWSTR table, UINT number );
293 * sort - orders the table by columns
295 UINT (*sort)( struct tagMSIVIEW *view, column_info *columns );
298 * drop - drops the table from the database
300 UINT (*drop)( struct tagMSIVIEW *view );
301 } MSIVIEWOPS;
303 struct tagMSIVIEW
305 MSIOBJECTHDR hdr;
306 const MSIVIEWOPS *ops;
309 struct msi_dialog_tag;
310 typedef struct msi_dialog_tag msi_dialog;
312 enum platform
314 PLATFORM_INTEL,
315 PLATFORM_INTEL64,
316 PLATFORM_X64
319 typedef struct tagMSIPACKAGE
321 MSIOBJECTHDR hdr;
322 MSIDATABASE *db;
323 INT version;
324 enum platform platform;
325 UINT num_langids;
326 LANGID *langids;
327 struct list patches;
328 struct list components;
329 struct list features;
330 struct list files;
331 struct list tempfiles;
332 struct list folders;
333 LPWSTR ActionFormat;
334 LPWSTR LastAction;
335 HANDLE log_file;
336 IAssemblyCache *cache_net;
337 IAssemblyCache *cache_sxs;
339 struct list classes;
340 struct list extensions;
341 struct list progids;
342 struct list mimes;
343 struct list appids;
345 struct tagMSISCRIPT *script;
347 struct list RunningActions;
349 LPWSTR BaseURL;
350 LPWSTR PackagePath;
351 LPWSTR ProductCode;
353 UINT CurrentInstallState;
354 msi_dialog *dialog;
355 LPWSTR next_dialog;
356 float center_x;
357 float center_y;
359 UINT WordCount;
360 UINT Context;
362 struct list subscriptions;
364 struct list sourcelist_info;
365 struct list sourcelist_media;
367 unsigned char scheduled_action_running : 1;
368 unsigned char commit_action_running : 1;
369 unsigned char rollback_action_running : 1;
370 unsigned char need_reboot : 1;
371 } MSIPACKAGE;
373 typedef struct tagMSIPREVIEW
375 MSIOBJECTHDR hdr;
376 MSIPACKAGE *package;
377 msi_dialog *dialog;
378 } MSIPREVIEW;
380 #define MSI_MAX_PROPS 20
382 typedef struct tagMSISUMMARYINFO
384 MSIOBJECTHDR hdr;
385 IStorage *storage;
386 DWORD update_count;
387 PROPVARIANT property[MSI_MAX_PROPS];
388 } MSISUMMARYINFO;
390 typedef struct tagMSIFEATURE
392 struct list entry;
393 LPWSTR Feature;
394 LPWSTR Feature_Parent;
395 LPWSTR Title;
396 LPWSTR Description;
397 INT Display;
398 INT Level;
399 LPWSTR Directory;
400 INT Attributes;
401 INSTALLSTATE Installed;
402 INSTALLSTATE ActionRequest;
403 INSTALLSTATE Action;
404 struct list Children;
405 struct list Components;
406 } MSIFEATURE;
408 typedef struct tagMSIASSEMBLY
410 LPWSTR feature;
411 LPWSTR manifest;
412 LPWSTR application;
413 DWORD attributes;
414 LPWSTR display_name;
415 LPWSTR tempdir;
416 BOOL installed;
417 } MSIASSEMBLY;
419 typedef struct tagMSICOMPONENT
421 struct list entry;
422 LPWSTR Component;
423 LPWSTR ComponentId;
424 LPWSTR Directory;
425 INT Attributes;
426 LPWSTR Condition;
427 LPWSTR KeyPath;
428 INSTALLSTATE Installed;
429 INSTALLSTATE ActionRequest;
430 INSTALLSTATE Action;
431 BOOL ForceLocalState;
432 BOOL Enabled;
433 INT Cost;
434 INT RefCount;
435 LPWSTR FullKeypath;
436 LPWSTR AdvertiseString;
437 MSIASSEMBLY *assembly;
439 unsigned int anyAbsent:1;
440 unsigned int hasAdvertiseFeature:1;
441 unsigned int hasLocalFeature:1;
442 unsigned int hasSourceFeature:1;
443 } MSICOMPONENT;
445 typedef struct tagComponentList
447 struct list entry;
448 MSICOMPONENT *component;
449 } ComponentList;
451 typedef struct tagFeatureList
453 struct list entry;
454 MSIFEATURE *feature;
455 } FeatureList;
457 typedef struct tagMSIFOLDER
459 struct list entry;
460 LPWSTR Directory;
461 LPWSTR Parent;
462 LPWSTR TargetDefault;
463 LPWSTR SourceLongPath;
464 LPWSTR SourceShortPath;
466 LPWSTR ResolvedTarget;
467 LPWSTR ResolvedSource;
468 LPWSTR Property; /* initially set property */
469 INT State;
470 /* 0 = uninitialized */
471 /* 1 = existing */
472 /* 2 = created remove if empty */
473 /* 3 = created persist if empty */
474 INT Cost;
475 INT Space;
476 } MSIFOLDER;
478 typedef enum _msi_file_state {
479 msifs_invalid,
480 msifs_missing,
481 msifs_overwrite,
482 msifs_present,
483 msifs_installed,
484 msifs_skipped,
485 } msi_file_state;
487 typedef struct tagMSIFILE
489 struct list entry;
490 LPWSTR File;
491 MSICOMPONENT *Component;
492 LPWSTR FileName;
493 LPWSTR ShortName;
494 LPWSTR LongName;
495 INT FileSize;
496 LPWSTR Version;
497 LPWSTR Language;
498 INT Attributes;
499 INT Sequence;
500 msi_file_state state;
501 LPWSTR TargetPath;
502 BOOL IsCompressed;
503 MSIFILEHASHINFO hash;
504 UINT disk_id;
505 } MSIFILE;
507 typedef struct tagMSITEMPFILE
509 struct list entry;
510 LPWSTR Path;
511 } MSITEMPFILE;
513 typedef struct tagMSIAPPID
515 struct list entry;
516 LPWSTR AppID; /* Primary key */
517 LPWSTR RemoteServerName;
518 LPWSTR LocalServer;
519 LPWSTR ServiceParameters;
520 LPWSTR DllSurrogate;
521 BOOL ActivateAtStorage;
522 BOOL RunAsInteractiveUser;
523 } MSIAPPID;
525 typedef struct tagMSIPROGID MSIPROGID;
527 typedef struct tagMSICLASS
529 struct list entry;
530 LPWSTR clsid; /* Primary Key */
531 LPWSTR Context; /* Primary Key */
532 MSICOMPONENT *Component;
533 MSIPROGID *ProgID;
534 LPWSTR ProgIDText;
535 LPWSTR Description;
536 MSIAPPID *AppID;
537 LPWSTR FileTypeMask;
538 LPWSTR IconPath;
539 LPWSTR DefInprocHandler;
540 LPWSTR DefInprocHandler32;
541 LPWSTR Argument;
542 MSIFEATURE *Feature;
543 INT Attributes;
544 /* not in the table, set during installation */
545 BOOL Installed;
546 } MSICLASS;
548 typedef struct tagMSIMIME MSIMIME;
550 typedef struct tagMSIEXTENSION
552 struct list entry;
553 LPWSTR Extension; /* Primary Key */
554 MSICOMPONENT *Component;
555 MSIPROGID *ProgID;
556 LPWSTR ProgIDText;
557 MSIMIME *Mime;
558 MSIFEATURE *Feature;
559 /* not in the table, set during installation */
560 BOOL Installed;
561 struct list verbs;
562 } MSIEXTENSION;
564 struct tagMSIPROGID
566 struct list entry;
567 LPWSTR ProgID; /* Primary Key */
568 MSIPROGID *Parent;
569 MSICLASS *Class;
570 LPWSTR Description;
571 LPWSTR IconPath;
572 /* not in the table, set during installation */
573 BOOL InstallMe;
574 MSIPROGID *CurVer;
575 MSIPROGID *VersionInd;
578 typedef struct tagMSIVERB
580 struct list entry;
581 LPWSTR Verb;
582 INT Sequence;
583 LPWSTR Command;
584 LPWSTR Argument;
585 } MSIVERB;
587 struct tagMSIMIME
589 struct list entry;
590 LPWSTR ContentType; /* Primary Key */
591 MSIEXTENSION *Extension;
592 LPWSTR suffix;
593 LPWSTR clsid;
594 MSICLASS *Class;
595 /* not in the table, set during installation */
596 BOOL InstallMe;
599 enum SCRIPTS {
600 INSTALL_SCRIPT = 0,
601 COMMIT_SCRIPT = 1,
602 ROLLBACK_SCRIPT = 2,
603 TOTAL_SCRIPTS = 3
606 #define SEQUENCE_UI 0x1
607 #define SEQUENCE_EXEC 0x2
608 #define SEQUENCE_INSTALL 0x10
610 typedef struct tagMSISCRIPT
612 LPWSTR *Actions[TOTAL_SCRIPTS];
613 UINT ActionCount[TOTAL_SCRIPTS];
614 BOOL ExecuteSequenceRun;
615 BOOL CurrentlyScripting;
616 UINT InWhatSequence;
617 LPWSTR *UniqueActions;
618 UINT UniqueActionsCount;
619 } MSISCRIPT;
621 #define MSIHANDLETYPE_ANY 0
622 #define MSIHANDLETYPE_DATABASE 1
623 #define MSIHANDLETYPE_SUMMARYINFO 2
624 #define MSIHANDLETYPE_VIEW 3
625 #define MSIHANDLETYPE_RECORD 4
626 #define MSIHANDLETYPE_PACKAGE 5
627 #define MSIHANDLETYPE_PREVIEW 6
629 #define MSI_MAJORVERSION 4
630 #define MSI_MINORVERSION 5
631 #define MSI_BUILDNUMBER 6001
633 #define GUID_SIZE 39
634 #define SQUISH_GUID_SIZE 33
636 #define MSIHANDLE_MAGIC 0x4d434923
638 DEFINE_GUID(CLSID_IMsiServer, 0x000C101C,0x0000,0x0000,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x46);
639 DEFINE_GUID(CLSID_IMsiServerX1, 0x000C103E,0x0000,0x0000,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x46);
640 DEFINE_GUID(CLSID_IMsiServerX2, 0x000C1090,0x0000,0x0000,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x46);
641 DEFINE_GUID(CLSID_IMsiServerX3, 0x000C1094,0x0000,0x0000,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x46);
643 DEFINE_GUID(CLSID_IMsiServerMessage, 0x000C101D,0x0000,0x0000,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x46);
645 DEFINE_GUID(CLSID_IWineMsiRemoteCustomAction,0xBA26E6FA,0x4F27,0x4f56,0x95,0x3A,0x3F,0x90,0x27,0x20,0x18,0xAA);
646 DEFINE_GUID(CLSID_IWineMsiRemotePackage,0x902b3592,0x9d08,0x4dfd,0xa5,0x93,0xd0,0x7c,0x52,0x54,0x64,0x21);
648 DEFINE_GUID(CLSID_MsiTransform, 0x000c1082,0x0000,0x0000,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x46);
649 DEFINE_GUID(CLSID_MsiDatabase, 0x000c1084,0x0000,0x0000,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x46);
650 DEFINE_GUID(CLSID_MsiPatch, 0x000c1086,0x0000,0x0000,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x46);
652 /* handle unicode/ascii output in the Msi* API functions */
653 typedef struct {
654 BOOL unicode;
655 union {
656 LPSTR a;
657 LPWSTR w;
658 } str;
659 } awstring;
661 typedef struct {
662 BOOL unicode;
663 union {
664 LPCSTR a;
665 LPCWSTR w;
666 } str;
667 } awcstring;
669 UINT msi_strcpy_to_awstring( LPCWSTR str, awstring *awbuf, DWORD *sz );
671 /* msi server interface */
672 extern ITypeLib *get_msi_typelib( LPWSTR *path );
673 extern HRESULT create_msi_custom_remote( IUnknown *pOuter, LPVOID *ppObj );
674 extern HRESULT create_msi_remote_package( IUnknown *pOuter, LPVOID *ppObj );
675 extern HRESULT create_msi_remote_database( IUnknown *pOuter, LPVOID *ppObj );
676 extern IUnknown *msi_get_remote(MSIHANDLE handle);
678 /* handle functions */
679 extern void *msihandle2msiinfo(MSIHANDLE handle, UINT type);
680 extern MSIHANDLE alloc_msihandle( MSIOBJECTHDR * );
681 extern MSIHANDLE alloc_msi_remote_handle( IUnknown *unk );
682 extern void *alloc_msiobject(UINT type, UINT size, msihandledestructor destroy );
683 extern void msiobj_addref(MSIOBJECTHDR *);
684 extern int msiobj_release(MSIOBJECTHDR *);
685 extern void msiobj_lock(MSIOBJECTHDR *);
686 extern void msiobj_unlock(MSIOBJECTHDR *);
687 extern void msi_free_handle_table(void);
689 extern void free_cached_tables( MSIDATABASE *db );
690 extern UINT MSI_CommitTables( MSIDATABASE *db );
693 /* string table functions */
694 enum StringPersistence
696 StringPersistent = 0,
697 StringNonPersistent = 1
700 extern BOOL msi_addstringW( string_table *st, const WCHAR *data, int len, USHORT refcount, enum StringPersistence persistence );
701 extern UINT msi_string2idW( const string_table *st, LPCWSTR buffer, UINT *id );
702 extern VOID msi_destroy_stringtable( string_table *st );
703 extern const WCHAR *msi_string_lookup_id( const string_table *st, UINT id );
704 extern HRESULT msi_init_string_table( IStorage *stg );
705 extern string_table *msi_load_string_table( IStorage *stg, UINT *bytes_per_strref );
706 extern UINT msi_save_string_table( const string_table *st, IStorage *storage, UINT *bytes_per_strref );
708 extern BOOL TABLE_Exists( MSIDATABASE *db, LPCWSTR name );
709 extern MSICONDITION MSI_DatabaseIsTablePersistent( MSIDATABASE *db, LPCWSTR table );
711 extern UINT read_stream_data( IStorage *stg, LPCWSTR stname, BOOL table,
712 BYTE **pdata, UINT *psz );
713 extern UINT write_stream_data( IStorage *stg, LPCWSTR stname,
714 LPCVOID data, UINT sz, BOOL bTable );
716 /* transform functions */
717 extern UINT msi_table_apply_transform( MSIDATABASE *db, IStorage *stg );
718 extern UINT MSI_DatabaseApplyTransformW( MSIDATABASE *db,
719 LPCWSTR szTransformFile, int iErrorCond );
720 extern void append_storage_to_db( MSIDATABASE *db, IStorage *stg );
722 /* patch functions */
723 extern UINT msi_check_patch_applicable( MSIPACKAGE *package, MSISUMMARYINFO *si );
724 extern UINT msi_parse_patch_summary( MSISUMMARYINFO *si, MSIPATCHINFO **patch );
725 extern UINT msi_apply_patch_db( MSIPACKAGE *package, MSIDATABASE *patch_db, MSIPATCHINFO *patch );
727 /* action internals */
728 extern UINT MSI_InstallPackage( MSIPACKAGE *, LPCWSTR, LPCWSTR );
729 extern UINT ACTION_DialogBox( MSIPACKAGE*, LPCWSTR);
730 extern UINT ACTION_ForceReboot(MSIPACKAGE *package);
731 extern UINT MSI_Sequence( MSIPACKAGE *package, LPCWSTR szTable, INT iSequenceMode );
732 extern UINT MSI_SetFeatureStates( MSIPACKAGE *package );
733 extern UINT msi_parse_command_line( MSIPACKAGE *package, LPCWSTR szCommandLine,
734 BOOL preserve_case );
736 /* record internals */
737 extern void MSI_CloseRecord( MSIOBJECTHDR * );
738 extern UINT MSI_RecordSetIStream( MSIRECORD *, UINT, IStream *);
739 extern UINT MSI_RecordGetIStream( MSIRECORD *, UINT, IStream **);
740 extern const WCHAR *MSI_RecordGetString( const MSIRECORD *, UINT );
741 extern MSIRECORD *MSI_CreateRecord( UINT );
742 extern UINT MSI_RecordSetInteger( MSIRECORD *, UINT, int );
743 extern UINT MSI_RecordSetIntPtr( MSIRECORD *, UINT, INT_PTR );
744 extern UINT MSI_RecordSetStringW( MSIRECORD *, UINT, LPCWSTR );
745 extern BOOL MSI_RecordIsNull( MSIRECORD *, UINT );
746 extern UINT MSI_RecordGetStringW( MSIRECORD * , UINT, LPWSTR, LPDWORD);
747 extern UINT MSI_RecordGetStringA( MSIRECORD *, UINT, LPSTR, LPDWORD);
748 extern int MSI_RecordGetInteger( MSIRECORD *, UINT );
749 extern INT_PTR MSI_RecordGetIntPtr( MSIRECORD *, UINT );
750 extern UINT MSI_RecordReadStream( MSIRECORD *, UINT, char *, LPDWORD);
751 extern UINT MSI_RecordSetStream(MSIRECORD *, UINT, IStream *);
752 extern UINT MSI_RecordGetFieldCount( const MSIRECORD *rec );
753 extern UINT MSI_RecordStreamToFile( MSIRECORD *, UINT, LPCWSTR );
754 extern UINT MSI_RecordSetStreamFromFileW( MSIRECORD *, UINT, LPCWSTR );
755 extern UINT MSI_RecordCopyField( MSIRECORD *, UINT, MSIRECORD *, UINT );
756 extern MSIRECORD *MSI_CloneRecord( MSIRECORD * );
757 extern BOOL MSI_RecordsAreEqual( MSIRECORD *, MSIRECORD * );
759 /* stream internals */
760 extern void enum_stream_names( IStorage *stg );
761 extern LPWSTR encode_streamname(BOOL bTable, LPCWSTR in);
762 extern BOOL decode_streamname(LPCWSTR in, LPWSTR out);
764 /* database internals */
765 extern UINT db_get_raw_stream( MSIDATABASE *, LPCWSTR, IStream ** );
766 void db_destroy_stream( MSIDATABASE *, LPCWSTR );
767 extern UINT MSI_OpenDatabaseW( LPCWSTR, LPCWSTR, MSIDATABASE ** );
768 extern UINT MSI_DatabaseOpenViewW(MSIDATABASE *, LPCWSTR, MSIQUERY ** );
769 extern UINT MSI_OpenQuery( MSIDATABASE *, MSIQUERY **, LPCWSTR, ... );
770 typedef UINT (*record_func)( MSIRECORD *, LPVOID );
771 extern UINT MSI_IterateRecords( MSIQUERY *, LPDWORD, record_func, LPVOID );
772 extern MSIRECORD *MSI_QueryGetRecord( MSIDATABASE *db, LPCWSTR query, ... );
773 extern UINT MSI_DatabaseGetPrimaryKeys( MSIDATABASE *, LPCWSTR, MSIRECORD ** );
775 /* view internals */
776 extern UINT MSI_ViewExecute( MSIQUERY*, MSIRECORD * );
777 extern UINT MSI_ViewFetch( MSIQUERY*, MSIRECORD ** );
778 extern UINT MSI_ViewClose( MSIQUERY* );
779 extern UINT MSI_ViewGetColumnInfo(MSIQUERY *, MSICOLINFO, MSIRECORD **);
780 extern UINT MSI_ViewModify( MSIQUERY *, MSIMODIFY, MSIRECORD * );
781 extern UINT VIEW_find_column( MSIVIEW *, LPCWSTR, LPCWSTR, UINT * );
782 extern UINT msi_view_get_row(MSIDATABASE *, MSIVIEW *, UINT, MSIRECORD **);
784 /* install internals */
785 extern UINT MSI_SetInstallLevel( MSIPACKAGE *package, int iInstallLevel );
787 /* package internals */
788 extern MSIPACKAGE *MSI_CreatePackage( MSIDATABASE *, LPCWSTR );
789 extern UINT MSI_OpenPackageW( LPCWSTR szPackage, MSIPACKAGE **pPackage );
790 extern UINT MSI_SetTargetPathW( MSIPACKAGE *, LPCWSTR, LPCWSTR );
791 extern INT MSI_ProcessMessage( MSIPACKAGE *, INSTALLMESSAGE, MSIRECORD * );
792 extern MSICONDITION MSI_EvaluateConditionW( MSIPACKAGE *, LPCWSTR );
793 extern UINT MSI_GetComponentStateW( MSIPACKAGE *, LPCWSTR, INSTALLSTATE *, INSTALLSTATE * );
794 extern UINT MSI_GetFeatureStateW( MSIPACKAGE *, LPCWSTR, INSTALLSTATE *, INSTALLSTATE * );
795 extern UINT WINAPI MSI_SetFeatureStateW(MSIPACKAGE*, LPCWSTR, INSTALLSTATE );
796 extern UINT msi_download_file( LPCWSTR szUrl, LPWSTR filename );
797 extern UINT msi_package_add_info(MSIPACKAGE *, DWORD, DWORD, LPCWSTR, LPWSTR);
798 extern UINT msi_package_add_media_disk(MSIPACKAGE *, DWORD, DWORD, DWORD, LPWSTR, LPWSTR);
799 extern UINT msi_clone_properties(MSIPACKAGE *);
800 extern UINT msi_set_context(MSIPACKAGE *);
801 extern void msi_adjust_privilege_properties(MSIPACKAGE *);
802 extern UINT MSI_GetFeatureCost(MSIPACKAGE *, MSIFEATURE *, MSICOSTTREE, INSTALLSTATE, LPINT);
804 /* for deformating */
805 extern UINT MSI_FormatRecordW( MSIPACKAGE *, MSIRECORD *, LPWSTR, LPDWORD );
807 /* registry data encoding/decoding functions */
808 extern BOOL unsquash_guid(LPCWSTR in, LPWSTR out);
809 extern BOOL squash_guid(LPCWSTR in, LPWSTR out);
810 extern BOOL encode_base85_guid(GUID *,LPWSTR);
811 extern BOOL decode_base85_guid(LPCWSTR,GUID*);
812 extern UINT MSIREG_OpenUninstallKey(MSIPACKAGE *package, HKEY *key, BOOL create);
813 extern UINT MSIREG_DeleteUninstallKey(MSIPACKAGE *package);
814 extern UINT MSIREG_OpenProductKey(LPCWSTR szProduct, LPCWSTR szUserSid,
815 MSIINSTALLCONTEXT context, HKEY* key, BOOL create);
816 extern UINT MSIREG_OpenFeaturesKey(LPCWSTR szProduct, MSIINSTALLCONTEXT context,
817 HKEY *key, BOOL create);
818 extern UINT MSIREG_OpenUserPatchesKey(LPCWSTR szPatch, HKEY* key, BOOL create);
819 UINT MSIREG_OpenUserDataFeaturesKey(LPCWSTR szProduct, MSIINSTALLCONTEXT context,
820 HKEY *key, BOOL create);
821 extern UINT MSIREG_OpenUserComponentsKey(LPCWSTR szComponent, HKEY* key, BOOL create);
822 extern UINT MSIREG_OpenUserDataComponentKey(LPCWSTR szComponent, LPCWSTR szUserSid,
823 HKEY *key, BOOL create);
824 extern UINT MSIREG_OpenPatchesKey(LPCWSTR szPatch, HKEY* key, BOOL create);
825 extern UINT MSIREG_OpenUserDataProductKey(LPCWSTR szProduct, MSIINSTALLCONTEXT dwContext,
826 LPCWSTR szUserSid, HKEY *key, BOOL create);
827 extern UINT MSIREG_OpenUserDataPatchKey(LPCWSTR szPatch, MSIINSTALLCONTEXT dwContext,
828 HKEY *key, BOOL create);
829 extern UINT MSIREG_OpenUserDataProductPatchesKey(LPCWSTR product, MSIINSTALLCONTEXT context,
830 HKEY *key, BOOL create);
831 extern UINT MSIREG_OpenInstallProps(LPCWSTR szProduct, MSIINSTALLCONTEXT dwContext,
832 LPCWSTR szUserSid, HKEY *key, BOOL create);
833 extern UINT MSIREG_OpenUpgradeCodesKey(LPCWSTR szProduct, HKEY* key, BOOL create);
834 extern UINT MSIREG_OpenUserUpgradeCodesKey(LPCWSTR szProduct, HKEY* key, BOOL create);
835 extern UINT MSIREG_DeleteProductKey(LPCWSTR szProduct);
836 extern UINT MSIREG_DeleteUserProductKey(LPCWSTR szProduct);
837 extern UINT MSIREG_DeleteUserDataPatchKey(LPCWSTR patch, MSIINSTALLCONTEXT context);
838 extern UINT MSIREG_DeleteUserDataProductKey(LPCWSTR szProduct);
839 extern UINT MSIREG_DeleteUserFeaturesKey(LPCWSTR szProduct);
840 extern UINT MSIREG_DeleteUserDataComponentKey(LPCWSTR szComponent, LPCWSTR szUserSid);
841 extern UINT MSIREG_DeleteUserUpgradeCodesKey(LPCWSTR szUpgradeCode);
842 extern UINT MSIREG_OpenClassesUpgradeCodesKey(LPCWSTR szUpgradeCode, HKEY* key, BOOL create);
843 extern UINT MSIREG_DeleteLocalClassesProductKey(LPCWSTR szProductCode);
844 extern UINT MSIREG_DeleteLocalClassesFeaturesKey(LPCWSTR szProductCode);
846 extern LPWSTR msi_reg_get_val_str( HKEY hkey, LPCWSTR name );
847 extern BOOL msi_reg_get_val_dword( HKEY hkey, LPCWSTR name, DWORD *val);
849 extern DWORD msi_version_str_to_dword(LPCWSTR p);
850 extern void msi_parse_version_string(LPCWSTR, PDWORD, PDWORD);
851 extern VS_FIXEDFILEINFO *msi_get_disk_file_version(LPCWSTR);
852 extern int msi_compare_file_versions(VS_FIXEDFILEINFO *, const WCHAR *);
855 extern LONG msi_reg_set_val_str( HKEY hkey, LPCWSTR name, LPCWSTR value );
856 extern LONG msi_reg_set_val_multi_str( HKEY hkey, LPCWSTR name, LPCWSTR value );
857 extern LONG msi_reg_set_val_dword( HKEY hkey, LPCWSTR name, DWORD val );
858 extern LONG msi_reg_set_subkey_val( HKEY hkey, LPCWSTR path, LPCWSTR name, LPCWSTR val );
860 /* msi dialog interface */
861 typedef UINT (*msi_dialog_event_handler)( MSIPACKAGE*, LPCWSTR, LPCWSTR, msi_dialog* );
862 extern msi_dialog *msi_dialog_create( MSIPACKAGE*, LPCWSTR, msi_dialog*, msi_dialog_event_handler );
863 extern UINT msi_dialog_run_message_loop( msi_dialog* );
864 extern void msi_dialog_end_dialog( msi_dialog* );
865 extern void msi_dialog_check_messages( HANDLE );
866 extern void msi_dialog_do_preview( msi_dialog* );
867 extern void msi_dialog_destroy( msi_dialog* );
868 extern void msi_dialog_unregister_class( void );
869 extern void msi_dialog_handle_event( msi_dialog*, LPCWSTR, LPCWSTR, MSIRECORD * );
870 extern UINT msi_dialog_reset( msi_dialog *dialog );
871 extern UINT msi_dialog_directorylist_up( msi_dialog *dialog );
872 extern msi_dialog *msi_dialog_get_parent( msi_dialog *dialog );
873 extern LPWSTR msi_dialog_get_name( msi_dialog *dialog );
874 extern UINT msi_spawn_error_dialog( MSIPACKAGE*, LPWSTR, LPWSTR );
876 /* summary information */
877 extern MSISUMMARYINFO *MSI_GetSummaryInformationW( IStorage *stg, UINT uiUpdateCount );
878 extern LPWSTR msi_suminfo_dup_string( MSISUMMARYINFO *si, UINT uiProperty );
879 extern INT msi_suminfo_get_int32( MSISUMMARYINFO *si, UINT uiProperty );
880 extern LPWSTR msi_get_suminfo_product( IStorage *stg );
881 extern UINT msi_add_suminfo( MSIDATABASE *db, LPWSTR **records, int num_records, int num_columns );
883 /* undocumented functions */
884 UINT WINAPI MsiCreateAndVerifyInstallerDirectory( DWORD );
885 UINT WINAPI MsiDecomposeDescriptorW( LPCWSTR, LPWSTR, LPWSTR, LPWSTR, LPDWORD );
886 UINT WINAPI MsiDecomposeDescriptorA( LPCSTR, LPSTR, LPSTR, LPSTR, LPDWORD );
887 LANGID WINAPI MsiLoadStringW( MSIHANDLE, UINT, LPWSTR, int, LANGID );
888 LANGID WINAPI MsiLoadStringA( MSIHANDLE, UINT, LPSTR, int, LANGID );
890 /* UI globals */
891 extern INSTALLUILEVEL gUILevel;
892 extern HWND gUIhwnd;
893 extern INSTALLUI_HANDLERA gUIHandlerA;
894 extern INSTALLUI_HANDLERW gUIHandlerW;
895 extern INSTALLUI_HANDLER_RECORD gUIHandlerRecord;
896 extern DWORD gUIFilter;
897 extern LPVOID gUIContext;
898 extern WCHAR *gszLogFile;
899 extern HINSTANCE msi_hInstance;
901 /* action related functions */
902 extern UINT ACTION_PerformAction(MSIPACKAGE *package, const WCHAR *action, UINT script);
903 extern UINT ACTION_PerformUIAction(MSIPACKAGE *package, const WCHAR *action, UINT script);
904 extern void ACTION_FinishCustomActions( const MSIPACKAGE* package);
905 extern UINT ACTION_CustomAction(MSIPACKAGE *package,const WCHAR *action, UINT script, BOOL execute);
907 /* actions in other modules */
908 extern UINT ACTION_AppSearch(MSIPACKAGE *package);
909 extern UINT ACTION_CCPSearch(MSIPACKAGE *package);
910 extern UINT ACTION_FindRelatedProducts(MSIPACKAGE *package);
911 extern UINT ACTION_InstallFiles(MSIPACKAGE *package);
912 extern UINT ACTION_RemoveFiles(MSIPACKAGE *package);
913 extern UINT ACTION_MoveFiles(MSIPACKAGE *package);
914 extern UINT ACTION_DuplicateFiles(MSIPACKAGE *package);
915 extern UINT ACTION_RemoveDuplicateFiles(MSIPACKAGE *package);
916 extern UINT ACTION_RegisterClassInfo(MSIPACKAGE *package);
917 extern UINT ACTION_RegisterProgIdInfo(MSIPACKAGE *package);
918 extern UINT ACTION_RegisterExtensionInfo(MSIPACKAGE *package);
919 extern UINT ACTION_RegisterMIMEInfo(MSIPACKAGE *package);
920 extern UINT ACTION_RegisterFonts(MSIPACKAGE *package);
921 extern UINT ACTION_UnregisterClassInfo(MSIPACKAGE *package);
922 extern UINT ACTION_UnregisterExtensionInfo(MSIPACKAGE *package);
923 extern UINT ACTION_UnregisterFonts(MSIPACKAGE *package);
924 extern UINT ACTION_UnregisterMIMEInfo(MSIPACKAGE *package);
925 extern UINT ACTION_UnregisterProgIdInfo(MSIPACKAGE *package);
926 extern UINT ACTION_MsiPublishAssemblies(MSIPACKAGE *package);
928 /* Helpers */
929 extern DWORD deformat_string(MSIPACKAGE *package, LPCWSTR ptr, WCHAR** data );
930 extern LPWSTR msi_dup_record_field(MSIRECORD *row, INT index);
931 extern LPWSTR msi_dup_property( MSIDATABASE *db, LPCWSTR prop );
932 extern UINT msi_set_property( MSIDATABASE *, LPCWSTR, LPCWSTR );
933 extern UINT msi_get_property( MSIDATABASE *, LPCWSTR, LPWSTR, LPDWORD );
934 extern int msi_get_property_int( MSIDATABASE *package, LPCWSTR prop, int def );
935 extern LPWSTR resolve_folder(MSIPACKAGE *package, LPCWSTR name, BOOL source,
936 BOOL set_prop, BOOL load_prop, MSIFOLDER **folder);
937 extern LPWSTR resolve_file_source(MSIPACKAGE *package, MSIFILE *file);
938 extern void msi_reset_folders( MSIPACKAGE *package, BOOL source );
939 extern MSICOMPONENT *get_loaded_component( MSIPACKAGE* package, LPCWSTR Component );
940 extern MSIFEATURE *get_loaded_feature( MSIPACKAGE* package, LPCWSTR Feature );
941 extern MSIFILE *get_loaded_file( MSIPACKAGE* package, LPCWSTR file );
942 extern MSIFOLDER *get_loaded_folder( MSIPACKAGE *package, LPCWSTR dir );
943 extern int track_tempfile(MSIPACKAGE *package, LPCWSTR path);
944 extern UINT schedule_action(MSIPACKAGE *package, UINT script, LPCWSTR action);
945 extern void msi_free_action_script(MSIPACKAGE *package, UINT script);
946 extern LPWSTR build_icon_path(MSIPACKAGE *, LPCWSTR);
947 extern LPWSTR build_directory_name(DWORD , ...);
948 extern BOOL create_full_pathW(const WCHAR *path);
949 extern void reduce_to_longfilename(WCHAR*);
950 extern LPWSTR create_component_advertise_string(MSIPACKAGE*, MSICOMPONENT*, LPCWSTR);
951 extern void ACTION_UpdateComponentStates(MSIPACKAGE *package, LPCWSTR szFeature);
952 extern UINT register_unique_action(MSIPACKAGE *, LPCWSTR);
953 extern BOOL check_unique_action(const MSIPACKAGE *, LPCWSTR);
954 extern WCHAR* generate_error_string(MSIPACKAGE *, UINT, DWORD, ... );
955 extern UINT msi_set_last_used_source(LPCWSTR product, LPCWSTR usersid,
956 MSIINSTALLCONTEXT context, DWORD options, LPCWSTR value);
957 extern UINT msi_get_local_package_name(LPWSTR path, LPCWSTR suffix);
958 extern UINT msi_set_sourcedir_props(MSIPACKAGE *package, BOOL replace);
959 extern void msi_component_set_state(MSIPACKAGE *, MSICOMPONENT *, INSTALLSTATE);
960 extern void msi_feature_set_state(MSIPACKAGE *, MSIFEATURE *, INSTALLSTATE);
961 extern MSIASSEMBLY *load_assembly(MSIPACKAGE *, MSICOMPONENT *);
962 extern UINT install_assembly(MSIPACKAGE *, MSICOMPONENT *);
964 /* media */
966 typedef BOOL (*PMSICABEXTRACTCB)(MSIPACKAGE *, LPCWSTR, DWORD, LPWSTR *, DWORD *, PVOID);
968 #define MSICABEXTRACT_BEGINEXTRACT 0x01
969 #define MSICABEXTRACT_FILEEXTRACTED 0x02
971 typedef struct
973 MSIPACKAGE* package;
974 MSIMEDIAINFO *mi;
975 PMSICABEXTRACTCB cb;
976 LPWSTR curfile;
977 PVOID user;
978 } MSICABDATA;
980 extern UINT ready_media(MSIPACKAGE *package, MSIFILE *file, MSIMEDIAINFO *mi);
981 extern void msi_free_media_info(MSIMEDIAINFO *mi);
982 extern BOOL msi_cabextract(MSIPACKAGE* package, MSIMEDIAINFO *mi, LPVOID data);
984 /* control event stuff */
985 extern VOID ControlEvent_FireSubscribedEvent(MSIPACKAGE *package, LPCWSTR event,
986 MSIRECORD *data);
987 extern VOID ControlEvent_CleanupDialogSubscriptions(MSIPACKAGE *package, LPWSTR dialog);
988 extern VOID ControlEvent_CleanupSubscriptions(MSIPACKAGE *package);
989 extern VOID ControlEvent_SubscribeToEvent(MSIPACKAGE *package, msi_dialog *dialog,
990 LPCWSTR event, LPCWSTR control, LPCWSTR attribute);
992 /* OLE automation */
993 extern HRESULT create_msiserver(IUnknown *pOuter, LPVOID *ppObj);
994 extern HRESULT create_session(MSIHANDLE msiHandle, IDispatch *pInstaller, IDispatch **pDispatch);
995 extern HRESULT load_type_info(IDispatch *iface, ITypeInfo **pptinfo, REFIID clsid, LCID lcid);
997 /* Scripting */
998 extern DWORD call_script(MSIHANDLE hPackage, INT type, LPCWSTR script, LPCWSTR function, LPCWSTR action);
1000 /* User Interface messages from the actions */
1001 extern void ui_progress(MSIPACKAGE *, int, int, int, int);
1002 extern void ui_actiondata(MSIPACKAGE *, LPCWSTR, MSIRECORD *);
1004 /* common strings */
1005 static const WCHAR cszSourceDir[] = {'S','o','u','r','c','e','D','i','r',0};
1006 static const WCHAR cszSOURCEDIR[] = {'S','O','U','R','C','E','D','I','R',0};
1007 static const WCHAR cszRootDrive[] = {'R','O','O','T','D','R','I','V','E',0};
1008 static const WCHAR szLocalSid[] = {'S','-','1','-','5','-','1','8',0};
1009 static const WCHAR szEmpty[] = {0};
1010 static const WCHAR szAll[] = {'A','L','L',0};
1011 static const WCHAR szOne[] = {'1',0};
1012 static const WCHAR szZero[] = {'0',0};
1013 static const WCHAR szSpace[] = {' ',0};
1014 static const WCHAR szBackSlash[] = {'\\',0};
1015 static const WCHAR szForwardSlash[] = {'/',0};
1016 static const WCHAR szDot[] = {'.',0};
1017 static const WCHAR szDotDot[] = {'.','.',0};
1018 static const WCHAR szSemiColon[] = {';',0};
1019 static const WCHAR szPreselected[] = {'P','r','e','s','e','l','e','c','t','e','d',0};
1020 static const WCHAR szPatches[] = {'P','a','t','c','h','e','s',0};
1021 static const WCHAR szState[] = {'S','t','a','t','e',0};
1022 static const WCHAR szMsi[] = {'m','s','i',0};
1023 static const WCHAR szPatch[] = {'P','A','T','C','H',0};
1024 static const WCHAR szSourceList[] = {'S','o','u','r','c','e','L','i','s','t',0};
1025 static const WCHAR szInstalled[] = {'I','n','s','t','a','l','l','e','d',0};
1026 static const WCHAR szReinstall[] = {'R','E','I','N','S','T','A','L','L',0};
1027 static const WCHAR szReinstallMode[] = {'R','E','I','N','S','T','A','L','L','M','O','D','E',0};
1028 static const WCHAR szRemove[] = {'R','E','M','O','V','E',0};
1029 static const WCHAR szUserSID[] = {'U','s','e','r','S','I','D',0};
1030 static const WCHAR szProductCode[] = {'P','r','o','d','u','c','t','C','o','d','e',0};
1031 static const WCHAR szRegisterClassInfo[] = {'R','e','g','i','s','t','e','r','C','l','a','s','s','I','n','f','o',0};
1032 static const WCHAR szRegisterProgIdInfo[] = {'R','e','g','i','s','t','e','r','P','r','o','g','I','d','I','n','f','o',0};
1033 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};
1034 static const WCHAR szRegisterMIMEInfo[] = {'R','e','g','i','s','t','e','r','M','I','M','E','I','n','f','o',0};
1035 static const WCHAR szDuplicateFiles[] = {'D','u','p','l','i','c','a','t','e','F','i','l','e','s',0};
1036 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};
1037 static const WCHAR szInstallFiles[] = {'I','n','s','t','a','l','l','F','i','l','e','s',0};
1038 static const WCHAR szRemoveFiles[] = {'R','e','m','o','v','e','F','i','l','e','s',0};
1039 static const WCHAR szFindRelatedProducts[] = {'F','i','n','d','R','e','l','a','t','e','d','P','r','o','d','u','c','t','s',0};
1040 static const WCHAR szAllUsers[] = {'A','L','L','U','S','E','R','S',0};
1041 static const WCHAR szCustomActionData[] = {'C','u','s','t','o','m','A','c','t','i','o','n','D','a','t','a',0};
1042 static const WCHAR szUILevel[] = {'U','I','L','e','v','e','l',0};
1043 static const WCHAR szProductID[] = {'P','r','o','d','u','c','t','I','D',0};
1044 static const WCHAR szPIDTemplate[] = {'P','I','D','T','e','m','p','l','a','t','e',0};
1045 static const WCHAR szPIDKEY[] = {'P','I','D','K','E','Y',0};
1046 static const WCHAR szTYPELIB[] = {'T','Y','P','E','L','I','B',0};
1047 static const WCHAR szSumInfo[] = {5 ,'S','u','m','m','a','r','y','I','n','f','o','r','m','a','t','i','o','n',0};
1048 static const WCHAR szHCR[] = {'H','K','E','Y','_','C','L','A','S','S','E','S','_','R','O','O','T','\\',0};
1049 static const WCHAR szHCU[] = {'H','K','E','Y','_','C','U','R','R','E','N','T','_','U','S','E','R','\\',0};
1050 static const WCHAR szHLM[] = {'H','K','E','Y','_','L','O','C','A','L','_','M','A','C','H','I','N','E','\\',0};
1051 static const WCHAR szHU[] = {'H','K','E','Y','_','U','S','E','R','S','\\',0};
1052 static const WCHAR szWindowsFolder[] = {'W','i','n','d','o','w','s','F','o','l','d','e','r',0};
1053 static const WCHAR szAppSearch[] = {'A','p','p','S','e','a','r','c','h',0};
1054 static const WCHAR szMoveFiles[] = {'M','o','v','e','F','i','l','e','s',0};
1055 static const WCHAR szCCPSearch[] = {'C','C','P','S','e','a','r','c','h',0};
1056 static const WCHAR szUnregisterClassInfo[] = {'U','n','r','e','g','i','s','t','e','r','C','l','a','s','s','I','n','f','o',0};
1057 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};
1058 static const WCHAR szUnregisterMIMEInfo[] = {'U','n','r','e','g','i','s','t','e','r','M','I','M','E','I','n','f','o',0};
1059 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};
1060 static const WCHAR szRegisterFonts[] = {'R','e','g','i','s','t','e','r','F','o','n','t','s',0};
1061 static const WCHAR szUnregisterFonts[] = {'U','n','r','e','g','i','s','t','e','r','F','o','n','t','s',0};
1062 static const WCHAR szCLSID[] = {'C','L','S','I','D',0};
1063 static const WCHAR szProgID[] = {'P','r','o','g','I','D',0};
1064 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};
1065 static const WCHAR szAppID[] = {'A','p','p','I','D',0};
1066 static const WCHAR szDefaultIcon[] = {'D','e','f','a','u','l','t','I','c','o','n',0};
1067 static const WCHAR szInprocHandler[] = {'I','n','p','r','o','c','H','a','n','d','l','e','r',0};
1068 static const WCHAR szInprocHandler32[] = {'I','n','p','r','o','c','H','a','n','d','l','e','r','3','2',0};
1069 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};
1070 static const WCHAR szLocalPackage[] = {'L','o','c','a','l','P','a','c','k','a','g','e',0};
1071 static const WCHAR szOriginalDatabase[] = {'O','r','i','g','i','n','a','l','D','a','t','a','b','a','s','e',0};
1072 static const WCHAR szUpgradeCode[] = {'U','p','g','r','a','d','e','C','o','d','e',0};
1073 static const WCHAR szAdminUser[] = {'A','d','m','i','n','U','s','e','r',0};
1074 static const WCHAR szIntel[] = {'I','n','t','e','l',0};
1075 static const WCHAR szIntel64[] = {'I','n','t','e','l','6','4',0};
1076 static const WCHAR szX64[] = {'x','6','4',0};
1077 static const WCHAR szWow6432NodeCLSID[] = {'W','o','w','6','4','3','2','N','o','d','e','\\','C','L','S','I','D',0};
1078 static const WCHAR szWow6432Node[] = {'W','o','w','6','4','3','2','N','o','d','e',0};
1079 static const WCHAR szStreams[] = {'_','S','t','r','e','a','m','s',0};
1080 static const WCHAR szStorages[] = {'_','S','t','o','r','a','g','e','s',0};
1081 static const WCHAR szMsiPublishAssemblies[] = {'M','s','i','P','u','b','l','i','s','h','A','s','s','e','m','b','l','i','e','s',0};
1083 /* memory allocation macro functions */
1084 static void *msi_alloc( size_t len ) __WINE_ALLOC_SIZE(1);
1085 static inline void *msi_alloc( size_t len )
1087 return HeapAlloc( GetProcessHeap(), 0, len );
1090 static void *msi_alloc_zero( size_t len ) __WINE_ALLOC_SIZE(1);
1091 static inline void *msi_alloc_zero( size_t len )
1093 return HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, len );
1096 static void *msi_realloc( void *mem, size_t len ) __WINE_ALLOC_SIZE(2);
1097 static inline void *msi_realloc( void *mem, size_t len )
1099 return HeapReAlloc( GetProcessHeap(), 0, mem, len );
1102 static void *msi_realloc_zero( void *mem, size_t len ) __WINE_ALLOC_SIZE(2);
1103 static inline void *msi_realloc_zero( void *mem, size_t len )
1105 return HeapReAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, mem, len );
1108 static inline BOOL msi_free( void *mem )
1110 return HeapFree( GetProcessHeap(), 0, mem );
1113 static inline char *strdupWtoA( LPCWSTR str )
1115 LPSTR ret = NULL;
1116 DWORD len;
1118 if (!str) return ret;
1119 len = WideCharToMultiByte( CP_ACP, 0, str, -1, NULL, 0, NULL, NULL);
1120 ret = msi_alloc( len );
1121 if (ret)
1122 WideCharToMultiByte( CP_ACP, 0, str, -1, ret, len, NULL, NULL );
1123 return ret;
1126 static inline LPWSTR strdupAtoW( LPCSTR str )
1128 LPWSTR ret = NULL;
1129 DWORD len;
1131 if (!str) return ret;
1132 len = MultiByteToWideChar( CP_ACP, 0, str, -1, NULL, 0 );
1133 ret = msi_alloc( len * sizeof(WCHAR) );
1134 if (ret)
1135 MultiByteToWideChar( CP_ACP, 0, str, -1, ret, len );
1136 return ret;
1139 static inline LPWSTR strdupW( LPCWSTR src )
1141 LPWSTR dest;
1142 if (!src) return NULL;
1143 dest = msi_alloc( (lstrlenW(src)+1)*sizeof(WCHAR) );
1144 if (dest)
1145 lstrcpyW(dest, src);
1146 return dest;
1149 #endif /* __WINE_MSI_PRIVATE__ */