IRQL

Hi all.
Could You help me. I can’t figure out what the SendFlags parameter for NdisFSendNetBufferLists should be when I call this function from the …DeviceIOControl procedure.
NdisFSendNetBufferLists(pFilter->FilterHandle,MyNetBufLists,NDIS_DEFAULT_PORT_NUMBER,0);
or
NdisFSendNetBufferLists(pFilter->FilterHandle,MyNetBufLists,NDIS_DEFAULT_PORT_NUMBER,NDIS_SEND_FLAGS_DISPATCH_LEVEL);
Thank you;
And the second question.
I only have 1 network card on my computer. But NDIS builds 4 driver modules. How can I figure out which module to use inside the …DeviceIOControl procedure to call NdisFSendNetBufferLists; Now this function (NdisFSendNetBufferLists) is called 4 times, but I only need for one. How can I determine which module to choose.
My NDIS filter driver receives Ethernet packets from a user mode program via IRP, creates MyNetBufLists, and calls NdisFSendNetBufferLists.

NDIS_SEND_FLAGS_DISPATCH_LEVEL
Specifies that the current IRQL is DISPATCH_LEVEL. For more information about this flag, see Dispatch IRQL Tracking.
https://learn.microsoft.com/en-us/windows-hardware/drivers/ddi/ndis/nf-ndis-ndissendnetbufferlists#ndis_send_flags_dispatch_level

Thank You Mr. Mark_Roddy. And what about second question?

But NDIS builds 4 driver modules.

Do you mean the system has 4 instances of your driver? How were you planning to identify the driver? Are you registering a driver interface?

Thanks for the answer.
No, I mean it’s 4 modules of the same NDIS filter network driver. And in the …DeviceIoControl routine when I list all modules

Link = FilterModuleList.Flink;
while (reference != &FilterModuleList) {



Link = Link->Flink;
}
I don’t know which module to use. Each driver module has its own context structure (pFilter) and inside the loop I have to store some values in this structure. But I can’t figure out which pFilter module to use.

This is a design question for your driver. Typically you would keep track
of the operational status and network addresses for each nic you are
filtering. Which nic you send your own initiated requests to depends on
that data.
Mark Roddy

Thank You.

I’m sorry, Mr. Mark_Roddy. Where can I read more about this. I’ve tried looking for it in the NDIS docs and elsewhere but haven’t found anything.

Look at filterDoInternalRequest in the filter sample. You have to query the nics by sending query oids to figure out which one(s) you want to use, or watch the oids and status indications being sent between protocol and nic layers, or likely a combination of both. But I have no idea what your actual use case is here, so you are really going to have to figure this out yourself. Assuming you need IP addresses see this page: https://learn.microsoft.com/en-us/windows-hardware/drivers/network/oid-gen-network-layer-addresses?redirectedfrom=MSDN

Thank You Mr. Mark_Roddy