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.

56 lines
1.4 KiB

  1. #include "stdafx.h"
  2. #include "common.h"
  3. #include "savedata.h"
  4. #include "aclpage.h"
  5. #include "remoteenv.h"
  6. #ifdef _DEBUG
  7. #define new DEBUG_NEW
  8. #undef THIS_FILE
  9. static char THIS_FILE[] = __FILE__;
  10. #endif
  11. HRESULT DoOnSaveData(
  12. HWND hWnd,
  13. LPCTSTR szMachineName,
  14. CMetaInterface * pInterface,
  15. BOOL bShowMsgBox,
  16. DWORD dwLastSystemChangeNumber
  17. )
  18. {
  19. HRESULT hRes = E_FAIL;
  20. // Connect to the metabase
  21. // and call it's SaveAllData() function
  22. if (pInterface)
  23. {
  24. // Flush the metabase
  25. hRes = pInterface->SaveData();
  26. if (TRUE == bShowMsgBox)
  27. {
  28. if (SUCCEEDED(hRes))
  29. {
  30. DWORD dwChangeNum = 0;
  31. CComBSTR strMsg;
  32. CComBSTR strCaption;
  33. pInterface->GetSystemChangeNumber(&dwChangeNum);
  34. if (dwLastSystemChangeNumber == dwChangeNum)
  35. {
  36. strMsg.LoadString(IDS_SAVE_DATA_NO_NEED);
  37. }
  38. else
  39. {
  40. strMsg.LoadString(IDS_SAVE_DATA_CONFIG_FILE);
  41. }
  42. strCaption.LoadString(IDS_APP_NAME);
  43. MessageBox(hWnd, strMsg, strCaption, MB_ICONINFORMATION | MB_OK | MB_APPLMODAL);
  44. }
  45. }
  46. }
  47. else
  48. {
  49. hRes = ERROR_INVALID_PARAMETER;
  50. }
  51. return hRes;
  52. }