Commit 5b513cbb authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

gdi32: Avoid calling kernel32 from ntgdi functions.

parent 9ca7966a
...@@ -745,13 +745,13 @@ static inline void lock_surface( struct windrv_physdev *dev ) ...@@ -745,13 +745,13 @@ static inline void lock_surface( struct windrv_physdev *dev )
{ {
GDI_CheckNotLock(); GDI_CheckNotLock();
dev->surface->funcs->lock( dev->surface ); dev->surface->funcs->lock( dev->surface );
if (is_rect_empty( dev->dibdrv->bounds )) dev->start_ticks = GetTickCount(); if (is_rect_empty( dev->dibdrv->bounds )) dev->start_ticks = NtGetTickCount();
} }
static inline void unlock_surface( struct windrv_physdev *dev ) static inline void unlock_surface( struct windrv_physdev *dev )
{ {
dev->surface->funcs->unlock( dev->surface ); dev->surface->funcs->unlock( dev->surface );
if (GetTickCount() - dev->start_ticks > FLUSH_PERIOD) dev->surface->funcs->flush( dev->surface ); if (NtGetTickCount() - dev->start_ticks > FLUSH_PERIOD) dev->surface->funcs->flush( dev->surface );
} }
static void CDECL unlock_bits_surface( struct gdi_image_bits *bits ) static void CDECL unlock_bits_surface( struct gdi_image_bits *bits )
......
...@@ -235,7 +235,7 @@ void CDECL __wine_set_display_driver( HMODULE module ) ...@@ -235,7 +235,7 @@ void CDECL __wine_set_display_driver( HMODULE module )
if (!(driver = create_driver( module ))) if (!(driver = create_driver( module )))
{ {
ERR( "Could not create graphics driver\n" ); ERR( "Could not create graphics driver\n" );
ExitProcess(1); NtTerminateProcess( GetCurrentThread(), 1 );
} }
if (InterlockedCompareExchangePointer( (void **)&display_driver, driver, NULL )) if (InterlockedCompareExchangePointer( (void **)&display_driver, driver, NULL ))
HeapFree( GetProcessHeap(), 0, driver ); HeapFree( GetProcessHeap(), 0, driver );
......
...@@ -885,7 +885,7 @@ void GDI_CheckNotLock(void) ...@@ -885,7 +885,7 @@ void GDI_CheckNotLock(void)
if (RtlIsCriticalSectionLockedByThread(&gdi_section)) if (RtlIsCriticalSectionLockedByThread(&gdi_section))
{ {
ERR( "BUG: holding GDI lock\n" ); ERR( "BUG: holding GDI lock\n" );
DebugBreak(); assert( 0 );
} }
} }
......
...@@ -39,10 +39,14 @@ WINE_DEFAULT_DEBUG_CHANNEL(print); ...@@ -39,10 +39,14 @@ WINE_DEFAULT_DEBUG_CHANNEL(print);
*/ */
DWORD WINAPI NtGdiGetSpoolMessage( void *ptr1, DWORD data2, void *ptr3, DWORD data4 ) DWORD WINAPI NtGdiGetSpoolMessage( void *ptr1, DWORD data2, void *ptr3, DWORD data4 )
{ {
TRACE("(%p 0x%x %p 0x%x) stub\n", ptr1, data2, ptr3, data4); LARGE_INTEGER time;
TRACE( "(%p 0x%x %p 0x%x) stub\n", ptr1, data2, ptr3, data4 );
/* avoid 100% cpu usage with spoolsv.exe from w2k /* avoid 100% cpu usage with spoolsv.exe from w2k
(spoolsv.exe from xp does Sleep 1000/1500/2000 in a loop) */ (spoolsv.exe from xp does Sleep 1000/1500/2000 in a loop) */
Sleep(500); time.QuadPart = 500 * -10000;
NtDelayExecution( FALSE, &time );
return 0; return 0;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment