Changeset 104930 in vbox for trunk/src/VBox/Runtime
- Timestamp:
- Jun 14, 2024 9:20:58 PM (11 months ago)
- svn:sync-xref-src-repo-rev:
- 163532
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/r3/win/process-win.cpp
r103232 r104930 152 152 /* user32.dll: */ 153 153 static decltype(OpenWindowStationW) *g_pfnOpenWindowStationW = NULL; 154 static decltype(CloseWindowStation) *g_pfnCloseWindowStation = NULL; 154 static decltype(CloseWindowStation) *g_pfnCloseWindowStation = NULL; 155 /* user32.dll: (for reasons of bad AV heuristics) */ 156 static decltype(GetUserObjectSecurity) *g_pfnGetUserObjectSecurity = NULL; 157 static decltype(SetUserObjectSecurity) *g_pfnSetUserObjectSecurity = NULL; 155 158 /* userenv.dll: */ 156 159 static PFNCREATEENVIRONMENTBLOCK g_pfnCreateEnvironmentBlock = NULL; … … 377 380 rc = RTLdrGetSymbol(hMod, "CloseWindowStation", (void **)&g_pfnCloseWindowStation); 378 381 if (RT_FAILURE(rc)) { g_pfnCloseWindowStation = NULL; Assert(g_enmWinVer <= kRTWinOSType_NT310); } 382 383 /* These are only imported to workaround bad AV detection heuristics. */ 384 rc = RTLdrGetSymbol(hMod, "GetUserObjectSecurity", (void **)&g_pfnGetUserObjectSecurity); 385 AssertRC(rc); 386 387 rc = RTLdrGetSymbol(hMod, "SetUserObjectSecurity", (void **)&g_pfnSetUserObjectSecurity); 388 AssertRC(rc); 379 389 380 390 RTLdrClose(hMod); … … 995 1005 DWORD cbNeeded; 996 1006 AssertReturn(pSecDesc, false); 997 if (!GetUserObjectSecurity(hUserObj, &SecInfo, pSecDesc, cbSecDesc, &cbNeeded)) 1007 AssertReturn(g_pfnGetUserObjectSecurity, false); 1008 if (!g_pfnGetUserObjectSecurity(hUserObj, &SecInfo, pSecDesc, cbSecDesc, &cbNeeded)) 998 1009 { 999 1010 RTMemTmpFree(pSecDesc); … … 1002 1013 pSecDesc = (PSECURITY_DESCRIPTOR)RTMemTmpAlloc(cbSecDesc); 1003 1014 AssertReturn(pSecDesc, false); 1004 if (! GetUserObjectSecurity(hUserObj, &SecInfo, pSecDesc, cbSecDesc, &cbNeeded))1015 if (!g_pfnGetUserObjectSecurity(hUserObj, &SecInfo, pSecDesc, cbSecDesc, &cbNeeded)) 1005 1016 { 1006 1017 RTMemTmpFree(pSecDesc); … … 1148 1159 DWORD cbNeeded; 1149 1160 AssertReturn(pSecDesc, NULL); 1150 if (!GetUserObjectSecurity(hUserObj, &SecInfo, pSecDesc, cbSecDesc, &cbNeeded)) 1161 AssertReturn(g_pfnGetUserObjectSecurity, NULL); 1162 if (!g_pfnGetUserObjectSecurity(hUserObj, &SecInfo, pSecDesc, cbSecDesc, &cbNeeded)) 1151 1163 { 1152 1164 RTMemTmpFree(pSecDesc); … … 1155 1167 pSecDesc = (PSECURITY_DESCRIPTOR)RTMemTmpAlloc(cbSecDesc); 1156 1168 AssertReturn(pSecDesc, NULL); 1157 if (! GetUserObjectSecurity(hUserObj, &SecInfo, pSecDesc, cbSecDesc, &cbNeeded))1169 if (!g_pfnGetUserObjectSecurity(hUserObj, &SecInfo, pSecDesc, cbSecDesc, &cbNeeded)) 1158 1170 { 1159 1171 RTMemTmpFree(pSecDesc); … … 1268 1280 { 1269 1281 bool fRet = false; 1282 AssertReturn(g_pfnSetUserObjectSecurity, fRet); 1270 1283 1271 1284 /* … … 1306 1319 { 1307 1320 SECURITY_INFORMATION SecInfo = DACL_SECURITY_INFORMATION; 1308 if ( SetUserObjectSecurity(hWinStation, &SecInfo, pNewSecDesc))1321 if (g_pfnSetUserObjectSecurity(hWinStation, &SecInfo, pNewSecDesc)) 1309 1322 fRet = true; 1310 1323 else … … 1340 1353 { 1341 1354 bool fRet = false; 1355 AssertReturn(g_pfnSetUserObjectSecurity, fRet); 1342 1356 1343 1357 /* … … 1376 1390 { 1377 1391 SECURITY_INFORMATION SecInfo = DACL_SECURITY_INFORMATION; 1378 if ( SetUserObjectSecurity(hDesktop, &SecInfo, pNewSecDesc))1392 if (g_pfnSetUserObjectSecurity(hDesktop, &SecInfo, pNewSecDesc)) 1379 1393 fRet = true; 1380 1394 else
Note:
See TracChangeset
for help on using the changeset viewer.