mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 10:04:49 +00:00
Slightly new and improved stub for GetUserNameA based on the Winehq
code and hacked by Royce and Me. svn path=/trunk/; revision=11082
This commit is contained in:
parent
05848ce54b
commit
21d354a1c1
1 changed files with 20 additions and 18 deletions
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: misc.c,v 1.25 2004/09/26 20:26:13 gvg Exp $
|
/* $Id: misc.c,v 1.26 2004/09/26 21:15:51 sedwards Exp $
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS system libraries
|
* PROJECT: ReactOS system libraries
|
||||||
|
@ -477,30 +477,32 @@ RevertToSelf(VOID)
|
||||||
* lpszName [O] Destination for the user name.
|
* lpszName [O] Destination for the user name.
|
||||||
* lpSize [I/O] Size of lpszName.
|
* lpSize [I/O] Size of lpszName.
|
||||||
*
|
*
|
||||||
* RETURNS
|
|
||||||
* Success: The length of the user name, including terminating NUL.
|
|
||||||
* Failure: ERROR_MORE_DATA if *lpSize is too small.
|
|
||||||
*
|
*
|
||||||
* @unimplemented
|
* @unimplemented
|
||||||
*/
|
*/
|
||||||
BOOL WINAPI
|
BOOL WINAPI
|
||||||
GetUserNameA( LPSTR lpszName, LPDWORD lpSize )
|
GetUserNameA( LPSTR lpszName, LPDWORD lpSize )
|
||||||
{
|
{
|
||||||
// size_t len;
|
size_t len;
|
||||||
// char name[] = { "Administrator" };
|
const char* name = "Administrator";
|
||||||
|
|
||||||
/* We need to include the null character when determining the size of the buffer. */
|
|
||||||
// len = strlen(name) + 1;
|
|
||||||
// if (len > *lpSize)
|
|
||||||
// {
|
|
||||||
// SetLastError(ERROR_MORE_DATA);
|
|
||||||
// *lpSize = len;
|
|
||||||
// return 0;
|
|
||||||
// }
|
|
||||||
|
|
||||||
// *lpSize = len;
|
|
||||||
// strcpy(lpszName, name);
|
|
||||||
DPRINT1("GetUserNameA: stub\n");
|
DPRINT1("GetUserNameA: stub\n");
|
||||||
|
if ( !lpSize )
|
||||||
|
{
|
||||||
|
SetLastError(ERROR_INVALID_PARAMETER);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
/* We need to include the null character when determining the size of the buffer. */
|
||||||
|
len = strlen(name) + 1;
|
||||||
|
if (len > *lpSize)
|
||||||
|
{
|
||||||
|
SetLastError(ERROR_MORE_DATA);
|
||||||
|
*lpSize = len;
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
*lpSize = len;
|
||||||
|
strcpy(lpszName, name);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue