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.

617 lines
17 KiB

  1. // FileLogs.cpp : implementation file
  2. //
  3. #include "stdafx.h"
  4. #include "smlogcfg.h"
  5. #include "fileprop.h"
  6. #include "smlogs.h"
  7. #include "smcfgmsg.h"
  8. #include "smlogqry.h"
  9. #include "fileprop.h" // for eValueRange
  10. #include "FileLogs.h"
  11. #ifdef _DEBUG
  12. #define new DEBUG_NEW
  13. #undef THIS_FILE
  14. static char THIS_FILE[] = __FILE__;
  15. #endif
  16. USE_HANDLE_MACROS("SMLOGCFG(filelogs.cpp)");
  17. static ULONG
  18. s_aulHelpIds[] =
  19. {
  20. IDC_FILES_FOLDER_EDIT, IDH_FILES_FOLDER_EDIT,
  21. IDC_FILES_FOLDER_BTN, IDH_FILES_FOLDER_BTN,
  22. IDC_FILES_FILENAME_EDIT, IDH_FILES_FILENAME_EDIT,
  23. IDC_FILES_SIZE_MAX_BTN, IDH_FILES_SIZE_MAX_BTN,
  24. IDC_FILES_SIZE_LIMIT_EDIT,IDH_FILES_SIZE_LIMIT_EDIT,
  25. IDC_FILES_SIZE_LIMIT_BTN, IDH_FILES_SIZE_LIMIT_BTN,
  26. 0,0
  27. };
  28. /////////////////////////////////////////////////////////////////////////////
  29. // CFileLogs dialog
  30. CFileLogs::CFileLogs(CWnd* pParent /*=NULL*/)
  31. : CDialog(CFileLogs::IDD, pParent)
  32. {
  33. //{{AFX_DATA_INIT(CFileLogs)
  34. m_strFileBaseName = _T("");
  35. m_strFolderName = _T("");
  36. m_nFileSizeRdo = 0;
  37. m_bAutoNameSuffix = FALSE;
  38. m_dwMaxSize = 0;
  39. m_dwFocusControl = 0;
  40. //}}AFX_DATA_INIT
  41. }
  42. void CFileLogs::DoDataExchange(CDataExchange* pDX)
  43. {
  44. CFilesProperty::eValueRange eMaxFileSize;
  45. CDialog::DoDataExchange(pDX);
  46. //{{AFX_DATA_MAP(CFileLogs)
  47. DDX_Text(pDX, IDC_FILES_FILENAME_EDIT, m_strFileBaseName);
  48. DDV_MaxChars(pDX, m_strFileBaseName, (SLQ_MAX_BASE_NAME_LEN));
  49. DDX_Text(pDX, IDC_FILES_FOLDER_EDIT, m_strFolderName);
  50. DDV_MaxChars(pDX, m_strFolderName, (MAX_PATH-1));
  51. DDX_Radio(pDX, IDC_FILES_SIZE_MAX_BTN, m_nFileSizeRdo);
  52. if ( SLF_BIN_FILE == m_dwLogFileTypeValue ) {
  53. eMaxFileSize = CFilesProperty::eMaxCtrSeqBinFileLimit;
  54. } else if ( SLF_SEQ_TRACE_FILE == m_dwLogFileTypeValue ) {
  55. eMaxFileSize = CFilesProperty::eMaxTrcSeqBinFileLimit;
  56. } else {
  57. eMaxFileSize = CFilesProperty::eMaxFileLimit;
  58. }
  59. ValidateTextEdit(pDX, IDC_FILES_SIZE_LIMIT_EDIT, 9, &m_dwMaxSize, CFilesProperty::eMinFileLimit, eMaxFileSize);
  60. //}}AFX_DATA_MAP
  61. if ( pDX->m_bSaveAndValidate ) {
  62. if (((CButton *)GetDlgItem(IDC_FILES_SIZE_MAX_BTN))->GetCheck() == 1) {
  63. m_dwMaxSizeInternal = SLQ_DISK_MAX_SIZE;
  64. } else {
  65. m_dwMaxSizeInternal = m_dwMaxSize;
  66. }
  67. }
  68. }
  69. BEGIN_MESSAGE_MAP(CFileLogs, CDialog)
  70. //{{AFX_MSG_MAP(CFileLogs)
  71. ON_WM_HELPINFO()
  72. ON_WM_CONTEXTMENU()
  73. ON_BN_CLICKED(IDC_FILES_FOLDER_BTN, OnFilesFolderBtn)
  74. ON_EN_CHANGE(IDC_FILES_FILENAME_EDIT, OnChangeFilesFilenameEdit)
  75. ON_EN_CHANGE(IDC_FILES_FOLDER_EDIT, OnChangeFilesFolderEdit)
  76. ON_EN_CHANGE(IDC_FILES_SIZE_LIMIT_EDIT, OnChangeFilesSizeLimitEdit)
  77. ON_BN_CLICKED(IDC_FILES_SIZE_LIMIT_BTN, OnFilesSizeLimitBtn)
  78. ON_NOTIFY(UDN_DELTAPOS, IDC_FILES_SIZE_LIMIT_SPIN, OnDeltaposFilesSizeLimitSpin)
  79. ON_BN_CLICKED(IDC_FILES_SIZE_MAX_BTN, OnFilesSizeMaxBtn)
  80. ON_EN_KILLFOCUS(IDC_FILES_FILENAME_EDIT, OnKillfocusFilesFilenameEdit)
  81. ON_EN_KILLFOCUS(IDC_FILES_FOLDER_EDIT, OnKillfocusFilesFolderEdit)
  82. ON_EN_KILLFOCUS(IDC_FILES_SIZE_LIMIT_EDIT, OnKillfocusFilesSizeLimitEdit)
  83. //}}AFX_MSG_MAP
  84. END_MESSAGE_MAP()
  85. /////////////////////////////////////////////////////////////////////////////
  86. // CFileLogs message handlers
  87. int
  88. BrowseCallbackProc(
  89. HWND hwnd,
  90. UINT uMsg,
  91. LPARAM /*lParam*/,
  92. LPARAM lpData
  93. )
  94. /*++
  95. Routine Description:
  96. Callback function for SHBrowseForFolder
  97. Arguments:
  98. hwnd - Handle to the browse dialog box
  99. uMsg - Identifying the reason for the callback
  100. lParam - Message parameter
  101. lpData - Application-defined value given in BROWSEINFO.lParam
  102. Return Value:
  103. 0
  104. --*/
  105. {
  106. if (uMsg == BFFM_INITIALIZED) {
  107. TCHAR buffer[MAX_PATH];
  108. CFileLogs* DlgFileLogs = (CFileLogs*) lpData;
  109. if ( DlgFileLogs->GetDlgItemText (IDC_FILES_FOLDER_EDIT, buffer, MAX_PATH)) {
  110. SendMessage(hwnd, BFFM_SETSELECTION, TRUE, (LPARAM) buffer);
  111. }
  112. }
  113. return 0;
  114. }
  115. void
  116. CFileLogs::OnFilesFolderBtn()
  117. {
  118. HRESULT hr = NOERROR;
  119. BROWSEINFO bi;
  120. LPMALLOC pMalloc = NULL;
  121. LPITEMIDLIST pidlItem;
  122. LPITEMIDLIST pidlRoot = NULL;
  123. TCHAR szFolderName[MAX_PATH];
  124. CString strTitle;
  125. ResourceStateManager rsm;
  126. m_hModule = (HINSTANCE)GetModuleHandleW (_CONFIG_DLL_NAME_W_);
  127. hr = SHGetSpecialFolderLocation(m_hWnd, CSIDL_DRIVES, &pidlRoot);
  128. if ( SUCCEEDED ( hr ) ) {
  129. hr = SHGetMalloc(&pMalloc);
  130. }
  131. if ( FAILED ( hr ) || pMalloc == NULL || pidlRoot == NULL) {
  132. //
  133. // Something wrong from SHELL api, just return
  134. //
  135. return;
  136. }
  137. bi.hwndOwner = m_hWnd;
  138. bi.pidlRoot = (LPCITEMIDLIST)pidlRoot;
  139. strTitle.LoadString ( IDS_SELECT_FILE_FOLDER );
  140. bi.lpszTitle = strTitle.GetBuffer ( strTitle.GetLength() );
  141. bi.pszDisplayName = szFolderName;
  142. bi.ulFlags = BIF_RETURNONLYFSDIRS |
  143. BIF_NEWDIALOGSTYLE |
  144. BIF_RETURNFSANCESTORS |
  145. BIF_DONTGOBELOWDOMAIN ;
  146. bi.lpfn = BrowseCallbackProc;
  147. bi.lParam = (LPARAM)this;
  148. pidlItem = SHBrowseForFolder (&bi);
  149. if ( pidlItem != NULL ) {
  150. SHGetPathFromIDList(pidlItem, szFolderName);
  151. SetDlgItemText (IDC_FILES_FOLDER_EDIT, szFolderName);
  152. } // else ignore if they canceled out
  153. //
  154. // Free the ITEMIDLIST structure returned from shell
  155. //
  156. pMalloc->Free(pidlRoot);
  157. if (pidlItem != NULL) {
  158. pMalloc->Free(pidlItem);
  159. }
  160. }
  161. void CFileLogs::OnChangeFilesFilenameEdit()
  162. {
  163. CString strOldText;
  164. // When the user hits OK in the folder browse dialog,
  165. // the file name might not have changed.
  166. strOldText = m_strFileBaseName;
  167. UpdateData( TRUE );
  168. if ( 0 != strOldText.Compare ( m_strFileBaseName ) ) {
  169. // UpdateSampleFileName();
  170. }
  171. }
  172. void CFileLogs::OnChangeFilesFolderEdit()
  173. {
  174. CString strOldText;
  175. // When the user hits OK in the folder browse dialog,
  176. // the folder name might not have changed.
  177. strOldText = m_strFolderName;
  178. UpdateData( TRUE );
  179. if ( 0 != strOldText.Compare ( m_strFolderName ) ) {
  180. // UpdateSampleFileName();
  181. }
  182. }
  183. void CFileLogs::OnChangeFilesSizeLimitEdit()
  184. {
  185. UpdateData( TRUE );
  186. }
  187. void CFileLogs::OnFilesSizeLimitBtn()
  188. {
  189. FileSizeBtn(FALSE);
  190. }
  191. void CFileLogs::OnDeltaposFilesSizeLimitSpin(NMHDR* pNMHDR, LRESULT* pResult)
  192. {
  193. CFilesProperty::eValueRange eMaxFileSize;
  194. if ( SLF_BIN_FILE == m_dwLogFileTypeValue ) {
  195. eMaxFileSize = CFilesProperty::eMaxCtrSeqBinFileLimit;
  196. } else if ( SLF_SEQ_TRACE_FILE == m_dwLogFileTypeValue ) {
  197. eMaxFileSize = CFilesProperty::eMaxTrcSeqBinFileLimit;
  198. } else {
  199. eMaxFileSize = CFilesProperty::eMaxFileLimit;
  200. }
  201. OnDeltaposSpin(pNMHDR, pResult, & m_dwMaxSize, CFilesProperty::eMinFileLimit, eMaxFileSize);
  202. }
  203. void CFileLogs::OnFilesSizeMaxBtn()
  204. {
  205. FileSizeBtn(FALSE);
  206. }
  207. void CFileLogs::OnKillfocusFilesFilenameEdit()
  208. {
  209. CString strOldText;
  210. strOldText = m_strFileBaseName;
  211. UpdateData ( TRUE );
  212. }
  213. void CFileLogs::OnKillfocusFilesFolderEdit()
  214. {
  215. CString strOldText;
  216. strOldText = m_strFolderName;
  217. UpdateData ( TRUE );
  218. }
  219. void CFileLogs::OnKillfocusFilesSizeLimitEdit()
  220. {
  221. DWORD dwOldValue;
  222. dwOldValue = m_dwMaxSize;
  223. UpdateData ( TRUE );
  224. }
  225. BOOL CFileLogs::OnInitDialog()
  226. {
  227. BOOL bLimitBtnSet;
  228. BOOL bReturn = TRUE;
  229. CDialog::OnInitDialog();
  230. // set the buttons
  231. m_nFileSizeRdo = 1;
  232. if (m_dwMaxSizeInternal == SLQ_DISK_MAX_SIZE) {
  233. m_nFileSizeRdo = 0;
  234. m_dwMaxSize = 1; // default
  235. } else {
  236. m_nFileSizeRdo = 1;
  237. m_dwMaxSize = m_dwMaxSizeInternal;
  238. }
  239. bLimitBtnSet = (m_nFileSizeRdo == 1);
  240. GetDlgItem(IDC_FILES_SIZE_LIMIT_EDIT)->EnableWindow(bLimitBtnSet);
  241. // Disable the file browse button for remote machines
  242. ASSERT ( NULL != m_pLogQuery );
  243. if ( NULL != m_pLogQuery ) {
  244. if ( !m_pLogQuery->GetLogService()->IsLocalMachine() ) {
  245. GetDlgItem ( IDC_FILES_FOLDER_BTN )->EnableWindow ( FALSE );
  246. }
  247. }
  248. UpdateData(FALSE);
  249. FileSizeBtnEnable();
  250. FileSizeBtn(FALSE);
  251. if ( 0 != m_dwFocusControl ) {
  252. GetDlgItem ( m_dwFocusControl )->SetFocus();
  253. bReturn = FALSE;
  254. }
  255. return bReturn; // return TRUE unless you set the focus to a control
  256. // EXCEPTION: OCX Property Pages should return FALSE
  257. }
  258. void CFileLogs::OnOK()
  259. {
  260. // load data from dialog
  261. if ( UpdateData (TRUE) ) {
  262. if ( IsValidLocalData() ) {
  263. CDialog::OnOK();
  264. }
  265. }
  266. }
  267. void
  268. CFileLogs::OnDeltaposSpin(
  269. NMHDR *pNMHDR,
  270. LRESULT *pResult,
  271. DWORD *pValue,
  272. DWORD dMinValue,
  273. DWORD dMaxValue)
  274. {
  275. NM_UPDOWN* pNMUpDown;
  276. LONG lValue;
  277. BOOL bResult = TRUE;
  278. UpdateData(TRUE);
  279. ASSERT(dMinValue <= dMaxValue);
  280. if ( NULL != pNMHDR
  281. && NULL != pResult
  282. && NULL != pValue )
  283. {
  284. pNMUpDown = (NM_UPDOWN *) pNMHDR;
  285. lValue = (LONG) (*pValue);
  286. if (lValue == INVALID_DWORD) {
  287. lValue = (DWORD) dMinValue;
  288. } else {
  289. if ( ((lValue >= (LONG) dMinValue + 1) && (pNMUpDown->iDelta > 0))
  290. || ((lValue <= (LONG) dMaxValue - 1) && (pNMUpDown->iDelta < 0)))
  291. {
  292. lValue += (pNMUpDown->iDelta * -1);
  293. if (lValue > (LONG) dMaxValue) {
  294. lValue = (DWORD) dMaxValue;
  295. } else if (lValue < (LONG) dMinValue) {
  296. lValue = (DWORD) dMinValue;
  297. }
  298. } else if (lValue > (LONG) dMaxValue) {
  299. lValue = (DWORD) dMaxValue;
  300. } else if (lValue < (LONG) dMinValue) {
  301. lValue = (DWORD) dMinValue;
  302. } else {
  303. bResult = FALSE;
  304. }
  305. }
  306. if (bResult) {
  307. *pValue = lValue;
  308. UpdateData(FALSE);
  309. }
  310. *pResult = 0;
  311. } else {
  312. ASSERT ( FALSE );
  313. }
  314. return;
  315. }
  316. void CFileLogs::FileSizeBtnEnable()
  317. {
  318. if ( ( SLF_BIN_CIRC_FILE == m_dwLogFileTypeValue )
  319. ||( SLF_CIRC_TRACE_FILE == m_dwLogFileTypeValue ) ) {
  320. ((CButton *)GetDlgItem(IDC_FILES_SIZE_LIMIT_BTN))->SetCheck(1);
  321. ((CButton *)GetDlgItem(IDC_FILES_SIZE_MAX_BTN))->SetCheck(0);
  322. GetDlgItem(IDC_FILES_SIZE_MAX_BTN)->EnableWindow ( FALSE );
  323. } else {
  324. GetDlgItem(IDC_FILES_SIZE_MAX_BTN)->EnableWindow ( TRUE );
  325. }
  326. }
  327. void CFileLogs::FileSizeBtn(BOOL bInit)
  328. {
  329. INT m_nFileSizeOld;
  330. m_nFileSizeOld = m_nFileSizeRdo;
  331. UpdateData ( TRUE );
  332. if (bInit || (m_nFileSizeOld != m_nFileSizeRdo)) {
  333. BOOL bMaxBtnSet, bLimitBtnSet;
  334. // *** This can be replaced since DDX_Radio implemented.
  335. // get btn state
  336. bMaxBtnSet = ((CButton *)GetDlgItem(IDC_FILES_SIZE_MAX_BTN))->GetCheck() == 1;
  337. bLimitBtnSet = ((CButton *)GetDlgItem(IDC_FILES_SIZE_LIMIT_BTN))->GetCheck() == 1;
  338. ASSERT (bLimitBtnSet != bMaxBtnSet);
  339. GetDlgItem(IDC_FILES_SIZE_LIMIT_EDIT)->EnableWindow(bLimitBtnSet);
  340. GetDlgItem(IDC_FILES_SIZE_LIMIT_SPIN)->EnableWindow(bLimitBtnSet);
  341. GetDlgItem(IDC_FILES_SIZE_LIMIT_UNITS)->EnableWindow(bLimitBtnSet);
  342. }
  343. }
  344. BOOL CFileLogs::IsValidLocalData()
  345. {
  346. BOOL bIsValid = TRUE;
  347. CFilesProperty::eValueRange eMaxFileSize;
  348. INT iPrevLength = 0;
  349. ResourceStateManager rsm;
  350. // assumes UpdateData has been called
  351. // Trim folder name and file name before validation
  352. iPrevLength = m_strFolderName.GetLength();
  353. m_strFolderName.TrimLeft();
  354. m_strFolderName.TrimRight();
  355. if ( iPrevLength != m_strFolderName.GetLength() ) {
  356. SetDlgItemText ( IDC_FILES_FOLDER_EDIT, m_strFolderName );
  357. }
  358. iPrevLength = m_strFileBaseName.GetLength();
  359. m_strFileBaseName.TrimRight();
  360. if ( iPrevLength != m_strFileBaseName.GetLength() ) {
  361. SetDlgItemText ( IDC_FILES_FILENAME_EDIT, m_strFileBaseName );
  362. }
  363. if ( bIsValid ) {
  364. if ( m_strFolderName.IsEmpty() ) {
  365. CString strMessage;
  366. strMessage.LoadString ( IDS_FILE_ERR_NOFOLDERNAME );
  367. MessageBox ( strMessage, m_pLogQuery->GetLogName(), MB_OK | MB_ICONERROR);
  368. (GetDlgItem(IDC_FILES_FOLDER_EDIT))->SetFocus();
  369. bIsValid = FALSE;
  370. }
  371. }
  372. if ( bIsValid ) {
  373. if ( m_strFileBaseName.IsEmpty() ) {
  374. if ( !m_bAutoNameSuffix ) {
  375. CString strMessage;
  376. strMessage.LoadString ( IDS_FILE_ERR_NOFILENAME );
  377. MessageBox ( strMessage, m_pLogQuery->GetLogName(), MB_OK | MB_ICONERROR);
  378. (GetDlgItem(IDC_FILES_FILENAME_EDIT))->SetFocus();
  379. bIsValid = FALSE;
  380. }
  381. } else {
  382. if ( !FileNameIsValid ( &m_strFileBaseName ) ){
  383. CString strMessage;
  384. strMessage.LoadString (IDS_ERRMSG_INVALIDCHAR);
  385. MessageBox( strMessage, m_pLogQuery->GetLogName(), MB_OK| MB_ICONERROR );
  386. (GetDlgItem(IDC_FILES_FILENAME_EDIT))->SetFocus();
  387. bIsValid = FALSE;
  388. }
  389. }
  390. }
  391. if ( bIsValid ) {
  392. if ( m_pLogQuery->GetLogService()->IsLocalMachine() ) {
  393. ProcessDirPath ( m_strFolderName, m_pLogQuery->GetLogName(), this, bIsValid, TRUE );
  394. if ( !bIsValid ) {
  395. GetDlgItem(IDC_FILES_FOLDER_EDIT)->SetFocus();
  396. }
  397. }
  398. }
  399. if (bIsValid)
  400. {
  401. if ( SLQ_DISK_MAX_SIZE != m_dwMaxSizeInternal ) {
  402. if ( SLF_BIN_FILE == m_dwLogFileTypeValue ) {
  403. eMaxFileSize = CFilesProperty::eMaxCtrSeqBinFileLimit;
  404. } else if ( SLF_SEQ_TRACE_FILE == m_dwLogFileTypeValue ) {
  405. eMaxFileSize = CFilesProperty::eMaxTrcSeqBinFileLimit;
  406. } else {
  407. eMaxFileSize = CFilesProperty::eMaxFileLimit;
  408. }
  409. bIsValid = ValidateDWordInterval(IDC_FILES_SIZE_LIMIT_EDIT,
  410. m_pLogQuery->GetLogName(),
  411. (long) m_dwMaxSizeInternal,
  412. CFilesProperty::eMinFileLimit,
  413. eMaxFileSize);
  414. }
  415. }
  416. return bIsValid;
  417. }
  418. void
  419. CFileLogs::ValidateTextEdit(
  420. CDataExchange * pDX,
  421. int nIDC,
  422. int nMaxChars,
  423. DWORD * pValue,
  424. DWORD /* minValue */,
  425. DWORD /* maxValue */)
  426. {
  427. HWND hWndCtrl = pDX->PrepareEditCtrl(nIDC);
  428. LONG currentValue = INVALID_DWORD;
  429. TCHAR szT[MAXSTR];
  430. CString strTemp;
  431. if ( NULL != pDX && NULL != pValue ) {
  432. if (pDX->m_bSaveAndValidate)
  433. {
  434. * pValue = (DWORD) currentValue;
  435. ::GetWindowText(hWndCtrl, szT, MAXSTR);
  436. strTemp = szT;
  437. DDV_MaxChars(pDX, strTemp, nMaxChars);
  438. if (szT[0] >= _T('0') && szT[0] <= _T('9'))
  439. {
  440. currentValue = _wtol(szT);
  441. * pValue = (DWORD) currentValue;
  442. }
  443. } else {
  444. if ( INVALID_DWORD != *pValue ) {
  445. wsprintf(szT, _T("%lu"), *pValue);
  446. } else {
  447. szT[0] = _T('\0');
  448. }
  449. GetDlgItem(nIDC)->SetWindowText(szT);
  450. }
  451. } else {
  452. ASSERT ( FALSE );
  453. }
  454. }
  455. BOOL
  456. CFileLogs::ValidateDWordInterval(int nIDC,
  457. LPCWSTR strLogName,
  458. long lValue,
  459. DWORD minValue,
  460. DWORD maxValue)
  461. {
  462. CString strMsg;
  463. BOOL bResult = (lValue >= (long) minValue)
  464. && (lValue <= (long) maxValue);
  465. if (! bResult)
  466. {
  467. strMsg.Format ( IDS_ERRMSG_INVALIDDWORD, minValue, maxValue );
  468. MessageBox(strMsg, strLogName, MB_OK | MB_ICONERROR);
  469. GetDlgItem(nIDC)->SetFocus();
  470. strMsg.Empty();
  471. }
  472. return (bResult);
  473. }
  474. BOOL
  475. CFileLogs::OnHelpInfo(HELPINFO * pHelpInfo)
  476. {
  477. if (pHelpInfo->iCtrlId >= IDC_FILELOG_FIRST_HELP_CTRL_ID ||
  478. pHelpInfo->iCtrlId == IDOK ||
  479. pHelpInfo->iCtrlId == IDCANCEL ) {
  480. InvokeWinHelp(WM_HELP,
  481. NULL,
  482. (LPARAM) pHelpInfo,
  483. m_strHelpFilePath,
  484. s_aulHelpIds);
  485. }
  486. return TRUE;
  487. }
  488. void
  489. CFileLogs::OnContextMenu(CWnd* pWnd, CPoint /* point */)
  490. {
  491. InvokeWinHelp(WM_CONTEXTMENU, (WPARAM)(pWnd->m_hWnd), NULL, m_strHelpFilePath, s_aulHelpIds);
  492. return;
  493. }
  494. DWORD
  495. CFileLogs::SetContextHelpFilePath(const CString& rstrPath)
  496. {
  497. DWORD dwStatus = ERROR_SUCCESS;
  498. MFC_TRY
  499. m_strHelpFilePath = rstrPath;
  500. MFC_CATCH_DWSTATUS
  501. return dwStatus;
  502. }