aboutsummaryrefslogtreecommitdiff
path: root/sftsr.h
diff options
context:
space:
mode:
authorJavier <dev.git@javispedro.com>2022-04-30 13:36:08 +0200
committerJavier <dev.git@javispedro.com>2022-04-30 13:36:08 +0200
commit7f2b85a2131718fd39b49737a5d945fb3ae7bde7 (patch)
tree918ee14faa96643db58b4b2464e1cddce5958bba /sftsr.h
parent66955fce6cc5b39cf3007d20dcc816a3607edd74 (diff)
downloadvbados-7f2b85a2131718fd39b49737a5d945fb3ae7bde7.tar.gz
vbados-7f2b85a2131718fd39b49737a5d945fb3ae7bde7.zip
save findfirst/findnext state in sdb, support concurrent calls
fd xcopy at least uses this. since we don't have a findclose call, we may leak the dir fd if the program does not finish reading the entire directory
Diffstat (limited to 'sftsr.h')
-rw-r--r--sftsr.h13
1 files changed, 5 insertions, 8 deletions
diff --git a/sftsr.h b/sftsr.h
index 7c8802f..52e86f3 100644
--- a/sftsr.h
+++ b/sftsr.h
@@ -30,11 +30,10 @@
#define TRACE_CALLS 0
#define LASTDRIVE 'Z'
-#define MAX_NUM_DRIVE (LASTDRIVE - 'A')
-#define NUM_DRIVES (MAX_NUM_DRIVE + 1)
+#define NUM_DRIVES ((LASTDRIVE - 'A') + 1)
/** Maximum number of open files */
-#define NUM_FILES 40
+#define NUM_FILES 60
/** Parameters used for returning disk geometry.
* For compatibility, better if sector_per_cluster * bytes_per_sector <= 32K. */
@@ -42,13 +41,12 @@
#define BYTES_PER_SECTOR 4096
#define BYTES_PER_CLUSTER (SECTORS_PER_CLUSTER * BYTES_PER_SECTOR)
-/** Directory enumeration needs an open file, this is its index in the "openfile" table. */
-#define SEARCH_DIR_FILE 0
-
/** Size of the VBox buffer. The maximum message length that may be sent.
* Enough to fit an HGCM connect call, which is actually larger than most other calls we use ( <= 7 args ). */
#define VBOX_BUFFER_SIZE (200)
+#define INVALID_OPENFILE (-1)
+
typedef struct {
uint32_t root;
uint64_t handle;
@@ -73,8 +71,7 @@ typedef struct {
uint32_t root;
} drives[NUM_DRIVES];
- /** All currently open files.
- * index 0 is reserved for the file opened during directory enumeration. */
+ /** All currently open files. */
OPENFILE files[NUM_FILES];
// VirtualBox communication