DDK docs states:
Calling this (PoStartNextPowerIrp) routine indicates that the driver is
finished with the previous power IRP, if any, and is ready to handle the
next power IRP. It must be called once by each driver for every
IRP_MN_QUERY_POWER or IRP_MN_SET_POWER request.
IRP_MN_WAIT_WAKE isn't mentioned there. I presume it is an omission and
function should be called. However, I'm a bit confused with BulkUsb sample
which calls it in its DispatchPower routine just before passing IRP to below
driver (which seem reasonable because nobody knows when it'll be completed)
and again in completion routine. If I haven't missed something, it is
called twice for the same IRP.
I wonder if it is an intention or a bug. It seems as a bug; also calling it
in completion routine seems dangerous because it can be called at any time
during other power IRP processing. I'm unsure about side effects -- is OS
able to identify double call for the same IRP and ignore it? What if there
isn't any other power IRP waiting -- is an extra call remembered possibly
causing problem hours later?
BTW, toaster sample doesn't call PoStartNextPowerIrp for IRP_MN_WAIT_WAKE at
all. Walter Oney in his generic code once in power dispatch.
Best regards,
Michal Vodicka
STMicroelectronics Design and Application s.r.o.
[michal.vodicka@st.com, http:://www.st.com]