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.

87 lines
1.5 KiB

  1. // Copyright (C) 1997 Microsoft Corporation
  2. //
  3. // dcpromo setup entry points
  4. //
  5. // 2-11-98 sburns
  6. #include "headers.hxx"
  7. HINSTANCE hResourceModuleHandle = 0;
  8. HINSTANCE hDLLModuleHandle = 0;
  9. const wchar_t* HELPFILE_NAME = 0;
  10. const wchar_t* RUNTIME_NAME = L"dcpromos";
  11. DWORD DEFAULT_LOGGING_OPTIONS =
  12. Log::OUTPUT_TO_FILE
  13. | Log::OUTPUT_FUNCCALLS
  14. | Log::OUTPUT_LOGS
  15. | Log::OUTPUT_ERRORS
  16. | Log::OUTPUT_HEADER;
  17. BOOL
  18. APIENTRY
  19. DllMain(
  20. HINSTANCE hInstance,
  21. DWORD dwReason,
  22. PVOID /* lpReserved */ )
  23. {
  24. switch (dwReason)
  25. {
  26. case DLL_PROCESS_ATTACH:
  27. {
  28. hResourceModuleHandle = hInstance;
  29. hDLLModuleHandle = hInstance;
  30. LOG(L"DLL_PROCESS_ATTACH");
  31. break;
  32. }
  33. case DLL_PROCESS_DETACH:
  34. {
  35. LOG(L"DLL_PROCESS_DETACH");
  36. break;
  37. }
  38. case DLL_THREAD_ATTACH:
  39. case DLL_THREAD_DETACH:
  40. default:
  41. {
  42. break;
  43. }
  44. }
  45. return TRUE;
  46. }
  47. DWORD
  48. APIENTRY
  49. DcPromoSaveDcStateForUpgrade(PCWSTR answerFile)
  50. {
  51. LOG_FUNCTION(DcPromoSaveDcStateForUpgrade);
  52. DWORD result = ERROR_SUCCESS;
  53. if (!IsDSRunning())
  54. {
  55. LOG(L"Calling DsRoleServerSaveStateForUpgrade");
  56. LOG(String::format(L"AnswerFile : %1",
  57. answerFile ? answerFile : L"(null)"));
  58. result = ::DsRoleServerSaveStateForUpgrade(answerFile);
  59. LOG(String::format(L"Error 0x%1!X! (!0 => error)", result));
  60. }
  61. return result;
  62. }