You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I believe I can make d3d9 hwnd handling 100% sound.
Validate HWND on creation
GetWindowThreadProcessId can be used to get an HWNDs creating thread and process IDs.
These can be used to enforce that device creation is only done with an appropriate, valid HWND.
I believe I can make d3d9 hwnd handling 100% sound.
Validate HWND on creation
GetWindowThreadProcessId
can be used to get anHWND
s creating thread and process IDs.These can be used to enforce that device creation is only done with an appropriate, valid HWND.
GetCurrentProcessId
GetCurrentThreadId
Validation failures can be coerced to Result s, which should be 100% defined behavior.
Detect Device outliving HWND
Now, to detect when an
HWND
is yanked out from under a device:Option 1: Hooks
SetWindowsHookExW
(WH_CALLWNDPROCRET, ...)High overhead - hooks every wndproc, including for window handles we don't really care much about.
Option 2: Patch WNDPROCs
SetWindowLongPtrW
(hwnd, GWLP_WNDPROC, ...)Saner, probably? Note that
CallWindowProcW
is required to call the original WNDPROC sanely.Error Handling
bugsalot::bug!(...)
+std::process::abort()
?The text was updated successfully, but these errors were encountered: