Author: cfinck
Date: Mon Apr 20 01:42:26 2009
New Revision: 40595
URL:
http://svn.reactos.org/svn/reactos?rev=40595&view=rev
Log:
Merge 40594
Modified:
branches/ros-branch-0_3_9/reactos/base/services/umpnpmgr/umpnpmgr.c
branches/ros-branch-0_3_9/reactos/dll/win32/setupapi/devinst.c
Modified: branches/ros-branch-0_3_9/reactos/base/services/umpnpmgr/umpnpmgr.c
URL:
http://svn.reactos.org/svn/reactos/branches/ros-branch-0_3_9/reactos/base/s…
==============================================================================
--- branches/ros-branch-0_3_9/reactos/base/services/umpnpmgr/umpnpmgr.c [iso-8859-1]
(original)
+++ branches/ros-branch-0_3_9/reactos/base/services/umpnpmgr/umpnpmgr.c [iso-8859-1] Mon
Apr 20 01:42:26 2009
@@ -1097,10 +1097,10 @@
LPWSTR pszDeviceInstance2)
{
CONFIGRET ret = CR_SUCCESS;
+ NTSTATUS Status;
UNREFERENCED_PARAMETER(hBinding);
UNREFERENCED_PARAMETER(ulMinorAction);
- UNREFERENCED_PARAMETER(pszDeviceInstance1);
UNREFERENCED_PARAMETER(pszDeviceInstance2);
DPRINT("PNP_DeviceInstanceAction() called\n");
@@ -1114,10 +1114,15 @@
break;
case PNP_DEVINST_ENABLE:
+ {
+ PLUGPLAY_CONTROL_RESET_DEVICE_DATA ResetDeviceData;
DPRINT("Enable device instance\n");
- /* FIXME */
- ret = CR_CALL_NOT_IMPLEMENTED;
- break;
+ RtlInitUnicodeString(&ResetDeviceData.DeviceInstance,
pszDeviceInstance1);
+ Status = NtPlugPlayControl(PlugPlayControlResetDevice, &ResetDeviceData,
sizeof(PLUGPLAY_CONTROL_RESET_DEVICE_DATA));
+ if (!NT_SUCCESS(Status))
+ ret = NtStatusToCrError(Status);
+ break;
+ }
case PNP_DEVINST_REENUMERATE:
DPRINT("Reenumerate device instance\n");
Modified: branches/ros-branch-0_3_9/reactos/dll/win32/setupapi/devinst.c
URL:
http://svn.reactos.org/svn/reactos/branches/ros-branch-0_3_9/reactos/dll/wi…
==============================================================================
--- branches/ros-branch-0_3_9/reactos/dll/win32/setupapi/devinst.c [iso-8859-1]
(original)
+++ branches/ros-branch-0_3_9/reactos/dll/win32/setupapi/devinst.c [iso-8859-1] Mon Apr 20
01:42:26 2009
@@ -4642,21 +4642,18 @@
IN PSP_DEVINFO_DATA DeviceInfoData)
{
#ifndef __WINESRC__
- PLUGPLAY_CONTROL_RESET_DEVICE_DATA ResetDeviceData;
+ struct DeviceInfoSet *set = (struct DeviceInfoSet *)DeviceInfoSet;
struct DeviceInfo *deviceInfo = (struct DeviceInfo *)DeviceInfoData->Reserved;
- NTSTATUS Status;
-
- if (((struct DeviceInfoSet *)DeviceInfoSet)->HKLM != HKEY_LOCAL_MACHINE)
- {
- /* At the moment, I only know how to start local devices */
- SetLastError(ERROR_INVALID_COMPUTERNAME);
- return FALSE;
- }
-
- RtlInitUnicodeString(&ResetDeviceData.DeviceInstance,
deviceInfo->instanceId);
- Status = NtPlugPlayControl(PlugPlayControlResetDevice, &ResetDeviceData,
sizeof(PLUGPLAY_CONTROL_RESET_DEVICE_DATA));
- SetLastError(RtlNtStatusToDosError(Status));
- return NT_SUCCESS(Status);
+ CONFIGRET cr;
+
+ cr = CM_Enable_DevNode_Ex(deviceInfo->dnDevInst, 0, set->hMachine);
+ if (cr != CR_SUCCESS)
+ {
+ SetLastError(GetErrorCodeFromCrCode(cr));
+ return FALSE;
+ }
+
+ return TRUE;
#else
FIXME("Stub: ResetDevice(%p %p)\n", DeviceInfoSet, DeviceInfoData);
return TRUE;