| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "base/file_util.h" | 5 #include "base/file_util.h" |
| 6 | 6 |
| 7 #include <windows.h> | 7 #include <windows.h> |
| 8 #include <propvarutil.h> | 8 #include <propvarutil.h> |
| 9 #include <psapi.h> | 9 #include <psapi.h> |
| 10 #include <shellapi.h> | 10 #include <shellapi.h> |
| (...skipping 809 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 820 | 820 |
| 821 void FileEnumerator::GetFindInfo(FindInfo* info) { | 821 void FileEnumerator::GetFindInfo(FindInfo* info) { |
| 822 DCHECK(info); | 822 DCHECK(info); |
| 823 | 823 |
| 824 if (!has_find_data_) | 824 if (!has_find_data_) |
| 825 return; | 825 return; |
| 826 | 826 |
| 827 memcpy(info, &find_data_, sizeof(*info)); | 827 memcpy(info, &find_data_, sizeof(*info)); |
| 828 } | 828 } |
| 829 | 829 |
| 830 // static |
| 830 bool FileEnumerator::IsDirectory(const FindInfo& info) { | 831 bool FileEnumerator::IsDirectory(const FindInfo& info) { |
| 831 return (info.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) != 0; | 832 return (info.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) != 0; |
| 832 } | 833 } |
| 833 | 834 |
| 834 // static | 835 // static |
| 836 bool FileEnumerator::IsLink(const FindInfo& info) { |
| 837 return false; |
| 838 } |
| 839 |
| 840 // static |
| 835 FilePath FileEnumerator::GetFilename(const FindInfo& find_info) { | 841 FilePath FileEnumerator::GetFilename(const FindInfo& find_info) { |
| 836 return FilePath(find_info.cFileName); | 842 return FilePath(find_info.cFileName); |
| 837 } | 843 } |
| 838 | 844 |
| 839 // static | 845 // static |
| 840 int64 FileEnumerator::GetFilesize(const FindInfo& find_info) { | 846 int64 FileEnumerator::GetFilesize(const FindInfo& find_info) { |
| 841 ULARGE_INTEGER size; | 847 ULARGE_INTEGER size; |
| 842 size.HighPart = find_info.nFileSizeHigh; | 848 size.HighPart = find_info.nFileSizeHigh; |
| 843 size.LowPart = find_info.nFileSizeLow; | 849 size.LowPart = find_info.nFileSizeLow; |
| 844 DCHECK_LE(size.QuadPart, std::numeric_limits<int64>::max()); | 850 DCHECK_LE(size.QuadPart, std::numeric_limits<int64>::max()); |
| (...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1104 HANDLE cp = GetCurrentProcess(); | 1110 HANDLE cp = GetCurrentProcess(); |
| 1105 if (::GetMappedFileNameW(cp, file_view, mapped_file_path, kMaxPathLength)) { | 1111 if (::GetMappedFileNameW(cp, file_view, mapped_file_path, kMaxPathLength)) { |
| 1106 *nt_path = FilePath(mapped_file_path); | 1112 *nt_path = FilePath(mapped_file_path); |
| 1107 success = true; | 1113 success = true; |
| 1108 } | 1114 } |
| 1109 ::UnmapViewOfFile(file_view); | 1115 ::UnmapViewOfFile(file_view); |
| 1110 return success; | 1116 return success; |
| 1111 } | 1117 } |
| 1112 | 1118 |
| 1113 } // namespace file_util | 1119 } // namespace file_util |
| OLD | NEW |