Lines Matching refs:pUrb

52     PURB pUrb = (PURB)vboxUsbToolMemAlloc(cbSize);
53 Assert(pUrb);
54 if (!pUrb)
57 pUrb->UrbHeader.Length = cbSize;
58 pUrb->UrbHeader.Function = u16Function;
59 return pUrb;
64 PURB pUrb = (PURB)vboxUsbToolMemAllocZ(cbSize);
65 Assert(pUrb);
66 if (!pUrb)
69 pUrb->UrbHeader.Length = cbSize;
70 pUrb->UrbHeader.Function = u16Function;
71 return pUrb;
74 VBOXUSBTOOL_DECL(PURB) VBoxUsbToolUrbReinit(PURB pUrb, USHORT cbSize, USHORT u16Function)
76 Assert(pUrb->UrbHeader.Length == cbSize);
77 if (pUrb->UrbHeader.Length < cbSize)
79 pUrb->UrbHeader.Length = cbSize;
80 pUrb->UrbHeader.Function = u16Function;
81 return pUrb;
84 VBOXUSBTOOL_DECL(VOID) VBoxUsbToolUrbFree(PURB pUrb)
86 vboxUsbToolMemFree(pUrb);
89 VBOXUSBTOOL_DECL(NTSTATUS) VBoxUsbToolUrbPost(PDEVICE_OBJECT pDevObj, PURB pUrb, ULONG dwTimeoutMs)
92 return VBoxUsbToolIoInternalCtlSendSync(pDevObj, IOCTL_INTERNAL_USB_SUBMIT_URB, pUrb, NULL);
93 return VBoxUsbToolIoInternalCtlSendSyncWithTimeout(pDevObj, IOCTL_INTERNAL_USB_SUBMIT_URB, pUrb, NULL, dwTimeoutMs);
100 PURB pUrb = VBoxUsbToolUrbAllocZ(URB_FUNCTION_GET_DESCRIPTOR_FROM_DEVICE, cbUrb);
101 if(!pUrb)
111 pUrb->UrbHeader.Function = URB_FUNCTION_GET_DESCRIPTOR_FROM_DEVICE;
112 pUrb->UrbHeader.Length = sizeof(struct _URB_CONTROL_DESCRIPTOR_REQUEST);
113 pUrb->UrbControlDescriptorRequest.TransferBufferLength = cbBuffer;
114 pUrb->UrbControlDescriptorRequest.TransferBuffer = pvBuffer;
115 pUrb->UrbControlDescriptorRequest.Index = (UCHAR)iIndex;
116 pUrb->UrbControlDescriptorRequest.DescriptorType = (UCHAR)Type;
117 pUrb->UrbControlDescriptorRequest.LanguageId = (USHORT)LangId;
119 Status = VBoxUsbToolUrbPost(pDevObj, pUrb, dwTimeoutMs);
122 VBoxUsbToolUrbFree(pUrb);
259 PURB pUrb = VBoxUsbToolUrbAlloc(u16Function, sizeof (struct _URB_PIPE_REQUEST));
260 if (!pUrb)
265 pUrb->UrbPipeRequest.PipeHandle = hPipe;
266 pUrb->UrbPipeRequest.Reserved = 0;
268 NTSTATUS Status = VBoxUsbToolUrbPost(pDevObj, pUrb, RT_INDEFINITE_WAIT);
269 if (!NT_SUCCESS(Status) || !USBD_SUCCESS(pUrb->UrbHeader.Status))
271 AssertMsgFailed((__FUNCTION__": vboxUsbToolRequest failed with %x (%x)\n", Status, pUrb->UrbHeader.Status));
274 VBoxUsbToolUrbFree(pUrb);
308 PURB pUrb = VBoxUsbToolUrbAlloc(URB_FUNCTION_SELECT_CONFIGURATION, cbUrb);
309 Assert(pUrb);
310 if (!pUrb)
313 UsbBuildSelectConfigurationRequest(pUrb, (USHORT)cbUrb, NULL);
315 NTSTATUS Status = VBoxUsbToolUrbPost(pDevObj, pUrb, RT_INDEFINITE_WAIT);
318 VBoxUsbToolUrbFree(pUrb);