diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/OLE/DragDropHelper.cs b/src/System.Windows.Forms/src/System/Windows/Forms/OLE/DragDropHelper.cs index 0d60be55fde..bc698519a31 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/OLE/DragDropHelper.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/OLE/DragDropHelper.cs @@ -520,7 +520,7 @@ private static bool TryGetDragDropHelper(TDragHelper** dragDropHelp throw new InvalidOperationException(SR.ThreadMustBeSTA); } - HRESULT hr = PInvoke.CoCreateInstance( + HRESULT hr = PInvokeCore.CoCreateInstance( in CLSID.DragDropHelper, pUnkOuter: null, CLSCTX.CLSCTX_INPROC_SERVER, diff --git a/src/System.Windows.Forms/tests/IntegrationTests/UIIntegrationTests/DragDropTests.cs b/src/System.Windows.Forms/tests/IntegrationTests/UIIntegrationTests/DragDropTests.cs index eb449ecdc47..95ebd897c64 100644 --- a/src/System.Windows.Forms/tests/IntegrationTests/UIIntegrationTests/DragDropTests.cs +++ b/src/System.Windows.Forms/tests/IntegrationTests/UIIntegrationTests/DragDropTests.cs @@ -543,7 +543,7 @@ await RunFormWithoutControlAsync( private unsafe bool TryGetUIAutomation(IUIAutomation** uiAutomation) { Guid CLSID_CUIAutomation = new("FF48DBA4-60EF-4201-AA87-54103EEF594E"); - HRESULT hr = PInvoke.CoCreateInstance( + HRESULT hr = PInvokeCore.CoCreateInstance( in CLSID_CUIAutomation, pUnkOuter: null, CLSCTX.CLSCTX_INPROC_SERVER, diff --git a/src/System.Windows.Forms/tests/InteropTests/PropertyGridTests.cs b/src/System.Windows.Forms/tests/InteropTests/PropertyGridTests.cs index 04114a76ab5..6167e87cb21 100644 --- a/src/System.Windows.Forms/tests/InteropTests/PropertyGridTests.cs +++ b/src/System.Windows.Forms/tests/InteropTests/PropertyGridTests.cs @@ -122,7 +122,7 @@ private unsafe void ExecuteWithActivationContext(string applicationManifest, Act private unsafe object CreateComObjectWithRawIErrorInfoUsage() { Guid clsidRawErrorInfoUsageTest = new("0ED8EE0D-22E3-49EA-850C-E69B20D1F296"); - PInvoke.CoCreateInstance( + PInvokeCore.CoCreateInstance( in clsidRawErrorInfoUsageTest, pUnkOuter: null, CLSCTX.CLSCTX_INPROC_SERVER, @@ -133,7 +133,7 @@ private unsafe object CreateComObjectWithRawIErrorInfoUsage() private unsafe object CreateComObjectWithStandardIErrorInfoUsage() { Guid clsidStandardErrorInfoUsageTest = new("EA1FCB3A-277C-4C79-AB85-E2ED3E858201"); - PInvoke.CoCreateInstance( + PInvokeCore.CoCreateInstance( in clsidStandardErrorInfoUsageTest, pUnkOuter: null, CLSCTX.CLSCTX_INPROC_SERVER, diff --git a/src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/ComponentModel/Com2Interop/ComNativeDescriptorTests.cs b/src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/ComponentModel/Com2Interop/ComNativeDescriptorTests.cs index 695116ab18e..3bd912db6ca 100644 --- a/src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/ComponentModel/Com2Interop/ComNativeDescriptorTests.cs +++ b/src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/ComponentModel/Com2Interop/ComNativeDescriptorTests.cs @@ -90,7 +90,7 @@ public void ComNativeDescriptor_GetProperties_FromIPicture() public void ComNativeDescriptor_GetProperties_FromActiveXMediaPlayerControl_ComInterop() { Guid guid = typeof(WindowsMediaPlayerClass).GUID; - HRESULT hr = PInvoke.CoCreateInstance( + HRESULT hr = PInvokeCore.CoCreateInstance( in guid, pUnkOuter: null, CLSCTX.CLSCTX_INPROC_SERVER,