OLD | NEW |
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, |
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
12 // See the License for the specific language governing permissions and | 12 // See the License for the specific language governing permissions and |
13 // limitations under the License. | 13 // limitations under the License. |
14 | 14 |
15 #include <windows.h> | 15 #include <windows.h> |
16 #include <winternl.h> | 16 #include <winternl.h> |
17 | 17 |
18 #include "util/win/process_structs.h" | 18 #include "util/win/process_structs.h" |
19 | 19 |
20 namespace crashpad { | 20 namespace crashpad { |
21 | 21 |
22 // Copied from ntstatus.h because um/winnt.h conflicts with general inclusion of | 22 // Copied from ntstatus.h because um/winnt.h conflicts with general inclusion of |
23 // ntstatus.h. | 23 // ntstatus.h. |
24 #define STATUS_BUFFER_TOO_SMALL ((NTSTATUS)0xC0000023L) | 24 #define STATUS_BUFFER_TOO_SMALL ((NTSTATUS)0xC0000023L) |
25 #define STATUS_INFO_LENGTH_MISMATCH ((NTSTATUS)0xC0000004L) | 25 #define STATUS_INFO_LENGTH_MISMATCH ((NTSTATUS)0xC0000004L) |
26 | 26 |
27 // winternal.h defines THREADINFOCLASS, but not all members. | 27 // winternal.h defines THREADINFOCLASS, but not all members. |
28 enum { ThreadBasicInformation = 0 }; | 28 enum { ThreadBasicInformation = 0 }; |
29 | 29 |
| 30 // winternal.h defines SYSTEM_INFORMATION_CLASS, but not all members. |
| 31 enum { SystemExtendedHandleInformation = 64 }; |
| 32 |
30 NTSTATUS NtQuerySystemInformation( | 33 NTSTATUS NtQuerySystemInformation( |
31 SYSTEM_INFORMATION_CLASS system_information_class, | 34 SYSTEM_INFORMATION_CLASS system_information_class, |
32 PVOID system_information, | 35 PVOID system_information, |
33 ULONG system_information_length, | 36 ULONG system_information_length, |
34 PULONG return_length); | 37 PULONG return_length); |
35 | 38 |
36 NTSTATUS NtQueryInformationThread(HANDLE thread_handle, | 39 NTSTATUS NtQueryInformationThread(HANDLE thread_handle, |
37 THREADINFOCLASS thread_information_class, | 40 THREADINFOCLASS thread_information_class, |
38 PVOID thread_information, | 41 PVOID thread_information, |
39 ULONG thread_information_length, | 42 ULONG thread_information_length, |
40 PULONG return_length); | 43 PULONG return_length); |
41 | 44 |
42 template <class Traits> | 45 template <class Traits> |
43 NTSTATUS NtOpenThread(PHANDLE thread_handle, | 46 NTSTATUS NtOpenThread(PHANDLE thread_handle, |
44 ACCESS_MASK desired_access, | 47 ACCESS_MASK desired_access, |
45 POBJECT_ATTRIBUTES object_attributes, | 48 POBJECT_ATTRIBUTES object_attributes, |
46 const process_types::CLIENT_ID<Traits>* client_id); | 49 const process_types::CLIENT_ID<Traits>* client_id); |
47 | 50 |
| 51 NTSTATUS NtQueryObject(HANDLE handle, |
| 52 OBJECT_INFORMATION_CLASS object_information_class, |
| 53 void* object_information, |
| 54 ULONG object_information_length, |
| 55 ULONG* return_length); |
| 56 |
48 } // namespace crashpad | 57 } // namespace crashpad |
OLD | NEW |