From 3e45266afd6083444c247614180af30edce00f6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Poussineau?= Date: Sat, 8 Oct 2005 15:52:14 +0000 Subject: [PATCH] Restart the device after its installation svn path=/trunk/; revision=18337 --- reactos/lib/setupapi/devinst.c | 33 ++++++++++++++------------------- 1 file changed, 14 insertions(+), 19 deletions(-) diff --git a/reactos/lib/setupapi/devinst.c b/reactos/lib/setupapi/devinst.c index 7dd210bd3a3..a7dfad819ea 100644 --- a/reactos/lib/setupapi/devinst.c +++ b/reactos/lib/setupapi/devinst.c @@ -24,22 +24,14 @@ #include -#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 #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 #include "setupapi_private.h" @@ -4790,14 +4782,17 @@ nextfile: goto cleanup; } - /* Load the driver/call AddDevice */ - FIXME("FIXME: Load the driver/call AddDevice\n"); - - /* 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; + /* 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; cleanup: /* End of installation */