Skip to content

Commit

Permalink
Merge pull request #921 from microsoft/fix915
Browse files Browse the repository at this point in the history
Update metadata to 49.0.21-preview
  • Loading branch information
AArnott authored Apr 27, 2023
2 parents be175b7 + 53fc6d0 commit fb94769
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
<CentralPackageTransitivePinningEnabled>true</CentralPackageTransitivePinningEnabled>

<MetadataVersion>46.0.5-preview</MetadataVersion>
<MetadataVersion>49.0.21-preview</MetadataVersion>
<!-- <DiaMetadataVersion>0.2.185-preview-g7e1e6a442c</DiaMetadataVersion> -->
<ApiDocsVersion>0.1.12-alpha</ApiDocsVersion>

Expand Down
2 changes: 1 addition & 1 deletion src/Microsoft.Windows.CsWin32/Generator.Invariants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace Microsoft.Windows.CsWin32;

public partial class Generator
{
internal const string InteropDecorationNamespace = "Windows.Win32.Interop";
internal const string InteropDecorationNamespace = "Windows.Win32.Foundation.Metadata";
internal const string NativeArrayInfoAttribute = "NativeArrayInfoAttribute";
internal const string RAIIFreeAttribute = "RAIIFreeAttribute";
internal const string DoNotReleaseAttribute = "DoNotReleaseAttribute";
Expand Down
6 changes: 6 additions & 0 deletions src/Microsoft.Windows.CsWin32/Generator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,12 @@ public void GenerateAllInteropTypes(CancellationToken cancellationToken)
continue;
}

if (this.Reader.StringComparer.Equals(typeDef.Namespace, InteropDecorationNamespace))
{
// Ignore the attributes that describe the metadata.
continue;
}

if (this.IsCompatibleWithPlatform(typeDef.GetCustomAttributes()))
{
try
Expand Down
2 changes: 1 addition & 1 deletion src/Microsoft.Windows.CsWin32/MetadataIndex.cs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ private MetadataIndex(string metadataPath, Platform? platform)
var trh = (TypeReferenceHandle)memberReference.Parent;
TypeReference tr = mr.GetTypeReference(trh);
if (mr.StringComparer.Equals(tr.Name, "SupportedArchitectureAttribute") &&
mr.StringComparer.Equals(tr.Namespace, "Windows.Win32.Interop"))
mr.StringComparer.Equals(tr.Namespace, Generator.InteropDecorationNamespace))
{
this.SupportedArchitectureAttributeCtor = memberRefHandle;
break;
Expand Down
2 changes: 1 addition & 1 deletion test/GenerationSandbox.Tests/GeneratedForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ private static void WPARAM_From_NInt()

private static void FARPROC_InSignatureChangedToIntPtr()
{
FARPROC p = PInvoke.GetProcAddress(default(HINSTANCE), default(PCSTR));
FARPROC p = PInvoke.GetProcAddress(default(HMODULE), default(PCSTR));
p = PInvoke.GetProcAddress(default(SafeHandle), null);
}

Expand Down
2 changes: 1 addition & 1 deletion test/Microsoft.Windows.CsWin32.Tests/HandleTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ public void HandleStructsHaveIsNullProperty(string handleName)
[Theory]
[InlineData("HANDLE")]
[InlineData("HGDIOBJ")]
[InlineData("HINSTANCE")]
[InlineData("HMODULE")]
public void HandleStructsHaveStaticNullMember(string handleName)
{
// A null HGDIOBJ has a specific meaning beyond just the concept of an invalid handle:
Expand Down
2 changes: 1 addition & 1 deletion test/SpellChecker/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
Span<PWSTR> suggestionResult = new PWSTR[1];
while (true)
{
if (errors.Next() is not ISpellingError error)
if (errors.Next(out ISpellingError error).ThrowOnFailure() == HRESULT.S_FALSE)
{
break;
}
Expand Down
2 changes: 1 addition & 1 deletion test/WinRTInteropTest/NativeMethods.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ EndPaint
GetMessage
GetModuleHandle
HDC
HINSTANCE
HMENU
HMODULE
HWND
ICompositorDesktopInterop
IDC_ARROW
Expand Down

0 comments on commit fb94769

Please sign in to comment.