Unable to find an entry point named EnumerateSecurityPackagesW in

T

TRI_CODER

I am trying to solve the following exception. The exception occurs when my
ASP.NET code behind code attemtps to access a remore site using SSL. Please
note that all certificates are valid and the remote site is trusted. Also, my
web site uses a custom HTTPModule implemented in a DLL named Security.dll.

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

Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information about
the error and where it originated in the code.

Exception Details: System.EntryPointNotFoundException: Unable to find an
entry point named EnumerateSecurityPackagesW in DLL security.dll.
 
M

[MSFT]

Hello,

The problem may be related to the name of "Security.dll". You can find a
file with same name in "Windows\System32\" and it is actually part of
Windows OS.

When ASPNET loads your WebRequest code following happens:

Frameworks at one point is doing DllImport inside HttpWebRequest, to call
DllLoadLibrary on Security.dll. When no path is specified, the function
searches for loaded modules whose base name matches the base name of the
module to be
loaded. If the name matches, the load succeeds.

Otherwise, the function searches for the file in the following sequence:
1. The directory from which the application loaded.
2. The current directory.
3. The system directory. Use the GetSystemDirectory function to get
the path of this directory.
4. The Windows directory. Use the GetWindowsDirectory function to
get the path of this directory.
5. The directories that are listed in the PATH environment
variable.

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.

Hope this help

Luke
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top