[client,windows] Add window handle validation in RDP_EVENT_TYPE_WINDOW_NEW

This commit is contained in:
tsz8899
2026-02-06 13:48:47 +08:00
parent 5c7aae27d0
commit b8a7e2ddf0

View File

@@ -454,6 +454,11 @@ static BOOL wf_post_connect(freerdp* instance)
{
wfc->hwnd = CreateWindowEx(0, wfc->wndClassName, wfc->window_title, dwStyle, 0, 0, 0, 0,
wfc->hWndParent, NULL, wfc->hInstance, NULL);
if (!wfc->hwnd)
{
WLog_ERR(TAG, "CreateWindowEx failed with error: %lu", GetLastError());
return FALSE;
}
SetWindowLongPtr(wfc->hwnd, GWLP_USERDATA, (LONG_PTR)wfc);
}