mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 01:55:19 +00:00
implemented SetupDiSetSelectedDriverA
svn path=/trunk/; revision=18778
This commit is contained in:
parent
66242cc2c6
commit
f0a99faa99
2 changed files with 66 additions and 2 deletions
|
@ -121,7 +121,7 @@ struct DeviceInterface /* Element of DeviceInfoElement.InterfaceListHead */
|
|||
struct InfFileDetails
|
||||
{
|
||||
HINF hInf;
|
||||
ULONG References;
|
||||
LONG References;
|
||||
};
|
||||
|
||||
struct DriverInfoElement /* Element of DeviceInfoSet.DriverListHead and DeviceInfoElement.DriverListHead */
|
||||
|
@ -4974,6 +4974,70 @@ SetupDiGetSelectedDriverW(
|
|||
return ret;
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* SetupDiSetSelectedDriverA (SETUPAPI.@)
|
||||
*/
|
||||
BOOL WINAPI
|
||||
SetupDiSetSelectedDriverA(
|
||||
IN HDEVINFO DeviceInfoSet,
|
||||
IN PSP_DEVINFO_DATA DeviceInfoData OPTIONAL,
|
||||
IN OUT PSP_DRVINFO_DATA_A DriverInfoData OPTIONAL)
|
||||
{
|
||||
SP_DRVINFO_DATA_V1_W DriverInfoDataW;
|
||||
PSP_DRVINFO_DATA_W pDriverInfoDataW = NULL;
|
||||
BOOL ret = FALSE;
|
||||
|
||||
if (DriverInfoData != NULL)
|
||||
{
|
||||
if (DriverInfoData->cbSize != sizeof(SP_DRVINFO_DATA_V2_A) &&
|
||||
DriverInfoData->cbSize != sizeof(SP_DRVINFO_DATA_V1_A));
|
||||
{
|
||||
SetLastError(ERROR_INVALID_PARAMETER);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
DriverInfoDataW.cbSize = sizeof(SP_DRVINFO_DATA_V1_W);
|
||||
DriverInfoDataW.Reserved = DriverInfoData->Reserved;
|
||||
|
||||
if (DriverInfoDataW.Reserved == 0)
|
||||
{
|
||||
DriverInfoDataW.DriverType = DriverInfoData->DriverType;
|
||||
|
||||
/* convert the strings to unicode */
|
||||
if (!MultiByteToWideChar(CP_ACP,
|
||||
0,
|
||||
DriverInfoData->Description,
|
||||
LINE_LEN,
|
||||
DriverInfoDataW.Description,
|
||||
LINE_LEN) ||
|
||||
!MultiByteToWideChar(CP_ACP,
|
||||
0,
|
||||
DriverInfoData->ProviderName,
|
||||
LINE_LEN,
|
||||
DriverInfoDataW.ProviderName,
|
||||
LINE_LEN))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
pDriverInfoDataW = (PSP_DRVINFO_DATA_W)&DriverInfoDataW;
|
||||
}
|
||||
|
||||
ret = SetupDiSetSelectedDriverW(DeviceInfoSet,
|
||||
DeviceInfoData,
|
||||
pDriverInfoDataW);
|
||||
|
||||
if (ret && pDriverInfoDataW != NULL)
|
||||
{
|
||||
DriverInfoData->Reserved = DriverInfoDataW.Reserved;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* SetupDiSetSelectedDriverW (SETUPAPI.@)
|
||||
*/
|
||||
|
|
|
@ -381,7 +381,7 @@
|
|||
@ stub SetupDiSetDriverInstallParamsA
|
||||
@ stub SetupDiSetDriverInstallParamsW
|
||||
@ stub SetupDiSetSelectedDevice
|
||||
@ stub SetupDiSetSelectedDriverA
|
||||
@ stdcall SetupDiSetSelectedDriverA(ptr ptr ptr)
|
||||
@ stdcall SetupDiSetSelectedDriverW(ptr ptr ptr)
|
||||
@ stub SetupDiUnremoveDevice
|
||||
@ stub SetupDuplicateDiskSpaceListA
|
||||
|
|
Loading…
Reference in a new issue