Author: akhaldi
Date: Mon May 26 14:03:24 2014
New Revision: 63464
URL:
http://svn.reactos.org/svn/reactos?rev=63464&view=rev
Log:
[TCPSVCS]
* Use swprintf instead of _swprintf which shouldn't be exported.
CORE-8174
Modified:
trunk/reactos/base/services/tcpsvcs/discard.c
trunk/reactos/base/services/tcpsvcs/echo.c
trunk/reactos/base/services/tcpsvcs/skelserver.c
trunk/reactos/base/services/tcpsvcs/tcpsvcs.c
trunk/reactos/base/services/tcpsvcs/tcpsvcs.h
Modified: trunk/reactos/base/services/tcpsvcs/discard.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/services/tcpsvcs/disc…
==============================================================================
--- trunk/reactos/base/services/tcpsvcs/discard.c [iso-8859-1] (original)
+++ trunk/reactos/base/services/tcpsvcs/discard.c [iso-8859-1] Mon May 26 14:03:24 2014
@@ -24,7 +24,7 @@
{
TCHAR logBuf[256];
- _swprintf(logBuf, L"Discard: Received %d bytes from client",
readBytes);
+ swprintf(logBuf, L"Discard: Received %d bytes from client",
readBytes);
LogEvent(logBuf, 0, 0, LOG_FILE);
}
else if (readBytes == SOCKET_ERROR)
Modified: trunk/reactos/base/services/tcpsvcs/echo.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/services/tcpsvcs/echo…
==============================================================================
--- trunk/reactos/base/services/tcpsvcs/echo.c [iso-8859-1] (original)
+++ trunk/reactos/base/services/tcpsvcs/echo.c [iso-8859-1] Mon May 26 14:03:24 2014
@@ -25,7 +25,7 @@
readBytes = recv(sock, readBuffer, RECV_BUF, 0);
if (readBytes > 0)
{
- _swprintf(logBuf, L"Received %d bytes from client", readBytes);
+ swprintf(logBuf, L"Received %d bytes from client", readBytes);
LogEvent(logBuf, 0, 0, LOG_FILE);
totalSentBytes = 0;
@@ -34,7 +34,7 @@
retVal = send(sock, readBuffer + totalSentBytes, readBytes -
totalSentBytes, 0);
if (retVal > 0)
{
- _swprintf(logBuf, L"Sent %d bytes back to client",
retVal);
+ swprintf(logBuf, L"Sent %d bytes back to client", retVal);
LogEvent(logBuf, 0, 0, LOG_FILE);
totalSentBytes += retVal;
}
Modified: trunk/reactos/base/services/tcpsvcs/skelserver.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/services/tcpsvcs/skel…
==============================================================================
--- trunk/reactos/base/services/tcpsvcs/skelserver.c [iso-8859-1] (original)
+++ trunk/reactos/base/services/tcpsvcs/skelserver.c [iso-8859-1] Mon May 26 14:03:24
2014
@@ -84,14 +84,14 @@
sock = accept(listeningSocket, (SOCKADDR*)&client, &addrSize);
if (sock != INVALID_SOCKET)
{
- _swprintf(logBuf,
- L"Accepted connection to %s server from %S:%d",
- lpName,
- inet_ntoa(client.sin_addr),
- ntohs(client.sin_port));
+ swprintf(logBuf,
+ L"Accepted connection to %s server from %S:%d",
+ lpName,
+ inet_ntoa(client.sin_addr),
+ ntohs(client.sin_port));
LogEvent(logBuf, 0, 0, LOG_FILE);
- _swprintf(logBuf, L"Creating worker thread for %s",
lpName);
+ swprintf(logBuf, L"Creating worker thread for %s",
lpName);
LogEvent(logBuf, 0, 0, LOG_FILE);
if (!bShutdown)
@@ -103,8 +103,8 @@
}
else
{
- _swprintf(logBuf, L"Failed to start worker thread for
the %s server",
- lpName);
+ swprintf(logBuf, L"Failed to start worker thread for the
%s server",
+ lpName);
LogEvent(logBuf, 0, 0, LOG_FILE);
}
}
@@ -149,7 +149,7 @@
ret = recv(sock, readBuffer, BUF, 0);
if (ret >= 0)
{
- _swprintf(logBuf, L"FYI, received %d unexpected bytes during
shutdown", ret);
+ swprintf(logBuf, L"FYI, received %d unexpected bytes during
shutdown", ret);
LogEvent(logBuf, 0, 0, LOG_FILE);
}
} while (ret > 0);
@@ -170,7 +170,7 @@
pServices = (PSERVICES)lpParam;
- _swprintf(logBuf, L"Starting %s server", pServices->lpName);
+ swprintf(logBuf, L"Starting %s server", pServices->lpName);
LogEvent(logBuf, 0, 0, LOG_FILE);
if (!bShutdown)
@@ -178,10 +178,10 @@
listeningSocket = SetUpListener(htons(pServices->Port));
if (!bShutdown && listeningSocket != INVALID_SOCKET)
{
- _swprintf(logBuf,
- L"%s is waiting for connections on port %d",
- pServices->lpName,
- pServices->Port);
+ swprintf(logBuf,
+ L"%s is waiting for connections on port %d",
+ pServices->lpName,
+ pServices->Port);
LogEvent(logBuf, 0, 0, LOG_FILE);
AcceptConnections(listeningSocket, pServices->lpService,
pServices->lpName);
@@ -192,9 +192,7 @@
}
}
- _swprintf(logBuf,
- L"Exiting %s thread",
- pServices->lpName);
+ swprintf(logBuf, L"Exiting %s thread", pServices->lpName);
LogEvent(logBuf, 0, 0, LOG_FILE);
ExitThread(0);
}
Modified: trunk/reactos/base/services/tcpsvcs/tcpsvcs.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/services/tcpsvcs/tcps…
==============================================================================
--- trunk/reactos/base/services/tcpsvcs/tcpsvcs.c [iso-8859-1] (original)
+++ trunk/reactos/base/services/tcpsvcs/tcpsvcs.c [iso-8859-1] Mon May 26 14:03:24 2014
@@ -72,7 +72,7 @@
if ((RetVal = WSAStartup(MAKEWORD(2, 2), &wsaData)) != 0)
{
- _swprintf(buf, L"WSAStartup() failed : %lu\n", RetVal);
+ swprintf(buf, L"WSAStartup() failed : %lu\n", RetVal);
LogEvent(buf, 0, 100, LOG_ALL);
return FALSE;
}
@@ -84,7 +84,7 @@
/* Create worker threads. */
for (i = 0; i < NUM_SERVICES; i++)
{
- _swprintf(buf, L"Creating thread for %s server", Services[i].lpName);
+ swprintf(buf, L"Creating thread for %s server", Services[i].lpName);
LogEvent(buf, 0, 0, LOG_FILE);
hThread[i] = CreateThread(NULL,
@@ -96,7 +96,7 @@
if (hThread[i] == NULL)
{
- _swprintf(buf, L"\nError creating %s server thread\n",
Services[i].lpName);
+ swprintf(buf, L"\nError creating %s server thread\n",
Services[i].lpName);
LogEvent(buf, GetLastError(), 0, LOG_ALL);
return FALSE;
}
Modified: trunk/reactos/base/services/tcpsvcs/tcpsvcs.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/services/tcpsvcs/tcps…
==============================================================================
--- trunk/reactos/base/services/tcpsvcs/tcpsvcs.h [iso-8859-1] (original)
+++ trunk/reactos/base/services/tcpsvcs/tcpsvcs.h [iso-8859-1] Mon May 26 14:03:24 2014
@@ -9,10 +9,6 @@
#define _INC_WINDOWS
#include <winsock2.h>
#include <tchar.h>
-
-#ifndef _MSC_VER
-#define _swprintf swprintf
-#endif
#define LOG_FILE 1
#define LOG_EVENTLOG 2