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

Mark System.Runtime APIs Supported on Windows #42030

Merged
merged 3 commits into from
Sep 14, 2020

Conversation

mdh1418
Copy link
Member

@mdh1418 mdh1418 commented Sep 9, 2020

all mono M:System.ArgIterator.#ctor(System.RuntimeArgumentHandle),System,ArgIterator,.ctor(RuntimeArgumentHandle),0
all mono "M:System.ArgIterator.#ctor(System.RuntimeArgumentHandle,System.Void*)",System,ArgIterator,".ctor(RuntimeArgumentHandle, Void*)",0
serialization "M:System.Delegate.GetObjectData(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext)",System,Delegate,"GetObjectData(SerializationInfo, StreamingContext)",0
all PNSE M:System.Exception.remove_SerializeObjectState(System.EventHandler{System.Runtime.Serialization.SafeSerializationEventArgs}),System,Exception,remove_SerializeObjectState(EventHandler<SafeSerializationEventArgs>),0
all PNSE M:System.Exception.add_SerializeObjectState(System.EventHandler{System.Runtime.Serialization.SafeSerializationEventArgs}),System,Exception,add_SerializeObjectState(EventHandler<SafeSerializationEventArgs>),0
all mono M:System.GC.GetGCMemoryInfo(System.GCKind),System,GC,GetGCMemoryInfo(GCKind),0
serialization "M:System.RuntimeFieldHandle.GetObjectData(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext)",System,RuntimeFieldHandle,"GetObjectData(SerializationInfo, StreamingContext)",0
serialization "M:System.RuntimeMethodHandle.GetObjectData(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext)",System,RuntimeMethodHandle,"GetObjectData(SerializationInfo, StreamingContext)",0
serialization "M:System.RuntimeTypeHandle.GetObjectData(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext)",System,RuntimeTypeHandle,"GetObjectData(SerializationInfo, StreamingContext)",0
Partially PNSE M:System.String.IsNormalized(System.Text.NormalizationForm),System,String,IsNormalized(NormalizationForm),3
Partially PNSE M:System.String.Normalize(System.Text.NormalizationForm),System,String,Normalize(NormalizationForm),3
Not implemented by design M:System.Type.GetType(System.String),System,Type,GetType(String),3
Not implemented by design "M:System.Type.GetType(System.String,System.Boolean,System.Boolean)",System,Type,"GetType(String, Boolean, Boolean)",3
all mono "M:System.Type.GetTypeFromCLSID(System.Guid,System.String,System.Boolean)",System,Type,"GetTypeFromCLSID(Guid, String, Boolean)",0
all mono "M:System.Type.GetTypeFromProgID(System.String,System.String,System.Boolean)",System,Type,"GetTypeFromProgID(String, String, Boolean)",0
all mono M:System.Type.GetTypeFromProgID(System.String),System,Type,GetTypeFromProgID(String),1
all mono "M:System.Type.GetTypeFromProgID(System.String,System.Boolean)",System,Type,"GetTypeFromProgID(String, Boolean)",1
all mono M:System.Type.GetTypeFromCLSID(System.Guid),System,Type,GetTypeFromCLSID(Guid),1
all mono "M:System.Type.GetTypeFromProgID(System.String,System.String)",System,Type,"GetTypeFromProgID(String, String)",1
all mono "M:System.Type.GetTypeFromCLSID(System.Guid,System.Boolean)",System,Type,"GetTypeFromCLSID(Guid, Boolean)",1
all PNSE "M:System.Type.ReflectionOnlyGetType(System.String,System.Boolean,System.Boolean)",System,Type,"ReflectionOnlyGetType(String, Boolean, Boolean)",0
Not implemented by design "M:System.Type.GetType(System.String,System.Boolean)",System,Type,"GetType(String, Boolean)",3
all mono "M:System.Type.GetTypeFromCLSID(System.Guid,System.String)",System,Type,"GetTypeFromCLSID(Guid, String)",1

Of the APIs listed to be marked as unsupported, many were serialization related (had System.Runtime.Serialization.SerializationInfo as a parameter), throw PNSE everywhere, or throw PNSE on mono.

This PR marks System.Type.GetTypeFromCLSID and System.Type.GetTypeFromProgID as Supported on Windows only.

@mdh1418 mdh1418 added arch-wasm WebAssembly architecture area-System.Runtime labels Sep 9, 2020
@mdh1418
Copy link
Member Author

mdh1418 commented Sep 9, 2020

The remaining methods seem like false-positives, but I wasn't sure. @MaximLipnin @steveisok could y'all take a look?

@jkotas
Copy link
Member

jkotas commented Sep 9, 2020

The remaining methods seem like false-positives,

Agree.

@jkotas
Copy link
Member

jkotas commented Sep 9, 2020

System.Type.GetTypeFromCLSID
System.Type.GetTypeFromProgID

It may make sense to mark these as Windows-specific.

@mdh1418
Copy link
Member Author

mdh1418 commented Sep 11, 2020

Both System.String.IsNormalized(System.Text.NormalizationForm) and System.String.Normalize(System.Text.NormalizationForm) work on Browser except for when NormalizationForm is NormalizationForm.FormKC or NormalizationForm.FormKD.

if (OperatingSystem.IsBrowser() && (normalizationForm == NormalizationForm.FormKC || normalizationForm == NormalizationForm.FormKD))
.

Since the method is partially supported, and there's currently no solution to mark this for the compatibility analyzer, the two APIs will not be marked as unsupported

@mdh1418 mdh1418 force-pushed the mdhwang/system_runtime_unsupported branch from d4a9a12 to bcd79f0 Compare September 11, 2020 17:55
@mdh1418 mdh1418 changed the title [wasm] Mark System.Runtime APIs unsupported on browser [wasm] Mark System.Runtime APIs Supported on Windows Sep 11, 2020
@mdh1418 mdh1418 changed the title [wasm] Mark System.Runtime APIs Supported on Windows Mark System.Runtime APIs Supported on Windows Sep 14, 2020
@mdh1418 mdh1418 marked this pull request as ready for review September 14, 2020 13:22
@safern safern merged commit 470858f into dotnet:master Sep 14, 2020
@mdh1418 mdh1418 deleted the mdhwang/system_runtime_unsupported branch September 15, 2020 19:28
@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.
Labels
arch-wasm WebAssembly architecture area-System.Runtime
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants