2 * Win32 advapi functions
4 * Copyright 1995 Sven Verdoolaege
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 #include "wine/port.h"
35 #include "wine/debug.h"
37 WINE_DEFAULT_DEBUG_CHANNEL(advapi);
39 /******************************************************************************
40 * GetUserNameA [ADVAPI32.@]
42 * NOTE: lpSize returns the total length of the username, including the
43 * terminating null character.
46 GetUserNameA( LPSTR lpszName, LPDWORD lpSize )
51 struct passwd *pwd = getpwuid( getuid() );
54 ERR("Username lookup failed: %s\n", strerror(errno));
60 /* We need to include the null character when determining the size of the buffer. */
61 len = strlen(name) + 1;
64 SetLastError(ERROR_MORE_DATA);
70 strcpy(lpszName, name);
74 /******************************************************************************
75 * GetUserNameW [ADVAPI32.@]
82 GetUserNameW( LPWSTR lpszName, LPDWORD lpSize )
84 LPSTR name = (LPSTR)HeapAlloc( GetProcessHeap(), 0, *lpSize );
86 BOOL res = GetUserNameA(name,lpSize);
88 /* FIXME: should set lpSize in WCHARs */
89 if (size && !MultiByteToWideChar( CP_ACP, 0, name, -1, lpszName, size ))
91 HeapFree( GetProcessHeap(), 0, name );
95 /******************************************************************************
96 * GetCurrentHwProfileA [ADVAPI32.@]
98 BOOL WINAPI GetCurrentHwProfileA(LPHW_PROFILE_INFOA info)
100 FIXME("Mostly Stub\n");
101 info->dwDockInfo = DOCKINFO_DOCKED;
102 strcpy(info->szHwProfileGuid,"{12340001-1234-1234-1234-1233456789012}");
103 strcpy(info->szHwProfileName,"Wine Profile");
107 /******************************************************************************
108 * AbortSystemShutdownA [ADVAPI32.@]
113 BOOL WINAPI AbortSystemShutdownA( LPSTR lpMachineName )
115 TRACE("stub %s (harmless)\n", lpMachineName);
119 /******************************************************************************
120 * AbortSystemShutdownW [ADVAPI32.@]
125 BOOL WINAPI AbortSystemShutdownW( LPCWSTR lpMachineName )
127 TRACE("stub %s (harmless)\n", debugstr_w(lpMachineName));