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
MSDN is not a good reference for this function. It's description is incomplete and wrong in some cases. And I don't see the problem. NtGdiExtGetObjectW is not called for GDI_OBJECT_TYPE_DC. It is only called for valid types.
James Tabor schrieb:
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 _______________________________________________ Ros-dev mailing list Ros-dev@reactos.org http://www.reactos.org/mailman/listinfo/ros-dev
On 4/28/07, Timo Kreuzer timo.kreuzer@web.de wrote:
MSDN is not a good reference for this function. It's description is incomplete and wrong in some cases. And I don't see the problem. NtGdiExtGetObjectW is not called for GDI_OBJECT_TYPE_DC. It is only called for valid types.
If the documentation is wrong could you provide a test case showing otherwise?
Steven Edwards schrieb:
On 4/28/07, Timo Kreuzer timo.kreuzer@web.de wrote:
MSDN is not a good reference for this function. It's description is incomplete and wrong in some cases. And I don't see the problem. NtGdiExtGetObjectW is not called for GDI_OBJECT_TYPE_DC. It is only called for valid types.
If the documentation is wrong could you provide a test case showing otherwise?
I have a lot of testcases for GetObjectA/W. I will commit my GDI32 tests soon (next hour probably, after some cleanup). The patch jimtabor referred to didn't even change any functionality except the GDI_OBJECT_TYPE_METADC case, wich I can provide a testcase for. Please RTFC ;-)
examples: MSDN says GetObject returns a LOGFONT, but it returnes different things depending on what you specify as count. More investigation is needed, but jimtabor has done some basics on that. Still missing: sizes not matching one of the structures. In those cases the structures get copied partly. The return value will be the count of bytes copied.
Same goes for brushes. The structure will be copied only as far as the count value specifies. But the return value will always be sizeof(LOGBRUSH)
all other types will return 0 and not copy anything if the buffer size is smaller than the structure. ... Have a look at the gdi32_test.. and privide more tests.
Atm all my tests succeed, except some font tests, because sizes inbetween the structures are not handled and extlogpen, wich is not implemeted at all in ros.
Steven Edwards wrote:
On 4/28/07, Timo Kreuzer timo.kreuzer@web.de wrote:
MSDN is not a good reference for this function. It's description is incomplete and wrong in some cases. And I don't see the problem. NtGdiExtGetObjectW is not called for GDI_OBJECT_TYPE_DC. It is only called for valid types.
If the documentation is wrong could you provide a test case showing otherwise?
It's a question of logic.
oh~ yeah~
WINE is not enough! James
Hi! Timo Kreuzer wrote:
MSDN is not a good reference for this function. It's description is incomplete and wrong in some cases. And I don't see the problem. NtGdiExtGetObjectW is not called for GDI_OBJECT_TYPE_DC. It is only called for valid types.
Okay, what ever~ I have no idea what I'm talking about.
NM, James