ReactOS 0.4.16-dev-197-g92996da
msi.c File Reference
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "winreg.h"
#include "winnls.h"
#include "shlwapi.h"
#include "msi.h"
#include "msidefs.h"
#include "msiquery.h"
#include "wincrypt.h"
#include "winver.h"
#include "winuser.h"
#include "shlobj.h"
#include "shobjidl.h"
#include "objidl.h"
#include "wintrust.h"
#include "softpub.h"
#include "msipriv.h"
#include "winemsi_s.h"
#include "initguid.h"
#include "msxml2.h"
#include "wine/debug.h"
#include "wine/exception.h"
Include dependency graph for msi.c:

Go to the source code of this file.

Classes

struct  md5_ctx
 

Macros

#define COBJMACROS
 
#define BASE85_SIZE   20
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (msi)
 
UINT msi_locate_product (LPCWSTR szProduct, MSIINSTALLCONTEXT *context)
 
UINT WINAPI MsiOpenProductA (LPCSTR szProduct, MSIHANDLE *phProduct)
 
static UINT MSI_OpenProductW (LPCWSTR szProduct, MSIPACKAGE **package)
 
UINT WINAPI MsiOpenProductW (LPCWSTR szProduct, MSIHANDLE *phProduct)
 
UINT WINAPI MsiAdvertiseProductA (LPCSTR szPackagePath, LPCSTR szScriptfilePath, LPCSTR szTransforms, LANGID lgidLanguage)
 
UINT WINAPI MsiAdvertiseProductW (LPCWSTR szPackagePath, LPCWSTR szScriptfilePath, LPCWSTR szTransforms, LANGID lgidLanguage)
 
UINT WINAPI MsiAdvertiseProductExA (const char *szPackagePath, const char *szScriptfilePath, const char *szTransforms, LANGID lgidLanguage, DWORD dwPlatform, DWORD dwOptions)
 
UINT WINAPI MsiAdvertiseProductExW (const WCHAR *szPackagePath, const WCHAR *szScriptfilePath, const WCHAR *szTransforms, LANGID lgidLanguage, DWORD dwPlatform, DWORD dwOptions)
 
UINT WINAPI MsiInstallProductA (LPCSTR szPackagePath, LPCSTR szCommandLine)
 
UINT WINAPI MsiInstallProductW (LPCWSTR szPackagePath, LPCWSTR szCommandLine)
 
UINT WINAPI MsiReinstallProductA (const char *szProduct, DWORD dwReinstallMode)
 
UINT WINAPI MsiReinstallProductW (const WCHAR *szProduct, DWORD dwReinstallMode)
 
UINT WINAPI MsiApplyPatchA (LPCSTR szPatchPackage, LPCSTR szInstallPackage, INSTALLTYPE eInstallType, LPCSTR szCommandLine)
 
static UINT get_patch_product_codes (LPCWSTR szPatchPackage, WCHAR ***product_codes)
 
static UINT MSI_ApplyPatchW (LPCWSTR szPatchPackage, LPCWSTR szProductCode, LPCWSTR szCommandLine)
 
UINT WINAPI MsiApplyPatchW (LPCWSTR szPatchPackage, LPCWSTR szInstallPackage, INSTALLTYPE eInstallType, LPCWSTR szCommandLine)
 
UINT WINAPI MsiApplyMultiplePatchesA (LPCSTR szPatchPackages, LPCSTR szProductCode, LPCSTR szPropertiesList)
 
UINT WINAPI MsiApplyMultiplePatchesW (LPCWSTR szPatchPackages, LPCWSTR szProductCode, LPCWSTR szPropertiesList)
 
static void free_patchinfo (DWORD count, MSIPATCHSEQUENCEINFOW *info)
 
static MSIPATCHSEQUENCEINFOWpatchinfoAtoW (DWORD count, const MSIPATCHSEQUENCEINFOA *info)
 
UINT WINAPI MsiDetermineApplicablePatchesA (const char *szProductPackagePath, DWORD cPatchInfo, MSIPATCHSEQUENCEINFOA *pPatchInfo)
 
static UINT MSI_ApplicablePatchW (MSIPACKAGE *package, LPCWSTR patch)
 
static UINT MSI_ApplicablePatchXML (MSIPACKAGE *package, IXMLDOMDocument *desc)
 
static UINT determine_patch_sequence (MSIPACKAGE *package, DWORD count, MSIPATCHSEQUENCEINFOW *info)
 
UINT WINAPI MsiDetermineApplicablePatchesW (const WCHAR *szProductPackagePath, DWORD cPatchInfo, MSIPATCHSEQUENCEINFOW *pPatchInfo)
 
UINT WINAPI MsiDeterminePatchSequenceA (const char *product, const char *usersid, MSIINSTALLCONTEXT context, DWORD count, MSIPATCHSEQUENCEINFOA *patchinfo)
 
static UINT open_package (const WCHAR *product, const WCHAR *usersid, MSIINSTALLCONTEXT context, MSIPACKAGE **package)
 
UINT WINAPI MsiDeterminePatchSequenceW (const WCHAR *product, const WCHAR *usersid, MSIINSTALLCONTEXT context, DWORD count, MSIPATCHSEQUENCEINFOW *patchinfo)
 
UINT WINAPI MsiConfigureProductExW (LPCWSTR szProduct, int iInstallLevel, INSTALLSTATE eInstallState, LPCWSTR szCommandLine)
 
UINT WINAPI MsiConfigureProductExA (LPCSTR szProduct, int iInstallLevel, INSTALLSTATE eInstallState, LPCSTR szCommandLine)
 
UINT WINAPI MsiConfigureProductA (LPCSTR szProduct, int iInstallLevel, INSTALLSTATE eInstallState)
 
UINT WINAPI MsiConfigureProductW (LPCWSTR szProduct, int iInstallLevel, INSTALLSTATE eInstallState)
 
UINT WINAPI MsiGetProductCodeA (LPCSTR szComponent, LPSTR szBuffer)
 
UINT WINAPI MsiGetProductCodeW (LPCWSTR szComponent, LPWSTR szBuffer)
 
static WCHARreg_get_value (HKEY hkey, const WCHAR *name, DWORD *type)
 
static UINT MSI_GetProductInfo (LPCWSTR szProduct, LPCWSTR szAttribute, awstring *szValue, LPDWORD pcchValueBuf)
 
UINT WINAPI MsiGetProductInfoA (LPCSTR szProduct, LPCSTR szAttribute, LPSTR szBuffer, LPDWORD pcchValueBuf)
 
UINT WINAPI MsiGetProductInfoW (LPCWSTR szProduct, LPCWSTR szAttribute, LPWSTR szBuffer, LPDWORD pcchValueBuf)
 
UINT WINAPI MsiGetProductInfoExA (LPCSTR szProductCode, LPCSTR szUserSid, MSIINSTALLCONTEXT dwContext, LPCSTR szProperty, LPSTR szValue, LPDWORD pcchValue)
 
static UINT copy_outval (const WCHAR *val, WCHAR *out, DWORD *size)
 
UINT WINAPI MsiGetProductInfoExW (LPCWSTR szProductCode, LPCWSTR szUserSid, MSIINSTALLCONTEXT dwContext, LPCWSTR szProperty, LPWSTR szValue, LPDWORD pcchValue)
 
UINT WINAPI MsiGetPatchFileListA (LPCSTR szProductCode, LPCSTR szPatchList, LPDWORD pcFiles, MSIHANDLE **pphFileRecords)
 
UINT WINAPI MsiGetPatchFileListW (LPCWSTR szProductCode, LPCWSTR szPatchList, LPDWORD pcFiles, MSIHANDLE **pphFileRecords)
 
UINT WINAPI MsiGetPatchInfoExA (LPCSTR szPatchCode, LPCSTR szProductCode, LPCSTR szUserSid, MSIINSTALLCONTEXT dwContext, LPCSTR szProperty, LPSTR lpValue, DWORD *pcchValue)
 
UINT WINAPI MsiGetPatchInfoExW (LPCWSTR szPatchCode, LPCWSTR szProductCode, LPCWSTR szUserSid, MSIINSTALLCONTEXT dwContext, LPCWSTR szProperty, LPWSTR lpValue, DWORD *pcchValue)
 
UINT WINAPI MsiGetPatchInfoA (LPCSTR patch, LPCSTR attr, LPSTR buffer, LPDWORD buflen)
 
UINT WINAPI MsiGetPatchInfoW (LPCWSTR patch, LPCWSTR attr, LPWSTR buffer, LPDWORD buflen)
 
UINT WINAPI MsiEnableLogA (DWORD dwLogMode, const char *szLogFile, DWORD attributes)
 
UINT WINAPI MsiEnableLogW (DWORD dwLogMode, const WCHAR *szLogFile, DWORD attributes)
 
UINT WINAPI MsiEnumComponentCostsA (MSIHANDLE handle, const char *component, DWORD index, INSTALLSTATE state, char *drive, DWORD *buflen, int *cost, int *temp)
 
static UINT set_drive (WCHAR *buffer, WCHAR letter)
 
UINT WINAPI MsiEnumComponentCostsW (MSIHANDLE handle, const WCHAR *component, DWORD index, INSTALLSTATE state, WCHAR *drive, DWORD *buflen, int *cost, int *temp)
 
UINT WINAPI MsiQueryComponentStateA (LPCSTR szProductCode, LPCSTR szUserSid, MSIINSTALLCONTEXT dwContext, LPCSTR szComponent, INSTALLSTATE *pdwState)
 
static BOOL comp_find_prod_key (const WCHAR *prodcode, MSIINSTALLCONTEXT context)
 
static BOOL comp_find_package (const WCHAR *prodcode, MSIINSTALLCONTEXT context)
 
static UINT comp_find_prodcode (const WCHAR *squashed_pc, MSIINSTALLCONTEXT context, const WCHAR *comp, WCHAR *val, DWORD *sz)
 
UINT WINAPI MsiQueryComponentStateW (LPCWSTR szProductCode, LPCWSTR szUserSid, MSIINSTALLCONTEXT dwContext, LPCWSTR szComponent, INSTALLSTATE *pdwState)
 
INSTALLSTATE WINAPI MsiQueryProductStateA (LPCSTR szProduct)
 
INSTALLSTATE WINAPI MsiQueryProductStateW (LPCWSTR szProduct)
 
INSTALLUILEVEL WINAPI MsiSetInternalUI (INSTALLUILEVEL dwUILevel, HWND *phWnd)
 
INSTALLUI_HANDLERA WINAPI MsiSetExternalUIA (INSTALLUI_HANDLERA puiHandler, DWORD dwMessageFilter, void *pvContext)
 
INSTALLUI_HANDLERW WINAPI MsiSetExternalUIW (INSTALLUI_HANDLERW puiHandler, DWORD dwMessageFilter, void *pvContext)
 
LANGID WINAPI MsiLoadStringW (MSIHANDLE handle, UINT id, WCHAR *lpBuffer, int nBufferMax, LANGID lang)
 
LANGID WINAPI MsiLoadStringA (MSIHANDLE handle, UINT id, LPSTR lpBuffer, int nBufferMax, LANGID lang)
 
INSTALLSTATE WINAPI MsiLocateComponentA (LPCSTR szComponent, LPSTR lpPathBuf, LPDWORD pcchBuf)
 
INSTALLSTATE WINAPI MsiLocateComponentW (LPCWSTR szComponent, LPWSTR lpPathBuf, LPDWORD pcchBuf)
 
UINT WINAPI MsiMessageBoxA (HWND hWnd, const char *lpText, const char *lpCaption, UINT uType, WORD wLanguageId, DWORD f)
 
UINT WINAPI MsiMessageBoxW (HWND hWnd, const WCHAR *lpText, const WCHAR *lpCaption, UINT uType, WORD wLanguageId, DWORD f)
 
UINT WINAPI MsiMessageBoxExA (HWND hWnd, const char *lpText, const char *lpCaption, UINT uType, DWORD unknown, WORD wLanguageId, DWORD f)
 
UINT WINAPI MsiMessageBoxExW (HWND hWnd, const WCHAR *lpText, const WCHAR *lpCaption, UINT uType, DWORD unknown, WORD wLanguageId, DWORD f)
 
UINT WINAPI MsiProvideAssemblyA (const char *szAssemblyName, const char *szAppContext, DWORD dwInstallMode, DWORD dwAssemblyInfo, char *lpPathBuf, DWORD *pcchPathBuf)
 
UINT WINAPI MsiProvideAssemblyW (const WCHAR *szAssemblyName, const WCHAR *szAppContext, DWORD dwInstallMode, DWORD dwAssemblyInfo, WCHAR *lpPathBuf, DWORD *pcchPathBuf)
 
UINT WINAPI MsiProvideComponentFromDescriptorA (LPCSTR szDescriptor, LPSTR szPath, LPDWORD pcchPath, LPDWORD pcchArgs)
 
UINT WINAPI MsiProvideComponentFromDescriptorW (LPCWSTR szDescriptor, LPWSTR szPath, LPDWORD pcchPath, LPDWORD pcchArgs)
 
HRESULT WINAPI MsiGetFileSignatureInformationA (const char *path, DWORD flags, PCCERT_CONTEXT *cert, BYTE *hash, DWORD *hashlen)
 
HRESULT WINAPI MsiGetFileSignatureInformationW (const WCHAR *path, DWORD flags, PCCERT_CONTEXT *cert, BYTE *hash, DWORD *hashlen)
 
UINT WINAPI MsiGetProductPropertyA (MSIHANDLE hProduct, const char *szProperty, char *szValue, DWORD *pccbValue)
 
UINT WINAPI MsiGetProductPropertyW (MSIHANDLE hProduct, const WCHAR *szProperty, WCHAR *szValue, DWORD *pccbValue)
 
UINT WINAPI MsiVerifyPackageA (LPCSTR szPackage)
 
UINT WINAPI MsiVerifyPackageW (LPCWSTR szPackage)
 
static BOOL open_userdata_comp_key (const WCHAR *comp, const WCHAR *usersid, MSIINSTALLCONTEXT ctx, HKEY *hkey)
 
static INSTALLSTATE MSI_GetComponentPath (const WCHAR *szProduct, const WCHAR *szComponent, const WCHAR *szUserSid, MSIINSTALLCONTEXT ctx, awstring *lpPathBuf, DWORD *pcchBuf)
 
INSTALLSTATE WINAPI MsiGetComponentPathExW (LPCWSTR product, LPCWSTR comp, LPCWSTR usersid, MSIINSTALLCONTEXT ctx, LPWSTR buf, LPDWORD buflen)
 
INSTALLSTATE WINAPI MsiGetComponentPathExA (LPCSTR product, LPCSTR comp, LPCSTR usersid, MSIINSTALLCONTEXT ctx, LPSTR buf, LPDWORD buflen)
 
INSTALLSTATE WINAPI MsiGetComponentPathW (LPCWSTR product, LPCWSTR comp, LPWSTR buf, LPDWORD buflen)
 
INSTALLSTATE WINAPI MsiGetComponentPathA (LPCSTR product, LPCSTR comp, LPSTR buf, LPDWORD buflen)
 
static UINT query_feature_state (const WCHAR *product, const WCHAR *squashed, const WCHAR *usersid, MSIINSTALLCONTEXT ctx, const WCHAR *feature, INSTALLSTATE *state)
 
UINT WINAPI MsiQueryFeatureStateExA (LPCSTR product, LPCSTR usersid, MSIINSTALLCONTEXT ctx, LPCSTR feature, INSTALLSTATE *state)
 
UINT WINAPI MsiQueryFeatureStateExW (LPCWSTR product, LPCWSTR usersid, MSIINSTALLCONTEXT ctx, LPCWSTR feature, INSTALLSTATE *state)
 
INSTALLSTATE WINAPI MsiQueryFeatureStateA (LPCSTR szProduct, LPCSTR szFeature)
 
INSTALLSTATE WINAPI MsiQueryFeatureStateW (LPCWSTR szProduct, LPCWSTR szFeature)
 
UINT WINAPI MsiGetFileVersionA (LPCSTR szFilePath, LPSTR lpVersionBuf, LPDWORD pcchVersionBuf, LPSTR lpLangBuf, LPDWORD pcchLangBuf)
 
static UINT get_file_version (const WCHAR *path, WCHAR *verbuf, DWORD *verlen, WCHAR *langbuf, DWORD *langlen)
 
UINT WINAPI MsiGetFileVersionW (const WCHAR *path, WCHAR *verbuf, DWORD *verlen, WCHAR *langbuf, DWORD *langlen)
 
UINT WINAPI MsiGetFeatureUsageW (LPCWSTR szProduct, LPCWSTR szFeature, LPDWORD pdwUseCount, LPWORD pwDateUsed)
 
UINT WINAPI MsiGetFeatureUsageA (LPCSTR szProduct, LPCSTR szFeature, LPDWORD pdwUseCount, LPWORD pwDateUsed)
 
INSTALLSTATE WINAPI MsiUseFeatureExW (const WCHAR *szProduct, const WCHAR *szFeature, DWORD dwInstallMode, DWORD dwReserved)
 
INSTALLSTATE WINAPI MsiUseFeatureExA (const char *szProduct, const char *szFeature, DWORD dwInstallMode, DWORD dwReserved)
 
INSTALLSTATE WINAPI MsiUseFeatureW (LPCWSTR szProduct, LPCWSTR szFeature)
 
INSTALLSTATE WINAPI MsiUseFeatureA (LPCSTR szProduct, LPCSTR szFeature)
 
static WCHARreg_get_multisz (HKEY hkey, const WCHAR *name)
 
static WCHARreg_get_sz (HKEY hkey, const WCHAR *name)
 
static UINT MSI_ProvideQualifiedComponentEx (LPCWSTR szComponent, LPCWSTR szQualifier, DWORD dwInstallMode, LPCWSTR szProduct, DWORD Unused1, DWORD Unused2, awstring *lpPathBuf, LPDWORD pcchPathBuf)
 
UINT WINAPI MsiProvideQualifiedComponentExW (const WCHAR *szComponent, const WCHAR *szQualifier, DWORD dwInstallMode, const WCHAR *szProduct, DWORD Unused1, DWORD Unused2, WCHAR *lpPathBuf, DWORD *pcchPathBuf)
 
UINT WINAPI MsiProvideQualifiedComponentExA (const char *szComponent, const char *szQualifier, DWORD dwInstallMode, const char *szProduct, DWORD Unused1, DWORD Unused2, char *lpPathBuf, DWORD *pcchPathBuf)
 
UINT WINAPI MsiProvideQualifiedComponentW (LPCWSTR szComponent, LPCWSTR szQualifier, DWORD dwInstallMode, LPWSTR lpPathBuf, LPDWORD pcchPathBuf)
 
UINT WINAPI MsiProvideQualifiedComponentA (LPCSTR szComponent, LPCSTR szQualifier, DWORD dwInstallMode, LPSTR lpPathBuf, LPDWORD pcchPathBuf)
 
static USERINFOSTATE MSI_GetUserInfo (LPCWSTR szProduct, awstring *lpUserNameBuf, LPDWORD pcchUserNameBuf, awstring *lpOrgNameBuf, LPDWORD pcchOrgNameBuf, awstring *lpSerialBuf, LPDWORD pcchSerialBuf)
 
USERINFOSTATE WINAPI MsiGetUserInfoW (LPCWSTR szProduct, LPWSTR lpUserNameBuf, LPDWORD pcchUserNameBuf, LPWSTR lpOrgNameBuf, LPDWORD pcchOrgNameBuf, LPWSTR lpSerialBuf, LPDWORD pcchSerialBuf)
 
USERINFOSTATE WINAPI MsiGetUserInfoA (LPCSTR szProduct, LPSTR lpUserNameBuf, LPDWORD pcchUserNameBuf, LPSTR lpOrgNameBuf, LPDWORD pcchOrgNameBuf, LPSTR lpSerialBuf, LPDWORD pcchSerialBuf)
 
UINT WINAPI MsiCollectUserInfoW (LPCWSTR szProduct)
 
UINT WINAPI MsiCollectUserInfoA (LPCSTR szProduct)
 
UINT WINAPI MsiConfigureFeatureA (LPCSTR szProduct, LPCSTR szFeature, INSTALLSTATE eInstallState)
 
UINT WINAPI MsiConfigureFeatureW (LPCWSTR szProduct, LPCWSTR szFeature, INSTALLSTATE eInstallState)
 
UINT WINAPI MsiCreateAndVerifyInstallerDirectory (DWORD dwReserved)
 
UINT WINAPI MsiGetShortcutTargetA (LPCSTR szShortcutTarget, LPSTR szProductCode, LPSTR szFeatureId, LPSTR szComponentCode)
 
UINT WINAPI MsiGetShortcutTargetW (LPCWSTR szShortcutTarget, LPWSTR szProductCode, LPWSTR szFeatureId, LPWSTR szComponentCode)
 
UINT WINAPI MsiReinstallFeatureW (const WCHAR *szProduct, const WCHAR *szFeature, DWORD dwReinstallMode)
 
UINT WINAPI MsiReinstallFeatureA (const char *szProduct, const char *szFeature, DWORD dwReinstallMode)
 
void WINAPI MD5Init (struct md5_ctx *)
 
void WINAPI MD5Update (struct md5_ctx *, const unsigned char *, unsigned int)
 
void WINAPI MD5Final (struct md5_ctx *)
 
UINT msi_get_filehash (MSIPACKAGE *package, const WCHAR *path, MSIFILEHASHINFO *hash)
 
UINT WINAPI MsiGetFileHashW (const WCHAR *szFilePath, DWORD dwOptions, MSIFILEHASHINFO *pHash)
 
UINT WINAPI MsiGetFileHashA (const char *szFilePath, DWORD dwOptions, MSIFILEHASHINFO *pHash)
 
UINT WINAPI MsiAdvertiseScriptW (const WCHAR *szScriptFile, DWORD dwFlags, HKEY *phRegData, BOOL fRemoveItems)
 
UINT WINAPI MsiAdvertiseScriptA (const char *szScriptFile, DWORD dwFlags, HKEY *phRegData, BOOL fRemoveItems)
 
UINT WINAPI MsiIsProductElevatedW (LPCWSTR szProduct, BOOL *pfElevated)
 
UINT WINAPI MsiIsProductElevatedA (LPCSTR szProduct, BOOL *pfElevated)
 
UINT WINAPI MsiSetExternalUIRecord (INSTALLUI_HANDLER_RECORD handler, DWORD filter, void *context, INSTALLUI_HANDLER_RECORD *prev)
 
UINT WINAPI MsiInstallMissingComponentA (LPCSTR product, LPCSTR component, INSTALLSTATE state)
 
UINT WINAPI MsiInstallMissingComponentW (LPCWSTR szProduct, LPCWSTR szComponent, INSTALLSTATE eInstallState)
 
UINT WINAPI MsiProvideComponentA (const char *product, const char *feature, const char *component, DWORD mode, char *buf, DWORD *buflen)
 
UINT WINAPI MsiProvideComponentW (const WCHAR *product, const WCHAR *feature, const WCHAR *component, DWORD mode, WCHAR *buf, DWORD *buflen)
 
UINT WINAPI MsiBeginTransactionA (const char *name, DWORD attrs, MSIHANDLE *id, HANDLE *event)
 
UINT WINAPI MsiBeginTransactionW (const WCHAR *name, DWORD attrs, MSIHANDLE *id, HANDLE *event)
 
UINT WINAPI MsiJoinTransaction (MSIHANDLE handle, DWORD attrs, HANDLE *event)
 
UINT WINAPI MsiEndTransaction (DWORD state)
 
UINT WINAPI Migrate10CachedPackagesW (void *a, void *b, void *c, DWORD d)
 
UINT WINAPI MsiRemovePatchesA (LPCSTR patchlist, LPCSTR product, INSTALLTYPE type, LPCSTR propertylist)
 
UINT WINAPI MsiRemovePatchesW (LPCWSTR patchlist, LPCWSTR product, INSTALLTYPE type, LPCWSTR propertylist)
 

Variables

BOOL is_wow64
 

Macro Definition Documentation

◆ BASE85_SIZE

#define BASE85_SIZE   20

Definition at line 3362 of file msi.c.

◆ COBJMACROS

#define COBJMACROS

Definition at line 23 of file msi.c.

Function Documentation

◆ comp_find_package()

static BOOL comp_find_package ( const WCHAR prodcode,
MSIINSTALLCONTEXT  context 
)
static

Definition at line 2093 of file msi.c.

2094{
2095 LPCWSTR package;
2096 HKEY hkey;
2097 DWORD sz;
2098 LONG res;
2099 UINT r;
2100
2101 r = MSIREG_OpenInstallProps(prodcode, context, NULL, &hkey, FALSE);
2102 if (r != ERROR_SUCCESS)
2103 return FALSE;
2104
2106 package = L"ManagedLocalPackage";
2107 else
2108 package = L"LocalPackage";
2109
2110 sz = 0;
2111 res = RegQueryValueExW(hkey, package, NULL, NULL, NULL, &sz);
2112 RegCloseKey(hkey);
2113
2114 return (res == ERROR_SUCCESS);
2115}
#define RegCloseKey(hKey)
Definition: registry.h:49
#define ERROR_SUCCESS
Definition: deptool.c:10
#define NULL
Definition: types.h:112
#define FALSE
Definition: types.h:117
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
unsigned long DWORD
Definition: ntddk_ex.h:95
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
GLuint res
Definition: glext.h:9613
@ MSIINSTALLCONTEXT_USERMANAGED
Definition: msi.h:198
UINT MSIREG_OpenInstallProps(LPCWSTR szProduct, MSIINSTALLCONTEXT dwContext, LPCWSTR szUserSid, HKEY *key, BOOL create)
Definition: registry.c:692
unsigned int UINT
Definition: ndis.h:50
long LONG
Definition: pedump.c:60
Definition: http.c:7252
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185

Referenced by MsiQueryComponentStateW().

◆ comp_find_prod_key()

static BOOL comp_find_prod_key ( const WCHAR prodcode,
MSIINSTALLCONTEXT  context 
)
static

Definition at line 2083 of file msi.c.

2084{
2085 UINT r;
2086 HKEY hkey = NULL;
2087
2088 r = MSIREG_OpenProductKey(prodcode, NULL, context, &hkey, FALSE);
2089 RegCloseKey(hkey);
2090 return (r == ERROR_SUCCESS);
2091}
UINT MSIREG_OpenProductKey(LPCWSTR szProduct, LPCWSTR szUserSid, MSIINSTALLCONTEXT context, HKEY *key, BOOL create)
Definition: registry.c:338

Referenced by MsiQueryComponentStateW().

◆ comp_find_prodcode()

static UINT comp_find_prodcode ( const WCHAR squashed_pc,
MSIINSTALLCONTEXT  context,
const WCHAR comp,
WCHAR val,
DWORD sz 
)
static

Definition at line 2117 of file msi.c.

2119{
2120 HKEY hkey;
2121 LONG res;
2122 UINT r;
2123
2125 r = MSIREG_OpenUserDataComponentKey(comp, L"S-1-5-18", &hkey, FALSE);
2126 else
2128
2129 if (r != ERROR_SUCCESS)
2130 return r;
2131
2132 res = RegQueryValueExW( hkey, squashed_pc, NULL, NULL, (BYTE *)val, sz );
2133 if (res != ERROR_SUCCESS)
2134 return res;
2135
2136 RegCloseKey(hkey);
2137 return res;
2138}
GLuint GLfloat * val
Definition: glext.h:7180
@ MSIINSTALLCONTEXT_MACHINE
Definition: msi.h:200
UINT MSIREG_OpenUserDataComponentKey(LPCWSTR szComponent, LPCWSTR szUserSid, HKEY *key, BOOL create)
Definition: registry.c:526
#define L(x)
Definition: ntvdm.h:50
unsigned char BYTE
Definition: xxhash.c:193

Referenced by MsiQueryComponentStateW().

◆ copy_outval()

static UINT copy_outval ( const WCHAR val,
WCHAR out,
DWORD size 
)
static

Definition at line 1366 of file msi.c.

1367{
1369
1370 if (!val)
1372
1373 if (out)
1374 {
1375 if (lstrlenW(val) >= *size)
1376 {
1378 if (*size > 0)
1379 *out = '\0';
1380 }
1381 else
1382 lstrcpyW(out, val);
1383 }
1384
1385 if (size)
1386 *size = lstrlenW(val);
1387
1388 return r;
1389}
#define ERROR_MORE_DATA
Definition: dderror.h:13
#define lstrcpyW
Definition: compat.h:749
#define lstrlenW
Definition: compat.h:750
GLsizeiptr size
Definition: glext.h:5919
static FILE * out
Definition: regtests2xml.c:44
#define ERROR_UNKNOWN_PROPERTY
Definition: winerror.h:966

Referenced by MsiGetProductInfoExW().

◆ determine_patch_sequence()

static UINT determine_patch_sequence ( MSIPACKAGE package,
DWORD  count,
MSIPATCHSEQUENCEINFOW info 
)
static

Definition at line 631 of file msi.c.

632{
634 DWORD i;
635
636 if (count > 1)
637 FIXME("patch ordering not supported\n");
638
639 for (i = 0; i < count; i++)
640 {
641 switch (info[i].ePatchDataType)
642 {
644 {
645 if (MSI_ApplicablePatchW( package, info[i].szPatchData ) != ERROR_SUCCESS)
646 {
647 info[i].dwOrder = ~0u;
649 }
650 else
651 {
652 info[i].dwOrder = i;
653 info[i].uStatus = ERROR_SUCCESS;
654 }
655 break;
656 }
659 {
661 HRESULT hr;
662 BSTR s;
663
664 if (!desc)
665 {
666 hr = CoCreateInstance( &CLSID_DOMDocument30, NULL, CLSCTX_INPROC_SERVER,
667 &IID_IXMLDOMDocument, (void**)&desc );
668 if (hr != S_OK)
669 {
670 ERR( "failed to create DOMDocument30 instance, %#lx\n", hr );
672 }
673 }
674
675 s = SysAllocString( info[i].szPatchData );
676 if (info[i].ePatchDataType == MSIPATCH_DATATYPE_XMLPATH)
677 {
678 VARIANT src;
679
680 V_VT(&src) = VT_BSTR;
681 V_BSTR(&src) = s;
682 hr = IXMLDOMDocument_load( desc, src, &b );
683 }
684 else
685 hr = IXMLDOMDocument_loadXML( desc, s, &b );
686 SysFreeString( s );
687 if ( hr != S_OK )
688 {
689 ERR("failed to parse patch description\n");
690 IXMLDOMDocument_Release( desc );
691 break;
692 }
693
694 if (MSI_ApplicablePatchXML( package, desc ) != ERROR_SUCCESS)
695 {
696 info[i].dwOrder = ~0u;
698 }
699 else
700 {
701 info[i].dwOrder = i;
702 info[i].uStatus = ERROR_SUCCESS;
703 }
704 break;
705 }
706 default:
707 {
708 FIXME("unknown patch data type %u\n", info[i].ePatchDataType);
709 info[i].dwOrder = i;
710 info[i].uStatus = ERROR_SUCCESS;
711 break;
712 }
713 }
714
715 TRACE("szPatchData: %s\n", debugstr_w(info[i].szPatchData));
716 TRACE("ePatchDataType: %u\n", info[i].ePatchDataType);
717 TRACE("dwOrder: %lu\n", info[i].dwOrder);
718 TRACE("uStatus: %u\n", info[i].uStatus);
719 }
720
721 if (desc) IXMLDOMDocument_Release( desc );
722
723 return ERROR_SUCCESS;
724}
#define FIXME(fmt,...)
Definition: precomp.h:53
#define ERR(fmt,...)
Definition: precomp.h:57
OLECHAR * BSTR
Definition: compat.h:2293
short VARIANT_BOOL
Definition: compat.h:2290
@ VT_BSTR
Definition: compat.h:2303
static UINT MSI_ApplicablePatchXML(MSIPACKAGE *package, IXMLDOMDocument *desc)
Definition: msi.c:589
static UINT MSI_ApplicablePatchW(MSIPACKAGE *package, LPCWSTR patch)
Definition: msi.c:559
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
Definition: compobj.c:3325
GLdouble s
Definition: gl.h:2039
GLuint GLuint GLsizei count
Definition: gl.h:1545
GLenum src
Definition: glext.h:6340
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
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
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
#define S_OK
Definition: intsafe.h:52
#define b
Definition: ke_i.h:79
#define debugstr_w
Definition: kernel32.h:32
static const WCHAR desc[]
Definition: protectdata.c:36
@ MSIPATCH_DATATYPE_XMLPATH
Definition: msi.h:237
@ MSIPATCH_DATATYPE_PATCHFILE
Definition: msi.h:236
@ MSIPATCH_DATATYPE_XMLBLOB
Definition: msi.h:238
#define ERROR_PATCH_TARGET_NOT_FOUND
Definition: msi.h:259
BSTR WINAPI SysAllocString(LPCOLESTR str)
Definition: oleaut.c:238
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
Definition: oleaut.c:271
#define V_VT(A)
Definition: oleauto.h:211
#define V_BSTR(A)
Definition: oleauto.h:226
HRESULT hr
Definition: shlfolder.c:183
#define TRACE(s)
Definition: solgame.cpp:4
#define ERROR_FUNCTION_FAILED
Definition: winerror.h:985

Referenced by MsiDetermineApplicablePatchesW(), and MsiDeterminePatchSequenceW().

◆ free_patchinfo()

static void free_patchinfo ( DWORD  count,
MSIPATCHSEQUENCEINFOW info 
)
static

Definition at line 501 of file msi.c.

502{
503 DWORD i;
504 for (i = 0; i < count; i++) free( (WCHAR *)info[i].szPatchData );
505 free( info );
506}
#define free
Definition: debug_ros.c:5
__wchar_t WCHAR
Definition: xmlstorage.h:180

Referenced by MsiDetermineApplicablePatchesA(), MsiDeterminePatchSequenceA(), and patchinfoAtoW().

◆ get_file_version()

static UINT get_file_version ( const WCHAR path,
WCHAR verbuf,
DWORD verlen,
WCHAR langbuf,
DWORD langlen 
)
static

Definition at line 3137 of file msi.c.

3139{
3141 UINT len;
3142 DWORD error;
3144 VS_FIXEDFILEINFO *ffi;
3145 USHORT *lang;
3146 WCHAR tmp[32];
3147
3148 if (!(len = GetFileVersionInfoSizeW( path, NULL )))
3149 {
3150 error = GetLastError();
3153 return error;
3154 }
3155 if (!(version = malloc( len ))) return ERROR_OUTOFMEMORY;
3156 if (!GetFileVersionInfoW( path, 0, len, version ))
3157 {
3158 free( version );
3159 return GetLastError();
3160 }
3161 if (!verbuf && !verlen && !langbuf && !langlen)
3162 {
3163 free( version );
3164 return ERROR_SUCCESS;
3165 }
3166 if (verlen)
3167 {
3168 if (VerQueryValueW( version, L"\\", (LPVOID *)&ffi, &len ) && len > 0)
3169 {
3170 swprintf( tmp, ARRAY_SIZE(tmp), L"%d.%d.%d.%d",
3171 HIWORD(ffi->dwFileVersionMS), LOWORD(ffi->dwFileVersionMS),
3172 HIWORD(ffi->dwFileVersionLS), LOWORD(ffi->dwFileVersionLS) );
3173 if (verbuf) lstrcpynW( verbuf, tmp, *verlen );
3174 len = lstrlenW( tmp );
3175 if (*verlen > len) ret = ERROR_SUCCESS;
3176 *verlen = len;
3177 }
3178 else
3179 {
3180 if (verbuf) *verbuf = 0;
3181 *verlen = 0;
3182 }
3183 }
3184 if (langlen)
3185 {
3186 if (VerQueryValueW( version, L"\\VarFileInfo\\Translation", (LPVOID *)&lang, &len ) && len > 0)
3187 {
3188 swprintf( tmp, ARRAY_SIZE(tmp), L"%d", *lang );
3189 if (langbuf) lstrcpynW( langbuf, tmp, *langlen );
3190 len = lstrlenW( tmp );
3191 if (*langlen > len) ret = ERROR_SUCCESS;
3192 *langlen = len;
3193 }
3194 else
3195 {
3196 if (langbuf) *langbuf = 0;
3197 *langlen = 0;
3198 }
3199 }
3200 free( version );
3201 return ret;
3202}
#define ARRAY_SIZE(A)
Definition: main.h:20
#define malloc
Definition: debug_ros.c:4
#define ERROR_OUTOFMEMORY
Definition: deptool.c:13
#define lstrcpynW
Definition: compat.h:738
static const WCHAR version[]
Definition: asmname.c:66
BOOL WINAPI GetFileVersionInfoW(LPCWSTR filename, DWORD handle, DWORD datasize, LPVOID data)
Definition: version.c:845
BOOL WINAPI VerQueryValueW(LPCVOID pBlock, LPCWSTR lpSubBlock, LPVOID *lplpBuffer, PUINT puLen)
Definition: version.c:1057
DWORD WINAPI GetFileVersionInfoSizeW(LPCWSTR filename, LPDWORD handle)
Definition: version.c:611
#define swprintf
Definition: precomp.h:40
GLenum GLsizei len
Definition: glext.h:6722
#define error(str)
Definition: mkdosfs.c:1605
#define ERROR_FILE_NOT_FOUND
Definition: disk.h:79
#define LOWORD(l)
Definition: pedump.c:82
unsigned short USHORT
Definition: pedump.c:61
#define HIWORD(l)
Definition: typedefs.h:247
static const WCHAR lang[]
Definition: wbemdisp.c:287
int ret
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
#define ERROR_BAD_PATHNAME
Definition: winerror.h:233
#define ERROR_FILE_INVALID
Definition: winerror.h:585
#define ERROR_RESOURCE_DATA_NOT_FOUND
Definition: winerror.h:1119

Referenced by MsiGetFileVersionW().

◆ get_patch_product_codes()

static UINT get_patch_product_codes ( LPCWSTR  szPatchPackage,
WCHAR ***  product_codes 
)
static

Definition at line 316 of file msi.c.

317{
318 MSIHANDLE patch, info = 0;
319 UINT r, type;
320 DWORD size;
321 static WCHAR empty[] = L"";
322 WCHAR *codes = NULL;
323
324 r = MsiOpenDatabaseW( szPatchPackage, MSIDBOPEN_READONLY, &patch );
325 if (r != ERROR_SUCCESS)
326 return r;
327
328 r = MsiGetSummaryInformationW( patch, NULL, 0, &info );
329 if (r != ERROR_SUCCESS)
330 goto done;
331
332 size = 0;
334 if (r != ERROR_MORE_DATA || !size || type != VT_LPSTR)
335 {
336 ERR("Failed to read product codes from patch\n");
338 goto done;
339 }
340
341 codes = malloc( ++size * sizeof(WCHAR) );
342 if (!codes)
343 {
345 goto done;
346 }
347
349 if (r == ERROR_SUCCESS)
350 *product_codes = msi_split_string( codes, ';' );
351
352done:
354 MsiCloseHandle( patch );
355 free( codes );
356 return r;
357}
static const WCHAR empty[]
Definition: main.c:47
@ VT_LPSTR
Definition: compat.h:2324
WCHAR ** msi_split_string(const WCHAR *str, WCHAR sep)
Definition: action.c:304
UINT WINAPI MsiOpenDatabaseW(LPCWSTR szDBPath, LPCWSTR szPersist, MSIHANDLE *phDB)
Definition: database.c:298
UINT WINAPI MsiCloseHandle(MSIHANDLE handle)
Definition: handle.c:269
UINT WINAPI MsiGetSummaryInformationW(MSIHANDLE hDatabase, const WCHAR *szDatabase, UINT uiUpdateCount, MSIHANDLE *pHandle)
Definition: suminfo.c:519
UINT WINAPI MsiSummaryInfoGetPropertyW(MSIHANDLE handle, UINT uiProperty, UINT *puiDataType, INT *piValue, FILETIME *pftValue, WCHAR *szValueBuf, DWORD *pcchValueBuf)
Definition: suminfo.c:793
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
#define PID_TEMPLATE
Definition: suminfo.c:49
#define MSIDBOPEN_READONLY
Definition: msiquery.h:66
unsigned long MSIHANDLE
Definition: winemsi.idl:27

Referenced by MSI_ApplyPatchW().

◆ MD5Final()

◆ MD5Init()

◆ MD5Update()

◆ Migrate10CachedPackagesW()

UINT WINAPI Migrate10CachedPackagesW ( void a,
void b,
void c,
DWORD  d 
)

Definition at line 4340 of file msi.c.

4341{
4342 FIXME( "%p, %p, %p, %#lx\n", a, b, c, d );
4343 return ERROR_SUCCESS;
4344}
const GLubyte * c
Definition: glext.h:8905
GLboolean GLboolean GLboolean GLboolean a
Definition: glext.h:6204
#define d
Definition: ke_i.h:81

◆ MSI_ApplicablePatchW()

static UINT MSI_ApplicablePatchW ( MSIPACKAGE package,
LPCWSTR  patch 
)
static

Definition at line 559 of file msi.c.

560{
561 MSISUMMARYINFO *si;
562 MSIDATABASE *patch_db;
563 UINT r;
564
565 r = MSI_OpenDatabaseW( patch, MSIDBOPEN_READONLY, &patch_db );
566 if (r != ERROR_SUCCESS)
567 {
568 WARN("failed to open patch file %s\n", debugstr_w(patch));
569 return r;
570 }
571
572 r = msi_get_suminfo( patch_db->storage, 0, &si );
573 if (r != ERROR_SUCCESS)
574 {
575 msiobj_release( &patch_db->hdr );
577 }
578
579 r = msi_check_patch_applicable( package, si );
580 if (r != ERROR_SUCCESS)
581 TRACE("patch not applicable\n");
582
583 msiobj_release( &patch_db->hdr );
584 msiobj_release( &si->hdr );
585 return r;
586}
#define WARN(fmt,...)
Definition: precomp.h:61
UINT MSI_OpenDatabaseW(LPCWSTR szDBPath, LPCWSTR szPersist, MSIDATABASE **pdb)
Definition: database.c:140
int msiobj_release(MSIOBJECTHDR *info)
Definition: handle.c:241
UINT msi_check_patch_applicable(MSIPACKAGE *package, MSISUMMARYINFO *si)
Definition: patch.c:294
UINT msi_get_suminfo(IStorage *stg, UINT uiUpdateCount, MSISUMMARYINFO **si)
Definition: suminfo.c:462
MSIOBJECTHDR hdr
Definition: msipriv.h:108
IStorage * storage
Definition: msipriv.h:109
MSIOBJECTHDR hdr
Definition: msipriv.h:486

Referenced by determine_patch_sequence().

◆ MSI_ApplicablePatchXML()

static UINT MSI_ApplicablePatchXML ( MSIPACKAGE package,
IXMLDOMDocument desc 
)
static

Definition at line 589 of file msi.c.

590{
593 LPWSTR product_code;
595 HRESULT hr;
596 BSTR s;
597
598 product_code = msi_dup_property( package->db, L"ProductCode" );
599 if (!product_code)
600 {
601 /* FIXME: the property ProductCode should be written into the DB somewhere */
602 ERR("no product code to check\n");
603 return ERROR_SUCCESS;
604 }
605
606 s = SysAllocString( L"MsiPatch/TargetProduct/TargetProductCode" );
607 hr = IXMLDOMDocument_selectNodes( desc, s, &list );
609 if (hr != S_OK)
611
612 while (IXMLDOMNodeList_nextNode( list, &node ) == S_OK && r != ERROR_SUCCESS)
613 {
614 hr = IXMLDOMNode_get_text( node, &s );
615 IXMLDOMNode_Release( node );
616 if (hr == S_OK)
617 {
618 if (!wcscmp( s, product_code )) r = ERROR_SUCCESS;
619 SysFreeString( s );
620 }
621 }
622 IXMLDOMNodeList_Release( list );
623
624 if (r != ERROR_SUCCESS)
625 TRACE("patch not applicable\n");
626
627 free( product_code );
628 return r;
629}
Definition: list.h:37
WCHAR * msi_dup_property(MSIDATABASE *db, const WCHAR *prop)
#define list
Definition: rosglue.h:35
_Check_return_ _CRTIMP int __cdecl wcscmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
MSIDATABASE * db
Definition: msipriv.h:394
Definition: dlist.c:348
#define ERROR_INVALID_PATCH_XML
Definition: winerror.h:1008
WCHAR * LPWSTR
Definition: xmlstorage.h:184

Referenced by determine_patch_sequence().

◆ MSI_ApplyPatchW()

static UINT MSI_ApplyPatchW ( LPCWSTR  szPatchPackage,
LPCWSTR  szProductCode,
LPCWSTR  szCommandLine 
)
static

Definition at line 359 of file msi.c.

360{
362 DWORD size;
363 LPCWSTR cmd_ptr = szCommandLine;
364 LPWSTR cmd, *codes = NULL;
365 BOOL succeeded = FALSE;
366
367 if (!szPatchPackage || !szPatchPackage[0])
369
370 if (!szProductCode && (r = get_patch_product_codes( szPatchPackage, &codes )))
371 return r;
372
373 if (!szCommandLine)
374 cmd_ptr = L"";
375
376 size = lstrlenW(cmd_ptr) + lstrlenW(L"%s PATCH=\"%s\"") + lstrlenW(szPatchPackage) + 1;
377 cmd = malloc(size * sizeof(WCHAR));
378 if (!cmd)
379 {
380 free(codes);
381 return ERROR_OUTOFMEMORY;
382 }
383 swprintf(cmd, size, L"%s PATCH=\"%s\"", cmd_ptr, szPatchPackage);
384
385 if (szProductCode)
387 else
388 {
389 for (i = 0; codes[i]; i++)
390 {
392 if (r == ERROR_SUCCESS)
393 {
394 TRACE("patch applied\n");
395 succeeded = TRUE;
396 }
397 }
398
399 if (succeeded)
401 }
402
403 free(cmd);
404 free(codes);
405 return r;
406}
#define TRUE
Definition: types.h:120
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
UINT WINAPI MsiConfigureProductExW(LPCWSTR szProduct, int iInstallLevel, INSTALLSTATE eInstallState, LPCWSTR szCommandLine)
Definition: msi.c:831
static UINT get_patch_product_codes(LPCWSTR szPatchPackage, WCHAR ***product_codes)
Definition: msi.c:316
unsigned int BOOL
Definition: ntddk_ex.h:94
@ INSTALLSTATE_DEFAULT
Definition: msi.h:48
@ INSTALLLEVEL_DEFAULT
Definition: msi.h:87
Definition: ftp_var.h:139

Referenced by MsiApplyMultiplePatchesW(), and MsiApplyPatchW().

◆ 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 CloseHandle
Definition: compat.h:739
#define PAGE_READONLY
Definition: compat.h:138
#define UnmapViewOfFile
Definition: compat.h:746
#define OPEN_EXISTING
Definition: compat.h:775
#define INVALID_HANDLE_VALUE
Definition: compat.h:731
#define CreateFileMappingW(a, b, c, d, e, f)
Definition: compat.h:744
#define GENERIC_READ
Definition: compat.h:135
#define CreateFileW
Definition: compat.h:741
#define FILE_MAP_READ
Definition: compat.h:776
#define MapViewOfFile
Definition: compat.h:745
#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
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
GLfloat GLfloat p
Definition: glext.h:8902
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define FILE_SHARE_DELETE
Definition: nt_native.h:682
#define memset(x, y, z)
Definition: compat.h:39
Definition: _hash_fun.h:40
Definition: msi.c:4007

Referenced by file_hash_matches(), and MsiGetFileHashW().

◆ MSI_GetComponentPath()

static INSTALLSTATE MSI_GetComponentPath ( const WCHAR szProduct,
const WCHAR szComponent,
const WCHAR szUserSid,
MSIINSTALLCONTEXT  ctx,
awstring lpPathBuf,
DWORD pcchBuf 
)
static

Definition at line 2771 of file msi.c.

2774{
2775 WCHAR *path = NULL, squashed_pc[SQUASHED_GUID_SIZE], squashed_comp[SQUASHED_GUID_SIZE];
2776 HKEY hkey;
2778 DWORD version;
2779
2780 if (!szProduct || !szComponent)
2782
2783 if (lpPathBuf->str.w && !pcchBuf)
2785
2786 if (!squash_guid( szProduct, squashed_pc ) || !squash_guid( szComponent, squashed_comp ))
2788
2789 if (szUserSid && ctx == MSIINSTALLCONTEXT_MACHINE)
2791
2793
2794 if (open_userdata_comp_key( szComponent, szUserSid, ctx, &hkey ))
2795 {
2796 path = msi_reg_get_val_str( hkey, squashed_pc );
2797 RegCloseKey(hkey);
2798
2800
2801 if ((!MSIREG_OpenInstallProps(szProduct, MSIINSTALLCONTEXT_MACHINE, NULL, &hkey, FALSE) ||
2803 msi_reg_get_val_dword(hkey, L"WindowsInstaller", &version) &&
2805 {
2806 RegCloseKey(hkey);
2808 }
2809 }
2810
2811 if (state != INSTALLSTATE_LOCAL &&
2814 {
2815 RegCloseKey(hkey);
2816
2817 if (open_userdata_comp_key( szComponent, szUserSid, ctx, &hkey ))
2818 {
2819 free(path);
2820 path = msi_reg_get_val_str( hkey, squashed_pc );
2821 RegCloseKey(hkey);
2822
2824
2827 }
2828 }
2829
2830 if (!path)
2831 return INSTALLSTATE_UNKNOWN;
2832
2833 if (state == INSTALLSTATE_LOCAL && !*path)
2835
2836 if (msi_strcpy_to_awstring(path, -1, lpPathBuf, pcchBuf) == ERROR_MORE_DATA)
2838
2839 free(path);
2840 return state;
2841}
static int state
Definition: maze.c:121
DWORD WINAPI GetFileAttributesW(LPCWSTR lpFileName)
Definition: fileinfo.c:652
UINT msi_strcpy_to_awstring(const WCHAR *str, int len, awstring *awbuf, DWORD *sz)
Definition: install.c:158
static BOOL open_userdata_comp_key(const WCHAR *comp, const WCHAR *usersid, MSIINSTALLCONTEXT ctx, HKEY *hkey)
Definition: msi.c:2752
@ INSTALLSTATE_UNKNOWN
Definition: msi.h:42
@ INSTALLSTATE_LOCAL
Definition: msi.h:46
@ INSTALLSTATE_ABSENT
Definition: msi.h:45
@ INSTALLSTATE_NOTUSED
Definition: msi.h:36
@ INSTALLSTATE_INVALIDARG
Definition: msi.h:41
@ INSTALLSTATE_MOREDATA
Definition: msi.h:40
@ MSIINSTALLCONTEXT_USERUNMANAGED
Definition: msi.h:199
BOOL squash_guid(LPCWSTR in, LPWSTR out)
Definition: registry.c:74
BOOL msi_reg_get_val_dword(HKEY hkey, LPCWSTR name, DWORD *val)
Definition: registry.c:262
UINT MSIREG_OpenUserDataProductKey(LPCWSTR szProduct, MSIINSTALLCONTEXT dwContext, LPCWSTR szUserSid, HKEY *key, BOOL create)
Definition: registry.c:582
WCHAR * msi_reg_get_val_str(HKEY hkey, const WCHAR *name)
#define SQUASHED_GUID_SIZE
Definition: msipriv.h:734
LPWSTR w
Definition: msipriv.h:743
union awstring::@501 str
#define INVALID_FILE_ATTRIBUTES
Definition: vfdcmd.c:23
int INSTALLSTATE
Definition: winemsi.idl:31

Referenced by MSI_ProvideQualifiedComponentEx(), MsiGetComponentPathExA(), and MsiGetComponentPathExW().

◆ MSI_GetProductInfo()

static UINT MSI_GetProductInfo ( LPCWSTR  szProduct,
LPCWSTR  szAttribute,
awstring szValue,
LPDWORD  pcchValueBuf 
)
static

Definition at line 1088 of file msi.c.

1090{
1091 static WCHAR empty[] = L"";
1094 HKEY prodkey, userdata, source;
1095 WCHAR *val = NULL, squashed_pc[SQUASHED_GUID_SIZE], packagecode[GUID_SIZE];
1096 BOOL badconfig = FALSE;
1097 LONG res;
1099
1100 TRACE("%s %s %p %p\n", debugstr_w(szProduct),
1101 debugstr_w(szAttribute), szValue, pcchValueBuf);
1102
1103 if ((szValue->str.w && !pcchValueBuf) || !szProduct || !szAttribute)
1105
1106 if (!squash_guid( szProduct, squashed_pc ))
1108
1109 if ((r = MSIREG_OpenProductKey(szProduct, NULL,
1111 &prodkey, FALSE)) != ERROR_SUCCESS &&
1112 (r = MSIREG_OpenProductKey(szProduct, NULL,
1114 &prodkey, FALSE)) != ERROR_SUCCESS &&
1115 (r = MSIREG_OpenProductKey(szProduct, NULL,
1117 &prodkey, FALSE)) == ERROR_SUCCESS)
1118 {
1120 }
1121
1138 {
1139 if (!prodkey)
1140 {
1142 goto done;
1143 }
1144 if (MSIREG_OpenInstallProps(szProduct, context, NULL, &userdata, FALSE))
1145 {
1147 goto done;
1148 }
1149
1151 szAttribute = L"DisplayName";
1153 szAttribute = L"DisplayVersion";
1154
1155 val = reg_get_value(userdata, szAttribute, &type);
1156 if (!val)
1157 val = empty;
1158 RegCloseKey(userdata);
1159 }
1170 {
1171 if (!prodkey)
1172 {
1174 goto done;
1175 }
1176
1178 szAttribute = L"Assignment";
1179
1181 {
1182 res = RegOpenKeyW(prodkey, L"SourceList", &source);
1183 if (res != ERROR_SUCCESS)
1184 {
1186 goto done;
1187 }
1188
1190 if (!val)
1191 val = empty;
1192
1194 }
1195 else
1196 {
1197 val = reg_get_value(prodkey, szAttribute, &type);
1198 if (!val)
1199 val = empty;
1200 }
1201
1202 if (val != empty && type != REG_DWORD &&
1204 {
1205 if (lstrlenW( val ) != SQUASHED_GUID_SIZE - 1)
1206 badconfig = TRUE;
1207 else
1208 {
1209 unsquash_guid(val, packagecode);
1210 free(val);
1211 val = wcsdup(packagecode);
1212 }
1213 }
1214 }
1215
1216 if (!val)
1217 {
1219 goto done;
1220 }
1221
1222 if (pcchValueBuf)
1223 {
1224 int len = lstrlenW( val );
1225
1226 /* If szBuffer (szValue->str) is NULL, there's no need to copy the value
1227 * out. Also, *pcchValueBuf may be uninitialized in this case, so we
1228 * can't rely on its value.
1229 */
1230 if (szValue->str.a || szValue->str.w)
1231 {
1232 DWORD size = *pcchValueBuf;
1233 if (len < size)
1234 r = msi_strcpy_to_awstring( val, len, szValue, &size );
1235 else
1237 }
1238
1239 if (!badconfig)
1240 *pcchValueBuf = len;
1241 }
1242
1243 if (badconfig)
1245
1246 if (val != empty)
1247 free(val);
1248
1249done:
1250 RegCloseKey(prodkey);
1251 return r;
1252}
LONG WINAPI RegOpenKeyW(HKEY hKey, LPCWSTR lpSubKey, PHKEY phkResult)
Definition: reg.c:3268
static WCHAR * reg_get_value(HKEY hkey, const WCHAR *name, DWORD *type)
Definition: msi.c:1067
static const WCHAR szAttribute[]
Definition: domdoc.c:1179
static const WCHAR INSTALLPROPERTY_PACKAGENAMEW[]
Definition: msi.h:265
static const WCHAR INSTALLPROPERTY_INSTALLEDPRODUCTNAMEW[]
Definition: msi.h:311
static const WCHAR INSTALLPROPERTY_AUTHORIZED_LUA_APPW[]
Definition: msi.h:305
static const WCHAR INSTALLPROPERTY_INSTALLLOCATIONW[]
Definition: msi.h:327
enum tagMSIINSTALLCONTEXT MSIINSTALLCONTEXT
static const WCHAR INSTALLPROPERTY_TRANSFORMSW[]
Definition: msi.h:269
static const WCHAR INSTALLPROPERTY_PACKAGECODEW[]
Definition: msi.h:285
static const WCHAR INSTALLPROPERTY_URLINFOABOUTW[]
Definition: msi.h:347
static const WCHAR INSTALLPROPERTY_HELPTELEPHONEW[]
Definition: msi.h:323
static const WCHAR INSTALLPROPERTY_REGCOMPANYW[]
Definition: msi.h:367
static const WCHAR INSTALLPROPERTY_PUBLISHERW[]
Definition: msi.h:339
static const WCHAR INSTALLPROPERTY_INSTALLSOURCEW[]
Definition: msi.h:331
static const WCHAR INSTALLPROPERTY_URLUPDATEINFOW[]
Definition: msi.h:351
static const WCHAR INSTALLPROPERTY_PRODUCTIDW[]
Definition: msi.h:363
static const WCHAR INSTALLPROPERTY_VERSIONMAJORW[]
Definition: msi.h:359
static const WCHAR INSTALLPROPERTY_LOCALPACKAGEW[]
Definition: msi.h:343
static const WCHAR INSTALLPROPERTY_PRODUCTNAMEW[]
Definition: msi.h:277
static const WCHAR INSTALLPROPERTY_PRODUCTICONW[]
Definition: msi.h:295
static const WCHAR INSTALLPROPERTY_INSTALLDATEW[]
Definition: msi.h:335
static const WCHAR INSTALLPROPERTY_HELPLINKW[]
Definition: msi.h:319
static const WCHAR INSTALLPROPERTY_INSTANCETYPEW[]
Definition: msi.h:300
static const WCHAR INSTALLPROPERTY_VERSIONSTRINGW[]
Definition: msi.h:315
static const WCHAR INSTALLPROPERTY_VERSIONW[]
Definition: msi.h:289
static const WCHAR INSTALLPROPERTY_ASSIGNMENTTYPEW[]
Definition: msi.h:281
static const WCHAR INSTALLPROPERTY_REGOWNERW[]
Definition: msi.h:371
static const WCHAR INSTALLPROPERTY_VERSIONMINORW[]
Definition: msi.h:355
static const WCHAR INSTALLPROPERTY_LANGUAGEW[]
Definition: msi.h:273
BOOL unsquash_guid(LPCWSTR in, LPWSTR out)
Definition: registry.c:41
#define GUID_SIZE
Definition: msipriv.h:733
#define REG_NONE
Definition: nt_native.h:1492
#define REG_DWORD
Definition: sdbapi.c:596
_Check_return_ _CRTIMP wchar_t *__cdecl wcsdup(_In_z_ const wchar_t *_Str)
LPSTR a
Definition: msipriv.h:742
#define ERROR_UNKNOWN_PRODUCT
Definition: winerror.h:963
#define ERROR_BAD_CONFIGURATION
Definition: winerror.h:968

Referenced by MsiGetProductInfoA(), and MsiGetProductInfoW().

◆ MSI_GetUserInfo()

static USERINFOSTATE MSI_GetUserInfo ( LPCWSTR  szProduct,
awstring lpUserNameBuf,
LPDWORD  pcchUserNameBuf,
awstring lpOrgNameBuf,
LPDWORD  pcchOrgNameBuf,
awstring lpSerialBuf,
LPDWORD  pcchSerialBuf 
)
static

Definition at line 3507 of file msi.c.

3511{
3512 WCHAR *user, *org, *serial, squashed_pc[SQUASHED_GUID_SIZE];
3514 HKEY hkey, props;
3515 LPCWSTR orgptr;
3516 UINT r;
3517
3518 TRACE("%s %p %p %p %p %p %p\n", debugstr_w(szProduct), lpUserNameBuf,
3519 pcchUserNameBuf, lpOrgNameBuf, pcchOrgNameBuf, lpSerialBuf,
3520 pcchSerialBuf);
3521
3522 if (!szProduct || !squash_guid( szProduct, squashed_pc ))
3524
3526 &hkey, FALSE) != ERROR_SUCCESS &&
3528 &hkey, FALSE) != ERROR_SUCCESS &&
3530 &hkey, FALSE) != ERROR_SUCCESS)
3531 {
3532 return USERINFOSTATE_UNKNOWN;
3533 }
3534
3536 NULL, &props, FALSE) != ERROR_SUCCESS &&
3539 {
3540 RegCloseKey(hkey);
3541 return USERINFOSTATE_ABSENT;
3542 }
3543
3548
3549 RegCloseKey(hkey);
3551
3552 if (user && serial)
3554
3555 if (pcchUserNameBuf)
3556 {
3557 if (lpUserNameBuf && !user)
3558 {
3559 (*pcchUserNameBuf)--;
3560 goto done;
3561 }
3562
3563 r = msi_strcpy_to_awstring(user, -1, lpUserNameBuf, pcchUserNameBuf);
3564 if (r == ERROR_MORE_DATA)
3565 {
3567 goto done;
3568 }
3569 }
3570
3571 if (pcchOrgNameBuf)
3572 {
3573 orgptr = org;
3574 if (!orgptr) orgptr = L"";
3575
3576 r = msi_strcpy_to_awstring(orgptr, -1, lpOrgNameBuf, pcchOrgNameBuf);
3577 if (r == ERROR_MORE_DATA)
3578 {
3580 goto done;
3581 }
3582 }
3583
3584 if (pcchSerialBuf)
3585 {
3586 if (!serial)
3587 {
3588 (*pcchSerialBuf)--;
3589 goto done;
3590 }
3591
3592 r = msi_strcpy_to_awstring(serial, -1, lpSerialBuf, pcchSerialBuf);
3593 if (r == ERROR_MORE_DATA)
3595 }
3596
3597done:
3598 free(user);
3599 free(org);
3600 free(serial);
3601
3602 return state;
3603}
void user(int argc, const char *argv[])
Definition: cmds.c:1350
uint32_t serial
Definition: fsck.fat.h:29
static char org[]
Definition: encode.c:7456
enum tagUSERINFOSTATE USERINFOSTATE
@ USERINFOSTATE_MOREDATA
Definition: msi.h:78
@ USERINFOSTATE_UNKNOWN
Definition: msi.h:80
@ USERINFOSTATE_INVALIDARG
Definition: msi.h:79
@ USERINFOSTATE_ABSENT
Definition: msi.h:81
@ USERINFOSTATE_PRESENT
Definition: msi.h:82
static const WCHAR props[]
Definition: wbemdisp.c:288

Referenced by MsiGetUserInfoA(), and MsiGetUserInfoW().

◆ msi_locate_product()

◆ MSI_OpenProductW()

static UINT MSI_OpenProductW ( LPCWSTR  szProduct,
MSIPACKAGE **  package 
)
static

Definition at line 101 of file msi.c.

102{
103 UINT r;
104 HKEY props;
105 LPWSTR path;
107
108 TRACE("%s %p\n", debugstr_w(szProduct), package);
109
110 r = msi_locate_product(szProduct, &context);
111 if (r != ERROR_SUCCESS)
112 return r;
113
115 if (r != ERROR_SUCCESS)
117
119 path = msi_reg_get_val_str(props, L"ManagedLocalPackage");
120 else
121 path = msi_reg_get_val_str(props, L"LocalPackage");
122
124
126 goto done;
127
129 {
131 goto done;
132 }
133
134 r = MSI_OpenPackageW(path, 0, package);
135
136done:
138 free(path);
139 return r;
140}
UINT msi_locate_product(LPCWSTR szProduct, MSIINSTALLCONTEXT *context)
Definition: msi.c:54
BOOL WINAPI PathIsRelativeW(LPCWSTR lpszPath)
Definition: path.c:1579
UINT MSI_OpenPackageW(LPCWSTR szPackage, DWORD dwOptions, MSIPACKAGE **pPackage)
Definition: package.c:1384
#define ERROR_INSTALL_PACKAGE_OPEN_FAILED
Definition: winerror.h:977

Referenced by MsiConfigureFeatureW(), MsiOpenProductW(), and MsiReinstallFeatureW().

◆ MSI_ProvideQualifiedComponentEx()

static UINT MSI_ProvideQualifiedComponentEx ( LPCWSTR  szComponent,
LPCWSTR  szQualifier,
DWORD  dwInstallMode,
LPCWSTR  szProduct,
DWORD  Unused1,
DWORD  Unused2,
awstring lpPathBuf,
LPDWORD  pcchPathBuf 
)
static

Definition at line 3367 of file msi.c.

3371{
3373 WCHAR *desc;
3374 HKEY hkey;
3375 DWORD size;
3376 UINT ret;
3378
3379 if (MSIREG_OpenUserComponentsKey( szComponent, &hkey, FALSE )) return ERROR_UNKNOWN_COMPONENT;
3380
3381 desc = reg_get_multisz( hkey, szQualifier );
3382 RegCloseKey(hkey);
3383 if (!desc) return ERROR_INDEX_ABSENT;
3384
3385 /* FIXME: handle multiple descriptors */
3386 ret = MsiDecomposeDescriptorW( desc, product, feature, comp, &size );
3387 free( desc );
3388 if (ret != ERROR_SUCCESS) return ret;
3389
3390 if (!szProduct) szProduct = product;
3391 if (!comp[0])
3392 {
3395 GUID guid;
3396
3397 /* use the first component of the feature if the descriptor component is empty */
3398 if ((ret = msi_locate_product( szProduct, &ctx ))) return ret;
3399 if ((ret = MSIREG_OpenUserDataFeaturesKey( szProduct, NULL, ctx, &hkey, FALSE )))
3400 {
3401 return ERROR_FILE_NOT_FOUND;
3402 }
3403 components = reg_get_sz( hkey, feature );
3404 RegCloseKey( hkey );
3405 if (!components) return ERROR_FILE_NOT_FOUND;
3406
3408 {
3409 free( components );
3410 return ERROR_FILE_NOT_FOUND;
3411 }
3412 free( components );
3413 StringFromGUID2( &guid, comp, ARRAY_SIZE( comp ));
3414 }
3415
3416 state = MSI_GetComponentPath( szProduct, comp, L"S-1-1-0", MSIINSTALLCONTEXT_ALL, lpPathBuf, pcchPathBuf );
3417
3420 return ERROR_SUCCESS;
3421}
static INSTALLSTATE MSI_GetComponentPath(const WCHAR *szProduct, const WCHAR *szComponent, const WCHAR *szUserSid, MSIINSTALLCONTEXT ctx, awstring *lpPathBuf, DWORD *pcchBuf)
Definition: msi.c:2771
#define BASE85_SIZE
Definition: msi.c:3362
static WCHAR * reg_get_sz(HKEY hkey, const WCHAR *name)
Definition: msi.c:3353
static WCHAR * reg_get_multisz(HKEY hkey, const WCHAR *name)
Definition: msi.c:3344
INT WINAPI StringFromGUID2(REFGUID id, LPOLESTR str, INT cmax)
Definition: compobj.c:2434
GLenum GLenum GLuint components
Definition: glext.h:9620
const GUID * guid
INTERNETFEATURELIST feature
Definition: misc.c:1719
@ MSIINSTALLCONTEXT_ALL
Definition: msi.h:201
#define MAX_FEATURE_CHARS
Definition: msi.h:257
BOOL decode_base85_guid(LPCWSTR, GUID *)
Definition: registry.c:132
UINT MSIREG_OpenUserComponentsKey(LPCWSTR szComponent, HKEY *key, BOOL create)
Definition: registry.c:505
UINT MSIREG_OpenUserDataFeaturesKey(LPCWSTR szProduct, LPCWSTR szUserSid, MSIINSTALLCONTEXT context, HKEY *key, BOOL create)
Definition: registry.c:472
UINT WINAPI MsiDecomposeDescriptorW(LPCWSTR, LPWSTR, LPWSTR, LPWSTR, LPDWORD)
Definition: registry.c:927
#define ERROR_UNKNOWN_COMPONENT
Definition: winerror.h:965
#define ERROR_INDEX_ABSENT
Definition: winerror.h:969

Referenced by MsiProvideQualifiedComponentExA(), and MsiProvideQualifiedComponentExW().

◆ MsiAdvertiseProductA()

UINT WINAPI MsiAdvertiseProductA ( LPCSTR  szPackagePath,
LPCSTR  szScriptfilePath,
LPCSTR  szTransforms,
LANGID  lgidLanguage 
)

Definition at line 166 of file msi.c.

168{
169 FIXME("%s %s %s %08x\n",debugstr_a(szPackagePath),
170 debugstr_a(szScriptfilePath), debugstr_a(szTransforms), lgidLanguage);
172}
#define ERROR_CALL_NOT_IMPLEMENTED
Definition: compat.h:102
#define debugstr_a
Definition: kernel32.h:31

◆ MsiAdvertiseProductExA()

UINT WINAPI MsiAdvertiseProductExA ( const char szPackagePath,
const char szScriptfilePath,
const char szTransforms,
LANGID  lgidLanguage,
DWORD  dwPlatform,
DWORD  dwOptions 
)

Definition at line 182 of file msi.c.

184{
185 FIXME( "%s, %s, %s, %#x, %#lx, %#lx\n", debugstr_a(szPackagePath), debugstr_a(szScriptfilePath),
186 debugstr_a(szTransforms), lgidLanguage, dwPlatform, dwOptions );
188}
DWORD dwOptions
Definition: solitaire.cpp:25

◆ MsiAdvertiseProductExW()

UINT WINAPI MsiAdvertiseProductExW ( const WCHAR szPackagePath,
const WCHAR szScriptfilePath,
const WCHAR szTransforms,
LANGID  lgidLanguage,
DWORD  dwPlatform,
DWORD  dwOptions 
)

Definition at line 190 of file msi.c.

192{
193 FIXME( "%s, %s, %s, %#x %#lx %#lx\n", debugstr_w(szPackagePath), debugstr_w(szScriptfilePath),
194 debugstr_w(szTransforms), lgidLanguage, dwPlatform, dwOptions );
196}

◆ MsiAdvertiseProductW()

UINT WINAPI MsiAdvertiseProductW ( LPCWSTR  szPackagePath,
LPCWSTR  szScriptfilePath,
LPCWSTR  szTransforms,
LANGID  lgidLanguage 
)

Definition at line 174 of file msi.c.

176{
177 FIXME("%s %s %s %08x\n",debugstr_w(szPackagePath),
178 debugstr_w(szScriptfilePath), debugstr_w(szTransforms), lgidLanguage);
180}

Referenced by WinMain().

◆ MsiAdvertiseScriptA()

UINT WINAPI MsiAdvertiseScriptA ( const char szScriptFile,
DWORD  dwFlags,
HKEY phRegData,
BOOL  fRemoveItems 
)

Definition at line 4118 of file msi.c.

4119{
4120 FIXME( "%s, %#lx, %p, %d\n", debugstr_a(szScriptFile), dwFlags, phRegData, fRemoveItems );
4122}
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1176

◆ MsiAdvertiseScriptW()

UINT WINAPI MsiAdvertiseScriptW ( const WCHAR szScriptFile,
DWORD  dwFlags,
HKEY phRegData,
BOOL  fRemoveItems 
)

Definition at line 4109 of file msi.c.

4110{
4111 FIXME( "%s, %#lx, %p, %d\n", debugstr_w(szScriptFile), dwFlags, phRegData, fRemoveItems );
4113}

◆ MsiApplyMultiplePatchesA()

UINT WINAPI MsiApplyMultiplePatchesA ( LPCSTR  szPatchPackages,
LPCSTR  szProductCode,
LPCSTR  szPropertiesList 
)

Definition at line 424 of file msi.c.

426{
427 LPWSTR patch_packages = NULL;
428 LPWSTR product_code = NULL;
429 LPWSTR properties_list = NULL;
431
432 TRACE("%s %s %s\n", debugstr_a(szPatchPackages), debugstr_a(szProductCode),
433 debugstr_a(szPropertiesList));
434
435 if (!szPatchPackages || !szPatchPackages[0])
437
438 if (!(patch_packages = strdupAtoW(szPatchPackages)))
439 return ERROR_OUTOFMEMORY;
440
441 if (szProductCode && !(product_code = strdupAtoW(szProductCode)))
442 goto done;
443
444 if (szPropertiesList && !(properties_list = strdupAtoW(szPropertiesList)))
445 goto done;
446
447 r = MsiApplyMultiplePatchesW(patch_packages, product_code, properties_list);
448
449done:
450 free(patch_packages);
451 free(product_code);
452 free(properties_list);
453
454 return r;
455}
static WCHAR * strdupAtoW(const char *str)
Definition: main.c:65
UINT WINAPI MsiApplyMultiplePatchesW(LPCWSTR szPatchPackages, LPCWSTR szProductCode, LPCWSTR szPropertiesList)
Definition: msi.c:457

Referenced by test_MsiApplyMultiplePatches().

◆ MsiApplyMultiplePatchesW()

UINT WINAPI MsiApplyMultiplePatchesW ( LPCWSTR  szPatchPackages,
LPCWSTR  szProductCode,
LPCWSTR  szPropertiesList 
)

Definition at line 457 of file msi.c.

459{
461 LPCWSTR beg, end;
462
463 TRACE("%s %s %s\n", debugstr_w(szPatchPackages), debugstr_w(szProductCode),
464 debugstr_w(szPropertiesList));
465
466 if (!szPatchPackages || !szPatchPackages[0])
468
469 beg = end = szPatchPackages;
470 while (*beg)
471 {
472 DWORD len;
473 LPWSTR patch;
474
475 while (*beg == ' ') beg++;
476 while (*end && *end != ';') end++;
477
478 len = end - beg;
479 while (len && beg[len - 1] == ' ') len--;
480
481 if (!len) return ERROR_INVALID_NAME;
482
483 patch = malloc((len + 1) * sizeof(WCHAR));
484 if (!patch)
485 return ERROR_OUTOFMEMORY;
486
487 memcpy(patch, beg, len * sizeof(WCHAR));
488 patch[len] = '\0';
489
490 r = MSI_ApplyPatchW(patch, szProductCode, szPropertiesList);
491 free(patch);
492
493 if (r != ERROR_SUCCESS || !*end)
494 break;
495
496 beg = ++end;
497 }
498 return r;
499}
#define ERROR_INVALID_NAME
Definition: compat.h:103
static UINT MSI_ApplyPatchW(LPCWSTR szPatchPackage, LPCWSTR szProductCode, LPCWSTR szCommandLine)
Definition: msi.c:359
GLuint GLuint end
Definition: gl.h:1545

Referenced by MsiApplyMultiplePatchesA().

◆ MsiApplyPatchA()

UINT WINAPI MsiApplyPatchA ( LPCSTR  szPatchPackage,
LPCSTR  szInstallPackage,
INSTALLTYPE  eInstallType,
LPCSTR  szCommandLine 
)

Definition at line 286 of file msi.c.

288{
289 LPWSTR patch_package = NULL;
290 LPWSTR install_package = NULL;
291 LPWSTR command_line = NULL;
293
294 TRACE("%s %s %d %s\n", debugstr_a(szPatchPackage), debugstr_a(szInstallPackage),
295 eInstallType, debugstr_a(szCommandLine));
296
297 if (szPatchPackage && !(patch_package = strdupAtoW(szPatchPackage)))
298 goto done;
299
300 if (szInstallPackage && !(install_package = strdupAtoW(szInstallPackage)))
301 goto done;
302
303 if (szCommandLine && !(command_line = strdupAtoW(szCommandLine)))
304 goto done;
305
306 r = MsiApplyPatchW(patch_package, install_package, eInstallType, command_line);
307
308done:
309 free(patch_package);
310 free(install_package);
311 free(command_line);
312
313 return r;
314}
UINT WINAPI MsiApplyPatchW(LPCWSTR szPatchPackage, LPCWSTR szInstallPackage, INSTALLTYPE eInstallType, LPCWSTR szCommandLine)
Definition: msi.c:408

Referenced by test_MsiApplyPatch(), test_patch_registration(), test_simple_patch(), and test_system_tables().

◆ MsiApplyPatchW()

UINT WINAPI MsiApplyPatchW ( LPCWSTR  szPatchPackage,
LPCWSTR  szInstallPackage,
INSTALLTYPE  eInstallType,
LPCWSTR  szCommandLine 
)

Definition at line 408 of file msi.c.

410{
411 TRACE("%s %s %d %s\n", debugstr_w(szPatchPackage), debugstr_w(szInstallPackage),
412 eInstallType, debugstr_w(szCommandLine));
413
414 if (szInstallPackage || eInstallType == INSTALLTYPE_NETWORK_IMAGE ||
415 eInstallType == INSTALLTYPE_SINGLE_INSTANCE)
416 {
417 FIXME("Only reading target products from patch\n");
419 }
420
421 return MSI_ApplyPatchW(szPatchPackage, NULL, szCommandLine);
422}
@ INSTALLTYPE_SINGLE_INSTANCE
Definition: msi.h:191
@ INSTALLTYPE_NETWORK_IMAGE
Definition: msi.h:190

Referenced by MsiApplyPatchA(), and WinMain().

◆ MsiBeginTransactionA()

UINT WINAPI MsiBeginTransactionA ( const char name,
DWORD  attrs,
MSIHANDLE id,
HANDLE event 
)

Definition at line 4291 of file msi.c.

4292{
4293 WCHAR *nameW;
4294 UINT r;
4295
4296 FIXME( "%s, %#lx, %p, %p\n", debugstr_a(name), attrs, id, event );
4297
4298 nameW = strdupAtoW( name );
4299 if (name && !nameW)
4300 return ERROR_OUTOFMEMORY;
4301
4302 r = MsiBeginTransactionW( nameW, attrs, id, event );
4303 free( nameW );
4304 return r;
4305}
static const WCHAR nameW[]
Definition: main.c:49
UINT WINAPI MsiBeginTransactionW(const WCHAR *name, DWORD attrs, MSIHANDLE *id, HANDLE *event)
Definition: msi.c:4310
struct _cl_event * event
Definition: glext.h:7739
Definition: name.c:39

◆ MsiBeginTransactionW()

UINT WINAPI MsiBeginTransactionW ( const WCHAR name,
DWORD  attrs,
MSIHANDLE id,
HANDLE event 
)

Definition at line 4310 of file msi.c.

4311{
4312 FIXME( "%s, %#lx, %p, %p\n", debugstr_w(name), attrs, id, event );
4313
4314 *id = (MSIHANDLE)0xdeadbeef;
4315 *event = (HANDLE)0xdeadbeef;
4316
4317 return ERROR_SUCCESS;
4318}
PVOID HANDLE
Definition: typedefs.h:73

Referenced by MsiBeginTransactionA().

◆ MsiCollectUserInfoA()

UINT WINAPI MsiCollectUserInfoA ( LPCSTR  szProduct)

Definition at line 3691 of file msi.c.

3692{
3694 UINT rc;
3695 MSIPACKAGE *package;
3696
3697 TRACE("(%s)\n",debugstr_a(szProduct));
3698
3699 rc = MsiOpenProductA(szProduct,&handle);
3700 if (rc != ERROR_SUCCESS)
3702
3703 /* MsiCollectUserInfo cannot be called from a custom action. */
3704 package = msihandle2msiinfo(handle, MSIHANDLETYPE_PACKAGE);
3705 if (!package)
3707
3708 rc = ACTION_PerformAction(package, L"FirstRun");
3709 msiobj_release( &package->hdr );
3710
3712
3713 return rc;
3714}
UINT ACTION_PerformAction(MSIPACKAGE *package, const WCHAR *action)
Definition: action.c:7640
UINT WINAPI MsiOpenProductA(LPCSTR szProduct, MSIHANDLE *phProduct)
Definition: msi.c:80
MSIOBJECTHDR hdr
Definition: msipriv.h:393

◆ MsiCollectUserInfoW()

UINT WINAPI MsiCollectUserInfoW ( LPCWSTR  szProduct)

Definition at line 3666 of file msi.c.

3667{
3669 UINT rc;
3670 MSIPACKAGE *package;
3671
3672 TRACE("(%s)\n",debugstr_w(szProduct));
3673
3674 rc = MsiOpenProductW(szProduct,&handle);
3675 if (rc != ERROR_SUCCESS)
3677
3678 /* MsiCollectUserInfo cannot be called from a custom action. */
3679 package = msihandle2msiinfo(handle, MSIHANDLETYPE_PACKAGE);
3680 if (!package)
3682
3683 rc = ACTION_PerformAction(package, L"FirstRun");
3684 msiobj_release( &package->hdr );
3685
3687
3688 return rc;
3689}
UINT WINAPI MsiOpenProductW(LPCWSTR szProduct, MSIHANDLE *phProduct)
Definition: msi.c:142

◆ MsiConfigureFeatureA()

UINT WINAPI MsiConfigureFeatureA ( LPCSTR  szProduct,
LPCSTR  szFeature,
INSTALLSTATE  eInstallState 
)

Definition at line 3719 of file msi.c.

3720{
3721 LPWSTR prod, feat = NULL;
3723
3724 TRACE("%s %s %i\n", debugstr_a(szProduct), debugstr_a(szFeature), eInstallState);
3725
3726 prod = strdupAtoW( szProduct );
3727 if (szProduct && !prod)
3728 goto end;
3729
3730 feat = strdupAtoW( szFeature );
3731 if (szFeature && !feat)
3732 goto end;
3733
3734 r = MsiConfigureFeatureW(prod, feat, eInstallState);
3735
3736end:
3737 free(feat);
3738 free(prod);
3739
3740 return r;
3741}
UINT WINAPI MsiConfigureFeatureW(LPCWSTR szProduct, LPCWSTR szFeature, INSTALLSTATE eInstallState)
Definition: msi.c:3746

Referenced by test_null().

◆ MsiConfigureFeatureW()

UINT WINAPI MsiConfigureFeatureW ( LPCWSTR  szProduct,
LPCWSTR  szFeature,
INSTALLSTATE  eInstallState 
)

Definition at line 3746 of file msi.c.

3747{
3748 MSIPACKAGE *package = NULL;
3749 UINT r;
3750 WCHAR sourcepath[MAX_PATH], filename[MAX_PATH];
3751 DWORD sz;
3752
3753 TRACE("%s %s %i\n", debugstr_w(szProduct), debugstr_w(szFeature), eInstallState);
3754
3755 if (!szProduct || !szFeature)
3757
3758 switch (eInstallState)
3759 {
3761 /* FIXME: how do we figure out the default location? */
3762 eInstallState = INSTALLSTATE_LOCAL;
3763 break;
3764 case INSTALLSTATE_LOCAL:
3768 break;
3769 default:
3771 }
3772
3773 r = MSI_OpenProductW( szProduct, &package );
3774 if (r != ERROR_SUCCESS)
3775 return r;
3776
3777 sz = sizeof(sourcepath);
3780
3781 sz = sizeof(filename);
3784
3785 lstrcatW( sourcepath, filename );
3786
3788
3789 r = ACTION_PerformAction(package, L"CostInitialize");
3790 if (r != ERROR_SUCCESS)
3791 goto end;
3792
3793 r = MSI_SetFeatureStateW( package, szFeature, eInstallState);
3794 if (r != ERROR_SUCCESS)
3795 goto end;
3796
3797 r = MSI_InstallPackage( package, sourcepath, NULL );
3798
3799end:
3800 msiobj_release( &package->hdr );
3801
3802 return r;
3803}
#define MAX_PATH
Definition: compat.h:34
UINT MSI_InstallPackage(MSIPACKAGE *package, LPCWSTR szPackagePath, LPCWSTR szCommandLine)
Definition: action.c:7740
UINT MSI_SetFeatureStateW(MSIPACKAGE *package, LPCWSTR szFeature, INSTALLSTATE iState)
Definition: install.c:915
INSTALLUILEVEL WINAPI MsiSetInternalUI(INSTALLUILEVEL dwUILevel, HWND *phWnd)
Definition: msi.c:2281
static UINT MSI_OpenProductW(LPCWSTR szProduct, MSIPACKAGE **package)
Definition: msi.c:101
UINT WINAPI MsiSourceListGetInfoW(LPCWSTR szProduct, LPCWSTR szUserSid, MSIINSTALLCONTEXT dwContext, DWORD dwOptions, LPCWSTR szProperty, LPWSTR szValue, LPDWORD pcchValue)
Definition: source.c:523
const char * filename
Definition: ioapi.h:137
LPWSTR WINAPI lstrcatW(LPWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:274
@ MSICODE_PRODUCT
Definition: msi.h:215
static const WCHAR INSTALLPROPERTY_LASTUSEDSOURCEW[]
Definition: msi.h:405
@ INSTALLSTATE_SOURCE
Definition: msi.h:47
@ INSTALLSTATE_ADVERTISED
Definition: msi.h:44
@ INSTALLUILEVEL_BASIC
Definition: msi.h:67

Referenced by MsiConfigureFeatureA(), and test_null().

◆ MsiConfigureProductA()

UINT WINAPI MsiConfigureProductA ( LPCSTR  szProduct,
int  iInstallLevel,
INSTALLSTATE  eInstallState 
)

Definition at line 946 of file msi.c.

948{
949 LPWSTR szwProduct = NULL;
950 UINT r;
951
952 TRACE("%s %d %d\n",debugstr_a(szProduct), iInstallLevel, eInstallState);
953
954 if( szProduct )
955 {
956 szwProduct = strdupAtoW( szProduct );
957 if( !szwProduct )
958 return ERROR_OUTOFMEMORY;
959 }
960
961 r = MsiConfigureProductW( szwProduct, iInstallLevel, eInstallState );
962 free( szwProduct );
963
964 return r;
965}
UINT WINAPI MsiConfigureProductW(LPCWSTR szProduct, int iInstallLevel, INSTALLSTATE eInstallState)
Definition: msi.c:967

Referenced by test_concurrentinstall().

◆ MsiConfigureProductExA()

UINT WINAPI MsiConfigureProductExA ( LPCSTR  szProduct,
int  iInstallLevel,
INSTALLSTATE  eInstallState,
LPCSTR  szCommandLine 
)

Definition at line 916 of file msi.c.

918{
919 LPWSTR szwProduct = NULL;
920 LPWSTR szwCommandLine = NULL;
922
923 if( szProduct )
924 {
925 szwProduct = strdupAtoW( szProduct );
926 if( !szwProduct )
927 goto end;
928 }
929
930 if( szCommandLine)
931 {
932 szwCommandLine = strdupAtoW( szCommandLine );
933 if( !szwCommandLine)
934 goto end;
935 }
936
937 r = MsiConfigureProductExW( szwProduct, iInstallLevel, eInstallState,
938 szwCommandLine );
939end:
940 free( szwProduct );
941 free( szwCommandLine);
942
943 return r;
944}

Referenced by test_installed_prop(), and test_MsiConfigureProductEx().

◆ MsiConfigureProductExW()

UINT WINAPI MsiConfigureProductExW ( LPCWSTR  szProduct,
int  iInstallLevel,
INSTALLSTATE  eInstallState,
LPCWSTR  szCommandLine 
)

Definition at line 831 of file msi.c.

833{
834 MSIPACKAGE* package = NULL;
836 UINT r;
837 DWORD sz;
838 WCHAR sourcepath[MAX_PATH], filename[MAX_PATH];
839 LPWSTR commandline;
840
841 TRACE("%s %d %d %s\n",debugstr_w(szProduct), iInstallLevel, eInstallState,
842 debugstr_w(szCommandLine));
843
844 if (!szProduct || lstrlenW(szProduct) != GUID_SIZE - 1)
846
847 if (eInstallState == INSTALLSTATE_ADVERTISED ||
848 eInstallState == INSTALLSTATE_SOURCE)
849 {
850 FIXME("State %d not implemented\n", eInstallState);
852 }
853
854 r = msi_locate_product(szProduct, &context);
855 if (r != ERROR_SUCCESS)
856 return r;
857
858 r = open_package(szProduct, NULL, context, &package);
859 if (r != ERROR_SUCCESS)
860 return r;
861
862 sz = lstrlenW(L" Installed=1") + 1;
863
864 if (szCommandLine)
865 sz += lstrlenW(szCommandLine);
866
867 if (eInstallState != INSTALLSTATE_DEFAULT)
868 sz += lstrlenW(L" INSTALLLEVEL=32767");
869
870 if (eInstallState == INSTALLSTATE_ABSENT)
871 sz += lstrlenW(L" REMOVE=ALL");
872
874 sz += lstrlenW(L" ALLUSERS=1");
875
876 commandline = malloc(sz * sizeof(WCHAR));
877 if (!commandline)
878 {
880 goto end;
881 }
882
883 commandline[0] = 0;
884 if (szCommandLine)
885 lstrcpyW(commandline, szCommandLine);
886
887 if (eInstallState != INSTALLSTATE_DEFAULT)
888 lstrcatW(commandline, L" INSTALLLEVEL=32767");
889
890 if (eInstallState == INSTALLSTATE_ABSENT)
891 lstrcatW(commandline, L" REMOVE=ALL");
892
894 lstrcatW(commandline, L" ALLUSERS=1");
895
896 sz = sizeof(sourcepath);
898 INSTALLPROPERTY_LASTUSEDSOURCEW, sourcepath, &sz);
899
900 sz = sizeof(filename);
903
904 lstrcatW(sourcepath, filename);
905
906 r = MSI_InstallPackage( package, sourcepath, commandline );
907
908 free(commandline);
909
910end:
911 msiobj_release( &package->hdr );
912
913 return r;
914}
static UINT open_package(const WCHAR *product, const WCHAR *usersid, MSIINSTALLCONTEXT context, MSIPACKAGE **package)
Definition: msi.c:782

Referenced by MSI_ApplyPatchW(), MsiConfigureProductExA(), MsiConfigureProductW(), and WinMain().

◆ MsiConfigureProductW()

UINT WINAPI MsiConfigureProductW ( LPCWSTR  szProduct,
int  iInstallLevel,
INSTALLSTATE  eInstallState 
)

Definition at line 967 of file msi.c.

969{
970 return MsiConfigureProductExW(szProduct, iInstallLevel, eInstallState, NULL);
971}

Referenced by MsiConfigureProductA().

◆ 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}
BOOL WINAPI CreateDirectoryW(IN LPCWSTR lpPathName, IN LPSECURITY_ATTRIBUTES lpSecurityAttributes)
Definition: dir.c:90
UINT WINAPI GetWindowsDirectoryW(OUT LPWSTR lpBuffer, IN UINT uSize)
Definition: path.c:2352
#define ERROR_ALREADY_EXISTS
Definition: disk.h:80
_In_ HANDLE _In_ DWORD _In_ DWORD _Inout_opt_ LPOVERLAPPED _In_opt_ LPTRANSMIT_FILE_BUFFERS _In_ DWORD dwReserved
Definition: mswsock.h:95

◆ MsiDetermineApplicablePatchesA()

UINT WINAPI MsiDetermineApplicablePatchesA ( const char szProductPackagePath,
DWORD  cPatchInfo,
MSIPATCHSEQUENCEINFOA pPatchInfo 
)

Definition at line 528 of file msi.c.

530{
531 UINT i, r;
532 WCHAR *package_path = NULL;
534
535 TRACE( "%s, %lu, %p\n", debugstr_a(szProductPackagePath), cPatchInfo, pPatchInfo );
536
537 if (szProductPackagePath && !(package_path = strdupAtoW( szProductPackagePath )))
538 return ERROR_OUTOFMEMORY;
539
540 if (!(psi = patchinfoAtoW( cPatchInfo, pPatchInfo )))
541 {
542 free( package_path );
543 return ERROR_OUTOFMEMORY;
544 }
545 r = MsiDetermineApplicablePatchesW( package_path, cPatchInfo, psi );
546 if (r == ERROR_SUCCESS)
547 {
548 for (i = 0; i < cPatchInfo; i++)
549 {
550 pPatchInfo[i].dwOrder = psi[i].dwOrder;
551 pPatchInfo[i].uStatus = psi[i].uStatus;
552 }
553 }
554 free( package_path );
555 free_patchinfo( cPatchInfo, psi );
556 return r;
557}
static void free_patchinfo(DWORD count, MSIPATCHSEQUENCEINFOW *info)
Definition: msi.c:501
UINT WINAPI MsiDetermineApplicablePatchesW(const WCHAR *szProductPackagePath, DWORD cPatchInfo, MSIPATCHSEQUENCEINFOW *pPatchInfo)
Definition: msi.c:726
static MSIPATCHSEQUENCEINFOW * patchinfoAtoW(DWORD count, const MSIPATCHSEQUENCEINFOA *info)
Definition: msi.c:508

◆ MsiDetermineApplicablePatchesW()

UINT WINAPI MsiDetermineApplicablePatchesW ( const WCHAR szProductPackagePath,
DWORD  cPatchInfo,
MSIPATCHSEQUENCEINFOW pPatchInfo 
)

Definition at line 726 of file msi.c.

728{
729 UINT r;
730 MSIPACKAGE *package;
731
732 TRACE( "%s, %lu, %p\n", debugstr_w(szProductPackagePath), cPatchInfo, pPatchInfo );
733
734 r = MSI_OpenPackageW( szProductPackagePath, 0, &package );
735 if (r != ERROR_SUCCESS)
736 {
737 ERR("failed to open package %u\n", r);
738 return r;
739 }
740 r = determine_patch_sequence( package, cPatchInfo, pPatchInfo );
741 msiobj_release( &package->hdr );
742 return r;
743}
static UINT determine_patch_sequence(MSIPACKAGE *package, DWORD count, MSIPATCHSEQUENCEINFOW *info)
Definition: msi.c:631

Referenced by MsiDetermineApplicablePatchesA().

◆ MsiDeterminePatchSequenceA()

UINT WINAPI MsiDeterminePatchSequenceA ( const char product,
const char usersid,
MSIINSTALLCONTEXT  context,
DWORD  count,
MSIPATCHSEQUENCEINFOA patchinfo 
)

Definition at line 745 of file msi.c.

747{
748 UINT i, r;
749 WCHAR *productW, *usersidW = NULL;
750 MSIPATCHSEQUENCEINFOW *patchinfoW;
751
752 TRACE( "%s, %s, %d, %lu, %p\n", debugstr_a(product), debugstr_a(usersid), context, count, patchinfo );
753
754 if (!product) return ERROR_INVALID_PARAMETER;
755 if (!(productW = strdupAtoW( product ))) return ERROR_OUTOFMEMORY;
756 if (usersid && !(usersidW = strdupAtoW( usersid )))
757 {
758 free( productW );
759 return ERROR_OUTOFMEMORY;
760 }
761 if (!(patchinfoW = patchinfoAtoW( count, patchinfo )))
762 {
763 free( productW );
764 free( usersidW );
765 return ERROR_OUTOFMEMORY;
766 }
767 r = MsiDeterminePatchSequenceW( productW, usersidW, context, count, patchinfoW );
768 if (r == ERROR_SUCCESS)
769 {
770 for (i = 0; i < count; i++)
771 {
772 patchinfo[i].dwOrder = patchinfoW[i].dwOrder;
773 patchinfo[i].uStatus = patchinfoW[i].uStatus;
774 }
775 }
776 free( productW );
777 free( usersidW );
778 free_patchinfo( count, patchinfoW );
779 return r;
780}
UINT WINAPI MsiDeterminePatchSequenceW(const WCHAR *product, const WCHAR *usersid, MSIINSTALLCONTEXT context, DWORD count, MSIPATCHSEQUENCEINFOW *patchinfo)
Definition: msi.c:814

◆ MsiDeterminePatchSequenceW()

UINT WINAPI MsiDeterminePatchSequenceW ( const WCHAR product,
const WCHAR usersid,
MSIINSTALLCONTEXT  context,
DWORD  count,
MSIPATCHSEQUENCEINFOW patchinfo 
)

Definition at line 814 of file msi.c.

816{
817 UINT r;
818 MSIPACKAGE *package;
819
820 TRACE( "%s, %s, %d, %lu, %p\n", debugstr_w(product), debugstr_w(usersid), context, count, patchinfo );
821
822 if (!product) return ERROR_INVALID_PARAMETER;
823 r = open_package( product, usersid, context, &package );
824 if (r != ERROR_SUCCESS) return r;
825
826 r = determine_patch_sequence( package, count, patchinfo );
827 msiobj_release( &package->hdr );
828 return r;
829}

Referenced by MsiDeterminePatchSequenceA().

◆ MsiEnableLogA()

UINT WINAPI MsiEnableLogA ( DWORD  dwLogMode,
const char szLogFile,
DWORD  attributes 
)

Definition at line 1882 of file msi.c.

1883{
1884 LPWSTR szwLogFile = NULL;
1885 UINT r;
1886
1887 TRACE( "%#lx, %s, %#lx\n", dwLogMode, debugstr_a(szLogFile), attributes );
1888
1889 if( szLogFile )
1890 {
1891 szwLogFile = strdupAtoW( szLogFile );
1892 if( !szwLogFile )
1893 return ERROR_OUTOFMEMORY;
1894 }
1895 r = MsiEnableLogW( dwLogMode, szwLogFile, attributes );
1896 free( szwLogFile );
1897 return r;
1898}
UINT WINAPI MsiEnableLogW(DWORD dwLogMode, const WCHAR *szLogFile, DWORD attributes)
Definition: msi.c:1900

Referenced by START_TEST().

◆ MsiEnableLogW()

UINT WINAPI MsiEnableLogW ( DWORD  dwLogMode,
const WCHAR szLogFile,
DWORD  attributes 
)

Definition at line 1900 of file msi.c.

1901{
1902 TRACE( "%#lx, %s, %#lx\n", dwLogMode, debugstr_w(szLogFile), attributes );
1903
1905 gszLogFile = NULL;
1906 if (szLogFile)
1907 {
1908 HANDLE file;
1909
1910 if (!(attributes & INSTALLLOGATTRIBUTES_APPEND))
1911 DeleteFileW(szLogFile);
1915 {
1916 gszLogFile = wcsdup(szLogFile);
1918 }
1919 else ERR( "unable to enable log %s (%lu)\n", debugstr_w(szLogFile), GetLastError() );
1920 }
1921
1922 return ERROR_SUCCESS;
1923}
#define FILE_ATTRIBUTE_NORMAL
Definition: compat.h:137
BOOL WINAPI DeleteFileW(IN LPCWSTR lpFileName)
Definition: delete.c:39
#define OPEN_ALWAYS
Definition: disk.h:70
@ INSTALLLOGATTRIBUTES_APPEND
Definition: msi.h:156
WCHAR * gszLogFile
Definition: msi_main.c:50
#define FILE_SHARE_WRITE
Definition: nt_native.h:681
#define GENERIC_WRITE
Definition: nt_native.h:90
Definition: fci.c:127

Referenced by MsiEnableLogA(), and WinMain().

◆ MsiEndTransaction()

UINT WINAPI MsiEndTransaction ( DWORD  state)

Definition at line 4334 of file msi.c.

4335{
4336 FIXME( "%#lx\n", state );
4337 return ERROR_SUCCESS;
4338}

◆ MsiEnumComponentCostsA()

UINT WINAPI MsiEnumComponentCostsA ( MSIHANDLE  handle,
const char component,
DWORD  index,
INSTALLSTATE  state,
char drive,
DWORD buflen,
int cost,
int temp 
)

Definition at line 1925 of file msi.c.

1927{
1928 UINT r;
1929 DWORD len;
1930 WCHAR *driveW, *componentW = NULL;
1931
1932 TRACE( "%lu, %s, %lu, %d, %p, %p, %p, %p\n", handle, debugstr_a(component), index, state, drive, buflen, cost,
1933 temp );
1934
1935 if (!drive || !buflen) return ERROR_INVALID_PARAMETER;
1936 if (component && !(componentW = strdupAtoW( component ))) return ERROR_OUTOFMEMORY;
1937
1938 len = *buflen;
1939 if (!(driveW = malloc( len * sizeof(WCHAR) )))
1940 {
1941 free( componentW );
1942 return ERROR_OUTOFMEMORY;
1943 }
1944 r = MsiEnumComponentCostsW( handle, componentW, index, state, driveW, buflen, cost, temp );
1945 if (!r)
1946 {
1947 WideCharToMultiByte( CP_ACP, 0, driveW, -1, drive, len, NULL, NULL );
1948 }
1949 free( componentW );
1950 free( driveW );
1951 return r;
1952}
#define CP_ACP
Definition: compat.h:109
#define WideCharToMultiByte
Definition: compat.h:111
UINT WINAPI MsiEnumComponentCostsW(MSIHANDLE handle, const WCHAR *component, DWORD index, INSTALLSTATE state, WCHAR *drive, DWORD *buflen, int *cost, int *temp)
Definition: msi.c:1962
GLuint index
Definition: glext.h:6031
static calc_node_t temp
Definition: rpn_ieee.c:38

Referenced by test_costs().

◆ MsiEnumComponentCostsW()

UINT WINAPI MsiEnumComponentCostsW ( MSIHANDLE  handle,
const WCHAR component,
DWORD  index,
INSTALLSTATE  state,
WCHAR drive,
DWORD buflen,
int cost,
int temp 
)

Definition at line 1962 of file msi.c.

1964{
1966 MSICOMPONENT *comp = NULL;
1967 MSIPACKAGE *package;
1968 MSIFILE *file;
1969 STATSTG stat = {0};
1971
1972 TRACE( "%lu, %s, %lu, %d, %p, %p, %p, %p\n", handle, debugstr_w(component), index, state, drive, buflen, cost,
1973 temp );
1974
1975 if (!drive || !buflen || !cost || !temp) return ERROR_INVALID_PARAMETER;
1976 if (!(package = msihandle2msiinfo( handle, MSIHANDLETYPE_PACKAGE )))
1977 {
1978 WCHAR buffer[3];
1979 MSIHANDLE remote;
1980
1981 if (!(remote = msi_get_remote(handle)))
1982 return ERROR_INVALID_HANDLE;
1983
1984 __TRY
1985 {
1986 r = remote_EnumComponentCosts(remote, component, index, state, buffer, cost, temp);
1987 }
1989 {
1990 r = GetExceptionCode();
1991 }
1992 __ENDTRY
1993
1994 if (r == ERROR_SUCCESS)
1995 {
1996 lstrcpynW(drive, buffer, *buflen);
1997 if (*buflen < 3)
1999 *buflen = 2;
2000 }
2001 return r;
2002 }
2003
2004 if (!msi_get_property_int( package->db, L"CostingComplete", 0 ))
2005 {
2006 msiobj_release( &package->hdr );
2008 }
2009 if (component && component[0] && !(comp = msi_get_loaded_component( package, component )))
2010 {
2011 msiobj_release( &package->hdr );
2013 }
2014 if (*buflen < 3)
2015 {
2016 *buflen = 2;
2017 msiobj_release( &package->hdr );
2018 return ERROR_MORE_DATA;
2019 }
2020 if (index)
2021 {
2022 msiobj_release( &package->hdr );
2023 return ERROR_NO_MORE_ITEMS;
2024 }
2025
2026 drive[0] = 0;
2027 *cost = *temp = 0;
2029 if (component && component[0])
2030 {
2031 if (msi_is_global_assembly( comp )) *temp = comp->cost;
2032 if (!comp->Enabled || !comp->KeyPath)
2033 {
2034 *cost = 0;
2035 *buflen = set_drive( drive, path[0] );
2036 r = ERROR_SUCCESS;
2037 }
2038 else if ((file = msi_get_loaded_file( package, comp->KeyPath )))
2039 {
2040 *cost = comp->cost;
2041 *buflen = set_drive( drive, file->TargetPath[0] );
2042 r = ERROR_SUCCESS;
2043 }
2044 }
2045 else if (IStorage_Stat( package->db->storage, &stat, STATFLAG_NONAME ) == S_OK)
2046 {
2047 *temp = cost_from_size( stat.cbSize.QuadPart );
2048 *buflen = set_drive( drive, path[0] );
2049 r = ERROR_SUCCESS;
2050 }
2051 msiobj_release( &package->hdr );
2052 return r;
2053}
#define __TRY
Definition: compat.h:80
#define ERROR_NO_MORE_ITEMS
Definition: compat.h:105
#define ERROR_INVALID_HANDLE
Definition: compat.h:98
#define __ENDTRY
Definition: compat.h:82
BOOL msi_is_global_assembly(MSICOMPONENT *comp)
Definition: action.c:2036
MSICOMPONENT * msi_get_loaded_component(MSIPACKAGE *package, const WCHAR *Component)
Definition: action.c:550
MSIFILE * msi_get_loaded_file(MSIPACKAGE *package, const WCHAR *key)
Definition: action.c:572
LONG WINAPI rpc_filter(EXCEPTION_POINTERS *eptr)
Definition: custom.c:85
MSIHANDLE msi_get_remote(MSIHANDLE handle)
Definition: handle.c:183
void * msihandle2msiinfo(MSIHANDLE handle, UINT type)
Definition: handle.c:158
static UINT set_drive(WCHAR *buffer, WCHAR letter)
Definition: msi.c:1954
GLuint buffer
Definition: glext.h:5915
static int cost_from_size(int size)
Definition: msipriv.h:1198
int msi_get_property_int(MSIDATABASE *package, LPCWSTR prop, int def)
Definition: package.c:2305
#define MSIHANDLETYPE_PACKAGE
Definition: msipriv.h:726
#define __EXCEPT(func)
Definition: exception.h:84
#define GetExceptionCode()
Definition: seh.h:27
Definition: stat.h:55
LPWSTR KeyPath
Definition: msipriv.h:529
#define ERROR_FUNCTION_NOT_CALLED
Definition: winerror.h:984

Referenced by MsiEnumComponentCostsA(), s_remote_EnumComponentCosts(), and test_costs().

◆ MsiGetComponentPathA()

INSTALLSTATE WINAPI MsiGetComponentPathA ( LPCSTR  product,
LPCSTR  comp,
LPSTR  buf,
LPDWORD  buflen 
)

Definition at line 2898 of file msi.c.

2899{
2900 return MsiGetComponentPathExA( product, comp, "s-1-1-0", MSIINSTALLCONTEXT_ALL, buf, buflen );
2901}
INSTALLSTATE WINAPI MsiGetComponentPathExA(LPCSTR product, LPCSTR comp, LPCSTR usersid, MSIINSTALLCONTEXT ctx, LPSTR buf, LPDWORD buflen)
Definition: msi.c:2860
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751

Referenced by MsiLocateComponentA(), test_getcomponentpath(), and test_MsiGetComponentPath().

◆ MsiGetComponentPathExA()

INSTALLSTATE WINAPI MsiGetComponentPathExA ( LPCSTR  product,
LPCSTR  comp,
LPCSTR  usersid,
MSIINSTALLCONTEXT  ctx,
LPSTR  buf,
LPDWORD  buflen 
)

Definition at line 2860 of file msi.c.

2862{
2863 WCHAR *productW = NULL, *compW = NULL, *usersidW = NULL;
2865 awstring path;
2866
2867 TRACE( "%s %s %s 0x%x %p %p\n", debugstr_a(product), debugstr_a(comp), debugstr_a(usersid),
2868 ctx, buf, buflen );
2869
2870 if (product && !(productW = strdupAtoW( product ))) return INSTALLSTATE_UNKNOWN;
2871 if (comp && !(compW = strdupAtoW( comp ))) goto end;
2872 if (usersid && !(usersidW = strdupAtoW( usersid ))) goto end;
2873
2874 path.unicode = FALSE;
2875 path.str.a = buf;
2876
2877 r = MSI_GetComponentPath( productW, compW, usersidW, ctx, &path, buflen );
2878
2879end:
2880 free( productW );
2881 free( compW );
2882 free( usersidW );
2883
2884 return r;
2885}

Referenced by MsiGetComponentPathA(), and test_MsiGetComponentPathEx().

◆ MsiGetComponentPathExW()

INSTALLSTATE WINAPI MsiGetComponentPathExW ( LPCWSTR  product,
LPCWSTR  comp,
LPCWSTR  usersid,
MSIINSTALLCONTEXT  ctx,
LPWSTR  buf,
LPDWORD  buflen 
)

Definition at line 2846 of file msi.c.

2848{
2849 awstring path;
2850
2851 TRACE( "%s %s %s 0x%x %p %p\n", debugstr_w(product), debugstr_w(comp), debugstr_w(usersid),
2852 ctx, buf, buflen );
2853
2854 path.unicode = TRUE;
2855 path.str.w = buf;
2856
2857 return MSI_GetComponentPath( product, comp, usersid, ctx, &path, buflen );
2858}

Referenced by MsiGetComponentPathW().

◆ MsiGetComponentPathW()

INSTALLSTATE WINAPI MsiGetComponentPathW ( LPCWSTR  product,
LPCWSTR  comp,
LPWSTR  buf,
LPDWORD  buflen 
)

Definition at line 2890 of file msi.c.

2891{
2892 return MsiGetComponentPathExW( product, comp, L"S-1-1-0", MSIINSTALLCONTEXT_ALL, buf, buflen );
2893}
INSTALLSTATE WINAPI MsiGetComponentPathExW(LPCWSTR product, LPCWSTR comp, LPCWSTR usersid, MSIINSTALLCONTEXT ctx, LPWSTR buf, LPDWORD buflen)
Definition: msi.c:2846

Referenced by MsiLocateComponentW(), and MsiProvideComponentW().

◆ MsiGetFeatureUsageA()

UINT WINAPI MsiGetFeatureUsageA ( LPCSTR  szProduct,
LPCSTR  szFeature,
LPDWORD  pdwUseCount,
LPWORD  pwDateUsed 
)

Definition at line 3250 of file msi.c.

3252{
3253 LPWSTR prod = NULL, feat = NULL;
3255
3256 TRACE("%s %s %p %p\n", debugstr_a(szProduct), debugstr_a(szFeature),
3257 pdwUseCount, pwDateUsed);
3258
3259 prod = strdupAtoW( szProduct );
3260 if (szProduct && !prod)
3261 goto end;
3262
3263 feat = strdupAtoW( szFeature );
3264 if (szFeature && !feat)
3265 goto end;
3266
3267 ret = MsiGetFeatureUsageW( prod, feat, pdwUseCount, pwDateUsed );
3268
3269end:
3270 free( prod );
3271 free( feat );
3272
3273 return ret;
3274}
UINT WINAPI MsiGetFeatureUsageW(LPCWSTR szProduct, LPCWSTR szFeature, LPDWORD pdwUseCount, LPWORD pwDateUsed)
Definition: msi.c:3239

◆ MsiGetFeatureUsageW()

UINT WINAPI MsiGetFeatureUsageW ( LPCWSTR  szProduct,
LPCWSTR  szFeature,
LPDWORD  pdwUseCount,
LPWORD  pwDateUsed 
)

Definition at line 3239 of file msi.c.

3241{
3242 FIXME("%s %s %p %p\n",debugstr_w(szProduct), debugstr_w(szFeature),
3243 pdwUseCount, pwDateUsed);
3245}

Referenced by MsiGetFeatureUsageA().

◆ MsiGetFileHashA()

UINT WINAPI MsiGetFileHashA ( const char szFilePath,
DWORD  dwOptions,
MSIFILEHASHINFO pHash 
)

Definition at line 4090 of file msi.c.

4091{
4092 LPWSTR file;
4093 UINT r;
4094
4095 TRACE( "%s, %#lx, %p\n", debugstr_a(szFilePath), dwOptions, pHash );
4096
4098 if (szFilePath && !file)
4099 return ERROR_OUTOFMEMORY;
4100
4101 r = MsiGetFileHashW( file, dwOptions, pHash );
4102 free( file );
4103 return r;
4104}
UINT WINAPI MsiGetFileHashW(const WCHAR *szFilePath, DWORD dwOptions, MSIFILEHASHINFO *pHash)
Definition: msi.c:4067
static WCHAR szFilePath[]
Definition: qotd.c:14

Referenced by test_MsiGetFileHash().

◆ MsiGetFileHashW()

UINT WINAPI MsiGetFileHashW ( const WCHAR szFilePath,
DWORD  dwOptions,
MSIFILEHASHINFO pHash 
)

Definition at line 4067 of file msi.c.

4068{
4069 TRACE( "%s, %#lx, %p\n", debugstr_w(szFilePath), dwOptions, pHash );
4070
4071 if (!szFilePath)
4073
4074 if (!*szFilePath)
4075 return ERROR_PATH_NOT_FOUND;
4076
4077 if (dwOptions)
4079 if (!pHash)
4081 if (pHash->dwFileHashInfoSize < sizeof *pHash)
4083
4084 return msi_get_filehash( NULL, szFilePath, pHash );
4085}
UINT msi_get_filehash(MSIPACKAGE *package, const WCHAR *path, MSIFILEHASHINFO *hash)
Definition: msi.c:4018
ULONG dwFileHashInfoSize
Definition: msi.h:230
#define ERROR_PATH_NOT_FOUND
Definition: winerror.h:106

Referenced by MsiGetFileHashA().

◆ MsiGetFileSignatureInformationA()

HRESULT WINAPI MsiGetFileSignatureInformationA ( const char path,
DWORD  flags,
PCCERT_CONTEXT cert,
BYTE hash,
DWORD hashlen 
)

Definition at line 2511 of file msi.c.

2513{
2514 UINT r;
2515 WCHAR *pathW = NULL;
2516
2517 TRACE( "%s, %#lx, %p, %p, %p\n", debugstr_a(path), flags, cert, hash, hashlen );
2518
2519 if (path && !(pathW = strdupAtoW( path ))) return E_OUTOFMEMORY;
2520 r = MsiGetFileSignatureInformationW( pathW, flags, cert, hash, hashlen );
2521 free( pathW );
2522 return r;
2523}
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
HRESULT WINAPI MsiGetFileSignatureInformationW(const WCHAR *path, DWORD flags, PCCERT_CONTEXT *cert, BYTE *hash, DWORD *hashlen)
Definition: msi.c:2525
GLbitfield flags
Definition: glext.h:7161
static BYTE cert[]
Definition: msg.c:1437

Referenced by test_MsiGetFileSignatureInformation().

◆ MsiGetFileSignatureInformationW()

HRESULT WINAPI MsiGetFileSignatureInformationW ( const WCHAR path,
DWORD  flags,
PCCERT_CONTEXT cert,
BYTE hash,
DWORD hashlen 
)

Definition at line 2525 of file msi.c.

2527{
2528 static GUID generic_verify_v2 = WINTRUST_ACTION_GENERIC_VERIFY_V2;
2529 HRESULT hr;
2532 CRYPT_PROVIDER_SGNR *signer;
2533 CRYPT_PROVIDER_CERT *provider;
2534
2535 TRACE( "%s, %#lx, %p, %p, %p\n", debugstr_w(path), flags, cert, hash, hashlen );
2536
2537 if (!path || !cert) return E_INVALIDARG;
2538
2539 info.cbStruct = sizeof(info);
2540 info.pcwszFilePath = path;
2541 info.hFile = NULL;
2542 info.pgKnownSubject = NULL;
2543
2544 memset( &data, 0, sizeof(data) );
2545 data.cbStruct = sizeof(data);
2546 data.dwUIChoice = WTD_UI_NONE;
2547 data.fdwRevocationChecks = WTD_REVOKE_WHOLECHAIN;
2548 data.dwUnionChoice = WTD_CHOICE_FILE;
2549 data.pFile = &info;
2550 data.dwStateAction = WTD_STATEACTION_VERIFY;
2551 data.dwUIContext = WTD_UICONTEXT_INSTALL;
2552
2553 hr = WinVerifyTrustEx( INVALID_HANDLE_VALUE, &generic_verify_v2, &data );
2554 *cert = NULL;
2555 if (FAILED(hr)) goto done;
2556
2557 if (!(signer = WTHelperGetProvSignerFromChain( data.hWVTStateData, 0, FALSE, 0 )))
2558 {
2560 goto done;
2561 }
2562 if (hash)
2563 {
2565 if (*hashlen < len)
2566 {
2567 *hashlen = len;
2569 goto done;
2570 }
2572 *hashlen = len;
2573 }
2574 if (!(provider = WTHelperGetProvCertFromChain( signer, 0 )))
2575 {
2577 goto done;
2578 }
2580
2581done:
2582 data.dwStateAction = WTD_STATEACTION_CLOSE;
2583 WinVerifyTrustEx( INVALID_HANDLE_VALUE, &generic_verify_v2, &data );
2584 return hr;
2585}
#define E_INVALIDARG
Definition: ddrawi.h:101
PCCERT_CONTEXT WINAPI CertDuplicateCertificateContext(PCCERT_CONTEXT pCertContext)
Definition: cert.c:360
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
#define FAILED(hr)
Definition: intsafe.h:51
#define WINTRUST_ACTION_GENERIC_VERIFY_V2
Definition: softpub.h:108
CRYPT_DATA_BLOB EncryptedHash
Definition: wincrypt.h:774
BYTE * pbData
Definition: wincrypt.h:103
PCCERT_CONTEXT pCert
Definition: wintrust.h:208
CMSG_SIGNER_INFO * psSigner
Definition: wintrust.h:237
#define TRUST_E_PROVIDER_UNKNOWN
Definition: winerror.h:3112
#define TRUST_E_NOSIGNATURE
Definition: winerror.h:3116
#define HRESULT_FROM_WIN32(x)
Definition: winerror.h:92
#define WTD_STATEACTION_CLOSE
Definition: wintrust.h:124
#define WTD_STATEACTION_VERIFY
Definition: wintrust.h:123
#define WTD_UICONTEXT_INSTALL
Definition: wintrust.h:143
#define WTD_UI_NONE
Definition: wintrust.h:84
#define WTD_REVOKE_WHOLECHAIN
Definition: wintrust.h:89
#define WTD_CHOICE_FILE
Definition: wintrust.h:91
CRYPT_PROVIDER_CERT *WINAPI WTHelperGetProvCertFromChain(CRYPT_PROVIDER_SGNR *pSgnr, DWORD idxCert)
CRYPT_PROVIDER_SGNR *WINAPI WTHelperGetProvSignerFromChain(CRYPT_PROVIDER_DATA *pProvData, DWORD idxSigner, BOOL fCounterSigner, DWORD idxCounterSigner)
HRESULT WINAPI WinVerifyTrustEx(HWND hwnd, GUID *ActionID, WINTRUST_DATA *ActionData)

Referenced by MsiGetFileSignatureInformationA().

◆ MsiGetFileVersionA()

UINT WINAPI MsiGetFileVersionA ( LPCSTR  szFilePath,
LPSTR  lpVersionBuf,
LPDWORD  pcchVersionBuf,
LPSTR  lpLangBuf,
LPDWORD  pcchLangBuf 
)

Definition at line 3088 of file msi.c.

3090{
3091 LPWSTR szwFilePath = NULL, lpwVersionBuff = NULL, lpwLangBuff = NULL;
3093
3094 if ((lpVersionBuf && !pcchVersionBuf) ||
3095 (lpLangBuf && !pcchLangBuf))
3097
3098 if( szFilePath )
3099 {
3100 szwFilePath = strdupAtoW( szFilePath );
3101 if( !szwFilePath )
3102 goto end;
3103 }
3104
3105 if( lpVersionBuf && pcchVersionBuf && *pcchVersionBuf )
3106 {
3107 lpwVersionBuff = malloc(*pcchVersionBuf * sizeof(WCHAR));
3108 if( !lpwVersionBuff )
3109 goto end;
3110 }
3111
3112 if( lpLangBuf && pcchLangBuf && *pcchLangBuf )
3113 {
3114 lpwLangBuff = malloc(*pcchLangBuf * sizeof(WCHAR));
3115 if( !lpwLangBuff )
3116 goto end;
3117 }
3118
3119 ret = MsiGetFileVersionW(szwFilePath, lpwVersionBuff, pcchVersionBuf,
3120 lpwLangBuff, pcchLangBuf);
3121
3122 if( (ret == ERROR_SUCCESS || ret == ERROR_MORE_DATA) && lpwVersionBuff )
3123 WideCharToMultiByte(CP_ACP, 0, lpwVersionBuff, -1,
3124 lpVersionBuf, *pcchVersionBuf + 1, NULL, NULL);
3125 if( (ret == ERROR_SUCCESS || ret == ERROR_MORE_DATA) && lpwLangBuff )
3126 WideCharToMultiByte(CP_ACP, 0, lpwLangBuff, -1,
3127 lpLangBuf, *pcchLangBuf + 1, NULL, NULL);
3128
3129end:
3130 free(szwFilePath);
3131 free(lpwVersionBuff);
3132 free(lpwLangBuff);
3133
3134 return ret;
3135}
UINT WINAPI MsiGetFileVersionW(const WCHAR *path, WCHAR *verbuf, DWORD *verlen, WCHAR *langbuf, DWORD *langlen)
Definition: msi.c:3208

Referenced by test_MsiGetFileVersion().

◆ MsiGetFileVersionW()

UINT WINAPI MsiGetFileVersionW ( const WCHAR path,
WCHAR verbuf,
DWORD verlen,
WCHAR langbuf,
DWORD langlen 
)

Definition at line 3208 of file msi.c.

3209{
3210 UINT ret;
3211
3212 TRACE( "%s, %p(%lu), %p(%lu)\n", debugstr_w(path), verbuf, verlen ? *verlen : 0, langbuf, langlen ? *langlen : 0 );
3213
3214 if ((verbuf && !verlen) || (langbuf && !langlen))
3216
3217 ret = get_file_version( path, verbuf, verlen, langbuf, langlen );
3218 if (ret == ERROR_RESOURCE_DATA_NOT_FOUND && verlen)
3219 {
3220 int len;
3222 if (!version) return ERROR_FILE_INVALID;
3223 len = lstrlenW( version );
3224 if (len >= *verlen) ret = ERROR_MORE_DATA;
3225 else if (verbuf)
3226 {
3227 lstrcpyW( verbuf, version );
3229 }
3230 *verlen = len;
3231 free( version );
3232 }
3233 return ret;
3234}
WCHAR * msi_get_font_file_version(MSIPACKAGE *package, const WCHAR *filename)
Definition: font.c:189
static UINT get_file_version(const WCHAR *path, WCHAR *verbuf, DWORD *verlen, WCHAR *langbuf, DWORD *langlen)
Definition: msi.c:3137

Referenced by MsiGetFileVersionA(), and ShowUsage().

◆ MsiGetPatchFileListA()

UINT WINAPI MsiGetPatchFileListA ( LPCSTR  szProductCode,
LPCSTR  szPatchList,
LPDWORD  pcFiles,
MSIHANDLE **  pphFileRecords 
)

Definition at line 1574 of file msi.c.

1576{
1577 FIXME("(%s, %s, %p, %p) stub!\n", debugstr_a(szProductCode),
1578 debugstr_a(szPatchList), pcFiles, pphFileRecords);
1579 return ERROR_FUNCTION_FAILED;
1580}

◆ MsiGetPatchFileListW()

UINT WINAPI MsiGetPatchFileListW ( LPCWSTR  szProductCode,
LPCWSTR  szPatchList,
LPDWORD  pcFiles,
MSIHANDLE **  pphFileRecords 
)

Definition at line 1582 of file msi.c.

1584{
1585 FIXME("(%s, %s, %p, %p) stub!\n", debugstr_w(szProductCode),
1586 debugstr_w(szPatchList), pcFiles, pphFileRecords);
1587 return ERROR_FUNCTION_FAILED;
1588}

◆ MsiGetPatchInfoA()

UINT WINAPI MsiGetPatchInfoA ( LPCSTR  patch,
LPCSTR  attr,
LPSTR  buffer,
LPDWORD  buflen 
)

Definition at line 1795 of file msi.c.

1796{
1798 DWORD size;
1799 LPWSTR patchW = NULL, attrW = NULL, bufferW = NULL;
1800
1801 TRACE("%s %s %p %p\n", debugstr_a(patch), debugstr_a(attr), buffer, buflen);
1802
1803 if (!patch || !attr)
1805
1806 if (!(patchW = strdupAtoW( patch )))
1807 goto done;
1808
1809 if (!(attrW = strdupAtoW( attr )))
1810 goto done;
1811
1812 size = 0;
1813 r = MsiGetPatchInfoW( patchW, attrW, NULL, &size );
1814 if (r != ERROR_SUCCESS)
1815 goto done;
1816
1817 size++;
1818 if (!(bufferW = malloc( size * sizeof(WCHAR) )))
1819 {
1821 goto done;
1822 }
1823
1824 r = MsiGetPatchInfoW( patchW, attrW, bufferW, &size );
1825 if (r == ERROR_SUCCESS)
1826 {
1827 int len = WideCharToMultiByte( CP_ACP, 0, bufferW, -1, NULL, 0, NULL, NULL );
1828 if (len > *buflen)
1830 else if (buffer)
1831 WideCharToMultiByte( CP_ACP, 0, bufferW, -1, buffer, *buflen, NULL, NULL );
1832
1833 *buflen = len - 1;
1834 }
1835
1836done:
1837 free( patchW );
1838 free( attrW );
1839 free( bufferW );
1840 return r;
1841}
UINT WINAPI MsiGetPatchInfoW(LPCWSTR patch, LPCWSTR attr, LPWSTR buffer, LPDWORD buflen)
Definition: msi.c:1843
Definition: cookie.c:202

Referenced by test_MsiGetPatchInfo().

◆ MsiGetPatchInfoExA()

UINT WINAPI MsiGetPatchInfoExA ( LPCSTR  szPatchCode,
LPCSTR  szProductCode,
LPCSTR  szUserSid,
MSIINSTALLCONTEXT  dwContext,
LPCSTR  szProperty,
LPSTR  lpValue,
DWORD pcchValue 
)

Definition at line 1590 of file msi.c.

1593{
1594 LPWSTR patch = NULL, product = NULL, usersid = NULL;
1595 LPWSTR property = NULL, val = NULL;
1596 DWORD len;
1597 UINT r;
1598
1599 TRACE("(%s, %s, %s, %d, %s, %p, %p)\n", debugstr_a(szPatchCode),
1600 debugstr_a(szProductCode), debugstr_a(szUserSid), dwContext,
1601 debugstr_a(szProperty), lpValue, pcchValue);
1602
1603 if (lpValue && !pcchValue)
1605
1606 if (szPatchCode) patch = strdupAtoW(szPatchCode);
1607 if (szProductCode) product = strdupAtoW(szProductCode);
1608 if (szUserSid) usersid = strdupAtoW(szUserSid);
1609 if (szProperty) property = strdupAtoW(szProperty);
1610
1611 len = 0;
1612 r = MsiGetPatchInfoExW(patch, product, usersid, dwContext, property,
1613 NULL, &len);
1614 if (r != ERROR_SUCCESS)
1615 goto done;
1616
1617 val = malloc(++len * sizeof(WCHAR));
1618 if (!val)
1619 {
1621 goto done;
1622 }
1623
1624 r = MsiGetPatchInfoExW(patch, product, usersid, dwContext, property,
1625 val, &len);
1626 if (r != ERROR_SUCCESS || !pcchValue)
1627 goto done;
1628
1629 if (lpValue)
1630 WideCharToMultiByte(CP_ACP, 0, val, -1, lpValue,
1631 *pcchValue - 1, NULL, NULL);
1632
1633 len = lstrlenW(val);
1634 if ((*val && *pcchValue < len + 1) || !lpValue)
1635 {
1636 if (lpValue)
1637 {
1639 lpValue[*pcchValue - 1] = '\0';
1640 }
1641
1642 *pcchValue = len * sizeof(WCHAR);
1643 }
1644 else
1645 *pcchValue = len;
1646
1647done:
1648 free(val);
1649 free(patch);
1650 free(product);
1651 free(usersid);
1652 free(property);
1653
1654 return r;
1655}
UINT WINAPI MsiGetPatchInfoExW(LPCWSTR szPatchCode, LPCWSTR szProductCode, LPCWSTR szUserSid, MSIINSTALLCONTEXT dwContext, LPCWSTR szProperty, LPWSTR lpValue, DWORD *pcchValue)
Definition: msi.c:1657

Referenced by test_MsiGetPatchInfoEx(), and test_patch_registration().

◆ MsiGetPatchInfoExW()

UINT WINAPI MsiGetPatchInfoExW ( LPCWSTR  szPatchCode,
LPCWSTR  szProductCode,
LPCWSTR  szUserSid,
MSIINSTALLCONTEXT  dwContext,
LPCWSTR  szProperty,
LPWSTR  lpValue,
DWORD pcchValue 
)

Definition at line 1657 of file msi.c.

1660{
1661 WCHAR *val = NULL, squashed_pc[SQUASHED_GUID_SIZE], squashed_patch[SQUASHED_GUID_SIZE];
1662 HKEY udprod = 0, prod = 0, props = 0;
1663 HKEY patch = 0, patches = 0;
1664 HKEY udpatch = 0, datakey = 0;
1665 HKEY prodpatches = 0;
1667 DWORD len, type;
1668 LONG res;
1669
1670 TRACE("(%s, %s, %s, %d, %s, %p, %p)\n", debugstr_w(szPatchCode),
1671 debugstr_w(szProductCode), debugstr_w(szUserSid), dwContext,
1672 debugstr_w(szProperty), lpValue, pcchValue);
1673
1674 if (!szProductCode || !squash_guid( szProductCode, squashed_pc ))
1676
1677 if (!szPatchCode || !squash_guid( szPatchCode, squashed_patch ))
1679
1680 if (!szProperty)
1682
1683 if (lpValue && !pcchValue)
1685
1686 if (dwContext != MSIINSTALLCONTEXT_USERMANAGED &&
1687 dwContext != MSIINSTALLCONTEXT_USERUNMANAGED &&
1688 dwContext != MSIINSTALLCONTEXT_MACHINE)
1690
1691 if (dwContext == MSIINSTALLCONTEXT_MACHINE && szUserSid)
1693
1694 if (szUserSid && !wcscmp( szUserSid, L"S-1-5-18" ))
1696
1697 if (MSIREG_OpenUserDataProductKey(szProductCode, dwContext, NULL,
1698 &udprod, FALSE) != ERROR_SUCCESS)
1699 goto done;
1700
1701 if (MSIREG_OpenInstallProps(szProductCode, dwContext, NULL,
1703 goto done;
1704
1706
1707 res = RegOpenKeyExW(udprod, L"Patches", 0, KEY_READ, &patches);
1708 if (res != ERROR_SUCCESS)
1709 goto done;
1710
1711 res = RegOpenKeyExW( patches, squashed_patch, 0, KEY_READ, &patch );
1712 if (res != ERROR_SUCCESS)
1713 goto done;
1714
1715 if (!wcscmp( szProperty, INSTALLPROPERTY_TRANSFORMSW ))
1716 {
1717 if (MSIREG_OpenProductKey(szProductCode, NULL, dwContext,
1718 &prod, FALSE) != ERROR_SUCCESS)
1719 goto done;
1720
1721 res = RegOpenKeyExW(prod, L"Patches", 0, KEY_ALL_ACCESS, &prodpatches);
1722 if (res != ERROR_SUCCESS)
1723 goto done;
1724
1725 datakey = prodpatches;
1726 szProperty = squashed_patch;
1727 }
1728 else
1729 {
1730 if (MSIREG_OpenUserDataPatchKey(szPatchCode, dwContext,
1731 &udpatch, FALSE) != ERROR_SUCCESS)
1732 goto done;
1733
1734 if (!wcscmp( szProperty, INSTALLPROPERTY_LOCALPACKAGEW ))
1735 {
1736 if (dwContext == MSIINSTALLCONTEXT_USERMANAGED)
1737 szProperty = L"ManagedLocalPackage";
1738 datakey = udpatch;
1739 }
1740 else if (!wcscmp( szProperty, INSTALLPROPERTY_INSTALLDATEW ))
1741 {
1742 datakey = patch;
1743 szProperty = L"Installed";
1744 }
1745 else if (!wcscmp( szProperty, INSTALLPROPERTY_UNINSTALLABLEW ) ||
1746 !wcscmp( szProperty, INSTALLPROPERTY_PATCHSTATEW ) ||
1747 !wcscmp( szProperty, INSTALLPROPERTY_DISPLAYNAMEW ) ||
1748 !wcscmp( szProperty, INSTALLPROPERTY_MOREINFOURLW ))
1749 {
1750 datakey = patch;
1751 }
1752 else
1753 {
1755 goto done;
1756 }
1757 }
1758
1759 val = reg_get_value(datakey, szProperty, &type);
1760 if (!val)
1761 val = wcsdup(L"");
1762
1763 r = ERROR_SUCCESS;
1764
1765 if (!pcchValue)
1766 goto done;
1767
1768 if (lpValue)
1769 lstrcpynW(lpValue, val, *pcchValue);
1770
1771 len = lstrlenW(val);
1772 if ((*val && *pcchValue < len + 1) || !lpValue)
1773 {
1774 if (lpValue)
1776
1777 *pcchValue = len * sizeof(WCHAR);
1778 }
1779
1780 *pcchValue = len;
1781
1782done:
1783 free(val);
1784 RegCloseKey(prodpatches);
1785 RegCloseKey(prod);
1786 RegCloseKey(patch);
1787 RegCloseKey(patches);
1788 RegCloseKey(udpatch);
1790 RegCloseKey(udprod);
1791
1792 return r;
1793}
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3333
static const WCHAR INSTALLPROPERTY_UNINSTALLABLEW[]
Definition: msi.h:376
static const WCHAR INSTALLPROPERTY_PATCHSTATEW[]
Definition: msi.h:384
static const WCHAR INSTALLPROPERTY_DISPLAYNAMEW[]
Definition: msi.h:396
static const WCHAR INSTALLPROPERTY_MOREINFOURLW[]
Definition: msi.h:400
UINT MSIREG_OpenUserDataPatchKey(LPCWSTR szPatch, MSIINSTALLCONTEXT dwContext, HKEY *key, BOOL create)
Definition: registry.c:610
#define KEY_ALL_ACCESS
Definition: nt_native.h:1041
#define KEY_READ
Definition: nt_native.h:1023
#define ERROR_UNKNOWN_PATCH
Definition: winerror.h:1005

Referenced by msi_apply_registered_patch(), MsiGetPatchInfoExA(), and MsiGetPatchInfoW().

◆ MsiGetPatchInfoW()

UINT WINAPI MsiGetPatchInfoW ( LPCWSTR  patch,
LPCWSTR  attr,
LPWSTR  buffer,
LPDWORD  buflen 
)

Definition at line 1843 of file msi.c.

1844{
1845 UINT r;
1846 WCHAR product[GUID_SIZE];
1847 DWORD index;
1848
1849 TRACE("%s %s %p %p\n", debugstr_w(patch), debugstr_w(attr), buffer, buflen);
1850
1851 if (!patch || !attr)
1853
1856
1857 index = 0;
1858 while (1)
1859 {
1860 r = MsiEnumProductsW( index, product );
1861 if (r != ERROR_SUCCESS)
1862 break;
1863
1864 r = MsiGetPatchInfoExW( patch, product, NULL, MSIINSTALLCONTEXT_USERMANAGED, attr, buffer, buflen );
1865 if (r == ERROR_SUCCESS || r == ERROR_MORE_DATA)
1866 return r;
1867
1868 r = MsiGetPatchInfoExW( patch, product, NULL, MSIINSTALLCONTEXT_USERUNMANAGED, attr, buffer, buflen );
1869 if (r == ERROR_SUCCESS || r == ERROR_MORE_DATA)
1870 return r;
1871
1872 r = MsiGetPatchInfoExW( patch, product, NULL, MSIINSTALLCONTEXT_MACHINE, attr, buffer, buflen );
1873 if (r == ERROR_SUCCESS || r == ERROR_MORE_DATA)
1874 return r;
1875
1876 index++;
1877 }
1878
1879 return ERROR_UNKNOWN_PRODUCT;
1880}
#define index(s, c)
Definition: various.h:29
UINT WINAPI MsiEnumProductsW(DWORD index, WCHAR *lpguid)
Definition: registry.c:1040

Referenced by MsiGetPatchInfoA(), and test_MsiGetPatchInfo().

◆ MsiGetProductCodeA()

UINT WINAPI MsiGetProductCodeA ( LPCSTR  szComponent,
LPSTR  szBuffer 
)

Definition at line 973 of file msi.c.

974{
975 LPWSTR szwComponent = NULL;
976 UINT r;
977 WCHAR szwBuffer[GUID_SIZE];
978
979 TRACE("%s %p\n", debugstr_a(szComponent), szBuffer);
980
981 if( szComponent )
982 {
983 szwComponent = strdupAtoW( szComponent );
984 if( !szwComponent )
985 return ERROR_OUTOFMEMORY;
986 }
987
988 *szwBuffer = '\0';
989 r = MsiGetProductCodeW( szwComponent, szwBuffer );
990
991 if(*szwBuffer)
992 WideCharToMultiByte(CP_ACP, 0, szwBuffer, -1, szBuffer, GUID_SIZE, NULL, NULL);
993
994 free( szwComponent );
995
996 return r;
997}
UINT WINAPI MsiGetProductCodeW(LPCWSTR szComponent, LPWSTR szBuffer)
Definition: msi.c:999

Referenced by MsiLocateComponentA(), and test_MsiGetProductCode().

◆ MsiGetProductCodeW()

UINT WINAPI MsiGetProductCodeW ( LPCWSTR  szComponent,
LPWSTR  szBuffer 
)

Definition at line 999 of file msi.c.

1000{
1001 UINT rc, index;
1002 HKEY compkey, prodkey;
1003 WCHAR squashed_comp[SQUASHED_GUID_SIZE], squashed_prod[SQUASHED_GUID_SIZE];
1004 DWORD sz = ARRAY_SIZE(squashed_prod);
1005
1006 TRACE("%s %p\n", debugstr_w(szComponent), szBuffer);
1007
1008 if (!szComponent || !*szComponent)
1010
1011 if (!squash_guid( szComponent, squashed_comp ))
1013
1014 if (MSIREG_OpenUserDataComponentKey(szComponent, NULL, &compkey, FALSE) != ERROR_SUCCESS &&
1015 MSIREG_OpenUserDataComponentKey(szComponent, L"S-1-5-18", &compkey, FALSE) != ERROR_SUCCESS)
1016 {
1018 }
1019
1020 rc = RegEnumValueW( compkey, 0, squashed_prod, &sz, NULL, NULL, NULL, NULL );
1021 if (rc != ERROR_SUCCESS)
1022 {
1023 RegCloseKey(compkey);
1025 }
1026
1027 /* check simple case, only one product */
1028 rc = RegEnumValueW( compkey, 1, squashed_prod, &sz, NULL, NULL, NULL, NULL );
1029 if (rc == ERROR_NO_MORE_ITEMS)
1030 {
1031 rc = ERROR_SUCCESS;
1032 goto done;
1033 }
1034
1035 index = 0;
1036 while ((rc = RegEnumValueW( compkey, index, squashed_prod, &sz, NULL, NULL, NULL, NULL )) !=
1038 {
1039 index++;
1040 sz = GUID_SIZE;
1041 unsquash_guid( squashed_prod, szBuffer );
1042
1043 if (MSIREG_OpenProductKey(szBuffer, NULL,
1045 &prodkey, FALSE) == ERROR_SUCCESS ||
1046 MSIREG_OpenProductKey(szBuffer, NULL,
1048 &prodkey, FALSE) == ERROR_SUCCESS ||
1049 MSIREG_OpenProductKey(szBuffer, NULL,
1051 &prodkey, FALSE) == ERROR_SUCCESS)
1052 {
1053 RegCloseKey(prodkey);
1054 rc = ERROR_SUCCESS;
1055 goto done;
1056 }
1057 }
1058
1060
1061done:
1062 RegCloseKey(compkey);
1063 unsquash_guid( squashed_prod, szBuffer );
1064 return rc;
1065}
LONG WINAPI RegEnumValueW(_In_ HKEY hKey, _In_ DWORD index, _Out_ LPWSTR value, _Inout_ PDWORD val_count, _Reserved_ PDWORD reserved, _Out_opt_ PDWORD type, _Out_opt_ LPBYTE data, _Inout_opt_ PDWORD count)
Definition: reg.c:2830
#define ERROR_INSTALL_FAILURE
Definition: winerror.h:961

Referenced by MsiGetProductCodeA(), and MsiLocateComponentW().

◆ MsiGetProductInfoA()

UINT WINAPI MsiGetProductInfoA ( LPCSTR  szProduct,
LPCSTR  szAttribute,
LPSTR  szBuffer,
LPDWORD  pcchValueBuf 
)

Definition at line 1254 of file msi.c.

1256{
1257 LPWSTR szwProduct, szwAttribute = NULL;
1260
1261 TRACE("%s %s %p %p\n", debugstr_a(szProduct), debugstr_a(szAttribute),
1262 szBuffer, pcchValueBuf);
1263
1264 szwProduct = strdupAtoW( szProduct );
1265 if( szProduct && !szwProduct )
1266 goto end;
1267
1268 szwAttribute = strdupAtoW( szAttribute );
1269 if( szAttribute && !szwAttribute )
1270 goto end;
1271
1272 buffer.unicode = FALSE;
1273 buffer.str.a = szBuffer;
1274
1275 r = MSI_GetProductInfo( szwProduct, szwAttribute,
1276 &buffer, pcchValueBuf );
1277
1278end:
1279 free( szwProduct );
1280 free( szwAttribute );
1281
1282 return r;
1283}
static UINT MSI_GetProductInfo(LPCWSTR szProduct, LPCWSTR szAttribute, awstring *szValue, LPDWORD pcchValueBuf)
Definition: msi.c:1088

Referenced by test_null(), test_simple_patch(), and test_states().

◆ MsiGetProductInfoExA()

UINT WINAPI MsiGetProductInfoExA ( LPCSTR  szProductCode,
LPCSTR  szUserSid,
MSIINSTALLCONTEXT  dwContext,
LPCSTR  szProperty,
LPSTR  szValue,
LPDWORD  pcchValue 
)

Definition at line 1300 of file msi.c.

1303{
1304 LPWSTR product = NULL;
1305 LPWSTR usersid = NULL;
1306 LPWSTR property = NULL;
1307 LPWSTR value = NULL;
1308 DWORD len = 0;
1309 UINT r;
1310
1311 TRACE("(%s, %s, %d, %s, %p, %p)\n", debugstr_a(szProductCode),
1312 debugstr_a(szUserSid), dwContext, debugstr_a(szProperty),
1313 szValue, pcchValue);
1314
1315 if (szValue && !pcchValue)
1317
1318 if (szProductCode) product = strdupAtoW(szProductCode);
1319 if (szUserSid) usersid = strdupAtoW(szUserSid);
1320 if (szProperty) property = strdupAtoW(szProperty);
1321
1322 r = MsiGetProductInfoExW(product, usersid, dwContext, property,
1323 NULL, &len);
1324 if (r != ERROR_SUCCESS)
1325 goto done;
1326
1327 value = malloc(++len * sizeof(WCHAR));
1328 if (!value)
1329 {
1331 goto done;
1332 }
1333
1334 r = MsiGetProductInfoExW(product, usersid, dwContext, property,
1335 value, &len);
1336 if (r != ERROR_SUCCESS)
1337 goto done;
1338
1339 if (!pcchValue)
1340 goto done;
1341
1342 len = WideCharToMultiByte(CP_ACP, 0, value, -1, NULL, 0, NULL, NULL);
1343 if (*pcchValue >= len)
1344 WideCharToMultiByte(CP_ACP, 0, value, -1, szValue, len, NULL, NULL);
1345 else if (szValue)
1346 {
1348 if (*pcchValue > 0)
1349 *szValue = '\0';
1350 }
1351
1352 if (*pcchValue <= len || !szValue)
1353 len = len * sizeof(WCHAR) - 1;
1354
1355 *pcchValue = len - 1;
1356
1357done:
1358 free(product);
1359 free(usersid);
1360 free(property);
1361 free(value);
1362
1363 return r;
1364}
UINT WINAPI MsiGetProductInfoExW(LPCWSTR szProductCode, LPCWSTR szUserSid, MSIINSTALLCONTEXT dwContext, LPCWSTR szProperty, LPWSTR szValue, LPDWORD pcchValue)
Definition: msi.c:1391
Definition: pdh_main.c:94

Referenced by test_MsiGetProductInfoEx().

◆ MsiGetProductInfoExW()

UINT WINAPI MsiGetProductInfoExW ( LPCWSTR  szProductCode,
LPCWSTR  szUserSid,
MSIINSTALLCONTEXT  dwContext,
LPCWSTR  szProperty,
LPWSTR  szValue,
LPDWORD  pcchValue 
)

Definition at line 1391 of file msi.c.

1394{
1395 WCHAR *val = NULL, squashed_pc[SQUASHED_GUID_SIZE];
1396 LPCWSTR package = NULL;
1397 HKEY props = NULL, prod, classes = NULL, managed, hkey = NULL;
1398 DWORD type;
1400
1401 TRACE("(%s, %s, %d, %s, %p, %p)\n", debugstr_w(szProductCode),
1402 debugstr_w(szUserSid), dwContext, debugstr_w(szProperty),
1403 szValue, pcchValue);
1404
1405 if (!szProductCode || !squash_guid( szProductCode, squashed_pc ))
1407
1408 if (szValue && !pcchValue)
1410
1411 if (dwContext != MSIINSTALLCONTEXT_USERUNMANAGED &&
1412 dwContext != MSIINSTALLCONTEXT_USERMANAGED &&
1413 dwContext != MSIINSTALLCONTEXT_MACHINE)
1415
1416 if (!szProperty || !*szProperty)
1418
1419 if (dwContext == MSIINSTALLCONTEXT_MACHINE && szUserSid)
1421
1422 /* FIXME: dwContext is provided, no need to search for it */
1424 &managed, FALSE);
1426 &prod, FALSE);
1427
1428 MSIREG_OpenInstallProps(szProductCode, dwContext, NULL, &props, FALSE);
1429
1430 if (dwContext == MSIINSTALLCONTEXT_USERUNMANAGED)
1431 {
1432 package = INSTALLPROPERTY_LOCALPACKAGEW;
1433
1434 if (!props && !prod)
1435 goto done;
1436 }
1437 else if (dwContext == MSIINSTALLCONTEXT_USERMANAGED)
1438 {
1439 package = L"ManagedLocalPackage";
1440
1441 if (!props && !managed)
1442 goto done;
1443 }
1444 else if (dwContext == MSIINSTALLCONTEXT_MACHINE)
1445 {
1446 package = INSTALLPROPERTY_LOCALPACKAGEW;
1447 MSIREG_OpenProductKey(szProductCode, NULL, dwContext, &classes, FALSE);
1448
1449 if (!props && !classes)
1450 goto done;
1451 }
1452
1453 if (!wcscmp( szProperty, INSTALLPROPERTY_HELPLINKW ) ||
1454 !wcscmp( szProperty, INSTALLPROPERTY_HELPTELEPHONEW ) ||
1455 !wcscmp( szProperty, INSTALLPROPERTY_INSTALLDATEW ) ||
1457 !wcscmp( szProperty, INSTALLPROPERTY_INSTALLLOCATIONW ) ||
1458 !wcscmp( szProperty, INSTALLPROPERTY_INSTALLSOURCEW ) ||
1459 !wcscmp( szProperty, INSTALLPROPERTY_LOCALPACKAGEW ) ||
1460 !wcscmp( szProperty, INSTALLPROPERTY_PUBLISHERW ) ||
1461 !wcscmp( szProperty, INSTALLPROPERTY_URLINFOABOUTW ) ||
1462 !wcscmp( szProperty, INSTALLPROPERTY_URLUPDATEINFOW ) ||
1463 !wcscmp( szProperty, INSTALLPROPERTY_VERSIONMINORW ) ||
1464 !wcscmp( szProperty, INSTALLPROPERTY_VERSIONMAJORW ) ||
1465 !wcscmp( szProperty, INSTALLPROPERTY_VERSIONSTRINGW ) ||
1466 !wcscmp( szProperty, INSTALLPROPERTY_PRODUCTIDW ) ||
1467 !wcscmp( szProperty, INSTALLPROPERTY_REGCOMPANYW ) ||
1468 !wcscmp( szProperty, INSTALLPROPERTY_REGOWNERW ) ||
1469 !wcscmp( szProperty, INSTALLPROPERTY_INSTANCETYPEW ))
1470 {
1471 val = reg_get_value(props, package, &type);
1472 if (!val)
1473 {
1474 if (prod || classes)
1476
1477 goto done;
1478 }
1479
1480 free(val);
1481
1483 szProperty = L"DisplayName";
1484 else if (!wcscmp( szProperty, INSTALLPROPERTY_VERSIONSTRINGW ))
1485 szProperty = L"DisplayVersion";
1486
1487 val = reg_get_value(props, szProperty, &type);
1488 if (!val)
1489 val = wcsdup(L"");
1490
1491 r = copy_outval(val, szValue, pcchValue);
1492 }
1493 else if (!wcscmp( szProperty, INSTALLPROPERTY_TRANSFORMSW ) ||
1494 !wcscmp( szProperty, INSTALLPROPERTY_LANGUAGEW ) ||
1495 !wcscmp( szProperty, INSTALLPROPERTY_PRODUCTNAMEW ) ||
1496 !wcscmp( szProperty, INSTALLPROPERTY_PACKAGECODEW ) ||
1497 !wcscmp( szProperty, INSTALLPROPERTY_VERSIONW ) ||
1498 !wcscmp( szProperty, INSTALLPROPERTY_PRODUCTICONW ) ||
1499 !wcscmp( szProperty, INSTALLPROPERTY_PACKAGENAMEW ) ||
1501 {
1502 if (!prod && !classes)
1503 goto done;
1504
1505 if (dwContext == MSIINSTALLCONTEXT_USERUNMANAGED)
1506 hkey = prod;
1507 else if (dwContext == MSIINSTALLCONTEXT_USERMANAGED)
1508 hkey = managed;
1509 else if (dwContext == MSIINSTALLCONTEXT_MACHINE)
1510 hkey = classes;
1511
1512 val = reg_get_value(hkey, szProperty, &type);
1513 if (!val)
1514 val = wcsdup(L"");
1515
1516 r = copy_outval(val, szValue, pcchValue);
1517 }
1518 else if (!wcscmp( szProperty, INSTALLPROPERTY_PRODUCTSTATEW ))
1519 {
1520 if (dwContext == MSIINSTALLCONTEXT_MACHINE)
1521 {
1522 if (props)
1523 {
1524 val = reg_get_value(props, package, &type);
1525 if (!val)
1526 goto done;
1527
1528 free(val);
1529 val = wcsdup(L"5");
1530 }
1531 else
1532 val = wcsdup(L"1");
1533
1534 r = copy_outval(val, szValue, pcchValue);
1535 goto done;
1536 }
1537 else if (props && (val = reg_get_value(props, package, &type)))
1538 {
1539 free(val);
1540 val = wcsdup(L"5");
1541 r = copy_outval(val, szValue, pcchValue);
1542 goto done;
1543 }
1544
1545 if (prod || managed)
1546 val = wcsdup(L"1");
1547 else
1548 goto done;
1549
1550 r = copy_outval(val, szValue, pcchValue);
1551 }
1552 else if (!wcscmp( szProperty, INSTALLPROPERTY_ASSIGNMENTTYPEW ))
1553 {
1554 if (!prod && !classes)
1555 goto done;
1556
1557 /* FIXME */
1558 val = wcsdup(L"");
1559 r = copy_outval(val, szValue, pcchValue);
1560 }
1561 else
1563
1564done:
1566 RegCloseKey(prod);
1567 RegCloseKey(managed);
1568 RegCloseKey(classes);
1569 free(val);
1570
1571 return r;
1572}
static BYTE * reg_get_value(HKEY hkey, const WCHAR *name, DWORD *type, DWORD *size)
Definition: action.c:2681
static UINT copy_outval(const WCHAR *val, WCHAR *out, DWORD *size)
Definition: msi.c:1366
static const WCHAR INSTALLPROPERTY_PRODUCTSTATEW[]
Definition: msi.h:380

Referenced by MsiGetProductInfoExA().

◆ MsiGetProductInfoW()

UINT WINAPI MsiGetProductInfoW ( LPCWSTR  szProduct,
LPCWSTR  szAttribute,
LPWSTR  szBuffer,
LPDWORD  pcchValueBuf 
)

Definition at line 1285 of file msi.c.

1287{
1289
1290 TRACE("%s %s %p %p\n", debugstr_w(szProduct), debugstr_w(szAttribute),
1291 szBuffer, pcchValueBuf);
1292
1293 buffer.unicode = TRUE;
1294 buffer.str.w = szBuffer;
1295
1296 return MSI_GetProductInfo( szProduct, szAttribute,
1297 &buffer, pcchValueBuf );
1298}

Referenced by InstallerImpl_ProductInfo().

◆ MsiGetProductPropertyA()

UINT WINAPI MsiGetProductPropertyA ( MSIHANDLE  hProduct,
const char szProperty,
char szValue,
DWORD pccbValue 
)

Definition at line 2590 of file msi.c.

2591{
2592 LPWSTR prop = NULL, val = NULL;
2593 DWORD len;
2594 UINT r;
2595
2596 TRACE( "%lu, %s, %p, %p\n", hProduct, debugstr_a(szProperty), szValue, pccbValue );
2597
2598 if (szValue && !pccbValue)
2600
2601 if (szProperty) prop = strdupAtoW(szProperty);
2602
2603 len = 0;
2604 r = MsiGetProductPropertyW(hProduct, prop, NULL, &len);
2605 if (r != ERROR_SUCCESS && r != ERROR_MORE_DATA)
2606 goto done;
2607
2608 if (r == ERROR_SUCCESS)
2609 {
2610 if (szValue) *szValue = '\0';
2611 if (pccbValue) *pccbValue = 0;
2612 goto done;
2613 }
2614
2615 val = malloc(++len * sizeof(WCHAR));
2616 if (!val)
2617 {
2619 goto done;
2620 }
2621
2622 r = MsiGetProductPropertyW(hProduct, prop, val, &len);
2623 if (r != ERROR_SUCCESS)
2624 goto done;
2625
2626 len = WideCharToMultiByte(CP_ACP, 0, val, -1, NULL, 0, NULL, NULL);
2627
2628 if (szValue)
2629 WideCharToMultiByte(CP_ACP, 0, val, -1, szValue,
2630 *pccbValue, NULL, NULL);
2631
2632 if (pccbValue)
2633 {
2634 if (len > *pccbValue)
2636
2637 *pccbValue = len - 1;
2638 }
2639
2640done:
2641 free(prop);
2642 free(val);
2643
2644 return r;
2645}
UINT WINAPI MsiGetProductPropertyW(MSIHANDLE hProduct, const WCHAR *szProperty, WCHAR *szValue, DWORD *pccbValue)
Definition: msi.c:2650

Referenced by test_MsiGetProductProperty(), and test_states().

◆ MsiGetProductPropertyW()

UINT WINAPI MsiGetProductPropertyW ( MSIHANDLE  hProduct,
const WCHAR szProperty,
WCHAR szValue,
DWORD pccbValue 
)

Definition at line 2650 of file msi.c.

2651{
2652 MSIPACKAGE *package;
2653 MSIQUERY *view = NULL;
2654 MSIRECORD *rec = NULL;
2655 LPCWSTR val;
2656 UINT r;
2657
2658 TRACE( "%lu, %s, %p, %p)\n", hProduct, debugstr_w(szProperty), szValue, pccbValue );
2659
2660 if (!szProperty)
2662
2663 if (szValue && !pccbValue)
2665
2666 package = msihandle2msiinfo(hProduct, MSIHANDLETYPE_PACKAGE);
2667 if (!package)
2668 return ERROR_INVALID_HANDLE;
2669
2670 r = MSI_OpenQuery(package->db, &view, L"SELECT * FROM `Property` WHERE `Property` = '%s'", szProperty);
2671 if (r != ERROR_SUCCESS)
2672 goto done;
2673
2674 r = MSI_ViewExecute(view, 0);
2675 if (r != ERROR_SUCCESS)
2676 goto done;
2677
2678 r = MSI_ViewFetch(view, &rec);
2679 if (r != ERROR_SUCCESS)
2680 goto done;
2681
2682 val = MSI_RecordGetString(rec, 2);
2683 if (!val)
2684 goto done;
2685
2686 if (lstrlenW(val) >= *pccbValue)
2687 {
2688 if (szValue) lstrcpynW(szValue, val, *pccbValue);
2690 }
2691 else
2692 {
2693 if (szValue) lstrcpyW(szValue, val);
2694 r = ERROR_SUCCESS;
2695 }
2696
2697 *pccbValue = lstrlenW(val);
2698
2699done:
2700 if (view)
2701 {
2703 msiobj_release(&view->hdr);
2704 if (rec) msiobj_release(&rec->hdr);
2705 }
2706
2707 if (!rec)
2708 {
2709 if (szValue) *szValue = '\0';
2710 if (pccbValue) *pccbValue = 0;
2711 r = ERROR_SUCCESS;
2712 }
2713
2714 msiobj_release(&package->hdr);
2715 return r;
2716}
UINT MSI_ViewExecute(MSIQUERY *, MSIRECORD *)
Definition: msiquery.c:502
UINT MSI_ViewClose(MSIQUERY *)
Definition: msiquery.c:454
const WCHAR * MSI_RecordGetString(const MSIRECORD *, UINT)
Definition: record.c:433
UINT WINAPIV MSI_OpenQuery(MSIDATABASE *, MSIQUERY **, LPCWSTR,...)
Definition: msiquery.c:138
UINT MSI_ViewFetch(MSIQUERY *, MSIRECORD **)
Definition: msiquery.c:377
MSIOBJECTHDR hdr
Definition: msipriv.h:151

Referenced by MsiGetProductPropertyA(), and test_MsiGetProductProperty().

◆ MsiGetShortcutTargetA()

UINT WINAPI MsiGetShortcutTargetA ( LPCSTR  szShortcutTarget,
LPSTR  szProductCode,
LPSTR  szFeatureId,
LPSTR  szComponentCode 
)

Definition at line 3836 of file msi.c.

3839{
3840 LPWSTR target;
3841 const int len = MAX_FEATURE_CHARS+1;
3843 UINT r;
3844
3845 target = strdupAtoW( szShortcutTarget );
3846 if (szShortcutTarget && !target )
3847 return ERROR_OUTOFMEMORY;
3848 product[0] = 0;
3849 feature[0] = 0;
3850 component[0] = 0;
3851 r = MsiGetShortcutTargetW( target, product, feature, component );
3852 free( target );
3853 if (r == ERROR_SUCCESS)
3854 {
3855 WideCharToMultiByte( CP_ACP, 0, product, -1, szProductCode, len, NULL, NULL );
3856 WideCharToMultiByte( CP_ACP, 0, feature, -1, szFeatureId, len, NULL, NULL );
3857 WideCharToMultiByte( CP_ACP, 0, component, -1, szComponentCode, len, NULL, NULL );
3858 }
3859 return r;
3860}
UINT WINAPI MsiGetShortcutTargetW(LPCWSTR szShortcutTarget, LPWSTR szProductCode, LPWSTR szFeatureId, LPWSTR szComponentCode)
Definition: msi.c:3865
GLenum target
Definition: glext.h:7315

◆ MsiGetShortcutTargetW()

UINT WINAPI MsiGetShortcutTargetW ( LPCWSTR  szShortcutTarget,
LPWSTR  szProductCode,
LPWSTR  szFeatureId,
LPWSTR  szComponentCode 
)

Definition at line 3865 of file msi.c.

3868{
3870 IPersistFile *pf = NULL;
3871 LPEXP_DARWIN_LINK darwin = NULL;
3872 HRESULT r, init;
3873
3874 TRACE("%s %p %p %p\n", debugstr_w(szShortcutTarget),
3875 szProductCode, szFeatureId, szComponentCode );
3876
3878
3879 r = CoCreateInstance( &CLSID_ShellLink, NULL, CLSCTX_INPROC_SERVER,
3880 &IID_IPersistFile, (LPVOID*) &pf );
3881 if( SUCCEEDED( r ) )
3882 {
3883 r = IPersistFile_Load( pf, szShortcutTarget,
3885 if( SUCCEEDED( r ) )
3886 {
3887 r = IPersistFile_QueryInterface( pf, &IID_IShellLinkDataList,
3888 (LPVOID*) &dl );
3889 if( SUCCEEDED( r ) )
3890 {
3891 IShellLinkDataList_CopyDataBlock( dl, EXP_DARWIN_ID_SIG,
3892 (LPVOID) &darwin );
3893 IShellLinkDataList_Release( dl );
3894 }
3895 }
3896 IPersistFile_Release( pf );
3897 }
3898
3899 if (SUCCEEDED(init))
3901
3902 TRACE("darwin = %p\n", darwin);
3903
3904 if (darwin)
3905 {
3906 DWORD sz;
3907 UINT ret;
3908
3910 szProductCode, szFeatureId, szComponentCode, &sz );
3911 LocalFree( darwin );
3912 return ret;
3913 }
3914
3915 return ERROR_FUNCTION_FAILED;
3916}
HRESULT WINAPI CoInitialize(LPVOID lpReserved)
Definition: compobj.c:1964
void WINAPI DECLSPEC_HOTPATCH CoUninitialize(void)
Definition: compobj.c:2067
HLOCAL NTAPI LocalFree(HLOCAL hMem)
Definition: heapmem.c:1594
#define SUCCEEDED(hr)
Definition: intsafe.h:50
#define STGM_SHARE_DENY_WRITE
Definition: objbase.h:922
#define STGM_READ
Definition: objbase.h:917
const GUID IID_IPersistFile
#define EXP_DARWIN_ID_SIG
Definition: shlobj.h:2055
static int init
Definition: wintirpc.c:33

Referenced by MsiGetShortcutTargetA().

◆ MsiGetUserInfoA()

USERINFOSTATE WINAPI MsiGetUserInfoA ( LPCSTR  szProduct,
LPSTR  lpUserNameBuf,
LPDWORD  pcchUserNameBuf,
LPSTR  lpOrgNameBuf,
LPDWORD  pcchOrgNameBuf,
LPSTR  lpSerialBuf,
LPDWORD  pcchSerialBuf 
)

Definition at line 3632 of file msi.c.

3636{
3638 LPWSTR prod;
3639 UINT r;
3640
3641 if ((lpUserNameBuf && !pcchUserNameBuf) ||
3642 (lpOrgNameBuf && !pcchOrgNameBuf) ||
3643 (lpSerialBuf && !pcchSerialBuf))
3645
3646 prod = strdupAtoW( szProduct );
3647 if (szProduct && !prod)
3648 return ERROR_OUTOFMEMORY;
3649
3650 user.unicode = FALSE;
3651 user.str.a = lpUserNameBuf;
3652 org.unicode = FALSE;
3653 org.str.a = lpOrgNameBuf;
3654 serial.unicode = FALSE;
3655 serial.str.a = lpSerialBuf;
3656
3657 r = MSI_GetUserInfo( prod, &user, pcchUserNameBuf,
3658 &org, pcchOrgNameBuf,
3659 &serial, pcchSerialBuf );
3660
3661 free( prod );
3662
3663 return r;
3664}
static USERINFOSTATE MSI_GetUserInfo(LPCWSTR szProduct, awstring *lpUserNameBuf, LPDWORD pcchUserNameBuf, awstring *lpOrgNameBuf, LPDWORD pcchOrgNameBuf, awstring *lpSerialBuf, LPDWORD pcchSerialBuf)
Definition: msi.c:3507

Referenced by test_MsiGetUserInfo().

◆ MsiGetUserInfoW()

USERINFOSTATE WINAPI MsiGetUserInfoW ( LPCWSTR  szProduct,
LPWSTR  lpUserNameBuf,
LPDWORD  pcchUserNameBuf,
LPWSTR  lpOrgNameBuf,
LPDWORD  pcchOrgNameBuf,
LPWSTR  lpSerialBuf,
LPDWORD  pcchSerialBuf 
)

Definition at line 3608 of file msi.c.

3612{
3614
3615 if ((lpUserNameBuf && !pcchUserNameBuf) ||
3616 (lpOrgNameBuf && !pcchOrgNameBuf) ||
3617 (lpSerialBuf && !pcchSerialBuf))
3619
3620 user.unicode = TRUE;
3621 user.str.w = lpUserNameBuf;
3622 org.unicode = TRUE;
3623 org.str.w = lpOrgNameBuf;
3624 serial.unicode = TRUE;
3625 serial.str.w = lpSerialBuf;
3626
3627 return MSI_GetUserInfo( szProduct, &user, pcchUserNameBuf,
3628 &org, pcchOrgNameBuf,
3629 &serial, pcchSerialBuf );
3630}

◆ MsiInstallMissingComponentA()

UINT WINAPI MsiInstallMissingComponentA ( LPCSTR  product,
LPCSTR  component,
INSTALLSTATE  state 
)

Definition at line 4167 of file msi.c.

4168{
4169 UINT r;
4170 WCHAR *productW = NULL, *componentW = NULL;
4171
4172 TRACE("%s, %s, %d\n", debugstr_a(product), debugstr_a(component), state);
4173
4174 if (product && !(productW = strdupAtoW( product )))
4175 return ERROR_OUTOFMEMORY;
4176
4177 if (component && !(componentW = strdupAtoW( component )))
4178 {
4179 free( productW );
4180 return ERROR_OUTOFMEMORY;
4181 }
4182
4183 r = MsiInstallMissingComponentW( productW, componentW, state );
4184 free( productW );
4185 free( componentW );
4186 return r;
4187}
UINT WINAPI MsiInstallMissingComponentW(LPCWSTR szProduct, LPCWSTR szComponent, INSTALLSTATE eInstallState)
Definition: msi.c:4192

◆ MsiInstallMissingComponentW()

UINT WINAPI MsiInstallMissingComponentW ( LPCWSTR  szProduct,
LPCWSTR  szComponent,
INSTALLSTATE  eInstallState 
)

Definition at line 4192 of file msi.c.

4193{
4194 FIXME("(%s %s %d\n", debugstr_w(szProduct), debugstr_w(szComponent), eInstallState);
4195 return ERROR_SUCCESS;
4196}

Referenced by MsiInstallMissingComponentA().

◆ MsiInstallProductA()

UINT WINAPI MsiInstallProductA ( LPCSTR  szPackagePath,
LPCSTR  szCommandLine 
)

Definition at line 198 of file msi.c.

199{
200 LPWSTR szwPath = NULL, szwCommand = NULL;
202
203 TRACE("%s %s\n",debugstr_a(szPackagePath), debugstr_a(szCommandLine));
204
205 if( szPackagePath )
206 {
207 szwPath = strdupAtoW( szPackagePath );
208 if( !szwPath )
209 goto end;
210 }
211
212 if( szCommandLine )
213 {
214 szwCommand = strdupAtoW( szCommandLine );
215 if( !szwCommand )
216 goto end;
217 }
218
219 r = MsiInstallProductW( szwPath, szwCommand );
220
221end:
222 free( szwPath );
223 free( szwCommand );
224
225 return r;
226}
UINT WINAPI MsiInstallProductW(LPCWSTR szPackagePath, LPCWSTR szCommandLine)
Definition: msi.c:228

Referenced by test_admin(), test_adminimage(), test_adminprops(), test_allusers_prop(), test_cabisextracted(), test_caborder(), test_command_line_parsing(), test_concurrentinstall(), test_continuouscabs(), test_create_remove_folder(), test_create_remove_shortcut(), test_currentworkingdir(), test_customaction1(), test_customaction51(), test_deferred_action(), test_delete_services(), test_duplicate_files(), test_envvar(), test_feature_override(), test_feature_tree(), test_file_in_use(), test_file_in_use_cab(), test_find_related_products(), test_icon_table(), test_ini_values(), test_install_remove_odbc(), test_install_services(), test_installed_prop(), test_installstate(), test_lastusedsource(), test_missingcab(), test_missingcomponent(), test_mixed_package(), test_mixedmedia(), test_move_files(), test_MsiConfigureProductEx(), test_MsiInstallProduct(), test_MsiProvideComponent(), test_package_validation(), test_patch_registration(), test_preselected(), test_process_components(), test_propcase(), test_publish(), test_publish_assemblies(), test_publish_components(), test_publish_features(), test_publish_product(), test_publish_sourcelist(), test_readonlyfile(), test_readonlyfile_cab(), test_register_class_info(), test_register_extension_info(), test_register_font(), test_register_mime_info(), test_register_product(), test_register_progid_info(), test_register_typelib(), test_register_user(), test_remove_duplicate_files(), test_remove_existing_products(), test_remove_files(), test_remove_upgrade_code(), test_samesequence(), test_self_registration(), test_setdirproperty(), test_setpropertyfolder(), test_shared_component(), test_shortcut(), test_simple_patch(), test_source_resolution(), test_sourcedir_props(), test_sourcedirprop(), test_sourcefolder(), test_sourcepath(), test_start_stop_services(), test_states(), test_system_tables(), test_top_level_action(), test_transformprop(), test_uiLevelFlags(), test_upgrade_code(), test_validate_product_id(), test_volume_props(), test_wow64(), and test_write_registry_values().

◆ MsiInstallProductW()

UINT WINAPI MsiInstallProductW ( LPCWSTR  szPackagePath,
LPCWSTR  szCommandLine 
)

Definition at line 228 of file msi.c.

229{
230 MSIPACKAGE *package = NULL;
231 const WCHAR *reinstallmode;
232 DWORD options = 0;
233 UINT r, len;
234
235 TRACE("%s %s\n",debugstr_w(szPackagePath), debugstr_w(szCommandLine));
236
237 if (!szPackagePath)
239
240 if (!*szPackagePath)
242
243 reinstallmode = msi_get_command_line_option(szCommandLine, L"REINSTALLMODE", &len);
244 if (reinstallmode)
245 {
246 while (len > 0)
247 {
248 if (reinstallmode[--len] == 'v' || reinstallmode[len] == 'V')
249 {
251 break;
252 }
253 }
254 }
255
256 r = MSI_OpenPackageW( szPackagePath, options, &package );
257 if (r == ERROR_SUCCESS)
258 {
259 r = MSI_InstallPackage( package, szPackagePath, szCommandLine );
260 msiobj_release( &package->hdr );
261 }
262
263 return r;
264}
const WCHAR * msi_get_command_line_option(const WCHAR *cmd, const WCHAR *option, UINT *len)
Definition: action.c:273
#define WINE_OPENPACKAGEFLAGS_RECACHE
Definition: msipriv.h:884

Referenced by install_file(), InstallerImpl_InstallProduct(), MsiInstallProductA(), and WinMain().

◆ MsiIsProductElevatedA()

UINT WINAPI MsiIsProductElevatedA ( LPCSTR  szProduct,
BOOL pfElevated 
)

Definition at line 4138 of file msi.c.

4139{
4140 FIXME("%s %p - stub\n",
4141 debugstr_a( szProduct ), pfElevated );
4142 *pfElevated = TRUE;
4143 return ERROR_SUCCESS;
4144}

◆ MsiIsProductElevatedW()

UINT WINAPI MsiIsProductElevatedW ( LPCWSTR  szProduct,
BOOL pfElevated 
)

Definition at line 4127 of file msi.c.

4128{
4129 FIXME("%s %p - stub\n",
4130 debugstr_w( szProduct ), pfElevated );
4131 *pfElevated = TRUE;
4132 return ERROR_SUCCESS;
4133}

◆ MsiJoinTransaction()

UINT WINAPI MsiJoinTransaction ( MSIHANDLE  handle,
DWORD  attrs,
HANDLE event 
)

Definition at line 4323 of file msi.c.

4324{
4325 FIXME( "%lu, %#lx, %p\n", handle, attrs, event );
4326
4327 *event = (HANDLE)0xdeadbeef;
4328 return ERROR_SUCCESS;
4329}

◆ 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,
2411 lpBuffer, nBufferMax, NULL, NULL );
2412 else
2413 r = 0;
2414 }
2415 free(bufW);
2416 return r;
2417}
static TAGREF LPCWSTR LPDWORD LPVOID lpBuffer
Definition: db.cpp:175
LANGID WINAPI MsiLoadStringW(MSIHANDLE handle, UINT id, WCHAR *lpBuffer, int nBufferMax, LANGID lang)
Definition: msi.c:2359
USHORT LANGID
Definition: mui.h:9
int32_t INT
Definition: typedefs.h:58

◆ MsiLoadStringW()

LANGID WINAPI MsiLoadStringW ( MSIHANDLE  handle,
UINT  id,
WCHAR lpBuffer,
int  nBufferMax,
LANGID  lang 
)

Definition at line 2359 of file msi.c.

2360{
2361 HRSRC hres;
2362 HGLOBAL hResData;
2363 LPWSTR p;
2364 DWORD i, len;
2365
2366 TRACE( "%lu, %u, %p, %d, %#x\n", handle, id, lpBuffer, nBufferMax, lang );
2367
2368 if( handle != -1 )
2369 FIXME( "don't know how to deal with handle = %lu\n", handle );
2370
2371 if( !lang )
2373
2375 if( !hres )
2376 return 0;
2377 hResData = LoadResource( msi_hInstance, hres );
2378 if( !hResData )
2379 return 0;
2380 p = LockResource( hResData );
2381 if( !p )
2382 return 0;
2383
2384 for (i = 0; i < (id & 0xf); i++) p += *p + 1;
2385 len = *p;
2386
2387 if( nBufferMax <= len )
2388 return 0;
2389
2390 memcpy( lpBuffer, p+1, len * sizeof(WCHAR));
2391 lpBuffer[ len ] = 0;
2392
2393 TRACE("found -> %s\n", debugstr_w(lpBuffer));
2394 return lang;
2395}
LPVOID WINAPI LockResource(HGLOBAL handle)
Definition: res.c:550
HRSRC WINAPI FindResourceExW(HMODULE hModule, LPCWSTR type, LPCWSTR name, WORD lang)
Definition: res.c:164
HGLOBAL WINAPI LoadResource(HINSTANCE hModule, HRSRC hRsrc)
Definition: res.c:532
LANGID WINAPI GetUserDefaultLangID(void)
Definition: locale.c:1177
HINSTANCE msi_hInstance
Definition: msi_main.c:51
HRESULT hres
Definition: protocol.c:465
#define RT_STRING
Definition: pedump.c:368

Referenced by MsiLoadStringA().

◆ MsiLocateComponentA()

INSTALLSTATE WINAPI MsiLocateComponentA ( LPCSTR  szComponent,
LPSTR  lpPathBuf,
LPDWORD  pcchBuf 
)

Definition at line 2419 of file msi.c.

2421{
2422 char szProduct[GUID_SIZE];
2423
2424 TRACE("%s %p %p\n", debugstr_a(szComponent), lpPathBuf, pcchBuf);
2425
2426 if (!szComponent || !pcchBuf)
2428
2429 if (MsiGetProductCodeA( szComponent, szProduct ) != ERROR_SUCCESS)
2430 return INSTALLSTATE_UNKNOWN;
2431
2432 return MsiGetComponentPathA( szProduct, szComponent, lpPathBuf, pcchBuf );
2433}
UINT WINAPI MsiGetProductCodeA(LPCSTR szComponent, LPSTR szBuffer)
Definition: msi.c:973
INSTALLSTATE WINAPI MsiGetComponentPathA(LPCSTR product, LPCSTR comp, LPSTR buf, LPDWORD buflen)
Definition: msi.c:2898

Referenced by test_MsiGetComponentPath().

◆ MsiLocateComponentW()

INSTALLSTATE WINAPI MsiLocateComponentW ( LPCWSTR  szComponent,
LPWSTR  lpPathBuf,
LPDWORD  pcchBuf 
)

Definition at line 2435 of file msi.c.

2437{
2438 WCHAR szProduct[GUID_SIZE];
2439
2440 TRACE("%s %p %p\n", debugstr_w(szComponent), lpPathBuf, pcchBuf);
2441
2442 if (!szComponent || !pcchBuf)
2444
2445 if (MsiGetProductCodeW( szComponent, szProduct ) != ERROR_SUCCESS)
2446 return INSTALLSTATE_UNKNOWN;
2447
2448 return MsiGetComponentPathW( szProduct, szComponent, lpPathBuf, pcchBuf );
2449}
INSTALLSTATE WINAPI MsiGetComponentPathW(LPCWSTR product, LPCWSTR comp, LPWSTR buf, LPDWORD buflen)
Definition: msi.c:2890

Referenced by search_components().

◆ MsiMessageBoxA()

UINT WINAPI MsiMessageBoxA ( HWND  hWnd,
const char lpText,
const char lpCaption,
UINT  uType,
WORD  wLanguageId,
DWORD  f 
)

Definition at line 2451 of file msi.c.

2453{
2454 FIXME( "%p, %s, %s, %u, %#x, %#lx\n", hWnd, debugstr_a(lpText), debugstr_a(lpCaption), uType, wLanguageId, f );
2455 return MessageBoxExA( hWnd, lpText, lpCaption, uType, wLanguageId );
2456}
HWND hWnd
Definition: settings.c:17
GLfloat f
Definition: glext.h:7540
int WINAPI MessageBoxExA(_In_opt_ HWND hWnd, _In_opt_ LPCSTR lpText, _In_opt_ LPCSTR lpCaption, _In_ UINT uType, _In_ WORD wLanguageId)

Referenced by report_error().

◆ MsiMessageBoxExA()

UINT WINAPI MsiMessageBoxExA ( HWND  hWnd,
const char lpText,
const char lpCaption,
UINT  uType,
DWORD  unknown,
WORD  wLanguageId,
DWORD  f 
)

Definition at line 2465 of file msi.c.

2467{
2468 FIXME( "%p, %s, %s, %u, %#lx, %#x, %#lx): semi-stub\n", hWnd, debugstr_a(lpText), debugstr_a(lpCaption), uType,
2469 unknown, wLanguageId, f );
2470 return MessageBoxExA( hWnd, lpText, lpCaption, uType, wLanguageId );
2471}
static WCHAR unknown[MAX_STRING_RESOURCE_LEN]
Definition: object.c:1605

◆ MsiMessageBoxExW()

UINT WINAPI MsiMessageBoxExW ( HWND  hWnd,
const WCHAR lpText,
const WCHAR lpCaption,
UINT  uType,
DWORD  unknown,
WORD  wLanguageId,
DWORD  f 
)

Definition at line 2473 of file msi.c.

2475{
2476 FIXME( "%p, %s, %s, %u, %#lx, %#x, %#lx): semi-stub\n", hWnd, debugstr_w(lpText), debugstr_w(lpCaption), uType,
2477 unknown, wLanguageId, f );
2478 return MessageBoxExW( hWnd, lpText, lpCaption, uType, wLanguageId );
2479}
int WINAPI MessageBoxExW(_In_opt_ HWND hWnd, _In_opt_ LPCWSTR lpText, _In_opt_ LPCWSTR lpCaption, _In_ UINT uType, _In_ WORD wLanguageId)

◆ MsiMessageBoxW()

UINT WINAPI MsiMessageBoxW ( HWND  hWnd,
const WCHAR lpText,
const WCHAR lpCaption,
UINT  uType,
WORD  wLanguageId,
DWORD  f 
)

Definition at line 2458 of file msi.c.

2460{
2461 FIXME( "%p, %s, %s, %u, %#x %#lx\n", hWnd, debugstr_w(lpText), debugstr_w(lpCaption), uType, wLanguageId, f );
2462 return MessageBoxExW( hWnd, lpText, lpCaption, uType, wLanguageId );
2463}

Referenced by ShowUsage().

◆ MsiOpenProductA()

UINT WINAPI MsiOpenProductA ( LPCSTR  szProduct,
MSIHANDLE phProduct 
)

Definition at line 80 of file msi.c.

81{
82 UINT r;
83 LPWSTR szwProd = NULL;
84
85 TRACE("%s %p\n",debugstr_a(szProduct), phProduct);
86
87 if( szProduct )
88 {
89 szwProd = strdupAtoW( szProduct );
90 if( !szwProd )
91 return ERROR_OUTOFMEMORY;
92 }
93
94 r = MsiOpenProductW( szwProd, phProduct );
95
96 free( szwProd );
97
98 return r;
99}

Referenced by MsiCollectUserInfoA(), test_MsiGetProductProperty(), test_MsiOpenProduct(), test_states(), and test_system_tables().

◆ MsiOpenProductW()

UINT WINAPI MsiOpenProductW ( LPCWSTR  szProduct,
MSIHANDLE phProduct 
)

Definition at line 142 of file msi.c.

143{
144 MSIPACKAGE *package = NULL;
145 WCHAR squashed_pc[SQUASHED_GUID_SIZE];
146 UINT r;
147
148 if (!szProduct || !squash_guid( szProduct, squashed_pc ))
150
151 if (!phProduct)
153
154 r = MSI_OpenProductW(szProduct, &package);
155 if (r != ERROR_SUCCESS)
156 return r;
157
158 *phProduct = alloc_msihandle(&package->hdr);
159 if (!*phProduct)
161
162 msiobj_release(&package->hdr);
163 return r;
164}
#define ERROR_NOT_ENOUGH_MEMORY
Definition: dderror.h:7
MSIHANDLE alloc_msihandle(MSIOBJECTHDR *obj)
Definition: handle.c:111

Referenced by MsiCollectUserInfoW(), and MsiOpenProductA().

◆ MsiProvideAssemblyA()

UINT WINAPI MsiProvideAssemblyA ( const char szAssemblyName,
const char szAppContext,
DWORD  dwInstallMode,
DWORD  dwAssemblyInfo,
char lpPathBuf,
DWORD pcchPathBuf 
)

Definition at line 2481 of file msi.c.

2483{
2484 FIXME( "%s, %s, %#lx, %#lx, %p, %p\n", debugstr_a(szAssemblyName), debugstr_a(szAppContext), dwInstallMode,
2485 dwAssemblyInfo, lpPathBuf, pcchPathBuf );
2487}
static LPCWSTR szAssemblyName
Definition: asmenum.c:37

◆ MsiProvideAssemblyW()

UINT WINAPI MsiProvideAssemblyW ( const WCHAR szAssemblyName,
const WCHAR szAppContext,
DWORD  dwInstallMode,
DWORD  dwAssemblyInfo,
WCHAR lpPathBuf,
DWORD pcchPathBuf 
)

Definition at line 2489 of file msi.c.

2491{
2492 FIXME( "%s, %s, %#lx, %#lx, %p, %p\n", debugstr_w(szAssemblyName), debugstr_w(szAppContext), dwInstallMode,
2493 dwAssemblyInfo, lpPathBuf, pcchPathBuf );
2495}

◆ MsiProvideComponentA()

UINT WINAPI MsiProvideComponentA ( const char product,
const char feature,
const char component,
DWORD  mode,
char buf,
DWORD buflen 
)

Definition at line 4198 of file msi.c.

4200{
4201 WCHAR *productW = NULL, *componentW = NULL, *featureW = NULL, *bufW = NULL;
4203 DWORD lenW = 0;
4204 int len;
4205
4206 TRACE( "%s, %s, %s, %#lx, %p, %p\n", debugstr_a(product), debugstr_a(component), debugstr_a(feature), mode,
4207 buf, buflen );
4208
4209 if (product && !(productW = strdupAtoW( product ))) goto done;
4210 if (feature && !(featureW = strdupAtoW( feature ))) goto done;
4211 if (component && !(componentW = strdupAtoW( component ))) goto done;
4212
4213 r = MsiProvideComponentW( productW, featureW, componentW, mode, NULL, &lenW );
4214 if (r != ERROR_SUCCESS)
4215 goto done;
4216
4217 if (!(bufW = malloc( ++lenW * sizeof(WCHAR) )))
4218 {
4220 goto done;
4221 }
4222
4223 r = MsiProvideComponentW( productW, featureW, componentW, mode, bufW, &lenW );
4224 if (r != ERROR_SUCCESS)
4225 goto done;
4226
4227 len = WideCharToMultiByte( CP_ACP, 0, bufW, -1, NULL, 0, NULL, NULL );
4228 if (buf)
4229 {
4230 if (len > *buflen)
4232 else
4233 WideCharToMultiByte( CP_ACP, 0, bufW, -1, buf, *buflen, NULL, NULL );
4234 }
4235
4236 *buflen = len - 1;
4237
4238done:
4239 free( productW );
4240 free( featureW );
4241 free( componentW );
4242 free( bufW );
4243 return r;
4244}
UINT WINAPI MsiProvideComponentW(const WCHAR *product, const WCHAR *feature, const WCHAR *component, DWORD mode, WCHAR *buf, DWORD *buflen)
Definition: msi.c:4246
GLenum mode
Definition: glext.h:6217

Referenced by test_MsiProvideComponent().

◆ MsiProvideComponentFromDescriptorA()

UINT WINAPI MsiProvideComponentFromDescriptorA ( LPCSTR  szDescriptor,
LPSTR  szPath,
LPDWORD  pcchPath,
LPDWORD  pcchArgs 
)

Definition at line 2497 of file msi.c.

2499{
2500 FIXME("%s %p %p %p\n", debugstr_a(szDescriptor), szPath, pcchPath, pcchArgs );
2502}
LPCWSTR szPath
Definition: env.c:37
static LPWSTR PDWORD pcchPath
Definition: asmcache.c:747

◆ MsiProvideComponentFromDescriptorW()

UINT WINAPI MsiProvideComponentFromDescriptorW ( LPCWSTR  szDescriptor,
LPWSTR  szPath,
LPDWORD  pcchPath,
LPDWORD  pcchArgs 
)

Definition at line 2504 of file msi.c.

2506{
2507 FIXME("%s %p %p %p\n", debugstr_w(szDescriptor), szPath, pcchPath, pcchArgs );
2509}

◆ MsiProvideComponentW()

UINT WINAPI MsiProvideComponentW ( const WCHAR product,
const WCHAR feature,
const WCHAR component,
DWORD  mode,
WCHAR buf,
DWORD buflen 
)

Definition at line 4246 of file msi.c.

4248{
4250
4251 TRACE( "%s, %s, %s, %#lx, %p, %p\n", debugstr_w(product), debugstr_w(component), debugstr_w(feature), mode,
4252 buf, buflen);
4253
4254 state = MsiQueryFeatureStateW( product, feature );
4255 TRACE("feature state: %d\n", state);
4256 switch (mode)
4257 {
4259 break;
4260
4261 default:
4262 FIXME( "mode %#lx not implemented\n", mode );
4263 return ERROR_INSTALL_FAILURE;
4264 }
4265
4266 state = MsiGetComponentPathW( product, component, buf, buflen );
4267 TRACE("component state: %d\n", state);
4268 switch (state)
4269 {
4272
4274 return ERROR_MORE_DATA;
4275
4277 case INSTALLSTATE_LOCAL:
4279 MsiUseFeatureW( product, feature );
4280 return ERROR_SUCCESS;
4281
4282 default:
4283 TRACE("MsiGetComponentPathW returned %d\n", state);
4284 return ERROR_INSTALL_FAILURE;
4285 }
4286}
INSTALLSTATE WINAPI MsiQueryFeatureStateW(LPCWSTR szProduct, LPCWSTR szFeature)
Definition: msi.c:3062
INSTALLSTATE WINAPI MsiUseFeatureW(LPCWSTR szProduct, LPCWSTR szFeature)
Definition: msi.c:3331
@ INSTALLMODE_NODETECTION
Definition: msi.h:164

Referenced by MsiProvideComponentA(), and test_MsiProvideComponent().

◆ MsiProvideQualifiedComponentA()

UINT WINAPI MsiProvideQualifiedComponentA ( LPCSTR  szComponent,
LPCSTR  szQualifier,
DWORD  dwInstallMode,
LPSTR  lpPathBuf,
LPDWORD  pcchPathBuf 
)

Definition at line 3496 of file msi.c.

3499{
3500 return MsiProvideQualifiedComponentExA(szComponent, szQualifier,
3501 dwInstallMode, NULL, 0, 0, lpPathBuf, pcchPathBuf);
3502}
UINT WINAPI MsiProvideQualifiedComponentExA(const char *szComponent, const char *szQualifier, DWORD dwInstallMode, const char *szProduct, DWORD Unused1, DWORD Unused2, char *lpPathBuf, DWORD *pcchPathBuf)
Definition: msi.c:3445

Referenced by test_publish_components().

◆ MsiProvideQualifiedComponentExA()

UINT WINAPI MsiProvideQualifiedComponentExA ( const char szComponent,
const char szQualifier,
DWORD  dwInstallMode,
const char szProduct,
DWORD  Unused1,
DWORD  Unused2,
char lpPathBuf,
DWORD pcchPathBuf 
)

Definition at line 3445 of file msi.c.

3448{
3449 WCHAR *szwComponent, *szwQualifier = NULL, *szwProduct = NULL;
3451 awstring path;
3452
3453 TRACE( "%s, %s, %lu, %s, %#lx, %#lx, %p, %p\n", debugstr_a(szComponent), debugstr_a(szQualifier), dwInstallMode,
3454 debugstr_a(szProduct), Unused1, Unused2, lpPathBuf, pcchPathBuf );
3455
3456 szwComponent = strdupAtoW( szComponent );
3457 if (szComponent && !szwComponent)
3458 goto end;
3459
3460 szwQualifier = strdupAtoW( szQualifier );
3461 if (szQualifier && !szwQualifier)
3462 goto end;
3463
3464 szwProduct = strdupAtoW( szProduct );
3465 if (szProduct && !szwProduct)
3466 goto end;
3467
3468 path.unicode = FALSE;
3469 path.str.a = lpPathBuf;
3470
3471 r = MSI_ProvideQualifiedComponentEx(szwComponent, szwQualifier,
3472 dwInstallMode, szwProduct, Unused1,
3473 Unused2, &path, pcchPathBuf);
3474end:
3475 free(szwProduct);
3476 free(szwComponent);
3477 free(szwQualifier);
3478
3479 return r;
3480}
static UINT MSI_ProvideQualifiedComponentEx(LPCWSTR szComponent, LPCWSTR szQualifier, DWORD dwInstallMode, LPCWSTR szProduct, DWORD Unused1, DWORD Unused2, awstring *lpPathBuf, LPDWORD pcchPathBuf)
Definition: msi.c:3367

Referenced by MsiProvideQualifiedComponentA(), and test_MsiProvideQualifiedComponentEx().

◆ MsiProvideQualifiedComponentExW()

UINT WINAPI MsiProvideQualifiedComponentExW ( const WCHAR szComponent,
const WCHAR szQualifier,
DWORD  dwInstallMode,
const WCHAR szProduct,
DWORD  Unused1,
DWORD  Unused2,
WCHAR lpPathBuf,
DWORD pcchPathBuf 
)

Definition at line 3426 of file msi.c.

3429{
3430 awstring path;
3431
3432 TRACE( "%s, %s, %lu, %s, %#lx, %#lx, %p, %p\n", debugstr_w(szComponent), debugstr_w(szQualifier), dwInstallMode,
3433 debugstr_w(szProduct), Unused1, Unused2, lpPathBuf, pcchPathBuf );
3434
3435 path.unicode = TRUE;
3436 path.str.w = lpPathBuf;
3437
3438 return MSI_ProvideQualifiedComponentEx( szComponent, szQualifier, dwInstallMode, szProduct, Unused1, Unused2,
3439 &path, pcchPathBuf );
3440}

Referenced by MsiProvideQualifiedComponentW().

◆ MsiProvideQualifiedComponentW()

UINT WINAPI MsiProvideQualifiedComponentW ( LPCWSTR  szComponent,
LPCWSTR  szQualifier,
DWORD  dwInstallMode,
LPWSTR  lpPathBuf,
LPDWORD  pcchPathBuf 
)

Definition at line 3485 of file msi.c.

3488{
3489 return MsiProvideQualifiedComponentExW(szComponent, szQualifier,
3490 dwInstallMode, NULL, 0, 0, lpPathBuf, pcchPathBuf);
3491}
UINT WINAPI MsiProvideQualifiedComponentExW(const WCHAR *szComponent, const WCHAR *szQualifier, DWORD dwInstallMode, const WCHAR *szProduct, DWORD Unused1, DWORD Unused2, WCHAR *lpPathBuf, DWORD *pcchPathBuf)
Definition: msi.c:3426

◆ MsiQueryComponentStateA()

UINT WINAPI MsiQueryComponentStateA ( LPCSTR  szProductCode,
LPCSTR  szUserSid,
MSIINSTALLCONTEXT  dwContext,
LPCSTR  szComponent,
INSTALLSTATE pdwState 
)

Definition at line 2055 of file msi.c.

2058{
2059 LPWSTR prodcode = NULL, usersid = NULL, comp = NULL;
2060 UINT r;
2061
2062 TRACE("(%s, %s, %d, %s, %p)\n", debugstr_a(szProductCode),
2063 debugstr_a(szUserSid), dwContext, debugstr_a(szComponent), pdwState);
2064
2065 if (szProductCode && !(prodcode = strdupAtoW(szProductCode)))
2066 return ERROR_OUTOFMEMORY;
2067
2068 if (szUserSid && !(usersid = strdupAtoW(szUserSid)))
2069 return ERROR_OUTOFMEMORY;
2070
2071 if (szComponent && !(comp = strdupAtoW(szComponent)))
2072 return ERROR_OUTOFMEMORY;
2073
2074 r = MsiQueryComponentStateW(prodcode, usersid, dwContext, comp, pdwState);
2075
2076 free(prodcode);
2077 free(usersid);
2078 free(comp);
2079
2080 return r;
2081}
UINT WINAPI MsiQueryComponentStateW(LPCWSTR szProductCode, LPCWSTR szUserSid, MSIINSTALLCONTEXT dwContext, LPCWSTR szComponent, INSTALLSTATE *pdwState)
Definition: msi.c:2140

Referenced by test_MsiQueryComponentState(), and test_publish().

◆ MsiQueryComponentStateW()

UINT WINAPI MsiQueryComponentStateW ( LPCWSTR  szProductCode,
LPCWSTR  szUserSid,
MSIINSTALLCONTEXT  dwContext,
LPCWSTR  szComponent,
INSTALLSTATE pdwState 
)

Definition at line 2140 of file msi.c.

2143{
2144 WCHAR squashed_pc[SQUASHED_GUID_SIZE];
2145 BOOL found;
2146 DWORD sz;
2147
2148 TRACE("(%s, %s, %d, %s, %p)\n", debugstr_w(szProductCode),
2149 debugstr_w(szUserSid), dwContext, debugstr_w(szComponent), pdwState);
2150
2151 if (!pdwState || !szComponent)
2153
2154 if (!szProductCode || !*szProductCode || lstrlenW(szProductCode) != GUID_SIZE - 1)
2156
2157 if (!squash_guid( szProductCode, squashed_pc ))
2159
2160 found = comp_find_prod_key(szProductCode, dwContext);
2161
2162 if (!comp_find_package(szProductCode, dwContext))
2163 {
2164 if (found)
2165 {
2166 *pdwState = INSTALLSTATE_UNKNOWN;
2168 }
2169
2170 return ERROR_UNKNOWN_PRODUCT;
2171 }
2172
2173 *pdwState = INSTALLSTATE_UNKNOWN;
2174
2175 sz = 0;
2176 if (comp_find_prodcode( squashed_pc, dwContext, szComponent, NULL, &sz ))
2178
2179 if (sz == 0)
2180 *pdwState = INSTALLSTATE_NOTUSED;
2181 else
2182 {
2183 WCHAR *val;
2184 UINT r;
2185
2186 if (!(val = malloc( sz ))) return ERROR_OUTOFMEMORY;
2187 if ((r = comp_find_prodcode( squashed_pc, dwContext, szComponent, val, &sz )))
2188 {
2189 free(val);
2190 return r;
2191 }
2192
2193 if (lstrlenW(val) > 2 &&
2194 val[0] >= '0' && val[0] <= '9' && val[1] >= '0' && val[1] <= '9' && val[2] != ':')
2195 {
2196 *pdwState = INSTALLSTATE_SOURCE;
2197 }
2198 else
2199 *pdwState = INSTALLSTATE_LOCAL;
2200 free( val );
2201 }
2202
2203 TRACE("-> %d\n", *pdwState);
2204 return ERROR_SUCCESS;
2205}
static BOOL comp_find_prod_key(const WCHAR *prodcode, MSIINSTALLCONTEXT context)
Definition: msi.c:2083
static UINT comp_find_prodcode(const WCHAR *squashed_pc, MSIINSTALLCONTEXT context, const WCHAR *comp, WCHAR *val, DWORD *sz)
Definition: msi.c:2117
static BOOL comp_find_package(const WCHAR *prodcode, MSIINSTALLCONTEXT context)
Definition: msi.c:2093

Referenced by ACTION_GetComponentInstallStates(), and MsiQueryComponentStateA().

◆ MsiQueryFeatureStateA()

INSTALLSTATE WINAPI MsiQueryFeatureStateA ( LPCSTR  szProduct,
LPCSTR  szFeature 
)

Definition at line 3023 of file msi.c.

3024{
3025 LPWSTR szwProduct = NULL, szwFeature= NULL;
3027
3028 szwProduct = strdupAtoW( szProduct );
3029 if ( szProduct && !szwProduct )
3030 goto end;
3031
3032 szwFeature = strdupAtoW( szFeature );
3033 if ( szFeature && !szwFeature )
3034 goto end;
3035
3036 rc = MsiQueryFeatureStateW(szwProduct, szwFeature);
3037
3038end:
3039 free(szwProduct);
3040 free(szwFeature);
3041
3042 return rc;
3043}

Referenced by test_MsiProvideComponent(), test_MsiProvideQualifiedComponentEx(), test_MsiQueryFeatureState(), test_publish(), test_states(), and test_usefeature().

◆ MsiQueryFeatureStateExA()

UINT WINAPI MsiQueryFeatureStateExA ( LPCSTR  product,
LPCSTR  usersid,
MSIINSTALLCONTEXT  ctx,
LPCSTR  feature,
INSTALLSTATE state 
)

Definition at line 2987 of file msi.c.

2989{
2990 UINT r;
2991 WCHAR *productW = NULL, *usersidW = NULL, *featureW = NULL;
2992
2993 if (product && !(productW = strdupAtoW( product ))) return ERROR_OUTOFMEMORY;
2994 if (usersid && !(usersidW = strdupAtoW( usersid )))
2995 {
2996 free( productW );
2997 return ERROR_OUTOFMEMORY;
2998 }
2999 if (feature && !(featureW = strdupAtoW( feature )))
3000 {
3001 free( productW );
3002 free( usersidW );
3003 return ERROR_OUTOFMEMORY;
3004 }
3005 r = MsiQueryFeatureStateExW( productW, usersidW, ctx, featureW, state );
3006 free( productW );
3007 free( usersidW );
3008 free( featureW );
3009 return r;
3010}
UINT WINAPI MsiQueryFeatureStateExW(LPCWSTR product, LPCWSTR usersid, MSIINSTALLCONTEXT ctx, LPCWSTR feature, INSTALLSTATE *state)
Definition: msi.c:3012

Referenced by test_publish().

◆ MsiQueryFeatureStateExW()

UINT WINAPI MsiQueryFeatureStateExW ( LPCWSTR  product,
LPCWSTR  usersid,
MSIINSTALLCONTEXT  ctx,
LPCWSTR  feature,
INSTALLSTATE state 
)

Definition at line 3012 of file msi.c.

3014{
3015 WCHAR squashed[33];
3016 if (!squash_guid( product, squashed )) return ERROR_INVALID_PARAMETER;
3017 return query_feature_state( product, squashed, usersid, ctx, feature, state );
3018}
static UINT query_feature_state(const WCHAR *product, const WCHAR *squashed, const WCHAR *usersid, MSIINSTALLCONTEXT ctx, const WCHAR *feature, INSTALLSTATE *state)
Definition: msi.c:2903

Referenced by MsiQueryFeatureStateExA().

◆ MsiQueryFeatureStateW()

INSTALLSTATE WINAPI MsiQueryFeatureStateW ( LPCWSTR  szProduct,
LPCWSTR  szFeature 
)

Definition at line 3062 of file msi.c.

3063{
3064 UINT r;
3066 WCHAR squashed[33];
3067
3068 TRACE("%s %s\n", debugstr_w(szProduct), debugstr_w(szFeature));
3069
3070 if (!szProduct || !szFeature || !squash_guid( szProduct, squashed ))
3072
3073 r = query_feature_state( szProduct, squashed, NULL, MSIINSTALLCONTEXT_USERMANAGED, szFeature, &state );
3074 if (r == ERROR_SUCCESS || r == ERROR_BAD_CONFIGURATION) return state;
3075
3076 r = query_feature_state( szProduct, squashed, NULL, MSIINSTALLCONTEXT_USERUNMANAGED, szFeature, &state );
3077 if (r == ERROR_SUCCESS || r == ERROR_BAD_CONFIGURATION) return state;
3078
3079 r = query_feature_state( szProduct, squashed, NULL, MSIINSTALLCONTEXT_MACHINE, szFeature, &state );
3080 if (r == ERROR_SUCCESS || r == ERROR_BAD_CONFIGURATION) return state;
3081
3082 return INSTALLSTATE_UNKNOWN;
3083}

Referenced by ACTION_GetFeatureInstallStates(), MsiProvideComponentW(), MsiQueryFeatureStateA(), and MsiUseFeatureExW().

◆ MsiQueryProductStateA()

INSTALLSTATE WINAPI MsiQueryProductStateA ( LPCSTR  szProduct)

Definition at line 2207 of file msi.c.

2208{
2209 LPWSTR szwProduct = NULL;
2211
2212 if( szProduct )
2213 {
2214 szwProduct = strdupAtoW( szProduct );
2215 if( !szwProduct )
2216 return ERROR_OUTOFMEMORY;
2217 }
2218 r = MsiQueryProductStateW( szwProduct );
2219 free( szwProduct );
2220 return r;
2221}
INSTALLSTATE WINAPI MsiQueryProductStateW(LPCWSTR szProduct)
Definition: msi.c:2223

Referenced by test_MsiProvideQualifiedComponentEx(), test_MsiQueryProductState(), and test_publish().

◆ MsiQueryProductStateW()

INSTALLSTATE WINAPI MsiQueryProductStateW ( LPCWSTR  szProduct)

Definition at line 2223 of file msi.c.

2224{
2227 HKEY prodkey = 0, userdata = 0;
2228 DWORD val;
2229 UINT r;
2230
2231 TRACE("%s\n", debugstr_w(szProduct));
2232
2233 if (!szProduct || !*szProduct)
2235
2236 if (lstrlenW(szProduct) != GUID_SIZE - 1)
2238
2239 if (szProduct[0] != '{' || szProduct[37] != '}')
2240 return INSTALLSTATE_UNKNOWN;
2241
2243
2245 &prodkey, FALSE) != ERROR_SUCCESS &&
2247 &prodkey, FALSE) != ERROR_SUCCESS &&
2249 &prodkey, FALSE) == ERROR_SUCCESS)
2250 {
2252 }
2253
2254 r = MSIREG_OpenInstallProps(szProduct, context, NULL, &userdata, FALSE);
2255 if (r != ERROR_SUCCESS)
2256 goto done;
2257
2258 if (!msi_reg_get_val_dword(userdata, L"WindowsInstaller", &val))
2259 goto done;
2260
2261 if (val)
2263 else
2265
2266done:
2267 if (!prodkey)
2268 {
2270
2271 if (userdata)
2273 }
2274
2275 RegCloseKey(prodkey);
2276 RegCloseKey(userdata);
2277 TRACE("-> %d\n", state);
2278 return state;
2279}
#define SetLastError(x)
Definition: compat.h:752

Referenced by InstallerImpl_ProductState(), MsiQueryProductStateA(), set_installer_properties(), and test_null().

◆ MsiReinstallFeatureA()

UINT WINAPI MsiReinstallFeatureA ( const char szProduct,
const char szFeature,
DWORD  dwReinstallMode 
)

Definition at line 3989 of file msi.c.

3990{
3991 WCHAR *wszProduct, *wszFeature;
3992 UINT rc;
3993
3994 TRACE( "%s, %s, %lu\n", debugstr_a(szProduct), debugstr_a(szFeature), dwReinstallMode );
3995
3996 wszProduct = strdupAtoW(szProduct);
3997 wszFeature = strdupAtoW(szFeature);
3998
3999 rc = MsiReinstallFeatureW(wszProduct, wszFeature, dwReinstallMode);
4000
4001 free(wszProduct);
4002 free(wszFeature);
4003 return rc;
4004}
UINT WINAPI MsiReinstallFeatureW(const WCHAR *szProduct, const WCHAR *szFeature, DWORD dwReinstallMode)
Definition: msi.c:3918

◆ MsiReinstallFeatureW()

UINT WINAPI MsiReinstallFeatureW ( const WCHAR szProduct,
const WCHAR szFeature,
DWORD  dwReinstallMode 
)

Definition at line 3918 of file msi.c.

3919{
3920 MSIPACKAGE *package;
3922 UINT r;
3923 WCHAR sourcepath[MAX_PATH], filename[MAX_PATH], reinstallmode[11];
3924 WCHAR *ptr, *cmdline;
3925 DWORD sz;
3926
3927 TRACE( "%s, %s, %#lx\n", debugstr_w(szProduct), debugstr_w(szFeature), dwReinstallMode );
3928
3929 r = msi_locate_product( szProduct, &context );
3930 if (r != ERROR_SUCCESS)
3931 return r;
3932
3933 ptr = reinstallmode;
3934
3935 if (dwReinstallMode & REINSTALLMODE_FILEMISSING)
3936 *ptr++ = 'p';
3937 if (dwReinstallMode & REINSTALLMODE_FILEOLDERVERSION)
3938 *ptr++ = 'o';
3939 if (dwReinstallMode & REINSTALLMODE_FILEEQUALVERSION)
3940 *ptr++ = 'w';
3941 if (dwReinstallMode & REINSTALLMODE_FILEEXACT)
3942 *ptr++ = 'd';
3943 if (dwReinstallMode & REINSTALLMODE_FILEVERIFY)
3944 *ptr++ = 'c';
3945 if (dwReinstallMode & REINSTALLMODE_FILEREPLACE)
3946 *ptr++ = 'a';
3947 if (dwReinstallMode & REINSTALLMODE_USERDATA)
3948 *ptr++ = 'u';
3949 if (dwReinstallMode & REINSTALLMODE_MACHINEDATA)
3950 *ptr++ = 'm';
3951 if (dwReinstallMode & REINSTALLMODE_SHORTCUT)
3952 *ptr++ = 's';
3953 if (dwReinstallMode & REINSTALLMODE_PACKAGE)
3954 *ptr++ = 'v';
3955 *ptr = 0;
3956
3957 sz = sizeof(sourcepath);
3959 INSTALLPROPERTY_LASTUSEDSOURCEW, sourcepath, &sz );
3960 sz = sizeof(filename);
3963 lstrcatW( sourcepath, filename );
3964
3965 if (dwReinstallMode & REINSTALLMODE_PACKAGE)
3966 r = MSI_OpenPackageW( sourcepath, 0, &package );
3967 else
3968 r = MSI_OpenProductW( szProduct, &package );
3969
3970 if (r != ERROR_SUCCESS)
3971 return r;
3972
3973 sz = (lstrlenW( L"%s=%s %s=%s" ) + lstrlenW( L"REINSTALLMODE" ) + lstrlenW( reinstallmode )) * sizeof(WCHAR);
3974 sz += (lstrlenW( L"REINSTALL" ) + lstrlenW( szFeature )) * sizeof(WCHAR);
3975 if (!(cmdline = malloc( sz )))
3976 {
3977 msiobj_release( &package->hdr );
3978 return ERROR_OUTOFMEMORY;
3979 }
3980 swprintf( cmdline, sz / sizeof(WCHAR), L"%s=%s %s=%s", L"REINSTALLMODE", reinstallmode, L"REINSTALL", szFeature );
3981
3982 r = MSI_InstallPackage( package, sourcepath, cmdline );
3983 msiobj_release( &package->hdr );
3984 free( cmdline );
3985
3986 return r;
3987}
static PVOID ptr
Definition: dispmode.c:27
@ REINSTALLMODE_MACHINEDATA
Definition: msi.h:123
@ REINSTALLMODE_FILEREPLACE
Definition: msi.h:122
@ REINSTALLMODE_FILEOLDERVERSION
Definition: msi.h:118
@ REINSTALLMODE_FILEEXACT
Definition: msi.h:120
@ REINSTALLMODE_FILEEQUALVERSION
Definition: msi.h:119
@ REINSTALLMODE_USERDATA
Definition: msi.h:124
@ REINSTALLMODE_PACKAGE
Definition: msi.h:126
@ REINSTALLMODE_FILEVERIFY
Definition: msi.h:121
@ REINSTALLMODE_SHORTCUT
Definition: msi.h:125
@ REINSTALLMODE_FILEMISSING
Definition: msi.h:117
TCHAR * cmdline
Definition: stretchblt.cpp:32

Referenced by MsiReinstallFeatureA(), and MsiReinstallProductW().

◆ MsiReinstallProductA()

UINT WINAPI MsiReinstallProductA ( const char szProduct,
DWORD  dwReinstallMode 
)

Definition at line 266 of file msi.c.

267{
268 WCHAR *wszProduct;
269 UINT rc;
270
271 TRACE( "%s, %#lx\n", debugstr_a(szProduct), dwReinstallMode );
272
273 wszProduct = strdupAtoW(szProduct);
274 rc = MsiReinstallProductW(wszProduct, dwReinstallMode);
275 free(wszProduct);
276 return rc;
277}
UINT WINAPI MsiReinstallProductW(const WCHAR *szProduct, DWORD dwReinstallMode)
Definition: msi.c:279

◆ MsiReinstallProductW()

UINT WINAPI MsiReinstallProductW ( const WCHAR szProduct,
DWORD  dwReinstallMode 
)

Definition at line 279 of file msi.c.

280{
281 TRACE( "%s, %#lx\n", debugstr_w(szProduct), dwReinstallMode );
282
283 return MsiReinstallFeatureW(szProduct, L"ALL", dwReinstallMode);
284}

Referenced by MsiReinstallProductA(), and WinMain().

◆ MsiRemovePatchesA()

UINT WINAPI MsiRemovePatchesA ( LPCSTR  patchlist,
LPCSTR  product,
INSTALLTYPE  type,
LPCSTR  propertylist 
)

Definition at line 4349 of file msi.c.

4350{
4351 FIXME("(%s %s %d %s\n", debugstr_a(patchlist), debugstr_a(product), type, debugstr_a(propertylist));
4352 return ERROR_SUCCESS;
4353}

◆ MsiRemovePatchesW()

UINT WINAPI MsiRemovePatchesW ( LPCWSTR  patchlist,
LPCWSTR  product,
INSTALLTYPE  type,
LPCWSTR  propertylist 
)

Definition at line 4358 of file msi.c.

4359{
4360 FIXME("(%s %s %d %s\n", debugstr_w(patchlist), debugstr_w(product), type, debugstr_w(propertylist));
4361 return ERROR_SUCCESS;
4362}

◆ MsiSetExternalUIA()

INSTALLUI_HANDLERA WINAPI MsiSetExternalUIA ( INSTALLUI_HANDLERA  puiHandler,
DWORD  dwMessageFilter,
void pvContext 
)

Definition at line 2306 of file msi.c.

2307{
2309
2310 TRACE( "%p, %#lx, %p\n", puiHandler, dwMessageFilter, pvContext );
2311
2312 gUIHandlerA = puiHandler;
2313 gUIHandlerW = NULL;
2314 gUIFilter = dwMessageFilter;
2315 gUIContext = pvContext;
2316
2317 return prev;
2318}
INT(CALLBACK * INSTALLUI_HANDLERA)(LPVOID, UINT, LPCSTR)
Definition: msi.h:420
INSTALLUI_HANDLERA gUIHandlerA
Definition: msi_main.c:43
DWORD gUIFilter
Definition: msi_main.c:46
LPVOID gUIContext
Definition: msi_main.c:48
INSTALLUI_HANDLERW gUIHandlerW
Definition: msi_main.c:44

Referenced by test_controlevent(), test_externalui(), test_externalui_message(), test_MsiSetExternalUI(), and test_top_level_action().

◆ MsiSetExternalUIRecord()

UINT WINAPI MsiSetExternalUIRecord ( INSTALLUI_HANDLER_RECORD  handler,
DWORD  filter,
void context,
INSTALLUI_HANDLER_RECORD prev 
)

Definition at line 4149 of file msi.c.

4151{
4152 TRACE( "%p, %#lx, %p, %p\n", handler, filter, context, prev );
4153
4154 if (prev)
4155 *prev = gUIHandlerRecord;
4156
4160
4161 return ERROR_SUCCESS;
4162}
UINT(* handler)(MSIPACKAGE *)
Definition: action.c:7512
GLint GLint GLint GLint GLint GLint GLint GLbitfield GLenum filter
Definition: glext.h:7005
LPVOID gUIContextRecord
Definition: msi_main.c:49
DWORD gUIFilterRecord
Definition: msi_main.c:47
INSTALLUI_HANDLER_RECORD gUIHandlerRecord
Definition: msi_main.c:45

Referenced by add_custom_dll(), test_controlevent(), test_externalui(), test_externalui_message(), test_MsiSetExternalUI(), and test_top_level_action().

◆ MsiSetExternalUIW()

INSTALLUI_HANDLERW WINAPI MsiSetExternalUIW ( INSTALLUI_HANDLERW  puiHandler,
DWORD  dwMessageFilter,
void pvContext 
)

Definition at line 2320 of file msi.c.

2321{
2323
2324 TRACE( "%p, %#lx, %p\n", puiHandler, dwMessageFilter, pvContext );
2325
2326 gUIHandlerA = NULL;
2327 gUIHandlerW = puiHandler;
2328 gUIFilter = dwMessageFilter;
2329 gUIContext = pvContext;
2330
2331 return prev;
2332}
INT(CALLBACK * INSTALLUI_HANDLERW)(LPVOID, UINT, LPCWSTR)
Definition: msi.h:421

Referenced by test_MsiSetExternalUI().

◆ MsiSetInternalUI()

INSTALLUILEVEL WINAPI MsiSetInternalUI ( INSTALLUILEVEL  dwUILevel,
HWND phWnd 
)

Definition at line 2281 of file msi.c.

2282{
2284 HWND oldwnd = gUIhwnd;
2285
2286 TRACE("%08x %p\n", dwUILevel, phWnd);
2287
2290 {
2291 FIXME("Unrecognized flags %08x\n", dwUILevel);
2293 }
2294
2295 if (dwUILevel != INSTALLUILEVEL_NOCHANGE)
2296 gUILevel = dwUILevel;
2297
2298 if (phWnd)
2299 {
2300 gUIhwnd = *phWnd;
2301 *phWnd = oldwnd;
2302 }
2303 return old;
2304}
enum tagINSTALLUILEVEL INSTALLUILEVEL
@ INSTALLUILEVEL_ENDDIALOG
Definition: msi.h:72
@ INSTALLUILEVEL_HIDECANCEL
Definition: msi.h:70
@ INSTALLUILEVEL_SOURCERESONLY
Definition: msi.h:73
@ INSTALLUILEVEL_PROGRESSONLY
Definition: msi.h:71
@ INSTALLUILEVEL_NOCHANGE
Definition: msi.h:64
INSTALLUILEVEL gUILevel
Definition: msi_main.c:41
HWND gUIhwnd
Definition: msi_main.c:42
#define INSTALLUILEVEL_MASK
Definition: msipriv.h:60

Referenced by InstallerImpl_UILevel(), MsiConfigureFeatureW(), test_admin(), test_adminimage(), test_adminprops(), test_allusers_prop(), test_appsearch(), test_appsearch_complocator(), test_appsearch_drlocator(), test_appsearch_inilocator(), test_appsearch_reglocator(), test_cabisextracted(), test_caborder(), test_ccpsearch(), test_command_line_parsing(), test_complocator(), test_concurrentinstall(), test_continuouscabs(), test_controlevent(), test_costs(), test_create_remove_folder(), test_create_remove_shortcut(), test_currentworkingdir(), test_customaction1(), test_customaction51(), test_deferred_action(), test_delete_services(), test_duplicate_files(), test_envvar(), test_externalui_message(), test_feature_override(), test_feature_tree(), test_featureparents(), test_file_in_use(), test_file_in_use_cab(), test_find_related_products(), test_formatrecord_tables(), test_icon_table(), test_ini_values(), test_install_remove_odbc(), test_install_services(), test_installed_prop(), test_installprops(), test_installstate(), test_lastusedsource(), test_launchconditions(), test_missingcab(), test_missingcomponent(), test_mixed_package(), test_mixedmedia(), test_move_files(), test_MsiConfigureProductEx(), test_MsiGetSourcePath(), test_MsiInstallProduct(), test_MsiOpenProduct(), test_MsiProvideComponent(), test_MsiSetComponentState(), test_MsiSetInternalUI(), test_package_validation(), test_patch_registration(), test_preselected(), test_process_components(), test_processmessage(), test_propcase(), test_publish(), test_publish_assemblies(), test_publish_components(), test_publish_features(), test_publish_product(), test_publish_sourcelist(), test_readonlyfile(), test_readonlyfile_cab(), test_register_class_info(), test_register_extension_info(), test_register_font(), test_register_mime_info(), test_register_product(), test_register_progid_info(), test_register_typelib(), test_register_user(), test_remove_duplicate_files(), test_remove_existing_products(), test_remove_files(), test_remove_upgrade_code(), test_removefiles(), test_samesequence(), test_self_registration(), test_setdirproperty(), test_setpropertyfolder(), test_settargetpath(), test_shared_component(), test_shortcut(), test_shortlongsource(), test_simple_patch(), test_source_resolution(), test_sourcedir(), test_sourcedir_props(), test_sourcedirprop(), test_sourcefolder(), test_sourcepath(), test_start_stop_services(), test_states(), test_system_tables(), test_top_level_action(), test_transformprop(), test_uiLevelFlags(), test_upgrade_code(), test_validate_product_id(), test_volume_props(), test_write_registry_values(), and WinMain().

◆ MsiUseFeatureA()

INSTALLSTATE WINAPI MsiUseFeatureA ( LPCSTR  szProduct,
LPCSTR  szFeature 
)

Definition at line 3339 of file msi.c.

3340{
3341 return MsiUseFeatureExA(szProduct, szFeature, 0, 0);
3342}
INSTALLSTATE WINAPI MsiUseFeatureExA(const char *szProduct, const char *szFeature, DWORD dwInstallMode, DWORD dwReserved)
Definition: msi.c:3303

◆ MsiUseFeatureExA()

INSTALLSTATE WINAPI MsiUseFeatureExA ( const char szProduct,
const char szFeature,
DWORD  dwInstallMode,
DWORD  dwReserved 
)

Definition at line 3303 of file msi.c.

3305{
3307 WCHAR *prod = NULL, *feat = NULL;
3308
3309 TRACE( "%s, %s, %lu, %#lx\n", debugstr_a(szProduct), debugstr_a(szFeature), dwInstallMode, dwReserved );
3310
3311 prod = strdupAtoW( szProduct );
3312 if (szProduct && !prod)
3313 goto end;
3314
3315 feat = strdupAtoW( szFeature );
3316 if (szFeature && !feat)
3317 goto end;
3318
3319 ret = MsiUseFeatureExW( prod, feat, dwInstallMode, dwReserved );
3320
3321end:
3322 free( prod );
3323 free( feat );
3324
3325 return ret;
3326}
INSTALLSTATE WINAPI MsiUseFeatureExW(const WCHAR *szProduct, const WCHAR *szFeature, DWORD dwInstallMode, DWORD dwReserved)
Definition: msi.c:3279

Referenced by MsiUseFeatureA(), and test_usefeature().

◆ MsiUseFeatureExW()

INSTALLSTATE WINAPI MsiUseFeatureExW ( const WCHAR szProduct,
const WCHAR szFeature,
DWORD  dwInstallMode,
DWORD  dwReserved 
)

Definition at line 3279 of file msi.c.

3281{
3283
3284 TRACE( "%s, %s, %lu %#lx\n", debugstr_w(szProduct), debugstr_w(szFeature), dwInstallMode, dwReserved );
3285
3286 state = MsiQueryFeatureStateW( szProduct, szFeature );
3287
3288 if (dwReserved)
3290
3291 if (state == INSTALLSTATE_LOCAL && dwInstallMode != INSTALLMODE_NODETECTION)
3292 {
3293 FIXME("mark product %s feature %s as used\n",
3294 debugstr_w(szProduct), debugstr_w(szFeature) );
3295 }
3296
3297 return state;
3298}

Referenced by MsiUseFeatureExA(), and MsiUseFeatureW().

◆ MsiUseFeatureW()

INSTALLSTATE WINAPI MsiUseFeatureW ( LPCWSTR  szProduct,
LPCWSTR  szFeature 
)

Definition at line 3331 of file msi.c.

3332{
3333 return MsiUseFeatureExW(szProduct, szFeature, 0, 0);
3334}

Referenced by MsiProvideComponentW().

◆ MsiVerifyPackageA()

UINT WINAPI MsiVerifyPackageA ( LPCSTR  szPackage)

Definition at line 2718 of file msi.c.

2719{
2720 UINT r;
2721 LPWSTR szPack = NULL;
2722
2723 TRACE("%s\n", debugstr_a(szPackage) );
2724
2725 if( szPackage )
2726 {
2727 szPack = strdupAtoW( szPackage );
2728 if( !szPack )
2729 return ERROR_OUTOFMEMORY;
2730 }
2731
2732 r = MsiVerifyPackageW( szPack );
2733
2734 free( szPack );
2735
2736 return r;
2737}
UINT WINAPI MsiVerifyPackageW(LPCWSTR szPackage)
Definition: msi.c:2739

◆ MsiVerifyPackageW()

UINT WINAPI MsiVerifyPackageW ( LPCWSTR  szPackage)

Definition at line 2739 of file msi.c.

2740{
2742 UINT r;
2743
2744 TRACE("%s\n", debugstr_w(szPackage) );
2745
2746 r = MsiOpenDatabaseW( szPackage, MSIDBOPEN_READONLY, &handle );
2748
2749 return r;
2750}

Referenced by MsiVerifyPackageA().

◆ open_package()

static UINT open_package ( const WCHAR product,
const WCHAR usersid,
MSIINSTALLCONTEXT  context,
MSIPACKAGE **  package 
)
static

Definition at line 782 of file msi.c.

784{
785 UINT r;
786 HKEY props;
787 WCHAR *localpath, sourcepath[MAX_PATH], filename[MAX_PATH];
788
789 r = MSIREG_OpenInstallProps( product, context, usersid, &props, FALSE );
791
792 if ((localpath = msi_reg_get_val_str( props, L"LocalPackage" )))
793 {
794 lstrcpyW( sourcepath, localpath );
795 free( localpath );
796 }
798 if (!localpath || GetFileAttributesW( sourcepath ) == INVALID_FILE_ATTRIBUTES)
799 {
800 DWORD sz = sizeof(sourcepath);
802 INSTALLPROPERTY_LASTUSEDSOURCEW, sourcepath, &sz );
803 sz = sizeof(filename);
806 lstrcatW( sourcepath, filename );
807 }
808 if (GetFileAttributesW( sourcepath ) == INVALID_FILE_ATTRIBUTES)
810
811 return MSI_OpenPackageW( sourcepath, 0, package );
812}
#define ERROR_INSTALL_SOURCE_ABSENT
Definition: winerror.h:970

Referenced by MsiConfigureProductExW(), and MsiDeterminePatchSequenceW().

◆ open_userdata_comp_key()

static BOOL open_userdata_comp_key ( const WCHAR comp,
const WCHAR usersid,
MSIINSTALLCONTEXT  ctx,
HKEY hkey 
)
static

Definition at line 2752 of file msi.c.

2754{
2756 {
2757 if (!MSIREG_OpenUserDataComponentKey( comp, L"S-1-5-18", hkey, FALSE )) return TRUE;
2758 }
2760 {
2761 if (usersid && !wcsicmp( usersid, L"S-1-1-0" ))
2762 {
2763 FIXME( "only looking at the current user\n" );
2764 usersid = NULL;
2765 }
2766 if (!MSIREG_OpenUserDataComponentKey( comp, usersid, hkey, FALSE )) return TRUE;
2767 }
2768 return FALSE;
2769}
#define wcsicmp
Definition: compat.h:15

Referenced by MSI_GetComponentPath().

◆ patchinfoAtoW()

static MSIPATCHSEQUENCEINFOW * patchinfoAtoW ( DWORD  count,
const MSIPATCHSEQUENCEINFOA info 
)
static

Definition at line 508 of file msi.c.

509{
510 DWORD i;
512
513 if (!(ret = malloc( count * sizeof(MSIPATCHSEQUENCEINFOW) ))) return NULL;
514 for (i = 0; i < count; i++)
515 {
516 if (info[i].szPatchData && !(ret[i].szPatchData = strdupAtoW( info[i].szPatchData )))
517 {
518 free_patchinfo( i, ret );
519 return NULL;
520 }
521 ret[i].ePatchDataType = info[i].ePatchDataType;
522 ret[i].dwOrder = info[i].dwOrder;
523 ret[i].uStatus = info[i].uStatus;
524 }
525 return ret;
526}

Referenced by MsiDetermineApplicablePatchesA(), and MsiDeterminePatchSequenceA().

◆ query_feature_state()

static UINT query_feature_state ( const WCHAR product,
const WCHAR squashed,
const WCHAR usersid,
MSIINSTALLCONTEXT  ctx,
const WCHAR feature,
INSTALLSTATE state 
)
static

Definition at line 2903 of file msi.c.

2905{
2906 UINT r;
2907 HKEY hkey;
2909 const WCHAR *p;
2910 BOOL missing = FALSE, source = FALSE;
2911 WCHAR comp[GUID_SIZE];
2912 GUID guid;
2913
2915
2916 if (MSIREG_OpenFeaturesKey( product, usersid, ctx, &hkey, FALSE )) return ERROR_UNKNOWN_PRODUCT;
2917
2919 RegCloseKey( hkey );
2920 if (!parent) return ERROR_UNKNOWN_FEATURE;
2921
2923 free( parent );
2924 if (*state == INSTALLSTATE_ABSENT)
2925 return ERROR_SUCCESS;
2926
2927 r = MSIREG_OpenUserDataFeaturesKey( product, usersid, ctx, &hkey, FALSE );
2928 if (r != ERROR_SUCCESS)
2929 {
2931 return ERROR_SUCCESS;
2932 }
2934 RegCloseKey( hkey );
2935
2936 TRACE("buffer = %s\n", debugstr_w(components));
2937
2938 if (!components)
2939 {
2941 return ERROR_SUCCESS;
2942 }
2943 for (p = components; *p && *p != 2 ; p += 20)
2944 {
2945 if (!decode_base85_guid( p, &guid ))
2946 {
2947 if (p != components) break;
2948 free( components );
2951 }
2952 StringFromGUID2( &guid, comp, GUID_SIZE );
2954 r = MSIREG_OpenUserDataComponentKey( comp, L"S-1-5-18", &hkey, FALSE );
2955 else
2956 r = MSIREG_OpenUserDataComponentKey( comp, usersid, &hkey, FALSE );
2957
2958 if (r != ERROR_SUCCESS)
2959 {
2960 free( components );
2962 return ERROR_SUCCESS;
2963 }
2964 path = msi_reg_get_val_str( hkey, squashed );
2965 if (!path) missing = TRUE;
2966 else if (lstrlenW( path ) > 2 &&
2967 path[0] >= '0' && path[0] <= '9' &&
2968 path[1] >= '0' && path[1] <= '9')
2969 {
2970 source = TRUE;
2971 }
2972 free( path );
2973 }
2974 free( components );
2975
2976 if (missing)
2978 else if (source)
2980 else
2982
2983 TRACE("returning state %d\n", *state);
2984 return ERROR_SUCCESS;
2985}
r parent
Definition: btrfs.c:3010
@ INSTALLSTATE_BADCONFIG
Definition: msi.h:37
UINT MSIREG_OpenFeaturesKey(LPCWSTR szProduct, LPCWSTR szUserSid, MSIINSTALLCONTEXT context, HKEY *key, BOOL create)
Definition: registry.c:404
#define ERROR_UNKNOWN_FEATURE
Definition: winerror.h:964

Referenced by MsiQueryFeatureStateExW(), and MsiQueryFeatureStateW().

◆ reg_get_multisz()

static WCHAR * reg_get_multisz ( HKEY  hkey,
const WCHAR name 
)
static

Definition at line 3344 of file msi.c.

3345{
3346 WCHAR *ret;
3347 DWORD len, type;
3348 if (RegQueryValueExW( hkey, name, NULL, &type, NULL, &len ) || type != REG_MULTI_SZ) return NULL;
3349 if ((ret = malloc( len ))) RegQueryValueExW( hkey, name, NULL, NULL, (BYTE *)ret, &len );
3350 return ret;
3351}
#define REG_MULTI_SZ
Definition: nt_native.h:1501

Referenced by MSI_ProvideQualifiedComponentEx().

◆ reg_get_sz()

static WCHAR * reg_get_sz ( HKEY  hkey,
const WCHAR name 
)
static

Definition at line 3353 of file msi.c.

3354{
3355 WCHAR *ret;
3356 DWORD len, type;
3357 if (RegQueryValueExW( hkey, name, NULL, &type, NULL, &len ) || type != REG_SZ) return NULL;
3358 if ((ret = malloc( len ))) RegQueryValueExW( hkey, name, NULL, NULL, (BYTE *)ret, &len );
3359 return ret;
3360}
#define REG_SZ
Definition: layer.c:22

Referenced by MSI_ProvideQualifiedComponentEx().

◆ reg_get_value()

static WCHAR * reg_get_value ( HKEY  hkey,
const WCHAR name,
DWORD type 
)
static

Definition at line 1067 of file msi.c.

1068{
1069 LONG res;
1070
1071 if ((res = RegQueryValueExW( hkey, name, NULL, type, NULL, NULL )) != ERROR_SUCCESS) return NULL;
1072
1073 if (*type == REG_SZ) return msi_reg_get_val_str( hkey, name );
1074 if (*type == REG_DWORD)
1075 {
1076 WCHAR temp[11];
1077 DWORD val;
1078
1079 if (!msi_reg_get_val_dword( hkey, name, &val )) return NULL;
1080 swprintf( temp, ARRAY_SIZE(temp), L"%u", val );
1081 return wcsdup( temp );
1082 }
1083
1084 ERR( "unhandled value type %lu\n", *type );
1085 return NULL;
1086}

Referenced by MSI_GetProductInfo().

◆ set_drive()

static UINT set_drive ( WCHAR buffer,
WCHAR  letter 
)
static

Definition at line 1954 of file msi.c.

1955{
1956 buffer[0] = letter;
1957 buffer[1] = ':';
1958 buffer[2] = 0;
1959 return 2;
1960}

Referenced by MsiEnumComponentCostsW().

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( msi  )

Variable Documentation

◆ is_wow64

BOOL is_wow64

Definition at line 52 of file msi.c.

Referenced by __IsWow64Process(), _SHGetCurrentVersionPath(), _SHGetDefaultValue(), CoGetPSClsid(), custom_start_server(), delete_component_path(), DllMain(), do_msidbCustomActionTypeDll(), get_owner_company(), get_registry_view(), IsOS(), msi_disable_fs_redirection(), msi_revert_fs_redirection(), reg_get_typelib_module(), RegisterTypeLib(), set_component_path(), START_TEST(), test_CoGetPSClsid(), test_create_env(), test_installprops(), test_IsWow64Process(), test_LBS_NODATA(), test_MsiConfigureProductEx(), test_MsiEnumClients(), test_MsiEnumComponents(), test_MsiEnumComponentsEx(), test_MsiEnumPatches(), test_MsiEnumPatchesEx_machine(), test_MsiEnumPatchesEx_usermanaged(), test_MsiEnumPatchesEx_userunmanaged(), test_MsiEnumProducts(), test_MsiEnumProductsEx(), test_MsiGetComponentPath(), test_MsiGetComponentPathEx(), test_MsiGetPatchInfo(), test_MsiGetPatchInfoEx(), test_MsiGetProductCode(), test_MsiGetProductInfoEx(), test_MsiGetProductProperty(), test_MsiGetUserInfo(), test_MsiOpenProduct(), test_MsiProvideQualifiedComponentEx(), test_MsiQueryComponentState(), test_MsiQueryFeatureState(), test_MsiQueryProductState(), test_NtMapViewOfSection(), test_null(), test_process_components(), test_publish(), test_publish_assemblies(), test_publish_features(), test_publish_product(), test_redirection(), test_register_font(), test_register_product(), test_register_typelib(), test_register_user(), test_RtlThreadErrorMode(), test_SHGetFolderPathA(), test_SHParseDisplayName(), test_stub(), test_SystemInfo(), test_thread_processor(), UnRegisterTypeLib(), and validate_package().