1 | /* $Id: registry.cpp,v 1.5 2000-10-18 17:09:33 sandervl Exp $ */
|
---|
2 |
|
---|
3 | /*
|
---|
4 | * Win32 registry API functions for OS/2
|
---|
5 | *
|
---|
6 | * 1998/06/12
|
---|
7 | *
|
---|
8 | * Copyright 1998 Sander van Leeuwen
|
---|
9 | * Copyright 1998 Patrick Haller
|
---|
10 | *
|
---|
11 | * Project Odin Software License can be found in LICENSE.TXT
|
---|
12 | *
|
---|
13 | */
|
---|
14 |
|
---|
15 |
|
---|
16 | /*****************************************************************************
|
---|
17 | * Includes *
|
---|
18 | *****************************************************************************/
|
---|
19 |
|
---|
20 | #include <odin.h>
|
---|
21 | #include <odinwrap.h>
|
---|
22 | #include <os2sel.h>
|
---|
23 |
|
---|
24 | #include <os2win.h>
|
---|
25 | #include <stdlib.h>
|
---|
26 | #include <stdarg.h>
|
---|
27 | #include <string.h>
|
---|
28 | #include <odinwrap.h>
|
---|
29 | #include <misc.h>
|
---|
30 | #include "unicode.h"
|
---|
31 | #include <winreg.h>
|
---|
32 |
|
---|
33 | #define DBG_LOCALLOG DBG_registry
|
---|
34 | #include "dbglocal.h"
|
---|
35 |
|
---|
36 |
|
---|
37 | ODINDEBUGCHANNEL(ADVAPI32-REGISTRY)
|
---|
38 |
|
---|
39 |
|
---|
40 | /*****************************************************************************
|
---|
41 | * Defines *
|
---|
42 | *****************************************************************************/
|
---|
43 |
|
---|
44 | /* this define enables certain less important debug messages */
|
---|
45 | //#define DEBUG_LOCAL 1
|
---|
46 |
|
---|
47 |
|
---|
48 | /*****************************************************************************
|
---|
49 | * Name : Convert Key
|
---|
50 | * Purpose : convert key handle values between win32 and os/2
|
---|
51 | * Parameters: HKEY winkey - the win32 key handle value
|
---|
52 | * Variables :
|
---|
53 | * Result : the os/2 warp registry key handle value
|
---|
54 | * Remark :
|
---|
55 | * Status : UNTESTED STUB
|
---|
56 | *
|
---|
57 | * Author : Patrick Haller [Tue, 1998/06/16 23:00]
|
---|
58 | *****************************************************************************/
|
---|
59 |
|
---|
60 | static HKEY ConvertKey(HKEY winkey)
|
---|
61 | {
|
---|
62 | switch((int)winkey)
|
---|
63 | {
|
---|
64 | case HKEY_CLASSES_ROOT: return HKEY_CLASSES_ROOT_O32;
|
---|
65 | case HKEY_CURRENT_USER: return HKEY_CURRENT_USER_O32;
|
---|
66 | case HKEY_LOCAL_MACHINE: return HKEY_LOCAL_MACHINE_O32;
|
---|
67 | case HKEY_USERS: return HKEY_USERS_O32;
|
---|
68 | }
|
---|
69 | return(winkey);
|
---|
70 | }
|
---|
71 |
|
---|
72 |
|
---|
73 | /*****************************************************************************
|
---|
74 | * Name :
|
---|
75 | * Purpose :
|
---|
76 | * Parameters:
|
---|
77 | * Variables :
|
---|
78 | * Result :
|
---|
79 | * Remark :
|
---|
80 | * Status : CORRECTED UNTESTED
|
---|
81 | *
|
---|
82 | * Author : Patrick Haller [Tue, 1998/06/16 23:00]
|
---|
83 | *****************************************************************************/
|
---|
84 |
|
---|
85 | ODINFUNCTION1(LONG,RegCloseKey,HKEY,hKey)
|
---|
86 | {
|
---|
87 | return O32_RegCloseKey(ConvertKey(hKey));
|
---|
88 | }
|
---|
89 |
|
---|
90 |
|
---|
91 | /*****************************************************************************
|
---|
92 | * Name :
|
---|
93 | * Purpose :
|
---|
94 | * Parameters:
|
---|
95 | * Variables :
|
---|
96 | * Result :
|
---|
97 | * Remark :
|
---|
98 | * Status : CORRECTED UNTESTED
|
---|
99 | *
|
---|
100 | * Author : Patrick Haller [Tue, 1998/06/16 23:00]
|
---|
101 | *****************************************************************************/
|
---|
102 |
|
---|
103 | ODINFUNCTION3(LONG,RegCreateKeyA,HKEY, hKey,
|
---|
104 | LPCSTR,lpszSubKey,
|
---|
105 | PHKEY, phkResult)
|
---|
106 | {
|
---|
107 | dprintf(("RegCreateKeyA %x %s", hKey, lpszSubKey));
|
---|
108 | return O32_RegCreateKey(ConvertKey(hKey),
|
---|
109 | lpszSubKey,
|
---|
110 | phkResult);
|
---|
111 | }
|
---|
112 |
|
---|
113 |
|
---|
114 | /*****************************************************************************
|
---|
115 | * Name :
|
---|
116 | * Purpose :
|
---|
117 | * Parameters:
|
---|
118 | * Variables :
|
---|
119 | * Result :
|
---|
120 | * Remark :
|
---|
121 | * Status : CORRECTED UNTESTED
|
---|
122 | *
|
---|
123 | * Author : Patrick Haller [Tue, 1998/06/16 23:00]
|
---|
124 | *****************************************************************************/
|
---|
125 |
|
---|
126 | ODINFUNCTION3(LONG,RegCreateKeyW,HKEY, hKey,
|
---|
127 | LPCWSTR,lpszSubKey,
|
---|
128 | PHKEY, phkResult)
|
---|
129 | {
|
---|
130 | char *astring = UnicodeToAsciiString((LPWSTR)lpszSubKey);
|
---|
131 | LONG rc;
|
---|
132 |
|
---|
133 | dprintf(("RegCreateKeyW %x %s", hKey, astring));
|
---|
134 | rc = O32_RegCreateKey(ConvertKey(hKey),
|
---|
135 | astring,
|
---|
136 | phkResult);
|
---|
137 |
|
---|
138 | FreeAsciiString(astring);
|
---|
139 | return(rc);
|
---|
140 | }
|
---|
141 |
|
---|
142 |
|
---|
143 | /*****************************************************************************
|
---|
144 | * Name :
|
---|
145 | * Purpose :
|
---|
146 | * Parameters:
|
---|
147 | * Variables :
|
---|
148 | * Result :
|
---|
149 | * Remark :
|
---|
150 | * Status : CORRECTED UNTESTED
|
---|
151 | *
|
---|
152 | * Author : Patrick Haller [Tue, 1998/06/16 23:00]
|
---|
153 | *****************************************************************************/
|
---|
154 |
|
---|
155 | ODINFUNCTION9(LONG,RegCreateKeyExA,HKEY, hKey,
|
---|
156 | LPCSTR, lpszSubKey,
|
---|
157 | DWORD, dwReserved,
|
---|
158 | LPSTR, lpszClass,
|
---|
159 | DWORD, fdwOptions,
|
---|
160 | REGSAM, samDesired,
|
---|
161 | LPSECURITY_ATTRIBUTES,lpSecurityAttributes,
|
---|
162 | PHKEY, phkResult,
|
---|
163 | LPDWORD, lpdwDisposition)
|
---|
164 | {
|
---|
165 | dprintf(("RegCreateKeyExA %x %s", hKey, lpszSubKey));
|
---|
166 |
|
---|
167 | return O32_RegCreateKeyEx(ConvertKey(hKey),
|
---|
168 | lpszSubKey,
|
---|
169 | dwReserved,
|
---|
170 | lpszClass,
|
---|
171 | fdwOptions,
|
---|
172 | samDesired, // | KEY_READ
|
---|
173 | lpSecurityAttributes,
|
---|
174 | phkResult,
|
---|
175 | lpdwDisposition);
|
---|
176 | }
|
---|
177 |
|
---|
178 |
|
---|
179 | /*****************************************************************************
|
---|
180 | * Name :
|
---|
181 | * Purpose :
|
---|
182 | * Parameters:
|
---|
183 | * Variables :
|
---|
184 | * Result :
|
---|
185 | * Remark :
|
---|
186 | * Status : CORRECTED UNTESTED
|
---|
187 | *
|
---|
188 | * Author : Patrick Haller [Tue, 1998/06/16 23:00]
|
---|
189 | *****************************************************************************/
|
---|
190 |
|
---|
191 | ODINFUNCTION9(LONG,RegCreateKeyExW,HKEY, hKey,
|
---|
192 | LPCWSTR, lpszSubKey,
|
---|
193 | DWORD, dwReserved,
|
---|
194 | LPWSTR, lpszClass,
|
---|
195 | DWORD, fdwOptions,
|
---|
196 | REGSAM, samDesired,
|
---|
197 | LPSECURITY_ATTRIBUTES,lpSecurityAttributes,
|
---|
198 | PHKEY, phkResult,
|
---|
199 | LPDWORD, lpdwDisposition)
|
---|
200 | {
|
---|
201 | char *astring1 = UnicodeToAsciiString((LPWSTR)lpszSubKey);
|
---|
202 | char *astring2 = UnicodeToAsciiString(lpszClass);
|
---|
203 | LONG rc;
|
---|
204 |
|
---|
205 | dprintf(("RegCreateKeyExW %x %s", hKey, astring1));
|
---|
206 |
|
---|
207 | rc = O32_RegCreateKeyEx(ConvertKey(hKey),
|
---|
208 | astring1,
|
---|
209 | dwReserved,
|
---|
210 | astring2,
|
---|
211 | fdwOptions,
|
---|
212 | samDesired, // | KEY_READ
|
---|
213 | lpSecurityAttributes,
|
---|
214 | phkResult,
|
---|
215 | lpdwDisposition);
|
---|
216 |
|
---|
217 | FreeAsciiString(astring1);
|
---|
218 | FreeAsciiString(astring2);
|
---|
219 | return(rc);
|
---|
220 | }
|
---|
221 |
|
---|
222 |
|
---|
223 | /*****************************************************************************
|
---|
224 | * Name :
|
---|
225 | * Purpose :
|
---|
226 | * Parameters:
|
---|
227 | * Variables :
|
---|
228 | * Result :
|
---|
229 | * Remark :
|
---|
230 | * Status : CORRECTED UNTESTED
|
---|
231 | *
|
---|
232 | * Author : Patrick Haller [Tue, 1998/06/16 23:00]
|
---|
233 | *****************************************************************************/
|
---|
234 |
|
---|
235 | ODINFUNCTION2(LONG,RegDeleteKeyW,HKEY, hKey,
|
---|
236 | LPWSTR,lpszSubKey)
|
---|
237 | {
|
---|
238 | char *astring = UnicodeToAsciiString(lpszSubKey);
|
---|
239 | LONG rc;
|
---|
240 |
|
---|
241 | dprintf(("RegDeleteKeyW %s", astring));
|
---|
242 | rc = O32_RegDeleteKey(ConvertKey(hKey),
|
---|
243 | astring);
|
---|
244 | FreeAsciiString(astring);
|
---|
245 | return(rc);
|
---|
246 | }
|
---|
247 |
|
---|
248 |
|
---|
249 | /*****************************************************************************
|
---|
250 | * Name :
|
---|
251 | * Purpose :
|
---|
252 | * Parameters:
|
---|
253 | * Variables :
|
---|
254 | * Result :
|
---|
255 | * Remark :
|
---|
256 | * Status : CORRECTED UNTESTED
|
---|
257 | *
|
---|
258 | * Author : Patrick Haller [Tue, 1998/06/16 23:00]
|
---|
259 | *****************************************************************************/
|
---|
260 |
|
---|
261 | ODINFUNCTION2(LONG,RegDeleteKeyA,HKEY, hKey,
|
---|
262 | LPCSTR,lpszSubKey)
|
---|
263 | {
|
---|
264 | dprintf(("RegDeleteKeyW %s", lpszSubKey));
|
---|
265 | return O32_RegDeleteKey(ConvertKey(hKey),
|
---|
266 | lpszSubKey);
|
---|
267 | }
|
---|
268 |
|
---|
269 |
|
---|
270 | /*****************************************************************************
|
---|
271 | * Name :
|
---|
272 | * Purpose :
|
---|
273 | * Parameters:
|
---|
274 | * Variables :
|
---|
275 | * Result :
|
---|
276 | * Remark :
|
---|
277 | * Status : CORRECTED UNTESTED
|
---|
278 | *
|
---|
279 | * Author : Patrick Haller [Tue, 1998/06/16 23:00]
|
---|
280 | *****************************************************************************/
|
---|
281 |
|
---|
282 | ODINFUNCTION2(LONG,RegDeleteValueA,HKEY, hKey,
|
---|
283 | LPSTR,lpszValue)
|
---|
284 | {
|
---|
285 | return O32_RegDeleteValue(ConvertKey(hKey),
|
---|
286 | lpszValue);
|
---|
287 | }
|
---|
288 |
|
---|
289 |
|
---|
290 | /*****************************************************************************
|
---|
291 | * Name :
|
---|
292 | * Purpose :
|
---|
293 | * Parameters:
|
---|
294 | * Variables :
|
---|
295 | * Result :
|
---|
296 | * Remark :
|
---|
297 | * Status : CORRECTED UNTESTED
|
---|
298 | *
|
---|
299 | * Author : Patrick Haller [Tue, 1998/06/16 23:00]
|
---|
300 | *****************************************************************************/
|
---|
301 |
|
---|
302 | ODINFUNCTION2(LONG,RegDeleteValueW,HKEY, hKey,
|
---|
303 | LPWSTR,lpszValue)
|
---|
304 | {
|
---|
305 | char *astring = UnicodeToAsciiString(lpszValue);
|
---|
306 | LONG rc;
|
---|
307 |
|
---|
308 | rc = O32_RegDeleteValue(ConvertKey(hKey),
|
---|
309 | astring);
|
---|
310 | FreeAsciiString(astring);
|
---|
311 | return(rc);
|
---|
312 | }
|
---|
313 |
|
---|
314 |
|
---|
315 | /*****************************************************************************
|
---|
316 | * Name :
|
---|
317 | * Purpose :
|
---|
318 | * Parameters:
|
---|
319 | * Variables :
|
---|
320 | * Result :
|
---|
321 | * Remark :
|
---|
322 | * Status : UNTESTED STUB
|
---|
323 | *
|
---|
324 | * Author : Patrick Haller [Tue, 1998/06/16 23:00]
|
---|
325 | *****************************************************************************/
|
---|
326 |
|
---|
327 | ODINFUNCTION4(LONG,RegEnumKeyA,HKEY, hKey,
|
---|
328 | DWORD,iSubKey,
|
---|
329 | LPSTR,lpszName,
|
---|
330 | DWORD,cchName)
|
---|
331 | {
|
---|
332 | return O32_RegEnumKey(ConvertKey(hKey),
|
---|
333 | iSubKey,
|
---|
334 | lpszName,
|
---|
335 | cchName);
|
---|
336 | }
|
---|
337 |
|
---|
338 |
|
---|
339 | /*****************************************************************************
|
---|
340 | * Name :
|
---|
341 | * Purpose :
|
---|
342 | * Parameters:
|
---|
343 | * Variables :
|
---|
344 | * Result :
|
---|
345 | * Remark :
|
---|
346 | * Status : UNTESTED STUB
|
---|
347 | *
|
---|
348 | * Author : Patrick Haller [Tue, 1998/06/16 23:00]
|
---|
349 | *****************************************************************************/
|
---|
350 |
|
---|
351 | ODINFUNCTION4(LONG,RegEnumKeyW,HKEY, hKey,
|
---|
352 | DWORD, iSubKey,
|
---|
353 | LPWSTR,lpszName,
|
---|
354 | DWORD, cchName)
|
---|
355 | {
|
---|
356 | char *astring;
|
---|
357 | LONG rc;
|
---|
358 |
|
---|
359 | rc = O32_RegEnumKey(ConvertKey(hKey),
|
---|
360 | iSubKey,
|
---|
361 | (char *)lpszName,
|
---|
362 | cchName);
|
---|
363 | if(rc == ERROR_SUCCESS)
|
---|
364 | {
|
---|
365 | astring = (char *)malloc(cchName);
|
---|
366 | strcpy(astring, (char *)lpszName);
|
---|
367 | AsciiToUnicode(astring, lpszName);
|
---|
368 | free(astring);
|
---|
369 | }
|
---|
370 | return(rc);
|
---|
371 | }
|
---|
372 |
|
---|
373 |
|
---|
374 | /*****************************************************************************
|
---|
375 | * Name :
|
---|
376 | * Purpose :
|
---|
377 | * Parameters:
|
---|
378 | * Variables :
|
---|
379 | * Result :
|
---|
380 | * Remark :
|
---|
381 | * Status : UNTESTED STUB
|
---|
382 | *
|
---|
383 | * Author : Patrick Haller [Tue, 1998/06/16 23:00]
|
---|
384 | *****************************************************************************/
|
---|
385 |
|
---|
386 | ODINFUNCTION8(LONG,RegEnumKeyExA,HKEY, arg1,
|
---|
387 | DWORD, arg2,
|
---|
388 | LPSTR, arg3,
|
---|
389 | LPDWORD, arg4,
|
---|
390 | LPDWORD, arg5,
|
---|
391 | LPSTR, arg6,
|
---|
392 | LPDWORD, arg7,
|
---|
393 | LPFILETIME,arg8)
|
---|
394 | {
|
---|
395 | return O32_RegEnumKeyEx(ConvertKey(arg1),
|
---|
396 | arg2,
|
---|
397 | arg3,
|
---|
398 | arg4,
|
---|
399 | arg5,
|
---|
400 | arg6,
|
---|
401 | arg7,
|
---|
402 | arg8);
|
---|
403 | }
|
---|
404 |
|
---|
405 |
|
---|
406 | /*****************************************************************************
|
---|
407 | * Name :
|
---|
408 | * Purpose :
|
---|
409 | * Parameters:
|
---|
410 | * Variables :
|
---|
411 | * Result :
|
---|
412 | * Remark :
|
---|
413 | * Status : UNTESTED STUB
|
---|
414 | *
|
---|
415 | * Author : Patrick Haller [Tue, 1998/06/16 23:00]
|
---|
416 | *****************************************************************************/
|
---|
417 |
|
---|
418 | ODINFUNCTION8(LONG,RegEnumKeyExW,HKEY, arg1,
|
---|
419 | DWORD, arg2,
|
---|
420 | LPWSTR, arg3,
|
---|
421 | LPDWORD, arg4,
|
---|
422 | LPDWORD, arg5,
|
---|
423 | LPWSTR, arg6,
|
---|
424 | LPDWORD, arg7,
|
---|
425 | LPFILETIME,arg8)
|
---|
426 | {
|
---|
427 | char *astring;
|
---|
428 | LONG rc;
|
---|
429 |
|
---|
430 | rc = O32_RegEnumKeyEx(ConvertKey(arg1),
|
---|
431 | arg2,
|
---|
432 | (char *)arg3,
|
---|
433 | arg4,
|
---|
434 | arg5,
|
---|
435 | (char *)arg6,
|
---|
436 | arg7,
|
---|
437 | arg8);
|
---|
438 | if(rc == ERROR_SUCCESS)
|
---|
439 | {
|
---|
440 | astring = (char *)malloc(max(*arg4, *arg7)); //class & keyname
|
---|
441 | strcpy(astring, (char *)arg3);
|
---|
442 | AsciiToUnicode(astring, arg3);
|
---|
443 | if(arg6 != NULL)
|
---|
444 | {
|
---|
445 | strcpy(astring, (char *)arg6);
|
---|
446 | AsciiToUnicode(astring, arg6);
|
---|
447 | }
|
---|
448 | free(astring);
|
---|
449 | }
|
---|
450 | return(rc);
|
---|
451 | }
|
---|
452 |
|
---|
453 |
|
---|
454 | /*****************************************************************************
|
---|
455 | * Name :
|
---|
456 | * Purpose :
|
---|
457 | * Parameters:
|
---|
458 | * Variables :
|
---|
459 | * Result :
|
---|
460 | * Remark :
|
---|
461 | * Status : UNTESTED STUB
|
---|
462 | *
|
---|
463 | * Author : Patrick Haller [Tue, 1998/06/16 23:00]
|
---|
464 | *****************************************************************************/
|
---|
465 |
|
---|
466 | ODINFUNCTION8(LONG,RegEnumValueA,HKEY, arg1,
|
---|
467 | DWORD, arg2,
|
---|
468 | LPSTR, arg3,
|
---|
469 | LPDWORD,arg4,
|
---|
470 | LPDWORD,arg5,
|
---|
471 | LPDWORD,arg6,
|
---|
472 | LPBYTE, arg7,
|
---|
473 | LPDWORD,arg8)
|
---|
474 | {
|
---|
475 | return O32_RegEnumValue(ConvertKey(arg1),
|
---|
476 | arg2,
|
---|
477 | arg3,
|
---|
478 | arg4,
|
---|
479 | arg5,
|
---|
480 | arg6,
|
---|
481 | arg7,
|
---|
482 | arg8);
|
---|
483 | }
|
---|
484 |
|
---|
485 |
|
---|
486 | /*****************************************************************************
|
---|
487 | * Name :
|
---|
488 | * Purpose :
|
---|
489 | * Parameters:
|
---|
490 | * Variables :
|
---|
491 | * Result :
|
---|
492 | * Remark :
|
---|
493 | * Status : UNTESTED STUB
|
---|
494 | *
|
---|
495 | * Author : Patrick Haller [Tue, 1998/06/16 23:00]
|
---|
496 | *****************************************************************************/
|
---|
497 |
|
---|
498 | ODINFUNCTION8(LONG,RegEnumValueW,HKEY, arg1,
|
---|
499 | DWORD, arg2,
|
---|
500 | LPWSTR, arg3,
|
---|
501 | LPDWORD,arg4,
|
---|
502 | LPDWORD,arg5,
|
---|
503 | LPDWORD,arg6,
|
---|
504 | LPBYTE, arg7,
|
---|
505 | LPDWORD,arg8)
|
---|
506 | {
|
---|
507 | char *astring;
|
---|
508 | LONG rc;
|
---|
509 |
|
---|
510 | rc = O32_RegEnumValue(ConvertKey(arg1),
|
---|
511 | arg2,
|
---|
512 | (char *)arg3,
|
---|
513 | arg4,
|
---|
514 | arg5,
|
---|
515 | arg6,
|
---|
516 | arg7,
|
---|
517 | arg8);
|
---|
518 | if(rc == ERROR_SUCCESS)
|
---|
519 | {
|
---|
520 | astring = (char *)malloc(*arg4);
|
---|
521 | strcpy(astring, (char *)arg3);
|
---|
522 | AsciiToUnicode(astring, arg3);
|
---|
523 | free(astring);
|
---|
524 | }
|
---|
525 | return(rc);
|
---|
526 | }
|
---|
527 |
|
---|
528 |
|
---|
529 | /*****************************************************************************
|
---|
530 | * Name :
|
---|
531 | * Purpose :
|
---|
532 | * Parameters:
|
---|
533 | * Variables :
|
---|
534 | * Result :
|
---|
535 | * Remark :
|
---|
536 | * Status : UNTESTED STUB
|
---|
537 | *
|
---|
538 | * Author : Patrick Haller [Tue, 1998/06/16 23:00]
|
---|
539 | *****************************************************************************/
|
---|
540 |
|
---|
541 | ODINFUNCTION3(LONG,RegOpenKeyA,HKEY, arg1,
|
---|
542 | LPCSTR,arg2,
|
---|
543 | PHKEY, arg3)
|
---|
544 | {
|
---|
545 | LONG rc;
|
---|
546 |
|
---|
547 | dprintf(("RegOpenKey %s", arg2));
|
---|
548 |
|
---|
549 | rc = O32_RegOpenKey(ConvertKey(arg1),
|
---|
550 | arg2,
|
---|
551 | arg3);
|
---|
552 | if(rc)
|
---|
553 | *arg3 = 0;
|
---|
554 |
|
---|
555 | return(rc);
|
---|
556 | }
|
---|
557 |
|
---|
558 |
|
---|
559 | /*****************************************************************************
|
---|
560 | * Name :
|
---|
561 | * Purpose :
|
---|
562 | * Parameters:
|
---|
563 | * Variables :
|
---|
564 | * Result :
|
---|
565 | * Remark :
|
---|
566 | * Status : UNTESTED STUB
|
---|
567 | *
|
---|
568 | * Author : Patrick Haller [Tue, 1998/06/16 23:00]
|
---|
569 | *****************************************************************************/
|
---|
570 |
|
---|
571 | ODINFUNCTION3(LONG,RegOpenKeyW,HKEY, arg1,
|
---|
572 | LPCWSTR,arg2,
|
---|
573 | PHKEY, arg3)
|
---|
574 | {
|
---|
575 | char *astring = UnicodeToAsciiString((LPWSTR)arg2);
|
---|
576 | LONG rc;
|
---|
577 |
|
---|
578 | rc = O32_RegOpenKey(ConvertKey(arg1),
|
---|
579 | astring,
|
---|
580 | arg3);
|
---|
581 | if(rc)
|
---|
582 | *arg3 = 0;
|
---|
583 |
|
---|
584 | FreeAsciiString(astring);
|
---|
585 | return(rc);
|
---|
586 | }
|
---|
587 |
|
---|
588 |
|
---|
589 | /*****************************************************************************
|
---|
590 | * Name :
|
---|
591 | * Purpose :
|
---|
592 | * Parameters:
|
---|
593 | * Variables :
|
---|
594 | * Result :
|
---|
595 | * Remark :
|
---|
596 | * Status : UNTESTED STUB
|
---|
597 | *
|
---|
598 | * Author : Patrick Haller [Tue, 1998/06/16 23:00]
|
---|
599 | *****************************************************************************/
|
---|
600 |
|
---|
601 | ODINFUNCTION5(LONG,RegOpenKeyExA,HKEY, arg1,
|
---|
602 | LPCSTR,arg2,
|
---|
603 | DWORD, arg3,
|
---|
604 | REGSAM,arg4,
|
---|
605 | PHKEY, arg5)
|
---|
606 | {
|
---|
607 | LONG rc;
|
---|
608 |
|
---|
609 | dprintf(("RegOpenKeyEx %s", arg2));
|
---|
610 | rc = O32_RegOpenKeyEx(ConvertKey(arg1),
|
---|
611 | arg2,
|
---|
612 | arg3,
|
---|
613 | arg4,
|
---|
614 | arg5);
|
---|
615 |
|
---|
616 | //SvL: This fixes crashes in pmwinx.dll. (if an app doesn't check the
|
---|
617 | // return value and uses the whatever *arg5 contains)
|
---|
618 | if(rc)
|
---|
619 | *arg5 = 0;
|
---|
620 |
|
---|
621 | return(rc);
|
---|
622 | }
|
---|
623 |
|
---|
624 |
|
---|
625 | /*****************************************************************************
|
---|
626 | * Name :
|
---|
627 | * Purpose :
|
---|
628 | * Parameters:
|
---|
629 | * Variables :
|
---|
630 | * Result :
|
---|
631 | * Remark :
|
---|
632 | * Status : UNTESTED STUB
|
---|
633 | *
|
---|
634 | * Author : Patrick Haller [Tue, 1998/06/16 23:00]
|
---|
635 | *****************************************************************************/
|
---|
636 |
|
---|
637 | ODINFUNCTION5(LONG,RegOpenKeyExW,HKEY, arg1,
|
---|
638 | LPCWSTR,arg2,
|
---|
639 | DWORD, arg3,
|
---|
640 | REGSAM, arg4,
|
---|
641 | PHKEY, arg5)
|
---|
642 | {
|
---|
643 | char *astring = UnicodeToAsciiString((LPWSTR)arg2);
|
---|
644 | LONG rc;
|
---|
645 |
|
---|
646 | rc = CALL_ODINFUNC(RegOpenKeyExA)(ConvertKey(arg1),
|
---|
647 | astring,
|
---|
648 | arg3,
|
---|
649 | arg4,
|
---|
650 | arg5);
|
---|
651 | //SvL: This fixes crashes in pmwinx.dll. (if an app doesn't check the
|
---|
652 | // return value and uses the whatever *arg5 contains)
|
---|
653 | if(rc)
|
---|
654 | *arg5 = 0;
|
---|
655 |
|
---|
656 | FreeAsciiString(astring);
|
---|
657 | return(rc);
|
---|
658 | }
|
---|
659 |
|
---|
660 |
|
---|
661 | /*****************************************************************************
|
---|
662 | * Name :
|
---|
663 | * Purpose :
|
---|
664 | * Parameters:
|
---|
665 | * Variables :
|
---|
666 | * Result :
|
---|
667 | * Remark :
|
---|
668 | * Status : UNTESTED STUB
|
---|
669 | *
|
---|
670 | * Author : Patrick Haller [Tue, 1998/06/16 23:00]
|
---|
671 | *****************************************************************************/
|
---|
672 |
|
---|
673 | ODINFUNCTION12(LONG,RegQueryInfoKeyA,HKEY, arg1,
|
---|
674 | LPSTR, arg2,
|
---|
675 | LPDWORD, arg3,
|
---|
676 | LPDWORD, arg4,
|
---|
677 | LPDWORD, arg5,
|
---|
678 | LPDWORD, arg6,
|
---|
679 | LPDWORD, arg7,
|
---|
680 | LPDWORD, arg8,
|
---|
681 | LPDWORD, arg9,
|
---|
682 | LPDWORD, arg10,
|
---|
683 | LPDWORD, arg11,
|
---|
684 | LPFILETIME, arg12)
|
---|
685 | {
|
---|
686 | return O32_RegQueryInfoKey(ConvertKey(arg1),
|
---|
687 | arg2,
|
---|
688 | arg3,
|
---|
689 | arg4,
|
---|
690 | arg5,
|
---|
691 | arg6,
|
---|
692 | arg7,
|
---|
693 | arg8,
|
---|
694 | arg9,
|
---|
695 | arg10,
|
---|
696 | arg11,
|
---|
697 | arg12);
|
---|
698 | }
|
---|
699 |
|
---|
700 |
|
---|
701 | /*****************************************************************************
|
---|
702 | * Name :
|
---|
703 | * Purpose :
|
---|
704 | * Parameters:
|
---|
705 | * Variables :
|
---|
706 | * Result :
|
---|
707 | * Remark :
|
---|
708 | * Status : UNTESTED STUB
|
---|
709 | *
|
---|
710 | * Author : Patrick Haller [Tue, 1998/06/16 23:00]
|
---|
711 | *****************************************************************************/
|
---|
712 |
|
---|
713 | ODINFUNCTION12(LONG,RegQueryInfoKeyW,HKEY, arg1,
|
---|
714 | LPWSTR, arg2,
|
---|
715 | LPDWORD, arg3,
|
---|
716 | LPDWORD, arg4,
|
---|
717 | LPDWORD, arg5,
|
---|
718 | LPDWORD, arg6,
|
---|
719 | LPDWORD, arg7,
|
---|
720 | LPDWORD, arg8,
|
---|
721 | LPDWORD, arg9,
|
---|
722 | LPDWORD, arg10,
|
---|
723 | LPDWORD, arg11,
|
---|
724 | LPFILETIME, arg12)
|
---|
725 | {
|
---|
726 | char *astring;
|
---|
727 | LONG rc;
|
---|
728 |
|
---|
729 | rc = O32_RegQueryInfoKey(ConvertKey(arg1),
|
---|
730 | (char *)arg2,
|
---|
731 | arg3,
|
---|
732 | arg4,
|
---|
733 | arg5,
|
---|
734 | arg6,
|
---|
735 | arg7,
|
---|
736 | arg8,
|
---|
737 | arg9,
|
---|
738 | arg10,
|
---|
739 | arg11,
|
---|
740 | arg12);
|
---|
741 | if(rc == ERROR_SUCCESS)
|
---|
742 | {
|
---|
743 | if(*arg3) {
|
---|
744 | astring = (char *)malloc(*arg3);
|
---|
745 | strcpy(astring, (char *)arg2);
|
---|
746 | AsciiToUnicode(astring, arg2);
|
---|
747 | free(astring);
|
---|
748 | }
|
---|
749 | else *arg2 = 0;
|
---|
750 | }
|
---|
751 | return(rc);
|
---|
752 | }
|
---|
753 |
|
---|
754 |
|
---|
755 | /*****************************************************************************
|
---|
756 | * Name :
|
---|
757 | * Purpose :
|
---|
758 | * Parameters:
|
---|
759 | * Variables :
|
---|
760 | * Result :
|
---|
761 | * Remark :
|
---|
762 | * Status : UNTESTED STUB
|
---|
763 | *
|
---|
764 | * Author : Patrick Haller [Tue, 1998/06/16 23:00]
|
---|
765 | *****************************************************************************/
|
---|
766 |
|
---|
767 | ODINFUNCTION4(LONG,RegQueryValueA,HKEY, arg1,
|
---|
768 | LPCSTR,arg2,
|
---|
769 | LPSTR, arg3,
|
---|
770 | PLONG, arg4)
|
---|
771 | {
|
---|
772 | dprintf(("ADVAPI32:Registry key=%s\n",
|
---|
773 | arg2));
|
---|
774 | return O32_RegQueryValue(ConvertKey(arg1),
|
---|
775 | arg2,
|
---|
776 | arg3,
|
---|
777 | arg4);
|
---|
778 | }
|
---|
779 |
|
---|
780 |
|
---|
781 | /*****************************************************************************
|
---|
782 | * Name :
|
---|
783 | * Purpose :
|
---|
784 | * Parameters:
|
---|
785 | * Variables :
|
---|
786 | * Result :
|
---|
787 | * Remark :
|
---|
788 | * Status : UNTESTED STUB
|
---|
789 | *
|
---|
790 | * Author : Patrick Haller [Tue, 1998/06/16 23:00]
|
---|
791 | *****************************************************************************/
|
---|
792 |
|
---|
793 | ODINFUNCTION4(LONG,RegQueryValueW,HKEY, hkey,
|
---|
794 | LPCWSTR,lpszSubKey,
|
---|
795 | LPWSTR, lpszValue,
|
---|
796 | PLONG, pcbValue)
|
---|
797 | {
|
---|
798 | char *astring1 = UnicodeToAsciiString((LPWSTR)lpszSubKey);
|
---|
799 | char *astring2;
|
---|
800 | LONG rc;
|
---|
801 |
|
---|
802 | rc = CALL_ODINFUNC(RegQueryValueA)(ConvertKey(hkey),
|
---|
803 | astring1,
|
---|
804 | (char *)lpszValue,
|
---|
805 | pcbValue);
|
---|
806 | if(rc == ERROR_SUCCESS)
|
---|
807 | {
|
---|
808 | if(pcbValue) {
|
---|
809 | astring2 = (char *)malloc(*pcbValue);
|
---|
810 | strcpy(astring2, (char *)lpszValue);
|
---|
811 | AsciiToUnicode(astring2, lpszValue);
|
---|
812 | free(astring2);
|
---|
813 | }
|
---|
814 | }
|
---|
815 | FreeAsciiString(astring1);
|
---|
816 | return(rc);
|
---|
817 | }
|
---|
818 |
|
---|
819 |
|
---|
820 | /*****************************************************************************
|
---|
821 | * Name :
|
---|
822 | * Purpose :
|
---|
823 | * Parameters:
|
---|
824 | * Variables :
|
---|
825 | * Result :
|
---|
826 | * Remark :
|
---|
827 | * Status : UNTESTED STUB
|
---|
828 | *
|
---|
829 | * Author : Patrick Haller [Tue, 1998/06/16 23:00]
|
---|
830 | *****************************************************************************/
|
---|
831 |
|
---|
832 | ODINFUNCTION6(LONG,RegQueryValueExA,HKEY, arg1,
|
---|
833 | LPSTR, arg2,
|
---|
834 | LPDWORD,arg3,
|
---|
835 | LPDWORD,arg4,
|
---|
836 | LPBYTE, arg5,
|
---|
837 | LPDWORD,arg6)
|
---|
838 | {
|
---|
839 | dprintf(("ADVAPI32:Registry key=%s", arg2));
|
---|
840 |
|
---|
841 | return O32_RegQueryValueEx(ConvertKey(arg1),
|
---|
842 | arg2,
|
---|
843 | arg3,
|
---|
844 | arg4,
|
---|
845 | arg5,
|
---|
846 | arg6);
|
---|
847 | }
|
---|
848 |
|
---|
849 |
|
---|
850 | /*****************************************************************************
|
---|
851 | * Name :
|
---|
852 | * Purpose :
|
---|
853 | * Parameters:
|
---|
854 | * Variables :
|
---|
855 | * Result :
|
---|
856 | * Remark : TODO: DOESN'T WORK FOR STRING DATA!!
|
---|
857 | * Status : UNTESTED STUB
|
---|
858 | *
|
---|
859 | * Author : Patrick Haller [Tue, 1998/06/16 23:00]
|
---|
860 | *****************************************************************************/
|
---|
861 |
|
---|
862 | ODINFUNCTION6(LONG,RegQueryValueExW,HKEY, arg1,
|
---|
863 | LPWSTR, arg2,
|
---|
864 | LPDWORD,arg3,
|
---|
865 | LPDWORD,arg4,
|
---|
866 | LPBYTE, arg5,
|
---|
867 | LPDWORD,arg6)
|
---|
868 | {
|
---|
869 | char *astring = UnicodeToAsciiString(arg2);
|
---|
870 | LONG rc;
|
---|
871 |
|
---|
872 | rc = CALL_ODINFUNC(RegQueryValueExA)(ConvertKey(arg1),
|
---|
873 | astring,
|
---|
874 | arg3,
|
---|
875 | arg4,
|
---|
876 | arg5,
|
---|
877 | arg6);
|
---|
878 | FreeAsciiString(astring);
|
---|
879 | return(rc);
|
---|
880 | }
|
---|
881 |
|
---|
882 |
|
---|
883 | /*****************************************************************************
|
---|
884 | * Name :
|
---|
885 | * Purpose :
|
---|
886 | * Parameters:
|
---|
887 | * Variables :
|
---|
888 | * Result :
|
---|
889 | * Remark :
|
---|
890 | * Status : UNTESTED STUB
|
---|
891 | *
|
---|
892 | * Author : Patrick Haller [Tue, 1998/06/16 23:00]
|
---|
893 | *****************************************************************************/
|
---|
894 |
|
---|
895 | ODINFUNCTION5(LONG,RegSetValueA,HKEY, hkey,
|
---|
896 | LPCSTR,lpSubKey,
|
---|
897 | DWORD, dwType,
|
---|
898 | LPCSTR,lpData,
|
---|
899 | DWORD, cbData)
|
---|
900 | {
|
---|
901 | LONG rc;
|
---|
902 |
|
---|
903 | //SvL: 8-11-'97: Bugfix: crash in pmwinx if size == 0 and string is large
|
---|
904 | if(cbData == 0)
|
---|
905 | cbData = strlen(lpData);
|
---|
906 |
|
---|
907 | rc = O32_RegSetValue(ConvertKey(hkey),
|
---|
908 | lpSubKey,
|
---|
909 | dwType,
|
---|
910 | lpData,
|
---|
911 | cbData);
|
---|
912 | if(rc == ERROR_NOT_ENOUGH_MEMORY && cbData == 0 && dwType == REG_SZ)
|
---|
913 | {
|
---|
914 | char regdata = 0;
|
---|
915 | //SvL: Netscape sets an empty string key this way; Open32 doesn't like it
|
---|
916 | rc = O32_RegSetValue(ConvertKey(hkey),
|
---|
917 | lpSubKey,
|
---|
918 | dwType,
|
---|
919 | ®data,
|
---|
920 | 1);
|
---|
921 | }
|
---|
922 | return rc;
|
---|
923 | }
|
---|
924 |
|
---|
925 |
|
---|
926 | /*****************************************************************************
|
---|
927 | * Name :
|
---|
928 | * Purpose :
|
---|
929 | * Parameters:
|
---|
930 | * Variables :
|
---|
931 | * Result :
|
---|
932 | * Remark :
|
---|
933 | * Status : UNTESTED STUB
|
---|
934 | *
|
---|
935 | * Author : Patrick Haller [Tue, 1998/06/16 23:00]
|
---|
936 | *****************************************************************************/
|
---|
937 |
|
---|
938 | ODINFUNCTION5(LONG,RegSetValueW,HKEY, hkey,
|
---|
939 | LPCWSTR,lpSubKey,
|
---|
940 | DWORD, dwType,
|
---|
941 | LPCWSTR,lpData,
|
---|
942 | DWORD, cbData)
|
---|
943 | {
|
---|
944 | char *astring1 = UnicodeToAsciiString((LPWSTR)lpSubKey);
|
---|
945 | char *astring2 = UnicodeToAsciiString((LPWSTR)lpData);
|
---|
946 | LONG rc;
|
---|
947 |
|
---|
948 | //SvL: 8-11-'97: Bugfix: crash in pmwinx if size == 0 and string is large
|
---|
949 | if(cbData == 0)
|
---|
950 | cbData = strlen(astring2);
|
---|
951 |
|
---|
952 | rc = O32_RegSetValue(ConvertKey(hkey),
|
---|
953 | astring1,
|
---|
954 | dwType,
|
---|
955 | astring2,
|
---|
956 | cbData);
|
---|
957 |
|
---|
958 | FreeAsciiString(astring1);
|
---|
959 | FreeAsciiString(astring2);
|
---|
960 | return(rc);
|
---|
961 | }
|
---|
962 |
|
---|
963 |
|
---|
964 | /*****************************************************************************
|
---|
965 | * Name :
|
---|
966 | * Purpose :
|
---|
967 | * Parameters:
|
---|
968 | * Variables :
|
---|
969 | * Result :
|
---|
970 | * Remark : TODO:Check for string length here too?
|
---|
971 | * Status : UNTESTED STUB
|
---|
972 | *
|
---|
973 | * Author : Patrick Haller [Tue, 1998/06/16 23:00]
|
---|
974 | *****************************************************************************/
|
---|
975 |
|
---|
976 | ODINFUNCTION6(LONG,RegSetValueExA,HKEY, arg1,
|
---|
977 | LPSTR, arg2,
|
---|
978 | DWORD, arg3,
|
---|
979 | DWORD, arg4,
|
---|
980 | BYTE*, arg5,
|
---|
981 | DWORD, arg6)
|
---|
982 | {
|
---|
983 | return O32_RegSetValueEx(ConvertKey(arg1),
|
---|
984 | arg2,
|
---|
985 | arg3,
|
---|
986 | arg4,
|
---|
987 | arg5,
|
---|
988 | arg6);
|
---|
989 | }
|
---|
990 |
|
---|
991 |
|
---|
992 | /*****************************************************************************
|
---|
993 | * Name :
|
---|
994 | * Purpose :
|
---|
995 | * Parameters:
|
---|
996 | * Variables :
|
---|
997 | * Result :
|
---|
998 | * Remark : TODO:Check for string length here too?
|
---|
999 | * Status : UNTESTED STUB
|
---|
1000 | *
|
---|
1001 | * Author : Patrick Haller [Tue, 1998/06/16 23:00]
|
---|
1002 | *****************************************************************************/
|
---|
1003 |
|
---|
1004 | ODINFUNCTION6(LONG,RegSetValueExW,HKEY, arg1,
|
---|
1005 | LPWSTR,arg2,
|
---|
1006 | DWORD, arg3,
|
---|
1007 | DWORD, arg4,
|
---|
1008 | BYTE*, arg5,
|
---|
1009 | DWORD, arg6)
|
---|
1010 | {
|
---|
1011 | char *astring = UnicodeToAsciiString(arg2);
|
---|
1012 | LONG rc;
|
---|
1013 |
|
---|
1014 | dprintf(("ADVAPI32: RegSetValueExW(%08xh,%s,%08xh,%08xh,%08xh,%08xh)\n",
|
---|
1015 | arg1,
|
---|
1016 | astring,
|
---|
1017 | arg3,
|
---|
1018 | arg4,
|
---|
1019 | arg5,
|
---|
1020 | arg6));
|
---|
1021 |
|
---|
1022 | rc = O32_RegSetValueEx(ConvertKey(arg1),
|
---|
1023 | astring,
|
---|
1024 | arg3,
|
---|
1025 | arg4,
|
---|
1026 | arg5,
|
---|
1027 | arg6);
|
---|
1028 | FreeAsciiString(astring);
|
---|
1029 | return(rc);
|
---|
1030 | }
|
---|
1031 |
|
---|
1032 |
|
---|
1033 | /*****************************************************************************
|
---|
1034 | * Name :
|
---|
1035 | * Purpose :
|
---|
1036 | * Parameters:
|
---|
1037 | * Variables :
|
---|
1038 | * Result :
|
---|
1039 | * Remark :
|
---|
1040 | * Status : UNTESTED STUB
|
---|
1041 | *
|
---|
1042 | * Author : Patrick Haller [Tue, 1998/06/16 23:00]
|
---|
1043 | *****************************************************************************/
|
---|
1044 |
|
---|
1045 | ODINFUNCTION1(LONG,RegFlushKey,HKEY,hkey)
|
---|
1046 | {
|
---|
1047 | dprintf(("ADVAPI32: RegFlushKey not implemented yet."));
|
---|
1048 |
|
---|
1049 | return(ERROR_SUCCESS);
|
---|
1050 | }
|
---|
1051 |
|
---|
1052 |
|
---|
1053 | /*****************************************************************************
|
---|
1054 | * Name : RegConnectRegistryA
|
---|
1055 | * Purpose : The RegConnectRegistry function establishes a connection to a
|
---|
1056 | * predefined registry handle on another computer.
|
---|
1057 | * Parameters: LPTSTR lpszComputerName address of name of remote computer
|
---|
1058 | * HKEY hKey predefined registry handle
|
---|
1059 | * PHKEY phkResult address of buffer for remote registry handle
|
---|
1060 | * Variables :
|
---|
1061 | * Result :
|
---|
1062 | * Remark :
|
---|
1063 | * Status : UNTESTED STUB
|
---|
1064 | *
|
---|
1065 | * Author : Patrick Haller [Tue, 1998/06/16 23:00]
|
---|
1066 | *****************************************************************************/
|
---|
1067 |
|
---|
1068 | ODINFUNCTION3(LONG,RegConnectRegistryA,LPCSTR,lpszComputerName,
|
---|
1069 | HKEY, hKey,
|
---|
1070 | PHKEY, phkResult)
|
---|
1071 | {
|
---|
1072 | char szLocalName[256];
|
---|
1073 | DWORD dwNameLength = sizeof(szLocalName)-2;
|
---|
1074 |
|
---|
1075 | szLocalName[0] = '\\';
|
---|
1076 | szLocalName[1] = '\\';
|
---|
1077 | GetComputerNameA(szLocalName+2, &dwNameLength);
|
---|
1078 |
|
---|
1079 | dprintf(("ADVAPI32: RegConnectRegistryA(%s,local %s) not implemented yet.\n",
|
---|
1080 | lpszComputerName,
|
---|
1081 | szLocalName));
|
---|
1082 |
|
---|
1083 | /* local registry ? */
|
---|
1084 | if ( ( lpszComputerName == NULL) ||
|
---|
1085 | (strcmp(szLocalName, lpszComputerName) == 0 ) )
|
---|
1086 | {
|
---|
1087 | /* @@@PH experimental !!! */
|
---|
1088 | *phkResult = hKey;
|
---|
1089 |
|
---|
1090 | return (NO_ERROR);
|
---|
1091 | }
|
---|
1092 |
|
---|
1093 | return (ERROR_ACCESS_DENIED);
|
---|
1094 | }
|
---|
1095 |
|
---|
1096 |
|
---|
1097 | /*****************************************************************************
|
---|
1098 | * Name : RegConnectRegistryW
|
---|
1099 | * Purpose : The RegConnectRegistry function establishes a connection to a
|
---|
1100 | * predefined registry handle on another computer.
|
---|
1101 | * Parameters: LPWSTR lpszComputerName address of name of remote computer
|
---|
1102 | * HKEY hKey predefined registry handle
|
---|
1103 | * PHKEY phkResult address of buffer for remote registry handle
|
---|
1104 | * Variables :
|
---|
1105 | * Result :
|
---|
1106 | * Remark :
|
---|
1107 | * Status : UNTESTED STUB
|
---|
1108 | *
|
---|
1109 | * Author : Patrick Haller [Tue, 1998/06/16 23:00]
|
---|
1110 | *****************************************************************************/
|
---|
1111 |
|
---|
1112 | ODINFUNCTION3(LONG,RegConnectRegistryW,LPCWSTR,lpszComputerName,
|
---|
1113 | HKEY, hKey,
|
---|
1114 | PHKEY, phkResult)
|
---|
1115 | {
|
---|
1116 | /* corresponding ascii string */
|
---|
1117 | LPSTR pszAscii;
|
---|
1118 | LONG rc; /* returncode from call to ascii version of this function */
|
---|
1119 |
|
---|
1120 | dprintf(("ADVAPI32: RegConnectRegistryW not implemented yet."));
|
---|
1121 |
|
---|
1122 | if (lpszComputerName != NULL)
|
---|
1123 | pszAscii = UnicodeToAsciiString((LPWSTR)lpszComputerName);
|
---|
1124 | else
|
---|
1125 | pszAscii = NULL;
|
---|
1126 |
|
---|
1127 | rc = RegConnectRegistryA(pszAscii,
|
---|
1128 | hKey,
|
---|
1129 | phkResult);
|
---|
1130 |
|
---|
1131 | if (pszAscii != NULL)
|
---|
1132 | FreeAsciiString(pszAscii);
|
---|
1133 |
|
---|
1134 | return (rc); /* OK */
|
---|
1135 | }
|
---|
1136 |
|
---|
1137 |
|
---|
1138 | /*****************************************************************************
|
---|
1139 | * Name : RegGetKeySecurity
|
---|
1140 | * Purpose : The RegGetKeySecurity function retrieves a copy of the security
|
---|
1141 | * descriptor protecting the specified open registry key.
|
---|
1142 | * Parameters: HKEY hKey open handle of key to set
|
---|
1143 | * SECURITY_INFORMATION SecInf descriptor contents
|
---|
1144 | * PSECURITY_DESCRIPTOR pSecDesc address of descriptor for key
|
---|
1145 | * LPDWORD lpcbSecDesc address of size of buffer and descriptor
|
---|
1146 | * Variables :
|
---|
1147 | * Result :
|
---|
1148 | * Remark :
|
---|
1149 | * Status : UNTESTED STUB
|
---|
1150 | *
|
---|
1151 | * Author : Patrick Haller [Tue, 1998/06/16 23:00]
|
---|
1152 | *****************************************************************************/
|
---|
1153 |
|
---|
1154 | ODINFUNCTION4(LONG,RegGetKeySecurity,HKEY, hKey,
|
---|
1155 | SECURITY_INFORMATION, SecInf,
|
---|
1156 | PSECURITY_DESCRIPTOR, pSecDesc,
|
---|
1157 | LPDWORD, lpcbSecDesc)
|
---|
1158 | {
|
---|
1159 | dprintf(("ADVAPI32: RegGetKeySecurity not implemented.\n"));
|
---|
1160 |
|
---|
1161 | return (ERROR_ACCESS_DENIED); /* signal failure */
|
---|
1162 | }
|
---|
1163 |
|
---|
1164 |
|
---|
1165 | /*****************************************************************************
|
---|
1166 | * Name : RegLoadKeyA
|
---|
1167 | * Purpose : The RegLoadKey function creates a subkey under HKEY_USER or
|
---|
1168 | * HKEY_LOCAL_MACHINE and stores registration information from a
|
---|
1169 | * specified file into that subkey. This registration information
|
---|
1170 | * is in the form of a hive. A hive is a discrete body of keys,
|
---|
1171 | * subkeys, and values that is rooted at the top of the registry
|
---|
1172 | * hierarchy. A hive is backed by a single file and .LOG file.
|
---|
1173 | * Parameters: HKEY hKey handle of open key
|
---|
1174 | * LPCSTR lpszSubKey address of name of subkey
|
---|
1175 | * LPCSTR lpszFile address of filename for registry information
|
---|
1176 | * Variables :
|
---|
1177 | * Result :
|
---|
1178 | * Remark :
|
---|
1179 | * Status : UNTESTED STUB
|
---|
1180 | *
|
---|
1181 | * Author : Patrick Haller [Tue, 1998/06/16 23:00]
|
---|
1182 | *****************************************************************************/
|
---|
1183 |
|
---|
1184 | ODINFUNCTION3(LONG,RegLoadKeyA,HKEY, hKey,
|
---|
1185 | LPCSTR,lpszSubKey,
|
---|
1186 | LPCSTR,lpszFile)
|
---|
1187 | {
|
---|
1188 | dprintf(("ADVAPI32: RegLoadKeyA not implemented.\n"));
|
---|
1189 |
|
---|
1190 | return (ERROR_ACCESS_DENIED); /* signal failure */
|
---|
1191 | }
|
---|
1192 |
|
---|
1193 |
|
---|
1194 | /*****************************************************************************
|
---|
1195 | * Name : RegLoadKeyW
|
---|
1196 | * Purpose : The RegLoadKey function creates a subkey under HKEY_USER or
|
---|
1197 | * HKEY_LOCAL_MACHINE and stores registration information from a
|
---|
1198 | * specified file into that subkey. This registration information
|
---|
1199 | * is in the form of a hive. A hive is a discrete body of keys,
|
---|
1200 | * subkeys, and values that is rooted at the top of the registry
|
---|
1201 | * hierarchy. A hive is backed by a single file and .LOG file.
|
---|
1202 | * Parameters: HKEY hKey handle of open key
|
---|
1203 | * LPCWSTR lpszSubKey address of name of subkey
|
---|
1204 | * LPCWSTR lpszFile address of filename for registry information
|
---|
1205 | * Variables :
|
---|
1206 | * Result :
|
---|
1207 | * Remark :
|
---|
1208 | * Status : UNTESTED STUB
|
---|
1209 | *
|
---|
1210 | * Author : Patrick Haller [Tue, 1998/06/16 23:00]
|
---|
1211 | *****************************************************************************/
|
---|
1212 |
|
---|
1213 | ODINFUNCTION3(LONG,RegLoadKeyW,HKEY, hKey,
|
---|
1214 | LPCWSTR,lpszSubKey,
|
---|
1215 | LPCWSTR,lpszFile)
|
---|
1216 | {
|
---|
1217 | dprintf(("ADVAPI32: RegLoadKeyW not implemented.\n"));
|
---|
1218 |
|
---|
1219 | return (ERROR_ACCESS_DENIED); /* signal failure */
|
---|
1220 | }
|
---|
1221 |
|
---|
1222 |
|
---|
1223 | /*****************************************************************************
|
---|
1224 | * Name : RegQueryMultipleValuesA
|
---|
1225 | * Purpose : The RegQueryMultipleValues function retrieves the type and data
|
---|
1226 | * for a list of value names associated with an open registry key.
|
---|
1227 | * Parameters: HKEY hKey handle of key to query
|
---|
1228 | * PVALENT val_list address of array of value entry structures
|
---|
1229 | * DWORD num_vals size of array of value entry structures
|
---|
1230 | * LPTSTR lpValueBuf address of buffer for value information
|
---|
1231 | * LPDWORD ldwTotsize address of size of value buffer
|
---|
1232 | * Variables :
|
---|
1233 | * Result :
|
---|
1234 | * Remark :
|
---|
1235 | * Status : UNTESTED STUB
|
---|
1236 | *
|
---|
1237 | * Author : Patrick Haller [Tue, 1998/06/16 23:00]
|
---|
1238 | *****************************************************************************/
|
---|
1239 |
|
---|
1240 | ODINFUNCTION5(LONG,RegQueryMultipleValuesA,HKEY, hKey,
|
---|
1241 | PVALENTA,val_list,
|
---|
1242 | DWORD, num_vals,
|
---|
1243 | LPTSTR, lpValueBuf,
|
---|
1244 | LPDWORD, ldwTotsize)
|
---|
1245 | {
|
---|
1246 | dprintf(("ADVAPI32: RegQueryMultipleValuesA not implemented.\n"));
|
---|
1247 |
|
---|
1248 | return (ERROR_ACCESS_DENIED); /* signal failure */
|
---|
1249 | }
|
---|
1250 |
|
---|
1251 |
|
---|
1252 | /*****************************************************************************
|
---|
1253 | * Name : RegQueryMultipleValuesW
|
---|
1254 | * Purpose : The RegQueryMultipleValues function retrieves the type and data
|
---|
1255 | * for a list of value names associated with an open registry key.
|
---|
1256 | * Parameters: HKEY hKey handle of key to query
|
---|
1257 | * PVALENT val_list address of array of value entry structures
|
---|
1258 | * DWORD num_vals size of array of value entry structures
|
---|
1259 | * LPWSTR lpValueBuf address of buffer for value information
|
---|
1260 | * LPDWORD ldwTotsize address of size of value buffer
|
---|
1261 | * Variables :
|
---|
1262 | * Result :
|
---|
1263 | * Remark :
|
---|
1264 | * Status : UNTESTED STUB
|
---|
1265 | *
|
---|
1266 | * Author : Patrick Haller [Tue, 1998/06/16 23:00]
|
---|
1267 | *****************************************************************************/
|
---|
1268 |
|
---|
1269 | ODINFUNCTION5(LONG,RegQueryMultipleValuesW,HKEY, hKey,
|
---|
1270 | PVALENTW,val_list,
|
---|
1271 | DWORD, num_vals,
|
---|
1272 | LPWSTR, lpValueBuf,
|
---|
1273 | LPDWORD, ldwTotsize)
|
---|
1274 | {
|
---|
1275 | dprintf(("ADVAPI32: RegQueryMultipleValuesW not implemented.\n"));
|
---|
1276 |
|
---|
1277 | return (ERROR_ACCESS_DENIED); /* signal failure */
|
---|
1278 | }
|
---|
1279 |
|
---|
1280 |
|
---|
1281 | /*****************************************************************************
|
---|
1282 | * Name : RegRemapPreDefKey
|
---|
1283 | * Purpose :
|
---|
1284 | * Parameters:
|
---|
1285 | * Variables :
|
---|
1286 | * Result :
|
---|
1287 | * Remark :
|
---|
1288 | * Status : UNTESTED STUB
|
---|
1289 | *
|
---|
1290 | * Author : Patrick Haller [Tue, 1998/06/16 23:00]
|
---|
1291 | *****************************************************************************/
|
---|
1292 |
|
---|
1293 | #if 0
|
---|
1294 | ODINFUNCTION1(LONG,RegRemapPreDefKey,HKEY,hKey)
|
---|
1295 | {
|
---|
1296 | dprintf(("ADVAPI32: RegRemapPreDefKey not implemented.\n"));
|
---|
1297 |
|
---|
1298 | return (ERROR_ACCESS_DENIED); /* signal failure */
|
---|
1299 | }
|
---|
1300 | #endif
|
---|
1301 |
|
---|
1302 |
|
---|
1303 | /*****************************************************************************
|
---|
1304 | * Name : RegReplaceKeyA
|
---|
1305 | * Purpose : The RegReplaceKey function replaces the file backing a key and
|
---|
1306 | * all its subkeys with another file, so that when the system is
|
---|
1307 | * next started, the key and subkeys will have the values stored in the new file.
|
---|
1308 | * Parameters: HKEY hKey handle of open key
|
---|
1309 | * LPCSTR lpSubKey address of name of subkey
|
---|
1310 | * LPCSTR lpNewFile address of filename for file with new data
|
---|
1311 | * LPCSTR lpOldFile address of filename for backup file
|
---|
1312 | * Variables :
|
---|
1313 | * Result :
|
---|
1314 | * Remark :
|
---|
1315 | * Status : UNTESTED STUB
|
---|
1316 | *
|
---|
1317 | * Author : Patrick Haller [Tue, 1998/06/16 23:00]
|
---|
1318 | *****************************************************************************/
|
---|
1319 |
|
---|
1320 | ODINFUNCTION4(LONG,RegReplaceKeyA,HKEY, hKey,
|
---|
1321 | LPCSTR,lpSubKey,
|
---|
1322 | LPCSTR,lpNewFile,
|
---|
1323 | LPCSTR,lpOldFile)
|
---|
1324 | {
|
---|
1325 | dprintf(("ADVAPI32: RegReplaceKeyA not implemented.\n"));
|
---|
1326 |
|
---|
1327 | return (ERROR_ACCESS_DENIED); /* signal failure */
|
---|
1328 | }
|
---|
1329 |
|
---|
1330 |
|
---|
1331 | /*****************************************************************************
|
---|
1332 | * Name : RegReplaceKeyW
|
---|
1333 | * Purpose : The RegReplaceKey function replaces the file backing a key and
|
---|
1334 | * all its subkeys with another file, so that when the system is
|
---|
1335 | * next started, the key and subkeys will have the values stored in the new file.
|
---|
1336 | * Parameters: HKEY hKey handle of open key
|
---|
1337 | * LPCWSTR lpSubKey address of name of subkey
|
---|
1338 | * LPCWSTR lpNewFile address of filename for file with new data
|
---|
1339 | * LPCWSTR lpOldFile address of filename for backup file
|
---|
1340 | * Variables :
|
---|
1341 | * Result :
|
---|
1342 | * Remark :
|
---|
1343 | * Status : UNTESTED STUB
|
---|
1344 | *
|
---|
1345 | * Author : Patrick Haller [Tue, 1998/06/16 23:00]
|
---|
1346 | *****************************************************************************/
|
---|
1347 |
|
---|
1348 | ODINFUNCTION4(LONG,RegReplaceKeyW,HKEY, hKey,
|
---|
1349 | LPCWSTR,lpSubKey,
|
---|
1350 | LPCWSTR,lpNewFile,
|
---|
1351 | LPCWSTR,lpOldFile)
|
---|
1352 | {
|
---|
1353 | dprintf(("ADVAPI32: RegReplaceKeyW not implemented.\n"));
|
---|
1354 |
|
---|
1355 | return (ERROR_ACCESS_DENIED); /* signal failure */
|
---|
1356 | }
|
---|
1357 |
|
---|
1358 |
|
---|
1359 | /*****************************************************************************
|
---|
1360 | * Name : RegRestoreKeyA
|
---|
1361 | * Purpose : The RegRestoreKey function reads the registry information in a
|
---|
1362 | * specified file and copies it over the specified key. This
|
---|
1363 | * registry information may be in the form of a key and multiple
|
---|
1364 | * levels of subkeys.
|
---|
1365 | * Parameters: HKEY hKey handle of key where restore begins
|
---|
1366 | * LPCSTR lpszFile address of filename containing saved tree
|
---|
1367 | * DWORD fdw optional flags
|
---|
1368 | * Variables :
|
---|
1369 | * Result :
|
---|
1370 | * Remark :
|
---|
1371 | * Status : UNTESTED STUB
|
---|
1372 | *
|
---|
1373 | * Author : Patrick Haller [Tue, 1998/06/16 23:00]
|
---|
1374 | *****************************************************************************/
|
---|
1375 |
|
---|
1376 | ODINFUNCTION3(LONG,RegRestoreKeyA,HKEY, hKey,
|
---|
1377 | LPCSTR,lpszFile,
|
---|
1378 | DWORD, fdw)
|
---|
1379 | {
|
---|
1380 | dprintf(("ADVAPI32: RegRestoreKeyA not implemented.\n"));
|
---|
1381 |
|
---|
1382 | return (ERROR_ACCESS_DENIED); /* signal failure */
|
---|
1383 | }
|
---|
1384 |
|
---|
1385 |
|
---|
1386 | /*****************************************************************************
|
---|
1387 | * Name : RegRestoreKeyW
|
---|
1388 | * Purpose : The RegRestoreKey function reads the registry information in a
|
---|
1389 | * specified file and copies it over the specified key. This
|
---|
1390 | * registry information may be in the form of a key and multiple
|
---|
1391 | * levels of subkeys.
|
---|
1392 | * Parameters: HKEY hKey handle of key where restore begins
|
---|
1393 | * LPCWSTR lpszFile address of filename containing saved tree
|
---|
1394 | * DWORD fdw optional flags
|
---|
1395 | * Variables :
|
---|
1396 | * Result :
|
---|
1397 | * Remark :
|
---|
1398 | * Status : UNTESTED STUB
|
---|
1399 | *
|
---|
1400 | * Author : Patrick Haller [Tue, 1998/06/16 23:00]
|
---|
1401 | *****************************************************************************/
|
---|
1402 |
|
---|
1403 | ODINFUNCTION3(LONG,RegRestoreKeyW,HKEY, hKey,
|
---|
1404 | LPCWSTR, lpszFile,
|
---|
1405 | DWORD, fdw)
|
---|
1406 | {
|
---|
1407 | dprintf(("ADVAPI32: RegRestoreKeyW not implemented.\n"));
|
---|
1408 |
|
---|
1409 | return (ERROR_ACCESS_DENIED); /* signal failure */
|
---|
1410 | }
|
---|
1411 |
|
---|
1412 |
|
---|
1413 | /*****************************************************************************
|
---|
1414 | * Name : RegSaveKeyA
|
---|
1415 | * Purpose : The RegSaveKey function saves the specified key and all of its
|
---|
1416 | * subkeys and values to a new file.
|
---|
1417 | * Parameters: HKEY hKey handle of key where save begins
|
---|
1418 | * LPCSTR lpszFile address of filename to save to
|
---|
1419 | * LPSECURITY_ATTRIBUTES lpsa address of security structure
|
---|
1420 | * Variables :
|
---|
1421 | * Result :
|
---|
1422 | * Remark :
|
---|
1423 | * Status : UNTESTED STUB
|
---|
1424 | *
|
---|
1425 | * Author : Patrick Haller [Tue, 1998/06/16 23:00]
|
---|
1426 | *****************************************************************************/
|
---|
1427 |
|
---|
1428 | ODINFUNCTION3(LONG,RegSaveKeyA,HKEY, hKey,
|
---|
1429 | LPCSTR, lpszFile,
|
---|
1430 | LPSECURITY_ATTRIBUTES,lpsa)
|
---|
1431 | {
|
---|
1432 | dprintf(("ADVAPI32: RegSaveKeyA not implemented.\n"));
|
---|
1433 |
|
---|
1434 | return (ERROR_ACCESS_DENIED); /* signal failure */
|
---|
1435 | }
|
---|
1436 |
|
---|
1437 |
|
---|
1438 | /*****************************************************************************
|
---|
1439 | * Name : RegSaveKeyW
|
---|
1440 | * Purpose : The RegSaveKey function saves the specified key and all of its
|
---|
1441 | * subkeys and values to a new file.
|
---|
1442 | * Parameters: HKEY hKey handle of key where save begins
|
---|
1443 | * LPCWSTR lpszFile address of filename to save to
|
---|
1444 | * LPSECURITY_ATTRIBUTES lpsa address of security structure
|
---|
1445 | * Variables :
|
---|
1446 | * Result :
|
---|
1447 | * Remark :
|
---|
1448 | * Status : UNTESTED STUB
|
---|
1449 | *
|
---|
1450 | * Author : Patrick Haller [Tue, 1998/06/16 23:00]
|
---|
1451 | *****************************************************************************/
|
---|
1452 |
|
---|
1453 | ODINFUNCTION3(LONG,RegSaveKeyW,HKEY, hKey,
|
---|
1454 | LPCWSTR, lpszFile,
|
---|
1455 | LPSECURITY_ATTRIBUTES,lpsa)
|
---|
1456 | {
|
---|
1457 | dprintf(("ADVAPI32: RegSaveKeyW not implemented.\n"));
|
---|
1458 |
|
---|
1459 | return (ERROR_ACCESS_DENIED); /* signal failure */
|
---|
1460 | }
|
---|
1461 |
|
---|
1462 |
|
---|
1463 | /*****************************************************************************
|
---|
1464 | * Name : RegSetKeySecurity
|
---|
1465 | * Purpose : The RegSetKeySecurity function sets the security of an open registry key.
|
---|
1466 | * Parameters: HKEY hKey open handle of key to set
|
---|
1467 | * SECURITY_INFORMATION si descriptor contents
|
---|
1468 | * PSECURITY_DESCRIPTOR psd address of descriptor for key
|
---|
1469 | * Variables :
|
---|
1470 | * Result :
|
---|
1471 | * Remark :
|
---|
1472 | * Status : UNTESTED STUB
|
---|
1473 | *
|
---|
1474 | * Author : Patrick Haller [Tue, 1998/06/16 23:00]
|
---|
1475 | *****************************************************************************/
|
---|
1476 |
|
---|
1477 | ODINFUNCTION3(LONG,RegSetKeySecurity,HKEY, hKey,
|
---|
1478 | SECURITY_INFORMATION,si,
|
---|
1479 | PSECURITY_DESCRIPTOR,psd)
|
---|
1480 | {
|
---|
1481 | dprintf(("ADVAPI32: RegSetKeySecurity not implemented.\n"));
|
---|
1482 |
|
---|
1483 | return (ERROR_ACCESS_DENIED); /* signal failure */
|
---|
1484 | }
|
---|
1485 |
|
---|
1486 |
|
---|
1487 | /*****************************************************************************
|
---|
1488 | * Name : RegUnLoadKeyA
|
---|
1489 | * Purpose : The RegUnLoadKey function unloads the specified key and subkeys from the registry.
|
---|
1490 | * Parameters: HKEY hKey handle of open key
|
---|
1491 | * LPCSTR lpszSubKey address of name of subkey to unload
|
---|
1492 | * Variables :
|
---|
1493 | * Result :
|
---|
1494 | * Remark :
|
---|
1495 | * Status : UNTESTED STUB
|
---|
1496 | *
|
---|
1497 | * Author : Patrick Haller [Tue, 1998/06/16 23:00]
|
---|
1498 | *****************************************************************************/
|
---|
1499 |
|
---|
1500 | ODINFUNCTION2(LONG,RegUnLoadKeyA,HKEY, hKey,
|
---|
1501 | LPCSTR, lpszSubKey)
|
---|
1502 | {
|
---|
1503 | dprintf(("ADVAPI32: RegUnLoadKeyA not implemented.\n"));
|
---|
1504 |
|
---|
1505 | return (ERROR_ACCESS_DENIED); /* signal failure */
|
---|
1506 | }
|
---|
1507 |
|
---|
1508 |
|
---|
1509 | /*****************************************************************************
|
---|
1510 | * Name : RegUnLoadKeyW
|
---|
1511 | * Purpose : The RegUnLoadKey function unloads the specified key and subkeys from the registry.
|
---|
1512 | * Parameters: HKEY hKey handle of open key
|
---|
1513 | * LPCWSTR lpszSubKey address of name of subkey to unload
|
---|
1514 | * Variables :
|
---|
1515 | * Result :
|
---|
1516 | * Remark :
|
---|
1517 | * Status : UNTESTED STUB
|
---|
1518 | *
|
---|
1519 | * Author : Patrick Haller [Tue, 1998/06/16 23:00]
|
---|
1520 | *****************************************************************************/
|
---|
1521 |
|
---|
1522 | ODINFUNCTION2(LONG,RegUnLoadKeyW,HKEY, hKey,
|
---|
1523 | LPCWSTR, lpszSubKey)
|
---|
1524 | {
|
---|
1525 | dprintf(("ADVAPI32: RegUnLoadKeyW not implemented.\n"));
|
---|
1526 |
|
---|
1527 | return (ERROR_ACCESS_DENIED); /* signal failure */
|
---|
1528 | }
|
---|
1529 |
|
---|
1530 |
|
---|
1531 | /*****************************************************************************
|
---|
1532 | * Name : RegNotifyChangeKeyValue
|
---|
1533 | * Purpose :
|
---|
1534 | * Parameters: HKEY hKey handle of open key
|
---|
1535 | * LPCWSTR lpszSubKey address of name of subkey to unload
|
---|
1536 | * Variables :
|
---|
1537 | * Result :
|
---|
1538 | * Remark :
|
---|
1539 | * Status : UNTESTED STUB
|
---|
1540 | *
|
---|
1541 | * Author : Patrick Haller [Tue, 1998/06/16 23:00]
|
---|
1542 | *****************************************************************************/
|
---|
1543 |
|
---|
1544 | ODINFUNCTION5(LONG,RegNotifyChangeKeyValue,HKEY, hKey,
|
---|
1545 | BOOL, bWatchSubtree,
|
---|
1546 | DWORD, dwNotifyFilter,
|
---|
1547 | HANDLE,hEvent,
|
---|
1548 | BOOL, fAsynchronus)
|
---|
1549 | {
|
---|
1550 | dprintf(("ADVAPI32: RegNotifyChangeKeyValue() not implemented.\n"));
|
---|
1551 |
|
---|
1552 | return ERROR_ACCESS_DENIED;
|
---|
1553 | }
|
---|
1554 |
|
---|