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.

66 lines
1.2 KiB

  1. /*
  2. * GLOBALS.C
  3. *
  4. * Global data for RSM Service
  5. *
  6. * Author: ErvinP
  7. *
  8. * (c) 2001 Microsoft Corporation
  9. *
  10. */
  11. #include <windows.h>
  12. #include <stdlib.h>
  13. #include <wtypes.h>
  14. #include <ntmsapi.h>
  15. #include "internal.h"
  16. #include "resource.h"
  17. #include "debug.h"
  18. CRITICAL_SECTION g_globalServiceLock;
  19. LIST_ENTRY g_allLibrariesList;
  20. LIST_ENTRY g_allSessionsList;
  21. HANDLE g_terminateServiceEvent = NULL;
  22. HINSTANCE g_hInstance = NULL;
  23. BOOLEAN RSMServiceGlobalInit()
  24. {
  25. BOOLEAN result = FALSE;
  26. InitializeCriticalSection(&g_globalServiceLock);
  27. InitializeListHead(&g_allLibrariesList);
  28. InitializeListHead(&g_allSessionsList);
  29. g_terminateServiceEvent = CreateEvent(NULL, FALSE, FALSE, NULL);
  30. if (g_terminateServiceEvent){
  31. result = TRUE;
  32. }
  33. ASSERT(result);
  34. return result;
  35. }
  36. VOID RSMServiceGlobalShutdown()
  37. {
  38. /*
  39. * This may be called on a failed startup,
  40. * so check each handle before freeing.
  41. */
  42. if (g_terminateServiceEvent){
  43. CloseHandle(g_terminateServiceEvent);
  44. g_terminateServiceEvent = NULL;
  45. }
  46. DeleteCriticalSection(&g_globalServiceLock);
  47. }