1/*
2  winreg interface definition
3*/
4
5import "lsa.idl", "initshutdown.idl", "security.idl";
6
7[
8  uuid("338cd001-2244-31f1-aaaa-900038001003"),
9  version(1.0),
10  endpoint("ncacn_np:[\\pipe\\winreg]","ncacn_ip_tcp:","ncalrpc:"),
11  pointer_default(unique),
12  pointer_default_top(unique),
13  helpstring("Remote Registry Service")
14] interface winreg
15{
16	declare bitmap security_secinfo;
17
18	typedef [bitmap32bit] bitmap {
19	} winreg_AccessMask;
20
21	typedef [v1_enum] enum {
22		REG_NONE                       = 0,
23		REG_SZ                         = 1,
24		REG_EXPAND_SZ                  = 2,
25		REG_BINARY                     = 3,
26		REG_DWORD                      = 4,
27		REG_DWORD_BIG_ENDIAN           = 5,
28		REG_LINK                       = 6,
29		REG_MULTI_SZ                   = 7,
30		REG_RESOURCE_LIST              = 8,
31		REG_FULL_RESOURCE_DESCRIPTOR   = 9,
32		REG_RESOURCE_REQUIREMENTS_LIST = 10,
33		REG_QWORD                      = 11
34	} winreg_Type;
35
36	typedef [public,noejs] struct {
37		[value(strlen_m_term(name)*2)] uint16 name_len;
38		[value(strlen_m_term(name)*2)] uint16 name_size;
39		[string,charset(UTF16)] uint16 *name;
40	} winreg_String;
41
42	/******************/
43	/* Function: 0x00 */
44	WERROR winreg_OpenHKCR(
45		[in]      uint16 *system_name,
46		[in]      winreg_AccessMask access_mask,
47		[out,ref] policy_handle *handle
48	);
49
50	/******************/
51	/* Function: 0x01 */
52	WERROR winreg_OpenHKCU(
53	        [in]      uint16 *system_name,
54		[in]      winreg_AccessMask access_mask,
55		[out,ref] policy_handle *handle
56	);
57
58	/******************/
59	/* Function: 0x02 */
60	WERROR winreg_OpenHKLM(
61		[in]      uint16 *system_name,
62		[in]      winreg_AccessMask access_mask,
63		[out,ref] policy_handle *handle
64	);
65
66	/******************/
67	/* Function: 0x03 */
68	WERROR winreg_OpenHKPD(
69		[in]      uint16 *system_name,
70		[in]      winreg_AccessMask access_mask,
71		[out,ref] policy_handle *handle
72	);
73
74	/******************/
75	/* Function: 0x04 */
76	WERROR winreg_OpenHKU(
77		[in]      uint16 *system_name,
78		[in]      winreg_AccessMask access_mask,
79		[out,ref] policy_handle *handle
80	);
81
82	/******************/
83	/* Function: 0x05 */
84	WERROR winreg_CloseKey(
85		[in,out,ref] policy_handle *handle
86	);
87
88	/******************/
89	/* Function: 0x06 */
90
91	typedef struct {
92		[size_is(size),length_is(len)] uint8 *data;
93		uint32 size;
94		uint32 len;
95	} KeySecurityData;
96
97	typedef struct {
98		uint32 length;
99		KeySecurityData sd;
100		boolean8  inherit;
101	} winreg_SecBuf;
102
103	typedef [v1_enum] enum {
104		REG_ACTION_NONE         = 0, /* used by caller */
105		REG_CREATED_NEW_KEY     = 1,
106		REG_OPENED_EXISTING_KEY = 2
107	} winreg_CreateAction;
108
109	WERROR winreg_CreateKey(
110		[in,ref] policy_handle *handle,
111		[in] winreg_String name,
112		[in] winreg_String keyclass,
113		[in] uint32 options,
114		[in] winreg_AccessMask access_mask,
115		[in,unique] winreg_SecBuf *secdesc,
116		[out,ref] policy_handle *new_handle,
117		[in,out,unique] winreg_CreateAction *action_taken
118	);
119
120	/******************/
121	/* Function: 0x07 */
122	WERROR winreg_DeleteKey(
123		[in,ref] policy_handle *handle,
124		[in]	 winreg_String key
125	);
126
127	/******************/
128	/* Function: 0x08 */
129	WERROR winreg_DeleteValue(
130		[in,ref] policy_handle *handle,
131		[in]	 winreg_String value
132	);
133
134	typedef struct {
135		[value(strlen_m_term(name)*2)] uint16 length;
136		/* size cannot be auto-set by value() as it is the
137		   amount of space the server is allowed to use for this
138		   string in the reply, not its current size */
139		uint16 size;
140		[size_is(size/2),length_is(length/2),charset(UTF16)] uint16 *name;
141	} winreg_StringBuf;
142
143	WERROR winreg_EnumKey(
144		[in,ref]        policy_handle    *handle,
145		[in]            uint32           enum_index,
146		[in,out,ref]    winreg_StringBuf *name,
147		[in,out,unique] winreg_StringBuf *keyclass,
148		[in,out,unique] NTTIME           *last_changed_time
149	);
150
151	/******************/
152	/* Function: 0x0a */
153
154	WERROR winreg_EnumValue(
155		[in,ref]        policy_handle *handle,
156		[in]            uint32 enum_index,
157		[in,out,ref]    winreg_StringBuf *name,
158		[in,out,unique] winreg_Type *type,
159		[in,out,unique,size_is(*size),length_is(*length)] uint8 *value,
160		[in,out,unique] uint32 *size,
161		[in,out,unique] uint32 *length
162	);
163
164	/******************/
165	/* Function: 0x0b */
166	WERROR winreg_FlushKey(
167		[in,ref] policy_handle *handle
168	);
169
170	/******************/
171	/* Function: 0x0c */
172	WERROR winreg_GetKeySecurity(
173		[in,ref] policy_handle *handle,
174		[in] security_secinfo sec_info,
175		[in,out,ref] KeySecurityData *sd
176	);
177
178	/******************/
179	/* Function: 0x0d */
180	WERROR winreg_LoadKey(
181		[in,ref] policy_handle *handle,
182		[in] winreg_String *keyname,
183		[in] winreg_String *filename
184	);
185
186	/******************/
187	/* Function: 0x0e */
188	WERROR winreg_NotifyChangeKeyValue(
189		[in,ref] policy_handle *handle,
190		[in] uint8 watch_subtree,
191		[in] uint32 notify_filter,
192		[in] uint32 unknown,
193		[in] winreg_String string1,
194		[in] winreg_String string2,
195		[in] uint32 unknown2
196	);
197
198	/******************/
199	/* Function: 0x0f */
200	WERROR winreg_OpenKey(
201		[in,ref] policy_handle *parent_handle,
202		[in] winreg_String keyname,
203		[in] uint32 unknown,
204		[in] winreg_AccessMask access_mask,
205		[out,ref] policy_handle *handle
206	);
207
208	/******************/
209	/* Function: 0x10 */
210	WERROR winreg_QueryInfoKey(
211		[in,ref] policy_handle *handle,
212		[in] winreg_String class_in,
213		[out,unique] winreg_String *class_out,
214		[out,ref] uint32 *num_subkeys,
215		[out,ref] uint32 *max_subkeylen,
216		[out,ref] uint32 *max_subkeysize,
217		[out,ref] uint32 *num_values,
218		[out,ref] uint32 *max_valnamelen,
219		[out,ref] uint32 *max_valbufsize,
220		[out,ref] uint32 *secdescsize,
221		[out,ref] NTTIME *last_changed_time
222	);
223
224	/******************/
225	/* Function: 0x11 */
226	WERROR winreg_QueryValue(
227		[in,ref] policy_handle *handle,
228		[in] winreg_String value_name,
229		[in,out] winreg_Type *type,
230		[in,out,size_is(*size),length_is(*length)] uint8 *data,
231		[in,out] uint32 *size,
232		[in,out] uint32 *length
233	);
234
235	/******************/
236	/* Function: 0x12 */
237	WERROR winreg_ReplaceKey(
238	);
239
240	/******************/
241	/* Function: 0x13 */
242	WERROR winreg_RestoreKey(
243	);
244
245	/******************/
246	/* Function: 0x14 */
247	WERROR winreg_SaveKey(
248	);
249
250	/******************/
251	/* Function: 0x15 */
252	WERROR winreg_SetKeySecurity(
253		[in,ref] policy_handle *handle,
254		[in] winreg_AccessMask access_mask,
255		[in,out,ref] KeySecurityData *sd
256	);
257
258	/******************/
259	/* Function: 0x16 */
260	WERROR winreg_SetValue(
261		[in,ref]           policy_handle *handle,
262		[in]               winreg_String name,
263		[in]               winreg_Type type,
264		[in,size_is(size),ref] uint8  *data,
265		[in]               uint32 size
266	);
267
268	/******************/
269	/* Function: 0x17 */
270	WERROR winreg_UnLoadKey(
271	);
272
273	/******************/
274	/* Function: 0x18 */
275	WERROR winreg_InitiateSystemShutdown(
276		[in]	uint16 *hostname,
277		[in]	initshutdown_String *message,
278		[in]	uint32 timeout,
279		[in]	uint8 force_apps,
280		[in]	uint8 reboot
281	);
282
283	/******************/
284	/* Function: 0x19 */
285	WERROR winreg_AbortSystemShutdown(
286		[in]	uint16 *server
287	);
288
289	/******************/
290	/* Function: 0x1a */
291	WERROR winreg_GetVersion(
292		[in,ref]     policy_handle *handle,
293		[out,ref]    uint32 *version
294	);
295
296	/******************/
297	/* Function: 0x1b */
298	WERROR winreg_OpenHKCC(
299		[in]      uint16 *system_name,
300		[in]      winreg_AccessMask access_mask,
301		[out,ref] policy_handle *handle
302	);
303
304	/******************/
305	/* Function: 0x1c */
306	WERROR winreg_OpenHKDD(
307		[in]      uint16 *system_name,
308		[in]      winreg_AccessMask access_mask,
309		[out,ref] policy_handle *handle
310	);
311
312	typedef struct {
313		winreg_String *name;
314		winreg_Type type;
315		uint32 offset;
316		uint32 length;
317	} QueryMultipleValue;
318
319	/******************/
320	/* Function: 0x1d */
321	WERROR winreg_QueryMultipleValues(
322		[in,ref] policy_handle *key_handle,
323		[in,out,ref,size_is(num_values),length_is(num_values)] QueryMultipleValue *values,
324		[in] uint32 num_values,
325		[in,out,size_is(*buffer_size),length_is(*buffer_size)] uint8 *buffer,
326		[in,out,ref] uint32 *buffer_size
327	);
328
329	/******************/
330	/* Function: 0x1e */
331	WERROR winreg_InitiateSystemShutdownEx(
332		[in] uint16 *hostname,
333		[in] initshutdown_String *message,
334		[in] uint32 timeout,
335		[in] uint8 force_apps,
336		[in] uint8 reboot,
337		[in] uint32 reason
338	);
339
340	/******************/
341	/* Function: 0x1f */
342	WERROR winreg_SaveKeyEx(
343	);
344
345	/******************/
346	/* Function: 0x20 */
347	WERROR winreg_OpenHKPT(
348		[in]      uint16 *system_name,
349		[in]      winreg_AccessMask access_mask,
350		[out,ref] policy_handle *handle
351	);
352
353	/******************/
354	/* Function: 0x21 */
355	WERROR winreg_OpenHKPN(
356		[in]      uint16 *system_name,
357		[in]      winreg_AccessMask access_mask,
358		[out,ref] policy_handle *handle
359	);
360
361	/******************/
362	/* Function: 0x22 */
363	WERROR winreg_QueryMultipleValues2(
364	);
365}
366