static void getInstalledPatchesList(const CString& productCode, CAtlList< CString >* patchesList)
{
UINT retval;
UINT patchIndex = 0;
TCHAR patchGuidBuffer[MAX_PRODUCT_CODE_LEN] = _T("");
TCHAR transformsBuff[100] = _T("");
DWORD transformsBuffSize = sizeof(transformsBuff)/sizeof(transformsBuff[0]);
do {
memset(patchGuidBuffer, 0, sizeof(patchGuidBuffer));
memset(transformsBuff, 0, sizeof(transformsBuff));
transformsBuffSize = sizeof(transformsBuff)/sizeof(transformsBuff[0]);
retval = MsiEnumPatches(productCode, patchIndex, patchGuidBuffer,
transformsBuff, &transformsBuffSize);
if (ERROR_SUCCESS == retval) {
patchesList->AddTail(CString(patchGuidBuffer));
++patchIndex;
}
} while (ERROR_SUCCESS == retval);
} //end of getInstalledPatchesList
|