Removed obsolete INT_Int31Handler.
[wine/multimedia.git] / dlls / advapi32 / advapi.c
blobd3bac2015853a9abe82705fc9b2b7ece864185f8
1 /*
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
21 #include "config.h"
22 #include "wine/port.h"
24 #include <errno.h>
25 #include <stdio.h>
26 #include <string.h>
28 #include "winbase.h"
29 #include "windef.h"
30 #include "winnls.h"
31 #include "winerror.h"
33 #include "wine/library.h"
34 #include "wine/debug.h"
36 WINE_DEFAULT_DEBUG_CHANNEL(advapi);
38 /******************************************************************************
39 * GetUserNameA [ADVAPI32.@]
41 * NOTE: lpSize returns the total length of the username, including the
42 * terminating null character.
44 BOOL WINAPI
45 GetUserNameA( LPSTR lpszName, LPDWORD lpSize )
47 size_t len;
48 const char *name = wine_get_user_name();
50 /* We need to include the null character when determining the size of the buffer. */
51 len = strlen(name) + 1;
52 if (len > *lpSize)
54 SetLastError(ERROR_MORE_DATA);
55 *lpSize = len;
56 return 0;
59 *lpSize = len;
60 strcpy(lpszName, name);
61 return 1;
64 /******************************************************************************
65 * GetUserNameW [ADVAPI32.@]
67 * PARAMS
68 * lpszName []
69 * lpSize []
71 BOOL WINAPI
72 GetUserNameW( LPWSTR lpszName, LPDWORD lpSize )
74 const char *name = wine_get_user_name();
75 DWORD len = MultiByteToWideChar( CP_ACP, 0, name, -1, NULL, 0 );
77 if (len > *lpSize)
79 SetLastError(ERROR_MORE_DATA);
80 *lpSize = len;
81 return FALSE;
84 *lpSize = len;
85 MultiByteToWideChar( CP_ACP, 0, name, -1, lpszName, len );
86 return TRUE;
89 /******************************************************************************
90 * GetCurrentHwProfileA [ADVAPI32.@]
92 BOOL WINAPI GetCurrentHwProfileA(LPHW_PROFILE_INFOA info)
94 FIXME("Mostly Stub\n");
95 info->dwDockInfo = DOCKINFO_DOCKED;
96 strcpy(info->szHwProfileGuid,"{12340001-1234-1234-1234-1233456789012}");
97 strcpy(info->szHwProfileName,"Wine Profile");
98 return 1;
101 /******************************************************************************
102 * AbortSystemShutdownA [ADVAPI32.@]
104 * PARAMS
105 * lpMachineName
107 BOOL WINAPI AbortSystemShutdownA( LPSTR lpMachineName )
109 TRACE("stub %s (harmless)\n", lpMachineName);
110 return TRUE;
113 /******************************************************************************
114 * AbortSystemShutdownW [ADVAPI32.@]
116 * PARAMS
117 * lpMachineName
119 BOOL WINAPI AbortSystemShutdownW( LPCWSTR lpMachineName )
121 TRACE("stub %s (harmless)\n", debugstr_w(lpMachineName));
122 return TRUE;