* Sync up to trunk head (r64921).
[reactos.git] / base / applications / mscutils / servman / export.c
index f2907d8..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],
@@ -31,7 +34,6 @@ GetTextFromListView(PMAIN_WND_INFO Info,
     return NumChars;
 }
 
-
 static BOOL
 SaveServicesToFile(PMAIN_WND_INFO Info,
                    LPCTSTR pszFileName)
@@ -50,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;
@@ -66,7 +68,7 @@ SaveServicesToFile(PMAIN_WND_INFO Info,
                                                    LVText,
                                                    i,
                                                    k);
-                if (LVText != NULL)
+                if (dwTextLength != 0)
                 {
                     WriteFile(hFile,
                               LVText,
@@ -82,8 +84,8 @@ SaveServicesToFile(PMAIN_WND_INFO Info,
                 }
             }
             WriteFile(hFile,
-                      &newl,
-                      sizeof(TCHAR),
+                      newl,
+                      sizeof(newl),
                       &dwWritten,
                       NULL);
         }
@@ -95,7 +97,6 @@ SaveServicesToFile(PMAIN_WND_INFO Info,
     return bSuccess;
 }
 
-
 VOID ExportFile(PMAIN_WND_INFO Info)
 {
     OPENFILENAME ofn;