- Timestamp:
- Sep 30, 2014 7:13:19 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostDrivers/Support/win/SUPDrv-win.cpp
r52738 r52905 167 167 /** The kind of process we're protecting. */ 168 168 SUPDRVNTPROTECTKIND volatile enmProcessKind; 169 /** 7,: Hack to allow the supid themes service duplicate handle privileges to 170 * our process. */ 171 bool fThemesFirstProcessCreateHandle : 1; 169 172 /** Vista, 7 & 8: Hack to allow more rights to the handle returned by 170 173 * NtCreateUserProcess. Only applicable to VmProcessUnconfirmed. */ … … 176 179 * NtCreateUserProcess. Only applicable to VmProcessUnconfirmed. */ 177 180 bool fCsrssFirstProcessCreateHandle : 1; 178 /** Vista, 7 & 8: Hack to allow more rights to the handle duplicated by CSR 179 * during process creation. Only applicable to VmProcessUnconfirmed. */ 180 bool fCsrssFirstProcessDuplicateHandle : 1; 181 /** 7,: Hack to allow the supid themes service duplicate handle privileges to 182 * our process. */ 183 bool fThemesFirstProcessCreateHandle : 1; 181 /** Vista, 7 & 8: Hack to allow more rights to the handle duplicated by CSRSS 182 * during process creation. Only applicable to VmProcessUnconfirmed. On 183 * 32-bit systems we allow two as ZoneAlarm's system call hooks has been 184 * observed to do some seemingly unnecessary duplication work. */ 185 int32_t volatile cCsrssFirstProcessDuplicateHandle; 184 186 185 187 /** The parent PID for VM processes, otherwise NULL. */ … … 2650 2652 pNtChild->fFirstThreadCreateHandle = true; 2651 2653 pNtChild->fCsrssFirstProcessCreateHandle = true; 2652 pNtChild-> fCsrssFirstProcessDuplicateHandle = true;2654 pNtChild->cCsrssFirstProcessDuplicateHandle = ARCH_BITS == 32 ? 2 : 1; 2653 2655 pNtChild->fThemesFirstProcessCreateHandle = true; 2654 2656 pNtChild->hParentPid = pNtParent->AvlCore.Key; … … 3031 3033 && pNtProtect->fCsrssFirstProcessCreateHandle 3032 3034 && pOpInfo->KernelHandle == 0 3035 && ExGetPreviousMode() == UserMode 3033 3036 && supdrvNtProtectIsAssociatedCsrss(pNtProtect, PsGetCurrentProcess()) ) 3034 3037 { … … 3057 3060 && pNtProtect->fThemesFirstProcessCreateHandle 3058 3061 && pOpInfo->KernelHandle == 0 3062 && ExGetPreviousMode() == UserMode 3059 3063 && supdrvNtProtectIsFrigginThemesService(pNtProtect, PsGetCurrentProcess()) ) 3060 3064 { … … 3097 3101 if ( g_uNtVerCombined < SUP_MAKE_NT_VER_SIMPLE(6, 3) 3098 3102 && pNtProtect->enmProcessKind == kSupDrvNtProtectKind_VmProcessUnconfirmed 3099 && pNtProtect-> fCsrssFirstProcessDuplicateHandle3103 && pNtProtect->cCsrssFirstProcessDuplicateHandle > 0 3100 3104 && pOpInfo->KernelHandle == 0 3105 && pOpInfo->Parameters->DuplicateHandleInformation.DesiredAccess == s_fCsrssStupidDesires 3101 3106 && pNtProtect->hParentPid 3102 3107 == PsGetProcessId((PEPROCESS)pOpInfo->Parameters->DuplicateHandleInformation.SourceProcess) 3103 3108 && pOpInfo->Parameters->DuplicateHandleInformation.TargetProcess == PsGetCurrentProcess() 3104 && supdrvNtProtectIsAssociatedCsrss(pNtProtect, PsGetCurrentProcess()) ) 3109 && ExGetPreviousMode() == UserMode 3110 && supdrvNtProtectIsAssociatedCsrss(pNtProtect, PsGetCurrentProcess())) 3105 3111 { 3106 pNtProtect->fCsrssFirstProcessDuplicateHandle = false; 3107 if (pOpInfo->Parameters->DuplicateHandleInformation.DesiredAccess == s_fCsrssStupidDesires) 3112 if (ASMAtomicDecS32(&pNtProtect->cCsrssFirstProcessDuplicateHandle) >= 0) 3108 3113 { 3109 3114 /* Not needed: PROCESS_CREATE_THREAD, PROCESS_SET_SESSIONID, … … 3249 3254 && pNtProtect->fFirstThreadCreateHandle 3250 3255 && pOpInfo->KernelHandle == 0 3256 && ExGetPreviousMode() == UserMode 3251 3257 && pNtProtect->hParentPid == PsGetProcessId(PsGetCurrentProcess()) ) 3252 3258 { … … 3271 3277 || enmProcessKind == kSupDrvNtProtectKind_VmProcessUnconfirmed) 3272 3278 && pOpInfo->KernelHandle == 0 3279 && ExGetPreviousMode() == UserMode 3273 3280 && supdrvNtProtectIsAssociatedCsrss(pNtProtect, PsGetCurrentProcess()) ) 3274 3281 { … … 3315 3322 && pOpInfo->Parameters->DuplicateHandleInformation.TargetProcess == PsGetCurrentProcess() 3316 3323 && pOpInfo->KernelHandle == 0 3324 && ExGetPreviousMode() == UserMode 3317 3325 && supdrvNtProtectIsAssociatedCsrss(pNtProtect, PsGetCurrentProcess()) ) 3318 3326 {
Note:
See TracChangeset
for help on using the changeset viewer.