Commit d7b76822 authored by Alexandre Julliard's avatar Alexandre Julliard

Use MapLS/UnMapLS instead of SEGPTR_* macros.

parent 6f011c08
...@@ -20,7 +20,6 @@ ...@@ -20,7 +20,6 @@
#include "vfw16.h" #include "vfw16.h"
#include "wine/winbase16.h" #include "wine/winbase16.h"
#include "debugtools.h" #include "debugtools.h"
#include "heap.h"
#include "stackframe.h" #include "stackframe.h"
DEFAULT_DEBUG_CHANNEL(msvideo); DEFAULT_DEBUG_CHANNEL(msvideo);
...@@ -220,17 +219,18 @@ HIC VFWAPI ICOpen(DWORD fccType,DWORD fccHandler,UINT wMode) { ...@@ -220,17 +219,18 @@ HIC VFWAPI ICOpen(DWORD fccType,DWORD fccHandler,UINT wMode) {
HIC MSVIDEO_OpenFunc(DWORD fccType, DWORD fccHandler, UINT wMode, FARPROC lpfnHandler, BOOL bFrom32) { HIC MSVIDEO_OpenFunc(DWORD fccType, DWORD fccHandler, UINT wMode, FARPROC lpfnHandler, BOOL bFrom32) {
char type[5],handler[5],codecname[20]; char type[5],handler[5],codecname[20];
HIC16 hic; HIC16 hic;
ICOPEN* icopen = SEGPTR_NEW(ICOPEN); ICOPEN icopen;
SEGPTR seg_icopen;
WINE_HIC *whic; WINE_HIC *whic;
memcpy(type,&fccType,4);type[4]=0; memcpy(type,&fccType,4);type[4]=0;
memcpy(handler,&fccHandler,4);handler[4]=0; memcpy(handler,&fccHandler,4);handler[4]=0;
TRACE("(%s,%s,%d,%p,%d)\n",type,handler,wMode,lpfnHandler,bFrom32?32:16); TRACE("(%s,%s,%d,%p,%d)\n",type,handler,wMode,lpfnHandler,bFrom32?32:16);
icopen->fccType = fccType; icopen.fccType = fccType;
icopen->fccHandler = fccHandler; icopen.fccHandler = fccHandler;
icopen->dwSize = sizeof(ICOPEN); icopen.dwSize = sizeof(ICOPEN);
icopen->dwFlags = wMode; icopen.dwFlags = wMode;
sprintf(codecname,"%s.%s",type,handler); sprintf(codecname,"%s.%s",type,handler);
...@@ -253,7 +253,9 @@ HIC MSVIDEO_OpenFunc(DWORD fccType, DWORD fccHandler, UINT wMode, FARPROC lpfnHa ...@@ -253,7 +253,9 @@ HIC MSVIDEO_OpenFunc(DWORD fccType, DWORD fccHandler, UINT wMode, FARPROC lpfnHa
/* return value is not checked */ /* return value is not checked */
MSVIDEO_SendMessage(hic,DRV_ENABLE,0L,0L,bFrom32); MSVIDEO_SendMessage(hic,DRV_ENABLE,0L,0L,bFrom32);
whic->hdrv = MSVIDEO_SendMessage(hic,DRV_OPEN,0,(LPARAM)(SEGPTR_GET(icopen)),FALSE); seg_icopen = MapLS( &icopen );
whic->hdrv = MSVIDEO_SendMessage(hic,DRV_OPEN,0,seg_icopen,FALSE);
UnMapLS( seg_icopen );
if (whic->hdrv == 0) { if (whic->hdrv == 0) {
WARN("DRV_OPEN failed for hic 0x%08lx\n",(DWORD)hic); WARN("DRV_OPEN failed for hic 0x%08lx\n",(DWORD)hic);
GlobalFree16(hic); GlobalFree16(hic);
...@@ -504,26 +506,28 @@ DWORD VFWAPIV ICCompress16(HIC16 hic, DWORD dwFlags, LPBITMAPINFOHEADER lpbiOutp ...@@ -504,26 +506,28 @@ DWORD VFWAPIV ICCompress16(HIC16 hic, DWORD dwFlags, LPBITMAPINFOHEADER lpbiOutp
LPBITMAPINFOHEADER lpbiPrev, LPVOID lpPrev) { LPBITMAPINFOHEADER lpbiPrev, LPVOID lpPrev) {
DWORD ret; DWORD ret;
ICCOMPRESS *iccmp = SEGPTR_NEW(ICCOMPRESS); ICCOMPRESS iccmp;
SEGPTR seg_iccmp;
TRACE("(0x%08lx,%ld,%p,%p,%p,%p,...)\n",(DWORD)hic,dwFlags,lpbiOutput,lpData,lpbiInput,lpBits); TRACE("(0x%08lx,%ld,%p,%p,%p,%p,...)\n",(DWORD)hic,dwFlags,lpbiOutput,lpData,lpbiInput,lpBits);
iccmp->dwFlags = dwFlags; iccmp.dwFlags = dwFlags;
iccmp->lpbiOutput = lpbiOutput; iccmp.lpbiOutput = lpbiOutput;
iccmp->lpOutput = lpData; iccmp.lpOutput = lpData;
iccmp->lpbiInput = lpbiInput; iccmp.lpbiInput = lpbiInput;
iccmp->lpInput = lpBits; iccmp.lpInput = lpBits;
iccmp->lpckid = lpckid; iccmp.lpckid = lpckid;
iccmp->lpdwFlags = lpdwFlags; iccmp.lpdwFlags = lpdwFlags;
iccmp->lFrameNum = lFrameNum; iccmp.lFrameNum = lFrameNum;
iccmp->dwFrameSize = dwFrameSize; iccmp.dwFrameSize = dwFrameSize;
iccmp->dwQuality = dwQuality; iccmp.dwQuality = dwQuality;
iccmp->lpbiPrev = lpbiPrev; iccmp.lpbiPrev = lpbiPrev;
iccmp->lpPrev = lpPrev; iccmp.lpPrev = lpPrev;
ret = ICSendMessage16(hic,ICM_COMPRESS,(DWORD)SEGPTR_GET(iccmp),sizeof(ICCOMPRESS)); seg_iccmp = MapLS( &iccmp );
SEGPTR_FREE(iccmp); ret = ICSendMessage16(hic,ICM_COMPRESS,seg_iccmp,sizeof(ICCOMPRESS));
UnMapLS( seg_iccmp );
return ret; return ret;
} }
...@@ -560,23 +564,23 @@ DWORD VFWAPIV ICDecompress(HIC hic,DWORD dwFlags,LPBITMAPINFOHEADER lpbiFormat, ...@@ -560,23 +564,23 @@ DWORD VFWAPIV ICDecompress(HIC hic,DWORD dwFlags,LPBITMAPINFOHEADER lpbiFormat,
* _ICDecompress [MSVIDEO.230] * _ICDecompress [MSVIDEO.230]
*/ */
DWORD VFWAPIV ICDecompress16(HIC16 hic, DWORD dwFlags, LPBITMAPINFOHEADER lpbiFormat, DWORD VFWAPIV ICDecompress16(HIC16 hic, DWORD dwFlags, LPBITMAPINFOHEADER lpbiFormat,
LPVOID lpData, LPBITMAPINFOHEADER lpbi, LPVOID lpBits) { LPVOID lpData, LPBITMAPINFOHEADER lpbi, LPVOID lpBits)
{
ICDECOMPRESS *icd = SEGPTR_NEW(ICDECOMPRESS); ICDECOMPRESS icd;
SEGPTR segptr;
DWORD ret; DWORD ret;
TRACE("(0x%08lx,%ld,%p,%p,%p,%p)\n",(DWORD)hic,dwFlags,lpbiFormat,lpData,lpbi,lpBits); TRACE("(0x%08lx,%ld,%p,%p,%p,%p)\n",(DWORD)hic,dwFlags,lpbiFormat,lpData,lpbi,lpBits);
icd->dwFlags = dwFlags; icd.dwFlags = dwFlags;
icd->lpbiInput = lpbiFormat; icd.lpbiInput = lpbiFormat;
icd->lpInput = lpData; icd.lpInput = lpData;
icd->lpbiOutput = lpbi; icd.lpbiOutput = lpbi;
icd->lpOutput = lpBits; icd.lpOutput = lpBits;
icd->ckid = 0; icd.ckid = 0;
segptr = MapLS( &icd );
ret = ICSendMessage16(hic,ICM_DECOMPRESS,(DWORD)SEGPTR_GET(icd),sizeof(ICDECOMPRESS)); ret = ICSendMessage16(hic,ICM_DECOMPRESS,segptr,sizeof(ICDECOMPRESS));
UnMapLS( segptr );
SEGPTR_FREE(icd);
return ret; return ret;
} }
...@@ -996,6 +1000,7 @@ LRESULT VFWAPIV ICMessage16(void) { ...@@ -996,6 +1000,7 @@ LRESULT VFWAPIV ICMessage16(void) {
UINT16 msg; UINT16 msg;
UINT16 cb; UINT16 cb;
LPWORD lpData; LPWORD lpData;
SEGPTR segData;
LRESULT ret; LRESULT ret;
UINT16 i; UINT16 i;
...@@ -1006,7 +1011,7 @@ LRESULT VFWAPIV ICMessage16(void) { ...@@ -1006,7 +1011,7 @@ LRESULT VFWAPIV ICMessage16(void) {
msg = VA_ARG16(valist, UINT16); msg = VA_ARG16(valist, UINT16);
cb = VA_ARG16(valist, UINT16); cb = VA_ARG16(valist, UINT16);
lpData = SEGPTR_ALLOC(cb); lpData = HeapAlloc( GetProcessHeap(), 0, cb );
TRACE("0x%08lx, %u, %u, ...)\n",(DWORD)hic,msg,cb); TRACE("0x%08lx, %u, %u, ...)\n",(DWORD)hic,msg,cb);
...@@ -1015,9 +1020,10 @@ LRESULT VFWAPIV ICMessage16(void) { ...@@ -1015,9 +1020,10 @@ LRESULT VFWAPIV ICMessage16(void) {
} }
VA_END16(valist); VA_END16(valist);
ret = ICSendMessage16(hic, msg, (DWORD)(SEGPTR_GET(lpData)), (DWORD)cb); segData = MapLS( lpData );
ret = ICSendMessage16(hic, msg, segData, (DWORD)cb);
SEGPTR_FREE(lpData); UnMapLS( segData );
HeapFree( GetProcessHeap(), 0, lpData );
return ret; return ret;
} }
...@@ -1089,30 +1095,31 @@ DWORD VFWAPIV ICDrawBegin16( ...@@ -1089,30 +1095,31 @@ DWORD VFWAPIV ICDrawBegin16(
DWORD dwScale) /* [in] */ DWORD dwScale) /* [in] */
{ {
DWORD ret; DWORD ret;
ICDRAWBEGIN16* icdb = SEGPTR_NEW(ICDRAWBEGIN16); /* SEGPTR for mapper to deal with */ ICDRAWBEGIN16 icdb;
SEGPTR seg_icdb;
TRACE("(0x%08lx,%ld,0x%08lx,0x%08lx,0x%08lx,%u,%u,%u,%u,%p,%u,%u,%u,%u,%ld,%ld)\n", TRACE("(0x%08lx,%ld,0x%08lx,0x%08lx,0x%08lx,%u,%u,%u,%u,%p,%u,%u,%u,%u,%ld,%ld)\n",
(DWORD)hic, dwFlags, (DWORD)hpal, (DWORD)hwnd, (DWORD)hdc, xDst, yDst, dxDst, dyDst, (DWORD)hic, dwFlags, (DWORD)hpal, (DWORD)hwnd, (DWORD)hdc, xDst, yDst, dxDst, dyDst,
lpbi, xSrc, ySrc, dxSrc, dySrc, dwRate, dwScale); lpbi, xSrc, ySrc, dxSrc, dySrc, dwRate, dwScale);
icdb->dwFlags = dwFlags; icdb.dwFlags = dwFlags;
icdb->hpal = hpal; icdb.hpal = hpal;
icdb->hwnd = hwnd; icdb.hwnd = hwnd;
icdb->hdc = hdc; icdb.hdc = hdc;
icdb->xDst = xDst; icdb.xDst = xDst;
icdb->yDst = yDst; icdb.yDst = yDst;
icdb->dxDst = dxDst; icdb.dxDst = dxDst;
icdb->dyDst = dyDst; icdb.dyDst = dyDst;
icdb->lpbi = lpbi; /* Keep this as SEGPTR for the mapping code to deal with */ icdb.lpbi = lpbi; /* Keep this as SEGPTR for the mapping code to deal with */
icdb->xSrc = xSrc; icdb.xSrc = xSrc;
icdb->ySrc = ySrc; icdb.ySrc = ySrc;
icdb->dxSrc = dxSrc; icdb.dxSrc = dxSrc;
icdb->dySrc = dySrc; icdb.dySrc = dySrc;
icdb->dwRate = dwRate; icdb.dwRate = dwRate;
icdb->dwScale = dwScale; icdb.dwScale = dwScale;
seg_icdb = MapLS( &icdb );
ret = (DWORD)ICSendMessage16(hic,ICM_DRAW_BEGIN,(DWORD)SEGPTR_GET(icdb),sizeof(ICDRAWBEGIN16)); ret = (DWORD)ICSendMessage16(hic,ICM_DRAW_BEGIN,seg_icdb,sizeof(ICDRAWBEGIN16));
SEGPTR_FREE(icdb); UnMapLS( seg_icdb );
return ret; return ret;
} }
...@@ -1144,16 +1151,20 @@ DWORD VFWAPIV ICDraw16( ...@@ -1144,16 +1151,20 @@ DWORD VFWAPIV ICDraw16(
DWORD cbData, DWORD cbData,
LONG lTime) LONG lTime)
{ {
ICDRAW* icd = SEGPTR_NEW(ICDRAW); /* SEGPTR for mapper to deal with */ DWORD ret;
ICDRAW icd;
SEGPTR seg_icd;
TRACE("(0x%08lx,0x%08lx,%p,%p,%ld,%ld)\n",(DWORD)hic,dwFlags,lpFormat,lpData,cbData,lTime); TRACE("(0x%08lx,0x%08lx,%p,%p,%ld,%ld)\n",(DWORD)hic,dwFlags,lpFormat,lpData,cbData,lTime);
icd->dwFlags = dwFlags; icd.dwFlags = dwFlags;
icd->lpFormat = lpFormat; icd.lpFormat = lpFormat;
icd->lpData = lpData; icd.lpData = lpData;
icd->cbData = cbData; icd.cbData = cbData;
icd->lTime = lTime; icd.lTime = lTime;
seg_icd = MapLS( &icd );
return ICSendMessage16(hic,ICM_DRAW,(DWORD)SEGPTR_GET(icd),sizeof(ICDRAW)); ret = ICSendMessage16(hic,ICM_DRAW,seg_icd,sizeof(ICDRAW));
UnMapLS( seg_icd );
return ret;
} }
/*********************************************************************** /***********************************************************************
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
#include <string.h> #include <string.h>
#include "wine/windef16.h"
#include "ole2.h" #include "ole2.h"
#include "oleauto.h" #include "oleauto.h"
#include "windef.h" #include "windef.h"
...@@ -16,7 +17,6 @@ ...@@ -16,7 +17,6 @@
#include "wingdi.h" #include "wingdi.h"
#include "winuser.h" #include "winuser.h"
#include "heap.h"
#include "ole2disp.h" #include "ole2disp.h"
#include "olectl.h" #include "olectl.h"
...@@ -33,8 +33,8 @@ DEFAULT_DEBUG_CHANNEL(ole); ...@@ -33,8 +33,8 @@ DEFAULT_DEBUG_CHANNEL(ole);
*/ */
static BSTR16 BSTR_AllocBytes(int n) static BSTR16 BSTR_AllocBytes(int n)
{ {
void *ptr = SEGPTR_ALLOC(n); void *ptr = HeapAlloc( GetProcessHeap(), 0, n );
return (BSTR16)SEGPTR_GET(ptr); return (BSTR16)MapLS(ptr);
} }
/****************************************************************************** /******************************************************************************
...@@ -42,7 +42,9 @@ static BSTR16 BSTR_AllocBytes(int n) ...@@ -42,7 +42,9 @@ static BSTR16 BSTR_AllocBytes(int n)
*/ */
static void BSTR_Free(BSTR16 in) static void BSTR_Free(BSTR16 in)
{ {
SEGPTR_FREE( MapSL((SEGPTR)in) ); void *ptr = MapSL( (SEGPTR)in );
UnMapLS( (SEGPTR)in );
HeapFree( GetProcessHeap(), 0, ptr );
} }
/****************************************************************************** /******************************************************************************
......
...@@ -6,7 +6,6 @@ ...@@ -6,7 +6,6 @@
#include "wine/winuser16.h" #include "wine/winuser16.h"
#include "winerror.h" #include "winerror.h"
#include "heap.h"
#include "hook.h" #include "hook.h"
#include "message.h" #include "message.h"
#include "spy.h" #include "spy.h"
...@@ -34,25 +33,24 @@ LRESULT WINAPI SendMessage16( HWND16 hwnd16, UINT16 msg, WPARAM16 wparam, LPARAM ...@@ -34,25 +33,24 @@ LRESULT WINAPI SendMessage16( HWND16 hwnd16, UINT16 msg, WPARAM16 wparam, LPARAM
/* first the WH_CALLWNDPROC hook */ /* first the WH_CALLWNDPROC hook */
if (HOOK_IsHooked( WH_CALLWNDPROC )) if (HOOK_IsHooked( WH_CALLWNDPROC ))
{ {
CWPSTRUCT16 *cwp; CWPSTRUCT16 cwp;
SEGPTR seg_cwp;
if ((cwp = SEGPTR_NEW(CWPSTRUCT16)))
{ cwp.hwnd = hwnd16;
cwp->hwnd = hwnd16; cwp.message = msg;
cwp->message = msg; cwp.wParam = wparam;
cwp->wParam = wparam; cwp.lParam = lparam;
cwp->lParam = lparam; seg_cwp = MapLS( &cwp );
HOOK_CallHooks16( WH_CALLWNDPROC, HC_ACTION, 1, SEGPTR_GET(cwp) ); HOOK_CallHooks16( WH_CALLWNDPROC, HC_ACTION, 1, seg_cwp );
if (cwp->hwnd != hwnd16) UnMapLS( seg_cwp );
if (cwp.hwnd != hwnd16)
{ {
hwnd16 = cwp->hwnd; hwnd16 = cwp.hwnd;
hwnd = WIN_Handle32( hwnd16 ); hwnd = WIN_Handle32( hwnd16 );
} }
msg = cwp->message; msg = cwp.message;
wparam = cwp->wParam; wparam = cwp.wParam;
lparam = cwp->lParam; lparam = cwp.lParam;
SEGPTR_FREE( cwp );
}
} }
if (!(winproc = (WNDPROC16)GetWindowLong16( hwnd16, GWL_WNDPROC ))) return 0; if (!(winproc = (WNDPROC16)GetWindowLong16( hwnd16, GWL_WNDPROC ))) return 0;
......
...@@ -10,7 +10,6 @@ ...@@ -10,7 +10,6 @@
#include "wingdi.h" #include "wingdi.h"
#include "wine/winuser16.h" #include "wine/winuser16.h"
#include "wine/server.h" #include "wine/server.h"
#include "heap.h"
/* size of buffer needed to store an atom string */ /* size of buffer needed to store an atom string */
#define ATOM_BUFFER_SIZE 256 #define ATOM_BUFFER_SIZE 256
...@@ -289,19 +288,20 @@ INT16 WINAPI EnumProps16( HWND16 hwnd, PROPENUMPROC16 func ) ...@@ -289,19 +288,20 @@ INT16 WINAPI EnumProps16( HWND16 hwnd, PROPENUMPROC16 func )
if (list) if (list)
{ {
char *string = SEGPTR_ALLOC( ATOM_BUFFER_SIZE ); char string[ATOM_BUFFER_SIZE];
SEGPTR segptr = MapLS( string );
for (i = 0; i < count; i++) for (i = 0; i < count; i++)
{ {
if (list[i].string) /* it was a string originally */ if (list[i].string) /* it was a string originally */
{ {
if (!GlobalGetAtomNameA( list[i].atom, string, ATOM_BUFFER_SIZE )) continue; if (!GlobalGetAtomNameA( list[i].atom, string, ATOM_BUFFER_SIZE )) continue;
ret = PROP_CallTo16_word_wlw( func, hwnd, SEGPTR_GET(string), list[i].handle ); ret = PROP_CallTo16_word_wlw( func, hwnd, segptr, list[i].handle );
} }
else else
ret = PROP_CallTo16_word_wlw( func, hwnd, list[i].atom, list[i].handle ); ret = PROP_CallTo16_word_wlw( func, hwnd, list[i].atom, list[i].handle );
if (!ret) break; if (!ret) break;
} }
SEGPTR_FREE( string ); UnMapLS( segptr );
HeapFree( GetProcessHeap(), 0, list ); HeapFree( GetProcessHeap(), 0, list );
} }
return ret; return ret;
......
...@@ -6,7 +6,6 @@ ...@@ -6,7 +6,6 @@
#include <stdlib.h> #include <stdlib.h>
#include "win16drv.h" #include "win16drv.h"
#include "heap.h"
#include "debugtools.h" #include "debugtools.h"
DEFAULT_DEBUG_CHANNEL(win16drv); DEFAULT_DEBUG_CHANNEL(win16drv);
...@@ -32,7 +31,7 @@ HBRUSH WIN16DRV_BRUSH_SelectObject( DC * dc, HBRUSH hbrush ) ...@@ -32,7 +31,7 @@ HBRUSH WIN16DRV_BRUSH_SelectObject( DC * dc, HBRUSH hbrush )
{ {
nSize = PRTDRV_RealizeObject (physDev->segptrPDEVICE, DRVOBJ_BRUSH, nSize = PRTDRV_RealizeObject (physDev->segptrPDEVICE, DRVOBJ_BRUSH,
&lBrush16, 0, 0); &lBrush16, 0, 0);
physDev->BrushInfo = SEGPTR_ALLOC( nSize ); physDev->BrushInfo = HeapAlloc( GetProcessHeap(), 0, nSize );
} }
......
...@@ -10,7 +10,6 @@ ...@@ -10,7 +10,6 @@
#include "wine/winbase16.h" #include "wine/winbase16.h"
#include "win16drv.h" #include "win16drv.h"
#include "font.h" #include "font.h"
#include "heap.h"
#include "gdi.h" #include "gdi.h"
#include "debugtools.h" #include "debugtools.h"
...@@ -97,12 +96,12 @@ HFONT WIN16DRV_FONT_SelectObject( DC * dc, HFONT hfont) ...@@ -97,12 +96,12 @@ HFONT WIN16DRV_FONT_SelectObject( DC * dc, HFONT hfont)
if( physDev->FontInfo && if( physDev->FontInfo &&
HeapSize( GetProcessHeap(), 0, physDev->FontInfo ) < nSize ) HeapSize( GetProcessHeap(), 0, physDev->FontInfo ) < nSize )
{ {
SEGPTR_FREE( physDev->FontInfo ); HeapFree( GetProcessHeap(), 0, physDev->FontInfo );
physDev->FontInfo = NULL; physDev->FontInfo = NULL;
} }
if( !physDev->FontInfo ) if( !physDev->FontInfo )
physDev->FontInfo = SEGPTR_ALLOC( nSize ); physDev->FontInfo = HeapAlloc( GetProcessHeap(), 0, nSize );
nSize = PRTDRV_RealizeObject(physDev->segptrPDEVICE, DRVOBJ_FONT, nSize = PRTDRV_RealizeObject(physDev->segptrPDEVICE, DRVOBJ_FONT,
......
...@@ -13,7 +13,6 @@ ...@@ -13,7 +13,6 @@
#include "win16drv.h" #include "win16drv.h"
#include "gdi.h" #include "gdi.h"
#include "bitmap.h" #include "bitmap.h"
#include "heap.h"
#include "font.h" #include "font.h"
#include "debugtools.h" #include "debugtools.h"
......
...@@ -5,7 +5,6 @@ ...@@ -5,7 +5,6 @@
*/ */
#include "win16drv.h" #include "win16drv.h"
#include "heap.h"
#include "debugtools.h" #include "debugtools.h"
DEFAULT_DEBUG_CHANNEL(win16drv); DEFAULT_DEBUG_CHANNEL(win16drv);
...@@ -35,7 +34,7 @@ HPEN WIN16DRV_PEN_SelectObject( DC * dc, HPEN hpen ) ...@@ -35,7 +34,7 @@ HPEN WIN16DRV_PEN_SelectObject( DC * dc, HPEN hpen )
{ {
nSize = PRTDRV_RealizeObject (physDev->segptrPDEVICE, DRVOBJ_PEN, nSize = PRTDRV_RealizeObject (physDev->segptrPDEVICE, DRVOBJ_PEN,
&lPen16, 0, 0); &lPen16, 0, 0);
physDev->PenInfo = SEGPTR_ALLOC( nSize ); physDev->PenInfo = HeapAlloc( GetProcessHeap(), 0, nSize );
} }
nSize = PRTDRV_RealizeObject(physDev->segptrPDEVICE, DRVOBJ_PEN, nSize = PRTDRV_RealizeObject(physDev->segptrPDEVICE, DRVOBJ_PEN,
......
...@@ -804,13 +804,13 @@ HINSTANCE16 WINAPI WinExec16( LPCSTR lpCmdLine, UINT16 nCmdShow ) ...@@ -804,13 +804,13 @@ HINSTANCE16 WINAPI WinExec16( LPCSTR lpCmdLine, UINT16 nCmdShow )
{ {
args++; args++;
arglen = strlen(args); arglen = strlen(args);
cmdline = SEGPTR_ALLOC( 2 + arglen ); cmdline = HeapAlloc( GetProcessHeap(), 0, 2 + arglen );
cmdline[0] = (BYTE)arglen; cmdline[0] = (BYTE)arglen;
strcpy( cmdline + 1, args ); strcpy( cmdline + 1, args );
} }
else else
{ {
cmdline = SEGPTR_ALLOC( 2 ); cmdline = HeapAlloc( GetProcessHeap(), 0, 2 );
cmdline[0] = cmdline[1] = 0; cmdline[0] = cmdline[1] = 0;
} }
...@@ -819,22 +819,22 @@ HINSTANCE16 WINAPI WinExec16( LPCSTR lpCmdLine, UINT16 nCmdShow ) ...@@ -819,22 +819,22 @@ HINSTANCE16 WINAPI WinExec16( LPCSTR lpCmdLine, UINT16 nCmdShow )
if (SearchPathA( NULL, name, ".exe", sizeof(buffer), buffer, NULL )) if (SearchPathA( NULL, name, ".exe", sizeof(buffer), buffer, NULL ))
{ {
LOADPARAMS16 params; LOADPARAMS16 params;
WORD *showCmd = SEGPTR_ALLOC( 2*sizeof(WORD) ); WORD showCmd[2];
showCmd[0] = 2; showCmd[0] = 2;
showCmd[1] = nCmdShow; showCmd[1] = nCmdShow;
params.hEnvironment = 0; params.hEnvironment = 0;
params.cmdLine = SEGPTR_GET(cmdline); params.cmdLine = MapLS( cmdline );
params.showCmd = SEGPTR_GET(showCmd); params.showCmd = MapLS( showCmd );
params.reserved = 0; params.reserved = 0;
ret = LoadModule16( buffer, &params ); ret = LoadModule16( buffer, &params );
UnMapLS( params.cmdLine );
SEGPTR_FREE( showCmd ); UnMapLS( params.showCmd );
SEGPTR_FREE( cmdline );
} }
else ret = GetLastError(); else ret = GetLastError();
HeapFree( GetProcessHeap(), 0, cmdline );
if (name != lpCmdLine) HeapFree( GetProcessHeap(), 0, name ); if (name != lpCmdLine) HeapFree( GetProcessHeap(), 0, name );
if (ret == 21) /* 32-bit module */ if (ret == 21) /* 32-bit module */
......
...@@ -10,8 +10,8 @@ ...@@ -10,8 +10,8 @@
#include <assert.h> #include <assert.h>
#include "winerror.h" #include "winerror.h"
#include "winnls.h" #include "winnls.h"
#include "wine/unicode.h"
#include "font.h" #include "font.h"
#include "heap.h"
#include "options.h" #include "options.h"
#include "debugtools.h" #include "debugtools.h"
#include "gdi.h" #include "gdi.h"
...@@ -694,12 +694,8 @@ INT16 WINAPI EnumFontFamiliesEx16( HDC16 hDC, LPLOGFONT16 plf, ...@@ -694,12 +694,8 @@ INT16 WINAPI EnumFontFamiliesEx16( HDC16 hDC, LPLOGFONT16 plf,
if (enum_func) if (enum_func)
{ {
LPNEWTEXTMETRICEX16 lptm16 = SEGPTR_ALLOC( sizeof(NEWTEXTMETRICEX16) ); NEWTEXTMETRICEX16 tm16;
if( lptm16 ) ENUMLOGFONTEX16 lf16;
{
LPENUMLOGFONTEX16 lplf16 = SEGPTR_ALLOC( sizeof(ENUMLOGFONTEX16) );
if( lplf16 )
{
fontEnum16 fe16; fontEnum16 fe16;
LOGFONTW lfW; LOGFONTW lfW;
FONT_LogFont16ToW(plf, &lfW); FONT_LogFont16ToW(plf, &lfW);
...@@ -707,18 +703,14 @@ INT16 WINAPI EnumFontFamiliesEx16( HDC16 hDC, LPLOGFONT16 plf, ...@@ -707,18 +703,14 @@ INT16 WINAPI EnumFontFamiliesEx16( HDC16 hDC, LPLOGFONT16 plf,
fe16.lpLogFontParam = plf; fe16.lpLogFontParam = plf;
fe16.lpEnumFunc = efproc; fe16.lpEnumFunc = efproc;
fe16.lpData = lParam; fe16.lpData = lParam;
fe16.lpTextMetric = &tm16;
fe16.lpTextMetric = lptm16; fe16.lpLogFont = &lf16;
fe16.lpLogFont = lplf16; fe16.segTextMetric = MapLS( &tm16 );
fe16.segTextMetric = SEGPTR_GET(lptm16); fe16.segLogFont = MapLS( &lf16 );
fe16.segLogFont = SEGPTR_GET(lplf16);
retVal = enum_func( hDC, &lfW, FONT_EnumInstance16, (LPARAM)&fe16 );
retVal = enum_func( hDC, &lfW, FONT_EnumInstance16, UnMapLS( fe16.segTextMetric );
(LPARAM)&fe16 ); UnMapLS( fe16.segLogFont );
SEGPTR_FREE(lplf16);
}
SEGPTR_FREE(lptm16);
}
} }
return retVal; return retVal;
} }
......
...@@ -19,7 +19,6 @@ ...@@ -19,7 +19,6 @@
#include "bitmap.h" #include "bitmap.h"
#include "brush.h" #include "brush.h"
#include "font.h" #include "font.h"
#include "heap.h"
#include "local.h" #include "local.h"
#include "palette.h" #include "palette.h"
#include "pen.h" #include "pen.h"
...@@ -873,8 +872,9 @@ INT16 WINAPI EnumObjects16( HDC16 hdc, INT16 nObjType, ...@@ -873,8 +872,9 @@ INT16 WINAPI EnumObjects16( HDC16 hdc, INT16 nObjType,
}; };
INT16 i, retval = 0; INT16 i, retval = 0;
LOGPEN16 *pen; LOGPEN16 pen;
LOGBRUSH16 *brush = NULL; LOGBRUSH16 brush;
SEGPTR segptr;
TRACE("%04x %d %08lx %08lx\n", TRACE("%04x %d %08lx %08lx\n",
hdc, nObjType, (DWORD)lpEnumFunc, lParam ); hdc, nObjType, (DWORD)lpEnumFunc, lParam );
...@@ -882,47 +882,44 @@ INT16 WINAPI EnumObjects16( HDC16 hdc, INT16 nObjType, ...@@ -882,47 +882,44 @@ INT16 WINAPI EnumObjects16( HDC16 hdc, INT16 nObjType,
{ {
case OBJ_PEN: case OBJ_PEN:
/* Enumerate solid pens */ /* Enumerate solid pens */
if (!(pen = SEGPTR_NEW(LOGPEN16))) break; segptr = MapLS( &pen );
for (i = 0; i < sizeof(solid_colors)/sizeof(solid_colors[0]); i++) for (i = 0; i < sizeof(solid_colors)/sizeof(solid_colors[0]); i++)
{ {
pen->lopnStyle = PS_SOLID; pen.lopnStyle = PS_SOLID;
pen->lopnWidth.x = 1; pen.lopnWidth.x = 1;
pen->lopnWidth.y = 0; pen.lopnWidth.y = 0;
pen->lopnColor = solid_colors[i]; pen.lopnColor = solid_colors[i];
retval = GDI_CallTo16_word_ll( lpEnumFunc, SEGPTR_GET(pen), lParam ); retval = GDI_CallTo16_word_ll( lpEnumFunc, segptr, lParam );
TRACE("solid pen %08lx, ret=%d\n", TRACE("solid pen %08lx, ret=%d\n", solid_colors[i], retval);
solid_colors[i], retval);
if (!retval) break; if (!retval) break;
} }
SEGPTR_FREE(pen); UnMapLS( segptr );
break; break;
case OBJ_BRUSH: case OBJ_BRUSH:
/* Enumerate solid brushes */ /* Enumerate solid brushes */
if (!(brush = SEGPTR_NEW(LOGBRUSH16))) break; segptr = MapLS( &brush );
for (i = 0; i < sizeof(solid_colors)/sizeof(solid_colors[0]); i++) for (i = 0; i < sizeof(solid_colors)/sizeof(solid_colors[0]); i++)
{ {
brush->lbStyle = BS_SOLID; brush.lbStyle = BS_SOLID;
brush->lbColor = solid_colors[i]; brush.lbColor = solid_colors[i];
brush->lbHatch = 0; brush.lbHatch = 0;
retval = GDI_CallTo16_word_ll( lpEnumFunc, SEGPTR_GET(brush), lParam ); retval = GDI_CallTo16_word_ll( lpEnumFunc, segptr, lParam );
TRACE("solid brush %08lx, ret=%d\n", TRACE("solid brush %08lx, ret=%d\n", solid_colors[i], retval);
solid_colors[i], retval);
if (!retval) break; if (!retval) break;
} }
/* Now enumerate hatched brushes */ /* Now enumerate hatched brushes */
if (retval) for (i = HS_HORIZONTAL; i <= HS_DIAGCROSS; i++) if (retval) for (i = HS_HORIZONTAL; i <= HS_DIAGCROSS; i++)
{ {
brush->lbStyle = BS_HATCHED; brush.lbStyle = BS_HATCHED;
brush->lbColor = RGB(0,0,0); brush.lbColor = RGB(0,0,0);
brush->lbHatch = i; brush.lbHatch = i;
retval = GDI_CallTo16_word_ll( lpEnumFunc, SEGPTR_GET(brush), lParam ); retval = GDI_CallTo16_word_ll( lpEnumFunc, segptr, lParam );
TRACE("hatched brush %d, ret=%d\n", TRACE("hatched brush %d, ret=%d\n", i, retval);
i, retval);
if (!retval) break; if (!retval) break;
} }
SEGPTR_FREE(brush); UnMapLS( segptr );
break; break;
default: default:
......
...@@ -8,7 +8,6 @@ ...@@ -8,7 +8,6 @@
#include <sys/types.h> #include <sys/types.h>
#include "ntddk.h" #include "ntddk.h"
#include "syslevel.h" #include "syslevel.h"
#include "heap.h"
#include "stackframe.h" #include "stackframe.h"
#include "debugtools.h" #include "debugtools.h"
...@@ -33,12 +32,13 @@ VOID WINAPI GetpWin16Lock(SYSLEVEL **lock) ...@@ -33,12 +32,13 @@ VOID WINAPI GetpWin16Lock(SYSLEVEL **lock)
*/ */
SEGPTR WINAPI GetpWin16Lock16(void) SEGPTR WINAPI GetpWin16Lock16(void)
{ {
static SYSLEVEL *w16Mutex;
static SEGPTR segpWin16Mutex; static SEGPTR segpWin16Mutex;
if (!segpWin16Mutex) if (!segpWin16Mutex)
{ {
SYSLEVEL **w16Mutex = SEGPTR_ALLOC(sizeof(SYSLEVEL *)); w16Mutex = &Win16Mutex;
*w16Mutex = &Win16Mutex; segpWin16Mutex = MapLS( &w16Mutex );
segpWin16Mutex = SEGPTR_GET(w16Mutex);
} }
return segpWin16Mutex; return segpWin16Mutex;
} }
......
...@@ -24,7 +24,6 @@ ...@@ -24,7 +24,6 @@
#include "wingdi.h" #include "wingdi.h"
#include "wine/winuser16.h" #include "wine/winuser16.h"
#include "wine/unicode.h" #include "wine/unicode.h"
#include "heap.h"
#include "win.h" #include "win.h"
#include "user.h" #include "user.h"
#include "controls.h" #include "controls.h"
...@@ -45,6 +44,7 @@ typedef struct tagCLASS ...@@ -45,6 +44,7 @@ typedef struct tagCLASS
INT cbClsExtra; /* Class extra bytes */ INT cbClsExtra; /* Class extra bytes */
INT cbWndExtra; /* Window extra bytes */ INT cbWndExtra; /* Window extra bytes */
LPWSTR menuName; /* Default menu name (Unicode followed by ASCII) */ LPWSTR menuName; /* Default menu name (Unicode followed by ASCII) */
SEGPTR segMenuName; /* Default menu name as SEGPTR */
struct tagDCE *dce; /* Class DCE (if CS_CLASSDC) */ struct tagDCE *dce; /* Class DCE (if CS_CLASSDC) */
HINSTANCE hInstance; /* Module that created the task */ HINSTANCE hInstance; /* Module that created the task */
HICON hIcon; /* Default icon */ HICON hIcon; /* Default icon */
...@@ -163,6 +163,20 @@ inline static LPSTR CLASS_GetMenuNameA( CLASS *classPtr ) ...@@ -163,6 +163,20 @@ inline static LPSTR CLASS_GetMenuNameA( CLASS *classPtr )
/*********************************************************************** /***********************************************************************
* CLASS_GetMenuName16
*
* Get the menu name as a SEGPTR.
*/
inline static SEGPTR CLASS_GetMenuName16( CLASS *classPtr )
{
if (!HIWORD(classPtr->menuName)) return (SEGPTR)classPtr->menuName;
if (!classPtr->segMenuName)
classPtr->segMenuName = MapLS( CLASS_GetMenuNameA(classPtr) );
return classPtr->segMenuName;
}
/***********************************************************************
* CLASS_GetMenuNameW * CLASS_GetMenuNameW
* *
* Get the menu name as a Unicode string. * Get the menu name as a Unicode string.
...@@ -180,12 +194,14 @@ inline static LPWSTR CLASS_GetMenuNameW( CLASS *classPtr ) ...@@ -180,12 +194,14 @@ inline static LPWSTR CLASS_GetMenuNameW( CLASS *classPtr )
*/ */
static void CLASS_SetMenuNameA( CLASS *classPtr, LPCSTR name ) static void CLASS_SetMenuNameA( CLASS *classPtr, LPCSTR name )
{ {
if (HIWORD(classPtr->menuName)) SEGPTR_FREE( classPtr->menuName ); UnMapLS( classPtr->segMenuName );
classPtr->segMenuName = 0;
if (HIWORD(classPtr->menuName)) HeapFree( GetProcessHeap(), 0, classPtr->menuName );
if (HIWORD(name)) if (HIWORD(name))
{ {
DWORD lenA = strlen(name) + 1; DWORD lenA = strlen(name) + 1;
DWORD lenW = MultiByteToWideChar( CP_ACP, 0, name, lenA, NULL, 0 ); DWORD lenW = MultiByteToWideChar( CP_ACP, 0, name, lenA, NULL, 0 );
classPtr->menuName = SEGPTR_ALLOC( lenA + lenW*sizeof(WCHAR) ); classPtr->menuName = HeapAlloc( GetProcessHeap(), 0, lenA + lenW*sizeof(WCHAR) );
MultiByteToWideChar( CP_ACP, 0, name, lenA, classPtr->menuName, lenW ); MultiByteToWideChar( CP_ACP, 0, name, lenA, classPtr->menuName, lenW );
memcpy( classPtr->menuName + lenW, name, lenA ); memcpy( classPtr->menuName + lenW, name, lenA );
} }
...@@ -200,12 +216,14 @@ static void CLASS_SetMenuNameA( CLASS *classPtr, LPCSTR name ) ...@@ -200,12 +216,14 @@ static void CLASS_SetMenuNameA( CLASS *classPtr, LPCSTR name )
*/ */
static void CLASS_SetMenuNameW( CLASS *classPtr, LPCWSTR name ) static void CLASS_SetMenuNameW( CLASS *classPtr, LPCWSTR name )
{ {
if (HIWORD(classPtr->menuName)) SEGPTR_FREE( classPtr->menuName ); UnMapLS( classPtr->segMenuName );
classPtr->segMenuName = 0;
if (HIWORD(classPtr->menuName)) HeapFree( GetProcessHeap(), 0, classPtr->menuName );
if (HIWORD(name)) if (HIWORD(name))
{ {
DWORD lenW = strlenW(name) + 1; DWORD lenW = strlenW(name) + 1;
DWORD lenA = WideCharToMultiByte( CP_ACP, 0, name, lenW, NULL, 0, NULL, NULL ); DWORD lenA = WideCharToMultiByte( CP_ACP, 0, name, lenW, NULL, 0, NULL, NULL );
classPtr->menuName = SEGPTR_ALLOC( lenA + lenW*sizeof(WCHAR) ); classPtr->menuName = HeapAlloc( GetProcessHeap(), 0, lenA + lenW*sizeof(WCHAR) );
memcpy( classPtr->menuName, name, lenW*sizeof(WCHAR) ); memcpy( classPtr->menuName, name, lenW*sizeof(WCHAR) );
WideCharToMultiByte( CP_ACP, 0, name, lenW, WideCharToMultiByte( CP_ACP, 0, name, lenW,
(char *)(classPtr->menuName + lenW), lenA, NULL, NULL ); (char *)(classPtr->menuName + lenW), lenA, NULL, NULL );
...@@ -245,6 +263,7 @@ static BOOL CLASS_FreeClass( CLASS *classPtr ) ...@@ -245,6 +263,7 @@ static BOOL CLASS_FreeClass( CLASS *classPtr )
GlobalDeleteAtom( classPtr->atomName ); GlobalDeleteAtom( classPtr->atomName );
WINPROC_FreeProc( classPtr->winprocA, WIN_PROC_CLASS ); WINPROC_FreeProc( classPtr->winprocA, WIN_PROC_CLASS );
WINPROC_FreeProc( classPtr->winprocW, WIN_PROC_CLASS ); WINPROC_FreeProc( classPtr->winprocW, WIN_PROC_CLASS );
UnMapLS( classPtr->segMenuName );
HeapFree( GetProcessHeap(), 0, classPtr->menuName ); HeapFree( GetProcessHeap(), 0, classPtr->menuName );
HeapFree( GetProcessHeap(), 0, classPtr ); HeapFree( GetProcessHeap(), 0, classPtr );
return TRUE; return TRUE;
...@@ -789,8 +808,10 @@ LONG WINAPI GetClassLong16( HWND16 hwnd16, INT16 offset ) ...@@ -789,8 +808,10 @@ LONG WINAPI GetClassLong16( HWND16 hwnd16, INT16 offset )
release_class_ptr( class ); release_class_ptr( class );
return ret; return ret;
case GCL_MENUNAME: case GCL_MENUNAME:
ret = GetClassLongA( hwnd, offset ); if (!(class = get_class_ptr( hwnd, FALSE ))) return 0;
return (LONG)SEGPTR_GET( (void *)ret ); ret = (LONG)CLASS_GetMenuName16( class );
release_class_ptr( class );
return ret;
default: default:
return GetClassLongA( hwnd, offset ); return GetClassLongA( hwnd, offset );
} }
...@@ -1094,9 +1115,7 @@ BOOL16 WINAPI GetClassInfo16( HINSTANCE16 hInstance, SEGPTR name, WNDCLASS16 *wc ...@@ -1094,9 +1115,7 @@ BOOL16 WINAPI GetClassInfo16( HINSTANCE16 hInstance, SEGPTR name, WNDCLASS16 *wc
wc->hCursor = classPtr->hCursor; wc->hCursor = classPtr->hCursor;
wc->hbrBackground = classPtr->hbrBackground; wc->hbrBackground = classPtr->hbrBackground;
wc->lpszClassName = name; wc->lpszClassName = name;
wc->lpszMenuName = (SEGPTR)CLASS_GetMenuNameA( classPtr ); wc->lpszMenuName = CLASS_GetMenuName16( classPtr );
if (HIWORD(wc->lpszMenuName)) /* Make it a SEGPTR */
wc->lpszMenuName = SEGPTR_GET( (LPSTR)wc->lpszMenuName );
return TRUE; return TRUE;
} }
...@@ -1206,9 +1225,7 @@ BOOL16 WINAPI GetClassInfoEx16( HINSTANCE16 hInstance, SEGPTR name, WNDCLASSEX16 ...@@ -1206,9 +1225,7 @@ BOOL16 WINAPI GetClassInfoEx16( HINSTANCE16 hInstance, SEGPTR name, WNDCLASSEX16
wc->hCursor = classPtr->hCursor; wc->hCursor = classPtr->hCursor;
wc->hbrBackground = classPtr->hbrBackground; wc->hbrBackground = classPtr->hbrBackground;
wc->lpszClassName = (SEGPTR)0; wc->lpszClassName = (SEGPTR)0;
wc->lpszMenuName = (SEGPTR)CLASS_GetMenuNameA( classPtr ); wc->lpszMenuName = CLASS_GetMenuName16( classPtr );
if (HIWORD(wc->lpszMenuName)) /* Make it a SEGPTR */
wc->lpszMenuName = SEGPTR_GET( (LPSTR)wc->lpszMenuName );
wc->lpszClassName = name; wc->lpszClassName = name;
/* We must return the atom of the class here instead of just TRUE. */ /* We must return the atom of the class here instead of just TRUE. */
......
...@@ -45,7 +45,7 @@ typedef struct ...@@ -45,7 +45,7 @@ typedef struct
UINT id; UINT id;
LPCSTR className; LPCSTR className;
LPCSTR windowName; LPCSTR windowName;
LPVOID data; LPCVOID data;
} DLG_CONTROL_INFO; } DLG_CONTROL_INFO;
/* Dialog template */ /* Dialog template */
...@@ -296,26 +296,21 @@ static LPCSTR DIALOG_GetControl16( LPCSTR p, DLG_CONTROL_INFO *info ) ...@@ -296,26 +296,21 @@ static LPCSTR DIALOG_GetControl16( LPCSTR p, DLG_CONTROL_INFO *info )
p += strlen(p) + 1; p += strlen(p) + 1;
} }
if (*p) if (*p) info->data = p + 1;
{
/* Additional CTLDATA available for this control. */
info->data = SEGPTR_ALLOC(*p);
memcpy( info->data, p + 1, *p );
}
else info->data = NULL; else info->data = NULL;
p += *p + 1; p += *p + 1;
if(int_id) if(int_id)
TRACE(" %s %04x %d, %d, %d, %d, %d, %08lx, %08lx\n", TRACE(" %s %04x %d, %d, %d, %d, %d, %08lx, %p\n",
info->className, LOWORD(info->windowName), info->className, LOWORD(info->windowName),
info->id, info->x, info->y, info->cx, info->cy, info->id, info->x, info->y, info->cx, info->cy,
info->style, (DWORD)SEGPTR_GET(info->data) ); info->style, info->data );
else else
TRACE(" %s '%s' %d, %d, %d, %d, %d, %08lx, %08lx\n", TRACE(" %s '%s' %d, %d, %d, %d, %d, %08lx, %p\n",
info->className, info->windowName, info->className, info->windowName,
info->id, info->x, info->y, info->cx, info->cy, info->id, info->x, info->y, info->cx, info->cy,
info->style, (DWORD)SEGPTR_GET(info->data) ); info->style, info->data );
return p; return p;
} }
...@@ -414,7 +409,7 @@ static const WORD *DIALOG_GetControl32( const WORD *p, DLG_CONTROL_INFO *info, ...@@ -414,7 +409,7 @@ static const WORD *DIALOG_GetControl32( const WORD *p, DLG_CONTROL_INFO *info,
DPRINTF("\n"); DPRINTF("\n");
TRACE(" END\n" ); TRACE(" END\n" );
} }
info->data = (LPVOID)(p + 1); info->data = p + 1;
p += GET_WORD(p) / sizeof(WORD); p += GET_WORD(p) / sizeof(WORD);
} }
else info->data = NULL; else info->data = NULL;
...@@ -444,6 +439,8 @@ static BOOL DIALOG_CreateControls( HWND hwnd, LPCSTR template, const DLG_TEMPLAT ...@@ -444,6 +439,8 @@ static BOOL DIALOG_CreateControls( HWND hwnd, LPCSTR template, const DLG_TEMPLAT
if (!win32) if (!win32)
{ {
HINSTANCE16 instance; HINSTANCE16 instance;
SEGPTR segptr;
template = DIALOG_GetControl16( template, &info ); template = DIALOG_GetControl16( template, &info );
if (HIWORD(info.className) && !strcmp( info.className, "EDIT") && if (HIWORD(info.className) && !strcmp( info.className, "EDIT") &&
!(GetWindowLongW( hwnd, GWL_STYLE ) & DS_LOCALEDIT)) !(GetWindowLongW( hwnd, GWL_STYLE ) & DS_LOCALEDIT))
...@@ -462,6 +459,7 @@ static BOOL DIALOG_CreateControls( HWND hwnd, LPCSTR template, const DLG_TEMPLAT ...@@ -462,6 +459,7 @@ static BOOL DIALOG_CreateControls( HWND hwnd, LPCSTR template, const DLG_TEMPLAT
} }
else instance = (HINSTANCE16)hInst; else instance = (HINSTANCE16)hInst;
segptr = MapLS( info.data );
hwndCtrl = WIN_Handle32( CreateWindowEx16( info.exStyle | WS_EX_NOPARENTNOTIFY, hwndCtrl = WIN_Handle32( CreateWindowEx16( info.exStyle | WS_EX_NOPARENTNOTIFY,
info.className, info.windowName, info.className, info.windowName,
info.style | WS_CHILD, info.style | WS_CHILD,
...@@ -470,9 +468,8 @@ static BOOL DIALOG_CreateControls( HWND hwnd, LPCSTR template, const DLG_TEMPLAT ...@@ -470,9 +468,8 @@ static BOOL DIALOG_CreateControls( HWND hwnd, LPCSTR template, const DLG_TEMPLAT
MulDiv(info.cx, dlgInfo->xBaseUnit, 4), MulDiv(info.cx, dlgInfo->xBaseUnit, 4),
MulDiv(info.cy, dlgInfo->yBaseUnit, 8), MulDiv(info.cy, dlgInfo->yBaseUnit, 8),
WIN_Handle16(hwnd), (HMENU16)info.id, WIN_Handle16(hwnd), (HMENU16)info.id,
instance, (LPVOID)SEGPTR_GET(info.data) )); instance, (LPVOID)segptr ));
UnMapLS( segptr );
if (info.data) SEGPTR_FREE(info.data);
} }
else else
{ {
...@@ -493,7 +490,7 @@ static BOOL DIALOG_CreateControls( HWND hwnd, LPCSTR template, const DLG_TEMPLAT ...@@ -493,7 +490,7 @@ static BOOL DIALOG_CreateControls( HWND hwnd, LPCSTR template, const DLG_TEMPLAT
MulDiv(info.cx, dlgInfo->xBaseUnit, 4), MulDiv(info.cx, dlgInfo->xBaseUnit, 4),
MulDiv(info.cy, dlgInfo->yBaseUnit, 8), MulDiv(info.cy, dlgInfo->yBaseUnit, 8),
hwnd, (HMENU)info.id, hwnd, (HMENU)info.id,
hInst, info.data ); hInst, (LPVOID)info.data );
} }
if (!hwndCtrl) return FALSE; if (!hwndCtrl) return FALSE;
......
...@@ -544,24 +544,21 @@ static HWND MDICreateChild( HWND parent, MDICLIENTINFO *ci, ...@@ -544,24 +544,21 @@ static HWND MDICreateChild( HWND parent, MDICLIENTINFO *ci,
} }
else else
{ {
MDICREATESTRUCT16 *cs16; MDICREATESTRUCT16 cs16;
LPSTR title, cls; SEGPTR title, cls, seg_cs16;
WIN_ReleaseWndPtr( wndParent ); WIN_ReleaseWndPtr( wndParent );
cs16 = SEGPTR_NEW(MDICREATESTRUCT16); STRUCT32_MDICREATESTRUCT32Ato16( cs, &cs16 );
STRUCT32_MDICREATESTRUCT32Ato16( cs, cs16 ); cs16.szTitle = title = MapLS( cs->szTitle );
title = SEGPTR_STRDUP( cs->szTitle ); cs16.szClass = cls = MapLS( cs->szClass );
cls = SEGPTR_STRDUP( cs->szClass ); seg_cs16 = MapLS( &cs16 );
cs16->szTitle = SEGPTR_GET(title);
cs16->szClass = SEGPTR_GET(cls);
hwnd = WIN_Handle32( CreateWindow16( cs->szClass, cs->szTitle, style, hwnd = WIN_Handle32( CreateWindow16( cs->szClass, cs->szTitle, style,
cs16->x, cs16->y, cs16->cx, cs16->cy, cs16.x, cs16.y, cs16.cx, cs16.cy,
WIN_Handle16(parent), (HMENU)wIDmenu, WIN_Handle16(parent), (HMENU)wIDmenu,
cs16->hOwner, (LPVOID)SEGPTR_GET(cs16) )); cs16.hOwner, (LPVOID)seg_cs16 ));
SEGPTR_FREE( title ); UnMapLS( seg_cs16 );
SEGPTR_FREE( cls ); UnMapLS( title );
SEGPTR_FREE( cs16 ); UnMapLS( cls );
} }
/* MDI windows are WS_CHILD so they won't be activated by CreateWindow */ /* MDI windows are WS_CHILD so they won't be activated by CreateWindow */
......
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