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

Unified Diff: runtime/bin/process_win.cc

Issue 23463044: Remove duplicated code on Windows (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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
« no previous file with comments | « runtime/bin/builtin_impl_sources.gypi ('k') | runtime/bin/utils_win.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/process_win.cc
diff --git a/runtime/bin/process_win.cc b/runtime/bin/process_win.cc
index d3efd4cc5f62f4526807ec52e52d9937ea8ca7dd..c83afabdb786116f2182c2faa21b749fe62a5077 100644
--- a/runtime/bin/process_win.cc
+++ b/runtime/bin/process_win.cc
@@ -13,6 +13,7 @@
#include "bin/log.h"
#include "bin/thread.h"
#include "bin/utils.h"
+#include "bin/utils_win.h"
namespace dart {
@@ -305,21 +306,7 @@ static int SetOsErrorMessage(char** os_error_message) {
int error_code = GetLastError();
static const int kMaxMessageLength = 256;
wchar_t message[kMaxMessageLength];
- DWORD message_size =
- FormatMessageW(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS,
- NULL,
- error_code,
- MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
- message,
- kMaxMessageLength,
- NULL);
- if (message_size == 0) {
- if (GetLastError() != ERROR_INSUFFICIENT_BUFFER) {
- Log::PrintErr("FormatMessage failed %d\n", GetLastError());
- }
- _snwprintf(message, kMaxMessageLength, L"OS Error %d", error_code);
- }
- message[kMaxMessageLength - 1] = '\0';
+ FormatMessageIntoBuffer(error_code, message, kMaxMessageLength);
*os_error_message = StringUtils::WideToUtf8(message);
return error_code;
}
« no previous file with comments | « runtime/bin/builtin_impl_sources.gypi ('k') | runtime/bin/utils_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698