mirror of
https://github.com/Ryujinx/Ryujinx.git
synced 2024-06-02 13:18:46 +02:00
Merge 5148010c1e
into 2f427deb67
This commit is contained in:
commit
0753c80a5d
|
@ -166,6 +166,13 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Sfdnsres
|
|||
return GetAddrInfoRequestImpl(context, responseBufferPosition, responseBufferSize, false, 0, 0);
|
||||
}
|
||||
|
||||
[CommandCmif(7)]
|
||||
// GetNameInfoRequest
|
||||
public ResultCode GetNameInfoRequest(ServiceCtx context)
|
||||
{
|
||||
return GetNameInfoRequestImpl(context, false);
|
||||
}
|
||||
|
||||
[CommandCmif(8)]
|
||||
// GetCancelHandleRequest(u64, pid) -> u32
|
||||
public ResultCode GetCancelHandleRequest(ServiceCtx context)
|
||||
|
@ -244,6 +251,12 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Sfdnsres
|
|||
return GetAddrInfoRequestImpl(context, outputBufferPosition, outputBufferSize, true, optionsBufferPosition, optionsBufferSize);
|
||||
}
|
||||
|
||||
[CommandCmif(13)]
|
||||
public ResultCode GetNameInfoRequestWithOptions(ServiceCtx context)
|
||||
{
|
||||
return GetNameInfoRequestImpl(context, true);
|
||||
}
|
||||
|
||||
[CommandCmif(14)] // 5.0.0+
|
||||
// ResolverSetOptionRequest(buffer<unknown, 5, 0>, u64 unknown, u64 pid_placeholder, pid) -> (i32 ret, u32 bsd_errno)
|
||||
public ResultCode ResolverSetOptionRequest(ServiceCtx context)
|
||||
|
@ -660,6 +673,26 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Sfdnsres
|
|||
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(
|
||||
ServiceCtx context,
|
||||
bool withOptions,
|
||||
|
|
Loading…
Reference in New Issue
Block a user