Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

360 lines
12 KiB

  1. /*
  2. Copyright (c) 1990-2000 Microsoft Corporation
  3. Module Name:
  4. scredir.idl
  5. Abstract:
  6. This module defines idl used to redirect the Smart Card Subsystem
  7. for Terminal Services.
  8. Revision History:
  9. --*/
  10. import "unknwn.idl";
  11. [ uuid (A35AF600-9CF4-11CD-A076-08002B2BD711),
  12. version(1.0),
  13. pointer_default(unique)
  14. ]
  15. interface type_scard_pack
  16. {
  17. const short ATR_SIZE = 32;
  18. //
  19. // Packing for calls that use the same params
  20. //
  21. typedef struct _REDIR_SCARDCONTEXT
  22. {
  23. DWORD cbContext;
  24. [unique] [size_is(cbContext)] BYTE *pbContext;
  25. } REDIR_SCARDCONTEXT;
  26. typedef struct _REDIR_SCARDHANDLE
  27. {
  28. REDIR_SCARDCONTEXT Context;
  29. DWORD cbHandle;
  30. [size_is(cbHandle)] BYTE *pbHandle;
  31. } REDIR_SCARDHANDLE;
  32. typedef struct _Long_Return
  33. {
  34. LONG ReturnCode;
  35. } Long_Return;
  36. typedef struct _LongAndMultiString_Return
  37. {
  38. LONG ReturnCode;
  39. DWORD cBytes;
  40. [unique] [size_is(cBytes)] BYTE *msz;
  41. } ListReaderGroups_Return, ListReaders_Return;
  42. typedef struct _Context_Call
  43. {
  44. REDIR_SCARDCONTEXT Context;
  45. } Context_Call;
  46. typedef struct _ContextAndStringA_Call
  47. {
  48. REDIR_SCARDCONTEXT Context;
  49. LPCSTR sz;
  50. } ContextAndStringA_Call;
  51. typedef struct _ContextAndStringW_Call
  52. {
  53. REDIR_SCARDCONTEXT Context;
  54. LPCWSTR sz;
  55. } ContextAndStringW_Call;
  56. typedef struct _ContextAndTwoStringA_Call
  57. {
  58. REDIR_SCARDCONTEXT Context;
  59. LPCSTR sz1;
  60. LPCSTR sz2;
  61. } ContextAndTwoStringA_Call;
  62. typedef struct _ContextAndTwoStringW_Call
  63. {
  64. REDIR_SCARDCONTEXT Context;
  65. LPCWSTR sz1;
  66. LPCWSTR sz2;
  67. } ContextAndTwoStringW_Call;
  68. //
  69. // Call specific packing
  70. //
  71. typedef struct _EstablishContext_Call
  72. {
  73. DWORD dwScope;
  74. } EstablishContext_Call;
  75. typedef struct _EstablishContext_Return
  76. {
  77. LONG ReturnCode;
  78. REDIR_SCARDCONTEXT Context;
  79. } EstablishContext_Return;
  80. typedef struct _ListReaderGroups_Call
  81. {
  82. REDIR_SCARDCONTEXT Context;
  83. BOOL fmszGroupsIsNULL;
  84. DWORD cchGroups;
  85. } ListReaderGroups_Call;
  86. typedef struct _ListReaders_Call
  87. {
  88. REDIR_SCARDCONTEXT Context;
  89. DWORD cBytes;
  90. [unique] [size_is(cBytes)] const BYTE *mszGroups;
  91. BOOL fmszReadersIsNULL;
  92. DWORD cchReaders;
  93. } ListReaders_Call;
  94. typedef struct _ReaderState_Common_Call
  95. {
  96. DWORD dwCurrentState;
  97. DWORD dwEventState;
  98. DWORD cbAtr;
  99. BYTE rgbAtr[36];
  100. } ReaderState_Common_Call;
  101. typedef struct _ReaderStateA
  102. {
  103. LPCSTR szReader;
  104. ReaderState_Common_Call Common;
  105. } ReaderStateA;
  106. typedef struct _ReaderStateW
  107. {
  108. LPCWSTR szReader;
  109. ReaderState_Common_Call Common;
  110. } ReaderStateW;
  111. typedef struct _ReaderState_Return
  112. {
  113. DWORD dwCurrentState;
  114. DWORD dwEventState;
  115. DWORD cbAtr;
  116. BYTE rgbAtr[36];
  117. } ReaderState_Return;
  118. typedef struct _LocateCardsA_Call
  119. {
  120. REDIR_SCARDCONTEXT Context;
  121. DWORD cBytes;
  122. [size_is(cBytes)] const BYTE *mszCards;
  123. DWORD cReaders;
  124. [size_is(cReaders)] ReaderStateA *rgReaderStates;
  125. } LocateCardsA_Call;
  126. typedef struct _LocateCardsW_Call
  127. {
  128. REDIR_SCARDCONTEXT Context;
  129. DWORD cBytes;
  130. [size_is(cBytes)] const BYTE *mszCards;
  131. DWORD cReaders;
  132. [size_is(cReaders)] ReaderStateW *rgReaderStates;
  133. } LocateCardsW_Call;
  134. typedef struct _LocateCards_ATRMask
  135. {
  136. DWORD cbAtr;
  137. BYTE rgbAtr[36];
  138. BYTE rgbMask[36];
  139. } LocateCards_ATRMask;
  140. typedef struct _LocateCardsByATRA_Call
  141. {
  142. REDIR_SCARDCONTEXT Context;
  143. DWORD cAtrs;
  144. [size_is(cAtrs)] LocateCards_ATRMask *rgAtrMasks;
  145. DWORD cReaders;
  146. [size_is(cReaders)] ReaderStateA *rgReaderStates;
  147. } LocateCardsByATRA_Call;
  148. typedef struct _LocateCardsByATRW_Call
  149. {
  150. REDIR_SCARDCONTEXT Context;
  151. DWORD cAtrs;
  152. [size_is(cAtrs)] LocateCards_ATRMask *rgAtrMasks;
  153. DWORD cReaders;
  154. [size_is(cReaders)] ReaderStateW *rgReaderStates;
  155. } LocateCardsByATRW_Call;
  156. typedef struct _LocateCards_Return
  157. {
  158. LONG ReturnCode;
  159. DWORD cReaders;
  160. [size_is(cReaders)] ReaderState_Return *rgReaderStates;
  161. } LocateCards_Return, GetStatusChange_Return;
  162. typedef struct _GetStatusChangeA_Call
  163. {
  164. REDIR_SCARDCONTEXT Context;
  165. DWORD dwTimeOut;
  166. DWORD cReaders;
  167. [size_is(cReaders)] ReaderStateA *rgReaderStates;
  168. } GetStatusChangeA_Call;
  169. typedef struct _GetStatusChangeW_Call
  170. {
  171. REDIR_SCARDCONTEXT Context;
  172. DWORD dwTimeOut;
  173. DWORD cReaders;
  174. [size_is(cReaders)] ReaderStateW *rgReaderStates;
  175. } GetStatusChangeW_Call;
  176. typedef struct _Connect_Common
  177. {
  178. REDIR_SCARDCONTEXT Context;
  179. DWORD dwShareMode;
  180. DWORD dwPreferredProtocols;
  181. } Connect_Common;
  182. typedef struct _ConnectA_Call
  183. {
  184. LPCSTR szReader;
  185. Connect_Common Common;
  186. } ConnectA_Call;
  187. typedef struct _ConnectW_Call
  188. {
  189. LPCWSTR szReader;
  190. Connect_Common Common;
  191. } ConnectW_Call;
  192. typedef struct _Connect_Return
  193. {
  194. LONG ReturnCode;
  195. REDIR_SCARDHANDLE hCard;
  196. DWORD dwActiveProtocol;
  197. } Connect_Return;
  198. typedef struct _Reconnect_Call
  199. {
  200. REDIR_SCARDHANDLE hCard;
  201. DWORD dwShareMode;
  202. DWORD dwPreferredProtocols;
  203. DWORD dwInitialization;
  204. } Reconnect_Call;
  205. typedef struct Reconnect_Return
  206. {
  207. LONG ReturnCode;
  208. DWORD dwActiveProtocol;
  209. } Reconnect_Return;
  210. typedef struct _HCardAndDisposition_Call
  211. {
  212. REDIR_SCARDHANDLE hCard;
  213. DWORD dwDisposition;
  214. } HCardAndDisposition_Call;
  215. typedef struct _State_Call
  216. {
  217. REDIR_SCARDHANDLE hCard;
  218. BOOL fpbAtrIsNULL;
  219. DWORD cbAtrLen;
  220. } State_Call;
  221. typedef struct _State_Return
  222. {
  223. LONG ReturnCode;
  224. DWORD dwState;
  225. DWORD dwProtocol;
  226. DWORD cbAtrLen;
  227. [unique] [size_is(cbAtrLen)] BYTE *rgAtr;
  228. } State_Return;
  229. typedef struct _Status_Call
  230. {
  231. REDIR_SCARDHANDLE hCard;
  232. BOOL fmszReaderNamesIsNULL;
  233. DWORD cchReaderLen;
  234. DWORD cbAtrLen;
  235. } Status_Call;
  236. typedef struct _Status_Return
  237. {
  238. LONG ReturnCode;
  239. DWORD cBytes;
  240. [unique] [size_is(cBytes)] BYTE *mszReaderNames;
  241. DWORD dwState;
  242. DWORD dwProtocol;
  243. BYTE pbAtr[ATR_SIZE];
  244. DWORD cbAtrLen;
  245. } Status_Return;
  246. typedef struct _SCardIO_Request
  247. {
  248. DWORD dwProtocol;
  249. DWORD cbExtraBytes;
  250. [unique] [size_is(cbExtraBytes)] BYTE *pbExtraBytes;
  251. } SCardIO_Request;
  252. typedef struct _Transmit_Call
  253. {
  254. REDIR_SCARDHANDLE hCard;
  255. SCardIO_Request ioSendPci;
  256. DWORD cbSendLength;
  257. [size_is(cbSendLength)] const BYTE *pbSendBuffer;
  258. [unique] SCardIO_Request *pioRecvPci;
  259. BOOL fpbRecvBufferIsNULL;
  260. DWORD cbRecvLength;
  261. } Transmit_Call;
  262. typedef struct _Transmit_Return
  263. {
  264. LONG ReturnCode;
  265. [unique] SCardIO_Request *pioRecvPci;
  266. DWORD cbRecvLength;
  267. [unique] [size_is(cbRecvLength)] BYTE *pbRecvBuffer;
  268. } Transmit_Return;
  269. typedef struct _Control_Call
  270. {
  271. REDIR_SCARDHANDLE hCard;
  272. DWORD dwControlCode;
  273. DWORD cbInBufferSize;
  274. [unique] [size_is(cbInBufferSize)] const BYTE *pvInBuffer;
  275. BOOL fpvOutBufferIsNULL;
  276. DWORD cbOutBufferSize;
  277. } Control_Call;
  278. typedef struct _Control_Return
  279. {
  280. LONG ReturnCode;
  281. DWORD cbOutBufferSize;
  282. [unique] [size_is(cbOutBufferSize)] BYTE *pvOutBuffer;
  283. } Control_Return;
  284. typedef struct _GetAttrib_Call
  285. {
  286. REDIR_SCARDHANDLE hCard;
  287. DWORD dwAttrId;
  288. BOOL fpbAttrIsNULL;
  289. DWORD cbAttrLen;
  290. } GetAttrib_Call;
  291. typedef struct _GetAttrib_Return
  292. {
  293. LONG ReturnCode;
  294. DWORD cbAttrLen;
  295. [unique] [size_is(cbAttrLen)] BYTE *pbAttr;
  296. } GetAttrib_Return;
  297. typedef struct _SetAttrib_Call
  298. {
  299. REDIR_SCARDHANDLE hCard;
  300. DWORD dwAttrId;
  301. DWORD cbAttrLen;
  302. [size_is(cbAttrLen)] const BYTE *pbAttr;
  303. } SetAttrib_Call;
  304. }