Fix indentation, comments, debug messages. Lioncash (mathew1800\AT/gmail\DOT/com), bug #6762.
svn path=/trunk/; revision=54647
PRECTL DestRect,
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.
- // dwx is current x-window, dwx2 is the 'last' window we need to process
- int dwx, dwx2; // destination window x-position
- int swx; // source window y-position
+ // dwx is current x-window, dwx2 is the 'last' window we need to process.
+ int dwx, dwx2; // Destination window x-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 dr = DestRect->right-1; // dest right (inclusive)
int sl = SourcePoint->x; // source left
int sr = sl + dr - dl; // source right (inclusive)
- // which direction are we going?
+ // Which direction are we going?
int xinc;
int yinc;
int ySrcDelta, yDstDelta;
- // following 4 variables are used for the y-sweep
- int dy; // dest y
+ // The following 4 variables are used for the y-sweep
+ int dy; // dest y
int dy1; // dest y start
int dy2; // dest y end
- int sy1; // src y start
+ int sy1; // src y start
int shift;
BYTE srcmask, dstmask, xormask;
if ( DestRect->top <= SourcePoint->y )
{
- // moving up ( scan top -> bottom )
+ // Moving up (scan top -> bottom)
dy1 = DestRect->top;
dy2 = DestRect->bottom - 1;
sy1 = SourcePoint->y;
}
else
{
- // moving down ( scan bottom -> top )
+ // Moving down (scan bottom -> top)
dy1 = DestRect->bottom - 1;
dy2 = DestRect->top;
sy1 = SourcePoint->y + dy1 - dy2;
}
if ( DestRect->left <= SourcePoint->x )
{
- // moving left ( scan left->right )
+ // Moving left (scan left->right)
dwx = dl&~7;
swx = (sl-(dl&7))&~7;
dwx2 = dr&~7;
}
else
{
- // moving right ( scan right->left )
- dwx = dr&~7;
- swx = (sr-(dr&7))&~7; //(sr-7)&~7; // we need the left edge of this block... thus the -7
- dwx2 = dl&~7;
+ // Moving right (scan right->left)
+ dwx = dr & ~7;
+ swx = (sr - (dr & 7)) & ~7; // (sr - 7) & ~7; // We need the left edge of this block. Thus the -7
+ dwx2 = dl & ~7;
xinc = -1;
}
d = &(((PBYTE)DestSurf->pvScan0)[dy1*DestSurf->lDelta + (dwx>>3)]);
}
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
- // needed and may in fact be invalid
+ // needed and may in fact be invalid.
if ( !shift )
{
for ( ;; )
{
*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 )
break;
dy += yinc;
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 ( ;; )
{
*pd = (BYTE)((*pd & dstmask)
| ( ( (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 )
break;
dy += yinc;
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 ( ;; )
{
*pd = (*pd & dstmask)
| ( ( (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 )
break;
dy += yinc;
ps += ySrcDelta;
}
}
- else // both ps[0] and ps[1] are needed
+ else // Both ps[0] and ps[1] are needed
{
for ( ;; )
{
*pd = (*pd & dstmask)
| ( ( ( ((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 )
break;
dy += yinc;
}
}
- // 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 )
break;
d += xinc;
/*
- * PROJECT: Win32 subsystem
+ * PROJECT: ReactOS Win32k subsystem
* LICENSE: See COPYING in the top level directory
* FILE: subsystems/win32/win32k/dib/stretchblt.c
* PURPOSE: StretchBlt implementation suitable for all bit depths
SrcHeight = SourceRect->bottom - SourceRect->top;
SrcWidth = SourceRect->right - SourceRect->left;
- /* FIXME : MaskOrigin? */
+ /* FIXME: MaskOrigin? */
switch(DestSurf->iBitmapFormat)
{
/*
* COPYRIGHT: See COPYING in the top level directory
- * PROJECT: ReactOS kernel
+ * PROJECT: ReactOS Win32k subsystem
* PURPOSE: GDI BitBlt Functions
- * FILE: subsys/win32k/eng/bitblt.c
+ * FILE: subsystems/win32/win32k/eng/bitblt.c
* PROGRAMER: Jason Filby
* Timo Kreuzer
*/
}
else
{
- /* FIXME - What to do here? */
+ /* FIXME: What to do here? */
}
}
else
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
* PURPOSE: GDI Clipping Functions
- * FILE: subsys/win32k/eng/clip.c
+ * FILE: subsystems/win32/win32k/eng/clip.c
* PROGRAMER: Jason Filby
*/
ULONG nCopy, i;
ENUMRECTS* pERects = (ENUMRECTS*)EnumRects;
- //calculate how many rectangles we should copy
+ // Calculate how many rectangles we should copy
nCopy = min( ClipGDI->EnumMax - ClipGDI->EnumPos,
min( ClipGDI->EnumRects.c - ClipGDI->EnumPos,
(ObjSize - sizeof(ULONG)) / sizeof(RECTL)));
return FALSE;
}
- /* copy rectangles */
+ /* Copy rectangles */
src = ClipGDI->EnumRects.arcl + ClipGDI->EnumPos;
for(i = 0, dest = pERects->arcl; i < nCopy; i++, dest++, src++)
{
/*
* COPYRIGHT: See COPYING in the top level directory
- * PROJECT: ReactOS kernel
+ * PROJECT: ReactOS Win32k subsystem
* PURPOSE: ENG misc Functions
* FILE: subsystems/win32/win32k/eng/engmisc.c
* PROGRAMER: ReactOS Team
{
/* http://www.osr.com/ddk/graphics/gdifncs_3tif.htm
In Windows 2000 and later, the EngGetProcessHandle function always returns NULL.
- FIXME - what does NT4 return? */
+ FIXME: What does NT4 return? */
return NULL;
}
(Multiplier * (TickCount.HighPart << 8)));
}
-
-
-
/* EOF */
/*
* COPYRIGHT: See COPYING in the top level directory
- * PROJECT: ReactOS kernel
+ * PROJECT: ReactOS Win32k subsystem
* PURPOSE: Support for logical devices
* FILE: subsystems/win32/win32k/eng/ldevobj.c
* PROGRAMER: Timo Kreuzer (timo.kreuzer@reactos.org)
TRUE,
IMAGE_DIRECTORY_ENTRY_EXPORT,
&cbSize);
- gpldevWin32k->pGdiDriverInfo->ImageLength = 0; // FIXME;
+ gpldevWin32k->pGdiDriverInfo->ImageLength = 0; // FIXME
return STATUS_SUCCESS;
}
return LDEVOBJ_pvFindImageProcAddress(pldev, lpProcName);
}
+/* EOF */
RECTL rect;
BOOL ret = FALSE;
- //Draw the Polyline with a call to IntEngLineTo for each segment.
+ // Draw the Polyline with a call to IntEngLineTo for each segment.
for (i = 1; i < dCount; i++)
{
rect.left = min(pt[i-1].x, pt[i].x);
InterlockedDecrement(&Semaphore->lCount);
return FALSE;
}
- /* FIXME - not thread-safe! Check result of InterlockedCompareExchangePointer
- and delete semaphore if already initialized! */
+ /* FIXME: Not thread-safe! Check result of InterlockedCompareExchangePointer
+ and delete semaphore if already initialized! */
(void)InterlockedExchangePointer((volatile PVOID *)&Semaphore->hsem, hSem);
}
else
{
if (InterlockedDecrement(&Semaphore->lCount) == 0)
{
- /* FIXME - not thread-safe! Use result of InterlockedCompareExchangePointer! */
+ /* FIXME: Not thread-safe! Use result of InterlockedCompareExchangePointer! */
EngDeleteSemaphore(Semaphore->hsem);
(void)InterlockedExchangePointer((volatile PVOID *)&Semaphore->hsem, NULL);
}
}
-
+/* EOF */
/*
* COPYRIGHT: See COPYING in the top level directory
- * PROJECT: ReactOS Win32 kernelmode subsystem
+ * PROJECT: ReactOS Win32k subsystem
* PURPOSE: GDI stretch blt functions
* FILE: subsystems/win32/win32k/eng/stretchblt.c
* PROGRAMER: Jason Filby
}
else
{
- /* FIXME - What to do here? */
+ /* FIXME: What to do here? */
}
}
else
return EngStretchBlt(psoDest, psoSource, Mask, ClipRegion, ColorTranslation, &ca, &lBrushOrigin, &rclDest, &rclSrc, &lMaskOrigin, Mode);
}
+/* EOF */
/*
* COPYRIGHT: See COPYING in the top level directory
- * PROJECT: ReactOS kernel
+ * PROJECT: ReactOS Win32k subsystem
* PURPOSE: GDI Color Translation Functions
* FILE: subsystems/win32/win32k/eng/xlate.c
* PROGRAMER: Timo Kreuzer (timo.kreuzer@reactos.org)
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))
{
/* At least one palette is not indexed, calculate shifts/masks */
static __inline BOOL
IsCallProcHandle(IN WNDPROC lpWndProc)
{
- /* FIXME - check for 64 bit architectures... */
+ /* FIXME: Check for 64-bit architectures... */
return ((ULONG_PTR)lpWndProc & 0xFFFF0000) == 0xFFFF0000;
}
#ifndef CLR_INVALID
#define CLR_INVALID 0xffffffff
#endif
-#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_MAPPED 0x10 /* logical palentry is a direct alias for system palentry */
+#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_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
{
PWIN32HEAP pheapDesktop;
ULONG_PTR ulHeapSize;
LIST_ENTRY PtiList;
- /* use for tracking mouse moves. */
+ /* Use for tracking mouse moves. */
PWND spwndTrack;
DWORD htEx;
RECT rcMouseHover;
/* XFORMOBJ has no public members */
} 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 */
#define ObjToGDI(ClipObj, Type) (Type##GDI *)(ClipObj)
#define GDIToObj(ClipGDI, Type) (Type##OBJ *)(ClipGDI)
#define HOOKID_TO_FLAG(HookId) (1 << ((HookId) + 1))
#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
injecting user api hook module to all processes.
It is used internally in win32k */
/* Scan Codes */
#define SC_KEY_UP 0x8000
/* lParam bits */
-#define LP_DO_NOT_CARE_BIT (1<<25) // for GetKeyNameText
+#define LP_DO_NOT_CARE_BIT (1<<25) // For GetKeyNameText
/* General */
INIT_FUNCTION NTSTATUS NTAPI InitInputImpl(VOID);
#ifdef __GNUC__
-/* Hack, for bug in ld. Will be removed soon. */
+/* HACK, for bug in ld. Will be removed soon. */
#define __ImageBase _image_base__
#endif
extern IMAGE_DOS_HEADER __ImageBase;
#pragma once
-/* monitor object */
+/* Monitor object */
typedef struct _MONITOR
{
HEAD head;
{
DWORD IsVisible: 1;
DWORD IsPalette: 1;
- DWORD IsPrimary: 1; /* wether this is the primary monitor */
+ DWORD IsPrimary: 1; /* Whether this is the primary monitor */
};
};
RECT rcMonitor;
HDEV hDev;
// ReactOS specific fields:
- UNICODE_STRING DeviceName; /* name of the monitor */
- PDEVOBJ *GdiDevice; /* pointer to the GDI device to
+ UNICODE_STRING DeviceName; /* Name of the monitor */
+ PDEVOBJ *GdiDevice; /* Pointer to the GDI device to
which this monitor is attached */
} MONITOR, *PMONITOR;
/* Message Queue Flags */
DWORD QF_flags;
- /* queue state tracking */
+ /* Queue state tracking */
// Send list QS_SENDMESSAGE
// Post list QS_POSTMESSAGE|QS_HOTKEY|QS_PAINT|QS_TIMER|QS_KEY
// 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.
DWORD nCntsQBits[QSIDCOUNTS]; // QS_KEY QS_MOUSEMOVE QS_MOUSEBUTTON QS_POSTMESSAGE QS_SENDMESSAGE QS_HOTKEY
- /* extra message information */
+ /* Extra message information */
LPARAM ExtraInfo;
- /* state of each key */
+ /* State of each key */
BYTE afKeyRecentDown[256 / 8]; // 1 bit 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;
- /* cursor object */
+ /* Cursor object */
PCURICON_OBJECT CursorObject;
- /* messages that are currently dispatched by other threads */
+ /* Messages that are currently dispatched by other threads */
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;
/* Desktop that the message queue is attached to */
#define QF_CAPTURELOCKED 0x00100000
#define QF_ACTIVEWNDTRACKING 0x00200000
-/* internal messages codes */
+/* Internal messages codes */
enum internal_event_message
{
WM_ASYNC_SHOWWINDOW = 0x80000000,
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;
SIZEL Size;
POINTL HotSpot;
SURFACE *psurfMask;
SURFACE *psurfSave;
- /* public pointer information */
- RECTL Exclude; /* required publicly for SPS_ACCEPT_EXCLUDE */
+ /* Public pointer information */
+ RECTL Exclude; /* Required publicly for SPS_ACCEPT_EXCLUDE */
} GDIPOINTER, *PGDIPOINTER;
typedef struct _DEVMODEINFO
#pragma once
-// create one struct
-// make usable for different users (multiple structs!)
+// Create one struct
+// Make usable for different users (multiple structs!)
#define SPI_TABLE1_MIN 1
#define SPI_TABLE1_MAX 119
#pragma once
-#define TAG_STRING ' RTS' /* string */
-#define TAG_HOOK 'ohsU' /* hook */
-#define TAG_MENUITEM 'emsU' /* menu item */
-#define TAG_MSG 'GSEM' /* message */
-#define TAG_USRMSG 'GSMU' /* user message */
-#define TAG_SBARINFO 'NIBS' /* scrollbar info */
-#define TAG_TIMERBMP 'BMIT' /* timers bitmap */
-#define TAG_WINSTA 'ATSW' /* window station */
-#define TAG_FONT 'ETNF' /* font entry */
-#define TAG_BEZIER 'RZEB' /* bezier */
-#define TAG_SHAPE 'phSG' /* shape */
-#define TAG_COLORMAP 'MLOC' /* color map */
-#define TAG_GDIHNDTBLE 'bthG' /* gdi handle table */
-#define TAG_DIB ' BID' /* dib */
+#define TAG_STRING ' RTS' /* String */
+#define TAG_HOOK 'ohsU' /* Hook */
+#define TAG_MENUITEM 'emsU' /* Menu item */
+#define TAG_MSG 'GSEM' /* Message */
+#define TAG_USRMSG 'GSMU' /* User message */
+#define TAG_SBARINFO 'NIBS' /* Scrollbar info */
+#define TAG_TIMERBMP 'BMIT' /* Timers bitmap */
+#define TAG_WINSTA 'ATSW' /* Window station */
+#define TAG_FONT 'ETNF' /* Font entry */
+#define TAG_BEZIER 'RZEB' /* Bezier */
+#define TAG_SHAPE 'phSG' /* Shape */
+#define TAG_COLORMAP 'MLOC' /* Color map */
+#define TAG_GDIHNDTBLE 'bthG' /* GDI handle table */
+#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_REGION GDITAG_HMGR_LOOKASIDE_RGN_TYPE
#define TAG_SURFACE GDITAG_HMGR_LOOKASIDE_SURF_TYPE
#define TAG_PALETTE GDITAG_HMGR_LOOKASIDE_PAL_TYPE
#define TAG_ICMLCS '90hG'
#define TAG_LFONT GDITAG_HMGR_LOOKASIDE_LFONT_TYPE
-#define TAG_RFONT ';0gG' /* correct? */
+#define TAG_RFONT ';0gG' /* Correct? */
#define TAG_PFE '<0hG'
-#define TAG_PFT '=0hG' /* correct? */
-#define TAG_ICMCXF '>0hG' /* correct? */
-#define TAG_SPRITE '?0hG' /* correct? */
+#define TAG_PFT '=0hG' /* Correct? */
+#define TAG_ICMCXF '>0hG' /* Correct? */
+#define TAG_SPRITE '?0hG' /* Correct? */
#define TAG_BRUSH GDITAG_HMGR_LOOKASIDE_BRUSH_TYPE
-#define TAG_UMPD 'A0hG' /* correct? */
-#define TAG_SPACE 'c0hG' /* correct? */
-#define TAG_META 'E0hG' /* correct? */
-#define TAG_EFSTATE 'F0hG' /* correct? */
-#define TAG_BMFD 'G0hG' /* correct? */
-#define TAG_VTFD 'H0hG' /* correct? */
-#define TAG_TTFD 'I0hG' /* correct? */
-#define TAG_RC 'J0hG' /* correct? */
-#define TAG_TEMP 'K0hG' /* correct? */
-#define TAG_DRVOBJ 'L0hG' /* correct? */
-#define TAG_DCIOBJ 'M0hG' /* correct? */
-#define TAG_SPOOL 'N0hG' /* correct? */
+#define TAG_UMPD 'A0hG' /* Correct? */
+#define TAG_SPACE 'c0hG' /* Correct? */
+#define TAG_META 'E0hG' /* Correct? */
+#define TAG_EFSTATE 'F0hG' /* Correct? */
+#define TAG_BMFD 'G0hG' /* Correct? */
+#define TAG_VTFD 'H0hG' /* Correct? */
+#define TAG_TTFD 'I0hG' /* Correct? */
+#define TAG_RC 'J0hG' /* Correct? */
+#define TAG_TEMP 'K0hG' /* Correct? */
+#define TAG_DRVOBJ 'L0hG' /* Correct? */
+#define TAG_DCIOBJ 'M0hG' /* Correct? */
+#define TAG_SPOOL 'N0hG' /* Correct? */
/* Dx internal tags rember I do not known if it right namees */
#define TAG_DXPVMLIST 'LPXD' /* pmvlist for the driver */
typedef struct _WIN32HEAP WIN32HEAP, *PWIN32HEAP;
#include <pshpack1.h>
-// FIXME! Move to ntuser.h
+// FIXME: Move to ntuser.h
typedef struct _TL
{
struct _TL* next;
ULONG Id;
} DBG_CHANNEL;
- /* note: the following values don't need to be sorted */
+ /* Note: The following values don't need to be sorted */
enum _DEBUGCHANNELS
{
DbgChEngBlt,
#define DBG_ENABLE_EVENT_LOGGING 0
#define DBG_ENABLE_SERVICE_HOOKS 0
-/* misc headers */
+/* Misc headers */
#include <include/win32kdebug.h>
#include <include/mmcopy.h>
#include <include/tags.h>
typedef struct _WINSTATION_OBJECT
{
- PVOID SharedHeap; /* points to kmode memory! */
+ PVOID SharedHeap; /* Points to kmode memory! */
CSHORT Type;
CSHORT Size;
HANDLE ShellListView;
/* Effects */
- BOOL FontSmoothing; /* enable */
+ BOOL FontSmoothing; /* Enable */
UINT FontSmoothingType; /* 1:Standard,2:ClearType */
/* FIXME: Big Icons (SPI_GETICONMETRICS?) */
BOOL DropShadow;
/*
* COPYRIGHT: See COPYING in the top level directory
- * PROJECT: ReactOS kernel
+ * PROJECT: ReactOS Win32k subsystem
* PURPOSE: Driver entry and initialization of win32k
* FILE: subsystems/win32/win32k/main/main.c
* PROGRAMER:
/* Allocate one if needed */
if (!Win32Process)
{
- /* FIXME - lock the process */
+ /* FIXME: Lock the process */
Win32Process = ExAllocatePoolWithTag(NonPagedPool,
sizeof(PROCESSINFO),
USERTAG_PROCESSINFO);
RtlZeroMemory(Win32Process, sizeof(PROCESSINFO));
PsSetProcessWin32Process(Process, Win32Process);
- /* FIXME - unlock the process */
+ /* FIXME: Unlock the process */
}
if (Create)
/* Allocate one if needed */
if (!ptiCurrent)
{
- /* FIXME - lock the process */
+ /* FIXME: Lock the process */
ptiCurrent = ExAllocatePoolWithTag(NonPagedPool,
sizeof(THREADINFO),
USERTAG_THREADINFO);
RtlZeroMemory(ptiCurrent, sizeof(THREADINFO));
PsSetThreadWin32Thread(Thread, ptiCurrent);
- /* FIXME - unlock the process */
+ /* FIXME: Unlock the process */
}
if (Type == PsW32ThreadCalloutInitialize)
if (Process->Win32Process == NULL)
{
- /* FIXME - lock the process */
+ /* FIXME: Lock the process */
Process->Win32Process = ExAllocatePoolWithTag(NonPagedPool, sizeof(PROCESSINFO), USERTAG_PROCESSINFO);
if (Process->Win32Process == NULL)
return STATUS_NO_MEMORY;
RtlZeroMemory(Process->Win32Process, sizeof(PROCESSINFO));
- /* FIXME - unlock the process */
+ /* FIXME: Unlock the process */
Win32kProcessCallback(Process, TRUE);
}
/* Create the global USER heap */
GlobalUserHeap = UserCreateHeap(&GlobalUserHeapSection,
&GlobalUserHeapBase,
- 1 * 1024 * 1024); /* FIXME - 1 MB for now... */
+ 1 * 1024 * 1024); /* FIXME: 1 MB for now... */
if (GlobalUserHeap == NULL)
{
DPRINT1("Failed to initialize the global heap!\n");
#include <win32k.h>
/*
- * FIXME! Is there a better algorithm. like FT_MulDiv
+ * FIXME: Is there a better algorithm, like FT_MulDiv?
*
* @implemented
*/
WCHAR awcBuffer[MAX_PATH];
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 */
Status = RtlFormatCurrentUserKeyPath(&usCurrentUserKey);
if (!NT_SUCCESS(Status))
if (W32Process != NULL)
{
- /* search for the mapping */
+ /* Search for the mapping */
Mapping = &W32Process->HeapMappings;
while (Mapping != NULL)
{
/* HACK: This needs to be handled during startup only... */
ASSERT(Base == (PVOID)GlobalUserHeap);
- /* temporarily map it into user space */
+ /* Temporarily map it into user space */
Offset.QuadPart = 0;
Status = MmMapViewOfSection(GlobalUserHeapSection,
PsGetCurrentProcess(),
&ViewSize,
ViewUnmap,
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))
return Status;
&ViewSize,
ViewUnmap,
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))
return NULL;
0,
&ViewSize,
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(),
MappedView);
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,
SECTION_ALL_ACCESS,
NULL,
&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,
NULL,
NULL);
return FALSE;
}
- /* create the heap */
+ /* Create the heap */
pHeap = IntUserHeapCreate(*SectionObject,
SystemBase,
HeapSize);
break;
case DxEGShDevData_hSpooler:
DPRINT1("requested DXEGSHDEVDATA DxEGShDevData_hSpooler\n");
- retVal = 0;//(DWORD_PTR) PDev->hSpooler; // If the device is a spooler driver.
+ retVal = 0; // (DWORD_PTR) PDev->hSpooler; // If the device is a spooler driver.
break;
case DxEGShDevData_DitherFmt:
DPRINT1("requested DXEGSHDEVDATA DxEGShDevData_DitherFmt\n");
/*
* COPYRIGHT: See COPYING in the top level directory
- * PROJECT: ReactOS kernel
+ * PROJECT: ReactOS Win32k subsystem
* 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)
* Thomas Weidenmueller (w3seek@users.sourceforge.net)
* NOTES: Please use the Callback Memory Management functions for
typedef struct _INT_CALLBACK_HEADER
{
- /* list entry in the THREADINFO structure */
+ /* List entry in the THREADINFO structure */
LIST_ENTRY ListEntry;
}
INT_CALLBACK_HEADER, *PINT_CALLBACK_HEADER;
W32Thread = PsGetCurrentThreadWin32Thread();
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);
W32Thread = PsGetCurrentThreadWin32Thread();
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);
- /* free memory */
+ /* Free memory */
ExFreePoolWithTag(Mem, USERTAG_CALLBACK);
}
Mem = CONTAINING_RECORD(CurrentEntry, INT_CALLBACK_HEADER,
ListEntry);
- /* free memory */
+ /* Free memory */
ExFreePool(Mem);
}
}
-
//
// 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.
/* FUNCTIONS *****************************************************************/
-/* calls ClientLoadLibrary in user32 */
+/* Calls ClientLoadLibrary in user32 */
HMODULE
co_IntClientLoadLibrary(PUNICODE_STRING pstrLibName,
PUNICODE_STRING pstrInitFunc,
ArgumentLength += pstrInitFunc->Length + sizeof(WCHAR);
}
- /* Allocate the argument*/
+ /* Allocate the argument */
pArguments = IntCbAllocateMemory(ArgumentLength);
if(pArguments == NULL)
{
return Status;
}
-
/* EOF */
WNDPROC
GetCallProcHandle(IN PCALLPROCDATA CallProc)
{
- /* FIXME - check for 64 bit architectures... */
+ /* FIXME: Check for 64 bit architectures... */
return (WNDPROC)((ULONG_PTR)UserHMGetHandle(CallProc) | 0xFFFF0000);
}
/*
* COPYRIGHT: See COPYING in the top level directory
- * PROJECT: ReactOS kernel
+ * PROJECT: ReactOS Win32k subsystem
* PURPOSE: Caret functions
- * FILE: subsys/win32k/ntuser/caret.c
+ * FILE: subsystems/win32/win32k/ntuser/caret.c
* PROGRAMER: Thomas Weidenmueller (w3seek@users.sourceforge.net)
*/
PTHREADINFO pti = PsGetCurrentThreadWin32Thread();
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))
{
EngSetLastError(ERROR_INVALID_PARAMETER);
Ret = WinStaObject->CaretBlinkRate;
if(!Ret)
{
- /* load it from the registry the first call only! */
+ /* Load it from the registry the first call only! */
Ret = WinStaObject->CaretBlinkRate = IntQueryCaretBlinkRate();
}
- /* windows doesn't do this check */
+ /* Windows doesn't do this check */
if((Ret < MIN_CARETBLINKRATE) || (Ret > MAX_CARETBLINKRATE))
{
Ret = DEFAULT_CARETBLINKRATE;
return FALSE;
}
-#if 0 //unused
+#if 0 // Unused
static
VOID FASTCALL
co_IntDrawCaret(HWND hWnd)
/*
* COPYRIGHT: See COPYING in the top level directory
- * PROJECT: ReactOS kernel
+ * PROJECT: ReactOS Win32k subsystem
* PURPOSE: Window classes
* FILE: subsystems/win32/win32k/ntuser/class.c
* PROGRAMER: Thomas Weidenmueller <w3seek@reactos.com>
static VOID
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)
{
UserHeapFree(Class->lpszClientUnicodeMenuName);
IntDestroyClass(IN OUT PCLS Class)
{
PDESKTOP pDesk;
- /* there shouldn't be any clones anymore */
+ /* There shouldn't be any clones anymore */
ASSERT(Class->cWndReferenceCount == 0);
ASSERT(Class->pclsClone == NULL);
pDesk = Class->rpdeskParent;
Class->rpdeskParent = NULL;
- /* free the structure */
+ /* Free the structure */
if (pDesk != NULL)
{
DesktopHeapFree(pDesk, 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 )
{
PCLS Class;
if (pi != NULL)
{
- /* free all local classes */
+ /* Free all local classes */
Class = pi->pclsPrivateList;
while (Class != NULL)
{
Class = pi->pclsPrivateList;
}
- /* free all global classes */
+ /* Free all global classes */
Class = pi->pclsPublicList;
while (Class != NULL)
{
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]))
{
EngSetLastError(ERROR_INVALID_PARAMETER);
{
RTL_ATOM Atom = (RTL_ATOM)0;
- /* update the base class first */
+ /* Update the base class first */
Class = Class->pclsBase;
if (!IntRegisterClassAtom(ClassName,
Class->atomClassName = Atom;
- /* update the clones */
+ /* Update the clones */
Class = Class->pclsClone;
while (Class != NULL)
{
Class->CSF_flags &= ~CSF_ANSIPROC;
}
- /* update the clones */
+ /* Update the clones */
chWndProc = Class->lpfnWndProc;
Class = Class->pclsClone;
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. */
return BaseClass;
ClassSize);
if (Class != NULL)
{
- /* simply clone the class */
+ /* Simply clone the class */
RtlCopyMemory( Class, BaseClass, ClassSize);
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 &&
Class->fnid <= FNID_GHOST &&
Class->fnid >= FNID_BUTTON )
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->cWndReferenceCount = 0;
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
the clone we just created, which now serves as the
new base class */
Class->pclsBase = Class;
Class->pclsNext = BaseClass->pclsNext;
- /* replace the base class */
+ /* Replace the base class */
(void)InterlockedExchangePointer((PVOID*)ClassLink,
Class);
- /* destroy the obsolete copy on the shared heap */
+ /* Destroy the obsolete copy on the shared heap */
BaseClass->pclsBase = NULL;
BaseClass->pclsClone = NULL;
IntDestroyClass(BaseClass);
}
else
{
- /* link in the clone */
+ /* Link in the clone */
Class->pclsClone = NULL;
Class->pclsBase = BaseClass;
Class->pclsNext = BaseClass->pclsClone;
ASSERT(Class->pclsBase->rpdeskParent != NULL);
ASSERT(Class->pclsBase->cWndReferenceCount == 0);
- /* unlink the clone */
+ /* Unlink the clone */
*CloneLink = Class->pclsNext;
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->pclsNext = (*BaseClassLink)->pclsNext;
- /* update all clones */
+ /* Update all clones */
Clone = Class->pclsClone;
while (Clone != NULL)
{
Clone = Clone->pclsNext;
}
- /* link in the new base class */
+ /* Link in the new base class */
(void)InterlockedExchangePointer((PVOID*)BaseClassLink,
Class);
}
ASSERT(Class->pclsBase == 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
then leave the class on the desktop heap. It will get moved
to the shared heap when the thread detaches. */
ASSERT(*PrevLink == BaseClass);
- /* make the first clone become the new base class */
+ /* Make the first clone become the new base class */
IntMakeCloneBaseClass(BaseClass->pclsClone,
PrevLink,
&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
resources shared by all classes (Base = NULL)! */
BaseClass->pclsBase = NULL;
{
TRACE("IntDereferenceClass1 0x%x\n", Class);
- /* locate the cloned class and unlink it */
+ /* Locate the cloned class and unlink it */
PrevLink = &BaseClass->pclsClone;
CurrentClass = BaseClass->pclsClone;
while (CurrentClass != Class)
ASSERT(Class->pclsBase == BaseClass);
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);
}
}
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);
if (NewClass != NULL)
{
NewClass->rpdeskParent = NULL;
NewClass->pclsBase = NewClass;
- /* replace the class in the list */
+ /* Replace the class in the list */
(void)InterlockedExchangePointer((PVOID*)*ClassLinkPtr,
NewClass);
*ClassLinkPtr = &NewClass->pclsNext;
- /* free the obsolete class on the desktop heap */
+ /* Free the obsolete class on the desktop heap */
Class->pclsBase = NULL;
IntDestroyClass(Class);
return TRUE;
if (Class->rpdeskParent == Desktop &&
Class->cWndReferenceCount == 0)
{
- /* there shouldn't be any clones around anymore! */
+ /* There shouldn't be any clones around anymore! */
ASSERT(Class->pclsClone == NULL);
- /* 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: 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
mapped into the process... */
- /* move the class to the shared heap */
+ /* Move the class to the shared heap */
if (IntMoveClassToSharedHeap(Class,
&Link))
{
if (FreeOnFailure)
{
- /* unlink the base class */
+ /* Unlink the base class */
(void)InterlockedExchangePointer((PVOID*)Link,
Class->pclsNext);
- /* we can free the old base class now */
+ /* We can free the old base class now */
Class->pclsBase = NULL;
IntDestroyClass(Class);
}
pi = GetW32ProcessInfo();
- /* check all local classes */
+ /* Check all local classes */
IntCheckDesktopClasses(Desktop,
&pi->pclsPrivateList,
FreeOnFailure,
&Ret);
- /* check all global classes */
+ /* Check all global classes */
IntCheckDesktopClasses(Desktop,
&pi->pclsPublicList,
FreeOnFailure,
}
else
{
- /* FIXME - the class was created before being connected
- to a desktop. It is possible for the desktop window,
- but should it be allowed for any other case? */
+ /* FIXME: The class was created before being connected
+ to a desktop. It is possible for the desktop window,
+ but should it be allowed for any other case? */
Class = UserHeapAlloc(ClassSize);
}
{
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
leak memory... */
// What?! If the user interface was written correctly this would not be an issue!
Class->hCursor = lpwcx->hCursor; /* FIXME */
Class->hbrBackground = lpwcx->hbrBackground;
- /* make a copy of the string */
+ /* Make a copy of the string */
if (pszMenuNameBuffer != NULL)
{
Class->MenuNameIsString = TRUE;
else
Class->lpszClientUnicodeMenuName = MenuName->Buffer;
- /* save an ansi copy of the string */
+ /* Save an ANSI copy of the string */
if (pszMenuNameBuffer != NULL)
{
ANSI_STRING AnsiString;
{
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;
}
}
Class->lpszClientAnsiMenuName = (PSTR)MenuName->Buffer;
/* Save kernel use menu name and ansi class name */
- Class->lpszMenuName = Class->lpszClientUnicodeMenuName; // Fixme!
- //Class->lpszAnsiClassName = Fixme!
+ Class->lpszMenuName = Class->lpszClientUnicodeMenuName; // FIXME!
+ //Class->lpszAnsiClassName = FIXME
/* Server Side overrides class calling type (A/W)!
User32 whine test_builtinproc: "deftest"
for match. This method will be used in related code.
*/
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)
{
WndProc = GETPFNSERVER(i);
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]))
{
EngSetLastError(ERROR_INVALID_PARAMETER);
else
AtomName = ClassName->Buffer;
- /* lookup the atom */
+ /* Lookup the atom */
Status = RtlLookupAtomInAtomTable(gAtomTable,
AtomName,
Atom);
{
PCLS Class;
- /* attempt to locate the class object */
+ /* Attempt to locate the class object */
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,
hInstance,
&pi->pclsPrivateList,
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 */
Class = IntFindClass(Atom,
NULL,
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,
hModClient,
&pi->pclsPrivateList,
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,
hModClient,
&pi->pclsPublicList,
if (Class != NULL && !Class->Global)
{
- // local class already exists
+ // Local class already exists
TRACE("Local Class 0x%p does already exist!\n", ClassAtom);
EngSetLastError(ERROR_CLASS_ALREADY_EXISTS);
return (RTL_ATOM)0;
return FALSE;
}
- /* must be a base class! */
+ /* Must be a base class! */
ASSERT(Class->pclsBase == Class);
- /* unlink the class */
+ /* Unlink the class */
*Link = Class->pclsNext;
if (NT_SUCCESS(IntDeregisterClassAtom(Class->atomClassName)))
{
TRACE("Class 0x%x\n", Class);
TRACE("UserUnregisterClass: Good Exit!\n");
- /* finally free the resources */
+ /* Finally free the resources */
IntDestroyClass(Class);
return TRUE;
}
PANSI_STRING AnsiClassName = (PANSI_STRING)ClassName;
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 */
if (BufLen / sizeof(WCHAR) > AnsiClassName->MaximumLength)
{
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,
Class->atomClassName,
NULL,
{
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
size to the buffer size provided */
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,
BufLen,
USERTAG_CLASS);
_SEH2_LEAVE;
}
- /* query the class name */
+ /* Query the class name */
Status = RtlQueryAtomInAtomTable(gAtomTable,
Atom ? Atom : Class->atomClassName,
NULL,
if (NT_SUCCESS(Status))
{
- /* convert the atom name to ansi */
+ /* Convert the atom name to ansi */
RtlInitUnicodeString(&UnicodeClassName,
szTemp);
Ret = BufLen / sizeof(WCHAR);
}
- else /* !Ansi */
+ else /* !ANSI */
{
BufLen = ClassName->MaximumLength;
- /* query the atom name */
+ /* Query the atom name */
Status = RtlQueryAtomInAtomTable(gAtomTable,
Atom ? Atom : Class->atomClassName,
NULL,
{
BOOL Ret = FALSE;
- /* change the base class first */
+ /* Change the base class first */
Class = Class->pclsBase;
if (MenuName->Length != 0)
{
NTSTATUS Status;
- /* copy the unicode string */
+ /* Copy the unicode string */
RtlCopyMemory(strBufW,
MenuName->Buffer,
MenuName->Length);
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);
Status = RtlUnicodeStringToAnsiString(&AnsiString,
MenuName,
if (Ret)
{
- /* update the base class */
+ /* Update the base class */
IntFreeClassMenuName(Class);
Class->lpszClientUnicodeMenuName = strBufW;
Class->lpszClientAnsiMenuName = AnsiString.Buffer;
Class->MenuNameIsString = TRUE;
- /* update the clones */
+ /* Update the clones */
Class = Class->pclsClone;
while (Class != NULL)
{
{
ASSERT(IS_INTRESOURCE(MenuName->Buffer));
- /* update the base class */
+ /* Update the base class */
IntFreeClassMenuName(Class);
Class->lpszClientUnicodeMenuName = MenuName->Buffer;
Class->lpszClientAnsiMenuName = (PSTR)MenuName->Buffer;
Class->MenuNameIsString = FALSE;
- /* update the clones */
+ /* Update the clones */
Class = Class->pclsClone;
while (Class != NULL)
{
/* 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;
if (Index >= 0)
Data = (PULONG_PTR)((ULONG_PTR)(Class + 1) + Index);
- /* FIXME - Data might be a unaligned pointer! Might be a problem on
- certain architectures, maybe using RtlCopyMemory is a
- better choice for those architectures! */
+ /* FIXME: Data might be a unaligned pointer! Might be a problem on
+ certain architectures, maybe using RtlCopyMemory is a
+ better choice for those architectures! */
Ret = *Data;
*Data = NewLong;
- /* update the clones */
+ /* Update the clones */
Class = Class->pclsClone;
while (Class != NULL)
{
Ret = (ULONG_PTR)Class->cbwndExtra;
Class->cbwndExtra = (INT)NewLong;
- /* update the clones */
+ /* Update the clones */
Class = Class->pclsClone;
while (Class != NULL)
{
Ret = (ULONG_PTR)Class->hbrBackground;
Class->hbrBackground = (HBRUSH)NewLong;
- /* update the clones */
+ /* Update the clones */
Class = Class->pclsClone;
while (Class != NULL)
{
break;
case GCLP_HCURSOR:
- /* FIXME - get handle from pointer to CURSOR object */
+ /* FIXME: Get handle from pointer to CURSOR object */
Ret = (ULONG_PTR)Class->hCursor;
Class->hCursor = (HANDLE)NewLong;
- /* update the clones */
+ /* Update the clones */
Class = Class->pclsClone;
while (Class != NULL)
{
break;
case GCLP_HICON:
- /* FIXME - get handle from pointer to ICON object */
+ /* FIXME: Get handle from pointer to ICON object */
Ret = (ULONG_PTR)Class->hIcon;
Class->hIcon = (HANDLE)NewLong;
- /* update the clones */
+ /* Update the clones */
Class = Class->pclsClone;
while (Class != NULL)
{
break;
case GCLP_HICONSM:
- /* FIXME - get handle from pointer to ICON object */
+ /* FIXME: Get handle from pointer to ICON object */
Ret = (ULONG_PTR)Class->hIconSm;
Class->hIconSm = (HANDLE)NewLong;
- /* update the clones */
+ /* Update the clones */
Class = Class->pclsClone;
while (Class != NULL)
{
Ret = (ULONG_PTR)Class->hModule;
Class->hModule = (HINSTANCE)NewLong;
- /* update the clones */
+ /* Update the clones */
Class = Class->pclsClone;
while (Class != NULL)
{
ERR("Setting the class menu name failed!\n");
}
- /* FIXME - really return NULL? Wine does so... */
+ /* FIXME: Really return NULL? Wine does so... */
break;
}
Ret = (ULONG_PTR)Class->style;
Class->style = (UINT)NewLong;
- /* FIXME - what if the CS_GLOBALCLASS style is changed? should we
- move the class to the appropriate list? For now, we save
- the original value in Class->Global, so we can always
- locate the appropriate list */
+ /* FIXME: What if the CS_GLOBALCLASS style is changed? should we
+ move the class to the appropriate list? For now, we save
+ the original value in Class->Global, so we can always
+ locate the appropriate list */
- /* update the clones */
+ /* Update the clones */
Class = Class->pclsClone;
while (Class != NULL)
{
lpwcx->cbClsExtra = Class->cbclsExtra;
lpwcx->cbWndExtra = Class->cbwndExtra;
- lpwcx->hIcon = Class->hIcon; /* FIXME - get handle from pointer */
- lpwcx->hCursor = Class->hCursor; /* FIXME - get handle from pointer */
+ lpwcx->hIcon = Class->hIcon; /* FIXME: Get handle from pointer */
+ lpwcx->hCursor = Class->hCursor; /* FIXME: Get handle from pointer */
lpwcx->hbrBackground = Class->hbrBackground;
/* Copy non-string to user first. */
else
lpwcx->lpszMenuName = Class->lpszClientUnicodeMenuName;
/*
- FIXME! CLSMENUNAME has the answers! Copy the already made buffers from there!
- Cls: lpszMenuName and lpszAnsiClassName should be used by kernel space.
- lpszClientXxxMenuName should already be mapped to user space.
+ * FIXME: CLSMENUNAME has the answers! Copy the already made buffers from there!
+ * Cls: lpszMenuName and lpszAnsiClassName should be used by kernel space.
+ * lpszClientXxxMenuName should already be mapped to user space.
*/
/* Copy string ptr to user. */
if ( Class->lpszClientUnicodeMenuName != NULL &&
else
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->hIconSm = Class->hIconSm; /* FIXME - get handle from pointer */
+ lpwcx->hIconSm = Class->hIconSm; /* FIXME: Get handle from pointer */
return TRUE;
}
//
-//
+// ???
//
BOOL
FASTCALL
}
if (IsCallProcHandle(lpwcx->lpfnWndProc))
- {// Never seen this yet, but I'm sure it's a little haxxy trick!
- // If this pops up we know what todo!
+ { // Never seen this yet, but I'm sure it's a little haxxy trick!
+ // If this pops up we know what todo!
ERR("NtUserRegisterClassExWOW WndProc is CallProc!!\n");
}
{
UNICODE_STRING Value;
- /* probe the parameters */
+ /* Probe the parameters */
if (Offset == GCW_ATOM || Offset == GCLP_MENUNAME)
{
Value = ProbeForReadUnicodeString((PUNICODE_STRING)dwNewLong);
_SEH2_TRY
{
- /* probe the paramters */
+ /* Probe the paramters */
CapturedClassName = ProbeForReadUnicodeString(ClassNameOrAtom);
if (CapturedClassName.Length & 1)
{
}
}
- /* unregister the class */
+ /* Unregister the class */
Ret = UserUnregisterClass(&CapturedClassName,
hInstance,
NULL); // Null for now~
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
NtUserGetClassInfo(
HINSTANCE hInstance,
PPROCESSINFO ppi;
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 */
UserEnterExclusive();
_SEH2_TRY
{
- /* probe the paramters */
+ /* Probe the paramters */
CapturedClassName = ProbeForReadUnicodeString(ClassName);
if (CapturedClassName.Length == 0)
ProbeForWriteUnicodeString(ClassName);
CapturedClassName = *ClassName;
- /* get the class name */
+ /* Get the class name */
Ret = UserGetClassName(Window->pcls,
&CapturedClassName,
Atom,
if (Ret != 0)
{
- /* update the Length field */
+ /* Update the Length field */
ClassName->Length = CapturedClassName.Length;
}
}
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
IntIsFormatAvailable(PWINSTATION_OBJECT pWinStaObj, UINT fmt)
{
}
}
-/* adds a new format and data to the clipboard */
+/* Adds a new format and data to the clipboard */
PCLIP static NTAPI
IntAddFormatedData(PWINSTATION_OBJECT pWinStaObj, UINT fmt, HANDLE hData, BOOLEAN fGlobalHandle, BOOL bEnd)
{
BOOL static FASTCALL
IntIsClipboardOpenByMe(PWINSTATION_OBJECT pWinSta)
{
- /* check if current thread has opened the clipboard */
+ /* Check if current thread has opened the clipboard */
if (pWinSta->ptiClipLock &&
pWinSta->ptiClipLock == PsGetCurrentThreadWin32Thread())
{
if (!pBmEl && pDibEl)
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 */
if (!pDibEl && pBmEl)
IntSynthesizeDib(pWinStaObj, pBmEl->hData);
if (!pWinStaObj)
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)
{
- /* the window that opens the clipboard was destroyed */
+ /* The window that opens the clipboard was destroyed */
pWinStaObj->spwndClipOpen = NULL;
pWinStaObj->ptiClipLock = NULL;
}
if (pWindow == pWinStaObj->spwndClipOwner)
{
- /* the owner window was destroyed */
+ /* The owner window was destroyed */
pWinStaObj->spwndClipOwner = NULL;
}
- /* remove window from window chain */
+ /* Remove window from window chain */
if (pWindow == pWinStaObj->spwndClipViewer)
pWinStaObj->spwndClipViewer = NULL;
UserEnterShared();
- /* if the format is built-in we fail */
+ /* If the format is built-in we fail */
if (fmt < 0xc000)
{
- /* registetrated formats are >= 0xc000 */
+ /* Registetrated formats are >= 0xc000 */
goto cleanup;
}
pElement = IntIsFormatAvailable(pWinStaObj, fmt);
if (pElement && IS_DATA_DELAYED(pElement) && pWinStaObj->spwndClipOwner)
{
- /* send WM_RENDERFORMAT message */
+ /* Send WM_RENDERFORMAT message */
pWinStaObj->fInDelayedRendering = TRUE;
co_IntSendMessage(pWinStaObj->spwndClipOwner->head.h, WM_RENDERFORMAT, (WPARAM)fmt, 0);
pWinStaObj->fInDelayedRendering = FALSE;
- /* data should be in clipboard now */
+ /* Data should be in clipboard now */
pElement = IntIsFormatAvailable(pWinStaObj, fmt);
}
if (IS_DATA_SYNTHESIZED(pElement))
{
- /* Note: data is synthesized in usermode */
+ /* Note: Data is synthesized in usermode */
/* TODO: Add more formats */
switch (fmt)
{
pWinStaObj->iClipSequenceNumber++;
pWinStaObj->fClipboardChanged = TRUE;
- /* Note: synthesized formats are added in NtUserCloseClipboard */
+ /* Note: Synthesized formats are added in NtUserCloseClipboard */
}
else
{
/*
* COPYRIGHT: See COPYING in the top level directory
- * PROJECT: ReactOS kernel
+ * PROJECT: ReactOS Win32k subsystem
* PURPOSE: Cursor and icon functions
- * FILE: subsystem/win32/win32k/ntuser/cursoricon.c
+ * FILE: subsystems/win32/win32k/ntuser/cursoricon.c
* PROGRAMER: ReactOS Team
*/
/*
CurIcon = (PCURICON_OBJECT)UserReferenceObjectByHandle(hCurIcon, otCursorIcon);
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);
return NULL;
}
LIST_FOR_EACH(CurIcon, &gCurIconList, CURICON_OBJECT, ListEntry)
{
- // if(NT_SUCCESS(UserReferenceObjectByPointer(Object, otCursorIcon))) //<- huh????
+ // if (NT_SUCCESS(UserReferenceObjectByPointer(Object, otCursorIcon))) // <- huh????
// UserReferenceObject( CurIcon);
// {
if ((CurIcon->hModule == hModule) && (CurIcon->hRsrc == hRsrc))
bmpMask = CurIcon->IconInfo.hbmMask;
bmpColor = CurIcon->IconInfo.hbmColor;
- /* delete bitmaps */
+ /* Delete bitmaps */
if (bmpMask)
{
GreSetObjectOwner(bmpMask, GDI_OBJ_HMGR_POWNED);
NtUserGetIconInfo(
HANDLE hCurIcon,
PICONINFO IconInfo,
- PUNICODE_STRING lpInstName, // optional
- PUNICODE_STRING lpResName, // optional
- LPDWORD pbpp, // optional
+ PUNICODE_STRING lpInstName, // Optional
+ PUNICODE_STRING lpResName, // Optional
+ LPDWORD pbpp, // Optional
BOOL bInternal)
{
ICONINFO ii;
if (NT_SUCCESS(Status))
bRet = TRUE;
else
- SetLastNtError(Status); // maybe not, test this
+ SetLastNtError(Status); // Maybe not, test this
UserDereferenceObject(CurIcon);
UserClipCursor(
RECTL *prcl)
{
- /* FIXME - check if process has WINSTA_WRITEATTRIBUTES */
+ /* FIXME: Check if process has WINSTA_WRITEATTRIBUTES */
PSYSTEM_CURSORINFO CurInfo;
PWND DesktopWindow = NULL;
{
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);
}
NtUserGetClipCursor(
RECTL *lpRect)
{
- /* FIXME - check if process has WINSTA_READATTRIBUTES */
+ /* FIXME: Check if process has WINSTA_READATTRIBUTES */
PSYSTEM_CURSORINFO CurInfo;
RECTL Rect;
NTSTATUS Status;
}
/* Set Background/foreground colors */
- iOldTxtColor = IntGdiSetTextColor(hDc, 0); //black
- iOldBkColor = IntGdiSetBkColor(hDc, 0x00FFFFFF); //white
+ iOldTxtColor = IntGdiSetTextColor(hDc, 0); // Black
+ iOldBkColor = IntGdiSetBkColor(hDc, 0x00FFFFFF); // White
if(bAlpha && (diFlags & DI_IMAGE))
{
goto CleanupAlpha;
}
- /* premultiply with the alpha channel value */
+ /* Premultiply with the alpha channel value */
for (i = 0; i < psurf->SurfObj.sizlBitmap.cy; i++)
{
ptr = (PBYTE)psurf->SurfObj.pvScan0 + i*psurf->SurfObj.lDelta;
return Ret;
}
+/* EOF */
/*
* COPYRIGHT: See COPYING in the top level directory
- * PROJECT: ReactOS kernel
- * PURPOSE: Misc User funcs
- * FILE: subsystem/win32/win32k/ntuser/defwnd.c
+ * PROJECT: ReactOS Win32k subsystem
+ * PURPOSE: Miscellaneous User functions
+ * FILE: subsystems/win32/win32k/ntuser/defwnd.c
* PROGRAMER:
*/
#define MCSR_DONOTSHUTDOWN 3
/*
- 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.
+ * 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.
*/
static
LRESULT FASTCALL
if (!pWnd) return HTNOWHERE;
- if (pWnd == UserGetDesktopWindow())//pWnd->fnid == FNID_DESKTOP)
+ if (pWnd == UserGetDesktopWindow()) // pWnd->fnid == FNID_DESKTOP)
{
rcClient.left = rcClient.top = rcWindow.left = rcWindow.top = 0;
rcWindow.right = UserGetSystemMetrics(SM_CXSCREEN);
}
/* 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))
{
rcWindow.left += UserGetSystemMetrics(SM_CXSIZE);
}
/* 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))
{
rcWindow.right -= UserGetSystemMetrics(SM_CXSIZE);
/*
* COPYRIGHT: See COPYING in the top level directory
- * PROJECT: ReactOS kernel
+ * PROJECT: ReactOS Win32k subsystem
* PURPOSE: Desktops
* FILE: subsystems/win32/win32k/ntuser/desktop.c
* PROGRAMER: Casper S. Hornstrup (chorns@users.sourceforge.net)
if(!WinStaPresent)
{
#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. */
if (!ObFindHandleForObject(Process,
NULL,
(PHANDLE)hWinSta))
#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");
}
}
if(!DesktopPresent && hDesktop != NULL)
{
#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. */
if (!ObFindHandleForObject(Process,
NULL,
(PHANDLE)hDesktop))
#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");
}
}
return STATUS_INSUFFICIENT_RESOURCES;
}
- /* open the window station */
+ /* Open the window station */
InitializeObjectAttributes(&ObjectAttributes,
&FullName,
OBJ_CASE_INSENSITIVE,
return STATUS_INSUFFICIENT_RESOURCES;
}
- /* open the desktop object */
+ /* Open the desktop object */
InitializeObjectAttributes(&ObjectAttributes,
&FullName,
OBJ_CASE_INSENSITIVE,
}
/*
- * returns or creates a handle to the desktop object
+ * Returns or creates a handle to the desktop object
*/
HDESK FASTCALL
IntGetDesktopObjectHandle(PDESKTOP DesktopObject)
(PHANDLE)&Ret);
if(!NT_SUCCESS(Status))
{
- /* unable to create a handle */
+ /* Unable to create a handle */
ERR("Unable to create a desktop handle\n");
return NULL;
}
PSHELL_HOOK_WINDOW Current;
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)
entries++;
LIST_FOR_EACH(Current, &Desktop->ShellHookWindows, SHELL_HOOK_WINDOW, ListEntry)
*cursor++ = Current->hWnd;
- *cursor = NULL; /* nullterm list */
+ *cursor = NULL; /* Nullterm list */
}
return list;
if (!gpsi->uiShellMsg)
{
- /* Too bad, this doesn't work.*/
+ /* Too bad, this doesn't work. */
#if 0
UNICODE_STRING Str;
RtlInitUnicodeString(&Str, L"SHELLHOOK");
InitializeListHead(&DesktopObject->pDeskInfo->aphkStart[i]);
}
-//// why is this here?
+//// Why is this here?
#if 0
if (! NT_SUCCESS(Status))
{
{
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)
{
- /* FIXME - clip out the bitmap
- can be replaced with "NtGdiPatBlt(hDC, x, y, WinSta->cxWallpaper, WinSta->cyWallpaper, PATCOPY | DSTINVERT);"
- once we support DSTINVERT */
+ /* FIXME: Clip out the bitmap
+ can be replaced with "NtGdiPatBlt(hDC, x, y, WinSta->cxWallpaper, WinSta->cyWallpaper, PATCOPY | DSTINVERT);"
+ once we support DSTINVERT */
PreviousBrush = NtGdiSelectBrush(hDC, DesktopBrush);
NtGdiPatBlt(hDC, Rect.left, Rect.top, Rect.right, Rect.bottom, PATCOPY);
NtGdiSelectBrush(hDC, PreviousBrush);
}
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(x = 0; x < Rect.right; x += WinSta->cxWallpaper)
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 */
Ret = ((PTHREADINFO)Thread->Tcb.Win32Thread)->hdesk;
ObDereferenceObject(Thread);
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) ||
!(DesktopObject = ((PTHREADINFO)Thread->Tcb.Win32Thread)->rpdesk))
{
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 */
- /* 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 */
KeAttachProcess(&Thread->ThreadsProcess->Pcb);
Status = ObReferenceObjectByHandle(hThreadDesktop,
&HandleInformation);
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))
{
ObDereferenceObject(Thread);
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 */
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(Thread);
RETURN(Ret);
CurrentWin32Process = PsGetCurrentProcessWin32Process();
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;
while (HeapMapping != NULL)
{
CurrentWin32Process = PsGetCurrentProcessWin32Process();
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;
while (HeapMapping != NULL)
{
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);
Offset.QuadPart = 0;
Status = MmMapViewOfSection(DesktopObject->hsectionDesktop,
&ViewSize,
ViewUnmap,
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))
{
ERR("Failed to map desktop\n");
return Status;
}
- /* add the mapping */
+ /* Add the mapping */
HeapMapping = UserHeapAlloc(sizeof(W32HEAP_USER_MAPPING));
if (HeapMapping == NULL)
{
{
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 */
if (MapHeap && DesktopObject != NULL)
IntUnmapDesktopView(DesktopObject);
TRACE("Enter UserEnumDisplaySettings('%wZ', %ld)\n",
pustrDevice, iModeNum);
- /* Ask gdi for the GRAPHICS_DEVICE */
+ /* Ask GDI for the GRAPHICS_DEVICE */
pGraphicsDevice = EngpFindGraphicsDevice(pustrDevice, 0, 0);
if (!pGraphicsDevice)
{
pdmentry = &pGraphicsDevice->pDevModeList[i];
- /* FIXME: consider EDS_RAWMODE */
+ /* FIXME: Consider EDS_RAWMODE */
#if 0
if ((!(dwFlags & EDS_RAWMODE) && (pdmentry->dwFlags & 1)) ||!
(dwFlags & EDS_RAWMODE))
if (bGlobal)
{
- // FIXME: need to fix the registry key somehow
+ // FIXME: Need to fix the registry key somehow
}
/* Open the registry key */
/* Output what we got */
RtlCopyMemory(lpDevMode, pdm, min(cbSize, pdm->dmSize));
- /* output private/extra driver data */
+ /* Output private/extra driver data */
if (cbExtra > 0 && pdm->dmDriverExtra > 0)
{
RtlCopyMemory((PCHAR)lpDevMode + cbSize,
/* Check params */
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;
}
ppdev = EngpGetPDEV(pustrDevice);
if (!ppdev)
{
- ERR("failed to get PDEV\n");
+ ERR("Failed to get PDEV\n");
return DISP_CHANGE_BADPARAM;
}
/* Check for failure */
if (!ulResult)
{
- ERR("failed to set mode\n");
+ ERR("Failed to set mode\n");
lResult = (lResult == DISP_CHANGE_NOTUPDATED) ?
DISP_CHANGE_FAILED : DISP_CHANGE_RESTART;
pEP->idObject = idObject;
pEP->idChild = idChild;
- /* FIXME should get timeout from
+ /* FIXME: Should get timeout from
* HKEY_CURRENT_USER\Control Panel\Desktop\LowLevelHooksTimeout */
Status = co_MsqSendMessage( pEH->head.pti->MessageQueue,
hwnd,
// Must be inside the event window.
if ( (pEH->eventMin <= Event) && (pEH->eventMax >= Event))
{
-// if all process || all thread || other thread same process
-// if ^skip own thread && ((Pid && CPid == Pid && ^skip own process) || all process)
+// If all process || all thread || other thread same process
+// If ^skip own thread && ((Pid && CPid == Pid && ^skip own process) || all process)
if ( (!pEH->idProcess || pEH->idProcess == PtrToUint(pti->pEThread->Cid.UniqueProcess)) &&
(!(pEH->Flags & WINEVENT_SKIPOWNPROCESS) || pEH->head.pti->ppi != pti->ppi) &&
(!pEH->idThread || pEH->idThread == PtrToUint(pti->pEThread->Cid.UniqueThread)) &&
/*
* COPYRIGHT: See COPYING in the top level directory
- * PROJECT: ReactOS kernel
+ * PROJECT: ReactOS Win32k subsystem
* PURPOSE: Focus functions
- * FILE: subsystem/win32/win32k/ntuser/focus.c
+ * FILE: subsystems/win32/win32k/ntuser/focus.c
* PROGRAMER: ReactOS Team
*/
return TRUE;
}
- /* call CBT hook chain */
+ /* Call CBT hook chain */
cbt.fMouse = MouseActivate;
cbt.hWndActive = hWndPrev;
if (co_HOOK_CallHooks( WH_CBT, HCBT_ACTIVATE, (WPARAM)hWnd, (LPARAM)&cbt))
}
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);
return hWndPrev;
}
- /* call CBT hook chain */
+ /* Call CBT hook chain */
cbt.fMouse = FALSE;
cbt.hWndActive = hWndPrev;
if (co_HOOK_CallHooks( WH_CBT, HCBT_ACTIVATE, (WPARAM)hWnd, (LPARAM)&cbt))
{
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 */
return 0;
}
- /* activate pwndTop if needed. */
+ /* Activate pwndTop if needed. */
if (pwndTop->head.h != ThreadQueue->ActiveWindow)
{
co_IntSetActiveWindow(pwndTop);
if (hWnd == NULL) // Release mode.
{
MOUSEINPUT mi;
- /// These are hacks!
- /* also remove other windows if not capturing anymore */
+ /// These are HACKS!
+ /* Also remove other windows if not capturing anymore */
MsqSetStateWindow(ThreadQueue, MSQ_STATE_MENUOWNER, NULL);
MsqSetStateWindow(ThreadQueue, MSQ_STATE_MOVESIZE, NULL);
///
{
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) &&
ptiCurrent->ppi != ppiCsr)
{
}
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) ||
ptiCurrent->ppi == ppiCsr)
{
co_MsqSendMessageAsync( ptiCurrent,
0,
WH_APIHOOK,
- FALSE, /* load the module */
+ FALSE, /* Load the module */
0,
NULL,
0,
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 */
Status = co_MsqSendMessage( pti->MessageQueue,
IntToPtr(Code), // hWnd
Size = sizeof(CBTACTIVATESTRUCT);
break;
- case HCBT_CREATEWND: /* Handle Ansi? */
+ case HCBT_CREATEWND: /* Handle ANSI? */
Size = sizeof(CBT_CREATEWND);
/* What shall we do? Size += sizeof(HOOKPROC_CBT_CREATEWND_EXTRA_ARGUMENTS); same as CREATESTRUCTEX */
break;
return pList;
}
-/* find the next hook in the chain */
+/* Find the next hook in the chain */
PHOOK
FASTCALL
IntGetNextHook(PHOOK Hook)
return NULL;
}
-/* free a hook, removing it from its chain */
+/* Free a hook, removing it from its chain */
static
VOID
FASTCALL
UserDeleteObject(UserHMGetHandle(Hook), otHook);
}
-/* remove a hook, freeing it from the chain */
+/* Remove a hook, freeing it from the chain */
static
VOID
FASTCALL
while (pElem != pGLE)
{
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)
{
IntRemoveHook(HookObj);
}
}
}
- else /* system-global hook */
+ else /* System-global hook */
{
ptiHook = pti; // gptiCurrent;
if ( !Mod &&
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);
ptiHook->sphkCurrent = NULL;
}
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);
}
else
return ret;
}
-
/* EOF */
/*
* COPYRIGHT: See COPYING in the top level directory
- * PROJECT: ReactOS kernel
+ * PROJECT: ReactOS Win32k subsystem
* PURPOSE: HotKey support
- * FILE: subsys/win32k/ntuser/hotkey.c
+ * FILE: subsystems/win32/win32k/ntuser/hotkey.c
* PROGRAMER: Eric Kohl
*/
/*
-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
-windows/threads on destops not belonging to WinSta0 to set hotkeys (recieve notifications).
-
--Gunnar
-*/
+ * 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
+ * windows/threads on destops not belonging to WinSta0 to set hotkeys (recieve notifications).
+ * -- Gunnar
+ */
#include <win32k.h>
DBG_DEFAULT_CHANNEL(UserHotkey);
{
//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);
}
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);
EngSetLastError(ERROR_INVALID_FLAGS);
/*
* COPYRIGHT: See COPYING in the top level directory
- * PROJECT: ReactOS kernel
+ * PROJECT: ReactOS Win32k subsystem
* PURPOSE: General input functions
* FILE: subsystems/win32/win32k/ntuser/input.c
* PROGRAMERS: Casper S. Hornstrup (chorns@users.sourceforge.net)
if(!pti->rpdesk || ((pti->TIF_flags & TIF_INCLEANUP) && BlockIt))
{
/*
- * fail blocking if exiting the thread
+ * Fail blocking if exiting the thread
*/
return FALSE;
}
/*
- * FIXME - check access rights of the window station
- * e.g. services running in the service window station cannot block input
+ * FIXME: Check access rights of the window station
+ * e.g. services running in the service window station cannot block input
*/
if(!ThreadHasInputAccess(pti) ||
!IntIsActiveDesktop(pti->rpdesk))
{
PATTACHINFO pai;
- /* Can not be the same thread.*/
+ /* Can not be the same thread. */
if (pti == ptiTo) return FALSE;
/* Do not attach to system threads or between different desktops. */
}
/*
- * FIXME - check access rights of the window station
- * e.g. services running in the service window station cannot block input
+ * FIXME: Check access rights of the window station
+ * e.g. services running in the service window station cannot block input
*/
if (!ThreadHasInputAccess(pti) ||
!IntIsActiveDesktop(pti->rpdesk))
/*
- * PROJECT: ReactOS Kernel
+ * PROJECT: ReactOS Win32k subsystem
* LICENSE: GPL - See COPYING in the top level directory
* FILE: subsystems/win32/win32k/ntuser/kbdlayout.c
* PURPOSE: Keyboard layout management
if (Flags & KLF_SETFORPROCESS)
{
- //FIXME
+ // FIXME
}
// Send WM_INPUTLANGCHANGE to thread's focus window
co_IntSendMessage(pti->MessageQueue->FocusWindow,
WM_INPUTLANGCHANGE,
- (WPARAM)pKl->iBaseCharset, // FIXME: how to set it?
- (LPARAM)pKl->hkl); //hkl
+ (WPARAM)pKl->iBaseCharset, // FIXME: How to set it?
+ (LPARAM)pKl->hkl); // hkl
return pklPrev;
}
APIENTRY
NtUserLoadKeyboardLayoutEx(
IN HANDLE Handle, // hFile (See downloads.securityfocus.com/vulnerabilities/exploits/43774.c)
- IN DWORD offTable, // offset to KbdTables
- IN PUNICODE_STRING puszKeyboardName, // not used?
+ IN DWORD offTable, // Offset to KbdTables
+ IN PUNICODE_STRING puszKeyboardName, // Not used?
IN HKL hklUnload,
IN PUNICODE_STRING pustrKLID,
IN DWORD hkl,
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));
_SEH2_TRY
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
* PURPOSE: Keyboard functions
- * FILE: subsys/win32k/ntuser/keyboard.c
+ * FILE: subsystems/win32/win32k/ntuser/keyboard.c
* PROGRAMERS: Casper S. Hornstrup (chorns@users.sourceforge.net)
* Rafal Harabien (rafalh@reactos.org)
*/
TRACE("Final char: %lc (%x)\n", wchTranslatedChar, wchTranslatedChar);
}
- /* dead char has not been not found */
+ /* Dead char has not been not found */
if (wchDead)
{
/* Treat both characters normally */
bDead = FALSE;
}
- /* add character to the buffer */
+ /* Add character to the buffer */
if (cchBuff > iRet)
pwszBuff[iRet++] = wchTranslatedChar;
{
/* Init message */
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.time = dwTime;
Msg.pt = gpsi->ptCursor;
Msg.lParam |= KF_REPEAT << 16;
if (!bIsDown)
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)
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...
Msg.lParam |= KF_MENUMODE << 16;
}
pKbdTbl = pKl->spkf->pKbdTbl;
/* 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 */
wVk = IntVscToVk(wScanCode, pKbdTbl);
TRACE("UserProcessKeyboardInput: %x (break: %u) -> %x\n",
case MAPVK_VK_TO_VSC:
uCode = IntFixVk(uCode, FALSE);
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;
break;
}
RtlZeroMemory(pwszBuff, sizeof(WCHAR) * cchBuff);
- UserEnterExclusive(); // Note: we modify wchDead static variable
+ UserEnterExclusive(); // Note: We modify wchDead static variable
if (dwhkl)
pKl = UserHklToKbl(dwhkl);
/* "Do not care" flag */
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 */
if (wScanCode == SCANCODE_RSHIFT && !bExtKey)
wScanCode = SCANCODE_LSHIFT;
{
cchKeyName = wcslen(pKeyName);
if (cchKeyName > cchSize - 1)
- cchKeyName = cchSize - 1; // don't count '\0'
+ cchKeyName = cchSize - 1; // Don't count '\0'
_SEH2_TRY
{
/* 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_GOINTOSUBMENU (0x10)
PWINSTATION_OBJECT WindowStation;
NTSTATUS Status;
- /* remove all menu items */
- IntDeleteMenuItems(Menu, bRecurse); /* do not destroy submenus */
+ /* Remove all menu items */
+ IntDeleteMenuItems(Menu, bRecurse); /* Do not destroy submenus */
if(RemoveFromProcess)
{
}
Menu->Process = PsGetCurrentProcess();
- Menu->RtoL = FALSE; /* default */
- Menu->MenuInfo.cbSize = sizeof(MENUINFO); /* not used */
- Menu->MenuInfo.fMask = 0; /* not used */
+ Menu->RtoL = FALSE; /* Default */
+ Menu->MenuInfo.cbSize = sizeof(MENUINFO); /* Not used */
+ Menu->MenuInfo.fMask = 0; /* Not used */
Menu->MenuInfo.dwStyle = 0; /* FIXME */
- Menu->MenuInfo.cyMax = 0; /* default */
- Menu->MenuInfo.hbrBack = NULL; /* no brush */
- Menu->MenuInfo.dwContextHelpID = 0; /* default */
- Menu->MenuInfo.dwMenuData = 0; /* default */
+ Menu->MenuInfo.cyMax = 0; /* Default */
+ Menu->MenuInfo.hbrBack = NULL; /* No brush */
+ Menu->MenuInfo.dwContextHelpID = 0; /* Default */
+ Menu->MenuInfo.dwMenuData = 0; /* Default */
Menu->MenuInfo.Self = *Handle;
Menu->MenuInfo.FocusedItem = NO_SELECTED_ITEM;
Menu->MenuInfo.Flags = (IsMenuBar ? 0 : MF_POPUP);
Menu->Process = PsGetCurrentProcess();
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.dwStyle = Source->MenuInfo.dwStyle;
Menu->MenuInfo.cyMax = Source->MenuInfo.cyMax;
if(LastItem)
{
- /* insert the item after LastItem */
+ /* Insert the item after LastItem */
LastItem->Next = MenuItem;
}
else
{
- /* insert at the beginning */
+ /* Insert at the beginning */
Menu->MenuItemList = MenuItem;
}
MenuItem->Next = CurItem;
if (lpmii->fMask & ( MIIM_STRING | MIIM_FTYPE | MIIM_BITMAP))
{
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);
return FALSE;
}
}
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 */
if(lpmii->fState & MFS_DEFAULT)
UserSetMenuDefaultItem(MenuObject, -1, 0);
- /* update the menu item state flags */
+ /* Update the menu item state flags */
UpdateMenuItemState(MenuItem->fState, lpmii->fState);
}
}
if (SubMenu == NULL)
{
- /* default to last position of menu */
+ /* Default to last position of menu */
SubMenu = MenuObject;
pos = MenuObject->MenuInfo.MenuItemCount;
}
if (0 != CurItem->Text.Length
&& (nMax >= CurItem->Text.Length + sizeof(WCHAR)))
{
- /* copy string */
+ /* Copy string */
Status = MmCopyToCaller(StrOut, CurItem->Text.Buffer,
CurItem->Text.Length);
if (! NT_SUCCESS(Status))
MenuItem->fState &= ~MF_HILITE;
}
- /* FIXME - update the window's menu */
+ /* FIXME: Update the window's menu */
return TRUE;
}
co_IntInitTracking(PWND Window, PMENU_OBJECT Menu, BOOL Popup,
UINT Flags)
{
- /* FIXME - hide caret */
+ /* FIXME: Hide caret */
if(!(Flags & TPM_NONOTIFY))
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))
co_IntSendMessage(Window->head.h, WM_INITMENU, (WPARAM)Menu->MenuInfo.Self, 0);
if(!(Flags & TPM_NONOTIFY))
co_IntSendMessage(Window->head.h, WM_EXITMENULOOP, 0 /* FIXME */, 0);
- /* FIXME - Show caret again */
+ /* FIXME: Show caret again */
}
INT FASTCALL
bti->rcTitleBar.right = pWindowObject->rcWindow.right - pWindowObject->rcWindow.left;
bti->rcTitleBar.bottom = pWindowObject->rcWindow.bottom - pWindowObject->rcWindow.top;
- /* is it iconiced ? */
+ /* Is it iconiced ? */
if ((dwStyle & WS_ICONIC)!=WS_ICONIC)
{
/* Remove frame from rectangle */
if (HAS_THICKFRAME( dwStyle, dwExStyle ))
{
- /* FIXME : Note this value should exists in pWindowObject for UserGetSystemMetrics(SM_CXFRAME) and UserGetSystemMetrics(SM_CYFRAME) */
+ /* FIXME: Note this value should exists in pWindowObject for UserGetSystemMetrics(SM_CXFRAME) and UserGetSystemMetrics(SM_CYFRAME) */
RECTL_vInflateRect( &bti->rcTitleBar, -UserGetSystemMetrics(SM_CXFRAME), -UserGetSystemMetrics(SM_CYFRAME) );
}
else if (HAS_DLGFRAME( dwStyle, dwExStyle ))
{
- /* FIXME : Note this value should exists in pWindowObject for UserGetSystemMetrics(SM_CXDLGFRAME) and UserGetSystemMetrics(SM_CYDLGFRAME) */
+ /* FIXME: Note this value should exists in pWindowObject for UserGetSystemMetrics(SM_CXDLGFRAME) and UserGetSystemMetrics(SM_CYDLGFRAME) */
RECTL_vInflateRect( &bti->rcTitleBar, -UserGetSystemMetrics(SM_CXDLGFRAME), -UserGetSystemMetrics(SM_CYDLGFRAME));
}
else if (HAS_THINFRAME( dwStyle, dwExStyle))
{
- /* FIXME : Note this value should exists in pWindowObject for UserGetSystemMetrics(SM_CXBORDER) and UserGetSystemMetrics(SM_CYBORDER) */
+ /* FIXME: Note this value should exists in pWindowObject for UserGetSystemMetrics(SM_CXBORDER) and UserGetSystemMetrics(SM_CYBORDER) */
RECTL_vInflateRect( &bti->rcTitleBar, -UserGetSystemMetrics(SM_CXBORDER), -UserGetSystemMetrics(SM_CYBORDER) );
}
{
if (dwExStyle & WS_EX_CLIENTEDGE)
{
- /* FIXME : Note this value should exists in pWindowObject for UserGetSystemMetrics(SM_CXEDGE) and UserGetSystemMetrics(SM_CYEDGE) */
+ /* FIXME: Note this value should exists in pWindowObject for UserGetSystemMetrics(SM_CXEDGE) and UserGetSystemMetrics(SM_CYEDGE) */
RECTL_vInflateRect (&bti->rcTitleBar, -UserGetSystemMetrics(SM_CXEDGE), -UserGetSystemMetrics(SM_CYEDGE));
}
if (dwExStyle & WS_EX_STATICEDGE)
{
- /* FIXME : Note this value should exists in pWindowObject for UserGetSystemMetrics(SM_CXBORDER) and UserGetSystemMetrics(SM_CYBORDER) */
+ /* FIXME: Note this value should exists in pWindowObject for UserGetSystemMetrics(SM_CXBORDER) and UserGetSystemMetrics(SM_CYBORDER) */
RECTL_vInflateRect (&bti->rcTitleBar, -UserGetSystemMetrics(SM_CXBORDER), -UserGetSystemMetrics(SM_CYBORDER));
}
}
bti->rcTitleBar.bottom = bti->rcTitleBar.top;
if (dwExStyle & WS_EX_TOOLWINDOW)
{
- /* FIXME : Note this value should exists in pWindowObject for UserGetSystemMetrics(SM_CYSMCAPTION) */
+ /* FIXME: Note this value should exists in pWindowObject for UserGetSystemMetrics(SM_CYSMCAPTION) */
bti->rcTitleBar.bottom += UserGetSystemMetrics(SM_CYSMCAPTION);
}
else
{
- /* FIXME : Note this value should exists in pWindowObject for UserGetSystemMetrics(SM_CYCAPTION) and UserGetSystemMetrics(SM_CXSIZE) */
+ /* FIXME: Note this value should exists in pWindowObject for UserGetSystemMetrics(SM_CYCAPTION) and UserGetSystemMetrics(SM_CXSIZE) */
bti->rcTitleBar.bottom += UserGetSystemMetrics(SM_CYCAPTION);
bti->rcTitleBar.left += UserGetSystemMetrics(SM_CXSIZE);
}
/*
-* COPYRIGHT: See COPYING in the top level directory
-* PROJECT: ReactOS kernel
-* PURPOSE: Messages
-* FILE: subsystems/win32/win32k/ntuser/message.c
-* PROGRAMER: Casper S. Hornstrup (chorns@users.sourceforge.net)
-*/
+ * COPYRIGHT: See COPYING in the top level directory
+ * PROJECT: ReactOS Win32k subsystem
+ * PURPOSE: Messages
+ * FILE: subsystems/win32/win32k/ntuser/message.c
+ * PROGRAMER: Casper S. Hornstrup (chorns@users.sourceforge.net)
+ */
#include <win32k.h>
DBG_DEFAULT_CHANNEL(UserMsg);
if (ProcessMask & QS_POSTMESSAGE)
{
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;
}
{
// Clear the spin cycle to fix the mix.
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;
}
if ( Window->state & WNDS_DESTROYED )
{
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;
}
if (uFlags & SMTO_ABORTIFHUNG && MsqIsHung(Window->head.pti->MessageQueue))
{
- // FIXME - Set window hung and add to a list.
- /* FIXME - Set a LastError? */
+ // FIXME: Set window hung and add to a list.
+ /* FIXME: Set a LastError? */
RETURN( FALSE);
}
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);
RETURN( FALSE);
}
}
while ((STATUS_TIMEOUT == Status) &&
(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)
{
/*
- MSDN says:
- Microsoft Windows 2000: If GetLastError returns zero, then the function
- timed out.
- XP+ : If the function fails or times out, the return value is zero.
- To get extended error information, call GetLastError. If GetLastError
- returns ERROR_TIMEOUT, then the function timed out.
-*/
+ * MSDN says:
+ * Microsoft Windows 2000: If GetLastError returns zero, then the function
+ * timed out.
+ * XP+ : If the function fails or times out, the return value is zero.
+ * To get extended error information, call GetLastError. If GetLastError
+ * returns ERROR_TIMEOUT, then the function timed out.
+ */
EngSetLastError(ERROR_TIMEOUT);
RETURN( FALSE);
}
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);
RETURN(FALSE);
}
}
// Basicly the same as IntPostOrSendMessage
- if (hWnd == HWND_BROADCAST) //Handle Broadcast
+ if (hWnd == HWND_BROADCAST) // Handle Broadcast
{
HWND *List;
PWND DesktopWindow;
/*
* COPYRIGHT: See COPYING in the top level directory
- * PROJECT: ReactOS kernel
+ * PROJECT: ReactOS Win32k subsystem
* PURPOSE: Window classes
- * FILE: subsys/win32k/ntuser/metric.c
+ * FILE: subsystems/win32/win32k/ntuser/metric.c
* PROGRAMER: Casper S. Hornstrup (chorns@users.sourceforge.net)
* Timo Kreuzer (timo.kreuzer@reactos.org)
*/
INT *piSysMet = gpsi->aiSysMet;
ULONG Width, Height;
- /* note: used for the SM_CLEANBOOT metric */
+ /* Note: used for the SM_CLEANBOOT metric */
DWORD dwValue = 0;
HKEY hKey = 0;
/* 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(RegReadDWORD(hKey, L"OptionValue", &dwValue)) piSysMet[SM_CLEANBOOT] = (INT)dwValue;
piSysMet[SM_CYVIRTUALSCREEN] = Height;
/* NC area sizes */
- piSysMet[SM_CYCAPTION] = gspv.ncm.iCaptionHeight + 1; // 19
- piSysMet[SM_CYSMCAPTION] = gspv.ncm.iSmCaptionHeight + 1; // 15;
- piSysMet[SM_CXSIZE] = 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_CYSMSIZE] = gspv.ncm.iSmCaptionHeight; // 14;
- piSysMet[SM_CXBORDER] = 1; // seems to be hardcoded
- piSysMet[SM_CYBORDER] = 1; // seems to be hardcoded
+ piSysMet[SM_CYCAPTION] = gspv.ncm.iCaptionHeight + 1; // 19
+ piSysMet[SM_CYSMCAPTION] = gspv.ncm.iSmCaptionHeight + 1; // 15;
+ piSysMet[SM_CXSIZE] = 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_CYSMSIZE] = gspv.ncm.iSmCaptionHeight; // 14;
+ piSysMet[SM_CXBORDER] = 1; // Seems to be hardcoded
+ piSysMet[SM_CYBORDER] = 1; // Seems to be hardcoded
piSysMet[SM_CXFOCUSBORDER] = 1;
piSysMet[SM_CYFOCUSBORDER] = 1;
piSysMet[SM_CXDLGFRAME] = 3;
+ piSysMet[SM_CYSIZE] + 4
+ 4 * gspv.tmCaptionFont.tmAveCharWidth
+ 2 * piSysMet[SM_CXFRAME];
- piSysMet[SM_CYMIN] = piSysMet[SM_CYCAPTION] + 2 * piSysMet[SM_CYFRAME];// 27
+ piSysMet[SM_CYMIN] = piSysMet[SM_CYCAPTION] + 2 * piSysMet[SM_CYFRAME]; // 27
piSysMet[SM_CXMAXIMIZED] = piSysMet[SM_CXSCREEN] + 2 * piSysMet[SM_CXFRAME];
piSysMet[SM_CYMAXIMIZED] = piSysMet[SM_CYSCREEN] - 20;
piSysMet[SM_CXFULLSCREEN] = piSysMet[SM_CXSCREEN];
+ 2 * piSysMet[SM_CYFRAME];
/* Icon */
- piSysMet[SM_CXVSCROLL] = gspv.ncm.iScrollWidth; //16;
- piSysMet[SM_CYVTHUMB] = gspv.ncm.iScrollHeight; //16;
- piSysMet[SM_CYHSCROLL] = gspv.ncm.iScrollWidth; //16;
- piSysMet[SM_CXHTHUMB] = gspv.ncm.iScrollHeight; //16;
- piSysMet[SM_CYVSCROLL] = gspv.ncm.iScrollHeight; // 16
- piSysMet[SM_CXHSCROLL] = gspv.ncm.iScrollHeight; // 16;
+ piSysMet[SM_CXVSCROLL] = gspv.ncm.iScrollWidth; // 16;
+ piSysMet[SM_CYVTHUMB] = gspv.ncm.iScrollHeight; // 16;
+ piSysMet[SM_CYHSCROLL] = gspv.ncm.iScrollWidth; // 16;
+ piSysMet[SM_CXHTHUMB] = gspv.ncm.iScrollHeight; // 16;
+ piSysMet[SM_CYVSCROLL] = gspv.ncm.iScrollHeight; // 16
+ piSysMet[SM_CXHSCROLL] = gspv.ncm.iScrollHeight; // 16;
piSysMet[SM_CXICON] = 32;
piSysMet[SM_CYICON] = 32;
piSysMet[SM_CXSMICON] = 16;
piSysMet[SM_CYSMICON] = 16;
- piSysMet[SM_CXICONSPACING] = gspv.im.iHorzSpacing;// 64;
- piSysMet[SM_CYICONSPACING] = gspv.im.iVertSpacing; // 64;
+ piSysMet[SM_CXICONSPACING] = gspv.im.iHorzSpacing; // 64;
+ piSysMet[SM_CYICONSPACING] = gspv.im.iVertSpacing; // 64;
piSysMet[SM_CXCURSOR] = 32;
piSysMet[SM_CYCURSOR] = 32;
- piSysMet[SM_CXMINTRACK] = piSysMet[SM_CXMIN]; // 117
- piSysMet[SM_CYMINTRACK] = piSysMet[SM_CYMIN]; // 27
+ piSysMet[SM_CXMINTRACK] = piSysMet[SM_CXMIN]; // 117
+ piSysMet[SM_CYMINTRACK] = piSysMet[SM_CYMIN]; // 27
piSysMet[SM_CXDRAG] = 4;
piSysMet[SM_CYDRAG] = 4;
- piSysMet[SM_ARRANGE] = gspv.mm.iArrange; // 8;
+ piSysMet[SM_ARRANGE] = gspv.mm.iArrange; // 8;
/* Menu */
- piSysMet[SM_CYMENU] = gspv.ncm.iMenuHeight + 1;//19;
+ piSysMet[SM_CYMENU] = gspv.ncm.iMenuHeight + 1; // 19;
piSysMet[SM_MENUDROPALIGNMENT] = gspv.bMenuDropAlign;
piSysMet[SM_CXMENUCHECK] = ((1 + gspv.tmMenuFont.tmHeight +
gspv.tmMenuFont.tmExternalLeading) & ~1) - 1; // 13;
piSysMet[SM_CYMENUCHECK] = piSysMet[SM_CXMENUCHECK];
- piSysMet[SM_CXMENUSIZE] = gspv.ncm.iMenuWidth; //18;
- piSysMet[SM_CYMENUSIZE] = gspv.ncm.iMenuHeight; //18;
+ piSysMet[SM_CXMENUSIZE] = gspv.ncm.iMenuWidth; // 18;
+ piSysMet[SM_CYMENUSIZE] = gspv.ncm.iMenuHeight; // 18;
/* Mouse */
piSysMet[SM_MOUSEPRESENT] = 1;
/*
* COPYRIGHT: See COPYING in the top level directory
- * PROJECT: ReactOS kernel
- * PURPOSE: Misc User funcs
+ * PROJECT: ReactOS Win32k subsystem
+ * PURPOSE: Miscellaneous User functions
* FILE: subsystems/win32/win32k/ntuser/misc.c
* PROGRAMER: Ge van Geldorp (ge@gse.nl)
*/
ret = (DWORD_PTR)IntGetThreadFocusWindow();
break;
case THREADSTATE_CAPTUREWINDOW:
- /* FIXME should use UserEnterShared */
+ /* FIXME: Should use UserEnterShared */
ret = (DWORD_PTR)IntGetCapture();
break;
case THREADSTATE_PROGMANWINDOW:
else
ret = ISMEX_NOTIFY;
}
- /* if ReplyMessage */
+ /* If ReplyMessage */
if (Message->QS_Flags & QS_SMRESULT) ret |= ISMEX_REPLIED;
}
BOOL
APIENTRY
NtUserGetGUIThreadInfo(
- DWORD idThread, /* if NULL use foreground thread */
+ DWORD idThread, /* If NULL use foreground thread */
LPGUITHREADINFO lpgui)
{
NTSTATUS Status;
Desktop = W32Thread->rpdesk;
}
else
- { /* get the foreground thread */
+ { /* Get the foreground thread */
Thread = PsGetCurrentThread();
W32Thread = (PTHREADINFO)Thread->Tcb.Win32Thread;
Desktop = W32Thread->rpdesk;
if (MsgQueue->MoveSize)
SafeGui.flags |= GUI_INMOVESIZE;
- /* FIXME add flag GUI_16BITTASK */
+ /* FIXME: Add flag GUI_16BITTASK */
SafeGui.hwndActive = MsgQueue->ActiveWindow;
SafeGui.hwndFocus = MsgQueue->FocusWindow;
return STATUS_SUCCESS;
}
- /* string is empty */
+ /* String is empty */
return STATUS_SUCCESS;
}
return Status;
}
- /* make sure the string is null-terminated */
+ /* Make sure the string is null-terminated */
Src = (PWSTR)((PBYTE)Dest->Buffer + Dest->Length);
*Src = L'\0';
return STATUS_SUCCESS;
}
- /* string is empty */
+ /* String is empty */
return STATUS_SUCCESS;
}
if (pti == NULL)
{
- /* FIXME - temporary hack for system threads... */
+ /* FIXME: Temporary hack for system threads... */
return NULL;
}
- /* initialize it */
+ /* Initialize it */
pti->ppi = ppi = GetW32ProcessInfo();
if (pti->rpdesk != NULL)
{
pti->pDeskInfo = NULL;
}
- /* update the TEB */
+ /* Update the TEB */
Teb = NtCurrentTeb();
pci = GetWin32ClientInfo();
pti->pClientInfo = pci;
return pti;
}
-
/* EOF */
TRACE("Attaching monitor...\n");
- /* create new monitor object */
+ /* Create new monitor object */
pMonitor = IntCreateMonitorObject();
if (pMonitor == NULL)
{
return 0;
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 */
if (pUnsafeRect != NULL)
{
rc.top += 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 */
else
{
if (mid->ButtonFlags & MOUSE_RIGHT_BUTTON_UP)
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 */
if (mid->ButtonFlags & MOUSE_BUTTON_4_DOWN)
/*
* COPYRIGHT: See COPYING in the top level directory
- * PROJECT: ReactOS kernel
+ * PROJECT: ReactOS Win32k subsystem
* PURPOSE: Message queues
* FILE: subsystems/win32/win32k/ntuser/msgqueue.c
* PROGRAMER: Casper S. Hornstrup (chorns@users.sourceforge.net)
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.message = Msg;
IntReferenceMessageQueue(MessageQueue);
- /* add it to the list of pending messages */
+ /* Add it to the list of pending messages */
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);
Message->QS_Flags = QS_SENDMESSAGE;
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)
{
UserLeaveCo();
- /* don't process messages sent to the thread */
+ /* Don't process messages sent to the thread */
WaitStatus = KeWaitForSingleObject(&CompletionEvent, UserRequest, UserMode,
FALSE, (uTimeout ? &Timeout : NULL));
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 */
Entry = MessageQueue->SentMessagesListHead.Flink;
while (Entry != &MessageQueue->SentMessagesListHead)
if ((PUSER_SENT_MESSAGE) CONTAINING_RECORD(Entry, USER_SENT_MESSAGE, ListEntry)
== 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 */
Message->CompletionEvent = NULL;
Message->Result = NULL;
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 */
Entry = ThreadQueue->DispatchingMessagesHead.Flink;
while (Entry != &ThreadQueue->DispatchingMessagesHead)
if ((PUSER_SENT_MESSAGE) CONTAINING_RECORD(Entry, USER_SENT_MESSAGE, DispatchingListEntry)
== 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
have been removed from this list by the dispatching routine right after
- dispatching the message */
+ dispatching the message */
Message->CompletionEvent = NULL;
Message->Result = NULL;
RemoveEntryList(&Message->DispatchingListEntry);
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 */
Entry = MessageQueue->SentMessagesListHead.Flink;
while (Entry != &MessageQueue->SentMessagesListHead)
if ((PUSER_SENT_MESSAGE) CONTAINING_RECORD(Entry, USER_SENT_MESSAGE, ListEntry)
== 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 */
Message->CompletionEvent = NULL;
Message->Result = NULL;
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 */
Entry = ThreadQueue->DispatchingMessagesHead.Flink;
while (Entry != &ThreadQueue->DispatchingMessagesHead)
if ((PUSER_SENT_MESSAGE) CONTAINING_RECORD(Entry, USER_SENT_MESSAGE, DispatchingListEntry)
== 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
have been removed from this list by the dispatching routine right after
- dispatching the message */
+ dispatching the message */
Message->CompletionEvent = NULL;
Message->Result = NULL;
RemoveEntryList(&Message->DispatchingListEntry);
hook.pt = msg->pt;
hook.hwnd = msg->hwnd;
hook.wHitTestCode = hittest;
- hook.dwExtraInfo = 0/*extra_info*/;
+ hook.dwExtraInfo = 0 /* extra_info */ ;
if (co_HOOK_CallHooks( WH_MOUSE, *RemoveMessages ? HC_ACTION : HC_NOREMOVE,
message, (LPARAM)&hook ))
{
hook.pt = msg->pt;
hook.hwnd = msg->hwnd;
hook.wHitTestCode = hittest;
- hook.dwExtraInfo = 0/*extra_info*/;
+ hook.dwExtraInfo = 0 /* extra_info */ ;
co_HOOK_CallHooks( WH_CBT, HCBT_CLICKSKIPPED, message, (LPARAM)&hook );
ERR("WH_MOUSE dorpped mouse message!\n");
/*
* COPYRIGHT: See COPYING in the top level directory
- * PROJECT: ReactOS kernel
+ * PROJECT: ReactOS Win32k subsystem
* 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)
*/
RtlCopyMemory(&gpsi->apfnClientW, pfnClientW, sizeof(PFNCLIENT));
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.
RtlCopyMemory(&gpsi->aStoCidPfn, pfnClientW, sizeof(gpsi->aStoCidPfn));
HMENU hMenu,
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
return 0;
}
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,
return NULL;
#if 0
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 new_size = min( ht->allocated_handles + growth, (LAST_USER_HANDLE-FIRST_USER_HANDLE+1) >> 1 );
if (new_size <= ht->allocated_handles)
}
-/* 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 )
{
PUSER_HANDLE_ENTRY entry;
}
-/* 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 )
{
PUSER_HANDLE_ENTRY entry;
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);
if (!mem)
{
return FALSE;
}
- //FIXME: make auto growable
+ // FIXME: Make auto growable
UserInitHandleTable(gHandleTable, mem, sizeof(USER_HANDLE_ENTRY) * 1024*2);
return TRUE;
}
/* Now set default headers. */
((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)
*h = hi;
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;
}
- TRACE("warning! Dereference to zero! Obj -> 0x%x\n", object);
+ TRACE("Warning! Dereference to zero! Obj -> 0x%x\n", object);
((PHEAD)object)->cLockObj = 0;
/*
* COPYRIGHT: See COPYING in the top level directory
- * PROJECT: ReactOS kernel
+ * PROJECT: ReactOS Win32k subsystem
* PURPOSE: Window painting function
* FILE: subsystems/win32/win32k/ntuser/painting.c
* PROGRAMER: Filip Navara (xnavara@volny.cz)
WndCaret = UserGetWindowObject(hWndCaret);
- //fix: check for WndCaret can be null
+ // FIXME: Check for WndCaret can be NULL
if (WndCaret == Window ||
((flags & SW_SCROLLCHILDREN) && IntIsChildWindow(Window, WndCaret)))
{
OldTextColor = IntGdiSetTextColor(hDc, IntGetSysColor(uFlags & DC_ACTIVE
? COLOR_CAPTIONTEXT : COLOR_INACTIVECAPTIONTEXT));
- //FIXME: If string doesn't fit to rc, truncate it and add ellipsis.
+ // FIXME: If string doesn't fit to rc, truncate it and add ellipsis.
GreGetTextExtentW(hDc, Text->Buffer, Text->Length/sizeof(WCHAR), &Size, 0);
GreExtTextOutW(hDc,
lpRc->left, (lpRc->top + lpRc->bottom)/2 - Size.cy/2,
RETURN( STATUS_INVALID_PARAMETER);
}
- /* copy list */
+ /* Copy list */
li = (PROPLISTITEM *)Buffer;
ListEntry = Window->PropListHead.Flink;
while((BufferSize >= sizeof(PROPLISTITEM)) && (ListEntry != &Window->PropListHead))
#define SA_SSI_REFRESH 0x0004
#define SA_SSI_REPAINT_ARROWS 0x0008
-#define SBRG_SCROLLBAR 0 /* the scrollbar itself */
-#define SBRG_TOPRIGHTBTN 1 /* the top or right button */
-#define SBRG_PAGEUPRIGHT 2 /* the page up or page right region */
-#define SBRG_SCROLLBOX 3 /* the scroll box */
-#define SBRG_PAGEDOWNLEFT 4 /* the page down or page left region */
-#define SBRG_BOTTOMLEFTBTN 5 /* the bottom or left button */
+#define SBRG_SCROLLBAR 0 /* The scrollbar itself */
+#define SBRG_TOPRIGHTBTN 1 /* The top or right button */
+#define SBRG_PAGEUPRIGHT 2 /* The page up or page right region */
+#define SBRG_SCROLLBOX 3 /* The scroll box */
+#define SBRG_PAGEDOWNLEFT 4 /* The page down or page left region */
+#define SBRG_BOTTOMLEFTBTN 5 /* The bottom or left button */
#define CHANGERGSTATE(item, status) \
if(Info->rgstate[(item)] != (status)) \
}
ThumbPos = Thumb;
- /* calculate Thumb */
+ /* Calculate Thumb */
if(cxy <= (2 * Thumb))
{
Thumb = cxy / 2;
PSCROLLBARINFO psbi;
UINT new_flags;
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);
}
}
- if (Window->pSBInfo->WSBflags != new_flags) /* check arrow flags */
+ if (Window->pSBInfo->WSBflags != new_flags) /* Check arrow flags */
{
Window->pSBInfo->WSBflags = new_flags;
action |= SA_SSI_REPAINT_ARROWS;
if (Window->pSBInfo && Window->pSBInfoex)
{
- /* no need to create it anymore */
+ /* No need to create it anymore */
return TRUE;
}
- /* allocate memory for all scrollbars (HORZ, VERT, CONTROL) */
+ /* Allocate memory for all scrollbars (HORZ, VERT, CONTROL) */
Size = 3 * (sizeof(SBINFOEX));
if(!(Window->pSBInfoex = ExAllocatePoolWithTag(PagedPool, Size, TAG_SBARINFO)))
{
if (fShowH) set_bits |= WS_HSCROLL;
else clear_bits |= WS_HSCROLL;
if( nBar == SB_HORZ ) break;
- /* fall through */
+ /* Fall through */
case SB_VERT:
if (fShowV) set_bits |= WS_VSCROLL;
else clear_bits |= WS_VSCROLL;
{
case SB_BOTH:
InfoV = IntGetScrollbarInfoFromWindow(Window, SB_VERT);
- /* fall through */
+ /* Fall through */
case SB_HORZ:
InfoH = IntGetScrollbarInfoFromWindow(Window, SB_HORZ);
break;
* COPYRIGHT: GPL, see COPYING in the top level directory
* PROJECT: ReactOS win32 kernel mode subsystem server
* 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)
*/
// TODO:
-// - check all values that are in Winsta in ros
-// - does setting invalid fonts work?
-// - save appropriate text metrics
+// - Check all values that are in Winsta in ROS.
+// - Does setting invalid fonts work?
+// - Save appropriate text metrics.
#include <win32k.h>
DBG_DEFAULT_CHANNEL(UserSysparams);
// gspv.tmMenuFont.tmExternalLeading);
if (gspv.iDblClickTime == 0) gspv.iDblClickTime = 500;
- // FIXME: hack!!!
+ // FIXME: Hack!!!
gspv.tmMenuFont.tmHeight = 11;
gspv.tmMenuFont.tmExternalLeading = 2;
case SPI_SETWORKAREA:
{
- /*FIXME: we should set the work area of the monitor
- that contains the specified rectangle*/
+ /* FIXME: We should set the work area of the monitor
+ that contains the specified rectangle */
PMONITOR pmonitor = IntGetPrimaryMonitor();
RECT rcWorkArea;
pmonitor->rcWork = rcWorkArea;
if (fl & SPIF_UPDATEINIFILE)
{
- // FIXME: what to do?
+ // FIXME: What to do?
}
return (UINT_PTR)KEY_DESKTOP;
}
return 0;
if (fl & SPIF_UPDATEINIFILE)
{
- // FIXME: what to do?
+ // FIXME: What to do?
}
return (UINT_PTR)KEY_DESKTOP;
return 0;
if (fl & SPIF_UPDATEINIFILE)
{
- // FIXME: what to do?
+ // FIXME: What to do?
}
return (UINT_PTR)KEY_DESKTOP;
return 0;
if (fl & SPIF_UPDATEINIFILE)
{
- // FIXME: what to do?
+ // FIXME: What to do?
}
return (UINT_PTR)KEY_DESKTOP;
return 0;
if (fl & SPIF_UPDATEINIFILE)
{
- // FIXME: what to do?
+ // FIXME: What to do?
}
return (UINT_PTR)KEY_DESKTOP;
return 0;
if (fl & SPIF_UPDATEINIFILE)
{
- // FIXME: what to do?
+ // FIXME: What to do?
}
return (UINT_PTR)KEY_DESKTOP;
return 0;
if (fl & SPIF_UPDATEINIFILE)
{
- // FIXME: what to do?
+ // FIXME: What to do?
}
return (UINT_PTR)KEY_DESKTOP;
return 0;
if (fl & SPIF_UPDATEINIFILE)
{
- // FIXME: what to do?
+ // FIXME: What to do?
}
return (UINT_PTR)KEY_DESKTOP;
return 0;
if (fl & SPIF_UPDATEINIFILE)
{
- // FIXME: what to do?
+ // FIXME: What to do?
}
return (UINT_PTR)KEY_DESKTOP;
return 0;
if (fl & SPIF_UPDATEINIFILE)
{
- // FIXME: what to do?
+ // FIXME: What to do?
}
return (UINT_PTR)KEY_DESKTOP;
return SpiGetInt(pvParam, &gspv.iMouseHoverTime, fl);
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
* only if they do not have SP install
* " Windows Server 2003 and Windows XP: The operating system does not
TRACE("Enter NtUserSystemParametersInfo(%d)\n", uiAction);
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 */
fWinIni |= SPIF_PROTECT;
return bResult;
}
+
+/* EOF */
WindowLessTimersBitMapBuffer,
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);
ExInitializeResourceLite(&TimerLock);
return Ret;
}
-
/* EOF */
/*
- * PROJECT: ReactOS Kernel
+ * PROJECT: ReactOS Win32k subsystem
* LICENSE: GPL - See COPYING in the top level directory
* FILE: subsystems/win32/win32k/ntuser/windc.c
* PURPOSE: Window DC management
- * COPYRIGHT: Copyright 2007 ReactOS
- */
+ * COPYRIGHT: Copyright 2007 ReactOS Team
+ */
#include <win32k.h>
DBG_DEFAULT_CHANNEL(UserDce);
/* 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! */
static LIST_ENTRY LEDce;
DCU_SetDcUndeletable(pDce->hDC);
- if (Type == DCE_WINDOW_DC || Type == DCE_CLASS_DC) //Window DCE have ownership.
+ if (Type == DCE_WINDOW_DC || Type == DCE_CLASS_DC) // Window DCE have ownership.
{
pDce->ptiOwner = GetW32ThreadInfo();
}
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;
}
return 0;
}
- /* restore previous visible region */
+ /* Restore previous visible region */
if ((dce->DCXFlags & (DCX_INTERSECTRGN | DCX_EXCLUDERGN)) &&
((dce->DCXFlags & DCX_CACHE) || EndPaint))
{
{
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);
// Clean the DC
if (dce->DCXFlags & DCX_DCEDIRTY)
{
- /* don't keep around invalidated entries
+ /* Don't keep around invalidated entries
* because SetDCState() disables hVisRgn updates
* by removing dirty bit. */
dce->hwndCurrent = 0;
if (Flags & DCX_USESTYLE)
{
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)
{
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_PARENTCLIP)
Dce->DCXFlags = Flags | DCX_DCEBUSY;
/*
- Bump it up! This prevents the random errors in wine dce tests and with
- proper bits set in DCX_CACHECOMPAREMASK.
- Reference:
- http://www.reactos.org/archives/public/ros-dev/2008-July/010498.html
- http://www.reactos.org/archives/public/ros-dev/2008-July/010499.html
+ * Bump it up! This prevents the random errors in wine dce tests and with
+ * proper bits set in DCX_CACHECOMPAREMASK.
+ * Reference:
+ * http://www.reactos.org/archives/public/ros-dev/2008-July/010498.html
+ * http://www.reactos.org/archives/public/ros-dev/2008-July/010499.html
*/
if (pLE != &LEDce)
{
GreGetObjectOwner(pdce->hDC) != GDI_OBJ_HMGR_POWNED)
{
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))
{
GreSetDCOwner(pdce->hDC, GDI_OBJ_HMGR_POWNED);
if ( pDCE->hwndCurrent == Window->head.h &&
!(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 (pDCE->DCXFlags & (DCX_INTERSECTRGN | DCX_EXCLUDERGN)) /* Class DCE*/
+ if (pDCE->DCXFlags & (DCX_INTERSECTRGN | DCX_EXCLUDERGN)) /* Class DCE */
DceDeleteClipRgn(pDCE);
// Update and reset Vis Rgn and clear the dirty bit.
// Should release VisRgn than reset it to default.
}
/* 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);
if (!pDCE) break;
}
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
* this should be a TRACE. But this is best left as an ERR
return oldPal;
}
-
/* EOF */
/*
* COPYRIGHT: See COPYING in the top level directory
- * PROJECT: ReactOS kernel
+ * PROJECT: ReactOS Win32k subsystem
* PURPOSE: Windows
* FILE: subsystems/win32/win32k/ntuser/window.c
* PROGRAMER: Casper S. Hornstrup (chorns@users.sourceforge.net)
return Window;
}
-/* temp hack */
+/* Temp HACK */
PWND FASTCALL UserGetWindowObject(HWND hWnd)
{
PWND Window;
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
- here forever...
- */
+ * FIXME: It is critical that the window removes itself! If now, we will loop
+ * here forever...
+ */
//ASSERT(co_UserDestroyWindow(Wnd));
- UserRefObjectCo(Wnd, &Ref);//faxme: temp hack??
+ UserRefObjectCo(Wnd, &Ref); // FIXME: Temp HACK??
if (!co_UserDestroyWindow(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??
}
}
if(W32Thread->rpdesk->rpwinstaParent->SystemMenuTemplate)
{
- /* clone system menu */
+ /* Clone system menu */
Menu = UserGetMenuObject(W32Thread->rpdesk->rpwinstaParent->SystemMenuTemplate);
if(!Menu)
return NULL;
}
/*
- link the window into siblings list
+ Link the window into siblings list
children and parent are kept in place.
*/
VOID FASTCALL
WndOldParent = Wnd->spwndParent;
- if (WndOldParent) UserReferenceObject(WndOldParent); /* caller must deref */
+ if (WndOldParent) UserReferenceObject(WndOldParent); /* Caller must deref */
if (WndNewParent != WndOldParent)
{
/* Set the new parent */
Wnd->spwndParent = WndNewParent;
- /* Link the window with its new siblings*/
+ /* Link the window with its new siblings */
IntLinkHwnd(Wnd, HWND_TOP);
}
| (WasVisible ? SWP_SHOWWINDOW : 0));
/*
- * FIXME: a WM_MOVE is also generated (in the DefWindowProc handler
- * for WM_WINDOWPOSCHANGED) in Windows, should probably remove SWP_NOMOVE
+ * FIXME: A WM_MOVE is also generated (in the DefWindowProc handler
+ * for WM_WINDOWPOSCHANGED) in Windows, should probably remove SWP_NOMOVE.
*/
if (WasVisible) co_WinPosShowWindow(Wnd, SW_SHOWNORMAL);
if(Menu)
{
- /* FIXME check window style, propably return FALSE ? */
+ /* FIXME: Check window style, propably return FALSE? */
Window->SystemMenu = Menu->MenuInfo.Self;
Menu->MenuInfo.Flags |= MF_SYSMENU;
}
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
IntUnlinkWindow(PWND Wnd)
{
#undef IS_DEFAULT
}
-/* Allocates and initializes a window*/
+/* Allocates and initializes a window */
PWND FASTCALL IntCreateWindow(CREATESTRUCTW* Cs,
PLARGE_STRING WindowName,
PCLS Class,
Cs->dwExStyle |= WS_EX_LAYOUTRTL;
}
else
- {/*
- Note from MSDN http://msdn.microsoft.com/en-us/library/aa913269.aspx :
-
- Dialog boxes and message boxes do not inherit layout, so you must
- set the layout explicitly.
- */
+ { /*
+ * Note from MSDN <http://msdn.microsoft.com/en-us/library/aa913269.aspx>:
+ *
+ * Dialog boxes and message boxes do not inherit layout, so you must
+ * set the layout explicitly.
+ */
if ( Class->fnid != FNID_DIALOG)
{
PPROCESSINFO ppi = PsGetCurrentProcessWin32Process();
TRACE("Created object with handle %X\n", hWnd);
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 */
pti->rpdesk->DesktopWindow = hWnd;
pti->rpdesk->pDeskInfo->spwnd = pWnd;
/*
* Fill out the structure describing it.
*/
- /* Remember, pWnd->head is setup in object.c ...*/
+ /* Remember, pWnd->head is setup in object.c ... */
pWnd->spwndParent = ParentWindow;
pWnd->spwndOwner = OwnerWindow;
pWnd->fnid = 0;
No where can I see in code or through testing does the window change back
to ANSI after being created as UNICODE in ROS. I didnt do more testing to
- see what problems this would cause.*/
+ see what problems this would cause. */
// Set WndProc from Class.
pWnd->lpfnWndProc = pWnd->pcls->lpfnWndProc;
}
else
{ /*
- It seems there can be both an Ansi creator and Unicode Class Window
- WndProc, unless the following overriding conditions occur:
- */
+ * It seems there can be both an Ansi creator and Unicode Class Window
+ * WndProc, unless the following overriding conditions occur:
+ */
if ( !bUnicodeWindow &&
( Class->atomClassName == gpsi->atomSysClass[ICLS_BUTTON] ||
Class->atomClassName == gpsi->atomSysClass[ICLS_COMBOBOX] ||
if (!(pWnd->style & (WS_CHILD | WS_POPUP)))
pWnd->state |= WNDS_SENDSIZEMOVEMSGS;
- /* create system menu */
- if((Cs->style & WS_SYSMENU) )//&& (dwStyle & WS_CAPTION) == WS_CAPTION)
+ /* Create system menu */
+ if ((Cs->style & WS_SYSMENU)) // && (dwStyle & WS_CAPTION) == WS_CAPTION)
{
SystemMenu = IntGetSystemMenu(pWnd, TRUE, TRUE);
if(SystemMenu)
/* Insert the window into the thread's window list. */
InsertTailList (&pti->WindowListHead, &pWnd->ThreadListEntry);
- /* Handle "CS_CLASSDC", it is tested first. */
+ /* Handle "CS_CLASSDC", it is tested first. */
if ( (pWnd->pcls->style & CS_CLASSDC) && !(pWnd->pcls->pdce) )
{ /* One DCE per class to have CLASS. */
pWnd->pcls->pdce = DceAllocDCE( pWnd, DCE_CLASS_DC );
if (pti == NULL || pti->rpdesk == NULL)
{
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;
ObReferenceObjectByPointer(WinSta, KernelMode, ExWindowStationObjectType, 0);
pCsw = NULL;
pCbtCreate = NULL;
- /* Get the class and reference it*/
+ /* Get the class and reference it */
Class = IntGetAndReferenceClass(ClassName, Cs->hInstance);
if(!Class)
{
ParentWindow = hWndParent ? UserGetWindowObject(hWndParent): NULL;
OwnerWindow = hWndOwner ? UserGetWindowObject(hWndOwner): NULL;
- /* FIXME: is this correct?*/
+ /* FIXME: Is this correct? */
if(OwnerWindow)
OwnerWindow = UserGetAncestor(OwnerWindow, GA_ROOT);
Cs->lpszName = (LPCWSTR) WindowName;
Cs->lpszClass = (LPCWSTR) ClassName;
- /* Send the WM_GETMINMAXINFO message*/
+ /* Send the WM_GETMINMAXINFO message */
Size.cx = Cs->cx;
Size.cy = Cs->cy;
}
Window->rcClient = Window->rcWindow;
- /* Link the window*/
+ /* Link the window */
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)
IntLinkHwnd(Window, HWND_BOTTOM);
else
goto cleanup;
}
- /* Send the EVENT_OBJECT_CREATE event*/
+ /* Send the EVENT_OBJECT_CREATE event */
IntNotifyWinEvent(EVENT_OBJECT_CREATE, Window, OBJID_WINDOW, CHILDID_SELF, 0);
/* By setting the flag below it can be examined to determine if the window
PTHREADINFO ti;
MSG msg;
- ASSERT_REFS_CO(Window); // FIXME: temp hack?
+ ASSERT_REFS_CO(Window); // FIXME: Temp HACK?
hWnd = Window->head.h;
if (IntWndBelongsToThread(Child, PsGetCurrentThreadWin32Thread()))
{
USER_REFERENCE_ENTRY ChildRef;
- UserRefObjectCo(Child, &ChildRef);//temp hack?
+ UserRefObjectCo(Child, &ChildRef); // Temp HACK?
co_UserDestroyWindow(Child);
- UserDerefObjectCo(Child);//temp hack?
+ UserDerefObjectCo(Child); // Temp HACK?
GotOne = TRUE;
continue;
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);
- UserDerefObjectCo(Window);//faxme: dunno if win should be reffed during destroy..
+ UserDerefObjectCo(Window); // FIXME: Dunno if win should be reffed during destroy...
RETURN(ret);
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
Parent is the desktop window??? */
PWND MsgWindows;
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
// RepaintButton, StaticRepaint, NtUserCallHwndLock HWNDLOCK_ROUTINE_REDRAWFRAMEANDHOOK, etc.
/* Send shell notifications */
if (WndTo) UserRefObjectCo(WndTo, &Ref);
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))
{
UserDerefObjectCo(WndTo);
}
}
- 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);
if (WndTo) UserDerefObjectCo(WndTo);
if (MaxTrack)
*MaxTrack = MinMax.ptMaxTrackSize;
- return 0; //FIXME: what does it return?
+ return 0; // FIXME: What does it return?
}
static
}
- //temphack
+ // Temp HACK
ThreadFocusWindow = UserGetWindowObject(IntGetThreadFocusWindow());
/* Revert focus to parent */
*/
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);
}
}
pt.x = X;
pt.y = Y;
- //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...
+ // Hmm... Threads live on desktops thus we have a reference on the desktop and indirectly the desktop window.
+ // It is possible this referencing is useless, though it should not hurt...
UserRefObjectCo(DesktopWindow, &Ref);
//pti = PsGetCurrentThreadWin32Thread();
/*
* COPYRIGHT: See COPYING in the top level directory
- * PROJECT: ReactOS kernel
+ * PROJECT: ReactOS Win32k subsystem
* PURPOSE: Window stations
- * FILE: subsys/win32k/ntuser/winsta.c
+ * FILE: subsystems/win32/win32k/ntuser/winsta.c
* PROGRAMER: Casper S. Hornstrup (chorns@users.sourceforge.net)
* TODO: The process window station is created on
* the first USER32/GDI32 call not related
/* Currently active window station */
PWINSTATION_OBJECT InputWindowStation = NULL;
-/* Winlogon sas window*/
+/* Winlogon SAS window */
HWND hwndSAS = NULL;
/* INITALIZATION FUNCTIONS ****************************************************/
NtGdiSelectFont(hSystemBM, NtGdiGetStockObject(SYSTEM_FONT));
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->BitsPixel = NtGdiGetDeviceCaps(ScreenDeviceContext, BITSPIXEL);
gpsi->BitCount = gpsi->Planes * gpsi->BitsPixel;
}
/*
- * 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);
#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) \
ret = ret && IntEngLineTo(&psurf->SurfObj, \
*/
/*
- * 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 down again, including correct rounding
* and avoiding floating point arithmatic
#define BEZIERSHIFTUP(x) ((x)<<BEZIERSHIFTBITS)
#define BEZIERPIXEL BEZIERSHIFTUP(1)
#define BEZIERSHIFTDOWN(x) (((x)+(1<<(BEZIERSHIFTBITS-1)))>>BEZIERSHIFTBITS)
-/* maximum depth of recursion */
+/* Maximum depth of recursion */
#define BEZIERMAXDEPTH 8
-/* size of array to store points on */
+/* Size of array to store points on */
/* enough for one curve */
#define BEZIER_INITBUFSIZE (150)
-/* calculate Bezier average, in this case the middle
+/* Calculate Bezier average, in this case the middle
* correctly rounded...
* */
dx=Points[3].x-Points[0].x;
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[3].x )
return TRUE;
}
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[3].y)
(*PtsOut)[*nPtsOut].y = BEZIERSHIFTDOWN(Points[3].y);
(*nPtsOut) ++;
} else {
- POINT Points2[4]; /* for the second recursive call */
+ POINT Points2[4]; /* For the second recursive call */
Points2[3]=Points[3];
BEZIERMIDDLE(Points2[2], Points[2], Points[3]);
BEZIERMIDDLE(Points2[0], Points[1], Points[2]);
Points2[0]=Points[3];
- /* do the two halves */
+ /* Do the two halves */
GDI_InternalBezier(Points, PtsOut, dwOut, nPtsOut, level-1);
GDI_InternalBezier(Points2, PtsOut, dwOut, nPtsOut, level-1);
}
EXLATEOBJ_vInitXlateFromDCs(&exlo, DCSrc, DCDest);
/* Perform the alpha blend operation */
- DPRINT("Performing the alpha Blend\n");
+ DPRINT("Performing the alpha blend\n");
bResult = IntEngAlphaBlend(&BitmapDest->SurfObj,
&BitmapSrc->SurfObj,
DCDest->rosdc.CombinedClip,
IN FLONG fl)
{
/* Forward to NtGdiMaskBlt */
- // TODO : what's fl for?
+ // TODO: What's fl for?
return NtGdiMaskBlt(hDCDest,
XDest,
YDest,
return TRUE;
}
-
BOOL APIENTRY
NtGdiPatBlt(
HDC hDC,
BOOL UsesSource = ROP_USES_SOURCE(ROP);
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);
}
/* Call the extended function */
return GreCreateBitmapEx(nWidth,
nHeight,
- 0, /* auto width */
+ 0, /* Auto width */
BitmapFormat(cBitsPixel * cPlanes, BI_RGB),
- 0, /* no bitmap flags */
- 0, /* auto size */
+ 0, /* No bitmap flags */
+ 0, /* Auto size */
pvBits,
DDB_SURFACE /* DDB */);
}
psurf->ppal = PALETTE_ShareLockPalette(Dc->ppdev->devinfo.hpalDefault);
/* Set flags */
psurf->flags = API_BITMAP;
- psurf->hdc = NULL; // Fixme
+ psurf->hdc = NULL; // FIXME:
SURFACE_ShareUnlockSurface(psurf);
}
else
GDIOBJ_vReferenceObjectByPointer((POBJ)psurf->ppal);
/* Set flags */
psurfBmp->flags = API_BITMAP;
- psurfBmp->hdc = NULL; // Fixme
+ psurfBmp->hdc = NULL; // FIXME:
SURFACE_ShareUnlockSurface(psurfBmp);
}
else if (Count == sizeof(DIBSECTION))
NtGdiGetPixel(HDC hDC, INT XPos, INT YPos)
{
PDC dc = NULL;
- COLORREF Result = (COLORREF)CLR_INVALID; // default to failure
+ COLORREF Result = (COLORREF)CLR_INVALID; // Default to failure
BOOL bInRect = FALSE;
SURFACE *psurf;
SURFOBJ *pso;
{
pso = &psurf->SurfObj;
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
{
ASSERT(pso->lDelta);
}
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)
{
// FIXME: create a 1x1 32BPP DIB, and blit to it
NtGdiBitBlt(hDCTmp, 0, 0, 1, 1, hDC, XPos, YPos, SRCCOPY, 0, 0);
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);
if (psurf)
{
/* Don't copy more bytes than the buffer has */
Bytes = min(Bytes, bmSize);
- // FIXME: use MmSecureVirtualMemory
+ // FIXME: Use MmSecureVirtualMemory
_SEH2_TRY
{
ProbeForWrite(pUnsafeBits, Bytes, 1);
if (!buffer) return sizeof(BITMAP);
if ((UINT)Count < sizeof(BITMAP)) return 0;
- /* always fill a basic BITMAP structure */
+ /* Always fill a basic BITMAP structure */
pBitmap = buffer;
pBitmap->bmType = 0;
pBitmap->bmWidth = psurf->SurfObj.sizlBitmap.cx;
pds->dsBmih.biCompression = BI_PNG;
break;
default:
- ASSERT(FALSE); /* this shouldn't happen */
+ ASSERT(FALSE); /* This shouldn't happen */
}
pds->dsBmih.biSizeImage = psurf->SurfObj.cjBits;
}
else
{
- /* not set according to wine test, confirmed in win2k */
+ /* Not set according to wine test, confirmed in win2k */
pBitmap->bmBits = NULL;
}
{
// Allow user access to User Data.
GDIOBJ_vSetObjectAttr(&pbr->BaseObject, pbr->pBrushAttr);
- // FIXME: allocate brush attr
+ // FIXME: Allocate brush attr
}
GDIOBJ_vSetObjectOwner(&pbr->BaseObject, ulOwner);
/* Set Hatch */
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;
}
else
/*
* COPYRIGHT: GNU GPL, See COPYING in the top level directory
- * PROJECT: ReactOS kernel
+ * PROJECT: ReactOS Win32k subsystem
* PURPOSE: Clip region functions
- * FILE: subsys/win32k/objects/cliprgn.c
+ * FILE: subsystems/win32/win32k/objects/cliprgn.c
* PROGRAMER: Unknown
*/
//HRGN hRgnVis;
PREGION prgnClip, prgnGCClip;
- // would prefer this, but the rest of the code sucks
-// ASSERT(Dc->rosdc.hGCClipRgn);
-// ASSERT(Dc->rosdc.hClipRgn);
+ /* Would prefer this, but the rest of the code sucks... */
+ //ASSERT(Dc->rosdc.hGCClipRgn);
+ //ASSERT(Dc->rosdc.hClipRgn);
ASSERT(Dc->prgnVis);
//hRgnVis = Dc->prgnVis->BaseObject.hHmgr;
IntGdiCombineRgn(prgnGCClip, Dc->prgnVis, NULL, RGN_COPY);
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);
REGION_UnlockRgn(prgnClip);
}
HRGN hrgn,
int fnMode)
{
- // dc->fs &= ~DC_FLAG_DIRTY_RAO;
+ // dc->fs &= ~DC_FLAG_DIRTY_RAO;
if (!hrgn)
{
RECTL rect;
if(dc->prgnVis)
{
- REGION_GetRgnBox(dc->prgnVis, &rect);
+ REGION_GetRgnBox(dc->prgnVis, &rect);
dc->rosdc.hClipRgn = IntSysCreateRectRgnIndirect(&rect);
}
else
INT retval;
PDC dc;
PROSRGNDATA pRgnNew, pRgn = NULL;
- BOOL Unlock = FALSE; //Small hack
+ BOOL Unlock = FALSE; // Small HACK
if (!(dc = DC_LockDc(hDC)))
{
return ERROR;
}
- /* FIXME! Rao and Vis only! */
+ /* FIXME: Rao and Vis only! */
if (dc->prgnAPI) // APIRGN
{
pRgn = dc->prgnAPI;
* COPYRIGHT: GNU GPL, See COPYING in the top level directory
* PROJECT: ReactOS kernel
* PURPOSE: Coordinate systems
- * FILE: subsys/win32k/objects/coord.c
+ * FILE: subsystems/win32/win32k/objects/coord.c
* PROGRAMER: Unknown
*/
}
}
-// 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
IntGdiCombineTransform(
LPXFORM XFormResult,
return TRUE;
}
-// FIXME: should be XFORML and use XFORMOBJ functions
+// FIXME: Should be XFORML and use XFORMOBJ functions
BOOL
APIENTRY
NtGdiCombineTransform(
_SEH2_TRY
{
- /* pointer was already probed! */
+ /* Pointer was already probed! */
RtlCopyMemory(UnsafePtOut, Points, Size);
}
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
DWORD Mode)
{
PDC dc;
- XFORM SafeXForm; //FIXME: use XFORML
+ XFORM SafeXForm; // FIXME: Use XFORML
BOOL Ret = TRUE;
dc = DC_LockDc(hDC);
#define NDEBUG
#include <debug.h>
-//FIXME: windows uses 0x0012009f
+// FIXME: Windows uses 0x0012009f
#define DIRTY_DEFAULT DIRTY_CHARSET|DIRTY_BACKGROUND|DIRTY_TEXT|DIRTY_LINE|DIRTY_FILL
PSURFACE psurfDefaultBitmap = 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
#define FLOATOBJ_0 {0x00000000, 0x00000000}
#define FLOATOBJ_1 {0x40000000, 0x00000002}
pdc->erclBounds.bottom = 0;
pdc->erclBoundsApp = pdc->erclBounds;
pdc->erclClip = pdc->erclWindow;
-// pdc->co = NULL
+ //pdc->co = NULL
}
-// pdc->dcattr.VisRectRegion:
+ //pdc->dcattr.VisRectRegion:
/* Setup coordinate transformation data */
pdc->dclevel.mxWorldToDevice = gmxWorldToDeviceDefault;
DC_UnlockDc(pdc);
- DPRINT("returning hdc = %p\n", hdc);
+ DPRINT("Returning hdc = %p\n", hdc);
return hdc;
}
DC_UnlockDc(DCToDelete);
if(UserReleaseDC(NULL, hDC, FALSE))
{
- /* ReactOs feature : call UserReleaseDC
- * I don't think windows does it.
+ /* ReactOS feature: Call UserReleaseDC
+ * I don't think Windows does it.
* Still, complain, no one should ever call DeleteDC
* on a window DC */
DPRINT1("No, you naughty application!\n");
NtGdiDeleteObjectApp(HANDLE hobj)
{
/* 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_GET_TYPE(hobj) != GDI_OBJECT_TYPE_DC)
return GreDeleteObject(hobj);
- // FIXME: everything should be callback based
+ // FIXME: Everything should be callback based
return IntGdiDeleteDC(hobj, FALSE);
}
/*
* COPYRIGHT: See COPYING in the top level directory
- * PROJECT: ReactOS kernel
+ * PROJECT: ReactOS Win32k subsystem
* 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)
*/
HPALETTE oldPal = NULL;
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);
if (!pdc)
{
/* Unlock the DC */
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,
0,
sizlBitmap.cx,
return SelObject;
}
-/* See wine, msdn, osr and Feng Yuan - Windows Graphics Programming Win32 Gdi And Directdraw
-
- 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!
- Go back and read 7.2 Clipping pages 418-19:
- Rao = API & Vis:
- 1) The Rao region is the intersection of the API region and the system region,
- named after the Microsoft engineer who initially proposed it.
- 2) The Rao region can be calculated from the API region and the system region.
-
- API:
- 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.
-*/
+/* See WINE, MSDN, OSR and Feng Yuan - Windows Graphics Programming Win32 GDI and DirectDraw
+ *
+ * 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!
+ * Go back and read 7.2 Clipping pages 418-19:
+ * Rao = API & Vis:
+ * 1) The Rao region is the intersection of the API region and the system region,
+ * named after the Microsoft engineer who initially proposed it.
+ * 2) The Rao region can be calculated from the API region and the system region.
+ *
+ * API:
+ * 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.
+ */
INT
APIENTRY
NtGdiGetRandomRgn(
return 0;
}
+/* EOF */
/*
* COPYRIGHT: See COPYING in the top level directory
- * PROJECT: ReactOS kernel
+ * PROJECT: ReactOS Win32k subsystem
* 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)
*/
DC_vSelectLineBrush(pdcDst, pdcSrc->dclevel.pbrLine);
DC_vSelectPalette(pdcDst, pdcSrc->dclevel.ppal);
- // FIXME: handle refs
+ // FIXME: Handle refs
pdcDst->dclevel.plfnt = pdcSrc->dclevel.plfnt;
/* Get/SetDCState() don't change hVisRgn field ("Undoc. Windows" p.559). */
pdcDst->rosdc.hClipRgn = IntSysCreateRectRgn(0, 0, 0, 0);
NtGdiCombineRgn(pdcDst->rosdc.hClipRgn, pdcSrc->rosdc.hClipRgn, 0, RGN_COPY);
}
- // FIXME! Handle prgnMeta!
+ // FIXME: Handle prgnMeta!
}
else // Copy "!To" RestoreDC state.
{ /* The VisRectRegion field needs to be set to a valid state */
DC_vInitDc(pdcSave, DCTYPE_MEMORY, pdc->ppdev);
/* Handle references here correctly */
-// pdcSrc->dclevel.pSurface = NULL;
-// pdcSrc->dclevel.pbrFill = NULL;
-// pdcSrc->dclevel.pbrLine = NULL;
-// pdcSrc->dclevel.ppal = NULL;
+ //pdcSrc->dclevel.pSurface = NULL;
+ //pdcSrc->dclevel.pbrFill = NULL;
+ //pdcSrc->dclevel.pbrLine = NULL;
+ //pdcSrc->dclevel.ppal = NULL;
/* 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);
/* Copy the current state */
if (pdc->dctype == DCTYPE_MEMORY)
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.flPath = pdc->dclevel.flPath | DCPATH_SAVESTATE;
if (pdcSave->dclevel.hPath) pdcSave->dclevel.flPath |= DCPATH_SAVE;
return lSaveDepth;
}
+/* EOF */
-
#include <win32k.h>
#define NDEBUG
rclWnd.bottom = pdc->dclevel.sizl.cy;
rclClip = rclWnd;
-// EngAcquireSemaphoreShared(pdc->ppdev->hsemDevLock);
+ //EngAcquireSemaphoreShared(pdc->ppdev->hsemDevLock);
if (pdc->ppdev->flFlags & PDEV_META_DEVICE)
{
pSurface = pdc->dclevel.pSurface;
rclClip.bottom += pdc->ppdev->ptlOrigion.y;
}
}
-// EngReleaseSemaphore(pdc->ppdev->hsemDevLock);
+ //EngReleaseSemaphore(pdc->ppdev->hsemDevLock);
prgn = pdc->prgnVis;
pdc->ptlDCOrig.y = 0;
pdc->erclWindow = rclWnd;
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.y = pdc->dcattr.VisRectRegion.Rect.bottom;
return TRUE;
return 0;
}
- wRet = dc->fs & DC_FLAG_DIRTY_RAO; // Fixme wrong flag!
-
- /* "Undocumented Windows" info is slightly confusing.
- */
+ wRet = dc->fs & DC_FLAG_DIRTY_RAO; // FIXME: Wrong flag!
+ /* Info in "Undocumented Windows" is slightly confusing. */
DPRINT("DC %p, Flags %04x\n", hDC, Flags);
if (Flags & DCHF_INVALIDATEVISRGN)
SURFOBJ *pso;
BOOL calledFromUser;
- calledFromUser = UserIsEntered(); //fixme: possibly upgrade a shared lock
+ calledFromUser = UserIsEntered(); // FIXME: Possibly upgrade a shared lock
if (!calledFromUser)
{
UserEnterExclusive();
}
- /* attach monitor */
+ /* Attach monitor */
IntAttachMonitor(gppdevPrimary, 0);
DPRINT("IntCreatePrimarySurface, pPrimarySurface=%p, pPrimarySurface->pSurface = %p\n",
if(!(psurfSrc && psurfDst))
{
- DPRINT1("Error, could not lock surfaces\n");
+ DPRINT1("Error: Could not lock surfaces\n");
goto cleanup;
}
IN OPTIONAL LPBYTE pjInit,
IN LPBITMAPINFO pbmi,
IN DWORD dwUsage,
- IN DWORD dwRop, // ms ntgdi.h says dwRop4(?)
+ IN DWORD dwRop, // MS ntgdi.h says dwRop4(?)
IN UINT cjMaxInfo,
IN UINT cjMaxBits,
IN HANDLE hcmXform)
}
_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)))
{
DPRINT1("Could not lock dc\n");
else
{
/* For DIB Brushes */
- DPRINT1("FIXME : Unsupported DIB_PAL_COLORS without a DC to map colors.\n");
+ DPRINT1("FIXME: Unsupported DIB_PAL_COLORS without a DC to map colors.\n");
/* HACK */
hpal = (HPALETTE) 0xFFFFFFFF;
}
if(!hpal)
{
- DPRINT1("Error : Could not create a palette for the DIB.\n");
+ DPRINT1("Error: Could not create a palette for the DIB.\n");
goto cleanup;
}
cleanup:
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)
{
// MmUnsecureVirtualMemory(hSecure); // FIXME: Implement this!
*size = 0;
return 0;
}
- if (header->biSize >= sizeof(BITMAPINFOHEADER)) /* assume BITMAPINFOHEADER */
+ if (header->biSize >= sizeof(BITMAPINFOHEADER)) /* Assume BITMAPINFOHEADER */
{
*width = header->biWidth;
*height = header->biHeight;
return sizeof(BITMAPCOREHEADER) + colors *
((coloruse == DIB_RGB_COLORS) ? sizeof(RGBTRIPLE) : sizeof(WORD));
}
- else /* assume BITMAPINFOHEADER */
+ else /* Assume BITMAPINFOHEADER */
{
colors = info->bmiHeader.biClrUsed;
if (colors > 256) colors = 256;
}
else if (Usage == DIB_PAL_COLORS)
{
- /* Invalid at high Res */
+ /* Invalid at high-res */
return NULL;
}
ExFreePoolWithTag(converted, TAG_DIB);
}
-
-
-
-
-
/* EOF */
typedef struct _Rect
{
- int x, y; /* top-left point inside rect */
- int width, height; /* width and height of rect */
+ int x, y; /* Top-left point inside rect */
+ int width, height; /* Width and height of rect */
} Rect, *PRect;
int FASTCALL IntFillRect(DC *dc, INT XLeft, INT YLeft, INT Width, INT Height, PBRUSH pbrush, BOOL Pen);
if (T + A2*Y < XCRIT) /* E(X+1,Y-1/2) <= 0 */
{
- /* move outwards to encounter edge */
+ /* Move outwards to encounter edge */
X += 1;
T += DXT;
DXT += D2XT;
}
else if (T - B2*X >= YCRIT) /* e(x+1/2,y-1) > 0 */
{
- /* drop down one line */
+ /* Drop down one line */
Y -= 1;
T += DYT;
DYT += D2YT;
}
else
{
- /* drop diagonally down and out */
+ /* Drop diagonally down and out */
X += 1;
Y -= 1;
T += DXT + DYT;
if (t + a2*y < xcrit) /* e(x+1,y-1/2) <= 0 */
{
- /* move outwards to encounter edge */
+ /* Move outwards to encounter edge */
x += 1;
t += dxt;
dxt += d2xt;
}
else if (t - b2*x >= ycrit) /* e(x+1/2,y-1) > 0 */
{
- /* drop down one line */
+ /* Drop down one line */
y -= 1;
t += dyt;
dyt += d2yt;
}
else
{
- /* drop diagonally down and out */
+ /* Drop diagonally down and out */
x += 1;
y -= 1;
t += dxt + dyt;
}
else if (r1.y+r1.height < r2.y)
{
- /* draw distinct rectangles */
+ /* Draw distinct rectangles */
result &= app_fill_rect(g, rect(r1.x,r1.y,
W,1), pbrush, TRUE);
result &= app_fill_rect(g, rect(
prevy = r1.y;
}
- /* move down */
+ /* Move down */
r1.y += 1;
r2.y -= 1;
}
if (moveout)
{
- /* move outwards */
+ /* Move outwards */
r1.x -= 1;
r1.width += 2;
r2.x -= 1;
}
if ((x <= a) && (prevy < r2.y))
{
- /* draw final line */
+ /* Draw final line */
r1.height = r1.y+r1.height-r2.y;
r1.y = r2.y;
if (r.y <= p0.y) //
{
- /* in top half of arc ellipse */
+ /* In top half of arc ellipse */
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 */
if (rise1 == 0)
x1 = p1.x;
}
else if ((start_angle >= 0) && (start_angle <= 180))
{
- /* start_line is above middle */
+ /* Start_line is above middle */
x1 = p1.x;
start_above = 1;
}
else
{
- /* start_line is below middle */
+ /* Start_line is below middle */
x1 = r.x + r.width;
start_above = 0;
}
{
if (start_angle > end_angle)
{
- /* fill outsides of wedge */
+ /* Fill outsides of wedge */
if (! app_fill_rect(g, rect(r.x, r.y,
x1-r.x, r.height), pbrush, Pen))
&