Implement RtlGetCallersAddress

This commit is contained in:
RadWolfie 2022-03-30 13:11:49 -05:00
parent 1d030aa41f
commit 57640cad49
1 changed files with 25 additions and 1 deletions

View File

@ -1106,7 +1106,31 @@ XBSYSAPI EXPORTNUM(288) xbox::void_xt NTAPI xbox::RtlGetCallersAddress
LOG_FUNC_ARG_OUT(CallersCaller)
LOG_FUNC_END;
LOG_UNIMPLEMENTED();
/* Get the tow back trace address */
PVOID BackTrace[2];
ushort_xt FrameCount = RtlCaptureStackBackTrace(2, 2, &BackTrace[0], zeroptr);
/* Only if user want it */
if (CallersAddress != NULL) {
/* only when first frames exist */
if (FrameCount >= 1) {
*CallersAddress = BackTrace[0];
}
else {
*CallersAddress = zeroptr;
}
}
/* Only if user want it */
if (CallersCaller != NULL) {
/* only when second frames exist */
if (FrameCount >= 2) {
*CallersCaller = BackTrace[1];
}
else {
*CallersCaller = zeroptr;
}
}
}
// ******************************************************************