mirror of
https://github.com/reactos/reactos.git
synced 2024-07-30 16:18:43 +00:00
Daniel Zimmerman <netzimme@aim.com>
- Implement RtlGetCallersAddress. - Add RtlCaptureStackBackTrace prototype to PSDK. See issue #3125 for more details. svn path=/trunk/; revision=32693
This commit is contained in:
parent
68f67228b5
commit
1789bf3561
|
@ -2902,6 +2902,17 @@ typedef struct _RTL_CRITICAL_SECTION {
|
|||
} RTL_CRITICAL_SECTION,*PRTL_CRITICAL_SECTION;
|
||||
#endif
|
||||
|
||||
NTSYSAPI
|
||||
WORD
|
||||
NTAPI
|
||||
RtlCaptureStackBackTrace(
|
||||
IN DWORD FramesToSkip,
|
||||
IN DWORD FramesToCapture,
|
||||
OUT PVOID *BackTrace,
|
||||
OUT PDWORD BackTraceHash OPTIONAL
|
||||
);
|
||||
|
||||
|
||||
NTSYSAPI
|
||||
PVOID
|
||||
NTAPI
|
||||
|
|
|
@ -16,14 +16,47 @@
|
|||
/* PUBLIC FUNCTIONS **********************************************************/
|
||||
|
||||
/*
|
||||
* @unimplemented
|
||||
* @implemented
|
||||
*/
|
||||
VOID
|
||||
NTAPI
|
||||
RtlGetCallersAddress(OUT PVOID *CallersAddress,
|
||||
OUT PVOID *CallersCaller)
|
||||
{
|
||||
UNIMPLEMENTED;
|
||||
USHORT FrameCount;
|
||||
PVOID BackTrace[2];
|
||||
PULONG BackTraceHash = NULL;
|
||||
|
||||
/* Get the tow back trace address */
|
||||
FrameCount = RtlCaptureStackBackTrace(2, 2, &BackTrace[0],BackTraceHash);
|
||||
|
||||
/* Only if user want it */
|
||||
if (*CallersAddress != NULL)
|
||||
{
|
||||
/* only when first frames exist */
|
||||
if (FrameCount >= 1)
|
||||
{
|
||||
*CallersAddress = BackTrace[0];
|
||||
}
|
||||
else
|
||||
{
|
||||
*CallersAddress = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
/* Only if user want it */
|
||||
if (*CallersCaller != NULL)
|
||||
{
|
||||
/* only when second frames exist */
|
||||
if (FrameCount >= 2)
|
||||
{
|
||||
*CallersCaller = BackTrace[1];
|
||||
}
|
||||
else
|
||||
{
|
||||
*CallersCaller = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Reference in a new issue