Replies: 1 comment 5 replies
-
I don't think we'll ever find out the reason behind this code... It should be fine to do this, right? /cc: @AaronRobinsonMSFT diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Control.ActiveXFontMarshaler.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Control.ActiveXFontMarshaler.cs
index b8d6c9df2..a5ae9a488 100644
--- a/src/System.Windows.Forms/src/System/Windows/Forms/Control.ActiveXFontMarshaler.cs
+++ b/src/System.Windows.Forms/src/System/Windows/Forms/Control.ActiveXFontMarshaler.cs
@@ -48,17 +48,7 @@ namespace System.Windows.Forms
Guid iid = typeof(Ole32.IFont).GUID;
Ole32.IFont oleFont = Oleaut32.OleCreateFontIndirect(ref fontDesc, in iid);
IntPtr pFont = Marshal.GetIUnknownForObject(oleFont);
-
- int hr = Marshal.QueryInterface(pFont, ref iid, out IntPtr pIFont);
-
- Marshal.Release(pFont);
-
- if (((HRESULT)hr).Failed())
- {
- Marshal.ThrowExceptionForHR(hr);
- }
-
- return pIFont;
+ return pFont;
} |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
winforms/src/System.Windows.Forms/src/System/Windows/Forms/Control.ActiveXFontMarshaler.cs
Lines 48 to 61 in 1bcfb9d
I found it quite strange to create RCW out of IFont Com pointer to later convert it to IUnknow and then QI to IFont again.
Beta Was this translation helpful? Give feedback.
All reactions