* Sync up to trunk head (r64921).
[reactos.git] / base / applications / mscutils / servman / export.c
index 07bc857..4abb279 100644 (file)
@@ -9,6 +9,9 @@
 
 #include "precomp.h"
 
+#include <commdlg.h>
+#include <cderr.h>
+
 static DWORD
 GetTextFromListView(PMAIN_WND_INFO Info,
                     TCHAR Text[500],
@@ -49,7 +52,7 @@ SaveServicesToFile(PMAIN_WND_INFO Info,
     if(hFile != INVALID_HANDLE_VALUE)
     {
         TCHAR LVText[500];
-        TCHAR newl = _T('\n');
+        TCHAR newl[2] = {_T('\r'), _T('\n')};
         TCHAR tab = _T('\t');
         DWORD dwTextLength, dwWritten;
         INT NumListedServ = 0;
@@ -65,7 +68,7 @@ SaveServicesToFile(PMAIN_WND_INFO Info,
                                                    LVText,
                                                    i,
                                                    k);
-                if (LVText != NULL)
+                if (dwTextLength != 0)
                 {
                     WriteFile(hFile,
                               LVText,
@@ -81,8 +84,8 @@ SaveServicesToFile(PMAIN_WND_INFO Info,
                 }
             }
             WriteFile(hFile,
-                      &newl,
-                      sizeof(TCHAR),
+                      newl,
+                      sizeof(newl),
                       &dwWritten,
                       NULL);
         }