Author: jgardou
Date: Mon Nov 10 13:06:48 2014
New Revision: 65355
URL:
http://svn.reactos.org/svn/reactos?rev=65355&view=rev
Log:
[MSAFD]
- Use wine debug output routines instead of blunt DbgPrint
This avoids the horrid "MSAFD: STATUS_XXX" which doesn't help.
Removed:
trunk/reactos/dll/win32/msafd/include/debug.h
Modified:
trunk/reactos/dll/win32/msafd/CMakeLists.txt
trunk/reactos/dll/win32/msafd/misc/dllmain.c
trunk/reactos/dll/win32/msafd/misc/event.c
trunk/reactos/dll/win32/msafd/misc/helpers.c
trunk/reactos/dll/win32/msafd/misc/sndrcv.c
trunk/reactos/dll/win32/msafd/misc/stubs.c
trunk/reactos/dll/win32/msafd/msafd.h
Modified: trunk/reactos/dll/win32/msafd/CMakeLists.txt
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msafd/CMakeLists…
==============================================================================
--- trunk/reactos/dll/win32/msafd/CMakeLists.txt [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/msafd/CMakeLists.txt [iso-8859-1] Mon Nov 10 13:06:48 2014
@@ -1,6 +1,5 @@
include_directories(
- BEFORE include
${REACTOS_SOURCE_DIR}/include/reactos/drivers)
spec2def(msafd.dll msafd.spec)
@@ -19,6 +18,7 @@
${CMAKE_CURRENT_BINARY_DIR}/msafd.def)
set_module_type(msafd win32dll UNICODE)
+target_link_libraries(msafd wine)
add_importlibs(msafd advapi32 msvcrt kernel32 ntdll)
add_pch(msafd msafd.h SOURCE)
add_cd_file(TARGET msafd DESTINATION reactos/system32 FOR all)
Removed: trunk/reactos/dll/win32/msafd/include/debug.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msafd/include/de…
==============================================================================
--- trunk/reactos/dll/win32/msafd/include/debug.h [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/msafd/include/debug.h (removed)
@@ -1,67 +0,0 @@
-/*
- * COPYRIGHT: See COPYING in the top level directory
- * PROJECT: ReactOS Ancillary Function Driver DLL
- * FILE: include/debug.h
- * PURPOSE: Debugging support macros
- * DEFINES: DBG - Enable debug output
- * NASSERT - Disable assertions
- */
-#ifndef __DEBUG_H
-#define __DEBUG_H
-
-#define NORMAL_MASK 0x000000FF
-#define SPECIAL_MASK 0xFFFFFF00
-#define MIN_TRACE 0x00000001
-#define MID_TRACE 0x00000002
-#define MAX_TRACE 0x00000003
-
-#define DEBUG_CHECK 0x00000100
-#define DEBUG_ULTRA 0xFFFFFFFF
-
-#ifdef ASSERT
-#undef ASSERT
-#endif
-
-#if DBG
-
-extern DWORD DebugTraceLevel;
-
-#define AFD_DbgPrint(_t_, _x_) \
- if (((DebugTraceLevel & NORMAL_MASK) >= _t_) || \
- ((DebugTraceLevel & _t_) > NORMAL_MASK)) { \
- DbgPrint("(%hS:%d)(%hS) ", __FILE__, __LINE__, __FUNCTION__); \
- DbgPrint _x_; \
- }
-
-#ifdef NASSERT
-#define ASSERT(x)
-#else /* NASSERT */
-#define ASSERT(x) if (!(x)) { AFD_DbgPrint(MIN_TRACE, ("Assertion "#x"
failed at %s:%d\n", __FILE__, __LINE__)); ExitProcess(0); }
-#endif /* NASSERT */
-
-#else /* DBG */
-
-#define AFD_DbgPrint(_t_, _x_)
-
-#define ASSERT_IRQL(x)
-#define ASSERT(x)
-
-#endif /* DBG */
-
-#ifdef assert
-#undef assert
-#endif
-#define assert(x) ASSERT(x)
-
-
-#define UNIMPLEMENTED \
- AFD_DbgPrint(MIN_TRACE, ("is unimplemented, please try again later.\n"));
-
-#define CHECKPOINT \
- AFD_DbgPrint(DEBUG_CHECK, ("\n"));
-
-#define CP CHECKPOINT
-
-#endif /* __DEBUG_H */
-
-/* EOF */
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] Mon Nov 10 13:06:48 2014
@@ -14,10 +14,8 @@
#include <winuser.h>
-#if DBG
-//DWORD DebugTraceLevel = DEBUG_ULTRA;
-DWORD DebugTraceLevel = 0;
-#endif /* DBG */
+#include <wine/debug.h>
+WINE_DEFAULT_DEBUG_CHANNEL(msafd);
HANDLE GlobalHeap;
WSPUPCALLTABLE Upcalls;
@@ -71,9 +69,8 @@
LARGE_INTEGER GroupData;
INT Status;
- AFD_DbgPrint(MAX_TRACE, ("Creating Socket, getting TDI Name\n"));
- AFD_DbgPrint(MAX_TRACE, ("AddressFamily (%d) SocketType (%d) Protocol
(%d).\n",
- AddressFamily, SocketType, Protocol));
+ TRACE("Creating Socket, getting TDI Name - AddressFamily (%d) SocketType (%d)
Protocol (%d).\n",
+ AddressFamily, SocketType, Protocol);
/* Get Helper Data and Transport */
Status = SockGetTdiName (&AddressFamily,
@@ -89,7 +86,7 @@
/* Check for error */
if (Status != NO_ERROR)
{
- AFD_DbgPrint(MID_TRACE,("SockGetTdiName: Status %x\n", Status));
+ ERR("SockGetTdiName: Status %x\n", Status);
goto error;
}
@@ -131,7 +128,7 @@
if( Socket->SharedData.SocketType == SOCK_DGRAM ||
Socket->SharedData.SocketType == SOCK_RAW )
{
- AFD_DbgPrint(MID_TRACE,("Connectionless socket\n"));
+ TRACE("Connectionless socket\n");
Socket->SharedData.ServiceFlags1 |= XP1_CONNECTIONLESS;
}
@@ -249,9 +246,9 @@
HeapFree(GlobalHeap, 0, EABuffer);
- if (Status != STATUS_SUCCESS)
- {
- AFD_DbgPrint(MIN_TRACE, ("Failed to open socket\n"));
+ if (!NT_SUCCESS(Status))
+ {
+ ERR("Failed to open socket. Status 0x%08x\n", Status);
HeapFree(GlobalHeap, 0, Socket);
@@ -295,12 +292,12 @@
Upcalls.lpWPUModifyIFSHandle(1, (SOCKET)Sock, lpErrno);
/* Return Socket Handle */
- AFD_DbgPrint(MID_TRACE,("Success %x\n", Sock));
+ TRACE("Success %x\n", Sock);
return (SOCKET)Sock;
error:
- AFD_DbgPrint(MID_TRACE,("Ending %x\n", Status));
+ ERR("Ending %x\n", Status);
if( Socket )
HeapFree(GlobalHeap, 0, Socket);
@@ -334,56 +331,44 @@
case STATUS_BUFFER_TOO_SMALL:
case STATUS_BUFFER_OVERFLOW:
- DbgPrint("MSAFD: STATUS_BUFFER_TOO_SMALL/STATUS_BUFFER_OVERFLOW\n");
return WSAEMSGSIZE;
case STATUS_NO_MEMORY:
case STATUS_INSUFFICIENT_RESOURCES:
- DbgPrint("MSAFD: STATUS_NO_MEMORY/STATUS_INSUFFICIENT_RESOURCES\n");
return WSAENOBUFS;
case STATUS_INVALID_CONNECTION:
- DbgPrint("MSAFD: STATUS_INVALID_CONNECTION\n");
return WSAEAFNOSUPPORT;
case STATUS_INVALID_ADDRESS:
- DbgPrint("MSAFD: STATUS_INVALID_ADDRESS\n");
return WSAEADDRNOTAVAIL;
case STATUS_REMOTE_NOT_LISTENING:
- DbgPrint("MSAFD: STATUS_REMOTE_NOT_LISTENING\n");
return WSAECONNREFUSED;
case STATUS_NETWORK_UNREACHABLE:
- DbgPrint("MSAFD: STATUS_NETWORK_UNREACHABLE\n");
return WSAENETUNREACH;
case STATUS_INVALID_PARAMETER:
- DbgPrint("MSAFD: STATUS_INVALID_PARAMETER\n");
return WSAEINVAL;
case STATUS_CANCELLED:
- DbgPrint("MSAFD: STATUS_CANCELLED\n");
return WSA_OPERATION_ABORTED;
case STATUS_ADDRESS_ALREADY_EXISTS:
- DbgPrint("MSAFD: STATUS_ADDRESS_ALREADY_EXISTS\n");
return WSAEADDRINUSE;
case STATUS_LOCAL_DISCONNECT:
- DbgPrint("MSAFD: STATUS_LOCAL_DISCONNECT\n");
return WSAECONNABORTED;
case STATUS_REMOTE_DISCONNECT:
- DbgPrint("MSAFD: STATUS_REMOTE_DISCONNECT\n");
return WSAECONNRESET;
case STATUS_ACCESS_VIOLATION:
- DbgPrint("MSAFD: STATUS_ACCESS_VIOLATION\n");
return WSAEFAULT;
default:
- DbgPrint("MSAFD: Unhandled NTSTATUS value: 0x%x\n", Status);
+ ERR("MSAFD: Unhandled NTSTATUS value: 0x%x\n", Status);
return WSAENETDOWN;
}
}
@@ -417,8 +402,10 @@
FALSE);
if(!NT_SUCCESS(Status))
+ {
+ ERR("NtCreateEvent failed: 0x%08x", Status);
return SOCKET_ERROR;
-
+ }
/* Get the Socket Structure associate to this Socket*/
Socket = GetSocketStructure(Handle);
if (!Socket)
@@ -439,6 +426,7 @@
if (Status)
{
if (lpErrno) *lpErrno = Status;
+ ERR("WSHNotify failed. Error 0x%#x", Status);
NtClose(SockEvent);
return SOCKET_ERROR;
}
@@ -447,6 +435,7 @@
/* If a Close is already in Process, give up */
if (Socket->SharedData.State == SocketClosed)
{
+ WARN("Socket is closing.\n");
NtClose(SockEvent);
*lpErrno = WSAENOTSOCK;
return SOCKET_ERROR;
@@ -497,6 +486,7 @@
*/
if (Socket->SharedData.NonBlocking)
{
+ WARN("Would block!\n");
NtClose(SockEvent);
Socket->SharedData.State = OldState;
*lpErrno = WSAEWOULDBLOCK;
@@ -828,23 +818,21 @@
if ( HandleCount == 0 )
{
- AFD_DbgPrint(MAX_TRACE,("HandleCount: %u. Return SOCKET_ERROR\n",
- HandleCount));
+ WARN("No handles! Returning SOCKET_ERROR\n", HandleCount);
if (lpErrno) *lpErrno = WSAEINVAL;
return SOCKET_ERROR;
}
PollBufferSize = sizeof(*PollInfo) + ((HandleCount - 1) * sizeof(AFD_HANDLE));
- AFD_DbgPrint(MID_TRACE,("HandleCount: %u BufferSize: %u\n",
- HandleCount, PollBufferSize));
+ TRACE("HandleCount: %u BufferSize: %u\n", HandleCount, PollBufferSize);
/* Convert Timeout to NT Format */
if (timeout == NULL)
{
Timeout.u.LowPart = -1;
Timeout.u.HighPart = 0x7FFFFFFF;
- AFD_DbgPrint(MAX_TRACE,("Infinite timeout\n"));
+ TRACE("Infinite timeout\n");
}
else
{
@@ -859,9 +847,9 @@
if (lpErrno) *lpErrno = WSAEINVAL;
return SOCKET_ERROR;
}
- AFD_DbgPrint(MAX_TRACE,("Timeout: Orig %d.%06d kernel %d\n",
+ TRACE("Timeout: Orig %d.%06d kernel %d\n",
timeout->tv_sec, timeout->tv_usec,
- Timeout.u.LowPart));
+ Timeout.u.LowPart);
}
Status = NtCreateEvent(&SockEvent,
@@ -870,8 +858,11 @@
1,
FALSE);
- if( !NT_SUCCESS(Status) )
+ if(!NT_SUCCESS(Status))
+ {
+ ERR("NtCreateEvent failed, 0x%08x\n", Status);
return SOCKET_ERROR;
+ }
/* Allocate */
PollBuffer = HeapAlloc(GlobalHeap, 0, PollBufferSize);
@@ -935,7 +926,7 @@
PollInfo,
PollBufferSize);
- AFD_DbgPrint(MID_TRACE,("DeviceIoControlFile => %x\n", Status));
+ TRACE("DeviceIoControlFile => %x\n", Status);
/* Wait for Completition */
if (Status == STATUS_PENDING)
@@ -968,9 +959,9 @@
case AFD_EVENT_ABORT:
case AFD_EVENT_ACCEPT:
case AFD_EVENT_CLOSE:
- AFD_DbgPrint(MID_TRACE,("Event %x on handle %x\n",
- PollInfo->Handles[i].Events,
- PollInfo->Handles[i].Handle));
+ TRACE("Event %x on handle %x\n",
+ PollInfo->Handles[i].Events,
+ PollInfo->Handles[i].Handle);
if (! HandleCounted)
{
OutCount++;
@@ -981,9 +972,9 @@
break;
case AFD_EVENT_SEND:
case AFD_EVENT_CONNECT:
- AFD_DbgPrint(MID_TRACE,("Event %x on handle %x\n",
- PollInfo->Handles[i].Events,
- PollInfo->Handles[i].Handle));
+ TRACE("Event %x on handle %x\n",
+ PollInfo->Handles[i].Events,
+ PollInfo->Handles[i].Handle);
if (! HandleCounted)
{
OutCount++;
@@ -994,9 +985,9 @@
break;
case AFD_EVENT_OOB_RECEIVE:
case AFD_EVENT_CONNECT_FAIL:
- AFD_DbgPrint(MID_TRACE,("Event %x on handle %x\n",
- PollInfo->Handles[i].Events,
- PollInfo->Handles[i].Handle));
+ TRACE("Event %x on handle %x\n",
+ PollInfo->Handles[i].Events,
+ PollInfo->Handles[i].Handle);
if (! HandleCounted)
{
OutCount++;
@@ -1024,10 +1015,10 @@
*lpErrno = WSAEINVAL;
break;
}
- AFD_DbgPrint(MID_TRACE,("*lpErrno = %x\n", *lpErrno));
- }
-
- AFD_DbgPrint(MID_TRACE,("%d events\n", OutCount));
+ TRACE("*lpErrno = %x\n", *lpErrno);
+ }
+
+ TRACE("%d events\n", OutCount);
return OutCount;
}
@@ -1402,7 +1393,7 @@
/* Re-enable Async Event */
SockReenableAsyncSelectEvent(Socket, FD_ACCEPT);
- AFD_DbgPrint(MID_TRACE,("Socket %x\n", AcceptSocket));
+ TRACE("Socket %x\n", AcceptSocket);
if (Status == STATUS_SUCCESS && (Socket->HelperEvents &
WSH_NOTIFY_ACCEPT))
{
@@ -1457,7 +1448,7 @@
if (!NT_SUCCESS(Status))
return MsafdReturnWithErrno(Status, lpErrno, 0, NULL);
- AFD_DbgPrint(MID_TRACE,("Called\n"));
+ TRACE("Called\n");
/* Get the Socket Structure associate to this Socket*/
Socket = GetSocketStructure(Handle);
@@ -1578,7 +1569,7 @@
/* FIXME: Handle Async Connect */
if (Socket->SharedData.NonBlocking)
{
- AFD_DbgPrint(MIN_TRACE, ("Async Connect UNIMPLEMENTED!\n"));
+ ERR("Async Connect UNIMPLEMENTED!\n");
}
/* Send IOCTL */
@@ -1626,7 +1617,7 @@
}
}
- AFD_DbgPrint(MID_TRACE,("Ending\n"));
+ TRACE("Ending\n");
notify:
if (ConnectInfo) HeapFree(GetProcessHeap(), 0, ConnectInfo);
@@ -1692,7 +1683,7 @@
if( !NT_SUCCESS(Status) )
return -1;
- AFD_DbgPrint(MID_TRACE,("Called\n"));
+ TRACE("Called\n");
/* Get the Socket Structure associate to this Socket*/
Socket = GetSocketStructure(Handle);
@@ -1742,7 +1733,7 @@
Status = IOSB.Status;
}
- AFD_DbgPrint(MID_TRACE,("Ending\n"));
+ TRACE("Ending\n");
NtClose( SockEvent );
@@ -1834,9 +1825,9 @@
SocketAddress->Address[0].Address,
SocketAddress->Address[0].AddressLength);
*NameLength = Socket->SharedData.SizeOfLocalAddress;
- AFD_DbgPrint (MID_TRACE, ("NameLength %d Address: %x Port %x\n",
+ TRACE("NameLength %d Address: %x Port %x\n",
*NameLength, ((struct sockaddr_in *)Name)->sin_addr.s_addr,
- ((struct sockaddr_in *)Name)->sin_port));
+ ((struct sockaddr_in *)Name)->sin_port);
HeapFree(GlobalHeap, 0, TdiAddress);
return 0;
}
@@ -1941,9 +1932,9 @@
SocketAddress->Address[0].Address,
SocketAddress->Address[0].AddressLength);
*NameLength = Socket->SharedData.SizeOfRemoteAddress;
- AFD_DbgPrint (MID_TRACE, ("NameLength %d Address: %x Port %x\n",
+ TRACE("NameLength %d Address: %x Port %x\n",
*NameLength, ((struct sockaddr_in *)Name)->sin_addr.s_addr,
- ((struct sockaddr_in *)Name)->sin_port));
+ ((struct sockaddr_in *)Name)->sin_port);
HeapFree(GlobalHeap, 0, SocketAddress);
return 0;
}
@@ -2085,7 +2076,7 @@
return SOCKET_ERROR;
}
- AFD_DbgPrint(MID_TRACE, ("Called\n"));
+ TRACE("Called\n");
switch (Level)
{
@@ -2292,7 +2283,7 @@
}
/* TODO: The total per-socket buffer space reserved for sends */
- AFD_DbgPrint(MIN_TRACE,("Setting send buf to %x is not implemented
yet\n", optval));
+ ERR("Setting send buf to %x is not implemented yet\n", optval);
return 0;
case SO_SNDTIMEO:
@@ -2326,7 +2317,7 @@
default:
/* Obviously this is a hack */
- DbgPrint("MSAFD: Set unknown optname %x\n", optname);
+ ERR("MSAFD: Set unknown optname %x\n", optname);
return 0;
}
}
@@ -2365,7 +2356,7 @@
{
NTSTATUS Status;
- AFD_DbgPrint(MAX_TRACE, ("wVersionRequested (0x%X) \n",
wVersionRequested));
+ ERR("wVersionRequested (0x%X) \n", wVersionRequested);
Status = NO_ERROR;
Upcalls = UpcallTable;
@@ -2405,7 +2396,7 @@
lpWSPData->wHighVersion = MAKEWORD(2, 2);
}
- AFD_DbgPrint(MAX_TRACE, ("Status (%d).\n", Status));
+ TRACE("Status (%d).\n", Status);
return Status;
}
@@ -2423,8 +2414,7 @@
WSPCleanup(OUT LPINT lpErrno)
{
- AFD_DbgPrint(MAX_TRACE, ("\n"));
- AFD_DbgPrint(MAX_TRACE, ("Leaving.\n"));
+ TRACE("Leaving.\n");
*lpErrno = NO_ERROR;
return 0;
@@ -2660,7 +2650,7 @@
2); // Allow 2 threads only
if (!NT_SUCCESS(Status))
{
- AFD_DbgPrint(MID_TRACE,("Failed to create completion port\n"));
+ ERR("Failed to create completion port: 0x%08x\n", Status);
return FALSE;
}
/* Protect Handle */
@@ -3093,7 +3083,7 @@
{
case DLL_PROCESS_ATTACH:
- AFD_DbgPrint(MAX_TRACE, ("Loading MSAFD.DLL \n"));
+ TRACE("Loading MSAFD.DLL \n");
/* Don't need thread attach notifications
so disable them to improve performance */
@@ -3108,7 +3098,7 @@
/* Initialize the lock that protects our socket list */
InitializeCriticalSection(&SocketListLock);
- AFD_DbgPrint(MAX_TRACE, ("MSAFD.DLL has been loaded\n"));
+ TRACE("MSAFD.DLL has been loaded\n");
break;
@@ -3126,7 +3116,7 @@
break;
}
- AFD_DbgPrint(MAX_TRACE, ("DllMain of msafd.dll (leaving)\n"));
+ TRACE("DllMain of msafd.dll (leaving)\n");
return TRUE;
}
Modified: trunk/reactos/dll/win32/msafd/misc/event.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msafd/misc/event…
==============================================================================
--- trunk/reactos/dll/win32/msafd/misc/event.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/msafd/misc/event.c [iso-8859-1] Mon Nov 10 13:06:48 2014
@@ -11,6 +11,9 @@
*/
#include <msafd.h>
+
+#include <wine/debug.h>
+WINE_DEFAULT_DEBUG_CHANNEL(msafd);
int
WSPAPI
@@ -103,28 +106,31 @@
NULL,
0);
- AFD_DbgPrint(MID_TRACE,("AFD: %x\n", Status));
+ TRACE("AFD: %x\n", Status);
/* Wait for return */
if (Status == STATUS_PENDING) {
- WaitForSingleObject(SockEvent, INFINITE);
+ WaitForSingleObject(SockEvent, INFINITE);
Status = IOSB.Status;
}
- AFD_DbgPrint(MID_TRACE,("Waited\n"));
+ TRACE("Waited\n");
NtClose( SockEvent );
if (Status != STATUS_SUCCESS)
+ {
+ ERR("Got status 0x%08x.\n", Status);
return MsafdReturnWithErrno(Status, lpErrno, 0, NULL);
-
- AFD_DbgPrint(MID_TRACE,("Closed event\n"));
+ }
+
+ TRACE("Closed event\n");
/* Set Socket Data*/
Socket->EventObject = hEventObject;
Socket->NetworkEvents = lNetworkEvents;
- AFD_DbgPrint(MID_TRACE,("Leaving\n"));
+ TRACE("Leaving\n");
return 0;
}
@@ -144,14 +150,14 @@
NTSTATUS Status;
HANDLE SockEvent;
- AFD_DbgPrint(MID_TRACE,("Called (lpNetworkEvents %x)\n",
lpNetworkEvents));
+ TRACE("Called (lpNetworkEvents %x)\n", lpNetworkEvents);
Status = NtCreateEvent( &SockEvent, EVENT_ALL_ACCESS,
NULL, 1, FALSE );
if( !NT_SUCCESS(Status) ) {
- AFD_DbgPrint(MID_TRACE,("Could not make an event %x\n", Status));
- return -1;
+ ERR("Could not make an event %x\n", Status);
+ return -1;
}
/* Get the Socket Structure associate to this Socket*/
@@ -177,60 +183,60 @@
NULL,
0);
- AFD_DbgPrint(MID_TRACE,("AFD: %x\n", Status));
+ TRACE("AFD: %x\n", Status);
/* Wait for return */
if (Status == STATUS_PENDING) {
- WaitForSingleObject(SockEvent, INFINITE);
- Status = IOSB.Status;
- }
-
- AFD_DbgPrint(MID_TRACE,("Waited\n"));
+ WaitForSingleObject(SockEvent, INFINITE);
+ Status = IOSB.Status;
+ }
+
+ TRACE("Waited\n");
NtClose( SockEvent );
if (Status != STATUS_SUCCESS)
+ {
+ ERR("Status 0x%08x", Status);
return MsafdReturnWithErrno(Status, lpErrno, 0, NULL);
-
- AFD_DbgPrint(MID_TRACE,("Closed event\n"));
- AFD_DbgPrint(MID_TRACE,("About to touch struct at %x (%d)\n",
- lpNetworkEvents, sizeof(*lpNetworkEvents)));
+ }
+
+ TRACE("Closed event\n");
+ TRACE("About to touch struct at %x (%d)\n", lpNetworkEvents,
sizeof(*lpNetworkEvents));
lpNetworkEvents->lNetworkEvents = 0;
-
- AFD_DbgPrint(MID_TRACE,("Zeroed struct\n"));
/* Set Events to wait for */
if (EnumReq.PollEvents & AFD_EVENT_RECEIVE) {
- lpNetworkEvents->lNetworkEvents |= FD_READ;
- lpNetworkEvents->iErrorCode[FD_READ_BIT] =
TranslateNtStatusError(EnumReq.EventStatus[FD_READ_BIT]);
+ lpNetworkEvents->lNetworkEvents |= FD_READ;
+ lpNetworkEvents->iErrorCode[FD_READ_BIT] =
TranslateNtStatusError(EnumReq.EventStatus[FD_READ_BIT]);
}
if (EnumReq.PollEvents & AFD_EVENT_SEND) {
- lpNetworkEvents->lNetworkEvents |= FD_WRITE;
- lpNetworkEvents->iErrorCode[FD_WRITE_BIT] =
TranslateNtStatusError(EnumReq.EventStatus[FD_WRITE_BIT]);
+ lpNetworkEvents->lNetworkEvents |= FD_WRITE;
+ lpNetworkEvents->iErrorCode[FD_WRITE_BIT] =
TranslateNtStatusError(EnumReq.EventStatus[FD_WRITE_BIT]);
}
if (EnumReq.PollEvents & AFD_EVENT_OOB_RECEIVE) {
lpNetworkEvents->lNetworkEvents |= FD_OOB;
- lpNetworkEvents->iErrorCode[FD_OOB_BIT] =
TranslateNtStatusError(EnumReq.EventStatus[FD_OOB_BIT]);
+ lpNetworkEvents->iErrorCode[FD_OOB_BIT] =
TranslateNtStatusError(EnumReq.EventStatus[FD_OOB_BIT]);
}
if (EnumReq.PollEvents & AFD_EVENT_ACCEPT) {
- lpNetworkEvents->lNetworkEvents |= FD_ACCEPT;
- lpNetworkEvents->iErrorCode[FD_ACCEPT_BIT] =
TranslateNtStatusError(EnumReq.EventStatus[FD_ACCEPT_BIT]);
+ lpNetworkEvents->lNetworkEvents |= FD_ACCEPT;
+ lpNetworkEvents->iErrorCode[FD_ACCEPT_BIT] =
TranslateNtStatusError(EnumReq.EventStatus[FD_ACCEPT_BIT]);
}
if (EnumReq.PollEvents &
- (AFD_EVENT_CONNECT | AFD_EVENT_CONNECT_FAIL)) {
+ (AFD_EVENT_CONNECT | AFD_EVENT_CONNECT_FAIL)) {
lpNetworkEvents->lNetworkEvents |= FD_CONNECT;
- lpNetworkEvents->iErrorCode[FD_CONNECT_BIT] =
TranslateNtStatusError(EnumReq.EventStatus[FD_CONNECT_BIT]);
+ lpNetworkEvents->iErrorCode[FD_CONNECT_BIT] =
TranslateNtStatusError(EnumReq.EventStatus[FD_CONNECT_BIT]);
}
if (EnumReq.PollEvents &
(AFD_EVENT_DISCONNECT | AFD_EVENT_ABORT | AFD_EVENT_CLOSE)) {
- lpNetworkEvents->lNetworkEvents |= FD_CLOSE;
- lpNetworkEvents->iErrorCode[FD_CLOSE_BIT] =
TranslateNtStatusError(EnumReq.EventStatus[FD_CLOSE_BIT]);
+ lpNetworkEvents->lNetworkEvents |= FD_CLOSE;
+ lpNetworkEvents->iErrorCode[FD_CLOSE_BIT] =
TranslateNtStatusError(EnumReq.EventStatus[FD_CLOSE_BIT]);
}
if (EnumReq.PollEvents & AFD_EVENT_QOS) {
@@ -239,11 +245,11 @@
}
if (EnumReq.PollEvents & AFD_EVENT_GROUP_QOS) {
- lpNetworkEvents->lNetworkEvents |= FD_GROUP_QOS;
- lpNetworkEvents->iErrorCode[FD_GROUP_QOS_BIT] =
TranslateNtStatusError(EnumReq.EventStatus[FD_GROUP_QOS_BIT]);
- }
-
- AFD_DbgPrint(MID_TRACE,("Leaving\n"));
+ lpNetworkEvents->lNetworkEvents |= FD_GROUP_QOS;
+ lpNetworkEvents->iErrorCode[FD_GROUP_QOS_BIT] =
TranslateNtStatusError(EnumReq.EventStatus[FD_GROUP_QOS_BIT]);
+ }
+
+ TRACE("Leaving\n");
return MsafdReturnWithErrno(STATUS_SUCCESS, lpErrno, 0, NULL);
}
Modified: trunk/reactos/dll/win32/msafd/misc/helpers.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msafd/misc/helpe…
==============================================================================
--- trunk/reactos/dll/win32/msafd/misc/helpers.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/msafd/misc/helpers.c [iso-8859-1] Mon Nov 10 13:06:48 2014
@@ -13,6 +13,9 @@
#include <msafd.h>
#include <winreg.h>
+
+#include <wine/debug.h>
+WINE_DEFAULT_DEBUG_CHANNEL(msafd);
CRITICAL_SECTION HelperDLLDatabaseLock;
LIST_ENTRY HelperDLLDatabaseListHead;
@@ -37,7 +40,8 @@
PLIST_ENTRY Helpers;
INT Status;
- AFD_DbgPrint(MID_TRACE,("Called\n"));
+ TRACE("AddressFamily %p, SocketType %p, Protocol %p, Group %u, Flags %lx,
TransportName %wZ, HelperDllContext %p, HeplperDllData %p, Events %p\n",
+ AddressFamily, SocketType, Protocol, Group, Flags, TransportName,
HelperDllContext, HelperDllData, Events);
/* Check in our Current Loaded Helpers */
for (Helpers = SockHelpersListHead.Flink;
@@ -86,7 +90,7 @@
/* Check for error */
if (Status) {
- AFD_DbgPrint(MIN_TRACE, ("Can't get transport list\n"));
+ WARN("Can't get transport list\n");
return Status;
}
@@ -94,14 +98,14 @@
for (Transport = Transports;
*Transports != 0;
Transport += wcslen(Transport) + 1) {
- AFD_DbgPrint(MID_TRACE, ("Transport: %S\n", Transports));
+ TRACE("Transport: %S\n", Transports);
/* See what mapping this Transport supports */
Status = SockLoadTransportMapping(Transport, &Mapping);
/* Check for error */
if (Status) {
- AFD_DbgPrint(MIN_TRACE, ("Can't get mapping\n"));
+ ERR("Can't get mapping for %S\n", Transports);
HeapFree(GlobalHeap, 0, Transports);
return Status;
}
@@ -114,7 +118,7 @@
/* Check for error */
if (Status) {
- AFD_DbgPrint(MIN_TRACE, ("Can't load helper DLL\n"));
+ ERR("Can't load helper DLL for Transport %S.\n",
Transport);
HeapFree(GlobalHeap, 0, Transports);
HeapFree(GlobalHeap, 0, Mapping);
return Status;
@@ -144,7 +148,7 @@
/* Return the Helper Pointers */
*HelperDllData = HelperData;
- /* We actually cache these ... the can't be freed yet */
+ /* We actually cache these ... the can't be freed yet */
/*HeapFree(GlobalHeap, 0, Transports);*/
/*HeapFree(GlobalHeap, 0, Mapping);*/
return NO_ERROR;
@@ -166,14 +170,14 @@
ULONG MappingSize;
LONG Status;
- AFD_DbgPrint(MID_TRACE,("Called: TransportName %ws\n", TransportName));
+ TRACE("TransportName %ws\n", TransportName);
/* Allocate a Buffer */
TransportKey = HeapAlloc(GlobalHeap, 0, (54 + wcslen(TransportName)) *
sizeof(WCHAR));
/* Check for error */
if (TransportKey == NULL) {
- AFD_DbgPrint(MIN_TRACE, ("Buffer allocation failed\n"));
+ ERR("Buffer allocation failed\n");
return WSAEINVAL;
}
@@ -190,7 +194,7 @@
/* Check for error */
if (Status) {
- AFD_DbgPrint(MIN_TRACE, ("Error reading transport mapping
registry\n"));
+ ERR("Error reading transport mapping registry\n");
return WSAEINVAL;
}
@@ -199,7 +203,7 @@
/* Check for error */
if (Status) {
- AFD_DbgPrint(MIN_TRACE, ("Error reading transport mapping
registry\n"));
+ ERR("Error reading transport mapping registry\n");
return WSAEINVAL;
}
@@ -208,7 +212,7 @@
/* Check for error */
if (*Mapping == NULL) {
- AFD_DbgPrint(MIN_TRACE, ("Buffer allocation failed\n"));
+ ERR("Buffer allocation failed\n");
return WSAEINVAL;
}
@@ -217,7 +221,7 @@
/* Check for error */
if (Status) {
- AFD_DbgPrint(MIN_TRACE, ("Error reading transport mapping
registry\n"));
+ ERR("Error reading transport mapping registry\n");
HeapFree(GlobalHeap, 0, *Mapping);
return WSAEINVAL;
}
@@ -235,7 +239,7 @@
HKEY KeyHandle;
LONG Status;
- AFD_DbgPrint(MID_TRACE,("Called\n"));
+ TRACE("Called\n");
/* Open the Transports Key */
Status = RegOpenKeyExW (HKEY_LOCAL_MACHINE,
@@ -246,7 +250,7 @@
/* Check for error */
if (Status) {
- AFD_DbgPrint(MIN_TRACE, ("Error reading transport list registry\n"));
+ ERR("Error reading transport list registry\n");
return WSAEINVAL;
}
@@ -260,7 +264,7 @@
/* Check for error */
if (Status) {
- AFD_DbgPrint(MIN_TRACE, ("Error reading transport list registry\n"));
+ ERR("Error reading transport list registry\n");
return WSAEINVAL;
}
@@ -269,7 +273,7 @@
/* Check for error */
if (*TransportList == NULL) {
- AFD_DbgPrint(MIN_TRACE, ("Buffer allocation failed\n"));
+ ERR("Buffer allocation failed\n");
return WSAEINVAL;
}
@@ -283,7 +287,7 @@
/* Check for error */
if (Status) {
- AFD_DbgPrint(MIN_TRACE, ("Error reading transport list registry\n"));
+ ERR("Error reading transport list registry\n");
HeapFree(GlobalHeap, 0, *TransportList);
return WSAEINVAL;
}
@@ -312,7 +316,7 @@
/* Check for error */
if (HelperData == NULL) {
- AFD_DbgPrint(MIN_TRACE, ("Buffer allocation failed\n"));
+ ERR("Buffer allocation failed\n");
return WSAEINVAL;
}
@@ -321,7 +325,7 @@
/* Check for error */
if (HelperKey == NULL) {
- AFD_DbgPrint(MIN_TRACE, ("Buffer allocation failed\n"));
+ ERR("Buffer allocation failed\n");
HeapFree(GlobalHeap, 0, HelperData);
return WSAEINVAL;
}
@@ -338,7 +342,7 @@
/* Check for error */
if (Status) {
- AFD_DbgPrint(MIN_TRACE, ("Error reading helper DLL parameters\n"));
+ ERR("Error reading helper DLL parameters\n");
HeapFree(GlobalHeap, 0, HelperData);
return WSAEINVAL;
}
@@ -380,7 +384,7 @@
/* Check for error */
if (HelperDllName == NULL) {
- AFD_DbgPrint(MIN_TRACE, ("Buffer allocation failed\n"));
+ ERR("Buffer allocation failed\n");
HeapFree(GlobalHeap, 0, HelperData);
return WSAEINVAL;
}
@@ -389,7 +393,7 @@
/* Check for error */
if (FullHelperDllName == NULL) {
- AFD_DbgPrint(MIN_TRACE, ("Buffer allocation failed\n"));
+ ERR("Buffer allocation failed\n");
HeapFree(GlobalHeap, 0, HelperDllName);
HeapFree(GlobalHeap, 0, HelperData);
return WSAEINVAL;
@@ -406,7 +410,7 @@
/* Check for error */
if (Status) {
- AFD_DbgPrint(MIN_TRACE, ("Error reading helper DLL parameters\n"));
+ ERR("Error reading helper DLL parameters\n");
HeapFree(GlobalHeap, 0, FullHelperDllName);
HeapFree(GlobalHeap, 0, HelperDllName);
HeapFree(GlobalHeap, 0, HelperData);
@@ -425,7 +429,7 @@
HeapFree(GlobalHeap, 0, FullHelperDllName);
if (HelperData->hInstance == NULL) {
- AFD_DbgPrint(MIN_TRACE, ("Error loading helper DLL\n"));
+ ERR("Error loading helper DLL\n");
HeapFree(GlobalHeap, 0, HelperData);
return WSAEINVAL;
}
@@ -495,25 +499,25 @@
/* The Windows version returns more detailed information on which of the 3 parameters
failed...we should do this later */
ULONG Row;
- AFD_DbgPrint(MID_TRACE,("Called, Mapping rows = %d\n", Mapping->Rows));
+ TRACE("Called, Mapping rows = %d\n", Mapping->Rows);
/* Loop through Mapping to Find a matching one */
for (Row = 0; Row < Mapping->Rows; Row++) {
- AFD_DbgPrint(MID_TRACE,("Examining: row %d: AF %d type %d proto %d\n",
+ TRACE("Examining: row %d: AF %d type %d proto %d\n",
Row,
(INT)Mapping->Mapping[Row].AddressFamily,
(INT)Mapping->Mapping[Row].SocketType,
- (INT)Mapping->Mapping[Row].Protocol));
+ (INT)Mapping->Mapping[Row].Protocol);
/* Check of all three values Match */
if (((INT)Mapping->Mapping[Row].AddressFamily == AddressFamily) &&
((INT)Mapping->Mapping[Row].SocketType == SocketType) &&
((INT)Mapping->Mapping[Row].Protocol == Protocol)) {
- AFD_DbgPrint(MID_TRACE,("Found\n"));
+ TRACE("Found\n");
return TRUE;
}
}
- AFD_DbgPrint(MID_TRACE,("Not found\n"));
+ WARN("Not found\n");
return FALSE;
}
Modified: trunk/reactos/dll/win32/msafd/misc/sndrcv.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msafd/misc/sndrc…
==============================================================================
--- trunk/reactos/dll/win32/msafd/misc/sndrcv.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/msafd/misc/sndrcv.c [iso-8859-1] Mon Nov 10 13:06:48 2014
@@ -11,6 +11,9 @@
*/
#include <msafd.h>
+
+#include <wine/debug.h>
+WINE_DEFAULT_DEBUG_CHANNEL(msafd);
INT
WSPAPI
@@ -113,7 +116,7 @@
HANDLE SockEvent;
PSOCKET_INFORMATION Socket;
- AFD_DbgPrint(MID_TRACE,("Called (%x)\n", Handle));
+ TRACE("Called (%x)\n", Handle);
/* Get the Socket Structure associate to this Socket*/
Socket = GetSocketStructure(Handle);
@@ -215,7 +218,7 @@
NtClose( SockEvent );
- AFD_DbgPrint(MID_TRACE,("Status %x Information %d\n", Status,
IOSB->Information));
+ TRACE("Status %x Information %d\n", Status, IOSB->Information);
/* Return the Flags */
*ReceiveFlags = 0;
@@ -448,7 +451,7 @@
if( !NT_SUCCESS(Status) )
return -1;
- AFD_DbgPrint(MID_TRACE,("Called\n"));
+ TRACE("Called\n");
/* Set up the Send Structure */
SendInfo.BufferArray = (PAFD_WSABUF)lpBuffers;
@@ -524,14 +527,14 @@
if (Status == STATUS_PENDING)
{
- AFD_DbgPrint(MID_TRACE,("Leaving (Pending)\n"));
+ TRACE("Leaving (Pending)\n");
return MsafdReturnWithErrno(Status, lpErrno, IOSB->Information,
lpNumberOfBytesSent);
}
/* Re-enable Async Event */
SockReenableAsyncSelectEvent(Socket, FD_WRITE);
- AFD_DbgPrint(MID_TRACE,("Leaving (Success, %d)\n", IOSB->Information));
+ TRACE("Leaving (Success, %d)\n", IOSB->Information);
return MsafdReturnWithErrno( Status, lpErrno, IOSB->Information,
lpNumberOfBytesSent );
}
@@ -710,7 +713,7 @@
OUT LPWSABUF lpInboundDisconnectData,
OUT LPINT lpErrno)
{
- UNIMPLEMENTED
+ UNIMPLEMENTED;
return 0;
}
@@ -722,7 +725,7 @@
IN LPWSABUF lpOutboundDisconnectData,
OUT LPINT lpErrno)
{
- UNIMPLEMENTED
+ UNIMPLEMENTED;
return 0;
}
Modified: trunk/reactos/dll/win32/msafd/misc/stubs.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msafd/misc/stubs…
==============================================================================
--- trunk/reactos/dll/win32/msafd/misc/stubs.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/msafd/misc/stubs.c [iso-8859-1] Mon Nov 10 13:06:48 2014
@@ -10,6 +10,9 @@
#include <msafd.h>
+#include <wine/debug.h>
+WINE_DEFAULT_DEBUG_CHANNEL(msafd);
+
INT
WSPAPI
WSPAddressToString(
@@ -20,7 +23,7 @@
IN OUT LPDWORD lpdwAddressStringLength,
OUT LPINT lpErrno)
{
- UNIMPLEMENTED
+ UNIMPLEMENTED;
return 0;
}
@@ -31,7 +34,7 @@
WSPCancelBlockingCall(
OUT LPINT lpErrno)
{
- UNIMPLEMENTED
+ UNIMPLEMENTED;
return 0;
}
@@ -45,7 +48,7 @@
OUT LPWSAPROTOCOL_INFOW lpProtocolInfo,
OUT LPINT lpErrno)
{
- UNIMPLEMENTED
+ UNIMPLEMENTED;
return 0;
}
@@ -61,7 +64,7 @@
OUT LPDWORD lpdwFlags,
OUT LPINT lpErrno)
{
- UNIMPLEMENTED
+ UNIMPLEMENTED;
return FALSE;
}
@@ -75,7 +78,7 @@
OUT LPQOS lpQOS,
OUT LPINT lpErrno)
{
- UNIMPLEMENTED
+ UNIMPLEMENTED;
return FALSE;
}
@@ -94,7 +97,7 @@
IN DWORD dwFlags,
OUT LPINT lpErrno)
{
- UNIMPLEMENTED
+ UNIMPLEMENTED;
return (SOCKET)0;
}
@@ -109,7 +112,7 @@
IN OUT LPINT lpAddressLength,
OUT LPINT lpErrno)
{
- UNIMPLEMENTED
+ UNIMPLEMENTED;
return 0;
}
Modified: trunk/reactos/dll/win32/msafd/msafd.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msafd/msafd.h?re…
==============================================================================
--- trunk/reactos/dll/win32/msafd/msafd.h [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/msafd/msafd.h [iso-8859-1] Mon Nov 10 13:06:48 2014
@@ -27,9 +27,7 @@
#include <wsahelp.h>
#include <tdi.h>
#include <afd/shared.h>
-#include <helpers.h>
-
-#include <debug.h>
+#include "include/helpers.h"
extern HANDLE GlobalHeap;
extern WSPUPCALLTABLE Upcalls;