using functions from schannel.dll
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: using functions from schannel.dll

  1. #1
    Join Date
    Mar 2009
    Posts
    4

    using functions from schannel.dll

    Hi,
    I am working on a project which requires me to clear the SsleCache. I have found a way to do this through schannel.dll.
    A sample of my code:


    typedef BOOL (*EmptyCachePtr)(LPSTR pszTargetName, DWORD dwFlags);

    HMODULE hSchannel;
    hSchannel = LoadLibrary("TEXT("schannel.dll"));

    emptyCache = (EmptyCacheFuncPtr) GetProcAddress(hChannel, "SslEmptyCacheA");

    if(emptyCache != NULL)
    {
    emptyCache(NULL, 0)l
    }

    FreeLibrary(hSchannel);

    The code compiles fine, but then when I run it it appears to run fine untill the end of the method where it moves into code which I can't see and crashes with a memory access error: 0xC0000005: Access violation writing location 0xfffffffd.

    If anyone needs more info let me know

    So... can anyone help me with why this code bugs out?
    Cheers

    Ed

  2. #2
    Join Date
    Mar 2009
    Posts
    4

    Re: using functions from schannel.dll

    Also, some of the time I get an error: A buffer overrun has occurred in .exe which has corrupted the program's internal state. Press break to debug or continue to terminate

  3. #3
    Join Date
    Mar 2009
    Posts
    4

    Re: using functions from schannel.dll

    FIXED: The problem was in the typedef:

    It should not include the variable names.
    It should be:
    typedef BOOL (WINAPI *EMPTYPTR)(LPSTR, DWORD);

    method:
    {
    .....

    emptyPtr = (EMPTYPTR) GetProcAddress(hSchannelDll, TEXT("SslEmptyCacheA"));

    BOOL ret = emptyPtr(NULL, 0);
    .....
    }

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Azure Activities Information Page

Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center