Damjan Jovanovic : mountmgr: Frame device service functions with IoGetCurrentIrpStackLocation and IoCompleteRequest .
Alexandre Julliard
julliard at winehq.org
Thu Mar 25 11:44:46 CDT 2010
Module: wine
Branch: master
Commit: 63bc9c484a1c5c53e733014e7b874172201d603c
URL: http://source.winehq.org/git/wine.git/?a=commit;h=63bc9c484a1c5c53e733014e7b874172201d603c
Author: Damjan Jovanovic <damjan.jov at gmail.com>
Date: Tue Mar 23 18:08:03 2010 +0200
mountmgr: Frame device service functions with IoGetCurrentIrpStackLocation and IoCompleteRequest.
---
dlls/mountmgr.sys/device.c | 3 ++-
dlls/mountmgr.sys/mountmgr.c | 3 ++-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/dlls/mountmgr.sys/device.c b/dlls/mountmgr.sys/device.c
index bf2bcee..ba5a02b 100644
--- a/dlls/mountmgr.sys/device.c
+++ b/dlls/mountmgr.sys/device.c
@@ -858,7 +858,7 @@ NTSTATUS query_dos_device( int letter, enum device_type *type, char **device, ch
/* handler for ioctls on the harddisk device */
static NTSTATUS WINAPI harddisk_ioctl( DEVICE_OBJECT *device, IRP *irp )
{
- IO_STACK_LOCATION *irpsp = irp->Tail.Overlay.s.u2.CurrentStackLocation;
+ IO_STACK_LOCATION *irpsp = IoGetCurrentIrpStackLocation( irp );
struct disk_device *dev = device->DeviceExtension;
TRACE( "ioctl %x insize %u outsize %u\n",
@@ -904,6 +904,7 @@ static NTSTATUS WINAPI harddisk_ioctl( DEVICE_OBJECT *device, IRP *irp )
}
LeaveCriticalSection( &device_section );
+ IoCompleteRequest( irp, IO_NO_INCREMENT );
return irp->IoStatus.u.Status;
}
diff --git a/dlls/mountmgr.sys/mountmgr.c b/dlls/mountmgr.sys/mountmgr.c
index c92e4a4..87d9007 100644
--- a/dlls/mountmgr.sys/mountmgr.c
+++ b/dlls/mountmgr.sys/mountmgr.c
@@ -351,7 +351,7 @@ done:
/* handler for ioctls on the mount manager device */
static NTSTATUS WINAPI mountmgr_ioctl( DEVICE_OBJECT *device, IRP *irp )
{
- IO_STACK_LOCATION *irpsp = irp->Tail.Overlay.s.u2.CurrentStackLocation;
+ IO_STACK_LOCATION *irpsp = IoGetCurrentIrpStackLocation( irp );
TRACE( "ioctl %x insize %u outsize %u\n",
irpsp->Parameters.DeviceIoControl.IoControlCode,
@@ -390,6 +390,7 @@ static NTSTATUS WINAPI mountmgr_ioctl( DEVICE_OBJECT *device, IRP *irp )
irp->IoStatus.u.Status = STATUS_NOT_SUPPORTED;
break;
}
+ IoCompleteRequest( irp, IO_NO_INCREMENT );
return irp->IoStatus.u.Status;
}
More information about the wine-cvs
mailing list