Use MapLS/UnMapLS instead of SEGPTR_* macros.
This commit is contained in:
parent
6f011c0847
commit
d7b76822ef
|
@ -20,7 +20,6 @@
|
|||
#include "vfw16.h"
|
||||
#include "wine/winbase16.h"
|
||||
#include "debugtools.h"
|
||||
#include "heap.h"
|
||||
#include "stackframe.h"
|
||||
|
||||
DEFAULT_DEBUG_CHANNEL(msvideo);
|
||||
|
@ -220,19 +219,20 @@ HIC VFWAPI ICOpen(DWORD fccType,DWORD fccHandler,UINT wMode) {
|
|||
HIC MSVIDEO_OpenFunc(DWORD fccType, DWORD fccHandler, UINT wMode, FARPROC lpfnHandler, BOOL bFrom32) {
|
||||
char type[5],handler[5],codecname[20];
|
||||
HIC16 hic;
|
||||
ICOPEN* icopen = SEGPTR_NEW(ICOPEN);
|
||||
ICOPEN icopen;
|
||||
SEGPTR seg_icopen;
|
||||
WINE_HIC *whic;
|
||||
|
||||
memcpy(type,&fccType,4);type[4]=0;
|
||||
memcpy(handler,&fccHandler,4);handler[4]=0;
|
||||
TRACE("(%s,%s,%d,%p,%d)\n",type,handler,wMode,lpfnHandler,bFrom32?32:16);
|
||||
|
||||
icopen->fccType = fccType;
|
||||
icopen->fccHandler = fccHandler;
|
||||
icopen->dwSize = sizeof(ICOPEN);
|
||||
icopen->dwFlags = wMode;
|
||||
|
||||
sprintf(codecname,"%s.%s",type,handler);
|
||||
|
||||
icopen.fccType = fccType;
|
||||
icopen.fccHandler = fccHandler;
|
||||
icopen.dwSize = sizeof(ICOPEN);
|
||||
icopen.dwFlags = wMode;
|
||||
|
||||
sprintf(codecname,"%s.%s",type,handler);
|
||||
|
||||
hic = GlobalAlloc16(GHND,sizeof(WINE_HIC));
|
||||
if (!hic)
|
||||
|
@ -253,7 +253,9 @@ HIC MSVIDEO_OpenFunc(DWORD fccType, DWORD fccHandler, UINT wMode, FARPROC lpfnHa
|
|||
/* return value is not checked */
|
||||
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) {
|
||||
WARN("DRV_OPEN failed for hic 0x%08lx\n",(DWORD)hic);
|
||||
GlobalFree16(hic);
|
||||
|
@ -504,26 +506,28 @@ DWORD VFWAPIV ICCompress16(HIC16 hic, DWORD dwFlags, LPBITMAPINFOHEADER lpbiOutp
|
|||
LPBITMAPINFOHEADER lpbiPrev, LPVOID lpPrev) {
|
||||
|
||||
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->lpOutput = lpData;
|
||||
iccmp->lpbiInput = lpbiInput;
|
||||
iccmp->lpInput = lpBits;
|
||||
iccmp.lpbiOutput = lpbiOutput;
|
||||
iccmp.lpOutput = lpData;
|
||||
iccmp.lpbiInput = lpbiInput;
|
||||
iccmp.lpInput = lpBits;
|
||||
|
||||
iccmp->lpckid = lpckid;
|
||||
iccmp->lpdwFlags = lpdwFlags;
|
||||
iccmp->lFrameNum = lFrameNum;
|
||||
iccmp->dwFrameSize = dwFrameSize;
|
||||
iccmp->dwQuality = dwQuality;
|
||||
iccmp->lpbiPrev = lpbiPrev;
|
||||
iccmp->lpPrev = lpPrev;
|
||||
ret = ICSendMessage16(hic,ICM_COMPRESS,(DWORD)SEGPTR_GET(iccmp),sizeof(ICCOMPRESS));
|
||||
SEGPTR_FREE(iccmp);
|
||||
iccmp.lpckid = lpckid;
|
||||
iccmp.lpdwFlags = lpdwFlags;
|
||||
iccmp.lFrameNum = lFrameNum;
|
||||
iccmp.dwFrameSize = dwFrameSize;
|
||||
iccmp.dwQuality = dwQuality;
|
||||
iccmp.lpbiPrev = lpbiPrev;
|
||||
iccmp.lpPrev = lpPrev;
|
||||
seg_iccmp = MapLS( &iccmp );
|
||||
ret = ICSendMessage16(hic,ICM_COMPRESS,seg_iccmp,sizeof(ICCOMPRESS));
|
||||
UnMapLS( seg_iccmp );
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -560,23 +564,23 @@ DWORD VFWAPIV ICDecompress(HIC hic,DWORD dwFlags,LPBITMAPINFOHEADER lpbiFormat,
|
|||
* _ICDecompress [MSVIDEO.230]
|
||||
*/
|
||||
DWORD VFWAPIV ICDecompress16(HIC16 hic, DWORD dwFlags, LPBITMAPINFOHEADER lpbiFormat,
|
||||
LPVOID lpData, LPBITMAPINFOHEADER lpbi, LPVOID lpBits) {
|
||||
|
||||
ICDECOMPRESS *icd = SEGPTR_NEW(ICDECOMPRESS);
|
||||
LPVOID lpData, LPBITMAPINFOHEADER lpbi, LPVOID lpBits)
|
||||
{
|
||||
ICDECOMPRESS icd;
|
||||
SEGPTR segptr;
|
||||
DWORD ret;
|
||||
|
||||
TRACE("(0x%08lx,%ld,%p,%p,%p,%p)\n",(DWORD)hic,dwFlags,lpbiFormat,lpData,lpbi,lpBits);
|
||||
|
||||
icd->dwFlags = dwFlags;
|
||||
icd->lpbiInput = lpbiFormat;
|
||||
icd->lpInput = lpData;
|
||||
icd->lpbiOutput = lpbi;
|
||||
icd->lpOutput = lpBits;
|
||||
icd->ckid = 0;
|
||||
|
||||
ret = ICSendMessage16(hic,ICM_DECOMPRESS,(DWORD)SEGPTR_GET(icd),sizeof(ICDECOMPRESS));
|
||||
|
||||
SEGPTR_FREE(icd);
|
||||
icd.dwFlags = dwFlags;
|
||||
icd.lpbiInput = lpbiFormat;
|
||||
icd.lpInput = lpData;
|
||||
icd.lpbiOutput = lpbi;
|
||||
icd.lpOutput = lpBits;
|
||||
icd.ckid = 0;
|
||||
segptr = MapLS( &icd );
|
||||
ret = ICSendMessage16(hic,ICM_DECOMPRESS,segptr,sizeof(ICDECOMPRESS));
|
||||
UnMapLS( segptr );
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -996,6 +1000,7 @@ LRESULT VFWAPIV ICMessage16(void) {
|
|||
UINT16 msg;
|
||||
UINT16 cb;
|
||||
LPWORD lpData;
|
||||
SEGPTR segData;
|
||||
LRESULT ret;
|
||||
UINT16 i;
|
||||
|
||||
|
@ -1006,7 +1011,7 @@ LRESULT VFWAPIV ICMessage16(void) {
|
|||
msg = 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);
|
||||
|
||||
|
@ -1015,9 +1020,10 @@ LRESULT VFWAPIV ICMessage16(void) {
|
|||
}
|
||||
|
||||
VA_END16(valist);
|
||||
ret = ICSendMessage16(hic, msg, (DWORD)(SEGPTR_GET(lpData)), (DWORD)cb);
|
||||
|
||||
SEGPTR_FREE(lpData);
|
||||
segData = MapLS( lpData );
|
||||
ret = ICSendMessage16(hic, msg, segData, (DWORD)cb);
|
||||
UnMapLS( segData );
|
||||
HeapFree( GetProcessHeap(), 0, lpData );
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -1089,30 +1095,31 @@ DWORD VFWAPIV ICDrawBegin16(
|
|||
DWORD dwScale) /* [in] */
|
||||
{
|
||||
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",
|
||||
(DWORD)hic, dwFlags, (DWORD)hpal, (DWORD)hwnd, (DWORD)hdc, xDst, yDst, dxDst, dyDst,
|
||||
lpbi, xSrc, ySrc, dxSrc, dySrc, dwRate, dwScale);
|
||||
|
||||
icdb->dwFlags = dwFlags;
|
||||
icdb->hpal = hpal;
|
||||
icdb->hwnd = hwnd;
|
||||
icdb->hdc = hdc;
|
||||
icdb->xDst = xDst;
|
||||
icdb->yDst = yDst;
|
||||
icdb->dxDst = dxDst;
|
||||
icdb->dyDst = dyDst;
|
||||
icdb->lpbi = lpbi; /* Keep this as SEGPTR for the mapping code to deal with */
|
||||
icdb->xSrc = xSrc;
|
||||
icdb->ySrc = ySrc;
|
||||
icdb->dxSrc = dxSrc;
|
||||
icdb->dySrc = dySrc;
|
||||
icdb->dwRate = dwRate;
|
||||
icdb->dwScale = dwScale;
|
||||
|
||||
ret = (DWORD)ICSendMessage16(hic,ICM_DRAW_BEGIN,(DWORD)SEGPTR_GET(icdb),sizeof(ICDRAWBEGIN16));
|
||||
SEGPTR_FREE(icdb);
|
||||
icdb.dwFlags = dwFlags;
|
||||
icdb.hpal = hpal;
|
||||
icdb.hwnd = hwnd;
|
||||
icdb.hdc = hdc;
|
||||
icdb.xDst = xDst;
|
||||
icdb.yDst = yDst;
|
||||
icdb.dxDst = dxDst;
|
||||
icdb.dyDst = dyDst;
|
||||
icdb.lpbi = lpbi; /* Keep this as SEGPTR for the mapping code to deal with */
|
||||
icdb.xSrc = xSrc;
|
||||
icdb.ySrc = ySrc;
|
||||
icdb.dxSrc = dxSrc;
|
||||
icdb.dySrc = dySrc;
|
||||
icdb.dwRate = dwRate;
|
||||
icdb.dwScale = dwScale;
|
||||
seg_icdb = MapLS( &icdb );
|
||||
ret = (DWORD)ICSendMessage16(hic,ICM_DRAW_BEGIN,seg_icdb,sizeof(ICDRAWBEGIN16));
|
||||
UnMapLS( seg_icdb );
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -1144,16 +1151,20 @@ DWORD VFWAPIV ICDraw16(
|
|||
DWORD cbData,
|
||||
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);
|
||||
icd->dwFlags = dwFlags;
|
||||
icd->lpFormat = lpFormat;
|
||||
icd->lpData = lpData;
|
||||
icd->cbData = cbData;
|
||||
icd->lTime = lTime;
|
||||
|
||||
return ICSendMessage16(hic,ICM_DRAW,(DWORD)SEGPTR_GET(icd),sizeof(ICDRAW));
|
||||
TRACE("(0x%08lx,0x%08lx,%p,%p,%ld,%ld)\n",(DWORD)hic,dwFlags,lpFormat,lpData,cbData,lTime);
|
||||
icd.dwFlags = dwFlags;
|
||||
icd.lpFormat = lpFormat;
|
||||
icd.lpData = lpData;
|
||||
icd.cbData = cbData;
|
||||
icd.lTime = lTime;
|
||||
seg_icd = MapLS( &icd );
|
||||
ret = ICSendMessage16(hic,ICM_DRAW,seg_icd,sizeof(ICDRAW));
|
||||
UnMapLS( seg_icd );
|
||||
return ret;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
|
||||
#include <string.h>
|
||||
|
||||
#include "wine/windef16.h"
|
||||
#include "ole2.h"
|
||||
#include "oleauto.h"
|
||||
#include "windef.h"
|
||||
|
@ -16,7 +17,6 @@
|
|||
#include "wingdi.h"
|
||||
#include "winuser.h"
|
||||
|
||||
#include "heap.h"
|
||||
#include "ole2disp.h"
|
||||
#include "olectl.h"
|
||||
|
||||
|
@ -33,8 +33,8 @@ DEFAULT_DEBUG_CHANNEL(ole);
|
|||
*/
|
||||
static BSTR16 BSTR_AllocBytes(int n)
|
||||
{
|
||||
void *ptr = SEGPTR_ALLOC(n);
|
||||
return (BSTR16)SEGPTR_GET(ptr);
|
||||
void *ptr = HeapAlloc( GetProcessHeap(), 0, n );
|
||||
return (BSTR16)MapLS(ptr);
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
|
@ -42,7 +42,9 @@ static BSTR16 BSTR_AllocBytes(int n)
|
|||
*/
|
||||
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 @@
|
|||
|
||||
#include "wine/winuser16.h"
|
||||
#include "winerror.h"
|
||||
#include "heap.h"
|
||||
#include "hook.h"
|
||||
#include "message.h"
|
||||
#include "spy.h"
|
||||
|
@ -34,25 +33,24 @@ LRESULT WINAPI SendMessage16( HWND16 hwnd16, UINT16 msg, WPARAM16 wparam, LPARAM
|
|||
/* first the WH_CALLWNDPROC hook */
|
||||
if (HOOK_IsHooked( WH_CALLWNDPROC ))
|
||||
{
|
||||
CWPSTRUCT16 *cwp;
|
||||
CWPSTRUCT16 cwp;
|
||||
SEGPTR seg_cwp;
|
||||
|
||||
if ((cwp = SEGPTR_NEW(CWPSTRUCT16)))
|
||||
cwp.hwnd = hwnd16;
|
||||
cwp.message = msg;
|
||||
cwp.wParam = wparam;
|
||||
cwp.lParam = lparam;
|
||||
seg_cwp = MapLS( &cwp );
|
||||
HOOK_CallHooks16( WH_CALLWNDPROC, HC_ACTION, 1, seg_cwp );
|
||||
UnMapLS( seg_cwp );
|
||||
if (cwp.hwnd != hwnd16)
|
||||
{
|
||||
cwp->hwnd = hwnd16;
|
||||
cwp->message = msg;
|
||||
cwp->wParam = wparam;
|
||||
cwp->lParam = lparam;
|
||||
HOOK_CallHooks16( WH_CALLWNDPROC, HC_ACTION, 1, SEGPTR_GET(cwp) );
|
||||
if (cwp->hwnd != hwnd16)
|
||||
{
|
||||
hwnd16 = cwp->hwnd;
|
||||
hwnd = WIN_Handle32( hwnd16 );
|
||||
}
|
||||
msg = cwp->message;
|
||||
wparam = cwp->wParam;
|
||||
lparam = cwp->lParam;
|
||||
SEGPTR_FREE( cwp );
|
||||
hwnd16 = cwp.hwnd;
|
||||
hwnd = WIN_Handle32( hwnd16 );
|
||||
}
|
||||
msg = cwp.message;
|
||||
wparam = cwp.wParam;
|
||||
lparam = cwp.lParam;
|
||||
}
|
||||
|
||||
if (!(winproc = (WNDPROC16)GetWindowLong16( hwnd16, GWL_WNDPROC ))) return 0;
|
||||
|
|
|
@ -10,7 +10,6 @@
|
|||
#include "wingdi.h"
|
||||
#include "wine/winuser16.h"
|
||||
#include "wine/server.h"
|
||||
#include "heap.h"
|
||||
|
||||
/* size of buffer needed to store an atom string */
|
||||
#define ATOM_BUFFER_SIZE 256
|
||||
|
@ -289,19 +288,20 @@ INT16 WINAPI EnumProps16( HWND16 hwnd, PROPENUMPROC16 func )
|
|||
|
||||
if (list)
|
||||
{
|
||||
char *string = SEGPTR_ALLOC( ATOM_BUFFER_SIZE );
|
||||
char string[ATOM_BUFFER_SIZE];
|
||||
SEGPTR segptr = MapLS( string );
|
||||
for (i = 0; i < count; i++)
|
||||
{
|
||||
if (list[i].string) /* it was a string originally */
|
||||
{
|
||||
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
|
||||
ret = PROP_CallTo16_word_wlw( func, hwnd, list[i].atom, list[i].handle );
|
||||
if (!ret) break;
|
||||
}
|
||||
SEGPTR_FREE( string );
|
||||
UnMapLS( segptr );
|
||||
HeapFree( GetProcessHeap(), 0, list );
|
||||
}
|
||||
return ret;
|
||||
|
|
|
@ -6,7 +6,6 @@
|
|||
|
||||
#include <stdlib.h>
|
||||
#include "win16drv.h"
|
||||
#include "heap.h"
|
||||
#include "debugtools.h"
|
||||
|
||||
DEFAULT_DEBUG_CHANNEL(win16drv);
|
||||
|
@ -32,7 +31,7 @@ HBRUSH WIN16DRV_BRUSH_SelectObject( DC * dc, HBRUSH hbrush )
|
|||
{
|
||||
nSize = PRTDRV_RealizeObject (physDev->segptrPDEVICE, DRVOBJ_BRUSH,
|
||||
&lBrush16, 0, 0);
|
||||
physDev->BrushInfo = SEGPTR_ALLOC( nSize );
|
||||
physDev->BrushInfo = HeapAlloc( GetProcessHeap(), 0, nSize );
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -10,7 +10,6 @@
|
|||
#include "wine/winbase16.h"
|
||||
#include "win16drv.h"
|
||||
#include "font.h"
|
||||
#include "heap.h"
|
||||
#include "gdi.h"
|
||||
#include "debugtools.h"
|
||||
|
||||
|
@ -97,12 +96,12 @@ HFONT WIN16DRV_FONT_SelectObject( DC * dc, HFONT hfont)
|
|||
if( physDev->FontInfo &&
|
||||
HeapSize( GetProcessHeap(), 0, physDev->FontInfo ) < nSize )
|
||||
{
|
||||
SEGPTR_FREE( physDev->FontInfo );
|
||||
HeapFree( GetProcessHeap(), 0, physDev->FontInfo );
|
||||
physDev->FontInfo = NULL;
|
||||
}
|
||||
|
||||
if( !physDev->FontInfo )
|
||||
physDev->FontInfo = SEGPTR_ALLOC( nSize );
|
||||
physDev->FontInfo = HeapAlloc( GetProcessHeap(), 0, nSize );
|
||||
|
||||
|
||||
nSize = PRTDRV_RealizeObject(physDev->segptrPDEVICE, DRVOBJ_FONT,
|
||||
|
|
|
@ -13,7 +13,6 @@
|
|||
#include "win16drv.h"
|
||||
#include "gdi.h"
|
||||
#include "bitmap.h"
|
||||
#include "heap.h"
|
||||
#include "font.h"
|
||||
#include "debugtools.h"
|
||||
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
*/
|
||||
|
||||
#include "win16drv.h"
|
||||
#include "heap.h"
|
||||
#include "debugtools.h"
|
||||
|
||||
DEFAULT_DEBUG_CHANNEL(win16drv);
|
||||
|
@ -35,7 +34,7 @@ HPEN WIN16DRV_PEN_SelectObject( DC * dc, HPEN hpen )
|
|||
{
|
||||
nSize = PRTDRV_RealizeObject (physDev->segptrPDEVICE, DRVOBJ_PEN,
|
||||
&lPen16, 0, 0);
|
||||
physDev->PenInfo = SEGPTR_ALLOC( nSize );
|
||||
physDev->PenInfo = HeapAlloc( GetProcessHeap(), 0, nSize );
|
||||
}
|
||||
|
||||
nSize = PRTDRV_RealizeObject(physDev->segptrPDEVICE, DRVOBJ_PEN,
|
||||
|
|
|
@ -13,7 +13,6 @@
|
|||
#include "wine/winbase16.h"
|
||||
#include "winuser.h"
|
||||
#include "win16drv.h"
|
||||
#include "heap.h"
|
||||
#include "debugtools.h"
|
||||
#include "bitmap.h"
|
||||
|
||||
|
@ -253,8 +252,8 @@ WORD PRTDRV_Enable(LPVOID lpDevInfo, WORD wStyle, LPCSTR lpDestDevType,
|
|||
pLPD = FindPrinterDriverFromName((char *)lpDeviceName);
|
||||
if (pLPD != NULL) {
|
||||
LONG lP5;
|
||||
DeviceCaps *lP1;
|
||||
LPSTR lP3,lP4;
|
||||
DeviceCaps devcaps;
|
||||
SEGPTR lP1, lP3,lP4;
|
||||
WORD wP2;
|
||||
|
||||
if (!pLPD->fn[FUNC_ENABLE]) {
|
||||
|
@ -263,30 +262,25 @@ WORD PRTDRV_Enable(LPVOID lpDevInfo, WORD wStyle, LPCSTR lpDestDevType,
|
|||
}
|
||||
|
||||
if (wStyle == INITPDEVICE)
|
||||
lP1 = (DeviceCaps*)lpDevInfo;/* 16 bit segmented ptr already */
|
||||
lP1 = (SEGPTR)lpDevInfo;/* 16 bit segmented ptr already */
|
||||
else
|
||||
lP1 = SEGPTR_NEW(DeviceCaps);
|
||||
lP1 = MapLS(&devcaps);
|
||||
|
||||
wP2 = wStyle;
|
||||
|
||||
/* SEGPTR_STRDUP handles NULL like a charm ... */
|
||||
lP3 = SEGPTR_STRDUP(lpDestDevType);
|
||||
lP4 = SEGPTR_STRDUP(lpOutputFile);
|
||||
/* MapLS handles NULL like a charm ... */
|
||||
lP3 = MapLS(lpDestDevType);
|
||||
lP4 = MapLS(lpOutputFile);
|
||||
lP5 = (LONG)lpData;
|
||||
|
||||
wRet = PRTDRV_CallTo16_word_lwlll(pLPD->fn[FUNC_ENABLE],
|
||||
(wStyle==INITPDEVICE)?(SEGPTR)lP1:SEGPTR_GET(lP1),
|
||||
wP2,
|
||||
SEGPTR_GET(lP3),
|
||||
SEGPTR_GET(lP4),
|
||||
lP5);
|
||||
SEGPTR_FREE(lP3);
|
||||
SEGPTR_FREE(lP4);
|
||||
wRet = PRTDRV_CallTo16_word_lwlll(pLPD->fn[FUNC_ENABLE], lP1, wP2, lP3, lP4, lP5);
|
||||
UnMapLS(lP3);
|
||||
UnMapLS(lP4);
|
||||
|
||||
/* Get the data back */
|
||||
if (lP1 != 0 && wStyle != INITPDEVICE) {
|
||||
memcpy(lpDevInfo,lP1,sizeof(DeviceCaps));
|
||||
SEGPTR_FREE(lP1);
|
||||
memcpy(lpDevInfo,&devcaps,sizeof(DeviceCaps));
|
||||
UnMapLS(lP1);
|
||||
}
|
||||
}
|
||||
TRACE("return %x\n", wRet);
|
||||
|
@ -308,8 +302,7 @@ WORD PRTDRV_EnumDFonts(LPPDEVICE lpDestDev, LPSTR lpFaceName,
|
|||
|
||||
if ((pLPD = FindPrinterDriverFromPDEVICE(lpDestDev)) != NULL)
|
||||
{
|
||||
LONG lP1, lP4;
|
||||
LPBYTE lP2;
|
||||
SEGPTR lP1, lP2, lP4;
|
||||
|
||||
if (pLPD->fn[FUNC_ENUMDFONTS] == NULL) {
|
||||
WARN("Not supported by driver\n");
|
||||
|
@ -317,16 +310,11 @@ WORD PRTDRV_EnumDFonts(LPPDEVICE lpDestDev, LPSTR lpFaceName,
|
|||
}
|
||||
|
||||
lP1 = (SEGPTR)lpDestDev;
|
||||
if(lpFaceName)
|
||||
lP2 = SEGPTR_STRDUP(lpFaceName);
|
||||
else
|
||||
lP2 = NULL;
|
||||
lP2 = MapLS(lpFaceName);
|
||||
lP4 = (LONG)lpClientData;
|
||||
wRet = PRTDRV_CallTo16_word_llll( pLPD->fn[FUNC_ENUMDFONTS],
|
||||
lP1, SEGPTR_GET(lP2),
|
||||
(LONG)lpCallbackFunc,lP4);
|
||||
if(lpFaceName)
|
||||
SEGPTR_FREE(lP2);
|
||||
wRet = PRTDRV_CallTo16_word_llll( pLPD->fn[FUNC_ENUMDFONTS], lP1, lP2,
|
||||
(LONG)lpCallbackFunc,lP4);
|
||||
UnMapLS(lP2);
|
||||
} else
|
||||
WARN("Failed to find device\n");
|
||||
|
||||
|
@ -395,11 +383,8 @@ WORD PRTDRV_Output(LPPDEVICE lpDestDev,
|
|||
|
||||
if ((pLPD = FindPrinterDriverFromPDEVICE(lpDestDev)) != NULL)
|
||||
{
|
||||
LONG lP1, lP5, lP6, lP7;
|
||||
LPPOINT16 lP4;
|
||||
LPRECT16 lP8;
|
||||
LONG lP1, lP4, lP5, lP6, lP7, lP8;
|
||||
WORD wP2, wP3;
|
||||
int nSize;
|
||||
if (pLPD->fn[FUNC_OUTPUT] == NULL)
|
||||
{
|
||||
WARN("Not supported by driver\n");
|
||||
|
@ -409,11 +394,9 @@ WORD PRTDRV_Output(LPPDEVICE lpDestDev,
|
|||
lP1 = lpDestDev;
|
||||
wP2 = wStyle;
|
||||
wP3 = wCount;
|
||||
nSize = sizeof(POINT16) * wCount;
|
||||
lP4 = (LPPOINT16 )SEGPTR_ALLOC(nSize);
|
||||
memcpy(lP4,points,nSize);
|
||||
lP5 = SEGPTR_GET( lpPen );
|
||||
lP6 = SEGPTR_GET( lpBrush );
|
||||
lP4 = MapLS( points );
|
||||
lP5 = MapLS( lpPen );
|
||||
lP6 = MapLS( lpBrush );
|
||||
lP7 = lpDrawMode;
|
||||
|
||||
if (hClipRgn)
|
||||
|
@ -432,41 +415,39 @@ WORD PRTDRV_Output(LPPDEVICE lpDestDev,
|
|||
if( clip->rdh.nCount == 0 )
|
||||
{
|
||||
wRet = PRTDRV_CallTo16_word_lwwlllll(pLPD->fn[FUNC_OUTPUT],
|
||||
lP1, wP2, wP3,
|
||||
SEGPTR_GET(lP4),
|
||||
lP1, wP2, wP3, lP4,
|
||||
lP5, lP6, lP7,
|
||||
(SEGPTR) NULL);
|
||||
}
|
||||
else
|
||||
{
|
||||
RECT *pRect;
|
||||
lP8 = SEGPTR_NEW(RECT16);
|
||||
RECT16 r16;
|
||||
lP8 = MapLS(&r16);
|
||||
|
||||
for(pRect = (RECT *)clip->Buffer;
|
||||
pRect < (RECT *)clip->Buffer + clip->rdh.nCount; pRect++)
|
||||
{
|
||||
CONV_RECT32TO16( pRect, lP8 );
|
||||
CONV_RECT32TO16( pRect, &r16 );
|
||||
|
||||
TRACE("rect = %d,%d - %d,%d\n",
|
||||
lP8->left, lP8->top, lP8->right, lP8->bottom );
|
||||
TRACE("rect = %d,%d - %d,%d\n", r16.left, r16.top, r16.right, r16.bottom );
|
||||
wRet = PRTDRV_CallTo16_word_lwwlllll(pLPD->fn[FUNC_OUTPUT],
|
||||
lP1, wP2, wP3,
|
||||
SEGPTR_GET(lP4),
|
||||
lP5, lP6, lP7,
|
||||
SEGPTR_GET(lP8));
|
||||
lP1, wP2, wP3, lP4,
|
||||
lP5, lP6, lP7, lP8);
|
||||
}
|
||||
SEGPTR_FREE(lP8);
|
||||
UnMapLS(lP8);
|
||||
}
|
||||
HeapFree( GetProcessHeap(), 0, clip );
|
||||
}
|
||||
else
|
||||
{
|
||||
wRet = PRTDRV_CallTo16_word_lwwlllll(pLPD->fn[FUNC_OUTPUT],
|
||||
lP1, wP2, wP3,
|
||||
SEGPTR_GET(lP4),
|
||||
lP1, wP2, wP3, lP4,
|
||||
lP5, lP6, lP7, (SEGPTR) NULL);
|
||||
}
|
||||
SEGPTR_FREE(lP4);
|
||||
UnMapLS( lP4 );
|
||||
UnMapLS( lP5 );
|
||||
UnMapLS( lP6 );
|
||||
}
|
||||
TRACE("PRTDRV_Output return %d\n", wRet);
|
||||
return wRet;
|
||||
|
@ -489,8 +470,6 @@ DWORD PRTDRV_RealizeObject(LPPDEVICE lpDestDev, WORD wStyle,
|
|||
{
|
||||
LONG lP1, lP3, lP4, lP5;
|
||||
WORD wP2;
|
||||
LPBYTE lpBuf = NULL;
|
||||
unsigned int nSize;
|
||||
|
||||
if (pLPD->fn[FUNC_REALIZEOBJECT] == NULL)
|
||||
{
|
||||
|
@ -500,51 +479,15 @@ DWORD PRTDRV_RealizeObject(LPPDEVICE lpDestDev, WORD wStyle,
|
|||
|
||||
lP1 = lpDestDev;
|
||||
wP2 = wStyle;
|
||||
|
||||
switch ((INT16)wStyle)
|
||||
{
|
||||
case DRVOBJ_BRUSH:
|
||||
nSize = sizeof (LOGBRUSH16);
|
||||
break;
|
||||
case DRVOBJ_FONT:
|
||||
nSize = sizeof(LOGFONT16);
|
||||
break;
|
||||
case DRVOBJ_PEN:
|
||||
nSize = sizeof(LOGPEN16);
|
||||
break;
|
||||
|
||||
case -DRVOBJ_BRUSH:
|
||||
case -DRVOBJ_FONT:
|
||||
case -DRVOBJ_PEN:
|
||||
nSize = -1;
|
||||
break;
|
||||
|
||||
case DRVOBJ_PBITMAP:
|
||||
default:
|
||||
WARN("Object type %d not supported\n", wStyle);
|
||||
nSize = 0;
|
||||
|
||||
}
|
||||
|
||||
if(nSize != -1)
|
||||
{
|
||||
lpBuf = SEGPTR_ALLOC(nSize);
|
||||
memcpy(lpBuf, lpInObj, nSize);
|
||||
lP3 = SEGPTR_GET(lpBuf);
|
||||
}
|
||||
else
|
||||
lP3 = SEGPTR_GET( lpInObj );
|
||||
|
||||
lP4 = SEGPTR_GET( lpOutObj );
|
||||
|
||||
lP3 = MapLS( lpInObj );
|
||||
lP4 = MapLS( lpOutObj );
|
||||
lP5 = lpTextXForm;
|
||||
TRACE("Calling Realize %08lx %04x %08lx %08lx %08lx\n",
|
||||
lP1, wP2, lP3, lP4, lP5);
|
||||
dwRet = PRTDRV_CallTo16_long_lwlll(pLPD->fn[FUNC_REALIZEOBJECT],
|
||||
lP1, wP2, lP3, lP4, lP5);
|
||||
if(lpBuf)
|
||||
SEGPTR_FREE(lpBuf);
|
||||
|
||||
UnMapLS( lP3 );
|
||||
UnMapLS( lP4 );
|
||||
}
|
||||
TRACE("return %x\n", dwRet);
|
||||
return dwRet;
|
||||
|
@ -572,7 +515,7 @@ DWORD PRTDRV_StretchBlt(LPPDEVICE lpDestDev,
|
|||
if ((pLPD = FindPrinterDriverFromPDEVICE(lpDestDev)) != NULL)
|
||||
{
|
||||
LONG lP1,lP6, lP11, lP12, lP13;
|
||||
LPRECT16 lP14;
|
||||
SEGPTR lP14;
|
||||
WORD wP2, wP3, wP4, wP5, wP7, wP8, wP9, wP10;
|
||||
|
||||
if (pLPD->fn[FUNC_STRETCHBLT] == NULL)
|
||||
|
@ -591,22 +534,15 @@ DWORD PRTDRV_StretchBlt(LPPDEVICE lpDestDev,
|
|||
wP9 = wSrcXext;
|
||||
wP10 = wSrcYext;
|
||||
lP11 = Rop3;
|
||||
lP12 = SEGPTR_GET( lpBrush );
|
||||
lP12 = MapLS( lpBrush );
|
||||
lP13 = lpDrawMode;
|
||||
if (lpClipRect != NULL)
|
||||
{
|
||||
lP14 = SEGPTR_NEW(RECT16);
|
||||
memcpy(lP14,lpClipRect,sizeof(RECT16));
|
||||
|
||||
}
|
||||
else
|
||||
lP14 = 0L;
|
||||
lP14 = MapLS(lpClipRect);
|
||||
wRet = PRTDRV_CallTo16_word_lwwwwlwwwwllll(pLPD->fn[FUNC_STRETCHBLT],
|
||||
lP1, wP2, wP3, wP4, wP5,
|
||||
lP6, wP7, wP8, wP9, wP10,
|
||||
lP11, lP12, lP13,
|
||||
SEGPTR_GET(lP14));
|
||||
SEGPTR_FREE(lP14);
|
||||
lP11, lP12, lP13, lP14);
|
||||
UnMapLS(lP12);
|
||||
UnMapLS(lP14);
|
||||
TRACE("Called StretchBlt ret %d\n",wRet);
|
||||
}
|
||||
return wRet;
|
||||
|
@ -625,12 +561,9 @@ DWORD PRTDRV_ExtTextOut(LPPDEVICE lpDestDev, WORD wDestXOrg, WORD wDestYOrg,
|
|||
|
||||
if ((pLPD = FindPrinterDriverFromPDEVICE(lpDestDev)) != NULL)
|
||||
{
|
||||
LONG lP1, lP7, lP8, lP9, lP10;
|
||||
LPSTR lP5;
|
||||
LPRECT16 lP4,lP11;
|
||||
LONG lP1, lP4, lP5, lP7, lP8, lP9, lP10, lP11;
|
||||
WORD wP2, wP3, wP12;
|
||||
INT16 iP6;
|
||||
unsigned int nSize = -1;
|
||||
|
||||
if (pLPD->fn[FUNC_EXTTEXTOUT] == NULL)
|
||||
{
|
||||
|
@ -641,56 +574,30 @@ DWORD PRTDRV_ExtTextOut(LPPDEVICE lpDestDev, WORD wDestXOrg, WORD wDestYOrg,
|
|||
lP1 = lpDestDev;
|
||||
wP2 = wDestXOrg;
|
||||
wP3 = wDestYOrg;
|
||||
|
||||
if (lpClipRect != NULL) {
|
||||
lP4 = SEGPTR_NEW(RECT16);
|
||||
TRACE("Adding lpClipRect\n");
|
||||
memcpy(lP4,lpClipRect,sizeof(RECT16));
|
||||
} else
|
||||
lP4 = 0L;
|
||||
|
||||
if (lpString != NULL) {
|
||||
nSize = strlen(lpString);
|
||||
if (nSize>abs(wCount))
|
||||
nSize = abs(wCount);
|
||||
lP5 = SEGPTR_ALLOC(nSize+1);
|
||||
TRACE("Adding lpString (nSize is %d)\n",nSize);
|
||||
memcpy(lP5,lpString,nSize);
|
||||
*((char *)lP5 + nSize) = '\0';
|
||||
} else
|
||||
lP5 = 0L;
|
||||
|
||||
lP4 = MapLS( lpClipRect );
|
||||
lP5 = MapLS( lpString );
|
||||
iP6 = wCount;
|
||||
|
||||
/* This should be realized by the driver, so in 16bit data area */
|
||||
lP7 = SEGPTR_GET( lpFontInfo );
|
||||
lP7 = MapLS( lpFontInfo );
|
||||
lP8 = lpDrawMode;
|
||||
lP9 = lpTextXForm;
|
||||
|
||||
if (lpCharWidths != NULL)
|
||||
FIXME("Char widths not supported\n");
|
||||
lP10 = 0;
|
||||
|
||||
if (lpOpaqueRect != NULL) {
|
||||
lP11 = SEGPTR_NEW(RECT16);
|
||||
TRACE("Adding lpOpaqueRect\n");
|
||||
memcpy(lP11,lpOpaqueRect,sizeof(RECT16));
|
||||
} else
|
||||
lP11 = 0L;
|
||||
|
||||
lP11 = MapLS( lpOpaqueRect );
|
||||
wP12 = wOptions;
|
||||
TRACE("Calling ExtTextOut 0x%lx 0x%x 0x%x %p\n",
|
||||
lP1, wP2, wP3, lP4);
|
||||
TRACE("%*s 0x%x 0x%lx 0x%lx\n",
|
||||
nSize,lP5, iP6, lP7, lP8);
|
||||
TRACE("0x%lx 0x%lx %p 0x%x\n",
|
||||
TRACE("Calling ExtTextOut 0x%lx 0x%x 0x%x 0x%lx\n", lP1, wP2, wP3, lP4);
|
||||
TRACE("%s 0x%x 0x%lx 0x%lx\n", lpString, iP6, lP7, lP8);
|
||||
TRACE("0x%lx 0x%lx 0x%lx 0x%x\n",
|
||||
lP9, lP10, lP11, wP12);
|
||||
dwRet = PRTDRV_CallTo16_long_lwwllwlllllw(pLPD->fn[FUNC_EXTTEXTOUT],
|
||||
lP1, wP2, wP3,
|
||||
SEGPTR_GET(lP4),
|
||||
SEGPTR_GET(lP5), iP6, lP7,
|
||||
lP8, lP9, lP10,
|
||||
SEGPTR_GET(lP11), wP12);
|
||||
dwRet = PRTDRV_CallTo16_long_lwwllwlllllw(pLPD->fn[FUNC_EXTTEXTOUT], lP1, wP2, wP3,
|
||||
lP4, lP5, iP6, lP7, lP8, lP9, lP10, lP11, wP12);
|
||||
UnMapLS( lP4 );
|
||||
UnMapLS( lP5 );
|
||||
UnMapLS( lP7 );
|
||||
UnMapLS( lP11 );
|
||||
}
|
||||
TRACE("return %lx\n", dwRet);
|
||||
return dwRet;
|
||||
|
@ -800,9 +707,8 @@ WORD PRTDRV_GetCharWidth(LPPDEVICE lpDestDev, LPINT lpBuffer,
|
|||
|
||||
if ((pLPD = FindPrinterDriverFromPDEVICE(lpDestDev)) != NULL)
|
||||
{
|
||||
LONG lP1, lP5, lP6, lP7;
|
||||
LPWORD lP2;
|
||||
WORD wP3, wP4, i;
|
||||
LONG lP1, lP2, lP5, lP6, lP7;
|
||||
WORD wP3, wP4;
|
||||
|
||||
if (pLPD->fn[FUNC_GETCHARWIDTH] == NULL)
|
||||
{
|
||||
|
@ -811,21 +717,18 @@ WORD PRTDRV_GetCharWidth(LPPDEVICE lpDestDev, LPINT lpBuffer,
|
|||
}
|
||||
|
||||
lP1 = lpDestDev;
|
||||
lP2 = SEGPTR_ALLOC( (wLastChar - wFirstChar + 1) * sizeof(WORD) );
|
||||
lP2 = MapLS( lpBuffer );
|
||||
wP3 = wFirstChar;
|
||||
wP4 = wLastChar;
|
||||
lP5 = SEGPTR_GET( lpFontInfo );
|
||||
lP5 = MapLS( lpFontInfo );
|
||||
lP6 = lpDrawMode;
|
||||
lP7 = lpTextXForm;
|
||||
|
||||
wRet = PRTDRV_CallTo16_word_llwwlll(pLPD->fn[FUNC_GETCHARWIDTH],
|
||||
lP1, SEGPTR_GET(lP2), wP3,
|
||||
wP4, lP5, lP6, lP7 );
|
||||
lP1, lP2, wP3, wP4, lP5, lP6, lP7 );
|
||||
|
||||
for(i = 0; i <= wLastChar - wFirstChar; i++)
|
||||
lpBuffer[i] = (INT) lP2[i];
|
||||
|
||||
SEGPTR_FREE(lP2);
|
||||
UnMapLS( lP2 );
|
||||
UnMapLS( lP5 );
|
||||
}
|
||||
return wRet;
|
||||
}
|
||||
|
@ -840,10 +743,8 @@ INT WIN16DRV_ExtDeviceMode(LPSTR lpszDriver, HWND hwnd, LPDEVMODEA lpdmOutput,
|
|||
DWORD dwMode)
|
||||
{
|
||||
LOADED_PRINTER_DRIVER *pLPD = LoadPrinterDriver(lpszDriver);
|
||||
LPDEVMODEA lpSegOut = NULL, lpSegIn = NULL;
|
||||
LPSTR lpSegDevice, lpSegPort, lpSegProfile;
|
||||
SEGPTR lpSegOut, lpSegIn, lpSegDevice, lpSegPort, lpSegProfile;
|
||||
INT16 wRet;
|
||||
WORD wOutSize = 0, wInSize = 0;
|
||||
|
||||
if(!pLPD) return -1;
|
||||
|
||||
|
@ -851,42 +752,19 @@ INT WIN16DRV_ExtDeviceMode(LPSTR lpszDriver, HWND hwnd, LPDEVMODEA lpdmOutput,
|
|||
WARN("No EXTDEVICEMODE\n");
|
||||
return -1;
|
||||
}
|
||||
lpSegDevice = SEGPTR_STRDUP(lpszDevice);
|
||||
lpSegPort = SEGPTR_STRDUP(lpszPort);
|
||||
lpSegProfile = SEGPTR_STRDUP(lpszProfile);
|
||||
if(lpdmOutput) {
|
||||
/* We don't know how big this will be so we call the driver's
|
||||
ExtDeviceMode to find out */
|
||||
wOutSize = PRTDRV_CallTo16_word_wwlllllw(
|
||||
pLPD->fn[FUNC_EXTDEVICEMODE], hwnd, pLPD->hInst, 0,
|
||||
SEGPTR_GET(lpSegDevice), SEGPTR_GET(lpSegPort), 0,
|
||||
SEGPTR_GET(lpSegProfile), 0 );
|
||||
lpSegOut = SEGPTR_ALLOC(wOutSize);
|
||||
}
|
||||
if(lpdmInput) {
|
||||
/* This time we get the information from the fields */
|
||||
wInSize = lpdmInput->dmSize + lpdmInput->dmDriverExtra;
|
||||
lpSegIn = SEGPTR_ALLOC(wInSize);
|
||||
memcpy(lpSegIn, lpdmInput, wInSize);
|
||||
}
|
||||
wRet = PRTDRV_CallTo16_word_wwlllllw( pLPD->fn[FUNC_EXTDEVICEMODE],
|
||||
hwnd, pLPD->hInst,
|
||||
SEGPTR_GET(lpSegOut),
|
||||
SEGPTR_GET(lpSegDevice),
|
||||
SEGPTR_GET(lpSegPort),
|
||||
SEGPTR_GET(lpSegIn),
|
||||
SEGPTR_GET(lpSegProfile),
|
||||
dwMode );
|
||||
if(lpSegOut) {
|
||||
memcpy(lpdmOutput, lpSegOut, wOutSize);
|
||||
SEGPTR_FREE(lpSegOut);
|
||||
}
|
||||
if(lpSegIn) {
|
||||
SEGPTR_FREE(lpSegIn);
|
||||
}
|
||||
SEGPTR_FREE(lpSegDevice);
|
||||
SEGPTR_FREE(lpSegPort);
|
||||
SEGPTR_FREE(lpSegProfile);
|
||||
lpSegDevice = MapLS(lpszDevice);
|
||||
lpSegPort = MapLS(lpszPort);
|
||||
lpSegProfile = MapLS(lpszProfile);
|
||||
lpSegOut = MapLS(lpdmOutput);
|
||||
lpSegIn = MapLS(lpdmInput);
|
||||
wRet = PRTDRV_CallTo16_word_wwlllllw( pLPD->fn[FUNC_EXTDEVICEMODE], hwnd, pLPD->hInst,
|
||||
lpSegOut, lpSegDevice, lpSegPort, lpSegIn,
|
||||
lpSegProfile, dwMode );
|
||||
UnMapLS(lpSegOut);
|
||||
UnMapLS(lpSegIn);
|
||||
UnMapLS(lpSegDevice);
|
||||
UnMapLS(lpSegPort);
|
||||
UnMapLS(lpSegProfile);
|
||||
return wRet;
|
||||
}
|
||||
|
||||
|
@ -902,10 +780,8 @@ DWORD WIN16DRV_DeviceCapabilities(LPSTR lpszDriver, LPCSTR lpszDevice,
|
|||
LPSTR lpszOutput, LPDEVMODEA lpDevMode)
|
||||
{
|
||||
LOADED_PRINTER_DRIVER *pLPD = LoadPrinterDriver(lpszDriver);
|
||||
LPVOID lpSegdm = NULL, lpSegOut = NULL;
|
||||
LPSTR lpSegDevice, lpSegPort;
|
||||
SEGPTR lpSegdm, lpSegOut, lpSegDevice, lpSegPort;
|
||||
DWORD dwRet;
|
||||
INT OutputSize;
|
||||
|
||||
TRACE("%s,%s,%s,%d,%p,%p\n", lpszDriver, lpszDevice, lpszPort,
|
||||
fwCapability, lpszOutput, lpDevMode);
|
||||
|
@ -916,107 +792,15 @@ DWORD WIN16DRV_DeviceCapabilities(LPSTR lpszDriver, LPCSTR lpszDevice,
|
|||
WARN("No DEVICECAPABILITES\n");
|
||||
return -1;
|
||||
}
|
||||
lpSegDevice = SEGPTR_STRDUP(lpszDevice);
|
||||
lpSegPort = SEGPTR_STRDUP(lpszPort);
|
||||
|
||||
if(lpDevMode) {
|
||||
lpSegdm = SEGPTR_ALLOC(lpDevMode->dmSize + lpDevMode->dmDriverExtra);
|
||||
memcpy(lpSegdm, lpDevMode, lpDevMode->dmSize +
|
||||
lpDevMode->dmDriverExtra);
|
||||
}
|
||||
|
||||
dwRet = PRTDRV_CallTo16_long_llwll(
|
||||
pLPD->fn[FUNC_DEVICECAPABILITIES],
|
||||
SEGPTR_GET(lpSegDevice), SEGPTR_GET(lpSegPort),
|
||||
fwCapability, 0, SEGPTR_GET(lpSegdm) );
|
||||
|
||||
if(dwRet == -1) return -1;
|
||||
|
||||
switch(fwCapability) {
|
||||
case DC_BINADJUST:
|
||||
case DC_COLLATE:
|
||||
case DC_COLORDEVICE:
|
||||
case DC_COPIES:
|
||||
case DC_DRIVER:
|
||||
case DC_DUPLEX:
|
||||
case DC_EMF_COMPLIANT:
|
||||
case DC_EXTRA:
|
||||
case DC_FIELDS:
|
||||
case DC_MANUFACTURER:
|
||||
case DC_MAXEXTENT:
|
||||
case DC_MINEXTENT:
|
||||
case DC_MODEL:
|
||||
case DC_ORIENTATION:
|
||||
case DC_PRINTERMEM:
|
||||
case DC_PRINTRATEUNIT:
|
||||
case DC_SIZE:
|
||||
case DC_TRUETYPE:
|
||||
case DC_VERSION:
|
||||
OutputSize = 0;
|
||||
break;
|
||||
|
||||
case DC_BINNAMES:
|
||||
OutputSize = 24 * dwRet;
|
||||
break;
|
||||
|
||||
case DC_BINS:
|
||||
case DC_PAPERS:
|
||||
OutputSize = sizeof(WORD) * dwRet;
|
||||
break;
|
||||
|
||||
case DC_DATATYPE_PRODUCED:
|
||||
OutputSize = dwRet;
|
||||
FIXME("%ld DataTypes supported. Don't know how long to make buffer!\n",
|
||||
dwRet);
|
||||
break;
|
||||
|
||||
case DC_ENUMRESOLUTIONS:
|
||||
OutputSize = 2 * sizeof(LONG) * dwRet;
|
||||
break;
|
||||
|
||||
case DC_FILEDEPENDENCIES:
|
||||
case DC_MEDIAREADY:
|
||||
case DC_PAPERNAMES:
|
||||
OutputSize = 64 * dwRet;
|
||||
break;
|
||||
|
||||
case DC_NUP:
|
||||
OutputSize = sizeof(DWORD) * dwRet;
|
||||
break;
|
||||
|
||||
case DC_PAPERSIZE:
|
||||
OutputSize = sizeof(POINT16) * dwRet;
|
||||
break;
|
||||
|
||||
case DC_PERSONALITY:
|
||||
OutputSize = 32 * dwRet;
|
||||
break;
|
||||
|
||||
default:
|
||||
FIXME("Unsupported capability %d\n", fwCapability);
|
||||
OutputSize = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
if(OutputSize && lpszOutput) {
|
||||
lpSegOut = SEGPTR_ALLOC(OutputSize);
|
||||
dwRet = PRTDRV_CallTo16_long_llwll(
|
||||
pLPD->fn[FUNC_DEVICECAPABILITIES],
|
||||
SEGPTR_GET(lpSegDevice),
|
||||
SEGPTR_GET(lpSegPort),
|
||||
fwCapability,
|
||||
SEGPTR_GET(lpSegOut),
|
||||
SEGPTR_GET(lpSegdm) );
|
||||
memcpy(lpszOutput, lpSegOut, OutputSize);
|
||||
SEGPTR_FREE(lpSegOut);
|
||||
}
|
||||
|
||||
if(lpSegdm) {
|
||||
memcpy(lpDevMode, lpSegdm, lpDevMode->dmSize +
|
||||
lpDevMode->dmDriverExtra);
|
||||
SEGPTR_FREE(lpSegdm);
|
||||
}
|
||||
SEGPTR_FREE(lpSegDevice);
|
||||
SEGPTR_FREE(lpSegPort);
|
||||
lpSegDevice = MapLS(lpszDevice);
|
||||
lpSegPort = MapLS(lpszPort);
|
||||
lpSegdm = MapLS(lpDevMode);
|
||||
lpSegOut = MapLS(lpszOutput);
|
||||
dwRet = PRTDRV_CallTo16_long_llwll( pLPD->fn[FUNC_DEVICECAPABILITIES],
|
||||
lpSegDevice, lpSegPort, fwCapability, lpSegOut, lpSegdm );
|
||||
UnMapLS(lpSegOut);
|
||||
UnMapLS(lpSegdm);
|
||||
UnMapLS(lpSegDevice);
|
||||
UnMapLS(lpSegPort);
|
||||
return dwRet;
|
||||
}
|
||||
|
|
|
@ -804,13 +804,13 @@ HINSTANCE16 WINAPI WinExec16( LPCSTR lpCmdLine, UINT16 nCmdShow )
|
|||
{
|
||||
args++;
|
||||
arglen = strlen(args);
|
||||
cmdline = SEGPTR_ALLOC( 2 + arglen );
|
||||
cmdline = HeapAlloc( GetProcessHeap(), 0, 2 + arglen );
|
||||
cmdline[0] = (BYTE)arglen;
|
||||
strcpy( cmdline + 1, args );
|
||||
}
|
||||
else
|
||||
{
|
||||
cmdline = SEGPTR_ALLOC( 2 );
|
||||
cmdline = HeapAlloc( GetProcessHeap(), 0, 2 );
|
||||
cmdline[0] = cmdline[1] = 0;
|
||||
}
|
||||
|
||||
|
@ -819,22 +819,22 @@ HINSTANCE16 WINAPI WinExec16( LPCSTR lpCmdLine, UINT16 nCmdShow )
|
|||
if (SearchPathA( NULL, name, ".exe", sizeof(buffer), buffer, NULL ))
|
||||
{
|
||||
LOADPARAMS16 params;
|
||||
WORD *showCmd = SEGPTR_ALLOC( 2*sizeof(WORD) );
|
||||
WORD showCmd[2];
|
||||
showCmd[0] = 2;
|
||||
showCmd[1] = nCmdShow;
|
||||
|
||||
params.hEnvironment = 0;
|
||||
params.cmdLine = SEGPTR_GET(cmdline);
|
||||
params.showCmd = SEGPTR_GET(showCmd);
|
||||
params.cmdLine = MapLS( cmdline );
|
||||
params.showCmd = MapLS( showCmd );
|
||||
params.reserved = 0;
|
||||
|
||||
ret = LoadModule16( buffer, ¶ms );
|
||||
|
||||
SEGPTR_FREE( showCmd );
|
||||
SEGPTR_FREE( cmdline );
|
||||
UnMapLS( params.cmdLine );
|
||||
UnMapLS( params.showCmd );
|
||||
}
|
||||
else ret = GetLastError();
|
||||
|
||||
HeapFree( GetProcessHeap(), 0, cmdline );
|
||||
if (name != lpCmdLine) HeapFree( GetProcessHeap(), 0, name );
|
||||
|
||||
if (ret == 21) /* 32-bit module */
|
||||
|
|
|
@ -10,8 +10,8 @@
|
|||
#include <assert.h>
|
||||
#include "winerror.h"
|
||||
#include "winnls.h"
|
||||
#include "wine/unicode.h"
|
||||
#include "font.h"
|
||||
#include "heap.h"
|
||||
#include "options.h"
|
||||
#include "debugtools.h"
|
||||
#include "gdi.h"
|
||||
|
@ -694,31 +694,23 @@ INT16 WINAPI EnumFontFamiliesEx16( HDC16 hDC, LPLOGFONT16 plf,
|
|||
|
||||
if (enum_func)
|
||||
{
|
||||
LPNEWTEXTMETRICEX16 lptm16 = SEGPTR_ALLOC( sizeof(NEWTEXTMETRICEX16) );
|
||||
if( lptm16 )
|
||||
{
|
||||
LPENUMLOGFONTEX16 lplf16 = SEGPTR_ALLOC( sizeof(ENUMLOGFONTEX16) );
|
||||
if( lplf16 )
|
||||
{
|
||||
fontEnum16 fe16;
|
||||
LOGFONTW lfW;
|
||||
FONT_LogFont16ToW(plf, &lfW);
|
||||
NEWTEXTMETRICEX16 tm16;
|
||||
ENUMLOGFONTEX16 lf16;
|
||||
fontEnum16 fe16;
|
||||
LOGFONTW lfW;
|
||||
FONT_LogFont16ToW(plf, &lfW);
|
||||
|
||||
fe16.lpLogFontParam = plf;
|
||||
fe16.lpEnumFunc = efproc;
|
||||
fe16.lpData = lParam;
|
||||
|
||||
fe16.lpTextMetric = lptm16;
|
||||
fe16.lpLogFont = lplf16;
|
||||
fe16.segTextMetric = SEGPTR_GET(lptm16);
|
||||
fe16.segLogFont = SEGPTR_GET(lplf16);
|
||||
fe16.lpLogFontParam = plf;
|
||||
fe16.lpEnumFunc = efproc;
|
||||
fe16.lpData = lParam;
|
||||
fe16.lpTextMetric = &tm16;
|
||||
fe16.lpLogFont = &lf16;
|
||||
fe16.segTextMetric = MapLS( &tm16 );
|
||||
fe16.segLogFont = MapLS( &lf16 );
|
||||
|
||||
retVal = enum_func( hDC, &lfW, FONT_EnumInstance16,
|
||||
(LPARAM)&fe16 );
|
||||
SEGPTR_FREE(lplf16);
|
||||
}
|
||||
SEGPTR_FREE(lptm16);
|
||||
}
|
||||
retVal = enum_func( hDC, &lfW, FONT_EnumInstance16, (LPARAM)&fe16 );
|
||||
UnMapLS( fe16.segTextMetric );
|
||||
UnMapLS( fe16.segLogFont );
|
||||
}
|
||||
return retVal;
|
||||
}
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
#include "bitmap.h"
|
||||
#include "brush.h"
|
||||
#include "font.h"
|
||||
#include "heap.h"
|
||||
#include "local.h"
|
||||
#include "palette.h"
|
||||
#include "pen.h"
|
||||
|
@ -873,8 +872,9 @@ INT16 WINAPI EnumObjects16( HDC16 hdc, INT16 nObjType,
|
|||
};
|
||||
|
||||
INT16 i, retval = 0;
|
||||
LOGPEN16 *pen;
|
||||
LOGBRUSH16 *brush = NULL;
|
||||
LOGPEN16 pen;
|
||||
LOGBRUSH16 brush;
|
||||
SEGPTR segptr;
|
||||
|
||||
TRACE("%04x %d %08lx %08lx\n",
|
||||
hdc, nObjType, (DWORD)lpEnumFunc, lParam );
|
||||
|
@ -882,47 +882,44 @@ INT16 WINAPI EnumObjects16( HDC16 hdc, INT16 nObjType,
|
|||
{
|
||||
case OBJ_PEN:
|
||||
/* Enumerate solid pens */
|
||||
if (!(pen = SEGPTR_NEW(LOGPEN16))) break;
|
||||
segptr = MapLS( &pen );
|
||||
for (i = 0; i < sizeof(solid_colors)/sizeof(solid_colors[0]); i++)
|
||||
{
|
||||
pen->lopnStyle = PS_SOLID;
|
||||
pen->lopnWidth.x = 1;
|
||||
pen->lopnWidth.y = 0;
|
||||
pen->lopnColor = solid_colors[i];
|
||||
retval = GDI_CallTo16_word_ll( lpEnumFunc, SEGPTR_GET(pen), lParam );
|
||||
TRACE("solid pen %08lx, ret=%d\n",
|
||||
solid_colors[i], retval);
|
||||
pen.lopnStyle = PS_SOLID;
|
||||
pen.lopnWidth.x = 1;
|
||||
pen.lopnWidth.y = 0;
|
||||
pen.lopnColor = solid_colors[i];
|
||||
retval = GDI_CallTo16_word_ll( lpEnumFunc, segptr, lParam );
|
||||
TRACE("solid pen %08lx, ret=%d\n", solid_colors[i], retval);
|
||||
if (!retval) break;
|
||||
}
|
||||
SEGPTR_FREE(pen);
|
||||
UnMapLS( segptr );
|
||||
break;
|
||||
|
||||
case OBJ_BRUSH:
|
||||
/* Enumerate solid brushes */
|
||||
if (!(brush = SEGPTR_NEW(LOGBRUSH16))) break;
|
||||
segptr = MapLS( &brush );
|
||||
for (i = 0; i < sizeof(solid_colors)/sizeof(solid_colors[0]); i++)
|
||||
{
|
||||
brush->lbStyle = BS_SOLID;
|
||||
brush->lbColor = solid_colors[i];
|
||||
brush->lbHatch = 0;
|
||||
retval = GDI_CallTo16_word_ll( lpEnumFunc, SEGPTR_GET(brush), lParam );
|
||||
TRACE("solid brush %08lx, ret=%d\n",
|
||||
solid_colors[i], retval);
|
||||
brush.lbStyle = BS_SOLID;
|
||||
brush.lbColor = solid_colors[i];
|
||||
brush.lbHatch = 0;
|
||||
retval = GDI_CallTo16_word_ll( lpEnumFunc, segptr, lParam );
|
||||
TRACE("solid brush %08lx, ret=%d\n", solid_colors[i], retval);
|
||||
if (!retval) break;
|
||||
}
|
||||
|
||||
/* Now enumerate hatched brushes */
|
||||
if (retval) for (i = HS_HORIZONTAL; i <= HS_DIAGCROSS; i++)
|
||||
{
|
||||
brush->lbStyle = BS_HATCHED;
|
||||
brush->lbColor = RGB(0,0,0);
|
||||
brush->lbHatch = i;
|
||||
retval = GDI_CallTo16_word_ll( lpEnumFunc, SEGPTR_GET(brush), lParam );
|
||||
TRACE("hatched brush %d, ret=%d\n",
|
||||
i, retval);
|
||||
brush.lbStyle = BS_HATCHED;
|
||||
brush.lbColor = RGB(0,0,0);
|
||||
brush.lbHatch = i;
|
||||
retval = GDI_CallTo16_word_ll( lpEnumFunc, segptr, lParam );
|
||||
TRACE("hatched brush %d, ret=%d\n", i, retval);
|
||||
if (!retval) break;
|
||||
}
|
||||
SEGPTR_FREE(brush);
|
||||
UnMapLS( segptr );
|
||||
break;
|
||||
|
||||
default:
|
||||
|
|
|
@ -8,7 +8,6 @@
|
|||
#include <sys/types.h>
|
||||
#include "ntddk.h"
|
||||
#include "syslevel.h"
|
||||
#include "heap.h"
|
||||
#include "stackframe.h"
|
||||
#include "debugtools.h"
|
||||
|
||||
|
@ -33,12 +32,13 @@ VOID WINAPI GetpWin16Lock(SYSLEVEL **lock)
|
|||
*/
|
||||
SEGPTR WINAPI GetpWin16Lock16(void)
|
||||
{
|
||||
static SYSLEVEL *w16Mutex;
|
||||
static SEGPTR segpWin16Mutex;
|
||||
|
||||
if (!segpWin16Mutex)
|
||||
{
|
||||
SYSLEVEL **w16Mutex = SEGPTR_ALLOC(sizeof(SYSLEVEL *));
|
||||
*w16Mutex = &Win16Mutex;
|
||||
segpWin16Mutex = SEGPTR_GET(w16Mutex);
|
||||
w16Mutex = &Win16Mutex;
|
||||
segpWin16Mutex = MapLS( &w16Mutex );
|
||||
}
|
||||
return segpWin16Mutex;
|
||||
}
|
||||
|
|
|
@ -24,7 +24,6 @@
|
|||
#include "wingdi.h"
|
||||
#include "wine/winuser16.h"
|
||||
#include "wine/unicode.h"
|
||||
#include "heap.h"
|
||||
#include "win.h"
|
||||
#include "user.h"
|
||||
#include "controls.h"
|
||||
|
@ -45,6 +44,7 @@ typedef struct tagCLASS
|
|||
INT cbClsExtra; /* Class extra bytes */
|
||||
INT cbWndExtra; /* Window extra bytes */
|
||||
LPWSTR menuName; /* Default menu name (Unicode followed by ASCII) */
|
||||
SEGPTR segMenuName; /* Default menu name as SEGPTR */
|
||||
struct tagDCE *dce; /* Class DCE (if CS_CLASSDC) */
|
||||
HINSTANCE hInstance; /* Module that created the task */
|
||||
HICON hIcon; /* Default icon */
|
||||
|
@ -162,6 +162,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
|
||||
*
|
||||
|
@ -180,12 +194,14 @@ inline static LPWSTR CLASS_GetMenuNameW( CLASS *classPtr )
|
|||
*/
|
||||
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))
|
||||
{
|
||||
DWORD lenA = strlen(name) + 1;
|
||||
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 );
|
||||
memcpy( classPtr->menuName + lenW, name, lenA );
|
||||
}
|
||||
|
@ -200,12 +216,14 @@ static void CLASS_SetMenuNameA( CLASS *classPtr, LPCSTR 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))
|
||||
{
|
||||
DWORD lenW = strlenW(name) + 1;
|
||||
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) );
|
||||
WideCharToMultiByte( CP_ACP, 0, name, lenW,
|
||||
(char *)(classPtr->menuName + lenW), lenA, NULL, NULL );
|
||||
|
@ -245,6 +263,7 @@ static BOOL CLASS_FreeClass( CLASS *classPtr )
|
|||
GlobalDeleteAtom( classPtr->atomName );
|
||||
WINPROC_FreeProc( classPtr->winprocA, WIN_PROC_CLASS );
|
||||
WINPROC_FreeProc( classPtr->winprocW, WIN_PROC_CLASS );
|
||||
UnMapLS( classPtr->segMenuName );
|
||||
HeapFree( GetProcessHeap(), 0, classPtr->menuName );
|
||||
HeapFree( GetProcessHeap(), 0, classPtr );
|
||||
return TRUE;
|
||||
|
@ -789,8 +808,10 @@ LONG WINAPI GetClassLong16( HWND16 hwnd16, INT16 offset )
|
|||
release_class_ptr( class );
|
||||
return ret;
|
||||
case GCL_MENUNAME:
|
||||
ret = GetClassLongA( hwnd, offset );
|
||||
return (LONG)SEGPTR_GET( (void *)ret );
|
||||
if (!(class = get_class_ptr( hwnd, FALSE ))) return 0;
|
||||
ret = (LONG)CLASS_GetMenuName16( class );
|
||||
release_class_ptr( class );
|
||||
return ret;
|
||||
default:
|
||||
return GetClassLongA( hwnd, offset );
|
||||
}
|
||||
|
@ -1094,9 +1115,7 @@ BOOL16 WINAPI GetClassInfo16( HINSTANCE16 hInstance, SEGPTR name, WNDCLASS16 *wc
|
|||
wc->hCursor = classPtr->hCursor;
|
||||
wc->hbrBackground = classPtr->hbrBackground;
|
||||
wc->lpszClassName = name;
|
||||
wc->lpszMenuName = (SEGPTR)CLASS_GetMenuNameA( classPtr );
|
||||
if (HIWORD(wc->lpszMenuName)) /* Make it a SEGPTR */
|
||||
wc->lpszMenuName = SEGPTR_GET( (LPSTR)wc->lpszMenuName );
|
||||
wc->lpszMenuName = CLASS_GetMenuName16( classPtr );
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
@ -1206,10 +1225,8 @@ BOOL16 WINAPI GetClassInfoEx16( HINSTANCE16 hInstance, SEGPTR name, WNDCLASSEX16
|
|||
wc->hCursor = classPtr->hCursor;
|
||||
wc->hbrBackground = classPtr->hbrBackground;
|
||||
wc->lpszClassName = (SEGPTR)0;
|
||||
wc->lpszMenuName = (SEGPTR)CLASS_GetMenuNameA( classPtr );
|
||||
if (HIWORD(wc->lpszMenuName)) /* Make it a SEGPTR */
|
||||
wc->lpszMenuName = SEGPTR_GET( (LPSTR)wc->lpszMenuName );
|
||||
wc->lpszClassName = name;
|
||||
wc->lpszMenuName = CLASS_GetMenuName16( classPtr );
|
||||
wc->lpszClassName = name;
|
||||
|
||||
/* We must return the atom of the class here instead of just TRUE. */
|
||||
return atom;
|
||||
|
|
|
@ -42,10 +42,10 @@ typedef struct
|
|||
INT16 y;
|
||||
INT16 cx;
|
||||
INT16 cy;
|
||||
UINT id;
|
||||
UINT id;
|
||||
LPCSTR className;
|
||||
LPCSTR windowName;
|
||||
LPVOID data;
|
||||
LPCVOID data;
|
||||
} DLG_CONTROL_INFO;
|
||||
|
||||
/* Dialog template */
|
||||
|
@ -296,26 +296,21 @@ static LPCSTR DIALOG_GetControl16( LPCSTR p, DLG_CONTROL_INFO *info )
|
|||
p += strlen(p) + 1;
|
||||
}
|
||||
|
||||
if (*p)
|
||||
{
|
||||
/* Additional CTLDATA available for this control. */
|
||||
info->data = SEGPTR_ALLOC(*p);
|
||||
memcpy( info->data, p + 1, *p );
|
||||
}
|
||||
if (*p) info->data = p + 1;
|
||||
else info->data = NULL;
|
||||
|
||||
p += *p + 1;
|
||||
|
||||
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->id, info->x, info->y, info->cx, info->cy,
|
||||
info->style, (DWORD)SEGPTR_GET(info->data) );
|
||||
info->style, info->data );
|
||||
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->id, info->x, info->y, info->cx, info->cy,
|
||||
info->style, (DWORD)SEGPTR_GET(info->data) );
|
||||
info->style, info->data );
|
||||
|
||||
return p;
|
||||
}
|
||||
|
@ -414,7 +409,7 @@ static const WORD *DIALOG_GetControl32( const WORD *p, DLG_CONTROL_INFO *info,
|
|||
DPRINTF("\n");
|
||||
TRACE(" END\n" );
|
||||
}
|
||||
info->data = (LPVOID)(p + 1);
|
||||
info->data = p + 1;
|
||||
p += GET_WORD(p) / sizeof(WORD);
|
||||
}
|
||||
else info->data = NULL;
|
||||
|
@ -444,6 +439,8 @@ static BOOL DIALOG_CreateControls( HWND hwnd, LPCSTR template, const DLG_TEMPLAT
|
|||
if (!win32)
|
||||
{
|
||||
HINSTANCE16 instance;
|
||||
SEGPTR segptr;
|
||||
|
||||
template = DIALOG_GetControl16( template, &info );
|
||||
if (HIWORD(info.className) && !strcmp( info.className, "EDIT") &&
|
||||
!(GetWindowLongW( hwnd, GWL_STYLE ) & DS_LOCALEDIT))
|
||||
|
@ -462,6 +459,7 @@ static BOOL DIALOG_CreateControls( HWND hwnd, LPCSTR template, const DLG_TEMPLAT
|
|||
}
|
||||
else instance = (HINSTANCE16)hInst;
|
||||
|
||||
segptr = MapLS( info.data );
|
||||
hwndCtrl = WIN_Handle32( CreateWindowEx16( info.exStyle | WS_EX_NOPARENTNOTIFY,
|
||||
info.className, info.windowName,
|
||||
info.style | WS_CHILD,
|
||||
|
@ -470,9 +468,8 @@ static BOOL DIALOG_CreateControls( HWND hwnd, LPCSTR template, const DLG_TEMPLAT
|
|||
MulDiv(info.cx, dlgInfo->xBaseUnit, 4),
|
||||
MulDiv(info.cy, dlgInfo->yBaseUnit, 8),
|
||||
WIN_Handle16(hwnd), (HMENU16)info.id,
|
||||
instance, (LPVOID)SEGPTR_GET(info.data) ));
|
||||
|
||||
if (info.data) SEGPTR_FREE(info.data);
|
||||
instance, (LPVOID)segptr ));
|
||||
UnMapLS( segptr );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -493,7 +490,7 @@ static BOOL DIALOG_CreateControls( HWND hwnd, LPCSTR template, const DLG_TEMPLAT
|
|||
MulDiv(info.cx, dlgInfo->xBaseUnit, 4),
|
||||
MulDiv(info.cy, dlgInfo->yBaseUnit, 8),
|
||||
hwnd, (HMENU)info.id,
|
||||
hInst, info.data );
|
||||
hInst, (LPVOID)info.data );
|
||||
}
|
||||
if (!hwndCtrl) return FALSE;
|
||||
|
||||
|
|
|
@ -544,24 +544,21 @@ static HWND MDICreateChild( HWND parent, MDICLIENTINFO *ci,
|
|||
}
|
||||
else
|
||||
{
|
||||
MDICREATESTRUCT16 *cs16;
|
||||
LPSTR title, cls;
|
||||
MDICREATESTRUCT16 cs16;
|
||||
SEGPTR title, cls, seg_cs16;
|
||||
|
||||
WIN_ReleaseWndPtr( wndParent );
|
||||
cs16 = SEGPTR_NEW(MDICREATESTRUCT16);
|
||||
STRUCT32_MDICREATESTRUCT32Ato16( cs, cs16 );
|
||||
title = SEGPTR_STRDUP( cs->szTitle );
|
||||
cls = SEGPTR_STRDUP( cs->szClass );
|
||||
cs16->szTitle = SEGPTR_GET(title);
|
||||
cs16->szClass = SEGPTR_GET(cls);
|
||||
|
||||
STRUCT32_MDICREATESTRUCT32Ato16( cs, &cs16 );
|
||||
cs16.szTitle = title = MapLS( cs->szTitle );
|
||||
cs16.szClass = cls = MapLS( cs->szClass );
|
||||
seg_cs16 = MapLS( &cs16 );
|
||||
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,
|
||||
cs16->hOwner, (LPVOID)SEGPTR_GET(cs16) ));
|
||||
SEGPTR_FREE( title );
|
||||
SEGPTR_FREE( cls );
|
||||
SEGPTR_FREE( cs16 );
|
||||
cs16.hOwner, (LPVOID)seg_cs16 ));
|
||||
UnMapLS( seg_cs16 );
|
||||
UnMapLS( title );
|
||||
UnMapLS( cls );
|
||||
}
|
||||
|
||||
/* MDI windows are WS_CHILD so they won't be activated by CreateWindow */
|
||||
|
|
Loading…
Reference in New Issue