Microsoft Usbccid Smartcard Reader -umdf 2- Driver [Best Pick]
WDF_USB_DEVICE_SELECT_CONFIG_PARAMS_INIT_SINGLE_INTERFACE(&configParams, 0); status = WdfUsbTargetDeviceSelectConfig(m_UsbDevice, WDF_NO_OBJECT_ATTRIBUTES, &configParams); if (!NT_SUCCESS(status)) return status;
void UsbCcidDevice::EvtIoDeviceControl(WDFQUEUE Queue, WDFREQUEST Request, size_t OutputBufferLength, size_t InputBufferLength, ULONG IoControlCode) WDFDEVICE device = WdfIoQueueGetDevice(Queue); UsbCcidDevice* context = GetDeviceContext(device); NTSTATUS status = STATUS_NOT_SUPPORTED;
// Callbacks static void EvtDevicePrepareHardware(_In_ WDFDEVICE Device, _In_ WDFCMRESLIST ResourceList); static void EvtDeviceReleaseHardware(_In_ WDFDEVICE Device, _In_ WDFCMRESLIST ResourceList); static void EvtIoDeviceControl(_In_ WDFQUEUE Queue, _In_ WDFREQUEST Request, _In_ size_t OutputBufferLength, _In_ size_t InputBufferLength, _In_ ULONG IoControlCode); private: WDFDEVICE m_Device; WDFUSBDEVICE m_UsbDevice; WDFUSBINTERFACE m_UsbInterface; WDFUSBPIPE m_BulkOutPipe; WDFUSBPIPE m_BulkInPipe; WDFUSBPIPE m_InterruptPipe; WDFQUEUE m_DefaultQueue; ; #include "Device.h" #include "trace.h" NTSTATUS UsbCcidDevice::Create(WDFDRIVER Driver, WDFDEVICE_INIT* DeviceInit, WDFDEVICE* Device) WDF_DEVICE_POWER_POLICY_IDLE_SETTINGS idleSettings; WDF_PNPPOWER_EVENT_CALLBACKS pnpCallbacks; WDF_IO_QUEUE_CONFIG queueConfig; WDF_OBJECT_ATTRIBUTES deviceAttributes; WDFDEVICE device; NTSTATUS status; microsoft usbccid smartcard reader -umdf 2- driver
[WudfServiceInstall] DisplayName=%ServiceDesc% ServiceType=1 StartType=3 ErrorControl=1 ServiceBinary=%12%\WUDFHost.exe
// Get USB pipes m_BulkOutPipe = WdfUsbInterfaceGetConfiguredPipe(m_UsbInterface, 0, NULL); m_BulkInPipe = WdfUsbInterfaceGetConfiguredPipe(m_UsbInterface, 1, NULL); m_InterruptPipe = WdfUsbInterfaceGetConfiguredPipe(m_UsbInterface, 2, NULL); status = WdfUsbTargetDeviceSelectConfig(m_UsbDevice
NTSTATUS UsbCcidDevice::Transmit(PBYTE Command, DWORD CommandLen, PBYTE Response, PDWORD ResponseLen) CCID_TRANSMIT transmitCmd = 0; transmitCmd.bMessageType = PC_to_RDR_XfrBlock; transmitCmd.dwLength = CommandLen; transmitCmd.bSlot = 0; transmitCmd.bSeq = 0; transmitCmd.bBWI = 0; transmitCmd.wLevelParameter = 0;
[Strings] ManufacturerName="Your Company" DeviceDesc="USB CCID Smartcard Reader (UMDF 2)" ServiceDesc="USB CCID Smartcard Reader Service" Device.h #pragma once #include <wdf.h> #include <usb.h> #include <scardlib.h> class UsbCcidDevice public: static NTSTATUS Create( In WDFDRIVER Driver, In WDFDEVICE_INIT* DeviceInit, Out WDFDEVICE* Device); if (!NT_SUCCESS(status)) return status
return STATUS_SUCCESS;
// Configure power management WDF_DEVICE_POWER_POLICY_IDLE_SETTINGS_INIT(&idleSettings, IdleCannotWakeFromS0); WdfDeviceAssignS0IdleSettings(device, &idleSettings);
[Manufacturer] %ManufacturerName% = Standard, NTamd64, NTarm64
Menü
WDF_USB_DEVICE_SELECT_CONFIG_PARAMS_INIT_SINGLE_INTERFACE(&configParams, 0); status = WdfUsbTargetDeviceSelectConfig(m_UsbDevice, WDF_NO_OBJECT_ATTRIBUTES, &configParams); if (!NT_SUCCESS(status)) return status;
void UsbCcidDevice::EvtIoDeviceControl(WDFQUEUE Queue, WDFREQUEST Request, size_t OutputBufferLength, size_t InputBufferLength, ULONG IoControlCode) WDFDEVICE device = WdfIoQueueGetDevice(Queue); UsbCcidDevice* context = GetDeviceContext(device); NTSTATUS status = STATUS_NOT_SUPPORTED;
// Callbacks static void EvtDevicePrepareHardware(_In_ WDFDEVICE Device, _In_ WDFCMRESLIST ResourceList); static void EvtDeviceReleaseHardware(_In_ WDFDEVICE Device, _In_ WDFCMRESLIST ResourceList); static void EvtIoDeviceControl(_In_ WDFQUEUE Queue, _In_ WDFREQUEST Request, _In_ size_t OutputBufferLength, _In_ size_t InputBufferLength, _In_ ULONG IoControlCode); private: WDFDEVICE m_Device; WDFUSBDEVICE m_UsbDevice; WDFUSBINTERFACE m_UsbInterface; WDFUSBPIPE m_BulkOutPipe; WDFUSBPIPE m_BulkInPipe; WDFUSBPIPE m_InterruptPipe; WDFQUEUE m_DefaultQueue; ; #include "Device.h" #include "trace.h" NTSTATUS UsbCcidDevice::Create(WDFDRIVER Driver, WDFDEVICE_INIT* DeviceInit, WDFDEVICE* Device) WDF_DEVICE_POWER_POLICY_IDLE_SETTINGS idleSettings; WDF_PNPPOWER_EVENT_CALLBACKS pnpCallbacks; WDF_IO_QUEUE_CONFIG queueConfig; WDF_OBJECT_ATTRIBUTES deviceAttributes; WDFDEVICE device; NTSTATUS status;
[WudfServiceInstall] DisplayName=%ServiceDesc% ServiceType=1 StartType=3 ErrorControl=1 ServiceBinary=%12%\WUDFHost.exe
// Get USB pipes m_BulkOutPipe = WdfUsbInterfaceGetConfiguredPipe(m_UsbInterface, 0, NULL); m_BulkInPipe = WdfUsbInterfaceGetConfiguredPipe(m_UsbInterface, 1, NULL); m_InterruptPipe = WdfUsbInterfaceGetConfiguredPipe(m_UsbInterface, 2, NULL);
NTSTATUS UsbCcidDevice::Transmit(PBYTE Command, DWORD CommandLen, PBYTE Response, PDWORD ResponseLen) CCID_TRANSMIT transmitCmd = 0; transmitCmd.bMessageType = PC_to_RDR_XfrBlock; transmitCmd.dwLength = CommandLen; transmitCmd.bSlot = 0; transmitCmd.bSeq = 0; transmitCmd.bBWI = 0; transmitCmd.wLevelParameter = 0;
[Strings] ManufacturerName="Your Company" DeviceDesc="USB CCID Smartcard Reader (UMDF 2)" ServiceDesc="USB CCID Smartcard Reader Service" Device.h #pragma once #include <wdf.h> #include <usb.h> #include <scardlib.h> class UsbCcidDevice public: static NTSTATUS Create( In WDFDRIVER Driver, In WDFDEVICE_INIT* DeviceInit, Out WDFDEVICE* Device);
return STATUS_SUCCESS;
// Configure power management WDF_DEVICE_POWER_POLICY_IDLE_SETTINGS_INIT(&idleSettings, IdleCannotWakeFromS0); WdfDeviceAssignS0IdleSettings(device, &idleSettings);
[Manufacturer] %ManufacturerName% = Standard, NTamd64, NTarm64