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.

169 lines
3.4 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 SCM_NAMEA "Service Control Manager"
  37. #define SC_RPC_IMPERSONATE L"RpcImpersonateClient"
  38. #define SC_RPC_REVERT L"RpcRevertToSelf"
  39. #define SC_LSA_STOREPRIVATEDATA L"LsaStorePrivateData"
  40. #define SC_LSA_RETRIEVEPRIVATEDATA L"LsaRetrievePrivateData"
  41. #define SC_LSA_OPENPOLICY L"LsaOpenPolicy"
  42. #define SC_RESET_EVENT L"ResetEvent"
  43. #define SC_LOAD_USER_PROFILE L"LoadUserProfile"
  44. //
  45. // Constants used for Safeboot
  46. //
  47. #define SAFEBOOT_BUFFER_LENGTH 256
  48. #define SAFEBOOT_KEY L"system\\currentcontrolset\\control\\safeboot\\"
  49. typedef struct _FAILED_DRIVER {
  50. struct _FAILED_DRIVER *Next;
  51. WCHAR DriverName[1];
  52. } FAILED_DRIVER, *LPFAILED_DRIVER;
  53. //
  54. // EXTERNAL GLOBALS
  55. //
  56. extern BOOL ScAutoStartInProgress;
  57. extern DWORD ScShutdownInProgress;
  58. extern BOOL ScPopupStartFail;
  59. extern BOOL ScStillInitializing;
  60. #ifndef _CAIRO_
  61. extern BOOL ScConnectedToSecProc;
  62. extern LPWSTR ScGlobalNetLogonName;
  63. #endif // _CAIRO_
  64. extern LPWSTR ScGlobalThisExePath;
  65. extern LPWSTR ScGlobalSecurityExePath;
  66. extern NT_PRODUCT_TYPE ScGlobalProductType;
  67. extern WCHAR g_szSafebootKey[];
  68. extern DWORD g_dwSafebootLen;
  69. extern DWORD g_SafeBootEnabled;
  70. extern HKEY g_hProviderKey;
  71. //
  72. // FUNCTION PROTOTYPES
  73. //
  74. VOID
  75. SvcctrlMain (
  76. int argc,
  77. PCHAR argv[]
  78. );
  79. //
  80. // Functions from start.c
  81. //
  82. VOID
  83. ScInitStartImage(
  84. VOID
  85. );
  86. //
  87. // Functions from control.c
  88. //
  89. VOID
  90. ScInitTransactNamedPipe(
  91. VOID
  92. );
  93. //
  94. // Functions from status.c
  95. //
  96. BOOL
  97. ScInitServerAnnounceFcn(
  98. VOID
  99. );
  100. DWORD
  101. ScRemoveServiceBits(
  102. IN LPSERVICE_RECORD ServiceRecord
  103. );
  104. BOOL
  105. ScShutdownNotificationRoutine(
  106. DWORD dwCtrlType
  107. );
  108. DWORD
  109. ScAddFailedDriver(
  110. LPWSTR Driver
  111. );
  112. #define IS_CONTROL_LOGGABLE(Control) (Control == SERVICE_CONTROL_STOP || \
  113. Control == SERVICE_CONTROL_PAUSE || \
  114. Control == SERVICE_CONTROL_CONTINUE)
  115. #define IS_STATUS_LOGGABLE(Status) (Status == SERVICE_STOPPED || \
  116. Status == SERVICE_RUNNING || \
  117. Status == SERVICE_PAUSED)
  118. VOID
  119. ScLogControlEvent(
  120. DWORD dwEvent,
  121. LPCWSTR lpServiceName,
  122. DWORD dwControl
  123. );
  124. #endif // def SVCCTRL_H