Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(959)

Unified Diff: snapshot/win/crashpad_snapshot_test_image_reader.cc

Issue 1352323002: win: Make reading NT_IMAGE_HEADERS work cross-bitness (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@cleanup-crashpad-info
Patch Set: fixes2 Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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;
}
+
« no previous file with comments | « snapshot/win/crashpad_snapshot_test_crashing_child.cc ('k') | snapshot/win/crashpad_snapshot_test_image_reader_module.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698