Skip to content

Commit

Permalink
Remove MarshalLocal proxy for IsTypeVisibleFromCom (#9609)
Browse files Browse the repository at this point in the history
  • Loading branch information
h3xds1nz authored Oct 8, 2024
1 parent f4b5926 commit f07e041
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 20 deletions.
14 changes: 0 additions & 14 deletions src/Microsoft.DotNet.Wpf/src/PresentationFramework/MarshalLocal.cs

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@
<Compile Include="$(WpfSharedDir)\Telemetry\Managed\TelemetryEventSource.cs" />
<Compile Include="$(WpfSharedDir)\Telemetry\Managed\TraceLoggingProvider.cs" />
<Compile Include="$(WpfSharedDir)\Telemetry\Managed\TraceLoggers\ControlsTraceLogger.cs" />
<Compile Include="MarshalLocal.cs" />
<Compile Include="Microsoft\Win32\CommonDialog.cs" />
<Compile Include="Microsoft\Win32\CommonItemDialog.cs" />
<Compile Include="Microsoft\Win32\FileDialog.cs" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ public object ObjectForScripting
{
Type t = value.GetType();

if (!System.Runtime.InteropServices.MarshalLocal.IsTypeVisibleFromCom(t))
if (!Marshal.IsTypeVisibleFromCom(t))
{
throw new ArgumentException(SR.NeedToBeComVisible);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -285,8 +285,7 @@ internal unsafe bool TryFindMemberAndInvokeNonWrapped(string memberName, int fla
// model, we rather throw instead. This Try-method allows internal lookups without directly
// throwing on non-fatal "member not found" situations, as we might want to have more complex
// fallback logic (as in ToString).
int dispid;
if (!TryGetDispIdForMember(memberName, cacheDispId, out dispid))
if (!TryGetDispIdForMember(memberName, cacheDispId, out int dispId))
{
return false;
}
Expand Down Expand Up @@ -358,7 +357,7 @@ internal unsafe bool TryFindMemberAndInvokeNonWrapped(string memberName, int fla
// by the CLR. Therefore we also check for the IsCOMObject property. It also seems
// COM interop special-cases DateTime as it's not revealed to be visible by any
// of the first two checks below.
if (!MarshalLocal.IsTypeVisibleFromCom(argType) &&
if (!Marshal.IsTypeVisibleFromCom(argType) &&
!argType.IsCOMObject && argType != typeof(DateTime))
{
throw new ArgumentException(SR.NeedToBeComVisible);
Expand All @@ -371,7 +370,7 @@ internal unsafe bool TryFindMemberAndInvokeNonWrapped(string memberName, int fla
}

NativeMethods.EXCEPINFO exInfo = new NativeMethods.EXCEPINFO();
HRESULT hr = InvokeOnScriptObject(dispid, flags, dp, exInfo, out result);
HRESULT hr = InvokeOnScriptObject(dispId, flags, dp, exInfo, out result);

if (hr.Failed)
{
Expand Down

0 comments on commit f07e041

Please # to comment.