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

Unified Diff: runtime/bin/process.cc

Issue 11558012: Use FormatMessageW for Windows error messages to handle internationalized messages correctly. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments. Created 8 years 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/process.h ('k') | runtime/bin/process_android.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/process.cc
diff --git a/runtime/bin/process.cc b/runtime/bin/process.cc
index e513939d4405a27075ee57726748793e28d78782..740e4a4e5011a6ba8b7582083e18e88cae38b5d3 100644
--- a/runtime/bin/process.cc
+++ b/runtime/bin/process.cc
@@ -122,8 +122,7 @@ void FUNCTION_NAME(Process_Start)(Dart_NativeArguments args) {
Dart_Handle err_handle = Dart_GetNativeArgument(args, 7);
Dart_Handle exit_handle = Dart_GetNativeArgument(args, 8);
intptr_t pid = -1;
- static const int kMaxChildOsErrorMessageLength = 256;
- char os_error_message[kMaxChildOsErrorMessageLength];
+ char* os_error_message = NULL;
int error_code = Process::Start(path,
string_args,
@@ -136,7 +135,7 @@ void FUNCTION_NAME(Process_Start)(Dart_NativeArguments args) {
&err,
&pid,
&exit_event,
- os_error_message, kMaxChildOsErrorMessageLength);
+ &os_error_message);
if (error_code == 0) {
Socket::SetSocketIdNativeField(in_handle, in);
Socket::SetSocketIdNativeField(out_handle, out);
@@ -151,6 +150,7 @@ void FUNCTION_NAME(Process_Start)(Dart_NativeArguments args) {
}
delete[] string_args;
delete[] string_environment;
+ free(os_error_message);
Dart_SetReturnValue(args, Dart_NewBoolean(error_code == 0));
Dart_ExitScope();
}
@@ -194,7 +194,7 @@ void FUNCTION_NAME(SystemEncodingToString)(Dart_NativeArguments args) {
Dart_PropagateError(result);
}
char* str =
- StringUtils::SystemStringToUtf8(reinterpret_cast<char*>(buffer));
+ StringUtils::ConsoleStringToUtf8(reinterpret_cast<char*>(buffer));
Dart_SetReturnValue(args, DartUtils::NewString(str));
if (str != reinterpret_cast<char*>(buffer)) free(str);
Dart_ExitScope();
@@ -205,7 +205,7 @@ void FUNCTION_NAME(StringToSystemEncoding)(Dart_NativeArguments args) {
Dart_EnterScope();
Dart_Handle str = Dart_GetNativeArgument(args, 0);
const char* utf8 = DartUtils::GetStringValue(str);
- const char* system_string = StringUtils::Utf8ToSystemString(utf8);
+ const char* system_string = StringUtils::Utf8ToConsoleString(utf8);
int external_length = strlen(system_string);
uint8_t* buffer = NULL;
Dart_Handle external_array = IOBuffer::Allocate(external_length, &buffer);
« no previous file with comments | « runtime/bin/process.h ('k') | runtime/bin/process_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698