MsiGetSummaryInformation Function

Windows Installer

MsiGetSummaryInformation Function

The MsiGetSummaryInformation function obtains a handle to the _SummaryInformation stream for an installer database. This function returns a handle that should be closed using MsiCloseHandle.

Syntax

C++UINT MsiGetSummaryInformation(
  __in   MSIHANDLE hDatabase,
  __in   LPCTSTR szDatabasePath,
  __in   UINT uiUpdateCount,
  __out  MSIHANDLE *phSummaryInfo
);

Parameters

hDatabase [in]

Handle to the database.

szDatabasePath [in]

Specifies the path to the database.

uiUpdateCount [in]

Specifies the maximum number of updated values.

phSummaryInfo [out]

Pointer to the location from which to receive the summary information handle.

Return Value

The MsiGetSummaryInformation function returns the following values:

ERROR_INSTALL_PACKAGE_INVALID

The installation package is invalid.

ERROR_INVALID_HANDLE

An invalid or inactive handle was supplied.

ERROR_INVALID_PARAMETER

An invalid parameter was passed to the function.

ERROR_SUCCESS

The function succeeded.

Remarks

If the database specified by the MsiGetSummaryInformation function is not open, you must specify 0 for hDatabase and specify the path to the database in szDatabasePath. If the database is open, you must set szDatabasePath to 0.

If a value of uiUpdateCount greater than 0 is used to open an existing summary information stream, MsiSummaryInfoPersist must be called before closing the phSummaryInfo handle. Failing to do this will lose the existing stream information.

To view the summary information of a patch using MsiGetSummaryInformation, set szDatabasePath to the path to the patch. Alternately, you can create a handle to the patch using MsiOpenDatabase and then pass that handle to MsiGetSummaryInformation as the hDatabase parameter.

Note that it is recommended to use variables of type PMSIHANDLE because the installer closes PMSIHANDLE objects as they go out of scope, whereas you must close MSIHANDLE objects by calling MsiCloseHandle. For more information see Use PMSIHANDLE instead of HANDLE section in the Windows Installer Best Practices.

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

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 on Windows Server 2003, Windows XP, and Windows 2000
HeaderMsiquery.h
LibraryMsi.lib
DLLMsi.dll
Unicode and ANSI namesMsiGetSummaryInformationW (Unicode) and MsiGetSummaryInformationA (ANSI)

See Also

Summary Information Property Functions
Summary Information Stream Property Set

Send comments about this topic to Microsoft

Build date: 8/13/2009

© 2009 Microsoft Corporation. All rights reserved.