aboutsummaryrefslogtreecommitdiff
path: root/CPP/7zip/UI/FileManager/FSFolder.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--CPP/7zip/UI/FileManager/FSFolder.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/CPP/7zip/UI/FileManager/FSFolder.cpp b/CPP/7zip/UI/FileManager/FSFolder.cpp
index 06c572d..26a2ccf 100644
--- a/CPP/7zip/UI/FileManager/FSFolder.cpp
+++ b/CPP/7zip/UI/FileManager/FSFolder.cpp
@@ -45,7 +45,7 @@ typedef struct _IO_STATUS_BLOCK {
45 45
46#include "SysIconUtils.h" 46#include "SysIconUtils.h"
47 47
48#if _WIN32_WINNT < 0x0501 48#if !defined(_WIN32_WINNT) || _WIN32_WINNT < 0x0501
49#ifdef _APISETFILE_ 49#ifdef _APISETFILE_
50// Windows SDK 8.1 defines in fileapi.h the function GetCompressedFileSizeW only if _WIN32_WINNT >= 0x0501 50// Windows SDK 8.1 defines in fileapi.h the function GetCompressedFileSizeW only if _WIN32_WINNT >= 0x0501
51// But real support version for that function is NT 3.1 (probably) 51// But real support version for that function is NT 3.1 (probably)
@@ -63,6 +63,7 @@ using namespace NDir;
63using namespace NName; 63using namespace NName;
64 64
65#ifndef USE_UNICODE_FSTRING 65#ifndef USE_UNICODE_FSTRING
66int CompareFileNames_ForFolderList(const FChar *s1, const FChar *s2);
66int CompareFileNames_ForFolderList(const FChar *s1, const FChar *s2) 67int CompareFileNames_ForFolderList(const FChar *s1, const FChar *s2)
67{ 68{
68 return CompareFileNames_ForFolderList(fs2us(s1), fs2us(s2)); 69 return CompareFileNames_ForFolderList(fs2us(s1), fs2us(s2));
@@ -119,7 +120,7 @@ HRESULT CFSFolder::Init(const FString &path /* , IFolderFolder *parentFolder */)
119 CFindFile findFile; 120 CFindFile findFile;
120 CFileInfo fi; 121 CFileInfo fi;
121 FString path2 = _path; 122 FString path2 = _path;
122 path2 += '*'; // CHAR_ANY_MASK; 123 path2.Add_Char('*'); // CHAR_ANY_MASK;
123 if (!findFile.FindFirst(path2, fi)) 124 if (!findFile.FindFirst(path2, fi))
124 return lastError; 125 return lastError;
125 } 126 }
@@ -357,7 +358,7 @@ bool CFSFolder::SaveComments()
357 attrib = fi.Attrib; 358 attrib = fi.Attrib;
358 } 359 }
359 NIO::COutFile file; 360 NIO::COutFile file;
360 if (!file.CreateAlways(path, attrib)) 361 if (!file.Create_ALWAYS_with_Attribs(path, attrib))
361 return false; 362 return false;
362 UInt32 processed; 363 UInt32 processed;
363 file.Write(utf, utf.Len(), processed); 364 file.Write(utf, utf.Len(), processed);
@@ -467,7 +468,7 @@ typedef enum
467Z7_WIN_FILE_INFORMATION_CLASS; 468Z7_WIN_FILE_INFORMATION_CLASS;
468 469
469 470
470#if (_WIN32_WINNT >= 0x0500) && !defined(_M_IA64) 471#if defined(_WIN32_WINNT) && (_WIN32_WINNT >= 0x0500) && !defined(_M_IA64)
471#define Z7_WIN_NTSTATUS NTSTATUS 472#define Z7_WIN_NTSTATUS NTSTATUS
472#define Z7_WIN_IO_STATUS_BLOCK IO_STATUS_BLOCK 473#define Z7_WIN_IO_STATUS_BLOCK IO_STATUS_BLOCK
473#else 474#else
@@ -495,6 +496,7 @@ EXTERN_C_END
495static Func_NtQueryInformationFile f_NtQueryInformationFile; 496static Func_NtQueryInformationFile f_NtQueryInformationFile;
496static bool g_NtQueryInformationFile_WasRequested = false; 497static bool g_NtQueryInformationFile_WasRequested = false;
497 498
499Z7_DIAGNOSTIC_IGNORE_CAST_FUNCTION
498 500
499void CFSFolder::ReadChangeTime(CDirItem &di) 501void CFSFolder::ReadChangeTime(CDirItem &di)
500{ 502{
@@ -907,7 +909,7 @@ Z7_COM7F_IMF(CFSFolder::BindToParentFolder(IFolderFolder **resultFolder))
907 int pos = _path.ReverseFind_PathSepar(); 909 int pos = _path.ReverseFind_PathSepar();
908 if (pos < 0 || pos != (int)_path.Len() - 1) 910 if (pos < 0 || pos != (int)_path.Len() - 1)
909 return E_FAIL; 911 return E_FAIL;
910 FString parentPath = _path.Left(pos); 912 FString parentPath = _path.Left((unsigned)pos);
911 pos = parentPath.ReverseFind_PathSepar(); 913 pos = parentPath.ReverseFind_PathSepar();
912 parentPath.DeleteFrom((unsigned)(pos + 1)); 914 parentPath.DeleteFrom((unsigned)(pos + 1));
913 915
@@ -1071,7 +1073,7 @@ Z7_COM7F_IMF(CFSFolder::CreateFile(const wchar_t *name, IProgress * /* progress
1071 FString absPath; 1073 FString absPath;
1072 GetAbsPath(name, absPath); 1074 GetAbsPath(name, absPath);
1073 NIO::COutFile outFile; 1075 NIO::COutFile outFile;
1074 if (!outFile.Create(absPath, false)) 1076 if (!outFile.Create_NEW(absPath))
1075 return GetLastError_noZero_HRESULT(); 1077 return GetLastError_noZero_HRESULT();
1076 return S_OK; 1078 return S_OK;
1077} 1079}