mirror of
https://github.com/reactos/reactos.git
synced 2025-05-07 02:41:22 +00:00
[NDIS]
- Fix a bugcheck caused when drivers pend requests NDIS-internal requests issued during initialization - Fixes Dell 1390 WLAN card (currently scanning via wlanconf isn't working, but connecting via SSID works) svn path=/trunk/; revision=66514
This commit is contained in:
parent
d607b14920
commit
e7607f493e
1 changed files with 45 additions and 11 deletions
|
@ -495,11 +495,25 @@ MiniRequestComplete(
|
|||
|
||||
MacBlock = (PNDIS_REQUEST_MAC_BLOCK)Request->MacReserved;
|
||||
|
||||
if( MacBlock->Binding->RequestCompleteHandler ) {
|
||||
(*MacBlock->Binding->RequestCompleteHandler)(
|
||||
MacBlock->Binding->ProtocolBindingContext,
|
||||
Request,
|
||||
Status);
|
||||
/* We may or may not be doing this request on behalf of an adapter binding */
|
||||
if (MacBlock->Binding != NULL)
|
||||
{
|
||||
/* We are, so invoke its request complete handler */
|
||||
if (MacBlock->Binding->RequestCompleteHandler != NULL)
|
||||
{
|
||||
(*MacBlock->Binding->RequestCompleteHandler)(
|
||||
MacBlock->Binding->ProtocolBindingContext,
|
||||
Request,
|
||||
Status);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/* We are doing this internally, so we'll signal this event we've stashed in the MacBlock */
|
||||
ASSERT(MacBlock->Unknown1 != NULL);
|
||||
ASSERT(MacBlock->Unknown3 == NULL);
|
||||
MacBlock->Unknown3 = (PVOID)Status;
|
||||
KeSetEvent(MacBlock->Unknown1, IO_NO_INCREMENT, FALSE);
|
||||
}
|
||||
|
||||
KeAcquireSpinLockAtDpcLevel(&Adapter->NdisMiniportBlock.Lock);
|
||||
|
@ -746,6 +760,8 @@ MiniSetInformation(
|
|||
{
|
||||
NDIS_STATUS NdisStatus;
|
||||
PNDIS_REQUEST NdisRequest;
|
||||
KEVENT Event;
|
||||
PNDIS_REQUEST_MAC_BLOCK MacBlock;
|
||||
|
||||
NDIS_DbgPrint(DEBUG_MINIPORT, ("Called.\n"));
|
||||
|
||||
|
@ -762,11 +778,19 @@ MiniSetInformation(
|
|||
NdisRequest->DATA.SET_INFORMATION.InformationBuffer = Buffer;
|
||||
NdisRequest->DATA.SET_INFORMATION.InformationBufferLength = Size;
|
||||
|
||||
/* We'll need to give the completion routine some way of letting us know
|
||||
* when it's finished. We'll stash a pointer to an event in the MacBlock */
|
||||
KeInitializeEvent(&Event, NotificationEvent, FALSE);
|
||||
MacBlock = (PNDIS_REQUEST_MAC_BLOCK)NdisRequest->MacReserved;
|
||||
MacBlock->Unknown1 = &Event;
|
||||
|
||||
NdisStatus = MiniDoRequest(Adapter, NdisRequest);
|
||||
|
||||
/* FIXME: Wait in pending case! */
|
||||
|
||||
ASSERT(NdisStatus != NDIS_STATUS_PENDING);
|
||||
if (NdisStatus == NDIS_STATUS_PENDING)
|
||||
{
|
||||
KeWaitForSingleObject(&Event, Executive, KernelMode, FALSE, NULL);
|
||||
NdisStatus = (NDIS_STATUS)MacBlock->Unknown3;
|
||||
}
|
||||
|
||||
*BytesRead = NdisRequest->DATA.SET_INFORMATION.BytesRead;
|
||||
|
||||
|
@ -796,6 +820,8 @@ MiniQueryInformation(
|
|||
{
|
||||
NDIS_STATUS NdisStatus;
|
||||
PNDIS_REQUEST NdisRequest;
|
||||
KEVENT Event;
|
||||
PNDIS_REQUEST_MAC_BLOCK MacBlock;
|
||||
|
||||
NDIS_DbgPrint(DEBUG_MINIPORT, ("Called.\n"));
|
||||
|
||||
|
@ -812,11 +838,19 @@ MiniQueryInformation(
|
|||
NdisRequest->DATA.QUERY_INFORMATION.InformationBuffer = Buffer;
|
||||
NdisRequest->DATA.QUERY_INFORMATION.InformationBufferLength = Size;
|
||||
|
||||
/* We'll need to give the completion routine some way of letting us know
|
||||
* when it's finished. We'll stash a pointer to an event in the MacBlock */
|
||||
KeInitializeEvent(&Event, NotificationEvent, FALSE);
|
||||
MacBlock = (PNDIS_REQUEST_MAC_BLOCK)NdisRequest->MacReserved;
|
||||
MacBlock->Unknown1 = &Event;
|
||||
|
||||
NdisStatus = MiniDoRequest(Adapter, NdisRequest);
|
||||
|
||||
/* FIXME: Wait in pending case! */
|
||||
|
||||
ASSERT(NdisStatus != NDIS_STATUS_PENDING);
|
||||
if (NdisStatus == NDIS_STATUS_PENDING)
|
||||
{
|
||||
KeWaitForSingleObject(&Event, Executive, KernelMode, FALSE, NULL);
|
||||
NdisStatus = (NDIS_STATUS)MacBlock->Unknown3;
|
||||
}
|
||||
|
||||
*BytesWritten = NdisRequest->DATA.QUERY_INFORMATION.BytesWritten;
|
||||
|
||||
|
|
Loading…
Reference in a new issue