MsiGetPatchFileList Function

Windows Installer

MsiGetPatchFileList Function

The MsiGetPatchFileList function is provided a list of .msp files, delimited by semicolons, and retrieves the list of files that can be updated by the patches.

Syntax

C++UINT WINAPI MsiGetPatchFileList(
  __in     LPCTSTR szProductCode,
  __in     LPCTSTR szPatchList,
  __inout  LPDWORD pcFiles,
  __inout  MSIHANDLE **    pphFileRecords
);

Parameters

szProductCode [in]

A null-terminated string value containing the ProductCode (GUID) of the product which is the target of the patches. This parameter cannot be NULL.

szPatchList [in]

A null-terminated string value that contains the list of Windows Installer patches (.msp files). Each patch can be specified by the full path to the patch package. The patches in the list are delimited by semicolons. At least one patch must be specified.

pcFiles [in, out]

A pointer to a location that receives the number of files that will be updated on this system by this list of patches specified by szPatchList. This parameter is required.

pphFileRecords [in, out]

A pointer to a location that receives a pointer to an array of records. The first field (0-index) of each record contains the full file path of a file that can be updated when the list of patches in szPatchList are applied on this computer. This parameter is required.

Return Value

The MsiGetPatchFileList function returns the following values.

Value Meaning
ERROR_SUCCESS

The function completed successfully.

ERROR_INVALID_PARAMETER

An invalid parameter was passed to the function.

ERROR_FUNCTION_FAILED

The function failed.

 

Remarks

For example, szPatchList could have the value: "c:\sus\download\cache\Office\sp1.msp; c:\sus\download\cache\Office\QFE1.msp; c:\sus\download\cache\Office\QFEn.msp".

This function runs in the context of the caller. The product code is searched in the order of user-unmanaged context, user-managed context, and machine context.

You must close all MSIHANDLE objects that are returned by this function by calling the MsiCloseHandle function.

If the function fails, you can obtain extended error information by using the MsiGetLastErrorRecord function.

For more information about using the MsiGetPatchFileList function see Listing the Files that can be Updated.

Requirements

VersionWindows Installer 5.0 on 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 4.5 on Windows Server 2003 and 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.
HeaderMsi.h
LibraryMsi.lib
DLLMsi.dll
Unicode and ANSI namesMsiGetPatchFileListW (Unicode) and MsiGetPatchFileListA (ANSI)

Send comments about this topic to Microsoft

Build date: 8/13/2009

© 2009 Microsoft Corporation. All rights reserved.