aboutsummaryrefslogtreecommitdiff
path: root/vboxshfl.h
diff options
context:
space:
mode:
authorJavier <dev.git@javispedro.com>2022-04-12 23:06:38 +0200
committerJavier <dev.git@javispedro.com>2022-04-12 23:06:38 +0200
commitd167af14ac9db82418e239060d3ff5e8d8dbf75a (patch)
treeda1ab4eba6801e3503f31a54f0021749993eb468 /vboxshfl.h
parenta109a1193ca3cf64a29265103075922d2dd9fc1b (diff)
downloadvbados-d167af14ac9db82418e239060d3ff5e8d8dbf75a.tar.gz
vbados-d167af14ac9db82418e239060d3ff5e8d8dbf75a.zip
getattr and lock
Diffstat (limited to 'vboxshfl.h')
-rw-r--r--vboxshfl.h37
1 files changed, 37 insertions, 0 deletions
diff --git a/vboxshfl.h b/vboxshfl.h
index aef9bca..04afed0 100644
--- a/vboxshfl.h
+++ b/vboxshfl.h
@@ -307,6 +307,43 @@ static int32_t vbox_shfl_write(LPVBOXCOMM vb, hgcm_client_id_t client_id, SHFLRO
return req->header.result;
}
+static int32_t vbox_shfl_lock(LPVBOXCOMM vb, hgcm_client_id_t client_id, SHFLROOT root, SHFLHANDLE handle,
+ unsigned long offset, unsigned long length, unsigned flags)
+{
+ VMMDevHGCMCall __far *req = (void __far *) vb->buf;
+ vbox_hgcm_init_call(req, client_id, SHFL_FN_LOCK, 5);
+
+ // arg 0 in uint32 "root"
+ req->aParms[0].type = VMMDevHGCMParmType_32bit;
+ req->aParms[0].u.value32 = root;
+
+ // arg 1 in uint64 "handle"
+ req->aParms[1].type = VMMDevHGCMParmType_64bit;
+ req->aParms[1].u.value64 = handle;
+
+ // arg 2 in uint64 "offset"
+ req->aParms[2].type = VMMDevHGCMParmType_64bit;
+ req->aParms[2].u.value64 = offset;
+
+ // arg 3 inout uint64 "length"
+ req->aParms[3].type = VMMDevHGCMParmType_64bit;
+ req->aParms[3].u.value64 = length;
+
+ // arg 4 in uint32 "flags"
+ req->aParms[4].type = VMMDevHGCMParmType_32bit;
+ req->aParms[4].u.value32 = flags;
+
+ vbox_send_request(vb->iobase, vb->dds.physicalAddress);
+
+ if (req->header.header.rc < 0) {
+ return req->header.header.rc;
+ } else if (req->header.header.rc == VINF_HGCM_ASYNC_EXECUTE) {
+ vbox_hgcm_wait(&req->header);
+ }
+
+ return req->header.result;
+}
+
static int32_t vbox_shfl_list(LPVBOXCOMM vb, hgcm_client_id_t client_id, SHFLROOT root, SHFLHANDLE handle,
unsigned flags, unsigned __far *size, const SHFLSTRING *path, SHFLDIRINFO *dirinfo, unsigned __far *resume, unsigned __far *count)
{