trying WinVerify fail

From: bayern (bayern_at_discussions.microsoft.com)
Date: 11/26/04


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;
}



Relevant Pages

  • Re: moving data from one place to another in a text file
    ... practical solution - as any solution requiring "memory allocation" canNOT handle ... And, of course, the "read twice method" would be portable to EVERY ANSI/ISO ... >>output the same input file with another name. ...
    (comp.lang.cobol)
  • Re: NEWBIE - Create array variables depending upon input file
    ... > Ie in my data file I have a time when a car enters my study area, ... everything is turned into bits and bytes in memory. ... lines in your input file, ...
    (alt.comp.lang.learn.c-cpp)
  • Re: Delete a line
    ... - read next record from input fileinto memory ... awk will not by itself modify an input file in place. ... keeps the results in an array in memory; ... This will fail if the amount of data doesn't fit in memory, ...
    (comp.lang.awk)
  • Re: Memory Management extremely poor in C# when manipulating string..
    ... I've tried every memory ... it runs up to 200+ Megs footprint and then starts throwing Out ... and write it to the file when done with the input file. ... Anyway you seem to hold too much strings in memory before writing to the ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: How does "new" work in a loop?
    ... garbage collector can release memory. ... My program seems to work fine, but I'm wondering about this loop: ... the array has a different size each time the input file size changes, ...
    (microsoft.public.dotnet.languages.csharp)