git.ucc.asn.au
/
tpg
/
acess2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
DiskTool - Mounts successfully, debugging readdir
[tpg/acess2.git]
/
Tools
/
DiskTool
/
src
/
vfs_handles.c
diff --git
a/Tools/DiskTool/src/vfs_handles.c
b/Tools/DiskTool/src/vfs_handles.c
index
42fa659
..
4f30151
100644
(file)
--- a/
Tools/DiskTool/src/vfs_handles.c
+++ b/
Tools/DiskTool/src/vfs_handles.c
@@
-1,15
+1,33
@@
/*
*
*/
/*
*
*/
+#include <acess.h>
+#include <vfs.h>
#include <vfs_int.h>
#include <vfs_int.h>
+#define MAX_KERNEL_FILES 32
+
+// === GLOBALS ===
+tVFS_Handle gaKernelHandles[MAX_KERNEL_FILES];
+
// === CODE ===
// === CODE ===
-int VFS_AllocHandle(int b
Kernel
)
+int VFS_AllocHandle(int b
IsUser, tVFS_Node *Node, int Mode
)
{
{
- return 0;
+ for( int i = 0; i < MAX_KERNEL_FILES; i ++ )
+ {
+ if(gaKernelHandles[i].Node) continue;
+ gaKernelHandles[i].Node = Node;
+ gaKernelHandles[i].Position = 0;
+ gaKernelHandles[i].Mode = Mode;
+ return i;
+ }
+
+ return -1;
}
tVFS_Handle *VFS_GetHandle(int ID)
{
}
tVFS_Handle *VFS_GetHandle(int ID)
{
- return NULL;
+ if( ID < 0 || ID >= MAX_KERNEL_FILES )
+ return NULL;
+ return &gaKernelHandles[ID];
}
}
UCC
git Repository :: git.ucc.asn.au