Can Windows inherit the intersection of a 32-bit / 64-bit border?

Is it possible for a child process to inherit a handle from its parent process if one of the processes is 32-bit and the other 64-bit?

HANDLE is a 64-bit type on Win64 and a 32-bit type on Win32, which suggests that even this should be possible in all cases, there would be cases when it failed: 64-bit parent process, 32-bit child a process and a descriptor that cannot be represented in 32 bits.

Or assigns an object the only way for a 32-bit process and a 64-bit process to get a handle for the same object?

+5
source share
2 answers

If it is a file descriptor or another kernel descriptor, then yes.

It just happens that although the HANDLE is a 64-bit type, it can always be converted to 32 bits and vice versa for any valid descriptor value.

GDI handlers cannot be inherited.

+7
source

, 32- 64- , , . , 32-63 31. , 0x80000000 0xFFFFFFFF80000000, 0x0000000080000000. , 32- 64- ( , - , - ​​, .)

. : SO ( Windows HANDLE 64- ?)

0

All Articles