From 17baa64613d457f252d2efa9076d0932fb42a8a5 Mon Sep 17 00:00:00 2001 From: Silent Date: Mon, 28 Oct 2024 22:36:50 +0100 Subject: [PATCH] SA: Use DWLP_USER in the resolution dialog GWLP_USERDATA was unlikely to cause issues, but it's technically reserved since we didn't create the window class ourselves. DWLP_USER is guaranteed to be free for us to use. --- SilentPatchSA/SilentPatchSA.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SilentPatchSA/SilentPatchSA.cpp b/SilentPatchSA/SilentPatchSA.cpp index 5a181ab..87cf3ff 100644 --- a/SilentPatchSA/SilentPatchSA.cpp +++ b/SilentPatchSA/SilentPatchSA.cpp @@ -2719,7 +2719,7 @@ namespace NewResolutionSelectionDialog if (msg == WM_INITDIALOG) { const WrappedDialocFunc* data = reinterpret_cast(lParam); - SetWindowLongPtr(window, GWLP_USERDATA, reinterpret_cast(data->lpDialogFunc)); + SetWindowLongPtr(window, DWLP_USER, reinterpret_cast(data->lpDialogFunc)); data->lpDialogFunc(window, msg, wParam, data->dwInitParam); @@ -2758,7 +2758,7 @@ namespace NewResolutionSelectionDialog } } - DLGPROC origProc = reinterpret_cast(GetWindowLongPtr(window, GWLP_USERDATA)); + DLGPROC origProc = reinterpret_cast(GetWindowLongPtr(window, DWLP_USER)); if (origProc != nullptr) { return origProc(window, msg, wParam, lParam);