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

Commit

Permalink
Revert an unnecessary breaking API change
Browse files Browse the repository at this point in the history
  • Loading branch information
AArnott committed Jul 8, 2020
1 parent 6efe8ab commit e82bb5a
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions src/SetupApi.Tests/SP_DEVINFO_DATAFacts.cs
Expand Up @@ -14,11 +14,11 @@ public void Size_Test()

if (Environment.Is64BitProcess)
{
Assert.Equal(0x20, value.cbSize);
Assert.Equal(0x20, value.Size);
}
else
{
Assert.Equal(0x1c, value.cbSize);
Assert.Equal(0x1c, value.Size);
}
}
}
1 change: 1 addition & 0 deletions src/SetupApi/PublicAPI.Shipped.txt
Expand Up @@ -24,6 +24,7 @@ PInvoke.SetupApi.SP_DEVINFO_DATA.ClassGuid -> System.Guid
PInvoke.SetupApi.SP_DEVINFO_DATA.DevInst -> uint
PInvoke.SetupApi.SP_DEVINFO_DATA.Reserved -> System.IntPtr
PInvoke.SetupApi.SP_DEVINFO_DATA.SP_DEVINFO_DATA() -> void
PInvoke.SetupApi.SP_DEVINFO_DATA.Size -> int
PInvoke.SetupApi.SafeDeviceInfoSetHandle
PInvoke.SetupApi.SafeDeviceInfoSetHandle.SafeDeviceInfoSetHandle() -> void
PInvoke.SetupApi.SafeDeviceInfoSetHandle.SafeDeviceInfoSetHandle(System.IntPtr preexistingHandle, bool ownsHandle = true) -> void
Expand Down
1 change: 0 additions & 1 deletion src/SetupApi/PublicAPI.Unshipped.txt
Expand Up @@ -45,7 +45,6 @@ PInvoke.SetupApi.DriverType
PInvoke.SetupApi.DriverType.SPDIT_CLASSDRIVER = 1 -> PInvoke.SetupApi.DriverType
PInvoke.SetupApi.DriverType.SPDIT_COMPATDRIVER = 2 -> PInvoke.SetupApi.DriverType
PInvoke.SetupApi.DriverType.SPDIT_NODRIVER = 0 -> PInvoke.SetupApi.DriverType
PInvoke.SetupApi.SP_DEVINFO_DATA.cbSize -> int
PInvoke.SetupApi.SP_DEVINSTALL_PARAMS
PInvoke.SetupApi.SP_DEVINSTALL_PARAMS.ClassInstallReserved -> System.IntPtr
PInvoke.SetupApi.SP_DEVINSTALL_PARAMS.DriverPath -> char*
Expand Down
6 changes: 3 additions & 3 deletions src/SetupApi/SetupApi+SP_DEVINFO_DATA.cs
Expand Up @@ -26,7 +26,7 @@ public struct SP_DEVINFO_DATA
/// The size, in bytes, of the <see cref="SP_DEVINFO_DATA" /> structure. The constructor set this value automatically
/// to the correct size.
/// </summary>
public int cbSize;
public int Size;

/// <summary>
/// The GUID of the device's setup class.
Expand All @@ -50,10 +50,10 @@ public struct SP_DEVINFO_DATA

/// <summary>
/// Initializes a new instance of the <see cref="SP_DEVINFO_DATA" /> struct
/// with <see cref="cbSize" /> set to the correct value.
/// with <see cref="Size" /> set to the correct value.
/// </summary>
/// <returns>An instance of <see cref="SP_DEVINFO_DATA"/>.</returns>
public static unsafe SP_DEVINFO_DATA Create() => new SP_DEVINFO_DATA { cbSize = sizeof(SP_DEVINFO_DATA) };
public static unsafe SP_DEVINFO_DATA Create() => new SP_DEVINFO_DATA { Size = sizeof(SP_DEVINFO_DATA) };
}
}
}
6 changes: 3 additions & 3 deletions src/SetupApi/SetupApi.cs
Expand Up @@ -146,7 +146,7 @@ public static partial class SetupApi
/// </param>
/// <param name="deviceInfoData">
/// A pointer to a buffer that receives information about the device that supports the requested interface. The caller
/// must set <see cref="SP_DEVINFO_DATA.cbSize" /> before calling this function.
/// must set <see cref="SP_DEVINFO_DATA.Size" /> before calling this function.
/// <para>This parameter is optional and can be <see langword="null" />.</para>
/// </param>
/// <returns>
Expand Down Expand Up @@ -175,7 +175,7 @@ public static partial class SetupApi
/// <param name="memberIndex">A zero-based index of the device information element to retrieve.</param>
/// <param name="deviceInfoData">
/// A pointer to an <see cref="SP_DEVINFO_DATA"/> structure to receive information about an enumerated
/// device information element. The caller must set <see cref="SP_DEVINFO_DATA.cbSize" /> before calling this function.
/// device information element. The caller must set <see cref="SP_DEVINFO_DATA.Size" /> before calling this function.
/// </param>
/// <returns>
/// Returns <see langword="true" /> if the function completed without error. If the function completed with an
Expand Down Expand Up @@ -271,7 +271,7 @@ public static partial class SetupApi
/// </param>
/// <param name="deviceInfoData">
/// A pointer to a caller-supplied <see cref="SP_DEVINFO_DATA"/> structure that receives information about the device information
/// element for the device instance that is specified by <paramref name="deviceInstanceId"/>. The caller must set <see cref="SP_DEVINFO_DATA.cbSize"/>.
/// element for the device instance that is specified by <paramref name="deviceInstanceId"/>. The caller must set <see cref="SP_DEVINFO_DATA.Size"/>.
/// This parameter is optional and can be <see langword="null"/>.
/// </param>
/// <returns>
Expand Down

0 comments on commit e82bb5a

Please sign in to comment.