mirror of
https://github.com/reactos/reactos.git
synced 2024-09-15 07:05:04 +00:00
- Make PortsStartup return NTSTATUS so we can make sure memory allocated succeeded
- Change the callers to check the return status svn path=/branches/aicom-network-fixes/; revision=36006
This commit is contained in:
parent
4c942b62d6
commit
2044568591
|
@ -10,7 +10,7 @@
|
|||
|
||||
#include "precomp.h"
|
||||
|
||||
VOID PortsStartup( PPORT_SET PortSet,
|
||||
NTSTATUS PortsStartup( PPORT_SET PortSet,
|
||||
UINT StartingPort,
|
||||
UINT PortsToManage ) {
|
||||
PortSet->StartingPort = StartingPort;
|
||||
|
@ -19,11 +19,13 @@ VOID PortsStartup( PPORT_SET PortSet,
|
|||
PortSet->PortsToOversee - 1;
|
||||
PortSet->ProtoBitBuffer =
|
||||
PoolAllocateBuffer( (PortSet->PortsToOversee + 7) / 8 );
|
||||
if(!PortSet->ProtoBitBuffer) return STATUS_INSUFFICIENT_RESOURCES;
|
||||
RtlInitializeBitMap( &PortSet->ProtoBitmap,
|
||||
PortSet->ProtoBitBuffer,
|
||||
PortSet->PortsToOversee );
|
||||
RtlClearAllBits( &PortSet->ProtoBitmap );
|
||||
ExInitializeFastMutex( &PortSet->Mutex );
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
VOID PortsShutdown( PPORT_SET PortSet ) {
|
||||
|
|
|
@ -455,7 +455,11 @@ NTSTATUS TCPStartup(VOID)
|
|||
return Status;
|
||||
}
|
||||
|
||||
PortsStartup( &TCPPorts, 1, 0xfffe );
|
||||
Status = PortsStartup( &TCPPorts, 1, 0xfffe );
|
||||
if( !NT_SUCCESS(Status) ) {
|
||||
TCPMemShutdown();
|
||||
return Status;
|
||||
}
|
||||
|
||||
RegisterOskitTCPEventHandlers( &EventHandlers );
|
||||
InitOskitTCP();
|
||||
|
|
|
@ -302,8 +302,12 @@ NTSTATUS UDPStartup(
|
|||
#ifdef __NTDRIVER__
|
||||
RtlZeroMemory(&UDPStats, sizeof(UDP_STATISTICS));
|
||||
#endif
|
||||
|
||||
NTSTATUS Status;
|
||||
|
||||
PortsStartup( &UDPPorts, 1, 0xfffe );
|
||||
Status = PortsStartup( &UDPPorts, 1, 0xfffe );
|
||||
|
||||
if( !NT_SUCCESS(Status) ) return Status;
|
||||
|
||||
/* Register this protocol with IP layer */
|
||||
IPRegisterProtocol(IPPROTO_UDP, UDPReceive);
|
||||
|
|
Loading…
Reference in a new issue