mirror of
https://github.com/reactos/reactos.git
synced 2024-07-24 05:08:16 +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) \
|
#define GDIOBJ_GetKernelObj(Handle) \
|
||||||
((PGDI_TABLE_ENTRY)&GdiHandleTable->Entries[GDI_HANDLE_GET_INDEX(Handle)])->KernelData
|
((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
|
#define NDEBUG
|
||||||
#include <debug.h>
|
#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 BASE_OBJTYPE_COUNT 32
|
||||||
|
|
||||||
#define DelayExecution() \
|
#define DelayExecution() \
|
||||||
|
|
|
@ -2073,14 +2073,12 @@ FASTCALL
|
||||||
REGION_AllocUserRgnWithHandle(INT nRgn)
|
REGION_AllocUserRgnWithHandle(INT nRgn)
|
||||||
{
|
{
|
||||||
PROSRGNDATA pRgn;
|
PROSRGNDATA pRgn;
|
||||||
INT Index;
|
|
||||||
PGDI_TABLE_ENTRY Entry;
|
PGDI_TABLE_ENTRY Entry;
|
||||||
|
|
||||||
pRgn = REGION_AllocRgnWithHandle(nRgn);
|
pRgn = REGION_AllocRgnWithHandle(nRgn);
|
||||||
if (pRgn)
|
if (pRgn)
|
||||||
{
|
{
|
||||||
Index = GDI_HANDLE_GET_INDEX(pRgn->BaseObject.hHmgr);
|
Entry = GDI_HANDLE_GET_ENTRY(GdiHandleTable, pRgn->BaseObject.hHmgr);
|
||||||
Entry = &GdiHandleTable->Entries[Index];
|
|
||||||
Entry->UserData = AllocateObjectAttr();
|
Entry->UserData = AllocateObjectAttr();
|
||||||
}
|
}
|
||||||
return pRgn;
|
return pRgn;
|
||||||
|
@ -2090,23 +2088,18 @@ PROSRGNDATA
|
||||||
FASTCALL
|
FASTCALL
|
||||||
RGNOBJAPI_Lock(HRGN hRgn, PRGN_ATTR *ppRgn_Attr)
|
RGNOBJAPI_Lock(HRGN hRgn, PRGN_ATTR *ppRgn_Attr)
|
||||||
{
|
{
|
||||||
INT Index;
|
|
||||||
PGDI_TABLE_ENTRY Entry;
|
PGDI_TABLE_ENTRY Entry;
|
||||||
PROSRGNDATA pRgn;
|
|
||||||
PRGN_ATTR pRgn_Attr;
|
PRGN_ATTR pRgn_Attr;
|
||||||
HANDLE pid;
|
PROSRGNDATA pRgn = NULL;
|
||||||
|
|
||||||
pRgn = REGION_LockRgn(hRgn);
|
pRgn = REGION_LockRgn(hRgn);
|
||||||
|
|
||||||
if (pRgn)
|
if (pRgn && GDIOBJ_OwnedByCurrentProcess(hRgn))
|
||||||
{
|
{
|
||||||
Index = GDI_HANDLE_GET_INDEX(hRgn);
|
Entry = GDI_HANDLE_GET_ENTRY(GdiHandleTable, hRgn);
|
||||||
Entry = &GdiHandleTable->Entries[Index];
|
|
||||||
pRgn_Attr = Entry->UserData;
|
pRgn_Attr = Entry->UserData;
|
||||||
pid = (HANDLE)((ULONG_PTR)Entry->ProcessId & ~0x1);
|
|
||||||
|
|
||||||
if ( pid == NtCurrentTeb()->ClientId.UniqueProcess &&
|
if ( pRgn_Attr )
|
||||||
pRgn_Attr )
|
|
||||||
{
|
{
|
||||||
_SEH2_TRY
|
_SEH2_TRY
|
||||||
{
|
{
|
||||||
|
@ -2151,20 +2144,15 @@ VOID
|
||||||
FASTCALL
|
FASTCALL
|
||||||
RGNOBJAPI_Unlock(PROSRGNDATA pRgn)
|
RGNOBJAPI_Unlock(PROSRGNDATA pRgn)
|
||||||
{
|
{
|
||||||
INT Index;
|
|
||||||
PGDI_TABLE_ENTRY Entry;
|
PGDI_TABLE_ENTRY Entry;
|
||||||
PRGN_ATTR pRgn_Attr;
|
PRGN_ATTR pRgn_Attr;
|
||||||
HANDLE pid;
|
|
||||||
|
|
||||||
if (pRgn)
|
if (pRgn && GDIOBJ_OwnedByCurrentProcess(pRgn->BaseObject.hHmgr))
|
||||||
{
|
{
|
||||||
Index = GDI_HANDLE_GET_INDEX(pRgn->BaseObject.hHmgr);
|
Entry = GDI_HANDLE_GET_ENTRY(GdiHandleTable, pRgn->BaseObject.hHmgr);
|
||||||
Entry = &GdiHandleTable->Entries[Index];
|
|
||||||
pRgn_Attr = Entry->UserData;
|
pRgn_Attr = Entry->UserData;
|
||||||
pid = (HANDLE)((ULONG_PTR)Entry->ProcessId & ~0x1);
|
|
||||||
|
|
||||||
if ( pid == NtCurrentTeb()->ClientId.UniqueProcess &&
|
if ( pRgn_Attr )
|
||||||
pRgn_Attr )
|
|
||||||
{
|
{
|
||||||
_SEH2_TRY
|
_SEH2_TRY
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue