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.

148 lines
3.7 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1997.
  5. //
  6. // File: D I A L U P U I . C P P
  7. //
  8. // Contents: Dial-up Connection UI object.
  9. //
  10. // Notes:
  11. //
  12. // Author: shaunco 15 Oct 1997
  13. //
  14. //----------------------------------------------------------------------------
  15. #include "pch.h"
  16. #pragma hdrstop
  17. #include "dialupui.h"
  18. //+---------------------------------------------------------------------------
  19. // INetConnectionConnectUi
  20. //
  21. STDMETHODIMP
  22. CDialupConnectionUi::SetConnection (
  23. INetConnection* pCon)
  24. {
  25. return HrSetConnection (pCon, this);
  26. }
  27. STDMETHODIMP
  28. CDialupConnectionUi::Connect (
  29. HWND hwndParent,
  30. DWORD dwFlags)
  31. {
  32. HRESULT hr = HrConnect (hwndParent, dwFlags, this,
  33. static_cast<INetConnectionConnectUi*>(this));
  34. TraceError ("CDialupConnectionUi::Connect", (S_FALSE == hr) ? S_OK : hr);
  35. return hr;
  36. }
  37. STDMETHODIMP
  38. CDialupConnectionUi::Disconnect (
  39. HWND hwndParent,
  40. DWORD dwFlags)
  41. {
  42. return HrDisconnect (hwndParent, dwFlags);
  43. }
  44. //+---------------------------------------------------------------------------
  45. // INetConnectionPropertyUi2
  46. //
  47. STDMETHODIMP
  48. CDialupConnectionUi::AddPages (
  49. HWND hwndParent,
  50. LPFNADDPROPSHEETPAGE pfnAddPage,
  51. LPARAM lParam)
  52. {
  53. HRESULT hr = HrAddPropertyPages (hwndParent, pfnAddPage, lParam);
  54. TraceError ("CDialupConnectionUi::AddPages (INetConnectionPropertyUi)", hr);
  55. return hr;
  56. }
  57. STDMETHODIMP
  58. CDialupConnectionUi::GetIcon (
  59. DWORD dwSize,
  60. HICON *phIcon )
  61. {
  62. HRESULT hr;
  63. Assert (phIcon);
  64. hr = HrGetIconFromMediaType(dwSize, NCM_PHONE, NCSM_NONE, 7, 0, phIcon);
  65. TraceError ("CLanConnectionUi::GetIcon (INetConnectionPropertyUi2)", hr);
  66. return hr;
  67. }
  68. //+---------------------------------------------------------------------------
  69. // INetConnectionWizardUi
  70. //
  71. STDMETHODIMP
  72. CDialupConnectionUi::QueryMaxPageCount (
  73. INetConnectionWizardUiContext* pContext,
  74. DWORD* pcMaxPages)
  75. {
  76. HRESULT hr = HrQueryMaxPageCount (pContext, pcMaxPages);
  77. TraceError ("CDialupConnectionUi::QueryMaxPageCount", hr);
  78. return hr;
  79. }
  80. STDMETHODIMP
  81. CDialupConnectionUi::AddPages (
  82. INetConnectionWizardUiContext* pContext,
  83. LPFNADDPROPSHEETPAGE pfnAddPage,
  84. LPARAM lParam)
  85. {
  86. HRESULT hr = HrAddWizardPages (pContext, pfnAddPage, lParam,
  87. RASEDFLAG_NewPhoneEntry);
  88. TraceError ("CDialupConnectionUi::AddPages (INetConnectionWizardUi)", hr);
  89. return hr;
  90. }
  91. STDMETHODIMP
  92. CDialupConnectionUi::GetSuggestedConnectionName (
  93. PWSTR* ppszwSuggestedName)
  94. {
  95. HRESULT hr = HrGetSuggestedConnectionName (ppszwSuggestedName);
  96. TraceError ("CDialupConnectionUi::GetSuggestedConnectionName", hr);
  97. return hr;
  98. }
  99. STDMETHODIMP
  100. CDialupConnectionUi::GetNewConnectionInfo (
  101. DWORD* pdwFlags,
  102. NETCON_MEDIATYPE* pMediaType)
  103. {
  104. HRESULT hr;
  105. *pdwFlags = 0;
  106. hr = HrGetNewConnectionInfo(pdwFlags);
  107. if (SUCCEEDED(hr))
  108. {
  109. *pdwFlags |= NCWF_SHORTCUT_ENABLE;
  110. }
  111. *pMediaType = NCM_PHONE;
  112. return hr;
  113. }
  114. STDMETHODIMP
  115. CDialupConnectionUi::SetConnectionName (
  116. PCWSTR pszwConnectionName)
  117. {
  118. HRESULT hr = HrSetConnectionName (pszwConnectionName);
  119. TraceError ("CDialupConnectionUi::SetConnectionName", hr);
  120. return hr;
  121. }
  122. STDMETHODIMP
  123. CDialupConnectionUi::GetNewConnection (
  124. INetConnection** ppCon)
  125. {
  126. HRESULT hr = HrGetNewConnection (ppCon);
  127. TraceError ("CDialupConnectionUi::GetNewConnection", hr);
  128. return hr;
  129. }