Microsoft KB Archive/813838

= Device Installation Scheduled as Part of GUIRunOnce Stops Responding (Hangs) =

Article ID: 813838

Article Last Modified on 12/3/2007

-

APPLIES TO


 * Microsoft Windows Server 2003, 64-Bit Datacenter Edition
 * Microsoft Windows Server 2003, Enterprise x64 Edition
 * Microsoft Windows Server 2003, Datacenter Edition (32-bit x86)
 * Microsoft Windows Server 2003, Enterprise Edition (32-bit x86)
 * Microsoft Windows Server 2003, Standard Edition (32-bit x86)
 * Microsoft Windows Server 2003, Web Edition
 * Microsoft Windows XP Professional x64 Edition
 * Microsoft Windows XP Home Edition
 * Microsoft Windows XP Professional
 * Microsoft Windows Small Business Server 2003 Standard Edition
 * Microsoft Windows Small Business Server 2003 Premium Edition

-





SYMPTOMS
On a Microsoft Windows XP-based or Windows Server 2003-based computer, a device installation that is scheduled as part of the GUIRunOnce process may appear to stop responding (hang). Also, other GUIRunOnce entries may appear to be processed out of order.



CAUSE
This issue occurs because on a Windows XP-based or Windows Server 2003-based computer, a device installation that is scheduled as part of the GUIRunOnce process must wait until all the GUIRunOnce entries are processed before it returns. This behavior is different than from Microsoft Windows 2000. In Windows 2000, a device installation that is scheduled as part of GUIRunOnce does not process any additional GUIRunOnce entries, and because of this, returns immediately.



WORKAROUND
To work around this issue if you must install a device during GUIRunOnce processing, use a single GUIRunOnce entry. This single GUIRunOnce entry can specify an .inf file that contains all the tasks that must be performed during GUIRunOnce processing. To use a single GUIRunOnce entry:  Create an .inf file that includes a [DefaultInstall] section that contains one or more RegisterDlls entries, and lists the executable files to run in the referenced sections. RegisterDlls is documented in the Driver Development Kit (DDK), and runs executable files (.exe) and Dynamic Link Library files. Add a GUIRunOnce entry that calls Rundll32.exe to process the .inf file:

%WINDIR%\System32\Runonce.exe %WINDIR%\System32\Setupapi.dll,InstallHinfSection 132 c:\ \





MORE INFORMATION
In Windows XP and Windows Server 2003, GUIRunOnce entries are added to the   registry key as REG_EXPAND_SZ values. Windows processes   entries in the following two locations in the Windows code:
 * In Explorer.exe, which processes   entries during the logon process. This includes the first operating system start-up after Setup completes, which is when GUI-RunOnce entries are processed.
 * In Runonce.exe, which is initiated by the SetupAPI component that performs device installations, and that may be initiated by other components.

In Windows 2000, Runonce.exe and Windows Explorer's   processing behaves differently because they are two different and independent sets of code. Among the differences:
 * Windows 2000 Explorer.exe processes both REG_SZ and REG_EXPAND_SZ   entries.
 * Runonce.exe processes REG_SZ   entries, but not REG_EXPAND_SZ entries.

GUIRunOnce entries are written as REG_EXPAND_SZ entries, and so on Windows 2000, are processed by Explorer.exe's   processing, but are skipped by Runonce.exe.

In Windows XP and Windows Server 2003, the   processing code was consolidated so that now Runonce.exe also processes REG_EXPAND_SZ entries.

For additional information about how to use RunOnce entries for device driver installation, click the following article number to view the article in the Microsoft Knowledge Base:

281820 INFO: Specifying RunOnce in Device INF Files

Keywords: kbprb KB813838

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.