Commit 82f29bff authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

gdi32: Use NtQuerySystemInformation instead of GetSystemInfo.

parent 57460dbb
......@@ -1531,12 +1531,10 @@ HBITMAP WINAPI NtGdiCreateDIBSection( HDC hdc, HANDLE section, DWORD offset, con
if (section)
{
SYSTEM_INFO SystemInfo;
DWORD mapOffset;
INT mapSize;
GetSystemInfo( &SystemInfo );
mapOffset = offset - (offset % SystemInfo.dwAllocationGranularity);
mapOffset = offset - (offset % system_info.AllocationGranularity);
mapSize = bmp->dib.dsBmih.biSizeImage + (offset - mapOffset);
mapBits = MapViewOfFile( section, FILE_MAP_ALL_ACCESS, 0, mapOffset, mapSize );
if (mapBits) bmp->dib.dsBm.bmBits = (char *)mapBits + (offset - mapOffset);
......@@ -1741,10 +1739,8 @@ static BOOL DIB_DeleteObject( HGDIOBJ handle )
if (bmp->dib.dshSection)
{
SYSTEM_INFO SystemInfo;
GetSystemInfo( &SystemInfo );
UnmapViewOfFile( (char *)bmp->dib.dsBm.bmBits -
(bmp->dib.dsOffset % SystemInfo.dwAllocationGranularity) );
(bmp->dib.dsOffset % system_info.AllocationGranularity) );
}
else VirtualFree( bmp->dib.dsBm.bmBits, 0, MEM_RELEASE );
......
......@@ -43,6 +43,7 @@ static GDI_HANDLE_ENTRY *next_free;
static GDI_HANDLE_ENTRY *next_unused = gdi_shared.Handles + FIRST_GDI_HANDLE;
static LONG debug_count;
HMODULE gdi32_module = 0;
SYSTEM_BASIC_INFORMATION system_info;
static inline HGDIOBJ entry_to_handle( GDI_HANDLE_ENTRY *entry )
{
......@@ -702,6 +703,7 @@ BOOL WINAPI DllMain( HINSTANCE inst, DWORD reason, LPVOID reserved )
gdi32_module = inst;
DisableThreadLibraryCalls( inst );
NtQuerySystemInformation( SystemBasicInformation, &system_info, sizeof(system_info), NULL );
set_gdi_shared();
font_init();
init_stock_objects();
......
......@@ -648,5 +648,6 @@ extern void CDECL free_heap_bits( struct gdi_image_bits *bits ) DECLSPEC_HIDDEN;
void set_gdi_client_ptr( HGDIOBJ handle, void *ptr ) DECLSPEC_HIDDEN;
extern HMODULE gdi32_module DECLSPEC_HIDDEN;
extern SYSTEM_BASIC_INFORMATION system_info DECLSPEC_HIDDEN;
#endif /* __WINE_NTGDI_PRIVATE_H */
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