mirror of
https://github.com/reactos/reactos.git
synced 2025-06-27 01:40:35 +00:00
[WIN32K]
Fix indentation, comments, debug messages. Lioncash (mathew1800\AT/gmail\DOT/com), bug #6762. svn path=/trunk/; revision=54647
This commit is contained in:
parent
b5381f1fd7
commit
f4065b5b2a
99 changed files with 1173 additions and 1184 deletions
|
@ -59,24 +59,24 @@ DIB_1BPP_BitBltSrcCopy_From1BPP (
|
||||||
PRECTL DestRect,
|
PRECTL DestRect,
|
||||||
POINTL *SourcePoint )
|
POINTL *SourcePoint )
|
||||||
{
|
{
|
||||||
// the 'window' in this sense is the x-position that corresponds
|
// The 'window' in this sense is the x-position that corresponds
|
||||||
// to the left-edge of the 8-pixel byte we are currently working with.
|
// to the left-edge of the 8-pixel byte we are currently working with.
|
||||||
// dwx is current x-window, dwx2 is the 'last' window we need to process
|
// dwx is current x-window, dwx2 is the 'last' window we need to process.
|
||||||
int dwx, dwx2; // destination window x-position
|
int dwx, dwx2; // Destination window x-position
|
||||||
int swx; // source window y-position
|
int swx; // Source window y-position
|
||||||
|
|
||||||
// left and right edges of source and dest rectangles
|
// Left and right edges of source and dest rectangles
|
||||||
int dl = DestRect->left; // dest left
|
int dl = DestRect->left; // dest left
|
||||||
int dr = DestRect->right-1; // dest right (inclusive)
|
int dr = DestRect->right-1; // dest right (inclusive)
|
||||||
int sl = SourcePoint->x; // source left
|
int sl = SourcePoint->x; // source left
|
||||||
int sr = sl + dr - dl; // source right (inclusive)
|
int sr = sl + dr - dl; // source right (inclusive)
|
||||||
|
|
||||||
// which direction are we going?
|
// Which direction are we going?
|
||||||
int xinc;
|
int xinc;
|
||||||
int yinc;
|
int yinc;
|
||||||
int ySrcDelta, yDstDelta;
|
int ySrcDelta, yDstDelta;
|
||||||
|
|
||||||
// following 4 variables are used for the y-sweep
|
// The following 4 variables are used for the y-sweep
|
||||||
int dy; // dest y
|
int dy; // dest y
|
||||||
int dy1; // dest y start
|
int dy1; // dest y start
|
||||||
int dy2; // dest y end
|
int dy2; // dest y end
|
||||||
|
@ -96,7 +96,7 @@ DIB_1BPP_BitBltSrcCopy_From1BPP (
|
||||||
|
|
||||||
if ( DestRect->top <= SourcePoint->y )
|
if ( DestRect->top <= SourcePoint->y )
|
||||||
{
|
{
|
||||||
// moving up ( scan top -> bottom )
|
// Moving up (scan top -> bottom)
|
||||||
dy1 = DestRect->top;
|
dy1 = DestRect->top;
|
||||||
dy2 = DestRect->bottom - 1;
|
dy2 = DestRect->bottom - 1;
|
||||||
sy1 = SourcePoint->y;
|
sy1 = SourcePoint->y;
|
||||||
|
@ -106,7 +106,7 @@ DIB_1BPP_BitBltSrcCopy_From1BPP (
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// moving down ( scan bottom -> top )
|
// Moving down (scan bottom -> top)
|
||||||
dy1 = DestRect->bottom - 1;
|
dy1 = DestRect->bottom - 1;
|
||||||
dy2 = DestRect->top;
|
dy2 = DestRect->top;
|
||||||
sy1 = SourcePoint->y + dy1 - dy2;
|
sy1 = SourcePoint->y + dy1 - dy2;
|
||||||
|
@ -116,7 +116,7 @@ DIB_1BPP_BitBltSrcCopy_From1BPP (
|
||||||
}
|
}
|
||||||
if ( DestRect->left <= SourcePoint->x )
|
if ( DestRect->left <= SourcePoint->x )
|
||||||
{
|
{
|
||||||
// moving left ( scan left->right )
|
// Moving left (scan left->right)
|
||||||
dwx = dl&~7;
|
dwx = dl&~7;
|
||||||
swx = (sl-(dl&7))&~7;
|
swx = (sl-(dl&7))&~7;
|
||||||
dwx2 = dr&~7;
|
dwx2 = dr&~7;
|
||||||
|
@ -124,9 +124,9 @@ DIB_1BPP_BitBltSrcCopy_From1BPP (
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// moving right ( scan right->left )
|
// Moving right (scan right->left)
|
||||||
dwx = dr & ~7;
|
dwx = dr & ~7;
|
||||||
swx = (sr-(dr&7))&~7; //(sr-7)&~7; // we need the left edge of this block... thus the -7
|
swx = (sr - (dr & 7)) & ~7; // (sr - 7) & ~7; // We need the left edge of this block. Thus the -7
|
||||||
dwx2 = dl & ~7;
|
dwx2 = dl & ~7;
|
||||||
xinc = -1;
|
xinc = -1;
|
||||||
}
|
}
|
||||||
|
@ -150,16 +150,16 @@ DIB_1BPP_BitBltSrcCopy_From1BPP (
|
||||||
}
|
}
|
||||||
dstmask = ~srcmask;
|
dstmask = ~srcmask;
|
||||||
|
|
||||||
// we unfortunately *must* have 5 different versions of the inner
|
// We unfortunately *must* have 5 different versions of the inner
|
||||||
// loop to be certain we don't try to read from memory that is not
|
// loop to be certain we don't try to read from memory that is not
|
||||||
// needed and may in fact be invalid
|
// needed and may in fact be invalid.
|
||||||
if ( !shift )
|
if ( !shift )
|
||||||
{
|
{
|
||||||
for ( ;; )
|
for ( ;; )
|
||||||
{
|
{
|
||||||
*pd = (BYTE)((*pd & dstmask) | ((ps[0]^xormask) & srcmask));
|
*pd = (BYTE)((*pd & dstmask) | ((ps[0]^xormask) & srcmask));
|
||||||
|
|
||||||
// this *must* be here, because we could be going up *or* down...
|
// This *must* be here, because we could be going up *or* down...
|
||||||
if ( dy == dy2 )
|
if ( dy == dy2 )
|
||||||
break;
|
break;
|
||||||
dy += yinc;
|
dy += yinc;
|
||||||
|
@ -167,14 +167,14 @@ DIB_1BPP_BitBltSrcCopy_From1BPP (
|
||||||
ps += ySrcDelta;
|
ps += ySrcDelta;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if ( !(0xFF00 & (srcmask<<shift) ) ) // check if ps[0] not needed...
|
else if ( !(0xFF00 & (srcmask<<shift) ) ) // Check if ps[0] not needed...
|
||||||
{
|
{
|
||||||
for ( ;; )
|
for ( ;; )
|
||||||
{
|
{
|
||||||
*pd = (BYTE)((*pd & dstmask)
|
*pd = (BYTE)((*pd & dstmask)
|
||||||
| ( ( (ps[1]^xormask) >> shift ) & srcmask ));
|
| ( ( (ps[1]^xormask) >> shift ) & srcmask ));
|
||||||
|
|
||||||
// this *must* be here, because we could be going up *or* down...
|
// This *must* be here, because we could be going up *or* down...
|
||||||
if ( dy == dy2 )
|
if ( dy == dy2 )
|
||||||
break;
|
break;
|
||||||
dy += yinc;
|
dy += yinc;
|
||||||
|
@ -182,14 +182,14 @@ DIB_1BPP_BitBltSrcCopy_From1BPP (
|
||||||
ps += ySrcDelta;
|
ps += ySrcDelta;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if ( !(0xFF & (srcmask<<shift) ) ) // check if ps[1] not needed...
|
else if ( !(0xFF & (srcmask<<shift) ) ) // Check if ps[1] not needed...
|
||||||
{
|
{
|
||||||
for ( ;; )
|
for ( ;; )
|
||||||
{
|
{
|
||||||
*pd = (*pd & dstmask)
|
*pd = (*pd & dstmask)
|
||||||
| ( ( (ps[0]^xormask) << ( 8 - shift ) ) & srcmask );
|
| ( ( (ps[0]^xormask) << ( 8 - shift ) ) & srcmask );
|
||||||
|
|
||||||
// this *must* be here, because we could be going up *or* down...
|
// This *must* be here, because we could be going up *or* down...
|
||||||
if ( dy == dy2 )
|
if ( dy == dy2 )
|
||||||
break;
|
break;
|
||||||
dy += yinc;
|
dy += yinc;
|
||||||
|
@ -197,14 +197,14 @@ DIB_1BPP_BitBltSrcCopy_From1BPP (
|
||||||
ps += ySrcDelta;
|
ps += ySrcDelta;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else // both ps[0] and ps[1] are needed
|
else // Both ps[0] and ps[1] are needed
|
||||||
{
|
{
|
||||||
for ( ;; )
|
for ( ;; )
|
||||||
{
|
{
|
||||||
*pd = (*pd & dstmask)
|
*pd = (*pd & dstmask)
|
||||||
| ( ( ( ((ps[1]^xormask))|((ps[0]^xormask)<<8) ) >> shift ) & srcmask );
|
| ( ( ( ((ps[1]^xormask))|((ps[0]^xormask)<<8) ) >> shift ) & srcmask );
|
||||||
|
|
||||||
// this *must* be here, because we could be going up *or* down...
|
// This *must* be here, because we could be going up *or* down...
|
||||||
if ( dy == dy2 )
|
if ( dy == dy2 )
|
||||||
break;
|
break;
|
||||||
dy += yinc;
|
dy += yinc;
|
||||||
|
@ -213,7 +213,7 @@ DIB_1BPP_BitBltSrcCopy_From1BPP (
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// this *must* be here, because we could be going right *or* left...
|
// This *must* be here, because we could be going right *or* left...
|
||||||
if ( dwx == dwx2 )
|
if ( dwx == dwx2 )
|
||||||
break;
|
break;
|
||||||
d += xinc;
|
d += xinc;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* PROJECT: Win32 subsystem
|
* PROJECT: ReactOS Win32k subsystem
|
||||||
* LICENSE: See COPYING in the top level directory
|
* LICENSE: See COPYING in the top level directory
|
||||||
* FILE: subsystems/win32/win32k/dib/stretchblt.c
|
* FILE: subsystems/win32/win32k/dib/stretchblt.c
|
||||||
* PURPOSE: StretchBlt implementation suitable for all bit depths
|
* PURPOSE: StretchBlt implementation suitable for all bit depths
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
/*
|
/*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS Win32k subsystem
|
||||||
* PURPOSE: GDI BitBlt Functions
|
* PURPOSE: GDI BitBlt Functions
|
||||||
* FILE: subsys/win32k/eng/bitblt.c
|
* FILE: subsystems/win32/win32k/eng/bitblt.c
|
||||||
* PROGRAMER: Jason Filby
|
* PROGRAMER: Jason Filby
|
||||||
* Timo Kreuzer
|
* Timo Kreuzer
|
||||||
*/
|
*/
|
||||||
|
@ -235,7 +235,7 @@ CallDibBitBlt(SURFOBJ* OutputObj,
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* FIXME - What to do here? */
|
/* FIXME: What to do here? */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
* PURPOSE: GDI Clipping Functions
|
* PURPOSE: GDI Clipping Functions
|
||||||
* FILE: subsys/win32k/eng/clip.c
|
* FILE: subsystems/win32/win32k/eng/clip.c
|
||||||
* PROGRAMER: Jason Filby
|
* PROGRAMER: Jason Filby
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -346,7 +346,7 @@ CLIPOBJ_bEnum(
|
||||||
ULONG nCopy, i;
|
ULONG nCopy, i;
|
||||||
ENUMRECTS* pERects = (ENUMRECTS*)EnumRects;
|
ENUMRECTS* pERects = (ENUMRECTS*)EnumRects;
|
||||||
|
|
||||||
//calculate how many rectangles we should copy
|
// Calculate how many rectangles we should copy
|
||||||
nCopy = min( ClipGDI->EnumMax - ClipGDI->EnumPos,
|
nCopy = min( ClipGDI->EnumMax - ClipGDI->EnumPos,
|
||||||
min( ClipGDI->EnumRects.c - ClipGDI->EnumPos,
|
min( ClipGDI->EnumRects.c - ClipGDI->EnumPos,
|
||||||
(ObjSize - sizeof(ULONG)) / sizeof(RECTL)));
|
(ObjSize - sizeof(ULONG)) / sizeof(RECTL)));
|
||||||
|
@ -356,7 +356,7 @@ CLIPOBJ_bEnum(
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* copy rectangles */
|
/* Copy rectangles */
|
||||||
src = ClipGDI->EnumRects.arcl + ClipGDI->EnumPos;
|
src = ClipGDI->EnumRects.arcl + ClipGDI->EnumPos;
|
||||||
for(i = 0, dest = pERects->arcl; i < nCopy; i++, dest++, src++)
|
for(i = 0, dest = pERects->arcl; i < nCopy; i++, dest++, src++)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS Win32k subsystem
|
||||||
* PURPOSE: ENG misc Functions
|
* PURPOSE: ENG misc Functions
|
||||||
* FILE: subsystems/win32/win32k/eng/engmisc.c
|
* FILE: subsystems/win32/win32k/eng/engmisc.c
|
||||||
* PROGRAMER: ReactOS Team
|
* PROGRAMER: ReactOS Team
|
||||||
|
@ -223,7 +223,7 @@ EngGetProcessHandle(VOID)
|
||||||
{
|
{
|
||||||
/* http://www.osr.com/ddk/graphics/gdifncs_3tif.htm
|
/* http://www.osr.com/ddk/graphics/gdifncs_3tif.htm
|
||||||
In Windows 2000 and later, the EngGetProcessHandle function always returns NULL.
|
In Windows 2000 and later, the EngGetProcessHandle function always returns NULL.
|
||||||
FIXME - what does NT4 return? */
|
FIXME: What does NT4 return? */
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -286,7 +286,4 @@ EngGetTickCount(VOID)
|
||||||
(Multiplier * (TickCount.HighPart << 8)));
|
(Multiplier * (TickCount.HighPart << 8)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* EOF */
|
/* EOF */
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS Win32k subsystem
|
||||||
* PURPOSE: Support for logical devices
|
* PURPOSE: Support for logical devices
|
||||||
* FILE: subsystems/win32/win32k/eng/ldevobj.c
|
* FILE: subsystems/win32/win32k/eng/ldevobj.c
|
||||||
* PROGRAMER: Timo Kreuzer (timo.kreuzer@reactos.org)
|
* PROGRAMER: Timo Kreuzer (timo.kreuzer@reactos.org)
|
||||||
|
@ -64,7 +64,7 @@ InitLDEVImpl()
|
||||||
TRUE,
|
TRUE,
|
||||||
IMAGE_DIRECTORY_ENTRY_EXPORT,
|
IMAGE_DIRECTORY_ENTRY_EXPORT,
|
||||||
&cbSize);
|
&cbSize);
|
||||||
gpldevWin32k->pGdiDriverInfo->ImageLength = 0; // FIXME;
|
gpldevWin32k->pGdiDriverInfo->ImageLength = 0; // FIXME
|
||||||
|
|
||||||
return STATUS_SUCCESS;
|
return STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
@ -507,3 +507,4 @@ EngFindImageProcAddress(
|
||||||
return LDEVOBJ_pvFindImageProcAddress(pldev, lpProcName);
|
return LDEVOBJ_pvFindImageProcAddress(pldev, lpProcName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* EOF */
|
||||||
|
|
|
@ -139,7 +139,7 @@ EngInitializeSafeSemaphore(
|
||||||
InterlockedDecrement(&Semaphore->lCount);
|
InterlockedDecrement(&Semaphore->lCount);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
/* FIXME - not thread-safe! Check result of InterlockedCompareExchangePointer
|
/* FIXME: Not thread-safe! Check result of InterlockedCompareExchangePointer
|
||||||
and delete semaphore if already initialized! */
|
and delete semaphore if already initialized! */
|
||||||
(void)InterlockedExchangePointer((volatile PVOID *)&Semaphore->hsem, hSem);
|
(void)InterlockedExchangePointer((volatile PVOID *)&Semaphore->hsem, hSem);
|
||||||
}
|
}
|
||||||
|
@ -163,10 +163,10 @@ EngDeleteSafeSemaphore(
|
||||||
{
|
{
|
||||||
if (InterlockedDecrement(&Semaphore->lCount) == 0)
|
if (InterlockedDecrement(&Semaphore->lCount) == 0)
|
||||||
{
|
{
|
||||||
/* FIXME - not thread-safe! Use result of InterlockedCompareExchangePointer! */
|
/* FIXME: Not thread-safe! Use result of InterlockedCompareExchangePointer! */
|
||||||
EngDeleteSemaphore(Semaphore->hsem);
|
EngDeleteSemaphore(Semaphore->hsem);
|
||||||
(void)InterlockedExchangePointer((volatile PVOID *)&Semaphore->hsem, NULL);
|
(void)InterlockedExchangePointer((volatile PVOID *)&Semaphore->hsem, NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* EOF */
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS Win32 kernelmode subsystem
|
* PROJECT: ReactOS Win32k subsystem
|
||||||
* PURPOSE: GDI stretch blt functions
|
* PURPOSE: GDI stretch blt functions
|
||||||
* FILE: subsystems/win32/win32k/eng/stretchblt.c
|
* FILE: subsystems/win32/win32k/eng/stretchblt.c
|
||||||
* PROGRAMER: Jason Filby
|
* PROGRAMER: Jason Filby
|
||||||
|
@ -62,7 +62,7 @@ CallDibStretchBlt(SURFOBJ* psoDest,
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* FIXME - What to do here? */
|
/* FIXME: What to do here? */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -560,3 +560,4 @@ NtGdiEngStretchBlt(
|
||||||
return EngStretchBlt(psoDest, psoSource, Mask, ClipRegion, ColorTranslation, &ca, &lBrushOrigin, &rclDest, &rclSrc, &lMaskOrigin, Mode);
|
return EngStretchBlt(psoDest, psoSource, Mask, ClipRegion, ColorTranslation, &ca, &lBrushOrigin, &rclDest, &rclSrc, &lMaskOrigin, Mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* EOF */
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS Win32k subsystem
|
||||||
* PURPOSE: GDI Color Translation Functions
|
* PURPOSE: GDI Color Translation Functions
|
||||||
* FILE: subsystems/win32/win32k/eng/xlate.c
|
* FILE: subsystems/win32/win32k/eng/xlate.c
|
||||||
* PROGRAMER: Timo Kreuzer (timo.kreuzer@reactos.org)
|
* PROGRAMER: Timo Kreuzer (timo.kreuzer@reactos.org)
|
||||||
|
@ -359,7 +359,7 @@ EXLATEOBJ_vInitialize(
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Chack if both of the pallettes are indexed */
|
/* Check if both of the pallettes are indexed */
|
||||||
if (!(ppalSrc->flFlags & PAL_INDEXED) || !(ppalDst->flFlags & PAL_INDEXED))
|
if (!(ppalSrc->flFlags & PAL_INDEXED) || !(ppalDst->flFlags & PAL_INDEXED))
|
||||||
{
|
{
|
||||||
/* At least one palette is not indexed, calculate shifts/masks */
|
/* At least one palette is not indexed, calculate shifts/masks */
|
||||||
|
|
|
@ -12,7 +12,7 @@ typedef struct _WNDPROC_INFO
|
||||||
static __inline BOOL
|
static __inline BOOL
|
||||||
IsCallProcHandle(IN WNDPROC lpWndProc)
|
IsCallProcHandle(IN WNDPROC lpWndProc)
|
||||||
{
|
{
|
||||||
/* FIXME - check for 64 bit architectures... */
|
/* FIXME: Check for 64-bit architectures... */
|
||||||
return ((ULONG_PTR)lpWndProc & 0xFFFF0000) == 0xFFFF0000;
|
return ((ULONG_PTR)lpWndProc & 0xFFFF0000) == 0xFFFF0000;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3,11 +3,11 @@
|
||||||
#ifndef CLR_INVALID
|
#ifndef CLR_INVALID
|
||||||
#define CLR_INVALID 0xffffffff
|
#define CLR_INVALID 0xffffffff
|
||||||
#endif
|
#endif
|
||||||
#define PC_SYS_USED 0x80 /* palentry is used (both system and logical) */
|
#define PC_SYS_USED 0x80 /* Palentry is used (both system and logical) */
|
||||||
#define PC_SYS_RESERVED 0x40 /* system palentry is not to be mapped to */
|
#define PC_SYS_RESERVED 0x40 /* System palentry is not to be mapped to */
|
||||||
#define PC_SYS_MAPPED 0x10 /* logical palentry is a direct alias for system palentry */
|
#define PC_SYS_MAPPED 0x10 /* Logical palentry is a direct alias for system palentry */
|
||||||
|
|
||||||
#define NB_RESERVED_COLORS 20 /* number of fixed colors in system palette */
|
#define NB_RESERVED_COLORS 20 /* Number of fixed colors in system palette */
|
||||||
|
|
||||||
typedef struct _COLORSPACE
|
typedef struct _COLORSPACE
|
||||||
{
|
{
|
||||||
|
|
|
@ -15,7 +15,7 @@ typedef struct _DESKTOP
|
||||||
PWIN32HEAP pheapDesktop;
|
PWIN32HEAP pheapDesktop;
|
||||||
ULONG_PTR ulHeapSize;
|
ULONG_PTR ulHeapSize;
|
||||||
LIST_ENTRY PtiList;
|
LIST_ENTRY PtiList;
|
||||||
/* use for tracking mouse moves. */
|
/* Use for tracking mouse moves. */
|
||||||
PWND spwndTrack;
|
PWND spwndTrack;
|
||||||
DWORD htEx;
|
DWORD htEx;
|
||||||
RECT rcMouseHover;
|
RECT rcMouseHover;
|
||||||
|
|
|
@ -121,7 +121,7 @@ typedef struct _XFORMGDI {
|
||||||
/* XFORMOBJ has no public members */
|
/* XFORMOBJ has no public members */
|
||||||
} XFORMGDI;
|
} XFORMGDI;
|
||||||
|
|
||||||
/* as the *OBJ structures are located at the beginning of the *GDI structures
|
/* As the *OBJ structures are located at the beginning of the *GDI structures
|
||||||
we can simply typecast the pointer */
|
we can simply typecast the pointer */
|
||||||
#define ObjToGDI(ClipObj, Type) (Type##GDI *)(ClipObj)
|
#define ObjToGDI(ClipObj, Type) (Type##GDI *)(ClipObj)
|
||||||
#define GDIToObj(ClipGDI, Type) (Type##OBJ *)(ClipGDI)
|
#define GDIToObj(ClipGDI, Type) (Type##OBJ *)(ClipGDI)
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
#define HOOKID_TO_FLAG(HookId) (1 << ((HookId) + 1))
|
#define HOOKID_TO_FLAG(HookId) (1 << ((HookId) + 1))
|
||||||
#define ISITHOOKED(HookId) (((PTHREADINFO)PsGetCurrentThreadWin32Thread())->fsHooks & HOOKID_TO_FLAG(HookId))
|
#define ISITHOOKED(HookId) (((PTHREADINFO)PsGetCurrentThreadWin32Thread())->fsHooks & HOOKID_TO_FLAG(HookId))
|
||||||
|
|
||||||
/* NOTE: the following definition is not a real hook but
|
/* NOTE: The following definition is not a real hook but
|
||||||
a pseudo-id that will be used only for
|
a pseudo-id that will be used only for
|
||||||
injecting user api hook module to all processes.
|
injecting user api hook module to all processes.
|
||||||
It is used internally in win32k */
|
It is used internally in win32k */
|
||||||
|
|
|
@ -56,7 +56,7 @@ extern PATTACHINFO gpai;
|
||||||
/* Scan Codes */
|
/* Scan Codes */
|
||||||
#define SC_KEY_UP 0x8000
|
#define SC_KEY_UP 0x8000
|
||||||
/* lParam bits */
|
/* lParam bits */
|
||||||
#define LP_DO_NOT_CARE_BIT (1<<25) // for GetKeyNameText
|
#define LP_DO_NOT_CARE_BIT (1<<25) // For GetKeyNameText
|
||||||
|
|
||||||
/* General */
|
/* General */
|
||||||
INIT_FUNCTION NTSTATUS NTAPI InitInputImpl(VOID);
|
INIT_FUNCTION NTSTATUS NTAPI InitInputImpl(VOID);
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
|
|
||||||
#ifdef __GNUC__
|
#ifdef __GNUC__
|
||||||
/* Hack, for bug in ld. Will be removed soon. */
|
/* HACK, for bug in ld. Will be removed soon. */
|
||||||
#define __ImageBase _image_base__
|
#define __ImageBase _image_base__
|
||||||
#endif
|
#endif
|
||||||
extern IMAGE_DOS_HEADER __ImageBase;
|
extern IMAGE_DOS_HEADER __ImageBase;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
/* monitor object */
|
/* Monitor object */
|
||||||
typedef struct _MONITOR
|
typedef struct _MONITOR
|
||||||
{
|
{
|
||||||
HEAD head;
|
HEAD head;
|
||||||
|
@ -12,7 +12,7 @@ typedef struct _MONITOR
|
||||||
{
|
{
|
||||||
DWORD IsVisible: 1;
|
DWORD IsVisible: 1;
|
||||||
DWORD IsPalette: 1;
|
DWORD IsPalette: 1;
|
||||||
DWORD IsPrimary: 1; /* wether this is the primary monitor */
|
DWORD IsPrimary: 1; /* Whether this is the primary monitor */
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
RECT rcMonitor;
|
RECT rcMonitor;
|
||||||
|
@ -23,8 +23,8 @@ typedef struct _MONITOR
|
||||||
HDEV hDev;
|
HDEV hDev;
|
||||||
|
|
||||||
// ReactOS specific fields:
|
// ReactOS specific fields:
|
||||||
UNICODE_STRING DeviceName; /* name of the monitor */
|
UNICODE_STRING DeviceName; /* Name of the monitor */
|
||||||
PDEVOBJ *GdiDevice; /* pointer to the GDI device to
|
PDEVOBJ *GdiDevice; /* Pointer to the GDI device to
|
||||||
which this monitor is attached */
|
which this monitor is attached */
|
||||||
} MONITOR, *PMONITOR;
|
} MONITOR, *PMONITOR;
|
||||||
|
|
||||||
|
|
|
@ -95,28 +95,28 @@ typedef struct _USER_MESSAGE_QUEUE
|
||||||
/* Message Queue Flags */
|
/* Message Queue Flags */
|
||||||
DWORD QF_flags;
|
DWORD QF_flags;
|
||||||
|
|
||||||
/* queue state tracking */
|
/* Queue state tracking */
|
||||||
// Send list QS_SENDMESSAGE
|
// Send list QS_SENDMESSAGE
|
||||||
// Post list QS_POSTMESSAGE|QS_HOTKEY|QS_PAINT|QS_TIMER|QS_KEY
|
// Post list QS_POSTMESSAGE|QS_HOTKEY|QS_PAINT|QS_TIMER|QS_KEY
|
||||||
// Hard list QS_MOUSE|QS_KEY only
|
// Hard list QS_MOUSE|QS_KEY only
|
||||||
// Accounting of queue bit sets, the rest are flags. QS_TIMER QS_PAINT counts are handled in thread information.
|
// Accounting of queue bit sets, the rest are flags. QS_TIMER QS_PAINT counts are handled in thread information.
|
||||||
DWORD nCntsQBits[QSIDCOUNTS]; // QS_KEY QS_MOUSEMOVE QS_MOUSEBUTTON QS_POSTMESSAGE QS_SENDMESSAGE QS_HOTKEY
|
DWORD nCntsQBits[QSIDCOUNTS]; // QS_KEY QS_MOUSEMOVE QS_MOUSEBUTTON QS_POSTMESSAGE QS_SENDMESSAGE QS_HOTKEY
|
||||||
|
|
||||||
/* extra message information */
|
/* Extra message information */
|
||||||
LPARAM ExtraInfo;
|
LPARAM ExtraInfo;
|
||||||
|
|
||||||
/* state of each key */
|
/* State of each key */
|
||||||
BYTE afKeyRecentDown[256 / 8]; // 1 bit per key
|
BYTE afKeyRecentDown[256 / 8]; // 1 bit per key
|
||||||
BYTE afKeyState[256 * 2 / 8]; // 2 bits per key
|
BYTE afKeyState[256 * 2 / 8]; // 2 bits per key
|
||||||
|
|
||||||
/* showing cursor counter (value>=0 - cursor visible, value<0 - cursor hidden) */
|
/* Showing cursor counter (value>=0 - cursor visible, value<0 - cursor hidden) */
|
||||||
INT ShowingCursor;
|
INT ShowingCursor;
|
||||||
/* cursor object */
|
/* Cursor object */
|
||||||
PCURICON_OBJECT CursorObject;
|
PCURICON_OBJECT CursorObject;
|
||||||
|
|
||||||
/* messages that are currently dispatched by other threads */
|
/* Messages that are currently dispatched by other threads */
|
||||||
LIST_ENTRY DispatchingMessagesHead;
|
LIST_ENTRY DispatchingMessagesHead;
|
||||||
/* messages that are currently dispatched by this message queue, required for cleanup */
|
/* Messages that are currently dispatched by this message queue, required for cleanup */
|
||||||
LIST_ENTRY LocalDispatchingMessagesHead;
|
LIST_ENTRY LocalDispatchingMessagesHead;
|
||||||
|
|
||||||
/* Desktop that the message queue is attached to */
|
/* Desktop that the message queue is attached to */
|
||||||
|
@ -142,7 +142,7 @@ typedef struct _USER_MESSAGE_QUEUE
|
||||||
#define QF_CAPTURELOCKED 0x00100000
|
#define QF_CAPTURELOCKED 0x00100000
|
||||||
#define QF_ACTIVEWNDTRACKING 0x00200000
|
#define QF_ACTIVEWNDTRACKING 0x00200000
|
||||||
|
|
||||||
/* internal messages codes */
|
/* Internal messages codes */
|
||||||
enum internal_event_message
|
enum internal_event_message
|
||||||
{
|
{
|
||||||
WM_ASYNC_SHOWWINDOW = 0x80000000,
|
WM_ASYNC_SHOWWINDOW = 0x80000000,
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
|
|
||||||
typedef struct _GDIPOINTER /* should stay private to ENG? No, part of PDEVOBJ aka HDEV aka PDEV. */
|
typedef struct _GDIPOINTER /* should stay private to ENG? No, part of PDEVOBJ aka HDEV aka PDEV. */
|
||||||
{
|
{
|
||||||
/* private GDI pointer handling information, required for software emulation */
|
/* Private GDI pointer handling information, required for software emulation */
|
||||||
BOOL Enabled;
|
BOOL Enabled;
|
||||||
SIZEL Size;
|
SIZEL Size;
|
||||||
POINTL HotSpot;
|
POINTL HotSpot;
|
||||||
|
@ -32,8 +32,8 @@ typedef struct _GDIPOINTER /* should stay private to ENG? No, part of PDEVOBJ ak
|
||||||
SURFACE *psurfMask;
|
SURFACE *psurfMask;
|
||||||
SURFACE *psurfSave;
|
SURFACE *psurfSave;
|
||||||
|
|
||||||
/* public pointer information */
|
/* Public pointer information */
|
||||||
RECTL Exclude; /* required publicly for SPS_ACCEPT_EXCLUDE */
|
RECTL Exclude; /* Required publicly for SPS_ACCEPT_EXCLUDE */
|
||||||
} GDIPOINTER, *PGDIPOINTER;
|
} GDIPOINTER, *PGDIPOINTER;
|
||||||
|
|
||||||
typedef struct _DEVMODEINFO
|
typedef struct _DEVMODEINFO
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
// create one struct
|
// Create one struct
|
||||||
// make usable for different users (multiple structs!)
|
// Make usable for different users (multiple structs!)
|
||||||
|
|
||||||
#define SPI_TABLE1_MIN 1
|
#define SPI_TABLE1_MIN 1
|
||||||
#define SPI_TABLE1_MAX 119
|
#define SPI_TABLE1_MAX 119
|
||||||
|
|
|
@ -1,21 +1,21 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#define TAG_STRING ' RTS' /* string */
|
#define TAG_STRING ' RTS' /* String */
|
||||||
#define TAG_HOOK 'ohsU' /* hook */
|
#define TAG_HOOK 'ohsU' /* Hook */
|
||||||
#define TAG_MENUITEM 'emsU' /* menu item */
|
#define TAG_MENUITEM 'emsU' /* Menu item */
|
||||||
#define TAG_MSG 'GSEM' /* message */
|
#define TAG_MSG 'GSEM' /* Message */
|
||||||
#define TAG_USRMSG 'GSMU' /* user message */
|
#define TAG_USRMSG 'GSMU' /* User message */
|
||||||
#define TAG_SBARINFO 'NIBS' /* scrollbar info */
|
#define TAG_SBARINFO 'NIBS' /* Scrollbar info */
|
||||||
#define TAG_TIMERBMP 'BMIT' /* timers bitmap */
|
#define TAG_TIMERBMP 'BMIT' /* Timers bitmap */
|
||||||
#define TAG_WINSTA 'ATSW' /* window station */
|
#define TAG_WINSTA 'ATSW' /* Window station */
|
||||||
#define TAG_FONT 'ETNF' /* font entry */
|
#define TAG_FONT 'ETNF' /* Font entry */
|
||||||
#define TAG_BEZIER 'RZEB' /* bezier */
|
#define TAG_BEZIER 'RZEB' /* Bezier */
|
||||||
#define TAG_SHAPE 'phSG' /* shape */
|
#define TAG_SHAPE 'phSG' /* Shape */
|
||||||
#define TAG_COLORMAP 'MLOC' /* color map */
|
#define TAG_COLORMAP 'MLOC' /* Color map */
|
||||||
#define TAG_GDIHNDTBLE 'bthG' /* gdi handle table */
|
#define TAG_GDIHNDTBLE 'bthG' /* GDI handle table */
|
||||||
#define TAG_DIB ' BID' /* dib */
|
#define TAG_DIB ' BID' /* Dib */
|
||||||
|
|
||||||
/* gdi objects from the handle table */
|
/* GDI objects from the handle table */
|
||||||
#define TAG_DC GDITAG_HMGR_LOOKASIDE_DC_TYPE
|
#define TAG_DC GDITAG_HMGR_LOOKASIDE_DC_TYPE
|
||||||
#define TAG_REGION GDITAG_HMGR_LOOKASIDE_RGN_TYPE
|
#define TAG_REGION GDITAG_HMGR_LOOKASIDE_RGN_TYPE
|
||||||
#define TAG_SURFACE GDITAG_HMGR_LOOKASIDE_SURF_TYPE
|
#define TAG_SURFACE GDITAG_HMGR_LOOKASIDE_SURF_TYPE
|
||||||
|
@ -24,24 +24,24 @@
|
||||||
#define TAG_PALETTE GDITAG_HMGR_LOOKASIDE_PAL_TYPE
|
#define TAG_PALETTE GDITAG_HMGR_LOOKASIDE_PAL_TYPE
|
||||||
#define TAG_ICMLCS '90hG'
|
#define TAG_ICMLCS '90hG'
|
||||||
#define TAG_LFONT GDITAG_HMGR_LOOKASIDE_LFONT_TYPE
|
#define TAG_LFONT GDITAG_HMGR_LOOKASIDE_LFONT_TYPE
|
||||||
#define TAG_RFONT ';0gG' /* correct? */
|
#define TAG_RFONT ';0gG' /* Correct? */
|
||||||
#define TAG_PFE '<0hG'
|
#define TAG_PFE '<0hG'
|
||||||
#define TAG_PFT '=0hG' /* correct? */
|
#define TAG_PFT '=0hG' /* Correct? */
|
||||||
#define TAG_ICMCXF '>0hG' /* correct? */
|
#define TAG_ICMCXF '>0hG' /* Correct? */
|
||||||
#define TAG_SPRITE '?0hG' /* correct? */
|
#define TAG_SPRITE '?0hG' /* Correct? */
|
||||||
#define TAG_BRUSH GDITAG_HMGR_LOOKASIDE_BRUSH_TYPE
|
#define TAG_BRUSH GDITAG_HMGR_LOOKASIDE_BRUSH_TYPE
|
||||||
#define TAG_UMPD 'A0hG' /* correct? */
|
#define TAG_UMPD 'A0hG' /* Correct? */
|
||||||
#define TAG_SPACE 'c0hG' /* correct? */
|
#define TAG_SPACE 'c0hG' /* Correct? */
|
||||||
#define TAG_META 'E0hG' /* correct? */
|
#define TAG_META 'E0hG' /* Correct? */
|
||||||
#define TAG_EFSTATE 'F0hG' /* correct? */
|
#define TAG_EFSTATE 'F0hG' /* Correct? */
|
||||||
#define TAG_BMFD 'G0hG' /* correct? */
|
#define TAG_BMFD 'G0hG' /* Correct? */
|
||||||
#define TAG_VTFD 'H0hG' /* correct? */
|
#define TAG_VTFD 'H0hG' /* Correct? */
|
||||||
#define TAG_TTFD 'I0hG' /* correct? */
|
#define TAG_TTFD 'I0hG' /* Correct? */
|
||||||
#define TAG_RC 'J0hG' /* correct? */
|
#define TAG_RC 'J0hG' /* Correct? */
|
||||||
#define TAG_TEMP 'K0hG' /* correct? */
|
#define TAG_TEMP 'K0hG' /* Correct? */
|
||||||
#define TAG_DRVOBJ 'L0hG' /* correct? */
|
#define TAG_DRVOBJ 'L0hG' /* Correct? */
|
||||||
#define TAG_DCIOBJ 'M0hG' /* correct? */
|
#define TAG_DCIOBJ 'M0hG' /* Correct? */
|
||||||
#define TAG_SPOOL 'N0hG' /* correct? */
|
#define TAG_SPOOL 'N0hG' /* Correct? */
|
||||||
|
|
||||||
/* Dx internal tags rember I do not known if it right namees */
|
/* Dx internal tags rember I do not known if it right namees */
|
||||||
#define TAG_DXPVMLIST 'LPXD' /* pmvlist for the driver */
|
#define TAG_DXPVMLIST 'LPXD' /* pmvlist for the driver */
|
||||||
|
|
|
@ -41,7 +41,7 @@ extern BOOL RegisteredSysClasses;
|
||||||
typedef struct _WIN32HEAP WIN32HEAP, *PWIN32HEAP;
|
typedef struct _WIN32HEAP WIN32HEAP, *PWIN32HEAP;
|
||||||
|
|
||||||
#include <pshpack1.h>
|
#include <pshpack1.h>
|
||||||
// FIXME! Move to ntuser.h
|
// FIXME: Move to ntuser.h
|
||||||
typedef struct _TL
|
typedef struct _TL
|
||||||
{
|
{
|
||||||
struct _TL* next;
|
struct _TL* next;
|
||||||
|
|
|
@ -35,7 +35,7 @@
|
||||||
ULONG Id;
|
ULONG Id;
|
||||||
} DBG_CHANNEL;
|
} DBG_CHANNEL;
|
||||||
|
|
||||||
/* note: the following values don't need to be sorted */
|
/* Note: The following values don't need to be sorted */
|
||||||
enum _DEBUGCHANNELS
|
enum _DEBUGCHANNELS
|
||||||
{
|
{
|
||||||
DbgChEngBlt,
|
DbgChEngBlt,
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
#define DBG_ENABLE_EVENT_LOGGING 0
|
#define DBG_ENABLE_EVENT_LOGGING 0
|
||||||
#define DBG_ENABLE_SERVICE_HOOKS 0
|
#define DBG_ENABLE_SERVICE_HOOKS 0
|
||||||
|
|
||||||
/* misc headers */
|
/* Misc headers */
|
||||||
#include <include/win32kdebug.h>
|
#include <include/win32kdebug.h>
|
||||||
#include <include/mmcopy.h>
|
#include <include/mmcopy.h>
|
||||||
#include <include/tags.h>
|
#include <include/tags.h>
|
||||||
|
|
|
@ -16,7 +16,7 @@ typedef enum
|
||||||
|
|
||||||
typedef struct _WINSTATION_OBJECT
|
typedef struct _WINSTATION_OBJECT
|
||||||
{
|
{
|
||||||
PVOID SharedHeap; /* points to kmode memory! */
|
PVOID SharedHeap; /* Points to kmode memory! */
|
||||||
|
|
||||||
CSHORT Type;
|
CSHORT Type;
|
||||||
CSHORT Size;
|
CSHORT Size;
|
||||||
|
@ -30,7 +30,7 @@ typedef struct _WINSTATION_OBJECT
|
||||||
HANDLE ShellListView;
|
HANDLE ShellListView;
|
||||||
|
|
||||||
/* Effects */
|
/* Effects */
|
||||||
BOOL FontSmoothing; /* enable */
|
BOOL FontSmoothing; /* Enable */
|
||||||
UINT FontSmoothingType; /* 1:Standard,2:ClearType */
|
UINT FontSmoothingType; /* 1:Standard,2:ClearType */
|
||||||
/* FIXME: Big Icons (SPI_GETICONMETRICS?) */
|
/* FIXME: Big Icons (SPI_GETICONMETRICS?) */
|
||||||
BOOL DropShadow;
|
BOOL DropShadow;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS Win32k subsystem
|
||||||
* PURPOSE: Driver entry and initialization of win32k
|
* PURPOSE: Driver entry and initialization of win32k
|
||||||
* FILE: subsystems/win32/win32k/main/main.c
|
* FILE: subsystems/win32/win32k/main/main.c
|
||||||
* PROGRAMER:
|
* PROGRAMER:
|
||||||
|
@ -46,7 +46,7 @@ Win32kProcessCallback(struct _EPROCESS *Process,
|
||||||
/* Allocate one if needed */
|
/* Allocate one if needed */
|
||||||
if (!Win32Process)
|
if (!Win32Process)
|
||||||
{
|
{
|
||||||
/* FIXME - lock the process */
|
/* FIXME: Lock the process */
|
||||||
Win32Process = ExAllocatePoolWithTag(NonPagedPool,
|
Win32Process = ExAllocatePoolWithTag(NonPagedPool,
|
||||||
sizeof(PROCESSINFO),
|
sizeof(PROCESSINFO),
|
||||||
USERTAG_PROCESSINFO);
|
USERTAG_PROCESSINFO);
|
||||||
|
@ -56,7 +56,7 @@ Win32kProcessCallback(struct _EPROCESS *Process,
|
||||||
RtlZeroMemory(Win32Process, sizeof(PROCESSINFO));
|
RtlZeroMemory(Win32Process, sizeof(PROCESSINFO));
|
||||||
|
|
||||||
PsSetProcessWin32Process(Process, Win32Process);
|
PsSetProcessWin32Process(Process, Win32Process);
|
||||||
/* FIXME - unlock the process */
|
/* FIXME: Unlock the process */
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Create)
|
if (Create)
|
||||||
|
@ -238,7 +238,7 @@ Win32kThreadCallback(struct _ETHREAD *Thread,
|
||||||
/* Allocate one if needed */
|
/* Allocate one if needed */
|
||||||
if (!ptiCurrent)
|
if (!ptiCurrent)
|
||||||
{
|
{
|
||||||
/* FIXME - lock the process */
|
/* FIXME: Lock the process */
|
||||||
ptiCurrent = ExAllocatePoolWithTag(NonPagedPool,
|
ptiCurrent = ExAllocatePoolWithTag(NonPagedPool,
|
||||||
sizeof(THREADINFO),
|
sizeof(THREADINFO),
|
||||||
USERTAG_THREADINFO);
|
USERTAG_THREADINFO);
|
||||||
|
@ -252,7 +252,7 @@ Win32kThreadCallback(struct _ETHREAD *Thread,
|
||||||
RtlZeroMemory(ptiCurrent, sizeof(THREADINFO));
|
RtlZeroMemory(ptiCurrent, sizeof(THREADINFO));
|
||||||
|
|
||||||
PsSetThreadWin32Thread(Thread, ptiCurrent);
|
PsSetThreadWin32Thread(Thread, ptiCurrent);
|
||||||
/* FIXME - unlock the process */
|
/* FIXME: Unlock the process */
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Type == PsW32ThreadCalloutInitialize)
|
if (Type == PsW32ThreadCalloutInitialize)
|
||||||
|
@ -463,14 +463,14 @@ Win32kInitWin32Thread(PETHREAD Thread)
|
||||||
|
|
||||||
if (Process->Win32Process == NULL)
|
if (Process->Win32Process == NULL)
|
||||||
{
|
{
|
||||||
/* FIXME - lock the process */
|
/* FIXME: Lock the process */
|
||||||
Process->Win32Process = ExAllocatePoolWithTag(NonPagedPool, sizeof(PROCESSINFO), USERTAG_PROCESSINFO);
|
Process->Win32Process = ExAllocatePoolWithTag(NonPagedPool, sizeof(PROCESSINFO), USERTAG_PROCESSINFO);
|
||||||
|
|
||||||
if (Process->Win32Process == NULL)
|
if (Process->Win32Process == NULL)
|
||||||
return STATUS_NO_MEMORY;
|
return STATUS_NO_MEMORY;
|
||||||
|
|
||||||
RtlZeroMemory(Process->Win32Process, sizeof(PROCESSINFO));
|
RtlZeroMemory(Process->Win32Process, sizeof(PROCESSINFO));
|
||||||
/* FIXME - unlock the process */
|
/* FIXME: Unlock the process */
|
||||||
|
|
||||||
Win32kProcessCallback(Process, TRUE);
|
Win32kProcessCallback(Process, TRUE);
|
||||||
}
|
}
|
||||||
|
@ -557,7 +557,7 @@ DriverEntry(
|
||||||
/* Create the global USER heap */
|
/* Create the global USER heap */
|
||||||
GlobalUserHeap = UserCreateHeap(&GlobalUserHeapSection,
|
GlobalUserHeap = UserCreateHeap(&GlobalUserHeapSection,
|
||||||
&GlobalUserHeapBase,
|
&GlobalUserHeapBase,
|
||||||
1 * 1024 * 1024); /* FIXME - 1 MB for now... */
|
1 * 1024 * 1024); /* FIXME: 1 MB for now... */
|
||||||
if (GlobalUserHeap == NULL)
|
if (GlobalUserHeap == NULL)
|
||||||
{
|
{
|
||||||
DPRINT1("Failed to initialize the global heap!\n");
|
DPRINT1("Failed to initialize the global heap!\n");
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
#include <win32k.h>
|
#include <win32k.h>
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* FIXME! Is there a better algorithm. like FT_MulDiv
|
* FIXME: Is there a better algorithm, like FT_MulDiv?
|
||||||
*
|
*
|
||||||
* @implemented
|
* @implemented
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -262,7 +262,7 @@ RegWriteUserSetting(
|
||||||
WCHAR awcBuffer[MAX_PATH];
|
WCHAR awcBuffer[MAX_PATH];
|
||||||
HKEY hkey;
|
HKEY hkey;
|
||||||
|
|
||||||
// FIXME: logged in user versus current process user?
|
// FIXME: Logged in user versus current process user?
|
||||||
/* Get the path of the current user's profile */
|
/* Get the path of the current user's profile */
|
||||||
Status = RtlFormatCurrentUserKeyPath(&usCurrentUserKey);
|
Status = RtlFormatCurrentUserKeyPath(&usCurrentUserKey);
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
|
|
|
@ -39,7 +39,7 @@ IntUserHeapCommitRoutine(IN PVOID Base,
|
||||||
|
|
||||||
if (W32Process != NULL)
|
if (W32Process != NULL)
|
||||||
{
|
{
|
||||||
/* search for the mapping */
|
/* Search for the mapping */
|
||||||
Mapping = &W32Process->HeapMappings;
|
Mapping = &W32Process->HeapMappings;
|
||||||
while (Mapping != NULL)
|
while (Mapping != NULL)
|
||||||
{
|
{
|
||||||
|
@ -63,7 +63,7 @@ IntUserHeapCommitRoutine(IN PVOID Base,
|
||||||
/* HACK: This needs to be handled during startup only... */
|
/* HACK: This needs to be handled during startup only... */
|
||||||
ASSERT(Base == (PVOID)GlobalUserHeap);
|
ASSERT(Base == (PVOID)GlobalUserHeap);
|
||||||
|
|
||||||
/* temporarily map it into user space */
|
/* Temporarily map it into user space */
|
||||||
Offset.QuadPart = 0;
|
Offset.QuadPart = 0;
|
||||||
Status = MmMapViewOfSection(GlobalUserHeapSection,
|
Status = MmMapViewOfSection(GlobalUserHeapSection,
|
||||||
PsGetCurrentProcess(),
|
PsGetCurrentProcess(),
|
||||||
|
@ -74,7 +74,7 @@ IntUserHeapCommitRoutine(IN PVOID Base,
|
||||||
&ViewSize,
|
&ViewSize,
|
||||||
ViewUnmap,
|
ViewUnmap,
|
||||||
SEC_NO_CHANGE,
|
SEC_NO_CHANGE,
|
||||||
PAGE_EXECUTE_READ); /* would prefer PAGE_READONLY, but thanks to RTL heaps... */
|
PAGE_EXECUTE_READ); /* Would prefer PAGE_READONLY, but thanks to RTL heaps... */
|
||||||
|
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
return Status;
|
return Status;
|
||||||
|
@ -132,7 +132,7 @@ IntUserHeapCreate(IN PSECTION_OBJECT SectionObject,
|
||||||
&ViewSize,
|
&ViewSize,
|
||||||
ViewUnmap,
|
ViewUnmap,
|
||||||
SEC_NO_CHANGE,
|
SEC_NO_CHANGE,
|
||||||
PAGE_EXECUTE_READ); /* would prefer PAGE_READONLY, but thanks to RTL heaps... */
|
PAGE_EXECUTE_READ); /* Would prefer PAGE_READONLY, but thanks to RTL heaps... */
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
@ -141,7 +141,7 @@ IntUserHeapCreate(IN PSECTION_OBJECT SectionObject,
|
||||||
0,
|
0,
|
||||||
&ViewSize,
|
&ViewSize,
|
||||||
MEM_COMMIT,
|
MEM_COMMIT,
|
||||||
PAGE_EXECUTE_READ); /* would prefer PAGE_READONLY, but thanks to RTL heaps... */
|
PAGE_EXECUTE_READ); /* Would prefer PAGE_READONLY, but thanks to RTL heaps... */
|
||||||
|
|
||||||
MmUnmapViewOfSection(PsGetCurrentProcess(),
|
MmUnmapViewOfSection(PsGetCurrentProcess(),
|
||||||
MappedView);
|
MappedView);
|
||||||
|
@ -177,12 +177,12 @@ UserCreateHeap(OUT PSECTION_OBJECT *SectionObject,
|
||||||
|
|
||||||
SizeHeap.QuadPart = HeapSize;
|
SizeHeap.QuadPart = HeapSize;
|
||||||
|
|
||||||
/* create the section and map it into session space */
|
/* Create the section and map it into session space */
|
||||||
Status = MmCreateSection((PVOID*)SectionObject,
|
Status = MmCreateSection((PVOID*)SectionObject,
|
||||||
SECTION_ALL_ACCESS,
|
SECTION_ALL_ACCESS,
|
||||||
NULL,
|
NULL,
|
||||||
&SizeHeap,
|
&SizeHeap,
|
||||||
PAGE_EXECUTE_READWRITE, /* would prefer PAGE_READWRITE, but thanks to RTL heaps... */
|
PAGE_EXECUTE_READWRITE, /* Would prefer PAGE_READWRITE, but thanks to RTL heaps... */
|
||||||
SEC_RESERVE,
|
SEC_RESERVE,
|
||||||
NULL,
|
NULL,
|
||||||
NULL);
|
NULL);
|
||||||
|
@ -205,7 +205,7 @@ UserCreateHeap(OUT PSECTION_OBJECT *SectionObject,
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* create the heap */
|
/* Create the heap */
|
||||||
pHeap = IntUserHeapCreate(*SectionObject,
|
pHeap = IntUserHeapCreate(*SectionObject,
|
||||||
SystemBase,
|
SystemBase,
|
||||||
HeapSize);
|
HeapSize);
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
/*
|
/*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS Win32k subsystem
|
||||||
* PURPOSE: Callback to usermode support
|
* PURPOSE: Callback to usermode support
|
||||||
* FILE: subsys/win32k/ntuser/callback.c
|
* FILE: subsystems/win32/win32k/ntuser/callback.c
|
||||||
* PROGRAMER: Casper S. Hornstrup (chorns@users.sourceforge.net)
|
* PROGRAMER: Casper S. Hornstrup (chorns@users.sourceforge.net)
|
||||||
* Thomas Weidenmueller (w3seek@users.sourceforge.net)
|
* Thomas Weidenmueller (w3seek@users.sourceforge.net)
|
||||||
* NOTES: Please use the Callback Memory Management functions for
|
* NOTES: Please use the Callback Memory Management functions for
|
||||||
|
@ -17,7 +17,7 @@ DBG_DEFAULT_CHANNEL(UserCallback);
|
||||||
|
|
||||||
typedef struct _INT_CALLBACK_HEADER
|
typedef struct _INT_CALLBACK_HEADER
|
||||||
{
|
{
|
||||||
/* list entry in the THREADINFO structure */
|
/* List entry in the THREADINFO structure */
|
||||||
LIST_ENTRY ListEntry;
|
LIST_ENTRY ListEntry;
|
||||||
}
|
}
|
||||||
INT_CALLBACK_HEADER, *PINT_CALLBACK_HEADER;
|
INT_CALLBACK_HEADER, *PINT_CALLBACK_HEADER;
|
||||||
|
@ -37,7 +37,7 @@ IntCbAllocateMemory(ULONG Size)
|
||||||
W32Thread = PsGetCurrentThreadWin32Thread();
|
W32Thread = PsGetCurrentThreadWin32Thread();
|
||||||
ASSERT(W32Thread);
|
ASSERT(W32Thread);
|
||||||
|
|
||||||
/* insert the callback memory into the thread's callback list */
|
/* Insert the callback memory into the thread's callback list */
|
||||||
|
|
||||||
InsertTailList(&W32Thread->W32CallbackListHead, &Mem->ListEntry);
|
InsertTailList(&W32Thread->W32CallbackListHead, &Mem->ListEntry);
|
||||||
|
|
||||||
|
@ -57,10 +57,10 @@ IntCbFreeMemory(PVOID Data)
|
||||||
W32Thread = PsGetCurrentThreadWin32Thread();
|
W32Thread = PsGetCurrentThreadWin32Thread();
|
||||||
ASSERT(W32Thread);
|
ASSERT(W32Thread);
|
||||||
|
|
||||||
/* remove the memory block from the thread's callback list */
|
/* Remove the memory block from the thread's callback list */
|
||||||
RemoveEntryList(&Mem->ListEntry);
|
RemoveEntryList(&Mem->ListEntry);
|
||||||
|
|
||||||
/* free memory */
|
/* Free memory */
|
||||||
ExFreePoolWithTag(Mem, USERTAG_CALLBACK);
|
ExFreePoolWithTag(Mem, USERTAG_CALLBACK);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -76,12 +76,11 @@ IntCleanupThreadCallbacks(PTHREADINFO W32Thread)
|
||||||
Mem = CONTAINING_RECORD(CurrentEntry, INT_CALLBACK_HEADER,
|
Mem = CONTAINING_RECORD(CurrentEntry, INT_CALLBACK_HEADER,
|
||||||
ListEntry);
|
ListEntry);
|
||||||
|
|
||||||
/* free memory */
|
/* Free memory */
|
||||||
ExFreePool(Mem);
|
ExFreePool(Mem);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Pass the Current Window handle and pointer to the Client Callback.
|
// Pass the Current Window handle and pointer to the Client Callback.
|
||||||
// This will help user space programs speed up read access with the window object.
|
// This will help user space programs speed up read access with the window object.
|
||||||
|
@ -114,7 +113,7 @@ IntRestoreTebWndCallback (HWND hWnd, PWND pWnd, PVOID pActCtx)
|
||||||
|
|
||||||
/* FUNCTIONS *****************************************************************/
|
/* FUNCTIONS *****************************************************************/
|
||||||
|
|
||||||
/* calls ClientLoadLibrary in user32 */
|
/* Calls ClientLoadLibrary in user32 */
|
||||||
HMODULE
|
HMODULE
|
||||||
co_IntClientLoadLibrary(PUNICODE_STRING pstrLibName,
|
co_IntClientLoadLibrary(PUNICODE_STRING pstrLibName,
|
||||||
PUNICODE_STRING pstrInitFunc,
|
PUNICODE_STRING pstrInitFunc,
|
||||||
|
@ -825,5 +824,4 @@ co_IntClientThreadSetup(VOID)
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* EOF */
|
/* EOF */
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
WNDPROC
|
WNDPROC
|
||||||
GetCallProcHandle(IN PCALLPROCDATA CallProc)
|
GetCallProcHandle(IN PCALLPROCDATA CallProc)
|
||||||
{
|
{
|
||||||
/* FIXME - check for 64 bit architectures... */
|
/* FIXME: Check for 64 bit architectures... */
|
||||||
return (WNDPROC)((ULONG_PTR)UserHMGetHandle(CallProc) | 0xFFFF0000);
|
return (WNDPROC)((ULONG_PTR)UserHMGetHandle(CallProc) | 0xFFFF0000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
/*
|
/*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS Win32k subsystem
|
||||||
* PURPOSE: Caret functions
|
* PURPOSE: Caret functions
|
||||||
* FILE: subsys/win32k/ntuser/caret.c
|
* FILE: subsystems/win32/win32k/ntuser/caret.c
|
||||||
* PROGRAMER: Thomas Weidenmueller (w3seek@users.sourceforge.net)
|
* PROGRAMER: Thomas Weidenmueller (w3seek@users.sourceforge.net)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -63,7 +63,7 @@ IntSetCaretBlinkTime(UINT uMSeconds)
|
||||||
PTHREADINFO pti = PsGetCurrentThreadWin32Thread();
|
PTHREADINFO pti = PsGetCurrentThreadWin32Thread();
|
||||||
PWINSTATION_OBJECT WinStaObject = pti->rpdesk->rpwinstaParent;
|
PWINSTATION_OBJECT WinStaObject = pti->rpdesk->rpwinstaParent;
|
||||||
|
|
||||||
/* windows doesn't do this check */
|
/* Windows doesn't do this check */
|
||||||
if((uMSeconds < MIN_CARETBLINKRATE) || (uMSeconds > MAX_CARETBLINKRATE))
|
if((uMSeconds < MIN_CARETBLINKRATE) || (uMSeconds > MAX_CARETBLINKRATE))
|
||||||
{
|
{
|
||||||
EngSetLastError(ERROR_INVALID_PARAMETER);
|
EngSetLastError(ERROR_INVALID_PARAMETER);
|
||||||
|
@ -157,11 +157,11 @@ IntGetCaretBlinkTime(VOID)
|
||||||
Ret = WinStaObject->CaretBlinkRate;
|
Ret = WinStaObject->CaretBlinkRate;
|
||||||
if(!Ret)
|
if(!Ret)
|
||||||
{
|
{
|
||||||
/* load it from the registry the first call only! */
|
/* Load it from the registry the first call only! */
|
||||||
Ret = WinStaObject->CaretBlinkRate = IntQueryCaretBlinkRate();
|
Ret = WinStaObject->CaretBlinkRate = IntQueryCaretBlinkRate();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* windows doesn't do this check */
|
/* Windows doesn't do this check */
|
||||||
if((Ret < MIN_CARETBLINKRATE) || (Ret > MAX_CARETBLINKRATE))
|
if((Ret < MIN_CARETBLINKRATE) || (Ret > MAX_CARETBLINKRATE))
|
||||||
{
|
{
|
||||||
Ret = DEFAULT_CARETBLINKRATE;
|
Ret = DEFAULT_CARETBLINKRATE;
|
||||||
|
@ -219,7 +219,7 @@ IntSwitchCaretShowing(PVOID Info)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0 //unused
|
#if 0 // Unused
|
||||||
static
|
static
|
||||||
VOID FASTCALL
|
VOID FASTCALL
|
||||||
co_IntDrawCaret(HWND hWnd)
|
co_IntDrawCaret(HWND hWnd)
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS Win32k subsystem
|
||||||
* PURPOSE: Window classes
|
* PURPOSE: Window classes
|
||||||
* FILE: subsystems/win32/win32k/ntuser/class.c
|
* FILE: subsystems/win32/win32k/ntuser/class.c
|
||||||
* PROGRAMER: Thomas Weidenmueller <w3seek@reactos.com>
|
* PROGRAMER: Thomas Weidenmueller <w3seek@reactos.com>
|
||||||
|
@ -115,7 +115,7 @@ LookupFnIdToiCls(int FnId, int *iCls )
|
||||||
static VOID
|
static VOID
|
||||||
IntFreeClassMenuName(IN OUT PCLS Class)
|
IntFreeClassMenuName(IN OUT PCLS Class)
|
||||||
{
|
{
|
||||||
/* free the menu name, if it was changed and allocated */
|
/* Free the menu name, if it was changed and allocated */
|
||||||
if (Class->lpszClientUnicodeMenuName != NULL && Class->MenuNameIsString)
|
if (Class->lpszClientUnicodeMenuName != NULL && Class->MenuNameIsString)
|
||||||
{
|
{
|
||||||
UserHeapFree(Class->lpszClientUnicodeMenuName);
|
UserHeapFree(Class->lpszClientUnicodeMenuName);
|
||||||
|
@ -128,7 +128,7 @@ static VOID
|
||||||
IntDestroyClass(IN OUT PCLS Class)
|
IntDestroyClass(IN OUT PCLS Class)
|
||||||
{
|
{
|
||||||
PDESKTOP pDesk;
|
PDESKTOP pDesk;
|
||||||
/* there shouldn't be any clones anymore */
|
/* There shouldn't be any clones anymore */
|
||||||
ASSERT(Class->cWndReferenceCount == 0);
|
ASSERT(Class->cWndReferenceCount == 0);
|
||||||
ASSERT(Class->pclsClone == NULL);
|
ASSERT(Class->pclsClone == NULL);
|
||||||
|
|
||||||
|
@ -161,7 +161,7 @@ IntDestroyClass(IN OUT PCLS Class)
|
||||||
pDesk = Class->rpdeskParent;
|
pDesk = Class->rpdeskParent;
|
||||||
Class->rpdeskParent = NULL;
|
Class->rpdeskParent = NULL;
|
||||||
|
|
||||||
/* free the structure */
|
/* Free the structure */
|
||||||
if (pDesk != NULL)
|
if (pDesk != NULL)
|
||||||
{
|
{
|
||||||
DesktopHeapFree(pDesk, Class);
|
DesktopHeapFree(pDesk, Class);
|
||||||
|
@ -173,7 +173,7 @@ IntDestroyClass(IN OUT PCLS Class)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* clean all process classes. all process windows must cleaned first!! */
|
/* Clean all process classes. all process windows must cleaned first!! */
|
||||||
void FASTCALL DestroyProcessClasses(PPROCESSINFO Process )
|
void FASTCALL DestroyProcessClasses(PPROCESSINFO Process )
|
||||||
{
|
{
|
||||||
PCLS Class;
|
PCLS Class;
|
||||||
|
@ -181,7 +181,7 @@ void FASTCALL DestroyProcessClasses(PPROCESSINFO Process )
|
||||||
|
|
||||||
if (pi != NULL)
|
if (pi != NULL)
|
||||||
{
|
{
|
||||||
/* free all local classes */
|
/* Free all local classes */
|
||||||
Class = pi->pclsPrivateList;
|
Class = pi->pclsPrivateList;
|
||||||
while (Class != NULL)
|
while (Class != NULL)
|
||||||
{
|
{
|
||||||
|
@ -193,7 +193,7 @@ void FASTCALL DestroyProcessClasses(PPROCESSINFO Process )
|
||||||
Class = pi->pclsPrivateList;
|
Class = pi->pclsPrivateList;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* free all global classes */
|
/* Free all global classes */
|
||||||
Class = pi->pclsPublicList;
|
Class = pi->pclsPublicList;
|
||||||
while (Class != NULL)
|
while (Class != NULL)
|
||||||
{
|
{
|
||||||
|
@ -217,7 +217,7 @@ IntRegisterClassAtom(IN PUNICODE_STRING ClassName,
|
||||||
|
|
||||||
if (ClassName->Length != 0)
|
if (ClassName->Length != 0)
|
||||||
{
|
{
|
||||||
/* FIXME - Don't limit to 64 characters! use SEH when allocating memory! */
|
/* FIXME: Don't limit to 64 characters! Use SEH when allocating memory! */
|
||||||
if (ClassName->Length / sizeof(WCHAR) >= sizeof(szBuf) / sizeof(szBuf[0]))
|
if (ClassName->Length / sizeof(WCHAR) >= sizeof(szBuf) / sizeof(szBuf[0]))
|
||||||
{
|
{
|
||||||
EngSetLastError(ERROR_INVALID_PARAMETER);
|
EngSetLastError(ERROR_INVALID_PARAMETER);
|
||||||
|
@ -281,7 +281,7 @@ IntSetClassAtom(IN OUT PCLS Class,
|
||||||
{
|
{
|
||||||
RTL_ATOM Atom = (RTL_ATOM)0;
|
RTL_ATOM Atom = (RTL_ATOM)0;
|
||||||
|
|
||||||
/* update the base class first */
|
/* Update the base class first */
|
||||||
Class = Class->pclsBase;
|
Class = Class->pclsBase;
|
||||||
|
|
||||||
if (!IntRegisterClassAtom(ClassName,
|
if (!IntRegisterClassAtom(ClassName,
|
||||||
|
@ -294,7 +294,7 @@ IntSetClassAtom(IN OUT PCLS Class,
|
||||||
|
|
||||||
Class->atomClassName = Atom;
|
Class->atomClassName = Atom;
|
||||||
|
|
||||||
/* update the clones */
|
/* Update the clones */
|
||||||
Class = Class->pclsClone;
|
Class = Class->pclsClone;
|
||||||
while (Class != NULL)
|
while (Class != NULL)
|
||||||
{
|
{
|
||||||
|
@ -425,7 +425,7 @@ IntSetClassWndProc(IN OUT PCLS Class,
|
||||||
Class->CSF_flags &= ~CSF_ANSIPROC;
|
Class->CSF_flags &= ~CSF_ANSIPROC;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* update the clones */
|
/* Update the clones */
|
||||||
chWndProc = Class->lpfnWndProc;
|
chWndProc = Class->lpfnWndProc;
|
||||||
|
|
||||||
Class = Class->pclsClone;
|
Class = Class->pclsClone;
|
||||||
|
@ -453,7 +453,7 @@ IntGetClassForDesktop(IN OUT PCLS BaseClass,
|
||||||
|
|
||||||
if (BaseClass->rpdeskParent == Desktop)
|
if (BaseClass->rpdeskParent == Desktop)
|
||||||
{
|
{
|
||||||
/* it is most likely that a window is created on the same
|
/* It is most likely that a window is created on the same
|
||||||
desktop as the window class. */
|
desktop as the window class. */
|
||||||
|
|
||||||
return BaseClass;
|
return BaseClass;
|
||||||
|
@ -499,12 +499,12 @@ IntGetClassForDesktop(IN OUT PCLS BaseClass,
|
||||||
ClassSize);
|
ClassSize);
|
||||||
if (Class != NULL)
|
if (Class != NULL)
|
||||||
{
|
{
|
||||||
/* simply clone the class */
|
/* Simply clone the class */
|
||||||
RtlCopyMemory( Class, BaseClass, ClassSize);
|
RtlCopyMemory( Class, BaseClass, ClassSize);
|
||||||
|
|
||||||
TRACE("Clone Class 0x%x hM 0x%x\n %S\n",Class, Class->hModule, Class->lpszClientUnicodeMenuName);
|
TRACE("Clone Class 0x%x hM 0x%x\n %S\n",Class, Class->hModule, Class->lpszClientUnicodeMenuName);
|
||||||
|
|
||||||
/* restore module address if default user class Ref: Bug 4778 */
|
/* Restore module address if default user class Ref: Bug 4778 */
|
||||||
if ( Class->hModule != hModClient &&
|
if ( Class->hModule != hModClient &&
|
||||||
Class->fnid <= FNID_GHOST &&
|
Class->fnid <= FNID_GHOST &&
|
||||||
Class->fnid >= FNID_BUTTON )
|
Class->fnid >= FNID_BUTTON )
|
||||||
|
@ -513,13 +513,13 @@ IntGetClassForDesktop(IN OUT PCLS BaseClass,
|
||||||
TRACE("Clone Class 0x%x Reset hM 0x%x\n",Class, Class->hModule);
|
TRACE("Clone Class 0x%x Reset hM 0x%x\n",Class, Class->hModule);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* update some pointers and link the class */
|
/* Update some pointers and link the class */
|
||||||
Class->rpdeskParent = Desktop;
|
Class->rpdeskParent = Desktop;
|
||||||
Class->cWndReferenceCount = 0;
|
Class->cWndReferenceCount = 0;
|
||||||
|
|
||||||
if (BaseClass->rpdeskParent == NULL)
|
if (BaseClass->rpdeskParent == NULL)
|
||||||
{
|
{
|
||||||
/* we don't really need the base class on the shared
|
/* We don't really need the base class on the shared
|
||||||
heap anymore, delete it so the only class left is
|
heap anymore, delete it so the only class left is
|
||||||
the clone we just created, which now serves as the
|
the clone we just created, which now serves as the
|
||||||
new base class */
|
new base class */
|
||||||
|
@ -528,18 +528,18 @@ IntGetClassForDesktop(IN OUT PCLS BaseClass,
|
||||||
Class->pclsBase = Class;
|
Class->pclsBase = Class;
|
||||||
Class->pclsNext = BaseClass->pclsNext;
|
Class->pclsNext = BaseClass->pclsNext;
|
||||||
|
|
||||||
/* replace the base class */
|
/* Replace the base class */
|
||||||
(void)InterlockedExchangePointer((PVOID*)ClassLink,
|
(void)InterlockedExchangePointer((PVOID*)ClassLink,
|
||||||
Class);
|
Class);
|
||||||
|
|
||||||
/* destroy the obsolete copy on the shared heap */
|
/* Destroy the obsolete copy on the shared heap */
|
||||||
BaseClass->pclsBase = NULL;
|
BaseClass->pclsBase = NULL;
|
||||||
BaseClass->pclsClone = NULL;
|
BaseClass->pclsClone = NULL;
|
||||||
IntDestroyClass(BaseClass);
|
IntDestroyClass(BaseClass);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* link in the clone */
|
/* Link in the clone */
|
||||||
Class->pclsClone = NULL;
|
Class->pclsClone = NULL;
|
||||||
Class->pclsBase = BaseClass;
|
Class->pclsBase = BaseClass;
|
||||||
Class->pclsNext = BaseClass->pclsClone;
|
Class->pclsNext = BaseClass->pclsClone;
|
||||||
|
@ -589,15 +589,15 @@ IntMakeCloneBaseClass(IN OUT PCLS Class,
|
||||||
ASSERT(Class->pclsBase->rpdeskParent != NULL);
|
ASSERT(Class->pclsBase->rpdeskParent != NULL);
|
||||||
ASSERT(Class->pclsBase->cWndReferenceCount == 0);
|
ASSERT(Class->pclsBase->cWndReferenceCount == 0);
|
||||||
|
|
||||||
/* unlink the clone */
|
/* Unlink the clone */
|
||||||
*CloneLink = Class->pclsNext;
|
*CloneLink = Class->pclsNext;
|
||||||
Class->pclsClone = Class->pclsBase->pclsClone;
|
Class->pclsClone = Class->pclsBase->pclsClone;
|
||||||
|
|
||||||
/* update the class information to make it a base class */
|
/* Update the class information to make it a base class */
|
||||||
Class->pclsBase = Class;
|
Class->pclsBase = Class;
|
||||||
Class->pclsNext = (*BaseClassLink)->pclsNext;
|
Class->pclsNext = (*BaseClassLink)->pclsNext;
|
||||||
|
|
||||||
/* update all clones */
|
/* Update all clones */
|
||||||
Clone = Class->pclsClone;
|
Clone = Class->pclsClone;
|
||||||
while (Clone != NULL)
|
while (Clone != NULL)
|
||||||
{
|
{
|
||||||
|
@ -607,7 +607,7 @@ IntMakeCloneBaseClass(IN OUT PCLS Class,
|
||||||
Clone = Clone->pclsNext;
|
Clone = Clone->pclsNext;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* link in the new base class */
|
/* Link in the new base class */
|
||||||
(void)InterlockedExchangePointer((PVOID*)BaseClassLink,
|
(void)InterlockedExchangePointer((PVOID*)BaseClassLink,
|
||||||
Class);
|
Class);
|
||||||
}
|
}
|
||||||
|
@ -629,7 +629,7 @@ IntDereferenceClass(IN OUT PCLS Class,
|
||||||
ASSERT(Class->pclsBase == Class);
|
ASSERT(Class->pclsBase == Class);
|
||||||
|
|
||||||
TRACE("IntDereferenceClass 0x%x\n", Class);
|
TRACE("IntDereferenceClass 0x%x\n", Class);
|
||||||
/* check if there are clones of the class on other desktops,
|
/* Check if there are clones of the class on other desktops,
|
||||||
link the first clone in if possible. If there are no clones
|
link the first clone in if possible. If there are no clones
|
||||||
then leave the class on the desktop heap. It will get moved
|
then leave the class on the desktop heap. It will get moved
|
||||||
to the shared heap when the thread detaches. */
|
to the shared heap when the thread detaches. */
|
||||||
|
@ -651,12 +651,12 @@ IntDereferenceClass(IN OUT PCLS Class,
|
||||||
|
|
||||||
ASSERT(*PrevLink == BaseClass);
|
ASSERT(*PrevLink == BaseClass);
|
||||||
|
|
||||||
/* make the first clone become the new base class */
|
/* Make the first clone become the new base class */
|
||||||
IntMakeCloneBaseClass(BaseClass->pclsClone,
|
IntMakeCloneBaseClass(BaseClass->pclsClone,
|
||||||
PrevLink,
|
PrevLink,
|
||||||
&BaseClass->pclsClone);
|
&BaseClass->pclsClone);
|
||||||
|
|
||||||
/* destroy the class, there's still another clone of the class
|
/* Destroy the class, there's still another clone of the class
|
||||||
that now serves as a base class. Make sure we don't destruct
|
that now serves as a base class. Make sure we don't destruct
|
||||||
resources shared by all classes (Base = NULL)! */
|
resources shared by all classes (Base = NULL)! */
|
||||||
BaseClass->pclsBase = NULL;
|
BaseClass->pclsBase = NULL;
|
||||||
|
@ -668,7 +668,7 @@ IntDereferenceClass(IN OUT PCLS Class,
|
||||||
{
|
{
|
||||||
TRACE("IntDereferenceClass1 0x%x\n", Class);
|
TRACE("IntDereferenceClass1 0x%x\n", Class);
|
||||||
|
|
||||||
/* locate the cloned class and unlink it */
|
/* Locate the cloned class and unlink it */
|
||||||
PrevLink = &BaseClass->pclsClone;
|
PrevLink = &BaseClass->pclsClone;
|
||||||
CurrentClass = BaseClass->pclsClone;
|
CurrentClass = BaseClass->pclsClone;
|
||||||
while (CurrentClass != Class)
|
while (CurrentClass != Class)
|
||||||
|
@ -687,7 +687,7 @@ IntDereferenceClass(IN OUT PCLS Class,
|
||||||
ASSERT(Class->pclsBase == BaseClass);
|
ASSERT(Class->pclsBase == BaseClass);
|
||||||
ASSERT(Class->pclsClone == NULL);
|
ASSERT(Class->pclsClone == NULL);
|
||||||
|
|
||||||
/* the class was just a clone, we don't need it anymore */
|
/* The class was just a clone, we don't need it anymore */
|
||||||
IntDestroyClass(Class);
|
IntDestroyClass(Class);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -707,7 +707,7 @@ IntMoveClassToSharedHeap(IN OUT PCLS Class,
|
||||||
|
|
||||||
ClassSize = sizeof(*Class) + (SIZE_T)Class->cbclsExtra;
|
ClassSize = sizeof(*Class) + (SIZE_T)Class->cbclsExtra;
|
||||||
|
|
||||||
/* allocate the new base class on the shared heap */
|
/* Allocate the new base class on the shared heap */
|
||||||
NewClass = UserHeapAlloc(ClassSize);
|
NewClass = UserHeapAlloc(ClassSize);
|
||||||
if (NewClass != NULL)
|
if (NewClass != NULL)
|
||||||
{
|
{
|
||||||
|
@ -718,12 +718,12 @@ IntMoveClassToSharedHeap(IN OUT PCLS Class,
|
||||||
NewClass->rpdeskParent = NULL;
|
NewClass->rpdeskParent = NULL;
|
||||||
NewClass->pclsBase = NewClass;
|
NewClass->pclsBase = NewClass;
|
||||||
|
|
||||||
/* replace the class in the list */
|
/* Replace the class in the list */
|
||||||
(void)InterlockedExchangePointer((PVOID*)*ClassLinkPtr,
|
(void)InterlockedExchangePointer((PVOID*)*ClassLinkPtr,
|
||||||
NewClass);
|
NewClass);
|
||||||
*ClassLinkPtr = &NewClass->pclsNext;
|
*ClassLinkPtr = &NewClass->pclsNext;
|
||||||
|
|
||||||
/* free the obsolete class on the desktop heap */
|
/* Free the obsolete class on the desktop heap */
|
||||||
Class->pclsBase = NULL;
|
Class->pclsBase = NULL;
|
||||||
IntDestroyClass(Class);
|
IntDestroyClass(Class);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
@ -760,14 +760,14 @@ IntCheckDesktopClasses(IN PDESKTOP Desktop,
|
||||||
if (Class->rpdeskParent == Desktop &&
|
if (Class->rpdeskParent == Desktop &&
|
||||||
Class->cWndReferenceCount == 0)
|
Class->cWndReferenceCount == 0)
|
||||||
{
|
{
|
||||||
/* there shouldn't be any clones around anymore! */
|
/* There shouldn't be any clones around anymore! */
|
||||||
ASSERT(Class->pclsClone == NULL);
|
ASSERT(Class->pclsClone == NULL);
|
||||||
|
|
||||||
/* FIXME - If process is terminating, don't move the class but rather destroy it! */
|
/* FIXME: If process is terminating, don't move the class but rather destroy it! */
|
||||||
/* FIXME - We could move the class to another desktop heap if there's still desktops
|
/* FIXME: We could move the class to another desktop heap if there's still desktops
|
||||||
mapped into the process... */
|
mapped into the process... */
|
||||||
|
|
||||||
/* move the class to the shared heap */
|
/* Move the class to the shared heap */
|
||||||
if (IntMoveClassToSharedHeap(Class,
|
if (IntMoveClassToSharedHeap(Class,
|
||||||
&Link))
|
&Link))
|
||||||
{
|
{
|
||||||
|
@ -779,11 +779,11 @@ IntCheckDesktopClasses(IN PDESKTOP Desktop,
|
||||||
|
|
||||||
if (FreeOnFailure)
|
if (FreeOnFailure)
|
||||||
{
|
{
|
||||||
/* unlink the base class */
|
/* Unlink the base class */
|
||||||
(void)InterlockedExchangePointer((PVOID*)Link,
|
(void)InterlockedExchangePointer((PVOID*)Link,
|
||||||
Class->pclsNext);
|
Class->pclsNext);
|
||||||
|
|
||||||
/* we can free the old base class now */
|
/* We can free the old base class now */
|
||||||
Class->pclsBase = NULL;
|
Class->pclsBase = NULL;
|
||||||
IntDestroyClass(Class);
|
IntDestroyClass(Class);
|
||||||
}
|
}
|
||||||
|
@ -810,13 +810,13 @@ IntCheckProcessDesktopClasses(IN PDESKTOP Desktop,
|
||||||
|
|
||||||
pi = GetW32ProcessInfo();
|
pi = GetW32ProcessInfo();
|
||||||
|
|
||||||
/* check all local classes */
|
/* Check all local classes */
|
||||||
IntCheckDesktopClasses(Desktop,
|
IntCheckDesktopClasses(Desktop,
|
||||||
&pi->pclsPrivateList,
|
&pi->pclsPrivateList,
|
||||||
FreeOnFailure,
|
FreeOnFailure,
|
||||||
&Ret);
|
&Ret);
|
||||||
|
|
||||||
/* check all global classes */
|
/* Check all global classes */
|
||||||
IntCheckDesktopClasses(Desktop,
|
IntCheckDesktopClasses(Desktop,
|
||||||
&pi->pclsPublicList,
|
&pi->pclsPublicList,
|
||||||
FreeOnFailure,
|
FreeOnFailure,
|
||||||
|
@ -873,7 +873,7 @@ IntCreateClass(IN CONST WNDCLASSEXW* lpwcx,
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* FIXME - the class was created before being connected
|
/* FIXME: The class was created before being connected
|
||||||
to a desktop. It is possible for the desktop window,
|
to a desktop. It is possible for the desktop window,
|
||||||
but should it be allowed for any other case? */
|
but should it be allowed for any other case? */
|
||||||
Class = UserHeapAlloc(ClassSize);
|
Class = UserHeapAlloc(ClassSize);
|
||||||
|
@ -900,7 +900,7 @@ IntCreateClass(IN CONST WNDCLASSEXW* lpwcx,
|
||||||
{
|
{
|
||||||
PWSTR pszMenuNameBuffer = pszMenuName;
|
PWSTR pszMenuNameBuffer = pszMenuName;
|
||||||
|
|
||||||
/* need to protect with SEH since accessing the WNDCLASSEX structure
|
/* Need to protect with SEH since accessing the WNDCLASSEX structure
|
||||||
and string buffers might raise an exception! We don't want to
|
and string buffers might raise an exception! We don't want to
|
||||||
leak memory... */
|
leak memory... */
|
||||||
// What?! If the user interface was written correctly this would not be an issue!
|
// What?! If the user interface was written correctly this would not be an issue!
|
||||||
|
@ -914,7 +914,7 @@ IntCreateClass(IN CONST WNDCLASSEXW* lpwcx,
|
||||||
Class->hCursor = lpwcx->hCursor; /* FIXME */
|
Class->hCursor = lpwcx->hCursor; /* FIXME */
|
||||||
Class->hbrBackground = lpwcx->hbrBackground;
|
Class->hbrBackground = lpwcx->hbrBackground;
|
||||||
|
|
||||||
/* make a copy of the string */
|
/* Make a copy of the string */
|
||||||
if (pszMenuNameBuffer != NULL)
|
if (pszMenuNameBuffer != NULL)
|
||||||
{
|
{
|
||||||
Class->MenuNameIsString = TRUE;
|
Class->MenuNameIsString = TRUE;
|
||||||
|
@ -930,7 +930,7 @@ IntCreateClass(IN CONST WNDCLASSEXW* lpwcx,
|
||||||
else
|
else
|
||||||
Class->lpszClientUnicodeMenuName = MenuName->Buffer;
|
Class->lpszClientUnicodeMenuName = MenuName->Buffer;
|
||||||
|
|
||||||
/* save an ansi copy of the string */
|
/* Save an ANSI copy of the string */
|
||||||
if (pszMenuNameBuffer != NULL)
|
if (pszMenuNameBuffer != NULL)
|
||||||
{
|
{
|
||||||
ANSI_STRING AnsiString;
|
ANSI_STRING AnsiString;
|
||||||
|
@ -945,7 +945,7 @@ IntCreateClass(IN CONST WNDCLASSEXW* lpwcx,
|
||||||
{
|
{
|
||||||
ERR("Failed to convert unicode menu name to ansi!\n");
|
ERR("Failed to convert unicode menu name to ansi!\n");
|
||||||
|
|
||||||
/* life would've been much prettier if ntoskrnl exported RtlRaiseStatus()... */
|
/* Life would've been much prettier if ntoskrnl exported RtlRaiseStatus()... */
|
||||||
_SEH2_LEAVE;
|
_SEH2_LEAVE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -953,8 +953,8 @@ IntCreateClass(IN CONST WNDCLASSEXW* lpwcx,
|
||||||
Class->lpszClientAnsiMenuName = (PSTR)MenuName->Buffer;
|
Class->lpszClientAnsiMenuName = (PSTR)MenuName->Buffer;
|
||||||
|
|
||||||
/* Save kernel use menu name and ansi class name */
|
/* Save kernel use menu name and ansi class name */
|
||||||
Class->lpszMenuName = Class->lpszClientUnicodeMenuName; // Fixme!
|
Class->lpszMenuName = Class->lpszClientUnicodeMenuName; // FIXME!
|
||||||
//Class->lpszAnsiClassName = Fixme!
|
//Class->lpszAnsiClassName = FIXME
|
||||||
|
|
||||||
/* Server Side overrides class calling type (A/W)!
|
/* Server Side overrides class calling type (A/W)!
|
||||||
User32 whine test_builtinproc: "deftest"
|
User32 whine test_builtinproc: "deftest"
|
||||||
|
@ -968,7 +968,7 @@ IntCreateClass(IN CONST WNDCLASSEXW* lpwcx,
|
||||||
for match. This method will be used in related code.
|
for match. This method will be used in related code.
|
||||||
*/
|
*/
|
||||||
for ( i = FNID_FIRST; i <= FNID_SWITCH; i++)
|
for ( i = FNID_FIRST; i <= FNID_SWITCH; i++)
|
||||||
{ // Open Ansi or Unicode, just match, set and break.
|
{ // Open ANSI or Unicode, just match, set and break.
|
||||||
if (GETPFNCLIENTW(i) == Class->lpfnWndProc)
|
if (GETPFNCLIENTW(i) == Class->lpfnWndProc)
|
||||||
{
|
{
|
||||||
WndProc = GETPFNSERVER(i);
|
WndProc = GETPFNSERVER(i);
|
||||||
|
@ -1080,7 +1080,7 @@ IntGetAtomFromStringOrAtom(IN PUNICODE_STRING ClassName,
|
||||||
|
|
||||||
if (ClassName->Length != 0)
|
if (ClassName->Length != 0)
|
||||||
{
|
{
|
||||||
/* FIXME - Don't limit to 64 characters! use SEH when allocating memory! */
|
/* FIXME: Don't limit to 64 characters! use SEH when allocating memory! */
|
||||||
if (ClassName->Length / sizeof(WCHAR) >= sizeof(szBuf) / sizeof(szBuf[0]))
|
if (ClassName->Length / sizeof(WCHAR) >= sizeof(szBuf) / sizeof(szBuf[0]))
|
||||||
{
|
{
|
||||||
EngSetLastError(ERROR_INVALID_PARAMETER);
|
EngSetLastError(ERROR_INVALID_PARAMETER);
|
||||||
|
@ -1100,7 +1100,7 @@ IntGetAtomFromStringOrAtom(IN PUNICODE_STRING ClassName,
|
||||||
else
|
else
|
||||||
AtomName = ClassName->Buffer;
|
AtomName = ClassName->Buffer;
|
||||||
|
|
||||||
/* lookup the atom */
|
/* Lookup the atom */
|
||||||
Status = RtlLookupAtomInAtomTable(gAtomTable,
|
Status = RtlLookupAtomInAtomTable(gAtomTable,
|
||||||
AtomName,
|
AtomName,
|
||||||
Atom);
|
Atom);
|
||||||
|
@ -1147,11 +1147,11 @@ IntGetClassAtom(IN PUNICODE_STRING ClassName,
|
||||||
{
|
{
|
||||||
PCLS Class;
|
PCLS Class;
|
||||||
|
|
||||||
/* attempt to locate the class object */
|
/* Attempt to locate the class object */
|
||||||
|
|
||||||
ASSERT(pi != NULL);
|
ASSERT(pi != NULL);
|
||||||
|
|
||||||
/* Step 1: try to find an exact match of locally registered classes */
|
/* Step 1: Try to find an exact match of locally registered classes */
|
||||||
Class = IntFindClass(Atom,
|
Class = IntFindClass(Atom,
|
||||||
hInstance,
|
hInstance,
|
||||||
&pi->pclsPrivateList,
|
&pi->pclsPrivateList,
|
||||||
|
@ -1161,7 +1161,7 @@ IntGetClassAtom(IN PUNICODE_STRING ClassName,
|
||||||
goto FoundClass;
|
goto FoundClass;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Step 2: try to find any globally registered class. The hInstance
|
/* Step 2: Try to find any globally registered class. The hInstance
|
||||||
is not relevant for global classes */
|
is not relevant for global classes */
|
||||||
Class = IntFindClass(Atom,
|
Class = IntFindClass(Atom,
|
||||||
NULL,
|
NULL,
|
||||||
|
@ -1172,7 +1172,7 @@ IntGetClassAtom(IN PUNICODE_STRING ClassName,
|
||||||
goto FoundClass;
|
goto FoundClass;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Step 3: try to find any local class registered by user32 */
|
/* Step 3: Try to find any local class registered by user32 */
|
||||||
Class = IntFindClass(Atom,
|
Class = IntFindClass(Atom,
|
||||||
hModClient,
|
hModClient,
|
||||||
&pi->pclsPrivateList,
|
&pi->pclsPrivateList,
|
||||||
|
@ -1182,7 +1182,7 @@ IntGetClassAtom(IN PUNICODE_STRING ClassName,
|
||||||
goto FoundClass;
|
goto FoundClass;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Step 4: try to find any global class registered by user32 */
|
/* Step 4: Try to find any global class registered by user32 */
|
||||||
Class = IntFindClass(Atom,
|
Class = IntFindClass(Atom,
|
||||||
hModClient,
|
hModClient,
|
||||||
&pi->pclsPublicList,
|
&pi->pclsPublicList,
|
||||||
|
@ -1283,7 +1283,7 @@ UserRegisterClass(IN CONST WNDCLASSEXW* lpwcx,
|
||||||
|
|
||||||
if (Class != NULL && !Class->Global)
|
if (Class != NULL && !Class->Global)
|
||||||
{
|
{
|
||||||
// local class already exists
|
// Local class already exists
|
||||||
TRACE("Local Class 0x%p does already exist!\n", ClassAtom);
|
TRACE("Local Class 0x%p does already exist!\n", ClassAtom);
|
||||||
EngSetLastError(ERROR_CLASS_ALREADY_EXISTS);
|
EngSetLastError(ERROR_CLASS_ALREADY_EXISTS);
|
||||||
return (RTL_ATOM)0;
|
return (RTL_ATOM)0;
|
||||||
|
@ -1373,17 +1373,17 @@ UserUnregisterClass(IN PUNICODE_STRING ClassName,
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* must be a base class! */
|
/* Must be a base class! */
|
||||||
ASSERT(Class->pclsBase == Class);
|
ASSERT(Class->pclsBase == Class);
|
||||||
|
|
||||||
/* unlink the class */
|
/* Unlink the class */
|
||||||
*Link = Class->pclsNext;
|
*Link = Class->pclsNext;
|
||||||
|
|
||||||
if (NT_SUCCESS(IntDeregisterClassAtom(Class->atomClassName)))
|
if (NT_SUCCESS(IntDeregisterClassAtom(Class->atomClassName)))
|
||||||
{
|
{
|
||||||
TRACE("Class 0x%x\n", Class);
|
TRACE("Class 0x%x\n", Class);
|
||||||
TRACE("UserUnregisterClass: Good Exit!\n");
|
TRACE("UserUnregisterClass: Good Exit!\n");
|
||||||
/* finally free the resources */
|
/* Finally free the resources */
|
||||||
IntDestroyClass(Class);
|
IntDestroyClass(Class);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
@ -1412,14 +1412,14 @@ UserGetClassName(IN PCLS Class,
|
||||||
PANSI_STRING AnsiClassName = (PANSI_STRING)ClassName;
|
PANSI_STRING AnsiClassName = (PANSI_STRING)ClassName;
|
||||||
UNICODE_STRING UnicodeClassName;
|
UNICODE_STRING UnicodeClassName;
|
||||||
|
|
||||||
/* limit the size of the static buffer on the stack to the
|
/* Limit the size of the static buffer on the stack to the
|
||||||
size of the buffer provided by the caller */
|
size of the buffer provided by the caller */
|
||||||
if (BufLen / sizeof(WCHAR) > AnsiClassName->MaximumLength)
|
if (BufLen / sizeof(WCHAR) > AnsiClassName->MaximumLength)
|
||||||
{
|
{
|
||||||
BufLen = AnsiClassName->MaximumLength * sizeof(WCHAR);
|
BufLen = AnsiClassName->MaximumLength * sizeof(WCHAR);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* find out how big the buffer needs to be */
|
/* Find out how big the buffer needs to be */
|
||||||
Status = RtlQueryAtomInAtomTable(gAtomTable,
|
Status = RtlQueryAtomInAtomTable(gAtomTable,
|
||||||
Class->atomClassName,
|
Class->atomClassName,
|
||||||
NULL,
|
NULL,
|
||||||
|
@ -1430,13 +1430,13 @@ UserGetClassName(IN PCLS Class,
|
||||||
{
|
{
|
||||||
if (BufLen / sizeof(WCHAR) > AnsiClassName->MaximumLength)
|
if (BufLen / sizeof(WCHAR) > AnsiClassName->MaximumLength)
|
||||||
{
|
{
|
||||||
/* the buffer required exceeds the ansi buffer provided,
|
/* The buffer required exceeds the ansi buffer provided,
|
||||||
pretend like we're using the ansi buffer and limit the
|
pretend like we're using the ansi buffer and limit the
|
||||||
size to the buffer size provided */
|
size to the buffer size provided */
|
||||||
BufLen = AnsiClassName->MaximumLength * sizeof(WCHAR);
|
BufLen = AnsiClassName->MaximumLength * sizeof(WCHAR);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* allocate a temporary buffer that can hold the unicode class name */
|
/* Allocate a temporary buffer that can hold the unicode class name */
|
||||||
szTemp = ExAllocatePoolWithTag(PagedPool,
|
szTemp = ExAllocatePoolWithTag(PagedPool,
|
||||||
BufLen,
|
BufLen,
|
||||||
USERTAG_CLASS);
|
USERTAG_CLASS);
|
||||||
|
@ -1446,7 +1446,7 @@ UserGetClassName(IN PCLS Class,
|
||||||
_SEH2_LEAVE;
|
_SEH2_LEAVE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* query the class name */
|
/* Query the class name */
|
||||||
Status = RtlQueryAtomInAtomTable(gAtomTable,
|
Status = RtlQueryAtomInAtomTable(gAtomTable,
|
||||||
Atom ? Atom : Class->atomClassName,
|
Atom ? Atom : Class->atomClassName,
|
||||||
NULL,
|
NULL,
|
||||||
|
@ -1459,7 +1459,7 @@ UserGetClassName(IN PCLS Class,
|
||||||
|
|
||||||
if (NT_SUCCESS(Status))
|
if (NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
/* convert the atom name to ansi */
|
/* Convert the atom name to ansi */
|
||||||
|
|
||||||
RtlInitUnicodeString(&UnicodeClassName,
|
RtlInitUnicodeString(&UnicodeClassName,
|
||||||
szTemp);
|
szTemp);
|
||||||
|
@ -1476,11 +1476,11 @@ UserGetClassName(IN PCLS Class,
|
||||||
|
|
||||||
Ret = BufLen / sizeof(WCHAR);
|
Ret = BufLen / sizeof(WCHAR);
|
||||||
}
|
}
|
||||||
else /* !Ansi */
|
else /* !ANSI */
|
||||||
{
|
{
|
||||||
BufLen = ClassName->MaximumLength;
|
BufLen = ClassName->MaximumLength;
|
||||||
|
|
||||||
/* query the atom name */
|
/* Query the atom name */
|
||||||
Status = RtlQueryAtomInAtomTable(gAtomTable,
|
Status = RtlQueryAtomInAtomTable(gAtomTable,
|
||||||
Atom ? Atom : Class->atomClassName,
|
Atom ? Atom : Class->atomClassName,
|
||||||
NULL,
|
NULL,
|
||||||
|
@ -1517,7 +1517,7 @@ IntSetClassMenuName(IN PCLS Class,
|
||||||
{
|
{
|
||||||
BOOL Ret = FALSE;
|
BOOL Ret = FALSE;
|
||||||
|
|
||||||
/* change the base class first */
|
/* Change the base class first */
|
||||||
Class = Class->pclsBase;
|
Class = Class->pclsBase;
|
||||||
|
|
||||||
if (MenuName->Length != 0)
|
if (MenuName->Length != 0)
|
||||||
|
@ -1535,13 +1535,13 @@ IntSetClassMenuName(IN PCLS Class,
|
||||||
{
|
{
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
|
|
||||||
/* copy the unicode string */
|
/* Copy the unicode string */
|
||||||
RtlCopyMemory(strBufW,
|
RtlCopyMemory(strBufW,
|
||||||
MenuName->Buffer,
|
MenuName->Buffer,
|
||||||
MenuName->Length);
|
MenuName->Length);
|
||||||
strBufW[MenuName->Length / sizeof(WCHAR)] = UNICODE_NULL;
|
strBufW[MenuName->Length / sizeof(WCHAR)] = UNICODE_NULL;
|
||||||
|
|
||||||
/* create an ansi copy of the string */
|
/* Create an ANSI copy of the string */
|
||||||
AnsiString.Buffer = (PSTR)(strBufW + (MenuName->Length / sizeof(WCHAR)) + 1);
|
AnsiString.Buffer = (PSTR)(strBufW + (MenuName->Length / sizeof(WCHAR)) + 1);
|
||||||
Status = RtlUnicodeStringToAnsiString(&AnsiString,
|
Status = RtlUnicodeStringToAnsiString(&AnsiString,
|
||||||
MenuName,
|
MenuName,
|
||||||
|
@ -1562,13 +1562,13 @@ IntSetClassMenuName(IN PCLS Class,
|
||||||
|
|
||||||
if (Ret)
|
if (Ret)
|
||||||
{
|
{
|
||||||
/* update the base class */
|
/* Update the base class */
|
||||||
IntFreeClassMenuName(Class);
|
IntFreeClassMenuName(Class);
|
||||||
Class->lpszClientUnicodeMenuName = strBufW;
|
Class->lpszClientUnicodeMenuName = strBufW;
|
||||||
Class->lpszClientAnsiMenuName = AnsiString.Buffer;
|
Class->lpszClientAnsiMenuName = AnsiString.Buffer;
|
||||||
Class->MenuNameIsString = TRUE;
|
Class->MenuNameIsString = TRUE;
|
||||||
|
|
||||||
/* update the clones */
|
/* Update the clones */
|
||||||
Class = Class->pclsClone;
|
Class = Class->pclsClone;
|
||||||
while (Class != NULL)
|
while (Class != NULL)
|
||||||
{
|
{
|
||||||
|
@ -1592,13 +1592,13 @@ IntSetClassMenuName(IN PCLS Class,
|
||||||
{
|
{
|
||||||
ASSERT(IS_INTRESOURCE(MenuName->Buffer));
|
ASSERT(IS_INTRESOURCE(MenuName->Buffer));
|
||||||
|
|
||||||
/* update the base class */
|
/* Update the base class */
|
||||||
IntFreeClassMenuName(Class);
|
IntFreeClassMenuName(Class);
|
||||||
Class->lpszClientUnicodeMenuName = MenuName->Buffer;
|
Class->lpszClientUnicodeMenuName = MenuName->Buffer;
|
||||||
Class->lpszClientAnsiMenuName = (PSTR)MenuName->Buffer;
|
Class->lpszClientAnsiMenuName = (PSTR)MenuName->Buffer;
|
||||||
Class->MenuNameIsString = FALSE;
|
Class->MenuNameIsString = FALSE;
|
||||||
|
|
||||||
/* update the clones */
|
/* Update the clones */
|
||||||
Class = Class->pclsClone;
|
Class = Class->pclsClone;
|
||||||
while (Class != NULL)
|
while (Class != NULL)
|
||||||
{
|
{
|
||||||
|
@ -1625,7 +1625,7 @@ UserSetClassLongPtr(IN PCLS Class,
|
||||||
|
|
||||||
/* NOTE: For GCLP_MENUNAME and GCW_ATOM this function may raise an exception! */
|
/* NOTE: For GCLP_MENUNAME and GCW_ATOM this function may raise an exception! */
|
||||||
|
|
||||||
/* change the information in the base class first, then update the clones */
|
/* Change the information in the base class first, then update the clones */
|
||||||
Class = Class->pclsBase;
|
Class = Class->pclsBase;
|
||||||
|
|
||||||
if (Index >= 0)
|
if (Index >= 0)
|
||||||
|
@ -1643,13 +1643,13 @@ UserSetClassLongPtr(IN PCLS Class,
|
||||||
|
|
||||||
Data = (PULONG_PTR)((ULONG_PTR)(Class + 1) + Index);
|
Data = (PULONG_PTR)((ULONG_PTR)(Class + 1) + Index);
|
||||||
|
|
||||||
/* FIXME - Data might be a unaligned pointer! Might be a problem on
|
/* FIXME: Data might be a unaligned pointer! Might be a problem on
|
||||||
certain architectures, maybe using RtlCopyMemory is a
|
certain architectures, maybe using RtlCopyMemory is a
|
||||||
better choice for those architectures! */
|
better choice for those architectures! */
|
||||||
Ret = *Data;
|
Ret = *Data;
|
||||||
*Data = NewLong;
|
*Data = NewLong;
|
||||||
|
|
||||||
/* update the clones */
|
/* Update the clones */
|
||||||
Class = Class->pclsClone;
|
Class = Class->pclsClone;
|
||||||
while (Class != NULL)
|
while (Class != NULL)
|
||||||
{
|
{
|
||||||
|
@ -1666,7 +1666,7 @@ UserSetClassLongPtr(IN PCLS Class,
|
||||||
Ret = (ULONG_PTR)Class->cbwndExtra;
|
Ret = (ULONG_PTR)Class->cbwndExtra;
|
||||||
Class->cbwndExtra = (INT)NewLong;
|
Class->cbwndExtra = (INT)NewLong;
|
||||||
|
|
||||||
/* update the clones */
|
/* Update the clones */
|
||||||
Class = Class->pclsClone;
|
Class = Class->pclsClone;
|
||||||
while (Class != NULL)
|
while (Class != NULL)
|
||||||
{
|
{
|
||||||
|
@ -1684,7 +1684,7 @@ UserSetClassLongPtr(IN PCLS Class,
|
||||||
Ret = (ULONG_PTR)Class->hbrBackground;
|
Ret = (ULONG_PTR)Class->hbrBackground;
|
||||||
Class->hbrBackground = (HBRUSH)NewLong;
|
Class->hbrBackground = (HBRUSH)NewLong;
|
||||||
|
|
||||||
/* update the clones */
|
/* Update the clones */
|
||||||
Class = Class->pclsClone;
|
Class = Class->pclsClone;
|
||||||
while (Class != NULL)
|
while (Class != NULL)
|
||||||
{
|
{
|
||||||
|
@ -1694,11 +1694,11 @@ UserSetClassLongPtr(IN PCLS Class,
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case GCLP_HCURSOR:
|
case GCLP_HCURSOR:
|
||||||
/* FIXME - get handle from pointer to CURSOR object */
|
/* FIXME: Get handle from pointer to CURSOR object */
|
||||||
Ret = (ULONG_PTR)Class->hCursor;
|
Ret = (ULONG_PTR)Class->hCursor;
|
||||||
Class->hCursor = (HANDLE)NewLong;
|
Class->hCursor = (HANDLE)NewLong;
|
||||||
|
|
||||||
/* update the clones */
|
/* Update the clones */
|
||||||
Class = Class->pclsClone;
|
Class = Class->pclsClone;
|
||||||
while (Class != NULL)
|
while (Class != NULL)
|
||||||
{
|
{
|
||||||
|
@ -1708,11 +1708,11 @@ UserSetClassLongPtr(IN PCLS Class,
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case GCLP_HICON:
|
case GCLP_HICON:
|
||||||
/* FIXME - get handle from pointer to ICON object */
|
/* FIXME: Get handle from pointer to ICON object */
|
||||||
Ret = (ULONG_PTR)Class->hIcon;
|
Ret = (ULONG_PTR)Class->hIcon;
|
||||||
Class->hIcon = (HANDLE)NewLong;
|
Class->hIcon = (HANDLE)NewLong;
|
||||||
|
|
||||||
/* update the clones */
|
/* Update the clones */
|
||||||
Class = Class->pclsClone;
|
Class = Class->pclsClone;
|
||||||
while (Class != NULL)
|
while (Class != NULL)
|
||||||
{
|
{
|
||||||
|
@ -1722,11 +1722,11 @@ UserSetClassLongPtr(IN PCLS Class,
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case GCLP_HICONSM:
|
case GCLP_HICONSM:
|
||||||
/* FIXME - get handle from pointer to ICON object */
|
/* FIXME: Get handle from pointer to ICON object */
|
||||||
Ret = (ULONG_PTR)Class->hIconSm;
|
Ret = (ULONG_PTR)Class->hIconSm;
|
||||||
Class->hIconSm = (HANDLE)NewLong;
|
Class->hIconSm = (HANDLE)NewLong;
|
||||||
|
|
||||||
/* update the clones */
|
/* Update the clones */
|
||||||
Class = Class->pclsClone;
|
Class = Class->pclsClone;
|
||||||
while (Class != NULL)
|
while (Class != NULL)
|
||||||
{
|
{
|
||||||
|
@ -1739,7 +1739,7 @@ UserSetClassLongPtr(IN PCLS Class,
|
||||||
Ret = (ULONG_PTR)Class->hModule;
|
Ret = (ULONG_PTR)Class->hModule;
|
||||||
Class->hModule = (HINSTANCE)NewLong;
|
Class->hModule = (HINSTANCE)NewLong;
|
||||||
|
|
||||||
/* update the clones */
|
/* Update the clones */
|
||||||
Class = Class->pclsClone;
|
Class = Class->pclsClone;
|
||||||
while (Class != NULL)
|
while (Class != NULL)
|
||||||
{
|
{
|
||||||
|
@ -1758,7 +1758,7 @@ UserSetClassLongPtr(IN PCLS Class,
|
||||||
ERR("Setting the class menu name failed!\n");
|
ERR("Setting the class menu name failed!\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
/* FIXME - really return NULL? Wine does so... */
|
/* FIXME: Really return NULL? Wine does so... */
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1766,12 +1766,12 @@ UserSetClassLongPtr(IN PCLS Class,
|
||||||
Ret = (ULONG_PTR)Class->style;
|
Ret = (ULONG_PTR)Class->style;
|
||||||
Class->style = (UINT)NewLong;
|
Class->style = (UINT)NewLong;
|
||||||
|
|
||||||
/* FIXME - what if the CS_GLOBALCLASS style is changed? should we
|
/* FIXME: What if the CS_GLOBALCLASS style is changed? should we
|
||||||
move the class to the appropriate list? For now, we save
|
move the class to the appropriate list? For now, we save
|
||||||
the original value in Class->Global, so we can always
|
the original value in Class->Global, so we can always
|
||||||
locate the appropriate list */
|
locate the appropriate list */
|
||||||
|
|
||||||
/* update the clones */
|
/* Update the clones */
|
||||||
Class = Class->pclsClone;
|
Class = Class->pclsClone;
|
||||||
while (Class != NULL)
|
while (Class != NULL)
|
||||||
{
|
{
|
||||||
|
@ -1825,8 +1825,8 @@ UserGetClassInfo(IN PCLS Class,
|
||||||
|
|
||||||
lpwcx->cbClsExtra = Class->cbclsExtra;
|
lpwcx->cbClsExtra = Class->cbclsExtra;
|
||||||
lpwcx->cbWndExtra = Class->cbwndExtra;
|
lpwcx->cbWndExtra = Class->cbwndExtra;
|
||||||
lpwcx->hIcon = Class->hIcon; /* FIXME - get handle from pointer */
|
lpwcx->hIcon = Class->hIcon; /* FIXME: Get handle from pointer */
|
||||||
lpwcx->hCursor = Class->hCursor; /* FIXME - get handle from pointer */
|
lpwcx->hCursor = Class->hCursor; /* FIXME: Get handle from pointer */
|
||||||
lpwcx->hbrBackground = Class->hbrBackground;
|
lpwcx->hbrBackground = Class->hbrBackground;
|
||||||
|
|
||||||
/* Copy non-string to user first. */
|
/* Copy non-string to user first. */
|
||||||
|
@ -1835,9 +1835,9 @@ UserGetClassInfo(IN PCLS Class,
|
||||||
else
|
else
|
||||||
lpwcx->lpszMenuName = Class->lpszClientUnicodeMenuName;
|
lpwcx->lpszMenuName = Class->lpszClientUnicodeMenuName;
|
||||||
/*
|
/*
|
||||||
FIXME! CLSMENUNAME has the answers! Copy the already made buffers from there!
|
* FIXME: CLSMENUNAME has the answers! Copy the already made buffers from there!
|
||||||
Cls: lpszMenuName and lpszAnsiClassName should be used by kernel space.
|
* Cls: lpszMenuName and lpszAnsiClassName should be used by kernel space.
|
||||||
lpszClientXxxMenuName should already be mapped to user space.
|
* lpszClientXxxMenuName should already be mapped to user space.
|
||||||
*/
|
*/
|
||||||
/* Copy string ptr to user. */
|
/* Copy string ptr to user. */
|
||||||
if ( Class->lpszClientUnicodeMenuName != NULL &&
|
if ( Class->lpszClientUnicodeMenuName != NULL &&
|
||||||
|
@ -1853,16 +1853,16 @@ UserGetClassInfo(IN PCLS Class,
|
||||||
else
|
else
|
||||||
lpwcx->hInstance = hInstance;
|
lpwcx->hInstance = hInstance;
|
||||||
|
|
||||||
/* FIXME - return the string? Okay! This is performed in User32!*/
|
/* FIXME: Return the string? Okay! This is performed in User32! */
|
||||||
//lpwcx->lpszClassName = (LPCWSTR)((ULONG_PTR)Class->atomClassName);
|
//lpwcx->lpszClassName = (LPCWSTR)((ULONG_PTR)Class->atomClassName);
|
||||||
|
|
||||||
lpwcx->hIconSm = Class->hIconSm; /* FIXME - get handle from pointer */
|
lpwcx->hIconSm = Class->hIconSm; /* FIXME: Get handle from pointer */
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
//
|
// ???
|
||||||
//
|
//
|
||||||
BOOL
|
BOOL
|
||||||
FASTCALL
|
FASTCALL
|
||||||
|
@ -2119,7 +2119,7 @@ NtUserSetClassLong(HWND hWnd,
|
||||||
{
|
{
|
||||||
UNICODE_STRING Value;
|
UNICODE_STRING Value;
|
||||||
|
|
||||||
/* probe the parameters */
|
/* Probe the parameters */
|
||||||
if (Offset == GCW_ATOM || Offset == GCLP_MENUNAME)
|
if (Offset == GCW_ATOM || Offset == GCLP_MENUNAME)
|
||||||
{
|
{
|
||||||
Value = ProbeForReadUnicodeString((PUNICODE_STRING)dwNewLong);
|
Value = ProbeForReadUnicodeString((PUNICODE_STRING)dwNewLong);
|
||||||
|
@ -2194,7 +2194,7 @@ NtUserUnregisterClass(IN PUNICODE_STRING ClassNameOrAtom,
|
||||||
|
|
||||||
_SEH2_TRY
|
_SEH2_TRY
|
||||||
{
|
{
|
||||||
/* probe the paramters */
|
/* Probe the paramters */
|
||||||
CapturedClassName = ProbeForReadUnicodeString(ClassNameOrAtom);
|
CapturedClassName = ProbeForReadUnicodeString(ClassNameOrAtom);
|
||||||
if (CapturedClassName.Length & 1)
|
if (CapturedClassName.Length & 1)
|
||||||
{
|
{
|
||||||
|
@ -2217,7 +2217,7 @@ InvalidParameter:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* unregister the class */
|
/* Unregister the class */
|
||||||
Ret = UserUnregisterClass(&CapturedClassName,
|
Ret = UserUnregisterClass(&CapturedClassName,
|
||||||
hInstance,
|
hInstance,
|
||||||
NULL); // Null for now~
|
NULL); // Null for now~
|
||||||
|
@ -2232,7 +2232,7 @@ InvalidParameter:
|
||||||
return Ret;
|
return Ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* NOTE: for system classes hInstance is not NULL here, but User32Instance */
|
/* NOTE: For system classes hInstance is not NULL here, but User32Instance */
|
||||||
BOOL APIENTRY
|
BOOL APIENTRY
|
||||||
NtUserGetClassInfo(
|
NtUserGetClassInfo(
|
||||||
HINSTANCE hInstance,
|
HINSTANCE hInstance,
|
||||||
|
@ -2248,7 +2248,7 @@ NtUserGetClassInfo(
|
||||||
PPROCESSINFO ppi;
|
PPROCESSINFO ppi;
|
||||||
BOOL Ret = TRUE;
|
BOOL Ret = TRUE;
|
||||||
|
|
||||||
/* NOTE: need exclusive lock because getting the wndproc might require the
|
/* NOTE: Need exclusive lock because getting the wndproc might require the
|
||||||
creation of a call procedure handle */
|
creation of a call procedure handle */
|
||||||
UserEnterExclusive();
|
UserEnterExclusive();
|
||||||
|
|
||||||
|
@ -2261,7 +2261,7 @@ NtUserGetClassInfo(
|
||||||
|
|
||||||
_SEH2_TRY
|
_SEH2_TRY
|
||||||
{
|
{
|
||||||
/* probe the paramters */
|
/* Probe the paramters */
|
||||||
CapturedClassName = ProbeForReadUnicodeString(ClassName);
|
CapturedClassName = ProbeForReadUnicodeString(ClassName);
|
||||||
|
|
||||||
if (CapturedClassName.Length == 0)
|
if (CapturedClassName.Length == 0)
|
||||||
|
@ -2403,7 +2403,7 @@ NtUserGetClassName (IN HWND hWnd,
|
||||||
ProbeForWriteUnicodeString(ClassName);
|
ProbeForWriteUnicodeString(ClassName);
|
||||||
CapturedClassName = *ClassName;
|
CapturedClassName = *ClassName;
|
||||||
|
|
||||||
/* get the class name */
|
/* Get the class name */
|
||||||
Ret = UserGetClassName(Window->pcls,
|
Ret = UserGetClassName(Window->pcls,
|
||||||
&CapturedClassName,
|
&CapturedClassName,
|
||||||
Atom,
|
Atom,
|
||||||
|
@ -2411,7 +2411,7 @@ NtUserGetClassName (IN HWND hWnd,
|
||||||
|
|
||||||
if (Ret != 0)
|
if (Ret != 0)
|
||||||
{
|
{
|
||||||
/* update the Length field */
|
/* Update the Length field */
|
||||||
ClassName->Length = CapturedClassName.Length;
|
ClassName->Length = CapturedClassName.Length;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,7 +36,7 @@ IntGetWinStaForCbAccess()
|
||||||
return pWinStaObj;
|
return pWinStaObj;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* if format exists, returns a non zero value (pointing to formated object) */
|
/* If format exists, returns a non zero value (pointing to formated object) */
|
||||||
PCLIP static FASTCALL
|
PCLIP static FASTCALL
|
||||||
IntIsFormatAvailable(PWINSTATION_OBJECT pWinStaObj, UINT fmt)
|
IntIsFormatAvailable(PWINSTATION_OBJECT pWinStaObj, UINT fmt)
|
||||||
{
|
{
|
||||||
|
@ -68,7 +68,7 @@ IntFreeElementData(PCLIP pElement)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* adds a new format and data to the clipboard */
|
/* Adds a new format and data to the clipboard */
|
||||||
PCLIP static NTAPI
|
PCLIP static NTAPI
|
||||||
IntAddFormatedData(PWINSTATION_OBJECT pWinStaObj, UINT fmt, HANDLE hData, BOOLEAN fGlobalHandle, BOOL bEnd)
|
IntAddFormatedData(PWINSTATION_OBJECT pWinStaObj, UINT fmt, HANDLE hData, BOOLEAN fGlobalHandle, BOOL bEnd)
|
||||||
{
|
{
|
||||||
|
@ -124,7 +124,7 @@ IntAddFormatedData(PWINSTATION_OBJECT pWinStaObj, UINT fmt, HANDLE hData, BOOLEA
|
||||||
BOOL static FASTCALL
|
BOOL static FASTCALL
|
||||||
IntIsClipboardOpenByMe(PWINSTATION_OBJECT pWinSta)
|
IntIsClipboardOpenByMe(PWINSTATION_OBJECT pWinSta)
|
||||||
{
|
{
|
||||||
/* check if current thread has opened the clipboard */
|
/* Check if current thread has opened the clipboard */
|
||||||
if (pWinSta->ptiClipLock &&
|
if (pWinSta->ptiClipLock &&
|
||||||
pWinSta->ptiClipLock == PsGetCurrentThreadWin32Thread())
|
pWinSta->ptiClipLock == PsGetCurrentThreadWin32Thread())
|
||||||
{
|
{
|
||||||
|
@ -285,7 +285,7 @@ IntAddSynthesizedFormats(PWINSTATION_OBJECT pWinStaObj)
|
||||||
if (!pBmEl && pDibEl)
|
if (!pBmEl && pDibEl)
|
||||||
IntAddFormatedData(pWinStaObj, CF_BITMAP, DATA_SYNTH_KRNL, FALSE, TRUE);
|
IntAddFormatedData(pWinStaObj, CF_BITMAP, DATA_SYNTH_KRNL, FALSE, TRUE);
|
||||||
|
|
||||||
/* Note: we need to render the DIB or DIBV5 format as soon as possible
|
/* Note: We need to render the DIB or DIBV5 format as soon as possible
|
||||||
because pallette information may change */
|
because pallette information may change */
|
||||||
if (!pDibEl && pBmEl)
|
if (!pDibEl && pBmEl)
|
||||||
IntSynthesizeDib(pWinStaObj, pBmEl->hData);
|
IntSynthesizeDib(pWinStaObj, pBmEl->hData);
|
||||||
|
@ -319,19 +319,19 @@ UserClipboardFreeWindow(PWND pWindow)
|
||||||
if (!pWinStaObj)
|
if (!pWinStaObj)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/* check if clipboard is not locked by this window, if yes, unlock it */
|
/* Check if clipboard is not locked by this window, if yes, unlock it */
|
||||||
if (pWindow == pWinStaObj->spwndClipOpen)
|
if (pWindow == pWinStaObj->spwndClipOpen)
|
||||||
{
|
{
|
||||||
/* the window that opens the clipboard was destroyed */
|
/* The window that opens the clipboard was destroyed */
|
||||||
pWinStaObj->spwndClipOpen = NULL;
|
pWinStaObj->spwndClipOpen = NULL;
|
||||||
pWinStaObj->ptiClipLock = NULL;
|
pWinStaObj->ptiClipLock = NULL;
|
||||||
}
|
}
|
||||||
if (pWindow == pWinStaObj->spwndClipOwner)
|
if (pWindow == pWinStaObj->spwndClipOwner)
|
||||||
{
|
{
|
||||||
/* the owner window was destroyed */
|
/* The owner window was destroyed */
|
||||||
pWinStaObj->spwndClipOwner = NULL;
|
pWinStaObj->spwndClipOwner = NULL;
|
||||||
}
|
}
|
||||||
/* remove window from window chain */
|
/* Remove window from window chain */
|
||||||
if (pWindow == pWinStaObj->spwndClipViewer)
|
if (pWindow == pWinStaObj->spwndClipViewer)
|
||||||
pWinStaObj->spwndClipViewer = NULL;
|
pWinStaObj->spwndClipViewer = NULL;
|
||||||
|
|
||||||
|
@ -623,10 +623,10 @@ NtUserGetClipboardFormatName(UINT fmt, LPWSTR lpszFormatName, INT cchMaxCount)
|
||||||
|
|
||||||
UserEnterShared();
|
UserEnterShared();
|
||||||
|
|
||||||
/* if the format is built-in we fail */
|
/* If the format is built-in we fail */
|
||||||
if (fmt < 0xc000)
|
if (fmt < 0xc000)
|
||||||
{
|
{
|
||||||
/* registetrated formats are >= 0xc000 */
|
/* Registetrated formats are >= 0xc000 */
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -801,12 +801,12 @@ NtUserGetClipboardData(UINT fmt, PGETCLIPBDATA pgcd)
|
||||||
pElement = IntIsFormatAvailable(pWinStaObj, fmt);
|
pElement = IntIsFormatAvailable(pWinStaObj, fmt);
|
||||||
if (pElement && IS_DATA_DELAYED(pElement) && pWinStaObj->spwndClipOwner)
|
if (pElement && IS_DATA_DELAYED(pElement) && pWinStaObj->spwndClipOwner)
|
||||||
{
|
{
|
||||||
/* send WM_RENDERFORMAT message */
|
/* Send WM_RENDERFORMAT message */
|
||||||
pWinStaObj->fInDelayedRendering = TRUE;
|
pWinStaObj->fInDelayedRendering = TRUE;
|
||||||
co_IntSendMessage(pWinStaObj->spwndClipOwner->head.h, WM_RENDERFORMAT, (WPARAM)fmt, 0);
|
co_IntSendMessage(pWinStaObj->spwndClipOwner->head.h, WM_RENDERFORMAT, (WPARAM)fmt, 0);
|
||||||
pWinStaObj->fInDelayedRendering = FALSE;
|
pWinStaObj->fInDelayedRendering = FALSE;
|
||||||
|
|
||||||
/* data should be in clipboard now */
|
/* Data should be in clipboard now */
|
||||||
pElement = IntIsFormatAvailable(pWinStaObj, fmt);
|
pElement = IntIsFormatAvailable(pWinStaObj, fmt);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -816,7 +816,7 @@ NtUserGetClipboardData(UINT fmt, PGETCLIPBDATA pgcd)
|
||||||
|
|
||||||
if (IS_DATA_SYNTHESIZED(pElement))
|
if (IS_DATA_SYNTHESIZED(pElement))
|
||||||
{
|
{
|
||||||
/* Note: data is synthesized in usermode */
|
/* Note: Data is synthesized in usermode */
|
||||||
/* TODO: Add more formats */
|
/* TODO: Add more formats */
|
||||||
switch (fmt)
|
switch (fmt)
|
||||||
{
|
{
|
||||||
|
@ -920,7 +920,7 @@ UserSetClipboardData(UINT fmt, HANDLE hData, PSETCLIPBDATA scd)
|
||||||
pWinStaObj->iClipSequenceNumber++;
|
pWinStaObj->iClipSequenceNumber++;
|
||||||
pWinStaObj->fClipboardChanged = TRUE;
|
pWinStaObj->fClipboardChanged = TRUE;
|
||||||
|
|
||||||
/* Note: synthesized formats are added in NtUserCloseClipboard */
|
/* Note: Synthesized formats are added in NtUserCloseClipboard */
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
/*
|
/*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS Win32k subsystem
|
||||||
* PURPOSE: Cursor and icon functions
|
* PURPOSE: Cursor and icon functions
|
||||||
* FILE: subsystem/win32/win32k/ntuser/cursoricon.c
|
* FILE: subsystems/win32/win32k/ntuser/cursoricon.c
|
||||||
* PROGRAMER: ReactOS Team
|
* PROGRAMER: ReactOS Team
|
||||||
*/
|
*/
|
||||||
/*
|
/*
|
||||||
|
@ -80,7 +80,7 @@ PCURICON_OBJECT FASTCALL UserGetCurIconObject(HCURSOR hCurIcon)
|
||||||
CurIcon = (PCURICON_OBJECT)UserReferenceObjectByHandle(hCurIcon, otCursorIcon);
|
CurIcon = (PCURICON_OBJECT)UserReferenceObjectByHandle(hCurIcon, otCursorIcon);
|
||||||
if (!CurIcon)
|
if (!CurIcon)
|
||||||
{
|
{
|
||||||
/* we never set ERROR_INVALID_ICON_HANDLE. lets hope noone ever checks for it */
|
/* We never set ERROR_INVALID_ICON_HANDLE. lets hope noone ever checks for it */
|
||||||
EngSetLastError(ERROR_INVALID_CURSOR_HANDLE);
|
EngSetLastError(ERROR_INVALID_CURSOR_HANDLE);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
@ -295,7 +295,7 @@ IntDestroyCurIconObject(PCURICON_OBJECT CurIcon, BOOL ProcessCleanup)
|
||||||
bmpMask = CurIcon->IconInfo.hbmMask;
|
bmpMask = CurIcon->IconInfo.hbmMask;
|
||||||
bmpColor = CurIcon->IconInfo.hbmColor;
|
bmpColor = CurIcon->IconInfo.hbmColor;
|
||||||
|
|
||||||
/* delete bitmaps */
|
/* Delete bitmaps */
|
||||||
if (bmpMask)
|
if (bmpMask)
|
||||||
{
|
{
|
||||||
GreSetObjectOwner(bmpMask, GDI_OBJ_HMGR_POWNED);
|
GreSetObjectOwner(bmpMask, GDI_OBJ_HMGR_POWNED);
|
||||||
|
@ -358,9 +358,9 @@ APIENTRY
|
||||||
NtUserGetIconInfo(
|
NtUserGetIconInfo(
|
||||||
HANDLE hCurIcon,
|
HANDLE hCurIcon,
|
||||||
PICONINFO IconInfo,
|
PICONINFO IconInfo,
|
||||||
PUNICODE_STRING lpInstName, // optional
|
PUNICODE_STRING lpInstName, // Optional
|
||||||
PUNICODE_STRING lpResName, // optional
|
PUNICODE_STRING lpResName, // Optional
|
||||||
LPDWORD pbpp, // optional
|
LPDWORD pbpp, // Optional
|
||||||
BOOL bInternal)
|
BOOL bInternal)
|
||||||
{
|
{
|
||||||
ICONINFO ii;
|
ICONINFO ii;
|
||||||
|
@ -473,7 +473,7 @@ NtUserGetIconSize(
|
||||||
if (NT_SUCCESS(Status))
|
if (NT_SUCCESS(Status))
|
||||||
bRet = TRUE;
|
bRet = TRUE;
|
||||||
else
|
else
|
||||||
SetLastNtError(Status); // maybe not, test this
|
SetLastNtError(Status); // Maybe not, test this
|
||||||
|
|
||||||
UserDereferenceObject(CurIcon);
|
UserDereferenceObject(CurIcon);
|
||||||
|
|
||||||
|
@ -547,7 +547,7 @@ APIENTRY
|
||||||
UserClipCursor(
|
UserClipCursor(
|
||||||
RECTL *prcl)
|
RECTL *prcl)
|
||||||
{
|
{
|
||||||
/* FIXME - check if process has WINSTA_WRITEATTRIBUTES */
|
/* FIXME: Check if process has WINSTA_WRITEATTRIBUTES */
|
||||||
PSYSTEM_CURSORINFO CurInfo;
|
PSYSTEM_CURSORINFO CurInfo;
|
||||||
PWND DesktopWindow = NULL;
|
PWND DesktopWindow = NULL;
|
||||||
|
|
||||||
|
@ -684,7 +684,7 @@ NtUserFindExistingCursorIcon(
|
||||||
{
|
{
|
||||||
Ret = CurIcon->Self;
|
Ret = CurIcon->Self;
|
||||||
|
|
||||||
// IntReleaseCurIconObject(CurIcon);//faxme: is this correct? does IntFindExistingCurIconObject add a ref?
|
// IntReleaseCurIconObject(CurIcon); // FIXME: Is this correct? Does IntFindExistingCurIconObject add a ref?
|
||||||
RETURN(Ret);
|
RETURN(Ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -706,7 +706,7 @@ APIENTRY
|
||||||
NtUserGetClipCursor(
|
NtUserGetClipCursor(
|
||||||
RECTL *lpRect)
|
RECTL *lpRect)
|
||||||
{
|
{
|
||||||
/* FIXME - check if process has WINSTA_READATTRIBUTES */
|
/* FIXME: Check if process has WINSTA_READATTRIBUTES */
|
||||||
PSYSTEM_CURSORINFO CurInfo;
|
PSYSTEM_CURSORINFO CurInfo;
|
||||||
RECTL Rect;
|
RECTL Rect;
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
|
@ -1157,8 +1157,8 @@ UserDrawIconEx(
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Set Background/foreground colors */
|
/* Set Background/foreground colors */
|
||||||
iOldTxtColor = IntGdiSetTextColor(hDc, 0); //black
|
iOldTxtColor = IntGdiSetTextColor(hDc, 0); // Black
|
||||||
iOldBkColor = IntGdiSetBkColor(hDc, 0x00FFFFFF); //white
|
iOldBkColor = IntGdiSetBkColor(hDc, 0x00FFFFFF); // White
|
||||||
|
|
||||||
if(bAlpha && (diFlags & DI_IMAGE))
|
if(bAlpha && (diFlags & DI_IMAGE))
|
||||||
{
|
{
|
||||||
|
@ -1183,7 +1183,7 @@ UserDrawIconEx(
|
||||||
goto CleanupAlpha;
|
goto CleanupAlpha;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* premultiply with the alpha channel value */
|
/* Premultiply with the alpha channel value */
|
||||||
for (i = 0; i < psurf->SurfObj.sizlBitmap.cy; i++)
|
for (i = 0; i < psurf->SurfObj.sizlBitmap.cy; i++)
|
||||||
{
|
{
|
||||||
ptr = (PBYTE)psurf->SurfObj.pvScan0 + i*psurf->SurfObj.lDelta;
|
ptr = (PBYTE)psurf->SurfObj.pvScan0 + i*psurf->SurfObj.lDelta;
|
||||||
|
@ -1350,3 +1350,4 @@ NtUserDrawIconEx(
|
||||||
return Ret;
|
return Ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* EOF */
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
/*
|
/*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS Win32k subsystem
|
||||||
* PURPOSE: Misc User funcs
|
* PURPOSE: Miscellaneous User functions
|
||||||
* FILE: subsystem/win32/win32k/ntuser/defwnd.c
|
* FILE: subsystems/win32/win32k/ntuser/defwnd.c
|
||||||
* PROGRAMER:
|
* PROGRAMER:
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -18,8 +18,8 @@ DBG_DEFAULT_CHANNEL(UserDefwnd);
|
||||||
#define MCSR_DONOTSHUTDOWN 3
|
#define MCSR_DONOTSHUTDOWN 3
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Based on CSRSS and described in pages 1115 - 1118 "Windows Internals, Fifth Edition".
|
* Based on CSRSS and described in pages 1115 - 1118 "Windows Internals, Fifth Edition".
|
||||||
Apparently CSRSS sends out messages to do this w/o going into win32k internals.
|
* Apparently CSRSS sends out messages to do this w/o going into win32k internals.
|
||||||
*/
|
*/
|
||||||
static
|
static
|
||||||
LRESULT FASTCALL
|
LRESULT FASTCALL
|
||||||
|
@ -392,7 +392,7 @@ GetNCHitEx(PWND pWnd, POINT pt)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Check maximize box */
|
/* Check maximize box */
|
||||||
/* In win95 there is automatically a Maximize button when there is a minimize one*/
|
/* In Win95 there is automatically a Maximize button when there is a minimize one */
|
||||||
if (min_or_max_box && !(ExStyle & WS_EX_TOOLWINDOW))
|
if (min_or_max_box && !(ExStyle & WS_EX_TOOLWINDOW))
|
||||||
{
|
{
|
||||||
rcWindow.left += UserGetSystemMetrics(SM_CXSIZE);
|
rcWindow.left += UserGetSystemMetrics(SM_CXSIZE);
|
||||||
|
@ -423,7 +423,7 @@ GetNCHitEx(PWND pWnd, POINT pt)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Check maximize box */
|
/* Check maximize box */
|
||||||
/* In win95 there is automatically a Maximize button when there is a minimize one*/
|
/* In Win95 there is automatically a Maximize button when there is a minimize one */
|
||||||
if (min_or_max_box && !(ExStyle & WS_EX_TOOLWINDOW))
|
if (min_or_max_box && !(ExStyle & WS_EX_TOOLWINDOW))
|
||||||
{
|
{
|
||||||
rcWindow.right -= UserGetSystemMetrics(SM_CXSIZE);
|
rcWindow.right -= UserGetSystemMetrics(SM_CXSIZE);
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS Win32k subsystem
|
||||||
* PURPOSE: Desktops
|
* PURPOSE: Desktops
|
||||||
* FILE: subsystems/win32/win32k/ntuser/desktop.c
|
* FILE: subsystems/win32/win32k/ntuser/desktop.c
|
||||||
* PROGRAMER: Casper S. Hornstrup (chorns@users.sourceforge.net)
|
* PROGRAMER: Casper S. Hornstrup (chorns@users.sourceforge.net)
|
||||||
|
@ -300,7 +300,7 @@ IntParseDesktopPath(PEPROCESS Process,
|
||||||
if(!WinStaPresent)
|
if(!WinStaPresent)
|
||||||
{
|
{
|
||||||
#if 0
|
#if 0
|
||||||
/* search the process handle table for (inherited) window station
|
/* Search the process handle table for (inherited) window station
|
||||||
handles, use a more appropriate one than WinSta0 if possible. */
|
handles, use a more appropriate one than WinSta0 if possible. */
|
||||||
if (!ObFindHandleForObject(Process,
|
if (!ObFindHandleForObject(Process,
|
||||||
NULL,
|
NULL,
|
||||||
|
@ -309,7 +309,7 @@ IntParseDesktopPath(PEPROCESS Process,
|
||||||
(PHANDLE)hWinSta))
|
(PHANDLE)hWinSta))
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
/* we had no luck searching for opened handles, use WinSta0 now */
|
/* We had no luck searching for opened handles, use WinSta0 now */
|
||||||
RtlInitUnicodeString(&WinSta, L"WinSta0");
|
RtlInitUnicodeString(&WinSta, L"WinSta0");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -317,7 +317,7 @@ IntParseDesktopPath(PEPROCESS Process,
|
||||||
if(!DesktopPresent && hDesktop != NULL)
|
if(!DesktopPresent && hDesktop != NULL)
|
||||||
{
|
{
|
||||||
#if 0
|
#if 0
|
||||||
/* search the process handle table for (inherited) desktop
|
/* Search the process handle table for (inherited) desktop
|
||||||
handles, use a more appropriate one than Default if possible. */
|
handles, use a more appropriate one than Default if possible. */
|
||||||
if (!ObFindHandleForObject(Process,
|
if (!ObFindHandleForObject(Process,
|
||||||
NULL,
|
NULL,
|
||||||
|
@ -326,7 +326,7 @@ IntParseDesktopPath(PEPROCESS Process,
|
||||||
(PHANDLE)hDesktop))
|
(PHANDLE)hDesktop))
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
/* we had no luck searching for opened handles, use Desktop now */
|
/* We had no luck searching for opened handles, use Desktop now */
|
||||||
RtlInitUnicodeString(&Desktop, L"Default");
|
RtlInitUnicodeString(&Desktop, L"Default");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -338,7 +338,7 @@ IntParseDesktopPath(PEPROCESS Process,
|
||||||
return STATUS_INSUFFICIENT_RESOURCES;
|
return STATUS_INSUFFICIENT_RESOURCES;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* open the window station */
|
/* Open the window station */
|
||||||
InitializeObjectAttributes(&ObjectAttributes,
|
InitializeObjectAttributes(&ObjectAttributes,
|
||||||
&FullName,
|
&FullName,
|
||||||
OBJ_CASE_INSENSITIVE,
|
OBJ_CASE_INSENSITIVE,
|
||||||
|
@ -372,7 +372,7 @@ IntParseDesktopPath(PEPROCESS Process,
|
||||||
return STATUS_INSUFFICIENT_RESOURCES;
|
return STATUS_INSUFFICIENT_RESOURCES;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* open the desktop object */
|
/* Open the desktop object */
|
||||||
InitializeObjectAttributes(&ObjectAttributes,
|
InitializeObjectAttributes(&ObjectAttributes,
|
||||||
&FullName,
|
&FullName,
|
||||||
OBJ_CASE_INSENSITIVE,
|
OBJ_CASE_INSENSITIVE,
|
||||||
|
@ -443,7 +443,7 @@ IntGetActiveDesktop(VOID)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* returns or creates a handle to the desktop object
|
* Returns or creates a handle to the desktop object
|
||||||
*/
|
*/
|
||||||
HDESK FASTCALL
|
HDESK FASTCALL
|
||||||
IntGetDesktopObjectHandle(PDESKTOP DesktopObject)
|
IntGetDesktopObjectHandle(PDESKTOP DesktopObject)
|
||||||
|
@ -468,7 +468,7 @@ IntGetDesktopObjectHandle(PDESKTOP DesktopObject)
|
||||||
(PHANDLE)&Ret);
|
(PHANDLE)&Ret);
|
||||||
if(!NT_SUCCESS(Status))
|
if(!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
/* unable to create a handle */
|
/* Unable to create a handle */
|
||||||
ERR("Unable to create a desktop handle\n");
|
ERR("Unable to create a desktop handle\n");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
@ -698,7 +698,7 @@ UserBuildShellHookHwndList(PDESKTOP Desktop)
|
||||||
PSHELL_HOOK_WINDOW Current;
|
PSHELL_HOOK_WINDOW Current;
|
||||||
HWND* list;
|
HWND* list;
|
||||||
|
|
||||||
/* fixme: if we save nb elements in desktop, we dont have to loop to find nb entries */
|
/* FIXME: If we save nb elements in desktop, we dont have to loop to find nb entries */
|
||||||
LIST_FOR_EACH(Current, &Desktop->ShellHookWindows, SHELL_HOOK_WINDOW, ListEntry)
|
LIST_FOR_EACH(Current, &Desktop->ShellHookWindows, SHELL_HOOK_WINDOW, ListEntry)
|
||||||
entries++;
|
entries++;
|
||||||
|
|
||||||
|
@ -712,7 +712,7 @@ UserBuildShellHookHwndList(PDESKTOP Desktop)
|
||||||
LIST_FOR_EACH(Current, &Desktop->ShellHookWindows, SHELL_HOOK_WINDOW, ListEntry)
|
LIST_FOR_EACH(Current, &Desktop->ShellHookWindows, SHELL_HOOK_WINDOW, ListEntry)
|
||||||
*cursor++ = Current->hWnd;
|
*cursor++ = Current->hWnd;
|
||||||
|
|
||||||
*cursor = NULL; /* nullterm list */
|
*cursor = NULL; /* Nullterm list */
|
||||||
}
|
}
|
||||||
|
|
||||||
return list;
|
return list;
|
||||||
|
@ -1002,7 +1002,7 @@ NtUserCreateDesktop(
|
||||||
InitializeListHead(&DesktopObject->pDeskInfo->aphkStart[i]);
|
InitializeListHead(&DesktopObject->pDeskInfo->aphkStart[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
//// why is this here?
|
//// Why is this here?
|
||||||
#if 0
|
#if 0
|
||||||
if (! NT_SUCCESS(Status))
|
if (! NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
|
@ -1395,10 +1395,10 @@ NtUserPaintDesktop(HDC hDC)
|
||||||
{
|
{
|
||||||
HBITMAP hOldBitmap;
|
HBITMAP hOldBitmap;
|
||||||
|
|
||||||
/* fill in the area that the bitmap is not going to cover */
|
/* Fill in the area that the bitmap is not going to cover */
|
||||||
if (x > 0 || y > 0)
|
if (x > 0 || y > 0)
|
||||||
{
|
{
|
||||||
/* FIXME - clip out the bitmap
|
/* FIXME: Clip out the bitmap
|
||||||
can be replaced with "NtGdiPatBlt(hDC, x, y, WinSta->cxWallpaper, WinSta->cyWallpaper, PATCOPY | DSTINVERT);"
|
can be replaced with "NtGdiPatBlt(hDC, x, y, WinSta->cxWallpaper, WinSta->cyWallpaper, PATCOPY | DSTINVERT);"
|
||||||
once we support DSTINVERT */
|
once we support DSTINVERT */
|
||||||
PreviousBrush = NtGdiSelectBrush(hDC, DesktopBrush);
|
PreviousBrush = NtGdiSelectBrush(hDC, DesktopBrush);
|
||||||
|
@ -1430,7 +1430,7 @@ NtUserPaintDesktop(HDC hDC)
|
||||||
}
|
}
|
||||||
else if (WinSta->WallpaperMode == wmTile)
|
else if (WinSta->WallpaperMode == wmTile)
|
||||||
{
|
{
|
||||||
/* paint the bitmap across the screen then down */
|
/* Paint the bitmap across the screen then down */
|
||||||
for(y = 0; y < Rect.bottom; y += WinSta->cyWallpaper)
|
for(y = 0; y < Rect.bottom; y += WinSta->cyWallpaper)
|
||||||
{
|
{
|
||||||
for(x = 0; x < Rect.right; x += WinSta->cxWallpaper)
|
for(x = 0; x < Rect.right; x += WinSta->cxWallpaper)
|
||||||
|
@ -1666,14 +1666,14 @@ NtUserGetThreadDesktop(DWORD dwThreadId, DWORD Unknown1)
|
||||||
|
|
||||||
if(Thread->ThreadsProcess == PsGetCurrentProcess())
|
if(Thread->ThreadsProcess == PsGetCurrentProcess())
|
||||||
{
|
{
|
||||||
/* just return the handle, we queried the desktop handle of a thread running
|
/* Just return the handle, we queried the desktop handle of a thread running
|
||||||
in the same context */
|
in the same context */
|
||||||
Ret = ((PTHREADINFO)Thread->Tcb.Win32Thread)->hdesk;
|
Ret = ((PTHREADINFO)Thread->Tcb.Win32Thread)->hdesk;
|
||||||
ObDereferenceObject(Thread);
|
ObDereferenceObject(Thread);
|
||||||
RETURN(Ret);
|
RETURN(Ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* get the desktop handle and the desktop of the thread */
|
/* Get the desktop handle and the desktop of the thread */
|
||||||
if(!(hThreadDesktop = ((PTHREADINFO)Thread->Tcb.Win32Thread)->hdesk) ||
|
if(!(hThreadDesktop = ((PTHREADINFO)Thread->Tcb.Win32Thread)->hdesk) ||
|
||||||
!(DesktopObject = ((PTHREADINFO)Thread->Tcb.Win32Thread)->rpdesk))
|
!(DesktopObject = ((PTHREADINFO)Thread->Tcb.Win32Thread)->rpdesk))
|
||||||
{
|
{
|
||||||
|
@ -1682,9 +1682,9 @@ NtUserGetThreadDesktop(DWORD dwThreadId, DWORD Unknown1)
|
||||||
RETURN(NULL);
|
RETURN(NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* we could just use DesktopObject instead of looking up the handle, but latter
|
/* We could just use DesktopObject instead of looking up the handle, but latter
|
||||||
may be a bit safer (e.g. when the desktop is being destroyed */
|
may be a bit safer (e.g. when the desktop is being destroyed */
|
||||||
/* switch into the context of the thread we're trying to get the desktop from,
|
/* Switch into the context of the thread we're trying to get the desktop from,
|
||||||
so we can use the handle */
|
so we can use the handle */
|
||||||
KeAttachProcess(&Thread->ThreadsProcess->Pcb);
|
KeAttachProcess(&Thread->ThreadsProcess->Pcb);
|
||||||
Status = ObReferenceObjectByHandle(hThreadDesktop,
|
Status = ObReferenceObjectByHandle(hThreadDesktop,
|
||||||
|
@ -1695,18 +1695,18 @@ NtUserGetThreadDesktop(DWORD dwThreadId, DWORD Unknown1)
|
||||||
&HandleInformation);
|
&HandleInformation);
|
||||||
KeDetachProcess();
|
KeDetachProcess();
|
||||||
|
|
||||||
/* the handle couldn't be found, there's nothing to get... */
|
/* The handle couldn't be found, there's nothing to get... */
|
||||||
if(!NT_SUCCESS(Status))
|
if(!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
ObDereferenceObject(Thread);
|
ObDereferenceObject(Thread);
|
||||||
RETURN(NULL);
|
RETURN(NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* lookup our handle table if we can find a handle to the desktop object,
|
/* Lookup our handle table if we can find a handle to the desktop object,
|
||||||
if not, create one */
|
if not, create one */
|
||||||
Ret = IntGetDesktopObjectHandle(DesktopObject);
|
Ret = IntGetDesktopObjectHandle(DesktopObject);
|
||||||
|
|
||||||
/* all done, we got a valid handle to the desktop */
|
/* All done, we got a valid handle to the desktop */
|
||||||
ObDereferenceObject(DesktopObject);
|
ObDereferenceObject(DesktopObject);
|
||||||
ObDereferenceObject(Thread);
|
ObDereferenceObject(Thread);
|
||||||
RETURN(Ret);
|
RETURN(Ret);
|
||||||
|
@ -1730,7 +1730,7 @@ IntUnmapDesktopView(IN PDESKTOP DesktopObject)
|
||||||
CurrentWin32Process = PsGetCurrentProcessWin32Process();
|
CurrentWin32Process = PsGetCurrentProcessWin32Process();
|
||||||
PrevLink = &CurrentWin32Process->HeapMappings.Next;
|
PrevLink = &CurrentWin32Process->HeapMappings.Next;
|
||||||
|
|
||||||
/* unmap if we're the last thread using the desktop */
|
/* Unmap if we're the last thread using the desktop */
|
||||||
HeapMapping = *PrevLink;
|
HeapMapping = *PrevLink;
|
||||||
while (HeapMapping != NULL)
|
while (HeapMapping != NULL)
|
||||||
{
|
{
|
||||||
|
@ -1777,7 +1777,7 @@ IntMapDesktopView(IN PDESKTOP DesktopObject)
|
||||||
CurrentWin32Process = PsGetCurrentProcessWin32Process();
|
CurrentWin32Process = PsGetCurrentProcessWin32Process();
|
||||||
PrevLink = &CurrentWin32Process->HeapMappings.Next;
|
PrevLink = &CurrentWin32Process->HeapMappings.Next;
|
||||||
|
|
||||||
/* find out if another thread already mapped the desktop heap */
|
/* Find out if another thread already mapped the desktop heap */
|
||||||
HeapMapping = *PrevLink;
|
HeapMapping = *PrevLink;
|
||||||
while (HeapMapping != NULL)
|
while (HeapMapping != NULL)
|
||||||
{
|
{
|
||||||
|
@ -1791,7 +1791,7 @@ IntMapDesktopView(IN PDESKTOP DesktopObject)
|
||||||
HeapMapping = HeapMapping->Next;
|
HeapMapping = HeapMapping->Next;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* we're the first, map the heap */
|
/* We're the first, map the heap */
|
||||||
TRACE("Noone mapped the desktop heap %p yet, so - map it!\n", DesktopObject->pheapDesktop);
|
TRACE("Noone mapped the desktop heap %p yet, so - map it!\n", DesktopObject->pheapDesktop);
|
||||||
Offset.QuadPart = 0;
|
Offset.QuadPart = 0;
|
||||||
Status = MmMapViewOfSection(DesktopObject->hsectionDesktop,
|
Status = MmMapViewOfSection(DesktopObject->hsectionDesktop,
|
||||||
|
@ -1803,14 +1803,14 @@ IntMapDesktopView(IN PDESKTOP DesktopObject)
|
||||||
&ViewSize,
|
&ViewSize,
|
||||||
ViewUnmap,
|
ViewUnmap,
|
||||||
SEC_NO_CHANGE,
|
SEC_NO_CHANGE,
|
||||||
PAGE_EXECUTE_READ); /* would prefer PAGE_READONLY, but thanks to RTL heaps... */
|
PAGE_EXECUTE_READ); /* Would prefer PAGE_READONLY, but thanks to RTL heaps... */
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
ERR("Failed to map desktop\n");
|
ERR("Failed to map desktop\n");
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* add the mapping */
|
/* Add the mapping */
|
||||||
HeapMapping = UserHeapAlloc(sizeof(W32HEAP_USER_MAPPING));
|
HeapMapping = UserHeapAlloc(sizeof(W32HEAP_USER_MAPPING));
|
||||||
if (HeapMapping == NULL)
|
if (HeapMapping == NULL)
|
||||||
{
|
{
|
||||||
|
@ -1930,7 +1930,7 @@ IntSetThreadDesktop(IN HDESK hDesktop,
|
||||||
{
|
{
|
||||||
ERR("Failed to move process classes to shared heap!\n");
|
ERR("Failed to move process classes to shared heap!\n");
|
||||||
|
|
||||||
/* failed to move desktop classes to the shared heap,
|
/* Failed to move desktop classes to the shared heap,
|
||||||
unmap the view and return the error */
|
unmap the view and return the error */
|
||||||
if (MapHeap && DesktopObject != NULL)
|
if (MapHeap && DesktopObject != NULL)
|
||||||
IntUnmapDesktopView(DesktopObject);
|
IntUnmapDesktopView(DesktopObject);
|
||||||
|
|
|
@ -462,7 +462,7 @@ UserEnumDisplaySettings(
|
||||||
TRACE("Enter UserEnumDisplaySettings('%wZ', %ld)\n",
|
TRACE("Enter UserEnumDisplaySettings('%wZ', %ld)\n",
|
||||||
pustrDevice, iModeNum);
|
pustrDevice, iModeNum);
|
||||||
|
|
||||||
/* Ask gdi for the GRAPHICS_DEVICE */
|
/* Ask GDI for the GRAPHICS_DEVICE */
|
||||||
pGraphicsDevice = EngpFindGraphicsDevice(pustrDevice, 0, 0);
|
pGraphicsDevice = EngpFindGraphicsDevice(pustrDevice, 0, 0);
|
||||||
|
|
||||||
if (!pGraphicsDevice)
|
if (!pGraphicsDevice)
|
||||||
|
@ -480,7 +480,7 @@ UserEnumDisplaySettings(
|
||||||
{
|
{
|
||||||
pdmentry = &pGraphicsDevice->pDevModeList[i];
|
pdmentry = &pGraphicsDevice->pDevModeList[i];
|
||||||
|
|
||||||
/* FIXME: consider EDS_RAWMODE */
|
/* FIXME: Consider EDS_RAWMODE */
|
||||||
#if 0
|
#if 0
|
||||||
if ((!(dwFlags & EDS_RAWMODE) && (pdmentry->dwFlags & 1)) ||!
|
if ((!(dwFlags & EDS_RAWMODE) && (pdmentry->dwFlags & 1)) ||!
|
||||||
(dwFlags & EDS_RAWMODE))
|
(dwFlags & EDS_RAWMODE))
|
||||||
|
@ -520,7 +520,7 @@ UserOpenDisplaySettingsKey(
|
||||||
|
|
||||||
if (bGlobal)
|
if (bGlobal)
|
||||||
{
|
{
|
||||||
// FIXME: need to fix the registry key somehow
|
// FIXME: Need to fix the registry key somehow
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Open the registry key */
|
/* Open the registry key */
|
||||||
|
@ -627,7 +627,7 @@ NtUserEnumDisplaySettings(
|
||||||
/* Output what we got */
|
/* Output what we got */
|
||||||
RtlCopyMemory(lpDevMode, pdm, min(cbSize, pdm->dmSize));
|
RtlCopyMemory(lpDevMode, pdm, min(cbSize, pdm->dmSize));
|
||||||
|
|
||||||
/* output private/extra driver data */
|
/* Output private/extra driver data */
|
||||||
if (cbExtra > 0 && pdm->dmDriverExtra > 0)
|
if (cbExtra > 0 && pdm->dmDriverExtra > 0)
|
||||||
{
|
{
|
||||||
RtlCopyMemory((PCHAR)lpDevMode + cbSize,
|
RtlCopyMemory((PCHAR)lpDevMode + cbSize,
|
||||||
|
@ -680,7 +680,7 @@ UserChangeDisplaySettings(
|
||||||
/* Check params */
|
/* Check params */
|
||||||
if ((dm.dmFields & (DM_PELSWIDTH | DM_PELSHEIGHT)) != (DM_PELSWIDTH | DM_PELSHEIGHT))
|
if ((dm.dmFields & (DM_PELSWIDTH | DM_PELSHEIGHT)) != (DM_PELSWIDTH | DM_PELSHEIGHT))
|
||||||
{
|
{
|
||||||
ERR("devmode doesn't specify the resolution.\n");
|
ERR("Devmode doesn't specify the resolution.\n");
|
||||||
return DISP_CHANGE_BADMODE;
|
return DISP_CHANGE_BADMODE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -688,7 +688,7 @@ UserChangeDisplaySettings(
|
||||||
ppdev = EngpGetPDEV(pustrDevice);
|
ppdev = EngpGetPDEV(pustrDevice);
|
||||||
if (!ppdev)
|
if (!ppdev)
|
||||||
{
|
{
|
||||||
ERR("failed to get PDEV\n");
|
ERR("Failed to get PDEV\n");
|
||||||
return DISP_CHANGE_BADPARAM;
|
return DISP_CHANGE_BADPARAM;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -762,7 +762,7 @@ UserChangeDisplaySettings(
|
||||||
/* Check for failure */
|
/* Check for failure */
|
||||||
if (!ulResult)
|
if (!ulResult)
|
||||||
{
|
{
|
||||||
ERR("failed to set mode\n");
|
ERR("Failed to set mode\n");
|
||||||
lResult = (lResult == DISP_CHANGE_NOTUPDATED) ?
|
lResult = (lResult == DISP_CHANGE_NOTUPDATED) ?
|
||||||
DISP_CHANGE_FAILED : DISP_CHANGE_RESTART;
|
DISP_CHANGE_FAILED : DISP_CHANGE_RESTART;
|
||||||
|
|
||||||
|
|
|
@ -111,7 +111,7 @@ IntCallLowLevelEvent( PEVENTHOOK pEH,
|
||||||
pEP->idObject = idObject;
|
pEP->idObject = idObject;
|
||||||
pEP->idChild = idChild;
|
pEP->idChild = idChild;
|
||||||
|
|
||||||
/* FIXME should get timeout from
|
/* FIXME: Should get timeout from
|
||||||
* HKEY_CURRENT_USER\Control Panel\Desktop\LowLevelHooksTimeout */
|
* HKEY_CURRENT_USER\Control Panel\Desktop\LowLevelHooksTimeout */
|
||||||
Status = co_MsqSendMessage( pEH->head.pti->MessageQueue,
|
Status = co_MsqSendMessage( pEH->head.pti->MessageQueue,
|
||||||
hwnd,
|
hwnd,
|
||||||
|
@ -246,8 +246,8 @@ IntNotifyWinEvent(
|
||||||
// Must be inside the event window.
|
// Must be inside the event window.
|
||||||
if ( (pEH->eventMin <= Event) && (pEH->eventMax >= Event))
|
if ( (pEH->eventMin <= Event) && (pEH->eventMax >= Event))
|
||||||
{
|
{
|
||||||
// if all process || all thread || other thread same process
|
// If all process || all thread || other thread same process
|
||||||
// if ^skip own thread && ((Pid && CPid == Pid && ^skip own process) || all process)
|
// If ^skip own thread && ((Pid && CPid == Pid && ^skip own process) || all process)
|
||||||
if ( (!pEH->idProcess || pEH->idProcess == PtrToUint(pti->pEThread->Cid.UniqueProcess)) &&
|
if ( (!pEH->idProcess || pEH->idProcess == PtrToUint(pti->pEThread->Cid.UniqueProcess)) &&
|
||||||
(!(pEH->Flags & WINEVENT_SKIPOWNPROCESS) || pEH->head.pti->ppi != pti->ppi) &&
|
(!(pEH->Flags & WINEVENT_SKIPOWNPROCESS) || pEH->head.pti->ppi != pti->ppi) &&
|
||||||
(!pEH->idThread || pEH->idThread == PtrToUint(pti->pEThread->Cid.UniqueThread)) &&
|
(!pEH->idThread || pEH->idThread == PtrToUint(pti->pEThread->Cid.UniqueThread)) &&
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
/*
|
/*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS Win32k subsystem
|
||||||
* PURPOSE: Focus functions
|
* PURPOSE: Focus functions
|
||||||
* FILE: subsystem/win32/win32k/ntuser/focus.c
|
* FILE: subsystems/win32/win32k/ntuser/focus.c
|
||||||
* PROGRAMER: ReactOS Team
|
* PROGRAMER: ReactOS Team
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -247,7 +247,7 @@ co_IntSetForegroundAndFocusWindow(PWND Wnd, PWND FocusWindow, BOOL MouseActivate
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* call CBT hook chain */
|
/* Call CBT hook chain */
|
||||||
cbt.fMouse = MouseActivate;
|
cbt.fMouse = MouseActivate;
|
||||||
cbt.hWndActive = hWndPrev;
|
cbt.hWndActive = hWndPrev;
|
||||||
if (co_HOOK_CallHooks( WH_CBT, HCBT_ACTIVATE, (WPARAM)hWnd, (LPARAM)&cbt))
|
if (co_HOOK_CallHooks( WH_CBT, HCBT_ACTIVATE, (WPARAM)hWnd, (LPARAM)&cbt))
|
||||||
|
@ -284,7 +284,7 @@ co_IntSetForegroundAndFocusWindow(PWND Wnd, PWND FocusWindow, BOOL MouseActivate
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL FASTCALL
|
BOOL FASTCALL
|
||||||
co_IntSetForegroundWindow(PWND Window)//FIXME: can Window be NULL??
|
co_IntSetForegroundWindow(PWND Window) // FIXME: Can Window be NULL??
|
||||||
{
|
{
|
||||||
/*if (Window)*/ ASSERT_REFS_CO(Window);
|
/*if (Window)*/ ASSERT_REFS_CO(Window);
|
||||||
|
|
||||||
|
@ -366,7 +366,7 @@ co_IntSetActiveWindow(PWND Wnd OPTIONAL)
|
||||||
return hWndPrev;
|
return hWndPrev;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* call CBT hook chain */
|
/* Call CBT hook chain */
|
||||||
cbt.fMouse = FALSE;
|
cbt.fMouse = FALSE;
|
||||||
cbt.hWndActive = hWndPrev;
|
cbt.hWndActive = hWndPrev;
|
||||||
if (co_HOOK_CallHooks( WH_CBT, HCBT_ACTIVATE, (WPARAM)hWnd, (LPARAM)&cbt))
|
if (co_HOOK_CallHooks( WH_CBT, HCBT_ACTIVATE, (WPARAM)hWnd, (LPARAM)&cbt))
|
||||||
|
@ -407,7 +407,7 @@ co_UserSetFocus(PWND Window)
|
||||||
{
|
{
|
||||||
if (hWndPrev == Window->head.h)
|
if (hWndPrev == Window->head.h)
|
||||||
{
|
{
|
||||||
return hWndPrev; /* nothing to do */
|
return hWndPrev; /* Nothing to do */
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Check if we can set the focus to this window */
|
/* Check if we can set the focus to this window */
|
||||||
|
@ -423,7 +423,7 @@ co_UserSetFocus(PWND Window)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* activate pwndTop if needed. */
|
/* Activate pwndTop if needed. */
|
||||||
if (pwndTop->head.h != ThreadQueue->ActiveWindow)
|
if (pwndTop->head.h != ThreadQueue->ActiveWindow)
|
||||||
{
|
{
|
||||||
co_IntSetActiveWindow(pwndTop);
|
co_IntSetActiveWindow(pwndTop);
|
||||||
|
@ -542,8 +542,8 @@ co_UserSetCapture(HWND hWnd)
|
||||||
if (hWnd == NULL) // Release mode.
|
if (hWnd == NULL) // Release mode.
|
||||||
{
|
{
|
||||||
MOUSEINPUT mi;
|
MOUSEINPUT mi;
|
||||||
/// These are hacks!
|
/// These are HACKS!
|
||||||
/* also remove other windows if not capturing anymore */
|
/* Also remove other windows if not capturing anymore */
|
||||||
MsqSetStateWindow(ThreadQueue, MSQ_STATE_MENUOWNER, NULL);
|
MsqSetStateWindow(ThreadQueue, MSQ_STATE_MENUOWNER, NULL);
|
||||||
MsqSetStateWindow(ThreadQueue, MSQ_STATE_MOVESIZE, NULL);
|
MsqSetStateWindow(ThreadQueue, MSQ_STATE_MOVESIZE, NULL);
|
||||||
///
|
///
|
||||||
|
|
|
@ -103,9 +103,9 @@ IntHookModuleUnloaded(PDESKTOP pdesk, int iHookID, HHOOK hHook)
|
||||||
{
|
{
|
||||||
ptiCurrent = CONTAINING_RECORD(ListEntry, THREADINFO, PtiLink);
|
ptiCurrent = CONTAINING_RECORD(ListEntry, THREADINFO, PtiLink);
|
||||||
|
|
||||||
/* FIXME: do some more security checks here */
|
/* FIXME: Do some more security checks here */
|
||||||
|
|
||||||
/* FIXME: the first check is a reactos specific hack for system threads */
|
/* FIXME: The first check is a reactos specific hack for system threads */
|
||||||
if(!PsIsSystemProcess(ptiCurrent->ppi->peProcess) &&
|
if(!PsIsSystemProcess(ptiCurrent->ppi->peProcess) &&
|
||||||
ptiCurrent->ppi != ppiCsr)
|
ptiCurrent->ppi != ppiCsr)
|
||||||
{
|
{
|
||||||
|
@ -181,7 +181,7 @@ UserRegisterUserApiHook(
|
||||||
}
|
}
|
||||||
ptiCurrent = pwndCurrent->head.pti;
|
ptiCurrent = pwndCurrent->head.pti;
|
||||||
|
|
||||||
/* FIXME: the first check is a reactos specific hack for system threads */
|
/* FIXME: The first check is a reactos specific hack for system threads */
|
||||||
if(PsIsSystemProcess(ptiCurrent->ppi->peProcess) ||
|
if(PsIsSystemProcess(ptiCurrent->ppi->peProcess) ||
|
||||||
ptiCurrent->ppi == ppiCsr)
|
ptiCurrent->ppi == ppiCsr)
|
||||||
{
|
{
|
||||||
|
@ -191,7 +191,7 @@ UserRegisterUserApiHook(
|
||||||
co_MsqSendMessageAsync( ptiCurrent,
|
co_MsqSendMessageAsync( ptiCurrent,
|
||||||
0,
|
0,
|
||||||
WH_APIHOOK,
|
WH_APIHOOK,
|
||||||
FALSE, /* load the module */
|
FALSE, /* Load the module */
|
||||||
0,
|
0,
|
||||||
NULL,
|
NULL,
|
||||||
0,
|
0,
|
||||||
|
@ -295,7 +295,7 @@ co_IntCallLowLevelHook(PHOOK Hook,
|
||||||
if (pHP->pHookStructs) RtlCopyMemory(pHP->pHookStructs, (PVOID)lParam, Size);
|
if (pHP->pHookStructs) RtlCopyMemory(pHP->pHookStructs, (PVOID)lParam, Size);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* FIXME should get timeout from
|
/* FIXME: Should get timeout from
|
||||||
* HKEY_CURRENT_USER\Control Panel\Desktop\LowLevelHooksTimeout */
|
* HKEY_CURRENT_USER\Control Panel\Desktop\LowLevelHooksTimeout */
|
||||||
Status = co_MsqSendMessage( pti->MessageQueue,
|
Status = co_MsqSendMessage( pti->MessageQueue,
|
||||||
IntToPtr(Code), // hWnd
|
IntToPtr(Code), // hWnd
|
||||||
|
@ -439,7 +439,7 @@ co_IntCallDebugHook(PHOOK Hook,
|
||||||
Size = sizeof(CBTACTIVATESTRUCT);
|
Size = sizeof(CBTACTIVATESTRUCT);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case HCBT_CREATEWND: /* Handle Ansi? */
|
case HCBT_CREATEWND: /* Handle ANSI? */
|
||||||
Size = sizeof(CBT_CREATEWND);
|
Size = sizeof(CBT_CREATEWND);
|
||||||
/* What shall we do? Size += sizeof(HOOKPROC_CBT_CREATEWND_EXTRA_ARGUMENTS); same as CREATESTRUCTEX */
|
/* What shall we do? Size += sizeof(HOOKPROC_CBT_CREATEWND_EXTRA_ARGUMENTS); same as CREATESTRUCTEX */
|
||||||
break;
|
break;
|
||||||
|
@ -983,7 +983,7 @@ IntGetGlobalHookHandles(PDESKTOP pdo, int HookId)
|
||||||
return pList;
|
return pList;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* find the next hook in the chain */
|
/* Find the next hook in the chain */
|
||||||
PHOOK
|
PHOOK
|
||||||
FASTCALL
|
FASTCALL
|
||||||
IntGetNextHook(PHOOK Hook)
|
IntGetNextHook(PHOOK Hook)
|
||||||
|
@ -1009,7 +1009,7 @@ IntGetNextHook(PHOOK Hook)
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* free a hook, removing it from its chain */
|
/* Free a hook, removing it from its chain */
|
||||||
static
|
static
|
||||||
VOID
|
VOID
|
||||||
FASTCALL
|
FASTCALL
|
||||||
|
@ -1025,7 +1025,7 @@ IntFreeHook(PHOOK Hook)
|
||||||
UserDeleteObject(UserHMGetHandle(Hook), otHook);
|
UserDeleteObject(UserHMGetHandle(Hook), otHook);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* remove a hook, freeing it from the chain */
|
/* Remove a hook, freeing it from the chain */
|
||||||
static
|
static
|
||||||
VOID
|
VOID
|
||||||
FASTCALL
|
FASTCALL
|
||||||
|
@ -1118,7 +1118,7 @@ HOOK_DestroyThreadHooks(PETHREAD Thread)
|
||||||
while (pElem != pGLE)
|
while (pElem != pGLE)
|
||||||
{
|
{
|
||||||
HookObj = CONTAINING_RECORD(pElem, HOOK, Chain);
|
HookObj = CONTAINING_RECORD(pElem, HOOK, Chain);
|
||||||
pElem = HookObj->Chain.Flink; // get next element before hook is destroyed
|
pElem = HookObj->Chain.Flink; // Get next element before hook is destroyed
|
||||||
if (HookObj->head.pti == pti)
|
if (HookObj->head.pti == pti)
|
||||||
{
|
{
|
||||||
IntRemoveHook(HookObj);
|
IntRemoveHook(HookObj);
|
||||||
|
@ -1538,7 +1538,7 @@ NtUserSetWindowsHookEx( HINSTANCE Mod,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else /* system-global hook */
|
else /* System-global hook */
|
||||||
{
|
{
|
||||||
ptiHook = pti; // gptiCurrent;
|
ptiHook = pti; // gptiCurrent;
|
||||||
if ( !Mod &&
|
if ( !Mod &&
|
||||||
|
@ -1587,7 +1587,7 @@ NtUserSetWindowsHookEx( HINSTANCE Mod,
|
||||||
|
|
||||||
TRACE("Set Hook Desk 0x%x DeskInfo 0x%x Handle Desk 0x%x\n",pti->rpdesk, pti->pDeskInfo,Hook->head.rpdesk);
|
TRACE("Set Hook Desk 0x%x DeskInfo 0x%x Handle Desk 0x%x\n",pti->rpdesk, pti->pDeskInfo,Hook->head.rpdesk);
|
||||||
|
|
||||||
if (ThreadId) /* thread-local hook */
|
if (ThreadId) /* Thread-local hook */
|
||||||
{
|
{
|
||||||
InsertHeadList(&ptiHook->aphkStart[HOOKID_TO_INDEX(HookId)], &Hook->Chain);
|
InsertHeadList(&ptiHook->aphkStart[HOOKID_TO_INDEX(HookId)], &Hook->Chain);
|
||||||
ptiHook->sphkCurrent = NULL;
|
ptiHook->sphkCurrent = NULL;
|
||||||
|
@ -1674,7 +1674,7 @@ NtUserSetWindowsHookEx( HINSTANCE Mod,
|
||||||
}
|
}
|
||||||
|
|
||||||
Hook->ModuleName.Length = ModuleName.Length;
|
Hook->ModuleName.Length = ModuleName.Length;
|
||||||
/* make proc relative to the module base */
|
/* Make proc relative to the module base */
|
||||||
Hook->offPfn = (ULONG_PTR)((char *)HookProc - (char *)Mod);
|
Hook->offPfn = (ULONG_PTR)((char *)HookProc - (char *)Mod);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -1779,5 +1779,4 @@ NtUserUnregisterUserApiHook(VOID)
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* EOF */
|
/* EOF */
|
||||||
|
|
|
@ -1,17 +1,16 @@
|
||||||
/*
|
/*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS Win32k subsystem
|
||||||
* PURPOSE: HotKey support
|
* PURPOSE: HotKey support
|
||||||
* FILE: subsys/win32k/ntuser/hotkey.c
|
* FILE: subsystems/win32/win32k/ntuser/hotkey.c
|
||||||
* PROGRAMER: Eric Kohl
|
* PROGRAMER: Eric Kohl
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
FIXME: Hotkey notifications are triggered by keyboard input (physical or programatically)
|
* FIXME: Hotkey notifications are triggered by keyboard input (physical or programatically)
|
||||||
and since only desktops on WinSta0 can recieve input in seems very wrong to allow
|
* and since only desktops on WinSta0 can recieve input in seems very wrong to allow
|
||||||
windows/threads on destops not belonging to WinSta0 to set hotkeys (recieve notifications).
|
* windows/threads on destops not belonging to WinSta0 to set hotkeys (recieve notifications).
|
||||||
|
* -- Gunnar
|
||||||
-Gunnar
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <win32k.h>
|
#include <win32k.h>
|
||||||
|
@ -226,7 +225,7 @@ co_UserProcessHotKeys(WORD wVk, BOOL bIsDown)
|
||||||
{
|
{
|
||||||
//co_ActivateDebugger(); // FIXME
|
//co_ActivateDebugger(); // FIXME
|
||||||
}
|
}
|
||||||
else if (pHotKey->id == IDHK_REACTOS && !pHotKey->pThread) // FIXME: those hotkeys doesn't depend on RegisterHotKey
|
else if (pHotKey->id == IDHK_REACTOS && !pHotKey->pThread) // FIXME: Those hotkeys doesn't depend on RegisterHotKey
|
||||||
{
|
{
|
||||||
SendSysCmdMsg(pHotKey->hWnd, SC_HOTKEY, (LPARAM)pHotKey->hWnd);
|
SendSysCmdMsg(pHotKey->hWnd, SC_HOTKEY, (LPARAM)pHotKey->hWnd);
|
||||||
}
|
}
|
||||||
|
@ -386,7 +385,7 @@ NtUserRegisterHotKey(HWND hWnd,
|
||||||
|
|
||||||
TRACE("Enter NtUserRegisterHotKey\n");
|
TRACE("Enter NtUserRegisterHotKey\n");
|
||||||
|
|
||||||
if (fsModifiers & ~(MOD_ALT|MOD_CONTROL|MOD_SHIFT|MOD_WIN)) //FIXME: does win2k3 supports MOD_NOREPEAT?
|
if (fsModifiers & ~(MOD_ALT|MOD_CONTROL|MOD_SHIFT|MOD_WIN)) // FIXME: Does Win2k3 support MOD_NOREPEAT?
|
||||||
{
|
{
|
||||||
WARN("Invalid modifiers: %x\n", fsModifiers);
|
WARN("Invalid modifiers: %x\n", fsModifiers);
|
||||||
EngSetLastError(ERROR_INVALID_FLAGS);
|
EngSetLastError(ERROR_INVALID_FLAGS);
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS Win32k subsystem
|
||||||
* PURPOSE: General input functions
|
* PURPOSE: General input functions
|
||||||
* FILE: subsystems/win32/win32k/ntuser/input.c
|
* FILE: subsystems/win32/win32k/ntuser/input.c
|
||||||
* PROGRAMERS: Casper S. Hornstrup (chorns@users.sourceforge.net)
|
* PROGRAMERS: Casper S. Hornstrup (chorns@users.sourceforge.net)
|
||||||
|
@ -353,14 +353,14 @@ IntBlockInput(PTHREADINFO pti, BOOL BlockIt)
|
||||||
if(!pti->rpdesk || ((pti->TIF_flags & TIF_INCLEANUP) && BlockIt))
|
if(!pti->rpdesk || ((pti->TIF_flags & TIF_INCLEANUP) && BlockIt))
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* fail blocking if exiting the thread
|
* Fail blocking if exiting the thread
|
||||||
*/
|
*/
|
||||||
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* FIXME - check access rights of the window station
|
* FIXME: Check access rights of the window station
|
||||||
* e.g. services running in the service window station cannot block input
|
* e.g. services running in the service window station cannot block input
|
||||||
*/
|
*/
|
||||||
if(!ThreadHasInputAccess(pti) ||
|
if(!ThreadHasInputAccess(pti) ||
|
||||||
|
@ -489,7 +489,7 @@ NtUserSendInput(
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* FIXME - check access rights of the window station
|
* FIXME: Check access rights of the window station
|
||||||
* e.g. services running in the service window station cannot block input
|
* e.g. services running in the service window station cannot block input
|
||||||
*/
|
*/
|
||||||
if (!ThreadHasInputAccess(pti) ||
|
if (!ThreadHasInputAccess(pti) ||
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* PROJECT: ReactOS Kernel
|
* PROJECT: ReactOS Win32k subsystem
|
||||||
* LICENSE: GPL - See COPYING in the top level directory
|
* LICENSE: GPL - See COPYING in the top level directory
|
||||||
* FILE: subsystems/win32/win32k/ntuser/kbdlayout.c
|
* FILE: subsystems/win32/win32k/ntuser/kbdlayout.c
|
||||||
* PURPOSE: Keyboard layout management
|
* PURPOSE: Keyboard layout management
|
||||||
|
@ -387,7 +387,7 @@ co_UserActivateKbl(PTHREADINFO pti, PKL pKl, UINT Flags)
|
||||||
// Send WM_INPUTLANGCHANGE to thread's focus window
|
// Send WM_INPUTLANGCHANGE to thread's focus window
|
||||||
co_IntSendMessage(pti->MessageQueue->FocusWindow,
|
co_IntSendMessage(pti->MessageQueue->FocusWindow,
|
||||||
WM_INPUTLANGCHANGE,
|
WM_INPUTLANGCHANGE,
|
||||||
(WPARAM)pKl->iBaseCharset, // FIXME: how to set it?
|
(WPARAM)pKl->iBaseCharset, // FIXME: How to set it?
|
||||||
(LPARAM)pKl->hkl); // hkl
|
(LPARAM)pKl->hkl); // hkl
|
||||||
|
|
||||||
return pklPrev;
|
return pklPrev;
|
||||||
|
@ -537,8 +537,8 @@ HKL
|
||||||
APIENTRY
|
APIENTRY
|
||||||
NtUserLoadKeyboardLayoutEx(
|
NtUserLoadKeyboardLayoutEx(
|
||||||
IN HANDLE Handle, // hFile (See downloads.securityfocus.com/vulnerabilities/exploits/43774.c)
|
IN HANDLE Handle, // hFile (See downloads.securityfocus.com/vulnerabilities/exploits/43774.c)
|
||||||
IN DWORD offTable, // offset to KbdTables
|
IN DWORD offTable, // Offset to KbdTables
|
||||||
IN PUNICODE_STRING puszKeyboardName, // not used?
|
IN PUNICODE_STRING puszKeyboardName, // Not used?
|
||||||
IN HKL hklUnload,
|
IN HKL hklUnload,
|
||||||
IN PUNICODE_STRING pustrKLID,
|
IN PUNICODE_STRING pustrKLID,
|
||||||
IN DWORD hkl,
|
IN DWORD hkl,
|
||||||
|
@ -558,7 +558,7 @@ NtUserLoadKeyboardLayoutEx(
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* FIXME: it seems KLF_RESET is only supported for WINLOGON */
|
/* FIXME: It seems KLF_RESET is only supported for WINLOGON */
|
||||||
|
|
||||||
RtlInitEmptyUnicodeString(&ustrSafeKLID, Buffer, sizeof(Buffer));
|
RtlInitEmptyUnicodeString(&ustrSafeKLID, Buffer, sizeof(Buffer));
|
||||||
_SEH2_TRY
|
_SEH2_TRY
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
* PURPOSE: Keyboard functions
|
* PURPOSE: Keyboard functions
|
||||||
* FILE: subsys/win32k/ntuser/keyboard.c
|
* FILE: subsystems/win32/win32k/ntuser/keyboard.c
|
||||||
* PROGRAMERS: Casper S. Hornstrup (chorns@users.sourceforge.net)
|
* PROGRAMERS: Casper S. Hornstrup (chorns@users.sourceforge.net)
|
||||||
* Rafal Harabien (rafalh@reactos.org)
|
* Rafal Harabien (rafalh@reactos.org)
|
||||||
*/
|
*/
|
||||||
|
@ -458,7 +458,7 @@ IntToUnicodeEx(UINT wVirtKey,
|
||||||
TRACE("Final char: %lc (%x)\n", wchTranslatedChar, wchTranslatedChar);
|
TRACE("Final char: %lc (%x)\n", wchTranslatedChar, wchTranslatedChar);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* dead char has not been not found */
|
/* Dead char has not been not found */
|
||||||
if (wchDead)
|
if (wchDead)
|
||||||
{
|
{
|
||||||
/* Treat both characters normally */
|
/* Treat both characters normally */
|
||||||
|
@ -467,7 +467,7 @@ IntToUnicodeEx(UINT wVirtKey,
|
||||||
bDead = FALSE;
|
bDead = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* add character to the buffer */
|
/* Add character to the buffer */
|
||||||
if (cchBuff > iRet)
|
if (cchBuff > iRet)
|
||||||
pwszBuff[iRet++] = wchTranslatedChar;
|
pwszBuff[iRet++] = wchTranslatedChar;
|
||||||
|
|
||||||
|
@ -861,7 +861,7 @@ ProcessKeyEvent(WORD wVk, WORD wScanCode, DWORD dwFlags, BOOL bInjected, DWORD d
|
||||||
{
|
{
|
||||||
/* Init message */
|
/* Init message */
|
||||||
Msg.hwnd = pFocusQueue->FocusWindow;
|
Msg.hwnd = pFocusQueue->FocusWindow;
|
||||||
Msg.wParam = wFixedVk & 0xFF; /* Note: it's simplified by msg queue */
|
Msg.wParam = wFixedVk & 0xFF; /* Note: It's simplified by msg queue */
|
||||||
Msg.lParam = MAKELPARAM(1, wScanCode);
|
Msg.lParam = MAKELPARAM(1, wScanCode);
|
||||||
Msg.time = dwTime;
|
Msg.time = dwTime;
|
||||||
Msg.pt = gpsi->ptCursor;
|
Msg.pt = gpsi->ptCursor;
|
||||||
|
@ -877,7 +877,7 @@ ProcessKeyEvent(WORD wVk, WORD wScanCode, DWORD dwFlags, BOOL bInjected, DWORD d
|
||||||
Msg.lParam |= KF_REPEAT << 16;
|
Msg.lParam |= KF_REPEAT << 16;
|
||||||
if (!bIsDown)
|
if (!bIsDown)
|
||||||
Msg.lParam |= KF_UP << 16;
|
Msg.lParam |= KF_UP << 16;
|
||||||
/* FIXME: set KF_DLGMODE and KF_MENUMODE when needed */
|
/* FIXME: Set KF_DLGMODE and KF_MENUMODE when needed */
|
||||||
if (pFocusQueue->QF_flags & QF_DIALOGACTIVE)
|
if (pFocusQueue->QF_flags & QF_DIALOGACTIVE)
|
||||||
Msg.lParam |= KF_DLGMODE << 16;
|
Msg.lParam |= KF_DLGMODE << 16;
|
||||||
if (pFocusQueue->MenuOwner) // pFocusQueue->MenuState) // MenuState needs a start flag...
|
if (pFocusQueue->MenuOwner) // pFocusQueue->MenuState) // MenuState needs a start flag...
|
||||||
|
@ -1008,7 +1008,7 @@ UserProcessKeyboardInput(
|
||||||
pKbdTbl = pKl->spkf->pKbdTbl;
|
pKbdTbl = pKl->spkf->pKbdTbl;
|
||||||
|
|
||||||
/* Convert scan code to virtual key.
|
/* Convert scan code to virtual key.
|
||||||
Note: we could call UserSendKeyboardInput using scan code,
|
Note: We could call UserSendKeyboardInput using scan code,
|
||||||
but it wouldn't interpret E1 key(s) properly */
|
but it wouldn't interpret E1 key(s) properly */
|
||||||
wVk = IntVscToVk(wScanCode, pKbdTbl);
|
wVk = IntVscToVk(wScanCode, pKbdTbl);
|
||||||
TRACE("UserProcessKeyboardInput: %x (break: %u) -> %x\n",
|
TRACE("UserProcessKeyboardInput: %x (break: %u) -> %x\n",
|
||||||
|
@ -1179,7 +1179,7 @@ IntMapVirtualKeyEx(UINT uCode, UINT Type, PKBDTABLES pKbdTbl)
|
||||||
case MAPVK_VK_TO_VSC:
|
case MAPVK_VK_TO_VSC:
|
||||||
uCode = IntFixVk(uCode, FALSE);
|
uCode = IntFixVk(uCode, FALSE);
|
||||||
uRet = IntVkToVsc(uCode, pKbdTbl);
|
uRet = IntVkToVsc(uCode, pKbdTbl);
|
||||||
if (uRet > 0xFF) // fail for scancodes with prefix (e0, e1)
|
if (uRet > 0xFF) // Fail for scancodes with prefix (e0, e1)
|
||||||
uRet = 0;
|
uRet = 0;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -1308,7 +1308,7 @@ NtUserToUnicodeEx(
|
||||||
}
|
}
|
||||||
RtlZeroMemory(pwszBuff, sizeof(WCHAR) * cchBuff);
|
RtlZeroMemory(pwszBuff, sizeof(WCHAR) * cchBuff);
|
||||||
|
|
||||||
UserEnterExclusive(); // Note: we modify wchDead static variable
|
UserEnterExclusive(); // Note: We modify wchDead static variable
|
||||||
|
|
||||||
if (dwhkl)
|
if (dwhkl)
|
||||||
pKl = UserHklToKbl(dwhkl);
|
pKl = UserHklToKbl(dwhkl);
|
||||||
|
@ -1370,7 +1370,7 @@ NtUserGetKeyNameText(LONG lParam, LPWSTR lpString, int cchSize)
|
||||||
/* "Do not care" flag */
|
/* "Do not care" flag */
|
||||||
if(lParam & LP_DO_NOT_CARE_BIT)
|
if(lParam & LP_DO_NOT_CARE_BIT)
|
||||||
{
|
{
|
||||||
/* Note: we could do vsc -> vk -> vsc conversion, instead of using
|
/* Note: We could do vsc -> vk -> vsc conversion, instead of using
|
||||||
hardcoded scan codes, but it's not what Windows does */
|
hardcoded scan codes, but it's not what Windows does */
|
||||||
if (wScanCode == SCANCODE_RSHIFT && !bExtKey)
|
if (wScanCode == SCANCODE_RSHIFT && !bExtKey)
|
||||||
wScanCode = SCANCODE_LSHIFT;
|
wScanCode = SCANCODE_LSHIFT;
|
||||||
|
@ -1409,7 +1409,7 @@ NtUserGetKeyNameText(LONG lParam, LPWSTR lpString, int cchSize)
|
||||||
{
|
{
|
||||||
cchKeyName = wcslen(pKeyName);
|
cchKeyName = wcslen(pKeyName);
|
||||||
if (cchKeyName > cchSize - 1)
|
if (cchKeyName > cchSize - 1)
|
||||||
cchKeyName = cchSize - 1; // don't count '\0'
|
cchKeyName = cchSize - 1; // Don't count '\0'
|
||||||
|
|
||||||
_SEH2_TRY
|
_SEH2_TRY
|
||||||
{
|
{
|
||||||
|
|
|
@ -11,7 +11,7 @@ DBG_DEFAULT_CHANNEL(UserMenu);
|
||||||
|
|
||||||
/* INTERNAL ******************************************************************/
|
/* INTERNAL ******************************************************************/
|
||||||
|
|
||||||
/* maximum number of menu items a menu can contain */
|
/* Maximum number of menu items a menu can contain */
|
||||||
#define MAX_MENU_ITEMS (0x4000)
|
#define MAX_MENU_ITEMS (0x4000)
|
||||||
#define MAX_GOINTOSUBMENU (0x10)
|
#define MAX_GOINTOSUBMENU (0x10)
|
||||||
|
|
||||||
|
@ -208,8 +208,8 @@ IntDestroyMenuObject(PMENU_OBJECT Menu,
|
||||||
PWINSTATION_OBJECT WindowStation;
|
PWINSTATION_OBJECT WindowStation;
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
|
|
||||||
/* remove all menu items */
|
/* Remove all menu items */
|
||||||
IntDeleteMenuItems(Menu, bRecurse); /* do not destroy submenus */
|
IntDeleteMenuItems(Menu, bRecurse); /* Do not destroy submenus */
|
||||||
|
|
||||||
if(RemoveFromProcess)
|
if(RemoveFromProcess)
|
||||||
{
|
{
|
||||||
|
@ -260,14 +260,14 @@ IntCreateMenu(PHANDLE Handle, BOOL IsMenuBar)
|
||||||
}
|
}
|
||||||
|
|
||||||
Menu->Process = PsGetCurrentProcess();
|
Menu->Process = PsGetCurrentProcess();
|
||||||
Menu->RtoL = FALSE; /* default */
|
Menu->RtoL = FALSE; /* Default */
|
||||||
Menu->MenuInfo.cbSize = sizeof(MENUINFO); /* not used */
|
Menu->MenuInfo.cbSize = sizeof(MENUINFO); /* Not used */
|
||||||
Menu->MenuInfo.fMask = 0; /* not used */
|
Menu->MenuInfo.fMask = 0; /* Not used */
|
||||||
Menu->MenuInfo.dwStyle = 0; /* FIXME */
|
Menu->MenuInfo.dwStyle = 0; /* FIXME */
|
||||||
Menu->MenuInfo.cyMax = 0; /* default */
|
Menu->MenuInfo.cyMax = 0; /* Default */
|
||||||
Menu->MenuInfo.hbrBack = NULL; /* no brush */
|
Menu->MenuInfo.hbrBack = NULL; /* No brush */
|
||||||
Menu->MenuInfo.dwContextHelpID = 0; /* default */
|
Menu->MenuInfo.dwContextHelpID = 0; /* Default */
|
||||||
Menu->MenuInfo.dwMenuData = 0; /* default */
|
Menu->MenuInfo.dwMenuData = 0; /* Default */
|
||||||
Menu->MenuInfo.Self = *Handle;
|
Menu->MenuInfo.Self = *Handle;
|
||||||
Menu->MenuInfo.FocusedItem = NO_SELECTED_ITEM;
|
Menu->MenuInfo.FocusedItem = NO_SELECTED_ITEM;
|
||||||
Menu->MenuInfo.Flags = (IsMenuBar ? 0 : MF_POPUP);
|
Menu->MenuInfo.Flags = (IsMenuBar ? 0 : MF_POPUP);
|
||||||
|
@ -369,7 +369,7 @@ IntCloneMenu(PMENU_OBJECT Source)
|
||||||
|
|
||||||
Menu->Process = PsGetCurrentProcess();
|
Menu->Process = PsGetCurrentProcess();
|
||||||
Menu->RtoL = Source->RtoL;
|
Menu->RtoL = Source->RtoL;
|
||||||
Menu->MenuInfo.cbSize = sizeof(MENUINFO); /* not used */
|
Menu->MenuInfo.cbSize = sizeof(MENUINFO); /* Not used */
|
||||||
Menu->MenuInfo.fMask = Source->MenuInfo.fMask;
|
Menu->MenuInfo.fMask = Source->MenuInfo.fMask;
|
||||||
Menu->MenuInfo.dwStyle = Source->MenuInfo.dwStyle;
|
Menu->MenuInfo.dwStyle = Source->MenuInfo.dwStyle;
|
||||||
Menu->MenuInfo.cyMax = Source->MenuInfo.cyMax;
|
Menu->MenuInfo.cyMax = Source->MenuInfo.cyMax;
|
||||||
|
@ -568,12 +568,12 @@ IntInsertMenuItemToList(PMENU_OBJECT Menu, PMENU_ITEM MenuItem, int pos)
|
||||||
|
|
||||||
if(LastItem)
|
if(LastItem)
|
||||||
{
|
{
|
||||||
/* insert the item after LastItem */
|
/* Insert the item after LastItem */
|
||||||
LastItem->Next = MenuItem;
|
LastItem->Next = MenuItem;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* insert at the beginning */
|
/* Insert at the beginning */
|
||||||
Menu->MenuItemList = MenuItem;
|
Menu->MenuItemList = MenuItem;
|
||||||
}
|
}
|
||||||
MenuItem->Next = CurItem;
|
MenuItem->Next = CurItem;
|
||||||
|
@ -668,7 +668,7 @@ IntSetMenuItemInfo(PMENU_OBJECT MenuObject, PMENU_ITEM MenuItem, PROSMENUITEMINF
|
||||||
if (lpmii->fMask & ( MIIM_STRING | MIIM_FTYPE | MIIM_BITMAP))
|
if (lpmii->fMask & ( MIIM_STRING | MIIM_FTYPE | MIIM_BITMAP))
|
||||||
{
|
{
|
||||||
ERR("IntSetMenuItemInfo: Invalid combination of fMask bits used\n");
|
ERR("IntSetMenuItemInfo: Invalid combination of fMask bits used\n");
|
||||||
/* this does not happen on Win9x/ME */
|
/* This does not happen on Win9x/ME */
|
||||||
SetLastNtError( ERROR_INVALID_PARAMETER);
|
SetLastNtError( ERROR_INVALID_PARAMETER);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
@ -722,11 +722,11 @@ IntSetMenuItemInfo(PMENU_OBJECT MenuObject, PMENU_ITEM MenuItem, PROSMENUITEMINF
|
||||||
}
|
}
|
||||||
if(lpmii->fMask & MIIM_STATE)
|
if(lpmii->fMask & MIIM_STATE)
|
||||||
{
|
{
|
||||||
/* remove MFS_DEFAULT flag from all other menu items if this item
|
/* Remove MFS_DEFAULT flag from all other menu items if this item
|
||||||
has the MFS_DEFAULT state */
|
has the MFS_DEFAULT state */
|
||||||
if(lpmii->fState & MFS_DEFAULT)
|
if(lpmii->fState & MFS_DEFAULT)
|
||||||
UserSetMenuDefaultItem(MenuObject, -1, 0);
|
UserSetMenuDefaultItem(MenuObject, -1, 0);
|
||||||
/* update the menu item state flags */
|
/* Update the menu item state flags */
|
||||||
UpdateMenuItemState(MenuItem->fState, lpmii->fState);
|
UpdateMenuItemState(MenuItem->fState, lpmii->fState);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -829,7 +829,7 @@ IntInsertMenuItem(PMENU_OBJECT MenuObject, UINT uItem, BOOL fByPosition,
|
||||||
}
|
}
|
||||||
if (SubMenu == NULL)
|
if (SubMenu == NULL)
|
||||||
{
|
{
|
||||||
/* default to last position of menu */
|
/* Default to last position of menu */
|
||||||
SubMenu = MenuObject;
|
SubMenu = MenuObject;
|
||||||
pos = MenuObject->MenuInfo.MenuItemCount;
|
pos = MenuObject->MenuInfo.MenuItemCount;
|
||||||
}
|
}
|
||||||
|
@ -965,7 +965,7 @@ IntBuildMenuItemList(PMENU_OBJECT MenuObject, PVOID Buffer, ULONG nMax)
|
||||||
if (0 != CurItem->Text.Length
|
if (0 != CurItem->Text.Length
|
||||||
&& (nMax >= CurItem->Text.Length + sizeof(WCHAR)))
|
&& (nMax >= CurItem->Text.Length + sizeof(WCHAR)))
|
||||||
{
|
{
|
||||||
/* copy string */
|
/* Copy string */
|
||||||
Status = MmCopyToCaller(StrOut, CurItem->Text.Buffer,
|
Status = MmCopyToCaller(StrOut, CurItem->Text.Buffer,
|
||||||
CurItem->Text.Length);
|
CurItem->Text.Length);
|
||||||
if (! NT_SUCCESS(Status))
|
if (! NT_SUCCESS(Status))
|
||||||
|
@ -1049,7 +1049,7 @@ IntHiliteMenuItem(PWND WindowObject, PMENU_OBJECT MenuObject,
|
||||||
MenuItem->fState &= ~MF_HILITE;
|
MenuItem->fState &= ~MF_HILITE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* FIXME - update the window's menu */
|
/* FIXME: Update the window's menu */
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
@ -1161,12 +1161,12 @@ VOID FASTCALL
|
||||||
co_IntInitTracking(PWND Window, PMENU_OBJECT Menu, BOOL Popup,
|
co_IntInitTracking(PWND Window, PMENU_OBJECT Menu, BOOL Popup,
|
||||||
UINT Flags)
|
UINT Flags)
|
||||||
{
|
{
|
||||||
/* FIXME - hide caret */
|
/* FIXME: Hide caret */
|
||||||
|
|
||||||
if(!(Flags & TPM_NONOTIFY))
|
if(!(Flags & TPM_NONOTIFY))
|
||||||
co_IntSendMessage(Window->head.h, WM_SETCURSOR, (WPARAM)Window->head.h, HTCAPTION);
|
co_IntSendMessage(Window->head.h, WM_SETCURSOR, (WPARAM)Window->head.h, HTCAPTION);
|
||||||
|
|
||||||
/* FIXME - send WM_SETCURSOR message */
|
/* FIXME: Send WM_SETCURSOR message */
|
||||||
|
|
||||||
if(!(Flags & TPM_NONOTIFY))
|
if(!(Flags & TPM_NONOTIFY))
|
||||||
co_IntSendMessage(Window->head.h, WM_INITMENU, (WPARAM)Menu->MenuInfo.Self, 0);
|
co_IntSendMessage(Window->head.h, WM_INITMENU, (WPARAM)Menu->MenuInfo.Self, 0);
|
||||||
|
@ -1179,7 +1179,7 @@ co_IntExitTracking(PWND Window, PMENU_OBJECT Menu, BOOL Popup,
|
||||||
if(!(Flags & TPM_NONOTIFY))
|
if(!(Flags & TPM_NONOTIFY))
|
||||||
co_IntSendMessage(Window->head.h, WM_EXITMENULOOP, 0 /* FIXME */, 0);
|
co_IntSendMessage(Window->head.h, WM_EXITMENULOOP, 0 /* FIXME */, 0);
|
||||||
|
|
||||||
/* FIXME - Show caret again */
|
/* FIXME: Show caret again */
|
||||||
}
|
}
|
||||||
|
|
||||||
INT FASTCALL
|
INT FASTCALL
|
||||||
|
@ -1254,7 +1254,7 @@ intGetTitleBarInfo(PWND pWindowObject, PTITLEBARINFO bti)
|
||||||
bti->rcTitleBar.right = pWindowObject->rcWindow.right - pWindowObject->rcWindow.left;
|
bti->rcTitleBar.right = pWindowObject->rcWindow.right - pWindowObject->rcWindow.left;
|
||||||
bti->rcTitleBar.bottom = pWindowObject->rcWindow.bottom - pWindowObject->rcWindow.top;
|
bti->rcTitleBar.bottom = pWindowObject->rcWindow.bottom - pWindowObject->rcWindow.top;
|
||||||
|
|
||||||
/* is it iconiced ? */
|
/* Is it iconiced ? */
|
||||||
if ((dwStyle & WS_ICONIC)!=WS_ICONIC)
|
if ((dwStyle & WS_ICONIC)!=WS_ICONIC)
|
||||||
{
|
{
|
||||||
/* Remove frame from rectangle */
|
/* Remove frame from rectangle */
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS Win32k subsystem
|
||||||
* PURPOSE: Messages
|
* PURPOSE: Messages
|
||||||
* FILE: subsystems/win32/win32k/ntuser/message.c
|
* FILE: subsystems/win32/win32k/ntuser/message.c
|
||||||
* PROGRAMER: Casper S. Hornstrup (chorns@users.sourceforge.net)
|
* PROGRAMER: Casper S. Hornstrup (chorns@users.sourceforge.net)
|
||||||
|
@ -764,7 +764,7 @@ co_IntPeekMessage( PMSG Msg,
|
||||||
if (ProcessMask & QS_POSTMESSAGE)
|
if (ProcessMask & QS_POSTMESSAGE)
|
||||||
{
|
{
|
||||||
pti->pcti->fsChangeBits &= ~(QS_POSTMESSAGE | QS_HOTKEY | QS_TIMER);
|
pti->pcti->fsChangeBits &= ~(QS_POSTMESSAGE | QS_HOTKEY | QS_TIMER);
|
||||||
if (MsgFilterMin == 0 && MsgFilterMax == 0) // wine hack does this; ~0U)
|
if (MsgFilterMin == 0 && MsgFilterMax == 0) // Wine hack does this; ~0U)
|
||||||
{
|
{
|
||||||
pti->pcti->fsChangeBits &= ~QS_ALLPOSTMESSAGE;
|
pti->pcti->fsChangeBits &= ~QS_ALLPOSTMESSAGE;
|
||||||
}
|
}
|
||||||
|
@ -1023,7 +1023,7 @@ co_IntGetPeekMessage( PMSG pMsg,
|
||||||
{
|
{
|
||||||
// Clear the spin cycle to fix the mix.
|
// Clear the spin cycle to fix the mix.
|
||||||
pti->pClientInfo->cSpins = 0;
|
pti->pClientInfo->cSpins = 0;
|
||||||
//if (!(pti->TIF_flags & TIF_SPINNING)) FIXME need to swap vinyl..
|
//if (!(pti->TIF_flags & TIF_SPINNING)) // FIXME: Need to swap vinyl...
|
||||||
}
|
}
|
||||||
return Present;
|
return Present;
|
||||||
}
|
}
|
||||||
|
@ -1179,7 +1179,7 @@ UserPostMessage( HWND Wnd,
|
||||||
if ( Window->state & WNDS_DESTROYED )
|
if ( Window->state & WNDS_DESTROYED )
|
||||||
{
|
{
|
||||||
ERR("Attempted to post message to window 0x%x that is being destroyed!\n", Wnd);
|
ERR("Attempted to post message to window 0x%x that is being destroyed!\n", Wnd);
|
||||||
/* FIXME - last error code? */
|
/* FIXME: Last error code? */
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1312,14 +1312,14 @@ co_IntSendMessageTimeoutSingle( HWND hWnd,
|
||||||
|
|
||||||
if (uFlags & SMTO_ABORTIFHUNG && MsqIsHung(Window->head.pti->MessageQueue))
|
if (uFlags & SMTO_ABORTIFHUNG && MsqIsHung(Window->head.pti->MessageQueue))
|
||||||
{
|
{
|
||||||
// FIXME - Set window hung and add to a list.
|
// FIXME: Set window hung and add to a list.
|
||||||
/* FIXME - Set a LastError? */
|
/* FIXME: Set a LastError? */
|
||||||
RETURN( FALSE);
|
RETURN( FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Window->state & WNDS_DESTROYED)
|
if (Window->state & WNDS_DESTROYED)
|
||||||
{
|
{
|
||||||
/* FIXME - last error? */
|
/* FIXME: Last error? */
|
||||||
ERR("Attempted to send message to window 0x%x that is being destroyed!\n", hWnd);
|
ERR("Attempted to send message to window 0x%x that is being destroyed!\n", hWnd);
|
||||||
RETURN( FALSE);
|
RETURN( FALSE);
|
||||||
}
|
}
|
||||||
|
@ -1338,17 +1338,17 @@ co_IntSendMessageTimeoutSingle( HWND hWnd,
|
||||||
}
|
}
|
||||||
while ((STATUS_TIMEOUT == Status) &&
|
while ((STATUS_TIMEOUT == Status) &&
|
||||||
(uFlags & SMTO_NOTIMEOUTIFNOTHUNG) &&
|
(uFlags & SMTO_NOTIMEOUTIFNOTHUNG) &&
|
||||||
!MsqIsHung(Window->head.pti->MessageQueue)); // FIXME - Set window hung and add to a list.
|
!MsqIsHung(Window->head.pti->MessageQueue)); // FIXME: Set window hung and add to a list.
|
||||||
|
|
||||||
if (STATUS_TIMEOUT == Status)
|
if (STATUS_TIMEOUT == Status)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
MSDN says:
|
* MSDN says:
|
||||||
Microsoft Windows 2000: If GetLastError returns zero, then the function
|
* Microsoft Windows 2000: If GetLastError returns zero, then the function
|
||||||
timed out.
|
* timed out.
|
||||||
XP+ : If the function fails or times out, the return value is zero.
|
* XP+ : If the function fails or times out, the return value is zero.
|
||||||
To get extended error information, call GetLastError. If GetLastError
|
* To get extended error information, call GetLastError. If GetLastError
|
||||||
returns ERROR_TIMEOUT, then the function timed out.
|
* returns ERROR_TIMEOUT, then the function timed out.
|
||||||
*/
|
*/
|
||||||
EngSetLastError(ERROR_TIMEOUT);
|
EngSetLastError(ERROR_TIMEOUT);
|
||||||
RETURN( FALSE);
|
RETURN( FALSE);
|
||||||
|
@ -1486,7 +1486,7 @@ co_IntSendMessageWithCallBack( HWND hWnd,
|
||||||
|
|
||||||
if (Window->state & WNDS_DESTROYED)
|
if (Window->state & WNDS_DESTROYED)
|
||||||
{
|
{
|
||||||
/* FIXME - last error? */
|
/* FIXME: last error? */
|
||||||
ERR("Attempted to send message to window 0x%x that is being destroyed!\n", hWnd);
|
ERR("Attempted to send message to window 0x%x that is being destroyed!\n", hWnd);
|
||||||
RETURN(FALSE);
|
RETURN(FALSE);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
/*
|
/*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS Win32k subsystem
|
||||||
* PURPOSE: Window classes
|
* PURPOSE: Window classes
|
||||||
* FILE: subsys/win32k/ntuser/metric.c
|
* FILE: subsystems/win32/win32k/ntuser/metric.c
|
||||||
* PROGRAMER: Casper S. Hornstrup (chorns@users.sourceforge.net)
|
* PROGRAMER: Casper S. Hornstrup (chorns@users.sourceforge.net)
|
||||||
* Timo Kreuzer (timo.kreuzer@reactos.org)
|
* Timo Kreuzer (timo.kreuzer@reactos.org)
|
||||||
*/
|
*/
|
||||||
|
@ -21,12 +21,12 @@ InitMetrics(VOID)
|
||||||
INT *piSysMet = gpsi->aiSysMet;
|
INT *piSysMet = gpsi->aiSysMet;
|
||||||
ULONG Width, Height;
|
ULONG Width, Height;
|
||||||
|
|
||||||
/* note: used for the SM_CLEANBOOT metric */
|
/* Note: used for the SM_CLEANBOOT metric */
|
||||||
DWORD dwValue = 0;
|
DWORD dwValue = 0;
|
||||||
HKEY hKey = 0;
|
HKEY hKey = 0;
|
||||||
|
|
||||||
/* Clean boot */
|
/* Clean boot */
|
||||||
piSysMet[SM_CLEANBOOT] = 0; // fallback value of 0 (normal mode)
|
piSysMet[SM_CLEANBOOT] = 0; // Fallback value of 0 (normal mode)
|
||||||
if(NT_SUCCESS(RegOpenKey(L"\\REGISTRY\\MACHINE\\SYSTEM\\CurrentControlSet\\Control\\SafeBoot\\Option", &hKey)))
|
if(NT_SUCCESS(RegOpenKey(L"\\REGISTRY\\MACHINE\\SYSTEM\\CurrentControlSet\\Control\\SafeBoot\\Option", &hKey)))
|
||||||
{
|
{
|
||||||
if(RegReadDWORD(hKey, L"OptionValue", &dwValue)) piSysMet[SM_CLEANBOOT] = (INT)dwValue;
|
if(RegReadDWORD(hKey, L"OptionValue", &dwValue)) piSysMet[SM_CLEANBOOT] = (INT)dwValue;
|
||||||
|
@ -58,10 +58,10 @@ InitMetrics(VOID)
|
||||||
piSysMet[SM_CYSMCAPTION] = gspv.ncm.iSmCaptionHeight + 1; // 15;
|
piSysMet[SM_CYSMCAPTION] = gspv.ncm.iSmCaptionHeight + 1; // 15;
|
||||||
piSysMet[SM_CXSIZE] = gspv.ncm.iCaptionHeight; // 18;
|
piSysMet[SM_CXSIZE] = gspv.ncm.iCaptionHeight; // 18;
|
||||||
piSysMet[SM_CYSIZE] = gspv.ncm.iCaptionHeight; // 18;
|
piSysMet[SM_CYSIZE] = gspv.ncm.iCaptionHeight; // 18;
|
||||||
piSysMet[SM_CXSMSIZE] = gspv.ncm.iSmCaptionWidth; // 12; xp: piSysMet(SM_CYSMCAPTION) - 1
|
piSysMet[SM_CXSMSIZE] = gspv.ncm.iSmCaptionWidth; // 12; XP: piSysMet(SM_CYSMCAPTION) - 1
|
||||||
piSysMet[SM_CYSMSIZE] = gspv.ncm.iSmCaptionHeight; // 14;
|
piSysMet[SM_CYSMSIZE] = gspv.ncm.iSmCaptionHeight; // 14;
|
||||||
piSysMet[SM_CXBORDER] = 1; // seems to be hardcoded
|
piSysMet[SM_CXBORDER] = 1; // Seems to be hardcoded
|
||||||
piSysMet[SM_CYBORDER] = 1; // seems to be hardcoded
|
piSysMet[SM_CYBORDER] = 1; // Seems to be hardcoded
|
||||||
piSysMet[SM_CXFOCUSBORDER] = 1;
|
piSysMet[SM_CXFOCUSBORDER] = 1;
|
||||||
piSysMet[SM_CYFOCUSBORDER] = 1;
|
piSysMet[SM_CYFOCUSBORDER] = 1;
|
||||||
piSysMet[SM_CXDLGFRAME] = 3;
|
piSysMet[SM_CXDLGFRAME] = 3;
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS Win32k subsystem
|
||||||
* PURPOSE: Misc User funcs
|
* PURPOSE: Miscellaneous User functions
|
||||||
* FILE: subsystems/win32/win32k/ntuser/misc.c
|
* FILE: subsystems/win32/win32k/ntuser/misc.c
|
||||||
* PROGRAMER: Ge van Geldorp (ge@gse.nl)
|
* PROGRAMER: Ge van Geldorp (ge@gse.nl)
|
||||||
*/
|
*/
|
||||||
|
@ -167,7 +167,7 @@ NtUserGetThreadState(
|
||||||
ret = (DWORD_PTR)IntGetThreadFocusWindow();
|
ret = (DWORD_PTR)IntGetThreadFocusWindow();
|
||||||
break;
|
break;
|
||||||
case THREADSTATE_CAPTUREWINDOW:
|
case THREADSTATE_CAPTUREWINDOW:
|
||||||
/* FIXME should use UserEnterShared */
|
/* FIXME: Should use UserEnterShared */
|
||||||
ret = (DWORD_PTR)IntGetCapture();
|
ret = (DWORD_PTR)IntGetCapture();
|
||||||
break;
|
break;
|
||||||
case THREADSTATE_PROGMANWINDOW:
|
case THREADSTATE_PROGMANWINDOW:
|
||||||
|
@ -197,7 +197,7 @@ NtUserGetThreadState(
|
||||||
else
|
else
|
||||||
ret = ISMEX_NOTIFY;
|
ret = ISMEX_NOTIFY;
|
||||||
}
|
}
|
||||||
/* if ReplyMessage */
|
/* If ReplyMessage */
|
||||||
if (Message->QS_Flags & QS_SMRESULT) ret |= ISMEX_REPLIED;
|
if (Message->QS_Flags & QS_SMRESULT) ret |= ISMEX_REPLIED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -276,7 +276,7 @@ NtUserGetDoubleClickTime(VOID)
|
||||||
BOOL
|
BOOL
|
||||||
APIENTRY
|
APIENTRY
|
||||||
NtUserGetGUIThreadInfo(
|
NtUserGetGUIThreadInfo(
|
||||||
DWORD idThread, /* if NULL use foreground thread */
|
DWORD idThread, /* If NULL use foreground thread */
|
||||||
LPGUITHREADINFO lpgui)
|
LPGUITHREADINFO lpgui)
|
||||||
{
|
{
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
|
@ -317,7 +317,7 @@ NtUserGetGUIThreadInfo(
|
||||||
Desktop = W32Thread->rpdesk;
|
Desktop = W32Thread->rpdesk;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{ /* get the foreground thread */
|
{ /* Get the foreground thread */
|
||||||
Thread = PsGetCurrentThread();
|
Thread = PsGetCurrentThread();
|
||||||
W32Thread = (PTHREADINFO)Thread->Tcb.Win32Thread;
|
W32Thread = (PTHREADINFO)Thread->Tcb.Win32Thread;
|
||||||
Desktop = W32Thread->rpdesk;
|
Desktop = W32Thread->rpdesk;
|
||||||
|
@ -348,7 +348,7 @@ NtUserGetGUIThreadInfo(
|
||||||
if (MsgQueue->MoveSize)
|
if (MsgQueue->MoveSize)
|
||||||
SafeGui.flags |= GUI_INMOVESIZE;
|
SafeGui.flags |= GUI_INMOVESIZE;
|
||||||
|
|
||||||
/* FIXME add flag GUI_16BITTASK */
|
/* FIXME: Add flag GUI_16BITTASK */
|
||||||
|
|
||||||
SafeGui.hwndActive = MsgQueue->ActiveWindow;
|
SafeGui.hwndActive = MsgQueue->ActiveWindow;
|
||||||
SafeGui.hwndFocus = MsgQueue->FocusWindow;
|
SafeGui.hwndFocus = MsgQueue->FocusWindow;
|
||||||
|
@ -488,7 +488,7 @@ IntSafeCopyUnicodeString(PUNICODE_STRING Dest,
|
||||||
return STATUS_SUCCESS;
|
return STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* string is empty */
|
/* String is empty */
|
||||||
return STATUS_SUCCESS;
|
return STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -531,14 +531,14 @@ IntSafeCopyUnicodeStringTerminateNULL(PUNICODE_STRING Dest,
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* make sure the string is null-terminated */
|
/* Make sure the string is null-terminated */
|
||||||
Src = (PWSTR)((PBYTE)Dest->Buffer + Dest->Length);
|
Src = (PWSTR)((PBYTE)Dest->Buffer + Dest->Length);
|
||||||
*Src = L'\0';
|
*Src = L'\0';
|
||||||
|
|
||||||
return STATUS_SUCCESS;
|
return STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* string is empty */
|
/* String is empty */
|
||||||
return STATUS_SUCCESS;
|
return STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -558,10 +558,10 @@ GetW32ThreadInfo(VOID)
|
||||||
|
|
||||||
if (pti == NULL)
|
if (pti == NULL)
|
||||||
{
|
{
|
||||||
/* FIXME - temporary hack for system threads... */
|
/* FIXME: Temporary hack for system threads... */
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
/* initialize it */
|
/* Initialize it */
|
||||||
pti->ppi = ppi = GetW32ProcessInfo();
|
pti->ppi = ppi = GetW32ProcessInfo();
|
||||||
|
|
||||||
if (pti->rpdesk != NULL)
|
if (pti->rpdesk != NULL)
|
||||||
|
@ -572,7 +572,7 @@ GetW32ThreadInfo(VOID)
|
||||||
{
|
{
|
||||||
pti->pDeskInfo = NULL;
|
pti->pDeskInfo = NULL;
|
||||||
}
|
}
|
||||||
/* update the TEB */
|
/* Update the TEB */
|
||||||
Teb = NtCurrentTeb();
|
Teb = NtCurrentTeb();
|
||||||
pci = GetWin32ClientInfo();
|
pci = GetWin32ClientInfo();
|
||||||
pti->pClientInfo = pci;
|
pti->pClientInfo = pci;
|
||||||
|
@ -613,5 +613,4 @@ GetW32ThreadInfo(VOID)
|
||||||
return pti;
|
return pti;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* EOF */
|
/* EOF */
|
||||||
|
|
|
@ -138,7 +138,7 @@ IntAttachMonitor(IN PDEVOBJ *pGdiDevice,
|
||||||
|
|
||||||
TRACE("Attaching monitor...\n");
|
TRACE("Attaching monitor...\n");
|
||||||
|
|
||||||
/* create new monitor object */
|
/* Create new monitor object */
|
||||||
pMonitor = IntCreateMonitorObject();
|
pMonitor = IntCreateMonitorObject();
|
||||||
if (pMonitor == NULL)
|
if (pMonitor == NULL)
|
||||||
{
|
{
|
||||||
|
@ -565,10 +565,10 @@ NtUserEnumDisplayMonitors(
|
||||||
return 0;
|
return 0;
|
||||||
if (iRgnType == COMPLEXREGION)
|
if (iRgnType == COMPLEXREGION)
|
||||||
{
|
{
|
||||||
/* TODO: warning */
|
/* TODO: Warning */
|
||||||
}
|
}
|
||||||
|
|
||||||
/* if hdc and pRect are given the area of interest is pRect with
|
/* If hdc and pRect are given the area of interest is pRect with
|
||||||
coordinate origin at the DC position */
|
coordinate origin at the DC position */
|
||||||
if (pUnsafeRect != NULL)
|
if (pUnsafeRect != NULL)
|
||||||
{
|
{
|
||||||
|
@ -577,7 +577,7 @@ NtUserEnumDisplayMonitors(
|
||||||
rc.top += DcRect.top;
|
rc.top += DcRect.top;
|
||||||
rc.bottom += DcRect.top;
|
rc.bottom += DcRect.top;
|
||||||
}
|
}
|
||||||
/* if hdc is given and pRect is not the area of interest is the
|
/* If hdc is given and pRect is not the area of interest is the
|
||||||
bounding rect of hdc */
|
bounding rect of hdc */
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -77,7 +77,7 @@ UserProcessMouseInput(PMOUSE_INPUT_DATA mid)
|
||||||
if (mid->ButtonFlags & MOUSE_RIGHT_BUTTON_UP)
|
if (mid->ButtonFlags & MOUSE_RIGHT_BUTTON_UP)
|
||||||
mi.dwFlags |= MOUSEEVENTF_RIGHTUP;
|
mi.dwFlags |= MOUSEEVENTF_RIGHTUP;
|
||||||
|
|
||||||
/* Note: next buttons use mouseData field so they cannot be sent in one call */
|
/* Note: Next buttons use mouseData field so they cannot be sent in one call */
|
||||||
|
|
||||||
/* Button 4 */
|
/* Button 4 */
|
||||||
if (mid->ButtonFlags & MOUSE_BUTTON_4_DOWN)
|
if (mid->ButtonFlags & MOUSE_BUTTON_4_DOWN)
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS Win32k subsystem
|
||||||
* PURPOSE: Message queues
|
* PURPOSE: Message queues
|
||||||
* FILE: subsystems/win32/win32k/ntuser/msgqueue.c
|
* FILE: subsystems/win32/win32k/ntuser/msgqueue.c
|
||||||
* PROGRAMER: Casper S. Hornstrup (chorns@users.sourceforge.net)
|
* PROGRAMER: Casper S. Hornstrup (chorns@users.sourceforge.net)
|
||||||
|
@ -1005,7 +1005,7 @@ co_MsqSendMessage(PUSER_MESSAGE_QUEUE MessageQueue,
|
||||||
|
|
||||||
Timeout.QuadPart = (LONGLONG) uTimeout * (LONGLONG) -10000;
|
Timeout.QuadPart = (LONGLONG) uTimeout * (LONGLONG) -10000;
|
||||||
|
|
||||||
/* FIXME - increase reference counter of sender's message queue here */
|
/* FIXME: Increase reference counter of sender's message queue here */
|
||||||
|
|
||||||
Message->Msg.hwnd = Wnd;
|
Message->Msg.hwnd = Wnd;
|
||||||
Message->Msg.message = Msg;
|
Message->Msg.message = Msg;
|
||||||
|
@ -1025,22 +1025,22 @@ co_MsqSendMessage(PUSER_MESSAGE_QUEUE MessageQueue,
|
||||||
|
|
||||||
IntReferenceMessageQueue(MessageQueue);
|
IntReferenceMessageQueue(MessageQueue);
|
||||||
|
|
||||||
/* add it to the list of pending messages */
|
/* Add it to the list of pending messages */
|
||||||
InsertTailList(&ThreadQueue->DispatchingMessagesHead, &Message->DispatchingListEntry);
|
InsertTailList(&ThreadQueue->DispatchingMessagesHead, &Message->DispatchingListEntry);
|
||||||
|
|
||||||
/* queue it in the destination's message queue */
|
/* Queue it in the destination's message queue */
|
||||||
InsertTailList(&MessageQueue->SentMessagesListHead, &Message->ListEntry);
|
InsertTailList(&MessageQueue->SentMessagesListHead, &Message->ListEntry);
|
||||||
|
|
||||||
Message->QS_Flags = QS_SENDMESSAGE;
|
Message->QS_Flags = QS_SENDMESSAGE;
|
||||||
MsqWakeQueue(MessageQueue, QS_SENDMESSAGE, TRUE);
|
MsqWakeQueue(MessageQueue, QS_SENDMESSAGE, TRUE);
|
||||||
|
|
||||||
/* we can't access the Message anymore since it could have already been deleted! */
|
/* We can't access the Message anymore since it could have already been deleted! */
|
||||||
|
|
||||||
if(Block)
|
if(Block)
|
||||||
{
|
{
|
||||||
UserLeaveCo();
|
UserLeaveCo();
|
||||||
|
|
||||||
/* don't process messages sent to the thread */
|
/* Don't process messages sent to the thread */
|
||||||
WaitStatus = KeWaitForSingleObject(&CompletionEvent, UserRequest, UserMode,
|
WaitStatus = KeWaitForSingleObject(&CompletionEvent, UserRequest, UserMode,
|
||||||
FALSE, (uTimeout ? &Timeout : NULL));
|
FALSE, (uTimeout ? &Timeout : NULL));
|
||||||
|
|
||||||
|
@ -1048,7 +1048,7 @@ co_MsqSendMessage(PUSER_MESSAGE_QUEUE MessageQueue,
|
||||||
|
|
||||||
if(WaitStatus == STATUS_TIMEOUT)
|
if(WaitStatus == STATUS_TIMEOUT)
|
||||||
{
|
{
|
||||||
/* look up if the message has not yet dispatched, if so
|
/* Look up if the message has not yet dispatched, if so
|
||||||
make sure it can't pass a result and it must not set the completion event anymore */
|
make sure it can't pass a result and it must not set the completion event anymore */
|
||||||
Entry = MessageQueue->SentMessagesListHead.Flink;
|
Entry = MessageQueue->SentMessagesListHead.Flink;
|
||||||
while (Entry != &MessageQueue->SentMessagesListHead)
|
while (Entry != &MessageQueue->SentMessagesListHead)
|
||||||
|
@ -1056,7 +1056,7 @@ co_MsqSendMessage(PUSER_MESSAGE_QUEUE MessageQueue,
|
||||||
if ((PUSER_SENT_MESSAGE) CONTAINING_RECORD(Entry, USER_SENT_MESSAGE, ListEntry)
|
if ((PUSER_SENT_MESSAGE) CONTAINING_RECORD(Entry, USER_SENT_MESSAGE, ListEntry)
|
||||||
== Message)
|
== Message)
|
||||||
{
|
{
|
||||||
/* we can access Message here, it's secure because the message queue is locked
|
/* We can access Message here, it's secure because the message queue is locked
|
||||||
and the message is still hasn't been dispatched */
|
and the message is still hasn't been dispatched */
|
||||||
Message->CompletionEvent = NULL;
|
Message->CompletionEvent = NULL;
|
||||||
Message->Result = NULL;
|
Message->Result = NULL;
|
||||||
|
@ -1065,7 +1065,7 @@ co_MsqSendMessage(PUSER_MESSAGE_QUEUE MessageQueue,
|
||||||
Entry = Entry->Flink;
|
Entry = Entry->Flink;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* remove from the local dispatching list so the other thread knows,
|
/* Remove from the local dispatching list so the other thread knows,
|
||||||
it can't pass a result and it must not set the completion event anymore */
|
it can't pass a result and it must not set the completion event anymore */
|
||||||
Entry = ThreadQueue->DispatchingMessagesHead.Flink;
|
Entry = ThreadQueue->DispatchingMessagesHead.Flink;
|
||||||
while (Entry != &ThreadQueue->DispatchingMessagesHead)
|
while (Entry != &ThreadQueue->DispatchingMessagesHead)
|
||||||
|
@ -1073,7 +1073,7 @@ co_MsqSendMessage(PUSER_MESSAGE_QUEUE MessageQueue,
|
||||||
if ((PUSER_SENT_MESSAGE) CONTAINING_RECORD(Entry, USER_SENT_MESSAGE, DispatchingListEntry)
|
if ((PUSER_SENT_MESSAGE) CONTAINING_RECORD(Entry, USER_SENT_MESSAGE, DispatchingListEntry)
|
||||||
== Message)
|
== Message)
|
||||||
{
|
{
|
||||||
/* we can access Message here, it's secure because the sender's message is locked
|
/* We can access Message here, it's secure because the sender's message is locked
|
||||||
and the message has definitely not yet been destroyed, otherwise it would
|
and the message has definitely not yet been destroyed, otherwise it would
|
||||||
have been removed from this list by the dispatching routine right after
|
have been removed from this list by the dispatching routine right after
|
||||||
dispatching the message */
|
dispatching the message */
|
||||||
|
@ -1108,7 +1108,7 @@ co_MsqSendMessage(PUSER_MESSAGE_QUEUE MessageQueue,
|
||||||
|
|
||||||
if(WaitStatus == STATUS_TIMEOUT)
|
if(WaitStatus == STATUS_TIMEOUT)
|
||||||
{
|
{
|
||||||
/* look up if the message has not yet been dispatched, if so
|
/* Look up if the message has not yet been dispatched, if so
|
||||||
make sure it can't pass a result and it must not set the completion event anymore */
|
make sure it can't pass a result and it must not set the completion event anymore */
|
||||||
Entry = MessageQueue->SentMessagesListHead.Flink;
|
Entry = MessageQueue->SentMessagesListHead.Flink;
|
||||||
while (Entry != &MessageQueue->SentMessagesListHead)
|
while (Entry != &MessageQueue->SentMessagesListHead)
|
||||||
|
@ -1116,7 +1116,7 @@ co_MsqSendMessage(PUSER_MESSAGE_QUEUE MessageQueue,
|
||||||
if ((PUSER_SENT_MESSAGE) CONTAINING_RECORD(Entry, USER_SENT_MESSAGE, ListEntry)
|
if ((PUSER_SENT_MESSAGE) CONTAINING_RECORD(Entry, USER_SENT_MESSAGE, ListEntry)
|
||||||
== Message)
|
== Message)
|
||||||
{
|
{
|
||||||
/* we can access Message here, it's secure because the message queue is locked
|
/* We can access Message here, it's secure because the message queue is locked
|
||||||
and the message is still hasn't been dispatched */
|
and the message is still hasn't been dispatched */
|
||||||
Message->CompletionEvent = NULL;
|
Message->CompletionEvent = NULL;
|
||||||
Message->Result = NULL;
|
Message->Result = NULL;
|
||||||
|
@ -1125,7 +1125,7 @@ co_MsqSendMessage(PUSER_MESSAGE_QUEUE MessageQueue,
|
||||||
Entry = Entry->Flink;
|
Entry = Entry->Flink;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* remove from the local dispatching list so the other thread knows,
|
/* Remove from the local dispatching list so the other thread knows,
|
||||||
it can't pass a result and it must not set the completion event anymore */
|
it can't pass a result and it must not set the completion event anymore */
|
||||||
Entry = ThreadQueue->DispatchingMessagesHead.Flink;
|
Entry = ThreadQueue->DispatchingMessagesHead.Flink;
|
||||||
while (Entry != &ThreadQueue->DispatchingMessagesHead)
|
while (Entry != &ThreadQueue->DispatchingMessagesHead)
|
||||||
|
@ -1133,7 +1133,7 @@ co_MsqSendMessage(PUSER_MESSAGE_QUEUE MessageQueue,
|
||||||
if ((PUSER_SENT_MESSAGE) CONTAINING_RECORD(Entry, USER_SENT_MESSAGE, DispatchingListEntry)
|
if ((PUSER_SENT_MESSAGE) CONTAINING_RECORD(Entry, USER_SENT_MESSAGE, DispatchingListEntry)
|
||||||
== Message)
|
== Message)
|
||||||
{
|
{
|
||||||
/* we can access Message here, it's secure because the sender's message is locked
|
/* We can access Message here, it's secure because the sender's message is locked
|
||||||
and the message has definitely not yet been destroyed, otherwise it would
|
and the message has definitely not yet been destroyed, otherwise it would
|
||||||
have been removed from this list by the dispatching routine right after
|
have been removed from this list by the dispatching routine right after
|
||||||
dispatching the message */
|
dispatching the message */
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
/*
|
/*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS Win32k subsystem
|
||||||
* PURPOSE: Native User stubs
|
* PURPOSE: Native User stubs
|
||||||
* FILE: subsys/win32k/ntuser/stubs.c
|
* FILE: subsystems/win32/win32k/ntuser/ntstubs.c
|
||||||
* PROGRAMER: Casper S. Hornstrup (chorns@users.sourceforge.net)
|
* PROGRAMER: Casper S. Hornstrup (chorns@users.sourceforge.net)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -256,7 +256,7 @@ NtUserInitializeClientPfnArrays(
|
||||||
RtlCopyMemory(&gpsi->apfnClientW, pfnClientW, sizeof(PFNCLIENT));
|
RtlCopyMemory(&gpsi->apfnClientW, pfnClientW, sizeof(PFNCLIENT));
|
||||||
RtlCopyMemory(&gpsi->apfnClientWorker, pfnClientWorker, sizeof(PFNCLIENTWORKER));
|
RtlCopyMemory(&gpsi->apfnClientWorker, pfnClientWorker, sizeof(PFNCLIENTWORKER));
|
||||||
|
|
||||||
//// FIXME! HAX! Temporary until server side is finished.
|
//// FIXME: HAX! Temporary until server side is finished.
|
||||||
//// Copy the client side procs for now.
|
//// Copy the client side procs for now.
|
||||||
RtlCopyMemory(&gpsi->aStoCidPfn, pfnClientW, sizeof(gpsi->aStoCidPfn));
|
RtlCopyMemory(&gpsi->aStoCidPfn, pfnClientW, sizeof(gpsi->aStoCidPfn));
|
||||||
|
|
||||||
|
@ -982,7 +982,7 @@ NtUserDrawMenuBarTemp(
|
||||||
HMENU hMenu,
|
HMENU hMenu,
|
||||||
HFONT hFont)
|
HFONT hFont)
|
||||||
{
|
{
|
||||||
/* we'll use this function just for caching the menu bar */
|
/* We'll use this function just for caching the menu bar */
|
||||||
STUB
|
STUB
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -49,7 +49,7 @@ __inline static PUSER_HANDLE_ENTRY alloc_user_entry(PUSER_HANDLE_TABLE ht)
|
||||||
return entry;
|
return entry;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ht->nb_handles >= ht->allocated_handles) /* need to grow the array */
|
if (ht->nb_handles >= ht->allocated_handles) /* Need to grow the array */
|
||||||
{
|
{
|
||||||
/**/
|
/**/
|
||||||
int i, iFree = 0, iWindow = 0, iMenu = 0, iCursorIcon = 0,
|
int i, iFree = 0, iWindow = 0, iMenu = 0, iCursorIcon = 0,
|
||||||
|
@ -103,7 +103,7 @@ __inline static PUSER_HANDLE_ENTRY alloc_user_entry(PUSER_HANDLE_TABLE ht)
|
||||||
return NULL;
|
return NULL;
|
||||||
#if 0
|
#if 0
|
||||||
PUSER_HANDLE_ENTRY new_handles;
|
PUSER_HANDLE_ENTRY new_handles;
|
||||||
/* grow array by 50% (but at minimum 32 entries) */
|
/* Grow array by 50% (but at minimum 32 entries) */
|
||||||
int growth = max( 32, ht->allocated_handles / 2 );
|
int growth = max( 32, ht->allocated_handles / 2 );
|
||||||
int new_size = min( ht->allocated_handles + growth, (LAST_USER_HANDLE-FIRST_USER_HANDLE+1) >> 1 );
|
int new_size = min( ht->allocated_handles + growth, (LAST_USER_HANDLE-FIRST_USER_HANDLE+1) >> 1 );
|
||||||
if (new_size <= ht->allocated_handles)
|
if (new_size <= ht->allocated_handles)
|
||||||
|
@ -219,7 +219,7 @@ PVOID UserGetObject(PUSER_HANDLE_TABLE ht, HANDLE handle, USER_OBJECT_TYPE type
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* get the full handle (32bit) for a possibly truncated (16bit) handle */
|
/* Get the full handle (32bit) for a possibly truncated (16bit) handle */
|
||||||
HANDLE get_user_full_handle(PUSER_HANDLE_TABLE ht, HANDLE handle )
|
HANDLE get_user_full_handle(PUSER_HANDLE_TABLE ht, HANDLE handle )
|
||||||
{
|
{
|
||||||
PUSER_HANDLE_ENTRY entry;
|
PUSER_HANDLE_ENTRY entry;
|
||||||
|
@ -232,7 +232,7 @@ HANDLE get_user_full_handle(PUSER_HANDLE_TABLE ht, HANDLE handle )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* same as get_user_object plus set the handle to the full 32-bit value */
|
/* Same as get_user_object plus set the handle to the full 32-bit value */
|
||||||
void *get_user_object_handle(PUSER_HANDLE_TABLE ht, HANDLE* handle, USER_OBJECT_TYPE type )
|
void *get_user_object_handle(PUSER_HANDLE_TABLE ht, HANDLE* handle, USER_OBJECT_TYPE type )
|
||||||
{
|
{
|
||||||
PUSER_HANDLE_ENTRY entry;
|
PUSER_HANDLE_ENTRY entry;
|
||||||
|
@ -250,7 +250,7 @@ BOOL FASTCALL UserCreateHandleTable(VOID)
|
||||||
|
|
||||||
PVOID mem;
|
PVOID mem;
|
||||||
|
|
||||||
//FIXME: dont alloc all at once! must be mapped into umode also...
|
// FIXME: Don't alloc all at once! Must be mapped into umode also...
|
||||||
mem = UserHeapAlloc(sizeof(USER_HANDLE_ENTRY) * 1024*2);
|
mem = UserHeapAlloc(sizeof(USER_HANDLE_ENTRY) * 1024*2);
|
||||||
if (!mem)
|
if (!mem)
|
||||||
{
|
{
|
||||||
|
@ -266,7 +266,7 @@ BOOL FASTCALL UserCreateHandleTable(VOID)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
//FIXME: make auto growable
|
// FIXME: Make auto growable
|
||||||
UserInitHandleTable(gHandleTable, mem, sizeof(USER_HANDLE_ENTRY) * 1024*2);
|
UserInitHandleTable(gHandleTable, mem, sizeof(USER_HANDLE_ENTRY) * 1024*2);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
@ -353,7 +353,7 @@ UserCreateObject( PUSER_HANDLE_TABLE ht,
|
||||||
}
|
}
|
||||||
/* Now set default headers. */
|
/* Now set default headers. */
|
||||||
((PHEAD)Object)->h = hi;
|
((PHEAD)Object)->h = hi;
|
||||||
((PHEAD)Object)->cLockObj = 2; // we need this, because we create 2 refs: handle and pointer!
|
((PHEAD)Object)->cLockObj = 2; // We need this, because we create 2 refs: handle and pointer!
|
||||||
|
|
||||||
if (h)
|
if (h)
|
||||||
*h = hi;
|
*h = hi;
|
||||||
|
@ -376,10 +376,10 @@ UserDereferenceObject(PVOID object)
|
||||||
|
|
||||||
if (!entry)
|
if (!entry)
|
||||||
{
|
{
|
||||||
ERR("warning! Dereference Object without ENTRY! Obj -> 0x%x\n", object);
|
ERR("Warning! Dereference Object without ENTRY! Obj -> 0x%x\n", object);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
TRACE("warning! Dereference to zero! Obj -> 0x%x\n", object);
|
TRACE("Warning! Dereference to zero! Obj -> 0x%x\n", object);
|
||||||
|
|
||||||
((PHEAD)object)->cLockObj = 0;
|
((PHEAD)object)->cLockObj = 0;
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS Win32k subsystem
|
||||||
* PURPOSE: Window painting function
|
* PURPOSE: Window painting function
|
||||||
* FILE: subsystems/win32/win32k/ntuser/painting.c
|
* FILE: subsystems/win32/win32k/ntuser/painting.c
|
||||||
* PROGRAMER: Filip Navara (xnavara@volny.cz)
|
* PROGRAMER: Filip Navara (xnavara@volny.cz)
|
||||||
|
@ -697,7 +697,7 @@ co_IntFixCaret(PWND Window, RECTL *lprc, UINT flags)
|
||||||
|
|
||||||
WndCaret = UserGetWindowObject(hWndCaret);
|
WndCaret = UserGetWindowObject(hWndCaret);
|
||||||
|
|
||||||
//fix: check for WndCaret can be null
|
// FIXME: Check for WndCaret can be NULL
|
||||||
if (WndCaret == Window ||
|
if (WndCaret == Window ||
|
||||||
((flags & SW_SCROLLCHILDREN) && IntIsChildWindow(Window, WndCaret)))
|
((flags & SW_SCROLLCHILDREN) && IntIsChildWindow(Window, WndCaret)))
|
||||||
{
|
{
|
||||||
|
|
|
@ -100,7 +100,7 @@ NtUserBuildPropList(HWND hWnd,
|
||||||
RETURN( STATUS_INVALID_PARAMETER);
|
RETURN( STATUS_INVALID_PARAMETER);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* copy list */
|
/* Copy list */
|
||||||
li = (PROPLISTITEM *)Buffer;
|
li = (PROPLISTITEM *)Buffer;
|
||||||
ListEntry = Window->PropListHead.Flink;
|
ListEntry = Window->PropListHead.Flink;
|
||||||
while((BufferSize >= sizeof(PROPLISTITEM)) && (ListEntry != &Window->PropListHead))
|
while((BufferSize >= sizeof(PROPLISTITEM)) && (ListEntry != &Window->PropListHead))
|
||||||
|
|
|
@ -18,12 +18,12 @@ DBG_DEFAULT_CHANNEL(UserScrollbar);
|
||||||
#define SA_SSI_REFRESH 0x0004
|
#define SA_SSI_REFRESH 0x0004
|
||||||
#define SA_SSI_REPAINT_ARROWS 0x0008
|
#define SA_SSI_REPAINT_ARROWS 0x0008
|
||||||
|
|
||||||
#define SBRG_SCROLLBAR 0 /* the scrollbar itself */
|
#define SBRG_SCROLLBAR 0 /* The scrollbar itself */
|
||||||
#define SBRG_TOPRIGHTBTN 1 /* the top or right button */
|
#define SBRG_TOPRIGHTBTN 1 /* The top or right button */
|
||||||
#define SBRG_PAGEUPRIGHT 2 /* the page up or page right region */
|
#define SBRG_PAGEUPRIGHT 2 /* The page up or page right region */
|
||||||
#define SBRG_SCROLLBOX 3 /* the scroll box */
|
#define SBRG_SCROLLBOX 3 /* The scroll box */
|
||||||
#define SBRG_PAGEDOWNLEFT 4 /* the page down or page left region */
|
#define SBRG_PAGEDOWNLEFT 4 /* The page down or page left region */
|
||||||
#define SBRG_BOTTOMLEFTBTN 5 /* the bottom or left button */
|
#define SBRG_BOTTOMLEFTBTN 5 /* The bottom or left button */
|
||||||
|
|
||||||
#define CHANGERGSTATE(item, status) \
|
#define CHANGERGSTATE(item, status) \
|
||||||
if(Info->rgstate[(item)] != (status)) \
|
if(Info->rgstate[(item)] != (status)) \
|
||||||
|
@ -117,7 +117,7 @@ IntCalculateThumb(PWND Wnd, LONG idObject, PSCROLLBARINFO psbi, LPSCROLLINFO psi
|
||||||
}
|
}
|
||||||
|
|
||||||
ThumbPos = Thumb;
|
ThumbPos = Thumb;
|
||||||
/* calculate Thumb */
|
/* Calculate Thumb */
|
||||||
if(cxy <= (2 * Thumb))
|
if(cxy <= (2 * Thumb))
|
||||||
{
|
{
|
||||||
Thumb = cxy / 2;
|
Thumb = cxy / 2;
|
||||||
|
@ -288,7 +288,7 @@ co_IntSetScrollInfo(PWND Window, INT nBar, LPCSCROLLINFO lpsi, BOOL bRedraw)
|
||||||
PSCROLLBARINFO psbi;
|
PSCROLLBARINFO psbi;
|
||||||
UINT new_flags;
|
UINT new_flags;
|
||||||
INT action = 0;
|
INT action = 0;
|
||||||
BOOL bChangeParams = FALSE; /* don't show/hide scrollbar if params don't change */
|
BOOL bChangeParams = FALSE; /* Don't show/hide scrollbar if params don't change */
|
||||||
|
|
||||||
ASSERT_REFS_CO(Window);
|
ASSERT_REFS_CO(Window);
|
||||||
|
|
||||||
|
@ -412,7 +412,7 @@ co_IntSetScrollInfo(PWND Window, INT nBar, LPCSCROLLINFO lpsi, BOOL bRedraw)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Window->pSBInfo->WSBflags != new_flags) /* check arrow flags */
|
if (Window->pSBInfo->WSBflags != new_flags) /* Check arrow flags */
|
||||||
{
|
{
|
||||||
Window->pSBInfo->WSBflags = new_flags;
|
Window->pSBInfo->WSBflags = new_flags;
|
||||||
action |= SA_SSI_REPAINT_ARROWS;
|
action |= SA_SSI_REPAINT_ARROWS;
|
||||||
|
@ -497,11 +497,11 @@ co_IntCreateScrollBars(PWND Window)
|
||||||
|
|
||||||
if (Window->pSBInfo && Window->pSBInfoex)
|
if (Window->pSBInfo && Window->pSBInfoex)
|
||||||
{
|
{
|
||||||
/* no need to create it anymore */
|
/* No need to create it anymore */
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* allocate memory for all scrollbars (HORZ, VERT, CONTROL) */
|
/* Allocate memory for all scrollbars (HORZ, VERT, CONTROL) */
|
||||||
Size = 3 * (sizeof(SBINFOEX));
|
Size = 3 * (sizeof(SBINFOEX));
|
||||||
if(!(Window->pSBInfoex = ExAllocatePoolWithTag(PagedPool, Size, TAG_SBARINFO)))
|
if(!(Window->pSBInfoex = ExAllocatePoolWithTag(PagedPool, Size, TAG_SBARINFO)))
|
||||||
{
|
{
|
||||||
|
@ -617,7 +617,7 @@ co_UserShowScrollBar(PWND Wnd, int nBar, BOOL fShowH, BOOL fShowV)
|
||||||
if (fShowH) set_bits |= WS_HSCROLL;
|
if (fShowH) set_bits |= WS_HSCROLL;
|
||||||
else clear_bits |= WS_HSCROLL;
|
else clear_bits |= WS_HSCROLL;
|
||||||
if( nBar == SB_HORZ ) break;
|
if( nBar == SB_HORZ ) break;
|
||||||
/* fall through */
|
/* Fall through */
|
||||||
case SB_VERT:
|
case SB_VERT:
|
||||||
if (fShowV) set_bits |= WS_VSCROLL;
|
if (fShowV) set_bits |= WS_VSCROLL;
|
||||||
else clear_bits |= WS_VSCROLL;
|
else clear_bits |= WS_VSCROLL;
|
||||||
|
@ -806,7 +806,7 @@ NtUserEnableScrollBar(
|
||||||
{
|
{
|
||||||
case SB_BOTH:
|
case SB_BOTH:
|
||||||
InfoV = IntGetScrollbarInfoFromWindow(Window, SB_VERT);
|
InfoV = IntGetScrollbarInfoFromWindow(Window, SB_VERT);
|
||||||
/* fall through */
|
/* Fall through */
|
||||||
case SB_HORZ:
|
case SB_HORZ:
|
||||||
InfoH = IntGetScrollbarInfoFromWindow(Window, SB_HORZ);
|
InfoH = IntGetScrollbarInfoFromWindow(Window, SB_HORZ);
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -2,14 +2,14 @@
|
||||||
* COPYRIGHT: GPL, see COPYING in the top level directory
|
* COPYRIGHT: GPL, see COPYING in the top level directory
|
||||||
* PROJECT: ReactOS win32 kernel mode subsystem server
|
* PROJECT: ReactOS win32 kernel mode subsystem server
|
||||||
* PURPOSE: System parameters functions
|
* PURPOSE: System parameters functions
|
||||||
* FILE: subsystem/win32/win32k/ntuser/sysparams.c
|
* FILE: subsystems/win32/win32k/ntuser/sysparams.c
|
||||||
* PROGRAMER: Timo Kreuzer (timo.kreuzer@reactos.org)
|
* PROGRAMER: Timo Kreuzer (timo.kreuzer@reactos.org)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// TODO:
|
// TODO:
|
||||||
// - check all values that are in Winsta in ros
|
// - Check all values that are in Winsta in ROS.
|
||||||
// - does setting invalid fonts work?
|
// - Does setting invalid fonts work?
|
||||||
// - save appropriate text metrics
|
// - Save appropriate text metrics.
|
||||||
|
|
||||||
#include <win32k.h>
|
#include <win32k.h>
|
||||||
DBG_DEFAULT_CHANNEL(UserSysparams);
|
DBG_DEFAULT_CHANNEL(UserSysparams);
|
||||||
|
@ -189,7 +189,7 @@ SpiFixupValues()
|
||||||
// gspv.tmMenuFont.tmExternalLeading);
|
// gspv.tmMenuFont.tmExternalLeading);
|
||||||
if (gspv.iDblClickTime == 0) gspv.iDblClickTime = 500;
|
if (gspv.iDblClickTime == 0) gspv.iDblClickTime = 500;
|
||||||
|
|
||||||
// FIXME: hack!!!
|
// FIXME: Hack!!!
|
||||||
gspv.tmMenuFont.tmHeight = 11;
|
gspv.tmMenuFont.tmHeight = 11;
|
||||||
gspv.tmMenuFont.tmExternalLeading = 2;
|
gspv.tmMenuFont.tmExternalLeading = 2;
|
||||||
|
|
||||||
|
@ -948,7 +948,7 @@ SpiGetSet(UINT uiAction, UINT uiParam, PVOID pvParam, FLONG fl)
|
||||||
|
|
||||||
case SPI_SETWORKAREA:
|
case SPI_SETWORKAREA:
|
||||||
{
|
{
|
||||||
/*FIXME: we should set the work area of the monitor
|
/* FIXME: We should set the work area of the monitor
|
||||||
that contains the specified rectangle */
|
that contains the specified rectangle */
|
||||||
PMONITOR pmonitor = IntGetPrimaryMonitor();
|
PMONITOR pmonitor = IntGetPrimaryMonitor();
|
||||||
RECT rcWorkArea;
|
RECT rcWorkArea;
|
||||||
|
@ -971,7 +971,7 @@ SpiGetSet(UINT uiAction, UINT uiParam, PVOID pvParam, FLONG fl)
|
||||||
pmonitor->rcWork = rcWorkArea;
|
pmonitor->rcWork = rcWorkArea;
|
||||||
if (fl & SPIF_UPDATEINIFILE)
|
if (fl & SPIF_UPDATEINIFILE)
|
||||||
{
|
{
|
||||||
// FIXME: what to do?
|
// FIXME: What to do?
|
||||||
}
|
}
|
||||||
return (UINT_PTR)KEY_DESKTOP;
|
return (UINT_PTR)KEY_DESKTOP;
|
||||||
}
|
}
|
||||||
|
@ -988,7 +988,7 @@ SpiGetSet(UINT uiAction, UINT uiParam, PVOID pvParam, FLONG fl)
|
||||||
return 0;
|
return 0;
|
||||||
if (fl & SPIF_UPDATEINIFILE)
|
if (fl & SPIF_UPDATEINIFILE)
|
||||||
{
|
{
|
||||||
// FIXME: what to do?
|
// FIXME: What to do?
|
||||||
}
|
}
|
||||||
return (UINT_PTR)KEY_DESKTOP;
|
return (UINT_PTR)KEY_DESKTOP;
|
||||||
|
|
||||||
|
@ -1000,7 +1000,7 @@ SpiGetSet(UINT uiAction, UINT uiParam, PVOID pvParam, FLONG fl)
|
||||||
return 0;
|
return 0;
|
||||||
if (fl & SPIF_UPDATEINIFILE)
|
if (fl & SPIF_UPDATEINIFILE)
|
||||||
{
|
{
|
||||||
// FIXME: what to do?
|
// FIXME: What to do?
|
||||||
}
|
}
|
||||||
return (UINT_PTR)KEY_DESKTOP;
|
return (UINT_PTR)KEY_DESKTOP;
|
||||||
|
|
||||||
|
@ -1012,7 +1012,7 @@ SpiGetSet(UINT uiAction, UINT uiParam, PVOID pvParam, FLONG fl)
|
||||||
return 0;
|
return 0;
|
||||||
if (fl & SPIF_UPDATEINIFILE)
|
if (fl & SPIF_UPDATEINIFILE)
|
||||||
{
|
{
|
||||||
// FIXME: what to do?
|
// FIXME: What to do?
|
||||||
}
|
}
|
||||||
return (UINT_PTR)KEY_DESKTOP;
|
return (UINT_PTR)KEY_DESKTOP;
|
||||||
|
|
||||||
|
@ -1032,7 +1032,7 @@ SpiGetSet(UINT uiAction, UINT uiParam, PVOID pvParam, FLONG fl)
|
||||||
return 0;
|
return 0;
|
||||||
if (fl & SPIF_UPDATEINIFILE)
|
if (fl & SPIF_UPDATEINIFILE)
|
||||||
{
|
{
|
||||||
// FIXME: what to do?
|
// FIXME: What to do?
|
||||||
}
|
}
|
||||||
return (UINT_PTR)KEY_DESKTOP;
|
return (UINT_PTR)KEY_DESKTOP;
|
||||||
|
|
||||||
|
@ -1046,7 +1046,7 @@ SpiGetSet(UINT uiAction, UINT uiParam, PVOID pvParam, FLONG fl)
|
||||||
return 0;
|
return 0;
|
||||||
if (fl & SPIF_UPDATEINIFILE)
|
if (fl & SPIF_UPDATEINIFILE)
|
||||||
{
|
{
|
||||||
// FIXME: what to do?
|
// FIXME: What to do?
|
||||||
}
|
}
|
||||||
return (UINT_PTR)KEY_DESKTOP;
|
return (UINT_PTR)KEY_DESKTOP;
|
||||||
|
|
||||||
|
@ -1058,7 +1058,7 @@ SpiGetSet(UINT uiAction, UINT uiParam, PVOID pvParam, FLONG fl)
|
||||||
return 0;
|
return 0;
|
||||||
if (fl & SPIF_UPDATEINIFILE)
|
if (fl & SPIF_UPDATEINIFILE)
|
||||||
{
|
{
|
||||||
// FIXME: what to do?
|
// FIXME: What to do?
|
||||||
}
|
}
|
||||||
return (UINT_PTR)KEY_DESKTOP;
|
return (UINT_PTR)KEY_DESKTOP;
|
||||||
|
|
||||||
|
@ -1070,7 +1070,7 @@ SpiGetSet(UINT uiAction, UINT uiParam, PVOID pvParam, FLONG fl)
|
||||||
return 0;
|
return 0;
|
||||||
if (fl & SPIF_UPDATEINIFILE)
|
if (fl & SPIF_UPDATEINIFILE)
|
||||||
{
|
{
|
||||||
// FIXME: what to do?
|
// FIXME: What to do?
|
||||||
}
|
}
|
||||||
return (UINT_PTR)KEY_DESKTOP;
|
return (UINT_PTR)KEY_DESKTOP;
|
||||||
|
|
||||||
|
@ -1082,7 +1082,7 @@ SpiGetSet(UINT uiAction, UINT uiParam, PVOID pvParam, FLONG fl)
|
||||||
return 0;
|
return 0;
|
||||||
if (fl & SPIF_UPDATEINIFILE)
|
if (fl & SPIF_UPDATEINIFILE)
|
||||||
{
|
{
|
||||||
// FIXME: what to do?
|
// FIXME: What to do?
|
||||||
}
|
}
|
||||||
return (UINT_PTR)KEY_DESKTOP;
|
return (UINT_PTR)KEY_DESKTOP;
|
||||||
|
|
||||||
|
@ -1106,7 +1106,7 @@ SpiGetSet(UINT uiAction, UINT uiParam, PVOID pvParam, FLONG fl)
|
||||||
return 0;
|
return 0;
|
||||||
if (fl & SPIF_UPDATEINIFILE)
|
if (fl & SPIF_UPDATEINIFILE)
|
||||||
{
|
{
|
||||||
// FIXME: what to do?
|
// FIXME: What to do?
|
||||||
}
|
}
|
||||||
return (UINT_PTR)KEY_DESKTOP;
|
return (UINT_PTR)KEY_DESKTOP;
|
||||||
|
|
||||||
|
@ -1215,7 +1215,7 @@ SpiGetSet(UINT uiAction, UINT uiParam, PVOID pvParam, FLONG fl)
|
||||||
return SpiGetInt(pvParam, &gspv.iMouseHoverTime, fl);
|
return SpiGetInt(pvParam, &gspv.iMouseHoverTime, fl);
|
||||||
|
|
||||||
case SPI_SETMOUSEHOVERTIME:
|
case SPI_SETMOUSEHOVERTIME:
|
||||||
/* see http://msdn2.microsoft.com/en-us/library/ms724947.aspx
|
/* See http://msdn2.microsoft.com/en-us/library/ms724947.aspx
|
||||||
* copy text from it, if some agument why xp and 2003 behovir diffent
|
* copy text from it, if some agument why xp and 2003 behovir diffent
|
||||||
* only if they do not have SP install
|
* only if they do not have SP install
|
||||||
* " Windows Server 2003 and Windows XP: The operating system does not
|
* " Windows Server 2003 and Windows XP: The operating system does not
|
||||||
|
@ -1597,7 +1597,7 @@ NtUserSystemParametersInfo(
|
||||||
TRACE("Enter NtUserSystemParametersInfo(%d)\n", uiAction);
|
TRACE("Enter NtUserSystemParametersInfo(%d)\n", uiAction);
|
||||||
UserEnterExclusive();
|
UserEnterExclusive();
|
||||||
|
|
||||||
// FIXME: get rid of the flags and only use this from um. kernel can access data directly.
|
// FIXME: Get rid of the flags and only use this from um. kernel can access data directly.
|
||||||
/* Set UM memory protection flag */
|
/* Set UM memory protection flag */
|
||||||
fWinIni |= SPIF_PROTECT;
|
fWinIni |= SPIF_PROTECT;
|
||||||
|
|
||||||
|
@ -1609,3 +1609,5 @@ NtUserSystemParametersInfo(
|
||||||
|
|
||||||
return bResult;
|
return bResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* EOF */
|
||||||
|
|
|
@ -598,7 +598,7 @@ InitTimerImpl(VOID)
|
||||||
WindowLessTimersBitMapBuffer,
|
WindowLessTimersBitMapBuffer,
|
||||||
BitmapBytes * 8);
|
BitmapBytes * 8);
|
||||||
|
|
||||||
/* yes we need this, since ExAllocatePoolWithTag isn't supposed to zero out allocated memory */
|
/* Yes we need this, since ExAllocatePoolWithTag isn't supposed to zero out allocated memory */
|
||||||
RtlClearAllBits(&WindowLessTimersBitMap);
|
RtlClearAllBits(&WindowLessTimersBitMap);
|
||||||
|
|
||||||
ExInitializeResourceLite(&TimerLock);
|
ExInitializeResourceLite(&TimerLock);
|
||||||
|
@ -695,5 +695,4 @@ NtUserValidateTimerCallback(
|
||||||
return Ret;
|
return Ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* EOF */
|
/* EOF */
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
/*
|
/*
|
||||||
* PROJECT: ReactOS Kernel
|
* PROJECT: ReactOS Win32k subsystem
|
||||||
* LICENSE: GPL - See COPYING in the top level directory
|
* LICENSE: GPL - See COPYING in the top level directory
|
||||||
* FILE: subsystems/win32/win32k/ntuser/windc.c
|
* FILE: subsystems/win32/win32k/ntuser/windc.c
|
||||||
* PURPOSE: Window DC management
|
* PURPOSE: Window DC management
|
||||||
* COPYRIGHT: Copyright 2007 ReactOS
|
* COPYRIGHT: Copyright 2007 ReactOS Team
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <win32k.h>
|
#include <win32k.h>
|
||||||
|
@ -11,7 +11,7 @@ DBG_DEFAULT_CHANNEL(UserDce);
|
||||||
|
|
||||||
/* GLOBALS *******************************************************************/
|
/* GLOBALS *******************************************************************/
|
||||||
|
|
||||||
/* NOTE - I think we should store this per window station (including gdi objects) */
|
/* NOTE: I think we should store this per window station (including GDI objects) */
|
||||||
/* Answer: No, use the DCE pMonitor to compare with! */
|
/* Answer: No, use the DCE pMonitor to compare with! */
|
||||||
|
|
||||||
static LIST_ENTRY LEDce;
|
static LIST_ENTRY LEDce;
|
||||||
|
@ -178,7 +178,7 @@ DceDeleteClipRgn(DCE* Dce)
|
||||||
|
|
||||||
Dce->hrgnClip = NULL;
|
Dce->hrgnClip = NULL;
|
||||||
|
|
||||||
/* make it dirty so that the vis rgn gets recomputed next time */
|
/* Make it dirty so that the vis rgn gets recomputed next time */
|
||||||
Dce->DCXFlags |= DCX_DCEDIRTY;
|
Dce->DCXFlags |= DCX_DCEDIRTY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -190,7 +190,7 @@ DceReleaseDC(DCE* dce, BOOL EndPaint)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* restore previous visible region */
|
/* Restore previous visible region */
|
||||||
if ((dce->DCXFlags & (DCX_INTERSECTRGN | DCX_EXCLUDERGN)) &&
|
if ((dce->DCXFlags & (DCX_INTERSECTRGN | DCX_EXCLUDERGN)) &&
|
||||||
((dce->DCXFlags & DCX_CACHE) || EndPaint))
|
((dce->DCXFlags & DCX_CACHE) || EndPaint))
|
||||||
{
|
{
|
||||||
|
@ -201,7 +201,7 @@ DceReleaseDC(DCE* dce, BOOL EndPaint)
|
||||||
{
|
{
|
||||||
if (!(dce->DCXFlags & DCX_NORESETATTRS))
|
if (!(dce->DCXFlags & DCX_NORESETATTRS))
|
||||||
{
|
{
|
||||||
/* make the DC clean so that SetDCState doesn't try to update the vis rgn */
|
/* Make the DC clean so that SetDCState doesn't try to update the vis rgn */
|
||||||
IntGdiSetHookFlags(dce->hDC, DCHF_VALIDATEVISRGN);
|
IntGdiSetHookFlags(dce->hDC, DCHF_VALIDATEVISRGN);
|
||||||
|
|
||||||
// Clean the DC
|
// Clean the DC
|
||||||
|
@ -209,7 +209,7 @@ DceReleaseDC(DCE* dce, BOOL EndPaint)
|
||||||
|
|
||||||
if (dce->DCXFlags & DCX_DCEDIRTY)
|
if (dce->DCXFlags & DCX_DCEDIRTY)
|
||||||
{
|
{
|
||||||
/* don't keep around invalidated entries
|
/* Don't keep around invalidated entries
|
||||||
* because SetDCState() disables hVisRgn updates
|
* because SetDCState() disables hVisRgn updates
|
||||||
* by removing dirty bit. */
|
* by removing dirty bit. */
|
||||||
dce->hwndCurrent = 0;
|
dce->hwndCurrent = 0;
|
||||||
|
@ -349,7 +349,7 @@ UserGetDCEx(PWND Wnd OPTIONAL, HANDLE ClipRegion, ULONG Flags)
|
||||||
if (Flags & DCX_USESTYLE)
|
if (Flags & DCX_USESTYLE)
|
||||||
{
|
{
|
||||||
Flags &= ~(DCX_CLIPCHILDREN | DCX_CLIPSIBLINGS | DCX_PARENTCLIP);
|
Flags &= ~(DCX_CLIPCHILDREN | DCX_CLIPSIBLINGS | DCX_PARENTCLIP);
|
||||||
if (!(Flags & DCX_WINDOW)) // not window rectangle
|
if (!(Flags & DCX_WINDOW)) // Not window rectangle
|
||||||
{
|
{
|
||||||
if (Wnd->pcls->style & CS_PARENTDC)
|
if (Wnd->pcls->style & CS_PARENTDC)
|
||||||
{
|
{
|
||||||
|
@ -414,7 +414,7 @@ UserGetDCEx(PWND Wnd OPTIONAL, HANDLE ClipRegion, ULONG Flags)
|
||||||
Flags |= DCX_CLIPSIBLINGS;
|
Flags |= DCX_CLIPSIBLINGS;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* it seems parent clip is ignored when clipping siblings or children */
|
/* It seems parent clip is ignored when clipping siblings or children */
|
||||||
if (Flags & (DCX_CLIPSIBLINGS | DCX_CLIPCHILDREN)) Flags &= ~DCX_PARENTCLIP;
|
if (Flags & (DCX_CLIPSIBLINGS | DCX_CLIPCHILDREN)) Flags &= ~DCX_PARENTCLIP;
|
||||||
|
|
||||||
if (Flags & DCX_PARENTCLIP)
|
if (Flags & DCX_PARENTCLIP)
|
||||||
|
@ -525,11 +525,11 @@ UserGetDCEx(PWND Wnd OPTIONAL, HANDLE ClipRegion, ULONG Flags)
|
||||||
Dce->DCXFlags = Flags | DCX_DCEBUSY;
|
Dce->DCXFlags = Flags | DCX_DCEBUSY;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Bump it up! This prevents the random errors in wine dce tests and with
|
* Bump it up! This prevents the random errors in wine dce tests and with
|
||||||
proper bits set in DCX_CACHECOMPAREMASK.
|
* proper bits set in DCX_CACHECOMPAREMASK.
|
||||||
Reference:
|
* Reference:
|
||||||
http://www.reactos.org/archives/public/ros-dev/2008-July/010498.html
|
* http://www.reactos.org/archives/public/ros-dev/2008-July/010498.html
|
||||||
http://www.reactos.org/archives/public/ros-dev/2008-July/010499.html
|
* http://www.reactos.org/archives/public/ros-dev/2008-July/010499.html
|
||||||
*/
|
*/
|
||||||
if (pLE != &LEDce)
|
if (pLE != &LEDce)
|
||||||
{
|
{
|
||||||
|
@ -619,7 +619,7 @@ DceFreeDCE(PDCE pdce, BOOLEAN Force)
|
||||||
GreGetObjectOwner(pdce->hDC) != GDI_OBJ_HMGR_POWNED)
|
GreGetObjectOwner(pdce->hDC) != GDI_OBJ_HMGR_POWNED)
|
||||||
{
|
{
|
||||||
TRACE("Change ownership for DCE! -> %x\n" , pdce);
|
TRACE("Change ownership for DCE! -> %x\n" , pdce);
|
||||||
// Note: Windows sets W32PF_OWNDCCLEANUP and moves on.
|
// NOTE: Windows sets W32PF_OWNDCCLEANUP and moves on.
|
||||||
if (GreIsHandleValid(pdce->hDC))
|
if (GreIsHandleValid(pdce->hDC))
|
||||||
{
|
{
|
||||||
GreSetDCOwner(pdce->hDC, GDI_OBJ_HMGR_POWNED);
|
GreSetDCOwner(pdce->hDC, GDI_OBJ_HMGR_POWNED);
|
||||||
|
@ -694,7 +694,7 @@ DceFreeWindowDCE(PWND Window)
|
||||||
if ( pDCE->hwndCurrent == Window->head.h &&
|
if ( pDCE->hwndCurrent == Window->head.h &&
|
||||||
!(pDCE->DCXFlags & DCX_DCEEMPTY) )
|
!(pDCE->DCXFlags & DCX_DCEEMPTY) )
|
||||||
{
|
{
|
||||||
if (!(pDCE->DCXFlags & DCX_CACHE)) /* owned or Class DCE*/
|
if (!(pDCE->DCXFlags & DCX_CACHE)) /* Owned or Class DCE */
|
||||||
{
|
{
|
||||||
if (Window->pcls->style & CS_CLASSDC) /* Test Class first */
|
if (Window->pcls->style & CS_CLASSDC) /* Test Class first */
|
||||||
{
|
{
|
||||||
|
@ -714,7 +714,7 @@ DceFreeWindowDCE(PWND Window)
|
||||||
}
|
}
|
||||||
/* Do not change owner so thread can clean up! */
|
/* Do not change owner so thread can clean up! */
|
||||||
}
|
}
|
||||||
else if (Window->pcls->style & CS_OWNDC) /* owned DCE*/
|
else if (Window->pcls->style & CS_OWNDC) /* Owned DCE */
|
||||||
{
|
{
|
||||||
pDCE = DceFreeDCE(pDCE, FALSE);
|
pDCE = DceFreeDCE(pDCE, FALSE);
|
||||||
if (!pDCE) break;
|
if (!pDCE) break;
|
||||||
|
@ -728,7 +728,7 @@ DceFreeWindowDCE(PWND Window)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (pDCE->DCXFlags & DCX_DCEBUSY) /* shared cache DCE */
|
if (pDCE->DCXFlags & DCX_DCEBUSY) /* Shared cache DCE */
|
||||||
{
|
{
|
||||||
/* FIXME: AFAICS we are doing the right thing here so
|
/* FIXME: AFAICS we are doing the right thing here so
|
||||||
* this should be a TRACE. But this is best left as an ERR
|
* this should be a TRACE. But this is best left as an ERR
|
||||||
|
@ -1063,5 +1063,4 @@ NtUserSelectPalette(HDC hDC,
|
||||||
return oldPal;
|
return oldPal;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* EOF */
|
/* EOF */
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS Win32k subsystem
|
||||||
* PURPOSE: Windows
|
* PURPOSE: Windows
|
||||||
* FILE: subsystems/win32/win32k/ntuser/window.c
|
* FILE: subsystems/win32/win32k/ntuser/window.c
|
||||||
* PROGRAMER: Casper S. Hornstrup (chorns@users.sourceforge.net)
|
* PROGRAMER: Casper S. Hornstrup (chorns@users.sourceforge.net)
|
||||||
|
@ -59,7 +59,7 @@ PWND FASTCALL IntGetWindowObject(HWND hWnd)
|
||||||
return Window;
|
return Window;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* temp hack */
|
/* Temp HACK */
|
||||||
PWND FASTCALL UserGetWindowObject(HWND hWnd)
|
PWND FASTCALL UserGetWindowObject(HWND hWnd)
|
||||||
{
|
{
|
||||||
PWND Window;
|
PWND Window;
|
||||||
|
@ -759,21 +759,21 @@ co_DestroyThreadWindows(struct _ETHREAD *Thread)
|
||||||
|
|
||||||
TRACE("thread cleanup: while destroy wnds, wnd=0x%x\n",Wnd);
|
TRACE("thread cleanup: while destroy wnds, wnd=0x%x\n",Wnd);
|
||||||
|
|
||||||
/* window removes itself from the list */
|
/* Window removes itself from the list */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
fixme: it is critical that the window removes itself! if now, we will loop
|
* FIXME: It is critical that the window removes itself! If now, we will loop
|
||||||
here forever...
|
* here forever...
|
||||||
*/
|
*/
|
||||||
|
|
||||||
//ASSERT(co_UserDestroyWindow(Wnd));
|
//ASSERT(co_UserDestroyWindow(Wnd));
|
||||||
|
|
||||||
UserRefObjectCo(Wnd, &Ref);//faxme: temp hack??
|
UserRefObjectCo(Wnd, &Ref); // FIXME: Temp HACK??
|
||||||
if (!co_UserDestroyWindow(Wnd))
|
if (!co_UserDestroyWindow(Wnd))
|
||||||
{
|
{
|
||||||
ERR("Unable to destroy window 0x%x at thread cleanup... This is _VERY_ bad!\n", Wnd);
|
ERR("Unable to destroy window 0x%x at thread cleanup... This is _VERY_ bad!\n", Wnd);
|
||||||
}
|
}
|
||||||
UserDerefObjectCo(Wnd);//faxme: temp hack??
|
UserDerefObjectCo(Wnd); // FIXME: Temp HACK??
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -839,7 +839,7 @@ IntGetSystemMenu(PWND Window, BOOL bRevert, BOOL RetMenu)
|
||||||
|
|
||||||
if(W32Thread->rpdesk->rpwinstaParent->SystemMenuTemplate)
|
if(W32Thread->rpdesk->rpwinstaParent->SystemMenuTemplate)
|
||||||
{
|
{
|
||||||
/* clone system menu */
|
/* Clone system menu */
|
||||||
Menu = UserGetMenuObject(W32Thread->rpdesk->rpwinstaParent->SystemMenuTemplate);
|
Menu = UserGetMenuObject(W32Thread->rpdesk->rpwinstaParent->SystemMenuTemplate);
|
||||||
if(!Menu)
|
if(!Menu)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -941,7 +941,7 @@ IntIsChildWindow(PWND Parent, PWND BaseWindow)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
link the window into siblings list
|
Link the window into siblings list
|
||||||
children and parent are kept in place.
|
children and parent are kept in place.
|
||||||
*/
|
*/
|
||||||
VOID FASTCALL
|
VOID FASTCALL
|
||||||
|
@ -1130,7 +1130,7 @@ co_IntSetParent(PWND Wnd, PWND WndNewParent)
|
||||||
|
|
||||||
WndOldParent = Wnd->spwndParent;
|
WndOldParent = Wnd->spwndParent;
|
||||||
|
|
||||||
if (WndOldParent) UserReferenceObject(WndOldParent); /* caller must deref */
|
if (WndOldParent) UserReferenceObject(WndOldParent); /* Caller must deref */
|
||||||
|
|
||||||
if (WndNewParent != WndOldParent)
|
if (WndNewParent != WndOldParent)
|
||||||
{
|
{
|
||||||
|
@ -1156,8 +1156,8 @@ co_IntSetParent(PWND Wnd, PWND WndNewParent)
|
||||||
| (WasVisible ? SWP_SHOWWINDOW : 0));
|
| (WasVisible ? SWP_SHOWWINDOW : 0));
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* FIXME: a WM_MOVE is also generated (in the DefWindowProc handler
|
* FIXME: A WM_MOVE is also generated (in the DefWindowProc handler
|
||||||
* for WM_WINDOWPOSCHANGED) in Windows, should probably remove SWP_NOMOVE
|
* for WM_WINDOWPOSCHANGED) in Windows, should probably remove SWP_NOMOVE.
|
||||||
*/
|
*/
|
||||||
if (WasVisible) co_WinPosShowWindow(Wnd, SW_SHOWNORMAL);
|
if (WasVisible) co_WinPosShowWindow(Wnd, SW_SHOWNORMAL);
|
||||||
|
|
||||||
|
@ -1236,7 +1236,7 @@ IntSetSystemMenu(PWND Window, PMENU_OBJECT Menu)
|
||||||
|
|
||||||
if(Menu)
|
if(Menu)
|
||||||
{
|
{
|
||||||
/* FIXME check window style, propably return FALSE ? */
|
/* FIXME: Check window style, propably return FALSE? */
|
||||||
Window->SystemMenu = Menu->MenuInfo.Self;
|
Window->SystemMenu = Menu->MenuInfo.Self;
|
||||||
Menu->MenuInfo.Flags |= MF_SYSMENU;
|
Menu->MenuInfo.Flags |= MF_SYSMENU;
|
||||||
}
|
}
|
||||||
|
@ -1246,7 +1246,7 @@ IntSetSystemMenu(PWND Window, PMENU_OBJECT Menu)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* unlink the window from siblings. children and parent are kept in place. */
|
/* Unlink the window from siblings. children and parent are kept in place. */
|
||||||
VOID FASTCALL
|
VOID FASTCALL
|
||||||
IntUnlinkWindow(PWND Wnd)
|
IntUnlinkWindow(PWND Wnd)
|
||||||
{
|
{
|
||||||
|
@ -1570,10 +1570,10 @@ PWND FASTCALL IntCreateWindow(CREATESTRUCTW* Cs,
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{ /*
|
{ /*
|
||||||
Note from MSDN http://msdn.microsoft.com/en-us/library/aa913269.aspx :
|
* Note from MSDN <http://msdn.microsoft.com/en-us/library/aa913269.aspx>:
|
||||||
|
*
|
||||||
Dialog boxes and message boxes do not inherit layout, so you must
|
* Dialog boxes and message boxes do not inherit layout, so you must
|
||||||
set the layout explicitly.
|
* set the layout explicitly.
|
||||||
*/
|
*/
|
||||||
if ( Class->fnid != FNID_DIALOG)
|
if ( Class->fnid != FNID_DIALOG)
|
||||||
{
|
{
|
||||||
|
@ -1613,7 +1613,7 @@ PWND FASTCALL IntCreateWindow(CREATESTRUCTW* Cs,
|
||||||
TRACE("Created object with handle %X\n", hWnd);
|
TRACE("Created object with handle %X\n", hWnd);
|
||||||
|
|
||||||
if (NULL == pti->rpdesk->DesktopWindow)
|
if (NULL == pti->rpdesk->DesktopWindow)
|
||||||
{ /*HACK! Helper for win32csr/desktopbg.c */
|
{ /* HACK: Helper for win32csr/desktopbg.c */
|
||||||
/* If there is no desktop window yet, we must be creating it */
|
/* If there is no desktop window yet, we must be creating it */
|
||||||
pti->rpdesk->DesktopWindow = hWnd;
|
pti->rpdesk->DesktopWindow = hWnd;
|
||||||
pti->rpdesk->pDeskInfo->spwnd = pWnd;
|
pti->rpdesk->pDeskInfo->spwnd = pWnd;
|
||||||
|
@ -1684,8 +1684,8 @@ PWND FASTCALL IntCreateWindow(CREATESTRUCTW* Cs,
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{ /*
|
{ /*
|
||||||
It seems there can be both an Ansi creator and Unicode Class Window
|
* It seems there can be both an Ansi creator and Unicode Class Window
|
||||||
WndProc, unless the following overriding conditions occur:
|
* WndProc, unless the following overriding conditions occur:
|
||||||
*/
|
*/
|
||||||
if ( !bUnicodeWindow &&
|
if ( !bUnicodeWindow &&
|
||||||
( Class->atomClassName == gpsi->atomSysClass[ICLS_BUTTON] ||
|
( Class->atomClassName == gpsi->atomSysClass[ICLS_BUTTON] ||
|
||||||
|
@ -1768,7 +1768,7 @@ PWND FASTCALL IntCreateWindow(CREATESTRUCTW* Cs,
|
||||||
if (!(pWnd->style & (WS_CHILD | WS_POPUP)))
|
if (!(pWnd->style & (WS_CHILD | WS_POPUP)))
|
||||||
pWnd->state |= WNDS_SENDSIZEMOVEMSGS;
|
pWnd->state |= WNDS_SENDSIZEMOVEMSGS;
|
||||||
|
|
||||||
/* create system menu */
|
/* Create system menu */
|
||||||
if ((Cs->style & WS_SYSMENU)) // && (dwStyle & WS_CAPTION) == WS_CAPTION)
|
if ((Cs->style & WS_SYSMENU)) // && (dwStyle & WS_CAPTION) == WS_CAPTION)
|
||||||
{
|
{
|
||||||
SystemMenu = IntGetSystemMenu(pWnd, TRUE, TRUE);
|
SystemMenu = IntGetSystemMenu(pWnd, TRUE, TRUE);
|
||||||
|
@ -1859,7 +1859,7 @@ co_UserCreateWindowEx(CREATESTRUCTW* Cs,
|
||||||
if (pti == NULL || pti->rpdesk == NULL)
|
if (pti == NULL || pti->rpdesk == NULL)
|
||||||
{
|
{
|
||||||
ERR("Thread is not attached to a desktop! Cannot create window!\n");
|
ERR("Thread is not attached to a desktop! Cannot create window!\n");
|
||||||
return NULL; //There is nothing to cleanup
|
return NULL; // There is nothing to cleanup.
|
||||||
}
|
}
|
||||||
WinSta = pti->rpdesk->rpwinstaParent;
|
WinSta = pti->rpdesk->rpwinstaParent;
|
||||||
ObReferenceObjectByPointer(WinSta, KernelMode, ExWindowStationObjectType, 0);
|
ObReferenceObjectByPointer(WinSta, KernelMode, ExWindowStationObjectType, 0);
|
||||||
|
@ -1900,7 +1900,7 @@ co_UserCreateWindowEx(CREATESTRUCTW* Cs,
|
||||||
ParentWindow = hWndParent ? UserGetWindowObject(hWndParent): NULL;
|
ParentWindow = hWndParent ? UserGetWindowObject(hWndParent): NULL;
|
||||||
OwnerWindow = hWndOwner ? UserGetWindowObject(hWndOwner): NULL;
|
OwnerWindow = hWndOwner ? UserGetWindowObject(hWndOwner): NULL;
|
||||||
|
|
||||||
/* FIXME: is this correct?*/
|
/* FIXME: Is this correct? */
|
||||||
if(OwnerWindow)
|
if(OwnerWindow)
|
||||||
OwnerWindow = UserGetAncestor(OwnerWindow, GA_ROOT);
|
OwnerWindow = UserGetAncestor(OwnerWindow, GA_ROOT);
|
||||||
|
|
||||||
|
@ -2070,7 +2070,7 @@ co_UserCreateWindowEx(CREATESTRUCTW* Cs,
|
||||||
/* Link the window */
|
/* Link the window */
|
||||||
if (NULL != ParentWindow)
|
if (NULL != ParentWindow)
|
||||||
{
|
{
|
||||||
/* link the window into the siblings list */
|
/* Link the window into the siblings list */
|
||||||
if ((Cs->style & (WS_CHILD|WS_MAXIMIZE)) == WS_CHILD)
|
if ((Cs->style & (WS_CHILD|WS_MAXIMIZE)) == WS_CHILD)
|
||||||
IntLinkHwnd(Window, HWND_BOTTOM);
|
IntLinkHwnd(Window, HWND_BOTTOM);
|
||||||
else
|
else
|
||||||
|
@ -2380,7 +2380,7 @@ BOOLEAN FASTCALL co_UserDestroyWindow(PWND Window)
|
||||||
PTHREADINFO ti;
|
PTHREADINFO ti;
|
||||||
MSG msg;
|
MSG msg;
|
||||||
|
|
||||||
ASSERT_REFS_CO(Window); // FIXME: temp hack?
|
ASSERT_REFS_CO(Window); // FIXME: Temp HACK?
|
||||||
|
|
||||||
hWnd = Window->head.h;
|
hWnd = Window->head.h;
|
||||||
|
|
||||||
|
@ -2480,9 +2480,9 @@ BOOLEAN FASTCALL co_UserDestroyWindow(PWND Window)
|
||||||
if (IntWndBelongsToThread(Child, PsGetCurrentThreadWin32Thread()))
|
if (IntWndBelongsToThread(Child, PsGetCurrentThreadWin32Thread()))
|
||||||
{
|
{
|
||||||
USER_REFERENCE_ENTRY ChildRef;
|
USER_REFERENCE_ENTRY ChildRef;
|
||||||
UserRefObjectCo(Child, &ChildRef);//temp hack?
|
UserRefObjectCo(Child, &ChildRef); // Temp HACK?
|
||||||
co_UserDestroyWindow(Child);
|
co_UserDestroyWindow(Child);
|
||||||
UserDerefObjectCo(Child);//temp hack?
|
UserDerefObjectCo(Child); // Temp HACK?
|
||||||
|
|
||||||
GotOne = TRUE;
|
GotOne = TRUE;
|
||||||
continue;
|
continue;
|
||||||
|
@ -2541,9 +2541,9 @@ NtUserDestroyWindow(HWND Wnd)
|
||||||
RETURN(FALSE);
|
RETURN(FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
UserRefObjectCo(Window, &Ref);//faxme: dunno if win should be reffed during destroy..
|
UserRefObjectCo(Window, &Ref); // FIXME: Dunno if win should be reffed during destroy...
|
||||||
ret = co_UserDestroyWindow(Window);
|
ret = co_UserDestroyWindow(Window);
|
||||||
UserDerefObjectCo(Window);//faxme: dunno if win should be reffed during destroy..
|
UserDerefObjectCo(Window); // FIXME: Dunno if win should be reffed during destroy...
|
||||||
|
|
||||||
RETURN(ret);
|
RETURN(ret);
|
||||||
|
|
||||||
|
@ -2805,7 +2805,7 @@ NtUserFindWindowEx(HWND hwndParent,
|
||||||
|
|
||||||
if(Ret == NULL && hwndParent == NULL && hwndChildAfter == NULL)
|
if(Ret == NULL && hwndParent == NULL && hwndChildAfter == NULL)
|
||||||
{
|
{
|
||||||
/* FIXME - if both hwndParent and hwndChildAfter are NULL, we also should
|
/* FIXME: If both hwndParent and hwndChildAfter are NULL, we also should
|
||||||
search the message-only windows. Should this also be done if
|
search the message-only windows. Should this also be done if
|
||||||
Parent is the desktop window??? */
|
Parent is the desktop window??? */
|
||||||
PWND MsgWindows;
|
PWND MsgWindows;
|
||||||
|
@ -3795,7 +3795,7 @@ NtUserDefSetText(HWND hWnd, PLARGE_STRING WindowText)
|
||||||
Wnd->strName.Buffer[0] = L'\0';
|
Wnd->strName.Buffer[0] = L'\0';
|
||||||
}
|
}
|
||||||
|
|
||||||
// HAX! FIXME! Windows does not do this in here!
|
// FIXME: HAX! Windows does not do this in here!
|
||||||
// In User32, these are called after: NotifyWinEvent EVENT_OBJECT_NAMECHANGE than
|
// In User32, these are called after: NotifyWinEvent EVENT_OBJECT_NAMECHANGE than
|
||||||
// RepaintButton, StaticRepaint, NtUserCallHwndLock HWNDLOCK_ROUTINE_REDRAWFRAMEANDHOOK, etc.
|
// RepaintButton, StaticRepaint, NtUserCallHwndLock HWNDLOCK_ROUTINE_REDRAWFRAMEANDHOOK, etc.
|
||||||
/* Send shell notifications */
|
/* Send shell notifications */
|
||||||
|
|
|
@ -112,9 +112,9 @@ done:
|
||||||
if (WndTo) UserRefObjectCo(WndTo, &Ref);
|
if (WndTo) UserRefObjectCo(WndTo, &Ref);
|
||||||
|
|
||||||
Fg = UserGetForegroundWindow();
|
Fg = UserGetForegroundWindow();
|
||||||
if ((!Fg || Wnd->head.h == Fg) && WndTo)//fixme: ok if WndTo is NULL??
|
if ((!Fg || Wnd->head.h == Fg) && WndTo) // FIXME: Ok if WndTo is NULL??
|
||||||
{
|
{
|
||||||
/* fixme: wine can pass WndTo=NULL to co_IntSetForegroundWindow. hmm */
|
/* FIXME: Wine can pass WndTo = NULL to co_IntSetForegroundWindow. Hmm... */
|
||||||
if (co_IntSetForegroundWindow(WndTo))
|
if (co_IntSetForegroundWindow(WndTo))
|
||||||
{
|
{
|
||||||
UserDerefObjectCo(WndTo);
|
UserDerefObjectCo(WndTo);
|
||||||
|
@ -122,7 +122,7 @@ done:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!co_IntSetActiveWindow(WndTo)) /* ok for WndTo to be NULL here */
|
if (!co_IntSetActiveWindow(WndTo)) /* Ok for WndTo to be NULL here */
|
||||||
co_IntSetActiveWindow(0);
|
co_IntSetActiveWindow(0);
|
||||||
|
|
||||||
if (WndTo) UserDerefObjectCo(WndTo);
|
if (WndTo) UserDerefObjectCo(WndTo);
|
||||||
|
@ -782,7 +782,7 @@ co_WinPosGetMinMaxInfo(PWND Window, POINT* MaxSize, POINT* MaxPos,
|
||||||
if (MaxTrack)
|
if (MaxTrack)
|
||||||
*MaxTrack = MinMax.ptMaxTrackSize;
|
*MaxTrack = MinMax.ptMaxTrackSize;
|
||||||
|
|
||||||
return 0; //FIXME: what does it return?
|
return 0; // FIXME: What does it return?
|
||||||
}
|
}
|
||||||
|
|
||||||
static
|
static
|
||||||
|
@ -1808,7 +1808,7 @@ co_WinPosShowWindow(PWND Wnd, INT Cmd)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//temphack
|
// Temp HACK
|
||||||
ThreadFocusWindow = UserGetWindowObject(IntGetThreadFocusWindow());
|
ThreadFocusWindow = UserGetWindowObject(IntGetThreadFocusWindow());
|
||||||
|
|
||||||
/* Revert focus to parent */
|
/* Revert focus to parent */
|
||||||
|
@ -1817,7 +1817,7 @@ co_WinPosShowWindow(PWND Wnd, INT Cmd)
|
||||||
*/
|
*/
|
||||||
if (Wnd == ThreadFocusWindow)
|
if (Wnd == ThreadFocusWindow)
|
||||||
{
|
{
|
||||||
//faxme: as long as we have ref on Window, we also, indirectly, have ref on parent...
|
// FIXME: As long as we have ref on Window, we also, indirectly, have ref on parent...
|
||||||
co_UserSetFocus(Wnd->spwndParent);
|
co_UserSetFocus(Wnd->spwndParent);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2779,8 +2779,8 @@ NtUserWindowFromPoint(LONG X, LONG Y)
|
||||||
pt.x = X;
|
pt.x = X;
|
||||||
pt.y = Y;
|
pt.y = Y;
|
||||||
|
|
||||||
//hmm... threads live on desktops thus we have a reference on the desktop and indirectly the desktop window
|
// Hmm... Threads live on desktops thus we have a reference on the desktop and indirectly the desktop window.
|
||||||
//its possible this referencing is useless, thou it shouldnt hurt...
|
// It is possible this referencing is useless, though it should not hurt...
|
||||||
UserRefObjectCo(DesktopWindow, &Ref);
|
UserRefObjectCo(DesktopWindow, &Ref);
|
||||||
|
|
||||||
//pti = PsGetCurrentThreadWin32Thread();
|
//pti = PsGetCurrentThreadWin32Thread();
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
/*
|
/*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS Win32k subsystem
|
||||||
* PURPOSE: Window stations
|
* PURPOSE: Window stations
|
||||||
* FILE: subsys/win32k/ntuser/winsta.c
|
* FILE: subsystems/win32/win32k/ntuser/winsta.c
|
||||||
* PROGRAMER: Casper S. Hornstrup (chorns@users.sourceforge.net)
|
* PROGRAMER: Casper S. Hornstrup (chorns@users.sourceforge.net)
|
||||||
* TODO: The process window station is created on
|
* TODO: The process window station is created on
|
||||||
* the first USER32/GDI32 call not related
|
* the first USER32/GDI32 call not related
|
||||||
|
@ -17,7 +17,7 @@ DBG_DEFAULT_CHANNEL(UserWinsta);
|
||||||
/* Currently active window station */
|
/* Currently active window station */
|
||||||
PWINSTATION_OBJECT InputWindowStation = NULL;
|
PWINSTATION_OBJECT InputWindowStation = NULL;
|
||||||
|
|
||||||
/* Winlogon sas window*/
|
/* Winlogon SAS window */
|
||||||
HWND hwndSAS = NULL;
|
HWND hwndSAS = NULL;
|
||||||
|
|
||||||
/* INITALIZATION FUNCTIONS ****************************************************/
|
/* INITALIZATION FUNCTIONS ****************************************************/
|
||||||
|
@ -301,7 +301,7 @@ co_IntInitializeDesktopGraphics(VOID)
|
||||||
NtGdiSelectFont(hSystemBM, NtGdiGetStockObject(SYSTEM_FONT));
|
NtGdiSelectFont(hSystemBM, NtGdiGetStockObject(SYSTEM_FONT));
|
||||||
GreSetDCOwner(hSystemBM, GDI_OBJ_HMGR_PUBLIC);
|
GreSetDCOwner(hSystemBM, GDI_OBJ_HMGR_PUBLIC);
|
||||||
|
|
||||||
// FIXME! Move these to a update routine.
|
// FIXME: Move these to a update routine.
|
||||||
gpsi->Planes = NtGdiGetDeviceCaps(ScreenDeviceContext, PLANES);
|
gpsi->Planes = NtGdiGetDeviceCaps(ScreenDeviceContext, PLANES);
|
||||||
gpsi->BitsPixel = NtGdiGetDeviceCaps(ScreenDeviceContext, BITSPIXEL);
|
gpsi->BitsPixel = NtGdiGetDeviceCaps(ScreenDeviceContext, BITSPIXEL);
|
||||||
gpsi->BitCount = gpsi->Planes * gpsi->BitsPixel;
|
gpsi->BitCount = gpsi->Planes * gpsi->BitsPixel;
|
||||||
|
@ -898,7 +898,7 @@ UserSetProcessWindowStation(HWINSTA hWindowStation)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* FIXME - don't allow changing the window station if there are threads that are attached to desktops and own gui objects
|
* FIXME: Don't allow changing the window station if there are threads that are attached to desktops and own GUI objects.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
PsSetProcessWindowStation(ppi->peProcess, hWindowStation);
|
PsSetProcessWindowStation(ppi->peProcess, hWindowStation);
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
#include <debug.h>
|
#include <debug.h>
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* a couple macros to fill a single pixel or a line
|
* A couple of macros to fill a single pixel or a line
|
||||||
*/
|
*/
|
||||||
#define PUTPIXEL(x,y,BrushInst) \
|
#define PUTPIXEL(x,y,BrushInst) \
|
||||||
ret = ret && IntEngLineTo(&psurf->SurfObj, \
|
ret = ret && IntEngLineTo(&psurf->SurfObj, \
|
||||||
|
|
|
@ -24,9 +24,9 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* some macro definitions for bezier drawing
|
* Some macro definitions for bezier drawing.
|
||||||
*
|
*
|
||||||
* to avoid trucation errors the coordinates are
|
* To avoid trucation errors the coordinates are
|
||||||
* shifted upwards. When used in drawing they are
|
* shifted upwards. When used in drawing they are
|
||||||
* shifted down again, including correct rounding
|
* shifted down again, including correct rounding
|
||||||
* and avoiding floating point arithmatic
|
* and avoiding floating point arithmatic
|
||||||
|
@ -39,14 +39,14 @@
|
||||||
#define BEZIERSHIFTUP(x) ((x)<<BEZIERSHIFTBITS)
|
#define BEZIERSHIFTUP(x) ((x)<<BEZIERSHIFTBITS)
|
||||||
#define BEZIERPIXEL BEZIERSHIFTUP(1)
|
#define BEZIERPIXEL BEZIERSHIFTUP(1)
|
||||||
#define BEZIERSHIFTDOWN(x) (((x)+(1<<(BEZIERSHIFTBITS-1)))>>BEZIERSHIFTBITS)
|
#define BEZIERSHIFTDOWN(x) (((x)+(1<<(BEZIERSHIFTBITS-1)))>>BEZIERSHIFTBITS)
|
||||||
/* maximum depth of recursion */
|
/* Maximum depth of recursion */
|
||||||
#define BEZIERMAXDEPTH 8
|
#define BEZIERMAXDEPTH 8
|
||||||
|
|
||||||
/* size of array to store points on */
|
/* Size of array to store points on */
|
||||||
/* enough for one curve */
|
/* enough for one curve */
|
||||||
#define BEZIER_INITBUFSIZE (150)
|
#define BEZIER_INITBUFSIZE (150)
|
||||||
|
|
||||||
/* calculate Bezier average, in this case the middle
|
/* Calculate Bezier average, in this case the middle
|
||||||
* correctly rounded...
|
* correctly rounded...
|
||||||
* */
|
* */
|
||||||
|
|
||||||
|
@ -68,9 +68,9 @@ static BOOL FASTCALL BezierCheck( int level, POINT *Points)
|
||||||
|
|
||||||
dx=Points[3].x-Points[0].x;
|
dx=Points[3].x-Points[0].x;
|
||||||
dy=Points[3].y-Points[0].y;
|
dy=Points[3].y-Points[0].y;
|
||||||
if ( abs(dy) <= abs(dx) ) /* shallow line */
|
if ( abs(dy) <= abs(dx) ) /* Shallow line */
|
||||||
{
|
{
|
||||||
/* check that control points are between begin and end */
|
/* Check that control points are between begin and end */
|
||||||
if ( Points[1].x < Points[0].x )
|
if ( Points[1].x < Points[0].x )
|
||||||
{
|
{
|
||||||
if ( Points[1].x < Points[3].x )
|
if ( Points[1].x < Points[3].x )
|
||||||
|
@ -98,8 +98,9 @@ static BOOL FASTCALL BezierCheck( int level, POINT *Points)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{ /* steep line */
|
{
|
||||||
/* check that control points are between begin and end */
|
/* Steep line */
|
||||||
|
/* Check that control points are between begin and end */
|
||||||
if(Points[1].y < Points[0].y)
|
if(Points[1].y < Points[0].y)
|
||||||
{
|
{
|
||||||
if(Points[1].y < Points[3].y)
|
if(Points[1].y < Points[3].y)
|
||||||
|
@ -149,7 +150,7 @@ static void APIENTRY GDI_InternalBezier( POINT *Points, POINT **PtsOut, INT *dwO
|
||||||
(*PtsOut)[*nPtsOut].y = BEZIERSHIFTDOWN(Points[3].y);
|
(*PtsOut)[*nPtsOut].y = BEZIERSHIFTDOWN(Points[3].y);
|
||||||
(*nPtsOut) ++;
|
(*nPtsOut) ++;
|
||||||
} else {
|
} else {
|
||||||
POINT Points2[4]; /* for the second recursive call */
|
POINT Points2[4]; /* For the second recursive call */
|
||||||
Points2[3]=Points[3];
|
Points2[3]=Points[3];
|
||||||
BEZIERMIDDLE(Points2[2], Points[2], Points[3]);
|
BEZIERMIDDLE(Points2[2], Points[2], Points[3]);
|
||||||
BEZIERMIDDLE(Points2[0], Points[1], Points[2]);
|
BEZIERMIDDLE(Points2[0], Points[1], Points[2]);
|
||||||
|
@ -161,7 +162,7 @@ static void APIENTRY GDI_InternalBezier( POINT *Points, POINT **PtsOut, INT *dwO
|
||||||
|
|
||||||
Points2[0]=Points[3];
|
Points2[0]=Points[3];
|
||||||
|
|
||||||
/* do the two halves */
|
/* Do the two halves */
|
||||||
GDI_InternalBezier(Points, PtsOut, dwOut, nPtsOut, level-1);
|
GDI_InternalBezier(Points, PtsOut, dwOut, nPtsOut, level-1);
|
||||||
GDI_InternalBezier(Points2, PtsOut, dwOut, nPtsOut, level-1);
|
GDI_InternalBezier(Points2, PtsOut, dwOut, nPtsOut, level-1);
|
||||||
}
|
}
|
||||||
|
|
|
@ -124,7 +124,7 @@ NtGdiAlphaBlend(
|
||||||
EXLATEOBJ_vInitXlateFromDCs(&exlo, DCSrc, DCDest);
|
EXLATEOBJ_vInitXlateFromDCs(&exlo, DCSrc, DCDest);
|
||||||
|
|
||||||
/* Perform the alpha blend operation */
|
/* Perform the alpha blend operation */
|
||||||
DPRINT("Performing the alpha Blend\n");
|
DPRINT("Performing the alpha blend\n");
|
||||||
bResult = IntEngAlphaBlend(&BitmapDest->SurfObj,
|
bResult = IntEngAlphaBlend(&BitmapDest->SurfObj,
|
||||||
&BitmapSrc->SurfObj,
|
&BitmapSrc->SurfObj,
|
||||||
DCDest->rosdc.CombinedClip,
|
DCDest->rosdc.CombinedClip,
|
||||||
|
@ -158,7 +158,7 @@ NtGdiBitBlt(
|
||||||
IN FLONG fl)
|
IN FLONG fl)
|
||||||
{
|
{
|
||||||
/* Forward to NtGdiMaskBlt */
|
/* Forward to NtGdiMaskBlt */
|
||||||
// TODO : what's fl for?
|
// TODO: What's fl for?
|
||||||
return NtGdiMaskBlt(hDCDest,
|
return NtGdiMaskBlt(hDCDest,
|
||||||
XDest,
|
XDest,
|
||||||
YDest,
|
YDest,
|
||||||
|
@ -860,7 +860,6 @@ IntGdiPolyPatBlt(
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
BOOL APIENTRY
|
BOOL APIENTRY
|
||||||
NtGdiPatBlt(
|
NtGdiPatBlt(
|
||||||
HDC hDC,
|
HDC hDC,
|
||||||
|
@ -878,7 +877,7 @@ NtGdiPatBlt(
|
||||||
BOOL UsesSource = ROP_USES_SOURCE(ROP);
|
BOOL UsesSource = ROP_USES_SOURCE(ROP);
|
||||||
if (UsesSource)
|
if (UsesSource)
|
||||||
{
|
{
|
||||||
/* in this case we call on GdiMaskBlt */
|
/* In this case we call on GdiMaskBlt */
|
||||||
return NtGdiMaskBlt(hDC, XLeft, YLeft, Width, Height, 0,0,0,0,0,0,ROP,0);
|
return NtGdiMaskBlt(hDC, XLeft, YLeft, Width, Height, 0,0,0,0,0,0,ROP,0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -145,10 +145,10 @@ GreCreateBitmap(
|
||||||
/* Call the extended function */
|
/* Call the extended function */
|
||||||
return GreCreateBitmapEx(nWidth,
|
return GreCreateBitmapEx(nWidth,
|
||||||
nHeight,
|
nHeight,
|
||||||
0, /* auto width */
|
0, /* Auto width */
|
||||||
BitmapFormat(cBitsPixel * cPlanes, BI_RGB),
|
BitmapFormat(cBitsPixel * cPlanes, BI_RGB),
|
||||||
0, /* no bitmap flags */
|
0, /* No bitmap flags */
|
||||||
0, /* auto size */
|
0, /* Auto size */
|
||||||
pvBits,
|
pvBits,
|
||||||
DDB_SURFACE /* DDB */);
|
DDB_SURFACE /* DDB */);
|
||||||
}
|
}
|
||||||
|
@ -238,7 +238,7 @@ IntCreateCompatibleBitmap(
|
||||||
psurf->ppal = PALETTE_ShareLockPalette(Dc->ppdev->devinfo.hpalDefault);
|
psurf->ppal = PALETTE_ShareLockPalette(Dc->ppdev->devinfo.hpalDefault);
|
||||||
/* Set flags */
|
/* Set flags */
|
||||||
psurf->flags = API_BITMAP;
|
psurf->flags = API_BITMAP;
|
||||||
psurf->hdc = NULL; // Fixme
|
psurf->hdc = NULL; // FIXME:
|
||||||
SURFACE_ShareUnlockSurface(psurf);
|
SURFACE_ShareUnlockSurface(psurf);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -264,7 +264,7 @@ IntCreateCompatibleBitmap(
|
||||||
GDIOBJ_vReferenceObjectByPointer((POBJ)psurf->ppal);
|
GDIOBJ_vReferenceObjectByPointer((POBJ)psurf->ppal);
|
||||||
/* Set flags */
|
/* Set flags */
|
||||||
psurfBmp->flags = API_BITMAP;
|
psurfBmp->flags = API_BITMAP;
|
||||||
psurfBmp->hdc = NULL; // Fixme
|
psurfBmp->hdc = NULL; // FIXME:
|
||||||
SURFACE_ShareUnlockSurface(psurfBmp);
|
SURFACE_ShareUnlockSurface(psurfBmp);
|
||||||
}
|
}
|
||||||
else if (Count == sizeof(DIBSECTION))
|
else if (Count == sizeof(DIBSECTION))
|
||||||
|
@ -403,7 +403,7 @@ COLORREF APIENTRY
|
||||||
NtGdiGetPixel(HDC hDC, INT XPos, INT YPos)
|
NtGdiGetPixel(HDC hDC, INT XPos, INT YPos)
|
||||||
{
|
{
|
||||||
PDC dc = NULL;
|
PDC dc = NULL;
|
||||||
COLORREF Result = (COLORREF)CLR_INVALID; // default to failure
|
COLORREF Result = (COLORREF)CLR_INVALID; // Default to failure
|
||||||
BOOL bInRect = FALSE;
|
BOOL bInRect = FALSE;
|
||||||
SURFACE *psurf;
|
SURFACE *psurf;
|
||||||
SURFOBJ *pso;
|
SURFOBJ *pso;
|
||||||
|
@ -435,7 +435,7 @@ NtGdiGetPixel(HDC hDC, INT XPos, INT YPos)
|
||||||
{
|
{
|
||||||
pso = &psurf->SurfObj;
|
pso = &psurf->SurfObj;
|
||||||
EXLATEOBJ_vInitialize(&exlo, psurf->ppal, &gpalRGB, 0, 0xffffff, 0);
|
EXLATEOBJ_vInitialize(&exlo, psurf->ppal, &gpalRGB, 0, 0xffffff, 0);
|
||||||
// check if this DC has a DIB behind it...
|
// Check if this DC has a DIB behind it...
|
||||||
if (pso->pvScan0) // STYPE_BITMAP == pso->iType
|
if (pso->pvScan0) // STYPE_BITMAP == pso->iType
|
||||||
{
|
{
|
||||||
ASSERT(pso->lDelta);
|
ASSERT(pso->lDelta);
|
||||||
|
@ -448,7 +448,7 @@ NtGdiGetPixel(HDC hDC, INT XPos, INT YPos)
|
||||||
}
|
}
|
||||||
DC_UnlockDc(dc);
|
DC_UnlockDc(dc);
|
||||||
|
|
||||||
// if Result is still CLR_INVALID, then the "quick" method above didn't work
|
// If Result is still CLR_INVALID, then the "quick" method above didn't work
|
||||||
if (bInRect && Result == CLR_INVALID)
|
if (bInRect && Result == CLR_INVALID)
|
||||||
{
|
{
|
||||||
// FIXME: create a 1x1 32BPP DIB, and blit to it
|
// FIXME: create a 1x1 32BPP DIB, and blit to it
|
||||||
|
@ -481,7 +481,7 @@ NtGdiGetPixel(HDC hDC, INT XPos, INT YPos)
|
||||||
NtGdiBitBlt(hDCTmp, 0, 0, 1, 1, hDC, XPos, YPos, SRCCOPY, 0, 0);
|
NtGdiBitBlt(hDCTmp, 0, 0, 1, 1, hDC, XPos, YPos, SRCCOPY, 0, 0);
|
||||||
NtGdiSelectBitmap(hDCTmp, hBmpOld);
|
NtGdiSelectBitmap(hDCTmp, hBmpOld);
|
||||||
|
|
||||||
// our bitmap is no longer selected, so we can access it's stuff...
|
// Our bitmap is no longer selected, so we can access it's stuff...
|
||||||
psurf = SURFACE_ShareLockSurface(hBmpTmp);
|
psurf = SURFACE_ShareLockSurface(hBmpTmp);
|
||||||
if (psurf)
|
if (psurf)
|
||||||
{
|
{
|
||||||
|
@ -564,7 +564,7 @@ NtGdiGetBitmapBits(
|
||||||
/* Don't copy more bytes than the buffer has */
|
/* Don't copy more bytes than the buffer has */
|
||||||
Bytes = min(Bytes, bmSize);
|
Bytes = min(Bytes, bmSize);
|
||||||
|
|
||||||
// FIXME: use MmSecureVirtualMemory
|
// FIXME: Use MmSecureVirtualMemory
|
||||||
_SEH2_TRY
|
_SEH2_TRY
|
||||||
{
|
{
|
||||||
ProbeForWrite(pUnsafeBits, Bytes, 1);
|
ProbeForWrite(pUnsafeBits, Bytes, 1);
|
||||||
|
@ -843,7 +843,7 @@ BITMAP_GetObject(SURFACE *psurf, INT Count, LPVOID buffer)
|
||||||
if (!buffer) return sizeof(BITMAP);
|
if (!buffer) return sizeof(BITMAP);
|
||||||
if ((UINT)Count < sizeof(BITMAP)) return 0;
|
if ((UINT)Count < sizeof(BITMAP)) return 0;
|
||||||
|
|
||||||
/* always fill a basic BITMAP structure */
|
/* Always fill a basic BITMAP structure */
|
||||||
pBitmap = buffer;
|
pBitmap = buffer;
|
||||||
pBitmap->bmType = 0;
|
pBitmap->bmType = 0;
|
||||||
pBitmap->bmWidth = psurf->SurfObj.sizlBitmap.cx;
|
pBitmap->bmWidth = psurf->SurfObj.sizlBitmap.cx;
|
||||||
|
@ -908,7 +908,7 @@ BITMAP_GetObject(SURFACE *psurf, INT Count, LPVOID buffer)
|
||||||
pds->dsBmih.biCompression = BI_PNG;
|
pds->dsBmih.biCompression = BI_PNG;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
ASSERT(FALSE); /* this shouldn't happen */
|
ASSERT(FALSE); /* This shouldn't happen */
|
||||||
}
|
}
|
||||||
|
|
||||||
pds->dsBmih.biSizeImage = psurf->SurfObj.cjBits;
|
pds->dsBmih.biSizeImage = psurf->SurfObj.cjBits;
|
||||||
|
@ -927,7 +927,7 @@ BITMAP_GetObject(SURFACE *psurf, INT Count, LPVOID buffer)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* not set according to wine test, confirmed in win2k */
|
/* Not set according to wine test, confirmed in win2k */
|
||||||
pBitmap->bmBits = NULL;
|
pBitmap->bmBits = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -53,7 +53,7 @@ IntGdiSetBrushOwner(PBRUSH pbr, ULONG ulOwner)
|
||||||
{
|
{
|
||||||
// Allow user access to User Data.
|
// Allow user access to User Data.
|
||||||
GDIOBJ_vSetObjectAttr(&pbr->BaseObject, pbr->pBrushAttr);
|
GDIOBJ_vSetObjectAttr(&pbr->BaseObject, pbr->pBrushAttr);
|
||||||
// FIXME: allocate brush attr
|
// FIXME: Allocate brush attr
|
||||||
}
|
}
|
||||||
|
|
||||||
GDIOBJ_vSetObjectOwner(&pbr->BaseObject, ulOwner);
|
GDIOBJ_vSetObjectOwner(&pbr->BaseObject, ulOwner);
|
||||||
|
@ -164,7 +164,7 @@ BRUSH_GetObject(PBRUSH pbrush, INT Count, LPLOGBRUSH Buffer)
|
||||||
/* Set Hatch */
|
/* Set Hatch */
|
||||||
if ((pbrush->flAttrs & GDIBRUSH_IS_HATCH)!=0)
|
if ((pbrush->flAttrs & GDIBRUSH_IS_HATCH)!=0)
|
||||||
{
|
{
|
||||||
/* FIXME : this is not the right value */
|
/* FIXME: This is not the right value */
|
||||||
Buffer->lbHatch = (LONG)pbrush->hbmPattern;
|
Buffer->lbHatch = (LONG)pbrush->hbmPattern;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
/*
|
/*
|
||||||
* COPYRIGHT: GNU GPL, See COPYING in the top level directory
|
* COPYRIGHT: GNU GPL, See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS Win32k subsystem
|
||||||
* PURPOSE: Clip region functions
|
* PURPOSE: Clip region functions
|
||||||
* FILE: subsys/win32k/objects/cliprgn.c
|
* FILE: subsystems/win32/win32k/objects/cliprgn.c
|
||||||
* PROGRAMER: Unknown
|
* PROGRAMER: Unknown
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@ CLIPPING_UpdateGCRegion(DC* Dc)
|
||||||
//HRGN hRgnVis;
|
//HRGN hRgnVis;
|
||||||
PREGION prgnClip, prgnGCClip;
|
PREGION prgnClip, prgnGCClip;
|
||||||
|
|
||||||
// would prefer this, but the rest of the code sucks
|
/* Would prefer this, but the rest of the code sucks... */
|
||||||
//ASSERT(Dc->rosdc.hGCClipRgn);
|
//ASSERT(Dc->rosdc.hGCClipRgn);
|
||||||
//ASSERT(Dc->rosdc.hClipRgn);
|
//ASSERT(Dc->rosdc.hClipRgn);
|
||||||
ASSERT(Dc->prgnVis);
|
ASSERT(Dc->prgnVis);
|
||||||
|
@ -34,7 +34,7 @@ CLIPPING_UpdateGCRegion(DC* Dc)
|
||||||
IntGdiCombineRgn(prgnGCClip, Dc->prgnVis, NULL, RGN_COPY);
|
IntGdiCombineRgn(prgnGCClip, Dc->prgnVis, NULL, RGN_COPY);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
prgnClip = REGION_LockRgn(Dc->rosdc.hClipRgn); // FIXME: locking order, ugh
|
prgnClip = REGION_LockRgn(Dc->rosdc.hClipRgn); // FIXME: Locking order, ugh!
|
||||||
IntGdiCombineRgn(prgnGCClip, Dc->prgnVis, prgnClip, RGN_AND);
|
IntGdiCombineRgn(prgnGCClip, Dc->prgnVis, prgnClip, RGN_AND);
|
||||||
REGION_UnlockRgn(prgnClip);
|
REGION_UnlockRgn(prgnClip);
|
||||||
}
|
}
|
||||||
|
@ -177,14 +177,14 @@ GdiGetClipBox(HDC hDC, PRECTL rc)
|
||||||
INT retval;
|
INT retval;
|
||||||
PDC dc;
|
PDC dc;
|
||||||
PROSRGNDATA pRgnNew, pRgn = NULL;
|
PROSRGNDATA pRgnNew, pRgn = NULL;
|
||||||
BOOL Unlock = FALSE; //Small hack
|
BOOL Unlock = FALSE; // Small HACK
|
||||||
|
|
||||||
if (!(dc = DC_LockDc(hDC)))
|
if (!(dc = DC_LockDc(hDC)))
|
||||||
{
|
{
|
||||||
return ERROR;
|
return ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* FIXME! Rao and Vis only! */
|
/* FIXME: Rao and Vis only! */
|
||||||
if (dc->prgnAPI) // APIRGN
|
if (dc->prgnAPI) // APIRGN
|
||||||
{
|
{
|
||||||
pRgn = dc->prgnAPI;
|
pRgn = dc->prgnAPI;
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
* COPYRIGHT: GNU GPL, See COPYING in the top level directory
|
* COPYRIGHT: GNU GPL, See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
* PURPOSE: Coordinate systems
|
* PURPOSE: Coordinate systems
|
||||||
* FILE: subsys/win32k/objects/coord.c
|
* FILE: subsystems/win32/win32k/objects/coord.c
|
||||||
* PROGRAMER: Unknown
|
* PROGRAMER: Unknown
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -117,7 +117,7 @@ DC_vUpdateViewportExt(PDC pdc)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// FIXME: don't use floating point in the kernel! use XFORMOBJ function
|
// FIXME: Don't use floating point in the kernel! use XFORMOBJ function
|
||||||
BOOL FASTCALL
|
BOOL FASTCALL
|
||||||
IntGdiCombineTransform(
|
IntGdiCombineTransform(
|
||||||
LPXFORM XFormResult,
|
LPXFORM XFormResult,
|
||||||
|
@ -145,7 +145,7 @@ IntGdiCombineTransform(
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
// FIXME: should be XFORML and use XFORMOBJ functions
|
// FIXME: Should be XFORML and use XFORMOBJ functions
|
||||||
BOOL
|
BOOL
|
||||||
APIENTRY
|
APIENTRY
|
||||||
NtGdiCombineTransform(
|
NtGdiCombineTransform(
|
||||||
|
@ -313,7 +313,7 @@ NtGdiTransformPoints(
|
||||||
|
|
||||||
_SEH2_TRY
|
_SEH2_TRY
|
||||||
{
|
{
|
||||||
/* pointer was already probed! */
|
/* Pointer was already probed! */
|
||||||
RtlCopyMemory(UnsafePtOut, Points, Size);
|
RtlCopyMemory(UnsafePtOut, Points, Size);
|
||||||
}
|
}
|
||||||
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
|
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
|
||||||
|
@ -385,7 +385,7 @@ NtGdiModifyWorldTransform(
|
||||||
DWORD Mode)
|
DWORD Mode)
|
||||||
{
|
{
|
||||||
PDC dc;
|
PDC dc;
|
||||||
XFORM SafeXForm; //FIXME: use XFORML
|
XFORM SafeXForm; // FIXME: Use XFORML
|
||||||
BOOL Ret = TRUE;
|
BOOL Ret = TRUE;
|
||||||
|
|
||||||
dc = DC_LockDc(hDC);
|
dc = DC_LockDc(hDC);
|
||||||
|
|
|
@ -11,13 +11,13 @@
|
||||||
#define NDEBUG
|
#define NDEBUG
|
||||||
#include <debug.h>
|
#include <debug.h>
|
||||||
|
|
||||||
//FIXME: windows uses 0x0012009f
|
// FIXME: Windows uses 0x0012009f
|
||||||
#define DIRTY_DEFAULT DIRTY_CHARSET|DIRTY_BACKGROUND|DIRTY_TEXT|DIRTY_LINE|DIRTY_FILL
|
#define DIRTY_DEFAULT DIRTY_CHARSET|DIRTY_BACKGROUND|DIRTY_TEXT|DIRTY_LINE|DIRTY_FILL
|
||||||
|
|
||||||
PSURFACE psurfDefaultBitmap = NULL;
|
PSURFACE psurfDefaultBitmap = NULL;
|
||||||
PBRUSH pbrDefaultBrush = NULL;
|
PBRUSH pbrDefaultBrush = NULL;
|
||||||
|
|
||||||
// FIXME: these should go to floatobj.h or something
|
// FIXME: These should go to floatobj.h or something
|
||||||
#ifdef _M_IX86
|
#ifdef _M_IX86
|
||||||
#define FLOATOBJ_0 {0x00000000, 0x00000000}
|
#define FLOATOBJ_0 {0x00000000, 0x00000000}
|
||||||
#define FLOATOBJ_1 {0x40000000, 0x00000002}
|
#define FLOATOBJ_1 {0x40000000, 0x00000002}
|
||||||
|
@ -626,7 +626,7 @@ GreOpenDCW(
|
||||||
|
|
||||||
DC_UnlockDc(pdc);
|
DC_UnlockDc(pdc);
|
||||||
|
|
||||||
DPRINT("returning hdc = %p\n", hdc);
|
DPRINT("Returning hdc = %p\n", hdc);
|
||||||
|
|
||||||
return hdc;
|
return hdc;
|
||||||
}
|
}
|
||||||
|
@ -820,8 +820,8 @@ IntGdiDeleteDC(HDC hDC, BOOL Force)
|
||||||
DC_UnlockDc(DCToDelete);
|
DC_UnlockDc(DCToDelete);
|
||||||
if(UserReleaseDC(NULL, hDC, FALSE))
|
if(UserReleaseDC(NULL, hDC, FALSE))
|
||||||
{
|
{
|
||||||
/* ReactOs feature : call UserReleaseDC
|
/* ReactOS feature: Call UserReleaseDC
|
||||||
* I don't think windows does it.
|
* I don't think Windows does it.
|
||||||
* Still, complain, no one should ever call DeleteDC
|
* Still, complain, no one should ever call DeleteDC
|
||||||
* on a window DC */
|
* on a window DC */
|
||||||
DPRINT1("No, you naughty application!\n");
|
DPRINT1("No, you naughty application!\n");
|
||||||
|
@ -858,7 +858,7 @@ APIENTRY
|
||||||
NtGdiDeleteObjectApp(HANDLE hobj)
|
NtGdiDeleteObjectApp(HANDLE hobj)
|
||||||
{
|
{
|
||||||
/* Complete all pending operations */
|
/* Complete all pending operations */
|
||||||
NtGdiFlushUserBatch(); // FIXME: we shouldn't need this
|
NtGdiFlushUserBatch(); // FIXME: We shouldn't need this
|
||||||
|
|
||||||
if (GDI_HANDLE_IS_STOCKOBJ(hobj)) return TRUE;
|
if (GDI_HANDLE_IS_STOCKOBJ(hobj)) return TRUE;
|
||||||
|
|
||||||
|
@ -871,7 +871,7 @@ NtGdiDeleteObjectApp(HANDLE hobj)
|
||||||
if (GDI_HANDLE_GET_TYPE(hobj) != GDI_OBJECT_TYPE_DC)
|
if (GDI_HANDLE_GET_TYPE(hobj) != GDI_OBJECT_TYPE_DC)
|
||||||
return GreDeleteObject(hobj);
|
return GreDeleteObject(hobj);
|
||||||
|
|
||||||
// FIXME: everything should be callback based
|
// FIXME: Everything should be callback based
|
||||||
return IntGdiDeleteDC(hobj, FALSE);
|
return IntGdiDeleteDC(hobj, FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
/*
|
/*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS Win32k subsystem
|
||||||
* PURPOSE: Functions for creation and destruction of DCs
|
* PURPOSE: Functions for creation and destruction of DCs
|
||||||
* FILE: subsystem/win32/win32k/objects/dcobjs.c
|
* FILE: subsystems/win32/win32k/objects/dcobjs.c
|
||||||
* PROGRAMER: Timo Kreuzer (timo.kreuzer@rectos.org)
|
* PROGRAMER: Timo Kreuzer (timo.kreuzer@rectos.org)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -149,7 +149,7 @@ GdiSelectPalette(
|
||||||
HPALETTE oldPal = NULL;
|
HPALETTE oldPal = NULL;
|
||||||
PPALETTE ppal;
|
PPALETTE ppal;
|
||||||
|
|
||||||
// FIXME: mark the palette as a [fore\back]ground pal
|
// FIXME: Mark the palette as a [fore\back]ground pal
|
||||||
pdc = DC_LockDc(hDC);
|
pdc = DC_LockDc(hDC);
|
||||||
if (!pdc)
|
if (!pdc)
|
||||||
{
|
{
|
||||||
|
@ -357,7 +357,7 @@ NtGdiSelectBitmap(
|
||||||
/* Unlock the DC */
|
/* Unlock the DC */
|
||||||
DC_UnlockDc(pdc);
|
DC_UnlockDc(pdc);
|
||||||
|
|
||||||
/* FIXME; improve by using a region without a handle and selecting it */
|
/* FIXME: Improve by using a region without a handle and selecting it */
|
||||||
hVisRgn = IntSysCreateRectRgn( 0,
|
hVisRgn = IntSysCreateRectRgn( 0,
|
||||||
0,
|
0,
|
||||||
sizlBitmap.cx,
|
sizlBitmap.cx,
|
||||||
|
@ -493,20 +493,20 @@ NtGdiGetDCObject(HDC hDC, INT ObjectType)
|
||||||
return SelObject;
|
return SelObject;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* See wine, msdn, osr and Feng Yuan - Windows Graphics Programming Win32 Gdi And Directdraw
|
/* See WINE, MSDN, OSR and Feng Yuan - Windows Graphics Programming Win32 GDI and DirectDraw
|
||||||
|
*
|
||||||
1st: http://www.codeproject.com/gdi/cliprgnguide.asp is wrong!
|
* 1st: http://www.codeproject.com/gdi/cliprgnguide.asp is wrong!
|
||||||
|
*
|
||||||
The intersection of the clip with the meta region is not Rao it's API!
|
* The intersection of the clip with the meta region is not Rao it's API!
|
||||||
Go back and read 7.2 Clipping pages 418-19:
|
* Go back and read 7.2 Clipping pages 418-19:
|
||||||
Rao = API & Vis:
|
* Rao = API & Vis:
|
||||||
1) The Rao region is the intersection of the API region and the system region,
|
* 1) The Rao region is the intersection of the API region and the system region,
|
||||||
named after the Microsoft engineer who initially proposed it.
|
* named after the Microsoft engineer who initially proposed it.
|
||||||
2) The Rao region can be calculated from the API region and the system region.
|
* 2) The Rao region can be calculated from the API region and the system region.
|
||||||
|
*
|
||||||
API:
|
* API:
|
||||||
API region is the intersection of the meta region and the clipping region,
|
* API region is the intersection of the meta region and the clipping region,
|
||||||
clearly named after the fact that it is controlled by GDI API calls.
|
* clearly named after the fact that it is controlled by GDI API calls.
|
||||||
*/
|
*/
|
||||||
INT
|
INT
|
||||||
APIENTRY
|
APIENTRY
|
||||||
|
@ -583,3 +583,4 @@ NtGdiEnumObjects(
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* EOF */
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
/*
|
/*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS Win32k subsystem
|
||||||
* PURPOSE: Functions for saving and restoring dc states
|
* PURPOSE: Functions for saving and restoring dc states
|
||||||
* FILE: subsystem/win32/win32k/objects/dcstate.c
|
* FILE: subsystems/win32/win32k/objects/dcstate.c
|
||||||
* PROGRAMER: Timo Kreuzer (timo.kreuzer@rectos.org)
|
* PROGRAMER: Timo Kreuzer (timo.kreuzer@rectos.org)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -45,7 +45,7 @@ DC_vCopyState(PDC pdcSrc, PDC pdcDst, BOOL To)
|
||||||
DC_vSelectLineBrush(pdcDst, pdcSrc->dclevel.pbrLine);
|
DC_vSelectLineBrush(pdcDst, pdcSrc->dclevel.pbrLine);
|
||||||
DC_vSelectPalette(pdcDst, pdcSrc->dclevel.ppal);
|
DC_vSelectPalette(pdcDst, pdcSrc->dclevel.ppal);
|
||||||
|
|
||||||
// FIXME: handle refs
|
// FIXME: Handle refs
|
||||||
pdcDst->dclevel.plfnt = pdcSrc->dclevel.plfnt;
|
pdcDst->dclevel.plfnt = pdcSrc->dclevel.plfnt;
|
||||||
|
|
||||||
/* Get/SetDCState() don't change hVisRgn field ("Undoc. Windows" p.559). */
|
/* Get/SetDCState() don't change hVisRgn field ("Undoc. Windows" p.559). */
|
||||||
|
@ -56,7 +56,7 @@ DC_vCopyState(PDC pdcSrc, PDC pdcDst, BOOL To)
|
||||||
pdcDst->rosdc.hClipRgn = IntSysCreateRectRgn(0, 0, 0, 0);
|
pdcDst->rosdc.hClipRgn = IntSysCreateRectRgn(0, 0, 0, 0);
|
||||||
NtGdiCombineRgn(pdcDst->rosdc.hClipRgn, pdcSrc->rosdc.hClipRgn, 0, RGN_COPY);
|
NtGdiCombineRgn(pdcDst->rosdc.hClipRgn, pdcSrc->rosdc.hClipRgn, 0, RGN_COPY);
|
||||||
}
|
}
|
||||||
// FIXME! Handle prgnMeta!
|
// FIXME: Handle prgnMeta!
|
||||||
}
|
}
|
||||||
else // Copy "!To" RestoreDC state.
|
else // Copy "!To" RestoreDC state.
|
||||||
{ /* The VisRectRegion field needs to be set to a valid state */
|
{ /* The VisRectRegion field needs to be set to a valid state */
|
||||||
|
@ -256,7 +256,7 @@ NtGdiSaveDC(
|
||||||
//pdcSrc->dclevel.ppal = NULL;
|
//pdcSrc->dclevel.ppal = NULL;
|
||||||
|
|
||||||
/* Make it a kernel handle
|
/* Make it a kernel handle
|
||||||
(FIXME: windows handles this different, see wiki)*/
|
(FIXME: Windows handles this differently, see Wiki) */
|
||||||
GreSetObjectOwner(hdcSave, GDI_OBJ_HMGR_PUBLIC);
|
GreSetObjectOwner(hdcSave, GDI_OBJ_HMGR_PUBLIC);
|
||||||
|
|
||||||
/* Copy the current state */
|
/* Copy the current state */
|
||||||
|
@ -266,7 +266,8 @@ NtGdiSaveDC(
|
||||||
if (pdc->dctype == DCTYPE_MEMORY)
|
if (pdc->dctype == DCTYPE_MEMORY)
|
||||||
DC_vSelectSurface(pdcSave, pdc->dclevel.pSurface);
|
DC_vSelectSurface(pdcSave, pdc->dclevel.pSurface);
|
||||||
|
|
||||||
/* Copy path. FIXME: why this way? */
|
/* Copy path */
|
||||||
|
/* FIXME: Why this way? */
|
||||||
pdcSave->dclevel.hPath = pdc->dclevel.hPath;
|
pdcSave->dclevel.hPath = pdc->dclevel.hPath;
|
||||||
pdcSave->dclevel.flPath = pdc->dclevel.flPath | DCPATH_SAVESTATE;
|
pdcSave->dclevel.flPath = pdc->dclevel.flPath | DCPATH_SAVESTATE;
|
||||||
if (pdcSave->dclevel.hPath) pdcSave->dclevel.flPath |= DCPATH_SAVE;
|
if (pdcSave->dclevel.hPath) pdcSave->dclevel.flPath |= DCPATH_SAVE;
|
||||||
|
@ -285,3 +286,4 @@ NtGdiSaveDC(
|
||||||
return lSaveDepth;
|
return lSaveDepth;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* EOF */
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
|
|
||||||
#include <win32k.h>
|
#include <win32k.h>
|
||||||
|
|
||||||
#define NDEBUG
|
#define NDEBUG
|
||||||
|
@ -180,7 +179,7 @@ IntSetDefaultRegion(PDC pdc)
|
||||||
pdc->ptlDCOrig.y = 0;
|
pdc->ptlDCOrig.y = 0;
|
||||||
pdc->erclWindow = rclWnd;
|
pdc->erclWindow = rclWnd;
|
||||||
pdc->erclClip = rclClip;
|
pdc->erclClip = rclClip;
|
||||||
/* Might be an InitDC or DCE....*/
|
/* Might be an InitDC or DCE... */
|
||||||
pdc->ptlFillOrigin.x = pdc->dcattr.VisRectRegion.Rect.right;
|
pdc->ptlFillOrigin.x = pdc->dcattr.VisRectRegion.Rect.right;
|
||||||
pdc->ptlFillOrigin.y = pdc->dcattr.VisRectRegion.Rect.bottom;
|
pdc->ptlFillOrigin.y = pdc->dcattr.VisRectRegion.Rect.bottom;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
@ -211,11 +210,9 @@ IntGdiSetHookFlags(HDC hDC, WORD Flags)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
wRet = dc->fs & DC_FLAG_DIRTY_RAO; // Fixme wrong flag!
|
wRet = dc->fs & DC_FLAG_DIRTY_RAO; // FIXME: Wrong flag!
|
||||||
|
|
||||||
/* "Undocumented Windows" info is slightly confusing.
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
/* Info in "Undocumented Windows" is slightly confusing. */
|
||||||
DPRINT("DC %p, Flags %04x\n", hDC, Flags);
|
DPRINT("DC %p, Flags %04x\n", hDC, Flags);
|
||||||
|
|
||||||
if (Flags & DCHF_INVALIDATEVISRGN)
|
if (Flags & DCHF_INVALIDATEVISRGN)
|
||||||
|
|
|
@ -32,13 +32,13 @@ IntCreatePrimarySurface()
|
||||||
SURFOBJ *pso;
|
SURFOBJ *pso;
|
||||||
BOOL calledFromUser;
|
BOOL calledFromUser;
|
||||||
|
|
||||||
calledFromUser = UserIsEntered(); //fixme: possibly upgrade a shared lock
|
calledFromUser = UserIsEntered(); // FIXME: Possibly upgrade a shared lock
|
||||||
if (!calledFromUser)
|
if (!calledFromUser)
|
||||||
{
|
{
|
||||||
UserEnterExclusive();
|
UserEnterExclusive();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* attach monitor */
|
/* Attach monitor */
|
||||||
IntAttachMonitor(gppdevPrimary, 0);
|
IntAttachMonitor(gppdevPrimary, 0);
|
||||||
|
|
||||||
DPRINT("IntCreatePrimarySurface, pPrimarySurface=%p, pPrimarySurface->pSurface = %p\n",
|
DPRINT("IntCreatePrimarySurface, pPrimarySurface=%p, pPrimarySurface->pSurface = %p\n",
|
||||||
|
|
|
@ -275,7 +275,7 @@ IntSetDIBits(
|
||||||
|
|
||||||
if(!(psurfSrc && psurfDst))
|
if(!(psurfSrc && psurfDst))
|
||||||
{
|
{
|
||||||
DPRINT1("Error, could not lock surfaces\n");
|
DPRINT1("Error: Could not lock surfaces\n");
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -998,7 +998,7 @@ NtGdiStretchDIBitsInternal(
|
||||||
IN OPTIONAL LPBYTE pjInit,
|
IN OPTIONAL LPBYTE pjInit,
|
||||||
IN LPBITMAPINFO pbmi,
|
IN LPBITMAPINFO pbmi,
|
||||||
IN DWORD dwUsage,
|
IN DWORD dwUsage,
|
||||||
IN DWORD dwRop, // ms ntgdi.h says dwRop4(?)
|
IN DWORD dwRop, // MS ntgdi.h says dwRop4(?)
|
||||||
IN UINT cjMaxInfo,
|
IN UINT cjMaxInfo,
|
||||||
IN UINT cjMaxBits,
|
IN UINT cjMaxBits,
|
||||||
IN HANDLE hcmXform)
|
IN HANDLE hcmXform)
|
||||||
|
@ -1065,7 +1065,7 @@ NtGdiStretchDIBitsInternal(
|
||||||
}
|
}
|
||||||
_SEH2_END
|
_SEH2_END
|
||||||
|
|
||||||
/* FIXME: locking twice is cheesy, coord tranlation in UM will fix it */
|
/* FIXME: Locking twice is cheesy, coord tranlation in UM will fix it */
|
||||||
if (!(pdc = DC_LockDc(hdc)))
|
if (!(pdc = DC_LockDc(hdc)))
|
||||||
{
|
{
|
||||||
DPRINT1("Could not lock dc\n");
|
DPRINT1("Could not lock dc\n");
|
||||||
|
@ -1608,7 +1608,7 @@ DIB_CreateDIBSection(
|
||||||
cleanup:
|
cleanup:
|
||||||
if (!res || !bmp || !bm.bmBits)
|
if (!res || !bmp || !bm.bmBits)
|
||||||
{
|
{
|
||||||
DPRINT("got an error res=%08x, bmp=%p, bm.bmBits=%p\n", res, bmp, bm.bmBits);
|
DPRINT("Got an error res=%08x, bmp=%p, bm.bmBits=%p\n", res, bmp, bm.bmBits);
|
||||||
if (bm.bmBits)
|
if (bm.bmBits)
|
||||||
{
|
{
|
||||||
// MmUnsecureVirtualMemory(hSecure); // FIXME: Implement this!
|
// MmUnsecureVirtualMemory(hSecure); // FIXME: Implement this!
|
||||||
|
@ -1667,7 +1667,7 @@ DIB_GetBitmapInfo( const BITMAPINFOHEADER *header, LONG *width,
|
||||||
*size = 0;
|
*size = 0;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
if (header->biSize >= sizeof(BITMAPINFOHEADER)) /* assume BITMAPINFOHEADER */
|
if (header->biSize >= sizeof(BITMAPINFOHEADER)) /* Assume BITMAPINFOHEADER */
|
||||||
{
|
{
|
||||||
*width = header->biWidth;
|
*width = header->biWidth;
|
||||||
*height = header->biHeight;
|
*height = header->biHeight;
|
||||||
|
@ -1711,7 +1711,7 @@ INT FASTCALL DIB_BitmapInfoSize(const BITMAPINFO * info, WORD coloruse)
|
||||||
return sizeof(BITMAPCOREHEADER) + colors *
|
return sizeof(BITMAPCOREHEADER) + colors *
|
||||||
((coloruse == DIB_RGB_COLORS) ? sizeof(RGBTRIPLE) : sizeof(WORD));
|
((coloruse == DIB_RGB_COLORS) ? sizeof(RGBTRIPLE) : sizeof(WORD));
|
||||||
}
|
}
|
||||||
else /* assume BITMAPINFOHEADER */
|
else /* Assume BITMAPINFOHEADER */
|
||||||
{
|
{
|
||||||
colors = info->bmiHeader.biClrUsed;
|
colors = info->bmiHeader.biClrUsed;
|
||||||
if (colors > 256) colors = 256;
|
if (colors > 256) colors = 256;
|
||||||
|
@ -1888,7 +1888,7 @@ DIB_ConvertBitmapInfo (CONST BITMAPINFO* pbmi, DWORD Usage)
|
||||||
}
|
}
|
||||||
else if (Usage == DIB_PAL_COLORS)
|
else if (Usage == DIB_PAL_COLORS)
|
||||||
{
|
{
|
||||||
/* Invalid at high Res */
|
/* Invalid at high-res */
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1934,9 +1934,4 @@ DIB_FreeConvertedBitmapInfo(BITMAPINFO* converted, BITMAPINFO* orig)
|
||||||
ExFreePoolWithTag(converted, TAG_DIB);
|
ExFreePoolWithTag(converted, TAG_DIB);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* EOF */
|
/* EOF */
|
||||||
|
|
|
@ -59,8 +59,8 @@ SUCH DAMAGE.
|
||||||
|
|
||||||
typedef struct _Rect
|
typedef struct _Rect
|
||||||
{
|
{
|
||||||
int x, y; /* top-left point inside rect */
|
int x, y; /* Top-left point inside rect */
|
||||||
int width, height; /* width and height of rect */
|
int width, height; /* Width and height of rect */
|
||||||
} Rect, *PRect;
|
} Rect, *PRect;
|
||||||
|
|
||||||
int FASTCALL IntFillRect(DC *dc, INT XLeft, INT YLeft, INT Width, INT Height, PBRUSH pbrush, BOOL Pen);
|
int FASTCALL IntFillRect(DC *dc, INT XLeft, INT YLeft, INT Width, INT Height, PBRUSH pbrush, BOOL Pen);
|
||||||
|
@ -186,21 +186,21 @@ app_draw_ellipse(DC *g, Rect r, PBRUSH pbrush)
|
||||||
|
|
||||||
if (T + A2*Y < XCRIT) /* E(X+1,Y-1/2) <= 0 */
|
if (T + A2*Y < XCRIT) /* E(X+1,Y-1/2) <= 0 */
|
||||||
{
|
{
|
||||||
/* move outwards to encounter edge */
|
/* Move outwards to encounter edge */
|
||||||
X += 1;
|
X += 1;
|
||||||
T += DXT;
|
T += DXT;
|
||||||
DXT += D2XT;
|
DXT += D2XT;
|
||||||
}
|
}
|
||||||
else if (T - B2*X >= YCRIT) /* e(x+1/2,y-1) > 0 */
|
else if (T - B2*X >= YCRIT) /* e(x+1/2,y-1) > 0 */
|
||||||
{
|
{
|
||||||
/* drop down one line */
|
/* Drop down one line */
|
||||||
Y -= 1;
|
Y -= 1;
|
||||||
T += DYT;
|
T += DYT;
|
||||||
DYT += D2YT;
|
DYT += D2YT;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* drop diagonally down and out */
|
/* Drop diagonally down and out */
|
||||||
X += 1;
|
X += 1;
|
||||||
Y -= 1;
|
Y -= 1;
|
||||||
T += DXT + DYT;
|
T += DXT + DYT;
|
||||||
|
@ -219,7 +219,7 @@ app_draw_ellipse(DC *g, Rect r, PBRUSH pbrush)
|
||||||
|
|
||||||
if (t + a2*y < xcrit) /* e(x+1,y-1/2) <= 0 */
|
if (t + a2*y < xcrit) /* e(x+1,y-1/2) <= 0 */
|
||||||
{
|
{
|
||||||
/* move outwards to encounter edge */
|
/* Move outwards to encounter edge */
|
||||||
x += 1;
|
x += 1;
|
||||||
t += dxt;
|
t += dxt;
|
||||||
dxt += d2xt;
|
dxt += d2xt;
|
||||||
|
@ -228,7 +228,7 @@ app_draw_ellipse(DC *g, Rect r, PBRUSH pbrush)
|
||||||
}
|
}
|
||||||
else if (t - b2*x >= ycrit) /* e(x+1/2,y-1) > 0 */
|
else if (t - b2*x >= ycrit) /* e(x+1/2,y-1) > 0 */
|
||||||
{
|
{
|
||||||
/* drop down one line */
|
/* Drop down one line */
|
||||||
y -= 1;
|
y -= 1;
|
||||||
t += dyt;
|
t += dyt;
|
||||||
dyt += d2yt;
|
dyt += d2yt;
|
||||||
|
@ -237,7 +237,7 @@ app_draw_ellipse(DC *g, Rect r, PBRUSH pbrush)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* drop diagonally down and out */
|
/* Drop diagonally down and out */
|
||||||
x += 1;
|
x += 1;
|
||||||
y -= 1;
|
y -= 1;
|
||||||
t += dxt + dyt;
|
t += dxt + dyt;
|
||||||
|
@ -279,7 +279,7 @@ app_draw_ellipse(DC *g, Rect r, PBRUSH pbrush)
|
||||||
}
|
}
|
||||||
else if (r1.y+r1.height < r2.y)
|
else if (r1.y+r1.height < r2.y)
|
||||||
{
|
{
|
||||||
/* draw distinct rectangles */
|
/* Draw distinct rectangles */
|
||||||
result &= app_fill_rect(g, rect(r1.x,r1.y,
|
result &= app_fill_rect(g, rect(r1.x,r1.y,
|
||||||
W,1), pbrush, TRUE);
|
W,1), pbrush, TRUE);
|
||||||
result &= app_fill_rect(g, rect(
|
result &= app_fill_rect(g, rect(
|
||||||
|
@ -293,14 +293,14 @@ app_draw_ellipse(DC *g, Rect r, PBRUSH pbrush)
|
||||||
prevy = r1.y;
|
prevy = r1.y;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* move down */
|
/* Move down */
|
||||||
r1.y += 1;
|
r1.y += 1;
|
||||||
r2.y -= 1;
|
r2.y -= 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (moveout)
|
if (moveout)
|
||||||
{
|
{
|
||||||
/* move outwards */
|
/* Move outwards */
|
||||||
r1.x -= 1;
|
r1.x -= 1;
|
||||||
r1.width += 2;
|
r1.width += 2;
|
||||||
r2.x -= 1;
|
r2.x -= 1;
|
||||||
|
@ -309,7 +309,7 @@ app_draw_ellipse(DC *g, Rect r, PBRUSH pbrush)
|
||||||
}
|
}
|
||||||
if ((x <= a) && (prevy < r2.y))
|
if ((x <= a) && (prevy < r2.y))
|
||||||
{
|
{
|
||||||
/* draw final line */
|
/* Draw final line */
|
||||||
r1.height = r1.y+r1.height-r2.y;
|
r1.height = r1.y+r1.height-r2.y;
|
||||||
r1.y = r2.y;
|
r1.y = r2.y;
|
||||||
|
|
||||||
|
@ -390,11 +390,11 @@ app_fill_arc_rect(DC *g,
|
||||||
|
|
||||||
if (r.y <= p0.y) //
|
if (r.y <= p0.y) //
|
||||||
{
|
{
|
||||||
/* in top half of arc ellipse */
|
/* In top half of arc ellipse */
|
||||||
|
|
||||||
if (p1.y <= r.y)
|
if (p1.y <= r.y)
|
||||||
{
|
{
|
||||||
/* start_line is in the top half and is */
|
/* Start_line is in the top half and is */
|
||||||
/* intersected by the current Y scan line */
|
/* intersected by the current Y scan line */
|
||||||
if (rise1 == 0)
|
if (rise1 == 0)
|
||||||
x1 = p1.x;
|
x1 = p1.x;
|
||||||
|
@ -404,13 +404,13 @@ app_fill_arc_rect(DC *g,
|
||||||
}
|
}
|
||||||
else if ((start_angle >= 0) && (start_angle <= 180))
|
else if ((start_angle >= 0) && (start_angle <= 180))
|
||||||
{
|
{
|
||||||
/* start_line is above middle */
|
/* Start_line is above middle */
|
||||||
x1 = p1.x;
|
x1 = p1.x;
|
||||||
start_above = 1;
|
start_above = 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* start_line is below middle */
|
/* Start_line is below middle */
|
||||||
x1 = r.x + r.width;
|
x1 = r.x + r.width;
|
||||||
start_above = 0;
|
start_above = 0;
|
||||||
}
|
}
|
||||||
|
@ -450,7 +450,7 @@ app_fill_arc_rect(DC *g,
|
||||||
{
|
{
|
||||||
if (start_angle > end_angle)
|
if (start_angle > end_angle)
|
||||||
{
|
{
|
||||||
/* fill outsides of wedge */
|
/* Fill outsides of wedge */
|
||||||
if (! app_fill_rect(g, rect(r.x, r.y,
|
if (! app_fill_rect(g, rect(r.x, r.y,
|
||||||
x1-r.x, r.height), pbrush, Pen))
|
x1-r.x, r.height), pbrush, Pen))
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -459,7 +459,7 @@ app_fill_arc_rect(DC *g,
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* fill inside of wedge */
|
/* Fill inside of wedge */
|
||||||
r.width = x1-x2;
|
r.width = x1-x2;
|
||||||
r.x = x2;
|
r.x = x2;
|
||||||
return app_fill_rect(g, r, pbrush, Pen);
|
return app_fill_rect(g, r, pbrush, Pen);
|
||||||
|
@ -467,13 +467,13 @@ app_fill_arc_rect(DC *g,
|
||||||
}
|
}
|
||||||
else if (start_above)
|
else if (start_above)
|
||||||
{
|
{
|
||||||
/* fill to the left of the start_line */
|
/* Fill to the left of the start_line */
|
||||||
r.width = x1-r.x;
|
r.width = x1-r.x;
|
||||||
return app_fill_rect(g, r, pbrush, Pen);
|
return app_fill_rect(g, r, pbrush, Pen);
|
||||||
}
|
}
|
||||||
else if (end_above)
|
else if (end_above)
|
||||||
{
|
{
|
||||||
/* fill right of end_line */
|
/* Fill right of end_line */
|
||||||
r.width = r.x+r.width-x2;
|
r.width = r.x+r.width-x2;
|
||||||
r.x = x2;
|
r.x = x2;
|
||||||
return app_fill_rect(g, r, pbrush, Pen);
|
return app_fill_rect(g, r, pbrush, Pen);
|
||||||
|
@ -488,7 +488,7 @@ app_fill_arc_rect(DC *g,
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* in lower half of arc ellipse */
|
/* In lower half of arc ellipse */
|
||||||
|
|
||||||
if (p1.y >= r.y)
|
if (p1.y >= r.y)
|
||||||
{
|
{
|
||||||
|
@ -553,13 +553,13 @@ app_fill_arc_rect(DC *g,
|
||||||
}
|
}
|
||||||
else if (start_above)
|
else if (start_above)
|
||||||
{
|
{
|
||||||
/* fill to the left of end_line */
|
/* Fill to the left of end_line */
|
||||||
r.width = x2-r.x;
|
r.width = x2-r.x;
|
||||||
return app_fill_rect(g,r, pbrush, Pen);
|
return app_fill_rect(g,r, pbrush, Pen);
|
||||||
}
|
}
|
||||||
else if (end_above)
|
else if (end_above)
|
||||||
{
|
{
|
||||||
/* fill right of start_line */
|
/* Fill right of start_line */
|
||||||
r.width = r.x+r.width-x1;
|
r.width = r.x+r.width-x1;
|
||||||
r.x = x1;
|
r.x = x1;
|
||||||
return app_fill_rect(g,r, pbrush, Pen);
|
return app_fill_rect(g,r, pbrush, Pen);
|
||||||
|
@ -568,7 +568,7 @@ app_fill_arc_rect(DC *g,
|
||||||
{
|
{
|
||||||
if (start_angle > end_angle)
|
if (start_angle > end_angle)
|
||||||
{
|
{
|
||||||
/* fill outsides of wedge */
|
/* Fill outsides of wedge */
|
||||||
if (! app_fill_rect(g, rect(r.x, r.y,
|
if (! app_fill_rect(g, rect(r.x, r.y,
|
||||||
x2-r.x, r.height), pbrush, Pen))
|
x2-r.x, r.height), pbrush, Pen))
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -577,7 +577,7 @@ app_fill_arc_rect(DC *g,
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* fill inside of wedge */
|
/* Fill inside of wedge */
|
||||||
r.width = x2-x1;
|
r.width = x2-x1;
|
||||||
r.x = x1;
|
r.x = x1;
|
||||||
return app_fill_rect(g, r, pbrush, Pen);
|
return app_fill_rect(g, r, pbrush, Pen);
|
||||||
|
@ -653,12 +653,12 @@ app_fill_ellipse(DC *g, Rect r, PBRUSH pbrush)
|
||||||
{
|
{
|
||||||
if (t + a2*y < xcrit) /* e(x+1,y-1/2) <= 0 */
|
if (t + a2*y < xcrit) /* e(x+1,y-1/2) <= 0 */
|
||||||
{
|
{
|
||||||
/* move outwards to encounter edge */
|
/* Move outwards to encounter edge */
|
||||||
x += 1;
|
x += 1;
|
||||||
t += dxt;
|
t += dxt;
|
||||||
dxt += d2xt;
|
dxt += d2xt;
|
||||||
|
|
||||||
/* move outwards */
|
/* Move outwards */
|
||||||
r1.x -= 1;
|
r1.x -= 1;
|
||||||
r1.width += 2;
|
r1.width += 2;
|
||||||
r2.x -= 1;
|
r2.x -= 1;
|
||||||
|
@ -666,19 +666,19 @@ app_fill_ellipse(DC *g, Rect r, PBRUSH pbrush)
|
||||||
}
|
}
|
||||||
else if (t - b2*x >= ycrit) /* e(x+1/2,y-1) > 0 */
|
else if (t - b2*x >= ycrit) /* e(x+1/2,y-1) > 0 */
|
||||||
{
|
{
|
||||||
/* drop down one line */
|
/* Drop down one line */
|
||||||
y -= 1;
|
y -= 1;
|
||||||
t += dyt;
|
t += dyt;
|
||||||
dyt += d2yt;
|
dyt += d2yt;
|
||||||
|
|
||||||
/* enlarge rectangles */
|
/* Enlarge rectangles */
|
||||||
r1.height += 1;
|
r1.height += 1;
|
||||||
r2.height += 1;
|
r2.height += 1;
|
||||||
r2.y -= 1;
|
r2.y -= 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* drop diagonally down and out */
|
/* Drop diagonally down and out */
|
||||||
x += 1;
|
x += 1;
|
||||||
y -= 1;
|
y -= 1;
|
||||||
t += dxt + dyt;
|
t += dxt + dyt;
|
||||||
|
@ -687,16 +687,16 @@ app_fill_ellipse(DC *g, Rect r, PBRUSH pbrush)
|
||||||
|
|
||||||
if ((r1.width > 0) && (r1.height > 0))
|
if ((r1.width > 0) && (r1.height > 0))
|
||||||
{
|
{
|
||||||
/* draw rectangles first */
|
/* Draw rectangles first */
|
||||||
|
|
||||||
if (r1.y+r1.height < r2.y)
|
if (r1.y+r1.height < r2.y)
|
||||||
{
|
{
|
||||||
/* distinct rectangles */
|
/* Distinct rectangles */
|
||||||
result &= app_fill_rect(g, r1, pbrush, FALSE);
|
result &= app_fill_rect(g, r1, pbrush, FALSE);
|
||||||
result &= app_fill_rect(g, r2, pbrush, FALSE);
|
result &= app_fill_rect(g, r2, pbrush, FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* move down */
|
/* Move down */
|
||||||
r1.y += r1.height;
|
r1.y += r1.height;
|
||||||
r1.height = 1;
|
r1.height = 1;
|
||||||
r2.y -= 1;
|
r2.y -= 1;
|
||||||
|
@ -704,15 +704,15 @@ app_fill_ellipse(DC *g, Rect r, PBRUSH pbrush)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* skipped pixels on initial diagonal */
|
/* Skipped pixels on initial diagonal */
|
||||||
|
|
||||||
/* enlarge, rather than moving down */
|
/* Enlarge, rather than moving down */
|
||||||
r1.height += 1;
|
r1.height += 1;
|
||||||
r2.height += 1;
|
r2.height += 1;
|
||||||
r2.y -= 1;
|
r2.y -= 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* move outwards */
|
/* Move outwards */
|
||||||
r1.x -= 1;
|
r1.x -= 1;
|
||||||
r1.width += 2;
|
r1.width += 2;
|
||||||
r2.x -= 1;
|
r2.x -= 1;
|
||||||
|
@ -721,7 +721,7 @@ app_fill_ellipse(DC *g, Rect r, PBRUSH pbrush)
|
||||||
}
|
}
|
||||||
if (r1.y < r2.y)
|
if (r1.y < r2.y)
|
||||||
{
|
{
|
||||||
/* overlap */
|
/* Overlap */
|
||||||
r1.x = r.x;
|
r1.x = r.x;
|
||||||
r1.width = r.width;
|
r1.width = r.width;
|
||||||
r1.height = r2.y+r2.height-r1.y;
|
r1.height = r2.y+r2.height-r1.y;
|
||||||
|
@ -729,7 +729,7 @@ app_fill_ellipse(DC *g, Rect r, PBRUSH pbrush)
|
||||||
}
|
}
|
||||||
else if (x <= a)
|
else if (x <= a)
|
||||||
{
|
{
|
||||||
/* crossover, draw final line */
|
/* Crossover, draw final line */
|
||||||
r1.x = r.x;
|
r1.x = r.x;
|
||||||
r1.width = r.width;
|
r1.width = r.width;
|
||||||
r1.height = r1.y+r1.height-r2.y;
|
r1.height = r1.y+r1.height-r2.y;
|
||||||
|
@ -807,33 +807,33 @@ app_fill_arc(DC *g, Rect r, int start_angle, int end_angle, PBRUSH pbrush, BOOL
|
||||||
int movedown, moveout;
|
int movedown, moveout;
|
||||||
int result = 1;
|
int result = 1;
|
||||||
|
|
||||||
/* line descriptions */
|
/* Line descriptions */
|
||||||
POINT p0, p1, p2;
|
POINT p0, p1, p2;
|
||||||
|
|
||||||
// START_DEBUG();
|
// START_DEBUG();
|
||||||
|
|
||||||
/* if angles differ by 360 degrees or more, close the shape */
|
/* If angles differ by 360 degrees or more, close the shape */
|
||||||
if ((start_angle + 360 <= end_angle) ||
|
if ((start_angle + 360 <= end_angle) ||
|
||||||
(start_angle - 360 >= end_angle))
|
(start_angle - 360 >= end_angle))
|
||||||
{
|
{
|
||||||
return app_fill_ellipse(g, r, pbrush);
|
return app_fill_ellipse(g, r, pbrush);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* make start_angle >= 0 and <= 360 */
|
/* Make start_angle >= 0 and <= 360 */
|
||||||
while (start_angle < 0)
|
while (start_angle < 0)
|
||||||
start_angle += 360;
|
start_angle += 360;
|
||||||
start_angle %= 360;
|
start_angle %= 360;
|
||||||
|
|
||||||
/* make end_angle >= 0 and <= 360 */
|
/* Make end_angle >= 0 and <= 360 */
|
||||||
while (end_angle < 0)
|
while (end_angle < 0)
|
||||||
end_angle += 360;
|
end_angle += 360;
|
||||||
end_angle %= 360;
|
end_angle %= 360;
|
||||||
|
|
||||||
/* draw nothing if the angles are equal */
|
/* Draw nothing if the angles are equal */
|
||||||
if (start_angle == end_angle)
|
if (start_angle == end_angle)
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
/* find arc wedge line end points */
|
/* Find arc wedge line end points */
|
||||||
p1 = app_boundary_point(r, start_angle);
|
p1 = app_boundary_point(r, start_angle);
|
||||||
p2 = app_boundary_point(r, end_angle);
|
p2 = app_boundary_point(r, end_angle);
|
||||||
if (Chord)
|
if (Chord)
|
||||||
|
@ -841,7 +841,7 @@ app_fill_arc(DC *g, Rect r, int start_angle, int end_angle, PBRUSH pbrush, BOOL
|
||||||
else
|
else
|
||||||
p0 = pt(r.x + r.width/2, r.y + r.height/2);
|
p0 = pt(r.x + r.width/2, r.y + r.height/2);
|
||||||
|
|
||||||
/* initialise rectangles to be drawn */
|
/* Initialise rectangles to be drawn */
|
||||||
r1.x = r.x + a;
|
r1.x = r.x + a;
|
||||||
r1.y = r.y;
|
r1.y = r.y;
|
||||||
r1.width = r.width & 1; /* i.e. if width is odd */
|
r1.width = r.width & 1; /* i.e. if width is odd */
|
||||||
|
@ -856,7 +856,7 @@ app_fill_arc(DC *g, Rect r, int start_angle, int end_angle, PBRUSH pbrush, BOOL
|
||||||
|
|
||||||
if (t + a2*y < xcrit) /* e(x+1,y-1/2) <= 0 */
|
if (t + a2*y < xcrit) /* e(x+1,y-1/2) <= 0 */
|
||||||
{
|
{
|
||||||
/* move outwards to encounter edge */
|
/* Move outwards to encounter edge */
|
||||||
x += 1;
|
x += 1;
|
||||||
t += dxt;
|
t += dxt;
|
||||||
dxt += d2xt;
|
dxt += d2xt;
|
||||||
|
@ -865,7 +865,7 @@ app_fill_arc(DC *g, Rect r, int start_angle, int end_angle, PBRUSH pbrush, BOOL
|
||||||
}
|
}
|
||||||
else if (t - b2*x >= ycrit) /* e(x+1/2,y-1) > 0 */
|
else if (t - b2*x >= ycrit) /* e(x+1/2,y-1) > 0 */
|
||||||
{
|
{
|
||||||
/* drop down one line */
|
/* Drop down one line */
|
||||||
y -= 1;
|
y -= 1;
|
||||||
t += dyt;
|
t += dyt;
|
||||||
dyt += d2yt;
|
dyt += d2yt;
|
||||||
|
@ -874,7 +874,7 @@ app_fill_arc(DC *g, Rect r, int start_angle, int end_angle, PBRUSH pbrush, BOOL
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* drop diagonally down and out */
|
/* Drop diagonally down and out */
|
||||||
x += 1;
|
x += 1;
|
||||||
y -= 1;
|
y -= 1;
|
||||||
t += dxt + dyt;
|
t += dxt + dyt;
|
||||||
|
@ -908,7 +908,7 @@ app_fill_arc(DC *g, Rect r, int start_angle, int end_angle, PBRUSH pbrush, BOOL
|
||||||
|
|
||||||
if ((r1.width > 0) && (r1.y+r1.height < r2.y))
|
if ((r1.width > 0) && (r1.y+r1.height < r2.y))
|
||||||
{
|
{
|
||||||
/* distinct rectangles */
|
/* Distinct rectangles */
|
||||||
result &= app_fill_arc_rect(g, r1,
|
result &= app_fill_arc_rect(g, r1,
|
||||||
p0, p1, p2,
|
p0, p1, p2,
|
||||||
start_angle, end_angle, pbrush, FALSE);
|
start_angle, end_angle, pbrush, FALSE);
|
||||||
|
@ -917,14 +917,14 @@ app_fill_arc(DC *g, Rect r, int start_angle, int end_angle, PBRUSH pbrush, BOOL
|
||||||
start_angle, end_angle, pbrush, FALSE);
|
start_angle, end_angle, pbrush, FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* move down */
|
/* Move down */
|
||||||
r1.y += 1;
|
r1.y += 1;
|
||||||
r2.y -= 1;
|
r2.y -= 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (moveout)
|
if (moveout)
|
||||||
{
|
{
|
||||||
/* move outwards */
|
/* Move outwards */
|
||||||
r1.x -= 1;
|
r1.x -= 1;
|
||||||
r1.width += 2;
|
r1.width += 2;
|
||||||
r2.x -= 1;
|
r2.x -= 1;
|
||||||
|
@ -933,7 +933,7 @@ app_fill_arc(DC *g, Rect r, int start_angle, int end_angle, PBRUSH pbrush, BOOL
|
||||||
}
|
}
|
||||||
if (r1.y < r2.y)
|
if (r1.y < r2.y)
|
||||||
{
|
{
|
||||||
/* overlap */
|
/* Overlap */
|
||||||
r1.x = r.x;
|
r1.x = r.x;
|
||||||
r1.width = r.width;
|
r1.width = r.width;
|
||||||
r1.height = r2.y+r2.height-r1.y;
|
r1.height = r2.y+r2.height-r1.y;
|
||||||
|
@ -948,7 +948,7 @@ app_fill_arc(DC *g, Rect r, int start_angle, int end_angle, PBRUSH pbrush, BOOL
|
||||||
}
|
}
|
||||||
else if (x <= a)
|
else if (x <= a)
|
||||||
{
|
{
|
||||||
/* crossover, draw final line */
|
/* Crossover, draw final line */
|
||||||
r1.x = r.x;
|
r1.x = r.x;
|
||||||
r1.width = r.width;
|
r1.width = r.width;
|
||||||
r1.height = r1.y+r1.height-r2.y;
|
r1.height = r1.y+r1.height-r2.y;
|
||||||
|
@ -1001,39 +1001,39 @@ int app_draw_arc(DC *g, Rect r, int start_angle, int end_angle, PBRUSH pbrushPen
|
||||||
int D2XT = B2+B2;
|
int D2XT = B2+B2;
|
||||||
int D2YT = A2+A2;
|
int D2YT = A2+A2;
|
||||||
|
|
||||||
/* arc rectangle calculations */
|
/* Arc rectangle calculations */
|
||||||
int movedown, moveout;
|
int movedown, moveout;
|
||||||
int innerX = 0, prevx, prevy, W;
|
int innerX = 0, prevx, prevy, W;
|
||||||
Rect r1, r2;
|
Rect r1, r2;
|
||||||
int result = 1;
|
int result = 1;
|
||||||
|
|
||||||
/* line descriptions */
|
/* Line descriptions */
|
||||||
POINT p0, p1, p2;
|
POINT p0, p1, p2;
|
||||||
|
|
||||||
// START_DEBUG();
|
// START_DEBUG();
|
||||||
|
|
||||||
/* if angles differ by 360 degrees or more, close the shape */
|
/* If angles differ by 360 degrees or more, close the shape */
|
||||||
if ((start_angle + 360 <= end_angle) ||
|
if ((start_angle + 360 <= end_angle) ||
|
||||||
(start_angle - 360 >= end_angle))
|
(start_angle - 360 >= end_angle))
|
||||||
{
|
{
|
||||||
return app_draw_ellipse(g, r, pbrushPen);
|
return app_draw_ellipse(g, r, pbrushPen);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* make start_angle >= 0 and <= 360 */
|
/* Make start_angle >= 0 and <= 360 */
|
||||||
while (start_angle < 0)
|
while (start_angle < 0)
|
||||||
start_angle += 360;
|
start_angle += 360;
|
||||||
start_angle %= 360;
|
start_angle %= 360;
|
||||||
|
|
||||||
/* make end_angle >= 0 and <= 360 */
|
/* Make end_angle >= 0 and <= 360 */
|
||||||
while (end_angle < 0)
|
while (end_angle < 0)
|
||||||
end_angle += 360;
|
end_angle += 360;
|
||||||
end_angle %= 360;
|
end_angle %= 360;
|
||||||
|
|
||||||
/* draw nothing if the angles are equal */
|
/* Draw nothing if the angles are equal */
|
||||||
if (start_angle == end_angle)
|
if (start_angle == end_angle)
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
/* find arc wedge line end points */
|
/* Find arc wedge line end points */
|
||||||
p1 = app_boundary_point(r, start_angle);
|
p1 = app_boundary_point(r, start_angle);
|
||||||
p2 = app_boundary_point(r, end_angle);
|
p2 = app_boundary_point(r, end_angle);
|
||||||
if (Chord)
|
if (Chord)
|
||||||
|
@ -1041,7 +1041,7 @@ int app_draw_arc(DC *g, Rect r, int start_angle, int end_angle, PBRUSH pbrushPen
|
||||||
else
|
else
|
||||||
p0 = pt(r.x + r.width/2, r.y + r.height/2);
|
p0 = pt(r.x + r.width/2, r.y + r.height/2);
|
||||||
|
|
||||||
/* determine ellipse rectangles */
|
/* Determine ellipse rectangles */
|
||||||
r1.x = r.x + a;
|
r1.x = r.x + a;
|
||||||
r1.y = r.y;
|
r1.y = r.y;
|
||||||
r1.width = r.width & 1; /* i.e. if width is odd */
|
r1.width = r.width & 1; /* i.e. if width is odd */
|
||||||
|
@ -1061,21 +1061,21 @@ int app_draw_arc(DC *g, Rect r, int start_angle, int end_angle, PBRUSH pbrushPen
|
||||||
|
|
||||||
if (T + A2*Y < XCRIT) /* E(X+1,Y-1/2) <= 0 */
|
if (T + A2*Y < XCRIT) /* E(X+1,Y-1/2) <= 0 */
|
||||||
{
|
{
|
||||||
/* move outwards to encounter edge */
|
/* Move outwards to encounter edge */
|
||||||
X += 1;
|
X += 1;
|
||||||
T += DXT;
|
T += DXT;
|
||||||
DXT += D2XT;
|
DXT += D2XT;
|
||||||
}
|
}
|
||||||
else if (T - B2*X >= YCRIT) /* e(x+1/2,y-1) > 0 */
|
else if (T - B2*X >= YCRIT) /* e(x+1/2,y-1) > 0 */
|
||||||
{
|
{
|
||||||
/* drop down one line */
|
/* Drop down one line */
|
||||||
Y -= 1;
|
Y -= 1;
|
||||||
T += DYT;
|
T += DYT;
|
||||||
DYT += D2YT;
|
DYT += D2YT;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* drop diagonally down and out */
|
/* Drop diagonally down and out */
|
||||||
X += 1;
|
X += 1;
|
||||||
Y -= 1;
|
Y -= 1;
|
||||||
T += DXT + DYT;
|
T += DXT + DYT;
|
||||||
|
@ -1094,7 +1094,7 @@ int app_draw_arc(DC *g, Rect r, int start_angle, int end_angle, PBRUSH pbrushPen
|
||||||
|
|
||||||
if (t + a2*y < xcrit) /* e(x+1,y-1/2) <= 0 */
|
if (t + a2*y < xcrit) /* e(x+1,y-1/2) <= 0 */
|
||||||
{
|
{
|
||||||
/* move outwards to encounter edge */
|
/* Move outwards to encounter edge */
|
||||||
x += 1;
|
x += 1;
|
||||||
t += dxt;
|
t += dxt;
|
||||||
dxt += d2xt;
|
dxt += d2xt;
|
||||||
|
@ -1103,7 +1103,7 @@ int app_draw_arc(DC *g, Rect r, int start_angle, int end_angle, PBRUSH pbrushPen
|
||||||
}
|
}
|
||||||
else if (t - b2*x >= ycrit) /* e(x+1/2,y-1) > 0 */
|
else if (t - b2*x >= ycrit) /* e(x+1/2,y-1) > 0 */
|
||||||
{
|
{
|
||||||
/* drop down one line */
|
/* Drop down one line */
|
||||||
y -= 1;
|
y -= 1;
|
||||||
t += dyt;
|
t += dyt;
|
||||||
dyt += d2yt;
|
dyt += d2yt;
|
||||||
|
@ -1112,7 +1112,7 @@ int app_draw_arc(DC *g, Rect r, int start_angle, int end_angle, PBRUSH pbrushPen
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* drop diagonally down and out */
|
/* Drop diagonally down and out */
|
||||||
x += 1;
|
x += 1;
|
||||||
y -= 1;
|
y -= 1;
|
||||||
t += dxt + dyt;
|
t += dxt + dyt;
|
||||||
|
@ -1158,7 +1158,7 @@ int app_draw_arc(DC *g, Rect r, int start_angle, int end_angle, PBRUSH pbrushPen
|
||||||
}
|
}
|
||||||
else if (r1.y+r1.height < r2.y)
|
else if (r1.y+r1.height < r2.y)
|
||||||
{
|
{
|
||||||
/* draw distinct rectangles */
|
/* Draw distinct rectangles */
|
||||||
result &= app_fill_arc_rect(g, rect(
|
result &= app_fill_arc_rect(g, rect(
|
||||||
r1.x,r1.y,W,1),
|
r1.x,r1.y,W,1),
|
||||||
p0, p1, p2,
|
p0, p1, p2,
|
||||||
|
@ -1180,14 +1180,14 @@ int app_draw_arc(DC *g, Rect r, int start_angle, int end_angle, PBRUSH pbrushPen
|
||||||
prevy = r1.y;
|
prevy = r1.y;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* move down */
|
/* Move down */
|
||||||
r1.y += 1;
|
r1.y += 1;
|
||||||
r2.y -= 1;
|
r2.y -= 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (moveout)
|
if (moveout)
|
||||||
{
|
{
|
||||||
/* move outwards */
|
/* Move outwards */
|
||||||
r1.x -= 1;
|
r1.x -= 1;
|
||||||
r1.width += 2;
|
r1.width += 2;
|
||||||
r2.x -= 1;
|
r2.x -= 1;
|
||||||
|
@ -1196,7 +1196,7 @@ int app_draw_arc(DC *g, Rect r, int start_angle, int end_angle, PBRUSH pbrushPen
|
||||||
}
|
}
|
||||||
if ((x <= a) && (prevy < r2.y))
|
if ((x <= a) && (prevy < r2.y))
|
||||||
{
|
{
|
||||||
/* draw final lines */
|
/* Draw final lines */
|
||||||
r1.height = r1.y+r1.height-r2.y;
|
r1.height = r1.y+r1.height-r2.y;
|
||||||
r1.y = r2.y;
|
r1.y = r2.y;
|
||||||
|
|
||||||
|
@ -1267,7 +1267,7 @@ IntFillRect( DC *dc,
|
||||||
{
|
{
|
||||||
pdcattr = dc->pdcattr;
|
pdcattr = dc->pdcattr;
|
||||||
|
|
||||||
/* fix negative spaces */
|
/* Fix negative spaces */
|
||||||
if (Width < 0)
|
if (Width < 0)
|
||||||
{
|
{
|
||||||
XLeft += Width;
|
XLeft += Width;
|
||||||
|
@ -1402,7 +1402,7 @@ IntFillRoundRect( PDC dc,
|
||||||
PBRUSH pbrush)
|
PBRUSH pbrush)
|
||||||
{
|
{
|
||||||
Rect r;
|
Rect r;
|
||||||
int rx, ry; /* radius in x and y directions */
|
int rx, ry; /* Radius in x and y directions */
|
||||||
|
|
||||||
// x y Width Height
|
// x y Width Height
|
||||||
r = rect( Left, Top, abs(Right-Left), abs(Bottom-Top));
|
r = rect( Left, Top, abs(Right-Left), abs(Bottom-Top));
|
||||||
|
@ -1468,7 +1468,7 @@ IntDrawRoundRect( PDC dc,
|
||||||
PBRUSH pbrushPen)
|
PBRUSH pbrushPen)
|
||||||
{
|
{
|
||||||
Rect r;
|
Rect r;
|
||||||
int rx, ry; /* radius in x and y directions */
|
int rx, ry; /* Radius in x and y directions */
|
||||||
int w = pbrushPen->ptPenWidth.x;
|
int w = pbrushPen->ptPenWidth.x;
|
||||||
|
|
||||||
r = rect( Left, Top, abs(Right-Left), abs(Bottom-Top));
|
r = rect( Left, Top, abs(Right-Left), abs(Bottom-Top));
|
||||||
|
|
|
@ -21,7 +21,7 @@ IntGdiPolygon(PDC dc,
|
||||||
{
|
{
|
||||||
SURFACE *psurf;
|
SURFACE *psurf;
|
||||||
PBRUSH pbrLine, pbrFill;
|
PBRUSH pbrLine, pbrFill;
|
||||||
BOOL ret = FALSE; // default to failure
|
BOOL ret = FALSE; // Default to failure
|
||||||
RECTL DestRect;
|
RECTL DestRect;
|
||||||
int CurrentPoint;
|
int CurrentPoint;
|
||||||
PDC_ATTR pdcattr;
|
PDC_ATTR pdcattr;
|
||||||
|
@ -29,7 +29,7 @@ IntGdiPolygon(PDC dc,
|
||||||
// int Left;
|
// int Left;
|
||||||
// int Top;
|
// int Top;
|
||||||
|
|
||||||
ASSERT(dc); // caller's responsibility to pass a valid dc
|
ASSERT(dc); // Caller's responsibility to pass a valid dc
|
||||||
|
|
||||||
if (!Points || Count < 2 )
|
if (!Points || Count < 2 )
|
||||||
{
|
{
|
||||||
|
@ -81,7 +81,7 @@ IntGdiPolygon(PDC dc,
|
||||||
pbrFill = dc->dclevel.pbrFill;
|
pbrFill = dc->dclevel.pbrFill;
|
||||||
pbrLine = dc->dclevel.pbrLine;
|
pbrLine = dc->dclevel.pbrLine;
|
||||||
psurf = dc->dclevel.pSurface;
|
psurf = dc->dclevel.pSurface;
|
||||||
/* FIXME - psurf can be NULL!!!! don't assert but handle this case gracefully! */
|
/* FIXME: psurf can be NULL!!!! don't assert but handle this case gracefully! */
|
||||||
ASSERT(psurf);
|
ASSERT(psurf);
|
||||||
|
|
||||||
/* Now fill the polygon with the current fill brush. */
|
/* Now fill the polygon with the current fill brush. */
|
||||||
|
@ -513,13 +513,13 @@ IntRectangle(PDC dc,
|
||||||
{
|
{
|
||||||
SURFACE *psurf = NULL;
|
SURFACE *psurf = NULL;
|
||||||
PBRUSH pbrLine, pbrFill;
|
PBRUSH pbrLine, pbrFill;
|
||||||
BOOL ret = FALSE; // default to failure
|
BOOL ret = FALSE; // Default to failure
|
||||||
RECTL DestRect;
|
RECTL DestRect;
|
||||||
MIX Mix;
|
MIX Mix;
|
||||||
PDC_ATTR pdcattr;
|
PDC_ATTR pdcattr;
|
||||||
POINTL BrushOrigin;
|
POINTL BrushOrigin;
|
||||||
|
|
||||||
ASSERT ( dc ); // caller's responsibility to set this up
|
ASSERT ( dc ); // Caller's responsibility to set this up
|
||||||
|
|
||||||
pdcattr = dc->pdcattr;
|
pdcattr = dc->pdcattr;
|
||||||
|
|
||||||
|
@ -595,7 +595,7 @@ IntRectangle(PDC dc,
|
||||||
|
|
||||||
// Draw the rectangle with the current pen
|
// Draw the rectangle with the current pen
|
||||||
|
|
||||||
ret = TRUE; // change default to success
|
ret = TRUE; // Change default to success
|
||||||
|
|
||||||
if (!(pbrLine->flAttrs & GDIBRUSH_IS_NULL))
|
if (!(pbrLine->flAttrs & GDIBRUSH_IS_NULL))
|
||||||
{
|
{
|
||||||
|
@ -647,7 +647,7 @@ NtGdiRectangle(HDC hDC,
|
||||||
int BottomRect)
|
int BottomRect)
|
||||||
{
|
{
|
||||||
DC *dc;
|
DC *dc;
|
||||||
BOOL ret; // default to failure
|
BOOL ret; // Default to failure
|
||||||
|
|
||||||
dc = DC_LockDc(hDC);
|
dc = DC_LockDc(hDC);
|
||||||
if (!dc)
|
if (!dc)
|
||||||
|
@ -701,10 +701,10 @@ IntRoundRect(
|
||||||
PBRUSH pbrLine, pbrFill;
|
PBRUSH pbrLine, pbrFill;
|
||||||
RECTL RectBounds;
|
RECTL RectBounds;
|
||||||
LONG PenWidth, PenOrigWidth;
|
LONG PenWidth, PenOrigWidth;
|
||||||
BOOL ret = TRUE; // default to success
|
BOOL ret = TRUE; // Default to success
|
||||||
BRUSH brushTemp;
|
BRUSH brushTemp;
|
||||||
|
|
||||||
ASSERT ( dc ); // caller's responsibility to set this up
|
ASSERT ( dc ); // Caller's responsibility to set this up
|
||||||
|
|
||||||
if ( PATH_IsPathOpen(dc->dclevel) )
|
if ( PATH_IsPathOpen(dc->dclevel) )
|
||||||
return PATH_RoundRect ( dc, Left, Top, Right, Bottom,
|
return PATH_RoundRect ( dc, Left, Top, Right, Bottom,
|
||||||
|
@ -818,7 +818,7 @@ NtGdiRoundRect(
|
||||||
int Height)
|
int Height)
|
||||||
{
|
{
|
||||||
DC *dc = DC_LockDc(hDC);
|
DC *dc = DC_LockDc(hDC);
|
||||||
BOOL ret = FALSE; /* default to failure */
|
BOOL ret = FALSE; /* Default to failure */
|
||||||
|
|
||||||
DPRINT("NtGdiRoundRect(0x%x,%i,%i,%i,%i,%i,%i)\n",hDC,LeftRect,TopRect,RightRect,BottomRect,Width,Height);
|
DPRINT("NtGdiRoundRect(0x%x,%i,%i,%i,%i,%i,%i)\n",hDC,LeftRect,TopRect,RightRect,BottomRect,Width,Height);
|
||||||
if ( !dc )
|
if ( !dc )
|
||||||
|
@ -859,7 +859,7 @@ GreGradientFill(
|
||||||
ULONG i;
|
ULONG i;
|
||||||
BOOL bRet;
|
BOOL bRet;
|
||||||
|
|
||||||
/* check parameters */
|
/* Check parameters */
|
||||||
if (ulMode & GRADIENT_FILL_TRIANGLE)
|
if (ulMode & GRADIENT_FILL_TRIANGLE)
|
||||||
{
|
{
|
||||||
PGRADIENT_TRIANGLE pTriangle = (PGRADIENT_TRIANGLE)pMesh;
|
PGRADIENT_TRIANGLE pTriangle = (PGRADIENT_TRIANGLE)pMesh;
|
||||||
|
@ -911,7 +911,7 @@ GreGradientFill(
|
||||||
return TRUE; // CHECKME
|
return TRUE; // CHECKME
|
||||||
}
|
}
|
||||||
|
|
||||||
/* calculate extent */
|
/* Calculate extent */
|
||||||
rclExtent.left = rclExtent.right = pVertex->x;
|
rclExtent.left = rclExtent.right = pVertex->x;
|
||||||
rclExtent.top = rclExtent.bottom = pVertex->y;
|
rclExtent.top = rclExtent.bottom = pVertex->y;
|
||||||
for (i = 0; i < nVertex; i++)
|
for (i = 0; i < nVertex; i++)
|
||||||
|
|
|
@ -384,7 +384,7 @@ IntGetFontLanguageInfo(PDC Dc)
|
||||||
|
|
||||||
pdcattr = Dc->pdcattr;
|
pdcattr = Dc->pdcattr;
|
||||||
|
|
||||||
/* this might need a test for a HEBREW- or ARABIC_CHARSET as well */
|
/* This might need a test for a HEBREW- or ARABIC_CHARSET as well */
|
||||||
if ( pdcattr->lTextAlign & TA_RTLREADING )
|
if ( pdcattr->lTextAlign & TA_RTLREADING )
|
||||||
if( (fontsig.fsCsb[0]&GCP_REORDER_MASK)!=0 )
|
if( (fontsig.fsCsb[0]&GCP_REORDER_MASK)!=0 )
|
||||||
result|=GCP_REORDER;
|
result|=GCP_REORDER;
|
||||||
|
@ -473,7 +473,7 @@ NtGdiAddFontResourceW(
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
int Ret;
|
int Ret;
|
||||||
|
|
||||||
/* FIXME - Protect with SEH? */
|
/* FIXME: Protect with SEH? */
|
||||||
RtlInitUnicodeString(&SafeFileName, pwszFiles);
|
RtlInitUnicodeString(&SafeFileName, pwszFiles);
|
||||||
|
|
||||||
/* Reserve for prepending '\??\' */
|
/* Reserve for prepending '\??\' */
|
||||||
|
@ -916,7 +916,7 @@ NtGdiGetFontResourceInfoInternalW(
|
||||||
WCHAR FullName[LF_FULLFACESIZE];
|
WCHAR FullName[LF_FULLFACESIZE];
|
||||||
} Buffer;
|
} Buffer;
|
||||||
|
|
||||||
/* FIXME: handle cFiles > 0 */
|
/* FIXME: Handle cFiles > 0 */
|
||||||
|
|
||||||
/* Check for valid dwType values
|
/* Check for valid dwType values
|
||||||
dwType == 4 seems to be handled by gdi32 only */
|
dwType == 4 seems to be handled by gdi32 only */
|
||||||
|
@ -1116,7 +1116,7 @@ NtGdiHfontCreate(
|
||||||
if (SafeLogfont.elfEnumLogfontEx.elfLogFont.lfEscapement !=
|
if (SafeLogfont.elfEnumLogfontEx.elfLogFont.lfEscapement !=
|
||||||
SafeLogfont.elfEnumLogfontEx.elfLogFont.lfOrientation)
|
SafeLogfont.elfEnumLogfontEx.elfLogFont.lfOrientation)
|
||||||
{
|
{
|
||||||
/* this should really depend on whether GM_ADVANCED is set */
|
/* This should really depend on whether GM_ADVANCED is set */
|
||||||
TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfOrientation =
|
TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfOrientation =
|
||||||
TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfEscapement;
|
TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfEscapement;
|
||||||
}
|
}
|
||||||
|
@ -1124,7 +1124,7 @@ NtGdiHfontCreate(
|
||||||
|
|
||||||
if (pvCliData && hNewFont)
|
if (pvCliData && hNewFont)
|
||||||
{
|
{
|
||||||
// FIXME: use GDIOBJ_InsertUserData
|
// FIXME: Use GDIOBJ_InsertUserData
|
||||||
KeEnterCriticalRegion();
|
KeEnterCriticalRegion();
|
||||||
{
|
{
|
||||||
INT Index = GDI_HANDLE_GET_INDEX((HGDIOBJ)hNewFont);
|
INT Index = GDI_HANDLE_GET_INDEX((HGDIOBJ)hNewFont);
|
||||||
|
|
|
@ -51,7 +51,7 @@ typedef struct _FONT_CACHE_ENTRY
|
||||||
static LIST_ENTRY FontCacheListHead;
|
static LIST_ENTRY FontCacheListHead;
|
||||||
static UINT FontCacheNumEntries;
|
static UINT FontCacheNumEntries;
|
||||||
|
|
||||||
static PWCHAR ElfScripts[32] = /* these are in the order of the fsCsb[0] bits */
|
static PWCHAR ElfScripts[32] = /* These are in the order of the fsCsb[0] bits */
|
||||||
{
|
{
|
||||||
L"Western", /* 00 */
|
L"Western", /* 00 */
|
||||||
L"Central_European",
|
L"Central_European",
|
||||||
|
@ -106,7 +106,7 @@ static const CHARSETINFO FontTci[MAXTCIINDEX] =
|
||||||
{ HANGEUL_CHARSET, 949, {{0,0,0,0},{FS_WANSUNG,0}} },
|
{ HANGEUL_CHARSET, 949, {{0,0,0,0},{FS_WANSUNG,0}} },
|
||||||
{ CHINESEBIG5_CHARSET, 950, {{0,0,0,0},{FS_CHINESETRAD,0}} },
|
{ CHINESEBIG5_CHARSET, 950, {{0,0,0,0},{FS_CHINESETRAD,0}} },
|
||||||
{ JOHAB_CHARSET, 1361, {{0,0,0,0},{FS_JOHAB,0}} },
|
{ JOHAB_CHARSET, 1361, {{0,0,0,0},{FS_JOHAB,0}} },
|
||||||
/* reserved for alternate ANSI and OEM */
|
/* Reserved for alternate ANSI and OEM */
|
||||||
{ DEFAULT_CHARSET, 0, {{0,0,0,0},{FS_LATIN1,0}} },
|
{ DEFAULT_CHARSET, 0, {{0,0,0,0},{FS_LATIN1,0}} },
|
||||||
{ DEFAULT_CHARSET, 0, {{0,0,0,0},{FS_LATIN1,0}} },
|
{ DEFAULT_CHARSET, 0, {{0,0,0,0},{FS_LATIN1,0}} },
|
||||||
{ DEFAULT_CHARSET, 0, {{0,0,0,0},{FS_LATIN1,0}} },
|
{ DEFAULT_CHARSET, 0, {{0,0,0,0},{FS_LATIN1,0}} },
|
||||||
|
@ -115,7 +115,7 @@ static const CHARSETINFO FontTci[MAXTCIINDEX] =
|
||||||
{ DEFAULT_CHARSET, 0, {{0,0,0,0},{FS_LATIN1,0}} },
|
{ DEFAULT_CHARSET, 0, {{0,0,0,0},{FS_LATIN1,0}} },
|
||||||
{ DEFAULT_CHARSET, 0, {{0,0,0,0},{FS_LATIN1,0}} },
|
{ DEFAULT_CHARSET, 0, {{0,0,0,0},{FS_LATIN1,0}} },
|
||||||
{ DEFAULT_CHARSET, 0, {{0,0,0,0},{FS_LATIN1,0}} },
|
{ DEFAULT_CHARSET, 0, {{0,0,0,0},{FS_LATIN1,0}} },
|
||||||
/* reserved for system */
|
/* Reserved for system */
|
||||||
{ DEFAULT_CHARSET, 0, {{0,0,0,0},{FS_LATIN1,0}} },
|
{ DEFAULT_CHARSET, 0, {{0,0,0,0},{FS_LATIN1,0}} },
|
||||||
{ SYMBOL_CHARSET, CP_SYMBOL, {{0,0,0,0},{FS_SYMBOL,0}} }
|
{ SYMBOL_CHARSET, CP_SYMBOL, {{0,0,0,0},{FS_SYMBOL,0}} }
|
||||||
};
|
};
|
||||||
|
@ -444,7 +444,7 @@ TextIntCreateFontIndirect(CONST LPLOGFONTW lf, HFONT *NewFont)
|
||||||
RtlCopyMemory(&TextObj->logfont.elfEnumLogfontEx.elfLogFont, lf, sizeof(LOGFONTW));
|
RtlCopyMemory(&TextObj->logfont.elfEnumLogfontEx.elfLogFont, lf, sizeof(LOGFONTW));
|
||||||
if (lf->lfEscapement != lf->lfOrientation)
|
if (lf->lfEscapement != lf->lfOrientation)
|
||||||
{
|
{
|
||||||
/* this should really depend on whether GM_ADVANCED is set */
|
/* This should really depend on whether GM_ADVANCED is set */
|
||||||
TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfOrientation =
|
TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfOrientation =
|
||||||
TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfEscapement;
|
TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfEscapement;
|
||||||
}
|
}
|
||||||
|
@ -575,8 +575,8 @@ FillTM(TEXTMETRICW *TM, PFONTGDI FontGDI, TT_OS2 *pOS2, TT_HoriHeader *pHori, FT
|
||||||
TM->tmAscent = (FT_MulFix(Ascent, YScale) + 32) >> 6;
|
TM->tmAscent = (FT_MulFix(Ascent, YScale) + 32) >> 6;
|
||||||
TM->tmDescent = (FT_MulFix(Descent, YScale) + 32) >> 6;
|
TM->tmDescent = (FT_MulFix(Descent, YScale) + 32) >> 6;
|
||||||
#else /* This (ros) code was previously affected by a FreeType bug, but it works now */
|
#else /* This (ros) code was previously affected by a FreeType bug, but it works now */
|
||||||
TM->tmAscent = (Face->size->metrics.ascender + 32) >> 6; /* units above baseline */
|
TM->tmAscent = (Face->size->metrics.ascender + 32) >> 6; /* Units above baseline */
|
||||||
TM->tmDescent = (32 - Face->size->metrics.descender) >> 6; /* units below baseline */
|
TM->tmDescent = (32 - Face->size->metrics.descender) >> 6; /* Units below baseline */
|
||||||
#endif
|
#endif
|
||||||
TM->tmInternalLeading = (FT_MulFix(Ascent + Descent - Face->units_per_EM, YScale) + 32) >> 6;
|
TM->tmInternalLeading = (FT_MulFix(Ascent + Descent - Face->units_per_EM, YScale) + 32) >> 6;
|
||||||
|
|
||||||
|
@ -659,9 +659,9 @@ FillTM(TEXTMETRICW *TM, PFONTGDI FontGDI, TT_OS2 *pOS2, TT_HoriHeader *pHori, FT
|
||||||
case PAN_ANY:
|
case PAN_ANY:
|
||||||
case PAN_NO_FIT:
|
case PAN_NO_FIT:
|
||||||
case PAN_FAMILY_TEXT_DISPLAY:
|
case PAN_FAMILY_TEXT_DISPLAY:
|
||||||
case PAN_FAMILY_PICTORIAL: /* symbol fonts get treated as if they were text */
|
case PAN_FAMILY_PICTORIAL: /* Symbol fonts get treated as if they were text */
|
||||||
/* which is clearly not what the panose spec says. */
|
/* Which is clearly not what the panose spec says. */
|
||||||
if (TM->tmPitchAndFamily == 0) /* fixed */
|
if (TM->tmPitchAndFamily == 0) /* Fixed */
|
||||||
{
|
{
|
||||||
TM->tmPitchAndFamily = FF_MODERN;
|
TM->tmPitchAndFamily = FF_MODERN;
|
||||||
}
|
}
|
||||||
|
@ -743,24 +743,24 @@ IntGetOutlineTextMetrics(PFONTGDI FontGDI,
|
||||||
|
|
||||||
/* These names should be read from the TT name table */
|
/* These names should be read from the TT name table */
|
||||||
|
|
||||||
/* length of otmpFamilyName */
|
/* Length of otmpFamilyName */
|
||||||
Needed += FamilyNameW.Length + sizeof(WCHAR);
|
Needed += FamilyNameW.Length + sizeof(WCHAR);
|
||||||
|
|
||||||
RtlInitUnicodeString(&Regular, L"regular");
|
RtlInitUnicodeString(&Regular, L"regular");
|
||||||
/* length of otmpFaceName */
|
/* Length of otmpFaceName */
|
||||||
if (0 == RtlCompareUnicodeString(&StyleNameW, &Regular, TRUE))
|
if (0 == RtlCompareUnicodeString(&StyleNameW, &Regular, TRUE))
|
||||||
{
|
{
|
||||||
Needed += FamilyNameW.Length + sizeof(WCHAR); /* just the family name */
|
Needed += FamilyNameW.Length + sizeof(WCHAR); /* Just the family name */
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Needed += FamilyNameW.Length + StyleNameW.Length + (sizeof(WCHAR) << 1); /* family + " " + style */
|
Needed += FamilyNameW.Length + StyleNameW.Length + (sizeof(WCHAR) << 1); /* family + " " + style */
|
||||||
}
|
}
|
||||||
|
|
||||||
/* length of otmpStyleName */
|
/* Length of otmpStyleName */
|
||||||
Needed += StyleNameW.Length + sizeof(WCHAR);
|
Needed += StyleNameW.Length + sizeof(WCHAR);
|
||||||
|
|
||||||
/* length of otmpFullName */
|
/* Length of otmpFullName */
|
||||||
Needed += FamilyNameW.Length + StyleNameW.Length + (sizeof(WCHAR) << 1);
|
Needed += FamilyNameW.Length + StyleNameW.Length + (sizeof(WCHAR) << 1);
|
||||||
|
|
||||||
if (Size < Needed)
|
if (Size < Needed)
|
||||||
|
@ -794,7 +794,7 @@ IntGetOutlineTextMetrics(PFONTGDI FontGDI,
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
pPost = FT_Get_Sfnt_Table(FontGDI->face, ft_sfnt_post); /* we can live with this failing */
|
pPost = FT_Get_Sfnt_Table(FontGDI->face, ft_sfnt_post); /* We can live with this failing */
|
||||||
|
|
||||||
Error = FT_Get_WinFNT_Header(FontGDI->face , &Win);
|
Error = FT_Get_WinFNT_Header(FontGDI->face , &Win);
|
||||||
|
|
||||||
|
@ -1050,7 +1050,7 @@ FontFamilyFillInfo(PFONTFAMILYINFO Info, PCWSTR FaceName, PFONTGDI FontGDI)
|
||||||
fs.fsCsb[0] |= FS_SYMBOL;
|
fs.fsCsb[0] |= FS_SYMBOL;
|
||||||
}
|
}
|
||||||
if (fs.fsCsb[0] == 0)
|
if (fs.fsCsb[0] == 0)
|
||||||
{ /* let's see if we can find any interesting cmaps */
|
{ /* Let's see if we can find any interesting cmaps */
|
||||||
for (i = 0; i < FontGDI->face->num_charmaps; i++)
|
for (i = 0; i < FontGDI->face->num_charmaps; i++)
|
||||||
{
|
{
|
||||||
switch (FontGDI->face->charmaps[i]->encoding)
|
switch (FontGDI->face->charmaps[i]->encoding)
|
||||||
|
@ -1503,7 +1503,7 @@ ftGdiGetGlyphOutline(
|
||||||
|
|
||||||
IntLockFreeType;
|
IntLockFreeType;
|
||||||
|
|
||||||
/* During testing, I never saw this used. In here just incase.*/
|
/* During testing, I never saw this used. It is here just in case. */
|
||||||
if (ft_face->charmap == NULL)
|
if (ft_face->charmap == NULL)
|
||||||
{
|
{
|
||||||
DPRINT("WARNING: No charmap selected!\n");
|
DPRINT("WARNING: No charmap selected!\n");
|
||||||
|
@ -1512,7 +1512,7 @@ ftGdiGetGlyphOutline(
|
||||||
for (n = 0; n < ft_face->num_charmaps; n++)
|
for (n = 0; n < ft_face->num_charmaps; n++)
|
||||||
{
|
{
|
||||||
charmap = ft_face->charmaps[n];
|
charmap = ft_face->charmaps[n];
|
||||||
DPRINT("found charmap encoding: %u\n", charmap->encoding);
|
DPRINT("Found charmap encoding: %u\n", charmap->encoding);
|
||||||
if (charmap->encoding != 0)
|
if (charmap->encoding != 0)
|
||||||
{
|
{
|
||||||
found = charmap;
|
found = charmap;
|
||||||
|
@ -1532,7 +1532,7 @@ ftGdiGetGlyphOutline(
|
||||||
|
|
||||||
// FT_Set_Pixel_Sizes(ft_face,
|
// FT_Set_Pixel_Sizes(ft_face,
|
||||||
// TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfWidth,
|
// TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfWidth,
|
||||||
/* FIXME should set character height if neg */
|
/* FIXME: Should set character height if neg */
|
||||||
// (TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfHeight == 0 ?
|
// (TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfHeight == 0 ?
|
||||||
// dc->ppdev->devinfo.lfDefaultFont.lfHeight : abs(TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfHeight)));
|
// dc->ppdev->devinfo.lfDefaultFont.lfHeight : abs(TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfHeight)));
|
||||||
|
|
||||||
|
@ -1681,7 +1681,7 @@ ftGdiGetGlyphOutline(
|
||||||
bottom = bottom & -64;
|
bottom = bottom & -64;
|
||||||
top = (top + 63) & -64;
|
top = (top + 63) & -64;
|
||||||
|
|
||||||
DPRINT("transformed box: (%d,%d - %d,%d)\n", left, top, right, bottom);
|
DPRINT("Transformed box: (%d,%d - %d,%d)\n", left, top, right, bottom);
|
||||||
vec.x = ft_face->glyph->metrics.horiAdvance;
|
vec.x = ft_face->glyph->metrics.horiAdvance;
|
||||||
vec.y = 0;
|
vec.y = 0;
|
||||||
FT_Vector_Transform(&vec, &transMat);
|
FT_Vector_Transform(&vec, &transMat);
|
||||||
|
@ -1710,7 +1710,7 @@ ftGdiGetGlyphOutline(
|
||||||
|
|
||||||
if (ft_face->glyph->format != ft_glyph_format_outline && iFormat != GGO_BITMAP)
|
if (ft_face->glyph->format != ft_glyph_format_outline && iFormat != GGO_BITMAP)
|
||||||
{
|
{
|
||||||
DPRINT1("loaded a bitmap\n");
|
DPRINT1("Loaded a bitmap\n");
|
||||||
return GDI_ERROR;
|
return GDI_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1760,7 +1760,7 @@ ftGdiGetGlyphOutline(
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
DPRINT1("loaded glyph format %x\n", ft_face->glyph->format);
|
DPRINT1("Loaded glyph format %x\n", ft_face->glyph->format);
|
||||||
return GDI_ERROR;
|
return GDI_ERROR;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -1830,7 +1830,7 @@ ftGdiGetGlyphOutline(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
DPRINT1("loaded glyph format %x\n", ft_face->glyph->format);
|
DPRINT1("Loaded glyph format %x\n", ft_face->glyph->format);
|
||||||
return GDI_ERROR;
|
return GDI_ERROR;
|
||||||
}
|
}
|
||||||
start = pvBuf;
|
start = pvBuf;
|
||||||
|
@ -1900,7 +1900,7 @@ ftGdiGetGlyphOutline(
|
||||||
else if (point <= outline->contours[contour] &&
|
else if (point <= outline->contours[contour] &&
|
||||||
outline->tags[point] & FT_Curve_Tag_On)
|
outline->tags[point] & FT_Curve_Tag_On)
|
||||||
{
|
{
|
||||||
/* add closing pt for bezier */
|
/* Add closing pt for bezier */
|
||||||
if (pvBuf)
|
if (pvBuf)
|
||||||
FTVectorToPOINTFX(&outline->points[point], &ppc->apfx[cpfx]);
|
FTVectorToPOINTFX(&outline->points[point], &ppc->apfx[cpfx]);
|
||||||
cpfx++;
|
cpfx++;
|
||||||
|
@ -2030,8 +2030,7 @@ ftGdiGetGlyphOutline(
|
||||||
(outline->tags[point] & FT_Curve_Tag_On) ==
|
(outline->tags[point] & FT_Curve_Tag_On) ==
|
||||||
(outline->tags[point-1] & FT_Curve_Tag_On));
|
(outline->tags[point-1] & FT_Curve_Tag_On));
|
||||||
/* At the end of a contour Windows adds the start point,
|
/* At the end of a contour Windows adds the start point,
|
||||||
but only for Beziers and we've already done that.
|
but only for Beziers and we've already done that. */
|
||||||
*/
|
|
||||||
if (point <= outline->contours[contour] &&
|
if (point <= outline->contours[contour] &&
|
||||||
outline->tags[point] & FT_Curve_Tag_On)
|
outline->tags[point] & FT_Curve_Tag_On)
|
||||||
{
|
{
|
||||||
|
@ -2100,7 +2099,7 @@ TextIntGetTextExtentPoint(PDC dc,
|
||||||
for (n = 0; n < face->num_charmaps; n++)
|
for (n = 0; n < face->num_charmaps; n++)
|
||||||
{
|
{
|
||||||
charmap = face->charmaps[n];
|
charmap = face->charmaps[n];
|
||||||
DPRINT("found charmap encoding: %u\n", charmap->encoding);
|
DPRINT("Found charmap encoding: %u\n", charmap->encoding);
|
||||||
if (charmap->encoding != 0)
|
if (charmap->encoding != 0)
|
||||||
{
|
{
|
||||||
found = charmap;
|
found = charmap;
|
||||||
|
@ -2128,7 +2127,7 @@ TextIntGetTextExtentPoint(PDC dc,
|
||||||
|
|
||||||
error = FT_Set_Pixel_Sizes(face,
|
error = FT_Set_Pixel_Sizes(face,
|
||||||
TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfWidth,
|
TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfWidth,
|
||||||
/* FIXME should set character height if neg */
|
/* FIXME: Should set character height if neg */
|
||||||
(TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfHeight == 0 ?
|
(TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfHeight == 0 ?
|
||||||
dc->ppdev->devinfo.lfDefaultFont.lfHeight : abs(TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfHeight)));
|
dc->ppdev->devinfo.lfDefaultFont.lfHeight : abs(TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfHeight)));
|
||||||
if (error)
|
if (error)
|
||||||
|
@ -2166,7 +2165,7 @@ TextIntGetTextExtentPoint(PDC dc,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* retrieve kerning distance */
|
/* Retrieve kerning distance */
|
||||||
if (use_kerning && previous && glyph_index)
|
if (use_kerning && previous && glyph_index)
|
||||||
{
|
{
|
||||||
FT_Vector delta;
|
FT_Vector delta;
|
||||||
|
@ -2255,7 +2254,7 @@ ftGdiGetTextCharsetInfo(
|
||||||
}
|
}
|
||||||
DPRINT("Csb 1=%x 0=%x\n", fs.fsCsb[1],fs.fsCsb[0]);
|
DPRINT("Csb 1=%x 0=%x\n", fs.fsCsb[1],fs.fsCsb[0]);
|
||||||
if (fs.fsCsb[0] == 0)
|
if (fs.fsCsb[0] == 0)
|
||||||
{ /* let's see if we can find any interesting cmaps */
|
{ /* Let's see if we can find any interesting cmaps */
|
||||||
for (i = 0; i < Face->num_charmaps; i++)
|
for (i = 0; i < Face->num_charmaps; i++)
|
||||||
{
|
{
|
||||||
switch (Face->charmaps[i]->encoding)
|
switch (Face->charmaps[i]->encoding)
|
||||||
|
@ -2325,7 +2324,7 @@ ftGetFontUnicodeRanges(PFONTGDI Font, PGLYPHSET glyphset)
|
||||||
|
|
||||||
char_code_prev = char_code = FT_Get_First_Char(face, &glyph_code);
|
char_code_prev = char_code = FT_Get_First_Char(face, &glyph_code);
|
||||||
|
|
||||||
DPRINT("face encoding FT_ENCODING_UNICODE, number of glyphs %ld, first glyph %u, first char %04lx\n",
|
DPRINT("Face encoding FT_ENCODING_UNICODE, number of glyphs %ld, first glyph %u, first char %04lx\n",
|
||||||
face->num_glyphs, glyph_code, char_code);
|
face->num_glyphs, glyph_code, char_code);
|
||||||
|
|
||||||
if (!glyph_code) return 0;
|
if (!glyph_code) return 0;
|
||||||
|
@ -2342,7 +2341,7 @@ ftGetFontUnicodeRanges(PFONTGDI Font, PGLYPHSET glyphset)
|
||||||
{
|
{
|
||||||
if (char_code < char_code_prev)
|
if (char_code < char_code_prev)
|
||||||
{
|
{
|
||||||
DPRINT1("expected increasing char code from FT_Get_Next_Char\n");
|
DPRINT1("Expected increasing char code from FT_Get_Next_Char\n");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
if (char_code - char_code_prev > 1)
|
if (char_code - char_code_prev > 1)
|
||||||
|
@ -2365,7 +2364,7 @@ ftGetFontUnicodeRanges(PFONTGDI Font, PGLYPHSET glyphset)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
DPRINT1("encoding %u not supported\n", face->charmap->encoding);
|
DPRINT1("Encoding %u not supported\n", face->charmap->encoding);
|
||||||
|
|
||||||
size = sizeof(GLYPHSET) + sizeof(WCRANGE) * (num_ranges - 1);
|
size = sizeof(GLYPHSET) + sizeof(WCRANGE) * (num_ranges - 1);
|
||||||
if (glyphset)
|
if (glyphset)
|
||||||
|
@ -2415,7 +2414,7 @@ ftGdiGetTextMetricsW(
|
||||||
IntLockFreeType;
|
IntLockFreeType;
|
||||||
Error = FT_Set_Pixel_Sizes(Face,
|
Error = FT_Set_Pixel_Sizes(Face,
|
||||||
TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfWidth,
|
TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfWidth,
|
||||||
/* FIXME should set character height if neg */
|
/* FIXME: Should set character height if neg */
|
||||||
(TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfHeight == 0 ?
|
(TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfHeight == 0 ?
|
||||||
dc->ppdev->devinfo.lfDefaultFont.lfHeight : abs(TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfHeight)));
|
dc->ppdev->devinfo.lfDefaultFont.lfHeight : abs(TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfHeight)));
|
||||||
IntUnLockFreeType;
|
IntUnLockFreeType;
|
||||||
|
@ -2675,7 +2674,7 @@ IntFontType(PFONTGDI Font)
|
||||||
{
|
{
|
||||||
Font->FontObj.flFontType |= FO_POSTSCRIPT;
|
Font->FontObj.flFontType |= FO_POSTSCRIPT;
|
||||||
}
|
}
|
||||||
/* check for the presence of the 'CFF ' table to check if the font is Type1 */
|
/* Check for the presence of the 'CFF ' table to check if the font is Type1 */
|
||||||
if (!FT_Load_Sfnt_Table(Font->face, FT_MAKE_TAG('C','F','F',' '), 0, NULL, &tmp_size))
|
if (!FT_Load_Sfnt_Table(Font->face, FT_MAKE_TAG('C','F','F',' '), 0, NULL, &tmp_size))
|
||||||
{
|
{
|
||||||
Font->FontObj.flFontType |= (FO_CFF|FO_POSTSCRIPT);
|
Font->FontObj.flFontType |= (FO_CFF|FO_POSTSCRIPT);
|
||||||
|
@ -2861,7 +2860,7 @@ IntGdiGetFontResourceInfo(
|
||||||
{
|
{
|
||||||
if (RtlEqualUnicodeString(&NameInfo1->Name, &NameInfo2->Name, FALSE))
|
if (RtlEqualUnicodeString(&NameInfo1->Name, &NameInfo2->Name, FALSE))
|
||||||
{
|
{
|
||||||
/* found */
|
/* Found */
|
||||||
FontFamilyFillInfo(&Info, FontEntry->FaceName.Buffer, FontEntry->Font);
|
FontFamilyFillInfo(&Info, FontEntry->FaceName.Buffer, FontEntry->Font);
|
||||||
bFound = TRUE;
|
bFound = TRUE;
|
||||||
break;
|
break;
|
||||||
|
@ -2884,7 +2883,7 @@ IntGdiGetFontResourceInfo(
|
||||||
|
|
||||||
switch (dwType)
|
switch (dwType)
|
||||||
{
|
{
|
||||||
case 0: /* FIXME: returns 1 or 2, don't know what this is atm */
|
case 0: /* FIXME: Returns 1 or 2, don't know what this is atm */
|
||||||
*(DWORD*)pBuffer = 1;
|
*(DWORD*)pBuffer = 1;
|
||||||
*pdwBytes = sizeof(DWORD);
|
*pdwBytes = sizeof(DWORD);
|
||||||
break;
|
break;
|
||||||
|
@ -2986,11 +2985,11 @@ ftGdiGetKerningPairs( PFONTGDI Font,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// Functions needing sorting.
|
// Functions needing sorting.
|
||||||
//
|
//
|
||||||
///////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
int APIENTRY
|
int APIENTRY
|
||||||
NtGdiGetFontFamilyInfo(HDC Dc,
|
NtGdiGetFontFamilyInfo(HDC Dc,
|
||||||
LPLOGFONTW UnsafeLogFont,
|
LPLOGFONTW UnsafeLogFont,
|
||||||
|
@ -3239,7 +3238,7 @@ GreExtTextOutW(
|
||||||
for (n = 0; n < face->num_charmaps; n++)
|
for (n = 0; n < face->num_charmaps; n++)
|
||||||
{
|
{
|
||||||
charmap = face->charmaps[n];
|
charmap = face->charmaps[n];
|
||||||
DPRINT("found charmap encoding: %u\n", charmap->encoding);
|
DPRINT("Found charmap encoding: %u\n", charmap->encoding);
|
||||||
if (charmap->encoding != 0)
|
if (charmap->encoding != 0)
|
||||||
{
|
{
|
||||||
found = charmap;
|
found = charmap;
|
||||||
|
@ -3266,7 +3265,7 @@ GreExtTextOutW(
|
||||||
error = FT_Set_Pixel_Sizes(
|
error = FT_Set_Pixel_Sizes(
|
||||||
face,
|
face,
|
||||||
TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfWidth,
|
TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfWidth,
|
||||||
/* FIXME should set character height if neg */
|
/* FIXME: Should set character height if neg */
|
||||||
(TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfHeight == 0 ?
|
(TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfHeight == 0 ?
|
||||||
dc->ppdev->devinfo.lfDefaultFont.lfHeight : abs(TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfHeight)));
|
dc->ppdev->devinfo.lfDefaultFont.lfHeight : abs(TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfHeight)));
|
||||||
if (error)
|
if (error)
|
||||||
|
@ -3342,7 +3341,7 @@ GreExtTextOutW(
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
/* retrieve kerning distance */
|
/* Retrieve kerning distance */
|
||||||
if (use_kerning && previous && glyph_index)
|
if (use_kerning && previous && glyph_index)
|
||||||
{
|
{
|
||||||
FT_Vector delta;
|
FT_Vector delta;
|
||||||
|
@ -3530,12 +3529,12 @@ GreExtTextOutW(
|
||||||
if (NULL == Dx)
|
if (NULL == Dx)
|
||||||
{
|
{
|
||||||
TextLeft += realglyph->root.advance.x >> 10;
|
TextLeft += realglyph->root.advance.x >> 10;
|
||||||
DPRINT("new TextLeft: %d\n", TextLeft);
|
DPRINT("New TextLeft: %d\n", TextLeft);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
TextLeft += Dx[i<<DxShift] << 6;
|
TextLeft += Dx[i<<DxShift] << 6;
|
||||||
DPRINT("new TextLeft2: %d\n", TextLeft);
|
DPRINT("New TextLeft2: %d\n", TextLeft);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (DxShift)
|
if (DxShift)
|
||||||
|
@ -3804,7 +3803,7 @@ NtGdiGetCharABCWidthsW(
|
||||||
IntLockFreeType;
|
IntLockFreeType;
|
||||||
FT_Set_Pixel_Sizes(face,
|
FT_Set_Pixel_Sizes(face,
|
||||||
TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfWidth,
|
TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfWidth,
|
||||||
/* FIXME should set character height if neg */
|
/* FIXME: Should set character height if neg */
|
||||||
(TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfHeight == 0 ?
|
(TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfHeight == 0 ?
|
||||||
dc->ppdev->devinfo.lfDefaultFont.lfHeight : abs(TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfHeight)));
|
dc->ppdev->devinfo.lfDefaultFont.lfHeight : abs(TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfHeight)));
|
||||||
|
|
||||||
|
@ -3971,7 +3970,7 @@ NtGdiGetCharWidthW(
|
||||||
IntLockFreeType;
|
IntLockFreeType;
|
||||||
FT_Set_Pixel_Sizes(face,
|
FT_Set_Pixel_Sizes(face,
|
||||||
TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfWidth,
|
TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfWidth,
|
||||||
/* FIXME should set character height if neg */
|
/* FIXME: Should set character height if neg */
|
||||||
(TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfHeight == 0 ?
|
(TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfHeight == 0 ?
|
||||||
dc->ppdev->devinfo.lfDefaultFont.lfHeight : abs(TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfHeight)));
|
dc->ppdev->devinfo.lfDefaultFont.lfHeight : abs(TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfHeight)));
|
||||||
|
|
||||||
|
@ -4190,7 +4189,7 @@ NtGdiGetGlyphIndicesW(
|
||||||
|
|
||||||
for (i = 0; i < cwc; i++)
|
for (i = 0; i < cwc; i++)
|
||||||
{
|
{
|
||||||
Buffer[i] = FT_Get_Char_Index(face, UnSafepwc[i]); // FIXME: unsafe!
|
Buffer[i] = FT_Get_Char_Index(face, UnSafepwc[i]); // FIXME: Unsafe!
|
||||||
if (Buffer[i] == 0)
|
if (Buffer[i] == 0)
|
||||||
{
|
{
|
||||||
Buffer[i] = DefChar;
|
Buffer[i] = DefChar;
|
||||||
|
@ -4221,5 +4220,4 @@ ErrorRet:
|
||||||
return GDI_ERROR;
|
return GDI_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* EOF */
|
/* EOF */
|
||||||
|
|
|
@ -5,7 +5,6 @@
|
||||||
#include <debug.h>
|
#include <debug.h>
|
||||||
|
|
||||||
|
|
||||||
//
|
|
||||||
//
|
//
|
||||||
// Gdi Batch Flush support functions.
|
// Gdi Batch Flush support functions.
|
||||||
//
|
//
|
||||||
|
@ -217,7 +216,7 @@ NtGdiFlushUserBatch(VOID)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// FIXME: on xp the function returns &pTeb->RealClientId, maybe VOID?
|
// FIXME: On Windows XP the function returns &pTeb->RealClientId, maybe VOID?
|
||||||
return STATUS_SUCCESS;
|
return STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
* PROJECT: ReactOS win32 kernel mode subsystem
|
* PROJECT: ReactOS win32 kernel mode subsystem
|
||||||
* LICENSE: GPL - See COPYING in the top level directory
|
* LICENSE: GPL - See COPYING in the top level directory
|
||||||
* FILE: subsystems/win32/win32k/objects/gdidbg.c
|
* FILE: subsystems/win32/win32k/objects/gdidbg.c
|
||||||
* PURPOSE: Special debugging functions for gdi
|
* PURPOSE: Special debugging functions for GDI
|
||||||
* PROGRAMMERS: Timo Kreuzer
|
* PROGRAMMERS: Timo Kreuzer
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -17,7 +17,7 @@ extern ULONG gulFirstUnused;
|
||||||
|
|
||||||
ULONG gulLogUnique = 0;
|
ULONG gulLogUnique = 0;
|
||||||
|
|
||||||
/* note the following values need to be sorted */
|
/* Note: the following values need to be sorted */
|
||||||
DBG_CHANNEL DbgChannels[DbgChCount]={
|
DBG_CHANNEL DbgChannels[DbgChCount]={
|
||||||
{L"EngBlt", DbgChEngBlt},
|
{L"EngBlt", DbgChEngBlt},
|
||||||
{L"EngBrush", DbgChEngBrush},
|
{L"EngBrush", DbgChEngBrush},
|
||||||
|
@ -125,12 +125,12 @@ DbgDumpGdiHandleTable(void)
|
||||||
|
|
||||||
if (leak_reported)
|
if (leak_reported)
|
||||||
{
|
{
|
||||||
DPRINT1("gdi handle abusers already reported!\n");
|
DPRINT1("GDI handle abusers already reported!\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
leak_reported = 1;
|
leak_reported = 1;
|
||||||
DPRINT1("reporting gdi handle abusers:\n");
|
DPRINT1("Reporting GDI handle abusers:\n");
|
||||||
|
|
||||||
/* We've got serious business to do */
|
/* We've got serious business to do */
|
||||||
KeRaiseIrql(DISPATCH_LEVEL, &OldIrql);
|
KeRaiseIrql(DISPATCH_LEVEL, &OldIrql);
|
||||||
|
@ -200,7 +200,7 @@ DbgDumpGdiHandleTable(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (i < nTraces)
|
if (i < nTraces)
|
||||||
DbgPrint("(list terminated - the remaining entries have 1 allocation only)\n");
|
DbgPrint("(List terminated - the remaining entries have 1 allocation only)\n");
|
||||||
|
|
||||||
KeLowerIrql(OldIrql);
|
KeLowerIrql(OldIrql);
|
||||||
|
|
||||||
|
@ -238,7 +238,7 @@ DbgGdiHTIntegrityCheck()
|
||||||
|
|
||||||
KeEnterCriticalRegion();
|
KeEnterCriticalRegion();
|
||||||
|
|
||||||
/* FIXME: check reserved entries */
|
/* FIXME: Check reserved entries */
|
||||||
|
|
||||||
/* Now go through the deleted objects */
|
/* Now go through the deleted objects */
|
||||||
i = gulFirstFree & 0xffff;
|
i = gulFirstFree & 0xffff;
|
||||||
|
@ -522,7 +522,7 @@ QueryEnvironmentVariable(PUNICODE_STRING Name,
|
||||||
PPEB Peb;
|
PPEB Peb;
|
||||||
PWSTR Environment;
|
PWSTR Environment;
|
||||||
|
|
||||||
/* Ugly hack for reactos system threads */
|
/* Ugly HACK for ReactOS system threads */
|
||||||
if(!NtCurrentTeb())
|
if(!NtCurrentTeb())
|
||||||
{
|
{
|
||||||
return(STATUS_VARIABLE_NOT_FOUND);
|
return(STATUS_VARIABLE_NOT_FOUND);
|
||||||
|
@ -728,3 +728,4 @@ BOOL DbgInitDebugChannels()
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* EOF */
|
||||||
|
|
|
@ -37,7 +37,7 @@
|
||||||
#define NDEBUG
|
#define NDEBUG
|
||||||
#include <debug.h>
|
#include <debug.h>
|
||||||
|
|
||||||
// move to gdidbg.h
|
// Move to gdidbg.h
|
||||||
#if DBG
|
#if DBG
|
||||||
#define DBG_INCREASE_LOCK_COUNT(pti, hobj) \
|
#define DBG_INCREASE_LOCK_COUNT(pti, hobj) \
|
||||||
if (pti) ((PTHREADINFO)pti)->acExclusiveLockCount[((ULONG_PTR)hobj >> 16) & 0x1f]++;
|
if (pti) ((PTHREADINFO)pti)->acExclusiveLockCount[((ULONG_PTR)hobj >> 16) & 0x1f]++;
|
||||||
|
@ -262,7 +262,7 @@ ENTRY_pentPopFreeEntry(VOID)
|
||||||
/* Check if we have unused entries left */
|
/* Check if we have unused entries left */
|
||||||
if (iFirst >= GDI_HANDLE_COUNT)
|
if (iFirst >= GDI_HANDLE_COUNT)
|
||||||
{
|
{
|
||||||
DPRINT1("No more gdi handles left!\n");
|
DPRINT1("No more GDI handles left!\n");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -353,14 +353,14 @@ ENTRY_ReferenceEntryByHandle(HGDIOBJ hobj, FLONG fl)
|
||||||
/* Check if the slot is deleted */
|
/* Check if the slot is deleted */
|
||||||
if ((cOldRefs & REF_MASK_VALID) == 0)
|
if ((cOldRefs & REF_MASK_VALID) == 0)
|
||||||
{
|
{
|
||||||
DPRINT("GDIOBJ: slot not valid: 0x%lx, hobh=%p\n", cOldRefs, hobj);
|
DPRINT("GDIOBJ: Slot is not valid: 0x%lx, hobh=%p\n", cOldRefs, hobj);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Check if the unique value matches */
|
/* Check if the unique value matches */
|
||||||
if (pentry->FullUnique != (USHORT)((ULONG_PTR)hobj >> 16))
|
if (pentry->FullUnique != (USHORT)((ULONG_PTR)hobj >> 16))
|
||||||
{
|
{
|
||||||
DPRINT("GDIOBJ: wrong unique value. Handle: 0x%4x, entry: 0x%4x\n",
|
DPRINT("GDIOBJ: Wrong unique value. Handle: 0x%4x, entry: 0x%4x\n",
|
||||||
(USHORT)((ULONG_PTR)hobj >> 16, pentry->FullUnique));
|
(USHORT)((ULONG_PTR)hobj >> 16, pentry->FullUnique));
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
@ -536,7 +536,7 @@ GDIOBJ_ReferenceObjectByHandle(
|
||||||
ASSERT_SHARED_OBJECT_TYPE(objt);
|
ASSERT_SHARED_OBJECT_TYPE(objt);
|
||||||
if ((((ULONG_PTR)hobj >> 16) & 0x1f) != objt)
|
if ((((ULONG_PTR)hobj >> 16) & 0x1f) != objt)
|
||||||
{
|
{
|
||||||
DPRINT("GDIOBJ: wrong type. handle=%p, type=%x\n", hobj, objt);
|
DPRINT("GDIOBJ: Wrong type. handle=%p, type=%x\n", hobj, objt);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -544,7 +544,7 @@ GDIOBJ_ReferenceObjectByHandle(
|
||||||
pentry = ENTRY_ReferenceEntryByHandle(hobj, 0);
|
pentry = ENTRY_ReferenceEntryByHandle(hobj, 0);
|
||||||
if (!pentry)
|
if (!pentry)
|
||||||
{
|
{
|
||||||
DPRINT("GDIOBJ: requested handle 0x%p is not valid.\n", hobj);
|
DPRINT("GDIOBJ: Requested handle 0x%p is not valid.\n", hobj);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -606,7 +606,7 @@ GDIOBJ_LockObject(
|
||||||
ASSERT_EXCLUSIVE_OBJECT_TYPE(objt);
|
ASSERT_EXCLUSIVE_OBJECT_TYPE(objt);
|
||||||
if ((((ULONG_PTR)hobj >> 16) & 0x1f) != objt)
|
if ((((ULONG_PTR)hobj >> 16) & 0x1f) != objt)
|
||||||
{
|
{
|
||||||
DPRINT("wrong object type: hobj=0x%p, objt=0x%x\n", hobj, objt);
|
DPRINT("Wrong object type: hobj=0x%p, objt=0x%x\n", hobj, objt);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -614,7 +614,7 @@ GDIOBJ_LockObject(
|
||||||
pentry = ENTRY_ReferenceEntryByHandle(hobj, 0);
|
pentry = ENTRY_ReferenceEntryByHandle(hobj, 0);
|
||||||
if (!pentry)
|
if (!pentry)
|
||||||
{
|
{
|
||||||
DPRINT("GDIOBJ: requested handle 0x%p is not valid.\n", hobj);
|
DPRINT("GDIOBJ: Requested handle 0x%p is not valid.\n", hobj);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -687,7 +687,7 @@ GDIOBJ_hInsertObject(
|
||||||
pentry = ENTRY_pentPopFreeEntry();
|
pentry = ENTRY_pentPopFreeEntry();
|
||||||
if (!pentry)
|
if (!pentry)
|
||||||
{
|
{
|
||||||
DPRINT1("GDIOBJ: could not get a free entry.\n");
|
DPRINT1("GDIOBJ: Could not get a free entry.\n");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -730,7 +730,7 @@ GDIOBJ_vSetObjectOwner(
|
||||||
{
|
{
|
||||||
PENTRY pentry;
|
PENTRY pentry;
|
||||||
|
|
||||||
/* This is a ugly hack, need to fix IntGdiSetDCOwnerEx */
|
/* This is a ugly HACK, needed to fix IntGdiSetDCOwnerEx */
|
||||||
if (GDI_HANDLE_IS_STOCKOBJ(pobj->hHmgr))
|
if (GDI_HANDLE_IS_STOCKOBJ(pobj->hHmgr))
|
||||||
{
|
{
|
||||||
DPRINT("Trying to set ownership of stock object %p to %lx\n", pobj->hHmgr, ulOwner);
|
DPRINT("Trying to set ownership of stock object %p to %lx\n", pobj->hHmgr, ulOwner);
|
||||||
|
@ -974,7 +974,7 @@ GreSetObjectOwner(
|
||||||
/* Check for stock objects */
|
/* Check for stock objects */
|
||||||
if (GDI_HANDLE_IS_STOCKOBJ(hobj))
|
if (GDI_HANDLE_IS_STOCKOBJ(hobj))
|
||||||
{
|
{
|
||||||
DPRINT("GreSetObjectOwner: got stock object %p\n", hobj);
|
DPRINT("GreSetObjectOwner: Got stock object %p\n", hobj);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -982,7 +982,7 @@ GreSetObjectOwner(
|
||||||
pentry = ENTRY_ReferenceEntryByHandle(hobj, 0);
|
pentry = ENTRY_ReferenceEntryByHandle(hobj, 0);
|
||||||
if (!pentry)
|
if (!pentry)
|
||||||
{
|
{
|
||||||
DPRINT("GreSetObjectOwner: invalid handle 0x%p.\n", hobj);
|
DPRINT("GreSetObjectOwner: Invalid handle 0x%p.\n", hobj);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1013,7 +1013,7 @@ GreGetObject(
|
||||||
objt != GDIObjType_LFONT_TYPE &&
|
objt != GDIObjType_LFONT_TYPE &&
|
||||||
objt != GDIObjType_PAL_TYPE)
|
objt != GDIObjType_PAL_TYPE)
|
||||||
{
|
{
|
||||||
DPRINT1("GreGetObject: invalid object type\n");
|
DPRINT1("GreGetObject: Invalid object type\n");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1143,7 +1143,7 @@ NtGdiCreateClientObj(
|
||||||
handle = GDIOBJ_hInsertObject(pObject, GDI_OBJ_HMGR_POWNED);
|
handle = GDIOBJ_hInsertObject(pObject, GDI_OBJ_HMGR_POWNED);
|
||||||
if (!handle)
|
if (!handle)
|
||||||
{
|
{
|
||||||
DPRINT1("NtGdiCreateClientObj Could not create a handle.\n");
|
DPRINT1("NtGdiCreateClientObj: Could not create a handle.\n");
|
||||||
GDIOBJ_vFreeObject(pObject);
|
GDIOBJ_vFreeObject(pObject);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
@ -1199,7 +1199,7 @@ GDIOBJ_ConvertToStockObj(HGDIOBJ *phObj)
|
||||||
pentry = ENTRY_ReferenceEntryByHandle(*phObj, 0);
|
pentry = ENTRY_ReferenceEntryByHandle(*phObj, 0);
|
||||||
if (!pentry)
|
if (!pentry)
|
||||||
{
|
{
|
||||||
DPRINT1("GDIOBJ: requested handle 0x%p is not valid.\n", *phObj);
|
DPRINT1("GDIOBJ: Requested handle 0x%p is not valid.\n", *phObj);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1340,3 +1340,4 @@ GDI_CleanupForProcess(struct _EPROCESS *Process)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* EOF */
|
||||||
|
|
|
@ -33,7 +33,7 @@ typedef struct _GDI_POOL
|
||||||
ULONG cjSectionSize; // 32 * cjAllocSize, rounded up to pages
|
ULONG cjSectionSize; // 32 * cjAllocSize, rounded up to pages
|
||||||
ULONG cSlotsPerSection;
|
ULONG cSlotsPerSection;
|
||||||
ULONG cEmptySections;
|
ULONG cEmptySections;
|
||||||
EX_PUSH_LOCK pushlock; // for pool growth
|
EX_PUSH_LOCK pushlock; // For pool growth
|
||||||
#if DBG_ENABLE_EVENT_LOGGING
|
#if DBG_ENABLE_EVENT_LOGGING
|
||||||
SLIST_HEADER slhLog;
|
SLIST_HEADER slhLog;
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -268,7 +268,7 @@ UpdateDeviceGammaRamp( HDEV hPDev )
|
||||||
//
|
//
|
||||||
// ICM registry subkey sets internal brightness range, gamma range is 128 or
|
// ICM registry subkey sets internal brightness range, gamma range is 128 or
|
||||||
// 256 when icm is init.
|
// 256 when icm is init.
|
||||||
INT IcmGammaRangeSet = 128; // <- make it global
|
INT IcmGammaRangeSet = 128; // <- Make it global
|
||||||
|
|
||||||
BOOL
|
BOOL
|
||||||
FASTCALL
|
FASTCALL
|
||||||
|
@ -401,7 +401,7 @@ NtGdiSetIcmMode(HDC hDC,
|
||||||
ULONG nCommand,
|
ULONG nCommand,
|
||||||
ULONG EnableICM) // ulMode
|
ULONG EnableICM) // ulMode
|
||||||
{
|
{
|
||||||
/* FIXME: this should be coded someday */
|
/* FIXME: This should be coded someday */
|
||||||
if (EnableICM == ICM_OFF)
|
if (EnableICM == ICM_OFF)
|
||||||
{
|
{
|
||||||
return ICM_OFF;
|
return ICM_OFF;
|
||||||
|
|
|
@ -30,7 +30,7 @@ IntGdiMoveToEx(DC *dc,
|
||||||
{
|
{
|
||||||
Point->x = pdcattr->ptfxCurrent.x; // ret prev before change.
|
Point->x = pdcattr->ptfxCurrent.x; // ret prev before change.
|
||||||
Point->y = pdcattr->ptfxCurrent.y;
|
Point->y = pdcattr->ptfxCurrent.y;
|
||||||
IntDPtoLP ( dc, Point, 1); // reconvert back.
|
IntDPtoLP ( dc, Point, 1); // Reconvert back.
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -91,7 +91,7 @@ IntGdiLineTo(DC *dc,
|
||||||
Ret = PATH_LineTo(dc, XEnd, YEnd);
|
Ret = PATH_LineTo(dc, XEnd, YEnd);
|
||||||
if (Ret)
|
if (Ret)
|
||||||
{
|
{
|
||||||
// FIXME - PATH_LineTo should maybe do this? No
|
// FIXME: PATH_LineTo should maybe do this? No
|
||||||
pdcattr->ptlCurrent.x = XEnd;
|
pdcattr->ptlCurrent.x = XEnd;
|
||||||
pdcattr->ptlCurrent.y = YEnd;
|
pdcattr->ptlCurrent.y = YEnd;
|
||||||
pdcattr->ptfxCurrent = pdcattr->ptlCurrent;
|
pdcattr->ptfxCurrent = pdcattr->ptlCurrent;
|
||||||
|
@ -127,7 +127,7 @@ IntGdiLineTo(DC *dc,
|
||||||
Bounds.right = max(Points[0].x, Points[1].x);
|
Bounds.right = max(Points[0].x, Points[1].x);
|
||||||
Bounds.bottom = max(Points[0].y, Points[1].y);
|
Bounds.bottom = max(Points[0].y, Points[1].y);
|
||||||
|
|
||||||
/* get BRUSH from current pen. */
|
/* Get BRUSH from current pen. */
|
||||||
pbrLine = dc->dclevel.pbrLine;
|
pbrLine = dc->dclevel.pbrLine;
|
||||||
ASSERT(pbrLine);
|
ASSERT(pbrLine);
|
||||||
|
|
||||||
|
@ -161,7 +161,7 @@ IntGdiPolyBezier(DC *dc,
|
||||||
LPPOINT pt,
|
LPPOINT pt,
|
||||||
DWORD Count)
|
DWORD Count)
|
||||||
{
|
{
|
||||||
BOOL ret = FALSE; // default to FAILURE
|
BOOL ret = FALSE; // Default to FAILURE
|
||||||
|
|
||||||
if ( PATH_IsPathOpen(dc->dclevel) )
|
if ( PATH_IsPathOpen(dc->dclevel) )
|
||||||
{
|
{
|
||||||
|
@ -189,7 +189,7 @@ IntGdiPolyBezierTo(DC *dc,
|
||||||
LPPOINT pt,
|
LPPOINT pt,
|
||||||
DWORD Count)
|
DWORD Count)
|
||||||
{
|
{
|
||||||
BOOL ret = FALSE; // default to failure
|
BOOL ret = FALSE; // Default to failure
|
||||||
PDC_ATTR pdcattr = dc->pdcattr;
|
PDC_ATTR pdcattr = dc->pdcattr;
|
||||||
|
|
||||||
if ( PATH_IsPathOpen(dc->dclevel) )
|
if ( PATH_IsPathOpen(dc->dclevel) )
|
||||||
|
@ -255,7 +255,7 @@ IntGdiPolyline(DC *dc,
|
||||||
if (Points != NULL)
|
if (Points != NULL)
|
||||||
{
|
{
|
||||||
psurf = dc->dclevel.pSurface;
|
psurf = dc->dclevel.pSurface;
|
||||||
/* FIXME - psurf can be NULL!!!!
|
/* FIXME: psurf can be NULL!!!!
|
||||||
Don't assert but handle this case gracefully! */
|
Don't assert but handle this case gracefully! */
|
||||||
ASSERT(psurf);
|
ASSERT(psurf);
|
||||||
|
|
||||||
|
@ -294,14 +294,14 @@ IntGdiPolylineTo(DC *dc,
|
||||||
LPPOINT pt,
|
LPPOINT pt,
|
||||||
DWORD Count)
|
DWORD Count)
|
||||||
{
|
{
|
||||||
BOOL ret = FALSE; // default to failure
|
BOOL ret = FALSE; // Default to failure
|
||||||
PDC_ATTR pdcattr = dc->pdcattr;
|
PDC_ATTR pdcattr = dc->pdcattr;
|
||||||
|
|
||||||
if (PATH_IsPathOpen(dc->dclevel))
|
if (PATH_IsPathOpen(dc->dclevel))
|
||||||
{
|
{
|
||||||
ret = PATH_PolylineTo(dc, pt, Count);
|
ret = PATH_PolylineTo(dc, pt, Count);
|
||||||
}
|
}
|
||||||
else /* do it using Polyline */
|
else /* Do it using Polyline */
|
||||||
{
|
{
|
||||||
POINT *pts = ExAllocatePoolWithTag(PagedPool,
|
POINT *pts = ExAllocatePoolWithTag(PagedPool,
|
||||||
sizeof(POINT) * (Count + 1),
|
sizeof(POINT) * (Count + 1),
|
||||||
|
@ -337,7 +337,7 @@ IntGdiPolyPolyline(DC *dc,
|
||||||
int i;
|
int i;
|
||||||
LPPOINT pts;
|
LPPOINT pts;
|
||||||
PULONG pc;
|
PULONG pc;
|
||||||
BOOL ret = FALSE; // default to failure
|
BOOL ret = FALSE; // Default to failure
|
||||||
pts = pt;
|
pts = pt;
|
||||||
pc = PolyPoints;
|
pc = PolyPoints;
|
||||||
|
|
||||||
|
@ -449,7 +449,7 @@ NtGdiPolyDraw(
|
||||||
_SEH2_LEAVE;
|
_SEH2_LEAVE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* check for valid point types */
|
/* Check for valid point types */
|
||||||
for (i = 0; i < cCount; i++)
|
for (i = 0; i < cCount; i++)
|
||||||
{
|
{
|
||||||
switch (lpbTypes[i])
|
switch (lpbTypes[i])
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
/*
|
/*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS Win32k subsystem
|
||||||
* PURPOSE: GDI Palette Functions
|
* PURPOSE: GDI Palette Functions
|
||||||
* FILE: subsys/win32k/eng/palette.c
|
* FILE: subsystems/win32/win32k/objects/palette.c
|
||||||
* PROGRAMERS: Jason Filby
|
* PROGRAMERS: Jason Filby
|
||||||
* Timo Kreuzer
|
* Timo Kreuzer
|
||||||
*/
|
*/
|
||||||
|
@ -12,15 +12,15 @@
|
||||||
#define NDEBUG
|
#define NDEBUG
|
||||||
#include <debug.h>
|
#include <debug.h>
|
||||||
|
|
||||||
static UINT SystemPaletteUse = SYSPAL_NOSTATIC; /* the program need save the pallete and restore it */
|
static UINT SystemPaletteUse = SYSPAL_NOSTATIC; /* The program need save the pallete and restore it */
|
||||||
|
|
||||||
PALETTE gpalRGB, gpalBGR, gpalMono, gpalRGB555, gpalRGB565, *gppalDefault;
|
PALETTE gpalRGB, gpalBGR, gpalMono, gpalRGB555, gpalRGB565, *gppalDefault;
|
||||||
PPALETTE appalSurfaceDefault[11];
|
PPALETTE appalSurfaceDefault[11];
|
||||||
|
|
||||||
const PALETTEENTRY g_sysPalTemplate[NB_RESERVED_COLORS] =
|
const PALETTEENTRY g_sysPalTemplate[NB_RESERVED_COLORS] =
|
||||||
{
|
{
|
||||||
// first 10 entries in the system palette
|
// First 10 entries in the system palette
|
||||||
// red green blue flags
|
// Red Green Blue Flags
|
||||||
{ 0x00, 0x00, 0x00, PC_SYS_USED },
|
{ 0x00, 0x00, 0x00, PC_SYS_USED },
|
||||||
{ 0x80, 0x00, 0x00, PC_SYS_USED },
|
{ 0x80, 0x00, 0x00, PC_SYS_USED },
|
||||||
{ 0x00, 0x80, 0x00, PC_SYS_USED },
|
{ 0x00, 0x80, 0x00, PC_SYS_USED },
|
||||||
|
@ -45,7 +45,7 @@ const PALETTEENTRY g_sysPalTemplate[NB_RESERVED_COLORS] =
|
||||||
{ 0x00, 0x00, 0xff, PC_SYS_USED },
|
{ 0x00, 0x00, 0xff, PC_SYS_USED },
|
||||||
{ 0xff, 0x00, 0xff, PC_SYS_USED },
|
{ 0xff, 0x00, 0xff, PC_SYS_USED },
|
||||||
{ 0x00, 0xff, 0xff, PC_SYS_USED },
|
{ 0x00, 0xff, 0xff, PC_SYS_USED },
|
||||||
{ 0xff, 0xff, 0xff, PC_SYS_USED } // last 10
|
{ 0xff, 0xff, 0xff, PC_SYS_USED } // Last 10
|
||||||
};
|
};
|
||||||
|
|
||||||
unsigned short GetNumberOfBits(unsigned int dwMask)
|
unsigned short GetNumberOfBits(unsigned int dwMask)
|
||||||
|
@ -66,7 +66,7 @@ InitPaletteImpl()
|
||||||
HPALETTE hpalette;
|
HPALETTE hpalette;
|
||||||
PLOGPALETTE palPtr;
|
PLOGPALETTE palPtr;
|
||||||
|
|
||||||
// create default palette (20 system colors)
|
// Create default palette (20 system colors)
|
||||||
palPtr = ExAllocatePoolWithTag(PagedPool,
|
palPtr = ExAllocatePoolWithTag(PagedPool,
|
||||||
sizeof(LOGPALETTE) +
|
sizeof(LOGPALETTE) +
|
||||||
(NB_RESERVED_COLORS * sizeof(PALETTEENTRY)),
|
(NB_RESERVED_COLORS * sizeof(PALETTEENTRY)),
|
||||||
|
@ -362,7 +362,7 @@ ULONG
|
||||||
NTAPI
|
NTAPI
|
||||||
PALETTE_ulGetNearestIndex(PALETTE* ppal, ULONG ulColor)
|
PALETTE_ulGetNearestIndex(PALETTE* ppal, ULONG ulColor)
|
||||||
{
|
{
|
||||||
if (ppal->flFlags & PAL_INDEXED) // use fl & PALINDEXED
|
if (ppal->flFlags & PAL_INDEXED) // Use fl & PALINDEXED
|
||||||
return PALETTE_ulGetNearestPaletteIndex(ppal, ulColor);
|
return PALETTE_ulGetNearestPaletteIndex(ppal, ulColor);
|
||||||
else
|
else
|
||||||
return PALETTE_ulGetNearestBitFieldsIndex(ppal, ulColor);
|
return PALETTE_ulGetNearestBitFieldsIndex(ppal, ulColor);
|
||||||
|
@ -523,7 +523,7 @@ NtGdiCreatePaletteInternal ( IN LPLOGPALETTE pLogPal, IN UINT cEntries )
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* FIXME - Handle PalGDI == NULL!!!! */
|
/* FIXME: Handle PalGDI == NULL!!!! */
|
||||||
DPRINT1("PalGDI is NULL\n");
|
DPRINT1("PalGDI is NULL\n");
|
||||||
}
|
}
|
||||||
return NewPalette;
|
return NewPalette;
|
||||||
|
@ -542,7 +542,7 @@ HPALETTE APIENTRY NtGdiCreateHalftonePalette(HDC hDC)
|
||||||
Palette.NumberOfEntries = 256;
|
Palette.NumberOfEntries = 256;
|
||||||
if (IntGetSystemPaletteEntries(hDC, 0, 256, Palette.aEntries) == 0)
|
if (IntGetSystemPaletteEntries(hDC, 0, 256, Palette.aEntries) == 0)
|
||||||
{
|
{
|
||||||
/* from wine, more that 256 color math */
|
/* From WINE, more that 256 color math */
|
||||||
Palette.NumberOfEntries = 20;
|
Palette.NumberOfEntries = 20;
|
||||||
for (i = 0; i < Palette.NumberOfEntries; i++)
|
for (i = 0; i < Palette.NumberOfEntries; i++)
|
||||||
{
|
{
|
||||||
|
@ -556,7 +556,7 @@ HPALETTE APIENTRY NtGdiCreateHalftonePalette(HDC hDC)
|
||||||
Palette.aEntries[0].peBlue=0x00;
|
Palette.aEntries[0].peBlue=0x00;
|
||||||
Palette.aEntries[0].peGreen=0x00;
|
Palette.aEntries[0].peGreen=0x00;
|
||||||
|
|
||||||
/* the first 6 */
|
/* The first 6 */
|
||||||
for (i=1; i <= 6; i++)
|
for (i=1; i <= 6; i++)
|
||||||
{
|
{
|
||||||
Palette.aEntries[i].peRed=(i%2)?0x80:0;
|
Palette.aEntries[i].peRed=(i%2)?0x80:0;
|
||||||
|
@ -787,13 +787,13 @@ IntGdiRealizePalette(HDC hDC)
|
||||||
|
|
||||||
if(!(ppalSurf->flFlags & PAL_INDEXED))
|
if(!(ppalSurf->flFlags & PAL_INDEXED))
|
||||||
{
|
{
|
||||||
// FIXME : set error?
|
// FIXME: Set error?
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
ASSERT(ppalDC->flFlags & PAL_INDEXED);
|
ASSERT(ppalDC->flFlags & PAL_INDEXED);
|
||||||
|
|
||||||
// FIXME : should we resize ppalSurf if it's too small?
|
// FIXME: Should we resize ppalSurf if it's too small?
|
||||||
realize = (ppalDC->NumColors < ppalSurf->NumColors) ? ppalDC->NumColors : ppalSurf->NumColors;
|
realize = (ppalDC->NumColors < ppalSurf->NumColors) ? ppalDC->NumColors : ppalSurf->NumColors;
|
||||||
|
|
||||||
for(i=0; i<realize; i++)
|
for(i=0; i<realize; i++)
|
||||||
|
|
|
@ -369,7 +369,7 @@ PATH_Rectangle ( PDC dc, INT x1, INT y1, INT x2, INT y2 )
|
||||||
* Should be called when a call to RoundRect is performed on a DC that has
|
* Should be called when a call to RoundRect is performed on a DC that has
|
||||||
* an open path. Returns TRUE if successful, else FALSE.
|
* an open path. Returns TRUE if successful, else FALSE.
|
||||||
*
|
*
|
||||||
* FIXME: it adds the same entries to the path as windows does, but there
|
* FIXME: It adds the same entries to the path as windows does, but there
|
||||||
* is an error in the bezier drawing code so that there are small pixel-size
|
* is an error in the bezier drawing code so that there are small pixel-size
|
||||||
* gaps when the resulting path is drawn by StrokePath()
|
* gaps when the resulting path is drawn by StrokePath()
|
||||||
*/
|
*/
|
||||||
|
@ -971,7 +971,7 @@ PATH_PolyPolygon ( PDC dc, const POINT* pts, const INT* counts, UINT polygons )
|
||||||
if(point == 0) startpt = pt;
|
if(point == 0) startpt = pt;
|
||||||
PATH_AddEntry(pPath, &pt, (point == 0) ? PT_MOVETO : PT_LINETO);
|
PATH_AddEntry(pPath, &pt, (point == 0) ? PT_MOVETO : PT_LINETO);
|
||||||
}
|
}
|
||||||
/* win98 adds an extra line to close the figure for some reason */
|
/* Win98 adds an extra line to close the figure for some reason */
|
||||||
PATH_AddEntry(pPath, &startpt, PT_LINETO | PT_CLOSEFIGURE);
|
PATH_AddEntry(pPath, &startpt, PT_LINETO | PT_CLOSEFIGURE);
|
||||||
}
|
}
|
||||||
PATH_UnlockPath( pPath );
|
PATH_UnlockPath( pPath );
|
||||||
|
@ -1688,7 +1688,7 @@ PATH_WidenPath(DC *dc)
|
||||||
PATH_AddEntry(pStrokes[numStrokes - 1], &point, pPath->pFlags[i]);
|
PATH_AddEntry(pStrokes[numStrokes - 1], &point, pPath->pFlags[i]);
|
||||||
break;
|
break;
|
||||||
case PT_BEZIERTO:
|
case PT_BEZIERTO:
|
||||||
/* should never happen because of the FlattenPath call */
|
/* Should never happen because of the FlattenPath call */
|
||||||
DPRINT1("Should never happen\n");
|
DPRINT1("Should never happen\n");
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -1946,7 +1946,7 @@ static inline INT int_from_fixed(FIXED f)
|
||||||
/**********************************************************************
|
/**********************************************************************
|
||||||
* PATH_BezierTo
|
* PATH_BezierTo
|
||||||
*
|
*
|
||||||
* internally used by PATH_add_outline
|
* Internally used by PATH_add_outline
|
||||||
*/
|
*/
|
||||||
static
|
static
|
||||||
VOID
|
VOID
|
||||||
|
@ -2113,7 +2113,7 @@ PATH_ExtTextOut(PDC dc, INT x, INT y, UINT flags, const RECTL *lprc,
|
||||||
TRUE);
|
TRUE);
|
||||||
if (dwSize == GDI_ERROR) return FALSE;
|
if (dwSize == GDI_ERROR) return FALSE;
|
||||||
|
|
||||||
/* add outline only if char is printable */
|
/* Add outline only if char is printable */
|
||||||
if (dwSize)
|
if (dwSize)
|
||||||
{
|
{
|
||||||
outline = ExAllocatePoolWithTag(PagedPool, dwSize, TAG_PATH);
|
outline = ExAllocatePoolWithTag(PagedPool, dwSize, TAG_PATH);
|
||||||
|
@ -2254,7 +2254,7 @@ BOOL
|
||||||
APIENTRY
|
APIENTRY
|
||||||
NtGdiCloseFigure(HDC hDC)
|
NtGdiCloseFigure(HDC hDC)
|
||||||
{
|
{
|
||||||
BOOL Ret = FALSE; // default to failure
|
BOOL Ret = FALSE; // Default to failure
|
||||||
PDC pDc;
|
PDC pDc;
|
||||||
PPATH pPath;
|
PPATH pPath;
|
||||||
|
|
||||||
|
@ -2280,7 +2280,7 @@ NtGdiCloseFigure(HDC hDC)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// FIXME: check if lasterror is set correctly
|
// FIXME: Check if lasterror is set correctly
|
||||||
EngSetLastError(ERROR_CAN_NOT_COMPLETE);
|
EngSetLastError(ERROR_CAN_NOT_COMPLETE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2552,7 +2552,7 @@ NtGdiPathToRegion(HDC hDC)
|
||||||
|
|
||||||
if (pPath->state!=PATH_Closed)
|
if (pPath->state!=PATH_Closed)
|
||||||
{
|
{
|
||||||
//FIXME: check that setlasterror is being called correctly
|
// FIXME: Check that setlasterror is being called correctly
|
||||||
EngSetLastError(ERROR_CAN_NOT_COMPLETE);
|
EngSetLastError(ERROR_CAN_NOT_COMPLETE);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -81,7 +81,7 @@ IntGdiExtCreatePen(
|
||||||
pbrushPen->ulPenStyle = dwPenStyle;
|
pbrushPen->ulPenStyle = dwPenStyle;
|
||||||
pbrushPen->BrushAttr.lbColor = ulColor;
|
pbrushPen->BrushAttr.lbColor = ulColor;
|
||||||
pbrushPen->ulStyle = ulBrushStyle;
|
pbrushPen->ulStyle = ulBrushStyle;
|
||||||
// FIXME: copy the bitmap first ?
|
// FIXME: Copy the bitmap first ?
|
||||||
pbrushPen->hbmClient = (HANDLE)ulClientHatch;
|
pbrushPen->hbmClient = (HANDLE)ulClientHatch;
|
||||||
pbrushPen->dwStyleCount = dwStyleCount;
|
pbrushPen->dwStyleCount = dwStyleCount;
|
||||||
pbrushPen->pStyle = pStyle;
|
pbrushPen->pStyle = pStyle;
|
||||||
|
@ -155,7 +155,7 @@ IntGdiExtCreatePen(
|
||||||
goto ExitCleanup;
|
goto ExitCleanup;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* FIXME: what style here? */
|
/* FIXME: What style here? */
|
||||||
pbrushPen->flAttrs |= 0;
|
pbrushPen->flAttrs |= 0;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -370,6 +370,4 @@ NtGdiExtCreatePen(
|
||||||
return hPen;
|
return hPen;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* EOF */
|
/* EOF */
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
/*
|
/*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS Win32k subsystem
|
||||||
* PURPOSE: Various Polygon Filling routines for Polygon()
|
* PURPOSE: Various Polygon Filling routines for Polygon()
|
||||||
* FILE: subsys/win32k/objects/polyfill.c
|
* FILE: subsystems/win32/win32k/objects/polyfill.c
|
||||||
* PROGRAMER: Mark Tempel
|
* PROGRAMER: Mark Tempel
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -106,7 +106,7 @@ POLYGONFILL_MakeEdge(POINT From, POINT To)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
//DPRINT1("Making Edge: (%d, %d) to (%d, %d)\n", From.x, From.y, To.x, To.y);
|
//DPRINT1("Making Edge: (%d, %d) to (%d, %d)\n", From.x, From.y, To.x, To.y);
|
||||||
//Now Fill the struct.
|
// Now fill the struct.
|
||||||
if ( To.y < From.y )
|
if ( To.y < From.y )
|
||||||
{
|
{
|
||||||
rc->FromX = To.x;
|
rc->FromX = To.x;
|
||||||
|
@ -115,7 +115,7 @@ POLYGONFILL_MakeEdge(POINT From, POINT To)
|
||||||
rc->ToY = From.y;
|
rc->ToY = From.y;
|
||||||
rc->YDirection = -1;
|
rc->YDirection = -1;
|
||||||
|
|
||||||
// lines that go up get walked backwards, so need to be offset
|
// Lines that go up get walked backwards, so need to be offset
|
||||||
// by -1 in order to make the walk identically on a pixel-level
|
// by -1 in order to make the walk identically on a pixel-level
|
||||||
rc->Error = -1;
|
rc->Error = -1;
|
||||||
}
|
}
|
||||||
|
@ -252,7 +252,7 @@ POLYGONFILL_MakeEdgeList(PPOINT Points, int Count)
|
||||||
if ( !e )
|
if ( !e )
|
||||||
goto fail;
|
goto fail;
|
||||||
|
|
||||||
// if a straight horizontal line - who cares?
|
// If a straight horizontal line - who cares?
|
||||||
if ( !e->absdy )
|
if ( !e->absdy )
|
||||||
EngFreeMem ( e );
|
EngFreeMem ( e );
|
||||||
else
|
else
|
||||||
|
@ -298,11 +298,11 @@ POLYGONFILL_UpdateScanline(FILL_EDGE* pEdge, int Scanline)
|
||||||
|
|
||||||
ASSERT ( pEdge->y == Scanline );
|
ASSERT ( pEdge->y == Scanline );
|
||||||
|
|
||||||
// now shoot to end of scanline collision
|
// Now shoot to end of scanline collision
|
||||||
steps = (pEdge->ErrorMax-pEdge->Error-1)/pEdge->absdy;
|
steps = (pEdge->ErrorMax-pEdge->Error-1)/pEdge->absdy;
|
||||||
if ( steps )
|
if ( steps )
|
||||||
{
|
{
|
||||||
// record first collision with scanline
|
// Record first collision with scanline
|
||||||
int x1 = pEdge->x;
|
int x1 = pEdge->x;
|
||||||
pEdge->x += steps * pEdge->XDirection;
|
pEdge->x += steps * pEdge->XDirection;
|
||||||
pEdge->Error += steps * pEdge->absdy;
|
pEdge->Error += steps * pEdge->absdy;
|
||||||
|
@ -316,17 +316,17 @@ POLYGONFILL_UpdateScanline(FILL_EDGE* pEdge, int Scanline)
|
||||||
pEdge->XIntercept[1] = pEdge->x;
|
pEdge->XIntercept[1] = pEdge->x;
|
||||||
}
|
}
|
||||||
|
|
||||||
// we should require exactly 1 step to step onto next scanline...
|
// We should require exactly 1 step to step onto next scanline...
|
||||||
ASSERT ( (pEdge->ErrorMax-pEdge->Error-1) / pEdge->absdy == 0 );
|
ASSERT ( (pEdge->ErrorMax-pEdge->Error-1) / pEdge->absdy == 0 );
|
||||||
pEdge->x += pEdge->XDirection;
|
pEdge->x += pEdge->XDirection;
|
||||||
pEdge->Error += pEdge->absdy;
|
pEdge->Error += pEdge->absdy;
|
||||||
ASSERT ( pEdge->Error >= pEdge->ErrorMax );
|
ASSERT ( pEdge->Error >= pEdge->ErrorMax );
|
||||||
|
|
||||||
// now step onto next scanline...
|
// Now step onto next scanline...
|
||||||
pEdge->Error -= pEdge->absdx;
|
pEdge->Error -= pEdge->absdx;
|
||||||
pEdge->y++;
|
pEdge->y++;
|
||||||
}
|
}
|
||||||
else // then this is a y-major line
|
else // Then this is a y-major line
|
||||||
{
|
{
|
||||||
pEdge->XIntercept[0] = pEdge->x;
|
pEdge->XIntercept[0] = pEdge->x;
|
||||||
pEdge->XIntercept[1] = pEdge->x;
|
pEdge->XIntercept[1] = pEdge->x;
|
||||||
|
@ -347,7 +347,7 @@ POLYGONFILL_UpdateScanline(FILL_EDGE* pEdge, int Scanline)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
** This method updates the Active edge collection for the scanline Scanline.
|
* This method updates the Active edge collection for the scanline Scanline.
|
||||||
*/
|
*/
|
||||||
static
|
static
|
||||||
void
|
void
|
||||||
|
@ -448,7 +448,7 @@ POLYGONFILL_FillScanLineWinding(
|
||||||
pRight = pLeft->pNext;
|
pRight = pLeft->pNext;
|
||||||
ASSERT(pRight);
|
ASSERT(pRight);
|
||||||
|
|
||||||
// setup first line...
|
// Setup first line...
|
||||||
x1 = pLeft->XIntercept[0];
|
x1 = pLeft->XIntercept[0];
|
||||||
x2 = pRight->XIntercept[1];
|
x2 = pRight->XIntercept[1];
|
||||||
|
|
||||||
|
@ -462,20 +462,20 @@ POLYGONFILL_FillScanLineWinding(
|
||||||
int newx2 = pRight->XIntercept[1];
|
int newx2 = pRight->XIntercept[1];
|
||||||
if ( winding )
|
if ( winding )
|
||||||
{
|
{
|
||||||
// check and see if this new line touches the previous...
|
// Check and see if this new line touches the previous...
|
||||||
if ( (newx1 >= x1 && newx1 <= x2)
|
if ( (newx1 >= x1 && newx1 <= x2)
|
||||||
|| (newx2 >= x1 && newx2 <= x2)
|
|| (newx2 >= x1 && newx2 <= x2)
|
||||||
|| (x1 >= newx1 && x1 <= newx2)
|
|| (x1 >= newx1 && x1 <= newx2)
|
||||||
|| (x2 >= newx2 && x2 <= newx2)
|
|| (x2 >= newx2 && x2 <= newx2)
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
// yup, just tack it on to our existing line
|
// Yup, just tack it on to our existing line
|
||||||
x1 = min(x1,newx1);
|
x1 = min(x1,newx1);
|
||||||
x2 = max(x2,newx2);
|
x2 = max(x2,newx2);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// nope - render the old line..
|
// Nope - render the old line..
|
||||||
BoundRect.left = x1;
|
BoundRect.left = x1;
|
||||||
BoundRect.right = x2;
|
BoundRect.right = x2;
|
||||||
|
|
||||||
|
@ -498,7 +498,7 @@ POLYGONFILL_FillScanLineWinding(
|
||||||
pRight = pLeft->pNext;
|
pRight = pLeft->pNext;
|
||||||
winding += pLeft->YDirection;
|
winding += pLeft->YDirection;
|
||||||
}
|
}
|
||||||
// there will always be a line left-over, render it now...
|
// There will always be a line left-over, render it now...
|
||||||
BoundRect.left = x1;
|
BoundRect.left = x1;
|
||||||
BoundRect.right = x2;
|
BoundRect.right = x2;
|
||||||
|
|
||||||
|
@ -557,7 +557,7 @@ FillPolygon(
|
||||||
|
|
||||||
if ( WINDING == pdcattr->jFillMode )
|
if ( WINDING == pdcattr->jFillMode )
|
||||||
FillScanLine = POLYGONFILL_FillScanLineWinding;
|
FillScanLine = POLYGONFILL_FillScanLineWinding;
|
||||||
else /* default */
|
else /* Default */
|
||||||
FillScanLine = POLYGONFILL_FillScanLineAlternate;
|
FillScanLine = POLYGONFILL_FillScanLineAlternate;
|
||||||
|
|
||||||
/* For each Scanline from BoundRect.bottom to BoundRect.top,
|
/* For each Scanline from BoundRect.bottom to BoundRect.top,
|
||||||
|
|
|
@ -68,7 +68,7 @@ NtGdiEscape(HDC hDC,
|
||||||
return SP_ERROR;
|
return SP_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* TODO FIXME - don't pass umode buffer to an Int function */
|
/* TODO: FIXME: Don't pass umode buffer to an Int function */
|
||||||
ret = IntGdiEscape(dc, Escape, InSize, InData, OutData);
|
ret = IntGdiEscape(dc, Escape, InSize, InData, OutData);
|
||||||
|
|
||||||
DC_UnlockDc( dc );
|
DC_UnlockDc( dc );
|
||||||
|
@ -172,7 +172,7 @@ NtGdiExtEscape(
|
||||||
|
|
||||||
_SEH2_TRY
|
_SEH2_TRY
|
||||||
{
|
{
|
||||||
/* pointers were already probed! */
|
/* Pointers were already probed! */
|
||||||
RtlCopyMemory(SafeInData,
|
RtlCopyMemory(SafeInData,
|
||||||
UnsafeInData,
|
UnsafeInData,
|
||||||
InSize);
|
InSize);
|
||||||
|
@ -235,7 +235,7 @@ freeout:
|
||||||
{
|
{
|
||||||
_SEH2_TRY
|
_SEH2_TRY
|
||||||
{
|
{
|
||||||
/* pointers were already probed! */
|
/* Pointers were already probed! */
|
||||||
RtlCopyMemory(UnsafeOutData,
|
RtlCopyMemory(UnsafeOutData,
|
||||||
SafeOutData,
|
SafeOutData,
|
||||||
OutSize);
|
OutSize);
|
||||||
|
|
|
@ -181,10 +181,10 @@ HRGN hrgnDefault = NULL;
|
||||||
* we traverse an entire pixel.
|
* we traverse an entire pixel.
|
||||||
*/
|
*/
|
||||||
#define BRESINITPGON(dy, x1, x2, xStart, d, m, m1, incr1, incr2) { \
|
#define BRESINITPGON(dy, x1, x2, xStart, d, m, m1, incr1, incr2) { \
|
||||||
int dx; /* local storage */ \
|
int dx; /* Local storage */ \
|
||||||
\
|
\
|
||||||
/* \
|
/* \
|
||||||
* if the edge is horizontal, then it is ignored \
|
* If the edge is horizontal, then it is ignored \
|
||||||
* and assumed not to be processed. Otherwise, do this stuff. \
|
* and assumed not to be processed. Otherwise, do this stuff. \
|
||||||
*/ \
|
*/ \
|
||||||
if ((dy) != 0) { \
|
if ((dy) != 0) { \
|
||||||
|
@ -237,10 +237,10 @@ HRGN hrgnDefault = NULL;
|
||||||
*/
|
*/
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
INT minor_axis; /* minor axis */
|
INT minor_axis; /* Minor axis */
|
||||||
INT d; /* decision variable */
|
INT d; /* Decision variable */
|
||||||
INT m, m1; /* slope and slope+1 */
|
INT m, m1; /* Slope and slope+1 */
|
||||||
INT incr1, incr2; /* error increments */
|
INT incr1, incr2; /* Error increments */
|
||||||
} BRESINFO;
|
} BRESINFO;
|
||||||
|
|
||||||
|
|
||||||
|
@ -300,7 +300,7 @@ typedef struct
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* for the winding number rule
|
* For the winding number rule
|
||||||
*/
|
*/
|
||||||
#define CLOCKWISE 1
|
#define CLOCKWISE 1
|
||||||
#define COUNTERCLOCKWISE -1
|
#define COUNTERCLOCKWISE -1
|
||||||
|
@ -309,18 +309,18 @@ typedef struct _EdgeTableEntry
|
||||||
{
|
{
|
||||||
INT ymax; /* ycoord at which we exit this edge. */
|
INT ymax; /* ycoord at which we exit this edge. */
|
||||||
BRESINFO bres; /* Bresenham info to run the edge */
|
BRESINFO bres; /* Bresenham info to run the edge */
|
||||||
struct _EdgeTableEntry *next; /* next in the list */
|
struct _EdgeTableEntry *next; /* Next in the list */
|
||||||
struct _EdgeTableEntry *back; /* for insertion sort */
|
struct _EdgeTableEntry *back; /* For insertion sort */
|
||||||
struct _EdgeTableEntry *nextWETE; /* for winding num rule */
|
struct _EdgeTableEntry *nextWETE; /* For winding num rule */
|
||||||
int ClockWise; /* flag for winding number rule */
|
int ClockWise; /* Flag for winding number rule */
|
||||||
} EdgeTableEntry;
|
} EdgeTableEntry;
|
||||||
|
|
||||||
|
|
||||||
typedef struct _ScanLineList
|
typedef struct _ScanLineList
|
||||||
{
|
{
|
||||||
INT scanline; /* the scanline represented */
|
INT scanline; /* The scanline represented */
|
||||||
EdgeTableEntry *edgelist; /* header node */
|
EdgeTableEntry *edgelist; /* Header node */
|
||||||
struct _ScanLineList *next; /* next in the list */
|
struct _ScanLineList *next; /* Next in the list */
|
||||||
} ScanLineList;
|
} ScanLineList;
|
||||||
|
|
||||||
|
|
||||||
|
@ -328,7 +328,7 @@ typedef struct
|
||||||
{
|
{
|
||||||
INT ymax; /* ymax for the polygon */
|
INT ymax; /* ymax for the polygon */
|
||||||
INT ymin; /* ymin for the polygon */
|
INT ymin; /* ymin for the polygon */
|
||||||
ScanLineList scanlines; /* header node */
|
ScanLineList scanlines; /* Header node */
|
||||||
} EdgeTable;
|
} EdgeTable;
|
||||||
|
|
||||||
|
|
||||||
|
@ -347,8 +347,7 @@ typedef struct _ScanLineListBlock
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
* A few macros for the inner loops of the fill code where
|
||||||
* a few macros for the inner loops of the fill code where
|
|
||||||
* performance considerations don't allow a procedure call.
|
* performance considerations don't allow a procedure call.
|
||||||
*
|
*
|
||||||
* Evaluate the given edge at the given scanline.
|
* Evaluate the given edge at the given scanline.
|
||||||
|
@ -360,7 +359,7 @@ typedef struct _ScanLineListBlock
|
||||||
* can reorder the Winding Active Edge Table.
|
* can reorder the Winding Active Edge Table.
|
||||||
*/
|
*/
|
||||||
#define EVALUATEEDGEWINDING(pAET, pPrevAET, y, fixWAET) { \
|
#define EVALUATEEDGEWINDING(pAET, pPrevAET, y, fixWAET) { \
|
||||||
if (pAET->ymax == y) { /* leaving this edge */ \
|
if (pAET->ymax == y) { /* Leaving this edge */ \
|
||||||
pPrevAET->next = pAET->next; \
|
pPrevAET->next = pAET->next; \
|
||||||
pAET = pPrevAET->next; \
|
pAET = pPrevAET->next; \
|
||||||
fixWAET = 1; \
|
fixWAET = 1; \
|
||||||
|
@ -383,7 +382,7 @@ typedef struct _ScanLineListBlock
|
||||||
* The even-odd rule is in effect.
|
* The even-odd rule is in effect.
|
||||||
*/
|
*/
|
||||||
#define EVALUATEEDGEEVENODD(pAET, pPrevAET, y) { \
|
#define EVALUATEEDGEEVENODD(pAET, pPrevAET, y) { \
|
||||||
if (pAET->ymax == y) { /* leaving this edge */ \
|
if (pAET->ymax == y) { /* Leaving this edge */ \
|
||||||
pPrevAET->next = pAET->next; \
|
pPrevAET->next = pAET->next; \
|
||||||
pAET = pPrevAET->next; \
|
pAET = pPrevAET->next; \
|
||||||
if (pAET) \
|
if (pAET) \
|
||||||
|
@ -449,7 +448,7 @@ typedef void (FASTCALL *nonOverlapProcp)(PROSRGNDATA, PRECT, PRECT, INT, INT);
|
||||||
|
|
||||||
#define RGN_DEFAULT_RECTS 2
|
#define RGN_DEFAULT_RECTS 2
|
||||||
|
|
||||||
// used to allocate buffers for points and link the buffers together
|
// Used to allocate buffers for points and link the buffers together
|
||||||
|
|
||||||
typedef struct _POINTBLOCK
|
typedef struct _POINTBLOCK
|
||||||
{
|
{
|
||||||
|
@ -484,7 +483,7 @@ IntDumpRegion(HRGN hRgn)
|
||||||
|
|
||||||
RGNOBJAPI_Unlock(Data);
|
RGNOBJAPI_Unlock(Data);
|
||||||
}
|
}
|
||||||
#endif /* not NDEBUG */
|
#endif /* Not NDEBUG */
|
||||||
|
|
||||||
|
|
||||||
INT
|
INT
|
||||||
|
@ -509,7 +508,7 @@ REGION_CopyRegion(
|
||||||
PROSRGNDATA src
|
PROSRGNDATA src
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
if (dst != src) // don't want to copy to itself
|
if (dst != src) // Don't want to copy to itself
|
||||||
{
|
{
|
||||||
if (dst->rdh.nRgnSize < src->rdh.nCount * sizeof(RECT))
|
if (dst->rdh.nRgnSize < src->rdh.nCount * sizeof(RECT))
|
||||||
{
|
{
|
||||||
|
@ -520,11 +519,11 @@ REGION_CopyRegion(
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
if (dst->Buffer && dst->Buffer != &dst->rdh.rcBound)
|
if (dst->Buffer && dst->Buffer != &dst->rdh.rcBound)
|
||||||
ExFreePoolWithTag(dst->Buffer, TAG_REGION); //free the old buffer
|
ExFreePoolWithTag(dst->Buffer, TAG_REGION); // Free the old buffer
|
||||||
dst->Buffer = temp;
|
dst->Buffer = temp;
|
||||||
dst->rdh.nRgnSize = src->rdh.nCount * sizeof(RECT); //size of region buffer
|
dst->rdh.nRgnSize = src->rdh.nCount * sizeof(RECT); // Size of region buffer
|
||||||
}
|
}
|
||||||
dst->rdh.nCount = src->rdh.nCount; //number of rectangles present in Buffer
|
dst->rdh.nCount = src->rdh.nCount; // Number of rectangles present in Buffer
|
||||||
dst->rdh.rcBound.left = src->rdh.rcBound.left;
|
dst->rdh.rcBound.left = src->rdh.rcBound.left;
|
||||||
dst->rdh.rcBound.top = src->rdh.rcBound.top;
|
dst->rdh.rcBound.top = src->rdh.rcBound.top;
|
||||||
dst->rdh.rcBound.right = src->rdh.rcBound.right;
|
dst->rdh.rcBound.right = src->rdh.rcBound.right;
|
||||||
|
@ -594,7 +593,7 @@ REGION_CropAndOffsetRegion(
|
||||||
|
|
||||||
if (!off) off = &pt;
|
if (!off) off = &pt;
|
||||||
|
|
||||||
if (!rect) // just copy and offset
|
if (!rect) // Just copy and offset
|
||||||
{
|
{
|
||||||
PRECTL xrect;
|
PRECTL xrect;
|
||||||
if (rgnDst == rgnSrc)
|
if (rgnDst == rgnSrc)
|
||||||
|
@ -610,7 +609,7 @@ REGION_CropAndOffsetRegion(
|
||||||
if(!xrect)
|
if(!xrect)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
if (rgnDst->Buffer && rgnDst->Buffer != &rgnDst->rdh.rcBound)
|
if (rgnDst->Buffer && rgnDst->Buffer != &rgnDst->rdh.rcBound)
|
||||||
ExFreePoolWithTag(rgnDst->Buffer, TAG_REGION); //free the old buffer. will be assigned to xrect below.
|
ExFreePoolWithTag(rgnDst->Buffer, TAG_REGION); // Free the old buffer. Will be assigned to xrect below.
|
||||||
}
|
}
|
||||||
|
|
||||||
if (rgnDst != rgnSrc)
|
if (rgnDst != rgnSrc)
|
||||||
|
@ -646,7 +645,7 @@ REGION_CropAndOffsetRegion(
|
||||||
{
|
{
|
||||||
goto empty;
|
goto empty;
|
||||||
}
|
}
|
||||||
else // region box and clipping rect appear to intersect
|
else // Region box and clipping rect appear to intersect
|
||||||
{
|
{
|
||||||
PRECTL lpr, rpr;
|
PRECTL lpr, rpr;
|
||||||
ULONG i, j, clipa, clipb;
|
ULONG i, j, clipa, clipb;
|
||||||
|
@ -654,7 +653,7 @@ REGION_CropAndOffsetRegion(
|
||||||
INT right = rgnSrc->rdh.rcBound.left + off->x;
|
INT right = rgnSrc->rdh.rcBound.left + off->x;
|
||||||
|
|
||||||
for (clipa = 0; (rgnSrc->Buffer + clipa)->bottom <= rect->top; clipa++)
|
for (clipa = 0; (rgnSrc->Buffer + clipa)->bottom <= rect->top; clipa++)
|
||||||
//region and rect intersect so we stop before clipa > rgnSrc->rdh.nCount
|
// Region and rect intersect so we stop before clipa > rgnSrc->rdh.nCount
|
||||||
; // skip bands above the clipping rectangle
|
; // skip bands above the clipping rectangle
|
||||||
|
|
||||||
for (clipb = clipa; clipb < rgnSrc->rdh.nCount; clipb++)
|
for (clipb = clipa; clipb < rgnSrc->rdh.nCount; clipb++)
|
||||||
|
@ -709,13 +708,13 @@ REGION_CropAndOffsetRegion(
|
||||||
right = rect->bottom + off->y;
|
right = rect->bottom + off->y;
|
||||||
|
|
||||||
rgnDst->rdh.nCount = j--;
|
rgnDst->rdh.nCount = j--;
|
||||||
for (i = 0; i <= j; i++) // fixup top band
|
for (i = 0; i <= j; i++) // Fixup top band
|
||||||
if ((rgnDst->Buffer + i)->top < left)
|
if ((rgnDst->Buffer + i)->top < left)
|
||||||
(rgnDst->Buffer + i)->top = left;
|
(rgnDst->Buffer + i)->top = left;
|
||||||
else
|
else
|
||||||
break;
|
break;
|
||||||
|
|
||||||
for (i = j; i > 0; i--) // fixup bottom band
|
for (i = j; i > 0; i--) // Fixup bottom band
|
||||||
if ((rgnDst->Buffer + i)->bottom > right)
|
if ((rgnDst->Buffer + i)->bottom > right)
|
||||||
(rgnDst->Buffer + i)->bottom = right;
|
(rgnDst->Buffer + i)->bottom = right;
|
||||||
else
|
else
|
||||||
|
@ -772,7 +771,7 @@ REGION_Coalesce(
|
||||||
RECTL *pRegEnd; /* End of region */
|
RECTL *pRegEnd; /* End of region */
|
||||||
INT curNumRects; /* Number of rectangles in current band */
|
INT curNumRects; /* Number of rectangles in current band */
|
||||||
INT prevNumRects; /* Number of rectangles in previous band */
|
INT prevNumRects; /* Number of rectangles in previous band */
|
||||||
INT bandtop; /* top coordinate for current band */
|
INT bandtop; /* Top coordinate for current band */
|
||||||
|
|
||||||
pRegEnd = pReg->Buffer + pReg->rdh.nCount;
|
pRegEnd = pReg->Buffer + pReg->rdh.nCount;
|
||||||
pPrevRect = pReg->Buffer + prevStart;
|
pPrevRect = pReg->Buffer + prevStart;
|
||||||
|
@ -925,7 +924,7 @@ REGION_RegionOp(
|
||||||
INT ytop; /* Top of intersection */
|
INT ytop; /* Top of intersection */
|
||||||
RECTL *oldRects; /* Old rects for newReg */
|
RECTL *oldRects; /* Old rects for newReg */
|
||||||
ULONG prevBand; /* Index of start of
|
ULONG prevBand; /* Index of start of
|
||||||
* previous band in newReg */
|
* Previous band in newReg */
|
||||||
ULONG curBand; /* Index of start of current band in newReg */
|
ULONG curBand; /* Index of start of current band in newReg */
|
||||||
RECTL *r1BandEnd; /* End of current band in r1 */
|
RECTL *r1BandEnd; /* End of current band in r1 */
|
||||||
RECTL *r2BandEnd; /* End of current band in r2 */
|
RECTL *r2BandEnd; /* End of current band in r2 */
|
||||||
|
@ -1274,7 +1273,7 @@ REGION_IntersectRegion(
|
||||||
ROSRGNDATA *reg2
|
ROSRGNDATA *reg2
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
/* check for trivial reject */
|
/* Check for trivial reject */
|
||||||
if ( (!(reg1->rdh.nCount)) || (!(reg2->rdh.nCount)) ||
|
if ( (!(reg1->rdh.nCount)) || (!(reg2->rdh.nCount)) ||
|
||||||
(!EXTENTCHECK(®1->rdh.rcBound, ®2->rdh.rcBound)) )
|
(!EXTENTCHECK(®1->rdh.rcBound, ®2->rdh.rcBound)) )
|
||||||
newReg->rdh.nCount = 0;
|
newReg->rdh.nCount = 0;
|
||||||
|
@ -1424,7 +1423,7 @@ REGION_UnionRegion(
|
||||||
ROSRGNDATA *reg2
|
ROSRGNDATA *reg2
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
/* checks all the simple cases */
|
/* Checks all the simple cases */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Region 1 and 2 are the same or region 1 is empty
|
* Region 1 and 2 are the same or region 1 is empty
|
||||||
|
@ -1441,7 +1440,7 @@ REGION_UnionRegion(
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* if nothing to union (region 2 empty)
|
* If nothing to union (region 2 empty)
|
||||||
*/
|
*/
|
||||||
if (0 == reg2->rdh.nCount ||
|
if (0 == reg2->rdh.nCount ||
|
||||||
reg2->rdh.rcBound.right <= reg2->rdh.rcBound.left ||
|
reg2->rdh.rcBound.right <= reg2->rdh.rcBound.left ||
|
||||||
|
@ -1690,7 +1689,7 @@ REGION_SubtractRegion(
|
||||||
ROSRGNDATA *regS
|
ROSRGNDATA *regS
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
/* check for trivial reject */
|
/* Check for trivial reject */
|
||||||
if ( (!(regM->rdh.nCount)) || (!(regS->rdh.nCount)) ||
|
if ( (!(regM->rdh.nCount)) || (!(regS->rdh.nCount)) ||
|
||||||
(!EXTENTCHECK(®M->rdh.rcBound, ®S->rdh.rcBound)) )
|
(!EXTENTCHECK(®M->rdh.rcBound, ®S->rdh.rcBound)) )
|
||||||
{
|
{
|
||||||
|
@ -1724,7 +1723,7 @@ REGION_XorRegion(
|
||||||
HRGN htra, htrb;
|
HRGN htra, htrb;
|
||||||
ROSRGNDATA *tra, *trb;
|
ROSRGNDATA *tra, *trb;
|
||||||
|
|
||||||
// FIXME: don't use a handle
|
// FIXME: Don't use a handle
|
||||||
tra = REGION_AllocRgnWithHandle(sra->rdh.nCount + 1);
|
tra = REGION_AllocRgnWithHandle(sra->rdh.nCount + 1);
|
||||||
if (!tra )
|
if (!tra )
|
||||||
{
|
{
|
||||||
|
@ -1732,7 +1731,7 @@ REGION_XorRegion(
|
||||||
}
|
}
|
||||||
htra = tra->BaseObject.hHmgr;
|
htra = tra->BaseObject.hHmgr;
|
||||||
|
|
||||||
// FIXME: don't use a handle
|
// FIXME: Don't use a handle
|
||||||
trb = REGION_AllocRgnWithHandle(srb->rdh.nCount + 1);
|
trb = REGION_AllocRgnWithHandle(srb->rdh.nCount + 1);
|
||||||
if (!trb)
|
if (!trb)
|
||||||
{
|
{
|
||||||
|
@ -1791,7 +1790,7 @@ REGION_CreateSimpleFrameRgn(
|
||||||
{
|
{
|
||||||
if (y != 0)
|
if (y != 0)
|
||||||
{
|
{
|
||||||
/* top rectangle */
|
/* Top rectangle */
|
||||||
prc->left = rgn->rdh.rcBound.left;
|
prc->left = rgn->rdh.rcBound.left;
|
||||||
prc->top = rgn->rdh.rcBound.top;
|
prc->top = rgn->rdh.rcBound.top;
|
||||||
prc->right = rgn->rdh.rcBound.right;
|
prc->right = rgn->rdh.rcBound.right;
|
||||||
|
@ -1801,14 +1800,14 @@ REGION_CreateSimpleFrameRgn(
|
||||||
|
|
||||||
if (x != 0)
|
if (x != 0)
|
||||||
{
|
{
|
||||||
/* left rectangle */
|
/* Left rectangle */
|
||||||
prc->left = rgn->rdh.rcBound.left;
|
prc->left = rgn->rdh.rcBound.left;
|
||||||
prc->top = rgn->rdh.rcBound.top + y;
|
prc->top = rgn->rdh.rcBound.top + y;
|
||||||
prc->right = prc->left + x;
|
prc->right = prc->left + x;
|
||||||
prc->bottom = rgn->rdh.rcBound.bottom - y;
|
prc->bottom = rgn->rdh.rcBound.bottom - y;
|
||||||
prc++;
|
prc++;
|
||||||
|
|
||||||
/* right rectangle */
|
/* Right rectangle */
|
||||||
prc->left = rgn->rdh.rcBound.right - x;
|
prc->left = rgn->rdh.rcBound.right - x;
|
||||||
prc->top = rgn->rdh.rcBound.top + y;
|
prc->top = rgn->rdh.rcBound.top + y;
|
||||||
prc->right = rgn->rdh.rcBound.right;
|
prc->right = rgn->rdh.rcBound.right;
|
||||||
|
@ -1818,7 +1817,7 @@ REGION_CreateSimpleFrameRgn(
|
||||||
|
|
||||||
if (y != 0)
|
if (y != 0)
|
||||||
{
|
{
|
||||||
/* bottom rectangle */
|
/* Bottom rectangle */
|
||||||
prc->left = rgn->rdh.rcBound.left;
|
prc->left = rgn->rdh.rcBound.left;
|
||||||
prc->top = rgn->rdh.rcBound.bottom - y;
|
prc->top = rgn->rdh.rcBound.bottom - y;
|
||||||
prc->right = rgn->rdh.rcBound.right;
|
prc->right = rgn->rdh.rcBound.right;
|
||||||
|
@ -2455,7 +2454,7 @@ REGION_GetRgnBox(
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
return 0; //if invalid region return zero
|
return 0; // If invalid region return zero
|
||||||
}
|
}
|
||||||
|
|
||||||
INT APIENTRY
|
INT APIENTRY
|
||||||
|
@ -2525,13 +2524,13 @@ IntGdiPaintRgn(
|
||||||
BrushOrigin.x = pdcattr->ptlBrushOrigin.x;
|
BrushOrigin.x = pdcattr->ptlBrushOrigin.x;
|
||||||
BrushOrigin.y = pdcattr->ptlBrushOrigin.y;
|
BrushOrigin.y = pdcattr->ptlBrushOrigin.y;
|
||||||
psurf = dc->dclevel.pSurface;
|
psurf = dc->dclevel.pSurface;
|
||||||
/* FIXME - Handle psurf == NULL !!!! */
|
/* FIXME: Handle psurf == NULL !!!! */
|
||||||
|
|
||||||
bRet = IntEngPaint(&psurf->SurfObj,
|
bRet = IntEngPaint(&psurf->SurfObj,
|
||||||
ClipRegion,
|
ClipRegion,
|
||||||
&dc->eboFill.BrushObject,
|
&dc->eboFill.BrushObject,
|
||||||
&BrushOrigin,
|
&BrushOrigin,
|
||||||
0xFFFF);//FIXME:don't know what to put here
|
0xFFFF); // FIXME: Don't know what to put here
|
||||||
|
|
||||||
RGNOBJAPI_Unlock(visrgn);
|
RGNOBJAPI_Unlock(visrgn);
|
||||||
GreDeleteObject(tmpVisRgn);
|
GreDeleteObject(tmpVisRgn);
|
||||||
|
@ -2550,7 +2549,7 @@ REGION_RectInRegion(
|
||||||
PRECTL pCurRect, pRectEnd;
|
PRECTL pCurRect, pRectEnd;
|
||||||
RECT rc;
|
RECT rc;
|
||||||
|
|
||||||
/* swap the coordinates to make right >= left and bottom >= top */
|
/* Swap the coordinates to make right >= left and bottom >= top */
|
||||||
/* (region building rectangles are normalized the same way) */
|
/* (region building rectangles are normalized the same way) */
|
||||||
if( rect->top > rect->bottom) {
|
if( rect->top > rect->bottom) {
|
||||||
rc.top = rect->bottom;
|
rc.top = rect->bottom;
|
||||||
|
@ -2567,20 +2566,20 @@ REGION_RectInRegion(
|
||||||
rc.left = rect->left;
|
rc.left = rect->left;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* this is (just) a useful optimization */
|
/* This is (just) a useful optimization */
|
||||||
if ((Rgn->rdh.nCount > 0) && EXTENTCHECK(&Rgn->rdh.rcBound, &rc))
|
if ((Rgn->rdh.nCount > 0) && EXTENTCHECK(&Rgn->rdh.rcBound, &rc))
|
||||||
{
|
{
|
||||||
for (pCurRect = Rgn->Buffer, pRectEnd = pCurRect +
|
for (pCurRect = Rgn->Buffer, pRectEnd = pCurRect +
|
||||||
Rgn->rdh.nCount; pCurRect < pRectEnd; pCurRect++)
|
Rgn->rdh.nCount; pCurRect < pRectEnd; pCurRect++)
|
||||||
{
|
{
|
||||||
if (pCurRect->bottom <= rc.top)
|
if (pCurRect->bottom <= rc.top)
|
||||||
continue; /* not far enough down yet */
|
continue; /* Not far enough down yet */
|
||||||
|
|
||||||
if (pCurRect->top >= rc.bottom)
|
if (pCurRect->top >= rc.bottom)
|
||||||
break; /* too far down */
|
break; /* Too far down */
|
||||||
|
|
||||||
if (pCurRect->right <= rc.left)
|
if (pCurRect->right <= rc.left)
|
||||||
continue; /* not far enough over yet */
|
continue; /* Not far enough over yet */
|
||||||
|
|
||||||
if (pCurRect->left >= rc.right) {
|
if (pCurRect->left >= rc.right) {
|
||||||
continue;
|
continue;
|
||||||
|
@ -2691,7 +2690,7 @@ REGION_InsertEdgeInET(
|
||||||
ScanLineListBlock *tmpSLLBlock;
|
ScanLineListBlock *tmpSLLBlock;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* find the right bucket to put the edge into
|
* Find the right bucket to put the edge into
|
||||||
*/
|
*/
|
||||||
pPrevSLL = &ET->scanlines;
|
pPrevSLL = &ET->scanlines;
|
||||||
pSLL = pPrevSLL->next;
|
pSLL = pPrevSLL->next;
|
||||||
|
@ -2702,7 +2701,7 @@ REGION_InsertEdgeInET(
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* reassign pSLL (pointer to ScanLineList) if necessary
|
* Reassign pSLL (pointer to ScanLineList) if necessary
|
||||||
*/
|
*/
|
||||||
if ((!pSLL) || (pSLL->scanline > scanline))
|
if ((!pSLL) || (pSLL->scanline > scanline))
|
||||||
{
|
{
|
||||||
|
@ -2712,7 +2711,7 @@ REGION_InsertEdgeInET(
|
||||||
if (!tmpSLLBlock)
|
if (!tmpSLLBlock)
|
||||||
{
|
{
|
||||||
DPRINT1("REGION_InsertEdgeInETL(): Can't alloc SLLB\n");
|
DPRINT1("REGION_InsertEdgeInETL(): Can't alloc SLLB\n");
|
||||||
/* FIXME - free resources? */
|
/* FIXME: Free resources? */
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
(*SLLBlock)->next = tmpSLLBlock;
|
(*SLLBlock)->next = tmpSLLBlock;
|
||||||
|
@ -2729,7 +2728,7 @@ REGION_InsertEdgeInET(
|
||||||
pSLL->scanline = scanline;
|
pSLL->scanline = scanline;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* now insert the edge in the right bucket
|
* Now insert the edge in the right bucket
|
||||||
*/
|
*/
|
||||||
prev = (EdgeTableEntry *)NULL;
|
prev = (EdgeTableEntry *)NULL;
|
||||||
start = pSLL->edgelist;
|
start = pSLL->edgelist;
|
||||||
|
@ -2936,7 +2935,7 @@ REGION_PtsToRegion(
|
||||||
|
|
||||||
for ( ; numFullPtBlocks >= 0; numFullPtBlocks--)
|
for ( ; numFullPtBlocks >= 0; numFullPtBlocks--)
|
||||||
{
|
{
|
||||||
/* the loop uses 2 points per iteration */
|
/* The loop uses 2 points per iteration */
|
||||||
i = NUMPTSTOBUFFER >> 1;
|
i = NUMPTSTOBUFFER >> 1;
|
||||||
if (!numFullPtBlocks)
|
if (!numFullPtBlocks)
|
||||||
i = iCurPtBlock >> 1;
|
i = iCurPtBlock >> 1;
|
||||||
|
@ -3026,7 +3025,7 @@ REGION_CreateETandAET(
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* initialize the Active Edge Table
|
* Initialize the Active Edge Table
|
||||||
*/
|
*/
|
||||||
AET->next = (EdgeTableEntry *)NULL;
|
AET->next = (EdgeTableEntry *)NULL;
|
||||||
AET->back = (EdgeTableEntry *)NULL;
|
AET->back = (EdgeTableEntry *)NULL;
|
||||||
|
@ -3034,7 +3033,7 @@ REGION_CreateETandAET(
|
||||||
AET->bres.minor_axis = SMALL_COORDINATE;
|
AET->bres.minor_axis = SMALL_COORDINATE;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* initialize the Edge Table.
|
* Initialize the Edge Table.
|
||||||
*/
|
*/
|
||||||
ET->scanlines.next = (ScanLineList *)NULL;
|
ET->scanlines.next = (ScanLineList *)NULL;
|
||||||
ET->ymax = SMALL_COORDINATE;
|
ET->ymax = SMALL_COORDINATE;
|
||||||
|
@ -3052,7 +3051,7 @@ REGION_CreateETandAET(
|
||||||
PrevPt = EndPt;
|
PrevPt = EndPt;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* for each vertex in the array of points.
|
* For each vertex in the array of points.
|
||||||
* In this loop we are dealing with two vertices at
|
* In this loop we are dealing with two vertices at
|
||||||
* a time -- these make up one edge of the polygon.
|
* a time -- these make up one edge of the polygon.
|
||||||
*/
|
*/
|
||||||
|
@ -3061,7 +3060,7 @@ REGION_CreateETandAET(
|
||||||
CurrPt = pts++;
|
CurrPt = pts++;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* find out which point is above and which is below.
|
* Find out which point is above and which is below.
|
||||||
*/
|
*/
|
||||||
if (PrevPt->y > CurrPt->y)
|
if (PrevPt->y > CurrPt->y)
|
||||||
{
|
{
|
||||||
|
@ -3075,7 +3074,7 @@ REGION_CreateETandAET(
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* don't add horizontal edges to the Edge table.
|
* Don't add horizontal edges to the Edge table.
|
||||||
*/
|
*/
|
||||||
if (bottom->y != top->y)
|
if (bottom->y != top->y)
|
||||||
{
|
{
|
||||||
|
@ -3083,7 +3082,7 @@ REGION_CreateETandAET(
|
||||||
/* -1 so we don't get last scanline */
|
/* -1 so we don't get last scanline */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* initialize integer edge algorithm
|
* Initialize integer edge algorithm
|
||||||
*/
|
*/
|
||||||
dy = bottom->y - top->y;
|
dy = bottom->y - top->y;
|
||||||
BRESINITPGONSTRUCT(dy, top->x, bottom->x, pETEs->bres);
|
BRESINITPGONSTRUCT(dy, top->x, bottom->x, pETEs->bres);
|
||||||
|
@ -3114,16 +3113,16 @@ IntCreatePolyPolygonRgn(
|
||||||
HRGN hrgn;
|
HRGN hrgn;
|
||||||
ROSRGNDATA *region;
|
ROSRGNDATA *region;
|
||||||
EdgeTableEntry *pAET; /* Active Edge Table */
|
EdgeTableEntry *pAET; /* Active Edge Table */
|
||||||
INT y; /* current scanline */
|
INT y; /* Current scanline */
|
||||||
int iPts = 0; /* number of pts in buffer */
|
int iPts = 0; /* Number of pts in buffer */
|
||||||
EdgeTableEntry *pWETE; /* Winding Edge Table Entry */
|
EdgeTableEntry *pWETE; /* Winding Edge Table Entry */
|
||||||
ScanLineList *pSLL; /* current scanLineList */
|
ScanLineList *pSLL; /* Current scanLineList */
|
||||||
POINT *pts; /* output buffer */
|
POINT *pts; /* Output buffer */
|
||||||
EdgeTableEntry *pPrevAET; /* ptr to previous AET */
|
EdgeTableEntry *pPrevAET; /* Pointer to previous AET */
|
||||||
EdgeTable ET; /* header node for ET */
|
EdgeTable ET; /* Header node for ET */
|
||||||
EdgeTableEntry AET; /* header node for AET */
|
EdgeTableEntry AET; /* Header node for AET */
|
||||||
EdgeTableEntry *pETEs; /* EdgeTableEntries pool */
|
EdgeTableEntry *pETEs; /* EdgeTableEntries pool */
|
||||||
ScanLineListBlock SLLBlock; /* header for scanlinelist */
|
ScanLineListBlock SLLBlock; /* Header for scanlinelist */
|
||||||
int fixWAET = FALSE;
|
int fixWAET = FALSE;
|
||||||
POINTBLOCK FirstPtBlock, *curPtBlock; /* PtBlock buffers */
|
POINTBLOCK FirstPtBlock, *curPtBlock; /* PtBlock buffers */
|
||||||
POINTBLOCK *tmpPtBlock;
|
POINTBLOCK *tmpPtBlock;
|
||||||
|
@ -3136,7 +3135,7 @@ IntCreatePolyPolygonRgn(
|
||||||
return 0;
|
return 0;
|
||||||
hrgn = region->BaseObject.hHmgr;
|
hrgn = region->BaseObject.hHmgr;
|
||||||
|
|
||||||
/* special case a rectangle */
|
/* Special case a rectangle */
|
||||||
|
|
||||||
if (((nbpolygons == 1) && ((*Count == 4) ||
|
if (((nbpolygons == 1) && ((*Count == 4) ||
|
||||||
((*Count == 5) && (Pts[4].x == Pts[0].x) && (Pts[4].y == Pts[0].y)))) &&
|
((*Count == 5) && (Pts[4].x == Pts[0].x) && (Pts[4].y == Pts[0].y)))) &&
|
||||||
|
@ -3170,7 +3169,7 @@ IntCreatePolyPolygonRgn(
|
||||||
if (mode != WINDING)
|
if (mode != WINDING)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* for each scanline
|
* For each scanline
|
||||||
*/
|
*/
|
||||||
for (y = ET.ymin; y < ET.ymax; y++)
|
for (y = ET.ymin; y < ET.ymax; y++)
|
||||||
{
|
{
|
||||||
|
@ -3187,7 +3186,7 @@ IntCreatePolyPolygonRgn(
|
||||||
pAET = AET.next;
|
pAET = AET.next;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* for each active edge
|
* For each active edge
|
||||||
*/
|
*/
|
||||||
while (pAET)
|
while (pAET)
|
||||||
{
|
{
|
||||||
|
@ -3195,7 +3194,7 @@ IntCreatePolyPolygonRgn(
|
||||||
pts++, iPts++;
|
pts++, iPts++;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* send out the buffer
|
* Send out the buffer
|
||||||
*/
|
*/
|
||||||
if (iPts == NUMPTSTOBUFFER)
|
if (iPts == NUMPTSTOBUFFER)
|
||||||
{
|
{
|
||||||
|
@ -3220,7 +3219,7 @@ IntCreatePolyPolygonRgn(
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* for each scanline
|
* For each scanline
|
||||||
*/
|
*/
|
||||||
for (y = ET.ymin; y < ET.ymax; y++)
|
for (y = ET.ymin; y < ET.ymax; y++)
|
||||||
{
|
{
|
||||||
|
@ -3239,12 +3238,12 @@ IntCreatePolyPolygonRgn(
|
||||||
pWETE = pAET;
|
pWETE = pAET;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* for each active edge
|
* For each active edge
|
||||||
*/
|
*/
|
||||||
while (pAET)
|
while (pAET)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* add to the buffer only those edges that
|
* Add to the buffer only those edges that
|
||||||
* are in the Winding active edge table.
|
* are in the Winding active edge table.
|
||||||
*/
|
*/
|
||||||
if (pWETE == pAET)
|
if (pWETE == pAET)
|
||||||
|
@ -3253,7 +3252,7 @@ IntCreatePolyPolygonRgn(
|
||||||
pts++, iPts++;
|
pts++, iPts++;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* send out the buffer
|
* Send out the buffer
|
||||||
*/
|
*/
|
||||||
if (iPts == NUMPTSTOBUFFER)
|
if (iPts == NUMPTSTOBUFFER)
|
||||||
{
|
{
|
||||||
|
@ -3278,7 +3277,7 @@ IntCreatePolyPolygonRgn(
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* recompute the winding active edge table if
|
* Recompute the winding active edge table if
|
||||||
* we just resorted or have exited an edge.
|
* we just resorted or have exited an edge.
|
||||||
*/
|
*/
|
||||||
if (REGION_InsertionSort(&AET) || fixWAET)
|
if (REGION_InsertionSort(&AET) || fixWAET)
|
||||||
|
@ -3478,9 +3477,9 @@ NtGdiCreateRoundRectRgn(
|
||||||
|
|
||||||
while (xd < yd)
|
while (xd < yd)
|
||||||
{
|
{
|
||||||
if (d > 0) /* if nearest pixel is toward the center */
|
if (d > 0) /* If nearest pixel is toward the center */
|
||||||
{
|
{
|
||||||
/* move toward center */
|
/* Move toward center */
|
||||||
rect.top = top++;
|
rect.top = top++;
|
||||||
rect.bottom = rect.top + 1;
|
rect.bottom = rect.top + 1;
|
||||||
REGION_UnionRectWithRgn(obj, &rect);
|
REGION_UnionRectWithRgn(obj, &rect);
|
||||||
|
@ -3490,7 +3489,7 @@ NtGdiCreateRoundRectRgn(
|
||||||
yd -= 2*asq;
|
yd -= 2*asq;
|
||||||
d -= yd;
|
d -= yd;
|
||||||
}
|
}
|
||||||
rect.left--; /* next horiz point */
|
rect.left--; /* Next horiz point */
|
||||||
rect.right++;
|
rect.right++;
|
||||||
xd += 2*bsq;
|
xd += 2*bsq;
|
||||||
d += bsq + xd;
|
d += bsq + xd;
|
||||||
|
@ -3507,9 +3506,9 @@ NtGdiCreateRoundRectRgn(
|
||||||
rect.top = --bottom;
|
rect.top = --bottom;
|
||||||
rect.bottom = rect.top + 1;
|
rect.bottom = rect.top + 1;
|
||||||
REGION_UnionRectWithRgn(obj, &rect);
|
REGION_UnionRectWithRgn(obj, &rect);
|
||||||
if (d < 0) /* if nearest pixel is outside ellipse */
|
if (d < 0) /* If nearest pixel is outside ellipse */
|
||||||
{
|
{
|
||||||
rect.left--; /* move away from center */
|
rect.left--; /* Move away from center */
|
||||||
rect.right++;
|
rect.right++;
|
||||||
xd += 2*bsq;
|
xd += 2*bsq;
|
||||||
d += xd;
|
d += xd;
|
||||||
|
@ -3910,7 +3909,7 @@ NtGdiRectInRegion(
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
SetLastNtError(Status);
|
SetLastNtError(Status);
|
||||||
DPRINT1("NtGdiRectInRegion: bogus rc\n");
|
DPRINT1("NtGdiRectInRegion: Bogus rc\n");
|
||||||
return ERROR;
|
return ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3931,7 +3930,7 @@ NtGdiSetRectRgn(
|
||||||
|
|
||||||
if ( !(rgn = RGNOBJAPI_Lock(hRgn, NULL)) )
|
if ( !(rgn = RGNOBJAPI_Lock(hRgn, NULL)) )
|
||||||
{
|
{
|
||||||
return 0; //per documentation
|
return 0; // Per documentation
|
||||||
}
|
}
|
||||||
|
|
||||||
REGION_SetRectRgn(rgn, LeftRect, TopRect, RightRect, BottomRect);
|
REGION_SetRectRgn(rgn, LeftRect, TopRect, RightRect, BottomRect);
|
||||||
|
@ -4007,9 +4006,9 @@ NtGdiGetRegionData(
|
||||||
if (count < (size + sizeof(RGNDATAHEADER)) || rgndata == NULL)
|
if (count < (size + sizeof(RGNDATAHEADER)) || rgndata == NULL)
|
||||||
{
|
{
|
||||||
RGNOBJAPI_Unlock(obj);
|
RGNOBJAPI_Unlock(obj);
|
||||||
if (rgndata) /* buffer is too small, signal it by return 0 */
|
if (rgndata) /* Buffer is too small, signal it by return 0 */
|
||||||
return 0;
|
return 0;
|
||||||
else /* user requested buffer size with rgndata NULL */
|
else /* User requested buffer size with rgndata NULL */
|
||||||
return size + sizeof(RGNDATAHEADER);
|
return size + sizeof(RGNDATAHEADER);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
* PROJECT: ReactOS win32 kernel mode subsystem
|
* PROJECT: ReactOS win32 kernel mode subsystem
|
||||||
* LICENSE: GPL - See COPYING in the top level directory
|
* LICENSE: GPL - See COPYING in the top level directory
|
||||||
* FILE: subsystems/win32/win32k/objects/wingl.c
|
* FILE: subsystems/win32/win32k/objects/wingl.c
|
||||||
* PURPOSE: wingl api
|
* PURPOSE: WinGL API
|
||||||
* PROGRAMMER:
|
* PROGRAMMER:
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
* PROJECT: ReactOS win32 kernel mode subsystem
|
* PROJECT: ReactOS win32 kernel mode subsystem
|
||||||
* LICENSE: GPL - See COPYING in the top level directory
|
* LICENSE: GPL - See COPYING in the top level directory
|
||||||
* FILE: subsystems/win32/win32k/objects/xformobj.c
|
* FILE: subsystems/win32/win32k/objects/xformobj.c
|
||||||
* PURPOSE: XFORMOBJ api
|
* PURPOSE: XFORMOBJ API
|
||||||
* PROGRAMMER: Timo Kreuzer
|
* PROGRAMMER: Timo Kreuzer
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
@ -2,8 +2,8 @@
|
||||||
#define __W32K_H
|
#define __W32K_H
|
||||||
/*
|
/*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS Graphics Subsystem
|
* PROJECT: ReactOS Win32k subsystem
|
||||||
* FILE: subsys/win32k/pch.h
|
* FILE: subsystems/win32/win32k/pch.h
|
||||||
* PURPOSE: Main Win32K Header
|
* PURPOSE: Main Win32K Header
|
||||||
* PROGRAMMER: Alex Ionescu (alex@relsoft.net)
|
* PROGRAMMER: Alex Ionescu (alex@relsoft.net)
|
||||||
*/
|
*/
|
||||||
|
@ -12,7 +12,7 @@
|
||||||
|
|
||||||
#define _NO_COM
|
#define _NO_COM
|
||||||
|
|
||||||
/* DDK/NDK/SDK Headers */
|
/* DDK/NDK/SDK headers */
|
||||||
#undef NTDDI_VERSION
|
#undef NTDDI_VERSION
|
||||||
#define NTDDI_VERSION NTDDI_WS03SP1
|
#define NTDDI_VERSION NTDDI_WS03SP1
|
||||||
#include <ntddk.h>
|
#include <ntddk.h>
|
||||||
|
@ -32,7 +32,7 @@
|
||||||
#include <ntddkbd.h>
|
#include <ntddkbd.h>
|
||||||
#include <bugcodes.h>
|
#include <bugcodes.h>
|
||||||
|
|
||||||
/* Win32 Headers */
|
/* Win32 headers */
|
||||||
/* FIXME: Defines in winbase.h that we need... */
|
/* FIXME: Defines in winbase.h that we need... */
|
||||||
typedef struct _SECURITY_ATTRIBUTES SECURITY_ATTRIBUTES, *LPSECURITY_ATTRIBUTES;
|
typedef struct _SECURITY_ATTRIBUTES SECURITY_ATTRIBUTES, *LPSECURITY_ATTRIBUTES;
|
||||||
#define WINBASEAPI
|
#define WINBASEAPI
|
||||||
|
@ -65,13 +65,13 @@ typedef struct _SECURITY_ATTRIBUTES SECURITY_ATTRIBUTES, *LPSECURITY_ATTRIBUTES;
|
||||||
#define _NOCSECT_TYPE
|
#define _NOCSECT_TYPE
|
||||||
#include <ddrawi.h>
|
#include <ddrawi.h>
|
||||||
|
|
||||||
/* SEH Support with PSEH */
|
/* SEH support with PSEH */
|
||||||
#include <pseh/pseh2.h>
|
#include <pseh/pseh2.h>
|
||||||
|
|
||||||
/* CSRSS Header */
|
/* CSRSS header */
|
||||||
#include <csrss/csrss.h>
|
#include <csrss/csrss.h>
|
||||||
|
|
||||||
/* Public Win32K Headers */
|
/* Public Win32K headers */
|
||||||
#include <win32k/callback.h>
|
#include <win32k/callback.h>
|
||||||
#include <win32k/ntusrtyp.h>
|
#include <win32k/ntusrtyp.h>
|
||||||
#include <win32k/ntuser.h>
|
#include <win32k/ntuser.h>
|
||||||
|
@ -96,7 +96,7 @@ typedef struct _SECURITY_ATTRIBUTES SECURITY_ATTRIBUTES, *LPSECURITY_ATTRIBUTES;
|
||||||
#include <freetype/ftwinfnt.h>
|
#include <freetype/ftwinfnt.h>
|
||||||
#include <freetype/freetype.h>
|
#include <freetype/freetype.h>
|
||||||
|
|
||||||
/* Internal Win32K Header */
|
/* Internal Win32K header */
|
||||||
#include "include/win32kp.h"
|
#include "include/win32kp.h"
|
||||||
|
|
||||||
#endif /* __W32K_H */
|
#endif /* __W32K_H */
|
||||||
|
|
|
@ -1236,7 +1236,7 @@ NtGdiGetSpoolMessage( DWORD u1,
|
||||||
DWORD u3,
|
DWORD u3,
|
||||||
DWORD u4)
|
DWORD u4)
|
||||||
{
|
{
|
||||||
/* FIXME the prototypes */
|
/* FIXME: The prototypes */
|
||||||
UNIMPLEMENTED;
|
UNIMPLEMENTED;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -1363,6 +1363,7 @@ NtGdiRemoveFontMemResourceEx(
|
||||||
UNIMPLEMENTED;
|
UNIMPLEMENTED;
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* @unimplemented
|
* @unimplemented
|
||||||
*/
|
*/
|
||||||
|
@ -1732,3 +1733,5 @@ EngNineGrid(IN SURFOBJ* pDestSurfaceObj,
|
||||||
UNIMPLEMENTED;
|
UNIMPLEMENTED;
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* EOF */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue