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.

158 lines
4.8 KiB

  1. // --------------------------------------------------------------------------
  2. // Module Name: CWInit.cpp
  3. //
  4. // Copyright (c) 2000, Microsoft Corporation
  5. //
  6. // C header file that contains function prototypes that contain
  7. // initialization for consumer windows functionality.
  8. //
  9. // History: 2000-02-04 vtan created
  10. // --------------------------------------------------------------------------
  11. #include "StandardHeader.h"
  12. #include <LPCFUS.h>
  13. #include <LPCThemes.h>
  14. #include <msginaexports.h>
  15. #include "Compatibility.h"
  16. #include "CredentialTransfer.h"
  17. #include "Impersonation.h"
  18. #include "LogonMutex.h"
  19. #include "ReturnToWelcome.h"
  20. #include "SpecialAccounts.h"
  21. #include "SystemSettings.h"
  22. #include "TokenGroups.h"
  23. // --------------------------------------------------------------------------
  24. // ::_Shell_DllMain
  25. //
  26. // Arguments: See the platform SDK under DllMain.
  27. //
  28. // Returns: NTSTATUS
  29. //
  30. // Purpose: Initialize anything that needs initializing in DllMain.
  31. //
  32. // History: 2000-10-13 vtan created
  33. // --------------------------------------------------------------------------
  34. EXTERN_C NTSTATUS _Shell_DllMain (HINSTANCE hInstance, DWORD dwReason)
  35. {
  36. UNREFERENCED_PARAMETER(hInstance);
  37. switch (dwReason)
  38. {
  39. case DLL_PROCESS_ATTACH:
  40. #ifdef DBG
  41. TSTATUS(CDebug::StaticInitialize());
  42. #endif
  43. TSTATUS(CImpersonation::StaticInitialize());
  44. TSTATUS(CTokenGroups::StaticInitialize());
  45. break;
  46. case DLL_PROCESS_DETACH:
  47. TSTATUS(CTokenGroups::StaticTerminate());
  48. TSTATUS(CImpersonation::StaticTerminate());
  49. #ifdef DBG
  50. TSTATUS(CDebug::StaticTerminate());
  51. break;
  52. #endif
  53. default:
  54. break;
  55. }
  56. return(STATUS_SUCCESS);
  57. }
  58. // --------------------------------------------------------------------------
  59. // ::_Shell_Initialize
  60. //
  61. // Arguments: pWlxContext = Winlogon's context for callbacks.
  62. //
  63. // Returns: NTSTATUS
  64. //
  65. // Purpose: Initializes any static information that needs to be to use
  66. // certain classes. These functions exist because of the need to
  67. // not depend on static object from being constructed.
  68. //
  69. // History: 2000-02-04 vtan created
  70. // --------------------------------------------------------------------------
  71. EXTERN_C NTSTATUS _Shell_Initialize (void *pWlxContext)
  72. {
  73. TSTATUS(CSystemSettings::CheckDomainMembership());
  74. TSTATUS(CCredentials::StaticInitialize(true));
  75. TSTATUS(CReturnToWelcome::StaticInitialize(pWlxContext));
  76. CLogonMutex::StaticInitialize();
  77. TSTATUS(_Shell_LogonStatus_StaticInitialize());
  78. TSTATUS(_Shell_LogonDialog_StaticInitialize());
  79. TSTATUS(CCompatibility::StaticInitialize());
  80. (DWORD)ThemeWaitForServiceReady(1000);
  81. (BOOL)ThemeWatchForStart();
  82. return(STATUS_SUCCESS);
  83. }
  84. // --------------------------------------------------------------------------
  85. // ::_Shell_Terminate
  86. //
  87. // Arguments: <none>
  88. //
  89. // Returns: NTSTATUS
  90. //
  91. // Purpose: Release any memory/resources used by the static initialization
  92. // of objects. This usually won't matter because this function
  93. // is called when the system or process is closing down.
  94. //
  95. // History: 2000-02-04 vtan created
  96. // --------------------------------------------------------------------------
  97. EXTERN_C NTSTATUS _Shell_Terminate (void)
  98. {
  99. TSTATUS(CCompatibility::StaticTerminate());
  100. TSTATUS(_Shell_LogonDialog_StaticTerminate());
  101. TSTATUS(_Shell_LogonStatus_StaticTerminate());
  102. CLogonMutex::StaticTerminate();
  103. TSTATUS(CReturnToWelcome::StaticTerminate());
  104. TSTATUS(CCredentials::StaticTerminate());
  105. TSTATUS(CSystemSettings::CheckDomainMembership());
  106. return(STATUS_SUCCESS);
  107. }
  108. // --------------------------------------------------------------------------
  109. // ::_Shell_Reconnect
  110. //
  111. // Arguments: <none>
  112. //
  113. // Returns: NTSTATUS
  114. //
  115. // Purpose: Notification of session reconnect.
  116. //
  117. // History: 2001-04-13 vtan created
  118. // --------------------------------------------------------------------------
  119. EXTERN_C NTSTATUS _Shell_Reconnect (void)
  120. {
  121. CCompatibility::RestoreWindowsOnReconnect();
  122. return(STATUS_SUCCESS);
  123. }
  124. // --------------------------------------------------------------------------
  125. // ::_Shell_Disconnect
  126. //
  127. // Arguments: <none>
  128. //
  129. // Returns: NTSTATUS
  130. //
  131. // Purpose: Notification of session disconnect.
  132. //
  133. // History: 2001-04-13 vtan created
  134. // --------------------------------------------------------------------------
  135. EXTERN_C NTSTATUS _Shell_Disconnect (void)
  136. {
  137. return(STATUS_SUCCESS);
  138. }