HyperDbg Debugger
Loading...
Searching...
No Matches
PlatformDpc.c File Reference

Implementation of cross platform APIs for Deferred Procedure Call (DPC) management. More...

#include "pch.h"

Functions

VOID PlatformDpcInitialize (PRKDPC Dpc, PKDEFERRED_ROUTINE DeferredRoutine, PVOID DeferredContext)
 Initialize a DPC object.
BOOLEAN PlatformDpcInsertQueueDpc (PRKDPC Dpc, PVOID SystemArgument1, PVOID SystemArgument2)
 Insert a DPC into the system DPC queue for execution.

Detailed Description

Implementation of cross platform APIs for Deferred Procedure Call (DPC) management.

Author
Sina Karvandi (sina@.nosp@m.hype.nosp@m.rdbg..nosp@m.org)
Version
0.19
Date
2026-05-09

Function Documentation

◆ PlatformDpcInitialize()

VOID PlatformDpcInitialize ( PRKDPC Dpc,
PKDEFERRED_ROUTINE DeferredRoutine,
PVOID DeferredContext )

Initialize a DPC object.

Parameters
DpcPointer to the KDPC structure to initialize
DeferredRoutineThe deferred procedure to be called
DeferredContextOptional context passed to the deferred routine
Returns
VOID
28{
29#if defined(_WIN32) || defined(_WIN64)
30
31 KeInitializeDpc(Dpc, DeferredRoutine, DeferredContext);
32
33#elif defined(__linux__)
34
35# error "Not yet implemented"
36
37#else
38
39# error "Unsupported platform"
40
41#endif
42}

◆ PlatformDpcInsertQueueDpc()

BOOLEAN PlatformDpcInsertQueueDpc ( PRKDPC Dpc,
PVOID SystemArgument1,
PVOID SystemArgument2 )

Insert a DPC into the system DPC queue for execution.

Parameters
DpcPointer to the initialized KDPC structure
SystemArgument1First system-defined argument passed to the deferred routine
SystemArgument2Second system-defined argument passed to the deferred routine
Returns
BOOLEAN TRUE if the DPC was successfully queued, FALSE if it was already in the queue
54{
55#if defined(_WIN32) || defined(_WIN64)
56
57 return KeInsertQueueDpc(Dpc, SystemArgument1, SystemArgument2);
58
59#elif defined(__linux__)
60
61# error "Not yet implemented"
62
63#else
64
65# error "Unsupported platform"
66
67#endif
68}