📄 msiquery.h
字号:
// Only needs to be called if not all records have been fetched
// Returns ERROR_SUCCESS, ERROR_INVALID_HANDLE, ERROR_INVALID_HANDLE_STATE
UINT WINAPI MsiViewClose(MSIHANDLE hView);
// Return a record containing the names of all primary key columns for a given table
// Returns an MSIHANDLE for a record containing the name of each column.
// The field count of the record corresponds to the number of primary key columns.
// Field [0] of the record contains the table name.
// Returns ERROR_SUCCESS, ERROR_INVALID_HANDLE, ERROR_INVALID_TABLE
UINT WINAPI MsiDatabaseGetPrimaryKeysA(MSIHANDLE hDatabase,
LPCSTR szTableName, // the name of a specific table <case-sensitive>
MSIHANDLE *phRecord); // returned record if ERROR_SUCCESS
UINT WINAPI MsiDatabaseGetPrimaryKeysW(MSIHANDLE hDatabase,
LPCWSTR szTableName, // the name of a specific table <case-sensitive>
MSIHANDLE *phRecord); // returned record if ERROR_SUCCESS
#ifdef UNICODE
#define MsiDatabaseGetPrimaryKeys MsiDatabaseGetPrimaryKeysW
#else
#define MsiDatabaseGetPrimaryKeys MsiDatabaseGetPrimaryKeysA
#endif // !UNICODE
// Return an enum defining the state of the table (temporary, unknown, or persistent).
// Returns MSICONDITION_ERROR, MSICONDITION_FALSE, MSICONDITION_TRUE, MSICONDITION_NONE
MSICONDITION WINAPI MsiDatabaseIsTablePersistentA(MSIHANDLE hDatabase,
LPCSTR szTableName); // the name of a specific table
MSICONDITION WINAPI MsiDatabaseIsTablePersistentW(MSIHANDLE hDatabase,
LPCWSTR szTableName); // the name of a specific table
#ifdef UNICODE
#define MsiDatabaseIsTablePersistent MsiDatabaseIsTablePersistentW
#else
#define MsiDatabaseIsTablePersistent MsiDatabaseIsTablePersistentA
#endif // !UNICODE
// --------------------------------------------------------------------------
// Summary information stream management functions
// --------------------------------------------------------------------------
// Integer Property IDs: 1, 14, 15, 16, 19
// DateTime Property IDs: 10, 11, 12, 13
// Text Property IDs: 2, 3, 4, 5, 6, 7, 8, 9, 18
// Unsupported Propery IDs: 0 (PID_DICTIONARY), 17 (PID_THUMBNAIL)
// Obtain a handle for the _SummaryInformation stream for an MSI database
// Execution of this function sets the error record, accessible via MsiGetLastErrorRecord
UINT WINAPI MsiGetSummaryInformationA(MSIHANDLE hDatabase, // 0 if not open
LPCSTR szDatabasePath, // path to database, 0 if database handle supplied
UINT uiUpdateCount, // maximium number of updated values, 0 to open read-only
MSIHANDLE *phSummaryInfo); // returned handle to summary information data
UINT WINAPI MsiGetSummaryInformationW(MSIHANDLE hDatabase, // 0 if not open
LPCWSTR szDatabasePath, // path to database, 0 if database handle supplied
UINT uiUpdateCount, // maximium number of updated values, 0 to open read-only
MSIHANDLE *phSummaryInfo); // returned handle to summary information data
#ifdef UNICODE
#define MsiGetSummaryInformation MsiGetSummaryInformationW
#else
#define MsiGetSummaryInformation MsiGetSummaryInformationA
#endif // !UNICODE
// Obtain the number of existing properties in the SummaryInformation stream
UINT WINAPI MsiSummaryInfoGetPropertyCount(MSIHANDLE hSummaryInfo,
UINT *puiPropertyCount); // pointer to location to return total property count
// Set a single summary information property
// Returns ERROR_SUCCESS, ERROR_INVALID_HANDLE, ERROR_UNKNOWN_PROPERTY
UINT WINAPI MsiSummaryInfoSetPropertyA(MSIHANDLE hSummaryInfo,
UINT uiProperty, // property ID, one of allowed values for summary information
UINT uiDataType, // VT_I4, VT_LPSTR, VT_FILETIME, or VT_EMPTY
INT iValue, // integer value, used only if integer property
FILETIME *pftValue, // pointer to filetime value, used only if datetime property
LPCSTR szValue); // text value, used only if string property
UINT WINAPI MsiSummaryInfoSetPropertyW(MSIHANDLE hSummaryInfo,
UINT uiProperty, // property ID, one of allowed values for summary information
UINT uiDataType, // VT_I4, VT_LPSTR, VT_FILETIME, or VT_EMPTY
INT iValue, // integer value, used only if integer property
FILETIME *pftValue, // pointer to filetime value, used only if datetime property
LPCWSTR szValue); // text value, used only if string property
#ifdef UNICODE
#define MsiSummaryInfoSetProperty MsiSummaryInfoSetPropertyW
#else
#define MsiSummaryInfoSetProperty MsiSummaryInfoSetPropertyA
#endif // !UNICODE
// Get a single property from the summary information
// Returns ERROR_SUCCESS, ERROR_INVALID_HANDLE, ERROR_UNKNOWN_PROPERTY
UINT WINAPI MsiSummaryInfoGetPropertyA(MSIHANDLE hSummaryInfo,
UINT uiProperty, // property ID, one of allowed values for summary information
UINT *puiDataType, // returned type: VT_I4, VT_LPSTR, VT_FILETIME, VT_EMPTY
INT *piValue, // returned integer property data
FILETIME *pftValue, // returned datetime property data
LPSTR szValueBuf, // buffer to return string property data
DWORD *pcchValueBuf); // in/out buffer character count
UINT WINAPI MsiSummaryInfoGetPropertyW(MSIHANDLE hSummaryInfo,
UINT uiProperty, // property ID, one of allowed values for summary information
UINT *puiDataType, // returned type: VT_I4, VT_LPSTR, VT_FILETIME, VT_EMPTY
INT *piValue, // returned integer property data
FILETIME *pftValue, // returned datetime property data
LPWSTR szValueBuf, // buffer to return string property data
DWORD *pcchValueBuf); // in/out buffer character count
#ifdef UNICODE
#define MsiSummaryInfoGetProperty MsiSummaryInfoGetPropertyW
#else
#define MsiSummaryInfoGetProperty MsiSummaryInfoGetPropertyA
#endif // !UNICODE
// Write back changed information to summary information stream
UINT WINAPI MsiSummaryInfoPersist(MSIHANDLE hSummaryInfo);
// --------------------------------------------------------------------------
// Installer database management functions - not used by custom actions
// --------------------------------------------------------------------------
// Open an installer database, specifying the persistance mode, which is a pointer.
// Predefined persist values are reserved pointer values, requiring pointer arithmetic.
// Execution of this function sets the error record, accessible via MsiGetLastErrorRecord
UINT WINAPI MsiOpenDatabaseA(
LPCSTR szDatabasePath, // path to database, 0 to create temporary database
LPCSTR szPersist, // output database path or one of predefined values
MSIHANDLE* phDatabase); // location to return database handle
UINT WINAPI MsiOpenDatabaseW(
LPCWSTR szDatabasePath, // path to database, 0 to create temporary database
LPCWSTR szPersist, // output database path or one of predefined values
MSIHANDLE* phDatabase); // location to return database handle
#ifdef UNICODE
#define MsiOpenDatabase MsiOpenDatabaseW
#else
#define MsiOpenDatabase MsiOpenDatabaseA
#endif // !UNICODE
// Import an MSI text archive table into an open database
// Execution of this function sets the error record, accessible via MsiGetLastErrorRecord
UINT WINAPI MsiDatabaseImportA(MSIHANDLE hDatabase,
LPCSTR szFolderPath, // folder containing archive files
LPCSTR szFileName); // table archive file to be imported
UINT WINAPI MsiDatabaseImportW(MSIHANDLE hDatabase,
LPCWSTR szFolderPath, // folder containing archive files
LPCWSTR szFileName); // table archive file to be imported
#ifdef UNICODE
#define MsiDatabaseImport MsiDatabaseImportW
#else
#define MsiDatabaseImport MsiDatabaseImportA
#endif // !UNICODE
// Export an MSI table from an open database to a text archive file
// Execution of this function sets the error record, accessible via MsiGetLastErrorRecord
UINT WINAPI MsiDatabaseExportA(MSIHANDLE hDatabase,
LPCSTR szTableName, // name of table in database <case-sensitive>
LPCSTR szFolderPath, // folder containing archive files
LPCSTR szFileName); // name of exported table archive file
UINT WINAPI MsiDatabaseExportW(MSIHANDLE hDatabase,
LPCWSTR szTableName, // name of table in database <case-sensitive>
LPCWSTR szFolderPath, // folder containing archive files
LPCWSTR szFileName); // name of exported table archive file
#ifdef UNICODE
#define MsiDatabaseExport MsiDatabaseExportW
#else
#define MsiDatabaseExport MsiDatabaseExportA
#endif // !UNICODE
// Merge two database together, allowing duplicate rows
// Execution of this function sets the error record, accessible via MsiGetLastErrorRecord
UINT WINAPI MsiDatabaseMergeA(MSIHANDLE hDatabase,
MSIHANDLE hDatabaseMerge, // database to be merged into hDatabase
LPCSTR szTableName); // name of non-persistent table to receive errors
UINT WINAPI MsiDatabaseMergeW(MSIHANDLE hDatabase,
MSIHANDLE hDatabaseMerge, // database to be merged into hDatabase
LPCWSTR szTableName); // name of non-persistent table to receive errors
#ifdef UNICODE
#define MsiDatabaseMerge MsiDatabaseMergeW
#else
#define MsiDatabaseMerge MsiDatabaseMergeA
#endif // !UNICODE
// Generate a transform file of differences between two databases
// Execution of this function sets the error record, accessible via MsiGetLastErrorRecord
UINT WINAPI MsiDatabaseGenerateTransformA(MSIHANDLE hDatabase,
MSIHANDLE hDatabaseReference, // base database to reference changes
LPCSTR szTransformFile, // name of generated transform file
int iReserved1, // reserved argument, not used
int iReserved2); // reserved argument, not used
UINT WINAPI MsiDatabaseGenerateTransformW(MSIHANDLE hDatabase,
MSIHANDLE hDatabaseReference, // base database to reference changes
LPCWSTR szTransformFile, // name of generated transform file
int iReserved1, // reserved argument, not used
int iReserved2); // reserved argument, not used
#ifdef UNICODE
#define MsiDatabaseGenerateTransform MsiDatabaseGenerateTransformW
#else
#define MsiDatabaseGenerateTransform MsiDatabaseGenerateTransformA
#endif // !UNICODE
// Apply a transform file containing database difference
// Execution of this function sets the error record, accessible via MsiGetLastErrorRecord
UINT WINAPI MsiDatabaseApplyTransformA(MSIHANDLE hDatabase,
LPCSTR szTransformFile, // name of transform file
int iErrorConditions); // errors to suppress, bits from MSITRANSFORM_ERROR
UINT WINAPI MsiDatabaseApplyTransformW(MSIHANDLE hDatabase,
LPCWSTR szTransformFile, // name of transform file
int iErrorConditions); // errors to suppress, bits from MSITRANSFORM_ERROR
#ifdef UNICODE
#define MsiDatabaseApplyTransform MsiDatabaseApplyTransformW
#else
#define MsiDatabaseApplyTransform MsiDatabaseApplyTransformA
#endif // !UNICODE
// Create summary information of existing transform to include validation and error conditions
// Execution of this function sets the error record, accessible via MsiGetLastErrorRecord
UINT WINAPI MsiCreateTransformSummaryInfoA(MSIHANDLE hDatabase,
MSIHANDLE hDatabaseReference, // base database to reference changes
LPCSTR szTransformFile, // name of generated transform file
int iErrorConditions, // errors to suppress when applied, from MSITRANSFORM_ERROR
int iValidation); // properties validated when applied, MSITRANSFORM_VALIDATE
UINT WINAPI MsiCreateTransformSummaryInfoW(MSIHANDLE hDatabase,
MSIHANDLE hDatabaseReference, // base database to reference changes
LPCWSTR szTransformFile, // name of generated transform file
int iErrorConditions, // errors to suppress when applied, from MSITRANSFORM_ERROR
int iValidation); // properties validated when applied, MSITRANSFORM_VALIDATE
#ifdef UNICODE
#define MsiCreateTransformSummaryInfo MsiCreateTransformSummaryInfoW
#else
#define MsiCreateTransformSummaryInfo MsiCreateTransformSummaryInfoA
#endif // !UNICODE
// Write out all persistent table data, ignored if database opened read-only
// Execution of this function sets the error record, accessible via MsiGetLastErrorRecord
UINT WINAPI MsiDatabaseCommit(MSIHANDLE hDatabase);
// Return the update state of a database
MSIDBSTATE WINAPI MsiGetDatabaseState(MSIHANDLE hDatabase);
// --------------------------------------------------------------------------
// Record object functions
// --------------------------------------------------------------------------
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -