Skip to content

Add additional Windows-specific APIs#40610

Merged
adamsitnik merged 9 commits into
dotnet:masterfrom
adamsitnik:additionalWindowsSpecificAPIs
Aug 11, 2020
Merged

Add additional Windows-specific APIs#40610
adamsitnik merged 9 commits into
dotnet:masterfrom
adamsitnik:additionalWindowsSpecificAPIs

Conversation

@adamsitnik
Copy link
Copy Markdown
Member

A follow up of dotnet/designs#142

@Dotnet-GitSync-Bot
Copy link
Copy Markdown
Collaborator

I couldn't figure out the best area label to add to this PR. If you have write-permissions please help me learn by adding exactly one area label.

@terrajobst
Copy link
Copy Markdown
Contributor

terrajobst commented Aug 11, 2020

I wrote a tool to extract these attributes from reference assemblies. I've looked at the report and the only thing that is missing from spec is this: System.Security.Cryptography.CspParameters. Was that intentional?

/cc @bartonjs

/// this <see cref="ComWrappers" /> instance, the previously created COM interface will be returned.
/// If not, a new one will be created.
/// </remarks>
[SupportedOSPlatform("windows")]
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we just mark the whole type as windows specific?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems reasonable to me

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done.

BTW how should we handle nested types? If class B is nested within class A which is Windows-specific, should B be Windows-specific OOTB as well?

[SupportedOSPlatform("windows")]
public class A
{
    public class B { }
}

/cc @buyaa-n

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If class B is nested within class A which is Windows-specific, should B be Windows-specific OOTB as well?

Yes, I would assume so. The same with any other scope - if a class is marked OS-specific, all the methods in it are OS-specific. If an assembly is marked OS-specific, all the types in it are OS-specific.

@adamsitnik adamsitnik merged commit 77b752b into dotnet:master Aug 11, 2020
@adamsitnik adamsitnik deleted the additionalWindowsSpecificAPIs branch August 11, 2020 14:18
_innerEventInfo = type.GetEvent(eventName)!;
}

[SupportedOSPlatform("windows")]
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems like the whole ComAwareEventInfo class should be marked as Windows-specific. In general, nothing "COM" specific will work outside of Windows.

@ghost ghost locked as resolved and limited conversation to collaborators Dec 7, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants