[Wine-patches] [eterhack] [eter-1.0.12] mountmgr.sys: Add URB_FUNCTION_GET_CONFIGURATION support.
Alexander Morozov
amorozov на etersoft.ru
Ср Авг 24 14:20:34 MSD 2011
----------- следующая часть -----------
From ab11fc3b5ec9bbb83c8655a325cab0abd34d5246 Mon Sep 17 00:00:00 2001
From: Alexander Morozov <amorozov на etersoft.ru>
Date: Wed, 24 Aug 2011 00:22:24 +0400
Subject: [PATCH] mountmgr.sys: Add URB_FUNCTION_GET_CONFIGURATION support.
---
dlls/mountmgr.sys/usbhub.c | 55 ++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 55 insertions(+), 0 deletions(-)
diff --git a/dlls/mountmgr.sys/usbhub.c b/dlls/mountmgr.sys/usbhub.c
index 4911e53..698cf7b 100644
--- a/dlls/mountmgr.sys/usbhub.c
+++ b/dlls/mountmgr.sys/usbhub.c
@@ -768,6 +768,33 @@ static NTSTATUS WINAPI usbhub_internal_ioctl( DEVICE_OBJECT *device, IRP *irp )
}
}
break;
+ case URB_FUNCTION_GET_CONFIGURATION:
+ {
+ struct _URB_CONTROL_GET_CONFIGURATION_REQUEST *request =
+ &urb->u.UrbControlGetConfigurationRequest;
+ char *buf = request->TransferBuffer;
+ libusb_device_handle *husb;
+ int ret, config;
+
+ TRACE( "URB_FUNCTION_GET_CONFIGURATION\n" );
+
+ if (buf == NULL && request->TransferBufferMDL != NULL)
+ buf = request->TransferBufferMDL->MappedSystemVa;
+ if (buf == NULL || request->TransferBufferLength < 1)
+ {
+ status = STATUS_INVALID_PARAMETER;
+ break;
+ }
+ if (!libusb_open( inst->dev, &husb ))
+ {
+ ret = libusb_get_configuration( husb, &config );
+ libusb_close( husb );
+ if (ret < 0) break;
+ *buf = config;
+ status = STATUS_SUCCESS;
+ }
+ }
+ break;
default:
FIXME( "unsupported URB function %x\n", urb->u.UrbHeader.Function );
}
@@ -1121,6 +1148,34 @@ static NTSTATUS WINAPI usbhub_internal_ioctl( DEVICE_OBJECT *device, IRP *irp )
}
}
break;
+ case URB_FUNCTION_GET_CONFIGURATION:
+ {
+ struct _URB_CONTROL_GET_CONFIGURATION_REQUEST *request =
+ &urb->u.UrbControlGetConfigurationRequest;
+ char *buf = request->TransferBuffer;
+ usb_dev_handle *husb;
+ int ret;
+
+ TRACE( "URB_FUNCTION_GET_CONFIGURATION\n" );
+
+ if (buf == NULL && request->TransferBufferMDL != NULL)
+ buf = request->TransferBufferMDL->MappedSystemVa;
+ if (buf == NULL || request->TransferBufferLength < 1)
+ {
+ status = STATUS_INVALID_PARAMETER;
+ break;
+ }
+ husb = usb_open( inst->dev );
+ if (husb)
+ {
+ ret = usb_control_msg( husb, 1 << 7,
+ USB_REQ_GET_CONFIGURATION, 0, 0, buf, 1, 0 );
+ if (ret >= 0)
+ status = STATUS_SUCCESS;
+ usb_close( husb );
+ }
+ }
+ break;
default:
FIXME( "unsupported URB function %x\n", urb->u.UrbHeader.Function );
}
--
1.5.6.5
Подробная информация о списке рассылки Wine-patches