From 5620a8ecffa9b2a2d74a7604c139801b7937aeae Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Fri, 19 Sep 2008 23:41:28 +0000 Subject: [PATCH] - Initialize the callback record before calling KeRegisterBugCheckCallback so NdisMRegisterAdapterShutdownHandler should work now svn path=/branches/aicom-network-fixes/; revision=36335 --- drivers/network/ndis/ndis/miniport.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/network/ndis/ndis/miniport.c b/drivers/network/ndis/ndis/miniport.c index 76317028a6f..221af359b5b 100644 --- a/drivers/network/ndis/ndis/miniport.c +++ b/drivers/network/ndis/ndis/miniport.c @@ -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"); }