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.

105 lines
3.0 KiB

  1. /*++
  2. Copyright (c) 2000 Microsoft Corporation
  3. Module Name:
  4. FaxDeviceProvider.h
  5. Abstract:
  6. Declaration of the CFaxDeviceProvider Class.
  7. Author:
  8. Iv Garber (IvG) Jun, 2000
  9. Revision History:
  10. --*/
  11. #ifndef __FAXDEVICEPROVIDER_H_
  12. #define __FAXDEVICEPROVIDER_H_
  13. #include "resource.h" // main symbols
  14. #include "FaxLocalPtr.h"
  15. //
  16. //=================== FAX DEVICE PROVIDER ========================================
  17. //
  18. class ATL_NO_VTABLE CFaxDeviceProvider :
  19. public CComObjectRootEx<CComSingleThreadModel>,
  20. public ISupportErrorInfo,
  21. public IDispatchImpl<IFaxDeviceProvider, &IID_IFaxDeviceProvider, &LIBID_FAXCOMEXLib>
  22. {
  23. public:
  24. CFaxDeviceProvider() :
  25. m_psaDeviceIDs(NULL)
  26. {
  27. DBG_ENTER(_T("FAX DEVICE PROVIDER::CREATE"));
  28. }
  29. ~CFaxDeviceProvider()
  30. {
  31. HRESULT hr = S_OK;
  32. DBG_ENTER(_T("FAX DEVICE PROVIDER::DESTROY"));
  33. if (m_psaDeviceIDs)
  34. {
  35. hr = SafeArrayDestroy(m_psaDeviceIDs);
  36. if (FAILED(hr))
  37. {
  38. CALL_FAIL(GENERAL_ERR, _T("SafeArrayDestroy(m_psaDeviceIDs)"), hr);
  39. }
  40. }
  41. }
  42. DECLARE_REGISTRY_RESOURCEID(IDR_FAXDEVICEPROVIDER)
  43. DECLARE_NOT_AGGREGATABLE(CFaxDeviceProvider)
  44. DECLARE_PROTECT_FINAL_CONSTRUCT()
  45. BEGIN_COM_MAP(CFaxDeviceProvider)
  46. COM_INTERFACE_ENTRY(IFaxDeviceProvider)
  47. COM_INTERFACE_ENTRY(IDispatch)
  48. COM_INTERFACE_ENTRY(ISupportErrorInfo)
  49. END_COM_MAP()
  50. // Interfaces
  51. STDMETHOD(InterfaceSupportsErrorInfo)(REFIID riid);
  52. STDMETHOD(get_Debug)(/*[out, retval]*/ VARIANT_BOOL *pbDebug);
  53. STDMETHOD(get_MajorBuild)(/*[out, retval]*/ long *plMajorBuild);
  54. STDMETHOD(get_MinorBuild)(/*[out, retval]*/ long *plMinorBuild);
  55. STDMETHOD(get_DeviceIds)(/*[out, retval]*/ VARIANT *pvDeviceIds);
  56. STDMETHOD(get_ImageName)(/*[out, retval]*/ BSTR *pbstrImageName);
  57. STDMETHOD(get_UniqueName)(/*[out, retval]*/ BSTR *pbstrUniqueName);
  58. STDMETHOD(get_MajorVersion)(/*[out, retval]*/ long *plMajorVersion);
  59. STDMETHOD(get_MinorVersion)(/*[out, retval]*/ long *plMinorVersion);
  60. STDMETHOD(get_InitErrorCode)(/*[out, retval]*/ long *plInitErrorCode);
  61. STDMETHOD(get_FriendlyName)(/*[out, retval]*/ BSTR *pbstrFriendlyName);
  62. STDMETHOD(get_Status)(/*[out, retval]*/ FAX_PROVIDER_STATUS_ENUM *pStatus);
  63. STDMETHOD(get_TapiProviderName)(/*[out, retval]*/ BSTR *pbstrTapiProviderName);
  64. // Internal Use
  65. STDMETHOD(Init)(FAX_DEVICE_PROVIDER_INFO *pInfo, FAX_PORT_INFO_EX *pDevices, DWORD dwNum);
  66. private:
  67. long m_lMajorBuild;
  68. long m_lMinorBuild;
  69. long m_lMajorVersion;
  70. long m_lMinorVersion;
  71. long m_lLastError;
  72. CComBSTR m_bstrUniqueName;
  73. CComBSTR m_bstrImageName;
  74. CComBSTR m_bstrFriendlyName;
  75. CComBSTR m_bstrTapiProviderName;
  76. SAFEARRAY *m_psaDeviceIDs;
  77. VARIANT_BOOL m_bDebug;
  78. FAX_PROVIDER_STATUS_ENUM m_Status;
  79. };
  80. #endif //__FAXDEVICEPROVIDER_H_