9d37510d1d
Stop trying to read or write if the backend function reports that 0 bytes have been read or written. Fixes #1563
97 lines
3.0 KiB
Diff
97 lines
3.0 KiB
Diff
sharedfolder_pagelist.patch
|
|
|
|
diff --git a/src/app/virtualbox/src/VBox/HostServices/SharedFolders/service.cpp b/src/app/virtualbox/src/VBox/HostServices/SharedFolders/service.cpp
|
|
index 49a0006..f9da046 100644
|
|
--- a/src/app/virtualbox/src/VBox/HostServices/SharedFolders/service.cpp
|
|
+++ b/src/app/virtualbox/src/VBox/HostServices/SharedFolders/service.cpp
|
|
@@ -549,6 +549,14 @@ static DECLCALLBACK(void) svcCall (void *, VBOXHGCMCALLHANDLE callHandle, uint32
|
|
}
|
|
else
|
|
{
|
|
+
|
|
+
|
|
+ /* WORKAROUND start */
|
|
+ uint32_t read = 0;
|
|
+
|
|
+ while (read < paParms[3].u.uint32) {
|
|
+
|
|
+
|
|
/* Execute the function. */
|
|
if (pStatusLed)
|
|
{
|
|
@@ -562,13 +570,27 @@ static DECLCALLBACK(void) svcCall (void *, VBOXHGCMCALLHANDLE callHandle, uint32
|
|
|
|
if (RT_SUCCESS(rc))
|
|
{
|
|
- /* Update parameters.*/
|
|
- paParms[3].u.uint32 = count;
|
|
+ if (count == 0) {
|
|
+ /* Update parameters.*/
|
|
+ paParms[3].u.uint32 = read;
|
|
+ break;
|
|
+ }
|
|
+
|
|
+ read += count;
|
|
+ offset += count;
|
|
+ pBuffer += count;
|
|
+ count = paParms[3].u.uint32 - read;
|
|
}
|
|
else
|
|
{
|
|
paParms[3].u.uint32 = 0; /* nothing read */
|
|
}
|
|
+
|
|
+
|
|
+
|
|
+ } /* WORKAROUND - End */
|
|
+
|
|
+
|
|
}
|
|
}
|
|
break;
|
|
@@ -616,6 +638,14 @@ static DECLCALLBACK(void) svcCall (void *, VBOXHGCMCALLHANDLE callHandle, uint32
|
|
}
|
|
else
|
|
{
|
|
+
|
|
+
|
|
+ /* WORKAROUND start */
|
|
+ uint32_t written = 0;
|
|
+
|
|
+ while (written < paParms[3].u.uint32) {
|
|
+
|
|
+
|
|
/* Execute the function. */
|
|
if (pStatusLed)
|
|
{
|
|
@@ -629,13 +659,27 @@ static DECLCALLBACK(void) svcCall (void *, VBOXHGCMCALLHANDLE callHandle, uint32
|
|
|
|
if (RT_SUCCESS(rc))
|
|
{
|
|
- /* Update parameters.*/
|
|
- paParms[3].u.uint32 = count;
|
|
+ if (count == 0) {
|
|
+ /* Update parameters.*/
|
|
+ paParms[3].u.uint32 = written;
|
|
+ break;
|
|
+ }
|
|
+
|
|
+ written += count;
|
|
+ offset += count;
|
|
+ pBuffer += count;
|
|
+ count = paParms[3].u.uint32 - written;
|
|
}
|
|
else
|
|
{
|
|
paParms[3].u.uint32 = 0; /* nothing read */
|
|
}
|
|
+
|
|
+
|
|
+ } /* WORKAROUND - End */
|
|
+
|
|
+
|
|
+
|
|
}
|
|
}
|
|
break;
|