当前位置: 首页>>代码示例>>C++>>正文


C++ KeBugCheck函数代码示例

本文整理汇总了C++中KeBugCheck函数的典型用法代码示例。如果您正苦于以下问题:C++ KeBugCheck函数的具体用法?C++ KeBugCheck怎么用?C++ KeBugCheck使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了KeBugCheck函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: KeStopSchedulingProcess

///////////////////////////////////////////////////////////////////////////////
//
//  KeStopSchedulingProcess
//
//      Stops scheduling specified process.
//
STATUS 
KeStopSchedulingProcess(
    PPROCESS Process
    )
{
    ASSERT(Process);

    //
    // determine in which list the process is located
    //
    switch (Process->State) {

        case running:
            //
            // mark as blocked so that it won't get scheduled again
            //
            Process->State = blocked;

            //
            // choose a different process to run
            //
            KepReschedule();
            break;
            
        case ready:
            // in a ready queue
            KepDequeueProcess(Process);
            break;
            
        case blocked:
            // in a blocked list
            if (!KepRemoveFromProcessList(&KepTimerList, Process)
                && !KepRemoveFromProcessList(&KepBlockedList, Process)) {

                KeBugCheck("KeStopSchedulingProcess: process blocked, but in no blocked queue");
            }
            
            break;

        default:
            KeBugCheck("KeStopSchedulingProcess: unhandled process state");
    }

    //
    // object no longer in our queues -> dereference
    //
    ObDereferenceObject(Process);

    return STATUS_SUCCESS;
}
开发者ID:wjcsharp,项目名称:arcos-os,代码行数:56,代码来源:scheduler.c

示例2: co_os_free_pages

void co_os_free_pages(void *ptr, unsigned int pages)
{
	if (ptr == 0)
		KeBugCheck(0x11117777 + 1);

	if (pages == 0)
		KeBugCheck(0x11117777 + 2);

#ifdef DEBUG_CO_OS_ALLOC
	co_debug_allocations("PAGE FREE %d(%u) - %p", allocs, pages, ptr);
	allocs--;
#endif
	MmFreeNonCachedMemory(ptr, pages * CO_ARCH_PAGE_SIZE);
}
开发者ID:matt81093,项目名称:Original-Colinux,代码行数:14,代码来源:alloc.c

示例3: WRITE_REGISTER_ULONG

VOID
WRITE_REGISTER_ULONG(
    volatile PULONG Register,
    ULONG Value
    )

/*++

Routine Description:

    Write to the specified register address.

Arguments:

    Register - Supplies a pointer to the register in EISA I/O space.
    Value  - The value to be written to the register.

Return Value:

    None

--*/

{
    //
    // We are assuming that the longword is aligned
    //
    ASSERT(((ULONG)Register & 0x3) == 0x0);

    if (IS_EISA_QVA(Register)) {

        *(volatile PULONG)(EISA_LONG_LEN |
			  ((ULONG)Register << EISA_BIT_SHIFT)) = Value;
        HalpMb;
	return;
    }

    //
    // ULONG operations are not supported on the combo chip
    //

    if (IS_COMBO_QVA(Register)) {

        KeBugCheck("Invalid Combo QVA in WRITE_REGISTER_ULONG\n");
    }

    KeBugCheck("Invalid QVA in WRITE_REGISTER_ULONG\n");
}
开发者ID:BillTheBest,项目名称:WinNT4,代码行数:48,代码来源:jxiouser.c

示例4: StackedMemoryAllFree

/** Reverses all operations recorded in the stacked memory object.
 *
 *  Reversing an operation means freeing memory the operation had allocated.
 *
 *  @param StackedMemory Stacked memory object.
 *
 *  @remark
 *  If the stacked memory object contains no operation records, nothing happens.
 */
VOID StackedMemoryAllFree(PUTILS_STACK StackedMemory)
{
   PUTILS_STACK_ITEM stackItem = NULL;
   PUTILS_STACKED_MEMORY_RECORD stackRecord = NULL;
   DEBUG_ENTER_FUNCTION("StackedMemory=0x%p", StackedMemory);

   while (!StackEmpty(StackedMemory)) {
      stackItem = StackPopNoFree(StackedMemory);
      stackRecord = CONTAINING_RECORD(stackItem, UTILS_STACKED_MEMORY_RECORD, StackItem);
      switch (stackRecord->AllocType) {
      case smatHeap:
         HeapMemoryFree(stackRecord->Address);
         break;
      case smatVirtual:
         VirtualMemoryFreeUser(stackRecord->Address);
         break;
      default:
         DEBUG_ERROR("Invalid stacked memory record type (%u)", stackRecord->AllocType);
         KeBugCheck(0);
         break;
      }

      HeapMemoryFree(stackRecord);
   }

   DEBUG_EXIT_FUNCTION_VOID();
   return;
}
开发者ID:MartinDrab,项目名称:VrtuleTree,代码行数:37,代码来源:utils-stacked-memory.c

示例5: MmMpwThreadMain

NTSTATUS NTAPI
MmMpwThreadMain(PVOID Ignored)
{
   NTSTATUS Status;
   ULONG PagesWritten;
   LARGE_INTEGER Timeout;

   Timeout.QuadPart = -50000000;

   for(;;)
   {
      Status = KeWaitForSingleObject(&MpwThreadEvent,
                                     0,
                                     KernelMode,
                                     FALSE,
                                     &Timeout);
      if (!NT_SUCCESS(Status))
      {
         DbgPrint("MpwThread: Wait failed\n");
         KeBugCheck(MEMORY_MANAGEMENT);
         return(STATUS_UNSUCCESSFUL);
      }

      PagesWritten = 0;

#ifndef NEWCC
	  // XXX arty -- we flush when evicting pages or destorying cache
	  // sections.
      CcRosFlushDirtyPages(128, &PagesWritten);
#endif
   }
}
开发者ID:HBelusca,项目名称:NasuTek-Odyssey,代码行数:32,代码来源:mminit.c

示例6: MmRebalanceMemoryConsumers

VOID
NTAPI
MmRebalanceMemoryConsumers(VOID)
{
   LONG Target;
   ULONG i;
   ULONG NrFreedPages;
   NTSTATUS Status;

   Target = (MiMinimumAvailablePages - MmAvailablePages) + MiPagesRequired;
   Target = max(Target, (LONG) MiMinimumPagesPerRun);

   for (i = 0; i < MC_MAXIMUM && Target > 0; i++)
   {
      if (MiMemoryConsumers[i].Trim != NULL)
      {
         Status = MiMemoryConsumers[i].Trim(Target, 0, &NrFreedPages);
         if (!NT_SUCCESS(Status))
         {
            KeBugCheck(MEMORY_MANAGEMENT);
         }
         Target = Target - NrFreedPages;
      }
   }
}
开发者ID:HBelusca,项目名称:NasuTek-Odyssey,代码行数:25,代码来源:balance.c

示例7: KiSetAffinityThread

KAFFINITY
FASTCALL
KiSetAffinityThread(IN PKTHREAD Thread,
                    IN KAFFINITY Affinity)
{
    KAFFINITY OldAffinity;

    /* Get the current affinity */
    OldAffinity = Thread->UserAffinity;

    /* Make sure that the affinity is valid */
    if (((Affinity & Thread->ApcState.Process->Affinity) != (Affinity)) ||
            (!Affinity))
    {
        /* Bugcheck the system */
        KeBugCheck(INVALID_AFFINITY_SET);
    }

    /* Update the new affinity */
    Thread->UserAffinity = Affinity;

    /* Check if system affinity is disabled */
    if (!Thread->SystemAffinityActive)
    {
#ifdef CONFIG_SMP
        /* FIXME: TODO */
        DPRINT1("Affinity support disabled!\n");
#endif
    }

    /* Return the old affinity */
    return OldAffinity;
}
开发者ID:SnakeSolidNL,项目名称:reactos,代码行数:33,代码来源:thrdschd.c

示例8: KepDequeueProcess

///////////////////////////////////////////////////////////////////////////////
//
//  KepDequeueProcess
//
//      Removes a process from the ready queue.
//
VOID
KepDequeueProcess(
    PPROCESS Process
    )
{
    PPROCESS currentProcess;
    
    ASSERT(Process->Priority < PROCESS_PRIORITY_LEVELS);

    currentProcess = KepReadyQueues[Process->Priority].First;

    //
    // handle special case when Process is the first in the queue
    //
    if (currentProcess == Process) {

        //
        // (if the process was the only one in the queue, it's NextPCB is NULL
        // and that's enough for us - no need to check for this special case)
        //
        KepReadyQueues[Process->Priority].First = currentProcess->NextPCB;

        currentProcess->NextPCB = NULL;

        return;
    }

    //
    // find the process in the queue
    //
    while (currentProcess->NextPCB) {

        if (currentProcess->NextPCB == Process) {

            //
            // unlink process from the list
            //
            currentProcess->NextPCB = Process->NextPCB;

            //
            // handle special case when this process was the last on the list
            //
            if (KepReadyQueues[Process->Priority].Last == Process) {

                KepReadyQueues[Process->Priority].Last = currentProcess;
            }

            Process->NextPCB = NULL;

            return;
        }

        //
        // move to the next queue entry
        //
        currentProcess = currentProcess->NextPCB;
    }

    KeBugCheck("KepDequeueProcess: process is not in the priority queue");
}
开发者ID:wjcsharp,项目名称:arcos-os,代码行数:66,代码来源:scheduler.c

示例9: MiTrimMemoryConsumer

ULONG
NTAPI
MiTrimMemoryConsumer(ULONG Consumer, ULONG InitialTarget)
{
    ULONG Target = InitialTarget;
    ULONG NrFreedPages = 0;
    NTSTATUS Status;

    /* Make sure we can trim this consumer */
    if (!MiMemoryConsumers[Consumer].Trim)
    {
        /* Return the unmodified initial target */
        return InitialTarget;
    }

    if (MiMemoryConsumers[Consumer].PagesUsed > MiMemoryConsumers[Consumer].PagesTarget)
    {
        /* Consumer page limit exceeded */
        Target = max(Target, MiMemoryConsumers[Consumer].PagesUsed - MiMemoryConsumers[Consumer].PagesTarget);
    }
    if (MmAvailablePages < MiMinimumAvailablePages)
    {
        /* Global page limit exceeded */
        Target = (ULONG)max(Target, MiMinimumAvailablePages - MmAvailablePages);
    }

    if (Target)
    {
        if (!InitialTarget)
        {
            /* If there was no initial target,
             * swap at least MiMinimumPagesPerRun */
            Target = max(Target, MiMinimumPagesPerRun);
        }

        /* Now swap the pages out */
        Status = MiMemoryConsumers[Consumer].Trim(Target, 0, &NrFreedPages);

        DPRINT("Trimming consumer %lu: Freed %lu pages with a target of %lu pages\n", Consumer, NrFreedPages, Target);

        if (!NT_SUCCESS(Status))
        {
            KeBugCheck(MEMORY_MANAGEMENT);
        }

        /* Update the target */
        if (NrFreedPages < Target)
            Target -= NrFreedPages;
        else
            Target = 0;

        /* Return the remaining pages needed to meet the target */
        return Target;
    }
    else
    {
        /* Initial target is zero and we don't have anything else to add */
        return 0;
    }
}
开发者ID:hackbunny,项目名称:reactos,代码行数:60,代码来源:balance.c

示例10: KeResumeProcess

///////////////////////////////////////////////////////////////////////////////
//
//  KeResumeProcess
//
//      Moves process from the blocked or sleeping list to the ready queue
//      and changes it's state to ready.
//
VOID
KeResumeProcess(
    PPROCESS Process
    )
{
    ASSERT(Process);
    ASSERT(Process->State == blocked);

    if (Process->ResumeMethod)
        Process->ResumeMethod(Process);

    //
    // remove process from the blocked list
    //
    if (!KepRemoveFromProcessList(&KepTimerList, Process)
        && !KepRemoveFromProcessList(&KepBlockedList, Process)) {

        KeBugCheck("KeResumeProcess: process blocked, but in no blocked queue");
    }

    //
    // add process to the scheduling queue
    //
    KepEnqueueProcess(Process);

    //
    // reschedule if this process has higher priority than the current process
    //
    if (Process->Priority > KeCurrentProcess->Priority) {
        KepReschedule();
    }   
}
开发者ID:wjcsharp,项目名称:arcos-os,代码行数:39,代码来源:scheduler.c

示例11: KeChangeProcessPriority

///////////////////////////////////////////////////////////////////////////////
//
//  KeChangeProcessPriority
//
//      Changes the priority of specified process.
//
VOID 
KeChangeProcessPriority(
    PPROCESS Process,
    ULONG NewPriority
    )
{
    ASSERT(Process);
    ASSERT(NewPriority < PROCESS_PRIORITY_LEVELS);
    
    switch (Process->State) {

        case running:
        case blocked:
            Process->Priority = NewPriority;
            break;

        case ready:
            KepDequeueProcess(Process);
            Process->Priority = NewPriority;
            KepEnqueueProcess(Process);
            break;

        default:
            KeBugCheck("KeChangeProcessPriority: unhandled process state");
    }
}
开发者ID:wjcsharp,项目名称:arcos-os,代码行数:32,代码来源:scheduler.c

示例12: PspSystemThreadStartup

VOID
NTAPI
PspSystemThreadStartup(IN PKSTART_ROUTINE StartRoutine,
                       IN PVOID StartContext)
{
    PETHREAD Thread;
    PSTRACE(PS_THREAD_DEBUG,
            "StartRoutine: %p StartContext: %p\n", StartRoutine, StartContext);

    /* Unlock the dispatcher Database */
    KeLowerIrql(PASSIVE_LEVEL);
    Thread = PsGetCurrentThread();

    /* Make sure the thread isn't gone */
    _SEH2_TRY
    {
        if (!(Thread->Terminated) && !(Thread->DeadThread))
        {
            /* Call the Start Routine */
            StartRoutine(StartContext);
        }
    }
    _SEH2_EXCEPT(PspUnhandledExceptionInSystemThread(_SEH2_GetExceptionInformation()))
    {
        /* Bugcheck if we got here */
        KeBugCheck(KMODE_EXCEPTION_NOT_HANDLED);
    }
    _SEH2_END;

    /* Exit the thread */
    PspTerminateThreadByPointer(Thread, STATUS_SUCCESS, TRUE);
}
开发者ID:hoangduit,项目名称:reactos,代码行数:32,代码来源:thread.c

示例13: CcScheduleReadAhead

VOID
NTAPI
CcScheduleReadAhead(IN PFILE_OBJECT FileObject,
                    IN PLARGE_INTEGER FileOffset,
                    IN ULONG Length)
{
    PWORK_QUEUE_WITH_READ_AHEAD WorkItem;

    DPRINT("Schedule read ahead %08x%08x:%x %wZ\n",
           FileOffset->HighPart,
           FileOffset->LowPart,
           Length,
           &FileObject->FileName);

    WorkItem = ExAllocatePool(NonPagedPool, sizeof(*WorkItem));
    if (!WorkItem) KeBugCheck(0);
    ObReferenceObject(FileObject);
    WorkItem->FileObject = FileObject;
    WorkItem->FileOffset = *FileOffset;
    WorkItem->Length = Length;

    ExInitializeWorkItem(((PWORK_QUEUE_ITEM)WorkItem),
                         (PWORKER_THREAD_ROUTINE)CcpReadAhead,
                         WorkItem);

    ExQueueWorkItem((PWORK_QUEUE_ITEM)WorkItem, DelayedWorkQueue);
    DPRINT("Done\n");
}
开发者ID:RPG-7,项目名称:reactos,代码行数:28,代码来源:cachesub.c

示例14: FsRtlInitializeTunnelCache

/*++
 * @name FsRtlDeleteTunnelCache
 * @unimplemented
 *
 * FILLME
 *
 * @param Cache
 *        FILLME
 *
 * @return None
 *
 * @remarks None
 *
 *--*/
VOID
NTAPI
FsRtlInitializeTunnelCache(IN PTUNNEL Cache)
{
    /* Unimplemented */
    KeBugCheck(FILE_SYSTEM);
}
开发者ID:Nevermore2015,项目名称:reactos,代码行数:21,代码来源:tunnel.c

示例15: HashTableUnlock

/** Unlocks a given bucket of a general hash table.
 *
 *  @param Table A hash table the bucket of which is to be unlocked.
 *  @param Index A zero-based index of the bucked to unlock.
 *  @param Irql A value of IRQL the caller had been running before the table
 *  was locked. The parameter is ignored for passive IRQL tables and tables access
 *  to whom is not synchronized.
 *
 *  @remark
 *  If access to the table is not synchronized, the routine performs nothing.
 *
 *  The @link(HASH_TABLE_IRQL_VALIDATE) is used to check whether the caller
 *  runs at a valid IRQL.
 */
static VOID HashTableUnlock(PHASH_TABLE Table, ULONG32 Index, KIRQL Irql)
{
   HASH_TABLE_IRQL_VALIDATE(Table);
   ASSERT(Index < Table->Size);

   switch (Table->Type) {
      case httPassiveLevel:
         ExReleaseResourceLite(&Table->Locks[Index]);
         KeLeaveCriticalRegion();
         break;
      case httDispatchLevel:
         if (Table->DispatchLockExclusive[Index]) {
            Table->DispatchLockExclusive[Index] = FALSE;
            KeReleaseSpinLock(&Table->DispatchLocks[Index], Irql);
         } else {
            KeReleaseSpinLock(&Table->DispatchLocks[Index], Irql);
         }
         break;
      case httNoSynchronization:
         break;
      default:
         DEBUG_ERROR("Invalid hash table type: %u", Table->Type);
         KeBugCheck(0);
         break;
   }

   return;
}
开发者ID:MartinDrab,项目名称:IRPMon,代码行数:42,代码来源:hash_table.c


注:本文中的KeBugCheck函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。