MCPcopy Create free account
hub / github.com/BeneficialCode/WinArk / DbgkpSendApiMessage

Function DbgkpSendApiMessage

KernelLibrary/kDbgSys.cpp:1578–1610  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1576}
1577
1578NTSTATUS DbgkpSendApiMessage(
1579 ULONG Flag,
1580 PDBGKM_APIMSG ApiMsg
1581) {
1582 NTSTATUS status;
1583 BOOLEAN isSuspend;
1584 PEPROCESS Process;
1585 PETHREAD Thread;
1586
1587 isSuspend = FALSE;
1588
1589 if (Flag & 0x1) {
1590 isSuspend = DbgkpSuspendProcess();
1591 }
1592
1593 Thread = PsGetCurrentThread();
1594 Process = PsGetCurrentProcess();
1595
1596 ApiMsg->ReturnedStatus = STATUS_PENDING;
1597 status = DbgkpQueueMessage(
1598 (PEPROCESS)Process,
1599 (PETHREAD)Thread,
1600 ApiMsg,
1601 ((Flag & 0x2) << 0x5),
1602 nullptr
1603 );
1604 ZwFlushInstructionCache(ZwCurrentProcess(), 0, 0);
1605 if (isSuspend) {
1606 // PsThawProcess()
1607 }
1608
1609 return status;
1610}
1611
1612LOGICAL ExFastRefDereference(
1613 _Inout_ PEX_FAST_REF FastRef,

Callers 5

DbgkpPostModuleMessagesFunction · 0.85
DbgkMapViewOfSectionFunction · 0.85
DbgkUnMapViewOfSectionFunction · 0.85
DbgkCreateThreadFunction · 0.85
DbgkForwardExceptionFunction · 0.85

Calls 2

DbgkpSuspendProcessFunction · 0.85
DbgkpQueueMessageFunction · 0.85

Tested by

no test coverage detected