447 lines
11 KiB
Plaintext
447 lines
11 KiB
Plaintext
__foldwin32sstuff __foldwin32sstuff;
|
|
foldstyleinitialization = true;
|
|
|
|
|
|
enablemapdirect3216 = true;
|
|
flatthunks = false; /* BUGBUG [KevinR] 31-Aug-1993 */
|
|
|
|
|
|
#include "types.thk"
|
|
#include "gditypes.thk"
|
|
|
|
|
|
|
|
|
|
DWORD SetBrushOrg( HDC, INT, INT, LPPOINT lpPoint deleted) =
|
|
DWORD ThkSetBrushOrgEx( HDC, INT, INT, LPPOINT lpPoint)
|
|
{
|
|
lpPoint = maptoretval;
|
|
errorcode = 0;
|
|
faulterrorcode = 4096 + 0;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
LONG GetPath(HDC hdc, LPPOINT lpptl, LPBYTE lpby, LONG cptl) =
|
|
LONG GetPath(HDC hdc, LPPOINT lpptl, LPBYTE lpby, LONG cptl)
|
|
{
|
|
lpptl = raw pack unpack;
|
|
dwFreeInfo1 = local 4;
|
|
lpby = raw pack unpack;
|
|
dwFreeInfo2 = local 4;
|
|
errorcode = -1;
|
|
faulterrorcode = -1 + 4096;
|
|
}
|
|
|
|
|
|
|
|
|
|
BOOL GdiComment(HDC hdc, ULONG cby, LPBYTE lpby) =
|
|
BOOL GdiComment(HDC hdc, ULONG cby, LPBYTE lpby)
|
|
{
|
|
lpby = raw pack unpack;
|
|
dwFreeInfo = local 4;
|
|
errorcode = 0;
|
|
faulterrorcode = 4096 + 0;
|
|
}
|
|
|
|
|
|
|
|
|
|
ULONG GetEnhMetaFileBits(HEMF hemf, ULONG cby, LPBYTE lpby) =
|
|
ULONG GetEnhMetaFileBits(HEMF hemf, ULONG cby, LPBYTE lpby)
|
|
{
|
|
lpby = raw pack unpack;
|
|
dwFreeInfo = local 4;
|
|
errorcode = 0;
|
|
faulterrorcode = 4096 + 0;
|
|
}
|
|
|
|
ULONG GetEnhMetaFileDescription(HEMF hemf, ULONG cby, LPBYTE lpby) =
|
|
ULONG GetEnhMetaFileDescriptionA(HEMF hemf, ULONG cby, LPBYTE lpby)
|
|
{
|
|
lpby = raw pack unpack;
|
|
dwFreeInfo = local 4;
|
|
errorcode = -1;
|
|
faulterrorcode = 4096 - 1;
|
|
}
|
|
|
|
|
|
|
|
|
|
ULONG GetEnhMetaFilePaletteEntries(HEMF hemf, ULONG cby, LPBYTE lpby) =
|
|
ULONG GetEnhMetaFilePaletteEntries(HEMF hemf, ULONG cby, LPBYTE lpby)
|
|
{
|
|
lpby = raw pack unpack;
|
|
dwFreeInfo = local 4;
|
|
errorcode = -1;
|
|
faulterrorcode = 4096 - 1;
|
|
}
|
|
|
|
|
|
/*
|
|
* The correct 16-bit definition is:
|
|
* BOOL PlayEnhMetaFileRecord(HDC hdc, LPBYTE lpht, LPBYTE lpby, ULONG che)
|
|
*
|
|
* However, to avoid thunk compiler complaints, and because this
|
|
* function has a hand-coded thunk body, the 16-bit definition is made the
|
|
* same as the 32-bit one.
|
|
*
|
|
* lpht is a selector array and not the fastest thing in the world.
|
|
* It doesn't really matter right now because the C code on the 16-bit
|
|
* side won't handle more than 64k anyway.
|
|
*/
|
|
BOOL PlayEnhMetaFileRecord(HDC hdc, LPBYTE lpht, LPBYTE lpby,
|
|
ULONG che, ULONG cby) =
|
|
BOOL ThkPlayEnhMetaFileRecord(HDC hdc, LPBYTE lpht, LPBYTE lpby,
|
|
ULONG che, ULONG cby)
|
|
{
|
|
body = special;
|
|
errorcode = 0;
|
|
faulterrorcode = 4096 + 0;
|
|
}
|
|
|
|
HEMF SetEnhMetaFileBits(ULONG cby, LPSTR lpby) =
|
|
HEMF SetEnhMetaFileBits(ULONG cby, LPSTR lpby)
|
|
{
|
|
lpby = raw pack unpack;
|
|
dwFreeInfo = local 4;
|
|
errorcode = 0;
|
|
faulterrorcode = 4096 + 0;
|
|
}
|
|
|
|
|
|
BOOL DeleteMetaFile( HMF hMF) =
|
|
BOOL DeleteMetaFile( HMF hMF)
|
|
{
|
|
/*
|
|
* If hMF is a global memory handle allocated via GlobalAlloc32,
|
|
* then free it via MyGlobalFree. Otherwise, call Win3.1.
|
|
*/
|
|
body=special;
|
|
errorcode = 0;
|
|
faulterrorcode = 4096 + 0;
|
|
}
|
|
|
|
|
|
HBITMAP CreateBitmapIndirect( LPBITMAPINFO lpBitmap) =
|
|
HBITMAP CreateBitmapIndirect( LPBITMAPINFO lpBitmap)
|
|
{
|
|
body=special;
|
|
errorcode = 0;
|
|
faulterrorcode = 4096 + 0;
|
|
}
|
|
|
|
DWORD GetBitmapBits( HBITMAP hBitmap, DWORD dwCount, LPSTR lpBits) =
|
|
DWORD GetBitmapBits( HBITMAP hBitmap, DWORD dwCount, LPSTR lpBits)
|
|
{
|
|
lpBits = raw pack unpack;
|
|
dwFreeInfo = local 4;
|
|
errorcode = 0;
|
|
faulterrorcode = 4096 + 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
* LATER: adjust rc to cb16 from cb32
|
|
*
|
|
* LOGPEN widen
|
|
* LOGBRUSH widen
|
|
* LOGFONT same
|
|
* bitmap ==> width, height, color info: BITMAP ( bmBits==0), widen
|
|
* LOGPALETTE ==> # entries in palette, unchanged
|
|
*
|
|
*/
|
|
INT GetObject( HGDI hObject, INT nCount, LPSTR lpObject) =
|
|
INT GetObjectA( HGDI hObject, INT nCount, LPSTR lpObject)
|
|
{
|
|
/*
|
|
* hObject = special;
|
|
* nCount = special;
|
|
* lpObject = special;
|
|
*/
|
|
body=special;
|
|
errorcode = 0;
|
|
faulterrorcode = 4096 + 0;
|
|
}
|
|
|
|
|
|
|
|
BOOL GetTextMetrics( HDC hDC, LPTEXTMETRIC16 lpMetrics) =
|
|
BOOL GetTextMetricsA( HDC hDC, LPTEXTMETRIC32 lpMetrics)
|
|
{
|
|
/*
|
|
* The macro UNPACK_GETTEXTMETRICS_lpMetrics does the unpacking.
|
|
* The output semantic causes correct amount of space to be allocated
|
|
* for 16-bit structure. The byname semantic turns off some error
|
|
* checking.
|
|
*/
|
|
lpMetrics = byname;
|
|
lpMetrics = output;
|
|
lpMetrics = unpack;
|
|
errorcode = 0;
|
|
faulterrorcode = 4096 + 0;
|
|
}
|
|
|
|
|
|
/*
|
|
* The correct 16-bit definition is:
|
|
* HMF SetMetaFileBits/Better( HANDLE hMF)
|
|
*
|
|
* However, to avoid thunk compiler complaints, and because this
|
|
* function has a hand-coded thunk body, the 16-bit definition is made the
|
|
* same as the 32-bit one.
|
|
*/
|
|
HANDLE SetMetaFileBitsBetter( DWORD nSize, LPSTR lpData) =
|
|
HANDLE SetMetaFileBitsEx( DWORD nSize, LPSTR lpData)
|
|
{
|
|
body=special;
|
|
errorcode = 0;
|
|
faulterrorcode = 4096 + 0;
|
|
}
|
|
|
|
|
|
/* LPBITMAPINFO lpBitsInfo, BITMAPINFO unchanged */
|
|
INT SetDIBitsToDevice( HDC, INT, INT, UINT, UINT,
|
|
INT, INT, UINT, UINT,
|
|
LPSTR lpBits, LPBITMAPINFO lpBitsInfo, UINT) =
|
|
INT SetDIBitsToDevice( HDC, INT, INT, UINT, UINT,
|
|
INT, INT, UINT, UINT,
|
|
LPSTR lpBits, LPBITMAPINFO lpBitsInfo, UINT)
|
|
{
|
|
lpBits = raw pack unpack;
|
|
dwFreeInfo = local 4;
|
|
errorcode = 0;
|
|
faulterrorcode = 4096 + 0;
|
|
}
|
|
|
|
|
|
|
|
DWORD SetBitmapBits( HBITMAP hBitmap, DWORD dwCount, LPSTR lpBits) =
|
|
DWORD SetBitmapBits( HBITMAP hBitmap, DWORD dwCount, LPSTR lpBits)
|
|
{
|
|
lpBits = raw pack unpack;
|
|
dwFreeInfo = local 4;
|
|
errorcode = 0;
|
|
faulterrorcode = 4096 + 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
HBITMAP CreateBitmap( int nWidth, int nHeight,
|
|
BYTE nPlanes, BYTE nBitCount, LPSTR lpBits) =
|
|
HBITMAP CreateBitmap( int nWidth, int nHeight,
|
|
WORD nPlanes, WORD nBitCount, LPSTR lpBits)
|
|
{
|
|
body = special;
|
|
errorcode = 0;
|
|
faulterrorcode = 4096 + 0;
|
|
}
|
|
|
|
|
|
|
|
INT EnumObjects( HDC hDC, INT nObjectType, FARPROC lpObjectFunc, LONG lpData) =
|
|
INT EnumObjects( HDC hDC, INT nObjectType, FARPROC lpObjectFunc, LONG lpData)
|
|
{
|
|
lpObjectFunc = raw pack unpack;
|
|
errorcode = void;
|
|
faulterrorcode = 4096 + 0;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int GetDIBits( HDC hDC, HBITMAP hBitmap, UINT nStartScan,
|
|
UINT nNumScans, LPSTR lpBits,
|
|
LPBITMAPINFO lpBitsInfo, UINT wUsage) =
|
|
int GetDIBits( HDC hDC , HBITMAP hBitmap, UINT nStartScan,
|
|
UINT nNumScans, LPSTR lpBits,
|
|
LPBITMAPINFO lpBitsInfo, UINT wUsage)
|
|
{
|
|
lpBits = raw pack unpack;
|
|
dwFreeInfo = local 4;
|
|
errorcode = 0;
|
|
faulterrorcode = 4096 + 0;
|
|
}
|
|
|
|
|
|
BOOL PlayMetaFileRecord32( HDC hDC, LPSTR lpHandletable,
|
|
LPSTR lpMetaRecord, UINT nHandles) =
|
|
special BOOL PlayMetaFileRecord( HDC hDC, LPSTR lpHandletable,
|
|
LPSTR lpMetaRecord, UINT nHandles)
|
|
{
|
|
lpMetaRecord = raw pack unpack;
|
|
dwFreeInfo = local 4;
|
|
errorcode = void;
|
|
faulterrorcode = 4096 + 0;
|
|
}
|
|
|
|
|
|
|
|
|
|
INT SetDIBits( HDC hDC, HBITMAP hBitmap, UINT nStartScan, UINT nNumScans,
|
|
LPSTR lpBits, LPBITMAPINFO lpBitsInfo, UINT wUsage) =
|
|
INT SetDIBits( HDC hDC, HBITMAP hBitmap, UINT nStartScan, UINT nNumScans,
|
|
LPSTR lpBits, LPBITMAPINFO lpBitsInfo, UINT wUsage)
|
|
{
|
|
lpBits = raw pack unpack;
|
|
dwFreeInfo = local 4;
|
|
errorcode = 0;
|
|
faulterrorcode = 4096 + 0;
|
|
}
|
|
|
|
|
|
INT StretchDIBits( HDC hDC, INT DestX, INT DestY, INT wDestWidth,
|
|
INT wDestHeight, INT SrcX, INT SrcY, INT wSrcWidth,
|
|
INT wSrcHeight, LPSTR lpBits, LPBITMAPINFO lpBitsInfo,
|
|
UINT wUsage, DWORD dwRop) =
|
|
INT StretchDIBits( HDC hDC, INT DestX, INT DestY, INT wDestWidth,
|
|
INT wDestHeight, INT SrcX, INT SrcY, INT wSrcWidth,
|
|
INT wSrcHeight, LPSTR lpBits, LPBITMAPINFO lpBitsInfo,
|
|
UINT wUsage, DWORD dwRop)
|
|
{
|
|
lpBits = raw pack unpack;
|
|
dwFreeInfo = local 4;
|
|
errorcode = -1;
|
|
faulterrorcode = 4096 - 1;
|
|
}
|
|
|
|
|
|
|
|
HBITMAP CreateDIBitmap( HDC hDC, LPBITMAPINFOHEADER lpInfoHeader,
|
|
DWORD dwUsage, LPSTR lpInitBits,
|
|
LPBITMAPINFO lpInitInfo, UINT wUsage) =
|
|
HBITMAP ThkCreateDIBitmap( HDC hDC, LPBITMAPINFOHEADER lpInfoHeader,
|
|
DWORD dwUsage, LPSTR lpInitBits,
|
|
LPBITMAPINFO lpInitInfo, UINT wUsage)
|
|
{
|
|
lpInitBits = raw pack unpack;
|
|
dwFreeInfo = local 4;
|
|
errorcode = 0;
|
|
faulterrorcode = 4096 + 0;
|
|
}
|
|
|
|
|
|
void LineDDA( int X1, int Y1, int X2, int Y2, FARPROC lpLineFunc, DWORD lpData)=
|
|
void LineDDA( int X1, int Y1, int X2, int Y2, FARPROC lpLineFunc, DWORD lpData)
|
|
{
|
|
lpLineFunc = callback CBID_LINEDDA;
|
|
errorcode = void;
|
|
}
|
|
|
|
|
|
|
|
|
|
int StartDoc(HDC hdc, LPDOCINFO16 lpdi) =
|
|
int StartDocA(HDC hdc, LPDOCINFO32 lpdi)
|
|
{
|
|
lpdi = pack unpack;
|
|
lpszDocNameTemp = local 4;
|
|
lpszOutputTemp = local 4;
|
|
lpszDatatypeTemp = local 4;
|
|
errorcode = special;
|
|
faulterrorcode = 4096 - 1;
|
|
}
|
|
|
|
|
|
int Escape(HDC hdc, int nEscape, int cbInput, LPSTR lpInData, LPSTR lpOutData) =
|
|
int ThkEscape(HDC hdc, int nEscape, int cbInput, LPSTR lpInData, LPSTR lpOutData)
|
|
{
|
|
body = special;
|
|
errorcode = special;
|
|
faulterrorcode = 4096 + 0;
|
|
}
|
|
|
|
int SetAbortProc(HDC hdc, DWORD pfnAbort) =
|
|
int SetAbortProc(HDC hdc, DWORD pfnAbort)
|
|
{
|
|
pfnAbort = push;
|
|
errorcode = -1;
|
|
faulterrorcode = 4096 - 1;
|
|
}
|
|
|
|
|
|
DWORD GetFontData(HDC, DWORD, DWORD, LPSTR lpvBuffer, DWORD cbData) =
|
|
DWORD GetFontData(HDC, DWORD, DWORD, LPSTR lpvBuffer, DWORD cbData)
|
|
{
|
|
lpvBuffer = raw pack unpack;
|
|
dwFreeInfo = local 4;
|
|
errorcode = -1;
|
|
faulterrorcode = 4096 - 1;
|
|
}
|
|
|
|
|
|
/*
|
|
* Last param is really LPMAT2, but no repacking necessary.
|
|
*/
|
|
DWORD GetGlyphOutline( HDC, UINT, UINT, LPGLYPHMETRICS16 lpgm, DWORD, LPSTR lpvBuffer, LPSTR) =
|
|
DWORD GetGlyphOutlineA(HDC, UINT, UINT, LPGLYPHMETRICS32 lpgm, DWORD, LPSTR lpvBuffer, LPSTR)
|
|
{
|
|
lpgm = output;
|
|
lpvBuffer = raw pack unpack;
|
|
dwFreeInfo = local 4;
|
|
errorcode = -1;
|
|
faulterrorcode = 4096 - 1;
|
|
}
|
|
|
|
|
|
/*
|
|
* lpotm is really LPOUTLINETEXTMETRIC
|
|
*/
|
|
WORD GetOutlineTextMetrics(HDC, UINT cbData, LPSTR lpotm) =
|
|
DWORD GetOutlineTextMetricsA(HDC, UINT cbData, LPSTR lpotm)
|
|
{
|
|
body=special;
|
|
errorcode = 0;
|
|
faulterrorcode = 4096 + 0;
|
|
}
|
|
|
|
|
|
|
|
int GetKerningPairs( HDC, int cPairs, LPKERNINGPAIR lpkp) =
|
|
int GetKerningPairsA(HDC, int cPairs, LPKERNINGPAIR lpkp)
|
|
{
|
|
lpkp = raw pack unpack;
|
|
dwFreeInfo = local 4;
|
|
errorcode = 0;
|
|
faulterrorcode = 4096 + 0;
|
|
}
|
|
|
|
|
|
BOOL GetTextExtentExPoint(HDC hdc,
|
|
LPSTR lpszStr,
|
|
int cchString,
|
|
int nMaxExtent,
|
|
LPINT lpnFit,
|
|
LPINT alpDx,
|
|
LPSIZE lpSize) =
|
|
BOOL GetTextExtentExPointA(HDC hdc,
|
|
LPSTR lpszStr,
|
|
int cchString,
|
|
int nMaxExtent,
|
|
LPINT lpnFit,
|
|
LPINT alpDx,
|
|
LPSIZE lpSize)
|
|
{
|
|
body = special;
|
|
faulterrorcode = 4096 + 0;
|
|
}
|
|
|
|
|
|
/* Private API: GDI32 must run this thunk before any other.
|
|
*
|
|
* The pointer params are linear addresses which are passed through
|
|
* untouched.
|
|
*/
|
|
VOID GdiThunkInit(DWORD pCB32Tab, DWORD ppData16, DWORD ppStockObj,
|
|
DWORD ppHeap32, DWORD phHeap32) =
|
|
VOID GdiThunkInit(DWORD pCB32Tab, DWORD ppData16, DWORD ppStockObj,
|
|
DWORD ppHeap32, DWORD phHeap32)
|
|
{}
|