Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,7 @@ protected override object CreateObject(IntPtr externalComObject, CreateObjectFla
Debug.Assert(flags == CreateObjectFlags.UniqueInstance);

Guid pictureIID = IPicture.IID;
#if NET8_0_OR_GREATER
int hr = Marshal.QueryInterface(externalComObject, in pictureIID, out IntPtr comObject);
#else
int hr = Marshal.QueryInterface(externalComObject, ref pictureIID, out IntPtr comObject);
#endif
if (hr == S_OK)
{
return new PictureWrapper(comObject);
Expand All @@ -78,12 +74,7 @@ internal static IStreamWrapper GetComWrapper(Ole32.IStream stream)
IntPtr streamWrapperPtr = Instance.GetOrCreateComInterfaceForObject(stream, CreateComInterfaceFlags.None);

Guid streamIID = IID_IStream;

#if NET8_0_OR_GREATER
int hr = Marshal.QueryInterface(streamWrapperPtr, in streamIID, out IntPtr streamPtr);
#else
int hr = Marshal.QueryInterface(streamWrapperPtr, ref streamIID, out IntPtr streamPtr);
#endif

Marshal.Release(streamWrapperPtr);

Expand Down Expand Up @@ -321,11 +312,7 @@ public unsafe int SaveAsFile(IntPtr pstm, int fSaveMemCopy, int* pcbSize)
// Get the IStream implementation, since the ComWrappers runtime returns a pointer to the IUnknown interface implementation
Guid streamIID = IID_IStream;

#if NET8_0_OR_GREATER
ThrowExceptionForHR(Marshal.QueryInterface(pstm, in streamIID, out IntPtr pstmImpl));
#else
ThrowExceptionForHR(Marshal.QueryInterface(pstm, ref streamIID, out IntPtr pstmImpl));
#endif

try
{
Expand Down