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