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.

823 lines
19 KiB

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