Leaked source code of windows server 2003
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.

476 lines
17 KiB

  1. // sspsidl.idl : IDL source for a subset of scardssp.dll
  2. //
  3. // This MIDL file is not compiled, it is merely for backwards compatibility.
  4. //
  5. cpp_quote("//+-------------------------------------------------------------------------")
  6. cpp_quote("//")
  7. cpp_quote("// Microsoft Smart Card Support")
  8. cpp_quote("// Copyright (C) Microsoft Corporation, 1996 - 1999")
  9. cpp_quote("//")
  10. cpp_quote("//")
  11. cpp_quote("// File: SspsIdl.h")
  12. cpp_quote("//")
  13. cpp_quote("//--------------------------------------------------------------------------")
  14. cpp_quote("")
  15. cpp_quote("//////////////////////////////////////////////////////////////////")
  16. cpp_quote("//")
  17. cpp_quote("// Imports")
  18. cpp_quote("//")
  19. #ifndef DO_NO_IMPORTS
  20. import "oaidl.idl";
  21. import "ocidl.idl";
  22. #endif
  23. cpp_quote("")
  24. cpp_quote("//////////////////////////////////////////////////////////////////")
  25. cpp_quote("//")
  26. cpp_quote("// Interface declarations")
  27. cpp_quote("//")
  28. interface IByteBuffer;
  29. interface ISCardTypeConv;
  30. interface ISCardCmd;
  31. cpp_quote("")
  32. cpp_quote("//////////////////////////////////////////////////////////////////")
  33. cpp_quote("//")
  34. cpp_quote("// Types and Constants")
  35. cpp_quote("//")
  36. cpp_quote("#ifndef _NULL_DEFINED")
  37. cpp_quote("#define _NULL_DEFINED")
  38. #define NULL 0
  39. cpp_quote("#endif // !_NULL_DEFINED")
  40. cpp_quote("#ifndef _BYTE_DEFINED")
  41. cpp_quote("#define _BYTE_DEFINED")
  42. typedef [public] unsigned char BYTE;
  43. cpp_quote("#endif // !_BYTE_DEFINED")
  44. cpp_quote("#ifndef _LPBYTE_DEFINED")
  45. cpp_quote("#define _LPBYTE_DEFINED")
  46. typedef [public] BYTE *LPBYTE;
  47. cpp_quote("#endif // !_LPBYTE_DEFINED")
  48. cpp_quote("#ifndef _LPCBYTE_DEFINED")
  49. cpp_quote("#define _LPCBYTE_DEFINED")
  50. typedef [public] const BYTE *LPCBYTE;
  51. cpp_quote("#endif // !_LPCBYTE_DEFINED")
  52. cpp_quote("#ifndef _BYTEARRAY_DEFINED")
  53. cpp_quote("#define _BYTEARRAY_DEFINED")
  54. typedef [helpstring("Helpful byte array."),
  55. //uuid(),
  56. //helpcontext(),
  57. version(1.0)]
  58. struct tagBYTEARRAY {
  59. HGLOBAL hMem;
  60. DWORD dwSize;
  61. [size_is(dwSize)] LPBYTE pbyData;
  62. } BYTEARRAY;
  63. cpp_quote("#define _CB_BYTEARRAY_DEFINED")
  64. cpp_quote("#define CB_BYTEARRAY (sizeof(BYTEARRAY))")
  65. cpp_quote("#define _PBYTEARRAY_DEFINED")
  66. typedef [public] BYTEARRAY *PBYTEARRAY;
  67. cpp_quote("#define _PCBYTEARRAY_DEFINED")
  68. typedef [public] const BYTEARRAY *PCBYTEARRAY;
  69. cpp_quote("#define _LPBYTEARRAY_DEFINED")
  70. typedef [public] BYTEARRAY *LPBYTEARRAY;
  71. cpp_quote("#define _LPCBYTEARRAY_DEFINED")
  72. typedef [public] const BYTEARRAY *LPCBYTEARRAY;
  73. cpp_quote("#endif // _BYTEARRAY_DEFINED")
  74. cpp_quote("#ifndef _STATSTRUCT")
  75. cpp_quote("#define _STATSTRUCT")
  76. typedef [helpstring("Stream status structure."),
  77. //uuid(),
  78. //helpcontext(),
  79. version(1.0)]
  80. struct tagSTATSTRUCT {
  81. LONG type;
  82. LONG cbSize;
  83. LONG grfMode;
  84. LONG grfLocksSupported;
  85. LONG grfStateBits;
  86. } STATSTRUCT;
  87. cpp_quote("#define _CB_STATSTRUCT_DEFINED")
  88. cpp_quote("#define CB_STATSTRUCT (sizeof(STATSTRUCT))")
  89. cpp_quote("#define _LPSTATSTRUCT_DEFINED")
  90. typedef [public] STATSTRUCT* LPSTATSTRUCT;
  91. cpp_quote("#endif // _STATSTRUCT_DEFINED")
  92. cpp_quote("#ifndef _ISO_APDU_TYPE")
  93. cpp_quote("#define _ISO_APDU_TYPE")
  94. typedef [helpstring("ISO 7816-4 APDU Case types."),
  95. //uuid(),
  96. //helpcontext(),
  97. version(1.0)]
  98. enum tagISO_APDU_TYPE {
  99. ISO_CASE_1 = 1,
  100. ISO_CASE_2 = 2,
  101. ISO_CASE_3 = 3,
  102. ISO_CASE_4 = 4
  103. } ISO_APDU_TYPE;
  104. cpp_quote("#endif // _ISO_APDU_TYPE")
  105. cpp_quote("")
  106. cpp_quote("//////////////////////////////////////////////////////////////////")
  107. cpp_quote("//")
  108. cpp_quote("// IByteBuffer Interface")
  109. cpp_quote("//")
  110. cpp_quote("#ifndef _LPBYTEBUFFER_DEFINED")
  111. cpp_quote("#define _LPBYTEBUFFER_DEFINED")
  112. [
  113. object,
  114. uuid(E126F8FE-A7AF-11D0-B88A-00C04FD424B9),
  115. // dual,
  116. helpstring("IByteBuffer Interface"),
  117. pointer_default(unique)
  118. ]
  119. interface IByteBuffer : IDispatch
  120. {
  121. // Pointers -
  122. typedef [unique] IByteBuffer* LPBYTEBUFFER;
  123. typedef [unique] const IByteBuffer *LPCBYTEBUFFER;
  124. // Properties -
  125. [ id(0), propget, hidden,
  126. helpstring("Returns a pointer to the internal IStream object.")]
  127. HRESULT Stream( [out, retval] LPSTREAM* ppStream );
  128. [ id(0), propput, hidden,
  129. helpstring("Sets the internal IStream pointer.")]
  130. HRESULT Stream( [in] LPSTREAM pStream );
  131. // Methods -
  132. [ id(1),
  133. helpstring("Creates a new object with its own seek pointer that references the same bytes as the original.")
  134. ]
  135. HRESULT Clone([in, out] LPBYTEBUFFER* ppByteBuffer);
  136. [ id(2),
  137. helpstring("Ensures that any changes made to an object open in transacted mode are reflected in the parent storage.")
  138. ]
  139. HRESULT Commit([in] LONG grfCommitFlags);
  140. [ id(3),
  141. helpstring("Copies a specified number of bytes from the current seek pointer in the object to the current seek pointer in another object.")
  142. ]
  143. HRESULT CopyTo( [in,out] LPBYTEBUFFER* ppByteBuffer,
  144. [in] LONG cb,
  145. [in,out, defaultvalue(NULL)] LONG* pcbRead,
  146. [in,out, defaultvalue(NULL)] LONG* pcbWritten);
  147. [ id(4),
  148. helpstring("Initializes the object. This must be called prior to calling any other methods!")]
  149. HRESULT Initialize( [in, defaultvalue(1)] LONG lSize,
  150. [in, defaultvalue(NULL)] BYTE* pData );
  151. [ id(5),
  152. helpstring("Restricts access to a specified range of bytes in the buffer object.")
  153. ]
  154. HRESULT LockRegion( [in] LONG libOffset,
  155. [in] LONG cb,
  156. [in] LONG dwLockType);
  157. [ id(6),
  158. helpstring("Reads a specified number of bytes from the buffer object into memory starting at the current seek pointer.")
  159. ]
  160. HRESULT Read( [in,out] BYTE* pByte,
  161. [in] LONG cb,
  162. [in, out, defaultvalue(NULL)] LONG* pcbRead);
  163. [ id(7),
  164. helpstring("Discards all changes that have been made to a transacted stream since the last IByteBuffer::Commit call.")
  165. ]
  166. HRESULT Revert ( void );
  167. [ id(8),
  168. helpstring("Changes the seek pointer to a new location relative to the beginning of the buffer, to the end of the buffer, or to the current seek pointer.")
  169. ]
  170. HRESULT Seek( [in] LONG dLibMove,
  171. [in] LONG dwOrigin,
  172. [in,out, defaultvalue(NULL)] LONG* pLibnewPosition);
  173. [ id(9),
  174. helpstring("Changes the size of the stream object.")
  175. ]
  176. HRESULT SetSize([in] LONG libNewSize);
  177. [ id(10),
  178. helpstring("Retrieves the STATSTG structure for this object.")
  179. ]
  180. HRESULT Stat( [in,out] LPSTATSTRUCT pstatstg,
  181. [in] LONG grfStatFlag);
  182. [ id(11),
  183. helpstring("Removes the access restriction on a range of bytes previously restricted with IByteBuffer::LockRegion.")
  184. ]
  185. HRESULT UnlockRegion( [in] LONG libOffset,
  186. [in] LONG cb,
  187. [in] LONG dwLockType);
  188. [ id(12),
  189. helpstring("Writes a specified number from bytes into the stream object starting at the current seek pointer.")
  190. ]
  191. HRESULT Write( [in,out] BYTE* pByte,
  192. [in] LONG cb,
  193. [in,out] LONG* pcbWritten);
  194. };
  195. cpp_quote("#endif //_LPBYTEBUFFER_DEFINED")
  196. cpp_quote("")
  197. cpp_quote("//////////////////////////////////////////////////////////////////")
  198. cpp_quote("//")
  199. cpp_quote("// ISCardTypeConv Interface Definition")
  200. cpp_quote("//")
  201. cpp_quote("#ifndef _LPSCARDTYPECONV_DEFINED")
  202. cpp_quote("#define _LPSCARDTYPECONV_DEFINED")
  203. [
  204. object,
  205. uuid(53B6AA63-3F56-11D0-916B-00AA00C18068),
  206. // dual,
  207. helpstring("ISCardTypeConv Interface"),
  208. pointer_default(unique)
  209. ]
  210. interface ISCardTypeConv : IDispatch
  211. {
  212. // Pointer(s);
  213. typedef [unique] ISCardTypeConv *LPSCARDTYPECONV;
  214. // Methods:
  215. [id(0), helpstring("Convert an array of bytes to an IByteBuffer")]
  216. HRESULT ConvertByteArrayToByteBuffer(
  217. [in] LPBYTE pbyArray,
  218. [in] DWORD dwArraySize,
  219. [out,retval] LPBYTEBUFFER *ppbyBuffer);
  220. [id(1), helpstring("Convert an IByteBuffer to an array of bytes")]
  221. HRESULT ConvertByteBufferToByteArray(
  222. [in] LPBYTEBUFFER pbyBuffer,
  223. [out,retval] LPBYTEARRAY *ppArray);
  224. [id(2), helpstring("Convert an IByteBuffer to a SAFEARRAY(unsigned char)")]
  225. HRESULT ConvertByteBufferToSafeArray(
  226. [in] LPBYTEBUFFER pbyBuffer,
  227. [out,retval] LPSAFEARRAY *ppbyArray);
  228. [id(3), helpstring("Convert a SAFEARRAY(unsigned char) to an IByteBuffer")]
  229. HRESULT ConvertSafeArrayToByteBuffer(
  230. [in] LPSAFEARRAY pbyArray,
  231. [out,retval] LPBYTEBUFFER *ppbyBuff);
  232. [id(4), helpstring("Create an array of bytes")]
  233. HRESULT CreateByteArray(
  234. [in] DWORD dwAllocSize,
  235. [out,retval] LPBYTE *ppbyArray);
  236. [id(5), helpstring("Create an IByteBuffer object")]
  237. HRESULT CreateByteBuffer(
  238. [in] DWORD dwAllocSize,
  239. [out,retval] LPBYTEBUFFER *ppbyBuff);
  240. [id(6), helpstring("Create a SAFEARRAY(unsigned char)")]
  241. HRESULT CreateSafeArray(
  242. [in] UINT nAllocSize,
  243. [out,retval] LPSAFEARRAY *ppArray);
  244. [id(7), helpstring("Free a pointer to the memory block managed by the IStream")]
  245. HRESULT FreeIStreamMemoryPtr(
  246. [in] LPSTREAM pStrm,
  247. [in] LPBYTE pMem);
  248. [id(8), helpstring("Get a pointer to the memory block managed by the IStream")]
  249. HRESULT GetAtIStreamMemory(
  250. [in] LPSTREAM pStrm,
  251. [out,retval] LPBYTEARRAY *ppMem);
  252. [id(9), helpstring("How many bytes are in the given IStream")]
  253. HRESULT SizeOfIStream(
  254. [in] LPSTREAM pStrm,
  255. [out,retval] ULARGE_INTEGER* puliSize);
  256. };
  257. cpp_quote("#endif // _LPSCARDTYPECONV_DEFINED")
  258. cpp_quote("")
  259. cpp_quote("//////////////////////////////////////////////////////////////////")
  260. cpp_quote("//")
  261. cpp_quote("// ISCardCmd Interface Definition")
  262. cpp_quote("//")
  263. cpp_quote("#ifndef _LPSCARDCMD_DEFINED")
  264. cpp_quote("#define _LPSCARDCMD_DEFINED")
  265. [
  266. object,
  267. uuid(D5778AE3-43DE-11D0-9171-00AA00C18068),
  268. // dual,
  269. helpstring("ISCardCmd Interface"),
  270. pointer_default(unique)
  271. ]
  272. interface ISCardCmd : IDispatch
  273. {
  274. // Pointer(s) -
  275. typedef [unique] ISCardCmd *LPSCARDCMD;
  276. // Properties -
  277. [id(0), propget/*, defaultcollelem*/,
  278. helpstring("Get the raw ISO 7816 APDU string")]
  279. HRESULT Apdu([out,retval] LPBYTEBUFFER *ppApdu);
  280. [id(0), propput/*, defaultcollelem*/,
  281. helpstring("Copy a new APDU over the current one")]
  282. HRESULT Apdu([in] LPBYTEBUFFER pApdu);
  283. [id(1), propget/*, defaultcollelem*/,
  284. helpstring("Get the byte count (size) of the raw ISO 7816 APDU string")]
  285. HRESULT ApduLength([out,retval] LONG* plSize);
  286. [id(2), propget/*, defaultcollelem*/,
  287. helpstring("Get the raw reply ISO 7816 APDU string")]
  288. HRESULT ApduReply([out,retval] LPBYTEBUFFER *ppReplyApdu);
  289. [id(2), propput/*, defaultcollelem*/,
  290. helpstring("Set the raw reply ISO 7816 APDU string")]
  291. HRESULT ApduReply([in] LPBYTEBUFFER pReplyApdu);
  292. [id(3), propget/*, defaultcollelem*/,
  293. helpstring("Get the byte count (size) of the raw reply ISO 7816 APDU string")]
  294. HRESULT ApduReplyLength([out,retval] LONG* plSize);
  295. [id(3), propput/*, defaultcollelem*/,
  296. helpstring("Set the byte count (size) of the raw reply ISO 7816 APDU string")]
  297. HRESULT ApduReplyLength([in] LONG lSize);
  298. [id(4), propget/*, defaultcollelem*/,
  299. helpstring("Get the current class ID of the ISO 7816 APDU header")]
  300. HRESULT ClassId([out,retval] BYTE* pbyClass);
  301. [id(4), propput/*, defaultcollelem*/,
  302. helpstring("Assign a new class ID in the ISO 7816 APDU header")]
  303. HRESULT ClassId([in,defaultvalue(0)] BYTE byClass);
  304. [id(5), propget/*, defaultcollelem*/,
  305. helpstring("Get the current data portion of the ISO 7816 APDU string")]
  306. HRESULT Data([out,retval] LPBYTEBUFFER *ppData);
  307. [id(5), propput/*, defaultcollelem*/,
  308. helpstring("Assign a new data portion of the ISO 7816 APDU string")]
  309. HRESULT Data([in] LPBYTEBUFFER pData);
  310. [id(6), propget/*, defaultcollelem*/,
  311. helpstring("Get the current instruction ID of the ISO 7816 APDU header")]
  312. HRESULT InstructionId([out,retval] BYTE* pbyIns);
  313. [id(6), propput/*, defaultcollelem*/,
  314. helpstring("Assign a new instruction ID in the ISO 7816 APDU header")]
  315. HRESULT InstructionId([in] BYTE byIns);
  316. [id(7), propget/*, defaultcollelem*/,
  317. helpstring("Get the Le parameter (expected length of reply data) of the ISO 7816 APDU")]
  318. HRESULT LeField([out,retval] LONG* plSize);
  319. [id(8), propget/*, defaultcollelem*/,
  320. helpstring("Get the first parameter of the ISO 7816 APDU header")]
  321. HRESULT P1([out,retval] BYTE* pbyP1);
  322. [id(8), propput/*, defaultcollelem*/,
  323. helpstring("Assign a new first parameter in the ISO 7816 APDU header")]
  324. HRESULT P1([in] BYTE byP1);
  325. [id(9), propget/*, defaultcollelem*/,
  326. helpstring("Get the second parameter of the ISO 7816 APDU header")]
  327. HRESULT P2([out,retval] BYTE* pbyP2);
  328. [id(9), propput/*, defaultcollelem*/,
  329. helpstring("Assign a new second parameter in the ISO 7816 APDU header")]
  330. HRESULT P2([in] BYTE byP2);
  331. [id(10), propget/*, defaultcollelem*/,
  332. helpstring("Get the third parameter of the ISO 7816 APDU header")]
  333. HRESULT P3([out,retval] BYTE* pbyP3);
  334. [id(11), propget/*, defaultcollelem*/,
  335. helpstring("Get the reply status word")]
  336. HRESULT ReplyStatus([out,retval] LPWORD pwStatus);
  337. [id(11), propput/*, defaultcollelem*/,
  338. helpstring("Set (save) the reply status word")]
  339. HRESULT ReplyStatus([in] WORD wStatus);
  340. [id(12), propget/*, defaultcollelem*/,
  341. helpstring("Get the reply status SW1 byte.")]
  342. HRESULT ReplyStatusSW1([out,retval] BYTE* pbySW1);
  343. [id(13), propget/*, defaultcollelem*/,
  344. helpstring("Get the reply status SW2 byte.")]
  345. HRESULT ReplyStatusSW2([out,retval] BYTE* pbySW2);
  346. [id(14), propget/*, defaultcollelem*/,
  347. helpstring("Get the current ISO 7816-4 type of the encapsulated APDU.")]
  348. HRESULT Type([out,retval] ISO_APDU_TYPE* pType);
  349. [id(18), propget/*, defaultcollelem*/,
  350. helpstring("Get the T=1 Node Address")]
  351. HRESULT Nad([out,retval] BYTE* pbNad);
  352. [id(18), propput/*, defaultcollelem*/,
  353. helpstring("Set (save) the T=1 Node Address")]
  354. HRESULT Nad([in] BYTE bNad);
  355. [id(19), propget/*, defaultcollelem*/,
  356. helpstring("Get the T=1 Reply Node Address")]
  357. HRESULT ReplyNad([out,retval] BYTE* pbNad);
  358. [id(19), propput/*, defaultcollelem*/,
  359. helpstring("Set (save) the T=1 Reply Node Address")]
  360. HRESULT ReplyNad([in] BYTE bNad);
  361. // Methods -
  362. [id(15),
  363. helpstring("Build a valid ISO 7816 APDU string")]
  364. HRESULT BuildCmd([in] BYTE byClassId,
  365. [in] BYTE byInsId,
  366. [in,defaultvalue(0)] BYTE byP1,
  367. [in,defaultvalue(0)] BYTE byP2,
  368. [in,defaultvalue(NULL)] LPBYTEBUFFER pbyData,
  369. [in,defaultvalue(NULL)] LONG* plLe);
  370. [id(16),
  371. helpstring("Clear the current APDU data")]
  372. HRESULT Clear(void);
  373. [id(17),
  374. helpstring("Encapsulate onother APDU into this one as data")]
  375. HRESULT Encapsulate([in] LPBYTEBUFFER pApdu,
  376. [in] ISO_APDU_TYPE ApduType);
  377. [id(20), propget/*, defaultcollelem*/,
  378. helpstring("Get the alternate class ID of the ISO 7816 APDU header")]
  379. HRESULT AlternateClassId([out,retval] BYTE* pbyClass);
  380. [id(20), propput/*, defaultcollelem*/,
  381. helpstring("Assign a new alternate class ID in the ISO 7816 APDU header")]
  382. HRESULT AlternateClassId([in] BYTE byClass);
  383. };
  384. cpp_quote("#endif //!_LPSCARDCMD_DEFINED")