* Sync up to trunk head (r64939).
[reactos.git] / dll / win32 / getuname / getuname.c
index 6a16af1..b1f670c 100644 (file)
@@ -3,17 +3,32 @@
  * FILE:            dll\win32\getuname\getuname.c
  * PURPOSE:         Main file
  * PROGRAMMERS:     Dmitry Chapyshev (dmitry@reactos.org)
+ *                  Baruch Rutman (peterooch at gmail dot com)
  */
 
-#include <windows.h>
+#include <stdarg.h>
+#include <windef.h>
+#include <winuser.h>
+
+HINSTANCE hInstance;
 
 int
 WINAPI
 GetUName(IN WORD wCharCode,
          OUT LPWSTR lpBuf)
 {
-       wcscpy(lpBuf, L"Undefined");
-    return 0;
+    WCHAR szDescription[256];
+    int res = LoadStringW(hInstance, wCharCode, szDescription, 256);
+    if (res != 0)
+    {
+        wcscpy(lpBuf, szDescription);
+        return 0;
+    }
+    else
+    { 
+        wcscpy(lpBuf, L"Undefined");
+        return 0;
+    }
 }
 
 
@@ -26,6 +41,7 @@ DllMain(IN HINSTANCE hinstDLL,
     switch (dwReason)
     {
         case DLL_PROCESS_ATTACH:
+            hInstance = hinstDLL;
             break;
     }