View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0000499 | Far Manager | Copy/Move | public | 2008-03-19 02:15 | 2008-04-05 14:17 |
Reporter | alexmitin | Assigned To | alexy | ||
Priority | normal | Severity | major | Reproducibility | always |
Status | closed | Resolution | fixed | ||
Fixed in Version | 1.80 alpha 1 | ||||
Summary | 0000499: Invalid file handle used in ShellCopy::ShellCopyFile() | ||||
Description | File: copy.cpp Context: int ShellCopy::ShellCopyFile( const wchar_t *SrcName, const FAR_FIND_DATA_EX &SrcData, const wchar_t *DestName, DWORD DestAttr, int Append ) { ... HANDLE SrcHandle= apiCreateFile( ==[code.A]== SrcName, GENERIC_READ, OpenMode, NULL, OPEN_EXISTING, FILE_FLAG_SEQUENTIAL_SCAN, NULL ); if (SrcHandle==INVALID_HANDLE_VALUE) ==[code.B]== { if (Opt.CMOpt.CopyOpened) { _localLastError=GetLastError(); SetLastError(_localLastError); if ( _localLastError == ERROR_SHARING_VIOLATION ) ==[code.C]== { SrcHandle = apiCreateFile( SrcName, GENERIC_READ, FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE, NULL, OPEN_EXISTING, FILE_FLAG_SEQUENTIAL_SCAN, NULL ); if (SrcHandle == INVALID_HANDLE_VALUE ) { _localLastError=GetLastError(); SetLastError(_localLastError); return COPY_FAILURE; } } } else { _localLastError=GetLastError(); SetLastError(_localLastError); return COPY_FAILURE; } } ... while (!ReadFile(SrcHandle,CopyBuffer,CopyBufSize,&BytesRead,NULL)) ==[code.D]== { ... } Analysis ================== Prerequisite: [x] Copy files opening for writing. If the apiCreateFile function (code.A) returns the value INVALID_HANDLE_VALUE for any reason except the ERROR_SHARING_VIOLATION the invalid handle will be used in the call of ReadFile() (code.D). | ||||
Additional Information | FAR 1.80.0.452 | ||||
Tags | No tags attached. | ||||
Build | 460 | ||||
Date Modified | Username | Field | Change |
---|---|---|---|
2008-03-19 02:15 | alexmitin | New Issue | |
2008-03-23 00:48 | alexy | Status | new => assigned |
2008-03-23 00:48 | alexy | Assigned To | => alexy |
2008-03-25 14:09 | alexy | Note Added: 0001426 | |
2008-03-25 14:09 | alexy | Status | assigned => feedback |
2008-04-02 00:51 | alexmitin | Status | feedback => resolved |
2008-04-02 00:51 | alexmitin | Resolution | open => fixed |
2008-04-02 00:51 | alexmitin | Note Added: 0001467 | |
2008-04-05 14:17 | alexy | Build | => 460 |
2008-04-05 14:17 | alexy | Status | resolved => closed |
2008-04-05 14:17 | alexy | Fixed in Version | => 1.80 alpha 1 |