HRESULT DecompressManifest(ULONG dwFlags, PLBLOB pManifestContents, HRESULT *hResult)
{
UINT_PTR pfn = CalcFunctionAddress(phWCP, pfb_DecompressManifest);
typedef signed int(__fastcall * fnDecompressManifest)(ULONG dwFlags, PLBLOB pManifestContents, HRESULT *hResult);
fnDecompressManifest g_fnDecompressManifest = (fnDecompressManifest)pfn;
HRESULT result = g_fnDecompressManifest(dwFlags, pManifestContents, hResult);
return result;
}
HRESULT DecompressManifestFile(LPWSTR ManifestFileName)
{
HRESULT result = 0;
IRtlFile *pIFile = NULL;
CFILE *pFile = NULL;
GetInterfaceAndObject(ManifestFileName, &pIFile, &pFile, GENERIC_WRITE);
LBLOB pManifestContents = { 0,0,0 };
pIFile->GetContents(0, &pManifestContents, &result);
DecompressManifest(0, &pManifestContents, &result);
pIFile->SetContents(0, pManifestContents);
return result;
}