d3d8: Stop setting the device state in d3d8_device_SetPixelShaderConstant().
[wine.git] / dlls / msi / msipriv.h
blob572bb08768173eaa5e3f314f91d9b4894ce7313f
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 #include "msiserver.h"
42 #include "winemsi.h"
44 static const BOOL is_64bit = sizeof(void *) > sizeof(int);
45 extern BOOL is_wow64 DECLSPEC_HIDDEN;
47 #define MSI_DATASIZEMASK 0x00ff
48 #define MSITYPE_VALID 0x0100
49 #define MSITYPE_LOCALIZABLE 0x200
50 #define MSITYPE_STRING 0x0800
51 #define MSITYPE_NULLABLE 0x1000
52 #define MSITYPE_KEY 0x2000
53 #define MSITYPE_TEMPORARY 0x4000
54 #define MSITYPE_UNKNOWN 0x8000
56 #define MAX_STREAM_NAME_LEN 62
57 #define LONG_STR_BYTES 3
59 /* Install UI level mask for AND operation to exclude flags */
60 #define INSTALLUILEVEL_MASK 0x0007
62 #define MSITYPE_IS_BINARY(type) (((type) & ~MSITYPE_NULLABLE) == (MSITYPE_STRING|MSITYPE_VALID))
64 struct tagMSITABLE;
65 typedef struct tagMSITABLE MSITABLE;
67 struct string_table;
68 typedef struct string_table string_table;
70 struct tagMSIOBJECTHDR;
71 typedef struct tagMSIOBJECTHDR MSIOBJECTHDR;
73 typedef VOID (*msihandledestructor)( MSIOBJECTHDR * );
75 struct tagMSIOBJECTHDR
77 UINT magic;
78 UINT type;
79 LONG refcount;
80 msihandledestructor destructor;
83 #define MSI_INITIAL_MEDIA_TRANSFORM_OFFSET 10000
84 #define MSI_INITIAL_MEDIA_TRANSFORM_DISKID 32000
86 typedef struct tagMSISTREAM
88 UINT str_index;
89 IStream *stream;
90 } MSISTREAM;
92 typedef struct tagMSITRANSFORM
94 struct list entry;
95 IStorage *stg;
96 } MSITRANSFORM;
98 /* integer versions of the MSIDBOPEN_* constants */
99 #define MSI_OPEN_READONLY 0
100 #define MSI_OPEN_TRANSACT 1
101 #define MSI_OPEN_DIRECT 2
102 #define MSI_OPEN_CREATE 3
103 #define MSI_OPEN_CREATEDIRECT 4
104 #define MSI_OPEN_PATCHFILE 32
106 typedef struct tagMSIDATABASE
108 MSIOBJECTHDR hdr;
109 IStorage *storage;
110 string_table *strings;
111 UINT bytes_per_strref;
112 LPWSTR path;
113 LPWSTR deletefile;
114 LPWSTR tempfolder;
115 UINT mode;
116 UINT media_transform_offset;
117 UINT media_transform_disk_id;
118 struct list tables;
119 struct list transforms;
120 MSISTREAM *streams;
121 UINT num_streams;
122 UINT num_streams_allocated;
123 } MSIDATABASE;
125 typedef struct tagMSIVIEW MSIVIEW;
127 typedef struct tagMSIQUERY
129 MSIOBJECTHDR hdr;
130 MSIVIEW *view;
131 UINT row;
132 MSIDATABASE *db;
133 struct list mem;
134 } MSIQUERY;
136 /* maybe we can use a Variant instead of doing it ourselves? */
137 typedef struct tagMSIFIELD
139 UINT type;
140 union
142 INT iVal;
143 LPWSTR szwVal;
144 IStream *stream;
145 } u;
146 int len;
147 } MSIFIELD;
149 typedef struct tagMSIRECORD
151 MSIOBJECTHDR hdr;
152 UINT count; /* as passed to MsiCreateRecord */
153 UINT64 cookie;
154 MSIFIELD fields[1]; /* nb. array size is count+1 */
155 } MSIRECORD;
157 typedef struct tagMSISOURCELISTINFO
159 struct list entry;
160 DWORD context;
161 DWORD options;
162 LPCWSTR property;
163 LPWSTR value;
164 } MSISOURCELISTINFO;
166 typedef struct tagMSIMEDIADISK
168 struct list entry;
169 DWORD context;
170 DWORD options;
171 DWORD disk_id;
172 LPWSTR volume_label;
173 LPWSTR disk_prompt;
174 } MSIMEDIADISK;
176 typedef struct tagMSIMEDIAINFO
178 UINT disk_id;
179 UINT type;
180 UINT last_sequence;
181 LPWSTR disk_prompt;
182 LPWSTR cabinet;
183 LPWSTR volume_label;
184 LPWSTR last_volume;
185 BOOL is_continuous;
186 BOOL is_extracted;
187 WCHAR sourcedir[MAX_PATH];
188 } MSIMEDIAINFO;
190 typedef struct tagMSICABINETSTREAM
192 struct list entry;
193 UINT disk_id;
194 IStorage *storage;
195 WCHAR *stream;
196 } MSICABINETSTREAM;
198 typedef struct tagMSIPATCHINFO
200 struct list entry;
201 LPWSTR patchcode;
202 LPWSTR products;
203 LPWSTR transforms;
204 LPWSTR filename;
205 LPWSTR localfile;
206 MSIPATCHSTATE state;
207 DWORD uninstallable;
208 BOOL delete_on_close;
209 BOOL registered;
210 UINT disk_id;
211 } MSIPATCHINFO;
213 typedef struct tagMSIBINARY
215 struct list entry;
216 WCHAR *source;
217 WCHAR *tmpfile;
218 } MSIBINARY;
220 typedef struct _column_info
222 LPCWSTR table;
223 LPCWSTR column;
224 INT type;
225 BOOL temporary;
226 struct expr *val;
227 struct _column_info *next;
228 } column_info;
230 typedef const struct tagMSICOLUMNHASHENTRY *MSIITERHANDLE;
232 typedef struct tagMSIVIEWOPS
235 * fetch_int - reads one integer from {row,col} in the table
237 * This function should be called after the execute method.
238 * Data returned by the function should not change until
239 * close or delete is called.
240 * To get a string value, query the database's string table with
241 * the integer value returned from this function.
243 UINT (*fetch_int)( struct tagMSIVIEW *view, UINT row, UINT col, UINT *val );
246 * fetch_stream - gets a stream from {row,col} in the table
248 * This function is similar to fetch_int, except fetches a
249 * stream instead of an integer.
251 UINT (*fetch_stream)( struct tagMSIVIEW *view, UINT row, UINT col, IStream **stm );
254 * set_int - set the integer value at {row, col}
255 * This function has undefined behaviour if the column does not contain
256 * integers.
258 UINT (*set_int)( struct tagMSIVIEW *view, UINT row, UINT col, int val );
261 * set_string - set the string value at {row, col}
262 * This function has undefined behaviour if the column does not contain
263 * strings.
265 UINT (*set_string)( struct tagMSIVIEW *view, UINT row, UINT col, const WCHAR *val, int len );
268 * set_stream - set the stream value at {row, col}
269 * This function has undefined behaviour if the column does not contain
270 * streams.
272 UINT (*set_stream)( struct tagMSIVIEW *view, UINT row, UINT col, IStream *stream );
275 * set_row - sets values in a row as specified by mask
277 * Similar semantics to fetch_int
279 UINT (*set_row)( struct tagMSIVIEW *view, UINT row, MSIRECORD *rec, UINT mask );
282 * Inserts a new row into the database from the records contents
284 UINT (*insert_row)( struct tagMSIVIEW *view, MSIRECORD *record, UINT row, BOOL temporary );
287 * Deletes a row from the database
289 UINT (*delete_row)( struct tagMSIVIEW *view, UINT row );
292 * execute - loads the underlying data into memory so it can be read
294 UINT (*execute)( struct tagMSIVIEW *view, MSIRECORD *record );
297 * close - clears the data read by execute from memory
299 UINT (*close)( struct tagMSIVIEW *view );
302 * get_dimensions - returns the number of rows or columns in a table.
304 * The number of rows can only be queried after the execute method
305 * is called. The number of columns can be queried at any time.
307 UINT (*get_dimensions)( struct tagMSIVIEW *view, UINT *rows, UINT *cols );
310 * get_column_info - returns the name and type of a specific column
312 * The column information can be queried at any time.
314 UINT (*get_column_info)( struct tagMSIVIEW *view, UINT n, LPCWSTR *name, UINT *type,
315 BOOL *temporary, LPCWSTR *table_name );
318 * modify - not yet implemented properly
320 UINT (*modify)( struct tagMSIVIEW *view, MSIMODIFY eModifyMode, MSIRECORD *record, UINT row );
323 * delete - destroys the structure completely
325 UINT (*delete)( struct tagMSIVIEW * );
328 * add_ref - increases the reference count of the table
330 UINT (*add_ref)( struct tagMSIVIEW *view );
333 * release - decreases the reference count of the table
335 UINT (*release)( struct tagMSIVIEW *view );
338 * add_column - adds a column to the table
340 UINT (*add_column)( struct tagMSIVIEW *view, LPCWSTR table, UINT number, LPCWSTR column, UINT type, BOOL hold );
343 * sort - orders the table by columns
345 UINT (*sort)( struct tagMSIVIEW *view, column_info *columns );
348 * drop - drops the table from the database
350 UINT (*drop)( struct tagMSIVIEW *view );
351 } MSIVIEWOPS;
353 struct tagMSIVIEW
355 MSIOBJECTHDR hdr;
356 const MSIVIEWOPS *ops;
357 MSIDBERROR error;
358 const WCHAR *error_column;
361 struct msi_dialog_tag;
362 typedef struct msi_dialog_tag msi_dialog;
364 enum platform
366 PLATFORM_UNRECOGNIZED,
367 PLATFORM_INTEL,
368 PLATFORM_INTEL64,
369 PLATFORM_X64,
370 PLATFORM_ARM,
371 PLATFORM_ARM64
374 enum clr_version
376 CLR_VERSION_V10,
377 CLR_VERSION_V11,
378 CLR_VERSION_V20,
379 CLR_VERSION_V40,
380 CLR_VERSION_MAX
383 enum script
385 SCRIPT_NONE = -1,
386 SCRIPT_INSTALL = 0,
387 SCRIPT_COMMIT = 1,
388 SCRIPT_ROLLBACK = 2,
389 SCRIPT_MAX = 3
392 typedef struct tagMSIPACKAGE
394 MSIOBJECTHDR hdr;
395 MSIDATABASE *db;
396 INT version;
397 enum platform platform;
398 UINT num_langids;
399 LANGID *langids;
400 void *cookie;
401 struct list patches;
402 struct list components;
403 struct list features;
404 struct list files;
405 struct list filepatches;
406 struct list tempfiles;
407 struct list folders;
408 struct list binaries;
409 struct list cabinet_streams;
410 LPWSTR ActionFormat;
411 LPWSTR LastAction;
412 LPWSTR LastActionTemplate;
413 UINT LastActionResult;
414 UINT action_progress_increment;
415 HANDLE log_file;
416 HMODULE hfusion10;
417 HMODULE hfusion11;
418 HMODULE hfusion20;
419 HMODULE hfusion40;
420 HMODULE hmscoree;
421 HRESULT (WINAPI *pGetFileVersion)( const WCHAR *, WCHAR *, DWORD, DWORD * );
422 HRESULT (WINAPI *pCreateAssemblyNameObject)( IAssemblyName **, const WCHAR *, DWORD, void * );
423 HRESULT (WINAPI *pCreateAssemblyEnum)( IAssemblyEnum **, IUnknown *, IAssemblyName *, DWORD, void * );
424 IAssemblyCache *cache_net[CLR_VERSION_MAX];
425 IAssemblyCache *cache_sxs;
427 struct list classes;
428 struct list extensions;
429 struct list progids;
430 struct list mimes;
431 struct list appids;
433 enum script script;
434 LPWSTR *script_actions[SCRIPT_MAX];
435 int script_actions_count[SCRIPT_MAX];
436 LPWSTR *unique_actions;
437 int unique_actions_count;
438 BOOL ExecuteSequenceRun;
439 UINT InWhatSequence;
441 struct list RunningActions;
443 HANDLE custom_server_32_process;
444 HANDLE custom_server_64_process;
445 HANDLE custom_server_32_pipe;
446 HANDLE custom_server_64_pipe;
448 LPWSTR PackagePath;
449 LPWSTR ProductCode;
450 LPWSTR localfile;
451 BOOL delete_on_close;
453 INSTALLUILEVEL ui_level;
454 msi_dialog *dialog;
455 LPWSTR next_dialog;
456 float center_x;
457 float center_y;
459 UINT WordCount;
460 UINT Context;
462 struct list subscriptions;
464 struct list sourcelist_info;
465 struct list sourcelist_media;
467 unsigned char scheduled_action_running : 1;
468 unsigned char commit_action_running : 1;
469 unsigned char rollback_action_running : 1;
470 unsigned char need_reboot_at_end : 1;
471 unsigned char need_reboot_now : 1;
472 unsigned char need_rollback : 1;
473 unsigned char rpc_server_started : 1;
474 } MSIPACKAGE;
476 typedef struct tagMSIPREVIEW
478 MSIOBJECTHDR hdr;
479 MSIPACKAGE *package;
480 msi_dialog *dialog;
481 } MSIPREVIEW;
483 #define MSI_MAX_PROPS 20
485 typedef struct tagMSISUMMARYINFO
487 MSIOBJECTHDR hdr;
488 IStorage *storage;
489 DWORD update_count;
490 PROPVARIANT property[MSI_MAX_PROPS];
491 } MSISUMMARYINFO;
493 typedef struct tagMSIFEATURE
495 struct list entry;
496 LPWSTR Feature;
497 LPWSTR Feature_Parent;
498 LPWSTR Title;
499 LPWSTR Description;
500 INT Display;
501 INT Level;
502 LPWSTR Directory;
503 INT Attributes;
504 INSTALLSTATE Installed;
505 INSTALLSTATE ActionRequest;
506 INSTALLSTATE Action;
507 struct list Children;
508 struct list Components;
509 } MSIFEATURE;
511 typedef struct tagMSIASSEMBLY
513 LPWSTR feature;
514 LPWSTR manifest;
515 LPWSTR application;
516 DWORD attributes;
517 LPWSTR display_name;
518 LPWSTR tempdir;
519 BOOL installed;
520 BOOL clr_version[CLR_VERSION_MAX];
521 } MSIASSEMBLY;
523 typedef struct tagMSICOMPONENT
525 struct list entry;
526 LPWSTR Component;
527 LPWSTR ComponentId;
528 LPWSTR Directory;
529 INT Attributes;
530 LPWSTR Condition;
531 LPWSTR KeyPath;
532 INSTALLSTATE Installed;
533 INSTALLSTATE ActionRequest;
534 INSTALLSTATE Action;
535 BOOL ForceLocalState;
536 BOOL Enabled;
537 INT Cost;
538 INT RefCount;
539 LPWSTR FullKeypath;
540 LPWSTR AdvertiseString;
541 MSIASSEMBLY *assembly;
542 int num_clients;
544 unsigned int anyAbsent:1;
545 unsigned int hasAdvertisedFeature:1;
546 unsigned int hasLocalFeature:1;
547 unsigned int hasSourceFeature:1;
548 } MSICOMPONENT;
550 typedef struct tagComponentList
552 struct list entry;
553 MSICOMPONENT *component;
554 } ComponentList;
556 typedef struct tagFeatureList
558 struct list entry;
559 MSIFEATURE *feature;
560 } FeatureList;
562 enum folder_state
564 FOLDER_STATE_UNINITIALIZED,
565 FOLDER_STATE_EXISTS,
566 FOLDER_STATE_CREATED,
567 FOLDER_STATE_CREATED_PERSISTENT,
568 FOLDER_STATE_REMOVED
571 typedef struct tagMSIFOLDER
573 struct list entry;
574 struct list children;
575 LPWSTR Directory;
576 LPWSTR Parent;
577 LPWSTR TargetDefault;
578 LPWSTR SourceLongPath;
579 LPWSTR SourceShortPath;
580 LPWSTR ResolvedTarget;
581 LPWSTR ResolvedSource;
582 enum folder_state State;
583 BOOL persistent;
584 } MSIFOLDER;
586 typedef struct tagFolderList
588 struct list entry;
589 MSIFOLDER *folder;
590 } FolderList;
592 typedef enum _msi_file_state {
593 msifs_invalid,
594 msifs_missing,
595 msifs_overwrite,
596 msifs_present,
597 msifs_installed,
598 msifs_skipped,
599 msifs_hashmatch
600 } msi_file_state;
602 typedef struct tagMSIFILE
604 struct list entry;
605 LPWSTR File;
606 MSICOMPONENT *Component;
607 LPWSTR FileName;
608 LPWSTR ShortName;
609 LPWSTR LongName;
610 INT FileSize;
611 LPWSTR Version;
612 LPWSTR Language;
613 INT Attributes;
614 INT Sequence;
615 msi_file_state state;
616 LPWSTR TargetPath;
617 BOOL IsCompressed;
618 MSIFILEHASHINFO hash;
619 UINT disk_id;
620 } MSIFILE;
622 typedef struct tagMSIFILEPATCH
624 struct list entry;
625 MSIFILE *File;
626 INT Sequence;
627 INT PatchSize;
628 INT Attributes;
629 BOOL extracted;
630 UINT disk_id;
631 WCHAR *path;
632 } MSIFILEPATCH;
634 typedef struct tagMSIAPPID
636 struct list entry;
637 LPWSTR AppID; /* Primary key */
638 LPWSTR RemoteServerName;
639 LPWSTR LocalServer;
640 LPWSTR ServiceParameters;
641 LPWSTR DllSurrogate;
642 BOOL ActivateAtStorage;
643 BOOL RunAsInteractiveUser;
644 } MSIAPPID;
646 typedef struct tagMSIPROGID MSIPROGID;
648 typedef struct tagMSICLASS
650 struct list entry;
651 LPWSTR clsid; /* Primary Key */
652 LPWSTR Context; /* Primary Key */
653 MSICOMPONENT *Component;
654 MSIPROGID *ProgID;
655 LPWSTR ProgIDText;
656 LPWSTR Description;
657 MSIAPPID *AppID;
658 LPWSTR FileTypeMask;
659 LPWSTR IconPath;
660 LPWSTR DefInprocHandler;
661 LPWSTR DefInprocHandler32;
662 LPWSTR Argument;
663 MSIFEATURE *Feature;
664 INT Attributes;
665 /* not in the table, set during installation */
666 INSTALLSTATE action;
667 } MSICLASS;
669 typedef struct tagMSIMIME MSIMIME;
671 typedef struct tagMSIEXTENSION
673 struct list entry;
674 LPWSTR Extension; /* Primary Key */
675 MSICOMPONENT *Component;
676 MSIPROGID *ProgID;
677 LPWSTR ProgIDText;
678 MSIMIME *Mime;
679 MSIFEATURE *Feature;
680 /* not in the table, set during installation */
681 INSTALLSTATE action;
682 struct list verbs;
683 } MSIEXTENSION;
685 struct tagMSIPROGID
687 struct list entry;
688 LPWSTR ProgID; /* Primary Key */
689 MSIPROGID *Parent;
690 MSICLASS *Class;
691 LPWSTR Description;
692 LPWSTR IconPath;
693 /* not in the table, set during installation */
694 MSIPROGID *CurVer;
695 MSIPROGID *VersionInd;
698 typedef struct tagMSIVERB
700 struct list entry;
701 LPWSTR Verb;
702 INT Sequence;
703 LPWSTR Command;
704 LPWSTR Argument;
705 } MSIVERB;
707 struct tagMSIMIME
709 struct list entry;
710 LPWSTR ContentType; /* Primary Key */
711 MSIEXTENSION *Extension;
712 LPWSTR suffix;
713 LPWSTR clsid;
714 MSICLASS *Class;
717 #define SEQUENCE_UI 0x1
718 #define SEQUENCE_EXEC 0x2
720 #define MSIHANDLETYPE_ANY 0
721 #define MSIHANDLETYPE_DATABASE 1
722 #define MSIHANDLETYPE_SUMMARYINFO 2
723 #define MSIHANDLETYPE_VIEW 3
724 #define MSIHANDLETYPE_RECORD 4
725 #define MSIHANDLETYPE_PACKAGE 5
726 #define MSIHANDLETYPE_PREVIEW 6
728 #define MSI_MAJORVERSION 4
729 #define MSI_MINORVERSION 5
730 #define MSI_BUILDNUMBER 6001
732 #define GUID_SIZE 39
733 #define SQUASHED_GUID_SIZE 33
735 #define MSIHANDLE_MAGIC 0x4d434923
737 /* handle unicode/ascii output in the Msi* API functions */
738 typedef struct {
739 BOOL unicode;
740 union {
741 LPSTR a;
742 LPWSTR w;
743 } str;
744 } awstring;
746 typedef struct {
747 BOOL unicode;
748 union {
749 LPCSTR a;
750 LPCWSTR w;
751 } str;
752 } awcstring;
754 UINT msi_strcpy_to_awstring(const WCHAR *, int, awstring *, DWORD *) DECLSPEC_HIDDEN;
756 /* msi server interface */
757 extern MSIHANDLE msi_get_remote(MSIHANDLE handle) DECLSPEC_HIDDEN;
758 extern LONG WINAPI rpc_filter(EXCEPTION_POINTERS *eptr) DECLSPEC_HIDDEN;
760 /* handle functions */
761 extern void *msihandle2msiinfo(MSIHANDLE handle, UINT type) DECLSPEC_HIDDEN;
762 extern MSIHANDLE alloc_msihandle( MSIOBJECTHDR * ) DECLSPEC_HIDDEN;
763 extern MSIHANDLE alloc_msi_remote_handle(MSIHANDLE remote) DECLSPEC_HIDDEN;
764 extern void *alloc_msiobject(UINT type, UINT size, msihandledestructor destroy ) DECLSPEC_HIDDEN;
765 extern void msiobj_addref(MSIOBJECTHDR *) DECLSPEC_HIDDEN;
766 extern int msiobj_release(MSIOBJECTHDR *) DECLSPEC_HIDDEN;
767 extern void msiobj_lock(MSIOBJECTHDR *) DECLSPEC_HIDDEN;
768 extern void msiobj_unlock(MSIOBJECTHDR *) DECLSPEC_HIDDEN;
769 extern void msi_free_handle_table(void) DECLSPEC_HIDDEN;
771 extern void free_cached_tables( MSIDATABASE *db ) DECLSPEC_HIDDEN;
772 extern UINT MSI_CommitTables( MSIDATABASE *db ) DECLSPEC_HIDDEN;
773 extern UINT msi_commit_streams( MSIDATABASE *db ) DECLSPEC_HIDDEN;
776 /* string table functions */
777 extern BOOL msi_add_string( string_table *st, const WCHAR *data, int len, BOOL persistent ) DECLSPEC_HIDDEN;
778 extern UINT msi_string2id( const string_table *st, const WCHAR *data, int len, UINT *id ) DECLSPEC_HIDDEN;
779 extern VOID msi_destroy_stringtable( string_table *st ) DECLSPEC_HIDDEN;
780 extern const WCHAR *msi_string_lookup( const string_table *st, UINT id, int *len ) DECLSPEC_HIDDEN;
781 extern HRESULT msi_init_string_table( IStorage *stg ) DECLSPEC_HIDDEN;
782 extern string_table *msi_load_string_table( IStorage *stg, UINT *bytes_per_strref ) DECLSPEC_HIDDEN;
783 extern UINT msi_save_string_table( const string_table *st, IStorage *storage, UINT *bytes_per_strref ) DECLSPEC_HIDDEN;
784 extern UINT msi_get_string_table_codepage( const string_table *st ) DECLSPEC_HIDDEN;
785 extern UINT msi_set_string_table_codepage( string_table *st, UINT codepage ) DECLSPEC_HIDDEN;
786 extern WCHAR *msi_strdupW( const WCHAR *value, int len ) DECLSPEC_HIDDEN;
788 extern BOOL TABLE_Exists( MSIDATABASE *db, LPCWSTR name ) DECLSPEC_HIDDEN;
789 extern MSICONDITION MSI_DatabaseIsTablePersistent( MSIDATABASE *db, LPCWSTR table ) DECLSPEC_HIDDEN;
791 extern UINT read_stream_data( IStorage *stg, LPCWSTR stname, BOOL table,
792 BYTE **pdata, UINT *psz ) DECLSPEC_HIDDEN;
793 extern UINT write_stream_data( IStorage *stg, LPCWSTR stname,
794 LPCVOID data, UINT sz, BOOL bTable ) DECLSPEC_HIDDEN;
796 /* transform functions */
797 extern UINT msi_table_apply_transform( MSIDATABASE *db, IStorage *stg ) DECLSPEC_HIDDEN;
798 extern UINT MSI_DatabaseApplyTransformW( MSIDATABASE *db,
799 LPCWSTR szTransformFile, int iErrorCond ) DECLSPEC_HIDDEN;
800 extern void append_storage_to_db( MSIDATABASE *db, IStorage *stg ) DECLSPEC_HIDDEN;
801 extern UINT msi_apply_transforms( MSIPACKAGE *package ) DECLSPEC_HIDDEN;
803 /* patch functions */
804 extern UINT msi_check_patch_applicable( MSIPACKAGE *package, MSISUMMARYINFO *si ) DECLSPEC_HIDDEN;
805 extern UINT msi_apply_patches( MSIPACKAGE *package ) DECLSPEC_HIDDEN;
806 extern UINT msi_apply_registered_patch( MSIPACKAGE *package, LPCWSTR patch_code ) DECLSPEC_HIDDEN;
807 extern void msi_free_patchinfo( MSIPATCHINFO *patch ) DECLSPEC_HIDDEN;
809 /* action internals */
810 extern UINT MSI_InstallPackage( MSIPACKAGE *, LPCWSTR, LPCWSTR ) DECLSPEC_HIDDEN;
811 extern INT ACTION_ShowDialog( MSIPACKAGE*, LPCWSTR) DECLSPEC_HIDDEN;
812 extern INT ACTION_DialogBox( MSIPACKAGE*, LPCWSTR) DECLSPEC_HIDDEN;
813 extern UINT ACTION_ForceReboot(MSIPACKAGE *package) DECLSPEC_HIDDEN;
814 extern UINT MSI_Sequence( MSIPACKAGE *package, LPCWSTR szTable ) DECLSPEC_HIDDEN;
815 extern UINT MSI_SetFeatureStates( MSIPACKAGE *package ) DECLSPEC_HIDDEN;
816 extern UINT msi_parse_command_line( MSIPACKAGE *package, LPCWSTR szCommandLine, BOOL preserve_case ) DECLSPEC_HIDDEN;
817 extern const WCHAR *msi_get_command_line_option( const WCHAR *cmd, const WCHAR *option, UINT *len ) DECLSPEC_HIDDEN;
818 extern UINT msi_schedule_action( MSIPACKAGE *package, UINT script, const WCHAR *action ) DECLSPEC_HIDDEN;
819 extern INSTALLSTATE msi_get_component_action( MSIPACKAGE *package, MSICOMPONENT *comp ) DECLSPEC_HIDDEN;
820 extern INSTALLSTATE msi_get_feature_action( MSIPACKAGE *package, MSIFEATURE *feature ) DECLSPEC_HIDDEN;
821 extern UINT msi_load_all_components( MSIPACKAGE *package ) DECLSPEC_HIDDEN;
822 extern UINT msi_load_all_features( MSIPACKAGE *package ) DECLSPEC_HIDDEN;
823 extern UINT msi_validate_product_id( MSIPACKAGE *package ) DECLSPEC_HIDDEN;
825 /* record internals */
826 extern void MSI_CloseRecord( MSIOBJECTHDR * ) DECLSPEC_HIDDEN;
827 extern UINT MSI_RecordSetIStream( MSIRECORD *, UINT, IStream *) DECLSPEC_HIDDEN;
828 extern UINT MSI_RecordGetIStream( MSIRECORD *, UINT, IStream **) DECLSPEC_HIDDEN;
829 extern const WCHAR *MSI_RecordGetString( const MSIRECORD *, UINT ) DECLSPEC_HIDDEN;
830 extern MSIRECORD *MSI_CreateRecord( UINT ) DECLSPEC_HIDDEN;
831 extern UINT MSI_RecordSetInteger( MSIRECORD *, UINT, int ) DECLSPEC_HIDDEN;
832 extern UINT MSI_RecordSetStringW( MSIRECORD *, UINT, LPCWSTR ) DECLSPEC_HIDDEN;
833 extern BOOL MSI_RecordIsNull( MSIRECORD *, UINT ) DECLSPEC_HIDDEN;
834 extern UINT MSI_RecordGetStringW( MSIRECORD * , UINT, LPWSTR, LPDWORD) DECLSPEC_HIDDEN;
835 extern UINT MSI_RecordGetStringA( MSIRECORD *, UINT, LPSTR, LPDWORD) DECLSPEC_HIDDEN;
836 extern int MSI_RecordGetInteger( MSIRECORD *, UINT ) DECLSPEC_HIDDEN;
837 extern UINT MSI_RecordReadStream( MSIRECORD *, UINT, char *, LPDWORD) DECLSPEC_HIDDEN;
838 extern UINT MSI_RecordSetStream(MSIRECORD *, UINT, IStream *) DECLSPEC_HIDDEN;
839 extern UINT MSI_RecordGetFieldCount( const MSIRECORD *rec ) DECLSPEC_HIDDEN;
840 extern UINT MSI_RecordStreamToFile( MSIRECORD *, UINT, LPCWSTR ) DECLSPEC_HIDDEN;
841 extern UINT MSI_RecordSetStreamFromFileW( MSIRECORD *, UINT, LPCWSTR ) DECLSPEC_HIDDEN;
842 extern UINT MSI_RecordCopyField( MSIRECORD *, UINT, MSIRECORD *, UINT ) DECLSPEC_HIDDEN;
843 extern MSIRECORD *MSI_CloneRecord( MSIRECORD * ) DECLSPEC_HIDDEN;
844 extern BOOL MSI_RecordsAreEqual( MSIRECORD *, MSIRECORD * ) DECLSPEC_HIDDEN;
845 extern BOOL MSI_RecordsAreFieldsEqual(MSIRECORD *a, MSIRECORD *b, UINT field) DECLSPEC_HIDDEN;
846 extern UINT msi_record_set_string(MSIRECORD *, UINT, const WCHAR *, int) DECLSPEC_HIDDEN;
847 extern const WCHAR *msi_record_get_string(const MSIRECORD *, UINT, int *) DECLSPEC_HIDDEN;
848 extern void dump_record(MSIRECORD *) DECLSPEC_HIDDEN;
849 extern UINT unmarshal_record(const struct wire_record *in, MSIHANDLE *out) DECLSPEC_HIDDEN;
850 extern struct wire_record *marshal_record(MSIHANDLE handle) DECLSPEC_HIDDEN;
851 extern void free_remote_record(struct wire_record *rec) DECLSPEC_HIDDEN;
852 extern UINT copy_remote_record(const struct wire_record *rec, MSIHANDLE handle) DECLSPEC_HIDDEN;
854 /* stream internals */
855 extern void enum_stream_names( IStorage *stg ) DECLSPEC_HIDDEN;
856 extern LPWSTR encode_streamname(BOOL bTable, LPCWSTR in) DECLSPEC_HIDDEN;
857 extern BOOL decode_streamname(LPCWSTR in, LPWSTR out) DECLSPEC_HIDDEN;
859 /* database internals */
860 extern UINT msi_get_stream( MSIDATABASE *, const WCHAR *, IStream ** ) DECLSPEC_HIDDEN;
861 extern UINT MSI_OpenDatabaseW( LPCWSTR, LPCWSTR, MSIDATABASE ** ) DECLSPEC_HIDDEN;
862 extern UINT MSI_DatabaseOpenViewW(MSIDATABASE *, LPCWSTR, MSIQUERY ** ) DECLSPEC_HIDDEN;
863 extern UINT WINAPIV MSI_OpenQuery( MSIDATABASE *, MSIQUERY **, LPCWSTR, ... ) DECLSPEC_HIDDEN;
864 typedef UINT (*record_func)( MSIRECORD *, LPVOID );
865 extern UINT MSI_IterateRecords( MSIQUERY *, LPDWORD, record_func, LPVOID ) DECLSPEC_HIDDEN;
866 extern MSIRECORD * WINAPIV MSI_QueryGetRecord( MSIDATABASE *db, LPCWSTR query, ... ) DECLSPEC_HIDDEN;
867 extern UINT MSI_DatabaseGetPrimaryKeys( MSIDATABASE *, LPCWSTR, MSIRECORD ** ) DECLSPEC_HIDDEN;
869 /* view internals */
870 extern UINT MSI_ViewExecute( MSIQUERY*, MSIRECORD * ) DECLSPEC_HIDDEN;
871 extern UINT MSI_ViewFetch( MSIQUERY*, MSIRECORD ** ) DECLSPEC_HIDDEN;
872 extern UINT MSI_ViewClose( MSIQUERY* ) DECLSPEC_HIDDEN;
873 extern UINT MSI_ViewGetColumnInfo(MSIQUERY *, MSICOLINFO, MSIRECORD **) DECLSPEC_HIDDEN;
874 extern UINT MSI_ViewModify( MSIQUERY *, MSIMODIFY, MSIRECORD * ) DECLSPEC_HIDDEN;
875 extern UINT VIEW_find_column( MSIVIEW *, LPCWSTR, LPCWSTR, UINT * ) DECLSPEC_HIDDEN;
876 extern UINT msi_view_get_row(MSIDATABASE *, MSIVIEW *, UINT, MSIRECORD **) DECLSPEC_HIDDEN;
878 /* install internals */
879 extern UINT MSI_SetInstallLevel( MSIPACKAGE *package, int iInstallLevel ) DECLSPEC_HIDDEN;
881 /* package internals */
882 #define WINE_OPENPACKAGEFLAGS_RECACHE 0x80000000
883 extern MSIPACKAGE *MSI_CreatePackage( MSIDATABASE * ) DECLSPEC_HIDDEN;
884 extern UINT MSI_OpenPackageW( LPCWSTR szPackage, DWORD dwOptions, MSIPACKAGE **pPackage ) DECLSPEC_HIDDEN;
885 extern UINT MSI_SetTargetPathW( MSIPACKAGE *, LPCWSTR, LPCWSTR ) DECLSPEC_HIDDEN;
886 extern INT MSI_ProcessMessageVerbatim( MSIPACKAGE *, INSTALLMESSAGE, MSIRECORD * ) DECLSPEC_HIDDEN;
887 extern INT MSI_ProcessMessage( MSIPACKAGE *, INSTALLMESSAGE, MSIRECORD * ) DECLSPEC_HIDDEN;
888 extern MSICONDITION MSI_EvaluateConditionW( MSIPACKAGE *, LPCWSTR ) DECLSPEC_HIDDEN;
889 extern UINT MSI_GetComponentStateW( MSIPACKAGE *, LPCWSTR, INSTALLSTATE *, INSTALLSTATE * ) DECLSPEC_HIDDEN;
890 extern UINT MSI_GetFeatureStateW( MSIPACKAGE *, LPCWSTR, INSTALLSTATE *, INSTALLSTATE * ) DECLSPEC_HIDDEN;
891 extern UINT MSI_SetFeatureStateW(MSIPACKAGE*, LPCWSTR, INSTALLSTATE ) DECLSPEC_HIDDEN;
892 extern UINT msi_download_file( LPCWSTR szUrl, LPWSTR filename ) DECLSPEC_HIDDEN;
893 extern UINT msi_package_add_info(MSIPACKAGE *, DWORD, DWORD, LPCWSTR, LPWSTR) DECLSPEC_HIDDEN;
894 extern UINT msi_package_add_media_disk(MSIPACKAGE *, DWORD, DWORD, DWORD, LPWSTR, LPWSTR) DECLSPEC_HIDDEN;
895 extern UINT msi_clone_properties(MSIDATABASE *) DECLSPEC_HIDDEN;
896 extern UINT msi_set_context(MSIPACKAGE *) DECLSPEC_HIDDEN;
897 extern void msi_adjust_privilege_properties(MSIPACKAGE *) DECLSPEC_HIDDEN;
898 extern UINT MSI_GetFeatureCost(MSIPACKAGE *, MSIFEATURE *, MSICOSTTREE, INSTALLSTATE, LPINT) DECLSPEC_HIDDEN;
900 /* for deformating */
901 extern UINT MSI_FormatRecordW( MSIPACKAGE *, MSIRECORD *, LPWSTR, LPDWORD ) DECLSPEC_HIDDEN;
903 /* registry data encoding/decoding functions */
904 extern BOOL unsquash_guid(LPCWSTR in, LPWSTR out) DECLSPEC_HIDDEN;
905 extern BOOL squash_guid(LPCWSTR in, LPWSTR out) DECLSPEC_HIDDEN;
906 extern BOOL encode_base85_guid(GUID *,LPWSTR) DECLSPEC_HIDDEN;
907 extern BOOL decode_base85_guid(LPCWSTR,GUID*) DECLSPEC_HIDDEN;
908 extern UINT MSIREG_OpenUninstallKey(const WCHAR *, enum platform, HKEY *, BOOL) DECLSPEC_HIDDEN;
909 extern UINT MSIREG_DeleteUninstallKey(const WCHAR *, enum platform) DECLSPEC_HIDDEN;
910 extern UINT MSIREG_OpenProductKey(LPCWSTR szProduct, LPCWSTR szUserSid,
911 MSIINSTALLCONTEXT context, HKEY* key, BOOL create) DECLSPEC_HIDDEN;
912 extern UINT MSIREG_OpenFeaturesKey(LPCWSTR szProduct, LPCWSTR szUserSid, MSIINSTALLCONTEXT context,
913 HKEY *key, BOOL create) DECLSPEC_HIDDEN;
914 extern UINT MSIREG_OpenUserPatchesKey(LPCWSTR szPatch, HKEY* key, BOOL create) DECLSPEC_HIDDEN;
915 UINT MSIREG_OpenUserDataFeaturesKey(LPCWSTR szProduct, LPCWSTR szUserSid, MSIINSTALLCONTEXT context,
916 HKEY *key, BOOL create) DECLSPEC_HIDDEN;
917 extern UINT MSIREG_OpenUserComponentsKey(LPCWSTR szComponent, HKEY* key, BOOL create) DECLSPEC_HIDDEN;
918 extern UINT MSIREG_OpenUserDataComponentKey(LPCWSTR szComponent, LPCWSTR szUserSid,
919 HKEY *key, BOOL create) DECLSPEC_HIDDEN;
920 extern UINT MSIREG_OpenPatchesKey(LPCWSTR szPatch, HKEY* key, BOOL create) DECLSPEC_HIDDEN;
921 extern UINT MSIREG_OpenUserDataProductKey(LPCWSTR szProduct, MSIINSTALLCONTEXT dwContext,
922 LPCWSTR szUserSid, HKEY *key, BOOL create) DECLSPEC_HIDDEN;
923 extern UINT MSIREG_OpenUserDataPatchKey(LPCWSTR szPatch, MSIINSTALLCONTEXT dwContext,
924 HKEY *key, BOOL create) DECLSPEC_HIDDEN;
925 extern UINT MSIREG_OpenUserDataProductPatchesKey(LPCWSTR product, MSIINSTALLCONTEXT context,
926 HKEY *key, BOOL create) DECLSPEC_HIDDEN;
927 extern UINT MSIREG_OpenInstallProps(LPCWSTR szProduct, MSIINSTALLCONTEXT dwContext,
928 LPCWSTR szUserSid, HKEY *key, BOOL create) DECLSPEC_HIDDEN;
929 extern UINT MSIREG_OpenUpgradeCodesKey(LPCWSTR szProduct, HKEY* key, BOOL create) DECLSPEC_HIDDEN;
930 extern UINT MSIREG_OpenUserUpgradeCodesKey(LPCWSTR szProduct, HKEY* key, BOOL create) DECLSPEC_HIDDEN;
931 extern UINT MSIREG_DeleteProductKey(LPCWSTR szProduct) DECLSPEC_HIDDEN;
932 extern UINT MSIREG_DeleteUserProductKey(LPCWSTR szProduct) DECLSPEC_HIDDEN;
933 extern UINT MSIREG_DeleteUserDataPatchKey(LPCWSTR patch, MSIINSTALLCONTEXT context) DECLSPEC_HIDDEN;
934 extern UINT MSIREG_DeleteUserDataProductKey(LPCWSTR, MSIINSTALLCONTEXT) DECLSPEC_HIDDEN;
935 extern UINT MSIREG_DeleteUserFeaturesKey(LPCWSTR szProduct) DECLSPEC_HIDDEN;
936 extern UINT MSIREG_DeleteUserDataComponentKey(LPCWSTR szComponent, LPCWSTR szUserSid) DECLSPEC_HIDDEN;
937 extern UINT MSIREG_DeleteUserUpgradeCodesKey(LPCWSTR szUpgradeCode) DECLSPEC_HIDDEN;
938 extern UINT MSIREG_DeleteUpgradeCodesKey(const WCHAR *) DECLSPEC_HIDDEN;
939 extern UINT MSIREG_DeleteClassesUpgradeCodesKey(LPCWSTR szUpgradeCode) DECLSPEC_HIDDEN;
940 extern UINT MSIREG_OpenClassesUpgradeCodesKey(LPCWSTR szUpgradeCode, HKEY* key, BOOL create) DECLSPEC_HIDDEN;
941 extern UINT MSIREG_DeleteLocalClassesProductKey(LPCWSTR szProductCode) DECLSPEC_HIDDEN;
942 extern UINT MSIREG_DeleteLocalClassesFeaturesKey(LPCWSTR szProductCode) DECLSPEC_HIDDEN;
943 extern UINT msi_locate_product(LPCWSTR szProduct, MSIINSTALLCONTEXT *context) DECLSPEC_HIDDEN;
944 extern LPWSTR msi_reg_get_val_str( HKEY hkey, LPCWSTR name ) DECLSPEC_HIDDEN;
945 extern BOOL msi_reg_get_val_dword( HKEY hkey, LPCWSTR name, DWORD *val) DECLSPEC_HIDDEN;
947 extern DWORD msi_version_str_to_dword(LPCWSTR p) DECLSPEC_HIDDEN;
948 extern void msi_parse_version_string(LPCWSTR, PDWORD, PDWORD) DECLSPEC_HIDDEN;
949 extern int msi_compare_file_versions(VS_FIXEDFILEINFO *, const WCHAR *) DECLSPEC_HIDDEN;
950 extern int msi_compare_font_versions(const WCHAR *, const WCHAR *) DECLSPEC_HIDDEN;
952 extern LONG msi_reg_set_val_str( HKEY hkey, LPCWSTR name, LPCWSTR value ) DECLSPEC_HIDDEN;
953 extern LONG msi_reg_set_val_multi_str( HKEY hkey, LPCWSTR name, LPCWSTR value ) DECLSPEC_HIDDEN;
954 extern LONG msi_reg_set_val_dword( HKEY hkey, LPCWSTR name, DWORD val ) DECLSPEC_HIDDEN;
955 extern LONG msi_reg_set_subkey_val( HKEY hkey, LPCWSTR path, LPCWSTR name, LPCWSTR val ) DECLSPEC_HIDDEN;
957 /* msi dialog interface */
958 extern void msi_dialog_check_messages( HANDLE ) DECLSPEC_HIDDEN;
959 extern void msi_dialog_destroy( msi_dialog* ) DECLSPEC_HIDDEN;
960 extern void msi_dialog_unregister_class( void ) DECLSPEC_HIDDEN;
962 /* summary information */
963 extern UINT msi_get_suminfo( IStorage *stg, UINT uiUpdateCount, MSISUMMARYINFO **si ) DECLSPEC_HIDDEN;
964 extern UINT msi_get_db_suminfo( MSIDATABASE *db, UINT uiUpdateCount, MSISUMMARYINFO **si ) DECLSPEC_HIDDEN;
965 extern LPWSTR msi_suminfo_dup_string( MSISUMMARYINFO *si, UINT uiProperty ) DECLSPEC_HIDDEN;
966 extern INT msi_suminfo_get_int32( MSISUMMARYINFO *si, UINT uiProperty ) DECLSPEC_HIDDEN;
967 extern LPWSTR msi_get_suminfo_product( IStorage *stg ) DECLSPEC_HIDDEN;
968 extern UINT msi_add_suminfo( MSIDATABASE *db, LPWSTR **records, int num_records, int num_columns ) DECLSPEC_HIDDEN;
969 extern UINT msi_export_suminfo( MSIDATABASE *db, HANDLE handle ) DECLSPEC_HIDDEN;
970 extern UINT msi_load_suminfo_properties( MSIPACKAGE *package ) DECLSPEC_HIDDEN;
972 /* undocumented functions */
973 UINT WINAPI MsiCreateAndVerifyInstallerDirectory( DWORD );
974 UINT WINAPI MsiDecomposeDescriptorW( LPCWSTR, LPWSTR, LPWSTR, LPWSTR, LPDWORD );
975 UINT WINAPI MsiDecomposeDescriptorA( LPCSTR, LPSTR, LPSTR, LPSTR, LPDWORD );
976 LANGID WINAPI MsiLoadStringW( MSIHANDLE, UINT, LPWSTR, int, LANGID );
977 LANGID WINAPI MsiLoadStringA( MSIHANDLE, UINT, LPSTR, int, LANGID );
979 /* UI globals */
980 extern INSTALLUILEVEL gUILevel DECLSPEC_HIDDEN;
981 extern HWND gUIhwnd DECLSPEC_HIDDEN;
982 extern INSTALLUI_HANDLERA gUIHandlerA DECLSPEC_HIDDEN;
983 extern INSTALLUI_HANDLERW gUIHandlerW DECLSPEC_HIDDEN;
984 extern INSTALLUI_HANDLER_RECORD gUIHandlerRecord DECLSPEC_HIDDEN;
985 extern DWORD gUIFilter DECLSPEC_HIDDEN;
986 extern DWORD gUIFilterRecord DECLSPEC_HIDDEN;
987 extern LPVOID gUIContext DECLSPEC_HIDDEN;
988 extern LPVOID gUIContextRecord DECLSPEC_HIDDEN;
989 extern WCHAR *gszLogFile DECLSPEC_HIDDEN;
990 extern HINSTANCE msi_hInstance DECLSPEC_HIDDEN;
992 /* action related functions */
993 extern UINT ACTION_PerformAction(MSIPACKAGE *package, const WCHAR *action) DECLSPEC_HIDDEN;
994 extern void ACTION_FinishCustomActions( const MSIPACKAGE* package) DECLSPEC_HIDDEN;
995 extern UINT ACTION_CustomAction(MSIPACKAGE *package, const WCHAR *action) DECLSPEC_HIDDEN;
996 extern void custom_stop_server(HANDLE process, HANDLE pipe) DECLSPEC_HIDDEN;
998 /* actions in other modules */
999 extern UINT ACTION_AppSearch(MSIPACKAGE *package) DECLSPEC_HIDDEN;
1000 extern UINT ACTION_CCPSearch(MSIPACKAGE *package) DECLSPEC_HIDDEN;
1001 extern UINT ACTION_FindRelatedProducts(MSIPACKAGE *package) DECLSPEC_HIDDEN;
1002 extern UINT ACTION_InstallFiles(MSIPACKAGE *package) DECLSPEC_HIDDEN;
1003 extern UINT ACTION_PatchFiles( MSIPACKAGE *package ) DECLSPEC_HIDDEN;
1004 extern UINT ACTION_RemoveFiles(MSIPACKAGE *package) DECLSPEC_HIDDEN;
1005 extern UINT ACTION_MoveFiles(MSIPACKAGE *package) DECLSPEC_HIDDEN;
1006 extern UINT ACTION_DuplicateFiles(MSIPACKAGE *package) DECLSPEC_HIDDEN;
1007 extern UINT ACTION_RemoveDuplicateFiles(MSIPACKAGE *package) DECLSPEC_HIDDEN;
1008 extern UINT ACTION_RegisterClassInfo(MSIPACKAGE *package) DECLSPEC_HIDDEN;
1009 extern UINT ACTION_RegisterProgIdInfo(MSIPACKAGE *package) DECLSPEC_HIDDEN;
1010 extern UINT ACTION_RegisterExtensionInfo(MSIPACKAGE *package) DECLSPEC_HIDDEN;
1011 extern UINT ACTION_RegisterMIMEInfo(MSIPACKAGE *package) DECLSPEC_HIDDEN;
1012 extern UINT ACTION_RegisterFonts(MSIPACKAGE *package) DECLSPEC_HIDDEN;
1013 extern UINT ACTION_UnregisterClassInfo(MSIPACKAGE *package) DECLSPEC_HIDDEN;
1014 extern UINT ACTION_UnregisterExtensionInfo(MSIPACKAGE *package) DECLSPEC_HIDDEN;
1015 extern UINT ACTION_UnregisterFonts(MSIPACKAGE *package) DECLSPEC_HIDDEN;
1016 extern UINT ACTION_UnregisterMIMEInfo(MSIPACKAGE *package) DECLSPEC_HIDDEN;
1017 extern UINT ACTION_UnregisterProgIdInfo(MSIPACKAGE *package) DECLSPEC_HIDDEN;
1018 extern UINT ACTION_MsiPublishAssemblies(MSIPACKAGE *package) DECLSPEC_HIDDEN;
1019 extern UINT ACTION_MsiUnpublishAssemblies(MSIPACKAGE *package) DECLSPEC_HIDDEN;
1021 /* Helpers */
1022 extern DWORD deformat_string(MSIPACKAGE *package, LPCWSTR ptr, WCHAR** data ) DECLSPEC_HIDDEN;
1023 extern WCHAR *msi_dup_record_field(MSIRECORD *row, INT index) DECLSPEC_HIDDEN;
1024 extern LPWSTR msi_dup_property( MSIDATABASE *db, LPCWSTR prop ) DECLSPEC_HIDDEN;
1025 extern UINT msi_set_property( MSIDATABASE *, const WCHAR *, const WCHAR *, int ) DECLSPEC_HIDDEN;
1026 extern UINT msi_get_property( MSIDATABASE *, LPCWSTR, LPWSTR, LPDWORD ) DECLSPEC_HIDDEN;
1027 extern int msi_get_property_int( MSIDATABASE *package, LPCWSTR prop, int def ) DECLSPEC_HIDDEN;
1028 extern WCHAR *msi_resolve_source_folder(MSIPACKAGE *package, const WCHAR *name, MSIFOLDER **folder) DECLSPEC_HIDDEN;
1029 extern void msi_resolve_target_folder(MSIPACKAGE *package, const WCHAR *name, BOOL load_prop) DECLSPEC_HIDDEN;
1030 extern WCHAR *msi_normalize_path(const WCHAR *) DECLSPEC_HIDDEN;
1031 extern WCHAR *msi_resolve_file_source(MSIPACKAGE *package, MSIFILE *file) DECLSPEC_HIDDEN;
1032 extern const WCHAR *msi_get_target_folder(MSIPACKAGE *package, const WCHAR *name) DECLSPEC_HIDDEN;
1033 extern void msi_reset_source_folders( MSIPACKAGE *package ) DECLSPEC_HIDDEN;
1034 extern MSICOMPONENT *msi_get_loaded_component(MSIPACKAGE *package, const WCHAR *Component) DECLSPEC_HIDDEN;
1035 extern MSIFEATURE *msi_get_loaded_feature(MSIPACKAGE *package, const WCHAR *Feature) DECLSPEC_HIDDEN;
1036 extern MSIFILE *msi_get_loaded_file(MSIPACKAGE *package, const WCHAR *file) DECLSPEC_HIDDEN;
1037 extern MSIFOLDER *msi_get_loaded_folder(MSIPACKAGE *package, const WCHAR *dir) DECLSPEC_HIDDEN;
1038 extern WCHAR *msi_create_temp_file(MSIDATABASE *db) DECLSPEC_HIDDEN;
1039 extern void msi_free_action_script(MSIPACKAGE *package, UINT script) DECLSPEC_HIDDEN;
1040 extern WCHAR *msi_build_icon_path(MSIPACKAGE *, const WCHAR *) DECLSPEC_HIDDEN;
1041 extern WCHAR *msi_build_directory_name(DWORD , ...) DECLSPEC_HIDDEN;
1042 extern void msi_reduce_to_long_filename(WCHAR *) DECLSPEC_HIDDEN;
1043 extern WCHAR *msi_create_component_advertise_string(MSIPACKAGE *, MSICOMPONENT *, const WCHAR *) DECLSPEC_HIDDEN;
1044 extern void ACTION_UpdateComponentStates(MSIPACKAGE *package, MSIFEATURE *feature) DECLSPEC_HIDDEN;
1045 extern UINT msi_register_unique_action(MSIPACKAGE *, const WCHAR *) DECLSPEC_HIDDEN;
1046 extern BOOL msi_action_is_unique(const MSIPACKAGE *, const WCHAR *) DECLSPEC_HIDDEN;
1047 extern UINT msi_set_last_used_source(LPCWSTR product, LPCWSTR usersid,
1048 MSIINSTALLCONTEXT context, DWORD options, LPCWSTR value) DECLSPEC_HIDDEN;
1049 extern UINT msi_create_empty_local_file(LPWSTR path, LPCWSTR suffix) DECLSPEC_HIDDEN;
1050 extern UINT msi_set_sourcedir_props(MSIPACKAGE *package, BOOL replace) DECLSPEC_HIDDEN;
1051 extern MSIASSEMBLY *msi_load_assembly(MSIPACKAGE *, MSICOMPONENT *) DECLSPEC_HIDDEN;
1052 extern UINT msi_install_assembly(MSIPACKAGE *, MSICOMPONENT *) DECLSPEC_HIDDEN;
1053 extern UINT msi_uninstall_assembly(MSIPACKAGE *, MSICOMPONENT *) DECLSPEC_HIDDEN;
1054 extern BOOL msi_init_assembly_caches(MSIPACKAGE *) DECLSPEC_HIDDEN;
1055 extern void msi_destroy_assembly_caches(MSIPACKAGE *) DECLSPEC_HIDDEN;
1056 extern BOOL msi_is_global_assembly(MSICOMPONENT *) DECLSPEC_HIDDEN;
1057 extern IAssemblyEnum *msi_create_assembly_enum(MSIPACKAGE *, const WCHAR *) DECLSPEC_HIDDEN;
1058 extern WCHAR *msi_get_assembly_path(MSIPACKAGE *, const WCHAR *) DECLSPEC_HIDDEN;
1059 extern WCHAR **msi_split_string(const WCHAR *, WCHAR) DECLSPEC_HIDDEN;
1060 extern UINT msi_set_original_database_property(MSIDATABASE *, const WCHAR *) DECLSPEC_HIDDEN;
1061 extern WCHAR *msi_get_error_message(MSIDATABASE *, int) DECLSPEC_HIDDEN;
1062 extern UINT msi_strncpyWtoA(const WCHAR *str, int len, char *buf, DWORD *sz, BOOL remote) DECLSPEC_HIDDEN;
1063 extern UINT msi_strncpyW(const WCHAR *str, int len, WCHAR *buf, DWORD *sz) DECLSPEC_HIDDEN;
1064 extern WCHAR *msi_get_package_code(MSIDATABASE *db) DECLSPEC_HIDDEN;
1066 /* wrappers for filesystem functions */
1067 static inline void msi_disable_fs_redirection( MSIPACKAGE *package )
1069 if (is_wow64 && package->platform == PLATFORM_X64) Wow64DisableWow64FsRedirection( &package->cookie );
1071 static inline void msi_revert_fs_redirection( MSIPACKAGE *package )
1073 if (is_wow64 && package->platform == PLATFORM_X64) Wow64RevertWow64FsRedirection( package->cookie );
1075 extern HANDLE msi_create_file( MSIPACKAGE *, const WCHAR *, DWORD, DWORD, DWORD, DWORD ) DECLSPEC_HIDDEN;
1076 extern BOOL msi_delete_file( MSIPACKAGE *, const WCHAR * ) DECLSPEC_HIDDEN;
1077 extern BOOL msi_remove_directory( MSIPACKAGE *, const WCHAR * ) DECLSPEC_HIDDEN;
1078 extern DWORD msi_get_file_attributes( MSIPACKAGE *, const WCHAR * ) DECLSPEC_HIDDEN;
1079 extern BOOL msi_set_file_attributes( MSIPACKAGE *, const WCHAR *, DWORD ) DECLSPEC_HIDDEN;
1080 extern HANDLE msi_find_first_file( MSIPACKAGE *, const WCHAR *, WIN32_FIND_DATAW * ) DECLSPEC_HIDDEN;
1081 extern BOOL msi_find_next_file( MSIPACKAGE *, HANDLE, WIN32_FIND_DATAW * ) DECLSPEC_HIDDEN;
1082 extern BOOL msi_move_file( MSIPACKAGE *, const WCHAR *, const WCHAR *, DWORD ) DECLSPEC_HIDDEN;
1083 extern DWORD msi_get_file_version_info( MSIPACKAGE *, const WCHAR *, DWORD, BYTE * ) DECLSPEC_HIDDEN;
1084 extern BOOL msi_create_full_path( MSIPACKAGE *, const WCHAR * ) DECLSPEC_HIDDEN;
1085 extern DWORD msi_get_disk_file_size( MSIPACKAGE *, const WCHAR * ) DECLSPEC_HIDDEN;
1086 extern VS_FIXEDFILEINFO *msi_get_disk_file_version( MSIPACKAGE *, const WCHAR * ) DECLSPEC_HIDDEN;
1087 extern UINT msi_get_filehash( MSIPACKAGE *, const WCHAR *, MSIFILEHASHINFO * ) DECLSPEC_HIDDEN;
1088 extern WCHAR *msi_get_font_file_version( MSIPACKAGE *, const WCHAR * ) DECLSPEC_HIDDEN;
1090 /* media */
1092 typedef BOOL (*PMSICABEXTRACTCB)(MSIPACKAGE *, LPCWSTR, DWORD, LPWSTR *, DWORD *, PVOID);
1094 #define MSICABEXTRACT_BEGINEXTRACT 0x01
1095 #define MSICABEXTRACT_FILEEXTRACTED 0x02
1097 typedef struct
1099 MSIPACKAGE* package;
1100 MSIMEDIAINFO *mi;
1101 PMSICABEXTRACTCB cb;
1102 LPWSTR curfile;
1103 PVOID user;
1104 } MSICABDATA;
1106 extern UINT ready_media(MSIPACKAGE *package, BOOL compressed, MSIMEDIAINFO *mi) DECLSPEC_HIDDEN;
1107 extern UINT msi_load_media_info(MSIPACKAGE *package, UINT Sequence, MSIMEDIAINFO *mi) DECLSPEC_HIDDEN;
1108 extern void msi_free_media_info(MSIMEDIAINFO *mi) DECLSPEC_HIDDEN;
1109 extern BOOL msi_cabextract(MSIPACKAGE* package, MSIMEDIAINFO *mi, LPVOID data) DECLSPEC_HIDDEN;
1110 extern UINT msi_add_cabinet_stream(MSIPACKAGE *, UINT, IStorage *, const WCHAR *) DECLSPEC_HIDDEN;
1112 /* control event stuff */
1113 extern void msi_event_fire(MSIPACKAGE *, const WCHAR *, MSIRECORD *) DECLSPEC_HIDDEN;
1114 extern void msi_event_cleanup_all_subscriptions( MSIPACKAGE * ) DECLSPEC_HIDDEN;
1116 /* OLE automation */
1117 typedef enum tid_t {
1118 Database_tid,
1119 Installer_tid,
1120 Record_tid,
1121 Session_tid,
1122 StringList_tid,
1123 SummaryInfo_tid,
1124 View_tid,
1125 LAST_tid
1126 } tid_t;
1128 extern HRESULT create_msiserver(IUnknown *pOuter, LPVOID *ppObj) DECLSPEC_HIDDEN;
1129 extern HRESULT create_session(MSIHANDLE msiHandle, IDispatch *pInstaller, IDispatch **pDispatch) DECLSPEC_HIDDEN;
1130 extern HRESULT get_typeinfo(tid_t tid, ITypeInfo **ti) DECLSPEC_HIDDEN;
1131 extern void release_typelib(void) DECLSPEC_HIDDEN;
1133 /* Scripting */
1134 extern DWORD call_script(MSIHANDLE hPackage, INT type, LPCWSTR script, LPCWSTR function, LPCWSTR action) DECLSPEC_HIDDEN;
1136 /* User interface messages from the actions */
1137 extern void msi_ui_progress(MSIPACKAGE *, int, int, int, int) DECLSPEC_HIDDEN;
1139 /* common strings */
1140 static const WCHAR szSourceDir[] = {'S','o','u','r','c','e','D','i','r',0};
1141 static const WCHAR szSOURCEDIR[] = {'S','O','U','R','C','E','D','I','R',0};
1142 static const WCHAR szRootDrive[] = {'R','O','O','T','D','R','I','V','E',0};
1143 static const WCHAR szTargetDir[] = {'T','A','R','G','E','T','D','I','R',0};
1144 static const WCHAR szLocalSid[] = {'S','-','1','-','5','-','1','8',0};
1145 static const WCHAR szAllSid[] = {'S','-','1','-','1','-','0',0};
1146 static const WCHAR szEmpty[] = {0};
1147 static const WCHAR szAll[] = {'A','L','L',0};
1148 static const WCHAR szOne[] = {'1',0};
1149 static const WCHAR szZero[] = {'0',0};
1150 static const WCHAR szSpace[] = {' ',0};
1151 static const WCHAR szBackSlash[] = {'\\',0};
1152 static const WCHAR szForwardSlash[] = {'/',0};
1153 static const WCHAR szDot[] = {'.',0};
1154 static const WCHAR szDotDot[] = {'.','.',0};
1155 static const WCHAR szSemiColon[] = {';',0};
1156 static const WCHAR szPreselected[] = {'P','r','e','s','e','l','e','c','t','e','d',0};
1157 static const WCHAR szPatches[] = {'P','a','t','c','h','e','s',0};
1158 static const WCHAR szState[] = {'S','t','a','t','e',0};
1159 static const WCHAR szMsi[] = {'m','s','i',0};
1160 static const WCHAR szPatch[] = {'P','A','T','C','H',0};
1161 static const WCHAR szSourceList[] = {'S','o','u','r','c','e','L','i','s','t',0};
1162 static const WCHAR szInstalled[] = {'I','n','s','t','a','l','l','e','d',0};
1163 static const WCHAR szReinstall[] = {'R','E','I','N','S','T','A','L','L',0};
1164 static const WCHAR szReinstallMode[] = {'R','E','I','N','S','T','A','L','L','M','O','D','E',0};
1165 static const WCHAR szRemove[] = {'R','E','M','O','V','E',0};
1166 static const WCHAR szUserSID[] = {'U','s','e','r','S','I','D',0};
1167 static const WCHAR szProductCode[] = {'P','r','o','d','u','c','t','C','o','d','e',0};
1168 static const WCHAR szRegisterClassInfo[] = {'R','e','g','i','s','t','e','r','C','l','a','s','s','I','n','f','o',0};
1169 static const WCHAR szRegisterProgIdInfo[] = {'R','e','g','i','s','t','e','r','P','r','o','g','I','d','I','n','f','o',0};
1170 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};
1171 static const WCHAR szRegisterMIMEInfo[] = {'R','e','g','i','s','t','e','r','M','I','M','E','I','n','f','o',0};
1172 static const WCHAR szDuplicateFiles[] = {'D','u','p','l','i','c','a','t','e','F','i','l','e','s',0};
1173 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};
1174 static const WCHAR szInstallFiles[] = {'I','n','s','t','a','l','l','F','i','l','e','s',0};
1175 static const WCHAR szPatchFiles[] = {'P','a','t','c','h','F','i','l','e','s',0};
1176 static const WCHAR szRemoveFiles[] = {'R','e','m','o','v','e','F','i','l','e','s',0};
1177 static const WCHAR szFindRelatedProducts[] = {'F','i','n','d','R','e','l','a','t','e','d','P','r','o','d','u','c','t','s',0};
1178 static const WCHAR szAllUsers[] = {'A','L','L','U','S','E','R','S',0};
1179 static const WCHAR szCustomActionData[] = {'C','u','s','t','o','m','A','c','t','i','o','n','D','a','t','a',0};
1180 static const WCHAR szUILevel[] = {'U','I','L','e','v','e','l',0};
1181 static const WCHAR szProductID[] = {'P','r','o','d','u','c','t','I','D',0};
1182 static const WCHAR szPIDTemplate[] = {'P','I','D','T','e','m','p','l','a','t','e',0};
1183 static const WCHAR szPIDKEY[] = {'P','I','D','K','E','Y',0};
1184 static const WCHAR szTYPELIB[] = {'T','Y','P','E','L','I','B',0};
1185 static const WCHAR szSumInfo[] = {5 ,'S','u','m','m','a','r','y','I','n','f','o','r','m','a','t','i','o','n',0};
1186 static const WCHAR szHCR[] = {'H','K','E','Y','_','C','L','A','S','S','E','S','_','R','O','O','T','\\',0};
1187 static const WCHAR szHCU[] = {'H','K','E','Y','_','C','U','R','R','E','N','T','_','U','S','E','R','\\',0};
1188 static const WCHAR szHLM[] = {'H','K','E','Y','_','L','O','C','A','L','_','M','A','C','H','I','N','E','\\',0};
1189 static const WCHAR szHU[] = {'H','K','E','Y','_','U','S','E','R','S','\\',0};
1190 static const WCHAR szWindowsFolder[] = {'W','i','n','d','o','w','s','F','o','l','d','e','r',0};
1191 static const WCHAR szAppSearch[] = {'A','p','p','S','e','a','r','c','h',0};
1192 static const WCHAR szMoveFiles[] = {'M','o','v','e','F','i','l','e','s',0};
1193 static const WCHAR szCCPSearch[] = {'C','C','P','S','e','a','r','c','h',0};
1194 static const WCHAR szUnregisterClassInfo[] = {'U','n','r','e','g','i','s','t','e','r','C','l','a','s','s','I','n','f','o',0};
1195 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};
1196 static const WCHAR szUnregisterMIMEInfo[] = {'U','n','r','e','g','i','s','t','e','r','M','I','M','E','I','n','f','o',0};
1197 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};
1198 static const WCHAR szRegisterFonts[] = {'R','e','g','i','s','t','e','r','F','o','n','t','s',0};
1199 static const WCHAR szUnregisterFonts[] = {'U','n','r','e','g','i','s','t','e','r','F','o','n','t','s',0};
1200 static const WCHAR szCLSID[] = {'C','L','S','I','D',0};
1201 static const WCHAR szProgID[] = {'P','r','o','g','I','D',0};
1202 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};
1203 static const WCHAR szAppID[] = {'A','p','p','I','D',0};
1204 static const WCHAR szDefaultIcon[] = {'D','e','f','a','u','l','t','I','c','o','n',0};
1205 static const WCHAR szInprocHandler[] = {'I','n','p','r','o','c','H','a','n','d','l','e','r',0};
1206 static const WCHAR szInprocHandler32[] = {'I','n','p','r','o','c','H','a','n','d','l','e','r','3','2',0};
1207 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};
1208 static const WCHAR szLocalPackage[] = {'L','o','c','a','l','P','a','c','k','a','g','e',0};
1209 static const WCHAR szOriginalDatabase[] = {'O','r','i','g','i','n','a','l','D','a','t','a','b','a','s','e',0};
1210 static const WCHAR szUpgradeCode[] = {'U','p','g','r','a','d','e','C','o','d','e',0};
1211 static const WCHAR szAdminUser[] = {'A','d','m','i','n','U','s','e','r',0};
1212 static const WCHAR szIntel[] = {'I','n','t','e','l',0};
1213 static const WCHAR szIntel64[] = {'I','n','t','e','l','6','4',0};
1214 static const WCHAR szX64[] = {'x','6','4',0};
1215 static const WCHAR szAMD64[] = {'A','M','D','6','4',0};
1216 static const WCHAR szARM[] = {'A','r','m',0};
1217 static const WCHAR szARM64[] = {'A','r','m','6','4',0};
1218 static const WCHAR szStreams[] = {'_','S','t','r','e','a','m','s',0};
1219 static const WCHAR szStorages[] = {'_','S','t','o','r','a','g','e','s',0};
1220 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};
1221 static const WCHAR szMsiUnpublishAssemblies[] = {'M','s','i','U','n','p','u','b','l','i','s','h','A','s','s','e','m','b','l','i','e','s',0};
1222 static const WCHAR szCostingComplete[] = {'C','o','s','t','i','n','g','C','o','m','p','l','e','t','e',0};
1223 static const WCHAR szTempFolder[] = {'T','e','m','p','F','o','l','d','e','r',0};
1224 static const WCHAR szDatabase[] = {'D','A','T','A','B','A','S','E',0};
1225 static const WCHAR szCRoot[] = {'C',':','\\',0};
1226 static const WCHAR szProductLanguage[] = {'P','r','o','d','u','c','t','L','a','n','g','u','a','g','e',0};
1227 static const WCHAR szProductVersion[] = {'P','r','o','d','u','c','t','V','e','r','s','i','o','n',0};
1228 static const WCHAR szWindowsInstaller[] = {'W','i','n','d','o','w','s','I','n','s','t','a','l','l','e','r',0};
1229 static const WCHAR szStringData[] = {'_','S','t','r','i','n','g','D','a','t','a',0};
1230 static const WCHAR szStringPool[] = {'_','S','t','r','i','n','g','P','o','o','l',0};
1231 static const WCHAR szInstallLevel[] = {'I','N','S','T','A','L','L','L','E','V','E','L',0};
1232 static const WCHAR szCostInitialize[] = {'C','o','s','t','I','n','i','t','i','a','l','i','z','e',0};
1233 static const WCHAR szAppDataFolder[] = {'A','p','p','D','a','t','a','F','o','l','d','e','r',0};
1234 static const WCHAR szRollbackDisabled[] = {'R','o','l','l','b','a','c','k','D','i','s','a','b','l','e','d',0};
1235 static const WCHAR szName[] = {'N','a','m','e',0};
1236 static const WCHAR szData[] = {'D','a','t','a',0};
1237 static const WCHAR szLangResource[] = {'\\','V','a','r','F','i','l','e','I','n','f','o','\\','T','r','a','n','s','l','a','t','i','o','n',0};
1238 static const WCHAR szInstallLocation[] = {'I','n','s','t','a','l','l','L','o','c','a','t','i','o','n',0};
1239 static const WCHAR szProperty[] = {'P','r','o','p','e','r','t','y',0};
1240 static const WCHAR szUninstallable[] = {'U','n','i','n','s','t','a','l','l','a','b','l','e',0};
1241 static const WCHAR szEXECUTEACTION[] = {'E','X','E','C','U','T','E','A','C','T','I','O','N',0};
1242 static const WCHAR szProductToBeRegistered[] = {'P','r','o','d','u','c','t','T','o','B','e','R','e','g','i','s','t','e','r','e','d',0};
1244 /* memory allocation macro functions */
1245 static void *msi_alloc( size_t len ) __WINE_ALLOC_SIZE(1);
1246 static inline void *msi_alloc( size_t len )
1248 return HeapAlloc( GetProcessHeap(), 0, len );
1251 static void *msi_alloc_zero( size_t len ) __WINE_ALLOC_SIZE(1);
1252 static inline void *msi_alloc_zero( size_t len )
1254 return HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, len );
1257 static void *msi_realloc( void *mem, size_t len ) __WINE_ALLOC_SIZE(2);
1258 static inline void *msi_realloc( void *mem, size_t len )
1260 return HeapReAlloc( GetProcessHeap(), 0, mem, len );
1263 static void *msi_realloc_zero( void *mem, size_t len ) __WINE_ALLOC_SIZE(2);
1264 static inline void *msi_realloc_zero( void *mem, size_t len )
1266 return HeapReAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, mem, len );
1269 static inline BOOL msi_free( void *mem )
1271 return HeapFree( GetProcessHeap(), 0, mem );
1274 static inline char *strdupWtoA( LPCWSTR str )
1276 LPSTR ret = NULL;
1277 DWORD len;
1279 if (!str) return ret;
1280 len = WideCharToMultiByte( CP_ACP, 0, str, -1, NULL, 0, NULL, NULL);
1281 ret = msi_alloc( len );
1282 if (ret)
1283 WideCharToMultiByte( CP_ACP, 0, str, -1, ret, len, NULL, NULL );
1284 return ret;
1287 static inline LPWSTR strdupAtoW( LPCSTR str )
1289 LPWSTR ret = NULL;
1290 DWORD len;
1292 if (!str) return ret;
1293 len = MultiByteToWideChar( CP_ACP, 0, str, -1, NULL, 0 );
1294 ret = msi_alloc( len * sizeof(WCHAR) );
1295 if (ret)
1296 MultiByteToWideChar( CP_ACP, 0, str, -1, ret, len );
1297 return ret;
1300 static inline LPWSTR strdupW( LPCWSTR src )
1302 LPWSTR dest;
1303 if (!src) return NULL;
1304 dest = msi_alloc( (lstrlenW(src)+1)*sizeof(WCHAR) );
1305 if (dest)
1306 lstrcpyW(dest, src);
1307 return dest;
1310 #endif /* __WINE_MSI_PRIVATE__ */