Emir Krkic

Hi,

I am developing an application in C++ that uses TCP to communicate to a another server application. I use Visual C++ 6 ( i will not upgrade! )

This application uses an impersonation to be able to check the permissions on the server side. This has been nice and secure and it has been working for ages. Now suddenly it does not work on Vista. It crashes with ACCESS_VIOLATION somwhere in Secur32.dll and this is when I try to call QuerySecurityPackageInfoW(). MSDN does not have any information that I am doing something wrong in this case, but this is how the code looks and it has been like this for ages:

HINSTANCE dll = ::LoadLibrary("secur32.dll"); // This succeeds and evrything looks good

FARPROC pfnInit = ::GetProcAddress(dll, "InitSecurityInterfaceW");

PSecurityFunctionTable functionTable = (PSecurityFunctionTable)pfnInit(); // Function table looks correct, all the functions are there...

SECURITY_STATUS ss;
PSecPkgInfoW pPkgInfo;
QuerySecurityPackageInfoW(PACKAGE_NAME, &pPkgInfo); // Here is the explosion...

Looks like: SECUR32! 755621f40() ACCESS_VIOLATION

User access thing is turned off and it is Vista Buisiness 32 bit. Did I point out that this worked on all other versions of Windows ( which actually does not mean that the code is correct or good) but at the time this was written this was the only/recommended way to do this.

To point it out again, I cant find any information how to do this now. Even if it has changed it should not crash with access_violation!

And one more thing, I tried to change it so it does not load the dll dynamicly, so it just calls the methods directly and link staticly, still the same problem....

Thanks for help, I am getting frustrated!



Re: Security for Applications in Windows Vista ACCESS_VIOLATION in secur32.dll

kannansiemens

Did you get any solution for this