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