DWORD WINAPI S4Control
(
IN SENSE4_CONTEXT *pS4Ctx,
IN DWORD dwCtlCode,
IN VOID *pInBuffer,
IN DWORD dwInBufferLen,
OUT VOID *pOutBuffer,
IN DWORD dwOutBufferLen,
OUT DWORD *pdwBytesReturned
);
#define S4_LED_UP 0x00000004 /** LED up*/
#define S4_LED_DOWN 0x00000008 /** LED down*/
#define S4_LED_WINK 0x00000028 /** LED wink*/
#define S4_GET_DEVICE_TYPE 0x00000025 /** get the device type*/
#define S4_GET_SERIAL_NUMBER 0X00000026 /** get the device serial number*/
#define S4_GET_VM_TYPE 0X00000027 /** get the virtual machine type*/
#define S4_GET_DEVICE_USABLE_SPACE 0x00000029 /** get the total space of the device*/
#define S4_SET_DEVICE_ID 0x0000002a /** set the device ID*/
#define S4_RESET_DEVICE 0x00000002 /** reset the device*/
#define S4_DF_AVAILABLE_SPACE 0x00000031 /** get the free space of current directory*/
#define S4_EF_INFO 0x00000032 /** get specified file information in current directory*/
#define S4_SET_USB_MODE 0x00000041 /** set the device as a normal usb device*/
#define S4_SET_HID_MODE 0x00000042 /** set the device as a HID device*/
#define S4_GET_CUSTOMER_NAME 0x0000002b /** get the customer number*/
#define S4_GET_MANUFACTURE_DATE 0x0000002c /** get the manufacture date of the device*/
#define S4_GET_CURRENT_TIME 0x0000002d /** get the current time of the clock device*/
第四步,更改目录,校验用户pin码,执行锁内程序得到返回值
DWORD WINAPI S4ChangeDir
(
IN SENSE4_CONTEXT *pS4Ctx,
IN LPCSTR lpszPath
);
DWORD WINAPI S4VerifyPin
(
IN SENSE4_CONTEXT *pS4Ctx,
IN BYTE *pbPin,
IN DWORD dwPinLen,
IN DWORD dwPinType
);
DWORD WINAPI S4ExecuteEx
(
IN SENSE4_CONTEXT *pS4Ctx,
IN LPCSTR lpszFileID,
IN DWORD dwFlag,
IN VOID *pInBuffer,
IN DWORD dwInbufferSize,
OUT VOID *pOutBuffer,
IN DWORD dwOutBufferSize,
OUT DWORD *pdwBytesReturned
);
最后处理返回值,关闭设备:
DWORD WINAPI S4Close
(
IN SENSE4_CONTEXT *pS4Ctx
);