Expand Minimize

MsiEnumPatches function

The MsiEnumPatches function enumerates all of the patches that have been applied to a product. The function returns the patch code GUID for each patch that has been applied to the product and returns a list of transforms from each patch that apply to the product. Note that patches may have many transforms only some of which are applicable to a particular product. The list of transforms are returned in the same format as the value of the TRANSFORMS property.

Note  pcchTransformsBuf is not set to the number of characters copied to lpTransformsBuf upon a successful return of MsiEnumPatches.

Syntax


UINT MsiEnumPatches(
  _In_     LPCTSTR szProduct,
  _In_     DWORD iPatchIndex,
  _Out_    LPTSTR lpPatchBuf,
  _Out_    LPTSTR lpTransformsBuf,
  _Inout_  DWORD *pcchTransformsBuf
);

Parameters

szProduct [in]

Specifies the product code of the product for which patches are to be enumerated.

iPatchIndex [in]

Specifies the index of the patch to retrieve. This parameter should be zero for the first call to the MsiEnumPatches function and then incremented for subsequent calls.

lpPatchBuf [out]

Pointer to a buffer that receives the patch's GUID. This argument is required.

lpTransformsBuf [out]

Pointer to a buffer that receives the list of transforms in the patch that are applicable to the product. This argument is required and cannot be Null.

pcchTransformsBuf [in, out]

Set to the number of characters copied to lpTransformsBuf upon an unsuccessful return of the function. Not set for a successful return. On input, this is the full size of the buffer, including a space for a terminating null character. If the buffer passed in is too small, the count returned does not include the terminating null character.

Return value

ValueMeaning
ERROR_BAD_CONFIGURATION

The configuration data is corrupt.

ERROR_INVALID_PARAMETER

An invalid parameter was passed to the function.

ERROR_NO_MORE_ITEMS

There are no patches to return.

ERROR_SUCCESS

A value was enumerated.

ERROR_MORE_DATA

A buffer is too small to hold the requested data.

 

Remarks

To enumerate patches, an application should initially call the MsiEnumPatches function with the iPatchIndex parameter set to zero. The application should then increment the iPatchIndex parameter and call MsiEnumPatches until there are no more products (until the function returns ERROR_NO_MORE_ITEMS).

If the buffer is too small to hold the requested data, MsiEnumPatches returns ERROR_MORE_DATA and pcchTransformsBuf contains the number of characters copied to lpTransformsBuf, without counting the Null character.

Requirements

Version

Windows Installer 5.0 on Windows Server 2012, Windows 8, Windows Server 2008 R2 or Windows 7. Windows Installer 4.0 or Windows Installer 4.5 on Windows Server 2008 or Windows Vista. Windows Installer on Windows Server 2003 or Windows XP. See the Windows Installer Run-Time Requirements for information about the minimum Windows service pack that is required by a Windows Installer version.

Header

Msi.h

Library

Msi.lib

DLL

Msi.dll

Unicode and ANSI names

MsiEnumPatchesW (Unicode) and MsiEnumPatchesA (ANSI)

 

 

Community Additions

ADD
Show:
© 2014 Microsoft