mirror of
https://github.com/reactos/reactos.git
synced 2025-06-14 03:58:30 +00:00
[SETUPAPI] Use ClassInstallReserved field instead of Reserved to store a pointer.
The Reserved field is ULONG and we need ULONG_PTR. ClassInstallReserved was unused so far. I have no idea whether this is correct, but it cannot be more incorrect than what we had.
This commit is contained in:
parent
0c4d21a5a1
commit
61e35141e8
3 changed files with 14 additions and 14 deletions
|
@ -5233,7 +5233,7 @@ SetupDiRegisterCoDeviceInstallers(
|
||||||
if (!Result)
|
if (!Result)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
SelectedDriver = (struct DriverInfoElement *)InstallParams.Reserved;
|
SelectedDriver = (struct DriverInfoElement *)InstallParams.ClassInstallReserved;
|
||||||
if (SelectedDriver == NULL)
|
if (SelectedDriver == NULL)
|
||||||
{
|
{
|
||||||
SetLastError(ERROR_NO_DRIVER_SELECTED);
|
SetLastError(ERROR_NO_DRIVER_SELECTED);
|
||||||
|
@ -5436,7 +5436,7 @@ SetupDiInstallDevice(
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
SelectedDriver = (struct DriverInfoElement *)InstallParams.Reserved;
|
SelectedDriver = (struct DriverInfoElement *)InstallParams.ClassInstallReserved;
|
||||||
if (SelectedDriver == NULL)
|
if (SelectedDriver == NULL)
|
||||||
{
|
{
|
||||||
SetLastError(ERROR_NO_DRIVER_SELECTED);
|
SetLastError(ERROR_NO_DRIVER_SELECTED);
|
||||||
|
|
|
@ -1247,7 +1247,7 @@ SetupDiDestroyDriverInfoList(
|
||||||
driverInfo = CONTAINING_RECORD(ListEntry, struct DriverInfoElement, ListEntry);
|
driverInfo = CONTAINING_RECORD(ListEntry, struct DriverInfoElement, ListEntry);
|
||||||
DestroyDriverInfoElement(driverInfo);
|
DestroyDriverInfoElement(driverInfo);
|
||||||
}
|
}
|
||||||
InstallParams.Reserved = 0;
|
InstallParams.ClassInstallReserved = 0;
|
||||||
InstallParams.Flags &= ~(DI_DIDCLASS | DI_MULTMFGS);
|
InstallParams.Flags &= ~(DI_DIDCLASS | DI_MULTMFGS);
|
||||||
InstallParams.FlagsEx &= ~DI_FLAGSEX_DIDINFOLIST;
|
InstallParams.FlagsEx &= ~DI_FLAGSEX_DIDINFOLIST;
|
||||||
ret = SetupDiSetDeviceInstallParamsW(DeviceInfoSet, NULL, &InstallParams);
|
ret = SetupDiSetDeviceInstallParamsW(DeviceInfoSet, NULL, &InstallParams);
|
||||||
|
@ -1265,14 +1265,14 @@ SetupDiDestroyDriverInfoList(
|
||||||
{
|
{
|
||||||
ListEntry = RemoveHeadList(&deviceInfo->DriverListHead);
|
ListEntry = RemoveHeadList(&deviceInfo->DriverListHead);
|
||||||
driverInfo = CONTAINING_RECORD(ListEntry, struct DriverInfoElement, ListEntry);
|
driverInfo = CONTAINING_RECORD(ListEntry, struct DriverInfoElement, ListEntry);
|
||||||
if ((PVOID)InstallParamsSet.Reserved == driverInfo)
|
if ((PVOID)InstallParamsSet.ClassInstallReserved == driverInfo)
|
||||||
{
|
{
|
||||||
InstallParamsSet.Reserved = 0;
|
InstallParamsSet.ClassInstallReserved = 0;
|
||||||
SetupDiSetDeviceInstallParamsW(DeviceInfoSet, NULL, &InstallParamsSet);
|
SetupDiSetDeviceInstallParamsW(DeviceInfoSet, NULL, &InstallParamsSet);
|
||||||
}
|
}
|
||||||
DestroyDriverInfoElement(driverInfo);
|
DestroyDriverInfoElement(driverInfo);
|
||||||
}
|
}
|
||||||
InstallParams.Reserved = 0;
|
InstallParams.ClassInstallReserved = 0;
|
||||||
InstallParams.Flags &= ~DI_DIDCOMPAT;
|
InstallParams.Flags &= ~DI_DIDCOMPAT;
|
||||||
InstallParams.FlagsEx &= ~DI_FLAGSEX_DIDCOMPATINFO;
|
InstallParams.FlagsEx &= ~DI_FLAGSEX_DIDCOMPATINFO;
|
||||||
ret = SetupDiSetDeviceInstallParamsW(DeviceInfoSet, DeviceInfoData, &InstallParams);
|
ret = SetupDiSetDeviceInstallParamsW(DeviceInfoSet, DeviceInfoData, &InstallParams);
|
||||||
|
@ -1503,7 +1503,7 @@ SetupDiGetSelectedDriverW(
|
||||||
if (SetupDiGetDeviceInstallParamsW(DeviceInfoSet, DeviceInfoData, &InstallParams))
|
if (SetupDiGetDeviceInstallParamsW(DeviceInfoSet, DeviceInfoData, &InstallParams))
|
||||||
{
|
{
|
||||||
struct DriverInfoElement *driverInfo;
|
struct DriverInfoElement *driverInfo;
|
||||||
driverInfo = (struct DriverInfoElement *)InstallParams.Reserved;
|
driverInfo = (struct DriverInfoElement *)InstallParams.ClassInstallReserved;
|
||||||
if (driverInfo == NULL)
|
if (driverInfo == NULL)
|
||||||
SetLastError(ERROR_NO_DRIVER_SELECTED);
|
SetLastError(ERROR_NO_DRIVER_SELECTED);
|
||||||
else
|
else
|
||||||
|
@ -1613,12 +1613,12 @@ SetupDiSetSelectedDriverW(
|
||||||
|
|
||||||
if (DeviceInfoData)
|
if (DeviceInfoData)
|
||||||
{
|
{
|
||||||
pDriverInfo = (struct DriverInfoElement **)&((struct DeviceInfo *)DeviceInfoData->Reserved)->InstallParams.Reserved;
|
pDriverInfo = (struct DriverInfoElement **)&((struct DeviceInfo *)DeviceInfoData->Reserved)->InstallParams.ClassInstallReserved;
|
||||||
ListHead = &((struct DeviceInfo *)DeviceInfoData->Reserved)->DriverListHead;
|
ListHead = &((struct DeviceInfo *)DeviceInfoData->Reserved)->DriverListHead;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
pDriverInfo = (struct DriverInfoElement **)&((struct DeviceInfoSet *)DeviceInfoSet)->InstallParams.Reserved;
|
pDriverInfo = (struct DriverInfoElement **)&((struct DeviceInfoSet *)DeviceInfoSet)->InstallParams.ClassInstallReserved;
|
||||||
ListHead = &((struct DeviceInfoSet *)DeviceInfoSet)->DriverListHead;
|
ListHead = &((struct DeviceInfoSet *)DeviceInfoSet)->DriverListHead;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2032,7 +2032,7 @@ SetupDiGetDriverInstallParamsW(
|
||||||
if (SetupDiGetDeviceInstallParamsW(DeviceInfoSet, DeviceInfoData, &InstallParams))
|
if (SetupDiGetDeviceInstallParamsW(DeviceInfoSet, DeviceInfoData, &InstallParams))
|
||||||
{
|
{
|
||||||
struct DriverInfoElement *driverInfo;
|
struct DriverInfoElement *driverInfo;
|
||||||
driverInfo = (struct DriverInfoElement *)InstallParams.Reserved;
|
driverInfo = (struct DriverInfoElement *)InstallParams.ClassInstallReserved;
|
||||||
if (driverInfo == NULL)
|
if (driverInfo == NULL)
|
||||||
SetLastError(ERROR_NO_DRIVER_SELECTED);
|
SetLastError(ERROR_NO_DRIVER_SELECTED);
|
||||||
else
|
else
|
||||||
|
@ -2106,9 +2106,9 @@ SetupDiInstallDriverFiles(
|
||||||
SetLastError(ERROR_INVALID_HANDLE);
|
SetLastError(ERROR_INVALID_HANDLE);
|
||||||
else if (DeviceInfoData && DeviceInfoData->cbSize != sizeof(SP_DEVINFO_DATA))
|
else if (DeviceInfoData && DeviceInfoData->cbSize != sizeof(SP_DEVINFO_DATA))
|
||||||
SetLastError(ERROR_INVALID_USER_BUFFER);
|
SetLastError(ERROR_INVALID_USER_BUFFER);
|
||||||
else if (DeviceInfoData && ((struct DeviceInfo *)DeviceInfoData->Reserved)->InstallParams.Reserved == 0)
|
else if (DeviceInfoData && ((struct DeviceInfo *)DeviceInfoData->Reserved)->InstallParams.ClassInstallReserved == 0)
|
||||||
SetLastError(ERROR_NO_DRIVER_SELECTED);
|
SetLastError(ERROR_NO_DRIVER_SELECTED);
|
||||||
else if (!DeviceInfoData && ((struct DeviceInfoSet *)DeviceInfoSet)->InstallParams.Reserved == 0)
|
else if (!DeviceInfoData && ((struct DeviceInfoSet *)DeviceInfoSet)->InstallParams.ClassInstallReserved == 0)
|
||||||
SetLastError(ERROR_NO_DRIVER_SELECTED);
|
SetLastError(ERROR_NO_DRIVER_SELECTED);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -2125,7 +2125,7 @@ SetupDiInstallDriverFiles(
|
||||||
if (!ret)
|
if (!ret)
|
||||||
goto done;
|
goto done;
|
||||||
|
|
||||||
SelectedDriver = (struct DriverInfoElement *)InstallParams.Reserved;
|
SelectedDriver = (struct DriverInfoElement *)InstallParams.ClassInstallReserved;
|
||||||
if (!SelectedDriver)
|
if (!SelectedDriver)
|
||||||
{
|
{
|
||||||
SetLastError(ERROR_NO_DRIVER_SELECTED);
|
SetLastError(ERROR_NO_DRIVER_SELECTED);
|
||||||
|
|
|
@ -454,7 +454,7 @@ SetupDiInstallDeviceInterfaces(
|
||||||
if (!Result)
|
if (!Result)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
SelectedDriver = (struct DriverInfoElement *)InstallParams.Reserved;
|
SelectedDriver = (struct DriverInfoElement *)InstallParams.ClassInstallReserved;
|
||||||
if (SelectedDriver == NULL)
|
if (SelectedDriver == NULL)
|
||||||
{
|
{
|
||||||
SetLastError(ERROR_NO_DRIVER_SELECTED);
|
SetLastError(ERROR_NO_DRIVER_SELECTED);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue