Source object not removed from archive during move drag-and-drop
A free file archiver for extremely high compression
Brought to you by:
ipavlov
During drag-and-drop from app, DoDragDrop is called with dwOKEffects=3 (Copy|Move):
# Time of Day Thread Module API Return Value Error Duration
1 10:59:07.481 AM 1 7zFM.exe DoDragDrop ( 0x00000000002bac90, 0x0000000000475aa0, 3, 0x00000000001aedc8 ) DRAGDROP_S_DROP 0.6383695
# Type Name Pre-Call Value Post-Call Value
1 LPDATAOBJECT pDataObj 0x00000000002bac90 0x00000000002bac90
2 LPDROPSOURCE pDropSource 0x0000000000475aa0 0x0000000000475aa0
3 DWORD dwOKEffects 3 3
4 LPDWORD pdwEffect 0x00000000001aedc8 = 0 0x00000000001aedc8 = 2
HRESULT Return DRAGDROP_S_DROP
but if pdwEffect value is set to Move (2), 7-Zip doesn't remove the source object from the archive.
7-Zip 26.00 x64 on Windows 7 SP1.
Deleting from an archive from "Move" is a dangerous operation where data loss is possible. And it can be expensive operation because recompression can be required in some cases.
So we try to use Copy instead of Move.
Then you need to set allowed operations (dwOKEffects) to 1 (Copy).
I don't remember details.
Each selected decision in that code had some reasons.
You can look source code, maybe there are some comments there.
some long comments from source code.
I hope these comments are related to that issue?
Last edit: Igor Pavlov 2026-02-17
I see, you are using the move effect to force the target app to move file object from temp to the target location if they are on the same logical drive.
Why not to use FileGroupDescriptor format that is designed for virtual objects?
I don't remember why it's so.
Does FileGroupDescriptor format support alternate data streams and creation timestamps in files?
But it's another thing.
Your original question was about
dwOKEffects.FileGroupDescriptor format supports creation, last access and last write timestamps. The data is transferred via FileContents format, which supports several media types: global memory, IStream, IStorage, e.t.c.