Clean up stale editor-hInstance comments, add isOwnModulePath edge tests

Drops a false claim about ReaSampler's own editor's hInstance, corrects the real reason for registering the wndproc class against our own module, and covers isOwnModulePath's separator edge cases.
This commit is contained in:
2026-09-25 14:15:36 -04:00
parent faa513cafb
commit 7e523b0505
3 changed files with 21 additions and 6 deletions
+4 -4
View File
@@ -36,10 +36,10 @@ const std::wstring& childClassName() {
// The module holding a given code address — used to resolve THIS wndProc's own module rather
// than the parent's hInstance REAPER hands us. Registering against the parent would put the class
// in REAPER's own module, where a second .vst3 (the other channel) sharing that hInstance could
// collide on the (now channel-forked) name, and any lookup-by-class would resolve into the wrong
// binary. Takes the address rather than naming wndProc directly so a free function in this
// anonymous namespace doesn't need access to the private member.
// in REAPER's own module while the wndproc still points into our DLL — a dangling procedure
// pointer once our DLL unloads but REAPER's class registration outlives it. Takes the address
// rather than naming wndProc directly so a free function in this anonymous namespace doesn't need
// access to the private member.
HMODULE moduleHandleFor(void* codeAddress) {
HMODULE mod = nullptr;
GetModuleHandleExW(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS |