ReactOS 0.4.17-dev-966-gf06eace
msipriv.h File Reference
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "fdi.h"
#include "msi.h"
#include "msiquery.h"
#include "msidefs.h"
#include "objbase.h"
#include "objidl.h"
#include "fusion.h"
#include "winnls.h"
#include "winver.h"
#include "wine/list.h"
#include "wine/debug.h"
#include "msiserver.h"
#include "winemsi.h"
Include dependency graph for msipriv.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  tagMSIOBJECTHDR
 
struct  tagMSISTREAM
 
struct  tagMSITRANSFORM
 
struct  tagMSIDATABASE
 
struct  tagMSIQUERY
 
struct  tagMSIFIELD
 
struct  tagMSIRECORD
 
struct  tagMSISOURCELISTINFO
 
struct  tagMSIMEDIADISK
 
struct  tagMSIMEDIAINFO
 
struct  tagMSICABINETSTREAM
 
struct  tagMSIPATCHINFO
 
struct  tagMSIBINARY
 
struct  _column_info
 
struct  tagMSIVIEWOPS
 
struct  tagMSIVIEW
 
struct  tagMSIPACKAGE
 
struct  tagMSIPREVIEW
 
struct  tagMSISUMMARYINFO
 
struct  tagMSIFEATURE
 
struct  tagMSIASSEMBLY
 
struct  tagMSICOMPONENT
 
struct  tagComponentList
 
struct  tagFeatureList
 
struct  tagMSIFOLDER
 
struct  tagFolderList
 
struct  tagMSIFILE
 
struct  tagMSIFILEPATCH
 
struct  tagMSIAPPID
 
struct  tagMSICLASS
 
struct  tagMSIEXTENSION
 
struct  tagMSIPROGID
 
struct  tagMSIVERB
 
struct  tagMSIMIME
 
struct  MSIDRLOCATOR
 
struct  awstring
 
struct  awcstring
 
struct  MSICABDATA
 

Macros

#define MSI_DATASIZEMASK   0x00ff
 
#define MSITYPE_VALID   0x0100
 
#define MSITYPE_LOCALIZABLE   0x200
 
#define MSITYPE_STRING   0x0800
 
#define MSITYPE_NULLABLE   0x1000
 
#define MSITYPE_KEY   0x2000
 
#define MSITYPE_TEMPORARY   0x4000
 
#define MSITYPE_UNKNOWN   0x8000
 
#define MAX_STREAM_NAME_LEN   62
 
#define LONG_STR_BYTES   3
 
#define INSTALLUILEVEL_MASK   0x0007
 
#define MSITYPE_IS_BINARY(type)   (((type) & ~MSITYPE_NULLABLE) == (MSITYPE_STRING|MSITYPE_VALID))
 
#define MSI_INITIAL_MEDIA_TRANSFORM_OFFSET   10000
 
#define MSI_INITIAL_MEDIA_TRANSFORM_DISKID   32000
 
#define MSI_OPEN_READONLY   0
 
#define MSI_OPEN_TRANSACT   1
 
#define MSI_OPEN_DIRECT   2
 
#define MSI_OPEN_CREATE   3
 
#define MSI_OPEN_CREATEDIRECT   4
 
#define MSI_OPEN_PATCHFILE   32
 
#define MSI_MAX_PROPS   20
 
#define SEQUENCE_UI   0x1
 
#define SEQUENCE_EXEC   0x2
 
#define MSIHANDLETYPE_ANY   0
 
#define MSIHANDLETYPE_DATABASE   1
 
#define MSIHANDLETYPE_SUMMARYINFO   2
 
#define MSIHANDLETYPE_VIEW   3
 
#define MSIHANDLETYPE_RECORD   4
 
#define MSIHANDLETYPE_PACKAGE   5
 
#define MSIHANDLETYPE_PREVIEW   6
 
#define MSI_MAJORVERSION   5
 
#define MSI_MINORVERSION   0
 
#define MSI_BUILDNUMBER   6001
 
#define GUID_SIZE   39
 
#define SQUASHED_GUID_SIZE   33
 
#define MSIHANDLE_MAGIC   0x4d434923
 
#define WINE_OPENPACKAGEFLAGS_RECACHE   0x80000000
 
#define MSICABEXTRACT_BEGINEXTRACT   0x01
 
#define MSICABEXTRACT_FILEEXTRACTED   0x02
 

Typedefs

typedef struct tagMSITABLE MSITABLE
 
typedef struct string_table string_table
 
typedef struct tagMSIOBJECTHDR MSIOBJECTHDR
 
typedef VOID(* msihandledestructor) (MSIOBJECTHDR *)
 
typedef struct tagMSISTREAM MSISTREAM
 
typedef struct tagMSITRANSFORM MSITRANSFORM
 
typedef struct tagMSIDATABASE MSIDATABASE
 
typedef struct tagMSIVIEW MSIVIEW
 
typedef struct tagMSIQUERY MSIQUERY
 
typedef struct tagMSIFIELD MSIFIELD
 
typedef struct tagMSIRECORD MSIRECORD
 
typedef struct tagMSISOURCELISTINFO MSISOURCELISTINFO
 
typedef struct tagMSIMEDIADISK MSIMEDIADISK
 
typedef struct tagMSIMEDIAINFO MSIMEDIAINFO
 
typedef struct tagMSICABINETSTREAM MSICABINETSTREAM
 
typedef struct tagMSIPATCHINFO MSIPATCHINFO
 
typedef struct tagMSIBINARY MSIBINARY
 
typedef struct _column_info column_info
 
typedef const struct tagMSICOLUMNHASHENTRY * MSIITERHANDLE
 
typedef struct tagMSIVIEWOPS MSIVIEWOPS
 
typedef struct msi_dialog_tag msi_dialog
 
typedef struct tagMSIPACKAGE MSIPACKAGE
 
typedef struct tagMSIPREVIEW MSIPREVIEW
 
typedef struct tagMSISUMMARYINFO MSISUMMARYINFO
 
typedef struct tagMSIFEATURE MSIFEATURE
 
typedef struct tagMSIASSEMBLY MSIASSEMBLY
 
typedef struct tagMSICOMPONENT MSICOMPONENT
 
typedef struct tagComponentList ComponentList
 
typedef struct tagFeatureList FeatureList
 
typedef struct tagMSIFOLDER MSIFOLDER
 
typedef struct tagFolderList FolderList
 
typedef enum _msi_file_state msi_file_state
 
typedef struct tagMSIFILE MSIFILE
 
typedef struct tagMSIFILEPATCH MSIFILEPATCH
 
typedef struct tagMSIAPPID MSIAPPID
 
typedef struct tagMSIPROGID MSIPROGID
 
typedef struct tagMSICLASS MSICLASS
 
typedef struct tagMSIMIME MSIMIME
 
typedef struct tagMSIEXTENSION MSIEXTENSION
 
typedef struct tagMSIVERB MSIVERB
 
typedef UINT(* record_func) (MSIRECORD *, LPVOID)
 
typedef BOOL(* PMSICABEXTRACTCB) (MSIPACKAGE *, LPCWSTR, DWORD, LPWSTR *, DWORD *, PVOID)
 
typedef enum tid_t tid_t
 

Enumerations

enum  platform {
  PLATFORM_UNRECOGNIZED , PLATFORM_INTEL , PLATFORM_INTEL64 , PLATFORM_X64 ,
  PLATFORM_ARM , PLATFORM_ARM64
}
 
enum  clr_version {
  CLR_VERSION_V10 , CLR_VERSION_V11 , CLR_VERSION_V20 , CLR_VERSION_V40 ,
  CLR_VERSION_MAX
}
 
enum  script {
  SCRIPT_NONE = -1 , SCRIPT_INSTALL = 0 , SCRIPT_COMMIT = 1 , SCRIPT_ROLLBACK = 2 ,
  SCRIPT_MAX = 3
}
 
enum  folder_state {
  FOLDER_STATE_UNINITIALIZED , FOLDER_STATE_EXISTS , FOLDER_STATE_CREATED , FOLDER_STATE_CREATED_PERSISTENT ,
  FOLDER_STATE_REMOVED
}
 
enum  _msi_file_state {
  msifs_invalid , msifs_missing , msifs_overwrite , msifs_present ,
  msifs_installed , msifs_skipped , msifs_hashmatch
}
 
enum  tid_t {
  LAST_tid , LAST_tid , Database_tid , Installer_tid ,
  Record_tid , Session_tid , StringList_tid , SummaryInfo_tid ,
  View_tid , LAST_tid , NULL_tid , IXMLDOMAttribute_tid ,
  IXMLDOMCDATASection_tid , IXMLDOMComment_tid , IXMLDOMDocument_tid , IXMLDOMDocument2_tid ,
  IXMLDOMDocument3_tid , IXMLDOMDocumentFragment_tid , IXMLDOMDocumentType_tid , IXMLDOMElement_tid ,
  IXMLDOMEntityReference_tid , IXMLDOMImplementation_tid , IXMLDOMNamedNodeMap_tid , IXMLDOMNode_tid ,
  IXMLDOMNodeList_tid , IXMLDOMParseError2_tid , IXMLDOMProcessingInstruction_tid , IXMLDOMSchemaCollection_tid ,
  IXMLDOMSchemaCollection2_tid , IXMLDOMSelection_tid , IXMLDOMText_tid , IXMLElement_tid ,
  IXMLDocument_tid , IXMLHTTPRequest_tid , IXSLProcessor_tid , IXSLTemplate_tid ,
  IVBSAXAttributes_tid , IVBSAXContentHandler_tid , IVBSAXDeclHandler_tid , IVBSAXDTDHandler_tid ,
  IVBSAXEntityResolver_tid , IVBSAXErrorHandler_tid , IVBSAXLexicalHandler_tid , IVBSAXLocator_tid ,
  IVBSAXXMLFilter_tid , IVBSAXXMLReader_tid , IMXAttributes_tid , IMXReaderControl_tid ,
  IMXWriter_tid , IVBMXNamespaceManager_tid , IServerXMLHTTPRequest_tid , LAST_tid ,
  NULL_tid , ITextDocument_tid , ITextRange_tid , ITextSelection_tid ,
  ITextFont_tid , ITextPara_tid , LAST_tid , NULL_tid ,
  IDictionary_tid , IDrive_tid , IDriveCollection_tid , IFile_tid ,
  IFileCollection_tid , IFileSystem3_tid , IFolder_tid , IFolderCollection_tid ,
  ITextStream_tid , LAST_tid , NULL_tid , IWshCollection_tid ,
  IWshEnvironment_tid , IWshExec_tid , IWshShell3_tid , IWshShortcut_tid ,
  IWshNetwork2_tid , LAST_tid
}
 

Functions

static BOOL is_platform_64bit (enum platform platform)
 
UINT msi_strcpy_to_awstring (const WCHAR *, int, awstring *, DWORD *)
 
MSIHANDLE msi_get_remote (MSIHANDLE handle)
 
LONG WINAPI rpc_filter (EXCEPTION_POINTERS *eptr)
 
void * msihandle2msiinfo (MSIHANDLE handle, UINT type)
 
MSIHANDLE alloc_msihandle (MSIOBJECTHDR *)
 
MSIHANDLE alloc_msi_remote_handle (MSIHANDLE remote)
 
void * alloc_msiobject (UINT type, UINT size, msihandledestructor destroy)
 
void msiobj_addref (MSIOBJECTHDR *)
 
int msiobj_release (MSIOBJECTHDR *)
 
void msiobj_lock (MSIOBJECTHDR *)
 
void msiobj_unlock (MSIOBJECTHDR *)
 
void msi_free_handle_table (void)
 
void free_cached_tables (MSIDATABASE *db)
 
UINT MSI_CommitTables (MSIDATABASE *db)
 
UINT msi_commit_streams (MSIDATABASE *db)
 
int msi_add_string (string_table *st, const WCHAR *data, int len, BOOL persistent)
 
UINT msi_string2id (const string_table *st, const WCHAR *data, int len, UINT *id)
 
VOID msi_destroy_stringtable (string_table *st)
 
const WCHAR * msi_string_lookup (const string_table *st, UINT id, int *len)
 
HRESULT msi_init_string_table (IStorage *stg)
 
string_table * msi_load_string_table (IStorage *stg, UINT *bytes_per_strref)
 
UINT msi_save_string_table (const string_table *st, IStorage *storage, UINT *bytes_per_strref)
 
UINT msi_get_string_table_codepage (const string_table *st)
 
UINT msi_set_string_table_codepage (string_table *st, UINT codepage)
 
WCHAR * msi_strdupW (const WCHAR *value, int len) __WINE_DEALLOC(free) __WINE_MALLOC
 
BOOL TABLE_Exists (MSIDATABASE *db, LPCWSTR name)
 
MSICONDITION MSI_DatabaseIsTablePersistent (MSIDATABASE *db, LPCWSTR table)
 
UINT read_stream_data (IStorage *stg, LPCWSTR stname, BOOL table, BYTE **pdata, UINT *psz)
 
UINT write_stream_data (IStorage *stg, LPCWSTR stname, LPCVOID data, UINT sz, BOOL bTable)
 
UINT msi_table_apply_transform (MSIDATABASE *db, IStorage *stg, int err_cond)
 
UINT MSI_DatabaseApplyTransformW (MSIDATABASE *db, LPCWSTR szTransformFile, int iErrorCond)
 
void append_storage_to_db (MSIDATABASE *db, IStorage *stg)
 
UINT msi_apply_transforms (MSIPACKAGE *package)
 
UINT msi_check_patch_applicable (MSIPACKAGE *package, MSISUMMARYINFO *si)
 
UINT msi_apply_patches (MSIPACKAGE *package)
 
UINT msi_apply_registered_patch (MSIPACKAGE *package, LPCWSTR patch_code)
 
void msi_free_patchinfo (MSIPATCHINFO *patch)
 
UINT msi_patch_assembly (MSIPACKAGE *, MSIASSEMBLY *, MSIFILEPATCH *)
 
UINT MSI_InstallPackage (MSIPACKAGE *, LPCWSTR, LPCWSTR)
 
INT ACTION_ShowDialog (MSIPACKAGE *, LPCWSTR)
 
INT ACTION_DialogBox (MSIPACKAGE *, LPCWSTR)
 
UINT ACTION_ForceReboot (MSIPACKAGE *package)
 
UINT MSI_Sequence (MSIPACKAGE *package, LPCWSTR szTable)
 
UINT MSI_SetFeatureStates (MSIPACKAGE *package)
 
UINT msi_parse_command_line (MSIPACKAGE *package, LPCWSTR szCommandLine, BOOL preserve_case)
 
const WCHAR * msi_get_command_line_option (const WCHAR *cmd, const WCHAR *option, UINT *len)
 
UINT msi_schedule_action (MSIPACKAGE *package, UINT script, const WCHAR *action)
 
INSTALLSTATE msi_get_component_action (MSIPACKAGE *package, MSICOMPONENT *comp)
 
INSTALLSTATE msi_get_feature_action (MSIPACKAGE *package, MSIFEATURE *feature)
 
UINT msi_load_all_components (MSIPACKAGE *package)
 
UINT msi_load_all_features (MSIPACKAGE *package)
 
UINT msi_validate_product_id (MSIPACKAGE *package)
 
void MSI_CloseRecord (MSIOBJECTHDR *)
 
UINT MSI_RecordSetIStream (MSIRECORD *, UINT, IStream *)
 
UINT MSI_RecordGetIStream (MSIRECORD *, UINT, IStream **)
 
const WCHAR * MSI_RecordGetString (const MSIRECORD *, UINT)
 
MSIRECORD * MSI_CreateRecord (UINT)
 
UINT MSI_RecordSetInteger (MSIRECORD *, UINT, int)
 
UINT MSI_RecordSetStringW (MSIRECORD *, UINT, LPCWSTR)
 
BOOL MSI_RecordIsNull (MSIRECORD *, UINT)
 
UINT MSI_RecordGetStringW (MSIRECORD *, UINT, LPWSTR, LPDWORD)
 
UINT MSI_RecordGetStringA (MSIRECORD *, UINT, LPSTR, LPDWORD)
 
int MSI_RecordGetInteger (MSIRECORD *, UINT)
 
UINT MSI_RecordReadStream (MSIRECORD *, UINT, char *, LPDWORD)
 
UINT MSI_RecordSetStream (MSIRECORD *, UINT, IStream *)
 
UINT MSI_RecordGetFieldCount (const MSIRECORD *rec)
 
UINT MSI_RecordStreamToFile (MSIRECORD *, UINT, LPCWSTR)
 
UINT MSI_RecordSetStreamFromFileW (MSIRECORD *, UINT, LPCWSTR)
 
UINT MSI_RecordCopyField (MSIRECORD *, UINT, MSIRECORD *, UINT)
 
MSIRECORD * MSI_CloneRecord (MSIRECORD *)
 
BOOL MSI_RecordsAreEqual (MSIRECORD *, MSIRECORD *)
 
BOOL MSI_RecordsAreFieldsEqual (MSIRECORD *a, MSIRECORD *b, UINT field)
 
UINT msi_record_set_string (MSIRECORD *, UINT, const WCHAR *, int)
 
const WCHAR * msi_record_get_string (const MSIRECORD *, UINT, int *)
 
void dump_record (MSIRECORD *)
 
UINT unmarshal_record (const struct wire_record *in, MSIHANDLE *out)
 
struct wire_record * marshal_record (MSIHANDLE handle)
 
void free_remote_record (struct wire_record *rec)
 
UINT copy_remote_record (const struct wire_record *rec, MSIHANDLE handle)
 
void enum_stream_names (IStorage *stg)
 
WCHAR * encode_streamname (BOOL is_table, const WCHAR *in) __WINE_DEALLOC(free) __WINE_MALLOC
 
BOOL decode_streamname (LPCWSTR in, LPWSTR out)
 
UINT msi_get_stream (MSIDATABASE *, const WCHAR *, IStream **)
 
UINT MSI_OpenDatabaseW (LPCWSTR, LPCWSTR, MSIDATABASE **)
 
UINT MSI_DatabaseOpenViewW (MSIDATABASE *, LPCWSTR, MSIQUERY **)
 
UINT WINAPIV MSI_OpenQuery (MSIDATABASE *, MSIQUERY **, LPCWSTR,...)
 
UINT MSI_IterateRecords (MSIQUERY *, LPDWORD, record_func, LPVOID)
 
MSIRECORD *WINAPIV MSI_QueryGetRecord (MSIDATABASE *db, LPCWSTR query,...)
 
UINT MSI_DatabaseGetPrimaryKeys (MSIDATABASE *, LPCWSTR, MSIRECORD **)
 
UINT MSI_ViewExecute (MSIQUERY *, MSIRECORD *)
 
UINT MSI_ViewFetch (MSIQUERY *, MSIRECORD **)
 
UINT MSI_ViewClose (MSIQUERY *)
 
UINT MSI_ViewGetColumnInfo (MSIQUERY *, MSICOLINFO, MSIRECORD **)
 
UINT MSI_ViewModify (MSIQUERY *, MSIMODIFY, MSIRECORD *)
 
UINT VIEW_find_column (MSIVIEW *, LPCWSTR, LPCWSTR, UINT *)
 
UINT msi_view_get_row (MSIDATABASE *, MSIVIEW *, UINT, MSIRECORD **)
 
UINT MSI_SetInstallLevel (MSIPACKAGE *package, int iInstallLevel)
 
MSIPACKAGE * MSI_CreatePackage (MSIDATABASE *)
 
UINT MSI_OpenPackageW (LPCWSTR szPackage, DWORD dwOptions, MSIPACKAGE **pPackage)
 
UINT MSI_SetTargetPathW (MSIPACKAGE *, LPCWSTR, LPCWSTR)
 
INT MSI_ProcessMessageVerbatim (MSIPACKAGE *, INSTALLMESSAGE, MSIRECORD *)
 
INT MSI_ProcessMessage (MSIPACKAGE *, INSTALLMESSAGE, MSIRECORD *)
 
MSICONDITION MSI_EvaluateConditionW (MSIPACKAGE *, LPCWSTR)
 
UINT MSI_GetComponentStateW (MSIPACKAGE *, LPCWSTR, INSTALLSTATE *, INSTALLSTATE *)
 
UINT MSI_GetFeatureStateW (MSIPACKAGE *, LPCWSTR, INSTALLSTATE *, INSTALLSTATE *)
 
UINT MSI_SetFeatureStateW (MSIPACKAGE *, LPCWSTR, INSTALLSTATE)
 
UINT msi_download_file (LPCWSTR szUrl, LPWSTR filename)
 
UINT msi_package_add_info (MSIPACKAGE *, DWORD, DWORD, LPCWSTR, LPWSTR)
 
UINT msi_package_add_media_disk (MSIPACKAGE *, DWORD, DWORD, DWORD, LPWSTR, LPWSTR)
 
UINT msi_clone_properties (MSIDATABASE *)
 
UINT msi_set_context (MSIPACKAGE *)
 
void msi_adjust_privilege_properties (MSIPACKAGE *)
 
UINT MSI_GetFeatureCost (MSIPACKAGE *, MSIFEATURE *, MSICOSTTREE, INSTALLSTATE, LPINT)
 
UINT MSI_FormatRecordW (MSIPACKAGE *, MSIRECORD *, LPWSTR, LPDWORD)
 
BOOL unsquash_guid (LPCWSTR in, LPWSTR out)
 
BOOL squash_guid (LPCWSTR in, LPWSTR out)
 
BOOL encode_base85_guid (GUID *, LPWSTR)
 
BOOL decode_base85_guid (LPCWSTR, GUID *)
 
UINT MSIREG_OpenUninstallKey (const WCHAR *, enum platform, HKEY *, BOOL)
 
UINT MSIREG_DeleteUninstallKey (const WCHAR *, enum platform)
 
UINT MSIREG_OpenProductKey (LPCWSTR szProduct, LPCWSTR szUserSid, MSIINSTALLCONTEXT context, HKEY *key, BOOL create)
 
UINT MSIREG_OpenFeaturesKey (LPCWSTR szProduct, LPCWSTR szUserSid, MSIINSTALLCONTEXT context, HKEY *key, BOOL create)
 
UINT MSIREG_OpenUserPatchesKey (LPCWSTR szPatch, HKEY *key, BOOL create)
 
UINT MSIREG_OpenUserDataFeaturesKey (LPCWSTR szProduct, LPCWSTR szUserSid, MSIINSTALLCONTEXT context, HKEY *key, BOOL create)
 
UINT MSIREG_OpenUserComponentsKey (LPCWSTR szComponent, HKEY *key, BOOL create)
 
UINT MSIREG_OpenUserDataComponentKey (LPCWSTR szComponent, LPCWSTR szUserSid, HKEY *key, BOOL create)
 
UINT MSIREG_OpenPatchesKey (LPCWSTR szPatch, HKEY *key, BOOL create)
 
UINT MSIREG_OpenUserDataProductKey (LPCWSTR szProduct, MSIINSTALLCONTEXT dwContext, LPCWSTR szUserSid, HKEY *key, BOOL create)
 
UINT MSIREG_OpenUserDataPatchKey (LPCWSTR szPatch, MSIINSTALLCONTEXT dwContext, HKEY *key, BOOL create)
 
UINT MSIREG_OpenUserDataProductPatchesKey (LPCWSTR product, MSIINSTALLCONTEXT context, HKEY *key, BOOL create)
 
UINT MSIREG_OpenInstallProps (LPCWSTR szProduct, MSIINSTALLCONTEXT dwContext, LPCWSTR szUserSid, HKEY *key, BOOL create)
 
UINT MSIREG_OpenUpgradeCodesKey (LPCWSTR szProduct, HKEY *key, BOOL create)
 
UINT MSIREG_OpenUserUpgradeCodesKey (LPCWSTR szProduct, HKEY *key, BOOL create)
 
UINT MSIREG_DeleteProductKey (LPCWSTR szProduct)
 
UINT MSIREG_DeleteUserProductKey (LPCWSTR szProduct)
 
UINT MSIREG_DeleteUserDataPatchKey (LPCWSTR patch, MSIINSTALLCONTEXT context)
 
UINT MSIREG_DeleteUserDataProductKey (LPCWSTR, MSIINSTALLCONTEXT)
 
UINT MSIREG_DeleteUserFeaturesKey (LPCWSTR szProduct)
 
UINT MSIREG_DeleteUserDataComponentKey (LPCWSTR szComponent, LPCWSTR szUserSid)
 
UINT MSIREG_DeleteUserUpgradeCodesKey (LPCWSTR szUpgradeCode)
 
UINT MSIREG_DeleteUpgradeCodesKey (const WCHAR *)
 
UINT MSIREG_DeleteClassesUpgradeCodesKey (LPCWSTR szUpgradeCode)
 
UINT MSIREG_OpenClassesUpgradeCodesKey (LPCWSTR szUpgradeCode, HKEY *key, BOOL create)
 
UINT MSIREG_DeleteLocalClassesProductKey (LPCWSTR szProductCode)
 
UINT MSIREG_DeleteLocalClassesFeaturesKey (LPCWSTR szProductCode)
 
UINT msi_locate_product (LPCWSTR szProduct, MSIINSTALLCONTEXT *context)
 
WCHAR * msi_reg_get_val_str (HKEY hkey, const WCHAR *name) __WINE_DEALLOC(free) __WINE_MALLOC
 
BOOL msi_reg_get_val_dword (HKEY hkey, LPCWSTR name, DWORD *val)
 
DWORD msi_version_str_to_dword (LPCWSTR p)
 
void msi_parse_version_string (LPCWSTR, PDWORD, PDWORD)
 
int msi_compare_file_versions (VS_FIXEDFILEINFO *, const WCHAR *)
 
int msi_compare_font_versions (const WCHAR *, const WCHAR *)
 
LONG msi_reg_set_val_str (HKEY hkey, LPCWSTR name, LPCWSTR value)
 
LONG msi_reg_set_val_multi_str (HKEY hkey, LPCWSTR name, LPCWSTR value)
 
LONG msi_reg_set_val_dword (HKEY hkey, LPCWSTR name, DWORD val)
 
LONG msi_reg_set_subkey_val (HKEY hkey, LPCWSTR path, LPCWSTR name, LPCWSTR val)
 
void msi_dialog_check_messages (HANDLE)
 
void msi_dialog_destroy (msi_dialog *)
 
void msi_dialog_unregister_class (void)
 
UINT msi_get_suminfo (IStorage *stg, UINT uiUpdateCount, MSISUMMARYINFO **si)
 
UINT msi_get_db_suminfo (MSIDATABASE *db, UINT uiUpdateCount, MSISUMMARYINFO **si)
 
WCHAR * msi_suminfo_dup_string (MSISUMMARYINFO *si, UINT property) __WINE_DEALLOC(free) __WINE_MALLOC
 
INT msi_suminfo_get_int32 (MSISUMMARYINFO *si, UINT uiProperty)
 
WCHAR * msi_get_suminfo_product (IStorage *stg) __WINE_DEALLOC(free) __WINE_MALLOC
 
UINT msi_add_suminfo (MSIDATABASE *db, LPWSTR **records, int num_records, int num_columns)
 
UINT msi_export_suminfo (MSIDATABASE *db, HANDLE handle)
 
UINT msi_load_suminfo_properties (MSIPACKAGE *package)
 
UINT msi_suminfo_persist (MSISUMMARYINFO *)
 
UINT msi_suminfo_get_prop (MSISUMMARYINFO *, UINT, UINT *, INT *, FILETIME *, awstring *, DWORD *)
 
UINT msi_suminfo_set_prop (MSISUMMARYINFO *, UINT, UINT, INT, FILETIME *, awcstring *)
 
UINT WINAPI MsiCreateAndVerifyInstallerDirectory (DWORD)
 
UINT WINAPI MsiDecomposeDescriptorW (LPCWSTR, LPWSTR, LPWSTR, LPWSTR, LPDWORD)
 
UINT WINAPI MsiDecomposeDescriptorA (LPCSTR, LPSTR, LPSTR, LPSTR, LPDWORD)
 
LANGID WINAPI MsiLoadStringW (MSIHANDLE, UINT, LPWSTR, int, LANGID)
 
LANGID WINAPI MsiLoadStringA (MSIHANDLE, UINT, LPSTR, int, LANGID)
 
UINT ACTION_PerformAction (MSIPACKAGE *package, const WCHAR *action)
 
void ACTION_FinishCustomActions (const MSIPACKAGE *package)
 
UINT ACTION_CustomAction (MSIPACKAGE *package, const WCHAR *action)
 
void custom_stop_server (HANDLE process, HANDLE pipe)
 
UINT ACTION_AppSearch (MSIPACKAGE *package)
 
UINT ACTION_CCPSearch (MSIPACKAGE *package)
 
UINT ACTION_FindRelatedProducts (MSIPACKAGE *package)
 
UINT ACTION_InstallFiles (MSIPACKAGE *package)
 
UINT ACTION_PatchFiles (MSIPACKAGE *package)
 
UINT ACTION_RemoveFiles (MSIPACKAGE *package)
 
UINT ACTION_MoveFiles (MSIPACKAGE *package)
 
UINT ACTION_DuplicateFiles (MSIPACKAGE *package)
 
UINT ACTION_RemoveDuplicateFiles (MSIPACKAGE *package)
 
UINT ACTION_RegisterClassInfo (MSIPACKAGE *package)
 
UINT ACTION_RegisterProgIdInfo (MSIPACKAGE *package)
 
UINT ACTION_RegisterExtensionInfo (MSIPACKAGE *package)
 
UINT ACTION_RegisterMIMEInfo (MSIPACKAGE *package)
 
UINT ACTION_RegisterFonts (MSIPACKAGE *package)
 
UINT ACTION_UnregisterClassInfo (MSIPACKAGE *package)
 
UINT ACTION_UnregisterExtensionInfo (MSIPACKAGE *package)
 
UINT ACTION_UnregisterFonts (MSIPACKAGE *package)
 
UINT ACTION_UnregisterMIMEInfo (MSIPACKAGE *package)
 
UINT ACTION_UnregisterProgIdInfo (MSIPACKAGE *package)
 
UINT ACTION_MsiPublishAssemblies (MSIPACKAGE *package)
 
UINT ACTION_MsiUnpublishAssemblies (MSIPACKAGE *package)
 
DWORD deformat_string (MSIPACKAGE *package, LPCWSTR ptr, WCHAR **data)
 
WCHAR * msi_dup_record_field (MSIRECORD *row, INT index) __WINE_DEALLOC(free) __WINE_MALLOC
 
WCHAR * msi_dup_property (MSIDATABASE *db, const WCHAR *prop) __WINE_DEALLOC(free) __WINE_MALLOC
 
UINT msi_set_property (MSIDATABASE *, const WCHAR *, const WCHAR *, int)
 
UINT msi_get_property (MSIDATABASE *, LPCWSTR, LPWSTR, LPDWORD)
 
int msi_get_property_int (MSIDATABASE *package, LPCWSTR prop, int def)
 
WCHAR * msi_resolve_source_folder (MSIPACKAGE *package, const WCHAR *name, MSIFOLDER **folder) __WINE_DEALLOC(free) __WINE_MALLOC
 
void msi_resolve_target_folder (MSIPACKAGE *package, const WCHAR *name, BOOL load_prop)
 
WCHAR * msi_normalize_path (const WCHAR *) __WINE_DEALLOC(free) __WINE_MALLOC
 
WCHAR * msi_resolve_file_source (MSIPACKAGE *package, MSIFILE *file) __WINE_DEALLOC(free) __WINE_MALLOC
 
const WCHAR * msi_get_target_folder (MSIPACKAGE *package, const WCHAR *name)
 
void msi_reset_source_folders (MSIPACKAGE *package)
 
MSICOMPONENT * msi_get_loaded_component (MSIPACKAGE *package, const WCHAR *Component)
 
MSIFEATURE * msi_get_loaded_feature (MSIPACKAGE *package, const WCHAR *Feature)
 
MSIFILE * msi_get_loaded_file (MSIPACKAGE *package, const WCHAR *file)
 
MSIFOLDER * msi_get_loaded_folder (MSIPACKAGE *package, const WCHAR *dir)
 
WCHAR * msi_create_temp_file (MSIDATABASE *db) __WINE_DEALLOC(free) __WINE_MALLOC
 
void msi_free_action_script (MSIPACKAGE *package, UINT script)
 
WCHAR * msi_build_icon_path (MSIPACKAGE *, const WCHAR *) __WINE_DEALLOC(free) __WINE_MALLOC
 
WCHAR *WINAPIV msi_build_directory_name (DWORD,...) __WINE_DEALLOC(free) __WINE_MALLOC
 
void msi_reduce_to_long_filename (WCHAR *)
 
WCHAR * msi_create_component_advertise_string (MSIPACKAGE *, MSICOMPONENT *, const WCHAR *) __WINE_DEALLOC(free) __WINE_MALLOC
 
void ACTION_UpdateComponentStates (MSIPACKAGE *package, MSIFEATURE *feature)
 
UINT msi_register_unique_action (MSIPACKAGE *, const WCHAR *)
 
BOOL msi_action_is_unique (const MSIPACKAGE *, const WCHAR *)
 
UINT msi_set_last_used_source (LPCWSTR product, LPCWSTR usersid, MSIINSTALLCONTEXT context, DWORD options, LPCWSTR value)
 
UINT msi_create_empty_local_file (LPWSTR path, LPCWSTR suffix)
 
UINT msi_set_sourcedir_props (MSIPACKAGE *package, BOOL replace)
 
MSIASSEMBLY * msi_load_assembly (MSIPACKAGE *, MSICOMPONENT *)
 
UINT msi_install_assembly (MSIPACKAGE *, MSICOMPONENT *)
 
UINT msi_uninstall_assembly (MSIPACKAGE *, MSICOMPONENT *)
 
void msi_destroy_assembly_caches (MSIPACKAGE *)
 
BOOL msi_is_global_assembly (MSICOMPONENT *)
 
IAssemblyEnum * msi_create_assembly_enum (MSIPACKAGE *, const WCHAR *)
 
WCHAR * msi_get_assembly_path (MSIPACKAGE *, const WCHAR *) __WINE_DEALLOC(free) __WINE_MALLOC
 
WCHAR ** msi_split_string (const WCHAR *, WCHAR)
 
UINT msi_set_original_database_property (MSIDATABASE *, const WCHAR *)
 
WCHAR * msi_get_error_message (MSIDATABASE *, int) __WINE_DEALLOC(free) __WINE_MALLOC
 
UINT msi_strncpyWtoA (const WCHAR *str, int len, char *buf, DWORD *sz, BOOL remote)
 
UINT msi_strncpyW (const WCHAR *str, int len, WCHAR *buf, DWORD *sz)
 
WCHAR * msi_get_package_code (MSIDATABASE *db) __WINE_DEALLOC(free) __WINE_MALLOC
 
static void msi_disable_fs_redirection (MSIPACKAGE *package)
 
static void msi_revert_fs_redirection (MSIPACKAGE *package)
 
BOOL msi_get_temp_file_name (MSIPACKAGE *, const WCHAR *, const WCHAR *, WCHAR *)
 
HANDLE msi_create_file (MSIPACKAGE *, const WCHAR *, DWORD, DWORD, DWORD, DWORD)
 
BOOL msi_copy_file (MSIPACKAGE *, const WCHAR *, const WCHAR *, BOOL)
 
BOOL msi_delete_file (MSIPACKAGE *, const WCHAR *)
 
BOOL msi_remove_directory (MSIPACKAGE *, const WCHAR *)
 
DWORD msi_get_file_attributes (MSIPACKAGE *, const WCHAR *)
 
BOOL msi_set_file_attributes (MSIPACKAGE *, const WCHAR *, DWORD)
 
HANDLE msi_find_first_file (MSIPACKAGE *, const WCHAR *, WIN32_FIND_DATAW *)
 
BOOL msi_find_next_file (MSIPACKAGE *, HANDLE, WIN32_FIND_DATAW *)
 
BOOL msi_move_file (MSIPACKAGE *, const WCHAR *, const WCHAR *, DWORD)
 
DWORD msi_get_file_version_info (MSIPACKAGE *, const WCHAR *, DWORD, BYTE *)
 
BOOL msi_create_full_path (MSIPACKAGE *, const WCHAR *)
 
DWORD msi_get_disk_file_size (MSIPACKAGE *, const WCHAR *)
 
VS_FIXEDFILEINFO * msi_get_disk_file_version (MSIPACKAGE *, const WCHAR *)
 
UINT msi_get_filehash (MSIPACKAGE *, const WCHAR *, MSIFILEHASHINFO *)
 
WCHAR * msi_get_font_file_version (MSIPACKAGE *, const WCHAR *) __WINE_DEALLOC(free) __WINE_MALLOC
 
UINT ready_media (MSIPACKAGE *package, BOOL compressed, MSIMEDIAINFO *mi)
 
UINT msi_load_media_info (MSIPACKAGE *package, UINT Sequence, MSIMEDIAINFO *mi)
 
void msi_free_media_info (MSIMEDIAINFO *mi)
 
BOOL msi_cabextract (MSIPACKAGE *package, MSIMEDIAINFO *mi, LPVOID data)
 
UINT msi_add_cabinet_stream (MSIPACKAGE *, UINT, IStorage *, const WCHAR *)
 
void msi_event_fire (MSIPACKAGE *, const WCHAR *, MSIRECORD *)
 
void msi_event_cleanup_all_subscriptions (MSIPACKAGE *)
 
HRESULT create_msiserver (IUnknown *pOuter, LPVOID *ppObj)
 
HRESULT create_session (MSIHANDLE msiHandle, IDispatch *pInstaller, IDispatch **pDispatch)
 
HRESULT get_typeinfo (tid_t tid, ITypeInfo **ti)
 
void release_typelib (void)
 
DWORD call_script (MSIHANDLE hPackage, INT type, LPCWSTR script, LPCWSTR function, LPCWSTR action)
 
void msi_ui_progress (MSIPACKAGE *, int, int, int, int)
 
static char * strdupWtoA (LPCWSTR str)
 
static LPWSTR strdupAtoW (LPCSTR str)
 
static char * strdupWtoU (LPCWSTR str)
 
static LPWSTR strdupUtoW (LPCSTR str)
 
static int cost_from_size (int size)
 

Variables

static const BOOL is_64bit = sizeof(void *) > sizeof(int)
 
BOOL is_wow64
 
INSTALLUILEVEL gUILevel
 
HWND gUIhwnd
 
INSTALLUI_HANDLERA gUIHandlerA
 
INSTALLUI_HANDLERW gUIHandlerW
 
INSTALLUI_HANDLER_RECORD gUIHandlerRecord
 
DWORD gUIFilter
 
DWORD gUIFilterRecord
 
LPVOID gUIContext
 
LPVOID gUIContextRecord
 
WCHAR * gszLogFile
 
HINSTANCE msi_hInstance
 

Macro Definition Documentation

◆ GUID_SIZE

#define GUID_SIZE   39

Definition at line 757 of file msipriv.h.

◆ INSTALLUILEVEL_MASK

#define INSTALLUILEVEL_MASK   0x0007

Definition at line 60 of file msipriv.h.

◆ LONG_STR_BYTES

#define LONG_STR_BYTES   3

Definition at line 57 of file msipriv.h.

◆ MAX_STREAM_NAME_LEN

#define MAX_STREAM_NAME_LEN   62

Definition at line 56 of file msipriv.h.

◆ MSI_BUILDNUMBER

#define MSI_BUILDNUMBER   6001

Definition at line 755 of file msipriv.h.

◆ MSI_DATASIZEMASK

#define MSI_DATASIZEMASK   0x00ff

Definition at line 47 of file msipriv.h.

◆ MSI_INITIAL_MEDIA_TRANSFORM_DISKID

#define MSI_INITIAL_MEDIA_TRANSFORM_DISKID   32000

Definition at line 84 of file msipriv.h.

◆ MSI_INITIAL_MEDIA_TRANSFORM_OFFSET

#define MSI_INITIAL_MEDIA_TRANSFORM_OFFSET   10000

Definition at line 83 of file msipriv.h.

◆ MSI_MAJORVERSION

#define MSI_MAJORVERSION   5

Definition at line 753 of file msipriv.h.

◆ MSI_MAX_PROPS

#define MSI_MAX_PROPS   20

Definition at line 496 of file msipriv.h.

◆ MSI_MINORVERSION

#define MSI_MINORVERSION   0

Definition at line 754 of file msipriv.h.

◆ MSI_OPEN_CREATE

#define MSI_OPEN_CREATE   3

Definition at line 102 of file msipriv.h.

◆ MSI_OPEN_CREATEDIRECT

#define MSI_OPEN_CREATEDIRECT   4

Definition at line 103 of file msipriv.h.

◆ MSI_OPEN_DIRECT

#define MSI_OPEN_DIRECT   2

Definition at line 101 of file msipriv.h.

◆ MSI_OPEN_PATCHFILE

#define MSI_OPEN_PATCHFILE   32

Definition at line 104 of file msipriv.h.

◆ MSI_OPEN_READONLY

#define MSI_OPEN_READONLY   0

Definition at line 99 of file msipriv.h.

◆ MSI_OPEN_TRANSACT

#define MSI_OPEN_TRANSACT   1

Definition at line 100 of file msipriv.h.

◆ MSICABEXTRACT_BEGINEXTRACT

#define MSICABEXTRACT_BEGINEXTRACT   0x01

Definition at line 1129 of file msipriv.h.

◆ MSICABEXTRACT_FILEEXTRACTED

#define MSICABEXTRACT_FILEEXTRACTED   0x02

Definition at line 1130 of file msipriv.h.

◆ MSIHANDLE_MAGIC

#define MSIHANDLE_MAGIC   0x4d434923

Definition at line 760 of file msipriv.h.

◆ MSIHANDLETYPE_ANY

#define MSIHANDLETYPE_ANY   0

Definition at line 745 of file msipriv.h.

◆ MSIHANDLETYPE_DATABASE

#define MSIHANDLETYPE_DATABASE   1

Definition at line 746 of file msipriv.h.

◆ MSIHANDLETYPE_PACKAGE

#define MSIHANDLETYPE_PACKAGE   5

Definition at line 750 of file msipriv.h.

◆ MSIHANDLETYPE_PREVIEW

#define MSIHANDLETYPE_PREVIEW   6

Definition at line 751 of file msipriv.h.

◆ MSIHANDLETYPE_RECORD

#define MSIHANDLETYPE_RECORD   4

Definition at line 749 of file msipriv.h.

◆ MSIHANDLETYPE_SUMMARYINFO

#define MSIHANDLETYPE_SUMMARYINFO   2

Definition at line 747 of file msipriv.h.

◆ MSIHANDLETYPE_VIEW

#define MSIHANDLETYPE_VIEW   3

Definition at line 748 of file msipriv.h.

◆ MSITYPE_IS_BINARY

#define MSITYPE_IS_BINARY (   type)    (((type) & ~MSITYPE_NULLABLE) == (MSITYPE_STRING|MSITYPE_VALID))

Definition at line 62 of file msipriv.h.

◆ MSITYPE_KEY

#define MSITYPE_KEY   0x2000

Definition at line 52 of file msipriv.h.

◆ MSITYPE_LOCALIZABLE

#define MSITYPE_LOCALIZABLE   0x200

Definition at line 49 of file msipriv.h.

◆ MSITYPE_NULLABLE

#define MSITYPE_NULLABLE   0x1000

Definition at line 51 of file msipriv.h.

◆ MSITYPE_STRING

#define MSITYPE_STRING   0x0800

Definition at line 50 of file msipriv.h.

◆ MSITYPE_TEMPORARY

#define MSITYPE_TEMPORARY   0x4000

Definition at line 53 of file msipriv.h.

◆ MSITYPE_UNKNOWN

#define MSITYPE_UNKNOWN   0x8000

Definition at line 54 of file msipriv.h.

◆ MSITYPE_VALID

#define MSITYPE_VALID   0x0100

Definition at line 48 of file msipriv.h.

◆ SEQUENCE_EXEC

#define SEQUENCE_EXEC   0x2

Definition at line 743 of file msipriv.h.

◆ SEQUENCE_UI

#define SEQUENCE_UI   0x1

Definition at line 742 of file msipriv.h.

◆ SQUASHED_GUID_SIZE

#define SQUASHED_GUID_SIZE   33

Definition at line 758 of file msipriv.h.

◆ WINE_OPENPACKAGEFLAGS_RECACHE

#define WINE_OPENPACKAGEFLAGS_RECACHE   0x80000000

Definition at line 908 of file msipriv.h.

Typedef Documentation

◆ column_info

◆ ComponentList

◆ FeatureList

◆ FolderList

◆ msi_dialog

Definition at line 361 of file msipriv.h.

◆ msi_file_state

◆ MSIAPPID

◆ MSIASSEMBLY

◆ MSIBINARY

◆ MSICABINETSTREAM

◆ MSICLASS

◆ MSICOMPONENT

◆ MSIDATABASE

◆ MSIEXTENSION

◆ MSIFEATURE

◆ MSIFIELD

◆ MSIFILE

◆ MSIFILEPATCH

◆ MSIFOLDER

◆ msihandledestructor

typedef VOID(* msihandledestructor) (MSIOBJECTHDR *)

Definition at line 73 of file msipriv.h.

◆ MSIITERHANDLE

typedef const struct tagMSICOLUMNHASHENTRY* MSIITERHANDLE

Definition at line 229 of file msipriv.h.

◆ MSIMEDIADISK

◆ MSIMEDIAINFO

◆ MSIMIME

Definition at line 684 of file msipriv.h.

◆ MSIOBJECTHDR

Definition at line 71 of file msipriv.h.

◆ MSIPACKAGE

◆ MSIPATCHINFO

◆ MSIPREVIEW

◆ MSIPROGID

Definition at line 661 of file msipriv.h.

◆ MSIQUERY

◆ MSIRECORD

◆ MSISOURCELISTINFO

◆ MSISTREAM

◆ MSISUMMARYINFO

◆ MSITABLE

Definition at line 65 of file msipriv.h.

◆ MSITRANSFORM

◆ MSIVERB

◆ MSIVIEW

Definition at line 125 of file msipriv.h.

◆ MSIVIEWOPS

◆ PMSICABEXTRACTCB

typedef BOOL(* PMSICABEXTRACTCB) (MSIPACKAGE *, LPCWSTR, DWORD, LPWSTR *, DWORD *, PVOID)

Definition at line 1127 of file msipriv.h.

◆ record_func

typedef UINT(* record_func) (MSIRECORD *, LPVOID)

Definition at line 890 of file msipriv.h.

◆ string_table

Definition at line 68 of file msipriv.h.

◆ tid_t

typedef enum tid_t tid_t

Enumeration Type Documentation

◆ _msi_file_state

Enumerator
msifs_invalid 
msifs_missing 
msifs_overwrite 
msifs_present 
msifs_installed 
msifs_skipped 
msifs_hashmatch 

Definition at line 607 of file msipriv.h.

607 {
enum _msi_file_state msi_file_state
@ msifs_missing
Definition: msipriv.h:609
@ msifs_skipped
Definition: msipriv.h:613
@ msifs_installed
Definition: msipriv.h:612
@ msifs_invalid
Definition: msipriv.h:608
@ msifs_present
Definition: msipriv.h:611
@ msifs_hashmatch
Definition: msipriv.h:614
@ msifs_overwrite
Definition: msipriv.h:610

◆ clr_version

Enumerator
CLR_VERSION_V10 
CLR_VERSION_V11 
CLR_VERSION_V20 
CLR_VERSION_V40 
CLR_VERSION_MAX 

Definition at line 386 of file msipriv.h.

387{
393};
@ CLR_VERSION_V20
Definition: msipriv.h:390
@ CLR_VERSION_MAX
Definition: msipriv.h:392
@ CLR_VERSION_V40
Definition: msipriv.h:391
@ CLR_VERSION_V11
Definition: msipriv.h:389
@ CLR_VERSION_V10
Definition: msipriv.h:388

◆ folder_state

Enumerator
FOLDER_STATE_UNINITIALIZED 
FOLDER_STATE_EXISTS 
FOLDER_STATE_CREATED 
FOLDER_STATE_CREATED_PERSISTENT 
FOLDER_STATE_REMOVED 

Definition at line 577 of file msipriv.h.

578{
584};
@ FOLDER_STATE_UNINITIALIZED
Definition: msipriv.h:579
@ FOLDER_STATE_EXISTS
Definition: msipriv.h:580
@ FOLDER_STATE_REMOVED
Definition: msipriv.h:583
@ FOLDER_STATE_CREATED
Definition: msipriv.h:581
@ FOLDER_STATE_CREATED_PERSISTENT
Definition: msipriv.h:582

◆ platform

Enumerator
PLATFORM_UNRECOGNIZED 
PLATFORM_INTEL 
PLATFORM_INTEL64 
PLATFORM_X64 
PLATFORM_ARM 
PLATFORM_ARM64 

Definition at line 363 of file msipriv.h.

364{
371};
@ PLATFORM_X64
Definition: msipriv.h:368
@ PLATFORM_UNRECOGNIZED
Definition: msipriv.h:365
@ PLATFORM_INTEL64
Definition: msipriv.h:367
@ PLATFORM_INTEL
Definition: msipriv.h:366
@ PLATFORM_ARM
Definition: msipriv.h:369
@ PLATFORM_ARM64
Definition: msipriv.h:370

◆ script

Enumerator
SCRIPT_NONE 
SCRIPT_INSTALL 
SCRIPT_COMMIT 
SCRIPT_ROLLBACK 
SCRIPT_MAX 

Definition at line 395 of file msipriv.h.

396{
397 SCRIPT_NONE = -1,
398 SCRIPT_INSTALL = 0,
399 SCRIPT_COMMIT = 1,
400 SCRIPT_ROLLBACK = 2,
401 SCRIPT_MAX = 3
402};
@ SCRIPT_INSTALL
Definition: msipriv.h:398
@ SCRIPT_ROLLBACK
Definition: msipriv.h:400
@ SCRIPT_NONE
Definition: msipriv.h:397
@ SCRIPT_COMMIT
Definition: msipriv.h:399
@ SCRIPT_MAX
Definition: msipriv.h:401

◆ tid_t

Enumerator
LAST_tid 
LAST_tid 
Database_tid 
Installer_tid 
Record_tid 
Session_tid 
StringList_tid 
SummaryInfo_tid 
View_tid 
LAST_tid 
NULL_tid 
IXMLDOMAttribute_tid 
IXMLDOMCDATASection_tid 
IXMLDOMComment_tid 
IXMLDOMDocument_tid 
IXMLDOMDocument2_tid 
IXMLDOMDocument3_tid 
IXMLDOMDocumentFragment_tid 
IXMLDOMDocumentType_tid 
IXMLDOMElement_tid 
IXMLDOMEntityReference_tid 
IXMLDOMImplementation_tid 
IXMLDOMNamedNodeMap_tid 
IXMLDOMNode_tid 
IXMLDOMNodeList_tid 
IXMLDOMParseError2_tid 
IXMLDOMProcessingInstruction_tid 
IXMLDOMSchemaCollection_tid 
IXMLDOMSchemaCollection2_tid 
IXMLDOMSelection_tid 
IXMLDOMText_tid 
IXMLElement_tid 
IXMLDocument_tid 
IXMLHTTPRequest_tid 
IXSLProcessor_tid 
IXSLTemplate_tid 
IVBSAXAttributes_tid 
IVBSAXContentHandler_tid 
IVBSAXDeclHandler_tid 
IVBSAXDTDHandler_tid 
IVBSAXEntityResolver_tid 
IVBSAXErrorHandler_tid 
IVBSAXLexicalHandler_tid 
IVBSAXLocator_tid 
IVBSAXXMLFilter_tid 
IVBSAXXMLReader_tid 
IMXAttributes_tid 
IMXReaderControl_tid 
IMXWriter_tid 
IVBMXNamespaceManager_tid 
IServerXMLHTTPRequest_tid 
LAST_tid 
NULL_tid 
ITextDocument_tid 
ITextRange_tid 
ITextSelection_tid 
ITextFont_tid 
ITextPara_tid 
LAST_tid 
NULL_tid 
IDictionary_tid 
IDrive_tid 
IDriveCollection_tid 
IFile_tid 
IFileCollection_tid 
IFileSystem3_tid 
IFolder_tid 
IFolderCollection_tid 
ITextStream_tid 
LAST_tid 
NULL_tid 
IWshCollection_tid 
IWshEnvironment_tid 
IWshExec_tid 
IWshShell3_tid 
IWshShortcut_tid 
IWshNetwork2_tid 
LAST_tid 

Definition at line 1152 of file msipriv.h.

1152 {
1155 Record_tid,
1159 View_tid,
1160 LAST_tid
1161} tid_t;
tid_t
Definition: msipriv.h:1152
@ View_tid
Definition: msipriv.h:1159
@ Session_tid
Definition: msipriv.h:1156
@ Database_tid
Definition: msipriv.h:1153
@ LAST_tid
Definition: msipriv.h:1160
@ SummaryInfo_tid
Definition: msipriv.h:1158
@ StringList_tid
Definition: msipriv.h:1157
@ Record_tid
Definition: msipriv.h:1155
@ Installer_tid
Definition: msipriv.h:1154

Function Documentation

◆ ACTION_AppSearch()

UINT ACTION_AppSearch ( MSIPACKAGE *  package)

Definition at line 1124 of file appsearch.c.

1125{
1126 MSIQUERY *view;
1127 UINT r;
1128
1129 if (msi_action_is_unique(package, L"AppSearch"))
1130 {
1131 TRACE("Skipping AppSearch action: already done in UI sequence\n");
1132 return ERROR_SUCCESS;
1133 }
1134 else
1135 msi_register_unique_action(package, L"AppSearch");
1136
1137 r = MSI_OpenQuery( package->db, &view, L"SELECT * FROM `AppSearch`" );
1138 if (r != ERROR_SUCCESS)
1139 return ERROR_SUCCESS;
1140
1142 msiobj_release( &view->hdr );
1143 return r;
1144}
static UINT ITERATE_AppSearch(MSIRECORD *row, LPVOID param)
Definition: appsearch.c:1086
#define ERROR_SUCCESS
Definition: deptool.c:10
#define NULL
Definition: types.h:112
UINT msi_register_unique_action(MSIPACKAGE *package, const WCHAR *action)
Definition: custom.c:112
BOOL msi_action_is_unique(const MSIPACKAGE *package, const WCHAR *action)
Definition: custom.c:130
int msiobj_release(MSIOBJECTHDR *info)
Definition: handle.c:241
#define L(x)
Definition: resources.c:13
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
unsigned int UINT
Definition: sysinfo.c:13
UINT WINAPIV MSI_OpenQuery(MSIDATABASE *, MSIQUERY **, LPCWSTR,...)
Definition: msiquery.c:138
UINT MSI_IterateRecords(MSIQUERY *, LPDWORD, record_func, LPVOID)
Definition: msiquery.c:163
#define TRACE(s)
Definition: solgame.cpp:4
MSIDATABASE * db
Definition: msipriv.h:407

◆ ACTION_CCPSearch()

UINT ACTION_CCPSearch ( MSIPACKAGE *  package)

Definition at line 1174 of file appsearch.c.

1175{
1176 MSIQUERY *view;
1177 UINT r;
1178
1179 if (msi_action_is_unique(package, L"CCPSearch"))
1180 {
1181 TRACE("Skipping AppSearch action: already done in UI sequence\n");
1182 return ERROR_SUCCESS;
1183 }
1184 else
1185 msi_register_unique_action(package, L"CCPSearch");
1186
1187 r = MSI_OpenQuery(package->db, &view, L"SELECT * FROM `CCPSearch`");
1188 if (r != ERROR_SUCCESS)
1189 return ERROR_SUCCESS;
1190
1192 msiobj_release(&view->hdr);
1193 return r;
1194}
static UINT ITERATE_CCPSearch(MSIRECORD *row, LPVOID param)
Definition: appsearch.c:1146

◆ ACTION_CustomAction()

UINT ACTION_CustomAction ( MSIPACKAGE *  package,
const WCHAR *  action 
)

Definition at line 1484 of file custom.c.

1485{
1486 UINT rc = ERROR_SUCCESS;
1487 MSIRECORD *row;
1488 UINT type;
1489 const WCHAR *source, *target, *ptr, *deferred_data = NULL;
1490 WCHAR *deformated = NULL;
1491 int len;
1492
1493 /* deferred action: [properties]Action */
1494 if ((ptr = wcsrchr(action, ']')))
1495 {
1496 deferred_data = action;
1497 action = ptr + 1;
1498 }
1499
1500 row = MSI_QueryGetRecord( package->db, L"SELECT * FROM `CustomAction` WHERE `Action` = '%s'", action );
1501 if (!row)
1503
1507
1508 TRACE("Handling custom action %s (%x %s %s)\n",debugstr_w(action),type,
1510
1511 /* handle some of the deferred actions */
1513 FIXME("msidbCustomActionTypeTSAware not handled\n");
1514
1516 {
1518 WARN("msidbCustomActionTypeNoImpersonate not handled\n");
1519
1520 if (!action_type_matches_script(type, package->script))
1521 {
1522 rc = defer_custom_action( package, action, type );
1523 goto end;
1524 }
1525 else
1526 {
1527 LPWSTR actiondata = msi_dup_property( package->db, action );
1528
1530 package->scheduled_action_running = TRUE;
1531
1533 package->commit_action_running = TRUE;
1534
1536 package->rollback_action_running = TRUE;
1537
1538 if (deferred_data)
1539 set_deferred_action_props(package, deferred_data);
1540 else if (actiondata)
1541 msi_set_property( package->db, L"CustomActionData", actiondata, -1 );
1542 else
1543 msi_set_property( package->db, L"CustomActionData", L"", -1 );
1544
1545 free(actiondata);
1546 }
1547 }
1549 {
1550 rc = ERROR_SUCCESS;
1551 goto end;
1552 }
1553
1554 switch (type & CUSTOM_ACTION_TYPE_MASK)
1555 {
1556 case 1: /* DLL file stored in a Binary table stream */
1557 rc = HANDLE_CustomType1( package, source, target, type, action );
1558 break;
1559 case 2: /* EXE file stored in a Binary table stream */
1560 rc = HANDLE_CustomType2( package, source, target, type, action );
1561 break;
1562 case 5:
1563 case 6: /* JScript/VBScript file stored in a Binary table stream */
1564 rc = HANDLE_CustomType5_6( package, source, target, type, action );
1565 break;
1566 case 7: /* Concurrent install from substorage */
1567 deformat_string( package, target, &deformated );
1568 rc = HANDLE_CustomType7( package, source, target, type, action );
1569 free( deformated );
1570 break;
1571 case 17:
1572 rc = HANDLE_CustomType17( package, source, target, type, action );
1573 break;
1574 case 18: /* EXE file installed with package */
1575 rc = HANDLE_CustomType18( package, source, target, type, action );
1576 break;
1577 case 19: /* Error that halts install */
1578 rc = HANDLE_CustomType19( package, source, target, type, action );
1579 break;
1580 case 21: /* JScript/VBScript file installed with the product */
1581 case 22:
1582 rc = HANDLE_CustomType21_22( package, source, target, type, action );
1583 break;
1584 case 23: /* Installs another package in the source tree */
1585 deformat_string( package, target, &deformated );
1586 rc = HANDLE_CustomType23( package, source, deformated, type, action );
1587 free( deformated );
1588 break;
1589 case 34: /* EXE to be run in specified directory */
1590 rc = HANDLE_CustomType34( package, source, target, type, action );
1591 break;
1592 case 35: /* Directory set with formatted text */
1593 deformat_string( package, target, &deformated );
1594 MSI_SetTargetPathW( package, source, deformated );
1595 free( deformated );
1596 break;
1597 case 37: /* JScript/VBScript text stored in target column */
1598 case 38:
1599 rc = HANDLE_CustomType37_38( package, source, target, type, action );
1600 break;
1601 case 50: /* EXE file specified by a property value */
1602 rc = HANDLE_CustomType50( package, source, target, type, action );
1603 break;
1604 case 51: /* Property set with formatted text */
1605 if (!source) break;
1606 len = deformat_string( package, target, &deformated );
1607 rc = msi_set_property( package->db, source, deformated, len );
1608 if (rc == ERROR_SUCCESS && !wcscmp( source, L"SourceDir" )) msi_reset_source_folders( package );
1609 free( deformated );
1610 break;
1611 case 53: /* JScript/VBScript text specified by a property value */
1612 case 54:
1613 rc = HANDLE_CustomType53_54( package, source, target, type, action );
1614 break;
1615 default:
1616 FIXME( "unhandled action type %u (%s %s)\n", type & CUSTOM_ACTION_TYPE_MASK, debugstr_w(source),
1617 debugstr_w(target) );
1618 }
1619
1620end:
1622 package->commit_action_running = FALSE;
1623 package->rollback_action_running = FALSE;
1624 msiobj_release(&row->hdr);
1625 return rc;
1626}
#define FIXME(fmt,...)
Definition: precomp.h:53
#define WARN(fmt,...)
Definition: precomp.h:61
#define free
Definition: debug_ros.c:5
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define wcsrchr
Definition: compat.h:16
static UINT HANDLE_CustomType1(MSIPACKAGE *package, const WCHAR *source, const WCHAR *target, INT type, const WCHAR *action)
Definition: custom.c:861
static UINT defer_custom_action(MSIPACKAGE *package, const WCHAR *action, UINT type)
Definition: custom.c:1447
static UINT HANDLE_CustomType7(MSIPACKAGE *package, const WCHAR *source, const WCHAR *target, INT type, const WCHAR *action)
Definition: custom.c:1146
#define CUSTOM_ACTION_TYPE_MASK
Definition: custom.c:50
static UINT HANDLE_CustomType37_38(MSIPACKAGE *package, const WCHAR *source, const WCHAR *target, INT type, const WCHAR *action)
Definition: custom.c:1295
static BOOL check_execution_scheduling_options(MSIPACKAGE *package, LPCWSTR action, UINT options)
Definition: custom.c:141
static UINT HANDLE_CustomType21_22(MSIPACKAGE *package, const WCHAR *source, const WCHAR *target, INT type, const WCHAR *action)
Definition: custom.c:1354
static UINT HANDLE_CustomType23(MSIPACKAGE *package, const WCHAR *source, const WCHAR *target, INT type, const WCHAR *action)
Definition: custom.c:1065
static UINT HANDLE_CustomType17(MSIPACKAGE *package, const WCHAR *source, const WCHAR *target, INT type, const WCHAR *action)
Definition: custom.c:974
static UINT HANDLE_CustomType2(MSIPACKAGE *package, const WCHAR *source, const WCHAR *target, INT type, const WCHAR *action)
Definition: custom.c:955
static void set_deferred_action_props(MSIPACKAGE *package, const WCHAR *deferred_data)
Definition: custom.c:198
static BOOL action_type_matches_script(UINT type, UINT script)
Definition: custom.c:1429
static UINT HANDLE_CustomType34(MSIPACKAGE *package, const WCHAR *source, const WCHAR *target, INT type, const WCHAR *action)
Definition: custom.c:1198
static UINT HANDLE_CustomType5_6(MSIPACKAGE *package, const WCHAR *source, const WCHAR *target, INT type, const WCHAR *action)
Definition: custom.c:1306
static UINT HANDLE_CustomType18(MSIPACKAGE *package, const WCHAR *source, const WCHAR *target, INT type, const WCHAR *action)
Definition: custom.c:1005
static UINT HANDLE_CustomType50(MSIPACKAGE *package, const WCHAR *source, const WCHAR *target, INT type, const WCHAR *action)
Definition: custom.c:1180
static UINT HANDLE_CustomType53_54(MSIPACKAGE *package, const WCHAR *source, const WCHAR *target, INT type, const WCHAR *action)
Definition: custom.c:1413
static UINT HANDLE_CustomType19(MSIPACKAGE *package, const WCHAR *source, const WCHAR *target, INT type, const WCHAR *action)
Definition: custom.c:1023
DWORD deformat_string(MSIPACKAGE *package, const WCHAR *fmt, WCHAR **data)
Definition: format.c:1015
UINT MSI_SetTargetPathW(MSIPACKAGE *package, LPCWSTR szFolder, LPCWSTR szFolderPath)
Definition: install.c:564
_ACRTIMP int __cdecl wcscmp(const wchar_t *, const wchar_t *)
Definition: wcs.c:1977
struct png_info_def *typedef unsigned char **typedef struct png_info_def *typedef struct png_info_def *typedef struct png_info_def *typedef unsigned char ** row
Definition: typeof.h:78
action
Definition: namespace.c:707
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
GLuint GLuint end
Definition: gl.h:1545
GLenum GLsizei len
Definition: glext.h:6722
#define debugstr_w
Definition: kernel32.h:32
static PVOID ptr
Definition: dispmode.c:27
@ msidbCustomActionTypeCommit
Definition: msidefs.h:137
@ msidbCustomActionTypeNoImpersonate
Definition: msidefs.h:139
@ msidbCustomActionTypeTSAware
Definition: msidefs.h:140
@ msidbCustomActionTypeRollback
Definition: msidefs.h:136
@ msidbCustomActionTypeInScript
Definition: msidefs.h:134
int MSI_RecordGetInteger(MSIRECORD *, UINT)
Definition: record.c:213
void msi_reset_source_folders(MSIPACKAGE *package)
Definition: package.c:2121
const WCHAR * MSI_RecordGetString(const MSIRECORD *, UINT)
Definition: record.c:433
UINT msi_set_property(MSIDATABASE *, const WCHAR *, const WCHAR *, int)
Definition: package.c:2132
MSIRECORD *WINAPIV MSI_QueryGetRecord(MSIDATABASE *db, LPCWSTR query,...)
Definition: msiquery.c:201
WCHAR * msi_dup_property(MSIDATABASE *db, const WCHAR *prop) __WINE_DEALLOC(free) __WINE_MALLOC
short WCHAR
Definition: pedump.c:58
unsigned char commit_action_running
Definition: msipriv.h:481
unsigned char rollback_action_running
Definition: msipriv.h:482
enum script script
Definition: msipriv.h:446
unsigned char scheduled_action_running
Definition: msipriv.h:480
Definition: tools.h:99
uint16_t * LPWSTR
Definition: typedefs.h:56
#define ERROR_FUNCTION_NOT_CALLED
Definition: winerror.h:1332

Referenced by ACTION_HandleCustomAction().

◆ ACTION_DialogBox()

INT ACTION_DialogBox ( MSIPACKAGE *  ,
LPCWSTR   
)

◆ ACTION_DuplicateFiles()

UINT ACTION_DuplicateFiles ( MSIPACKAGE *  package)

Definition at line 1315 of file files.c.

1316{
1317 MSIQUERY *view;
1318 UINT rc;
1319
1320 if (package->script == SCRIPT_NONE)
1321 return msi_schedule_action(package, SCRIPT_INSTALL, L"DuplicateFiles");
1322
1323 rc = MSI_DatabaseOpenViewW(package->db, L"SELECT * FROM `DuplicateFile`", &view);
1324 if (rc != ERROR_SUCCESS)
1325 return ERROR_SUCCESS;
1326
1328 msiobj_release(&view->hdr);
1329 return rc;
1330}
UINT msi_schedule_action(MSIPACKAGE *package, UINT script, const WCHAR *action)
Definition: custom.c:89
static UINT ITERATE_DuplicateFiles(MSIRECORD *row, LPVOID param)
Definition: files.c:1254
UINT MSI_DatabaseOpenViewW(MSIDATABASE *, LPCWSTR, MSIQUERY **)

◆ ACTION_FindRelatedProducts()

UINT ACTION_FindRelatedProducts ( MSIPACKAGE *  package)

Definition at line 217 of file upgrade.c.

218{
219 MSIQUERY *view;
220 UINT rc;
221
222 if (msi_get_property_int(package->db, L"Installed", 0))
223 {
224 TRACE("Skipping FindRelatedProducts action: product already installed\n");
225 return ERROR_SUCCESS;
226 }
227 if (msi_action_is_unique(package, L"FindRelatedProducts"))
228 {
229 TRACE("Skipping FindRelatedProducts action: already done in UI sequence\n");
230 return ERROR_SUCCESS;
231 }
232 else
233 msi_register_unique_action(package, L"FindRelatedProducts");
234
235 rc = MSI_DatabaseOpenViewW(package->db, L"SELECT * FROM `Upgrade`", &view);
236 if (rc != ERROR_SUCCESS)
237 return ERROR_SUCCESS;
238
240 msiobj_release(&view->hdr);
241 return rc;
242}
int msi_get_property_int(MSIDATABASE *package, LPCWSTR prop, int def)
Definition: package.c:2337
static UINT ITERATE_FindRelatedProducts(MSIRECORD *rec, LPVOID param)
Definition: upgrade.c:115

◆ ACTION_FinishCustomActions()

void ACTION_FinishCustomActions ( const MSIPACKAGE *  package)

Definition at line 1628 of file custom.c.

1629{
1630 struct list *item;
1631 HANDLE *wait_handles;
1632 unsigned int handle_count, i;
1634
1635 while ((item = list_head( &package->RunningActions )))
1636 {
1638
1639 list_remove( &action->entry );
1640
1641 TRACE("waiting for %s\n", debugstr_w( action->name ) );
1643
1644 CloseHandle( action->handle );
1645 free( action->name );
1646 free( action );
1647 }
1648
1650
1651 handle_count = list_count( &pending_custom_actions );
1652 wait_handles = malloc( handle_count * sizeof(HANDLE) );
1653
1654 handle_count = 0;
1656 {
1657 if (info->package == package )
1658 {
1659 if (DuplicateHandle(GetCurrentProcess(), info->handle, GetCurrentProcess(), &wait_handles[handle_count], SYNCHRONIZE, FALSE, 0))
1660 handle_count++;
1661 }
1662 }
1663
1665
1666 for (i = 0; i < handle_count; i++)
1667 {
1668 msi_dialog_check_messages( wait_handles[i] );
1669 CloseHandle( wait_handles[i] );
1670 }
1671 free( wait_handles );
1672
1675 {
1676 if (info->package == package)
1678 }
1680}
static void list_remove(struct list_entry *entry)
Definition: list.h:90
Definition: list.h:39
#define malloc
Definition: debug_ros.c:4
#define CloseHandle
Definition: compat.h:739
#define GetCurrentProcess()
Definition: compat.h:759
BOOL WINAPI DuplicateHandle(IN HANDLE hSourceProcessHandle, IN HANDLE hSourceHandle, IN HANDLE hTargetProcessHandle, OUT LPHANDLE lpTargetHandle, IN DWORD dwDesiredAccess, IN BOOL bInheritHandle, IN DWORD dwOptions)
Definition: handle.c:149
static struct list pending_custom_actions
Definition: custom.c:72
static CRITICAL_SECTION custom_action_cs
Definition: custom.c:62
static void free_custom_action_data(custom_action_info *info)
Definition: custom.c:395
void msi_dialog_check_messages(HANDLE handle)
Definition: dialog.c:3991
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
const char cursor[]
Definition: icontest.c:13
uint32_t entry
Definition: isohybrid.c:63
#define SYNCHRONIZE
Definition: nt_native.h:61
__WINE_SERVER_LIST_INLINE unsigned int list_count(const struct list *list)
Definition: list.h:157
#define LIST_FOR_EACH_ENTRY_SAFE(cursor, cursor2, list, type, field)
Definition: list.h:242
Definition: list.h:15
struct list RunningActions
Definition: msipriv.h:454
#define LIST_ENTRY(type)
Definition: queue.h:175
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)

Referenced by MSI_InstallPackage().

◆ ACTION_ForceReboot()

UINT ACTION_ForceReboot ( MSIPACKAGE *  package)

Definition at line 5227 of file action.c.

5228{
5229 WCHAR buffer[256], sysdir[MAX_PATH], squashed_pc[SQUASHED_GUID_SIZE];
5230 HKEY hkey;
5231
5232 squash_guid( package->ProductCode, squashed_pc );
5233
5234 GetSystemDirectoryW(sysdir, ARRAY_SIZE(sysdir));
5235 RegCreateKeyW(HKEY_LOCAL_MACHINE, L"Software\\Microsoft\\Windows\\CurrentVersion\\RunOnce", &hkey);
5236 swprintf(buffer, ARRAY_SIZE(buffer), L"%s\\MsiExec.exe /@ \"%s\"", sysdir, squashed_pc);
5237
5238 msi_reg_set_val_str( hkey, squashed_pc, buffer );
5239 RegCloseKey(hkey);
5240
5241 TRACE("Reboot command %s\n",debugstr_w(buffer));
5242
5243 RegCreateKeyW(HKEY_LOCAL_MACHINE, L"Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\RunOnceEntries",
5244 &hkey);
5245 swprintf( buffer, ARRAY_SIZE(buffer), L"/I \"%s\" AFTERREBOOT=1 RUNONCEENTRY=\"%s\"", package->ProductCode,
5246 squashed_pc );
5247
5248 msi_reg_set_val_str( hkey, squashed_pc, buffer );
5249 RegCloseKey(hkey);
5250
5251 return ERROR_INSTALL_SUSPEND;
5252}
#define ARRAY_SIZE(A)
Definition: main.h:20
#define RegCloseKey(hKey)
Definition: registry.h:49
LONG WINAPI RegCreateKeyW(HKEY hKey, LPCWSTR lpSubKey, PHKEY phkResult)
Definition: reg.c:1201
#define MAX_PATH
Definition: compat.h:34
UINT WINAPI GetSystemDirectoryW(OUT LPWSTR lpBuffer, IN UINT uSize)
Definition: path.c:2331
#define swprintf
Definition: precomp.h:40
GLuint buffer
Definition: glext.h:5915
BOOL squash_guid(LPCWSTR in, LPWSTR out)
Definition: registry.c:74
LONG msi_reg_set_val_str(HKEY hkey, LPCWSTR name, LPCWSTR value)
Definition: registry.c:209
#define SQUASHED_GUID_SIZE
Definition: msipriv.h:758
LPWSTR ProductCode
Definition: msipriv.h:462
#define ERROR_INSTALL_SUSPEND
Definition: winerror.h:1310
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12

Referenced by custom_get_thread_return(), and ITERATE_Actions().

◆ ACTION_InstallFiles()

UINT ACTION_InstallFiles ( MSIPACKAGE *  package)

Definition at line 564 of file files.c.

565{
567 UINT rc = ERROR_SUCCESS;
568 MSIFILE *file;
569
571
572 if (package->script == SCRIPT_NONE)
573 return msi_schedule_action(package, SCRIPT_INSTALL, L"InstallFiles");
574
575 schedule_install_files(package);
576 mi = calloc(1, sizeof(MSIMEDIAINFO));
577
579 {
580 BOOL is_global_assembly = msi_is_global_assembly( file->Component );
581
582 file_update_ui( package, file, L"InstallFiles" );
583
584 rc = msi_load_media_info( package, file->Sequence, mi );
585 if (rc != ERROR_SUCCESS)
586 {
587 ERR("Unable to load media info for %s (%u)\n", debugstr_w(file->File), rc);
589 goto done;
590 }
591
592 if (file->state != msifs_hashmatch &&
593 file->state != msifs_skipped &&
594 (file->state != msifs_present || !msi_get_property_int( package->db, L"Installed", 0 )) &&
595 (rc = ready_media( package, file->IsCompressed, mi )))
596 {
597 ERR("Failed to ready media for %s\n", debugstr_w(file->File));
598 goto done;
599 }
600
601 if (file->state != msifs_missing && !mi->is_continuous && file->state != msifs_overwrite)
602 continue;
603
604 if (file->Sequence > mi->last_sequence || mi->is_continuous ||
605 (file->IsCompressed && !mi->is_extracted))
606 {
609
610 data.mi = mi;
611 data.package = package;
613 data.user = &cursor;
614
615 if (file->IsCompressed && !msi_cabextract(package, mi, &data))
616 {
617 ERR("Failed to extract cabinet: %s\n", debugstr_w(mi->cabinet));
619 goto done;
620 }
621 }
622
623 if (!file->IsCompressed)
624 {
626
627 TRACE("copying %s to %s\n", debugstr_w(source), debugstr_w(file->TargetPath));
628
629 if (!is_global_assembly)
630 {
631 create_folder(package, file->Component->Directory);
632 }
633 rc = copy_install_file(package, file, source);
634 if (rc != ERROR_SUCCESS)
635 {
636 ERR("Failed to copy %s to %s (%u)\n", debugstr_w(source), debugstr_w(file->TargetPath), rc);
638 free(source);
639 goto done;
640 }
641 if (!is_global_assembly) file->state = msifs_installed;
642 free(source);
643 }
644 else if (!is_global_assembly && file->state != msifs_installed &&
645 !(file->Attributes & msidbFileAttributesPatchAdded))
646 {
647 ERR("compressed file wasn't installed (%s)\n", debugstr_w(file->File));
649 goto done;
650 }
651 }
652
653done:
655 return rc;
656}
#define ERR(fmt,...)
Definition: precomp.h:57
BOOL msi_is_global_assembly(MSICOMPONENT *comp)
Definition: action.c:2035
UINT msi_set_sourcedir_props(MSIPACKAGE *package, BOOL replace)
Definition: action.c:348
WCHAR * msi_resolve_file_source(MSIPACKAGE *package, MSIFILE *file)
Definition: files.c:536
static BOOL installfiles_cb(MSIPACKAGE *package, LPCWSTR filename, DWORD action, LPWSTR *path, DWORD *attrs, PVOID user)
Definition: files.c:505
static void schedule_install_files(MSIPACKAGE *package)
Definition: files.c:387
static UINT copy_install_file(MSIPACKAGE *package, MSIFILE *file, LPWSTR source)
Definition: files.c:416
static void file_update_ui(MSIPACKAGE *package, MSIFILE *f, const WCHAR *action)
Definition: files.c:251
static UINT create_folder(MSIPACKAGE *package, const WCHAR *dir)
Definition: files.c:475
UINT ready_media(MSIPACKAGE *package, BOOL compressed, MSIMEDIAINFO *mi)
Definition: media.c:838
void msi_free_media_info(MSIMEDIAINFO *mi)
Definition: media.c:649
BOOL msi_cabextract(MSIPACKAGE *package, MSIMEDIAINFO *mi, LPVOID data)
Definition: media.c:640
UINT msi_load_media_info(MSIPACKAGE *package, UINT Sequence, MSIMEDIAINFO *mi)
Definition: media.c:677
unsigned int BOOL
Definition: ntddk_ex.h:94
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
static MONITORINFO mi
Definition: win.c:9400
@ msidbFileAttributesPatchAdded
Definition: msidefs.h:37
#define calloc
Definition: rosglue.h:14
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
Definition: list.h:236
Definition: fci.c:123
struct list files
Definition: msipriv.h:416
#define ERROR_INSTALL_FAILURE
Definition: winerror.h:1309
#define ERROR_FUNCTION_FAILED
Definition: winerror.h:1333

◆ ACTION_MoveFiles()

UINT ACTION_MoveFiles ( MSIPACKAGE *  package)

Definition at line 1185 of file files.c.

1186{
1187 MSIQUERY *view;
1188 UINT rc;
1189
1190 if (package->script == SCRIPT_NONE)
1191 return msi_schedule_action(package, SCRIPT_INSTALL, L"MoveFiles");
1192
1193 rc = MSI_DatabaseOpenViewW(package->db, L"SELECT * FROM `MoveFile`", &view);
1194 if (rc != ERROR_SUCCESS)
1195 return ERROR_SUCCESS;
1196
1198 msiobj_release(&view->hdr);
1199 return rc;
1200}
static UINT ITERATE_MoveFiles(MSIRECORD *rec, LPVOID param)
Definition: files.c:1059

◆ ACTION_MsiPublishAssemblies()

UINT ACTION_MsiPublishAssemblies ( MSIPACKAGE *  package)

Definition at line 542 of file assembly.c.

543{
544 MSICOMPONENT *comp;
545
546 if (package->script == SCRIPT_NONE)
547 return msi_schedule_action(package, SCRIPT_INSTALL, L"MsiPublishAssemblies");
548
550 {
551 LONG res;
552 HKEY hkey;
553 GUID guid;
554 DWORD size;
555 WCHAR buffer[43];
556 MSIRECORD *uirow;
558 BOOL win32;
559
560 if (!assembly || !comp->ComponentId) continue;
561
562 comp->Action = msi_get_component_action( package, comp );
563 if (comp->Action != INSTALLSTATE_LOCAL)
564 {
565 TRACE("component not scheduled for installation %s\n", debugstr_w(comp->Component));
566 continue;
567 }
568 TRACE("publishing %s\n", debugstr_w(comp->Component));
569
570 CLSIDFromString( package->ProductCode, &guid );
572 buffer[20] = '>';
575 buffer[42] = 0;
576
577 win32 = assembly->attributes & msidbAssemblyAttributesWin32;
578 if (assembly->application)
579 {
580 MSIFILE *file = msi_get_loaded_file( package, assembly->application );
581 if (!file)
582 {
583 WARN("no matching file %s for local assembly\n", debugstr_w(assembly->application));
584 continue;
585 }
586 if ((res = open_local_assembly_key( package->Context, win32, file->TargetPath, &hkey )))
587 {
588 WARN( "failed to open local assembly key %ld\n", res );
590 }
591 }
592 else
593 {
594 if ((res = open_global_assembly_key( package->Context, win32, &hkey )))
595 {
596 WARN( "failed to open global assembly key %ld\n", res );
598 }
599 }
600 size = sizeof(buffer);
601 if ((res = RegSetValueExW( hkey, assembly->display_name, 0, REG_MULTI_SZ, (const BYTE *)buffer, size )))
602 {
603 WARN( "failed to set assembly value %ld\n", res );
604 }
605 RegCloseKey( hkey );
606
607 uirow = MSI_CreateRecord( 2 );
608 MSI_RecordSetStringW( uirow, 2, assembly->display_name );
610 msiobj_release( &uirow->hdr );
611 }
612 return ERROR_SUCCESS;
613}
LONG WINAPI RegSetValueExW(_In_ HKEY hKey, _In_ LPCWSTR lpValueName, _In_ DWORD Reserved, _In_ DWORD dwType, _In_ CONST BYTE *lpData, _In_ DWORD cbData)
Definition: reg.c:4882
HRESULT WINAPI CLSIDFromString(LPCOLESTR str, LPCLSID clsid)
Definition: combase.c:1470
GUID guid
Definition: version.c:147
INSTALLSTATE msi_get_component_action(MSIPACKAGE *package, MSICOMPONENT *comp)
Definition: action.c:608
MSIFILE * msi_get_loaded_file(MSIPACKAGE *package, const WCHAR *key)
Definition: action.c:571
unsigned long DWORD
Definition: ntddk_ex.h:95
GLuint res
Definition: glext.h:9613
GLsizeiptr size
Definition: glext.h:5919
static LONG open_local_assembly_key(UINT context, BOOL win32, const WCHAR *filename, HKEY *hkey)
Definition: assembly.c:482
static LONG open_global_assembly_key(UINT context, BOOL win32, HKEY *hkey)
Definition: assembly.c:522
@ INSTALLMESSAGE_ACTIONDATA
Definition: msi.h:103
@ INSTALLSTATE_LOCAL
Definition: msi.h:46
@ msidbAssemblyAttributesWin32
Definition: msidefs.h:216
BOOL encode_base85_guid(GUID *, LPWSTR)
Definition: registry.c:165
INT MSI_ProcessMessage(MSIPACKAGE *, INSTALLMESSAGE, MSIRECORD *)
Definition: package.c:1941
UINT MSI_RecordSetStringW(MSIRECORD *, UINT, LPCWSTR)
Definition: record.c:597
MSIRECORD * MSI_CreateRecord(UINT)
Definition: record.c:76
#define REG_MULTI_SZ
Definition: nt_native.h:1504
long LONG
Definition: pedump.c:60
LPWSTR Component
Definition: msipriv.h:538
INSTALLSTATE Action
Definition: msipriv.h:546
LPWSTR ComponentId
Definition: msipriv.h:539
MSIASSEMBLY * assembly
Definition: msipriv.h:554
struct list components
Definition: msipriv.h:414
MSIINSTALLCONTEXT Context
Definition: msipriv.h:473
MSIOBJECTHDR hdr
Definition: msipriv.h:151
unsigned char BYTE
Definition: xxhash.c:193

◆ ACTION_MsiUnpublishAssemblies()

UINT ACTION_MsiUnpublishAssemblies ( MSIPACKAGE *  package)

Definition at line 615 of file assembly.c.

616{
617 MSICOMPONENT *comp;
618
619 if (package->script == SCRIPT_NONE)
620 return msi_schedule_action(package, SCRIPT_INSTALL, L"MsiUnpublishAssemblies");
621
623 {
624 LONG res;
625 MSIRECORD *uirow;
627 BOOL win32;
628
629 if (!assembly || !comp->ComponentId) continue;
630
631 comp->Action = msi_get_component_action( package, comp );
632 if (comp->Action != INSTALLSTATE_ABSENT)
633 {
634 TRACE("component not scheduled for removal %s\n", debugstr_w(comp->Component));
635 continue;
636 }
637 TRACE("unpublishing %s\n", debugstr_w(comp->Component));
638
639 win32 = assembly->attributes & msidbAssemblyAttributesWin32;
640 if (assembly->application)
641 {
642 MSIFILE *file = msi_get_loaded_file( package, assembly->application );
643 if (!file)
644 {
645 WARN("no matching file %s for local assembly\n", debugstr_w(assembly->application));
646 continue;
647 }
648 if ((res = delete_local_assembly_key( package->Context, win32, file->TargetPath )))
649 WARN( "failed to delete local assembly key %ld\n", res );
650 }
651 else
652 {
653 HKEY hkey;
654 if ((res = open_global_assembly_key( package->Context, win32, &hkey )))
655 WARN( "failed to delete global assembly key %ld\n", res );
656 else
657 {
658 if ((res = RegDeleteValueW( hkey, assembly->display_name )))
659 WARN( "failed to delete global assembly value %ld\n", res );
660 RegCloseKey( hkey );
661 }
662 }
663
664 uirow = MSI_CreateRecord( 2 );
665 MSI_RecordSetStringW( uirow, 2, assembly->display_name );
667 msiobj_release( &uirow->hdr );
668 }
669 return ERROR_SUCCESS;
670}
LONG WINAPI RegDeleteValueW(HKEY hKey, LPCWSTR lpValueName)
Definition: reg.c:2330
static LONG delete_local_assembly_key(UINT context, BOOL win32, const WCHAR *filename)
Definition: assembly.c:502
@ INSTALLSTATE_ABSENT
Definition: msi.h:45

◆ ACTION_PatchFiles()

UINT ACTION_PatchFiles ( MSIPACKAGE *  package)

Definition at line 776 of file files.c.

777{
778 MSIFILEPATCH *patch;
780 UINT rc = ERROR_SUCCESS;
781
782 TRACE("%p\n", package);
783
784 if (package->script == SCRIPT_NONE)
785 return msi_schedule_action(package, SCRIPT_INSTALL, L"PatchFiles");
786
787 mi = calloc( 1, sizeof(MSIMEDIAINFO) );
788
789 TRACE("extracting files\n");
790
792 {
793 MSIFILE *file = patch->File;
794 MSICOMPONENT *comp = file->Component;
795
796 rc = msi_load_media_info( package, patch->Sequence, mi );
797 if (rc != ERROR_SUCCESS)
798 {
799 ERR("Unable to load media info for %s (%u)\n", debugstr_w(file->File), rc);
801 goto done;
802 }
803 comp->Action = msi_get_component_action( package, comp );
804 if (!comp->Enabled || comp->Action != INSTALLSTATE_LOCAL) continue;
805
806 if (!patch->extracted)
807 {
809 MSIFILEPATCH *cursor = patch;
810
811 rc = ready_media( package, TRUE, mi );
812 if (rc != ERROR_SUCCESS)
813 {
814 ERR("Failed to ready media for %s\n", debugstr_w(file->File));
815 goto done;
816 }
817 data.mi = mi;
818 data.package = package;
819 data.cb = patchfiles_cb;
820 data.user = &cursor;
821
822 if (!msi_cabextract( package, mi, &data ))
823 {
824 ERR("Failed to extract cabinet: %s\n", debugstr_w(mi->cabinet));
826 goto done;
827 }
828 }
829 }
830
831 TRACE("applying patches\n");
832
834 {
835 MSICOMPONENT *comp = patch->File->Component;
836
837 if (msi_is_global_assembly( comp ) || !patch->path) continue;
838
839 rc = patch_file( package, patch );
840 if (rc && !(patch->Attributes & msidbPatchAttributesNonVital))
841 {
842 ERR("Failed to apply patch to file: %s\n", debugstr_w(patch->File->File));
843 break;
844 }
845 }
846
847done:
849 return rc;
850}
static UINT patch_file(MSIPACKAGE *package, MSIFILEPATCH *patch)
Definition: files.c:704
static BOOL patchfiles_cb(MSIPACKAGE *package, LPCWSTR file, DWORD action, LPWSTR *path, DWORD *attrs, PVOID user)
Definition: files.c:670
@ msidbPatchAttributesNonVital
Definition: msidefs.h:43
MSIFILE * File
Definition: msipriv.h:640
BOOL extracted
Definition: msipriv.h:644
WCHAR * path
Definition: msipriv.h:646
LPWSTR File
Definition: msipriv.h:620
MSICOMPONENT * Component
Definition: msipriv.h:621
struct list filepatches
Definition: msipriv.h:417

◆ ACTION_PerformAction()

UINT ACTION_PerformAction ( MSIPACKAGE *  package,
const WCHAR *  action 
)

Definition at line 7837 of file action.c.

7838{
7839 UINT rc;
7840
7841 TRACE("Performing action (%s)\n", debugstr_w(action));
7842
7843 package->action_progress_increment = 0;
7844 rc = ACTION_HandleStandardAction(package, action);
7845
7846 if (rc == ERROR_FUNCTION_NOT_CALLED)
7847 rc = ACTION_HandleCustomAction(package, action);
7848
7849 if (rc == ERROR_FUNCTION_NOT_CALLED)
7850 WARN("unhandled msi action %s\n", debugstr_w(action));
7851
7852 return rc;
7853}
static UINT ACTION_HandleStandardAction(MSIPACKAGE *package, LPCWSTR action)
Definition: action.c:7794
static UINT ACTION_HandleCustomAction(MSIPACKAGE *package, LPCWSTR action)
Definition: action.c:511
UINT action_progress_increment
Definition: msipriv.h:427

Referenced by ACTION_ExecuteAction(), ACTION_PerformEndAction(), event_do_action(), execute_script(), ITERATE_Actions(), MSI_InstallPackage(), MsiCollectUserInfoA(), MsiCollectUserInfoW(), MsiConfigureFeatureW(), and MsiDoActionW().

◆ ACTION_RegisterClassInfo()

UINT ACTION_RegisterClassInfo ( MSIPACKAGE *  package)

Definition at line 690 of file classes.c.

691{
693 MSIRECORD *uirow;
694 HKEY hkey, hkey2, hkey3;
695 MSICLASS *cls;
696 UINT r;
697
698 if (package->script == SCRIPT_NONE)
699 return msi_schedule_action( package, SCRIPT_INSTALL, L"RegisterClassInfo" );
700
701 r = load_classes_and_such( package );
702 if (r != ERROR_SUCCESS)
703 return r;
704
705 if (package->platform == PLATFORM_INTEL)
707 else
709
710 if (RegCreateKeyExW( HKEY_CLASSES_ROOT, L"CLSID", 0, NULL, 0, access, NULL, &hkey, NULL ))
712
713 LIST_FOR_EACH_ENTRY( cls, &package->classes, MSICLASS, entry )
714 {
715 MSICOMPONENT *comp;
716 MSIFILE *file;
717 DWORD size;
718 LPWSTR argument;
720
721 comp = cls->Component;
722 if ( !comp )
723 continue;
724
725 if (!comp->Enabled)
726 {
727 TRACE("component is disabled\n");
728 continue;
729 }
730
731 feature = cls->Feature;
732 if (!feature)
733 continue;
734
735 feature->Action = msi_get_feature_action( package, feature );
736 if (feature->Action != INSTALLSTATE_LOCAL &&
738 {
739 TRACE("feature %s not scheduled for installation, skipping registration of class %s\n",
740 debugstr_w(feature->Feature), debugstr_w(cls->clsid));
741 continue;
742 }
743
744 if (!comp->KeyPath || !(file = msi_get_loaded_file( package, comp->KeyPath )))
745 {
746 TRACE("COM server not provided, skipping class %s\n", debugstr_w(cls->clsid));
747 continue;
748 }
749 TRACE("Registering class %s (%p)\n", debugstr_w(cls->clsid), cls);
750
752
753 RegCreateKeyW( hkey, cls->clsid, &hkey2 );
754
755 if (cls->Description)
756 msi_reg_set_val_str( hkey2, NULL, cls->Description );
757
758 RegCreateKeyW( hkey2, cls->Context, &hkey3 );
759
760 /*
761 * FIXME: Implement install on demand (advertised components).
762 *
763 * ole32.dll should call msi.MsiProvideComponentFromDescriptor()
764 * when it needs an InProcServer that doesn't exist.
765 * The component advertise string should be in the "InProcServer" value.
766 */
767 size = lstrlenW( file->TargetPath )+1;
768 if (cls->Argument)
769 size += lstrlenW(cls->Argument)+1;
770
771 argument = malloc( size * sizeof(WCHAR) );
772 lstrcpyW( argument, file->TargetPath );
773
774 if (cls->Argument)
775 {
776 lstrcatW( argument, L" " );
777 lstrcatW( argument, cls->Argument );
778 }
779
780 msi_reg_set_val_str( hkey3, NULL, argument );
781 free(argument);
782
783 RegCloseKey(hkey3);
784
785 if (cls->ProgID || cls->ProgIDText)
786 {
788
789 if (cls->ProgID)
790 progid = cls->ProgID->ProgID;
791 else
792 progid = cls->ProgIDText;
793
794 msi_reg_set_subkey_val( hkey2, L"ProgID", NULL, progid );
795
796 if (cls->ProgID && cls->ProgID->VersionInd)
797 {
798 msi_reg_set_subkey_val( hkey2, L"VersionIndependentProgID", NULL,
799 cls->ProgID->VersionInd->ProgID );
800 }
801 }
802
803 if (cls->AppID)
804 {
805 MSIAPPID *appid = cls->AppID;
806 msi_reg_set_val_str( hkey2, L"AppID", appid->AppID );
808 }
809
810 if (cls->IconPath)
811 msi_reg_set_subkey_val( hkey2, L"DefaultIcon", NULL, cls->IconPath );
812
813 if (cls->DefInprocHandler)
814 msi_reg_set_subkey_val( hkey2, L"InprocHandler", NULL, cls->DefInprocHandler );
815
816 if (cls->DefInprocHandler32)
817 msi_reg_set_subkey_val( hkey2, L"InprocHandler32", NULL, cls->DefInprocHandler32 );
818 RegCloseKey(hkey2);
819
820 /* if there is a FileTypeMask, register the FileType */
821 if (cls->FileTypeMask)
822 {
823 LPWSTR ptr, ptr2;
824 LPWSTR keyname;
825 INT index = 0;
826 ptr = cls->FileTypeMask;
827 while (ptr && *ptr)
828 {
829 ptr2 = wcschr(ptr,';');
830 if (ptr2)
831 *ptr2 = 0;
832 keyname = malloc( sizeof(L"FileType\\%s\\%d") + (wcslen(cls->clsid) + 3) * sizeof(WCHAR) );
833 swprintf( keyname, lstrlenW(L"FileType\\%s\\%d") + lstrlenW(cls->clsid) + 4,
834 L"FileType\\%s\\%d", cls->clsid, index );
835
837 free( keyname );
838
839 if (ptr2)
840 ptr = ptr2+1;
841 else
842 ptr = NULL;
843
844 index ++;
845 }
846 }
847
848 uirow = MSI_CreateRecord(1);
849 MSI_RecordSetStringW( uirow, 1, cls->clsid );
851 msiobj_release(&uirow->hdr);
852 }
853 RegCloseKey(hkey);
854 return ERROR_SUCCESS;
855}
LONG WINAPI RegCreateKeyExW(_In_ HKEY hKey, _In_ LPCWSTR lpSubKey, _In_ DWORD Reserved, _In_opt_ LPWSTR lpClass, _In_ DWORD dwOptions, _In_ REGSAM samDesired, _In_opt_ LPSECURITY_ATTRIBUTES lpSecurityAttributes, _Out_ PHKEY phkResult, _Out_opt_ LPDWORD lpdwDisposition)
Definition: reg.c:1096
#define wcschr
Definition: compat.h:17
#define lstrcpyW
Definition: compat.h:749
#define lstrlenW
Definition: compat.h:750
INSTALLSTATE msi_get_feature_action(MSIPACKAGE *package, MSIFEATURE *feature)
Definition: action.c:624
_ACRTIMP size_t __cdecl wcslen(const wchar_t *)
Definition: wcs.c:2988
#define progid(str)
Definition: exdisp.idl:31
GLuint index
Definition: glext.h:6031
GLuint GLint GLboolean GLint GLenum access
Definition: glext.h:7866
LPWSTR WINAPI lstrcatW(LPWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:274
char * appid
Definition: mkisofs.c:161
INTERNETFEATURELIST feature
Definition: misc.c:1807
static UINT load_classes_and_such(MSIPACKAGE *package)
Definition: classes.c:631
static UINT register_appid(const MSIAPPID *appid, LPCWSTR app)
Definition: classes.c:659
@ INSTALLSTATE_ADVERTISED
Definition: msi.h:44
LONG msi_reg_set_subkey_val(HKEY hkey, LPCWSTR path, LPCWSTR name, LPCWSTR val)
Definition: registry.c:230
#define KEY_ALL_ACCESS
Definition: nt_native.h:1044
LPWSTR clsid
Definition: msipriv.h:666
LPWSTR IconPath
Definition: msipriv.h:674
LPWSTR Argument
Definition: msipriv.h:677
LPWSTR ProgIDText
Definition: msipriv.h:670
INSTALLSTATE action
Definition: msipriv.h:681
LPWSTR DefInprocHandler
Definition: msipriv.h:675
MSIAPPID * AppID
Definition: msipriv.h:672
LPWSTR FileTypeMask
Definition: msipriv.h:673
LPWSTR Description
Definition: msipriv.h:671
LPWSTR DefInprocHandler32
Definition: msipriv.h:676
LPWSTR Context
Definition: msipriv.h:667
MSICOMPONENT * Component
Definition: msipriv.h:668
MSIFEATURE * Feature
Definition: msipriv.h:678
MSIPROGID * ProgID
Definition: msipriv.h:669
LPWSTR KeyPath
Definition: msipriv.h:543
struct list classes
Definition: msipriv.h:440
enum platform platform
Definition: msipriv.h:409
LPWSTR ProgID
Definition: msipriv.h:703
MSIPROGID * VersionInd
Definition: msipriv.h:710
const uint16_t * LPCWSTR
Definition: typedefs.h:57
int32_t INT
Definition: typedefs.h:58
ACCESS_MASK REGSAM
Definition: winreg.h:76
#define HKEY_CLASSES_ROOT
Definition: winreg.h:10
#define KEY_WOW64_32KEY
Definition: cmtypes.h:45
#define KEY_WOW64_64KEY
Definition: cmtypes.h:46

◆ ACTION_RegisterExtensionInfo()

UINT ACTION_RegisterExtensionInfo ( MSIPACKAGE *  package)

Definition at line 1196 of file classes.c.

1197{
1198 HKEY hkey = NULL;
1200 MSIRECORD *uirow;
1201 BOOL install_on_demand = TRUE;
1202 LONG res;
1203 UINT r;
1204
1205 if (package->script == SCRIPT_NONE)
1206 return msi_schedule_action( package, SCRIPT_INSTALL, L"RegisterExtensionInfo" );
1207
1208 r = load_classes_and_such( package );
1209 if (r != ERROR_SUCCESS)
1210 return r;
1211
1212 /* We need to set install_on_demand based on if the shell handles advertised
1213 * shortcuts and the like. Because Mike McCormack is working on this i am
1214 * going to default to TRUE
1215 */
1216
1218 {
1219 LPWSTR extension;
1221
1222 if (!ext->Component)
1223 continue;
1224
1225 if (!ext->Component->Enabled)
1226 {
1227 TRACE("component is disabled\n");
1228 continue;
1229 }
1230
1231 feature = ext->Feature;
1232 if (!feature)
1233 continue;
1234
1235 /*
1236 * yes. MSDN says that these are based on _Feature_ not on
1237 * Component. So verify the feature is to be installed
1238 */
1239 feature->Action = msi_get_feature_action( package, feature );
1240 if (feature->Action != INSTALLSTATE_LOCAL &&
1241 !(install_on_demand && feature->Action == INSTALLSTATE_ADVERTISED))
1242 {
1243 TRACE("feature %s not scheduled for installation, skipping registration of extension %s\n",
1244 debugstr_w(feature->Feature), debugstr_w(ext->Extension));
1245 continue;
1246 }
1247 TRACE("Registering extension %s (%p)\n", debugstr_w(ext->Extension), ext);
1248
1249 ext->action = INSTALLSTATE_LOCAL;
1250
1251 extension = malloc( (wcslen( ext->Extension ) + 2) * sizeof(WCHAR) );
1252 if (extension)
1253 {
1254 extension[0] = '.';
1255 lstrcpyW( extension + 1, ext->Extension );
1256 res = RegCreateKeyW( HKEY_CLASSES_ROOT, extension, &hkey );
1257 free( extension );
1258 if (res != ERROR_SUCCESS)
1259 WARN("failed to create extension key %ld\n", res);
1260 }
1261
1262 if (ext->Mime)
1263 msi_reg_set_val_str( hkey, L"Content Type", ext->Mime->ContentType );
1264
1265 if (ext->ProgID || ext->ProgIDText)
1266 {
1267 HKEY hkey2;
1268 LPWSTR newkey;
1270 MSIVERB *verb;
1271 INT Sequence = MSI_NULL_INTEGER;
1272
1273 if (ext->ProgID)
1274 progid = ext->ProgID->ProgID;
1275 else
1276 progid = ext->ProgIDText;
1277
1279
1280 newkey = malloc( wcslen(progid) * sizeof(WCHAR) + sizeof(L"\\ShellNew") );
1281
1282 lstrcpyW(newkey, progid);
1283 lstrcatW(newkey, L"\\ShellNew");
1284 RegCreateKeyW(hkey, newkey, &hkey2);
1285 RegCloseKey(hkey2);
1286
1287 free(newkey);
1288
1289 /* do all the verbs */
1290 LIST_FOR_EACH_ENTRY( verb, &ext->verbs, MSIVERB, entry )
1291 {
1292 register_verb( package, progid, ext->Component,
1293 ext, verb, &Sequence);
1294 }
1295 }
1296
1297 RegCloseKey(hkey);
1298
1299 uirow = MSI_CreateRecord(1);
1300 MSI_RecordSetStringW( uirow, 1, ext->Extension );
1302 msiobj_release(&uirow->hdr);
1303 }
1304 return ERROR_SUCCESS;
1305}
static const WCHAR *const ext[]
Definition: module.c:53
static UINT register_verb(MSIPACKAGE *package, LPCWSTR progid, MSICOMPONENT *component, const MSIEXTENSION *extension, MSIVERB *verb, INT *Sequence)
Definition: classes.c:1124
#define MSI_NULL_INTEGER
Definition: msiquery.h:32
struct list extensions
Definition: msipriv.h:441

◆ ACTION_RegisterFonts()

UINT ACTION_RegisterFonts ( MSIPACKAGE *  package)

Definition at line 279 of file font.c.

280{
281 MSIQUERY *view;
282 UINT rc;
283
284 if (package->script == SCRIPT_NONE)
285 return msi_schedule_action(package, SCRIPT_INSTALL, L"RegisterFonts");
286
287 rc = MSI_DatabaseOpenViewW(package->db, L"SELECT * FROM `Font`", &view);
288 if (rc != ERROR_SUCCESS)
289 return ERROR_SUCCESS;
290
292 msiobj_release(&view->hdr);
293 return rc;
294}
static UINT ITERATE_RegisterFonts(MSIRECORD *row, LPVOID param)
Definition: font.c:215

◆ ACTION_RegisterMIMEInfo()

UINT ACTION_RegisterMIMEInfo ( MSIPACKAGE *  package)

Definition at line 1392 of file classes.c.

1393{
1394 MSIRECORD *uirow;
1395 MSIMIME *mt;
1396 UINT r;
1397
1398 if (package->script == SCRIPT_NONE)
1399 return msi_schedule_action( package, SCRIPT_INSTALL, L"RegisterMIMEInfo" );
1400
1401 r = load_classes_and_such( package );
1402 if (r != ERROR_SUCCESS)
1403 return r;
1404
1405 LIST_FOR_EACH_ENTRY( mt, &package->mimes, MSIMIME, entry )
1406 {
1407 LPWSTR extension = NULL, key;
1408
1409 /*
1410 * check if the MIME is to be installed. Either as requested by an
1411 * extension or Class
1412 */
1413 if ((!mt->Class || mt->Class->action != INSTALLSTATE_LOCAL) &&
1414 (!mt->Extension || mt->Extension->action != INSTALLSTATE_LOCAL))
1415 {
1416 TRACE("MIME %s not scheduled to be installed\n", debugstr_w(mt->ContentType));
1417 continue;
1418 }
1419
1420 TRACE("Registering MIME type %s\n", debugstr_w(mt->ContentType));
1421
1422 if (mt->Extension) extension = malloc( (wcslen( mt->Extension->Extension ) + 2) * sizeof(WCHAR) );
1423 key = malloc( sizeof( L"MIME\\Database\\Content Type\\" ) +
1424 wcslen( mt->ContentType ) * sizeof(WCHAR) );
1425
1426 if (extension && key)
1427 {
1428 extension[0] = '.';
1429 lstrcpyW( extension + 1, mt->Extension->Extension );
1430
1431 lstrcpyW( key, L"MIME\\Database\\Content Type\\" );
1432 lstrcatW( key, mt->ContentType );
1433 msi_reg_set_subkey_val( HKEY_CLASSES_ROOT, key, L"Extension", extension );
1434
1435 if (mt->clsid)
1437 }
1438 free( extension );
1439 free( key );
1440
1441 uirow = MSI_CreateRecord( 2 );
1442 MSI_RecordSetStringW( uirow, 1, mt->ContentType );
1443 MSI_RecordSetStringW( uirow, 2, mt->suffix );
1445 msiobj_release( &uirow->hdr );
1446 }
1447 return ERROR_SUCCESS;
1448}
Definition: copy.c:22
INSTALLSTATE action
Definition: msipriv.h:696
LPWSTR Extension
Definition: msipriv.h:689
MSIEXTENSION * Extension
Definition: msipriv.h:726
LPWSTR ContentType
Definition: msipriv.h:725
LPWSTR clsid
Definition: msipriv.h:728
MSICLASS * Class
Definition: msipriv.h:729
LPWSTR suffix
Definition: msipriv.h:727
struct list mimes
Definition: msipriv.h:443

◆ ACTION_RegisterProgIdInfo()

UINT ACTION_RegisterProgIdInfo ( MSIPACKAGE *  package)

Definition at line 1026 of file classes.c.

1027{
1029 MSIRECORD *uirow;
1030 UINT r;
1031
1032 if (package->script == SCRIPT_NONE)
1033 return msi_schedule_action( package, SCRIPT_INSTALL, L"RegisterProgIdInfo" );
1034
1035 r = load_classes_and_such( package );
1036 if (r != ERROR_SUCCESS)
1037 return r;
1038
1040 {
1042 {
1043 TRACE("progid %s not scheduled to be installed\n", debugstr_w(progid->ProgID));
1044 continue;
1045 }
1046 TRACE("Registering progid %s\n", debugstr_w(progid->ProgID));
1047
1049
1050 uirow = MSI_CreateRecord( 1 );
1051 MSI_RecordSetStringW( uirow, 1, progid->ProgID );
1053 msiobj_release( &uirow->hdr );
1054 }
1055 return ERROR_SUCCESS;
1056}
static BOOL has_class_installed(const MSIPROGID *progid)
Definition: classes.c:1008
static BOOL has_one_extension_installed(const MSIPACKAGE *package, const MSIPROGID *progid)
Definition: classes.c:1015
static UINT register_progid(const MSIPROGID *progid)
Definition: classes.c:964
struct list progids
Definition: msipriv.h:442

◆ ACTION_RemoveDuplicateFiles()

UINT ACTION_RemoveDuplicateFiles ( MSIPACKAGE *  package)

Definition at line 1390 of file files.c.

1391{
1392 MSIQUERY *view;
1393 UINT rc;
1394
1395 if (package->script == SCRIPT_NONE)
1396 return msi_schedule_action(package, SCRIPT_INSTALL, L"RemoveDuplicateFiles");
1397
1398 rc = MSI_DatabaseOpenViewW( package->db, L"SELECT * FROM `DuplicateFile`", &view );
1399 if (rc != ERROR_SUCCESS)
1400 return ERROR_SUCCESS;
1401
1403 msiobj_release( &view->hdr );
1404 return rc;
1405}
static UINT ITERATE_RemoveDuplicateFiles(MSIRECORD *row, LPVOID param)
Definition: files.c:1332

◆ ACTION_RemoveFiles()

UINT ACTION_RemoveFiles ( MSIPACKAGE *  package)

Definition at line 1528 of file files.c.

1529{
1530 MSIQUERY *view;
1531 MSICOMPONENT *comp;
1532 MSIFILE *file;
1533 UINT r;
1534
1535 if (package->script == SCRIPT_NONE)
1536 return msi_schedule_action(package, SCRIPT_INSTALL, L"RemoveFiles");
1537
1538 r = MSI_DatabaseOpenViewW(package->db, L"SELECT * FROM `RemoveFile`", &view);
1539 if (r == ERROR_SUCCESS)
1540 {
1542 msiobj_release(&view->hdr);
1543 if (r != ERROR_SUCCESS)
1544 return r;
1545 }
1546
1548 {
1549 MSIRECORD *uirow;
1550 VS_FIXEDFILEINFO *ver;
1551
1552 comp = file->Component;
1553 file_update_ui( package, file, L"RemoveFiles" );
1554
1555 comp->Action = msi_get_component_action( package, comp );
1557 continue;
1558
1559 if (comp->assembly && !comp->assembly->application)
1560 continue;
1561
1563 {
1564 TRACE("permanent component, not removing file\n");
1565 continue;
1566 }
1567
1568 if (file->Version)
1569 {
1570 ver = msi_get_disk_file_version( package, file->TargetPath );
1571 if (ver && msi_compare_file_versions( ver, file->Version ) > 0)
1572 {
1573 TRACE("newer version detected, not removing file\n");
1574 free( ver );
1575 continue;
1576 }
1577 free( ver );
1578 }
1579
1580 if (file->state == msifs_installed)
1581 WARN("removing installed file %s\n", debugstr_w(file->TargetPath));
1582
1583 TRACE("removing %s\n", debugstr_w(file->File) );
1584
1585 msi_set_file_attributes( package, file->TargetPath, FILE_ATTRIBUTE_NORMAL );
1586 if (!msi_delete_file( package, file->TargetPath ))
1587 {
1588 WARN( "failed to delete %s (%lu)\n", debugstr_w(file->TargetPath), GetLastError() );
1589 }
1590 file->state = msifs_missing;
1591
1592 uirow = MSI_CreateRecord( 9 );
1593 MSI_RecordSetStringW( uirow, 1, file->FileName );
1594 MSI_RecordSetStringW( uirow, 9, comp->Directory );
1596 msiobj_release( &uirow->hdr );
1597 }
1598
1600 {
1601 comp->Action = msi_get_component_action( package, comp );
1602 if (comp->Action != INSTALLSTATE_ABSENT) continue;
1603
1605 {
1606 TRACE("permanent component, not removing directory\n");
1607 continue;
1608 }
1609 if (comp->assembly && !comp->assembly->application)
1610 msi_uninstall_assembly( package, comp );
1611 else
1612 {
1613 MSIFOLDER *folder = msi_get_loaded_folder( package, comp->Directory );
1614 if (folder) remove_folder( folder );
1615 }
1616 }
1617 return ERROR_SUCCESS;
1618}
#define FILE_ATTRIBUTE_NORMAL
Definition: compat.h:137
int msi_compare_file_versions(VS_FIXEDFILEINFO *fi, const WCHAR *version)
Definition: action.c:1928
MSIFOLDER * msi_get_loaded_folder(MSIPACKAGE *package, const WCHAR *dir)
Definition: action.c:582
BOOL msi_set_file_attributes(MSIPACKAGE *package, const WCHAR *filename, DWORD attrs)
Definition: files.c:106
BOOL msi_delete_file(MSIPACKAGE *package, const WCHAR *filename)
Definition: files.c:79
VS_FIXEDFILEINFO * msi_get_disk_file_version(MSIPACKAGE *package, const WCHAR *filename)
Definition: files.c:170
static UINT ITERATE_RemoveFiles(MSIRECORD *row, LPVOID param)
Definition: files.c:1431
static void remove_folder(MSIFOLDER *folder)
Definition: files.c:1514
UINT msi_uninstall_assembly(MSIPACKAGE *package, MSICOMPONENT *comp)
Definition: assembly.c:402
@ INSTALLSTATE_SOURCE
Definition: msi.h:47
@ msidbComponentAttributesPermanent
Definition: msidefs.h:164
Definition: fci.c:112
LPWSTR application
Definition: msipriv.h:528
INSTALLSTATE Installed
Definition: msipriv.h:544
LPWSTR Directory
Definition: msipriv.h:540
DWORD WINAPI GetLastError(void)
Definition: except.c:1042

◆ ACTION_ShowDialog()

INT ACTION_ShowDialog ( MSIPACKAGE *  ,
LPCWSTR   
)

◆ ACTION_UnregisterClassInfo()

UINT ACTION_UnregisterClassInfo ( MSIPACKAGE *  package)

Definition at line 857 of file classes.c.

858{
860 MSIRECORD *uirow;
861 MSICLASS *cls;
862 HKEY hkey, hkey2;
863 UINT r;
864
865 if (package->script == SCRIPT_NONE)
866 return msi_schedule_action( package, SCRIPT_INSTALL, L"UnregisterClassInfo" );
867
868 r = load_classes_and_such( package );
869 if (r != ERROR_SUCCESS)
870 return r;
871
872 if (package->platform == PLATFORM_INTEL)
874 else
876
877 if (RegCreateKeyExW( HKEY_CLASSES_ROOT, L"CLSID", 0, NULL, 0, access, NULL, &hkey, NULL ))
879
880 LIST_FOR_EACH_ENTRY( cls, &package->classes, MSICLASS, entry )
881 {
883 MSICOMPONENT *comp;
885 LONG res;
886
887 comp = cls->Component;
888 if (!comp)
889 continue;
890
891 if (!comp->Enabled)
892 {
893 TRACE("component is disabled\n");
894 continue;
895 }
896
897 feature = cls->Feature;
898 if (!feature)
899 continue;
900
901 feature->Action = msi_get_feature_action( package, feature );
902 if (feature->Action != INSTALLSTATE_ABSENT)
903 {
904 TRACE("feature %s not scheduled for removal, skipping unregistration of class %s\n",
905 debugstr_w(feature->Feature), debugstr_w(cls->clsid));
906 continue;
907 }
908 TRACE("Unregistering class %s (%p)\n", debugstr_w(cls->clsid), cls);
909
911
912 res = RegDeleteTreeW( hkey, cls->clsid );
913 if (res != ERROR_SUCCESS)
914 WARN("failed to delete class key %ld\n", res);
915
916 if (cls->AppID)
917 {
918 res = RegOpenKeyW( HKEY_CLASSES_ROOT, L"AppID", &hkey2 );
919 if (res == ERROR_SUCCESS)
920 {
921 res = RegDeleteKeyW( hkey2, cls->AppID->AppID );
922 if (res != ERROR_SUCCESS)
923 WARN("failed to delete appid key %ld\n", res);
924 RegCloseKey( hkey2 );
925 }
926 }
927 if (cls->FileTypeMask)
928 {
929 filetype = malloc( sizeof( L"FileType\\" ) + wcslen( cls->clsid ) * sizeof(WCHAR) );
930 if (filetype)
931 {
932 lstrcpyW( filetype, L"FileType\\" );
933 lstrcatW( filetype, cls->clsid );
935 free( filetype );
936
937 if (res != ERROR_SUCCESS)
938 WARN("failed to delete file type %ld\n", res);
939 }
940 }
941
942 uirow = MSI_CreateRecord( 1 );
943 MSI_RecordSetStringW( uirow, 1, cls->clsid );
945 msiobj_release( &uirow->hdr );
946 }
947 RegCloseKey( hkey );
948 return ERROR_SUCCESS;
949}
LSTATUS WINAPI RegDeleteTreeW(_In_ HKEY, _In_opt_ LPCWSTR)
LONG WINAPI RegOpenKeyW(HKEY hKey, LPCWSTR lpSubKey, PHKEY phkResult)
Definition: reg.c:3268
LONG WINAPI RegDeleteKeyW(_In_ HKEY hKey, _In_ LPCWSTR lpSubKey)
Definition: reg.c:1239
LOCAL char * filetype(int t)
Definition: tree.c:114
LPWSTR AppID
Definition: msipriv.h:652

◆ ACTION_UnregisterExtensionInfo()

UINT ACTION_UnregisterExtensionInfo ( MSIPACKAGE *  package)

Definition at line 1307 of file classes.c.

1308{
1310 MSIRECORD *uirow;
1311 LONG res;
1312 UINT r;
1313
1314 if (package->script == SCRIPT_NONE)
1315 return msi_schedule_action( package, SCRIPT_INSTALL, L"UnregisterExtensionInfo" );
1316
1317 r = load_classes_and_such( package );
1318 if (r != ERROR_SUCCESS)
1319 return r;
1320
1322 {
1323 LPWSTR extension;
1325
1326 if (!ext->Component)
1327 continue;
1328
1329 if (!ext->Component->Enabled)
1330 {
1331 TRACE("component is disabled\n");
1332 continue;
1333 }
1334
1335 feature = ext->Feature;
1336 if (!feature)
1337 continue;
1338
1339 feature->Action = msi_get_feature_action( package, feature );
1340 if (feature->Action != INSTALLSTATE_ABSENT)
1341 {
1342 TRACE("feature %s not scheduled for removal, skipping unregistration of extension %s\n",
1343 debugstr_w(feature->Feature), debugstr_w(ext->Extension));
1344 continue;
1345 }
1346 TRACE("Unregistering extension %s\n", debugstr_w(ext->Extension));
1347
1348 ext->action = INSTALLSTATE_ABSENT;
1349
1350 extension = malloc( (wcslen( ext->Extension ) + 2) * sizeof(WCHAR) );
1351 if (extension)
1352 {
1353 extension[0] = '.';
1354 lstrcpyW( extension + 1, ext->Extension );
1355 res = RegDeleteTreeW( HKEY_CLASSES_ROOT, extension );
1356 free( extension );
1357 if (res != ERROR_SUCCESS)
1358 WARN("failed to delete extension key %ld\n", res);
1359 }
1360
1361 if (ext->ProgID || ext->ProgIDText)
1362 {
1364 LPWSTR progid_shell;
1365
1366 if (ext->ProgID)
1367 progid = ext->ProgID->ProgID;
1368 else
1369 progid = ext->ProgIDText;
1370
1371 progid_shell = malloc( wcslen( progid ) * sizeof(WCHAR) + sizeof( L"\\shell" ) );
1372 if (progid_shell)
1373 {
1374 lstrcpyW( progid_shell, progid );
1375 lstrcatW( progid_shell, L"\\shell" );
1376 res = RegDeleteTreeW( HKEY_CLASSES_ROOT, progid_shell );
1377 free( progid_shell );
1378 if (res != ERROR_SUCCESS)
1379 WARN("failed to delete shell key %ld\n", res);
1381 }
1382 }
1383
1384 uirow = MSI_CreateRecord( 1 );
1385 MSI_RecordSetStringW( uirow, 1, ext->Extension );
1387 msiobj_release( &uirow->hdr );
1388 }
1389 return ERROR_SUCCESS;
1390}

◆ ACTION_UnregisterFonts()

UINT ACTION_UnregisterFonts ( MSIPACKAGE *  package)

Definition at line 360 of file font.c.

361{
362 MSIQUERY *view;
363 UINT r;
364
365 if (package->script == SCRIPT_NONE)
366 return msi_schedule_action(package, SCRIPT_INSTALL, L"UnregisterFonts");
367
368 r = MSI_DatabaseOpenViewW( package->db, L"SELECT * FROM `Font`", &view );
369 if (r != ERROR_SUCCESS)
370 return ERROR_SUCCESS;
371
373 msiobj_release( &view->hdr );
374 return r;
375}
static UINT ITERATE_UnregisterFonts(MSIRECORD *row, LPVOID param)
Definition: font.c:296

◆ ACTION_UnregisterMIMEInfo()

UINT ACTION_UnregisterMIMEInfo ( MSIPACKAGE *  package)

Definition at line 1450 of file classes.c.

1451{
1452 MSIRECORD *uirow;
1453 MSIMIME *mime;
1454 UINT r;
1455
1456 if (package->script == SCRIPT_NONE)
1457 return msi_schedule_action( package, SCRIPT_INSTALL, L"UnregisterMIMEInfo" );
1458
1459 r = load_classes_and_such( package );
1460 if (r != ERROR_SUCCESS)
1461 return r;
1462
1464 {
1465 LONG res;
1466 LPWSTR mime_key;
1467
1468 if ((!mime->Class || mime->Class->action != INSTALLSTATE_ABSENT) &&
1469 (!mime->Extension || mime->Extension->action != INSTALLSTATE_ABSENT))
1470 {
1471 TRACE("MIME %s not scheduled to be removed\n", debugstr_w(mime->ContentType));
1472 continue;
1473 }
1474
1475 TRACE("Unregistering MIME type %s\n", debugstr_w(mime->ContentType));
1476
1477 mime_key = malloc( sizeof( L"MIME\\Database\\Content Type\\" ) +
1478 wcslen( mime->ContentType ) * sizeof(WCHAR) );
1479 if (mime_key)
1480 {
1481 lstrcpyW( mime_key, L"MIME\\Database\\Content Type\\" );
1482 lstrcatW( mime_key, mime->ContentType );
1483 res = RegDeleteKeyW( HKEY_CLASSES_ROOT, mime_key );
1484 if (res != ERROR_SUCCESS)
1485 WARN("failed to delete MIME key %ld\n", res);
1486 free( mime_key );
1487 }
1488
1489 uirow = MSI_CreateRecord( 2 );
1490 MSI_RecordSetStringW( uirow, 1, mime->ContentType );
1491 MSI_RecordSetStringW( uirow, 2, mime->suffix );
1493 msiobj_release( &uirow->hdr );
1494 }
1495 return ERROR_SUCCESS;
1496}
const WCHAR * mime
Definition: mimefilter.c:487

◆ ACTION_UnregisterProgIdInfo()

UINT ACTION_UnregisterProgIdInfo ( MSIPACKAGE *  package)

Definition at line 1088 of file classes.c.

1089{
1091 MSIRECORD *uirow;
1092 LONG res;
1093 UINT r;
1094
1095 if (package->script == SCRIPT_NONE)
1096 return msi_schedule_action( package, SCRIPT_INSTALL, L"UnregisterProgIdInfo" );
1097
1098 r = load_classes_and_such( package );
1099 if (r != ERROR_SUCCESS)
1100 return r;
1101
1103 {
1104 if (!has_class_removed( progid ) ||
1105 (has_extensions( package, progid ) && !has_all_extensions_removed( package, progid )))
1106 {
1107 TRACE("progid %s not scheduled to be removed\n", debugstr_w(progid->ProgID));
1108 continue;
1109 }
1110 TRACE("Unregistering progid %s\n", debugstr_w(progid->ProgID));
1111
1113 if (res != ERROR_SUCCESS)
1114 TRACE("failed to delete progid key %ld\n", res);
1115
1116 uirow = MSI_CreateRecord( 1 );
1117 MSI_RecordSetStringW( uirow, 1, progid->ProgID );
1119 msiobj_release( &uirow->hdr );
1120 }
1121 return ERROR_SUCCESS;
1122}
static BOOL has_extensions(const MSIPACKAGE *package, const MSIPROGID *progid)
Definition: classes.c:1065
static BOOL has_all_extensions_removed(const MSIPACKAGE *package, const MSIPROGID *progid)
Definition: classes.c:1075
static BOOL has_class_removed(const MSIPROGID *progid)
Definition: classes.c:1058

◆ ACTION_UpdateComponentStates()

void ACTION_UpdateComponentStates ( MSIPACKAGE *  package,
MSIFEATURE *  feature 
)

Definition at line 833 of file install.c.

834{
835 INSTALLSTATE newstate;
836 ComponentList *cl;
837
838 newstate = feature->ActionRequest;
839 if (newstate == INSTALLSTATE_ABSENT) newstate = INSTALLSTATE_UNKNOWN;
840
842 {
844
845 if (!component->Enabled) continue;
846
847 TRACE("Modifying (%d): Component %s (Installed %d, Action %d, Request %d)\n",
848 newstate, debugstr_w(component->Component), component->Installed,
849 component->Action, component->ActionRequest);
850
851 if (newstate == INSTALLSTATE_LOCAL)
852 {
854 component->ActionRequest = INSTALLSTATE_LOCAL;
855 }
856 else
857 {
858 ComponentList *clist;
859 MSIFEATURE *f;
860
861 component->hasLocalFeature = FALSE;
862
863 component->Action = newstate;
864 component->ActionRequest = newstate;
865 /* if any other feature wants it local we need to set it local */
867 {
868 if ( f->ActionRequest != INSTALLSTATE_LOCAL &&
869 f->ActionRequest != INSTALLSTATE_SOURCE )
870 {
871 continue;
872 }
873 LIST_FOR_EACH_ENTRY(clist, &f->Components, ComponentList, entry)
874 {
875 if (clist->component == component &&
876 (f->ActionRequest == INSTALLSTATE_LOCAL ||
877 f->ActionRequest == INSTALLSTATE_SOURCE))
878 {
879 TRACE("Saved by %s\n", debugstr_w(f->Feature));
880 component->hasLocalFeature = TRUE;
881
883 {
884 if (f->Attributes & msidbFeatureAttributesFavorSource)
885 {
887 component->ActionRequest = INSTALLSTATE_SOURCE;
888 }
889 else
890 {
892 component->ActionRequest = INSTALLSTATE_LOCAL;
893 }
894 }
895 else if (component->Attributes & msidbComponentAttributesSourceOnly)
896 {
898 component->ActionRequest = INSTALLSTATE_SOURCE;
899 }
900 else
901 {
903 component->ActionRequest = INSTALLSTATE_LOCAL;
904 }
905 }
906 }
907 }
908 }
909 TRACE("Result (%d): Component %s (Installed %d, Action %d, Request %d)\n",
910 newstate, debugstr_w(component->Component), component->Installed,
911 component->Action, component->ActionRequest);
912 }
913}
GLfloat f
Definition: glext.h:7540
#define f
Definition: ke_i.h:83
@ INSTALLSTATE_UNKNOWN
Definition: msi.h:42
@ msidbComponentAttributesOptional
Definition: msidefs.h:161
@ msidbComponentAttributesSourceOnly
Definition: msidefs.h:160
@ msidbFeatureAttributesFavorSource
Definition: msidefs.h:149
MSICOMPONENT * component
Definition: msipriv.h:568
struct list features
Definition: msipriv.h:415
int INSTALLSTATE
Definition: winemsi.idl:31

Referenced by MSI_SetFeatureStateW(), and seltree_update_feature_installstate().

◆ alloc_msi_remote_handle()

MSIHANDLE alloc_msi_remote_handle ( MSIHANDLE  remote)

Definition at line 135 of file handle.c.

136{
137 struct handle_info *entry;
139
141
143 if (ret)
144 {
145 entry = &handle_table[ ret - 1 ];
146 entry->u.rem = remote;
147 entry->dwThreadId = GetCurrentThreadId();
148 entry->remote = TRUE;
149 }
150
152
153 TRACE( "%lu -> %lu\n", remote, ret );
154
155 return ret;
156}
static MSIHANDLE alloc_handle_table_entry(void)
Definition: handle.c:80
static CRITICAL_SECTION handle_cs
Definition: handle.c:38
return ret
Definition: mutex.c:147
BOOL remote
Definition: handle.c:60
DWORD WINAPI GetCurrentThreadId(void)
Definition: thread.c:459
unsigned long MSIHANDLE
Definition: winemsi.idl:27

Referenced by __wine_msi_call_dll_function(), MsiDatabaseOpenViewW(), MsiGetActiveDatabase(), and MsiGetSummaryInformationW().

◆ alloc_msihandle()

MSIHANDLE alloc_msihandle ( MSIOBJECTHDR *  obj)

Definition at line 111 of file handle.c.

112{
113 struct handle_info *entry;
115
117
119 if (ret)
120 {
121 entry = &handle_table[ ret - 1 ];
123 entry->u.obj = obj;
124 entry->dwThreadId = GetCurrentThreadId();
125 entry->remote = FALSE;
126 }
127
129
130 TRACE( "%p -> %lu\n", obj, ret );
131
132 return ret;
133}
void msiobj_addref(MSIOBJECTHDR *info)
Definition: handle.c:217
MSIOBJECTHDR * obj
Definition: handle.c:62

Referenced by ACTION_CallScript(), MSI_ProcessMessageVerbatim(), MsiCreateRecord(), MsiDatabaseGetPrimaryKeysW(), MsiDatabaseOpenViewW(), MsiEnableUIPreview(), MsiGetActiveDatabase(), MsiGetSummaryInformationW(), MsiOpenDatabaseW(), MsiOpenPackageExW(), MsiOpenProductW(), MsiViewFetch(), MsiViewGetColumnInfo(), and s_remote_GetActionInfo().

◆ alloc_msiobject()

void * alloc_msiobject ( UINT  type,
UINT  size,
msihandledestructor  destroy 
)

Definition at line 201 of file handle.c.

202{
204
205 info = calloc( 1, size );
206 if( info )
207 {
208 info->magic = MSIHANDLE_MAGIC;
209 info->type = type;
210 info->refcount = 1;
211 info->destructor = destroy;
212 }
213
214 return info;
215}
void destroy(_Tp *__pointer)
Definition: _construct.h:278
#define MSIHANDLE_MAGIC
Definition: msipriv.h:760

Referenced by create_suminfo(), MSI_CreateRecord(), MSI_DatabaseOpenViewW(), MSI_EnableUIPreview(), and MSI_OpenDatabaseW().

◆ append_storage_to_db()

void append_storage_to_db ( MSIDATABASE *  db,
IStorage *  stg 
)

Definition at line 76 of file database.c.

77{
79
80 t = malloc( sizeof *t );
81 t->stg = stg;
82 IStorage_AddRef( stg );
83 list_add_head( &db->transforms, &t->entry );
84}
static void list_add_head(struct list_entry *head, struct list_entry *entry)
Definition: list.h:76
GLdouble GLdouble t
Definition: gl.h:2047
struct list transforms
Definition: msipriv.h:119

Referenced by msi_table_apply_transform().

◆ call_script()

DWORD call_script ( MSIHANDLE  hPackage,
INT  type,
LPCWSTR  script,
LPCWSTR  function,
LPCWSTR  action 
)

Definition at line 289 of file script.c.

290{
291 HRESULT hr;
292 IActiveScript *pActiveScript = NULL;
293 IActiveScriptParse *pActiveScriptParse = NULL;
294 struct script_site *scriptsite;
295 IDispatch *pDispatch = NULL;
296 DISPPARAMS dispparamsNoArgs = {NULL, NULL, 0, 0};
297 DISPID dispid;
298 CLSID clsid;
299 VARIANT var;
301
303
304 /* Create MsiActiveScriptSite object */
305 hr = create_activescriptsite(&scriptsite);
306 if (hr != S_OK) goto done;
307
308 /* Create an installer object */
309 hr = create_msiserver(NULL, (void**)&scriptsite->installer);
310 if (hr != S_OK) goto done;
311
312 /* Create a session object */
313 hr = create_session(hPackage, scriptsite->installer, &scriptsite->session);
314 if (hr != S_OK) goto done;
315
316 /* Create the scripting engine */
319 hr = CLSIDFromProgID(L"JScript", &clsid);
321 hr = CLSIDFromProgID(L"VBScript", &clsid);
322 else {
323 ERR("Unknown script type %d\n", type);
324 goto done;
325 }
326 if (FAILED(hr)) {
327 ERR("Could not find CLSID for Windows Script\n");
328 goto done;
329 }
330 hr = CoCreateInstance(&clsid, NULL, CLSCTX_INPROC_SERVER, &IID_IActiveScript, (void **)&pActiveScript);
331 if (FAILED(hr)) {
332 ERR("Could not instantiate class for Windows Script\n");
333 goto done;
334 }
335
336 hr = IActiveScript_QueryInterface(pActiveScript, &IID_IActiveScriptParse, (void **)&pActiveScriptParse);
337 if (FAILED(hr)) goto done;
338
339 hr = IActiveScript_SetScriptSite(pActiveScript, &scriptsite->IActiveScriptSite_iface);
340 if (FAILED(hr)) goto done;
341
342 hr = IActiveScriptParse_InitNew(pActiveScriptParse);
343 if (FAILED(hr)) goto done;
344
345 hr = IActiveScript_AddNamedItem(pActiveScript, L"Session", SCRIPTITEM_GLOBALMEMBERS|SCRIPTITEM_ISVISIBLE);
346 if (FAILED(hr)) goto done;
347
348 hr = IActiveScriptParse_ParseScriptText(pActiveScriptParse, script, NULL, NULL, NULL, 0, 0, 0L, NULL, NULL);
349 if (FAILED(hr)) goto done;
350
351 hr = IActiveScript_SetScriptState(pActiveScript, SCRIPTSTATE_CONNECTED);
352 if (FAILED(hr)) goto done;
353
354 /* Call a function if necessary through the IDispatch interface */
355 if (function && function[0]) {
356 TRACE("Calling function %s\n", debugstr_w(function));
357
358 hr = IActiveScript_GetScriptDispatch(pActiveScript, NULL, &pDispatch);
359 if (FAILED(hr)) goto done;
360
361 hr = IDispatch_GetIDsOfNames(pDispatch, &IID_NULL, (WCHAR **)&function, 1,LOCALE_USER_DEFAULT, &dispid);
362 if (FAILED(hr)) goto done;
363
364 hr = IDispatch_Invoke(pDispatch, dispid, &IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &dispparamsNoArgs, &var, NULL, NULL);
365 if (FAILED(hr)) goto done;
366
367 hr = VariantChangeType(&var, &var, 0, VT_I4);
368 if (FAILED(hr)) goto done;
369
371
373 } else {
374 /* If no function to be called, MSI behavior is to succeed */
376 }
377
378done:
379
380 if (pDispatch) IDispatch_Release(pDispatch);
381 if (pActiveScript) IActiveScript_Release(pActiveScript);
382 if (pActiveScriptParse) IActiveScriptParse_Release(pActiveScriptParse);
383 if (scriptsite)
384 {
385 if (scriptsite->session) IDispatch_Release(scriptsite->session);
386 if (scriptsite->installer) IDispatch_Release(scriptsite->installer);
387 IActiveScriptSite_Release(&scriptsite->IActiveScriptSite_iface);
388 }
389 CoUninitialize(); /* must call even if CoInitialize failed */
390 return ret;
391}
@ SCRIPTSTATE_CONNECTED
Definition: activscp.idl:59
HRESULT hr
Definition: delayimp.cpp:582
HRESULT WINAPI DECLSPEC_HOTPATCH CLSIDFromProgID(LPCOLESTR progid, CLSID *clsid)
Definition: combase.c:1437
void WINAPI DECLSPEC_HOTPATCH CoUninitialize(void)
Definition: combase.c:2842
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, IUnknown *outer, DWORD cls_context, REFIID riid, void **obj)
Definition: combase.c:1685
@ VT_I4
Definition: compat.h:2298
#define IActiveScriptParse_ParseScriptText
Definition: script.c:41
HRESULT create_session(MSIHANDLE msiHandle, IDispatch *installer, IDispatch **disp)
Definition: automation.c:2446
HRESULT create_msiserver(IUnknown *outer, void **ppObj)
Definition: automation.c:2427
#define IActiveScriptParse_InitNew
Definition: script.c:47
#define IActiveScriptParse_Release
Definition: script.c:46
static HRESULT create_activescriptsite(struct script_site **obj)
Definition: script.c:250
static UINT map_return_value(LONG val)
Definition: script.c:272
HRESULT WINAPI CoInitialize(LPVOID lpReserved)
Definition: compobj.c:531
#define S_OK
Definition: intsafe.h:52
#define FAILED(hr)
Definition: intsafe.h:51
const char * var
Definition: shader.c:5879
static VARIANTARG static DISPID
Definition: ordinal.c:49
const CLSID * clsid
Definition: msctf.cpp:50
@ msidbCustomActionTypeJScript
Definition: msidefs.h:119
@ msidbCustomActionTypeVBScript
Definition: msidefs.h:120
script
Definition: msipriv.h:396
struct stdole::DISPPARAMS DISPPARAMS
#define LOCALE_USER_DEFAULT
#define DISPATCH_METHOD
Definition: oleauto.h:1006
#define V_I4(A)
Definition: oleauto.h:247
#define IID_NULL
Definition: guiddef.h:98
IDispatch * session
Definition: script.c:59
IActiveScriptSite IActiveScriptSite_iface
Definition: script.c:57
IDispatch * installer
Definition: script.c:58
HRESULT WINAPI DECLSPEC_HOTPATCH VariantChangeType(VARIANTARG *pvargDest, const VARIANTARG *pvargSrc, USHORT wFlags, VARTYPE vt)
Definition: variant.c:939
HRESULT WINAPI DECLSPEC_HOTPATCH VariantClear(VARIANTARG *pVarg)
Definition: variant.c:626

Referenced by ACTION_CallScript().

◆ copy_remote_record()

UINT copy_remote_record ( const struct wire_record *  rec,
MSIHANDLE  handle 
)

Definition at line 1052 of file record.c.

1053{
1054 MSIRECORD *rec;
1055 unsigned int i;
1057
1059 return ERROR_INVALID_HANDLE;
1060
1061 rec->cookie = in->cookie;
1062 for (i = 0; i <= in->count; i++)
1063 {
1064 switch (in->fields[i].type)
1065 {
1066 case MSIFIELD_NULL:
1067 MSI_FreeField(&rec->fields[i]);
1068 rec->fields[i].type = MSIFIELD_NULL;
1069 break;
1070 case MSIFIELD_INT:
1071 r = MSI_RecordSetInteger(rec, i, in->fields[i].u.iVal);
1072 break;
1073 case MSIFIELD_WSTR:
1074 r = MSI_RecordSetStringW(rec, i, in->fields[i].u.szwVal);
1075 break;
1076 case MSIFIELD_STREAM:
1077 r = MSI_RecordSetIStream(rec, i, in->fields[i].u.stream);
1078 break;
1079 default:
1080 ERR("invalid field type %d\n", in->fields[i].type);
1081 break;
1082 }
1083
1084 if (r)
1085 {
1086 msiobj_release(&rec->hdr);
1087 return r;
1088 }
1089 }
1090
1091 msiobj_release(&rec->hdr);
1092 return ERROR_SUCCESS;
1093}
#define ERROR_INVALID_HANDLE
Definition: compat.h:98
void * msihandle2msiinfo(MSIHANDLE handle, UINT type)
Definition: handle.c:158
UINT MSI_RecordSetStringW(MSIRECORD *rec, UINT iField, LPCWSTR szValue)
Definition: record.c:597
#define MSIFIELD_STREAM
Definition: record.c:47
UINT MSI_RecordSetInteger(MSIRECORD *rec, UINT iField, int iVal)
Definition: record.c:280
#define MSIFIELD_INT
Definition: record.c:45
#define MSIFIELD_WSTR
Definition: record.c:46
UINT MSI_RecordSetIStream(MSIRECORD *rec, UINT iField, IStream *stm)
Definition: record.c:836
#define MSIFIELD_NULL
Definition: record.c:44
static void MSI_FreeField(MSIFIELD *field)
Definition: record.c:49
GLuint in
Definition: glext.h:9616
#define MSIHANDLETYPE_RECORD
Definition: msipriv.h:749
UINT type
Definition: msipriv.h:139
MSIFIELD fields[1]
Definition: msipriv.h:154
UINT64 cookie
Definition: msipriv.h:153
wchar_t tm const _CrtWcstime_Writes_and_advances_ptr_ count wchar_t ** out
Definition: wcsftime.cpp:383

Referenced by MsiViewModify(), and unmarshal_record().

◆ cost_from_size()

static int cost_from_size ( int  size)
inlinestatic

Definition at line 1226 of file msipriv.h.

1227{
1228 /* Cost is size rounded up to the nearest 4096 bytes,
1229 * expressed in units of 512 bytes. */
1230 return ((size + 4095) & ~4095) / 512;
1231}

Referenced by calculate_file_cost(), and MsiEnumComponentCostsW().

◆ create_msiserver()

HRESULT create_msiserver ( IUnknown *  pOuter,
LPVOID *  ppObj 
)

◆ create_session()

HRESULT create_session ( MSIHANDLE  msiHandle,
IDispatch *  pInstaller,
IDispatch **  pDispatch 
)

Definition at line 2446 of file automation.c.

2447{
2448 struct session_object *session;
2449
2450 session = malloc(sizeof(*session));
2451 if (!session) return E_OUTOFMEMORY;
2452
2453 init_automation_object(&session->autoobj, msiHandle, Session_tid);
2454
2455 session->installer = installer;
2456 *disp = &session->autoobj.IDispatch_iface;
2457
2458 return S_OK;
2459}
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
static void init_automation_object(struct automation_object *This, MSIHANDLE msiHandle, tid_t tid)
Definition: automation.c:549
IDispatch * installer
Definition: automation.c:183

Referenced by call_script(), and InstallerImpl_OpenPackage().

◆ custom_stop_server()

void custom_stop_server ( HANDLE  process,
HANDLE  pipe 
)

Definition at line 681 of file custom.c.

682{
683 DWORD size;
684
685 WriteFile(pipe, &GUID_NULL, sizeof(GUID_NULL), &size, NULL);
688 CloseHandle(pipe);
689}
BOOL WINAPI WriteFile(_In_ HANDLE hFile, _In_reads_bytes_opt_(nNumberOfBytesToWrite) LPCVOID lpBuffer, _In_ DWORD nNumberOfBytesToWrite, _Out_opt_ LPDWORD lpNumberOfBytesWritten, _Inout_opt_ LPOVERLAPPED lpOverlapped)
Definition: rw.c:25
#define INFINITE
Definition: serial.h:102
#define GUID_NULL
Definition: ks.h:106
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
Definition: synch.c:82

Referenced by MSI_FreePackage().

◆ decode_base85_guid()

BOOL decode_base85_guid ( LPCWSTR  str,
GUID *  guid 
)

Definition at line 132 of file registry.c.

133{
134 DWORD i, val = 0, base = 1, *p;
135
136 if (!str)
137 return FALSE;
138
139 p = (DWORD*) guid;
140 for( i=0; i<20; i++ )
141 {
142 if( (i%5) == 0 )
143 {
144 val = 0;
145 base = 1;
146 }
147 val += table_dec85[str[i]] * base;
148 if( str[i] >= 0x80 )
149 return FALSE;
150 if( table_dec85[str[i]] == 0xff )
151 return FALSE;
152 if( (i%5) == 4 )
153 p[i/5] = val;
154 base *= 85;
155 }
156 return TRUE;
157}
static const unsigned char table_dec85[0x80]
Definition: registry.c:110
GLuint GLfloat * val
Definition: glext.h:7180
GLfloat GLfloat p
Definition: glext.h:8902
const WCHAR * str

Referenced by MSI_ProvideQualifiedComponentEx(), MsiDecomposeDescriptorW(), and query_feature_state().

◆ decode_streamname()

BOOL decode_streamname ( LPCWSTR  in,
LPWSTR  out 
)

Definition at line 180 of file table.c.

181{
182 WCHAR ch;
183 DWORD count = 0;
184
185 while ( (ch = *in++) )
186 {
187 if( (ch >= 0x3800 ) && (ch < 0x4840 ) )
188 {
189 if( ch >= 0x4800 )
190 ch = mime2utf(ch-0x4800);
191 else
192 {
193 ch -= 0x3800;
194 *out++ = mime2utf(ch&0x3f);
195 count++;
196 ch = mime2utf((ch>>6)&0x3f);
197 }
198 }
199 *out++ = ch;
200 count++;
201 }
202 *out = 0;
203 return count;
204}
static int mime2utf(int x)
Definition: table.c:167
unsigned char ch[4][2]
Definition: console.c:118
GLuint GLuint GLsizei count
Definition: gl.h:1545

Referenced by admin_remove_cabinet_streams(), enum_stream_names(), load_streams(), and msi_table_apply_transform().

◆ deformat_string()

DWORD deformat_string ( MSIPACKAGE *  package,
LPCWSTR  ptr,
WCHAR **  data 
)

◆ dump_record()

void dump_record ( MSIRECORD *  rec)

Definition at line 1028 of file record.c.

1029{
1030 int i;
1031 if (!rec)
1032 {
1033 TRACE("(null)\n");
1034 return;
1035 }
1036
1037 TRACE("[");
1038 for (i = 0; i <= rec->count; i++)
1039 {
1040 switch(rec->fields[i].type)
1041 {
1042 case MSIFIELD_NULL: TRACE("(null)"); break;
1043 case MSIFIELD_INT: TRACE("%d", rec->fields[i].u.iVal); break;
1044 case MSIFIELD_WSTR: TRACE("%s", debugstr_w(rec->fields[i].u.szwVal)); break;
1045 case MSIFIELD_STREAM: TRACE("%p", rec->fields[i].u.stream); break;
1046 }
1047 if (i < rec->count) TRACE(", ");
1048 }
1049 TRACE("]\n");
1050}
INT iVal
Definition: msipriv.h:142
IStream * stream
Definition: msipriv.h:144
union tagMSIFIELD::@615 u
LPWSTR szwVal
Definition: msipriv.h:143
UINT count
Definition: msipriv.h:152

Referenced by MSI_FormatRecordW(), MSI_ProcessMessageVerbatim(), and table_load_transform().

◆ encode_base85_guid()

BOOL encode_base85_guid ( GUID *  guid,
LPWSTR  str 
)

Definition at line 165 of file registry.c.

166{
167 unsigned int x, *p, i;
168
169 p = (unsigned int*) guid;
170 for( i=0; i<4; i++ )
171 {
172 x = p[i];
173 *str++ = table_enc85[x%85];
174 x = x/85;
175 *str++ = table_enc85[x%85];
176 x = x/85;
177 *str++ = table_enc85[x%85];
178 x = x/85;
179 *str++ = table_enc85[x%85];
180 x = x/85;
181 *str++ = table_enc85[x%85];
182 }
183 *str = 0;
184
185 return TRUE;
186}
static const char table_enc85[]
Definition: registry.c:121
GLint GLint GLint GLint GLint x
Definition: gl.h:1548

Referenced by ACTION_MsiPublishAssemblies(), ACTION_PublishFeatures(), and msi_create_component_advertise_string().

◆ encode_streamname()

WCHAR * encode_streamname ( BOOL  is_table,
const WCHAR *  in 
)

◆ enum_stream_names()

void enum_stream_names ( IStorage *  stg)

Definition at line 206 of file table.c.

207{
208 IEnumSTATSTG *stgenum = NULL;
209 HRESULT r;
210 STATSTG stat;
211 ULONG n, count;
212 WCHAR name[0x40];
213
214 r = IStorage_EnumElements( stg, 0, NULL, 0, &stgenum );
215 if( FAILED( r ) )
216 return;
217
218 n = 0;
219 while( 1 )
220 {
221 count = 0;
222 r = IEnumSTATSTG_Next( stgenum, 1, &stat, &count );
223 if( FAILED( r ) || !count )
224 break;
225 decode_streamname( stat.pwcsName, name );
226 TRACE( "stream %2lu -> %s %s\n", n, debugstr_w(stat.pwcsName), debugstr_w(name) );
227 CoTaskMemFree( stat.pwcsName );
228 n++;
229 }
230
231 IEnumSTATSTG_Release( stgenum );
232}
#define stat
Definition: acwin.h:100
void WINAPI CoTaskMemFree(void *ptr)
Definition: malloc.c:389
BOOL decode_streamname(LPCWSTR in, LPWSTR out)
Definition: table.c:180
GLdouble n
Definition: glext.h:7729
Definition: name.c:39
Definition: stat.h:66
uint32_t ULONG
Definition: typedefs.h:59

Referenced by MSI_DatabaseApplyTransformW(), and MSI_OpenDatabaseW().

◆ free_cached_tables()

void free_cached_tables ( MSIDATABASE *  db)

Definition at line 472 of file table.c.

473{
474 while( !list_empty( &db->tables ) )
475 {
477
478 list_remove( &t->entry );
479 free_table( t );
480 }
481}
static int list_empty(struct list_entry *head)
Definition: list.h:58
static void free_table(MSITABLE *table)
Definition: table.c:364
struct list tables
Definition: msipriv.h:118

Referenced by MSI_CloseDatabase().

◆ free_remote_record()

void free_remote_record ( struct wire_record *  rec)

Definition at line 1149 of file record.c.

1150{
1151 int i;
1152
1153 for (i = 0; i <= rec->count; i++)
1154 {
1155 if (rec->fields[i].type == MSIFIELD_WSTR)
1156 midl_user_free(rec->fields[i].u.szwVal);
1157 else if (rec->fields[i].type == MSIFIELD_STREAM)
1158 IStream_Release(rec->fields[i].u.stream);
1159 }
1160
1161 midl_user_free(rec);
1162}
#define midl_user_free
Definition: rpc.h:41
unsigned int count
Definition: winemsi.idl:57
struct wire_field fields[]
Definition: winemsi.idl:59

Referenced by MsiDatabaseGetPrimaryKeysW(), MsiViewFetch(), MsiViewGetColumnInfo(), and MsiViewModify().

◆ get_typeinfo()

HRESULT get_typeinfo ( tid_t  tid,
ITypeInfo **  ti 
)

Definition at line 61 of file ieframe_main.c.

62{
64
65 if(!typelib)
67 if(!typelib)
68 return hres;
69
70 if(!typeinfos[tid]) {
71 ITypeInfo *ti;
72
73 hres = ITypeLib_GetTypeInfoOfGuid(typelib, tid_ids[tid], &ti);
74 if(FAILED(hres)) {
75 ERR("GetTypeInfoOfGuid(%s) failed: %08x\n", debugstr_guid(tid_ids[tid]), hres);
76 return hres;
77 }
78
80 ITypeInfo_Release(ti);
81 }
82
84 return S_OK;
85}
static HRESULT load_typelib(void)
Definition: ieframe_main.c:45
static REFIID tid_ids[]
Definition: ieframe_main.c:37
static ITypeInfo * typeinfos[LAST_tid]
Definition: ieframe_main.c:35
static TfClientId tid
#define InterlockedCompareExchangePointer
Definition: interlocked.h:144
#define debugstr_guid
Definition: kernel32.h:35
HRESULT hres
Definition: protocol.c:432

◆ is_platform_64bit()

static BOOL is_platform_64bit ( enum platform  platform)
inlinestatic

Definition at line 373 of file msipriv.h.

374{
375 switch (platform)
376 {
377 case PLATFORM_INTEL64:
378 case PLATFORM_X64:
379 case PLATFORM_ARM64:
380 return TRUE;
381 default:
382 return FALSE;
383 }
384}
platform
Definition: msipriv.h:364

Referenced by msi_disable_fs_redirection(), and msi_revert_fs_redirection().

◆ marshal_record()

struct wire_record * marshal_record ( MSIHANDLE  handle)

Definition at line 1109 of file record.c.

1110{
1111 struct wire_record *ret;
1112 unsigned int i;
1113 MSIRECORD *rec;
1114
1116 return NULL;
1117
1118 ret = midl_user_allocate(sizeof(*ret) + rec->count * sizeof(ret->fields[0]));
1119 ret->count = rec->count;
1120 ret->cookie = rec->cookie;
1121
1122 for (i = 0; i <= rec->count; i++)
1123 {
1124 switch (rec->fields[i].type)
1125 {
1126 case MSIFIELD_NULL:
1127 break;
1128 case MSIFIELD_INT:
1129 ret->fields[i].u.iVal = rec->fields[i].u.iVal;
1130 break;
1131 case MSIFIELD_WSTR:
1132 ret->fields[i].u.szwVal = wcsdup(rec->fields[i].u.szwVal);
1133 break;
1134 case MSIFIELD_STREAM:
1135 IStream_AddRef(rec->fields[i].u.stream);
1136 ret->fields[i].u.stream = rec->fields[i].u.stream;
1137 break;
1138 default:
1139 ERR("invalid field type %d\n", rec->fields[i].type);
1140 break;
1141 }
1142 ret->fields[i].type = rec->fields[i].type;
1143 }
1144
1145 msiobj_release(&rec->hdr);
1146 return ret;
1147}
static wchar_t * wcsdup(const wchar_t *str)
Definition: string.h:94
#define midl_user_allocate
Definition: rpc.h:40

Referenced by s_remote_DatabaseGetPrimaryKeys(), s_remote_ViewFetch(), s_remote_ViewGetColumnInfo(), and s_remote_ViewModify().

◆ msi_action_is_unique()

BOOL msi_action_is_unique ( const MSIPACKAGE *  package,
const WCHAR *  action 
)

Definition at line 130 of file custom.c.

131{
132 UINT i;
133
134 for (i = 0; i < package->unique_actions_count; i++)
135 {
136 if (!wcscmp( package->unique_actions[i], action )) return TRUE;
137 }
138 return FALSE;
139}
int unique_actions_count
Definition: msipriv.h:450
LPWSTR * unique_actions
Definition: msipriv.h:449

Referenced by ACTION_AppSearch(), ACTION_CCPSearch(), ACTION_FindRelatedProducts(), and check_execution_scheduling_options().

◆ msi_add_cabinet_stream()

UINT msi_add_cabinet_stream ( MSIPACKAGE *  package,
UINT  disk_id,
IStorage *  storage,
const WCHAR *  name 
)

Definition at line 923 of file media.c.

924{
925 MSICABINETSTREAM *cab, *item;
926
927 TRACE("%p, %u, %p, %s\n", package, disk_id, storage, debugstr_w(name));
928
930 {
931 if (item->disk_id == disk_id)
932 {
933 TRACE("duplicate disk id %u\n", disk_id);
935 }
936 }
937 if (!(cab = malloc( sizeof(*cab) ))) return ERROR_OUTOFMEMORY;
938 if (!(cab->stream = malloc( (wcslen( name ) + 1) * sizeof(WCHAR) )))
939 {
940 free( cab );
941 return ERROR_OUTOFMEMORY;
942 }
943 lstrcpyW( cab->stream, name );
944 cab->disk_id = disk_id;
945 cab->storage = storage;
946 IStorage_AddRef( storage );
947 list_add_tail( &package->cabinet_streams, &cab->entry );
948
949 return ERROR_SUCCESS;
950}
static void list_add_tail(struct list_entry *head, struct list_entry *entry)
Definition: list.h:83
#define ERROR_OUTOFMEMORY
Definition: deptool.c:13
struct list entry
Definition: msipriv.h:192
IStorage * storage
Definition: msipriv.h:194
struct list cabinet_streams
Definition: msipriv.h:421

Referenced by load_media(), and patch_add_media().

◆ msi_add_string()

int msi_add_string ( string_table *  st,
const WCHAR *  data,
int  len,
BOOL  persistent 
)

Definition at line 303 of file string.c.

304{
305 UINT n;
306 LPWSTR str;
307
308 if( !data )
309 return 0;
310
311 if (len < 0) len = lstrlenW( data );
312
313 if( !data[0] && !len )
314 return 0;
315
316 if (msi_string2id( st, data, len, &n) == ERROR_SUCCESS )
317 {
318 if (persistent)
319 st->strings[n].persistent_refcount++;
320 else
321 st->strings[n].nonpersistent_refcount++;
322 return n;
323 }
324
325 n = st_find_free_entry( st );
326 if( n == -1 )
327 return -1;
328
329 /* allocate a new string */
330 TRACE( "%s, n = %d len = %d\n", debugstr_wn(data, len), n, len );
331
332 str = malloc( (len + 1) * sizeof(WCHAR) );
333 if( !str )
334 return -1;
335 memcpy( str, data, len*sizeof(WCHAR) );
336 str[len] = 0;
337
338 set_st_entry( st, n, str, len, 1, persistent );
339 return n;
340}
UINT msi_string2id(const string_table *st, const WCHAR *str, int len, UINT *id)
Definition: string.c:400
static int st_find_free_entry(string_table *st)
Definition: string.c:122
static void set_st_entry(string_table *st, UINT n, WCHAR *str, int len, USHORT refcount, BOOL persistent)
Definition: string.c:208
#define debugstr_wn
Definition: kernel32.h:33
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
struct msistring * strings
Definition: string.c:57

Referenced by add_storages_to_table(), append_stream(), find_insert_index(), msi_create_table(), STORAGES_set_row(), STREAMS_set_row(), TABLE_add_column(), TABLE_set_row(), and TABLE_set_string().

◆ msi_add_suminfo()

UINT msi_add_suminfo ( MSIDATABASE *  db,
LPWSTR **  records,
int  num_records,
int  num_columns 
)

Definition at line 1077 of file suminfo.c.

1078{
1079 UINT r;
1080 int i, j;
1082
1083 r = msi_get_suminfo( db->storage, num_records * (num_columns / 2), &si );
1084 if (r != ERROR_SUCCESS)
1085 {
1086 if (!(si = create_suminfo( db->storage, num_records * (num_columns / 2) )))
1087 return ERROR_OUTOFMEMORY;
1088 r = ERROR_SUCCESS;
1089 }
1090
1091 for (i = 0; i < num_records; i++)
1092 {
1093 for (j = 0; j < num_columns; j += 2)
1094 {
1095 UINT pid;
1096 INT int_value = 0;
1097 FILETIME ft_value;
1098 awcstring str_value;
1099
1100 r = parse_prop( records[i][j], records[i][j + 1], &pid, &int_value, &ft_value, &str_value );
1101 if (r != ERROR_SUCCESS)
1102 goto end;
1103
1104 r = set_prop( si, pid, get_type(pid), int_value, &ft_value, &str_value );
1105 if (r != ERROR_SUCCESS)
1106 goto end;
1107 }
1108 }
1109
1110end:
1111 if (r == ERROR_SUCCESS)
1113
1114 msiobj_release( &si->hdr );
1115 return r;
1116}
UINT msi_get_suminfo(IStorage *stg, UINT uiUpdateCount, MSISUMMARYINFO **ret)
Definition: suminfo.c:461
UINT msi_suminfo_persist(MSISUMMARYINFO *si)
Definition: suminfo.c:971
static UINT parse_prop(LPCWSTR prop, LPCWSTR value, UINT *pid, INT *int_value, FILETIME *ft_value, awcstring *str_value)
Definition: suminfo.c:1028
static MSISUMMARYINFO * create_suminfo(IStorage *stg, UINT update_count)
Definition: suminfo.c:447
static UINT set_prop(MSISUMMARYINFO *si, UINT uiProperty, UINT type, INT iValue, FILETIME *pftValue, awcstring *str)
Definition: suminfo.c:841
static UINT get_type(UINT uiProperty)
Definition: suminfo.c:117
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
Definition: glfuncs.h:250
static SYSTEM_INFO si
Definition: virtual.c:39
IStorage * storage
Definition: msipriv.h:109
_In_ ULONG_PTR _In_ ULONG _Out_ ULONG_PTR * pid
Definition: winddi.h:3837

Referenced by MSI_DatabaseImport().

◆ msi_adjust_privilege_properties()

void msi_adjust_privilege_properties ( MSIPACKAGE *  package)

Definition at line 967 of file package.c.

968{
969 /* FIXME: this should depend on the user's privileges */
970 if (msi_get_property_int( package->db, L"ALLUSERS", 0 ) == 2)
971 {
972 TRACE("resetting ALLUSERS property from 2 to 1\n");
973 msi_set_property( package->db, L"ALLUSERS", L"1", -1 );
974 }
975 msi_set_property( package->db, L"AdminUser", L"1", -1 );
976 msi_set_property( package->db, L"Privileged", L"1", -1 );
977 msi_set_property( package->db, L"MsiRunningElevated", L"1", -1 );
978 msi_set_property( package->db, L"MsiTrueAdminUser", L"1", -1 );
979}
UINT msi_set_property(MSIDATABASE *db, const WCHAR *name, const WCHAR *value, int len)
Definition: package.c:2132
int msi_get_property_int(MSIDATABASE *db, LPCWSTR prop, int def)
Definition: package.c:2337

Referenced by MSI_CreatePackage(), MSI_InstallPackage(), and MSI_OpenPackageW().

◆ msi_apply_patches()

UINT msi_apply_patches ( MSIPACKAGE *  package)

Definition at line 932 of file patch.c.

933{
934 LPWSTR patch_list, *patches;
936
937 patch_list = msi_dup_property( package->db, L"PATCH" );
938
939 TRACE("patches to be applied: %s\n", debugstr_w(patch_list));
940
941 patches = msi_split_string( patch_list, ';' );
942 for (i = 0; patches && patches[i] && r == ERROR_SUCCESS; i++)
943 r = apply_patch_package( package, patches[i] );
944
945 free( patches );
946 free( patch_list );
947 return r;
948}
WCHAR ** msi_split_string(const WCHAR *str, WCHAR sep)
Definition: action.c:297
static UINT apply_patch_package(MSIPACKAGE *package, const WCHAR *file)
Definition: patch.c:875

Referenced by MSI_InstallPackage().

◆ msi_apply_registered_patch()

UINT msi_apply_registered_patch ( MSIPACKAGE *  package,
LPCWSTR  patch_code 
)

Definition at line 990 of file patch.c.

991{
992 UINT r;
993 DWORD len;
995 MSIDATABASE *patch_db;
996 MSIPATCHINFO *patch_info;
998
999 TRACE("%p, %s\n", package, debugstr_w(patch_code));
1000
1002 r = MsiGetPatchInfoExW( patch_code, package->ProductCode, NULL, package->Context,
1004 if (r != ERROR_SUCCESS)
1005 {
1006 ERR("failed to get patch filename %u\n", r);
1007 return r;
1008 }
1010 if (r != ERROR_SUCCESS)
1011 {
1012 ERR("failed to open patch database %s\n", debugstr_w( patch_file ));
1013 return r;
1014 }
1015 r = msi_get_suminfo( patch_db->storage, 0, &si );
1016 if (r != ERROR_SUCCESS)
1017 {
1018 msiobj_release( &patch_db->hdr );
1019 return r;
1020 }
1021 r = parse_patch_summary( si, &patch_info );
1022 msiobj_release( &si->hdr );
1023 if (r != ERROR_SUCCESS)
1024 {
1025 ERR("failed to parse patch summary %u\n", r);
1026 msiobj_release( &patch_db->hdr );
1027 return r;
1028 }
1029 patch_info->registered = TRUE;
1030 patch_info->localfile = wcsdup( patch_file );
1031 if (!patch_info->localfile)
1032 {
1033 msiobj_release( &patch_db->hdr );
1034 msi_free_patchinfo( patch_info );
1035 return ERROR_OUTOFMEMORY;
1036 }
1037 r = apply_patch_db( package, patch_db, patch_info );
1038 msiobj_release( &patch_db->hdr );
1039 if (r != ERROR_SUCCESS)
1040 {
1041 ERR("failed to apply patch %u\n", r);
1042 msi_free_patchinfo( patch_info );
1043 }
1044 return r;
1045}
UINT MSI_OpenDatabaseW(LPCWSTR szDBPath, LPCWSTR szPersist, MSIDATABASE **pdb)
Definition: database.c:140
UINT WINAPI MsiGetPatchInfoExW(LPCWSTR szPatchCode, LPCWSTR szProductCode, LPCWSTR szUserSid, MSIINSTALLCONTEXT dwContext, LPCWSTR szProperty, LPWSTR lpValue, DWORD *pcchValue)
Definition: msi.c:1657
static UINT parse_patch_summary(MSISUMMARYINFO *si, MSIPATCHINFO **patch)
Definition: patch.c:318
static UINT apply_patch_db(MSIPACKAGE *package, MSIDATABASE *patch_db, MSIPATCHINFO *patch)
Definition: patch.c:834
void msi_free_patchinfo(MSIPATCHINFO *patch)
Definition: patch.c:865
static const WCHAR INSTALLPROPERTY_LOCALPACKAGEW[]
Definition: msi.h:343
UINT msi_get_suminfo(IStorage *stg, UINT uiUpdateCount, MSISUMMARYINFO **si)
Definition: suminfo.c:461
#define MSIDBOPEN_PATCHFILE
Definition: msiquery.h:79
#define MSIDBOPEN_READONLY
Definition: msiquery.h:66
MSIOBJECTHDR hdr
Definition: msipriv.h:108
BOOL registered
Definition: msipriv.h:209
LPWSTR localfile
Definition: msipriv.h:205

Referenced by MSI_OpenPackageW().

◆ msi_apply_transforms()

UINT msi_apply_transforms ( MSIPACKAGE *  package)

Definition at line 950 of file patch.c.

951{
952 LPWSTR xform_list, *xforms;
954
955 xform_list = msi_dup_property( package->db, L"TRANSFORMS" );
956 xforms = msi_split_string( xform_list, ';' );
957
958 for (i = 0; xforms && xforms[i] && r == ERROR_SUCCESS; i++)
959 {
960 if (xforms[i][0] == ':')
961 r = apply_substorage_transform( package, package->db, xforms[i] );
962 else
963 {
965
966 if (!PathIsRelativeW( xforms[i] )) transform = xforms[i];
967 else
968 {
969 WCHAR *p = wcsrchr( package->PackagePath, '\\' );
970 DWORD len = p - package->PackagePath + 1;
971
972 if (!(transform = malloc( (len + wcslen( xforms[i] ) + 1) * sizeof(WCHAR)) ))
973 {
974 free( xforms );
975 free( xform_list );
976 return ERROR_OUTOFMEMORY;
977 }
978 memcpy( transform, package->PackagePath, len * sizeof(WCHAR) );
979 memcpy( transform + len, xforms[i], (lstrlenW( xforms[i] ) + 1) * sizeof(WCHAR) );
980 }
981 r = MSI_DatabaseApplyTransformW( package->db, transform, 0 );
982 if (transform != xforms[i]) free( transform );
983 }
984 }
985 free( xforms );
986 free( xform_list );
987 return r;
988}
BOOL WINAPI PathIsRelativeW(const WCHAR *path)
Definition: path.c:1006
static UINT apply_substorage_transform(MSIPACKAGE *package, MSIDATABASE *patch_db, LPCWSTR name)
Definition: patch.c:259
GLuint GLenum GLenum transform
Definition: glext.h:9407
UINT MSI_DatabaseApplyTransformW(MSIDATABASE *db, LPCWSTR szTransformFile, int iErrorCond)
LPWSTR PackagePath
Definition: msipriv.h:461

Referenced by MSI_InstallPackage().

◆ msi_build_directory_name()

WCHAR *WINAPIV msi_build_directory_name ( DWORD  count,
  ... 
)

Definition at line 2006 of file action.c.

2007{
2008 DWORD sz = 1, i;
2009 WCHAR *dir;
2010 va_list va;
2011
2012 va_start( va, count );
2013 for (i = 0; i < count; i++)
2014 {
2015 const WCHAR *str = va_arg( va, const WCHAR * );
2016 if (str) sz += lstrlenW( str ) + 1;
2017 }
2018 va_end( va );
2019
2020 dir = malloc( sz * sizeof(WCHAR) );
2021 dir[0] = 0;
2022
2023 va_start( va, count );
2024 for (i = 0; i < count; i++)
2025 {
2026 const WCHAR *str = va_arg( va, const WCHAR * );
2027 if (!str) continue;
2028 lstrcatW( dir, str );
2029 if ( i + 1 != count && dir[0] && dir[lstrlenW( dir ) - 1] != '\\') lstrcatW( dir, L"\\" );
2030 }
2031 va_end( va );
2032 return dir;
2033}
unsigned int dir
Definition: maze.c:112
#define va_end(v)
Definition: stdarg.h:28
#define va_arg(v, l)
Definition: stdarg.h:27
#define va_start(v, l)
Definition: stdarg.h:26
char * va_list
Definition: vadefs.h:50

Referenced by get_duplicate_filename(), get_ini_file_name(), get_link_file(), ITERATE_InstallODBCDriver(), msi_build_icon_path(), msi_resolve_file_source(), msi_resolve_source_folder(), msi_resolve_target_folder(), MSI_SetTargetPathW(), register_verb(), and set_target_path().

◆ msi_build_icon_path()

WCHAR * msi_build_icon_path ( MSIPACKAGE *  package,
const WCHAR *  icon_name 
)

Definition at line 3721 of file action.c.

3722{
3723 WCHAR *folder, *dest, *path;
3724
3725 if (package->Context == MSIINSTALLCONTEXT_MACHINE)
3726 folder = msi_dup_property( package->db, L"WindowsFolder" );
3727 else
3728 {
3729 WCHAR *appdata = msi_dup_property( package->db, L"AppDataFolder" );
3730 folder = msi_build_directory_name( 2, appdata, L"Microsoft\\" );
3731 free( appdata );
3732 }
3733 dest = msi_build_directory_name( 3, folder, L"Installer\\", package->ProductCode );
3734 msi_create_full_path( package, dest );
3735 path = msi_build_directory_name( 2, dest, icon_name );
3736 free( folder );
3737 free( dest );
3738 return path;
3739}
WCHAR *WINAPIV msi_build_directory_name(DWORD count,...)
Definition: action.c:2006
BOOL msi_create_full_path(MSIPACKAGE *package, const WCHAR *path)
Definition: files.c:211
static char * dest
Definition: rtl.c:149
@ MSIINSTALLCONTEXT_MACHINE
Definition: msi.h:200
static const char appdata[]
Definition: shdocvw.c:39

Referenced by ITERATE_CreateShortcuts(), ITERATE_PublishIcon(), ITERATE_UnpublishIcon(), load_class(), load_progid(), and publish_product_properties().

◆ msi_cabextract()

BOOL msi_cabextract ( MSIPACKAGE *  package,
MSIMEDIAINFO *  mi,
LPVOID  data 
)

Definition at line 640 of file media.c.

641{
642 if (mi->cabinet[0] == '#')
643 {
644 return extract_cabinet_stream( package, mi, data );
645 }
646 return extract_cabinet( package, mi, data );
647}
static BOOL extract_cabinet(MSIPACKAGE *package, MSIMEDIAINFO *mi, LPVOID data)
Definition: media.c:567
static BOOL extract_cabinet_stream(MSIPACKAGE *package, MSIMEDIAINFO *mi, LPVOID data)
Definition: media.c:607

Referenced by ACTION_InstallFiles(), and ACTION_PatchFiles().

◆ msi_check_patch_applicable()

UINT msi_check_patch_applicable ( MSIPACKAGE *  package,
MSISUMMARYINFO *  si 
)

Definition at line 294 of file patch.c.

295{
296 LPWSTR guid_list, *guids, product_code;
298
299 product_code = msi_dup_property( package->db, L"ProductCode" );
300 if (!product_code)
301 {
302 /* FIXME: the property ProductCode should be written into the DB somewhere */
303 ERR("no product code to check\n");
304 return ERROR_SUCCESS;
305 }
308 for (i = 0; guids[i] && ret != ERROR_SUCCESS; i++)
309 {
310 if (!wcscmp( guids[i], product_code )) ret = ERROR_SUCCESS;
311 }
312 free( guids );
313 free( guid_list );
314 free( product_code );
315 return ret;
316}
const struct sortguid * guids
Definition: locale.c:422
#define PID_TEMPLATE
Definition: suminfo.c:49
static const GUID * guid_list[]
Definition: metadata.c:3117
WCHAR * msi_suminfo_dup_string(MSISUMMARYINFO *si, UINT property) __WINE_DEALLOC(free) __WINE_MALLOC
Definition: suminfo.c:700

Referenced by apply_patch_package(), and MSI_ApplicablePatchW().

◆ msi_clone_properties()

UINT msi_clone_properties ( MSIDATABASE *  db)

Definition at line 381 of file package.c.

382{
383 MSIQUERY *view_select;
384 UINT rc;
385
386 rc = MSI_DatabaseOpenViewW( db, L"SELECT * FROM `Property`", &view_select );
387 if (rc != ERROR_SUCCESS)
388 return rc;
389
390 rc = MSI_ViewExecute( view_select, 0 );
391 if (rc != ERROR_SUCCESS)
392 {
393 MSI_ViewClose( view_select );
394 msiobj_release( &view_select->hdr );
395 return rc;
396 }
397
398 while (1)
399 {
400 MSIQUERY *view_insert, *view_update;
401 MSIRECORD *rec_select;
402
403 rc = MSI_ViewFetch( view_select, &rec_select );
404 if (rc != ERROR_SUCCESS)
405 break;
406
407 rc = MSI_DatabaseOpenViewW( db, L"INSERT INTO `_Property` (`_Property`,`Value`) VALUES (?,?)", &view_insert );
408 if (rc != ERROR_SUCCESS)
409 {
410 msiobj_release( &rec_select->hdr );
411 continue;
412 }
413
414 rc = MSI_ViewExecute( view_insert, rec_select );
415 MSI_ViewClose( view_insert );
416 msiobj_release( &view_insert->hdr );
417 if (rc != ERROR_SUCCESS)
418 {
419 MSIRECORD *rec_update;
420
421 TRACE("insert failed, trying update\n");
422
423 rc = MSI_DatabaseOpenViewW( db, L"UPDATE `_Property` SET `Value` = ? WHERE `_Property` = ?", &view_update );
424 if (rc != ERROR_SUCCESS)
425 {
426 WARN("open view failed %u\n", rc);
427 msiobj_release( &rec_select->hdr );
428 continue;
429 }
430
431 rec_update = MSI_CreateRecord( 2 );
432 MSI_RecordCopyField( rec_select, 1, rec_update, 2 );
433 MSI_RecordCopyField( rec_select, 2, rec_update, 1 );
434 rc = MSI_ViewExecute( view_update, rec_update );
435 if (rc != ERROR_SUCCESS)
436 WARN("update failed %u\n", rc);
437
438 MSI_ViewClose( view_update );
439 msiobj_release( &view_update->hdr );
440 msiobj_release( &rec_update->hdr );
441 }
442
443 msiobj_release( &rec_select->hdr );
444 }
445
446 MSI_ViewClose( view_select );
447 msiobj_release( &view_select->hdr );
448 return rc;
449}
UINT MSI_ViewExecute(MSIQUERY *, MSIRECORD *)
Definition: msiquery.c:498
UINT MSI_ViewClose(MSIQUERY *)
Definition: msiquery.c:450
UINT MSI_RecordCopyField(MSIRECORD *, UINT, MSIRECORD *, UINT)
Definition: record.c:166
UINT MSI_ViewFetch(MSIQUERY *, MSIRECORD **)
Definition: msiquery.c:373
MSIOBJECTHDR hdr
Definition: msipriv.h:129

Referenced by MSI_CreatePackage(), and msi_table_apply_transform().

◆ MSI_CloneRecord()

MSIRECORD * MSI_CloneRecord ( MSIRECORD *  rec)

Definition at line 921 of file record.c.

922{
923 MSIRECORD *clone;
924 UINT r, i, count;
925
927 clone = MSI_CreateRecord(count);
928 if (!clone)
929 return NULL;
930
931 for (i = 0; i <= count; i++)
932 {
933 if (rec->fields[i].type == MSIFIELD_STREAM)
934 {
935 if (FAILED(IStream_Clone(rec->fields[i].u.stream,
936 &clone->fields[i].u.stream)))
937 {
938 msiobj_release(&clone->hdr);
939 return NULL;
940 }
941 clone->fields[i].type = MSIFIELD_STREAM;
942 }
943 else
944 {
945 r = MSI_RecordCopyField(rec, i, clone, i);
946 if (r != ERROR_SUCCESS)
947 {
948 msiobj_release(&clone->hdr);
949 return NULL;
950 }
951 }
952 }
953
954 return clone;
955}
UINT MSI_RecordCopyField(MSIRECORD *in_rec, UINT in_n, MSIRECORD *out_rec, UINT out_n)
Definition: record.c:166
MSIRECORD * MSI_CreateRecord(UINT cParams)
Definition: record.c:76
UINT MSI_RecordGetFieldCount(const MSIRECORD *rec)
Definition: record.c:108

Referenced by iterate_properties(), merge_diff_row(), and MSI_FormatRecordW().

◆ MSI_CloseRecord()

void MSI_CloseRecord ( MSIOBJECTHDR *  arg)

Definition at line 67 of file record.c.

68{
69 MSIRECORD *rec = (MSIRECORD *) arg;
70 UINT i;
71
72 for( i=0; i<=rec->count; i++ )
73 MSI_FreeField( &rec->fields[i] );
74}

Referenced by MSI_CreateRecord(), and refresh_record().

◆ msi_commit_streams()

UINT msi_commit_streams ( MSIDATABASE *  db)

Definition at line 607 of file streams.c.

608{
609 UINT i;
610 const WCHAR *name;
611 WCHAR *encname;
613 HRESULT hr;
614
615 TRACE("got %u streams\n", db->num_streams);
616
617 for (i = 0; i < db->num_streams; i++)
618 {
620 if (!wcscmp( name, L"\5SummaryInformation" )) continue;
621
622 if (!(encname = encode_streamname( FALSE, name ))) return ERROR_OUTOFMEMORY;
623 TRACE("saving stream %s as %s\n", debugstr_w(name), debugstr_w(encname));
624
625 hr = IStorage_CreateStream( db->storage, encname, STGM_WRITE|STGM_SHARE_EXCLUSIVE, 0, 0, &stream );
626 if (SUCCEEDED( hr ))
627 {
629 if (FAILED( hr ))
630 {
631 ERR( "failed to write stream %s (hr = %#lx)\n", debugstr_w(encname), hr );
632 free( encname );
633 IStream_Release( stream );
635 }
636 hr = IStream_Commit( stream, 0 );
637 IStream_Release( stream );
638 if (FAILED( hr ))
639 {
640 ERR( "failed to commit stream %s (hr = %#lx)\n", debugstr_w(encname), hr );
641 free( encname );
643 }
644 }
645 else if (hr != STG_E_FILEALREADYEXISTS)
646 {
647 ERR( "failed to create stream %s (hr = %#lx)\n", debugstr_w(encname), hr );
648 free( encname );
650 }
651 free( encname );
652 }
653
654 return ERROR_SUCCESS;
655}
#define SUCCEEDED(hr)
Definition: intsafe.h:50
WCHAR * encode_streamname(BOOL is_table, const WCHAR *in) __WINE_DEALLOC(free) __WINE_MALLOC
const WCHAR * msi_string_lookup(const string_table *st, UINT id, int *len)
Definition: string.c:343
#define STGM_SHARE_EXCLUSIVE
Definition: objbase.h:942
#define STGM_WRITE
Definition: objbase.h:937
static HRESULT write_stream(IStream *dst, IStream *src)
Definition: streams.c:562
Definition: parse.h:23
MSISTREAM * streams
Definition: msipriv.h:120
UINT num_streams
Definition: msipriv.h:121
string_table * strings
Definition: msipriv.h:110
UINT str_index
Definition: msipriv.h:88
IStream * stream
Definition: msipriv.h:89
#define STG_E_FILEALREADYEXISTS
Definition: winerror.h:3674

Referenced by MsiDatabaseCommit().

◆ MSI_CommitTables()

UINT MSI_CommitTables ( MSIDATABASE *  db)

Definition at line 2903 of file table.c.

2904{
2905 UINT r, bytes_per_strref;
2906 HRESULT hr;
2907 MSITABLE *table = NULL;
2908
2909 TRACE("%p\n",db);
2910
2911 r = msi_save_string_table( db->strings, db->storage, &bytes_per_strref );
2912 if( r != ERROR_SUCCESS )
2913 {
2914 WARN("failed to save string table r=%08x\n",r);
2915 return r;
2916 }
2917
2919 {
2920 r = save_table( db, table, bytes_per_strref );
2921 if( r != ERROR_SUCCESS )
2922 {
2923 WARN("failed to save table %s (r=%08x)\n",
2924 debugstr_w(table->name), r);
2925 return r;
2926 }
2927 }
2928
2929 hr = IStorage_Commit( db->storage, 0 );
2930 if (FAILED( hr ))
2931 {
2932 WARN( "failed to commit changes %#lx\n", hr );
2934 }
2935 return r;
2936}
static UINT save_table(MSIDATABASE *db, const MSITABLE *t, UINT bytes_per_strref)
Definition: table.c:860
UINT msi_save_string_table(const string_table *st, IStorage *storage, UINT *bytes_per_strref)
Definition: string.c:564
const WCHAR * name

Referenced by MsiDatabaseCommit().

◆ msi_compare_file_versions()

int msi_compare_file_versions ( VS_FIXEDFILEINFO *  fi,
const WCHAR *  version 
)

Definition at line 1928 of file action.c.

1929{
1930 DWORD ms, ls;
1931
1933
1934 if (fi->dwFileVersionMS > ms) return 1;
1935 else if (fi->dwFileVersionMS < ms) return -1;
1936 else if (fi->dwFileVersionLS > ls) return 1;
1937 else if (fi->dwFileVersionLS < ls) return -1;
1938 return 0;
1939}
void msi_parse_version_string(LPCWSTR verStr, PDWORD ms, PDWORD ls)
Definition: appsearch.c:52
void ls(int argc, const char *argv[])
Definition: cmds.c:1136
static const WCHAR version[]
Definition: asmname.c:66
DWORD dwFileVersionLS
Definition: compat.h:903
DWORD dwFileVersionMS
Definition: compat.h:902

Referenced by ACTION_RemoveFiles(), calculate_file_cost(), and calculate_install_state().

◆ msi_compare_font_versions()

int msi_compare_font_versions ( const WCHAR *  ver1,
const WCHAR *  ver2 
)

Definition at line 1941 of file action.c.

1942{
1943 DWORD ms1, ms2;
1944
1945 msi_parse_version_string( ver1, &ms1, NULL );
1946 msi_parse_version_string( ver2, &ms2, NULL );
1947
1948 if (ms1 > ms2) return 1;
1949 else if (ms1 < ms2) return -1;
1950 return 0;
1951}

Referenced by calculate_file_cost(), and calculate_install_state().

◆ msi_copy_file()

BOOL msi_copy_file ( MSIPACKAGE *  package,
const WCHAR *  src,
const WCHAR *  dst,
BOOL  fail_if_exists 
)

Definition at line 70 of file files.c.

71{
72 BOOL ret;
74 ret = CopyFileW( src, dst, fail_if_exists );
76 return ret;
77}
BOOL WINAPI CopyFileW(IN LPCWSTR lpExistingFileName, IN LPCWSTR lpNewFileName, IN BOOL bFailIfExists)
Definition: copy.c:367
GLenum src
Definition: glext.h:6340
GLenum GLenum dst
Definition: glext.h:6340
static void msi_revert_fs_redirection(MSIPACKAGE *package)
Definition: msipriv.h:1103
static void msi_disable_fs_redirection(MSIPACKAGE *package)
Definition: msipriv.h:1099

Referenced by ACTION_InstallAdminPackage(), copy_file_attributes(), copy_install_file(), ITERATE_DuplicateFiles(), move_file(), and msi_patch_assembly().

◆ msi_create_assembly_enum()

IAssemblyEnum * msi_create_assembly_enum ( MSIPACKAGE *  package,
const WCHAR *  displayname 
)

Definition at line 244 of file assembly.c.

245{
246 HRESULT hr;
249 WCHAR *str;
250 DWORD len = 0;
251
252 if (!init_assembly_caches( package ) || !package->pCreateAssemblyNameObject || !package->pCreateAssemblyEnum)
253 return NULL;
254
255 hr = package->pCreateAssemblyNameObject( &name, displayname, CANOF_PARSE_DISPLAY_NAME, NULL );
256 if (FAILED( hr )) return NULL;
257
258 hr = IAssemblyName_GetName( name, &len, NULL );
259 if (hr != E_NOT_SUFFICIENT_BUFFER || !(str = malloc( len * sizeof(WCHAR) )))
260 {
261 IAssemblyName_Release( name );
262 return NULL;
263 }
264
265 hr = IAssemblyName_GetName( name, &len, str );
266 IAssemblyName_Release( name );
267 if (FAILED( hr ))
268 {
269 free( str );
270 return NULL;
271 }
272
273 hr = package->pCreateAssemblyNameObject( &name, str, 0, NULL );
274 free( str );
275 if (FAILED( hr )) return NULL;
276
277 hr = package->pCreateAssemblyEnum( &ret, NULL, name, ASM_CACHE_GAC, NULL );
278 IAssemblyName_Release( name );
279 if (FAILED( hr )) return NULL;
280
281 return ret;
282}
@ ASM_CACHE_GAC
Definition: fusion.idl:29
static BOOL init_assembly_caches(MSIPACKAGE *package)
Definition: assembly.c:54
#define E_NOT_SUFFICIENT_BUFFER
Definition: winerror.h:3437
@ CANOF_PARSE_DISPLAY_NAME
Definition: winsxs.idl:193

Referenced by msi_patch_assembly().

◆ msi_create_component_advertise_string()

WCHAR * msi_create_component_advertise_string ( MSIPACKAGE *  package,
MSICOMPONENT *  component,
const WCHAR *  feature 
)

Definition at line 5538 of file action.c.

5539{
5540 WCHAR productid_85[21], component_85[21], *ret;
5541 GUID clsid;
5542 DWORD sz;
5543
5544 /* > is used if there is a component GUID and < if not. */
5545
5546 productid_85[0] = 0;
5547 component_85[0] = 0;
5548 CLSIDFromString( package->ProductCode, &clsid );
5549
5550 encode_base85_guid( &clsid, productid_85 );
5551 if (component)
5552 {
5553 CLSIDFromString( component->ComponentId, &clsid );
5554 encode_base85_guid( &clsid, component_85 );
5555 }
5556
5557 TRACE("product=%s feature=%s component=%s\n", debugstr_w(productid_85), debugstr_w(feature),
5558 debugstr_w(component_85));
5559
5560 sz = 20 + lstrlenW( feature ) + 20 + 3;
5561 ret = calloc( 1, sz * sizeof(WCHAR) );
5562 if (ret) swprintf( ret, sz, L"%s%s%c%s", productid_85, feature, component ? '>' : '<', component_85 );
5563 return ret;
5564}

Referenced by ITERATE_PublishComponent(), and register_verb().

◆ msi_create_empty_local_file()

UINT msi_create_empty_local_file ( LPWSTR  path,
LPCWSTR  suffix 
)

Definition at line 1066 of file package.c.

1067{
1068 DWORD time, len, i, offset;
1069 HANDLE handle;
1070
1071 time = GetTickCount();
1073 lstrcatW( path, L"\\Installer\\" );
1075
1076 len = lstrlenW(path);
1077 for (i = 0; i < 0x10000; i++)
1078 {
1079 offset = swprintf( path + len, MAX_PATH - len, L"%x", (time + i) & 0xffff );
1080 memcpy( path + len + offset, suffix, (lstrlenW( suffix ) + 1) * sizeof(WCHAR) );
1084 {
1086 break;
1087 }
1090 return ERROR_FUNCTION_FAILED;
1091 }
1092
1093 return ERROR_SUCCESS;
1094}
#define INVALID_HANDLE_VALUE
Definition: compat.h:731
#define CreateFileW
Definition: compat.h:741
BOOL WINAPI CreateDirectoryW(IN LPCWSTR lpPathName, IN LPSECURITY_ATTRIBUTES lpSecurityAttributes)
Definition: dir.c:58
UINT WINAPI GetWindowsDirectoryW(OUT LPWSTR lpBuffer, IN UINT uSize)
Definition: path.c:2370
ULONG WINAPI DECLSPEC_HOTPATCH GetTickCount(void)
Definition: sync.c:182
GLintptr offset
Definition: glext.h:5920
__u16 time
Definition: mkdosfs.c:8
#define CREATE_NEW
Definition: disk.h:69
#define GENERIC_WRITE
Definition: nt_native.h:90
#define ERROR_SHARING_VIOLATION
Definition: winerror.h:257
#define ERROR_FILE_EXISTS
Definition: winerror.h:287

Referenced by apply_patch_package(), and MSI_OpenPackageW().

◆ msi_create_file()

HANDLE msi_create_file ( MSIPACKAGE *  package,
const WCHAR *  filename,
DWORD  access,
DWORD  sharing,
DWORD  creation,
DWORD  flags 
)

Definition at line 60 of file files.c.

62{
67 return handle;
68}
GLbitfield flags
Definition: glext.h:7161
const char * filename
Definition: ioapi.h:137
static OBJECT_ATTRIBUTES *static ULONG POBJECT_ATTRIBUTES PIO_STATUS_BLOCK ULONG sharing
Definition: pipe.c:95

Referenced by admin_create_dest_file(), cabinet_copy_file(), HANDLE_CustomType21_22(), ITERATE_PublishIcon(), load_ttf_name_id(), msi_get_disk_file_size(), and msi_get_filehash().

◆ msi_create_full_path()

BOOL msi_create_full_path ( MSIPACKAGE *  package,
const WCHAR *  path 
)

Definition at line 211 of file files.c.

212{
213 BOOL ret = TRUE;
214 WCHAR *new_path;
215 int len;
216
217 if (!(new_path = malloc( (wcslen( path ) + 1) * sizeof(WCHAR) ))) return FALSE;
218 lstrcpyW( new_path, path );
219
220 while ((len = lstrlenW( new_path )) && new_path[len - 1] == '\\')
221 new_path[len - 1] = 0;
222
223 while (!create_directory( package, new_path ))
224 {
225 WCHAR *slash;
227 if (last_error == ERROR_ALREADY_EXISTS) break;
229 {
230 ret = FALSE;
231 break;
232 }
233 if (!(slash = wcsrchr( new_path, '\\' )))
234 {
235 ret = FALSE;
236 break;
237 }
238 len = slash - new_path;
239 new_path[len] = 0;
240 if (!msi_create_full_path( package, new_path ))
241 {
242 ret = FALSE;
243 break;
244 }
245 new_path[len] = '\\';
246 }
247 free( new_path );
248 return ret;
249}
static BOOL create_directory(MSIPACKAGE *package, const WCHAR *path)
Definition: files.c:88
#define ERROR_ALREADY_EXISTS
Definition: disk.h:80
#define ERROR_PATH_NOT_FOUND
Definition: winerror.h:228

Referenced by admin_create_dest_file(), create_folder(), get_duplicate_filename(), get_link_file(), ITERATE_CreateFolders(), ITERATE_MoveFiles(), msi_build_icon_path(), and msi_create_full_path().

◆ msi_create_temp_file()

WCHAR * msi_create_temp_file ( MSIDATABASE *  db)

Definition at line 214 of file custom.c.

215{
216 WCHAR *ret;
217
218 if (!db->tempfolder)
219 {
220 WCHAR tmp[MAX_PATH];
221 DWORD len = ARRAY_SIZE( tmp );
222
223 if (msi_get_property( db, L"TempFolder", tmp, &len ) ||
225 {
226 GetTempPathW( MAX_PATH, tmp );
227 }
228 if (!(db->tempfolder = wcsdup( tmp ))) return NULL;
229 }
230
231 if ((ret = malloc( (wcslen( db->tempfolder ) + 20) * sizeof(WCHAR) )))
232 {
233 if (!GetTempFileNameW( db->tempfolder, L"msi", 0, ret ))
234 {
235 free( ret );
236 return NULL;
237 }
238 }
239
240 return ret;
241}
DWORD WINAPI GetFileAttributesW(LPCWSTR lpFileName)
Definition: fileinfo.c:636
DWORD WINAPI GetTempPathW(IN DWORD count, OUT LPWSTR path)
Definition: path.c:2098
UINT WINAPI GetTempFileNameW(IN LPCWSTR lpPathName, IN LPCWSTR lpPrefixString, IN UINT uUnique, OUT LPWSTR lpTempFileName)
Definition: filename.c:84
UINT msi_get_property(MSIDATABASE *, LPCWSTR, LPWSTR, LPDWORD)
Definition: package.c:2282
#define FILE_ATTRIBUTE_DIRECTORY
Definition: nt_native.h:705
LPWSTR tempfolder
Definition: msipriv.h:114

Referenced by create_temp_binary(), HANDLE_CustomType7(), load_image(), patch_file(), and patchfiles_cb().

◆ MSI_CreatePackage()

MSIPACKAGE * MSI_CreatePackage ( MSIDATABASE *  db)

Definition at line 981 of file package.c.

982{
983 MSIPACKAGE *package;
984 WCHAR uilevel[11];
985 int len;
986 UINT r;
987
988 TRACE("%p\n", db);
989
990 package = alloc_package();
991 if (package)
992 {
993 msiobj_addref( &db->hdr );
994 package->db = db;
995
996 package->LastAction = NULL;
997 package->LastActionTemplate = NULL;
999 package->WordCount = 0;
1000 package->PackagePath = wcsdup( db->path );
1001
1002 create_temp_property_table( package );
1003 msi_clone_properties( package->db );
1005
1006 package->ProductCode = msi_dup_property( package->db, L"ProductCode" );
1007
1008 set_installer_properties( package );
1009
1010 package->ui_level = gUILevel;
1011 len = swprintf( uilevel, ARRAY_SIZE(uilevel), L"%u", gUILevel & INSTALLUILEVEL_MASK );
1012 msi_set_property( package->db, L"UILevel", uilevel, len );
1013
1014 r = msi_load_suminfo_properties( package );
1015 if (r != ERROR_SUCCESS)
1016 {
1017 msiobj_release( &package->hdr );
1018 return NULL;
1019 }
1020
1022 load_admin_properties( package );
1023
1024 package->log_file = INVALID_HANDLE_VALUE;
1025 package->script = SCRIPT_NONE;
1026 }
1027 return package;
1028}
static VOID set_installer_properties(MSIPACKAGE *package)
Definition: package.c:631
static UINT create_temp_property_table(MSIPACKAGE *package)
Definition: package.c:365
static UINT load_admin_properties(MSIPACKAGE *package)
Definition: package.c:952
INSTALLUILEVEL gUILevel
Definition: msi_main.c:41
@ msidbSumInfoSourceTypeAdminImage
Definition: msidefs.h:223
#define INSTALLUILEVEL_MASK
Definition: msipriv.h:60
UINT msi_clone_properties(MSIDATABASE *)
Definition: package.c:381
UINT msi_load_suminfo_properties(MSIPACKAGE *package)
Definition: suminfo.c:1266
void msi_adjust_privilege_properties(MSIPACKAGE *)
Definition: package.c:967
LPWSTR path
Definition: msipriv.h:112
UINT WordCount
Definition: msipriv.h:472
LPWSTR LastAction
Definition: msipriv.h:424
MSIOBJECTHDR hdr
Definition: msipriv.h:406
INSTALLUILEVEL ui_level
Definition: msipriv.h:466
HANDLE log_file
Definition: msipriv.h:428
LPWSTR LastActionTemplate
Definition: msipriv.h:425
UINT LastActionResult
Definition: msipriv.h:426

◆ MSI_CreateRecord()

MSIRECORD * MSI_CreateRecord ( UINT  cParams)

Definition at line 76 of file record.c.

77{
78 MSIRECORD *rec;
79
80 TRACE("%d\n", cParams);
81
82 if( cParams>65535 )
83 return NULL;
84
87 if( rec )
88 rec->count = cParams;
89 return rec;
90}
void * alloc_msiobject(UINT type, UINT size, msihandledestructor destroy)
Definition: handle.c:201
void MSI_CloseRecord(MSIOBJECTHDR *arg)
Definition: record.c:67
const char * fields[10]
Definition: parser.c:313
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:255

Referenced by ACTION_AllocateRegistrySpace(), ACTION_ExecuteAction(), ACTION_MsiPublishAssemblies(), ACTION_MsiUnpublishAssemblies(), ACTION_ProcessComponents(), ACTION_PublishFeatures(), ACTION_PublishProduct(), ACTION_RegisterClassInfo(), ACTION_RegisterExtensionInfo(), ACTION_RegisterMIMEInfo(), ACTION_RegisterProduct(), ACTION_RegisterProgIdInfo(), ACTION_RegisterUser(), ACTION_RemoveFiles(), ACTION_ResolveSource(), ACTION_ShowDialog(), ACTION_UnregisterClassInfo(), ACTION_UnregisterExtensionInfo(), ACTION_UnregisterMIMEInfo(), ACTION_UnregisterProgIdInfo(), add_stream(), arrange_record(), change_media(), construct_record(), deformat_string(), dialog_create(), dialog_seltree_handler(), event_set_target_path(), file_update_ui(), get_property_row(), get_transform_record(), internal_ui_handler(), ITERATE_AppSearch(), ITERATE_CreateFolders(), ITERATE_DeleteService(), ITERATE_DuplicateFiles(), ITERATE_FindRelatedProducts(), ITERATE_InstallODBCDataSource(), ITERATE_InstallODBCDriver(), ITERATE_InstallODBCTranslator(), ITERATE_MoveFiles(), ITERATE_PublishComponent(), ITERATE_RegisterFonts(), ITERATE_RemoveDuplicateFiles(), ITERATE_RemoveEnvironmentString(), ITERATE_RemoveFiles(), ITERATE_RemoveFolders(), ITERATE_RemoveIniValuesOnInstall(), ITERATE_RemoveIniValuesOnUninstall(), ITERATE_RemoveODBCDataSource(), ITERATE_RemoveODBCDriver(), ITERATE_RemoveODBCTranslator(), ITERATE_RemoveRegistryValuesOnInstall(), ITERATE_RemoveRegistryValuesOnUninstall(), ITERATE_SelfRegModules(), ITERATE_SelfUnregModules(), ITERATE_StartService(), ITERATE_StopService(), ITERATE_UnpublishComponent(), ITERATE_UnregisterFonts(), ITERATE_WriteEnvironmentString(), ITERATE_WriteIniValues(), ITERATE_WriteRegistryValues(), msi_clone_properties(), MSI_CloneRecord(), msi_create_table(), MSI_DatabaseGetPrimaryKeys(), MSI_OpenPackageW(), msi_query_merge_record(), msi_set_property(), msi_ui_progress(), msi_view_get_row(), MSI_ViewGetColumnInfo(), MsiCreateRecord(), patch_add_media(), patch_offset_get_filepatches(), patch_offset_get_files(), patch_offset_modify_db(), patch_update_filepatch_sequence(), SELECT_set_row(), TABLE_add_column(), TABLE_drop(), TABLE_remove_column(), translate_record(), ui_actioninfo(), ui_actionstart(), unpublish_feature(), UPDATE_execute(), and WHERE_set_row().

◆ MSI_DatabaseApplyTransformW()

UINT MSI_DatabaseApplyTransformW ( MSIDATABASE *  db,
LPCWSTR  szTransformFile,
int  iErrorCond 
)

Referenced by msi_apply_transforms().

◆ MSI_DatabaseGetPrimaryKeys()

UINT MSI_DatabaseGetPrimaryKeys ( MSIDATABASE *  ,
LPCWSTR  ,
MSIRECORD **   
)

◆ MSI_DatabaseIsTablePersistent()

MSICONDITION MSI_DatabaseIsTablePersistent ( MSIDATABASE *  db,
LPCWSTR  table 
)

Definition at line 2938 of file table.c.

2939{
2940 MSITABLE *t;
2941 UINT r;
2942
2943 TRACE("%p %s\n", db, debugstr_w(table));
2944
2945 if (!table)
2946 return MSICONDITION_ERROR;
2947
2948 r = get_table( db, table, &t );
2949 if (r != ERROR_SUCCESS)
2950 return MSICONDITION_NONE;
2951
2952 return t->persistent;
2953}
static UINT get_table(MSIDATABASE *db, LPCWSTR name, MSITABLE **table_ret)
Definition: table.c:575
@ MSICONDITION_ERROR
Definition: msiquery.h:29
@ MSICONDITION_NONE
Definition: msiquery.h:28

Referenced by MsiDatabaseIsTablePersistentW().

◆ MSI_DatabaseOpenViewW()

UINT MSI_DatabaseOpenViewW ( MSIDATABASE *  ,
LPCWSTR  ,
MSIQUERY **   
)

Referenced by ACTION_BindImage(), ACTION_CostFinalize(), ACTION_CreateFolders(), ACTION_CreateShortcuts(), ACTION_DeleteServices(), ACTION_DuplicateFiles(), ACTION_FindRelatedProducts(), ACTION_InstallODBC(), ACTION_InstallServices(), ACTION_InstallValidate(), ACTION_LaunchConditions(), ACTION_MigrateFeatureStates(), ACTION_MoveFiles(), ACTION_ProcessUISequence(), ACTION_PublishComponents(), ACTION_RegisterFonts(), ACTION_RegisterTypeLibraries(), ACTION_RemoveDuplicateFiles(), ACTION_RemoveEnvironmentStrings(), ACTION_RemoveExistingProducts(), ACTION_RemoveFiles(), ACTION_RemoveFolders(), ACTION_RemoveIniValues(), ACTION_RemoveODBC(), ACTION_RemoveRegistryValues(), ACTION_RemoveShortcuts(), ACTION_SelfRegModules(), ACTION_SelfUnregModules(), ACTION_SetODBCFolders(), ACTION_StartServices(), ACTION_StopServices(), ACTION_UnpublishComponents(), ACTION_UnregisterFonts(), ACTION_UnregisterTypeLibraries(), ACTION_WriteEnvironmentStrings(), ACTION_WriteIniValues(), ACTION_WriteRegistryValues(), add_stream(), add_table_to_db(), create_temp_property_table(), gather_merge_data(), get_property(), get_property_row(), is_uninstallable(), load_all_classes(), load_all_drlocators(), load_all_extensions(), load_all_files(), load_all_folders(), load_all_media(), load_all_mimes(), load_all_patches(), load_all_progids(), load_all_verbs(), merge_diff_row(), msi_clone_properties(), msi_load_all_components(), msi_load_all_features(), msi_set_property(), msi_table_apply_transform(), patch_add_media(), patch_offset_get_filepatches(), patch_offset_get_files(), patch_offset_modify_db(), patch_set_media_source_prop(), patch_set_offsets(), patch_update_filepatch_sequence(), publish_icons(), TransformView_add_column(), TransformView_Create(), TransformView_create_table(), TransformView_delete_row(), TransformView_drop_table(), TransformView_insert_row(), TransformView_set_row(), ui_sequence_exists(), and unpublish_icons().

◆ msi_delete_file()

BOOL msi_delete_file ( MSIPACKAGE *  package,
const WCHAR *  filename 
)

Definition at line 79 of file files.c.

80{
81 BOOL ret;
85 return ret;
86}
BOOL WINAPI DeleteFileW(IN LPCWSTR lpFileName)
Definition: delete.c:39

Referenced by ACTION_RemoveFiles(), cabinet_copy_file(), ITERATE_PublishIcon(), ITERATE_RemoveDuplicateFiles(), ITERATE_RemoveFiles(), ITERATE_RemoveShortcuts(), ITERATE_UnpublishIcon(), and patch_file().

◆ msi_destroy_assembly_caches()

void msi_destroy_assembly_caches ( MSIPACKAGE *  package)

Definition at line 89 of file assembly.c.

90{
91 UINT i;
92
93 if (package->cache_sxs)
94 {
95 IAssemblyCache_Release( package->cache_sxs );
96 package->cache_sxs = NULL;
97 }
98 for (i = 0; i < CLR_VERSION_MAX; i++)
99 {
100 if (package->cache_net[i])
101 {
102 IAssemblyCache_Release( package->cache_net[i] );
103 package->cache_net[i] = NULL;
104 }
105 }
106 package->pGetFileVersion = NULL;
107 package->pCreateAssemblyNameObject = NULL;
108 package->pCreateAssemblyEnum = NULL;
109 FreeLibrary( package->hfusion10 );
110 FreeLibrary( package->hfusion11 );
111 FreeLibrary( package->hfusion20 );
112 FreeLibrary( package->hfusion40 );
113 FreeLibrary( package->hmscoree );
114 package->hfusion10 = NULL;
115 package->hfusion11 = NULL;
116 package->hfusion20 = NULL;
117 package->hfusion40 = NULL;
118 package->hmscoree = NULL;
119}
#define FreeLibrary(x)
Definition: compat.h:748
WCHAR DWORD const WCHAR void IUnknown IAssemblyName void *IAssemblyCache * cache_net[CLR_VERSION_MAX]
Definition: msipriv.h:437
HMODULE hfusion20
Definition: msipriv.h:431
HMODULE hfusion11
Definition: msipriv.h:430
HMODULE hfusion10
Definition: msipriv.h:429
HMODULE hmscoree
Definition: msipriv.h:433
HMODULE hfusion40
Definition: msipriv.h:432
IAssemblyCache * cache_sxs
Definition: msipriv.h:438

Referenced by MSI_FreePackage().

◆ msi_destroy_stringtable()

VOID msi_destroy_stringtable ( string_table *  st)

Definition at line 107 of file string.c.

108{
109 UINT i;
110
111 for( i=0; i<st->maxcount; i++ )
112 {
113 if( st->strings[i].persistent_refcount ||
114 st->strings[i].nonpersistent_refcount )
115 free( st->strings[i].data );
116 }
117 free( st->strings );
118 free( st->sorted );
119 free( st );
120}
UINT * sorted
Definition: string.c:58
UINT maxcount
Definition: string.c:53

Referenced by MSI_CloseDatabase(), and msi_table_apply_transform().

◆ msi_dialog_check_messages()

void msi_dialog_check_messages ( HANDLE  handle)

Definition at line 3991 of file dialog.c.

3992{
3993 DWORD r;
3994
3995 /* in threads other than the UI thread, block */
3997 {
3998 if (!handle) return;
4000 {
4001 MSG msg;
4002 while (PeekMessageW( &msg, NULL, 0, 0, PM_REMOVE ))
4003 {
4006 }
4007 }
4008 return;
4009 }
4010
4011 /* there are two choices for the UI thread */
4012 while (1)
4013 {
4015
4016 if( !handle )
4017 break;
4018
4019 /*
4020 * block here until somebody creates a new dialog or
4021 * the handle we're waiting on becomes ready
4022 */
4024 if( r == WAIT_OBJECT_0 )
4025 break;
4026 }
4027}
#define msg(x)
Definition: auth_time.c:54
static void process_pending_messages(HWND hdlg)
Definition: dialog.c:3831
static DWORD uiThreadId
Definition: dialog.c:131
BOOL WINAPI TranslateMessage(_In_ const MSG *)
#define QS_ALLINPUT
Definition: winuser.h:914
DWORD WINAPI MsgWaitForMultipleObjects(_In_ DWORD nCount, _In_reads_opt_(nCount) CONST HANDLE *pHandles, _In_ BOOL fWaitAll, _In_ DWORD dwMilliseconds, _In_ DWORD dwWakeMask)
DWORD WINAPI MsgWaitForMultipleObjectsEx(_In_ DWORD nCount, _In_reads_opt_(nCount) CONST HANDLE *pHandles, _In_ DWORD dwMilliseconds, _In_ DWORD dwWakeMask, _In_ DWORD dwFlags)
BOOL WINAPI PeekMessageW(_Out_ LPMSG, _In_opt_ HWND, _In_ UINT, _In_ UINT, _In_ UINT)
#define PM_REMOVE
Definition: winuser.h:1207
LRESULT WINAPI DispatchMessageW(_In_ const MSG *)
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1829
#define WAIT_OBJECT_0
Definition: winbase.h:383

Referenced by ACTION_FinishCustomActions(), dialog_handle_event(), ITERATE_Actions(), msi_ui_progress(), register_dll(), wait_process_handle(), and wait_thread_handle().

◆ msi_dialog_destroy()

void msi_dialog_destroy ( msi_dialog *  dialog)

Definition at line 4059 of file dialog.c.

4060{
4061 struct font *font, *next;
4062
4064 {
4066 return;
4067 }
4068
4069 if( dialog->hwnd )
4070 {
4071 ShowWindow( dialog->hwnd, SW_HIDE );
4072 DestroyWindow( dialog->hwnd );
4073 }
4074
4075 /* unsubscribe events */
4076 event_cleanup_subscriptions( dialog->package, dialog->name );
4077
4078 /* destroy the list of controls */
4079 while( !list_empty( &dialog->controls ) )
4080 {
4081 struct control *t;
4082
4083 t = LIST_ENTRY( list_head( &dialog->controls ), struct control, entry );
4084 destroy_control( t );
4085 }
4086
4087 /* destroy the list of fonts */
4088 LIST_FOR_EACH_ENTRY_SAFE( font, next, &dialog->fonts, struct font, entry )
4089 {
4090 list_remove( &font->entry );
4091 DeleteObject( font->hfont );
4092 free( font );
4093 }
4094 free( dialog->default_font );
4095
4096 free( dialog->control_default );
4097 free( dialog->control_cancel );
4098 dialog->package = NULL;
4099 free( dialog );
4100}
#define WM_MSI_DIALOG_DESTROY
Definition: dialog.c:127
static void destroy_control(struct control *t)
Definition: dialog.c:355
static void event_cleanup_subscriptions(MSIPACKAGE *package, const WCHAR *dialog)
Definition: dialog.c:4045
static HWND hMsiHiddenWindow
Definition: dialog.c:132
pKey DeleteObject()
LONG_PTR LPARAM
Definition: minwindef.h:175
static HWND dialog
Definition: gui.c:33
Definition: mk_font.cpp:20
#define SW_HIDE
Definition: winuser.h:779
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
BOOL WINAPI DestroyWindow(_In_ HWND)
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
static unsigned __int64 next
Definition: rand_nt.c:6
Definition: dialog.c:52

Referenced by dialog_create(), event_do_dialog(), MSI_FreePackage(), MSI_PreviewDialogW(), and MSIHiddenWindowProc().

◆ msi_dialog_unregister_class()

void msi_dialog_unregister_class ( void  )

Definition at line 4102 of file dialog.c.

4103{
4106 UnregisterClassW( L"MsiDialogCloseClass", NULL );
4107 UnregisterClassW( L"MsiHiddenWindow", NULL );
4108 uiThreadId = 0;
4109}
BOOL WINAPI UnregisterClassW(_In_ LPCWSTR, HINSTANCE)

Referenced by DllMain().

◆ msi_disable_fs_redirection()

static void msi_disable_fs_redirection ( MSIPACKAGE *  package)
inlinestatic

◆ msi_download_file()

UINT msi_download_file ( LPCWSTR  szUrl,
LPWSTR  filename 
)

Definition at line 1030 of file package.c.

1031{
1033 DWORD size = 0;
1034 HRESULT hr;
1035
1036 /* call will always fail, because size is 0,
1037 * but will return ERROR_FILE_NOT_FOUND first
1038 * if the file doesn't exist
1039 */
1040 GetUrlCacheEntryInfoW( szUrl, NULL, &size );
1042 {
1043 cache_entry = malloc( size );
1044 if ( !GetUrlCacheEntryInfoW( szUrl, cache_entry, &size ) )
1045 {
1047 free( cache_entry );
1048 return error;
1049 }
1050
1051 lstrcpyW( filename, cache_entry->lpszLocalFileName );
1052 free( cache_entry );
1053 return ERROR_SUCCESS;
1054 }
1055
1057 if ( FAILED(hr) )
1058 {
1059 WARN("failed to download %s to cache file\n", debugstr_w(szUrl));
1060 return ERROR_FUNCTION_FAILED;
1061 }
1062
1063 return ERROR_SUCCESS;
1064}
BOOL WINAPI GetUrlCacheEntryInfoW(LPCWSTR lpszUrl, LPINTERNET_CACHE_ENTRY_INFOW lpCacheEntryInfo, LPDWORD lpdwCacheEntryInfoBufferSize)
Definition: urlcache.c:2012
#define error(str)
Definition: mkdosfs.c:1605
#define ERROR_FILE_NOT_FOUND
Definition: disk.h:79
Definition: wininet.h:2127
Definition: svc_auth_des.c:77
HRESULT WINAPI URLDownloadToCacheFileW(LPUNKNOWN lpUnkCaller, LPCWSTR szURL, LPWSTR szFileName, DWORD dwBufLength, DWORD dwReserved, LPBINDSTATUSCALLBACK pBSC)
Definition: umon.c:868

Referenced by MSI_OpenPackageW(), and ready_media().

◆ msi_dup_property()

◆ msi_dup_record_field()

WCHAR * msi_dup_record_field ( MSIRECORD *  row,
INT  index 
)

Definition at line 1002 of file record.c.

1003{
1004 DWORD sz = 0;
1005 WCHAR *str;
1006 UINT r;
1007
1008 if (MSI_RecordIsNull( rec, field )) return NULL;
1009
1010 r = MSI_RecordGetStringW( rec, field, NULL, &sz );
1011 if (r != ERROR_SUCCESS)
1012 return NULL;
1013
1014 sz++;
1015 str = malloc( sz * sizeof(WCHAR) );
1016 if (!str) return NULL;
1017 str[0] = 0;
1018 r = MSI_RecordGetStringW( rec, field, str, &sz );
1019 if (r != ERROR_SUCCESS)
1020 {
1021 ERR("failed to get string!\n");
1022 free( str );
1023 return NULL;
1024 }
1025 return str;
1026}
UINT MSI_RecordGetStringW(MSIRECORD *rec, UINT iField, WCHAR *szValue, DWORD *pcchValue)
Definition: record.c:438
BOOL MSI_RecordIsNull(MSIRECORD *rec, UINT iField)
Definition: record.c:321
Definition: parser.c:44

Referenced by get_ini_file_name(), get_key_value(), get_link_file(), get_signature(), internal_ui_handler(), iterate_load_verb(), ITERATE_RegisterFonts(), ITERATE_UnregisterFonts(), load_appid(), load_class(), load_component(), load_drlocator(), load_extension(), load_feature(), load_file(), load_folder(), load_mime(), load_progid(), MSI_FormatRecordW(), msi_get_error_message(), MSI_ProcessMessage(), patch_add_media(), patch_offset_get_filepatches(), patch_offset_get_files(), and search_ini().

◆ MSI_EvaluateConditionW()

◆ msi_event_cleanup_all_subscriptions()

void msi_event_cleanup_all_subscriptions ( MSIPACKAGE *  package)

Definition at line 4111 of file dialog.c.

4112{
4113 struct list *item, *next;
4114
4116 {
4117 struct subscriber *sub = LIST_ENTRY( item, struct subscriber, entry );
4118 list_remove( &sub->entry );
4119 free_subscriber( sub );
4120 }
4121}
static void free_subscriber(struct subscriber *sub)
Definition: dialog.c:4037
#define LIST_FOR_EACH_SAFE(cursor, cursor2, list)
Definition: list.h:230
struct list entry
Definition: dialog.c:104
struct list subscriptions
Definition: msipriv.h:475

Referenced by event_new_dialog(), and free_package_structures().

◆ msi_event_fire()

void msi_event_fire ( MSIPACKAGE *  package,
const WCHAR *  event,
MSIRECORD *  rec 
)

Definition at line 4421 of file dialog.c.

4422{
4423 struct subscriber *sub;
4424
4425 TRACE("firing event %s\n", debugstr_w(event));
4426
4427 LIST_FOR_EACH_ENTRY( sub, &package->subscriptions, struct subscriber, entry )
4428 {
4429 if (wcsicmp( sub->event, event )) continue;
4430 dialog_handle_event( sub->dialog, sub->control, sub->attribute, rec );
4431 }
4432}
#define wcsicmp
Definition: compat.h:15
static void dialog_handle_event(msi_dialog *dialog, const WCHAR *control, const WCHAR *attribute, MSIRECORD *rec)
Definition: dialog.c:555
Definition: filter.c:185
WCHAR * event
Definition: dialog.c:106
WCHAR * attribute
Definition: dialog.c:108
WCHAR * control
Definition: dialog.c:107
msi_dialog * dialog
Definition: dialog.c:105

Referenced by dialog_seltree_handler(), event_set_target_path(), and internal_ui_handler().

◆ msi_export_suminfo()

UINT msi_export_suminfo ( MSIDATABASE *  db,
HANDLE  handle 
)

Definition at line 1194 of file suminfo.c.

1195{
1196 UINT i, r, num_rows;
1198
1199 r = msi_get_suminfo( db->storage, 0, &si );
1200 if (r != ERROR_SUCCESS)
1201 r = msi_get_db_suminfo( db, 0, &si );
1202 if (r != ERROR_SUCCESS)
1203 return r;
1204
1205 num_rows = get_property_count( si->property );
1206 if (!num_rows)
1207 {
1208 msiobj_release( &si->hdr );
1209 return ERROR_FUNCTION_FAILED;
1210 }
1211
1212 for (i = 0; i < num_rows; i++)
1213 {
1214 r = save_prop( si, handle, i );
1215 if (r != ERROR_SUCCESS)
1216 {
1217 msiobj_release( &si->hdr );
1218 return r;
1219 }
1220 }
1221
1222 msiobj_release( &si->hdr );
1223 return ERROR_SUCCESS;
1224}
UINT msi_get_db_suminfo(MSIDATABASE *db, UINT uiUpdateCount, MSISUMMARYINFO **ret)
Definition: suminfo.c:491
static UINT save_prop(MSISUMMARYINFO *si, HANDLE handle, UINT row)
Definition: suminfo.c:1118
static UINT get_property_count(const PROPVARIANT *property)
Definition: suminfo.c:157
JSAMPARRAY int num_rows
Definition: jpegint.h:420

Referenced by export_summaryinformation().

◆ msi_find_first_file()

HANDLE msi_find_first_file ( MSIPACKAGE *  package,
const WCHAR *  filename,
WIN32_FIND_DATAW *  data 
)

Definition at line 124 of file files.c.

125{
129 msi_revert_fs_redirection( package );
130 return handle;
131}
HANDLE WINAPI FindFirstFileW(IN LPCWSTR lpFileName, OUT LPWIN32_FIND_DATAW lpFindFileData)
Definition: find.c:320

Referenced by move_files_wildcard(), and recurse_search_directory().

◆ msi_find_next_file()

BOOL msi_find_next_file ( MSIPACKAGE *  package,
HANDLE  handle,
WIN32_FIND_DATAW *  data 
)

Definition at line 133 of file files.c.

134{
135 BOOL ret;
138 msi_revert_fs_redirection( package );
139 return ret;
140}
BOOL WINAPI FindNextFileW(IN HANDLE hFindFile, OUT LPWIN32_FIND_DATAW lpFindFileData)
Definition: find.c:382

Referenced by move_files_wildcard(), and recurse_search_directory().

◆ MSI_FormatRecordW()

UINT MSI_FormatRecordW ( MSIPACKAGE *  package,
MSIRECORD *  record,
LPWSTR  buffer,
LPDWORD  size 
)

Definition at line 838 of file format.c.

840{
841 WCHAR *format, *deformated = NULL;
843 DWORD len;
844 MSIRECORD *record_deformated;
845 int field_count, i;
846
848
849 if (!(format = msi_dup_record_field( record, 0 )))
851
852 field_count = MSI_RecordGetFieldCount(record);
853 record_deformated = MSI_CloneRecord(record);
854 if (!record_deformated)
855 {
857 goto end;
858 }
859 MSI_RecordSetStringW(record_deformated, 0, format);
860 for (i = 1; i <= field_count; i++)
861 {
863 {
864 deformat_string_internal(package, MSI_RecordGetString(record, i), &deformated, &len, NULL);
865 MSI_RecordSetStringW(record_deformated, i, deformated);
866 free(deformated);
867 }
868 }
869
870 deformat_string_internal(package, format, &deformated, &len, record_deformated);
871 if (buffer)
872 {
873 if (*size>len)
874 {
875 memcpy(buffer,deformated,len*sizeof(WCHAR));
876 rc = ERROR_SUCCESS;
877 buffer[len] = 0;
878 }
879 else
880 {
881 if (*size > 0)
882 {
883 memcpy(buffer,deformated,(*size)*sizeof(WCHAR));
884 buffer[(*size)-1] = 0;
885 }
886 rc = ERROR_MORE_DATA;
887 }
888 }
889 else rc = ERROR_SUCCESS;
890
891 *size = len;
892 msiobj_release(&record_deformated->hdr);
893end:
894 free( format );
895 free( deformated );
896 return rc;
897}
#define ERROR_MORE_DATA
Definition: dderror.h:13
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
static DWORD deformat_string_internal(MSIPACKAGE *package, LPCWSTR ptr, WCHAR **data, DWORD *len, MSIRECORD *record)
Definition: format.c:756
static WCHAR * build_default_format(const MSIRECORD *record)
Definition: format.c:342
void dump_record(MSIRECORD *)
Definition: record.c:1028
WCHAR * msi_dup_record_field(MSIRECORD *row, INT index) __WINE_DEALLOC(free) __WINE_MALLOC
Definition: record.c:1002
UINT MSI_RecordGetFieldCount(const MSIRECORD *rec)
Definition: record.c:108
MSIRECORD * MSI_CloneRecord(MSIRECORD *)
Definition: record.c:921

Referenced by deformat_string(), MSI_ProcessMessageVerbatim(), MsiFormatRecordA(), and MsiFormatRecordW().

◆ msi_free_action_script()

void msi_free_action_script ( MSIPACKAGE *  package,
UINT  script 
)

Definition at line 137 of file package.c.

138{
139 UINT i;
140 for (i = 0; i < package->script_actions_count[script]; i++)
141 free( package->script_actions[script][i] );
142
143 free( package->script_actions[script] );
144 package->script_actions[script] = NULL;
145 package->script_actions_count[script] = 0;
146}
LPWSTR * script_actions[SCRIPT_MAX]
Definition: msipriv.h:447
int script_actions_count[SCRIPT_MAX]
Definition: msipriv.h:448

Referenced by execute_script(), and free_package_structures().

◆ msi_free_handle_table()

void msi_free_handle_table ( void  )

Definition at line 71 of file handle.c.

72{
78}
static unsigned int handle_table_size
Definition: handle.c:69
static CRITICAL_SECTION object_cs
Definition: handle.c:48
void WINAPI DeleteCriticalSection(PCRITICAL_SECTION)

Referenced by DllMain().

◆ msi_free_media_info()

void msi_free_media_info ( MSIMEDIAINFO *  mi)

Definition at line 649 of file media.c.

650{
651 free(mi->disk_prompt);
652 free(mi->cabinet);
653 free(mi->volume_label);
654 free(mi->last_volume);
655 free(mi);
656}

Referenced by ACTION_InstallFiles(), and ACTION_PatchFiles().

◆ msi_free_patchinfo()

void msi_free_patchinfo ( MSIPATCHINFO *  patch)

Definition at line 865 of file patch.c.

866{
867 free( patch->patchcode );
868 free( patch->products );
869 free( patch->transforms );
870 free( patch->filename );
871 free( patch->localfile );
872 free( patch );
873}
LPWSTR patchcode
Definition: msipriv.h:201
LPWSTR transforms
Definition: msipriv.h:203
LPWSTR products
Definition: msipriv.h:202
LPWSTR filename
Definition: msipriv.h:204

Referenced by apply_patch_package(), free_package_structures(), and msi_apply_registered_patch().

◆ msi_get_assembly_path()

WCHAR * msi_get_assembly_path ( MSIPACKAGE *  package,
const WCHAR *  displayname 
)

Definition at line 219 of file assembly.c.

220{
221 HRESULT hr;
224
225 if (!init_assembly_caches( package ) || !(cache = package->cache_net[CLR_VERSION_V40])) return NULL;
226
227 memset( &info, 0, sizeof(info) );
228 info.cbAssemblyInfo = sizeof(info);
229 hr = IAssemblyCache_QueryAssemblyInfo( cache, 0, displayname, &info );
230 if (hr != E_NOT_SUFFICIENT_BUFFER) return NULL;
231
232 if (!(info.pszCurrentAssemblyPathBuf = malloc( info.cchBuf * sizeof(WCHAR) ))) return NULL;
233
234 hr = IAssemblyCache_QueryAssemblyInfo( cache, 0, displayname, &info );
235 if (FAILED( hr ))
236 {
237 free( info.pszCurrentAssemblyPathBuf );
238 return NULL;
239 }
240 TRACE("returning %s\n", debugstr_w(info.pszCurrentAssemblyPathBuf));
241 return info.pszCurrentAssemblyPathBuf;
242}
#define memset(x, y, z)
Definition: compat.h:39
Definition: cache.c:41

Referenced by msi_patch_assembly().

◆ msi_get_command_line_option()

const WCHAR * msi_get_command_line_option ( const WCHAR *  cmd,
const WCHAR *  option,
UINT *  len 
)

Definition at line 266 of file action.c.

267{
268 DWORD opt_len = lstrlenW(option);
269
270 if (!cmd)
271 return NULL;
272
273 while (*cmd)
274 {
275 BOOL found = FALSE;
276
277 while (*cmd == ' ') cmd++;
278 if (!*cmd) break;
279
280 if(!wcsnicmp(cmd, option, opt_len))
281 found = TRUE;
282
283 cmd = wcschr( cmd, '=' );
284 if(!cmd) break;
285 cmd++;
286 while (*cmd == ' ') cmd++;
287 if (!*cmd) break;
288
289 *len = parse_prop( cmd, NULL, NULL);
290 if (found) return cmd;
291 cmd += *len;
292 }
293
294 return NULL;
295}
#define wcsnicmp
Definition: compat.h:14
static int parse_prop(const WCHAR *str, WCHAR *value, int *quotes)
Definition: action.c:101
Definition: ftp_var.h:139
Definition: getopt.h:109

Referenced by MsiInstallProductW().

◆ msi_get_component_action()

INSTALLSTATE msi_get_component_action ( MSIPACKAGE *  package,
MSICOMPONENT *  comp 
)

Definition at line 608 of file action.c.

609{
610 if (!comp->Enabled)
611 {
612 TRACE("component is disabled: %s\n", debugstr_w(comp->Component));
614 }
615 if (package->need_rollback) return comp->Installed;
616 if (comp->num_clients > 0 && comp->ActionRequest == INSTALLSTATE_ABSENT)
617 {
618 TRACE("%s has %u clients left\n", debugstr_w(comp->Component), comp->num_clients);
620 }
621 return comp->ActionRequest;
622}
INSTALLSTATE ActionRequest
Definition: msipriv.h:545
unsigned char need_rollback
Definition: msipriv.h:485

Referenced by ACTION_MsiPublishAssemblies(), ACTION_MsiUnpublishAssemblies(), ACTION_PatchFiles(), ACTION_RemoveFiles(), calculate_install_state(), ITERATE_CreateFolders(), ITERATE_CreateShortcuts(), ITERATE_DeleteService(), ITERATE_DuplicateFiles(), ITERATE_InstallODBCDataSource(), ITERATE_InstallODBCDriver(), ITERATE_InstallODBCTranslator(), ITERATE_InstallService(), ITERATE_MoveFiles(), ITERATE_RegisterFonts(), ITERATE_RegisterTypeLibraries(), ITERATE_RemoveDuplicateFiles(), ITERATE_RemoveEnvironmentString(), ITERATE_RemoveFiles(), ITERATE_RemoveFolders(), ITERATE_RemoveIniValuesOnInstall(), ITERATE_RemoveIniValuesOnUninstall(), ITERATE_RemoveODBCDataSource(), ITERATE_RemoveODBCDriver(), ITERATE_RemoveODBCTranslator(), ITERATE_RemoveRegistryValuesOnInstall(), ITERATE_RemoveRegistryValuesOnUninstall(), ITERATE_RemoveShortcuts(), ITERATE_SelfRegModules(), ITERATE_SelfUnregModules(), ITERATE_StartService(), ITERATE_StopService(), ITERATE_UnregisterFonts(), ITERATE_UnregisterTypeLibraries(), ITERATE_WriteEnvironmentString(), ITERATE_WriteIniValues(), ITERATE_WriteRegistryValues(), and patchfiles_cb().

◆ msi_get_db_suminfo()

UINT msi_get_db_suminfo ( MSIDATABASE *  db,
UINT  uiUpdateCount,
MSISUMMARYINFO **  si 
)

Definition at line 491 of file suminfo.c.

492{
493 IStream *stm;
495 UINT r;
496
497 if (!(si = create_suminfo( db->storage, uiUpdateCount ))) return ERROR_OUTOFMEMORY;
498
499 r = msi_get_stream( db, L"\5SummaryInformation", &stm );
500 if (r != ERROR_SUCCESS)
501 {
502 msiobj_release( &si->hdr );
503 return r;
504 }
505
506 r = load_summary_info( si, stm );
507 IStream_Release( stm );
508 if (r != ERROR_SUCCESS)
509 {
510 msiobj_release( &si->hdr );
511 return r;
512 }
513
514 *ret = si;
515 return ERROR_SUCCESS;
516}
static UINT load_summary_info(MSISUMMARYINFO *si, IStream *stm)
Definition: suminfo.c:255
UINT msi_get_stream(MSIDATABASE *, const WCHAR *, IStream **)
Definition: streams.c:499

Referenced by msi_export_suminfo(), msi_get_package_code(), msi_load_suminfo_properties(), MSI_OpenPackageW(), and MsiGetSummaryInformationW().

◆ msi_get_disk_file_size()

DWORD msi_get_disk_file_size ( MSIPACKAGE *  package,
const WCHAR *  filename 
)

Definition at line 199 of file files.c.

200{
201 DWORD size;
202 HANDLE file;
206 CloseHandle( file );
207 return size;
208}
#define OPEN_EXISTING
Definition: compat.h:775
#define GENERIC_READ
Definition: compat.h:135
#define FILE_SHARE_READ
Definition: compat.h:136
DWORD WINAPI GetFileSize(HANDLE hFile, LPDWORD lpFileSizeHigh)
Definition: fileinfo.c:331
HANDLE msi_create_file(MSIPACKAGE *package, const WCHAR *filename, DWORD access, DWORD sharing, DWORD creation, DWORD flags)
Definition: files.c:60
#define INVALID_FILE_SIZE
Definition: winbase.h:528

Referenced by calculate_file_cost(), and calculate_install_state().

◆ msi_get_disk_file_version()

VS_FIXEDFILEINFO * msi_get_disk_file_version ( MSIPACKAGE *  package,
const WCHAR *  filename 
)

Definition at line 170 of file files.c.

171{
173 DWORD version_size;
174 UINT size;
175 void *version;
176
177 if (!(version_size = msi_get_file_version_info( package, filename, 0, NULL ))) return NULL;
178 if (!(version = malloc( version_size ))) return NULL;
179
180 msi_get_file_version_info( package, filename, version_size, version );
181
182 if (!VerQueryValueW( version, L"\\", (void **)&ptr, &size ))
183 {
184 free( version );
185 return NULL;
186 }
187
188 if (!(ret = malloc( size )))
189 {
190 free( version );
191 return NULL;
192 }
193
194 memcpy( ret, ptr, size );
195 free( version );
196 return ret;
197}
BOOL WINAPI VerQueryValueW(LPCVOID pBlock, LPCWSTR lpSubBlock, LPVOID *lplpBuffer, PUINT puLen)
Definition: version.c:1171
DWORD msi_get_file_version_info(MSIPACKAGE *package, const WCHAR *path, DWORD buflen, BYTE *buffer)
Definition: files.c:160

Referenced by ACTION_RemoveFiles(), calculate_file_cost(), and calculate_install_state().

◆ msi_get_error_message()

WCHAR * msi_get_error_message ( MSIDATABASE *  db,
int  error 
)

Definition at line 1850 of file package.c.

1851{
1853 LPWSTR ret = NULL;
1854
1855 if ((record = MSI_QueryGetRecord(db, L"SELECT `Message` FROM `Error` WHERE `Error` = %d", error)))
1856 {
1858 msiobj_release(&record->hdr);
1859 }
1860 else if (error < 2000)
1861 {
1863 if (len)
1864 {
1865 ret = malloc((len + 1) * sizeof(WCHAR));
1867 }
1868 else
1869 ret = NULL;
1870 }
1871
1872 return ret;
1873}
HINSTANCE msi_hInstance
Definition: msi_main.c:51
#define IDS_ERROR_BASE
Definition: resource.h:33
#define LoadStringW
Definition: utils.h:64

Referenced by ACTION_ExecuteAction(), MSI_OpenPackageW(), MSI_ProcessMessage(), and ui_actioninfo().

◆ msi_get_feature_action()

INSTALLSTATE msi_get_feature_action ( MSIPACKAGE *  package,
MSIFEATURE *  feature 
)

◆ msi_get_file_attributes()

DWORD msi_get_file_attributes ( MSIPACKAGE *  package,
const WCHAR *  path 
)

◆ msi_get_file_version_info()

DWORD msi_get_file_version_info ( MSIPACKAGE *  package,
const WCHAR *  path,
DWORD  buflen,
BYTE *  buffer 
)

Definition at line 160 of file files.c.

161{
164 if (buffer) size = GetFileVersionInfoW( path, 0, buflen, buffer );
166 msi_revert_fs_redirection( package );
167 return size;
168}
BOOL WINAPI GetFileVersionInfoW(LPCWSTR filename, DWORD handle, DWORD datasize, LPVOID data)
Definition: version.c:967
DWORD WINAPI GetFileVersionInfoSizeW(LPCWSTR filename, LPDWORD handle)
Definition: version.c:738

Referenced by file_version_matches(), msi_get_disk_file_version(), and search_file().

◆ msi_get_filehash()

UINT msi_get_filehash ( MSIPACKAGE *  package,
const WCHAR *  path,
MSIFILEHASHINFO *  hash 
)

Definition at line 4018 of file msi.c.

4019{
4021 void *p;
4022 DWORD length;
4024
4025 if (package)
4027 else
4030 {
4031 WARN( "can't open file %lu\n", GetLastError() );
4032 return ERROR_FILE_NOT_FOUND;
4033 }
4034 if ((length = GetFileSize( handle, NULL )))
4035 {
4037 {
4038 if ((p = MapViewOfFile( mapping, FILE_MAP_READ, 0, 0, length )))
4039 {
4040 struct md5_ctx ctx;
4041
4042 MD5Init( &ctx );
4043 MD5Update( &ctx, p, length );
4044 MD5Final( &ctx );
4045 UnmapViewOfFile( p );
4046
4047 memcpy( hash->dwData, ctx.digest, sizeof(hash->dwData) );
4048 r = ERROR_SUCCESS;
4049 }
4051 }
4052 }
4053 else
4054 {
4055 /* Empty file -> set hash to 0 */
4056 memset( hash->dwData, 0, sizeof(hash->dwData) );
4057 r = ERROR_SUCCESS;
4058 }
4059
4061 return r;
4062}
#define PAGE_READONLY
Definition: compat.h:138
#define UnmapViewOfFile
Definition: compat.h:746
#define CreateFileMappingW(a, b, c, d, e, f)
Definition: compat.h:744
#define FILE_MAP_READ
Definition: compat.h:776
#define MapViewOfFile
Definition: compat.h:745
void WINAPI MD5Update(struct md5_ctx *, const unsigned char *, unsigned int)
void WINAPI MD5Init(struct md5_ctx *)
void WINAPI MD5Final(struct md5_ctx *)
GLuint GLsizei GLsizei * length
Definition: glext.h:6040
GLenum GLenum GLenum GLenum mapping
Definition: glext.h:9031
#define FILE_SHARE_DELETE
Definition: nt_native.h:682
Definition: msi.c:4007

Referenced by file_hash_matches(), and MsiGetFileHashW().

◆ msi_get_font_file_version()

WCHAR * msi_get_font_file_version ( MSIPACKAGE *  package,
const WCHAR *  filename 
)

Definition at line 189 of file font.c.

190{
191 WCHAR *version, *p, *q, *ret = NULL;
192
194 {
195 int len, major = 0, minor = 0;
196 if ((p = wcschr( version, ';' ))) *p = 0;
197 p = version;
198 while (*p && !iswdigit( *p )) p++;
199 if ((q = wcschr( p, '.' )))
200 {
201 major = wcstol( p, NULL, 10 );
202 p = ++q;
203 while (*q && iswdigit( *q )) q++;
204 if (!*q || *q == ' ') minor = wcstol( p, NULL, 10 );
205 else major = 0;
206 }
207 len = lstrlenW( L"%u.%u.0.0" ) + 20;
208 ret = malloc( len * sizeof(WCHAR) );
209 swprintf( ret, len, L"%u.%u.0.0", major, minor );
210 free( version );
211 }
212 return ret;
213}
static WCHAR * load_ttf_name_id(MSIPACKAGE *package, const WCHAR *filename, DWORD id)
Definition: font.c:76
#define NAME_ID_VERSION
Definition: font.c:57
_ACRTIMP __msvcrt_long __cdecl wcstol(const wchar_t *, wchar_t **, int)
Definition: wcs.c:2752
GLdouble GLdouble GLdouble GLdouble q
Definition: gl.h:2063
#define iswdigit(_c)
Definition: ctype.h:667
#define minor(rdev)
Definition: propsheet.cpp:929
#define major(rdev)
Definition: propsheet.cpp:928

Referenced by calculate_file_cost(), calculate_install_state(), and MsiGetFileVersionW().

◆ msi_get_loaded_component()

MSICOMPONENT * msi_get_loaded_component ( MSIPACKAGE *  package,
const WCHAR *  Component 
)

Definition at line 549 of file action.c.

550{
551 MSICOMPONENT *comp;
552
554 {
555 if (!wcscmp( Component, comp->Component )) return comp;
556 }
557 return NULL;
558}
_In_ ULONG Component
Definition: potypes.h:499

Referenced by deformat_component(), iterate_all_classes(), iterate_all_extensions(), ITERATE_CreateFolders(), ITERATE_CreateShortcuts(), ITERATE_DeleteService(), ITERATE_DuplicateFiles(), ITERATE_InstallODBCDataSource(), ITERATE_InstallODBCDriver(), ITERATE_InstallODBCTranslator(), ITERATE_InstallService(), iterate_load_featurecomponents(), ITERATE_MoveFiles(), iterate_patched_component(), ITERATE_PublishComponent(), ITERATE_RegisterFonts(), ITERATE_RegisterTypeLibraries(), ITERATE_RemoveDuplicateFiles(), ITERATE_RemoveEnvironmentString(), ITERATE_RemoveFiles(), ITERATE_RemoveFolders(), ITERATE_RemoveIniValuesOnInstall(), ITERATE_RemoveIniValuesOnUninstall(), ITERATE_RemoveODBCDataSource(), ITERATE_RemoveODBCDriver(), ITERATE_RemoveODBCTranslator(), ITERATE_RemoveRegistryValuesOnInstall(), ITERATE_RemoveRegistryValuesOnUninstall(), ITERATE_RemoveShortcuts(), ITERATE_StartService(), ITERATE_StopService(), ITERATE_UnpublishComponent(), ITERATE_UnregisterFonts(), ITERATE_UnregisterTypeLibraries(), ITERATE_WriteEnvironmentString(), ITERATE_WriteIniValues(), ITERATE_WriteRegistryValues(), load_class(), load_extension(), load_file(), MSI_GetComponentStateW(), MSI_SetComponentStateW(), and MsiEnumComponentCostsW().

◆ msi_get_loaded_feature()

◆ msi_get_loaded_file()

◆ msi_get_loaded_folder()

MSIFOLDER * msi_get_loaded_folder ( MSIPACKAGE *  package,
const WCHAR *  dir 
)

◆ msi_get_package_code()

WCHAR * msi_get_package_code ( MSIDATABASE *  db)

Definition at line 1309 of file package.c.

1310{
1311 WCHAR *ret;
1313 UINT r;
1314
1315 r = msi_get_suminfo( db->storage, 0, &si );
1316 if (r != ERROR_SUCCESS)
1317 {
1318 r = msi_get_db_suminfo( db, 0, &si );
1319 if (r != ERROR_SUCCESS)
1320 {
1321 WARN("failed to load summary info %u\n", r);
1322 return NULL;
1323 }
1324 }
1326 msiobj_release( &si->hdr );
1327 return ret;
1328}
#define PID_REVNUMBER
Definition: suminfo.c:51
UINT msi_get_db_suminfo(MSIDATABASE *db, UINT uiUpdateCount, MSISUMMARYINFO **si)
Definition: suminfo.c:491

Referenced by ACTION_PublishProduct(), and publish_product_properties().

◆ msi_get_property()

UINT msi_get_property ( MSIDATABASE *  db,
LPCWSTR  szName,
LPWSTR  szValueBuf,
LPDWORD  pchValueBuf 
)

Definition at line 2282 of file package.c.

2284{
2285 MSIRECORD *row;
2287
2288 TRACE("%p %s %p %p\n", db, debugstr_w(szName), szValueBuf, pchValueBuf);
2289
2290 row = get_property_row( db, szName );
2291
2292 if (*pchValueBuf > 0)
2293 szValueBuf[0] = 0;
2294
2295 if (row)
2296 {
2297 rc = MSI_RecordGetStringW(row, 1, szValueBuf, pchValueBuf);
2298 msiobj_release(&row->hdr);
2299 }
2300
2301 if (rc == ERROR_SUCCESS)
2302 TRACE("returning %s for property %s\n", debugstr_wn(szValueBuf, *pchValueBuf),
2304 else if (rc == ERROR_MORE_DATA)
2305 TRACE( "need %lu sized buffer for %s\n", *pchValueBuf, debugstr_w(szName) );
2306 else
2307 {
2308 *pchValueBuf = 0;
2309 TRACE("property %s not found\n", debugstr_w(szName));
2310 }
2311
2312 return rc;
2313}
static MSIRECORD * get_property_row(MSIDATABASE *db, const WCHAR *name)
Definition: package.c:2215
UINT MSI_RecordGetStringW(MSIRECORD *, UINT, LPWSTR, LPDWORD)
static const WCHAR szName[]
Definition: powrprof.c:45

Referenced by create_temp_dir(), deformat_property(), dialog_get_checkbox_state(), msi_create_temp_file(), msi_dup_property(), MSI_InstallPackage(), and msi_set_property().

◆ msi_get_property_int()

◆ msi_get_remote()

◆ msi_get_stream()

UINT msi_get_stream ( MSIDATABASE *  db,
const WCHAR *  name,
IStream **  ret 
)

Definition at line 499 of file streams.c.

500{
502 WCHAR *encname;
503 HRESULT hr;
504 UINT r;
505
506 if ((stream = find_stream( db, name )))
507 {
509
510 pos.QuadPart = 0;
511 hr = IStream_Seek( stream->stream, pos, STREAM_SEEK_SET, NULL );
512 if (FAILED( hr ))
514
515 *ret = stream->stream;
516 IStream_AddRef( *ret );
517 return ERROR_SUCCESS;
518 }
519
520 if (!(encname = encode_streamname( FALSE, name )))
521 return ERROR_OUTOFMEMORY;
522
523 hr = open_stream( db, encname, ret );
524 free( encname );
525 if (FAILED( hr ))
527
528 r = append_stream( db, name, *ret );
529 if (r != ERROR_SUCCESS)
530 {
531 IStream_Release( *ret );
532 return r;
533 }
534
535 IStream_AddRef( *ret );
536 return ERROR_SUCCESS;
537}
#define open_stream
Definition: intsym.h:251
static UINT append_stream(MSIDATABASE *db, const WCHAR *name, IStream *stream)
Definition: streams.c:430
static MSISTREAM * find_stream(MSIDATABASE *db, const WCHAR *name)
Definition: streams.c:415

Referenced by cabinet_open_stream(), msi_get_db_suminfo(), and TABLE_fetch_stream().

◆ msi_get_string_table_codepage()

UINT msi_get_string_table_codepage ( const string_table *  st)

Definition at line 671 of file string.c.

672{
673 return st->codepage;
674}
UINT codepage
Definition: string.c:55

Referenced by ACTION_ExecuteAction(), MSI_DatabaseExport(), and MSI_OpenPackageW().

◆ msi_get_suminfo()

UINT msi_get_suminfo ( IStorage *  stg,
UINT  uiUpdateCount,
MSISUMMARYINFO **  si 
)

Definition at line 461 of file suminfo.c.

462{
463 IStream *stm;
465 HRESULT hr;
466 UINT r;
467
468 TRACE("%p, %u\n", stg, uiUpdateCount);
469
470 if (!(si = create_suminfo( stg, uiUpdateCount ))) return ERROR_OUTOFMEMORY;
471
472 hr = IStorage_OpenStream( si->storage, L"\5SummaryInformation", 0, STGM_READ|STGM_SHARE_EXCLUSIVE, 0, &stm );
473 if (FAILED( hr ))
474 {
475 msiobj_release( &si->hdr );
477 }
478
479 r = load_summary_info( si, stm );
480 IStream_Release( stm );
481 if (r != ERROR_SUCCESS)
482 {
483 msiobj_release( &si->hdr );
484 return r;
485 }
486
487 *ret = si;
488 return ERROR_SUCCESS;
489}
#define STGM_READ
Definition: objbase.h:936

Referenced by admin_update_package_info(), apply_patch_package(), check_transform_applicable(), msi_add_suminfo(), MSI_ApplicablePatchW(), msi_apply_registered_patch(), msi_export_suminfo(), msi_get_package_code(), msi_get_suminfo_product(), msi_load_suminfo_properties(), MSI_OpenPackageW(), and MsiGetSummaryInformationW().

◆ msi_get_suminfo_product()

WCHAR * msi_get_suminfo_product ( IStorage *  stg)

Definition at line 724 of file suminfo.c.

725{
727 LPWSTR prod;
728 UINT r;
729
730 r = msi_get_suminfo( stg, 0, &si );
731 if (r != ERROR_SUCCESS)
732 {
733 ERR("no summary information!\n");
734 return NULL;
735 }
737 msiobj_release( &si->hdr );
738 return prod;
739}
LPWSTR msi_suminfo_dup_string(MSISUMMARYINFO *si, UINT uiProperty)
Definition: suminfo.c:700

Referenced by check_transform_applicable().

◆ msi_get_target_folder()

const WCHAR * msi_get_target_folder ( MSIPACKAGE *  package,
const WCHAR *  name 
)

Definition at line 232 of file install.c.

233{
235
236 if (!folder) return NULL;
237 if (!folder->ResolvedTarget)
238 {
240 while (parent->Parent && wcscmp( parent->Parent, parent->Directory ))
241 {
242 parent = msi_get_loaded_folder( package, parent->Parent );
243 }
244 msi_resolve_target_folder( package, parent->Directory, TRUE );
245 }
246 return folder->ResolvedTarget;
247}
void msi_resolve_target_folder(MSIPACKAGE *package, const WCHAR *name, BOOL load_prop)
Definition: action.c:2183
r parent
Definition: btrfs.c:3010

Referenced by create_folder(), deformat_component(), get_duplicate_filename(), get_ini_file_name(), get_link_file(), HANDLE_CustomType34(), ITERATE_CreateFolders(), ITERATE_CreateShortcuts(), ITERATE_InstallODBCDriver(), ITERATE_RegisterTypeLibraries(), ITERATE_RemoveFolders(), MSI_SetTargetPathW(), MsiGetTargetPathA(), MsiGetTargetPathW(), resolve_keypath(), and set_target_path().

◆ msi_get_temp_file_name()

BOOL msi_get_temp_file_name ( MSIPACKAGE *  package,
const WCHAR *  tmp_path,
const WCHAR *  prefix,
WCHAR *  tmp_filename 
)

Definition at line 51 of file files.c.

52{
53 BOOL ret;
55 ret = GetTempFileNameW( tmp_path, prefix, 0, tmp_filename );
57 return ret;
58}
Character const *const prefix
Definition: tempnam.cpp:195

Referenced by ACTION_InstallAdminPackage(), and cabinet_copy_file().

◆ MSI_GetComponentStateW()

UINT MSI_GetComponentStateW ( MSIPACKAGE *  package,
LPCWSTR  szComponent,
INSTALLSTATE *  piInstalled,
INSTALLSTATE *  piAction 
)

Definition at line 1430 of file install.c.

1432{
1433 MSICOMPONENT *comp;
1434
1435 TRACE("%p %s %p %p\n", package, debugstr_w(szComponent),
1436 piInstalled, piAction);
1437
1438 comp = msi_get_loaded_component(package,szComponent);
1439 if (!comp)
1441
1442 if (piInstalled)
1443 {
1444 if (comp->Enabled)
1445 *piInstalled = comp->Installed;
1446 else
1447 *piInstalled = INSTALLSTATE_UNKNOWN;
1448 }
1449
1450 if (piAction)
1451 {
1452 if (comp->Enabled)
1453 *piAction = comp->Action;
1454 else
1455 *piAction = INSTALLSTATE_UNKNOWN;
1456 }
1457
1458 TRACE("states (%i, %i)\n", comp->Installed, comp->Action );
1459 return ERROR_SUCCESS;
1460}
MSICOMPONENT * msi_get_loaded_component(MSIPACKAGE *package, const WCHAR *Component)
Definition: action.c:549
#define ERROR_UNKNOWN_COMPONENT
Definition: winerror.h:1313

Referenced by MsiGetComponentStateW().

◆ MSI_GetFeatureCost()

UINT MSI_GetFeatureCost ( MSIPACKAGE *  package,
MSIFEATURE *  feature,
MSICOSTTREE  tree,
INSTALLSTATE  state,
LPINT  cost 
)

Definition at line 1158 of file install.c.

1160{
1161 TRACE("%s, %u, %d, %p\n", debugstr_w(feature->Feature), tree, state, cost);
1162
1163 *cost = 0;
1164 switch (tree)
1165 {
1167 {
1169
1171 {
1172 if (child->ActionRequest == state)
1173 *cost += feature_cost( child );
1174 }
1175 break;
1176 }
1178 {
1179 const WCHAR *feature_parent = feature->Feature_Parent;
1180 for (;;)
1181 {
1182 MSIFEATURE *parent = msi_get_loaded_feature( package, feature_parent );
1183 if (!parent)
1184 break;
1185
1186 if (parent->ActionRequest == state)
1187 *cost += feature_cost( parent );
1188
1189 feature_parent = parent->Feature_Parent;
1190 }
1191 break;
1192 }
1194 if (feature->ActionRequest == state)
1195 *cost = feature_cost( feature );
1196 break;
1197
1198 default:
1199 WARN("unhandled cost tree %u\n", tree);
1200 break;
1201 }
1202
1203 return ERROR_SUCCESS;
1204}
static int state
Definition: maze.c:121
MSIFEATURE * msi_get_loaded_feature(MSIPACKAGE *package, const WCHAR *Feature)
Definition: action.c:560
static INT feature_cost(MSIFEATURE *feature)
Definition: install.c:1146
static HWND child
Definition: cursoricon.c:298
@ MSICOSTTREE_PARENTS
Definition: msiquery.h:44
@ MSICOSTTREE_CHILDREN
Definition: msiquery.h:43
@ MSICOSTTREE_SELFONLY
Definition: msiquery.h:42

Referenced by MsiGetFeatureCostW(), and vcl_get_cost().

◆ MSI_GetFeatureStateW()

UINT MSI_GetFeatureStateW ( MSIPACKAGE *  package,
LPCWSTR  szFeature,
INSTALLSTATE *  piInstalled,
INSTALLSTATE *  piAction 
)

Definition at line 1068 of file install.c.

1070{
1072
1073 feature = msi_get_loaded_feature(package,szFeature);
1074 if (!feature)
1075 return ERROR_UNKNOWN_FEATURE;
1076
1077 if (piInstalled)
1078 *piInstalled = feature->Installed;
1079
1080 if (piAction)
1081 *piAction = feature->ActionRequest;
1082
1083 TRACE("returning %i %i\n", feature->Installed, feature->ActionRequest);
1084
1085 return ERROR_SUCCESS;
1086}
#define ERROR_UNKNOWN_FEATURE
Definition: winerror.h:1312

Referenced by MsiGetFeatureStateW().

◆ msi_init_string_table()

HRESULT msi_init_string_table ( IStorage *  stg)

Definition at line 460 of file string.c.

461{
462 USHORT zero[2] = { 0, 0 };
463 UINT ret;
464
465 /* create the StringPool stream... add the zero string to it*/
466 ret = write_stream_data(stg, L"_StringPool", zero, sizeof zero, TRUE);
467 if (ret != ERROR_SUCCESS)
468 return E_FAIL;
469
470 /* create the StringData stream... make it zero length */
471 ret = write_stream_data(stg, L"_StringData", NULL, 0, TRUE);
472 if (ret != ERROR_SUCCESS)
473 return E_FAIL;
474
475 return S_OK;
476}
#define E_FAIL
Definition: ddrawi.h:102
UINT write_stream_data(IStorage *stg, LPCWSTR stname, LPCVOID data, UINT sz, BOOL bTable)
Definition: table.c:298
unsigned short USHORT
Definition: pedump.c:61
int zero
Definition: sehframes.cpp:29

Referenced by db_initialize().

◆ msi_install_assembly()

UINT msi_install_assembly ( MSIPACKAGE *  package,
MSICOMPONENT *  comp 
)

Definition at line 356 of file assembly.c.

357{
358 HRESULT hr;
359 const WCHAR *manifest;
363
364 if (!init_assembly_caches( package )) return ERROR_FUNCTION_FAILED;
365
366 if (comp->assembly->feature)
367 feature = msi_get_loaded_feature( package, comp->assembly->feature );
368
369 if (assembly->application)
370 {
371 if (feature) feature->Action = INSTALLSTATE_LOCAL;
372 return ERROR_SUCCESS;
373 }
374 if (assembly->attributes == msidbAssemblyAttributesWin32)
375 {
376 if (!assembly->manifest)
377 {
378 WARN("no manifest\n");
380 }
382 cache = package->cache_sxs;
383 }
384 else
385 {
386 manifest = msi_get_loaded_file( package, comp->KeyPath )->TargetPath;
387 cache = package->cache_net[get_clr_version( package, manifest )];
388 if (!cache) return ERROR_SUCCESS;
389 }
390 TRACE("installing assembly %s\n", debugstr_w(manifest));
391
392 hr = IAssemblyCache_InstallAssembly( cache, 0, manifest, NULL );
393 if (hr != S_OK)
394 {
395 ERR( "failed to install assembly %s (%#lx)\n", debugstr_w(manifest), hr );
397 }
398 if (feature) feature->Action = INSTALLSTATE_LOCAL;
399 return ERROR_SUCCESS;
400}
static enum clr_version get_clr_version(MSIPACKAGE *package, const WCHAR *filename)
Definition: assembly.c:331
struct file_info manifest
Definition: actctx.c:555
LPWSTR feature
Definition: msipriv.h:526
LPWSTR TargetPath
Definition: msipriv.h:631
static const CHAR manifest[]
Definition: v6util.h:41

Referenced by ACTION_InstallFinalize().

◆ MSI_InstallPackage()

UINT MSI_InstallPackage ( MSIPACKAGE *  package,
LPCWSTR  szPackagePath,
LPCWSTR  szCommandLine 
)

Definition at line 7917 of file action.c.

7919{
7920 WCHAR *reinstall = NULL, *productcode, *action;
7921 UINT rc;
7922 DWORD len = 0;
7923
7924 if (szPackagePath)
7925 {
7926 LPWSTR p, dir;
7927 LPCWSTR file;
7928
7929 dir = wcsdup(szPackagePath);
7930 p = wcsrchr(dir, '\\');
7931 if (p)
7932 {
7933 *(++p) = 0;
7934 file = szPackagePath + (p - dir);
7935 }
7936 else
7937 {
7938 free(dir);
7939 dir = malloc(MAX_PATH * sizeof(WCHAR));
7941 lstrcatW(dir, L"\\");
7942 file = szPackagePath;
7943 }
7944
7945 free(package->PackagePath);
7946 package->PackagePath = malloc((wcslen(dir) + wcslen(file) + 1) * sizeof(WCHAR));
7947 if (!package->PackagePath)
7948 {
7949 free(dir);
7950 return ERROR_OUTOFMEMORY;
7951 }
7952
7953 lstrcpyW(package->PackagePath, dir);
7954 lstrcatW(package->PackagePath, file);
7955 free(dir);
7956
7958 }
7959
7960 rc = msi_parse_command_line( package, szCommandLine, FALSE );
7961 if (rc != ERROR_SUCCESS)
7962 return rc;
7963
7964 msi_apply_transforms( package );
7965 msi_apply_patches( package );
7966
7967 if (msi_get_property( package->db, L"ACTION", NULL, &len ))
7968 msi_set_property( package->db, L"ACTION", L"INSTALL", -1 );
7969 action = msi_dup_property( package->db, L"ACTION" );
7971
7972 msi_set_original_database_property( package->db, szPackagePath );
7973 msi_parse_command_line( package, szCommandLine, FALSE );
7975 msi_set_context( package );
7976
7977 productcode = msi_dup_property( package->db, L"ProductCode" );
7978 if (wcsicmp( productcode, package->ProductCode ))
7979 {
7980 TRACE( "product code changed %s -> %s\n", debugstr_w(package->ProductCode), debugstr_w(productcode) );
7981 free( package->ProductCode );
7982 package->ProductCode = productcode;
7983 }
7984 else free( productcode );
7985
7986 if (msi_get_property_int( package->db, L"DISABLEROLLBACK", 0 ))
7987 {
7988 TRACE("disabling rollback\n");
7989 msi_set_property( package->db, L"RollbackDisabled", L"1", -1 );
7990 }
7991
7992 rc = ACTION_PerformAction(package, action);
7993
7994 /* process the ending type action */
7995 if (rc == ERROR_SUCCESS)
7996 ACTION_PerformEndAction(package, action, -1);
7997 else if (rc == ERROR_INSTALL_USEREXIT)
7998 ACTION_PerformEndAction(package, action, -2);
7999 else if (rc == ERROR_INSTALL_SUSPEND)
8000 ACTION_PerformEndAction(package, action, -4);
8001 else /* failed */
8002 {
8003 ACTION_PerformEndAction(package, action, -3);
8004 if (!msi_get_property_int( package->db, L"RollbackDisabled", 0 ))
8005 {
8006 package->need_rollback = TRUE;
8007 }
8008 }
8009
8010 /* finish up running custom actions */
8012
8013 if (package->need_rollback && !(reinstall = msi_dup_property( package->db, L"REINSTALL" )))
8014 {
8015 WARN("installation failed, running rollback script\n");
8016 execute_script( package, SCRIPT_ROLLBACK );
8017 }
8018 free( reinstall );
8019 free( action );
8020
8021 if (rc == ERROR_SUCCESS && package->need_reboot_at_end)
8023
8024 return rc;
8025}
#define GetCurrentDirectoryW(x, y)
Definition: compat.h:756
LPWSTR WINAPI CharUpperW(WCHAR *str)
Definition: string.c:1249
UINT msi_set_context(MSIPACKAGE *package)
Definition: action.c:390
const WCHAR * action
Definition: action.c:7705
static UINT ACTION_PerformEndAction(MSIPACKAGE *package, const WCHAR *action, UINT sequence)
Definition: action.c:7855
UINT ACTION_PerformAction(MSIPACKAGE *package, const WCHAR *action)
Definition: action.c:7837
UINT msi_parse_command_line(MSIPACKAGE *package, LPCWSTR szCommandLine, BOOL preserve_case)
Definition: action.c:206
static UINT execute_script(MSIPACKAGE *package, UINT script)
Definition: action.c:1395
void ACTION_FinishCustomActions(const MSIPACKAGE *package)
Definition: custom.c:1628
UINT msi_apply_patches(MSIPACKAGE *package)
Definition: patch.c:932
UINT msi_set_original_database_property(MSIDATABASE *, const WCHAR *)
Definition: package.c:1342
UINT msi_apply_transforms(MSIPACKAGE *package)
Definition: patch.c:950
unsigned char need_reboot_at_end
Definition: msipriv.h:483
#define ERROR_INSTALL_USEREXIT
Definition: winerror.h:1308
#define ERROR_SUCCESS_REBOOT_REQUIRED
Definition: winerror.h:1580

Referenced by MsiConfigureFeatureW(), MsiConfigureProductExW(), MsiInstallProductW(), and MsiReinstallFeatureW().

◆ msi_is_global_assembly()

◆ MSI_IterateRecords()

UINT MSI_IterateRecords ( MSIQUERY *  view,
LPDWORD  count,
record_func  func,
LPVOID  param 
)

Definition at line 163 of file msiquery.c.

165{
166 MSIRECORD *rec = NULL;
167 UINT r, n = 0, max = 0;
168
170 if( r != ERROR_SUCCESS )
171 return r;
172
173 if( count )
174 max = *count;
175
176 /* iterate a query */
177 for( n = 0; (max == 0) || (n < max); n++ )
178 {
179 r = MSI_ViewFetch( view, &rec );
180 if( r != ERROR_SUCCESS )
181 break;
182 if (func)
183 r = func( rec, param );
184 msiobj_release( &rec->hdr );
185 if( r != ERROR_SUCCESS )
186 break;
187 }
188
190
191 if( count )
192 *count = n;
193
194 if( r == ERROR_NO_MORE_ITEMS )
196
197 return r;
198}
#define ERROR_NO_MORE_ITEMS
Definition: compat.h:105
GLenum func
Definition: glext.h:6028
GLfloat param
Definition: glext.h:5796
UINT MSI_ViewExecute(MSIQUERY *query, MSIRECORD *rec)
Definition: msiquery.c:498
UINT MSI_ViewClose(MSIQUERY *query)
Definition: msiquery.c:450
UINT MSI_ViewFetch(MSIQUERY *query, MSIRECORD **prec)
Definition: msiquery.c:373
#define max(a, b)
Definition: svc.c:63

Referenced by ACTION_AppSearch(), ACTION_BindImage(), ACTION_CCPSearch(), ACTION_CostFinalize(), ACTION_CreateFolders(), ACTION_CreateShortcuts(), ACTION_DeleteServices(), ACTION_DuplicateFiles(), ACTION_ExecuteAction(), ACTION_FindRelatedProducts(), ACTION_InstallODBC(), ACTION_InstallServices(), ACTION_InstallValidate(), ACTION_LaunchConditions(), ACTION_MigrateFeatureStates(), ACTION_MoveFiles(), ACTION_ProcessExecSequence(), ACTION_ProcessUISequence(), ACTION_PublishComponents(), ACTION_RegisterFonts(), ACTION_RegisterTypeLibraries(), ACTION_RemoveDuplicateFiles(), ACTION_RemoveEnvironmentStrings(), ACTION_RemoveExistingProducts(), ACTION_RemoveFiles(), ACTION_RemoveFolders(), ACTION_RemoveIniValues(), ACTION_RemoveODBC(), ACTION_RemoveRegistryValues(), ACTION_RemoveShortcuts(), ACTION_SelfRegModules(), ACTION_SelfUnregModules(), ACTION_SetODBCFolders(), ACTION_StartServices(), ACTION_StopServices(), ACTION_UnpublishComponents(), ACTION_UnregisterFonts(), ACTION_UnregisterTypeLibraries(), ACTION_WriteEnvironmentStrings(), ACTION_WriteIniValues(), ACTION_WriteRegistryValues(), combobox_add_items(), dialog_build_font_list(), dialog_button_handler(), dialog_evaluate_control_conditions(), dialog_fill_controls(), dialog_map_events(), dialog_radiogroup_control(), gather_merge_data(), get_assembly_display_name(), listbox_add_items(), listview_add_items(), load_all_classes(), load_all_drlocators(), load_all_extensions(), load_all_files(), load_all_folders(), load_all_media(), load_all_mimes(), load_all_patches(), load_all_progids(), load_all_verbs(), load_feature(), mark_patched_components(), merge_diff_tables(), MSI_DatabaseExport(), MSI_DatabaseGetPrimaryKeys(), msi_load_all_components(), msi_load_all_features(), MSI_Sequence(), publish_icons(), ui_sequence_exists(), unimplemented_action_stub(), and unpublish_icons().

◆ msi_load_all_components()

UINT msi_load_all_components ( MSIPACKAGE *  package)

Definition at line 806 of file action.c.

807{
808 MSIQUERY *view;
809 UINT r;
810
811 if (!list_empty(&package->components))
812 return ERROR_SUCCESS;
813
814 r = MSI_DatabaseOpenViewW( package->db, L"SELECT * FROM `Component`", &view );
815 if (r != ERROR_SUCCESS)
816 return r;
817
819 msiobj_release(&view->hdr);
820 return r;
821}
static UINT load_component(MSIRECORD *row, LPVOID param)
Definition: action.c:776

Referenced by ACTION_CostInitialize(), and MsiGetFeatureInfoW().

◆ msi_load_all_features()

UINT msi_load_all_features ( MSIPACKAGE *  package)

Definition at line 949 of file action.c.

950{
951 MSIQUERY *view;
952 UINT r;
953
954 if (!list_empty(&package->features))
955 return ERROR_SUCCESS;
956
957 r = MSI_DatabaseOpenViewW( package->db, L"SELECT * FROM `Feature` ORDER BY `Display`", &view );
958 if (r != ERROR_SUCCESS)
959 return r;
960
961 r = MSI_IterateRecords( view, NULL, load_feature, package );
962 if (r != ERROR_SUCCESS)
963 {
964 msiobj_release( &view->hdr );
965 return r;
966 }
968 msiobj_release( &view->hdr );
969 return r;
970}
static UINT load_feature(MSIRECORD *row, LPVOID param)
Definition: action.c:876
static UINT find_feature_children(MSIRECORD *row, LPVOID param)
Definition: action.c:929

Referenced by ACTION_CostInitialize(), and MsiGetFeatureInfoW().

◆ msi_load_assembly()

MSIASSEMBLY * msi_load_assembly ( MSIPACKAGE *  package,
MSICOMPONENT *  comp 
)

Definition at line 292 of file assembly.c.

293{
294 MSIRECORD *rec;
295 MSIASSEMBLY *a;
296
297 if (!(rec = get_assembly_record( package, comp->Component ))) return NULL;
298 if (!(a = calloc( 1, sizeof(MSIASSEMBLY) )))
299 {
300 msiobj_release( &rec->hdr );
301 return NULL;
302 }
303 a->feature = wcsdup( MSI_RecordGetString( rec, 2 ) );
304 TRACE("feature %s\n", debugstr_w(a->feature));
305
306 a->manifest = wcsdup( MSI_RecordGetString( rec, 3 ) );
307 TRACE("manifest %s\n", debugstr_w(a->manifest));
308
309 a->application = wcsdup( MSI_RecordGetString( rec, 4 ) );
310 TRACE("application %s\n", debugstr_w(a->application));
311
312 a->attributes = MSI_RecordGetInteger( rec, 5 );
313 TRACE( "attributes %lu\n", a->attributes );
314
315 if (!(a->display_name = get_assembly_display_name( package->db, comp->Component, a )))
316 {
317 WARN("can't get display name\n");
318 msiobj_release( &rec->hdr );
319 free( a->feature );
320 free( a->manifest );
321 free( a->application );
322 free( a );
323 return NULL;
324 }
325 TRACE("display name %s\n", debugstr_w(a->display_name));
326
327 msiobj_release( &rec->hdr );
328 return a;
329}
GLboolean GLboolean GLboolean GLboolean a
Definition: glext.h:6204
#define a
Definition: ke_i.h:78
static MSIRECORD * get_assembly_record(MSIPACKAGE *package, const WCHAR *comp)
Definition: assembly.c:121
static WCHAR * get_assembly_display_name(MSIDATABASE *db, const WCHAR *comp, MSIASSEMBLY *assembly)
Definition: assembly.c:172

Referenced by load_component().

◆ msi_load_media_info()

UINT msi_load_media_info ( MSIPACKAGE *  package,
UINT  Sequence,
MSIMEDIAINFO *  mi 
)

Definition at line 677 of file media.c.

678{
679 MSIRECORD *row;
680 WCHAR *source_dir, *source, *base_url = NULL;
682
683 if (Sequence <= mi->last_sequence) /* already loaded */
684 return ERROR_SUCCESS;
685
686 row = MSI_QueryGetRecord(package->db, L"SELECT * FROM `Media` WHERE `LastSequence` >= %d ORDER BY `DiskId`", Sequence);
687 if (!row)
688 {
689 TRACE("Unable to query row\n");
691 }
692
693 mi->is_extracted = FALSE;
694 mi->disk_id = MSI_RecordGetInteger(row, 1);
695 mi->last_sequence = MSI_RecordGetInteger(row, 2);
696 free(mi->disk_prompt);
697 mi->disk_prompt = wcsdup(MSI_RecordGetString(row, 3));
698 free(mi->cabinet);
699 mi->cabinet = wcsdup(MSI_RecordGetString(row, 4));
700 free(mi->volume_label);
701 mi->volume_label = wcsdup(MSI_RecordGetString(row, 5));
702 msiobj_release(&row->hdr);
703
705 source_dir = msi_dup_property(package->db, L"SourceDir");
706 lstrcpyW(mi->sourcedir, source_dir);
707 PathAddBackslashW(mi->sourcedir);
708 mi->type = get_drive_type(source_dir);
709
711 if (mi->type == DRIVE_CDROM || mi->type == DRIVE_REMOVABLE)
712 {
713 source = source_dir;
715 }
716 else if ((base_url = get_base_url(package->db)))
717 {
720 }
721 else
722 {
723 source = mi->sourcedir;
725 }
726
727 msi_package_add_media_disk(package, package->Context,
728 MSICODE_PRODUCT, mi->disk_id,
729 mi->volume_label, mi->disk_prompt);
730
731 msi_package_add_info(package, package->Context,
733
734 TRACE("sequence %u -> cabinet %s disk id %u\n", Sequence, debugstr_w(mi->cabinet), mi->disk_id);
735
736 free(base_url);
737 free(source_dir);
738 return ERROR_SUCCESS;
739}
static WCHAR * get_base_url(MSIDATABASE *db)
Definition: media.c:669
static UINT get_drive_type(const WCHAR *path)
Definition: media.c:658
const WCHAR * base_url
Definition: mimeole.c:1439
@ MSICODE_PRODUCT
Definition: msi.h:215
@ MSISOURCETYPE_URL
Definition: msi.h:209
@ MSISOURCETYPE_NETWORK
Definition: msi.h:208
@ MSISOURCETYPE_MEDIA
Definition: msi.h:210
static const WCHAR INSTALLPROPERTY_LASTUSEDSOURCEW[]
Definition: msi.h:405
UINT msi_package_add_media_disk(MSIPACKAGE *, DWORD, DWORD, DWORD, LPWSTR, LPWSTR)
Definition: package.c:2680
UINT msi_package_add_info(MSIPACKAGE *, DWORD, DWORD, LPCWSTR, LPWSTR)
Definition: package.c:2657
#define PathAddBackslashW
Definition: pathcch.h:302
#define DRIVE_CDROM
Definition: winbase.h:279
#define DRIVE_REMOVABLE
Definition: winbase.h:276

Referenced by ACTION_InstallFiles(), and ACTION_PatchFiles().

◆ msi_load_string_table()

string_table * msi_load_string_table ( IStorage *  stg,
UINT *  bytes_per_strref 
)

Definition at line 478 of file string.c.

479{
480 string_table *st = NULL;
481 CHAR *data = NULL;
482 USHORT *pool = NULL;
483 UINT r, datasize = 0, poolsize = 0, codepage;
484 DWORD i, count, offset, len, n, refs;
485
486 r = read_stream_data( stg, L"_StringPool", TRUE, (BYTE **)&pool, &poolsize );
487 if( r != ERROR_SUCCESS)
488 goto end;
489 r = read_stream_data( stg, L"_StringData", TRUE, (BYTE **)&data, &datasize );
490 if( r != ERROR_SUCCESS)
491 goto end;
492
493 if ( (poolsize > 4) && (pool[1] & 0x8000) )
494 *bytes_per_strref = LONG_STR_BYTES;
495 else
496 *bytes_per_strref = sizeof(USHORT);
497
498 count = poolsize/4;
499 if( poolsize > 4 )
500 codepage = pool[0] | ( (pool[1] & ~0x8000) << 16 );
501 else
504 if (!st)
505 goto end;
506
507 offset = 0;
508 n = 1;
509 i = 1;
510 while( i<count )
511 {
512 /* the string reference count is always the second word */
513 refs = pool[i*2+1];
514
515 /* empty entries have two zeros, still have a string id */
516 if (pool[i*2] == 0 && refs == 0)
517 {
518 i++;
519 n++;
520 continue;
521 }
522
523 /*
524 * If a string is over 64k, the previous string entry is made null
525 * and its the high word of the length is inserted in the null string's
526 * reference count field.
527 */
528 if( pool[i*2] == 0)
529 {
530 len = (pool[i*2+3] << 16) + pool[i*2+2];
531 i += 2;
532 }
533 else
534 {
535 len = pool[i*2];
536 i += 1;
537 }
538
539 if ( (offset + len) > datasize )
540 {
541 ERR("string table corrupt?\n");
542 break;
543 }
544
545 r = add_string( st, n, data+offset, len, refs, TRUE );
546 if( r != n )
547 ERR( "Failed to add string %lu\n", n );
548 n++;
549 offset += len;
550 }
551
552 if ( datasize != offset )
553 ERR( "string table load failed! (%u != %lu), please report\n", datasize, offset );
554
555 TRACE( "loaded %lu strings\n", count );
556
557end:
558 free( pool );
559 free( data );
560
561 return st;
562}
static SIZE_T datasize
Definition: asm.c:30
#define CP_ACP
Definition: compat.h:109
LONG refs
Definition: port.c:62
static int add_string(string_table *st, UINT n, const char *data, UINT len, USHORT refcount, BOOL persistent)
Definition: string.c:257
static string_table * init_stringtable(int entries, UINT codepage)
Definition: string.c:71
static HRESULT read_stream_data(nsChannelBSC *This, IStream *stream)
Definition: navigate.c:960
#define LONG_STR_BYTES
Definition: msipriv.h:57
char CHAR
Definition: pedump.c:57
int codepage
Definition: win_iconv.c:156

Referenced by MSI_OpenDatabaseW(), and msi_table_apply_transform().

◆ msi_load_suminfo_properties()

UINT msi_load_suminfo_properties ( MSIPACKAGE *  package)

Definition at line 1266 of file suminfo.c.

1267{
1269 WCHAR *package_code;
1270 UINT r;
1271 DWORD len;
1272 awstring str;
1273 INT count;
1274
1275 r = msi_get_suminfo( package->db->storage, 0, &si );
1276 if (r != ERROR_SUCCESS)
1277 {
1278 r = msi_get_db_suminfo( package->db, 0, &si );
1279 if (r != ERROR_SUCCESS)
1280 {
1281 ERR("Unable to open summary information stream %u\n", r);
1282 return r;
1283 }
1284 }
1285
1286 str.unicode = TRUE;
1287 str.str.w = NULL;
1288 len = 0;
1290 if (r != ERROR_MORE_DATA)
1291 {
1292 WARN("Unable to query revision number %u\n", r);
1293 msiobj_release( &si->hdr );
1294 return ERROR_FUNCTION_FAILED;
1295 }
1296
1297 len++;
1298 if (!(package_code = malloc( len * sizeof(WCHAR) ))) return ERROR_OUTOFMEMORY;
1299 str.str.w = package_code;
1300
1302 if (r != ERROR_SUCCESS)
1303 {
1304 free( package_code );
1305 msiobj_release( &si->hdr );
1306 return r;
1307 }
1308
1309 r = msi_set_property( package->db, L"PackageCode", package_code, len );
1310 free( package_code );
1311
1312 count = 0;
1314 package->WordCount = count;
1315
1316 msiobj_release( &si->hdr );
1317 return r;
1318}
UINT msi_suminfo_get_prop(MSISUMMARYINFO *si, UINT uiProperty, UINT *puiDataType, INT *piValue, FILETIME *pftValue, awstring *str, DWORD *pcchValueBuf)
Definition: suminfo.c:645
#define PID_WORDCOUNT
Definition: suminfo.c:57

Referenced by MSI_CreatePackage().

◆ msi_locate_product()

UINT msi_locate_product ( LPCWSTR  szProduct,
MSIINSTALLCONTEXT *  context 
)

Definition at line 54 of file msi.c.

55{
56 HKEY hkey = NULL;
57
59 if (!szProduct) return ERROR_UNKNOWN_PRODUCT;
60
62 &hkey, FALSE) == ERROR_SUCCESS)
65 &hkey, FALSE) == ERROR_SUCCESS)
67 else if (MSIREG_OpenProductKey(szProduct, NULL,
69 &hkey, FALSE) == ERROR_SUCCESS)
71
72 RegCloseKey(hkey);
73
76
77 return ERROR_SUCCESS;
78}
@ MSIINSTALLCONTEXT_NONE
Definition: msi.h:197
@ MSIINSTALLCONTEXT_USERUNMANAGED
Definition: msi.h:199
@ MSIINSTALLCONTEXT_USERMANAGED
Definition: msi.h:198
UINT MSIREG_OpenProductKey(LPCWSTR szProduct, LPCWSTR szUserSid, MSIINSTALLCONTEXT context, HKEY *key, BOOL create)
Definition: registry.c:338
Definition: http.c:7252
#define ERROR_UNKNOWN_PRODUCT
Definition: winerror.h:1311

Referenced by get_registered_local_package(), MSI_OpenPackageW(), MSI_OpenProductW(), MSI_ProvideQualifiedComponentEx(), msi_set_context(), MsiConfigureProductExW(), and MsiReinstallFeatureW().

◆ msi_move_file()

BOOL msi_move_file ( MSIPACKAGE *  package,
const WCHAR *  from,
const WCHAR *  to,
DWORD  flags 
)

Definition at line 142 of file files.c.

143{
144 BOOL ret;
146 ret = MoveFileExW( from, to, flags );
147 msi_revert_fs_redirection( package );
148 return ret;
149}
BOOL WINAPI MoveFileExW(IN LPCWSTR lpExistingFileName, IN LPCWSTR lpNewFileName OPTIONAL, IN DWORD dwFlags)
Definition: move.c:1074
CardRegion * from
Definition: spigame.cpp:19

Referenced by cabinet_copy_file(), copy_install_file(), move_file(), and patch_file().

◆ msi_normalize_path()

WCHAR * msi_normalize_path ( const WCHAR *  in)

Definition at line 2115 of file action.c.

2116{
2117 const WCHAR *p = in;
2118 WCHAR *q, *ret;
2119 int n, len = lstrlenW( in ) + 2;
2120
2121 if (!(q = ret = malloc( len * sizeof(WCHAR) ))) return NULL;
2122
2123 len = 0;
2124 while (1)
2125 {
2126 /* copy until the end of the string or a space */
2127 while (*p != ' ' && (*q = *p))
2128 {
2129 p++, len++;
2130 /* reduce many backslashes to one */
2131 if (*p != '\\' || *q != '\\')
2132 q++;
2133 }
2134
2135 /* quit at the end of the string */
2136 if (!*p)
2137 break;
2138
2139 /* count the number of spaces */
2140 n = 0;
2141 while (p[n] == ' ')
2142 n++;
2143
2144 /* if it's leading or trailing space, skip it */
2145 if ( len == 0 || p[-1] == '\\' || p[n] == '\\' )
2146 p += n;
2147 else /* copy n spaces */
2148 while (n && (*q++ = *p++)) n--;
2149 }
2150 while (q - ret > 0 && q[-1] == ' ') q--;
2151 if (q - ret > 0 && q[-1] != '\\')
2152 {
2153 q[0] = '\\';
2154 q[1] = 0;
2155 }
2156 return ret;
2157}

Referenced by msi_resolve_target_folder(), and set_target_path().

◆ MSI_OpenDatabaseW()

UINT MSI_OpenDatabaseW ( LPCWSTR  szDBPath,
LPCWSTR  szPersist,
MSIDATABASE **  pdb 
)

Definition at line 140 of file database.c.

141{
142 IStorage *stg = NULL;
143 HRESULT r;
144 MSIDATABASE *db = NULL;
147 UINT mode;
148 STATSTG stat;
149 BOOL created = FALSE, patch = FALSE;
151
152 TRACE("%s %s\n",debugstr_w(szDBPath),debugstr_w(szPersist) );
153
154 if( !pdb )
156
157 save_path = szDBPath;
158 if ( IS_INTMSIDBOPEN(szPersist) )
159 {
160 mode = LOWORD(szPersist);
161 }
162 else
163 {
164 if (!CopyFileW( szDBPath, szPersist, FALSE ))
165 return ERROR_OPEN_FAILED;
166
167 szDBPath = szPersist;
169 created = TRUE;
170 }
171
173 {
174 TRACE("Database is a patch\n");
175 mode &= ~MSI_OPEN_PATCHFILE;
176 patch = TRUE;
177 }
178
179 if( mode == MSI_OPEN_READONLY )
180 {
181 r = StgOpenStorage( szDBPath, NULL,
183 }
184 else if( mode == MSI_OPEN_CREATE )
185 {
186 r = StgCreateDocfile( szDBPath,
188
189 if( SUCCEEDED(r) )
190 r = db_initialize( stg, patch ? &CLSID_MsiPatch : &CLSID_MsiDatabase );
191 created = TRUE;
192 }
193 else if( mode == MSI_OPEN_CREATEDIRECT )
194 {
195 r = StgCreateDocfile( szDBPath,
197
198 if( SUCCEEDED(r) )
199 r = db_initialize( stg, patch ? &CLSID_MsiPatch : &CLSID_MsiDatabase );
200 created = TRUE;
201 }
202 else if( mode == MSI_OPEN_TRANSACT )
203 {
204 r = StgOpenStorage( szDBPath, NULL,
206 }
207 else if( mode == MSI_OPEN_DIRECT )
208 {
209 r = StgOpenStorage( szDBPath, NULL,
211 }
212 else
213 {
214 ERR("unknown flag %x\n",mode);
216 }
217
218 if( FAILED( r ) || !stg )
219 {
220 WARN("open failed r = %#lx for %s\n", r, debugstr_w(szDBPath));
222 }
223
224 r = IStorage_Stat( stg, &stat, STATFLAG_NONAME );
225 if( FAILED( r ) )
226 {
227 FIXME("Failed to stat storage\n");
228 goto end;
229 }
230
231 if ( !IsEqualGUID( &stat.clsid, &CLSID_MsiDatabase ) &&
232 !IsEqualGUID( &stat.clsid, &CLSID_MsiPatch ) &&
233 !IsEqualGUID( &stat.clsid, &CLSID_MsiTransform ) )
234 {
235 ERR("storage GUID is not a MSI database GUID %s\n",
236 debugstr_guid(&stat.clsid) );
237 goto end;
238 }
239
240 if ( patch && !IsEqualGUID( &stat.clsid, &CLSID_MsiPatch ) )
241 {
242 ERR("storage GUID is not the MSI patch GUID %s\n",
243 debugstr_guid(&stat.clsid) );
245 goto end;
246 }
247
250 if( !db )
251 {
252 FIXME("Failed to allocate a handle\n");
253 goto end;
254 }
255
256 if (!wcschr( save_path, '\\' ))
257 {
259 lstrcatW( path, L"\\" );
261 }
262 else
264
265 db->path = wcsdup( path );
268
269 if( TRACE_ON( msi ) )
270 enum_stream_names( stg );
271
272 db->storage = stg;
273 db->mode = mode;
274 if (created)
275 db->deletefile = wcsdup( szDBPath );
276 list_init( &db->tables );
277 list_init( &db->transforms );
278
280 if( !db->strings )
281 goto end;
282
284
285 msiobj_addref( &db->hdr );
286 IStorage_AddRef( stg );
287 *pdb = db;
288
289end:
290 if( db )
291 msiobj_release( &db->hdr );
292 if( stg )
293 IStorage_Release( stg );
294
295 return ret;
296}
static struct @1789 save_path[MOVE_LIST_SIZE]
static void list_init(struct list_entry *head)
Definition: list.h:51
static PDB pdb
Definition: db.cpp:173
#define TRACE_ON(x)
Definition: compat.h:75
static VOID MSI_CloseDatabase(MSIOBJECTHDR *arg)
Definition: database.c:86
#define IS_INTMSIDBOPEN(x)
Definition: database.c:53
static HRESULT db_initialize(IStorage *stg, const GUID *clsid)
Definition: database.c:104
HRESULT WINAPI StgOpenStorage(const OLECHAR *pwcsName, IStorage *pstgPriority, DWORD grfMode, SNB snbExclude, DWORD reserved, IStorage **ppstgOpen)
Definition: storage32.c:8701
HRESULT WINAPI StgCreateDocfile(LPCOLESTR pwcsName, DWORD grfMode, DWORD reserved, IStorage **ppstgOpen)
Definition: storage32.c:8597
GLenum mode
Definition: glext.h:6217
#define MSI_INITIAL_MEDIA_TRANSFORM_DISKID
Definition: msipriv.h:84
#define MSIHANDLETYPE_DATABASE
Definition: msipriv.h:746
#define MSI_OPEN_DIRECT
Definition: msipriv.h:101
#define MSI_OPEN_CREATEDIRECT
Definition: msipriv.h:103
#define MSI_OPEN_TRANSACT
Definition: msipriv.h:100
string_table * msi_load_string_table(IStorage *stg, UINT *bytes_per_strref)
Definition: string.c:478
#define MSI_OPEN_CREATE
Definition: msipriv.h:102
#define MSI_OPEN_READONLY
Definition: msipriv.h:99
void enum_stream_names(IStorage *stg)
Definition: table.c:206
#define MSI_INITIAL_MEDIA_TRANSFORM_OFFSET
Definition: msipriv.h:83
#define MSI_OPEN_PATCHFILE
Definition: msipriv.h:104
#define STGM_CREATE
Definition: objbase.h:945
#define STGM_DIRECT
Definition: objbase.h:933
#define STGM_READWRITE
Definition: objbase.h:938
#define STGM_TRANSACTED
Definition: objbase.h:934
#define STGM_SHARE_DENY_WRITE
Definition: objbase.h:941
#define LOWORD(l)
Definition: pedump.c:82
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147
UINT media_transform_disk_id
Definition: msipriv.h:117
UINT bytes_per_strref
Definition: msipriv.h:111
LPWSTR deletefile
Definition: msipriv.h:113
UINT media_transform_offset
Definition: msipriv.h:116
#define ERROR_OPEN_FAILED
Definition: winerror.h:306

Referenced by apply_patch_package(), MSI_ApplicablePatchW(), msi_apply_registered_patch(), MSI_OpenPackageW(), MsiGetSummaryInformationW(), and MsiOpenDatabaseW().

◆ MSI_OpenPackageW()

UINT MSI_OpenPackageW ( LPCWSTR  szPackage,
DWORD  dwOptions,
MSIPACKAGE **  pPackage 
)

Definition at line 1416 of file package.c.

1417{
1418 MSIDATABASE *db;
1419 MSIPACKAGE *package;
1421 MSIRECORD *data_row, *info_row;
1422 UINT r;
1423 WCHAR localfile[MAX_PATH], cachefile[MAX_PATH];
1424 LPCWSTR file = szPackage;
1425 DWORD index = 0;
1427 BOOL delete_on_close = FALSE;
1428 WCHAR *info_template, *productname, *product_code;
1430
1431 TRACE("%s %p\n", debugstr_w(szPackage), pPackage);
1432
1434
1435 localfile[0] = 0;
1436 if( szPackage[0] == '#' )
1437 {
1438 handle = wcstol(&szPackage[1], NULL, 10);
1440 return ERROR_INVALID_HANDLE;
1441 }
1442 else
1443 {
1444 WCHAR *product_version = NULL;
1445
1446 if ( UrlIsW( szPackage, URLIS_URL ) )
1447 {
1448 r = msi_download_file( szPackage, cachefile );
1449 if (r != ERROR_SUCCESS)
1450 return r;
1451
1452 file = cachefile;
1453 }
1454#ifdef __REACTOS__
1455 AppHelpCheckPackage(file);
1456#endif
1457
1459 if (r != ERROR_SUCCESS)
1460 {
1462 return ERROR_FILE_NOT_FOUND;
1463 return r;
1464 }
1465 r = get_local_package( db, localfile );
1467 {
1468 DWORD localfile_attr;
1469
1470 r = msi_create_empty_local_file( localfile, L".msi" );
1471 if (r != ERROR_SUCCESS)
1472 {
1473 msiobj_release( &db->hdr );
1474 return r;
1475 }
1476
1477 if (!CopyFileW( file, localfile, FALSE ))
1478 {
1479 r = GetLastError();
1480 WARN("unable to copy package %s to %s (%u)\n", debugstr_w(file), debugstr_w(localfile), r);
1481 DeleteFileW( localfile );
1482 msiobj_release( &db->hdr );
1483 return r;
1484 }
1485 delete_on_close = TRUE;
1486
1487 /* Remove read-only bit, we are opening it with write access in MSI_OpenDatabaseW below. */
1488 localfile_attr = GetFileAttributesW( localfile );
1489 if (localfile_attr & FILE_ATTRIBUTE_READONLY)
1490 SetFileAttributesW( localfile, localfile_attr & ~FILE_ATTRIBUTE_READONLY);
1491 }
1493 {
1494 if (!CopyFileW( file, localfile, FALSE ))
1495 {
1496 r = GetLastError();
1497 WARN("unable to update cached package (%u)\n", r);
1498 msiobj_release( &db->hdr );
1499 return r;
1500 }
1501 }
1502 else
1503 product_version = get_product_version( db );
1504 msiobj_release( &db->hdr );
1505 TRACE("opening package %s\n", debugstr_w( localfile ));
1506 r = MSI_OpenDatabaseW( localfile, MSIDBOPEN_TRANSACT, &db );
1507 if (r != ERROR_SUCCESS)
1508 {
1509 free( product_version );
1510 return r;
1511 }
1512
1513 if (product_version)
1514 {
1515 WCHAR *cache_version = get_product_version( db );
1516 if (!product_version != !cache_version ||
1517 (product_version && wcscmp(product_version, cache_version)))
1518 {
1519 msiobj_release( &db->hdr );
1520 free( product_version );
1521 free( cache_version );
1522 return ERROR_PRODUCT_VERSION;
1523 }
1524 free( product_version );
1525 free( cache_version );
1526 }
1527 }
1528 package = MSI_CreatePackage( db );
1529 msiobj_release( &db->hdr );
1530 if (!package) return ERROR_INSTALL_PACKAGE_INVALID;
1531 package->localfile = wcsdup( localfile );
1532 package->delete_on_close = delete_on_close;
1533
1534 r = msi_get_suminfo( db->storage, 0, &si );
1535 if (r != ERROR_SUCCESS)
1536 {
1537 r = msi_get_db_suminfo( db, 0, &si );
1538 if (r != ERROR_SUCCESS)
1539 {
1540 WARN("failed to load summary info\n");
1541 msiobj_release( &package->hdr );
1543 }
1544 }
1545 r = parse_suminfo( si, package );
1546 msiobj_release( &si->hdr );
1547 if (r != ERROR_SUCCESS)
1548 {
1549 WARN("failed to parse summary info %u\n", r);
1550 msiobj_release( &package->hdr );
1551 return r;
1552 }
1553 r = validate_package( package );
1554 if (r != ERROR_SUCCESS)
1555 {
1556 msiobj_release( &package->hdr );
1557 return r;
1558 }
1559 msi_set_property( package->db, L"DATABASE", db->path, -1 );
1560 set_installed_prop( package );
1561 msi_set_context( package );
1562
1563 product_code = get_product_code( db );
1564 if (msi_locate_product( product_code, &context ) == ERROR_SUCCESS)
1565 {
1566 TRACE("product already registered\n");
1567 msi_set_property( package->db, L"ProductToBeRegistered", L"1", -1 );
1568 }
1569 free( product_code );
1570
1571 while (1)
1572 {
1573 WCHAR patch_code[GUID_SIZE];
1574 r = MsiEnumPatchesExW( package->ProductCode, NULL, package->Context,
1575 MSIPATCHSTATE_APPLIED, index, patch_code, NULL, NULL, NULL, NULL );
1576 if (r != ERROR_SUCCESS)
1577 break;
1578
1579 TRACE("found registered patch %s\n", debugstr_w(patch_code));
1580
1581 r = msi_apply_registered_patch( package, patch_code );
1582 if (r != ERROR_SUCCESS)
1583 {
1584 ERR("registered patch failed to apply %u\n", r);
1585 msiobj_release( &package->hdr );
1586 return r;
1587 }
1588 index++;
1589 }
1590 if (index) msi_adjust_privilege_properties( package );
1591
1592 r = msi_set_original_database_property( package->db, szPackage );
1593 if (r != ERROR_SUCCESS)
1594 {
1595 msiobj_release( &package->hdr );
1596 return r;
1597 }
1598 if (gszLogFile)
1601
1602 /* FIXME: when should these messages be sent? */
1603 data_row = MSI_CreateRecord(3);
1604 if (!data_row)
1605 return ERROR_OUTOFMEMORY;
1606 MSI_RecordSetStringW(data_row, 0, NULL);
1607 MSI_RecordSetInteger(data_row, 1, 0);
1608 MSI_RecordSetInteger(data_row, 2, package->num_langids ? package->langids[0] : 0);
1611
1612 info_row = MSI_CreateRecord(0);
1613 if (!info_row)
1614 {
1615 msiobj_release(&data_row->hdr);
1616 return ERROR_OUTOFMEMORY;
1617 }
1618 info_template = msi_get_error_message(package->db, MSIERR_INFO_LOGGINGSTART);
1619 MSI_RecordSetStringW(info_row, 0, info_template);
1620 free(info_template);
1622
1624
1625 productname = msi_dup_property(package->db, INSTALLPROPERTY_PRODUCTNAMEW);
1626 MSI_RecordSetInteger(data_row, 1, 1);
1627 MSI_RecordSetStringW(data_row, 2, productname);
1628 MSI_RecordSetStringW(data_row, 3, NULL);
1630
1631 free(productname);
1632 msiobj_release(&info_row->hdr);
1633 msiobj_release(&data_row->hdr);
1634
1635 *pPackage = package;
1636 return ERROR_SUCCESS;
1637}
BOOL WINAPI SetFileAttributesW(LPCWSTR lpFileName, DWORD dwFileAttributes)
Definition: fileinfo.c:779
BOOL WINAPI UrlIsW(const WCHAR *url, URLIS Urlis)
Definition: path.c:4788
UINT msi_locate_product(LPCWSTR szProduct, MSIINSTALLCONTEXT *context)
Definition: msi.c:54
static UINT validate_package(MSIPACKAGE *package)
Definition: package.c:1214
UINT msi_download_file(LPCWSTR szUrl, LPWSTR filename)
Definition: package.c:1030
INT MSI_ProcessMessage(MSIPACKAGE *package, INSTALLMESSAGE eMessageType, MSIRECORD *record)
Definition: package.c:1941
static UINT get_local_package(MSIDATABASE *db, WCHAR *localfile)
Definition: package.c:1330
static WCHAR * get_product_version(MSIDATABASE *db)
Definition: package.c:1279
static UINT parse_suminfo(MSISUMMARYINFO *si, MSIPACKAGE *package)
Definition: package.c:1106
static WCHAR * get_product_code(MSIDATABASE *db)
Definition: package.c:1274
static UINT set_installed_prop(MSIPACKAGE *package)
Definition: package.c:457
UINT msi_create_empty_local_file(LPWSTR path, LPCWSTR suffix)
Definition: package.c:1066
UINT WINAPI MsiEnumPatchesExW(const WCHAR *szProductCode, const WCHAR *szUserSid, DWORD dwContext, DWORD dwFilter, DWORD dwIndex, WCHAR *szPatchCode, WCHAR *szTargetProductCode, MSIINSTALLCONTEXT *pdwTargetProductContext, WCHAR *szTargetUserSid, DWORD *pcchTargetUserSid)
Definition: registry.c:1950
#define MSIERR_INFO_LOGGINGSTART
Definition: resource.h:24
@ MSIPATCHSTATE_APPLIED
Definition: msi.h:54
enum tagMSIINSTALLCONTEXT MSIINSTALLCONTEXT
static const WCHAR INSTALLPROPERTY_PRODUCTNAMEW[]
Definition: msi.h:277
@ INSTALLMESSAGE_COMMONDATA
Definition: msi.h:105
@ INSTALLMESSAGE_INFO
Definition: msi.h:98
@ INSTALLMESSAGE_INITIALIZE
Definition: msi.h:106
WCHAR * gszLogFile
Definition: msi_main.c:50
UINT msi_get_string_table_codepage(const string_table *st)
Definition: string.c:671
UINT MSI_RecordSetInteger(MSIRECORD *, UINT, int)
Definition: record.c:280
WCHAR * msi_get_error_message(MSIDATABASE *, int) __WINE_DEALLOC(free) __WINE_MALLOC
Definition: package.c:1850
#define GUID_SIZE
Definition: msipriv.h:757
INT MSI_ProcessMessageVerbatim(MSIPACKAGE *, INSTALLMESSAGE, MSIRECORD *)
Definition: package.c:1875
UINT msi_apply_registered_patch(MSIPACKAGE *package, LPCWSTR patch_code)
Definition: patch.c:990
#define WINE_OPENPACKAGEFLAGS_RECACHE
Definition: msipriv.h:908
#define MSIDBOPEN_TRANSACT
Definition: msiquery.h:67
#define FILE_SHARE_WRITE
Definition: nt_native.h:681
#define FILE_ATTRIBUTE_READONLY
Definition: nt_native.h:702
@ URLIS_URL
Definition: shlwapi.h:597
#define MB_ICONHAND
Definition: winuser.h:799
DWORD dwOptions
Definition: solitaire.cpp:25
BOOL delete_on_close
Definition: msipriv.h:464
UINT num_langids
Definition: msipriv.h:410
LANGID * langids
Definition: msipriv.h:411
LPWSTR localfile
Definition: msipriv.h:463
#define INVALID_FILE_ATTRIBUTES
Definition: vfdcmd.c:23
#define ERROR_INSTALL_PACKAGE_INVALID
Definition: winerror.h:1326
#define ERROR_PRODUCT_VERSION
Definition: winerror.h:1344

Referenced by ACTION_InstallAdminPackage(), MSI_OpenProductW(), MsiDetermineApplicablePatchesW(), MsiInstallProductW(), MsiOpenPackageExW(), MsiReinstallFeatureW(), and open_package().

◆ MSI_OpenQuery()

UINT WINAPIV MSI_OpenQuery ( MSIDATABASE *  db,
MSIQUERY **  view,
LPCWSTR  fmt,
  ... 
)

Definition at line 138 of file msiquery.c.

139{
140 UINT r;
141 int size = 100, res;
143
144 /* construct the string */
145 for (;;)
146 {
147 va_list va;
148 query = malloc(size * sizeof(WCHAR));
149 va_start(va, fmt);
150 res = vswprintf(query, size, fmt, va);
151 va_end(va);
152 if (res == -1) size *= 2;
153 else if (res >= size) size = res + 1;
154 else break;
155 free(query);
156 }
157 /* perform the query */
159 free(query);
160 return r;
161}
static int __cdecl vswprintf(wchar_t *buffer, size_t size, const wchar_t *format, va_list args)
UINT MSI_DatabaseOpenViewW(MSIDATABASE *db, const WCHAR *szQuery, MSIQUERY **pView)
Definition: msiquery.c:110
Definition: dsound.c:943

Referenced by ACTION_AppSearch(), ACTION_CCPSearch(), ACTION_ExecuteAction(), ACTION_ProcessExecSequence(), add_records_to_table(), combobox_add_items(), dialog_build_font_list(), dialog_button_handler(), dialog_evaluate_control_conditions(), dialog_fill_controls(), dialog_map_events(), dialog_radiogroup_control(), get_assembly_display_name(), get_assembly_record(), get_merge_table(), listbox_add_items(), listview_add_items(), load_feature(), load_file_hash(), load_folder_persistence(), mark_patched_components(), merge_diff_tables(), MSI_DatabaseExport(), MSI_DatabaseGetPrimaryKeys(), MSI_Sequence(), MsiGetProductPropertyW(), unimplemented_action_stub(), and update_merge_errors().

◆ msi_package_add_info()

UINT msi_package_add_info ( MSIPACKAGE *  package,
DWORD  context,
DWORD  options,
LPCWSTR  property,
LPWSTR  value 
)

Definition at line 2657 of file package.c.

2659{
2661
2663 {
2664 if (!wcscmp( info->value, value )) return ERROR_SUCCESS;
2665 }
2666
2667 info = malloc(sizeof(MSISOURCELISTINFO));
2668 if (!info)
2669 return ERROR_OUTOFMEMORY;
2670
2671 info->context = context;
2672 info->options = options;
2673 info->property = property;
2674 info->value = wcsdup(value);
2675 list_add_head(&package->sourcelist_info, &info->entry);
2676
2677 return ERROR_SUCCESS;
2678}
struct list sourcelist_info
Definition: msipriv.h:477
Definition: pdh_main.c:64

Referenced by msi_load_media_info().

◆ msi_package_add_media_disk()

UINT msi_package_add_media_disk ( MSIPACKAGE *  package,
DWORD  context,
DWORD  options,
DWORD  disk_id,
LPWSTR  volume_label,
LPWSTR  disk_prompt 
)

Definition at line 2680 of file package.c.

2682{
2683 MSIMEDIADISK *disk;
2684
2686 {
2687 if (disk->disk_id == disk_id) return ERROR_SUCCESS;
2688 }
2689
2690 disk = malloc(sizeof(MSIMEDIADISK));
2691 if (!disk)
2692 return ERROR_OUTOFMEMORY;
2693
2694 disk->context = context;
2695 disk->options = options;
2696 disk->disk_id = disk_id;
2698 disk->disk_prompt = wcsdup(disk_prompt);
2699 list_add_head(&package->sourcelist_media, &disk->entry);
2700
2701 return ERROR_SUCCESS;
2702}
__u8 volume_label[11]
Definition: mkdosfs.c:4
DWORD context
Definition: msipriv.h:169
DWORD options
Definition: msipriv.h:170
LPWSTR volume_label
Definition: msipriv.h:172
struct list entry
Definition: msipriv.h:168
LPWSTR disk_prompt
Definition: msipriv.h:173
DWORD disk_id
Definition: msipriv.h:171
struct list sourcelist_media
Definition: msipriv.h:478

Referenced by msi_load_media_info().

◆ msi_parse_command_line()

UINT msi_parse_command_line ( MSIPACKAGE *  package,
LPCWSTR  szCommandLine,
BOOL  preserve_case 
)

Definition at line 206 of file action.c.

208{
209 LPCWSTR ptr, ptr2;
210 int num_quotes;
211 DWORD len;
212 WCHAR *prop, *val;
213 UINT r;
214
215 if (!szCommandLine)
216 return ERROR_SUCCESS;
217
218 ptr = szCommandLine;
219 while (*ptr)
220 {
221 while (*ptr == ' ') ptr++;
222 if (!*ptr) break;
223
224 ptr2 = wcschr( ptr, '=' );
225 if (!ptr2) return ERROR_INVALID_COMMAND_LINE;
226
227 len = ptr2 - ptr;
228 if (!len) return ERROR_INVALID_COMMAND_LINE;
229
230 while (ptr[len - 1] == ' ') len--;
231
232 prop = malloc( (len + 1) * sizeof(WCHAR) );
233 memcpy( prop, ptr, len * sizeof(WCHAR) );
234 prop[len] = 0;
235 if (!preserve_case) wcsupr( prop );
236
237 ptr2++;
238 while (*ptr2 == ' ') ptr2++;
239
240 num_quotes = 0;
241 val = malloc( (wcslen( ptr2 ) + 1) * sizeof(WCHAR) );
242 len = parse_prop( ptr2, val, &num_quotes );
243 if (num_quotes % 2)
244 {
245 WARN("unbalanced quotes\n");
246 free( val );
247 free( prop );
249 }
251 TRACE("Found commandline property %s = %s\n", debugstr_w(prop), debugstr_w(val));
252
253 r = msi_set_property( package->db, prop, val, -1 );
254 if (r == ERROR_SUCCESS && !wcscmp( prop, L"SourceDir" ))
255 msi_reset_source_folders( package );
256
257 free( val );
258 free( prop );
259
260 ptr = ptr2 + len;
261 }
262
263 return ERROR_SUCCESS;
264}
static void remove_quotes(WCHAR *str)
Definition: action.c:194
static wchar_t * wcsupr(wchar_t *str)
Definition: string.h:102
#define ERROR_INVALID_COMMAND_LINE
Definition: winerror.h:1345

Referenced by load_admin_properties(), and MSI_InstallPackage().

◆ msi_parse_version_string()

void msi_parse_version_string ( LPCWSTR  verStr,
PDWORD  ms,
PDWORD  ls 
)

Definition at line 52 of file appsearch.c.

53{
54 const WCHAR *ptr;
55 int x1 = 0, x2 = 0, x3 = 0, x4 = 0;
56
57 x1 = wcstol(verStr, NULL, 10);
58 ptr = wcschr(verStr, '.');
59 if (ptr)
60 {
61 x2 = wcstol(ptr + 1, NULL, 10);
62 ptr = wcschr(ptr + 1, '.');
63 }
64 if (ptr)
65 {
66 x3 = wcstol(ptr + 1, NULL, 10);
67 ptr = wcschr(ptr + 1, '.');
68 }
69 if (ptr)
70 x4 = wcstol(ptr + 1, NULL, 10);
71 /* FIXME: byte-order dependent? */
72 *ms = x1 << 16 | x2;
73 if (ls) *ls = x3 << 16 | x4;
74}
static float int float int float int x3
Definition: server.c:79
static float int float int float int float int x4
Definition: server.c:79
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG x1
Definition: winddi.h:3708
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG _In_ LONG _In_ LONG x2
Definition: winddi.h:3710

Referenced by check_transform_applicable(), get_signature(), msi_compare_file_versions(), and msi_compare_font_versions().

◆ msi_patch_assembly()

UINT msi_patch_assembly ( MSIPACKAGE *  package,
MSIASSEMBLY *  assembly,
MSIFILEPATCH *  patch 
)

Definition at line 726 of file files.c.

727{
730 IAssemblyEnum *iter;
731
732 if (!(iter = msi_create_assembly_enum( package, assembly->display_name )))
734
735 while ((IAssemblyEnum_GetNextAssembly( iter, NULL, &name, 0 ) == S_OK))
736 {
737 WCHAR *displayname, *path;
738 DWORD len = 0;
739 HRESULT hr;
740
741 hr = IAssemblyName_GetDisplayName( name, NULL, &len, 0 );
742 if (hr != E_NOT_SUFFICIENT_BUFFER || !(displayname = malloc( len * sizeof(WCHAR) )))
743 break;
744
745 hr = IAssemblyName_GetDisplayName( name, displayname, &len, 0 );
746 if (FAILED( hr ))
747 {
748 free( displayname );
749 break;
750 }
751
752 if ((path = msi_get_assembly_path( package, displayname )))
753 {
754 if (!msi_copy_file( package, path, patch->File->TargetPath, FALSE ))
755 {
756 ERR( "failed to copy file %s -> %s (%lu)\n", debugstr_w(path),
758 free( path );
759 free( displayname );
760 IAssemblyName_Release( name );
761 break;
762 }
763 r = patch_file( package, patch );
764 free( path );
765 }
766
767 free( displayname );
768 IAssemblyName_Release( name );
769 if (r == ERROR_SUCCESS) break;
770 }
771
772 IAssemblyEnum_Release( iter );
773 return r;
774}
BOOL msi_copy_file(MSIPACKAGE *package, const WCHAR *src, const WCHAR *dst, BOOL fail_if_exists)
Definition: files.c:70
IAssemblyEnum * msi_create_assembly_enum(MSIPACKAGE *package, const WCHAR *displayname)
Definition: assembly.c:244
WCHAR * msi_get_assembly_path(MSIPACKAGE *package, const WCHAR *displayname)
Definition: assembly.c:219

Referenced by ACTION_InstallFinalize().

◆ MSI_ProcessMessage()

INT MSI_ProcessMessage ( MSIPACKAGE *  package,
INSTALLMESSAGE  eMessageType,
MSIRECORD *  record 
)

Definition at line 1941 of file package.c.

1942{
1943 switch (eMessageType & 0xff000000)
1944 {
1952 {
1953 /* error message */
1954
1955 LPWSTR template;
1956 LPWSTR template_rec = NULL, template_prefix = NULL;
1958
1959 if (MSI_RecordIsNull(record, 0))
1960 {
1961 if (error >= 32)
1962 {
1963 template_rec = msi_get_error_message(package->db, error);
1964
1965 if (!template_rec && error >= 2000)
1966 {
1967 /* internal error, not localized */
1968 if ((template_rec = (LPWSTR) get_internal_error_message(error)))
1969 {
1970 MSI_RecordSetStringW(record, 0, template_rec);
1972 }
1973 template_rec = msi_get_error_message(package->db, MSIERR_INSTALLERROR);
1974 MSI_RecordSetStringW(record, 0, template_rec);
1975 MSI_ProcessMessageVerbatim(package, eMessageType, record);
1976 free(template_rec);
1977 return 0;
1978 }
1979 }
1980 }
1981 else
1982 template_rec = msi_dup_record_field(record, 0);
1983
1984 template_prefix = msi_get_error_message(package->db, eMessageType >> 24);
1985 if (!template_prefix) template_prefix = wcsdup(L"");
1986
1987 if (!template_rec)
1988 {
1989 /* always returns 0 */
1990 MSI_RecordSetStringW(record, 0, template_prefix);
1991 MSI_ProcessMessageVerbatim(package, eMessageType, record);
1992 free(template_prefix);
1993 return 0;
1994 }
1995
1996 template = malloc((wcslen(template_rec) + wcslen(template_prefix) + 1) * sizeof(WCHAR));
1997 if (!template)
1998 {
1999 free(template_prefix);
2000 free(template_rec);
2001 return ERROR_OUTOFMEMORY;
2002 }
2003
2004 lstrcpyW(template, template_prefix);
2005 lstrcatW(template, template_rec);
2006 MSI_RecordSetStringW(record, 0, template);
2007
2008 free(template_prefix);
2009 free(template_rec);
2010 free(template);
2011 }
2012 break;
2014 {
2015 WCHAR *template = msi_get_error_message(package->db, MSIERR_ACTIONSTART);
2016 MSI_RecordSetStringW(record, 0, template);
2017 free(template);
2018
2019 free(package->LastAction);
2020 free(package->LastActionTemplate);
2021 package->LastAction = msi_dup_record_field(record, 1);
2022 if (!package->LastAction) package->LastAction = wcsdup(L"");
2024 break;
2025 }
2027 if (package->LastAction && package->LastActionTemplate)
2028 {
2029 size_t len = lstrlenW(package->LastAction) + lstrlenW(package->LastActionTemplate) + 7;
2030 WCHAR *template = malloc(len * sizeof(WCHAR));
2031 if (!template) return ERROR_OUTOFMEMORY;
2032 swprintf(template, len, L"{{%s: }}%s", package->LastAction, package->LastActionTemplate);
2033 MSI_RecordSetStringW(record, 0, template);
2034 free(template);
2035 }
2036 break;
2038 {
2039 WCHAR *template = msi_get_error_message(package->db, MSIERR_COMMONDATA);
2040 MSI_RecordSetStringW(record, 0, template);
2041 free(template);
2042 }
2043 break;
2044 }
2045
2046 return MSI_ProcessMessageVerbatim(package, eMessageType, record);
2047}
static LPCWSTR get_internal_error_message(int error)
Definition: package.c:1834
INT MSI_ProcessMessageVerbatim(MSIPACKAGE *package, INSTALLMESSAGE eMessageType, MSIRECORD *record)
Definition: package.c:1875
LPWSTR msi_get_error_message(MSIDATABASE *db, int error)
Definition: package.c:1850
#define MSIERR_INSTALLERROR
Definition: resource.h:21
#define MSIERR_ACTIONSTART
Definition: resource.h:22
#define MSIERR_COMMONDATA
Definition: resource.h:23
@ INSTALLMESSAGE_WARNING
Definition: msi.h:96
@ INSTALLMESSAGE_ACTIONSTART
Definition: msi.h:102
@ INSTALLMESSAGE_ERROR
Definition: msi.h:95
@ INSTALLMESSAGE_USER
Definition: msi.h:97
@ INSTALLMESSAGE_OUTOFDISKSPACE
Definition: msi.h:101
@ INSTALLMESSAGE_FATALEXIT
Definition: msi.h:94
BOOL MSI_RecordIsNull(MSIRECORD *, UINT)
Definition: record.c:321

Referenced by ACTION_AllocateRegistrySpace(), ACTION_ExecuteAction(), ACTION_MsiPublishAssemblies(), ACTION_MsiUnpublishAssemblies(), ACTION_ProcessComponents(), ACTION_PublishFeatures(), ACTION_PublishProduct(), ACTION_RegisterClassInfo(), ACTION_RegisterExtensionInfo(), ACTION_RegisterMIMEInfo(), ACTION_RegisterProduct(), ACTION_RegisterProgIdInfo(), ACTION_RegisterUser(), ACTION_RemoveFiles(), ACTION_ResolveSource(), ACTION_ShowDialog(), ACTION_UnregisterClassInfo(), ACTION_UnregisterExtensionInfo(), ACTION_UnregisterMIMEInfo(), ACTION_UnregisterProgIdInfo(), change_media(), dialog_create(), file_update_ui(), ITERATE_AppSearch(), ITERATE_CreateFolders(), ITERATE_CreateShortcuts(), ITERATE_DeleteService(), ITERATE_DuplicateFiles(), ITERATE_FindRelatedProducts(), ITERATE_InstallODBCDataSource(), ITERATE_InstallODBCDriver(), ITERATE_InstallODBCTranslator(), ITERATE_MoveFiles(), iterate_properties(), ITERATE_PublishComponent(), ITERATE_RegisterFonts(), ITERATE_RegisterTypeLibraries(), ITERATE_RemoveDuplicateFiles(), ITERATE_RemoveEnvironmentString(), ITERATE_RemoveFiles(), ITERATE_RemoveFolders(), ITERATE_RemoveIniValuesOnInstall(), ITERATE_RemoveIniValuesOnUninstall(), ITERATE_RemoveODBCDataSource(), ITERATE_RemoveODBCDriver(), ITERATE_RemoveODBCTranslator(), ITERATE_RemoveRegistryValuesOnInstall(), ITERATE_RemoveRegistryValuesOnUninstall(), ITERATE_RemoveShortcuts(), ITERATE_SelfRegModules(), ITERATE_SelfUnregModules(), ITERATE_StartService(), ITERATE_StopService(), ITERATE_UnpublishComponent(), ITERATE_UnregisterFonts(), ITERATE_UnregisterTypeLibraries(), ITERATE_WriteEnvironmentString(), ITERATE_WriteIniValues(), ITERATE_WriteRegistryValues(), MSI_FreePackage(), MSI_OpenPackageW(), msi_ui_progress(), MsiOpenPackageExW(), MsiProcessMessage(), ui_actioninfo(), ui_actionstart(), and unpublish_feature().

◆ MSI_ProcessMessageVerbatim()

INT MSI_ProcessMessageVerbatim ( MSIPACKAGE *  package,
INSTALLMESSAGE  eMessageType,
MSIRECORD *  record 
)

Definition at line 1875 of file package.c.

1876{
1877 LPWSTR message = {0};
1878 DWORD len;
1879 DWORD log_type = 1 << (eMessageType >> 24);
1880 UINT res;
1881 INT rc = 0;
1882 char *msg;
1883
1884 TRACE("%x\n", eMessageType);
1885 if (TRACE_ON(msi)) dump_record(record);
1886
1887 if (!package || !record)
1888 message = NULL;
1889 else {
1890 res = MSI_FormatRecordW(package, record, message, &len);
1891 if (res != ERROR_SUCCESS && res != ERROR_MORE_DATA)
1892 return res;
1893 len++;
1894 message = malloc(len * sizeof(WCHAR));
1895 if (!message) return ERROR_OUTOFMEMORY;
1896 MSI_FormatRecordW(package, record, message, &len);
1897 }
1898
1899 /* convert it to ANSI */
1900 len = WideCharToMultiByte( CP_ACP, 0, message, -1, NULL, 0, NULL, NULL );
1901 msg = malloc( len );
1903
1904 if (gUIHandlerRecord && (gUIFilterRecord & log_type))
1905 {
1906 MSIHANDLE rec = alloc_msihandle(&record->hdr);
1907 TRACE( "calling UI handler %p(pvContext = %p, iMessageType = %#x, hRecord = %lu)\n",
1908 gUIHandlerRecord, gUIContextRecord, eMessageType, rec );
1909 rc = gUIHandlerRecord( gUIContextRecord, eMessageType, rec );
1910 MsiCloseHandle( rec );
1911 }
1912 if (!rc && gUIHandlerW && (gUIFilter & log_type))
1913 {
1914 TRACE( "calling UI handler %p(pvContext = %p, iMessageType = %#x, szMessage = %s)\n",
1915 gUIHandlerW, gUIContext, eMessageType, debugstr_w(message) );
1916 rc = gUIHandlerW( gUIContext, eMessageType, message );
1917 }
1918 else if (!rc && gUIHandlerA && (gUIFilter & log_type))
1919 {
1920 TRACE( "calling UI handler %p(pvContext = %p, iMessageType = %#x, szMessage = %s)\n",
1921 gUIHandlerA, gUIContext, eMessageType, debugstr_a(msg) );
1922 rc = gUIHandlerA( gUIContext, eMessageType, msg );
1923 }
1924
1925 if (!rc)
1926 rc = internal_ui_handler(package, eMessageType, record, message);
1927
1928 if (!rc && package && package->log_file != INVALID_HANDLE_VALUE &&
1929 (eMessageType & 0xff000000) != INSTALLMESSAGE_PROGRESS)
1930 {
1931 DWORD written;
1932 WriteFile( package->log_file, msg, len - 1, &written, NULL );
1933 WriteFile( package->log_file, "\n", 1, &written, NULL );
1934 }
1935 free( msg );
1936 free( message );
1937
1938 return rc;
1939}
#define WideCharToMultiByte
Definition: compat.h:111
UINT MSI_FormatRecordW(MSIPACKAGE *package, MSIRECORD *record, LPWSTR buffer, LPDWORD size)
Definition: format.c:838
MSIHANDLE alloc_msihandle(MSIOBJECTHDR *obj)
Definition: handle.c:111
UINT WINAPI MsiCloseHandle(MSIHANDLE handle)
Definition: handle.c:269
static INT internal_ui_handler(MSIPACKAGE *package, INSTALLMESSAGE eMessageType, MSIRECORD *record, LPCWSTR message)
Definition: package.c:1732
#define debugstr_a
Definition: kernel32.h:31
@ INSTALLMESSAGE_PROGRESS
Definition: msi.h:104
INSTALLUI_HANDLERA gUIHandlerA
Definition: msi_main.c:43
DWORD gUIFilter
Definition: msi_main.c:46
LPVOID gUIContextRecord
Definition: msi_main.c:49
DWORD gUIFilterRecord
Definition: msi_main.c:47
LPVOID gUIContext
Definition: msi_main.c:48
INSTALLUI_HANDLER_RECORD gUIHandlerRecord
Definition: msi_main.c:45
INSTALLUI_HANDLERW gUIHandlerW
Definition: msi_main.c:44
Definition: tftpd.h:60

Referenced by ACTION_ExecuteAction(), MSI_OpenPackageW(), and MSI_ProcessMessage().

◆ MSI_QueryGetRecord()

MSIRECORD *WINAPIV MSI_QueryGetRecord ( MSIDATABASE *  db,
LPCWSTR  query,
  ... 
)

◆ msi_record_get_string()

const WCHAR * msi_record_get_string ( const MSIRECORD *  rec,
UINT  field,
int *  len 
)

◆ msi_record_set_string()

UINT msi_record_set_string ( MSIRECORD *  rec,
UINT  field,
const WCHAR *  value,
int  len 
)

Definition at line 573 of file record.c.

574{
575 if (field > rec->count)
576 return ERROR_INVALID_FIELD;
577
578 MSI_FreeField( &rec->fields[field] );
579
580 if (value && len < 0) len = lstrlenW( value );
581
582 if (value && len)
583 {
586 rec->fields[field].len = len;
587 }
588 else
589 {
591 rec->fields[field].u.szwVal = NULL;
592 rec->fields[field].len = 0;
593 }
594 return 0;
595}
WCHAR * msi_strdupW(const WCHAR *value, int len)
Definition: record.c:155
#define ERROR_INVALID_FIELD
Definition: winerror.h:1322

Referenced by get_transform_record(), MSI_RecordSetStringW(), msi_set_property(), and msi_view_refresh_row().

◆ MSI_RecordCopyField()

UINT MSI_RecordCopyField ( MSIRECORD *  in_rec,
UINT  in_n,
MSIRECORD *  out_rec,
UINT  out_n 
)

Definition at line 166 of file record.c.

168{
170
171 msiobj_lock( &in_rec->hdr );
172
173 if ( in_n > in_rec->count || out_n > out_rec->count )
175 else if ( in_rec != out_rec || in_n != out_n )
176 {
177 LPWSTR str;
178 MSIFIELD *in, *out;
179
180 in = &in_rec->fields[in_n];
181 out = &out_rec->fields[out_n];
182
183 switch ( in->type )
184 {
185 case MSIFIELD_NULL:
186 break;
187 case MSIFIELD_INT:
188 out->u.iVal = in->u.iVal;
189 break;
190 case MSIFIELD_WSTR:
191 if ((str = msi_strdupW( in->u.szwVal, in->len )))
192 {
193 out->u.szwVal = str;
194 out->len = in->len;
195 }
196 else r = ERROR_OUTOFMEMORY;
197 break;
198 case MSIFIELD_STREAM:
199 IStream_AddRef( in->u.stream );
200 out->u.stream = in->u.stream;
201 break;
202 default:
203 ERR("invalid field type %d\n", in->type);
204 }
205 if (r == ERROR_SUCCESS)
206 out->type = in->type;
207 }
208
209 msiobj_unlock( &in_rec->hdr );
210 return r;
211}
void msiobj_lock(MSIOBJECTHDR *info)
Definition: handle.c:231
void msiobj_unlock(MSIOBJECTHDR *info)
Definition: handle.c:236

Referenced by arrange_record(), msi_clone_properties(), MSI_CloneRecord(), msi_query_merge_record(), refresh_record(), SELECT_set_row(), translate_record(), UPDATE_execute(), and WHERE_set_row().

◆ MSI_RecordGetFieldCount()

◆ MSI_RecordGetInteger()

int MSI_RecordGetInteger ( MSIRECORD *  rec,
UINT  iField 
)

Definition at line 213 of file record.c.

214{
215 int ret = 0;
216
217 TRACE("%p %d\n", rec, iField );
218
219 if( iField > rec->count )
220 return MSI_NULL_INTEGER;
221
222 switch( rec->fields[iField].type )
223 {
224 case MSIFIELD_INT:
225 return rec->fields[iField].u.iVal;
226 case MSIFIELD_WSTR:
227 if( string2intW( rec->fields[iField].u.szwVal, &ret ) )
228 return ret;
229 return MSI_NULL_INTEGER;
230 default:
231 break;
232 }
233
234 return MSI_NULL_INTEGER;
235}
static BOOL string2intW(LPCWSTR str, int *out)
Definition: record.c:132

Referenced by ACTION_CustomAction(), ACTION_ProcessComponents(), dialog_add_control(), dialog_add_font(), dialog_adjust_dialog_pos(), dialog_bitmap_control(), dialog_button_control(), dialog_combo_control(), dialog_create(), dialog_create_window(), dialog_directory_combo(), dialog_directory_list(), dialog_handle_event(), dialog_hyperlink(), dialog_icon_control(), dialog_list_box(), dialog_listview(), dialog_oncreate(), dialog_pathedit_control(), dialog_progress_bar(), dialog_radiogroup_control(), dialog_selection_tree(), dialog_text_control(), dialog_volumeselect_combo(), get_signature(), get_table_value_from_record(), internal_ui_handler(), ITERATE_CostFinalizeConditions(), ITERATE_CreateShortcuts(), ITERATE_DeleteService(), ITERATE_FindRelatedProducts(), ITERATE_InstallODBCDataSource(), ITERATE_InstallService(), iterate_load_verb(), ITERATE_MigrateFeatureStates(), ITERATE_MoveFiles(), ITERATE_RemoveExistingProducts(), ITERATE_RemoveFiles(), ITERATE_RemoveIniValuesOnInstall(), ITERATE_RemoveIniValuesOnUninstall(), ITERATE_RemoveODBCDataSource(), ITERATE_RemoveRegistryValuesOnInstall(), ITERATE_RemoveRegistryValuesOnUninstall(), ITERATE_StartService(), ITERATE_StopService(), ITERATE_UnregisterTypeLibraries(), ITERATE_WriteIniValues(), ITERATE_WriteRegistryValues(), load_class(), load_component(), load_drlocator(), load_feature(), load_file(), load_file_disk_id(), load_file_hash(), load_media(), load_patch(), load_patch_disk_id(), load_progid(), msi_load_assembly(), msi_load_media_info(), MSI_ProcessMessage(), msi_select_update(), MsiRecordGetInteger(), patch_add_media(), patch_offset_get_filepatches(), patch_offset_get_files(), patch_set_offsets(), patch_update_file_sequence(), patch_update_filepatch_sequence(), primary_key_iterator(), record_to_row(), resolve_keypath(), search_components(), search_ini(), search_reg(), table_load_transform(), table_validate_new(), and WHERE_evaluate().

◆ MSI_RecordGetIStream()

UINT MSI_RecordGetIStream ( MSIRECORD *  rec,
UINT  iField,
IStream **  pstm 
)

Definition at line 852 of file record.c.

853{
854 TRACE("%p %d %p\n", rec, iField, pstm);
855
856 if( iField > rec->count )
857 return ERROR_INVALID_FIELD;
858
859 if( rec->fields[iField].type != MSIFIELD_STREAM )
860 return ERROR_INVALID_FIELD;
861
862 *pstm = rec->fields[iField].u.stream;
863 IStream_AddRef( *pstm );
864
865 return ERROR_SUCCESS;
866}

Referenced by load_picture(), MSI_RecordStreamToFile(), msi_select_update(), STORAGES_set_row(), STREAMS_set_row(), and TABLE_set_row().

◆ MSI_RecordGetString()

const WCHAR * MSI_RecordGetString ( const MSIRECORD *  rec,
UINT  iField 
)

Definition at line 433 of file record.c.

434{
435 return msi_record_get_string( rec, iField, NULL );
436}
const WCHAR * msi_record_get_string(const MSIRECORD *rec, UINT field, int *len)
Definition: record.c:420

Referenced by ACTION_CustomAction(), ACTION_PerformEndAction(), combobox_add_item(), create_diff_row_query(), dialog_add_control(), dialog_add_font(), dialog_checkbox_control(), dialog_combo_control(), dialog_control_event(), dialog_create(), dialog_create_controls(), dialog_create_radiobutton(), dialog_create_window(), dialog_directory_combo(), dialog_directory_list(), dialog_edit_control(), dialog_get_uitext(), dialog_handle_event(), dialog_hyperlink(), dialog_list_box(), dialog_listview(), dialog_maskedit_control(), dialog_oncreate(), dialog_pathedit_control(), dialog_radiogroup_control(), dialog_scrolltext_control(), dialog_selection_tree(), dialog_seltree_handler(), dialog_set_control_condition(), dialog_text_control(), dialog_vcl_add_columns(), dialog_volumeselect_combo(), find_feature_children(), find_folder_children(), get_assembly_name_attribute(), get_assembly_record(), get_deformatted_field(), get_duplicate_filename(), get_ini_file_name(), get_key_value(), get_link_file(), get_property(), get_query_columns(), get_query_types(), get_table_labels(), HANDLE_CustomType19(), internal_ui_handler(), is_uninstallable(), ITERATE_Actions(), iterate_all_classes(), iterate_all_extensions(), iterate_all_mimes(), iterate_all_progids(), ITERATE_AppSearch(), ITERATE_BindImage(), ITERATE_CCPSearch(), ITERATE_CostFinalizeConditions(), ITERATE_CreateFolders(), ITERATE_CreateShortcuts(), ITERATE_DeleteService(), ITERATE_DuplicateFiles(), ITERATE_FindRelatedProducts(), ITERATE_InstallODBCDataSource(), ITERATE_InstallODBCDriver(), ITERATE_InstallODBCTranslator(), ITERATE_InstallService(), ITERATE_LaunchConditions(), iterate_load_featurecomponents(), iterate_load_verb(), ITERATE_MigrateFeatureStates(), ITERATE_MoveFiles(), iterate_patched_component(), ITERATE_PublishComponent(), ITERATE_PublishIcon(), ITERATE_RegisterFonts(), ITERATE_RegisterTypeLibraries(), ITERATE_RemoveDuplicateFiles(), ITERATE_RemoveEnvironmentString(), ITERATE_RemoveExistingProducts(), ITERATE_RemoveFiles(), ITERATE_RemoveFolders(), ITERATE_RemoveIniValuesOnInstall(), ITERATE_RemoveIniValuesOnUninstall(), ITERATE_RemoveODBCDataSource(), ITERATE_RemoveODBCDriver(), ITERATE_RemoveODBCTranslator(), ITERATE_RemoveRegistryValuesOnInstall(), ITERATE_RemoveRegistryValuesOnUninstall(), ITERATE_RemoveShortcuts(), ITERATE_SelfRegModules(), ITERATE_SelfUnregModules(), ITERATE_StartService(), ITERATE_StopService(), ITERATE_UnpublishComponent(), ITERATE_UnpublishIcon(), ITERATE_UnregisterFonts(), ITERATE_UnregisterTypeLibraries(), ITERATE_WriteEnvironmentString(), ITERATE_WriteIniValues(), ITERATE_WriteRegistryValues(), join_find_row(), listbox_add_item(), listview_add_item(), load_appid(), load_class(), load_extension(), load_file(), load_media(), load_mime(), load_patch(), load_progid(), map_event(), media_get_disk_info(), merge_diff_tables(), merge_verify_colnames(), merge_verify_primary_keys(), MSI_FormatRecordW(), msi_load_assembly(), msi_load_media_info(), MsiGetProductPropertyW(), patch_set_media_source_prop(), patch_update_file_sequence(), patch_update_filepatch_sequence(), primary_key_iterator(), resolve_keypath(), search_components(), search_reg(), storages_find_row(), STORAGES_set_row(), streams_find_row(), STREAMS_set_row(), STRING_evaluate(), and ui_actionstart().

◆ MSI_RecordGetStringA()

UINT MSI_RecordGetStringA ( MSIRECORD *  rec,
UINT  iField,
LPSTR  szValue,
LPDWORD  pcchValue 
)

Definition at line 351 of file record.c.

353{
354 UINT len = 0, ret = ERROR_SUCCESS;
355 CHAR buffer[16];
356
357 TRACE("%p %d %p %p\n", rec, iField, szValue, pcchValue);
358
359 if( iField > rec->count )
360 {
361 if ( szValue && *pcchValue > 0 )
362 szValue[0] = 0;
363
364 *pcchValue = 0;
365 return ERROR_SUCCESS;
366 }
367
368 switch( rec->fields[iField].type )
369 {
370 case MSIFIELD_INT:
371 wsprintfA(buffer, "%d", rec->fields[iField].u.iVal);
372 len = lstrlenA( buffer );
373 if (szValue)
374 lstrcpynA(szValue, buffer, *pcchValue);
375 break;
376 case MSIFIELD_WSTR:
377 len = WideCharToMultiByte( CP_ACP, 0, rec->fields[iField].u.szwVal,
378 rec->fields[iField].len + 1, NULL, 0 , NULL, NULL );
379 if (szValue)
380 WideCharToMultiByte( CP_ACP, 0, rec->fields[iField].u.szwVal,
381 rec->fields[iField].len + 1, szValue, *pcchValue, NULL, NULL );
382 if( szValue && *pcchValue && len>*pcchValue )
383 szValue[*pcchValue-1] = 0;
384 if( len )
385 len--;
386 break;
387 case MSIFIELD_NULL:
388 if( szValue && *pcchValue > 0 )
389 szValue[0] = 0;
390 break;
391 default:
393 break;
394 }
395
396 if( szValue && *pcchValue <= len )
398 *pcchValue = len;
399
400 return ret;
401}
#define lstrcpynA
Definition: compat.h:751
int WINAPI lstrlenA(LPCSTR lpString)
Definition: lstring.c:145
int WINAPIV wsprintfA(_Out_ LPSTR, _In_ _Printf_format_string_ LPCSTR,...)

Referenced by export_field(), and MsiRecordGetStringA().

◆ MSI_RecordGetStringW()

◆ MSI_RecordIsNull()

◆ MSI_RecordReadStream()

UINT MSI_RecordReadStream ( MSIRECORD *  rec,
UINT  iField,
char *  buf,
LPDWORD  sz 
)

Definition at line 761 of file record.c.

762{
763 ULONG count;
764 HRESULT r;
765 IStream *stm;
766
767 TRACE("%p %d %p %p\n", rec, iField, buf, sz);
768
769 if( !sz )
771
772 if( iField > rec->count)
774
775 if ( rec->fields[iField].type == MSIFIELD_NULL )
776 {
777 *sz = 0;
778 return ERROR_INVALID_DATA;
779 }
780
781 if( rec->fields[iField].type != MSIFIELD_STREAM )
783
784 stm = rec->fields[iField].u.stream;
785 if( !stm )
787
788 /* if there's no buffer pointer, calculate the length to the end */
789 if( !buf )
790 {
791 LARGE_INTEGER ofs;
793
794 ofs.QuadPart = cur.QuadPart = 0;
795 end.QuadPart = 0;
796 IStream_Seek( stm, ofs, STREAM_SEEK_SET, &cur );
797 IStream_Seek( stm, ofs, STREAM_SEEK_END, &end );
798 ofs.QuadPart = cur.QuadPart;
799 IStream_Seek( stm, ofs, STREAM_SEEK_SET, &cur );
800 *sz = end.QuadPart - cur.QuadPart;
801
802 return ERROR_SUCCESS;
803 }
804
805 /* read the data */
806 count = 0;
807 r = IStream_Read( stm, buf, *sz, &count );
808 if( FAILED( r ) )
809 {
810 *sz = 0;
812 }
813
814 *sz = count;
815
816 return ERROR_SUCCESS;
817}
FxCollectionEntry * cur
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
LONGLONG QuadPart
Definition: typedefs.h:114
#define ERROR_INVALID_DATATYPE
Definition: winerror.h:1468
#define ERROR_INVALID_DATA
Definition: winerror.h:238

Referenced by create_temp_binary(), export_stream(), HANDLE_CustomType5_6(), ITERATE_PublishIcon(), and MsiRecordReadStream().

◆ MSI_RecordsAreEqual()

BOOL MSI_RecordsAreEqual ( MSIRECORD *  a,
MSIRECORD *  b 
)

Definition at line 986 of file record.c.

987{
988 UINT i;
989
990 if (a->count != b->count)
991 return FALSE;
992
993 for (i = 0; i <= a->count; i++)
994 {
995 if (!MSI_RecordsAreFieldsEqual( a, b, i ))
996 return FALSE;
997 }
998
999 return TRUE;
1000}
BOOL MSI_RecordsAreFieldsEqual(MSIRECORD *a, MSIRECORD *b, UINT field)
Definition: record.c:957
GLboolean GLboolean GLboolean b
Definition: glext.h:6204

Referenced by merge_diff_row().

◆ MSI_RecordsAreFieldsEqual()

BOOL MSI_RecordsAreFieldsEqual ( MSIRECORD *  a,
MSIRECORD *  b,
UINT  field 
)

Definition at line 957 of file record.c.

958{
959 if (a->fields[field].type != b->fields[field].type)
960 return FALSE;
961
962 switch (a->fields[field].type)
963 {
964 case MSIFIELD_NULL:
965 break;
966
967 case MSIFIELD_INT:
968 if (a->fields[field].u.iVal != b->fields[field].u.iVal)
969 return FALSE;
970 break;
971
972 case MSIFIELD_WSTR:
973 if (a->fields[field].len != b->fields[field].len) return FALSE;
974 if (memcmp( a->fields[field].u.szwVal, b->fields[field].u.szwVal,
975 a->fields[field].len * sizeof(WCHAR) )) return FALSE;
976 break;
977
978 case MSIFIELD_STREAM:
979 default:
980 return FALSE;
981 }
982 return TRUE;
983}
_ACRTIMP int __cdecl memcmp(const void *, const void *, size_t)
Definition: string.c:2807

Referenced by join_modify_update(), and MSI_RecordsAreEqual().

◆ MSI_RecordSetInteger()

◆ MSI_RecordSetIStream()

UINT MSI_RecordSetIStream ( MSIRECORD *  rec,
UINT  iField,
IStream *  stm 
)

Definition at line 836 of file record.c.

837{
838 TRACE("%p %d %p\n", rec, iField, stm);
839
840 if( iField > rec->count )
841 return ERROR_INVALID_FIELD;
842
843 MSI_FreeField( &rec->fields[iField] );
844
845 rec->fields[iField].type = MSIFIELD_STREAM;
846 rec->fields[iField].u.stream = stm;
847 IStream_AddRef( stm );
848
849 return ERROR_SUCCESS;
850}

Referenced by add_stream(), copy_remote_record(), and msi_view_refresh_row().

◆ MSI_RecordSetStream()

UINT MSI_RecordSetStream ( MSIRECORD *  rec,
UINT  iField,
IStream *  stream 
)

Definition at line 671 of file record.c.

672{
673 if ( (iField == 0) || (iField > rec->count) )
675
676 MSI_FreeField( &rec->fields[iField] );
677 rec->fields[iField].type = MSIFIELD_STREAM;
678 rec->fields[iField].u.stream = stream;
679
680 return ERROR_SUCCESS;
681}

Referenced by get_transform_record(), and MSI_RecordSetStreamFromFileW().

◆ MSI_RecordSetStreamFromFileW()

UINT MSI_RecordSetStreamFromFileW ( MSIRECORD *  rec,
UINT  iField,
LPCWSTR  szFilename 
)

Definition at line 683 of file record.c.

684{
685 IStream *stm = NULL;
686 HRESULT hr;
687 UINT ret;
688
689 if( (iField == 0) || (iField > rec->count) )
691
692 /* no filename means we should seek back to the start of the stream */
693 if( !szFilename )
694 {
695 LARGE_INTEGER ofs;
697
698 if( rec->fields[iField].type != MSIFIELD_STREAM )
699 return ERROR_INVALID_FIELD;
700
701 stm = rec->fields[iField].u.stream;
702 if( !stm )
703 return ERROR_INVALID_FIELD;
704
705 ofs.QuadPart = 0;
706 hr = IStream_Seek( stm, ofs, STREAM_SEEK_SET, &cur );
707 if (FAILED( hr ))
709 }
710 else
711 {
712 /* read the file into a stream and save the stream in the record */
713 ret = RECORD_StreamFromFile(szFilename, &stm);
714 if (ret != ERROR_SUCCESS)
715 return ret;
716
717 /* if all's good, store it in the record */
718 MSI_RecordSetStream(rec, iField, stm);
719 }
720
721 return ERROR_SUCCESS;
722}
static UINT RECORD_StreamFromFile(LPCWSTR szFile, IStream **pstm)
Definition: record.c:623
UINT MSI_RecordSetStream(MSIRECORD *rec, UINT iField, IStream *stream)
Definition: record.c:671

Referenced by construct_record(), and MsiRecordSetStreamW().

◆ MSI_RecordSetStringW()

UINT MSI_RecordSetStringW ( MSIRECORD *  rec,
UINT  iField,
LPCWSTR  szValue 
)

Definition at line 597 of file record.c.

598{
599 TRACE("%p %d %s\n", rec, iField, debugstr_w(szValue));
600
601 return msi_record_set_string( rec, iField, szValue, -1 );
602}
UINT msi_record_set_string(MSIRECORD *rec, UINT field, const WCHAR *value, int len)
Definition: record.c:573

Referenced by ACTION_ExecuteAction(), ACTION_MsiPublishAssemblies(), ACTION_MsiUnpublishAssemblies(), ACTION_ProcessComponents(), ACTION_PublishFeatures(), ACTION_PublishProduct(), ACTION_RegisterClassInfo(), ACTION_RegisterExtensionInfo(), ACTION_RegisterMIMEInfo(), ACTION_RegisterProduct(), ACTION_RegisterProgIdInfo(), ACTION_RegisterUser(), ACTION_RemoveFiles(), ACTION_ResolveSource(), ACTION_ShowDialog(), ACTION_UnregisterClassInfo(), ACTION_UnregisterExtensionInfo(), ACTION_UnregisterMIMEInfo(), ACTION_UnregisterProgIdInfo(), add_stream(), change_media(), construct_record(), copy_remote_record(), deformat_string(), dialog_create(), dialog_seltree_handler(), event_set_target_path(), file_update_ui(), get_property_row(), internal_ui_handler(), ITERATE_AppSearch(), ITERATE_CreateFolders(), ITERATE_DeleteService(), ITERATE_DuplicateFiles(), ITERATE_FindRelatedProducts(), ITERATE_InstallODBCDataSource(), ITERATE_InstallODBCDriver(), ITERATE_InstallODBCTranslator(), ITERATE_MoveFiles(), iterate_properties(), ITERATE_PublishComponent(), ITERATE_RegisterFonts(), ITERATE_RemoveDuplicateFiles(), ITERATE_RemoveEnvironmentString(), ITERATE_RemoveFiles(), ITERATE_RemoveFolders(), ITERATE_RemoveIniValuesOnInstall(), ITERATE_RemoveIniValuesOnUninstall(), ITERATE_RemoveODBCDataSource(), ITERATE_RemoveODBCDriver(), ITERATE_RemoveODBCTranslator(), ITERATE_RemoveRegistryValuesOnInstall(), ITERATE_RemoveRegistryValuesOnUninstall(), ITERATE_SelfRegModules(), ITERATE_SelfUnregModules(), ITERATE_StartService(), ITERATE_StopService(), ITERATE_UnpublishComponent(), ITERATE_UnregisterFonts(), ITERATE_WriteEnvironmentString(), ITERATE_WriteIniValues(), ITERATE_WriteRegistryValues(), msi_create_table(), MSI_DatabaseExport(), MSI_FormatRecordW(), MSI_OpenPackageW(), MSI_ProcessMessage(), msi_query_merge_record(), MSI_ViewGetColumnInfo(), MsiRecordSetStringA(), MsiRecordSetStringW(), patch_add_media(), patch_update_filepatch_sequence(), primary_key_iterator(), set_record_type_string(), TABLE_add_column(), TABLE_drop(), TABLE_remove_column(), ui_actioninfo(), ui_actionstart(), and unpublish_feature().

◆ MSI_RecordStreamToFile()

UINT MSI_RecordStreamToFile ( MSIRECORD *  rec,
UINT  iField,
LPCWSTR  name 
)

Definition at line 900 of file record.c.

901{
902 IStream *stm = NULL;
903 UINT r;
904
905 TRACE("%p %u %s\n", rec, iField, debugstr_w(name));
906
907 msiobj_lock( &rec->hdr );
908
909 r = MSI_RecordGetIStream( rec, iField, &stm );
910 if( r == ERROR_SUCCESS )
911 {
912 r = dump_stream_to_file( stm, name );
913 IStream_Release( stm );
914 }
915
916 msiobj_unlock( &rec->hdr );
917
918 return r;
919}
UINT MSI_RecordGetIStream(MSIRECORD *rec, UINT iField, IStream **pstm)
Definition: record.c:852
static UINT dump_stream_to_file(IStream *stm, const WCHAR *name)
Definition: record.c:868

Referenced by load_image().

◆ msi_reduce_to_long_filename()

void msi_reduce_to_long_filename ( WCHAR *  filename)

Definition at line 1053 of file files.c.

1054{
1055 WCHAR *p = wcschr( filename, '|' );
1056 if (p) memmove( filename, p + 1, (lstrlenW( p + 1 ) + 1) * sizeof(WCHAR) );
1057}
#define memmove(s1, s2, n)
Definition: mkisofs.h:881

Referenced by get_duplicate_filename(), get_link_file(), ITERATE_MoveFiles(), ITERATE_RemoveFiles(), load_class(), and load_file().

◆ msi_reg_get_val_dword()

BOOL msi_reg_get_val_dword ( HKEY  hkey,
LPCWSTR  name,
DWORD *  val 
)

Definition at line 262 of file registry.c.

263{
264 DWORD type, len = sizeof (DWORD);
265 LONG r = RegQueryValueExW(hkey, name, NULL, &type, (LPBYTE) val, &len);
266 return r == ERROR_SUCCESS && type == REG_DWORD;
267}
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
Definition: reg.c:4103
#define DWORD
Definition: nt_native.h:44
#define REG_DWORD
Definition: sdbapi.c:615
unsigned char * LPBYTE
Definition: typedefs.h:53

Referenced by MSI_GetComponentPath(), MsiQueryProductStateW(), and reg_get_value().

◆ msi_reg_get_val_str()

◆ msi_reg_set_subkey_val()

LONG msi_reg_set_subkey_val ( HKEY  hkey,
LPCWSTR  path,
LPCWSTR  name,
LPCWSTR  val 
)

Definition at line 230 of file registry.c.

231{
232 HKEY hsubkey = 0;
233 LONG r;
234
235 r = RegCreateKeyW( hkey, path, &hsubkey );
236 if (r != ERROR_SUCCESS)
237 return r;
238 r = msi_reg_set_val_str( hsubkey, name, val );
239 RegCloseKey( hsubkey );
240 return r;
241}
LONG msi_reg_set_val_str(HKEY hkey, LPCWSTR name, LPCWSTR value)
Definition: registry.c:209

Referenced by ACTION_RegisterClassInfo(), ACTION_RegisterMIMEInfo(), register_progid(), and register_verb().

◆ msi_reg_set_val_dword()

LONG msi_reg_set_val_dword ( HKEY  hkey,
LPCWSTR  name,
DWORD  val 
)

Definition at line 225 of file registry.c.

226{
227 return RegSetValueExW( hkey, name, 0, REG_DWORD, (LPBYTE)&val, sizeof (DWORD) );
228}

Referenced by publish_install_properties(), publish_product_properties(), and write_shared_dlls_count().

◆ msi_reg_set_val_multi_str()

LONG msi_reg_set_val_multi_str ( HKEY  hkey,
LPCWSTR  name,
LPCWSTR  value 
)

Definition at line 217 of file registry.c.

218{
219 LPCWSTR p = value;
220 while (*p) p += lstrlenW(p) + 1;
221 return RegSetValueExW( hkey, name, 0, REG_MULTI_SZ,
222 (const BYTE *)value, (p + 1 - value) * sizeof(WCHAR) );
223}

Referenced by ITERATE_PublishComponent(), publish_product_properties(), and register_verb().

◆ msi_reg_set_val_str()

◆ msi_register_unique_action()

UINT msi_register_unique_action ( MSIPACKAGE *  package,
const WCHAR *  action 
)

Definition at line 112 of file custom.c.

113{
114 UINT count;
115 WCHAR **newbuf = NULL;
116
117 TRACE("Registering %s as unique action\n", debugstr_w(action));
118
119 count = package->unique_actions_count;
120 package->unique_actions_count++;
121 if (count != 0) newbuf = realloc( package->unique_actions,
122 package->unique_actions_count * sizeof(WCHAR *) );
123 else newbuf = malloc( sizeof(WCHAR *) );
124
125 newbuf[count] = wcsdup( action );
126 package->unique_actions = newbuf;
127 return ERROR_SUCCESS;
128}
#define realloc
Definition: debug_ros.c:6

Referenced by ACTION_AppSearch(), ACTION_CCPSearch(), ACTION_FindRelatedProducts(), and check_execution_scheduling_options().

◆ msi_remove_directory()

BOOL msi_remove_directory ( MSIPACKAGE *  package,
const WCHAR *  path 
)

Definition at line 97 of file files.c.

98{
99 BOOL ret;
102 msi_revert_fs_redirection( package );
103 return ret;
104}
BOOL WINAPI RemoveDirectoryW(IN LPCWSTR lpPathName)
Definition: dir.c:700

Referenced by ITERATE_RemoveFiles(), ITERATE_UnpublishIcon(), and remove_path().

◆ msi_reset_source_folders()

void msi_reset_source_folders ( MSIPACKAGE *  package)

Definition at line 2121 of file package.c.

2122{
2124
2126 {
2127 free( folder->ResolvedSource );
2128 folder->ResolvedSource = NULL;
2129 }
2130}

Referenced by ACTION_CustomAction(), append_productcode(), dialog_set_property(), ITERATE_AppSearch(), msi_parse_command_line(), msi_set_sourcedir_props(), and MsiSetPropertyW().

◆ msi_resolve_file_source()

WCHAR * msi_resolve_file_source ( MSIPACKAGE *  package,
MSIFILE *  file 
)

Definition at line 536 of file files.c.

537{
538 WCHAR *p, *path;
539
540 TRACE("Working to resolve source of file %s\n", debugstr_w(file->File));
541
542 if (file->IsCompressed) return NULL;
543
544 p = msi_resolve_source_folder( package, file->Component->Directory, NULL );
545 path = msi_build_directory_name( 2, p, file->ShortName );
546
547 if (file->LongName && msi_get_file_attributes( package, path ) == INVALID_FILE_ATTRIBUTES)
548 {
549 free( path );
550 path = msi_build_directory_name( 2, p, file->LongName );
551 }
552 free( p );
553 TRACE("file %s source resolves to %s\n", debugstr_w(file->File), debugstr_w(path));
554 return path;
555}
DWORD msi_get_file_attributes(MSIPACKAGE *package, const WCHAR *path)
Definition: files.c:115
WCHAR * msi_resolve_source_folder(MSIPACKAGE *package, const WCHAR *name, MSIFOLDER **folder)
Definition: install.c:364

Referenced by ACTION_InstallFiles(), and ACTION_ProcessComponents().

◆ msi_resolve_source_folder()

WCHAR * msi_resolve_source_folder ( MSIPACKAGE *  package,
const WCHAR *  name,
MSIFOLDER **  folder 
)

Definition at line 364 of file install.c.

365{
366 MSIFOLDER *f;
367 LPWSTR p, path = NULL, parent;
368
369 TRACE("working to resolve %s\n", debugstr_w(name));
370
371 if (!wcscmp( name, L"SourceDir" )) name = L"TARGETDIR";
372 if (!(f = msi_get_loaded_folder( package, name ))) return NULL;
373
374 /* special resolving for root dir */
375 if (!wcscmp( name, L"TARGETDIR" ) && !f->ResolvedSource)
376 {
377 f->ResolvedSource = get_source_root( package );
378 }
379 if (folder) *folder = f;
380 if (f->ResolvedSource)
381 {
382 path = wcsdup( f->ResolvedSource );
383 TRACE(" already resolved to %s\n", debugstr_w(path));
384 return path;
385 }
386 if (!f->Parent) return path;
387 parent = f->Parent;
388 TRACE(" ! parent is %s\n", debugstr_w(parent));
389
390 p = msi_resolve_source_folder( package, parent, NULL );
391
393 path = get_source_root( package );
394 else if (package->WordCount & msidbSumInfoSourceTypeSFN)
395 path = msi_build_directory_name( 3, p, f->SourceShortPath, NULL );
396 else
397 path = msi_build_directory_name( 3, p, f->SourceLongPath, NULL );
398
399 TRACE("-> %s\n", debugstr_w(path));
400 f->ResolvedSource = wcsdup( path );
401 free( p );
402
403 return path;
404}
static WCHAR * get_source_root(MSIPACKAGE *package)
Definition: install.c:358
@ msidbSumInfoSourceTypeSFN
Definition: msidefs.h:221
@ msidbSumInfoSourceTypeCompressed
Definition: msidefs.h:222

Referenced by deformat_component(), msi_resolve_file_source(), msi_resolve_source_folder(), MsiGetSourcePathA(), and MsiGetSourcePathW().

◆ msi_resolve_target_folder()

void msi_resolve_target_folder ( MSIPACKAGE *  package,
const WCHAR *  name,
BOOL  load_prop 
)

Definition at line 2183 of file action.c.

2184{
2185 FolderList *fl;
2187 WCHAR *path, *normalized_path;
2188
2189 TRACE("resolving %s\n", debugstr_w(name));
2190
2191 if (!(folder = msi_get_loaded_folder( package, name ))) return;
2192
2193 if (!wcscmp( folder->Directory, L"TARGETDIR" )) /* special resolving for target root dir */
2194 {
2195 if (!(path = get_install_location( package )) &&
2196 (!load_prop || !(path = msi_dup_property( package->db, L"TARGETDIR" ))))
2197 {
2198 path = msi_dup_property( package->db, L"ROOTDRIVE" );
2199 }
2200 if (is_admin_install( package )) load_prop = FALSE;
2201 }
2202 else if (!load_prop || !(path = msi_dup_property( package->db, folder->Directory )))
2203 {
2204 if (folder->Parent && wcscmp( folder->Directory, folder->Parent ))
2205 {
2206 parent = msi_get_loaded_folder( package, folder->Parent );
2207 path = msi_build_directory_name( 3, parent->ResolvedTarget, folder->TargetDefault, NULL );
2208 }
2209 else
2210 path = msi_build_directory_name( 2, folder->TargetDefault, NULL );
2211 }
2212
2213 normalized_path = msi_normalize_path( path );
2214 msi_set_property( package->db, folder->Directory, normalized_path, -1 );
2215 free( path );
2216
2217 free( folder->ResolvedTarget );
2218 folder->ResolvedTarget = normalized_path;
2219
2221 {
2222 child = fl->folder;
2223 msi_resolve_target_folder( package, child->Directory, load_prop );
2224 }
2225 TRACE("%s resolves to %s\n", debugstr_w(name), debugstr_w(folder->ResolvedTarget));
2226}
WCHAR * msi_normalize_path(const WCHAR *in)
Definition: action.c:2115
static BOOL is_admin_install(MSIPACKAGE *package)
Definition: action.c:2175
static WCHAR * get_install_location(MSIPACKAGE *package)
Definition: action.c:2159
_In_ FLONG fl
Definition: winddi.h:1279

Referenced by ACTION_CostFinalize(), msi_get_target_folder(), msi_resolve_target_folder(), and set_target_path().

◆ msi_revert_fs_redirection()

◆ msi_save_string_table()

UINT msi_save_string_table ( const string_table *  st,
IStorage *  storage,
UINT *  bytes_per_strref 
)

Definition at line 564 of file string.c.

565{
566 UINT i, datasize = 0, poolsize = 0, sz, used, r, codepage, n;
568 CHAR *data = NULL;
569 USHORT *pool = NULL;
570
571 TRACE("\n");
572
573 /* construct the new table in memory first */
574 string_totalsize( st, &datasize, &poolsize );
575
576 TRACE("%u %u %u\n", st->maxcount, datasize, poolsize );
577
578 pool = malloc( poolsize );
579 if( ! pool )
580 {
581 WARN("Failed to alloc pool %d bytes\n", poolsize );
582 goto err;
583 }
584 data = malloc( datasize );
585 if( ! data )
586 {
587 WARN("Failed to alloc data %d bytes\n", datasize );
588 goto err;
589 }
590
591 used = 0;
592 codepage = st->codepage;
593 pool[0] = codepage & 0xffff;
594 pool[1] = codepage >> 16;
595 if (st->maxcount > 0xffff)
596 {
597 pool[1] |= 0x8000;
598 *bytes_per_strref = LONG_STR_BYTES;
599 }
600 else
601 *bytes_per_strref = sizeof(USHORT);
602
603 n = 1;
604 for( i=1; i<st->maxcount; i++ )
605 {
606 if( !st->strings[i].persistent_refcount )
607 {
608 pool[ n*2 ] = 0;
609 pool[ n*2 + 1] = 0;
610 n++;
611 continue;
612 }
613
614 sz = datasize - used;
615 r = id2string( st, i, data+used, &sz );
616 if( r != ERROR_SUCCESS )
617 {
618 ERR("failed to fetch string\n");
619 sz = 0;
620 }
621
622 if (sz)
623 pool[ n*2 + 1 ] = st->strings[i].persistent_refcount;
624 else
625 pool[ n*2 + 1 ] = 0;
626 if (sz < 0x10000)
627 {
628 pool[ n*2 ] = sz;
629 n++;
630 }
631 else
632 {
633 pool[ n*2 ] = 0;
634 pool[ n*2 + 2 ] = sz&0xffff;
635 pool[ n*2 + 3 ] = (sz>>16);
636 n += 2;
637 }
638 used += sz;
639 if( used > datasize )
640 {
641 ERR("oops overran %d >= %d\n", used, datasize);
642 goto err;
643 }
644 }
645
646 if( used != datasize )
647 {
648 ERR("oops used %d != datasize %d\n", used, datasize);
649 goto err;
650 }
651
652 /* write the streams */
653 r = write_stream_data( storage, L"_StringData", data, datasize, TRUE );
654 TRACE("Wrote StringData r=%08x\n", r);
655 if( r )
656 goto err;
657 r = write_stream_data( storage, L"_StringPool", pool, poolsize, TRUE );
658 TRACE("Wrote StringPool r=%08x\n", r);
659 if( r )
660 goto err;
661
663
664err:
665 free( data );
666 free( pool );
667
668 return ret;
669}
static int used
Definition: adh-main.c:39
static UINT id2string(const string_table *st, UINT id, char *buffer, UINT *sz)
Definition: string.c:372
static void string_totalsize(const string_table *st, UINT *datasize, UINT *poolsize)
Definition: string.c:424
#define err(...)

Referenced by MSI_CommitTables().

◆ msi_schedule_action()

UINT msi_schedule_action ( MSIPACKAGE *  package,
UINT  script,
const WCHAR *  action 
)

Definition at line 89 of file custom.c.

90{
91 UINT count;
92 WCHAR **newbuf = NULL;
93
94 if (script >= SCRIPT_MAX)
95 {
96 FIXME("Unknown script requested %u\n", script);
98 }
99 TRACE("Scheduling action %s in script %u\n", debugstr_w(action), script);
100
102 package->script_actions_count[script]++;
103 if (count != 0) newbuf = realloc( package->script_actions[script],
104 package->script_actions_count[script] * sizeof(WCHAR *) );
105 else newbuf = malloc( sizeof(WCHAR *) );
106
107 newbuf[count] = wcsdup( action );
108 package->script_actions[script] = newbuf;
109 return ERROR_SUCCESS;
110}

Referenced by ACTION_CreateFolders(), ACTION_CreateShortcuts(), ACTION_DeleteServices(), ACTION_DuplicateFiles(), ACTION_HandleStandardAction(), ACTION_InstallFiles(), ACTION_InstallODBC(), ACTION_InstallServices(), ACTION_MoveFiles(), ACTION_MsiPublishAssemblies(), ACTION_MsiUnpublishAssemblies(), ACTION_PatchFiles(), ACTION_ProcessComponents(), ACTION_PublishComponents(), ACTION_PublishFeatures(), ACTION_PublishProduct(), ACTION_RegisterClassInfo(), ACTION_RegisterExtensionInfo(), ACTION_RegisterFonts(), ACTION_RegisterMIMEInfo(), ACTION_RegisterProduct(), ACTION_RegisterProgIdInfo(), ACTION_RegisterTypeLibraries(), ACTION_RegisterUser(), ACTION_RemoveDuplicateFiles(), ACTION_RemoveEnvironmentStrings(), ACTION_RemoveFiles(), ACTION_RemoveFolders(), ACTION_RemoveIniValues(), ACTION_RemoveODBC(), ACTION_RemoveRegistryValues(), ACTION_RemoveShortcuts(), ACTION_SelfRegModules(), ACTION_SelfUnregModules(), ACTION_StartServices(), ACTION_StopServices(), ACTION_UnpublishComponents(), ACTION_UnpublishFeatures(), ACTION_UnregisterClassInfo(), ACTION_UnregisterExtensionInfo(), ACTION_UnregisterFonts(), ACTION_UnregisterMIMEInfo(), ACTION_UnregisterProgIdInfo(), ACTION_UnregisterTypeLibraries(), ACTION_WriteEnvironmentStrings(), ACTION_WriteIniValues(), ACTION_WriteRegistryValues(), and defer_custom_action().

◆ MSI_Sequence()

UINT MSI_Sequence ( MSIPACKAGE *  package,
LPCWSTR  szTable 
)

Definition at line 446 of file action.c.

447{
448 MSIQUERY *view;
449 UINT r;
450
451 TRACE("%p %s\n", package, debugstr_w(table));
452
453 r = MSI_OpenQuery( package->db, &view, L"SELECT * FROM `%s` WHERE `Sequence` > 0 ORDER BY `Sequence`", table );
454 if (r == ERROR_SUCCESS)
455 {
457 msiobj_release(&view->hdr);
458 }
459 return r;
460}
static UINT ITERATE_Actions(MSIRECORD *row, LPVOID param)
Definition: action.c:404

Referenced by MsiSequenceW().

◆ msi_set_context()

UINT msi_set_context ( MSIPACKAGE *  package)

Definition at line 390 of file action.c.

391{
392 UINT r = msi_locate_product( package->ProductCode, &package->Context );
393 if (r != ERROR_SUCCESS)
394 {
395 int num = msi_get_property_int( package->db, L"ALLUSERS", 0 );
396 if (num == 1 || num == 2)
398 else
400 }
401 return ERROR_SUCCESS;
402}
GLuint GLuint num
Definition: glext.h:9618

Referenced by MSI_InstallPackage(), and MSI_OpenPackageW().

◆ msi_set_file_attributes()

BOOL msi_set_file_attributes ( MSIPACKAGE *  package,
const WCHAR *  filename,
DWORD  attrs 
)

Definition at line 106 of file files.c.

107{
108 BOOL ret;
110 ret = SetFileAttributesW( filename, attrs );
111 msi_revert_fs_redirection( package );
112 return ret;
113}

Referenced by ACTION_RemoveFiles(), cabinet_copy_file(), copy_file_attributes(), and copy_install_file().

◆ msi_set_last_used_source()

UINT msi_set_last_used_source ( LPCWSTR  product,
LPCWSTR  usersid,
MSIINSTALLCONTEXT  context,
DWORD  options,
LPCWSTR  value 
)

Definition at line 686 of file source.c.

689{
690 HKEY source;
692 WCHAR typechar;
693 DWORD size;
694 UINT r;
695 int index = 1;
696
698 typechar = 'n';
699 else if (options & MSISOURCETYPE_URL)
700 typechar = 'u';
701 else if (options & MSISOURCETYPE_MEDIA)
702 typechar = 'm';
703 else
705
707 {
708 r = MsiSourceListAddSourceExW(product, usersid, context,
709 options, value, 0);
710 if (r != ERROR_SUCCESS)
711 return r;
712
713 index = 0;
714 while ((r = MsiSourceListEnumSourcesW(product, usersid, context, options,
716 index++;
717
718 if (r != ERROR_NO_MORE_ITEMS)
719 return r;
720 }
721
722 size = lstrlenW(L"%c;%d;%s") + lstrlenW(value) + 7;
723 buffer = malloc(size * sizeof(WCHAR));
724 if (!buffer)
725 return ERROR_OUTOFMEMORY;
726
728 if (r != ERROR_SUCCESS)
729 {
730 free(buffer);
731 return r;
732 }
733
734 swprintf(buffer, size, L"%c;%d;%s", typechar, index, value);
735
736 size = (lstrlenW(buffer) + 1) * sizeof(WCHAR);
739 free(buffer);
740
742 return r;
743}
UINT WINAPI MsiSourceListAddSourceExW(const WCHAR *szProduct, const WCHAR *szUserSid, MSIINSTALLCONTEXT dwContext, DWORD dwOptions, const WCHAR *szSource, DWORD dwIndex)
Definition: source.c:1033
static UINT OpenSourceKey(LPCWSTR szProduct, HKEY *key, DWORD dwOptions, MSIINSTALLCONTEXT context, BOOL create)
Definition: source.c:53
UINT WINAPI MsiSourceListEnumSourcesW(const WCHAR *szProductCodeOrPatch, const WCHAR *szUserSid, MSIINSTALLCONTEXT dwContext, DWORD dwOptions, DWORD dwIndex, WCHAR *szSource, DWORD *pcchSource)
Definition: source.c:398

Referenced by MsiSourceListSetInfoW(), and publish_sourcelist().

◆ msi_set_original_database_property()

UINT msi_set_original_database_property ( MSIDATABASE *  db,
const WCHAR *  package 
)

Definition at line 1342 of file package.c.

1343{
1344 UINT r;
1345
1346 if (UrlIsW( package, URLIS_URL ))
1347 r = msi_set_property( db, L"OriginalDatabase", package, -1 );
1348 else if (package[0] == '#')
1349 r = msi_set_property( db, L"OriginalDatabase", db->path, -1 );
1350 else
1351 {
1352 DWORD len;
1353 WCHAR *path;
1354
1355 if (!(len = GetFullPathNameW( package, 0, NULL, NULL ))) return GetLastError();
1356 if (!(path = malloc( len * sizeof(WCHAR) ))) return ERROR_OUTOFMEMORY;
1357 len = GetFullPathNameW( package, len, path, NULL );
1358 r = msi_set_property( db, L"OriginalDatabase", path, len );
1359 free( path );
1360 }
1361 return r;
1362}
DWORD WINAPI GetFullPathNameW(IN LPCWSTR lpFileName, IN DWORD nBufferLength, OUT LPWSTR lpBuffer, OUT LPWSTR *lpFilePart)
Definition: path.c:1164

Referenced by MSI_InstallPackage(), and MSI_OpenPackageW().

◆ msi_set_property()

UINT msi_set_property ( MSIDATABASE *  db,
const WCHAR *  name,
const WCHAR *  value,
int  len 
)

Definition at line 2132 of file package.c.

2133{
2134 MSIQUERY *view;
2135 MSIRECORD *row = NULL;
2136 DWORD sz = 0;
2137 WCHAR query[1024];
2138 UINT rc;
2139
2140 TRACE("%p %s %s %d\n", db, debugstr_w(name), debugstr_wn(value, len), len);
2141
2142 if (!name)
2144
2145 /* this one is weird... */
2146 if (!name[0])
2148
2149 if (value && len < 0) len = lstrlenW( value );
2150
2151 rc = msi_get_property( db, name, 0, &sz );
2152 if (!value || (!*value && !len))
2153 {
2154 swprintf( query, ARRAY_SIZE(query), L"DELETE FROM `_Property` WHERE `_Property` = '%s'", name );
2155 }
2156 else if (rc == ERROR_MORE_DATA || rc == ERROR_SUCCESS)
2157 {
2158 swprintf( query, ARRAY_SIZE(query), L"UPDATE `_Property` SET `Value` = ? WHERE `_Property` = '%s'", name );
2159 row = MSI_CreateRecord(1);
2161 }
2162 else
2163 {
2164 lstrcpyW( query, L"INSERT INTO `_Property` (`_Property`,`Value`) VALUES (?,?)" );
2165 row = MSI_CreateRecord(2);
2166 msi_record_set_string( row, 1, name, -1 );
2168 }
2169
2170 rc = MSI_DatabaseOpenViewW(db, query, &view);
2171 if (rc == ERROR_SUCCESS)
2172 {
2173 rc = MSI_ViewExecute(view, row);
2175 msiobj_release(&view->hdr);
2176 }
2177 if (row) msiobj_release(&row->hdr);
2178 return rc;
2179}
UINT msi_get_property(MSIDATABASE *db, LPCWSTR szName, LPWSTR szValueBuf, LPDWORD pchValueBuf)
Definition: package.c:2282
UINT msi_record_set_string(MSIRECORD *, UINT, const WCHAR *, int)
Definition: record.c:573

Referenced by ACTION_ADMIN(), ACTION_CostFinalize(), ACTION_CostInitialize(), ACTION_CustomAction(), ACTION_DisableRollback(), ACTION_INSTALL(), ACTION_ProcessExecSequence(), append_productcode(), dialog_set_property(), event_add_local(), event_add_source(), event_reinstall(), event_reinstall_mode(), event_remove(), ITERATE_AppSearch(), ITERATE_CCPSearch(), msi_adjust_privilege_properties(), MSI_CreatePackage(), MSI_InstallPackage(), msi_load_suminfo_properties(), MSI_OpenPackageW(), msi_parse_command_line(), msi_resolve_target_folder(), msi_set_original_database_property(), msi_set_sourcedir_props(), MSI_SetInstallLevel(), msi_validate_product_id(), MsiSetPropertyW(), patch_set_media_source_prop(), process_overrides(), set_deferred_action_props(), set_installed_prop(), set_installer_properties(), set_msi_assembly_prop(), set_target_path(), and set_user_sid_prop().

◆ msi_set_sourcedir_props()

UINT msi_set_sourcedir_props ( MSIPACKAGE *  package,
BOOL  replace 
)

Definition at line 348 of file action.c.

349{
350 WCHAR *source, *check, *p, *db;
351 DWORD len;
352
353 if (!(db = msi_dup_property( package->db, L"OriginalDatabase" )))
354 return ERROR_OUTOFMEMORY;
355
356 if (!(p = wcsrchr( db, '\\' )) && !(p = wcsrchr( db, '/' )))
357 {
358 free(db);
359 return ERROR_SUCCESS;
360 }
361 len = p - db + 2;
362 source = malloc( len * sizeof(WCHAR) );
363 lstrcpynW( source, db, len );
364 free( db );
365
366 check = msi_dup_property( package->db, L"SourceDir" );
367 if (!check || replace)
368 {
369 UINT r = msi_set_property( package->db, L"SourceDir", source, -1 );
370 if (r == ERROR_SUCCESS)
371 msi_reset_source_folders( package );
372 }
373 free( check );
374
375 check = msi_dup_property( package->db, L"SOURCEDIR" );
376 if (!check || replace)
377 msi_set_property( package->db, L"SOURCEDIR", source, -1 );
378
379 free( check );
380 free( source );
381
382 return ERROR_SUCCESS;
383}
#define lstrcpynW
Definition: compat.h:738
#define check(expected, result)
Definition: dplayx.c:43
INT replace(TCHAR source[MAX_PATH], TCHAR dest[MAX_PATH], DWORD dwFlags, BOOL *doMore)
Definition: replace.c:38

Referenced by ACTION_InstallFiles(), ACTION_ProcessComponents(), ACTION_ResolveSource(), get_source_root(), MSI_InstallPackage(), and msi_load_media_info().

◆ msi_set_string_table_codepage()

UINT msi_set_string_table_codepage ( string_table *  st,
UINT  codepage 
)

Definition at line 676 of file string.c.

677{
679 {
680 st->codepage = codepage;
681 return ERROR_SUCCESS;
682 }
684}
static BOOL validate_codepage(UINT codepage)
Definition: string.c:61

Referenced by MSI_DatabaseImport().

◆ MSI_SetFeatureStates()

UINT MSI_SetFeatureStates ( MSIPACKAGE *  package)

Definition at line 1638 of file action.c.

1639{
1640 int level;
1643
1644 TRACE("Checking Install Level\n");
1645
1646 level = msi_get_property_int(package->db, L"INSTALLLEVEL", 1);
1647
1648 if (msi_get_property_int( package->db, L"Preselected", 0 ))
1649 {
1651 {
1652 if (!is_feature_selected( feature, level )) continue;
1653
1654 if (feature->ActionRequest == INSTALLSTATE_UNKNOWN)
1655 {
1656 if (feature->Installed == INSTALLSTATE_ABSENT)
1657 {
1658 feature->Action = INSTALLSTATE_UNKNOWN;
1659 feature->ActionRequest = INSTALLSTATE_UNKNOWN;
1660 }
1661 else
1662 {
1663 feature->Action = feature->Installed;
1664 feature->ActionRequest = feature->Installed;
1665 }
1666 }
1667 }
1668 }
1669 else if (!msi_get_property_int( package->db, L"Installed", 0 ))
1670 {
1672 {
1673 if (!is_feature_selected( feature, level )) continue;
1674
1675 if (feature->ActionRequest == INSTALLSTATE_UNKNOWN)
1676 {
1678 {
1679 feature->Action = INSTALLSTATE_SOURCE;
1680 feature->ActionRequest = INSTALLSTATE_SOURCE;
1681 }
1682 else if (feature->Attributes & msidbFeatureAttributesFavorAdvertise)
1683 {
1685 feature->ActionRequest = INSTALLSTATE_ADVERTISED;
1686 }
1687 else
1688 {
1689 feature->Action = INSTALLSTATE_LOCAL;
1690 feature->ActionRequest = INSTALLSTATE_LOCAL;
1691 }
1692 }
1693 }
1694 }
1695 else
1696 {
1698 {
1699 ComponentList *cl;
1700 MSIFEATURE *cur;
1701
1702 if (!is_feature_selected( feature, level )) continue;
1703 if (feature->ActionRequest != INSTALLSTATE_UNKNOWN) continue;
1704
1705 LIST_FOR_EACH_ENTRY( cl, &feature->Components, ComponentList, entry )
1706 {
1707 if (!cl->component->updated && !cl->component->added)
1708 continue;
1709
1710 cur = feature;
1711 while (cur)
1712 {
1713 if (cur->ActionRequest != INSTALLSTATE_UNKNOWN)
1714 break;
1715
1716 if (cur->Installed != INSTALLSTATE_ABSENT)
1717 {
1718 cur->Action = cur->Installed;
1719 cur->ActionRequest = cur->Installed;
1720 }
1721 else if (!cl->component->added)
1722 {
1723 break;
1724 }
1725 else if (cur->Attributes & msidbFeatureAttributesFavorSource)
1726 {
1727 cur->Action = INSTALLSTATE_SOURCE;
1728 cur->ActionRequest = INSTALLSTATE_SOURCE;
1729 }
1730 else if (cur->Attributes & msidbFeatureAttributesFavorAdvertise)
1731 {
1732 cur->Action = INSTALLSTATE_ADVERTISED;
1733 cur->ActionRequest = INSTALLSTATE_ADVERTISED;
1734 }
1735 else
1736 {
1737 cur->Action = INSTALLSTATE_LOCAL;
1738 cur->ActionRequest = INSTALLSTATE_LOCAL;
1739 }
1740
1741 if (!cur->Feature_Parent)
1742 break;
1743 cur = msi_get_loaded_feature(package, cur->Feature_Parent);
1744 }
1745 }
1746 }
1747 }
1748
1749 /* disable child features of unselected parent or follow parent */
1751 {
1752 if (feature->Feature_Parent) continue;
1755 }
1756
1757 /* now we want to set component state based based on feature state */
1759 {
1760 ComponentList *cl;
1761
1762 TRACE("examining feature %s (level %d installed %d request %d action %d)\n",
1763 debugstr_w(feature->Feature), feature->Level, feature->Installed,
1764 feature->ActionRequest, feature->Action);
1765
1766 /* features with components that have compressed files are made local */
1767 LIST_FOR_EACH_ENTRY( cl, &feature->Components, ComponentList, entry )
1768 {
1769 if (cl->component->ForceLocalState &&
1770 feature->ActionRequest == INSTALLSTATE_SOURCE)
1771 {
1772 feature->Action = INSTALLSTATE_LOCAL;
1773 feature->ActionRequest = INSTALLSTATE_LOCAL;
1774 break;
1775 }
1776 }
1777
1778 LIST_FOR_EACH_ENTRY( cl, &feature->Components, ComponentList, entry )
1779 {
1780 component = cl->component;
1781
1782 switch (feature->ActionRequest)
1783 {
1785 component->anyAbsent = 1;
1786 break;
1788 component->hasAdvertisedFeature = 1;
1789 break;
1791 component->hasSourceFeature = 1;
1792 break;
1793 case INSTALLSTATE_LOCAL:
1794 component->hasLocalFeature = 1;
1795 break;
1798 component->hasAdvertisedFeature = 1;
1799 else if (feature->Attributes & msidbFeatureAttributesFavorSource)
1800 component->hasSourceFeature = 1;
1801 else
1802 component->hasLocalFeature = 1;
1803 break;
1805 if (feature->Installed == INSTALLSTATE_ADVERTISED)
1806 component->hasAdvertisedFeature = 1;
1807 if (feature->Installed == INSTALLSTATE_SOURCE)
1808 component->hasSourceFeature = 1;
1809 if (feature->Installed == INSTALLSTATE_LOCAL)
1810 component->hasLocalFeature = 1;
1811 break;
1812 default:
1813 break;
1814 }
1815 }
1816 }
1817
1819 {
1820 /* check if it's local or source */
1821 if (!(component->Attributes & msidbComponentAttributesOptional) &&
1822 (component->hasLocalFeature || component->hasSourceFeature))
1823 {
1824 if ((component->Attributes & msidbComponentAttributesSourceOnly) &&
1825 !component->ForceLocalState)
1826 {
1828 component->ActionRequest = INSTALLSTATE_SOURCE;
1829 }
1830 else
1831 {
1832 component->Action = INSTALLSTATE_LOCAL;
1833 component->ActionRequest = INSTALLSTATE_LOCAL;
1834 }
1835 continue;
1836 }
1837
1838 /* if any feature is local, the component must be local too */
1839 if (component->hasLocalFeature)
1840 {
1841 component->Action = INSTALLSTATE_LOCAL;
1842 component->ActionRequest = INSTALLSTATE_LOCAL;
1843 continue;
1844 }
1845 if (component->hasSourceFeature)
1846 {
1848 component->ActionRequest = INSTALLSTATE_SOURCE;
1849 continue;
1850 }
1851 if (component->hasAdvertisedFeature)
1852 {
1854 component->ActionRequest = INSTALLSTATE_ADVERTISED;
1855 continue;
1856 }
1857 TRACE("nobody wants component %s\n", debugstr_w(component->Component));
1858 if (component->anyAbsent && component->ComponentId)
1859 {
1861 component->ActionRequest = INSTALLSTATE_ABSENT;
1862 }
1863 }
1864
1866 {
1867 if (component->ActionRequest == INSTALLSTATE_DEFAULT)
1868 {
1869 TRACE("%s was default, setting to local\n", debugstr_w(component->Component));
1870 component->Action = INSTALLSTATE_LOCAL;
1871 component->ActionRequest = INSTALLSTATE_LOCAL;
1872 }
1873
1874 if (component->ActionRequest == INSTALLSTATE_SOURCE &&
1875 component->Installed == INSTALLSTATE_SOURCE &&
1876 component->hasSourceFeature)
1877 {
1879 component->ActionRequest = INSTALLSTATE_UNKNOWN;
1880 }
1881
1882 if (component->Action == INSTALLSTATE_LOCAL || component->Action == INSTALLSTATE_SOURCE)
1883 component->num_clients++;
1884 else if (component->Action == INSTALLSTATE_ABSENT)
1885 {
1886 component->num_clients--;
1887
1888 if (component->num_clients > 0)
1889 {
1890 TRACE("multiple clients uses %s - disallowing uninstallation\n", debugstr_w(component->Component));
1892 }
1893 }
1894
1895 TRACE("component %s (installed %d request %d action %d)\n",
1896 debugstr_w(component->Component), component->Installed, component->ActionRequest, component->Action);
1897 }
1898
1899 return ERROR_SUCCESS;
1900}
static BOOL is_feature_selected(MSIFEATURE *feature, INT level)
Definition: action.c:1505
static void disable_children(MSIFEATURE *feature, int level)
Definition: action.c:1599
static void follow_parent(MSIFEATURE *feature)
Definition: action.c:1619
GLint level
Definition: gl.h:1546
@ INSTALLSTATE_DEFAULT
Definition: msi.h:48
@ msidbFeatureAttributesFavorAdvertise
Definition: msidefs.h:151
unsigned int updated
Definition: msipriv.h:562
BOOL ForceLocalState
Definition: msipriv.h:547
unsigned int added
Definition: msipriv.h:561

Referenced by ACTION_CostFinalize(), and MSI_SetInstallLevel().

◆ MSI_SetFeatureStateW()

UINT MSI_SetFeatureStateW ( MSIPACKAGE *  package,
LPCWSTR  szFeature,
INSTALLSTATE  iState 
)

Definition at line 915 of file install.c.

916{
917 UINT rc = ERROR_SUCCESS;
919
920 TRACE("%s %i\n", debugstr_w(szFeature), iState);
921
922 feature = msi_get_loaded_feature( package, szFeature );
923 if (!feature)
925
926 if (iState == INSTALLSTATE_ADVERTISED &&
928 {
929 TRACE("Advertising is disallowed; making feature absent\n");
930 iState = INSTALLSTATE_ABSENT;
931 }
932
933 feature->ActionRequest = iState;
934
936
937 /* update all the features that are children of this feature */
939 {
940 if (child->Feature_Parent && !wcscmp( szFeature, child->Feature_Parent ))
941 MSI_SetFeatureStateW(package, child->Feature, iState);
942 }
943
944 return rc;
945}
UINT MSI_SetFeatureStateW(MSIPACKAGE *package, LPCWSTR szFeature, INSTALLSTATE iState)
Definition: install.c:915
void ACTION_UpdateComponentStates(MSIPACKAGE *package, MSIFEATURE *feature)
Definition: install.c:833
@ msidbFeatureAttributesDisallowAdvertise
Definition: msidefs.h:152

Referenced by event_add_local(), event_add_source(), event_remove(), MSI_SetFeatureStateW(), MsiConfigureFeatureW(), and MsiSetFeatureStateW().

◆ MSI_SetInstallLevel()

UINT MSI_SetInstallLevel ( MSIPACKAGE *  package,
int  iInstallLevel 
)

Definition at line 1574 of file install.c.

1575{
1576 WCHAR level[6];
1577 int len;
1578 UINT r;
1579
1580 TRACE("%p %i\n", package, iInstallLevel);
1581
1582 if (iInstallLevel > 32767)
1584
1585 if (iInstallLevel < 1)
1586 return MSI_SetFeatureStates( package );
1587
1588 len = swprintf( level, ARRAY_SIZE(level), L"%d", iInstallLevel );
1589 r = msi_set_property( package->db, L"INSTALLLEVEL", level, len );
1590 if ( r == ERROR_SUCCESS )
1591 r = MSI_SetFeatureStates( package );
1592
1593 return r;
1594}
UINT MSI_SetFeatureStates(MSIPACKAGE *package)
Definition: action.c:1638

Referenced by event_set_install_level(), and MsiSetInstallLevel().

◆ MSI_SetTargetPathW()

UINT MSI_SetTargetPathW ( MSIPACKAGE *  package,
LPCWSTR  szFolder,
LPCWSTR  szFolderPath 
)

Definition at line 564 of file install.c.

565{
566 DWORD attrib;
568 MSIFILE *file;
569
570 TRACE("%p %s %s\n", package, debugstr_w(szFolder), debugstr_w(szFolderPath));
571
572 attrib = msi_get_file_attributes( package, szFolderPath );
573 /* native MSI tests writeability by making temporary files at each drive */
574 if (attrib != INVALID_FILE_ATTRIBUTES &&
575 (attrib & FILE_ATTRIBUTE_OFFLINE || attrib & FILE_ATTRIBUTE_READONLY))
576 {
578 }
579 if (!(folder = msi_get_loaded_folder( package, szFolder ))) return ERROR_DIRECTORY;
580
581 set_target_path( package, folder, szFolderPath );
582
584 {
585 const WCHAR *dir;
586 MSICOMPONENT *comp = file->Component;
587
588 if (!comp->Enabled || msi_is_global_assembly( comp )) continue;
589
590 dir = msi_get_target_folder( package, comp->Directory );
591 free( file->TargetPath );
592 file->TargetPath = msi_build_directory_name( 2, dir, file->FileName );
593 }
594 return ERROR_SUCCESS;
595}
static void set_target_path(MSIPACKAGE *package, MSIFOLDER *folder, const WCHAR *path)
Definition: install.c:542
const WCHAR * msi_get_target_folder(MSIPACKAGE *package, const WCHAR *name)
Definition: install.c:232
#define FILE_ATTRIBUTE_OFFLINE
Definition: nt_native.h:712
#define ERROR_DIRECTORY
Definition: winerror.h:416

Referenced by ACTION_CustomAction(), event_set_target_path(), and MsiSetTargetPathW().

◆ msi_split_string()

WCHAR ** msi_split_string ( const WCHAR *  str,
WCHAR  sep 
)

Definition at line 297 of file action.c.

298{
299 LPCWSTR pc;
300 LPWSTR p, *ret = NULL;
301 UINT count = 0;
302
303 if (!str)
304 return ret;
305
306 /* count the number of substrings */
307 for ( pc = str, count = 0; pc; count++ )
308 {
309 pc = wcschr( pc, sep );
310 if (pc)
311 pc++;
312 }
313
314 /* allocate space for an array of substring pointers and the substrings */
315 ret = malloc( (count + 1) * sizeof(WCHAR *) + (wcslen(str) + 1) * sizeof(WCHAR) );
316 if (!ret)
317 return ret;
318
319 /* copy the string and set the pointers */
320 p = (LPWSTR) &ret[count+1];
321 lstrcpyW( p, str );
322 for( count = 0; (ret[count] = p); count++ )
323 {
324 p = wcschr( p, sep );
325 if (p)
326 *p++ = 0;
327 }
328
329 return ret;
330}

Referenced by apply_patch_db(), get_patch_product_codes(), ITERATE_BindImage(), msi_apply_patches(), msi_apply_transforms(), and msi_check_patch_applicable().

◆ msi_strcpy_to_awstring()

UINT msi_strcpy_to_awstring ( const WCHAR *  str,
int  len,
awstring *  awbuf,
DWORD *  sz 
)

Definition at line 158 of file install.c.

159{
161
162 if (awbuf->str.w && !sz)
164 if (!sz)
165 return ERROR_SUCCESS;
166
167 if (len < 0) len = lstrlenW( str );
168
169 if (awbuf->unicode && awbuf->str.w)
170 {
171 memcpy( awbuf->str.w, str, min(len + 1, *sz) * sizeof(WCHAR) );
172 if (*sz && len >= *sz)
173 awbuf->str.w[*sz - 1] = 0;
174 }
175 else
176 {
177 int lenA = WideCharToMultiByte( CP_ACP, 0, str, len + 1, NULL, 0, NULL, NULL );
178 if (lenA) lenA--;
179 WideCharToMultiByte( CP_ACP, 0, str, len + 1, awbuf->str.a, *sz, NULL, NULL );
180 if (awbuf->str.a && *sz && lenA >= *sz)
181 awbuf->str.a[*sz - 1] = 0;
182 len = lenA;
183 }
184 if (awbuf->str.w && len >= *sz)
186 *sz = len;
187 return r;
188}
#define min(a, b)
Definition: monoChain.cc:55
LPWSTR w
Definition: msipriv.h:767
LPSTR a
Definition: msipriv.h:766
union awstring::@616 str
BOOL unicode
Definition: msipriv.h:764

Referenced by MSI_EnumComponentQualifiers(), MSI_GetComponentPath(), MSI_GetProductInfo(), and MSI_GetUserInfo().

◆ msi_strdupW()

WCHAR * msi_strdupW ( const WCHAR *  value,
int  len 
)

Definition at line 155 of file record.c.

156{
157 WCHAR *ret;
158
159 if (!value) return NULL;
160 if (!(ret = malloc( (len + 1) * sizeof(WCHAR) ))) return NULL;
161 memcpy( ret, value, len * sizeof(WCHAR) );
162 ret[len] = 0;
163 return ret;
164}

Referenced by ACTION_ExecuteAction(), msi_record_set_string(), MSI_RecordCopyField(), and parse_value().

◆ msi_string2id()

UINT msi_string2id ( const string_table *  st,
const WCHAR *  data,
int  len,
UINT *  id 
)

Definition at line 400 of file string.c.

401{
402 int i, c, low = 0, high = st->sortcount - 1;
403
404 if (len < 0) len = lstrlenW( str );
405
406 while (low <= high)
407 {
408 i = (low + high) / 2;
409 c = cmp_string( str, len, st->strings[st->sorted[i]].data, st->strings[st->sorted[i]].len );
410
411 if (c < 0)
412 high = i - 1;
413 else if (c > 0)
414 low = i + 1;
415 else
416 {
417 *id = st->sorted[i];
418 return ERROR_SUCCESS;
419 }
420 }
422}
static int cmp_string(const WCHAR *str1, int len1, const WCHAR *str2, int len2)
Definition: string.c:163
const GLubyte * c
Definition: glext.h:8905
#define c
Definition: ke_i.h:80
UINT sortcount
Definition: string.c:56

Referenced by find_stream(), get_table_value_from_record(), get_tablecolumns(), join_find_row(), msi_add_string(), record_to_row(), storages_find_row(), streams_find_row(), string2id(), TABLE_add_column(), TABLE_Exists(), TABLE_set_string(), and TransformView_Create().

◆ msi_string_lookup()

const WCHAR * msi_string_lookup ( const string_table *  st,
UINT  id,
int *  len 
)

Definition at line 343 of file string.c.

344{
345 if( id == 0 )
346 {
347 if (len) *len = 0;
348 return L"";
349 }
350 if( id >= st->maxcount )
351 return NULL;
352
353 if( id && !st->strings[id].persistent_refcount && !st->strings[id].nonpersistent_refcount)
354 return NULL;
355
356 if (len) *len = st->strings[id].len;
357
358 return st->strings[id].data;
359}
GLuint id
Definition: glext.h:5910

Referenced by dump_table(), get_stream_name(), get_tablecolumns(), get_transform_record(), id2string(), msi_commit_streams(), msi_create_table(), msi_view_refresh_row(), STORAGES_set_stream(), STREAMS_delete_row(), STRING_evaluate(), TABLE_add_column(), TransformView_Create(), and TransformView_drop_table().

◆ msi_strncpyW()

UINT msi_strncpyW ( const WCHAR *  str,
int  len,
WCHAR *  buf,
DWORD *  sz 
)

Definition at line 213 of file install.c.

214{
216
217 if (!sz)
219
220 if (len < 0) len = lstrlenW(str);
221 if (buf)
222 memcpy(buf, str, min(len + 1, *sz) * sizeof(WCHAR));
223 if (buf && len >= *sz)
224 {
225 if (*sz) buf[*sz - 1] = 0;
227 }
228 *sz = len;
229 return r;
230}

Referenced by MsiFormatRecordW(), MsiGetPropertyW(), MsiGetSourcePathW(), MsiGetTargetPathW(), MsiSummaryInfoGetPropertyW(), and MsiViewGetErrorW().

◆ msi_strncpyWtoA()

UINT msi_strncpyWtoA ( const WCHAR *  str,
int  len,
char *  buf,
DWORD *  sz,
BOOL  remote 
)

Definition at line 190 of file install.c.

191{
193 DWORD lenA;
194
195 if (!sz)
197
198 if (lenW < 0) lenW = lstrlenW(str);
199 lenA = WideCharToMultiByte(CP_ACP, 0, str, lenW + 1, NULL, 0, NULL, NULL);
200 WideCharToMultiByte(CP_ACP, 0, str, lenW + 1, buf, *sz, NULL, NULL);
201 lenA--;
202 if (buf && lenA >= *sz)
203 {
204 if (*sz) buf[*sz - 1] = 0;
206 }
207 if (remote && lenA >= *sz)
208 lenA *= 2;
209 *sz = lenA;
210 return r;
211}

Referenced by MsiFormatRecordA(), MsiGetPropertyA(), MsiGetSourcePathA(), MsiGetTargetPathA(), MsiSummaryInfoGetPropertyA(), and MsiViewGetErrorA().

◆ msi_suminfo_dup_string()

WCHAR * msi_suminfo_dup_string ( MSISUMMARYINFO *  si,
UINT  property 
)

Definition at line 700 of file suminfo.c.

701{
702 PROPVARIANT *prop;
703
704 if ( uiProperty >= MSI_MAX_PROPS )
705 return NULL;
706 prop = &si->property[uiProperty];
707 if( prop->vt != VT_LPSTR )
708 return NULL;
709 return strdupAtoW( prop->pszVal );
710}
static WCHAR * strdupAtoW(const char *str)
Definition: main.c:61
@ VT_LPSTR
Definition: compat.h:2324
#define MSI_MAX_PROPS
Definition: msipriv.h:496

Referenced by check_transform_applicable(), msi_check_patch_applicable(), msi_get_package_code(), msi_get_suminfo_product(), parse_patch_summary(), and parse_suminfo().

◆ msi_suminfo_get_int32()

INT msi_suminfo_get_int32 ( MSISUMMARYINFO *  si,
UINT  uiProperty 
)

Definition at line 712 of file suminfo.c.

713{
714 PROPVARIANT *prop;
715
716 if ( uiProperty >= MSI_MAX_PROPS )
717 return -1;
718 prop = &si->property[uiProperty];
719 if( prop->vt != VT_I4 )
720 return -1;
721 return prop->lVal;
722}

Referenced by check_transform_applicable(), and parse_suminfo().

◆ msi_suminfo_get_prop()

UINT msi_suminfo_get_prop ( MSISUMMARYINFO *  si,
UINT  uiProperty,
UINT *  puiDataType,
INT *  piValue,
FILETIME *  pftValue,
awstring *  str,
DWORD *  pcchValueBuf 
)

Definition at line 645 of file suminfo.c.

647{
648 PROPVARIANT *prop;
650
651 prop = &si->property[uiProperty];
652
653 if( puiDataType )
654 *puiDataType = prop->vt;
655
656 switch( prop->vt )
657 {
658 case VT_I2:
659 if( piValue )
660 *piValue = prop->iVal;
661 break;
662 case VT_I4:
663 if( piValue )
664 *piValue = prop->lVal;
665 break;
666 case VT_LPSTR:
667 if( pcchValueBuf )
668 {
669 DWORD len = 0;
670
671 if( str->unicode )
672 {
673 len = MultiByteToWideChar( CP_ACP, 0, prop->pszVal, -1, NULL, 0 ) - 1;
674 MultiByteToWideChar( CP_ACP, 0, prop->pszVal, -1, str->str.w, *pcchValueBuf );
675 }
676 else
677 {
678 len = lstrlenA( prop->pszVal );
679 if( str->str.a )
680 lstrcpynA(str->str.a, prop->pszVal, *pcchValueBuf );
681 }
682 if (len >= *pcchValueBuf)
684 *pcchValueBuf = len;
685 }
686 break;
687 case VT_FILETIME:
688 if( pftValue )
689 *pftValue = prop->filetime;
690 break;
691 case VT_EMPTY:
692 break;
693 default:
694 FIXME("Unknown property variant type\n");
695 break;
696 }
697 return ret;
698}
#define MultiByteToWideChar
Definition: compat.h:110
@ VT_FILETIME
Definition: compat.h:2329
@ VT_I2
Definition: compat.h:2297
@ VT_EMPTY
Definition: compat.h:2295

Referenced by admin_update_package_info(), msi_load_suminfo_properties(), MsiSummaryInfoGetPropertyA(), MsiSummaryInfoGetPropertyW(), and save_prop().

◆ msi_suminfo_persist()

UINT msi_suminfo_persist ( MSISUMMARYINFO *  si)

Definition at line 971 of file suminfo.c.

972{
974 IStream *stm = NULL;
975 DWORD grfMode;
976 HRESULT r;
977
979 r = IStorage_CreateStream( si->storage, L"\5SummaryInformation", grfMode, 0, 0, &stm );
980 if( SUCCEEDED(r) )
981 {
982 ret = save_summary_info( si, stm );
983 IStream_Release( stm );
984 }
985 return ret;
986}
static UINT save_summary_info(const MSISUMMARYINFO *si, IStream *stm)
Definition: suminfo.c:379

Referenced by admin_update_package_info(), msi_add_suminfo(), and MsiSummaryInfoPersist().

◆ msi_suminfo_set_prop()

UINT msi_suminfo_set_prop ( MSISUMMARYINFO *  si,
UINT  uiProperty,
UINT  uiDataType,
INT  iValue,
FILETIME *  pftValue,
awcstring *  str 
)

Definition at line 895 of file suminfo.c.

897{
898 UINT type = get_type( uiProperty );
899 if (type == VT_EMPTY || type != uiDataType)
901
902 if (uiDataType == VT_LPSTR && !str->str.a)
904
905 if (uiDataType == VT_FILETIME && !pftValue)
907
908 return set_prop( si, uiProperty, type, iValue, pftValue, str );
909}
#define ERROR_DATATYPE_MISMATCH
Definition: winerror.h:1335

Referenced by admin_update_package_info(), MsiSummaryInfoSetPropertyA(), and MsiSummaryInfoSetPropertyW().

◆ msi_table_apply_transform()

UINT msi_table_apply_transform ( MSIDATABASE *  db,
IStorage *  stg,
int  err_cond 
)

Definition at line 3385 of file table.c.

3386{
3387 struct list transforms;
3388 IEnumSTATSTG *stgenum = NULL;
3389 struct transform_data *transform;
3390 struct transform_data *tables = NULL, *columns = NULL;
3391 HRESULT hr;
3392 STATSTG stat;
3395 UINT bytes_per_strref;
3396 BOOL property_update = FALSE;
3397 MSIVIEW *transform_view = NULL;
3398
3399 TRACE("%p %p\n", db, stg );
3400
3401 strings = msi_load_string_table( stg, &bytes_per_strref );
3402 if( !strings )
3403 goto end;
3404
3405 hr = IStorage_EnumElements( stg, 0, NULL, 0, &stgenum );
3406 if (FAILED( hr ))
3407 goto end;
3408
3409 list_init(&transforms);
3410
3411 while ( TRUE )
3412 {
3413 struct table_view *tv = NULL;
3414 WCHAR name[0x40];
3415 ULONG count = 0;
3416
3417 hr = IEnumSTATSTG_Next( stgenum, 1, &stat, &count );
3418 if (FAILED( hr ) || !count)
3419 break;
3420
3421 decode_streamname( stat.pwcsName, name );
3422 CoTaskMemFree( stat.pwcsName );
3423 if ( name[0] != 0x4840 )
3424 continue;
3425
3426 if ( !wcscmp( name+1, L"_StringPool" ) ||
3427 !wcscmp( name+1, L"_StringData" ) )
3428 continue;
3429
3430 transform = calloc( 1, sizeof(*transform) );
3431 if ( !transform )
3432 break;
3433
3434 list_add_tail( &transforms, &transform->entry );
3435
3436 transform->name = wcsdup( name + 1 );
3437
3438 if ( !wcscmp( transform->name, L"_Tables" ) )
3439 tables = transform;
3440 else if (!wcscmp( transform->name, L"_Columns" ) )
3442 else if (!wcscmp( transform->name, L"Property" ))
3443 property_update = TRUE;
3444
3445 TRACE("transform contains stream %s\n", debugstr_w(name));
3446
3447 /* load the table */
3448 if (TABLE_CreateView( db, transform->name, (MSIVIEW**) &tv ) != ERROR_SUCCESS)
3449 continue;
3450
3451 if (tv->view.ops->execute( &tv->view, NULL ) != ERROR_SUCCESS)
3452 {
3453 tv->view.ops->delete( &tv->view );
3454 continue;
3455 }
3456
3457 tv->view.ops->delete( &tv->view );
3458 }
3459
3460 if (err_cond & MSITRANSFORM_ERROR_VIEWTRANSFORM)
3461 {
3462 static const WCHAR create_query[] = L"CREATE TABLE `_TransformView` ( "
3463 L"`Table` CHAR(0) NOT NULL TEMPORARY, `Column` CHAR(0) NOT NULL TEMPORARY, "
3464 L"`Row` CHAR(0) TEMPORARY, `Data` CHAR(0) TEMPORARY, `Current` CHAR(0) TEMPORARY "
3465 L"PRIMARY KEY `Table`, `Column`, `Row` ) HOLD";
3466
3467 MSIQUERY *query;
3468 UINT r;
3469
3471 if (r != ERROR_SUCCESS)
3472 goto end;
3473
3475 if (r == ERROR_SUCCESS)
3477 msiobj_release( &query->hdr );
3479 goto end;
3480
3481 if (TABLE_CreateView(db, L"_TransformView", &transform_view) != ERROR_SUCCESS)
3482 goto end;
3483
3485 transform_view->ops->add_ref( transform_view );
3486
3487 r = transform_view->ops->add_column( transform_view, L"new",
3488 MSITYPE_TEMPORARY | MSITYPE_NULLABLE | 0x402 /* INT */, FALSE );
3489 if (r != ERROR_SUCCESS)
3490 goto end;
3491 }
3492
3493 /*
3494 * Apply _Tables and _Columns transforms first so that
3495 * the table metadata is correct, and empty tables exist.
3496 */
3497 ret = table_load_transform( db, stg, strings, tables, bytes_per_strref, err_cond );
3499 goto end;
3500
3501 ret = table_load_transform( db, stg, strings, columns, bytes_per_strref, err_cond );
3503 goto end;
3504
3506
3507 while ( !list_empty( &transforms ) )
3508 {
3509 transform = LIST_ENTRY( list_head( &transforms ), struct transform_data, entry );
3510
3511 if ( wcscmp( transform->name, L"_Columns" ) &&
3512 wcscmp( transform->name, L"_Tables" ) &&
3513 ret == ERROR_SUCCESS )
3514 {
3515 ret = table_load_transform( db, stg, strings, transform, bytes_per_strref, err_cond );
3516 }
3517
3518 list_remove( &transform->entry );
3519 free( transform->name );
3520 free( transform );
3521 }
3522
3523 if ( ret == ERROR_SUCCESS )
3524 {
3525 append_storage_to_db( db, stg );
3526 if (property_update) msi_clone_properties( db );
3527 }
3528
3529end:
3530 if ( stgenum )
3531 IEnumSTATSTG_Release( stgenum );
3532 if ( strings )
3534 if (transform_view)
3535 {
3536 struct tagMSITABLE *table = ((struct table_view *)transform_view)->table;
3537
3538 if (ret != ERROR_SUCCESS)
3539 transform_view->ops->release( transform_view );
3540
3541 if (!wcscmp(table->colinfo[table->col_count - 1].colname, L"new"))
3542 TABLE_remove_column( transform_view, table->colinfo[table->col_count - 1].number );
3543 transform_view->ops->delete( transform_view );
3544 }
3545
3546 return ret;
3547}
void append_storage_to_db(MSIDATABASE *db, IStorage *stg)
Definition: database.c:76
static UINT table_load_transform(MSIDATABASE *db, IStorage *stg, string_table *st, struct transform_data *transform, UINT bytes_per_strref, int err_cond)
Definition: table.c:3192
static UINT TABLE_remove_column(struct tagMSIVIEW *view, UINT number)
Definition: table.c:1954
UINT TABLE_CreateView(MSIDATABASE *db, LPCWSTR name, MSIVIEW **view)
Definition: table.c:2208
struct nls_table * tables
Definition: nls_base.c:22
GLsizei const GLchar *const * strings
Definition: glext.h:7622
#define MSITYPE_TEMPORARY
Definition: msipriv.h:53
#define MSITYPE_NULLABLE
Definition: msipriv.h:51
VOID msi_destroy_stringtable(string_table *st)
Definition: string.c:107
@ MSITRANSFORM_ERROR_VIEWTRANSFORM
Definition: msiquery.h:156
static struct query * create_query(void)
Definition: pdh_main.c:123
MSIDATABASE * db
Definition: table.c:999
struct column_info * columns
Definition: table.c:1001
UINT(* add_column)(struct tagMSIVIEW *view, LPCWSTR column, INT type, BOOL hold)
Definition: msipriv.h:339
UINT(* add_ref)(struct tagMSIVIEW *view)
Definition: msipriv.h:329
UINT(* release)(struct tagMSIVIEW *view)
Definition: msipriv.h:334
UINT(* execute)(struct tagMSIVIEW *view, MSIRECORD *record)
Definition: msipriv.h:293
UINT(* delete)(struct tagMSIVIEW *)
Definition: msipriv.h:324
const MSIVIEWOPS * ops
Definition: msipriv.h:355
#define ERROR_INVALID_TABLE
Definition: winerror.h:1334
#define ERROR_BAD_QUERY_SYNTAX
Definition: winerror.h:1321

Referenced by apply_substorage_transform(), and MSI_DatabaseApplyTransformW().

◆ msi_ui_progress()

void msi_ui_progress ( MSIPACKAGE *  package,
int  a,
int  b,
int  c,
int  d 
)

◆ msi_uninstall_assembly()

UINT msi_uninstall_assembly ( MSIPACKAGE *  package,
MSICOMPONENT *  comp 
)

Definition at line 402 of file assembly.c.

403{
404 HRESULT hr;
408
409 if (!init_assembly_caches( package )) return ERROR_FUNCTION_FAILED;
410
411 if (comp->assembly->feature)
412 feature = msi_get_loaded_feature( package, comp->assembly->feature );
413
414 if (assembly->application)
415 {
416 if (feature) feature->Action = INSTALLSTATE_ABSENT;
417 return ERROR_SUCCESS;
418 }
419 TRACE("removing %s\n", debugstr_w(assembly->display_name));
420
421 if (assembly->attributes == msidbAssemblyAttributesWin32)
422 {
423 cache = package->cache_sxs;
424 hr = IAssemblyCache_UninstallAssembly( cache, 0, assembly->display_name, NULL, NULL );
425 if (FAILED( hr )) WARN( "failed to uninstall assembly %#lx\n", hr );
426 }
427 else
428 {
429 unsigned int i;
430 for (i = 0; i < CLR_VERSION_MAX; i++)
431 {
432 if (!assembly->clr_version[i]) continue;
433 cache = package->cache_net[i];
434 if (cache)
435 {
436 hr = IAssemblyCache_UninstallAssembly( cache, 0, assembly->display_name, NULL, NULL );
437 if (FAILED( hr )) WARN( "failed to uninstall assembly %#lx\n", hr );
438 }
439 }
440 }
441 if (feature) feature->Action = INSTALLSTATE_ABSENT;
442 return ERROR_SUCCESS;
443}

Referenced by ACTION_RemoveFiles().

◆ msi_validate_product_id()

UINT msi_validate_product_id ( MSIPACKAGE *  package)

Definition at line 7221 of file action.c.

7222{
7223 LPWSTR key, template, id;
7225
7226 id = msi_dup_property( package->db, L"ProductID" );
7227 if (id)
7228 {
7229 free( id );
7230 return ERROR_SUCCESS;
7231 }
7232 template = msi_dup_property( package->db, L"PIDTemplate" );
7233 key = msi_dup_property( package->db, L"PIDKEY" );
7234 if (key && template)
7235 {
7236 FIXME( "partial stub: template %s key %s\n", debugstr_w(template), debugstr_w(key) );
7237#ifdef __REACTOS__
7238 WARN("Product key validation HACK, see CORE-14710\n");
7239#else
7240 r = msi_set_property( package->db, L"ProductID", key, -1 );
7241#endif
7242 }
7243 free( template );
7244 free( key );
7245 return r;
7246}

Referenced by ACTION_ValidateProductID(), and event_validate_product_id().

◆ msi_version_str_to_dword()

DWORD msi_version_str_to_dword ( LPCWSTR  p)

Definition at line 188 of file registry.c.

189{
190 DWORD major, minor = 0, build = 0, version = 0;
191
192 if (!p)
193 return version;
194
195 major = wcstol(p, NULL, 10);
196
197 p = wcschr(p, '.');
198 if (p)
199 {
200 minor = wcstol(p+1, NULL, 10);
201 p = wcschr(p+1, '.');
202 if (p)
203 build = wcstol(p+1, NULL, 10);
204 }
205
206 return MAKELONG(build, MAKEWORD(minor, major));
207}
WORD WORD * build
Definition: metahost.c:91
#define MAKEWORD(a, b)
Definition: typedefs.h:248
#define MAKELONG(a, b)
Definition: typedefs.h:249

Referenced by ITERATE_FindRelatedProducts(), publish_install_properties(), and publish_product_properties().

◆ msi_view_get_row()

UINT msi_view_get_row ( MSIDATABASE *  db,
MSIVIEW *  view,
UINT  row,
MSIRECORD **  rec 
)

Definition at line 351 of file msiquery.c.

352{
353 UINT row_count = 0, col_count = 0, r;
355
356 if ((r = view->ops->get_dimensions(view, &row_count, &col_count)))
357 return r;
358
359 if (row >= row_count)
360 return ERROR_NO_MORE_ITEMS;
361
362 if (!(object = MSI_CreateRecord( col_count )))
363 return ERROR_OUTOFMEMORY;
364
365 if ((r = msi_view_refresh_row(db, view, row, object)))
366 msiobj_release( &object->hdr );
367 else
368 *rec = object;
369
370 return r;
371}
UINT msi_view_refresh_row(MSIDATABASE *db, MSIVIEW *view, UINT row, MSIRECORD *rec)
Definition: msiquery.c:287

Referenced by join_modify_update(), MSI_ViewFetch(), TABLE_get_row(), TransformView_delete_row(), and TransformView_set_row().

◆ MSI_ViewClose()

UINT MSI_ViewClose ( MSIQUERY *  query)

◆ MSI_ViewExecute()

◆ MSI_ViewFetch()

UINT MSI_ViewFetch ( MSIQUERY *  query,
MSIRECORD **  prec 
)

Definition at line 373 of file msiquery.c.

374{
375 MSIVIEW *view;
376 UINT r;
377
378 TRACE("%p %p\n", query, prec );
379
380 view = query->view;
381 if( !view )
383
384 r = msi_view_get_row(query->db, view, query->row, prec);
385 if (r == ERROR_SUCCESS)
386 {
387 query->row ++;
388 (*prec)->cookie = (UINT64)(ULONG_PTR)query;
389 MSI_RecordSetInteger(*prec, 0, 1);
390 }
391 else if (r == ERROR_NO_MORE_ITEMS)
392 {
393 /* end of view; reset cursor to first row */
394 query->row = 0;
395 }
396
397 return r;
398}
COMPILER_DEPENDENT_UINT64 UINT64
Definition: actypes.h:131
UINT msi_view_get_row(MSIDATABASE *db, MSIVIEW *view, UINT row, MSIRECORD **rec)
Definition: msiquery.c:351
uint32_t ULONG_PTR
Definition: typedefs.h:65

Referenced by add_records_to_table(), get_assembly_record(), get_property(), get_property_row(), is_uninstallable(), load_file_hash(), load_folder_persistence(), merge_diff_row(), msi_clone_properties(), MSI_IterateRecords(), MSI_QueryGetRecord(), MsiGetProductPropertyW(), MsiViewFetch(), patch_add_media(), patch_offset_get_filepatches(), patch_offset_get_files(), patch_offset_modify_db(), patch_set_media_source_prop(), patch_set_offsets(), and TransformView_Create().

◆ MSI_ViewGetColumnInfo()

UINT MSI_ViewGetColumnInfo ( MSIQUERY *  query,
MSICOLINFO  info,
MSIRECORD **  prec 
)

Definition at line 598 of file msiquery.c.

599{
601 MSIRECORD *rec;
604 BOOL temporary;
605
606 if( !view )
608
609 if( !view->ops->get_dimensions )
611
612 r = view->ops->get_dimensions( view, NULL, &count );
613 if( r != ERROR_SUCCESS )
614 return r;
615 if( !count )
617
618 rec = MSI_CreateRecord( count );
619 if( !rec )
621
622 for( i=0; i<count; i++ )
623 {
624 name = NULL;
625 r = view->ops->get_column_info( view, i+1, &name, &type, &temporary, NULL );
626 if( r != ERROR_SUCCESS )
627 continue;
628 if (info == MSICOLINFO_NAMES)
629 MSI_RecordSetStringW( rec, i+1, name );
630 else
631 set_record_type_string( rec, i+1, type, temporary );
632 }
633 *prec = rec;
634 return ERROR_SUCCESS;
635}
static UINT set_record_type_string(MSIRECORD *rec, UINT field, UINT type, BOOL temporary)
Definition: msiquery.c:563
@ MSICOLINFO_NAMES
Definition: msiquery.h:36

Referenced by get_key_value(), get_query_columns(), get_query_types(), merge_verify_colnames(), MSI_DatabaseExport(), and MsiViewGetColumnInfo().

◆ MSI_ViewModify()

UINT MSI_ViewModify ( MSIQUERY *  query,
MSIMODIFY  mode,
MSIRECORD *  rec 
)

Definition at line 693 of file msiquery.c.

694{
695 MSIVIEW *view = NULL;
696 UINT r;
697
698 if ( !query || !rec )
700
701 view = query->view;
702 if ( !view || !view->ops->modify)
704
705 if ( mode == MSIMODIFY_UPDATE && rec->cookie != (UINT64)(ULONG_PTR)query )
707
708 r = view->ops->modify( view, mode, rec, query->row - 1 );
710 query->row--;
711
712 return r;
713}
@ MSIMODIFY_DELETE
Definition: msiquery.h:57
@ MSIMODIFY_UPDATE
Definition: msiquery.h:53

Referenced by add_records_to_table(), MsiViewModify(), patch_set_offsets(), and patch_update_file_sequence().

◆ MsiCreateAndVerifyInstallerDirectory()

UINT WINAPI MsiCreateAndVerifyInstallerDirectory ( DWORD  dwReserved)

Definition at line 3810 of file msi.c.

3811{
3813
3814 TRACE( "%#lx\n", dwReserved );
3815
3816 if (dwReserved)
3817 {
3818 FIXME( "dwReserved = %#lx\n", dwReserved );
3820 }
3821
3823 return ERROR_FUNCTION_FAILED;
3824
3825 lstrcatW(path, L"\\Installer");
3826
3828 return ERROR_FUNCTION_FAILED;
3829
3830 return ERROR_SUCCESS;
3831}
_In_ HANDLE _In_ DWORD _In_ DWORD _Inout_opt_ LPOVERLAPPED _In_opt_ LPTRANSMIT_FILE_BUFFERS _In_ DWORD dwReserved
Definition: mswsock.h:95

◆ MsiDecomposeDescriptorA()

UINT WINAPI MsiDecomposeDescriptorA ( LPCSTR  szDescriptor,
LPSTR  szProduct,
LPSTR  szFeature,
LPSTR  szComponent,
LPDWORD  pUsed 
)

Definition at line 984 of file registry.c.

986{
987 WCHAR product[MAX_FEATURE_CHARS+1];
990 LPWSTR str = NULL, p = NULL, f = NULL, c = NULL;
991 UINT r;
992
993 TRACE("%s %p %p %p %p\n", debugstr_a(szDescriptor), szProduct,
994 szFeature, szComponent, pUsed);
995
996 str = strdupAtoW( szDescriptor );
997 if( szDescriptor && !str )
998 return ERROR_OUTOFMEMORY;
999
1000 if (szProduct)
1001 p = product;
1002 if (szFeature)
1003 f = feature;
1004 if (szComponent)
1005 c = component;
1006
1007 r = MsiDecomposeDescriptorW( str, p, f, c, pUsed );
1008
1009 if (r == ERROR_SUCCESS)
1010 {
1011 WideCharToMultiByte( CP_ACP, 0, p, -1,
1012 szProduct, MAX_FEATURE_CHARS+1, NULL, NULL );
1013 WideCharToMultiByte( CP_ACP, 0, f, -1,
1014 szFeature, MAX_FEATURE_CHARS+1, NULL, NULL );
1015 WideCharToMultiByte( CP_ACP, 0, c, -1,
1016 szComponent, MAX_FEATURE_CHARS+1, NULL, NULL );
1017 }
1018
1019 free( str );
1020
1021 return r;
1022}
UINT WINAPI MsiDecomposeDescriptorW(LPCWSTR szDescriptor, LPWSTR szProduct, LPWSTR szFeature, LPWSTR szComponent, LPDWORD pUsed)
Definition: registry.c:927
#define MAX_FEATURE_CHARS
Definition: msi.h:257

◆ MsiDecomposeDescriptorW()

UINT WINAPI MsiDecomposeDescriptorW ( LPCWSTR  szDescriptor,
LPWSTR  szProduct,
LPWSTR  szFeature,
LPWSTR  szComponent,
LPDWORD  pUsed 
)

Definition at line 927 of file registry.c.

929{
930 UINT len;
931 const WCHAR *p;
932 GUID product, component;
933
934 TRACE("%s %p %p %p %p\n", debugstr_w(szDescriptor), szProduct,
935 szFeature, szComponent, pUsed);
936
937 if (!decode_base85_guid( szDescriptor, &product ))
939
940 TRACE("product %s\n", debugstr_guid( &product ));
941
942 if (!(p = wcschr( &szDescriptor[20], '>' )))
943 p = wcschr( &szDescriptor[20], '<' );
944 if (!p)
946
947 len = (p - &szDescriptor[20]);
948 if( len > MAX_FEATURE_CHARS )
950
951 TRACE("feature %s\n", debugstr_wn( &szDescriptor[20], len ));
952
953 if (*p == '>')
954 {
955 if (!decode_base85_guid( p+1, &component ))
957 TRACE( "component %s\n", debugstr_guid(&component) );
958 }
959
960 if (szProduct)
961 StringFromGUID2( &product, szProduct, MAX_FEATURE_CHARS+1 );
962 if (szComponent)
963 {
964 if (*p == '>')
965 StringFromGUID2( &component, szComponent, MAX_FEATURE_CHARS+1 );
966 else
967 szComponent[0] = 0;
968 }
969 if (szFeature)
970 {
971 memcpy( szFeature, &szDescriptor[20], len*sizeof(WCHAR) );
972 szFeature[len] = 0;
973 }
974
975 len = p - szDescriptor + 1;
976 if (*p == '>') len += 20;
977
978 TRACE("length = %d\n", len);
979 if (pUsed) *pUsed = len;
980
981 return ERROR_SUCCESS;
982}
INT WINAPI StringFromGUID2(REFGUID guid, LPOLESTR str, INT cmax)
Definition: combase.c:1525
BOOL decode_base85_guid(LPCWSTR str, GUID *guid)
Definition: registry.c:132

Referenced by MSI_EnumComponentQualifiers(), MSI_ProvideQualifiedComponentEx(), MsiDecomposeDescriptorA(), and MsiGetShortcutTargetW().

◆ msihandle2msiinfo()

void * msihandle2msiinfo ( MSIHANDLE  handle,
UINT  type 
)

Definition at line 158 of file handle.c.

159{
161
163 handle--;
165 goto out;
166 if (handle_table[handle].remote)
167 goto out;
168 if (!handle_table[handle].u.obj)
169 goto out;
170 if (handle_table[handle].u.obj->magic != MSIHANDLE_MAGIC)
171 goto out;
172 if (type && (handle_table[handle].u.obj->type != type))
173 goto out;
174 ret = handle_table[handle].u.obj;
176
177out:
179
180 return ret;
181}
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble * u
Definition: glfuncs.h:240

Referenced by copy_remote_record(), marshal_record(), MSI_OpenPackageW(), MsiDatabaseApplyTransformW(), MsiDatabaseCommit(), MsiDatabaseExportW(), MsiDatabaseGetPrimaryKeysW(), MsiDatabaseImportW(), MsiDatabaseIsTablePersistentW(), MsiDatabaseMergeW(), MsiDatabaseOpenViewW(), MsiEnableUIPreview(), MsiEnumComponentCostsW(), MsiFormatRecordA(), MsiFormatRecordW(), MsiGetDatabaseState(), MsiGetFeatureInfoW(), MsiGetSummaryInformationW(), MsiPreviewDialogW(), MsiProcessMessage(), MsiRecordClearData(), MsiRecordDataSize(), MsiRecordGetFieldCount(), MsiRecordGetInteger(), MsiRecordGetStringA(), MsiRecordGetStringW(), MsiRecordIsNull(), MsiRecordReadStream(), MsiRecordSetInteger(), MsiRecordSetStreamW(), MsiRecordSetStringA(), MsiRecordSetStringW(), MsiSetFeatureAttributesW(), MsiSummaryInfoGetPropertyA(), MsiSummaryInfoGetPropertyCount(), MsiSummaryInfoGetPropertyW(), MsiSummaryInfoPersist(), MsiSummaryInfoSetPropertyA(), MsiSummaryInfoSetPropertyW(), MsiViewClose(), MsiViewExecute(), MsiViewFetch(), MsiViewGetColumnInfo(), MsiViewGetErrorA(), MsiViewGetErrorW(), and MsiViewModify().

◆ MsiLoadStringA()

LANGID WINAPI MsiLoadStringA ( MSIHANDLE  handle,
UINT  id,
LPSTR  lpBuffer,
int  nBufferMax,
LANGID  lang 
)

Definition at line 2397 of file msi.c.

2399{
2400 LPWSTR bufW;
2401 LANGID r;
2402 INT len;
2403
2404 bufW = malloc(nBufferMax * sizeof(WCHAR));
2405 r = MsiLoadStringW(handle, id, bufW, nBufferMax, lang);
2406 if( r )
2407 {
2408 len = WideCharToMultiByte(CP_ACP, 0, bufW, -1, NULL, 0, NULL, NULL );
2409 if( len <= nBufferMax )
2410 WideCharToMultiByte( CP_ACP, 0, bufW, -1,
2412 else
2413 r = 0;
2414 }
2415 free(bufW);
2416 return r;
2417}
LANGID WINAPI MsiLoadStringW(MSIHANDLE handle, UINT id, WCHAR *lpBuffer, int nBufferMax, LANGID lang)
Definition: msi.c:2359
USHORT LANGID
Definition: mui.h:9
_Out_ LPWSTR lpBuffer
Definition: netsh.h:68
_Out_ LPWSTR _In_ DWORD nBufferMax
Definition: netsh.h:69
static const WCHAR lang[]
Definition: wbemdisp.c:287

◆ MsiLoadStringW()

LANGID WINAPI MsiLoadStringW ( MSIHANDLE  ,
UINT  ,
LPWSTR  ,
int  ,
LANGID   
)

◆ msiobj_addref()

void msiobj_addref ( MSIOBJECTHDR *  info)

Definition at line 217 of file handle.c.

218{
219 if( !info )
220 return;
221
222 if( info->magic != MSIHANDLE_MAGIC )
223 {
224 ERR("Invalid handle!\n");
225 return;
226 }
227
228 InterlockedIncrement(&info->refcount);
229}
#define InterlockedIncrement
Definition: armddk.h:53

Referenced by alloc_msihandle(), CREATE_CreateView(), DISTINCT_CreateView(), do_msidbCustomActionTypeDll(), do_msidbCustomActionTypeScript(), INSERT_CreateView(), MSI_CreatePackage(), MSI_DatabaseOpenViewW(), MSI_EnableUIPreview(), MSI_OpenDatabaseW(), msihandle2msiinfo(), UPDATE_CreateView(), and WHERE_CreateView().

◆ msiobj_lock()

◆ msiobj_release()

int msiobj_release ( MSIOBJECTHDR *  info)

Definition at line 241 of file handle.c.

242{
243 int ret;
244
245 if( !info )
246 return -1;
247
248 if( info->magic != MSIHANDLE_MAGIC )
249 {
250 ERR("Invalid handle!\n");
251 return -1;
252 }
253
254 ret = InterlockedDecrement( &info->refcount );
255 if( ret==0 )
256 {
257 if( info->destructor )
258 info->destructor( info );
259 TRACE("object %p destroyed\n", info);
260 free( info );
261 }
262
263 return ret;
264}
#define InterlockedDecrement
Definition: armddk.h:52

Referenced by ACTION_AllocateRegistrySpace(), ACTION_AppSearch(), ACTION_BindImage(), ACTION_CCPSearch(), ACTION_CostFinalize(), ACTION_CreateFolders(), ACTION_CreateShortcuts(), ACTION_CustomAction(), ACTION_DeleteServices(), ACTION_DuplicateFiles(), ACTION_ExecuteAction(), ACTION_FindRelatedProducts(), ACTION_InstallAdminPackage(), ACTION_InstallODBC(), ACTION_InstallServices(), ACTION_InstallValidate(), ACTION_LaunchConditions(), ACTION_MigrateFeatureStates(), ACTION_MoveFiles(), ACTION_MsiPublishAssemblies(), ACTION_MsiUnpublishAssemblies(), ACTION_PerformEndAction(), ACTION_ProcessComponents(), ACTION_ProcessExecSequence(), ACTION_ProcessUISequence(), ACTION_PublishComponents(), ACTION_PublishFeatures(), ACTION_PublishProduct(), ACTION_RegisterClassInfo(), ACTION_RegisterExtensionInfo(), ACTION_RegisterFonts(), ACTION_RegisterMIMEInfo(), ACTION_RegisterProduct(), ACTION_RegisterProgIdInfo(), ACTION_RegisterTypeLibraries(), ACTION_RegisterUser(), ACTION_RemoveDuplicateFiles(), ACTION_RemoveEnvironmentStrings(), ACTION_RemoveExistingProducts(), ACTION_RemoveFiles(), ACTION_RemoveFolders(), ACTION_RemoveIniValues(), ACTION_RemoveODBC(), ACTION_RemoveRegistryValues(), ACTION_RemoveShortcuts(), ACTION_ResolveSource(), ACTION_SelfRegModules(), ACTION_SelfUnregModules(), ACTION_SetODBCFolders(), ACTION_ShowDialog(), ACTION_StartServices(), ACTION_StopServices(), ACTION_UnpublishComponents(), ACTION_UnregisterClassInfo(), ACTION_UnregisterExtensionInfo(), ACTION_UnregisterFonts(), ACTION_UnregisterMIMEInfo(), ACTION_UnregisterProgIdInfo(), ACTION_UnregisterTypeLibraries(), ACTION_WriteEnvironmentStrings(), ACTION_WriteIniValues(), ACTION_WriteRegistryValues(), add_records_to_table(), add_stream(), add_table_to_db(), admin_update_package_info(), apply_patch_package(), arrange_record(), change_media(), check_transform_applicable(), combobox_add_items(), construct_record(), copy_remote_record(), CREATE_delete(), create_diff_row_query(), create_temp_binary(), create_temp_property_table(), deformat_string(), dialog_build_font_list(), dialog_button_handler(), dialog_create(), dialog_evaluate_control_conditions(), dialog_fill_controls(), dialog_get_uitext(), dialog_map_events(), dialog_oncreate(), dialog_radiogroup_control(), dialog_seltree_handler(), DISTINCT_delete(), event_set_target_path(), file_update_ui(), free_custom_action_data(), gather_merge_data(), get_assembly_display_name(), get_assembly_record(), get_checkbox_value(), get_key_value(), get_merge_table(), get_property(), get_property_row(), get_query_columns(), get_query_types(), get_signature(), get_table_labels(), get_transform_record(), HANDLE_CustomType19(), HANDLE_CustomType5_6(), INSERT_delete(), INSERT_execute(), internal_ui_handler(), is_uninstallable(), ITERATE_AppSearch(), ITERATE_CreateFolders(), ITERATE_DeleteService(), ITERATE_DuplicateFiles(), ITERATE_FindRelatedProducts(), ITERATE_InstallODBCDataSource(), ITERATE_InstallODBCDriver(), ITERATE_InstallODBCTranslator(), ITERATE_InstallService(), ITERATE_MoveFiles(), iterate_properties(), ITERATE_PublishComponent(), ITERATE_RegisterFonts(), ITERATE_RemoveDuplicateFiles(), ITERATE_RemoveEnvironmentString(), ITERATE_RemoveFiles(), ITERATE_RemoveFolders(), ITERATE_RemoveIniValuesOnInstall(), ITERATE_RemoveIniValuesOnUninstall(), ITERATE_RemoveODBCDataSource(), ITERATE_RemoveODBCDriver(), ITERATE_RemoveODBCTranslator(), ITERATE_RemoveRegistryValuesOnInstall(), ITERATE_RemoveRegistryValuesOnUninstall(), ITERATE_SelfRegModules(), ITERATE_SelfUnregModules(), ITERATE_StartService(), ITERATE_StopService(), ITERATE_UnpublishComponent(), ITERATE_UnregisterFonts(), ITERATE_WriteEnvironmentString(), ITERATE_WriteIniValues(), ITERATE_WriteRegistryValues(), join_modify_update(), listbox_add_items(), listview_add_items(), load_all_classes(), load_all_drlocators(), load_all_extensions(), load_all_files(), load_all_folders(), load_all_media(), load_all_mimes(), load_all_patches(), load_all_progids(), load_all_verbs(), load_feature(), load_file_disk_id(), load_file_hash(), load_folder_persistence(), load_given_appid(), load_given_class(), load_given_extension(), load_given_mime(), load_given_progid(), load_image(), load_patch_disk_id(), load_picture(), mark_patched_components(), marshal_record(), media_get_disk_info(), merge_diff_row(), merge_diff_tables(), merge_free_rows(), merge_verify_colnames(), merge_verify_primary_keys(), msi_add_suminfo(), MSI_ApplicablePatchW(), msi_apply_registered_patch(), msi_clone_properties(), MSI_CloneRecord(), MSI_ClosePreview(), MSI_CloseView(), msi_create_table(), MSI_CreatePackage(), MSI_DatabaseExport(), MSI_DatabaseGetPrimaryKeys(), MSI_DatabaseOpenViewW(), MSI_EnableUIPreview(), msi_export_suminfo(), MSI_FormatRecordW(), MSI_FreePackage(), msi_get_db_suminfo(), msi_get_error_message(), msi_get_package_code(), msi_get_property(), msi_get_suminfo(), msi_get_suminfo_product(), MSI_IterateRecords(), msi_load_all_components(), msi_load_all_features(), msi_load_assembly(), msi_load_media_info(), msi_load_suminfo_properties(), MSI_OpenDatabaseW(), MSI_OpenPackageW(), msi_query_merge_record(), MSI_QueryGetRecord(), MSI_Sequence(), msi_set_property(), msi_table_apply_transform(), msi_ui_progress(), msi_view_get_row(), MsiCloseHandle(), MsiCollectUserInfoA(), MsiCollectUserInfoW(), MsiConfigureFeatureW(), MsiConfigureProductExW(), MsiCreateRecord(), MsiDatabaseApplyTransformW(), MsiDatabaseCommit(), MsiDatabaseExportW(), MsiDatabaseGetPrimaryKeysW(), MsiDatabaseImportW(), MsiDatabaseIsTablePersistentW(), MsiDatabaseMergeW(), MsiDatabaseOpenViewW(), MsiDetermineApplicablePatchesW(), MsiDeterminePatchSequenceW(), MsiDoActionW(), MsiEnableUIPreview(), MsiEnumComponentCostsW(), MsiFormatRecordA(), MsiFormatRecordW(), MsiGetActiveDatabase(), MsiGetComponentStateW(), MsiGetDatabaseState(), MsiGetFeatureCostW(), MsiGetFeatureInfoW(), MsiGetFeatureStateW(), MsiGetLanguage(), MsiGetMode(), MsiGetProductPropertyW(), MsiGetPropertyA(), MsiGetPropertyW(), MsiGetSourcePathA(), MsiGetSourcePathW(), MsiGetSummaryInformationW(), MsiGetTargetPathA(), MsiGetTargetPathW(), MsiInstallProductW(), MsiOpenDatabaseW(), MsiOpenPackageExW(), MsiOpenProductW(), MsiPreviewDialogW(), MsiProcessMessage(), MsiRecordClearData(), MsiRecordDataSize(), MsiRecordGetFieldCount(), MsiRecordGetInteger(), MsiRecordGetStringA(), MsiRecordGetStringW(), MsiRecordIsNull(), MsiRecordReadStream(), MsiRecordSetInteger(), MsiRecordSetStreamW(), MsiRecordSetStringA(), MsiRecordSetStringW(), MsiReinstallFeatureW(), MsiSequenceW(), MsiSetComponentStateW(), MsiSetFeatureAttributesW(), MsiSetFeatureStateW(), MsiSetInstallLevel(), MsiSetMode(), MsiSetPropertyW(), MsiSetTargetPathW(), MsiSummaryInfoGetPropertyA(), MsiSummaryInfoGetPropertyCount(), MsiSummaryInfoGetPropertyW(), MsiSummaryInfoPersist(), MsiSummaryInfoSetPropertyA(), MsiSummaryInfoSetPropertyW(), MsiViewClose(), MsiViewExecute(), MsiViewFetch(), MsiViewGetColumnInfo(), MsiViewGetErrorA(), MsiViewGetErrorW(), MsiViewModify(), patch_add_media(), patch_offset_get_filepatches(), patch_offset_get_files(), patch_offset_modify_db(), patch_set_media_source_prop(), patch_set_offsets(), patch_update_filepatch_sequence(), publish_icons(), refresh_record(), resolve_keypath(), search_components(), search_ini(), search_reg(), SELECT_insert_row(), SELECT_modify(), SELECT_set_row(), TABLE_add_column(), TABLE_drop(), table_load_transform(), TABLE_remove_column(), TransformView_add_column(), TransformView_Create(), TransformView_create_table(), TransformView_delete_row(), TransformView_drop_table(), TransformView_insert_row(), TransformView_set_row(), translate_record(), ui_actioninfo(), ui_actionstart(), ui_sequence_exists(), unimplemented_action_stub(), unpublish_feature(), unpublish_icons(), UPDATE_delete(), UPDATE_execute(), update_merge_errors(), WHERE_delete(), and WHERE_set_row().

◆ msiobj_unlock()

◆ MSIREG_DeleteClassesUpgradeCodesKey()

UINT MSIREG_DeleteClassesUpgradeCodesKey ( LPCWSTR  szUpgradeCode)

Definition at line 890 of file registry.c.

891{
893 WCHAR squashed_uc[SQUASHED_GUID_SIZE];
894 HKEY hkey;
895 LONG r;
896
897 if (!squash_guid( szUpgradeCode, squashed_uc )) return ERROR_FUNCTION_FAILED;
898 TRACE("%s squashed %s\n", debugstr_w(szUpgradeCode), debugstr_w(squashed_uc));
899
900 if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, L"Software\\Classes\\Installer\\UpgradeCodes", 0, access, &hkey))
901 return ERROR_SUCCESS;
902 r = RegDeleteTreeW( hkey, squashed_uc );
903 RegCloseKey(hkey);
904 return r;
905}
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3333
BOOL squash_guid(LPCWSTR in, LPWSTR out)
Definition: registry.c:74

Referenced by remove_product_upgrade_code().

◆ MSIREG_DeleteLocalClassesFeaturesKey()

UINT MSIREG_DeleteLocalClassesFeaturesKey ( LPCWSTR  szProductCode)

Definition at line 858 of file registry.c.

859{
861 WCHAR squashed_pc[SQUASHED_GUID_SIZE];
862 HKEY hkey;
863 LONG r;
864
865 if (!squash_guid( szProductCode, squashed_pc )) return ERROR_FUNCTION_FAILED;
866 TRACE("%s squashed %s\n", debugstr_w(szProductCode), debugstr_w(squashed_pc));
867
868 if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, L"Software\\Classes\\Installer\\Features", 0, access, &hkey))
869 return ERROR_SUCCESS;
870 r = RegDeleteTreeW( hkey, squashed_pc );
871 RegCloseKey(hkey);
872 return r;
873}

Referenced by ACTION_UnpublishProduct().

◆ MSIREG_DeleteLocalClassesProductKey()

UINT MSIREG_DeleteLocalClassesProductKey ( LPCWSTR  szProductCode)

Definition at line 841 of file registry.c.

842{
844 WCHAR squashed_pc[SQUASHED_GUID_SIZE];
845 HKEY hkey;
846 LONG r;
847
848 if (!squash_guid( szProductCode, squashed_pc )) return ERROR_FUNCTION_FAILED;
849 TRACE("%s squashed %s\n", debugstr_w(szProductCode), debugstr_w(squashed_pc));
850
851 if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, L"Software\\Classes\\Installer\\Products", 0, access, &hkey))
852 return ERROR_SUCCESS;
853 r = RegDeleteTreeW( hkey, squashed_pc );
854 RegCloseKey(hkey);
855 return r;
856}

Referenced by ACTION_UnpublishProduct().

◆ MSIREG_DeleteProductKey()

UINT MSIREG_DeleteProductKey ( LPCWSTR  szProduct)

Definition at line 751 of file registry.c.

752{
754 WCHAR squashed_pc[SQUASHED_GUID_SIZE];
755 HKEY hkey;
756 LONG r;
757
758 if (!squash_guid( szProduct, squashed_pc )) return ERROR_FUNCTION_FAILED;
759 TRACE("%s squashed %s\n", debugstr_w(szProduct), debugstr_w(squashed_pc));
760
761 if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, L"Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\Products",
762 0, access, &hkey)) return ERROR_SUCCESS;
763 r = RegDeleteTreeW( hkey, squashed_pc );
764 RegCloseKey(hkey);
765 return r;
766}

Referenced by ACTION_UnpublishProduct().

◆ MSIREG_DeleteUninstallKey()

UINT MSIREG_DeleteUninstallKey ( const WCHAR *  ,
enum  platform 
)

Referenced by ACTION_UnpublishProduct().

◆ MSIREG_DeleteUpgradeCodesKey()

UINT MSIREG_DeleteUpgradeCodesKey ( const WCHAR *  code)

Definition at line 812 of file registry.c.

813{
814 WCHAR squashed_code[SQUASHED_GUID_SIZE];
816 HKEY hkey;
817 LONG ret;
818
819 if (!squash_guid( code, squashed_code )) return ERROR_FUNCTION_FAILED;
820 TRACE( "%s squashed %s\n", debugstr_w(code), debugstr_w(squashed_code) );
821
822 if (RegOpenKeyExW( HKEY_LOCAL_MACHINE, L"Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\UpgradeCodes\\",
823 0, access, &hkey )) return ERROR_SUCCESS;
824 ret = RegDeleteTreeW( hkey, squashed_code );
825 RegCloseKey( hkey );
826 return ret;
827}
Definition: inflate.c:139

Referenced by remove_product_upgrade_code().

◆ MSIREG_DeleteUserDataComponentKey()

UINT MSIREG_DeleteUserDataComponentKey ( LPCWSTR  szComponent,
LPCWSTR  szUserSid 
)

Definition at line 552 of file registry.c.

553{
554 static const WCHAR fmtW[] =
555 L"Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\UserData\\%s\\Components";
557 WCHAR *usersid, squashed_comp[SQUASHED_GUID_SIZE], keypath[0x200];
558 HKEY hkey;
559 LONG r;
560
561 if (!squash_guid( szComponent, squashed_comp )) return ERROR_FUNCTION_FAILED;
562 TRACE("%s squashed %s\n", debugstr_w(szComponent), debugstr_w(squashed_comp));
563
564 if (!szUserSid)
565 {
566 if (!(usersid = get_user_sid()))
567 {
568 ERR("Failed to retrieve user SID\n");
570 }
571 swprintf(keypath, ARRAY_SIZE(keypath), fmtW, usersid);
572 LocalFree(usersid);
573 }
574 else swprintf(keypath, ARRAY_SIZE(keypath), fmtW, szUserSid);
575
576 if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, keypath, 0, access, &hkey)) return ERROR_SUCCESS;
577 r = RegDeleteTreeW( hkey, squashed_comp );
578 RegCloseKey(hkey);
579 return r;
580}
static WCHAR * get_user_sid(void)
Definition: registry.c:269
HLOCAL NTAPI LocalFree(HLOCAL hMem)
Definition: heapmem.c:1594

Referenced by ACTION_ProcessComponents().

◆ MSIREG_DeleteUserDataPatchKey()

UINT MSIREG_DeleteUserDataPatchKey ( LPCWSTR  patch,
MSIINSTALLCONTEXT  context 
)

Definition at line 636 of file registry.c.

637{
638 static const WCHAR fmtW[] =
639 L"Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\UserData\\%s\\Patches";
641 WCHAR *usersid, squashed_patch[SQUASHED_GUID_SIZE], keypath[0x200];
642 HKEY hkey;
643 LONG r;
644
645 if (!squash_guid( patch, squashed_patch )) return ERROR_FUNCTION_FAILED;
646 TRACE("%s squashed %s\n", debugstr_w(patch), debugstr_w(squashed_patch));
647
649 swprintf(keypath, ARRAY_SIZE(keypath), fmtW, L"S-1-5-18");
650 else
651 {
652 if (!(usersid = get_user_sid()))
653 {
654 ERR("Failed to retrieve user SID\n");
656 }
657 swprintf(keypath, ARRAY_SIZE(keypath), fmtW, usersid);
658 LocalFree(usersid);
659 }
660 if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, keypath, 0, access, &hkey)) return ERROR_SUCCESS;
661 r = RegDeleteTreeW( hkey, squashed_patch );
662 RegCloseKey(hkey);
663 return r;
664}

Referenced by ACTION_UnpublishProduct().

◆ MSIREG_DeleteUserDataProductKey()

UINT MSIREG_DeleteUserDataProductKey ( LPCWSTR  szProduct,
MSIINSTALLCONTEXT  context 
)

Definition at line 720 of file registry.c.

721{
722 static const WCHAR fmtW[] =
723 L"Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\UserData\\%s\\Products";
725 WCHAR *usersid, squashed_pc[SQUASHED_GUID_SIZE], keypath[0x200];
726 HKEY hkey;
727 LONG r;
728
729 if (!squash_guid( szProduct, squashed_pc )) return ERROR_FUNCTION_FAILED;
730 TRACE("%s squashed %s\n", debugstr_w(szProduct), debugstr_w(squashed_pc));
731
733 swprintf(keypath, ARRAY_SIZE(keypath), fmtW, L"S-1-5-18");
734 else
735 {
736 if (!(usersid = get_user_sid()))
737 {
738 ERR("Failed to retrieve user SID\n");
740 }
741 swprintf(keypath, ARRAY_SIZE(keypath), fmtW, usersid);
742 LocalFree(usersid);
743 }
744
745 if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, keypath, 0, access, &hkey)) return ERROR_SUCCESS;
746 r = RegDeleteTreeW( hkey, squashed_pc );
747 RegCloseKey(hkey);
748 return r;
749}

Referenced by ACTION_RegisterUser(), and ACTION_UnpublishProduct().

◆ MSIREG_DeleteUserFeaturesKey()

UINT MSIREG_DeleteUserFeaturesKey ( LPCWSTR  szProduct)

Definition at line 445 of file registry.c.

446{
447 WCHAR squashed_pc[SQUASHED_GUID_SIZE], keypath[0x200];
448
449 if (!squash_guid( szProduct, squashed_pc )) return ERROR_FUNCTION_FAILED;
450 TRACE("%s squashed %s\n", debugstr_w(szProduct), debugstr_w(squashed_pc));
451
452 lstrcpyW( keypath, L"Software\\Microsoft\\Installer\\Features\\" );
453 lstrcatW( keypath, squashed_pc );
454 return RegDeleteTreeW(HKEY_CURRENT_USER, keypath);
455}
#define HKEY_CURRENT_USER
Definition: winreg.h:11

Referenced by ACTION_UnpublishProduct().

◆ MSIREG_DeleteUserProductKey()

UINT MSIREG_DeleteUserProductKey ( LPCWSTR  szProduct)

Definition at line 378 of file registry.c.

379{
380 WCHAR squashed_pc[SQUASHED_GUID_SIZE], keypath[0x200];
381
382 if (!squash_guid( szProduct, squashed_pc )) return ERROR_FUNCTION_FAILED;
383 TRACE("%s squashed %s\n", debugstr_w(szProduct), debugstr_w(squashed_pc));
384
385 lstrcpyW( keypath, L"Software\\Microsoft\\Installer\\Products\\" );
386 lstrcatW( keypath, squashed_pc );
387 return RegDeleteTreeW(HKEY_CURRENT_USER, keypath);
388}

Referenced by ACTION_UnpublishProduct().

◆ MSIREG_DeleteUserUpgradeCodesKey()

UINT MSIREG_DeleteUserUpgradeCodesKey ( LPCWSTR  szUpgradeCode)

Definition at line 829 of file registry.c.

830{
831 WCHAR squashed_uc[SQUASHED_GUID_SIZE], keypath[0x200];
832
833 if (!squash_guid( szUpgradeCode, squashed_uc )) return ERROR_FUNCTION_FAILED;
834 TRACE("%s squashed %s\n", debugstr_w(szUpgradeCode), debugstr_w(squashed_uc));
835
836 lstrcpyW(keypath, L"Software\\Microsoft\\Installer\\UpgradeCodes\\");
837 lstrcatW( keypath, squashed_uc );
838 return RegDeleteTreeW(HKEY_CURRENT_USER, keypath);
839}

Referenced by remove_product_upgrade_code().

◆ MSIREG_OpenClassesUpgradeCodesKey()

UINT MSIREG_OpenClassesUpgradeCodesKey ( LPCWSTR  szUpgradeCode,
HKEY *  key,
BOOL  create 
)

Definition at line 875 of file registry.c.

876{
878 WCHAR squashed_uc[SQUASHED_GUID_SIZE], keypath[0x200];
879
880 if (!squash_guid( szUpgradeCode, squashed_uc )) return ERROR_FUNCTION_FAILED;
881 TRACE("%s squashed %s\n", debugstr_w(szUpgradeCode), debugstr_w(squashed_uc));
882
883 lstrcpyW(keypath, L"Software\\Classes\\Installer\\UpgradeCodes\\");
884 lstrcatW( keypath, squashed_uc );
885
886 if (create) return RegCreateKeyExW(HKEY_LOCAL_MACHINE, keypath, 0, NULL, 0, access, NULL, key, NULL);
887 return RegOpenKeyExW(HKEY_LOCAL_MACHINE, keypath, 0, access, key);
888}
static const struct access_res create[16]
Definition: package.c:7546

Referenced by ITERATE_MigrateFeatureStates(), publish_upgrade_code(), and remove_product_upgrade_code().

◆ MSIREG_OpenFeaturesKey()

UINT MSIREG_OpenFeaturesKey ( LPCWSTR  szProduct,
LPCWSTR  szUserSid,
MSIINSTALLCONTEXT  context,
HKEY *  key,
BOOL  create 
)

Definition at line 404 of file registry.c.

406{
409 WCHAR squashed_pc[SQUASHED_GUID_SIZE], keypath[MAX_PATH], *usersid = NULL;
410
411 if (!squash_guid( szProduct, squashed_pc )) return ERROR_FUNCTION_FAILED;
412 TRACE("%s squashed %s\n", debugstr_w(szProduct), debugstr_w(squashed_pc));
413
415 {
416 lstrcpyW(keypath, L"Software\\Classes\\Installer\\Features\\");
417 lstrcatW( keypath, squashed_pc );
418 }
420 {
422 lstrcpyW(keypath, L"Software\\Microsoft\\Installer\\Features\\");
423 lstrcatW( keypath, squashed_pc );
424 }
425 else
426 {
427 if (!szUserSid)
428 {
429 if (!(usersid = get_user_sid()))
430 {
431 ERR("Failed to retrieve user SID\n");
433 }
434 szUserSid = usersid;
435 }
436 swprintf( keypath, ARRAY_SIZE(keypath),
437 L"Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\Managed\\%s\\Installer\\Features\\%s",
438 szUserSid, squashed_pc );
439 LocalFree(usersid);
440 }
441 if (create) return RegCreateKeyExW(root, keypath, 0, NULL, 0, access, NULL, key, NULL);
442 return RegOpenKeyExW(root, keypath, 0, access, key);
443}

Referenced by ACTION_PublishFeatures(), query_feature_state(), and unpublish_feature().

◆ MSIREG_OpenInstallProps()

UINT MSIREG_OpenInstallProps ( LPCWSTR  szProduct,
MSIINSTALLCONTEXT  dwContext,
LPCWSTR  szUserSid,
HKEY *  key,
BOOL  create 
)

Definition at line 692 of file registry.c.

693{
694 static const WCHAR fmtW[] =
695 L"Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\UserData\\%s\\Products\\%s\\InstallProperties";
697 WCHAR *usersid, squashed_pc[SQUASHED_GUID_SIZE], keypath[0x200];
698
699 if (!squash_guid( szProduct, squashed_pc )) return ERROR_FUNCTION_FAILED;
700 TRACE("%s squashed %s\n", debugstr_w(szProduct), debugstr_w(squashed_pc));
701
702 if (dwContext == MSIINSTALLCONTEXT_MACHINE)
703 swprintf( keypath, ARRAY_SIZE(keypath), fmtW, L"S-1-5-18", squashed_pc );
704 else if (szUserSid)
705 swprintf( keypath, ARRAY_SIZE(keypath), fmtW, szUserSid, squashed_pc );
706 else
707 {
708 if (!(usersid = get_user_sid()))
709 {
710 ERR("Failed to retrieve user SID\n");
712 }
713 swprintf( keypath, ARRAY_SIZE(keypath), fmtW, usersid, squashed_pc );
714 LocalFree(usersid);
715 }
716 if (create) return RegCreateKeyExW(HKEY_LOCAL_MACHINE, keypath, 0, NULL, 0, access, NULL, key, NULL);
717 return RegOpenKeyExW(HKEY_LOCAL_MACHINE, keypath, 0, access, key);
718}

Referenced by ACTION_RegisterProduct(), ACTION_RegisterUser(), comp_find_package(), get_install_location(), get_registered_local_package(), MSI_GetComponentPath(), MSI_GetProductInfo(), MSI_GetUserInfo(), MSI_OpenProductW(), MsiGetPatchInfoExW(), MsiGetProductInfoExW(), MsiQueryProductStateW(), and open_package().

◆ MSIREG_OpenPatchesKey()

UINT MSIREG_OpenPatchesKey ( LPCWSTR  szPatch,
HKEY *  key,
BOOL  create 
)

Definition at line 768 of file registry.c.

769{
771 WCHAR squashed_pc[SQUASHED_GUID_SIZE], keypath[0x200];
772
773 if (!squash_guid( szPatch, squashed_pc )) return ERROR_FUNCTION_FAILED;
774 TRACE("%s squashed %s\n", debugstr_w(szPatch), debugstr_w(squashed_pc));
775
776 lstrcpyW( keypath, L"Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\Patches\\" );
777 lstrcatW( keypath, squashed_pc );
778
779 if (create) return RegCreateKeyExW(HKEY_LOCAL_MACHINE, keypath, 0, NULL, 0, access, NULL, key, NULL);
780 return RegOpenKeyExW(HKEY_LOCAL_MACHINE, keypath, 0, access, key);
781}

Referenced by OpenSourceKey().

◆ MSIREG_OpenProductKey()

UINT MSIREG_OpenProductKey ( LPCWSTR  szProduct,
LPCWSTR  szUserSid,
MSIINSTALLCONTEXT  context,
HKEY *  key,
BOOL  create 
)

Definition at line 338 of file registry.c.

339{
342 WCHAR *usersid = NULL, squashed_pc[SQUASHED_GUID_SIZE], keypath[MAX_PATH];
343
344 if (!squash_guid( szProduct, squashed_pc )) return ERROR_FUNCTION_FAILED;
345 TRACE("%s squashed %s\n", debugstr_w(szProduct), debugstr_w(squashed_pc));
346
348 {
349 lstrcpyW(keypath, L"Software\\Classes\\Installer\\Products\\");
350 lstrcatW( keypath, squashed_pc );
351 }
353 {
355 lstrcpyW( keypath, L"Software\\Microsoft\\Installer\\Products\\" );
356 lstrcatW( keypath, squashed_pc );
357 }
358 else
359 {
360 if (!szUserSid)
361 {
362 if (!(usersid = get_user_sid()))
363 {
364 ERR("Failed to retrieve user SID\n");
366 }
367 szUserSid = usersid;
368 }
369 swprintf( keypath, ARRAY_SIZE(keypath),
370 L"Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\Managed\\%s\\Installer\\Products\\%s",
371 szUserSid, squashed_pc );
372 LocalFree(usersid);
373 }
374 if (create) return RegCreateKeyExW(root, keypath, 0, NULL, 0, access, NULL, key, NULL);
375 return RegOpenKeyExW(root, keypath, 0, access, key);
376}

Referenced by ACTION_PublishProduct(), check_product_patches(), comp_find_prod_key(), ITERATE_FindRelatedProducts(), MSI_GetComponentPath(), MSI_GetProductInfo(), MSI_GetUserInfo(), msi_locate_product(), MsiEnumPatchesW(), MsiGetPatchInfoExW(), MsiGetProductCodeW(), MsiGetProductInfoExW(), MsiQueryProductStateW(), MsiSourceListAddSourceW(), OpenSourceKey(), and publish_patches().

◆ MSIREG_OpenUninstallKey()

UINT MSIREG_OpenUninstallKey ( const WCHAR *  ,
enum  platform,
HKEY *  ,
BOOL   
)

◆ MSIREG_OpenUpgradeCodesKey()

UINT MSIREG_OpenUpgradeCodesKey ( LPCWSTR  szProduct,
HKEY *  key,
BOOL  create 
)

Definition at line 783 of file registry.c.

784{
786 WCHAR squashed_uc[SQUASHED_GUID_SIZE], keypath[0x200];
787
788 if (!squash_guid( szUpgradeCode, squashed_uc )) return ERROR_FUNCTION_FAILED;
789 TRACE("%s squashed %s\n", debugstr_w(szUpgradeCode), debugstr_w(squashed_uc));
790
791 lstrcpyW( keypath, L"Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\UpgradeCodes\\" );
792 lstrcatW( keypath, squashed_uc );
793
794 if (create) return RegCreateKeyExW(HKEY_LOCAL_MACHINE, keypath, 0, NULL, 0, access, NULL, key, NULL);
795 return RegOpenKeyExW(HKEY_LOCAL_MACHINE, keypath, 0, access, key);
796}

Referenced by ACTION_RegisterProduct(), ITERATE_FindRelatedProducts(), MsiEnumRelatedProductsW(), and remove_product_upgrade_code().

◆ MSIREG_OpenUserComponentsKey()

UINT MSIREG_OpenUserComponentsKey ( LPCWSTR  szComponent,
HKEY *  key,
BOOL  create 
)

Definition at line 505 of file registry.c.

506{
507 WCHAR squashed_cc[SQUASHED_GUID_SIZE], keypath[0x200];
509 UINT ret;
510
511 if (!squash_guid( szComponent, squashed_cc)) return ERROR_FUNCTION_FAILED;
512 TRACE("%s squashed %s\n", debugstr_w(szComponent), debugstr_w(squashed_cc));
513
514 lstrcpyW(keypath, L"Software\\Microsoft\\Installer\\Components\\");
515 lstrcatW( keypath, squashed_cc );
516
517 if (create) return RegCreateKeyW(HKEY_CURRENT_USER, keypath, key);
519 if (ret != ERROR_FILE_NOT_FOUND) return ret;
520
521 lstrcpyW(keypath, L"Software\\Classes\\Installer\\Components\\");
522 lstrcatW( keypath, squashed_cc );
523 return RegOpenKeyExW( HKEY_LOCAL_MACHINE, keypath, 0, access, key );
524}

Referenced by ITERATE_PublishComponent(), MSI_EnumComponentQualifiers(), and MSI_ProvideQualifiedComponentEx().

◆ MSIREG_OpenUserDataComponentKey()

UINT MSIREG_OpenUserDataComponentKey ( LPCWSTR  szComponent,
LPCWSTR  szUserSid,
HKEY *  key,
BOOL  create 
)

Definition at line 526 of file registry.c.

527{
528 static const WCHAR fmtW[] =
529 L"Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\UserData\\%s\\Components\\%s";
531 WCHAR *usersid, squashed_comp[SQUASHED_GUID_SIZE], keypath[0x200];
532
533 if (!squash_guid( szComponent, squashed_comp )) return ERROR_FUNCTION_FAILED;
534 TRACE("%s squashed %s\n", debugstr_w(szComponent), debugstr_w(squashed_comp));
535
536 if (!szUserSid)
537 {
538 if (!(usersid = get_user_sid()))
539 {
540 ERR("Failed to retrieve user SID\n");
542 }
543 swprintf( keypath, ARRAY_SIZE(keypath), fmtW, usersid, squashed_comp );
544 LocalFree(usersid);
545 }
546 else swprintf( keypath, ARRAY_SIZE(keypath), fmtW, szUserSid, squashed_comp );
547
548 if (create) return RegCreateKeyExW(HKEY_LOCAL_MACHINE, keypath, 0, NULL, 0, access, NULL, key, NULL);
549 return RegOpenKeyExW(HKEY_LOCAL_MACHINE, keypath, 0, access, key);
550}

Referenced by ACTION_ProcessComponents(), comp_find_prodcode(), get_client_counts(), MsiEnumClientsW(), MsiGetProductCodeW(), open_userdata_comp_key(), and query_feature_state().

◆ MSIREG_OpenUserDataFeaturesKey()

UINT MSIREG_OpenUserDataFeaturesKey ( LPCWSTR  szProduct,
LPCWSTR  szUserSid,
MSIINSTALLCONTEXT  context,
HKEY *  key,
BOOL  create 
)

Definition at line 472 of file registry.c.

474{
475 static const WCHAR fmtW[] =
476 L"Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\UserData\\%s\\Products\\%s\\Features";
478 WCHAR squashed_pc[SQUASHED_GUID_SIZE], keypath[0x200], *usersid = NULL;
479
480 if (!squash_guid( szProduct, squashed_pc )) return ERROR_FUNCTION_FAILED;
481 TRACE("%s squashed %s\n", debugstr_w(szProduct), debugstr_w(squashed_pc));
482
484 {
485 swprintf( keypath, ARRAY_SIZE(keypath), fmtW, L"S-1-5-18", squashed_pc );
486 }
487 else
488 {
489 if (!szUserSid)
490 {
491 if (!(usersid = get_user_sid()))
492 {
493 ERR("Failed to retrieve user SID\n");
495 }
496 szUserSid = usersid;
497 }
498 swprintf( keypath, ARRAY_SIZE(keypath), fmtW, szUserSid, squashed_pc );
499 LocalFree(usersid);
500 }
501 if (create) return RegCreateKeyExW(HKEY_LOCAL_MACHINE, keypath, 0, NULL, 0, access, NULL, key, NULL);
502 return RegOpenKeyExW(HKEY_LOCAL_MACHINE, keypath, 0, access, key);
503}

Referenced by ACTION_PublishFeatures(), MSI_ProvideQualifiedComponentEx(), query_feature_state(), and unpublish_feature().

◆ MSIREG_OpenUserDataPatchKey()

UINT MSIREG_OpenUserDataPatchKey ( LPCWSTR  szPatch,
MSIINSTALLCONTEXT  dwContext,
HKEY *  key,
BOOL  create 
)

Definition at line 610 of file registry.c.

611{
612 static const WCHAR fmtW[] =
613 L"Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\UserData\\%s\\Patches\\%s";
615 WCHAR *usersid, squashed_patch[SQUASHED_GUID_SIZE], keypath[0x200];
616
617 if (!squash_guid( szPatch, squashed_patch )) return ERROR_FUNCTION_FAILED;
618 TRACE("%s squashed %s\n", debugstr_w(szPatch), debugstr_w(squashed_patch));
619
620 if (dwContext == MSIINSTALLCONTEXT_MACHINE)
621 swprintf( keypath, ARRAY_SIZE(keypath), fmtW, L"S-1-5-18", squashed_patch );
622 else
623 {
624 if (!(usersid = get_user_sid()))
625 {
626 ERR("Failed to retrieve user SID\n");
628 }
629 swprintf( keypath, ARRAY_SIZE(keypath), fmtW, usersid, squashed_patch );
630 LocalFree(usersid);
631 }
632 if (create) return RegCreateKeyExW(HKEY_LOCAL_MACHINE, keypath, 0, NULL, 0, access, NULL, key, NULL);
633 return RegOpenKeyExW(HKEY_LOCAL_MACHINE, keypath, 0, access, key);
634}

Referenced by check_product_patches(), MsiGetPatchInfoExW(), and publish_patches().

◆ MSIREG_OpenUserDataProductKey()

UINT MSIREG_OpenUserDataProductKey ( LPCWSTR  szProduct,
MSIINSTALLCONTEXT  dwContext,
LPCWSTR  szUserSid,
HKEY *  key,
BOOL  create 
)

Definition at line 582 of file registry.c.

583{
584 static const WCHAR fmtW[] =
585 L"Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\UserData\\%s\\Products\\%s";
587 WCHAR *usersid, squashed_pc[SQUASHED_GUID_SIZE], keypath[0x200];
588
589 if (!squash_guid( szProduct, squashed_pc )) return ERROR_FUNCTION_FAILED;
590 TRACE("%s squashed %s\n", debugstr_w(szProduct), debugstr_w(squashed_pc));
591
592 if (dwContext == MSIINSTALLCONTEXT_MACHINE)
593 swprintf( keypath, ARRAY_SIZE(keypath), fmtW, L"S-1-5-18", squashed_pc );
594 else if (szUserSid)
595 swprintf( keypath, ARRAY_SIZE(keypath), fmtW, szUserSid, squashed_pc );
596 else
597 {
598 if (!(usersid = get_user_sid()))
599 {
600 ERR("Failed to retrieve user SID\n");
602 }
603 swprintf( keypath, ARRAY_SIZE(keypath), fmtW, usersid, squashed_pc );
604 LocalFree(usersid);
605 }
606 if (create) return RegCreateKeyExW(HKEY_LOCAL_MACHINE, keypath, 0, NULL, 0, access, NULL, key, NULL);
607 return RegOpenKeyExW(HKEY_LOCAL_MACHINE, keypath, 0, access, key);
608}

Referenced by ACTION_PublishProduct(), check_product_patches(), get_patch_state(), MSI_GetComponentPath(), and MsiGetPatchInfoExW().

◆ MSIREG_OpenUserDataProductPatchesKey()

UINT MSIREG_OpenUserDataProductPatchesKey ( LPCWSTR  product,
MSIINSTALLCONTEXT  context,
HKEY *  key,
BOOL  create 
)

Definition at line 666 of file registry.c.

667{
668 static const WCHAR fmtW[] =
669 L"Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\UserData\\%s\\Products\\%s\\Patches";
671 WCHAR *usersid, squashed_product[SQUASHED_GUID_SIZE], keypath[0x200];
672
673 if (!squash_guid( product, squashed_product )) return ERROR_FUNCTION_FAILED;
674 TRACE("%s squashed %s\n", debugstr_w(product), debugstr_w(squashed_product));
675
677 swprintf( keypath, ARRAY_SIZE(keypath), fmtW, L"S-1-5-18", squashed_product );
678 else
679 {
680 if (!(usersid = get_user_sid()))
681 {
682 ERR("Failed to retrieve user SID\n");
684 }
685 swprintf( keypath, ARRAY_SIZE(keypath), fmtW, usersid, squashed_product );
686 LocalFree(usersid);
687 }
688 if (create) return RegCreateKeyExW(HKEY_LOCAL_MACHINE, keypath, 0, NULL, 0, access, NULL, key, NULL);
689 return RegOpenKeyExW(HKEY_LOCAL_MACHINE, keypath, 0, access, key);
690}

Referenced by publish_patches().

◆ MSIREG_OpenUserPatchesKey()

UINT MSIREG_OpenUserPatchesKey ( LPCWSTR  szPatch,
HKEY *  key,
BOOL  create 
)

Definition at line 390 of file registry.c.

391{
392 WCHAR squashed_pc[SQUASHED_GUID_SIZE], keypath[0x200];
393
394 if (!squash_guid( szPatch, squashed_pc )) return ERROR_FUNCTION_FAILED;
395 TRACE("%s squashed %s\n", debugstr_w(szPatch), debugstr_w(squashed_pc));
396
397 lstrcpyW( keypath, L"Software\\Microsoft\\Installer\\Patches\\" );
398 lstrcatW( keypath, squashed_pc );
399
400 if (create) return RegCreateKeyW(HKEY_CURRENT_USER, keypath, key);
401 return RegOpenKeyW(HKEY_CURRENT_USER, keypath, key);
402}

Referenced by OpenSourceKey().

◆ MSIREG_OpenUserUpgradeCodesKey()

UINT MSIREG_OpenUserUpgradeCodesKey ( LPCWSTR  szProduct,
HKEY *  key,
BOOL  create 
)

Definition at line 798 of file registry.c.

799{
800 WCHAR squashed_uc[SQUASHED_GUID_SIZE], keypath[0x200];
801
802 if (!squash_guid( szUpgradeCode, squashed_uc )) return ERROR_FUNCTION_FAILED;
803 TRACE("%s squashed %s\n", debugstr_w(szUpgradeCode), debugstr_w(squashed_uc));
804
805 lstrcpyW(keypath, L"Software\\Microsoft\\Installer\\UpgradeCodes\\");
806 lstrcatW( keypath, squashed_uc );
807
808 if (create) return RegCreateKeyW(HKEY_CURRENT_USER, keypath, key);
809 return RegOpenKeyW(HKEY_CURRENT_USER, keypath, key);
810}

Referenced by ITERATE_MigrateFeatureStates(), publish_upgrade_code(), and remove_product_upgrade_code().

◆ read_stream_data()

UINT read_stream_data ( IStorage *  stg,
LPCWSTR  stname,
BOOL  table,
BYTE **  pdata,
UINT *  psz 
)

Definition at line 234 of file table.c.

236{
237 HRESULT r;
239 VOID *data;
240 ULONG sz, count;
241 IStream *stm = NULL;
242 STATSTG stat;
243 LPWSTR encname;
244
245 encname = encode_streamname(table, stname);
246
247 TRACE("%s -> %s\n",debugstr_w(stname),debugstr_w(encname));
248
249 r = IStorage_OpenStream(stg, encname, NULL,
251 free(encname);
252 if( FAILED( r ) )
253 {
254 WARN( "open stream failed r = %#lx - empty table?\n", r );
255 return ret;
256 }
257
258 r = IStream_Stat(stm, &stat, STATFLAG_NONAME );
259 if( FAILED( r ) )
260 {
261 WARN( "open stream failed r = %#lx!\n", r );
262 goto end;
263 }
264
265 if( stat.cbSize.QuadPart >> 32 )
266 {
267 WARN("Too big!\n");
268 goto end;
269 }
270
271 sz = stat.cbSize.QuadPart;
272 data = malloc(sz);
273 if( !data )
274 {
275 WARN( "couldn't allocate memory r = %#lx!\n", r );
277 goto end;
278 }
279
280 r = IStream_Read(stm, data, sz, &count );
281 if( FAILED( r ) || ( count != sz ) )
282 {
283 free(data);
284 WARN("read stream failed r = %#lx!\n", r);
285 goto end;
286 }
287
288 *pdata = data;
289 *psz = sz;
291
292end:
293 IStream_Release( stm );
294
295 return ret;
296}
#define ERROR_NOT_ENOUGH_MEMORY
Definition: dderror.h:7
LPWSTR encode_streamname(BOOL bTable, LPCWSTR in)
Definition: table.c:121
static PROTOCOLDATA * pdata
Definition: protocol.c:163

Referenced by read_table_from_storage(), and table_load_transform().

◆ ready_media()

UINT ready_media ( MSIPACKAGE *  package,
BOOL  compressed,
MSIMEDIAINFO *  mi 
)

Definition at line 838 of file media.c.

839{
840 UINT rc;
841 WCHAR *cabinet_file = NULL;
842
843 /* media info for continuous cabinet is already loaded */
844 if (mi->is_continuous) return ERROR_SUCCESS;
845
846 if (mi->cabinet)
847 {
849
850 /* cabinet is internal, no checks needed */
851 if (mi->cabinet[0] == '#') return ERROR_SUCCESS;
852
853 if (!(cabinet_file = get_cabinet_filename( mi ))) return ERROR_OUTOFMEMORY;
854
855 /* package should be downloaded */
856 if (compressed && GetFileAttributesW( cabinet_file ) == INVALID_FILE_ATTRIBUTES &&
857 (base_url = get_base_url( package->db )))
858 {
859 WCHAR temppath[MAX_PATH], *p, *url;
860
861 free( cabinet_file );
862 if (!(url = realloc( base_url, (wcslen( base_url ) + wcslen( mi->cabinet ) + 1) * sizeof(WCHAR) )))
863 {
864 free( base_url );
865 return ERROR_OUTOFMEMORY;
866 }
867 lstrcatW( url, mi->cabinet );
868 if ((rc = msi_download_file( url, temppath )) != ERROR_SUCCESS)
869 {
870 ERR("failed to download %s (%u)\n", debugstr_w(url), rc);
871 free( url );
872 return rc;
873 }
874 if ((p = wcsrchr( temppath, '\\' ))) *p = 0;
875 lstrcpyW( mi->sourcedir, temppath );
876 PathAddBackslashW( mi->sourcedir );
877 free( mi->cabinet );
878 mi->cabinet = wcsdup( p + 1 );
879
880 free( url );
881 return ERROR_SUCCESS;
882 }
883 }
884 /* check volume matches, change media if not */
885 if (mi->volume_label)
886 {
887 /* assume first volume is in the drive */
888 if (mi->last_volume && wcsicmp( mi->last_volume, mi->volume_label ))
889 {
890 WCHAR *source = msi_dup_property( package->db, L"SourceDir" );
892 free( source );
893
894 if (!match && (mi->type == DRIVE_CDROM || mi->type == DRIVE_REMOVABLE))
895 {
896 if ((rc = change_media( package, mi )) != ERROR_SUCCESS)
897 {
898 free( cabinet_file );
899 return rc;
900 }
901 }
902 }
903
904 free(mi->last_volume);
905 mi->last_volume = wcsdup(mi->volume_label);
906 }
907 if (mi->cabinet)
908 {
909 if (compressed && GetFileAttributesW( cabinet_file ) == INVALID_FILE_ATTRIBUTES)
910 {
911 if ((rc = find_published_source( package, mi )) != ERROR_SUCCESS)
912 {
913 ERR("cabinet not found: %s\n", debugstr_w(cabinet_file));
914 free( cabinet_file );
916 }
917 }
918 }
919 free( cabinet_file );
920 return ERROR_SUCCESS;
921}
static UINT change_media(MSIPACKAGE *package, MSIMEDIAINFO *mi)
Definition: media.c:63
static WCHAR * get_cabinet_filename(MSIMEDIAINFO *mi)
Definition: media.c:289
static BOOL source_matches_volume(MSIMEDIAINFO *mi, LPCWSTR source_root)
Definition: media.c:39
static UINT find_published_source(MSIPACKAGE *package, MSIMEDIAINFO *mi)
Definition: media.c:742
static const WCHAR url[]
Definition: encode.c:1384
UINT msi_download_file(LPCWSTR szUrl, LPWSTR filename)
Definition: package.c:1030
Definition: match.c:28

Referenced by ACTION_InstallFiles(), and ACTION_PatchFiles().

◆ release_typelib()

void release_typelib ( void  )

Definition at line 160 of file apps.c.

161{
162 unsigned i;
163
164 for (i = 0; i < ARRAY_SIZE(typeinfo); i++)
165 if (typeinfo[i])
166 ITypeInfo_Release(typeinfo[i]);
167
168 if (typelib)
169 ITypeLib_Release(typelib);
170}

◆ rpc_filter()

LONG WINAPI rpc_filter ( EXCEPTION_POINTERS *  eptr)

Definition at line 84 of file custom.c.

85{
87}
RPCRTAPI int RPC_ENTRY I_RpcExceptionFilter(ULONG)
PEXCEPTION_RECORD ExceptionRecord
Definition: rtltypes.h:200
DWORD ExceptionCode
Definition: compat.h:208

◆ squash_guid()

BOOL squash_guid ( LPCWSTR  in,
LPWSTR  out 
)

Definition at line 74 of file registry.c.

75{
76 DWORD i,n=1;
77 GUID guid;
78
79 out[0] = 0;
80
81 if (FAILED(CLSIDFromString((LPCOLESTR)in, &guid)))
82 return FALSE;
83
84 for(i=0; i<8; i++)
85 out[7-i] = in[n++];
86 n++;
87 for(i=0; i<4; i++)
88 out[11-i] = in[n++];
89 n++;
90 for(i=0; i<4; i++)
91 out[15-i] = in[n++];
92 n++;
93 for(i=0; i<2; i++)
94 {
95 out[17+i*2] = in[n++];
96 out[16+i*2] = in[n++];
97 }
98 n++;
99 for( ; i<8; i++)
100 {
101 out[17+i*2] = in[n++];
102 out[16+i*2] = in[n++];
103 }
104 out[32]=0;
105 return TRUE;
106}

Referenced by ACTION_ForceReboot(), ACTION_ProcessComponents(), ACTION_PublishProduct(), ACTION_RegisterProduct(), compose_base85_guid(), create_test_guid(), ITERATE_UnpublishComponent(), MSI_GetComponentPath(), MSI_GetProductInfo(), MSI_GetUserInfo(), MsiEnumPatchesExW(), MsiEnumPatchesW(), MsiGetPatchInfoExW(), MsiGetProductCodeW(), MsiGetProductInfoExW(), MsiOpenProductW(), MsiQueryComponentStateW(), MsiQueryFeatureStateExW(), MsiQueryFeatureStateW(), MSIREG_DeleteClassesUpgradeCodesKey(), MSIREG_DeleteLocalClassesFeaturesKey(), MSIREG_DeleteLocalClassesProductKey(), MSIREG_DeleteProductKey(), MSIREG_DeleteUpgradeCodesKey(), MSIREG_DeleteUserDataComponentKey(), MSIREG_DeleteUserDataPatchKey(), MSIREG_DeleteUserDataProductKey(), MSIREG_DeleteUserFeaturesKey(), MSIREG_DeleteUserProductKey(), MSIREG_DeleteUserUpgradeCodesKey(), MSIREG_OpenClassesUpgradeCodesKey(), MSIREG_OpenFeaturesKey(), MSIREG_OpenInstallerFeaturesKey(), MSIREG_OpenInstallProps(), MSIREG_OpenPatchesKey(), MSIREG_OpenProductKey(), MSIREG_OpenUpgradeCodesKey(), MSIREG_OpenUserComponentsKey(), MSIREG_OpenUserDataComponentKey(), MSIREG_OpenUserDataFeaturesKey(), MSIREG_OpenUserDataPatchKey(), MSIREG_OpenUserDataProductKey(), MSIREG_OpenUserDataProductPatchesKey(), MSIREG_OpenUserPatchesKey(), MSIREG_OpenUserUpgradeCodesKey(), MsiSourceListAddMediaDiskW(), MsiSourceListAddSourceExW(), MsiSourceListAddSourceW(), MsiSourceListEnumMediaDisksW(), MsiSourceListEnumSourcesW(), MsiSourceListGetInfoW(), MsiSourceListSetInfoW(), publish_patches(), publish_product_properties(), publish_upgrade_code(), and remove_product_upgrade_code().

◆ strdupAtoW()

static LPWSTR strdupAtoW ( LPCSTR  str)
inlinestatic

Definition at line 1187 of file msipriv.h.

1188{
1189 LPWSTR ret = NULL;
1190 DWORD len;
1191
1192 if (!str) return ret;
1193 len = MultiByteToWideChar( CP_ACP, 0, str, -1, NULL, 0 );
1194 ret = malloc( len * sizeof(WCHAR) );
1195 if (ret)
1196 MultiByteToWideChar( CP_ACP, 0, str, -1, ret, len );
1197 return ret;
1198}

◆ strdupUtoW()

static LPWSTR strdupUtoW ( LPCSTR  str)
inlinestatic

Definition at line 1213 of file msipriv.h.

1214{
1215 LPWSTR ret = NULL;
1216 DWORD len;
1217
1218 if (!str) return ret;
1219 len = MultiByteToWideChar( CP_UTF8, 0, str, -1, NULL, 0 );
1220 ret = malloc( len * sizeof(WCHAR) );
1221 if (ret)
1222 MultiByteToWideChar( CP_UTF8, 0, str, -1, ret, len );
1223 return ret;
1224}
#define CP_UTF8
Definition: nls.h:20

Referenced by cabinet_open().

◆ strdupWtoA()

static char * strdupWtoA ( LPCWSTR  str)
inlinestatic

Definition at line 1174 of file msipriv.h.

1175{
1176 LPSTR ret = NULL;
1177 DWORD len;
1178
1179 if (!str) return ret;
1180 len = WideCharToMultiByte( CP_ACP, 0, str, -1, NULL, 0, NULL, NULL);
1181 ret = malloc( len );
1182 if (ret)
1183 WideCharToMultiByte( CP_ACP, 0, str, -1, ret, len, NULL, NULL );
1184 return ret;
1185}
char * LPSTR
Definition: typedefs.h:51

◆ strdupWtoU()

static char * strdupWtoU ( LPCWSTR  str)
inlinestatic

Definition at line 1200 of file msipriv.h.

1201{
1202 LPSTR ret = NULL;
1203 DWORD len;
1204
1205 if (!str) return ret;
1206 len = WideCharToMultiByte( CP_UTF8, 0, str, -1, NULL, 0, NULL, NULL);
1207 ret = malloc( len );
1208 if (ret)
1210 return ret;
1211}

Referenced by extract_cabinet().

◆ TABLE_Exists()

BOOL TABLE_Exists ( MSIDATABASE *  db,
LPCWSTR  name 
)

Definition at line 962 of file table.c.

963{
964 UINT r, table_id, i;
966
967 if( !wcscmp( name, L"_Tables" ) || !wcscmp( name, L"_Columns" ) ||
968 !wcscmp( name, L"_Streams" ) || !wcscmp( name, L"_Storages" ) )
969 return TRUE;
970
971 r = msi_string2id( db->strings, name, -1, &table_id );
972 if( r != ERROR_SUCCESS )
973 {
974 TRACE("Couldn't find id for %s\n", debugstr_w(name));
975 return FALSE;
976 }
977
978 r = get_table( db, L"_Tables", &table );
979 if( r != ERROR_SUCCESS )
980 {
981 ERR("table _Tables not available\n");
982 return FALSE;
983 }
984
985 for( i = 0; i < table->row_count; i++ )
986 {
987 if( read_table_int( table->data, i, 0, LONG_STR_BYTES ) == table_id )
988 return TRUE;
989 }
990
991 return FALSE;
992}
static UINT read_table_int(BYTE *const *data, UINT row, UINT col, UINT bytes)
Definition: table.c:621
UINT msi_string2id(const string_table *st, const WCHAR *data, int len, UINT *id)
Definition: string.c:400
BYTE * data

Referenced by ACTION_ShowDialog(), merge_diff_row(), merge_diff_tables(), merge_table(), msi_create_table(), MSI_DatabaseGetPrimaryKeys(), MSI_DatabaseImport(), and update_merge_errors().

◆ unmarshal_record()

UINT unmarshal_record ( const struct wire_record *  in,
MSIHANDLE *  out 
)

Definition at line 1095 of file record.c.

1096{
1097 if (!in)
1098 {
1099 *out = 0;
1100 return ERROR_SUCCESS;
1101 }
1102
1103 *out = MsiCreateRecord(in->count);
1104 if (!*out) return ERROR_OUTOFMEMORY;
1105
1106 return copy_remote_record(in, *out);
1107}
MSIHANDLE WINAPI MsiCreateRecord(UINT cParams)
Definition: record.c:92
UINT copy_remote_record(const struct wire_record *in, MSIHANDLE out)
Definition: record.c:1052

Referenced by MsiDatabaseGetPrimaryKeysW(), MsiViewFetch(), MsiViewGetColumnInfo(), s_remote_FormatRecord(), s_remote_ProcessMessage(), s_remote_ViewExecute(), and s_remote_ViewModify().

◆ unsquash_guid()

BOOL unsquash_guid ( LPCWSTR  in,
LPWSTR  out 
)

Definition at line 41 of file registry.c.

42{
43 DWORD i,n=0;
44
45 if (lstrlenW(in) != 32)
46 return FALSE;
47
48 out[n++]='{';
49 for(i=0; i<8; i++)
50 out[n++] = in[7-i];
51 out[n++]='-';
52 for(i=0; i<4; i++)
53 out[n++] = in[11-i];
54 out[n++]='-';
55 for(i=0; i<4; i++)
56 out[n++] = in[15-i];
57 out[n++]='-';
58 for(i=0; i<2; i++)
59 {
60 out[n++] = in[17+i*2];
61 out[n++] = in[16+i*2];
62 }
63 out[n++]='-';
64 for( ; i<8; i++)
65 {
66 out[n++] = in[17+i*2];
67 out[n++] = in[16+i*2];
68 }
69 out[n++]='}';
70 out[n]=0;
71 return TRUE;
72}

Referenced by check_product_patches(), fetch_machine_component(), fetch_machine_product(), fetch_user_component(), fetch_user_product(), ITERATE_FindRelatedProducts(), MSI_GetProductInfo(), MsiEnumClientsW(), MsiEnumRelatedProductsW(), and MsiGetProductCodeW().

◆ VIEW_find_column()

UINT VIEW_find_column ( MSIVIEW *  table,
LPCWSTR  name,
LPCWSTR  table_name,
UINT *  n 
)

Definition at line 59 of file msiquery.c.

60{
61 LPCWSTR col_name, haystack_table_name;
62 UINT i, count, r;
63
64 r = table->ops->get_dimensions( table, NULL, &count );
65 if( r != ERROR_SUCCESS )
66 return r;
67
68 for( i=1; i<=count; i++ )
69 {
70 INT x;
71
72 r = table->ops->get_column_info( table, i, &col_name, NULL,
73 NULL, &haystack_table_name );
74 if( r != ERROR_SUCCESS )
75 return r;
76 x = wcscmp( name, col_name );
77 if( table_name )
78 x |= wcscmp( table_name, haystack_table_name );
79 if( !x )
80 {
81 *n = i;
82 return ERROR_SUCCESS;
83 }
84 }
86}

Referenced by SELECT_AddColumn().

◆ write_stream_data()

UINT write_stream_data ( IStorage *  stg,
LPCWSTR  stname,
LPCVOID  data,
UINT  sz,
BOOL  bTable 
)

Definition at line 298 of file table.c.

300{
301 HRESULT r;
303 ULONG count;
304 IStream *stm = NULL;
307 LPWSTR encname;
308
309 encname = encode_streamname(bTable, stname );
310 r = IStorage_OpenStream( stg, encname, NULL,
312 if( FAILED(r) )
313 {
314 r = IStorage_CreateStream( stg, encname,
315 STGM_WRITE | STGM_SHARE_EXCLUSIVE, 0, 0, &stm);
316 }
317 free( encname );
318 if( FAILED( r ) )
319 {
320 WARN( "open stream failed r = %#lx\n", r );
321 return ret;
322 }
323
324 size.QuadPart = sz;
325 r = IStream_SetSize( stm, size );
326 if( FAILED( r ) )
327 {
328 WARN("Failed to SetSize\n");
329 goto end;
330 }
331
332 pos.QuadPart = 0;
333 r = IStream_Seek( stm, pos, STREAM_SEEK_SET, NULL );
334 if( FAILED( r ) )
335 {
336 WARN("Failed to Seek\n");
337 goto end;
338 }
339
340 if (sz)
341 {
342 r = IStream_Write(stm, data, sz, &count );
343 if( FAILED( r ) || ( count != sz ) )
344 {
345 WARN("Failed to Write\n");
346 goto end;
347 }
348 }
349
351
352end:
353 IStream_Release( stm );
354
355 return ret;
356}

Referenced by db_initialize(), msi_init_string_table(), msi_save_string_table(), and save_table().

Variable Documentation

◆ gszLogFile

WCHAR* gszLogFile
extern

Definition at line 50 of file msi_main.c.

Referenced by DllMain(), MSI_OpenPackageW(), and MsiEnableLogW().

◆ gUIContext

LPVOID gUIContext
extern

Definition at line 48 of file msi_main.c.

Referenced by MSI_ProcessMessageVerbatim(), MsiSetExternalUIA(), and MsiSetExternalUIW().

◆ gUIContextRecord

LPVOID gUIContextRecord
extern

Definition at line 49 of file msi_main.c.

Referenced by MSI_ProcessMessageVerbatim(), and MsiSetExternalUIRecord().

◆ gUIFilter

DWORD gUIFilter
extern

Definition at line 46 of file msi_main.c.

Referenced by MSI_ProcessMessageVerbatim(), MsiSetExternalUIA(), and MsiSetExternalUIW().

◆ gUIFilterRecord

DWORD gUIFilterRecord
extern

Definition at line 47 of file msi_main.c.

Referenced by MSI_ProcessMessageVerbatim(), and MsiSetExternalUIRecord().

◆ gUIHandlerA

INSTALLUI_HANDLERA gUIHandlerA
extern

Definition at line 43 of file msi_main.c.

Referenced by MSI_ProcessMessageVerbatim(), MsiSetExternalUIA(), and MsiSetExternalUIW().

◆ gUIHandlerRecord

INSTALLUI_HANDLER_RECORD gUIHandlerRecord
extern

Definition at line 45 of file msi_main.c.

Referenced by MSI_ProcessMessageVerbatim(), and MsiSetExternalUIRecord().

◆ gUIHandlerW

INSTALLUI_HANDLERW gUIHandlerW
extern

Definition at line 44 of file msi_main.c.

Referenced by MSI_ProcessMessageVerbatim(), MsiSetExternalUIA(), and MsiSetExternalUIW().

◆ gUIhwnd

HWND gUIhwnd
extern

Definition at line 42 of file msi_main.c.

Referenced by internal_ui_handler(), and MsiSetInternalUI().

◆ gUILevel

INSTALLUILEVEL gUILevel
extern

Definition at line 41 of file msi_main.c.

Referenced by MSI_CreatePackage(), and MsiSetInternalUI().

◆ is_64bit

◆ is_wow64

◆ msi_hInstance

HINSTANCE msi_hInstance
extern

Definition at line 51 of file msi_main.c.

Referenced by DllMain().