Skip to content
This repository has been archived by the owner on Jul 26, 2023. It is now read-only.

Commit

Permalink
Merge pull request #127 from AArnott/fix76_setupapi
Browse files Browse the repository at this point in the history
Fix parameter propagation in helper method
  • Loading branch information
AArnott committed Jan 1, 2016
2 parents c43c1fa + 94c3f6e commit b4d14af
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/SetupApi.Desktop/SetupApi.Helpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,20 +79,20 @@ public static IEnumerable<DeviceInterfaceData> SetupDiEnumDeviceInterfaces(
}

public static string SetupDiGetDeviceInterfaceDetail(
SafeDeviceInfoSetHandle lpDeviceInfoSet,
DeviceInterfaceData oInterfaceData,
IntPtr lpDeviceInfoData)
SafeDeviceInfoSetHandle deviceInfoSet,
DeviceInterfaceData interfaceData,
DeviceInfoData deviceInfoData)
{
var requiredSize = new NullableUInt32();

// First call to get the size to allocate
SetupDiGetDeviceInterfaceDetail(
lpDeviceInfoSet,
ref oInterfaceData,
deviceInfoSet,
ref interfaceData,
IntPtr.Zero,
0,
requiredSize,
null);
deviceInfoData);

// As we passed an empty buffer we know that the function will fail, not need to check the result.
var lastError = GetLastError();
Expand All @@ -109,8 +109,8 @@ public static string SetupDiGetDeviceInterfaceDetail(

// Second call to get the value
var success = SetupDiGetDeviceInterfaceDetail(
lpDeviceInfoSet,
ref oInterfaceData,
deviceInfoSet,
ref interfaceData,
buffer,
(int)requiredSize.Value,
null,
Expand Down

0 comments on commit b4d14af

Please sign in to comment.