Author: hpoussin
Date: Thu Dec 27 23:51:53 2007
New Revision: 31470
URL:
http://svn.reactos.org/svn/reactos?rev=31470&view=rev
Log:
Add traces
Modified:
trunk/reactos/base/services/umpnpmgr/umpnpmgr.c
trunk/reactos/dll/win32/newdev/newdev.c
Modified: trunk/reactos/base/services/umpnpmgr/umpnpmgr.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/services/umpnpmgr/ump…
==============================================================================
--- trunk/reactos/base/services/umpnpmgr/umpnpmgr.c (original)
+++ trunk/reactos/base/services/umpnpmgr/umpnpmgr.c Thu Dec 27 23:51:53 2007
@@ -1494,6 +1494,8 @@
NTSTATUS Status;
BOOL DeviceInstalled = FALSE;
+ DPRINT("InstallDevice(%S, %d)\n", DeviceInstance, ShowWizard);
+
RtlInitUnicodeString(&PlugPlayData.DeviceInstance,
DeviceInstance);
PlugPlayData.Operation = 0; /* Get status */
@@ -1503,25 +1505,40 @@
(PVOID)&PlugPlayData,
sizeof(PLUGPLAY_CONTROL_STATUS_DATA));
if (!NT_SUCCESS(Status))
+ {
+ DPRINT1("NtPlugPlayControl('%S') failed with status 0x%08lx\n",
DeviceInstance, Status);
return FALSE;
+ }
if ((PlugPlayData.DeviceStatus & (DNF_STARTED | DNF_START_FAILED)) != 0)
+ {
/* Device is already started, or disabled due to some problem. Don't install
it */
+ DPRINT("No need to install '%S'\n", DeviceInstance);
return TRUE;
+ }
/* Install device */
SetEnvironmentVariableW(L"USERPROFILE", L"."); /* FIXME: why is
it needed? */
hNewDev = LoadLibraryW(L"newdev.dll");
if (!hNewDev)
+ {
+ DPRINT1("Unable to load newdev.dll\n");
goto cleanup;
+ }
DevInstallW = (PDEV_INSTALL_W)GetProcAddress(hNewDev,
(LPCSTR)"DevInstallW");
if (!DevInstallW)
+ {
+ DPRINT1("'DevInstallW' not found in newdev.dll\n");
goto cleanup;
+ }
if (!DevInstallW(NULL, NULL, DeviceInstance, ShowWizard ? SW_SHOWNOACTIVATE :
SW_HIDE))
+ {
+ DPRINT1("DevInstallW('%S') failed\n", DeviceInstance);
goto cleanup;
+ }
DeviceInstalled = TRUE;
@@ -1660,8 +1677,6 @@
UNREFERENCED_PARAMETER(lpParameter);
showWizard = !SetupIsActive() && !IsConsoleBoot();
-
- SetEnvironmentVariable(L"USERPROFILE", L"."); /* FIXME: why is it
needed? */
while (TRUE)
{
Modified: trunk/reactos/dll/win32/newdev/newdev.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/newdev/newdev.c?…
==============================================================================
--- trunk/reactos/dll/win32/newdev/newdev.c (original)
+++ trunk/reactos/dll/win32/newdev/newdev.c Thu Dec 27 23:51:53 2007
@@ -643,6 +643,8 @@
DWORD config_flags;
BOOL retval = FALSE;
+ TRACE("(%p, %p, %s, %d)\n", hWndParent, hInstance, debugstr_w(InstanceId),
Show);
+
if (!IsUserAdmin())
{
/* XP kills the process... */
@@ -731,6 +733,7 @@
if (config_flags & CONFIGFLAG_FAILEDINSTALL)
{
/* The device is disabled */
+ TRACE("Device is disabled\n");
retval = TRUE;
goto cleanup;
}
@@ -748,6 +751,7 @@
{
/* Driver found ; install it */
retval = InstallCurrentDriver(DevInstData);
+ TRACE("InstallCurrentDriver() returned %d\n", retval);
if (retval && Show != SW_HIDE)
{
/* Should we display the 'Need to reboot' page? */
@@ -759,7 +763,10 @@
&installParams))
{
if (installParams.Flags & (DI_NEEDRESTART | DI_NEEDREBOOT))
+ {
+ TRACE("Displaying 'Reboot' wizard page\n");
retval = DisplayWizard(DevInstData, hWndParent, IDD_NEEDREBOOT);
+ }
}
}
goto cleanup;
@@ -767,10 +774,12 @@
else if (Show == SW_HIDE)
{
/* We can't show the wizard. Fail the install */
+ TRACE("No wizard\n");
goto cleanup;
}
/* Prepare the wizard, and display it */
+ TRACE("Need to show install wizard\n");
retval = DisplayWizard(DevInstData, hWndParent, IDD_WELCOMEPAGE);
cleanup: