Sample code (pc/sc 2.0 part 10), Appendix d. sample code (pc/sc 2.0 part 10) – ACS ACR83 PINeasy Smart Card Reader User Manual

Page 42

Advertising
background image

ACR83 – Reference Manual

[email protected]

Version 1.05

www.acs.com.hk

Page 42 of 49

Appendix D. Sample Code (PC/SC 2.0 Part 10)

#include <stdio.h>

#include <stdlib.h>

#include <windows.h>

#include <winscard.h>

#define FEATURE_VERIFY_PIN_START 0x01

#define FEATURE_VERIFY_PIN_FINISH 0x02

#define FEATURE_MODIFY_PIN_START 0x03

#define FEATURE_MODIFY_PIN_FINISH 0x04

#define FEATURE_GET_KEY_PRESSED 0x05

#define FEATURE_VERIFY_PIN_DIRECT 0x06

#define FEATURE_MODIFY_PIN_DIRECT 0x07

#define FEATURE_MCT_READERDIRECT 0x08

#define FEATURE_MCT_UNIVERSAL 0x09

#define FEATURE_IFD_PIN_PROP 0x0A

#define FEATURE_ABORT 0x0B

#define FEATURE_SIZE (FEATURE_ABORT + 1)

#define IOCTL_SMARTCARD_GET_FIRMWARE_VERSION SCARD_CTL_CODE(2078)

#define IOCTL_SMARTCARD_DISPLAY_LCD_MESSAGE SCARD_CTL_CODE(2079)

#define IOCTL_SMARTCARD_READ_KEY SCARD_CTL_CODE(2080)

#define CM_IOCTL_GET_FEATURE_REQUEST SCARD_CTL_CODE(3400)

#pragma pack(push, 1)

typedef struct _PIN_VERIFY_STRUCTURE {

BYTE bTimeOut;

BYTE bTimeOut2;

BYTE bmFormatString;

BYTE bmPINBlockString;

BYTE bmPINLengthFormat;

USHORT wPINMaxExtraDigit;

BYTE bEntryValidationCondition;

BYTE bNumberMessage;

USHORT wLangId;

BYTE bMsgIndex;

BYTE bTeoPrologue[3];

ULONG ulDataLength;

BYTE abData[1];

} PIN_VERIFY_STRUCTURE, *PPIN_VERIFY_STRUCTURE;

typedef struct _PIN_MODIFY_STRUCTURE {

BYTE bTimeOut;

BYTE bTimeOut2;

BYTE bmFormatString;

BYTE bmPINBlockString;

BYTE bmPINLengthFormat;

BYTE bInsertionOffsetOld;

BYTE bInsertionOffsetNew;

USHORT wPINMaxExtraDigit;

BYTE bConfirmPIN;

BYTE bEntryValidationCondition;

BYTE bNumberMessage;

USHORT wLangId;

BYTE bMsgIndex1;

BYTE bMsgIndex2;

BYTE bMsgIndex3;

BYTE bTeoPrologue[3];

ULONG ulDataLength;

Advertising