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.

2305 lines
52 KiB

  1. /*++
  2. Copyright (C) Microsoft Corporation, 1996 - 1999
  3. Module Name:
  4. CalCom
  5. Abstract:
  6. This header file describes the classes used to implement communication
  7. between the Calais API DLL and the Calais Service Manager Server.
  8. Author:
  9. Doug Barlow (dbarlow) 10/30/1996
  10. Environment:
  11. Win32, C++ w/ Exceptions
  12. Notes:
  13. ?Notes?
  14. --*/
  15. #ifndef _CALCOM_H_
  16. #define _CALCOM_H_
  17. #include <winSCard.h>
  18. #include <CalaisLb.h>
  19. #define CALAIS_COMM_V1_00 0 // Version identifier for communications
  20. #define CALAIS_COMM_V2_02 0x00020002 // 2.2 Designation
  21. #define CALAIS_COMM_CURRENT CALAIS_COMM_V2_02
  22. #define CALAIS_LOCK_TIMEOUT 20000 // Milliseconds to wait before a lock is
  23. // declared dead.
  24. #define CALAIS_THREAD_TIMEOUT 30000 // Milliseconds to wait before a thread is
  25. // declared dead.
  26. #define CALAIS_COMM_MSGLEN 512 // Expected reasonable size of a message
  27. #include "Locks.h"
  28. class CComInitiator;
  29. class CComResponder;
  30. extern HANDLE g_hCalaisShutdown; // We declare it here, since we don't know
  31. // if it comes from the client or server.
  32. extern DWORD StartCalaisService(void);
  33. extern HANDLE AccessStartedEvent(void);
  34. extern HANDLE AccessStoppedEvent(void);
  35. extern HANDLE AccessNewReaderEvent(void);
  36. extern void ReleaseStartedEvent(void);
  37. extern void ReleaseStoppedEvent(void);
  38. extern void ReleaseNewReaderEvent(void);
  39. extern void ReleaseAllEvents(void);
  40. extern "C" DWORD WINAPI ServiceMonitor(LPVOID pvParameter);
  41. //
  42. // An INTERCHANGEHANDLE is an internal identifier for communications between
  43. // the client and server. It isn't exposed to users. For now, it's a simple
  44. // 32-bit unsigned index value.
  45. //
  46. typedef DWORD INTERCHANGEHANDLE;
  47. //
  48. //==============================================================================
  49. //
  50. // CComChannel
  51. //
  52. class CComChannel
  53. {
  54. public:
  55. // Constructors & Destructor
  56. ~CComChannel();
  57. // Properties
  58. // Methods
  59. DWORD Send(LPCVOID pvData, DWORD cbLen);
  60. void Receive(LPVOID pvData, DWORD cbLen);
  61. void ClosePipe()
  62. {
  63. if (m_hPipe.IsValid())
  64. m_hPipe.Close();
  65. };
  66. HANDLE Process(void) const
  67. { return m_hProc; };
  68. void Process(HANDLE hProc)
  69. { ASSERT(!m_hProc.IsValid());
  70. m_hProc = hProc; };
  71. // Operators
  72. protected:
  73. // Internal comm structures
  74. typedef struct
  75. {
  76. DWORD dwSync;
  77. DWORD dwVersion;
  78. } CONNECT_REQMSG; // Connect request message.
  79. typedef struct
  80. {
  81. DWORD dwStatus;
  82. DWORD dwVersion;
  83. } CONNECT_RSPMSG; // Connect response message.
  84. // Constructors & Destructor
  85. CComChannel(HANDLE hPipe);
  86. // Properties
  87. CHandleObject m_hPipe;
  88. CHandleObject m_hProc;
  89. CHandleObject m_hOvrWait;
  90. OVERLAPPED m_ovrlp;
  91. // Methods
  92. // Friends
  93. friend class CComInitiator;
  94. friend class CComResponder;
  95. friend DWORD WINAPI ServiceMonitor(LPVOID pvParameter);
  96. };
  97. //
  98. //==============================================================================
  99. //
  100. // CComInitiator
  101. //
  102. class CComInitiator
  103. {
  104. public:
  105. // Constructors & Destructor
  106. // Properties
  107. // Methods
  108. CComChannel *Initiate(LPCTSTR szName, LPDWORD pdwVersion) const;
  109. // Operators
  110. protected:
  111. // Properties
  112. // Methods
  113. };
  114. //
  115. //==============================================================================
  116. //
  117. // CComResponder
  118. //
  119. class CComResponder
  120. {
  121. public:
  122. // Constructors & Destructor
  123. CComResponder();
  124. ~CComResponder();
  125. // Properties
  126. // Methods
  127. void Create(LPCTSTR szName);
  128. CComChannel *Listen(void);
  129. // Operators
  130. protected:
  131. // Properties
  132. CHandleObject m_hComPipe;
  133. CHandleObject m_hAccessMutex;
  134. CBuffer m_bfPipeName;
  135. CSecurityDescriptor m_aclPipe;
  136. OVERLAPPED m_ovrlp;
  137. CHandleObject m_hOvrWait;
  138. // Methods
  139. void Clean(void);
  140. void Clear(void);
  141. };
  142. //
  143. //==============================================================================
  144. //
  145. // CComObject and derivatives.
  146. //
  147. class CComObject
  148. {
  149. public:
  150. typedef enum
  151. {
  152. EstablishContext_request = 0,
  153. EstablishContext_response,
  154. ReleaseContext_request,
  155. ReleaseContext_response,
  156. IsValidContext_request,
  157. IsValidContext_response,
  158. #if 0
  159. ListReaderGroups_request,
  160. ListReaderGroups_response,
  161. #endif
  162. ListReaders_request,
  163. ListReaders_response,
  164. #if 0
  165. ListCards_request,
  166. ListCards_response,
  167. ListInterfaces_request,
  168. ListInterfaces_response,
  169. GetProviderId_request,
  170. GetProviderId_response,
  171. IntroduceReaderGroup_request,
  172. IntroduceReaderGroup_response,
  173. ForgetReaderGroup_request,
  174. ForgetReaderGroup_response,
  175. IntroduceReader_request,
  176. IntroduceReader_response,
  177. ForgetReader_request,
  178. ForgetReader_response,
  179. AddReaderToGroup_request,
  180. AddReaderToGroup_response,
  181. RemoveReaderFromGroup_request,
  182. RemoveReaderFromGroup_response,
  183. IntroduceCardType_request,
  184. IntroduceCardType_response,
  185. ForgetCardType_request,
  186. ForgetCardType_response,
  187. FreeMemory_request,
  188. FreeMemory_response,
  189. #endif
  190. LocateCards_request,
  191. LocateCards_response,
  192. GetStatusChange_request,
  193. GetStatusChange_response,
  194. #if 0
  195. Cancel_request,
  196. Cancel_response,
  197. #endif
  198. Connect_request,
  199. Connect_response,
  200. Reconnect_request,
  201. Reconnect_response,
  202. Disconnect_request,
  203. Disconnect_response,
  204. BeginTransaction_request,
  205. BeginTransaction_response,
  206. EndTransaction_request,
  207. EndTransaction_response,
  208. Status_request,
  209. Status_response,
  210. Transmit_request,
  211. Transmit_response,
  212. OpenReader_request,
  213. OpenReader_response,
  214. Control_request,
  215. Control_response,
  216. GetAttrib_request,
  217. GetAttrib_response,
  218. SetAttrib_request,
  219. SetAttrib_response,
  220. OutofRange
  221. } COMMAND_ID;
  222. typedef struct
  223. {
  224. DWORD
  225. dwCommandId,
  226. dwTotalLength,
  227. dwDataOffset;
  228. } CObjGeneric_request;
  229. typedef struct
  230. {
  231. DWORD
  232. dwCommandId,
  233. dwTotalLength,
  234. dwDataOffset,
  235. dwStatus;
  236. } CObjGeneric_response;
  237. typedef struct
  238. {
  239. DWORD
  240. dwOffset,
  241. dwLength;
  242. } Desc;
  243. static const DWORD
  244. AUTOCOUNT, // Append symbol to force computing string length.
  245. MULTISTRING; // Append symbol to force computing multistring length.
  246. // Constructors & Destructor
  247. CComObject();
  248. virtual ~CComObject() /* Mandatory Base Class Destructor */
  249. {
  250. // Our storage buffer may contain sensitive data such as user
  251. // PINs. Scrub this buffer if it exists.
  252. if (NULL != m_pbfActive)
  253. {
  254. RtlSecureZeroMemory(m_pbfActive->Access(), m_pbfActive->Length());
  255. }
  256. };
  257. // Properties
  258. // Methods
  259. #ifdef DBG
  260. void dbgCheck(void) const;
  261. #define ComObjCheck dbgCheck()
  262. #else
  263. #define ComObjCheck
  264. #endif
  265. static CComObject *
  266. ReceiveComObject( // Spit out the type of Com Object coming in.
  267. CComChannel *pChannel);
  268. CObjGeneric_response *Receive(CComChannel *pChannel);
  269. DWORD Send(CComChannel *pChannel);
  270. LPBYTE Request(void) const
  271. { return m_bfRequest.Access(); };
  272. LPBYTE Response(void) const
  273. { return m_bfResponse.Access(); };
  274. LPBYTE Data(void) const
  275. {
  276. ComObjCheck;
  277. return m_pbfActive->Access();
  278. };
  279. DWORD Length(void) const
  280. {
  281. ComObjCheck;
  282. return m_pbfActive->Length();
  283. };
  284. COMMAND_ID Type(void) const
  285. {
  286. ComObjCheck;
  287. return (COMMAND_ID)(*(LPDWORD)Data());
  288. };
  289. void Presize(DWORD cbSize)
  290. {
  291. ComObjCheck;
  292. m_pbfActive->Presize(cbSize);
  293. };
  294. LPVOID Prep(Desc &dsc, DWORD cbLength);
  295. LPBYTE Append(Desc &dsc, LPCGUID rgguid, DWORD cguid)
  296. { return Append(dsc, (LPCBYTE)rgguid, cguid * sizeof(GUID)); };
  297. LPBYTE Append(Desc &dsc, LPCTSTR szString, DWORD cchLen = AUTOCOUNT);
  298. LPBYTE Append(Desc &dsc, LPCBYTE pbData, DWORD cbLength);
  299. LPCVOID Parse(Desc &dsc, LPDWORD pcbLen = NULL);
  300. // Operators
  301. protected:
  302. // Properties
  303. CBuffer *m_pbfActive;
  304. CBuffer m_bfRequest;
  305. CBuffer m_bfResponse;
  306. // Methods
  307. void InitStruct(DWORD dwCommandId, DWORD dwDataOffset, DWORD dwExtra);
  308. // Friends
  309. friend CComObject * ReceiveComObject(HANDLE hFile);
  310. };
  311. //
  312. ////////////////////////////////////////////////////////////////////////////////
  313. //
  314. // Service Manager Access Services
  315. //
  316. // The following services are used to manage user and terminal contexts for
  317. // smartcards.
  318. //
  319. // The first few fields are very specific. For request structures they
  320. // must be:
  321. //
  322. // DWORD
  323. // dwCommandId,
  324. // dwTotalLength,
  325. // dwDataOffset;
  326. //
  327. // and for response structures they must be:
  328. //
  329. // DWORD
  330. // dwCommandId,
  331. // dwTotalLength,
  332. // dwDataOffset,
  333. // dwStatus;
  334. //
  335. // As defined for CObjGeneric_request and CObjGeneric_response,
  336. // respectively.
  337. //
  338. //
  339. // ComEstablishContext
  340. //
  341. class ComEstablishContext
  342. : public CComObject
  343. {
  344. public:
  345. typedef struct
  346. {
  347. DWORD
  348. dwCommandId,
  349. dwTotalLength,
  350. dwDataOffset;
  351. DWORD dwProcId;
  352. UINT64 hptrCancelEvent;
  353. } CObjEstablishContext_request;
  354. typedef struct
  355. {
  356. DWORD
  357. dwCommandId,
  358. dwTotalLength,
  359. dwDataOffset,
  360. dwStatus;
  361. DWORD dwProcId;
  362. UINT64 hptrCancelEvent;
  363. } CObjEstablishContext_response;
  364. // Constructors & Destructor
  365. // Properties
  366. // Methods
  367. CObjEstablishContext_request *InitRequest(DWORD dwExtraLen)
  368. {
  369. InitStruct(
  370. EstablishContext_request,
  371. sizeof(CObjEstablishContext_request),
  372. dwExtraLen);
  373. return (CObjEstablishContext_request *)Data();
  374. };
  375. CObjEstablishContext_response *InitResponse(DWORD dwExtraLen)
  376. {
  377. InitStruct(
  378. EstablishContext_response,
  379. sizeof(CObjEstablishContext_response),
  380. dwExtraLen);
  381. return (CObjEstablishContext_response *)Data();
  382. };
  383. CObjEstablishContext_response *Receive(CComChannel *pChannel)
  384. {
  385. return (CObjEstablishContext_response *)CComObject::Receive(pChannel);
  386. };
  387. // Operators
  388. protected:
  389. // Properties
  390. // Methods
  391. };
  392. //
  393. // ComReleaseContext
  394. //
  395. class ComReleaseContext
  396. : public CComObject
  397. {
  398. public:
  399. typedef struct
  400. {
  401. DWORD
  402. dwCommandId,
  403. dwTotalLength,
  404. dwDataOffset;
  405. } CObjReleaseContext_request;
  406. typedef struct
  407. {
  408. DWORD
  409. dwCommandId,
  410. dwTotalLength,
  411. dwDataOffset,
  412. dwStatus;
  413. } CObjReleaseContext_response;
  414. // Constructors & Destructor
  415. // Properties
  416. // Methods
  417. CObjReleaseContext_request *InitRequest(DWORD dwExtraLen)
  418. {
  419. InitStruct(
  420. ReleaseContext_request,
  421. sizeof(CObjReleaseContext_request),
  422. dwExtraLen);
  423. return (CObjReleaseContext_request *)Data();
  424. };
  425. CObjReleaseContext_response *InitResponse(DWORD dwExtraLen)
  426. {
  427. InitStruct(
  428. ReleaseContext_response,
  429. sizeof(CObjReleaseContext_response),
  430. dwExtraLen);
  431. return (CObjReleaseContext_response *)Data();
  432. };
  433. CObjReleaseContext_response *Receive(CComChannel *pChannel)
  434. {
  435. return (CObjReleaseContext_response *)CComObject::Receive(pChannel);
  436. };
  437. // Operators
  438. protected:
  439. // Properties
  440. // Methods
  441. };
  442. //
  443. // ComIsValidContext
  444. //
  445. class ComIsValidContext
  446. : public CComObject
  447. {
  448. public:
  449. typedef struct
  450. {
  451. DWORD
  452. dwCommandId,
  453. dwTotalLength,
  454. dwDataOffset;
  455. } CObjIsValidContext_request;
  456. typedef struct
  457. {
  458. DWORD
  459. dwCommandId,
  460. dwTotalLength,
  461. dwDataOffset,
  462. dwStatus;
  463. } CObjIsValidContext_response;
  464. // Constructors & Destructor
  465. // Properties
  466. // Methods
  467. CObjIsValidContext_request *InitRequest(DWORD dwExtraLen)
  468. {
  469. InitStruct(
  470. IsValidContext_request,
  471. sizeof(CObjIsValidContext_request),
  472. dwExtraLen);
  473. return (CObjIsValidContext_request *)Data();
  474. };
  475. CObjIsValidContext_response *InitResponse(DWORD dwExtraLen)
  476. {
  477. InitStruct(
  478. IsValidContext_response,
  479. sizeof(CObjIsValidContext_response),
  480. dwExtraLen);
  481. return (CObjIsValidContext_response *)Data();
  482. };
  483. CObjIsValidContext_response *Receive(CComChannel *pChannel)
  484. {
  485. return (CObjIsValidContext_response *)CComObject::Receive(pChannel);
  486. };
  487. // Operators
  488. protected:
  489. // Properties
  490. // Methods
  491. };
  492. //
  493. ////////////////////////////////////////////////////////////////////////////////
  494. //
  495. // Reader Services
  496. //
  497. // The following services supply means for tracking cards within readers.
  498. //
  499. //
  500. // ComLocateCards
  501. //
  502. class ComLocateCards
  503. : public CComObject
  504. {
  505. public:
  506. typedef struct
  507. {
  508. DWORD
  509. dwCommandId,
  510. dwTotalLength,
  511. dwDataOffset;
  512. Desc dscAtrs; // ATR strings w/ leading byte length.
  513. Desc dscAtrMasks; // ATR Masks w/ leading byte length.
  514. Desc dscReaders; // mszReaders as device names
  515. Desc dscReaderStates; // rgdwReaderStates
  516. } CObjLocateCards_request;
  517. typedef struct
  518. {
  519. DWORD
  520. dwCommandId,
  521. dwTotalLength,
  522. dwDataOffset,
  523. dwStatus;
  524. Desc dscReaderStates; // rgdwReaderStates
  525. Desc dscAtrs; // ATR strings w/ leading byte length.
  526. } CObjLocateCards_response;
  527. // Constructors & Destructor
  528. // Properties
  529. // Methods
  530. CObjLocateCards_request *InitRequest(DWORD dwExtraLen)
  531. {
  532. InitStruct(
  533. LocateCards_request,
  534. sizeof(CObjLocateCards_request),
  535. dwExtraLen);
  536. return (CObjLocateCards_request *)Data();
  537. };
  538. CObjLocateCards_response *InitResponse(DWORD dwExtraLen)
  539. {
  540. InitStruct(
  541. LocateCards_response,
  542. sizeof(CObjLocateCards_response),
  543. dwExtraLen);
  544. return (CObjLocateCards_response *)Data();
  545. };
  546. CObjLocateCards_response *Receive(CComChannel *pChannel)
  547. {
  548. return (CObjLocateCards_response *)CComObject::Receive(pChannel);
  549. };
  550. // Operators
  551. protected:
  552. // Properties
  553. // Methods
  554. };
  555. //
  556. // ComGetStatusChange
  557. //
  558. class ComGetStatusChange
  559. : public CComObject
  560. {
  561. public:
  562. typedef struct
  563. {
  564. DWORD
  565. dwCommandId,
  566. dwTotalLength,
  567. dwDataOffset;
  568. DWORD dwTimeout;
  569. Desc dscReaders; // mszReaders as device names.
  570. Desc dscReaderStates; // rgdwReaderStates
  571. } CObjGetStatusChange_request;
  572. typedef struct
  573. {
  574. DWORD
  575. dwCommandId,
  576. dwTotalLength,
  577. dwDataOffset,
  578. dwStatus;
  579. Desc dscReaderStates; // rgdwReaderStates
  580. Desc dscAtrs; // ATR strings w/ leading byte length.
  581. } CObjGetStatusChange_response;
  582. // Constructors & Destructor
  583. // Properties
  584. // Methods
  585. CObjGetStatusChange_request *InitRequest(DWORD dwExtraLen)
  586. {
  587. InitStruct(
  588. GetStatusChange_request,
  589. sizeof(CObjGetStatusChange_request),
  590. dwExtraLen);
  591. return (CObjGetStatusChange_request *)Data();
  592. };
  593. CObjGetStatusChange_response *InitResponse(DWORD dwExtraLen)
  594. {
  595. InitStruct(
  596. GetStatusChange_response,
  597. sizeof(CObjGetStatusChange_response),
  598. dwExtraLen);
  599. return (CObjGetStatusChange_response *)Data();
  600. };
  601. CObjGetStatusChange_response *Receive(CComChannel *pChannel)
  602. {
  603. return (CObjGetStatusChange_response *)CComObject::Receive(pChannel);
  604. };
  605. // Operators
  606. protected:
  607. // Properties
  608. // Methods
  609. };
  610. //
  611. ////////////////////////////////////////////////////////////////////////////////
  612. //
  613. // Card/Reader Access Services
  614. //
  615. // The following services provide means for establishing communication with
  616. // the card.
  617. //
  618. //
  619. // ComConnect
  620. //
  621. class ComConnect
  622. : public CComObject
  623. {
  624. public:
  625. typedef struct
  626. {
  627. DWORD
  628. dwCommandId,
  629. dwTotalLength,
  630. dwDataOffset;
  631. DWORD dwShareMode;
  632. DWORD dwPreferredProtocols;
  633. Desc dscReader; // szReader
  634. } CObjConnect_request;
  635. typedef struct
  636. {
  637. DWORD
  638. dwCommandId,
  639. dwTotalLength,
  640. dwDataOffset,
  641. dwStatus;
  642. INTERCHANGEHANDLE hCard;
  643. DWORD dwActiveProtocol;
  644. } CObjConnect_response;
  645. // Constructors & Destructor
  646. // Properties
  647. // Methods
  648. CObjConnect_request *InitRequest(DWORD dwExtraLen)
  649. {
  650. InitStruct(
  651. Connect_request,
  652. sizeof(CObjConnect_request),
  653. dwExtraLen);
  654. return (CObjConnect_request *)Data();
  655. };
  656. CObjConnect_response *InitResponse(DWORD dwExtraLen)
  657. {
  658. InitStruct(
  659. Connect_response,
  660. sizeof(CObjConnect_response),
  661. dwExtraLen);
  662. return (CObjConnect_response *)Data();
  663. };
  664. CObjConnect_response *Receive(CComChannel *pChannel)
  665. {
  666. return (CObjConnect_response *)CComObject::Receive(pChannel);
  667. };
  668. // Operators
  669. protected:
  670. // Properties
  671. // Methods
  672. };
  673. //
  674. // ComReconnect
  675. //
  676. class ComReconnect
  677. : public CComObject
  678. {
  679. public:
  680. typedef struct
  681. {
  682. DWORD
  683. dwCommandId,
  684. dwTotalLength,
  685. dwDataOffset;
  686. INTERCHANGEHANDLE hCard;
  687. DWORD dwShareMode;
  688. DWORD dwPreferredProtocols;
  689. DWORD dwInitialization;
  690. } CObjReconnect_request;
  691. typedef struct
  692. {
  693. DWORD
  694. dwCommandId,
  695. dwTotalLength,
  696. dwDataOffset,
  697. dwStatus;
  698. DWORD dwActiveProtocol;
  699. } CObjReconnect_response;
  700. // Constructors & Destructor
  701. // Properties
  702. // Methods
  703. CObjReconnect_request *InitRequest(DWORD dwExtraLen)
  704. {
  705. InitStruct(
  706. Reconnect_request,
  707. sizeof(CObjReconnect_request),
  708. dwExtraLen);
  709. return (CObjReconnect_request *)Data();
  710. };
  711. CObjReconnect_response *InitResponse(DWORD dwExtraLen)
  712. {
  713. InitStruct(
  714. Reconnect_response,
  715. sizeof(CObjReconnect_response),
  716. dwExtraLen);
  717. return (CObjReconnect_response *)Data();
  718. };
  719. CObjReconnect_response *Receive(CComChannel *pChannel)
  720. {
  721. return (CObjReconnect_response *)CComObject::Receive(pChannel);
  722. };
  723. // Operators
  724. protected:
  725. // Properties
  726. // Methods
  727. };
  728. //
  729. // ComDisconnect
  730. //
  731. class ComDisconnect
  732. : public CComObject
  733. {
  734. public:
  735. typedef struct
  736. {
  737. DWORD
  738. dwCommandId,
  739. dwTotalLength,
  740. dwDataOffset;
  741. INTERCHANGEHANDLE hCard;
  742. DWORD dwDisposition;
  743. } CObjDisconnect_request;
  744. typedef struct
  745. {
  746. DWORD
  747. dwCommandId,
  748. dwTotalLength,
  749. dwDataOffset,
  750. dwStatus;
  751. } CObjDisconnect_response;
  752. // Constructors & Destructor
  753. // Properties
  754. // Methods
  755. CObjDisconnect_request *InitRequest(DWORD dwExtraLen)
  756. {
  757. InitStruct(
  758. Disconnect_request,
  759. sizeof(CObjDisconnect_request),
  760. dwExtraLen);
  761. return (CObjDisconnect_request *)Data();
  762. };
  763. CObjDisconnect_response *InitResponse(DWORD dwExtraLen)
  764. {
  765. InitStruct(
  766. Disconnect_response,
  767. sizeof(CObjDisconnect_response),
  768. dwExtraLen);
  769. return (CObjDisconnect_response *)Data();
  770. };
  771. CObjDisconnect_response *Receive(CComChannel *pChannel)
  772. {
  773. return (CObjDisconnect_response *)CComObject::Receive(pChannel);
  774. };
  775. // Operators
  776. protected:
  777. // Properties
  778. // Methods
  779. };
  780. //
  781. // ComBeginTransaction
  782. //
  783. class ComBeginTransaction
  784. : public CComObject
  785. {
  786. public:
  787. typedef struct
  788. {
  789. DWORD
  790. dwCommandId,
  791. dwTotalLength,
  792. dwDataOffset;
  793. INTERCHANGEHANDLE hCard;
  794. } CObjBeginTransaction_request;
  795. typedef struct
  796. {
  797. DWORD
  798. dwCommandId,
  799. dwTotalLength,
  800. dwDataOffset,
  801. dwStatus;
  802. } CObjBeginTransaction_response;
  803. // Constructors & Destructor
  804. // Properties
  805. // Methods
  806. CObjBeginTransaction_request *InitRequest(DWORD dwExtraLen)
  807. {
  808. InitStruct(
  809. BeginTransaction_request,
  810. sizeof(CObjBeginTransaction_request),
  811. dwExtraLen);
  812. return (CObjBeginTransaction_request *)Data();
  813. };
  814. CObjBeginTransaction_response *InitResponse(DWORD dwExtraLen)
  815. {
  816. InitStruct(
  817. BeginTransaction_response,
  818. sizeof(CObjBeginTransaction_response),
  819. dwExtraLen);
  820. return (CObjBeginTransaction_response *)Data();
  821. };
  822. CObjBeginTransaction_response *Receive(CComChannel *pChannel)
  823. {
  824. return (CObjBeginTransaction_response *)CComObject::Receive(pChannel);
  825. };
  826. // Operators
  827. protected:
  828. // Properties
  829. // Methods
  830. };
  831. //
  832. // ComEndTransaction
  833. //
  834. class ComEndTransaction
  835. : public CComObject
  836. {
  837. public:
  838. typedef struct
  839. {
  840. DWORD
  841. dwCommandId,
  842. dwTotalLength,
  843. dwDataOffset;
  844. INTERCHANGEHANDLE hCard;
  845. DWORD dwDisposition;
  846. } CObjEndTransaction_request;
  847. typedef struct
  848. {
  849. DWORD
  850. dwCommandId,
  851. dwTotalLength,
  852. dwDataOffset,
  853. dwStatus;
  854. } CObjEndTransaction_response;
  855. // Constructors & Destructor
  856. // Properties
  857. // Methods
  858. CObjEndTransaction_request *InitRequest(DWORD dwExtraLen)
  859. {
  860. InitStruct(
  861. EndTransaction_request,
  862. sizeof(CObjEndTransaction_request),
  863. dwExtraLen);
  864. return (CObjEndTransaction_request *)Data();
  865. };
  866. CObjEndTransaction_response *InitResponse(DWORD dwExtraLen)
  867. {
  868. InitStruct(
  869. EndTransaction_response,
  870. sizeof(CObjEndTransaction_response),
  871. dwExtraLen);
  872. return (CObjEndTransaction_response *)Data();
  873. };
  874. CObjEndTransaction_response *Receive(CComChannel *pChannel)
  875. {
  876. return (CObjEndTransaction_response *)CComObject::Receive(pChannel);
  877. };
  878. // Operators
  879. protected:
  880. // Properties
  881. // Methods
  882. };
  883. //
  884. // ComStatus
  885. //
  886. class ComStatus
  887. : public CComObject
  888. {
  889. public:
  890. typedef struct
  891. {
  892. DWORD
  893. dwCommandId,
  894. dwTotalLength,
  895. dwDataOffset;
  896. INTERCHANGEHANDLE hCard;
  897. } CObjStatus_request;
  898. typedef struct
  899. {
  900. DWORD
  901. dwCommandId,
  902. dwTotalLength,
  903. dwDataOffset,
  904. dwStatus;
  905. DWORD dwState;
  906. DWORD dwProtocol;
  907. Desc dscAtr; // pbAtr
  908. Desc dscSysName; // szReader
  909. } CObjStatus_response;
  910. // Constructors & Destructor
  911. // Properties
  912. // Methods
  913. CObjStatus_request *InitRequest(DWORD dwExtraLen)
  914. {
  915. InitStruct(
  916. Status_request,
  917. sizeof(CObjStatus_request),
  918. dwExtraLen);
  919. return (CObjStatus_request *)Data();
  920. };
  921. CObjStatus_response *InitResponse(DWORD dwExtraLen)
  922. {
  923. InitStruct(
  924. Status_response,
  925. sizeof(CObjStatus_response),
  926. dwExtraLen);
  927. return (CObjStatus_response *)Data();
  928. };
  929. CObjStatus_response *Receive(CComChannel *pChannel)
  930. {
  931. return (CObjStatus_response *)CComObject::Receive(pChannel);
  932. };
  933. // Operators
  934. protected:
  935. // Properties
  936. // Methods
  937. };
  938. //
  939. // ComTransmit
  940. //
  941. class ComTransmit
  942. : public CComObject
  943. {
  944. public:
  945. typedef struct
  946. {
  947. DWORD
  948. dwCommandId,
  949. dwTotalLength,
  950. dwDataOffset;
  951. INTERCHANGEHANDLE hCard;
  952. DWORD dwPciLength;
  953. DWORD dwRecvLength;
  954. Desc dscSendPci; // pioSendPci
  955. Desc dscSendBuffer; // pbSendBuffer
  956. } CObjTransmit_request;
  957. typedef struct
  958. {
  959. DWORD
  960. dwCommandId,
  961. dwTotalLength,
  962. dwDataOffset,
  963. dwStatus;
  964. Desc dscRecvPci; // pioRecvPci
  965. Desc dscRecvBuffer; // pbRecvBuffer
  966. } CObjTransmit_response;
  967. // Constructors & Destructor
  968. // Properties
  969. // Methods
  970. CObjTransmit_request *InitRequest(DWORD dwExtraLen)
  971. {
  972. InitStruct(
  973. Transmit_request,
  974. sizeof(CObjTransmit_request),
  975. dwExtraLen);
  976. return (CObjTransmit_request *)Data();
  977. };
  978. CObjTransmit_response *InitResponse(DWORD dwExtraLen)
  979. {
  980. InitStruct(
  981. Transmit_response,
  982. sizeof(CObjTransmit_response),
  983. dwExtraLen);
  984. return (CObjTransmit_response *)Data();
  985. };
  986. CObjTransmit_response *Receive(CComChannel *pChannel)
  987. {
  988. return (CObjTransmit_response *)CComObject::Receive(pChannel);
  989. };
  990. // Operators
  991. protected:
  992. // Properties
  993. // Methods
  994. };
  995. //
  996. ////////////////////////////////////////////////////////////////////////////////
  997. //
  998. // Reader Control Routines
  999. //
  1000. // The following services provide for direct, low-level manipulation of the
  1001. // reader by the calling application allowing it control over the
  1002. // attributes of the communications with the card. This control is done
  1003. // via an SCARD_ATTRIBUTES structure, which is defined as follows:
  1004. //
  1005. //
  1006. // ComOpenReader
  1007. //
  1008. class ComOpenReader
  1009. : public CComObject
  1010. {
  1011. public:
  1012. typedef struct
  1013. {
  1014. DWORD
  1015. dwCommandId,
  1016. dwTotalLength,
  1017. dwDataOffset;
  1018. Desc dscReader; // szReader
  1019. } CObjOpenReader_request;
  1020. typedef struct
  1021. {
  1022. DWORD
  1023. dwCommandId,
  1024. dwTotalLength,
  1025. dwDataOffset,
  1026. dwStatus;
  1027. INTERCHANGEHANDLE hReader;
  1028. DWORD dwState;
  1029. } CObjOpenReader_response;
  1030. // Constructors & Destructor
  1031. // Properties
  1032. // Methods
  1033. CObjOpenReader_request *InitRequest(DWORD dwExtraLen)
  1034. {
  1035. InitStruct(
  1036. OpenReader_request,
  1037. sizeof(CObjOpenReader_request),
  1038. dwExtraLen);
  1039. return (CObjOpenReader_request *)Data();
  1040. };
  1041. CObjOpenReader_response *InitResponse(DWORD dwExtraLen)
  1042. {
  1043. InitStruct(
  1044. OpenReader_response,
  1045. sizeof(CObjOpenReader_response),
  1046. dwExtraLen);
  1047. return (CObjOpenReader_response *)Data();
  1048. };
  1049. CObjOpenReader_response *Receive(CComChannel *pChannel)
  1050. {
  1051. return (CObjOpenReader_response *)CComObject::Receive(pChannel);
  1052. };
  1053. // Operators
  1054. protected:
  1055. // Properties
  1056. // Methods
  1057. };
  1058. //
  1059. // ComControl
  1060. //
  1061. class ComControl
  1062. : public CComObject
  1063. {
  1064. public:
  1065. typedef struct
  1066. {
  1067. DWORD
  1068. dwCommandId,
  1069. dwTotalLength,
  1070. dwDataOffset;
  1071. INTERCHANGEHANDLE hCard;
  1072. DWORD dwControlCode;
  1073. DWORD dwOutLength;
  1074. Desc dscInBuffer; // lpInBuffer
  1075. } CObjControl_request;
  1076. typedef struct
  1077. {
  1078. DWORD
  1079. dwCommandId,
  1080. dwTotalLength,
  1081. dwDataOffset,
  1082. dwStatus;
  1083. Desc dscOutBuffer; // lpOutBuffer
  1084. } CObjControl_response;
  1085. // Constructors & Destructor
  1086. // Properties
  1087. // Methods
  1088. CObjControl_request *InitRequest(DWORD dwExtraLen)
  1089. {
  1090. InitStruct(
  1091. Control_request,
  1092. sizeof(CObjControl_request),
  1093. dwExtraLen);
  1094. return (CObjControl_request *)Data();
  1095. };
  1096. CObjControl_response *InitResponse(DWORD dwExtraLen)
  1097. {
  1098. InitStruct(
  1099. Control_response,
  1100. sizeof(CObjControl_response),
  1101. dwExtraLen);
  1102. return (CObjControl_response *)Data();
  1103. };
  1104. CObjControl_response *Receive(CComChannel *pChannel)
  1105. {
  1106. return (CObjControl_response *)CComObject::Receive(pChannel);
  1107. };
  1108. // Operators
  1109. protected:
  1110. // Properties
  1111. // Methods
  1112. };
  1113. //
  1114. // ComGetAttrib
  1115. //
  1116. class ComGetAttrib
  1117. : public CComObject
  1118. {
  1119. public:
  1120. typedef struct
  1121. {
  1122. DWORD
  1123. dwCommandId,
  1124. dwTotalLength,
  1125. dwDataOffset;
  1126. INTERCHANGEHANDLE hCard;
  1127. DWORD dwAttrId;
  1128. DWORD dwOutLength;
  1129. } CObjGetAttrib_request;
  1130. typedef struct
  1131. {
  1132. DWORD
  1133. dwCommandId,
  1134. dwTotalLength,
  1135. dwDataOffset,
  1136. dwStatus;
  1137. Desc dscAttr; // pbAttr
  1138. } CObjGetAttrib_response;
  1139. // Constructors & Destructor
  1140. // Properties
  1141. // Methods
  1142. CObjGetAttrib_request *InitRequest(DWORD dwExtraLen)
  1143. {
  1144. InitStruct(
  1145. GetAttrib_request,
  1146. sizeof(CObjGetAttrib_request),
  1147. dwExtraLen);
  1148. return (CObjGetAttrib_request *)Data();
  1149. };
  1150. CObjGetAttrib_response *InitResponse(DWORD dwExtraLen)
  1151. {
  1152. InitStruct(
  1153. GetAttrib_response,
  1154. sizeof(CObjGetAttrib_response),
  1155. dwExtraLen);
  1156. return (CObjGetAttrib_response *)Data();
  1157. };
  1158. CObjGetAttrib_response *Receive(CComChannel *pChannel)
  1159. {
  1160. return (CObjGetAttrib_response *)CComObject::Receive(pChannel);
  1161. };
  1162. // Operators
  1163. protected:
  1164. // Properties
  1165. // Methods
  1166. };
  1167. //
  1168. // ComSetAttrib
  1169. //
  1170. class ComSetAttrib
  1171. : public CComObject
  1172. {
  1173. public:
  1174. typedef struct
  1175. {
  1176. DWORD
  1177. dwCommandId,
  1178. dwTotalLength,
  1179. dwDataOffset;
  1180. INTERCHANGEHANDLE hCard;
  1181. DWORD dwAttrId;
  1182. Desc dscAttr; // pbAttr
  1183. } CObjSetAttrib_request;
  1184. typedef struct
  1185. {
  1186. DWORD
  1187. dwCommandId,
  1188. dwTotalLength,
  1189. dwDataOffset,
  1190. dwStatus;
  1191. } CObjSetAttrib_response;
  1192. // Constructors & Destructor
  1193. // Properties
  1194. // Methods
  1195. CObjSetAttrib_request *InitRequest(DWORD dwExtraLen)
  1196. {
  1197. InitStruct(
  1198. SetAttrib_request,
  1199. sizeof(CObjSetAttrib_request),
  1200. dwExtraLen);
  1201. return (CObjSetAttrib_request *)Data();
  1202. };
  1203. CObjSetAttrib_response *InitResponse(DWORD dwExtraLen)
  1204. {
  1205. InitStruct(
  1206. SetAttrib_response,
  1207. sizeof(CObjSetAttrib_response),
  1208. dwExtraLen);
  1209. return (CObjSetAttrib_response *)Data();
  1210. };
  1211. CObjSetAttrib_response *Receive(CComChannel *pChannel)
  1212. {
  1213. return (CObjSetAttrib_response *)CComObject::Receive(pChannel);
  1214. };
  1215. // Operators
  1216. protected:
  1217. // Properties
  1218. // Methods
  1219. };
  1220. //
  1221. ////////////////////////////////////////////////////////////////////////////////
  1222. //
  1223. // Smartcard Database Management Services
  1224. //
  1225. // The following services provide for managing the Smartcard Database.
  1226. //
  1227. //
  1228. // ComListReaders
  1229. //
  1230. class ComListReaders
  1231. : public CComObject
  1232. {
  1233. public:
  1234. typedef struct
  1235. {
  1236. DWORD
  1237. dwCommandId,
  1238. dwTotalLength,
  1239. dwDataOffset;
  1240. Desc dscReaders; // mszReaders
  1241. } CObjListReaders_request;
  1242. typedef struct
  1243. {
  1244. DWORD
  1245. dwCommandId,
  1246. dwTotalLength,
  1247. dwDataOffset,
  1248. dwStatus;
  1249. Desc dscReaders; // rgfReaderActive
  1250. } CObjListReaders_response;
  1251. // Constructors & Destructor
  1252. // Properties
  1253. // Methods
  1254. CObjListReaders_request *InitRequest(DWORD dwExtraLen)
  1255. {
  1256. InitStruct(
  1257. ListReaders_request,
  1258. sizeof(CObjListReaders_request),
  1259. dwExtraLen);
  1260. return (CObjListReaders_request *)Data();
  1261. };
  1262. CObjListReaders_response *InitResponse(DWORD dwExtraLen)
  1263. {
  1264. InitStruct(
  1265. ListReaders_response,
  1266. sizeof(CObjListReaders_response),
  1267. dwExtraLen);
  1268. return (CObjListReaders_response *)Data();
  1269. };
  1270. CObjListReaders_response *Receive(CComChannel *pChannel)
  1271. {
  1272. return (CObjListReaders_response *)CComObject::Receive(pChannel);
  1273. };
  1274. // Operators
  1275. protected:
  1276. // Properties
  1277. // Methods
  1278. };
  1279. #if 0
  1280. //
  1281. // ComListReaderGroups
  1282. //
  1283. class ComListReaderGroups
  1284. : public CComObject
  1285. {
  1286. public:
  1287. typedef struct
  1288. {
  1289. DWORD
  1290. dwCommandId,
  1291. dwTotalLength,
  1292. dwDataOffset;
  1293. } CObjListReaderGroups_request;
  1294. typedef struct
  1295. {
  1296. DWORD
  1297. dwCommandId,
  1298. dwTotalLength,
  1299. dwDataOffset,
  1300. dwStatus;
  1301. Desc dscGroups; // mszGroups
  1302. } CObjListReaderGroups_response;
  1303. // Constructors & Destructor
  1304. // Properties
  1305. // Methods
  1306. CObjListReaderGroups_request *InitRequest(DWORD dwExtraLen)
  1307. {
  1308. InitStruct(
  1309. ListReaderGroups_request,
  1310. sizeof(CObjListReaderGroups_request),
  1311. dwExtraLen);
  1312. return (CObjListReaderGroups_request *)Data();
  1313. };
  1314. CObjListReaderGroups_response *InitResponse(DWORD dwExtraLen)
  1315. {
  1316. InitStruct(
  1317. ListReaderGroups_response,
  1318. sizeof(CObjListReaderGroups_response),
  1319. dwExtraLen);
  1320. return (CObjListReaderGroups_response *)Data();
  1321. };
  1322. CObjListReaderGroups_response *Receive(CComChannel *pChannel)
  1323. {
  1324. return (CObjListReaderGroups_response *)CComObject::Receive(pChannel);
  1325. };
  1326. // Operators
  1327. protected:
  1328. // Properties
  1329. // Methods
  1330. };
  1331. //
  1332. // ComListCards
  1333. //
  1334. class ComListCards
  1335. : public CComObject
  1336. {
  1337. public:
  1338. typedef struct
  1339. {
  1340. DWORD
  1341. dwCommandId,
  1342. dwTotalLength,
  1343. dwDataOffset;
  1344. Desc dscAtr; // pbAtr
  1345. Desc dscInterfaces; // pguidInterfaces
  1346. } CObjListCards_request;
  1347. typedef struct
  1348. {
  1349. DWORD
  1350. dwCommandId,
  1351. dwTotalLength,
  1352. dwDataOffset,
  1353. dwStatus;
  1354. Desc dscCards; // mszCards
  1355. } CObjListCards_response;
  1356. // Constructors & Destructor
  1357. // Properties
  1358. // Methods
  1359. CObjListCards_request *InitRequest(DWORD dwExtraLen)
  1360. {
  1361. InitStruct(
  1362. ListCards_request,
  1363. sizeof(CObjListCards_request),
  1364. dwExtraLen);
  1365. return (CObjListCards_request *)Data();
  1366. };
  1367. CObjListCards_response *InitResponse(DWORD dwExtraLen)
  1368. {
  1369. InitStruct(
  1370. ListCards_response,
  1371. sizeof(CObjListCards_response),
  1372. dwExtraLen);
  1373. return (CObjListCards_response *)Data();
  1374. };
  1375. CObjListCards_response *Receive(CComChannel *pChannel)
  1376. {
  1377. return (CObjListCards_response *)CComObject::Receive(pChannel);
  1378. };
  1379. // Operators
  1380. protected:
  1381. // Properties
  1382. // Methods
  1383. };
  1384. //
  1385. // ComListInterfaces
  1386. //
  1387. class ComListInterfaces
  1388. : public CComObject
  1389. {
  1390. public:
  1391. typedef struct
  1392. {
  1393. DWORD
  1394. dwCommandId,
  1395. dwTotalLength,
  1396. dwDataOffset;
  1397. Desc dscCard; // szCard
  1398. } CObjListInterfaces_request;
  1399. typedef struct
  1400. {
  1401. DWORD
  1402. dwCommandId,
  1403. dwTotalLength,
  1404. dwDataOffset,
  1405. dwStatus;
  1406. Desc dscInterfaces; // pguidInterfaces
  1407. } CObjListInterfaces_response;
  1408. // Constructors & Destructor
  1409. // Properties
  1410. // Methods
  1411. CObjListInterfaces_request *InitRequest(DWORD dwExtraLen)
  1412. {
  1413. InitStruct(
  1414. ListInterfaces_request,
  1415. sizeof(CObjListInterfaces_request),
  1416. dwExtraLen);
  1417. return (CObjListInterfaces_request *)Data();
  1418. };
  1419. CObjListInterfaces_response *InitResponse(DWORD dwExtraLen)
  1420. {
  1421. InitStruct(
  1422. ListInterfaces_response,
  1423. sizeof(CObjListInterfaces_response),
  1424. dwExtraLen);
  1425. return (CObjListInterfaces_response *)Data();
  1426. };
  1427. CObjListInterfaces_response *Receive(CComChannel *pChannel)
  1428. {
  1429. return (CObjListInterfaces_response *)CComObject::Receive(pChannel);
  1430. };
  1431. // Operators
  1432. protected:
  1433. // Properties
  1434. // Methods
  1435. };
  1436. //
  1437. // ComGetProviderId
  1438. //
  1439. class ComGetProviderId
  1440. : public CComObject
  1441. {
  1442. public:
  1443. typedef struct
  1444. {
  1445. DWORD
  1446. dwCommandId,
  1447. dwTotalLength,
  1448. dwDataOffset;
  1449. Desc dscCard; // szCard
  1450. } CObjGetProviderId_request;
  1451. typedef struct
  1452. {
  1453. DWORD
  1454. dwCommandId,
  1455. dwTotalLength,
  1456. dwDataOffset,
  1457. dwStatus;
  1458. Desc dscProviderId; // pguidProviderId
  1459. } CObjGetProviderId_response;
  1460. // Constructors & Destructor
  1461. // Properties
  1462. // Methods
  1463. CObjGetProviderId_request *InitRequest(DWORD dwExtraLen)
  1464. {
  1465. InitStruct(
  1466. GetProviderId_request,
  1467. sizeof(CObjGetProviderId_request),
  1468. dwExtraLen);
  1469. return (CObjGetProviderId_request *)Data();
  1470. };
  1471. CObjGetProviderId_response *InitResponse(DWORD dwExtraLen)
  1472. {
  1473. InitStruct(
  1474. GetProviderId_response,
  1475. sizeof(CObjGetProviderId_response),
  1476. dwExtraLen);
  1477. return (CObjGetProviderId_response *)Data();
  1478. };
  1479. CObjGetProviderId_response *Receive(CComChannel *pChannel)
  1480. {
  1481. return (CObjGetProviderId_response *)CComObject::Receive(pChannel);
  1482. };
  1483. // Operators
  1484. protected:
  1485. // Properties
  1486. // Methods
  1487. };
  1488. //
  1489. // ComIntroduceReaderGroup
  1490. //
  1491. class ComIntroduceReaderGroup
  1492. : public CComObject
  1493. {
  1494. public:
  1495. typedef struct
  1496. {
  1497. DWORD
  1498. dwCommandId,
  1499. dwTotalLength,
  1500. dwDataOffset;
  1501. Desc dscGroupName; // szGroupName
  1502. } CObjIntroduceReaderGroup_request;
  1503. typedef struct
  1504. {
  1505. DWORD
  1506. dwCommandId,
  1507. dwTotalLength,
  1508. dwDataOffset,
  1509. dwStatus;
  1510. } CObjIntroduceReaderGroup_response;
  1511. // Constructors & Destructor
  1512. // Properties
  1513. // Methods
  1514. CObjIntroduceReaderGroup_request *InitRequest(DWORD dwExtraLen)
  1515. {
  1516. InitStruct(
  1517. IntroduceReaderGroup_request,
  1518. sizeof(CObjIntroduceReaderGroup_request),
  1519. dwExtraLen);
  1520. return (CObjIntroduceReaderGroup_request *)Data();
  1521. };
  1522. CObjIntroduceReaderGroup_response *InitResponse(DWORD dwExtraLen)
  1523. {
  1524. InitStruct(
  1525. IntroduceReaderGroup_response,
  1526. sizeof(CObjIntroduceReaderGroup_response),
  1527. dwExtraLen);
  1528. return (CObjIntroduceReaderGroup_response *)Data();
  1529. };
  1530. CObjIntroduceReaderGroup_response *Receive(CComChannel *pChannel)
  1531. {
  1532. return (CObjIntroduceReaderGroup_response *)CComObject::Receive(pChannel);
  1533. };
  1534. // Operators
  1535. protected:
  1536. // Properties
  1537. // Methods
  1538. };
  1539. //
  1540. // ComForgetReaderGroup
  1541. //
  1542. class ComForgetReaderGroup
  1543. : public CComObject
  1544. {
  1545. public:
  1546. typedef struct
  1547. {
  1548. DWORD
  1549. dwCommandId,
  1550. dwTotalLength,
  1551. dwDataOffset;
  1552. Desc dscGroupName; // szGroupName
  1553. } CObjForgetReaderGroup_request;
  1554. typedef struct
  1555. {
  1556. DWORD
  1557. dwCommandId,
  1558. dwTotalLength,
  1559. dwDataOffset,
  1560. dwStatus;
  1561. } CObjForgetReaderGroup_response;
  1562. // Constructors & Destructor
  1563. // Properties
  1564. // Methods
  1565. CObjForgetReaderGroup_request *InitRequest(DWORD dwExtraLen)
  1566. {
  1567. InitStruct(
  1568. ForgetReaderGroup_request,
  1569. sizeof(CObjForgetReaderGroup_request),
  1570. dwExtraLen);
  1571. return (CObjForgetReaderGroup_request *)Data();
  1572. };
  1573. CObjForgetReaderGroup_response *InitResponse(DWORD dwExtraLen)
  1574. {
  1575. InitStruct(
  1576. ForgetReaderGroup_response,
  1577. sizeof(CObjForgetReaderGroup_response),
  1578. dwExtraLen);
  1579. return (CObjForgetReaderGroup_response *)Data();
  1580. };
  1581. CObjForgetReaderGroup_response *Receive(CComChannel *pChannel)
  1582. {
  1583. return (CObjForgetReaderGroup_response *)CComObject::Receive(pChannel);
  1584. };
  1585. // Operators
  1586. protected:
  1587. // Properties
  1588. // Methods
  1589. };
  1590. //
  1591. // ComIntroduceReader
  1592. //
  1593. class ComIntroduceReader
  1594. : public CComObject
  1595. {
  1596. public:
  1597. typedef struct
  1598. {
  1599. DWORD
  1600. dwCommandId,
  1601. dwTotalLength,
  1602. dwDataOffset;
  1603. Desc dscReaderName; // szReaderName
  1604. Desc dscDeviceName; // szDeviceName
  1605. } CObjIntroduceReader_request;
  1606. typedef struct
  1607. {
  1608. DWORD
  1609. dwCommandId,
  1610. dwTotalLength,
  1611. dwDataOffset,
  1612. dwStatus;
  1613. } CObjIntroduceReader_response;
  1614. // Constructors & Destructor
  1615. // Properties
  1616. // Methods
  1617. CObjIntroduceReader_request *InitRequest(DWORD dwExtraLen)
  1618. {
  1619. InitStruct(
  1620. IntroduceReader_request,
  1621. sizeof(CObjIntroduceReader_request),
  1622. dwExtraLen);
  1623. return (CObjIntroduceReader_request *)Data();
  1624. };
  1625. CObjIntroduceReader_response *InitResponse(DWORD dwExtraLen)
  1626. {
  1627. InitStruct(
  1628. IntroduceReader_response,
  1629. sizeof(CObjIntroduceReader_response),
  1630. dwExtraLen);
  1631. return (CObjIntroduceReader_response *)Data();
  1632. };
  1633. CObjIntroduceReader_response *Receive(CComChannel *pChannel)
  1634. {
  1635. return (CObjIntroduceReader_response *)CComObject::Receive(pChannel);
  1636. };
  1637. // Operators
  1638. protected:
  1639. // Properties
  1640. // Methods
  1641. };
  1642. //
  1643. // ComForgetReader
  1644. //
  1645. class ComForgetReader
  1646. : public CComObject
  1647. {
  1648. public:
  1649. typedef struct
  1650. {
  1651. DWORD
  1652. dwCommandId,
  1653. dwTotalLength,
  1654. dwDataOffset;
  1655. Desc dscReaderName; // szReaderName
  1656. } CObjForgetReader_request;
  1657. typedef struct
  1658. {
  1659. DWORD
  1660. dwCommandId,
  1661. dwTotalLength,
  1662. dwDataOffset,
  1663. dwStatus;
  1664. } CObjForgetReader_response;
  1665. // Constructors & Destructor
  1666. // Properties
  1667. // Methods
  1668. CObjForgetReader_request *InitRequest(DWORD dwExtraLen)
  1669. {
  1670. InitStruct(
  1671. ForgetReader_request,
  1672. sizeof(CObjForgetReader_request),
  1673. dwExtraLen);
  1674. return (CObjForgetReader_request *)Data();
  1675. };
  1676. CObjForgetReader_response *InitResponse(DWORD dwExtraLen)
  1677. {
  1678. InitStruct(
  1679. ForgetReader_response,
  1680. sizeof(CObjForgetReader_response),
  1681. dwExtraLen);
  1682. return (CObjForgetReader_response *)Data();
  1683. };
  1684. CObjForgetReader_response *Receive(CComChannel *pChannel)
  1685. {
  1686. return (CObjForgetReader_response *)CComObject::Receive(pChannel);
  1687. };
  1688. // Operators
  1689. protected:
  1690. // Properties
  1691. // Methods
  1692. };
  1693. //
  1694. // ComAddReaderToGroup
  1695. //
  1696. class ComAddReaderToGroup
  1697. : public CComObject
  1698. {
  1699. public:
  1700. typedef struct
  1701. {
  1702. DWORD
  1703. dwCommandId,
  1704. dwTotalLength,
  1705. dwDataOffset;
  1706. Desc dscReaderName; // szReaderName
  1707. Desc dscGroupName; // szGroupName
  1708. } CObjAddReaderToGroup_request;
  1709. typedef struct
  1710. {
  1711. DWORD
  1712. dwCommandId,
  1713. dwTotalLength,
  1714. dwDataOffset,
  1715. dwStatus;
  1716. } CObjAddReaderToGroup_response;
  1717. // Constructors & Destructor
  1718. // Properties
  1719. // Methods
  1720. CObjAddReaderToGroup_request *InitRequest(DWORD dwExtraLen)
  1721. {
  1722. InitStruct(
  1723. AddReaderToGroup_request,
  1724. sizeof(CObjAddReaderToGroup_request),
  1725. dwExtraLen);
  1726. return (CObjAddReaderToGroup_request *)Data();
  1727. };
  1728. CObjAddReaderToGroup_response *InitResponse(DWORD dwExtraLen)
  1729. {
  1730. InitStruct(
  1731. AddReaderToGroup_response,
  1732. sizeof(CObjAddReaderToGroup_response),
  1733. dwExtraLen);
  1734. return (CObjAddReaderToGroup_response *)Data();
  1735. };
  1736. CObjAddReaderToGroup_response *Receive(CComChannel *pChannel)
  1737. {
  1738. return (CObjAddReaderToGroup_response *)CComObject::Receive(pChannel);
  1739. };
  1740. // Operators
  1741. protected:
  1742. // Properties
  1743. // Methods
  1744. };
  1745. //
  1746. // ComRemoveReaderFromGroup
  1747. //
  1748. class ComRemoveReaderFromGroup
  1749. : public CComObject
  1750. {
  1751. public:
  1752. typedef struct
  1753. {
  1754. DWORD
  1755. dwCommandId,
  1756. dwTotalLength,
  1757. dwDataOffset;
  1758. Desc dscReaderName; // szReaderName
  1759. Desc dscGroupName; // szGroupName
  1760. } CObjRemoveReaderFromGroup_request;
  1761. typedef struct
  1762. {
  1763. DWORD
  1764. dwCommandId,
  1765. dwTotalLength,
  1766. dwDataOffset,
  1767. dwStatus;
  1768. } CObjRemoveReaderFromGroup_response;
  1769. // Constructors & Destructor
  1770. // Properties
  1771. // Methods
  1772. CObjRemoveReaderFromGroup_request *InitRequest(DWORD dwExtraLen)
  1773. {
  1774. InitStruct(
  1775. RemoveReaderFromGroup_request,
  1776. sizeof(CObjRemoveReaderFromGroup_request),
  1777. dwExtraLen);
  1778. return (CObjRemoveReaderFromGroup_request *)Data();
  1779. };
  1780. CObjRemoveReaderFromGroup_response *InitResponse(DWORD dwExtraLen)
  1781. {
  1782. InitStruct(
  1783. RemoveReaderFromGroup_response,
  1784. sizeof(CObjRemoveReaderFromGroup_response),
  1785. dwExtraLen);
  1786. return (CObjRemoveReaderFromGroup_response *)Data();
  1787. };
  1788. CObjRemoveReaderFromGroup_response *Receive(CComChannel *pChannel)
  1789. {
  1790. return (CObjRemoveReaderFromGroup_response *)CComObject::Receive(pChannel);
  1791. };
  1792. // Operators
  1793. protected:
  1794. // Properties
  1795. // Methods
  1796. };
  1797. //
  1798. // ComIntroduceCardType
  1799. //
  1800. class ComIntroduceCardType
  1801. : public CComObject
  1802. {
  1803. public:
  1804. typedef struct
  1805. {
  1806. DWORD
  1807. dwCommandId,
  1808. dwTotalLength,
  1809. dwDataOffset;
  1810. Desc dscCardName; // szCardName
  1811. Desc dscPrimaryProvider; // pguidPrimaryProvider
  1812. Desc dscInterfaces; // rgguidInterfaces
  1813. Desc dscAtr; // pbAtr
  1814. Desc dscAtrMask; // pbAtrMask
  1815. } CObjIntroduceCardType_request;
  1816. typedef struct
  1817. {
  1818. DWORD
  1819. dwCommandId,
  1820. dwTotalLength,
  1821. dwDataOffset,
  1822. dwStatus;
  1823. } CObjIntroduceCardType_response;
  1824. // Constructors & Destructor
  1825. // Properties
  1826. // Methods
  1827. CObjIntroduceCardType_request *InitRequest(DWORD dwExtraLen)
  1828. {
  1829. InitStruct(
  1830. IntroduceCardType_request,
  1831. sizeof(CObjIntroduceCardType_request),
  1832. dwExtraLen);
  1833. return (CObjIntroduceCardType_request *)Data();
  1834. };
  1835. CObjIntroduceCardType_response *InitResponse(DWORD dwExtraLen)
  1836. {
  1837. InitStruct(
  1838. IntroduceCardType_response,
  1839. sizeof(CObjIntroduceCardType_response),
  1840. dwExtraLen);
  1841. return (CObjIntroduceCardType_response *)Data();
  1842. };
  1843. CObjIntroduceCardType_response *Receive(CComChannel *pChannel)
  1844. {
  1845. return (CObjIntroduceCardType_response *)CComObject::Receive(pChannel);
  1846. };
  1847. // Operators
  1848. protected:
  1849. // Properties
  1850. // Methods
  1851. };
  1852. //
  1853. // ComForgetCardType
  1854. //
  1855. class ComForgetCardType
  1856. : public CComObject
  1857. {
  1858. public:
  1859. typedef struct
  1860. {
  1861. DWORD
  1862. dwCommandId,
  1863. dwTotalLength,
  1864. dwDataOffset;
  1865. Desc dscCardName; // szCardName
  1866. } CObjForgetCardType_request;
  1867. typedef struct
  1868. {
  1869. DWORD
  1870. dwCommandId,
  1871. dwTotalLength,
  1872. dwDataOffset,
  1873. dwStatus;
  1874. } CObjForgetCardType_response;
  1875. // Constructors & Destructor
  1876. // Properties
  1877. // Methods
  1878. CObjForgetCardType_request *InitRequest(DWORD dwExtraLen)
  1879. {
  1880. InitStruct(
  1881. ForgetCardType_request,
  1882. sizeof(CObjForgetCardType_request),
  1883. dwExtraLen);
  1884. return (CObjForgetCardType_request *)Data();
  1885. };
  1886. CObjForgetCardType_response *InitResponse(DWORD dwExtraLen)
  1887. {
  1888. InitStruct(
  1889. ForgetCardType_response,
  1890. sizeof(CObjForgetCardType_response),
  1891. dwExtraLen);
  1892. return (CObjForgetCardType_response *)Data();
  1893. };
  1894. CObjForgetCardType_response *Receive(CComChannel *pChannel)
  1895. {
  1896. return (CObjForgetCardType_response *)CComObject::Receive(pChannel);
  1897. };
  1898. // Operators
  1899. protected:
  1900. // Properties
  1901. // Methods
  1902. };
  1903. #endif
  1904. //
  1905. ////////////////////////////////////////////////////////////////////////////////
  1906. //
  1907. // Service Manager Support Routines
  1908. //
  1909. // The following services are supplied to simplify the use of the Service
  1910. // Manager API.
  1911. //
  1912. #if 0
  1913. //
  1914. // ComCancel
  1915. //
  1916. class ComCancel
  1917. : public CComObject
  1918. {
  1919. public:
  1920. typedef struct
  1921. {
  1922. DWORD
  1923. dwCommandId,
  1924. dwTotalLength,
  1925. dwDataOffset;
  1926. } CObjCancel_request;
  1927. typedef struct
  1928. {
  1929. DWORD
  1930. dwCommandId,
  1931. dwTotalLength,
  1932. dwDataOffset,
  1933. dwStatus;
  1934. } CObjCancel_response;
  1935. // Constructors & Destructor
  1936. // Properties
  1937. // Methods
  1938. CObjCancel_request *InitRequest(DWORD dwExtraLen)
  1939. {
  1940. InitStruct(
  1941. Cancel_request,
  1942. sizeof(CObjCancel_request),
  1943. dwExtraLen);
  1944. return (CObjCancel_request *)Data();
  1945. };
  1946. CObjCancel_response *InitResponse(DWORD dwExtraLen)
  1947. {
  1948. InitStruct(
  1949. Cancel_response,
  1950. sizeof(CObjCancel_response),
  1951. dwExtraLen);
  1952. return (CObjCancel_response *)Data();
  1953. };
  1954. CObjCancel_response *Receive(CComChannel *pChannel)
  1955. {
  1956. return (CObjCancel_response *)CComObject::Receive(pChannel);
  1957. };
  1958. // Operators
  1959. protected:
  1960. // Properties
  1961. // Methods
  1962. };
  1963. //
  1964. // ComFreeMemory
  1965. //
  1966. class ComFreeMemory
  1967. : public CComObject
  1968. {
  1969. public:
  1970. typedef struct
  1971. {
  1972. DWORD
  1973. dwCommandId,
  1974. dwTotalLength,
  1975. dwDataOffset,
  1976. dwStatus;
  1977. LPVOID pvMem;
  1978. } CObjFreeMemory_request;
  1979. typedef struct
  1980. {
  1981. DWORD
  1982. dwCommandId,
  1983. dwTotalLength,
  1984. dwDataOffset,
  1985. dwStatus;
  1986. } CObjFreeMemory_response;
  1987. // Constructors & Destructor
  1988. // Properties
  1989. // Methods
  1990. CObjFreeMemory_request *InitRequest(DWORD dwExtraLen)
  1991. {
  1992. InitStruct(
  1993. FreeMemory_request,
  1994. sizeof(CObjFreeMemory_request),
  1995. dwExtraLen);
  1996. return (CObjFreeMemory_request *)Data();
  1997. };
  1998. CObjFreeMemory_response *InitResponse(DWORD dwExtraLen)
  1999. {
  2000. InitStruct(
  2001. FreeMemory_response,
  2002. sizeof(CObjFreeMemory_response),
  2003. dwExtraLen);
  2004. return (CObjFreeMemory_response *)Data();
  2005. };
  2006. CObjFreeMemory_response *Receive(CComChannel *pChannel)
  2007. {
  2008. return (CObjFreeMemory_response *)CComObject::Receive(pChannel);
  2009. };
  2010. // Operators
  2011. protected:
  2012. // Properties
  2013. // Methods
  2014. };
  2015. #endif
  2016. #endif // _CALCOM_H_