Browse Source

Made sure that release based on binary object file can be built

git-svn-id: https://svn.inf.ethz.ch/svn/lecturers/a2/trunk@6773 8c9fc860-2736-0410-a75d-ab315db34111
felixf 9 years ago
parent
commit
ff8558d009
2 changed files with 24 additions and 1 deletions
  1. 9 0
      source/Modules.Mod
  2. 15 1
      source/Win32.Kernel32.Mod

+ 9 - 0
source/Modules.Mod

@@ -84,6 +84,15 @@ TYPE
 
 	ProcOffsetTable* = POINTER TO ARRAY OF ProcOffsetEntry;
 
+	(* only for interface compatibility with generic loader based system
+	-- does not provide functionality. Used for precise GC.
+	*)
+	ProcedureDescPointer* = POINTER TO ProcedureDesc;
+	ProcedureDesc*= RECORD
+		pcFrom-, pcLimit-: ADDRESS; 
+		offsets- {UNTRACED}: POINTER TO ARRAY OF ADDRESS; 
+	END;
+
 	Module* = OBJECT (Heaps.RootObject)	(* cf. Linker0 & Heaps.WriteType *)
 		VAR
 			next*: Module;	(** once a module is published, all fields are read-only *)

+ 15 - 1
source/Win32.Kernel32.Mod

@@ -213,6 +213,10 @@ TYPE
 		EDI*, ESI*, EBX*, EDX*, ECX*, EAX*: LONGINT;
 		BP*, PC*, CS*, FLAGS*, SP*, SS*: LONGINT; (* whereas BP is EBP and SP is ESP *)
 	END;
+	
+	Wow64Context*= RECORD (Context)
+		extension: ARRAY 512 (* MaxWOW64Extension *) OF CHAR;
+	END;
 
 	ExceptionRecordPtr* = POINTER TO ExceptionRecord;
 	ExceptionRecord* = RECORD
@@ -539,6 +543,9 @@ VAR
 	(** The GetThreadContext function retrieves the context of the specified thread. *)
 	GetThreadContext-: PROCEDURE {WINAPI} ( hThread: HANDLE;
 																			  VAR lpContext: Context ): BOOL;
+	(** The GetThreadContext function retrieves the context of the specified thread. *)
+	Wow64GetThreadContext-: PROCEDURE {WINAPI} ( hThread: HANDLE;
+																			  VAR lpContext: Wow64Context ): BOOL;
 	(** The GetThreadPriority function returns the priority value for the specified thread. This value, together with
 			the priority class of the thread's process, determines the thread's base-priority level. *)
 	GetThreadPriority-: PROCEDURE {WINAPI} ( hThread: HANDLE ): LONGINT;
@@ -718,6 +725,8 @@ VAR
 	Sleep-: PROCEDURE {WINAPI} ( dwMilliseconds: LONGINT );
 	(** The SuspendThread function suspends the specified thread. *)
 	SuspendThread-: PROCEDURE {WINAPI} ( hThread: HANDLE ): LONGINT;
+	(** The SuspendThread function suspends the specified thread. *)
+	Wow64SuspendThread-: PROCEDURE {WINAPI} ( hThread: HANDLE ): LONGINT;
 	(** The SystemTimeToFileTime function converts a system time to a file time. *)
 	SystemTimeToFileTime-: PROCEDURE {WINAPI} ( VAR lpSystemTime: SystemTime;
 																					   VAR lpFileTime: FileTime ): BOOL;
@@ -754,6 +763,10 @@ VAR
 	(** Method used to write text to the Console. *)
 	OutputString*: PROCEDURE ( CONST a: ARRAY OF CHAR );
 
+	(** methods to store the GC context before temporarily escaping to Windows -- required because GetContext does not work correctly any more  *)
+	(* entered here for interface compatibility only *)
+	LeaveA2*, ReenterA2*: PROCEDURE;
+
 	hInstance-: HINSTANCE;   (* init by linker/loader *)
 	isEXE-: BOOLEAN;
 
@@ -878,7 +891,7 @@ VAR
 		GetProcAddress(mod, "GetTempFileNameA",SYSTEM.VAL(ADDRESS,GetTempFileName));
 		GetProcAddress(mod, "GetTempPathA",SYSTEM.VAL(ADDRESS,GetTempPath));
 		GetProcAddress(mod, "GetThreadContext",SYSTEM.VAL(ADDRESS,GetThreadContext));
-		GetProcAddress(mod, "GetThreadPriority",SYSTEM.VAL(ADDRESS,GetThreadPriority));
+		GetProcAddress(mod, "Wow64GetThreadContext",SYSTEM.VAL(ADDRESS,Wow64GetThreadContext));		GetProcAddress(mod, "GetThreadPriority",SYSTEM.VAL(ADDRESS,GetThreadPriority));
 		GetProcAddress(mod, "GetThreadTimes",SYSTEM.VAL(ADDRESS,GetThreadTimes));
 		GetProcAddress(mod, "GetTickCount",SYSTEM.VAL(ADDRESS,GetTickCount));
 		GetProcAddress(mod, "GetWindowsDirectoryA",SYSTEM.VAL(ADDRESS,GetWindowsDirectory));
@@ -939,6 +952,7 @@ VAR
 		GetProcAddress(mod, "SetupComm",SYSTEM.VAL(ADDRESS,SetupComm));
 		GetProcAddress(mod, "Sleep",SYSTEM.VAL(ADDRESS,Sleep));
 		GetProcAddress(mod, "SuspendThread",SYSTEM.VAL(ADDRESS,SuspendThread));
+		GetProcAddress(mod, "Wow64SuspendThread",SYSTEM.VAL(ADDRESS,Wow64SuspendThread));
 		GetProcAddress(mod, "SystemTimeToFileTime",SYSTEM.VAL(ADDRESS,SystemTimeToFileTime));
 		GetProcAddress(mod, "TerminateThread",SYSTEM.VAL(ADDRESS,TerminateThread));
 		GetProcAddress(mod, "TlsAlloc",SYSTEM.VAL(ADDRESS,TlsAlloc));