Hi,
although I like the way NtGdiExtGetObjectW is using the union, we will
get a problem with it.
We don't know how many styles an extpen has, so we cannot statically
allocate a kmode buffer that is big enough.
I can currently think of 3 possible solutions:
1. Add a big additional hack for GDI_OBJECT_TYPE_EXTPEN in
NtGdiExtGetObjectW, that will copy the styles, wich seems to be a bad idea.
2. Use the old method of first calling IntGdiExtGetObjectW to get the
needed buffer size then allocate a kernelmode buffer then call
IntGdiExtGetObjectW again to tranfer the data then copy to usermode.
This is slower and needs extra memory.
3. Move the copying to usermode to the XXX_GetObject functions. This
would remove the need for an extra kernelmode buffer and we wouldn't
really need IntGdiExtGetObjectW anymore. But it doesn't match the rest
of our call chain design.
Comments appreciated.
Timo
Hi!
Which testing-framefork do ReactOS use?
I have seen, that CUnit for example outputs the result in a nice
html-format:
http://cunit.sourceforge.net/ss_automated.html
Looks similar to the output of GNU Classpath (which trys to rewrite Java):
http://builder.classpath.org/japi/jdk15-generics.html
But GNU Classpath uses JUnit. And ReactOS is written in C, so in this case
CUnit would be better.
Existing for ReactOS also a side like this, where everytime stands, which
test are passed and which not?
Greatings
theuserbl
_________________________________________________________________
Sie suchen E-Mails, Dokumente oder Fotos? Die neue MSN Suche Toolbar mit
Windows-Desktopsuche liefert in sekundenschnelle Ergebnisse. Jetzt neu!
http://desktop.msn.de/ Jetzt gratis downloaden!
Why did you randomly remove the hacks I added and call them useless? They're in Windows code, a checked GDI Server even prints out the size too big message! And why rename my variables? I don't really see the need to re-format code.
-----Original Message-----
From: ros-diffs-bounces(a)reactos.org [mailto:ros-diffs-bounces@reactos.org] On Behalf Of tkreuzer(a)svn.reactos.org
Sent: April-28-07 5:53 PM
To: ros-diffs(a)reactos.org
Subject: [ros-diffs] [tkreuzer] 26565: BRUSH_GetObject: - return sizeof(LOBRUSH) not BRUSHOBJ - don't return 0 on too small usermode buffer NtGdiExtGetObjectW: - remove unnecessary hacks - no need to align usermode buffer to words - add ENUMLOGFONTEXDVW, wich shou
Author: tkreuzer
Date: Sun Apr 29 01:53:06 2007
New Revision: 26565
URL: http://svn.reactos.org/svn/reactos?rev=26565&view=rev
Log:
BRUSH_GetObject:
- return sizeof(LOBRUSH) not BRUSHOBJ
- don't return 0 on too small usermode buffer
NtGdiExtGetObjectW:
- remove unnecessary hacks
- no need to align usermode buffer to words
- add ENUMLOGFONTEXDVW, wich should be the biggest structure needed
more fixes for fonts and extpens needed in the corresponding subfunctions, but all of my other tests pass now.
Modified:
trunk/reactos/subsystems/win32/win32k/objects/brush.c
trunk/reactos/subsystems/win32/win32k/objects/dc.c
Modified: trunk/reactos/subsystems/win32/win32k/objects/brush.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/objects/brush.c (original)
+++ trunk/reactos/subsystems/win32/win32k/objects/brush.c Sun Apr 29 01:53:06 2007
@@ -52,9 +52,8 @@
INT FASTCALL
BRUSH_GetObject (PGDIBRUSHOBJ BrushObject, INT Count, LPLOGBRUSH Buffer)
{
- if( Buffer == NULL ) return sizeof(BRUSHOBJ);
+ if( Buffer == NULL ) return sizeof(LOGBRUSH);
if (Count == 0) return 0;
- if ((UINT)Count < sizeof(BRUSHOBJ)) return 0;
/* Set colour */
Buffer->lbColor = BrushObject->BrushAttr.lbColor;
@@ -106,7 +105,7 @@
*/
/* FIXME */
- return sizeof(BRUSHOBJ);
+ return sizeof(LOGBRUSH);
}
Modified: trunk/reactos/subsystems/win32/win32k/objects/dc.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/objects/dc.c (original)
+++ trunk/reactos/subsystems/win32/win32k/objects/dc.c Sun Apr 29 01:53:06 2007
@@ -1817,92 +1817,44 @@
OUT LPVOID lpBuffer)
{
INT iRetCount = 0;
- INT iObjectType;
- INT cbRealCount = cbCount;
+ INT cbCopyCount;
union
{
- BITMAP bmpObject;
- DIBSECTION disObject;
- LOGPEN lgpObject;
- LOGBRUSH lgbObject;
- LOGFONTW lgfObject;
- EXTLOGFONTW elgfObject;
+ BITMAP bitmap;
+ DIBSECTION dibsection;
+ LOGPEN logpen;
+ LOGBRUSH logbrush;
+ LOGFONTW logfontw;
+ EXTLOGFONTW extlogfontw;
+ ENUMLOGFONTEXDVW enumlogfontexdvw;
} Object;
- //
- // Get the object type
- //
- iObjectType = GDIOBJ_GetObjectType(hGdiObj);
-
- //
- // Check if the given size is too large
- //
- if (cbCount > sizeof(Object))
- {
- //
- // Normalize to the largest supported object size
- //
- DPRINT1("cbCount too big!\n");
- cbCount = sizeof(Object);
- }
-
- //
- // Check if this is a brush
- //
- if (iObjectType == GDI_OBJECT_TYPE_BRUSH)
- {
- //
- // Windows GDI Hack: Manually correct the size
- //
- cbCount = sizeof(LOGBRUSH);
- }
-
- //
+ // Normalize to the largest supported object size
+ cbCount = min((UINT)cbCount, sizeof(Object));
+
// Now do the actual call
- //
iRetCount = IntGdiGetObject(hGdiObj, cbCount, lpBuffer ? &Object : NULL);
-
- //
- // Check if this is a brush
- //
- if (iObjectType == GDI_OBJECT_TYPE_BRUSH)
- {
- //
- // Fixup the size to account for our previous fixup
- //
- cbCount = min(cbCount, cbRealCount);
- }
-
- //
- // Make sure we have a buffer and a return size
- //
- if ((iRetCount) && (lpBuffer))
- {
- //
+ cbCopyCount = min((UINT)cbCount, (UINT)iRetCount);
+
+ // Make sure we have a buffer and a copy size
+ if ((cbCopyCount) && (lpBuffer))
+ {
// Enter SEH for buffer transfer
- //
_SEH_TRY
{
- //
// Probe the buffer and copy it
- //
- ProbeForWrite(lpBuffer, min(cbCount, cbRealCount), sizeof(WORD));
- RtlCopyMemory(lpBuffer, &Object, min(cbCount, cbRealCount));
+ ProbeForWrite(lpBuffer, cbCopyCount, 1);
+ RtlCopyMemory(lpBuffer, &Object, cbCopyCount);
}
_SEH_HANDLE
{
- //
// Clear the return value.
// Do *NOT* set last error here!
- //
iRetCount = 0;
}
_SEH_END;
}
-
- //
// Return the count
- //
return iRetCount;
}
Hi!
switch(dwType)
{
+ case GDI_OBJECT_TYPE_PEN: //Check the structures and see if A & W are the same.
+ case GDI_OBJECT_TYPE_EXTPEN:
+ case GDI_OBJECT_TYPE_BRUSH: // Mixing Apples and Oranges?
+ case GDI_OBJECT_TYPE_BITMAP:
+ case GDI_OBJECT_TYPE_PALETTE:
+ return NtGdiExtGetObjectW(hGdiObj, cbSize, lpBuffer);
+
case GDI_OBJECT_TYPE_DC:
case GDI_OBJECT_TYPE_REGION:
case GDI_OBJECT_TYPE_METAFILE:
case GDI_OBJECT_TYPE_ENHMETAFILE:
case GDI_OBJECT_TYPE_EMF:
- case GDI_OBJECT_TYPE_METADC:
SetLastError(ERROR_INVALID_HANDLE);
- return 0;
This is wrong,,, you can not call NtGdiExtGetObjectW first before faulting on GDI_OBJECT_TYPE_DC.
http://msdn2.microsoft.com/en-us/library/ms533268.aspx
Normal DC's do not pass to kernel space. Please RTFM.
Thanks,
James
----- Original Message -----
From: <dgorbachev(a)svn.reactos.org>
To: <ros-diffs(a)reactos.org>
Sent: Saturday, April 28, 2007 8:02 AM
Subject: [ros-diffs] [dgorbachev] 26555: Patch by Sbs (sbarthes [at] gmail
[dot] com). Bugzilla report #2137.
> Author: dgorbachev
> Date: Sat Apr 28 10:02:22 2007
> New Revision: 26555
>
> URL: http://svn.reactos.org/svn/reactos?rev=26555&view=rev
> Log:
> Patch by Sbs (sbarthes [at] gmail [dot] com). Bugzilla report #2137.
> - _stprintf(Text, _T("%d%%"), (int)CpuUsage);
> + wsprintf(Text, _T("%d%%"), (int)CpuUsage);
Is this a correct change? IIRC, I talked with some dev (hpoussin?) about
this, and he said those changes shouldn't be done.
WBR,
Aleksey Bragin.
----- Original Message -----
From: <gedmurphy(a)svn.reactos.org>
To: <ros-diffs(a)reactos.org>
Sent: Friday, April 27, 2007 5:18 PM
Subject: [ros-diffs] [gedmurphy] 26541: - add support for .ocx files to
rbuild - update project to VS2005
> Author: gedmurphy
> Date: Fri Apr 27 19:18:34 2007
> New Revision: 26541
>
> - update project to VS2005
I think it was specifically kept at low version, since autoconverting from
old version to the new one can always be done, but "downgrading" the project
file back to e.g. VS2003 is not guaranteed to be straight forward.
WBR,
Aleksey Bragin.
Hello Andranik,
you have to find at least one more native Armenian language person, so you can proof-read each other's translation before submitting to ReactOS.
Also, are you sure you have necessary english language skills to be able to translate all stuff correctly?
As for keyboard layout - yes, you're welcome to implement the corresponding .dll for it, if it's missing.
WBR,
Aleksey.
----- Original Message -----
From: Andranik Haroyan
To: ros-dev(a)reactos.org
Sent: Thursday, April 26, 2007 8:46 AM
Subject: [ros-dev] Help ReactOS localize
Hi everybody I am beginner programmer from Armenia.
One week ago I found alternative for MS Windows and sow ReactOS in http://www.reactos.org. I downloaded RO3.0.0 and tried. I think it is very interesting but I cant find in ReactOS Armenian support. Now I am download source and wont to localize it into Armenia. I am changing something in ( \boot\bootdata\hivesys.inf, hivecls.inf, hivesft.inf ) and write keyboard layout for Armenian language but after compile I sow it did not enough.
If anybody have some help or some else documentation about localize please help me.
Thanks
respect Andranik Haroyan.
Hi everybody I am beginner programmer from Armenia.
One week ago I found alternative for MS Windows and sow ReactOS in http://www.reactos.org. I downloaded RO3.0.0 and tried. I think it is very interesting but I cant find in ReactOS Armenian support. Now I am download source and wont to localize it into Armenia. I am changing something in ( \boot\bootdata\hivesys.inf, hivecls.inf, hivesft.inf ) and write keyboard layout for Armenian language but after compile I sow it did not enough.
If anybody have some help or some else documentation about localize please help me.
Thanks
respect Andranik Haroyan.
---------------------------------
Ahhh...imagining that irresistible "new car" smell?
Check outnew cars at Yahoo! Autos.