Index: src/plugin/AdblockPlusClient.cpp |
=================================================================== |
--- a/src/plugin/AdblockPlusClient.cpp |
+++ b/src/plugin/AdblockPlusClient.cpp |
@@ -1,40 +1,40 @@ |
#include "PluginStdAfx.h" |
#include "PluginSettings.h" |
#include "PluginSystem.h" |
#include "PluginFilter.h" |
#include "PluginClientFactory.h" |
-#include "PluginDictionary.h" |
#include "PluginHttpRequest.h" |
#include "PluginMutex.h" |
#include "PluginClass.h" |
-#include "PluginUtil.h" |
#include "AdblockPlusClient.h" |
#include "../shared/Communication.h" |
+#include "../shared/Utils.h" |
namespace |
{ |
void SpawnAdblockPlusEngine() |
{ |
- std::wstring engineExecutablePath = DllDir() + L"AdblockPlusEngine.exe"; |
- CString browserLanguage = CPluginSystem::GetInstance()->GetBrowserLanguage(); |
+ std::wstring engineExecutablePath = GetDllDir() + L"AdblockPlusEngine.exe"; |
+ CString params = L"AdblockPlusEngine.exe " + CPluginSystem::GetInstance()->GetBrowserLanguage(); |
Felix Dahlke
2013/06/11 12:31:14
From the documentation (http://msdn.microsoft.com/
Wladimir Palant
2013/06/12 13:46:07
I would be opposed to that idea given that engineE
Felix Dahlke
2013/06/13 18:07:37
Fair enough.
|
+ |
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 (!CreateProcessAsUserW(newToken, engineExecutablePath.c_str(), |
- browserLanguage.GetBuffer(browserLanguage.GetLength() + 1), |
+ params.GetBuffer(params.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); |