xref: /illumos-gate/usr/src/uts/common/smbsrv/ndl/winreg.ndl (revision bb57d1f5164aca913cbd286ae1b61c896167cfa7)
1/*
2 * CDDL HEADER START
3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
12 *
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 */
21/*
22 * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
23 * Use is subject to license terms.
24 */
25
26#ifndef _MLSVC_WINREG_NDL_
27#define _MLSVC_WINREG_NDL_
28
29#pragma ident	"%Z%%M%	%I%	%E% SMI"
30
31/*
32 * Windows Registry (WINREG) RPC interface definition.
33 */
34
35#include "ndrtypes.ndl"
36
37#define WINREG_OPNUM_OpenHKLM		0x02
38#define WINREG_OPNUM_OpenHKUsers	0x04
39#define WINREG_OPNUM_Close		0x05
40#define WINREG_OPNUM_CreateKey		0x06
41#define WINREG_OPNUM_DeleteKey		0x07
42#define WINREG_OPNUM_DeleteValue	0x08
43#define WINREG_OPNUM_EnumKey		0x09
44#define WINREG_OPNUM_EnumValue		0x0a
45#define WINREG_OPNUM_FlushKey		0x0b
46#define WINREG_OPNUM_GetKeySec		0x0c
47#define WINREG_OPNUM_OpenKey		0x0f
48#define WINREG_OPNUM_QueryKey		0x10
49#define WINREG_OPNUM_QueryValue		0x11
50#define WINREG_OPNUM_SetKeySec		0x15
51#define WINREG_OPNUM_CreateValue	0x16
52#define WINREG_OPNUM_Shutdown		0x18
53#define WINREG_OPNUM_GetVersion		0x1a
54
55
56struct msreg_handle {
57	DWORD hand1;
58	DWORD hand2;
59	WORD  hand3[2];
60	BYTE  hand4[8];
61};
62typedef struct msreg_handle	msreg_handle_t;
63
64struct msreg_string_desc {
65	WORD	length;
66	WORD	allosize;
67	LPTSTR	str;
68};
69typedef struct msreg_string_desc msreg_string_t;
70
71/*
72 * Fake Varying/Conformant with a funny conformant.
73 */
74struct msreg_value {
75	DWORD	vc_first_is;	/* 0 */
76	DWORD	vc_length_is;
77  SIZE_IS(vc_length_is)
78	BYTE	value[ANY_SIZE_ARRAY];
79};
80
81struct file_time {
82	DWORD	low;
83	DWORD	high;
84};
85typedef struct file_time file_time_t;
86
87
88OPERATION(WINREG_OPNUM_OpenHKLM)
89struct msreg_OpenHKLM {
90	IN  BYTE		whatever[8];
91	IN  DWORD		access_mask;
92	OUT msreg_handle_t	handle;
93	OUT DWORD		status;
94};
95
96
97OPERATION(WINREG_OPNUM_OpenHKUsers)
98struct msreg_OpenHKUsers {
99	IN  BYTE		whatever[8];
100	IN  DWORD		access_mask;
101	OUT msreg_handle_t	handle;
102	OUT DWORD		status;
103};
104
105
106OPERATION(WINREG_OPNUM_Close)
107struct msreg_Close {
108	IN  msreg_handle_t	handle;
109	OUT msreg_handle_t	result_handle;
110	OUT DWORD		status;
111};
112
113
114OPERATION(WINREG_OPNUM_CreateKey)
115struct msreg_CreateKey {
116	IN	msreg_handle_t	handle;
117	IN	msreg_string_t	subkey;
118	/* IN	ignore the remaining input data */
119
120	OUT DWORD		status;
121};
122
123
124OPERATION(WINREG_OPNUM_DeleteKey)
125struct msreg_DeleteKey {
126	IN	msreg_handle_t	handle;
127	IN	msreg_string_t	subkey;
128	/* IN	ignore the remaining input data */
129
130	OUT DWORD		status;
131};
132
133
134OPERATION(WINREG_OPNUM_DeleteValue)
135struct msreg_DeleteValue {
136	IN	msreg_handle_t	handle;
137	IN	msreg_string_t	name;
138	/* IN	ignore the remaining input data */
139
140	OUT DWORD		status;
141};
142
143
144/*
145 * Some of the OUT parameters are also supplied
146 * as IN parameters but we can ignore them.
147 */
148OPERATION(WINREG_OPNUM_EnumValue)
149struct msreg_EnumValue {
150	IN	msreg_handle_t	handle;
151	IN	DWORD		index;
152	/* IN	ignore the remaining input data */
153
154	OUT	msreg_string_t	name;
155	OUT DWORD		*type;
156	OUT struct msreg_value *value;
157	OUT DWORD		*value_size;
158	OUT DWORD		*value_size_total;
159	OUT DWORD		status;
160};
161
162
163OPERATION(WINREG_OPNUM_OpenKey)
164struct msreg_OpenKey {
165	IN  msreg_handle_t	handle;
166	IN  msreg_string_t	name;
167	IN  DWORD		unknown;
168	IN  DWORD		access_mask;
169	OUT msreg_handle_t	result_handle;
170	OUT DWORD		status;
171};
172
173
174/*
175 * 000000A0                    00 00 00 00 C1 F9 C0 86 18 B1       ..........
176 * 000000B0  D5 11 99 C8 00 C0 F0 1F 42 26 00 00 10 04 CC ED ........B&......
177 * 000000C0  12 00 08 02 00 00 00 00 00 00 00 00 00 00       ..............
178	DWORD unknown_0x04100000;
179	DWORD unkown_ptr;
180	DWORD unknown_0x00000208;
181	DWORD unknown2;
182	DWORD unknown3;
183 */
184
185OPERATION(WINREG_OPNUM_QueryKey)
186struct msreg_QueryKey {
187	IN  msreg_handle_t	handle;
188	/*
189	 * Ignore the remaining input data
190	 * (2 * DWORD, possibly msreg_string_t).
191	 */
192
193	OUT msreg_string_t	name;
194	OUT DWORD		unknown;
195	OUT DWORD 		sub_keys;
196	OUT DWORD 		max_subkey_len;
197	OUT DWORD 		max_class_len;
198	OUT DWORD 		values;
199	OUT DWORD 		max_value_namelen;
200	OUT DWORD 		max_value_len;
201	OUT DWORD 		security_desc;
202	OUT file_time_t 	last_write_time;
203	OUT DWORD		status;
204};
205
206
207/*
208 * Some of the OUT parameters are also supplied
209 * as IN parameters but we can ignore them.
210 */
211OPERATION(WINREG_OPNUM_QueryValue)
212struct msreg_QueryValue {
213	IN  msreg_handle_t	handle;
214	IN  msreg_string_t	value_name;
215	/* IN	ignore the remaining input data */
216
217	OUT DWORD		*type;
218	OUT struct msreg_value	*value;
219	OUT DWORD		*value_size;
220	OUT DWORD		*value_size_total;
221	OUT DWORD		status;
222};
223
224
225OPERATION(WINREG_OPNUM_CreateValue)
226struct msreg_CreateValue {
227	IN	msreg_handle_t	handle;
228	IN	msreg_string_t	name;
229	/* IN	ignore the remaining input data */
230
231	OUT DWORD		status;
232};
233
234
235/*
236 * The real structure of shutdown passes some strings, a timeout
237 * and reboot/shutdown flags but this allows us to accept the call,
238 * without anything appearing in the log, and return access denied.
239 */
240OPERATION(WINREG_OPNUM_Shutdown)
241struct msreg_Shutdown {
242	IN	DWORD ignored;
243	OUT	DWORD status;
244};
245
246
247OPERATION(WINREG_OPNUM_GetVersion)
248struct msreg_GetVersion {
249	IN	msreg_handle_t handle;
250	OUT	DWORD version;
251	OUT	DWORD status;
252};
253
254
255/*
256 * The WINREG interface.
257 */
258INTERFACE(0)
259union winreg_interface {
260	CASE(WINREG_OPNUM_OpenHKLM)
261		struct msreg_OpenHKLM		OpenHKLM;
262	CASE(WINREG_OPNUM_OpenHKUsers)
263		struct msreg_OpenHKUsers	OpenHKUsers;
264	CASE(WINREG_OPNUM_Close)
265		struct msreg_Close		Close;
266	CASE(WINREG_OPNUM_CreateKey)
267		struct msreg_CreateKey		CreateKey;
268	CASE(WINREG_OPNUM_DeleteKey)
269		struct msreg_DeleteKey		DeleteKey;
270	CASE(WINREG_OPNUM_DeleteValue)
271		struct msreg_DeleteValue	DeleteValue;
272	CASE(WINREG_OPNUM_OpenKey)
273		struct msreg_OpenKey		OpenKey;
274	CASE(WINREG_OPNUM_QueryKey)
275		struct msreg_QueryKey		QueryKey;
276	CASE(WINREG_OPNUM_QueryValue)
277		struct msreg_QueryValue		QueryValue;
278	CASE(WINREG_OPNUM_CreateValue)
279		struct msreg_CreateValue	CreateValue;
280	CASE(WINREG_OPNUM_Shutdown)
281		struct msreg_Shutdown		Shutdown;
282	CASE(WINREG_OPNUM_GetVersion)
283		struct msreg_GetVersion		GetVersion;
284};
285typedef union winreg_interface	winreg_interface_t;
286EXTERNTYPEINFO(winreg_interface)
287
288#endif /* _MLSVC_WINREG_NDL_ */
289