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

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

Issue 1328703003: Correct PROCESS_BASIC_INFORMATION for 64 bit Windows. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 3 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
OLDNEW
(Empty)
1 // Copyright 2015 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.
4
5 #include <windows.h>
6
7 #include "base/win/scoped_handle.h"
8 #include "base/win/scoped_process_information.h"
9 #include "sandbox/win/src/policy_broker.h"
10 #include "sandbox/win/src/sandbox_nt_util.h"
11 #include "testing/gtest/include/gtest/gtest.h"
12
13 namespace sandbox {
14 namespace {
15
16 TEST(SandboxNtUtil, IsSameProcess) {
17 InitGlobalNt();
18
19 HANDLE current_process_pseudo = GetCurrentProcess();
20 base::win::ScopedHandle current_process(
21 OpenProcess(PROCESS_ALL_ACCESS, FALSE, GetCurrentProcessId()));
22
23 EXPECT_TRUE(IsSameProcess(current_process_pseudo));
24 EXPECT_TRUE(IsSameProcess(current_process.Get()));
25
26 STARTUPINFO si = {sizeof(si)};
27 PROCESS_INFORMATION pi = {};
28 wchar_t notepad[] = L"notepad";
29 ASSERT_TRUE(CreateProcessW(nullptr, notepad, nullptr, nullptr, FALSE, 0,
30 nullptr, nullptr, &si, &pi));
31 base::win::ScopedProcessInformation process_info(pi);
32
33 EXPECT_FALSE(IsSameProcess(process_info.process_handle()));
34
35 EXPECT_TRUE(TerminateProcess(process_info.process_handle(), 0));
36 }
37
38 } // namespace
39 } // namespace sandbox
OLDNEW
« sandbox/win/src/nt_internals.h ('K') | « sandbox/win/src/sandbox_nt_util.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698