mirror of
https://git.ryujinx.app/ryubing/ryujinx.git
synced 2025-07-25 10:37:11 +02:00
misc: chore: Fix object creation in HLE project
This commit is contained in:
parent
f1fd5c9366
commit
beab133c8d
48 changed files with 194 additions and 194 deletions
|
@ -60,7 +60,7 @@ namespace Ryujinx.HLE.HOS.Services.Account.Acc
|
|||
}
|
||||
}
|
||||
|
||||
public void AddUser(string name, byte[] image, UserId userId = new UserId())
|
||||
public void AddUser(string name, byte[] image, UserId userId = new())
|
||||
{
|
||||
if (userId.IsNull)
|
||||
{
|
||||
|
@ -194,7 +194,7 @@ namespace Ryujinx.HLE.HOS.Services.Account.Acc
|
|||
SaveDataFilter saveDataFilter = SaveDataFilter.Make(programId: default, saveType: default,
|
||||
new LibHac.Fs.UserId((ulong)userId.High, (ulong)userId.Low), saveDataId: default, index: default);
|
||||
|
||||
using UniqueRef<SaveDataIterator> saveDataIterator = new UniqueRef<SaveDataIterator>();
|
||||
using UniqueRef<SaveDataIterator> saveDataIterator = new();
|
||||
|
||||
_horizonClient.Fs.OpenSaveDataIterator(ref saveDataIterator.Ref, SaveDataSpaceId.User, in saveDataFilter).ThrowIfFailure();
|
||||
|
||||
|
|
|
@ -51,7 +51,7 @@ namespace Ryujinx.HLE.HOS.Services.Account.Acc.AccountService
|
|||
byte[] deviceAccountId = new byte[0x10];
|
||||
RandomNumberGenerator.Fill(deviceId);
|
||||
|
||||
SecurityTokenDescriptor descriptor = new SecurityTokenDescriptor
|
||||
SecurityTokenDescriptor descriptor = new()
|
||||
{
|
||||
Subject = new GenericIdentity(Convert.ToHexString(rawUserId).ToLower()),
|
||||
SigningCredentials = credentials,
|
||||
|
|
|
@ -214,7 +214,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Sys
|
|||
|
||||
_vrModeEnabled = vrModeEnabled;
|
||||
|
||||
using LblApi lblApi = new LblApi();
|
||||
using LblApi lblApi = new();
|
||||
|
||||
if (vrModeEnabled)
|
||||
{
|
||||
|
|
|
@ -118,7 +118,7 @@ namespace Ryujinx.HLE.HOS.Services.Caps
|
|||
}
|
||||
|
||||
// NOTE: The saved JPEG file doesn't have the limitation in the extra EXIF data.
|
||||
using SKBitmap bitmap = new SKBitmap(new SKImageInfo(1280, 720, SKColorType.Rgba8888));
|
||||
using SKBitmap bitmap = new(new SKImageInfo(1280, 720, SKColorType.Rgba8888));
|
||||
Marshal.Copy(screenshotData, 0, bitmap.GetPixels(), screenshotData.Length);
|
||||
using SKData data = bitmap.Encode(SKEncodedImageFormat.Jpeg, 80);
|
||||
using FileStream file = File.OpenWrite(filePath);
|
||||
|
|
|
@ -26,7 +26,7 @@ namespace Ryujinx.HLE.HOS.Services.Fs.FileSystemProxy
|
|||
try
|
||||
{
|
||||
LocalStorage storage = new(pfsPath, FileAccess.Read, FileMode.Open);
|
||||
PartitionFileSystem pfs = new PartitionFileSystem();
|
||||
PartitionFileSystem pfs = new();
|
||||
using SharedRef<LibHac.Fs.Fsa.IFileSystem> nsp = new(pfs);
|
||||
pfs.Initialize(storage).ThrowIfFailure();
|
||||
|
||||
|
@ -58,7 +58,7 @@ namespace Ryujinx.HLE.HOS.Services.Fs.FileSystemProxy
|
|||
}
|
||||
|
||||
LibHac.Fs.Fsa.IFileSystem fileSystem = nca.OpenFileSystem(NcaSectionType.Data, context.Device.System.FsIntegrityCheckLevel);
|
||||
using SharedRef<LibHac.Fs.Fsa.IFileSystem> sharedFs = new SharedRef<LibHac.Fs.Fsa.IFileSystem>(fileSystem);
|
||||
using SharedRef<LibHac.Fs.Fsa.IFileSystem> sharedFs = new(fileSystem);
|
||||
|
||||
using SharedRef<LibHac.FsSrv.Sf.IFileSystem> adapter = FileSystemInterfaceAdapter.CreateShared(ref sharedFs.Ref, true);
|
||||
|
||||
|
@ -99,7 +99,7 @@ namespace Ryujinx.HLE.HOS.Services.Fs.FileSystemProxy
|
|||
|
||||
string filename = fullPath.Replace(archivePath.FullName, string.Empty).TrimStart('\\');
|
||||
|
||||
using UniqueRef<LibHac.Fs.Fsa.IFile> ncaFile = new UniqueRef<LibHac.Fs.Fsa.IFile>();
|
||||
using UniqueRef<LibHac.Fs.Fsa.IFile> ncaFile = new();
|
||||
|
||||
Result result = nsp.OpenFile(ref ncaFile.Ref, filename.ToU8Span(), OpenMode.Read);
|
||||
if (result.IsFailure())
|
||||
|
@ -122,7 +122,7 @@ namespace Ryujinx.HLE.HOS.Services.Fs.FileSystemProxy
|
|||
{
|
||||
foreach (DirectoryEntryEx ticketEntry in nsp.EnumerateEntries("/", "*.tik"))
|
||||
{
|
||||
using UniqueRef<LibHac.Fs.Fsa.IFile> ticketFile = new UniqueRef<LibHac.Fs.Fsa.IFile>();
|
||||
using UniqueRef<LibHac.Fs.Fsa.IFile> ticketFile = new();
|
||||
|
||||
Result result = nsp.OpenFile(ref ticketFile.Ref, ticketEntry.FullPath.ToU8Span(), OpenMode.Read);
|
||||
|
||||
|
|
|
@ -111,7 +111,7 @@ namespace Ryujinx.HLE.HOS.Services.Fs.FileSystemProxy
|
|||
uint mode = context.RequestData.ReadUInt32();
|
||||
|
||||
ref readonly Path name = ref FileSystemProxyHelper.GetSfPath(context);
|
||||
using SharedRef<LibHac.FsSrv.Sf.IFile> file = new SharedRef<LibHac.FsSrv.Sf.IFile>();
|
||||
using SharedRef<LibHac.FsSrv.Sf.IFile> file = new();
|
||||
|
||||
Result result = _fileSystem.Get.OpenFile(ref file.Ref, in name, mode);
|
||||
|
||||
|
@ -132,7 +132,7 @@ namespace Ryujinx.HLE.HOS.Services.Fs.FileSystemProxy
|
|||
uint mode = context.RequestData.ReadUInt32();
|
||||
|
||||
ref readonly Path name = ref FileSystemProxyHelper.GetSfPath(context);
|
||||
using SharedRef<LibHac.FsSrv.Sf.IDirectory> dir = new SharedRef<LibHac.FsSrv.Sf.IDirectory>();
|
||||
using SharedRef<LibHac.FsSrv.Sf.IDirectory> dir = new();
|
||||
|
||||
Result result = _fileSystem.Get.OpenDirectory(ref dir.Ref, name, mode);
|
||||
|
||||
|
|
|
@ -110,7 +110,7 @@ namespace Ryujinx.HLE.HOS.Services.Fs
|
|||
BisPartitionId bisPartitionId = (BisPartitionId)context.RequestData.ReadInt32();
|
||||
|
||||
ref readonly FspPath path = ref FileSystemProxyHelper.GetFspPath(context);
|
||||
using SharedRef<IFileSystem> fileSystem = new SharedRef<IFileSystem>();
|
||||
using SharedRef<IFileSystem> fileSystem = new();
|
||||
|
||||
Result result = _baseFileSystemProxy.Get.OpenBisFileSystem(ref fileSystem.Ref, in path, bisPartitionId);
|
||||
if (result.IsFailure())
|
||||
|
@ -128,7 +128,7 @@ namespace Ryujinx.HLE.HOS.Services.Fs
|
|||
public ResultCode OpenBisStorage(ServiceCtx context)
|
||||
{
|
||||
BisPartitionId bisPartitionId = (BisPartitionId)context.RequestData.ReadInt32();
|
||||
using SharedRef<IStorage> storage = new SharedRef<IStorage>();
|
||||
using SharedRef<IStorage> storage = new();
|
||||
|
||||
Result result = _baseFileSystemProxy.Get.OpenBisStorage(ref storage.Ref, bisPartitionId);
|
||||
if (result.IsFailure())
|
||||
|
@ -152,7 +152,7 @@ namespace Ryujinx.HLE.HOS.Services.Fs
|
|||
// OpenSdCardFileSystem() -> object<nn::fssrv::sf::IFileSystem>
|
||||
public ResultCode OpenSdCardFileSystem(ServiceCtx context)
|
||||
{
|
||||
using SharedRef<IFileSystem> fileSystem = new SharedRef<IFileSystem>();
|
||||
using SharedRef<IFileSystem> fileSystem = new();
|
||||
|
||||
Result result = _baseFileSystemProxy.Get.OpenSdCardFileSystem(ref fileSystem.Ref);
|
||||
if (result.IsFailure())
|
||||
|
@ -260,7 +260,7 @@ namespace Ryujinx.HLE.HOS.Services.Fs
|
|||
{
|
||||
GameCardHandle handle = context.RequestData.ReadUInt32();
|
||||
GameCardPartitionRaw partitionId = (GameCardPartitionRaw)context.RequestData.ReadInt32();
|
||||
using SharedRef<IStorage> storage = new SharedRef<IStorage>();
|
||||
using SharedRef<IStorage> storage = new();
|
||||
|
||||
Result result = _baseFileSystemProxy.Get.OpenGameCardStorage(ref storage.Ref, handle, partitionId);
|
||||
if (result.IsFailure())
|
||||
|
@ -279,7 +279,7 @@ namespace Ryujinx.HLE.HOS.Services.Fs
|
|||
{
|
||||
GameCardHandle handle = context.RequestData.ReadUInt32();
|
||||
GameCardPartition partitionId = (GameCardPartition)context.RequestData.ReadInt32();
|
||||
using SharedRef<IFileSystem> fileSystem = new SharedRef<IFileSystem>();
|
||||
using SharedRef<IFileSystem> fileSystem = new();
|
||||
|
||||
Result result = _baseFileSystemProxy.Get.OpenGameCardFileSystem(ref fileSystem.Ref, handle, partitionId);
|
||||
if (result.IsFailure())
|
||||
|
@ -360,7 +360,7 @@ namespace Ryujinx.HLE.HOS.Services.Fs
|
|||
{
|
||||
SaveDataSpaceId spaceId = (SaveDataSpaceId)context.RequestData.ReadInt64();
|
||||
SaveDataAttribute attribute = context.RequestData.ReadStruct<SaveDataAttribute>();
|
||||
using SharedRef<IFileSystem> fileSystem = new SharedRef<IFileSystem>();
|
||||
using SharedRef<IFileSystem> fileSystem = new();
|
||||
|
||||
Result result = _baseFileSystemProxy.Get.OpenSaveDataFileSystem(ref fileSystem.Ref, spaceId, in attribute);
|
||||
if (result.IsFailure())
|
||||
|
@ -379,7 +379,7 @@ namespace Ryujinx.HLE.HOS.Services.Fs
|
|||
{
|
||||
SaveDataSpaceId spaceId = (SaveDataSpaceId)context.RequestData.ReadInt64();
|
||||
SaveDataAttribute attribute = context.RequestData.ReadStruct<SaveDataAttribute>();
|
||||
using SharedRef<IFileSystem> fileSystem = new SharedRef<IFileSystem>();
|
||||
using SharedRef<IFileSystem> fileSystem = new();
|
||||
|
||||
Result result = _baseFileSystemProxy.Get.OpenSaveDataFileSystemBySystemSaveDataId(ref fileSystem.Ref, spaceId, in attribute);
|
||||
if (result.IsFailure())
|
||||
|
@ -398,7 +398,7 @@ namespace Ryujinx.HLE.HOS.Services.Fs
|
|||
{
|
||||
SaveDataSpaceId spaceId = (SaveDataSpaceId)context.RequestData.ReadInt64();
|
||||
SaveDataAttribute attribute = context.RequestData.ReadStruct<SaveDataAttribute>();
|
||||
using SharedRef<IFileSystem> fileSystem = new SharedRef<IFileSystem>();
|
||||
using SharedRef<IFileSystem> fileSystem = new();
|
||||
|
||||
Result result = _baseFileSystemProxy.Get.OpenReadOnlySaveDataFileSystem(ref fileSystem.Ref, spaceId, in attribute);
|
||||
if (result.IsFailure())
|
||||
|
@ -469,7 +469,7 @@ namespace Ryujinx.HLE.HOS.Services.Fs
|
|||
// OpenSaveDataInfoReader() -> object<nn::fssrv::sf::ISaveDataInfoReader>
|
||||
public ResultCode OpenSaveDataInfoReader(ServiceCtx context)
|
||||
{
|
||||
using SharedRef<LibHac.FsSrv.Sf.ISaveDataInfoReader> infoReader = new SharedRef<LibHac.FsSrv.Sf.ISaveDataInfoReader>();
|
||||
using SharedRef<LibHac.FsSrv.Sf.ISaveDataInfoReader> infoReader = new();
|
||||
|
||||
Result result = _baseFileSystemProxy.Get.OpenSaveDataInfoReader(ref infoReader.Ref);
|
||||
if (result.IsFailure())
|
||||
|
@ -487,7 +487,7 @@ namespace Ryujinx.HLE.HOS.Services.Fs
|
|||
public ResultCode OpenSaveDataInfoReaderBySaveDataSpaceId(ServiceCtx context)
|
||||
{
|
||||
SaveDataSpaceId spaceId = (SaveDataSpaceId)context.RequestData.ReadByte();
|
||||
using SharedRef<LibHac.FsSrv.Sf.ISaveDataInfoReader> infoReader = new SharedRef<LibHac.FsSrv.Sf.ISaveDataInfoReader>();
|
||||
using SharedRef<LibHac.FsSrv.Sf.ISaveDataInfoReader> infoReader = new();
|
||||
|
||||
Result result = _baseFileSystemProxy.Get.OpenSaveDataInfoReaderBySaveDataSpaceId(ref infoReader.Ref, spaceId);
|
||||
if (result.IsFailure())
|
||||
|
@ -504,7 +504,7 @@ namespace Ryujinx.HLE.HOS.Services.Fs
|
|||
// OpenSaveDataInfoReaderOnlyCacheStorage() -> object<nn::fssrv::sf::ISaveDataInfoReader>
|
||||
public ResultCode OpenSaveDataInfoReaderOnlyCacheStorage(ServiceCtx context)
|
||||
{
|
||||
using SharedRef<LibHac.FsSrv.Sf.ISaveDataInfoReader> infoReader = new SharedRef<LibHac.FsSrv.Sf.ISaveDataInfoReader>();
|
||||
using SharedRef<LibHac.FsSrv.Sf.ISaveDataInfoReader> infoReader = new();
|
||||
|
||||
Result result = _baseFileSystemProxy.Get.OpenSaveDataInfoReaderOnlyCacheStorage(ref infoReader.Ref);
|
||||
if (result.IsFailure())
|
||||
|
@ -523,7 +523,7 @@ namespace Ryujinx.HLE.HOS.Services.Fs
|
|||
{
|
||||
SaveDataSpaceId spaceId = (SaveDataSpaceId)context.RequestData.ReadInt64();
|
||||
ulong saveDataId = context.RequestData.ReadUInt64();
|
||||
using SharedRef<IFileSystem> fileSystem = new SharedRef<IFileSystem>();
|
||||
using SharedRef<IFileSystem> fileSystem = new();
|
||||
|
||||
Result result = _baseFileSystemProxy.Get.OpenSaveDataInternalStorageFileSystem(ref fileSystem.Ref, spaceId, saveDataId);
|
||||
if (result.IsFailure())
|
||||
|
@ -587,7 +587,7 @@ namespace Ryujinx.HLE.HOS.Services.Fs
|
|||
{
|
||||
SaveDataSpaceId spaceId = (SaveDataSpaceId)context.RequestData.ReadInt64();
|
||||
SaveDataFilter filter = context.RequestData.ReadStruct<SaveDataFilter>();
|
||||
using SharedRef<LibHac.FsSrv.Sf.ISaveDataInfoReader> infoReader = new SharedRef<LibHac.FsSrv.Sf.ISaveDataInfoReader>();
|
||||
using SharedRef<LibHac.FsSrv.Sf.ISaveDataInfoReader> infoReader = new();
|
||||
|
||||
Result result = _baseFileSystemProxy.Get.OpenSaveDataInfoReaderWithFilter(ref infoReader.Ref, spaceId, in filter);
|
||||
if (result.IsFailure())
|
||||
|
@ -664,7 +664,7 @@ namespace Ryujinx.HLE.HOS.Services.Fs
|
|||
SaveDataSpaceId spaceId = (SaveDataSpaceId)context.RequestData.ReadInt32();
|
||||
SaveDataMetaType metaType = (SaveDataMetaType)context.RequestData.ReadInt32();
|
||||
SaveDataAttribute attribute = context.RequestData.ReadStruct<SaveDataAttribute>();
|
||||
using SharedRef<LibHac.FsSrv.Sf.IFile> file = new SharedRef<LibHac.FsSrv.Sf.IFile>();
|
||||
using SharedRef<LibHac.FsSrv.Sf.IFile> file = new();
|
||||
|
||||
Result result = _baseFileSystemProxy.Get.OpenSaveDataMetaFile(ref file.Ref, spaceId, in attribute, metaType);
|
||||
if (result.IsFailure())
|
||||
|
@ -702,7 +702,7 @@ namespace Ryujinx.HLE.HOS.Services.Fs
|
|||
public ResultCode OpenImageDirectoryFileSystem(ServiceCtx context)
|
||||
{
|
||||
ImageDirectoryId directoryId = (ImageDirectoryId)context.RequestData.ReadInt32();
|
||||
using SharedRef<IFileSystem> fileSystem = new SharedRef<IFileSystem>();
|
||||
using SharedRef<IFileSystem> fileSystem = new();
|
||||
|
||||
Result result = _baseFileSystemProxy.Get.OpenImageDirectoryFileSystem(ref fileSystem.Ref, directoryId);
|
||||
if (result.IsFailure())
|
||||
|
@ -719,7 +719,7 @@ namespace Ryujinx.HLE.HOS.Services.Fs
|
|||
public ResultCode OpenBaseFileSystem(ServiceCtx context)
|
||||
{
|
||||
BaseFileSystemId fileSystemId = (BaseFileSystemId)context.RequestData.ReadInt32();
|
||||
using SharedRef<IFileSystem> fileSystem = new SharedRef<IFileSystem>();
|
||||
using SharedRef<IFileSystem> fileSystem = new();
|
||||
|
||||
Result result = _baseFileSystemProxy.Get.OpenBaseFileSystem(ref fileSystem.Ref, fileSystemId);
|
||||
if (result.IsFailure())
|
||||
|
@ -736,7 +736,7 @@ namespace Ryujinx.HLE.HOS.Services.Fs
|
|||
public ResultCode OpenContentStorageFileSystem(ServiceCtx context)
|
||||
{
|
||||
ContentStorageId contentStorageId = (ContentStorageId)context.RequestData.ReadInt32();
|
||||
using SharedRef<IFileSystem> fileSystem = new SharedRef<IFileSystem>();
|
||||
using SharedRef<IFileSystem> fileSystem = new();
|
||||
|
||||
Result result = _baseFileSystemProxy.Get.OpenContentStorageFileSystem(ref fileSystem.Ref, contentStorageId);
|
||||
if (result.IsFailure())
|
||||
|
@ -753,7 +753,7 @@ namespace Ryujinx.HLE.HOS.Services.Fs
|
|||
public ResultCode OpenCloudBackupWorkStorageFileSystem(ServiceCtx context)
|
||||
{
|
||||
CloudBackupWorkStorageId storageId = (CloudBackupWorkStorageId)context.RequestData.ReadInt32();
|
||||
using SharedRef<IFileSystem> fileSystem = new SharedRef<IFileSystem>();
|
||||
using SharedRef<IFileSystem> fileSystem = new();
|
||||
|
||||
Result result = _baseFileSystemProxy.Get.OpenCloudBackupWorkStorageFileSystem(ref fileSystem.Ref, storageId);
|
||||
if (result.IsFailure())
|
||||
|
@ -770,7 +770,7 @@ namespace Ryujinx.HLE.HOS.Services.Fs
|
|||
public ResultCode OpenCustomStorageFileSystem(ServiceCtx context)
|
||||
{
|
||||
CustomStorageId customStorageId = (CustomStorageId)context.RequestData.ReadInt32();
|
||||
using SharedRef<IFileSystem> fileSystem = new SharedRef<IFileSystem>();
|
||||
using SharedRef<IFileSystem> fileSystem = new();
|
||||
|
||||
Result result = _baseFileSystemProxy.Get.OpenCustomStorageFileSystem(ref fileSystem.Ref, customStorageId);
|
||||
if (result.IsFailure())
|
||||
|
@ -788,8 +788,8 @@ namespace Ryujinx.HLE.HOS.Services.Fs
|
|||
public ResultCode OpenDataStorageByCurrentProcess(ServiceCtx context)
|
||||
{
|
||||
LibHac.Fs.IStorage storage = context.Device.FileSystem.GetRomFs(_pid).AsStorage(true);
|
||||
using SharedRef<LibHac.Fs.IStorage> sharedStorage = new SharedRef<LibHac.Fs.IStorage>(storage);
|
||||
using SharedRef<IStorage> sfStorage = new SharedRef<IStorage>(new StorageInterfaceAdapter(ref sharedStorage.Ref));
|
||||
using SharedRef<LibHac.Fs.IStorage> sharedStorage = new(storage);
|
||||
using SharedRef<IStorage> sfStorage = new(new StorageInterfaceAdapter(ref sharedStorage.Ref));
|
||||
|
||||
MakeObject(context, new FileSystemProxy.IStorage(ref sfStorage.Ref));
|
||||
|
||||
|
@ -813,8 +813,8 @@ namespace Ryujinx.HLE.HOS.Services.Fs
|
|||
Logger.Info?.Print(LogClass.Loader, $"Opened AddOnContent Data TitleID={titleId:X16}");
|
||||
|
||||
LibHac.Fs.IStorage storage = context.Device.FileSystem.ModLoader.ApplyRomFsMods(titleId, aocStorage);
|
||||
using SharedRef<LibHac.Fs.IStorage> sharedStorage = new SharedRef<LibHac.Fs.IStorage>(storage);
|
||||
using SharedRef<IStorage> sfStorage = new SharedRef<IStorage>(new StorageInterfaceAdapter(ref sharedStorage.Ref));
|
||||
using SharedRef<LibHac.Fs.IStorage> sharedStorage = new(storage);
|
||||
using SharedRef<IStorage> sfStorage = new(new StorageInterfaceAdapter(ref sharedStorage.Ref));
|
||||
|
||||
MakeObject(context, new FileSystemProxy.IStorage(ref sfStorage.Ref));
|
||||
|
||||
|
@ -848,8 +848,8 @@ namespace Ryujinx.HLE.HOS.Services.Fs
|
|||
LibHac.Fs.IStorage ncaStorage = new LocalStorage(ncaPath, FileAccess.Read, FileMode.Open);
|
||||
Nca nca = new(context.Device.System.KeySet, ncaStorage);
|
||||
LibHac.Fs.IStorage romfsStorage = nca.OpenStorage(NcaSectionType.Data, context.Device.System.FsIntegrityCheckLevel);
|
||||
using SharedRef<LibHac.Fs.IStorage> sharedStorage = new SharedRef<LibHac.Fs.IStorage>(romfsStorage);
|
||||
using SharedRef<IStorage> sfStorage = new SharedRef<IStorage>(new StorageInterfaceAdapter(ref sharedStorage.Ref));
|
||||
using SharedRef<LibHac.Fs.IStorage> sharedStorage = new(romfsStorage);
|
||||
using SharedRef<IStorage> sfStorage = new(new StorageInterfaceAdapter(ref sharedStorage.Ref));
|
||||
|
||||
MakeObject(context, new FileSystemProxy.IStorage(ref sfStorage.Ref));
|
||||
}
|
||||
|
@ -879,8 +879,8 @@ namespace Ryujinx.HLE.HOS.Services.Fs
|
|||
public ResultCode OpenPatchDataStorageByCurrentProcess(ServiceCtx context)
|
||||
{
|
||||
LibHac.Fs.IStorage storage = context.Device.FileSystem.GetRomFs(_pid).AsStorage(true);
|
||||
using SharedRef<LibHac.Fs.IStorage> sharedStorage = new SharedRef<LibHac.Fs.IStorage>(storage);
|
||||
using SharedRef<IStorage> sfStorage = new SharedRef<IStorage>(new StorageInterfaceAdapter(ref sharedStorage.Ref));
|
||||
using SharedRef<LibHac.Fs.IStorage> sharedStorage = new(storage);
|
||||
using SharedRef<IStorage> sfStorage = new(new StorageInterfaceAdapter(ref sharedStorage.Ref));
|
||||
|
||||
MakeObject(context, new FileSystemProxy.IStorage(ref sfStorage.Ref));
|
||||
|
||||
|
@ -899,8 +899,8 @@ namespace Ryujinx.HLE.HOS.Services.Fs
|
|||
}
|
||||
|
||||
LibHac.Fs.IStorage storage = context.Device.FileSystem.GetRomFs(_pid).AsStorage(true);
|
||||
using SharedRef<LibHac.Fs.IStorage> sharedStorage = new SharedRef<LibHac.Fs.IStorage>(storage);
|
||||
using SharedRef<IStorage> sfStorage = new SharedRef<IStorage>(new StorageInterfaceAdapter(ref sharedStorage.Ref));
|
||||
using SharedRef<LibHac.Fs.IStorage> sharedStorage = new(storage);
|
||||
using SharedRef<IStorage> sfStorage = new(new StorageInterfaceAdapter(ref sharedStorage.Ref));
|
||||
|
||||
MakeObject(context, new FileSystemProxy.IStorage(ref sfStorage.Ref));
|
||||
|
||||
|
@ -911,7 +911,7 @@ namespace Ryujinx.HLE.HOS.Services.Fs
|
|||
// OpenDataStorageByCurrentProcess() -> object<nn::fssrv::sf::IStorage> dataStorage
|
||||
public ResultCode OpenDeviceOperator(ServiceCtx context)
|
||||
{
|
||||
using SharedRef<LibHac.FsSrv.Sf.IDeviceOperator> deviceOperator = new SharedRef<LibHac.FsSrv.Sf.IDeviceOperator>();
|
||||
using SharedRef<LibHac.FsSrv.Sf.IDeviceOperator> deviceOperator = new();
|
||||
|
||||
Result result = _baseFileSystemProxy.Get.OpenDeviceOperator(ref deviceOperator.Ref);
|
||||
if (result.IsFailure())
|
||||
|
@ -1310,7 +1310,7 @@ namespace Ryujinx.HLE.HOS.Services.Fs
|
|||
[CommandCmif(1008)]
|
||||
public ResultCode OpenRegisteredUpdatePartition(ServiceCtx context)
|
||||
{
|
||||
using SharedRef<IFileSystem> fileSystem = new SharedRef<IFileSystem>();
|
||||
using SharedRef<IFileSystem> fileSystem = new();
|
||||
|
||||
Result result = _baseFileSystemProxy.Get.OpenRegisteredUpdatePartition(ref fileSystem.Ref);
|
||||
if (result.IsFailure())
|
||||
|
@ -1420,7 +1420,7 @@ namespace Ryujinx.HLE.HOS.Services.Fs
|
|||
// OpenMultiCommitManager() -> object<nn::fssrv::sf::IMultiCommitManager>
|
||||
public ResultCode OpenMultiCommitManager(ServiceCtx context)
|
||||
{
|
||||
using SharedRef<LibHac.FsSrv.Sf.IMultiCommitManager> commitManager = new SharedRef<LibHac.FsSrv.Sf.IMultiCommitManager>();
|
||||
using SharedRef<LibHac.FsSrv.Sf.IMultiCommitManager> commitManager = new();
|
||||
|
||||
Result result = _baseFileSystemProxy.Get.OpenMultiCommitManager(ref commitManager.Ref);
|
||||
if (result.IsFailure())
|
||||
|
|
|
@ -244,7 +244,7 @@ namespace Ryujinx.HLE.HOS.Services.Ldn.UserServiceCreator.LdnMitm
|
|||
|
||||
byte[] ip = address.GetAddressBytes();
|
||||
|
||||
Array6<byte> macAddress = new Array6<byte>();
|
||||
Array6<byte> macAddress = new();
|
||||
new byte[] { 0x02, 0x00, ip[0], ip[1], ip[2], ip[3] }.CopyTo(macAddress.AsSpan());
|
||||
|
||||
return macAddress;
|
||||
|
|
|
@ -138,7 +138,7 @@ namespace Ryujinx.HLE.HOS.Services.Ldn.UserServiceCreator.LdnMitm.Proxy
|
|||
|
||||
lock (_scanLock)
|
||||
{
|
||||
Dictionary<ulong, NetworkInfo> results = new Dictionary<ulong, NetworkInfo>();
|
||||
Dictionary<ulong, NetworkInfo> results = new();
|
||||
|
||||
foreach (KeyValuePair<ulong, NetworkInfo> last in _scanResultsLast)
|
||||
{
|
||||
|
|
|
@ -22,7 +22,7 @@ namespace Ryujinx.HLE.HOS.Services.Ldn.UserServiceCreator.LdnRyu
|
|||
{
|
||||
public bool NeedsRealId => true;
|
||||
|
||||
private static InitializeMessage InitializeMemory = new InitializeMessage();
|
||||
private static InitializeMessage InitializeMemory = new();
|
||||
|
||||
private const int InactiveTimeout = 6000;
|
||||
private const int FailureTimeout = 4000;
|
||||
|
@ -31,16 +31,16 @@ namespace Ryujinx.HLE.HOS.Services.Ldn.UserServiceCreator.LdnRyu
|
|||
private bool _useP2pProxy;
|
||||
private NetworkError _lastError;
|
||||
|
||||
private readonly ManualResetEvent _connected = new ManualResetEvent(false);
|
||||
private readonly ManualResetEvent _error = new ManualResetEvent(false);
|
||||
private readonly ManualResetEvent _scan = new ManualResetEvent(false);
|
||||
private readonly ManualResetEvent _reject = new ManualResetEvent(false);
|
||||
private readonly AutoResetEvent _apConnected = new AutoResetEvent(false);
|
||||
private readonly ManualResetEvent _connected = new(false);
|
||||
private readonly ManualResetEvent _error = new(false);
|
||||
private readonly ManualResetEvent _scan = new(false);
|
||||
private readonly ManualResetEvent _reject = new(false);
|
||||
private readonly AutoResetEvent _apConnected = new(false);
|
||||
|
||||
private readonly RyuLdnProtocol _protocol;
|
||||
private readonly NetworkTimeout _timeout;
|
||||
|
||||
private readonly List<NetworkInfo> _availableGames = new List<NetworkInfo>();
|
||||
private readonly List<NetworkInfo> _availableGames = new();
|
||||
private DisconnectReason _disconnectReason;
|
||||
|
||||
private P2pProxyServer _hostedProxy;
|
||||
|
@ -490,7 +490,7 @@ namespace Ryujinx.HLE.HOS.Services.Ldn.UserServiceCreator.LdnRyu
|
|||
SendAsync(_protocol.Encode(PacketId.CreateAccessPoint, request, advertiseData));
|
||||
|
||||
// Send a network change event with dummy data immediately. Necessary to avoid crashes in some games
|
||||
NetworkChangeEventArgs networkChangeEvent = new NetworkChangeEventArgs(new NetworkInfo()
|
||||
NetworkChangeEventArgs networkChangeEvent = new(new NetworkInfo()
|
||||
{
|
||||
Common = new CommonNetworkInfo()
|
||||
{
|
||||
|
@ -610,7 +610,7 @@ namespace Ryujinx.HLE.HOS.Services.Ldn.UserServiceCreator.LdnRyu
|
|||
|
||||
SendAsync(_protocol.Encode(PacketId.Connect, request));
|
||||
|
||||
NetworkChangeEventArgs networkChangeEvent = new NetworkChangeEventArgs(new NetworkInfo()
|
||||
NetworkChangeEventArgs networkChangeEvent = new(new NetworkInfo()
|
||||
{
|
||||
Common = request.NetworkInfo.Common,
|
||||
Ldn = request.NetworkInfo.Ldn
|
||||
|
|
|
@ -7,7 +7,7 @@ namespace Ryujinx.HLE.HOS.Services.Ldn.UserServiceCreator.LdnRyu.Proxy
|
|||
{
|
||||
private const ushort EphemeralBase = 49152;
|
||||
|
||||
private readonly List<ushort> _ephemeralPorts = new List<ushort>();
|
||||
private readonly List<ushort> _ephemeralPorts = new();
|
||||
|
||||
private readonly Lock _lock = new();
|
||||
|
||||
|
|
|
@ -13,8 +13,8 @@ namespace Ryujinx.HLE.HOS.Services.Ldn.UserServiceCreator.LdnRyu.Proxy
|
|||
public EndPoint LocalEndpoint { get; }
|
||||
public IPAddress LocalAddress { get; }
|
||||
|
||||
private readonly List<LdnProxySocket> _sockets = new List<LdnProxySocket>();
|
||||
private readonly Dictionary<ProtocolType, EphemeralPortPool> _ephemeralPorts = new Dictionary<ProtocolType, EphemeralPortPool>();
|
||||
private readonly List<LdnProxySocket> _sockets = new();
|
||||
private readonly Dictionary<ProtocolType, EphemeralPortPool> _ephemeralPorts = new();
|
||||
|
||||
private readonly IProxyClient _parent;
|
||||
private RyuLdnProtocol _protocol;
|
||||
|
@ -132,7 +132,7 @@ namespace Ryujinx.HLE.HOS.Services.Ldn.UserServiceCreator.LdnRyu.Proxy
|
|||
|
||||
public void HandleData(LdnHeader header, ProxyDataHeader proxyHeader, byte[] data)
|
||||
{
|
||||
ProxyDataPacket packet = new ProxyDataPacket() { Header = proxyHeader, Data = data };
|
||||
ProxyDataPacket packet = new() { Header = proxyHeader, Data = data };
|
||||
|
||||
ForRoutedSockets(proxyHeader.Info, (socket) =>
|
||||
{
|
||||
|
@ -179,7 +179,7 @@ namespace Ryujinx.HLE.HOS.Services.Ldn.UserServiceCreator.LdnRyu.Proxy
|
|||
{
|
||||
// We must ask the other side to initialize a connection, so they can accept a socket for us.
|
||||
|
||||
ProxyConnectRequest request = new ProxyConnectRequest
|
||||
ProxyConnectRequest request = new()
|
||||
{
|
||||
Info = MakeInfo(localEp, remoteEp, type)
|
||||
};
|
||||
|
@ -191,7 +191,7 @@ namespace Ryujinx.HLE.HOS.Services.Ldn.UserServiceCreator.LdnRyu.Proxy
|
|||
{
|
||||
// We must tell the other side that we have accepted their request for connection.
|
||||
|
||||
ProxyConnectResponse request = new ProxyConnectResponse
|
||||
ProxyConnectResponse request = new()
|
||||
{
|
||||
Info = MakeInfo(localEp, remoteEp, type)
|
||||
};
|
||||
|
@ -203,7 +203,7 @@ namespace Ryujinx.HLE.HOS.Services.Ldn.UserServiceCreator.LdnRyu.Proxy
|
|||
{
|
||||
// We must tell the other side that our connection is dropped.
|
||||
|
||||
ProxyDisconnectMessage request = new ProxyDisconnectMessage
|
||||
ProxyDisconnectMessage request = new()
|
||||
{
|
||||
Info = MakeInfo(localEp, remoteEp, type),
|
||||
DisconnectReason = 0 // TODO
|
||||
|
@ -217,7 +217,7 @@ namespace Ryujinx.HLE.HOS.Services.Ldn.UserServiceCreator.LdnRyu.Proxy
|
|||
// We send exactly as much as the user wants us to, currently instantly.
|
||||
// TODO: handle over "virtual mtu" (we have a max packet size to worry about anyways). fragment if tcp? throw if udp?
|
||||
|
||||
ProxyDataHeader request = new ProxyDataHeader
|
||||
ProxyDataHeader request = new()
|
||||
{
|
||||
Info = MakeInfo(localEp, remoteEp, type),
|
||||
DataLength = (uint)buffer.Length
|
||||
|
|
|
@ -18,21 +18,21 @@ namespace Ryujinx.HLE.HOS.Services.Ldn.UserServiceCreator.LdnRyu.Proxy
|
|||
private readonly LdnProxy _proxy;
|
||||
|
||||
private bool _isListening;
|
||||
private readonly List<LdnProxySocket> _listenSockets = new List<LdnProxySocket>();
|
||||
private readonly List<LdnProxySocket> _listenSockets = new();
|
||||
|
||||
private readonly Queue<ProxyConnectRequest> _connectRequests = new Queue<ProxyConnectRequest>();
|
||||
private readonly Queue<ProxyConnectRequest> _connectRequests = new();
|
||||
|
||||
private readonly AutoResetEvent _acceptEvent = new AutoResetEvent(false);
|
||||
private readonly AutoResetEvent _acceptEvent = new(false);
|
||||
private readonly int _acceptTimeout = -1;
|
||||
|
||||
private readonly Queue<int> _errors = new Queue<int>();
|
||||
private readonly Queue<int> _errors = new();
|
||||
|
||||
private readonly AutoResetEvent _connectEvent = new AutoResetEvent(false);
|
||||
private readonly AutoResetEvent _connectEvent = new(false);
|
||||
private ProxyConnectResponse _connectResponse;
|
||||
|
||||
private int _receiveTimeout = -1;
|
||||
private readonly AutoResetEvent _receiveEvent = new AutoResetEvent(false);
|
||||
private readonly Queue<ProxyDataPacket> _receiveQueue = new Queue<ProxyDataPacket>();
|
||||
private readonly AutoResetEvent _receiveEvent = new(false);
|
||||
private readonly Queue<ProxyDataPacket> _receiveQueue = new();
|
||||
|
||||
// private int _sendTimeout = -1; // Sends are techically instant right now, so not _really_ used.
|
||||
|
||||
|
@ -42,7 +42,7 @@ namespace Ryujinx.HLE.HOS.Services.Ldn.UserServiceCreator.LdnRyu.Proxy
|
|||
// private bool _writeShutdown;
|
||||
private bool _closed;
|
||||
|
||||
private readonly Dictionary<SocketOptionName, int> _socketOptions = new Dictionary<SocketOptionName, int>()
|
||||
private readonly Dictionary<SocketOptionName, int> _socketOptions = new()
|
||||
{
|
||||
{ SocketOptionName.Broadcast, 0 }, //TODO: honor this value
|
||||
{ SocketOptionName.DontLinger, 0 },
|
||||
|
@ -147,7 +147,7 @@ namespace Ryujinx.HLE.HOS.Services.Ldn.UserServiceCreator.LdnRyu.Proxy
|
|||
}
|
||||
}
|
||||
|
||||
IPEndPoint localEp = new IPEndPoint(_proxy.LocalAddress, _proxy.GetEphemeralPort(ProtocolType));
|
||||
IPEndPoint localEp = new(_proxy.LocalAddress, _proxy.GetEphemeralPort(ProtocolType));
|
||||
LocalEndPoint = localEp;
|
||||
|
||||
return localEp;
|
||||
|
|
|
@ -16,9 +16,9 @@ namespace Ryujinx.HLE.HOS.Services.Ldn.UserServiceCreator.LdnRyu.Proxy
|
|||
|
||||
private readonly RyuLdnProtocol _protocol;
|
||||
|
||||
private readonly ManualResetEvent _connected = new ManualResetEvent(false);
|
||||
private readonly ManualResetEvent _ready = new ManualResetEvent(false);
|
||||
private readonly AutoResetEvent _error = new AutoResetEvent(false);
|
||||
private readonly ManualResetEvent _connected = new(false);
|
||||
private readonly ManualResetEvent _ready = new(false);
|
||||
private readonly AutoResetEvent _error = new(false);
|
||||
|
||||
public P2pProxyClient(string address, int port) : base(address, port)
|
||||
{
|
||||
|
|
|
@ -29,22 +29,22 @@ namespace Ryujinx.HLE.HOS.Services.Ldn.UserServiceCreator.LdnRyu.Proxy
|
|||
|
||||
private const ushort AuthWaitSeconds = 1;
|
||||
|
||||
private readonly ReaderWriterLockSlim _lock = new ReaderWriterLockSlim(LockRecursionPolicy.SupportsRecursion);
|
||||
private readonly ReaderWriterLockSlim _lock = new(LockRecursionPolicy.SupportsRecursion);
|
||||
|
||||
public ushort PrivatePort { get; }
|
||||
|
||||
private ushort _publicPort;
|
||||
|
||||
private bool _disposed;
|
||||
private readonly CancellationTokenSource _disposedCancellation = new CancellationTokenSource();
|
||||
private readonly CancellationTokenSource _disposedCancellation = new();
|
||||
|
||||
private NatDevice _natDevice;
|
||||
private Mapping _portMapping;
|
||||
|
||||
private readonly List<P2pProxySession> _players = new List<P2pProxySession>();
|
||||
private readonly List<P2pProxySession> _players = new();
|
||||
|
||||
private readonly List<ExternalProxyToken> _waitingTokens = new List<ExternalProxyToken>();
|
||||
private readonly AutoResetEvent _tokenEvent = new AutoResetEvent(false);
|
||||
private readonly List<ExternalProxyToken> _waitingTokens = new();
|
||||
private readonly AutoResetEvent _tokenEvent = new(false);
|
||||
|
||||
private uint _broadcastAddress;
|
||||
|
||||
|
@ -112,8 +112,8 @@ namespace Ryujinx.HLE.HOS.Services.Ldn.UserServiceCreator.LdnRyu.Proxy
|
|||
|
||||
public async Task<ushort> NatPunch()
|
||||
{
|
||||
NatDiscoverer discoverer = new NatDiscoverer();
|
||||
CancellationTokenSource cts = new CancellationTokenSource(1000);
|
||||
NatDiscoverer discoverer = new();
|
||||
CancellationTokenSource cts = new(1000);
|
||||
|
||||
NatDevice device;
|
||||
|
||||
|
@ -300,7 +300,7 @@ namespace Ryujinx.HLE.HOS.Services.Ldn.UserServiceCreator.LdnRyu.Proxy
|
|||
|
||||
session.SetIpv4(waitToken.VirtualIp);
|
||||
|
||||
ProxyConfig pconfig = new ProxyConfig
|
||||
ProxyConfig pconfig = new()
|
||||
{
|
||||
ProxyIp = session.VirtualIpAddress,
|
||||
ProxySubnetMask = 0xFFFF0000 // TODO: Use from server.
|
||||
|
|
|
@ -131,7 +131,7 @@ namespace Ryujinx.HLE.HOS.Services.Nfc.AmiiboDecryption
|
|||
string nickName = amiiboDump.AmiiboNickname;
|
||||
LogFinalData(titleId, appId, head, tail, finalID, nickName, initDateTime, writeDateTime, settingsValue, writeCounterValue, applicationAreas);
|
||||
|
||||
VirtualAmiiboFile virtualAmiiboFile = new VirtualAmiiboFile
|
||||
VirtualAmiiboFile virtualAmiiboFile = new()
|
||||
{
|
||||
FileVersion = 1,
|
||||
TagUuid = uid,
|
||||
|
@ -182,7 +182,7 @@ namespace Ryujinx.HLE.HOS.Services.Nfc.AmiiboDecryption
|
|||
readBytes = newFileBytes;
|
||||
}
|
||||
|
||||
AmiiboDecryptor amiiboDecryptor = new AmiiboDecryptor(keyRetailBinPath);
|
||||
AmiiboDecryptor amiiboDecryptor = new(keyRetailBinPath);
|
||||
AmiiboDump amiiboDump = amiiboDecryptor.DecryptAmiiboDump(readBytes);
|
||||
|
||||
byte[] oldData = amiiboDump.GetData();
|
||||
|
@ -250,7 +250,7 @@ namespace Ryujinx.HLE.HOS.Services.Nfc.AmiiboDecryption
|
|||
readBytes = newFileBytes;
|
||||
}
|
||||
|
||||
AmiiboDecryptor amiiboDecryptor = new AmiiboDecryptor(keyRetailBinPath);
|
||||
AmiiboDecryptor amiiboDecryptor = new(keyRetailBinPath);
|
||||
AmiiboDump amiiboDump = amiiboDecryptor.DecryptAmiiboDump(readBytes);
|
||||
amiiboDump.AmiiboNickname = newNickName;
|
||||
byte[] oldData = amiiboDump.GetData();
|
||||
|
|
|
@ -91,7 +91,7 @@ namespace Ryujinx.HLE.HOS.Services.Nfc.AmiiboDecryption
|
|||
Array.Copy(seedBytes, 0, dataForAes, 2, seedBytes.Length);
|
||||
|
||||
byte[] derivedBytes;
|
||||
using (HMACSHA256 hmac = new HMACSHA256(key.HmacKey))
|
||||
using (HMACSHA256 hmac = new(key.HmacKey))
|
||||
{
|
||||
derivedBytes = hmac.ComputeHash(dataForAes);
|
||||
}
|
||||
|
@ -105,7 +105,7 @@ namespace Ryujinx.HLE.HOS.Services.Nfc.AmiiboDecryption
|
|||
dataForHmacKey[1] = 0x01; // Counter (1)
|
||||
Array.Copy(seedBytes, 0, dataForHmacKey, 2, seedBytes.Length);
|
||||
|
||||
using (HMACSHA256 hmac = new HMACSHA256(key.HmacKey))
|
||||
using (HMACSHA256 hmac = new(key.HmacKey))
|
||||
{
|
||||
derivedBytes = hmac.ComputeHash(dataForHmacKey);
|
||||
}
|
||||
|
@ -121,7 +121,7 @@ namespace Ryujinx.HLE.HOS.Services.Nfc.AmiiboDecryption
|
|||
Array.Copy(seedBytes, 0, dataForHmacKey, 2, seedBytes.Length);
|
||||
|
||||
byte[] derivedBytes;
|
||||
using (HMACSHA256 hmac = new HMACSHA256(key.HmacKey))
|
||||
using (HMACSHA256 hmac = new(key.HmacKey))
|
||||
{
|
||||
derivedBytes = hmac.ComputeHash(dataForHmacKey);
|
||||
}
|
||||
|
@ -229,7 +229,7 @@ namespace Ryujinx.HLE.HOS.Services.Nfc.AmiiboDecryption
|
|||
Array.Copy(data, 0x054, tagHmacData, 8, 44);
|
||||
|
||||
byte[] tagHmac;
|
||||
using (HMACSHA256 hmac = new HMACSHA256(hmacTagKey))
|
||||
using (HMACSHA256 hmac = new(hmacTagKey))
|
||||
{
|
||||
tagHmac = hmac.ComputeHash(tagHmacData);
|
||||
}
|
||||
|
@ -258,7 +258,7 @@ namespace Ryujinx.HLE.HOS.Services.Nfc.AmiiboDecryption
|
|||
Array.Copy(data, 0x054, dataHmacData, offset, len5);
|
||||
|
||||
byte[] dataHmac;
|
||||
using (HMACSHA256 hmac = new HMACSHA256(hmacDataKey))
|
||||
using (HMACSHA256 hmac = new(hmacDataKey))
|
||||
{
|
||||
dataHmac = hmac.ComputeHash(dataHmacData);
|
||||
}
|
||||
|
@ -278,7 +278,7 @@ namespace Ryujinx.HLE.HOS.Services.Nfc.AmiiboDecryption
|
|||
Array.Copy(data, 0x054, tagHmacData, 8, 44);
|
||||
|
||||
byte[] calculatedTagHmac;
|
||||
using (HMACSHA256 hmac = new HMACSHA256(hmacTagKey))
|
||||
using (HMACSHA256 hmac = new(hmacTagKey))
|
||||
{
|
||||
calculatedTagHmac = hmac.ComputeHash(tagHmacData);
|
||||
}
|
||||
|
@ -312,7 +312,7 @@ namespace Ryujinx.HLE.HOS.Services.Nfc.AmiiboDecryption
|
|||
Array.Copy(data, 0x054, dataHmacData, offset, len5);
|
||||
|
||||
byte[] calculatedDataHmac;
|
||||
using (HMACSHA256 hmac = new HMACSHA256(hmacDataKey))
|
||||
using (HMACSHA256 hmac = new(hmacDataKey))
|
||||
{
|
||||
calculatedDataHmac = hmac.ComputeHash(dataHmacData);
|
||||
}
|
||||
|
|
|
@ -18,8 +18,8 @@ namespace Ryujinx.HLE.HOS.Services.Nv
|
|||
MemoryAllocator = new NvMemoryAllocator();
|
||||
Host1x = new Host1xDevice(gpu.Synchronization);
|
||||
Smmu = gpu.CreateDeviceMemoryManager(pid);
|
||||
NvdecDevice nvdec = new NvdecDevice(Smmu);
|
||||
VicDevice vic = new VicDevice(Smmu);
|
||||
NvdecDevice nvdec = new(Smmu);
|
||||
VicDevice vic = new(Smmu);
|
||||
Host1x.RegisterDevice(ClassId.Nvdec, nvdec);
|
||||
Host1x.RegisterDevice(ClassId.Vic, vic);
|
||||
}
|
||||
|
|
|
@ -33,8 +33,8 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvHostAsGpu
|
|||
}
|
||||
|
||||
private static readonly VmRegion[] _vmRegions = {
|
||||
new VmRegion((ulong)BigPageSize << 16, SmallRegionLimit),
|
||||
new VmRegion(SmallRegionLimit, DefaultUserSize),
|
||||
new((ulong)BigPageSize << 16, SmallRegionLimit),
|
||||
new(SmallRegionLimit, DefaultUserSize),
|
||||
};
|
||||
|
||||
private readonly AddressSpaceContext _asContext;
|
||||
|
|
|
@ -76,7 +76,7 @@ namespace Ryujinx.HLE.HOS.Services.Sdb.Pl
|
|||
Nca nca = new(_device.System.KeySet, ncaFileStream);
|
||||
IFileSystem romfs = nca.OpenFileSystem(NcaSectionType.Data, _device.System.FsIntegrityCheckLevel);
|
||||
|
||||
using UniqueRef<IFile> fontFile = new UniqueRef<IFile>();
|
||||
using UniqueRef<IFile> fontFile = new();
|
||||
|
||||
romfs.OpenFile(ref fontFile.Ref, ("/" + fontFilename).ToU8Span(), OpenMode.Read).ThrowIfFailure();
|
||||
|
||||
|
|
|
@ -326,7 +326,7 @@ namespace Ryujinx.HLE.HOS.Services.Settings
|
|||
|
||||
IFileSystem firmwareRomFs = firmwareContent.OpenFileSystem(NcaSectionType.Data, device.System.FsIntegrityCheckLevel);
|
||||
|
||||
using UniqueRef<IFile> firmwareFile = new UniqueRef<IFile>();
|
||||
using UniqueRef<IFile> firmwareFile = new();
|
||||
|
||||
Result result = firmwareRomFs.OpenFile(ref firmwareFile.Ref, "/file".ToU8Span(), OpenMode.Read);
|
||||
if (result.IsFailure())
|
||||
|
|
|
@ -129,7 +129,7 @@ namespace Ryujinx.HLE.HOS.Services.Ssl
|
|||
|
||||
IFileSystem romfs = nca.OpenFileSystem(NcaSectionType.Data, _fsIntegrityCheckLevel);
|
||||
|
||||
using UniqueRef<IFile> trustedCertsFileRef = new UniqueRef<IFile>();
|
||||
using UniqueRef<IFile> trustedCertsFileRef = new();
|
||||
|
||||
Result result = romfs.OpenFile(ref trustedCertsFileRef.Ref, "/ssl_TrustedCerts.bdf".ToU8Span(), OpenMode.Read);
|
||||
|
||||
|
|
|
@ -94,7 +94,7 @@ namespace Ryujinx.HLE.HOS.Services.Time.TimeZone
|
|||
Nca nca = new(_virtualFileSystem.KeySet, ncaFileStream);
|
||||
IFileSystem romfs = nca.OpenFileSystem(NcaSectionType.Data, _fsIntegrityCheckLevel);
|
||||
|
||||
using UniqueRef<IFile> binaryListFile = new UniqueRef<IFile>();
|
||||
using UniqueRef<IFile> binaryListFile = new();
|
||||
|
||||
romfs.OpenFile(ref binaryListFile.Ref, "/binaryList.txt".ToU8Span(), OpenMode.Read).ThrowIfFailure();
|
||||
|
||||
|
@ -139,7 +139,7 @@ namespace Ryujinx.HLE.HOS.Services.Time.TimeZone
|
|||
continue;
|
||||
}
|
||||
|
||||
using UniqueRef<IFile> tzif = new UniqueRef<IFile>();
|
||||
using UniqueRef<IFile> tzif = new();
|
||||
|
||||
if (romfs.OpenFile(ref tzif.Ref, $"/zoneinfo/{locName}".ToU8Span(), OpenMode.Read).IsFailure())
|
||||
{
|
||||
|
@ -269,7 +269,7 @@ namespace Ryujinx.HLE.HOS.Services.Time.TimeZone
|
|||
Nca nca = new(_virtualFileSystem.KeySet, ncaFile);
|
||||
IFileSystem romfs = nca.OpenFileSystem(NcaSectionType.Data, _fsIntegrityCheckLevel);
|
||||
|
||||
using UniqueRef<IFile> timeZoneBinaryFile = new UniqueRef<IFile>();
|
||||
using UniqueRef<IFile> timeZoneBinaryFile = new();
|
||||
|
||||
Result result = romfs.OpenFile(ref timeZoneBinaryFile.Ref, $"/zoneinfo/{locationName}".ToU8Span(), OpenMode.Read);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue