source: trunk/src/kernel32/registry.cpp@ 8689

Last change on this file since 8689 was 8687, checked in by sandervl, 23 years ago

RegSetValueExA: translated REG_EXPAND_SZ into REG_SZ; registry.dll doesn't like this type for some reason

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