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.

173 lines
4.9 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. //
  5. // Copyright (C) Microsoft Corporation, 1999 - 1999
  6. //
  7. // File: ISO7816.h
  8. //
  9. //--------------------------------------------------------------------------
  10. // ISO7816.h : Declaration of the CSCardISO7816
  11. #ifndef __SCARDISO7816_H_
  12. #define __SCARDISO7816_H_
  13. #include "resource.h" // main symbols
  14. #include "scardcmd.h"
  15. /////////////////////////////////////////////////////////////////////////////
  16. // CSCardISO7816
  17. class ATL_NO_VTABLE CSCardISO7816 :
  18. public CComObjectRootEx<CComMultiThreadModel>,
  19. public CComCoClass<CSCardISO7816, &CLSID_CSCardISO7816>,
  20. public IDispatchImpl<ISCardISO7816, &IID_ISCardISO7816, &LIBID_SCARDSSPLib>
  21. {
  22. public:
  23. CSCardISO7816()
  24. {
  25. m_pUnkMarshaler = NULL;
  26. m_bCla = 0;
  27. }
  28. DECLARE_REGISTRY_RESOURCEID(IDR_SCARDISO7816)
  29. DECLARE_GET_CONTROLLING_UNKNOWN()
  30. DECLARE_PROTECT_FINAL_CONSTRUCT()
  31. BEGIN_COM_MAP(CSCardISO7816)
  32. COM_INTERFACE_ENTRY(ISCardISO7816)
  33. COM_INTERFACE_ENTRY(IDispatch)
  34. COM_INTERFACE_ENTRY_AGGREGATE(IID_IMarshal, m_pUnkMarshaler.p)
  35. END_COM_MAP()
  36. HRESULT FinalConstruct()
  37. {
  38. return CoCreateFreeThreadedMarshaler(
  39. GetControllingUnknown(), &m_pUnkMarshaler.p);
  40. }
  41. void FinalRelease()
  42. {
  43. m_pUnkMarshaler.Release();
  44. }
  45. CComPtr<IUnknown> m_pUnkMarshaler;
  46. protected:
  47. BYTE m_bCla;
  48. // ISCardISO7816
  49. public:
  50. STDMETHOD(AppendRecord)(
  51. /* [in] */ BYTE byRefCtrl,
  52. /* [in] */ LPBYTEBUFFER pData,
  53. /* [out][in] */ LPSCARDCMD __RPC_FAR *ppCmd);
  54. STDMETHOD(EraseBinary)(
  55. /* [in] */ BYTE byP1,
  56. /* [in] */ BYTE byP2,
  57. /* [in] */ LPBYTEBUFFER pData,
  58. /* [out][in] */ LPSCARDCMD __RPC_FAR *ppCmd);
  59. STDMETHOD(ExternalAuthenticate)(
  60. /* [in] */ BYTE byAlgorithmRef,
  61. /* [in] */ BYTE bySecretRef,
  62. /* [in] */ LPBYTEBUFFER pChallenge,
  63. /* [out][in] */ LPSCARDCMD __RPC_FAR *ppCmd);
  64. STDMETHOD(GetChallenge)(
  65. /* [in] */ LONG lBytesExpected,
  66. /* [out][in] */ LPSCARDCMD __RPC_FAR *ppCmd);
  67. STDMETHOD(GetData)(
  68. /* [in] */ BYTE byP1,
  69. /* [in] */ BYTE byP2,
  70. /* [in] */ LONG lBytesToGet,
  71. /* [out][in] */ LPSCARDCMD __RPC_FAR *ppCmd);
  72. STDMETHOD(GetResponse)(
  73. /* [in] */ BYTE byP1,
  74. /* [in] */ BYTE byP2,
  75. /* [in] */ LONG lDataLength,
  76. /* [out][in] */ LPSCARDCMD __RPC_FAR *ppCmd);
  77. STDMETHOD(InternalAuthenticate)(
  78. /* [in] */ BYTE byAlgorithmRef,
  79. /* [in] */ BYTE bySecretRef,
  80. /* [in] */ LPBYTEBUFFER pChallenge,
  81. /* [in] */ LONG lReplyBytes,
  82. /* [out][in] */ LPSCARDCMD __RPC_FAR *ppCmd);
  83. STDMETHOD(ManageChannel)(
  84. /* [in] */ BYTE byChannelState,
  85. /* [in] */ BYTE byChannel,
  86. /* [out][in] */ LPSCARDCMD __RPC_FAR *ppCmd);
  87. STDMETHOD(PutData)(
  88. /* [in] */ BYTE byP1,
  89. /* [in] */ BYTE byP2,
  90. /* [in] */ LPBYTEBUFFER pData,
  91. /* [out][in] */ LPSCARDCMD __RPC_FAR *ppCmd);
  92. STDMETHOD(ReadBinary)(
  93. /* [in] */ BYTE byP1,
  94. /* [in] */ BYTE byP2,
  95. /* [in] */ LONG lBytesToRead,
  96. /* [out][in] */ LPSCARDCMD __RPC_FAR *ppCmd);
  97. STDMETHOD(ReadRecord)(
  98. /* [in] */ BYTE byRecordId,
  99. /* [in] */ BYTE byRefCtrl,
  100. /* [in] */ LONG lBytesToRead,
  101. /* [out][in] */ LPSCARDCMD __RPC_FAR *ppCmd);
  102. STDMETHOD(SelectFile)(
  103. /* [in] */ BYTE byP1,
  104. /* [in] */ BYTE byP2,
  105. /* [in] */ LPBYTEBUFFER pData,
  106. /* [in] */ LONG lBytesToRead,
  107. /* [out][in] */ LPSCARDCMD __RPC_FAR *ppCmd);
  108. STDMETHOD(SetDefaultClassId)(
  109. /* [in] */ BYTE byClass);
  110. STDMETHOD(UpdateBinary)(
  111. /* [in] */ BYTE byP1,
  112. /* [in] */ BYTE byP2,
  113. /* [in] */ LPBYTEBUFFER pData,
  114. /* [out][in] */ LPSCARDCMD __RPC_FAR *ppCmd);
  115. STDMETHOD(UpdateRecord)(
  116. /* [in] */ BYTE byRecordId,
  117. /* [in] */ BYTE byRefCtrl,
  118. /* [in] */ LPBYTEBUFFER pData,
  119. /* [out][in] */ LPSCARDCMD __RPC_FAR *ppCmd);
  120. STDMETHOD(Verify)(
  121. /* [in] */ BYTE byRefCtrl,
  122. /* [in] */ LPBYTEBUFFER pData,
  123. /* [out][in] */ LPSCARDCMD __RPC_FAR *ppCmd);
  124. STDMETHOD(WriteBinary)(
  125. /* [in] */ BYTE byP1,
  126. /* [in] */ BYTE byP2,
  127. /* [in] */ LPBYTEBUFFER pData,
  128. /* [out][in] */ LPSCARDCMD __RPC_FAR *ppCmd);
  129. STDMETHOD(WriteRecord)(
  130. /* [in] */ BYTE byRecordId,
  131. /* [in] */ BYTE byRefCtrl,
  132. /* [in] */ LPBYTEBUFFER pData,
  133. /* [out][in] */ LPSCARDCMD __RPC_FAR *ppCmd);
  134. };
  135. inline CSCardISO7816 *
  136. NewSCardISO7816(
  137. void)
  138. {
  139. return (CSCardISO7816 *)NewObject(CLSID_CSCardISO7816, IID_ISCardISO7816);
  140. }
  141. #endif //__SCARDISO7816_H_