@@ -3447,53 +3447,15 @@ BOOL WINAPI SetupDiGetDeviceRegistryPropertyW(
3447
3447
}
3448
3448
3449
3449
/***********************************************************************
3450
- * SetupDiSetDeviceRegistryPropertyA (SETUPAPI.@)
3451
- */
3452
- BOOL WINAPI SetupDiSetDeviceRegistryPropertyA (
3453
- HDEVINFO DeviceInfoSet ,
3454
- PSP_DEVINFO_DATA DeviceInfoData ,
3455
- DWORD Property ,
3456
- const BYTE * PropertyBuffer ,
3457
- DWORD PropertyBufferSize )
3458
- {
3459
- BOOL ret = FALSE;
3460
- struct DeviceInfoSet * set = (struct DeviceInfoSet * )DeviceInfoSet ;
3461
-
3462
- TRACE ("%p %p %d %p %d\n" , DeviceInfoSet , DeviceInfoData , Property ,
3463
- PropertyBuffer , PropertyBufferSize );
3464
-
3465
- if (!DeviceInfoSet || DeviceInfoSet == INVALID_HANDLE_VALUE )
3466
- {
3467
- SetLastError (ERROR_INVALID_HANDLE );
3468
- return FALSE;
3469
- }
3470
- if (set -> magic != SETUP_DEVICE_INFO_SET_MAGIC )
3471
- {
3472
- SetLastError (ERROR_INVALID_HANDLE );
3473
- return FALSE;
3474
- }
3475
- if (!DeviceInfoData || DeviceInfoData -> cbSize != sizeof (SP_DEVINFO_DATA )
3476
- || !DeviceInfoData -> Reserved )
3477
- {
3478
- SetLastError (ERROR_INVALID_PARAMETER );
3479
- return FALSE;
3480
- }
3481
-
3482
- FIXME ("%p %p 0x%lx %p 0x%lx\n" , DeviceInfoSet , DeviceInfoData ,
3483
- Property , PropertyBuffer , PropertyBufferSize );
3484
- SetLastError (ERROR_CALL_NOT_IMPLEMENTED );
3485
- return ret ;
3486
- }
3487
-
3488
- /***********************************************************************
3489
- * SetupDiSetDeviceRegistryPropertyW (SETUPAPI.@)
3450
+ * Internal for SetupDiSetDeviceRegistryPropertyA/W
3490
3451
*/
3491
- BOOL WINAPI SetupDiSetDeviceRegistryPropertyW (
3452
+ BOOL WINAPI IntSetupDiSetDeviceRegistryPropertyAW (
3492
3453
HDEVINFO DeviceInfoSet ,
3493
3454
PSP_DEVINFO_DATA DeviceInfoData ,
3494
3455
DWORD Property ,
3495
3456
const BYTE * PropertyBuffer ,
3496
- DWORD PropertyBufferSize )
3457
+ DWORD PropertyBufferSize ,
3458
+ BOOL isAnsi )
3497
3459
{
3498
3460
BOOL ret = FALSE;
3499
3461
struct DeviceInfoSet * set = (struct DeviceInfoSet * )DeviceInfoSet ;
@@ -3518,18 +3480,29 @@ BOOL WINAPI SetupDiSetDeviceRegistryPropertyW(
3518
3480
return FALSE;
3519
3481
}
3520
3482
if (Property < sizeof (PropertyMap ) / sizeof (PropertyMap [0 ])
3521
- && PropertyMap [Property ].nameW )
3483
+ && PropertyMap [Property ].nameW
3484
+ && PropertyMap [Property ].nameA )
3522
3485
{
3523
3486
HKEY hKey ;
3524
3487
LONG l ;
3525
3488
hKey = SetupDiOpenDevRegKey (DeviceInfoSet , DeviceInfoData , DICS_FLAG_GLOBAL , 0 , DIREG_DEV , KEY_SET_VALUE );
3526
3489
if (hKey == INVALID_HANDLE_VALUE )
3527
3490
return FALSE;
3528
3491
/* Write new data */
3529
- l = RegSetValueExW (
3530
- hKey , PropertyMap [Property ].nameW , 0 ,
3531
- PropertyMap [Property ].regType , PropertyBuffer ,
3532
- PropertyBufferSize );
3492
+ if (isAnsi )
3493
+ {
3494
+ l = RegSetValueExA (
3495
+ hKey , PropertyMap [Property ].nameA , 0 ,
3496
+ PropertyMap [Property ].regType , PropertyBuffer ,
3497
+ PropertyBufferSize );
3498
+ }
3499
+ else
3500
+ {
3501
+ l = RegSetValueExW (
3502
+ hKey , PropertyMap [Property ].nameW , 0 ,
3503
+ PropertyMap [Property ].regType , PropertyBuffer ,
3504
+ PropertyBufferSize );
3505
+ }
3533
3506
if (!l )
3534
3507
ret = TRUE;
3535
3508
else
@@ -3545,6 +3518,41 @@ BOOL WINAPI SetupDiSetDeviceRegistryPropertyW(
3545
3518
TRACE ("Returning %d\n" , ret );
3546
3519
return ret ;
3547
3520
}
3521
+ /***********************************************************************
3522
+ * SetupDiSetDeviceRegistryPropertyA (SETUPAPI.@)
3523
+ */
3524
+ BOOL WINAPI SetupDiSetDeviceRegistryPropertyA (
3525
+ HDEVINFO DeviceInfoSet ,
3526
+ PSP_DEVINFO_DATA DeviceInfoData ,
3527
+ DWORD Property ,
3528
+ const BYTE * PropertyBuffer ,
3529
+ DWORD PropertyBufferSize )
3530
+ {
3531
+ return IntSetupDiSetDeviceRegistryPropertyAW (DeviceInfoSet ,
3532
+ DeviceInfoData ,
3533
+ Property ,
3534
+ PropertyBuffer ,
3535
+ PropertyBufferSize ,
3536
+ TRUE);
3537
+ }
3538
+
3539
+ /***********************************************************************
3540
+ * SetupDiSetDeviceRegistryPropertyW (SETUPAPI.@)
3541
+ */
3542
+ BOOL WINAPI SetupDiSetDeviceRegistryPropertyW (
3543
+ HDEVINFO DeviceInfoSet ,
3544
+ PSP_DEVINFO_DATA DeviceInfoData ,
3545
+ DWORD Property ,
3546
+ const BYTE * PropertyBuffer ,
3547
+ DWORD PropertyBufferSize )
3548
+ {
3549
+ return IntSetupDiSetDeviceRegistryPropertyAW (DeviceInfoSet ,
3550
+ DeviceInfoData ,
3551
+ Property ,
3552
+ PropertyBuffer ,
3553
+ PropertyBufferSize ,
3554
+ FALSE);
3555
+ }
3548
3556
3549
3557
/***********************************************************************
3550
3558
* SetupDiInstallClassA (SETUPAPI.@)
0 commit comments