EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Excel 2003 Renames sending ReplaceIfExists

Also by EldoS: MsgConnect
Cross-platform protocol-independent communication framework for building peer-to-peer and client-server applications and middleware components.
#21242
Posted: 08/29/2012 14:49:23
by Eric Dahlvang (Standard support level)
Joined: 09/11/2009
Posts: 29

Using the current CBFS VMounter dotNET sample, if you save a Microsoft Office 2003 Excel file into the drive, there will be a remnant file left after the save operation completes. This is due to the fact that Excel 2003 creates a temporary file, then renames the original file to the name of that temporary file. Which causes the DiskEnumerationContext.mFileList to have two files with the same name.

Watching the operations on the drive with Process Monitor reveals that Excel.exe sends ReplaceIfExists: True in the SetRenameInformationFile call...however, this information is not provided in the CBFS callback. Is it possible to have this information available to us, or are we simply to assume that every application that attempts to rename a file to the name of an existing file is in fact intending to replace the existing file?

Here are the calls from Process Monitor:

2:36:07.1383526 PM EXCEL.EXE 356 CreateFile Z:\Excel2003File.xls~RF9ea7ad4.TMP
SUCCESS Desired Access: Generic Write, Read Attributes, Delete,
Disposition: Create,
Options: Synchronous IO Non-Alert, Non-Directory File,
Attributes: HT,
ShareMode: None, AllocationSize: 0,
OpenResult: Created

2:36:07.1385852 PM EXCEL.EXE 356 CloseFile Z:\Excel2003File.xls~RF9ea7ad4.TMP
SUCCESS

2:36:07.1386439 PM EXCEL.EXE 356 QueryBasicInformationFile Z:\Excel2003File.xls
SUCCESS CreationTime: 8/29/2012 2:28:33 PM,
LastAccessTime: 8/29/2012 2:35:58 PM,
LastWriteTime: 8/29/2012 2:28:33 PM,
ChangeTime: 0, FileAttributes: A

2:36:07.1386659 PM EXCEL.EXE 356 CreateFile Z:\
SUCCESS Desired Access: Write Data/Add File, Synchronize,
Disposition: Open, Options: ,
Attributes: n/a,
ShareMode: Read, Write,
AllocationSize: n/a, OpenResult: Exists

2:36:07.1391979 PM EXCEL.EXE 356 SetRenameInformationFile Z:\Excel2003File.xls 0xC000022D
ReplaceIfExists: True, FileName: Z:\Excel2003File.xls~RF9ea7ad4.TMP
#21245
Posted: 08/30/2012 01:09:33
by Volodymyr Zinin (EldoS Corp.)

Quote
Eric Dahlvang wrote:
or are we simply to assume that every application that attempts to rename a file to the name of an existing file is in fact intending to replace the existing file?

The ReplaceIfExists flag is processed internally by CallbackFS. Just replace the already existing file.

Reply

Statistics

Topic viewed 1515 times

Number of guests: 1, registered members: 0, in total hidden: 0




|

Back to top

As of July 15, 2016 EldoS Corporation will operate as a division of /n software inc. For more information, please read the announcement.

Got it!