Hamed Moayeri
Hamed Moayeri

Reputation: 83

Unable to find security.dll library on class library application

I trying to use ssl connection on class library application but i tried to authenticate as a client to server i got following error message.

"Unable to find an entry point named 'EnumerateSecurityPackagesW' in DLL 'security.dll'."

Have any body experience about this?

Upvotes: 1

Views: 446

Answers (1)

Harsh
Harsh

Reputation: 3751

Security.dll is also the same name for the Windows DLL containing the SSPI implementation, which is used for authentication. When loading DLLs, the local bin directory will be checked before the Windows directory. As a result, your System.dll is being loaded instead of the SSPI System.dll.

So if in certain situations your custom Security.dll is loaded before c:\winnt\system32\security.dll then LoadLibrary thinks it has the dll already loaded (since it's just a Win32 Dll, only name matter, NOT version information). But as we know this is not the correct dll and hence the problem.

The workaround is to change the dll name.

Upvotes: 1

Related Questions