Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_util.h" | 5 #include "base/process_util.h" |
| 6 | 6 |
| 7 #include <fcntl.h> | 7 #include <fcntl.h> |
| 8 #include <io.h> | 8 #include <io.h> |
| 9 #include <windows.h> | 9 #include <windows.h> |
| 10 #include <userenv.h> | 10 #include <userenv.h> |
| (...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 239 HANDLE process_with_query_rights; | 239 HANDLE process_with_query_rights; |
| 240 if (DuplicateHandle(current_process, process, current_process, | 240 if (DuplicateHandle(current_process, process, current_process, |
| 241 &process_with_query_rights, PROCESS_QUERY_INFORMATION, | 241 &process_with_query_rights, PROCESS_QUERY_INFORMATION, |
| 242 false, 0)) { | 242 false, 0)) { |
| 243 DWORD id = GetProcessId(process_with_query_rights); | 243 DWORD id = GetProcessId(process_with_query_rights); |
| 244 CloseHandle(process_with_query_rights); | 244 CloseHandle(process_with_query_rights); |
| 245 return id; | 245 return id; |
| 246 } | 246 } |
| 247 | 247 |
| 248 // We're screwed. | 248 // We're screwed. |
| 249 NOTREACHED(); | 249 //NOTREACHED(); |
|
MAD
2013/01/31 20:14:53
Really?
robertshield
2013/01/31 20:24:28
Heh, oops, local patch until Brett reads https://c
| |
| 250 return 0; | 250 return 0; |
| 251 } | 251 } |
| 252 | 252 |
| 253 bool GetProcessIntegrityLevel(ProcessHandle process, IntegrityLevel *level) { | 253 bool GetProcessIntegrityLevel(ProcessHandle process, IntegrityLevel *level) { |
| 254 if (!level) | 254 if (!level) |
| 255 return false; | 255 return false; |
| 256 | 256 |
| 257 if (win::GetVersion() < base::win::VERSION_VISTA) | 257 if (win::GetVersion() < base::win::VERSION_VISTA) |
| 258 return false; | 258 return false; |
| 259 | 259 |
| (...skipping 746 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1006 | 1006 |
| 1007 PERFORMANCE_INFORMATION info; | 1007 PERFORMANCE_INFORMATION info; |
| 1008 if (!InternalGetPerformanceInfo(&info, sizeof(info))) { | 1008 if (!InternalGetPerformanceInfo(&info, sizeof(info))) { |
| 1009 DLOG(ERROR) << "Failed to fetch internal performance info."; | 1009 DLOG(ERROR) << "Failed to fetch internal performance info."; |
| 1010 return 0; | 1010 return 0; |
| 1011 } | 1011 } |
| 1012 return (info.CommitTotal * system_info.dwPageSize) / 1024; | 1012 return (info.CommitTotal * system_info.dwPageSize) / 1024; |
| 1013 } | 1013 } |
| 1014 | 1014 |
| 1015 } // namespace base | 1015 } // namespace base |
| OLD | NEW |