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.

172 lines
3.5 KiB

  1. /*++
  2. Copyright (c) 1991 Microsoft Corporation
  3. Module Name:
  4. svcctrl.h
  5. Abstract:
  6. Included by the main module svcctrl.c.
  7. Author:
  8. Dan Lafferty (danl) 22-Apr-1991
  9. Environment:
  10. User Mode -Win32
  11. Revision History:
  12. 20-Oct-1993 Danl
  13. Added ScConnectedToSecProc and ScGlobalNetLogonName.
  14. --*/
  15. #ifndef SVCCTRL_H
  16. #define SVCCTRL_H
  17. #include <netevent.h>
  18. #include <safeboot.h>
  19. //
  20. // CONSTANTS
  21. //
  22. //
  23. // Flags to indicate the amount of initialization work done
  24. //
  25. #define SC_NAMED_EVENT_CREATED 0x00000001
  26. #define WELL_KNOWN_SIDS_CREATED 0x00000002
  27. #define SC_MANAGER_OBJECT_CREATED 0x00000004
  28. #define CRITICAL_SECTIONS_CREATED 0x00000008
  29. #define AUTO_START_INITIALIZED 0x00000010
  30. #define RPC_SERVER_STARTED 0x00000020
  31. #define SC_DATABASE_INITIALIZED 0x00000040
  32. //
  33. // String constants for event logging
  34. //
  35. #define SCM_NAMEW L"Service Control Manager"
  36. #define SC_RPC_IMPERSONATE L"RpcImpersonateClient"
  37. #define SC_RPC_REVERT L"RpcRevertToSelf"
  38. #define SC_LSA_STOREPRIVATEDATA L"LsaStorePrivateData"
  39. #define SC_LSA_OPENPOLICY L"LsaOpenPolicy"
  40. #define SC_RESET_EVENT L"ResetEvent"
  41. #define SC_LOAD_USER_PROFILE L"LoadUserProfile"
  42. //
  43. // Constants used for Safeboot
  44. //
  45. #define SAFEBOOT_KEY L"system\\currentcontrolset\\control\\safeboot\\"
  46. #define SAFEBOOT_KEY_LENGTH (sizeof(SAFEBOOT_KEY) / sizeof(WCHAR) - 1)
  47. typedef struct _FAILED_DRIVER {
  48. struct _FAILED_DRIVER *Next;
  49. WCHAR DriverName[1];
  50. } FAILED_DRIVER, *LPFAILED_DRIVER;
  51. //
  52. // EXTERNAL GLOBALS
  53. //
  54. extern BOOL ScAutoStartInProgress;
  55. extern DWORD ScShutdownInProgress;
  56. extern BOOL ScPopupStartFail;
  57. extern BOOL ScStillInitializing;
  58. #ifndef _CAIRO_
  59. extern BOOL ScConnectedToSecProc;
  60. extern LPWSTR ScGlobalNetLogonName;
  61. #endif // _CAIRO_
  62. extern LPWSTR ScGlobalThisExePath;
  63. extern LPWSTR ScGlobalSecurityExePath;
  64. extern NT_PRODUCT_TYPE ScGlobalProductType;
  65. extern WCHAR g_szSafebootKey[];
  66. extern DWORD g_dwSafebootLen;
  67. extern DWORD g_SafeBootEnabled;
  68. extern HKEY g_hProviderKey;
  69. extern HANDLE g_hProcessToken;
  70. //
  71. // FUNCTION PROTOTYPES
  72. //
  73. VOID
  74. SvcctrlMain (
  75. int argc,
  76. PCHAR argv[]
  77. );
  78. //
  79. // Functions from start.c
  80. //
  81. VOID
  82. ScInitStartImage(
  83. VOID
  84. );
  85. //
  86. // Functions from control.c
  87. //
  88. VOID
  89. ScInitTransactNamedPipe(
  90. VOID
  91. );
  92. //
  93. // Functions from status.c
  94. //
  95. BOOL
  96. ScInitServerAnnounceFcn(
  97. VOID
  98. );
  99. DWORD
  100. ScRemoveServiceBits(
  101. IN LPSERVICE_RECORD ServiceRecord
  102. );
  103. BOOL
  104. ScShutdownNotificationRoutine(
  105. DWORD dwCtrlType
  106. );
  107. DWORD
  108. ScAddFailedDriver(
  109. LPWSTR Driver
  110. );
  111. #define IS_CONTROL_LOGGABLE(Control) (Control == SERVICE_CONTROL_STOP || \
  112. Control == SERVICE_CONTROL_PAUSE || \
  113. Control == SERVICE_CONTROL_CONTINUE)
  114. #define IS_STATUS_LOGGABLE(Status) (Status == SERVICE_STOPPED || \
  115. Status == SERVICE_RUNNING || \
  116. Status == SERVICE_PAUSED)
  117. VOID
  118. ScLogControlEvent(
  119. DWORD dwEvent,
  120. LPCWSTR lpServiceName,
  121. DWORD dwControl
  122. );
  123. #endif // def SVCCTRL_H