VirtualBox

Changeset 12160

Show
Ignore:
Timestamp:
09/06/08 01:23:14 (3 months ago)
Author:
vboxsync
Message:

IPRT/semfastmutex-r0drv-nt: Fail RTSemFastMutexRequest calls with IRQL > APC_LEVEL because ExAcquireFastMutex? will otherwise lower the IRQL.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/VBox/Runtime/r0drv/nt/semfastmutex-r0drv-nt.cpp

    r10827 r12160  
    9797    ASMAtomicIncU32(&pFastInt->u32Magic); 
    9898    Assert(pFastInt->Mutex.Count == 1); 
    99     /* It's not very clear what this Contention field really means. Seems to be a counter for the number of times contention occurred. (see e.g. http://winprogger.com/?p=6)  
     99    /* It's not very clear what this Contention field really means. Seems to be a counter for the number of times contention occurred. (see e.g. http://winprogger.com/?p=6) 
    100100     * The following assertion is therefor wrong: 
    101101     * Assert(pFastInt->Mutex.Contention == 0); 
     
    118118        return VERR_INVALID_PARAMETER; 
    119119    } 
     120#if 1 
     121    /* 
     122     * ExAcquireFastMutex will set the IRQL to APC regardless of our current 
     123     * level. Lowering the IRQL may screw things up, so to allow this. 
     124     */ 
     125# if 0 /** @todo enable this when the logger has been fixed. */ 
     126    AssertMsg(KeGetCurrentIrql() <= APC_LEVEL, 
     127              ("%d\n", KeGetCurrentIrql()), 
     128              VERR_INVALID_STATE); 
     129# else  /* the gentler approach. */ 
     130    KIRQL Irql = KeGetCurrentIrql(); 
     131    if (Irql > APC_LEVEL) 
     132        return VERR_INVALID_STATE; 
     133# endif 
     134#endif 
    120135 
    121136    ExAcquireFastMutex(&pFastInt->Mutex); 

© 2008 Sun Microsystems, Inc.
ContactPrivacy policy