Fixed AppendParam for X_EX_TITLE_TERMINATE_REGISTRATION,

X_EXCEPTION_RECORD.
Added AppendParam for X_OBJECT_ATTRIBUTES.
This commit is contained in:
gibbed 2016-06-18 13:44:52 -05:00
parent 2d60d6f672
commit 4fc3bdf213
4 changed files with 37 additions and 23 deletions

View File

@ -366,6 +366,32 @@ inline void AppendParam(StringBuffer* string_buffer, lpdouble_t param) {
string_buffer->AppendFormat("(%G)", param.value());
}
}
void AppendParam(StringBuffer* string_buffer,
pointer_t<X_OBJECT_ATTRIBUTES> record) {
string_buffer->AppendFormat("%.8X", record.guest_address());
if (record) {
auto name_string =
kernel_memory()->TranslateVirtual<X_ANSI_STRING*>(record->name_ptr);
std::string name =
name_string == nullptr
? "(null)"
: name_string->to_string(kernel_memory()->virtual_membase());
string_buffer->AppendFormat("(%.8X,%s,%.8X)",
uint32_t(record->root_directory), name.c_str(),
uint32_t(record->attributes));
}
}
void AppendParam(StringBuffer* string_buffer,
pointer_t<X_EX_TITLE_TERMINATE_REGISTRATION> reg) {
string_buffer->AppendFormat("%.8X(%.8X, %.8X)", reg.guest_address(),
static_cast<uint32_t>(reg->notification_routine),
static_cast<uint32_t>(reg->priority));
}
void AppendParam(StringBuffer* string_buffer,
pointer_t<X_EXCEPTION_RECORD> record) {
string_buffer->AppendFormat("%.8X(%.8X)", record.guest_address(),
uint32_t(record->exception_code));
}
template <typename T>
void AppendParam(StringBuffer* string_buffer, pointer_t<T> param) {
string_buffer->AppendFormat("%.8X", param.guest_address());

View File

@ -31,22 +31,6 @@ typedef struct {
} X_THREADNAME_INFO;
static_assert_size(X_THREADNAME_INFO, 0x10);
// https://msdn.microsoft.com/en-us/library/windows/desktop/aa363082.aspx
typedef struct {
xe::be<uint32_t> exception_code;
xe::be<uint32_t> exception_flags;
xe::be<uint32_t> exception_record;
xe::be<uint32_t> exception_address;
xe::be<uint32_t> number_parameters;
xe::be<uint32_t> exception_information[15];
} X_EXCEPTION_RECORD;
static_assert_size(X_EXCEPTION_RECORD, 0x50);
void AppendParam(StringBuffer* string_buffer,
pointer_t<X_EXCEPTION_RECORD> record) {
string_buffer->AppendFormat("%.8X(%.8X)", record.guest_address(),
uint32_t(record->exception_code));
}
void RtlRaiseException(pointer_t<X_EXCEPTION_RECORD> record) {
if (record->exception_code == 0x406D1388) {
// SetThreadName. FFS.

View File

@ -320,13 +320,6 @@ SHIM_CALL XexGetProcedureAddress_shim(PPCContext* ppc_context,
SHIM_SET_RETURN_32(result);
}
void AppendParam(StringBuffer* string_buffer,
pointer_t<X_EX_TITLE_TERMINATE_REGISTRATION> reg) {
string_buffer->AppendFormat("%.8X(%.8X, %.8X)", reg.guest_address(),
static_cast<uint32_t>(reg->notification_routine),
static_cast<uint32_t>(reg->priority));
}
void ExRegisterTitleTerminateNotification(
pointer_t<X_EX_TITLE_TERMINATE_REGISTRATION> reg, dword_t create) {
if (create) {

View File

@ -385,6 +385,17 @@ struct X_OBJECT_ATTRIBUTES {
xe::be<uint32_t> attributes; // 0xC
};
// https://msdn.microsoft.com/en-us/library/windows/desktop/aa363082.aspx
typedef struct {
xe::be<uint32_t> exception_code;
xe::be<uint32_t> exception_flags;
xe::be<uint32_t> exception_record;
xe::be<uint32_t> exception_address;
xe::be<uint32_t> number_parameters;
xe::be<uint32_t> exception_information[15];
} X_EXCEPTION_RECORD;
static_assert_size(X_EXCEPTION_RECORD, 0x50);
#pragma pack(pop)
} // namespace xe