Skip to content

Commit

Permalink
Retired Windows.Win32.Interop.dll and moved attribute definitions to …
Browse files Browse the repository at this point in the history
…Windows.Win32.Foundation.Metadata (#1527)

* Initial attempt at merging Interop types into the main winmd.

The winmd is generated but the attributes don't appear to be retaining the Attribute inheritance which is causing build failures in the WinmdGenerator and samples.

* Updated new files and attributes.

* Updated interop reference.

* Attributes moved to Windows.Win32.Foundation.Metadata and everything builds and compiles but attributes that expose properties like MemorySize and NativeArrayInfo have questionable definitions since the properties aren't exposed in the metadata.

* Updated debug configuration.

* Added support for properties and attributes.

* Updated the baseline.

* Added public constructors.

* Updated the diffing tool to account for the attribute namespace change and updated the baseline.
  • Loading branch information
mikebattista authored Apr 6, 2023
1 parent 18f30ab commit 45869a0
Show file tree
Hide file tree
Showing 108 changed files with 537 additions and 549 deletions.
1 change: 0 additions & 1 deletion BuildTools/BuildTools.proj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
<ProjectReference Include="..\sources\ConstantsScraper\ConstantsScraper.csproj"/>
<ProjectReference Include="..\sources\ClangSharpSourceToWinmd\ClangSharpSourceToWinmd.csproj"/>
<ProjectReference Include="..\sources\WinmdUtils\WinmdUtils.csproj"/>
<ProjectReference Include="..\sources\Win32MetadataInterop\Win32MetadataInterop.csproj"/>
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ Constants are removed from the metadata when they are detected as members of an

## Attributes

Our tooling defines several [attributes](sources/Win32MetadataInterop) that can be applied to APIs to provide useful context to language projections.
Our tooling defines several [attributes](generation/WinSDK/manual/Metadata.cs) that can be applied to APIs to provide useful context to language projections.

To apply an attribute to an API, update the `--memberRemap` section of [emitter.settings.rsp](generation/WinSDK/emitter.settings.rsp) in one of the following ways:

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Note: Community projects are listed here to help with discovery but are not offi

See the [roadmap](./docs/roadmap.md) and [FAQ](./docs/faq.md) for more details.

If you'd like to browse the metadata to see what we're emitting, extract Windows.Win32.winmd and Windows.Win32.Interop.dll from the [Microsoft.Windows.SDK.Win32Metadata](https://www.nuget.org/packages/Microsoft.Windows.SDK.Win32Metadata/) NuGet package and load Windows.Win32.winmd in [ILSpy](https://github.com/icsharpcode/ILSpy/releases/latest). Download the package and rename it to .zip to browse and extract its content.
If you'd like to browse the metadata to see what we're emitting, extract Windows.Win32.winmd from the [Microsoft.Windows.SDK.Win32Metadata](https://www.nuget.org/packages/Microsoft.Windows.SDK.Win32Metadata/) NuGet package and load Windows.Win32.winmd in [ILSpy](https://github.com/icsharpcode/ILSpy/releases/latest). Download the package and rename it to .zip to browse and extract its content.

![ILSpy with winmd](./images/ILSpyWithWinmd.png)

Expand Down
2 changes: 1 addition & 1 deletion azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ jobs:
inputs:
ConnectedServiceName: 'Xlang Code Signing'
FolderPath: '$(Build.SourcesDirectory)\bin'
Pattern: 'Windows.Win32.Interop.dll,Windows.Win32.winmd'
Pattern: 'Windows.Win32.winmd'
signConfigType: 'inlineSignParams'
inlineOperation: |
[
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System;
using System.Runtime.InteropServices;
using Windows.Win32.Interop;
using Windows.Win32.Foundation.Metadata;

namespace Windows.Win32.System.ApplicationInstallationAndServicing
{
Expand Down
2 changes: 1 addition & 1 deletion generation/WinSDK/manual/Audio.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System;
using System.Runtime.InteropServices;
using Windows.Win32.Interop;
using Windows.Win32.Foundation.Metadata;
using static Windows.Win32.UI.WindowsAndMessaging.Apis;

namespace Windows.Win32.Media.Audio
Expand Down
2 changes: 1 addition & 1 deletion generation/WinSDK/manual/Com.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System;
using System.Runtime.InteropServices;
using Windows.Win32.Interop;
using Windows.Win32.Foundation.Metadata;
using static Windows.Win32.UI.Controls.Apis;

namespace Windows.Win32.System.Com
Expand Down
2 changes: 1 addition & 1 deletion generation/WinSDK/manual/Console.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System;
using System.Runtime.InteropServices;
using Windows.Win32.Interop;
using Windows.Win32.Foundation.Metadata;

namespace Windows.Win32.System.Console
{
Expand Down
2 changes: 1 addition & 1 deletion generation/WinSDK/manual/Controls.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System;
using System.Runtime.InteropServices;
using Windows.Win32.Interop;
using Windows.Win32.Foundation.Metadata;
using static Windows.Win32.UI.Controls.Apis;

namespace Windows.Win32.UI.Controls
Expand Down
2 changes: 1 addition & 1 deletion generation/WinSDK/manual/CryptCerts.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System;
using System.Runtime.InteropServices;
using Windows.Win32.Interop;
using Windows.Win32.Foundation.Metadata;
using static Windows.Win32.UI.WindowsAndMessaging.Apis;

namespace Windows.Win32.Security.Cryptography.Certificates
Expand Down
2 changes: 1 addition & 1 deletion generation/WinSDK/manual/DevInst.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System;
using System.Runtime.InteropServices;
using Windows.Win32.Interop;
using Windows.Win32.Foundation.Metadata;

namespace Windows.Win32.Devices.DeviceAndDriverInstallation
{
Expand Down
2 changes: 1 addition & 1 deletion generation/WinSDK/manual/Dfs.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System;
using System.Runtime.InteropServices;

using Windows.Win32.Interop;
using Windows.Win32.Foundation.Metadata;

namespace Windows.Win32.Storage.IscsiDisc
{
Expand Down
2 changes: 1 addition & 1 deletion generation/WinSDK/manual/Direct2D.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System;
using System.Runtime.InteropServices;
using Windows.Win32.Interop;
using Windows.Win32.Foundation.Metadata;

namespace Windows.Win32.Graphics.Direct2D
{
Expand Down
2 changes: 1 addition & 1 deletion generation/WinSDK/manual/DirectWrite.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System;
using System.Runtime.InteropServices;
using Windows.Win32.Interop;
using Windows.Win32.Foundation.Metadata;
using static Windows.Win32.System.SystemServices.Apis;

namespace Windows.Win32.Graphics.DirectWrite
Expand Down
2 changes: 1 addition & 1 deletion generation/WinSDK/manual/Dxgi.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System;
using System.Runtime.InteropServices;
using Windows.Win32.Interop;
using Windows.Win32.Foundation.Metadata;

namespace Windows.Win32.Graphics.Dxgi
{
Expand Down
2 changes: 1 addition & 1 deletion generation/WinSDK/manual/ETW.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System;
using System.Runtime.InteropServices;
using Windows.Win32.Interop;
using Windows.Win32.Foundation.Metadata;

namespace Windows.Win32.System.Diagnostics.Etw
{
Expand Down
2 changes: 1 addition & 1 deletion generation/WinSDK/manual/FileSystem.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System;
using System.Runtime.InteropServices;
using Windows.Win32.Interop;
using Windows.Win32.Foundation.Metadata;

namespace Windows.Win32.Storage.FileSystem
{
Expand Down
2 changes: 1 addition & 1 deletion generation/WinSDK/manual/Foundation.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System;
using System.Runtime.InteropServices;
using Windows.Win32.Interop;
using Windows.Win32.Foundation.Metadata;

namespace Windows.Win32.Foundation
{
Expand Down
2 changes: 1 addition & 1 deletion generation/WinSDK/manual/Gdi.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System;
using System.Runtime.InteropServices;

using Windows.Win32.Interop;
using Windows.Win32.Foundation.Metadata;

namespace Windows.Win32.Graphics.Gdi
{
Expand Down
2 changes: 1 addition & 1 deletion generation/WinSDK/manual/HiDpi.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System;
using System.Runtime.InteropServices;
using Windows.Win32.Interop;
using Windows.Win32.Foundation.Metadata;

namespace Windows.Win32.UI.HiDpi
{
Expand Down
3 changes: 1 addition & 2 deletions generation/WinSDK/manual/Identity.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using System;
using System.Runtime.InteropServices;

using Windows.Win32.Interop;
using Windows.Win32.Foundation.Metadata;

namespace Windows.Win32.Security.Authentication.Identity
{
Expand Down
2 changes: 1 addition & 1 deletion generation/WinSDK/manual/Iis.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System;
using System.Runtime.InteropServices;
using Windows.Win32.Foundation;
using Windows.Win32.Interop;
using Windows.Win32.Foundation.Metadata;

namespace Windows.Win32.System.Iis
{
Expand Down
2 changes: 1 addition & 1 deletion generation/WinSDK/manual/Ioctl.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System;
using System.Runtime.InteropServices;
using Windows.Win32.Interop;
using Windows.Win32.Foundation.Metadata;

namespace Windows.Win32.System.Ioctl
{
Expand Down
2 changes: 1 addition & 1 deletion generation/WinSDK/manual/JobObjects.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System;
using System.Runtime.InteropServices;
using Windows.Win32.Interop;
using Windows.Win32.Foundation.Metadata;

namespace Windows.Win32.System.JobObjects
{
Expand Down
2 changes: 1 addition & 1 deletion generation/WinSDK/manual/Js.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System;
using System.Runtime.InteropServices;
using Windows.Win32.Interop;
using Windows.Win32.Foundation.Metadata;

namespace Windows.Win32.System.Js
{
Expand Down
2 changes: 1 addition & 1 deletion generation/WinSDK/manual/Kernel.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System;
using System.Runtime.InteropServices;
using Windows.Win32.Interop;
using Windows.Win32.Foundation.Metadata;

namespace Windows.Win32.System.Kernel
{
Expand Down
2 changes: 1 addition & 1 deletion generation/WinSDK/manual/MediaFoundation.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System;
using System.Runtime.InteropServices;
using Windows.Win32.Interop;
using Windows.Win32.Foundation.Metadata;

namespace Windows.Win32.Media.MediaFoundation
{
Expand Down
Loading

0 comments on commit 45869a0

Please sign in to comment.