mirror of
https://github.com/reactos/reactos.git
synced 2024-07-05 12:15:46 +00:00
1. Cleanup GDI objects when process is deleted.
2. Bug fixes. svn path=/trunk/; revision=3590
This commit is contained in:
parent
784dc1a198
commit
c6002facd3
|
@ -18,12 +18,12 @@ void __stdcall Background (HDC Desktop)
|
||||||
|
|
||||||
MoveToEx (Desktop, 0, 0, NULL);
|
MoveToEx (Desktop, 0, 0, NULL);
|
||||||
LineTo (Desktop, 640, 480);
|
LineTo (Desktop, 640, 480);
|
||||||
for (y = 479, x = 0; x < 640; x+=2)
|
for (y = 479, x = 0; x < 640; x+=42)
|
||||||
{
|
{
|
||||||
MoveToEx (Desktop, 0, 0, NULL);
|
MoveToEx (Desktop, 0, 0, NULL);
|
||||||
LineTo (Desktop, x, y);
|
LineTo (Desktop, x, y);
|
||||||
}
|
}
|
||||||
for (y = 0, x = 639; y < 480; y+=2)
|
for (y = 0, x = 639; y < 480; y+=42)
|
||||||
{
|
{
|
||||||
MoveToEx (Desktop, 0, 0, NULL);
|
MoveToEx (Desktop, 0, 0, NULL);
|
||||||
LineTo (Desktop, x, y);
|
LineTo (Desktop, x, y);
|
||||||
|
|
|
@ -58,6 +58,7 @@ W32kDeleteDC 1
|
||||||
W32kDeleteEnhMetaFile 1
|
W32kDeleteEnhMetaFile 1
|
||||||
W32kDeleteMetaFile 1
|
W32kDeleteMetaFile 1
|
||||||
W32kDeleteObject 1
|
W32kDeleteObject 1
|
||||||
|
W32kCleanupForProcess 1
|
||||||
W32kDescribePixelFormat 4
|
W32kDescribePixelFormat 4
|
||||||
#W32kDeviceCapabilitiesEx ?
|
#W32kDeviceCapabilitiesEx ?
|
||||||
W32kDrawEscape 4
|
W32kDrawEscape 4
|
||||||
|
|
|
@ -30,7 +30,7 @@ typedef struct _BITMAPOBJ
|
||||||
#define BITMAPOBJ_AllocBitmap() \
|
#define BITMAPOBJ_AllocBitmap() \
|
||||||
((HBITMAP) GDIOBJ_AllocObj (sizeof (BITMAPOBJ), GO_BITMAP_MAGIC))
|
((HBITMAP) GDIOBJ_AllocObj (sizeof (BITMAPOBJ), GO_BITMAP_MAGIC))
|
||||||
#define BITMAPOBJ_FreeBitmap(hBMObj) \
|
#define BITMAPOBJ_FreeBitmap(hBMObj) \
|
||||||
GDIOBJ_FreeObj((HGDIOBJ) hBMObj, GO_BITMAP_MAGIC)
|
GDIOBJ_FreeObj((HGDIOBJ) hBMObj, GO_BITMAP_MAGIC, GDIOBJFLAG_DEFAULT)
|
||||||
#define BITMAPOBJ_HandleToPtr(hBMObj) \
|
#define BITMAPOBJ_HandleToPtr(hBMObj) \
|
||||||
((PBITMAPOBJ) GDIOBJ_LockObj ((HGDIOBJ) hBMObj, GO_BITMAP_MAGIC))
|
((PBITMAPOBJ) GDIOBJ_LockObj ((HGDIOBJ) hBMObj, GO_BITMAP_MAGIC))
|
||||||
#define BITMAPOBJ_ReleasePtr(hBMObj) \
|
#define BITMAPOBJ_ReleasePtr(hBMObj) \
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
|
|
||||||
#define BRUSHOBJ_AllocBrush() \
|
#define BRUSHOBJ_AllocBrush() \
|
||||||
((HBRUSH) GDIOBJ_AllocObj (sizeof (BRUSHOBJ), GO_BRUSH_MAGIC))
|
((HBRUSH) GDIOBJ_AllocObj (sizeof (BRUSHOBJ), GO_BRUSH_MAGIC))
|
||||||
#define BRUSHOBJ_FreeBrush(hBrush) GDIOBJ_FreeObj((HGDIOBJ)hBrush, GO_BRUSH_MAGIC)
|
#define BRUSHOBJ_FreeBrush(hBrush) GDIOBJ_FreeObj((HGDIOBJ)hBrush, GO_BRUSH_MAGIC, GDIOBJFLAG_DEFAULT)
|
||||||
/*#define BRUSHOBJ_HandleToPtr(hBrush) \
|
/*#define BRUSHOBJ_HandleToPtr(hBrush) \
|
||||||
((PBRUSHOBJ) GDIOBJ_HandleToPtr ((HGDIOBJ) hBrush, GO_BRUSH_MAGIC))
|
((PBRUSHOBJ) GDIOBJ_HandleToPtr ((HGDIOBJ) hBrush, GO_BRUSH_MAGIC))
|
||||||
#define BRUSHOBJ_PtrToHandle(pBrushObj) \
|
#define BRUSHOBJ_PtrToHandle(pBrushObj) \
|
||||||
|
|
|
@ -76,11 +76,16 @@ typedef struct _GDI_HANDLE_TABLE
|
||||||
} GDI_HANDLE_TABLE, *PGDI_HANDLE_TABLE;
|
} GDI_HANDLE_TABLE, *PGDI_HANDLE_TABLE;
|
||||||
|
|
||||||
HGDIOBJ GDIOBJ_AllocObj(WORD Size, WORD Magic);
|
HGDIOBJ GDIOBJ_AllocObj(WORD Size, WORD Magic);
|
||||||
BOOL GDIOBJ_FreeObj (HGDIOBJ Obj, WORD Magic);
|
BOOL GDIOBJ_FreeObj (HGDIOBJ Obj, WORD Magic, DWORD Flag);
|
||||||
PGDIOBJ GDIOBJ_LockObj (HGDIOBJ Obj, WORD Magic);
|
PGDIOBJ GDIOBJ_LockObj (HGDIOBJ Obj, WORD Magic);
|
||||||
BOOL GDIOBJ_UnlockObj (HGDIOBJ Obj, WORD Magic);
|
BOOL GDIOBJ_UnlockObj (HGDIOBJ Obj, WORD Magic);
|
||||||
WORD GDIOBJ_GetHandleMagic (HGDIOBJ ObjectHandle);
|
WORD GDIOBJ_GetHandleMagic (HGDIOBJ ObjectHandle);
|
||||||
VOID STDCALL W32kDumpGdiObjects( INT Process );
|
VOID STDCALL W32kDumpGdiObjects( INT Process );
|
||||||
|
BOOL STDCALL W32kCleanupForProcess( INT Process );
|
||||||
|
|
||||||
|
#define GDIOBJFLAG_DEFAULT (0x0)
|
||||||
|
#define GDIOBJFLAG_IGNOREPID (0x1)
|
||||||
|
#define GDIOBJFLAG_IGNORELOCK (0x2)
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,7 @@ typedef struct
|
||||||
|
|
||||||
#define PENOBJ_AllocPen() \
|
#define PENOBJ_AllocPen() \
|
||||||
((HPEN) GDIOBJ_AllocObj (sizeof (PENOBJ), GO_PEN_MAGIC))
|
((HPEN) GDIOBJ_AllocObj (sizeof (PENOBJ), GO_PEN_MAGIC))
|
||||||
#define PENOBJ_FreePen(hBMObj) GDIOBJ_FreeObj((HGDIOBJ) hBMObj)
|
#define PENOBJ_FreePen(hBMObj) GDIOBJ_FreeObj((HGDIOBJ) hBMObj, GO_PEN_MAGIC, GDIOBJFLAG_DEFAULT)
|
||||||
/*
|
/*
|
||||||
#define PENOBJ_HandleToPtr(hBMObj) \
|
#define PENOBJ_HandleToPtr(hBMObj) \
|
||||||
((PPENOBJ) GDIOBJ_HandleToPtr ((HGDIOBJ) hBMObj, GO_PEN_MAGIC))
|
((PPENOBJ) GDIOBJ_HandleToPtr ((HGDIOBJ) hBMObj, GO_PEN_MAGIC))
|
||||||
|
|
|
@ -11,7 +11,7 @@ typedef struct _ROSRGNDATA {
|
||||||
} ROSRGNDATA, *PROSRGNDATA, *LPROSRGNDATA;
|
} ROSRGNDATA, *PROSRGNDATA, *LPROSRGNDATA;
|
||||||
|
|
||||||
|
|
||||||
#define RGNDATA_FreeRgn(hRgn) GDIOBJ_FreeObj((HGDIOBJ)hRgn, GO_REGION_MAGIC)
|
#define RGNDATA_FreeRgn(hRgn) GDIOBJ_FreeObj((HGDIOBJ)hRgn, GO_REGION_MAGIC, GDIOBJFLAG_DEFAULT)
|
||||||
#define RGNDATA_LockRgn(hRgn) ((PROSRGNDATA)GDIOBJ_LockObj((HGDIOBJ)hRgn, GO_REGION_MAGIC))
|
#define RGNDATA_LockRgn(hRgn) ((PROSRGNDATA)GDIOBJ_LockObj((HGDIOBJ)hRgn, GO_REGION_MAGIC))
|
||||||
#define RGNDATA_UnlockRgn(hRgn) GDIOBJ_UnlockObj((HGDIOBJ)hRgn, GO_REGION_MAGIC)
|
#define RGNDATA_UnlockRgn(hRgn) GDIOBJ_UnlockObj((HGDIOBJ)hRgn, GO_REGION_MAGIC)
|
||||||
HRGN RGNDATA_AllocRgn(INT n);
|
HRGN RGNDATA_AllocRgn(INT n);
|
||||||
|
|
|
@ -12,7 +12,7 @@ typedef struct
|
||||||
|
|
||||||
#define TEXTOBJ_AllocText() \
|
#define TEXTOBJ_AllocText() \
|
||||||
((HFONT) GDIOBJ_AllocObj (sizeof (TEXTOBJ), GO_FONT_MAGIC))
|
((HFONT) GDIOBJ_AllocObj (sizeof (TEXTOBJ), GO_FONT_MAGIC))
|
||||||
#define TEXTOBJ_FreeText(hBMObj) GDIOBJ_FreeObj((HGDIOBJ) hBMObj, GO_FONT_MAGIC)
|
#define TEXTOBJ_FreeText(hBMObj) GDIOBJ_FreeObj((HGDIOBJ) hBMObj, GO_FONT_MAGIC, GDIOBJFLAG_DEFAULT)
|
||||||
/*
|
/*
|
||||||
#define TEXTOBJ_HandleToPtr(hBMObj) \
|
#define TEXTOBJ_HandleToPtr(hBMObj) \
|
||||||
((PTEXTOBJ) GDIOBJ_HandleToPtr ((HGDIOBJ) hBMObj, GO_FONT_MAGIC))
|
((PTEXTOBJ) GDIOBJ_HandleToPtr ((HGDIOBJ) hBMObj, GO_FONT_MAGIC))
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: process.c,v 1.19 2002/09/08 10:23:45 chorns Exp $
|
/* $Id: process.c,v 1.20 2002/10/01 06:41:56 ei Exp $
|
||||||
*
|
*
|
||||||
* reactos/subsys/csrss/api/process.c
|
* reactos/subsys/csrss/api/process.c
|
||||||
*
|
*
|
||||||
|
@ -15,6 +15,8 @@
|
||||||
#include <ntdll/rtl.h>
|
#include <ntdll/rtl.h>
|
||||||
#include "api.h"
|
#include "api.h"
|
||||||
|
|
||||||
|
BOOL STDCALL W32kCleanupForProcess( INT Process );
|
||||||
|
|
||||||
#define LOCK RtlEnterCriticalSection(&ProcessDataLock)
|
#define LOCK RtlEnterCriticalSection(&ProcessDataLock)
|
||||||
#define UNLOCK RtlLeaveCriticalSection(&ProcessDataLock)
|
#define UNLOCK RtlLeaveCriticalSection(&ProcessDataLock)
|
||||||
|
|
||||||
|
@ -58,7 +60,7 @@ PCSRSS_PROCESS_DATA STDCALL CsrGetProcessData(ULONG ProcessId)
|
||||||
for (i=0; i<NrProcess; i++)
|
for (i=0; i<NrProcess; i++)
|
||||||
{
|
{
|
||||||
if (ProcessData[i] == NULL)
|
if (ProcessData[i] == NULL)
|
||||||
{
|
{
|
||||||
ProcessData[i] = RtlAllocateHeap(CsrssApiHeap,
|
ProcessData[i] = RtlAllocateHeap(CsrssApiHeap,
|
||||||
HEAP_ZERO_MEMORY,
|
HEAP_ZERO_MEMORY,
|
||||||
sizeof(CSRSS_PROCESS_DATA));
|
sizeof(CSRSS_PROCESS_DATA));
|
||||||
|
@ -85,6 +87,8 @@ NTSTATUS STDCALL CsrFreeProcessData(ULONG Pid)
|
||||||
{
|
{
|
||||||
if( ProcessData[i] && ProcessData[i]->ProcessId == Pid )
|
if( ProcessData[i] && ProcessData[i]->ProcessId == Pid )
|
||||||
{
|
{
|
||||||
|
//DbgPrint("CsrFreeProcessData pid: %d\n", Pid);
|
||||||
|
W32kCleanupForProcess( Pid ); //should check if win32k process
|
||||||
if( ProcessData[i]->HandleTable )
|
if( ProcessData[i]->HandleTable )
|
||||||
{
|
{
|
||||||
int c;
|
int c;
|
||||||
|
@ -119,17 +123,17 @@ CSR_API(CsrCreateProcess)
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
HANDLE Process;
|
HANDLE Process;
|
||||||
|
|
||||||
Reply->Header.DataSize = sizeof(CSRSS_API_REPLY) -
|
Reply->Header.DataSize = sizeof(CSRSS_API_REPLY) -
|
||||||
sizeof(LPC_MESSAGE_HEADER);
|
sizeof(LPC_MESSAGE_HEADER);
|
||||||
Reply->Header.MessageSize = sizeof(CSRSS_API_REPLY);
|
Reply->Header.MessageSize = sizeof(CSRSS_API_REPLY);
|
||||||
|
|
||||||
NewProcessData = CsrGetProcessData(Request->Data.CreateProcessRequest.NewProcessId);
|
NewProcessData = CsrGetProcessData(Request->Data.CreateProcessRequest.NewProcessId);
|
||||||
if (NewProcessData == NULL)
|
if (NewProcessData == NULL)
|
||||||
{
|
{
|
||||||
Reply->Status = STATUS_NO_MEMORY;
|
Reply->Status = STATUS_NO_MEMORY;
|
||||||
return(STATUS_NO_MEMORY);
|
return(STATUS_NO_MEMORY);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Request->Data.CreateProcessRequest.Flags & DETACHED_PROCESS)
|
if (Request->Data.CreateProcessRequest.Flags & DETACHED_PROCESS)
|
||||||
{
|
{
|
||||||
NewProcessData->Console = NULL;
|
NewProcessData->Console = NULL;
|
||||||
|
@ -192,7 +196,7 @@ CSR_API(CsrCreateProcess)
|
||||||
NtClose( Process );
|
NtClose( Process );
|
||||||
}
|
}
|
||||||
else Reply->Data.CreateProcessReply.OutputHandle = Reply->Data.CreateProcessReply.InputHandle = INVALID_HANDLE_VALUE;
|
else Reply->Data.CreateProcessReply.OutputHandle = Reply->Data.CreateProcessReply.InputHandle = INVALID_HANDLE_VALUE;
|
||||||
|
|
||||||
return(STATUS_SUCCESS);
|
return(STATUS_SUCCESS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -200,7 +204,7 @@ CSR_API(CsrTerminateProcess)
|
||||||
{
|
{
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
|
|
||||||
Reply->Header.MessageSize = sizeof(CSRSS_API_REPLY)
|
Reply->Header.MessageSize = sizeof(CSRSS_API_REPLY)
|
||||||
- sizeof(LPC_MESSAGE_HEADER);
|
- sizeof(LPC_MESSAGE_HEADER);
|
||||||
Reply->Header.DataSize = sizeof(CSRSS_API_REPLY);
|
Reply->Header.DataSize = sizeof(CSRSS_API_REPLY);
|
||||||
|
|
||||||
|
@ -213,11 +217,11 @@ CSR_API(CsrTerminateProcess)
|
||||||
CSR_API(CsrConnectProcess)
|
CSR_API(CsrConnectProcess)
|
||||||
{
|
{
|
||||||
Reply->Header.MessageSize = sizeof(CSRSS_API_REPLY);
|
Reply->Header.MessageSize = sizeof(CSRSS_API_REPLY);
|
||||||
Reply->Header.DataSize = sizeof(CSRSS_API_REPLY) -
|
Reply->Header.DataSize = sizeof(CSRSS_API_REPLY) -
|
||||||
sizeof(LPC_MESSAGE_HEADER);
|
sizeof(LPC_MESSAGE_HEADER);
|
||||||
|
|
||||||
Reply->Status = STATUS_SUCCESS;
|
Reply->Status = STATUS_SUCCESS;
|
||||||
|
|
||||||
return(STATUS_SUCCESS);
|
return(STATUS_SUCCESS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
#include <ddk/winddi.h>
|
#include <ddk/winddi.h>
|
||||||
#include "handle.h"
|
#include "handle.h"
|
||||||
|
|
||||||
//#define NDEBUG
|
#define NDEBUG
|
||||||
#include <win32k/debug1.h>
|
#include <win32k/debug1.h>
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -35,7 +35,7 @@ typedef struct tagDCE
|
||||||
|
|
||||||
#define DCEOBJ_AllocDCE() \
|
#define DCEOBJ_AllocDCE() \
|
||||||
((HDCE) GDIOBJ_AllocObj (sizeof (DCE), GO_DCE_MAGIC))
|
((HDCE) GDIOBJ_AllocObj (sizeof (DCE), GO_DCE_MAGIC))
|
||||||
#define DCEOBJ_FreeDCE(hDCE) GDIOBJ_FreeObj((HGDIOBJ)hDCE, GO_DCE_MAGIC)
|
#define DCEOBJ_FreeDCE(hDCE) GDIOBJ_FreeObj((HGDIOBJ)hDCE, GO_DCE_MAGIC, GDIOBJFLAG_DEFAULT)
|
||||||
#define DCEOBJ_LockDCE(hDCE) ((PDCE)GDIOBJ_LockObj((HGDIOBJ)hDCE, GO_DCE_MAGIC))
|
#define DCEOBJ_LockDCE(hDCE) ((PDCE)GDIOBJ_LockObj((HGDIOBJ)hDCE, GO_DCE_MAGIC))
|
||||||
#define DCEOBJ_UnlockDCE(hDCE) GDIOBJ_UnlockObj((HGDIOBJ)hDCE, GO_DCE_MAGIC)
|
#define DCEOBJ_UnlockDCE(hDCE) GDIOBJ_UnlockObj((HGDIOBJ)hDCE, GO_DCE_MAGIC)
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
//#include <win32k/debug.h>
|
//#include <win32k/debug.h>
|
||||||
#include "../eng/handle.h"
|
#include "../eng/handle.h"
|
||||||
|
|
||||||
//#define NDEBUG
|
#define NDEBUG
|
||||||
#include <win32k/debug1.h>
|
#include <win32k/debug1.h>
|
||||||
|
|
||||||
BOOL STDCALL W32kBitBlt(HDC hDCDest,
|
BOOL STDCALL W32kBitBlt(HDC hDCDest,
|
||||||
|
@ -169,7 +169,8 @@ HBITMAP STDCALL W32kCreateBitmap(INT Width,
|
||||||
BOOL Bitmap_InternalDelete( PBITMAPOBJ pBmp )
|
BOOL Bitmap_InternalDelete( PBITMAPOBJ pBmp )
|
||||||
{
|
{
|
||||||
ASSERT( pBmp );
|
ASSERT( pBmp );
|
||||||
ExFreePool(pBmp->bitmap.bmBits);
|
if( pBmp->bitmap.bmBits )
|
||||||
|
ExFreePool(pBmp->bitmap.bmBits);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -184,7 +185,7 @@ HBITMAP STDCALL W32kCreateCompatibleBitmap(HDC hDC,
|
||||||
hbmpRet = 0;
|
hbmpRet = 0;
|
||||||
dc = DC_HandleToPtr (hDC);
|
dc = DC_HandleToPtr (hDC);
|
||||||
|
|
||||||
DbgPrint("W32kCreateCompatibleBitmap(%04x,%d,%d, bpp:%d) = \n", hDC, Width, Height, dc->w.bitsPerPixel);
|
DPRINT("W32kCreateCompatibleBitmap(%04x,%d,%d, bpp:%d) = \n", hDC, Width, Height, dc->w.bitsPerPixel);
|
||||||
|
|
||||||
if (!dc)
|
if (!dc)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: dc.c,v 1.42 2002/09/24 20:22:10 jfilby Exp $
|
/* $Id: dc.c,v 1.43 2002/10/01 06:41:55 ei Exp $
|
||||||
*
|
*
|
||||||
* DC.C - Device context functions
|
* DC.C - Device context functions
|
||||||
*
|
*
|
||||||
|
@ -236,7 +236,7 @@ BOOL STDCALL W32kCreatePrimarySurface(LPCWSTR Driver,
|
||||||
|
|
||||||
DPRINT("Enabling PDev\n");
|
DPRINT("Enabling PDev\n");
|
||||||
|
|
||||||
PrimarySurface.PDev =
|
PrimarySurface.PDev =
|
||||||
PrimarySurface.DriverFunctions.EnablePDev(&PrimarySurface.DMW,
|
PrimarySurface.DriverFunctions.EnablePDev(&PrimarySurface.DMW,
|
||||||
L"",
|
L"",
|
||||||
HS_DDI_MAX,
|
HS_DDI_MAX,
|
||||||
|
@ -257,7 +257,7 @@ BOOL STDCALL W32kCreatePrimarySurface(LPCWSTR Driver,
|
||||||
DPRINT("calling completePDev\n");
|
DPRINT("calling completePDev\n");
|
||||||
|
|
||||||
/* Complete initialization of the physical device */
|
/* Complete initialization of the physical device */
|
||||||
PrimarySurface.DriverFunctions.CompletePDev(PrimarySurface.PDev,
|
PrimarySurface.DriverFunctions.CompletePDev(PrimarySurface.PDev,
|
||||||
&PrimarySurface);
|
&PrimarySurface);
|
||||||
|
|
||||||
DPRINT("calling DRIVER_ReferenceDriver\n");
|
DPRINT("calling DRIVER_ReferenceDriver\n");
|
||||||
|
@ -267,8 +267,8 @@ BOOL STDCALL W32kCreatePrimarySurface(LPCWSTR Driver,
|
||||||
DPRINT("calling EnableSurface\n");
|
DPRINT("calling EnableSurface\n");
|
||||||
|
|
||||||
/* Enable the drawing surface */
|
/* Enable the drawing surface */
|
||||||
PrimarySurface.Handle =
|
PrimarySurface.Handle =
|
||||||
PrimarySurface.DriverFunctions.EnableSurface(PrimarySurface.PDev);
|
PrimarySurface.DriverFunctions.EnableSurface(PrimarySurface.PDev);
|
||||||
|
|
||||||
SurfObj = (PSURFOBJ)AccessUserObject(PrimarySurface.Handle);
|
SurfObj = (PSURFOBJ)AccessUserObject(PrimarySurface.Handle);
|
||||||
SurfObj->dhpdev = PrimarySurface.PDev;
|
SurfObj->dhpdev = PrimarySurface.PDev;
|
||||||
|
@ -278,10 +278,10 @@ HDC STDCALL W32kCreateDC(LPCWSTR Driver,
|
||||||
LPCWSTR Device,
|
LPCWSTR Device,
|
||||||
LPCWSTR Output,
|
LPCWSTR Output,
|
||||||
CONST PDEVMODEW InitData)
|
CONST PDEVMODEW InitData)
|
||||||
{
|
{
|
||||||
HDC hNewDC;
|
HDC hNewDC;
|
||||||
PDC NewDC;
|
PDC NewDC;
|
||||||
HDC hDC = NULL;
|
HDC hDC = NULL;
|
||||||
|
|
||||||
/* Check for existing DC object */
|
/* Check for existing DC object */
|
||||||
if ((hNewDC = DC_FindOpenDC(Driver)) != NULL)
|
if ((hNewDC = DC_FindOpenDC(Driver)) != NULL)
|
||||||
|
@ -333,8 +333,8 @@ HDC STDCALL W32kCreateDC(LPCWSTR Driver,
|
||||||
NewDC->DMW.dmDisplayFrequency = 0;
|
NewDC->DMW.dmDisplayFrequency = 0;
|
||||||
|
|
||||||
NewDC->w.bitsPerPixel = 4; // FIXME: set this here??
|
NewDC->w.bitsPerPixel = 4; // FIXME: set this here??
|
||||||
|
|
||||||
NewDC->w.hPalette = NewDC->DevInfo.hpalDefault;
|
NewDC->w.hPalette = NewDC->DevInfo.hpalDefault;
|
||||||
|
|
||||||
DPRINT("Bits per pel: %u\n", NewDC->w.bitsPerPixel);
|
DPRINT("Bits per pel: %u\n", NewDC->w.bitsPerPixel);
|
||||||
|
|
||||||
|
@ -378,7 +378,8 @@ BOOL STDCALL W32kDeleteDC(HDC DCHandle)
|
||||||
DCToDelete->DriverFunctions.AssertMode( DCToDelete->PDev, FALSE );
|
DCToDelete->DriverFunctions.AssertMode( DCToDelete->PDev, FALSE );
|
||||||
CHECKPOINT;
|
CHECKPOINT;
|
||||||
DCToDelete->DriverFunctions.DisablePDev(DCToDelete->PDev);
|
DCToDelete->DriverFunctions.DisablePDev(DCToDelete->PDev);
|
||||||
}
|
PrimarySurfaceCreated = FALSE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
CHECKPOINT;
|
CHECKPOINT;
|
||||||
/* First delete all saved DCs */
|
/* First delete all saved DCs */
|
||||||
|
@ -972,7 +973,7 @@ HGDIOBJ STDCALL W32kSelectObject(HDC hDC, HGDIOBJ hGDIObj)
|
||||||
if( PalGDI ){
|
if( PalGDI ){
|
||||||
XlateObj = (PXLATEOBJ)EngCreateXlate(PalGDI->Mode, PAL_RGB, dc->w.hPalette, NULL);
|
XlateObj = (PXLATEOBJ)EngCreateXlate(PalGDI->Mode, PAL_RGB, dc->w.hPalette, NULL);
|
||||||
brush = GDIOBJ_LockObj(dc->w.hBrush, GO_BRUSH_MAGIC);
|
brush = GDIOBJ_LockObj(dc->w.hBrush, GO_BRUSH_MAGIC);
|
||||||
brush->iSolidColor = XLATEOBJ_iXlate(XlateObj,
|
brush->iSolidColor = XLATEOBJ_iXlate(XlateObj,
|
||||||
brush->logbrush.lbColor);
|
brush->logbrush.lbColor);
|
||||||
GDIOBJ_UnlockObj( dc->w.hBrush, GO_BRUSH_MAGIC);
|
GDIOBJ_UnlockObj( dc->w.hBrush, GO_BRUSH_MAGIC);
|
||||||
}
|
}
|
||||||
|
@ -1234,7 +1235,7 @@ void DC_InitDC(HDC DCHandle)
|
||||||
|
|
||||||
void DC_FreeDC(HDC DCToFree)
|
void DC_FreeDC(HDC DCToFree)
|
||||||
{
|
{
|
||||||
if (!GDIOBJ_FreeObj(DCToFree, GO_DC_MAGIC))
|
if (!GDIOBJ_FreeObj(DCToFree, GO_DC_MAGIC, GDIOBJFLAG_DEFAULT))
|
||||||
{
|
{
|
||||||
DPRINT("DC_FreeDC failed\n");
|
DPRINT("DC_FreeDC failed\n");
|
||||||
}
|
}
|
||||||
|
@ -1242,7 +1243,8 @@ void DC_FreeDC(HDC DCToFree)
|
||||||
|
|
||||||
BOOL DC_InternalDeleteDC( PDC DCToDelete )
|
BOOL DC_InternalDeleteDC( PDC DCToDelete )
|
||||||
{
|
{
|
||||||
ExFreePool(DCToDelete->DriverName);
|
if( DCToDelete->DriverName )
|
||||||
|
ExFreePool(DCToDelete->DriverName);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -540,7 +540,7 @@ HBITMAP DIB_CreateDIBSection(
|
||||||
|
|
||||||
if (dib) { ExFreePool(dib); dib = NULL; }
|
if (dib) { ExFreePool(dib); dib = NULL; }
|
||||||
if (bmp) { bmp = NULL; }
|
if (bmp) { bmp = NULL; }
|
||||||
if (res) { GDIOBJ_FreeObj(res, GO_BITMAP_MAGIC); res = 0; }
|
if (res) { GDIOBJ_FreeObj(res, GO_BITMAP_MAGIC, GDIOBJFLAG_DEFAULT); res = 0; }
|
||||||
}
|
}
|
||||||
|
|
||||||
// Install fault handler, if possible
|
// Install fault handler, if possible
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
* GDIOBJ.C - GDI object manipulation routines
|
* GDIOBJ.C - GDI object manipulation routines
|
||||||
*
|
*
|
||||||
* $Id: gdiobj.c,v 1.18 2002/09/08 10:23:53 chorns Exp $
|
* $Id: gdiobj.c,v 1.19 2002/10/01 06:41:55 ei Exp $
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -169,6 +169,7 @@ HGDIOBJ GDIOBJ_AllocObj(WORD Size, WORD Magic)
|
||||||
newObject = ExAllocatePool (PagedPool, Size + sizeof (GDIOBJHDR));
|
newObject = ExAllocatePool (PagedPool, Size + sizeof (GDIOBJHDR));
|
||||||
if (newObject == NULL)
|
if (newObject == NULL)
|
||||||
{
|
{
|
||||||
|
DPRINT("GDIOBJ_AllocObj: failed\n");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
RtlZeroMemory (newObject, Size + sizeof (GDIOBJHDR));
|
RtlZeroMemory (newObject, Size + sizeof (GDIOBJHDR));
|
||||||
|
@ -183,7 +184,7 @@ HGDIOBJ GDIOBJ_AllocObj(WORD Size, WORD Magic)
|
||||||
return (HGDIOBJ) newObject->wTableIndex;
|
return (HGDIOBJ) newObject->wTableIndex;
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL GDIOBJ_FreeObj(HGDIOBJ hObj, WORD Magic)
|
BOOL GDIOBJ_FreeObj(HGDIOBJ hObj, WORD Magic, DWORD Flag)
|
||||||
{
|
{
|
||||||
PGDIOBJHDR objectHeader;
|
PGDIOBJHDR objectHeader;
|
||||||
PGDI_HANDLE_ENTRY handleEntry;
|
PGDI_HANDLE_ENTRY handleEntry;
|
||||||
|
@ -191,24 +192,28 @@ BOOL GDIOBJ_FreeObj(HGDIOBJ hObj, WORD Magic)
|
||||||
BOOL bRet = TRUE;
|
BOOL bRet = TRUE;
|
||||||
|
|
||||||
handleEntry = GDIOBJ_iGetHandleEntryForIndex ((WORD)hObj & 0xffff);
|
handleEntry = GDIOBJ_iGetHandleEntryForIndex ((WORD)hObj & 0xffff);
|
||||||
DPRINT("GDIOBJ_FreeObj: hObj: %d, magic: %x, handleEntry: %x\n", hObj, Magic, handleEntry );
|
DPRINT("GDIOBJ_FreeObj: hObj: %d, magic: %x, handleEntry: %x\n", (WORD)hObj & 0xffff, Magic, handleEntry );
|
||||||
if (handleEntry == 0 || (handleEntry->wMagic != Magic && handleEntry->wMagic != GO_MAGIC_DONTCARE )
|
if (handleEntry == 0 || (handleEntry->wMagic != Magic && Magic != GO_MAGIC_DONTCARE )
|
||||||
|| handleEntry->hProcessId != PsGetCurrentProcessId ())
|
|| ((handleEntry->hProcessId != PsGetCurrentProcessId()) && !(Flag & GDIOBJFLAG_IGNOREPID))){
|
||||||
|
DPRINT("Can't Delete hObj: %d, magic: %x, pid:%d\n currpid:%d, flag:%d, hmm:%d\n",(WORD)hObj & 0xffff, handleEntry->wMagic, handleEntry->hProcessId, PsGetCurrentProcessId(), (Flag&GDIOBJFLAG_IGNOREPID), ((handleEntry->hProcessId != PsGetCurrentProcessId()) && !(Flag&GDIOBJFLAG_IGNOREPID)) );
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
objectHeader = (PGDIOBJHDR) handleEntry->pObject;
|
objectHeader = (PGDIOBJHDR) handleEntry->pObject;
|
||||||
ASSERT(objectHeader);
|
ASSERT(objectHeader);
|
||||||
|
DPRINT("FreeObj: locks: %x\n", objectHeader->dwCount );
|
||||||
// check that the reference count is zero. if not then set flag
|
if( !(Flag & GDIOBJFLAG_IGNORELOCK) ){
|
||||||
// and delete object when releaseobj is called
|
// check that the reference count is zero. if not then set flag
|
||||||
ExAcquireFastMutex(&RefCountHandling);
|
// and delete object when releaseobj is called
|
||||||
if( ( objectHeader->dwCount & ~0x80000000 ) > 0 ){
|
ExAcquireFastMutex(&RefCountHandling);
|
||||||
objectHeader->dwCount |= 0x80000000;
|
if( ( objectHeader->dwCount & ~0x80000000 ) > 0 ){
|
||||||
DPRINT("GDIOBJ_FreeObj: delayed object deletion");
|
DPRINT("GDIOBJ_FreeObj: delayed object deletion: count %d\n", objectHeader->dwCount);
|
||||||
|
objectHeader->dwCount |= 0x80000000;
|
||||||
|
ExReleaseFastMutex(&RefCountHandling);
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
ExReleaseFastMutex(&RefCountHandling);
|
ExReleaseFastMutex(&RefCountHandling);
|
||||||
return TRUE;
|
}
|
||||||
}
|
|
||||||
ExReleaseFastMutex(&RefCountHandling);
|
|
||||||
|
|
||||||
//allow object to delete internal data
|
//allow object to delete internal data
|
||||||
Obj = (PGDIOBJ)((PCHAR)handleEntry->pObject + sizeof(GDIOBJHDR));
|
Obj = (PGDIOBJ)((PCHAR)handleEntry->pObject + sizeof(GDIOBJHDR));
|
||||||
|
@ -216,14 +221,14 @@ BOOL GDIOBJ_FreeObj(HGDIOBJ hObj, WORD Magic)
|
||||||
case GO_REGION_MAGIC:
|
case GO_REGION_MAGIC:
|
||||||
bRet = RGNDATA_InternalDelete( (PROSRGNDATA) Obj );
|
bRet = RGNDATA_InternalDelete( (PROSRGNDATA) Obj );
|
||||||
break;
|
break;
|
||||||
case GO_PEN_MAGIC:
|
|
||||||
case GO_PALETTE_MAGIC:
|
|
||||||
case GO_BITMAP_MAGIC:
|
case GO_BITMAP_MAGIC:
|
||||||
bRet = Bitmap_InternalDelete( (PBITMAPOBJ) Obj );
|
bRet = Bitmap_InternalDelete( (PBITMAPOBJ) Obj );
|
||||||
break;
|
break;
|
||||||
case GO_DC_MAGIC:
|
case GO_DC_MAGIC:
|
||||||
bRet = DC_InternalDeleteDC( (PDC) Obj );
|
bRet = DC_InternalDeleteDC( (PDC) Obj );
|
||||||
break;
|
break;
|
||||||
|
case GO_PEN_MAGIC:
|
||||||
|
case GO_PALETTE_MAGIC:
|
||||||
case GO_DISABLED_DC_MAGIC:
|
case GO_DISABLED_DC_MAGIC:
|
||||||
case GO_META_DC_MAGIC:
|
case GO_META_DC_MAGIC:
|
||||||
case GO_METAFILE_MAGIC:
|
case GO_METAFILE_MAGIC:
|
||||||
|
@ -251,10 +256,12 @@ PGDIOBJ GDIOBJ_LockObj( HGDIOBJ hObj, WORD Magic )
|
||||||
PGDIOBJHDR objectHeader;
|
PGDIOBJHDR objectHeader;
|
||||||
|
|
||||||
DPRINT("GDIOBJ_LockObj: hObj: %d, magic: %x, \n handleEntry: %x, mag %x\n", hObj, Magic, handleEntry, handleEntry->wMagic);
|
DPRINT("GDIOBJ_LockObj: hObj: %d, magic: %x, \n handleEntry: %x, mag %x\n", hObj, Magic, handleEntry, handleEntry->wMagic);
|
||||||
if (handleEntry == 0 || (handleEntry->wMagic != Magic && handleEntry->wMagic != GO_MAGIC_DONTCARE )
|
if (handleEntry == 0 || (handleEntry->wMagic != Magic && Magic != GO_MAGIC_DONTCARE )
|
||||||
|| (handleEntry->hProcessId != (HANDLE)0xFFFFFFFF &&
|
|| (handleEntry->hProcessId != (HANDLE)0xFFFFFFFF &&
|
||||||
handleEntry->hProcessId != PsGetCurrentProcessId ()))
|
handleEntry->hProcessId != PsGetCurrentProcessId ())){
|
||||||
|
DPRINT("GDIBOJ_LockObj failed for %d, magic: %d, reqMagic\n",(WORD) hObj & 0xffff, handleEntry->wMagic, Magic);
|
||||||
return NULL;
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
objectHeader = (PGDIOBJHDR) handleEntry->pObject;
|
objectHeader = (PGDIOBJHDR) handleEntry->pObject;
|
||||||
ASSERT(objectHeader);
|
ASSERT(objectHeader);
|
||||||
|
@ -273,10 +280,12 @@ BOOL GDIOBJ_UnlockObj( HGDIOBJ hObj, WORD Magic )
|
||||||
PGDIOBJHDR objectHeader;
|
PGDIOBJHDR objectHeader;
|
||||||
|
|
||||||
DPRINT("GDIOBJ_UnlockObj: hObj: %d, magic: %x, \n handleEntry: %x\n", hObj, Magic, handleEntry);
|
DPRINT("GDIOBJ_UnlockObj: hObj: %d, magic: %x, \n handleEntry: %x\n", hObj, Magic, handleEntry);
|
||||||
if (handleEntry == 0 || (handleEntry->wMagic != Magic && handleEntry->wMagic != GO_MAGIC_DONTCARE )
|
if (handleEntry == 0 || (handleEntry->wMagic != Magic && Magic != GO_MAGIC_DONTCARE )
|
||||||
|| (handleEntry->hProcessId != (HANDLE)0xFFFFFFFF &&
|
|| (handleEntry->hProcessId != (HANDLE)0xFFFFFFFF &&
|
||||||
handleEntry->hProcessId != PsGetCurrentProcessId ()))
|
handleEntry->hProcessId != PsGetCurrentProcessId ())){
|
||||||
return FALSE;
|
DPRINT( "GDIOBJ_UnLockObj: failed\n");
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
objectHeader = (PGDIOBJHDR) handleEntry->pObject;
|
objectHeader = (PGDIOBJHDR) handleEntry->pObject;
|
||||||
ASSERT(objectHeader);
|
ASSERT(objectHeader);
|
||||||
|
@ -297,7 +306,7 @@ BOOL GDIOBJ_UnlockObj( HGDIOBJ hObj, WORD Magic )
|
||||||
objectHeader->dwCount = 0;
|
objectHeader->dwCount = 0;
|
||||||
ExReleaseFastMutex(&RefCountHandling);
|
ExReleaseFastMutex(&RefCountHandling);
|
||||||
DPRINT("GDIOBJ_UnlockObj: delayed delete\n");
|
DPRINT("GDIOBJ_UnlockObj: delayed delete\n");
|
||||||
return GDIOBJ_FreeObj( hObj, Magic );
|
return GDIOBJ_FreeObj( hObj, Magic, GDIOBJFLAG_DEFAULT );
|
||||||
}
|
}
|
||||||
ExReleaseFastMutex(&RefCountHandling);
|
ExReleaseFastMutex(&RefCountHandling);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
@ -369,7 +378,7 @@ PGDIOBJ GDIOBJ_HandleToPtr (HGDIOBJ ObjectHandle, WORD Magic)
|
||||||
|
|
||||||
handleEntry = GDIOBJ_iGetHandleEntryForIndex ((WORD)ObjectHandle & 0xffff);
|
handleEntry = GDIOBJ_iGetHandleEntryForIndex ((WORD)ObjectHandle & 0xffff);
|
||||||
if (handleEntry == 0 ||
|
if (handleEntry == 0 ||
|
||||||
(Magic != GO_MAGIC_DONTCARE && handleEntry->wMagic != Magic) ||
|
(Magic != GO_MAGIC_DONTCARE && Magic != Magic) ||
|
||||||
handleEntry->hProcessId != PsGetCurrentProcessId () )
|
handleEntry->hProcessId != PsGetCurrentProcessId () )
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
@ -451,7 +460,7 @@ VOID CreateStockObjects(void)
|
||||||
GDIOBJ_MarkObjectGlobal(StockObjects[ANSI_FIXED_FONT]);
|
GDIOBJ_MarkObjectGlobal(StockObjects[ANSI_FIXED_FONT]);
|
||||||
StockObjects[SYSTEM_FONT] = W32kCreateFontIndirect(&SystemFont);
|
StockObjects[SYSTEM_FONT] = W32kCreateFontIndirect(&SystemFont);
|
||||||
GDIOBJ_MarkObjectGlobal(StockObjects[SYSTEM_FONT]);
|
GDIOBJ_MarkObjectGlobal(StockObjects[SYSTEM_FONT]);
|
||||||
StockObjects[DEVICE_DEFAULT_FONT] =
|
StockObjects[DEVICE_DEFAULT_FONT] =
|
||||||
W32kCreateFontIndirect(&DeviceDefaultFont);
|
W32kCreateFontIndirect(&DeviceDefaultFont);
|
||||||
GDIOBJ_MarkObjectGlobal(StockObjects[DEVICE_DEFAULT_FONT]);
|
GDIOBJ_MarkObjectGlobal(StockObjects[DEVICE_DEFAULT_FONT]);
|
||||||
StockObjects[SYSTEM_FIXED_FONT] = W32kCreateFontIndirect(&SystemFixedFont);
|
StockObjects[SYSTEM_FIXED_FONT] = W32kCreateFontIndirect(&SystemFixedFont);
|
||||||
|
@ -477,7 +486,24 @@ HGDIOBJ STDCALL W32kGetStockObject(INT Object)
|
||||||
|
|
||||||
BOOL STDCALL W32kDeleteObject(HGDIOBJ hObject)
|
BOOL STDCALL W32kDeleteObject(HGDIOBJ hObject)
|
||||||
{
|
{
|
||||||
return GDIOBJ_FreeObj( hObject, GO_MAGIC_DONTCARE );
|
return GDIOBJ_FreeObj( hObject, GO_MAGIC_DONTCARE, GDIOBJFLAG_DEFAULT );
|
||||||
|
}
|
||||||
|
|
||||||
|
BOOL STDCALL W32kCleanupForProcess( INT Process )
|
||||||
|
{
|
||||||
|
DWORD i;
|
||||||
|
PGDI_HANDLE_ENTRY handleEntry;
|
||||||
|
PGDIOBJHDR objectHeader;
|
||||||
|
|
||||||
|
for( i=1; i < GDI_HANDLE_NUMBER; i++ ){
|
||||||
|
handleEntry = GDIOBJ_iGetHandleEntryForIndex ((WORD) i & 0xffff);
|
||||||
|
if( handleEntry && handleEntry->wMagic != 0 && handleEntry->hProcessId == Process){
|
||||||
|
objectHeader = (PGDIOBJHDR) handleEntry->pObject;
|
||||||
|
DPRINT("\nW32kCleanup: %d, magic: %x \n process: %d, locks: %d", i, handleEntry->wMagic, handleEntry->hProcessId, objectHeader->dwCount);
|
||||||
|
GDIOBJ_FreeObj( (WORD) i & 0xffff, GO_MAGIC_DONTCARE, GDIOBJFLAG_IGNOREPID|GDIOBJFLAG_IGNORELOCK );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
// dump all the objects for process. if process == 0 dump all the objects
|
// dump all the objects for process. if process == 0 dump all the objects
|
||||||
|
|
|
@ -22,6 +22,8 @@ PBRUSHOBJ PenToBrushObj(PDC dc, PENOBJ *pen)
|
||||||
BRUSHOBJ *BrushObj;
|
BRUSHOBJ *BrushObj;
|
||||||
XLATEOBJ *RGBtoVGA16;
|
XLATEOBJ *RGBtoVGA16;
|
||||||
|
|
||||||
|
ASSERT( pen );
|
||||||
|
|
||||||
BrushObj = ExAllocatePool(NonPagedPool, sizeof(BRUSHOBJ));
|
BrushObj = ExAllocatePool(NonPagedPool, sizeof(BRUSHOBJ));
|
||||||
BrushObj->iSolidColor = pen->logpen.lopnColor;
|
BrushObj->iSolidColor = pen->logpen.lopnColor;
|
||||||
|
|
||||||
|
|
|
@ -1429,7 +1429,7 @@ HRGN RGNDATA_AllocRgn(INT n)
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
GDIOBJ_FreeObj( hReg, GO_REGION_MAGIC );
|
GDIOBJ_FreeObj( hReg, GO_REGION_MAGIC, GDIOBJFLAG_DEFAULT );
|
||||||
}
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
@ -1694,7 +1694,7 @@ UnsafeW32kGetRgnBox(HRGN hRgn,
|
||||||
*pRect = rgn->rdh.rcBound;
|
*pRect = rgn->rdh.rcBound;
|
||||||
ret = rgn->rdh.iType;
|
ret = rgn->rdh.iType;
|
||||||
RGNDATA_UnlockRgn( hRgn );
|
RGNDATA_UnlockRgn( hRgn );
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
return 0; //if invalid region return zero
|
return 0; //if invalid region return zero
|
||||||
|
@ -1717,10 +1717,10 @@ W32kGetRgnBox(HRGN hRgn,
|
||||||
SafeRect.bottom = rgn->rdh.rcBound.bottom;
|
SafeRect.bottom = rgn->rdh.rcBound.bottom;
|
||||||
ret = rgn->rdh.iType;
|
ret = rgn->rdh.iType;
|
||||||
RGNDATA_UnlockRgn( hRgn );
|
RGNDATA_UnlockRgn( hRgn );
|
||||||
|
|
||||||
if(!NT_SUCCESS(MmCopyToCaller(pRect, &SafeRect, sizeof(RECT))))
|
if(!NT_SUCCESS(MmCopyToCaller(pRect, &SafeRect, sizeof(RECT))))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
return 0; //if invalid region return zero
|
return 0; //if invalid region return zero
|
||||||
|
|
Loading…
Reference in a new issue