Differentiate tracing functions between request and reply.
[wine/multimedia.git] / dlls / advapi32 / advapi.c
blob646f0f8625017323818c32a72c1fc946d37e7975
1 /*
2 * Win32 advapi functions
4 * Copyright 1995 Sven Verdoolaege
5 */
7 #include <stdio.h>
8 #include <unistd.h>
9 #include <string.h>
11 #include "winbase.h"
12 #include "windef.h"
13 #include "winerror.h"
14 #include "wine/winestring.h"
16 #include "debugtools.h"
19 /******************************************************************************
20 * GetUserName32A [ADVAPI32.67]
22 BOOL WINAPI
23 GetUserNameA( LPSTR lpszName, LPDWORD lpSize )
25 size_t len;
26 char *name;
28 name=getlogin();
29 #if 0
30 /* FIXME: should use getpwuid() here */
31 if (!name) name=cuserid(NULL);
32 #endif
33 len = name ? strlen(name) : 0;
34 if (!len || !lpSize || len > *lpSize) {
35 if (lpszName) *lpszName = 0;
36 return 0;
38 *lpSize=len;
39 strcpy(lpszName, name);
40 return 1;
43 /******************************************************************************
44 * GetUserName32W [ADVAPI32.68]
46 * PARAMS
47 * lpszName []
48 * lpSize []
50 BOOL WINAPI
51 GetUserNameW( LPWSTR lpszName, LPDWORD lpSize )
53 LPSTR name = (LPSTR)HeapAlloc( GetProcessHeap(), 0, *lpSize );
54 DWORD size = *lpSize;
55 BOOL res = GetUserNameA(name,lpSize);
57 lstrcpynAtoW(lpszName,name,size);
58 HeapFree( GetProcessHeap(), 0, name );
59 return res;