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

Unified Diff: base/process_util_win.cc

Issue 57062: Use portable typedef for PIDs (process IDs). (Closed)
Patch Set: speculative fix for win Created 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/process_util_posix.cc ('k') | base/process_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/process_util_win.cc
diff --git a/base/process_util_win.cc b/base/process_util_win.cc
index beb4ea34509cb9a47afa1401a91735d0c80b5555..df3d7f209e78b4da49ed079c770145711c55e613 100644
--- a/base/process_util_win.cc
+++ b/base/process_util_win.cc
@@ -25,7 +25,7 @@ typedef BOOL (WINAPI* HeapSetFn)(HANDLE, HEAP_INFORMATION_CLASS, PVOID, SIZE_T);
namespace base {
-int GetCurrentProcId() {
+ProcessId GetCurrentProcId() {
return ::GetCurrentProcessId();
}
@@ -33,7 +33,7 @@ ProcessHandle GetCurrentProcessHandle() {
return ::GetCurrentProcess();
}
-ProcessHandle OpenProcessHandle(int pid) {
+ProcessHandle OpenProcessHandle(ProcessId pid) {
return OpenProcess(PROCESS_DUP_HANDLE | PROCESS_TERMINATE, FALSE, pid);
}
@@ -100,7 +100,7 @@ bool GetProcIdViaNtQueryInformationProcess(ProcessHandle process, DWORD* id) {
return true;
}
-int GetProcId(ProcessHandle process) {
+ProcessId GetProcId(ProcessHandle process) {
// Get a handle to |process| that has PROCESS_QUERY_INFORMATION rights.
HANDLE current_process = GetCurrentProcess();
HANDLE process_with_query_rights;
@@ -160,7 +160,7 @@ bool LaunchApp(const CommandLine& cl,
// Attempts to kill the process identified by the given process
// entry structure, giving it the specified exit code.
// Returns true if this is successful, false otherwise.
-bool KillProcessById(DWORD process_id, int exit_code, bool wait) {
+bool KillProcessById(ProcessId process_id, int exit_code, bool wait) {
HANDLE process = OpenProcess(PROCESS_TERMINATE | SYNCHRONIZE,
FALSE, // Don't inherit handle
process_id);
« no previous file with comments | « base/process_util_posix.cc ('k') | base/process_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698