https://git.reactos.org/?p=reactos.git;a=commitdiff;h=bf5e33201eb75e515d875…
commit bf5e33201eb75e515d87594c45cf2c57af768d45
Author: Thomas Faber <thomas.faber(a)reactos.org>
AuthorDate: Sat Jan 6 18:11:18 2018 +0100
[MSAFD] Avoid magic numbers in NtCreateEvent calls.
---
dll/win32/msafd/misc/dllmain.c | 24 ++++++++++++------------
dll/win32/msafd/misc/event.c | 4 ++--
dll/win32/msafd/misc/sndrcv.c | 8 ++++----
3 files changed, 18 insertions(+), 18 deletions(-)
diff --git a/dll/win32/msafd/misc/dllmain.c b/dll/win32/msafd/misc/dllmain.c
index e456796147..c0de49ba28 100644
--- a/dll/win32/msafd/misc/dllmain.c
+++ b/dll/win32/msafd/misc/dllmain.c
@@ -640,7 +640,7 @@ WSPCloseSocket(IN SOCKET Handle,
Status = NtCreateEvent(&SockEvent,
EVENT_ALL_ACCESS,
NULL,
- 1,
+ SynchronizationEvent,
FALSE);
if(!NT_SUCCESS(Status))
@@ -883,7 +883,7 @@ WSPBind(SOCKET Handle,
Status = NtCreateEvent(&SockEvent,
EVENT_ALL_ACCESS,
NULL,
- 1,
+ SynchronizationEvent,
FALSE);
if (!NT_SUCCESS(Status))
@@ -998,7 +998,7 @@ WSPListen(SOCKET Handle,
Status = NtCreateEvent(&SockEvent,
EVENT_ALL_ACCESS,
NULL,
- 1,
+ SynchronizationEvent,
FALSE);
if( !NT_SUCCESS(Status) )
@@ -1145,7 +1145,7 @@ WSPSelect(IN int nfds,
Status = NtCreateEvent(&SockEvent,
EVENT_ALL_ACCESS,
NULL,
- 1,
+ SynchronizationEvent,
FALSE);
if(!NT_SUCCESS(Status))
@@ -1477,7 +1477,7 @@ WSPAccept(SOCKET Handle,
Status = NtCreateEvent(&SockEvent,
EVENT_ALL_ACCESS,
NULL,
- 1,
+ SynchronizationEvent,
FALSE);
if( !NT_SUCCESS(Status) )
@@ -1851,7 +1851,7 @@ WSPConnect(SOCKET Handle,
Status = NtCreateEvent(&SockEvent,
EVENT_ALL_ACCESS,
NULL,
- 1,
+ SynchronizationEvent,
FALSE);
if (!NT_SUCCESS(Status))
@@ -2087,7 +2087,7 @@ WSPShutdown(SOCKET Handle,
Status = NtCreateEvent(&SockEvent,
EVENT_ALL_ACCESS,
NULL,
- 1,
+ SynchronizationEvent,
FALSE);
if( !NT_SUCCESS(Status) )
@@ -2173,7 +2173,7 @@ WSPGetSockName(IN SOCKET Handle,
Status = NtCreateEvent(&SockEvent,
EVENT_ALL_ACCESS,
NULL,
- 1,
+ SynchronizationEvent,
FALSE);
if( !NT_SUCCESS(Status) )
@@ -2280,7 +2280,7 @@ WSPGetPeerName(IN SOCKET s,
Status = NtCreateEvent(&SockEvent,
EVENT_ALL_ACCESS,
NULL,
- 1,
+ SynchronizationEvent,
FALSE);
if( !NT_SUCCESS(Status) )
@@ -3176,7 +3176,7 @@ GetSocketInformation(PSOCKET_INFORMATION Socket,
Status = NtCreateEvent(&SockEvent,
EVENT_ALL_ACCESS,
NULL,
- 1,
+ SynchronizationEvent,
FALSE);
if( !NT_SUCCESS(Status) )
@@ -3301,7 +3301,7 @@ SetSocketInformation(PSOCKET_INFORMATION Socket,
Status = NtCreateEvent(&SockEvent,
EVENT_ALL_ACCESS,
NULL,
- 1,
+ SynchronizationEvent,
FALSE);
if( !NT_SUCCESS(Status) )
@@ -3435,7 +3435,7 @@ int CreateContext(PSOCKET_INFORMATION Socket)
Status = NtCreateEvent(&SockEvent,
EVENT_ALL_ACCESS,
NULL,
- 1,
+ SynchronizationEvent,
FALSE);
if( !NT_SUCCESS(Status) )
diff --git a/dll/win32/msafd/misc/event.c b/dll/win32/msafd/misc/event.c
index 467c039cb4..581e4ee195 100644
--- a/dll/win32/msafd/misc/event.c
+++ b/dll/win32/msafd/misc/event.c
@@ -38,7 +38,7 @@ WSPEventSelect(
}
Status = NtCreateEvent(&SockEvent, EVENT_ALL_ACCESS,
- NULL, 1, FALSE);
+ NULL, SynchronizationEvent, FALSE);
if (!NT_SUCCESS(Status)) return SOCKET_ERROR;
@@ -158,7 +158,7 @@ WSPEnumNetworkEvents(
}
Status = NtCreateEvent(&SockEvent, EVENT_ALL_ACCESS,
- NULL, 1, FALSE);
+ NULL, SynchronizationEvent, FALSE);
if( !NT_SUCCESS(Status) ) {
ERR("Could not make an event %x\n", Status);
diff --git a/dll/win32/msafd/misc/sndrcv.c b/dll/win32/msafd/misc/sndrcv.c
index 507bd47256..07fe8b1f1c 100644
--- a/dll/win32/msafd/misc/sndrcv.c
+++ b/dll/win32/msafd/misc/sndrcv.c
@@ -198,7 +198,7 @@ WSPRecv(SOCKET Handle,
}
Status = NtCreateEvent( &SockEvent, EVENT_ALL_ACCESS,
- NULL, 1, FALSE );
+ NULL, SynchronizationEvent, FALSE );
if( !NT_SUCCESS(Status) )
return -1;
@@ -417,7 +417,7 @@ WSPRecvFrom(SOCKET Handle,
}
Status = NtCreateEvent( &SockEvent, EVENT_ALL_ACCESS,
- NULL, 1, FALSE );
+ NULL, SynchronizationEvent, FALSE );
if( !NT_SUCCESS(Status) )
return -1;
@@ -601,7 +601,7 @@ WSPSend(SOCKET Handle,
}
Status = NtCreateEvent( &SockEvent, EVENT_ALL_ACCESS,
- NULL, 1, FALSE );
+ NULL, SynchronizationEvent, FALSE );
if( !NT_SUCCESS(Status) )
return -1;
@@ -802,7 +802,7 @@ WSPSendTo(SOCKET Handle,
Status = NtCreateEvent(&SockEvent,
EVENT_ALL_ACCESS,
- NULL, 1, FALSE);
+ NULL, SynchronizationEvent, FALSE);
if (!NT_SUCCESS(Status))
{