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.

274 lines
6.7 KiB

  1. /////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (c) 1998-1999 Microsoft Corporation
  4. //
  5. // Module Name:
  6. // SmbSSht.cpp
  7. //
  8. // Abstract:
  9. // Implementation of the CFileShareSecuritySheet class.
  10. //
  11. // Author:
  12. // Galen Barbee (galenb) February 12, 1998
  13. //
  14. // Revision History:
  15. //
  16. // Notes:
  17. //
  18. /////////////////////////////////////////////////////////////////////////////
  19. #include "stdafx.h"
  20. #include "resource.h"
  21. #include "SmbSSht.h"
  22. #include "AclUtils.h"
  23. #ifdef _DEBUG
  24. #define new DEBUG_NEW
  25. #undef THIS_FILE
  26. static char THIS_FILE[] = __FILE__;
  27. #endif
  28. /////////////////////////////////////////////////////////////////////////////
  29. // CFileShareSecuritySheet property page
  30. /////////////////////////////////////////////////////////////////////////////
  31. /////////////////////////////////////////////////////////////////////////////
  32. // Message Maps
  33. BEGIN_MESSAGE_MAP(CFileShareSecuritySheet, CPropertySheet)
  34. //{{AFX_MSG_MAP(CFileShareSecuritySheet)
  35. //}}AFX_MSG_MAP
  36. // TODO: Modify the following lines to represent the data displayed on this page.
  37. END_MESSAGE_MAP()
  38. /////////////////////////////////////////////////////////////////////////////
  39. //++
  40. //
  41. // CFileShareSecuritySheet::CFileShareSecuritySheet
  42. //
  43. // Routine Description:
  44. // constructor.
  45. //
  46. // Arguments:
  47. // pParent [IN]
  48. // strCaption [IN]
  49. //
  50. // Return Value:
  51. // None.
  52. //
  53. //--
  54. /////////////////////////////////////////////////////////////////////////////
  55. CFileShareSecuritySheet::CFileShareSecuritySheet(
  56. IN CWnd * pParent,
  57. IN CString const & strCaption
  58. ) : CPropertySheet( strCaption, pParent ),
  59. m_peo( NULL ),
  60. m_ppp( NULL )
  61. {
  62. // TODO: Modify the following lines to represent the data displayed on this page.
  63. //{{AFX_DATA_INIT(CFileShareSecuritySheet)
  64. //}}AFX_DATA_INIT
  65. } //*** CFileShareSecuritySheet::CFileShareSecuritySheet()
  66. /////////////////////////////////////////////////////////////////////////////
  67. //++
  68. //
  69. // CFileShareSecuritySheet::~CFileShareSecuritySheet
  70. //
  71. // Routine Description:
  72. // Destructor.
  73. //
  74. // Arguments:
  75. // None.
  76. //
  77. // Return Value:
  78. // None.
  79. //
  80. //--
  81. /////////////////////////////////////////////////////////////////////////////
  82. CFileShareSecuritySheet::~CFileShareSecuritySheet(
  83. void
  84. )
  85. {
  86. } //*** CFileShareSecuritySheet::~CFileShareSecuritySheet()
  87. /////////////////////////////////////////////////////////////////////////////
  88. //++
  89. //
  90. // CFileShareSecuritySheet::HrInit
  91. //
  92. // Routine Description:
  93. //
  94. //
  95. // Arguments:
  96. // ppp [IN]
  97. // peo [IN]
  98. // strNodeName [IN]
  99. // strShareName [IN]
  100. //
  101. // Return Value:
  102. // hr
  103. //
  104. //--
  105. /////////////////////////////////////////////////////////////////////////////
  106. HRESULT CFileShareSecuritySheet::HrInit(
  107. IN CFileShareParamsPage* ppp,
  108. IN CExtObject* peo,
  109. IN CString const& strNodeName,
  110. IN CString const& strShareName
  111. )
  112. {
  113. ASSERT( ppp != NULL );
  114. ASSERT( peo != NULL );
  115. HRESULT _hr = S_FALSE;
  116. if ( ( peo != NULL ) && ( ppp != NULL ) )
  117. {
  118. m_ppp = ppp;
  119. m_peo = peo;
  120. m_strNodeName = strNodeName;
  121. m_strShareName = strShareName;
  122. _hr = m_page.HrInit( peo, this, strNodeName );
  123. }
  124. return _hr;
  125. } //*** CFileShareSecuritySheet::HrInit()
  126. /////////////////////////////////////////////////////////////////////////////
  127. //++
  128. //
  129. // CFileShareSecuritySheet::DoDataExchange
  130. //
  131. // Routine Description:
  132. // Do data exchange between the dialog and the class.
  133. //
  134. // Arguments:
  135. // pDX [IN OUT] Data exchange object
  136. //
  137. // Return Value:
  138. // None.
  139. //
  140. //--
  141. /////////////////////////////////////////////////////////////////////////////
  142. void
  143. CFileShareSecuritySheet::DoDataExchange(
  144. CDataExchange * pDX
  145. )
  146. {
  147. AFX_MANAGE_STATE( AfxGetStaticModuleState() );
  148. // TODO: Modify the following lines to represent the data displayed on this page.
  149. //{{AFX_DATA_MAP(CFileShareSecuritySheet)
  150. //}}AFX_DATA_MAP
  151. CPropertySheet::DoDataExchange( pDX );
  152. } //*** CFileShareSecuritySheet::DoDataExchange()
  153. /////////////////////////////////////////////////////////////////////////////
  154. //++
  155. //
  156. // CFileShareSecuritySheet::OnInitDialog
  157. //
  158. // Routine Description:
  159. // Handler for the WM_INITDIALOG message.
  160. //
  161. // Arguments:
  162. // None.
  163. //
  164. // Return Value:
  165. // TRUE We need the focus to be set for us.
  166. // FALSE We already set the focus to the proper control.
  167. //
  168. //--
  169. /////////////////////////////////////////////////////////////////////////////
  170. BOOL
  171. CFileShareSecuritySheet::OnInitDialog(
  172. void
  173. )
  174. {
  175. AFX_MANAGE_STATE( AfxGetStaticModuleState() );
  176. CPropertySheet::OnInitDialog();
  177. return TRUE; // return TRUE unless you set the focus to a control
  178. // EXCEPTION: OCX Property Pages should return FALSE
  179. } //*** CFileShareSecuritySheet::OnInitDialog()
  180. /////////////////////////////////////////////////////////////////////////////
  181. //++
  182. //
  183. // CFileShareSecuritySheet::BuildPropPageArray
  184. //
  185. // Routine Description:
  186. // Overridden from CPropertySheet. Puts the security hpage into the
  187. // PROPSHEETHEADER before calling ::PropertySheet().
  188. //
  189. // Arguments:
  190. // None.
  191. //
  192. // Return Value:
  193. // None.
  194. //
  195. //--
  196. /////////////////////////////////////////////////////////////////////////////
  197. void
  198. CFileShareSecuritySheet::BuildPropPageArray(
  199. void
  200. )
  201. {
  202. // delete existing prop page array
  203. delete[] (PROPSHEETPAGE*) m_psh.ppsp; // delete any old PROPSHEETPAGEs
  204. m_psh.ppsp = NULL;
  205. // build new PROPSHEETPAGE array and coerce to an HPROPSHEETPAGE
  206. m_psh.phpage = (HPROPSHEETPAGE *) new PROPSHEETPAGE[1];
  207. m_psh.dwFlags &= ~PSH_PROPSHEETPAGE; // ensure that the hpage is used
  208. m_psh.phpage[0] = m_page.GetHPage(); // assign the hpage
  209. m_psh.nPages = 1;
  210. } //*** CFileShareSecuritySheet::BuildPropPageArray()
  211. /////////////////////////////////////////////////////////////////////////////
  212. //++
  213. //
  214. // CFileShareSecuritySheet::AssertValid
  215. //
  216. // Routine Description:
  217. // Overridden from CPropertySheet. Couldn't have an assertion that
  218. // the PROPSHEETHEADER was using phpage instead of pspp...
  219. // CPropertyPage::AssertValid() required that the flag PSH_PROPSHHETPAGE
  220. // be set.
  221. //
  222. // Arguments:
  223. // None.
  224. //
  225. // Return Value:
  226. // None.
  227. //
  228. //--
  229. /////////////////////////////////////////////////////////////////////////////
  230. #ifdef _DEBUG
  231. void
  232. CFileShareSecuritySheet::AssertValid(
  233. void
  234. ) const
  235. {
  236. CWnd::AssertValid();
  237. // NB: MFC is built using _WIN32_IE set to 0x0300. Until MFC moves up
  238. // we cannot do the following checks because they don't align then
  239. // _WIN32_IE is set to 0x0400.
  240. #if ( _WIN32_IE == 0x0300 )
  241. m_pages.AssertValid();
  242. ASSERT( m_psh.dwSize == sizeof( PROPSHEETHEADER ) );
  243. #endif
  244. } //*** CFileShareSecuritySheet::AssertValid()
  245. #endif // _DEBUG