1 : // Copyright 2014 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_MINIDUMP_H_
16 : #define SYZYGY_KASKO_MINIDUMP_H_
17 :
18 : #include <vector>
19 :
20 : #include "base/process/process_handle.h"
21 : #include "base/threading/platform_thread.h"
22 : #include "syzygy/kasko/minidump_request.h"
23 : #include "syzygy/kasko/api/minidump_type.h"
24 :
25 m : namespace base {
26 m : class FilePath;
27 m : } // namespace base
28 :
29 m : namespace kasko {
30 :
31 : // Returns the access required to create a minidump of this type.
32 : // @param type The type of the minidump to generate.
33 : // @returns The access flags needed for the dump type.
34 m : DWORD GetRequiredAccessForMinidumpType(MinidumpRequest::Type type);
35 m : DWORD GetRequiredAccessForMinidumpType(api::MinidumpType type);
36 :
37 : // Generates a minidump.
38 : // @param destination The path where the dump should be generated.
39 : // @param target_process The handle of the process whose dump should be
40 : // captured. Must have PROCESS_QUERY_INFORMATION and PROCESS_VM_READ access.
41 : // for full dumps, PROCESS_DUP_HANDLE is also required.
42 : // @param thread_id The thread that threw the exception. Ignored if
43 : // request.exception_pointers is null.
44 : // @param request The minidump parameters.
45 : // @returns true if the operation is successful.
46 m : bool GenerateMinidump(const base::FilePath& destination,
47 m : base::ProcessHandle target_process,
48 m : base::PlatformThreadId thread_id,
49 m : const MinidumpRequest& request);
50 :
51 m : } // namespace kasko
52 :
53 : #endif // SYZYGY_KASKO_MINIDUMP_H_
|