xref: /reactos/dll/win32/getuname/getuname.c (revision c2c66aff)
1 /*
2  * PROJECT:         Unicode name dll
3  * FILE:            dll\win32\getuname\getuname.c
4  * PURPOSE:         Main file
5  * PROGRAMMERS:     Dmitry Chapyshev (dmitry@reactos.org)
6  *                  Baruch Rutman (peterooch at gmail dot com)
7  */
8 
9 #include <stdarg.h>
10 #include <windef.h>
11 #include <winuser.h>
12 
13 HINSTANCE hInstance;
14 
15 int
16 WINAPI
17 GetUName(IN WORD wCharCode,
18          OUT LPWSTR lpBuf)
19 {
20     WCHAR szDescription[256];
21     int res = LoadStringW(hInstance, wCharCode, szDescription, 256);
22     if (res != 0)
23     {
24         wcscpy(lpBuf, szDescription);
25         return 0;
26     }
27     else
28     {
29         wcscpy(lpBuf, L"Undefined");
30         return 0;
31     }
32 }
33 
34 
35 BOOL
36 WINAPI
37 DllMain(IN HINSTANCE hinstDLL,
38         IN DWORD dwReason,
39         IN LPVOID lpvReserved)
40 {
41     switch (dwReason)
42     {
43         case DLL_PROCESS_ATTACH:
44             hInstance = hinstDLL;
45             break;
46     }
47 
48     return TRUE;
49 }
50