test: vendor node-is-valid-window (#39965)

This commit is contained in:
David Sanders 2023-09-25 03:43:57 -07:00 committed by GitHub
parent fdf1ecec47
commit 18f517d8a6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 181 additions and 14 deletions

View file

@ -0,0 +1,14 @@
#include "impl.h"
#include <windows.h>
namespace impl {
bool IsValidWindow(char* handle, size_t size) {
if (size != sizeof(HWND))
return false;
HWND window = *reinterpret_cast<HWND*>(handle);
return ::IsWindow(window);
}
} // namespace impl