mirror of
https://github.com/reactos/reactos.git
synced 2024-09-15 07:05:04 +00:00
- Skip ObReferenceObjectByHandle if HandleArray[i].Handle is NULL
- Fail if ObReferenceObjectByHandle didn't succeed - Remove a bad ASSERT I added in my last commit svn path=/branches/aicom-network-fixes/; revision=35583
This commit is contained in:
parent
98c2a1ea67
commit
4f54a68190
|
@ -168,7 +168,7 @@ VOID UnlockBuffers( PAFD_WSABUF Buf, UINT Count, BOOL Address ) {
|
||||||
* pointers. This will allow the system to do proper alerting */
|
* pointers. This will allow the system to do proper alerting */
|
||||||
PAFD_HANDLE LockHandles( PAFD_HANDLE HandleArray, UINT HandleCount ) {
|
PAFD_HANDLE LockHandles( PAFD_HANDLE HandleArray, UINT HandleCount ) {
|
||||||
UINT i;
|
UINT i;
|
||||||
NTSTATUS Status;
|
NTSTATUS Status = STATUS_SUCCESS;
|
||||||
|
|
||||||
PAFD_HANDLE FileObjects = ExAllocatePool
|
PAFD_HANDLE FileObjects = ExAllocatePool
|
||||||
( NonPagedPool, HandleCount * sizeof(AFD_HANDLE) );
|
( NonPagedPool, HandleCount * sizeof(AFD_HANDLE) );
|
||||||
|
@ -177,13 +177,21 @@ PAFD_HANDLE LockHandles( PAFD_HANDLE HandleArray, UINT HandleCount ) {
|
||||||
HandleArray[i].Status = 0;
|
HandleArray[i].Status = 0;
|
||||||
HandleArray[i].Events = HandleArray[i].Events;
|
HandleArray[i].Events = HandleArray[i].Events;
|
||||||
FileObjects[i].Handle = 0;
|
FileObjects[i].Handle = 0;
|
||||||
Status = ObReferenceObjectByHandle
|
if( !HandleArray[i].Handle ) continue;
|
||||||
( (PVOID)HandleArray[i].Handle,
|
if( NT_SUCCESS(Status) ) {
|
||||||
FILE_ALL_ACCESS,
|
Status = ObReferenceObjectByHandle
|
||||||
NULL,
|
( (PVOID)HandleArray[i].Handle,
|
||||||
KernelMode,
|
FILE_ALL_ACCESS,
|
||||||
(PVOID*)&FileObjects[i].Handle,
|
NULL,
|
||||||
NULL );
|
KernelMode,
|
||||||
|
(PVOID*)&FileObjects[i].Handle,
|
||||||
|
NULL );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if( !NT_SUCCESS(Status) ) {
|
||||||
|
UnlockHandles( FileObjects, HandleCount );
|
||||||
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
return FileObjects;
|
return FileObjects;
|
||||||
|
@ -324,7 +332,6 @@ VOID SocketCalloutEnter( PAFD_FCB FCB ) {
|
||||||
|
|
||||||
VOID SocketCalloutLeave( PAFD_FCB FCB ) {
|
VOID SocketCalloutLeave( PAFD_FCB FCB ) {
|
||||||
ASSERT(FCB->Critical);
|
ASSERT(FCB->Critical);
|
||||||
ASSERT(!FCB->Locked);
|
|
||||||
FCB->Critical = FALSE;
|
FCB->Critical = FALSE;
|
||||||
SocketAcquireStateLock( FCB );
|
SocketAcquireStateLock( FCB );
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue