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.

164 lines
4.7 KiB

  1. // --------------------------------------------------------------------------
  2. // Module Name: ThemeServerExports.cpp
  3. //
  4. // Copyright (c) 2000, Microsoft Corporation
  5. //
  6. // This file contains functions that exported from the theme services module.
  7. //
  8. // History: 2000-11-29 vtan created
  9. // --------------------------------------------------------------------------
  10. #include "StandardHeader.h"
  11. #include "StatusCode.h"
  12. #include "ThemeServerClient.h"
  13. #include <uxthemep.h>
  14. // --------------------------------------------------------------------------
  15. // ::ThemeWaitForServiceReady
  16. //
  17. // Arguments: dwTimeout = Number of ticks to wait.
  18. //
  19. // Returns: DWORD
  20. //
  21. // Purpose: External C entry point to DLL to wait for the service to
  22. // enter the running state.
  23. //
  24. // History: 2000-10-13 vtan created
  25. // 2000-11-29 vtan converted to a Win32 service
  26. // --------------------------------------------------------------------------
  27. EXTERN_C DWORD WINAPI ThemeWaitForServiceReady (DWORD dwTimeout)
  28. {
  29. return(CThemeServerClient::WaitForServiceReady(dwTimeout));
  30. }
  31. // --------------------------------------------------------------------------
  32. // ::ThemeWatchForStart
  33. //
  34. // Arguments: <none>
  35. //
  36. // Returns: BOOL
  37. //
  38. // Purpose: External C entry point to DLL to watch for the service
  39. // recovering or demand starting.
  40. //
  41. // History: 2000-11-29 vtan created
  42. // --------------------------------------------------------------------------
  43. EXTERN_C BOOL WINAPI ThemeWatchForStart (void)
  44. {
  45. bool fResult;
  46. NTSTATUS status;
  47. status = CThemeServerClient::WatchForStart();
  48. fResult = NT_SUCCESS(status);
  49. if (!fResult)
  50. {
  51. SetLastError(CStatusCode::ErrorCodeOfStatusCode(status));
  52. }
  53. return(fResult);
  54. }
  55. // --------------------------------------------------------------------------
  56. // ::ThemeUserLogon
  57. //
  58. // Arguments: hToken = Token of user that logged on.
  59. //
  60. // Returns: BOOL
  61. //
  62. // Purpose: External C entry point to DLL to signal a user logon.
  63. //
  64. // History: 2000-10-12 vtan created
  65. // 2000-11-29 vtan converted to a Win32 service
  66. // --------------------------------------------------------------------------
  67. EXTERN_C BOOL WINAPI ThemeUserLogon (HANDLE hToken)
  68. {
  69. bool fResult;
  70. NTSTATUS status;
  71. status = CThemeServerClient::UserLogon(hToken);
  72. fResult = NT_SUCCESS(status);
  73. if (!fResult)
  74. {
  75. SetLastError(CStatusCode::ErrorCodeOfStatusCode(status));
  76. }
  77. return(fResult);
  78. }
  79. // --------------------------------------------------------------------------
  80. // ::ThemeUserLogoff
  81. //
  82. // Arguments: <none>
  83. //
  84. // Returns: BOOL
  85. //
  86. // Purpose: External C entry point to DLL to signal a user logoff.
  87. //
  88. // History: 2000-10-12 vtan created
  89. // 2000-11-29 vtan converted to a Win32 service
  90. // --------------------------------------------------------------------------
  91. EXTERN_C BOOL WINAPI ThemeUserLogoff (void)
  92. {
  93. bool fResult;
  94. NTSTATUS status;
  95. status = CThemeServerClient::UserLogoff();
  96. fResult = NT_SUCCESS(status);
  97. if (!fResult)
  98. {
  99. SetLastError(CStatusCode::ErrorCodeOfStatusCode(status));
  100. }
  101. return(fResult);
  102. }
  103. // --------------------------------------------------------------------------
  104. // ::ThemeUserTSReconnect
  105. //
  106. // Arguments: <none>
  107. //
  108. // Returns: BOOL
  109. //
  110. // Purpose: External C entry point to DLL to signal terminal server
  111. // "reconnect" (remote connect to a session or reestablish
  112. // local connect to a session).
  113. //
  114. // History: 2001-01-18 rfernand created
  115. // --------------------------------------------------------------------------
  116. EXTERN_C BOOL WINAPI ThemeUserTSReconnect (void)
  117. {
  118. //---- this may turn theme on/off based on local/remote conditions ----
  119. CThemeServerClient::UserInitTheme(FALSE);
  120. return(true); // always succeeds
  121. }
  122. // --------------------------------------------------------------------------
  123. // ::ThemeUserStartShell
  124. //
  125. // Arguments: <none>
  126. //
  127. // Returns: BOOL
  128. //
  129. // Purpose: Load the theme for this user
  130. //
  131. // History: 2001-03-29 lmouton created
  132. // --------------------------------------------------------------------------
  133. EXTERN_C BOOL WINAPI ThemeUserStartShell (void)
  134. {
  135. //---- this may turn theme on/off based on local/remote conditions ----
  136. CThemeServerClient::UserInitTheme(TRUE);
  137. return(true); // always succeeds
  138. }