BUG: SetNamedSecurityInfo Hangs When Called from DLLMain

ID: Q207779


The information in this article applies to:
  • Microsoft Win32 Application Programming Interface (API), included with:
    • Microsoft Windows NT 4.0
    • Microsoft Windows 2000


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: kbdsupport kbdsh

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


Last Reviewed: January 10, 2000
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.