=?UTF-8?Q?Andr=C3=A9=20Hentschel=20?=: usbd.sys: Add partial USBD_ValidateConfigurationDescriptor implementation.
Alexandre Julliard
julliard at winehq.org
Wed Aug 29 15:01:39 CDT 2012
Module: wine
Branch: master
Commit: c540c98d55d2354cd3a6c37a480c0180b9327826
URL: http://source.winehq.org/git/wine.git/?a=commit;h=c540c98d55d2354cd3a6c37a480c0180b9327826
Author: André Hentschel <nerv at dawncrow.de>
Date: Tue Aug 28 23:27:40 2012 +0200
usbd.sys: Add partial USBD_ValidateConfigurationDescriptor implementation.
---
dlls/usbd.sys/usbd.c | 20 ++++++++++++++++++++
dlls/usbd.sys/usbd.sys.spec | 2 ++
include/ddk/usbdlib.h | 1 +
3 files changed, 23 insertions(+), 0 deletions(-)
diff --git a/dlls/usbd.sys/usbd.c b/dlls/usbd.sys/usbd.c
index 80fd02e..daf49cf 100644
--- a/dlls/usbd.sys/usbd.c
+++ b/dlls/usbd.sys/usbd.c
@@ -218,6 +218,26 @@ PUSB_COMMON_DESCRIPTOR WINAPI USBD_ParseDescriptors(
return NULL;
}
+USBD_STATUS WINAPI USBD_ValidateConfigurationDescriptor(
+ PUSB_CONFIGURATION_DESCRIPTOR descr,
+ ULONG length,
+ USHORT level,
+ PUCHAR *offset,
+ ULONG tag )
+{
+ FIXME( "(%p, %u, %u, %p, %u) partial stub!", descr, length, level, offset, tag );
+
+ if (offset) *offset = 0;
+
+ if (!descr ||
+ length < sizeof(USB_CONFIGURATION_DESCRIPTOR) ||
+ descr->bLength < sizeof(USB_CONFIGURATION_DESCRIPTOR) ||
+ descr->wTotalLength < descr->bNumInterfaces * sizeof(USB_CONFIGURATION_DESCRIPTOR)
+ ) return USBD_STATUS_ERROR;
+
+ return USBD_STATUS_SUCCESS;
+}
+
ULONG WINAPI USBD_GetInterfaceLength(
PUSB_INTERFACE_DESCRIPTOR InterfaceDescriptor,
PUCHAR BufferEnd )
diff --git a/dlls/usbd.sys/usbd.sys.spec b/dlls/usbd.sys/usbd.sys.spec
index 1cb507e..15cf352 100644
--- a/dlls/usbd.sys/usbd.sys.spec
+++ b/dlls/usbd.sys/usbd.sys.spec
@@ -16,6 +16,7 @@
@ stub USBD_GetDeviceInformation
@ stdcall USBD_GetInterfaceLength(ptr ptr)
@ stub USBD_GetPdoRegistryParameter
+@ stub USBD_GetRegistryKeyValue
@ stub USBD_GetSuspendPowerState
@ stdcall USBD_GetUSBDIVersion(ptr)
@ stub USBD_InitializeDevice
@@ -30,4 +31,5 @@
@ stub USBD_RemoveDevice
@ stub USBD_RestoreDevice
@ stub USBD_SetSuspendPowerState
+@ stdcall USBD_ValidateConfigurationDescriptor(ptr long long ptr long)
@ stub USBD_WaitDeviceMutex
diff --git a/include/ddk/usbdlib.h b/include/ddk/usbdlib.h
index 0003816..86080ce 100644
--- a/include/ddk/usbdlib.h
+++ b/include/ddk/usbdlib.h
@@ -31,5 +31,6 @@ ULONG WINAPI USBD_GetInterfaceLength(PUSB_INTERFACE_DESCRIPTOR,PUCHAR);
VOID WINAPI USBD_GetUSBDIVersion(PUSBD_VERSION_INFORMATION);
PUSB_COMMON_DESCRIPTOR WINAPI USBD_ParseDescriptors(PVOID,ULONG,PVOID,LONG);
PUSB_INTERFACE_DESCRIPTOR WINAPI USBD_ParseConfigurationDescriptorEx(PUSB_CONFIGURATION_DESCRIPTOR,PVOID,LONG,LONG,LONG,LONG,LONG);
+USBD_STATUS WINAPI USBD_ValidateConfigurationDescriptor(PUSB_CONFIGURATION_DESCRIPTOR,ULONG,USHORT,PUCHAR*,ULONG);
#endif
More information about the wine-cvs
mailing list