📄 bulltlp3.h
字号:
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//
// Use of this source code is subject to the terms of the Microsoft end-user
// license agreement (EULA) under which you licensed this SOFTWARE PRODUCT.
// If you did not accept the terms of the EULA, you are not authorized to use
// this source code. For a copy of the EULA, please see the LICENSE.RTF on your
// install media.
//
/*++
Module Name:
scrcp8t.h
Abstract:
smartcard TLP3 serial miniport defines and structures
Author:
Revision History:
--*/
#ifndef _BULLTLP3_
#define _BULLTLP3_
#define MAXIMUM_SERIAL_READERS 4
#define SMARTCARD_READ SCARD_CTL_CODE( 0x800)
#define SMARTCARD_WRITE SCARD_CTL_CODE( 0x801)
#define IOCTL_INIT_COMPLETE SCARD_CTL_CODE( 0x810 )
#define READ_INTERVAL_TIMEOUT_DEFAULT 1000
#define READ_TOTAL_TIMEOUT_CONSTANT_DEFAULT 3000
#define READ_INTERVAL_TIMEOUT_ATR 0
#define READ_TOTAL_TIMEOUT_CONSTANT_ATR 50
#define READER_CMD_POWER_DOWN 'O'
#define READER_CMD_COLD_RESET 'C'
#define READER_CMD_WARM_RESET 'W'
#ifndef REG_PATH_LEN
#define REG_PATH_LEN 256
#endif
typedef enum _READER_POWER_STATE {
PowerReaderUnspecified = 0,
PowerReaderWorking,
PowerReaderOff
} READER_POWER_STATE, *PREADER_POWER_STATE;
typedef struct _SERIAL_READER_CONFIG {
// Baud rate , line control, control char and etc.
DCB SerialControlBlock;
// read/write timeouts
COMMTIMEOUTS Timeouts;
// Event serial reader uses to signal insert/removal
ULONG SerialWaitMask;
} SERIAL_READER_CONFIG, *PSERIAL_READER_CONFIG;
//
// Define the reader specific portion of the smart card extension
//
typedef struct _READER_EXTENSION {
// IoRequest to be send to serial driver
ULONG SerialIoControlCode;
ULONG CardStatus;
// Current reader power state.
READER_POWER_STATE ReaderPowerState;
// following fields are specific to WinCE driver
LONG d_RefCount; // count the number of references to the device
// backgroud thread for track modem status change.
HANDLE hBackgroundThread;
DWORD dwThreadID;
UINT d_uReaderState; // state of device (STATE_OPENED, STATE_CLOSED, etc
HANDLE hSerialPort; // Serial Port Handle and its name.
TCHAR d_SerialPort[DEVNAME_LEN];
TCHAR d_ActivePath[REG_PATH_LEN]; // registry path to active device
} READER_EXTENSION, *PREADER_EXTENSION;
#define PL131_STATE_NOCARD 0 /*driver disabled*/
#define PL131_STATE_ACTIVECARD 1 /*no card currently inserted*/
#define PL131_STATE_INACTIVECARD 2 /*card not active*/
#define PL131_STATE_WAITATR 3 /*wait for ATR sequence to start*/
#define PL131_STATE_READATR 4 /*wait for ATR sequence to end*/
#define PL131_STATE_READY 5 /*card ready for action*/
#define READER_EXTENSION(member) (SmartcardExtension->ReaderExtension->member)
//
// Prototypes
//
NTSTATUS
TLP3ReaderPower( PSMARTCARD_EXTENSION SmartcardExtension );
NTSTATUS
TLP3SetProtocol( PSMARTCARD_EXTENSION SmartcardExtension );
NTSTATUS
TLP3TransmitT0( PSMARTCARD_EXTENSION SmartcardExtension );
NTSTATUS
TLP3Transmit( PSMARTCARD_EXTENSION SmartcardExtension );
NTSTATUS
TLP3CardTracking( PSMARTCARD_EXTENSION SmartcardExtension );
NTSTATUS
TLP3VendorIoctl( PSMARTCARD_EXTENSION SmartcardExtension );
void POWERDOWN();
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -