1 : // Copyright 2015 Google Inc. All Rights Reserved.
2 : //
3 : // Licensed under the Apache License, Version 2.0 (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
6 : //
7 : // http://www.apache.org/licenses/LICENSE-2.0
8 : //
9 : // Unless required by applicable law or agreed to in writing, software
10 : // distributed under the License is distributed on an "AS IS" BASIS,
11 : // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 : // See the License for the specific language governing permissions and
13 : // limitations under the License.
14 :
15 : #ifndef SYZYGY_KASKO_API_INTERNAL_CRASH_KEY_REGISTRATION_H_
16 : #define SYZYGY_KASKO_API_INTERNAL_CRASH_KEY_REGISTRATION_H_
17 :
18 : #include <windows.h>
19 :
20 : #include <vector>
21 :
22 m : namespace kasko {
23 m : namespace api {
24 :
25 m : struct CrashKey;
26 :
27 m : namespace internal {
28 :
29 : // Registers the address of an array of crash keys for the current process. The
30 : // registered crash key values may later be retrieved using
31 : // ReadCrashKeysFromProcess. This method must only be called once per process.
32 : // @param crash_keys An array of crash keys.
33 : // @param crash_key_count The number of entries in crash_keys.
34 m : void RegisterCrashKeys(const CrashKey* crash_keys, size_t count);
35 :
36 : // Reads the registered crash keys (if any) from a process. This method may
37 : // return keys with empty keys and/or values.
38 : // @param process The process from which to read the crash keys. Must have
39 : // PROCESS_QUERY_INFORMATION and PROCESS_VM_READ access.
40 : // @param crash_keys Receives the crash keys that are read.
41 : // @return true if successful.
42 m : bool ReadCrashKeysFromProcess(HANDLE process,
43 m : std::vector<CrashKey>* crash_keys);
44 :
45 m : } // namespace internal
46 m : } // namespace api
47 m : } // namespace kasko
48 :
49 : #endif // SYZYGY_KASKO_API_INTERNAL_CRASH_KEY_REGISTRATION_H_
|