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.

95 lines
1.8 KiB

  1. /*
  2. * SVCAPI.C
  3. *
  4. * Interfaces 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. STDAPI DllRegisterServer(void)
  19. {
  20. HRESULT hres;
  21. // BUGBUG FINISH
  22. hres = S_OK;
  23. return hres;
  24. }
  25. STDAPI DllUnregisterServer(void)
  26. {
  27. HRESULT hres;
  28. // BUGBUG FINISH
  29. hres = S_OK;
  30. return hres;
  31. }
  32. VOID WINAPI ServiceMain(DWORD dwNumServiceArgs, LPWSTR *lpServiceArgVectors)
  33. {
  34. SERVICE_STATUS_HANDLE hService;
  35. ASSERT(g_hInstance);
  36. hService = RegisterServiceCtrlHandlerEx("NtmsSvc", RSMServiceHandler, 0);
  37. if (hService){
  38. BOOL ok;
  39. ok = InitializeRSMService();
  40. if (ok){
  41. /*
  42. * WAIT HERE UNTIL SERVICE TERMINATES
  43. */
  44. WaitForSingleObject(g_terminateServiceEvent, INFINITE);
  45. }
  46. ShutdownRSMService();
  47. }
  48. }
  49. // BUGBUG - how does old ntmssvc's DllMain get called
  50. // without being declared in the .def file ?
  51. BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)
  52. {
  53. switch (dwReason){
  54. case DLL_PROCESS_ATTACH:
  55. /*
  56. * This service DLL has its own process space,
  57. * so it should only get once instance handle ever.
  58. * BUGBUG -- is this right ?
  59. */
  60. ASSERT(!g_hInstance || (hInstance == g_hInstance));
  61. g_hInstance = hInstance;
  62. break;
  63. case DLL_THREAD_ATTACH:
  64. break;
  65. case DLL_THREAD_DETACH:
  66. break;
  67. case DLL_PROCESS_DETACH:
  68. break;
  69. }
  70. return TRUE;
  71. }