SCR331-DI Product Technical Manual
8.0 Appendix
C
8.1 Sample Code for using Escape messages through Escape
IOCTL
File Name : T_pupi.H
#ifdef __cplusplus
extern "C" {
#endif
#define IOCTL_CCID_ESCAPE
SCARD_CTL_CODE(0xDAC)
#define
CCID_GET_PUPI_STATUS
0xFF9B
#define
CCID_SET_PUPI_ON
0x019B
#define
CCID_SET_PUPI_OFF
0x009B
#define
MINTIMEOUT
300
#ifdef __cplusplus
}
#endif
File Name : T_pupi.CPP
#include <windows.h>
#include <winbase.h>
#include <stdio.h>
#include <conio.h>
#include "winscard.h"
#include "winerror.h"
#include "T_pupi.H"
VOID main(VOID)
{
SCARDCONTEXT
ContextHandle;
SCARDHANDLE CardHandle;
BYTE
OutByte;
WORD
InWord,i;
DWORD
ActiveProtocol;
/* ICC protocol */
ULONG
InBufLen,ResLen;
ULONG
ret;
SCARD_READERSTATE Reader[1];
IND.SCR331-DI.MANUAL.VER.1.8
VER1.8
Page 33 of 36