Ticket #9554 (closed defect: fixed)

Opened 7 years ago

Last modified 5 years ago

WriteFile fails to write to shared folder file if number of bytes is bigger than 64KB.

Reported by: dboiko Owned by:
Priority: major Component: shared folders
Version: VirtualBox 4.1.2 Keywords: WriteFile invalid parameter
Cc: Guest type: Windows
Host type: Windows

Description (last modified by sunlover) (diff)

When I try to write big-sized data (2MB-32MB) to a file on a shared folder (using WriteFile function), I get "invalid parameter" error. I get the error if number of bytes to write is bigger than 64KB. I get the error on Windows XP, Windows Server 2008 and Windows 7.

I get the error also on VirtualBox 4.0.12, but maximum number of bytes is 8MB.

Change History

comment:1 Changed 7 years ago by sunlover

You should attach VBox.log file of a VM, where the error happens.

What the version of guest additions is used? Do you use any antivirus software in the guest?

comment:2 Changed 6 years ago by ksmyth

VBox.log shows nothing relating to the error.

I reproduced this error today with VirtualBox 4.1.18 and Guest Additions 4.1.18, while using Visual Studio to compile a C++ project with a large .obj file. Error message was:

fatal error LNK1106: invalid file or disk full: cannot seek to 0x1AC6CC2

While the error message says "cannot seek", Process Monitor confirms the same source of the bug: WriteFile with a large Length failing with INVALID PARAMETER:

2:41:46.6353762 PM link.exe 372 WriteFile
vboxsrv\Documents\.....lib INVALID PARAMETER Offset: 4,194,304, Length: 20,271,104, I/O Flags: Non-cached, Paging I/O, Synchronous Paging I/O, Priority: Normal

comment:3 Changed 6 years ago by ksmyth

Python script to repro:

from win32file import CreateFile, WriteFile, GENERIC_READ, GENERIC_WRITE, CREATE_ALWAYS

filename = r'\\VBOXSVR\Documents\9554'
size = 1024 * 1024 * 16 + 1

f = CreateFile(filename, GENERIC_READ | GENERIC_WRITE, 0, None, CREATE_ALWAYS, 0, None)
WriteFile(f, ' ' * size)
Traceback (most recent call last):
  File "C:\Users\ksmyth\Desktop\", line 8, in <module>
    WriteFile(f, ' ' * size)
pywintypes.error: (87, 'WriteFile', 'The parameter is incorrect.')

comment:4 Changed 5 years ago by sunlover

  • Status changed from new to closed
  • Resolution set to fixed
  • Description modified (diff)

Fixed in VBox 4.2.8.

Note: See TracTickets for help on using tickets.
ContactPrivacy policyTerms of Use