ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

BOOLEAN NTAPI CcpUnpinData ( IN PNOCC_BCB  RealBcb,
BOOLEAN  ReleaseBit 
)

Definition at line 920 of file pinsup.c.

{
    if (RealBcb->RefCount <= 2)
    {
        RealBcb->Exclusive = FALSE;
        if (RealBcb->ExclusiveWaiter)
        {
            DPRINT("Triggering exclusive waiter\n");
            KeSetEvent(&RealBcb->ExclusiveWait, IO_NO_INCREMENT, FALSE);
            return TRUE;
        }
    }
    if (RealBcb->RefCount == 2 && !ReleaseBit)
        return FALSE;
    if (RealBcb->RefCount > 1)
    {
        DPRINT("Removing one reference #%x\n", RealBcb - CcCacheSections);
        RealBcb->RefCount--;
        KeSetEvent(&CcDeleteEvent, IO_DISK_INCREMENT, FALSE);
    }
    if (RealBcb->RefCount == 1)
    {
        DPRINT("Clearing allocation bit #%x\n", RealBcb - CcCacheSections);

        RtlClearBit(CcCacheBitmap, RealBcb - CcCacheSections);

#ifdef PIN_WRITE_ONLY
        PVOID BaseAddress = RealBcb->BaseAddress;
        SIZE_T NumberOfBytes = RealBcb->Length;
        ULONG OldProtect;

        MiProtectVirtualMemory(NULL,
                               &BaseAddress,
                               &NumberOfBytes,
                               PAGE_READONLY,
                               &OldProtect);
#endif
    }

    return TRUE;
}

Generated on Sun May 27 2012 06:06:25 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.