- Initialize the callback record before calling KeRegisterBugCheckCallback so NdisMRegisterAdapterShutdownHandler should work now

svn path=/branches/aicom-network-fixes/; revision=36335
This commit is contained in:
Cameron Gutman 2008-09-19 23:41:28 +00:00
parent face815dd6
commit 5620a8ecff

View file

@ -1143,7 +1143,6 @@ NdisMRegisterAdapterShutdownHandler(
* ShutdownHandler: Function to call to handle the bugcheck
* NOTES:
* - I'm not sure about ShutdownContext
* - FIXME - memory leak below
*/
{
PLOGICAL_ADAPTER Adapter = (PLOGICAL_ADAPTER)MiniportHandle;
@ -1164,9 +1163,10 @@ NdisMRegisterAdapterShutdownHandler(
BugcheckContext->ShutdownHandler = ShutdownHandler;
BugcheckContext->DriverContext = ShutdownContext;
/* not sure if this needs to be initialized or not... oh well, it's a leak. */
BugcheckContext->CallbackRecord = ExAllocatePool(NonPagedPool, sizeof(KBUGCHECK_CALLBACK_RECORD));
KeInitializeCallbackRecord(BugcheckContext->CallbackRecord);
KeRegisterBugCheckCallback(BugcheckContext->CallbackRecord, NdisIBugcheckCallback,
BugcheckContext, sizeof(BugcheckContext), (PUCHAR)"Ndis Miniport");
}