I've been trying to create a program to efficiently validate user credentials locally, without the client and server handling LogonUser() provides. I've ran into trouble getting the InitializeSecurityContext() function from both the security.dll and secur32.dll , and have been getting the error message mentioned in the title. I've tried to look at different documentation to see if it is no longer a supported function, but I couldn't find anything that said it was. I'm performing the operation much the same as the Microsoft example here.
How I load the function :
#ifdef UNICODE
security.AcquireCredentialsHandle = ( ACQUIRE_CREDENTIALS_HANDLE_FN )GetProcAddress( hdll, "AcquireCredentialsHandleW" );
security.InitializeSecurityContext = ( INITIALIZE_SECURITY_CONTEXT_FN )GetProcAddress( hdll, "InitializeSecurityContextW" );
security.QuerySecurityPackageInfo = ( QUERY_SECURITY_PACKAGE_INFO_FN )GetProcAddress( hdll, "QuerySecurityPackageInfoW" );
#else
security.AcquireCredentialsHandle = ( ACQUIRE_CREDENTIALS_HANDLE_FN )GetProcAddress( hdll, "AcquireCredentialsHandleA" );
security.QuerySecurityPackageInfo = ( QUERY_SECURITY_PACKAGE_INFO_FN )GetProcAddress( hdll, "QuerySecurityPackageInfoA" );
security.InitializeSecurityContext = ( INITIALIZE_SECURITY_CONTEXT_FN )GetProcAddress( hdll, "InitializeSecurityContextA" );
#endif
My check for errors :
if ( !security.InitializeSecurityContext )
return LoadingError( showError, exit );
All the other functions load without problems.
As a bonus, it would be nice if someone could point out what exactly I need to call to simply authenticate a local username and password. The Microsoft example is a little overwhelming to look through, and I'm not sure what applies to my situation yet. If you guys think that it would be better for me to figure that out on my own, that's fine.