Pārlūkot izejas kodu

--- Merging r20079 into '.':
U rtl/win64/system.pp
U rtl/win32/sysinitcyg.pp
U rtl/win32/sysinitpas.pp
U rtl/win32/system.pp
U rtl/win32/sysinitgprof.pp
U tests/test/library/ttdlltest.pp
U tests/test/library/testdll.pp

# revisions: 20079
------------------------------------------------------------------------
r20079 | florian | 2012-01-14 21:21:52 +0100 (Sat, 14 Jan 2012) | 1 line
Changed paths:
M /trunk/rtl/win32/sysinitcyg.pp
M /trunk/rtl/win32/sysinitgprof.pp
M /trunk/rtl/win32/sysinitpas.pp
M /trunk/rtl/win32/system.pp
M /trunk/rtl/win64/system.pp
M /trunk/tests/test/library/testdll.pp
M /trunk/tests/test/library/ttdlltest.pp

* change dllparam into PtrInt, this is required for 64 bit systems, patch based on Gennadiy's patch in #21089, resolves #21089
------------------------------------------------------------------------

git-svn-id: branches/fixes_2_6@21229 -

marco 13 gadi atpakaļ
vecāks
revīzija
8dda76642d

+ 4 - 4
rtl/win32/sysinitcyg.pp

@@ -83,12 +83,12 @@ unit sysinitcyg;
       end;
 
 
-    procedure _FPC_DLLMainCRTStartup(_hinstance,_dllreason,_dllparam:longint);stdcall;public name '_DLLMainCRTStartup';
+    procedure _FPC_DLLMainCRTStartup(_hinstance : longint;_dllreason : dword;_dllparam:Pointer);stdcall;public name '_DLLMainCRTStartup';
       begin
         IsConsole:=true;
         sysinstance:=_hinstance;
         dllreason:=_dllreason;
-        dllparam:=_dllparam;
+        dllparam:=PtrInt(_dllparam);
         asm
           subl   $0x8,%esp
           andl   $0xfffffff0,%esp
@@ -97,12 +97,12 @@ unit sysinitcyg;
       end;
 
 
-    procedure _FPC_DLLWinMainCRTStartup(_hinstance,_dllreason,_dllparam:longint);stdcall;public name '_DLLWinMainCRTStartup';
+    procedure _FPC_DLLWinMainCRTStartup(_hinstance : longint;_dllreason : dword;_dllparam:Pointer);stdcall;public name '_DLLWinMainCRTStartup';
       begin
         IsConsole:=false;
         sysinstance:=_hinstance;
         dllreason:=_dllreason;
-        dllparam:=_dllparam;
+        dllparam:=PtrInt(_dllparam);
         asm
           subl   $0x8,%esp
           andl   $0xfffffff0,%esp

+ 4 - 4
rtl/win32/sysinitgprof.pp

@@ -118,12 +118,12 @@ unit sysinitgprof;
       end;
 
 
-    procedure _FPC_DLLMainCRTStartup(_hinstance,_dllreason,_dllparam:longint);stdcall;public name '_DLLMainCRTStartup';
+    procedure _FPC_DLLMainCRTStartup(_hinstance : longint;_dllreason : dword;_dllparam:Pointer);stdcall;public name '_DLLMainCRTStartup';
       begin
         IsConsole:=true;
         sysinstance:=_hinstance;
         dllreason:=_dllreason;
-        dllparam:=_dllparam;
+        dllparam:=PtrInt(_dllparam);
         asm
           subl   $0x8,%esp
           andl   $0xfffffff0,%esp
@@ -132,12 +132,12 @@ unit sysinitgprof;
       end;
 
 
-    procedure _FPC_DLLWinMainCRTStartup(_hinstance,_dllreason,_dllparam:longint);stdcall;public name '_DLLWinMainCRTStartup';
+    procedure _FPC_DLLWinMainCRTStartup(_hinstance : longint;_dllreason : dword;_dllparam:Pointer);stdcall;public name '_DLLWinMainCRTStartup';
       begin
         IsConsole:=false;
         sysinstance:=_hinstance;
         dllreason:=_dllreason;
-        dllparam:=_dllparam;
+        dllparam:=PtrInt(_dllparam);
         asm
           subl   $0x8,%esp
           andl   $0xfffffff0,%esp

+ 4 - 4
rtl/win32/sysinitpas.pp

@@ -50,23 +50,23 @@ unit sysinitpas;
     end;
 
 
-    procedure _FPC_DLLMainCRTStartup(_hinstance,_dllreason,_dllparam:longint);stdcall;public name '_DLLMainCRTStartup';
+    procedure _FPC_DLLMainCRTStartup(_hinstance : longint;_dllreason : dword;_dllparam:Pointer);stdcall;public name '_DLLMainCRTStartup';
     begin
       IsConsole:=true;
       sysinstance:=_hinstance;
       dllreason:=_dllreason;
-      dllparam:=_dllparam;
+      dllparam:=PtrInt(_dllparam);
       SetupEntryInformation;
       DLL_Entry(EntryInformation);
     end;
 
 
-    procedure _FPC_DLLWinMainCRTStartup(_hinstance,_dllreason,_dllparam:longint);stdcall;public name '_DLLWinMainCRTStartup';
+    procedure _FPC_DLLWinMainCRTStartup(_hinstance : longint;_dllreason : dword;_dllparam:Pointer);stdcall;public name '_DLLWinMainCRTStartup';
     begin
       IsConsole:=false;
       sysinstance:=_hinstance;
       dllreason:=_dllreason;
-      dllparam:=_dllparam;
+      dllparam:=PtrInt(_dllparam);
       SetupEntryInformation;
       DLL_Entry(EntryInformation);
     end;

+ 3 - 3
rtl/win32/system.pp

@@ -100,12 +100,12 @@ var
   hprevinst,
   MainInstance,
   cmdshow     : longint;
-  DLLreason : longint; public name 'operatingsystem_dllreason';
-  DLLparam : longint; public name 'operatingsystem_dllparam';
+  DLLreason : dword; public name 'operatingsystem_dllreason';
+  DLLparam : PtrInt; public name 'operatingsystem_dllparam';
   StartupConsoleMode : DWORD;
 
 type
-  TDLL_Entry_Hook = procedure (dllparam : longint);
+  TDLL_Entry_Hook = procedure (dllparam : PtrInt);
 
 const
   Dll_Process_Detach_Hook : TDLL_Entry_Hook = nil;

+ 7 - 6
rtl/win64/system.pp

@@ -96,9 +96,10 @@ var
   hprevinst,
   MainInstance : qword;
   cmdshow     : longint;
-  DLLreason,DLLparam:longint;
+  DLLreason : dword;
+  DLLparam : PtrInt;
 type
-  TDLL_Entry_Hook = procedure (dllparam : longint);
+  TDLL_Entry_Hook = procedure (dllparam : PtrInt);
 
 const
   Dll_Process_Detach_Hook : TDLL_Entry_Hook = nil;
@@ -442,22 +443,22 @@ function Dll_entry{$ifdef FPC_HAS_INDIRECT_MAIN_INFORMATION}(const info : TEntry
 
 
 
-procedure _FPC_DLLMainCRTStartup(_hinstance : qword;_dllreason,_dllparam:longint);stdcall;public name '_DLLMainCRTStartup';
+procedure _FPC_DLLMainCRTStartup(_hinstance : qword;_dllreason : dword;_dllparam:Pointer);stdcall;public name '_DLLMainCRTStartup';
 begin
   IsConsole:=true;
   sysinstance:=_hinstance;
   dllreason:=_dllreason;
-  dllparam:=_dllparam;
+  dllparam:=PtrInt(_dllparam);
   DLL_Entry;
 end;
 
 
-procedure _FPC_DLLWinMainCRTStartup(_hinstance : qword;_dllreason,_dllparam:longint);stdcall;public name '_DLLWinMainCRTStartup';
+procedure _FPC_DLLWinMainCRTStartup(_hinstance : qword;_dllreason : dword;_dllparam:Pointer);stdcall;public name '_DLLWinMainCRTStartup';
 begin
   IsConsole:=false;
   sysinstance:=_hinstance;
   dllreason:=_dllreason;
-  dllparam:=_dllparam;
+  dllparam:=PtrInt(_dllparam);
   DLL_Entry;
 end;
 

+ 1 - 1
tests/test/library/testdll.pp

@@ -65,7 +65,7 @@ begin
 end;
 
 
-procedure MyDllHook(DllParma : longint);
+procedure MyDllHook(DllParma : PtrInt);
 begin
   Writeln('DLL: Thread Detach Hook  called with DLLParam=',DllParam);
   Writeln('DLL: Thread Id is ',GetCurrentThreadId);

+ 1 - 1
tests/test/library/ttdlltest.pp

@@ -62,7 +62,7 @@ var
    s2 : string;
 
 
-   procedure MyMainHook(DllParma : longint);
+   procedure MyMainHook(DllParma : PtrInt);
    begin
      Writeln('Main: Thread Detach Hook  called with DLLParam=',DllParam);
    end;