[ros-diffs] [hpoussin] 18337: Restart the device after its installation

hpoussin at svn.reactos.com hpoussin at svn.reactos.com
Sat Oct 8 17:52:24 CEST 2005


Restart the device after its installation
Modified: trunk/reactos/lib/setupapi/devinst.c
  _____  

Modified: trunk/reactos/lib/setupapi/devinst.c
--- trunk/reactos/lib/setupapi/devinst.c	2005-10-08 15:20:13 UTC
(rev 18336)
+++ trunk/reactos/lib/setupapi/devinst.c	2005-10-08 15:52:14 UTC
(rev 18337)
@@ -24,22 +24,14 @@

 
 #include <stdarg.h>
 
-#include "windef.h"
-#include "winbase.h"
-#include "winnt.h"
-#include "winreg.h"
-#include "winternl.h"
-#include "wingdi.h"
-#include "winuser.h"
-#include "winnls.h"
+#include <windows.h>
 #include "setupapi.h"
 #include "wine/debug.h"
 #include "wine/unicode.h"
 #include "cfgmgr32.h"
 #include "initguid.h"
-#include "winioctl.h"
-#include "rpc.h"
-#include "rpcdce.h"
+#define NTOS_MODE_USER
+#include <ndk/ntndk.h>
 
 #include "setupapi_private.h"
 
@@ -4790,15 +4782,18 @@
        goto cleanup;
     }
 
-    /* Load the driver/call AddDevice */
-    FIXME("FIXME: Load the driver/call AddDevice\n");
+    /* Start the device */
+    if (!RebootRequired && !(Flags & (DI_NEEDRESTART | DI_NEEDREBOOT |
DI_DONOTCALLCONFIGMG)))
+    {
+        PLUGPLAY_CONTROL_RESET_DEVICE_DATA ResetDeviceData;
+        NTSTATUS Status;
+        RtlInitUnicodeString(&ResetDeviceData.DeviceInstance,
DevInfo->DeviceName);
+        Status = NtPlugPlayControl(PlugPlayControlResetDevice,
&ResetDeviceData, sizeof(PLUGPLAY_CONTROL_RESET_DEVICE_DATA));
+        ret = NT_SUCCESS(Status);
+    }
+    else
+        ret = TRUE;
 
-    /* Send IRP_MN_START_DEVICE if needed */
-    //if (!RebootRequired && !(Flags & (DI_NEEDRESTART | DI_NEEDREBOOT
| DI_DONOTCALLCONFIGMG)))
-        FIXME("FIXME: Send IRP_MN_START_DEVICE\n");
-
-   ret = TRUE;
-
 cleanup:
     /* End of installation */
     if (hClassKey != INVALID_HANDLE_VALUE)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.reactos.org/pipermail/ros-diffs/attachments/20051008/f98c84e8/attachment.html


More information about the Ros-diffs mailing list