From b5fcf883e863c5f449855dc1113db07383b914b5 Mon Sep 17 00:00:00 2001
From: gdkchan <gab.dark.100@gmail.com>
Date: Fri, 15 Feb 2019 12:44:25 -0300
Subject: [PATCH] Implement IStorage GetSize (#585)

---
 Ryujinx.HLE/HOS/Services/FspSrv/IStorage.cs | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/Ryujinx.HLE/HOS/Services/FspSrv/IStorage.cs b/Ryujinx.HLE/HOS/Services/FspSrv/IStorage.cs
index d000635de3..85ab2cf65e 100644
--- a/Ryujinx.HLE/HOS/Services/FspSrv/IStorage.cs
+++ b/Ryujinx.HLE/HOS/Services/FspSrv/IStorage.cs
@@ -16,7 +16,8 @@ namespace Ryujinx.HLE.HOS.Services.FspSrv
         {
             _commands = new Dictionary<int, ServiceProcessRequest>
             {
-                { 0, Read }
+                { 0, Read    },
+                { 4, GetSize }
             };
 
             _baseStream = baseStream;
@@ -51,5 +52,13 @@ namespace Ryujinx.HLE.HOS.Services.FspSrv
 
             return 0;
         }
+
+        // GetSize() -> u64 size
+        public long GetSize(ServiceCtx context)
+        {
+            context.ResponseData.Write(_baseStream.Length);
+
+            return 0;
+        }
     }
 }