From 07561a141986ce0454c83687dfac12525ee24cd6 Mon Sep 17 00:00:00 2001 From: dahall Date: Tue, 9 Feb 2021 09:18:31 -0700 Subject: [PATCH] Added CoClassAttribute to IContextCallback --- PInvoke/Ole/Ole32/CtxtCall.cs | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/PInvoke/Ole/Ole32/CtxtCall.cs b/PInvoke/Ole/Ole32/CtxtCall.cs index 168b2a54..c162d033 100644 --- a/PInvoke/Ole/Ole32/CtxtCall.cs +++ b/PInvoke/Ole/Ole32/CtxtCall.cs @@ -6,6 +6,15 @@ namespace Vanara.PInvoke { public static partial class Ole32 { + /// CLSID_ContextSwitcher + public static readonly Guid CLSID_ContextSwitcher = new Guid(0x0000034e, 0x0000, 0x0000, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46); + + /// IID_ICallbackWithNoReentrancyToApplicationSTA + public static readonly Guid IID_ICallbackWithNoReentrancyToApplicationSTA = new Guid(0x0a299774, 0x3e4e, 0xfc42, 0x1d, 0x9d, 0x72, 0xce, 0xe1, 0x05, 0xca, 0x57); + + /// IID_IEnterActivityWithNoLock + public static readonly Guid IID_IEnterActivityWithNoLock = new Guid(0xd7174f82, 0x36b8, 0x4aa8, 0x80, 0x0a, 0xe9, 0x63, 0xab, 0x2d, 0xfa, 0xb9); + /// /// The function to be called inside the object context if . @@ -20,7 +29,7 @@ namespace Vanara.PInvoke /// An instance of this interface for the current context can be obtained using CoGetObjectContext. // https://docs.microsoft.com/en-us/windows/win32/api/ctxtcall/nn-ctxtcall-icontextcallback [PInvokeData("ctxtcall.h", MSDNShortId = "NN:ctxtcall.IContextCallback")] - [ComImport, Guid("000001da-0000-0000-C000-000000000046"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] + [ComImport, Guid("000001da-0000-0000-C000-000000000046"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown), CoClass(typeof(ContextSwitcher))] public interface IContextCallback { /// Enters the object context, executes the specified function, and returns. @@ -88,14 +97,5 @@ namespace Vanara.PInvoke int iMethod, IntPtr pUnk = new IntPtr()); } - - /// CLSID_ContextSwitcher - public static readonly Guid CLSID_ContextSwitcher = new Guid(0x0000034e, 0x0000, 0x0000, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46); - - /// IID_IEnterActivityWithNoLock - public static readonly Guid IID_IEnterActivityWithNoLock = new Guid(0xd7174f82, 0x36b8, 0x4aa8, 0x80, 0x0a, 0xe9, 0x63, 0xab, 0x2d, 0xfa, 0xb9); - - /// IID_ICallbackWithNoReentrancyToApplicationSTA - public static readonly Guid IID_ICallbackWithNoReentrancyToApplicationSTA = new Guid(0x0a299774, 0x3e4e, 0xfc42, 0x1d, 0x9d, 0x72, 0xce, 0xe1, 0x05, 0xca, 0x57); } } \ No newline at end of file