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