Source code of Windows XP (NT5)
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.

243 lines
3.4 KiB

  1. /*++
  2. Copyright (c) 1996 Microsoft Corporation
  3. Module Name:
  4. xplogon.cpp
  5. Abstract:
  6. This module contains the XPLOGON class implementation.
  7. Author:
  8. Wesley Witt (wesw) 13-Aug-1996
  9. --*/
  10. #define INITGUID
  11. #define USES_IID_IXPProvider
  12. #define USES_IID_IXPLogon
  13. #define USES_IID_IMAPIStatus
  14. #define USES_IID_IMAPIProp
  15. #define USES_IID_IMAPIPropData
  16. #define USES_IID_IMAPIControl
  17. #define USES_IID_IMAPIContainer
  18. #define USES_IID_IMAPIFolder
  19. #define USES_IID_IMAPITableData
  20. #define USES_IID_IStreamDocfile
  21. #define USES_PS_PUBLIC_STRINGS
  22. #include "faxxp.h"
  23. #pragma hdrstop
  24. CXPProvider::CXPProvider(
  25. HINSTANCE hInst
  26. )
  27. /*++
  28. Routine Description:
  29. Constructor of the object. Parameters are passed to initialize the
  30. data members with the appropiate values.
  31. Arguments:
  32. hInst - Handle to instance of this XP DLL
  33. Return Value:
  34. None.
  35. --*/
  36. {
  37. m_hInstance = hInst;
  38. m_cRef = 1;
  39. InitializeCriticalSection( &m_csTransport );
  40. }
  41. CXPProvider::~CXPProvider()
  42. /*++
  43. Routine Description:
  44. Close down and release resources and libraries.
  45. Arguments:
  46. None.
  47. Return Value:
  48. None.
  49. --*/
  50. {
  51. m_hInstance = NULL;
  52. DeleteCriticalSection( &m_csTransport );
  53. }
  54. STDMETHODIMP
  55. CXPProvider::QueryInterface(
  56. REFIID riid,
  57. LPVOID * ppvObj
  58. )
  59. /*++
  60. Routine Description:
  61. Returns a pointer to a interface requested if the interface is
  62. supported and implemented by this object. If it is not supported, it
  63. returns NULL
  64. Arguments:
  65. Refer to MAPI Documentation on this method.
  66. Return Value:
  67. An HRESULT.
  68. --*/
  69. {
  70. *ppvObj = NULL;
  71. if (riid == IID_IXPProvider || riid == IID_IUnknown) {
  72. *ppvObj = (LPVOID)this;
  73. AddRef();
  74. return S_OK;
  75. }
  76. return E_NOINTERFACE;
  77. }
  78. STDMETHODIMP
  79. CXPProvider::Shutdown(
  80. ULONG * pulFlags
  81. )
  82. /*++
  83. Routine Description:
  84. Stub method.
  85. Arguments:
  86. Refer to MAPI Documentation on this method.
  87. Return Value:
  88. An HRESULT.
  89. --*/
  90. {
  91. return S_OK;
  92. }
  93. STDMETHODIMP
  94. CXPProvider::TransportLogon(
  95. LPMAPISUP pSupObj,
  96. ULONG ulUIParam,
  97. LPTSTR pszProfileName,
  98. ULONG *pulFlags,
  99. LPMAPIERROR *ppMAPIError,
  100. LPXPLOGON *ppXPLogon
  101. )
  102. /*++
  103. Routine Description:
  104. Display the logon dialog to show the options saved in the profile for
  105. this provider and allow changes to it. Save new configuration settings
  106. back in the profile.
  107. Create a new CXPLogon object and return it to the spooler. Also,
  108. initialize the properties array for each address type handled
  109. by this transport. Check all the flags and return them to the spooler
  110. Arguments:
  111. Refer to MAPI Documentation on this method.
  112. Return Value:
  113. An HRESULT.
  114. --*/
  115. {
  116. CXPLogon *LogonObj = new CXPLogon( m_hInstance, pSupObj, pszProfileName );
  117. if (!LogonObj) {
  118. return E_OUTOFMEMORY;
  119. }
  120. LogonObj->InitializeStatusRow(0);
  121. strcpy( m_ProfileName, pszProfileName );
  122. *ppXPLogon = LogonObj;
  123. return S_OK;
  124. }
  125. STDMETHODIMP_(ULONG)
  126. CXPProvider::AddRef()
  127. /*++
  128. Routine Description:
  129. Arguments:
  130. Refer to MAPI Documentation on this method.
  131. Return Value:
  132. An HRESULT.
  133. --*/
  134. {
  135. ++m_cRef;
  136. return m_cRef;
  137. }
  138. STDMETHODIMP_(ULONG)
  139. CXPProvider::Release()
  140. /*++
  141. Routine Description:
  142. Arguments:
  143. Refer to MAPI Documentation on this method.
  144. Return Value:
  145. An HRESULT.
  146. --*/
  147. {
  148. ULONG ulCount = --m_cRef;
  149. if (!ulCount) {
  150. delete this;
  151. }
  152. return ulCount;
  153. }