BUG: SetNamedSecurityInfo Hangs When Called from DLLMain

ID: Q207779


The information in this article applies to:


SYMPTOMS

On Microsoft Windows NT 4.0 Service Pack 4, a process will enter a deadlock state if SetNamedSecurityInfo() is called from DLLMain.


CAUSE

The execution of DLLMain entry point function is serialized. Only one thread at a time can be executing inside DLLMain.

On Service Pack 4, the SetNamedSecurityInfo() API creates a worker thread to do its work and waits until the worker thread exits before returning to the caller. Because a worker thread is created, the system needs to call DLLMain function before executing its thread procedure. This deadlocks because the caller of SetNamedSecurityInfo() is still inside the DllMain function waiting for the API to return.


RESOLUTION

An application should not call the SetNamedSecurityInfo() API inside a DLLMain.


STATUS

This behavior is by design.


MORE INFORMATION

Please see the DLLMain documentation for details on implementing a DLL.

Additional query words:


Keywords          : kbAccCtrl kbAPI kbDLL kbKernBase kbNTOS400 kbSDKPlatform kbSecurity 
Version           : winnt:4.0
Platform          : winnt 
Issue type        : kbbug 

Last Reviewed: February 11, 1999