Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update metadata to 49.0.21-preview #921

Merged
merged 1 commit into from
Apr 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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