trying WinVerify fail
From: bayern (bayern_at_discussions.microsoft.com)
Date: 11/26/04
- Next message: Prassi: "Re: Creating a custom CSP"
- Previous message: Valery Pryamikov: "On Evolution of Microsoft Perception of System Security"
- Next in thread: Jeffrey Altman: "Re: trying WinVerify fail"
- Reply: Jeffrey Altman: "Re: trying WinVerify fail"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Date: Fri, 26 Nov 2004 02:25:04 -0800
hi, I have try WinVerify to verify a signed dll.My program is as following.
If the input file doesn't not exist. I can got the routine exit normally. if
the file is exist, I got a messagebox: instruction is refer to '0xcccccccc'
memory, the memory can't be 'read'.
I am using VS.net 1.0, and the platform is win2000. anyone can help?
BOOL VerifyTrust(char * cFileName)
{
if(cFileName == NULL ) return FALSE;
WINTRUST_DATA fTrust;
WINTRUST_FILE_INFO finfo;
wchar_t wFileName[260];
HRESULT ret;
mbstowcs(wFileName, cFileName, 260);
fTrust.pPolicyCallbackData = NULL;
fTrust.pSIPClientData = NULL;
fTrust.dwUIChoice = WTD_UI_NONE;
fTrust.fdwRevocationChecks = WTD_REVOKE_NONE;
fTrust.dwUnionChoice = WTD_CHOICE_FILE;
fTrust.pFile = &finfo;
fTrust.dwStateAction = 0;
fTrust.hWVTStateData = NULL;
fTrust.dwProvFlags = 0;
fTrust.cbStruct = sizeof(fTrust);
finfo.cbStruct = sizeof(finfo);
finfo.pcwszFilePath= wFileName;
finfo.hFile = NULL;
GUID trustAction = WINTRUST_ACTION_GENERIC_VERIFY_V2;
ret = WinVerifyTrust(NULL,&trustAction, &fTrust);
if(ret == ERROR_SUCCESS)
return TRUE;
else
{
char cBuf[40];
sprintf(cBuf, "%X", GetLastError());
::MessageBox(NULL, cBuf, "", MB_OK);
}
return FALSE;
}
- Next message: Prassi: "Re: Creating a custom CSP"
- Previous message: Valery Pryamikov: "On Evolution of Microsoft Perception of System Security"
- Next in thread: Jeffrey Altman: "Re: trying WinVerify fail"
- Reply: Jeffrey Altman: "Re: trying WinVerify fail"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|