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.
This commit is contained in:
Silent 2024-10-28 22:36:50 +01:00
parent f1d85b825b
commit 17baa64613
No known key found for this signature in database
GPG Key ID: AE53149BB0C45AF1

View File

@ -2719,7 +2719,7 @@ namespace NewResolutionSelectionDialog
if (msg == WM_INITDIALOG)
{
const WrappedDialocFunc* data = reinterpret_cast<WrappedDialocFunc*>(lParam);
SetWindowLongPtr(window, GWLP_USERDATA, reinterpret_cast<LONG_PTR>(data->lpDialogFunc));
SetWindowLongPtr(window, DWLP_USER, reinterpret_cast<LONG_PTR>(data->lpDialogFunc));
data->lpDialogFunc(window, msg, wParam, data->dwInitParam);
@ -2758,7 +2758,7 @@ namespace NewResolutionSelectionDialog
}
}
DLGPROC origProc = reinterpret_cast<DLGPROC>(GetWindowLongPtr(window, GWLP_USERDATA));
DLGPROC origProc = reinterpret_cast<DLGPROC>(GetWindowLongPtr(window, DWLP_USER));
if (origProc != nullptr)
{
return origProc(window, msg, wParam, lParam);