OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 "base/process/process_handle.h" | 5 #include "base/process/process_handle.h" |
6 | 6 |
7 #include <windows.h> | 7 #include <windows.h> |
8 #include <tlhelp32.h> | 8 #include <tlhelp32.h> |
9 | 9 |
10 #include "base/memory/scoped_ptr.h" | |
11 #include "base/win/scoped_handle.h" | 10 #include "base/win/scoped_handle.h" |
12 #include "base/win/windows_version.h" | 11 #include "base/win/windows_version.h" |
13 | 12 |
14 namespace base { | 13 namespace base { |
15 | 14 |
16 ProcessId GetCurrentProcId() { | 15 ProcessId GetCurrentProcId() { |
17 return ::GetCurrentProcessId(); | 16 return ::GetCurrentProcessId(); |
18 } | 17 } |
19 | 18 |
20 ProcessHandle GetCurrentProcessHandle() { | 19 ProcessHandle GetCurrentProcessHandle() { |
(...skipping 15 matching lines...) Expand all Loading... |
36 do { | 35 do { |
37 if (process_entry.th32ProcessID == child_pid) | 36 if (process_entry.th32ProcessID == child_pid) |
38 return process_entry.th32ParentProcessID; | 37 return process_entry.th32ParentProcessID; |
39 } while (Process32Next(snapshot.Get(), &process_entry)); | 38 } while (Process32Next(snapshot.Get(), &process_entry)); |
40 } | 39 } |
41 | 40 |
42 return 0u; | 41 return 0u; |
43 } | 42 } |
44 | 43 |
45 } // namespace base | 44 } // namespace base |
OLD | NEW |