VirtualBox

Changeset 20929 in vbox for trunk


Ignore:
Timestamp:
Jun 25, 2009 11:54:56 AM (16 years ago)
Author:
vboxsync
Message:

semevent-r0drv-nt.cpp: s/pEventInt/pThis/g

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/r0drv/nt/semevent-r0drv-nt.cpp

    r20923 r20929  
    6262{
    6363    Assert(sizeof(RTSEMEVENTINTERNAL) > sizeof(void *));
    64     PRTSEMEVENTINTERNAL pEventInt = (PRTSEMEVENTINTERNAL)RTMemAlloc(sizeof(*pEventInt));
    65     if (pEventInt)
     64    PRTSEMEVENTINTERNAL pThis = (PRTSEMEVENTINTERNAL)RTMemAlloc(sizeof(*pThis));
     65    if (pThis)
    6666    {
    67         pEventInt->u32Magic = RTSEMEVENT_MAGIC;
    68         KeInitializeEvent(&pEventInt->Event, SynchronizationEvent, FALSE);
    69         *pEventSem = pEventInt;
     67        pThis->u32Magic = RTSEMEVENT_MAGIC;
     68        KeInitializeEvent(&pThis->Event, SynchronizationEvent, FALSE);
     69        *pEventSem = pThis;
    7070        return VINF_SUCCESS;
    7171    }
     
    7979     * Validate input.
    8080     */
    81     PRTSEMEVENTINTERNAL pEventInt = (PRTSEMEVENTINTERNAL)EventSem;
    82     if (!pEventInt)
     81    PRTSEMEVENTINTERNAL pThis = (PRTSEMEVENTINTERNAL)EventSem;
     82    if (!pThis)
    8383        return VERR_INVALID_PARAMETER;
    84     if (pEventInt->u32Magic != RTSEMEVENT_MAGIC)
     84    if (pThis->u32Magic != RTSEMEVENT_MAGIC)
    8585    {
    86         AssertMsgFailed(("pEventInt->u32Magic=%RX32 pEventInt=%p\n", pEventInt->u32Magic, pEventInt));
     86        AssertMsgFailed(("pThis->u32Magic=%RX32 pThis=%p\n", pThis->u32Magic, pThis));
    8787        return VERR_INVALID_PARAMETER;
    8888    }
     
    9191     * Invalidate it and signal the object just in case.
    9292     */
    93     ASMAtomicIncU32(&pEventInt->u32Magic);
    94     KeSetEvent(&pEventInt->Event, 0xfff, FALSE);
    95     RTMemFree(pEventInt);
     93    ASMAtomicIncU32(&pThis->u32Magic);
     94    KeSetEvent(&pThis->Event, 0xfff, FALSE);
     95    RTMemFree(pThis);
    9696    return VINF_SUCCESS;
    9797}
     
    103103     * Validate input.
    104104     */
    105     PRTSEMEVENTINTERNAL pEventInt = (PRTSEMEVENTINTERNAL)EventSem;
    106     if (!pEventInt)
     105    PRTSEMEVENTINTERNAL pThis = (PRTSEMEVENTINTERNAL)EventSem;
     106    if (!pThis)
    107107        return VERR_INVALID_PARAMETER;
    108     if (    !pEventInt
    109         ||  pEventInt->u32Magic != RTSEMEVENT_MAGIC)
     108    if (    !pThis
     109        ||  pThis->u32Magic != RTSEMEVENT_MAGIC)
    110110    {
    111         AssertMsgFailed(("pEventInt->u32Magic=%RX32 pEventInt=%p\n", pEventInt ? pEventInt->u32Magic : 0, pEventInt));
     111        AssertMsgFailed(("pThis->u32Magic=%RX32 pThis=%p\n", pThis ? pThis->u32Magic : 0, pThis));
    112112        return VERR_INVALID_PARAMETER;
    113113    }
     
    116116     * Signal the event object.
    117117     */
    118     KeSetEvent(&pEventInt->Event, 1, FALSE);
     118    KeSetEvent(&pThis->Event, 1, FALSE);
    119119    return VINF_SUCCESS;
    120120}
     
    126126     * Validate input.
    127127     */
    128     PRTSEMEVENTINTERNAL pEventInt = (PRTSEMEVENTINTERNAL)EventSem;
    129     if (!pEventInt)
     128    PRTSEMEVENTINTERNAL pThis = (PRTSEMEVENTINTERNAL)EventSem;
     129    if (!pThis)
    130130        return VERR_INVALID_PARAMETER;
    131     if (    !pEventInt
    132         ||  pEventInt->u32Magic != RTSEMEVENT_MAGIC)
     131    if (    !pThis
     132        ||  pThis->u32Magic != RTSEMEVENT_MAGIC)
    133133    {
    134         AssertMsgFailed(("pEventInt->u32Magic=%RX32 pEventInt=%p\n", pEventInt ? pEventInt->u32Magic : 0, pEventInt));
     134        AssertMsgFailed(("pThis->u32Magic=%RX32 pThis=%p\n", pThis ? pThis->u32Magic : 0, pThis));
    135135        return VERR_INVALID_PARAMETER;
    136136    }
     
    143143    KPROCESSOR_MODE WaitMode   = fInterruptible ? UserMode : KernelMode;
    144144    if (cMillies == RT_INDEFINITE_WAIT)
    145         rcNt = KeWaitForSingleObject(&pEventInt->Event, Executive, WaitMode, fInterruptible, NULL);
     145        rcNt = KeWaitForSingleObject(&pThis->Event, Executive, WaitMode, fInterruptible, NULL);
    146146    else
    147147    {
    148148        LARGE_INTEGER Timeout;
    149149        Timeout.QuadPart = -(int64_t)cMillies * 10000;
    150         rcNt = KeWaitForSingleObject(&pEventInt->Event, Executive, WaitMode, fInterruptible, &Timeout);
     150        rcNt = KeWaitForSingleObject(&pThis->Event, Executive, WaitMode, fInterruptible, &Timeout);
    151151    }
    152152    switch (rcNt)
    153153    {
    154154        case STATUS_SUCCESS:
    155             if (pEventInt->u32Magic == RTSEMEVENT_MAGIC)
     155            if (pThis->u32Magic == RTSEMEVENT_MAGIC)
    156156                return VINF_SUCCESS;
    157157            return VERR_SEM_DESTROYED;
     
    163163            return VERR_TIMEOUT;
    164164        default:
    165             AssertMsgFailed(("pEventInt->u32Magic=%RX32 pEventInt=%p: wait returned %lx!\n",
    166                              pEventInt->u32Magic, pEventInt, (long)rcNt));
     165            AssertMsgFailed(("pThis->u32Magic=%RX32 pThis=%p: wait returned %lx!\n",
     166                             pThis->u32Magic, pThis, (long)rcNt));
    167167            return VERR_INTERNAL_ERROR;
    168168    }
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette