Required routines
WDM 판독기 드라이버에는 다음 루틴이 필요합니다.
DriverEntry
드라이버 개체와 디스패치 테이블을 초기화합니다.
AddDevice
스마트 카드 판독기용 디바이스 개체를 만듭니다. In addition, AddDevice can call any of the following driver library routines:
- SmartcardInitialize (WDM) to complete driver initialization. Calling this routine in AddDevice is obligatory.
- SmartcardLogError (WDM) to log an error. Drivers must call this routine in AddDevice if SmartcardInitialize (WDM) fails.
- SmartcardCreateLink (WDM) to create a symbolic link for the reader device in the registry.
Unload
시스템에서 드라이버를 제거합니다.
DispatchCreate
-and-
DispatchClose
Supports IRP_MJ_CREATE and IRP_MJ_CLOSE<, respectively. To establish a connection to the reader, the resource manager sends IRP_MJ_CREATE to the reader driver. To sever the connection, the resource manager sends IRP_MJ_CLOSE.
DispatchCleanup
Supports IRP_MJ_CLEANUP, which the resource manager sends to the reader driver to cancel pending I/O requests.
DispatchPnP
Supports IRP_MJ_PNP
DispatchPower
Supports IRP_MJ_POWER.
DispatchDeviceControl
Supports IRP_MJ_DEVICE_CONTROL and is the main entry point for smart card requests. Upon receiving IRP_MJ_DEVICE_CONTROL, DispatchDeviceControl must immediately call SmartcardDeviceControl (WDM), which is the smart card driver library routine that handles device-control requests. 다음 코드 예제에서는 WDM 드라이버에서 이 라이브러리 루틴을 호출하는 방법을 보여줍니다.
NTSTATUS
DriverDeviceControl(
PDEVICE_OBJECT DeviceObject,
PIRP Irp
)
{
PDEVICE_EXTENSION deviceExtension = DeviceObject -> DeviceExtension;
return SmartcardDeviceControl(
&(deviceExtension->SmartcardExtension),
Irp
);
If it is unable to handle the particular IOCTL that is indicated in the call, SmartcardDeviceControl will call the driver's callback for unknown IOCTL requests.