Better process type emulation.
This commit is contained in:
parent
8c171a6489
commit
4fabd20980
|
@ -34,6 +34,7 @@ KernelState::KernelState(Emulator* emulator)
|
|||
: emulator_(emulator),
|
||||
memory_(emulator->memory()),
|
||||
has_notified_startup_(false),
|
||||
process_type_(X_PROCTYPE_USER),
|
||||
executable_module_(nullptr) {
|
||||
processor_ = emulator->processor();
|
||||
file_system_ = emulator->file_system();
|
||||
|
|
|
@ -59,6 +59,9 @@ class KernelState {
|
|||
ObjectTable* object_table() const { return object_table_; }
|
||||
std::mutex& object_mutex() { return object_mutex_; }
|
||||
|
||||
uint32_t process_type() const { return process_type_; }
|
||||
void set_process_type(uint32_t value) { process_type_ = value; }
|
||||
|
||||
void RegisterModule(XModule* module);
|
||||
void UnregisterModule(XModule* module);
|
||||
XModule* GetModule(const char* name);
|
||||
|
@ -95,6 +98,7 @@ class KernelState {
|
|||
std::vector<XNotifyListener*> notify_listeners_;
|
||||
bool has_notified_startup_;
|
||||
|
||||
uint32_t process_type_;
|
||||
XUserModule* executable_module_;
|
||||
|
||||
friend class XObject;
|
||||
|
|
|
@ -242,8 +242,19 @@ SHIM_CALL KeGetCurrentProcessType_shim(PPCContext* ppc_state,
|
|||
|
||||
// DWORD
|
||||
|
||||
int result = X_PROCTYPE_USER;
|
||||
SHIM_SET_RETURN_64(result);
|
||||
SHIM_SET_RETURN_64(state->process_type());
|
||||
}
|
||||
|
||||
SHIM_CALL KeSetCurrentProcessType_shim(PPCContext* ppc_state,
|
||||
KernelState* state) {
|
||||
uint32_t type = SHIM_GET_ARG_32(0);
|
||||
// One of X_PROCTYPE_?
|
||||
|
||||
XELOGD("KeSetCurrentProcessType(%d)", type);
|
||||
|
||||
assert_true(type >= 0 && type <= 2);
|
||||
|
||||
state->set_process_type(type);
|
||||
}
|
||||
|
||||
SHIM_CALL KeQueryPerformanceFrequency_shim(PPCContext* ppc_state,
|
||||
|
@ -1232,6 +1243,7 @@ void xe::kernel::xboxkrnl::RegisterThreadingExports(
|
|||
SHIM_SET_MAPPING("xboxkrnl.exe", KeSetBasePriorityThread, state);
|
||||
|
||||
SHIM_SET_MAPPING("xboxkrnl.exe", KeGetCurrentProcessType, state);
|
||||
SHIM_SET_MAPPING("xboxkrnl.exe", KeSetCurrentProcessType, state);
|
||||
|
||||
SHIM_SET_MAPPING("xboxkrnl.exe", KeQueryPerformanceFrequency, state);
|
||||
SHIM_SET_MAPPING("xboxkrnl.exe", KeDelayExecutionThread, state);
|
||||
|
|
Loading…
Reference in New Issue