mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 20:15:59 +00:00
[NTOSKRNL]
- The trailing NULL is NOT included in the string length - IopNotifyPlugPlayNotification needs a pointer to an actual GUID not a UNICODE_STRING - The Power Manager can now see ACPI power devices again - ROS will now do a graceful shutdown and power off if the power button is pressed and ACPI is enabled svn path=/trunk/; revision=48574
This commit is contained in:
parent
1883a6f208
commit
5122323eb8
1 changed files with 9 additions and 6 deletions
|
@ -731,11 +731,6 @@ IoGetDeviceInterfaces(IN CONST GUID *InterfaceClassGuid,
|
||||||
}
|
}
|
||||||
KeyName.Length = KeyName.MaximumLength = (USHORT)bip->DataLength - 4 * sizeof(WCHAR);
|
KeyName.Length = KeyName.MaximumLength = (USHORT)bip->DataLength - 4 * sizeof(WCHAR);
|
||||||
KeyName.Buffer = &((PWSTR)bip->Data)[4];
|
KeyName.Buffer = &((PWSTR)bip->Data)[4];
|
||||||
if (KeyName.Length && KeyName.Buffer[KeyName.Length / sizeof(WCHAR)] == UNICODE_NULL)
|
|
||||||
{
|
|
||||||
/* Remove trailing NULL */
|
|
||||||
KeyName.Length -= sizeof(WCHAR);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Add new symbolic link to symbolic link list */
|
/* Add new symbolic link to symbolic link list */
|
||||||
if (ReturnBuffer.Length + KeyName.Length + sizeof(WCHAR) > ReturnBuffer.MaximumLength)
|
if (ReturnBuffer.Length + KeyName.Length + sizeof(WCHAR) > ReturnBuffer.MaximumLength)
|
||||||
|
@ -1232,6 +1227,7 @@ IoSetDeviceInterfaceState(IN PUNICODE_STRING SymbolicLinkName,
|
||||||
UNICODE_STRING KeyName;
|
UNICODE_STRING KeyName;
|
||||||
OBJECT_ATTRIBUTES ObjectAttributes;
|
OBJECT_ATTRIBUTES ObjectAttributes;
|
||||||
ULONG LinkedValue;
|
ULONG LinkedValue;
|
||||||
|
GUID DeviceGuid;
|
||||||
|
|
||||||
if (SymbolicLinkName == NULL)
|
if (SymbolicLinkName == NULL)
|
||||||
return STATUS_INVALID_PARAMETER_1;
|
return STATUS_INVALID_PARAMETER_1;
|
||||||
|
@ -1310,12 +1306,19 @@ IoSetDeviceInterfaceState(IN PUNICODE_STRING SymbolicLinkName,
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Status = RtlGUIDFromString(&GuidString, &DeviceGuid);
|
||||||
|
if (!NT_SUCCESS(Status))
|
||||||
|
{
|
||||||
|
DPRINT1("RtlGUIDFromString() failed with status 0x%08lx\n", Status);
|
||||||
|
return Status;
|
||||||
|
}
|
||||||
|
|
||||||
EventGuid = Enable ? &GUID_DEVICE_INTERFACE_ARRIVAL : &GUID_DEVICE_INTERFACE_REMOVAL;
|
EventGuid = Enable ? &GUID_DEVICE_INTERFACE_ARRIVAL : &GUID_DEVICE_INTERFACE_REMOVAL;
|
||||||
IopNotifyPlugPlayNotification(
|
IopNotifyPlugPlayNotification(
|
||||||
PhysicalDeviceObject,
|
PhysicalDeviceObject,
|
||||||
EventCategoryDeviceInterfaceChange,
|
EventCategoryDeviceInterfaceChange,
|
||||||
EventGuid,
|
EventGuid,
|
||||||
&GuidString,
|
&DeviceGuid,
|
||||||
(PVOID)SymbolicLinkName);
|
(PVOID)SymbolicLinkName);
|
||||||
|
|
||||||
ObDereferenceObject(FileObject);
|
ObDereferenceObject(FileObject);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue