Преглед изворни кода

--- Merging r17333 into '.':
U rtl/win/wininc/defines.inc
A tests/test/tstdhandle.pp

# revisions: 17333
------------------------------------------------------------------------
r17333 | sergei | 2011-04-18 00:27:56 +0200 (Mon, 18 Apr 2011) | 2 lines
Changed paths:
M /trunk/rtl/win/wininc/defines.inc
A /trunk/tests/test/tstdhandle.pp

* Reverted STD_xxx_HANDLE constants back to DWORD type (issue introduced in r15824). These are not handles, and are 32-bit even in Win64. See http://msdn.microsoft.com/en-us/library/ms683231.aspx
+ added a test to help detecting this happening again.
------------------------------------------------------------------------

git-svn-id: branches/fixes_2_4@17621 -

marco пре 14 година
родитељ
комит
29183a1c1e
3 измењених фајлова са 17 додато и 3 уклоњено
  1. 1 0
      .gitattributes
  2. 4 3
      rtl/win/wininc/defines.inc
  3. 12 0
      tests/test/tstdhandle.pp

+ 1 - 0
.gitattributes

@@ -8817,6 +8817,7 @@ tests/test/tset6.pp svneol=native#text/plain
 tests/test/tset7.pp svneol=native#text/plain
 tests/test/tsetsize.pp svneol=native#text/plain
 tests/test/tstack.pp svneol=native#text/plain
+tests/test/tstdhandle.pp svneol=native#text/plain
 tests/test/tstprocv.pp svneol=native#text/plain
 tests/test/tstring1.pp svneol=native#text/plain
 tests/test/tstring10.pp svneol=native#text/plain

+ 4 - 3
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);
 
 
 

+ 12 - 0
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.