- Reverted my last changed, should go to branch!
[reactos.git] / reactos / include / services / scmprot.h
1 /*
2 * Service Control Manager - Protocol Header
3 *
4 * Copyright (C) 2004 Filip Navara
5 *
6 * This software is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License as
8 * published by the Free Software Foundation; either version 2 of the
9 * License, or (at your option) any later version.
10 *
11 * This software is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Library General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this software; see the file COPYING.LIB. If not, write
18 * to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge,
19 * MA 02139, USA.
20 *
21 * $Id: scmprot.h,v 1.1 2004/04/12 17:14:26 navaraf Exp $
22 */
23
24 #ifndef _SCM_H
25 #define _SCM_H
26
27 /*
28 * NOTE:
29 * This protocol isn't compatible with the Windows (R) one. Since
30 * Windows (R) XP (or 2000?) all the communcation goes through RPC.
31 * We don't have RPC implemented yet, so it can't be used yet :(
32 */
33
34 typedef struct
35 {
36 ULONG Length;
37 WCHAR Buffer[256];
38 } SCM_STRING;
39
40 #define INIT_SCM_STRING(x, y) x.Length = wcslen(y) * sizeof(WCHAR), RtlCopyMemory(x.Buffer, y, x.Length + sizeof(UNICODE_NULL))
41
42 /*
43 * Global requests
44 */
45
46 #define SCM_OPENSERVICE 0x14
47 #define SCM_CREATESERVICE 0x20
48
49 typedef struct _SCM_OPENSERVICE_REQUEST
50 {
51 DWORD RequestCode;
52 SCM_STRING ServiceName;
53 DWORD dwDesiredAccess;
54 } SCM_OPENSERVICE_REQUEST, *PSCM_OPENSERVICE_REQUEST;
55
56 typedef struct _SCM_OPENSERVICE_REPLY
57 {
58 DWORD ReplyStatus;
59 WCHAR PipeName[128];
60 } SCM_OPENSERVICE_REPLY, *PSCM_OPENSERVICE_REPLY;
61
62 typedef struct _SCM_CREATESERVICE_REQUEST
63 {
64 DWORD RequestCode;
65 SCM_STRING ServiceName;
66 SCM_STRING DisplayName;
67 DWORD dwDesiredAccess;
68 DWORD dwServiceType;
69 DWORD dwStartType;
70 DWORD dwErrorControl;
71 SCM_STRING BinaryPathName;
72 SCM_STRING LoadOrderGroup;
73 SCM_STRING Dependencies;
74 SCM_STRING ServiceStartName;
75 SCM_STRING Password;
76 } SCM_CREATESERVICE_REQUEST, *PSCM_CREATESERVICE_REQUEST;
77
78 typedef struct _SCM_CREATESERVICE_REPLY
79 {
80 DWORD ReplyStatus;
81 WCHAR PipeName[128];
82 } SCM_CREATESERVICE_REPLY, *PSCM_CREATESERVICE_REPLY;
83
84 typedef union _SCM_REQUEST
85 {
86 DWORD RequestCode;
87 SCM_OPENSERVICE_REQUEST OpenService;
88 SCM_CREATESERVICE_REQUEST CreateService;
89 } SCM_REQUEST, *PSCM_REQUEST;
90
91 typedef union _SCM_REPLY
92 {
93 DWORD ReplyStatus;
94 SCM_OPENSERVICE_REPLY OpenService;
95 SCM_CREATESERVICE_REPLY CreateService;
96 } SCM_REPLY, *PSCM_REPLY;
97
98 /*
99 * Per service requests
100 */
101
102 #define SCM_DELETESERVICE 0x10
103 #define SCM_STARTSERVICE 0x11
104
105 typedef union _SCM_SERVICE_REQUEST
106 {
107 DWORD RequestCode;
108 } SCM_SERVICE_REQUEST, *PSCM_SERVICE_REQUEST;
109
110 typedef union _SCM_SERVICE_REPLY
111 {
112 DWORD ReplyStatus;
113 } SCM_SERVICE_REPLY, *PSCM_SERVICE_REPLY;
114
115 #endif