ReactOS  0.4.13-dev-39-g8b6696f
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 "msipriv.h"
#include "msiserver.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 "initguid.h"
#include "msxml2.h"
#include "wine/debug.h"
#include "wine/unicode.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 (LPCSTR szPackagePath, LPCSTR szScriptfilePath, LPCSTR szTransforms, LANGID lgidLanguage, DWORD dwPlatform, DWORD dwOptions)
 
UINT WINAPI MsiAdvertiseProductExW (LPCWSTR szPackagePath, LPCWSTR szScriptfilePath, LPCWSTR szTransforms, LANGID lgidLanguage, DWORD dwPlatform, DWORD dwOptions)
 
UINT WINAPI MsiInstallProductA (LPCSTR szPackagePath, LPCSTR szCommandLine)
 
UINT WINAPI MsiInstallProductW (LPCWSTR szPackagePath, LPCWSTR szCommandLine)
 
UINT WINAPI MsiReinstallProductA (LPCSTR szProduct, DWORD dwReinstallMode)
 
UINT WINAPI MsiReinstallProductW (LPCWSTR 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 (LPCSTR szProductPackagePath, DWORD cPatchInfo, PMSIPATCHSEQUENCEINFOA 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 (LPCWSTR szProductPackagePath, DWORD cPatchInfo, PMSIPATCHSEQUENCEINFOW pPatchInfo)
 
UINT WINAPI MsiDeterminePatchSequenceA (LPCSTR product, LPCSTR usersid, MSIINSTALLCONTEXT context, DWORD count, PMSIPATCHSEQUENCEINFOA patchinfo)
 
static UINT open_package (const WCHAR *product, const WCHAR *usersid, MSIINSTALLCONTEXT context, MSIPACKAGE **package)
 
UINT WINAPI MsiDeterminePatchSequenceW (LPCWSTR product, LPCWSTR usersid, MSIINSTALLCONTEXT context, DWORD count, PMSIPATCHSEQUENCEINFOW 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, LPCSTR szLogFile, DWORD attributes)
 
UINT WINAPI MsiEnableLogW (DWORD dwLogMode, LPCWSTR szLogFile, DWORD attributes)
 
UINT WINAPI MsiEnumComponentCostsA (MSIHANDLE handle, LPCSTR component, DWORD index, INSTALLSTATE state, LPSTR drive, DWORD *buflen, int *cost, int *temp)
 
static UINT set_drive (WCHAR *buffer, WCHAR letter)
 
UINT WINAPI MsiEnumComponentCostsW (MSIHANDLE handle, LPCWSTR component, DWORD index, INSTALLSTATE state, LPWSTR 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, LPVOID pvContext)
 
INSTALLUI_HANDLERW WINAPI MsiSetExternalUIW (INSTALLUI_HANDLERW puiHandler, DWORD dwMessageFilter, LPVOID pvContext)
 
LANGID WINAPI MsiLoadStringW (MSIHANDLE handle, UINT id, LPWSTR 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, LPCSTR lpText, LPCSTR lpCaption, UINT uType, WORD wLanguageId, DWORD f)
 
UINT WINAPI MsiMessageBoxW (HWND hWnd, LPCWSTR lpText, LPCWSTR lpCaption, UINT uType, WORD wLanguageId, DWORD f)
 
UINT WINAPI MsiMessageBoxExA (HWND hWnd, LPCSTR lpText, LPCSTR lpCaption, UINT uType, DWORD unknown, WORD wLanguageId, DWORD f)
 
UINT WINAPI MsiMessageBoxExW (HWND hWnd, LPCWSTR lpText, LPCWSTR lpCaption, UINT uType, DWORD unknown, WORD wLanguageId, DWORD f)
 
UINT WINAPI MsiProvideAssemblyA (LPCSTR szAssemblyName, LPCSTR szAppContext, DWORD dwInstallMode, DWORD dwAssemblyInfo, LPSTR lpPathBuf, LPDWORD pcchPathBuf)
 
UINT WINAPI MsiProvideAssemblyW (LPCWSTR szAssemblyName, LPCWSTR szAppContext, DWORD dwInstallMode, DWORD dwAssemblyInfo, LPWSTR lpPathBuf, LPDWORD 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 (LPCSTR path, DWORD flags, PCCERT_CONTEXT *cert, LPBYTE hash, LPDWORD hashlen)
 
HRESULT WINAPI MsiGetFileSignatureInformationW (LPCWSTR path, DWORD flags, PCCERT_CONTEXT *cert, LPBYTE hash, LPDWORD hashlen)
 
UINT WINAPI MsiGetProductPropertyA (MSIHANDLE hProduct, LPCSTR szProperty, LPSTR szValue, LPDWORD pccbValue)
 
UINT WINAPI MsiGetProductPropertyW (MSIHANDLE hProduct, LPCWSTR szProperty, LPWSTR szValue, LPDWORD 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 (LPCWSTR path, LPWSTR verbuf, LPDWORD verlen, LPWSTR langbuf, LPDWORD 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 (LPCWSTR szProduct, LPCWSTR szFeature, DWORD dwInstallMode, DWORD dwReserved)
 
INSTALLSTATE WINAPI MsiUseFeatureExA (LPCSTR szProduct, LPCSTR 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 (LPCWSTR szComponent, LPCWSTR szQualifier, DWORD dwInstallMode, LPCWSTR szProduct, DWORD Unused1, DWORD Unused2, LPWSTR lpPathBuf, LPDWORD pcchPathBuf)
 
UINT WINAPI MsiProvideQualifiedComponentExA (LPCSTR szComponent, LPCSTR szQualifier, DWORD dwInstallMode, LPCSTR szProduct, DWORD Unused1, DWORD Unused2, LPSTR lpPathBuf, LPDWORD 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 (LPCWSTR szProduct, LPCWSTR szFeature, DWORD dwReinstallMode)
 
UINT WINAPI MsiReinstallFeatureA (LPCSTR szProduct, LPCSTR 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 (const WCHAR *path, MSIFILEHASHINFO *hash)
 
UINT WINAPI MsiGetFileHashW (LPCWSTR szFilePath, DWORD dwOptions, PMSIFILEHASHINFO pHash)
 
UINT WINAPI MsiGetFileHashA (LPCSTR szFilePath, DWORD dwOptions, PMSIFILEHASHINFO pHash)
 
UINT WINAPI MsiAdvertiseScriptW (LPCWSTR szScriptFile, DWORD dwFlags, PHKEY phRegData, BOOL fRemoveItems)
 
UINT WINAPI MsiAdvertiseScriptA (LPCSTR szScriptFile, DWORD dwFlags, PHKEY 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, LPVOID context, PINSTALLUI_HANDLER_RECORD prev)
 
UINT WINAPI MsiInstallMissingComponentA (LPCSTR product, LPCSTR component, INSTALLSTATE state)
 
UINT WINAPI MsiInstallMissingComponentW (LPCWSTR szProduct, LPCWSTR szComponent, INSTALLSTATE eInstallState)
 
UINT WINAPI MsiProvideComponentA (LPCSTR product, LPCSTR feature, LPCSTR component, DWORD mode, LPSTR buf, LPDWORD buflen)
 
UINT WINAPI MsiProvideComponentW (LPCWSTR product, LPCWSTR feature, LPCWSTR component, DWORD mode, LPWSTR buf, LPDWORD buflen)
 
UINT WINAPI MsiBeginTransactionA (LPCSTR name, DWORD attrs, MSIHANDLE *id, HANDLE *event)
 
UINT WINAPI MsiBeginTransactionW (LPCWSTR 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

static const WCHAR installerW [] = {'\\','I','n','s','t','a','l','l','e','r',0}
 

Macro Definition Documentation

◆ BASE85_SIZE

#define BASE85_SIZE   20

Definition at line 3424 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 631 of file msi.c.

632 {
634  DWORD i;
635 
636  if (count > 1)
637  FIXME("patch ordering not supported\n");
638 
639  for (i = 0; i < count; i++)
640  {
641  switch (info[i].ePatchDataType)
642  {
644  {
645  if (MSI_ApplicablePatchW( package, info[i].szPatchData ) != ERROR_SUCCESS)
646  {
647  info[i].dwOrder = ~0u;
649  }
650  else
651  {
652  info[i].dwOrder = i;
653  info[i].uStatus = ERROR_SUCCESS;
654  }
655  break;
656  }
659  {
660  VARIANT_BOOL b;
661  HRESULT hr;
662  BSTR s;
663 
664  if (!desc)
665  {
666  hr = CoCreateInstance( &CLSID_DOMDocument30, NULL, CLSCTX_INPROC_SERVER,
667  &IID_IXMLDOMDocument, (void**)&desc );
668  if (hr != S_OK)
669  {
670  ERR("failed to create DOMDocument30 instance, 0x%08x\n", hr);
671  return ERROR_FUNCTION_FAILED;
672  }
673  }
674 
675  s = SysAllocString( info[i].szPatchData );
676  if (info[i].ePatchDataType == MSIPATCH_DATATYPE_XMLPATH)
677  {
678  VARIANT src;
679 
680  V_VT(&src) = VT_BSTR;
681  V_BSTR(&src) = s;
682  hr = IXMLDOMDocument_load( desc, src, &b );
683  }
684  else
685  hr = IXMLDOMDocument_loadXML( desc, s, &b );
686  SysFreeString( s );
687  if ( hr != S_OK )
688  {
689  ERR("failed to parse patch description\n");
690  IXMLDOMDocument_Release( desc );
691  break;
692  }
693 
694  if (MSI_ApplicablePatchXML( package, desc ) != ERROR_SUCCESS)
695  {
696  info[i].dwOrder = ~0u;
698  }
699  else
700  {
701  info[i].dwOrder = i;
702  info[i].uStatus = ERROR_SUCCESS;
703  }
704  break;
705  }
706  default:
707  {
708  FIXME("unknown patch data type %u\n", info[i].ePatchDataType);
709  info[i].dwOrder = i;
710  info[i].uStatus = ERROR_SUCCESS;
711  break;
712  }
713  }
714 
715  TRACE("szPatchData: %s\n", debugstr_w(info[i].szPatchData));
716  TRACE("ePatchDataType: %u\n", info[i].ePatchDataType);
717  TRACE("dwOrder: %u\n", info[i].dwOrder);
718  TRACE("uStatus: %u\n", info[i].uStatus);
719  }
720 
721  if (desc) IXMLDOMDocument_Release( desc );
722 
723  return ERROR_SUCCESS;
724 }
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:1927
short VARIANT_BOOL
Definition: compat.h:1924
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
#define ERROR_FUNCTION_FAILED
Definition: winerror.h:985
#define debugstr_w
Definition: kernel32.h:32
#define FIXME(fmt,...)
Definition: debug.h:110
const struct builtin_class_descr * desc
Definition: regcontrol.c:48
smooth NULL
Definition: ftsmooth.c:416
BSTR WINAPI SysAllocString(LPCOLESTR str)
Definition: oleaut.c:241
#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:586
LONG HRESULT
Definition: typedefs.h:77
unsigned long DWORD
Definition: ntddk_ex.h:95
static UINT MSI_ApplicablePatchW(MSIPACKAGE *package, LPCWSTR patch)
Definition: msi.c:556
#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:3234
#define ERR(fmt,...)
Definition: debug.h:109
#define S_OK
Definition: intsafe.h:59
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
Definition: oleaut.c:274

Referenced by MsiDetermineApplicablePatchesW(), and MsiDeterminePatchSequenceW().

◆ free_patchinfo()

static void free_patchinfo ( DWORD  count,
MSIPATCHSEQUENCEINFOW info 
)
static

Definition at line 498 of file msi.c.

499 {
500  DWORD i;
501  for (i = 0; i < count; i++) msi_free( (WCHAR *)info[i].szPatchData );
502  msi_free( info );
503 }
GLuint GLuint GLsizei count
Definition: gl.h:1545
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
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned long DWORD
Definition: ntddk_ex.h:95
static BOOL msi_free(void *mem)
Definition: msipriv.h:1227

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

3195 {
3196  static const WCHAR szVersionResource[] = {'\\',0};
3197  static const WCHAR szVersionFormat[] = {'%','d','.','%','d','.','%','d','.','%','d',0};
3198  static const WCHAR szLangFormat[] = {'%','d',0};
3200  DWORD len, error;
3201  LPVOID version;
3202  VS_FIXEDFILEINFO *ffi;
3203  USHORT *lang;
3204  WCHAR tmp[32];
3205 
3206  if (!(len = GetFileVersionInfoSizeW( path, NULL )))
3207  {
3208  error = GetLastError();
3211  return error;
3212  }
3213  if (!(version = msi_alloc( len ))) return ERROR_OUTOFMEMORY;
3214  if (!GetFileVersionInfoW( path, 0, len, version ))
3215  {
3216  msi_free( version );
3217  return GetLastError();
3218  }
3219  if (!verbuf && !verlen && !langbuf && !langlen)
3220  {
3221  msi_free( version );
3222  return ERROR_SUCCESS;
3223  }
3224  if (verlen)
3225  {
3226  if (VerQueryValueW( version, szVersionResource, (LPVOID *)&ffi, &len ) && len > 0)
3227  {
3228  sprintfW( tmp, szVersionFormat,
3229  HIWORD(ffi->dwFileVersionMS), LOWORD(ffi->dwFileVersionMS),
3230  HIWORD(ffi->dwFileVersionLS), LOWORD(ffi->dwFileVersionLS) );
3231  if (verbuf) lstrcpynW( verbuf, tmp, *verlen );
3232  len = strlenW( tmp );
3233  if (*verlen > len) ret = ERROR_SUCCESS;
3234  *verlen = len;
3235  }
3236  else
3237  {
3238  if (verbuf) *verbuf = 0;
3239  *verlen = 0;
3240  }
3241  }
3242  if (langlen)
3243  {
3244  if (VerQueryValueW( version, szLangResource, (LPVOID *)&lang, &len ) && len > 0)
3245  {
3246  sprintfW( tmp, szLangFormat, *lang );
3247  if (langbuf) lstrcpynW( langbuf, tmp, *langlen );
3248  len = strlenW( tmp );
3249  if (*langlen > len) ret = ERROR_SUCCESS;
3250  *langlen = len;
3251  }
3252  else
3253  {
3254  if (langbuf) *langbuf = 0;
3255  *langlen = 0;
3256  }
3257  }
3258  msi_free( version );
3259  return ret;
3260 }
WINE_UNICODE_INLINE unsigned int strlenW(const WCHAR *str)
Definition: unicode.h:212
#define ERROR_SUCCESS
Definition: deptool.c:10
#define error(str)
Definition: mkdosfs.c:1605
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
#define lstrcpynW
Definition: compat.h:397
smooth NULL
Definition: ftsmooth.c:416
static const WCHAR version[]
Definition: asmname.c:64
#define ERROR_FILE_NOT_FOUND
Definition: disk.h:79
static const WCHAR lang[]
Definition: wbemdisp.c:287
static const WCHAR szLangResource[]
Definition: msipriv.h:1196
__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:616
GLenum GLsizei len
Definition: glext.h:6722
#define ERROR_MORE_DATA
Definition: dderror.h:13
unsigned short USHORT
Definition: pedump.c:61
Definition: services.c:325
#define sprintfW
Definition: unicode.h:58
unsigned int UINT
Definition: ndis.h:50
#define ERROR_FILE_INVALID
Definition: winerror.h:585
BOOL WINAPI GetFileVersionInfoW(LPCWSTR filename, DWORD handle, DWORD datasize, LPVOID data)
Definition: version.c:850
static BOOL msi_free(void *mem)
Definition: msipriv.h:1227
static void * msi_alloc(size_t len) __WINE_ALLOC_SIZE(1)
Definition: msipriv.h:1204
#define HIWORD(l)
Definition: typedefs.h:246
#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:1054

Referenced by MsiGetFileVersionW().

◆ get_patch_product_codes()

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

Definition at line 310 of file msi.c.

311 {
312  MSIHANDLE patch, info = 0;
313  UINT r, type;
314  DWORD size;
315  static WCHAR empty[] = {0};
316  WCHAR *codes = NULL;
317 
318  r = MsiOpenDatabaseW( szPatchPackage, MSIDBOPEN_READONLY, &patch );
319  if (r != ERROR_SUCCESS)
320  return r;
321 
322  r = MsiGetSummaryInformationW( patch, NULL, 0, &info );
323  if (r != ERROR_SUCCESS)
324  goto done;
325 
326  size = 0;
328  if (r != ERROR_MORE_DATA || !size || type != VT_LPSTR)
329  {
330  ERR("Failed to read product codes from patch\n");
332  goto done;
333  }
334 
335  codes = msi_alloc( ++size * sizeof(WCHAR) );
336  if (!codes)
337  {
339  goto done;
340  }
341 
343  if (r == ERROR_SUCCESS)
344  *product_codes = msi_split_string( codes, ';' );
345 
346 done:
347  MsiCloseHandle( info );
348  MsiCloseHandle( patch );
349  msi_free( codes );
350  return r;
351 }
#define PID_TEMPLATE
Definition: suminfo.c:49
#define MSIDBOPEN_READONLY
Definition: msiquery.h:66
UINT WINAPI MsiSummaryInfoGetPropertyW(MSIHANDLE handle, UINT uiProperty, PUINT puiDataType, LPINT piValue, FILETIME *pftValue, LPWSTR szValueBuf, LPDWORD pcchValueBuf)
Definition: suminfo.c:750
#define ERROR_SUCCESS
Definition: deptool.c:10
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
static const WCHAR empty[]
Definition: main.c:49
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
UINT WINAPI MsiGetSummaryInformationW(MSIHANDLE hDatabase, LPCWSTR szDatabase, UINT uiUpdateCount, MSIHANDLE *pHandle)
Definition: suminfo.c:514
unsigned long MSIHANDLE
Definition: msiserver.idl:25
#define ERROR_FUNCTION_FAILED
Definition: winerror.h:985
smooth NULL
Definition: ftsmooth.c:416
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:270
#define ERR(fmt,...)
Definition: debug.h:109
WCHAR ** msi_split_string(const WCHAR *str, WCHAR sep)
Definition: action.c:388
DWORD size
Definition: msi.c:1488
UINT WINAPI MsiOpenDatabaseW(LPCWSTR szDBPath, LPCWSTR szPersist, MSIHANDLE *phDB)
Definition: database.c:303
unsigned int UINT
Definition: ndis.h:50
static BOOL msi_free(void *mem)
Definition: msipriv.h:1227
static void * msi_alloc(size_t len) __WINE_ALLOC_SIZE(1)
Definition: msipriv.h:1204
#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 }
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
GLdouble GLdouble t
Definition: gl.h:2047
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
if(!(yy_init))
Definition: macro.lex.yy.c:714
#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 4412 of file msi.c.

4413 {
4414  FIXME("%p,%p,%p,%08x\n", a, b, c, d);
4415  return ERROR_SUCCESS;
4416 }
#define ERROR_SUCCESS
Definition: deptool.c:10
#define FIXME(fmt,...)
Definition: debug.h:110
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
#define d
Definition: ke_i.h:81
const GLubyte * c
Definition: glext.h:8905
GLboolean GLboolean GLboolean GLboolean a
Definition: glext.h:6204

◆ MSI_ApplicablePatchW()

static UINT MSI_ApplicablePatchW ( MSIPACKAGE package,
LPCWSTR  patch 
)
static

Definition at line 556 of file msi.c.

557 {
558  MSISUMMARYINFO *si;
559  MSIDATABASE *patch_db;
560  UINT r;
561 
562  r = MSI_OpenDatabaseW( patch, MSIDBOPEN_READONLY, &patch_db );
563  if (r != ERROR_SUCCESS)
564  {
565  WARN("failed to open patch file %s\n", debugstr_w(patch));
566  return r;
567  }
568 
569  r = msi_get_suminfo( patch_db->storage, 0, &si );
570  if (r != ERROR_SUCCESS)
571  {
572  msiobj_release( &patch_db->hdr );
573  return ERROR_FUNCTION_FAILED;
574  }
575 
576  r = msi_check_patch_applicable( package, si );
577  if (r != ERROR_SUCCESS)
578  TRACE("patch not applicable\n");
579 
580  msiobj_release( &patch_db->hdr );
581  msiobj_release( &si->hdr );
582  return r;
583 }
#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:149
#define WARN(fmt,...)
Definition: debug.h:111
UINT msi_check_patch_applicable(MSIPACKAGE *package, MSISUMMARYINFO *si) DECLSPEC_HIDDEN
Definition: patch.c:290
#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:463
int msiobj_release(MSIOBJECTHDR *info)
Definition: handle.c:242
unsigned int UINT
Definition: ndis.h:50
IStorage * storage
Definition: msipriv.h:98
MSIOBJECTHDR hdr
Definition: msipriv.h:97

Referenced by determine_patch_sequence().

◆ MSI_ApplicablePatchXML()

static UINT MSI_ApplicablePatchXML ( MSIPACKAGE package,
IXMLDOMDocument desc 
)
static

Definition at line 586 of file msi.c.

587 {
588  static const WCHAR queryW[] = {'M','s','i','P','a','t','c','h','/',
589  'T','a','r','g','e','t','P','r','o','d','u','c','t','/',
590  'T','a','r','g','e','t','P','r','o','d','u','c','t','C','o','d','e',0};
593  LPWSTR product_code;
594  IXMLDOMNode *node;
595  HRESULT hr;
596  BSTR s;
597 
598  product_code = msi_dup_property( package->db, szProductCode );
599  if (!product_code)
600  {
601  /* FIXME: the property ProductCode should be written into the DB somewhere */
602  ERR("no product code to check\n");
603  return ERROR_SUCCESS;
604  }
605 
606  s = SysAllocString(queryW);
607  hr = IXMLDOMDocument_selectNodes( desc, s, &list );
608  SysFreeString(s);
609  if (hr != S_OK)
611 
612  while (IXMLDOMNodeList_nextNode( list, &node ) == S_OK && r != ERROR_SUCCESS)
613  {
614  hr = IXMLDOMNode_get_text( node, &s );
615  IXMLDOMNode_Release( node );
616  if (hr == S_OK)
617  {
618  if (!strcmpW( s, product_code )) r = ERROR_SUCCESS;
619  SysFreeString( s );
620  }
621  }
622  IXMLDOMNodeList_Release( list );
623 
624  if (r != ERROR_SUCCESS)
625  TRACE("patch not applicable\n");
626 
627  msi_free( product_code );
628  return r;
629 }
#define ERROR_SUCCESS
Definition: deptool.c:10
HRESULT hr
Definition: shlfolder.c:183
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
OLECHAR * BSTR
Definition: compat.h:1927
struct node node
#define ERROR_FUNCTION_FAILED
Definition: winerror.h:985
const struct builtin_class_descr * desc
Definition: regcontrol.c:48
BSTR WINAPI SysAllocString(LPCOLESTR str)
Definition: oleaut.c:241
#define TRACE(s)
Definition: solgame.cpp:4
#define ERROR_INVALID_PATCH_XML
Definition: winerror.h:1008
static const WCHAR szProductCode[]
Definition: msipriv.h:1127
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
MSIDATABASE * db
Definition: msipriv.h:386
GLdouble s
Definition: gl.h:2039
Definition: _list.h:228
#define ERR(fmt,...)
Definition: debug.h:109
#define S_OK
Definition: intsafe.h:59
#define list
Definition: rosglue.h:35
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
Definition: oleaut.c:274
unsigned int UINT
Definition: ndis.h:50
static BOOL msi_free(void *mem)
Definition: msipriv.h:1227
WINE_UNICODE_INLINE int strcmpW(const WCHAR *str1, const WCHAR *str2)
Definition: unicode.h:229
WCHAR * LPWSTR
Definition: xmlstorage.h:184
Definition: dlist.c:348
LPWSTR msi_dup_property(MSIDATABASE *db, LPCWSTR prop) DECLSPEC_HIDDEN
Definition: package.c:2370

Referenced by determine_patch_sequence().

◆ MSI_ApplyPatchW()

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

Definition at line 353 of file msi.c.

354 {
356  DWORD size;
357  LPCWSTR cmd_ptr = szCommandLine;
358  LPWSTR cmd, *codes = NULL;
359  BOOL succeeded = FALSE;
360 
361  static const WCHAR fmt[] = {'%','s',' ','P','A','T','C','H','=','"','%','s','"',0};
362  static const WCHAR empty[] = {0};
363 
364  if (!szPatchPackage || !szPatchPackage[0])
366 
367  if (!szProductCode && (r = get_patch_product_codes( szPatchPackage, &codes )))
368  return r;
369 
370  if (!szCommandLine)
371  cmd_ptr = empty;
372 
373  size = strlenW(cmd_ptr) + strlenW(fmt) + strlenW(szPatchPackage) + 1;
374  cmd = msi_alloc(size * sizeof(WCHAR));
375  if (!cmd)
376  {
377  msi_free(codes);
378  return ERROR_OUTOFMEMORY;
379  }
380  sprintfW(cmd, fmt, cmd_ptr, szPatchPackage);
381 
382  if (szProductCode)
384  else
385  {
386  for (i = 0; codes[i]; i++)
387  {
389  if (r == ERROR_SUCCESS)
390  {
391  TRACE("patch applied\n");
392  succeeded = TRUE;
393  }
394  }
395 
396  if (succeeded)
397  r = ERROR_SUCCESS;
398  }
399 
400  msi_free(cmd);
401  msi_free(codes);
402  return r;
403 }
#define ERROR_INVALID_PARAMETER
Definition: compat.h:91
#define TRUE
Definition: types.h:120
WINE_UNICODE_INLINE unsigned int strlenW(const WCHAR *str)
Definition: unicode.h:212
#define ERROR_SUCCESS
Definition: deptool.c:10
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
Definition: ftp_var.h:139
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
static const WCHAR empty[]
Definition: main.c:49
char * cmd
Definition: vfdcmd.c:85
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
#define ERROR_FUNCTION_FAILED
Definition: winerror.h:985
unsigned int BOOL
Definition: ntddk_ex.h:94
UINT WINAPI MsiConfigureProductExW(LPCWSTR szProduct, int iInstallLevel, INSTALLSTATE eInstallState, LPCWSTR szCommandLine)
Definition: msi.c:833
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
GLsizeiptr size
Definition: glext.h:5919
static const WCHAR szProductCode[]
Definition: msipriv.h:1127
__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:310
#define sprintfW
Definition: unicode.h:58
DWORD size
Definition: msi.c:1488
unsigned int UINT
Definition: ndis.h:50
static BOOL msi_free(void *mem)
Definition: msipriv.h:1227
static void * msi_alloc(size_t len) __WINE_ALLOC_SIZE(1)
Definition: msipriv.h:1204
WCHAR * LPWSTR
Definition: xmlstorage.h:184
Definition: dsound.c:943
#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 2119 of file msi.c.

2120 {
2121  LPCWSTR package;
2122  HKEY hkey;
2123  DWORD sz;
2124  LONG res;
2125  UINT r;
2126 
2127  static const WCHAR local_package[] = {'L','o','c','a','l','P','a','c','k','a','g','e',0};
2128  static const WCHAR managed_local_package[] = {
2129  'M','a','n','a','g','e','d','L','o','c','a','l','P','a','c','k','a','g','e',0
2130  };
2131 
2132  r = MSIREG_OpenInstallProps(prodcode, context, NULL, &hkey, FALSE);
2133  if (r != ERROR_SUCCESS)
2134  return FALSE;
2135 
2137  package = managed_local_package;
2138  else
2139  package = local_package;
2140 
2141  sz = 0;
2142  res = RegQueryValueExW(hkey, package, NULL, NULL, NULL, &sz);
2143  RegCloseKey(hkey);
2144 
2145  return (res == ERROR_SUCCESS);
2146 }
#define ERROR_SUCCESS
Definition: deptool.c:10
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
Definition: http.c:6587
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:830
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
long LONG
Definition: pedump.c:60
smooth NULL
Definition: ftsmooth.c:416
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
Definition: reg.c:4134
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned long DWORD
Definition: ntddk_ex.h:95
unsigned int UINT
Definition: ndis.h:50
GLuint res
Definition: glext.h:9613

Referenced by MsiQueryComponentStateW().

◆ msi_comp_find_prod_key()

static BOOL msi_comp_find_prod_key ( LPCWSTR  prodcode,
MSIINSTALLCONTEXT  context 
)
static

Definition at line 2109 of file msi.c.

2110 {
2111  UINT r;
2112  HKEY hkey = NULL;
2113 
2114  r = MSIREG_OpenProductKey(prodcode, NULL, context, &hkey, FALSE);
2115  RegCloseKey(hkey);
2116  return (r == ERROR_SUCCESS);
2117 }
#define ERROR_SUCCESS
Definition: deptool.c:10
Definition: http.c:6587
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
smooth NULL
Definition: ftsmooth.c:416
UINT MSIREG_OpenProductKey(LPCWSTR szProduct, LPCWSTR szUserSid, MSIINSTALLCONTEXT context, HKEY *key, BOOL create) DECLSPEC_HIDDEN
Definition: registry.c:492
unsigned int UINT
Definition: ndis.h:50

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

2151 {
2152  HKEY hkey;
2153  LONG res;
2154  UINT r;
2155 
2158  else
2159  r = MSIREG_OpenUserDataComponentKey(comp, NULL, &hkey, FALSE);
2160 
2161  if (r != ERROR_SUCCESS)
2162  return r;
2163 
2164  res = RegQueryValueExW( hkey, squashed_pc, NULL, NULL, (BYTE *)val, sz );
2165  if (res != ERROR_SUCCESS)
2166  return res;
2167 
2168  RegCloseKey(hkey);
2169  return res;
2170 }
#define ERROR_SUCCESS
Definition: deptool.c:10
Definition: http.c:6587
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
long LONG
Definition: pedump.c:60
UINT MSIREG_OpenUserDataComponentKey(LPCWSTR szComponent, LPCWSTR szUserSid, HKEY *key, BOOL create) DECLSPEC_HIDDEN
Definition: registry.c:674
smooth NULL
Definition: ftsmooth.c:416
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:4134
static const WCHAR szLocalSid[]
Definition: msipriv.h:1104
unsigned char BYTE
Definition: mem.h:68
unsigned int UINT
Definition: ndis.h:50
GLuint res
Definition: glext.h:9613

Referenced by MsiQueryComponentStateW().

◆ msi_copy_outval()

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

Definition at line 1382 of file msi.c.

1383 {
1384  UINT r = ERROR_SUCCESS;
1385 
1386  if (!val)
1387  return ERROR_UNKNOWN_PROPERTY;
1388 
1389  if (out)
1390  {
1391  if (strlenW(val) >= *size)
1392  {
1393  r = ERROR_MORE_DATA;
1394  if (*size > 0)
1395  *out = '\0';
1396  }
1397  else
1398  lstrcpyW(out, val);
1399  }
1400 
1401  if (size)
1402  *size = lstrlenW(val);
1403 
1404  return r;
1405 }
#define ERROR_UNKNOWN_PROPERTY
Definition: winerror.h:966
WINE_UNICODE_INLINE unsigned int strlenW(const WCHAR *str)
Definition: unicode.h:212
#define ERROR_SUCCESS
Definition: deptool.c:10
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
#define lstrlenW
Definition: compat.h:407
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:406
unsigned int UINT
Definition: ndis.h:50

Referenced by MsiGetProductInfoExW().

◆ msi_get_filehash()

UINT msi_get_filehash ( const WCHAR path,
MSIFILEHASHINFO hash 
)

Definition at line 4090 of file msi.c.

4091 {
4093  void *p;
4094  DWORD length;
4096 
4099  {
4100  WARN("can't open file %u\n", GetLastError());
4101  return ERROR_FILE_NOT_FOUND;
4102  }
4103  if ((length = GetFileSize( handle, NULL )))
4104  {
4106  {
4107  if ((p = MapViewOfFile( mapping, FILE_MAP_READ, 0, 0, length )))
4108  {
4109  MD5_CTX ctx;
4110 
4111  MD5Init( &ctx );
4112  MD5Update( &ctx, p, length );
4113  MD5Final( &ctx );
4114  UnmapViewOfFile( p );
4115 
4116  memcpy( hash->dwData, ctx.digest, sizeof(hash->dwData) );
4117  r = ERROR_SUCCESS;
4118  }
4119  CloseHandle( mapping );
4120  }
4121  }
4122  else
4123  {
4124  /* Empty file -> set hash to 0 */
4125  memset( hash->dwData, 0, sizeof(hash->dwData) );
4126  r = ERROR_SUCCESS;
4127  }
4128 
4129  CloseHandle( handle );
4130  return r;
4131 }
namespace GUID const ADDRINFOEXW ADDRINFOEXW struct timeval OVERLAPPED LPLOOKUPSERVICE_COMPLETION_ROUTINE HANDLE * handle
Definition: sock.c:82
#define CloseHandle
Definition: compat.h:398
#define ERROR_SUCCESS
Definition: deptool.c:10
#define MapViewOfFile
Definition: compat.h:402
VOID WINAPI MD5Init(MD5_CTX *)
Definition: md5.c:45
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
#define WARN(fmt,...)
Definition: debug.h:111
#define INVALID_HANDLE_VALUE
Definition: compat.h:391
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
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:125
#define ERROR_FUNCTION_FAILED
Definition: winerror.h:985
smooth NULL
Definition: ftsmooth.c:416
#define FILE_MAP_READ
Definition: compat.h:427
#define ERROR_FILE_NOT_FOUND
Definition: disk.h:79
#define OPEN_EXISTING
Definition: compat.h:426
unsigned char digest[16]
Definition: msi.c:4083
GLenum GLuint GLenum GLsizei length
Definition: glext.h:5579
#define CreateFileMappingW(a, b, c, d, e, f)
Definition: compat.h:401
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:481
#define FILE_SHARE_DELETE
Definition: nt_native.h:682
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define GENERIC_READ
Definition: compat.h:124
Definition: services.c:325
unsigned int UINT
Definition: ndis.h:50
#define PAGE_READONLY
Definition: compat.h:127
#define CreateFileW
Definition: compat.h:400
Definition: msi.c:4078
GLfloat GLfloat p
Definition: glext.h:8902
#define UnmapViewOfFile
Definition: compat.h:403
Definition: _hash_fun.h:40
#define memset(x, y, z)
Definition: compat.h:39

Referenced by msi_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 2825 of file msi.c.

2828 {
2829  static const WCHAR wininstaller[] =
2830  {'W','i','n','d','o','w','s','I','n','s','t','a','l','l','e','r',0};
2831  WCHAR *path = NULL, squashed_pc[SQUASHED_GUID_SIZE], squashed_comp[SQUASHED_GUID_SIZE];
2832  HKEY hkey;
2834  DWORD version;
2835 
2836  if (!szProduct || !szComponent)
2837  return INSTALLSTATE_INVALIDARG;
2838 
2839  if (lpPathBuf->str.w && !pcchBuf)
2840  return INSTALLSTATE_INVALIDARG;
2841 
2842  if (!squash_guid( szProduct, squashed_pc ) || !squash_guid( szComponent, squashed_comp ))
2843  return INSTALLSTATE_INVALIDARG;
2844 
2845  if (szUserSid && ctx == MSIINSTALLCONTEXT_MACHINE)
2846  return INSTALLSTATE_INVALIDARG;
2847 
2849 
2850  if (open_userdata_comp_key( szComponent, szUserSid, ctx, &hkey ))
2851  {
2852  path = msi_reg_get_val_str( hkey, squashed_pc );
2853  RegCloseKey(hkey);
2854 
2856 
2857  if ((!MSIREG_OpenInstallProps(szProduct, MSIINSTALLCONTEXT_MACHINE, NULL, &hkey, FALSE) ||
2859  msi_reg_get_val_dword(hkey, wininstaller, &version) &&
2861  {
2862  RegCloseKey(hkey);
2864  }
2865  }
2866 
2867  if (state != INSTALLSTATE_LOCAL &&
2870  {
2871  RegCloseKey(hkey);
2872 
2873  if (open_userdata_comp_key( szComponent, szUserSid, ctx, &hkey ))
2874  {
2875  msi_free(path);
2876  path = msi_reg_get_val_str( hkey, squashed_pc );
2877  RegCloseKey(hkey);
2878 
2880 
2883  }
2884  }
2885 
2886  if (!path)
2887  return INSTALLSTATE_UNKNOWN;
2888 
2889  if (state == INSTALLSTATE_LOCAL && !*path)
2891 
2892  if (msi_strcpy_to_awstring(path, -1, lpPathBuf, pcchBuf) == ERROR_MORE_DATA)
2894 
2895  msi_free(path);
2896  return state;
2897 }
LPWSTR msi_reg_get_val_str(HKEY hkey, LPCWSTR name) DECLSPEC_HIDDEN
Definition: registry.c:394
LPWSTR w
Definition: msipriv.h:720
UINT msi_strcpy_to_awstring(const WCHAR *str, int len, awstring *awbuf, DWORD *sz)
Definition: install.c:181
UINT MSIREG_OpenInstallProps(LPCWSTR szProduct, MSIINSTALLCONTEXT dwContext, LPCWSTR szUserSid, HKEY *key, BOOL create) DECLSPEC_HIDDEN
Definition: registry.c:830
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
DWORD WINAPI GetFileAttributesW(LPCWSTR lpFileName)
Definition: fileinfo.c:802
smooth NULL
Definition: ftsmooth.c:416
static const WCHAR version[]
Definition: asmname.c:64
BOOL msi_reg_get_val_dword(HKEY hkey, LPCWSTR name, DWORD *val) DECLSPEC_HIDDEN
Definition: registry.c:413
UINT MSIREG_OpenProductKey(LPCWSTR szProduct, LPCWSTR szUserSid, MSIINSTALLCONTEXT context, HKEY *key, BOOL create) DECLSPEC_HIDDEN
Definition: registry.c:492
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned long DWORD
Definition: ntddk_ex.h:95
union awstring::@478 str
#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:728
static int state
Definition: maze.c:121
static BOOL open_userdata_comp_key(const WCHAR *comp, const WCHAR *usersid, MSIINSTALLCONTEXT ctx, HKEY *hkey)
Definition: msi.c:2806
#define ERROR_MORE_DATA
Definition: dderror.h:13
int INSTALLSTATE
Definition: msiserver.idl:35
#define SQUASHED_GUID_SIZE
Definition: msipriv.h:711
Definition: services.c:325
static BOOL msi_free(void *mem)
Definition: msipriv.h:1227
static BOOL squash_guid(LPCWSTR in, LPWSTR out)
Definition: msi.c:1578

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

1102 {
1103  static WCHAR empty[] = {0};
1104  static const WCHAR sourcelist[] = {'S','o','u','r','c','e','L','i','s','t',0};
1105  static const WCHAR display_name[] = {'D','i','s','p','l','a','y','N','a','m','e',0};
1106  static const WCHAR display_version[] = {'D','i','s','p','l','a','y','V','e','r','s','i','o','n',0};
1107  static const WCHAR assignment[] = {'A','s','s','i','g','n','m','e','n','t',0};
1110  HKEY prodkey, userdata, source;
1111  WCHAR *val = NULL, squashed_pc[SQUASHED_GUID_SIZE], packagecode[GUID_SIZE];
1112  BOOL badconfig = FALSE;
1113  LONG res;
1114  DWORD type = REG_NONE;
1115 
1116  TRACE("%s %s %p %p\n", debugstr_w(szProduct),
1117  debugstr_w(szAttribute), szValue, pcchValueBuf);
1118 
1119  if ((szValue->str.w && !pcchValueBuf) || !szProduct || !szAttribute)
1120  return ERROR_INVALID_PARAMETER;
1121 
1122  if (!squash_guid( szProduct, squashed_pc ))
1123  return ERROR_INVALID_PARAMETER;
1124 
1125  if ((r = MSIREG_OpenProductKey(szProduct, NULL,
1127  &prodkey, FALSE)) != ERROR_SUCCESS &&
1128  (r = MSIREG_OpenProductKey(szProduct, NULL,
1130  &prodkey, FALSE)) != ERROR_SUCCESS &&
1131  (r = MSIREG_OpenProductKey(szProduct, NULL,
1133  &prodkey, FALSE)) == ERROR_SUCCESS)
1134  {
1136  }
1137 
1154  {
1155  if (!prodkey)
1156  {
1158  goto done;
1159  }
1160  if (MSIREG_OpenInstallProps(szProduct, context, NULL, &userdata, FALSE))
1161  {
1163  goto done;
1164  }
1165 
1167  szAttribute = display_name;
1169  szAttribute = display_version;
1170 
1171  val = reg_get_value(userdata, szAttribute, &type);
1172  if (!val)
1173  val = empty;
1174  RegCloseKey(userdata);
1175  }
1186  {
1187  if (!prodkey)
1188  {
1190  goto done;
1191  }
1192 
1194  szAttribute = assignment;
1195 
1197  {
1198  res = RegOpenKeyW(prodkey, sourcelist, &source);
1199  if (res != ERROR_SUCCESS)
1200  {
1202  goto done;
1203  }
1204 
1206  if (!val)
1207  val = empty;
1208 
1210  }
1211  else
1212  {
1213  val = reg_get_value(prodkey, szAttribute, &type);
1214  if (!val)
1215  val = empty;
1216  }
1217 
1218  if (val != empty && type != REG_DWORD &&
1220  {
1221  if (lstrlenW( val ) != SQUASHED_GUID_SIZE - 1)
1222  badconfig = TRUE;
1223  else
1224  {
1225  unsquash_guid(val, packagecode);
1226  msi_free(val);
1227  val = strdupW(packagecode);
1228  }
1229  }
1230  }
1231 
1232  if (!val)
1233  {
1235  goto done;
1236  }
1237 
1238  if (pcchValueBuf)
1239  {
1240  int len = strlenW( val );
1241 
1242  /* If szBuffer (szValue->str) is NULL, there's no need to copy the value
1243  * out. Also, *pcchValueBuf may be uninitialized in this case, so we
1244  * can't rely on its value.
1245  */
1246  if (szValue->str.a || szValue->str.w)
1247  {
1248  DWORD size = *pcchValueBuf;
1249  if (len < size)
1250  r = msi_strcpy_to_awstring( val, len, szValue, &size );
1251  else
1252  r = ERROR_MORE_DATA;
1253  }
1254 
1255  if (!badconfig)
1256  *pcchValueBuf = len;
1257  }
1258 
1259  if (badconfig)
1261 
1262  if (val != empty)
1263  msi_free(val);
1264 
1265 done:
1266  RegCloseKey(prodkey);
1267  return r;
1268 }
static const WCHAR INSTALLPROPERTY_URLUPDATEINFOW[]
Definition: msi.h:351
#define ERROR_INVALID_PARAMETER
Definition: compat.h:91
static const WCHAR INSTALLPROPERTY_PACKAGENAMEW[]
Definition: msi.h:265
#define ERROR_UNKNOWN_PROPERTY
Definition: winerror.h:966
#define TRUE
Definition: types.h:120
static const WCHAR INSTALLPROPERTY_HELPLINKW[]
Definition: msi.h:319
WINE_UNICODE_INLINE unsigned int strlenW(const WCHAR *str)
Definition: unicode.h:212
#define ERROR_SUCCESS
Definition: deptool.c:10
enum tagMSIINSTALLCONTEXT MSIINSTALLCONTEXT
Definition: action.c:41
static const WCHAR INSTALLPROPERTY_INSTALLDATEW[]
Definition: msi.h:335
Definition: http.c:6587
static WCHAR * strdupW(const WCHAR *src)
Definition: main.c:92
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
static const WCHAR empty[]
Definition: main.c:49
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
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
LPWSTR w
Definition: msipriv.h:720
static const WCHAR szAttribute[]
Definition: domdoc.c:1179
#define lstrlenW
Definition: compat.h:407
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:181
UINT MSIREG_OpenInstallProps(LPCWSTR szProduct, MSIINSTALLCONTEXT dwContext, LPCWSTR szUserSid, HKEY *key, BOOL create) DECLSPEC_HIDDEN
Definition: registry.c:830
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
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:3311
#define debugstr_w
Definition: kernel32.h:32
smooth NULL
Definition: ftsmooth.c:416
LPSTR a
Definition: msipriv.h:719
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:492
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:1078
#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
union awstring::@478 str
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
static const WCHAR INSTALLPROPERTY_PRODUCTNAMEW[]
Definition: msi.h:277
static const WCHAR INSTALLPROPERTY_INSTALLLOCATIONW[]
Definition: msi.h:327
#define SQUASHED_GUID_SIZE
Definition: msipriv.h:711
GLsizei GLsizei GLchar * source
Definition: glext.h:6048
unsigned int UINT
Definition: ndis.h:50
static const WCHAR INSTALLPROPERTY_INSTALLEDPRODUCTNAMEW[]
Definition: msi.h:311
static BOOL msi_free(void *mem)
Definition: msipriv.h:1227
WINE_UNICODE_INLINE int strcmpW(const WCHAR *str1, const WCHAR *str2)
Definition: unicode.h:229
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:192
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 GUID_SIZE
Definition: msipriv.h:710
#define REG_DWORD
Definition: sdbapi.c:596
static BOOL squash_guid(LPCWSTR in, LPWSTR out)
Definition: msi.c:1578
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 3573 of file msi.c.

3577 {
3578  WCHAR *user, *org, *serial, squashed_pc[SQUASHED_GUID_SIZE];
3580  HKEY hkey, props;
3581  LPCWSTR orgptr;
3582  UINT r;
3583 
3584  TRACE("%s %p %p %p %p %p %p\n", debugstr_w(szProduct), lpUserNameBuf,
3585  pcchUserNameBuf, lpOrgNameBuf, pcchOrgNameBuf, lpSerialBuf,
3586  pcchSerialBuf);
3587 
3588  if (!szProduct || !squash_guid( szProduct, squashed_pc ))
3589  return USERINFOSTATE_INVALIDARG;
3590 
3592  &hkey, FALSE) != ERROR_SUCCESS &&
3594  &hkey, FALSE) != ERROR_SUCCESS &&
3596  &hkey, FALSE) != ERROR_SUCCESS)
3597  {
3598  return USERINFOSTATE_UNKNOWN;
3599  }
3600 
3602  NULL, &props, FALSE) != ERROR_SUCCESS &&
3604  NULL, &props, FALSE) != ERROR_SUCCESS)
3605  {
3606  RegCloseKey(hkey);
3607  return USERINFOSTATE_ABSENT;
3608  }
3609 
3614 
3615  RegCloseKey(hkey);
3616  RegCloseKey(props);
3617 
3618  if (user && serial)
3620 
3621  if (pcchUserNameBuf)
3622  {
3623  if (lpUserNameBuf && !user)
3624  {
3625  (*pcchUserNameBuf)--;
3626  goto done;
3627  }
3628 
3629  r = msi_strcpy_to_awstring(user, -1, lpUserNameBuf, pcchUserNameBuf);
3630  if (r == ERROR_MORE_DATA)
3631  {
3633  goto done;
3634  }
3635  }
3636 
3637  if (pcchOrgNameBuf)
3638  {
3639  orgptr = org;
3640  if (!orgptr) orgptr = szEmpty;
3641 
3642  r = msi_strcpy_to_awstring(orgptr, -1, lpOrgNameBuf, pcchOrgNameBuf);
3643  if (r == ERROR_MORE_DATA)
3644  {
3646  goto done;
3647  }
3648  }
3649 
3650  if (pcchSerialBuf)
3651  {
3652  if (!serial)
3653  {
3654  (*pcchSerialBuf)--;
3655  goto done;
3656  }
3657 
3658  r = msi_strcpy_to_awstring(serial, -1, lpSerialBuf, pcchSerialBuf);
3659  if (r == ERROR_MORE_DATA)
3661  }
3662 
3663 done:
3664  msi_free(user);
3665  msi_free(org);
3666  msi_free(serial);
3667 
3668  return state;
3669 }
#define ERROR_SUCCESS
Definition: deptool.c:10
LPWSTR msi_reg_get_val_str(HKEY hkey, LPCWSTR name) DECLSPEC_HIDDEN
Definition: registry.c:394
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
static const WCHAR INSTALLPROPERTY_REGCOMPANYW[]
Definition: msi.h:367
enum tagUSERINFOSTATE USERINFOSTATE
UINT msi_strcpy_to_awstring(const WCHAR *str, int len, awstring *awbuf, DWORD *sz)
Definition: install.c:181
UINT MSIREG_OpenInstallProps(LPCWSTR szProduct, MSIINSTALLCONTEXT dwContext, LPCWSTR szUserSid, HKEY *key, BOOL create) DECLSPEC_HIDDEN
Definition: registry.c:830
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
static char org[]
Definition: encode.c:7456
#define debugstr_w
Definition: kernel32.h:32
smooth NULL
Definition: ftsmooth.c:416
UINT MSIREG_OpenProductKey(LPCWSTR szProduct, LPCWSTR szUserSid, MSIINSTALLCONTEXT context, HKEY *key, BOOL create) DECLSPEC_HIDDEN
Definition: registry.c:492
static const WCHAR szEmpty[]
Definition: provider.c:47
#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
#define SQUASHED_GUID_SIZE
Definition: msipriv.h:711
unsigned int UINT
Definition: ndis.h:50
static BOOL msi_free(void *mem)
Definition: msipriv.h:1227
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:1578

Referenced by MsiGetUserInfoA(), and MsiGetUserInfoW().

◆ msi_locate_product()

UINT msi_locate_product ( LPCWSTR  szProduct,
MSIINSTALLCONTEXT context 
)

Definition at line 55 of file msi.c.

56 {
57  HKEY hkey = NULL;
58 
60  if (!szProduct) return ERROR_UNKNOWN_PRODUCT;
61 
63  &hkey, FALSE) == ERROR_SUCCESS)
66  &hkey, FALSE) == ERROR_SUCCESS)
68  else if (MSIREG_OpenProductKey(szProduct, NULL,
70  &hkey, FALSE) == ERROR_SUCCESS)
72 
73  RegCloseKey(hkey);
74 
76  return ERROR_UNKNOWN_PRODUCT;
77 
78  return ERROR_SUCCESS;
79 }
#define ERROR_SUCCESS
Definition: deptool.c:10
Definition: http.c:6587
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
smooth NULL
Definition: ftsmooth.c:416
UINT MSIREG_OpenProductKey(LPCWSTR szProduct, LPCWSTR szUserSid, MSIINSTALLCONTEXT context, HKEY *key, BOOL create) DECLSPEC_HIDDEN
Definition: registry.c:492
#define ERROR_UNKNOWN_PRODUCT
Definition: winerror.h:963

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

◆ MSI_OpenProductW()

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

Definition at line 102 of file msi.c.

103 {
104  UINT r;
105  HKEY props;
106  LPWSTR path;
108 
109  static const WCHAR managed[] = {
110  'M','a','n','a','g','e','d','L','o','c','a','l','P','a','c','k','a','g','e',0};
111  static const WCHAR local[] = {'L','o','c','a','l','P','a','c','k','a','g','e',0};
112 
113  TRACE("%s %p\n", debugstr_w(szProduct), package);
114 
115  r = msi_locate_product(szProduct, &context);
116  if (r != ERROR_SUCCESS)
117  return r;
118 
119  r = MSIREG_OpenInstallProps(szProduct, context, NULL, &props, FALSE);
120  if (r != ERROR_SUCCESS)
121  return ERROR_UNKNOWN_PRODUCT;
122 
124  path = msi_reg_get_val_str(props, managed);
125  else
127 
129 
131  goto done;
132 
133  if (PathIsRelativeW(path))
134  {
136  goto done;
137  }
138 
139  r = MSI_OpenPackageW(path, package);
140 
141 done:
143  msi_free(path);
144  return r;
145 }
BOOL WINAPI PathIsRelativeW(LPCWSTR lpszPath)
Definition: path.c:1558
#define ERROR_SUCCESS
Definition: deptool.c:10
enum tagMSIINSTALLCONTEXT MSIINSTALLCONTEXT
Definition: action.c:41
LPWSTR msi_reg_get_val_str(HKEY hkey, LPCWSTR name) DECLSPEC_HIDDEN
Definition: registry.c:394
Definition: http.c:6587
GLsizei const GLchar ** path
Definition: glext.h:7234
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:830
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
DWORD WINAPI GetFileAttributesW(LPCWSTR lpFileName)
Definition: fileinfo.c:802
#define debugstr_w
Definition: kernel32.h:32
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define ERROR_UNKNOWN_PRODUCT
Definition: winerror.h:963
UINT msi_locate_product(LPCWSTR szProduct, MSIINSTALLCONTEXT *context)
Definition: msi.c:55
#define INVALID_FILE_ATTRIBUTES
Definition: vfdcmd.c:23
UINT MSI_OpenPackageW(LPCWSTR szPackage, MSIPACKAGE **pPackage) DECLSPEC_HIDDEN
Definition: package.c:1441
#define local
Definition: zutil.h:30
Definition: services.c:325
unsigned int UINT
Definition: ndis.h:50
static BOOL msi_free(void *mem)
Definition: msipriv.h:1227
static const WCHAR props[]
Definition: wbemdisp.c:288
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#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 3429 of file msi.c.

3433 {
3435  WCHAR *desc;
3436  HKEY hkey;
3437  DWORD size;
3438  UINT ret;
3440 
3441  if (MSIREG_OpenUserComponentsKey( szComponent, &hkey, FALSE )) return ERROR_UNKNOWN_COMPONENT;
3442 
3443  desc = reg_get_multisz( hkey, szQualifier );
3444  RegCloseKey(hkey);
3445  if (!desc) return ERROR_INDEX_ABSENT;
3446 
3447  /* FIXME: handle multiple descriptors */
3448  ret = MsiDecomposeDescriptorW( desc, product, feature, comp, &size );
3449  msi_free( desc );
3450  if (ret != ERROR_SUCCESS) return ret;
3451 
3452  if (!szProduct) szProduct = product;
3453  if (!comp[0])
3454  {
3455  MSIINSTALLCONTEXT ctx;
3456  WCHAR *components;
3457  GUID guid;
3458 
3459  /* use the first component of the feature if the descriptor component is empty */
3460  if ((ret = msi_locate_product( szProduct, &ctx ))) return ret;
3461  if ((ret = MSIREG_OpenUserDataFeaturesKey( szProduct, NULL, ctx, &hkey, FALSE )))
3462  {
3463  return ERROR_FILE_NOT_FOUND;
3464  }
3465  components = reg_get_sz( hkey, feature );
3466  RegCloseKey( hkey );
3467  if (!components) return ERROR_FILE_NOT_FOUND;
3468 
3470  {
3471  msi_free( components );
3472  return ERROR_FILE_NOT_FOUND;
3473  }
3474  msi_free( components );
3475  StringFromGUID2( &guid, comp, sizeof(comp)/sizeof(comp[0]) );
3476  }
3477 
3478  state = MSI_GetComponentPath( szProduct, comp, szAllSid, MSIINSTALLCONTEXT_ALL, lpPathBuf, pcchPathBuf );
3479 
3482  return ERROR_SUCCESS;
3483 }
INTERNETFEATURELIST feature
Definition: misc.c:1689
static INSTALLSTATE MSI_GetComponentPath(const WCHAR *szProduct, const WCHAR *szComponent, const WCHAR *szUserSid, MSIINSTALLCONTEXT ctx, awstring *lpPathBuf, DWORD *pcchBuf)
Definition: msi.c:2825
WINE_UNICODE_INLINE unsigned int strlenW(const WCHAR *str)
Definition: unicode.h:212
#define ERROR_SUCCESS
Definition: deptool.c:10
enum tagMSIINSTALLCONTEXT MSIINSTALLCONTEXT
Definition: action.c:41
BOOL decode_base85_guid(LPCWSTR, GUID *) DECLSPEC_HIDDEN
Definition: registry.c:283
static const WCHAR szAllSid[]
Definition: msipriv.h:1105
#define ERROR_INDEX_ABSENT
Definition: winerror.h:969
static WCHAR * reg_get_sz(HKEY hkey, const WCHAR *name)
Definition: msi.c:3415
UINT MSIREG_OpenUserComponentsKey(LPCWSTR szComponent, HKEY *key, BOOL create) DECLSPEC_HIDDEN
Definition: registry.c:653
const GUID * guid
UINT MSIREG_OpenUserDataFeaturesKey(LPCWSTR szProduct, LPCWSTR szUserSid, MSIINSTALLCONTEXT context, HKEY *key, BOOL create) DECLSPEC_HIDDEN
Definition: registry.c:622
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
#define MAX_FEATURE_CHARS
Definition: msi.h:257
static WCHAR * reg_get_multisz(HKEY hkey, const WCHAR *name)
Definition: msi.c:3406
const struct builtin_class_descr * desc
Definition: regcontrol.c:48
smooth NULL
Definition: ftsmooth.c:416
UINT WINAPI MsiDecomposeDescriptorW(LPCWSTR, LPWSTR, LPWSTR, LPWSTR, LPDWORD)
Definition: registry.c:1055
#define ERROR_FILE_NOT_FOUND
Definition: disk.h:79
#define BASE85_SIZE
Definition: msi.c:3424
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:2343
UINT msi_locate_product(LPCWSTR szProduct, MSIINSTALLCONTEXT *context)
Definition: msi.c:55
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
#define ERROR_MORE_DATA
Definition: dderror.h:13
int INSTALLSTATE
Definition: msiserver.idl:35
DWORD size
Definition: msi.c:1488
#define ERROR_UNKNOWN_COMPONENT
Definition: winerror.h:965
unsigned int UINT
Definition: ndis.h:50
static BOOL msi_free(void *mem)
Definition: msipriv.h:1227

Referenced by MsiProvideQualifiedComponentExA(), and MsiProvideQualifiedComponentExW().

◆ MsiAdvertiseProductA()

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

Definition at line 171 of file msi.c.

173 {
174  FIXME("%s %s %s %08x\n",debugstr_a(szPackagePath),
175  debugstr_a(szScriptfilePath), debugstr_a(szTransforms), lgidLanguage);
177 }
#define FIXME(fmt,...)
Definition: debug.h:110
#define debugstr_a
Definition: kernel32.h:31
#define ERROR_CALL_NOT_IMPLEMENTED
Definition: compat.h:92

◆ MsiAdvertiseProductExA()

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

Definition at line 187 of file msi.c.

189 {
190  FIXME("%s %s %s %08x %08x %08x\n", debugstr_a(szPackagePath),
191  debugstr_a(szScriptfilePath), debugstr_a(szTransforms),
192  lgidLanguage, dwPlatform, dwOptions);
194 }
DWORD dwOptions
Definition: solitaire.cpp:23
#define FIXME(fmt,...)
Definition: debug.h:110
#define debugstr_a
Definition: kernel32.h:31
#define ERROR_CALL_NOT_IMPLEMENTED
Definition: compat.h:92

◆ MsiAdvertiseProductExW()

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

Definition at line 196 of file msi.c.

198 {
199  FIXME("%s %s %s %08x %08x %08x\n", debugstr_w(szPackagePath),
200  debugstr_w(szScriptfilePath), debugstr_w(szTransforms),
201  lgidLanguage, dwPlatform, dwOptions);
203 }
DWORD dwOptions
Definition: solitaire.cpp:23
#define debugstr_w
Definition: kernel32.h:32
#define FIXME(fmt,...)
Definition: debug.h:110
#define ERROR_CALL_NOT_IMPLEMENTED
Definition: compat.h:92

◆ MsiAdvertiseProductW()

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

Definition at line 179 of file msi.c.

181 {
182  FIXME("%s %s %s %08x\n",debugstr_w(szPackagePath),
183  debugstr_w(szScriptfilePath), debugstr_w(szTransforms), lgidLanguage);
185 }
#define debugstr_w
Definition: kernel32.h:32
#define FIXME(fmt,...)
Definition: debug.h:110
#define ERROR_CALL_NOT_IMPLEMENTED
Definition: compat.h:92

Referenced by WinMain().

◆ MsiAdvertiseScriptA()

UINT WINAPI MsiAdvertiseScriptA ( LPCSTR  szScriptFile,
DWORD  dwFlags,
PHKEY  phRegData,
BOOL  fRemoveItems 
)

Definition at line 4191 of file msi.c.

4193 {
4194  FIXME("%s %08x %p %d\n",
4195  debugstr_a( szScriptFile ), dwFlags, phRegData, fRemoveItems );
4197 }
#define FIXME(fmt,...)
Definition: debug.h:110
#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:92

◆ MsiAdvertiseScriptW()

UINT WINAPI MsiAdvertiseScriptW ( LPCWSTR  szScriptFile,
DWORD  dwFlags,
PHKEY  phRegData,
BOOL  fRemoveItems 
)

Definition at line 4180 of file msi.c.

4182 {
4183  FIXME("%s %08x %p %d\n",
4184  debugstr_w( szScriptFile ), dwFlags, phRegData, fRemoveItems );
4186 }
#define debugstr_w
Definition: kernel32.h:32
#define FIXME(fmt,...)
Definition: debug.h:110
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
#define ERROR_CALL_NOT_IMPLEMENTED
Definition: compat.h:92

◆ MsiApplyMultiplePatchesA()

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

Definition at line 421 of file msi.c.

423 {
424  LPWSTR patch_packages = NULL;
425  LPWSTR product_code = NULL;
426  LPWSTR properties_list = NULL;
428 
429  TRACE("%s %s %s\n", debugstr_a(szPatchPackages), debugstr_a(szProductCode),
430  debugstr_a(szPropertiesList));
431 
432  if (!szPatchPackages || !szPatchPackages[0])
434 
435  if (!(patch_packages = strdupAtoW(szPatchPackages)))
436  return ERROR_OUTOFMEMORY;
437 
438  if (szProductCode && !(product_code = strdupAtoW(szProductCode)))
439  goto done;
440 
441  if (szPropertiesList && !(properties_list = strdupAtoW(szPropertiesList)))
442  goto done;
443 
444  r = MsiApplyMultiplePatchesW(patch_packages, product_code, properties_list);
445 
446 done:
447  msi_free(patch_packages);
448  msi_free(product_code);
449  msi_free(properties_list);
450 
451  return r;
452 }
#define ERROR_INVALID_PARAMETER
Definition: compat.h:91
UINT WINAPI MsiApplyMultiplePatchesW(LPCWSTR szPatchPackages, LPCWSTR szProductCode, LPCWSTR szPropertiesList)
Definition: msi.c:454
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
static const WCHAR szProductCode[]
Definition: msipriv.h:1127
#define debugstr_a
Definition: kernel32.h:31
unsigned int UINT
Definition: ndis.h:50
static BOOL msi_free(void *mem)
Definition: msipriv.h:1227
WCHAR * LPWSTR
Definition: xmlstorage.h:184
static WCHAR * strdupAtoW(const char *str)
Definition: main.c:67
#define ERROR_OUTOFMEMORY
Definition: deptool.c:13

Referenced by test_MsiApplyMultiplePatches().

◆ MsiApplyMultiplePatchesW()

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

Definition at line 454 of file msi.c.

456 {
457  UINT r = ERROR_SUCCESS;
458  LPCWSTR beg, end;
459 
460  TRACE("%s %s %s\n", debugstr_w(szPatchPackages), debugstr_w(szProductCode),
461  debugstr_w(szPropertiesList));
462 
463  if (!szPatchPackages || !szPatchPackages[0])
465 
466  beg = end = szPatchPackages;
467  while (*beg)
468  {
469  DWORD len;
470  LPWSTR patch;
471 
472  while (*beg == ' ') beg++;
473  while (*end && *end != ';') end++;
474 
475  len = end - beg;
476  while (len && beg[len - 1] == ' ') len--;
477 
478  if (!len) return ERROR_INVALID_NAME;
479 
480  patch = msi_alloc((len + 1) * sizeof(WCHAR));
481  if (!patch)
482  return ERROR_OUTOFMEMORY;
483 
484  memcpy(patch, beg, len * sizeof(WCHAR));
485  patch[len] = '\0';
486 
487  r = MSI_ApplyPatchW(patch, szProductCode, szPropertiesList);
488  msi_free(patch);
489 
490  if (r != ERROR_SUCCESS || !*end)
491  break;
492 
493  beg = ++end;
494  }
495  return r;
496 }
#define ERROR_INVALID_PARAMETER
Definition: compat.h:91
#define ERROR_SUCCESS
Definition: deptool.c:10
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
GLuint GLuint end
Definition: gl.h:1545
#define debugstr_w
Definition: kernel32.h:32
#define TRACE(s)
Definition: solgame.cpp:4
static const WCHAR szProductCode[]
Definition: msipriv.h:1127
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned long DWORD
Definition: ntddk_ex.h:95
static UINT MSI_ApplyPatchW(LPCWSTR szPatchPackage, LPCWSTR szProductCode, LPCWSTR szCommandLine)
Definition: msi.c:353
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
GLenum GLsizei len
Definition: glext.h:6722
unsigned int UINT
Definition: ndis.h:50
static BOOL msi_free(void *mem)
Definition: msipriv.h:1227
static void * msi_alloc(size_t len) __WINE_ALLOC_SIZE(1)
Definition: msipriv.h:1204
#define ERROR_INVALID_NAME
Definition: compat.h:93
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 280 of file msi.c.

282 {
283  LPWSTR patch_package = NULL;
284  LPWSTR install_package = NULL;
285  LPWSTR command_line = NULL;
287 
288  TRACE("%s %s %d %s\n", debugstr_a(szPatchPackage), debugstr_a(szInstallPackage),
289  eInstallType, debugstr_a(szCommandLine));
290 
291  if (szPatchPackage && !(patch_package = strdupAtoW(szPatchPackage)))
292  goto done;
293 
294  if (szInstallPackage && !(install_package = strdupAtoW(szInstallPackage)))
295  goto done;
296 
297  if (szCommandLine && !(command_line = strdupAtoW(szCommandLine)))
298  goto done;
299 
300  r = MsiApplyPatchW(patch_package, install_package, eInstallType, command_line);
301 
302 done:
303  msi_free(patch_package);
304  msi_free(install_package);
305  msi_free(command_line);
306 
307  return r;
308 }
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
UINT WINAPI MsiApplyPatchW(LPCWSTR szPatchPackage, LPCWSTR szInstallPackage, INSTALLTYPE eInstallType, LPCWSTR szCommandLine)
Definition: msi.c:405
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
#define debugstr_a
Definition: kernel32.h:31
unsigned int UINT
Definition: ndis.h:50
static BOOL msi_free(void *mem)
Definition: msipriv.h:1227
WCHAR * LPWSTR
Definition: xmlstorage.h:184
static WCHAR * strdupAtoW(const char *str)
Definition: main.c:67
#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 405 of file msi.c.

407 {
408  TRACE("%s %s %d %s\n", debugstr_w(szPatchPackage), debugstr_w(szInstallPackage),
409  eInstallType, debugstr_w(szCommandLine));
410 
411  if (szInstallPackage || eInstallType == INSTALLTYPE_NETWORK_IMAGE ||
412  eInstallType == INSTALLTYPE_SINGLE_INSTANCE)
413  {
414  FIXME("Only reading target products from patch\n");
416  }
417 
418  return MSI_ApplyPatchW(szPatchPackage, NULL, szCommandLine);
419 }
#define debugstr_w
Definition: kernel32.h:32
#define FIXME(fmt,...)
Definition: debug.h:110
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
static UINT MSI_ApplyPatchW(LPCWSTR szPatchPackage, LPCWSTR szProductCode, LPCWSTR szCommandLine)
Definition: msi.c:353
#define ERROR_CALL_NOT_IMPLEMENTED
Definition: compat.h:92

Referenced by MsiApplyPatchA(), and WinMain().

◆ MsiBeginTransactionA()

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

Definition at line 4363 of file msi.c.

4364 {
4365  WCHAR *nameW;
4366  UINT r;
4367 
4368  FIXME("%s %u %p %p\n", debugstr_a(name), attrs, id, event);
4369 
4370  nameW = strdupAtoW( name );
4371  if (name && !nameW)
4372  return ERROR_OUTOFMEMORY;
4373 
4374  r = MsiBeginTransactionW( nameW, attrs, id, event );
4375  msi_free( nameW );
4376  return r;
4377 }
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
#define FIXME(fmt,...)
Definition: debug.h:110
static const WCHAR nameW[]
Definition: main.c:46
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define debugstr_a
Definition: kernel32.h:31
struct _cl_event * event
Definition: glext.h:7739
unsigned int UINT
Definition: ndis.h:50
static BOOL msi_free(void *mem)
Definition: msipriv.h:1227
Definition: name.c:36
UINT WINAPI MsiBeginTransactionW(LPCWSTR name, DWORD attrs, MSIHANDLE *id, HANDLE *event)
Definition: msi.c:4382
static WCHAR * strdupAtoW(const char *str)
Definition: main.c:67
#define ERROR_OUTOFMEMORY
Definition: deptool.c:13

◆ MsiBeginTransactionW()

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

Definition at line 4382 of file msi.c.

4383 {
4384  FIXME("%s %u %p %p\n", debugstr_w(name), attrs, id, event);
4385 
4386  *id = (MSIHANDLE)0xdeadbeef;
4387  *event = (HANDLE)0xdeadbeef;
4388 
4389  return ERROR_SUCCESS;
4390 }
#define ERROR_SUCCESS
Definition: deptool.c:10
unsigned long MSIHANDLE
Definition: msiserver.idl:25
#define debugstr_w
Definition: kernel32.h:32
#define FIXME(fmt,...)
Definition: debug.h:110
PVOID HANDLE
Definition: typedefs.h:71
struct _cl_event * event
Definition: glext.h:7739
Definition: name.c:36

Referenced by MsiBeginTransactionA().

◆ MsiCollectUserInfoA()

UINT WINAPI MsiCollectUserInfoA ( LPCSTR  szProduct)

Definition at line 3758 of file msi.c.

3759 {
3760  MSIHANDLE handle;
3761  UINT rc;
3762  MSIPACKAGE *package;
3763  static const WCHAR szFirstRun[] = {'F','i','r','s','t','R','u','n',0};
3764 
3765  TRACE("(%s)\n",debugstr_a(szProduct));
3766 
3767  rc = MsiOpenProductA(szProduct,&handle);
3768  if (rc != ERROR_SUCCESS)
3769  return ERROR_INVALID_PARAMETER;
3770 
3771  /* MsiCollectUserInfo cannot be called from a custom action. */
3772  package = msihandle2msiinfo(handle, MSIHANDLETYPE_PACKAGE);
3773  if (!package)
3775 
3776  rc = ACTION_PerformAction(package, szFirstRun, SCRIPT_NONE);
3777  msiobj_release( &package->hdr );
3778 
3780 
3781  return rc;
3782 }
#define ERROR_INVALID_PARAMETER
Definition: compat.h:91
namespace GUID const ADDRINFOEXW ADDRINFOEXW struct timeval OVERLAPPED LPLOOKUPSERVICE_COMPLETION_ROUTINE HANDLE * handle
Definition: sock.c:82
#define ERROR_SUCCESS
Definition: deptool.c:10
MSIOBJECTHDR hdr
Definition: msipriv.h:385
unsigned long MSIHANDLE
Definition: msiserver.idl:25
UINT ACTION_PerformAction(MSIPACKAGE *package, const WCHAR *action, UINT script)
Definition: action.c:7913
UINT WINAPI MsiOpenProductA(LPCSTR szProduct, MSIHANDLE *phProduct)
Definition: msi.c:81
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define debugstr_a
Definition: kernel32.h:31
int msiobj_release(MSIOBJECTHDR *info)
Definition: handle.c:242
UINT WINAPI MsiCloseHandle(MSIHANDLE handle)
Definition: handle.c:270
unsigned int UINT
Definition: ndis.h:50
#define ERROR_CALL_NOT_IMPLEMENTED
Definition: compat.h:92

◆ MsiCollectUserInfoW()

UINT WINAPI MsiCollectUserInfoW ( LPCWSTR  szProduct)

Definition at line 3732 of file msi.c.

3733 {
3734  MSIHANDLE handle;
3735  UINT rc;
3736  MSIPACKAGE *package;
3737  static const WCHAR szFirstRun[] = {'F','i','r','s','t','R','u','n',0};
3738 
3739  TRACE("(%s)\n",debugstr_w(szProduct));
3740 
3741  rc = MsiOpenProductW(szProduct,&handle);
3742  if (rc != ERROR_SUCCESS)
3743  return ERROR_INVALID_PARAMETER;
3744 
3745  /* MsiCollectUserInfo cannot be called from a custom action. */
3746  package = msihandle2msiinfo(handle, MSIHANDLETYPE_PACKAGE);
3747  if (!package)
3749 
3750  rc = ACTION_PerformAction(package, szFirstRun, SCRIPT_NONE);
3751  msiobj_release( &package->hdr );
3752 
3754 
3755  return rc;
3756 }
#define ERROR_INVALID_PARAMETER
Definition: compat.h:91
namespace GUID const ADDRINFOEXW ADDRINFOEXW struct timeval OVERLAPPED LPLOOKUPSERVICE_COMPLETION_ROUTINE HANDLE * handle
Definition: sock.c:82
#define ERROR_SUCCESS
Definition: deptool.c:10
MSIOBJECTHDR hdr
Definition: msipriv.h:385
unsigned long MSIHANDLE
Definition: msiserver.idl:25
#define debugstr_w
Definition: kernel32.h:32
UINT ACTION_PerformAction(MSIPACKAGE *package, const WCHAR *action, UINT script)
Definition: action.c:7913
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
int msiobj_release(MSIOBJECTHDR *info)
Definition: handle.c:242
UINT WINAPI MsiOpenProductW(LPCWSTR szProduct, MSIHANDLE *phProduct)
Definition: msi.c:147
UINT WINAPI MsiCloseHandle(MSIHANDLE handle)
Definition: handle.c:270
unsigned int UINT
Definition: ndis.h:50
#define ERROR_CALL_NOT_IMPLEMENTED
Definition: compat.h:92

◆ MsiConfigureFeatureA()

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

Definition at line 3787 of file msi.c.

3788 {
3789  LPWSTR prod, feat = NULL;
3791 
3792  TRACE("%s %s %i\n", debugstr_a(szProduct), debugstr_a(szFeature), eInstallState);
3793 
3794  prod = strdupAtoW( szProduct );
3795  if (szProduct && !prod)
3796  goto end;
3797 
3798  feat = strdupAtoW( szFeature );
3799  if (szFeature && !feat)
3800  goto end;
3801 
3802  r = MsiConfigureFeatureW(prod, feat, eInstallState);
3803 
3804 end:
3805  msi_free(feat);
3806  msi_free(prod);
3807 
3808  return r;
3809 }
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
GLuint GLuint end
Definition: gl.h:1545
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
#define debugstr_a
Definition: kernel32.h:31
unsigned int UINT
Definition: ndis.h:50
static BOOL msi_free(void *mem)
Definition: msipriv.h:1227
UINT WINAPI MsiConfigureFeatureW(LPCWSTR szProduct, LPCWSTR szFeature, INSTALLSTATE eInstallState)
Definition: msi.c:3814
WCHAR * LPWSTR
Definition: xmlstorage.h:184
static WCHAR * strdupAtoW(const char *str)
Definition: main.c:67
#define ERROR_OUTOFMEMORY
Definition: deptool.c:13

Referenced by test_null().

◆ MsiConfigureFeatureW()

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

Definition at line 3814 of file msi.c.

3815 {
3816  MSIPACKAGE *package = NULL;
3817  UINT r;
3818  WCHAR sourcepath[MAX_PATH], filename[MAX_PATH];
3819  DWORD sz;
3820 
3821  TRACE("%s %s %i\n", debugstr_w(szProduct), debugstr_w(szFeature), eInstallState);
3822 
3823  if (!szProduct || !szFeature)
3824  return ERROR_INVALID_PARAMETER;
3825 
3826  switch (eInstallState)
3827  {
3828  case INSTALLSTATE_DEFAULT:
3829  /* FIXME: how do we figure out the default location? */
3830  eInstallState = INSTALLSTATE_LOCAL;
3831  break;
3832  case INSTALLSTATE_LOCAL:
3833  case INSTALLSTATE_SOURCE:
3834  case INSTALLSTATE_ABSENT:
3836  break;
3837  default:
3838  return ERROR_INVALID_PARAMETER;
3839  }
3840 
3841  r = MSI_OpenProductW( szProduct, &package );
3842  if (r != ERROR_SUCCESS)
3843  return r;
3844 
3845  sz = sizeof(sourcepath);
3848 
3849  sz = sizeof(filename);
3852 
3853  lstrcatW( sourcepath, filename );
3854 
3856 
3858  if (r != ERROR_SUCCESS)
3859  goto end;
3860 
3861  r = MSI_SetFeatureStateW( package, szFeature, eInstallState);
3862  if (r != ERROR_SUCCESS)
3863  goto end;
3864 
3865  r = MSI_InstallPackage( package, sourcepath, NULL );
3866 
3867 end:
3868  msiobj_release( &package->hdr );
3869 
3870  return r;
3871 }
#define ERROR_INVALID_PARAMETER
Definition: compat.h:91
UINT MSI_InstallPackage(MSIPACKAGE *package, LPCWSTR szPackagePath, LPCWSTR szCommandLine)
Definition: action.c:8024
static const WCHAR INSTALLPROPERTY_PACKAGENAMEW[]
Definition: msi.h:265
static UINT MSI_OpenProductW(LPCWSTR szProduct, MSIPACKAGE **package)
Definition: msi.c:102
UINT WINAPI MsiSourceListGetInfoW(LPCWSTR szProduct, LPCWSTR szUserSid, MSIINSTALLCONTEXT dwContext, DWORD dwOptions, LPCWSTR szProperty, LPWSTR szValue, LPDWORD pcchValue)
Definition: source.c:538
#define ERROR_SUCCESS
Definition: deptool.c:10
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
static const WCHAR szCostInitialize[]
Definition: msipriv.h:1191
INSTALLUILEVEL WINAPI MsiSetInternalUI(INSTALLUILEVEL dwUILevel, HWND *phWnd)
Definition: msi.c:2313
GLuint GLuint end
Definition: gl.h:1545
const char * filename
Definition: ioapi.h:135
static const WCHAR INSTALLPROPERTY_LASTUSEDSOURCEW[]
Definition: msi.h:405
#define debugstr_w
Definition: kernel32.h:32
smooth NULL
Definition: ftsmooth.c:416
UINT ACTION_PerformAction(MSIPACKAGE *package, const WCHAR *action, UINT script)
Definition: action.c:7913
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define MAX_PATH
Definition: compat.h:26
unsigned long DWORD
Definition: ntddk_ex.h:95
int msiobj_release(MSIOBJECTHDR *info)
Definition: handle.c:242
UINT MSI_SetFeatureStateW(MSIPACKAGE *package, LPCWSTR szFeature, INSTALLSTATE iState)
Definition: install.c:940
unsigned int UINT
Definition: ndis.h:50
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 957 of file msi.c.

959 {
960  LPWSTR szwProduct = NULL;
961  UINT r;
962 
963  TRACE("%s %d %d\n",debugstr_a(szProduct), iInstallLevel, eInstallState);
964 
965  if( szProduct )
966  {
967  szwProduct = strdupAtoW( szProduct );
968  if( !szwProduct )
969  return ERROR_OUTOFMEMORY;
970  }
971 
972  r = MsiConfigureProductW( szwProduct, iInstallLevel, eInstallState );
973  msi_free( szwProduct );
974 
975  return r;
976 }
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
smooth NULL
Definition: ftsmooth.c:416
UINT WINAPI MsiConfigureProductW(LPCWSTR szProduct, int iInstallLevel, INSTALLSTATE eInstallState)
Definition: msi.c:978
#define TRACE(s)
Definition: solgame.cpp:4
#define debugstr_a
Definition: kernel32.h:31
unsigned int UINT
Definition: ndis.h:50
static BOOL msi_free(void *mem)
Definition: msipriv.h:1227
WCHAR * LPWSTR
Definition: xmlstorage.h:184
static WCHAR * strdupAtoW(const char *str)
Definition: main.c:67
#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 927 of file msi.c.

929 {
930  LPWSTR szwProduct = NULL;
931  LPWSTR szwCommandLine = NULL;
933 
934  if( szProduct )
935  {
936  szwProduct = strdupAtoW( szProduct );
937  if( !szwProduct )
938  goto end;
939  }
940 
941  if( szCommandLine)
942  {
943  szwCommandLine = strdupAtoW( szCommandLine );
944  if( !szwCommandLine)
945  goto end;
946  }
947 
948  r = MsiConfigureProductExW( szwProduct, iInstallLevel, eInstallState,
949  szwCommandLine );
950 end:
951  msi_free( szwProduct );
952  msi_free( szwCommandLine);
953 
954  return r;
955 }
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
GLuint GLuint end
Definition: gl.h:1545
UINT WINAPI MsiConfigureProductExW(LPCWSTR szProduct, int iInstallLevel, INSTALLSTATE eInstallState, LPCWSTR szCommandLine)
Definition: msi.c:833
smooth NULL
Definition: ftsmooth.c:416
unsigned int UINT
Definition: ndis.h:50
static BOOL msi_free(void *mem)
Definition: msipriv.h:1227
WCHAR * LPWSTR
Definition: xmlstorage.h:184
static WCHAR * strdupAtoW(const char *str)
Definition: main.c:67
#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  static const WCHAR szInstalled[] = {
844  ' ','I','n','s','t','a','l','l','e','d','=','1',0};
845  static const WCHAR szMaxInstallLevel[] = {
846  ' ','I','N','S','T','A','L','L','L','E','V','E','L','=','3','2','7','6','7',0};
847  static const WCHAR szRemoveAll[] = {
848  ' ','R','E','M','O','V','E','=','A','L','L',0};
849  static const WCHAR szMachine[] = {
850  ' ','A','L','L','U','S','E','R','S','=','1',0};
851 
852  TRACE("%s %d %d %s\n",debugstr_w(szProduct), iInstallLevel, eInstallState,
853  debugstr_w(szCommandLine));
854 
855  if (!szProduct || lstrlenW(szProduct) != GUID_SIZE - 1)
857 
858  if (eInstallState == INSTALLSTATE_ADVERTISED ||
859  eInstallState == INSTALLSTATE_SOURCE)
860  {
861  FIXME("State %d not implemented\n", eInstallState);
863  }
864 
865  r = msi_locate_product(szProduct, &context);
866  if (r != ERROR_SUCCESS)
867  return r;
868 
869  r = open_package(szProduct, NULL, context, &package);
870  if (r != ERROR_SUCCESS)
871  return r;
872 
873  sz = lstrlenW(szInstalled) + 1;
874 
875  if (szCommandLine)
876  sz += lstrlenW(szCommandLine);
877 
878  if (eInstallState != INSTALLSTATE_DEFAULT)
879  sz += lstrlenW(szMaxInstallLevel);
880 
881  if (eInstallState == INSTALLSTATE_ABSENT)
882  sz += lstrlenW(szRemoveAll);
883 
885  sz += lstrlenW(szMachine);
886 
887  commandline = msi_alloc(sz * sizeof(WCHAR));
888  if (!commandline)
889  {
891  goto end;
892  }
893 
894  commandline[0] = 0;
895  if (szCommandLine)
896  lstrcpyW(commandline,szCommandLine);
897 
898  if (eInstallState != INSTALLSTATE_DEFAULT)
899  lstrcatW(commandline, szMaxInstallLevel);
900 
901  if (eInstallState == INSTALLSTATE_ABSENT)
902  lstrcatW(commandline, szRemoveAll);
903 
905  lstrcatW(commandline, szMachine);
906 
907  sz = sizeof(sourcepath);
909  INSTALLPROPERTY_LASTUSEDSOURCEW, sourcepath, &sz);
910 
911  sz = sizeof(filename);
914 
915  strcatW(sourcepath, filename);
916 
917  r = MSI_InstallPackage( package, sourcepath, commandline );
918 
919  msi_free(commandline);
920 
921 end:
922  msiobj_release( &package->hdr );
923 
924  return r;
925 }
#define ERROR_INVALID_PARAMETER
Definition: compat.h:91
UINT MSI_InstallPackage(MSIPACKAGE *package, LPCWSTR szPackagePath, LPCWSTR szCommandLine)
Definition: action.c:8024
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:783
UINT WINAPI MsiSourceListGetInfoW(LPCWSTR szProduct, LPCWSTR szUserSid, MSIINSTALLCONTEXT dwContext, DWORD dwOptions, LPCWSTR szProperty, LPWSTR szValue, LPDWORD pcchValue)
Definition: source.c:538
#define ERROR_SUCCESS
Definition: deptool.c:10
enum tagMSIINSTALLCONTEXT MSIINSTALLCONTEXT
Definition: action.c:41
Definition: http.c:6587
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
GLuint GLuint end
Definition: gl.h:1545
const char * filename
Definition: ioapi.h:135
#define lstrlenW
Definition: compat.h:407
static const WCHAR INSTALLPROPERTY_LASTUSEDSOURCEW[]
Definition: msi.h:405
#define debugstr_w
Definition: kernel32.h:32
#define FIXME(fmt,...)
Definition: debug.h:110
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define MAX_PATH
Definition: compat.h:26
UINT msi_locate_product(LPCWSTR szProduct, MSIINSTALLCONTEXT *context)
Definition: msi.c:55
unsigned long DWORD
Definition: ntddk_ex.h:95
int msiobj_release(MSIOBJECTHDR *info)
Definition: handle.c:242
#define lstrcpyW
Definition: compat.h:406
WINE_UNICODE_INLINE WCHAR * strcatW(WCHAR *dst, const WCHAR *src)
Definition: unicode.h:242
unsigned int UINT
Definition: ndis.h:50
static BOOL msi_free(void *mem)
Definition: msipriv.h:1227
static void * msi_alloc(size_t len) __WINE_ALLOC_SIZE(1)
Definition: msipriv.h:1204
#define ERROR_CALL_NOT_IMPLEMENTED
Definition: compat.h:92
LPWSTR WINAPI lstrcatW(LPWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:274
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define GUID_SIZE
Definition: msipriv.h:710
static const WCHAR szInstalled[]
Definition: msipriv.h:1122
#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 978 of file msi.c.

980 {
981  return MsiConfigureProductExW(szProduct, iInstallLevel, eInstallState, NULL);
982 }
UINT WINAPI MsiConfigureProductExW(LPCWSTR szProduct, int iInstallLevel, INSTALLSTATE eInstallState, LPCWSTR szCommandLine)
Definition: msi.c:833
smooth NULL
Definition: ftsmooth.c:416

Referenced by MsiConfigureProductA().

◆ MsiCreateAndVerifyInstallerDirectory()

UINT WINAPI MsiCreateAndVerifyInstallerDirectory ( DWORD  dwReserved)

Definition at line 3878 of file msi.c.

3879 {
3880  WCHAR path[MAX_PATH];
3881 
3882  TRACE("%d\n", dwReserved);
3883 
3884  if (dwReserved)
3885  {
3886  FIXME("dwReserved=%d\n", dwReserved);
3887  return ERROR_INVALID_PARAMETER;
3888  }
3889 
3891  return ERROR_FUNCTION_FAILED;
3892 
3894 
3896  return ERROR_FUNCTION_FAILED;
3897 
3898  return ERROR_SUCCESS;
3899 }
#define ERROR_INVALID_PARAMETER
Definition: compat.h:91
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:1059
static const WCHAR installerW[]
Definition: msi.c:53
UINT WINAPI GetWindowsDirectoryW(OUT LPWSTR lpBuffer, IN UINT uSize)
Definition: path.c:2351
#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:110
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define MAX_PATH
Definition: compat.h:26
Definition: services.c:325
LPWSTR WINAPI lstrcatW(LPWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:274
#define ERROR_ALREADY_EXISTS
Definition: disk.h:80

◆ MsiDetermineApplicablePatchesA()

UINT WINAPI MsiDetermineApplicablePatchesA ( LPCSTR  szProductPackagePath,
DWORD  cPatchInfo,
PMSIPATCHSEQUENCEINFOA  pPatchInfo 
)

Definition at line 525 of file msi.c.

527 {
528  UINT i, r;
529  WCHAR *package_path = NULL;
531 
532  TRACE("%s, %u, %p\n", debugstr_a(szProductPackagePath), cPatchInfo, pPatchInfo);
533 
534  if (szProductPackagePath && !(package_path = strdupAtoW( szProductPackagePath )))
535  return ERROR_OUTOFMEMORY;
536 
537  if (!(psi = patchinfoAtoW( cPatchInfo, pPatchInfo )))
538  {
539  msi_free( package_path );
540  return ERROR_OUTOFMEMORY;
541  }
542  r = MsiDetermineApplicablePatchesW( package_path, cPatchInfo, psi );
543  if (r == ERROR_SUCCESS)
544  {
545  for (i = 0; i < cPatchInfo; i++)
546  {
547  pPatchInfo[i].dwOrder = psi[i].dwOrder;
548  pPatchInfo[i].uStatus = psi[i].uStatus;
549  }
550  }
551  msi_free( package_path );
552  free_patchinfo( cPatchInfo, psi );
553  return r;
554 }
#define ERROR_SUCCESS
Definition: deptool.c:10
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
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
static void free_patchinfo(DWORD count, MSIPATCHSEQUENCEINFOW *info)
Definition: msi.c:498
smooth NULL
Definition: ftsmooth.c:416
#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:505
UINT WINAPI MsiDetermineApplicablePatchesW(LPCWSTR szProductPackagePath, DWORD cPatchInfo, PMSIPATCHSEQUENCEINFOW pPatchInfo)
Definition: msi.c:726
unsigned int UINT
Definition: ndis.h:50
static BOOL msi_free(void *mem)
Definition: msipriv.h:1227
static WCHAR * strdupAtoW(const char *str)
Definition: main.c:67
#define ERROR_OUTOFMEMORY
Definition: deptool.c:13

◆ MsiDetermineApplicablePatchesW()

UINT WINAPI MsiDetermineApplicablePatchesW ( LPCWSTR  szProductPackagePath,
DWORD  cPatchInfo,
PMSIPATCHSEQUENCEINFOW  pPatchInfo 
)

Definition at line 726 of file msi.c.

728 {
729  UINT r;
730  MSIPACKAGE *package;
731 
732  TRACE("%s, %u, %p\n", debugstr_w(szProductPackagePath), cPatchInfo, pPatchInfo);
733 
734  r = MSI_OpenPackageW( szProductPackagePath, &package );
735  if (r != ERROR_SUCCESS)
736  {
737  ERR("failed to open package %u\n", r);
738  return r;
739  }
740  r = determine_patch_sequence( package, cPatchInfo, pPatchInfo );
741  msiobj_release( &package->hdr );
742  return r;
743 }
#define ERROR_SUCCESS
Definition: deptool.c:10
MSIOBJECTHDR hdr
Definition: msipriv.h:385
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:242
UINT MSI_OpenPackageW(LPCWSTR szPackage, MSIPACKAGE **pPackage) DECLSPEC_HIDDEN
Definition: package.c:1441
#define ERR(fmt,...)
Definition: debug.h:109
unsigned int UINT
Definition: ndis.h:50
static UINT determine_patch_sequence(MSIPACKAGE *package, DWORD count, MSIPATCHSEQUENCEINFOW *info)
Definition: msi.c:631

Referenced by MsiDetermineApplicablePatchesA().

◆ MsiDeterminePatchSequenceA()

UINT WINAPI MsiDeterminePatchSequenceA ( LPCSTR  product,
LPCSTR  usersid,
MSIINSTALLCONTEXT  context,
DWORD  count,
PMSIPATCHSEQUENCEINFOA  patchinfo 
)

Definition at line 745 of file msi.c.

747 {
748  UINT i, r;
749  WCHAR *productW, *usersidW = NULL;
750  MSIPATCHSEQUENCEINFOW *patchinfoW;
751 
752  TRACE("%s, %s, %d, %d, %p\n", debugstr_a(product), debugstr_a(usersid),
753  context, count, patchinfo);
754 
755  if (!product) return ERROR_INVALID_PARAMETER;
756  if (!(productW = strdupAtoW( product ))) return ERROR_OUTOFMEMORY;
757  if (usersid && !(usersidW = strdupAtoW( usersid )))
758  {
759  msi_free( productW );
760  return ERROR_OUTOFMEMORY;
761  }
762  if (!(patchinfoW = patchinfoAtoW( count, patchinfo )))
763  {
764  msi_free( productW );
765  msi_free( usersidW );
766  return ERROR_OUTOFMEMORY;
767  }
768  r = MsiDeterminePatchSequenceW( productW, usersidW, context, count, patchinfoW );
769  if (r == ERROR_SUCCESS)
770  {
771  for (i = 0; i < count; i++)
772  {
773  patchinfo[i].dwOrder = patchinfoW[i].dwOrder;
774  patchinfo[i].uStatus = patchinfoW[i].uStatus;
775  }
776  }
777  msi_free( productW );
778  msi_free( usersidW );
779  free_patchinfo( count, patchinfoW );
780  return r;
781 }
#define ERROR_INVALID_PARAMETER
Definition: compat.h:91
#define ERROR_SUCCESS
Definition: deptool.c:10
Definition: http.c:6587
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
GLuint GLuint GLsizei count
Definition: gl.h:1545
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
static void free_patchinfo(DWORD count, MSIPATCHSEQUENCEINFOW *info)
Definition: msi.c:498
smooth NULL
Definition: ftsmooth.c:416
#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:505
UINT WINAPI MsiDeterminePatchSequenceW(LPCWSTR product, LPCWSTR usersid, MSIINSTALLCONTEXT context, DWORD count, PMSIPATCHSEQUENCEINFOW patchinfo)
Definition: msi.c:815
unsigned int UINT
Definition: ndis.h:50
static BOOL msi_free(void *mem)
Definition: msipriv.h:1227
static WCHAR * strdupAtoW(const char *str)
Definition: main.c:67
#define ERROR_OUTOFMEMORY
Definition: deptool.c:13

◆ MsiDeterminePatchSequenceW()

UINT WINAPI MsiDeterminePatchSequenceW ( LPCWSTR  product,
LPCWSTR  usersid,
MSIINSTALLCONTEXT  context,
DWORD  count,
PMSIPATCHSEQUENCEINFOW  patchinfo 
)

Definition at line 815 of file msi.c.

817 {
818  UINT r;
819  MSIPACKAGE *package;
820 
821  TRACE("%s, %s, %d, %d, %p\n", debugstr_w(product), debugstr_w(usersid),
822  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:91
static UINT open_package(const WCHAR *product, const WCHAR *usersid, MSIINSTALLCONTEXT context, MSIPACKAGE **package)
Definition: msi.c:783
#define ERROR_SUCCESS
Definition: deptool.c:10
Definition: http.c:6587
MSIOBJECTHDR hdr
Definition: msipriv.h:385
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:242
unsigned int UINT
Definition: ndis.h:50
static UINT determine_patch_sequence(MSIPACKAGE *package, DWORD count, MSIPATCHSEQUENCEINFOW *info)
Definition: msi.c:631

Referenced by MsiDeterminePatchSequenceA().

◆ MsiEnableLogA()

UINT WINAPI MsiEnableLogA ( DWORD  dwLogMode,
LPCSTR  szLogFile,
DWORD  attributes 
)

Definition at line 1908 of file msi.c.

1909 {
1910  LPWSTR szwLogFile = NULL;
1911  UINT r;
1912 
1913  TRACE("%08x %s %08x\n", dwLogMode, debugstr_a(szLogFile), attributes);
1914 
1915  if( szLogFile )
1916  {
1917  szwLogFile = strdupAtoW( szLogFile );
1918  if( !szwLogFile )
1919  return ERROR_OUTOFMEMORY;
1920  }
1921  r = MsiEnableLogW( dwLogMode, szwLogFile, attributes );
1922  msi_free( szwLogFile );
1923  return r;
1924 }
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
UINT WINAPI MsiEnableLogW(DWORD dwLogMode, LPCWSTR szLogFile, DWORD attributes)
Definition: msi.c:1926
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
#define debugstr_a
Definition: kernel32.h:31
unsigned int UINT
Definition: ndis.h:50
static BOOL msi_free(void *mem)
Definition: msipriv.h:1227
WCHAR * LPWSTR
Definition: xmlstorage.h:184
static WCHAR * strdupAtoW(const char *str)
Definition: main.c:67
#define ERROR_OUTOFMEMORY
Definition: deptool.c:13

Referenced by START_TEST().

◆ MsiEnableLogW()

UINT WINAPI MsiEnableLogW ( DWORD  dwLogMode,
LPCWSTR  szLogFile,
DWORD  attributes 
)

Definition at line 1926 of file msi.c.

1927 {
1928  TRACE("%08x %s %08x\n", dwLogMode, debugstr_w(szLogFile), attributes);
1929 
1931  gszLogFile = NULL;
1932  if (szLogFile)
1933  {
1934  HANDLE file;
1935 
1936  if (!(attributes & INSTALLLOGATTRIBUTES_APPEND))
1937  DeleteFileW(szLogFile);
1940  if (file != INVALID_HANDLE_VALUE)
1941  {
1942  gszLogFile = strdupW(szLogFile);
1943  CloseHandle(file);
1944  }
1945  else
1946  ERR("Unable to enable log %s (%u)\n", debugstr_w(szLogFile), GetLastError());
1947  }
1948 
1949  return ERROR_SUCCESS;
1950 }
#define CloseHandle
Definition: compat.h:398
#define ERROR_SUCCESS
Definition: deptool.c:10
static WCHAR * strdupW(const WCHAR *src)
Definition: main.c:92
#define INVALID_HANDLE_VALUE
Definition: compat.h:391
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
#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
smooth NULL
Definition: ftsmooth.c:416
#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:126
#define ERR(fmt,...)
Definition: debug.h:109
#define CreateFileW
Definition: compat.h:400
static BOOL msi_free(void *mem)
Definition: msipriv.h:1227
Definition: fci.c:126

Referenced by MsiEnableLogA(), and WinMain().

◆ MsiEndTransaction()

UINT WINAPI MsiEndTransaction ( DWORD  state)

Definition at line 4406 of file msi.c.

4407 {
4408  FIXME("%u\n", state);
4409  return ERROR_SUCCESS;
4410 }
#define ERROR_SUCCESS
Definition: deptool.c:10
#define FIXME(fmt,...)
Definition: debug.h:110
static int state
Definition: maze.c:121

◆ MsiEnumComponentCostsA()

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

Definition at line 1952 of file msi.c.

1955 {
1956  UINT r;
1957  DWORD len;
1958  WCHAR *driveW, *componentW = NULL;
1959 
1960  TRACE("%d, %s, %u, %d, %p, %p, %p %p\n", handle, debugstr_a(component), index,
1961  state, drive, buflen, cost, temp);
1962 
1963  if (!drive || !buflen) return ERROR_INVALID_PARAMETER;
1964  if (component && !(componentW = strdupAtoW( component ))) return ERROR_OUTOFMEMORY;
1965 
1966  len = *buflen;
1967  if (!(driveW = msi_alloc( len * sizeof(WCHAR) )))
1968  {
1969  msi_free( componentW );
1970  return ERROR_OUTOFMEMORY;
1971  }
1972  r = MsiEnumComponentCostsW( handle, componentW, index, state, driveW, buflen, cost, temp );
1973  if (!r)
1974  {
1975  WideCharToMultiByte( CP_ACP, 0, driveW, -1, drive, len, NULL, NULL );
1976  }
1977  msi_free( componentW );
1978  msi_free( driveW );
1979  return r;
1980 }
#define ERROR_INVALID_PARAMETER
Definition: compat.h:91
#define WideCharToMultiByte
Definition: compat.h:101
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
#define CP_ACP
Definition: compat.h:99
smooth NULL
Definition: ftsmooth.c:416
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
static BOOL msi_free(void *mem)
Definition: msipriv.h:1227
static void * msi_alloc(size_t len) __WINE_ALLOC_SIZE(1)
Definition: msipriv.h:1204
UINT WINAPI MsiEnumComponentCostsW(MSIHANDLE handle, LPCWSTR component, DWORD index, INSTALLSTATE state, LPWSTR drive, DWORD *buflen, int *cost, int *temp)
Definition: msi.c:1990
static WCHAR * strdupAtoW(const char *str)
Definition: main.c:67
#define ERROR_OUTOFMEMORY
Definition: deptool.c:13

Referenced by test_MsiEnumComponentCosts().

◆ MsiEnumComponentCostsW()

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

Definition at line 1990 of file msi.c.

1993 {
1995  MSICOMPONENT *comp = NULL;
1996  MSIPACKAGE *package;
1997  MSIFILE *file;
1998  STATSTG stat = {0};
1999  WCHAR path[MAX_PATH];
2000 
2001  TRACE("%d, %s, %u, %d, %p, %p, %p %p\n", handle, debugstr_w(component), index,
2002  state, drive, buflen, cost, temp);
2003 
2004  if (!drive || !buflen || !cost || !temp) return ERROR_INVALID_PARAMETER;
2005  if (!(package = msihandle2msiinfo( handle, MSIHANDLETYPE_PACKAGE )))
2006  {
2007  HRESULT hr;
2008  IWineMsiRemotePackage *remote_package;
2009  BSTR bname = NULL;
2010 
2011  if (!(remote_package = (IWineMsiRemotePackage *)msi_get_remote( handle )))
2012  return ERROR_INVALID_HANDLE;
2013 
2014  if (component && !(bname = SysAllocString( component )))
2015  {
2016  IWineMsiRemotePackage_Release( remote_package );
2017  return ERROR_OUTOFMEMORY;
2018  }
2019  hr = IWineMsiRemotePackage_EnumComponentCosts( remote_package, bname, index, state, drive, buflen, cost, temp );
2020  IWineMsiRemotePackage_Release( remote_package );
2021  SysFreeString( bname );
2022  if (FAILED(hr))
2023  {
2025  return ERROR_FUNCTION_FAILED;
2026  }
2027  return ERROR_SUCCESS;
2028  }
2029 
2030  if (!msi_get_property_int( package->db, szCostingComplete, 0 ))
2031  {
2032  msiobj_release( &package->hdr );
2034  }
2035  if (component && component[0] && !(comp = msi_get_loaded_component( package, component )))
2036  {
2037  msiobj_release( &package->hdr );
2038  return ERROR_UNKNOWN_COMPONENT;
2039  }
2040  if (*buflen < 3)
2041  {
2042  *buflen = 2;
2043  msiobj_release( &package->hdr );
2044  return ERROR_MORE_DATA;
2045  }
2046  if (index)
2047  {
2048  msiobj_release( &package->hdr );
2049  return ERROR_NO_MORE_ITEMS;
2050  }
2051 
2052  drive[0] = 0;
2053  *cost = *temp = 0;
2055  if (component && component[0])
2056  {
2057  if (msi_is_global_assembly( comp )) *temp = comp->Cost;
2058  if (!comp->Enabled || !comp->KeyPath)
2059  {
2060  *cost = 0;
2061  *buflen = set_drive( drive, path[0] );
2062  r = ERROR_SUCCESS;
2063  }
2064  else if ((file = msi_get_loaded_file( package, comp->KeyPath )))
2065  {
2066  *cost = max( 8, comp->Cost / 512 );
2067  *buflen = set_drive( drive, file->TargetPath[0] );
2068  r = ERROR_SUCCESS;
2069  }
2070  }
2071  else if (IStorage_Stat( package->db->storage, &stat, STATFLAG_NONAME ) == S_OK)
2072  {
2073  *temp = max( 8, stat.cbSize.QuadPart / 512 );
2074  *buflen = set_drive( drive, path[0] );
2075  r = ERROR_SUCCESS;
2076  }
2077  msiobj_release( &package->hdr );
2078  return r;
2079 }
#define ERROR_INVALID_PARAMETER
Definition: compat.h:91
#define max(a, b)
Definition: svc.c:63
#define ERROR_SUCCESS
Definition: deptool.c:10
HRESULT hr
Definition: shlfolder.c:183
#define ERROR_NO_MORE_ITEMS
Definition: compat.h:95
MSIOBJECTHDR hdr
Definition: msipriv.h:385
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
int msi_get_property_int(MSIDATABASE *package, LPCWSTR prop, int def) DECLSPEC_HIDDEN
Definition: package.c:2392
#define ERROR_INVALID_HANDLE
Definition: compat.h:88
BOOL msi_is_global_assembly(MSICOMPONENT *comp)
Definition: action.c:2193
OLECHAR * BSTR
Definition: compat.h:1927
LPWSTR KeyPath
Definition: msipriv.h:507
UINT WINAPI GetWindowsDirectoryW(OUT LPWSTR lpBuffer, IN UINT uSize)
Definition: path.c:2351
#define ERROR_FUNCTION_FAILED
Definition: winerror.h:985
#define HRESULT_FACILITY(hr)
Definition: winerror.h:79
static UINT set_drive(WCHAR *buffer, WCHAR letter)
Definition: msi.c:1982
#define debugstr_w
Definition: kernel32.h:32
#define ERROR_FUNCTION_NOT_CALLED
Definition: winerror.h:984
smooth NULL
Definition: ftsmooth.c:416
BSTR WINAPI SysAllocString(LPCOLESTR str)
Definition: oleaut.c:241
GLuint index
Definition: glext.h:6031
MSIFILE * msi_get_loaded_file(MSIPACKAGE *package, const WCHAR *key)
Definition: action.c:674
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
#define MAX_PATH
Definition: compat.h:26
static const WCHAR szCostingComplete[]
Definition: msipriv.h:1181
const char file[]
Definition: icontest.c:11
MSIDATABASE * db
Definition: msipriv.h:386
int msiobj_release(MSIOBJECTHDR *info)
Definition: handle.c:242
MSICOMPONENT * msi_get_loaded_component(MSIPACKAGE *package, const WCHAR *Component)
Definition: action.c:652
#define MSIHANDLETYPE_PACKAGE
Definition: msipriv.h:703
static int state
Definition: maze.c:121
Definition: stat.h:55
#define ERROR_MORE_DATA
Definition: dderror.h:13
#define FACILITY_WIN32
Definition: winerror.h:27
#define S_OK
Definition: intsafe.h:59
static calc_node_t temp
Definition: rpn_ieee.c:38
Definition: services.c:325
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
Definition: oleaut.c:274
#define ERROR_UNKNOWN_COMPONENT
Definition: winerror.h:965
unsigned int UINT
Definition: ndis.h:50
#define HRESULT_CODE(hr)
Definition: winerror.h:76
IUnknown * msi_get_remote(MSIHANDLE handle)
Definition: handle.c:182