summaryrefslogtreecommitdiffhomepage
path: root/dev/Kernel/src/FS
diff options
context:
space:
mode:
Diffstat (limited to 'dev/Kernel/src/FS')
-rw-r--r--dev/Kernel/src/FS/NeFS.cc13
1 files changed, 11 insertions, 2 deletions
diff --git a/dev/Kernel/src/FS/NeFS.cc b/dev/Kernel/src/FS/NeFS.cc
index e375632f..0ef83615 100644
--- a/dev/Kernel/src/FS/NeFS.cc
+++ b/dev/Kernel/src/FS/NeFS.cc
@@ -138,13 +138,22 @@ _Output BOOL NeFileSystemParser::CreateFork(_Input NFS_FORK_STRUCT& the_fork)
the_fork.PreviousSibling = lbaOfPreviousFork;
the_fork.NextSibling = (the_fork.DataOffset - the_fork.DataSize - sizeof(NFS_FORK_STRUCT));
+ NFS_FORK_STRUCT* fork = new NFS_FORK_STRUCT;
+
+ MUST_PASS(fork); // ?????
+
+ rt_copy_memory(&the_fork, fork, sizeof(NFS_FORK_STRUCT));
+
drv.fPacket.fPacketLba = lba;
drv.fPacket.fPacketSize = sizeof(NFS_FORK_STRUCT);
- drv.fPacket.fPacketContent = &the_fork;
+ drv.fPacket.fPacketContent = fork;
kcout << "Writing fork...\r";
- drv.fOutput(&drv.fPacket);
+ drv.fOutput(&drv.fPacket);
+
+ delete fork;
+ fork = nullptr;
/// log what we have now.
kcout << "Wrote fork data at: " << hex_number(the_fork.DataOffset)