mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-13 03:49:59 +02:00
* sync with trunk r3339
git-svn-id: branches/fixes_2_0@3340 -
This commit is contained in:
parent
3006652b93
commit
c1958660b2
@ -69,9 +69,18 @@
|
||||
|
||||
PINTEGER = ^longint;
|
||||
PBOOL = ^BOOL;
|
||||
|
||||
|
||||
LONGLONG = int64;
|
||||
PLONGLONG = ^LONGLONG;
|
||||
ULONGLONG = qword; // used in AMD64 CONTEXT
|
||||
PULONGLONG = ^ULONGLONG; //
|
||||
DWORD64 = qword; //
|
||||
PDWORD64 = ^DWORD64; //
|
||||
|
||||
INT_PTR = PtrInt;
|
||||
UINT_PTR = PtrUInt;
|
||||
LONG_PTR = PtrInt;
|
||||
ULONG_PTR = PtrUInt;
|
||||
|
||||
DWORDLONG = qword; { was unsigned long }
|
||||
PDWORDLONG = ^DWORDLONG;
|
||||
@ -125,7 +134,7 @@
|
||||
LANGID = word;
|
||||
LCID = DWORD;
|
||||
LCTYPE = DWORD;
|
||||
LPARAM = longint;
|
||||
LPARAM = LONG_PTR;
|
||||
|
||||
LP = ^word;
|
||||
LPBOOL = ^WINBOOL;
|
||||
@ -161,7 +170,7 @@
|
||||
LPTSTR = Pchar;
|
||||
{$endif}
|
||||
|
||||
LRESULT = longint;
|
||||
LRESULT = LONG_PTR;
|
||||
|
||||
LPVOID = pointer;
|
||||
LPCVOID = pointer;
|
||||
@ -244,7 +253,7 @@
|
||||
ULONG = cardinal;
|
||||
USHORT = word;
|
||||
|
||||
WPARAM = Longint;
|
||||
WPARAM = LONG_PTR;
|
||||
PLPSTR = ^LPSTR;
|
||||
PLPWStr= ^LPWStr;
|
||||
|
||||
@ -802,14 +811,14 @@ type
|
||||
{ argument types are unknown }
|
||||
function MAKEINTATOM(i : longint) : LPTSTR;
|
||||
begin
|
||||
MAKEINTATOM:=LPTSTR(DWORD(WORD(i)));
|
||||
MAKEINTATOM:=LPTSTR(ULONG_PTR(WORD(i)));
|
||||
end;
|
||||
|
||||
{ was #define dname(params) def_expr }
|
||||
{ argument types are unknown }
|
||||
function MAKEINTRESOURCE(i : longint) : LPTSTR;
|
||||
begin
|
||||
MAKEINTRESOURCE:=LPTSTR(DWORD(WORD(i)));
|
||||
MAKEINTRESOURCE:=LPTSTR(ULONG_PTR(WORD(i)));
|
||||
end;
|
||||
|
||||
{ was #define dname(params) def_expr }
|
||||
|
@ -5258,8 +5258,9 @@ Const
|
||||
DECLARE_HANDLE(HANDLE);
|
||||
#endif
|
||||
*)
|
||||
{$ifdef __PPC__}
|
||||
|
||||
{$ifdef cpupowerpc32}
|
||||
{ ppc }
|
||||
const
|
||||
CONTEXT_CONTROL = 1;
|
||||
CONTEXT_FLOATING_POINT = 2;
|
||||
@ -5267,23 +5268,51 @@ Const
|
||||
CONTEXT_DEBUG_REGISTERS = 8;
|
||||
CONTEXT_FULL = (CONTEXT_CONTROL or CONTEXT_FLOATING_POINT) or CONTEXT_INTEGER;
|
||||
CONTEXT_DEBUGGER = CONTEXT_FULL;
|
||||
{$else}
|
||||
{$endif}
|
||||
|
||||
{$ifdef cpui386}
|
||||
{ x86 }
|
||||
{ The doc refered me to winnt.h, so I had to look... }
|
||||
|
||||
const
|
||||
SIZE_OF_80387_REGISTERS = 80;
|
||||
{ Values for contextflags }
|
||||
CONTEXT_i386 = $10000;
|
||||
CONTEXT_CONTROL = CONTEXT_i386 or 1;
|
||||
CONTEXT_INTEGER = CONTEXT_i386 or 2;
|
||||
CONTEXT_SEGMENTS = CONTEXT_i386 or 4;
|
||||
CONTEXT_FLOATING_POINT = CONTEXT_i386 or 8;
|
||||
CONTEXT_DEBUG_REGISTERS = CONTEXT_i386 or $10;
|
||||
CONTEXT_i386 = $10000; // this assumes that i386 and
|
||||
CONTEXT_i486 = $10000; // i486 have identical context records
|
||||
|
||||
CONTEXT_CONTROL = CONTEXT_i386 or 1; // SS:SP, CS:IP, FLAGS, BP
|
||||
CONTEXT_INTEGER = CONTEXT_i386 or 2; // AX, BX, CX, DX, SI, DI
|
||||
CONTEXT_SEGMENTS = CONTEXT_i386 or 4; // DS, ES, FS, GS
|
||||
CONTEXT_FLOATING_POINT = CONTEXT_i386 or 8; // 387 state
|
||||
CONTEXT_DEBUG_REGISTERS = CONTEXT_i386 or $10; // DB 0-3,6,7
|
||||
CONTEXT_EXTENDED_REGISTERS = CONTEXT_i386 or $20; // cpu specific extensions
|
||||
CONTEXT_FULL = (CONTEXT_CONTROL or CONTEXT_INTEGER) or CONTEXT_SEGMENTS;
|
||||
CONTEXT_ALL = CONTEXT_FULL or CONTEXT_FLOATING_POINT or CONTEXT_DEBUG_REGISTERS or CONTEXT_EXTENDED_REGISTERS;
|
||||
{ our own invention }
|
||||
FLAG_TRACE_BIT = $100;
|
||||
CONTEXT_DEBUGGER = CONTEXT_FULL or CONTEXT_FLOATING_POINT;
|
||||
{$endif}
|
||||
|
||||
{$ifdef cpux86_64}
|
||||
const
|
||||
INITIAL_MXCSR = $1f80; // initial MXCSR value
|
||||
INITIAL_FPCSR = $027f; // initial FPCSR value
|
||||
|
||||
CONTEXT_AMD64 = $100000;
|
||||
|
||||
CONTEXT_CONTROL = (CONTEXT_AMD64 or $00000001);
|
||||
CONTEXT_INTEGER = (CONTEXT_AMD64 or $00000002);
|
||||
CONTEXT_SEGMENTS = (CONTEXT_AMD64 or $00000004);
|
||||
CONTEXT_FLOATING_POINT = (CONTEXT_AMD64 or $00000008);
|
||||
CONTEXT_DEBUG_REGISTERS = (CONTEXT_AMD64 or $00000010);
|
||||
|
||||
CONTEXT_FULL = (CONTEXT_CONTROL or CONTEXT_INTEGER or CONTEXT_FLOATING_POINT);
|
||||
CONTEXT_ALL = (CONTEXT_CONTROL or CONTEXT_INTEGER or CONTEXT_SEGMENTS or CONTEXT_FLOATING_POINT or CONTEXT_DEBUG_REGISTERS);
|
||||
|
||||
CONTEXT_EXCEPTION_ACTIVE = $08000000;
|
||||
CONTEXT_SERVICE_ACTIVE = $10000000;
|
||||
CONTEXT_EXCEPTION_REQUEST = $40000000;
|
||||
CONTEXT_EXCEPTION_REPORTING = $80000000;
|
||||
{$endif}
|
||||
|
||||
const
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1188,6 +1188,16 @@ Type
|
||||
|
||||
{$else}
|
||||
|
||||
{$ifdef cpu64}
|
||||
HALFLRESULT = DWORD;
|
||||
HALFPARAM = DWORD;
|
||||
HALFPARAMBOOL = LONGBOOL;
|
||||
{$else}
|
||||
HALFLRESULT = WORD;
|
||||
HALFPARAM = WORD;
|
||||
HALFPARAMBOOL = WORDBOOL;
|
||||
{$endif}
|
||||
|
||||
MSG = record
|
||||
hwnd : HWND;
|
||||
message : UINT;
|
||||
@ -1204,7 +1214,7 @@ Type
|
||||
|
||||
|
||||
PMessage = ^TMessage;
|
||||
TMessage = packed record {fields according to ICS}
|
||||
TMessage = record {fields according to ICS}
|
||||
msg : UINT;
|
||||
case longint of
|
||||
0: (
|
||||
@ -1214,26 +1224,26 @@ Type
|
||||
);
|
||||
1: (
|
||||
wParamlo,
|
||||
wParamhi : WORD; // Is there Windows type for half an wparam?
|
||||
wParamhi : HALFPARAM; // Is there Windows type for half an wparam?
|
||||
lParamlo,
|
||||
lParamhi : WORD;
|
||||
lParamhi : HALFPARAM;
|
||||
Resultlo,
|
||||
Resulthi : WORD;
|
||||
Resulthi : HALFLRESULT;
|
||||
);
|
||||
end;
|
||||
|
||||
TWMSize = packed record
|
||||
Msg: Cardinal;
|
||||
SizeType : LongInt;
|
||||
Width : Word;
|
||||
Height : Word;
|
||||
Result : LongInt;
|
||||
TWMSize = record
|
||||
Msg: UINT;
|
||||
SizeType : WPARAM;
|
||||
Width : HALFPARAM;
|
||||
Height : HALFPARAM;
|
||||
Result : LRESULT;
|
||||
End;
|
||||
|
||||
TWMNoParams = packed record
|
||||
Msg : Cardinal;
|
||||
Unused : array[0..3] of Word;
|
||||
Result : Longint;
|
||||
TWMNoParams = record
|
||||
Msg : UINT;
|
||||
Unused : array[0..3] of HALFPARAM;
|
||||
Result : LRESULT;
|
||||
end;
|
||||
|
||||
TWMGetDlgCode = TWMNoParams;
|
||||
@ -1241,67 +1251,68 @@ Type
|
||||
TWMGetFont = TWMNoParams;
|
||||
|
||||
TWMScroll = record
|
||||
Msg : Cardinal;
|
||||
ScrollCode : SmallInt;
|
||||
Pos : SmallInt;
|
||||
Msg : UINT;
|
||||
ScrollCode : HALFPARAM;
|
||||
Pos : HALFPARAM;
|
||||
ScrollBar : HWND;
|
||||
Result : LongInt;
|
||||
Result : LRESULT;
|
||||
end;
|
||||
|
||||
TWMHScroll = TWMScroll;
|
||||
TWMVScroll = TWMScroll;
|
||||
|
||||
TWMGetText = packed record
|
||||
Msg : Cardinal;
|
||||
TextMax : LongInt;
|
||||
TWMGetText = record
|
||||
Msg : UINT;
|
||||
TextMax : LPARAM;
|
||||
Text : PChar;
|
||||
Result : LongInt;
|
||||
Result : LRESULT;
|
||||
end;
|
||||
|
||||
TWMGetTextLength = TWMNoParams;
|
||||
|
||||
TWMKillFocus = packed record
|
||||
Msg : Cardinal;
|
||||
TWMKillFocus = record
|
||||
Msg : UINT;
|
||||
FocusedWnd : HWND;
|
||||
UnUsed : LongInt;
|
||||
Result : LongInt;
|
||||
UnUsed : WPARAM;
|
||||
Result : LRESULT;
|
||||
End;
|
||||
|
||||
TWMSetCursor = packed record
|
||||
Msg : Cardinal;
|
||||
TWMSetCursor = record
|
||||
Msg : UINT;
|
||||
CursorWnd : HWND;
|
||||
HitTest : Word;
|
||||
MouseMsg : Word;
|
||||
Result : LongInt;
|
||||
HitTest : HALFPARAM;
|
||||
MouseMsg : HALFPARAM;
|
||||
Result : LRESULT;
|
||||
end;
|
||||
|
||||
TWMSetFocus = packed record
|
||||
Msg : Cardinal;
|
||||
TWMSetFocus = record
|
||||
Msg : UINT;
|
||||
FocusedWnd : HWND;
|
||||
Unused : LongInt;
|
||||
Result : LongInt;
|
||||
Unused : WPARAM;
|
||||
Result : LRESULT;
|
||||
end;
|
||||
|
||||
TWMSetFont = packed record
|
||||
Msg : Cardinal;
|
||||
TWMSetFont = record
|
||||
Msg : UINT;
|
||||
Font : HFONT;
|
||||
Redraw : WordBool;
|
||||
Unused : Word;
|
||||
Result : LongInt;
|
||||
Redraw : HALFPARAMBOOL;
|
||||
Unused : HALFPARAM;
|
||||
Result : LRESULT;
|
||||
end;
|
||||
|
||||
TWMShowWindow = packed record
|
||||
Msg : Cardinal;
|
||||
Show : BOOL;
|
||||
Status : LongInt;
|
||||
Result : LongInt;
|
||||
TWMShowWindow = record
|
||||
Msg : UINT;
|
||||
Show : HALFPARAMBOOL;
|
||||
Unused : HALFPARAM;
|
||||
Status : WPARAM;
|
||||
Result : LRESULT;
|
||||
end;
|
||||
|
||||
TWMEraseBkgnd = packed record
|
||||
Msg: Cardinal;
|
||||
TWMEraseBkgnd = record
|
||||
Msg: UINT;
|
||||
DC: HDC;
|
||||
Unused: Longint;
|
||||
Result: Longint;
|
||||
Unused: LPARAM;
|
||||
Result: LRESULT;
|
||||
end;
|
||||
|
||||
{$endif messagesunit}
|
||||
|
@ -1017,7 +1017,8 @@
|
||||
TCONSOLESCREENBUFFERINFO = CONSOLE_SCREEN_BUFFER_INFO;
|
||||
PCONSOLESCREENBUFFERINFO = ^CONSOLE_SCREEN_BUFFER_INFO;
|
||||
|
||||
{$ifdef i386}
|
||||
{$ifdef cpui386}
|
||||
{$define __HASCONTEXT__}
|
||||
type
|
||||
|
||||
FLOATING_SAVE_AREA = record
|
||||
@ -1061,12 +1062,217 @@
|
||||
Esp : DWORD;
|
||||
SegSs : DWORD;
|
||||
end;
|
||||
LPCONTEXT = ^CONTEXT;
|
||||
_CONTEXT = CONTEXT;
|
||||
TCONTEXT = CONTEXT;
|
||||
PCONTEXT = ^CONTEXT;
|
||||
{$endif}
|
||||
|
||||
{$else}
|
||||
{$ifdef cpux86_64}
|
||||
{$define __HASCONTEXT__}
|
||||
//
|
||||
// Define 128-bit 16-byte aligned xmm register type.
|
||||
//
|
||||
|
||||
//typedef struct DECLSPEC_ALIGN(16) _M128A {
|
||||
{$note todo, fix alignment }
|
||||
type
|
||||
M128A = record
|
||||
Low: ULONGLONG;
|
||||
High: LONGLONG;
|
||||
end;
|
||||
_M128A = M128A;
|
||||
TM128A = M128A;
|
||||
PM128A = TM128A;
|
||||
|
||||
//
|
||||
// Format of data for 32-bit fxsave/fxrstor instructions.
|
||||
//
|
||||
|
||||
//typedef struct _XMM_SAVE_AREA32 {
|
||||
type
|
||||
XMM_SAVE_AREA32 = record
|
||||
ControlWord: WORD;
|
||||
StatusWord: WORD;
|
||||
TagWord: BYTE;
|
||||
Reserved1: BYTE;
|
||||
ErrorOpcode: WORD;
|
||||
ErrorOffset: DWORD;
|
||||
ErrorSelector: WORD;
|
||||
Reserved2: WORD;
|
||||
DataOffset: DWORD;
|
||||
DataSelector: WORD;
|
||||
Reserved3: WORD;
|
||||
MxCsr: DWORD;
|
||||
MxCsr_Mask: DWORD;
|
||||
FloatRegisters: array[0..7] of M128A;
|
||||
XmmRegisters: array[0..16] of M128A;
|
||||
Reserved4: array[0..95] of BYTE;
|
||||
end;
|
||||
_XMM_SAVE_AREA32 = XMM_SAVE_AREA32;
|
||||
TXmmSaveArea = XMM_SAVE_AREA32;
|
||||
PXmmSaveArea = ^TXmmSaveArea;
|
||||
|
||||
const
|
||||
LEGACY_SAVE_AREA_LENGTH = sizeof(XMM_SAVE_AREA32);
|
||||
|
||||
//
|
||||
// Context Frame
|
||||
//
|
||||
// This frame has a several purposes: 1) it is used as an argument to
|
||||
// NtContinue, 2) is is used to constuct a call frame for APC delivery,
|
||||
// and 3) it is used in the user level thread creation routines.
|
||||
//
|
||||
//
|
||||
// The flags field within this record controls the contents of a CONTEXT
|
||||
// record.
|
||||
//
|
||||
// If the context record is used as an input parameter, then for each
|
||||
// portion of the context record controlled by a flag whose value is
|
||||
// set, it is assumed that that portion of the context record contains
|
||||
// valid context. If the context record is being used to modify a threads
|
||||
// context, then only that portion of the threads context is modified.
|
||||
//
|
||||
// If the context record is used as an output parameter to capture the
|
||||
// context of a thread, then only those portions of the thread's context
|
||||
// corresponding to set flags will be returned.
|
||||
//
|
||||
// CONTEXT_CONTROL specifies SegSs, Rsp, SegCs, Rip, and EFlags.
|
||||
//
|
||||
// CONTEXT_INTEGER specifies Rax, Rcx, Rdx, Rbx, Rbp, Rsi, Rdi, and R8-R15.
|
||||
//
|
||||
// CONTEXT_SEGMENTS specifies SegDs, SegEs, SegFs, and SegGs.
|
||||
//
|
||||
// CONTEXT_DEBUG_REGISTERS specifies Dr0-Dr3 and Dr6-Dr7.
|
||||
//
|
||||
// CONTEXT_MMX_REGISTERS specifies the floating point and extended registers
|
||||
// Mm0/St0-Mm7/St7 and Xmm0-Xmm15).
|
||||
//
|
||||
|
||||
//typedef struct DECLSPEC_ALIGN(16) _CONTEXT {
|
||||
{$note todo, fix alignment }
|
||||
type
|
||||
CONTEXT = record
|
||||
|
||||
//
|
||||
// Register parameter home addresses.
|
||||
//
|
||||
// N.B. These fields are for convience - they could be used to extend the
|
||||
// context record in the future.
|
||||
//
|
||||
|
||||
P1Home: DWORD64;
|
||||
P2Home: DWORD64;
|
||||
P3Home: DWORD64;
|
||||
P4Home: DWORD64;
|
||||
P5Home: DWORD64;
|
||||
P6Home: DWORD64;
|
||||
|
||||
//
|
||||
// Control flags.
|
||||
//
|
||||
|
||||
ContextFlags: DWORD;
|
||||
MxCsr: DWORD;
|
||||
|
||||
//
|
||||
// Segment Registers and processor flags.
|
||||
//
|
||||
|
||||
SegCs: WORD;
|
||||
SegDs: WORD;
|
||||
SegEs: WORD;
|
||||
SegFs: WORD;
|
||||
SegGs: WORD;
|
||||
SegSs: WORD;
|
||||
EFlags: DWORD;
|
||||
|
||||
//
|
||||
// Debug registers
|
||||
//
|
||||
|
||||
Dr0: DWORD64;
|
||||
Dr1: DWORD64;
|
||||
Dr2: DWORD64;
|
||||
Dr3: DWORD64;
|
||||
Dr6: DWORD64;
|
||||
Dr7: DWORD64;
|
||||
|
||||
//
|
||||
// Integer registers.
|
||||
//
|
||||
|
||||
Rax: DWORD64;
|
||||
Rcx: DWORD64;
|
||||
Rdx: DWORD64;
|
||||
Rbx: DWORD64;
|
||||
Rsp: DWORD64;
|
||||
Rbp: DWORD64;
|
||||
Rsi: DWORD64;
|
||||
Rdi: DWORD64;
|
||||
R8: DWORD64;
|
||||
R9: DWORD64;
|
||||
R10: DWORD64;
|
||||
R11: DWORD64;
|
||||
R12: DWORD64;
|
||||
R13: DWORD64;
|
||||
R14: DWORD64;
|
||||
R15: DWORD64;
|
||||
|
||||
//
|
||||
// Program counter.
|
||||
//
|
||||
|
||||
Rip: DWORD64;
|
||||
|
||||
//
|
||||
// Floating point state.
|
||||
//
|
||||
|
||||
FltSave: XMM_SAVE_AREA32; // MWE: only translated the FltSave part of the union
|
||||
(*
|
||||
union {
|
||||
XMM_SAVE_AREA32 FltSave;
|
||||
struct {
|
||||
M128A Header[2];
|
||||
M128A Legacy[8];
|
||||
M128A Xmm0;
|
||||
M128A Xmm1;
|
||||
M128A Xmm2;
|
||||
M128A Xmm3;
|
||||
M128A Xmm4;
|
||||
M128A Xmm5;
|
||||
M128A Xmm6;
|
||||
M128A Xmm7;
|
||||
M128A Xmm8;
|
||||
M128A Xmm9;
|
||||
M128A Xmm10;
|
||||
M128A Xmm11;
|
||||
M128A Xmm12;
|
||||
M128A Xmm13;
|
||||
M128A Xmm14;
|
||||
M128A Xmm15;
|
||||
};
|
||||
};
|
||||
*)
|
||||
|
||||
//
|
||||
// Vector registers.
|
||||
//
|
||||
|
||||
VectorRegister: array[0..25] of M128A;
|
||||
VectorControl: DWORD64;
|
||||
|
||||
//
|
||||
// Special debug control registers.
|
||||
//
|
||||
|
||||
DebugControl: DWORD64;
|
||||
LastBranchToRip: DWORD64;
|
||||
LastBranchFromRip: DWORD64;
|
||||
LastExceptionToRip: DWORD64;
|
||||
LastExceptionFromRip: DWORD64;
|
||||
end;
|
||||
{$endif}
|
||||
|
||||
{$ifdef cpupowerpc32}
|
||||
{$define __HASCONTEXT__}
|
||||
{ __ppc__ }
|
||||
{ Floating point registers returned when CONTEXT_FLOATING_POINT is set }
|
||||
{ Integer registers returned when CONTEXT_INTEGER is set. }
|
||||
@ -1173,12 +1379,22 @@
|
||||
Dr6 : DWORD;
|
||||
Dr7 : DWORD;
|
||||
end;
|
||||
{$endif}
|
||||
|
||||
{$ifndef __HASCONTEXT__}
|
||||
{ MWE: placeholder so it won't break compilation on others (CPUARM ?) }
|
||||
type
|
||||
CONTEXT = record
|
||||
end;
|
||||
{$endif}
|
||||
|
||||
{$undef __HASCONTEXT__}
|
||||
|
||||
LPCONTEXT = ^CONTEXT;
|
||||
_CONTEXT = CONTEXT;
|
||||
TCONTEXT = CONTEXT;
|
||||
PCONTEXT = ^CONTEXT;
|
||||
|
||||
{$endif}
|
||||
|
||||
type
|
||||
|
||||
LIST_ENTRY = record
|
||||
@ -1559,7 +1775,7 @@
|
||||
ExceptionRecord : ^_EXCEPTION_RECORD;
|
||||
ExceptionAddress : PVOID;
|
||||
NumberParameters : DWORD;
|
||||
ExceptionInformation : array[0..(EXCEPTION_MAXIMUM_PARAMETERS)-1] of DWORD;
|
||||
ExceptionInformation : array[0..(EXCEPTION_MAXIMUM_PARAMETERS)-1] of ULONG_PTR;
|
||||
end;
|
||||
PEXCEPTION_RECORD = ^EXCEPTION_RECORD;
|
||||
_EXCEPTION_RECORD = EXCEPTION_RECORD;
|
||||
@ -3968,7 +4184,7 @@
|
||||
hSubMenu : HMENU;
|
||||
hbmpChecked : HBITMAP;
|
||||
hbmpUnchecked : HBITMAP;
|
||||
dwItemData : DWORD;
|
||||
dwItemData : ULONG_PTR;
|
||||
dwTypeData : LPTSTR;
|
||||
cch : UINT;
|
||||
hbmpItem : HBITMAP;
|
||||
|
Loading…
Reference in New Issue
Block a user