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.

92 lines
2.2 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation 1996-2001.
  5. //
  6. // File: lstring.cpp
  7. //
  8. // Contents: implementation of CLocalPolString
  9. //
  10. //----------------------------------------------------------------------------
  11. #include "stdafx.h"
  12. #include "wsecmgr.h"
  13. #include "lstring.h"
  14. #include "util.h"
  15. #ifdef _DEBUG
  16. #define new DEBUG_NEW
  17. #undef THIS_FILE
  18. static char THIS_FILE[] = __FILE__;
  19. #endif
  20. /////////////////////////////////////////////////////////////////////////////
  21. // CLocalPolString dialog
  22. CLocalPolString::CLocalPolString()
  23. : CConfigName(IDD)
  24. {
  25. //{{AFX_DATA_INIT(CLocalPolString)
  26. //}}AFX_DATA_INIT
  27. m_pHelpIDs = (DWORD_PTR)a230HelpIDs;
  28. m_uTemplateResID = IDD;
  29. }
  30. /////////////////////////////////////////////////////////////////////////////
  31. // CLocalPolString message handlers
  32. BOOL CLocalPolString::OnApply()
  33. {
  34. if ( !m_bReadOnly )
  35. {
  36. LONG_PTR dw = 0;
  37. UpdateData(TRUE);
  38. BOOL bChanged=TRUE;
  39. m_strName.TrimLeft();
  40. m_strName.TrimRight();
  41. if (m_bConfigure)
  42. {
  43. dw = (LONG_PTR)(LPCTSTR)m_strName;
  44. if ( m_pData->GetBase() && dw &&
  45. _wcsicmp((LPTSTR)(m_pData->GetBase()), (LPTSTR)dw) == 0 )
  46. {
  47. bChanged = FALSE;
  48. }
  49. if ( bChanged )
  50. {
  51. if ( m_pData->GetSetting() == m_pData->GetBase() &&
  52. m_pData->GetSetting() )
  53. {
  54. // a good item, need take the base into setting
  55. m_pSnapin->TransferAnalysisName(m_pData->GetID());
  56. }
  57. m_pData->SetBase(dw);
  58. DWORD dwStatus = m_pSnapin->SetLocalPolInfo(m_pData->GetID(),dw);
  59. //Yanggao 1/31/2001 Bug211219.
  60. if( SCE_STATUS_MISMATCH == dwStatus )
  61. {
  62. m_pData->SetStatus(dwStatus);
  63. m_pData->Update(m_pSnapin,TRUE);
  64. }
  65. else if (SCE_ERROR_VALUE != dwStatus)
  66. {
  67. m_pData->SetStatus(dwStatus);
  68. m_pData->Update(m_pSnapin);
  69. }
  70. }
  71. }
  72. }
  73. // Class hieirarchy is bad - call CAttribute base method directly
  74. return CAttribute::OnApply();
  75. }