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.

171 lines
3.1 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. DWORD
  77. SplProcessPnPEvent(
  78. IN DWORD dwEventType,
  79. IN PVOID pEventData,
  80. IN PVOID pData
  81. );
  82. VOID
  83. SplStartPhase2Init(
  84. VOID);
  85. BOOL
  86. SplPowerEvent(
  87. DWORD
  88. );
  89. RPC_STATUS
  90. SpoolerStartRpcServer(
  91. VOID
  92. );
  93. RPC_STATUS
  94. SpoolerStopRpcServer(
  95. VOID
  96. );
  97. VOID
  98. SPOOLER_main (
  99. IN DWORD argc,
  100. IN LPTSTR argv[]
  101. );
  102. PSECURITY_DESCRIPTOR
  103. CreateNamedPipeSecurityDescriptor(
  104. VOID
  105. );
  106. BOOL
  107. BuildNamedPipeProtection(
  108. IN PUCHAR AceType,
  109. IN DWORD AceCount,
  110. IN PSID *AceSid,
  111. IN ACCESS_MASK *AceMask,
  112. IN BYTE *InheritFlags,
  113. IN PSID OwnerSid,
  114. IN PSID GroupSid,
  115. IN PGENERIC_MAPPING GenericMap,
  116. OUT PSECURITY_DESCRIPTOR *ppSecurityDescriptor
  117. );
  118. HRESULT
  119. ServerAllowRemoteCalls(
  120. VOID
  121. );
  122. HRESULT
  123. RegisterNamedPipe(
  124. VOID
  125. );
  126. HRESULT
  127. ServerGetPolicy(
  128. IN PCWSTR pszPolicyName,
  129. IN ULONG* pulValue
  130. );