Home | Info | Community | Development | myReactOS | Contact Us
ReactOS Development > Doxygenmsipriv.h
Go to the documentation of this file.
00001 /* 00002 * Implementation of the Microsoft Installer (msi.dll) 00003 * 00004 * Copyright 2002-2005 Mike McCormack for CodeWeavers 00005 * Copyright 2005 Aric Stewart for CodeWeavers 00006 * 00007 * This library is free software; you can redistribute it and/or 00008 * modify it under the terms of the GNU Lesser General Public 00009 * License as published by the Free Software Foundation; either 00010 * version 2.1 of the License, or (at your option) any later version. 00011 * 00012 * This library is distributed in the hope that it will be useful, 00013 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00015 * Lesser General Public License for more details. 00016 * 00017 * You should have received a copy of the GNU Lesser General Public 00018 * License along with this library; if not, write to the Free Software 00019 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA 00020 */ 00021 00022 #ifndef __WINE_MSI_PRIVATE__ 00023 #define __WINE_MSI_PRIVATE__ 00024 00025 #include <stdarg.h> 00026 00027 #include "windef.h" 00028 #include "winbase.h" 00029 #include "fdi.h" 00030 #include "msi.h" 00031 #include "msiquery.h" 00032 #include "msidefs.h" 00033 #include "objbase.h" 00034 #include "objidl.h" 00035 #include "fusion.h" 00036 #include "winnls.h" 00037 #include "winver.h" 00038 #include "wine/list.h" 00039 #include "wine/debug.h" 00040 00041 static const BOOL is_64bit = sizeof(void *) > sizeof(int); 00042 00043 #define MSI_DATASIZEMASK 0x00ff 00044 #define MSITYPE_VALID 0x0100 00045 #define MSITYPE_LOCALIZABLE 0x200 00046 #define MSITYPE_STRING 0x0800 00047 #define MSITYPE_NULLABLE 0x1000 00048 #define MSITYPE_KEY 0x2000 00049 #define MSITYPE_TEMPORARY 0x4000 00050 #define MSITYPE_UNKNOWN 0x8000 00051 00052 #define MAX_STREAM_NAME_LEN 62 00053 #define LONG_STR_BYTES 3 00054 00055 /* Install UI level mask for AND operation to exclude flags */ 00056 #define INSTALLUILEVEL_MASK 0x0007 00057 00058 #define MSITYPE_IS_BINARY(type) (((type) & ~MSITYPE_NULLABLE) == (MSITYPE_STRING|MSITYPE_VALID)) 00059 00060 struct tagMSITABLE; 00061 typedef struct tagMSITABLE MSITABLE; 00062 00063 struct string_table; 00064 typedef struct string_table string_table; 00065 00066 struct tagMSIOBJECTHDR; 00067 typedef struct tagMSIOBJECTHDR MSIOBJECTHDR; 00068 00069 typedef VOID (*msihandledestructor)( MSIOBJECTHDR * ); 00070 00071 struct tagMSIOBJECTHDR 00072 { 00073 UINT magic; 00074 UINT type; 00075 LONG refcount; 00076 msihandledestructor destructor; 00077 }; 00078 00079 #define MSI_INITIAL_MEDIA_TRANSFORM_OFFSET 10000 00080 #define MSI_INITIAL_MEDIA_TRANSFORM_DISKID 30000 00081 00082 typedef struct tagMSIDATABASE 00083 { 00084 MSIOBJECTHDR hdr; 00085 IStorage *storage; 00086 string_table *strings; 00087 UINT bytes_per_strref; 00088 LPWSTR path; 00089 LPWSTR deletefile; 00090 LPCWSTR mode; 00091 UINT media_transform_offset; 00092 UINT media_transform_disk_id; 00093 struct list tables; 00094 struct list transforms; 00095 struct list streams; 00096 } MSIDATABASE; 00097 00098 typedef struct tagMSIVIEW MSIVIEW; 00099 00100 typedef struct tagMSIQUERY 00101 { 00102 MSIOBJECTHDR hdr; 00103 MSIVIEW *view; 00104 UINT row; 00105 MSIDATABASE *db; 00106 struct list mem; 00107 } MSIQUERY; 00108 00109 /* maybe we can use a Variant instead of doing it ourselves? */ 00110 typedef struct tagMSIFIELD 00111 { 00112 UINT type; 00113 union 00114 { 00115 INT iVal; 00116 INT_PTR pVal; 00117 LPWSTR szwVal; 00118 IStream *stream; 00119 } u; 00120 } MSIFIELD; 00121 00122 typedef struct tagMSIRECORD 00123 { 00124 MSIOBJECTHDR hdr; 00125 UINT count; /* as passed to MsiCreateRecord */ 00126 MSIFIELD fields[1]; /* nb. array size is count+1 */ 00127 } MSIRECORD; 00128 00129 typedef struct tagMSISOURCELISTINFO 00130 { 00131 struct list entry; 00132 DWORD context; 00133 DWORD options; 00134 LPCWSTR property; 00135 LPWSTR value; 00136 } MSISOURCELISTINFO; 00137 00138 typedef struct tagMSIMEDIADISK 00139 { 00140 struct list entry; 00141 DWORD context; 00142 DWORD options; 00143 DWORD disk_id; 00144 LPWSTR volume_label; 00145 LPWSTR disk_prompt; 00146 } MSIMEDIADISK; 00147 00148 typedef struct tagMSIMEDIAINFO 00149 { 00150 UINT disk_id; 00151 UINT type; 00152 UINT last_sequence; 00153 LPWSTR disk_prompt; 00154 LPWSTR cabinet; 00155 LPWSTR first_volume; 00156 LPWSTR volume_label; 00157 BOOL is_continuous; 00158 BOOL is_extracted; 00159 WCHAR sourcedir[MAX_PATH]; 00160 } MSIMEDIAINFO; 00161 00162 typedef struct tagMSICABINETSTREAM 00163 { 00164 struct list entry; 00165 UINT disk_id; 00166 IStorage *storage; 00167 WCHAR *stream; 00168 } MSICABINETSTREAM; 00169 00170 typedef struct tagMSIPATCHINFO 00171 { 00172 struct list entry; 00173 LPWSTR patchcode; 00174 LPWSTR products; 00175 LPWSTR transforms; 00176 LPWSTR filename; 00177 LPWSTR localfile; 00178 MSIPATCHSTATE state; 00179 BOOL delete_on_close; 00180 } MSIPATCHINFO; 00181 00182 typedef struct tagMSIBINARY 00183 { 00184 struct list entry; 00185 WCHAR *source; 00186 WCHAR *tmpfile; 00187 HMODULE module; 00188 } MSIBINARY; 00189 00190 typedef struct _column_info 00191 { 00192 LPCWSTR table; 00193 LPCWSTR column; 00194 INT type; 00195 BOOL temporary; 00196 struct expr *val; 00197 struct _column_info *next; 00198 } column_info; 00199 00200 typedef const struct tagMSICOLUMNHASHENTRY *MSIITERHANDLE; 00201 00202 typedef struct tagMSIVIEWOPS 00203 { 00204 /* 00205 * fetch_int - reads one integer from {row,col} in the table 00206 * 00207 * This function should be called after the execute method. 00208 * Data returned by the function should not change until 00209 * close or delete is called. 00210 * To get a string value, query the database's string table with 00211 * the integer value returned from this function. 00212 */ 00213 UINT (*fetch_int)( struct tagMSIVIEW *view, UINT row, UINT col, UINT *val ); 00214 00215 /* 00216 * fetch_stream - gets a stream from {row,col} in the table 00217 * 00218 * This function is similar to fetch_int, except fetches a 00219 * stream instead of an integer. 00220 */ 00221 UINT (*fetch_stream)( struct tagMSIVIEW *view, UINT row, UINT col, IStream **stm ); 00222 00223 /* 00224 * get_row - gets values from a row 00225 * 00226 */ 00227 UINT (*get_row)( struct tagMSIVIEW *view, UINT row, MSIRECORD **rec ); 00228 00229 /* 00230 * set_row - sets values in a row as specified by mask 00231 * 00232 * Similar semantics to fetch_int 00233 */ 00234 UINT (*set_row)( struct tagMSIVIEW *view, UINT row, MSIRECORD *rec, UINT mask ); 00235 00236 /* 00237 * Inserts a new row into the database from the records contents 00238 */ 00239 UINT (*insert_row)( struct tagMSIVIEW *view, MSIRECORD *record, UINT row, BOOL temporary ); 00240 00241 /* 00242 * Deletes a row from the database 00243 */ 00244 UINT (*delete_row)( struct tagMSIVIEW *view, UINT row ); 00245 00246 /* 00247 * execute - loads the underlying data into memory so it can be read 00248 */ 00249 UINT (*execute)( struct tagMSIVIEW *view, MSIRECORD *record ); 00250 00251 /* 00252 * close - clears the data read by execute from memory 00253 */ 00254 UINT (*close)( struct tagMSIVIEW *view ); 00255 00256 /* 00257 * get_dimensions - returns the number of rows or columns in a table. 00258 * 00259 * The number of rows can only be queried after the execute method 00260 * is called. The number of columns can be queried at any time. 00261 */ 00262 UINT (*get_dimensions)( struct tagMSIVIEW *view, UINT *rows, UINT *cols ); 00263 00264 /* 00265 * get_column_info - returns the name and type of a specific column 00266 * 00267 * The column information can be queried at any time. 00268 */ 00269 UINT (*get_column_info)( struct tagMSIVIEW *view, UINT n, LPCWSTR *name, UINT *type, 00270 BOOL *temporary, LPCWSTR *table_name ); 00271 00272 /* 00273 * modify - not yet implemented properly 00274 */ 00275 UINT (*modify)( struct tagMSIVIEW *view, MSIMODIFY eModifyMode, MSIRECORD *record, UINT row ); 00276 00277 /* 00278 * delete - destroys the structure completely 00279 */ 00280 UINT (*delete)( struct tagMSIVIEW * ); 00281 00282 /* 00283 * find_matching_rows - iterates through rows that match a value 00284 * 00285 * If the column type is a string then a string ID should be passed in. 00286 * If the value to be looked up is an integer then no transformation of 00287 * the input value is required, except if the column is a string, in which 00288 * case a string ID should be passed in. 00289 * The handle is an input/output parameter that keeps track of the current 00290 * position in the iteration. It must be initialised to zero before the 00291 * first call and continued to be passed in to subsequent calls. 00292 */ 00293 UINT (*find_matching_rows)( struct tagMSIVIEW *view, UINT col, UINT val, UINT *row, MSIITERHANDLE *handle ); 00294 00295 /* 00296 * add_ref - increases the reference count of the table 00297 */ 00298 UINT (*add_ref)( struct tagMSIVIEW *view ); 00299 00300 /* 00301 * release - decreases the reference count of the table 00302 */ 00303 UINT (*release)( struct tagMSIVIEW *view ); 00304 00305 /* 00306 * add_column - adds a column to the table 00307 */ 00308 UINT (*add_column)( struct tagMSIVIEW *view, LPCWSTR table, UINT number, LPCWSTR column, UINT type, BOOL hold ); 00309 00310 /* 00311 * remove_column - removes the column represented by table name and column number from the table 00312 */ 00313 UINT (*remove_column)( struct tagMSIVIEW *view, LPCWSTR table, UINT number ); 00314 00315 /* 00316 * sort - orders the table by columns 00317 */ 00318 UINT (*sort)( struct tagMSIVIEW *view, column_info *columns ); 00319 00320 /* 00321 * drop - drops the table from the database 00322 */ 00323 UINT (*drop)( struct tagMSIVIEW *view ); 00324 } MSIVIEWOPS; 00325 00326 struct tagMSIVIEW 00327 { 00328 MSIOBJECTHDR hdr; 00329 const MSIVIEWOPS *ops; 00330 MSIDBERROR error; 00331 const WCHAR *error_column; 00332 }; 00333 00334 struct msi_dialog_tag; 00335 typedef struct msi_dialog_tag msi_dialog; 00336 00337 enum platform 00338 { 00339 PLATFORM_INTEL, 00340 PLATFORM_INTEL64, 00341 PLATFORM_X64, 00342 PLATFORM_ARM 00343 }; 00344 00345 enum clr_version 00346 { 00347 CLR_VERSION_V10, 00348 CLR_VERSION_V11, 00349 CLR_VERSION_V20, 00350 CLR_VERSION_MAX 00351 }; 00352 00353 typedef struct tagMSIPACKAGE 00354 { 00355 MSIOBJECTHDR hdr; 00356 MSIDATABASE *db; 00357 INT version; 00358 enum platform platform; 00359 UINT num_langids; 00360 LANGID *langids; 00361 struct list patches; 00362 struct list components; 00363 struct list features; 00364 struct list files; 00365 struct list filepatches; 00366 struct list tempfiles; 00367 struct list folders; 00368 struct list binaries; 00369 struct list cabinet_streams; 00370 LPWSTR ActionFormat; 00371 LPWSTR LastAction; 00372 HANDLE log_file; 00373 IAssemblyCache *cache_net[CLR_VERSION_MAX]; 00374 IAssemblyCache *cache_sxs; 00375 00376 struct list classes; 00377 struct list extensions; 00378 struct list progids; 00379 struct list mimes; 00380 struct list appids; 00381 00382 struct tagMSISCRIPT *script; 00383 00384 struct list RunningActions; 00385 00386 LPWSTR BaseURL; 00387 LPWSTR PackagePath; 00388 LPWSTR ProductCode; 00389 LPWSTR localfile; 00390 BOOL delete_on_close; 00391 00392 INSTALLUILEVEL ui_level; 00393 UINT CurrentInstallState; 00394 msi_dialog *dialog; 00395 LPWSTR next_dialog; 00396 float center_x; 00397 float center_y; 00398 00399 UINT WordCount; 00400 UINT Context; 00401 00402 struct list subscriptions; 00403 00404 struct list sourcelist_info; 00405 struct list sourcelist_media; 00406 00407 unsigned char scheduled_action_running : 1; 00408 unsigned char commit_action_running : 1; 00409 unsigned char rollback_action_running : 1; 00410 unsigned char need_reboot_at_end : 1; 00411 unsigned char need_reboot_now : 1; 00412 unsigned char need_rollback : 1; 00413 } MSIPACKAGE; 00414 00415 typedef struct tagMSIPREVIEW 00416 { 00417 MSIOBJECTHDR hdr; 00418 MSIPACKAGE *package; 00419 msi_dialog *dialog; 00420 } MSIPREVIEW; 00421 00422 #define MSI_MAX_PROPS 20 00423 00424 typedef struct tagMSISUMMARYINFO 00425 { 00426 MSIOBJECTHDR hdr; 00427 IStorage *storage; 00428 DWORD update_count; 00429 PROPVARIANT property[MSI_MAX_PROPS]; 00430 } MSISUMMARYINFO; 00431 00432 typedef struct tagMSIFEATURE 00433 { 00434 struct list entry; 00435 LPWSTR Feature; 00436 LPWSTR Feature_Parent; 00437 LPWSTR Title; 00438 LPWSTR Description; 00439 INT Display; 00440 INT Level; 00441 LPWSTR Directory; 00442 INT Attributes; 00443 INSTALLSTATE Installed; 00444 INSTALLSTATE ActionRequest; 00445 INSTALLSTATE Action; 00446 struct list Children; 00447 struct list Components; 00448 } MSIFEATURE; 00449 00450 typedef struct tagMSIASSEMBLY 00451 { 00452 LPWSTR feature; 00453 LPWSTR manifest; 00454 LPWSTR application; 00455 DWORD attributes; 00456 LPWSTR display_name; 00457 LPWSTR tempdir; 00458 BOOL installed; 00459 BOOL clr_version[CLR_VERSION_MAX]; 00460 } MSIASSEMBLY; 00461 00462 typedef struct tagMSICOMPONENT 00463 { 00464 struct list entry; 00465 LPWSTR Component; 00466 LPWSTR ComponentId; 00467 LPWSTR Directory; 00468 INT Attributes; 00469 LPWSTR Condition; 00470 LPWSTR KeyPath; 00471 INSTALLSTATE Installed; 00472 INSTALLSTATE ActionRequest; 00473 INSTALLSTATE Action; 00474 BOOL ForceLocalState; 00475 BOOL Enabled; 00476 INT Cost; 00477 INT RefCount; 00478 LPWSTR FullKeypath; 00479 LPWSTR AdvertiseString; 00480 MSIASSEMBLY *assembly; 00481 00482 unsigned int anyAbsent:1; 00483 unsigned int hasAdvertiseFeature:1; 00484 unsigned int hasLocalFeature:1; 00485 unsigned int hasSourceFeature:1; 00486 } MSICOMPONENT; 00487 00488 typedef struct tagComponentList 00489 { 00490 struct list entry; 00491 MSICOMPONENT *component; 00492 } ComponentList; 00493 00494 typedef struct tagFeatureList 00495 { 00496 struct list entry; 00497 MSIFEATURE *feature; 00498 } FeatureList; 00499 00500 enum folder_state 00501 { 00502 FOLDER_STATE_UNINITIALIZED, 00503 FOLDER_STATE_EXISTS, 00504 FOLDER_STATE_CREATED, 00505 FOLDER_STATE_CREATED_PERSISTENT, 00506 FOLDER_STATE_REMOVED 00507 }; 00508 00509 typedef struct tagMSIFOLDER 00510 { 00511 struct list entry; 00512 struct list children; 00513 LPWSTR Directory; 00514 LPWSTR Parent; 00515 LPWSTR TargetDefault; 00516 LPWSTR SourceLongPath; 00517 LPWSTR SourceShortPath; 00518 LPWSTR ResolvedTarget; 00519 LPWSTR ResolvedSource; 00520 enum folder_state State; 00521 BOOL persistent; 00522 INT Cost; 00523 INT Space; 00524 } MSIFOLDER; 00525 00526 typedef struct tagFolderList 00527 { 00528 struct list entry; 00529 MSIFOLDER *folder; 00530 } FolderList; 00531 00532 typedef enum _msi_file_state { 00533 msifs_invalid, 00534 msifs_missing, 00535 msifs_overwrite, 00536 msifs_present, 00537 msifs_installed, 00538 msifs_skipped, 00539 msifs_hashmatch 00540 } msi_file_state; 00541 00542 typedef struct tagMSIFILE 00543 { 00544 struct list entry; 00545 LPWSTR File; 00546 MSICOMPONENT *Component; 00547 LPWSTR FileName; 00548 LPWSTR ShortName; 00549 LPWSTR LongName; 00550 INT FileSize; 00551 LPWSTR Version; 00552 LPWSTR Language; 00553 INT Attributes; 00554 INT Sequence; 00555 msi_file_state state; 00556 LPWSTR TargetPath; 00557 BOOL IsCompressed; 00558 MSIFILEHASHINFO hash; 00559 UINT disk_id; 00560 } MSIFILE; 00561 00562 typedef struct tagMSITEMPFILE 00563 { 00564 struct list entry; 00565 LPWSTR Path; 00566 } MSITEMPFILE; 00567 00568 typedef struct tagMSIFILEPATCH 00569 { 00570 struct list entry; 00571 MSIFILE *File; 00572 INT Sequence; 00573 INT PatchSize; 00574 INT Attributes; 00575 BOOL IsApplied; 00576 } MSIFILEPATCH; 00577 00578 typedef struct tagMSIAPPID 00579 { 00580 struct list entry; 00581 LPWSTR AppID; /* Primary key */ 00582 LPWSTR RemoteServerName; 00583 LPWSTR LocalServer; 00584 LPWSTR ServiceParameters; 00585 LPWSTR DllSurrogate; 00586 BOOL ActivateAtStorage; 00587 BOOL RunAsInteractiveUser; 00588 } MSIAPPID; 00589 00590 typedef struct tagMSIPROGID MSIPROGID; 00591 00592 typedef struct tagMSICLASS 00593 { 00594 struct list entry; 00595 LPWSTR clsid; /* Primary Key */ 00596 LPWSTR Context; /* Primary Key */ 00597 MSICOMPONENT *Component; 00598 MSIPROGID *ProgID; 00599 LPWSTR ProgIDText; 00600 LPWSTR Description; 00601 MSIAPPID *AppID; 00602 LPWSTR FileTypeMask; 00603 LPWSTR IconPath; 00604 LPWSTR DefInprocHandler; 00605 LPWSTR DefInprocHandler32; 00606 LPWSTR Argument; 00607 MSIFEATURE *Feature; 00608 INT Attributes; 00609 /* not in the table, set during installation */ 00610 BOOL Installed; 00611 } MSICLASS; 00612 00613 typedef struct tagMSIMIME MSIMIME; 00614 00615 typedef struct tagMSIEXTENSION 00616 { 00617 struct list entry; 00618 LPWSTR Extension; /* Primary Key */ 00619 MSICOMPONENT *Component; 00620 MSIPROGID *ProgID; 00621 LPWSTR ProgIDText; 00622 MSIMIME *Mime; 00623 MSIFEATURE *Feature; 00624 /* not in the table, set during installation */ 00625 BOOL Installed; 00626 struct list verbs; 00627 } MSIEXTENSION; 00628 00629 struct tagMSIPROGID 00630 { 00631 struct list entry; 00632 LPWSTR ProgID; /* Primary Key */ 00633 MSIPROGID *Parent; 00634 MSICLASS *Class; 00635 LPWSTR Description; 00636 LPWSTR IconPath; 00637 /* not in the table, set during installation */ 00638 BOOL InstallMe; 00639 MSIPROGID *CurVer; 00640 MSIPROGID *VersionInd; 00641 }; 00642 00643 typedef struct tagMSIVERB 00644 { 00645 struct list entry; 00646 LPWSTR Verb; 00647 INT Sequence; 00648 LPWSTR Command; 00649 LPWSTR Argument; 00650 } MSIVERB; 00651 00652 struct tagMSIMIME 00653 { 00654 struct list entry; 00655 LPWSTR ContentType; /* Primary Key */ 00656 MSIEXTENSION *Extension; 00657 LPWSTR suffix; 00658 LPWSTR clsid; 00659 MSICLASS *Class; 00660 /* not in the table, set during installation */ 00661 BOOL InstallMe; 00662 }; 00663 00664 enum SCRIPTS 00665 { 00666 SCRIPT_NONE = -1, 00667 SCRIPT_INSTALL = 0, 00668 SCRIPT_COMMIT = 1, 00669 SCRIPT_ROLLBACK = 2, 00670 SCRIPT_MAX = 3 00671 }; 00672 00673 #define SEQUENCE_UI 0x1 00674 #define SEQUENCE_EXEC 0x2 00675 #define SEQUENCE_INSTALL 0x10 00676 00677 typedef struct tagMSISCRIPT 00678 { 00679 LPWSTR *Actions[SCRIPT_MAX]; 00680 UINT ActionCount[SCRIPT_MAX]; 00681 BOOL ExecuteSequenceRun; 00682 BOOL CurrentlyScripting; 00683 UINT InWhatSequence; 00684 LPWSTR *UniqueActions; 00685 UINT UniqueActionsCount; 00686 } MSISCRIPT; 00687 00688 #define MSIHANDLETYPE_ANY 0 00689 #define MSIHANDLETYPE_DATABASE 1 00690 #define MSIHANDLETYPE_SUMMARYINFO 2 00691 #define MSIHANDLETYPE_VIEW 3 00692 #define MSIHANDLETYPE_RECORD 4 00693 #define MSIHANDLETYPE_PACKAGE 5 00694 #define MSIHANDLETYPE_PREVIEW 6 00695 00696 #define MSI_MAJORVERSION 4 00697 #define MSI_MINORVERSION 5 00698 #define MSI_BUILDNUMBER 6001 00699 00700 #define GUID_SIZE 39 00701 #define SQUISH_GUID_SIZE 33 00702 00703 #define MSIHANDLE_MAGIC 0x4d434923 00704 00705 /* handle unicode/ascii output in the Msi* API functions */ 00706 typedef struct { 00707 BOOL unicode; 00708 union { 00709 LPSTR a; 00710 LPWSTR w; 00711 } str; 00712 } awstring; 00713 00714 typedef struct { 00715 BOOL unicode; 00716 union { 00717 LPCSTR a; 00718 LPCWSTR w; 00719 } str; 00720 } awcstring; 00721 00722 UINT msi_strcpy_to_awstring( LPCWSTR str, awstring *awbuf, DWORD *sz ) DECLSPEC_HIDDEN; 00723 00724 /* msi server interface */ 00725 extern HRESULT create_msi_custom_remote( IUnknown *pOuter, LPVOID *ppObj ) DECLSPEC_HIDDEN; 00726 extern HRESULT create_msi_remote_package( IUnknown *pOuter, LPVOID *ppObj ) DECLSPEC_HIDDEN; 00727 extern HRESULT create_msi_remote_database( IUnknown *pOuter, LPVOID *ppObj ) DECLSPEC_HIDDEN; 00728 extern IUnknown *msi_get_remote(MSIHANDLE handle) DECLSPEC_HIDDEN; 00729 00730 /* handle functions */ 00731 extern void *msihandle2msiinfo(MSIHANDLE handle, UINT type) DECLSPEC_HIDDEN; 00732 extern MSIHANDLE alloc_msihandle( MSIOBJECTHDR * ) DECLSPEC_HIDDEN; 00733 extern MSIHANDLE alloc_msi_remote_handle( IUnknown *unk ) DECLSPEC_HIDDEN; 00734 extern void *alloc_msiobject(UINT type, UINT size, msihandledestructor destroy ) DECLSPEC_HIDDEN; 00735 extern void msiobj_addref(MSIOBJECTHDR *) DECLSPEC_HIDDEN; 00736 extern int msiobj_release(MSIOBJECTHDR *) DECLSPEC_HIDDEN; 00737 extern void msiobj_lock(MSIOBJECTHDR *) DECLSPEC_HIDDEN; 00738 extern void msiobj_unlock(MSIOBJECTHDR *) DECLSPEC_HIDDEN; 00739 extern void msi_free_handle_table(void) DECLSPEC_HIDDEN; 00740 00741 extern void free_cached_tables( MSIDATABASE *db ) DECLSPEC_HIDDEN; 00742 extern UINT MSI_CommitTables( MSIDATABASE *db ) DECLSPEC_HIDDEN; 00743 00744 00745 /* string table functions */ 00746 enum StringPersistence 00747 { 00748 StringPersistent = 0, 00749 StringNonPersistent = 1 00750 }; 00751 00752 extern BOOL msi_addstringW( string_table *st, const WCHAR *data, int len, USHORT refcount, enum StringPersistence persistence ) DECLSPEC_HIDDEN; 00753 extern UINT msi_string2idW( const string_table *st, LPCWSTR buffer, UINT *id ) DECLSPEC_HIDDEN; 00754 extern VOID msi_destroy_stringtable( string_table *st ) DECLSPEC_HIDDEN; 00755 extern const WCHAR *msi_string_lookup_id( const string_table *st, UINT id ) DECLSPEC_HIDDEN; 00756 extern HRESULT msi_init_string_table( IStorage *stg ) DECLSPEC_HIDDEN; 00757 extern string_table *msi_load_string_table( IStorage *stg, UINT *bytes_per_strref ) DECLSPEC_HIDDEN; 00758 extern UINT msi_save_string_table( const string_table *st, IStorage *storage, UINT *bytes_per_strref ) DECLSPEC_HIDDEN; 00759 extern UINT msi_get_string_table_codepage( const string_table *st ) DECLSPEC_HIDDEN; 00760 extern UINT msi_set_string_table_codepage( string_table *st, UINT codepage ) DECLSPEC_HIDDEN; 00761 00762 extern BOOL TABLE_Exists( MSIDATABASE *db, LPCWSTR name ) DECLSPEC_HIDDEN; 00763 extern MSICONDITION MSI_DatabaseIsTablePersistent( MSIDATABASE *db, LPCWSTR table ) DECLSPEC_HIDDEN; 00764 00765 extern UINT read_stream_data( IStorage *stg, LPCWSTR stname, BOOL table, 00766 BYTE **pdata, UINT *psz ) DECLSPEC_HIDDEN; 00767 extern UINT write_stream_data( IStorage *stg, LPCWSTR stname, 00768 LPCVOID data, UINT sz, BOOL bTable ) DECLSPEC_HIDDEN; 00769 00770 /* transform functions */ 00771 extern UINT msi_table_apply_transform( MSIDATABASE *db, IStorage *stg ) DECLSPEC_HIDDEN; 00772 extern UINT MSI_DatabaseApplyTransformW( MSIDATABASE *db, 00773 LPCWSTR szTransformFile, int iErrorCond ) DECLSPEC_HIDDEN; 00774 extern void append_storage_to_db( MSIDATABASE *db, IStorage *stg ) DECLSPEC_HIDDEN; 00775 extern UINT msi_apply_transforms( MSIPACKAGE *package ) DECLSPEC_HIDDEN; 00776 00777 /* patch functions */ 00778 extern UINT msi_check_patch_applicable( MSIPACKAGE *package, MSISUMMARYINFO *si ) DECLSPEC_HIDDEN; 00779 extern UINT msi_apply_patches( MSIPACKAGE *package ) DECLSPEC_HIDDEN; 00780 extern UINT msi_apply_registered_patch( MSIPACKAGE *package, LPCWSTR patch_code ) DECLSPEC_HIDDEN; 00781 extern void msi_free_patchinfo( MSIPATCHINFO *patch ) DECLSPEC_HIDDEN; 00782 00783 /* action internals */ 00784 extern UINT MSI_InstallPackage( MSIPACKAGE *, LPCWSTR, LPCWSTR ) DECLSPEC_HIDDEN; 00785 extern UINT ACTION_DialogBox( MSIPACKAGE*, LPCWSTR) DECLSPEC_HIDDEN; 00786 extern UINT ACTION_ForceReboot(MSIPACKAGE *package) DECLSPEC_HIDDEN; 00787 extern UINT MSI_Sequence( MSIPACKAGE *package, LPCWSTR szTable ) DECLSPEC_HIDDEN; 00788 extern UINT MSI_SetFeatureStates( MSIPACKAGE *package ) DECLSPEC_HIDDEN; 00789 extern UINT msi_parse_command_line( MSIPACKAGE *package, LPCWSTR szCommandLine, BOOL preserve_case ) DECLSPEC_HIDDEN; 00790 extern UINT msi_schedule_action( MSIPACKAGE *package, UINT script, const WCHAR *action ) DECLSPEC_HIDDEN; 00791 extern INSTALLSTATE msi_get_component_action( MSIPACKAGE *package, MSICOMPONENT *comp ) DECLSPEC_HIDDEN; 00792 extern INSTALLSTATE msi_get_feature_action( MSIPACKAGE *package, MSIFEATURE *feature ) DECLSPEC_HIDDEN; 00793 extern UINT msi_load_all_components( MSIPACKAGE *package ) DECLSPEC_HIDDEN; 00794 extern UINT msi_load_all_features( MSIPACKAGE *package ) DECLSPEC_HIDDEN; 00795 extern UINT msi_validate_product_id( MSIPACKAGE *package ) DECLSPEC_HIDDEN; 00796 00797 /* record internals */ 00798 extern void MSI_CloseRecord( MSIOBJECTHDR * ) DECLSPEC_HIDDEN; 00799 extern UINT MSI_RecordSetIStream( MSIRECORD *, UINT, IStream *) DECLSPEC_HIDDEN; 00800 extern UINT MSI_RecordGetIStream( MSIRECORD *, UINT, IStream **) DECLSPEC_HIDDEN; 00801 extern const WCHAR *MSI_RecordGetString( const MSIRECORD *, UINT ) DECLSPEC_HIDDEN; 00802 extern MSIRECORD *MSI_CreateRecord( UINT ) DECLSPEC_HIDDEN; 00803 extern UINT MSI_RecordSetInteger( MSIRECORD *, UINT, int ) DECLSPEC_HIDDEN; 00804 extern UINT MSI_RecordSetIntPtr( MSIRECORD *, UINT, INT_PTR ) DECLSPEC_HIDDEN; 00805 extern UINT MSI_RecordSetStringW( MSIRECORD *, UINT, LPCWSTR ) DECLSPEC_HIDDEN; 00806 extern BOOL MSI_RecordIsNull( MSIRECORD *, UINT ) DECLSPEC_HIDDEN; 00807 extern UINT MSI_RecordGetStringW( MSIRECORD * , UINT, LPWSTR, LPDWORD) DECLSPEC_HIDDEN; 00808 extern UINT MSI_RecordGetStringA( MSIRECORD *, UINT, LPSTR, LPDWORD) DECLSPEC_HIDDEN; 00809 extern int MSI_RecordGetInteger( MSIRECORD *, UINT ) DECLSPEC_HIDDEN; 00810 extern INT_PTR MSI_RecordGetIntPtr( MSIRECORD *, UINT ) DECLSPEC_HIDDEN; 00811 extern UINT MSI_RecordReadStream( MSIRECORD *, UINT, char *, LPDWORD) DECLSPEC_HIDDEN; 00812 extern UINT MSI_RecordSetStream(MSIRECORD *, UINT, IStream *) DECLSPEC_HIDDEN; 00813 extern UINT MSI_RecordGetFieldCount( const MSIRECORD *rec ) DECLSPEC_HIDDEN; 00814 extern UINT MSI_RecordStreamToFile( MSIRECORD *, UINT, LPCWSTR ) DECLSPEC_HIDDEN; 00815 extern UINT MSI_RecordSetStreamFromFileW( MSIRECORD *, UINT, LPCWSTR ) DECLSPEC_HIDDEN; 00816 extern UINT MSI_RecordCopyField( MSIRECORD *, UINT, MSIRECORD *, UINT ) DECLSPEC_HIDDEN; 00817 extern MSIRECORD *MSI_CloneRecord( MSIRECORD * ) DECLSPEC_HIDDEN; 00818 extern BOOL MSI_RecordsAreEqual( MSIRECORD *, MSIRECORD * ) DECLSPEC_HIDDEN; 00819 extern BOOL MSI_RecordsAreFieldsEqual(MSIRECORD *a, MSIRECORD *b, UINT field) DECLSPEC_HIDDEN; 00820 00821 /* stream internals */ 00822 extern void enum_stream_names( IStorage *stg ) DECLSPEC_HIDDEN; 00823 extern LPWSTR encode_streamname(BOOL bTable, LPCWSTR in) DECLSPEC_HIDDEN; 00824 extern BOOL decode_streamname(LPCWSTR in, LPWSTR out) DECLSPEC_HIDDEN; 00825 00826 /* database internals */ 00827 extern UINT msi_get_raw_stream( MSIDATABASE *, LPCWSTR, IStream ** ) DECLSPEC_HIDDEN; 00828 extern UINT msi_clone_open_stream( MSIDATABASE *, IStorage *, const WCHAR *, IStream ** ) DECLSPEC_HIDDEN; 00829 void msi_destroy_stream( MSIDATABASE *, const WCHAR * ) DECLSPEC_HIDDEN; 00830 extern UINT MSI_OpenDatabaseW( LPCWSTR, LPCWSTR, MSIDATABASE ** ) DECLSPEC_HIDDEN; 00831 extern UINT MSI_DatabaseOpenViewW(MSIDATABASE *, LPCWSTR, MSIQUERY ** ) DECLSPEC_HIDDEN; 00832 extern UINT MSI_OpenQuery( MSIDATABASE *, MSIQUERY **, LPCWSTR, ... ) DECLSPEC_HIDDEN; 00833 typedef UINT (*record_func)( MSIRECORD *, LPVOID ); 00834 extern UINT MSI_IterateRecords( MSIQUERY *, LPDWORD, record_func, LPVOID ) DECLSPEC_HIDDEN; 00835 extern MSIRECORD *MSI_QueryGetRecord( MSIDATABASE *db, LPCWSTR query, ... ) DECLSPEC_HIDDEN; 00836 extern UINT MSI_DatabaseGetPrimaryKeys( MSIDATABASE *, LPCWSTR, MSIRECORD ** ) DECLSPEC_HIDDEN; 00837 00838 /* view internals */ 00839 extern UINT MSI_ViewExecute( MSIQUERY*, MSIRECORD * ) DECLSPEC_HIDDEN; 00840 extern UINT MSI_ViewFetch( MSIQUERY*, MSIRECORD ** ) DECLSPEC_HIDDEN; 00841 extern UINT MSI_ViewClose( MSIQUERY* ) DECLSPEC_HIDDEN; 00842 extern UINT MSI_ViewGetColumnInfo(MSIQUERY *, MSICOLINFO, MSIRECORD **) DECLSPEC_HIDDEN; 00843 extern UINT MSI_ViewModify( MSIQUERY *, MSIMODIFY, MSIRECORD * ) DECLSPEC_HIDDEN; 00844 extern UINT VIEW_find_column( MSIVIEW *, LPCWSTR, LPCWSTR, UINT * ) DECLSPEC_HIDDEN; 00845 extern UINT msi_view_get_row(MSIDATABASE *, MSIVIEW *, UINT, MSIRECORD **) DECLSPEC_HIDDEN; 00846 00847 /* install internals */ 00848 extern UINT MSI_SetInstallLevel( MSIPACKAGE *package, int iInstallLevel ) DECLSPEC_HIDDEN; 00849 00850 /* package internals */ 00851 extern MSIPACKAGE *MSI_CreatePackage( MSIDATABASE *, LPCWSTR ) DECLSPEC_HIDDEN; 00852 extern UINT MSI_OpenPackageW( LPCWSTR szPackage, MSIPACKAGE **pPackage ) DECLSPEC_HIDDEN; 00853 extern UINT MSI_SetTargetPathW( MSIPACKAGE *, LPCWSTR, LPCWSTR ) DECLSPEC_HIDDEN; 00854 extern INT MSI_ProcessMessage( MSIPACKAGE *, INSTALLMESSAGE, MSIRECORD * ) DECLSPEC_HIDDEN; 00855 extern MSICONDITION MSI_EvaluateConditionW( MSIPACKAGE *, LPCWSTR ) DECLSPEC_HIDDEN; 00856 extern UINT MSI_GetComponentStateW( MSIPACKAGE *, LPCWSTR, INSTALLSTATE *, INSTALLSTATE * ) DECLSPEC_HIDDEN; 00857 extern UINT MSI_GetFeatureStateW( MSIPACKAGE *, LPCWSTR, INSTALLSTATE *, INSTALLSTATE * ) DECLSPEC_HIDDEN; 00858 extern UINT MSI_SetFeatureStateW(MSIPACKAGE*, LPCWSTR, INSTALLSTATE ) DECLSPEC_HIDDEN; 00859 extern UINT msi_download_file( LPCWSTR szUrl, LPWSTR filename ) DECLSPEC_HIDDEN; 00860 extern UINT msi_package_add_info(MSIPACKAGE *, DWORD, DWORD, LPCWSTR, LPWSTR) DECLSPEC_HIDDEN; 00861 extern UINT msi_package_add_media_disk(MSIPACKAGE *, DWORD, DWORD, DWORD, LPWSTR, LPWSTR) DECLSPEC_HIDDEN; 00862 extern UINT msi_clone_properties(MSIPACKAGE *) DECLSPEC_HIDDEN; 00863 extern UINT msi_set_context(MSIPACKAGE *) DECLSPEC_HIDDEN; 00864 extern void msi_adjust_privilege_properties(MSIPACKAGE *) DECLSPEC_HIDDEN; 00865 extern UINT MSI_GetFeatureCost(MSIPACKAGE *, MSIFEATURE *, MSICOSTTREE, INSTALLSTATE, LPINT) DECLSPEC_HIDDEN; 00866 00867 /* for deformating */ 00868 extern UINT MSI_FormatRecordW( MSIPACKAGE *, MSIRECORD *, LPWSTR, LPDWORD ) DECLSPEC_HIDDEN; 00869 00870 /* registry data encoding/decoding functions */ 00871 extern BOOL unsquash_guid(LPCWSTR in, LPWSTR out) DECLSPEC_HIDDEN; 00872 extern BOOL squash_guid(LPCWSTR in, LPWSTR out) DECLSPEC_HIDDEN; 00873 extern BOOL encode_base85_guid(GUID *,LPWSTR) DECLSPEC_HIDDEN; 00874 extern BOOL decode_base85_guid(LPCWSTR,GUID*) DECLSPEC_HIDDEN; 00875 extern UINT MSIREG_OpenUninstallKey(const WCHAR *, enum platform, HKEY *, BOOL) DECLSPEC_HIDDEN; 00876 extern UINT MSIREG_DeleteUninstallKey(const WCHAR *, enum platform) DECLSPEC_HIDDEN; 00877 extern UINT MSIREG_OpenProductKey(LPCWSTR szProduct, LPCWSTR szUserSid, 00878 MSIINSTALLCONTEXT context, HKEY* key, BOOL create) DECLSPEC_HIDDEN; 00879 extern UINT MSIREG_OpenFeaturesKey(LPCWSTR szProduct, MSIINSTALLCONTEXT context, 00880 HKEY *key, BOOL create) DECLSPEC_HIDDEN; 00881 extern UINT MSIREG_OpenUserPatchesKey(LPCWSTR szPatch, HKEY* key, BOOL create) DECLSPEC_HIDDEN; 00882 UINT MSIREG_OpenUserDataFeaturesKey(LPCWSTR szProduct, MSIINSTALLCONTEXT context, 00883 HKEY *key, BOOL create) DECLSPEC_HIDDEN; 00884 extern UINT MSIREG_OpenUserComponentsKey(LPCWSTR szComponent, HKEY* key, BOOL create) DECLSPEC_HIDDEN; 00885 extern UINT MSIREG_OpenUserDataComponentKey(LPCWSTR szComponent, LPCWSTR szUserSid, 00886 HKEY *key, BOOL create) DECLSPEC_HIDDEN; 00887 extern UINT MSIREG_OpenPatchesKey(LPCWSTR szPatch, HKEY* key, BOOL create) DECLSPEC_HIDDEN; 00888 extern UINT MSIREG_OpenUserDataProductKey(LPCWSTR szProduct, MSIINSTALLCONTEXT dwContext, 00889 LPCWSTR szUserSid, HKEY *key, BOOL create) DECLSPEC_HIDDEN; 00890 extern UINT MSIREG_OpenUserDataPatchKey(LPCWSTR szPatch, MSIINSTALLCONTEXT dwContext, 00891 HKEY *key, BOOL create) DECLSPEC_HIDDEN; 00892 extern UINT MSIREG_OpenUserDataProductPatchesKey(LPCWSTR product, MSIINSTALLCONTEXT context, 00893 HKEY *key, BOOL create) DECLSPEC_HIDDEN; 00894 extern UINT MSIREG_OpenInstallProps(LPCWSTR szProduct, MSIINSTALLCONTEXT dwContext, 00895 LPCWSTR szUserSid, HKEY *key, BOOL create) DECLSPEC_HIDDEN; 00896 extern UINT MSIREG_OpenUpgradeCodesKey(LPCWSTR szProduct, HKEY* key, BOOL create) DECLSPEC_HIDDEN; 00897 extern UINT MSIREG_OpenUserUpgradeCodesKey(LPCWSTR szProduct, HKEY* key, BOOL create) DECLSPEC_HIDDEN; 00898 extern UINT MSIREG_DeleteProductKey(LPCWSTR szProduct) DECLSPEC_HIDDEN; 00899 extern UINT MSIREG_DeleteUserProductKey(LPCWSTR szProduct) DECLSPEC_HIDDEN; 00900 extern UINT MSIREG_DeleteUserDataPatchKey(LPCWSTR patch, MSIINSTALLCONTEXT context) DECLSPEC_HIDDEN; 00901 extern UINT MSIREG_DeleteUserDataProductKey(LPCWSTR szProduct) DECLSPEC_HIDDEN; 00902 extern UINT MSIREG_DeleteUserFeaturesKey(LPCWSTR szProduct) DECLSPEC_HIDDEN; 00903 extern UINT MSIREG_DeleteUserDataComponentKey(LPCWSTR szComponent, LPCWSTR szUserSid) DECLSPEC_HIDDEN; 00904 extern UINT MSIREG_DeleteUserUpgradeCodesKey(LPCWSTR szUpgradeCode) DECLSPEC_HIDDEN; 00905 extern UINT MSIREG_DeleteClassesUpgradeCodesKey(LPCWSTR szUpgradeCode) DECLSPEC_HIDDEN; 00906 extern UINT MSIREG_OpenClassesUpgradeCodesKey(LPCWSTR szUpgradeCode, HKEY* key, BOOL create) DECLSPEC_HIDDEN; 00907 extern UINT MSIREG_DeleteLocalClassesProductKey(LPCWSTR szProductCode) DECLSPEC_HIDDEN; 00908 extern UINT MSIREG_DeleteLocalClassesFeaturesKey(LPCWSTR szProductCode) DECLSPEC_HIDDEN; 00909 extern UINT msi_locate_product(LPCWSTR szProduct, MSIINSTALLCONTEXT *context) DECLSPEC_HIDDEN; 00910 extern LPWSTR msi_reg_get_val_str( HKEY hkey, LPCWSTR name ) DECLSPEC_HIDDEN; 00911 extern BOOL msi_reg_get_val_dword( HKEY hkey, LPCWSTR name, DWORD *val) DECLSPEC_HIDDEN; 00912 00913 extern DWORD msi_version_str_to_dword(LPCWSTR p) DECLSPEC_HIDDEN; 00914 extern void msi_parse_version_string(LPCWSTR, PDWORD, PDWORD) DECLSPEC_HIDDEN; 00915 extern VS_FIXEDFILEINFO *msi_get_disk_file_version(LPCWSTR) DECLSPEC_HIDDEN; 00916 extern int msi_compare_file_versions(VS_FIXEDFILEINFO *, const WCHAR *) DECLSPEC_HIDDEN; 00917 extern int msi_compare_font_versions(const WCHAR *, const WCHAR *) DECLSPEC_HIDDEN; 00918 extern DWORD msi_get_disk_file_size(LPCWSTR) DECLSPEC_HIDDEN; 00919 extern BOOL msi_file_hash_matches(MSIFILE *) DECLSPEC_HIDDEN; 00920 00921 extern LONG msi_reg_set_val_str( HKEY hkey, LPCWSTR name, LPCWSTR value ) DECLSPEC_HIDDEN; 00922 extern LONG msi_reg_set_val_multi_str( HKEY hkey, LPCWSTR name, LPCWSTR value ) DECLSPEC_HIDDEN; 00923 extern LONG msi_reg_set_val_dword( HKEY hkey, LPCWSTR name, DWORD val ) DECLSPEC_HIDDEN; 00924 extern LONG msi_reg_set_subkey_val( HKEY hkey, LPCWSTR path, LPCWSTR name, LPCWSTR val ) DECLSPEC_HIDDEN; 00925 00926 /* msi dialog interface */ 00927 typedef UINT (*msi_dialog_event_handler)( MSIPACKAGE*, LPCWSTR, LPCWSTR, msi_dialog* ); 00928 extern msi_dialog *msi_dialog_create( MSIPACKAGE*, LPCWSTR, msi_dialog*, msi_dialog_event_handler ) DECLSPEC_HIDDEN; 00929 extern UINT msi_dialog_run_message_loop( msi_dialog* ) DECLSPEC_HIDDEN; 00930 extern void msi_dialog_end_dialog( msi_dialog* ) DECLSPEC_HIDDEN; 00931 extern void msi_dialog_check_messages( HANDLE ) DECLSPEC_HIDDEN; 00932 extern void msi_dialog_destroy( msi_dialog* ) DECLSPEC_HIDDEN; 00933 extern void msi_dialog_unregister_class( void ) DECLSPEC_HIDDEN; 00934 extern void msi_dialog_handle_event( msi_dialog*, LPCWSTR, LPCWSTR, MSIRECORD * ) DECLSPEC_HIDDEN; 00935 extern UINT msi_dialog_reset( msi_dialog *dialog ) DECLSPEC_HIDDEN; 00936 extern UINT msi_dialog_directorylist_up( msi_dialog *dialog ) DECLSPEC_HIDDEN; 00937 extern msi_dialog *msi_dialog_get_parent( msi_dialog *dialog ) DECLSPEC_HIDDEN; 00938 extern LPWSTR msi_dialog_get_name( msi_dialog *dialog ) DECLSPEC_HIDDEN; 00939 extern UINT msi_spawn_error_dialog( MSIPACKAGE*, LPWSTR, LPWSTR ) DECLSPEC_HIDDEN; 00940 00941 /* summary information */ 00942 extern MSISUMMARYINFO *MSI_GetSummaryInformationW( IStorage *stg, UINT uiUpdateCount ) DECLSPEC_HIDDEN; 00943 extern LPWSTR msi_suminfo_dup_string( MSISUMMARYINFO *si, UINT uiProperty ) DECLSPEC_HIDDEN; 00944 extern INT msi_suminfo_get_int32( MSISUMMARYINFO *si, UINT uiProperty ) DECLSPEC_HIDDEN; 00945 extern LPWSTR msi_get_suminfo_product( IStorage *stg ) DECLSPEC_HIDDEN; 00946 extern UINT msi_add_suminfo( MSIDATABASE *db, LPWSTR **records, int num_records, int num_columns ) DECLSPEC_HIDDEN; 00947 00948 /* undocumented functions */ 00949 UINT WINAPI MsiCreateAndVerifyInstallerDirectory( DWORD ); 00950 UINT WINAPI MsiDecomposeDescriptorW( LPCWSTR, LPWSTR, LPWSTR, LPWSTR, LPDWORD ); 00951 UINT WINAPI MsiDecomposeDescriptorA( LPCSTR, LPSTR, LPSTR, LPSTR, LPDWORD ); 00952 LANGID WINAPI MsiLoadStringW( MSIHANDLE, UINT, LPWSTR, int, LANGID ); 00953 LANGID WINAPI MsiLoadStringA( MSIHANDLE, UINT, LPSTR, int, LANGID ); 00954 00955 /* UI globals */ 00956 extern INSTALLUILEVEL gUILevel DECLSPEC_HIDDEN; 00957 extern HWND gUIhwnd DECLSPEC_HIDDEN; 00958 extern INSTALLUI_HANDLERA gUIHandlerA DECLSPEC_HIDDEN; 00959 extern INSTALLUI_HANDLERW gUIHandlerW DECLSPEC_HIDDEN; 00960 extern INSTALLUI_HANDLER_RECORD gUIHandlerRecord DECLSPEC_HIDDEN; 00961 extern DWORD gUIFilter DECLSPEC_HIDDEN; 00962 extern LPVOID gUIContext DECLSPEC_HIDDEN; 00963 extern WCHAR *gszLogFile DECLSPEC_HIDDEN; 00964 extern HINSTANCE msi_hInstance DECLSPEC_HIDDEN; 00965 00966 /* action related functions */ 00967 extern UINT ACTION_PerformAction(MSIPACKAGE *package, const WCHAR *action, UINT script) DECLSPEC_HIDDEN; 00968 extern UINT ACTION_PerformUIAction(MSIPACKAGE *package, const WCHAR *action, UINT script) DECLSPEC_HIDDEN; 00969 extern void ACTION_FinishCustomActions( const MSIPACKAGE* package) DECLSPEC_HIDDEN; 00970 extern UINT ACTION_CustomAction(MSIPACKAGE *package,const WCHAR *action, UINT script, BOOL execute) DECLSPEC_HIDDEN; 00971 00972 /* actions in other modules */ 00973 extern UINT ACTION_AppSearch(MSIPACKAGE *package) DECLSPEC_HIDDEN; 00974 extern UINT ACTION_CCPSearch(MSIPACKAGE *package) DECLSPEC_HIDDEN; 00975 extern UINT ACTION_FindRelatedProducts(MSIPACKAGE *package) DECLSPEC_HIDDEN; 00976 extern UINT ACTION_InstallFiles(MSIPACKAGE *package) DECLSPEC_HIDDEN; 00977 extern UINT ACTION_PatchFiles( MSIPACKAGE *package ) DECLSPEC_HIDDEN; 00978 extern UINT ACTION_RemoveFiles(MSIPACKAGE *package) DECLSPEC_HIDDEN; 00979 extern UINT ACTION_MoveFiles(MSIPACKAGE *package) DECLSPEC_HIDDEN; 00980 extern UINT ACTION_DuplicateFiles(MSIPACKAGE *package) DECLSPEC_HIDDEN; 00981 extern UINT ACTION_RemoveDuplicateFiles(MSIPACKAGE *package) DECLSPEC_HIDDEN; 00982 extern UINT ACTION_RegisterClassInfo(MSIPACKAGE *package) DECLSPEC_HIDDEN; 00983 extern UINT ACTION_RegisterProgIdInfo(MSIPACKAGE *package) DECLSPEC_HIDDEN; 00984 extern UINT ACTION_RegisterExtensionInfo(MSIPACKAGE *package) DECLSPEC_HIDDEN; 00985 extern UINT ACTION_RegisterMIMEInfo(MSIPACKAGE *package) DECLSPEC_HIDDEN; 00986 extern UINT ACTION_RegisterFonts(MSIPACKAGE *package) DECLSPEC_HIDDEN; 00987 extern UINT ACTION_UnregisterClassInfo(MSIPACKAGE *package) DECLSPEC_HIDDEN; 00988 extern UINT ACTION_UnregisterExtensionInfo(MSIPACKAGE *package) DECLSPEC_HIDDEN; 00989 extern UINT ACTION_UnregisterFonts(MSIPACKAGE *package) DECLSPEC_HIDDEN; 00990 extern UINT ACTION_UnregisterMIMEInfo(MSIPACKAGE *package) DECLSPEC_HIDDEN; 00991 extern UINT ACTION_UnregisterProgIdInfo(MSIPACKAGE *package) DECLSPEC_HIDDEN; 00992 extern UINT ACTION_MsiPublishAssemblies(MSIPACKAGE *package) DECLSPEC_HIDDEN; 00993 extern UINT ACTION_MsiUnpublishAssemblies(MSIPACKAGE *package) DECLSPEC_HIDDEN; 00994 00995 /* Helpers */ 00996 extern DWORD deformat_string(MSIPACKAGE *package, LPCWSTR ptr, WCHAR** data ) DECLSPEC_HIDDEN; 00997 extern WCHAR *msi_dup_record_field(MSIRECORD *row, INT index) DECLSPEC_HIDDEN; 00998 extern LPWSTR msi_dup_property( MSIDATABASE *db, LPCWSTR prop ) DECLSPEC_HIDDEN; 00999 extern UINT msi_set_property( MSIDATABASE *, LPCWSTR, LPCWSTR ) DECLSPEC_HIDDEN; 01000 extern UINT msi_get_property( MSIDATABASE *, LPCWSTR, LPWSTR, LPDWORD ) DECLSPEC_HIDDEN; 01001 extern int msi_get_property_int( MSIDATABASE *package, LPCWSTR prop, int def ) DECLSPEC_HIDDEN; 01002 extern WCHAR *msi_resolve_source_folder(MSIPACKAGE *package, const WCHAR *name, MSIFOLDER **folder) DECLSPEC_HIDDEN; 01003 extern void msi_resolve_target_folder(MSIPACKAGE *package, const WCHAR *name, BOOL load_prop) DECLSPEC_HIDDEN; 01004 extern WCHAR *msi_normalize_path(const WCHAR *) DECLSPEC_HIDDEN; 01005 extern WCHAR *msi_resolve_file_source(MSIPACKAGE *package, MSIFILE *file) DECLSPEC_HIDDEN; 01006 extern const WCHAR *msi_get_target_folder(MSIPACKAGE *package, const WCHAR *name) DECLSPEC_HIDDEN; 01007 extern void msi_reset_folders( MSIPACKAGE *package, BOOL source ) DECLSPEC_HIDDEN; 01008 extern MSICOMPONENT *msi_get_loaded_component(MSIPACKAGE *package, const WCHAR *Component) DECLSPEC_HIDDEN; 01009 extern MSIFEATURE *msi_get_loaded_feature(MSIPACKAGE *package, const WCHAR *Feature) DECLSPEC_HIDDEN; 01010 extern MSIFILE *msi_get_loaded_file(MSIPACKAGE *package, const WCHAR *file) DECLSPEC_HIDDEN; 01011 extern MSIFILEPATCH *msi_get_loaded_filepatch(MSIPACKAGE* package, const WCHAR *key) DECLSPEC_HIDDEN; 01012 extern MSIFOLDER *msi_get_loaded_folder(MSIPACKAGE *package, const WCHAR *dir) DECLSPEC_HIDDEN; 01013 extern int msi_track_tempfile(MSIPACKAGE *package, const WCHAR *path) DECLSPEC_HIDDEN; 01014 extern void msi_free_action_script(MSIPACKAGE *package, UINT script) DECLSPEC_HIDDEN; 01015 extern WCHAR *msi_build_icon_path(MSIPACKAGE *, const WCHAR *) DECLSPEC_HIDDEN; 01016 extern WCHAR *msi_build_directory_name(DWORD , ...) DECLSPEC_HIDDEN; 01017 extern BOOL msi_create_full_path(const WCHAR *path) DECLSPEC_HIDDEN; 01018 extern void msi_reduce_to_long_filename(WCHAR *) DECLSPEC_HIDDEN; 01019 extern WCHAR *msi_create_component_advertise_string(MSIPACKAGE *, MSICOMPONENT *, const WCHAR *) DECLSPEC_HIDDEN; 01020 extern void ACTION_UpdateComponentStates(MSIPACKAGE *package, MSIFEATURE *feature) DECLSPEC_HIDDEN; 01021 extern UINT msi_register_unique_action(MSIPACKAGE *, const WCHAR *) DECLSPEC_HIDDEN; 01022 extern BOOL msi_action_is_unique(const MSIPACKAGE *, const WCHAR *) DECLSPEC_HIDDEN; 01023 extern WCHAR *msi_build_error_string(MSIPACKAGE *, UINT, DWORD, ...) DECLSPEC_HIDDEN; 01024 extern UINT msi_set_last_used_source(LPCWSTR product, LPCWSTR usersid, 01025 MSIINSTALLCONTEXT context, DWORD options, LPCWSTR value) DECLSPEC_HIDDEN; 01026 extern UINT msi_create_empty_local_file(LPWSTR path, LPCWSTR suffix) DECLSPEC_HIDDEN; 01027 extern UINT msi_set_sourcedir_props(MSIPACKAGE *package, BOOL replace) DECLSPEC_HIDDEN; 01028 extern MSIASSEMBLY *msi_load_assembly(MSIPACKAGE *, MSICOMPONENT *) DECLSPEC_HIDDEN; 01029 extern UINT msi_install_assembly(MSIPACKAGE *, MSICOMPONENT *) DECLSPEC_HIDDEN; 01030 extern UINT msi_uninstall_assembly(MSIPACKAGE *, MSICOMPONENT *) DECLSPEC_HIDDEN; 01031 extern BOOL msi_init_assembly_caches(MSIPACKAGE *) DECLSPEC_HIDDEN; 01032 extern void msi_destroy_assembly_caches(MSIPACKAGE *) DECLSPEC_HIDDEN; 01033 extern WCHAR *msi_font_version_from_file(const WCHAR *) DECLSPEC_HIDDEN; 01034 extern WCHAR **msi_split_string(const WCHAR *, WCHAR) DECLSPEC_HIDDEN; 01035 01036 /* media */ 01037 01038 typedef BOOL (*PMSICABEXTRACTCB)(MSIPACKAGE *, LPCWSTR, DWORD, LPWSTR *, DWORD *, PVOID); 01039 01040 #define MSICABEXTRACT_BEGINEXTRACT 0x01 01041 #define MSICABEXTRACT_FILEEXTRACTED 0x02 01042 01043 typedef struct 01044 { 01045 MSIPACKAGE* package; 01046 MSIMEDIAINFO *mi; 01047 PMSICABEXTRACTCB cb; 01048 LPWSTR curfile; 01049 PVOID user; 01050 } MSICABDATA; 01051 01052 extern UINT ready_media(MSIPACKAGE *package, BOOL compressed, MSIMEDIAINFO *mi) DECLSPEC_HIDDEN; 01053 extern UINT msi_load_media_info(MSIPACKAGE *package, UINT Sequence, MSIMEDIAINFO *mi) DECLSPEC_HIDDEN; 01054 extern void msi_free_media_info(MSIMEDIAINFO *mi) DECLSPEC_HIDDEN; 01055 extern BOOL msi_cabextract(MSIPACKAGE* package, MSIMEDIAINFO *mi, LPVOID data) DECLSPEC_HIDDEN; 01056 extern UINT msi_add_cabinet_stream(MSIPACKAGE *, UINT, IStorage *, const WCHAR *) DECLSPEC_HIDDEN; 01057 01058 /* control event stuff */ 01059 extern VOID ControlEvent_FireSubscribedEvent(MSIPACKAGE *package, LPCWSTR event, 01060 MSIRECORD *data) DECLSPEC_HIDDEN; 01061 extern VOID ControlEvent_CleanupDialogSubscriptions(MSIPACKAGE *package, LPWSTR dialog) DECLSPEC_HIDDEN; 01062 extern VOID ControlEvent_CleanupSubscriptions(MSIPACKAGE *package) DECLSPEC_HIDDEN; 01063 extern VOID ControlEvent_SubscribeToEvent(MSIPACKAGE *package, msi_dialog *dialog, 01064 LPCWSTR event, LPCWSTR control, LPCWSTR attribute) DECLSPEC_HIDDEN; 01065 01066 /* OLE automation */ 01067 extern HRESULT create_msiserver(IUnknown *pOuter, LPVOID *ppObj) DECLSPEC_HIDDEN; 01068 extern HRESULT create_session(MSIHANDLE msiHandle, IDispatch *pInstaller, IDispatch **pDispatch) DECLSPEC_HIDDEN; 01069 extern HRESULT load_type_info(IDispatch *iface, ITypeInfo **pptinfo, REFIID clsid, LCID lcid) DECLSPEC_HIDDEN; 01070 01071 /* Scripting */ 01072 extern DWORD call_script(MSIHANDLE hPackage, INT type, LPCWSTR script, LPCWSTR function, LPCWSTR action) DECLSPEC_HIDDEN; 01073 01074 /* User interface messages from the actions */ 01075 extern void msi_ui_progress(MSIPACKAGE *, int, int, int, int) DECLSPEC_HIDDEN; 01076 extern void msi_ui_actiondata(MSIPACKAGE *, const WCHAR *, MSIRECORD *) DECLSPEC_HIDDEN; 01077 01078 /* common strings */ 01079 static const WCHAR szSourceDir[] = {'S','o','u','r','c','e','D','i','r',0}; 01080 static const WCHAR szSOURCEDIR[] = {'S','O','U','R','C','E','D','I','R',0}; 01081 static const WCHAR szRootDrive[] = {'R','O','O','T','D','R','I','V','E',0}; 01082 static const WCHAR szTargetDir[] = {'T','A','R','G','E','T','D','I','R',0}; 01083 static const WCHAR szLocalSid[] = {'S','-','1','-','5','-','1','8',0}; 01084 static const WCHAR szAllSid[] = {'S','-','1','-','1','-','0',0}; 01085 static const WCHAR szEmpty[] = {0}; 01086 static const WCHAR szAll[] = {'A','L','L',0}; 01087 static const WCHAR szOne[] = {'1',0}; 01088 static const WCHAR szZero[] = {'0',0}; 01089 static const WCHAR szSpace[] = {' ',0}; 01090 static const WCHAR szBackSlash[] = {'\\',0}; 01091 static const WCHAR szForwardSlash[] = {'/',0}; 01092 static const WCHAR szDot[] = {'.',0}; 01093 static const WCHAR szDotDot[] = {'.','.',0}; 01094 static const WCHAR szSemiColon[] = {';',0}; 01095 static const WCHAR szPreselected[] = {'P','r','e','s','e','l','e','c','t','e','d',0}; 01096 static const WCHAR szPatches[] = {'P','a','t','c','h','e','s',0}; 01097 static const WCHAR szState[] = {'S','t','a','t','e',0}; 01098 static const WCHAR szMsi[] = {'m','s','i',0}; 01099 static const WCHAR szPatch[] = {'P','A','T','C','H',0}; 01100 static const WCHAR szSourceList[] = {'S','o','u','r','c','e','L','i','s','t',0}; 01101 static const WCHAR szInstalled[] = {'I','n','s','t','a','l','l','e','d',0}; 01102 static const WCHAR szReinstall[] = {'R','E','I','N','S','T','A','L','L',0}; 01103 static const WCHAR szReinstallMode[] = {'R','E','I','N','S','T','A','L','L','M','O','D','E',0}; 01104 static const WCHAR szRemove[] = {'R','E','M','O','V','E',0}; 01105 static const WCHAR szUserSID[] = {'U','s','e','r','S','I','D',0}; 01106 static const WCHAR szProductCode[] = {'P','r','o','d','u','c','t','C','o','d','e',0}; 01107 static const WCHAR szRegisterClassInfo[] = {'R','e','g','i','s','t','e','r','C','l','a','s','s','I','n','f','o',0}; 01108 static const WCHAR szRegisterProgIdInfo[] = {'R','e','g','i','s','t','e','r','P','r','o','g','I','d','I','n','f','o',0}; 01109 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}; 01110 static const WCHAR szRegisterMIMEInfo[] = {'R','e','g','i','s','t','e','r','M','I','M','E','I','n','f','o',0}; 01111 static const WCHAR szDuplicateFiles[] = {'D','u','p','l','i','c','a','t','e','F','i','l','e','s',0}; 01112 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}; 01113 static const WCHAR szInstallFiles[] = {'I','n','s','t','a','l','l','F','i','l','e','s',0}; 01114 static const WCHAR szPatchFiles[] = {'P','a','t','c','h','F','i','l','e','s',0}; 01115 static const WCHAR szRemoveFiles[] = {'R','e','m','o','v','e','F','i','l','e','s',0}; 01116 static const WCHAR szFindRelatedProducts[] = {'F','i','n','d','R','e','l','a','t','e','d','P','r','o','d','u','c','t','s',0}; 01117 static const WCHAR szAllUsers[] = {'A','L','L','U','S','E','R','S',0}; 01118 static const WCHAR szCustomActionData[] = {'C','u','s','t','o','m','A','c','t','i','o','n','D','a','t','a',0}; 01119 static const WCHAR szUILevel[] = {'U','I','L','e','v','e','l',0}; 01120 static const WCHAR szProductID[] = {'P','r','o','d','u','c','t','I','D',0}; 01121 static const WCHAR szPIDTemplate[] = {'P','I','D','T','e','m','p','l','a','t','e',0}; 01122 static const WCHAR szPIDKEY[] = {'P','I','D','K','E','Y',0}; 01123 static const WCHAR szTYPELIB[] = {'T','Y','P','E','L','I','B',0}; 01124 static const WCHAR szSumInfo[] = {5 ,'S','u','m','m','a','r','y','I','n','f','o','r','m','a','t','i','o','n',0}; 01125 static const WCHAR szHCR[] = {'H','K','E','Y','_','C','L','A','S','S','E','S','_','R','O','O','T','\\',0}; 01126 static const WCHAR szHCU[] = {'H','K','E','Y','_','C','U','R','R','E','N','T','_','U','S','E','R','\\',0}; 01127 static const WCHAR szHLM[] = {'H','K','E','Y','_','L','O','C','A','L','_','M','A','C','H','I','N','E','\\',0}; 01128 static const WCHAR szHU[] = {'H','K','E','Y','_','U','S','E','R','S','\\',0}; 01129 static const WCHAR szWindowsFolder[] = {'W','i','n','d','o','w','s','F','o','l','d','e','r',0}; 01130 static const WCHAR szAppSearch[] = {'A','p','p','S','e','a','r','c','h',0}; 01131 static const WCHAR szMoveFiles[] = {'M','o','v','e','F','i','l','e','s',0}; 01132 static const WCHAR szCCPSearch[] = {'C','C','P','S','e','a','r','c','h',0}; 01133 static const WCHAR szUnregisterClassInfo[] = {'U','n','r','e','g','i','s','t','e','r','C','l','a','s','s','I','n','f','o',0}; 01134 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}; 01135 static const WCHAR szUnregisterMIMEInfo[] = {'U','n','r','e','g','i','s','t','e','r','M','I','M','E','I','n','f','o',0}; 01136 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}; 01137 static const WCHAR szRegisterFonts[] = {'R','e','g','i','s','t','e','r','F','o','n','t','s',0}; 01138 static const WCHAR szUnregisterFonts[] = {'U','n','r','e','g','i','s','t','e','r','F','o','n','t','s',0}; 01139 static const WCHAR szCLSID[] = {'C','L','S','I','D',0}; 01140 static const WCHAR szProgID[] = {'P','r','o','g','I','D',0}; 01141 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}; 01142 static const WCHAR szAppID[] = {'A','p','p','I','D',0}; 01143 static const WCHAR szDefaultIcon[] = {'D','e','f','a','u','l','t','I','c','o','n',0}; 01144 static const WCHAR szInprocHandler[] = {'I','n','p','r','o','c','H','a','n','d','l','e','r',0}; 01145 static const WCHAR szInprocHandler32[] = {'I','n','p','r','o','c','H','a','n','d','l','e','r','3','2',0}; 01146 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}; 01147 static const WCHAR szLocalPackage[] = {'L','o','c','a','l','P','a','c','k','a','g','e',0}; 01148 static const WCHAR szOriginalDatabase[] = {'O','r','i','g','i','n','a','l','D','a','t','a','b','a','s','e',0}; 01149 static const WCHAR szUpgradeCode[] = {'U','p','g','r','a','d','e','C','o','d','e',0}; 01150 static const WCHAR szAdminUser[] = {'A','d','m','i','n','U','s','e','r',0}; 01151 static const WCHAR szIntel[] = {'I','n','t','e','l',0}; 01152 static const WCHAR szIntel64[] = {'I','n','t','e','l','6','4',0}; 01153 static const WCHAR szX64[] = {'x','6','4',0}; 01154 static const WCHAR szAMD64[] = {'A','M','D','6','4',0}; 01155 static const WCHAR szARM[] = {'A','r','m',0}; 01156 static const WCHAR szWow6432NodeCLSID[] = {'W','o','w','6','4','3','2','N','o','d','e','\\','C','L','S','I','D',0}; 01157 static const WCHAR szWow6432Node[] = {'W','o','w','6','4','3','2','N','o','d','e',0}; 01158 static const WCHAR szStreams[] = {'_','S','t','r','e','a','m','s',0}; 01159 static const WCHAR szStorages[] = {'_','S','t','o','r','a','g','e','s',0}; 01160 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}; 01161 static const WCHAR szCostingComplete[] = {'C','o','s','t','i','n','g','C','o','m','p','l','e','t','e',0}; 01162 static const WCHAR szTempFolder[] = {'T','e','m','p','F','o','l','d','e','r',0}; 01163 static const WCHAR szDatabase[] = {'D','A','T','A','B','A','S','E',0}; 01164 static const WCHAR szCRoot[] = {'C',':','\\',0}; 01165 static const WCHAR szProductLanguage[] = {'P','r','o','d','u','c','t','L','a','n','g','u','a','g','e',0}; 01166 static const WCHAR szProductVersion[] = {'P','r','o','d','u','c','t','V','e','r','s','i','o','n',0}; 01167 static const WCHAR szWindowsInstaller[] = {'W','i','n','d','o','w','s','I','n','s','t','a','l','l','e','r',0}; 01168 static const WCHAR szStringData[] = {'_','S','t','r','i','n','g','D','a','t','a',0}; 01169 static const WCHAR szStringPool[] = {'_','S','t','r','i','n','g','P','o','o','l',0}; 01170 static const WCHAR szInstallLevel[] = {'I','N','S','T','A','L','L','L','E','V','E','L',0}; 01171 static const WCHAR szCostInitialize[] = {'C','o','s','t','I','n','i','t','i','a','l','i','z','e',0}; 01172 static const WCHAR szAppDataFolder[] = {'A','p','p','D','a','t','a','F','o','l','d','e','r',0}; 01173 static const WCHAR szRollbackDisabled[] = {'R','o','l','l','b','a','c','k','D','i','s','a','b','l','e','d',0}; 01174 static const WCHAR szName[] = {'N','a','m','e',0}; 01175 static const WCHAR szData[] = {'D','a','t','a',0}; 01176 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}; 01177 01178 /* memory allocation macro functions */ 01179 static void *msi_alloc( size_t len ) __WINE_ALLOC_SIZE(1); 01180 static inline void *msi_alloc( size_t len ) 01181 { 01182 return HeapAlloc( GetProcessHeap(), 0, len ); 01183 } 01184 01185 static void *msi_alloc_zero( size_t len ) __WINE_ALLOC_SIZE(1); 01186 static inline void *msi_alloc_zero( size_t len ) 01187 { 01188 return HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, len ); 01189 } 01190 01191 static void *msi_realloc( void *mem, size_t len ) __WINE_ALLOC_SIZE(2); 01192 static inline void *msi_realloc( void *mem, size_t len ) 01193 { 01194 return HeapReAlloc( GetProcessHeap(), 0, mem, len ); 01195 } 01196 01197 static void *msi_realloc_zero( void *mem, size_t len ) __WINE_ALLOC_SIZE(2); 01198 static inline void *msi_realloc_zero( void *mem, size_t len ) 01199 { 01200 return HeapReAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, mem, len ); 01201 } 01202 01203 static inline BOOL msi_free( void *mem ) 01204 { 01205 return HeapFree( GetProcessHeap(), 0, mem ); 01206 } 01207 01208 static inline char *strdupWtoA( LPCWSTR str ) 01209 { 01210 LPSTR ret = NULL; 01211 DWORD len; 01212 01213 if (!str) return ret; 01214 len = WideCharToMultiByte( CP_ACP, 0, str, -1, NULL, 0, NULL, NULL); 01215 ret = msi_alloc( len ); 01216 if (ret) 01217 WideCharToMultiByte( CP_ACP, 0, str, -1, ret, len, NULL, NULL ); 01218 return ret; 01219 } 01220 01221 static inline LPWSTR strdupAtoW( LPCSTR str ) 01222 { 01223 LPWSTR ret = NULL; 01224 DWORD len; 01225 01226 if (!str) return ret; 01227 len = MultiByteToWideChar( CP_ACP, 0, str, -1, NULL, 0 ); 01228 ret = msi_alloc( len * sizeof(WCHAR) ); 01229 if (ret) 01230 MultiByteToWideChar( CP_ACP, 0, str, -1, ret, len ); 01231 return ret; 01232 } 01233 01234 static inline LPWSTR strdupW( LPCWSTR src ) 01235 { 01236 LPWSTR dest; 01237 if (!src) return NULL; 01238 dest = msi_alloc( (lstrlenW(src)+1)*sizeof(WCHAR) ); 01239 if (dest) 01240 lstrcpyW(dest, src); 01241 return dest; 01242 } 01243 01244 #endif /* __WINE_MSI_PRIVATE__ */ Generated on Sun May 27 2012 04:25:18 for ReactOS by
1.7.6.1
|