/* Get the Socket Structure associated to this Socket */
Socket = GetSocketStructure(Handle);
+ if (!Socket)
+ {
+ *lpErrno = WSAENOTSOCK;
+ return SOCKET_ERROR;
+ }
/* Allocate the Async Data Structure to pass on to the Thread later */
AsyncData = HeapAlloc(GetProcessHeap(), 0, sizeof(*AsyncData));
/* Get the Socket Structure associate to this Socket*/
Socket = GetSocketStructure(Handle);
+ if (!Socket)
+ {
+ *lpErrno = WSAENOTSOCK;
+ return SOCKET_ERROR;
+ }
Status = NtCreateEvent( &SockEvent, GENERIC_READ | GENERIC_WRITE,
NULL, 1, FALSE );
/* Return the Flags */
*ReceiveFlags = 0;
- if (Status == STATUS_PENDING)
- return MsafdReturnWithErrno(Status, lpErrno, IOSB->Information, lpNumberOfBytesRead);
-
switch (Status)
{
case STATUS_RECEIVE_EXPEDITED:
/* Get the Socket Structure associate to this Socket*/
Socket = GetSocketStructure(Handle);
+ if (!Socket)
+ {
+ *lpErrno = WSAENOTSOCK;
+ return SOCKET_ERROR;
+ }
Status = NtCreateEvent( &SockEvent, GENERIC_READ | GENERIC_WRITE,
NULL, 1, FALSE );
/* Return the Flags */
*ReceiveFlags = 0;
- if (Status == STATUS_PENDING)
- return MsafdReturnWithErrno(Status, lpErrno, IOSB->Information, lpNumberOfBytesRead);
-
switch (Status)
{
case STATUS_RECEIVE_EXPEDITED: *ReceiveFlags = MSG_OOB;
/* Get the Socket Structure associate to this Socket*/
Socket = GetSocketStructure(Handle);
+ if (!Socket)
+ {
+ *lpErrno = WSAENOTSOCK;
+ return SOCKET_ERROR;
+ }
Status = NtCreateEvent( &SockEvent, GENERIC_READ | GENERIC_WRITE,
NULL, 1, FALSE );
/* Get the Socket Structure associate to this Socket */
Socket = GetSocketStructure(Handle);
+ if (!Socket)
+ {
+ *lpErrno = WSAENOTSOCK;
+ return SOCKET_ERROR;
+ }
/* Bind us First */
if (Socket->SharedData.State == SocketOpen)