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.

103 lines
2.8 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. //
  5. // Copyright (C) Microsoft Corporation, 1999 - 1999
  6. //
  7. // File: Locate.h
  8. //
  9. //--------------------------------------------------------------------------
  10. // Locate.h : Declaration of the CSCardLocate
  11. #ifndef __SCARDLOCATE_H_
  12. #define __SCARDLOCATE_H_
  13. #include <winscard.h>
  14. #include "resource.h" // main symbols
  15. /////////////////////////////////////////////////////////////////////////////
  16. // CSCardLocate
  17. class ATL_NO_VTABLE CSCardLocate :
  18. public CComObjectRootEx<CComMultiThreadModel>,
  19. public CComCoClass<CSCardLocate, &CLSID_CSCardLocate>,
  20. public IDispatchImpl<ISCardLocate, &IID_ISCardLocate, &LIBID_SCARDSSPLib>
  21. {
  22. public:
  23. CSCardLocate()
  24. : m_mtzGroupNames(),
  25. m_mtzCardNames(),
  26. m_bfInterfaces(),
  27. m_bfRdr(MAX_PATH),
  28. m_bfCard(MAX_PATH),
  29. m_tzTitle()
  30. {
  31. m_pUnkMarshaler = NULL;
  32. m_lFlags = 0;
  33. ZeroMemory(&m_subCardInfo, sizeof(SCARDINFO));
  34. }
  35. DECLARE_REGISTRY_RESOURCEID(IDR_SCARDLOCATE)
  36. DECLARE_GET_CONTROLLING_UNKNOWN()
  37. DECLARE_PROTECT_FINAL_CONSTRUCT()
  38. BEGIN_COM_MAP(CSCardLocate)
  39. COM_INTERFACE_ENTRY(ISCardLocate)
  40. COM_INTERFACE_ENTRY(IDispatch)
  41. COM_INTERFACE_ENTRY_AGGREGATE(IID_IMarshal, m_pUnkMarshaler.p)
  42. END_COM_MAP()
  43. HRESULT FinalConstruct()
  44. {
  45. return CoCreateFreeThreadedMarshaler(
  46. GetControllingUnknown(), &m_pUnkMarshaler.p);
  47. }
  48. void FinalRelease()
  49. {
  50. m_pUnkMarshaler.Release();
  51. }
  52. CComPtr<IUnknown> m_pUnkMarshaler;
  53. protected:
  54. SCARDINFO m_subCardInfo;
  55. CTextMultistring m_mtzGroupNames;
  56. CTextMultistring m_mtzCardNames;
  57. CBuffer m_bfInterfaces;
  58. CBuffer m_bfRdr;
  59. CBuffer m_bfCard;
  60. CTextString m_tzTitle;
  61. LONG m_lFlags;
  62. // ISCardLocate
  63. public:
  64. STDMETHOD(ConfigureCardGuidSearch)(
  65. /* [in] */ LPSAFEARRAY pCardGuids,
  66. /* [defaultvalue][in] */ LPSAFEARRAY pGroupNames = 0,
  67. /* [defaultvalue][in] */ BSTR bstrTitle = L"",
  68. /* [defaultvalue][in] */ LONG lFlags = 1);
  69. STDMETHOD(ConfigureCardNameSearch)(
  70. /* [in] */ LPSAFEARRAY pCardNames,
  71. /* [defaultvalue][in] */ LPSAFEARRAY pGroupNames = 0,
  72. /* [defaultvalue][in] */ BSTR bstrTitle = L"",
  73. /* [defaultvalue][in] */ LONG lFlags = 1);
  74. STDMETHOD(FindCard)(
  75. /* [defaultvalue][in] */ SCARD_SHARE_MODES ShareMode,
  76. /* [defaultvalue][in] */ SCARD_PROTOCOLS Protocols,
  77. /* [defaultvalue][in] */ LONG lFlags,
  78. /* [retval][out] */ LPSCARDINFO __RPC_FAR *ppCardInfo);
  79. };
  80. inline LPSCARDLOCATE
  81. NewSCardLocate(
  82. void)
  83. {
  84. return (LPSCARDLOCATE)NewObject(CLSID_CSCardLocate, IID_ISCardLocate);
  85. }
  86. #endif //__SCARDLOCATE_H_