Author: cgutman Date: Fri Aug 20 04:45:25 2010 New Revision: 48574
URL: http://svn.reactos.org/svn/reactos?rev=48574&view=rev Log: [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
Modified: trunk/reactos/ntoskrnl/io/iomgr/deviface.c
Modified: trunk/reactos/ntoskrnl/io/iomgr/deviface.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/io/iomgr/deviface.... ============================================================================== --- trunk/reactos/ntoskrnl/io/iomgr/deviface.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/io/iomgr/deviface.c [iso-8859-1] Fri Aug 20 04:45:25 2010 @@ -731,11 +731,6 @@ } KeyName.Length = KeyName.MaximumLength = (USHORT)bip->DataLength - 4 * sizeof(WCHAR); 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 */ if (ReturnBuffer.Length + KeyName.Length + sizeof(WCHAR) > ReturnBuffer.MaximumLength) @@ -1232,6 +1227,7 @@ UNICODE_STRING KeyName; OBJECT_ATTRIBUTES ObjectAttributes; ULONG LinkedValue; + GUID DeviceGuid;
if (SymbolicLinkName == NULL) return STATUS_INVALID_PARAMETER_1; @@ -1309,13 +1305,20 @@ DPRINT1("IoGetDeviceObjectPointer() failed with status 0x%08lx\n", 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; IopNotifyPlugPlayNotification( PhysicalDeviceObject, EventCategoryDeviceInterfaceChange, EventGuid, - &GuidString, + &DeviceGuid, (PVOID)SymbolicLinkName);
ObDereferenceObject(FileObject);