3 * Copyright (C) 2003 ReactOS Team
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 * PROJECT: ReactOS gdi32.dll
22 * FILE: lib/gdi32/misc/misc.c
23 * PURPOSE: Miscellaneous functions
24 * PROGRAMMER: Thomas Weidenmueller <w3seek@reactos.com>
31 PGDI_TABLE_ENTRY GdiHandleTable
= NULL
;
32 HANDLE CurrentProcessId
= NULL
;
41 return (PVOID
)GdiHandleTable
;
44 BOOL
GdiIsHandleValid(HGDIOBJ hGdiObj
)
46 PGDI_TABLE_ENTRY Entry
= GdiHandleTable
+ GDI_HANDLE_GET_INDEX(hGdiObj
);
47 if(Entry
->KernelData
!= NULL
&& (Entry
->Type
& GDI_HANDLE_TYPE_MASK
) == (LONG
)GDI_HANDLE_GET_TYPE(hGdiObj
))
49 HANDLE pid
= (HANDLE
)((ULONG_PTR
)Entry
->ProcessId
& ~0x1);
50 if(pid
== NULL
|| pid
== CurrentProcessId
)
58 BOOL
GdiGetHandleUserData(HGDIOBJ hGdiObj
, PVOID
*UserData
)
60 PGDI_TABLE_ENTRY Entry
= GdiHandleTable
+ GDI_HANDLE_GET_INDEX(hGdiObj
);
61 if(Entry
->KernelData
!= NULL
&& (Entry
->Type
& GDI_HANDLE_TYPE_MASK
) == (LONG
)GDI_HANDLE_GET_TYPE(hGdiObj
))
63 HANDLE pid
= (HANDLE
)((ULONG_PTR
)Entry
->ProcessId
& ~0x1);
64 if(pid
== NULL
|| pid
== CurrentProcessId
)
66 *UserData
= Entry
->UserData
;