[ros-diffs] [cwittich] 32492: only get the last error code when it is needed

cwittich at svn.reactos.org cwittich at svn.reactos.org
Tue Feb 26 15:04:35 CET 2008


Author: cwittich
Date: Tue Feb 26 17:04:35 2008
New Revision: 32492

URL: http://svn.reactos.org/svn/reactos?rev=32492&view=rev
Log:
only get the last error code when it is needed

Modified:
    trunk/reactos/base/services/tcpsvcs/tcpsvcs.c

Modified: trunk/reactos/base/services/tcpsvcs/tcpsvcs.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/services/tcpsvcs/tcpsvcs.c?rev=32492&r1=32491&r2=32492&view=diff
==============================================================================
--- trunk/reactos/base/services/tcpsvcs/tcpsvcs.c (original)
+++ trunk/reactos/base/services/tcpsvcs/tcpsvcs.c Tue Feb 26 17:04:35 2008
@@ -37,7 +37,7 @@
 {
 #ifdef DEBUG
     DWORD eMsgLen;
-    DWORD ErrNum = GetLastError();
+    DWORD ErrNum;
     LPTSTR lpvSysMsg;
     TCHAR MessageBuffer[512];
     FILE *hLogFile = NULL;
@@ -47,6 +47,7 @@
 
     if (PrintErrorMsg)
     {
+        ErrNum = GetLastError();
         eMsgLen = FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM,
                                 NULL,
                                 ErrNum,




More information about the Ros-diffs mailing list