Author: tkreuzer
Date: Wed May 28 17:25:08 2008
New Revision: 33750
URL: http://svn.reactos.org/svn/reactos?rev=33750&view=rev
Log:
(Nt)GdiFlushUserBatch:
- optmize by moving the locking of the dc to NtGdiFlushUserBatch instead of doing it for every object
- fix wrong pointer calculation (GdiFlushUserBatch returns the size of the objects in bytes not in ULONG)
- simplify a check
- add a comment: on XP NtGdiFlushUserBatch doesn't return NTSTATUS, but a pointer to inside the Teb, maybe random/VOID
Modified:
trunk/reactos/subsystems/win32/win32k/objects/gdibatch.c
Modified: trunk/reactos/subsystems/win32/win32k/objects/gdibatch.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/objects/gdibatch.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/objects/gdibatch.c [iso-8859-1] Wed May 28 17:25:08 2008
@@ -61,18 +61,13 @@
//
ULONG
FASTCALL
-GdiFlushUserBatch(HDC hDC, PGDIBATCHHDR pHdr)
+GdiFlushUserBatch(PDC dc, PGDIBATCHHDR pHdr)
{
- PDC dc = NULL;
PDC_ATTR Dc_Attr = NULL;
- if (hDC && !IsObjectDead(hDC))
+ if (dc)
{
- dc = DC_LockDc(hDC);
- if (dc)
- {
- Dc_Attr = dc->pDc_Attr;
- if (!Dc_Attr) Dc_Attr = &dc->Dc_Attr;
- }
+ Dc_Attr = dc->pDc_Attr;
+ if (!Dc_Attr) Dc_Attr = &dc->Dc_Attr;
}
// The thread is approaching the end of sunset.
switch(pHdr->Cmd)
@@ -113,7 +108,7 @@
default:
break;
}
- if (dc) DC_UnlockDc(dc);
+
return pHdr->Size; // Return the full size of the structure.
}
@@ -146,25 +141,39 @@
if( (GdiBatchCount > 0) && (GdiBatchCount <= (GDIBATCHBUFSIZE/4)))
{
HDC hDC = (HDC) pTeb->GdiTebBatch.HDC;
-//
-// If hDC is zero and the buffer fills up with delete objects we need to run
-// anyway. So, hard code to the system batch limit.
-//
- if ((hDC) || ((!hDC) && (GdiBatchCount >= GDI_BATCH_LIMIT)))
+
+ /* If hDC is zero and the buffer fills up with delete objects we need
+ to run anyway. So, hard code to the system batch limit. */
+ if ((hDC) || (GdiBatchCount >= GDI_BATCH_LIMIT))
{
- PULONG pHdr = &pTeb->GdiTebBatch.Buffer[0];
+ PCHAR pHdr = (PCHAR)&pTeb->GdiTebBatch.Buffer[0];
+ PDC pDC = NULL;
+
+ if (hDC && !IsObjectDead(hDC))
+ {
+ pDC = DC_LockDc(hDC);
+ }
+
// No need to init anything, just go!
for (; GdiBatchCount > 0; GdiBatchCount--)
{
// Process Gdi Batch!
- pHdr += GdiFlushUserBatch( hDC, (PGDIBATCHHDR) pHdr );
+ pHdr += GdiFlushUserBatch(pDC, (PGDIBATCHHDR) pHdr);
}
+
+ if (pDC)
+ {
+ DC_UnlockDc(pDC);
+ }
+
// Exit and clear out for the next round.
pTeb->GdiTebBatch.Offset = 0;
pTeb->GdiBatchCount = 0;
pTeb->GdiTebBatch.HDC = 0;
}
}
+
+ // FIXME: on xp the function returns &pTeb->RealClientId, maybe VOID?
return STATUS_SUCCESS;
}
Author: cfinck
Date: Wed May 28 16:37:05 2008
New Revision: 33748
URL: http://svn.reactos.org/svn/reactos?rev=33748&view=rev
Log:
Sorry, forgot this file
Added:
trunk/reactos/lib/sdk/crt/except/checkesp.c (with props)
Added: trunk/reactos/lib/sdk/crt/except/checkesp.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/lib/sdk/crt/except/checkes…
==============================================================================
--- trunk/reactos/lib/sdk/crt/except/checkesp.c (added)
+++ trunk/reactos/lib/sdk/crt/except/checkesp.c [iso-8859-1] Wed May 28 16:37:05 2008
@@ -1,0 +1,35 @@
+/*********************************************************************
+* _chkesp (MSVCRT.@)
+*
+* Trap to a debugger if the value of the stack pointer has changed.
+*
+* PARAMS
+* None.
+*
+* RETURNS
+* Does not return.
+*
+* NOTES
+* This function is available for iX86 only.
+*
+* When VC++ generates debug code, it stores the value of the stack pointer
+* before calling any external function, and checks the value following
+* the call. It then calls this function, which will trap if the values are
+* not the same. Usually this means that the prototype used to call
+* the function is incorrect. It can also mean that the .spec entry has
+* the wrong calling convention or parameters.
+*/
+
+#ifdef __i386__
+
+void _chkesp(void)
+{
+}
+
+#else
+
+void _chkesp(void)
+{
+}
+
+#endif /* __i386__ */
Propchange: trunk/reactos/lib/sdk/crt/except/checkesp.c
------------------------------------------------------------------------------
svn:eol-style = native
Author: tkreuzer
Date: Wed May 28 15:03:36 2008
New Revision: 33745
URL: http://svn.reactos.org/svn/reactos?rev=33745&view=rev
Log:
DCOrg is in device coordinates, fix a comment accordingly
Modified:
trunk/reactos/subsystems/win32/win32k/objects/line.c
Modified: trunk/reactos/subsystems/win32/win32k/objects/line.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/objects/line.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/objects/line.c [iso-8859-1] Wed May 28 15:03:36 2008
@@ -129,7 +129,7 @@
IntLPtoDP(dc, Points, 2);
- /* FIXME: Is it correct to do this after the transformation? */
+ /* The DCOrg is in device coordinates */
Points[0].x += dc->w.DCOrgX;
Points[0].y += dc->w.DCOrgY;
Points[1].x += dc->w.DCOrgX;
Author: greatlrd
Date: Wed May 28 15:03:10 2008
New Revision: 33744
URL: http://svn.reactos.org/svn/reactos?rev=33744&view=rev
Log:
This file will be share between dxg and win32k explain why will follow in documentations that Z98 helping me writing at moment. they will be release to public
fast explain windows xp and higher have two gdi table, it is better reuse same macro for both, that rewrite it one more time.
Modified:
trunk/reactos/include/reactos/win32k/ntgdihdl.h
Modified: trunk/reactos/include/reactos/win32k/ntgdihdl.h
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/win32k/ntg…
==============================================================================
--- trunk/reactos/include/reactos/win32k/ntgdihdl.h [iso-8859-1] (original)
+++ trunk/reactos/include/reactos/win32k/ntgdihdl.h [iso-8859-1] Wed May 28 15:03:10 2008
@@ -51,7 +51,6 @@
*/
/*@{*/
#define GDI_OBJECT_TYPE_DC 0x00010000
-#define GDI_OBJECT_TYPE_DIRECTDRAW 0x00020000 /* Should be moved away from gdi objects */
#define GDI_OBJECT_TYPE_DD_SURFACE 0x00030000 /* Should be moved away from gdi objects */
#define GDI_OBJECT_TYPE_REGION 0x00040000
#define GDI_OBJECT_TYPE_BITMAP 0x00050000
@@ -66,9 +65,13 @@
#define GDI_OBJECT_TYPE_DD_MOTIONCOMP 0x00140000 /* Should be moved away from gdi objects */
#define GDI_OBJECT_TYPE_ENUMFONT 0x00160000
+/* Confrim on XP value is taken from NtGdiCreateDirectDrawObject */
+#define GDI_OBJECT_TYPE_DIRECTDRAW 0x00200000
+
/* Following object types are derived types from the above base types
use 0x001f0000 as mask to get the base type */
#define GDI_OBJECT_TYPE_EMF 0x00210000
+
#define GDI_OBJECT_TYPE_METAFILE 0x00260000
#define GDI_OBJECT_TYPE_ENHMETAFILE 0x00460000
#define GDI_OBJECT_TYPE_PEN 0x00300000