Author: pschweitzer
Date: Mon Oct 27 02:34:02 2008
New Revision: 37012
URL:
http://svn.reactos.org/svn/reactos?rev=37012&view=rev
Log:
FsRtlNotifyVolumeEvent:
- IoReportTargetDeviceChangeAsynchronous is only called for mount event. For the rest,
call IoReportTargetDeviceChange
- Fixed a mistake in status return (even if it's not perfect, because of the FIXME)
Modified:
branches/pierre-fsd/ntoskrnl/fsrtl/pnp.c
Modified: branches/pierre-fsd/ntoskrnl/fsrtl/pnp.c
URL:
http://svn.reactos.org/svn/reactos/branches/pierre-fsd/ntoskrnl/fsrtl/pnp.c…
==============================================================================
--- branches/pierre-fsd/ntoskrnl/fsrtl/pnp.c [iso-8859-1] (original)
+++ branches/pierre-fsd/ntoskrnl/fsrtl/pnp.c [iso-8859-1] Mon Oct 27 02:34:02 2008
@@ -39,10 +39,11 @@
IN ULONG EventCode)
{
LPGUID Guid = NULL;
- NTSTATUS Status = STATUS_SUCCESS;
+ NTSTATUS Status = STATUS_INVALID_PARAMETER;
PDEVICE_OBJECT DeviceObject = NULL;
TARGET_DEVICE_CUSTOM_NOTIFICATION Notification;
+ /* FIXME: We should call IoGetRelatedTargetDevice here */
DeviceObject = IoGetRelatedDeviceObject(FileObject);
if (DeviceObject)
{
@@ -85,20 +86,26 @@
Guid = (LPGUID)&GUID_IO_VOLUME_UNLOCK;
break;
}
- default:
- {
- Status = STATUS_INVALID_PARAMETER;
- break;
- }
}
if (Guid)
{
/* Copy GUID to notification structure and then report the change */
RtlCopyMemory(&(Notification.Event), Guid, sizeof(GUID));
- IoReportTargetDeviceChangeAsynchronous(DeviceObject,
- &Notification,
- NULL,
- NULL);
+
+ if (EventCode == FSRTL_VOLUME_MOUNT)
+ {
+ IoReportTargetDeviceChangeAsynchronous(DeviceObject,
+ &Notification,
+ NULL,
+ NULL);
+ }
+ else
+ {
+ IoReportTargetDeviceChange(DeviceObject,
+ &Notification);
+ }
+
+ Status = STATUS_SUCCESS;
}
ObfDereferenceObject(DeviceObject);
}