Skip to content
This repository has been archived by the owner on Jun 23, 2018. It is now read-only.

Commit

Permalink
Remove duplicate code
Browse files Browse the repository at this point in the history
  • Loading branch information
shauleiz committed May 25, 2016
1 parent d62e0cf commit 7777ef7
Showing 1 changed file with 0 additions and 52 deletions.
52 changes: 0 additions & 52 deletions XOutput/XOutput.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,58 +122,6 @@ DWORD XOutputGetDriverPackageVersion(PDWORDLONG Version)

}

DWORD XOutputGetDriverPackageVersion(PDWORDLONG Version)
{
DWORD Status = ERROR_INVALID_FUNCTION;
// Get the "device info set" for our driver GUID
HDEVINFO devInfoSet = SetupDiGetClassDevs(&GUID_DEVINTERFACE_SCPVBUS, NULL, NULL, DIGCF_PRESENT | DIGCF_DEVICEINTERFACE);

// Cycle through all devices currently present (Only One)
for (int i = 0; ; i++)
{
// Get the device info for this device
SP_DEVINFO_DATA devInfo;
devInfo.cbSize = sizeof(SP_DEVINFO_DATA);
if (!SetupDiEnumDeviceInfo(devInfoSet, i, &devInfo))
break;


SP_DEVINSTALL_PARAMS InstallParams;
InstallParams.cbSize = sizeof(SP_DEVINSTALL_PARAMS);
if (!SetupDiGetDeviceInstallParams(devInfoSet, &devInfo, &InstallParams))
{
return GetLastError();
}
else
{
InstallParams.FlagsEx |= DI_FLAGSEX_INSTALLEDDRIVER;
if (!SetupDiSetDeviceInstallParams(devInfoSet, &devInfo, &InstallParams))
{
return GetLastError();
}
}


// Build a list of driver info items that we will retrieve below
if (!SetupDiBuildDriverInfoList(devInfoSet, &devInfo, SPDIT_COMPATDRIVER))
return GetLastError(); // Exit on error

// Get all the info items for this driver
for (int j = 0; ; j++)
{
SP_DRVINFO_DATA drvInfo;
drvInfo.cbSize = sizeof(SP_DRVINFO_DATA);
if (!SetupDiEnumDriverInfo(devInfoSet, &devInfo, SPDIT_COMPATDRIVER, j, &drvInfo))
break;
*Version = drvInfo.DriverVersion;
Status = ERROR_SUCCESS;
}

}

return Status;

}
DWORD XOutputSetState(DWORD dwUserIndex, XINPUT_GAMEPAD* pGamepad)
{
Initialize();
Expand Down

0 comments on commit 7777ef7

Please sign in to comment.