aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Ryujinx.Graphics.Gpu/GpuContext.cs10
-rw-r--r--Ryujinx.Graphics.Gpu/Window.cs2
-rw-r--r--Ryujinx.HLE/HOS/ArmProcessContext.cs4
-rw-r--r--Ryujinx.HLE/HOS/ArmProcessContextFactory.cs2
-rw-r--r--Ryujinx.HLE/HOS/Ipc/IpcHandleDesc.cs6
-rw-r--r--Ryujinx.HLE/HOS/Kernel/KernelContext.cs16
-rw-r--r--Ryujinx.HLE/HOS/Kernel/Memory/KSharedMemory.cs4
-rw-r--r--Ryujinx.HLE/HOS/Kernel/Process/IProcessContextFactory.cs2
-rw-r--r--Ryujinx.HLE/HOS/Kernel/Process/KProcess.cs6
-rw-r--r--Ryujinx.HLE/HOS/Kernel/Process/ProcessContextFactory.cs2
-rw-r--r--Ryujinx.HLE/HOS/Kernel/SupervisorCall/Syscall.cs4
-rw-r--r--Ryujinx.HLE/HOS/Kernel/SupervisorCall/Syscall32.cs10
-rw-r--r--Ryujinx.HLE/HOS/Kernel/SupervisorCall/Syscall64.cs4
-rw-r--r--Ryujinx.HLE/HOS/Kernel/Threading/KThread.cs2
-rw-r--r--Ryujinx.HLE/HOS/Services/Am/AppletAE/AllSystemAppletProxiesService/ILibraryAppletProxy.cs4
-rw-r--r--Ryujinx.HLE/HOS/Services/Am/AppletAE/AllSystemAppletProxiesService/ISystemAppletProxy.cs4
-rw-r--r--Ryujinx.HLE/HOS/Services/Am/AppletAE/AllSystemAppletProxiesService/SystemAppletProxy/ISelfController.cs4
-rw-r--r--Ryujinx.HLE/HOS/Services/Am/AppletAE/AllSystemAppletProxiesService/SystemAppletProxy/IWindowController.cs4
-rw-r--r--Ryujinx.HLE/HOS/Services/Am/AppletOE/ApplicationProxyService/IApplicationProxy.cs4
-rw-r--r--Ryujinx.HLE/HOS/Services/Friend/ServiceCreator/IFriendService.cs2
-rw-r--r--Ryujinx.HLE/HOS/Services/Ns/Aoc/IAddOnContentManager.cs16
-rw-r--r--Ryujinx.HLE/HOS/Services/Nv/Host1xContext.cs2
-rw-r--r--Ryujinx.HLE/HOS/Services/Nv/INvDrvServices.cs4
-rw-r--r--Ryujinx.HLE/HOS/Services/Nv/NvDrvServices/NvDeviceFile.cs4
-rw-r--r--Ryujinx.HLE/HOS/Services/Nv/NvDrvServices/NvHostAsGpu/NvHostAsGpuDeviceFile.cs2
-rw-r--r--Ryujinx.HLE/HOS/Services/Nv/NvDrvServices/NvHostChannel/NvHostChannelDeviceFile.cs8
-rw-r--r--Ryujinx.HLE/HOS/Services/Nv/NvDrvServices/NvHostChannel/NvHostGpuDeviceFile.cs2
-rw-r--r--Ryujinx.HLE/HOS/Services/Nv/NvDrvServices/NvHostCtrl/NvHostCtrlDeviceFile.cs2
-rw-r--r--Ryujinx.HLE/HOS/Services/Nv/NvDrvServices/NvHostCtrlGpu/NvHostCtrlGpuDeviceFile.cs2
-rw-r--r--Ryujinx.HLE/HOS/Services/Nv/NvDrvServices/NvMap/NvMapDeviceFile.cs12
-rw-r--r--Ryujinx.HLE/HOS/Services/Pctl/IParentalControlServiceFactory.cs4
-rw-r--r--Ryujinx.HLE/HOS/Services/Pctl/ParentalControlServiceFactory/IParentalControlService.cs4
-rw-r--r--Ryujinx.HLE/HOS/Services/Pm/IShellInterface.cs2
-rw-r--r--Ryujinx.HLE/HOS/Services/Ro/IRoInterface.cs2
-rw-r--r--Ryujinx.HLE/HOS/Services/Sockets/Bsd/BsdContext.cs6
-rw-r--r--Ryujinx.HLE/HOS/Services/Ssl/SslService/ISslConnection.cs4
-rw-r--r--Ryujinx.HLE/HOS/Services/Ssl/SslService/ISslContext.cs5
-rw-r--r--Ryujinx.HLE/HOS/Services/SurfaceFlinger/BufferQueue.cs2
-rw-r--r--Ryujinx.HLE/HOS/Services/SurfaceFlinger/BufferQueueCore.cs4
-rw-r--r--Ryujinx.HLE/HOS/Services/SurfaceFlinger/SurfaceFlinger.cs8
-rw-r--r--Ryujinx.HLE/HOS/Services/SurfaceFlinger/Types/GraphicBuffer.cs4
-rw-r--r--Ryujinx.HLE/HOS/Services/Vi/RootService/ApplicationDisplayService/IManagerDisplayService.cs2
-rw-r--r--Ryujinx.HLE/HOS/TamperMachine.cs2
43 files changed, 99 insertions, 100 deletions
diff --git a/Ryujinx.Graphics.Gpu/GpuContext.cs b/Ryujinx.Graphics.Gpu/GpuContext.cs
index 8ea7c91fb..e6697b3ae 100644
--- a/Ryujinx.Graphics.Gpu/GpuContext.cs
+++ b/Ryujinx.Graphics.Gpu/GpuContext.cs
@@ -77,7 +77,7 @@ namespace Ryujinx.Graphics.Gpu
77 /// <summary> 77 /// <summary>
78 /// Registry with physical memories that can be used with this GPU context, keyed by owner process ID. 78 /// Registry with physical memories that can be used with this GPU context, keyed by owner process ID.
79 /// </summary> 79 /// </summary>
80 internal ConcurrentDictionary<long, PhysicalMemory> PhysicalMemoryRegistry { get; } 80 internal ConcurrentDictionary<ulong, PhysicalMemory> PhysicalMemoryRegistry { get; }
81 81
82 /// <summary> 82 /// <summary>
83 /// Host hardware capabilities. 83 /// Host hardware capabilities.
@@ -126,7 +126,7 @@ namespace Ryujinx.Graphics.Gpu
126 126
127 DeferredActions = new Queue<Action>(); 127 DeferredActions = new Queue<Action>();
128 128
129 PhysicalMemoryRegistry = new ConcurrentDictionary<long, PhysicalMemory>(); 129 PhysicalMemoryRegistry = new ConcurrentDictionary<ulong, PhysicalMemory>();
130 } 130 }
131 131
132 /// <summary> 132 /// <summary>
@@ -144,7 +144,7 @@ namespace Ryujinx.Graphics.Gpu
144 /// <param name="pid">ID of the process that owns the memory manager</param> 144 /// <param name="pid">ID of the process that owns the memory manager</param>
145 /// <returns>The memory manager</returns> 145 /// <returns>The memory manager</returns>
146 /// <exception cref="ArgumentException">Thrown when <paramref name="pid"/> is invalid</exception> 146 /// <exception cref="ArgumentException">Thrown when <paramref name="pid"/> is invalid</exception>
147 public MemoryManager CreateMemoryManager(long pid) 147 public MemoryManager CreateMemoryManager(ulong pid)
148 { 148 {
149 if (!PhysicalMemoryRegistry.TryGetValue(pid, out var physicalMemory)) 149 if (!PhysicalMemoryRegistry.TryGetValue(pid, out var physicalMemory))
150 { 150 {
@@ -160,7 +160,7 @@ namespace Ryujinx.Graphics.Gpu
160 /// <param name="pid">ID of the process that owns <paramref name="cpuMemory"/></param> 160 /// <param name="pid">ID of the process that owns <paramref name="cpuMemory"/></param>
161 /// <param name="cpuMemory">Virtual memory owned by the process</param> 161 /// <param name="cpuMemory">Virtual memory owned by the process</param>
162 /// <exception cref="ArgumentException">Thrown if <paramref name="pid"/> was already registered</exception> 162 /// <exception cref="ArgumentException">Thrown if <paramref name="pid"/> was already registered</exception>
163 public void RegisterProcess(long pid, Cpu.IVirtualMemoryManagerTracked cpuMemory) 163 public void RegisterProcess(ulong pid, Cpu.IVirtualMemoryManagerTracked cpuMemory)
164 { 164 {
165 var physicalMemory = new PhysicalMemory(this, cpuMemory); 165 var physicalMemory = new PhysicalMemory(this, cpuMemory);
166 if (!PhysicalMemoryRegistry.TryAdd(pid, physicalMemory)) 166 if (!PhysicalMemoryRegistry.TryAdd(pid, physicalMemory))
@@ -175,7 +175,7 @@ namespace Ryujinx.Graphics.Gpu
175 /// Unregisters a process, indicating that its memory will no longer be used, and that caches can be freed. 175 /// Unregisters a process, indicating that its memory will no longer be used, and that caches can be freed.
176 /// </summary> 176 /// </summary>
177 /// <param name="pid">ID of the process</param> 177 /// <param name="pid">ID of the process</param>
178 public void UnregisterProcess(long pid) 178 public void UnregisterProcess(ulong pid)
179 { 179 {
180 if (PhysicalMemoryRegistry.TryRemove(pid, out var physicalMemory)) 180 if (PhysicalMemoryRegistry.TryRemove(pid, out var physicalMemory))
181 { 181 {
diff --git a/Ryujinx.Graphics.Gpu/Window.cs b/Ryujinx.Graphics.Gpu/Window.cs
index 9a4dfb9ac..17da1ffa1 100644
--- a/Ryujinx.Graphics.Gpu/Window.cs
+++ b/Ryujinx.Graphics.Gpu/Window.cs
@@ -122,7 +122,7 @@ namespace Ryujinx.Graphics.Gpu
122 /// <param name="userObj">User defined object passed to the release callback</param> 122 /// <param name="userObj">User defined object passed to the release callback</param>
123 /// <exception cref="ArgumentException">Thrown when <paramref name="pid"/> is invalid</exception> 123 /// <exception cref="ArgumentException">Thrown when <paramref name="pid"/> is invalid</exception>
124 public void EnqueueFrameThreadSafe( 124 public void EnqueueFrameThreadSafe(
125 long pid, 125 ulong pid,
126 ulong address, 126 ulong address,
127 int width, 127 int width,
128 int height, 128 int height,
diff --git a/Ryujinx.HLE/HOS/ArmProcessContext.cs b/Ryujinx.HLE/HOS/ArmProcessContext.cs
index 89ce0eb34..e76ee1557 100644
--- a/Ryujinx.HLE/HOS/ArmProcessContext.cs
+++ b/Ryujinx.HLE/HOS/ArmProcessContext.cs
@@ -9,14 +9,14 @@ namespace Ryujinx.HLE.HOS
9{ 9{
10 class ArmProcessContext<T> : IProcessContext where T : class, IVirtualMemoryManagerTracked, IMemoryManager 10 class ArmProcessContext<T> : IProcessContext where T : class, IVirtualMemoryManagerTracked, IMemoryManager
11 { 11 {
12 private readonly long _pid; 12 private readonly ulong _pid;
13 private readonly GpuContext _gpuContext; 13 private readonly GpuContext _gpuContext;
14 private readonly CpuContext _cpuContext; 14 private readonly CpuContext _cpuContext;
15 private T _memoryManager; 15 private T _memoryManager;
16 16
17 public IVirtualMemoryManager AddressSpace => _memoryManager; 17 public IVirtualMemoryManager AddressSpace => _memoryManager;
18 18
19 public ArmProcessContext(long pid, GpuContext gpuContext, T memoryManager, bool for64Bit) 19 public ArmProcessContext(ulong pid, GpuContext gpuContext, T memoryManager, bool for64Bit)
20 { 20 {
21 if (memoryManager is IRefCounted rc) 21 if (memoryManager is IRefCounted rc)
22 { 22 {
diff --git a/Ryujinx.HLE/HOS/ArmProcessContextFactory.cs b/Ryujinx.HLE/HOS/ArmProcessContextFactory.cs
index 50dbd8435..2556b2cc8 100644
--- a/Ryujinx.HLE/HOS/ArmProcessContextFactory.cs
+++ b/Ryujinx.HLE/HOS/ArmProcessContextFactory.cs
@@ -17,7 +17,7 @@ namespace Ryujinx.HLE.HOS
17 _gpu = gpu; 17 _gpu = gpu;
18 } 18 }
19 19
20 public IProcessContext Create(KernelContext context, long pid, ulong addressSpaceSize, InvalidAccessHandler invalidAccessHandler, bool for64Bit) 20 public IProcessContext Create(KernelContext context, ulong pid, ulong addressSpaceSize, InvalidAccessHandler invalidAccessHandler, bool for64Bit)
21 { 21 {
22 MemoryManagerMode mode = context.Device.Configuration.MemoryManagerMode; 22 MemoryManagerMode mode = context.Device.Configuration.MemoryManagerMode;
23 23
diff --git a/Ryujinx.HLE/HOS/Ipc/IpcHandleDesc.cs b/Ryujinx.HLE/HOS/Ipc/IpcHandleDesc.cs
index 5b1d5788f..439590e0c 100644
--- a/Ryujinx.HLE/HOS/Ipc/IpcHandleDesc.cs
+++ b/Ryujinx.HLE/HOS/Ipc/IpcHandleDesc.cs
@@ -7,7 +7,7 @@ namespace Ryujinx.HLE.HOS.Ipc
7 { 7 {
8 public bool HasPId { get; private set; } 8 public bool HasPId { get; private set; }
9 9
10 public long PId { get; private set; } 10 public ulong PId { get; private set; }
11 11
12 public int[] ToCopy { get; private set; } 12 public int[] ToCopy { get; private set; }
13 public int[] ToMove { get; private set; } 13 public int[] ToMove { get; private set; }
@@ -21,7 +21,7 @@ namespace Ryujinx.HLE.HOS.Ipc
21 ToCopy = new int[(word >> 1) & 0xf]; 21 ToCopy = new int[(word >> 1) & 0xf];
22 ToMove = new int[(word >> 5) & 0xf]; 22 ToMove = new int[(word >> 5) & 0xf];
23 23
24 PId = HasPId ? reader.ReadInt64() : 0; 24 PId = HasPId ? reader.ReadUInt64() : 0;
25 25
26 for (int index = 0; index < ToCopy.Length; index++) 26 for (int index = 0; index < ToCopy.Length; index++)
27 { 27 {
@@ -40,7 +40,7 @@ namespace Ryujinx.HLE.HOS.Ipc
40 ToMove = move ?? throw new ArgumentNullException(nameof(move)); 40 ToMove = move ?? throw new ArgumentNullException(nameof(move));
41 } 41 }
42 42
43 public IpcHandleDesc(int[] copy, int[] move, long pId) : this(copy, move) 43 public IpcHandleDesc(int[] copy, int[] move, ulong pId) : this(copy, move)
44 { 44 {
45 PId = pId; 45 PId = pId;
46 46
diff --git a/Ryujinx.HLE/HOS/Kernel/KernelContext.cs b/Ryujinx.HLE/HOS/Kernel/KernelContext.cs
index 4f18faca6..4b8e4d159 100644
--- a/Ryujinx.HLE/HOS/Kernel/KernelContext.cs
+++ b/Ryujinx.HLE/HOS/Kernel/KernelContext.cs
@@ -42,14 +42,14 @@ namespace Ryujinx.HLE.HOS.Kernel
42 public KSynchronization Synchronization { get; } 42 public KSynchronization Synchronization { get; }
43 public KContextIdManager ContextIdManager { get; } 43 public KContextIdManager ContextIdManager { get; }
44 44
45 public ConcurrentDictionary<long, KProcess> Processes { get; } 45 public ConcurrentDictionary<ulong, KProcess> Processes { get; }
46 public ConcurrentDictionary<string, KAutoObject> AutoObjectNames { get; } 46 public ConcurrentDictionary<string, KAutoObject> AutoObjectNames { get; }
47 47
48 public bool ThreadReselectionRequested { get; set; } 48 public bool ThreadReselectionRequested { get; set; }
49 49
50 private long _kipId; 50 private ulong _kipId;
51 private long _processId; 51 private ulong _processId;
52 private long _threadUid; 52 private ulong _threadUid;
53 53
54 public KernelContext( 54 public KernelContext(
55 Switch device, 55 Switch device,
@@ -98,7 +98,7 @@ namespace Ryujinx.HLE.HOS.Kernel
98 98
99 KernelInitialized = true; 99 KernelInitialized = true;
100 100
101 Processes = new ConcurrentDictionary<long, KProcess>(); 101 Processes = new ConcurrentDictionary<ulong, KProcess>();
102 AutoObjectNames = new ConcurrentDictionary<string, KAutoObject>(); 102 AutoObjectNames = new ConcurrentDictionary<string, KAutoObject>();
103 103
104 _kipId = KernelConstants.InitialKipId; 104 _kipId = KernelConstants.InitialKipId;
@@ -115,17 +115,17 @@ namespace Ryujinx.HLE.HOS.Kernel
115 new Thread(PreemptionThreadStart) { Name = "HLE.PreemptionThread" }.Start(); 115 new Thread(PreemptionThreadStart) { Name = "HLE.PreemptionThread" }.Start();
116 } 116 }
117 117
118 public long NewThreadUid() 118 public ulong NewThreadUid()
119 { 119 {
120 return Interlocked.Increment(ref _threadUid) - 1; 120 return Interlocked.Increment(ref _threadUid) - 1;
121 } 121 }
122 122
123 public long NewKipId() 123 public ulong NewKipId()
124 { 124 {
125 return Interlocked.Increment(ref _kipId) - 1; 125 return Interlocked.Increment(ref _kipId) - 1;
126 } 126 }
127 127
128 public long NewProcessId() 128 public ulong NewProcessId()
129 { 129 {
130 return Interlocked.Increment(ref _processId) - 1; 130 return Interlocked.Increment(ref _processId) - 1;
131 } 131 }
diff --git a/Ryujinx.HLE/HOS/Kernel/Memory/KSharedMemory.cs b/Ryujinx.HLE/HOS/Kernel/Memory/KSharedMemory.cs
index 61c883d80..4e5168427 100644
--- a/Ryujinx.HLE/HOS/Kernel/Memory/KSharedMemory.cs
+++ b/Ryujinx.HLE/HOS/Kernel/Memory/KSharedMemory.cs
@@ -8,7 +8,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Memory
8 { 8 {
9 private readonly SharedMemoryStorage _storage; 9 private readonly SharedMemoryStorage _storage;
10 10
11 private readonly long _ownerPid; 11 private readonly ulong _ownerPid;
12 12
13 private readonly KMemoryPermission _ownerPermission; 13 private readonly KMemoryPermission _ownerPermission;
14 private readonly KMemoryPermission _userPermission; 14 private readonly KMemoryPermission _userPermission;
@@ -16,7 +16,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Memory
16 public KSharedMemory( 16 public KSharedMemory(
17 KernelContext context, 17 KernelContext context,
18 SharedMemoryStorage storage, 18 SharedMemoryStorage storage,
19 long ownerPid, 19 ulong ownerPid,
20 KMemoryPermission ownerPermission, 20 KMemoryPermission ownerPermission,
21 KMemoryPermission userPermission) : base(context) 21 KMemoryPermission userPermission) : base(context)
22 { 22 {
diff --git a/Ryujinx.HLE/HOS/Kernel/Process/IProcessContextFactory.cs b/Ryujinx.HLE/HOS/Kernel/Process/IProcessContextFactory.cs
index 10df43a82..0a24a5240 100644
--- a/Ryujinx.HLE/HOS/Kernel/Process/IProcessContextFactory.cs
+++ b/Ryujinx.HLE/HOS/Kernel/Process/IProcessContextFactory.cs
@@ -4,6 +4,6 @@ namespace Ryujinx.HLE.HOS.Kernel.Process
4{ 4{
5 interface IProcessContextFactory 5 interface IProcessContextFactory
6 { 6 {
7 IProcessContext Create(KernelContext context, long pid, ulong addressSpaceSize, InvalidAccessHandler invalidAccessHandler, bool for64Bit); 7 IProcessContext Create(KernelContext context, ulong pid, ulong addressSpaceSize, InvalidAccessHandler invalidAccessHandler, bool for64Bit);
8 } 8 }
9} 9}
diff --git a/Ryujinx.HLE/HOS/Kernel/Process/KProcess.cs b/Ryujinx.HLE/HOS/Kernel/Process/KProcess.cs
index 20b3a4973..83316b0fa 100644
--- a/Ryujinx.HLE/HOS/Kernel/Process/KProcess.cs
+++ b/Ryujinx.HLE/HOS/Kernel/Process/KProcess.cs
@@ -62,7 +62,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Process
62 62
63 public ulong TitleId { get; private set; } 63 public ulong TitleId { get; private set; }
64 public bool IsApplication { get; private set; } 64 public bool IsApplication { get; private set; }
65 public long Pid { get; private set; } 65 public ulong Pid { get; private set; }
66 66
67 private long _creationTimestamp; 67 private long _creationTimestamp;
68 private ulong _entrypoint; 68 private ulong _entrypoint;
@@ -131,7 +131,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Process
131 131
132 Pid = KernelContext.NewKipId(); 132 Pid = KernelContext.NewKipId();
133 133
134 if (Pid == 0 || (ulong)Pid >= KernelConstants.InitialProcessId) 134 if (Pid == 0 || Pid >= KernelConstants.InitialProcessId)
135 { 135 {
136 throw new InvalidOperationException($"Invalid KIP Id {Pid}."); 136 throw new InvalidOperationException($"Invalid KIP Id {Pid}.");
137 } 137 }
@@ -239,7 +239,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Process
239 239
240 Pid = KernelContext.NewProcessId(); 240 Pid = KernelContext.NewProcessId();
241 241
242 if (Pid == -1 || (ulong)Pid < KernelConstants.InitialProcessId) 242 if (Pid == ulong.MaxValue || Pid < KernelConstants.InitialProcessId)
243 { 243 {
244 throw new InvalidOperationException($"Invalid Process Id {Pid}."); 244 throw new InvalidOperationException($"Invalid Process Id {Pid}.");
245 } 245 }
diff --git a/Ryujinx.HLE/HOS/Kernel/Process/ProcessContextFactory.cs b/Ryujinx.HLE/HOS/Kernel/Process/ProcessContextFactory.cs
index ff250e88b..d81f1d0ac 100644
--- a/Ryujinx.HLE/HOS/Kernel/Process/ProcessContextFactory.cs
+++ b/Ryujinx.HLE/HOS/Kernel/Process/ProcessContextFactory.cs
@@ -4,7 +4,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Process
4{ 4{
5 class ProcessContextFactory : IProcessContextFactory 5 class ProcessContextFactory : IProcessContextFactory
6 { 6 {
7 public IProcessContext Create(KernelContext context, long pid, ulong addressSpaceSize, InvalidAccessHandler invalidAccessHandler, bool for64Bit) 7 public IProcessContext Create(KernelContext context, ulong pid, ulong addressSpaceSize, InvalidAccessHandler invalidAccessHandler, bool for64Bit)
8 { 8 {
9 return new ProcessContext(new AddressSpaceManager(addressSpaceSize)); 9 return new ProcessContext(new AddressSpaceManager(addressSpaceSize));
10 } 10 }
diff --git a/Ryujinx.HLE/HOS/Kernel/SupervisorCall/Syscall.cs b/Ryujinx.HLE/HOS/Kernel/SupervisorCall/Syscall.cs
index c022d6e29..3c6e2586d 100644
--- a/Ryujinx.HLE/HOS/Kernel/SupervisorCall/Syscall.cs
+++ b/Ryujinx.HLE/HOS/Kernel/SupervisorCall/Syscall.cs
@@ -24,7 +24,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
24 24
25 // Process 25 // Process
26 26
27 public KernelResult GetProcessId(out long pid, int handle) 27 public KernelResult GetProcessId(out ulong pid, int handle)
28 { 28 {
29 KProcess currentProcess = KernelStatic.GetCurrentProcess(); 29 KProcess currentProcess = KernelStatic.GetCurrentProcess();
30 30
@@ -2280,7 +2280,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
2280 return KernelStatic.GetCurrentThread().CurrentCore; 2280 return KernelStatic.GetCurrentThread().CurrentCore;
2281 } 2281 }
2282 2282
2283 public KernelResult GetThreadId(out long threadUid, int handle) 2283 public KernelResult GetThreadId(out ulong threadUid, int handle)
2284 { 2284 {
2285 KProcess process = KernelStatic.GetCurrentProcess(); 2285 KProcess process = KernelStatic.GetCurrentProcess();
2286 2286
diff --git a/Ryujinx.HLE/HOS/Kernel/SupervisorCall/Syscall32.cs b/Ryujinx.HLE/HOS/Kernel/SupervisorCall/Syscall32.cs
index f1b5b0e56..bf4eee797 100644
--- a/Ryujinx.HLE/HOS/Kernel/SupervisorCall/Syscall32.cs
+++ b/Ryujinx.HLE/HOS/Kernel/SupervisorCall/Syscall32.cs
@@ -235,12 +235,12 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
235 resultHigh = (uint)(result >> 32); 235 resultHigh = (uint)(result >> 32);
236 } 236 }
237 237
238 public KernelResult GetProcessId32([R(1)] int handle, [R(1)] out int pidLow, [R(2)] out int pidHigh) 238 public KernelResult GetProcessId32([R(1)] int handle, [R(1)] out uint pidLow, [R(2)] out uint pidHigh)
239 { 239 {
240 KernelResult result = _syscall.GetProcessId(out long pid, handle); 240 KernelResult result = _syscall.GetProcessId(out ulong pid, handle);
241 241
242 pidLow = (int)(pid & uint.MaxValue); 242 pidLow = (uint)(pid & uint.MaxValue);
243 pidHigh = (int)(pid >> 32); 243 pidHigh = (uint)(pid >> 32);
244 244
245 return result; 245 return result;
246 } 246 }
@@ -413,7 +413,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
413 413
414 public KernelResult GetThreadId32([R(1)] int handle, [R(1)] out uint threadUidLow, [R(2)] out uint threadUidHigh) 414 public KernelResult GetThreadId32([R(1)] int handle, [R(1)] out uint threadUidLow, [R(2)] out uint threadUidHigh)
415 { 415 {
416 long threadUid; 416 ulong threadUid;
417 417
418 KernelResult result = _syscall.GetThreadId(out threadUid, handle); 418 KernelResult result = _syscall.GetThreadId(out threadUid, handle);
419 419
diff --git a/Ryujinx.HLE/HOS/Kernel/SupervisorCall/Syscall64.cs b/Ryujinx.HLE/HOS/Kernel/SupervisorCall/Syscall64.cs
index fcb2a702f..2af736d8a 100644
--- a/Ryujinx.HLE/HOS/Kernel/SupervisorCall/Syscall64.cs
+++ b/Ryujinx.HLE/HOS/Kernel/SupervisorCall/Syscall64.cs
@@ -232,7 +232,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
232 return _syscall.GetSystemTick(); 232 return _syscall.GetSystemTick();
233 } 233 }
234 234
235 public KernelResult GetProcessId64([R(1)] int handle, [R(1)] out long pid) 235 public KernelResult GetProcessId64([R(1)] int handle, [R(1)] out ulong pid)
236 { 236 {
237 return _syscall.GetProcessId(out pid, handle); 237 return _syscall.GetProcessId(out pid, handle);
238 } 238 }
@@ -345,7 +345,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
345 return _syscall.GetCurrentProcessorNumber(); 345 return _syscall.GetCurrentProcessorNumber();
346 } 346 }
347 347
348 public KernelResult GetThreadId64([R(1)] int handle, [R(1)] out long threadUid) 348 public KernelResult GetThreadId64([R(1)] int handle, [R(1)] out ulong threadUid)
349 { 349 {
350 return _syscall.GetThreadId(out threadUid, handle); 350 return _syscall.GetThreadId(out threadUid, handle);
351 } 351 }
diff --git a/Ryujinx.HLE/HOS/Kernel/Threading/KThread.cs b/Ryujinx.HLE/HOS/Kernel/Threading/KThread.cs
index 16744c437..60f5e1a87 100644
--- a/Ryujinx.HLE/HOS/Kernel/Threading/KThread.cs
+++ b/Ryujinx.HLE/HOS/Kernel/Threading/KThread.cs
@@ -30,7 +30,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Threading
30 public int DynamicPriority { get; set; } 30 public int DynamicPriority { get; set; }
31 public ulong AffinityMask { get; set; } 31 public ulong AffinityMask { get; set; }
32 32
33 public long ThreadUid { get; private set; } 33 public ulong ThreadUid { get; private set; }
34 34
35 private long _totalTimeRunning; 35 private long _totalTimeRunning;
36 36
diff --git a/Ryujinx.HLE/HOS/Services/Am/AppletAE/AllSystemAppletProxiesService/ILibraryAppletProxy.cs b/Ryujinx.HLE/HOS/Services/Am/AppletAE/AllSystemAppletProxiesService/ILibraryAppletProxy.cs
index b85a39e5c..08b8fc7ea 100644
--- a/Ryujinx.HLE/HOS/Services/Am/AppletAE/AllSystemAppletProxiesService/ILibraryAppletProxy.cs
+++ b/Ryujinx.HLE/HOS/Services/Am/AppletAE/AllSystemAppletProxiesService/ILibraryAppletProxy.cs
@@ -5,9 +5,9 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService
5{ 5{
6 class ILibraryAppletProxy : IpcService 6 class ILibraryAppletProxy : IpcService
7 { 7 {
8 private readonly long _pid; 8 private readonly ulong _pid;
9 9
10 public ILibraryAppletProxy(long pid) 10 public ILibraryAppletProxy(ulong pid)
11 { 11 {
12 _pid = pid; 12 _pid = pid;
13 } 13 }
diff --git a/Ryujinx.HLE/HOS/Services/Am/AppletAE/AllSystemAppletProxiesService/ISystemAppletProxy.cs b/Ryujinx.HLE/HOS/Services/Am/AppletAE/AllSystemAppletProxiesService/ISystemAppletProxy.cs
index 4c94f9b6e..61a7a46d3 100644
--- a/Ryujinx.HLE/HOS/Services/Am/AppletAE/AllSystemAppletProxiesService/ISystemAppletProxy.cs
+++ b/Ryujinx.HLE/HOS/Services/Am/AppletAE/AllSystemAppletProxiesService/ISystemAppletProxy.cs
@@ -4,9 +4,9 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService
4{ 4{
5 class ISystemAppletProxy : IpcService 5 class ISystemAppletProxy : IpcService
6 { 6 {
7 private readonly long _pid; 7 private readonly ulong _pid;
8 8
9 public ISystemAppletProxy(long pid) 9 public ISystemAppletProxy(ulong pid)
10 { 10 {
11 _pid = pid; 11 _pid = pid;
12 } 12 }
diff --git a/Ryujinx.HLE/HOS/Services/Am/AppletAE/AllSystemAppletProxiesService/SystemAppletProxy/ISelfController.cs b/Ryujinx.HLE/HOS/Services/Am/AppletAE/AllSystemAppletProxiesService/SystemAppletProxy/ISelfController.cs
index 51b204f0f..2af80f6ef 100644
--- a/Ryujinx.HLE/HOS/Services/Am/AppletAE/AllSystemAppletProxiesService/SystemAppletProxy/ISelfController.cs
+++ b/Ryujinx.HLE/HOS/Services/Am/AppletAE/AllSystemAppletProxiesService/SystemAppletProxy/ISelfController.cs
@@ -8,7 +8,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Sys
8{ 8{
9 class ISelfController : IpcService 9 class ISelfController : IpcService
10 { 10 {
11 private readonly long _pid; 11 private readonly ulong _pid;
12 12
13 private KEvent _libraryAppletLaunchableEvent; 13 private KEvent _libraryAppletLaunchableEvent;
14 private int _libraryAppletLaunchableEventHandle; 14 private int _libraryAppletLaunchableEventHandle;
@@ -35,7 +35,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Sys
35 private uint _screenShotImageOrientation = 0; 35 private uint _screenShotImageOrientation = 0;
36 private uint _idleTimeDetectionExtension = 0; 36 private uint _idleTimeDetectionExtension = 0;
37 37
38 public ISelfController(ServiceCtx context, long pid) 38 public ISelfController(ServiceCtx context, ulong pid)
39 { 39 {
40 _libraryAppletLaunchableEvent = new KEvent(context.Device.System.KernelContext); 40 _libraryAppletLaunchableEvent = new KEvent(context.Device.System.KernelContext);
41 _pid = pid; 41 _pid = pid;
diff --git a/Ryujinx.HLE/HOS/Services/Am/AppletAE/AllSystemAppletProxiesService/SystemAppletProxy/IWindowController.cs b/Ryujinx.HLE/HOS/Services/Am/AppletAE/AllSystemAppletProxiesService/SystemAppletProxy/IWindowController.cs
index a97b01b41..7cb557ae0 100644
--- a/Ryujinx.HLE/HOS/Services/Am/AppletAE/AllSystemAppletProxiesService/SystemAppletProxy/IWindowController.cs
+++ b/Ryujinx.HLE/HOS/Services/Am/AppletAE/AllSystemAppletProxiesService/SystemAppletProxy/IWindowController.cs
@@ -4,9 +4,9 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Sys
4{ 4{
5 class IWindowController : IpcService 5 class IWindowController : IpcService
6 { 6 {
7 private readonly long _pid; 7 private readonly ulong _pid;
8 8
9 public IWindowController(long pid) 9 public IWindowController(ulong pid)
10 { 10 {
11 _pid = pid; 11 _pid = pid;
12 } 12 }
diff --git a/Ryujinx.HLE/HOS/Services/Am/AppletOE/ApplicationProxyService/IApplicationProxy.cs b/Ryujinx.HLE/HOS/Services/Am/AppletOE/ApplicationProxyService/IApplicationProxy.cs
index 44477922d..bb85c1db4 100644
--- a/Ryujinx.HLE/HOS/Services/Am/AppletOE/ApplicationProxyService/IApplicationProxy.cs
+++ b/Ryujinx.HLE/HOS/Services/Am/AppletOE/ApplicationProxyService/IApplicationProxy.cs
@@ -5,9 +5,9 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletOE.ApplicationProxyService
5{ 5{
6 class IApplicationProxy : IpcService 6 class IApplicationProxy : IpcService
7 { 7 {
8 private readonly long _pid; 8 private readonly ulong _pid;
9 9
10 public IApplicationProxy(long pid) 10 public IApplicationProxy(ulong pid)
11 { 11 {
12 _pid = pid; 12 _pid = pid;
13 } 13 }
diff --git a/Ryujinx.HLE/HOS/Services/Friend/ServiceCreator/IFriendService.cs b/Ryujinx.HLE/HOS/Services/Friend/ServiceCreator/IFriendService.cs
index 7a98b0e13..e417ffd5d 100644
--- a/Ryujinx.HLE/HOS/Services/Friend/ServiceCreator/IFriendService.cs
+++ b/Ryujinx.HLE/HOS/Services/Friend/ServiceCreator/IFriendService.cs
@@ -318,7 +318,7 @@ namespace Ryujinx.HLE.HOS.Services.Friend.ServiceCreator
318 318
319 // Pid placeholder 319 // Pid placeholder
320 context.RequestData.ReadInt64(); 320 context.RequestData.ReadInt64();
321 long pid = context.Request.HandleDesc.PId; 321 ulong pid = context.Request.HandleDesc.PId;
322 322
323 ulong playHistoryRegistrationKeyPosition = context.Request.PtrBuff[0].Position; 323 ulong playHistoryRegistrationKeyPosition = context.Request.PtrBuff[0].Position;
324 ulong PlayHistoryRegistrationKeySize = context.Request.PtrBuff[0].Size; 324 ulong PlayHistoryRegistrationKeySize = context.Request.PtrBuff[0].Size;
diff --git a/Ryujinx.HLE/HOS/Services/Ns/Aoc/IAddOnContentManager.cs b/Ryujinx.HLE/HOS/Services/Ns/Aoc/IAddOnContentManager.cs
index 18e371da5..53866a6b3 100644
--- a/Ryujinx.HLE/HOS/Services/Ns/Aoc/IAddOnContentManager.cs
+++ b/Ryujinx.HLE/HOS/Services/Ns/Aoc/IAddOnContentManager.cs
@@ -44,7 +44,7 @@ namespace Ryujinx.HLE.HOS.Services.Ns.Aoc
44 // CountAddOnContent(pid) -> u32 44 // CountAddOnContent(pid) -> u32
45 public ResultCode CountAddOnContent(ServiceCtx context) 45 public ResultCode CountAddOnContent(ServiceCtx context)
46 { 46 {
47 long pid = context.Request.HandleDesc.PId; 47 ulong pid = context.Request.HandleDesc.PId;
48 48
49 // NOTE: Service call arp:r GetApplicationLaunchProperty to get TitleId using the PId. 49 // NOTE: Service call arp:r GetApplicationLaunchProperty to get TitleId using the PId.
50 50
@@ -55,7 +55,7 @@ namespace Ryujinx.HLE.HOS.Services.Ns.Aoc
55 // ListAddOnContent(u32 start_index, u32 buffer_size, pid) -> (u32 count, buffer<u32>) 55 // ListAddOnContent(u32 start_index, u32 buffer_size, pid) -> (u32 count, buffer<u32>)
56 public ResultCode ListAddOnContent(ServiceCtx context) 56 public ResultCode ListAddOnContent(ServiceCtx context)
57 { 57 {
58 long pid = context.Request.HandleDesc.PId; 58 ulong pid = context.Request.HandleDesc.PId;
59 59
60 // NOTE: Service call arp:r GetApplicationLaunchProperty to get TitleId using the PId. 60 // NOTE: Service call arp:r GetApplicationLaunchProperty to get TitleId using the PId.
61 61
@@ -75,7 +75,7 @@ namespace Ryujinx.HLE.HOS.Services.Ns.Aoc
75 // GetAddOnContentBaseId(pid) -> u64 75 // GetAddOnContentBaseId(pid) -> u64
76 public ResultCode GetAddOnContentBaseId(ServiceCtx context) 76 public ResultCode GetAddOnContentBaseId(ServiceCtx context)
77 { 77 {
78 long pid = context.Request.HandleDesc.PId; 78 ulong pid = context.Request.HandleDesc.PId;
79 79
80 // NOTE: Service call arp:r GetApplicationLaunchProperty to get TitleId using the PId. 80 // NOTE: Service call arp:r GetApplicationLaunchProperty to get TitleId using the PId.
81 81
@@ -95,7 +95,7 @@ namespace Ryujinx.HLE.HOS.Services.Ns.Aoc
95 // PrepareAddOnContent(u32 index, pid) 95 // PrepareAddOnContent(u32 index, pid)
96 public ResultCode PrepareAddOnContent(ServiceCtx context) 96 public ResultCode PrepareAddOnContent(ServiceCtx context)
97 { 97 {
98 long pid = context.Request.HandleDesc.PId; 98 ulong pid = context.Request.HandleDesc.PId;
99 99
100 // NOTE: Service call arp:r GetApplicationLaunchProperty to get TitleId using the PId. 100 // NOTE: Service call arp:r GetApplicationLaunchProperty to get TitleId using the PId.
101 101
@@ -123,7 +123,7 @@ namespace Ryujinx.HLE.HOS.Services.Ns.Aoc
123 // GetAddOnContentListChangedEventWithProcessId(pid) -> handle<copy> 123 // GetAddOnContentListChangedEventWithProcessId(pid) -> handle<copy>
124 public ResultCode GetAddOnContentListChangedEventWithProcessId(ServiceCtx context) 124 public ResultCode GetAddOnContentListChangedEventWithProcessId(ServiceCtx context)
125 { 125 {
126 long pid = context.Request.HandleDesc.PId; 126 ulong pid = context.Request.HandleDesc.PId;
127 127
128 // NOTE: Service call arp:r GetApplicationLaunchProperty to get TitleId using the PId. 128 // NOTE: Service call arp:r GetApplicationLaunchProperty to get TitleId using the PId.
129 129
@@ -142,7 +142,7 @@ namespace Ryujinx.HLE.HOS.Services.Ns.Aoc
142 // NotifyMountAddOnContent(pid, u64 title_id) 142 // NotifyMountAddOnContent(pid, u64 title_id)
143 public ResultCode NotifyMountAddOnContent(ServiceCtx context) 143 public ResultCode NotifyMountAddOnContent(ServiceCtx context)
144 { 144 {
145 long pid = context.Request.HandleDesc.PId; 145 ulong pid = context.Request.HandleDesc.PId;
146 146
147 // NOTE: Service call arp:r GetApplicationLaunchProperty to get TitleId using the PId. 147 // NOTE: Service call arp:r GetApplicationLaunchProperty to get TitleId using the PId.
148 148
@@ -160,7 +160,7 @@ namespace Ryujinx.HLE.HOS.Services.Ns.Aoc
160 // NotifyUnmountAddOnContent(pid, u64 title_id) 160 // NotifyUnmountAddOnContent(pid, u64 title_id)
161 public ResultCode NotifyUnmountAddOnContent(ServiceCtx context) 161 public ResultCode NotifyUnmountAddOnContent(ServiceCtx context)
162 { 162 {
163 long pid = context.Request.HandleDesc.PId; 163 ulong pid = context.Request.HandleDesc.PId;
164 164
165 // NOTE: Service call arp:r GetApplicationLaunchProperty to get TitleId using the PId. 165 // NOTE: Service call arp:r GetApplicationLaunchProperty to get TitleId using the PId.
166 166
@@ -175,7 +175,7 @@ namespace Ryujinx.HLE.HOS.Services.Ns.Aoc
175 // CheckAddOnContentMountStatus(pid) 175 // CheckAddOnContentMountStatus(pid)
176 public ResultCode CheckAddOnContentMountStatus(ServiceCtx context) 176 public ResultCode CheckAddOnContentMountStatus(ServiceCtx context)
177 { 177 {
178 long pid = context.Request.HandleDesc.PId; 178 ulong pid = context.Request.HandleDesc.PId;
179 179
180 // NOTE: Service call arp:r GetApplicationLaunchProperty to get TitleId using the PId. 180 // NOTE: Service call arp:r GetApplicationLaunchProperty to get TitleId using the PId.
181 // Then it does some internal checks and returns InvalidBufferSize if they fail. 181 // Then it does some internal checks and returns InvalidBufferSize if they fail.
diff --git a/Ryujinx.HLE/HOS/Services/Nv/Host1xContext.cs b/Ryujinx.HLE/HOS/Services/Nv/Host1xContext.cs
index 14f3389b8..bb609fa4a 100644
--- a/Ryujinx.HLE/HOS/Services/Nv/Host1xContext.cs
+++ b/Ryujinx.HLE/HOS/Services/Nv/Host1xContext.cs
@@ -13,7 +13,7 @@ namespace Ryujinx.HLE.HOS.Services.Nv
13 public NvMemoryAllocator MemoryAllocator { get; } 13 public NvMemoryAllocator MemoryAllocator { get; }
14 public Host1xDevice Host1x { get;} 14 public Host1xDevice Host1x { get;}
15 15
16 public Host1xContext(GpuContext gpu, long pid) 16 public Host1xContext(GpuContext gpu, ulong pid)
17 { 17 {
18 MemoryAllocator = new NvMemoryAllocator(); 18 MemoryAllocator = new NvMemoryAllocator();
19 Host1x = new Host1xDevice(gpu.Synchronization); 19 Host1x = new Host1xDevice(gpu.Synchronization);
diff --git a/Ryujinx.HLE/HOS/Services/Nv/INvDrvServices.cs b/Ryujinx.HLE/HOS/Services/Nv/INvDrvServices.cs
index b70f6cb79..9a1842268 100644
--- a/Ryujinx.HLE/HOS/Services/Nv/INvDrvServices.cs
+++ b/Ryujinx.HLE/HOS/Services/Nv/INvDrvServices.cs
@@ -40,7 +40,7 @@ namespace Ryujinx.HLE.HOS.Services.Nv
40 public static IdDictionary DeviceFileIdRegistry = new IdDictionary(); 40 public static IdDictionary DeviceFileIdRegistry = new IdDictionary();
41 41
42 private IVirtualMemoryManager _clientMemory; 42 private IVirtualMemoryManager _clientMemory;
43 private long _owner; 43 private ulong _owner;
44 44
45 private bool _transferMemInitialized = false; 45 private bool _transferMemInitialized = false;
46 46
@@ -53,7 +53,7 @@ namespace Ryujinx.HLE.HOS.Services.Nv
53 { 53 {
54 if (_deviceFileRegistry.TryGetValue(path, out Type deviceFileClass)) 54 if (_deviceFileRegistry.TryGetValue(path, out Type deviceFileClass))
55 { 55 {
56 ConstructorInfo constructor = deviceFileClass.GetConstructor(new Type[] { typeof(ServiceCtx), typeof(IVirtualMemoryManager), typeof(long) }); 56 ConstructorInfo constructor = deviceFileClass.GetConstructor(new Type[] { typeof(ServiceCtx), typeof(IVirtualMemoryManager), typeof(ulong) });
57 57
58 NvDeviceFile deviceFile = (NvDeviceFile)constructor.Invoke(new object[] { context, _clientMemory, _owner }); 58 NvDeviceFile deviceFile = (NvDeviceFile)constructor.Invoke(new object[] { context, _clientMemory, _owner });
59 59
diff --git a/Ryujinx.HLE/HOS/Services/Nv/NvDrvServices/NvDeviceFile.cs b/Ryujinx.HLE/HOS/Services/Nv/NvDrvServices/NvDeviceFile.cs
index f143f6d1c..0ecbab3ff 100644
--- a/Ryujinx.HLE/HOS/Services/Nv/NvDrvServices/NvDeviceFile.cs
+++ b/Ryujinx.HLE/HOS/Services/Nv/NvDrvServices/NvDeviceFile.cs
@@ -11,11 +11,11 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices
11 abstract class NvDeviceFile 11 abstract class NvDeviceFile
12 { 12 {
13 public readonly ServiceCtx Context; 13 public readonly ServiceCtx Context;
14 public readonly long Owner; 14 public readonly ulong Owner;
15 15
16 public string Path; 16 public string Path;
17 17
18 public NvDeviceFile(ServiceCtx context, long owner) 18 public NvDeviceFile(ServiceCtx context, ulong owner)
19 { 19 {
20 Context = context; 20 Context = context;
21 Owner = owner; 21 Owner = owner;
diff --git a/Ryujinx.HLE/HOS/Services/Nv/NvDrvServices/NvHostAsGpu/NvHostAsGpuDeviceFile.cs b/Ryujinx.HLE/HOS/Services/Nv/NvDrvServices/NvHostAsGpu/NvHostAsGpuDeviceFile.cs
index 49c768b4e..ac5761d69 100644
--- a/Ryujinx.HLE/HOS/Services/Nv/NvDrvServices/NvHostAsGpu/NvHostAsGpuDeviceFile.cs
+++ b/Ryujinx.HLE/HOS/Services/Nv/NvDrvServices/NvHostAsGpu/NvHostAsGpuDeviceFile.cs
@@ -41,7 +41,7 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvHostAsGpu
41 private readonly AddressSpaceContext _asContext; 41 private readonly AddressSpaceContext _asContext;
42 private readonly NvMemoryAllocator _memoryAllocator; 42 private readonly NvMemoryAllocator _memoryAllocator;
43 43
44 public NvHostAsGpuDeviceFile(ServiceCtx context, IVirtualMemoryManager memory, long owner) : base(context, owner) 44 public NvHostAsGpuDeviceFile(ServiceCtx context, IVirtualMemoryManager memory, ulong owner) : base(context, owner)
45 { 45 {
46 _asContext = new AddressSpaceContext(context.Device.Gpu.CreateMemoryManager(owner)); 46 _asContext = new AddressSpaceContext(context.Device.Gpu.CreateMemoryManager(owner));
47 _memoryAllocator = new NvMemoryAllocator(); 47 _memoryAllocator = new NvMemoryAllocator();
diff --git a/Ryujinx.HLE/HOS/Services/Nv/NvDrvServices/NvHostChannel/NvHostChannelDeviceFile.cs b/Ryujinx.HLE/HOS/Services/Nv/NvDrvServices/NvHostChannel/NvHostChannelDeviceFile.cs
index edf554382..f0c968eb3 100644
--- a/Ryujinx.HLE/HOS/Services/Nv/NvDrvServices/NvHostChannel/NvHostChannelDeviceFile.cs
+++ b/Ryujinx.HLE/HOS/Services/Nv/NvDrvServices/NvHostChannel/NvHostChannelDeviceFile.cs
@@ -15,7 +15,7 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvHostChannel
15{ 15{
16 class NvHostChannelDeviceFile : NvDeviceFile 16 class NvHostChannelDeviceFile : NvDeviceFile
17 { 17 {
18 private static readonly ConcurrentDictionary<long, Host1xContext> _host1xContextRegistry = new(); 18 private static readonly ConcurrentDictionary<ulong, Host1xContext> _host1xContextRegistry = new();
19 19
20 private const uint MaxModuleSyncpoint = 16; 20 private const uint MaxModuleSyncpoint = 16;
21 21
@@ -45,7 +45,7 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvHostChannel
45 45
46 private NvFence _channelSyncpoint; 46 private NvFence _channelSyncpoint;
47 47
48 public NvHostChannelDeviceFile(ServiceCtx context, IVirtualMemoryManager memory, long owner) : base(context, owner) 48 public NvHostChannelDeviceFile(ServiceCtx context, IVirtualMemoryManager memory, ulong owner) : base(context, owner)
49 { 49 {
50 _device = context.Device; 50 _device = context.Device;
51 _memory = memory; 51 _memory = memory;
@@ -556,9 +556,9 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvHostChannel
556 _channelSyncpoint.Id = 0; 556 _channelSyncpoint.Id = 0;
557 } 557 }
558 558
559 private static Host1xContext GetHost1XContext(GpuContext gpu, long pid) 559 private static Host1xContext GetHost1XContext(GpuContext gpu, ulong pid)
560 { 560 {
561 return _host1xContextRegistry.GetOrAdd(pid, (long key) => new Host1xContext(gpu, key)); 561 return _host1xContextRegistry.GetOrAdd(pid, (ulong key) => new Host1xContext(gpu, key));
562 } 562 }
563 563
564 public static void Destroy() 564 public static void Destroy()
diff --git a/Ryujinx.HLE/HOS/Services/Nv/NvDrvServices/NvHostChannel/NvHostGpuDeviceFile.cs b/Ryujinx.HLE/HOS/Services/Nv/NvDrvServices/NvHostChannel/NvHostGpuDeviceFile.cs
index 46c19c6eb..5bc3e3bd3 100644
--- a/Ryujinx.HLE/HOS/Services/Nv/NvDrvServices/NvHostChannel/NvHostGpuDeviceFile.cs
+++ b/Ryujinx.HLE/HOS/Services/Nv/NvDrvServices/NvHostChannel/NvHostGpuDeviceFile.cs
@@ -16,7 +16,7 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvHostChannel
16 private int _smExceptionBptPauseReportEventHandle; 16 private int _smExceptionBptPauseReportEventHandle;
17 private int _errorNotifierEventHandle; 17 private int _errorNotifierEventHandle;
18 18
19 public NvHostGpuDeviceFile(ServiceCtx context, IVirtualMemoryManager memory, long owner) : base(context, memory, owner) 19 public NvHostGpuDeviceFile(ServiceCtx context, IVirtualMemoryManager memory, ulong owner) : base(context, memory, owner)
20 { 20 {
21 _smExceptionBptIntReportEvent = CreateEvent(context, out _smExceptionBptIntReportEventHandle); 21 _smExceptionBptIntReportEvent = CreateEvent(context, out _smExceptionBptIntReportEventHandle);
22 _smExceptionBptPauseReportEvent = CreateEvent(context, out _smExceptionBptPauseReportEventHandle); 22 _smExceptionBptPauseReportEvent = CreateEvent(context, out _smExceptionBptPauseReportEventHandle);
diff --git a/Ryujinx.HLE/HOS/Services/Nv/NvDrvServices/NvHostCtrl/NvHostCtrlDeviceFile.cs b/Ryujinx.HLE/HOS/Services/Nv/NvDrvServices/NvHostCtrl/NvHostCtrlDeviceFile.cs
index f9a2e03df..2149e2667 100644
--- a/Ryujinx.HLE/HOS/Services/Nv/NvDrvServices/NvHostCtrl/NvHostCtrlDeviceFile.cs
+++ b/Ryujinx.HLE/HOS/Services/Nv/NvDrvServices/NvHostCtrl/NvHostCtrlDeviceFile.cs
@@ -20,7 +20,7 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvHostCtrl
20 private Switch _device; 20 private Switch _device;
21 private NvHostEvent[] _events; 21 private NvHostEvent[] _events;
22 22
23 public NvHostCtrlDeviceFile(ServiceCtx context, IVirtualMemoryManager memory, long owner) : base(context, owner) 23 public NvHostCtrlDeviceFile(ServiceCtx context, IVirtualMemoryManager memory, ulong owner) : base(context, owner)
24 { 24 {
25 if (NxSettings.Settings.TryGetValue("nv!rmos_set_production_mode", out object productionModeSetting)) 25 if (NxSettings.Settings.TryGetValue("nv!rmos_set_production_mode", out object productionModeSetting))
26 { 26 {
diff --git a/Ryujinx.HLE/HOS/Services/Nv/NvDrvServices/NvHostCtrlGpu/NvHostCtrlGpuDeviceFile.cs b/Ryujinx.HLE/HOS/Services/Nv/NvDrvServices/NvHostCtrlGpu/NvHostCtrlGpuDeviceFile.cs
index 840d95b93..f1a6570b0 100644
--- a/Ryujinx.HLE/HOS/Services/Nv/NvDrvServices/NvHostCtrlGpu/NvHostCtrlGpuDeviceFile.cs
+++ b/Ryujinx.HLE/HOS/Services/Nv/NvDrvServices/NvHostCtrlGpu/NvHostCtrlGpuDeviceFile.cs
@@ -16,7 +16,7 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvHostCtrlGpu
16 private KEvent _errorEvent; 16 private KEvent _errorEvent;
17 private KEvent _unknownEvent; 17 private KEvent _unknownEvent;
18 18
19 public NvHostCtrlGpuDeviceFile(ServiceCtx context, IVirtualMemoryManager memory, long owner) : base(context, owner) 19 public NvHostCtrlGpuDeviceFile(ServiceCtx context, IVirtualMemoryManager memory, ulong owner) : base(context, owner)
20 { 20 {
21 _errorEvent = new KEvent(context.Device.System.KernelContext); 21 _errorEvent = new KEvent(context.Device.System.KernelContext);
22 _unknownEvent = new KEvent(context.Device.System.KernelContext); 22 _unknownEvent = new KEvent(context.Device.System.KernelContext);
diff --git a/Ryujinx.HLE/HOS/Services/Nv/NvDrvServices/NvMap/NvMapDeviceFile.cs b/Ryujinx.HLE/HOS/Services/Nv/NvDrvServices/NvMap/NvMapDeviceFile.cs
index 7f6f6068f..68e610068 100644
--- a/Ryujinx.HLE/HOS/Services/Nv/NvDrvServices/NvMap/NvMapDeviceFile.cs
+++ b/Ryujinx.HLE/HOS/Services/Nv/NvDrvServices/NvMap/NvMapDeviceFile.cs
@@ -11,9 +11,9 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvMap
11 { 11 {
12 private const int FlagNotFreedYet = 1; 12 private const int FlagNotFreedYet = 1;
13 13
14 private static ConcurrentDictionary<long, IdDictionary> _maps = new ConcurrentDictionary<long, IdDictionary>(); 14 private static ConcurrentDictionary<ulong, IdDictionary> _maps = new ConcurrentDictionary<ulong, IdDictionary>();
15 15
16 public NvMapDeviceFile(ServiceCtx context, IVirtualMemoryManager memory, long owner) : base(context, owner) 16 public NvMapDeviceFile(ServiceCtx context, IVirtualMemoryManager memory, ulong owner) : base(context, owner)
17 { 17 {
18 IdDictionary dict = _maps.GetOrAdd(Owner, (key) => new IdDictionary()); 18 IdDictionary dict = _maps.GetOrAdd(Owner, (key) => new IdDictionary());
19 19
@@ -237,7 +237,7 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvMap
237 return dict.Add(map); 237 return dict.Add(map);
238 } 238 }
239 239
240 private static bool DeleteMapWithHandle(long pid, int handle) 240 private static bool DeleteMapWithHandle(ulong pid, int handle)
241 { 241 {
242 if (_maps.TryGetValue(pid, out IdDictionary dict)) 242 if (_maps.TryGetValue(pid, out IdDictionary dict))
243 { 243 {
@@ -247,12 +247,12 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvMap
247 return false; 247 return false;
248 } 248 }
249 249
250 public static void IncrementMapRefCount(long pid, int handle) 250 public static void IncrementMapRefCount(ulong pid, int handle)
251 { 251 {
252 GetMapFromHandle(pid, handle)?.IncrementRefCount(); 252 GetMapFromHandle(pid, handle)?.IncrementRefCount();
253 } 253 }
254 254
255 public static bool DecrementMapRefCount(long pid, int handle) 255 public static bool DecrementMapRefCount(ulong pid, int handle)
256 { 256 {
257 NvMapHandle map = GetMapFromHandle(pid, handle); 257 NvMapHandle map = GetMapFromHandle(pid, handle);
258 258
@@ -275,7 +275,7 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvMap
275 } 275 }
276 } 276 }
277 277
278 public static NvMapHandle GetMapFromHandle(long pid, int handle) 278 public static NvMapHandle GetMapFromHandle(ulong pid, int handle)
279 { 279 {
280 if (_maps.TryGetValue(pid, out IdDictionary dict)) 280 if (_maps.TryGetValue(pid, out IdDictionary dict))
281 { 281 {
diff --git a/Ryujinx.HLE/HOS/Services/Pctl/IParentalControlServiceFactory.cs b/Ryujinx.HLE/HOS/Services/Pctl/IParentalControlServiceFactory.cs
index a84e13b54..f5be0cb42 100644
--- a/Ryujinx.HLE/HOS/Services/Pctl/IParentalControlServiceFactory.cs
+++ b/Ryujinx.HLE/HOS/Services/Pctl/IParentalControlServiceFactory.cs
@@ -19,7 +19,7 @@ namespace Ryujinx.HLE.HOS.Services.Pctl
19 // CreateService(u64, pid) -> object<nn::pctl::detail::ipc::IParentalControlService> 19 // CreateService(u64, pid) -> object<nn::pctl::detail::ipc::IParentalControlService>
20 public ResultCode CreateService(ServiceCtx context) 20 public ResultCode CreateService(ServiceCtx context)
21 { 21 {
22 long pid = context.Request.HandleDesc.PId; 22 ulong pid = context.Request.HandleDesc.PId;
23 23
24 MakeObject(context, new IParentalControlService(context, pid, true, _permissionFlag)); 24 MakeObject(context, new IParentalControlService(context, pid, true, _permissionFlag));
25 25
@@ -30,7 +30,7 @@ namespace Ryujinx.HLE.HOS.Services.Pctl
30 // CreateServiceWithoutInitialize(u64, pid) -> object<nn::pctl::detail::ipc::IParentalControlService> 30 // CreateServiceWithoutInitialize(u64, pid) -> object<nn::pctl::detail::ipc::IParentalControlService>
31 public ResultCode CreateServiceWithoutInitialize(ServiceCtx context) 31 public ResultCode CreateServiceWithoutInitialize(ServiceCtx context)
32 { 32 {
33 long pid = context.Request.HandleDesc.PId; 33 ulong pid = context.Request.HandleDesc.PId;
34 34
35 MakeObject(context, new IParentalControlService(context, pid, false, _permissionFlag)); 35 MakeObject(context, new IParentalControlService(context, pid, false, _permissionFlag));
36 36
diff --git a/Ryujinx.HLE/HOS/Services/Pctl/ParentalControlServiceFactory/IParentalControlService.cs b/Ryujinx.HLE/HOS/Services/Pctl/ParentalControlServiceFactory/IParentalControlService.cs
index 173b3223d..15b998f2a 100644
--- a/Ryujinx.HLE/HOS/Services/Pctl/ParentalControlServiceFactory/IParentalControlService.cs
+++ b/Ryujinx.HLE/HOS/Services/Pctl/ParentalControlServiceFactory/IParentalControlService.cs
@@ -7,7 +7,7 @@ namespace Ryujinx.HLE.HOS.Services.Pctl.ParentalControlServiceFactory
7{ 7{
8 class IParentalControlService : IpcService 8 class IParentalControlService : IpcService
9 { 9 {
10 private long _pid; 10 private ulong _pid;
11 private int _permissionFlag; 11 private int _permissionFlag;
12 private ulong _titleId; 12 private ulong _titleId;
13 private ParentalControlFlagValue _parentalControlFlag; 13 private ParentalControlFlagValue _parentalControlFlag;
@@ -19,7 +19,7 @@ namespace Ryujinx.HLE.HOS.Services.Pctl.ParentalControlServiceFactory
19 private bool _stereoVisionRestrictionConfigurable = true; 19 private bool _stereoVisionRestrictionConfigurable = true;
20 private bool _stereoVisionRestriction = false; 20 private bool _stereoVisionRestriction = false;
21 21
22 public IParentalControlService(ServiceCtx context, long pid, bool withInitialize, int permissionFlag) 22 public IParentalControlService(ServiceCtx context, ulong pid, bool withInitialize, int permissionFlag)
23 { 23 {
24 _pid = pid; 24 _pid = pid;
25 _permissionFlag = permissionFlag; 25 _permissionFlag = permissionFlag;
diff --git a/Ryujinx.HLE/HOS/Services/Pm/IShellInterface.cs b/Ryujinx.HLE/HOS/Services/Pm/IShellInterface.cs
index 7bb7c8ed2..e59b02d81 100644
--- a/Ryujinx.HLE/HOS/Services/Pm/IShellInterface.cs
+++ b/Ryujinx.HLE/HOS/Services/Pm/IShellInterface.cs
@@ -11,7 +11,7 @@
11 { 11 {
12 // FIXME: This is wrong but needed to make hb loader works 12 // FIXME: This is wrong but needed to make hb loader works
13 // TODO: Change this when we will have a way to process via a PM like interface. 13 // TODO: Change this when we will have a way to process via a PM like interface.
14 long pid = context.Process.Pid; 14 ulong pid = context.Process.Pid;
15 15
16 context.ResponseData.Write(pid); 16 context.ResponseData.Write(pid);
17 17
diff --git a/Ryujinx.HLE/HOS/Services/Ro/IRoInterface.cs b/Ryujinx.HLE/HOS/Services/Ro/IRoInterface.cs
index e93971fcb..713ef6cc1 100644
--- a/Ryujinx.HLE/HOS/Services/Ro/IRoInterface.cs
+++ b/Ryujinx.HLE/HOS/Services/Ro/IRoInterface.cs
@@ -418,7 +418,7 @@ namespace Ryujinx.HLE.HOS.Services.Ro
418 return (ResultCode)result; 418 return (ResultCode)result;
419 } 419 }
420 420
421 private ResultCode IsInitialized(long pid) 421 private ResultCode IsInitialized(ulong pid)
422 { 422 {
423 if (_owner != null && _owner.Pid == pid) 423 if (_owner != null && _owner.Pid == pid)
424 { 424 {
diff --git a/Ryujinx.HLE/HOS/Services/Sockets/Bsd/BsdContext.cs b/Ryujinx.HLE/HOS/Services/Sockets/Bsd/BsdContext.cs
index 071c13176..cd78af78b 100644
--- a/Ryujinx.HLE/HOS/Services/Sockets/Bsd/BsdContext.cs
+++ b/Ryujinx.HLE/HOS/Services/Sockets/Bsd/BsdContext.cs
@@ -5,7 +5,7 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Bsd
5{ 5{
6 class BsdContext 6 class BsdContext
7 { 7 {
8 private static ConcurrentDictionary<long, BsdContext> _registry = new ConcurrentDictionary<long, BsdContext>(); 8 private static ConcurrentDictionary<ulong, BsdContext> _registry = new ConcurrentDictionary<ulong, BsdContext>();
9 9
10 private readonly object _lock = new object(); 10 private readonly object _lock = new object();
11 11
@@ -123,7 +123,7 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Bsd
123 return LinuxError.SUCCESS; 123 return LinuxError.SUCCESS;
124 } 124 }
125 125
126 public static BsdContext GetOrRegister(long processId) 126 public static BsdContext GetOrRegister(ulong processId)
127 { 127 {
128 BsdContext context = GetContext(processId); 128 BsdContext context = GetContext(processId);
129 129
@@ -137,7 +137,7 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Bsd
137 return context; 137 return context;
138 } 138 }
139 139
140 public static BsdContext GetContext(long processId) 140 public static BsdContext GetContext(ulong processId)
141 { 141 {
142 if (!_registry.TryGetValue(processId, out BsdContext processContext)) 142 if (!_registry.TryGetValue(processId, out BsdContext processContext))
143 { 143 {
diff --git a/Ryujinx.HLE/HOS/Services/Ssl/SslService/ISslConnection.cs b/Ryujinx.HLE/HOS/Services/Ssl/SslService/ISslConnection.cs
index fba22f45d..96ae84be7 100644
--- a/Ryujinx.HLE/HOS/Services/Ssl/SslService/ISslConnection.cs
+++ b/Ryujinx.HLE/HOS/Services/Ssl/SslService/ISslConnection.cs
@@ -23,11 +23,11 @@ namespace Ryujinx.HLE.HOS.Services.Ssl.SslService
23 23
24 private ISslConnectionBase _connection; 24 private ISslConnectionBase _connection;
25 private BsdContext _bsdContext; 25 private BsdContext _bsdContext;
26 private readonly long _processId; 26 private readonly ulong _processId;
27 27
28 private byte[] _nextAplnProto; 28 private byte[] _nextAplnProto;
29 29
30 public ISslConnection(long processId, SslVersion sslVersion) 30 public ISslConnection(ulong processId, SslVersion sslVersion)
31 { 31 {
32 _processId = processId; 32 _processId = processId;
33 _sslVersion = sslVersion; 33 _sslVersion = sslVersion;
diff --git a/Ryujinx.HLE/HOS/Services/Ssl/SslService/ISslContext.cs b/Ryujinx.HLE/HOS/Services/Ssl/SslService/ISslContext.cs
index 0b8cb463a..93b9b423e 100644
--- a/Ryujinx.HLE/HOS/Services/Ssl/SslService/ISslContext.cs
+++ b/Ryujinx.HLE/HOS/Services/Ssl/SslService/ISslContext.cs
@@ -1,5 +1,4 @@
1using Ryujinx.Common.Logging; 1using Ryujinx.Common.Logging;
2using Ryujinx.HLE.HOS.Services.Sockets.Bsd;
3using Ryujinx.HLE.HOS.Services.Ssl.Types; 2using Ryujinx.HLE.HOS.Services.Ssl.Types;
4using System.Text; 3using System.Text;
5 4
@@ -9,12 +8,12 @@ namespace Ryujinx.HLE.HOS.Services.Ssl.SslService
9 { 8 {
10 private uint _connectionCount; 9 private uint _connectionCount;
11 10
12 private readonly long _processId; 11 private readonly ulong _processId;
13 private readonly SslVersion _sslVersion; 12 private readonly SslVersion _sslVersion;
14 private ulong _serverCertificateId; 13 private ulong _serverCertificateId;
15 private ulong _clientCertificateId; 14 private ulong _clientCertificateId;
16 15
17 public ISslContext(long processId, SslVersion sslVersion) 16 public ISslContext(ulong processId, SslVersion sslVersion)
18 { 17 {
19 _processId = processId; 18 _processId = processId;
20 _sslVersion = sslVersion; 19 _sslVersion = sslVersion;
diff --git a/Ryujinx.HLE/HOS/Services/SurfaceFlinger/BufferQueue.cs b/Ryujinx.HLE/HOS/Services/SurfaceFlinger/BufferQueue.cs
index 2a9a60644..422414dee 100644
--- a/Ryujinx.HLE/HOS/Services/SurfaceFlinger/BufferQueue.cs
+++ b/Ryujinx.HLE/HOS/Services/SurfaceFlinger/BufferQueue.cs
@@ -2,7 +2,7 @@
2{ 2{
3 static class BufferQueue 3 static class BufferQueue
4 { 4 {
5 public static BufferQueueCore CreateBufferQueue(Switch device, long pid, out BufferQueueProducer producer, out BufferQueueConsumer consumer) 5 public static BufferQueueCore CreateBufferQueue(Switch device, ulong pid, out BufferQueueProducer producer, out BufferQueueConsumer consumer)
6 { 6 {
7 BufferQueueCore core = new BufferQueueCore(device, pid); 7 BufferQueueCore core = new BufferQueueCore(device, pid);
8 8
diff --git a/Ryujinx.HLE/HOS/Services/SurfaceFlinger/BufferQueueCore.cs b/Ryujinx.HLE/HOS/Services/SurfaceFlinger/BufferQueueCore.cs
index b8fc71f38..3c9313936 100644
--- a/Ryujinx.HLE/HOS/Services/SurfaceFlinger/BufferQueueCore.cs
+++ b/Ryujinx.HLE/HOS/Services/SurfaceFlinger/BufferQueueCore.cs
@@ -40,7 +40,7 @@ namespace Ryujinx.HLE.HOS.Services.SurfaceFlinger
40 private KEvent _waitBufferFreeEvent; 40 private KEvent _waitBufferFreeEvent;
41 private KEvent _frameAvailableEvent; 41 private KEvent _frameAvailableEvent;
42 42
43 public long Owner { get; } 43 public ulong Owner { get; }
44 44
45 public bool Active { get; private set; } 45 public bool Active { get; private set; }
46 46
@@ -48,7 +48,7 @@ namespace Ryujinx.HLE.HOS.Services.SurfaceFlinger
48 48
49 public event Action BufferQueued; 49 public event Action BufferQueued;
50 50
51 public BufferQueueCore(Switch device, long pid) 51 public BufferQueueCore(Switch device, ulong pid)
52 { 52 {
53 Slots = new BufferSlotArray(); 53 Slots = new BufferSlotArray();
54 IsAbandoned = false; 54 IsAbandoned = false;
diff --git a/Ryujinx.HLE/HOS/Services/SurfaceFlinger/SurfaceFlinger.cs b/Ryujinx.HLE/HOS/Services/SurfaceFlinger/SurfaceFlinger.cs
index c45c4b9da..be2e15bd3 100644
--- a/Ryujinx.HLE/HOS/Services/SurfaceFlinger/SurfaceFlinger.cs
+++ b/Ryujinx.HLE/HOS/Services/SurfaceFlinger/SurfaceFlinger.cs
@@ -44,7 +44,7 @@ namespace Ryujinx.HLE.HOS.Services.SurfaceFlinger
44 public IGraphicBufferProducer Producer; 44 public IGraphicBufferProducer Producer;
45 public BufferItemConsumer Consumer; 45 public BufferItemConsumer Consumer;
46 public BufferQueueCore Core; 46 public BufferQueueCore Core;
47 public long Owner; 47 public ulong Owner;
48 } 48 }
49 49
50 private class TextureCallbackInformation 50 private class TextureCallbackInformation
@@ -92,7 +92,7 @@ namespace Ryujinx.HLE.HOS.Services.SurfaceFlinger
92 } 92 }
93 } 93 }
94 94
95 public IGraphicBufferProducer OpenLayer(long pid, long layerId) 95 public IGraphicBufferProducer OpenLayer(ulong pid, long layerId)
96 { 96 {
97 bool needCreate; 97 bool needCreate;
98 98
@@ -109,7 +109,7 @@ namespace Ryujinx.HLE.HOS.Services.SurfaceFlinger
109 return GetProducerByLayerId(layerId); 109 return GetProducerByLayerId(layerId);
110 } 110 }
111 111
112 public IGraphicBufferProducer CreateLayer(long pid, out long layerId) 112 public IGraphicBufferProducer CreateLayer(ulong pid, out long layerId)
113 { 113 {
114 layerId = 1; 114 layerId = 1;
115 115
@@ -129,7 +129,7 @@ namespace Ryujinx.HLE.HOS.Services.SurfaceFlinger
129 return GetProducerByLayerId(layerId); 129 return GetProducerByLayerId(layerId);
130 } 130 }
131 131
132 private void CreateLayerFromId(long pid, long layerId) 132 private void CreateLayerFromId(ulong pid, long layerId)
133 { 133 {
134 lock (Lock) 134 lock (Lock)
135 { 135 {
diff --git a/Ryujinx.HLE/HOS/Services/SurfaceFlinger/Types/GraphicBuffer.cs b/Ryujinx.HLE/HOS/Services/SurfaceFlinger/Types/GraphicBuffer.cs
index d86ff21e8..bd7692261 100644
--- a/Ryujinx.HLE/HOS/Services/SurfaceFlinger/Types/GraphicBuffer.cs
+++ b/Ryujinx.HLE/HOS/Services/SurfaceFlinger/Types/GraphicBuffer.cs
@@ -42,7 +42,7 @@ namespace Ryujinx.HLE.HOS.Services.SurfaceFlinger
42 Buffer = parcel.ReadUnmanagedType<NvGraphicBuffer>(); 42 Buffer = parcel.ReadUnmanagedType<NvGraphicBuffer>();
43 } 43 }
44 44
45 public void IncrementNvMapHandleRefCount(long pid) 45 public void IncrementNvMapHandleRefCount(ulong pid)
46 { 46 {
47 NvMapDeviceFile.IncrementMapRefCount(pid, Buffer.NvMapId); 47 NvMapDeviceFile.IncrementMapRefCount(pid, Buffer.NvMapId);
48 48
@@ -52,7 +52,7 @@ namespace Ryujinx.HLE.HOS.Services.SurfaceFlinger
52 } 52 }
53 } 53 }
54 54
55 public void DecrementNvMapHandleRefCount(long pid) 55 public void DecrementNvMapHandleRefCount(ulong pid)
56 { 56 {
57 NvMapDeviceFile.DecrementMapRefCount(pid, Buffer.NvMapId); 57 NvMapDeviceFile.DecrementMapRefCount(pid, Buffer.NvMapId);
58 58
diff --git a/Ryujinx.HLE/HOS/Services/Vi/RootService/ApplicationDisplayService/IManagerDisplayService.cs b/Ryujinx.HLE/HOS/Services/Vi/RootService/ApplicationDisplayService/IManagerDisplayService.cs
index fdab0f1b7..096c7a30e 100644
--- a/Ryujinx.HLE/HOS/Services/Vi/RootService/ApplicationDisplayService/IManagerDisplayService.cs
+++ b/Ryujinx.HLE/HOS/Services/Vi/RootService/ApplicationDisplayService/IManagerDisplayService.cs
@@ -33,7 +33,7 @@ namespace Ryujinx.HLE.HOS.Services.Vi.RootService.ApplicationDisplayService
33 long displayId = context.RequestData.ReadInt64(); 33 long displayId = context.RequestData.ReadInt64();
34 long appletResourceUserId = context.RequestData.ReadInt64(); 34 long appletResourceUserId = context.RequestData.ReadInt64();
35 35
36 long pid = context.Device.System.AppletState.AppletResourceUserIds.GetData<long>((int)appletResourceUserId); 36 ulong pid = context.Device.System.AppletState.AppletResourceUserIds.GetData<ulong>((int)appletResourceUserId);
37 37
38 context.Device.System.SurfaceFlinger.CreateLayer(pid, out long layerId); 38 context.Device.System.SurfaceFlinger.CreateLayer(pid, out long layerId);
39 context.Device.System.SurfaceFlinger.SetRenderLayer(layerId); 39 context.Device.System.SurfaceFlinger.SetRenderLayer(layerId);
diff --git a/Ryujinx.HLE/HOS/TamperMachine.cs b/Ryujinx.HLE/HOS/TamperMachine.cs
index 016f326f1..c6f8bf973 100644
--- a/Ryujinx.HLE/HOS/TamperMachine.cs
+++ b/Ryujinx.HLE/HOS/TamperMachine.cs
@@ -54,7 +54,7 @@ namespace Ryujinx.HLE.HOS
54 Activate(); 54 Activate();
55 } 55 }
56 56
57 private bool CanInstallOnPid(long pid) 57 private bool CanInstallOnPid(ulong pid)
58 { 58 {
59 // Do not allow tampering of kernel processes. 59 // Do not allow tampering of kernel processes.
60 if (pid < KernelConstants.InitialProcessId) 60 if (pid < KernelConstants.InitialProcessId)