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
180bd104
Commit
180bd104
authored
Mar 14, 2024
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Implement RtlGetCallersAddress.
parent
92d20c11
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
30 additions
and
1 deletion
+30
-1
exception.c
dlls/ntdll/exception.c
+14
-0
ntdll.spec
dlls/ntdll/ntdll.spec
+1
-1
exception.c
dlls/ntdll/tests/exception.c
+14
-0
rtlsupportapi.h
include/rtlsupportapi.h
+1
-0
No files found.
dlls/ntdll/exception.c
View file @
180bd104
...
...
@@ -531,6 +531,20 @@ USHORT WINAPI RtlCaptureStackBackTrace( ULONG skip, ULONG count, void **buffer,
}
/*************************************************************************
* RtlGetCallersAddress (NTDLL.@)
*/
void
WINAPI
RtlGetCallersAddress
(
void
**
caller
,
void
**
parent
)
{
void
*
buffer
[
2
];
ULONG
count
=
ARRAY_SIZE
(
buffer
),
skip
=
2
;
/* skip our frame and the parent */
count
=
RtlWalkFrameChain
(
buffer
,
count
+
skip
,
skip
<<
8
);
*
caller
=
count
>
0
?
buffer
[
0
]
:
NULL
;
*
parent
=
count
>
1
?
buffer
[
1
]
:
NULL
;
}
/**********************************************************************
* RtlGetEnabledExtendedFeatures (NTDLL.@)
*/
...
...
dlls/ntdll/ntdll.spec
View file @
180bd104
...
...
@@ -716,7 +716,7 @@
@ stub RtlGenerate8dot3Name
@ stdcall RtlGetAce(ptr long ptr)
@ stdcall RtlGetActiveActivationContext(ptr)
@ st
ub RtlGetCallersAddress
@ st
dcall RtlGetCallersAddress(ptr ptr)
@ stdcall RtlGetCompressionWorkSpaceSize(long ptr ptr)
@ stdcall RtlGetControlSecurityDescriptor(ptr ptr ptr)
@ stdcall RtlGetCurrentDirectory_U(long ptr)
...
...
dlls/ntdll/tests/exception.c
View file @
180bd104
...
...
@@ -66,6 +66,7 @@ static void * (WINAPI *pRtlLocateLegacyContext)(CONTEXT_EX *context_ex, ULONG
static
void
(
WINAPI
*
pRtlSetExtendedFeaturesMask
)(
CONTEXT_EX
*
context_ex
,
ULONG64
feature_mask
);
static
ULONG64
(
WINAPI
*
pRtlGetExtendedFeaturesMask
)(
CONTEXT_EX
*
context_ex
);
static
void
*
(
WINAPI
*
pRtlPcToFileHeader
)(
PVOID
pc
,
PVOID
*
address
);
static
void
(
WINAPI
*
pRtlGetCallersAddress
)(
void
**
,
void
**
);
static
NTSTATUS
(
WINAPI
*
pNtRaiseException
)(
EXCEPTION_RECORD
*
rec
,
CONTEXT
*
context
,
BOOL
first_chance
);
static
NTSTATUS
(
WINAPI
*
pNtReadVirtualMemory
)(
HANDLE
,
const
void
*
,
void
*
,
SIZE_T
,
SIZE_T
*
);
static
NTSTATUS
(
WINAPI
*
pNtTerminateProcess
)(
HANDLE
handle
,
LONG
exit_code
);
...
...
@@ -10784,6 +10785,18 @@ static void test_backtrace(void)
ok
(
module
==
GetModuleHandleA
(
0
),
"wrong module %p %s / %p for %p
\n
"
,
module
,
debugstr_w
(
name
),
GetModuleHandleA
(
0
),
buffer
[
0
]);
if
(
pRtlGetCallersAddress
)
{
void
*
caller
,
*
parent
;
caller
=
parent
=
(
void
*
)
0xdeadbeef
;
pRtlGetCallersAddress
(
&
caller
,
&
parent
);
ok
(
caller
==
(
count
>
1
?
buffer
[
1
]
:
NULL
)
||
broken
(
is_arm64ec
),
/* caller is entry thunk */
"wrong caller %p / %p
\n
"
,
caller
,
buffer
[
1
]
);
ok
(
parent
==
(
count
>
2
?
buffer
[
2
]
:
NULL
),
"wrong parent %p / %p
\n
"
,
parent
,
buffer
[
2
]
);
}
else
win_skip
(
"RtlGetCallersAddress not supported
\n
"
);
if
(
count
&&
!
buffer
[
count
-
1
])
count
--
;
/* win11 32-bit */
if
(
count
<=
1
)
return
;
RtlPcToFileHeader
(
buffer
[
count
-
1
],
&
module
);
...
...
@@ -10844,6 +10857,7 @@ START_TEST(exception)
X
(
RtlSetExtendedFeaturesMask
);
X
(
RtlGetExtendedFeaturesMask
);
X
(
RtlPcToFileHeader
);
X
(
RtlGetCallersAddress
);
X
(
RtlCopyContext
);
X
(
RtlCopyExtendedContext
);
X
(
KiUserApcDispatcher
);
...
...
include/rtlsupportapi.h
View file @
180bd104
...
...
@@ -24,6 +24,7 @@
NTSYSAPI
void
WINAPI
RtlCaptureContext
(
CONTEXT
*
);
NTSYSAPI
void
WINAPI
RtlCaptureContext2
(
CONTEXT
*
);
NTSYSAPI
USHORT
WINAPI
RtlCaptureStackBackTrace
(
ULONG
,
ULONG
,
void
**
,
ULONG
*
);
NTSYSAPI
void
WINAPI
RtlGetCallersAddress
(
void
**
,
void
**
);
NTSYSAPI
void
WINAPI
RtlRaiseException
(
EXCEPTION_RECORD
*
);
NTSYSAPI
void
CDECL
RtlRestoreContext
(
CONTEXT
*
,
EXCEPTION_RECORD
*
);
NTSYSAPI
void
WINAPI
RtlUnwind
(
void
*
,
void
*
,
EXCEPTION_RECORD
*
,
void
*
);
...
...
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