Author: cgutman
Date: Fri Aug 28 00:25:59 2009
New Revision: 42959
URL:
http://svn.reactos.org/svn/reactos?rev=42959&view=rev
Log:
- Check that AFD succeeded the create request
- Use NtCreateFile instead of ZwCreateFile
Modified:
trunk/reactos/dll/win32/msafd/misc/dllmain.c
Modified: trunk/reactos/dll/win32/msafd/misc/dllmain.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msafd/misc/dllma…
==============================================================================
--- trunk/reactos/dll/win32/msafd/misc/dllmain.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/msafd/misc/dllmain.c [iso-8859-1] Fri Aug 28 00:25:59 2009
@@ -235,18 +235,28 @@
ourselves after every call to NtDeviceIoControlFile. This is
because the kernel doesn't support overlapping synchronous I/O
requests (made from multiple threads) at this time (Sep 2005) */
- ZwCreateFile(&Sock,
- GENERIC_READ | GENERIC_WRITE | SYNCHRONIZE,
- &Object,
- &IOSB,
- NULL,
- 0,
- FILE_SHARE_READ | FILE_SHARE_WRITE, FILE_OPEN_IF,
- 0,
- EABuffer,
- SizeOfEA);
+ Status = NtCreateFile(&Sock,
+ GENERIC_READ | GENERIC_WRITE | SYNCHRONIZE,
+ &Object,
+ &IOSB,
+ NULL,
+ 0,
+ FILE_SHARE_READ | FILE_SHARE_WRITE,
+ FILE_OPEN_IF,
+ 0,
+ EABuffer,
+ SizeOfEA);
HeapFree(GlobalHeap, 0, EABuffer);
+
+ if (Status != STATUS_SUCCESS)
+ {
+ AFD_DbgPrint(MIN_TRACE, ("Failed to open socket\n"));
+
+ HeapFree(GlobalHeap, 0, Socket);
+
+ return MsafdReturnWithErrno(Status, lpErrno, 0, NULL);
+ }
/* Save Handle */
Socket->Handle = (SOCKET)Sock;