From 257a60878da68465da7fedd0085196d00bc1aeb7 Mon Sep 17 00:00:00 2001 From: Fredrik Orderud Date: Tue, 19 Jul 2022 00:40:29 +0200 Subject: [PATCH] SandboxTest: Also load and register the Image3dAPI type library to enable marshsaling of the corresponding interfaces. --- SandboxTest/Main.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/SandboxTest/Main.cpp b/SandboxTest/Main.cpp index 5e88c3d..627ca7a 100644 --- a/SandboxTest/Main.cpp +++ b/SandboxTest/Main.cpp @@ -198,6 +198,21 @@ int wmain(int argc, wchar_t *argv[]) { } } + // register type library to enable out-of-proc Image3dAPI calls + // only works if running as admin + CComPtr typelib; + HRESULT hr = LoadTypeLibEx(L"Image3dAPI.tlb", REGKIND_REGISTER, &typelib); + CHECK(hr); + +#if 0 + // unregister type library + TLIBATTR * tlb_attr = nullptr; + CHECK(typelib->GetLibAttr(&tlb_attr)); + hr = UnRegisterTypeLib(tlb_attr->guid, tlb_attr->wMajorVerNum, tlb_attr->wMinorVerNum, tlb_attr->lcid, tlb_attr->syskind); + CHECK(hr); + typelib->ReleaseTLibAttr(tlb_attr); +#endif + // create loader in a separate "low integrity" dllhost.exe process CComPtr loader; CComPtr source;