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

Unified Diff: chrome/common/section_util_win.cc

Issue 6386009: Remove app/win/win_util.h,cc etc. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Code cleanup Created 9 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: chrome/common/section_util_win.cc
diff --git a/chrome/common/section_util_win.cc b/chrome/common/section_util_win.cc
new file mode 100755
index 0000000000000000000000000000000000000000..449151cfd17fe9d8dd1b547858f966e5858924f5
--- /dev/null
+++ b/chrome/common/section_util_win.cc
@@ -0,0 +1,29 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/common/section_util_win.h"
+
+namespace chrome {
+
+HANDLE GetSectionFromProcess(HANDLE section, HANDLE process, bool read_only) {
+ HANDLE valid_section = NULL;
+ DWORD access = STANDARD_RIGHTS_REQUIRED | FILE_MAP_READ;
+ if (!read_only)
+ access |= FILE_MAP_WRITE;
+ DuplicateHandle(process, section, GetCurrentProcess(), &valid_section, access,
+ FALSE, 0);
+ return valid_section;
+}
+
+HANDLE GetSectionForProcess(HANDLE section, HANDLE process, bool read_only) {
+ HANDLE valid_section = NULL;
+ DWORD access = STANDARD_RIGHTS_REQUIRED | FILE_MAP_READ;
+ if (!read_only)
+ access |= FILE_MAP_WRITE;
+ DuplicateHandle(GetCurrentProcess(), section, process, &valid_section, access,
+ FALSE, 0);
+ return valid_section;
+}
+
+} // namespace chrome

Powered by Google App Engine
This is Rietveld 408576698