Hey,
I just experienced a bugcheck in my NDIS driver in my MiniportInitialize()
function. I had been inspired by the netvmini sample's use of the two macros
MP_INC_REF() and MP_DEC_REF(). The latter calls NdisSetEvent() whenever the
reference count has reached zero.
However, this results in a problem in the MiniportInitialize() function. In
the sample, one of the last things done in the function is to call
NdisInitializeEvent(). But if initialization fails at an earlier point,
NdisInitializeEvent() is never executed and when MP_DEC_REF() is called to
clean-up memory a bugcheck occurs (as the event hasn't been initialized).
What's up with that?