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

Side by Side Diff: util/win/nt_internals.cc

Issue 1400413002: win: Add Handles() to ProcessInfo (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: rebase Created 5 years, 2 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
« no previous file with comments | « util/win/nt_internals.h ('k') | util/win/process_info.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Crashpad Authors. All rights reserved. 1 // Copyright 2015 The Crashpad Authors. All rights reserved.
2 // 2 //
3 // Licensed under the Apache License, Version 2.0 (the "License"); 3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License. 4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at 5 // You may obtain a copy of the License at
6 // 6 //
7 // http://www.apache.org/licenses/LICENSE-2.0 7 // http://www.apache.org/licenses/LICENSE-2.0
8 // 8 //
9 // Unless required by applicable law or agreed to in writing, software 9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS, 10 // distributed under the License is distributed on an "AS IS" BASIS,
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 static NtOpenThreadFunction nt_open_thread = 65 static NtOpenThreadFunction nt_open_thread =
66 reinterpret_cast<NtOpenThreadFunction>( 66 reinterpret_cast<NtOpenThreadFunction>(
67 GetProcAddress(LoadLibrary(L"ntdll.dll"), "NtOpenThread")); 67 GetProcAddress(LoadLibrary(L"ntdll.dll"), "NtOpenThread"));
68 DCHECK(nt_open_thread); 68 DCHECK(nt_open_thread);
69 return nt_open_thread(thread_handle, 69 return nt_open_thread(thread_handle,
70 desired_access, 70 desired_access,
71 object_attributes, 71 object_attributes,
72 static_cast<const void*>(client_id)); 72 static_cast<const void*>(client_id));
73 } 73 }
74 74
75 NTSTATUS NtQueryObject(HANDLE handle,
76 OBJECT_INFORMATION_CLASS object_information_class,
77 void* object_information,
78 ULONG object_information_length,
79 ULONG* return_length) {
80 static decltype(::NtQueryObject)* nt_query_object =
81 reinterpret_cast<decltype(::NtQueryObject)*>(
82 GetProcAddress(LoadLibrary(L"ntdll.dll"), "NtQueryObject"));
83 DCHECK(nt_query_object);
84 return nt_query_object(handle,
85 object_information_class,
86 object_information,
87 object_information_length,
88 return_length);
89 }
90
75 // Explicit instantiations with the only 2 valid template arguments to avoid 91 // Explicit instantiations with the only 2 valid template arguments to avoid
76 // putting the body of the function in the header. 92 // putting the body of the function in the header.
77 template NTSTATUS NtOpenThread<process_types::internal::Traits32>( 93 template NTSTATUS NtOpenThread<process_types::internal::Traits32>(
78 PHANDLE thread_handle, 94 PHANDLE thread_handle,
79 ACCESS_MASK desired_access, 95 ACCESS_MASK desired_access,
80 POBJECT_ATTRIBUTES object_attributes, 96 POBJECT_ATTRIBUTES object_attributes,
81 const process_types::CLIENT_ID<process_types::internal::Traits32>* 97 const process_types::CLIENT_ID<process_types::internal::Traits32>*
82 client_id); 98 client_id);
83 99
84 template NTSTATUS NtOpenThread<process_types::internal::Traits64>( 100 template NTSTATUS NtOpenThread<process_types::internal::Traits64>(
85 PHANDLE thread_handle, 101 PHANDLE thread_handle,
86 ACCESS_MASK desired_access, 102 ACCESS_MASK desired_access,
87 POBJECT_ATTRIBUTES object_attributes, 103 POBJECT_ATTRIBUTES object_attributes,
88 const process_types::CLIENT_ID<process_types::internal::Traits64>* 104 const process_types::CLIENT_ID<process_types::internal::Traits64>*
89 client_id); 105 client_id);
90 106
91 } // namespace crashpad 107 } // namespace crashpad
OLDNEW
« no previous file with comments | « util/win/nt_internals.h ('k') | util/win/process_info.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698