Author: jimtabor Date: Wed Nov 7 20:58:02 2007 New Revision: 30244
URL: http://svn.reactos.org/svn/reactos?rev=30244&view=rev Log: Win32k/Gdi32 - Use Batch with SetBrushOrgEx now, removed NtGdiGetBrushOrgEx, update all related files. - Fixed WinDC DCE death to all window DCE's. This will move to gdiobj as a check to see if a object handle is on deaths door. This prevents exceptions. - Implemented NtgdiGet/ABCCharWidth/sW, updated all related files. Float and Indices not supported yet. - Added Brush, Region and Font user attribute structures. Based on Yuan book. - All tested with linux qemu with AbiWord 2.4.1.
Modified: trunk/reactos/dll/win32/gdi32/misc/stubs.c trunk/reactos/dll/win32/gdi32/objects/brush.c trunk/reactos/dll/win32/gdi32/objects/font.c trunk/reactos/include/reactos/win32k/ntgdibad.h trunk/reactos/include/reactos/win32k/ntgdihdl.h trunk/reactos/include/reactos/win32k/ntgdityp.h trunk/reactos/subsystems/win32/win32k/ntuser/object.c trunk/reactos/subsystems/win32/win32k/ntuser/windc.c trunk/reactos/subsystems/win32/win32k/objects/dc.c trunk/reactos/subsystems/win32/win32k/objects/text.c trunk/reactos/subsystems/win32/win32k/w32ksvc.db
Modified: trunk/reactos/dll/win32/gdi32/misc/stubs.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdi32/misc/stubs.... ============================================================================== --- trunk/reactos/dll/win32/gdi32/misc/stubs.c (original) +++ trunk/reactos/dll/win32/gdi32/misc/stubs.c Wed Nov 7 20:58:02 2007 @@ -1550,25 +1550,6 @@ SetLastError(ERROR_CALL_NOT_IMPLEMENTED); return 0; } - -/* - * @unimplemented - */ -BOOL -STDCALL -GetCharWidthI(HDC hdc, - UINT giFirst, - UINT cgi, - LPWORD pgi, - LPINT lpBuffer -) -{ - UNIMPLEMENTED; - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return 0; -} - -
/* * @implemented @@ -2385,30 +2366,6 @@ * @implemented * */ -BOOL -STDCALL -GetBrushOrgEx(HDC hdc,LPPOINT pt) -{ - /* FIXME some part are done in user mode */ - return NtGdiGetBrushOrgEx(hdc,pt); -} - -/* - * @implemented - * - */ -BOOL -STDCALL -GetCharABCWidthsFloatW(HDC hdc,UINT FirstChar,UINT LastChar,LPABCFLOAT abcF) -{ - - return FALSE; -} - -/* - * @implemented - * - */ int STDCALL GetDeviceCaps(HDC hdc, @@ -2444,52 +2401,6 @@ /* FIXME some part need be done in user mode */ return NtGdiGetClipBox(hdc, lprc); } - -/* - * @implemented - * - */ -BOOL -STDCALL -GetCharWidthFloatW(HDC hdc, - UINT iFirstChar, - UINT iLastChar, - PFLOAT pxBuffer) -{ - - return FALSE; -} - -/* - * @implemented - * - */ -BOOL -STDCALL -GetCharWidth32W(HDC hdc, - UINT iFirstChar, - UINT iLastChar, - LPINT lpBuffer) -{ - /* FIXME some part need be done in user mode */ - return NtGdiGetCharWidth32(hdc, iFirstChar, iLastChar, lpBuffer); -} - -/* - * @implemented - * - */ -BOOL -STDCALL -GetCharABCWidths(HDC hdc, - UINT uFirstChar, - UINT uLastChar, - LPABC lpabc) -{ - /* FIXME some part need be done in user mode */ - return NtGdiGetCharABCWidths(hdc, uFirstChar, uLastChar, lpabc); -} -
/* * @implemented
Modified: trunk/reactos/dll/win32/gdi32/objects/brush.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdi32/objects/bru... ============================================================================== --- trunk/reactos/dll/win32/gdi32/objects/brush.c (original) +++ trunk/reactos/dll/win32/gdi32/objects/brush.c Wed Nov 7 20:58:02 2007 @@ -257,6 +257,25 @@
/* * @implemented + * + */ +BOOL +STDCALL +GetBrushOrgEx(HDC hdc,LPPOINT pt) +{ + PDC_ATTR Dc_Attr; + + if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr)) return FALSE; + if (pt) + { + pt->x = Dc_Attr->ptlBrushOrigin.x; + pt->y = Dc_Attr->ptlBrushOrigin.y; + } + return TRUE; +} + +/* + * @implemented */ BOOL STDCALL @@ -265,6 +284,7 @@ int nYOrg, LPPOINT lppt) { + PDC_ATTR Dc_Attr; #if 0 // Handle something other than a normal dc object. if (GDI_HANDLE_GET_TYPE(hdc) != GDI_OBJECT_TYPE_DC) @@ -282,9 +302,6 @@ return FALSE; } #endif -#if 0 - PDC_ATTR Dc_Attr; - if (GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr)) { PTEB pTeb = NtCurrentTeb(); @@ -313,12 +330,17 @@ pTeb->GdiTebBatch.Offset += sizeof(GDIBSSETBRHORG); pTeb->GdiTebBatch.HDC = (ULONG)hdc; pTeb->GdiBatchCount++; - if (pTeb->GdiBatchCount >= GDI_BatchLimit) NtGdiFlush(); - + DPRINT("Loading the Flush!! COUNT-> %d\n", pTeb->GdiBatchCount); + + if (pTeb->GdiBatchCount >= GDI_BatchLimit) + { + DPRINT("Call GdiFlush!!\n"); + NtGdiFlush(); + DPRINT("Exit GdiFlush!!\n"); + } return TRUE; } } -#endif return NtGdiSetBrushOrg(hdc,nXOrg,nYOrg,lppt); }
Modified: trunk/reactos/dll/win32/gdi32/objects/font.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdi32/objects/fon... ============================================================================== --- trunk/reactos/dll/win32/gdi32/objects/font.c (original) +++ trunk/reactos/dll/win32/gdi32/objects/font.c Wed Nov 7 20:58:02 2007 @@ -419,88 +419,6 @@ return IntEnumFontFamilies(hdc, &LogFont, lpEnumFontFamProc, lParam, FALSE); }
- -/* - * @implemented - */ -BOOL -STDCALL -GetCharWidthA ( - HDC hdc, - UINT iFirstChar, - UINT iLastChar, - LPINT lpBuffer - ) -{ -DPRINT1("GCWA iFirstChar %x\n",iFirstChar); - - return GetCharWidth32A ( hdc, iFirstChar, iLastChar, lpBuffer ); -} - - -/* - * @implemented - */ -BOOL -STDCALL -GetCharWidth32A( - HDC hdc, - UINT iFirstChar, - UINT iLastChar, - LPINT lpBuffer - ) -{ - INT i, wlen, count = (INT)(iLastChar - iFirstChar + 1); - LPSTR str; - LPWSTR wstr; - BOOL ret = TRUE; -DPRINT1("GCW32A iFirstChar %x\n",iFirstChar); - - if(count <= 0) return FALSE; - - str = HeapAlloc(GetProcessHeap(), 0, count); - for(i = 0; i < count; i++) - str[i] = (BYTE)(iFirstChar + i); - - wstr = FONT_mbtowc(NULL, str, count, &wlen, NULL); - - for(i = 0; i < wlen; i++) - { - /* FIXME should be NtGdiGetCharWidthW */ - if(!NtGdiGetCharWidth32 (hdc, wstr[i], wstr[i], lpBuffer)) - { - ret = FALSE; - break; - } - lpBuffer++; - } - - HeapFree(GetProcessHeap(), 0, str); - HeapFree(GetProcessHeap(), 0, wstr); - - return ret; -} - - -/* - * @implemented - */ -BOOL -STDCALL -GetCharWidthW ( - HDC hdc, - UINT iFirstChar, - UINT iLastChar, - LPINT lpBuffer - ) -{ -DPRINT1("GCW32w uFirstChar %x\n",iFirstChar); - - /* FIXME should be NtGdiGetCharWidthW */ - return NtGdiGetCharWidth32 ( hdc, iFirstChar, iLastChar, lpBuffer ); -} - - /* * @implemented */ @@ -518,6 +436,7 @@ DWORD ret=0; SIZE size; UINT i, nSet; + DPRINT("GetCharacterPlacementW\n");
if(dwFlags&(~GCP_REORDER)) DPRINT("flags 0x%08lx ignored\n", dwFlags); if(lpResults->lpClass) DPRINT("classes not implemented\n"); @@ -558,7 +477,7 @@ int c; for (i = 0; i < nSet; i++) { - if (NtGdiGetCharWidth32(hdc, lpString[i], lpString[i], &c)) + if (GetCharWidth32W(hdc, lpString[i], lpString[i], &c)) lpResults->lpDx[i]= c; } } @@ -582,9 +501,212 @@ return ret; }
- -/* - * @unimplemented +/* + * @implemented + * + */ +BOOL +STDCALL +GetCharABCWidthsFloatW(HDC hdc, + UINT FirstChar, + UINT LastChar, + LPABCFLOAT abcF) +{ +DPRINT("GetCharABCWidthsFloatW\n"); + if ((!abcF) || (FirstChar > LastChar)) + { + SetLastError(ERROR_INVALID_PARAMETER); + return FALSE; + } + return NtGdiGetCharABCWidthsW( hdc, + FirstChar, + (ULONG)(LastChar - FirstChar + 1), + (PWCHAR) NULL, + 0, + (PVOID)abcF); +} + +/* + * @implemented + * + */ +BOOL +STDCALL +GetCharWidthFloatW(HDC hdc, + UINT iFirstChar, + UINT iLastChar, + PFLOAT pxBuffer) +{ +DPRINT("GetCharWidthsFloatW\n"); + if ((!pxBuffer) || (iFirstChar > iLastChar)) + { + SetLastError(ERROR_INVALID_PARAMETER); + return FALSE; + } + return NtGdiGetCharWidthW( hdc, + iFirstChar, + (ULONG)(iLastChar - iFirstChar + 1), + (PWCHAR) NULL, + 0, + (PVOID) pxBuffer); +} + +/* + * @implemented + * + */ +BOOL +STDCALL +GetCharWidthW(HDC hdc, + UINT iFirstChar, + UINT iLastChar, + LPINT lpBuffer) +{ +DPRINT("GetCharWidthsW\n"); + if ((!lpBuffer) || (iFirstChar > iLastChar)) + { + SetLastError(ERROR_INVALID_PARAMETER); + return FALSE; + } + return NtGdiGetCharWidthW( hdc, + iFirstChar, + (ULONG)(iLastChar - iFirstChar + 1), + (PWCHAR) NULL, + GCW_NOFLOAT, + (PVOID) lpBuffer); +} + +/* + * @implemented + * + */ +BOOL +STDCALL +GetCharWidth32W(HDC hdc, + UINT iFirstChar, + UINT iLastChar, + LPINT lpBuffer) +{ +DPRINT("GetCharWidths32W\n"); + if ((!lpBuffer) || (iFirstChar > iLastChar)) + { + SetLastError(ERROR_INVALID_PARAMETER); + return FALSE; + } + return NtGdiGetCharWidthW( hdc, + iFirstChar, + (ULONG)(iLastChar - iFirstChar + 1), + (PWCHAR) NULL, + GCW_NOFLOAT|GCW_WIN32, + (PVOID) lpBuffer); +} + + +/* + * @implemented + * + */ +BOOL +STDCALL +GetCharABCWidthsW(HDC hdc, + UINT FirstChar, + UINT LastChar, + LPABC lpabc) +{ +DPRINT("GetCharABCWidthsW\n"); + if ((!lpabc) || (FirstChar > LastChar)) + { + SetLastError(ERROR_INVALID_PARAMETER); + return FALSE; + } + return NtGdiGetCharABCWidthsW( hdc, + FirstChar, + (ULONG)(LastChar - FirstChar + 1), + (PWCHAR) NULL, + GCABCW_NOFLOAT, + (PVOID)lpabc); +} + +/* + * @implemented + */ +BOOL +STDCALL +GetCharWidthA( + HDC hdc, + UINT iFirstChar, + UINT iLastChar, + LPINT lpBuffer + ) +{ +DPRINT("GetCharWidthsA\n"); + INT i, wlen, count = (INT)(iLastChar - iFirstChar + 1); + LPSTR str; + LPWSTR wstr; + BOOL ret = TRUE; + + if(count <= 0) return FALSE; + + str = HeapAlloc(GetProcessHeap(), 0, count); + for(i = 0; i < count; i++) + str[i] = (BYTE)(iFirstChar + i); + + wstr = FONT_mbtowc(NULL, str, count, &wlen, NULL); + + ret = NtGdiGetCharWidthW( hdc, + wstr[0], + (ULONG) count, + (PWCHAR) wstr, + GCW_NOFLOAT, + (PVOID) lpBuffer); + + HeapFree(GetProcessHeap(), 0, str); + HeapFree(GetProcessHeap(), 0, wstr); + + return ret; +} + +/* + * @implemented + */ +BOOL +STDCALL +GetCharWidth32A( + HDC hdc, + UINT iFirstChar, + UINT iLastChar, + LPINT lpBuffer + ) +{ +DPRINT("GetCharWidths32A\n"); + INT i, wlen, count = (INT)(iLastChar - iFirstChar + 1); + LPSTR str; + LPWSTR wstr; + BOOL ret = TRUE; + + if(count <= 0) return FALSE; + + str = HeapAlloc(GetProcessHeap(), 0, count); + for(i = 0; i < count; i++) + str[i] = (BYTE)(iFirstChar + i); + + wstr = FONT_mbtowc(NULL, str, count, &wlen, NULL); + + ret = NtGdiGetCharWidthW( hdc, + wstr[0], + (ULONG) count, + (PWCHAR) wstr, + GCW_NOFLOAT|GCW_WIN32, + (PVOID) lpBuffer); + + HeapFree(GetProcessHeap(), 0, str); + HeapFree(GetProcessHeap(), 0, wstr); + + return ret; +} + +/* + * @implemented */ BOOL APIENTRY @@ -595,10 +717,27 @@ PFLOAT pxBuffer ) { - /* FIXME what to do with iFirstChar and iLastChar ??? */ - return FALSE; -} - +DPRINT("GetCharWidthsFloatA\n"); + INT i, wlen, count = (INT)(iLastChar - iFirstChar + 1); + LPSTR str; + LPWSTR wstr; + BOOL ret = TRUE; + + if(count <= 0) return FALSE; + + str = HeapAlloc(GetProcessHeap(), 0, count); + for(i = 0; i < count; i++) + str[i] = (BYTE)(iFirstChar + i); + + wstr = FONT_mbtowc(NULL, str, count, &wlen, NULL); + + ret = NtGdiGetCharWidthW( hdc, wstr[0], (ULONG) count, (PWCHAR) wstr, 0, (PVOID) pxBuffer); + + HeapFree(GetProcessHeap(), 0, str); + HeapFree(GetProcessHeap(), 0, wstr); + + return ret; +}
/* * @implemented @@ -612,14 +751,35 @@ LPABC lpabc ) { -DPRINT1("GCABCWA uFirstChar %x\n",uFirstChar); - -return NtGdiGetCharABCWidths(hdc, uFirstChar, uLastChar, lpabc); -} - - -/* - * @unimplemented +DPRINT("GetCharABCWidthsA\n"); + INT i, wlen, count = (INT)(uLastChar - uFirstChar + 1); + LPSTR str; + LPWSTR wstr; + BOOL ret = TRUE; + + if(count <= 0) return FALSE; + + str = HeapAlloc(GetProcessHeap(), 0, count); + for(i = 0; i < count; i++) + str[i] = (BYTE)(uFirstChar + i); + + wstr = FONT_mbtowc(hdc, str, count, &wlen, NULL); + + ret = NtGdiGetCharABCWidthsW( hdc, + wstr[0], + (ULONG)count, + (PWCHAR)wstr, + GCABCW_NOFLOAT, + (PVOID)lpabc); + + HeapFree(GetProcessHeap(), 0, str); + HeapFree(GetProcessHeap(), 0, wstr); + + return ret; +} + +/* + * @implemented */ BOOL APIENTRY @@ -630,10 +790,27 @@ LPABCFLOAT lpABCF ) { -DPRINT1("GCABCWFA iFirstChar %x\n",iFirstChar); - - /* FIXME what to do with iFirstChar and iLastChar ??? */ - return FALSE; +DPRINT("GetCharABCWidthsFloatA\n"); + INT i, wlen, count = (INT)(iLastChar - iFirstChar + 1); + LPSTR str; + LPWSTR wstr; + BOOL ret = TRUE; + + if (count <= 0) return FALSE; + + str = HeapAlloc(GetProcessHeap(), 0, count); + + for(i = 0; i < count; i++) + str[i] = (BYTE)(iFirstChar + i); + + wstr = FONT_mbtowc( hdc, str, count, &wlen, NULL ); + + ret = NtGdiGetCharABCWidthsW( hdc,wstr[0],(ULONG)count, (PWCHAR)wstr, 0, (PVOID)lpABCF); + + HeapFree( GetProcessHeap(), 0, str ); + HeapFree( GetProcessHeap(), 0, wstr ); + + return ret; }
/* @@ -645,10 +822,42 @@ UINT giFirst, UINT cgi, LPWORD pgi, - LPABC lpabc + LPABC lpabc) +{ +DPRINT("GetCharABCWidthsI\n"); + return NtGdiGetCharABCWidthsW( hdc, + giFirst, + (ULONG) cgi, + (PWCHAR) pgi, + GCABCW_NOFLOAT|GCABCW_INDICES, + (PVOID)lpabc); +} + +/* + * @implemented + */ +BOOL +STDCALL +GetCharWidthI(HDC hdc, + UINT giFirst, + UINT cgi, + LPWORD pgi, + LPINT lpBuffer ) { - return NtGdiGetCharABCWidthsW( hdc, giFirst, (ULONG) cgi, (PWCHAR) pgi, 3, (PVOID)lpabc); +DPRINT("GetCharWidthsI\n"); + if (!lpBuffer || (!pgi && (giFirst == MAXUSHORT))) // Cannot be at max. + { + SetLastError(ERROR_INVALID_PARAMETER); + return FALSE; + } + if (!cgi) return TRUE; + return NtGdiGetCharWidthW( hdc, + giFirst, + cgi, + (PWCHAR) pgi, + GCW_INDICES|GCW_NOFLOAT|GCW_WIN32, + (PVOID) lpBuffer ); }
/* @@ -730,7 +939,9 @@ CONST MAT2 *lpmat2 ) { - DPRINT1("GetGlyphOutlineW uChar %x\n", uChar); + DPRINT("GetGlyphOutlineW uChar %x\n", uChar); + if (!lpgm & !lpmat2) return GDI_ERROR; + if (!lpvBuffer) cbBuffer = 0; return NtGdiGetGlyphOutline ( hdc, uChar, uFormat, lpgm, cbBuffer, lpvBuffer, (CONST LPMAT2)lpmat2, TRUE); }
Modified: trunk/reactos/include/reactos/win32k/ntgdibad.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/win32k/ntgd... ============================================================================== --- trunk/reactos/include/reactos/win32k/ntgdibad.h (original) +++ trunk/reactos/include/reactos/win32k/ntgdibad.h Wed Nov 7 20:58:02 2007 @@ -79,15 +79,6 @@ LPSIZE );
-BOOL -STDCALL -NtGdiGetCharWidth32( - HDC hDC, - UINT FirstChar, - UINT LastChar, - LPINT Buffer -); - /* Use NtGdiAddFontResourceW */ int STDCALL @@ -210,9 +201,6 @@
/* Should be done in user-mode using shared GDI Objects. */ INT STDCALL NtGdiGetBkMode(HDC hDC); - -/* Should be done in user-mode using shared GDI Objects. */ -BOOL STDCALL NtGdiGetBrushOrgEx(HDC hDC, LPPOINT brushOrg);
/* Use NtGdiGetCharABCWidthsW */ BOOL
Modified: trunk/reactos/include/reactos/win32k/ntgdihdl.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/win32k/ntgd... ============================================================================== --- trunk/reactos/include/reactos/win32k/ntgdihdl.h (original) +++ trunk/reactos/include/reactos/win32k/ntgdihdl.h Wed Nov 7 20:58:02 2007 @@ -283,4 +283,26 @@ RGNATTR VisRectRegion; } DC_ATTR, *PDC_ATTR;
+typedef struct _BRUSH_ATTR +{ + LOGBRUSH logbrush; + DWORD dwUnused[3]; +} BRUSH_ATTR, *PBRUSH_ATTR; + +typedef struct _REGION_ATTR +{ + DWORD dwUnknown1; + DWORD dwUnknown2; + LONG right; + LONG bottom; + LONG left; + LONG top; +} REGION_ATTR, *PREGION_ATTR; + +typedef struct _FONT_ATTR +{ + DWORD dwUnknown; + void *pCharWidthData; +} FONT_ATTR, *PFONT_ATTR; + #endif
Modified: trunk/reactos/include/reactos/win32k/ntgdityp.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/win32k/ntgd... ============================================================================== --- trunk/reactos/include/reactos/win32k/ntgdityp.h (original) +++ trunk/reactos/include/reactos/win32k/ntgdityp.h Wed Nov 7 20:58:02 2007 @@ -77,8 +77,6 @@ GdiGetDCOrg = 6, } GETDCPOINT, *PGETDCPOINT;
-#define GDIBATCHBUFSIZE 0x136*4 -#define GDI_BATCH_LIMIT 20
typedef enum _GDIBATCHCMD { @@ -104,6 +102,21 @@ /* FIXME: Unknown */ typedef DWORD FULLSCREENCONTROL; typedef DWORD LFTYPE; + +/* DEFINES *******************************************************************/ + +#define GDIBATCHBUFSIZE 0x136*4 +#define GDI_BATCH_LIMIT 20 + +// NtGdiGetCharWidthW Flags +#define GCW_WIN32 0x0001 +#define GCW_NOFLOAT 0x0002 +#define GCW_INDICES 0x0008 + +// NtGdiGetCharABCWidthW Flags +#define GCABCW_NOFLOAT 0x0001 +#define GCABCW_INDICES 0x0002 +
/* TYPES *********************************************************************/
Modified: trunk/reactos/subsystems/win32/win32k/ntuser/object.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ntu... ============================================================================== --- trunk/reactos/subsystems/win32/win32k/ntuser/object.c (original) +++ trunk/reactos/subsystems/win32/win32k/ntuser/object.c Wed Nov 7 20:58:02 2007 @@ -55,7 +55,7 @@ { PUSER_HANDLE_ENTRY entry;
-// DPRINT1("handles used %i\n",usedHandles); + DPRINT("handles used %i\n",usedHandles);
if (ht->freelist) {
Modified: trunk/reactos/subsystems/win32/win32k/ntuser/windc.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ntu... ============================================================================== --- trunk/reactos/subsystems/win32/win32k/ntuser/windc.c (original) +++ trunk/reactos/subsystems/win32/win32k/ntuser/windc.c Wed Nov 7 20:58:02 2007 @@ -678,7 +678,18 @@ if(Force && !GDIOBJ_OwnedByCurrentProcess(GdiHandleTable, pdce->hDC)) { DPRINT1("Change ownership for DCE!\n"); - DC_SetOwnership( pdce->hDC, PsGetCurrentProcess()); + INT Index = GDI_HANDLE_GET_INDEX(pdce->hDC); + PGDI_TABLE_ENTRY Entry = &GdiHandleTable->Entries[Index]; + + // Must take control of handles that are not in the process of going away. + if ((Entry->Type & ~GDI_ENTRY_REUSE_MASK) != 0 && Entry->KernelData != NULL) + { + DC_SetOwnership( pdce->hDC, PsGetCurrentProcess()); + } + else + { + DPRINT1("Attempted to change ownership of an DCEhDC 0x%x currently being destroyed!!!\n",pdce->hDC); + } }
NtGdiDeleteObjectApp(pdce->hDC);
Modified: trunk/reactos/subsystems/win32/win32k/objects/dc.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/obj... ============================================================================== --- trunk/reactos/subsystems/win32/win32k/objects/dc.c (original) +++ trunk/reactos/subsystems/win32/win32k/objects/dc.c Wed Nov 7 20:58:02 2007 @@ -1137,7 +1137,6 @@
DC_GET_VAL( COLORREF, NtGdiGetBkColor, Dc_Attr.crBackgroundClr ) DC_GET_VAL( INT, NtGdiGetBkMode, Dc_Attr.jBkMode ) -DC_GET_VAL_EX( GetBrushOrgEx, Dc_Attr.ptlBrushOrigin.x, Dc_Attr.ptlBrushOrigin.y, POINT, x, y )
HANDLE STDCALL
Modified: trunk/reactos/subsystems/win32/win32k/objects/text.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/obj... ============================================================================== --- trunk/reactos/subsystems/win32/win32k/objects/text.c (original) +++ trunk/reactos/subsystems/win32/win32k/objects/text.c Wed Nov 7 20:58:02 2007 @@ -2130,12 +2130,18 @@ return FALSE; }
+ /* + * @implemented + */ BOOL STDCALL -NtGdiGetCharABCWidths(HDC hDC, - UINT FirstChar, - UINT LastChar, - LPABC abc) +NtGdiGetCharABCWidthsW( + IN HDC hDC, + IN UINT FirstChar, + IN ULONG Count, + IN OPTIONAL PWCHAR pwch, + IN FLONG fl, + OUT PVOID Buffer) { LPABC SafeBuffer; PDC dc; @@ -2146,14 +2152,21 @@ UINT i, glyph_index, BufferSize; HFONT hFont = 0; NTSTATUS Status; - - if (LastChar < FirstChar) - { - SetLastWin32Error(ERROR_INVALID_PARAMETER); + LPABC abc = NULL; + LPABCFLOAT abcf = NULL; + + if (!fl) + { + abcf = (LPABCFLOAT) Buffer; + // Not supported yet! return FALSE; } - - BufferSize = (LastChar - FirstChar + 1) * sizeof(ABC); + else + abc = (LPABC) Buffer; + + if (fl & GCABCW_INDICES) return FALSE; // Not supported yet! + + BufferSize = Count * sizeof(ABC); SafeBuffer = ExAllocatePoolWithTag(PagedPool, BufferSize, TAG_GDITEXT); if (SafeBuffer == NULL) { @@ -2214,7 +2227,7 @@ (TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfHeight < 0 ? - TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfHeight : TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfHeight == 0 ? 11 : TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfHeight));
- for (i = FirstChar; i <= LastChar; i++) + for (i = FirstChar; i < FirstChar+Count; i++) { int adv, lsb, bbx, left, right;
@@ -2252,45 +2265,17 @@ }
/* - * @unimplemented - */ -BOOL -STDCALL -NtGdiGetCharABCWidthsW( - IN HDC hdc, - IN UINT wchFirst, - IN ULONG cwch, - IN OPTIONAL PWCHAR pwch, - IN FLONG fl, - OUT PVOID pvBuf) - { - UNIMPLEMENTED; - return FALSE; -} - - /* - * @unimplemented + * @implemented */ BOOL STDCALL NtGdiGetCharWidthW( - IN HDC hdc, - IN UINT wcFirst, - IN UINT cwc, + IN HDC hDC, + IN UINT FirstChar, + IN UINT Count, IN OPTIONAL PWCHAR pwc, IN FLONG fl, - OUT PVOID pvBuf) -{ - UNIMPLEMENTED; - return FALSE; -} - -BOOL -STDCALL -NtGdiGetCharWidth32(HDC hDC, - UINT FirstChar, - UINT LastChar, - LPINT Buffer) + OUT PVOID Buffer) { LPINT SafeBuffer; PDC dc; @@ -2300,14 +2285,20 @@ FT_CharMap charmap, found = NULL; UINT i, glyph_index, BufferSize; HFONT hFont = 0; - - if (LastChar < FirstChar) - { - SetLastWin32Error(ERROR_INVALID_PARAMETER); + PFLOAT BufF = NULL; + LPINT Buf = NULL; + + if (fl == 0) + { + BufF = (PFLOAT) Buffer; return FALSE; } - - BufferSize = (LastChar - FirstChar + 1) * sizeof(INT); + else + Buf = (LPINT) Buffer; + + if (fl & GCW_INDICES) return FALSE; + + BufferSize = Count * sizeof(INT); SafeBuffer = ExAllocatePoolWithTag(PagedPool, BufferSize, TAG_GDITEXT); if (SafeBuffer == NULL) { @@ -2369,7 +2360,7 @@ - TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfHeight : TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfHeight == 0 ? 11 : TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfHeight));
- for (i = FirstChar; i <= LastChar; i++) + for (i = FirstChar; i < FirstChar+Count; i++) { glyph_index = FT_Get_Char_Index(face, i); FT_Load_Glyph(face, glyph_index, FT_LOAD_DEFAULT); @@ -2410,7 +2401,7 @@ OUTLINETEXTMETRICW *potm; INT i; FT_Face face; - WCHAR DefChar = 0, tmDefaultChar; + WCHAR DefChar = 0; PWSTR Buffer = NULL; ULONG Size;
@@ -2441,18 +2432,20 @@ return GDI_ERROR; }
- Size = IntGetOutlineTextMetrics(FontGDI, 0, NULL); - potm = ExAllocatePoolWithTag(PagedPool, Size, TAG_GDITEXT); - if (!potm) + if (iMode & GGI_MARK_NONEXISTING_GLYPHS) DefChar = 0x001f; /* Indicate non existence */ + else { - Status = ERROR_NOT_ENOUGH_MEMORY; - goto ErrorRet; + Size = IntGetOutlineTextMetrics(FontGDI, 0, NULL); + potm = ExAllocatePoolWithTag(PagedPool, Size, TAG_GDITEXT); + if (!potm) + { + Status = ERROR_NOT_ENOUGH_MEMORY; + goto ErrorRet; + } + IntGetOutlineTextMetrics(FontGDI, Size, potm); + DefChar = potm->otmTextMetrics.tmDefaultChar; // May need this. + ExFreePool(potm); } - IntGetOutlineTextMetrics(FontGDI, Size, potm); - tmDefaultChar = potm->otmTextMetrics.tmDefaultChar; // May need this. - ExFreePool(potm); - - if (iMode & GGI_MARK_NONEXISTING_GLYPHS) DefChar = 0x001f; /* Indicate non existence */
_SEH_TRY { @@ -2474,11 +2467,7 @@ for (i = 0; i < cwc; i++) { Buffer[i] = FT_Get_Char_Index(face, UnSafepwc[i]); - if (Buffer[i] == 0) - { - if (!DefChar) DefChar = tmDefaultChar; - Buffer[i] = DefChar; - } + if (Buffer[i] == 0) Buffer[i] = DefChar; }
IntUnLockFreeType;
Modified: trunk/reactos/subsystems/win32/win32k/w32ksvc.db URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/w32... ============================================================================== --- trunk/reactos/subsystems/win32/win32k/w32ksvc.db (original) +++ trunk/reactos/subsystems/win32/win32k/w32ksvc.db Wed Nov 7 20:58:02 2007 @@ -746,9 +746,6 @@ NtGdiGetAspectRatioFilterEx 2 NtGdiGetBkColor 1 NtGdiGetBkMode 1 -NtGdiGetBrushOrgEx 2 -NtGdiGetCharABCWidths 4 -NtGdiGetCharWidth32 4 NtGdiGetClipBox 2 NtGdiGetColorSpace 1 NtGdiGetCurrentPositionEx 2