Index: src/plugin/AdblockPlusClient.cpp |
=================================================================== |
--- a/src/plugin/AdblockPlusClient.cpp |
+++ b/src/plugin/AdblockPlusClient.cpp |
@@ -15,26 +15,28 @@ |
#include "../shared/AutoHandle.h" |
#include "../shared/Communication.h" |
namespace |
{ |
void SpawnAdblockPlusEngine() |
{ |
std::wstring engineExecutablePath = DllDir() + L"AdblockPlusEngine.exe"; |
+ CString browserLanguage = CPluginSystem::GetInstance()->GetBrowserLanguage(); |
STARTUPINFO startupInfo = {}; |
PROCESS_INFORMATION processInformation = {}; |
HANDLE token; |
OpenProcessToken(GetCurrentProcess(), TOKEN_DUPLICATE | TOKEN_ADJUST_DEFAULT | TOKEN_QUERY | TOKEN_ASSIGN_PRIMARY, &token); |
HANDLE newToken; |
DuplicateTokenEx(token, 0, 0, SecurityImpersonation, TokenPrimary, &newToken); |
- if (!CreateProcessAsUser(newToken, 0, const_cast<wchar_t*>(engineExecutablePath.c_str()), 0, 0, 0, 0, 0, 0, |
- &startupInfo, &processInformation)) |
+ if (!CreateProcessAsUserW(newToken, engineExecutablePath.c_str(), |
+ browserLanguage.GetBuffer(browserLanguage.GetLength() + 1), |
Felix Dahlke
2013/06/04 09:46:09
I'd prefer const_cast<LPWSTR>(browserLanguage.c_st
Wladimir Palant
2013/06/04 11:28:45
No, it doesn't do the same thing (besides, browser
Felix Dahlke
2013/06/04 11:34:20
Oh, tought it had c_str() or some equivalent. Well
|
+ 0, 0, 0, 0, 0, 0, &startupInfo, &processInformation)) |
{ |
DWORD error = GetLastError(); |
throw std::runtime_error("Failed to start Adblock Plus Engine"); |
} |
CloseHandle(processInformation.hProcess); |
CloseHandle(processInformation.hThread); |
} |