gdi32: Support StockFlag in GDI_HANDLE_ENTRY.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Jacek Caban 2021-08-06 15:59:07 +01:00 committed by Alexandre Julliard
parent 6b22f2bd60
commit 6d28f3029c
3 changed files with 15 additions and 5 deletions

View File

@ -613,6 +613,16 @@ static void set_gdi_shared(void)
NtCurrentTeb()->Peb->GdiSharedHandleTable = &gdi_shared;
}
static HGDIOBJ make_stock_object( HGDIOBJ obj )
{
GDI_HANDLE_ENTRY *entry;
if (!(entry = handle_entry( obj ))) return 0;
entry_obj( entry )->system = TRUE;
entry->StockFlag = 1;
return entry_to_handle( entry );
}
/***********************************************************************
* DllMain
*
@ -668,8 +678,8 @@ BOOL WINAPI DllMain( HINSTANCE inst, DWORD reason, LPVOID reserved )
/* clear the NOSYSTEM bit on all stock objects*/
for (i = 0; i < NB_STOCK_OBJECTS; i++)
{
if (stock_objects[i]) __wine_make_gdi_object_system( stock_objects[i], TRUE );
if (scaled_stock_objects[i]) __wine_make_gdi_object_system( scaled_stock_objects[i], TRUE );
stock_objects[i] = make_stock_object( stock_objects[i] );
scaled_stock_objects[i] = make_stock_object( scaled_stock_objects[i] );
}
return TRUE;
}

View File

@ -396,7 +396,6 @@ static void test_shared_handle_entry( HGDIOBJ obj, unsigned int type, BOOL is_st
todo_wine
ok(entry->ExtType == NTGDI_OBJ_DC, "ExtType = %x, expected NTGDI_OBJ_DC\n", entry->ExtType);
}
todo_wine_if(is_stock)
ok(entry->StockFlag == is_stock, "StockFlag = %x\n", entry->StockFlag);
ok(entry->Type == (type & 0x1f), "Type = %x, expected %x\n", entry->Type, type & 0x1f);
ok(entry->Object, "Object = NULL\n");

View File

@ -67,8 +67,9 @@ typedef struct _GDI_HANDLE_ENTRY
/* Wine extension, native uses NTGDI_OBJ_DC */
#define NTGDI_OBJ_MEMDC 0x41
#define NTGDI_HANDLE_TYPE_SHIFT 16
#define NTGDI_HANDLE_TYPE_MASK 0x007f0000
#define NTGDI_HANDLE_TYPE_SHIFT 16
#define NTGDI_HANDLE_TYPE_MASK 0x007f0000
#define NTGDI_HANDLE_STOCK_OBJECT 0x00800000
typedef struct _GDI_SHARED_MEMORY
{