[TCPSVCS]
authorAmine Khaldi <amine.khaldi@reactos.org>
Mon, 26 May 2014 14:03:24 +0000 (14:03 +0000)
committerAmine Khaldi <amine.khaldi@reactos.org>
Mon, 26 May 2014 14:03:24 +0000 (14:03 +0000)
* Use swprintf instead of _swprintf which shouldn't be exported.
CORE-8174

svn path=/trunk/; revision=63464

reactos/base/services/tcpsvcs/discard.c
reactos/base/services/tcpsvcs/echo.c
reactos/base/services/tcpsvcs/skelserver.c
reactos/base/services/tcpsvcs/tcpsvcs.c
reactos/base/services/tcpsvcs/tcpsvcs.h

index 8ac3d66..a900b71 100644 (file)
@@ -24,7 +24,7 @@ ReceiveIncomingPackets(SOCKET sock)
         {
             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)
index 95aed12..e92732c 100644 (file)
@@ -25,7 +25,7 @@ EchoIncomingPackets(SOCKET sock)
         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 @@ EchoIncomingPackets(SOCKET sock)
                 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;
                 }
index 20bf8e3..1b5e6d6 100644 (file)
@@ -84,14 +84,14 @@ AcceptConnections(SOCKET listeningSocket,
                 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 @@ AcceptConnections(SOCKET listeningSocket,
                         }
                         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 @@ ShutdownConnection(SOCKET sock,
             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 @@ StartServer(LPVOID lpParam)
 
     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 @@ StartServer(LPVOID lpParam)
         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 @@ StartServer(LPVOID lpParam)
         }
     }
 
-    _swprintf(logBuf,
-              L"Exiting %s thread",
-              pServices->lpName);
+    swprintf(logBuf, L"Exiting %s thread", pServices->lpName);
     LogEvent(logBuf, 0, 0, LOG_FILE);
     ExitThread(0);
 }
index 345a19f..f025b67 100644 (file)
@@ -72,7 +72,7 @@ CreateServers(PSERVICEINFO pServInfo)
 
     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 @@ CreateServers(PSERVICEINFO pServInfo)
     /* 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 @@ CreateServers(PSERVICEINFO pServInfo)
 
         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;
         }
index 87f27eb..b024e7c 100644 (file)
 #include <winsock2.h>
 #include <tchar.h>
 
-#ifndef _MSC_VER
-#define _swprintf swprintf
-#endif
-
 #define LOG_FILE 1
 #define LOG_EVENTLOG 2
 #define LOG_ERROR 4