OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
11 #include "webrtc/base/win32filesystem.h" | 11 #include "webrtc/rtc_base/win32filesystem.h" |
12 | 12 |
13 #include "webrtc/base/win32.h" | |
14 #include <shellapi.h> | 13 #include <shellapi.h> |
15 #include <shlobj.h> | 14 #include <shlobj.h> |
16 #include <tchar.h> | 15 #include <tchar.h> |
| 16 #include "webrtc/rtc_base/win32.h" |
17 | 17 |
18 #include <memory> | 18 #include <memory> |
19 | 19 |
20 #include "webrtc/base/arraysize.h" | 20 #include "webrtc/rtc_base/arraysize.h" |
21 #include "webrtc/base/checks.h" | 21 #include "webrtc/rtc_base/checks.h" |
22 #include "webrtc/base/fileutils.h" | 22 #include "webrtc/rtc_base/fileutils.h" |
23 #include "webrtc/base/pathutils.h" | 23 #include "webrtc/rtc_base/pathutils.h" |
24 #include "webrtc/base/stream.h" | 24 #include "webrtc/rtc_base/stream.h" |
25 #include "webrtc/base/stringutils.h" | 25 #include "webrtc/rtc_base/stringutils.h" |
26 | 26 |
27 // In several places in this file, we test the integrity level of the process | 27 // In several places in this file, we test the integrity level of the process |
28 // before calling GetLongPathName. We do this because calling GetLongPathName | 28 // before calling GetLongPathName. We do this because calling GetLongPathName |
29 // when running under protected mode IE (a low integrity process) can result in | 29 // when running under protected mode IE (a low integrity process) can result in |
30 // a virtualized path being returned, which is wrong if you only plan to read. | 30 // a virtualized path being returned, which is wrong if you only plan to read. |
31 // TODO: Waiting to hear back from IE team on whether this is the | 31 // TODO: Waiting to hear back from IE team on whether this is the |
32 // best approach; IEIsProtectedModeProcess is another possible solution. | 32 // best approach; IEIsProtectedModeProcess is another possible solution. |
33 | 33 |
34 namespace rtc { | 34 namespace rtc { |
35 | 35 |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 bool Win32Filesystem::GetFileSize(const Pathname &pathname, size_t *size) { | 146 bool Win32Filesystem::GetFileSize(const Pathname &pathname, size_t *size) { |
147 WIN32_FILE_ATTRIBUTE_DATA data = {0}; | 147 WIN32_FILE_ATTRIBUTE_DATA data = {0}; |
148 if (::GetFileAttributesEx(ToUtf16(pathname.pathname()).c_str(), | 148 if (::GetFileAttributesEx(ToUtf16(pathname.pathname()).c_str(), |
149 GetFileExInfoStandard, &data) == 0) | 149 GetFileExInfoStandard, &data) == 0) |
150 return false; | 150 return false; |
151 *size = data.nFileSizeLow; | 151 *size = data.nFileSizeLow; |
152 return true; | 152 return true; |
153 } | 153 } |
154 | 154 |
155 } // namespace rtc | 155 } // namespace rtc |
OLD | NEW |