Index: snapshot/win/crashpad_snapshot_test_image_reader.cc |
diff --git a/snapshot/win/crashpad_snapshot_test_crashing_child.cc b/snapshot/win/crashpad_snapshot_test_image_reader.cc |
similarity index 57% |
copy from snapshot/win/crashpad_snapshot_test_crashing_child.cc |
copy to snapshot/win/crashpad_snapshot_test_image_reader.cc |
index d74f6a62bddc3ac1e16aa0090a8adf4d95009fbd..0592f26438d275e057eed17d3f8831888b09a2eb 100644 |
--- a/snapshot/win/crashpad_snapshot_test_crashing_child.cc |
+++ b/snapshot/win/crashpad_snapshot_test_image_reader.cc |
@@ -12,32 +12,27 @@ |
// See the License for the specific language governing permissions and |
// limitations under the License. |
-#include <stdint.h> |
-#include <stdlib.h> |
#include <windows.h> |
#include "base/logging.h" |
-#include "client/crashpad_client.h" |
#include "util/file/file_io.h" |
-#include "util/win/address_types.h" |
+#include "util/win/scoped_handle.h" |
-__declspec(noinline) crashpad::WinVMAddress CurrentAddress() { |
- return reinterpret_cast<crashpad::WinVMAddress>(_ReturnAddress()); |
-} |
- |
-int main(int argc, char* argv[]) { |
+int wmain(int argc, wchar_t* argv[]) { |
CHECK_EQ(argc, 2); |
- crashpad::CrashpadClient client; |
- CHECK(client.SetHandler(argv[1])); |
- CHECK(client.UseHandler()); |
+ crashpad::ScopedKernelHANDLE done(CreateEvent(nullptr, true, false, argv[1])); |
+ |
+ PCHECK(LoadLibrary(L"crashpad_snapshot_test_image_reader_module.dll")) |
+ << "LoadLibrary"; |
HANDLE out = GetStdHandle(STD_OUTPUT_HANDLE); |
- CHECK_NE(out, INVALID_HANDLE_VALUE); |
- crashpad::WinVMAddress break_address = CurrentAddress(); |
- crashpad::CheckedWriteFile(out, &break_address, sizeof(break_address)); |
+ PCHECK(out != INVALID_HANDLE_VALUE) << "GetStdHandle"; |
+ char c = ' '; |
+ crashpad::CheckedWriteFile(out, &c, sizeof(c)); |
- __debugbreak(); |
+ CHECK_EQ(WAIT_OBJECT_0, WaitForSingleObject(done.get(), INFINITE)); |
return 0; |
} |
+ |