[IPCONFIG]
[reactos.git] / reactos / base / applications / network / ipconfig / ipconfig.c
index 2657614..178a6d8 100644 (file)
  * allow globbing on adapter names
  */
 
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
+#include <stdarg.h>
+#include <windef.h>
+#include <winbase.h>
+#include <winuser.h>
+#include <winreg.h>
 #include <stdio.h>
 #include <tchar.h>
 #include <time.h>
 #include <iphlpapi.h>
+
 #include "resource.h"
 
 #define GUID_LEN 40
@@ -28,13 +32,21 @@ HANDLE ProcessHeap;
 int LoadStringAndOem(HINSTANCE hInst,
                UINT uID,
                LPTSTR szNode,
-               int Siz
-)      
+               int byteSize
+)
 {
-  TCHAR szTmp[25];
-  int res = LoadString(hInst, uID, szTmp, sizeof(szTmp)); 
+  TCHAR *szTmp;
+  int res;
+
+  szTmp = (LPTSTR)HeapAlloc(ProcessHeap, 0, byteSize);
+  if (szTmp == NULL)
+  {
+    return 0;
+  }
+  res = LoadString(hInst, uID, szTmp, byteSize); 
   CharToOem(szTmp, szNode);
-  return(res);
+  HeapFree(ProcessHeap, 0, szTmp);
+  return res;
 }
 
 LPTSTR GetNodeTypeName(UINT NodeType)
@@ -321,8 +333,8 @@ LPTSTR GetConnectionDescription(LPTSTR lpClass)
                                (PBYTE)lpKeyClass,
                                &dwDataSize) != ERROR_SUCCESS)
             {
-                lpKeyClass = NULL;
                 HeapFree(ProcessHeap, 0, lpKeyClass);
+                lpKeyClass = NULL;
                 continue;
             }
         }
@@ -702,7 +714,7 @@ VOID Usage(VOID)
                            Size))
             {
                 _tprintf(_T("%s"), lpUsage);
-            }
+            }            
         }
     }
 
@@ -813,4 +825,3 @@ int main(int argc, char *argv[])
 
     return 0;
 }
-