static void DumpInterface(const BUSBInterface* interface) { if (!interface) return; printf(" Class .............. 0x%02x (%s)\n", interface->Class(), ClassName(interface->Class())); printf(" Subclass ........... 0x%02x%s\n", interface->Subclass(), SubclassName(interface->Class(), interface->Subclass())); printf(" Protocol ........... 0x%02x%s\n", interface->Protocol(), ProtocolName(interface->Class(), interface->Subclass(), interface->Protocol())); printf(" Interface String ... \"%s\"\n", interface->InterfaceString()); for (uint32 i = 0; i < interface->CountEndpoints(); i++) { const BUSBEndpoint* endpoint = interface->EndpointAt(i); if (!endpoint) continue; printf(" [Endpoint %" B_PRIu32 "]\n", i); printf(" MaxPacketSize .... %d\n", endpoint->MaxPacketSize()); printf(" Interval ......... %d\n", endpoint->Interval()); if (endpoint->IsControl()) printf(" Type ............. Control\n"); else if (endpoint->IsBulk()) printf(" Type ............. Bulk\n"); else if (endpoint->IsIsochronous()) printf(" Type ............. Isochronous\n"); else if (endpoint->IsInterrupt()) printf(" Type ............. Interrupt\n"); if (endpoint->IsInput()) printf(" Direction ........ Input\n"); else printf(" Direction ........ Output\n"); } char buffer[256]; usb_descriptor* generic = (usb_descriptor*)buffer; for (uint32 i = 0; interface->OtherDescriptorAt(i, generic, 256) == B_OK; i++) { printf(" [Descriptor %" B_PRIu32 "]\n", i); DumpDescriptor(&generic->generic, interface->Class(), interface->Subclass()); } }
VOID dg( HANDLE CurrentProcess, HANDLE CurrentThread, DWORD CurrentPc, PWINDBG_EXTENSION_APIS ExtensionApis, LPSTR ArgumentString ) /*++ Routine Description: Arguments: CurrentProcess -- Supplies a handle to the current process CurrentThread -- Supplies a handle to the current thread CurrentPc -- Supplies the current program counter. (may be meaningless) ExtensionApis -- Supplies pointers to ntsd support routines ArgumentString -- Supplies the arguments passed to the command Return Value: None. --*/ { UNREFERENCED_PARAMETER(CurrentPc); hCurrentProcess = CurrentProcess; hCurrentThread = CurrentThread; lpArgumentString = ArgumentString; SETUP_WINDBG_POINTERS(ExtensionApis); DumpDescriptor(); }