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

Side by Side Diff: sandbox/win/sandbox_poc/pocdll/processes_and_threads.cc

Issue 10689170: Move the Windows sandbox to sandbox/win (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase on top of tree (properly this time) Created 8 years, 5 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 (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 <windows.h> 5 #include <windows.h>
6 #include <Tlhelp32.h> 6 #include <Tlhelp32.h>
7 #include "sandbox/sandbox_poc/pocdll/exports.h" 7 #include "sandbox/win/sandbox_poc/pocdll/exports.h"
8 #include "sandbox/sandbox_poc/pocdll/utils.h" 8 #include "sandbox/win/sandbox_poc/pocdll/utils.h"
9 9
10 // This file contains the tests used to verify the security of threads and 10 // This file contains the tests used to verify the security of threads and
11 // processes. 11 // processes.
12 12
13 void POCDLL_API TestProcesses(HANDLE log) { 13 void POCDLL_API TestProcesses(HANDLE log) {
14 HandleToFile handle2file; 14 HandleToFile handle2file;
15 FILE *output = handle2file.Translate(log, "w"); 15 FILE *output = handle2file.Translate(log, "w");
16 16
17 HANDLE snapshot = ::CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, NULL); 17 HANDLE snapshot = ::CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, NULL);
18 if (INVALID_HANDLE_VALUE == snapshot) { 18 if (INVALID_HANDLE_VALUE == snapshot) {
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 if (ERROR_NO_MORE_FILES != err_code) { 93 if (ERROR_NO_MORE_FILES != err_code) {
94 fprintf(output, "[ERROR] Error %d while looking at the processes on " 94 fprintf(output, "[ERROR] Error %d while looking at the processes on "
95 "the system\r\n", err_code); 95 "the system\r\n", err_code);
96 } 96 }
97 97
98 fprintf(output, "[INFO] Found %d threads. Able to open %d of them\r\n", 98 fprintf(output, "[INFO] Found %d threads. Able to open %d of them\r\n",
99 nb_success + nb_failure, nb_success); 99 nb_success + nb_failure, nb_success);
100 100
101 ::CloseHandle(snapshot); 101 ::CloseHandle(snapshot);
102 } 102 }
OLDNEW
« no previous file with comments | « sandbox/win/sandbox_poc/pocdll/pocdll.vcproj ('k') | sandbox/win/sandbox_poc/pocdll/registry.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698