I’m doing a code review of an NDIS miniport. Without getting stuck on the
issue of *why*, this code stores references to the NDIS_HANDLE passed to
MiniportInitialize, and later invokes NDIS library functions (such as
NdisMIndicateStatus, NdisMEthIndicateReceiveComplete, etc.) in arbitrary
thread contexts. In other words, these NDIS library functions are NOT being
called in the context of miniport/wrapper callbacks, such as MiniportIsr,
etc.
Is this (guaranteed to be) safe? As long as the driver can guarantee that
none of these functions are being called with an adapter context after the
MiniportHalt callback completes, it seems like it should be. But I cannot
find a description, one way or the other, of whether this is acceptable or
not.
Empirically, the driver works, but I am interested in whether it will
continue to work, and under what conditions.
Thanks.
– arlie