mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 12:43:05 +00:00
[MSAFD] Minor changes. Code style fixes. tabs->spaces. CORE-12104
svn path=/trunk/; revision=73176
This commit is contained in:
parent
2c118e1890
commit
781673fa3d
1 changed files with 93 additions and 100 deletions
|
@ -6,7 +6,7 @@
|
||||||
* PROGRAMMERS: Casper S. Hornstrup (chorns@users.sourceforge.net)
|
* PROGRAMMERS: Casper S. Hornstrup (chorns@users.sourceforge.net)
|
||||||
* Alex Ionescu (alex@relsoft.net)
|
* Alex Ionescu (alex@relsoft.net)
|
||||||
* REVISIONS:
|
* REVISIONS:
|
||||||
* CSH 15/06-2001 Created
|
* CSH 15/06/2001 - Created
|
||||||
* Alex 16/07/2004 - Complete Rewrite
|
* Alex 16/07/2004 - Complete Rewrite
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -18,10 +18,10 @@ WINE_DEFAULT_DEBUG_CHANNEL(msafd);
|
||||||
int
|
int
|
||||||
WSPAPI
|
WSPAPI
|
||||||
WSPEventSelect(
|
WSPEventSelect(
|
||||||
SOCKET Handle,
|
IN SOCKET Handle,
|
||||||
WSAEVENT hEventObject,
|
IN WSAEVENT hEventObject,
|
||||||
long lNetworkEvents,
|
IN long lNetworkEvents,
|
||||||
LPINT lpErrno)
|
OUT LPINT lpErrno)
|
||||||
{
|
{
|
||||||
IO_STATUS_BLOCK IOSB;
|
IO_STATUS_BLOCK IOSB;
|
||||||
AFD_EVENT_SELECT_INFO EventSelectInfo;
|
AFD_EVENT_SELECT_INFO EventSelectInfo;
|
||||||
|
@ -30,6 +30,8 @@ WSPEventSelect(
|
||||||
BOOLEAN BlockMode;
|
BOOLEAN BlockMode;
|
||||||
HANDLE SockEvent;
|
HANDLE SockEvent;
|
||||||
|
|
||||||
|
TRACE("WSPEventSelect (%lx) %lx %lx\n", Handle, hEventObject, lNetworkEvents);
|
||||||
|
|
||||||
/* Get the Socket Structure associate to this Socket*/
|
/* Get the Socket Structure associate to this Socket*/
|
||||||
Socket = GetSocketStructure(Handle);
|
Socket = GetSocketStructure(Handle);
|
||||||
if (!Socket)
|
if (!Socket)
|
||||||
|
@ -105,16 +107,12 @@ WSPEventSelect(
|
||||||
NULL,
|
NULL,
|
||||||
0);
|
0);
|
||||||
|
|
||||||
TRACE("AFD: %x\n", Status);
|
|
||||||
|
|
||||||
/* Wait for return */
|
/* Wait for return */
|
||||||
if (Status == STATUS_PENDING) {
|
if (Status == STATUS_PENDING) {
|
||||||
WaitForSingleObject(SockEvent, INFINITE);
|
WaitForSingleObject(SockEvent, INFINITE);
|
||||||
Status = IOSB.Status;
|
Status = IOSB.Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
TRACE("Waited\n");
|
|
||||||
|
|
||||||
NtClose (SockEvent);
|
NtClose (SockEvent);
|
||||||
|
|
||||||
if (Status != STATUS_SUCCESS)
|
if (Status != STATUS_SUCCESS)
|
||||||
|
@ -123,8 +121,6 @@ WSPEventSelect(
|
||||||
return MsafdReturnWithErrno(Status, lpErrno, 0, NULL);
|
return MsafdReturnWithErrno(Status, lpErrno, 0, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
TRACE("Closed event\n");
|
|
||||||
|
|
||||||
/* Set Socket Data*/
|
/* Set Socket Data*/
|
||||||
Socket->EventObject = hEventObject;
|
Socket->EventObject = hEventObject;
|
||||||
Socket->NetworkEvents = lNetworkEvents;
|
Socket->NetworkEvents = lNetworkEvents;
|
||||||
|
@ -151,6 +147,19 @@ WSPEnumNetworkEvents(
|
||||||
|
|
||||||
TRACE("Called (lpNetworkEvents %x)\n", lpNetworkEvents);
|
TRACE("Called (lpNetworkEvents %x)\n", lpNetworkEvents);
|
||||||
|
|
||||||
|
/* Get the Socket Structure associate to this Socket*/
|
||||||
|
Socket = GetSocketStructure(Handle);
|
||||||
|
if (!Socket)
|
||||||
|
{
|
||||||
|
if (lpErrno) *lpErrno = WSAENOTSOCK;
|
||||||
|
return SOCKET_ERROR;
|
||||||
|
}
|
||||||
|
if (!lpNetworkEvents)
|
||||||
|
{
|
||||||
|
if (lpErrno) *lpErrno = WSAEFAULT;
|
||||||
|
return SOCKET_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
Status = NtCreateEvent(&SockEvent, EVENT_ALL_ACCESS,
|
Status = NtCreateEvent(&SockEvent, EVENT_ALL_ACCESS,
|
||||||
NULL, 1, FALSE);
|
NULL, 1, FALSE);
|
||||||
|
|
||||||
|
@ -159,15 +168,6 @@ WSPEnumNetworkEvents(
|
||||||
return SOCKET_ERROR;
|
return SOCKET_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Get the Socket Structure associate to this Socket*/
|
|
||||||
Socket = GetSocketStructure(Handle);
|
|
||||||
if (!Socket)
|
|
||||||
{
|
|
||||||
NtClose(SockEvent);
|
|
||||||
if (lpErrno) *lpErrno = WSAENOTSOCK;
|
|
||||||
return SOCKET_ERROR;
|
|
||||||
}
|
|
||||||
|
|
||||||
EnumReq.Event = hEventObject;
|
EnumReq.Event = hEventObject;
|
||||||
|
|
||||||
/* Send IOCTL */
|
/* Send IOCTL */
|
||||||
|
@ -182,16 +182,12 @@ WSPEnumNetworkEvents(
|
||||||
NULL,
|
NULL,
|
||||||
0);
|
0);
|
||||||
|
|
||||||
TRACE("AFD: %x\n", Status);
|
|
||||||
|
|
||||||
/* Wait for return */
|
/* Wait for return */
|
||||||
if (Status == STATUS_PENDING) {
|
if (Status == STATUS_PENDING) {
|
||||||
WaitForSingleObject(SockEvent, INFINITE);
|
WaitForSingleObject(SockEvent, INFINITE);
|
||||||
Status = IOSB.Status;
|
Status = IOSB.Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
TRACE("Waited\n");
|
|
||||||
|
|
||||||
NtClose (SockEvent);
|
NtClose (SockEvent);
|
||||||
|
|
||||||
if (Status != STATUS_SUCCESS)
|
if (Status != STATUS_SUCCESS)
|
||||||
|
@ -200,9 +196,6 @@ WSPEnumNetworkEvents(
|
||||||
return MsafdReturnWithErrno(Status, lpErrno, 0, NULL);
|
return MsafdReturnWithErrno(Status, lpErrno, 0, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
TRACE("Closed event\n");
|
|
||||||
TRACE("About to touch struct at %x (%d)\n", lpNetworkEvents, sizeof(*lpNetworkEvents));
|
|
||||||
|
|
||||||
lpNetworkEvents->lNetworkEvents = 0;
|
lpNetworkEvents->lNetworkEvents = 0;
|
||||||
|
|
||||||
/* Set Events to wait for */
|
/* Set Events to wait for */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue