Well that is not really critical and may only in rare circumstances cause that the TC-Lister fails.
However I encountered such a scenario when messing around with the Flashplayer.
It'll buffer files in
c:\Temp\acro_rd_dir\fla2281.tmp
'forgot' to set the FILE_SHARE_READ flag on CreateFile and additional set the flag FILE_FLAG_DELETE_ON_CLOSE 0x04000000
I fixed the FILE_SHARE_READ-'bug' to be able to copy or drag fla2281.tmp into VLC just as in old times.
Code: Select all
Patch for
C:\Windows\System32\Macromed\Flash
NPSWF32_11_4_402_265.dll
Search
68 00 00 00 14 6A 02 6A 00 68 00 00 00 C0
Replace with
68 00 00 00 14 6A 02 6A 01
^^-FILE_SHARE_READ
Comments
68 00000014 PUSH 14000000 ;FILE_FLAG_DELETE_ON_CLOSE
6A 02 PUSH 2 ;CREATE_ALWAYS
6A 00 PUSH 0 <- ;NO 0x01 FILE_SHARE_READ !!!
68 000000C0 PUSH C0000000 ;GENERIC_READ|GENERIC_WRITE
0CDD9CC8 |FileName = "\\?\c:\Temp\acro_rd_dir\fla67CF.tmp"
C0000000 |Access = GENERIC_READ|GENERIC_WRITE
00000001 |ShareMode = FILE_SHARE_READ
00000000 |pSecurity = NULL
00000002 |Mode = CREATE_ALWAYS
14000000 |Attributes = RANDOM_ACCESS|DELETE_ON_CLOSE
00000000 \hTemplateFile = NULL

Digging deeper into this reveals that if a file was created with DELETE_ON_CLOSE(and of course with at least FILE_SHARE_READ) and some other application also opens this files it needs FILE_SHARE_DELETE in ShareMode or opening will fail.
So please add the 'FILE_SHARE_DELETE' flag to the ShareMode parameter in CreateFile for opening files in the TC.
Well I did this already in Totalcmd.exe like this
before:
Code: Select all
...
Case 0,4
sharemode:=3 ;FILE_SHARE_WRITE | FILE_SHARE_READ
Case 1
sharemode:=0
Case 2
sharemode:=1 ;FILE_SHARE_READ
Case 3
sharemode:=2 ;FILE_SHARE_WRITE
...
Code: Select all
...Case 0,4
sharemode:=7 ;FILE_SHARE_DELETE | FILE_SHARE_WRITE | FILE_SHARE_READ
Case 1
sharemode:=0
Case 2
sharemode:=5 ;FILE_SHARE_DELETE | FILE_SHARE_READ
Case 3
sharemode:=6 ;FILE_SHARE_DELETE | FILE_SHARE_WRITE
...
(..well I know the TC selfchecks - 'temporally' disabled this overhead for testing and kept it off for better performance

_______________________________________________________
Reference for the Kernel32.CreateFile API-Function:
http://msdn.microsoft.com/en-us/library/windows/desktop/aa363858%28v=vs.85%29.aspx
That's what the MSDN tells about
FILE_FLAG_DELETE_ON_CLOSE 0x04000000
...and aboutThe file is to be deleted immediately after all of its handles are closed, which includes the specified handle and any other open or duplicated handles.
If there are existing open handles to a file, the call fails unless they were all opened with the FILE_SHARE_DELETE share mode.
Subsequent open requests for the file fail, unless the FILE_SHARE_DELETE share mode is specified.
FILE_SHARE_READ 0x00000001
FILE_SHARE_WRITE 0x00000002
FILE_SHARE_DELETE 0x00000004
Enables subsequent open operations on a file or device to request delete access.
Otherwise, other processes cannot open the file or device if they request delete access.
If this flag is not specified, but the file or device has been opened for delete access, the function fails.
Note Delete access allows both delete and rename operations.