Release 960712
[wine] / win32 / advapi.c
1 /*
2  * Win32 advapi functions
3  *
4  * Copyright 1995 Sven Verdoolaege
5  */
6
7 #include <stdio.h>
8 #include <unistd.h>
9 #include "windows.h"
10 #include "winerror.h"
11 #include "advapi32.h"
12 #include "stddebug.h"
13 #include "debug.h"
14
15 /***********************************************************************
16  *           GetUserNameA   [ADVAPI32.67]
17  */
18
19 BOOL GetUserNameA(LPSTR lpszName, LPDWORD lpSize)
20 {
21   size_t len;
22   char *name;
23
24   name=getlogin();
25   len = name ? strlen(name) : 0;
26   if (!len || !lpSize || len > *lpSize) {
27     if (lpszName) *lpszName = 0;
28     return 0;
29   }
30   *lpSize=len;
31   strcpy(lpszName, name);
32   return 1;
33 }