Skip to content

Commit 277f271

Browse files
committed
- Firstly mark the IRP as pending, and only then release the lock (otherwise IRP is firstly completed/freed, and then tried to be marked as pending). This makes FireFox 1.5 working again.
- NULLify handle in case of TdiOpenDevice() failure. svn path=/trunk/; revision=27615
1 parent 90ce81d commit 277f271

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

reactos/drivers/network/afd/afd/lock.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,10 +237,15 @@ NTSTATUS NTAPI UnlockAndMaybeComplete
237237
UINT Information,
238238
PIO_COMPLETION_ROUTINE Completion,
239239
BOOL ShouldUnlock ) {
240-
SocketStateUnlock( FCB );
240+
241241
if( Status == STATUS_PENDING ) {
242+
/* We should firstly mark this IRP as pending, because
243+
otherwise it may be completed by StreamSocketConnectComplete()
244+
before we return from SocketStateUnlock(). */
242245
IoMarkIrpPending( Irp );
246+
SocketStateUnlock( FCB );
243247
} else {
248+
SocketStateUnlock( FCB );
244249
Irp->IoStatus.Status = Status;
245250
Irp->IoStatus.Information = Information;
246251
if( Completion )

reactos/drivers/network/afd/afd/tdi.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ static NTSTATUS TdiOpenDevice(
143143
}
144144
} else {
145145
AFD_DbgPrint(MIN_TRACE, ("ZwCreateFile() failed with status (0x%X)\n", Status));
146+
*Handle = NULL;
146147
}
147148

148149
return Status;

0 commit comments

Comments
 (0)