diff options
-rw-r--r-- | rtl/win/wininc/defines.inc | 7 | ||||
-rw-r--r-- | tests/test/tstdhandle.pp | 12 |
2 files changed, 16 insertions, 3 deletions
diff --git a/rtl/win/wininc/defines.inc b/rtl/win/wininc/defines.inc index 21d0b2afea..81bf1a68fb 100644 --- a/rtl/win/wininc/defines.inc +++ b/rtl/win/wininc/defines.inc @@ -1696,9 +1696,10 @@ SIF_RANGE = 1; SIF_DISABLENOSCROLL = 8; { GetStdHandle } - STD_INPUT_HANDLE = HANDLE(-10); - STD_OUTPUT_HANDLE = HANDLE(-11); - STD_ERROR_HANDLE = HANDLE(-12); + { !!! The 3 following constants are NOT handles. They remain 32-bit on Win64. } + STD_INPUT_HANDLE = DWORD(-10); + STD_OUTPUT_HANDLE = DWORD(-11); + STD_ERROR_HANDLE = DWORD(-12); diff --git a/tests/test/tstdhandle.pp b/tests/test/tstdhandle.pp new file mode 100644 index 0000000000..037dd7d2e0 --- /dev/null +++ b/tests/test/tstdhandle.pp @@ -0,0 +1,12 @@ +{ %TARGET=win64 } +uses + Windows; + +{ The STD_xxx_HANDLE constants remain 32-bit in 64-bit Windows. } +{$warnings off} // unreachable code warnings when things are correct. +begin + if STD_INPUT_HANDLE > High(DWORD) then Halt(1); + if STD_OUTPUT_HANDLE > High(DWORD) then Halt(2); + if STD_ERROR_HANDLE > High(DWORD) then Halt(3); + Halt(0); +end.
\ No newline at end of file |