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.

747 lines
18 KiB

  1. /*++ BUILD Version: 0010 // Increment this if a change has global effects
  2. Copyright (c) 1993-1994 Microsoft Corporation
  3. Module Name:
  4. winsvc.h
  5. Abstract:
  6. Header file for the Service Control Manager
  7. --*/
  8. #ifndef _WINSVC_
  9. #define _WINSVC_
  10. //
  11. // Define API decoration for direct importing of DLL references.
  12. //
  13. #if !defined(WINADVAPI)
  14. #if !defined(_ADVAPI32_)
  15. #define WINADVAPI DECLSPEC_IMPORT
  16. #else
  17. #define WINADVAPI
  18. #endif
  19. #endif
  20. #ifdef __cplusplus
  21. extern "C" {
  22. #endif
  23. //
  24. // Constants
  25. //
  26. //
  27. // Service database names
  28. //
  29. #define SERVICES_ACTIVE_DATABASEW L"ServicesActive"
  30. #define SERVICES_FAILED_DATABASEW L"ServicesFailed"
  31. #define SERVICES_ACTIVE_DATABASEA "ServicesActive"
  32. #define SERVICES_FAILED_DATABASEA "ServicesFailed"
  33. //
  34. // Character to designate that a name is a group
  35. //
  36. #define SC_GROUP_IDENTIFIERW L'+'
  37. #define SC_GROUP_IDENTIFIERA '+'
  38. #ifdef UNICODE
  39. #define SERVICES_ACTIVE_DATABASE SERVICES_ACTIVE_DATABASEW
  40. #define SERVICES_FAILED_DATABASE SERVICES_FAILED_DATABASEW
  41. #define SC_GROUP_IDENTIFIER SC_GROUP_IDENTIFIERW
  42. #else // ndef UNICODE
  43. #define SERVICES_ACTIVE_DATABASE SERVICES_ACTIVE_DATABASEA
  44. #define SERVICES_FAILED_DATABASE SERVICES_FAILED_DATABASEA
  45. #define SC_GROUP_IDENTIFIER SC_GROUP_IDENTIFIERA
  46. #endif // ndef UNICODE
  47. //
  48. // Value to indicate no change to an optional parameter
  49. //
  50. #define SERVICE_NO_CHANGE 0xffffffff
  51. //
  52. // Service State -- for Enum Requests (Bit Mask)
  53. //
  54. #define SERVICE_ACTIVE 0x00000001
  55. #define SERVICE_INACTIVE 0x00000002
  56. #define SERVICE_STATE_ALL (SERVICE_ACTIVE | \
  57. SERVICE_INACTIVE)
  58. //
  59. // Controls
  60. //
  61. #define SERVICE_CONTROL_STOP 0x00000001
  62. #define SERVICE_CONTROL_PAUSE 0x00000002
  63. #define SERVICE_CONTROL_CONTINUE 0x00000003
  64. #define SERVICE_CONTROL_INTERROGATE 0x00000004
  65. #define SERVICE_CONTROL_SHUTDOWN 0x00000005
  66. //
  67. // Service State -- for CurrentState
  68. //
  69. #define SERVICE_STOPPED 0x00000001
  70. #define SERVICE_START_PENDING 0x00000002
  71. #define SERVICE_STOP_PENDING 0x00000003
  72. #define SERVICE_RUNNING 0x00000004
  73. #define SERVICE_CONTINUE_PENDING 0x00000005
  74. #define SERVICE_PAUSE_PENDING 0x00000006
  75. #define SERVICE_PAUSED 0x00000007
  76. //
  77. // Controls Accepted (Bit Mask)
  78. //
  79. #define SERVICE_ACCEPT_STOP 0x00000001
  80. #define SERVICE_ACCEPT_PAUSE_CONTINUE 0x00000002
  81. #define SERVICE_ACCEPT_SHUTDOWN 0x00000004
  82. //
  83. // Service Control Manager object specific access types
  84. //
  85. #define SC_MANAGER_CONNECT 0x0001
  86. #define SC_MANAGER_CREATE_SERVICE 0x0002
  87. #define SC_MANAGER_ENUMERATE_SERVICE 0x0004
  88. #define SC_MANAGER_LOCK 0x0008
  89. #define SC_MANAGER_QUERY_LOCK_STATUS 0x0010
  90. #define SC_MANAGER_MODIFY_BOOT_CONFIG 0x0020
  91. #define SC_MANAGER_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | \
  92. SC_MANAGER_CONNECT | \
  93. SC_MANAGER_CREATE_SERVICE | \
  94. SC_MANAGER_ENUMERATE_SERVICE | \
  95. SC_MANAGER_LOCK | \
  96. SC_MANAGER_QUERY_LOCK_STATUS | \
  97. SC_MANAGER_MODIFY_BOOT_CONFIG)
  98. //
  99. // Service object specific access type
  100. //
  101. #define SERVICE_QUERY_CONFIG 0x0001
  102. #define SERVICE_CHANGE_CONFIG 0x0002
  103. #define SERVICE_QUERY_STATUS 0x0004
  104. #define SERVICE_ENUMERATE_DEPENDENTS 0x0008
  105. #define SERVICE_START 0x0010
  106. #define SERVICE_STOP 0x0020
  107. #define SERVICE_PAUSE_CONTINUE 0x0040
  108. #define SERVICE_INTERROGATE 0x0080
  109. #define SERVICE_USER_DEFINED_CONTROL 0x0100
  110. #define SERVICE_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | \
  111. SERVICE_QUERY_CONFIG | \
  112. SERVICE_CHANGE_CONFIG | \
  113. SERVICE_QUERY_STATUS | \
  114. SERVICE_ENUMERATE_DEPENDENTS | \
  115. SERVICE_START | \
  116. SERVICE_STOP | \
  117. SERVICE_PAUSE_CONTINUE | \
  118. SERVICE_INTERROGATE | \
  119. SERVICE_USER_DEFINED_CONTROL)
  120. //
  121. // Handle Types
  122. //
  123. typedef HANDLE SC_HANDLE;
  124. typedef SC_HANDLE *LPSC_HANDLE;
  125. typedef DWORD SERVICE_STATUS_HANDLE;
  126. //
  127. // Service Status Structure
  128. //
  129. typedef struct _SERVICE_STATUS {
  130. DWORD dwServiceType;
  131. DWORD dwCurrentState;
  132. DWORD dwControlsAccepted;
  133. DWORD dwWin32ExitCode;
  134. DWORD dwServiceSpecificExitCode;
  135. DWORD dwCheckPoint;
  136. DWORD dwWaitHint;
  137. } SERVICE_STATUS, *LPSERVICE_STATUS;
  138. //
  139. // Service Status Enumeration Structure
  140. //
  141. typedef struct _ENUM_SERVICE_STATUSA {
  142. LPSTR lpServiceName;
  143. LPSTR lpDisplayName;
  144. SERVICE_STATUS ServiceStatus;
  145. } ENUM_SERVICE_STATUSA, *LPENUM_SERVICE_STATUSA;
  146. typedef struct _ENUM_SERVICE_STATUSW {
  147. LPWSTR lpServiceName;
  148. LPWSTR lpDisplayName;
  149. SERVICE_STATUS ServiceStatus;
  150. } ENUM_SERVICE_STATUSW, *LPENUM_SERVICE_STATUSW;
  151. #ifdef UNICODE
  152. typedef ENUM_SERVICE_STATUSW ENUM_SERVICE_STATUS;
  153. typedef LPENUM_SERVICE_STATUSW LPENUM_SERVICE_STATUS;
  154. #else
  155. typedef ENUM_SERVICE_STATUSA ENUM_SERVICE_STATUS;
  156. typedef LPENUM_SERVICE_STATUSA LPENUM_SERVICE_STATUS;
  157. #endif // UNICODE
  158. //
  159. // Structures for the Lock API functions
  160. //
  161. typedef LPVOID SC_LOCK;
  162. typedef struct _QUERY_SERVICE_LOCK_STATUSA {
  163. DWORD fIsLocked;
  164. LPSTR lpLockOwner;
  165. DWORD dwLockDuration;
  166. } QUERY_SERVICE_LOCK_STATUSA, *LPQUERY_SERVICE_LOCK_STATUSA;
  167. typedef struct _QUERY_SERVICE_LOCK_STATUSW {
  168. DWORD fIsLocked;
  169. LPWSTR lpLockOwner;
  170. DWORD dwLockDuration;
  171. } QUERY_SERVICE_LOCK_STATUSW, *LPQUERY_SERVICE_LOCK_STATUSW;
  172. #ifdef UNICODE
  173. typedef QUERY_SERVICE_LOCK_STATUSW QUERY_SERVICE_LOCK_STATUS;
  174. typedef LPQUERY_SERVICE_LOCK_STATUSW LPQUERY_SERVICE_LOCK_STATUS;
  175. #else
  176. typedef QUERY_SERVICE_LOCK_STATUSA QUERY_SERVICE_LOCK_STATUS;
  177. typedef LPQUERY_SERVICE_LOCK_STATUSA LPQUERY_SERVICE_LOCK_STATUS;
  178. #endif // UNICODE
  179. //
  180. // Query Service Configuration Structure
  181. //
  182. typedef struct _QUERY_SERVICE_CONFIGA {
  183. DWORD dwServiceType;
  184. DWORD dwStartType;
  185. DWORD dwErrorControl;
  186. LPSTR lpBinaryPathName;
  187. LPSTR lpLoadOrderGroup;
  188. DWORD dwTagId;
  189. LPSTR lpDependencies;
  190. LPSTR lpServiceStartName;
  191. LPSTR lpDisplayName;
  192. } QUERY_SERVICE_CONFIGA, *LPQUERY_SERVICE_CONFIGA;
  193. typedef struct _QUERY_SERVICE_CONFIGW {
  194. DWORD dwServiceType;
  195. DWORD dwStartType;
  196. DWORD dwErrorControl;
  197. LPWSTR lpBinaryPathName;
  198. LPWSTR lpLoadOrderGroup;
  199. DWORD dwTagId;
  200. LPWSTR lpDependencies;
  201. LPWSTR lpServiceStartName;
  202. LPWSTR lpDisplayName;
  203. } QUERY_SERVICE_CONFIGW, *LPQUERY_SERVICE_CONFIGW;
  204. #ifdef UNICODE
  205. typedef QUERY_SERVICE_CONFIGW QUERY_SERVICE_CONFIG;
  206. typedef LPQUERY_SERVICE_CONFIGW LPQUERY_SERVICE_CONFIG;
  207. #else
  208. typedef QUERY_SERVICE_CONFIGA QUERY_SERVICE_CONFIG;
  209. typedef LPQUERY_SERVICE_CONFIGA LPQUERY_SERVICE_CONFIG;
  210. #endif // UNICODE
  211. //
  212. // Function Prototype for the Service Main Function
  213. //
  214. typedef VOID (WINAPI *LPSERVICE_MAIN_FUNCTIONW)(
  215. DWORD dwNumServicesArgs,
  216. LPWSTR *lpServiceArgVectors
  217. );
  218. typedef VOID (WINAPI *LPSERVICE_MAIN_FUNCTIONA)(
  219. DWORD dwNumServicesArgs,
  220. LPSTR *lpServiceArgVectors
  221. );
  222. #ifdef UNICODE
  223. #define LPSERVICE_MAIN_FUNCTION LPSERVICE_MAIN_FUNCTIONW
  224. #else
  225. #define LPSERVICE_MAIN_FUNCTION LPSERVICE_MAIN_FUNCTIONA
  226. #endif //UNICODE
  227. //
  228. // Service Start Table
  229. //
  230. typedef struct _SERVICE_TABLE_ENTRYA {
  231. LPSTR lpServiceName;
  232. LPSERVICE_MAIN_FUNCTIONA lpServiceProc;
  233. }SERVICE_TABLE_ENTRYA, *LPSERVICE_TABLE_ENTRYA;
  234. typedef struct _SERVICE_TABLE_ENTRYW {
  235. LPWSTR lpServiceName;
  236. LPSERVICE_MAIN_FUNCTIONW lpServiceProc;
  237. }SERVICE_TABLE_ENTRYW, *LPSERVICE_TABLE_ENTRYW;
  238. #ifdef UNICODE
  239. typedef SERVICE_TABLE_ENTRYW SERVICE_TABLE_ENTRY;
  240. typedef LPSERVICE_TABLE_ENTRYW LPSERVICE_TABLE_ENTRY;
  241. #else
  242. typedef SERVICE_TABLE_ENTRYA SERVICE_TABLE_ENTRY;
  243. typedef LPSERVICE_TABLE_ENTRYA LPSERVICE_TABLE_ENTRY;
  244. #endif // UNICODE
  245. //
  246. // Prototype for the Service Control Handler Function
  247. //
  248. typedef VOID (WINAPI *LPHANDLER_FUNCTION)(
  249. DWORD dwControl
  250. );
  251. ///////////////////////////////////////////////////////////////////////////
  252. // API Function Prototypes
  253. ///////////////////////////////////////////////////////////////////////////
  254. WINADVAPI
  255. BOOL
  256. WINAPI
  257. ChangeServiceConfigA(
  258. SC_HANDLE hService,
  259. DWORD dwServiceType,
  260. DWORD dwStartType,
  261. DWORD dwErrorControl,
  262. LPCSTR lpBinaryPathName,
  263. LPCSTR lpLoadOrderGroup,
  264. LPDWORD lpdwTagId,
  265. LPCSTR lpDependencies,
  266. LPCSTR lpServiceStartName,
  267. LPCSTR lpPassword,
  268. LPCSTR lpDisplayName
  269. );
  270. WINADVAPI
  271. BOOL
  272. WINAPI
  273. ChangeServiceConfigW(
  274. SC_HANDLE hService,
  275. DWORD dwServiceType,
  276. DWORD dwStartType,
  277. DWORD dwErrorControl,
  278. LPCWSTR lpBinaryPathName,
  279. LPCWSTR lpLoadOrderGroup,
  280. LPDWORD lpdwTagId,
  281. LPCWSTR lpDependencies,
  282. LPCWSTR lpServiceStartName,
  283. LPCWSTR lpPassword,
  284. LPCWSTR lpDisplayName
  285. );
  286. #ifdef UNICODE
  287. #define ChangeServiceConfig ChangeServiceConfigW
  288. #else
  289. #define ChangeServiceConfig ChangeServiceConfigA
  290. #endif // !UNICODE
  291. WINADVAPI
  292. BOOL
  293. WINAPI
  294. CloseServiceHandle(
  295. SC_HANDLE hSCObject
  296. );
  297. WINADVAPI
  298. BOOL
  299. WINAPI
  300. ControlService(
  301. SC_HANDLE hService,
  302. DWORD dwControl,
  303. LPSERVICE_STATUS lpServiceStatus
  304. );
  305. WINADVAPI
  306. SC_HANDLE
  307. WINAPI
  308. CreateServiceA(
  309. SC_HANDLE hSCManager,
  310. LPCSTR lpServiceName,
  311. LPCSTR lpDisplayName,
  312. DWORD dwDesiredAccess,
  313. DWORD dwServiceType,
  314. DWORD dwStartType,
  315. DWORD dwErrorControl,
  316. LPCSTR lpBinaryPathName,
  317. LPCSTR lpLoadOrderGroup,
  318. LPDWORD lpdwTagId,
  319. LPCSTR lpDependencies,
  320. LPCSTR lpServiceStartName,
  321. LPCSTR lpPassword
  322. );
  323. WINADVAPI
  324. SC_HANDLE
  325. WINAPI
  326. CreateServiceW(
  327. SC_HANDLE hSCManager,
  328. LPCWSTR lpServiceName,
  329. LPCWSTR lpDisplayName,
  330. DWORD dwDesiredAccess,
  331. DWORD dwServiceType,
  332. DWORD dwStartType,
  333. DWORD dwErrorControl,
  334. LPCWSTR lpBinaryPathName,
  335. LPCWSTR lpLoadOrderGroup,
  336. LPDWORD lpdwTagId,
  337. LPCWSTR lpDependencies,
  338. LPCWSTR lpServiceStartName,
  339. LPCWSTR lpPassword
  340. );
  341. #ifdef UNICODE
  342. #define CreateService CreateServiceW
  343. #else
  344. #define CreateService CreateServiceA
  345. #endif // !UNICODE
  346. WINADVAPI
  347. BOOL
  348. WINAPI
  349. DeleteService(
  350. SC_HANDLE hService
  351. );
  352. WINADVAPI
  353. BOOL
  354. WINAPI
  355. EnumDependentServicesA(
  356. SC_HANDLE hService,
  357. DWORD dwServiceState,
  358. LPENUM_SERVICE_STATUSA lpServices,
  359. DWORD cbBufSize,
  360. LPDWORD pcbBytesNeeded,
  361. LPDWORD lpServicesReturned
  362. );
  363. WINADVAPI
  364. BOOL
  365. WINAPI
  366. EnumDependentServicesW(
  367. SC_HANDLE hService,
  368. DWORD dwServiceState,
  369. LPENUM_SERVICE_STATUSW lpServices,
  370. DWORD cbBufSize,
  371. LPDWORD pcbBytesNeeded,
  372. LPDWORD lpServicesReturned
  373. );
  374. #ifdef UNICODE
  375. #define EnumDependentServices EnumDependentServicesW
  376. #else
  377. #define EnumDependentServices EnumDependentServicesA
  378. #endif // !UNICODE
  379. WINADVAPI
  380. BOOL
  381. WINAPI
  382. EnumServicesStatusA(
  383. SC_HANDLE hSCManager,
  384. DWORD dwServiceType,
  385. DWORD dwServiceState,
  386. LPENUM_SERVICE_STATUSA lpServices,
  387. DWORD cbBufSize,
  388. LPDWORD pcbBytesNeeded,
  389. LPDWORD lpServicesReturned,
  390. LPDWORD lpResumeHandle
  391. );
  392. WINADVAPI
  393. BOOL
  394. WINAPI
  395. EnumServicesStatusW(
  396. SC_HANDLE hSCManager,
  397. DWORD dwServiceType,
  398. DWORD dwServiceState,
  399. LPENUM_SERVICE_STATUSW lpServices,
  400. DWORD cbBufSize,
  401. LPDWORD pcbBytesNeeded,
  402. LPDWORD lpServicesReturned,
  403. LPDWORD lpResumeHandle
  404. );
  405. #ifdef UNICODE
  406. #define EnumServicesStatus EnumServicesStatusW
  407. #else
  408. #define EnumServicesStatus EnumServicesStatusA
  409. #endif // !UNICODE
  410. WINADVAPI
  411. BOOL
  412. WINAPI
  413. GetServiceKeyNameA(
  414. SC_HANDLE hSCManager,
  415. LPCSTR lpDisplayName,
  416. LPSTR lpServiceName,
  417. LPDWORD lpcchBuffer
  418. );
  419. WINADVAPI
  420. BOOL
  421. WINAPI
  422. GetServiceKeyNameW(
  423. SC_HANDLE hSCManager,
  424. LPCWSTR lpDisplayName,
  425. LPWSTR lpServiceName,
  426. LPDWORD lpcchBuffer
  427. );
  428. #ifdef UNICODE
  429. #define GetServiceKeyName GetServiceKeyNameW
  430. #else
  431. #define GetServiceKeyName GetServiceKeyNameA
  432. #endif // !UNICODE
  433. WINADVAPI
  434. BOOL
  435. WINAPI
  436. GetServiceDisplayNameA(
  437. SC_HANDLE hSCManager,
  438. LPCSTR lpServiceName,
  439. LPSTR lpDisplayName,
  440. LPDWORD lpcchBuffer
  441. );
  442. WINADVAPI
  443. BOOL
  444. WINAPI
  445. GetServiceDisplayNameW(
  446. SC_HANDLE hSCManager,
  447. LPCWSTR lpServiceName,
  448. LPWSTR lpDisplayName,
  449. LPDWORD lpcchBuffer
  450. );
  451. #ifdef UNICODE
  452. #define GetServiceDisplayName GetServiceDisplayNameW
  453. #else
  454. #define GetServiceDisplayName GetServiceDisplayNameA
  455. #endif // !UNICODE
  456. WINADVAPI
  457. SC_LOCK
  458. WINAPI
  459. LockServiceDatabase(
  460. SC_HANDLE hSCManager
  461. );
  462. WINADVAPI
  463. BOOL
  464. WINAPI
  465. NotifyBootConfigStatus(
  466. BOOL BootAcceptable
  467. );
  468. WINADVAPI
  469. SC_HANDLE
  470. WINAPI
  471. OpenSCManagerA(
  472. LPCSTR lpMachineName,
  473. LPCSTR lpDatabaseName,
  474. DWORD dwDesiredAccess
  475. );
  476. WINADVAPI
  477. SC_HANDLE
  478. WINAPI
  479. OpenSCManagerW(
  480. LPCWSTR lpMachineName,
  481. LPCWSTR lpDatabaseName,
  482. DWORD dwDesiredAccess
  483. );
  484. #ifdef UNICODE
  485. #define OpenSCManager OpenSCManagerW
  486. #else
  487. #define OpenSCManager OpenSCManagerA
  488. #endif // !UNICODE
  489. WINADVAPI
  490. SC_HANDLE
  491. WINAPI
  492. OpenServiceA(
  493. SC_HANDLE hSCManager,
  494. LPCSTR lpServiceName,
  495. DWORD dwDesiredAccess
  496. );
  497. WINADVAPI
  498. SC_HANDLE
  499. WINAPI
  500. OpenServiceW(
  501. SC_HANDLE hSCManager,
  502. LPCWSTR lpServiceName,
  503. DWORD dwDesiredAccess
  504. );
  505. #ifdef UNICODE
  506. #define OpenService OpenServiceW
  507. #else
  508. #define OpenService OpenServiceA
  509. #endif // !UNICODE
  510. WINADVAPI
  511. BOOL
  512. WINAPI
  513. QueryServiceConfigA(
  514. SC_HANDLE hService,
  515. LPQUERY_SERVICE_CONFIGA lpServiceConfig,
  516. DWORD cbBufSize,
  517. LPDWORD pcbBytesNeeded
  518. );
  519. WINADVAPI
  520. BOOL
  521. WINAPI
  522. QueryServiceConfigW(
  523. SC_HANDLE hService,
  524. LPQUERY_SERVICE_CONFIGW lpServiceConfig,
  525. DWORD cbBufSize,
  526. LPDWORD pcbBytesNeeded
  527. );
  528. #ifdef UNICODE
  529. #define QueryServiceConfig QueryServiceConfigW
  530. #else
  531. #define QueryServiceConfig QueryServiceConfigA
  532. #endif // !UNICODE
  533. WINADVAPI
  534. BOOL
  535. WINAPI
  536. QueryServiceLockStatusA(
  537. SC_HANDLE hSCManager,
  538. LPQUERY_SERVICE_LOCK_STATUSA lpLockStatus,
  539. DWORD cbBufSize,
  540. LPDWORD pcbBytesNeeded
  541. );
  542. WINADVAPI
  543. BOOL
  544. WINAPI
  545. QueryServiceLockStatusW(
  546. SC_HANDLE hSCManager,
  547. LPQUERY_SERVICE_LOCK_STATUSW lpLockStatus,
  548. DWORD cbBufSize,
  549. LPDWORD pcbBytesNeeded
  550. );
  551. #ifdef UNICODE
  552. #define QueryServiceLockStatus QueryServiceLockStatusW
  553. #else
  554. #define QueryServiceLockStatus QueryServiceLockStatusA
  555. #endif // !UNICODE
  556. WINADVAPI
  557. BOOL
  558. WINAPI
  559. QueryServiceObjectSecurity(
  560. SC_HANDLE hService,
  561. SECURITY_INFORMATION dwSecurityInformation,
  562. PSECURITY_DESCRIPTOR lpSecurityDescriptor,
  563. DWORD cbBufSize,
  564. LPDWORD pcbBytesNeeded
  565. );
  566. WINADVAPI
  567. BOOL
  568. WINAPI
  569. QueryServiceStatus(
  570. SC_HANDLE hService,
  571. LPSERVICE_STATUS lpServiceStatus
  572. );
  573. WINADVAPI
  574. SERVICE_STATUS_HANDLE
  575. WINAPI
  576. RegisterServiceCtrlHandlerA(
  577. LPCSTR lpServiceName,
  578. LPHANDLER_FUNCTION lpHandlerProc
  579. );
  580. WINADVAPI
  581. SERVICE_STATUS_HANDLE
  582. WINAPI
  583. RegisterServiceCtrlHandlerW(
  584. LPCWSTR lpServiceName,
  585. LPHANDLER_FUNCTION lpHandlerProc
  586. );
  587. #ifdef UNICODE
  588. #define RegisterServiceCtrlHandler RegisterServiceCtrlHandlerW
  589. #else
  590. #define RegisterServiceCtrlHandler RegisterServiceCtrlHandlerA
  591. #endif // !UNICODE
  592. WINADVAPI
  593. BOOL
  594. WINAPI
  595. SetServiceObjectSecurity(
  596. SC_HANDLE hService,
  597. SECURITY_INFORMATION dwSecurityInformation,
  598. PSECURITY_DESCRIPTOR lpSecurityDescriptor
  599. );
  600. WINADVAPI
  601. BOOL
  602. WINAPI
  603. SetServiceStatus(
  604. SERVICE_STATUS_HANDLE hServiceStatus,
  605. LPSERVICE_STATUS lpServiceStatus
  606. );
  607. WINADVAPI
  608. BOOL
  609. WINAPI
  610. StartServiceCtrlDispatcherA(
  611. LPSERVICE_TABLE_ENTRYA lpServiceStartTable
  612. );
  613. WINADVAPI
  614. BOOL
  615. WINAPI
  616. StartServiceCtrlDispatcherW(
  617. LPSERVICE_TABLE_ENTRYW lpServiceStartTable
  618. );
  619. #ifdef UNICODE
  620. #define StartServiceCtrlDispatcher StartServiceCtrlDispatcherW
  621. #else
  622. #define StartServiceCtrlDispatcher StartServiceCtrlDispatcherA
  623. #endif // !UNICODE
  624. WINADVAPI
  625. BOOL
  626. WINAPI
  627. StartServiceA(
  628. SC_HANDLE hService,
  629. DWORD dwNumServiceArgs,
  630. LPCSTR *lpServiceArgVectors
  631. );
  632. WINADVAPI
  633. BOOL
  634. WINAPI
  635. StartServiceW(
  636. SC_HANDLE hService,
  637. DWORD dwNumServiceArgs,
  638. LPCWSTR *lpServiceArgVectors
  639. );
  640. #ifdef UNICODE
  641. #define StartService StartServiceW
  642. #else
  643. #define StartService StartServiceA
  644. #endif // !UNICODE
  645. WINADVAPI
  646. BOOL
  647. WINAPI
  648. UnlockServiceDatabase(
  649. SC_LOCK ScLock
  650. );
  651. #ifdef __cplusplus
  652. }
  653. #endif
  654. #endif // _WINSVC_