Author: cgutman
Date: Sat Feb 4 18:39:09 2012
New Revision: 55416
URL:
http://svn.reactos.org/svn/reactos?rev=55416&view=rev
Log:
[USBD]
- Add and fix missing exports
- Add UNIMPLEMENTED to unimplemented functions
- Fix completely broken USBD_GetPdoRegistryParameter (which wasn't even exported
because somebody made a typo and couldn't figure it out)
- My Linksys USB300M driver now loads but it runs into some unimplemented code paths in
usbehci
Modified:
branches/usb-bringup-trunk/drivers/usb/usbd/usbd.c
branches/usb-bringup-trunk/drivers/usb/usbd/usbd.spec
Modified: branches/usb-bringup-trunk/drivers/usb/usbd/usbd.c
URL:
http://svn.reactos.org/svn/reactos/branches/usb-bringup-trunk/drivers/usb/u…
==============================================================================
--- branches/usb-bringup-trunk/drivers/usb/usbd/usbd.c [iso-8859-1] (original)
+++ branches/usb-bringup-trunk/drivers/usb/usbd/usbd.c [iso-8859-1] Sat Feb 4 18:39:09
2012
@@ -102,6 +102,7 @@
PVOID NTAPI
USBD_AllocateDeviceName(ULONG Unknown)
{
+ UNIMPLEMENTED
return NULL;
}
@@ -139,6 +140,7 @@
ULONG NTAPI
USBD_Dispatch(ULONG Unknown1, ULONG Unknown2, ULONG Unknown3, ULONG Unknown4)
{
+ UNIMPLEMENTED
return 1;
}
@@ -148,6 +150,7 @@
VOID NTAPI
USBD_FreeDeviceMutex(PVOID Unknown)
{
+ UNIMPLEMENTED
}
/*
@@ -156,6 +159,7 @@
VOID NTAPI
USBD_FreeDeviceName(PVOID Unknown)
{
+ UNIMPLEMENTED
}
/*
@@ -164,6 +168,7 @@
VOID NTAPI
USBD_WaitDeviceMutex(PVOID Unknown)
{
+ UNIMPLEMENTED
}
/*
@@ -172,6 +177,7 @@
ULONG NTAPI
USBD_GetSuspendPowerState(ULONG Unknown1)
{
+ UNIMPLEMENTED
return 0;
}
@@ -182,6 +188,7 @@
USBD_InitializeDevice(ULONG Unknown1, ULONG Unknown2, ULONG Unknown3,
ULONG Unknown4, ULONG Unknown5, ULONG Unknown6)
{
+ UNIMPLEMENTED
return STATUS_NOT_SUPPORTED;
}
@@ -193,6 +200,7 @@
ULONG Unknown4, ULONG Unknown5, ULONG Unknown6, ULONG Unknown7,
ULONG Unknown8, ULONG Unknown9, ULONG Unknown10)
{
+ UNIMPLEMENTED
return STATUS_NOT_SUPPORTED;
}
@@ -202,6 +210,7 @@
NTSTATUS NTAPI
USBD_GetDeviceInformation(ULONG Unknown1, ULONG Unknown2, ULONG Unknown3)
{
+ UNIMPLEMENTED
return STATUS_NOT_SUPPORTED;
}
@@ -212,6 +221,7 @@
USBD_CreateDevice(ULONG Unknown1, ULONG Unknown2, ULONG Unknown3,
ULONG Unknown4, ULONG Unknown5)
{
+ UNIMPLEMENTED
return STATUS_NOT_SUPPORTED;
}
@@ -221,6 +231,7 @@
NTSTATUS NTAPI
USBD_RemoveDevice(ULONG Unknown1, ULONG Unknown2, ULONG Unknown3)
{
+ UNIMPLEMENTED
return STATUS_NOT_SUPPORTED;
}
@@ -230,6 +241,7 @@
VOID NTAPI
USBD_CompleteRequest(ULONG Unknown1, ULONG Unknown2)
{
+ UNIMPLEMENTED
}
/*
@@ -241,6 +253,7 @@
PDEVICE_OBJECT FilterDeviceObject
)
{
+ UNIMPLEMENTED
}
/*
@@ -249,6 +262,7 @@
VOID NTAPI
USBD_SetSuspendPowerState(ULONG Unknown1, ULONG Unknown2)
{
+ UNIMPLEMENTED
}
/*
@@ -257,6 +271,7 @@
NTSTATUS NTAPI
USBD_MakePdoName(ULONG Unknown1, ULONG Unknown2)
{
+ UNIMPLEMENTED
return STATUS_NOT_SUPPORTED;
}
@@ -269,6 +284,7 @@
PULONG CurrentFrame
)
{
+ UNIMPLEMENTED
return STATUS_NOT_SUPPORTED;
}
@@ -283,7 +299,7 @@
if (Version != NULL)
{
Version->USBDI_Version = USBDI_VERSION;
- Version->Supported_USB_Version = 0x100;
+ Version->Supported_USB_Version = 0x200;
}
}
@@ -293,6 +309,7 @@
NTSTATUS NTAPI
USBD_RestoreDevice(ULONG Unknown1, ULONG Unknown2, ULONG Unknown3)
{
+ UNIMPLEMENTED
return STATUS_NOT_SUPPORTED;
}
@@ -303,6 +320,7 @@
USBD_RegisterHcDeviceCapabilities(ULONG Unknown1, ULONG Unknown2,
ULONG Unknown3)
{
+ UNIMPLEMENTED
}
/*
@@ -586,28 +604,58 @@
NTSTATUS Status;
HANDLE DevInstRegKey;
+ /* Open the device key */
Status = IoOpenDeviceRegistryKey(PhysicalDeviceObject,
- PLUGPLAY_REGKEY_DRIVER, STANDARD_RIGHTS_ALL, &DevInstRegKey);
+ PLUGPLAY_REGKEY_DEVICE, STANDARD_RIGHTS_ALL, &DevInstRegKey);
if (NT_SUCCESS(Status))
{
- PKEY_VALUE_FULL_INFORMATION FullInfo;
+ PKEY_VALUE_PARTIAL_INFORMATION PartialInfo;
UNICODE_STRING ValueName;
ULONG Length;
- RtlInitUnicodeString(&ValueName, KeyName);
- Length = ParameterLength + KeyNameLength + sizeof(KEY_VALUE_FULL_INFORMATION);
- FullInfo = ExAllocatePool(PagedPool, Length);
- if (FullInfo)
+ /* Initialize the unicode string based on caller data */
+ ValueName.Buffer = KeyName;
+ ValueName.Length = ValueName.MaximumLength = KeyNameLength;
+
+ Length = ParameterLength + sizeof(KEY_VALUE_PARTIAL_INFORMATION);
+ PartialInfo = ExAllocatePool(PagedPool, Length);
+ if (PartialInfo)
{
Status = ZwQueryValueKey(DevInstRegKey, &ValueName,
- KeyValueFullInformation, FullInfo, Length, &Length);
+ KeyValuePartialInformation, PartialInfo, Length, &Length);
+ if (Status == STATUS_BUFFER_OVERFLOW || Status == STATUS_BUFFER_TOO_SMALL)
+ {
+ /* The caller doesn't want all the data */
+ ExFreePool(PartialInfo);
+ PartialInfo = ExAllocatePool(PagedPool, Length);
+ if (PartialInfo)
+ {
+ Status = ZwQueryValueKey(DevInstRegKey, &ValueName,
+ KeyValuePartialInformation, PartialInfo, Length, &Length);
+ }
+ else
+ {
+ Status = STATUS_NO_MEMORY;
+ }
+ }
+
if (NT_SUCCESS(Status))
{
+ /* Compute the length to copy back */
+ if (ParameterLength < PartialInfo->DataLength)
+ Length = ParameterLength;
+ else
+ Length = PartialInfo->DataLength;
+
RtlCopyMemory(Parameter,
- ((PUCHAR)FullInfo) + FullInfo->DataOffset,
- ParameterLength /*FullInfo->DataLength*/);
+ PartialInfo->Data,
+ Length);
}
- ExFreePool(FullInfo);
+
+ if (PartialInfo)
+ {
+ ExFreePool(PartialInfo);
+ }
} else
Status = STATUS_NO_MEMORY;
ZwClose(DevInstRegKey);
Modified: branches/usb-bringup-trunk/drivers/usb/usbd/usbd.spec
URL:
http://svn.reactos.org/svn/reactos/branches/usb-bringup-trunk/drivers/usb/u…
==============================================================================
--- branches/usb-bringup-trunk/drivers/usb/usbd/usbd.spec [iso-8859-1] (original)
+++ branches/usb-bringup-trunk/drivers/usb/usbd/usbd.spec [iso-8859-1] Sat Feb 4 18:39:09
2012
@@ -1,5 +1,6 @@
@ stdcall USBD_Debug_GetHeap(long long long long)
@ stdcall USBD_Debug_RetHeap(ptr long long)
+@ stdcall USBD_Debug_LogEntry(ptr ptr ptr ptr)
@ stdcall USBD_CalculateUsbBandwidth(long long long)
@ stdcall USBD_CreateConfigurationRequestEx(ptr ptr)
@ stdcall USBD_CreateConfigurationRequest(ptr ptr)
@@ -7,4 +8,6 @@
@ stdcall USBD_ParseConfigurationDescriptor(ptr long long)
@ stdcall USBD_ParseConfigurationDescriptorEx(ptr ptr long long long long long)
@ stdcall USBD_ParseDescriptors(ptr long ptr long)
-;USBD_GetPdoRegistryParameters
+@ stdcall USBD_GetPdoRegistryParameter(ptr ptr long ptr long)
+@ stdcall USBD_GetUSBDIVersion(ptr)
+@ stdcall USBD_QueryBusTime(ptr ptr)