// Send control transfer status = WdfUsbTargetDeviceSendControlTransferSynchronously( UsbDevice, WDF_NO_HANDLE, // Optional WDFREQUEST WDF_NO_HANDLE, // Optional send options &setupPacket, NULL, // Optional memory NULL, // Optional offset &bytesTransferred );
SP_DEVICE_INTERFACE_DATA interfaceData; interfaceData.cbSize = sizeof(SP_DEVICE_INTERFACE_DATA);
// Initialize USB device create config WDF_USB_DEVICE_CREATE_CONFIG_INIT(&usbConfig, USBD_CLIENT_CONTRACT_VERSION_602);
INCLUDES=$(INCLUDES);.
typedef struct _CAMERA_STATUS ULONG Zoom; ULONG Focus; ULONG Exposure; BOOLEAN IsStreaming; CAMERA_STATUS, *PCAMERA_STATUS;
// Helper function to send vendor-specific USB control transfer NTSTATUS SendVendorCommand( In WDFUSBDEVICE UsbDevice, In UCHAR Command, In ULONG Value )
return STATUS_SUCCESS; VOID EagleEyeEvtIoDeviceControl( _In_ WDFQUEUE Queue, _In_ WDFREQUEST Request, _In_ size_t OutputBufferLength, _In_ size_t InputBufferLength, _In_ ULONG IoControlCode ) eagle eye mini camera driver windows 10
PDEVICE_CONTEXT deviceContext; WDF_USB_DEVICE_CREATE_CONFIG usbConfig; WDF_USB_DEVICE_SELECT_CONFIG_PARAMS configParams; WDF_USB_INTERFACE_SELECT_SETTING_PARAMS settingParams; WDF_OBJECT_ATTRIBUTES usbAttributes; NTSTATUS status; UCHAR i; UNREFERENCED_PARAMETER(ResourceList); UNREFERENCED_PARAMETER(ResourceListTranslated);
// Get pipes for (i = 0; i < WdfUsbInterfaceGetNumPipes(deviceContext->UsbInterface); i++) WDF_USB_PIPE_INFO pipeInfo; WDF_USB_PIPE_INFO_INIT(&pipeInfo); status = WdfUsbInterfaceGetConfiguredPipe(deviceContext->UsbInterface, i, &pipeInfo); if (NT_SUCCESS(status)) // Check pipe type if (WdfUsbPipeTypeBulk == pipeInfo.PipeType) USBD_PIPE_INFORMATION pipeInfoUsb; WdfUsbTargetPipeGetInformation(pipeInfo.Pipe, &pipeInfoUsb); if (pipeInfoUsb.EndpointAddress & USB_ENDPOINT_DIRECTION_IN) deviceContext->BulkReadPipe = pipeInfo.Pipe; KdPrint(("Bulk IN pipe found\n")); else deviceContext->BulkWritePipe = pipeInfo.Pipe; KdPrint(("Bulk OUT pipe found\n")); else if (WdfUsbPipeTypeInterrupt == pipeInfo.PipeType) deviceContext->InterruptPipe = pipeInfo.Pipe; KdPrint(("Interrupt pipe found\n"));
CloseHandle(hCamera); return 0; !include $(NTMAKEENV)\makefile.def TARGETNAME=EagleEyeMini TARGETTYPE=DRIVER TARGETPATH=obj // Optional WDFREQUEST WDF_NO_HANDLE
SOURCES=Driver.c Device.c Usb.c Ioctl.c
WDF_DRIVER_CONFIG_INIT(&config, EagleEyeEvtDeviceAdd);
WDF_USB_CONTROL_SETUP_PACKET setupPacket; WDF_MEMORY memory; NTSTATUS status; ULONG bytesTransferred; // Optional send options &setupPacket
// Set device type as exclusive (camera) WdfDeviceInitSetDeviceType(DeviceInit, FILE_DEVICE_VIDEO);