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.

124 lines
2.1 KiB

  1. /*
  2. * SERVICE.C
  3. *
  4. * Entrypoint 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. DWORD RSMServiceHandler( IN DWORD dwOpcode,
  19. IN DWORD dwEventType,
  20. IN PVOID pEventData,
  21. IN PVOID pData)
  22. {
  23. DWORD status = NO_ERROR;
  24. switch (dwOpcode){
  25. case SERVICE_CONTROL_STOP:
  26. break;
  27. case SERVICE_CONTROL_PAUSE:
  28. break;
  29. case SERVICE_CONTROL_CONTINUE:
  30. break;
  31. case SERVICE_CONTROL_INTERROGATE:
  32. break;
  33. case SERVICE_CONTROL_SHUTDOWN:
  34. break;
  35. case SERVICE_CONTROL_PARAMCHANGE:
  36. break;
  37. case SERVICE_CONTROL_DEVICEEVENT:
  38. break;
  39. case SERVICE_CONTROL_NETBINDREMOVE:
  40. break;
  41. default:
  42. break;
  43. }
  44. return status;
  45. }
  46. BOOL InitializeRSMService()
  47. {
  48. BOOL result = FALSE;
  49. DWORD dwStatus;
  50. InitGuidHash();
  51. StartLibraryManager();
  52. // BUGBUG FINISH
  53. // create global events
  54. // Initialize Device Notifications (InitializeDeviceNotClass)
  55. // WMI initialization (WmiOpenBlock, etc)
  56. /*
  57. * Populate the RSM database with default objects.
  58. */
  59. #if 0 // BUGBUG FINISH
  60. dwStatus = NtmsDbInstall();
  61. if ((dwStatus == ERROR_SUCCESS) || (dwStatus == ERROR_ALREADY_EXISTS)){
  62. // BUGBUG FINISH
  63. result = TRUE;
  64. }
  65. else {
  66. }
  67. #endif
  68. return result;
  69. }
  70. VOID ShutdownRSMService()
  71. {
  72. }
  73. VOID RSMServiceLoop()
  74. {
  75. MSG msg;
  76. /*
  77. * Loop in message pump
  78. * Unlike an app window's message pump,
  79. * a NULL-window message pump dispatches messages posted to
  80. * the current thread via PostThreadMessage().
  81. */
  82. while (GetMessage(&msg, NULL, 0, 0)){
  83. DispatchMessage(&msg);
  84. }
  85. }