2002-06-13 20:36:40 +00:00
|
|
|
/*
|
|
|
|
* ReactOS kernel
|
|
|
|
* Copyright (C) 1998, 1999, 2000, 2001 ReactOS Team
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
|
|
*/
|
2013-03-14 20:35:39 +00:00
|
|
|
/*
|
2002-06-13 20:36:40 +00:00
|
|
|
* PROJECT: ReactOS user32.dll
|
2015-11-01 09:41:29 +00:00
|
|
|
* FILE: win32ss/user/user32/misc/object.c
|
2002-06-13 20:36:40 +00:00
|
|
|
* PURPOSE: DDE
|
|
|
|
* PROGRAMMER: Casper S. Hornstrup (chorns@users.sourceforge.net)
|
|
|
|
* UPDATE HISTORY:
|
|
|
|
* 09-05-2001 CSH Created
|
|
|
|
*/
|
|
|
|
|
2005-06-19 18:06:53 +00:00
|
|
|
#include <user32.h>
|
2006-06-26 13:16:43 +00:00
|
|
|
|
2007-07-26 15:13:36 +00:00
|
|
|
WINE_DEFAULT_DEBUG_CHANNEL(user32);
|
2002-06-13 20:36:40 +00:00
|
|
|
|
2003-07-10 21:04:32 +00:00
|
|
|
/*
|
2004-05-15 22:50:04 +00:00
|
|
|
* @implemented
|
2003-07-10 21:04:32 +00:00
|
|
|
*/
|
2004-01-23 23:38:26 +00:00
|
|
|
BOOL
|
2008-11-30 11:42:05 +00:00
|
|
|
WINAPI
|
2002-06-13 20:36:40 +00:00
|
|
|
GetUserObjectInformationA(
|
|
|
|
HANDLE hObj,
|
|
|
|
int nIndex,
|
|
|
|
PVOID pvInfo,
|
|
|
|
DWORD nLength,
|
|
|
|
LPDWORD lpnLengthNeeded)
|
|
|
|
{
|
2004-05-15 22:50:04 +00:00
|
|
|
LPWSTR buffer;
|
2012-10-30 16:50:11 +00:00
|
|
|
BOOL ret = FALSE;
|
|
|
|
DWORD LengthNeeded;
|
2005-05-09 01:42:07 +00:00
|
|
|
|
2007-07-26 15:13:36 +00:00
|
|
|
TRACE("GetUserObjectInformationA(%x %d %x %d %x)\n", hObj, nIndex,
|
2004-05-15 22:50:04 +00:00
|
|
|
pvInfo, nLength, lpnLengthNeeded);
|
2005-05-09 01:42:07 +00:00
|
|
|
|
2004-05-15 22:50:04 +00:00
|
|
|
if (nIndex != UOI_NAME && nIndex != UOI_TYPE)
|
2009-01-11 12:37:54 +00:00
|
|
|
return GetUserObjectInformationW(hObj, nIndex, pvInfo, nLength, lpnLengthNeeded);
|
2004-05-15 22:50:04 +00:00
|
|
|
|
2005-05-09 01:42:07 +00:00
|
|
|
/* allocate unicode buffer */
|
2004-05-15 22:50:04 +00:00
|
|
|
buffer = HeapAlloc(GetProcessHeap(), 0, nLength*2);
|
|
|
|
if (buffer == NULL)
|
|
|
|
{
|
|
|
|
SetLastError(ERROR_NOT_ENOUGH_MEMORY);
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* get unicode string */
|
2012-10-30 16:50:11 +00:00
|
|
|
if (GetUserObjectInformationW(hObj, nIndex, buffer, nLength*2, lpnLengthNeeded))
|
2004-05-15 22:50:04 +00:00
|
|
|
{
|
|
|
|
/* convert string */
|
2012-10-30 16:50:11 +00:00
|
|
|
LengthNeeded = WideCharToMultiByte(CP_THREAD_ACP, 0, buffer, -1,
|
|
|
|
pvInfo, nLength, NULL, NULL);
|
|
|
|
|
|
|
|
if (LengthNeeded != 0)
|
2004-05-15 22:50:04 +00:00
|
|
|
{
|
2014-10-13 09:18:46 +00:00
|
|
|
if (lpnLengthNeeded)
|
|
|
|
*lpnLengthNeeded = LengthNeeded;
|
2012-10-30 16:50:11 +00:00
|
|
|
ret = TRUE;
|
2004-05-15 22:50:04 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2005-05-09 01:42:07 +00:00
|
|
|
/* free resources */
|
2004-05-15 22:50:04 +00:00
|
|
|
HeapFree(GetProcessHeap(), 0, buffer);
|
|
|
|
return ret;
|
2002-06-13 20:36:40 +00:00
|
|
|
}
|