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.
|
|
|
|
*/
|
2008-07-09 04:44:13 +00:00
|
|
|
/*
|
2002-06-13 20:36:40 +00:00
|
|
|
* PROJECT: ReactOS user32.dll
|
|
|
|
* FILE: lib/user32/windows/input.c
|
|
|
|
* PURPOSE: Input
|
|
|
|
* PROGRAMMER: Casper S. Hornstrup (chorns@users.sourceforge.net)
|
|
|
|
* UPDATE HISTORY:
|
|
|
|
* 09-05-2001 CSH Created
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* INCLUDES ******************************************************************/
|
|
|
|
|
2005-06-19 18:06:53 +00:00
|
|
|
#include <user32.h>
|
2002-06-13 20:36:40 +00:00
|
|
|
|
2006-06-26 13:16:43 +00:00
|
|
|
#include <wine/debug.h>
|
|
|
|
|
2008-07-09 03:29:43 +00:00
|
|
|
WINE_DEFAULT_DEBUG_CHANNEL(user32);
|
|
|
|
|
2003-11-20 15:35:33 +00:00
|
|
|
#define ATOM_BUFFER_SIZE 256
|
2002-09-03 22:44:21 +00:00
|
|
|
|
2008-07-09 03:29:43 +00:00
|
|
|
/* INTERNAL FUNCTIONS ********************************************************/
|
|
|
|
|
|
|
|
HANDLE
|
|
|
|
FASTCALL
|
|
|
|
IntGetProp(HWND hWnd, ATOM Atom)
|
|
|
|
{
|
|
|
|
PLIST_ENTRY ListEntry, temp;
|
|
|
|
PPROPERTY Property;
|
2009-07-22 05:23:08 +00:00
|
|
|
PWND pWnd;
|
2008-07-09 03:29:43 +00:00
|
|
|
int i;
|
|
|
|
|
|
|
|
pWnd = ValidateHwnd(hWnd);
|
|
|
|
if (!pWnd) return NULL;
|
|
|
|
|
|
|
|
ListEntry = SharedPtrToUser(pWnd->PropListHead.Flink);
|
|
|
|
for (i = 0; i < pWnd->PropListItems; i++ )
|
|
|
|
{
|
|
|
|
Property = CONTAINING_RECORD(ListEntry, PROPERTY, PropListEntry);
|
|
|
|
if (Property->Atom == Atom)
|
|
|
|
{
|
|
|
|
return(Property);
|
|
|
|
}
|
|
|
|
temp = ListEntry->Flink;
|
|
|
|
ListEntry = SharedPtrToUser(temp);
|
|
|
|
}
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2002-06-13 20:36:40 +00:00
|
|
|
/* FUNCTIONS *****************************************************************/
|
|
|
|
|
2003-07-10 21:04:32 +00:00
|
|
|
/*
|
2003-11-20 15:35:33 +00:00
|
|
|
* @implemented
|
2003-07-10 21:04:32 +00:00
|
|
|
*/
|
2008-11-30 11:42:05 +00:00
|
|
|
int WINAPI
|
2003-08-07 04:03:25 +00:00
|
|
|
EnumPropsA(HWND hWnd, PROPENUMPROCA lpEnumFunc)
|
2002-06-13 20:36:40 +00:00
|
|
|
{
|
2003-11-20 15:35:33 +00:00
|
|
|
PPROPLISTITEM pli, i;
|
|
|
|
NTSTATUS Status;
|
|
|
|
DWORD Count;
|
|
|
|
int ret = -1;
|
2005-05-09 01:42:07 +00:00
|
|
|
|
2003-11-20 15:35:33 +00:00
|
|
|
if(!lpEnumFunc)
|
|
|
|
{
|
|
|
|
SetLastError(ERROR_INVALID_PARAMETER);
|
|
|
|
return ret;
|
|
|
|
}
|
2005-05-09 01:42:07 +00:00
|
|
|
|
2003-11-20 15:35:33 +00:00
|
|
|
Status = NtUserBuildPropList(hWnd, NULL, 0, &Count);
|
|
|
|
if(!NT_SUCCESS(Status))
|
|
|
|
{
|
|
|
|
if(Status == STATUS_INVALID_HANDLE)
|
|
|
|
SetLastError(ERROR_INVALID_WINDOW_HANDLE);
|
|
|
|
else
|
|
|
|
SetLastError(RtlNtStatusToDosError(Status));
|
|
|
|
return ret;
|
|
|
|
}
|
2005-05-09 01:42:07 +00:00
|
|
|
|
2003-11-20 15:35:33 +00:00
|
|
|
if(Count > 0)
|
|
|
|
{
|
2004-04-09 20:03:21 +00:00
|
|
|
pli = RtlAllocateHeap(GetProcessHeap(), 0, Count);
|
2005-12-12 20:24:20 +00:00
|
|
|
if (pli == NULL)
|
|
|
|
{
|
|
|
|
SetLastError(ERROR_OUTOFMEMORY);
|
|
|
|
return -1;
|
|
|
|
}
|
2005-05-09 01:42:07 +00:00
|
|
|
|
2003-11-20 15:35:33 +00:00
|
|
|
Status = NtUserBuildPropList(hWnd, (LPVOID)pli, Count, &Count);
|
|
|
|
if(!NT_SUCCESS(Status))
|
|
|
|
{
|
2004-04-09 20:03:21 +00:00
|
|
|
RtlFreeHeap(GetProcessHeap(), 0, pli);
|
2003-11-20 15:35:33 +00:00
|
|
|
if(Status == STATUS_INVALID_HANDLE)
|
|
|
|
SetLastError(ERROR_INVALID_WINDOW_HANDLE);
|
|
|
|
else
|
|
|
|
SetLastError(RtlNtStatusToDosError(Status));
|
|
|
|
return ret;
|
|
|
|
}
|
2005-05-09 01:42:07 +00:00
|
|
|
|
2003-11-20 15:35:33 +00:00
|
|
|
i = pli;
|
|
|
|
for(; Count > 0; Count--, i++)
|
|
|
|
{
|
|
|
|
char str[ATOM_BUFFER_SIZE];
|
2005-05-09 01:42:07 +00:00
|
|
|
|
2003-11-20 15:35:33 +00:00
|
|
|
if(!GlobalGetAtomNameA(i->Atom, str, ATOM_BUFFER_SIZE))
|
|
|
|
continue;
|
2005-05-09 01:42:07 +00:00
|
|
|
|
2003-11-20 15:35:33 +00:00
|
|
|
ret = lpEnumFunc(hWnd, str, i->Data);
|
|
|
|
if(!ret)
|
|
|
|
break;
|
|
|
|
}
|
2005-05-09 01:42:07 +00:00
|
|
|
|
2004-04-09 20:03:21 +00:00
|
|
|
RtlFreeHeap(GetProcessHeap(), 0, pli);
|
2003-11-20 15:35:33 +00:00
|
|
|
}
|
2005-05-09 01:42:07 +00:00
|
|
|
|
2003-11-20 15:35:33 +00:00
|
|
|
return ret;
|
2002-06-13 20:36:40 +00:00
|
|
|
}
|
|
|
|
|
2003-07-10 21:04:32 +00:00
|
|
|
|
|
|
|
/*
|
2003-11-20 15:35:33 +00:00
|
|
|
* @implemented
|
2003-07-10 21:04:32 +00:00
|
|
|
*/
|
2008-11-30 11:42:05 +00:00
|
|
|
int WINAPI
|
2003-08-07 04:03:25 +00:00
|
|
|
EnumPropsExA(HWND hWnd, PROPENUMPROCEXA lpEnumFunc, LPARAM lParam)
|
2002-06-13 20:36:40 +00:00
|
|
|
{
|
2003-11-20 15:35:33 +00:00
|
|
|
PPROPLISTITEM pli, i;
|
|
|
|
NTSTATUS Status;
|
|
|
|
DWORD Count;
|
|
|
|
int ret = -1;
|
2005-05-09 01:42:07 +00:00
|
|
|
|
2003-11-20 15:35:33 +00:00
|
|
|
if(!lpEnumFunc)
|
|
|
|
{
|
|
|
|
SetLastError(ERROR_INVALID_PARAMETER);
|
|
|
|
return ret;
|
|
|
|
}
|
2005-05-09 01:42:07 +00:00
|
|
|
|
2003-11-20 15:35:33 +00:00
|
|
|
Status = NtUserBuildPropList(hWnd, NULL, 0, &Count);
|
|
|
|
if(!NT_SUCCESS(Status))
|
|
|
|
{
|
|
|
|
if(Status == STATUS_INVALID_HANDLE)
|
|
|
|
SetLastError(ERROR_INVALID_WINDOW_HANDLE);
|
|
|
|
else
|
|
|
|
SetLastError(RtlNtStatusToDosError(Status));
|
|
|
|
return ret;
|
|
|
|
}
|
2005-05-09 01:42:07 +00:00
|
|
|
|
2003-11-20 15:35:33 +00:00
|
|
|
if(Count > 0)
|
|
|
|
{
|
2004-04-09 20:03:21 +00:00
|
|
|
pli = RtlAllocateHeap(GetProcessHeap(), 0, Count);
|
2005-12-12 20:24:20 +00:00
|
|
|
if (pli == NULL)
|
|
|
|
{
|
|
|
|
SetLastError(ERROR_OUTOFMEMORY);
|
|
|
|
return -1;
|
|
|
|
}
|
2005-05-09 01:42:07 +00:00
|
|
|
|
2003-11-20 15:35:33 +00:00
|
|
|
Status = NtUserBuildPropList(hWnd, (LPVOID)pli, Count, &Count);
|
|
|
|
if(!NT_SUCCESS(Status))
|
|
|
|
{
|
2004-04-09 20:03:21 +00:00
|
|
|
RtlFreeHeap(GetProcessHeap(), 0, pli);
|
2003-11-20 15:35:33 +00:00
|
|
|
if(Status == STATUS_INVALID_HANDLE)
|
|
|
|
SetLastError(ERROR_INVALID_WINDOW_HANDLE);
|
|
|
|
else
|
|
|
|
SetLastError(RtlNtStatusToDosError(Status));
|
|
|
|
return ret;
|
|
|
|
}
|
2005-05-09 01:42:07 +00:00
|
|
|
|
2003-11-20 15:35:33 +00:00
|
|
|
i = pli;
|
|
|
|
for(; Count > 0; Count--, i++)
|
|
|
|
{
|
|
|
|
char str[ATOM_BUFFER_SIZE];
|
2005-05-09 01:42:07 +00:00
|
|
|
|
2003-11-20 15:35:33 +00:00
|
|
|
if(!GlobalGetAtomNameA(i->Atom, str, ATOM_BUFFER_SIZE))
|
|
|
|
continue;
|
2005-05-09 01:42:07 +00:00
|
|
|
|
2003-11-20 15:35:33 +00:00
|
|
|
ret = lpEnumFunc(hWnd, str, i->Data, lParam);
|
|
|
|
if(!ret)
|
|
|
|
break;
|
|
|
|
}
|
2005-05-09 01:42:07 +00:00
|
|
|
|
2004-04-09 20:03:21 +00:00
|
|
|
RtlFreeHeap(GetProcessHeap(), 0, pli);
|
2003-11-20 15:35:33 +00:00
|
|
|
}
|
2005-05-09 01:42:07 +00:00
|
|
|
|
2003-11-20 15:35:33 +00:00
|
|
|
return ret;
|
2002-06-13 20:36:40 +00:00
|
|
|
}
|
|
|
|
|
2003-07-10 21:04:32 +00:00
|
|
|
|
|
|
|
/*
|
2003-11-20 15:35:33 +00:00
|
|
|
* @implemented
|
2003-07-10 21:04:32 +00:00
|
|
|
*/
|
2008-11-30 11:42:05 +00:00
|
|
|
int WINAPI
|
2003-08-07 04:03:25 +00:00
|
|
|
EnumPropsExW(HWND hWnd, PROPENUMPROCEXW lpEnumFunc, LPARAM lParam)
|
2002-06-13 20:36:40 +00:00
|
|
|
{
|
2003-11-20 15:35:33 +00:00
|
|
|
PPROPLISTITEM pli, i;
|
|
|
|
NTSTATUS Status;
|
|
|
|
DWORD Count;
|
|
|
|
int ret = -1;
|
2005-05-09 01:42:07 +00:00
|
|
|
|
2003-11-20 15:35:33 +00:00
|
|
|
if(!lpEnumFunc)
|
|
|
|
{
|
|
|
|
SetLastError(ERROR_INVALID_PARAMETER);
|
|
|
|
return ret;
|
|
|
|
}
|
2005-05-09 01:42:07 +00:00
|
|
|
|
2003-11-20 15:35:33 +00:00
|
|
|
Status = NtUserBuildPropList(hWnd, NULL, 0, &Count);
|
|
|
|
if(!NT_SUCCESS(Status))
|
|
|
|
{
|
|
|
|
if(Status == STATUS_INVALID_HANDLE)
|
|
|
|
SetLastError(ERROR_INVALID_WINDOW_HANDLE);
|
|
|
|
else
|
|
|
|
SetLastError(RtlNtStatusToDosError(Status));
|
|
|
|
return ret;
|
|
|
|
}
|
2005-05-09 01:42:07 +00:00
|
|
|
|
2003-11-20 15:35:33 +00:00
|
|
|
if(Count > 0)
|
|
|
|
{
|
2004-04-09 20:03:21 +00:00
|
|
|
pli = RtlAllocateHeap(GetProcessHeap(), 0, Count);
|
2005-12-12 20:24:20 +00:00
|
|
|
if (pli == NULL)
|
|
|
|
{
|
|
|
|
SetLastError(ERROR_OUTOFMEMORY);
|
|
|
|
return -1;
|
|
|
|
}
|
2005-05-09 01:42:07 +00:00
|
|
|
|
2003-11-20 15:35:33 +00:00
|
|
|
Status = NtUserBuildPropList(hWnd, (LPVOID)pli, Count, &Count);
|
|
|
|
if(!NT_SUCCESS(Status))
|
|
|
|
{
|
2004-04-09 20:03:21 +00:00
|
|
|
RtlFreeHeap(GetProcessHeap(), 0, pli);
|
2003-11-20 15:35:33 +00:00
|
|
|
if(Status == STATUS_INVALID_HANDLE)
|
|
|
|
SetLastError(ERROR_INVALID_WINDOW_HANDLE);
|
|
|
|
else
|
|
|
|
SetLastError(RtlNtStatusToDosError(Status));
|
|
|
|
return ret;
|
|
|
|
}
|
2005-05-09 01:42:07 +00:00
|
|
|
|
2003-11-20 15:35:33 +00:00
|
|
|
i = pli;
|
|
|
|
for(; Count > 0; Count--, i++)
|
|
|
|
{
|
|
|
|
WCHAR str[ATOM_BUFFER_SIZE];
|
2005-05-09 01:42:07 +00:00
|
|
|
|
2003-11-20 15:35:33 +00:00
|
|
|
if(!GlobalGetAtomNameW(i->Atom, str, ATOM_BUFFER_SIZE))
|
|
|
|
continue;
|
2005-05-09 01:42:07 +00:00
|
|
|
|
2003-11-20 15:35:33 +00:00
|
|
|
ret = lpEnumFunc(hWnd, str, i->Data, lParam);
|
|
|
|
if(!ret)
|
|
|
|
break;
|
|
|
|
}
|
2005-05-09 01:42:07 +00:00
|
|
|
|
2004-04-09 20:03:21 +00:00
|
|
|
RtlFreeHeap(GetProcessHeap(), 0, pli);
|
2003-11-20 15:35:33 +00:00
|
|
|
}
|
2005-05-09 01:42:07 +00:00
|
|
|
|
2003-11-20 15:35:33 +00:00
|
|
|
return ret;
|
2002-06-13 20:36:40 +00:00
|
|
|
}
|
|
|
|
|
2003-07-10 21:04:32 +00:00
|
|
|
|
|
|
|
/*
|
2003-11-20 15:35:33 +00:00
|
|
|
* @implemented
|
2003-07-10 21:04:32 +00:00
|
|
|
*/
|
2008-11-30 11:42:05 +00:00
|
|
|
int WINAPI
|
2003-08-07 04:03:25 +00:00
|
|
|
EnumPropsW(HWND hWnd, PROPENUMPROCW lpEnumFunc)
|
2002-06-13 20:36:40 +00:00
|
|
|
{
|
2003-11-20 15:35:33 +00:00
|
|
|
PPROPLISTITEM pli, i;
|
|
|
|
NTSTATUS Status;
|
|
|
|
DWORD Count;
|
|
|
|
int ret = -1;
|
2005-05-09 01:42:07 +00:00
|
|
|
|
2003-11-20 15:35:33 +00:00
|
|
|
if(!lpEnumFunc)
|
|
|
|
{
|
|
|
|
SetLastError(ERROR_INVALID_PARAMETER);
|
|
|
|
return ret;
|
|
|
|
}
|
2005-05-09 01:42:07 +00:00
|
|
|
|
2003-11-20 15:35:33 +00:00
|
|
|
Status = NtUserBuildPropList(hWnd, NULL, 0, &Count);
|
|
|
|
if(!NT_SUCCESS(Status))
|
|
|
|
{
|
|
|
|
if(Status == STATUS_INVALID_HANDLE)
|
|
|
|
SetLastError(ERROR_INVALID_WINDOW_HANDLE);
|
|
|
|
else
|
|
|
|
SetLastError(RtlNtStatusToDosError(Status));
|
|
|
|
return ret;
|
|
|
|
}
|
2005-05-09 01:42:07 +00:00
|
|
|
|
2003-11-20 15:35:33 +00:00
|
|
|
if(Count > 0)
|
|
|
|
{
|
2004-04-09 20:03:21 +00:00
|
|
|
pli = RtlAllocateHeap(GetProcessHeap(), 0, Count);
|
2005-12-12 20:24:20 +00:00
|
|
|
if (pli == NULL)
|
|
|
|
{
|
|
|
|
SetLastError(ERROR_OUTOFMEMORY);
|
|
|
|
return -1;
|
|
|
|
}
|
2005-05-09 01:42:07 +00:00
|
|
|
|
2003-11-20 15:35:33 +00:00
|
|
|
Status = NtUserBuildPropList(hWnd, (LPVOID)pli, Count, &Count);
|
|
|
|
if(!NT_SUCCESS(Status))
|
|
|
|
{
|
2004-04-09 20:03:21 +00:00
|
|
|
RtlFreeHeap(GetProcessHeap(), 0, pli);
|
2003-11-20 15:35:33 +00:00
|
|
|
if(Status == STATUS_INVALID_HANDLE)
|
|
|
|
SetLastError(ERROR_INVALID_WINDOW_HANDLE);
|
|
|
|
else
|
|
|
|
SetLastError(RtlNtStatusToDosError(Status));
|
|
|
|
return ret;
|
|
|
|
}
|
2005-05-09 01:42:07 +00:00
|
|
|
|
2003-11-20 15:35:33 +00:00
|
|
|
i = pli;
|
|
|
|
for(; Count > 0; Count--, i++)
|
|
|
|
{
|
|
|
|
WCHAR str[ATOM_BUFFER_SIZE];
|
2005-05-09 01:42:07 +00:00
|
|
|
|
2003-11-20 15:35:33 +00:00
|
|
|
if(!GlobalGetAtomNameW(i->Atom, str, ATOM_BUFFER_SIZE))
|
|
|
|
continue;
|
2005-05-09 01:42:07 +00:00
|
|
|
|
2003-11-20 15:35:33 +00:00
|
|
|
ret = lpEnumFunc(hWnd, str, i->Data);
|
|
|
|
if(!ret)
|
|
|
|
break;
|
|
|
|
}
|
2005-05-09 01:42:07 +00:00
|
|
|
|
2004-04-09 20:03:21 +00:00
|
|
|
RtlFreeHeap(GetProcessHeap(), 0, pli);
|
2003-11-20 15:35:33 +00:00
|
|
|
}
|
2005-05-09 01:42:07 +00:00
|
|
|
|
2003-11-20 15:35:33 +00:00
|
|
|
return ret;
|
2002-06-13 20:36:40 +00:00
|
|
|
}
|
2002-09-03 22:44:21 +00:00
|
|
|
|
2003-07-10 21:04:32 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* @implemented
|
|
|
|
*/
|
2008-11-30 11:42:05 +00:00
|
|
|
HANDLE WINAPI
|
2002-09-03 22:44:21 +00:00
|
|
|
GetPropA(HWND hWnd, LPCSTR lpString)
|
2002-06-13 20:36:40 +00:00
|
|
|
{
|
2002-09-03 22:44:21 +00:00
|
|
|
PWSTR lpWString;
|
2002-09-17 23:46:23 +00:00
|
|
|
UNICODE_STRING UString;
|
2002-09-03 22:44:21 +00:00
|
|
|
HANDLE Ret;
|
|
|
|
if (HIWORD(lpString))
|
|
|
|
{
|
2002-09-17 23:46:23 +00:00
|
|
|
RtlCreateUnicodeStringFromAsciiz(&UString, (LPSTR)lpString);
|
|
|
|
lpWString = UString.Buffer;
|
2002-09-03 22:44:21 +00:00
|
|
|
if (lpWString == NULL)
|
|
|
|
{
|
|
|
|
return(FALSE);
|
|
|
|
}
|
|
|
|
Ret = GetPropW(hWnd, lpWString);
|
2002-09-17 23:46:23 +00:00
|
|
|
RtlFreeUnicodeString(&UString);
|
2002-09-03 22:44:21 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2002-09-17 23:46:23 +00:00
|
|
|
Ret = GetPropW(hWnd, (LPWSTR)lpString);
|
2005-05-09 01:42:07 +00:00
|
|
|
}
|
2002-09-03 22:44:21 +00:00
|
|
|
return(Ret);
|
2002-06-13 20:36:40 +00:00
|
|
|
}
|
|
|
|
|
2003-07-10 21:04:32 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* @implemented
|
|
|
|
*/
|
2008-11-30 11:42:05 +00:00
|
|
|
HANDLE WINAPI
|
2002-09-03 22:44:21 +00:00
|
|
|
GetPropW(HWND hWnd, LPCWSTR lpString)
|
2002-06-13 20:36:40 +00:00
|
|
|
{
|
2002-09-03 22:44:21 +00:00
|
|
|
ATOM Atom;
|
2008-07-09 03:29:43 +00:00
|
|
|
HANDLE Data = NULL;
|
|
|
|
PPROPERTY Prop;
|
2002-09-03 22:44:21 +00:00
|
|
|
if (HIWORD(lpString))
|
2008-07-09 03:29:43 +00:00
|
|
|
{
|
|
|
|
Atom = GlobalFindAtomW(lpString);
|
|
|
|
}
|
2002-09-03 22:44:21 +00:00
|
|
|
else
|
2008-07-09 03:29:43 +00:00
|
|
|
{
|
2010-06-27 22:19:17 +00:00
|
|
|
Atom = LOWORD((DWORD_PTR)lpString);
|
2008-07-09 03:29:43 +00:00
|
|
|
}
|
|
|
|
Prop = IntGetProp(hWnd, Atom);
|
|
|
|
if (Prop != NULL) Data = Prop->Data;
|
|
|
|
return Data;
|
2002-06-13 20:36:40 +00:00
|
|
|
}
|
2002-09-03 22:44:21 +00:00
|
|
|
|
2003-07-10 21:04:32 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* @implemented
|
|
|
|
*/
|
2008-11-30 11:42:05 +00:00
|
|
|
HANDLE WINAPI
|
2002-09-03 22:44:21 +00:00
|
|
|
RemovePropA(HWND hWnd, LPCSTR lpString)
|
2002-06-13 20:36:40 +00:00
|
|
|
{
|
2002-09-03 22:44:21 +00:00
|
|
|
PWSTR lpWString;
|
2002-09-17 23:46:23 +00:00
|
|
|
UNICODE_STRING UString;
|
2002-09-03 22:44:21 +00:00
|
|
|
HANDLE Ret;
|
|
|
|
|
|
|
|
if (HIWORD(lpString))
|
|
|
|
{
|
2002-09-17 23:46:23 +00:00
|
|
|
RtlCreateUnicodeStringFromAsciiz(&UString, (LPSTR)lpString);
|
|
|
|
lpWString = UString.Buffer;
|
2002-09-03 22:44:21 +00:00
|
|
|
if (lpWString == NULL)
|
|
|
|
{
|
|
|
|
return(FALSE);
|
|
|
|
}
|
|
|
|
Ret = RemovePropW(hWnd, lpWString);
|
2002-09-17 23:46:23 +00:00
|
|
|
RtlFreeUnicodeString(&UString);
|
2002-09-03 22:44:21 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2002-11-05 20:58:20 +00:00
|
|
|
Ret = RemovePropW(hWnd, (LPCWSTR)lpString);
|
2002-09-03 22:44:21 +00:00
|
|
|
}
|
|
|
|
return(Ret);
|
2002-06-13 20:36:40 +00:00
|
|
|
}
|
|
|
|
|
2003-07-10 21:04:32 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* @implemented
|
|
|
|
*/
|
2008-11-30 11:42:05 +00:00
|
|
|
HANDLE WINAPI
|
2002-09-03 22:44:21 +00:00
|
|
|
RemovePropW(HWND hWnd,
|
|
|
|
LPCWSTR lpString)
|
2002-06-13 20:36:40 +00:00
|
|
|
{
|
2002-09-03 22:44:21 +00:00
|
|
|
ATOM Atom;
|
|
|
|
if (HIWORD(lpString))
|
|
|
|
{
|
|
|
|
Atom = GlobalFindAtomW(lpString);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2010-06-27 22:19:17 +00:00
|
|
|
Atom = LOWORD((DWORD_PTR)lpString);
|
2002-09-03 22:44:21 +00:00
|
|
|
}
|
|
|
|
return(NtUserRemoveProp(hWnd, Atom));
|
2002-06-13 20:36:40 +00:00
|
|
|
}
|
2002-09-03 22:44:21 +00:00
|
|
|
|
2003-07-10 21:04:32 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* @implemented
|
|
|
|
*/
|
2008-11-30 11:42:05 +00:00
|
|
|
BOOL WINAPI
|
2002-09-03 22:44:21 +00:00
|
|
|
SetPropA(HWND hWnd, LPCSTR lpString, HANDLE hData)
|
2002-06-13 20:36:40 +00:00
|
|
|
{
|
2002-09-03 22:44:21 +00:00
|
|
|
PWSTR lpWString;
|
2002-09-17 23:46:23 +00:00
|
|
|
UNICODE_STRING UString;
|
2002-09-03 22:44:21 +00:00
|
|
|
BOOL Ret;
|
2005-05-09 01:42:07 +00:00
|
|
|
|
2002-09-03 22:44:21 +00:00
|
|
|
if (HIWORD(lpString))
|
|
|
|
{
|
2002-09-17 23:46:23 +00:00
|
|
|
RtlCreateUnicodeStringFromAsciiz(&UString, (LPSTR)lpString);
|
|
|
|
lpWString = UString.Buffer;
|
2002-09-03 22:44:21 +00:00
|
|
|
if (lpWString == NULL)
|
|
|
|
{
|
|
|
|
return(FALSE);
|
|
|
|
}
|
|
|
|
Ret = SetPropW(hWnd, lpWString, hData);
|
2002-09-17 23:46:23 +00:00
|
|
|
RtlFreeUnicodeString(&UString);
|
2002-09-03 22:44:21 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2002-09-17 23:46:23 +00:00
|
|
|
Ret = SetPropW(hWnd, (LPWSTR)lpString, hData);
|
2002-09-03 22:44:21 +00:00
|
|
|
}
|
|
|
|
return(Ret);
|
2002-06-13 20:36:40 +00:00
|
|
|
}
|
|
|
|
|
2003-07-10 21:04:32 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* @implemented
|
|
|
|
*/
|
2008-11-30 11:42:05 +00:00
|
|
|
BOOL WINAPI
|
2002-09-03 22:44:21 +00:00
|
|
|
SetPropW(HWND hWnd, LPCWSTR lpString, HANDLE hData)
|
2002-06-13 20:36:40 +00:00
|
|
|
{
|
2002-09-03 22:44:21 +00:00
|
|
|
ATOM Atom;
|
|
|
|
if (HIWORD(lpString))
|
|
|
|
{
|
2003-11-20 15:35:33 +00:00
|
|
|
Atom = GlobalAddAtomW(lpString);
|
2002-09-03 22:44:21 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2010-06-27 22:19:17 +00:00
|
|
|
Atom = LOWORD((DWORD_PTR)lpString);
|
2002-09-03 22:44:21 +00:00
|
|
|
}
|
2005-05-09 01:42:07 +00:00
|
|
|
|
2002-09-03 22:44:21 +00:00
|
|
|
return(NtUserSetProp(hWnd, Atom, hData));
|
2002-06-13 20:36:40 +00:00
|
|
|
}
|