| 1576 | } |
| 1577 | |
| 1578 | NTSTATUS 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 | |
| 1612 | LOGICAL ExFastRefDereference( |
| 1613 | _Inout_ PEX_FAST_REF FastRef, |
no test coverage detected