mirror of
https://github.com/reactos/reactos.git
synced 2024-10-07 01:44:21 +00:00
[Win32k]
- Fix an uncovered bug. This should fix coolplayer and winamp type applications. Does not fix drawing issues. svn path=/trunk/; revision=51008
This commit is contained in:
parent
a2453433f1
commit
729ce068d8
|
@ -160,3 +160,7 @@ INT FASTCALL GreGetObjectOwner(HGDIOBJ, GDIOBJTYPE);
|
|||
|
||||
#define GDIOBJ_GetKernelObj(Handle) \
|
||||
((PGDI_TABLE_ENTRY)&GdiHandleTable->Entries[GDI_HANDLE_GET_INDEX(Handle)])->KernelData
|
||||
#define GDI_ENTRY_TO_INDEX(ht, e) \
|
||||
(((ULONG_PTR)(e) - (ULONG_PTR)&((ht)->Entries[0])) / sizeof(GDI_TABLE_ENTRY))
|
||||
#define GDI_HANDLE_GET_ENTRY(HandleTable, h) \
|
||||
(&(HandleTable)->Entries[GDI_HANDLE_GET_INDEX((h))])
|
||||
|
|
|
@ -12,11 +12,6 @@
|
|||
#define NDEBUG
|
||||
#include <debug.h>
|
||||
|
||||
#define GDI_ENTRY_TO_INDEX(ht, e) \
|
||||
(((ULONG_PTR)(e) - (ULONG_PTR)&((ht)->Entries[0])) / sizeof(GDI_TABLE_ENTRY))
|
||||
#define GDI_HANDLE_GET_ENTRY(HandleTable, h) \
|
||||
(&(HandleTable)->Entries[GDI_HANDLE_GET_INDEX((h))])
|
||||
|
||||
#define BASE_OBJTYPE_COUNT 32
|
||||
|
||||
#define DelayExecution() \
|
||||
|
|
|
@ -2073,14 +2073,12 @@ FASTCALL
|
|||
REGION_AllocUserRgnWithHandle(INT nRgn)
|
||||
{
|
||||
PROSRGNDATA pRgn;
|
||||
INT Index;
|
||||
PGDI_TABLE_ENTRY Entry;
|
||||
|
||||
pRgn = REGION_AllocRgnWithHandle(nRgn);
|
||||
if (pRgn)
|
||||
{
|
||||
Index = GDI_HANDLE_GET_INDEX(pRgn->BaseObject.hHmgr);
|
||||
Entry = &GdiHandleTable->Entries[Index];
|
||||
Entry = GDI_HANDLE_GET_ENTRY(GdiHandleTable, pRgn->BaseObject.hHmgr);
|
||||
Entry->UserData = AllocateObjectAttr();
|
||||
}
|
||||
return pRgn;
|
||||
|
@ -2090,23 +2088,18 @@ PROSRGNDATA
|
|||
FASTCALL
|
||||
RGNOBJAPI_Lock(HRGN hRgn, PRGN_ATTR *ppRgn_Attr)
|
||||
{
|
||||
INT Index;
|
||||
PGDI_TABLE_ENTRY Entry;
|
||||
PROSRGNDATA pRgn;
|
||||
PRGN_ATTR pRgn_Attr;
|
||||
HANDLE pid;
|
||||
PROSRGNDATA pRgn = NULL;
|
||||
|
||||
pRgn = REGION_LockRgn(hRgn);
|
||||
|
||||
if (pRgn)
|
||||
if (pRgn && GDIOBJ_OwnedByCurrentProcess(hRgn))
|
||||
{
|
||||
Index = GDI_HANDLE_GET_INDEX(hRgn);
|
||||
Entry = &GdiHandleTable->Entries[Index];
|
||||
Entry = GDI_HANDLE_GET_ENTRY(GdiHandleTable, hRgn);
|
||||
pRgn_Attr = Entry->UserData;
|
||||
pid = (HANDLE)((ULONG_PTR)Entry->ProcessId & ~0x1);
|
||||
|
||||
if ( pid == NtCurrentTeb()->ClientId.UniqueProcess &&
|
||||
pRgn_Attr )
|
||||
if ( pRgn_Attr )
|
||||
{
|
||||
_SEH2_TRY
|
||||
{
|
||||
|
@ -2151,20 +2144,15 @@ VOID
|
|||
FASTCALL
|
||||
RGNOBJAPI_Unlock(PROSRGNDATA pRgn)
|
||||
{
|
||||
INT Index;
|
||||
PGDI_TABLE_ENTRY Entry;
|
||||
PRGN_ATTR pRgn_Attr;
|
||||
HANDLE pid;
|
||||
|
||||
if (pRgn)
|
||||
if (pRgn && GDIOBJ_OwnedByCurrentProcess(pRgn->BaseObject.hHmgr))
|
||||
{
|
||||
Index = GDI_HANDLE_GET_INDEX(pRgn->BaseObject.hHmgr);
|
||||
Entry = &GdiHandleTable->Entries[Index];
|
||||
Entry = GDI_HANDLE_GET_ENTRY(GdiHandleTable, pRgn->BaseObject.hHmgr);
|
||||
pRgn_Attr = Entry->UserData;
|
||||
pid = (HANDLE)((ULONG_PTR)Entry->ProcessId & ~0x1);
|
||||
|
||||
if ( pid == NtCurrentTeb()->ClientId.UniqueProcess &&
|
||||
pRgn_Attr )
|
||||
if ( pRgn_Attr )
|
||||
{
|
||||
_SEH2_TRY
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue