[vbox-dev] Preserving original file's time stamp when Drag&Drop files Guest to Host

info at adontec.com info at adontec.com
Wed Mar 15 20:57:47 UTC 2017

Hi there

we use VirtualBox to run Windows VM. Quite often files need to be copied between host and guets and for this Drag&Drop was used in case of Virtual PC.

Since moved to VirtualBox Drag and Drop does not seem to be working as expected. The original file's time stamp is not restored.

Going through a network drive restores the original time stamp but it is not the preferred way for our solution.

So going to the actual VBOX sources (5.1.4)  we might have located the files and the correct code to be added at least for Windows Guest/Host.

Unfortunately the compile task is to complex and time consuming for us to go further. So if you would like to have that code and test it and incorporate it in an upcoming release we happily mail that to you (MIT license).

File: DnDURIObject.cpp

void DnDURIObject::closeInternal(void)


    if (!m_fOpen)

    switch (m_Type)
        case File:
             /* Set file's original time stamp. */
            if (m_AccessTime || m_ChangeTime || m_ModificationTime || m_BirthTime)
            RTFileSetTimes(u.m_hFile, &m_AccessTime, &m_ModificationTime, &m_ChangeTime, &m_BirthTime);

Attached a zip file with the affected two files. Changes marked with "//KG". Since we have not compiled it, it is also not tested so we are not very sure that it corrects this issue.


Kiriakos Georgiadis

Since 1990, Professional Developer Tools for the Professional Software Developer.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: DragAndDrop.zip
Type: octet/stream
Size: 6033 bytes
URL: <http://www.virtualbox.org/pipermail/vbox-dev/attachments/20170315/224e5526/attachment.bin>

More information about the vbox-dev mailing list