Exemplo n.º 1
0
VOID hook_init(struct _KDPC *Dpc, PVOID DeferredContext,PVOID SystemArgument1,PVOID SystemArgument2)
{
	UCHAR vec = (UCHAR)SystemArgument1;
	
	UNREFERENCED_PARAMETER(Dpc);
	UNREFERENCED_PARAMETER(DeferredContext);
	HookInterrupt(vec, (void(*)(void))SystemArgument2);
	InterlockedIncrement(&cpunos);
	if (cpunos >= KeNumberProcessors)
		KeSetEvent(&SyncIDT, 0, FALSE);
}
Exemplo n.º 2
0
//------------------------------------------------------------------------------
//
//  Function:  HookAndSetPriority
//
BOOL HookAndSetPriority(int hwIntNumber, FARPROC pfnHandler, BYTE intrPrio)
{
    BOOL retVal = FALSE;

    OALMSG(OAL_INTR&&OAL_FUNC, (L"+HookAndSetPriority(%d, 0x%08x, %d)\r\n",
                      hwIntNumber, pfnHandler, intrPrio));

    if(!HookInterrupt(hwIntNumber, pfnHandler))
    {
        OALMSG(OAL_ERROR, (L"ERROR: Unable to hook interrupt\r\n"));
        goto cleanUp;
    }

    IntrPrio[hwIntNumber] = intrPrio;
    retVal = TRUE;

cleanUp:
    OALMSG(OAL_INTR&&OAL_FUNC, (L"-HookAndSetPriority(rc = %d)\r\n", retVal));
    return retVal;
}