commit c3fe500c5a3b13325de906947799b8986cb4b32f parent d84747fae5b1d0479b9658a38744530e99e257d8 Author: Jack Mordaunt <jackmordaunt.dev@gmail.com> Date: Mon, 13 Mar 2023 12:56:00 +0800 c-lib: export initializers It feels wrong to force the caller to use a third-party means to initialize the Windows Runtime. The caller _can_ use ole.{Co,Ro}Initialize, and we likely will, however including functions to do the same seems like a good approach. Signed-off-by: Jack Mordaunt <jackmordaunt.dev@gmail.com> Diffstat:
| M | internal/c-lib/toast.c | | | 11 | ++++++++++- |
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/internal/c-lib/toast.c b/internal/c-lib/toast.c @@ -809,8 +809,17 @@ void Fire(void) { _cb(1); } +// Init exports RoInitialize. For go-ole we can use the ole provided function instead. +// This allows the consumer to handle initialization without relying on a third-party. __declspec(dllexport) -HRESULT Wrap_RoInitialize(RO_INIT_TYPE roInit) { +HRESULT Init(RO_INIT_TYPE roInit) { return RoInitialize(roInit); } +// Uninit exports RoUninitialize. For go-ole we can use the ole provided function instead. +// This allows the consumer to handle uninitialization without relying on a third-party. +__declspec(dllexport) +void Uninit() { + return RoUninitialize(); +} +