[Wine-patches] [eterhack 07/12] parport.sys: Add support for IOCTL_INTERNAL_PARALLEL_PORT_{ALLOCATE, FREE}.

Alexander Morozov =?iso-8859-1?q?amorozov_=CE=C1_etersoft=2Eru?=
Чт Май 21 17:53:43 MSD 2009


---
 dlls/parport.sys/parport.c |   10 ++++++++++
 include/ddk/parallel.h     |    2 ++
 2 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/dlls/parport.sys/parport.c b/dlls/parport.sys/parport.c
index 2b94d6b..db304a6 100644
--- a/dlls/parport.sys/parport.c
+++ b/dlls/parport.sys/parport.c
@@ -103,6 +103,12 @@ static NTSTATUS WINAPI parport_ioctl( DEVICE_OBJECT *device, IRP *irp )
 
     switch(irpsp->Parameters.DeviceIoControl.IoControlCode)
     {
+    case IOCTL_INTERNAL_PARALLEL_PORT_ALLOCATE:
+        if (parport_try( device->DeviceExtension ))
+            status = STATUS_SUCCESS;
+        else
+            status = STATUS_UNSUCCESSFUL;
+        break;
     case IOCTL_INTERNAL_GET_PARALLEL_PORT_INFO:
     {
         PARALLEL_PORT_INFORMATION *ppi = irp->AssociatedIrp.SystemBuffer;
@@ -130,6 +136,10 @@ static NTSTATUS WINAPI parport_ioctl( DEVICE_OBJECT *device, IRP *irp )
         irp->IoStatus.Information = 0;
         status = STATUS_SUCCESS;
         break;
+    case IOCTL_INTERNAL_PARALLEL_PORT_FREE:
+        parport_free( device->DeviceExtension );
+        status = STATUS_SUCCESS;
+        break;
     default:
         FIXME( "IOCTL %08x is not implemented\n",
                 irpsp->Parameters.DeviceIoControl.IoControlCode );
diff --git a/include/ddk/parallel.h b/include/ddk/parallel.h
index bcde4bf..d6f05d8 100644
--- a/include/ddk/parallel.h
+++ b/include/ddk/parallel.h
@@ -17,8 +17,10 @@
 #ifndef _PARALLEL_
 #define _PARALLEL_
 
+#define IOCTL_INTERNAL_PARALLEL_PORT_ALLOCATE      CTL_CODE(FILE_DEVICE_PARALLEL_PORT, 11, METHOD_BUFFERED, FILE_ANY_ACCESS)
 #define IOCTL_INTERNAL_GET_PARALLEL_PORT_INFO      CTL_CODE(FILE_DEVICE_PARALLEL_PORT, 12, METHOD_BUFFERED, FILE_ANY_ACCESS)
 #define IOCTL_INTERNAL_GET_MORE_PARALLEL_PORT_INFO CTL_CODE(FILE_DEVICE_PARALLEL_PORT, 17, METHOD_BUFFERED, FILE_ANY_ACCESS)
+#define IOCTL_INTERNAL_PARALLEL_PORT_FREE          CTL_CODE(FILE_DEVICE_PARALLEL_PORT, 40, METHOD_BUFFERED, FILE_ANY_ACCESS)
 
 typedef BOOLEAN (WINAPI *PPARALLEL_TRY_ALLOCATE_ROUTINE)(PVOID TryAllocateContext);
 typedef void (WINAPI *PPARALLEL_FREE_ROUTINE)(PVOID FreeContext);
-- 
1.6.2.5



Подробная информация о списке рассылки Wine-patches