commit d82f8bc4a3a4b11c0b2d018eefe665f6d52f64f0
parent 9b2bf0b1d578a355302161fc86d67b96149a041a
Author: Jack Mordaunt <jackmordaunt.dev@gmail.com>
Date: Thu, 16 Mar 2023 12:22:24 +0800
bind: use predefined RoRegisterClassObject
Instead of wrapping it and exposing it in our DLL.
Signed-off-by: Jack Mordaunt <jackmordaunt.dev@gmail.com>
Diffstat:
3 files changed, 3 insertions(+), 15 deletions(-)
diff --git a/internal/bind/proc.go b/internal/bind/proc.go
@@ -8,9 +8,11 @@ import (
)
var (
+ modcombase = windows.NewLazySystemDLL("combase.dll")
+ procRegisterClassObject = modcombase.NewProc("RoRegisterClassObject")
+
toast = windows.NewLazyDLL("toast.dll")
procSetActivationCallback = toast.NewProc("SetActivationCallback")
- procRegisterClassObject = toast.NewProc("RegisterClassObject")
procMalloc = toast.NewProc("Malloc")
procFree = toast.NewProc("Free")
procNewClassFactory = toast.NewProc("NewClassFactory")
diff --git a/internal/c-lib/toast.c b/internal/c-lib/toast.c
@@ -232,20 +232,6 @@ Free(void* object) {
free(object);
}
-// RegisterClassObject exports CoRegisterClassObject since package ole does not
-// offer this function.
-__declspec(dllexport)
-HRESULT
-RegisterClassObject(
- REFCLSID rclsid,
- LPUNKNOWN pUnk,
- DWORD dwClsContext,
- DWORD flags,
- LPDWORD lpdwRegister
-) {
- return CoRegisterClassObject(rclsid, pUnk, dwClsContext, flags, lpdwRegister);
-}
-
// NewClassFactory allocates a ClassFactory.
// If the pointer is NULL we are out of memory.
__declspec(dllexport)
diff --git a/toast.dll b/toast.dll
Binary files differ.