ReactOS  0.4.15-dev-5146-g069b08d
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 NONAMELESSUNION
 
#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 msi_copy_outval (LPWSTR val, LPWSTR out, LPDWORD 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 msi_comp_find_prod_key (LPCWSTR prodcode, MSIINSTALLCONTEXT context)
 
static BOOL msi_comp_find_package (LPCWSTR prodcode, MSIINSTALLCONTEXT context)
 
static UINT msi_comp_find_prodcode (WCHAR *squashed_pc, MSIINSTALLCONTEXT context, LPCWSTR comp, LPWSTR 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 (MD5_CTX *)
 
VOID WINAPI MD5Update (MD5_CTX *, const unsigned char *, unsigned int)
 
VOID WINAPI MD5Final (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 3368 of file msi.c.

◆ COBJMACROS

#define COBJMACROS

Definition at line 23 of file msi.c.

◆ NONAMELESSUNION

#define NONAMELESSUNION

Definition at line 24 of file msi.c.

Function Documentation

◆ determine_patch_sequence()

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

Definition at line 633 of file msi.c.

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

Referenced by MsiDetermineApplicablePatchesW(), and MsiDeterminePatchSequenceW().

◆ free_patchinfo()

static void free_patchinfo ( DWORD  count,
MSIPATCHSEQUENCEINFOW info 
)
static

Definition at line 503 of file msi.c.

504 {
505  DWORD i;
506  for (i = 0; i < count; i++) msi_free( (WCHAR *)info[i].szPatchData );
507  msi_free( info );
508 }
GLuint GLuint GLsizei count
Definition: gl.h:1545
static void msi_free(void *mem)
Definition: msipriv.h:1159
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned long DWORD
Definition: ntddk_ex.h:95
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

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 3143 of file msi.c.

3145 {
3147  UINT len;
3148  DWORD error;
3149  LPVOID version;
3150  VS_FIXEDFILEINFO *ffi;
3151  USHORT *lang;
3152  WCHAR tmp[32];
3153 
3154  if (!(len = GetFileVersionInfoSizeW( path, NULL )))
3155  {
3156  error = GetLastError();
3159  return error;
3160  }
3161  if (!(version = msi_alloc( len ))) return ERROR_OUTOFMEMORY;
3162  if (!GetFileVersionInfoW( path, 0, len, version ))
3163  {
3164  msi_free( version );
3165  return GetLastError();
3166  }
3167  if (!verbuf && !verlen && !langbuf && !langlen)
3168  {
3169  msi_free( version );
3170  return ERROR_SUCCESS;
3171  }
3172  if (verlen)
3173  {
3174  if (VerQueryValueW( version, L"\\", (LPVOID *)&ffi, &len ) && len > 0)
3175  {
3176  swprintf( tmp, ARRAY_SIZE(tmp), L"%d.%d.%d.%d",
3177  HIWORD(ffi->dwFileVersionMS), LOWORD(ffi->dwFileVersionMS),
3178  HIWORD(ffi->dwFileVersionLS), LOWORD(ffi->dwFileVersionLS) );
3179  if (verbuf) lstrcpynW( verbuf, tmp, *verlen );
3180  len = lstrlenW( tmp );
3181  if (*verlen > len) ret = ERROR_SUCCESS;
3182  *verlen = len;
3183  }
3184  else
3185  {
3186  if (verbuf) *verbuf = 0;
3187  *verlen = 0;
3188  }
3189  }
3190  if (langlen)
3191  {
3192  if (VerQueryValueW( version, L"\\VarFileInfo\\Translation", (LPVOID *)&lang, &len ) && len > 0)
3193  {
3194  swprintf( tmp, ARRAY_SIZE(tmp), L"%d", *lang );
3195  if (langbuf) lstrcpynW( langbuf, tmp, *langlen );
3196  len = lstrlenW( tmp );
3197  if (*langlen > len) ret = ERROR_SUCCESS;
3198  *langlen = len;
3199  }
3200  else
3201  {
3202  if (langbuf) *langbuf = 0;
3203  *langlen = 0;
3204  }
3205  }
3206  msi_free( version );
3207  return ret;
3208 }
#define ERROR_SUCCESS
Definition: deptool.c:10
#define error(str)
Definition: mkdosfs.c:1605
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1040
static void msi_free(void *mem)
Definition: msipriv.h:1159
#define lstrlenW
Definition: compat.h:609
#define lstrcpynW
Definition: compat.h:597
#define L(x)
Definition: ntvdm.h:50
static const WCHAR version[]
Definition: asmname.c:66
#define ERROR_FILE_NOT_FOUND
Definition: disk.h:79
static const WCHAR lang[]
Definition: wbemdisp.c:287
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned long DWORD
Definition: ntddk_ex.h:95
int ret
DWORD WINAPI GetFileVersionInfoSizeW(LPCWSTR filename, LPDWORD handle)
Definition: version.c:611
GLenum GLsizei len
Definition: glext.h:6722
int _cdecl swprintf(const WCHAR *,...)
#define ERROR_MORE_DATA
Definition: dderror.h:13
unsigned short USHORT
Definition: pedump.c:61
#define ARRAY_SIZE(a)
Definition: main.h:24
unsigned int UINT
Definition: ndis.h:50
#define NULL
Definition: types.h:112
#define ERROR_FILE_INVALID
Definition: winerror.h:585
BOOL WINAPI GetFileVersionInfoW(LPCWSTR filename, DWORD handle, DWORD datasize, LPVOID data)
Definition: version.c:845
static void * msi_alloc(size_t len) __WINE_ALLOC_SIZE(1)
Definition: msipriv.h:1142
#define HIWORD(l)
Definition: typedefs.h:247
#define ERROR_BAD_PATHNAME
Definition: winerror.h:233
#define LOWORD(l)
Definition: pedump.c:82
#define ERROR_RESOURCE_DATA_NOT_FOUND
Definition: winerror.h:1119
#define ERROR_OUTOFMEMORY
Definition: deptool.c:13
BOOL WINAPI VerQueryValueW(LPCVOID pBlock, LPCWSTR lpSubBlock, LPVOID *lplpBuffer, PUINT puLen)
Definition: version.c:1049

Referenced by MsiGetFileVersionW().

◆ get_patch_product_codes()

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

Definition at line 318 of file msi.c.

319 {
320  MSIHANDLE patch, info = 0;
321  UINT r, type;
322  DWORD size;
323  static WCHAR empty[] = L"";
324  WCHAR *codes = NULL;
325 
326  r = MsiOpenDatabaseW( szPatchPackage, MSIDBOPEN_READONLY, &patch );
327  if (r != ERROR_SUCCESS)
328  return r;
329 
330  r = MsiGetSummaryInformationW( patch, NULL, 0, &info );
331  if (r != ERROR_SUCCESS)
332  goto done;
333 
334  size = 0;
336  if (r != ERROR_MORE_DATA || !size || type != VT_LPSTR)
337  {
338  ERR("Failed to read product codes from patch\n");
340  goto done;
341  }
342 
343  codes = msi_alloc( ++size * sizeof(WCHAR) );
344  if (!codes)
345  {
347  goto done;
348  }
349 
351  if (r == ERROR_SUCCESS)
352  *product_codes = msi_split_string( codes, ';' );
353 
354 done:
355  MsiCloseHandle( info );
356  MsiCloseHandle( patch );
357  msi_free( codes );
358  return r;
359 }
#define PID_TEMPLATE
Definition: suminfo.c:49
#define MSIDBOPEN_READONLY
Definition: msiquery.h:66
#define ERROR_SUCCESS
Definition: deptool.c:10
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
UINT WINAPI MsiSummaryInfoGetPropertyW(MSIHANDLE handle, UINT uiProperty, UINT *puiDataType, INT *piValue, FILETIME *pftValue, WCHAR *szValueBuf, DWORD *pcchValueBuf)
Definition: suminfo.c:788
UINT WINAPI MsiGetSummaryInformationW(MSIHANDLE hDatabase, const WCHAR *szDatabase, UINT uiUpdateCount, MSIHANDLE *pHandle)
Definition: suminfo.c:514
static void msi_free(void *mem)
Definition: msipriv.h:1159
#define L(x)
Definition: ntvdm.h:50
#define ERROR_FUNCTION_FAILED
Definition: winerror.h:985
unsigned long MSIHANDLE
Definition: winemsi.idl:24
GLsizeiptr size
Definition: glext.h:5919
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned long DWORD
Definition: ntddk_ex.h:95
#define ERROR_MORE_DATA
Definition: dderror.h:13
UINT WINAPI MsiCloseHandle(MSIHANDLE handle)
Definition: handle.c:269
#define ERR(fmt,...)
Definition: debug.h:110
WCHAR ** msi_split_string(const WCHAR *str, WCHAR sep)
Definition: action.c:305
DWORD size
Definition: msi.c:1103
UINT WINAPI MsiOpenDatabaseW(LPCWSTR szDBPath, LPCWSTR szPersist, MSIHANDLE *phDB)
Definition: database.c:298
unsigned int UINT
Definition: ndis.h:50
#define NULL
Definition: types.h:112
BOOL empty
Definition: button.c:170
static void * msi_alloc(size_t len) __WINE_ALLOC_SIZE(1)
Definition: msipriv.h:1142
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
#define ERROR_OUTOFMEMORY
Definition: deptool.c:13

Referenced by MSI_ApplyPatchW().

◆ MD5Final()

VOID WINAPI MD5Final ( MD5_CTX )

Definition at line 113 of file md5.c.

114 {
115  unsigned int count;
116  unsigned char *p;
117 
118  /* Compute number of bytes mod 64 */
119  count = (ctx->i[0] >> 3) & 0x3F;
120 
121  /* Set the first char of padding to 0x80. This is safe since there is
122  always at least one byte free */
123  p = ctx->in + count;
124  *p++ = 0x80;
125 
126  /* Bytes of padding needed to make 64 bytes */
127  count = 64 - 1 - count;
128 
129  /* Pad out to 56 mod 64 */
130  if (count < 8)
131  {
132  /* Two lots of padding: Pad the first block to 64 bytes */
133  memset( p, 0, count );
134  byteReverse( ctx->in, 16 );
135  MD5Transform( ctx->buf, (unsigned int *)ctx->in );
136 
137  /* Now fill the next block with 56 bytes */
138  memset( ctx->in, 0, 56 );
139  }
140  else
141  {
142  /* Pad block to 56 bytes */
143  memset( p, 0, count - 8 );
144  }
145 
146  byteReverse( ctx->in, 14 );
147 
148  /* Append length in bits and transform */
149  ((unsigned int *)ctx->in)[14] = ctx->i[0];
150  ((unsigned int *)ctx->in)[15] = ctx->i[1];
151 
152  MD5Transform( ctx->buf, (unsigned int *)ctx->in );
153  byteReverse( (unsigned char *)ctx->buf, 4 );
154  memcpy( ctx->digest, ctx->buf, 16 );
155 }
GLuint GLuint GLsizei count
Definition: gl.h:1545
void byteReverse(unsigned char *buf, unsigned longs)
Definition: util.c:8
static void MD5Transform(unsigned int buf[4], const unsigned int in[16])
Definition: md5.c:174
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
GLfloat GLfloat p
Definition: glext.h:8902
#define memset(x, y, z)
Definition: compat.h:39

Referenced by HMACMD5Final(), HMACMD5Init(), KsecGetKeyData(), KsecInitializeEncryptionSupport(), and msi_get_filehash().

◆ MD5Init()

VOID WINAPI MD5Init ( MD5_CTX )

Definition at line 45 of file md5.c.

46 {
47  ctx->buf[0] = 0x67452301;
48  ctx->buf[1] = 0xefcdab89;
49  ctx->buf[2] = 0x98badcfe;
50  ctx->buf[3] = 0x10325476;
51 
52  ctx->i[0] = ctx->i[1] = 0;
53 }

Referenced by HMACMD5Final(), HMACMD5Init(), KsecInitializeEncryptionSupport(), and msi_get_filehash().

◆ MD5Update()

VOID WINAPI MD5Update ( MD5_CTX ,
const unsigned char ,
unsigned int   
)

Definition at line 59 of file md5.c.

60 {
61  register unsigned int t;
62 
63  /* Update bitcount */
64  t = ctx->i[0];
65 
66  if ((ctx->i[0] = t + (len << 3)) < t)
67  ctx->i[1]++; /* Carry from low to high */
68 
69  ctx->i[1] += len >> 29;
70  t = (t >> 3) & 0x3f;
71 
72  /* Handle any leading odd-sized chunks */
73  if (t)
74  {
75  unsigned char *p = (unsigned char *)ctx->in + t;
76  t = 64 - t;
77 
78  if (len < t)
79  {
80  memcpy( p, buf, len );
81  return;
82  }
83 
84  memcpy( p, buf, t );
85  byteReverse( ctx->in, 16 );
86 
87  MD5Transform( ctx->buf, (unsigned int *)ctx->in );
88 
89  buf += t;
90  len -= t;
91  }
92 
93  /* Process data in 64-byte chunks */
94  while (len >= 64)
95  {
96  memcpy( ctx->in, buf, 64 );
97  byteReverse( ctx->in, 16 );
98 
99  MD5Transform( ctx->buf, (unsigned int *)ctx->in );
100 
101  buf += 64;
102  len -= 64;
103  }
104 
105  /* Handle any remaining bytes of data. */
106  memcpy( ctx->in, buf, len );
107 }
GLdouble GLdouble t
Definition: gl.h:2047
if(dx==0 &&dy==0)
Definition: linetemp.h:174
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
void byteReverse(unsigned char *buf, unsigned longs)
Definition: util.c:8
static void MD5Transform(unsigned int buf[4], const unsigned int in[16])
Definition: md5.c:174
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
GLenum GLsizei len
Definition: glext.h:6722
GLfloat GLfloat p
Definition: glext.h:8902

Referenced by HMACMD5Final(), HMACMD5Init(), HMACMD5Update(), KsecGetKeyData(), KsecInitializeEncryptionSupport(), and msi_get_filehash().

◆ Migrate10CachedPackagesW()

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

Definition at line 4346 of file msi.c.

4347 {
4348  FIXME( "%p, %p, %p, %#lx\n", a, b, c, d );
4349  return ERROR_SUCCESS;
4350 }
#define ERROR_SUCCESS
Definition: deptool.c:10
#define FIXME(fmt,...)
Definition: debug.h:111
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
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 561 of file msi.c.

562 {
563  MSISUMMARYINFO *si;
564  MSIDATABASE *patch_db;
565  UINT r;
566 
567  r = MSI_OpenDatabaseW( patch, MSIDBOPEN_READONLY, &patch_db );
568  if (r != ERROR_SUCCESS)
569  {
570  WARN("failed to open patch file %s\n", debugstr_w(patch));
571  return r;
572  }
573 
574  r = msi_get_suminfo( patch_db->storage, 0, &si );
575  if (r != ERROR_SUCCESS)
576  {
577  msiobj_release( &patch_db->hdr );
578  return ERROR_FUNCTION_FAILED;
579  }
580 
581  r = msi_check_patch_applicable( package, si );
582  if (r != ERROR_SUCCESS)
583  TRACE("patch not applicable\n");
584 
585  msiobj_release( &patch_db->hdr );
586  msiobj_release( &si->hdr );
587  return r;
588 }
#define MSIDBOPEN_READONLY
Definition: msiquery.h:66
#define ERROR_SUCCESS
Definition: deptool.c:10
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
UINT MSI_OpenDatabaseW(LPCWSTR szDBPath, LPCWSTR szPersist, MSIDATABASE **pdb)
Definition: database.c:140
#define WARN(fmt,...)
Definition: debug.h:112
UINT msi_check_patch_applicable(MSIPACKAGE *package, MSISUMMARYINFO *si) DECLSPEC_HIDDEN
Definition: patch.c:294
#define ERROR_FUNCTION_FAILED
Definition: winerror.h:985
#define debugstr_w
Definition: kernel32.h:32
UINT msi_get_suminfo(IStorage *stg, UINT uiUpdateCount, MSISUMMARYINFO **si) DECLSPEC_HIDDEN
Definition: suminfo.c:457
#define TRACE(s)
Definition: solgame.cpp:4
MSIOBJECTHDR hdr
Definition: msipriv.h:486
int msiobj_release(MSIOBJECTHDR *info)
Definition: handle.c:241
unsigned int UINT
Definition: ndis.h:50
IStorage * storage
Definition: msipriv.h:109
MSIOBJECTHDR hdr
Definition: msipriv.h:108

Referenced by determine_patch_sequence().

◆ MSI_ApplicablePatchXML()

static UINT MSI_ApplicablePatchXML ( MSIPACKAGE package,
IXMLDOMDocument desc 
)
static

Definition at line 591 of file msi.c.

592 {
595  LPWSTR product_code;
596  IXMLDOMNode *node;
597  HRESULT hr;
598  BSTR s;
599 
600  product_code = msi_dup_property( package->db, L"ProductCode" );
601  if (!product_code)
602  {
603  /* FIXME: the property ProductCode should be written into the DB somewhere */
604  ERR("no product code to check\n");
605  return ERROR_SUCCESS;
606  }
607 
608  s = SysAllocString( L"MsiPatch/TargetProduct/TargetProductCode" );
609  hr = IXMLDOMDocument_selectNodes( desc, s, &list );
610  SysFreeString(s);
611  if (hr != S_OK)
613 
614  while (IXMLDOMNodeList_nextNode( list, &node ) == S_OK && r != ERROR_SUCCESS)
615  {
616  hr = IXMLDOMNode_get_text( node, &s );
617  IXMLDOMNode_Release( node );
618  if (hr == S_OK)
619  {
620  if (!wcscmp( s, product_code )) r = ERROR_SUCCESS;
621  SysFreeString( s );
622  }
623  }
624  IXMLDOMNodeList_Release( list );
625 
626  if (r != ERROR_SUCCESS)
627  TRACE("patch not applicable\n");
628 
629  msi_free( product_code );
630  return r;
631 }
#define ERROR_SUCCESS
Definition: deptool.c:10
HRESULT hr
Definition: shlfolder.c:183
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
static void msi_free(void *mem)
Definition: msipriv.h:1159
OLECHAR * BSTR
Definition: compat.h:2152
struct node node
#define L(x)
Definition: ntvdm.h:50
#define ERROR_FUNCTION_FAILED
Definition: winerror.h:985
static const WCHAR desc[]
Definition: protectdata.c:36
BSTR WINAPI SysAllocString(LPCOLESTR str)
Definition: oleaut.c:238
#define TRACE(s)
Definition: solgame.cpp:4
#define ERROR_INVALID_PATCH_XML
Definition: winerror.h:1008
LONG HRESULT
Definition: typedefs.h:79
MSIDATABASE * db
Definition: msipriv.h:394
GLdouble s
Definition: gl.h:2039
Definition: _list.h:228
#define ERR(fmt,...)
Definition: debug.h:110
_Check_return_ _CRTIMP int __cdecl wcscmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
#define S_OK
Definition: intsafe.h:52
#define list
Definition: rosglue.h:35
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
Definition: oleaut.c:271
unsigned int UINT
Definition: ndis.h:50
WCHAR * LPWSTR
Definition: xmlstorage.h:184
Definition: dlist.c:348
LPWSTR msi_dup_property(MSIDATABASE *db, LPCWSTR prop) DECLSPEC_HIDDEN
Definition: package.c:2283

Referenced by determine_patch_sequence().

◆ MSI_ApplyPatchW()

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

Definition at line 361 of file msi.c.

362 {
364  DWORD size;
365  LPCWSTR cmd_ptr = szCommandLine;
366  LPWSTR cmd, *codes = NULL;
367  BOOL succeeded = FALSE;
368 
369  if (!szPatchPackage || !szPatchPackage[0])
371 
372  if (!szProductCode && (r = get_patch_product_codes( szPatchPackage, &codes )))
373  return r;
374 
375  if (!szCommandLine)
376  cmd_ptr = L"";
377 
378  size = lstrlenW(cmd_ptr) + lstrlenW(L"%s PATCH=\"%s\"") + lstrlenW(szPatchPackage) + 1;
379  cmd = msi_alloc(size * sizeof(WCHAR));
380  if (!cmd)
381  {
382  msi_free(codes);
383  return ERROR_OUTOFMEMORY;
384  }
385  swprintf(cmd, size, L"%s PATCH=\"%s\"", cmd_ptr, szPatchPackage);
386 
387  if (szProductCode)
389  else
390  {
391  for (i = 0; codes[i]; i++)
392  {
394  if (r == ERROR_SUCCESS)
395  {
396  TRACE("patch applied\n");
397  succeeded = TRUE;
398  }
399  }
400 
401  if (succeeded)
402  r = ERROR_SUCCESS;
403  }
404 
405  msi_free(cmd);
406  msi_free(codes);
407  return r;
408 }
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
#define ERROR_SUCCESS
Definition: deptool.c:10
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
Definition: ftp_var.h:139
#define TRUE
Definition: types.h:120
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
char * cmd
Definition: vfdcmd.c:85
static void msi_free(void *mem)
Definition: msipriv.h:1159
#define lstrlenW
Definition: compat.h:609
#define L(x)
Definition: ntvdm.h:50
#define ERROR_FUNCTION_FAILED
Definition: winerror.h:985
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
UINT WINAPI MsiConfigureProductExW(LPCWSTR szProduct, int iInstallLevel, INSTALLSTATE eInstallState, LPCWSTR szCommandLine)
Definition: msi.c:833
#define TRACE(s)
Definition: solgame.cpp:4
GLsizeiptr size
Definition: glext.h:5919
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned long DWORD
Definition: ntddk_ex.h:95
static UINT get_patch_product_codes(LPCWSTR szPatchPackage, WCHAR ***product_codes)
Definition: msi.c:318
int _cdecl swprintf(const WCHAR *,...)
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
DWORD size
Definition: msi.c:1103
unsigned int UINT
Definition: ndis.h:50
#define NULL
Definition: types.h:112
static void * msi_alloc(size_t len) __WINE_ALLOC_SIZE(1)
Definition: msipriv.h:1142
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define ERROR_OUTOFMEMORY
Definition: deptool.c:13

Referenced by MsiApplyMultiplePatchesW(), and MsiApplyPatchW().

◆ msi_comp_find_package()

static BOOL msi_comp_find_package ( LPCWSTR  prodcode,
MSIINSTALLCONTEXT  context 
)
static

Definition at line 2095 of file msi.c.

2096 {
2097  LPCWSTR package;
2098  HKEY hkey;
2099  DWORD sz;
2100  LONG res;
2101  UINT r;
2102 
2103  r = MSIREG_OpenInstallProps(prodcode, context, NULL, &hkey, FALSE);
2104  if (r != ERROR_SUCCESS)
2105  return FALSE;
2106 
2108  package = L"ManagedLocalPackage";
2109  else
2110  package = L"LocalPackage";
2111 
2112  sz = 0;
2113  res = RegQueryValueExW(hkey, package, NULL, NULL, NULL, &sz);
2114  RegCloseKey(hkey);
2115 
2116  return (res == ERROR_SUCCESS);
2117 }
#define ERROR_SUCCESS
Definition: deptool.c:10
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
Definition: http.c:7251
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
UINT MSIREG_OpenInstallProps(LPCWSTR szProduct, MSIINSTALLCONTEXT dwContext, LPCWSTR szUserSid, HKEY *key, BOOL create) DECLSPEC_HIDDEN
Definition: registry.c:692
#define FALSE
Definition: types.h:117
long LONG
Definition: pedump.c:60
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
Definition: reg.c:4120
unsigned long DWORD
Definition: ntddk_ex.h:95
unsigned int UINT
Definition: ndis.h:50
#define NULL
Definition: types.h:112
GLuint res
Definition: glext.h:9613
#define RegCloseKey(hKey)
Definition: registry.h:47

Referenced by MsiQueryComponentStateW().

◆ msi_comp_find_prod_key()

static BOOL msi_comp_find_prod_key ( LPCWSTR  prodcode,
MSIINSTALLCONTEXT  context 
)
static

Definition at line 2085 of file msi.c.

2086 {
2087  UINT r;
2088  HKEY hkey = NULL;
2089 
2090  r = MSIREG_OpenProductKey(prodcode, NULL, context, &hkey, FALSE);
2091  RegCloseKey(hkey);
2092  return (r == ERROR_SUCCESS);
2093 }
#define ERROR_SUCCESS
Definition: deptool.c:10
Definition: http.c:7251
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
#define FALSE
Definition: types.h:117
UINT MSIREG_OpenProductKey(LPCWSTR szProduct, LPCWSTR szUserSid, MSIINSTALLCONTEXT context, HKEY *key, BOOL create) DECLSPEC_HIDDEN
Definition: registry.c:338
unsigned int UINT
Definition: ndis.h:50
#define NULL
Definition: types.h:112
#define RegCloseKey(hKey)
Definition: registry.h:47

Referenced by MsiQueryComponentStateW().

◆ msi_comp_find_prodcode()

static UINT msi_comp_find_prodcode ( WCHAR squashed_pc,
MSIINSTALLCONTEXT  context,
LPCWSTR  comp,
LPWSTR  val,
DWORD sz 
)
static

Definition at line 2119 of file msi.c.

2122 {
2123  HKEY hkey;
2124  LONG res;
2125  UINT r;
2126 
2128  r = MSIREG_OpenUserDataComponentKey(comp, L"S-1-5-18", &hkey, FALSE);
2129  else
2130  r = MSIREG_OpenUserDataComponentKey(comp, NULL, &hkey, FALSE);
2131 
2132  if (r != ERROR_SUCCESS)
2133  return r;
2134 
2135  res = RegQueryValueExW( hkey, squashed_pc, NULL, NULL, (BYTE *)val, sz );
2136  if (res != ERROR_SUCCESS)
2137  return res;
2138 
2139  RegCloseKey(hkey);
2140  return res;
2141 }
#define ERROR_SUCCESS
Definition: deptool.c:10
Definition: http.c:7251
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
#define L(x)
Definition: ntvdm.h:50
#define FALSE
Definition: types.h:117
long LONG
Definition: pedump.c:60
UINT MSIREG_OpenUserDataComponentKey(LPCWSTR szComponent, LPCWSTR szUserSid, HKEY *key, BOOL create) DECLSPEC_HIDDEN
Definition: registry.c:526
GLuint GLfloat * val
Definition: glext.h:7180
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
Definition: reg.c:4120
unsigned char BYTE
Definition: xxhash.c:193
unsigned int UINT
Definition: ndis.h:50
#define NULL
Definition: types.h:112
GLuint res
Definition: glext.h:9613
#define RegCloseKey(hKey)
Definition: registry.h:47

Referenced by MsiQueryComponentStateW().

◆ msi_copy_outval()

static UINT msi_copy_outval ( LPWSTR  val,
LPWSTR  out,
LPDWORD  size 
)
static

Definition at line 1368 of file msi.c.

1369 {
1370  UINT r = ERROR_SUCCESS;
1371 
1372  if (!val)
1373  return ERROR_UNKNOWN_PROPERTY;
1374 
1375  if (out)
1376  {
1377  if (lstrlenW(val) >= *size)
1378  {
1379  r = ERROR_MORE_DATA;
1380  if (*size > 0)
1381  *out = '\0';
1382  }
1383  else
1384  lstrcpyW(out, val);
1385  }
1386 
1387  if (size)
1388  *size = lstrlenW(val);
1389 
1390  return r;
1391 }
#define ERROR_UNKNOWN_PROPERTY
Definition: winerror.h:966
#define ERROR_SUCCESS
Definition: deptool.c:10
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
#define lstrlenW
Definition: compat.h:609
GLuint GLfloat * val
Definition: glext.h:7180
GLsizeiptr size
Definition: glext.h:5919
static FILE * out
Definition: regtests2xml.c:44
#define ERROR_MORE_DATA
Definition: dderror.h:13
#define lstrcpyW
Definition: compat.h:608
unsigned int UINT
Definition: ndis.h:50

Referenced by MsiGetProductInfoExW().

◆ msi_get_filehash()

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

Definition at line 4024 of file msi.c.

4025 {
4027  void *p;
4028  DWORD length;
4030 
4031  if (package)
4033  else
4036  {
4037  WARN( "can't open file %lu\n", GetLastError() );
4038  return ERROR_FILE_NOT_FOUND;
4039  }
4040  if ((length = GetFileSize( handle, NULL )))
4041  {
4043  {
4044  if ((p = MapViewOfFile( mapping, FILE_MAP_READ, 0, 0, length )))
4045  {
4046  MD5_CTX ctx;
4047 
4048  MD5Init( &ctx );
4049  MD5Update( &ctx, p, length );
4050  MD5Final( &ctx );
4051  UnmapViewOfFile( p );
4052 
4053  memcpy( hash->dwData, ctx.digest, sizeof(hash->dwData) );
4054  r = ERROR_SUCCESS;
4055  }
4056  CloseHandle( mapping );
4057  }
4058  }
4059  else
4060  {
4061  /* Empty file -> set hash to 0 */
4062  memset( hash->dwData, 0, sizeof(hash->dwData) );
4063  r = ERROR_SUCCESS;
4064  }
4065 
4066  CloseHandle( handle );
4067  return r;
4068 }
#define CloseHandle
Definition: compat.h:598
#define ERROR_SUCCESS
Definition: deptool.c:10
#define MapViewOfFile
Definition: compat.h:604
VOID WINAPI MD5Init(MD5_CTX *)
Definition: md5.c:45
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
#define WARN(fmt,...)
Definition: debug.h:112
#define INVALID_HANDLE_VALUE
Definition: compat.h:590
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1040
VOID WINAPI MD5Final(MD5_CTX *)
Definition: md5.c:113
VOID WINAPI MD5Update(MD5_CTX *, const unsigned char *, unsigned int)
Definition: md5.c:59
#define FILE_SHARE_READ
Definition: compat.h:136
namespace GUID const ADDRINFOEXW ADDRINFOEXW struct timeval OVERLAPPED LPLOOKUPSERVICE_COMPLETION_ROUTINE HANDLE * handle
Definition: sock.c:82
#define ERROR_FUNCTION_FAILED
Definition: winerror.h:985
GLenum GLuint GLenum GLsizei length
Definition: glext.h:5579
#define FILE_MAP_READ
Definition: compat.h:635
#define ERROR_FILE_NOT_FOUND
Definition: disk.h:79
#define OPEN_EXISTING
Definition: compat.h:634
HANDLE msi_create_file(MSIPACKAGE *package, const WCHAR *filename, DWORD access, DWORD sharing, DWORD creation, DWORD flags)
Definition: files.c:51
#define CreateFileMappingW(a, b, c, d, e, f)
Definition: compat.h:603
unsigned long DWORD
Definition: ntddk_ex.h:95
GLenum GLenum GLenum GLenum mapping
Definition: glext.h:9031
DWORD WINAPI GetFileSize(HANDLE hFile, LPDWORD lpFileSizeHigh)
Definition: fileinfo.c:331
#define FILE_SHARE_DELETE
Definition: nt_native.h:682
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define GENERIC_READ
Definition: compat.h:135
unsigned int UINT
Definition: ndis.h:50
#define NULL
Definition: types.h:112
#define PAGE_READONLY
Definition: compat.h:138
#define CreateFileW
Definition: compat.h:600
Definition: msi.c:4012
GLfloat GLfloat p
Definition: glext.h:8902
#define UnmapViewOfFile
Definition: compat.h:605
Definition: _hash_fun.h:40
#define memset(x, y, z)
Definition: compat.h:39

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 2777 of file msi.c.

2780 {
2781  WCHAR *path = NULL, squashed_pc[SQUASHED_GUID_SIZE], squashed_comp[SQUASHED_GUID_SIZE];
2782  HKEY hkey;
2784  DWORD version;
2785 
2786  if (!szProduct || !szComponent)
2787  return INSTALLSTATE_INVALIDARG;
2788 
2789  if (lpPathBuf->str.w && !pcchBuf)
2790  return INSTALLSTATE_INVALIDARG;
2791 
2792  if (!squash_guid( szProduct, squashed_pc ) || !squash_guid( szComponent, squashed_comp ))
2793  return INSTALLSTATE_INVALIDARG;
2794 
2795  if (szUserSid && ctx == MSIINSTALLCONTEXT_MACHINE)
2796  return INSTALLSTATE_INVALIDARG;
2797 
2799 
2800  if (open_userdata_comp_key( szComponent, szUserSid, ctx, &hkey ))
2801  {
2802  path = msi_reg_get_val_str( hkey, squashed_pc );
2803  RegCloseKey(hkey);
2804 
2806 
2807  if ((!MSIREG_OpenInstallProps(szProduct, MSIINSTALLCONTEXT_MACHINE, NULL, &hkey, FALSE) ||
2809  msi_reg_get_val_dword(hkey, L"WindowsInstaller", &version) &&
2811  {
2812  RegCloseKey(hkey);
2814  }
2815  }
2816 
2817  if (state != INSTALLSTATE_LOCAL &&
2820  {
2821  RegCloseKey(hkey);
2822 
2823  if (open_userdata_comp_key( szComponent, szUserSid, ctx, &hkey ))
2824  {
2825  msi_free(path);
2826  path = msi_reg_get_val_str( hkey, squashed_pc );
2827  RegCloseKey(hkey);
2828 
2830 
2833  }
2834  }
2835 
2836  if (!path)
2837  return INSTALLSTATE_UNKNOWN;
2838 
2839  if (state == INSTALLSTATE_LOCAL && !*path)
2841 
2842  if (msi_strcpy_to_awstring(path, -1, lpPathBuf, pcchBuf) == ERROR_MORE_DATA)
2844 
2845  msi_free(path);
2846  return state;
2847 }
LPWSTR msi_reg_get_val_str(HKEY hkey, LPCWSTR name) DECLSPEC_HIDDEN
Definition: registry.c:243
static void msi_free(void *mem)
Definition: msipriv.h:1159
LPWSTR w
Definition: msipriv.h:743
UINT msi_strcpy_to_awstring(const WCHAR *str, int len, awstring *awbuf, DWORD *sz)
Definition: install.c:158
UINT MSIREG_OpenInstallProps(LPCWSTR szProduct, MSIINSTALLCONTEXT dwContext, LPCWSTR szUserSid, HKEY *key, BOOL create) DECLSPEC_HIDDEN
Definition: registry.c:692
#define L(x)
Definition: ntvdm.h:50
#define FALSE
Definition: types.h:117
DWORD WINAPI GetFileAttributesW(LPCWSTR lpFileName)
Definition: fileinfo.c:652
#define SQUASHED_GUID_SIZE
Definition: msi.c:38
static const WCHAR version[]
Definition: asmname.c:66
BOOL msi_reg_get_val_dword(HKEY hkey, LPCWSTR name, DWORD *val) DECLSPEC_HIDDEN
Definition: registry.c:262
UINT MSIREG_OpenProductKey(LPCWSTR szProduct, LPCWSTR szUserSid, MSIINSTALLCONTEXT context, HKEY *key, BOOL create) DECLSPEC_HIDDEN
Definition: registry.c:338
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned long DWORD
Definition: ntddk_ex.h:95
#define INVALID_FILE_ATTRIBUTES
Definition: vfdcmd.c:23
UINT MSIREG_OpenUserDataProductKey(LPCWSTR szProduct, MSIINSTALLCONTEXT dwContext, LPCWSTR szUserSid, HKEY *key, BOOL create) DECLSPEC_HIDDEN
Definition: registry.c:582
static int state
Definition: maze.c:121
int INSTALLSTATE
Definition: winemsi.idl:31
static BOOL open_userdata_comp_key(const WCHAR *comp, const WCHAR *usersid, MSIINSTALLCONTEXT ctx, HKEY *hkey)
Definition: msi.c:2758
#define ERROR_MORE_DATA
Definition: dderror.h:13
union awstring::@487 str
#define NULL
Definition: types.h:112
static BOOL squash_guid(LPCWSTR in, LPWSTR out)
Definition: msi.c:1193
#define RegCloseKey(hKey)
Definition: registry.h:47

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 1090 of file msi.c.

1092 {
1093  static WCHAR empty[] = L"";
1096  HKEY prodkey, userdata, source;
1097  WCHAR *val = NULL, squashed_pc[SQUASHED_GUID_SIZE], packagecode[GUID_SIZE];
1098  BOOL badconfig = FALSE;
1099  LONG res;
1100  DWORD type = REG_NONE;
1101 
1102  TRACE("%s %s %p %p\n", debugstr_w(szProduct),
1103  debugstr_w(szAttribute), szValue, pcchValueBuf);
1104 
1105  if ((szValue->str.w && !pcchValueBuf) || !szProduct || !szAttribute)
1106  return ERROR_INVALID_PARAMETER;
1107 
1108  if (!squash_guid( szProduct, squashed_pc ))
1109  return ERROR_INVALID_PARAMETER;
1110 
1111  if ((r = MSIREG_OpenProductKey(szProduct, NULL,
1113  &prodkey, FALSE)) != ERROR_SUCCESS &&
1114  (r = MSIREG_OpenProductKey(szProduct, NULL,
1116  &prodkey, FALSE)) != ERROR_SUCCESS &&
1117  (r = MSIREG_OpenProductKey(szProduct, NULL,
1119  &prodkey, FALSE)) == ERROR_SUCCESS)
1120  {
1122  }
1123 
1140  {
1141  if (!prodkey)
1142  {
1144  goto done;
1145  }
1146  if (MSIREG_OpenInstallProps(szProduct, context, NULL, &userdata, FALSE))
1147  {
1149  goto done;
1150  }
1151 
1153  szAttribute = L"DisplayName";
1155  szAttribute = L"DisplayVersion";
1156 
1157  val = reg_get_value(userdata, szAttribute, &type);
1158  if (!val)
1159  val = empty;
1160  RegCloseKey(userdata);
1161  }
1172  {
1173  if (!prodkey)
1174  {
1176  goto done;
1177  }
1178 
1180  szAttribute = L"Assignment";
1181 
1183  {
1184  res = RegOpenKeyW(prodkey, L"SourceList", &source);
1185  if (res != ERROR_SUCCESS)
1186  {
1188  goto done;
1189  }
1190 
1192  if (!val)
1193  val = empty;
1194 
1196  }
1197  else
1198  {
1199  val = reg_get_value(prodkey, szAttribute, &type);
1200  if (!val)
1201  val = empty;
1202  }
1203 
1204  if (val != empty && type != REG_DWORD &&
1206  {
1207  if (lstrlenW( val ) != SQUASHED_GUID_SIZE - 1)
1208  badconfig = TRUE;
1209  else
1210  {
1211  unsquash_guid(val, packagecode);
1212  msi_free(val);
1213  val = strdupW(packagecode);
1214  }
1215  }
1216  }
1217 
1218  if (!val)
1219  {
1221  goto done;
1222  }
1223 
1224  if (pcchValueBuf)
1225  {
1226  int len = lstrlenW( val );
1227 
1228  /* If szBuffer (szValue->str) is NULL, there's no need to copy the value
1229  * out. Also, *pcchValueBuf may be uninitialized in this case, so we
1230  * can't rely on its value.
1231  */
1232  if (szValue->str.a || szValue->str.w)
1233  {
1234  DWORD size = *pcchValueBuf;
1235  if (len < size)
1236  r = msi_strcpy_to_awstring( val, len, szValue, &size );
1237  else
1238  r = ERROR_MORE_DATA;
1239  }
1240 
1241  if (!badconfig)
1242  *pcchValueBuf = len;
1243  }
1244 
1245  if (badconfig)
1247 
1248  if (val != empty)
1249  msi_free(val);
1250 
1251 done:
1252  RegCloseKey(prodkey);
1253  return r;
1254 }
static const WCHAR INSTALLPROPERTY_URLUPDATEINFOW[]
Definition: msi.h:351
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
static const WCHAR INSTALLPROPERTY_PACKAGENAMEW[]
Definition: msi.h:265
#define ERROR_UNKNOWN_PROPERTY
Definition: winerror.h:966
static const WCHAR INSTALLPROPERTY_HELPLINKW[]
Definition: msi.h:319
#define ERROR_SUCCESS
Definition: deptool.c:10
enum tagMSIINSTALLCONTEXT MSIINSTALLCONTEXT
Definition: action.c:49
static const WCHAR INSTALLPROPERTY_INSTALLDATEW[]
Definition: msi.h:335
Definition: http.c:7251
#define TRUE
Definition: types.h:120
static WCHAR * strdupW(const WCHAR *src)
Definition: main.c:92
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
static const WCHAR INSTALLPROPERTY_PUBLISHERW[]
Definition: msi.h:339
static const WCHAR INSTALLPROPERTY_TRANSFORMSW[]
Definition: msi.h:269
static const WCHAR INSTALLPROPERTY_REGCOMPANYW[]
Definition: msi.h:367
static void msi_free(void *mem)
Definition: msipriv.h:1159
LPWSTR w
Definition: msipriv.h:743
static const WCHAR szAttribute[]
Definition: domdoc.c:1179
#define lstrlenW
Definition: compat.h:609
static const WCHAR INSTALLPROPERTY_HELPTELEPHONEW[]
Definition: msi.h:323
static const WCHAR INSTALLPROPERTY_LOCALPACKAGEW[]
Definition: msi.h:343
UINT msi_strcpy_to_awstring(const WCHAR *str, int len, awstring *awbuf, DWORD *sz)
Definition: install.c:158
UINT MSIREG_OpenInstallProps(LPCWSTR szProduct, MSIINSTALLCONTEXT dwContext, LPCWSTR szUserSid, HKEY *key, BOOL create) DECLSPEC_HIDDEN
Definition: registry.c:692
#define L(x)
Definition: ntvdm.h:50
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
long LONG
Definition: pedump.c:60
LONG WINAPI RegOpenKeyW(HKEY hKey, LPCWSTR lpSubKey, PHKEY phkResult)
Definition: reg.c:3291
#define debugstr_w
Definition: kernel32.h:32
#define SQUASHED_GUID_SIZE
Definition: msi.c:38
LPSTR a
Definition: msipriv.h:742
GLuint GLfloat * val
Definition: glext.h:7180
static const WCHAR INSTALLPROPERTY_VERSIONSTRINGW[]
Definition: msi.h:315
static const WCHAR INSTALLPROPERTY_INSTANCETYPEW[]
Definition: msi.h:300
UINT MSIREG_OpenProductKey(LPCWSTR szProduct, LPCWSTR szUserSid, MSIINSTALLCONTEXT context, HKEY *key, BOOL create) DECLSPEC_HIDDEN
Definition: registry.c:338
static const WCHAR INSTALLPROPERTY_PACKAGECODEW[]
Definition: msi.h:285
#define TRACE(s)
Definition: solgame.cpp:4
GLsizeiptr size
Definition: glext.h:5919
#define ERROR_BAD_CONFIGURATION
Definition: winerror.h:968
__wchar_t WCHAR
Definition: xmlstorage.h:180
static WCHAR * reg_get_value(HKEY hkey, const WCHAR *name, DWORD *type)
Definition: msi.c:1069
#define ERROR_UNKNOWN_PRODUCT
Definition: winerror.h:963
static const WCHAR INSTALLPROPERTY_REGOWNERW[]
Definition: msi.h:371
unsigned long DWORD
Definition: ntddk_ex.h:95
static const WCHAR INSTALLPROPERTY_PRODUCTICONW[]
Definition: msi.h:295
static const WCHAR INSTALLPROPERTY_URLINFOABOUTW[]
Definition: msi.h:347
static const WCHAR INSTALLPROPERTY_LANGUAGEW[]
Definition: msi.h:273
GLenum GLsizei len
Definition: glext.h:6722
static const WCHAR INSTALLPROPERTY_INSTALLSOURCEW[]
Definition: msi.h:331
static const WCHAR INSTALLPROPERTY_VERSIONMINORW[]
Definition: msi.h:355
#define ERROR_MORE_DATA
Definition: dderror.h:13
#define GUID_SIZE
Definition: msi.c:37
static const WCHAR INSTALLPROPERTY_PRODUCTNAMEW[]
Definition: msi.h:277
static const WCHAR INSTALLPROPERTY_INSTALLLOCATIONW[]
Definition: msi.h:327
_Check_return_ _CRTIMP int __cdecl wcscmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
union awstring::@487 str
GLsizei GLsizei GLchar * source
Definition: glext.h:6048
unsigned int UINT
Definition: ndis.h:50
#define NULL
Definition: types.h:112
BOOL empty
Definition: button.c:170
static const WCHAR INSTALLPROPERTY_INSTALLEDPRODUCTNAMEW[]
Definition: msi.h:311
GLuint res
Definition: glext.h:9613
static const WCHAR INSTALLPROPERTY_VERSIONW[]
Definition: msi.h:289
BOOL unsquash_guid(LPCWSTR in, LPWSTR out) DECLSPEC_HIDDEN
Definition: registry.c:41
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
static const WCHAR INSTALLPROPERTY_PRODUCTIDW[]
Definition: msi.h:363
#define REG_NONE
Definition: nt_native.h:1492
static const WCHAR INSTALLPROPERTY_ASSIGNMENTTYPEW[]
Definition: msi.h:281
#define REG_DWORD
Definition: sdbapi.c:596
static BOOL squash_guid(LPCWSTR in, LPWSTR out)
Definition: msi.c:1193
#define RegCloseKey(hKey)
Definition: registry.h:47
static const WCHAR INSTALLPROPERTY_AUTHORIZED_LUA_APPW[]
Definition: msi.h:305
static const WCHAR INSTALLPROPERTY_VERSIONMAJORW[]
Definition: msi.h:359

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 3513 of file msi.c.

3517 {
3518  WCHAR *user, *org, *serial, squashed_pc[SQUASHED_GUID_SIZE];
3520  HKEY hkey, props;
3521  LPCWSTR orgptr;
3522  UINT r;
3523 
3524  TRACE("%s %p %p %p %p %p %p\n", debugstr_w(szProduct), lpUserNameBuf,
3525  pcchUserNameBuf, lpOrgNameBuf, pcchOrgNameBuf, lpSerialBuf,
3526  pcchSerialBuf);
3527 
3528  if (!szProduct || !squash_guid( szProduct, squashed_pc ))
3529  return USERINFOSTATE_INVALIDARG;
3530 
3532  &hkey, FALSE) != ERROR_SUCCESS &&
3534  &hkey, FALSE) != ERROR_SUCCESS &&
3536  &hkey, FALSE) != ERROR_SUCCESS)
3537  {
3538  return USERINFOSTATE_UNKNOWN;
3539  }
3540 
3542  NULL, &props, FALSE) != ERROR_SUCCESS &&
3544  NULL, &props, FALSE) != ERROR_SUCCESS)
3545  {
3546  RegCloseKey(hkey);
3547  return USERINFOSTATE_ABSENT;
3548  }
3549 
3554 
3555  RegCloseKey(hkey);
3556  RegCloseKey(props);
3557 
3558  if (user && serial)
3560 
3561  if (pcchUserNameBuf)
3562  {
3563  if (lpUserNameBuf && !user)
3564  {
3565  (*pcchUserNameBuf)--;
3566  goto done;
3567  }
3568 
3569  r = msi_strcpy_to_awstring(user, -1, lpUserNameBuf, pcchUserNameBuf);
3570  if (r == ERROR_MORE_DATA)
3571  {
3573  goto done;
3574  }
3575  }
3576 
3577  if (pcchOrgNameBuf)
3578  {
3579  orgptr = org;
3580  if (!orgptr) orgptr = L"";
3581 
3582  r = msi_strcpy_to_awstring(orgptr, -1, lpOrgNameBuf, pcchOrgNameBuf);
3583  if (r == ERROR_MORE_DATA)
3584  {
3586  goto done;
3587  }
3588  }
3589 
3590  if (pcchSerialBuf)
3591  {
3592  if (!serial)
3593  {
3594  (*pcchSerialBuf)--;
3595  goto done;
3596  }
3597 
3598  r = msi_strcpy_to_awstring(serial, -1, lpSerialBuf, pcchSerialBuf);
3599  if (r == ERROR_MORE_DATA)
3601  }
3602 
3603 done:
3604  msi_free(user);
3605  msi_free(org);
3606  msi_free(serial);
3607 
3608  return state;
3609 }
#define ERROR_SUCCESS
Definition: deptool.c:10
LPWSTR msi_reg_get_val_str(HKEY hkey, LPCWSTR name) DECLSPEC_HIDDEN
Definition: registry.c:243
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
static const WCHAR INSTALLPROPERTY_REGCOMPANYW[]
Definition: msi.h:367
static void msi_free(void *mem)
Definition: msipriv.h:1159
enum tagUSERINFOSTATE USERINFOSTATE
UINT msi_strcpy_to_awstring(const WCHAR *str, int len, awstring *awbuf, DWORD *sz)
Definition: install.c:158
UINT MSIREG_OpenInstallProps(LPCWSTR szProduct, MSIINSTALLCONTEXT dwContext, LPCWSTR szUserSid, HKEY *key, BOOL create) DECLSPEC_HIDDEN
Definition: registry.c:692
#define L(x)
Definition: ntvdm.h:50
#define FALSE
Definition: types.h:117
static char org[]
Definition: encode.c:7456
#define debugstr_w
Definition: kernel32.h:32
#define SQUASHED_GUID_SIZE
Definition: msi.c:38
UINT MSIREG_OpenProductKey(LPCWSTR szProduct, LPCWSTR szUserSid, MSIINSTALLCONTEXT context, HKEY *key, BOOL create) DECLSPEC_HIDDEN
Definition: registry.c:338
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
static const WCHAR INSTALLPROPERTY_REGOWNERW[]
Definition: msi.h:371
static int state
Definition: maze.c:121
#define ERROR_MORE_DATA
Definition: dderror.h:13
uint32_t serial
Definition: fsck.fat.h:64
unsigned int UINT
Definition: ndis.h:50
#define NULL
Definition: types.h:112
static const WCHAR props[]
Definition: wbemdisp.c:288
static const WCHAR INSTALLPROPERTY_PRODUCTIDW[]
Definition: msi.h:363
void user(int argc, const char *argv[])
Definition: cmds.c:1350
static BOOL squash_guid(LPCWSTR in, LPWSTR out)
Definition: msi.c:1193
#define RegCloseKey(hKey)
Definition: registry.h:47

Referenced by MsiGetUserInfoA(), and MsiGetUserInfoW().

◆ msi_locate_product()

UINT msi_locate_product ( LPCWSTR  szProduct,
MSIINSTALLCONTEXT context 
)

Definition at line 56 of file msi.c.

57 {
58  HKEY hkey = NULL;
59 
61  if (!szProduct) return ERROR_UNKNOWN_PRODUCT;
62 
64  &hkey, FALSE) == ERROR_SUCCESS)
67  &hkey, FALSE) == ERROR_SUCCESS)
69  else if (MSIREG_OpenProductKey(szProduct, NULL,
71  &hkey, FALSE) == ERROR_SUCCESS)
73 
74  RegCloseKey(hkey);
75 
77  return ERROR_UNKNOWN_PRODUCT;
78 
79  return ERROR_SUCCESS;
80 }
#define ERROR_SUCCESS
Definition: deptool.c:10
Definition: http.c:7251
#define FALSE
Definition: types.h:117
UINT MSIREG_OpenProductKey(LPCWSTR szProduct, LPCWSTR szUserSid, MSIINSTALLCONTEXT context, HKEY *key, BOOL create) DECLSPEC_HIDDEN
Definition: registry.c:338
#define ERROR_UNKNOWN_PRODUCT
Definition: winerror.h:963
#define NULL
Definition: types.h:112
#define RegCloseKey(hKey)
Definition: registry.h:47

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

◆ MSI_OpenProductW()

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

Definition at line 103 of file msi.c.

104 {
105  UINT r;
106  HKEY props;
107  LPWSTR path;
109 
110  TRACE("%s %p\n", debugstr_w(szProduct), package);
111 
112  r = msi_locate_product(szProduct, &context);
113  if (r != ERROR_SUCCESS)
114  return r;
115 
116  r = MSIREG_OpenInstallProps(szProduct, context, NULL, &props, FALSE);
117  if (r != ERROR_SUCCESS)
118  return ERROR_UNKNOWN_PRODUCT;
119 
121  path = msi_reg_get_val_str(props, L"ManagedLocalPackage");
122  else
123  path = msi_reg_get_val_str(props, L"LocalPackage");
124 
126 
128  goto done;
129 
130  if (PathIsRelativeW(path))
131  {
133  goto done;
134  }
135 
136  r = MSI_OpenPackageW(path, 0, package);
137 
138 done:
140  msi_free(path);
141  return r;
142 }
UINT MSI_OpenPackageW(LPCWSTR szPackage, DWORD dwOptions, MSIPACKAGE **pPackage) DECLSPEC_HIDDEN
Definition: package.c:1385
BOOL WINAPI PathIsRelativeW(LPCWSTR lpszPath)
Definition: path.c:1578
#define ERROR_SUCCESS
Definition: deptool.c:10
enum tagMSIINSTALLCONTEXT MSIINSTALLCONTEXT
Definition: action.c:49
LPWSTR msi_reg_get_val_str(HKEY hkey, LPCWSTR name) DECLSPEC_HIDDEN
Definition: registry.c:243
Definition: http.c:7251
GLsizei const GLchar ** path
Definition: glext.h:7234
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
static void msi_free(void *mem)
Definition: msipriv.h:1159
UINT MSIREG_OpenInstallProps(LPCWSTR szProduct, MSIINSTALLCONTEXT dwContext, LPCWSTR szUserSid, HKEY *key, BOOL create) DECLSPEC_HIDDEN
Definition: registry.c:692
#define L(x)
Definition: ntvdm.h:50
#define FALSE
Definition: types.h:117
DWORD WINAPI GetFileAttributesW(LPCWSTR lpFileName)
Definition: fileinfo.c:652
#define debugstr_w
Definition: kernel32.h:32
#define TRACE(s)
Definition: solgame.cpp:4
#define ERROR_UNKNOWN_PRODUCT
Definition: winerror.h:963
UINT msi_locate_product(LPCWSTR szProduct, MSIINSTALLCONTEXT *context)
Definition: msi.c:56
#define INVALID_FILE_ATTRIBUTES
Definition: vfdcmd.c:23
_In_opt_ PVOID _In_ ULONG _In_ PVOID context
Definition: wdfdriver.h:113
unsigned int UINT
Definition: ndis.h:50
#define NULL
Definition: types.h:112
static const WCHAR props[]
Definition: wbemdisp.c:288
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define RegCloseKey(hKey)
Definition: registry.h:47
#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 3373 of file msi.c.

3377 {
3379  WCHAR *desc;
3380  HKEY hkey;
3381  DWORD size;
3382  UINT ret;
3384 
3385  if (MSIREG_OpenUserComponentsKey( szComponent, &hkey, FALSE )) return ERROR_UNKNOWN_COMPONENT;
3386 
3387  desc = reg_get_multisz( hkey, szQualifier );
3388  RegCloseKey(hkey);
3389  if (!desc) return ERROR_INDEX_ABSENT;
3390 
3391  /* FIXME: handle multiple descriptors */
3392  ret = MsiDecomposeDescriptorW( desc, product, feature, comp, &size );
3393  msi_free( desc );
3394  if (ret != ERROR_SUCCESS) return ret;
3395 
3396  if (!szProduct) szProduct = product;
3397  if (!comp[0])
3398  {
3400  WCHAR *components;
3401  GUID guid;
3402 
3403  /* use the first component of the feature if the descriptor component is empty */
3404  if ((ret = msi_locate_product( szProduct, &ctx ))) return ret;
3405  if ((ret = MSIREG_OpenUserDataFeaturesKey( szProduct, NULL, ctx, &hkey, FALSE )))
3406  {
3407  return ERROR_FILE_NOT_FOUND;
3408  }
3409  components = reg_get_sz( hkey, feature );
3410  RegCloseKey( hkey );
3411  if (!components) return ERROR_FILE_NOT_FOUND;
3412 
3414  {
3415  msi_free( components );
3416  return ERROR_FILE_NOT_FOUND;
3417  }
3418  msi_free( components );
3419  StringFromGUID2( &guid, comp, ARRAY_SIZE( comp ));
3420  }
3421 
3422  state = MSI_GetComponentPath( szProduct, comp, L"S-1-1-0", MSIINSTALLCONTEXT_ALL, lpPathBuf, pcchPathBuf );
3423 
3426  return ERROR_SUCCESS;
3427 }
INTERNETFEATURELIST feature
Definition: misc.c:1719
static INSTALLSTATE MSI_GetComponentPath(const WCHAR *szProduct, const WCHAR *szComponent, const WCHAR *szUserSid, MSIINSTALLCONTEXT ctx, awstring *lpPathBuf, DWORD *pcchBuf)
Definition: msi.c:2777
#define ERROR_SUCCESS
Definition: deptool.c:10
enum tagMSIINSTALLCONTEXT MSIINSTALLCONTEXT
Definition: action.c:49
BOOL decode_base85_guid(LPCWSTR, GUID *) DECLSPEC_HIDDEN
Definition: registry.c:132
static void msi_free(void *mem)
Definition: msipriv.h:1159
#define ERROR_INDEX_ABSENT
Definition: winerror.h:969
#define lstrlenW
Definition: compat.h:609
static WCHAR * reg_get_sz(HKEY hkey, const WCHAR *name)
Definition: msi.c:3359
UINT MSIREG_OpenUserComponentsKey(LPCWSTR szComponent, HKEY *key, BOOL create) DECLSPEC_HIDDEN
Definition: registry.c:505
const GUID * guid
#define L(x)
Definition: ntvdm.h:50
UINT MSIREG_OpenUserDataFeaturesKey(LPCWSTR szProduct, LPCWSTR szUserSid, MSIINSTALLCONTEXT context, HKEY *key, BOOL create) DECLSPEC_HIDDEN
Definition: registry.c:472
#define FALSE
Definition: types.h:117
static const WCHAR desc[]
Definition: protectdata.c:36
#define MAX_FEATURE_CHARS
Definition: msi.h:257
static WCHAR * reg_get_multisz(HKEY hkey, const WCHAR *name)
Definition: msi.c:3350
UINT WINAPI MsiDecomposeDescriptorW(LPCWSTR, LPWSTR, LPWSTR, LPWSTR, LPDWORD)
Definition: registry.c:927
#define ERROR_FILE_NOT_FOUND
Definition: disk.h:79
#define BASE85_SIZE
Definition: msi.c:3368
GLsizeiptr size
Definition: glext.h:5919
__wchar_t WCHAR
Definition: xmlstorage.h:180
INT WINAPI StringFromGUID2(REFGUID id, LPOLESTR str, INT cmax)
Definition: compobj.c:2434
UINT msi_locate_product(LPCWSTR szProduct, MSIINSTALLCONTEXT *context)
Definition: msi.c:56
unsigned long DWORD
Definition: ntddk_ex.h:95
GLenum GLenum GLuint components
Definition: glext.h:9620
int ret
static int state
Definition: maze.c:121
int INSTALLSTATE
Definition: winemsi.idl:31
#define ERROR_MORE_DATA
Definition: dderror.h:13
#define ARRAY_SIZE(a)
Definition: main.h:24
DWORD size
Definition: msi.c:1103
#define ERROR_UNKNOWN_COMPONENT
Definition: winerror.h:965
unsigned int UINT
Definition: ndis.h:50
#define NULL
Definition: types.h:112
#define RegCloseKey(hKey)
Definition: registry.h:47

Referenced by MsiProvideQualifiedComponentExA(), and MsiProvideQualifiedComponentExW().

◆ MsiAdvertiseProductA()

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

Definition at line 168 of file msi.c.

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

◆ MsiAdvertiseProductExA()

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

Definition at line 184 of file msi.c.

186 {
187  FIXME( "%s, %s, %s, %#x, %#lx, %#lx\n", debugstr_a(szPackagePath), debugstr_a(szScriptfilePath),
188  debugstr_a(szTransforms), lgidLanguage, dwPlatform, dwOptions );
190 }
DWORD dwOptions
Definition: solitaire.cpp:24
#define FIXME(fmt,...)
Definition: debug.h:111
#define debugstr_a
Definition: kernel32.h:31
#define ERROR_CALL_NOT_IMPLEMENTED
Definition: compat.h:102

◆ MsiAdvertiseProductExW()

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

Definition at line 192 of file msi.c.

194 {
195  FIXME( "%s, %s, %s, %#x %#lx %#lx\n", debugstr_w(szPackagePath), debugstr_w(szScriptfilePath),
196  debugstr_w(szTransforms), lgidLanguage, dwPlatform, dwOptions );
198 }
DWORD dwOptions
Definition: solitaire.cpp:24
#define debugstr_w
Definition: kernel32.h:32
#define FIXME(fmt,...)
Definition: debug.h:111
#define ERROR_CALL_NOT_IMPLEMENTED
Definition: compat.h:102

◆ MsiAdvertiseProductW()

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

Definition at line 176 of file msi.c.

178 {
179  FIXME("%s %s %s %08x\n",debugstr_w(szPackagePath),
180  debugstr_w(szScriptfilePath), debugstr_w(szTransforms), lgidLanguage);
182 }
#define debugstr_w
Definition: kernel32.h:32
#define FIXME(fmt,...)
Definition: debug.h:111
#define ERROR_CALL_NOT_IMPLEMENTED
Definition: compat.h:102

Referenced by WinMain().

◆ MsiAdvertiseScriptA()

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

Definition at line 4124 of file msi.c.

4125 {
4126  FIXME( "%s, %#lx, %p, %d\n", debugstr_a(szScriptFile), dwFlags, phRegData, fRemoveItems );
4128 }
#define FIXME(fmt,...)
Definition: debug.h:111
#define debugstr_a
Definition: kernel32.h:31
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
#define ERROR_CALL_NOT_IMPLEMENTED
Definition: compat.h:102

◆ MsiAdvertiseScriptW()

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

Definition at line 4115 of file msi.c.

4116 {
4117  FIXME( "%s, %#lx, %p, %d\n", debugstr_w(szScriptFile), dwFlags, phRegData, fRemoveItems );
4119 }
#define debugstr_w
Definition: kernel32.h:32
#define FIXME(fmt,...)
Definition: debug.h:111
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
#define ERROR_CALL_NOT_IMPLEMENTED
Definition: compat.h:102

◆ MsiApplyMultiplePatchesA()

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

Definition at line 426 of file msi.c.

428 {
429  LPWSTR patch_packages = NULL;
430  LPWSTR product_code = NULL;
431  LPWSTR properties_list = NULL;
433 
434  TRACE("%s %s %s\n", debugstr_a(szPatchPackages), debugstr_a(szProductCode),
435  debugstr_a(szPropertiesList));
436 
437  if (!szPatchPackages || !szPatchPackages[0])
439 
440  if (!(patch_packages = strdupAtoW(szPatchPackages)))
441  return ERROR_OUTOFMEMORY;
442 
443  if (szProductCode && !(product_code = strdupAtoW(szProductCode)))
444  goto done;
445 
446  if (szPropertiesList && !(properties_list = strdupAtoW(szPropertiesList)))
447  goto done;
448 
449  r = MsiApplyMultiplePatchesW(patch_packages, product_code, properties_list);
450 
451 done:
452  msi_free(patch_packages);
453  msi_free(product_code);
454  msi_free(properties_list);
455 
456  return r;
457 }
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
UINT WINAPI MsiApplyMultiplePatchesW(LPCWSTR szPatchPackages, LPCWSTR szProductCode, LPCWSTR szPropertiesList)
Definition: msi.c:459
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
static void msi_free(void *mem)
Definition: msipriv.h:1159
#define TRACE(s)
Definition: solgame.cpp:4
#define debugstr_a
Definition: kernel32.h:31
unsigned int UINT
Definition: ndis.h:50
#define NULL
Definition: types.h:112
WCHAR * LPWSTR
Definition: xmlstorage.h:184
static WCHAR * strdupAtoW(const char *str)
Definition: main.c:65
#define ERROR_OUTOFMEMORY
Definition: deptool.c:13

Referenced by test_MsiApplyMultiplePatches().

◆ MsiApplyMultiplePatchesW()

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

Definition at line 459 of file msi.c.

461 {
462  UINT r = ERROR_SUCCESS;
463  LPCWSTR beg, end;
464 
465  TRACE("%s %s %s\n", debugstr_w(szPatchPackages), debugstr_w(szProductCode),
466  debugstr_w(szPropertiesList));
467 
468  if (!szPatchPackages || !szPatchPackages[0])
470 
471  beg = end = szPatchPackages;
472  while (*beg)
473  {
474  DWORD len;
475  LPWSTR patch;
476 
477  while (*beg == ' ') beg++;
478  while (*end && *end != ';') end++;
479 
480  len = end - beg;
481  while (len && beg[len - 1] == ' ') len--;
482 
483  if (!len) return ERROR_INVALID_NAME;
484 
485  patch = msi_alloc((len + 1) * sizeof(WCHAR));
486  if (!patch)
487  return ERROR_OUTOFMEMORY;
488 
489  memcpy(patch, beg, len * sizeof(WCHAR));
490  patch[len] = '\0';
491 
492  r = MSI_ApplyPatchW(patch, szProductCode, szPropertiesList);
493  msi_free(patch);
494 
495  if (r != ERROR_SUCCESS || !*end)
496  break;
497 
498  beg = ++end;
499  }
500  return r;
501 }
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
#define ERROR_SUCCESS
Definition: deptool.c:10
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
static void msi_free(void *mem)
Definition: msipriv.h:1159
#define debugstr_w
Definition: kernel32.h:32
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned long DWORD
Definition: ntddk_ex.h:95
GLuint GLuint end
Definition: gl.h:1545
static UINT MSI_ApplyPatchW(LPCWSTR szPatchPackage, LPCWSTR szProductCode, LPCWSTR szCommandLine)
Definition: msi.c:361
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
GLenum GLsizei len
Definition: glext.h:6722
unsigned int UINT
Definition: ndis.h:50
static void * msi_alloc(size_t len) __WINE_ALLOC_SIZE(1)
Definition: msipriv.h:1142
#define ERROR_INVALID_NAME
Definition: compat.h:103
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define ERROR_OUTOFMEMORY
Definition: deptool.c:13

Referenced by MsiApplyMultiplePatchesA().

◆ MsiApplyPatchA()

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

Definition at line 288 of file msi.c.

290 {
291  LPWSTR patch_package = NULL;
292  LPWSTR install_package = NULL;
293  LPWSTR command_line = NULL;
295 
296  TRACE("%s %s %d %s\n", debugstr_a(szPatchPackage), debugstr_a(szInstallPackage),
297  eInstallType, debugstr_a(szCommandLine));
298 
299  if (szPatchPackage && !(patch_package = strdupAtoW(szPatchPackage)))
300  goto done;
301 
302  if (szInstallPackage && !(install_package = strdupAtoW(szInstallPackage)))
303  goto done;
304 
305  if (szCommandLine && !(command_line = strdupAtoW(szCommandLine)))
306  goto done;
307 
308  r = MsiApplyPatchW(patch_package, install_package, eInstallType, command_line);
309 
310 done:
311  msi_free(patch_package);
312  msi_free(install_package);
313  msi_free(command_line);
314 
315  return r;
316 }
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
static void msi_free(void *mem)
Definition: msipriv.h:1159
UINT WINAPI MsiApplyPatchW(LPCWSTR szPatchPackage, LPCWSTR szInstallPackage, INSTALLTYPE eInstallType, LPCWSTR szCommandLine)
Definition: msi.c:410
#define TRACE(s)
Definition: solgame.cpp:4
#define debugstr_a
Definition: kernel32.h:31
unsigned int UINT
Definition: ndis.h:50
#define NULL
Definition: types.h:112
WCHAR * LPWSTR
Definition: xmlstorage.h:184
static WCHAR * strdupAtoW(const char *str)
Definition: main.c:65
#define ERROR_OUTOFMEMORY
Definition: deptool.c:13

Referenced by init_function_pointers(), 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 410 of file msi.c.

412 {
413  TRACE("%s %s %d %s\n", debugstr_w(szPatchPackage), debugstr_w(szInstallPackage),
414  eInstallType, debugstr_w(szCommandLine));
415 
416  if (szInstallPackage || eInstallType == INSTALLTYPE_NETWORK_IMAGE ||
417  eInstallType == INSTALLTYPE_SINGLE_INSTANCE)
418  {
419  FIXME("Only reading target products from patch\n");
421  }
422 
423  return MSI_ApplyPatchW(szPatchPackage, NULL, szCommandLine);
424 }
#define debugstr_w
Definition: kernel32.h:32
#define FIXME(fmt,...)
Definition: debug.h:111
#define TRACE(s)
Definition: solgame.cpp:4
static UINT MSI_ApplyPatchW(LPCWSTR szPatchPackage, LPCWSTR szProductCode, LPCWSTR szCommandLine)
Definition: msi.c:361
#define NULL
Definition: types.h:112
#define ERROR_CALL_NOT_IMPLEMENTED
Definition: compat.h:102

Referenced by MsiApplyPatchA(), and WinMain().

◆ MsiBeginTransactionA()

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

Definition at line 4297 of file msi.c.

4298 {
4299  WCHAR *nameW;
4300  UINT r;
4301 
4302  FIXME( "%s, %#lx, %p, %p\n", debugstr_a(name), attrs, id, event );
4303 
4304  nameW = strdupAtoW( name );
4305  if (name && !nameW)
4306  return ERROR_OUTOFMEMORY;
4307 
4308  r = MsiBeginTransactionW( nameW, attrs, id, event );
4309  msi_free( nameW );
4310  return r;
4311 }
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
static void msi_free(void *mem)
Definition: msipriv.h:1159
#define FIXME(fmt,...)
Definition: debug.h:111
static const WCHAR nameW[]
Definition: main.c:46
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define debugstr_a
Definition: kernel32.h:31
UINT WINAPI MsiBeginTransactionW(const WCHAR *name, DWORD attrs, MSIHANDLE *id, HANDLE *event)
Definition: msi.c:4316
struct _cl_event * event
Definition: glext.h:7739
unsigned int UINT
Definition: ndis.h:50
Definition: name.c:38
static WCHAR * strdupAtoW(const char *str)
Definition: main.c:65
#define ERROR_OUTOFMEMORY
Definition: deptool.c:13

◆ MsiBeginTransactionW()

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

Definition at line 4316 of file msi.c.

4317 {
4318  FIXME( "%s, %#lx, %p, %p\n", debugstr_w(name), attrs, id, event );
4319 
4320  *id = (MSIHANDLE)0xdeadbeef;
4321  *event = (HANDLE)0xdeadbeef;
4322 
4323  return ERROR_SUCCESS;
4324 }
#define ERROR_SUCCESS
Definition: deptool.c:10
unsigned long MSIHANDLE
Definition: winemsi.idl:24
#define debugstr_w
Definition: kernel32.h:32
#define FIXME(fmt,...)
Definition: debug.h:111
PVOID HANDLE
Definition: typedefs.h:73
struct _cl_event * event
Definition: glext.h:7739
Definition: name.c:38

Referenced by MsiBeginTransactionA().

◆ MsiCollectUserInfoA()

UINT WINAPI MsiCollectUserInfoA ( LPCSTR  szProduct)

Definition at line 3697 of file msi.c.

3698 {
3699  MSIHANDLE handle;
3700  UINT rc;
3701  MSIPACKAGE *package;
3702 
3703  TRACE("(%s)\n",debugstr_a(szProduct));
3704 
3705  rc = MsiOpenProductA(szProduct,&handle);
3706  if (rc != ERROR_SUCCESS)
3707  return ERROR_INVALID_PARAMETER;
3708 
3709  /* MsiCollectUserInfo cannot be called from a custom action. */
3710  package = msihandle2msiinfo(handle, MSIHANDLETYPE_PACKAGE);
3711  if (!package)
3713 
3714  rc = ACTION_PerformAction(package, L"FirstRun");
3715  msiobj_release( &package->hdr );
3716 
3718 
3719  return rc;
3720 }
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
#define ERROR_SUCCESS
Definition: deptool.c:10
MSIOBJECTHDR hdr
Definition: msipriv.h:393
#define L(x)
Definition: ntvdm.h:50
namespace GUID const ADDRINFOEXW ADDRINFOEXW struct timeval OVERLAPPED LPLOOKUPSERVICE_COMPLETION_ROUTINE HANDLE * handle
Definition: sock.c:82
unsigned long MSIHANDLE
Definition: winemsi.idl:24
UINT WINAPI MsiOpenProductA(LPCSTR szProduct, MSIHANDLE *phProduct)
Definition: msi.c:82
#define TRACE(s)
Definition: solgame.cpp:4
#define debugstr_a
Definition: kernel32.h:31
int msiobj_release(MSIOBJECTHDR *info)
Definition: handle.c:241
UINT WINAPI MsiCloseHandle(MSIHANDLE handle)
Definition: handle.c:269
UINT ACTION_PerformAction(MSIPACKAGE *package, const WCHAR *action)
Definition: action.c:7610
unsigned int UINT
Definition: ndis.h:50
#define ERROR_CALL_NOT_IMPLEMENTED
Definition: compat.h:102

◆ MsiCollectUserInfoW()

UINT WINAPI MsiCollectUserInfoW ( LPCWSTR  szProduct)

Definition at line 3672 of file msi.c.

3673 {
3674  MSIHANDLE handle;
3675  UINT rc;
3676  MSIPACKAGE *package;
3677 
3678  TRACE("(%s)\n",debugstr_w(szProduct));
3679 
3680  rc = MsiOpenProductW(szProduct,&handle);
3681  if (rc != ERROR_SUCCESS)
3682  return ERROR_INVALID_PARAMETER;
3683 
3684  /* MsiCollectUserInfo cannot be called from a custom action. */
3685  package = msihandle2msiinfo(handle, MSIHANDLETYPE_PACKAGE);
3686  if (!package)
3688 
3689  rc = ACTION_PerformAction(package, L"FirstRun");
3690  msiobj_release( &package->hdr );
3691 
3693 
3694  return rc;
3695 }
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
#define ERROR_SUCCESS
Definition: deptool.c:10
MSIOBJECTHDR hdr
Definition: msipriv.h:393
#define L(x)
Definition: ntvdm.h:50
namespace GUID const ADDRINFOEXW ADDRINFOEXW struct timeval OVERLAPPED LPLOOKUPSERVICE_COMPLETION_ROUTINE HANDLE * handle
Definition: sock.c:82
unsigned long MSIHANDLE
Definition: winemsi.idl:24
#define debugstr_w
Definition: kernel32.h:32
#define TRACE(s)
Definition: solgame.cpp:4
int msiobj_release(MSIOBJECTHDR *info)
Definition: handle.c:241
UINT WINAPI MsiOpenProductW(LPCWSTR szProduct, MSIHANDLE *phProduct)
Definition: msi.c:144
UINT WINAPI MsiCloseHandle(MSIHANDLE handle)
Definition: handle.c:269
UINT ACTION_PerformAction(MSIPACKAGE *package, const WCHAR *action)
Definition: action.c:7610
unsigned int UINT
Definition: ndis.h:50
#define ERROR_CALL_NOT_IMPLEMENTED
Definition: compat.h:102

◆ MsiConfigureFeatureA()

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

Definition at line 3725 of file msi.c.

3726 {
3727  LPWSTR prod, feat = NULL;
3729 
3730  TRACE("%s %s %i\n", debugstr_a(szProduct), debugstr_a(szFeature), eInstallState);
3731 
3732  prod = strdupAtoW( szProduct );
3733  if (szProduct && !prod)
3734  goto end;
3735 
3736  feat = strdupAtoW( szFeature );
3737  if (szFeature && !feat)
3738  goto end;
3739 
3740  r = MsiConfigureFeatureW(prod, feat, eInstallState);
3741 
3742 end:
3743  msi_free(feat);
3744  msi_free(prod);
3745 
3746  return r;
3747 }
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
static void msi_free(void *mem)
Definition: msipriv.h:1159
#define TRACE(s)
Definition: solgame.cpp:4
#define debugstr_a
Definition: kernel32.h:31
GLuint GLuint end
Definition: gl.h:1545
unsigned int UINT
Definition: ndis.h:50
#define NULL
Definition: types.h:112
UINT WINAPI MsiConfigureFeatureW(LPCWSTR szProduct, LPCWSTR szFeature, INSTALLSTATE eInstallState)
Definition: msi.c:3752
WCHAR * LPWSTR
Definition: xmlstorage.h:184
static WCHAR * strdupAtoW(const char *str)
Definition: main.c:65
#define ERROR_OUTOFMEMORY
Definition: deptool.c:13

Referenced by test_null().

◆ MsiConfigureFeatureW()

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

Definition at line 3752 of file msi.c.

3753 {
3754  MSIPACKAGE *package = NULL;
3755  UINT r;
3756  WCHAR sourcepath[MAX_PATH], filename[MAX_PATH];
3757  DWORD sz;
3758 
3759  TRACE("%s %s %i\n", debugstr_w(szProduct), debugstr_w(szFeature), eInstallState);
3760 
3761  if (!szProduct || !szFeature)
3762  return ERROR_INVALID_PARAMETER;
3763 
3764  switch (eInstallState)
3765  {
3766  case INSTALLSTATE_DEFAULT:
3767  /* FIXME: how do we figure out the default location? */
3768  eInstallState = INSTALLSTATE_LOCAL;
3769  break;
3770  case INSTALLSTATE_LOCAL:
3771  case INSTALLSTATE_SOURCE:
3772  case INSTALLSTATE_ABSENT:
3774  break;
3775  default:
3776  return ERROR_INVALID_PARAMETER;
3777  }
3778 
3779  r = MSI_OpenProductW( szProduct, &package );
3780  if (r != ERROR_SUCCESS)
3781  return r;
3782 
3783  sz = sizeof(sourcepath);
3786 
3787  sz = sizeof(filename);
3790 
3791  lstrcatW( sourcepath, filename );
3792 
3794 
3795  r = ACTION_PerformAction(package, L"CostInitialize");
3796  if (r != ERROR_SUCCESS)
3797  goto end;
3798 
3799  r = MSI_SetFeatureStateW( package, szFeature, eInstallState);
3800  if (r != ERROR_SUCCESS)
3801  goto end;
3802 
3803  r = MSI_InstallPackage( package, sourcepath, NULL );
3804 
3805 end:
3806  msiobj_release( &package->hdr );
3807 
3808  return r;
3809 }
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
UINT MSI_InstallPackage(MSIPACKAGE *package, LPCWSTR szPackagePath, LPCWSTR szCommandLine)
Definition: action.c:7710
static const WCHAR INSTALLPROPERTY_PACKAGENAMEW[]
Definition: msi.h:265
static UINT MSI_OpenProductW(LPCWSTR szProduct, MSIPACKAGE **package)
Definition: msi.c:103
UINT WINAPI MsiSourceListGetInfoW(LPCWSTR szProduct, LPCWSTR szUserSid, MSIINSTALLCONTEXT dwContext, DWORD dwOptions, LPCWSTR szProperty, LPWSTR szValue, LPDWORD pcchValue)
Definition: source.c:523
#define ERROR_SUCCESS
Definition: deptool.c:10
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
INSTALLUILEVEL WINAPI MsiSetInternalUI(INSTALLUILEVEL dwUILevel, HWND *phWnd)
Definition: msi.c:2284
const char * filename
Definition: ioapi.h:135
static const WCHAR INSTALLPROPERTY_LASTUSEDSOURCEW[]
Definition: msi.h:405
#define L(x)
Definition: ntvdm.h:50
#define debugstr_w
Definition: kernel32.h:32
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define MAX_PATH
Definition: compat.h:34
unsigned long DWORD
Definition: ntddk_ex.h:95
int msiobj_release(MSIOBJECTHDR *info)
Definition: handle.c:241
GLuint GLuint end
Definition: gl.h:1545
UINT MSI_SetFeatureStateW(MSIPACKAGE *package, LPCWSTR szFeature, INSTALLSTATE iState)
Definition: install.c:915
UINT ACTION_PerformAction(MSIPACKAGE *package, const WCHAR *action)
Definition: action.c:7610
unsigned int UINT
Definition: ndis.h:50
#define NULL
Definition: types.h:112
LPWSTR WINAPI lstrcatW(LPWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:274

Referenced by MsiConfigureFeatureA(), and test_null().

◆ MsiConfigureProductA()

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

Definition at line 948 of file msi.c.

950 {
951  LPWSTR szwProduct = NULL;
952  UINT r;
953 
954  TRACE("%s %d %d\n",debugstr_a(szProduct), iInstallLevel, eInstallState);
955 
956  if( szProduct )
957  {
958  szwProduct = strdupAtoW( szProduct );
959  if( !szwProduct )
960  return ERROR_OUTOFMEMORY;
961  }
962 
963  r = MsiConfigureProductW( szwProduct, iInstallLevel, eInstallState );
964  msi_free( szwProduct );
965 
966  return r;
967 }
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
static void msi_free(void *mem)
Definition: msipriv.h:1159
UINT WINAPI MsiConfigureProductW(LPCWSTR szProduct, int iInstallLevel, INSTALLSTATE eInstallState)
Definition: msi.c:969
#define TRACE(s)
Definition: solgame.cpp:4
#define debugstr_a
Definition: kernel32.h:31
unsigned int UINT
Definition: ndis.h:50
#define NULL
Definition: types.h:112
WCHAR * LPWSTR
Definition: xmlstorage.h:184
static WCHAR * strdupAtoW(const char *str)
Definition: main.c:65
#define ERROR_OUTOFMEMORY
Definition: deptool.c:13

Referenced by test_concurrentinstall().

◆ MsiConfigureProductExA()

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

Definition at line 918 of file msi.c.

920 {
921  LPWSTR szwProduct = NULL;
922  LPWSTR szwCommandLine = NULL;
924 
925  if( szProduct )
926  {
927  szwProduct = strdupAtoW( szProduct );
928  if( !szwProduct )
929  goto end;
930  }
931 
932  if( szCommandLine)
933  {
934  szwCommandLine = strdupAtoW( szCommandLine );
935  if( !szwCommandLine)
936  goto end;
937  }
938 
939  r = MsiConfigureProductExW( szwProduct, iInstallLevel, eInstallState,
940  szwCommandLine );
941 end:
942  msi_free( szwProduct );
943  msi_free( szwCommandLine);
944 
945  return r;
946 }
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
static void msi_free(void *mem)
Definition: msipriv.h:1159
UINT WINAPI MsiConfigureProductExW(LPCWSTR szProduct, int iInstallLevel, INSTALLSTATE eInstallState, LPCWSTR szCommandLine)
Definition: msi.c:833
GLuint GLuint end
Definition: gl.h:1545
unsigned int UINT
Definition: ndis.h:50
#define NULL
Definition: types.h:112
WCHAR * LPWSTR
Definition: xmlstorage.h:184
static WCHAR * strdupAtoW(const char *str)
Definition: main.c:65
#define ERROR_OUTOFMEMORY
Definition: deptool.c:13

Referenced by test_installed_prop(), and test_MsiConfigureProductEx().

◆ MsiConfigureProductExW()

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

Definition at line 833 of file msi.c.

835 {
836  MSIPACKAGE* package = NULL;
838  UINT r;
839  DWORD sz;
840  WCHAR sourcepath[MAX_PATH], filename[MAX_PATH];
841  LPWSTR commandline;
842 
843  TRACE("%s %d %d %s\n",debugstr_w(szProduct), iInstallLevel, eInstallState,
844  debugstr_w(szCommandLine));
845 
846  if (!szProduct || lstrlenW(szProduct) != GUID_SIZE - 1)
848 
849  if (eInstallState == INSTALLSTATE_ADVERTISED ||
850  eInstallState == INSTALLSTATE_SOURCE)
851  {
852  FIXME("State %d not implemented\n", eInstallState);
854  }
855 
856  r = msi_locate_product(szProduct, &context);
857  if (r != ERROR_SUCCESS)
858  return r;
859 
860  r = open_package(szProduct, NULL, context, &package);
861  if (r != ERROR_SUCCESS)
862  return r;
863 
864  sz = lstrlenW(L" Installed=1") + 1;
865 
866  if (szCommandLine)
867  sz += lstrlenW(szCommandLine);
868 
869  if (eInstallState != INSTALLSTATE_DEFAULT)
870  sz += lstrlenW(L" INSTALLLEVEL=32767");
871 
872  if (eInstallState == INSTALLSTATE_ABSENT)
873  sz += lstrlenW(L" REMOVE=ALL");
874 
876  sz += lstrlenW(L" ALLUSERS=1");
877 
878  commandline = msi_alloc(sz * sizeof(WCHAR));
879  if (!commandline)
880  {
882  goto end;
883  }
884 
885  commandline[0] = 0;
886  if (szCommandLine)
887  lstrcpyW(commandline, szCommandLine);
888 
889  if (eInstallState != INSTALLSTATE_DEFAULT)
890  lstrcatW(commandline, L" INSTALLLEVEL=32767");
891 
892  if (eInstallState == INSTALLSTATE_ABSENT)
893  lstrcatW(commandline, L" REMOVE=ALL");
894 
896  lstrcatW(commandline, L" ALLUSERS=1");
897 
898  sz = sizeof(sourcepath);
900  INSTALLPROPERTY_LASTUSEDSOURCEW, sourcepath, &sz);
901 
902  sz = sizeof(filename);
905 
906  lstrcatW(sourcepath, filename);
907 
908  r = MSI_InstallPackage( package, sourcepath, commandline );
909 
910  msi_free(commandline);
911 
912 end:
913  msiobj_release( &package->hdr );
914 
915  return r;
916 }
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
UINT MSI_InstallPackage(MSIPACKAGE *package, LPCWSTR szPackagePath, LPCWSTR szCommandLine)
Definition: action.c:7710
static const WCHAR INSTALLPROPERTY_PACKAGENAMEW[]
Definition: msi.h:265
static UINT open_package(const WCHAR *product, const WCHAR *usersid, MSIINSTALLCONTEXT context, MSIPACKAGE **package)
Definition: msi.c:784
UINT WINAPI MsiSourceListGetInfoW(LPCWSTR szProduct, LPCWSTR szUserSid, MSIINSTALLCONTEXT dwContext, DWORD dwOptions, LPCWSTR szProperty, LPWSTR szValue, LPDWORD pcchValue)
Definition: source.c:523
#define ERROR_SUCCESS
Definition: deptool.c:10
enum tagMSIINSTALLCONTEXT MSIINSTALLCONTEXT
Definition: action.c:49
Definition: http.c:7251
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
static void msi_free(void *mem)
Definition: msipriv.h:1159
const char * filename
Definition: ioapi.h:135
#define lstrlenW
Definition: compat.h:609
static const WCHAR INSTALLPROPERTY_LASTUSEDSOURCEW[]
Definition: msi.h:405
#define L(x)
Definition: ntvdm.h:50
#define debugstr_w
Definition: kernel32.h:32
#define FIXME(fmt,...)
Definition: debug.h:111
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define MAX_PATH
Definition: compat.h:34
UINT msi_locate_product(LPCWSTR szProduct, MSIINSTALLCONTEXT *context)
Definition: msi.c:56
unsigned long DWORD
Definition: ntddk_ex.h:95
_In_opt_ PVOID _In_ ULONG _In_ PVOID context
Definition: wdfdriver.h:113
int msiobj_release(MSIOBJECTHDR *info)
Definition: handle.c:241
GLuint GLuint end
Definition: gl.h:1545
#define GUID_SIZE
Definition: msi.c:37
#define lstrcpyW
Definition: compat.h:608
unsigned int UINT
Definition: ndis.h:50
#define NULL
Definition: types.h:112
static void * msi_alloc(size_t len) __WINE_ALLOC_SIZE(1)
Definition: msipriv.h:1142
#define ERROR_CALL_NOT_IMPLEMENTED
Definition: compat.h:102
LPWSTR WINAPI lstrcatW(LPWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:274
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define ERROR_OUTOFMEMORY
Definition: deptool.c:13

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

◆ MsiConfigureProductW()

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

Definition at line 969 of file msi.c.

971 {
972  return MsiConfigureProductExW(szProduct, iInstallLevel, eInstallState, NULL);
973 }
UINT WINAPI MsiConfigureProductExW(LPCWSTR szProduct, int iInstallLevel, INSTALLSTATE eInstallState, LPCWSTR szCommandLine)
Definition: msi.c:833
#define NULL
Definition: types.h:112

Referenced by MsiConfigureProductA().

◆ MsiCreateAndVerifyInstallerDirectory()

UINT WINAPI MsiCreateAndVerifyInstallerDirectory ( DWORD  dwReserved)

Definition at line 3816 of file msi.c.

3817 {
3818  WCHAR path[MAX_PATH];
3819 
3820  TRACE( "%#lx\n", dwReserved );
3821 
3822  if (dwReserved)
3823  {
3824  FIXME( "dwReserved = %#lx\n", dwReserved );
3825  return ERROR_INVALID_PARAMETER;
3826  }
3827 
3829  return ERROR_FUNCTION_FAILED;
3830 
3831  lstrcatW(path, L"\\Installer");
3832 
3834  return ERROR_FUNCTION_FAILED;
3835 
3836  return ERROR_SUCCESS;
3837 }
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
BOOL WINAPI CreateDirectoryW(IN LPCWSTR lpPathName, IN LPSECURITY_ATTRIBUTES lpSecurityAttributes)
Definition: dir.c:90
#define ERROR_SUCCESS
Definition: deptool.c:10
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1040
UINT WINAPI GetWindowsDirectoryW(OUT LPWSTR lpBuffer, IN UINT uSize)
Definition: path.c:2352
#define L(x)
Definition: ntvdm.h:50
#define ERROR_FUNCTION_FAILED
Definition: winerror.h:985
_In_ HANDLE _In_ DWORD _In_ DWORD _Inout_opt_ LPOVERLAPPED _In_opt_ LPTRANSMIT_FILE_BUFFERS _In_ DWORD dwReserved
Definition: mswsock.h:90
#define FIXME(fmt,...)
Definition: debug.h:111
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define MAX_PATH
Definition: compat.h:34
#define NULL
Definition: types.h:112
LPWSTR WINAPI lstrcatW(LPWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:274
#define ERROR_ALREADY_EXISTS
Definition: disk.h:80

◆ MsiDetermineApplicablePatchesA()

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

Definition at line 530 of file msi.c.

532 {
533  UINT i, r;
534  WCHAR *package_path = NULL;
536 
537  TRACE( "%s, %lu, %p\n", debugstr_a(szProductPackagePath), cPatchInfo, pPatchInfo );
538 
539  if (szProductPackagePath && !(package_path = strdupAtoW( szProductPackagePath )))
540  return ERROR_OUTOFMEMORY;
541 
542  if (!(psi = patchinfoAtoW( cPatchInfo, pPatchInfo )))
543  {
544  msi_free( package_path );
545  return ERROR_OUTOFMEMORY;
546  }
547  r = MsiDetermineApplicablePatchesW( package_path, cPatchInfo, psi );
548  if (r == ERROR_SUCCESS)
549  {
550  for (i = 0; i < cPatchInfo; i++)
551  {
552  pPatchInfo[i].dwOrder = psi[i].dwOrder;
553  pPatchInfo[i].uStatus = psi[i].uStatus;
554  }
555  }
556  msi_free( package_path );
557  free_patchinfo( cPatchInfo, psi );
558  return r;
559 }
#define ERROR_SUCCESS
Definition: deptool.c:10
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
static void msi_free(void *mem)
Definition: msipriv.h:1159
static void free_patchinfo(DWORD count, MSIPATCHSEQUENCEINFOW *info)
Definition: msi.c:503
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define debugstr_a
Definition: kernel32.h:31
static MSIPATCHSEQUENCEINFOW * patchinfoAtoW(DWORD count, const MSIPATCHSEQUENCEINFOA *info)
Definition: msi.c:510
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
unsigned int UINT
Definition: ndis.h:50
#define NULL
Definition: types.h:112
UINT WINAPI MsiDetermineApplicablePatchesW(const WCHAR *szProductPackagePath, DWORD cPatchInfo, MSIPATCHSEQUENCEINFOW *pPatchInfo)
Definition: msi.c:728
static WCHAR * strdupAtoW(const char *str)
Definition: main.c:65
#define ERROR_OUTOFMEMORY
Definition: deptool.c:13

◆ MsiDetermineApplicablePatchesW()

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

Definition at line 728 of file msi.c.

730 {
731  UINT r;
732  MSIPACKAGE *package;
733 
734  TRACE( "%s, %lu, %p\n", debugstr_w(szProductPackagePath), cPatchInfo, pPatchInfo );
735 
736  r = MSI_OpenPackageW( szProductPackagePath, 0, &package );
737  if (r != ERROR_SUCCESS)
738  {
739  ERR("failed to open package %u\n", r);
740  return r;
741  }
742  r = determine_patch_sequence( package, cPatchInfo, pPatchInfo );
743  msiobj_release( &package->hdr );
744  return r;
745 }
UINT MSI_OpenPackageW(LPCWSTR szPackage, DWORD dwOptions, MSIPACKAGE **pPackage) DECLSPEC_HIDDEN
Definition: package.c:1385
#define ERROR_SUCCESS
Definition: deptool.c:10
MSIOBJECTHDR hdr
Definition: msipriv.h:393
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
#define debugstr_w
Definition: kernel32.h:32
#define TRACE(s)
Definition: solgame.cpp:4
int msiobj_release(MSIOBJECTHDR *info)
Definition: handle.c:241
#define ERR(fmt,...)
Definition: debug.h:110
unsigned int UINT
Definition: ndis.h:50
static UINT determine_patch_sequence(MSIPACKAGE *package, DWORD count, MSIPATCHSEQUENCEINFOW *info)
Definition: msi.c:633

Referenced by MsiDetermineApplicablePatchesA().

◆ MsiDeterminePatchSequenceA()

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

Definition at line 747 of file msi.c.

749 {
750  UINT i, r;
751  WCHAR *productW, *usersidW = NULL;
752  MSIPATCHSEQUENCEINFOW *patchinfoW;
753 
754  TRACE( "%s, %s, %d, %lu, %p\n", debugstr_a(product), debugstr_a(usersid), context, count, patchinfo );
755 
756  if (!product) return ERROR_INVALID_PARAMETER;
757  if (!(productW = strdupAtoW( product ))) return ERROR_OUTOFMEMORY;
758  if (usersid && !(usersidW = strdupAtoW( usersid )))
759  {
760  msi_free( productW );
761  return ERROR_OUTOFMEMORY;
762  }
763  if (!(patchinfoW = patchinfoAtoW( count, patchinfo )))
764  {
765  msi_free( productW );
766  msi_free( usersidW );
767  return ERROR_OUTOFMEMORY;
768  }
769  r = MsiDeterminePatchSequenceW( productW, usersidW, context, count, patchinfoW );
770  if (r == ERROR_SUCCESS)
771  {
772  for (i = 0; i < count; i++)
773  {
774  patchinfo[i].dwOrder = patchinfoW[i].dwOrder;
775  patchinfo[i].uStatus = patchinfoW[i].uStatus;
776  }
777  }
778  msi_free( productW );
779  msi_free( usersidW );
780  free_patchinfo( count, patchinfoW );
781  return r;
782 }
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
#define ERROR_SUCCESS
Definition: deptool.c:10
Definition: http.c:7251
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
GLuint GLuint GLsizei count
Definition: gl.h:1545
static void msi_free(void *mem)
Definition: msipriv.h:1159
UINT WINAPI MsiDeterminePatchSequenceW(const WCHAR *product, const WCHAR *usersid, MSIINSTALLCONTEXT context, DWORD count, MSIPATCHSEQUENCEINFOW *patchinfo)
Definition: msi.c:816
static void free_patchinfo(DWORD count, MSIPATCHSEQUENCEINFOW *info)
Definition: msi.c:503
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define debugstr_a
Definition: kernel32.h:31
static MSIPATCHSEQUENCEINFOW * patchinfoAtoW(DWORD count, const MSIPATCHSEQUENCEINFOA *info)
Definition: msi.c:510
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
unsigned int UINT
Definition: ndis.h:50
#define NULL
Definition: types.h:112
static WCHAR * strdupAtoW(const char *str)
Definition: main.c:65
#define ERROR_OUTOFMEMORY
Definition: deptool.c:13

◆ MsiDeterminePatchSequenceW()

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

Definition at line 816 of file msi.c.

818 {
819  UINT r;
820  MSIPACKAGE *package;
821 
822  TRACE( "%s, %s, %d, %lu, %p\n", debugstr_w(product), debugstr_w(usersid), context, count, patchinfo );
823 
824  if (!product) return ERROR_INVALID_PARAMETER;
825  r = open_package( product, usersid, context, &package );
826  if (r != ERROR_SUCCESS) return r;
827 
828  r = determine_patch_sequence( package, count, patchinfo );
829  msiobj_release( &package->hdr );
830  return r;
831 }
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
static UINT open_package(const WCHAR *product, const WCHAR *usersid, MSIINSTALLCONTEXT context, MSIPACKAGE **package)
Definition: msi.c:784
#define ERROR_SUCCESS
Definition: deptool.c:10
Definition: http.c:7251
MSIOBJECTHDR hdr
Definition: msipriv.h:393
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
GLuint GLuint GLsizei count
Definition: gl.h:1545
#define debugstr_w
Definition: kernel32.h:32
#define TRACE(s)
Definition: solgame.cpp:4
int msiobj_release(MSIOBJECTHDR *info)
Definition: handle.c:241
unsigned int UINT
Definition: ndis.h:50
static UINT determine_patch_sequence(MSIPACKAGE *package, DWORD count, MSIPATCHSEQUENCEINFOW *info)
Definition: msi.c:633

Referenced by MsiDeterminePatchSequenceA().

◆ MsiEnableLogA()

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

Definition at line 1884 of file msi.c.

1885 {
1886  LPWSTR szwLogFile = NULL;
1887  UINT r;
1888 
1889  TRACE( "%#lx, %s, %#lx\n", dwLogMode, debugstr_a(szLogFile), attributes );
1890 
1891  if( szLogFile )
1892  {
1893  szwLogFile = strdupAtoW( szLogFile );
1894  if( !szwLogFile )
1895  return ERROR_OUTOFMEMORY;
1896  }
1897  r = MsiEnableLogW( dwLogMode, szwLogFile, attributes );
1898  msi_free( szwLogFile );
1899  return r;
1900 }
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
static void msi_free(void *mem)
Definition: msipriv.h:1159
UINT WINAPI MsiEnableLogW(DWORD dwLogMode, const WCHAR *szLogFile, DWORD attributes)
Definition: msi.c:1902
#define TRACE(s)
Definition: solgame.cpp:4
#define debugstr_a
Definition: kernel32.h:31
unsigned int UINT
Definition: ndis.h:50
#define NULL
Definition: types.h:112
WCHAR * LPWSTR
Definition: xmlstorage.h:184
static WCHAR * strdupAtoW(const char *str)
Definition: main.c:65
#define ERROR_OUTOFMEMORY
Definition: deptool.c:13

Referenced by START_TEST().

◆ MsiEnableLogW()

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

Definition at line 1902 of file msi.c.

1903 {
1904  TRACE( "%#lx, %s, %#lx\n", dwLogMode, debugstr_w(szLogFile), attributes );
1905 
1907  gszLogFile = NULL;
1908  if (szLogFile)
1909  {
1910  HANDLE file;
1911 
1912  if (!(attributes & INSTALLLOGATTRIBUTES_APPEND))
1913  DeleteFileW(szLogFile);
1916  if (file != INVALID_HANDLE_VALUE)
1917  {
1918  gszLogFile = strdupW(szLogFile);
1919  CloseHandle(file);
1920  }
1921  else ERR( "unable to enable log %s (%lu)\n", debugstr_w(szLogFile), GetLastError() );
1922  }
1923 
1924  return ERROR_SUCCESS;
1925 }
#define CloseHandle
Definition: compat.h:598
#define ERROR_SUCCESS
Definition: deptool.c:10
static WCHAR * strdupW(const WCHAR *src)
Definition: main.c:92
#define INVALID_HANDLE_VALUE
Definition: compat.h:590
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1040
static void msi_free(void *mem)
Definition: msipriv.h:1159
#define FILE_SHARE_WRITE
Definition: nt_native.h:681
#define GENERIC_WRITE
Definition: nt_native.h:90
#define debugstr_w
Definition: kernel32.h:32
BOOL WINAPI DeleteFileW(IN LPCWSTR lpFileName)
Definition: delete.c:39
#define TRACE(s)
Definition: solgame.cpp:4
const char file[]
Definition: icontest.c:11
WCHAR * gszLogFile
Definition: msi_main.c:50
#define OPEN_ALWAYS
Definition: disk.h:70
#define FILE_ATTRIBUTE_NORMAL
Definition: compat.h:137
#define ERR(fmt,...)
Definition: debug.h:110
#define NULL
Definition: types.h:112
#define CreateFileW
Definition: compat.h:600
Definition: fci.c:126

Referenced by MsiEnableLogA(), and WinMain().

◆ MsiEndTransaction()

UINT WINAPI MsiEndTransaction ( DWORD  state)

Definition at line 4340 of file msi.c.

4341 {
4342  FIXME( "%#lx\n", state );
4343  return ERROR_SUCCESS;
4344 }
#define ERROR_SUCCESS
Definition: deptool.c:10
#define FIXME(fmt,...)
Definition: debug.h:111
static int state
Definition: maze.c:121

◆ MsiEnumComponentCostsA()

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

Definition at line 1927 of file msi.c.

1929 {
1930  UINT r;
1931  DWORD len;
1932  WCHAR *driveW, *componentW = NULL;
1933 
1934  TRACE( "%lu, %s, %lu, %d, %p, %p, %p, %p\n", handle, debugstr_a(component), index, state, drive, buflen, cost,
1935  temp );
1936 
1937  if (!drive || !buflen) return ERROR_INVALID_PARAMETER;
1938  if (component && !(componentW = strdupAtoW( component ))) return ERROR_OUTOFMEMORY;
1939 
1940  len = *buflen;
1941  if (!(driveW = msi_alloc( len * sizeof(WCHAR) )))
1942  {
1943  msi_free( componentW );
1944  return ERROR_OUTOFMEMORY;
1945  }
1946  r = MsiEnumComponentCostsW( handle, componentW, index, state, driveW, buflen, cost, temp );
1947  if (!r)
1948  {
1949  WideCharToMultiByte( CP_ACP, 0, driveW, -1, drive, len, NULL, NULL );
1950  }
1951  msi_free( componentW );
1952  msi_free( driveW );
1953  return r;
1954 }
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
UINT WINAPI MsiEnumComponentCostsW(MSIHANDLE handle, const WCHAR *component, DWORD index, INSTALLSTATE state, WCHAR *drive, DWORD *buflen, int *cost, int *temp)
Definition: msi.c:1964
#define WideCharToMultiByte
Definition: compat.h:111
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
#define CP_ACP
Definition: compat.h:109
static void msi_free(void *mem)
Definition: msipriv.h:1159
GLuint index
Definition: glext.h:6031
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define debugstr_a
Definition: kernel32.h:31
unsigned long DWORD
Definition: ntddk_ex.h:95
static int state
Definition: maze.c:121
GLenum GLsizei len
Definition: glext.h:6722
static calc_node_t temp
Definition: rpn_ieee.c:38
unsigned int UINT
Definition: ndis.h:50
#define NULL
Definition: types.h:112
static void * msi_alloc(size_t len) __WINE_ALLOC_SIZE(1)
Definition: msipriv.h:1142
static WCHAR * strdupAtoW(const char *str)
Definition: main.c:65
#define ERROR_OUTOFMEMORY
Definition: deptool.c:13

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 1964 of file msi.c.

1966 {
1968  MSICOMPONENT *comp = NULL;
1969  MSIPACKAGE *package;
1970  MSIFILE *file;
1971  STATSTG stat = {0};
1972  WCHAR path[MAX_PATH];
1973 
1974  TRACE( "%lu, %s, %lu, %d, %p, %p, %p, %p\n", handle, debugstr_w(component), index, state, drive, buflen, cost,
1975  temp );
1976 
1977  if (!drive || !buflen || !cost || !temp) return ERROR_INVALID_PARAMETER;
1978  if (!(package = msihandle2msiinfo( handle, MSIHANDLETYPE_PACKAGE )))
1979  {
1980  WCHAR buffer[3];
1981  MSIHANDLE remote;
1982 
1983  if (!(remote = msi_get_remote(handle)))
1984  return ERROR_INVALID_HANDLE;
1985 
1986  __TRY
1987  {
1988  r = remote_EnumComponentCosts(remote, component, index, state, buffer, cost, temp);
1989  }
1991  {
1992  r = GetExceptionCode();
1993  }
1994  __ENDTRY
1995 
1996  if (r == ERROR_SUCCESS)
1997  {
1998  lstrcpynW(drive, buffer, *buflen);
1999  if (*buflen < 3)
2000  r = ERROR_MORE_DATA;
2001  *buflen = 2;
2002  }
2003  return r;
2004  }
2005 
2006  if (!msi_get_property_int( package->db, L"CostingComplete", 0 ))
2007  {
2008  msiobj_release( &package->hdr );
2010  }
2011  if (component && component[0] && !(comp = msi_get_loaded_component( package, component )))
2012  {
2013  msiobj_release( &package->hdr );
2014  return ERROR_UNKNOWN_COMPONENT;
2015  }
2016  if (*buflen < 3)
2017  {
2018  *buflen = 2;
2019  msiobj_release( &package->hdr );
2020  return ERROR_MORE_DATA;
2021  }
2022  if (index)
2023  {
2024  msiobj_release( &package->hdr );
2025  return ERROR_NO_MORE_ITEMS;
2026  }
2027 
2028  drive[0] = 0;
2029  *cost = *temp = 0;
2031  if (component && component[0])
2032  {
2033  if (msi_is_global_assembly( comp )) *temp = comp->Cost;
2034  if (!comp->Enabled || !comp->KeyPath)
2035  {
2036  *cost = 0;
2037  *buflen = set_drive( drive, path[0] );
2038  r = ERROR_SUCCESS;
2039  }
2040  else if ((file = msi_get_loaded_file( package, comp->KeyPath )))
2041  {
2042  *cost = max( 8, comp->Cost / 512 );
2043  *buflen = set_drive( drive, file->TargetPath[0] );
2044  r = ERROR_SUCCESS;
2045  }
2046  }
2047  else if (IStorage_Stat( package->db->storage, &stat, STATFLAG_NONAME ) == S_OK)
2048  {
2049  *temp = max( 8, stat.cbSize.QuadPart / 512 );
2050  *buflen = set_drive( drive, path[0] );
2051  r = ERROR_SUCCESS;
2052  }
2053  msiobj_release( &package->hdr );
2054  return r;
2055 }
#define __EXCEPT(func)
Definition: exception.h:84
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
MSIHANDLE msi_get_remote(MSIHANDLE handle)
Definition: handle.c:183
#define max(a, b)
Definition: svc.c:63
#define ERROR_SUCCESS
Definition: deptool.c:10
#define ERROR_NO_MORE_ITEMS
Definition: compat.h:105
MSIOBJECTHDR hdr
Definition: msipriv.h:393
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
int msi_get_property_int(MSIDATABASE *package, LPCWSTR prop, int def) DECLSPEC_HIDDEN
Definition: package.c:2305
#define ERROR_INVALID_HANDLE
Definition: compat.h:98
BOOL msi_is_global_assembly(MSICOMPONENT *comp)
Definition: action.c:2037
GLuint buffer
Definition: glext.h:5915
LPWSTR KeyPath
Definition: msipriv.h:530
#define lstrcpynW
Definition: compat.h:597
UINT WINAPI GetWindowsDirectoryW(OUT LPWSTR lpBuffer, IN UINT uSize)
Definition: path.c:2352
#define L(x)
Definition: ntvdm.h:50
static UINT set_drive(WCHAR *buffer, WCHAR letter)
Definition: msi.c:1956
unsigned long MSIHANDLE
Definition: winemsi.idl:24
#define debugstr_w
Definition: kernel32.h:32
LONG WINAPI rpc_filter(EXCEPTION_POINTERS *eptr)
Definition: custom.c:85
#define ERROR_FUNCTION_NOT_CALLED
Definition: winerror.h:984
GLuint index
Definition: glext.h:6031
#define __TRY
Definition: compat.h:80
MSIFILE * msi_get_loaded_file(MSIPACKAGE *package, const WCHAR *key)
Definition: action.c:574
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define MAX_PATH
Definition: compat.h:34
const char file[]
Definition: icontest.c:11
MSIDATABASE * db
Definition: msipriv.h:394
int msiobj_release(MSIOBJECTHDR *info)
Definition: handle.c:241
MSICOMPONENT * msi_get_loaded_component(MSIPACKAGE *package, const WCHAR *Component)
Definition: action.c:552
#define __ENDTRY
Definition: compat.h:82
#define MSIHANDLETYPE_PACKAGE
Definition: msipriv.h:726
static int state
Definition: