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