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), |
+ 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); |
} |