このコードはVista/Win7で正常に機能しますが、win xpでは失敗します(ERROR_INVALID_PARAMETERを返します)。この問題に関するドキュメントはインターネットにありません。誰かが間違いがどこにあるか知っていますか?ありがとう。
QList<std::pair<int, int> > versions;
versions << std::pair<int, int>(5, 0);
versions << std::pair<int, int>(5, 1);
versions << std::pair<int, int>(5, 2);
versions << std::pair<int, int>(6, 0);
versions << std::pair<int, int>(6, 1);
QList<int> architectures;
architectures << PROCESSOR_ARCHITECTURE_INTEL << PROCESSOR_ARCHITECTURE_AMD64;
for (int i = 0; i < versions.count(); i++)
{
int major = versions[i].first;
int minor = versions[i].second;
for (int j = 0; j < architectures.count(); j++)
{
int arch = architectures[j];
SP_INF_SIGNER_INFO_V2 signerInfo;
signerInfo.cbSize = sizeof(SP_INF_SIGNER_INFO_V2);
SP_ALTPLATFORM_INFO_V2 altPlatInfo;
altPlatInfo.cbSize = sizeof(SP_ALTPLATFORM_INFO_V2);
altPlatInfo.Platform = VER_PLATFORM_WIN32_NT;
altPlatInfo.MajorVersion = major;
altPlatInfo.MinorVersion = minor;
altPlatInfo.Flags = SP_ALTPLATFORM_FLAGS_VERSION_RANGE;
altPlatInfo.FirstValidatedMajorVersion = major;
altPlatInfo.FirstValidatedMinorVersion = minor;
altPlatInfo.ProcessorArchitecture = arch;
SP_INF_SIGNER_INFO_V2 signerInfo;
signerInfo.cbSize = sizeof(SP_INF_SIGNER_INFO_V2);
bool result = SetupVerifyInfFile((wchar_t*)package.infFilePath.utf16(), 0, &signerInfo);