I use the FwpsInjectTransportReceiveAsync function to inject inbound packets in FWPM_LAYER_DATAGRAM_DATA_V4, the FwpsInjectTransportReceiveAsync function returns success, but the STATUS_PROTOCOL_UNREACHABLE(0xc0000023e) error appears in the injection completion callback function.
But when I turn off my windows firewall I don’t have this error anymore, does anyone know how to do this?
Rough code:
void NTAPI InboundDatagramDataComplete(
IN void* context,
IN OUT NET_BUFFER_LIST* netBufferList,
IN BOOLEAN dispatchLevel
){
if (!NT_SUCCESS(netBufferList->Status)){
DbgPrint("fail,Status=%x", netBufferList->Status);//Error 0xc0000023e will be printed here
}
FwpsFreeCloneNetBufferList(netBufferList, 0);
}
......
status = FwpsInjectTransportReceiveAsync(g_injectionHandle,
NULL, 0, 0, AF_INET,
inMetaValues->compartmentId,
interfaceIndex,
subInterfaceIndex,
pCloneNetBufferList,
InboundDatagramDataComplete,
NULL);
if (!NT_SUCCESS(status)) {
DbgPrint("FwpsInjectTransportReceiveAsync() fail\n");
goto Exit;
}
......