Update SboxHostDll.cpp
This commit is contained in:
parent
c30ec207c3
commit
33170d82cb
|
@ -1,5 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2004-2020 Sandboxie Holdings, LLC
|
* Copyright 2004-2020 Sandboxie Holdings, LLC
|
||||||
|
* Copyright 2022 David Xanatos, xanasoft.com
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -41,6 +42,15 @@ BOOL SboxHostDll_OpenProcessToken(HANDLE ProcessHandle, DWORD DesiredAccess, PHA
|
||||||
|
|
||||||
if (bRet)
|
if (bRet)
|
||||||
{
|
{
|
||||||
|
// todo:
|
||||||
|
//HANDLE hAltToken = (HANDLE)SbieApi_QueryProcessInfoEx((HANDLE)GetProcessId(ProcessHandle), 'ptok', 0);
|
||||||
|
//if (hAltToken) {
|
||||||
|
// CloseHandle(hToken);
|
||||||
|
// if (phTokenOut)
|
||||||
|
// *phTokenOut = hAltToken;
|
||||||
|
// bRet = TRUE;
|
||||||
|
//}
|
||||||
|
|
||||||
if (SbieApi_QueryProcessInfo((HANDLE)GetProcessId(ProcessHandle), 0) & SBIE_FLAG_VALID_PROCESS)
|
if (SbieApi_QueryProcessInfo((HANDLE)GetProcessId(ProcessHandle), 0) & SBIE_FLAG_VALID_PROCESS)
|
||||||
{
|
{
|
||||||
BOOL bNeedAnotherValidToken = FALSE;
|
BOOL bNeedAnotherValidToken = FALSE;
|
||||||
|
@ -55,7 +65,12 @@ BOOL SboxHostDll_OpenProcessToken(HANDLE ProcessHandle, DWORD DesiredAccess, PHA
|
||||||
if(token.GetUser(&userSid))
|
if(token.GetUser(&userSid))
|
||||||
{
|
{
|
||||||
// this token is usable for clicktorun service
|
// this token is usable for clicktorun service
|
||||||
if (lstrcmpi(userSid.Sid(), _T("S-1-5-7"))==0)
|
|
||||||
|
//
|
||||||
|
// keep the 2nd option in sync with SandboxieSid[12] in DriverAssistSid.cpp
|
||||||
|
//
|
||||||
|
|
||||||
|
if (lstrcmpi(userSid.Sid(), _T("S-1-5-7"))==0 || _wcsnicmp(userSid.Sid(), _T("S-1-5-100-"), 10)==0)
|
||||||
{
|
{
|
||||||
if(token.GetLogonSid(&logonSid))
|
if(token.GetLogonSid(&logonSid))
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue