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
3 // found in the LICENSE file.
5 #include "content/common/section_util_win.h"
9 HANDLE
GetSectionFromProcess(HANDLE section
, HANDLE process
, bool read_only
) {
10 HANDLE valid_section
= NULL
;
11 DWORD access
= STANDARD_RIGHTS_REQUIRED
| FILE_MAP_READ
;
13 access
|= FILE_MAP_WRITE
;
14 DuplicateHandle(process
, section
, GetCurrentProcess(), &valid_section
, access
,
19 HANDLE
GetSectionForProcess(HANDLE section
, HANDLE process
, bool read_only
) {
20 HANDLE valid_section
= NULL
;
21 DWORD access
= STANDARD_RIGHTS_REQUIRED
| FILE_MAP_READ
;
23 access
|= FILE_MAP_WRITE
;
24 DuplicateHandle(GetCurrentProcess(), section
, process
, &valid_section
, access
,