This should work.
This commit is contained in:
parent
86e8010db3
commit
632d297f4b
1 changed files with 11 additions and 6 deletions
|
@ -78,12 +78,17 @@ namespace Ryujinx.OsHle.Objects.FspSrv
|
||||||
long BufferLen = Context.Request.ReceiveBuff[0].Size;
|
long BufferLen = Context.Request.ReceiveBuff[0].Size;
|
||||||
long MaxDirectories = BufferLen / DirectoryEntrySize;
|
long MaxDirectories = BufferLen / DirectoryEntrySize;
|
||||||
|
|
||||||
if (MaxDirectories >= DirectoryEntries.Count) MaxDirectories = DirectoryEntries.Count;
|
if (MaxDirectories > DirectoryEntries.Count - LastItem)
|
||||||
|
|
||||||
int CurrentIndex, CurrentItem;
|
|
||||||
byte[] DirectoryEntry = new byte[DirectoryEntrySize];
|
|
||||||
for (CurrentIndex = 0, CurrentItem = LastItem; CurrentIndex < MaxDirectories; CurrentIndex++, CurrentItem++)
|
|
||||||
{
|
{
|
||||||
|
MaxDirectories = DirectoryEntries.Count - LastItem;
|
||||||
|
}
|
||||||
|
|
||||||
|
int CurrentIndex;
|
||||||
|
byte[] DirectoryEntry = new byte[DirectoryEntrySize];
|
||||||
|
for (CurrentIndex = 0; CurrentIndex < MaxDirectories; CurrentIndex++)
|
||||||
|
{
|
||||||
|
int CurrentItem = LastItem + CurrentIndex;
|
||||||
|
|
||||||
MemoryStream MemStream = new MemoryStream();
|
MemoryStream MemStream = new MemoryStream();
|
||||||
BinaryWriter Writer = new BinaryWriter(MemStream);
|
BinaryWriter Writer = new BinaryWriter(MemStream);
|
||||||
|
|
||||||
|
@ -100,7 +105,7 @@ namespace Ryujinx.OsHle.Objects.FspSrv
|
||||||
|
|
||||||
if (LastItem < DirectoryEntries.Count)
|
if (LastItem < DirectoryEntries.Count)
|
||||||
{
|
{
|
||||||
LastItem = CurrentItem;
|
LastItem += CurrentIndex;
|
||||||
Context.ResponseData.Write((long)CurrentIndex); // index = number of entries written this call.
|
Context.ResponseData.Write((long)CurrentIndex); // index = number of entries written this call.
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue