test: vendor node-is-valid-window (#39965)
This commit is contained in:
parent
fdf1ecec47
commit
18f517d8a6
13 changed files with 181 additions and 14 deletions
14
spec/is-valid-window/src/impl_win.cc
Normal file
14
spec/is-valid-window/src/impl_win.cc
Normal 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
|
Loading…
Add table
Add a link
Reference in a new issue