OLD | NEW |
1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium 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 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
6 | 6 |
7 #include "core/fxcrt/fxcrt_windows.h" | 7 #include "core/fxcrt/fxcrt_windows.h" |
8 | 8 |
9 #include "core/include/fxcrt/fx_string.h" | 9 #include "core/fxcrt/include/fx_string.h" |
10 | 10 |
11 #if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ | 11 #if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ |
12 IFXCRT_FileAccess* FXCRT_FileAccess_Create() { | 12 IFXCRT_FileAccess* FXCRT_FileAccess_Create() { |
13 return new CFXCRT_FileAccess_Win64; | 13 return new CFXCRT_FileAccess_Win64; |
14 } | 14 } |
15 void FXCRT_Windows_GetFileMode(FX_DWORD dwMode, | 15 void FXCRT_Windows_GetFileMode(FX_DWORD dwMode, |
16 FX_DWORD& dwAccess, | 16 FX_DWORD& dwAccess, |
17 FX_DWORD& dwShare, | 17 FX_DWORD& dwShare, |
18 FX_DWORD& dwCreation) { | 18 FX_DWORD& dwCreation) { |
19 dwAccess = GENERIC_READ; | 19 dwAccess = GENERIC_READ; |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 } | 163 } |
164 return ::FlushFileBuffers(m_hFile); | 164 return ::FlushFileBuffers(m_hFile); |
165 } | 165 } |
166 FX_BOOL CFXCRT_FileAccess_Win64::Truncate(FX_FILESIZE szFile) { | 166 FX_BOOL CFXCRT_FileAccess_Win64::Truncate(FX_FILESIZE szFile) { |
167 if (SetPosition(szFile) == (FX_FILESIZE)-1) { | 167 if (SetPosition(szFile) == (FX_FILESIZE)-1) { |
168 return FALSE; | 168 return FALSE; |
169 } | 169 } |
170 return ::SetEndOfFile(m_hFile); | 170 return ::SetEndOfFile(m_hFile); |
171 } | 171 } |
172 #endif | 172 #endif |
OLD | NEW |