[Kernel] Don't directly call RtlNtStatusToDosError export.
This commit is contained in:
parent
216bec15f6
commit
64403d5dc6
|
@ -356,7 +356,7 @@ dword_result_t NetDll_WSAWaitForMultipleEvents(dword_t num_events,
|
|||
} while (result == X_STATUS_ALERTED);
|
||||
|
||||
if (XFAILED(result)) {
|
||||
uint32_t error = xboxkrnl::RtlNtStatusToDosError(result);
|
||||
uint32_t error = xboxkrnl::xeRtlNtStatusToDosError(result);
|
||||
XThread::SetLastError(error);
|
||||
return ~0u;
|
||||
}
|
||||
|
@ -375,7 +375,7 @@ DECLARE_XAM_EXPORT1(NetDll_WSACreateEvent, kNetworking, kImplemented);
|
|||
dword_result_t NetDll_WSACloseEvent(dword_t event_handle) {
|
||||
X_STATUS result = kernel_state()->object_table()->ReleaseHandle(event_handle);
|
||||
if (XFAILED(result)) {
|
||||
uint32_t error = xboxkrnl::RtlNtStatusToDosError(result);
|
||||
uint32_t error = xboxkrnl::xeRtlNtStatusToDosError(result);
|
||||
XThread::SetLastError(error);
|
||||
return 0;
|
||||
}
|
||||
|
@ -386,7 +386,7 @@ DECLARE_XAM_EXPORT1(NetDll_WSACloseEvent, kNetworking, kImplemented);
|
|||
dword_result_t NetDll_WSAResetEvent(dword_t event_handle) {
|
||||
X_STATUS result = xboxkrnl::xeNtClearEvent(event_handle);
|
||||
if (XFAILED(result)) {
|
||||
uint32_t error = xboxkrnl::RtlNtStatusToDosError(result);
|
||||
uint32_t error = xboxkrnl::xeRtlNtStatusToDosError(result);
|
||||
XThread::SetLastError(error);
|
||||
return 0;
|
||||
}
|
||||
|
@ -397,7 +397,7 @@ DECLARE_XAM_EXPORT1(NetDll_WSAResetEvent, kNetworking, kImplemented);
|
|||
dword_result_t NetDll_WSASetEvent(dword_t event_handle) {
|
||||
X_STATUS result = xboxkrnl::xeNtSetEvent(event_handle, nullptr);
|
||||
if (XFAILED(result)) {
|
||||
uint32_t error = xboxkrnl::RtlNtStatusToDosError(result);
|
||||
uint32_t error = xboxkrnl::xeRtlNtStatusToDosError(result);
|
||||
XThread::SetLastError(error);
|
||||
return 0;
|
||||
}
|
||||
|
@ -567,7 +567,7 @@ dword_result_t NetDll_socket(dword_t caller, dword_t af, dword_t type,
|
|||
if (XFAILED(result)) {
|
||||
socket->Release();
|
||||
|
||||
uint32_t error = xboxkrnl::RtlNtStatusToDosError(result);
|
||||
uint32_t error = xboxkrnl::xeRtlNtStatusToDosError(result);
|
||||
XThread::SetLastError(error);
|
||||
return -1;
|
||||
}
|
||||
|
@ -643,7 +643,7 @@ dword_result_t NetDll_ioctlsocket(dword_t caller, dword_t socket_handle,
|
|||
|
||||
X_STATUS status = socket->IOControl(cmd, arg_ptr);
|
||||
if (XFAILED(status)) {
|
||||
XThread::SetLastError(xboxkrnl::RtlNtStatusToDosError(status));
|
||||
XThread::SetLastError(xboxkrnl::xeRtlNtStatusToDosError(status));
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -665,7 +665,7 @@ dword_result_t NetDll_bind(dword_t caller, dword_t socket_handle,
|
|||
N_XSOCKADDR_IN native_name(name);
|
||||
X_STATUS status = socket->Bind(&native_name, namelen);
|
||||
if (XFAILED(status)) {
|
||||
XThread::SetLastError(xboxkrnl::RtlNtStatusToDosError(status));
|
||||
XThread::SetLastError(xboxkrnl::xeRtlNtStatusToDosError(status));
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -686,7 +686,7 @@ dword_result_t NetDll_connect(dword_t caller, dword_t socket_handle,
|
|||
N_XSOCKADDR native_name(name);
|
||||
X_STATUS status = socket->Connect(&native_name, namelen);
|
||||
if (XFAILED(status)) {
|
||||
XThread::SetLastError(xboxkrnl::RtlNtStatusToDosError(status));
|
||||
XThread::SetLastError(xboxkrnl::xeRtlNtStatusToDosError(status));
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -706,7 +706,7 @@ dword_result_t NetDll_listen(dword_t caller, dword_t socket_handle,
|
|||
|
||||
X_STATUS status = socket->Listen(backlog);
|
||||
if (XFAILED(status)) {
|
||||
XThread::SetLastError(xboxkrnl::RtlNtStatusToDosError(status));
|
||||
XThread::SetLastError(xboxkrnl::xeRtlNtStatusToDosError(status));
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
|
|
@ -971,7 +971,7 @@ const error_lookup_table error_tables[] = {
|
|||
};
|
||||
#undef MAKE_ENTRY
|
||||
|
||||
dword_result_t RtlNtStatusToDosError(dword_t source_status) {
|
||||
uint32_t xeRtlNtStatusToDosError(uint32_t source_status) {
|
||||
uint32_t status = source_status;
|
||||
if (!status || (status & 0x20000000)) {
|
||||
return status;
|
||||
|
@ -1010,6 +1010,10 @@ dword_result_t RtlNtStatusToDosError(dword_t source_status) {
|
|||
XELOGE("RtlNtStatusToDosError lookup NOT IMPLEMENTED");
|
||||
return 317; // ERROR_MR_MID_NOT_FOUND
|
||||
}
|
||||
|
||||
dword_result_t RtlNtStatusToDosError(dword_t source_status) {
|
||||
return xeRtlNtStatusToDosError(source_status);
|
||||
}
|
||||
DECLARE_XBOXKRNL_EXPORT3(RtlNtStatusToDosError, kNone, kImportant,
|
||||
kHighFrequency, kLogResult);
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ namespace xe {
|
|||
namespace kernel {
|
||||
namespace xboxkrnl {
|
||||
|
||||
dword_result_t RtlNtStatusToDosError(dword_t source_status);
|
||||
uint32_t xeRtlNtStatusToDosError(uint32_t source_status);
|
||||
|
||||
} // namespace xboxkrnl
|
||||
} // namespace kernel
|
||||
|
|
Loading…
Reference in New Issue