* 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
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)
(PBYTE)lpKeyClass,
&dwDataSize) != ERROR_SUCCESS)
{
- lpKeyClass = NULL;
HeapFree(ProcessHeap, 0, lpKeyClass);
+ lpKeyClass = NULL;
continue;
}
}
Size))
{
_tprintf(_T("%s"), lpUsage);
- }
+ }
}
}
return 0;
}
-