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