Use MapLS/UnMapLS instead of SEGPTR_* macros.
[wine] / graphics / win16drv / brush.c
1 /*
2  * GDI brush objects - win16drv
3  *
4  * Copyright 1997  John Harvey
5  */
6
7 #include <stdlib.h>
8 #include "win16drv.h"
9 #include "debugtools.h"
10
11 DEFAULT_DEBUG_CHANNEL(win16drv);
12
13 HBRUSH WIN16DRV_BRUSH_SelectObject( DC * dc, HBRUSH hbrush )
14 {
15     WIN16DRV_PDEVICE *physDev = (WIN16DRV_PDEVICE *)dc->physDev;
16     HBRUSH16     prevHandle = dc->hBrush;
17     int          nSize;
18     LOGBRUSH16 lBrush16;
19
20     if (!GetObject16( hbrush, sizeof(lBrush16), &lBrush16 )) return 0;
21
22     dc->hBrush = hbrush;
23     if ( physDev->BrushInfo )
24     {
25         TRACE("UnRealizing BrushInfo\n");
26         nSize = PRTDRV_RealizeObject (physDev->segptrPDEVICE, -DRVOBJ_BRUSH,
27                                       physDev->BrushInfo,
28                                       physDev->BrushInfo, 0);
29     }
30     else 
31     {
32         nSize = PRTDRV_RealizeObject (physDev->segptrPDEVICE, DRVOBJ_BRUSH,
33                                   &lBrush16, 0, 0); 
34         physDev->BrushInfo = HeapAlloc( GetProcessHeap(), 0, nSize );
35     }
36
37
38     nSize = PRTDRV_RealizeObject(physDev->segptrPDEVICE, DRVOBJ_BRUSH,
39                                  &lBrush16, 
40                                  physDev->BrushInfo, 
41                                  win16drv_SegPtr_TextXForm); 
42                          
43     return prevHandle;
44 }