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.

102 lines
2.0 KiB

  1. /*++
  2. Copyright (c) 1991 Microsoft Corporation
  3. Module Name:
  4. splsvc.c
  5. Abstract:
  6. This is the main routine for the Spooler Service.
  7. Author:
  8. Krishna Ganugapati (KrishnaG) 17-October-1992
  9. Environment:
  10. User Mode - Win32
  11. Revision History:
  12. 17-Oct-1993 KrishnaG
  13. created
  14. --*/
  15. #include "precomp.h"
  16. #include "splsvr.h"
  17. #include "server.h"
  18. void __cdecl
  19. main (
  20. int argc,
  21. unsigned char * argv[]
  22. )
  23. /*++
  24. Routine Description:
  25. This is a main routine for the Windows NT Spooler Services.
  26. It basically sets up the ControlDispatcher and, on return, exits from
  27. this main thread. The call to NetServiceStartCtrlDispatcher does
  28. not return until all services have terminated, and this process can
  29. go away.
  30. It will be up to the ControlDispatcher thread to start/stop/pause/continue
  31. any services. If a service is to be started, it will create a thread
  32. and then call the main routine of that service.
  33. Arguments:
  34. Anything passed in from the "command line". Currently, NOTHING.
  35. Return Value:
  36. NONE
  37. Note:
  38. --*/
  39. {
  40. #if DBG
  41. //
  42. // Debugging: if started with "ns" then don't start as service.
  43. //
  44. if (argc == 2 && !lstrcmpiA("ns", argv[1])) {
  45. SpoolerStartRpcServer();
  46. InitializeRouter((SERVICE_STATUS_HANDLE)0);
  47. return;
  48. }
  49. #endif
  50. //
  51. // Call NetServiceStartCtrlDispatcher to set up the control interface.
  52. // The API won't return until all services have been terminated. At that
  53. // point, we just exit.
  54. //
  55. if (! StartServiceCtrlDispatcher (SpoolerServiceDispatchTable)) {
  56. //
  57. // It would be good to also log an Event here.
  58. //
  59. DBGMSG(DBG_ERROR, ("Fail to start control dispatcher %lu\n",GetLastError()));
  60. }
  61. ExitProcess(0);
  62. DBG_UNREFERENCED_PARAMETER( argc );
  63. DBG_UNREFERENCED_PARAMETER( argv );
  64. }