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_TESTING_MINIDUMP_UNITTEST_HELPERS_H_
16 : #define SYZYGY_KASKO_TESTING_MINIDUMP_UNITTEST_HELPERS_H_
17 :
18 : #include <Windows.h> // NOLINT
19 : #include <Dbgeng.h>
20 :
21 : #include "base/callback_forward.h"
22 :
23 m : namespace base {
24 m : class FilePath;
25 m : } // namespace base
26 :
27 m : namespace kasko {
28 m : namespace testing {
29 :
30 : // Receives COM interfaces that may be used to query a minidump file.
31 m : typedef base::Callback<void(IDebugClient4*, IDebugControl*, IDebugSymbols*)>
32 m : MinidumpVisitor;
33 :
34 : // Loads a minidump file and provides access via a callback.
35 : // @param file_path The path to a minidump file.
36 : // @param visitor A callback that will be invoked to query the loaded minidump
37 : // file.
38 : // @returns S_OK if successful. Otherwise, an error code encountered during the
39 : // operation.
40 m : HRESULT VisitMinidump(const base::FilePath& file_path,
41 m : const MinidumpVisitor& visitor);
42 :
43 m : } // namespace testing
44 m : } // namespace kasko
45 :
46 : #endif // SYZYGY_KASKO_TESTING_MINIDUMP_UNITTEST_HELPERS_H_
|