diff --git a/reactos/dll/win32/gdi32/misc/stubs.c b/reactos/dll/win32/gdi32/misc/stubs.c index db94b81f7c1..3b06aa56b5b 100644 --- a/reactos/dll/win32/gdi32/misc/stubs.c +++ b/reactos/dll/win32/gdi32/misc/stubs.c @@ -251,9 +251,7 @@ GetTextCharacterExtra( HDC hDc ) { - UNIMPLEMENTED; - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return 0; + return NtGdiGetSetTextCharExtra( hDc, 0, FALSE); } @@ -390,13 +388,11 @@ SetSystemPaletteUse( int STDCALL SetTextCharacterExtra( - HDC a0, - int a1 + HDC hDC, + int CharExtra ) { - UNIMPLEMENTED; - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return 0; + return NtGdiGetSetTextCharExtra( hDC, CharExtra, TRUE); } diff --git a/reactos/include/reactos/win32k/ntgdibad.h b/reactos/include/reactos/win32k/ntgdibad.h index 0148c2875b1..18d9e5de88a 100644 --- a/reactos/include/reactos/win32k/ntgdibad.h +++ b/reactos/include/reactos/win32k/ntgdibad.h @@ -679,6 +679,11 @@ INT STDCALL NtGdiGetROP2(HDC hDC); /* Should be done in user-mode using shared GDI Objects. */ INT STDCALL NtGdiGetRelAbs(HDC hDC); +/* Should be done in user-mode using shared GDI Objects. */ +INT +STDCALL +NtGdiGetSetTextCharExtra( HDC hDC, INT CharExtra, BOOL Set); + /* Should be done in user-mode using shared GDI Objects. */ INT STDCALL NtGdiGetStretchBltMode(HDC hDC); diff --git a/reactos/subsystems/win32/win32k/objects/text.c b/reactos/subsystems/win32/win32k/objects/text.c index 9755371f547..2939b829877 100644 --- a/reactos/subsystems/win32/win32k/objects/text.c +++ b/reactos/subsystems/win32/win32k/objects/text.c @@ -3267,4 +3267,26 @@ FontGetObject(PTEXTOBJ Font, INT Count, PVOID Buffer) return sizeof(LOGFONTW); } + +/* Remove this HAX! after the below function is done in GDI32.DLL! */ +INT +STDCALL +NtGdiGetSetTextCharExtra( HDC hDC, INT CharExtra, BOOL Set) +{ + /* Ulta-Ugly Hax! */ + INT Ret = 0x80000000; + DPRINT("TextCharacterExtra %d", CharExtra); + PDC dc = DC_LockDc ( hDC ); + if (!dc) + { + SetLastWin32Error(ERROR_INVALID_HANDLE); + } + else + { + Ret = dc->w.charExtra; + if( Set ) dc->w.charExtra = CharExtra; + } + return (Ret); +} + /* EOF */ diff --git a/reactos/tools/nci/w32ksvc.db b/reactos/tools/nci/w32ksvc.db index cbf6e8e7ade..823f9edf195 100644 --- a/reactos/tools/nci/w32ksvc.db +++ b/reactos/tools/nci/w32ksvc.db @@ -150,6 +150,7 @@ NtGdiGetRasterizerCaps 2 NtGdiGetRelAbs 1 NtGdiGetRegionData 3 NtGdiGetRgnBox 2 +NtGdiGetSetTextCharExtra 3 NtGdiGetStockObject 1 NtGdiGetStretchBltMode 1 NtGdiGetSystemPaletteEntries 4