mirror of
https://git.naxdy.org/Mirror/Ryujinx.git
synced 2024-12-26 18:43:04 +00:00
Write data properly
This commit is contained in:
parent
7b399493d6
commit
5148010c1e
1 changed files with 28 additions and 3 deletions
|
@ -166,6 +166,13 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Sfdnsres
|
||||||
return GetAddrInfoRequestImpl(context, responseBufferPosition, responseBufferSize, false, 0, 0);
|
return GetAddrInfoRequestImpl(context, responseBufferPosition, responseBufferSize, false, 0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[CommandCmif(7)]
|
||||||
|
// GetNameInfoRequest
|
||||||
|
public ResultCode GetNameInfoRequest(ServiceCtx context)
|
||||||
|
{
|
||||||
|
return GetNameInfoRequestImpl(context, false);
|
||||||
|
}
|
||||||
|
|
||||||
[CommandCmif(8)]
|
[CommandCmif(8)]
|
||||||
// GetCancelHandleRequest(u64, pid) -> u32
|
// GetCancelHandleRequest(u64, pid) -> u32
|
||||||
public ResultCode GetCancelHandleRequest(ServiceCtx context)
|
public ResultCode GetCancelHandleRequest(ServiceCtx context)
|
||||||
|
@ -247,9 +254,7 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Sfdnsres
|
||||||
[CommandCmif(13)]
|
[CommandCmif(13)]
|
||||||
public ResultCode GetNameInfoRequestWithOptions(ServiceCtx context)
|
public ResultCode GetNameInfoRequestWithOptions(ServiceCtx context)
|
||||||
{
|
{
|
||||||
Logger.Stub?.PrintStub(LogClass.ServiceSfdnsres);
|
return GetNameInfoRequestImpl(context, true);
|
||||||
|
|
||||||
return ResultCode.Success;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[CommandCmif(14)] // 5.0.0+
|
[CommandCmif(14)] // 5.0.0+
|
||||||
|
@ -668,6 +673,26 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Sfdnsres
|
||||||
return region.Memory.Span.Length - data.Length;
|
return region.Memory.Span.Length - data.Length;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static ResultCode GetNameInfoRequestImpl(
|
||||||
|
ServiceCtx context,
|
||||||
|
bool withOptions)
|
||||||
|
{
|
||||||
|
if (!context.Device.Configuration.EnableInternetAccess)
|
||||||
|
{
|
||||||
|
Logger.Info?.Print(LogClass.ServiceSfdnsres, "Guest network access disabled, DNS Blocked.");
|
||||||
|
|
||||||
|
WriteResponse(context, withOptions, 0, GaiError.NoData, NetDbError.NoAddress);
|
||||||
|
|
||||||
|
return ResultCode.Success;
|
||||||
|
}
|
||||||
|
|
||||||
|
Logger.Info?.PrintStub(LogClass.ServiceSfdnsres);
|
||||||
|
|
||||||
|
WriteResponse(context, withOptions, 0, GaiError.NoData, NetDbError.NoAddress);
|
||||||
|
|
||||||
|
return ResultCode.Success;
|
||||||
|
}
|
||||||
|
|
||||||
private static void WriteResponse(
|
private static void WriteResponse(
|
||||||
ServiceCtx context,
|
ServiceCtx context,
|
||||||
bool withOptions,
|
bool withOptions,
|
||||||
|
|
Loading…
Reference in a new issue