Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(404)

Side by Side Diff: sandbox/win/src/process_mitigations_win32k_interception.cc

Issue 333773005: Intercept the user32!SystemParametersInfoW API in the win32k user gdi lockdown mode (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "sandbox/win/src/process_mitigations_win32k_interception.h" 5 #include "sandbox/win/src/process_mitigations_win32k_interception.h"
6 6
7 namespace sandbox { 7 namespace sandbox {
8 8
9 BOOL WINAPI TargetGdiDllInitialize( 9 BOOL WINAPI TargetGdiDllInitialize(
10 GdiDllInitializeFunction orig_gdi_dll_initialize, 10 GdiDllInitializeFunction orig_gdi_dll_initialize,
11 HANDLE dll, 11 HANDLE dll,
12 DWORD reason) { 12 DWORD reason) {
13 return TRUE; 13 return TRUE;
14 } 14 }
15 15
16 HGDIOBJ WINAPI TargetGetStockObject( 16 HGDIOBJ WINAPI TargetGetStockObject(
17 GetStockObjectFunction orig_get_stock_object, 17 GetStockObjectFunction orig_get_stock_object,
18 int object) { 18 int object) {
19 return reinterpret_cast<HGDIOBJ>(NULL); 19 return reinterpret_cast<HGDIOBJ>(NULL);
20 } 20 }
21 21
22 ATOM WINAPI TargetRegisterClassW( 22 ATOM WINAPI TargetRegisterClassW(
23 RegisterClassWFunction orig_register_class_function, 23 RegisterClassWFunction orig_register_class_function,
24 const WNDCLASS* wnd_class) { 24 const WNDCLASS* wnd_class) {
25 return TRUE; 25 return TRUE;
26 } 26 }
27 27
28 BOOL WINAPI TargetSystemParametersInfoW(
29 SystemParametersInfoWFunction orig_system_parameters_info,
30 UINT action,
31 UINT ui_param,
32 PVOID value,
33 UINT win_ini) {
34 // The SystemParametersInfo API fails for the following font related
35 // parameters in the win32k lockdown mode. We fake the values for
36 // SPI_GETFONTSMOOTHING and SPI_GETFONTSMOOTHINGTYPE for now and default to
37 // smooth and FE_FONTSMOOTHINGCLEARTYPE for now. This should be ok given that
38 // this code only runs on Windows 8 and above.
39 // TODO(ananta)
40 // Revisit and handle this via browser side IPCs if needed.
41 if (action == SPI_GETFONTSMOOTHING) {
42 BOOL* smoothing = reinterpret_cast<BOOL*>(value);
43 if (smoothing) {
44 *smoothing = TRUE;
45 return TRUE;
46 }
47 } else if (action == SPI_GETFONTSMOOTHINGTYPE) {
48 UINT* smooth_type = reinterpret_cast<UINT*>(value);
49 if (smooth_type) {
50 *smooth_type = FE_FONTSMOOTHINGCLEARTYPE;
51 return TRUE;
52 }
53 }
54 return orig_system_parameters_info(action, ui_param, value, win_ini);
55 }
56
28 } // namespace sandbox 57 } // namespace sandbox
29 58
OLDNEW
« no previous file with comments | « sandbox/win/src/process_mitigations_win32k_interception.h ('k') | sandbox/win/src/process_mitigations_win32k_policy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698