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

Side by Side Diff: content/common/section_util_win.cc

Issue 6677064: Remove last dependencies on chrome\common from chrome\plugin. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 9 years, 9 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
« no previous file with comments | « content/common/section_util_win.h ('k') | content/content_common.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "chrome/common/section_util_win.h" 5 #include "content/common/section_util_win.h"
6 6
7 namespace chrome { 7 namespace chrome {
8 8
9 HANDLE GetSectionFromProcess(HANDLE section, HANDLE process, bool read_only) { 9 HANDLE GetSectionFromProcess(HANDLE section, HANDLE process, bool read_only) {
10 HANDLE valid_section = NULL; 10 HANDLE valid_section = NULL;
11 DWORD access = STANDARD_RIGHTS_REQUIRED | FILE_MAP_READ; 11 DWORD access = STANDARD_RIGHTS_REQUIRED | FILE_MAP_READ;
12 if (!read_only) 12 if (!read_only)
13 access |= FILE_MAP_WRITE; 13 access |= FILE_MAP_WRITE;
14 DuplicateHandle(process, section, GetCurrentProcess(), &valid_section, access, 14 DuplicateHandle(process, section, GetCurrentProcess(), &valid_section, access,
15 FALSE, 0); 15 FALSE, 0);
16 return valid_section; 16 return valid_section;
17 } 17 }
18 18
19 HANDLE GetSectionForProcess(HANDLE section, HANDLE process, bool read_only) { 19 HANDLE GetSectionForProcess(HANDLE section, HANDLE process, bool read_only) {
20 HANDLE valid_section = NULL; 20 HANDLE valid_section = NULL;
21 DWORD access = STANDARD_RIGHTS_REQUIRED | FILE_MAP_READ; 21 DWORD access = STANDARD_RIGHTS_REQUIRED | FILE_MAP_READ;
22 if (!read_only) 22 if (!read_only)
23 access |= FILE_MAP_WRITE; 23 access |= FILE_MAP_WRITE;
24 DuplicateHandle(GetCurrentProcess(), section, process, &valid_section, access, 24 DuplicateHandle(GetCurrentProcess(), section, process, &valid_section, access,
25 FALSE, 0); 25 FALSE, 0);
26 return valid_section; 26 return valid_section;
27 } 27 }
28 28
29 } // namespace chrome 29 } // namespace chrome
OLDNEW
« no previous file with comments | « content/common/section_util_win.h ('k') | content/content_common.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698