From 43cf325be09379594dd96e0b35146585cdfd6a34 Mon Sep 17 00:00:00 2001 From: "phajdan.jr@chromium.org" Date: Wed, 1 Apr 2009 09:19:37 +0000 Subject: Use portable typedef for PIDs (process IDs). This is a preparation to land http://codereview.chromium.org/54003, which replaces chrome_process_filter with more portable chrome_process_util. Review URL: http://codereview.chromium.org/57062 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@12948 0039d316-1c4b-4281-b951-d872f2087c98 --- base/process_util_win.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'base/process_util_win.cc') diff --git a/base/process_util_win.cc b/base/process_util_win.cc index beb4ea3..df3d7f20 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); -- cgit v1.1