On Mon Jun 19 12:46:00 2023 +0000, Jinoh Kang wrote:
There is a memory leak. `GetCurrentActCtx` outputs a reference-counted handle that shall be freed later with [`ReleaseActCtx`]. Also, note that `GetCurrentActCtx` is not supposed to output `INVALID_HANDLE_VALUE` on failure. [`ReleaseActCtx`]: https://learn.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-relea...
if (!GetCurrentActCtx(&This->user_actctx)) { ERR("Failed to get current activation context, last error %lx\n", GetLastError()); This->user_actctx = INVALID_HANDLE_VALUE; }
Well that's embarrassing of me, thank you for catching this. Also added the `INVALID_HANDLE_VALUE` check in `DLL_PROCESS_DETACH` seeing how most of `ReleaseActCtx` usage does the same thing.