0
0
Fork 0
mirror of https://github.com/GreemDev/Ryujinx.git synced 2024-12-23 04:35:46 +00:00

Address gdkchan's comment

This commit is contained in:
Mary 2022-08-31 19:41:43 +02:00 committed by Mary-nyan
parent f6a7309b14
commit 730d2f4b9b
2 changed files with 12 additions and 12 deletions

View file

@ -7,18 +7,18 @@ namespace Ryujinx.HLE.HOS.Services.Account.Acc
{ {
class IAsyncContext : IpcService class IAsyncContext : IpcService
{ {
protected AsyncExecution _asyncExecution; protected AsyncExecution AsyncExecution;
public IAsyncContext(AsyncExecution asyncExecution) public IAsyncContext(AsyncExecution asyncExecution)
{ {
_asyncExecution = asyncExecution; AsyncExecution = asyncExecution;
} }
[CommandHipc(0)] [CommandHipc(0)]
// GetSystemEvent() -> handle<copy> // GetSystemEvent() -> handle<copy>
public ResultCode GetSystemEvent(ServiceCtx context) public ResultCode GetSystemEvent(ServiceCtx context)
{ {
if (context.Process.HandleTable.GenerateHandle(_asyncExecution.SystemEvent.ReadableEvent, out int _systemEventHandle) != KernelResult.Success) if (context.Process.HandleTable.GenerateHandle(AsyncExecution.SystemEvent.ReadableEvent, out int _systemEventHandle) != KernelResult.Success)
{ {
throw new InvalidOperationException("Out of handles!"); throw new InvalidOperationException("Out of handles!");
} }
@ -32,14 +32,14 @@ namespace Ryujinx.HLE.HOS.Services.Account.Acc
// Cancel() // Cancel()
public ResultCode Cancel(ServiceCtx context) public ResultCode Cancel(ServiceCtx context)
{ {
if (!_asyncExecution.IsInitialized) if (!AsyncExecution.IsInitialized)
{ {
return ResultCode.AsyncExecutionNotInitialized; return ResultCode.AsyncExecutionNotInitialized;
} }
if (_asyncExecution.IsRunning) if (AsyncExecution.IsRunning)
{ {
_asyncExecution.Cancel(); AsyncExecution.Cancel();
} }
return ResultCode.Success; return ResultCode.Success;
@ -49,12 +49,12 @@ namespace Ryujinx.HLE.HOS.Services.Account.Acc
// HasDone() -> b8 // HasDone() -> b8
public ResultCode HasDone(ServiceCtx context) public ResultCode HasDone(ServiceCtx context)
{ {
if (!_asyncExecution.IsInitialized) if (!AsyncExecution.IsInitialized)
{ {
return ResultCode.AsyncExecutionNotInitialized; return ResultCode.AsyncExecutionNotInitialized;
} }
context.ResponseData.Write(_asyncExecution.SystemEvent.ReadableEvent.IsSignaled()); context.ResponseData.Write(AsyncExecution.SystemEvent.ReadableEvent.IsSignaled());
return ResultCode.Success; return ResultCode.Success;
} }
@ -63,12 +63,12 @@ namespace Ryujinx.HLE.HOS.Services.Account.Acc
// GetResult() // GetResult()
public ResultCode GetResult(ServiceCtx context) public ResultCode GetResult(ServiceCtx context)
{ {
if (!_asyncExecution.IsInitialized) if (!AsyncExecution.IsInitialized)
{ {
return ResultCode.AsyncExecutionNotInitialized; return ResultCode.AsyncExecutionNotInitialized;
} }
if (!_asyncExecution.SystemEvent.ReadableEvent.IsSignaled()) if (!AsyncExecution.SystemEvent.ReadableEvent.IsSignaled())
{ {
return ResultCode.Unknown41; return ResultCode.Unknown41;
} }

View file

@ -15,12 +15,12 @@ namespace Ryujinx.HLE.HOS.Services.Account.Acc
// GetNetworkServiceLicenseKind() -> nn::account::NetworkServiceLicenseKind // GetNetworkServiceLicenseKind() -> nn::account::NetworkServiceLicenseKind
public ResultCode GetNetworkServiceLicenseKind(ServiceCtx context) public ResultCode GetNetworkServiceLicenseKind(ServiceCtx context)
{ {
if (!_asyncExecution.IsInitialized) if (!AsyncExecution.IsInitialized)
{ {
return ResultCode.AsyncExecutionNotInitialized; return ResultCode.AsyncExecutionNotInitialized;
} }
if (!_asyncExecution.SystemEvent.ReadableEvent.IsSignaled()) if (!AsyncExecution.SystemEvent.ReadableEvent.IsSignaled())
{ {
return ResultCode.Unknown41; return ResultCode.Unknown41;
} }