/* Copyright (c) 1990-2000 Microsoft Corporation Module Name: scredir.idl Abstract: This module defines idl used to redirect the Smart Card Subsystem for Terminal Services. Revision History: --*/ import "unknwn.idl"; [ uuid (A35AF600-9CF4-11CD-A076-08002B2BD711), version(1.0), pointer_default(unique) ] interface type_scard_pack { const short ATR_SIZE = 32; // // Packing for calls that use the same params // typedef struct _REDIR_SCARDCONTEXT { [range(0, 16)] DWORD cbContext; // 16 == size of a pointer on 128-bit system [unique] [size_is(cbContext)] BYTE *pbContext; } REDIR_SCARDCONTEXT; typedef struct _REDIR_SCARDHANDLE { REDIR_SCARDCONTEXT Context; [range(0, 16)] DWORD cbHandle; // 16 == size of a pointer on 128-bit system [size_is(cbHandle)] BYTE *pbHandle; } REDIR_SCARDHANDLE; typedef struct _Long_Return { LONG ReturnCode; } Long_Return; typedef struct _LongAndMultiString_Return { LONG ReturnCode; [range(0, 65336)] DWORD cBytes; // 64k should always be large enough [unique] [size_is(cBytes)] BYTE *msz; } ListReaderGroups_Return, ListReaders_Return; typedef struct _Context_Call { REDIR_SCARDCONTEXT Context; } Context_Call; typedef struct _ContextAndStringA_Call { REDIR_SCARDCONTEXT Context; LPCSTR sz; } ContextAndStringA_Call; typedef struct _ContextAndStringW_Call { REDIR_SCARDCONTEXT Context; LPCWSTR sz; } ContextAndStringW_Call; typedef struct _ContextAndTwoStringA_Call { REDIR_SCARDCONTEXT Context; LPCSTR sz1; LPCSTR sz2; } ContextAndTwoStringA_Call; typedef struct _ContextAndTwoStringW_Call { REDIR_SCARDCONTEXT Context; LPCWSTR sz1; LPCWSTR sz2; } ContextAndTwoStringW_Call; // // Call specific packing // typedef struct _EstablishContext_Call { DWORD dwScope; } EstablishContext_Call; typedef struct _EstablishContext_Return { LONG ReturnCode; REDIR_SCARDCONTEXT Context; } EstablishContext_Return; typedef struct _ListReaderGroups_Call { REDIR_SCARDCONTEXT Context; BOOL fmszGroupsIsNULL; DWORD cchGroups; } ListReaderGroups_Call; typedef struct _ListReaders_Call { REDIR_SCARDCONTEXT Context; [range(0, 65336)] DWORD cBytes; // 64k should always be large enough [unique] [size_is(cBytes)] const BYTE *mszGroups; BOOL fmszReadersIsNULL; DWORD cchReaders; } ListReaders_Call; typedef struct _ReaderState_Common_Call { DWORD dwCurrentState; DWORD dwEventState; DWORD cbAtr; BYTE rgbAtr[36]; } ReaderState_Common_Call; typedef struct _ReaderStateA { LPCSTR szReader; ReaderState_Common_Call Common; } ReaderStateA; typedef struct _ReaderStateW { LPCWSTR szReader; ReaderState_Common_Call Common; } ReaderStateW; typedef struct _ReaderState_Return { DWORD dwCurrentState; DWORD dwEventState; DWORD cbAtr; BYTE rgbAtr[36]; } ReaderState_Return; typedef struct _LocateCardsA_Call { REDIR_SCARDCONTEXT Context; [range(0, 65336)] DWORD cBytes; // 64k should always be large enough [size_is(cBytes)] const BYTE *mszCards; [range(0, 10)] DWORD cReaders; // 10 == MAXIMUM_SMARTCARD_READERS [size_is(cReaders)] ReaderStateA *rgReaderStates; } LocateCardsA_Call; typedef struct _LocateCardsW_Call { REDIR_SCARDCONTEXT Context; [range(0, 65336)] DWORD cBytes; // 64k should always be large enough [size_is(cBytes)] const BYTE *mszCards; [range(0, 10)] DWORD cReaders; // 10 == MAXIMUM_SMARTCARD_READERS [size_is(cReaders)] ReaderStateW *rgReaderStates; } LocateCardsW_Call; typedef struct _LocateCards_ATRMask { DWORD cbAtr; BYTE rgbAtr[36]; BYTE rgbMask[36]; } LocateCards_ATRMask; typedef struct _LocateCardsByATRA_Call { REDIR_SCARDCONTEXT Context; [range(0, 1000)] DWORD cAtrs; // 1000 types of cards... come on!! Never! [size_is(cAtrs)] LocateCards_ATRMask *rgAtrMasks; [range(0, 10)] DWORD cReaders; // 10 == MAXIMUM_SMARTCARD_READERS [size_is(cReaders)] ReaderStateA *rgReaderStates; } LocateCardsByATRA_Call; typedef struct _LocateCardsByATRW_Call { REDIR_SCARDCONTEXT Context; [range(0, 1000)] DWORD cAtrs; // 1000 types of cards... come on!! Never! [size_is(cAtrs)] LocateCards_ATRMask *rgAtrMasks; [range(0, 10)] DWORD cReaders; // 10 == MAXIMUM_SMARTCARD_READERS [size_is(cReaders)] ReaderStateW *rgReaderStates; } LocateCardsByATRW_Call; typedef struct _LocateCards_Return { LONG ReturnCode; [range(0, 10)] DWORD cReaders; // 10 == MAXIMUM_SMARTCARD_READERS [size_is(cReaders)] ReaderState_Return *rgReaderStates; } LocateCards_Return, GetStatusChange_Return; typedef struct _GetStatusChangeA_Call { REDIR_SCARDCONTEXT Context; DWORD dwTimeOut; [range(0, 11)] DWORD cReaders; // 11 == MAXIMUM_SMARTCARD_READERS + 1 for PnP Reader [size_is(cReaders)] ReaderStateA *rgReaderStates; } GetStatusChangeA_Call; typedef struct _GetStatusChangeW_Call { REDIR_SCARDCONTEXT Context; DWORD dwTimeOut; [range(0, 11)] DWORD cReaders; // 11 == MAXIMUM_SMARTCARD_READERS + 1 for PnP Reader [size_is(cReaders)] ReaderStateW *rgReaderStates; } GetStatusChangeW_Call; typedef struct _Connect_Common { REDIR_SCARDCONTEXT Context; DWORD dwShareMode; DWORD dwPreferredProtocols; } Connect_Common; typedef struct _ConnectA_Call { LPCSTR szReader; Connect_Common Common; } ConnectA_Call; typedef struct _ConnectW_Call { LPCWSTR szReader; Connect_Common Common; } ConnectW_Call; typedef struct _Connect_Return { LONG ReturnCode; REDIR_SCARDHANDLE hCard; DWORD dwActiveProtocol; } Connect_Return; typedef struct _Reconnect_Call { REDIR_SCARDHANDLE hCard; DWORD dwShareMode; DWORD dwPreferredProtocols; DWORD dwInitialization; } Reconnect_Call; typedef struct Reconnect_Return { LONG ReturnCode; DWORD dwActiveProtocol; } Reconnect_Return; typedef struct _HCardAndDisposition_Call { REDIR_SCARDHANDLE hCard; DWORD dwDisposition; } HCardAndDisposition_Call; typedef struct _State_Call { REDIR_SCARDHANDLE hCard; BOOL fpbAtrIsNULL; DWORD cbAtrLen; } State_Call; typedef struct _State_Return { LONG ReturnCode; DWORD dwState; DWORD dwProtocol; [range(0, 36)] DWORD cbAtrLen; // 36 is consistent with max ATR size in scardsvr [unique] [size_is(cbAtrLen)] BYTE *rgAtr; } State_Return; typedef struct _Status_Call { REDIR_SCARDHANDLE hCard; BOOL fmszReaderNamesIsNULL; DWORD cchReaderLen; DWORD cbAtrLen; } Status_Call; typedef struct _Status_Return { LONG ReturnCode; [range(0, 65336)] DWORD cBytes; // 64k should always be large enough [unique] [size_is(cBytes)] BYTE *mszReaderNames; DWORD dwState; DWORD dwProtocol; BYTE pbAtr[ATR_SIZE]; DWORD cbAtrLen; } Status_Return; typedef struct _SCardIO_Request { DWORD dwProtocol; [range(0, 1024)] DWORD cbExtraBytes; // 1k should always be large enough [unique] [size_is(cbExtraBytes)] BYTE *pbExtraBytes; } SCardIO_Request; typedef struct _Transmit_Call { REDIR_SCARDHANDLE hCard; SCardIO_Request ioSendPci; [range(0, 66360)] DWORD cbSendLength; // 65k should always be large enough [size_is(cbSendLength)] const BYTE *pbSendBuffer; [unique] SCardIO_Request *pioRecvPci; BOOL fpbRecvBufferIsNULL; DWORD cbRecvLength; } Transmit_Call; typedef struct _Transmit_Return { LONG ReturnCode; [unique] SCardIO_Request *pioRecvPci; [range(0, 66360)] DWORD cbRecvLength; // 65k should always be large enough [unique] [size_is(cbRecvLength)] BYTE *pbRecvBuffer; } Transmit_Return; typedef struct _Control_Call { REDIR_SCARDHANDLE hCard; DWORD dwControlCode; [range(0, 66360)] DWORD cbInBufferSize;// 65k should always be large enough [unique] [size_is(cbInBufferSize)] const BYTE *pvInBuffer; BOOL fpvOutBufferIsNULL; DWORD cbOutBufferSize; } Control_Call; typedef struct _Control_Return { LONG ReturnCode; [range(0, 66360)] DWORD cbOutBufferSize; // 65k should always be large enough [unique] [size_is(cbOutBufferSize)] BYTE *pvOutBuffer; } Control_Return; typedef struct _GetAttrib_Call { REDIR_SCARDHANDLE hCard; DWORD dwAttrId; BOOL fpbAttrIsNULL; DWORD cbAttrLen; } GetAttrib_Call; typedef struct _GetAttrib_Return { LONG ReturnCode; [range(0, 65336)] DWORD cbAttrLen; [unique] [size_is(cbAttrLen)] BYTE *pbAttr; } GetAttrib_Return; typedef struct _SetAttrib_Call { REDIR_SCARDHANDLE hCard; DWORD dwAttrId; [range(0, 65336)] DWORD cbAttrLen; [size_is(cbAttrLen)] const BYTE *pbAttr; } SetAttrib_Call; }