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

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

RegQueryInfoKeyW fix

File size: 50.1 KB
Line 
1/* $Id: registry.cpp,v 1.15 2002-05-16 12:53:45 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) {
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 return O32_RegSetValueEx(ConvertKey(hkey),
1062 lpszValueName,
1063 dwReserved,
1064 fdwType,
1065 lpbData,
1066 cbData);
1067}
1068
1069
1070/*****************************************************************************
1071 * Name :
1072 * Purpose :
1073 * Parameters:
1074 * Variables :
1075 * Result :
1076 * Remark : TODO:Check for string length here too?
1077 * Status : UNTESTED STUB
1078 *
1079 * Author : Patrick Haller [Tue, 1998/06/16 23:00]
1080 *****************************************************************************/
1081
1082LONG WIN32API RegSetValueExW(HKEY hkey,
1083 LPCWSTR lpszValueName,
1084 DWORD dwReserved,
1085 DWORD fdwType,
1086 BYTE* lpbData,
1087 DWORD cbData)
1088{
1089 char *astring = UnicodeToAsciiString(lpszValueName);
1090 char *akeydata = NULL;
1091 LONG rc;
1092
1093 switch(fdwType) {
1094 case REG_SZ:
1095 case REG_EXPAND_SZ:
1096 akeydata = UnicodeToAsciiString((LPWSTR)lpbData);
1097 lpbData = (BYTE *)akeydata;
1098 break;
1099 case REG_MULTI_SZ:
1100 case REG_LINK: //???
1101 dprintf(("ERROR: key data must be translated from Unicode to Ascii!!"));
1102 break;
1103 }
1104 rc = RegSetValueExA(hkey, astring, dwReserved, fdwType, lpbData, cbData);
1105
1106 if(akeydata)
1107 FreeAsciiString(akeydata);
1108
1109 if (NULL != astring)
1110 FreeAsciiString(astring);
1111
1112 return(rc);
1113}
1114
1115
1116/*****************************************************************************
1117 * Name :
1118 * Purpose :
1119 * Parameters:
1120 * Variables :
1121 * Result :
1122 * Remark :
1123 * Status : UNTESTED STUB
1124 *
1125 * Author : Patrick Haller [Tue, 1998/06/16 23:00]
1126 *****************************************************************************/
1127
1128LONG WIN32API RegFlushKey(HKEY hkey)
1129{
1130 dprintf(("ADVAPI32: RegFlushKey not implemented yet."));
1131
1132 return(ERROR_SUCCESS);
1133}
1134
1135
1136/*****************************************************************************
1137 * Name : RegConnectRegistryA
1138 * Purpose : The RegConnectRegistry function establishes a connection to a
1139 * predefined registry handle on another computer.
1140 * Parameters: LPTSTR lpszComputerName address of name of remote computer
1141 * HKEY hKey predefined registry handle
1142 * PHKEY phkResult address of buffer for remote registry handle
1143 * Variables :
1144 * Result :
1145 * Remark :
1146 * Status : UNTESTED STUB
1147 *
1148 * Author : Patrick Haller [Tue, 1998/06/16 23:00]
1149 *****************************************************************************/
1150
1151LONG WIN32API RegConnectRegistryA(LPCSTR lpszComputerName,
1152 HKEY hKey,
1153 PHKEY phkResult)
1154{
1155 char szLocalName[256];
1156 DWORD dwNameLength = sizeof(szLocalName)-2;
1157
1158 szLocalName[0] = '\\';
1159 szLocalName[1] = '\\';
1160 GetComputerNameA(szLocalName+2, &dwNameLength);
1161
1162 dprintf(("ADVAPI32: RegConnectRegistryA(%s,local %s) not implemented yet.\n",
1163 lpszComputerName,
1164 szLocalName));
1165
1166 /* local registry ? */
1167 if ( ( lpszComputerName == NULL) ||
1168 (strcmp(szLocalName, lpszComputerName) == 0 ) )
1169 {
1170 /* @@@PH experimental !!! */
1171 *phkResult = hKey;
1172
1173 return (NO_ERROR);
1174 }
1175
1176 return (ERROR_ACCESS_DENIED);
1177}
1178
1179
1180/*****************************************************************************
1181 * Name : RegConnectRegistryW
1182 * Purpose : The RegConnectRegistry function establishes a connection to a
1183 * predefined registry handle on another computer.
1184 * Parameters: LPWSTR lpszComputerName address of name of remote computer
1185 * HKEY hKey predefined registry handle
1186 * PHKEY phkResult address of buffer for remote registry handle
1187 * Variables :
1188 * Result :
1189 * Remark :
1190 * Status : UNTESTED STUB
1191 *
1192 * Author : Patrick Haller [Tue, 1998/06/16 23:00]
1193 *****************************************************************************/
1194
1195LONG WIN32API RegConnectRegistryW(LPCWSTR lpszComputerName,
1196 HKEY hKey,
1197 PHKEY phkResult)
1198{
1199 /* corresponding ascii string */
1200 LPSTR pszAscii;
1201 LONG rc; /* returncode from call to ascii version of this function */
1202
1203 dprintf(("ADVAPI32: RegConnectRegistryW not implemented yet."));
1204
1205 if (lpszComputerName != NULL)
1206 pszAscii = UnicodeToAsciiString((LPWSTR)lpszComputerName);
1207 else
1208 pszAscii = NULL;
1209
1210 rc = RegConnectRegistryA(pszAscii,
1211 hKey,
1212 phkResult);
1213
1214 if (pszAscii != NULL)
1215 FreeAsciiString(pszAscii);
1216
1217 return (rc); /* OK */
1218}
1219
1220
1221/*****************************************************************************
1222 * Name : RegGetKeySecurity
1223 * Purpose : The RegGetKeySecurity function retrieves a copy of the security
1224 * descriptor protecting the specified open registry key.
1225 * Parameters: HKEY hKey open handle of key to set
1226 * SECURITY_INFORMATION SecInf descriptor contents
1227 * PSECURITY_DESCRIPTOR pSecDesc address of descriptor for key
1228 * LPDWORD lpcbSecDesc address of size of buffer and descriptor
1229 * Variables :
1230 * Result :
1231 * Remark :
1232 * Status : UNTESTED STUB
1233 *
1234 * Author : Patrick Haller [Tue, 1998/06/16 23:00]
1235 *****************************************************************************/
1236
1237LONG WIN32API RegGetKeySecurity(HKEY hKey,
1238 SECURITY_INFORMATION SecInf,
1239 PSECURITY_DESCRIPTOR pSecDesc,
1240 LPDWORD lpcbSecDesc)
1241{
1242 dprintf(("ADVAPI32: RegGetKeySecurity not implemented.\n"));
1243
1244 return (ERROR_ACCESS_DENIED); /* signal failure */
1245}
1246
1247
1248/*****************************************************************************
1249 * Name : RegLoadKeyA
1250 * Purpose : The RegLoadKey function creates a subkey under HKEY_USER or
1251 * HKEY_LOCAL_MACHINE and stores registration information from a
1252 * specified file into that subkey. This registration information
1253 * is in the form of a hive. A hive is a discrete body of keys,
1254 * subkeys, and values that is rooted at the top of the registry
1255 * hierarchy. A hive is backed by a single file and .LOG file.
1256 * Parameters: HKEY hKey handle of open key
1257 * LPCSTR lpszSubKey address of name of subkey
1258 * LPCSTR lpszFile address of filename for registry information
1259 * Variables :
1260 * Result :
1261 * Remark :
1262 * Status : UNTESTED STUB
1263 *
1264 * Author : Patrick Haller [Tue, 1998/06/16 23:00]
1265 *****************************************************************************/
1266
1267LONG WIN32API RegLoadKeyA(HKEY hKey,
1268 LPCSTR lpszSubKey,
1269 LPCSTR lpszFile)
1270{
1271 dprintf(("ADVAPI32: RegLoadKeyA not implemented.\n"));
1272
1273 return (ERROR_ACCESS_DENIED); /* signal failure */
1274}
1275
1276
1277/*****************************************************************************
1278 * Name : RegLoadKeyW
1279 * Purpose : The RegLoadKey function creates a subkey under HKEY_USER or
1280 * HKEY_LOCAL_MACHINE and stores registration information from a
1281 * specified file into that subkey. This registration information
1282 * is in the form of a hive. A hive is a discrete body of keys,
1283 * subkeys, and values that is rooted at the top of the registry
1284 * hierarchy. A hive is backed by a single file and .LOG file.
1285 * Parameters: HKEY hKey handle of open key
1286 * LPCWSTR lpszSubKey address of name of subkey
1287 * LPCWSTR lpszFile address of filename for registry information
1288 * Variables :
1289 * Result :
1290 * Remark :
1291 * Status : UNTESTED STUB
1292 *
1293 * Author : Patrick Haller [Tue, 1998/06/16 23:00]
1294 *****************************************************************************/
1295
1296LONG WIN32API RegLoadKeyW(HKEY hKey,
1297 LPCWSTR lpszSubKey,
1298 LPCWSTR lpszFile)
1299{
1300 dprintf(("ADVAPI32: RegLoadKeyW not implemented.\n"));
1301
1302 return (ERROR_ACCESS_DENIED); /* signal failure */
1303}
1304
1305
1306/*****************************************************************************
1307 * Name : RegQueryMultipleValuesA
1308 * Purpose : The RegQueryMultipleValues function retrieves the type and data
1309 * for a list of value names associated with an open registry key.
1310 * Parameters: HKEY hKey handle of key to query
1311 * PVALENT val_list address of array of value entry structures
1312 * DWORD num_vals size of array of value entry structures
1313 * LPTSTR lpValueBuf address of buffer for value information
1314 * LPDWORD ldwTotsize address of size of value buffer
1315 * Variables :
1316 * Result :
1317 * Remark :
1318 * Status : UNTESTED STUB
1319 *
1320 * Author : Patrick Haller [Tue, 1998/06/16 23:00]
1321 *****************************************************************************/
1322
1323LONG WIN32API RegQueryMultipleValuesA(HKEY hKey,
1324 PVALENTA val_list,
1325 DWORD num_vals,
1326 LPTSTR lpValueBuf,
1327 LPDWORD ldwTotsize)
1328{
1329 dprintf(("ADVAPI32: RegQueryMultipleValuesA not implemented.\n"));
1330
1331 return (ERROR_ACCESS_DENIED); /* signal failure */
1332}
1333
1334
1335/*****************************************************************************
1336 * Name : RegQueryMultipleValuesW
1337 * Purpose : The RegQueryMultipleValues function retrieves the type and data
1338 * for a list of value names associated with an open registry key.
1339 * Parameters: HKEY hKey handle of key to query
1340 * PVALENT val_list address of array of value entry structures
1341 * DWORD num_vals size of array of value entry structures
1342 * LPWSTR lpValueBuf address of buffer for value information
1343 * LPDWORD ldwTotsize address of size of value buffer
1344 * Variables :
1345 * Result :
1346 * Remark :
1347 * Status : UNTESTED STUB
1348 *
1349 * Author : Patrick Haller [Tue, 1998/06/16 23:00]
1350 *****************************************************************************/
1351
1352LONG WIN32API RegQueryMultipleValuesW(HKEY hKey,
1353 PVALENTW val_list,
1354 DWORD num_vals,
1355 LPWSTR lpValueBuf,
1356 LPDWORD ldwTotsize)
1357{
1358 dprintf(("ADVAPI32: RegQueryMultipleValuesW not implemented.\n"));
1359
1360 return (ERROR_ACCESS_DENIED); /* signal failure */
1361}
1362
1363
1364/*****************************************************************************
1365 * Name : RegRemapPreDefKey
1366 * Purpose :
1367 * Parameters:
1368 * Variables :
1369 * Result :
1370 * Remark :
1371 * Status : UNTESTED STUB
1372 *
1373 * Author : Patrick Haller [Tue, 1998/06/16 23:00]
1374 *****************************************************************************/
1375
1376#if 0
1377LONG WIN32API RegRemapPreDefKey(HKEY hKey)
1378{
1379 dprintf(("ADVAPI32: RegRemapPreDefKey not implemented.\n"));
1380
1381 return (ERROR_ACCESS_DENIED); /* signal failure */
1382}
1383#endif
1384
1385
1386/*****************************************************************************
1387 * Name : RegReplaceKeyA
1388 * Purpose : The RegReplaceKey function replaces the file backing a key and
1389 * all its subkeys with another file, so that when the system is
1390 * next started, the key and subkeys will have the values stored in the new file.
1391 * Parameters: HKEY hKey handle of open key
1392 * LPCSTR lpSubKey address of name of subkey
1393 * LPCSTR lpNewFile address of filename for file with new data
1394 * LPCSTR lpOldFile address of filename for backup file
1395 * Variables :
1396 * Result :
1397 * Remark :
1398 * Status : UNTESTED STUB
1399 *
1400 * Author : Patrick Haller [Tue, 1998/06/16 23:00]
1401 *****************************************************************************/
1402
1403LONG WIN32API RegReplaceKeyA(HKEY hKey, LPCSTR lpSubKey, LPCSTR lpNewFile,
1404 LPCSTR lpOldFile)
1405{
1406 dprintf(("ADVAPI32: RegReplaceKeyA not implemented.\n"));
1407
1408 return (ERROR_ACCESS_DENIED); /* signal failure */
1409}
1410
1411
1412/*****************************************************************************
1413 * Name : RegReplaceKeyW
1414 * Purpose : The RegReplaceKey function replaces the file backing a key and
1415 * all its subkeys with another file, so that when the system is
1416 * next started, the key and subkeys will have the values stored in the new file.
1417 * Parameters: HKEY hKey handle of open key
1418 * LPCWSTR lpSubKey address of name of subkey
1419 * LPCWSTR lpNewFile address of filename for file with new data
1420 * LPCWSTR lpOldFile address of filename for backup file
1421 * Variables :
1422 * Result :
1423 * Remark :
1424 * Status : UNTESTED STUB
1425 *
1426 * Author : Patrick Haller [Tue, 1998/06/16 23:00]
1427 *****************************************************************************/
1428
1429LONG WIN32API RegReplaceKeyW(HKEY hKey,
1430 LPCWSTR lpSubKey,
1431 LPCWSTR lpNewFile,
1432 LPCWSTR lpOldFile)
1433{
1434 dprintf(("ADVAPI32: RegReplaceKeyW not implemented.\n"));
1435
1436 return (ERROR_ACCESS_DENIED); /* signal failure */
1437}
1438
1439
1440/*****************************************************************************
1441 * Name : RegRestoreKeyA
1442 * Purpose : The RegRestoreKey function reads the registry information in a
1443 * specified file and copies it over the specified key. This
1444 * registry information may be in the form of a key and multiple
1445 * levels of subkeys.
1446 * Parameters: HKEY hKey handle of key where restore begins
1447 * LPCSTR lpszFile address of filename containing saved tree
1448 * DWORD fdw optional flags
1449 * Variables :
1450 * Result :
1451 * Remark :
1452 * Status : UNTESTED STUB
1453 *
1454 * Author : Patrick Haller [Tue, 1998/06/16 23:00]
1455 *****************************************************************************/
1456
1457LONG WIN32API RegRestoreKeyA(HKEY hKey,
1458 LPCSTR lpszFile,
1459 DWORD fdw)
1460{
1461 dprintf(("ADVAPI32: RegRestoreKeyA not implemented.\n"));
1462
1463 return (ERROR_ACCESS_DENIED); /* signal failure */
1464}
1465
1466
1467/*****************************************************************************
1468 * Name : RegRestoreKeyW
1469 * Purpose : The RegRestoreKey function reads the registry information in a
1470 * specified file and copies it over the specified key. This
1471 * registry information may be in the form of a key and multiple
1472 * levels of subkeys.
1473 * Parameters: HKEY hKey handle of key where restore begins
1474 * LPCWSTR lpszFile address of filename containing saved tree
1475 * DWORD fdw optional flags
1476 * Variables :
1477 * Result :
1478 * Remark :
1479 * Status : UNTESTED STUB
1480 *
1481 * Author : Patrick Haller [Tue, 1998/06/16 23:00]
1482 *****************************************************************************/
1483
1484LONG WIN32API RegRestoreKeyW(HKEY hKey,
1485 LPCWSTR lpszFile,
1486 DWORD fdw)
1487{
1488 dprintf(("ADVAPI32: RegRestoreKeyW not implemented.\n"));
1489
1490 return (ERROR_ACCESS_DENIED); /* signal failure */
1491}
1492
1493
1494/*****************************************************************************
1495 * Name : RegSaveKeyA
1496 * Purpose : The RegSaveKey function saves the specified key and all of its
1497 * subkeys and values to a new file.
1498 * Parameters: HKEY hKey handle of key where save begins
1499 * LPCSTR lpszFile address of filename to save to
1500 * LPSECURITY_ATTRIBUTES lpsa address of security structure
1501 * Variables :
1502 * Result :
1503 * Remark :
1504 * Status : UNTESTED STUB
1505 *
1506 * Author : Patrick Haller [Tue, 1998/06/16 23:00]
1507 *****************************************************************************/
1508
1509LONG WIN32API RegSaveKeyA(HKEY hKey,
1510 LPCSTR lpszFile,
1511 LPSECURITY_ATTRIBUTES lpsa)
1512{
1513 dprintf(("ADVAPI32: RegSaveKeyA not implemented.\n"));
1514
1515 return (ERROR_ACCESS_DENIED); /* signal failure */
1516}
1517
1518
1519/*****************************************************************************
1520 * Name : RegSaveKeyW
1521 * Purpose : The RegSaveKey function saves the specified key and all of its
1522 * subkeys and values to a new file.
1523 * Parameters: HKEY hKey handle of key where save begins
1524 * LPCWSTR lpszFile address of filename to save to
1525 * LPSECURITY_ATTRIBUTES lpsa address of security structure
1526 * Variables :
1527 * Result :
1528 * Remark :
1529 * Status : UNTESTED STUB
1530 *
1531 * Author : Patrick Haller [Tue, 1998/06/16 23:00]
1532 *****************************************************************************/
1533
1534LONG WIN32API RegSaveKeyW(HKEY hKey,
1535 LPCWSTR lpszFile,
1536 LPSECURITY_ATTRIBUTES lpsa)
1537{
1538 dprintf(("ADVAPI32: RegSaveKeyW not implemented.\n"));
1539
1540 return (ERROR_ACCESS_DENIED); /* signal failure */
1541}
1542
1543
1544/*****************************************************************************
1545 * Name : RegSetKeySecurity
1546 * Purpose : The RegSetKeySecurity function sets the security of an open registry key.
1547 * Parameters: HKEY hKey open handle of key to set
1548 * SECURITY_INFORMATION si descriptor contents
1549 * PSECURITY_DESCRIPTOR psd address of descriptor for key
1550 * Variables :
1551 * Result :
1552 * Remark :
1553 * Status : UNTESTED STUB
1554 *
1555 * Author : Patrick Haller [Tue, 1998/06/16 23:00]
1556 *****************************************************************************/
1557
1558LONG WIN32API RegSetKeySecurity(HKEY hKey,
1559 SECURITY_INFORMATION si,
1560 PSECURITY_DESCRIPTOR psd)
1561{
1562 dprintf(("ADVAPI32: RegSetKeySecurity not implemented.\n"));
1563
1564 return (ERROR_ACCESS_DENIED); /* signal failure */
1565}
1566
1567
1568/*****************************************************************************
1569 * Name : RegUnLoadKeyA
1570 * Purpose : The RegUnLoadKey function unloads the specified key and subkeys from the registry.
1571 * Parameters: HKEY hKey handle of open key
1572 * LPCSTR lpszSubKey address of name of subkey to unload
1573 * Variables :
1574 * Result :
1575 * Remark :
1576 * Status : UNTESTED STUB
1577 *
1578 * Author : Patrick Haller [Tue, 1998/06/16 23:00]
1579 *****************************************************************************/
1580
1581LONG WIN32API RegUnLoadKeyA(HKEY hKey,
1582 LPCSTR lpszSubKey)
1583{
1584 dprintf(("ADVAPI32: RegUnLoadKeyA not implemented.\n"));
1585
1586 return (ERROR_ACCESS_DENIED); /* signal failure */
1587}
1588
1589
1590/*****************************************************************************
1591 * Name : RegUnLoadKeyW
1592 * Purpose : The RegUnLoadKey function unloads the specified key and subkeys from the registry.
1593 * Parameters: HKEY hKey handle of open key
1594 * LPCWSTR lpszSubKey address of name of subkey to unload
1595 * Variables :
1596 * Result :
1597 * Remark :
1598 * Status : UNTESTED STUB
1599 *
1600 * Author : Patrick Haller [Tue, 1998/06/16 23:00]
1601 *****************************************************************************/
1602
1603LONG WIN32API RegUnLoadKeyW(HKEY hKey,
1604 LPCWSTR lpszSubKey)
1605{
1606 dprintf(("ADVAPI32: RegUnLoadKeyW not implemented.\n"));
1607
1608 return (ERROR_ACCESS_DENIED); /* signal failure */
1609}
1610
1611
1612/*****************************************************************************
1613 * Name : RegNotifyChangeKeyValue
1614 * Purpose :
1615 * Parameters: HKEY hKey handle of open key
1616 * LPCWSTR lpszSubKey address of name of subkey to unload
1617 * Variables :
1618 * Result :
1619 * Remark :
1620 * Status : UNTESTED STUB
1621 *
1622 * Author : Patrick Haller [Tue, 1998/06/16 23:00]
1623 *****************************************************************************/
1624
1625LONG WIN32API RegNotifyChangeKeyValue(HKEY hKey,
1626 BOOL bWatchSubtree,
1627 DWORD dwNotifyFilter,
1628 HANDLE hEvent,
1629 BOOL fAsynchronus)
1630{
1631 dprintf(("ADVAPI32: RegNotifyChangeKeyValue() not implemented.\n"));
1632
1633 return ERROR_ACCESS_DENIED;
1634}
1635
Note: See TracBrowser for help on using the repository browser.