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

Unified Diff: runtime/bin/extensions_win.cc

Issue 2426053002: Fix crashes on debug windows (Closed)
Patch Set: Cleanup Created 4 years, 2 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 | « no previous file | runtime/bin/file.h » ('j') | runtime/bin/file.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/extensions_win.cc
diff --git a/runtime/bin/extensions_win.cc b/runtime/bin/extensions_win.cc
index da626f15e06e0aa995e49c7fb39f665a7297533a..17bb58f05d62cf7640235d3405350783a0606028 100644
--- a/runtime/bin/extensions_win.cc
+++ b/runtime/bin/extensions_win.cc
@@ -19,7 +19,16 @@ const char* kPrecompiledDataSymbolName = "_kDataSnapshot";
void* Extensions::LoadExtensionLibrary(const char* library_file) {
SetLastError(0);
- return LoadLibraryW(StringUtilsWin::Utf8ToWide(library_file));
+
+ // Convert to wchar_t string.
+ int name_len = MultiByteToWideChar(CP_UTF8, 0, library_file, -1, NULL, 0);
+ wchar_t* name;
+ name = new wchar_t[name_len];
+ MultiByteToWideChar(CP_UTF8, 0, library_file, -1, name, name_len);
+
+ void* ext = LoadLibraryW(name);
+ delete[] name;
+ return ext;
}
void* Extensions::ResolveSymbol(void* lib_handle, const char* symbol) {
« no previous file with comments | « no previous file | runtime/bin/file.h » ('j') | runtime/bin/file.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698