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/include/fpdfapi/fpdf_module.h" | 7 #include "../../core/include/fpdfapi/fpdf_module.h" |
8 #include "../../core/include/fxcodec/fx_codec.h" | 8 #include "../../core/include/fxcodec/fx_codec.h" |
9 #include "../../core/include/fxcrt/fx_safe_types.h" | 9 #include "../../core/include/fxcrt/fx_safe_types.h" |
10 #include "../../public/fpdf_ext.h" | 10 #include "../../public/fpdf_ext.h" |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 else | 159 else |
160 foxit_sandbox_policy &= 0xFFFFFFFE; | 160 foxit_sandbox_policy &= 0xFFFFFFFE; |
161 } break; | 161 } break; |
162 default: | 162 default: |
163 break; | 163 break; |
164 } | 164 } |
165 } | 165 } |
166 | 166 |
167 FPDF_BOOL FSDK_IsSandBoxPolicyEnabled(FPDF_DWORD policy) { | 167 FPDF_BOOL FSDK_IsSandBoxPolicyEnabled(FPDF_DWORD policy) { |
168 switch (policy) { | 168 switch (policy) { |
169 case FPDF_POLICY_MACHINETIME_ACCESS: { | 169 case FPDF_POLICY_MACHINETIME_ACCESS: |
170 if (foxit_sandbox_policy & 0x01) | 170 return (foxit_sandbox_policy & 0x01) ? TRUE : FALSE; |
171 return TRUE; | |
172 else | |
173 return FALSE; | |
174 } break; | |
175 default: | 171 default: |
176 break; | 172 return FALSE; |
177 } | 173 } |
178 return FALSE; | |
179 } | 174 } |
180 | 175 |
181 CCodec_ModuleMgr* g_pCodecModule = nullptr; | 176 CCodec_ModuleMgr* g_pCodecModule = nullptr; |
182 | 177 |
183 DLLEXPORT void STDCALL FPDF_InitLibrary() { | 178 DLLEXPORT void STDCALL FPDF_InitLibrary() { |
184 FPDF_InitLibraryWithConfig(nullptr); | 179 FPDF_InitLibraryWithConfig(nullptr); |
185 } | 180 } |
186 | 181 |
187 DLLEXPORT void STDCALL | 182 DLLEXPORT void STDCALL |
188 FPDF_InitLibraryWithConfig(const FPDF_LIBRARY_CONFIG* cfg) { | 183 FPDF_InitLibraryWithConfig(const FPDF_LIBRARY_CONFIG* cfg) { |
(...skipping 895 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1084 if (!buffer) { | 1079 if (!buffer) { |
1085 *buflen = len; | 1080 *buflen = len; |
1086 } else if (*buflen >= len) { | 1081 } else if (*buflen >= len) { |
1087 memcpy(buffer, utf16Name.c_str(), len); | 1082 memcpy(buffer, utf16Name.c_str(), len); |
1088 *buflen = len; | 1083 *buflen = len; |
1089 } else { | 1084 } else { |
1090 *buflen = -1; | 1085 *buflen = -1; |
1091 } | 1086 } |
1092 return (FPDF_DEST)pDestObj; | 1087 return (FPDF_DEST)pDestObj; |
1093 } | 1088 } |
OLD | NEW |