Source code of Windows XP (NT5)
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.

163 lines
2.8 KiB

  1. /*++
  2. Copyright (c) 1106990 Microsoft Corporation
  3. Module Name:
  4. splsvr.h
  5. Abstract:
  6. Header file for Spooler Service.
  7. Contains all function prototypes
  8. Author:
  9. Krishna Ganugapati (KrishnaG) 18-Oct-1993
  10. Notes:
  11. Revision History:
  12. 4-Jan-1999 Khaleds
  13. Added Code for optimiziting the load time of the spooler by decoupling
  14. the startup dependency between spoolsv and spoolss
  15. --*/
  16. //
  17. // Spooler Service States (used as return codes)
  18. //
  19. #define UPDATE_ONLY 0 // no change in state - just send current status.
  20. #define STARTING 1 // the messenger is initializing.
  21. #define RUNNING 2 // initialization completed normally - now running
  22. #define STOPPING 3 // uninstall pending
  23. #define STOPPED 4 // uninstalled
  24. //
  25. // Forced Shutdown PendingCodes
  26. //
  27. #define PENDING TRUE
  28. #define IMMEDIATE FALSE
  29. #define SPOOLER_START_PHASE_TWO_INIT 2*60*1000
  30. //
  31. // Based on the data fed back to us from perf devs,
  32. // the maximum number of threads encountered in their
  33. // tests was 2385 threads at the rate of ~12000
  34. // jobs/min. This is at 72% CPU capacity and so the
  35. // following number is suggested as a threshold to
  36. // be on the safe side with serving i/p concurrent
  37. // RPC client requests
  38. //
  39. #define SPL_MAX_RPC_CALLS 6000
  40. extern HANDLE TerminateEvent;
  41. extern HANDLE hPhase2Init;
  42. extern WCHAR szSpoolerExitingEvent[];
  43. //
  44. // Function Prototypes
  45. //
  46. DWORD
  47. GetSpoolerState (
  48. VOID
  49. );
  50. DWORD
  51. SpoolerBeginForcedShutdown(
  52. IN BOOL PendingCode,
  53. IN DWORD Win32ExitCode,
  54. IN DWORD ServiceSpecificExitCode
  55. );
  56. DWORD
  57. SpoolerInitializeSpooler(
  58. DWORD argc,
  59. LPTSTR *argv
  60. );
  61. VOID
  62. SpoolerShutdown(VOID);
  63. VOID
  64. SpoolerStatusInit(VOID);
  65. DWORD
  66. SpoolerStatusUpdate(
  67. IN DWORD NewState
  68. );
  69. DWORD
  70. SpoolerCtrlHandler(
  71. IN DWORD opcode,
  72. IN DWORD dwEventType,
  73. IN PVOID pEventData,
  74. IN PVOID pData
  75. );
  76. BOOL
  77. InitializeRouter(
  78. SERVICE_STATUS_HANDLE SpoolerStatusHandle
  79. );
  80. DWORD
  81. SplProcessPnPEvent(
  82. IN DWORD dwEventType,
  83. IN PVOID pEventData,
  84. IN PVOID pData
  85. );
  86. VOID
  87. SplStartPhase2Init(
  88. VOID);
  89. BOOL
  90. SplPowerEvent(
  91. DWORD
  92. );
  93. RPC_STATUS
  94. SpoolerStartRpcServer(
  95. VOID
  96. );
  97. RPC_STATUS
  98. SpoolerStopRpcServer(
  99. VOID
  100. );
  101. VOID
  102. SPOOLER_main (
  103. IN DWORD argc,
  104. IN LPTSTR argv[]
  105. );
  106. PSECURITY_DESCRIPTOR
  107. CreateNamedPipeSecurityDescriptor(
  108. VOID
  109. );
  110. BOOL
  111. BuildNamedPipeProtection(
  112. IN PUCHAR AceType,
  113. IN DWORD AceCount,
  114. IN PSID *AceSid,
  115. IN ACCESS_MASK *AceMask,
  116. IN BYTE *InheritFlags,
  117. IN PSID OwnerSid,
  118. IN PSID GroupSid,
  119. IN PGENERIC_MAPPING GenericMap,
  120. OUT PSECURITY_DESCRIPTOR *ppSecurityDescriptor
  121. );