Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
0a277b63
Commit
0a277b63
authored
May 13, 1999
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adapted for new register functions support (ESP_reg in register
functions now points after the arguments).
parent
06b97899
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
96 additions
and
159 deletions
+96
-159
exception.c
dlls/ntdll/exception.c
+12
-67
rtl.c
dlls/ntdll/rtl.c
+2
-2
stackframe.h
include/stackframe.h
+1
-1
module.c
loader/ne/module.c
+8
-4
selector.c
memory/selector.c
+23
-25
ntdll.spec
relay32/ntdll.spec
+3
-3
kernel32.c
win32/kernel32.c
+46
-56
ordinals.c
win32/ordinals.c
+1
-1
No files found.
dlls/ntdll/exception.c
View file @
0a277b63
...
...
@@ -96,12 +96,10 @@ static void EXC_DefaultHandling( EXCEPTION_RECORD *rec, CONTEXT *context )
}
/*******************************************************************
* EXC_RaiseException
*
* Implementation of NtRaiseException.
/***********************************************************************
* RtlRaiseException (NTDLL.464)
*/
static
void
EXC_RaiseException
(
EXCEPTION_RECORD
*
rec
,
CONTEXT
*
context
)
void
WINAPI
REGS_FUNC
(
RtlRaiseException
)
(
EXCEPTION_RECORD
*
rec
,
CONTEXT
*
context
)
{
PEXCEPTION_FRAME
frame
,
dispatch
,
nested_frame
;
EXCEPTION_RECORD
newrec
;
...
...
@@ -160,16 +158,17 @@ static void EXC_RaiseException( EXCEPTION_RECORD *rec, CONTEXT *context )
/*******************************************************************
* EXC_RtlUnwind
*
* Implementation of RtlUnwind.
* RtlUnwind (KERNEL32.590) (NTDLL.518)
*/
static
void
EXC_RtlUnwind
(
EXCEPTION_FRAME
*
pEndFrame
,
EXCEPTION_RECORD
*
pRecord
,
CONTEXT
*
context
)
void
WINAPI
REGS_FUNC
(
RtlUnwind
)(
PEXCEPTION_FRAME
pEndFrame
,
LPVOID
unusedEip
,
PEXCEPTION_RECORD
pRecord
,
DWORD
returnEax
,
CONTEXT
*
context
)
{
EXCEPTION_RECORD
record
,
newrec
;
PEXCEPTION_FRAME
frame
,
dispatch
;
EAX_reg
(
context
)
=
returnEax
;
/* build an exception record, if we do not have one */
if
(
!
pRecord
)
{
...
...
@@ -235,69 +234,15 @@ static void EXC_RtlUnwind( EXCEPTION_FRAME *pEndFrame, EXCEPTION_RECORD *pRecord
* Real prototype:
* DWORD WINAPI NtRaiseException( EXCEPTION_RECORD *rec, CONTEXT *ctx, BOOL first );
*/
REGS_ENTRYPOINT
(
NtRaiseException
)
void
WINAPI
REGS_FUNC
(
NtRaiseException
)(
EXCEPTION_RECORD
*
rec
,
CONTEXT
*
ctx
,
BOOL
first
,
CONTEXT
*
context
)
{
DWORD
ret
;
EXCEPTION_RECORD
*
rec
;
CONTEXT
*
ctx
;
BOOL
first
;
ret
=
STACK32_POP
(
context
);
/* return addr */
rec
=
(
PEXCEPTION_RECORD
)
STACK32_POP
(
context
);
ctx
=
(
PCONTEXT
)
STACK32_POP
(
context
);
first
=
(
BOOL
)
STACK32_POP
(
context
);
STACK32_PUSH
(
context
,
ret
);
/* restore return addr */
EXC_RaiseException
(
rec
,
ctx
);
REGS_FUNC
(
RtlRaiseException
)(
rec
,
ctx
);
*
context
=
*
ctx
;
}
/***********************************************************************
* RtlRaiseException (NTDLL.464)
*
* Real prototype:
* void WINAPI RtlRaiseException(PEXCEPTION_RECORD pRecord)
*/
REGS_ENTRYPOINT
(
RtlRaiseException
)
{
EXCEPTION_RECORD
*
rec
;
DWORD
ret
;
ret
=
STACK32_POP
(
context
);
/* return addr */
rec
=
(
PEXCEPTION_RECORD
)
STACK32_POP
(
context
);
STACK32_PUSH
(
context
,
ret
);
/* restore return addr */
rec
->
ExceptionAddress
=
(
LPVOID
)
EIP_reg
(
context
);
EXC_RaiseException
(
rec
,
context
);
}
/*******************************************************************
* RtlUnwind (KERNEL32.590) (NTDLL.518)
*
* The real prototype is:
* void WINAPI RtlUnwind( PEXCEPTION_FRAME pEndFrame, LPVOID unusedEip,
* PEXCEPTION_RECORD pRecord, DWORD returnEax );
*/
REGS_ENTRYPOINT
(
RtlUnwind
)
{
PEXCEPTION_FRAME
pEndFrame
;
PEXCEPTION_RECORD
pRecord
;
/* get the arguments from the stack */
DWORD
ret
=
STACK32_POP
(
context
);
/* return addr */
pEndFrame
=
(
PEXCEPTION_FRAME
)
STACK32_POP
(
context
);
(
void
)
STACK32_POP
(
context
);
/* unused arg */
pRecord
=
(
PEXCEPTION_RECORD
)
STACK32_POP
(
context
);
EAX_reg
(
context
)
=
STACK32_POP
(
context
);
STACK32_PUSH
(
context
,
ret
);
/* restore return addr */
EXC_RtlUnwind
(
pEndFrame
,
pRecord
,
context
);
}
/***********************************************************************
* RtlRaiseStatus (NTDLL.465)
*
* Raise an exception with ExceptionCode = status
...
...
dlls/ntdll/rtl.c
View file @
0a277b63
...
...
@@ -374,11 +374,11 @@ BOOLEAN WINAPI RtlGetNtProductType(LPDWORD type)
* NTDLL_alloca_probe [NTDLL.861]
* Glorified "enter xxxx".
*/
REGS_ENTRYPOINT
(
NTDLL_chkstk
)
void
WINAPI
REGS_FUNC
(
NTDLL_chkstk
)(
CONTEXT
*
context
)
{
ESP_reg
(
context
)
-=
EAX_reg
(
context
);
}
REGS_ENTRYPOINT
(
NTDLL_alloca_probe
)
void
WINAPI
REGS_FUNC
(
NTDLL_alloca_probe
)(
CONTEXT
*
context
)
{
ESP_reg
(
context
)
-=
EAX_reg
(
context
);
}
...
...
include/stackframe.h
View file @
0a277b63
...
...
@@ -85,6 +85,6 @@ typedef void *VA_LIST16;
#define STACK32_POP(context) (*(*(DWORD **)&ESP_reg(context))++)
/* Win32 register functions */
#define REGS_
ENTRYPOINT(name) void WINAPI __regs_##name( CONTEXT *context )
#define REGS_
FUNC(name) __regs_##name
#endif
/* __WINE_STACKFRAME_H */
loader/ne/module.c
View file @
0a277b63
...
...
@@ -1560,21 +1560,24 @@ HMODULE WINAPI MapHModuleSL(HMODULE16 hmod) {
/***************************************************************************
* MapHInstLS (KERNEL32.516)
*/
REGS_ENTRYPOINT
(
MapHInstLS
)
{
void
WINAPI
REGS_FUNC
(
MapHInstLS
)(
CONTEXT
*
context
)
{
EAX_reg
(
context
)
=
MapHModuleLS
(
EAX_reg
(
context
));
}
/***************************************************************************
* MapHInstSL (KERNEL32.518)
*/
REGS_ENTRYPOINT
(
MapHInstSL
)
{
void
WINAPI
REGS_FUNC
(
MapHInstSL
)(
CONTEXT
*
context
)
{
EAX_reg
(
context
)
=
MapHModuleSL
(
EAX_reg
(
context
));
}
/***************************************************************************
* MapHInstLS_PN (KERNEL32.517)
*/
REGS_ENTRYPOINT
(
MapHInstLS_PN
)
{
void
WINAPI
REGS_FUNC
(
MapHInstLS_PN
)(
CONTEXT
*
context
)
{
if
(
EAX_reg
(
context
))
EAX_reg
(
context
)
=
MapHModuleLS
(
EAX_reg
(
context
));
}
...
...
@@ -1582,7 +1585,8 @@ REGS_ENTRYPOINT(MapHInstLS_PN) {
/***************************************************************************
* MapHInstSL_PN (KERNEL32.519)
*/
REGS_ENTRYPOINT
(
MapHInstSL_PN
)
{
void
WINAPI
REGS_FUNC
(
MapHInstSL_PN
)(
CONTEXT
*
context
)
{
if
(
EAX_reg
(
context
))
EAX_reg
(
context
)
=
MapHModuleSL
(
EAX_reg
(
context
));
}
...
...
memory/selector.c
View file @
0a277b63
...
...
@@ -558,11 +558,9 @@ LPVOID WINAPI MapSLFix( SEGPTR sptr )
* UnMapSLFixArray (KERNEL32.701)
*/
REGS_ENTRYPOINT
(
UnMapSLFixArray
)
/* SEGPTR sptr[], INT32 length */
void
WINAPI
REGS_FUNC
(
UnMapSLFixArray
)(
SEGPTR
sptr
[],
INT
length
,
CONTEXT
*
context
)
{
/* Must not change EAX, hence defined as 'register' function */
/* We need to remove the arguments ourselves */
ESP_reg
(
context
)
+=
8
;
}
/***********************************************************************
...
...
@@ -642,17 +640,17 @@ x_SMapLS_IP_EBP_x(CONTEXT *context,int argoff) {
EAX_reg
(
context
)
=
ptr
;
}
REGS_ENTRYPOINT
(
SMapLS_IP_EBP_8
)
{
x_SMapLS_IP_EBP_x
(
context
,
8
);}
REGS_ENTRYPOINT
(
SMapLS_IP_EBP_12
)
{
x_SMapLS_IP_EBP_x
(
context
,
12
);}
REGS_ENTRYPOINT
(
SMapLS_IP_EBP_16
)
{
x_SMapLS_IP_EBP_x
(
context
,
16
);}
REGS_ENTRYPOINT
(
SMapLS_IP_EBP_20
)
{
x_SMapLS_IP_EBP_x
(
context
,
20
);}
REGS_ENTRYPOINT
(
SMapLS_IP_EBP_24
)
{
x_SMapLS_IP_EBP_x
(
context
,
24
);}
REGS_ENTRYPOINT
(
SMapLS_IP_EBP_28
)
{
x_SMapLS_IP_EBP_x
(
context
,
28
);}
REGS_ENTRYPOINT
(
SMapLS_IP_EBP_32
)
{
x_SMapLS_IP_EBP_x
(
context
,
32
);}
REGS_ENTRYPOINT
(
SMapLS_IP_EBP_36
)
{
x_SMapLS_IP_EBP_x
(
context
,
36
);}
REGS_ENTRYPOINT
(
SMapLS_IP_EBP_40
)
{
x_SMapLS_IP_EBP_x
(
context
,
40
);}
void
WINAPI
REGS_FUNC
(
SMapLS_IP_EBP_8
)(
CONTEXT
*
context
)
{
x_SMapLS_IP_EBP_x
(
context
,
8
);}
void
WINAPI
REGS_FUNC
(
SMapLS_IP_EBP_12
)(
CONTEXT
*
context
)
{
x_SMapLS_IP_EBP_x
(
context
,
12
);}
void
WINAPI
REGS_FUNC
(
SMapLS_IP_EBP_16
)(
CONTEXT
*
context
)
{
x_SMapLS_IP_EBP_x
(
context
,
16
);}
void
WINAPI
REGS_FUNC
(
SMapLS_IP_EBP_20
)(
CONTEXT
*
context
)
{
x_SMapLS_IP_EBP_x
(
context
,
20
);}
void
WINAPI
REGS_FUNC
(
SMapLS_IP_EBP_24
)(
CONTEXT
*
context
)
{
x_SMapLS_IP_EBP_x
(
context
,
24
);}
void
WINAPI
REGS_FUNC
(
SMapLS_IP_EBP_28
)(
CONTEXT
*
context
)
{
x_SMapLS_IP_EBP_x
(
context
,
28
);}
void
WINAPI
REGS_FUNC
(
SMapLS_IP_EBP_32
)(
CONTEXT
*
context
)
{
x_SMapLS_IP_EBP_x
(
context
,
32
);}
void
WINAPI
REGS_FUNC
(
SMapLS_IP_EBP_36
)(
CONTEXT
*
context
)
{
x_SMapLS_IP_EBP_x
(
context
,
36
);}
void
WINAPI
REGS_FUNC
(
SMapLS_IP_EBP_40
)(
CONTEXT
*
context
)
{
x_SMapLS_IP_EBP_x
(
context
,
40
);}
REGS_ENTRYPOINT
(
SMapLS
)
void
WINAPI
REGS_FUNC
(
SMapLS
)(
CONTEXT
*
context
)
{
if
(
EAX_reg
(
context
)
>=
0x10000
)
{
EAX_reg
(
context
)
=
MapLS
((
LPVOID
)
EAX_reg
(
context
));
...
...
@@ -662,7 +660,7 @@ REGS_ENTRYPOINT(SMapLS)
}
}
REGS_ENTRYPOINT
(
SUnMapLS
)
void
WINAPI
REGS_FUNC
(
SUnMapLS
)(
CONTEXT
*
context
)
{
if
(
EAX_reg
(
context
)
>=
0x10000
)
UnMapLS
((
SEGPTR
)
EAX_reg
(
context
));
...
...
@@ -674,15 +672,15 @@ x_SUnMapLS_IP_EBP_x(CONTEXT *context,int argoff) {
UnMapLS
(
*
(
DWORD
*
)(
EBP_reg
(
context
)
+
argoff
));
*
(
DWORD
*
)(
EBP_reg
(
context
)
+
argoff
)
=
0
;
}
REGS_ENTRYPOINT
(
SUnMapLS_IP_EBP_8
)
{
x_SUnMapLS_IP_EBP_x
(
context
,
8
);
}
REGS_ENTRYPOINT
(
SUnMapLS_IP_EBP_12
)
{
x_SUnMapLS_IP_EBP_x
(
context
,
12
);
}
REGS_ENTRYPOINT
(
SUnMapLS_IP_EBP_16
)
{
x_SUnMapLS_IP_EBP_x
(
context
,
16
);
}
REGS_ENTRYPOINT
(
SUnMapLS_IP_EBP_20
)
{
x_SUnMapLS_IP_EBP_x
(
context
,
20
);
}
REGS_ENTRYPOINT
(
SUnMapLS_IP_EBP_24
)
{
x_SUnMapLS_IP_EBP_x
(
context
,
24
);
}
REGS_ENTRYPOINT
(
SUnMapLS_IP_EBP_28
)
{
x_SUnMapLS_IP_EBP_x
(
context
,
28
);
}
REGS_ENTRYPOINT
(
SUnMapLS_IP_EBP_32
)
{
x_SUnMapLS_IP_EBP_x
(
context
,
32
);
}
REGS_ENTRYPOINT
(
SUnMapLS_IP_EBP_36
)
{
x_SUnMapLS_IP_EBP_x
(
context
,
36
);
}
REGS_ENTRYPOINT
(
SUnMapLS_IP_EBP_40
)
{
x_SUnMapLS_IP_EBP_x
(
context
,
40
);
}
void
WINAPI
REGS_FUNC
(
SUnMapLS_IP_EBP_8
)(
CONTEXT
*
context
)
{
x_SUnMapLS_IP_EBP_x
(
context
,
8
);
}
void
WINAPI
REGS_FUNC
(
SUnMapLS_IP_EBP_12
)(
CONTEXT
*
context
)
{
x_SUnMapLS_IP_EBP_x
(
context
,
12
);
}
void
WINAPI
REGS_FUNC
(
SUnMapLS_IP_EBP_16
)(
CONTEXT
*
context
)
{
x_SUnMapLS_IP_EBP_x
(
context
,
16
);
}
void
WINAPI
REGS_FUNC
(
SUnMapLS_IP_EBP_20
)(
CONTEXT
*
context
)
{
x_SUnMapLS_IP_EBP_x
(
context
,
20
);
}
void
WINAPI
REGS_FUNC
(
SUnMapLS_IP_EBP_24
)(
CONTEXT
*
context
)
{
x_SUnMapLS_IP_EBP_x
(
context
,
24
);
}
void
WINAPI
REGS_FUNC
(
SUnMapLS_IP_EBP_28
)(
CONTEXT
*
context
)
{
x_SUnMapLS_IP_EBP_x
(
context
,
28
);
}
void
WINAPI
REGS_FUNC
(
SUnMapLS_IP_EBP_32
)(
CONTEXT
*
context
)
{
x_SUnMapLS_IP_EBP_x
(
context
,
32
);
}
void
WINAPI
REGS_FUNC
(
SUnMapLS_IP_EBP_36
)(
CONTEXT
*
context
)
{
x_SUnMapLS_IP_EBP_x
(
context
,
36
);
}
void
WINAPI
REGS_FUNC
(
SUnMapLS_IP_EBP_40
)(
CONTEXT
*
context
)
{
x_SUnMapLS_IP_EBP_x
(
context
,
40
);
}
/**********************************************************************
* AllocMappedBuffer (KERNEL32.38)
...
...
@@ -703,7 +701,7 @@ REGS_ENTRYPOINT(SUnMapLS_IP_EBP_40) { x_SUnMapLS_IP_EBP_x(context,40); }
* The SEGPTR is used by the caller!
*/
REGS_ENTRYPOINT
(
AllocMappedBuffer
)
void
WINAPI
REGS_FUNC
(
AllocMappedBuffer
)(
CONTEXT
*
context
)
{
HGLOBAL
handle
=
GlobalAlloc
(
0
,
EDI_reg
(
context
)
+
8
);
DWORD
*
buffer
=
(
DWORD
*
)
GlobalLock
(
handle
);
...
...
@@ -736,7 +734,7 @@ REGS_ENTRYPOINT(AllocMappedBuffer)
* Input: EDI register: pointer to buffer
*/
REGS_ENTRYPOINT
(
FreeMappedBuffer
)
void
WINAPI
REGS_FUNC
(
FreeMappedBuffer
)(
CONTEXT
*
context
)
{
if
(
EDI_reg
(
context
))
{
...
...
relay32/ntdll.spec
View file @
0a277b63
...
...
@@ -180,7 +180,7 @@ type win32
172 stdcall NtQueryValueKey(long long long long long long) NtQueryValueKey
173 stub NtQueryVirtualMemory
174 stub NtQueryVolumeInformationFile
175 register NtRaiseException() NtRaiseException
175 register NtRaiseException(
ptr ptr long
) NtRaiseException
176 stub NtRaiseHardError
177 stdcall NtReadFile(long long long long long long long long long) NtReadFile
178 stub NtReadRequestData
...
...
@@ -469,7 +469,7 @@ type win32
461 stub RtlQuerySecurityObject
462 stub RtlQueryTagHeap
463 stub RtlQueryTimeZoneInformation
464 register RtlRaiseException() RtlRaiseException
464 register RtlRaiseException(
ptr
) RtlRaiseException
465 stdcall RtlRaiseStatus(long) RtlRaiseStatus
466 stub RtlRandom
467 stub RtlReAllocateHeap
...
...
@@ -523,7 +523,7 @@ type win32
515 stdcall RtlUnicodeToOemN(ptr long ptr ptr long) RtlUnicodeToOemN
516 stub RtlUniform
517 stub RtlUnlockHeap
518 register RtlUnwind() RtlUnwind
518 register RtlUnwind(
ptr ptr ptr long
) RtlUnwind
519 stub RtlUpcaseUnicodeChar
520 stdcall RtlUpcaseUnicodeString(ptr ptr long) RtlUpcaseUnicodeString
521 stub RtlUpcaseUnicodeStringToAnsiString
...
...
win32/kernel32.c
View file @
0a277b63
This diff is collapsed.
Click to expand it.
win32/ordinals.c
View file @
0a277b63
...
...
@@ -54,7 +54,7 @@ LPVOID WINAPI GetPK16SysVar(void)
/**********************************************************************
* CommonUnimpStub (KERNEL32.17)
*/
REGS_ENTRYPOINT
(
CommonUnimpStub
)
void
WINAPI
REGS_FUNC
(
CommonUnimpStub
)(
CONTEXT
*
context
)
{
if
(
EAX_reg
(
context
))
MESSAGE
(
"*** Unimplemented Win32 API: %s
\n
"
,
(
LPSTR
)
EAX_reg
(
context
)
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment