r20: Add the registry library. Still needs a lot of work,
[abartlet/samba.git/.git] / source4 / rpc_server / winreg / rpc_winreg.c
1 /* 
2    Unix SMB/CIFS implementation.
3
4    endpoint server for the winreg pipe
5
6    Copyright (C) Jelmer Vernooij 2004
7    
8    This program is free software; you can redistribute it and/or modify
9    it under the terms of the GNU General Public License as published by
10    the Free Software Foundation; either version 2 of the License, or
11    (at your option) any later version.
12    
13    This program is distributed in the hope that it will be useful,
14    but WITHOUT ANY WARRANTY; without even the implied warranty of
15    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16    GNU General Public License for more details.
17    
18    You should have received a copy of the GNU General Public License
19    along with this program; if not, write to the Free Software
20    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 */
22
23 #include "includes.h"
24
25 REG_HANDLE *get_registry_handle() {
26         return reg_open("nt4", "/home/aurelia/jelmer/NTUSER.dat", False);
27 }
28
29 /* 
30   winreg_OpenHKCR 
31 */
32 static NTSTATUS winreg_OpenHKCR(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
33                        struct winreg_OpenHKCR *r)
34 {
35         return NT_STATUS_NOT_IMPLEMENTED;
36 }
37
38
39 /* 
40   winreg_OpenHKCU 
41 */
42 static NTSTATUS winreg_OpenHKCU(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
43                        struct winreg_OpenHKCU *r)
44 {
45         REG_KEY *hkcu = reg_open_key(get_registry_handle(), "\\HKEY_CURRENT_USER");
46
47         if(!hkcu) {
48                 r->out.result = WERR_NO_MORE_ITEMS;
49                 return NT_STATUS_OK;
50         }
51
52         r->out.result = WERR_OK;
53         
54         return NT_STATUS_NOT_IMPLEMENTED;
55 }
56
57
58 /* 
59   winreg_OpenHKLM 
60 */
61 static NTSTATUS winreg_OpenHKLM(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
62                        struct winreg_OpenHKLM *r)
63 {
64         return NT_STATUS_NOT_IMPLEMENTED;
65 }
66
67
68 /* 
69   winreg_OpenHKPD 
70 */
71 static NTSTATUS winreg_OpenHKPD(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
72                        struct winreg_OpenHKPD *r)
73 {
74         return NT_STATUS_NOT_IMPLEMENTED;
75 }
76
77
78 /* 
79   winreg_OpenHKU 
80 */
81 static NTSTATUS winreg_OpenHKU(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
82                        struct winreg_OpenHKU *r)
83 {
84         return NT_STATUS_NOT_IMPLEMENTED;
85 }
86
87
88 /* 
89   winreg_CloseKey 
90 */
91 static NTSTATUS winreg_CloseKey(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
92                        struct winreg_CloseKey *r)
93 {
94         return NT_STATUS_NOT_IMPLEMENTED;
95 }
96
97
98 /* 
99   winreg_CreateKey 
100 */
101 static NTSTATUS winreg_CreateKey(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
102                        struct winreg_CreateKey *r)
103 {
104         return NT_STATUS_NOT_IMPLEMENTED;
105 }
106
107
108 /* 
109   winreg_DeleteKey 
110 */
111 static NTSTATUS winreg_DeleteKey(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
112                        struct winreg_DeleteKey *r)
113 {
114         return NT_STATUS_NOT_IMPLEMENTED;
115 }
116
117
118 /* 
119   winreg_DeleteValue 
120 */
121 static NTSTATUS winreg_DeleteValue(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
122                        struct winreg_DeleteValue *r)
123 {
124         return NT_STATUS_NOT_IMPLEMENTED;
125 }
126
127
128 /* 
129   winreg_EnumKey 
130 */
131 static NTSTATUS winreg_EnumKey(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
132                        struct winreg_EnumKey *r)
133 {
134         return NT_STATUS_NOT_IMPLEMENTED;
135 }
136
137
138 /* 
139   winreg_EnumValue 
140 */
141 static NTSTATUS winreg_EnumValue(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
142                        struct winreg_EnumValue *r)
143 {
144         return NT_STATUS_NOT_IMPLEMENTED;
145 }
146
147
148 /* 
149   winreg_FlushKey 
150 */
151 static NTSTATUS winreg_FlushKey(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
152                        struct winreg_FlushKey *r)
153 {
154         return NT_STATUS_NOT_IMPLEMENTED;
155 }
156
157
158 /* 
159   winreg_GetKeySecurity 
160 */
161 static NTSTATUS winreg_GetKeySecurity(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
162                        struct winreg_GetKeySecurity *r)
163 {
164         return NT_STATUS_NOT_IMPLEMENTED;
165 }
166
167
168 /* 
169   winreg_LoadKey 
170 */
171 static NTSTATUS winreg_LoadKey(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
172                        struct winreg_LoadKey *r)
173 {
174         return NT_STATUS_NOT_IMPLEMENTED;
175 }
176
177
178 /* 
179   winreg_NotifyChangeKeyValue 
180 */
181 static NTSTATUS winreg_NotifyChangeKeyValue(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
182                        struct winreg_NotifyChangeKeyValue *r)
183 {
184         return NT_STATUS_NOT_IMPLEMENTED;
185 }
186
187
188 /* 
189   winreg_OpenKey 
190 */
191 static NTSTATUS winreg_OpenKey(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
192                        struct winreg_OpenKey *r)
193 {
194         return NT_STATUS_NOT_IMPLEMENTED;
195 }
196
197
198 /* 
199   winreg_QueryInfoKey 
200 */
201 static NTSTATUS winreg_QueryInfoKey(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
202                        struct winreg_QueryInfoKey *r)
203 {
204         return NT_STATUS_NOT_IMPLEMENTED;
205 }
206
207
208 /* 
209   winreg_QueryValue 
210 */
211 static NTSTATUS winreg_QueryValue(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
212                        struct winreg_QueryValue *r)
213 {
214         return NT_STATUS_NOT_IMPLEMENTED;
215 }
216
217
218 /* 
219   winreg_ReplaceKey 
220 */
221 static NTSTATUS winreg_ReplaceKey(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
222                        struct winreg_ReplaceKey *r)
223 {
224         return NT_STATUS_NOT_IMPLEMENTED;
225 }
226
227
228 /* 
229   winreg_RestoreKey 
230 */
231 static NTSTATUS winreg_RestoreKey(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
232                        struct winreg_RestoreKey *r)
233 {
234         return NT_STATUS_NOT_IMPLEMENTED;
235 }
236
237
238 /* 
239   winreg_SaveKey 
240 */
241 static NTSTATUS winreg_SaveKey(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
242                        struct winreg_SaveKey *r)
243 {
244         return NT_STATUS_NOT_IMPLEMENTED;
245 }
246
247
248 /* 
249   winreg_SetKeySecurity 
250 */
251 static NTSTATUS winreg_SetKeySecurity(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
252                        struct winreg_SetKeySecurity *r)
253 {
254         return NT_STATUS_NOT_IMPLEMENTED;
255 }
256
257
258 /* 
259   winreg_SetValue 
260 */
261 static NTSTATUS winreg_SetValue(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
262                        struct winreg_SetValue *r)
263 {
264         return NT_STATUS_NOT_IMPLEMENTED;
265 }
266
267
268 /* 
269   winreg_UnLoadKey 
270 */
271 static NTSTATUS winreg_UnLoadKey(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
272                        struct winreg_UnLoadKey *r)
273 {
274         return NT_STATUS_NOT_IMPLEMENTED;
275 }
276
277
278 /* 
279   winreg_InitiateSystemShutdown 
280 */
281 static NTSTATUS winreg_InitiateSystemShutdown(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
282                        struct winreg_InitiateSystemShutdown *r)
283 {
284         return NT_STATUS_NOT_IMPLEMENTED;
285 }
286
287
288 /* 
289   winreg_AbortSystemShutdown 
290 */
291 static NTSTATUS winreg_AbortSystemShutdown(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
292                        struct winreg_AbortSystemShutdown *r)
293 {
294         return NT_STATUS_NOT_IMPLEMENTED;
295 }
296
297
298 /* 
299   winreg_GetVersion 
300 */
301 static NTSTATUS winreg_GetVersion(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
302                        struct winreg_GetVersion *r)
303 {
304         return NT_STATUS_NOT_IMPLEMENTED;
305 }
306
307
308 /* 
309   winreg_OpenHKCC 
310 */
311 static NTSTATUS winreg_OpenHKCC(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
312                        struct winreg_OpenHKCC *r)
313 {
314         return NT_STATUS_NOT_IMPLEMENTED;
315 }
316
317
318 /* 
319   winreg_OpenHKDD 
320 */
321 static NTSTATUS winreg_OpenHKDD(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
322                        struct winreg_OpenHKDD *r)
323 {
324         return NT_STATUS_NOT_IMPLEMENTED;
325 }
326
327
328 /* 
329   winreg_QueryMultipleValues 
330 */
331 static NTSTATUS winreg_QueryMultipleValues(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
332                        struct winreg_QueryMultipleValues *r)
333 {
334         return NT_STATUS_NOT_IMPLEMENTED;
335 }
336
337
338 /* 
339   winreg_InitiateSystemShutdownEx 
340 */
341 static NTSTATUS winreg_InitiateSystemShutdownEx(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
342                        struct winreg_InitiateSystemShutdownEx *r)
343 {
344         return NT_STATUS_NOT_IMPLEMENTED;
345 }
346
347
348 /* 
349   winreg_SaveKeyEx 
350 */
351 static NTSTATUS winreg_SaveKeyEx(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
352                        struct winreg_SaveKeyEx *r)
353 {
354         return NT_STATUS_NOT_IMPLEMENTED;
355 }
356
357
358 /* 
359   winreg_OpenHKPT 
360 */
361 static NTSTATUS winreg_OpenHKPT(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
362                        struct winreg_OpenHKPT *r)
363 {
364         return NT_STATUS_NOT_IMPLEMENTED;
365 }
366
367
368 /* 
369   winreg_OpenHKPN 
370 */
371 static NTSTATUS winreg_OpenHKPN(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
372                        struct winreg_OpenHKPN *r)
373 {
374         return NT_STATUS_NOT_IMPLEMENTED;
375 }
376
377
378 /* 
379   winreg_QueryMultipleValues2 
380 */
381 static NTSTATUS winreg_QueryMultipleValues2(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
382                        struct winreg_QueryMultipleValues2 *r)
383 {
384         return NT_STATUS_NOT_IMPLEMENTED;
385 }
386
387
388 /* include the generated boilerplate */
389 #include "librpc/gen_ndr/ndr_winreg_s.c"