亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? filemon.c

?? 文件監(jiān)視FileMon 一個常用的監(jiān)視軟件
?? C
?? 第 1 頁 / 共 5 頁
字號:
    //
    passedFilters = !ProcessFilters || ApplyFilters( text );
    if( passedFilters ) {

        //
        // Assign a sequence number if we weren't passed one
        //
        if( !SeqNum || (SeqNum && *SeqNum == (ULONG) -1)) {

            recordSequence = InterlockedIncrement( &Sequence );
            if( SeqNum ) *SeqNum = recordSequence;

        } else {

            recordSequence = *SeqNum;
        }

        //
        // If the current output buffer is near capacity, move to a new 
        // output buffer
        //
        if( CurrentLog->Len + len + sizeof(ENTRY) +1 >= LOGBUFSIZE ) {

            FilemonAllocateLog();
        }

        //
        // Log the entry
        //
        Entry = (void *)(CurrentLog->Data+CurrentLog->Len);
        Entry->seq = recordSequence;
        Entry->datetime.QuadPart = 0;
        Entry->perftime.QuadPart = 0;
        if( dateTime ) Entry->datetime = *dateTime;
        if( perfTime ) Entry->perftime = *perfTime;
        memcpy( Entry->text, text, len );
 
        //
        // Log the length of the string, plus 1 for the terminating
        // NULL  
        //   
        CurrentLog->Len += ((ULONG) (Entry->text - (PCHAR) Entry )) + len;
    }

    //
    // Release the output buffer lock
    //
    ExReleaseFastMutex( &LogMutex );
    return passedFilters;
}

//----------------------------------------------------------------------
//       H A S H   T A B L E   M A N A G E M E N T
//----------------------------------------------------------------------

//----------------------------------------------------------------------
//
// FilemonHashCleanup
//
// Called when we are unloading to free any memory that we have 
// in our possession.
//
//----------------------------------------------------------------------
VOID
FilemonHashCleanup(
    VOID
    )
{
    PHASH_ENTRY		hashEntry, nextEntry;
    ULONG		    i;

    KeEnterCriticalRegion();
    ExAcquireResourceExclusiveLite( &HashResource, TRUE );

    //
    // Free the hash table entries
    //
    for( i = 0; i < NUMHASH; i++ ) {

        hashEntry = HashTable[i];

        while( hashEntry ) {
            nextEntry = hashEntry->Next;
            ExFreePool( hashEntry );
            hashEntry = nextEntry;
        }

        HashTable[i] = NULL;
    }
    ExReleaseResourceLite( &HashResource );
    KeLeaveCriticalRegion();
}


//----------------------------------------------------------------------
//
// FilemonFreeHashEntry
//
// When we see a file close, we can free the string we had associated
// with the fileobject being closed since we know it won't be used
// again.
//
//----------------------------------------------------------------------
VOID 
FilemonFreeHashEntry( 
    PFILE_OBJECT fileObject 
    )
{
    PHASH_ENTRY		hashEntry, prevEntry;

    KeEnterCriticalRegion();
    ExAcquireResourceExclusiveLite( &HashResource, TRUE );

    //
    // Look-up the entry
    //
    hashEntry = HashTable[ HASHOBJECT( fileObject ) ];
    prevEntry = NULL;

    while( hashEntry && hashEntry->FileObject != fileObject ) {

        prevEntry = hashEntry;
        hashEntry = hashEntry->Next;
    }
 
    //  
    // If we fall of the hash list without finding what we're looking
    // for, just return.
    //
    if( !hashEntry ) {

        ExReleaseResourceLite( &HashResource );
        KeLeaveCriticalRegion();
        return;
    }

    //
    // Got it! Remove it from the list
    //
    if( prevEntry ) {

        prevEntry->Next = hashEntry->Next;

    } else {

        HashTable[ HASHOBJECT( fileObject )] = hashEntry->Next;
    }

    //
    // Free the entry's memory
    //
    ExFreePool( hashEntry );

    ExReleaseResourceLite( &HashResource );
    KeLeaveCriticalRegion();
}

//----------------------------------------------------------------------
//       P A T H  A N D  P R O C E S S  N A M E  R O U T I N E S
//----------------------------------------------------------------------


//----------------------------------------------------------------------
//
// FilemonFreeFilters
//
// Fress storage we allocated for filter strings.
//
//----------------------------------------------------------------------
VOID 
FilemonFreeFilters(
    VOID
    )
{
    ULONG   i;

    for( i = 0; i < NumIncludeFilters; i++ ) {

        ExFreePool( IncludeFilters[i] );
    }
    for( i = 0; i < NumExcludeFilters; i++ ) {

        ExFreePool( ExcludeFilters[i] );
    }
    NumIncludeFilters = 0;
    NumExcludeFilters = 0;
}


//----------------------------------------------------------------------
//
// MakeFilterArray
//
// Takes a filter string and splits into components (a component
// is seperated with a ';')
//
//----------------------------------------------------------------------
VOID
MakeFilterArray( 
    PCHAR FilterString,
    PCHAR FilterArray[],
    PULONG NumFilters 
    )
{
    PCHAR filterStart;
    ULONG filterLength;
    CHAR  saveChar;

    //
    // Scan through the process filters
    //
    filterStart = FilterString;
    while( *filterStart ) {

        filterLength = 0;
        while( filterStart[filterLength] &&
               filterStart[filterLength] != ';' ) {

            filterLength++;
        }

        //
        // Ignore zero-length components
        //
        if( filterLength ) {

            //
            // Conservatively allocate so that we can prepend and append
            // wildcards
            //
            FilterArray[ *NumFilters ] = 
                ExAllocatePool( PagedPool, filterLength + 1 + 2*sizeof('*') );
            
            //
            // Only fill this in if there's enough memory
            //
            if( FilterArray[ *NumFilters] ) {

                saveChar = *(filterStart + filterLength );
                *(filterStart + filterLength) = 0;
                sprintf( FilterArray[ *NumFilters ], "%s%s%s",
                         *filterStart == '*' ? "" : "*",
                         filterStart,
                         *(filterStart + filterLength - 1 ) == '*' ? "" : "*" );
                *(filterStart + filterLength) = saveChar;
                (*NumFilters)++;
            }
        }
    
        //
        // Are we done?
        //
        if( !filterStart[filterLength] ) break;

        //
        // Move to the next component (skip over ';')
        //
        filterStart += filterLength + 1;
    }
}


//----------------------------------------------------------------------
//
// FilemonUpdateFilters
//
// Takes a new filter specification and updates the filter
// arrays with them.
//
//----------------------------------------------------------------------
VOID 
FilemonUpdateFilters(
    VOID
    )
{
    //
    // Free old filters (if any)
    //
    KeEnterCriticalRegion();
    ExAcquireResourceExclusiveLite( &FilterResource, TRUE );
    FilemonFreeFilters();

    //
    // Create new filter arrays
    //
    MakeFilterArray( FilterDef.includefilter,
                     IncludeFilters, &NumIncludeFilters );
    MakeFilterArray( FilterDef.excludefilter,
                     ExcludeFilters, &NumExcludeFilters );
    ExReleaseResourceLite( &FilterResource );
    KeLeaveCriticalRegion();
}


//----------------------------------------------------------------------
//
// ApplyFilters
//
// If the name matches the exclusion mask, we do not log it. Else if
// it doesn't match the inclusion mask we do not log it. 
//
//----------------------------------------------------------------------
BOOLEAN
ApplyFilters( 
    PCHAR Text
    )
{
    ULONG i;

    //
    // If no GUI or no filename return FALSE
    //
    if( !Text ) return FALSE;

    //   
    // If it matches the exclusion string, do not log it
    //
    KeEnterCriticalRegion();
    ExAcquireResourceSharedLite( &FilterResource, TRUE );

    for( i = 0; i < NumExcludeFilters; i++ ) {

        if( MatchWithPattern( ExcludeFilters[i], Text ) ) {

            ExReleaseResourceLite( &FilterResource );
            KeLeaveCriticalRegion();
            return FALSE;
        }
    }
 
    //
    // If it matches an include filter then log it
    //
    for( i = 0; i < NumIncludeFilters; i++ ) {

        if( MatchWithPattern( IncludeFilters[i], Text )) {

            ExReleaseResourceLite( &FilterResource );
            KeLeaveCriticalRegion();
            return TRUE;
        }
    }

    //
    // It didn't match any include filters so don't log
    //
    ExReleaseResourceLite( &FilterResource );
    KeLeaveCriticalRegion();
    return FALSE;
}


//----------------------------------------------------------------------
//
// FilemonQueryFileComplete
//
// This routine is used to handle I/O completion for our self-generated
// IRP that is used to query a file's name or number.
//
//----------------------------------------------------------------------
NTSTATUS 
FilemonQueryFileComplete(
    PDEVICE_OBJECT DeviceObject,
    PIRP Irp,
    PVOID Context
    )
{
    //
    // Copy the status information back into the "user" IOSB.
    //
    *Irp->UserIosb = Irp->IoStatus;
    if( !NT_SUCCESS(Irp->IoStatus.Status) ) {

        DbgPrint(("   ERROR ON IRP: %x\n", Irp->IoStatus.Status ));
    }
    
    //
    // Set the user event - wakes up the mainline code doing this.
    //
    KeSetEvent(Irp->UserEvent, 0, FALSE);
    
    //
    // Free the IRP now that we are done with it.
    //
    IoFreeIrp(Irp);
    
    //
    // We return STATUS_MORE_PROCESSING_REQUIRED because this "magic" return value
    // tells the I/O Manager that additional processing will be done by this driver
    // to the IRP - in fact, it might (as it is in this case) already BE done - and
    // the IRP cannot be completed.
    //
    return STATUS_MORE_PROCESSING_REQUIRED;
}


//----------------------------------------------------------------------
//
// FilemonQueryFile
//
// This function retrieves the "standard" information for the
// underlying file system, asking for the filename in particular.
//
//----------------------------------------------------------------------
BOOLEAN 
FilemonQueryFile( 
    PDEVICE_OBJECT DeviceObject, 
    PFILE_OBJECT FileObject,
    FILE_INFORMATION_CLASS FileInformationClass,
    PVOID FileQueryBuffer,
    ULONG FileQueryBufferLength
    )
{
    PIRP irp;
    KEVENT event;
    IO_STATUS_BLOCK IoStatusBlock;
    PIO_STACK_LOCATION ioStackLocation;

    DbgPrint(("Getting file name for %x\n", FileObject));

    //
    // Initialize the event
    //
    KeInitializeEvent(&event, SynchronizationEvent, FALSE);

    //
    // Allocate an irp for this request.  This could also come from a 
    // private pool, for instance.
    //
    irp = IoAllocateIrp(DeviceObject->StackSize, FALSE);
    if(!irp) {

        //
        // Failure!
        //
        return FALSE;
    }
  
    //
    // Build the IRP's main body
    //  
    irp->AssociatedIrp.SystemBuffer = FileQueryBuffer;
    irp->UserEvent = &event;
    irp->UserIosb = &IoStatusBlock;
    irp->Tail.Overlay.Thread = PsGetCurrentThread();
    irp->Tail.Overlay.OriginalFileObject = FileObject;
    irp->RequestorMode = KernelMode;
    irp->Flags = 0;

    //
    // Set up the I/O stack location.
    //
    ioStackLocation = IoGetNextIrpStackLocation(irp);
    ioStackLocation->MajorFunction = IRP_MJ_QUERY_INFORMATION;
    ioStackLocation->DeviceObject = DeviceObject;
    ioStackLocation->FileObject = FileObject;
    ioStackLocation->Parameters.QueryFile.Length = FileQueryBufferLength;
    ioStackLocation->Parameters.QueryFile.FileInformationClass = FileInformationClass;

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
麻豆国产精品777777在线| 欧美亚洲综合网| 一区二区三区在线视频观看58| 911精品产国品一二三产区| 国产成人综合网| 性做久久久久久免费观看欧美| 国产丝袜欧美中文另类| 欧美精品丝袜久久久中文字幕| 成人国产在线观看| 国产在线精品免费| 视频一区欧美精品| 亚洲少妇30p| 中文字幕欧美日本乱码一线二线| 欧美一区2区视频在线观看| 91蜜桃网址入口| 国产福利一区二区| 久久电影国产免费久久电影 | 日本一区二区免费在线| 91精品国产一区二区三区香蕉| 91色婷婷久久久久合中文| 国产精品88888| 极品销魂美女一区二区三区| 日本一道高清亚洲日美韩| 亚洲精品国产成人久久av盗摄| 国产亚洲一本大道中文在线| 日韩欧美亚洲另类制服综合在线 | 中文一区在线播放| 精品久久久久久综合日本欧美| 欧美日韩黄视频| 欧美一a一片一级一片| 91首页免费视频| av不卡在线观看| 成人av先锋影音| 成人一级黄色片| 国产精品亚洲第一| 国产综合色精品一区二区三区| 久久精品99国产精品| 日韩经典中文字幕一区| 亚洲6080在线| 日本vs亚洲vs韩国一区三区二区| 日韩电影在线看| 麻豆91在线观看| 精品在线亚洲视频| 韩国v欧美v日本v亚洲v| 国内外精品视频| 国精产品一区一区三区mba桃花| 国产自产高清不卡| 成人丝袜18视频在线观看| 粉嫩高潮美女一区二区三区| 成人性视频网站| 色综合天天综合网天天看片| 色婷婷亚洲一区二区三区| 色呦呦国产精品| 欧美日韩色一区| 日韩欧美的一区二区| 日韩美一区二区三区| 精品国产123| 国产精品美女久久久久久2018| 国产精品免费人成网站| 樱花影视一区二区| 全部av―极品视觉盛宴亚洲| 国产精华液一区二区三区| 成人精品免费视频| 91国产视频在线观看| 欧美日韩一区二区三区视频| 日韩欧美一区在线观看| 国产亚洲精品7777| 亚洲乱码中文字幕| 日韩av电影天堂| 欧美伊人精品成人久久综合97| 欧美精品一二三| 国产色产综合产在线视频| 亚洲欧美日韩国产一区二区三区| 午夜激情一区二区三区| 国产一区二三区好的| 色综合久久天天| 日韩精品一区二区三区swag | 国产欧美日本一区二区三区| 夜夜爽夜夜爽精品视频| 蜜桃一区二区三区在线观看| av电影在线观看完整版一区二区 | 亚洲精品欧美在线| 麻豆国产精品777777在线| 不卡av电影在线播放| 欧美久久久久中文字幕| 久久精品无码一区二区三区| 亚洲精品美腿丝袜| 国产在线麻豆精品观看| 色婷婷亚洲精品| 久久久久久久久久久99999| 亚洲精品视频在线看| 美脚の诱脚舐め脚责91| 99精品视频在线观看| 日韩欧美一级特黄在线播放| 亚洲精品欧美综合四区| 国内精品久久久久影院薰衣草| 欧美吻胸吃奶大尺度电影 | 亚洲一区二区三区视频在线| 国产老女人精品毛片久久| 欧美日韩五月天| 综合电影一区二区三区 | 99视频一区二区三区| 91精品欧美久久久久久动漫| 亚洲女子a中天字幕| 狠狠色狠狠色综合| 精品视频在线免费看| 亚洲国产成人在线| 久久99久久99小草精品免视看| 欧美视频精品在线| 亚洲欧美在线视频| 国产ts人妖一区二区| 精品少妇一区二区三区在线视频| 亚洲成年人影院| 一本一道久久a久久精品| 国产精品久久三| 国产精品自产自拍| 日韩写真欧美这视频| 日韩有码一区二区三区| 在线观看亚洲一区| 亚洲女同ⅹxx女同tv| 播五月开心婷婷综合| 欧美激情综合五月色丁香小说| 国产一区二区福利视频| 欧美一级xxx| 日韩中文字幕av电影| 欧美日韩一二三| 亚洲女同女同女同女同女同69| av中文字幕不卡| 中文字幕亚洲精品在线观看| 日韩欧美亚洲国产精品字幕久久久 | 欧美群妇大交群中文字幕| 一区二区三区影院| 9i看片成人免费高清| 国产精品久久久久久久裸模 | 在线观看网站黄不卡| 亚洲精品成人在线| 91久久精品国产91性色tv| ...av二区三区久久精品| 99精品视频在线免费观看| 国产精品成人免费| 92国产精品观看| 亚洲综合视频在线| 欧美综合欧美视频| 婷婷亚洲久悠悠色悠在线播放| 91精品国产aⅴ一区二区| 蜜臀av亚洲一区中文字幕| 91精品福利在线一区二区三区| 麻豆一区二区三| 国产亚洲欧美日韩日本| 成人精品视频一区二区三区| 亚洲码国产岛国毛片在线| 在线观看av不卡| 天天操天天干天天综合网| 日韩三级伦理片妻子的秘密按摩| 精品无人区卡一卡二卡三乱码免费卡 | 亚洲国产毛片aaaaa无费看| 精品视频一区二区不卡| 天天色 色综合| 亚洲精品在线三区| 99久久99久久免费精品蜜臀| 亚洲成人激情自拍| 精品日本一线二线三线不卡| 粉嫩嫩av羞羞动漫久久久 | 日韩高清不卡在线| 亚洲精品一区二区在线观看| 成人午夜免费av| 亚洲电影在线播放| 久久欧美一区二区| 91蜜桃视频在线| 日韩av电影天堂| 中文字幕va一区二区三区| 欧美性受极品xxxx喷水| 狠狠色伊人亚洲综合成人| 亚洲色欲色欲www| 日韩视频在线观看一区二区| 岛国精品在线观看| 视频一区二区中文字幕| 欧美极品美女视频| 欧美绝品在线观看成人午夜影视| 国产美女av一区二区三区| 亚洲自拍偷拍麻豆| 国产午夜精品一区二区三区视频| 色猫猫国产区一区二在线视频| 久久99精品久久只有精品| 樱花影视一区二区| 国产偷国产偷亚洲高清人白洁| 欧美在线制服丝袜| 国产 欧美在线| 奇米影视在线99精品| 亚洲精选视频免费看| 久久综合久久久久88| 欧美日韩免费电影| 成人精品gif动图一区| 免费人成黄页网站在线一区二区| 亚洲欧美一区二区不卡| 亚洲精品一区在线观看| 欧美激情一区二区三区蜜桃视频 | 国产精品一区免费在线观看| 亚洲成人777| 亚洲精品国产a|