XamUserGetSigninInfo, NtCreateSemaphore, busted error codes.
This commit is contained in:
@@ -53,6 +53,20 @@ SHIM_CALL XamUserGetSigninState_shim(
|
||||
}
|
||||
|
||||
|
||||
SHIM_CALL XamUserGetSigninInfo_shim(
|
||||
PPCContext* ppc_state, KernelState* state) {
|
||||
uint32_t user_index = SHIM_GET_ARG_32(0);
|
||||
uint32_t flags = SHIM_GET_ARG_32(1);
|
||||
uint32_t info_ptr = SHIM_GET_ARG_32(2);
|
||||
|
||||
XELOGD(
|
||||
"XamUserGetSigninInfo(%d, %.8X, %.8X)",
|
||||
user_index, flags, info_ptr);
|
||||
|
||||
SHIM_SET_RETURN(X_ERROR_NO_SUCH_USER);
|
||||
}
|
||||
|
||||
|
||||
// http://freestyledash.googlecode.com/svn/trunk/Freestyle/Tools/Generic/xboxtools.cpp
|
||||
SHIM_CALL XamUserReadProfileSettings_shim(
|
||||
PPCContext* ppc_state, KernelState* state) {
|
||||
@@ -125,5 +139,6 @@ void xe::kernel::xam::RegisterUserExports(
|
||||
ExportResolver* export_resolver, KernelState* state) {
|
||||
SHIM_SET_MAPPING("xam.xex", XamUserGetXUID, state);
|
||||
SHIM_SET_MAPPING("xam.xex", XamUserGetSigninState, state);
|
||||
SHIM_SET_MAPPING("xam.xex", XamUserGetSigninInfo, state);
|
||||
SHIM_SET_MAPPING("xam.xex", XamUserReadProfileSettings, state);
|
||||
}
|
||||
|
||||
@@ -656,6 +656,33 @@ SHIM_CALL NtClearEvent_shim(
|
||||
}
|
||||
|
||||
|
||||
SHIM_CALL NtCreateSemaphore_shim(
|
||||
PPCContext* ppc_state, KernelState* state) {
|
||||
uint32_t handle_ptr = SHIM_GET_ARG_32(0);
|
||||
uint32_t obj_attributes_ptr = SHIM_GET_ARG_32(1);
|
||||
int32_t count = SHIM_GET_ARG_32(2);
|
||||
int32_t limit = SHIM_GET_ARG_32(3);
|
||||
|
||||
XELOGD(
|
||||
"NtCreateSemaphore(%.8X, %.8X, %d, %d)",
|
||||
handle_ptr, obj_attributes_ptr, count, limit);
|
||||
|
||||
XSemaphore* sem = new XSemaphore(state);
|
||||
sem->Initialize(count, limit);
|
||||
|
||||
// obj_attributes may have a name inside of it, if != NULL.
|
||||
if (obj_attributes_ptr) {
|
||||
//sem->SetName(...);
|
||||
}
|
||||
|
||||
if (handle_ptr) {
|
||||
SHIM_SET_MEM_32(handle_ptr, sem->handle());
|
||||
}
|
||||
|
||||
SHIM_SET_RETURN(X_STATUS_SUCCESS);
|
||||
}
|
||||
|
||||
|
||||
void xeKeInitializeSemaphore(
|
||||
void* semaphore_ptr, int32_t count, int32_t limit) {
|
||||
KernelState* state = shared_kernel_state_;
|
||||
@@ -896,6 +923,7 @@ void xe::kernel::xboxkrnl::RegisterThreadingExports(
|
||||
SHIM_SET_MAPPING("xboxkrnl.exe", KeResetEvent, state);
|
||||
SHIM_SET_MAPPING("xboxkrnl.exe", NtClearEvent, state);
|
||||
|
||||
SHIM_SET_MAPPING("xboxkrnl.exe", NtCreateSemaphore, state);
|
||||
SHIM_SET_MAPPING("xboxkrnl.exe", KeInitializeSemaphore, state);
|
||||
SHIM_SET_MAPPING("xboxkrnl.exe", KeReleaseSemaphore, state);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user