📄 scarddat.idl
字号:
{
// Includes:
import "oaidl.idl";
// Pointer(s);
typedef [unique] ISCardTypeConv *LPSCARDTYPECONV;
// Methods:
[id(0), helpstring("Convert an array of bytes to an IByteBuffer")]
HRESULT ConvertByteArrayToByteBuffer(
[in] LPBYTE pbyArray,
[in] DWORD dwArraySize,
[out,retval] LPBYTEBUFFER *ppbyBuffer);
[id(1), helpstring("Convert an IByteBuffer to an array of bytes")]
HRESULT ConvertByteBufferToByteArray(
[in] LPBYTEBUFFER pbyBuffer,
[out,retval] LPBYTEARRAY *ppArray);
[id(2), helpstring("Convert an IByteBuffer to a SAFEARRAY(unsigned char)")]
HRESULT ConvertByteBufferToSafeArray(
[in] LPBYTEBUFFER pbyBuffer,
[out,retval] LPSAFEARRAY *ppbyArray);
[id(3), helpstring("Convert a SAFEARRAY(unsigned char) to an IByteBuffer")]
HRESULT ConvertSafeArrayToByteBuffer(
[in] LPSAFEARRAY pbyArray,
[out,retval] LPBYTEBUFFER *ppbyBuff);
[id(4), helpstring("Create an array of bytes")]
HRESULT CreateByteArray(
[in] DWORD dwAllocSize,
[out,retval] LPBYTE *ppbyArray);
[id(5), helpstring("Create an IByteBuffer object")]
HRESULT CreateByteBuffer(
[in] DWORD dwAllocSize,
[out,retval] LPBYTEBUFFER *ppbyBuff);
[id(6), helpstring("Create a SAFEARRAY(unsigned char)")]
HRESULT CreateSafeArray(
[in] UINT nAllocSize,
[out,retval] LPSAFEARRAY *ppArray);
[id(7), helpstring("Free a pointer to the memory block managed by the IStream")]
HRESULT FreeIStreamMemoryPtr(
[in] LPSTREAM pStrm,
[in] LPBYTE pMem);
[id(8), helpstring("Get a pointer to the memory block managed by the IStream")]
HRESULT GetAtIStreamMemory(
[in] LPSTREAM pStrm,
[out,retval] LPBYTEARRAY *ppMem);
[id(9), helpstring("How many bytes are in the given IStream")]
HRESULT SizeOfIStream(
[in] LPSTREAM pStrm,
[out,retval] ULARGE_INTEGER* puliSize);
};
cpp_quote("#endif // _LPSCARDTYPECONV_DEFINED")
cpp_quote("")
cpp_quote("//////////////////////////////////////////////////////////////////")
cpp_quote("//")
cpp_quote("// ISCardCmd Interface Definition")
cpp_quote("//")
cpp_quote("#ifndef _LPSCARDCMD_DEFINED")
cpp_quote("#define _LPSCARDCMD_DEFINED")
[
object,
uuid(D5778AE3-43DE-11D0-9171-00AA00C18068),
dual,
helpstring("ISCardCmd Interface"),
//hidden,
//restricted, // prevent macro programming?
version(1.1),
pointer_default(unique)
]
interface ISCardCmd : IDispatch
{
// Includes -
import "oaidl.idl";
// Pointer(s) -
typedef [unique] ISCardCmd *LPSCARDCMD;
// Properties -
[id(0), propget/*, defaultcollelem*/,
helpstring("Get the raw ISO 7816 APDU string")]
HRESULT Apdu([out,retval] LPBYTEBUFFER *ppApdu);
[id(0), propput/*, defaultcollelem*/,
helpstring("Copy a new APDU over the current one")]
HRESULT Apdu([in] LPBYTEBUFFER pApdu);
[id(1), propget/*, defaultcollelem*/,
helpstring("Get the byte count (size) of the raw ISO 7816 APDU string")]
HRESULT ApduLength([out,retval] LONG* plSize);
[id(2), propget/*, defaultcollelem*/,
helpstring("Get the raw reply ISO 7816 APDU string")]
HRESULT ApduReply([out,retval] LPBYTEBUFFER *ppReplyApdu);
[id(2), propput/*, defaultcollelem*/,
helpstring("Set the raw reply ISO 7816 APDU string")]
HRESULT ApduReply([in] LPBYTEBUFFER pReplyApdu);
[id(3), propget/*, defaultcollelem*/,
helpstring("Get the byte count (size) of the raw reply ISO 7816 APDU string")]
HRESULT ApduReplyLength([out,retval] LONG* plSize);
[id(3), propput/*, defaultcollelem*/,
helpstring("Set the byte count (size) of the raw reply ISO 7816 APDU string")]
HRESULT ApduReplyLength([in] LONG lSize);
[id(4), propget/*, defaultcollelem*/,
helpstring("Get the current class ID of the ISO 7816 APDU header")]
HRESULT ClassId([out,retval] BYTE* pbyClass);
[id(4), propput/*, defaultcollelem*/,
helpstring("Assign a new class ID in the ISO 7816 APDU header")]
HRESULT ClassId([in,defaultvalue(0)] BYTE byClass);
[id(5), propget/*, defaultcollelem*/,
helpstring("Get the current data portion of the ISO 7816 APDU string")]
HRESULT Data([out,retval] LPBYTEBUFFER *ppData);
[id(5), propput/*, defaultcollelem*/,
helpstring("Assign a new data portion of the ISO 7816 APDU string")]
HRESULT Data([in] LPBYTEBUFFER pData);
[id(6), propget/*, defaultcollelem*/,
helpstring("Get the current instruction ID of the ISO 7816 APDU header")]
HRESULT InstructionId([out,retval] BYTE* pbyIns);
[id(6), propput/*, defaultcollelem*/,
helpstring("Assign a new instruction ID in the ISO 7816 APDU header")]
HRESULT InstructionId([in] BYTE byIns);
[id(7), propget/*, defaultcollelem*/,
helpstring("Get the Le parameter (expected length of reply data) of the ISO 7816 APDU")]
HRESULT LeField([out,retval] LONG* plSize);
[id(8), propget/*, defaultcollelem*/,
helpstring("Get the first parameter of the ISO 7816 APDU header")]
HRESULT P1([out,retval] BYTE* pbyP1);
[id(8), propput/*, defaultcollelem*/,
helpstring("Assign a new first parameter in the ISO 7816 APDU header")]
HRESULT P1([in] BYTE byP1);
[id(9), propget/*, defaultcollelem*/,
helpstring("Get the second parameter of the ISO 7816 APDU header")]
HRESULT P2([out,retval] BYTE* pbyP2);
[id(9), propput/*, defaultcollelem*/,
helpstring("Assign a new second parameter in the ISO 7816 APDU header")]
HRESULT P2([in] BYTE byP2);
[id(10), propget/*, defaultcollelem*/,
helpstring("Get the third parameter of the ISO 7816 APDU header")]
HRESULT P3([out,retval] BYTE* pbyP3);
[id(11), propget/*, defaultcollelem*/,
helpstring("Get the reply status word")]
HRESULT ReplyStatus([out,retval] LPWORD pwStatus);
[id(11), propput/*, defaultcollelem*/,
helpstring("Set (save) the reply status word")]
HRESULT ReplyStatus([in] WORD wStatus);
[id(12), propget/*, defaultcollelem*/,
helpstring("Get the reply status SW1 byte.")]
HRESULT ReplyStatusSW1([out,retval] BYTE* pbySW1);
[id(13), propget/*, defaultcollelem*/,
helpstring("Get the reply status SW2 byte.")]
HRESULT ReplyStatusSW2([out,retval] BYTE* pbySW2);
[id(14), propget/*, defaultcollelem*/,
helpstring("Get the current ISO 7816-4 type of the encapsulated APDU.")]
HRESULT Type([out,retval] ISO_APDU_TYPE* pType);
[id(18), propget/*, defaultcollelem*/,
helpstring("Get the T=1 Node Address")]
HRESULT Nad([out,retval] LPBYTE pbNad);
[id(18), propput/*, defaultcollelem*/,
helpstring("Set (save) the T=1 Node Address")]
HRESULT Nad([in] BYTE bNad);
[id(19), propget/*, defaultcollelem*/,
helpstring("Get the T=1 Reply Node Address")]
HRESULT ReplyNad([out,retval] LPBYTE pbNad);
[id(19), propput/*, defaultcollelem*/,
helpstring("Set (save) the T=1 Reply Node Address")]
HRESULT ReplyNad([in] BYTE bNad);
// Methods -
[id(15),
helpstring("Build a valid ISO 7816 APDU string")]
HRESULT BuildCmd([in] BYTE byClassId,
[in] BYTE byInsId,
[in,defaultvalue(0)] BYTE byP1,
[in,defaultvalue(0)] BYTE byP2,
[in,defaultvalue(NULL)] LPBYTEBUFFER pbyData,
[in,defaultvalue(NULL)] LONG* plLe);
[id(16),
helpstring("Clear the current APDU data")]
HRESULT Clear(void);
[id(17),
helpstring("Encapsulate onother APDU into this one as data")]
HRESULT Encapsulate([in] LPBYTEBUFFER pApdu,
[in] ISO_APDU_TYPE ApduType);
};
cpp_quote("#endif //!_LPSCARDCMD_DEFINED")
cpp_quote("")
cpp_quote("//////////////////////////////////////////////////////////////////")
cpp_quote("//")
cpp_quote("// SCardDat Type Library")
cpp_quote("//")
[
uuid(D5778AE1-43DE-11D0-9171-00AA00C18068),
version(1.0),
//hidden,
//lcid(0x0409), // general language
helpstring("SCardDat 1.0 Type Library")
]
library SCardDatLib
{
// NOTE: must include stdole2.tlb due to problems with the Alpha stdole32.tlb.
// This will generate warnings during build, but compile is successful.
#ifdef _ALPHA_
importlib("stdole2.tlb");
#else
importlib("stdole32.tlb");
#endif
[
uuid(E126F8FF-A7AF-11D0-B88A-00C04FD424B9),
helpstring("ByteBuffer Class")//,
//hidden,
// licensed,
]
coclass ByteBuffer
{
[default] interface IByteBuffer;
};
[
uuid(53B6AA67-3F56-11D0-916B-00AA00C18068),
helpstring("SCardTypeConv(ersion) Class"),
//hidden,
//licensed,
aggregatable
]
coclass CSCardTypeConv
{
[default] interface ISCardTypeConv;
};
[
uuid(D5778AE7-43DE-11D0-9171-00AA00C18068),
helpstring("SCardCmd Class"),
//hidden,
//licensed,
aggregatable
]
coclass CSCardCmd
{
[default] interface ISCardCmd;
};
};
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -