Microsoft KB Archive/225102

{|
 * width="100%"|

PRB: "Failed initialization on Comctl32.dll" from a Service

 * }

Q225102

-

The information in this article applies to:


 * Microsoft Win32 Application Programming Interface (API), on platform(s):
 * Microsoft Windows NT Server versions 4.0, 4.0 SP4
 * Microsoft Windows NT Workstation versions 4.0, 4.0 SP4

-

SYMPTOMS
When creating a console-mode application via CreateProcess or CreateProcessAsUser from a service, a large number of instances may cause failure when initializing Comctl32.dll.

CAUSE
This is a result of the behavior of CreateProcess when invoked from a service. By default, CreateProcess and CreateProcessAsUser create a new console window that has its own instance of Comctl32.dll. Because the desktop heap is fixed to only 48 MB in size, this can rapidly consume the entire desktop heap. Even though this console window may be completely invisible, and on its own (phantom) desktop, it still loads its own instance of Comctl32.dll.

RESOLUTION
The console-mode application must be created as a detached process, if possible, and with the CREATE_NO_WINDOW flag. This method prevents the creation of the window and consumes far fewer resources.

STATUS
This behavior is by design.

Additional query words:

Keywords : kbCtrl kbOSWinNT400 kbSDKPlatform kbSDKWin32 kbGrpDSUser

Issue type : kbprb

Technology : kbAudDeveloper kbWin32sSearch kbWin32API