summaryrefslogtreecommitdiffstats
path: root/private/mvdm/wow16/inc
diff options
context:
space:
mode:
Diffstat (limited to 'private/mvdm/wow16/inc')
-rw-r--r--private/mvdm/wow16/inc/cderr.h58
-rw-r--r--private/mvdm/wow16/inc/cmacros.inc1413
-rw-r--r--private/mvdm/wow16/inc/cmacros.mas2666
-rw-r--r--private/mvdm/wow16/inc/cmstrip.c102
-rw-r--r--private/mvdm/wow16/inc/commdlg.h318
-rw-r--r--private/mvdm/wow16/inc/common.ver101
-rw-r--r--private/mvdm/wow16/inc/convdll.inc58
-rw-r--r--private/mvdm/wow16/inc/cpl.h159
-rw-r--r--private/mvdm/wow16/inc/custcntl.h105
-rw-r--r--private/mvdm/wow16/inc/dbcs.c115
-rw-r--r--private/mvdm/wow16/inc/dbcs.h7
-rw-r--r--private/mvdm/wow16/inc/dde.h146
-rw-r--r--private/mvdm/wow16/inc/ddeml.h459
-rw-r--r--private/mvdm/wow16/inc/debug.h32
-rw-r--r--private/mvdm/wow16/inc/debugsys.inc867
-rw-r--r--private/mvdm/wow16/inc/dlgs.h192
-rw-r--r--private/mvdm/wow16/inc/dosx.inc47
-rw-r--r--private/mvdm/wow16/inc/drivinit.h2
-rw-r--r--private/mvdm/wow16/inc/gdidefs.inc1292
-rw-r--r--private/mvdm/wow16/inc/gpfix.inc62
-rw-r--r--private/mvdm/wow16/inc/header.txt364
-rw-r--r--private/mvdm/wow16/inc/ime.h210
-rw-r--r--private/mvdm/wow16/inc/int31.inc136
-rw-r--r--private/mvdm/wow16/inc/io.h47
-rw-r--r--private/mvdm/wow16/inc/klayer.inc1367
-rw-r--r--private/mvdm/wow16/inc/layer.inc1386
-rw-r--r--private/mvdm/wow16/inc/logerror.h186
-rw-r--r--private/mvdm/wow16/inc/logerror.inc159
-rw-r--r--private/mvdm/wow16/inc/lzdos.h5
-rw-r--r--private/mvdm/wow16/inc/lzexpand.h95
-rw-r--r--private/mvdm/wow16/inc/memory.h56
-rw-r--r--private/mvdm/wow16/inc/mmddk.h414
-rw-r--r--private/mvdm/wow16/inc/mmddk.inc337
-rw-r--r--private/mvdm/wow16/inc/mmsystem.h1954
-rw-r--r--private/mvdm/wow16/inc/mmsystem.inc1490
-rw-r--r--private/mvdm/wow16/inc/multires.h71
-rw-r--r--private/mvdm/wow16/inc/newexe.inc332
-rw-r--r--private/mvdm/wow16/inc/ole.h504
-rw-r--r--private/mvdm/wow16/inc/paswindw.inc5327
-rw-r--r--private/mvdm/wow16/inc/penwin.h818
-rw-r--r--private/mvdm/wow16/inc/prd.inc69
-rw-r--r--private/mvdm/wow16/inc/print.h302
-rw-r--r--private/mvdm/wow16/inc/printer.h258
-rw-r--r--private/mvdm/wow16/inc/rom.inc50
-rw-r--r--private/mvdm/wow16/inc/shellapi.h99
-rw-r--r--private/mvdm/wow16/inc/spl_wnt.h248
-rw-r--r--private/mvdm/wow16/inc/spool.h175
-rw-r--r--private/mvdm/wow16/inc/stdarg.h42
-rw-r--r--private/mvdm/wow16/inc/stdio.h254
-rw-r--r--private/mvdm/wow16/inc/stdlib.h212
-rw-r--r--private/mvdm/wow16/inc/string.h121
-rw-r--r--private/mvdm/wow16/inc/strtable.h136
-rw-r--r--private/mvdm/wow16/inc/style.h206
-rw-r--r--private/mvdm/wow16/inc/testing.h50
-rw-r--r--private/mvdm/wow16/inc/time.h118
-rw-r--r--private/mvdm/wow16/inc/userproc.h38
-rw-r--r--private/mvdm/wow16/inc/ver.h255
-rw-r--r--private/mvdm/wow16/inc/version.h64
-rw-r--r--private/mvdm/wow16/inc/w32sys.h24
-rw-r--r--private/mvdm/wow16/inc/wfwnet.h72
-rw-r--r--private/mvdm/wow16/inc/wife.h1103
-rw-r--r--private/mvdm/wow16/inc/win3deb.inc186
-rw-r--r--private/mvdm/wow16/inc/windefs.inc124
-rw-r--r--private/mvdm/wow16/inc/windows.h5724
-rw-r--r--private/mvdm/wow16/inc/windows.inc2418
-rw-r--r--private/mvdm/wow16/inc/windowsx.h1112
-rw-r--r--private/mvdm/wow16/inc/winexp.h47
-rw-r--r--private/mvdm/wow16/inc/winnet.h507
-rw-r--r--private/mvdm/wow16/inc/winnls.h91
-rw-r--r--private/mvdm/wow16/inc/wmsyserr.h37
70 files changed, 37601 insertions, 0 deletions
diff --git a/private/mvdm/wow16/inc/cderr.h b/private/mvdm/wow16/inc/cderr.h
new file mode 100644
index 000000000..402ac0956
--- /dev/null
+++ b/private/mvdm/wow16/inc/cderr.h
@@ -0,0 +1,58 @@
+/*****************************************************************************\
+* *
+* cderr.h - Common dialog error return codes *
+* *
+* Version 1.0 *
+* *
+* Copyright (c) 1992, Microsoft Corp. All rights reserved. *
+* *
+\*****************************************************************************/
+
+#ifndef _INC_CDERR
+#define _INC_CDERR
+
+#define CDERR_DIALOGFAILURE 0xFFFF
+
+#define CDERR_GENERALCODES 0x0000
+#define CDERR_STRUCTSIZE 0x0001
+#define CDERR_INITIALIZATION 0x0002
+#define CDERR_NOTEMPLATE 0x0003
+#define CDERR_NOHINSTANCE 0x0004
+#define CDERR_LOADSTRFAILURE 0x0005
+#define CDERR_FINDRESFAILURE 0x0006
+#define CDERR_LOADRESFAILURE 0x0007
+#define CDERR_LOCKRESFAILURE 0x0008
+#define CDERR_MEMALLOCFAILURE 0x0009
+#define CDERR_MEMLOCKFAILURE 0x000A
+#define CDERR_NOHOOK 0x000B
+#define CDERR_REGISTERMSGFAIL 0x000C
+
+#define PDERR_PRINTERCODES 0x1000
+#define PDERR_SETUPFAILURE 0x1001
+#define PDERR_PARSEFAILURE 0x1002
+#define PDERR_RETDEFFAILURE 0x1003
+#define PDERR_LOADDRVFAILURE 0x1004
+#define PDERR_GETDEVMODEFAIL 0x1005
+#define PDERR_INITFAILURE 0x1006
+#define PDERR_NODEVICES 0x1007
+#define PDERR_NODEFAULTPRN 0x1008
+#define PDERR_DNDMMISMATCH 0x1009
+#define PDERR_CREATEICFAILURE 0x100A
+#define PDERR_PRINTERNOTFOUND 0x100B
+#define PDERR_DEFAULTDIFFERENT 0x100C
+
+#define CFERR_CHOOSEFONTCODES 0x2000
+#define CFERR_NOFONTS 0x2001
+#define CFERR_MAXLESSTHANMIN 0x2002
+
+#define FNERR_FILENAMECODES 0x3000
+#define FNERR_SUBCLASSFAILURE 0x3001
+#define FNERR_INVALIDFILENAME 0x3002
+#define FNERR_BUFFERTOOSMALL 0x3003
+
+#define FRERR_FINDREPLACECODES 0x4000
+#define FRERR_BUFFERLENGTHZERO 0x4001
+
+#define CCERR_CHOOSECOLORCODES 0x5000
+
+#endif /* !_INC_CDERR */
diff --git a/private/mvdm/wow16/inc/cmacros.inc b/private/mvdm/wow16/inc/cmacros.inc
new file mode 100644
index 000000000..427ad4a86
--- /dev/null
+++ b/private/mvdm/wow16/inc/cmacros.inc
@@ -0,0 +1,1413 @@
+comment $
+cmacros - assembly macros for interfacing to hlls
+(C)Copyright Microsoft Corp. 1984-1988
+$
+.xcref
+.xcref ??_out
+ifndef ?QUIET
+?QUIET equ 1
+endif
+??_out macro t
+ifndef ?QUIET
+%out t
+endif
+endm
+outif macro name,defval,onmsg,offmsg
+ifndef name
+ifb <defval>
+name=0
+else
+name=defval
+endif
+endif
+if name
+name=1
+ifnb <onmsg>
+??_out <! onmsg>
+endif
+else
+ifnb <offmsg>
+??_out <! offmsg>
+endif
+endif
+endm
+.xcref ??error
+??error macro msg
+e r r o r ----- msg
+.err
+endm
+.xcref ASMpass
+.xcref memS,memM,memL,memC,memH,memMOD,sizec,sized
+if1
+ASMpass=1
+ifdef ?SMALL
+memS=1
+endif
+ifdef ?MEDIUM
+memM=1
+endif
+ifdef ?COMPACT
+memC=1
+endif
+ifdef ?LARGE
+memL=1
+endif
+ifdef ?HUGE
+memH=1
+endif
+??_out <cMacros Version 5.20 - Copyright (c) Microsoft Corp. 1984-1988>
+outif memS,0,<Small model>
+outif memM,0,<Medium model>
+outif memL,0,<Large model>
+outif memC,0,<Compact model>
+outif memH,0,<Huge model>
+memMOD= memS + memM + memL + memC + memH
+if memMOD ne 1
+if memMOD eq 0
+memS = 1
+else
+??error <more than 1 memory model selected>
+endif
+endif
+sizec= memM + memL + memH
+sized= memL + memC + (memH*2)
+outif ?DF,0,<No segments or groups will be defined>
+outif ?TF,0,<Epilog sequences assume valid SP>
+outif ?WIN,1,<Windows support>
+ifdef PMODE
+?pmd=1
+??_out <! 286 protect mode>
+else
+?pmd=0
+endif
+ifdef ?386regs
+if ?386regs
+??_out <! 386 registers enabled>
+endif
+else
+?386regs=0
+endif
+if ?WIN eq 1
+outif ?PLM,1,<>
+else
+outif ?PLM,1,<Pascal calling convention>
+endif
+ifndef ?NODATA
+?nodata1=0
+else
+?nodata1=1
+??_out <! NODATA module>
+endif
+ifndef ?CHKSTK
+?chkstk1=0
+else
+?chkstk1=1
+ifdef ?CHKSTKPROC
+??_out <! Private stack checking enabled>
+else
+??_out <! Stack checking enabled>
+endif
+endif
+ifndef DOS5
+?DOS5=0
+else
+?DOS5=1
+??_out <! DOS5 module>
+endif
+ifdef ?PROFILE
+??_out <! Native profiling enabled>
+endif
+else
+ASMpass=2
+endif
+ifdef ?pmd
+.286p
+endif
+if ?386regs
+.xcref ?n,?ax,?eax,?bx,?ebx
+.xcref ?cx,?ecx,?dx,?edx
+.xcref ?si,?esi,?di,?edi,?es,?ds,?fs
+.xcref ?gs
+else
+.xcref ?n,?ax,?ah,?al,?bx,?bh
+.xcref ?bl,?cx,?ch,?cl,?dx,?dh
+.xcref ?dl,?si,?di,?es,?ds,?bp
+.xcref ?sp,?ss,?cs
+endif
+.xcref ?rsl,?cpd,?argl,?argc,?ba
+.xcref ?acb,???,?po
+.xcref ?pas,?pc
+.xcref uconcat,mpush,mpop
+.xcref ?ri,?pp,?pp1,?al1
+.xcref ?ad,?ap,?atal,?dd,?dd1,?dd2
+.xcref ?pg,?pg1,?aloc,?cs1,?cs2
+.xcref ?DF,?TF,?ff,?PLM,?WIN,?ia,?pu,?adj
+.xcref ?uf,?rp,?nx,?nd,?nodata1,?chkstk1,?DOS5,?pmd,?lds,?exp
+.xcref ?wfp,arg,cCall,cProc,assumes,?cs3,?cs2,?cs1
+.xcref defgrp,addseg,createSeg
+.xcref save,outif,errnz,errn$,errnz1
+.xcref ?PLMPrevParm,?gcc
+.xcref ?cCall1,?pcc
+?rsl = 0
+?cpd = 0
+?argl = 0
+?argc = 0
+?ba = 0
+?acb = 0
+??? = 0
+?po = 0
+?pas = 0
+?pc = 0
+?ia = 0
+?pu = 0
+?adj = 0
+?rp = 0
+?uf = 0
+?nd = 0
+?nx = 0
+?wfp = 0
+?lds = 0
+?exp = 0
+?ff = 0
+?dd2 = 0
+?cCall1 = 0
+?pcc = 0
+?PLMPrevParm = 0
+.xcref ?casen
+if1
+?casen = 0
+endif
+if ?386regs
+?n = 0000000000000000b
+?ax = 0000000000000001b
+?eax = 0000000000000010b
+?bx = 0000000000000100b
+?ebx = 0000000000001000b
+?cx = 0000000000010000b
+?ecx = 0000000000100000b
+?dx = 0000000001000000b
+?edx = 0000000010000000b
+?si = 0000000100000000b
+?esi = 0000001000000000b
+?di = 0000010000000000b
+?edi = 0000100000000000b
+?ds = 0001000000000000b
+?es = 0010000000000000b
+?fs = 0100000000000000b
+?gs = 1000000000000000b
+else
+?n = 0000000000000000b
+?ax = 0000000000000011b
+?ah = 0000000000000001b
+?al = 0000000000000010b
+?bx = 0000000000001100b
+?bh = 0000000000000100b
+?bl = 0000000000001000b
+?cx = 0000000000110000b
+?ch = 0000000000010000b
+?cl = 0000000000100000b
+?dx = 0000000011000000b
+?dh = 0000000001000000b
+?dl = 0000000010000000b
+?si = 0000000100000000b
+?di = 0000001000000000b
+?es = 0000010000000000b
+?ds = 0000100000000000b
+?bp = 0001000000000000b
+?sp = 0010000000000000b
+?ss = 0100000000000000b
+?cs = 1000000000000000b
+endif
+.cref
+uconcat macro a,b,c,d,e,f,g
+a&b c&d e&f&g
+endm
+if ?386regs
+mpush macro r
+irp x,<ax,eax,bx,ebx,cx,ecx,dx,edx,si,esi,di,edi,ds,es,fs,gs>
+if (r and ?&&x)
+ push x
+endif
+endm
+endm
+else
+mpush macro r
+irp x,<ax,bx,cx,dx,si,di,es,ds,bp,sp,ss,cs>
+if (r and ?&&x)
+ push x
+endif
+endm
+endm
+endif
+if ?386regs
+mpop macro r
+irp x,<gs,fs,es,ds,edi,di,esi,si,edx,dx,ecx,cx,ebx,bx,eax,ax>
+if (r and ?&&x)
+ pop x
+endif
+endm
+endm
+else
+mpop macro r
+irp x,<cs,ss,sp,bp,ds,es,di,si,dx,cx,bx,ax>
+if (r and ?&&x)
+ pop x
+endif
+endm
+endm
+endif
+save macro r
+?rsl=0
+?ri ?rsl,<r>
+endm
+?ri macro n,r
+irp x,<r>
+.ERRNDEF ?&&x
+n=n or ?&&x
+endm
+endm
+.xcref
+.xcref parmB,parmW,parmD,parmQ,parmT,parmCP,parmDP
+.cref
+parmB macro n
+?pp <n>,<byte>,2,1
+endm
+parmW macro n
+?pp <n>,<word>,2,2
+endm
+parmD macro n
+ife ?PLM
+irp x,<n>
+?pp <&&x>,<dword>,0,4
+?pp <off_&&x>,<word>,2,2
+?pp <seg_&&x>,<word>,2,2
+endm
+else
+irp x,<n>
+?pp <seg_&&x>,<word>,2,2
+?pp <off_&&x>,<word>,2,2
+?pp <&&x>,<dword>,0,4
+endm
+endif
+endm
+parmQ macro n
+?pp <n>,<qword>,8,8
+endm
+parmT macro n
+?pp <n>,<tbyte>,10,10
+endm
+if sizec
+parmCP macro n
+parmD <n>
+endm
+else
+parmCP macro n
+parmW <n>
+endm
+endif
+if sized
+parmDP macro n
+parmD <n>
+endm
+else
+parmDP macro n
+parmW <n>
+endm
+endif
+?pp macro n,t,l,s
+if ?cpd
+.xcref
+irp x,<n>
+.xcref ?t&&x
+?t&&x=s
+ife ?PLM
+?pp1 x,<t>,,,%(?po+?adj)
+?po=?po+l
+else
+?PLMPrevParm=?PLMPrevParm+1
+?po=?po+l
+?pp1 x,<t>,%?po,%?adj,,%?PLMPrevParm,%(?PLMPrevParm-1)
+endif
+endm
+.cref
+else
+??error <parm(s) "&n" declared outside proc def>
+endif
+endm
+?pp1 macro n,t,o,a,b,cpc,ppc
+ife ?PLM
+n equ (t ptr [bp+b])
+else
+.xcref
+.xcref ?PLMParm&cpc
+.cref
+?PLMParm&cpc &macro po
+uconcat <n>,,<equ>,,<(t ptr [bp+>,%(a+po-o),<])>
+?PLMParm&ppc po
+purge ?PLMParm&cpc
+&endm
+endif
+endm
+ifndef ?NOPARMR
+if ?pmd
+parmR macro n,r,r2
+??error <Sorry: ParmR can't be used with PMODE=1>
+endm
+else
+.xcref
+.xcref ?pr,parmR
+.cref
+parmR macro n,r,r2
+?pr n,r,r2,%?rp,%(?ia+2)
+endm
+?pr macro n,r,r2,i,o
+.xcref
+ifnb <r2>
+parmR seg_&n,r
+parmR off_&n,r2
+n equ (dword ptr [bp-o-2])
+.xcref ?t&n
+?t&n=4
+else
+.xcref ?rp&i
+?rp&i=0
+ifdef ?&r
+?rp&i=?&r
+endif
+if ??? or (?cpd eq 0) or (?rp&i eq 0)
+??error <invalid parmR encountered: &n,&r>
+exitm
+endif
+n equ (word ptr [bp-o])
+?t&n=2
+irp x,<bh,ch,dh,bl,cl,dl,ah,al>
+if ?&&x eq ?&r
+n equ (byte ptr [bp-o])
+?t&n=1
+exitm
+endif
+endm
+?ia=?ia+2
+?rp=?rp+1
+endif
+.cref
+endm
+endif
+endif
+.xcref
+.xcref localB,localW,localD,localQ,localT,localCP,localDP,localV
+.cref
+localB macro n
+?aloc <n>,<byte ptr>,1,1,0
+endm
+localW macro n
+?aloc <n>,<word ptr>,2,2,1
+endm
+localD macro n
+irp x,<n>
+?aloc <seg_&&x>,<word ptr>,2,2,1
+?aloc <off_&&x>,<word ptr>,2,2,1
+?aloc <&&x>,<dword ptr>,0,4,1
+endm
+endm
+localQ macro n
+?aloc <n>,<qword ptr>,8,8,1
+endm
+localT macro n
+?aloc <n>,<tbyte ptr>,10,10,1
+endm
+if sizec
+localCP macro n
+localD <n>
+endm
+else
+localCP macro n
+localW <n>
+endm
+endif
+if sized
+localDP macro n
+localD <n>
+endm
+else
+localDP macro n
+localW <n>
+endm
+endif
+localV macro n,a
+?aloc <n>,,%(a),0,1
+endm
+?aloc macro n,t,l,s,a
+if ?cpd
+.xcref
+irp x,<n>
+???=???+l
+if a
+???=((??? + 1) and 0fffeh)
+endif
+?al1 x,<t>,%(???+?ia)
+.xcref ?t&&x
+?t&&x=s
+endm
+.cref
+else
+??error <locals "&n" declared outside procedure def>
+endif
+endm
+?al1 macro n,t,o
+n equ (t [bp-o])
+endm
+?gcc macro s,i,cc
+s = i
+ifnb <cc>
+ifidn <cc>,<C>
+s=0
+endif
+ifidn <cc>,<PLM>
+s=1
+endif
+ifidn <cc>,<PASCAL>
+s=1
+endif
+endif
+endm
+ifndef ?NOGLOBAL
+.xcref
+.xcref globalB,globalW,globalD,globalQ,globalT,globalCP,globalDP
+.cref
+globalB macro n,i,s,c
+?ad <n>,1
+?dd n,1,<byte>,<db>,<i>,<s>,<c>
+endm
+globalW macro n,i,s,c
+?ad <n>,2
+?dd n,1,<word>,<dw>,<i>,<s>,<c>
+endm
+globalD macro n,i,s,c
+?ad <n>,4
+?dd n,1,<dword>,<dd>,<i>,<s>,<c>
+off_&n equ n
+seg_&n equ n[2]
+endm
+globalQ macro n,i,s,c
+?ad <n>,8
+?dd n,1,<qword>,<dq>,<i>,<s>,<c>
+endm
+globalT macro n,i,s,c
+?ad <n>,10
+?dd n,1,<tbyte>,<dt>,<i>,<s>,<c>
+endm
+if sizec
+globalCP macro n,i,s,c
+globalD n,<i>,<s>,<c>
+endm
+else
+globalCP macro n,i,s,c
+globalW n,<i>,<s>,<c>
+endm
+endif
+if sized
+globalDP macro n,i,s,c
+globalD n,<i>,<s>,<c>
+endm
+else
+globalDP macro n,i,s,c
+globalW n,<i>,<s>,<c>
+endm
+endif
+endif
+ifndef ?NOSTATIC
+.xcref
+.xcref staticB,staticW,staticD,staticQ,staticT,staticCP,staticDP
+.cref
+staticB macro n,i,s
+?ad <n>,1
+?dd n,0,<byte>,<db>,<i>,<s>,<PLM>
+endm
+staticW macro n,i,s
+?ad <n>,2
+?dd n,0,<word>,<dw>,<i>,<s>,<PLM>
+endm
+staticD macro n,i,s
+?ad <n>,4
+?dd n,0,<dword>,<dd>,<i>,<s>,<PLM>
+endm
+staticQ macro n,i,s
+?ad <n>,8
+?dd n,0,<qword>,<dq>,<i>,<s>,<PLM>
+endm
+staticT macro n,i,s
+?ad <n>,10
+?dd n,0,<tbyte>,<dt>,<i>,<s>,<PLM>
+endm
+if sizec
+staticCP macro n,i,s
+staticD n,<i>,<s>
+endm
+else
+staticCP macro n,i,s
+staticW n,<i>,<s>
+endm
+endif
+if sized
+staticDP macro n,i,s
+staticD n,<i>,<s>
+endm
+else
+staticDP macro n,i,s
+staticW n,<i>,<s>
+endm
+endif
+endif
+?dd macro n,p,t,d,i,s,c
+?gcc ?dd2,%?PLM,<c>
+ife ?dd2
+n label t
+?dd1 _&n,p,<d>,<i>,<s>
+else
+?dd1 n,p,<d>,<i>,<s>
+endif
+endm
+?dd1 macro n,p,d,i,s
+if p
+public n
+endif
+ifb <s>
+n d i
+else
+ifb <i>
+n d s dup (?)
+else
+n d s dup (i)
+endif
+endif
+endm
+ifndef ?NOEXTERN
+.xcref
+.xcref ?ex1,?ex2,externB,externW,externD,externQ,externT
+.xcref externNP,externFP,externP,externCP,externDP,externA
+.cref
+?ex2 = 0
+externA macro n,c
+?ex1 <n>,40h,<abs>,<c>,<>
+endm
+externB macro n,c
+?ex1 <n>,1,<byte>,<c>,<>
+endm
+externW macro n,c
+?ex1 <n>,2,<word>,<c>,<>
+endm
+externD macro n,c
+?ex1 <n>,4,<dword>,<c>,<>
+endm
+externQ macro n,c
+?ex1 <n>,8,<qword>,<c>,<>
+endm
+externT macro n,c
+?ex1 <n>,10,<tbyte>,<c>,<>
+endm
+externNP macro n,c
+?ex1 <n>,2,<near>,<c>,<cc>
+endm
+externFP macro n,c
+?ex1 <n>,4,<far>,<c>,<cc>
+endm
+if sizec
+externP macro n,c
+?ex1 <n>,4,<far>,<c>,<cc>
+endm
+else
+externP macro n,c
+?ex1 <n>,2,<near>,<c>,<cc>
+endm
+endif
+if sizec
+externCP macro n,c
+?ex1 <n>,4,<dword>,<c>,<>
+endm
+else
+externCP macro n,c
+?ex1 <n>,2,<word>,<c>,<>
+endm
+endif
+if sized
+externDP macro n,c
+?ex1 <n>,4,<dword>,<c>,<>
+endm
+else
+externDP macro n,c
+?ex1 <n>,2,<word>,<c>,<>
+endm
+endif
+?ex1 macro n,s,d,c,scv
+?gcc ?ex2,%?PLM,<c>
+irp x,<n>
+.xcref
+.xcref ?t&&x
+.cref
+?t&&x=s
+ife ?ex2
+extrn _&&x:&d
+x equ _&&x
+else
+extrn x:&d
+endif
+ifidn <scv>,<cc>
+.xcref
+.xcref ?CC&&x
+.cref
+?CC&&x=?ex2
+endif
+endm
+endm
+endif
+ifndef ?NOLABEL
+.xcref
+.xcref ?lb1,?lblpu,?lb2
+.xcref labelB,labelW,labelD,labelQ,labelT
+.xcref labelNP,labelFP,labelP,labelCP,labelDP
+.cref
+?lblpu = 0
+?lb2 = 0
+labelB macro n,c
+?lb1 <n>,1,<byte>,<c>
+endm
+labelW macro n,c
+?lb1 <n>,2,<word>,<c>
+endm
+labelD macro n,c
+?lb1 <n>,4,<dword>,<c>
+endm
+labelQ macro n,c
+?lb1 <n>,8,<qword>,<c>
+endm
+labelT macro n,c
+?lb1 <n>,10,<tbyte>,<c>
+endm
+labelNP macro n,c
+?lb1 <n>,2,<near>,<c>
+endm
+labelFP macro n,c
+?lb1 <n>,4,<far>,<c>
+endm
+if sizec
+labelP macro n,c
+?lb1 <n>,4,<far>,<c>
+endm
+else
+labelP macro n,c
+?lb1 <n>,2,<near>,<c>
+endm
+endif
+if sizec
+labelCP macro n,c
+?lb1 <n>,4,<dword>,<c>
+endm
+else
+labelCP macro n,c
+?lb1 <n>,2,<word>,<c>
+endm
+endif
+if sized
+labelDP macro n,c
+?lb1 <n>,4,<dword>,<c>
+endm
+else
+labelDP macro n,c
+?lb1 <n>,2,<word>,<c>
+endm
+endif
+?lb1 macro n,s,d,c
+?gcc ?lb2,%?PLM,<c>
+?lblpu=0
+irp x,<n>
+ifidn <x>,<PUBLIC>
+?lblpu=1
+else
+.xcref
+.xcref ?t&&x
+.cref
+?t&&x=s
+ife ?lb2
+if ?lblpu
+public _&&x
+endif
+_&&x label &d
+x equ _&&x
+else
+if ?lblpu
+public x
+endif
+x label &d
+endif
+endif
+endm
+endm
+endif
+ifndef ?NODEF
+.xcref
+.xcref defB,defW,defD,defQ,defT,defCP,defDP
+.cref
+defB macro n
+?ad <n>,1
+endm
+defW macro n
+?ad <n>,2
+endm
+defD macro n
+?ad <n>,4
+endm
+defQ macro n
+?ad <n>,8
+endm
+defT macro n
+?ad <n>,10
+endm
+if sizec
+defCP macro n
+defD <n>
+endm
+else
+defCP macro n
+defW <n>
+endm
+endif
+if sized
+defDP macro n
+defD <n>
+endm
+else
+defDP macro n
+defW <n>
+endm
+endif
+endif
+?ad macro n,s
+irp x,<n>
+.xcref
+.xcref ?t&&x
+.cref
+?t&&x=s
+endm
+endm
+ifndef ?NOPTR
+.xcref
+.xcref regPtr,farPtr
+.cref
+regPtr macro n,s,o
+farPtr n,s,o
+endm
+farPtr macro n,s,o
+.xcref
+.xcref ?t&n
+.cref
+n &macro
+ push s
+ push o
+&endm
+?t&n=80h
+endm
+endif
+arg macro a
+irp x,<a>
+?argc=?argc+1
+?atal <x>,%?argc
+endm
+endm
+?atal macro n,i
+.xcref
+.xcref ?ali&i
+.cref
+?ali&i &macro
+?ap n
+&endm
+endm
+?ap macro n
+?argl=?argl+2
+ifdef ?t&n
+ife ?t&n-1
+ push word ptr (n)
+exitm
+endif
+ife ?t&n-2
+ push n
+exitm
+endif
+ife ?t&n-4
+ push word ptr (n)[2]
+ push word ptr (n)
+?argl=?argl+2
+exitm
+endif
+ife ?t&n-8
+ push word ptr (n)[6]
+ push word ptr (n)[4]
+ push word ptr (n)[2]
+ push word ptr (n)
+?argl=?argl+6
+exitm
+endif
+if ?t&n and 80h
+n
+?argl=?argl+2
+exitm
+endif
+ife ?t&n
+ push word ptr (n)
+exitm
+endif
+endif
+ push n
+endm
+cCall macro n,a,c
+ifnb <a>
+arg <a>
+endif
+mpush %?rsl
+ifdef ?CC&n
+?cCall1=?CC&n
+else
+?cCall1=?PLM
+endif
+ifnb <c>
+?gcc ?cCall1,%?cCall1,<c>
+endif
+?argl=0
+ife ?cCall1
+?acb=?argc
+else
+?acb=1
+endif
+rept ?argc
+uconcat <?ali>,%?acb
+uconcat <purge>,,<?ali>,%?acb
+ife ?cCall1
+?acb=?acb-1
+else
+?acb=?acb+1
+endif
+endm
+ call n
+if ((?cCall1 eq 0) and (?argl ne 0))
+ add sp,?argl
+endif
+mpop %?rsl
+?rsl=0
+?argc= 0
+?argl= 0
+endm
+cProc macro n,cf,a
+if ?cpd
+?utpe
+endif
+?cpd=1
+???=0
+?argc=0
+?ba=0
+?po=0
+?pu=0
+?ia=0
+?adj=4
+?rp=0
+?uf=0
+?wfp=?WIN
+?ff=0
+?pas=0
+?pcc=?PLM
+?lds=0
+?exp=0
+ifnb <a>
+?ri ?pas,<a>
+endif
+?pc=sizec
+?nd=?nodata1
+?nx=0
+irp x,<cf>
+ifidn <x>,<FAR>
+?pc=1
+endif
+ifidn <x>,<NEAR>
+?pc=0
+endif
+ifidn <x>,<PUBLIC>
+?pu=1
+endif
+ifidn <x>,<SMALL>
+?uf=1
+endif
+ifidn <x>,<DATA>
+?nd=0
+endif
+ifidn <x>,<NODATA>
+?nd=1
+endif
+ifidn <x>,<ATOMIC>
+?nx=1
+endif
+ifidn <x>,<C>
+?pcc=0
+endif
+ifidn <x>,<PLM>
+?pcc=1
+endif
+ifidn <x>,<PASCAL>
+?pcc=1
+endif
+ifidn <x>,<WIN>
+?wfp=1
+endif
+ifidn <x>,<NONWIN>
+?wfp=0
+endif
+ifidn <x>,<LOADDS>
+?lds=1
+endif
+ifidn <x>,<EXPORTED>
+?exp=1
+endif
+endm
+if ?pcc
+?PLMPrevParm=0
+.xcref
+.xcref ?PLMParm0
+.cref
+?PLMParm0 &macro
+purge ?PLMParm0
+&endm
+endif
+.xcref
+.xcref ?CC&n
+.cref
+?CC&n=?pcc
+if (?nx eq 1) and (?nd eq 0)
+?nx = 0
+??error <ATOMIC specified without NODATA - ATOMIC ignored>
+endif
+if ?pc
+if ?wfp+?exp+?lds
+ife ?nx
+ife ?pmd
+?ia=2
+endif
+?pas = ?pas and (not ?ds)
+endif
+endif
+?adj=?adj+2
+else
+?wfp=0
+endif
+ife ?386regs
+?pas = ?pas and (not (?sp+?cs+?ss))
+endif
+if ?uf
+if ?386regs
+?pas = ?pas and (not (?si+?di))
+else
+?pas = ?pas and (not (?bp+?si+?di))
+endif
+endif
+ife ?pcc
+?pg <_&n>,%?pu,%?pc,%?pas,%?wfp,<n>,%?pcc
+else
+?pg <n>,%?pu,%?pc,%?pas,%?wfp,<n>,%?pcc
+endif
+endm
+?pg macro n,p,c,a,w,nnu,cc
+.xcref
+if ?uf
+if ?nd
+??error <NODATA encountered in &n - user frame ignored>
+?uf=0
+endif
+endif
+.xcref cBegin
+cBegin &macro g
+.xcref
+if cc
+uconcat <?PLMParm>,%?PLMPrevParm,%?po
+endif
+if ?uf
+if ?rp
+??error <parmR encountered in &n - user frame ignored>
+?uf=0
+endif
+endif
+?pg1 <n>,c,a,%?po,w,%?uf,%?nd,%?rp,cc
+?cpd=0
+?argc=0
+?ba=1
+???=(???+1) and 0fffeh
+if p
+public n
+endif
+ife c
+n proc near
+else
+n proc far
+endif
+ife cc
+nnu equ n
+endif
+ifidn <g>,<nogen>
+if ???+?po+a+?rp
+??_out <cBegin - possible invalid use of nogen>
+endif
+else
+if ?uf
+?mf c,%???,%?po
+mpush a
+else
+if w+?exp+?lds
+if ?pmd
+ife ?nd
+if ?lds
+mov ax,_DATA
+else
+if ?exp
+mov ax,ds
+nop
+endif
+endif
+endif
+ife ?nx
+if ???+?po
+if ?chkstk1
+push bp
+mov bp,sp
+else
+if ???
+enter ???,0
+else
+push bp
+mov bp,sp
+endif
+endif
+endif
+push ds
+if ?lds+?exp
+mov ds,ax
+endif
+else
+if ?ff+???+?po+?rp
+ push bp
+ mov bp,sp
+endif
+endif
+else
+ife ?nd
+ mov ax,ds
+ nop
+endif
+ife ?nx
+ife ?DOS5
+ inc bp
+endif
+ push bp
+ mov bp,sp
+ push ds
+else
+if ?ff+???+?po+?rp
+ push bp
+ mov bp,sp
+endif
+endif
+ife ?nd
+ mov ds,ax
+endif
+endif
+else
+if ?pmd
+if ?exp
+mov ax,ds
+nop
+else
+if ?lds
+mov ax,_DATA
+endif
+endif
+if ?ff+???+?po+?rp
+if ?chkstk1
+push bp
+mov bp,sp
+else
+if ???
+enter ???,0
+else
+push bp
+mov bp,sp
+endif
+endif
+endif
+if ?exp+?lds
+push ds
+mov ds,ax
+endif
+else
+if ?ff+???+?po+?rp
+ push bp
+ mov bp,sp
+endif
+endif
+endif
+if ?rp
+?uf=0
+rept ?rp
+uconcat mpush,,?rp,%?uf
+?uf=?uf+1
+endm
+endif
+if ???
+if ?chkstk1
+ifdef ?CHKSTKPROC
+?CHKSTKPROC %???
+else
+ mov ax,???
+ife cc
+ call _chkstk
+else
+ call chkstk
+endif
+endif
+else
+ife ?pmd
+ sub sp,???
+endif
+endif
+endif
+mpush a
+endif
+ifdef ?PROFILE
+if c
+ call StartNMeas
+endif
+endif
+endif
+.cref
+purge cBegin
+&endm
+.xcref ?utpe
+?utpe &macro
+??error <unterminated procedure definition: "&n">
+&endm
+.cref
+endm
+?pg1 macro n,c,a,o,w,f,d,r,cc
+.xcref
+.xcref cEnd
+cEnd &macro g
+.xcref
+?ba=0
+ifidn <g>,<nogen>
+if o+a+r
+??_out <cEnd - possible invalid use of nogen>
+endif
+else
+ifdef ?PROFILE
+if c
+call StopNMeas
+endif
+endif
+mpop a
+if f
+ db 0c3h
+else
+if w+?exp+?lds
+if ?pmd
+ife ?nx
+pop ds
+endif
+ife ?nx
+if ?chkstk1+???+?po
+leave
+endif
+else
+if ?ff+???+?po+?rp
+leave
+endif
+endif
+else
+ife ?nx
+if (?TF eq 0) or (???+?rp)
+ lea sp,-2[bp]
+endif
+ pop ds
+ pop bp
+ife ?DOS5
+ dec bp
+endif
+else
+if (?TF eq 0) or (???+?rp)
+ mov sp,bp
+endif
+if ???+?po+?rp
+ pop bp
+endif
+endif
+endif
+else
+if ?pmd
+if ?ff+???+?po+?rp
+leave
+endif
+else
+if ?ff+???+?po+?rp
+if (?TF eq 0) or (???+?rp)
+ mov sp,bp
+endif
+ pop bp
+endif
+endif
+endif
+ife cc
+ ret
+else
+ ret o
+endif
+endif
+endif
+n endp
+.cref
+purge cEnd
+&endm
+.cref
+endm
+assumes macro s,ln
+ifndef ln&_assumes
+assume s:ln
+else
+ln&_assumes s
+endif
+endm
+createSeg macro n,ln,a,co,cl,grp
+ifnb <grp>
+addseg grp,n
+else
+ln&OFFSET equ offset n:
+ln&BASE equ n
+?cs3 <ln>,<n>
+endif
+ifnb <cl>
+n segment a co '&cl'
+else
+n segment a co
+endif
+n ends
+?cs1 <ln>,<n>
+endm
+addseg macro grp,seg
+.xcref
+.xcref grp&_def
+.cref
+ifndef grp&_def
+grp&_def=0
+endif
+if grp&_def ne ASMpass
+.xcref
+.xcref grp&_add
+.cref
+grp&_add &macro s
+grp&_in <seg>,s
+&endm
+.xcref
+.xcref grp&_in
+.cref
+grp&_in &macro sl,s
+ifb <s>
+grp group sl
+else
+grp&_add &macro ns
+grp&_in <sl,s>,ns
+&endm
+endif
+&endm
+grp&_def=ASMpass
+else
+grp&_add seg
+endif
+endm
+defgrp macro grp,ln
+addseg grp
+ifnb <ln>
+irp x,<ln>
+?cs3 <&x>,<grp>
+x&&OFFSET equ offset grp:
+x&&BASE equ grp
+endm
+endif
+endm
+?cs1 macro ln,n
+.xcref
+.xcref ln&_sbegin
+.cref
+ln&_sbegin &macro
+.xcref
+.xcref ?mf
+.cref
+?mf &&macro c,l,p
+if c
+ extrn n&_FARFRAME:near
+ call n&_FARFRAME
+else
+ extrn n&_NEARFRAME:near
+ call n&_NEARFRAME
+endif
+ db l shr 1
+ db p shr 1
+&&endm
+?cs2 <ln>,<n>
+n segment
+&endm
+endm
+?cs2 macro ln,n
+.xcref
+.xcref sEnd
+.cref
+sEnd &macro
+n ends
+purge ?mf
+purge sEnd
+&endm
+endm
+?cs3 macro ln,n
+.xcref
+.xcref ln&_assumes
+.cref
+ln&_assumes &macro s
+assume s:&n
+&endm
+endm
+.xcref
+.xcref sBegin
+.cref
+sBegin macro ln
+ln&_sbegin
+endm
+ife ?DF
+createSeg _TEXT,Code,word,public,CODE
+ife ?nodata1
+createSeg _DATA,Data,word,public,DATA,DGROUP
+defgrp DGROUP,Data
+endif
+if ?chkstk1
+ifndef ?CHKSTKPROC
+externp <chkstk>
+endif
+endif
+endif
+errnz macro x
+if2
+if x
+errnz1 <x>,%(x)
+endif
+endif
+endm
+errnz1 macro x1,x2
+= *errnz* x1 = x2
+.err
+endm
+errn$ macro l,x
+errnz <offset $ - offset l x>
+endm
+ifdef ?PROFILE
+externFP <StartNMeas,StopNMeas>
+endif
diff --git a/private/mvdm/wow16/inc/cmacros.mas b/private/mvdm/wow16/inc/cmacros.mas
new file mode 100644
index 000000000..17b024775
--- /dev/null
+++ b/private/mvdm/wow16/inc/cmacros.mas
@@ -0,0 +1,2666 @@
+comment $
+
+cmacros - assembly macros for interfacing to hlls
+
+(C)Copyright Microsoft Corp. 1984-1988
+
+$
+
+;; Revision History
+;;
+;; 1.00 05/03/84 Initial Release
+;;
+;; 1.01 05/06/84 Greg Whitten
+;; Added defgrp and changed cMerge to Microsoft C
+;; Added copyright message and changed to 1.01
+;; Changes should have no affect on working programs
+;;
+;; 1.02 07/10/84 Steve Wood
+;; Added labelx macros
+;;
+;; 1.03 07/14/84 Greg Whitten
+;; Added defines for ?pu, ?adj, ?lblpu
+;; (removes undefined errors)
+;; Changes should have no affect on working programs
+;;
+;; 1.04 07/18/84 Greg Whitten
+;; Added local control from PL/M or C conventions
+;; except for cCall macro
+;;
+;; 1.05 08/06/84 Steve Wood
+;; Made ?PLM and ?WIN be the defaults
+;;
+;; 1.06 01/02/85 Steve Wood
+;; Changed createSeg and defgrp to automatically
+;; define the ln_assumes macro and the lnoffset
+;; and lnbase equates for each logical segment
+;; name.
+;;
+;; 1.07 02/19/85 Walt Moore
+;; Added farptr macro for defining a far pointer
+;; to be used in a cCall. Folded regptr into
+;; farptr. Space compaction in macros. Changed
+;; ?pp to be smaller. Moved ?ia out of ?al1 into
+;; ?aloc. Merged cProc and ?pd into one macro.
+;; Changed some %outs to use the error macro so
+;; an error would be generated. Added makeframe
+;; and parmR to cProc. Changed error to also put
+;; the error message in the listing.
+;; Deleted the smashes macro.
+;;
+;; 1.08 03/18/85 Steve Wood
+;; Added NODATA support.
+;;
+;; 1.09 03/27/85 Steve Wood
+;; Added ?definitions
+;;
+;; 2.00 04/01/85 Steve Wood
+;; April fools
+;;
+;; 2.01 06/17/85 Steve Wood
+;; Changed NODATA to always generate POP DS
+;; for return address patching
+;;
+;; 2.02 02/11/86 Steve Wood
+;; Added ATOMIC keyword to cProc macro
+;; Changed far epilog to use LEA SP,BP-2
+;; Changed error macro to ??error to avoid
+;; conflict
+;;
+;; 2.03 03/06/86 Steve Wood
+;; Fixed bug with ATOMIC and locals in far proc
+;; Added DOS5 switch to disable INC/DEC BP
+;; instructions in special far prologs/epilogs
+;;
+;; 2.04 08/07/86 Scott Randell
+;; Fixed bug with ATOMIC and ?TF
+;; (was doing unnecessary MOV SP,BP)
+;; Added pcode profile ?PROFILE
+;;
+;; 2.05 08/12/86 Walt Moore
+;; Changed _TEXT alignment to word.
+;; Added/corrected some comments.
+;; Removed redundant init of ?pc in cProc
+;; Made ATOMIC require NODATA
+;; Moved definition of non-underscored 'C' label
+;; from the cProc to the cBegin macro
+;; Minor clean-up of code
+;;
+;; 2.06 09/11/86 Walt Moore
+;; Added private stack checking
+;; Put local control for PL/M or C into cCall
+;;
+;;
+;; 2.07 09/19/86 Steve Wood
+;; Added ?SMALL, ?MEDIUM, etc. symbols
+;; Added forceframe keyword to cProc macro.
+;; Interpret ?TF for all epilogs.
+;;
+;; 3.xx.a 02/26/87 Massive rework. Documentation coming.
+;;
+;;
+;; Assembly macros for interfacing to C
+;;
+;; User setable conditional assembly flags used within the cmacros
+;;
+;; Memory model flags. Set only one of the following. memS is the
+;; default. The symbols with ? are for defining from the command line
+;; and the memx symbols are numeric symbols that can be set in your source
+;; file prior to including this file.
+;;
+;; ?SMALL memS - small model
+;; ?MEDIUM memM - medium model
+;; ?LARGE memL - large model
+;; ?COMPACT memC - compact model
+;; ?HUGE memH - huge model
+;;
+;; ?DF Define flag. If this flag is 0, then defines default segment
+;; and group definitions based on the compiler flag. If this
+;; flag is 1, then does not define any segments or groups.
+;;
+;; ?TF Tight flag. If this flag is 0, then use longer epilog
+;; sequence that safely cleans up a stack frame. If this flag is
+;; 1, then use more efficient epilog that assumes the stack is
+;; valid (SP)
+;;
+;; ?WIN Windows flag. Enables generation of special prolog/epilog
+;; for far procedures. Default value is 1 (Windows).
+;;
+;; DOS5 If defined, then special far prolog/epilog seqeuences will not
+;; include the INC/DEC BP instructions.
+;;
+;; PMODE Protect mode flag. Enables use of ENTER/LEAVE, disables
+;; INC/DEC BP instructions, sets .286p.
+;;
+;; ?386regs Enables use of eax,ebx,ecx,esi,edi,fs,gs as registers
+;; in cProc et al. Use of al,ah,bl,bh,cl,ch,dl,dh,ss,bp,sp,ss,cs
+;; no longer allowed.
+;;
+;; ?PLM Calling convention flag. If this flag is 0, then the
+;; calling convention used is that of C. If this flag
+;; is 1, then the PL/M calling convention is used.
+;; The default value is 1. The PL/M calling convention
+;; is used by pascal, fortran, basic, and cobol.
+;;
+;; In the C calling convention, arguments are passed
+;; in reverse order; arg0 is the last pushed, argn is the
+;; first pushed. also, it is the callers responsibility
+;; to remove the arguments from the stack upon a return
+;; from a call.
+;;
+;; In the PL/M calling comvention, arguments are passed
+;; as encountered; arg0 is the first pushed, argn is the
+;; last pushed. also, it is the called procedure's
+;; responsibility to remove parameters from the stack
+;; before returning (using the RET n instruction)
+;;
+;; ?NODATA If defined, then no data segment or DGROUP is defined and
+;; the special prolog/epilog sequences will not contain the
+;; code needed to setup DS.
+;;
+;; ?CHKSTK If defined, then prolog sequences for cProcs with local
+;; parameters will call the CHKSTK procedure to allocate
+;; the stack space.
+;;
+;; ?CHKSTKPROC If defined, then this macro will be invoked to
+;; perform the stack checking, otherwise the
+;; standard stack checking procedure will be
+;; performed. ?CHKSTKPROC must be declared
+;; before the cmacros are included in the source
+;; else the standard chkstk routine will be declared
+;; as an external symbol.
+;;
+;; On entry to the user's stack checking procedure,
+;; the frame has been setup except for allocating
+;; local variable space and saving autosave registers.
+;;
+;; The user supplied macro is passed as an argument
+;; the number of byte of stack space requested.
+;;
+;; ?PROFILE If defined then all far cBegin entries will have StartNMeas,
+;; and all cEnd will have StopNMeas calls, StartNMeas and
+;; StopNMeas will be defined as externfp
+;;
+;; ?NOPARMR If defined, then the "parmR" macro will not be defined.
+;;
+;; ?NOGLOBAL If defined, then the "globalx" macros will not be defined.
+;;
+;; ?NOSTATIC If defined, then the "staticx" macros will not be defined.
+;;
+;; ?NOEXTERN If defined, then the "externx" macros will not be defined.
+;;
+;; ?NOLABEL If defined, then the "labelx" macros will not be defined.
+;;
+;; ?NODEF If defined, then the "defx" macros will not be defined.
+;;
+;; ?NOPTR If defined, then "farptr & regptr" will not be defined.
+;;
+;; ?QUIET If defined, then only error messages will be issued to
+;; the console. If undefined, then certain cmacro text will
+;; be generated to the console.
+
+
+.xcref ;;Get rid of a lot of symbols
+
+
+
+; ??_out - output given message to the console unless ?QUIET has
+; been specified.
+;
+; usage:
+; ??_out <t>
+;
+; where:
+; <t> is the message to output
+
+.xcref ??_out
+??_out macro t
+ ifndef ?QUIET
+ %out t
+ endif
+endm
+
+
+
+; outif - output msg if name is non-zero. if name is undefined,
+; set name = 0, else set name to the default value.
+;
+; usage:
+; outif name,defval,onmsg,offmsg
+; where:
+; name name of symbol
+; defval default value to give symbol if not defined
+; if blank, then 0 will be used
+; onmsg text to display if symbol is non-zero
+; offmsg test to be displayed if symbol is zero
+
+
+outif macro name,defval,onmsg,offmsg
+ ifndef name
+ ifb <defval>
+ name=0
+ else
+ name=defval
+ endif
+ endif
+ if name
+ name=1
+ ifnb <onmsg>
+ ??_out <! onmsg>
+ endif
+ else
+ ifnb <offmsg>
+ ??_out <! offmsg>
+ endif
+ endif
+endm
+
+
+
+; ??error - output msg and generate an assembly time error
+;
+; usage:
+; ??error <t>
+; where:
+; t is the text to be output
+
+
+.xcref ??error
+??error macro msg
+ e r r o r ----- msg ;;to console
+ .err ;;for good measure, force this also
+endm
+
+
+.xcref ASMpass
+.xcref memS,memM,memL,memC,memH,memMOD,sizec,sized
+
+if1 ;;Only on pass 1
+ ASMpass=1
+ ifdef ?SMALL ;;inform user what is going on
+ memS=1
+ endif
+ ifdef ?MEDIUM
+ memM=1
+ endif
+ ifdef ?COMPACT
+ memC=1
+ endif
+ ifdef ?LARGE
+ memL=1
+ endif
+ ifdef ?HUGE
+ memH=1
+ endif
+
+ ??_out <cMacros Version 5.20 - Copyright (c) Microsoft Corp. 1984-1988>
+ outif memS,0,<Small model>
+ outif memM,0,<Medium model>
+ outif memL,0,<Large model>
+ outif memC,0,<Compact model>
+ outif memH,0,<Huge model>
+
+ memMOD= memS + memM + memL + memC + memH
+ if memMOD ne 1
+ if memMOD eq 0
+ memS = 1 ; assume small model
+ else
+ ??error <more than 1 memory model selected>
+ endif
+ endif
+
+ sizec= memM + memL + memH ; large code
+ sized= memL + memC + (memH*2) ; large data (2 if huge)
+
+ outif ?DF,0,<No segments or groups will be defined>
+ outif ?TF,0,<Epilog sequences assume valid SP>
+ outif ?WIN,1,<Windows support>
+
+ ifdef PMODE
+ ?pmd=1
+ ??_out <! 286 protect mode>
+ else
+ ?pmd=0
+ endif
+
+ ifdef ?386regs
+ if ?386regs
+ ??_out <! 386 registers enabled>
+ endif
+ else
+ ?386regs=0
+ endif
+
+ if ?WIN eq 1
+ outif ?PLM,1,<>
+ else
+ outif ?PLM,1,<Pascal calling convention>
+ endif
+
+ ifndef ?NODATA
+ ?nodata1=0
+ else
+ ?nodata1=1
+ ??_out <! NODATA module>
+ endif
+
+ ifndef ?CHKSTK
+ ?chkstk1=0
+ else
+ ?chkstk1=1
+ ifdef ?CHKSTKPROC
+ ??_out <! Private stack checking enabled>
+ else
+ ??_out <! Stack checking enabled>
+ endif
+ endif
+
+ ifndef DOS5
+ ?DOS5=0
+ else
+ ?DOS5=1
+ ??_out <! DOS5 module>
+ endif
+
+ ifdef ?PROFILE
+ ??_out <! Native profiling enabled>
+ endif
+else
+ ASMpass=2
+endif
+
+ ifdef ?pmd
+ .286p
+ endif
+
+;; Initialize all symbols used in the macros. Theses symbols will not be
+;; included in any cross reference listing.
+
+if ?386regs
+ .xcref ?n,?ax,?eax,?bx,?ebx
+ .xcref ?cx,?ecx,?dx,?edx
+ .xcref ?si,?esi,?di,?edi,?es,?ds,?fs
+ .xcref ?gs
+else
+ .xcref ?n,?ax,?ah,?al,?bx,?bh
+ .xcref ?bl,?cx,?ch,?cl,?dx,?dh
+ .xcref ?dl,?si,?di,?es,?ds,?bp
+ .xcref ?sp,?ss,?cs
+endif
+ .xcref ?rsl,?cpd,?argl,?argc,?ba
+ .xcref ?acb,???,?po
+ .xcref ?pas,?pc
+
+ .xcref uconcat,mpush,mpop
+ .xcref ?ri,?pp,?pp1,?al1
+ .xcref ?ad,?ap,?atal,?dd,?dd1,?dd2
+ .xcref ?pg,?pg1,?aloc,?cs1,?cs2
+ .xcref ?DF,?TF,?ff,?PLM,?WIN,?ia,?pu,?adj
+ .xcref ?uf,?rp,?nx,?nd,?nodata1,?chkstk1,?DOS5,?pmd,?lds,?exp
+ .xcref ?wfp,arg,cCall,cProc,assumes,?cs3,?cs2,?cs1
+ .xcref defgrp,addseg,createSeg
+ .xcref save,outif,errnz,errn$,errnz1
+ .xcref ?PLMPrevParm,?gcc
+ .xcref ?cCall1,?pcc
+
+
+;; conditionals set by the macros
+;;
+;; ?pc Procedure class. If this is set to 1, then the procedure
+;; is a far procedure, else it is a near procedure.
+;;
+;; ?ia Interface adjustment count for far procedures. The
+;; interface adjustment defines the number of bytes of
+;; storage allocated between BP and the first frame variable
+;; allocated on the stack.
+;;
+;; Normally zero, it will be adjusted for both far windows
+;; procedures and by register parameters.
+;;
+;; ?cpd Current procedure defined. This is set to a non-zero
+;; value if a procedure is being defined (i.e a cProc has
+;; been encountered, and cBegin has not).
+;;
+;; ?ba Begin active. This is set to a non-zero value if a
+;; cBegin is active (i.e. a cBegin has been encountered,
+;; and cEnd has not).
+;;
+;; ?wfp Windows far procedure. Set if a windows far procedure
+;;
+;; ?lds LOADDS keyword - Preserve DS and set DS to _DATA
+;;
+;; ?exp EXPORTED keyword - mov ax,ds/nop as first inst, preserve DS
+;;
+;; Other variables that are defined once so that the .xcref command
+;; doesn't get too upset if they show up missing!
+
+?rsl = 0 ;;0 = no register to save
+?cpd = 0 ;;<> 0 if in a procedure definition
+?argl = 0 ;;length of arguments pushed on stack
+?argc = 0 ;;# of arguments so far
+?ba = 0 ;;<>0 if in a procedure (xbegin)
+?acb = 0 ;;number of arguments to a call
+??? = 0 ;;byte count of local storage
+?po = 0 ;;byte count of parameters
+?pas = 0 ;;autosave value for procedure
+?pc = 0 ;;class of a procedure (near/far)
+?ia = 0 ;;no adjustment
+?pu = 0 ;;public flag for some macros
+?adj = 0 ;;initial define for .xcref
+?rp = 0 ;;count of register parameters
+?uf = 0 ;;user's frame code specified
+?nd = 0 ;;NODATA keyword specified
+?nx = 0 ;;ATOMIC keyword specified
+?wfp = 0 ;;window far procedure
+?lds = 0 ;;LOADDS keyword
+?exp = 0 ;;EXPORTED keyword
+?ff = 0 ;;forceframe keyword specified
+?dd2 = 0 ;;used for globalx and staticx
+?cCall1 = 0 ;;used for cCalls
+?pcc = 0 ;;procedure calling convention
+?PLMPrevParm = 0 ;;Used in parameter processing
+
+ .xcref ?casen
+if1 ;;only define ?casen on pass 1
+?casen = 0 ;;case sensitive assembly if <> 0
+endif
+
+if ?386regs
+?n = 0000000000000000b
+?ax = 0000000000000001b
+?eax = 0000000000000010b
+?bx = 0000000000000100b
+?ebx = 0000000000001000b
+?cx = 0000000000010000b
+?ecx = 0000000000100000b
+?dx = 0000000001000000b
+?edx = 0000000010000000b
+?si = 0000000100000000b
+?esi = 0000001000000000b
+?di = 0000010000000000b
+?edi = 0000100000000000b
+?ds = 0001000000000000b
+?es = 0010000000000000b
+?fs = 0100000000000000b
+?gs = 1000000000000000b
+else
+?n = 0000000000000000b ;;register none
+?ax = 0000000000000011b ;;register ax
+?ah = 0000000000000001b ;;register ah
+?al = 0000000000000010b ;;register al
+?bx = 0000000000001100b ;;register bx
+?bh = 0000000000000100b ;;register bh
+?bl = 0000000000001000b ;;register bl
+?cx = 0000000000110000b ;;register cx
+?ch = 0000000000010000b ;;register ch
+?cl = 0000000000100000b ;;register cl
+?dx = 0000000011000000b ;;register dx
+?dh = 0000000001000000b ;;register dh
+?dl = 0000000010000000b ;;register dl
+?si = 0000000100000000b ;;register si
+?di = 0000001000000000b ;;register di
+?es = 0000010000000000b ;;register es
+?ds = 0000100000000000b ;;register ds
+?bp = 0001000000000000b ;;register bp
+?sp = 0010000000000000b ;;register sp
+?ss = 0100000000000000b ;;register ss
+?cs = 1000000000000000b ;;register cs
+endif
+ .cref
+
+
+
+;; uconcat - unconditionally generate a statement from a field
+;; of given parameters
+;;
+;; usage:
+;; uconcat a,b,c,d,e,f,g
+;;
+;; where:
+;; a,b are concatenated for field 1
+;; c,d are concatenated for field 2
+;; e,f,g are concatenated for field 3
+
+uconcat macro a,b,c,d,e,f,g
+ a&b c&d e&f&g
+endm
+
+
+
+;; mpush pushes multiple registers onto the stack according to
+;; a register specification.
+;;
+;; format:
+;; mpush r
+;;
+;; where:
+;; r is a numeric expression returned from ?ri
+;; or any other valid register expression
+
+if ?386regs
+
+mpush macro r
+ irp x,<ax,eax,bx,ebx,cx,ecx,dx,edx,si,esi,di,edi,ds,es,fs,gs>
+ if (r and ?&&x)
+ push x ;@
+ endif
+ endm
+endm
+
+else
+
+mpush macro r
+ irp x,<ax,bx,cx,dx,si,di,es,ds,bp,sp,ss,cs>
+ if (r and ?&&x)
+ push x ;@
+ endif
+ endm
+endm
+
+endif
+
+;; mpop pops multiple registers from the stack according to
+;; a register specification.
+;;
+;; format:
+;; mpop r
+;;
+;; where:
+;; r is a numeric expression returned from ?ri
+;; or any other valid register expression
+
+if ?386regs
+
+mpop macro r
+ irp x,<gs,fs,es,ds,edi,di,esi,si,edx,dx,ecx,cx,ebx,bx,eax,ax>
+ if (r and ?&&x)
+ pop x ;@
+ endif
+ endm
+endm
+
+else
+
+mpop macro r
+ irp x,<cs,ss,sp,bp,ds,es,di,si,dx,cx,bx,ax>
+ if (r and ?&&x)
+ pop x ;@
+ endif
+ endm
+endm
+
+endif
+
+;; save - flag that the indicated registers are to be saved/restored
+;;
+;; A flag is created which indicates which registers are to be saved
+;; when the cCall macro is invoked, and then restored after the call.
+;;
+;; usage:
+;; save <r>
+;;
+;; where r is the list of registers to save, which may be:
+;;
+;; register saves
+;; AX AX
+;; AH AX
+;; AL AX
+;; BX BX
+;; BH BX
+;; BL BX
+;; CX CX
+;; CH CX
+;; CL CX
+;; DX DX
+;; DH DX
+;; DL DX
+;; SI SI
+;; DI DI
+;; ES ES
+;; DS DS
+;; BP BP
+;;
+;; none nothing
+;;
+;; the macro generates a value for the variable ?rsl
+
+save macro r
+ ?rsl=0 ;;initialize save list
+ ?ri ?rsl,<r> ;;generate magic number
+endm
+
+;; ?ri - or register indexes to variable
+;;
+;; ?ri is a macro that examines the passed argument list and computes
+;; a register index variable.
+;;
+;; The values ORed with the variable are:
+;;
+;; ?n equ 0000000000000000b;
+;; ?AX equ 0000000000000011b;
+;; ?AH equ 0000000000000001b;
+;; ?AL equ 0000000000000010b;
+;; ?BX equ 0000000000001100b;
+;; ?BH equ 0000000000000100b;
+;; ?BL equ 0000000000001000b;
+;; ?CX equ 0000000000110000b;
+;; ?CH equ 0000000000010000b;
+;; ?CL equ 0000000000100000b;
+;; ?DX equ 0000000011000000b;
+;; ?DH equ 0000000001000000b;
+;; ?DL equ 0000000010000000b;
+;; ?SI equ 0000000100000000b;
+;; ?DI equ 0000001000000000b;
+;; ?ES equ 0000010000000000b;
+;; ?DS equ 0000100000000000b;
+;; ?BP equ 0001000000000000b;
+;; ?SP equ 0010000000000000b;
+;; ?SS equ 0100000000000000b;
+;; ?CS equ 1000000000000000b;
+;; usage:
+;; ?ri n,<r>
+;; where:
+;; n is the variable to contain the new index value
+;; r is the register list
+
+?ri macro n,r
+ irp x,<r>
+ .ERRNDEF ?&&x ;; yell if register isn't defined
+ n=n or ?&&x
+ endm
+endm
+
+
+
+;; parmx - generate reference to parameter(s) on the stack
+;;
+;; An equate is generated for addressing a paramter(s)
+;; on the stack for the current procedural frame.
+;;
+;; An error message is generated if there isn't a current frame.
+;;
+;; usage:
+;; parmx n
+;; where:
+;; x is the type of the argument(s) b=byte, w=word, d=dword
+;; n is the name(s) to be given the parameter(s).
+;;
+;; Bytes are considered to be two bytes long for alignment.
+;;
+;; The parmd form of the macro generates three equates:
+;;
+;; name - for accessing the parameter as a double word
+;; off_name - for accessing the offset (lsw) of the parameter
+;; seg_name - for accessing the segment (msw) of the parameter
+
+.xcref
+.xcref parmB,parmW,parmD,parmQ,parmT,parmCP,parmDP
+.cref
+
+parmB macro n
+ ?pp <n>,<byte>,2,1
+endm
+
+parmW macro n
+ ?pp <n>,<word>,2,2
+endm
+
+parmD macro n
+ ife ?PLM ;;if to assemble for C
+ irp x,<n>
+ ?pp <&&x>,<dword>,0,4
+ ?pp <off_&&x>,<word>,2,2
+ ?pp <seg_&&x>,<word>,2,2
+ endm
+ else ;;if to assemble for PL/M
+ irp x,<n>
+ ?pp <seg_&&x>,<word>,2,2
+ ?pp <off_&&x>,<word>,2,2
+ ?pp <&&x>,<dword>,0,4
+ endm
+ endif
+endm
+
+parmQ macro n
+ ?pp <n>,<qword>,8,8
+endm
+
+parmT macro n
+ ?pp <n>,<tbyte>,10,10
+endm
+
+if sizec
+ parmCP macro n
+ parmD <n>
+ endm
+else
+ parmCP macro n
+ parmW <n>
+ endm
+endif
+
+if sized
+ parmDP macro n
+ parmD <n>
+ endm
+else
+ parmDP macro n
+ parmW <n>
+ endm
+endif
+
+
+
+;; ?pp is the generalized parameter definition macro
+;;
+;; usage:
+;; ?pp m,t,l,s
+;;
+;; where:
+;; n is the name(s) of the parameters
+;; t is the type (word, dword)
+;; l is the length to update parameter byte count by
+;; s is the internal typing size
+
+
+?pp macro n,t,l,s ;;process parameter
+ if ?cpd ;;must be in a procedure definition
+ .xcref
+ irp x,<n>
+ .xcref ?t&&x ;;don't want this in xref
+ ?t&&x=s ;;save size info
+ ife ?PLM ;;if C calling convention
+ ?pp1 x,<t>,,,%(?po+?adj)
+ ?po=?po+l ;;update parameter offset
+ else ;;else assemble for PL/M
+ ?PLMPrevParm=?PLMPrevParm+1 ;;Show next parameter
+ ?po=?po+l ;;update parameter offset
+ ?pp1 x,<t>,%?po,%?adj,,%?PLMPrevParm,%(?PLMPrevParm-1)
+ endif
+ endm
+ .cref
+ else
+ ??error <parm(s) "&n" declared outside proc def>
+ endif
+endm
+
+
+
+;; ?pp1 is the macro that generates the text equate for the
+;; parameter. Two options exist, one for the C calling
+;; convention where the last parameter was the first pushed onto
+;; the stack ('C' convention), and one for the PL/M calling
+;; convention where the first parameter was the first
+;; pushed (also the same as ms-pascal).
+;;
+;; The text generated will be of one of two forms:
+;;
+;; name equ (type ptr [bp+(adj+offset)]) for C
+;; or
+;; name equ (type ptr [bp+adj+?po-offset]) for PL/M
+;;
+;;
+;; For C, since parameters are pushed first last, the offset
+;; plus the adjust will point to the correct parameter.
+;;
+;; For PL/M, since parameters are pushed first first, the offset
+;; of a parameter is much more complicated. A known portion of
+;; the offset can be computed when the text equate is generated.
+;;
+;; What is known is the number of garbage bytes between BP and
+;; the nearest parameter (in this case the last parameter), and
+;; also how many bytes of parameters have preceeded this parameter.
+;;
+;; What is unknown is how many total bytes of parameters there will
+;; be, which affects all the generated text equates since the offset
+;; from bp must be determined at some point.
+;;
+;; Well, the offset from BP can be computed with one variable if
+;; the following is remembered:
+;;
+;; the offset of any parameter from the first parameter is always
+;; the current parameter offset (?po).
+;;
+;; With this in mind, you just have to figure out where the first
+;; parameter is, which is:
+;;
+;; bp + garbage adjustment + distance to first parameter
+;; or
+;; bp + ?adj + ?po
+;;
+;; This implies that any parameter can be defined as:
+;;
+;; bp + ?adj + ?po -%?po
+;;
+;; Make any sense?
+;;
+;; For PL/M, a chain of self-purging macros will be generated
+;; which will pass the evaluated ?po to any previous incarnation
+;; of the macro. This will allow the text equate to be generated
+;; with the actual offset instead of the symbolic ?po.
+;;
+;;
+;; usage:
+;; ?pp1 n,t,o,a,b,cpc,ppc
+;;
+;; where:
+;; n is the name to be given the equate
+;; t is the type (byte, word, dword)
+;; o is the offset from the first parameter
+;; a is the adjustment
+;; b is the adjustment plus the offset from the first parameter
+;; cpc is the number of parameters so far
+;; ppc is cpc - 1
+
+
+?pp1 macro n,t,o,a,b,cpc,ppc
+ ife ?PLM ;;if to generate for C
+ n equ (t ptr [bp+b])
+ else ;;else generate for PL/M
+ .xcref
+ .xcref ?PLMParm&cpc
+ .cref
+ ?PLMParm&cpc &macro po
+ uconcat <n>,,<equ>,,<(t ptr [bp+>,%(a+po-o),<])>
+ ?PLMParm&ppc po
+ purge ?PLMParm&cpc
+ &endm
+ endif
+endm
+
+
+
+;; parmR - register parameter
+;;
+;; parmR is the macro used for generating register parameters.
+;; The space allocated for the register parameters will be
+;; the ?ia (interface adjust) area which is between the old
+;; BP and the first parameter. Normally this is empty (?ia=0),
+;; or has the saved ds for a windows far procedure.
+;;
+;; Byte and dword register parameters will be allowed.
+;;
+;; usage:
+;; parmR n,r,r2
+;; where:
+;; n is the name of the parameter
+;; r is the register it is in
+;; r2 is the offset register if a dword
+
+
+ifndef ?NOPARMR
+ if ?pmd
+ parmR macro n,r,r2
+ ??error <Sorry: ParmR can't be used with PMODE=1>
+ endm
+ else
+ .xcref
+ .xcref ?pr,parmR
+ .cref
+
+ parmR macro n,r,r2
+ ?pr n,r,r2,%?rp,%(?ia+2)
+ endm
+
+ ;; ?pr - register parameter
+ ;;
+ ;; ?pr is the actual macro for generating the equates for
+ ;; register parameters.
+ ;;
+ ;; usage:
+ ;; parmR n,r,r2,i,o
+ ;; where:
+ ;; n is the name of the parameter
+ ;; r is the register it is in
+ ;; r2 is the offset register if a dword
+ ;; i is the index of the ?rp to generate
+ ;; o is the offset from bp where the parm will be
+
+ ?pr macro n,r,r2,i,o
+ .xcref
+ ifnb <r2> ;;if a dword parameter
+ parmR seg_&n,r ;;define segment equate
+ parmR off_&n,r2 ;;define offset equate
+ n equ (dword ptr [bp-o-2]) ;;define dword equate
+ .xcref ?t&n
+ ?t&n=4 ;;show a dword to cmacros
+ else
+ .xcref ?rp&i
+ ?rp&i=0 ;;show no register(s)
+ ifdef ?&r ;;define register if valid
+ ?rp&i=?&r
+ endif
+
+ if ??? or (?cpd eq 0) or (?rp&i eq 0)
+ ??error <invalid parmR encountered: &n,&r>
+ exitm
+ endif
+
+ n equ (word ptr [bp-o]) ;;assume a word register
+ ?t&n=2 ;;show a word to cmacros
+ irp x,<bh,ch,dh,bl,cl,dl,ah,al>
+ if ?&&x eq ?&r ;;if really a byte register
+ n equ (byte ptr [bp-o]) ;; then make it a byte
+ ?t&n=1 ;;show a byte to cmacros
+ exitm
+ endif
+ endm
+ ?ia=?ia+2 ;;show this guy is out there
+ ?rp=?rp+1 ;;show one more register parameter
+ endif
+ .cref
+ endm
+ endif
+endif
+
+
+
+;; localx - generate reference to a local variable on the stack
+;;
+;; An equate is generated for addressing a local variable
+;; on the stack for the current procedural frame.
+;;
+;; usage:
+;; localx n
+;; where:
+;; x is the type b=byte, w=word, d=dword, v=variable size
+;; n is the name(s) to be given the variable(s).
+;;
+;; Bytes are considered to be two bytes long for alignment reasons
+;;
+;; The locald form of the macro generates three equates:
+;;
+;; name - for accessing the variable as a double word
+;; off_name - for accessing the offset (lsw) of the variable
+;; seg_name - for accessing the segment (msw) of the variable
+
+
+.xcref
+.xcref localB,localW,localD,localQ,localT,localCP,localDP,localV
+.cref
+
+localB macro n
+ ?aloc <n>,<byte ptr>,1,1,0 ;; no alignment
+endm
+
+localW macro n
+ ?aloc <n>,<word ptr>,2,2,1 ;; word aligned
+endm
+
+localD macro n
+ irp x,<n>
+ ?aloc <seg_&&x>,<word ptr>,2,2,1 ;; word aligned
+ ?aloc <off_&&x>,<word ptr>,2,2,1 ;; word aligned
+ ?aloc <&&x>,<dword ptr>,0,4,1 ;; word aligned
+ endm
+endm
+
+localQ macro n
+ ?aloc <n>,<qword ptr>,8,8,1 ;; word aligned
+endm
+
+localT macro n
+ ?aloc <n>,<tbyte ptr>,10,10,1 ;; word aligned
+endm
+
+if sizec
+ localCP macro n
+ localD <n>
+ endm
+else
+ localCP macro n
+ localW <n>
+ endm
+endif
+
+if sized
+ localDP macro n
+ localD <n>
+ endm
+else
+ localDP macro n
+ localW <n>
+ endm
+endif
+
+localV macro n,a
+ ?aloc <n>,,%(a),0,1 ;; word aligned
+endm
+
+
+;; ?aloc is the macro that actually allocates local storage.
+;; it is only invoked by the localx macros.
+;;
+;; usage:
+;; ?aloc n,t,l,s,a
+;; where:
+;; n is a list of names of local variable of the
+;; given type.
+;; t is the text string for the given variable
+;; and is one of:
+;; word ptr
+;; dword ptr
+;; byte ptr
+;; or alternatively left blank for variable size
+;; allocations (no implicit type).
+;; l is the size of the variable in bytes
+;; s is the internal type flag (size), and is one of:
+;; word - 2
+;; dword - 4
+;; byte - 1
+;; variable - 0
+;; a is a flag indicating that word alignment is to be
+;; forced for this type of item.
+;;
+;; NOTE: It is assumed that the stack is already aligned on a word
+;; boundary when the cProc is invoked. The macros will guarantee
+;; to allocate an even number of bytes on the stack to maintain
+;; word alignment.
+
+
+?aloc macro n,t,l,s,a
+ if ?cpd ;;must be in a proc def
+ .xcref
+ irp x,<n> ;;generate symbol equates
+ ???=???+l ;;update length of locals
+ if a ;;if align, then force word alignment
+ ???=((??? + 1) and 0fffeh)
+ endif
+ ?al1 x,<t>,%(???+?ia) ;;?ia will always be valid (0 or 2)
+ .xcref ?t&&x
+ ?t&&x=s ;;save size info
+ endm
+ .cref
+ else
+ ??error <locals "&n" declared outside procedure def>
+ endif
+endm
+
+
+
+;; ?al1 - allocate local, continued.
+;;
+;; ?al1 actually generates the text equate for the local variable.
+;; The form of the text equate generated is more or less:
+;;
+;; name equ (type ptr [bp-?ia-nn])
+;; or
+;; name equ ([bp-?ia-nn])
+;;
+;; where:
+;; ?ia is defined to be either zero, or is defined to be
+;; the number of bytes between the saved BP and the first
+;; local. ?ia is only applicable if the current cProc is
+;; a windows far procedure or if parmRs have been
+;; encountered. If not, the ?ia will be zero. since ?ia
+;; is determinable prior to invoking this macro, it will be
+;; added into the offset ("nn") passed to this macro
+;;
+;; usage:
+;; ?al1 n,t,o
+;; where:
+;; n is the name for the text equate
+;; t is the type of the equate
+;; o is the offset of the equate
+
+
+?al1 macro n,t,o
+ n equ (t [bp-o])
+endm
+
+
+;; ?gcc - get calling convention
+;;
+;; ?gcv sets the given symbol to the calling convention
+;; to be used.
+;;
+;; usage:
+;; ?gcc s,i,cc
+;;
+;; where:
+;; s is the symbol to return the convention in
+;; s = 0 if 'C' calling convention
+;; s = 1 if PL/M (PASCAL) calling convention
+;; i is the initial value for s
+;; cc is the calling convention override, and may be one of
+;; C use 'C' convention
+;; PLM use PL/M calling convention
+;; PASCAL use PL/M calling convention
+
+?gcc macro s,i,cc
+ s = i ;;Set default calling convention
+ ifnb <cc>
+ ifidn <cc>,<C> ;;If overriding default
+ s=0 ;; 'C' calling convention
+ endif
+ ifidn <cc>,<PLM>
+ s=1 ;; PL/M calling convention
+ endif
+ ifidn <cc>,<PASCAL>
+ s=1 ;; PL/M calling convention
+ endif
+ endif
+endm
+
+
+
+ifndef ?NOGLOBAL
+ .xcref
+ .xcref globalB,globalW,globalD,globalQ,globalT,globalCP,globalDP
+ .cref
+
+ ;; globalx - define global data of type x
+ ;;
+ ;; usage:
+ ;; globalx n,i,s,c
+ ;; where:
+ ;; x is the type of the variable b=byte, w=word, d=dword
+ ;; q=quad word, t=tenbytes, cp=code pointer, dp=data pointer
+ ;; n is the name to be given the variable.
+ ;; i is the initial value of the variable.
+ ;; s is the duplication factor
+ ;; c is the convention, C for C, PLM or PASCAL for PL/M.
+ ;; The default (?PLM flag) will be used if not specified.
+ ;;
+ ;; The D form will generate two extra equates of the form off_n and seg_n.
+
+ globalB macro n,i,s,c
+ ?ad <n>,1
+ ?dd n,1,<byte>,<db>,<i>,<s>,<c>
+ endm
+
+ globalW macro n,i,s,c
+ ?ad <n>,2
+ ?dd n,1,<word>,<dw>,<i>,<s>,<c>
+ endm
+
+ globalD macro n,i,s,c
+ ?ad <n>,4
+ ?dd n,1,<dword>,<dd>,<i>,<s>,<c>
+ off_&n equ n
+ seg_&n equ n[2]
+ endm
+
+ globalQ macro n,i,s,c
+ ?ad <n>,8
+ ?dd n,1,<qword>,<dq>,<i>,<s>,<c>
+ endm
+
+ globalT macro n,i,s,c
+ ?ad <n>,10
+ ?dd n,1,<tbyte>,<dt>,<i>,<s>,<c>
+ endm
+
+ if sizec
+ globalCP macro n,i,s,c
+ globalD n,<i>,<s>,<c>
+ endm
+ else
+ globalCP macro n,i,s,c
+ globalW n,<i>,<s>,<c>
+ endm
+ endif
+
+ if sized
+ globalDP macro n,i,s,c
+ globalD n,<i>,<s>,<c>
+ endm
+ else
+ globalDP macro n,i,s,c
+ globalW n,<i>,<s>,<c>
+ endm
+ endif
+
+endif
+
+
+ifndef ?NOSTATIC
+ .xcref
+ .xcref staticB,staticW,staticD,staticQ,staticT,staticCP,staticDP
+ .cref
+
+ ;; staticx - define static data of type x
+ ;;
+ ;; usage:
+ ;; staticx n,i,s
+ ;; where:
+ ;; x is the type of the variable b=byte, w=word, d=dword
+ ;; q=quad word, t=tenbytes, cp=code pointer, dp=data pointer
+ ;; n is the name to be given the variable.
+ ;; i is the initial value of the variable.
+ ;; s is the duplication factor
+ ;;
+ ;; statics do not generate an underscored version of the symbol
+ ;; since they are intended to be internal symbols. If they are
+ ;; required to be public, use globlax.
+
+
+ staticB macro n,i,s
+ ?ad <n>,1
+ ?dd n,0,<byte>,<db>,<i>,<s>,<PLM> ;;PLM to keep from generating _
+ endm
+
+ staticW macro n,i,s
+ ?ad <n>,2
+ ?dd n,0,<word>,<dw>,<i>,<s>,<PLM>
+ endm
+
+ staticD macro n,i,s
+ ?ad <n>,4
+ ?dd n,0,<dword>,<dd>,<i>,<s>,<PLM>
+ endm
+
+ staticQ macro n,i,s
+ ?ad <n>,8
+ ?dd n,0,<qword>,<dq>,<i>,<s>,<PLM>
+ endm
+
+ staticT macro n,i,s
+ ?ad <n>,10
+ ?dd n,0,<tbyte>,<dt>,<i>,<s>,<PLM>
+ endm
+
+ if sizec
+ staticCP macro n,i,s
+ staticD n,<i>,<s>
+ endm
+ else
+ staticCP macro n,i,s
+ staticW n,<i>,<s>
+ endm
+ endif
+
+ if sized
+ staticDP macro n,i,s
+ staticD n,<i>,<s>
+ endm
+ else
+ staticDP macro n,i,s
+ staticW n,<i>,<s>
+ endm
+ endif
+endif
+
+
+
+;; ?dd is the generalized data definition macro.
+;;
+;; format:
+;; ?dd n,p,t,d,i,s,c
+;; where:
+;; n is the name of the procedure
+;; p is the public flag
+;; t is the assembler type (byte, word, dword)
+;; d is the assembler directive (db,dw or dd)
+;; i is the initial value
+;; s is a duplication factor
+;; c is the convention, C for C, PLM or PSACAL for PL/M.
+;; The default (?PLM flag) will be used if not specified.
+
+
+?dd macro n,p,t,d,i,s,c
+ ?gcc ?dd2,%?PLM,<c> ;;Set calling convention
+ ife ?dd2 ;;If 'C'
+ n label t
+ ?dd1 _&n,p,<d>,<i>,<s> ;;Microsoft C uses leading underscores
+ else
+ ?dd1 n,p,<d>,<i>,<s> ;;If PL/M
+ endif
+endm
+
+
+
+;; ?dd1 is the generalized data definition macro.
+;;
+;; format:
+;; ?dd1 n,p,d,i,s
+;; where:
+;; n is the name of the procedure
+;; p is the public flag
+;; d is the assembler directive (db,dw or dd)
+;; i is the initial value
+;; s is a duplication factor
+
+
+?dd1 macro n,p,d,i,s
+ if p
+ public n
+ endif
+ ifb <s>
+ n d i
+ else
+ ifb <i>
+ n d s dup (?)
+ else
+ n d s dup (i)
+ endif
+ endif
+endm
+
+
+
+ifndef ?NOEXTERN
+ .xcref
+ .xcref ?ex1,?ex2,externB,externW,externD,externQ,externT
+ .xcref externNP,externFP,externP,externCP,externDP,externA
+ .cref
+ ?ex2 = 0
+
+ ;; externx - define external data of type x
+ ;;
+ ;; usage:
+ ;; externx n,c
+ ;; where:
+ ;; x is the type of the variable b=byte, w=word, d=dword
+ ;; q=quad word, t=tenbytes, cp=code pointer
+ ;; dp=data pointer, a=absolute
+ ;; n is a list of names to define
+ ;; c is the convention, C for C, PLM or PSACAL forPL/M.
+ ;; The default (?PLM flag) will be used if not specified.
+
+ externA macro n,c ;;40h is reserved for whatever will
+ ?ex1 <n>,40h,<abs>,<c>,<> ;; be done in the future for ASB
+ endm ;; externals
+
+ externB macro n,c
+ ?ex1 <n>,1,<byte>,<c>,<>
+ endm
+
+ externW macro n,c
+ ?ex1 <n>,2,<word>,<c>,<>
+ endm
+
+ externD macro n,c
+ ?ex1 <n>,4,<dword>,<c>,<>
+ endm
+
+ externQ macro n,c
+ ?ex1 <n>,8,<qword>,<c>,<>
+ endm
+
+ externT macro n,c
+ ?ex1 <n>,10,<tbyte>,<c>,<>
+ endm
+
+ externNP macro n,c
+ ?ex1 <n>,2,<near>,<c>,<cc>
+ endm
+
+ externFP macro n,c
+ ?ex1 <n>,4,<far>,<c>,<cc>
+ endm
+
+ if sizec
+ externP macro n,c
+ ?ex1 <n>,4,<far>,<c>,<cc>
+ endm
+ else
+ externP macro n,c
+ ?ex1 <n>,2,<near>,<c>,<cc>
+ endm
+ endif
+
+ if sizec
+ externCP macro n,c
+ ?ex1 <n>,4,<dword>,<c>,<>
+ endm
+ else
+ externCP macro n,c
+ ?ex1 <n>,2,<word>,<c>,<>
+ endm
+ endif
+
+ if sized
+ externDP macro n,c
+ ?ex1 <n>,4,<dword>,<c>,<>
+ endm
+ else
+ externDP macro n,c
+ ?ex1 <n>,2,<word>,<c>,<>
+ endm
+ endif
+
+
+
+ ;; ?ex1 is the generalized external definition macro
+ ;;
+ ;; format:
+ ;; ?ex1 n,s,d,c,scv
+ ;; where:
+ ;; n is are the names of the externals
+ ;; s is the size in bytes (used for typing)
+ ;; d is the type
+ ;; c is the convention, C for C, PLM or PSACAL for PL/M.
+ ;; The default (?PLM flag) will be used if not specified.
+ ;; scv save calling convention. If this field is "cc", then
+ ;; the calling convention will be saved in a ?CCn equ.
+
+ ?ex1 macro n,s,d,c,scv
+ ?gcc ?ex2,%?PLM,<c>
+ irp x,<n>
+ .xcref
+ .xcref ?t&&x
+ .cref
+ ?t&&x=s ;;save size info
+ ife ?ex2
+ extrn _&&x:&d
+ x equ _&&x
+ else
+ extrn x:&d
+ endif
+ ifidn <scv>,<cc> ;;save calling convention (C or PL/M)
+ .xcref ;; if NP, FP, or P
+ .xcref ?CC&&x
+ .cref
+ ?CC&&x=?ex2
+ endif
+ endm
+ endm
+endif
+
+
+
+ifndef ?NOLABEL
+ .xcref
+ .xcref ?lb1,?lblpu,?lb2
+ .xcref labelB,labelW,labelD,labelQ,labelT
+ .xcref labelNP,labelFP,labelP,labelCP,labelDP
+ .cref
+ ?lblpu = 0
+ ?lb2 = 0
+
+ ;; labelx - define label of data type x
+ ;;
+ ;; usage:
+ ;; labelx n,c
+ ;; where:
+ ;; x is the type of the variable b=byte, w=word, d=dword
+ ;; q=quad word, t=tenbytes, cp=code pointer, dp=data pointer
+ ;; n is a list of names to define, the first of which can
+ ;; be the keyword public
+ ;; c is the convention, C for C, PLM or PSACAL for PL/M.
+ ;; The default (?PLM flag) will be used if not specified.
+
+ labelB macro n,c
+ ?lb1 <n>,1,<byte>,<c>
+ endm
+
+ labelW macro n,c
+ ?lb1 <n>,2,<word>,<c>
+ endm
+
+ labelD macro n,c
+ ?lb1 <n>,4,<dword>,<c>
+ endm
+
+ labelQ macro n,c
+ ?lb1 <n>,8,<qword>,<c>
+ endm
+
+ labelT macro n,c
+ ?lb1 <n>,10,<tbyte>,<c>
+ endm
+
+ labelNP macro n,c
+ ?lb1 <n>,2,<near>,<c>
+ endm
+
+ labelFP macro n,c
+ ?lb1 <n>,4,<far>,<c>
+ endm
+
+ if sizec
+ labelP macro n,c
+ ?lb1 <n>,4,<far>,<c>
+ endm
+ else
+ labelP macro n,c
+ ?lb1 <n>,2,<near>,<c>
+ endm
+ endif
+
+ if sizec
+ labelCP macro n,c
+ ?lb1 <n>,4,<dword>,<c>
+ endm
+ else
+ labelCP macro n,c
+ ?lb1 <n>,2,<word>,<c>
+ endm
+ endif
+
+ if sized
+ labelDP macro n,c
+ ?lb1 <n>,4,<dword>,<c>
+ endm
+ else
+ labelDP macro n,c
+ ?lb1 <n>,2,<word>,<c>
+ endm
+ endif
+
+
+ ;; ?lb1 is the generalized label definition macro
+ ;;
+ ;; format:
+ ;; ?lb1 n,s,d
+ ;; where:
+ ;; n are the names of the labels
+ ;; s is the size in bytes (used for typing)
+ ;; d is the type
+ ;; c is the convention, C for C, PLM or PSACAL for PL/M.
+ ;; The default (?PLM flag) will be used if not specified.
+
+ ?lb1 macro n,s,d,c
+ ?gcc ?lb2,%?PLM,<c>
+ ?lblpu=0
+ irp x,<n>
+ ifidn <x>,<PUBLIC>
+ ?lblpu=1
+ else
+ .xcref
+ .xcref ?t&&x
+ .cref
+ ?t&&x=s ;;save size info
+ ife ?lb2 ;;If C
+ if ?lblpu
+ public _&&x
+ endif
+ _&&x label &d
+ x equ _&&x
+ else ;;If PL/M
+ if ?lblpu
+ public x
+ endif
+ x label &d
+ endif
+ endif
+ endm
+ endm
+endif
+
+
+
+ifndef ?NODEF
+
+ ;; defx - inform macros that name is of type x
+ ;;
+ ;; The given name(s) is flaged to be of the given type. This macro
+ ;; is intended for giving types to variables that were not generated
+ ;; by the macros (i.e., static storage). There must be a type definition
+ ;; for all parameters in a call list.
+ ;;
+ ;; usage:
+ ;; defx n
+ ;; where:
+ ;; x is the type of the variable b=byte, w=word, d=dword
+ ;; n is the name(s) to be given the variable(s).
+ ;;
+ ;; Bytes are considered to be two bytes long for alignment reasons
+
+ .xcref
+ .xcref defB,defW,defD,defQ,defT,defCP,defDP
+ .cref
+
+ defB macro n
+ ?ad <n>,1
+ endm
+
+ defW macro n
+ ?ad <n>,2
+ endm
+
+ defD macro n
+ ?ad <n>,4
+ endm
+
+ defQ macro n
+ ?ad <n>,8
+ endm
+
+ defT macro n
+ ?ad <n>,10
+ endm
+
+ if sizec
+ defCP macro n
+ defD <n>
+ endm
+ else
+ defCP macro n
+ defW <n>
+ endm
+ endif
+
+ if sized
+ defDP macro n
+ defD <n>
+ endm
+ else
+ defDP macro n
+ defW <n>
+ endm
+ endif
+endif
+
+
+
+; ?ad is the macro which creates a definition for the given
+; symbol
+;
+; usage:
+; ?ad <n>,s
+; where:
+; n is a list of names to define
+; s is the size info (1,2,4,8,10)
+
+
+?ad macro n,s
+ irp x,<n>
+ .xcref
+ .xcref ?t&&x
+ .cref
+ ?t&&x=s ;;save size info
+ endm
+endm
+
+
+
+ifndef ?NOPTR
+ .xcref
+ .xcref regPtr,farPtr
+ .cref
+
+ ;; regPtr generates information allowing a 32-bit pointer currently
+ ;; in a register to be pushed as a parameter to a subroutine using
+ ;; the cCall macro.
+ ;;
+ ;; usage:
+ ;; regptr n,s,o
+ ;; where:
+ ;; n is the name the argument will be known as
+ ;; s is the register containing the segment portion
+ ;; of the pointer
+ ;; o is the register containing the offset portion
+ ;; of the pointer
+ ;;
+ ;; 2/14/85 - made obsolete with farptr
+
+ regPtr macro n,s,o
+ farPtr n,s,o
+ endm
+
+
+
+ ;; farPtr generates information allowing a 32-bit pointer to be
+ ;; pushed as a parameter to a subroutine using the cCall macro.
+ ;;
+ ;; usage:
+ ;; farptr n,s,o
+ ;; where:
+ ;; n is the name the argument will be known as
+ ;; s is the segment portion of the pointer
+ ;; o is the offset portion of the pointer
+ ;;
+ ;; Note that any cast must have been made in the argument itself
+ ;; (i.e. regptr ptr1,ds,<word ptr 3[si]>)
+
+
+ farPtr macro n,s,o
+ .xcref
+ .xcref ?t&n
+ .cref
+ n &macro
+ push s ;@
+ push o ;@
+ &endm
+ ?t&n=80h
+ endm
+endif
+
+
+
+;; arg - declare argument
+;;
+;; The given argument(s) is added to the argument list structure
+;;
+;; format:
+;; arg a
+;;
+;; where:
+;; a is any valid argument to push.
+;;
+;; If any element in arglist has not been defined or isn't a 16-bit
+;; register, then a complete specification must have been given in a
+;; text equate and a defx also given (if not, you'll pay the penalty!)
+
+
+arg macro a
+ irp x,<a>
+ ?argc=?argc+1 ;;increment the arg count
+ ?atal <x>,%?argc ;;generate argument
+ endm
+endm
+
+
+
+;; ?atal (add to argument list) generates a macro that will cause
+;; the given argument to be processed when invoked. It is used by
+;; the arg macro only.
+
+
+?atal macro n,i
+ .xcref
+ .xcref ?ali&i
+ .cref
+ ?ali&i &macro
+ ?ap n
+ &endm
+endm
+
+
+
+;; ?ap - process arguments and place onto stack
+;;
+;; The given argument is processed (type checking) and place on
+;; the stack for a pending call. There must be a type definition
+;; for all arguments (except words). This can be done by using
+;; text equates and the defx macro.
+;;
+;; format:
+;; ?ap n
+;; where:
+;; n is the name of the argument to be pushed
+;;
+;; The variable ?argl is updated by the length of the arguments
+;; pushed so that the stack can be cleaned up after the call.
+
+
+?ap macro n
+ ?argl=?argl+2 ;;assume one word is pushed
+ ifdef ?t&n
+ ife ?t&n-1 ;;byte type
+ push word ptr (n) ;@
+ exitm
+ endif
+
+ ife ?t&n-2 ;;word type
+ push n ;@
+ exitm
+ endif
+
+ ife ?t&n-4 ;;dword type
+ push word ptr (n)[2] ;@
+ push word ptr (n) ;@
+ ?argl=?argl+2
+ exitm
+ endif
+
+ ife ?t&n-8 ;;qword type
+ push word ptr (n)[6] ;@
+ push word ptr (n)[4] ;@
+ push word ptr (n)[2] ;@
+ push word ptr (n) ;@
+ ?argl=?argl+6
+ exitm
+ endif
+
+ if ?t&n and 80h ;;far pointer type
+ n
+ ?argl=?argl+2
+ exitm
+ endif
+
+ ife ?t&n ;;variable storage
+ push word ptr (n) ;@
+ exitm
+ endif
+ endif
+
+ push n ;;unknown or register or immediate ;@
+endm
+
+
+
+;; cCall - call a 'c' language procedure
+;;
+;; The given procedure is called with the given parameters.
+;; If the calling convention is C, the arguments are pushed
+;; in reverse order, and removed after the called procedure
+;; returns. If the calling conventing is PL/M, the arguments
+;; are pushed as they were encountered, and the called procedure
+;; is assumed to have removed them from the stack.
+;;
+;; The calling convention priority will be:
+;; 1) that specified on the cCall if present
+;; 2) that defined by the target
+;; 3) the default (?PLM flag)
+;;
+;; format:
+;; ccall n,<a>,c
+;;
+;; where:
+;; n is the name of the procedure to call
+;; a are arguments to be pushed (optional, may be
+;; specified with the "arg" macro.
+;; c is the convention, C for C, PLM or PSACAL for PL/M.
+;; The default (?PLM flag) will be used if not specified.
+
+
+cCall macro n,a,c
+ ifnb <a> ;;add any arguments to list
+ arg <a>
+ endif
+ mpush %?rsl ;;save registers (if any)
+
+ ifdef ?CC&n ;;if calling convention has been
+ ?cCall1=?CC&n ;; defined for target, use it
+ else ;;else use the default
+ ?cCall1=?PLM
+ endif
+
+ ifnb <c> ;;If possible override, check it out
+ ?gcc ?cCall1,%?cCall1,<c>
+ endif
+
+ ?argl=0 ;;init argument length
+ ife ?cCall1 ;;if C calling convention
+ ?acb=?argc ;;initialize for looping
+ else
+ ?acb=1 ;;initialize for looping
+ endif
+
+ rept ?argc ;;push arguments and purge macros
+ uconcat <?ali>,%?acb
+ uconcat <purge>,,<?ali>,%?acb
+ ife ?cCall1 ;;if C calling convention
+ ?acb=?acb-1
+ else
+ ?acb=?acb+1
+ endif
+ endm
+ call n ;;call the procedure ;@
+ if ((?cCall1 eq 0) and (?argl ne 0)) ;;If C calling convention and arguments
+ add sp,?argl ;; then remove them ;@
+ endif
+ mpop %?rsl ;;pop all specified regs
+ ?rsl=0 ;;invalidate save list
+ ?argc= 0 ;; " arguments
+ ?argl= 0
+endm
+
+
+
+
+;; cProc - define a 'c' procedure
+;;
+;; cProc is the procedure definition for procedures.
+;;
+;; format:
+;; cProc n,cf,a
+;; where:
+;; n is the name of the procedure
+;;
+;; cf controls certain definitions, and may be:
+;; NEAR proc is to be a near label
+;; FAR proc is to be a far label
+;; PUBLIC proc is to be defined as public
+;; SMALL call makeframe procedure
+;; NODATA dont create prolog code to setup DS
+;; ATOMIC don't link stack if not needed
+;; NODATA must be specified for ATOMIC
+;; FORCEFRAME Force generation of a frame
+;; NOTE: FORCEFRAME no longer supported
+;; C proc is to be a C procedure
+;; PLM proc is to be a PL/M procedure
+;; PASCAL proc is to be a PL/M procedure
+;; WIN proc is to be a windows procedure
+;; NONWIN proc isn't to be a windows procedure
+;; LOADDS Preserve & set DS to _DATA
+;; EXPORTED mov ax,ds, nop at start of routine
+;;
+;; a is a list of registers that are to be saved whenever
+;; the procedure is invoked.
+;;
+;; makeframe procedure: If small is specified, then
+;; the "makeframe procedure" is invoked instead of
+;; generating normal prologues/epilogues
+;;
+;; A call is performed to the makeframe procedure. The
+;; call is followed by two bytes. the first byte is the
+;; number of locals to allocate for the frame, the second
+;; is the number of bytes of parameters. The makeframe
+;; procedure will in turn call the cProc routine at the
+;; address following the data bytes. When the cProc is
+;; finished, it will do a near return to the makeframe
+;; procedure to clean up the frame and exit.
+;;
+;; Note that register parameters and makeframe are
+;; incompatible and cannot be used together.
+;;
+;; The makeframe procedure will save SI, DI, and also
+;; DS if a far procedure. These registers will be
+;; removed from the autosave list if specified.
+
+
+cProc macro n,cf,a
+ if ?cpd
+ ?utpe ;;generate unterminated proc error
+ endif
+
+ ?cpd=1 ;;a procdef is active now
+ ???=0 ;;no locals are defined yet
+ ?argc=0 ;;no arguments are defined
+ ?ba=0 ;;not in a procedure
+ ?po=0 ;;initial parameter offset
+ ?pu=0 ;;initial public setting
+ ?ia=0 ;;no special prolog/epilog
+ ?adj=4 ;;parameter adjustment (near ret+bp)
+ ?rp=0 ;;no register parameters
+ ?uf=0 ;;don't use makeframe
+ ?wfp=?WIN ;;default far procedure (win or not)
+ ?ff=0 ;;don't force frame setup
+ ?pas=0 ;;process register save list
+ ?pcc=?PLM ;;calling convention (C or PL/M)
+ ?lds=0 ;;no LOADDS
+ ?exp=0 ;;not EXPORTED
+
+ ifnb <a> ;;register save list
+ ?ri ?pas,<a>
+ endif
+
+ ?pc=sizec ;;default size
+ ?nd=?nodata1 ;;default NODATA flag
+ ?nx=0 ;;default is not ATOMIC
+ irp x,<cf>
+ ifidn <x>,<FAR> ;;if far,
+ ?pc=1 ;; set far flag
+ endif
+ ifidn <x>,<NEAR> ;;if near,
+ ?pc=0 ;; set near flag
+ endif
+ ifidn <x>,<PUBLIC> ;;if public,
+ ?pu=1 ;; set public flag
+ endif
+ ifidn <x>,<SMALL> ;;if small
+ ?uf=1 ;; set small flag
+ endif
+ ifidn <x>,<DATA> ;;if data
+ ?nd=0 ;; reset NODATA flag
+ endif
+ ifidn <x>,<NODATA> ;;if NODATA
+ ?nd=1 ;; set NODATA flag
+ endif
+ ifidn <x>,<ATOMIC> ;;if ATOMIC
+ ?nx=1 ;; set ATOMIC flag
+ endif
+ ifidn <x>,<C> ;;if to force C calling convention
+ ?pcc=0 ;; set flag
+ endif
+ ifidn <x>,<PLM> ;;if to force PLM calling convention
+ ?pcc=1 ;; set flag
+ endif
+ ifidn <x>,<PASCAL> ;;if to force PLM calling convention
+ ?pcc=1 ;; set flag
+ endif
+ ifidn <x>,<WIN> ;;if to force a Window's frame
+ ?wfp=1 ;; set flag
+ endif
+ ifidn <x>,<NONWIN> ;;if not to be a Window's frame
+ ?wfp=0 ;; set flag
+ endif
+ ifidn <x>,<LOADDS> ;; Preserve & setup DS
+ ?lds=1
+ endif
+ ifidn <x>,<EXPORTED>
+ ?exp=1
+ endif
+ endm
+
+ if ?pcc ;;If PLM
+ ?PLMPrevParm=0 ;; show no previous parameter
+ .xcref
+ .xcref ?PLMParm0
+ .cref
+ ?PLMParm0 &macro ;;Null macro to terminate
+ purge ?PLMParm0
+ &endm
+ endif
+
+ .xcref
+ .xcref ?CC&n
+ .cref
+ ?CC&n=?pcc ;;Save procedure type
+
+ if (?nx eq 1) and (?nd eq 0) ;;ATOMIC requires NODATA
+ ?nx = 0 ;;clear the ATOMIC keyword
+ ??error <ATOMIC specified without NODATA - ATOMIC ignored>
+ endif
+
+ if ?pc ;;if a far procedure
+ if ?wfp+?exp+?lds ;;if windows, EXPORTED, or LOADDS
+ ife ?nx ;;and not ATOMIC
+ ife ?pmd ;;If PMODE, no adjustment needed
+ ?ia=2 ;; adjust locals for saved ds
+ endif
+ ?pas = ?pas and (not ?ds) ;;no need for extra save
+ endif
+ endif
+ ?adj=?adj+2 ;;far, make parameter adjustment
+ else
+ ?wfp=0 ;;not a far windows procedure
+ endif
+
+ ife ?386regs
+ ?pas = ?pas and (not (?sp+?cs+?ss)) ;;make no sense to save these
+ endif
+
+ if ?uf ;;don't save these if user frame
+ if ?386regs
+ ?pas = ?pas and (not (?si+?di))
+ else
+ ?pas = ?pas and (not (?bp+?si+?di))
+ endif
+ endif
+
+ ife ?pcc
+ ?pg <_&n>,%?pu,%?pc,%?pas,%?wfp,<n>,%?pcc
+ else
+ ?pg <n>,%?pu,%?pc,%?pas,%?wfp,<n>,%?pcc
+ endif
+endm
+
+
+;; ?pg - generate begin and nested macros for current procedure
+;;
+;; format:
+;; ?pg n,p,c,a,w,nnu,cc
+;; where:
+;; n is the name of the procedure
+;; p is the public flag
+;; c is the class definition for the procedure
+;; a is an enumerated list of registers to save
+;; at entry and restore at exit
+;; w true if a far windows procedure
+;; nnu procedure name without any underscore
+;; cc calling convention (C or PL/M)
+;;
+;;
+;; local stack allocation will be forced to an even byte count to
+;; maintain stack word alignment.
+
+;;
+;;
+
+
+?pg macro n,p,c,a,w,nnu,cc
+ .xcref
+ if ?uf ;;if user frame
+ if ?nd
+ ??error <NODATA encountered in &n - user frame ignored>
+ ?uf=0
+ endif
+ endif
+
+ .xcref cBegin
+ cBegin &macro g ;;generate cBegin macro
+ .xcref
+ if cc ;;Finish definition of parameters
+ uconcat <?PLMParm>,%?PLMPrevParm,%?po
+ endif
+
+ if ?uf ;;if user frame
+ if ?rp
+ ??error <parmR encountered in &n - user frame ignored>
+ ?uf=0
+ endif
+ endif
+ ?pg1 <n>,c,a,%?po,w,%?uf,%?nd,%?rp,cc ;;generate cEnd macro
+ ?cpd=0 ;;terminate current proc def
+ ?argc=0 ;;no arguments are defined yet
+ ?ba=1 ;;have reached a begin
+ ???=(???+1) and 0fffeh ;;word align local storage
+
+ if p ;;If to be public
+ public n
+ endif
+
+ ife c ;;declare procedure type
+ n proc near
+ else
+ n proc far
+ endif
+
+ ife cc ;;if 'C' calling convention
+ nnu equ n ;; generate label without underscore
+ endif
+
+ ifidn <g>,<nogen> ;;if nogen specified, shouldn't have
+ if ???+?po+a+?rp ;; parms, locals, or saved regs
+ ??_out <cBegin - possible invalid use of nogen>
+ endif
+ else ;;must generate a frame
+ if ?uf ;;if user frame code specified
+ ?mf c,%???,%?po ;; call user's makeframe
+ mpush a ;; save specified registers
+ else
+
+ if w+?exp+?lds ;;if a far windows procedure
+
+ if ?pmd ;;if protect mode:
+ ife ?nd ;; if not NODATA
+ if ?lds ;; and LOADDS
+ mov ax,_DATA ;; ax = _DATA
+ else ;; else if EXPORTED
+ if ?exp
+ mov ax,ds ;; ax = DS
+ nop ;;
+ endif
+ endif
+ endif
+
+ ife ?nx ;;!ATOMIC:
+ if ???+?po ;; or there are no locals or params
+ if ?chkstk1 ;; if stack checking,
+ push bp ;; we can't use ENTER
+ mov bp,sp
+ else
+ if ??? ;; If there are locals, use ENTER
+ enter ???,0
+ else
+ push bp ;; otherwise it's smaller/faster
+ mov bp,sp ;; to use standard sequence
+ endif
+ endif
+ endif
+
+ push ds ;; preserve DS
+
+ if ?lds+?exp ;; if LOADDS or EXPORTED
+ mov ds,ax ;; set up new DS
+ endif
+ else ;;ATOMIC:
+ if ?ff+???+?po+?rp ;;if any locals or parameters
+ push bp ;; then must set frame pointer ;@
+ mov bp,sp ;; to be able to access them ;@
+ endif
+ endif
+
+ else ;; !?pmd
+
+ ife ?nd ;;if not NODATA,
+ mov ax,ds ;; then set AX = currentds, and ;@
+ nop ;; leave room for MOV AX,_DATA ;@
+ endif
+ ife ?nx ;;if not ATOMIC, far frame must be set
+ ife ?DOS5 ;;if not DOS5, then set far frame flag
+ inc bp ;; by incrementing the old bp ;@
+ endif
+ push bp ;@
+ mov bp,sp ;@
+ push ds ;@
+ else ;;ATOMIC procedure
+ if ?ff+???+?po+?rp ;;if any locals or parameters
+ push bp ;; then must set frame pointer ;@
+ mov bp,sp ;; to be able to access them ;@
+ endif
+ endif
+ ife ?nd ;;if not NODATA, then AX should
+ mov ds,ax ;; have the ds to use ;@
+ endif
+
+ endif ;; !?pmd
+
+ else ;;not windows. use standard prolog
+
+ if ?pmd ;;protect mode:
+
+ if ?exp
+ mov ax,ds ;; If EXPORTED, generate patchable
+ nop ;; instruction.
+ else
+ if ?lds ;; If LOADDS, set up AX = _DATA
+ mov ax,_DATA
+ endif
+ endif
+
+ if ?ff+???+?po+?rp ;; If frame needed...
+ if ?chkstk1 ;; if stack checking,
+ push bp ;; we can't use ENTER
+ mov bp,sp
+ else
+ if ??? ;; If there are locals, use ENTER
+ enter ???,0
+ else
+ push bp ;; otherwise it's smaller/faster
+ mov bp,sp ;; to use standard sequence
+ endif
+ endif
+ endif
+
+ if ?exp+?lds ;;if EXPORTED or LOADDS
+ push ds ;; preserve DS
+ mov ds,ax ;; and set up new one.
+ endif
+
+ else ;; ! ?pmd
+ if ?ff+???+?po+?rp ;;if any locals or parameters
+ push bp ;; then must set frame pointer ;@
+ mov bp,sp ;; to be able to access them ;@
+ endif
+ endif ;; ! ?pmd
+
+ endif ;; ! w
+
+ if ?rp ;;if parmR's, push them before
+ ?uf=0 ;; allocating locals and saving
+ rept ?rp ;; the autosave registers
+ uconcat mpush,,?rp,%?uf
+ ?uf=?uf+1
+ endm
+ endif
+
+ if ??? ;;if locals to allocate
+ if ?chkstk1 ;;if stack checking enabled
+ ifdef ?CHKSTKPROC ;;if user supplied stack checking
+ ?CHKSTKPROC %??? ;; invoke it with bytes requested
+ else
+ mov ax,??? ;;invoke default stack checking ;@
+ ife cc
+ call _chkstk ;@
+ else
+ call chkstk ;@
+ endif
+ endif
+ else ;;no stack checking
+ ife ?pmd ;;no need if in pmode (we used enter)
+ sub sp,??? ;; allocate any local storage ;@
+ endif
+ endif
+ endif
+
+ mpush a ;;save autosave registers
+ endif
+
+ ifdef ?PROFILE ;;if profiling enabled
+ if c ;; and a far procedure
+ call StartNMeas ;; invoke profile start procedure ;@
+ endif
+ endif
+
+ endif
+
+ .cref
+ purge cBegin ;;remove the macro
+ &endm ;;end of cBegin macro
+
+ .xcref ?utpe
+ ?utpe &macro
+ ??error <unterminated procedure definition: "&n">
+ &endm
+ .cref
+endm ;;end of ?pg macro
+
+
+
+
+;; ?pg1 - generate end macro for current procedure
+;;
+;; format:
+;; ?pg1 n,c,a,o,w,f,d,r,cc
+;; where:
+;; n is the name of the procedure
+;; c is the class definition for the procedure
+;; a is an enumerated list of registers to save
+;; at entry and restore at exit
+;; o is the number of bytes of paramteres to remove at exit
+;; w true if a far windows procedure
+;; f is 1 if to use the user's makeframe procedure
+;; d is 1 if NODATA procedure
+;; r number of register parameters
+;; cc calling convention (C or PL/M)
+
+
+?pg1 macro n,c,a,o,w,f,d,r,cc
+ .xcref
+ .xcref cEnd
+ cEnd &macro g ;;start of cEnd macro
+ .xcref
+ ?ba=0 ;;no longer in a procedure
+
+ ifidn <g>,<nogen> ;;validate nogen usage
+ if o+a+r
+ ??_out <cEnd - possible invalid use of nogen>
+ endif
+ else ;;must generate an epilog
+ ifdef ?PROFILE ;;if profiling enabled
+ if c ;; and a far procedure
+ call StopNMeas ;; invoke profile stop procedure
+ endif ;; (doesn't trash DX:AX)
+ endif
+
+ mpop a ;;restore autosaved registers
+ if f ;;if to use the "makeframe" procedure
+ db 0c3h ;; near return to user's makeframe @
+ else
+ if w+?exp+?lds ;;if far win proc, use special epilog
+ if ?pmd
+ ife ?nx
+ pop ds ;; if not ATOMIC, restore DS
+ endif
+
+ ife ?nx ;; if not ATOMIC and no locals
+ if ?chkstk1+???+?po
+ leave
+ endif
+ else ;;ATOMIC:
+ if ?ff+???+?po+?rp ;;if any parameters
+ leave ;; fix up BP & exit
+ endif
+ endif
+
+ else ;; !?pmd
+ ife ?nx ;;if not ATOMIC, bp was pushed
+ if (?TF eq 0) or (???+?rp) ;;if cannot assume valid sp
+ lea sp,-2[bp] ;; or locals or parmR's, get valid SP @
+ endif
+ pop ds ;;restore saved ds and bp @
+ pop bp ;; @
+ ife ?DOS5 ;;if not DOS5, bp was
+ dec bp ;; incremented to mark far frame @
+ endif
+ else ;;ATOMIC frame was set up
+ if (?TF eq 0) or (???+?rp) ;;if cannot assume valid sp
+ mov sp,bp ;; or locals or parmR's, get valid SP @
+ endif
+ if ???+?po+?rp
+ pop bp ;@
+ endif
+ endif
+ endif ;; !?pmd
+ else ;;non-windows standard epilog
+ if ?pmd
+ if ?ff+???+?po+?rp ;;if any parameters
+ leave
+ endif
+ else
+ if ?ff+???+?po+?rp ;;if any parameters
+ if (?TF eq 0) or (???+?rp) ;;if cannot assume valid SP
+ mov sp,bp ;; or locals or parmR's, get valid SP;@
+ endif
+ pop bp ;@
+ endif
+ endif
+ endif
+
+ ife cc ;;if C calling convention
+ ret ;; return ;@
+ else ;;else
+ ret o ;; return and remove paramteres ;@
+ endif
+ endif
+ endif
+ n endp ;;end of process
+ .cref
+ purge cEnd ;;remove the macro
+ &endm
+ .cref
+endm
+
+
+
+
+; assumes is a macro that will set up the assumes for a segment
+; or group created with the createSeg macro. If the assumed
+; value passed in isn't known, then a normal assume is made.
+;
+; usage:
+; assumes s,g
+;
+; where:
+; s is the register to make the assumption about
+; g is the value to assume is in it
+
+
+assumes macro s,ln
+ ifndef ln&_assumes
+ assume s:ln
+ else
+ ln&_assumes s
+ endif
+endm
+
+
+
+; createSeg is a macro that sets up a segment definition and
+; a logical name for that segment. The logical name can be
+; used to enter the segment, but it cannot be used for anything
+; else.
+;
+; usage:
+; createSeg n,ln,a,co,cl,grp
+; where:
+; n is the physical name of the segment
+; ln is the name it is to be invoked by
+; a is the alignment, and is optional
+; co is the combine type, and is optional
+; cl is the class, and is optional
+; grp is the name of the group that contains this segment
+
+
+createSeg macro n,ln,a,co,cl,grp
+ ifnb <grp>
+ addseg grp,n
+ else
+ ln&OFFSET equ offset n:
+ ln&BASE equ n
+ ?cs3 <ln>,<n>
+ endif
+ ifnb <cl>
+ n segment a co '&cl'
+ else
+ n segment a co
+ endif
+ n ends
+ ?cs1 <ln>,<n>
+endm
+
+
+addseg macro grp,seg
+ .xcref
+ .xcref grp&_def
+ .cref
+ ifndef grp&_def
+ grp&_def=0
+ endif
+ if grp&_def ne ASMpass
+ .xcref
+ .xcref grp&_add
+ .cref
+ grp&_add &macro s
+ grp&_in <seg>,s
+ &endm
+ .xcref
+ .xcref grp&_in
+ .cref
+ grp&_in &macro sl,s
+ ifb <s>
+ grp group sl
+ else
+ grp&_add &macro ns
+ grp&_in <sl,s>,ns
+ &endm
+ endif
+ &endm
+ grp&_def=ASMpass
+ else
+ grp&_add seg
+ endif
+endm
+
+
+defgrp macro grp,ln
+ addseg grp
+ ifnb <ln>
+ irp x,<ln>
+ ?cs3 <&x>,<grp>
+ x&&OFFSET equ offset grp:
+ x&&BASE equ grp
+ endm
+ endif
+endm
+
+
+?cs1 macro ln,n
+ .xcref
+ .xcref ln&_sbegin
+ .cref
+ ln&_sbegin &macro
+ .xcref
+ .xcref ?mf
+ .cref
+ ?mf &&macro c,l,p ;;when sBegin is invoked, generate
+ if c ;; the makeframe macro
+ extrn n&_FARFRAME:near ;; make frame for far procedures ;@
+ call n&_FARFRAME ;@
+ else
+ extrn n&_NEARFRAME:near ;; make frame for near procedures ;@
+ call n&_NEARFRAME ;@
+ endif
+ db l shr 1 ;;define number of locals ;@
+ db p shr 1 ;;define number of parameters ;@
+ &&endm
+ ?cs2 <ln>,<n>
+ n segment
+ &endm
+endm
+
+
+?cs2 macro ln,n
+ .xcref
+ .xcref sEnd
+ .cref
+ sEnd &macro
+ n ends
+ purge ?mf ;;delete the makeframe macro
+ purge sEnd
+ &endm
+endm
+
+
+?cs3 macro ln,n
+ .xcref
+ .xcref ln&_assumes
+ .cref
+ ln&_assumes &macro s
+ assume s:&n
+ &endm
+endm
+
+
+
+; sBegin is the macro that opens up the definition of a segment.
+; The segment must have already been defined with the createSeg
+; macro.
+;
+; usage:
+; sBegin ln
+;
+; where:
+; ln is the logical name given to the segment when
+; it was declared.
+
+.xcref
+.xcref sBegin
+.cref
+sBegin macro ln
+ ln&_sbegin
+endm
+
+
+
+ife ?DF
+
+ ; Define all segments that will be used. This will allow the
+ ; assume and groups to be set up at one given place, and also
+ ; allow quick changes to be made
+ ;
+ ; createSeg name,logname,align,combine,class,group
+
+ createSeg _TEXT,Code,word,public,CODE
+ ife ?nodata1
+ createSeg _DATA,Data,word,public,DATA,DGROUP
+ defgrp DGROUP,Data
+ endif
+
+ if ?chkstk1
+ ifndef ?CHKSTKPROC
+ externp <chkstk>
+ endif
+ endif
+endif
+
+
+
+; errnz exp - generate error message if expression isn't zero
+;
+; The errnz will generate an error message if the expression "exp"
+; does not evaluate to zero. This macro is very useful for testing
+; relationships between items, labels, and data that was coded into
+; an application.
+;
+; errnz <offset $ - offset label> ;error if not at "label"
+; errnz <eofflag and 00000001b> ;eofflag must be bit 0
+;
+; For expressions involving more than one token, the angle brackets
+; must be used.
+;
+; The macro is only evaluated on pass 2, so forward references may be
+; used in the expression.
+
+errnz macro x ;;display error if expression is <>0
+ if2
+ if x ;;if expression is non-zero,
+ errnz1 <x>,%(x)
+ endif
+ endif
+endm
+
+errnz1 macro x1,x2
+ = *errnz* x1 = x2
+ .err
+endm
+
+
+
+; errn$ label,exp - generate error message if label (exp) <> $
+;
+; The errnz will generate an error message if the label and "exp"
+; does not evaluate to the current value of the location counter.
+; This macro is very useful for testing relationships between
+; labels and the location counter that was coded into an application.
+;
+; examples: errn$ label ;error if not at "label"
+; errn$ label,+3 ;error if not three bytes from "label"
+; errn$ label,-3 ;error if not three bytes past "label"
+;
+; If no "exp" is given, it is the same as specifying 0
+;
+; The macro is only evaluated on pass 2, so forward references may be
+; used in the expression.
+
+errn$ macro l,x ;;error if <$-label1 (exp2)> <>0
+ errnz <offset $ - offset l x>
+endm
+
+
+
+;; If profile has been specified, declare the profile routines
+;; to be external and far. It would be best if this could be done
+;; when the call is actually made, but then the fix-up would be
+;; generated as segment-relative.
+
+
+ifdef ?PROFILE
+ externFP <StartNMeas,StopNMeas>
+endif
diff --git a/private/mvdm/wow16/inc/cmstrip.c b/private/mvdm/wow16/inc/cmstrip.c
new file mode 100644
index 000000000..402724258
--- /dev/null
+++ b/private/mvdm/wow16/inc/cmstrip.c
@@ -0,0 +1,102 @@
+/*
+ stripper: strips asm comments, blanks lines, and spurious spaces
+ (except spaces following the exception strings, listed below.)
+*/
+
+#include <stdio.h>
+
+char *
+ScanWhite( ps )
+char **ps;
+{
+ char *s = *ps;
+
+ while (*s != ' ' && *s != '\t' && *s)
+ s++;
+ *ps = s;
+ if (*s)
+ return s;
+ else
+ return NULL;
+}
+
+char *
+SkipWhite( ps )
+char **ps;
+{
+ char *s = *ps;
+
+ while (*s == ' ' || *s == '\t')
+ s++;
+ *ps = s;
+ if (*s)
+ return s;
+ else
+ return NULL;
+}
+
+char inBuf[ 256 ];
+char outBuf[ 256 ];
+
+
+main()
+{
+ char
+ *inStr,
+ *outStr,
+ *str;
+ int inLen,
+ outLen,
+ tabcnt;
+
+ long totSaved = 0L;
+
+ unlink( "cmacros.bak" ); /* */
+ rename( "cmacros.bak", "cmacros.inc" ); /* */
+ freopen( "cmacros.mas", "r", stdin ); /* */
+ freopen( "cmacros.inc", "w", stdout ); /* */
+ fprintf( stderr, "cmacros.mas => cmacros.inc" );
+ fflush( stderr );
+
+ while (inStr = gets( inBuf ))
+ {
+ inLen = strlen( inBuf );
+ outStr = outBuf;
+
+ tabcnt=0;
+ if (inBuf[inLen-1] == '@')
+ tabcnt=1;
+
+ while (SkipWhite( &inStr ))
+ {
+ if (*inStr == ';')
+ break;
+
+ str = inStr;
+ ScanWhite( &inStr );
+ if (tabcnt > 0 && tabcnt < 3)
+ {
+ *outStr++ = '\t';
+ tabcnt++;
+ }
+ else
+ {
+ if (outStr != outBuf)
+ *outStr++ = ' ';
+ }
+ while (str != inStr)
+ *outStr++ = *str++;
+ }
+
+ if (outLen = outStr - outBuf)
+ {
+ *outStr++ = 0;
+ puts( outBuf );
+ }
+
+ totSaved += (inLen - outLen);
+ }
+
+ fprintf( stderr, " [OK] %ld blanks stripped\n", totSaved );
+ exit( 0 );
+}
diff --git a/private/mvdm/wow16/inc/commdlg.h b/private/mvdm/wow16/inc/commdlg.h
new file mode 100644
index 000000000..723f7b4d3
--- /dev/null
+++ b/private/mvdm/wow16/inc/commdlg.h
@@ -0,0 +1,318 @@
+/*****************************************************************************\
+* *
+* commdlg.h - Common dialog functions, types, and definitions *
+* *
+* Version 1.0 *
+* *
+* NOTE: windows.h must be #included first *
+* *
+* Copyright (c) 1992, Microsoft Corp. All rights reserved. *
+* *
+\*****************************************************************************/
+
+#ifndef _INC_COMMDLG
+#define _INC_COMMDLG
+
+#ifndef RC_INVOKED
+#pragma pack(1) /* Assume byte packing throughout */
+#endif /* !RC_INVOKED */
+
+#ifdef __cplusplus
+extern "C" { /* Assume C declarations for C++ */
+#endif /* __cplusplus */
+
+#ifndef WINAPI /* If not included with 3.1 headers... */
+#define WINAPI FAR PASCAL
+#define CALLBACK FAR PASCAL
+#define LPCSTR LPSTR
+#define UINT WORD
+#define LPARAM LONG
+#define WPARAM WORD
+#define LRESULT LONG
+#define HMODULE HANDLE
+#define HINSTANCE HANDLE
+#define HLOCAL HANDLE
+#define HGLOBAL HANDLE
+#endif /* _INC_WINDOWS */
+
+typedef struct tagOFN
+{
+ DWORD lStructSize;
+ HWND hwndOwner;
+ HINSTANCE hInstance;
+ LPCSTR lpstrFilter;
+ LPSTR lpstrCustomFilter;
+ DWORD nMaxCustFilter;
+ DWORD nFilterIndex;
+ LPSTR lpstrFile;
+ DWORD nMaxFile;
+ LPSTR lpstrFileTitle;
+ DWORD nMaxFileTitle;
+ LPCSTR lpstrInitialDir;
+ LPCSTR lpstrTitle;
+ DWORD Flags;
+ UINT nFileOffset;
+ UINT nFileExtension;
+ LPCSTR lpstrDefExt;
+ LPARAM lCustData;
+ UINT (CALLBACK *lpfnHook)(HWND, UINT, WPARAM, LPARAM);
+ LPCSTR lpTemplateName;
+} OPENFILENAME;
+typedef OPENFILENAME FAR* LPOPENFILENAME;
+
+BOOL WINAPI GetOpenFileName(OPENFILENAME FAR*);
+BOOL WINAPI GetSaveFileName(OPENFILENAME FAR*);
+int WINAPI GetFileTitle(LPCSTR, LPSTR, UINT);
+
+#define OFN_READONLY 0x00000001
+#define OFN_OVERWRITEPROMPT 0x00000002
+#define OFN_HIDEREADONLY 0x00000004
+#define OFN_NOCHANGEDIR 0x00000008
+#define OFN_SHOWHELP 0x00000010
+#define OFN_ENABLEHOOK 0x00000020
+#define OFN_ENABLETEMPLATE 0x00000040
+#define OFN_ENABLETEMPLATEHANDLE 0x00000080
+#define OFN_NOVALIDATE 0x00000100
+#define OFN_ALLOWMULTISELECT 0x00000200
+#define OFN_EXTENSIONDIFFERENT 0x00000400
+#define OFN_PATHMUSTEXIST 0x00000800
+#define OFN_FILEMUSTEXIST 0x00001000
+#define OFN_CREATEPROMPT 0x00002000
+#define OFN_SHAREAWARE 0x00004000
+#define OFN_NOREADONLYRETURN 0x00008000
+#define OFN_NOTESTFILECREATE 0x00010000
+
+/* Return values for the registered message sent to the hook function
+ * when a sharing violation occurs. OFN_SHAREFALLTHROUGH allows the
+ * filename to be accepted, OFN_SHARENOWARN rejects the name but puts
+ * up no warning (returned when the app has already put up a warning
+ * message), and OFN_SHAREWARN puts up the default warning message
+ * for sharing violations.
+ *
+ * Note: Undefined return values map to OFN_SHAREWARN, but are
+ * reserved for future use.
+ */
+
+#define OFN_SHAREFALLTHROUGH 2
+#define OFN_SHARENOWARN 1
+#define OFN_SHAREWARN 0
+
+typedef struct tagCHOOSECOLOR
+{
+ DWORD lStructSize;
+ HWND hwndOwner;
+ HWND hInstance;
+ COLORREF rgbResult;
+ COLORREF FAR* lpCustColors;
+ DWORD Flags;
+ LPARAM lCustData;
+ UINT (CALLBACK* lpfnHook)(HWND, UINT, WPARAM, LPARAM);
+ LPCSTR lpTemplateName;
+} CHOOSECOLOR;
+typedef CHOOSECOLOR FAR *LPCHOOSECOLOR;
+
+BOOL WINAPI ChooseColor(CHOOSECOLOR FAR*);
+
+#define CC_RGBINIT 0x00000001
+#define CC_FULLOPEN 0x00000002
+#define CC_PREVENTFULLOPEN 0x00000004
+#define CC_SHOWHELP 0x00000008
+#define CC_ENABLEHOOK 0x00000010
+#define CC_ENABLETEMPLATE 0x00000020
+#define CC_ENABLETEMPLATEHANDLE 0x00000040
+
+typedef struct tagFINDREPLACE
+{
+ DWORD lStructSize; /* size of this struct 0x20 */
+ HWND hwndOwner; /* handle to owner's window */
+ HINSTANCE hInstance; /* instance handle of.EXE that
+ * contains cust. dlg. template
+ */
+ DWORD Flags; /* one or more of the FR_?? */
+ LPSTR lpstrFindWhat; /* ptr. to search string */
+ LPSTR lpstrReplaceWith; /* ptr. to replace string */
+ UINT wFindWhatLen; /* size of find buffer */
+ UINT wReplaceWithLen; /* size of replace buffer */
+ LPARAM lCustData; /* data passed to hook fn. */
+ UINT (CALLBACK* lpfnHook)(HWND, UINT, WPARAM, LPARAM);
+ /* ptr. to hook fn. or NULL */
+ LPCSTR lpTemplateName; /* custom template name */
+} FINDREPLACE;
+typedef FINDREPLACE FAR *LPFINDREPLACE;
+
+#define FR_DOWN 0x00000001
+#define FR_WHOLEWORD 0x00000002
+#define FR_MATCHCASE 0x00000004
+#define FR_FINDNEXT 0x00000008
+#define FR_REPLACE 0x00000010
+#define FR_REPLACEALL 0x00000020
+#define FR_DIALOGTERM 0x00000040
+#define FR_SHOWHELP 0x00000080
+#define FR_ENABLEHOOK 0x00000100
+#define FR_ENABLETEMPLATE 0x00000200
+#define FR_NOUPDOWN 0x00000400
+#define FR_NOMATCHCASE 0x00000800
+#define FR_NOWHOLEWORD 0x00001000
+#define FR_ENABLETEMPLATEHANDLE 0x00002000
+#define FR_HIDEUPDOWN 0x00004000
+#define FR_HIDEMATCHCASE 0x00008000
+#define FR_HIDEWHOLEWORD 0x00010000
+
+HWND WINAPI FindText(FINDREPLACE FAR*);
+HWND WINAPI ReplaceText(FINDREPLACE FAR*);
+
+typedef struct tagCHOOSEFONT
+{
+ DWORD lStructSize; /* */
+ HWND hwndOwner; /* caller's window handle */
+ HDC hDC; /* printer DC/IC or NULL */
+ LOGFONT FAR* lpLogFont; /* ptr. to a LOGFONT struct */
+ int iPointSize; /* 10 * size in points of selected font */
+ DWORD Flags; /* enum. type flags */
+ COLORREF rgbColors; /* returned text color */
+ LPARAM lCustData; /* data passed to hook fn. */
+ UINT (CALLBACK* lpfnHook)(HWND, UINT, WPARAM, LPARAM);
+ /* ptr. to hook function */
+ LPCSTR lpTemplateName; /* custom template name */
+ HINSTANCE hInstance; /* instance handle of.EXE that
+ * contains cust. dlg. template
+ */
+ LPSTR lpszStyle; /* return the style field here
+ * must be LF_FACESIZE or bigger */
+ UINT nFontType; /* same value reported to the EnumFonts
+ * call back with the extra FONTTYPE_
+ * bits added */
+ int nSizeMin; /* minimum pt size allowed & */
+ int nSizeMax; /* max pt size allowed if */
+ /* CF_LIMITSIZE is used */
+} CHOOSEFONT;
+typedef CHOOSEFONT FAR *LPCHOOSEFONT;
+
+BOOL WINAPI ChooseFont(CHOOSEFONT FAR*);
+
+#define CF_SCREENFONTS 0x00000001
+#define CF_PRINTERFONTS 0x00000002
+#define CF_BOTH (CF_SCREENFONTS | CF_PRINTERFONTS)
+#define CF_SHOWHELP 0x00000004L
+#define CF_ENABLEHOOK 0x00000008L
+#define CF_ENABLETEMPLATE 0x00000010L
+#define CF_ENABLETEMPLATEHANDLE 0x00000020L
+#define CF_INITTOLOGFONTSTRUCT 0x00000040L
+#define CF_USESTYLE 0x00000080L
+#define CF_EFFECTS 0x00000100L
+#define CF_APPLY 0x00000200L
+#define CF_ANSIONLY 0x00000400L
+#define CF_NOVECTORFONTS 0x00000800L
+#define CF_NOOEMFONTS CF_NOVECTORFONTS
+#define CF_NOSIMULATIONS 0x00001000L
+#define CF_LIMITSIZE 0x00002000L
+#define CF_FIXEDPITCHONLY 0x00004000L
+#define CF_WYSIWYG 0x00008000L /* must also have CF_SCREENFONTS & CF_PRINTERFONTS */
+#define CF_FORCEFONTEXIST 0x00010000L
+#define CF_SCALABLEONLY 0x00020000L
+#define CF_TTONLY 0x00040000L
+#define CF_NOFACESEL 0x00080000L
+#define CF_NOSTYLESEL 0x00100000L
+#define CF_NOSIZESEL 0x00200000L
+
+/* these are extra nFontType bits that are added to what is returned to the
+ * EnumFonts callback routine */
+
+#define SIMULATED_FONTTYPE 0x8000
+#define PRINTER_FONTTYPE 0x4000
+#define SCREEN_FONTTYPE 0x2000
+#define BOLD_FONTTYPE 0x0100
+#define ITALIC_FONTTYPE 0x0200
+#define REGULAR_FONTTYPE 0x0400
+
+#define WM_CHOOSEFONT_GETLOGFONT (WM_USER + 1)
+
+
+/* strings used to obtain unique window message for communication
+ * between dialog and caller
+ */
+#define LBSELCHSTRING "commdlg_LBSelChangedNotify"
+#define SHAREVISTRING "commdlg_ShareViolation"
+#define FILEOKSTRING "commdlg_FileNameOK"
+#define COLOROKSTRING "commdlg_ColorOK"
+#define SETRGBSTRING "commdlg_SetRGBColor"
+#define FINDMSGSTRING "commdlg_FindReplace"
+#define HELPMSGSTRING "commdlg_help"
+
+/* HIWORD values for lParam of commdlg_LBSelChangeNotify message */
+#define CD_LBSELNOITEMS -1
+#define CD_LBSELCHANGE 0
+#define CD_LBSELSUB 1
+#define CD_LBSELADD 2
+
+typedef struct tagPD
+{
+ DWORD lStructSize;
+ HWND hwndOwner;
+ HGLOBAL hDevMode;
+ HGLOBAL hDevNames;
+ HDC hDC;
+ DWORD Flags;
+ UINT nFromPage;
+ UINT nToPage;
+ UINT nMinPage;
+ UINT nMaxPage;
+ UINT nCopies;
+ HINSTANCE hInstance;
+ LPARAM lCustData;
+ UINT (CALLBACK* lpfnPrintHook)(HWND, UINT, WPARAM, LPARAM);
+ UINT (CALLBACK* lpfnSetupHook)(HWND, UINT, WPARAM, LPARAM);
+ LPCSTR lpPrintTemplateName;
+ LPCSTR lpSetupTemplateName;
+ HGLOBAL hPrintTemplate;
+ HGLOBAL hSetupTemplate;
+} PRINTDLG;
+typedef PRINTDLG FAR* LPPRINTDLG;
+
+BOOL WINAPI PrintDlg(PRINTDLG FAR*);
+
+#define PD_ALLPAGES 0x00000000
+#define PD_SELECTION 0x00000001
+#define PD_PAGENUMS 0x00000002
+#define PD_NOSELECTION 0x00000004
+#define PD_NOPAGENUMS 0x00000008
+#define PD_COLLATE 0x00000010
+#define PD_PRINTTOFILE 0x00000020
+#define PD_PRINTSETUP 0x00000040
+#define PD_NOWARNING 0x00000080
+#define PD_RETURNDC 0x00000100
+#define PD_RETURNIC 0x00000200
+#define PD_RETURNDEFAULT 0x00000400
+#define PD_SHOWHELP 0x00000800
+#define PD_ENABLEPRINTHOOK 0x00001000
+#define PD_ENABLESETUPHOOK 0x00002000
+#define PD_ENABLEPRINTTEMPLATE 0x00004000
+#define PD_ENABLESETUPTEMPLATE 0x00008000
+#define PD_ENABLEPRINTTEMPLATEHANDLE 0x00010000
+#define PD_ENABLESETUPTEMPLATEHANDLE 0x00020000
+#define PD_USEDEVMODECOPIES 0x00040000
+#define PD_DISABLEPRINTTOFILE 0x00080000
+#define PD_HIDEPRINTTOFILE 0x00100000
+
+typedef struct tagDEVNAMES
+{
+ UINT wDriverOffset;
+ UINT wDeviceOffset;
+ UINT wOutputOffset;
+ UINT wDefault;
+} DEVNAMES;
+typedef DEVNAMES FAR* LPDEVNAMES;
+
+#define DN_DEFAULTPRN 0x0001
+
+DWORD WINAPI CommDlgExtendedError(void);
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#ifndef RC_INVOKED
+#pragma pack()
+#endif /* !RC_INVOKED */
+
+#endif /* !_INC_COMMDLG */
diff --git a/private/mvdm/wow16/inc/common.ver b/private/mvdm/wow16/inc/common.ver
new file mode 100644
index 000000000..45a4eccd3
--- /dev/null
+++ b/private/mvdm/wow16/inc/common.ver
@@ -0,0 +1,101 @@
+
+/*---------------------------------------------------------------*/
+/* */
+/* The following section actually creates the version structure. */
+/* They are ignored if we are not being invoked by RC. */
+/* */
+/* VERSION.H must be included before including this file */
+/* */
+/* If VER_LEGALCOPYRIGHT_STR is not defined, it will be */
+/* constructed using VER_LEGALCOPYRIGHT_YEARS. */
+/* */
+/* VER_FILETYPE, VER_FILESUBTYPE, VER_FILEDESCRIPTION_STR, and */
+/* VER_INTERNALNAME_STR must be defined before including this */
+/* file. */
+/* */
+/* If VER_FILEVERSION is not defined, VER_PRODUCTVERSION will be */
+/* used instead. If VER_FILEVERSION_STR is not defined, */
+/* VER_PRODUCTVERSION_STR will be used instead. */
+/* */
+/* If VER_ORIGINALFILENAME_STR is not defined, it is set to */
+/* the NULL string. */
+/* */
+/* If INTL is defined, then this is assumed to be an */
+/* an international build; two string blocks will be created, */
+/* (since all version resources must have English), and the */
+/* second one can be localized */
+/* */
+/*---------------------------------------------------------------*/
+
+#ifdef RC_INVOKED
+
+#ifndef VER_LEGALCOPYRIGHT_YEARS
+#define VER_LEGALCOPYRIGHT_YEARS "1981-1996"
+#endif
+
+#ifndef VER_LEGALCOPYRIGHT_STR
+#define VER_LEGALCOPYRIGHT_STR "Copyright \251 Microsoft Corp. ", VER_LEGALCOPYRIGHT_YEARS, "\0"
+#endif
+
+#ifndef VER_FILEVERSION
+#define VER_FILEVERSION VER_PRODUCTVERSION
+#endif
+
+#ifndef VER_FILEVERSION_STR
+#define VER_FILEVERSION_STR VER_PRODUCTVERSION_STR
+#endif
+
+#ifndef VER_ORIGINALFILENAME_STR
+#define VER_ORIGINALFILENAME_STR "\0"
+#endif
+
+#define VER_WOWVERSION_STR "4.0"
+
+VS_VERSION_INFO VERSIONINFO
+FILEVERSION VER_FILEVERSION
+PRODUCTVERSION VER_PRODUCTVERSION
+FILEFLAGSMASK VER_FILEFLAGSMASK
+FILEFLAGS VER_FILEFLAGS
+FILEOS VER_FILEOS
+FILETYPE VER_FILETYPE
+FILESUBTYPE VER_FILESUBTYPE
+BEGIN
+ BLOCK "StringFileInfo"
+ BEGIN
+ BLOCK "040904E4"
+ BEGIN
+ VALUE "CompanyName", VER_COMPANYNAME_STR, "\0"
+ VALUE "FileDescription", VER_FILEDESCRIPTION_STR, "\0"
+ VALUE "FileVersion", VER_FILEVERSION_STR, "\0"
+ VALUE "InternalName", VER_INTERNALNAME_STR, "\0"
+ VALUE "LegalCopyright", VER_LEGALCOPYRIGHT_STR, "\0"
+ VALUE "OriginalFilename",VER_ORIGINALFILENAME_STR, "\0"
+ VALUE "ProductName", VER_PRODUCTNAME_STR, "\0"
+ VALUE "ProductVersion", VER_PRODUCTVERSION_STR, "\0"
+ VALUE "WOW Version", VER_WOWVERSION_STR, "\0"
+ END
+
+#ifdef INTL
+ BLOCK "040904E4"
+ BEGIN
+ VALUE "CompanyName", VER_COMPANYNAME_STR, "\0"
+ VALUE "FileDescription", VER_FILEDESCRIPTION_STR, "\0"
+ VALUE "FileVersion", VER_FILEVERSION_STR, "\0"
+ VALUE "InternalName", VER_INTERNALNAME_STR, "\0"
+ VALUE "LegalCopyright", VER_LEGALCOPYRIGHT_STR, "\0"
+ VALUE "OriginalFilename",VER_ORIGINALFILENAME_STR, "\0"
+ VALUE "ProductName", VER_PRODUCTNAME_STR, "\0"
+ VALUE "ProductVersion", VER_PRODUCTVERSION_STR, "\0"
+ VALUE "WOW Version", VER_WOWVERSION_STR, "\0"
+ END
+#endif
+ END
+
+ BLOCK "VarFileInfo"
+ BEGIN
+ /* the following line should be extended for localized versions */
+ VALUE "Translation", 0x0409, 0x04E4
+ END
+END
+
+#endif
diff --git a/private/mvdm/wow16/inc/convdll.inc b/private/mvdm/wow16/inc/convdll.inc
new file mode 100644
index 000000000..e17ff44a1
--- /dev/null
+++ b/private/mvdm/wow16/inc/convdll.inc
@@ -0,0 +1,58 @@
+WLOINITDLL macro
+ local cd_start, cd_patch, cd_init, WIN_NOP, WIN_PPLI
+ local cd_end
+ EXTRN GETMODULEUSAGE:FAR
+ EXTRN INITTASK:FAR
+ EXTRN __WINFLAGS:abs
+
+cd_start:
+ push ax
+ push bx
+ push cx
+ push dx
+ push es
+
+ mov ax, __WINFLAGS
+ or ax,ax
+ jns WIN_NOP
+
+ pop es
+ pop dx
+ pop cx
+ pop bx
+ pop ax
+ call INITTASK-5
+cd_patch:
+ jmp short cd_init
+ nop
+ xor ax, ax
+ retf
+cd_init: jmp short cd_end
+
+WIN_NOP:
+ jmp short WIN_PPLI
+ jmp short WIN_PPLI
+ push di
+ call GETMODULEUSAGE
+ dec ax
+ jz WIN_PPLI
+ inc ax
+ add sp,10
+ retf
+
+WIN_PPLI:
+ pop es
+ pop dx
+ pop cx
+ pop bx
+ pop ax
+ jmp short cd_end
+ db "C", "D", "D", 1, 0
+ dw cd_patch - cd_start
+ dw WIN_NOP - cd_start
+ dw cd_end - cd_start
+cd_end:
+
+endm
+ WLOINITDLL
+ \ No newline at end of file
diff --git a/private/mvdm/wow16/inc/cpl.h b/private/mvdm/wow16/inc/cpl.h
new file mode 100644
index 000000000..0e8065ad5
--- /dev/null
+++ b/private/mvdm/wow16/inc/cpl.h
@@ -0,0 +1,159 @@
+/*****************************************************************************\
+* *
+* cpl.h - Control panel extension DLL definitions *
+* *
+* Version 3.10 *
+* *
+* Copyright (c) 1992, Microsoft Corp. All rights reserved *
+* *
+******************************************************************************
+* General rules for being installed in the Control Panel:
+*
+* 1) The DLL must export a function named CPlApplet which will handle
+* the messages discussed below.
+* 2) If the applet needs to save information in CONTROL.INI minimize
+* clutter by using the application name [MMCPL.appletname].
+* 2) If the applet is refrenced in CONTROL.INI under [MMCPL] use
+* the following form:
+* ...
+* [MMCPL]
+* uniqueName=c:\mydir\myapplet.dll
+* ...
+*
+*
+* The order applet DLL's are loaded by CONTROL.EXE is:
+*
+* 1) MAIN.CPL is loaded from the windows system directory.
+*
+* 2) Installable drivers that are loaded and export the
+* CplApplet() routine.
+*
+* 3) DLL's specified in the [MMCPL] section of CONTROL.INI.
+*
+* 4) DLL's named *.CPL from windows system directory.
+*
+*/
+#ifndef _INC_CPL
+#define _INC_CPL
+
+#ifndef RC_INVOKED
+#pragma pack(1) /* Assume byte packing throughout */
+#endif /* RC_INVOKED */
+
+#ifdef __cplusplus
+extern "C" { /* Assume C declarations for C++ */
+#endif /* __cplusplus */
+
+/*
+ * CONTROL.EXE will answer this message and launch an applet
+ *
+ * WM_CPL_LAUNCH
+ *
+ * wParam - window handle of calling app
+ * lParam - LPSTR of name of applet to launch
+ *
+ * WM_CPL_LAUNCHED
+ *
+ * wParam - TRUE/FALSE if applet was launched
+ * lParam - NULL
+ *
+ * CONTROL.EXE will post this message to the caller when the applet returns
+ * (ie., when wParam is a valid window handle)
+ *
+ */
+#define WM_CPL_LAUNCH (WM_USER+1000)
+#define WM_CPL_LAUNCHED (WM_USER+1001)
+
+/* A function prototype for CPlApplet() */
+
+typedef LRESULT (CALLBACK *APPLET_PROC)(HWND hwndCpl, UINT msg, LPARAM lParam1, LPARAM lParam2);
+
+/* The data structure CPlApplet() must fill in. */
+
+typedef struct tagCPLINFO
+{
+ int idIcon; /* icon resource id, provided by CPlApplet() */
+ int idName; /* name string res. id, provided by CPlApplet() */
+ int idInfo; /* info string res. id, provided by CPlApplet() */
+ LONG lData; /* user defined data */
+} CPLINFO, *PCPLINFO, FAR *LPCPLINFO;
+
+typedef struct tagNEWCPLINFO
+{
+ DWORD dwSize; /* similar to the commdlg */
+ DWORD dwFlags;
+ DWORD dwHelpContext; /* help context to use */
+ LONG lData; /* user defined data */
+ HICON hIcon; /* icon to use, this is owned by CONTROL.EXE (may be deleted) */
+ char szName[32]; /* short name */
+ char szInfo[64]; /* long name (status line) */
+ char szHelpFile[128];/* path to help file to use */
+} NEWCPLINFO, *PNEWCPLINFO, FAR *LPNEWCPLINFO;
+
+
+/* The messages CPlApplet() must handle: */
+
+#define CPL_INIT 1
+/* This message is sent to indicate CPlApplet() was found. */
+/* lParam1 and lParam2 are not defined. */
+/* Return TRUE or FALSE indicating whether the control panel should proceed. */
+
+
+#define CPL_GETCOUNT 2
+/* This message is sent to determine the number of applets to be displayed. */
+/* lParam1 and lParam2 are not defined. */
+/* Return the number of applets you wish to display in the control */
+/* panel window. */
+
+
+#define CPL_INQUIRE 3
+/* This message is sent for information about each applet. */
+/* lParam1 is the applet number to register, a value from 0 to */
+/* (CPL_GETCOUNT - 1). lParam2 is a far ptr to a CPLINFO structure. */
+/* Fill in CPL_INFO's idIcon, idName, idInfo and lData fields with */
+/* the resource id for an icon to display, name and description string ids, */
+/* and a long data item associated with applet #lParam1. */
+
+
+#define CPL_SELECT 4
+/* This message is sent when the applet's icon has been clicked upon. */
+/* lParam1 is the applet number which was selected. lParam2 is the */
+/* applet's lData value. */
+
+
+#define CPL_DBLCLK 5
+/* This message is sent when the applet's icon has been double-clicked */
+/* upon. lParam1 is the applet number which was selected. lParam2 is the */
+/* applet's lData value. */
+/* This message should initiate the applet's dialog box. */
+
+
+#define CPL_STOP 6
+/* This message is sent for each applet when the control panel is exiting. */
+/* lParam1 is the applet number. lParam2 is the applet's lData value. */
+/* Do applet specific cleaning up here. */
+
+
+#define CPL_EXIT 7
+/* This message is sent just before the control panel calls FreeLibrary. */
+/* lParam1 and lParam2 are not defined. */
+/* Do non-applet specific cleaning up here. */
+
+
+#define CPL_NEWINQUIRE 8
+/* this is the same as CPL_INQUIRE execpt lParam2 is a pointer to a */
+/* NEWCPLINFO structure. this will be sent before the CPL_INQUIRE */
+/* and if it is responed to (return != 0) CPL_INQUIRE will not be sent */
+
+#define CPL_DO_PRINTER_SETUP 100 /* ;Internal */
+#define CPL_DO_NETPRN_SETUP 101 /* ;Internal */
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#ifndef RC_INVOKED
+#pragma pack()
+#endif /* RC_INVOKED */
+
+#endif /* _INC_CPL */
diff --git a/private/mvdm/wow16/inc/custcntl.h b/private/mvdm/wow16/inc/custcntl.h
new file mode 100644
index 000000000..be3d02af1
--- /dev/null
+++ b/private/mvdm/wow16/inc/custcntl.h
@@ -0,0 +1,105 @@
+/*****************************************************************************\
+* *
+* custcntl.h - Custom Control Library header file *
+* *
+* Copyright (c) 1992, Microsoft Corp. All rights reserved *
+* *
+\*****************************************************************************/
+
+#ifndef _INC_CUSTCNTL
+#define _INC_CUSTCNTL
+
+#ifndef RC_INVOKED
+#pragma pack(1) /* Assume byte packing throughout */
+#endif /* RC_INVOKED */
+
+#ifdef __cplusplus
+extern "C" { /* Assume C declarations for C++ */
+#endif /* __cplusplus */
+
+/*
+ * Every custom control DLL must have three functions present,
+ * and they must be exported by the following ordinals.
+ */
+#define CCINFOORD 2 /* information function ordinal */
+#define CCSTYLEORD 3 /* styles function ordinal */
+#define CCFLAGSORD 4 /* translate flags function ordinal */
+
+/* general size definitions */
+#define CTLTYPES 12 /* max number of control types */
+#define CTLDESCR 22 /* max size of description */
+#define CTLCLASS 20 /* max size of class name */
+#define CTLTITLE 94 /* max size of control text */
+
+/*
+ * CONTROL STYLE DATA STRUCTURE
+ *
+ * This data structure is used by the class style dialog function
+ * to set and/or reset various control attributes.
+ *
+ */
+typedef struct tagCTLSTYLE
+{
+ UINT wX; /* x origin of control */
+ UINT wY; /* y origin of control */
+ UINT wCx; /* width of control */
+ UINT wCy; /* height of control */
+ UINT wId; /* control child id */
+ DWORD dwStyle; /* control style */
+ char szClass[CTLCLASS]; /* name of control class */
+ char szTitle[CTLTITLE]; /* control text */
+} CTLSTYLE;
+typedef CTLSTYLE * PCTLSTYLE;
+typedef CTLSTYLE FAR* LPCTLSTYLE;
+
+/*
+ * CONTROL DATA STRUCTURE
+ *
+ * This data structure is returned by the control options function
+ * when inquiring about the capabilities of a particular control.
+ * Each control may contain various types (with predefined style
+ * bits) under one general class.
+ *
+ * The width and height fields are used to provide the host
+ * application with a suggested size. The values in these fields
+ * are in rc coordinates.
+ *
+ */
+typedef struct tagCTLTYPE
+{
+ UINT wType; /* type style */
+ UINT wWidth; /* suggested width */
+ UINT wHeight; /* suggested height */
+ DWORD dwStyle; /* default style */
+ char szDescr[CTLDESCR]; /* description */
+} CTLTYPE;
+
+typedef struct tagCTLINFO
+{
+ UINT wVersion; /* control version */
+ UINT wCtlTypes; /* control types */
+ char szClass[CTLCLASS]; /* control class name */
+ char szTitle[CTLTITLE]; /* control title */
+ char szReserved[10]; /* reserved for future use */
+ CTLTYPE Type[CTLTYPES]; /* control type list */
+} CTLINFO;
+typedef CTLINFO * PCTLINFO;
+typedef CTLINFO FAR* LPCTLINFO;
+
+/* These two function prototypes are used by the dialog editor */
+#ifdef STRICT
+typedef DWORD (CALLBACK* LPFNSTRTOID)(LPCSTR);
+#else
+typedef DWORD (CALLBACK* LPFNSTRTOID)(LPSTR);
+#endif
+typedef UINT (CALLBACK* LPFNIDTOSTR)(UINT, LPSTR, UINT);
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#ifndef RC_INVOKED
+#pragma pack()
+#endif /* RC_INVOKED */
+
+#endif /* _INC_CUSTCNTL */
diff --git a/private/mvdm/wow16/inc/dbcs.c b/private/mvdm/wow16/inc/dbcs.c
new file mode 100644
index 000000000..34413cf8f
--- /dev/null
+++ b/private/mvdm/wow16/inc/dbcs.c
@@ -0,0 +1,115 @@
+/*
+** dbcs.c - DBCS functions for DOS apps.
+**
+** Written by RokaH and DavidDi.
+*/
+
+
+/* Headers
+**********/
+
+#include <dos.h>
+#include <ctype.h>
+
+#include <dbcs.h>
+
+
+/*
+** int IsDBCSLeadByte(unsigned char uch);
+**
+** Check to see if a character is a DBCS lead byte.
+**
+** Arguments: uch - charcter to examine
+**
+** Returns: int - 1 if the character is a DBCS lead byte. 0 if not.
+**
+** Globals: none
+*/
+int IsDBCSLeadByte(unsigned char uch)
+{
+ static unsigned char far *DBCSLeadByteTable = 0;
+ union REGS inregs, outregs;
+ struct SREGS segregs;
+ unsigned char far *puch;
+
+ if (DBCSLeadByteTable == 0)
+ {
+ /*
+ ** Get DBCS lead byte table. This function has been supported since
+ ** DBCS MS-DOS 2.21.
+ */
+ inregs.x.ax = 0x6300;
+ intdosx(&inregs, &outregs, &segregs);
+
+ FP_OFF(DBCSLeadByteTable) = outregs.x.si;
+ FP_SEG(DBCSLeadByteTable) = segregs.ds;
+ }
+
+ /* See if the given byte is in any of the table's lead byte ranges. */
+ for (puch = DBCSLeadByteTable; puch[0] || puch[1]; puch += 2)
+ if (uch >= puch[0] && uch <= puch[1])
+ return(1);
+
+ return(0);
+}
+
+
+/*
+** unsigned char *AnsiNext(unsigned char *puch);
+**
+** Moves to the next character in a string.
+**
+** Arguments: puch - pointer to current location in string
+**
+** Returns: char * - Pointer to next character in string.
+**
+** Globals: none
+**
+** N.b., if puch points to a null character, AnsiNext() will return puch.
+*/
+unsigned char far *AnsiNext(unsigned char far *puch)
+{
+ if (*puch == '\0')
+ return(puch);
+ else if (IsDBCSLeadByte(*puch))
+ puch++;
+
+ puch++;
+
+ return(puch);
+}
+
+
+/*
+** unsigned char *AnsiPrev(unsigned char *psz, unsigned char *puch);
+**
+** Moves back one character in a string.
+**
+** Arguments: psz - pointer to start of string
+** puch - pointer to current location in string
+**
+** Returns: char * - Pointer to previous character in string.
+**
+** Globals: none
+**
+** N.b., if puch <= psz, AnsiPrev() will return psz.
+**
+** This function is implemented in a very slow fashion because we do not wish
+** to trust that the given string is necessarily DBCS "safe," i.e., contains
+** only single-byte characters and valid DBCS characters. So we start from
+** the beginning of the string and work our way forward.
+*/
+unsigned char far *AnsiPrev(unsigned char far *psz, unsigned char far *puch)
+{
+ unsigned char far *puchPrevious;
+
+ do
+ {
+ puchPrevious = psz;
+ psz = AnsiNext(psz);
+ } while (*psz != '\0' && psz < puch);
+
+ return(puchPrevious);
+}
+
+
diff --git a/private/mvdm/wow16/inc/dbcs.h b/private/mvdm/wow16/inc/dbcs.h
new file mode 100644
index 000000000..6f92bdd48
--- /dev/null
+++ b/private/mvdm/wow16/inc/dbcs.h
@@ -0,0 +1,7 @@
+/*
+** dbcs.h - DBCS functions prototypes for DOS apps.
+*/
+
+extern int IsDBCSLeadByte(unsigned char uch);
+extern unsigned char far *AnsiNext(unsigned char far *puch);
+extern unsigned char far *AnsiPrev(unsigned char far *psz, unsigned char far *puch);
diff --git a/private/mvdm/wow16/inc/dde.h b/private/mvdm/wow16/inc/dde.h
new file mode 100644
index 000000000..26aa0139b
--- /dev/null
+++ b/private/mvdm/wow16/inc/dde.h
@@ -0,0 +1,146 @@
+/*****************************************************************************\
+* *
+* dde.h - Dynamic Data Exchange structures and definitions *
+* *
+* Copyright (c) 1992, Microsoft Corp. All rights reserved *
+* *
+\*****************************************************************************/
+
+#ifndef _INC_DDE
+#define _INC_DDE
+
+#ifndef RC_INVOKED
+#pragma pack(1) /* Assume byte packing throughout */
+#endif /* RC_INVOKED */
+
+#ifdef __cplusplus
+extern "C" { /* Assume C declarations for C++ */
+#endif /* __cplusplus */
+
+/* DDE window messages */
+
+#define WM_DDE_FIRST 0x03E0
+#define WM_DDE_INITIATE (WM_DDE_FIRST)
+#define WM_DDE_TERMINATE (WM_DDE_FIRST+1)
+#define WM_DDE_ADVISE (WM_DDE_FIRST+2)
+#define WM_DDE_UNADVISE (WM_DDE_FIRST+3)
+#define WM_DDE_ACK (WM_DDE_FIRST+4)
+#define WM_DDE_DATA (WM_DDE_FIRST+5)
+#define WM_DDE_REQUEST (WM_DDE_FIRST+6)
+#define WM_DDE_POKE (WM_DDE_FIRST+7)
+#define WM_DDE_EXECUTE (WM_DDE_FIRST+8)
+#define WM_DDE_LAST (WM_DDE_FIRST+8)
+
+/****************************************************************************\
+* DDEACK structure
+*
+* Structure of wStatus (LOWORD(lParam)) in WM_DDE_ACK message
+* sent in response to a WM_DDE_DATA, WM_DDE_REQUEST, WM_DDE_POKE,
+* WM_DDE_ADVISE, or WM_DDE_UNADVISE message.
+*
+\****************************************************************************/
+
+typedef struct tagDDEACK
+{
+ WORD bAppReturnCode:8,
+ reserved:6,
+ fBusy:1,
+ fAck:1;
+} DDEACK;
+
+/****************************************************************************\
+* DDEADVISE structure
+*
+* WM_DDE_ADVISE parameter structure for hOptions (LOWORD(lParam))
+*
+\****************************************************************************/
+
+typedef struct tagDDEADVISE
+{
+ WORD reserved:14,
+ fDeferUpd:1,
+ fAckReq:1;
+ short cfFormat;
+} DDEADVISE;
+
+/****************************************************************************\
+* DDEDATA structure
+*
+* WM_DDE_DATA parameter structure for hData (LOWORD(lParam)).
+* The actual size of this structure depends on the size of
+* the Value array.
+*
+\****************************************************************************/
+
+typedef struct tagDDEDATA
+{
+ WORD unused:12,
+ fResponse:1,
+ fRelease:1,
+ reserved:1,
+ fAckReq:1;
+ short cfFormat;
+ BYTE Value[1];
+} DDEDATA;
+
+
+/****************************************************************************\
+* DDEPOKE structure
+*
+* WM_DDE_POKE parameter structure for hData (LOWORD(lParam)).
+* The actual size of this structure depends on the size of
+* the Value array.
+*
+\****************************************************************************/
+
+typedef struct tagDDEPOKE
+{
+ WORD unused:13, /* Earlier versions of DDE.H incorrectly */
+ /* 12 unused bits. */
+ fRelease:1,
+ fReserved:2;
+ short cfFormat;
+ BYTE Value[1]; /* This member was named rgb[1] in previous */
+ /* versions of DDE.H */
+
+} DDEPOKE;
+
+/****************************************************************************\
+* The following typedef's were used in previous versions of the Windows SDK.
+* They are still valid. The above typedef's define exactly the same structures
+* as those below. The above typedef names are recommended, however, as they
+* are more meaningful.
+*
+* Note that the DDEPOKE structure typedef'ed in earlier versions of DDE.H did
+* not correctly define the bit positions.
+\****************************************************************************/
+
+typedef struct tagDDELN
+{
+ WORD unused:13,
+ fRelease:1,
+ fDeferUpd:1,
+ fAckReq:1;
+ short cfFormat;
+} DDELN;
+
+typedef struct tagDDEUP
+{
+ WORD unused:12,
+ fAck:1,
+ fRelease:1,
+ fReserved:1,
+ fAckReq:1;
+ short cfFormat;
+ BYTE rgb[1];
+} DDEUP;
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#ifndef RC_INVOKED
+#pragma pack()
+#endif /* RC_INVOKED */
+
+#endif /* _INC_DDE */
diff --git a/private/mvdm/wow16/inc/ddeml.h b/private/mvdm/wow16/inc/ddeml.h
new file mode 100644
index 000000000..354cf72c8
--- /dev/null
+++ b/private/mvdm/wow16/inc/ddeml.h
@@ -0,0 +1,459 @@
+/*****************************************************************************\
+* *
+* ddeml.h - DDEML API header file *
+* *
+* Version 1.0 *
+* *
+* Copyright (c) 1992, Microsoft Corp. All rights reserved. *
+* *
+\*****************************************************************************/
+#ifndef _INC_DDEML
+#define _INC_DDEML
+
+#ifndef RC_INVOKED
+#pragma pack(1)
+#endif /* RC_INVOKED */
+
+#ifdef __cplusplus
+extern "C" { /* Assume C declarations for C++ */
+#endif /* __cplusplus */
+
+#ifndef _INC_WINDOWS /* If not included with 3.1 headers... */
+#define LPCSTR LPSTR
+#define WINAPI FAR PASCAL
+#define CALLBACK FAR PASCAL
+#define UINT WORD
+#define LPARAM LONG
+#define WPARAM WORD
+#define LRESULT LONG
+#define HMODULE HANDLE
+#define HINSTANCE HANDLE
+#define HLOCAL HANDLE
+#define HGLOBAL HANDLE
+#endif /* _INC_WINDOWS */
+
+#ifndef DECLARE_HANDLE32
+#ifdef STRICT
+#define DECLARE_HANDLE32(name) struct name##__ { int unused; }; \
+ typedef const struct name##__ _far* name
+#else /* STRICT */
+#define DECLARE_HANDLE32(name) typedef DWORD name
+#endif /* !STRICT */
+#endif /* !DECLARE_HANDLE32 */
+
+#define EXPENTRY WINAPI
+
+/******** public types ********/
+
+DECLARE_HANDLE32(HCONVLIST);
+DECLARE_HANDLE32(HCONV);
+DECLARE_HANDLE32(HSZ);
+DECLARE_HANDLE32(HDDEDATA);
+
+/* the following structure is for use with XTYP_WILDCONNECT processing. */
+
+typedef struct tagHSZPAIR
+{
+ HSZ hszSvc;
+ HSZ hszTopic;
+} HSZPAIR;
+typedef HSZPAIR FAR *PHSZPAIR;
+
+/* The following structure is used by DdeConnect() and DdeConnectList() and
+ by XTYP_CONNECT and XTYP_WILDCONNECT callbacks. */
+
+typedef struct tagCONVCONTEXT
+{
+ UINT cb; /* set to sizeof(CONVCONTEXT) */
+ UINT wFlags; /* none currently defined. */
+ UINT wCountryID; /* country code for topic/item strings used. */
+ int iCodePage; /* codepage used for topic/item strings. */
+ DWORD dwLangID; /* language ID for topic/item strings. */
+ DWORD dwSecurity; /* Private security code. */
+} CONVCONTEXT;
+typedef CONVCONTEXT FAR *PCONVCONTEXT;
+
+/* The following structure is used by DdeQueryConvInfo(): */
+
+typedef struct tagCONVINFO
+{
+ DWORD cb; /* sizeof(CONVINFO) */
+ DWORD hUser; /* user specified field */
+ HCONV hConvPartner; /* hConv on other end or 0 if non-ddemgr partner */
+ HSZ hszSvcPartner; /* app name of partner if obtainable */
+ HSZ hszServiceReq; /* AppName requested for connection */
+ HSZ hszTopic; /* Topic name for conversation */
+ HSZ hszItem; /* transaction item name or NULL if quiescent */
+ UINT wFmt; /* transaction format or NULL if quiescent */
+ UINT wType; /* XTYP_ for current transaction */
+ UINT wStatus; /* ST_ constant for current conversation */
+ UINT wConvst; /* XST_ constant for current transaction */
+ UINT wLastError; /* last transaction error. */
+ HCONVLIST hConvList; /* parent hConvList if this conversation is in a list */
+ CONVCONTEXT ConvCtxt; /* conversation context */
+ HWND hwnd; /* Added to allow access for NetDDE. */
+ HWND hwndPartner; /* Added to allow access for NetDDE. */
+} CONVINFO;
+typedef CONVINFO FAR *PCONVINFO;
+
+/***** conversation states (usState) *****/
+
+#define XST_NULL 0 /* quiescent states */
+#define XST_INCOMPLETE 1
+#define XST_CONNECTED 2
+#define XST_INIT1 3 /* mid-initiation states */
+#define XST_INIT2 4
+#define XST_REQSENT 5 /* active conversation states */
+#define XST_DATARCVD 6
+#define XST_POKESENT 7
+#define XST_POKEACKRCVD 8
+#define XST_EXECSENT 9
+#define XST_EXECACKRCVD 10
+#define XST_ADVSENT 11
+#define XST_UNADVSENT 12
+#define XST_ADVACKRCVD 13
+#define XST_UNADVACKRCVD 14
+#define XST_ADVDATASENT 15
+#define XST_ADVDATAACKRCVD 16
+
+/* used in LOWORD(dwData1) of XTYP_ADVREQ callbacks... */
+#define CADV_LATEACK 0xFFFF
+
+/***** conversation status bits (fsStatus) *****/
+
+#define ST_CONNECTED 0x0001
+#define ST_ADVISE 0x0002
+#define ST_ISLOCAL 0x0004
+#define ST_BLOCKED 0x0008
+#define ST_CLIENT 0x0010
+#define ST_TERMINATED 0x0020
+#define ST_INLIST 0x0040
+#define ST_BLOCKNEXT 0x0080
+#define ST_ISSELF 0x0100
+
+/* DDE constants for wStatus field */
+
+#define DDE_FACK 0x8000
+#define DDE_FBUSY 0x4000
+#define DDE_FDEFERUPD 0x4000
+#define DDE_FACKREQ 0x8000
+#define DDE_FRELEASE 0x2000
+#define DDE_FREQUESTED 0x1000
+#define DDE_FACKRESERVED 0x3ff0
+#define DDE_FADVRESERVED 0x3fff
+#define DDE_FDATRESERVED 0x4fff
+#define DDE_FPOKRESERVED 0xdfff
+#define DDE_FAPPSTATUS 0x00ff
+#define DDE_FNOTPROCESSED 0x0000
+
+/***** message filter hook types *****/
+
+#define MSGF_DDEMGR 0x8001
+
+/***** codepage constants ****/
+
+#define CP_WINANSI 1004 /* default codepage for windows & old DDE convs. */
+
+/***** transaction types *****/
+
+#define XTYPF_NOBLOCK 0x0002 /* CBR_BLOCK will not work */
+#define XTYPF_NODATA 0x0004 /* DDE_FDEFERUPD */
+#define XTYPF_ACKREQ 0x0008 /* DDE_FACKREQ */
+
+#define XCLASS_MASK 0xFC00
+#define XCLASS_BOOL 0x1000
+#define XCLASS_DATA 0x2000
+#define XCLASS_FLAGS 0x4000
+#define XCLASS_NOTIFICATION 0x8000
+
+#define XTYP_ERROR (0x0000 | XCLASS_NOTIFICATION | XTYPF_NOBLOCK )
+#define XTYP_ADVDATA (0x0010 | XCLASS_FLAGS )
+#define XTYP_ADVREQ (0x0020 | XCLASS_DATA | XTYPF_NOBLOCK )
+#define XTYP_ADVSTART (0x0030 | XCLASS_BOOL )
+#define XTYP_ADVSTOP (0x0040 | XCLASS_NOTIFICATION)
+#define XTYP_EXECUTE (0x0050 | XCLASS_FLAGS )
+#define XTYP_CONNECT (0x0060 | XCLASS_BOOL | XTYPF_NOBLOCK)
+#define XTYP_CONNECT_CONFIRM (0x0070 | XCLASS_NOTIFICATION | XTYPF_NOBLOCK)
+#define XTYP_XACT_COMPLETE (0x0080 | XCLASS_NOTIFICATION )
+#define XTYP_POKE (0x0090 | XCLASS_FLAGS )
+#define XTYP_REGISTER (0x00A0 | XCLASS_NOTIFICATION | XTYPF_NOBLOCK)
+#define XTYP_REQUEST (0x00B0 | XCLASS_DATA )
+#define XTYP_DISCONNECT (0x00C0 | XCLASS_NOTIFICATION | XTYPF_NOBLOCK)
+#define XTYP_UNREGISTER (0x00D0 | XCLASS_NOTIFICATION | XTYPF_NOBLOCK)
+#define XTYP_WILDCONNECT (0x00E0 | XCLASS_DATA | XTYPF_NOBLOCK)
+
+#define XTYP_MASK 0x00F0
+#define XTYP_SHIFT 4 /* shift to turn XTYP_ into an index */
+
+/***** Timeout constants *****/
+
+#define TIMEOUT_ASYNC -1L
+
+/***** Transaction ID constants *****/
+
+#define QID_SYNC -1L
+
+/****** public strings used in DDE ******/
+
+#define SZDDESYS_TOPIC "System"
+#define SZDDESYS_ITEM_TOPICS "Topics"
+#define SZDDESYS_ITEM_SYSITEMS "SysItems"
+#define SZDDESYS_ITEM_RTNMSG "ReturnMessage"
+#define SZDDESYS_ITEM_STATUS "Status"
+#define SZDDESYS_ITEM_FORMATS "Formats"
+#define SZDDESYS_ITEM_HELP "Help"
+#define SZDDE_ITEM_ITEMLIST "TopicItemList"
+
+
+/****** API entry points ******/
+
+typedef HDDEDATA CALLBACK FNCALLBACK(UINT wType, UINT wFmt, HCONV hConv,
+ HSZ hsz1, HSZ hsz2, HDDEDATA hData, DWORD dwData1, DWORD dwData2);
+typedef FNCALLBACK *PFNCALLBACK;
+
+#define CBR_BLOCK 0xffffffffL
+
+/* DLL registration functions */
+
+UINT WINAPI DdeInitialize(DWORD FAR* pidInst, PFNCALLBACK pfnCallback,
+ DWORD afCmd, DWORD ulRes);
+
+/*
+ * Callback filter flags for use with standard apps.
+ */
+
+#define CBF_FAIL_SELFCONNECTIONS 0x00001000
+#define CBF_FAIL_CONNECTIONS 0x00002000
+#define CBF_FAIL_ADVISES 0x00004000
+#define CBF_FAIL_EXECUTES 0x00008000
+#define CBF_FAIL_POKES 0x00010000
+#define CBF_FAIL_REQUESTS 0x00020000
+#define CBF_FAIL_ALLSVRXACTIONS 0x0003f000
+
+#define CBF_SKIP_CONNECT_CONFIRMS 0x00040000
+#define CBF_SKIP_REGISTRATIONS 0x00080000
+#define CBF_SKIP_UNREGISTRATIONS 0x00100000
+#define CBF_SKIP_DISCONNECTS 0x00200000
+#define CBF_SKIP_ALLNOTIFICATIONS 0x003c0000
+
+/*
+ * Application command flags
+ */
+#define APPCMD_CLIENTONLY 0x00000010L
+#define APPCMD_FILTERINITS 0x00000020L
+#define APPCMD_MASK 0x00000FF0L
+
+/*
+ * Application classification flags
+ */
+#define APPCLASS_STANDARD 0x00000000L
+#define APPCLASS_MASK 0x0000000FL
+
+
+BOOL WINAPI DdeUninitialize(DWORD idInst);
+
+/* conversation enumeration functions */
+
+HCONVLIST WINAPI DdeConnectList(DWORD idInst, HSZ hszService, HSZ hszTopic,
+ HCONVLIST hConvList, CONVCONTEXT FAR* pCC);
+HCONV WINAPI DdeQueryNextServer(HCONVLIST hConvList, HCONV hConvPrev);
+BOOL WINAPI DdeDisconnectList(HCONVLIST hConvList);
+
+/* conversation control functions */
+
+HCONV WINAPI DdeConnect(DWORD idInst, HSZ hszService, HSZ hszTopic,
+ CONVCONTEXT FAR* pCC);
+BOOL WINAPI DdeDisconnect(HCONV hConv);
+HCONV WINAPI DdeReconnect(HCONV hConv);
+
+UINT WINAPI DdeQueryConvInfo(HCONV hConv, DWORD idTransaction, CONVINFO FAR* pConvInfo);
+BOOL WINAPI DdeSetUserHandle(HCONV hConv, DWORD id, DWORD hUser);
+
+BOOL WINAPI DdeAbandonTransaction(DWORD idInst, HCONV hConv, DWORD idTransaction);
+
+
+/* app server interface functions */
+
+BOOL WINAPI DdePostAdvise(DWORD idInst, HSZ hszTopic, HSZ hszItem);
+BOOL WINAPI DdeEnableCallback(DWORD idInst, HCONV hConv, UINT wCmd);
+
+#define EC_ENABLEALL 0
+#define EC_ENABLEONE ST_BLOCKNEXT
+#define EC_DISABLE ST_BLOCKED
+#define EC_QUERYWAITING 2
+
+HDDEDATA WINAPI DdeNameService(DWORD idInst, HSZ hsz1, HSZ hsz2, UINT afCmd);
+
+#define DNS_REGISTER 0x0001
+#define DNS_UNREGISTER 0x0002
+#define DNS_FILTERON 0x0004
+#define DNS_FILTEROFF 0x0008
+
+/* app client interface functions */
+
+HDDEDATA WINAPI DdeClientTransaction(void FAR* pData, DWORD cbData,
+ HCONV hConv, HSZ hszItem, UINT wFmt, UINT wType,
+ DWORD dwTimeout, DWORD FAR* pdwResult);
+
+/* data transfer functions */
+
+HDDEDATA WINAPI DdeCreateDataHandle(DWORD idInst, void FAR* pSrc, DWORD cb,
+ DWORD cbOff, HSZ hszItem, UINT wFmt, UINT afCmd);
+HDDEDATA WINAPI DdeAddData(HDDEDATA hData, void FAR* pSrc, DWORD cb, DWORD cbOff);
+DWORD WINAPI DdeGetData(HDDEDATA hData, void FAR* pDst, DWORD cbMax, DWORD cbOff);
+BYTE FAR* WINAPI DdeAccessData(HDDEDATA hData, DWORD FAR* pcbDataSize);
+BOOL WINAPI DdeUnaccessData(HDDEDATA hData);
+BOOL WINAPI DdeFreeDataHandle(HDDEDATA hData);
+
+#define HDATA_APPOWNED 0x0001
+
+
+
+UINT WINAPI DdeGetLastError(DWORD idInst);
+
+#define DMLERR_NO_ERROR 0 /* must be 0 */
+
+#define DMLERR_FIRST 0x4000
+
+#define DMLERR_ADVACKTIMEOUT 0x4000
+#define DMLERR_BUSY 0x4001
+#define DMLERR_DATAACKTIMEOUT 0x4002
+#define DMLERR_DLL_NOT_INITIALIZED 0x4003
+#define DMLERR_DLL_USAGE 0x4004
+#define DMLERR_EXECACKTIMEOUT 0x4005
+#define DMLERR_INVALIDPARAMETER 0x4006
+#define DMLERR_LOW_MEMORY 0x4007
+#define DMLERR_MEMORY_ERROR 0x4008
+#define DMLERR_NOTPROCESSED 0x4009
+#define DMLERR_NO_CONV_ESTABLISHED 0x400a
+#define DMLERR_POKEACKTIMEOUT 0x400b
+#define DMLERR_POSTMSG_FAILED 0x400c
+#define DMLERR_REENTRANCY 0x400d
+#define DMLERR_SERVER_DIED 0x400e
+#define DMLERR_SYS_ERROR 0x400f
+#define DMLERR_UNADVACKTIMEOUT 0x4010
+#define DMLERR_UNFOUND_QUEUE_ID 0x4011
+
+#define DMLERR_LAST 0x4011
+
+HSZ WINAPI DdeCreateStringHandle(DWORD idInst, LPCSTR psz, int iCodePage);
+DWORD WINAPI DdeQueryString(DWORD idInst, HSZ hsz, LPSTR psz, DWORD cchMax, int iCodePage);
+BOOL WINAPI DdeFreeStringHandle(DWORD idInst, HSZ hsz);
+BOOL WINAPI DdeKeepStringHandle(DWORD idInst, HSZ hsz);
+int WINAPI DdeCmpStringHandles(HSZ hsz1, HSZ hsz2);
+
+
+#ifndef NODDEMLSPY
+/* */
+/* DDEML public debugging header file info */
+/* */
+
+typedef struct tagMONMSGSTRUCT
+{
+ UINT cb;
+ HWND hwndTo;
+ DWORD dwTime;
+ HANDLE hTask;
+ UINT wMsg;
+ WPARAM wParam;
+ LPARAM lParam;
+} MONMSGSTRUCT;
+
+typedef struct tagMONCBSTRUCT
+{
+ UINT cb;
+ WORD wReserved;
+ DWORD dwTime;
+ HANDLE hTask;
+ DWORD dwRet;
+ UINT wType;
+ UINT wFmt;
+ HCONV hConv;
+ HSZ hsz1;
+ HSZ hsz2;
+ HDDEDATA hData;
+ DWORD dwData1;
+ DWORD dwData2;
+} MONCBSTRUCT;
+
+typedef struct tagMONHSZSTRUCT
+{
+ UINT cb;
+ BOOL fsAction; /* MH_ value */
+ DWORD dwTime;
+ HSZ hsz;
+ HANDLE hTask;
+ WORD wReserved;
+ char str[1];
+} MONHSZSTRUCT;
+
+#define MH_CREATE 1
+#define MH_KEEP 2
+#define MH_DELETE 3
+#define MH_CLEANUP 4
+
+
+typedef struct tagMONERRSTRUCT
+{
+ UINT cb;
+ UINT wLastError;
+ DWORD dwTime;
+ HANDLE hTask;
+} MONERRSTRUCT;
+
+typedef struct tagMONLINKSTRUCT
+{
+ UINT cb;
+ DWORD dwTime;
+ HANDLE hTask;
+ BOOL fEstablished;
+ BOOL fNoData;
+ HSZ hszSvc;
+ HSZ hszTopic;
+ HSZ hszItem;
+ UINT wFmt;
+ BOOL fServer;
+ HCONV hConvServer;
+ HCONV hConvClient;
+} MONLINKSTRUCT;
+
+typedef struct tagMONCONVSTRUCT
+{
+ UINT cb;
+ BOOL fConnect;
+ DWORD dwTime;
+ HANDLE hTask;
+ HSZ hszSvc;
+ HSZ hszTopic;
+ HCONV hConvClient;
+ HCONV hConvServer;
+} MONCONVSTRUCT;
+
+#define MAX_MONITORS 4
+#define APPCLASS_MONITOR 0x00000001L
+#define XTYP_MONITOR (0x00F0 | XCLASS_NOTIFICATION | XTYPF_NOBLOCK)
+
+/*
+ * Callback filter flags for use with MONITOR apps - 0 implies no monitor
+ * callbacks.
+ */
+#define MF_HSZ_INFO 0x01000000
+#define MF_SENDMSGS 0x02000000
+#define MF_POSTMSGS 0x04000000
+#define MF_CALLBACKS 0x08000000
+#define MF_ERRORS 0x10000000
+#define MF_LINKS 0x20000000
+#define MF_CONV 0x40000000
+
+#define MF_MASK 0xFF000000
+#endif /* NODDEMLSPY */
+
+#ifdef __cplusplus
+}
+#endif
+
+#ifndef RC_INVOKED
+#pragma pack()
+#endif /* RC_INVOKED */
+
+#endif /* _INC_DDEML */
diff --git a/private/mvdm/wow16/inc/debug.h b/private/mvdm/wow16/inc/debug.h
new file mode 100644
index 000000000..39e44faf2
--- /dev/null
+++ b/private/mvdm/wow16/inc/debug.h
@@ -0,0 +1,32 @@
+/* This include file contains the functions needed by debuggers which run
+ * under windows.
+ */
+
+/* USER functions */
+BOOL FAR PASCAL QuerySendMessage(HANDLE h1, HANDLE h2, HANDLE h3, LPMSG lpmsg);
+BOOL FAR PASCAL LockInput(HANDLE h1, HWND hwndInput, BOOL fLock);
+
+LONG FAR PASCAL GetSystemDebugState(void);
+/* Flags returned by GetSystemDebugState.
+ */
+#define SDS_MENU 0x0001
+#define SDS_SYSMODAL 0x0002
+#define SDS_NOTASKQUEUE 0x0004
+
+/* Kernel procedures */
+void FAR PASCAL DirectedYield(HANDLE hTask);
+
+/* Debug hook to support debugging through other hooks.
+ */
+#define WH_DEBUG 9
+
+typedef struct tagDEBUGHOOKSTRUCT
+ {
+ WORD hAppHookTask; //"hTask" of the task that installed the app hook
+ DWORD dwUnUsed; // This field is unused.
+ LONG lAppHooklParam; //"lParam" of the App hook.
+ WORD wAppHookwParam; //"wParam" of the App hook.
+ int iAppHookCode; //"iCode" of the App hook.
+ } DEBUGHOOKSTRUCT;
+
+typedef DEBUGHOOKSTRUCT FAR *LPDEBUGHOOKSTRUCT;
diff --git a/private/mvdm/wow16/inc/debugsys.inc b/private/mvdm/wow16/inc/debugsys.inc
new file mode 100644
index 000000000..9f161d9c9
--- /dev/null
+++ b/private/mvdm/wow16/inc/debugsys.inc
@@ -0,0 +1,867 @@
+;******************************************************************************
+;
+; (C) Copyright MICROSOFT Corp., 1988-1990
+;
+; Title: DEBUGSYS.INC - VMM debugging include file
+;
+; Version: 1.00
+;
+; Date: 13-Jun-1988
+;
+; Author: RAL
+;
+;------------------------------------------------------------------------------
+;
+; README README README README README
+;
+; The "master copy" of this file lives in the WIN386 include directory.
+; If another copy of this file is ever checked in anywhere, the copy
+; should be checked periodically to make sure it is identical with the
+; master copy.
+;
+;------------------------------------------------------------------------------
+;
+; Change log:
+;
+; DATE REV DESCRIPTION
+; ----------- --- -----------------------------------------------------------
+; 13-Jun-1988 RAL
+; 24-Oct-1988 RAP changed INT from 2E to 41, and added functions for
+; Windows to notify the debugger about segment selectors
+; 14-Dec-1988 RAP split services into ones available through INT 41h
+; for non-ring 0 clients and those available through INT 21h
+; for ring 0 clients
+; 11-Dec-1990 ERH Merged WIN386 copy with file actually used by the
+; debugger.
+; 11-Dec-1990 ERH Merged file describing real mode services with this
+; one.
+;
+;==============================================================================
+
+;******************************************************************************
+;
+; Real mode Debugger services:
+;
+;
+
+D386_RM_Int equ 68h ; hooked by the debugger in real mode.
+
+D386_Id equ 0F386h ; debugger identification code
+
+D386_MIN equ 43h ; minimum INT 68 function code
+
+D386_Identify equ 43h ; returns debugger identification, if debugger
+ ; loaded
+
+D386_Prepare_PMode equ 44h ; partially prepare for protected mode operation
+ ; a pointer to a procedure is returned so that
+ ; the IDT can also be set in protected mode
+ ; INPUT:
+ ; AL 0 - retail version of Win386
+ ; 1 - debugging version
+ ; BX a valid selector that gives access
+ ; to all of memory
+ ; CX first of 2 selectors reserved for
+ ; WDeb386 to use
+ ; DX is GDT selector
+ ; DS:SI pointer to working copy of GDT
+ ; ES:DI pointer to working copy of IDT
+ ;
+ ; RETURN:
+ ; ES:EDI points to a protected mode procedure
+ ; (selector:offset32) that can be called
+ ; to set the IDT when it has been created.
+ ; This protected mode procedure takes a
+ ; pointer to the PMode IDT in ES:EDI.
+
+D386_Real_Mode_Init equ 45h ; re-init fro real mode after entering pmode
+
+D386_Set_Switches equ 46h ; set debugging switches
+ ; BL = verbose switch
+ ; - 00b - no segment display
+ ; - 01b - display win386 segments only
+ ; - 10b - display ring 1 segments only
+ ; - 11b - display win386 & ring 1 segs
+ ; BH = conditional brkpts
+ ; 0 - off
+ ; 1 - on
+ ; -1 for BX means no change (default)
+
+D386_Execute_Cond equ 47h ; execute conditional BP (/B option)
+ ; ES:SI points to NUL terminated string
+ ; to print if conditional flag set.
+
+D386_Set_Baudrate equ 49h ; set com port baud rate
+ ; BX = baud rate
+
+D386_Reinit equ 4ah ; reinitialize debugger for protected mode
+ ; AL 0 - retail version of Win386
+ ; 1 - debugging version of Win386
+ ; 2 - 286 DOS extender (3.0)
+ ; 3 - 286 DOS extender under VCPI (3.1)
+ ; 4 - 286 DOS extender (3.1)
+ ; BX a valid selector that gives access
+ ; to all of memory
+ ; CX first of 2 selectors reserved for
+ ; wdeb386 to use
+ ; DX is GDT selector
+ ;
+ ; This function can after a function 45h only
+ ; if function 44 was executed in the past on
+ ; the IDT/GDT.
+
+D386_Def_Deb_Segs equ 4bh ; define debugger's segments
+
+D386_Set_Com_Port equ 4ch ; set com port number
+ ; BX = com port number
+ ; returns AX != 0, error bad com port
+
+D386_Link_Sym equ 4dh ; link sym file map
+ ; ES:DI pointer to AddrS struc in front of
+ ; sym file map.
+ ; BX = loader ID (used to unlink sym file maps)
+ ; A loader ID of 0 is used for all the maps
+ ; wdeb386 loads via /S is ran as a program and
+ ; -1 is used by the device driver version. All
+ ; loader IDs of 0 are automaticly unlinked when
+ ; wdeb386 exits.
+
+D386_Unlink_Sym equ 4eh ; unlink sym file maps
+ ; BX = loader ID - this routine looks at all
+ ; of the maps that are currently linked and
+ ; removes the ones that were loaded with this
+ ; ID.
+
+D386_Remove_Segs equ 4fh ; remove any undefined segments from the
+ ; name module's symbols
+ ; ES:DI pointer to module name
+
+D386_Load_Segment equ 50h ; defines the actual segment/selector for a
+ ; loaded segment to allow for symbol processing
+ ; INPUT:
+ ; AL segment type 0 - code selector
+ ; 1 - data selector
+ ; 10h - code segment
+ ; 11h - data segment
+ ; 40h - code segment & sel
+ ; 41h - data segment & sel
+ ; 80h - device driver code seg
+ ; 81h - device driver data seg
+ ; If AL < 80h then
+ ; BX segment #
+ ; CX actual segment/selector
+ ; DX actual selector (if 40h or 41h)
+ ; ES:DI pointer to module name
+ ; Else
+ ; ES:DI points to D386_Device_Params struc
+ ;
+ ; RETURN:
+ ; AL = 1, if successful, else 0
+
+D386_Display_Char equ 51h ; display a character to the debugging terminal
+ ; AL = char to display
+
+D386_Display_Str equ 52h ; display a string to the debugging terminal
+ ; ES:SI points to NUL terminated string
+
+D386_IsVxDInstalled equ 53h ; returns if debug VxD has been installed
+ ; AL == 0 if not install, AL != 0 if installed
+
+D386_VxDInstall equ 54h ; sets that the debug VxD installed/uninstalled
+ ; BL == 0 if uninstall, BL != 0 if installed
+
+D386_RegisterDotCmd equ 55h ; registers dot command
+ ; BL = command letter
+ ; CX:SI = address of dot command routine
+ ; DX:DI = address of help text
+ ; returns AX == 0, no errors
+ ; AX != 0, dot command already used
+ ; or out of dot commands
+ ; Dot command routine:
+ ; AL = command character
+ ; DS:SI = linear address of command line
+ ; terminated by a NULL or ";".
+ ; DS,ES = debugger's data selector
+ ; returns AX == 0, no errors
+ ; AX !=0, command line or option error
+
+D386_DeRegisterDotCmd equ 56h ; de-registers dot command
+ ; BL = command letter
+
+D386_Printf equ 57h ; Printf
+ ; (DS:SI) = address of format string
+ ; (ES:DI) = address of the start of parameters
+ ; set DS_Printf for format char information
+
+D386_Link_Sym_Phys equ 58h ; link symbol file with physical address
+ ; (DX:CX) = physical address of one extra
+ ; paragraph front of map file image.
+ ; (SI) = XMS handle (0 if just physical)
+ ; (BX) = load id
+
+D386_CheckMap equ 59h ; DX:DI = pointer to module name
+ ; returns AX != 0, map found
+ ; AX == 0, map not found
+
+D386_SetAutoLoadSym equ 5ah ; (BL) != 0, auto load symbols
+ ; (BL) == 0, don't auto load symbols
+
+D386_SetTeftiPort equ 5bh ; (BX) = TEFTI port address
+
+D386_ExecDebugCommand equ 5ch ; execute debugger command script
+ ; (DS:SI) = ptr to debugger command script str
+ ; (CX) = size of script
+
+D386_LoadCodeDataHigh equ 5dh ; makes the debugger copy its code/data high
+ ; (DX:BX) = physical address to put debugger
+
+D386_SetWinVersion equ 5eh ; sets Windows version number
+ ; (DI) = Version number (default if this
+ ; api not called is 0300h).
+
+D386_MAX equ 5eh ; maximum INT 68 function code
+
+; D386_Load_Segment type equates:
+
+ST_code_sel equ 0 ; code selector
+ST_data_sel equ 1 ; data selector
+ST_code_seg equ 10h ; code segment
+ST_data_seg equ 11h ; data segment
+ST_dual_code equ 40h ; code segment and selector
+ST_dual_data equ 41h ; data segment and selector
+ST_device_code equ 80h ; device driver code segment
+ST_device_data equ 81h ; device driver data segment
+
+; D386_Load_Segment device load parameters structure
+
+D386_Device_Params STRUC
+DD_logical_seg dw ? ; logical segment # from map
+DD_actual_sel dw ? ; actual selector value
+DD_base dd ? ; linear address offset for start of segment
+DD_length dd ? ; actual length of segment
+DD_name df ? ; 16:32 ptr to null terminated device name
+DD_sym_name df ? ; 16:32 ptr to null terminated symbolic
+ ; module name (i.e. Win386)
+DD_alias_sel dw ? ; alias selector value (0 = none)
+D386_Device_Params ENDS
+
+;
+; VCPI information, passed to debugger when client is DOS Extender
+; running as a VCPI client. This information is used to get into
+; and out of protected mode when running under a VCPI server.
+;
+;
+; This structure is also used by the DOS Extender.
+;
+WdebVCPIInfo STRUC
+;
+; Enter protected mode information.
+;
+ fnVCPI df ? ; VCPI protect mode server entry point
+ rdsVCPI dw ? ; Selector for VCPI server
+;
+; Enter v86 mode information.
+;
+ laVTP dd ? ; linear address of data structure containing
+ ; values for system registers.
+ Port67 dw ? ; Qualitas magic port for emulating INT 67h
+WdebVCPIInfo ENDS
+;
+; The following structure contains the system register contents for the
+; VCPI server to use when switching to protected mode. It is taken
+; from dxvcpi.inc in the DOSX project, and is part of the VCPI spec.
+;
+VTP struc
+ zaCr3VTP dd 0 ; physical addr of page directory
+ laGdtrVTP dd 0 ; linear addr in first meg of gdtr
+ laIdtrVTP dd 0 ; linear addr in first meg of idtr
+ selLdtVTP dw 0 ; selector of ldt
+ selTrVTP dw 0 ; selector of tr
+ ipVTP dw 0 ; 48-bit address of protect
+ unusedVTP dw 0 ; mode entry point to xfer to
+ csVTP dw 0 ;
+VTP ends
+
+VCPI_RM_CALLOUT_INT equ 67h ; v86 mode call to VCPI server
+;
+; Send this value in AX to the VCPI server to request V86 to protected
+; mode switch or protected to V86 mode switch.
+;
+VCPI_PROT_ENTRY equ 0DE0CH
+
+
+;******************************************************************************
+;
+; Protected mode Debugger services:
+;
+;
+
+
+Debug_Serv_Int equ 41h ; Interrupt that calls Deb386 to perform
+ ; debugging I/O, AX selects the function as
+ ; described by the following equates
+
+DS_Out_Char equ 0 ; function to display the char in DL
+DS_In_Char equ 1 ; function to read a char into AL
+DS_Out_Str equ 2 ; function to display a NUL terminated string
+ ; pointed to by DS:ESI
+DS_Is_Char equ 3 ; Non blocking In_Chr
+
+DS_DebLoaded equ 4Fh ; check to see if the debugger is installed and
+ ; knows how to deal with protected mode programs
+ ; return AX = F386h, if true
+DS_DebPresent equ 0F386h
+
+DS_Out_Str16 equ 12h ; function to display a NUL terminated string
+ ; pointed to by DS:SI
+ ; (same as function 2, but for 16 bit callers)
+
+DS_ForcedGO16 equ 40h ; enter the debugger and perform the equivalent
+ ; of a GO command to force a stop at the
+ ; specified CS:IP
+ ; CX is the desired CS
+ ; BX is the desired IP
+
+DS_LinkMap equ 45h ; DX:(E)DI = ptr to paragraph in front of map
+
+DS_UnlinkMap equ 46h ; DX:(E)DI = ptr to paragraph in front of map
+
+DS_CheckMap equ 47h ; DX:(E)DI = pointer to module name
+ ; returns AX != 0, map found
+ ; AX == 0, map not found
+
+DS_IsAutoLoadSym equ 48h ; returns AX != 0, auto load symbols
+ ; AX == 0, don't auto load symbols
+
+DS_LoadSeg equ 50h ; define a segment value for the
+ ; debugger's symbol handling
+ ; SI type 0 - code selector
+ ; 1 - data selector
+ ; 80h - code segment
+ ; 81h - data segment
+ ; BX segment #
+ ; CX actual segment/selector
+ ; DX data instance
+ ; ES:(E)DI pointer to module name
+
+DS_LoadSeg_32 equ 0150h ; Define a 32-bit segment for Windows 32
+ ; SI type 0 - code selector
+ ; 1 - data selector
+ ; DX:EBX points to a D386_Device_Params STRUC
+ ; with all the necessaries in it
+
+DS_MoveSeg equ 51h ; notify the debugger that a segment has moved
+ ; BX old segment value
+ ; CX new segment value
+
+DS_FreeSeg equ 52h ; notify the debugger that a segment has been
+ ; freed
+ ; BX segment value
+
+DS_FreeSeg_32 equ 0152h ; notify the debugger that a segment has been
+ ; freed
+ ; BX segment number
+ ; DX:EDI pointer to module name
+
+DS_DGH equ 56h ; register "dump global heap" handler
+ ; BX is code offset
+ ; CX is code segment
+DS_DFL equ 57h ; register "dump free list" handler
+ ; BX is code offset
+ ; CX is code segment
+DS_DLL equ 58h ; register "dump LRU list" handler
+ ; BX is code offset
+ ; CX is code segment
+
+DS_StartTask equ 59h ; notify debugger that a new task is starting
+ ; BX is task handle
+ ; task's initial registers are stored on the
+ ; stack:
+ ; push cs
+ ; push ip
+ ; pusha
+ ; push ds
+ ; push es
+ ; push ss
+ ; push sp
+
+DS_Kernel_Vars equ 5ah ; Used by the Windows kernel to tell the
+ ; debugger the location of kernel variables
+ ; used in the heap dump commands.
+ ; BX = version number of this data (03a0h)
+ ; DX:CX points to:
+ ; WORD hGlobalHeap ****
+ ; WORD pGlobalHeap ****
+ ; WORD hExeHead ****
+ ; WORD hExeSweep
+ ; WORD topPDB
+ ; WORD headPDB
+ ; WORD topsizePDB
+ ; WORD headTDB ****
+ ; WORD curTDB ****
+ ; WORD loadTDB
+ ; WORD LockTDB
+ ; WORD SelTableLen ****
+ ; DWORD SelTableStart ****
+ ;
+ ; The starred fields are used by the
+ ; heap dump commands which are internal
+ ; to WDEB386.
+
+
+DS_VCPI_Notify equ 5bh ; notify debugger that DOS extender is
+ ; running under a VCPI implementation,
+ ; and register VCPI protect mode interface
+ ; ES:DI points to a data structure used to
+ ; get from V86 mode to Pmode under VCPI.
+ ; This is defined in the VCPI version
+ ; 1.0 spec.
+DS_ReleaseSeg equ 5ch ; This does the same as a DS_FreeSeg, but
+ ; it restores any breakpoints first.
+
+DS_POSTLOAD = 60h ; Used by the RegisterPTrace interface
+DS_EXITCALL = 62h ; Somebody will fill these in if we ever
+DS_INT2 = 63h ; figure out what they are supposed to do.
+DS_LOADDLL = 64h
+DS_DELMODULE = 65h
+
+DS_NEWTASK = 0BH
+DS_FLUSHTASK = 0CH
+DS_SWITCHOUT = 0DH
+DS_SWITCHIN = 0EH
+
+DS_IntRings equ 20h ; function to tell debugger which INT 1's & 3's
+ ; to grab
+ ; BX = 0, grab only ring 0 ints
+ ; BX != 0, grab all ints
+DS_IncludeSegs equ 21h ; function to tell debugger to go ahead and
+ ; process INT 1's & 3's which occur in this
+ ; DX:DI points to list of selectors
+ ; (1 word per entry)
+ ; CX = # of selectors (maximum of 20)
+ ; CX = 0, to remove the list of segs
+MaxDebugSegs = 20
+
+DS_CondBP equ 0F001h ; conditional break pt, if the command line
+ ; switch /B is given when the debugger is run
+ ; or the conditional flag is later set, then
+ ; this int should cause the program to break
+ ; into the debugger, else this int should be
+ ; ignored!
+ ; ESI points to a nul terminated string to
+ ; display if break is to happen.
+
+DS_ForcedBP equ 0F002h ; break pt, which accomplishes the same thing
+ ; as an INT 1 or an INT 3, but is a break point
+ ; that should be permanently left in the code,
+ ; so that a random search of source code would
+ ; not result in the accidental removal of this
+ ; necessary break_pt
+
+DS_ForcedGO equ 0F003h ; enter the debugger and perform the equivalent
+ ; of a GO command to force a stop at the
+ ; specified CS:EIP
+ ; CX is the desired CS
+ ; EBX is the desired EIP
+
+DS_HardINT1 equ 0F004h ; check to see if INT 1 hooked for all rings
+ ; ENTER: nothing
+ ; EXIT: AX = 0, if no, 1, if yes
+
+DS_FatalFault equ 0F005h ; check if fault is hooked by debugger via VSF
+ ; ENTRY BX = trap number
+ ; DX = error code
+ ; CX:(E)SI = address of CS:(E)IP
+ ; EXIT: AL == 0, handle fault normally
+ ; AL != 0, handled by debugger
+
+DS_Out_Symbol equ 0Fh ; find the symbol nearest to the address in
+ ; CX:EBX and display the result in the format
+ ; symbol name <+offset>
+ ; the offset is only included if needed, and
+ ; no CR&LF is displayed
+
+DS_Disasm_Ins equ 10h ; function to disassemble the instruction
+ ; pointed to by DS:ESI
+
+DS_RegisterDotCommand equ 70h ; registers a 32 bit dot command handler
+
+; This interface is used to register wdeb386 dot commands by FLAT 32
+; bit code. The following conditions apply:
+;
+; * The code will be run at ring 0
+; * Interrupts may not be enabled
+; * Must not access any not present pages or load invalid selectors
+; * Must stay on the stack called with when calling INT 41 services
+; * Must not change DS or ES from the FLAT selector
+;
+; The help text is printed when .? is executed in the order of
+; registration. The text must include CR/LF at the end; nothing
+; is added to the help text.
+;
+; ENTRY: (AX) = 0070h
+; (BL) = dot command to register
+; (ESI) = linear address of dot command routine
+; Dot command routine:
+; ENTRY: (AL) = command character
+; (DS, ES) = flat data selector
+;
+; EXIT: (AX) == 0, no errors
+; (AX) !=0, command line or option error
+;
+; NOTE: MUST return with a 32 bit FAR return (retfd)
+; (EDI) = linear address of help text
+;
+; EXIT: (AX) == 0, no errors
+; (AX) != 0, dot command already used or out of dot commands
+
+DS_RegisterDotCommand16 equ 71h ; registers a 16 bit dot command handler
+
+; This interface is used to register wdeb386 dot commands by 16 bit
+; code. The following conditions apply:
+;
+; * The code will be run at ring 0 or in real mode
+; * Interrupts may not be enabled
+; * Must not access any not present pages or load invalid selectors
+; * Must stay on the stack called with when calling INT 41 services
+;
+; The help text is printed when .? is executed in the order of
+; registration. The text must include CR/LF at the end; nothing
+; is added to the help text.
+;
+; ENTRY: (AX) = 0071h
+; (BL) = dot command to register
+; (CX:SI) = address of dot command routine
+; Dot command routine:
+; ENTRY: (AL) = command character
+; (DS, ES) = debugger's data selector
+;
+; EXIT: (AX) == 0, no errors
+; (AX) != 0, command line or option error
+;
+; NOTE: MUST return with a 16 bit FAR return (retf)
+; (DX:DI) = address of help text
+;
+; EXIT: (AX) == 0, no errors
+; (AX) != 0, dot command already used or out of dot commands
+
+DS_DeRegisterDotCommand equ 72h ; de-registers 16 or 32 bit dot command
+
+; This interface is used to de-register wdeb386 dot commands registered
+; by the above 16 or 32 bit services. Care should be used not to
+; de-register dot commands that weren't registered by your code.
+;
+; ENTRY: (AX) = 0072h
+; (BL) = dot command to de-register
+;
+; EXIT: NONE
+
+DS_Printf equ 73h ; print formatted output
+
+; This function allows formatted output with the standard "C"
+; printf syntax.
+;
+; ENTRY: (AX) = 0073h
+; (DS:ESI) = address of format string
+; (ES:EDI) = address of the start of the dword arguments
+;
+; EXIT: NONE
+;
+; Supported types are:
+;
+; %% %
+; %[l][h]c character
+; %[-][+][ ][0][width][.precision][l][h][p][n]d decimal
+; %[-][0][width][.precision][l][h][p][n]u unsigned decimal
+; %[-][#][0][width][.precision][l][h][p][n]x hex
+; %[-][#][0][width][.precision][l][h][p][n]X hex
+; %[-][0][width][.precision][l][h][p][n]o octal
+; %[-][0][width][.precision][l][h][p][n]b binary
+; %[-][width][.precision][l][h][a][F]s string
+; %[-][width][.precision][l][h][a][p][n][F][L][H][N]S symbol
+; %[-][width][.precision][l][h][a][p][n][F][L][H][N]G group:symbol
+; %[-][width][.precision][l][h][a][p][n][F][L][H][N]M map:group:symbol
+; %[-][width][.precision][l][h][a][p][n][F][L][H][N]A address
+;
+; Where "width" or "precision" is a decimal number or the '*'
+; character; '*' causes the field width or precision to be picked
+; up from the next parameter. []'ed parameters are optional.
+;
+; "\r", "\t", "\n", "\a", "\b", are supported directly.
+;
+; Prefixes
+; --------
+;
+; Used with c,d,u,x,X,o,b:
+;
+; Parameter Argument Size
+; -----------------------
+; word h
+; dword l
+;
+; Used with s,S,G,M,A:
+;
+; Address Argument Size
+; ---------------------
+; 16 bit DS relative h
+; 16:16 segment:offset hF or Fh
+; 32 bit flat relative l
+; 16:32 segment:offset (2 dwords) lF or Fl
+; pointer to AddrS structure a
+;
+; Used with S,G,M,A:
+;
+; Address Display Size or Format
+; ------------------------------
+; 16 bit offset H
+; 32 bit offset L
+; offset only N
+;
+; Default display size depends on the "386env" flag setting.
+;
+; Used with S,G,M:
+;
+; gets the previous symbol p
+; gets the next symbol n
+;
+; Used with A:
+;
+; gets the previous symbol address p
+; gets the next symbol address n
+;
+; Used with d,u,x,X,o,b:
+;
+; gets the previous symbol offset p
+; gets the next symbol offset n
+;
+
+DS_Printf16 equ 74h ; print formatted 16 bit output
+
+; This function allows formatted output with the standard "C"
+; printf syntax.
+;
+; ENTRY: (AX) = 0074h
+; (DS:SI) = address of format string
+; (ES:DI) = address of the start of the word or dword arguments
+;
+; EXIT: NONE
+;
+; The format options and parameters are the same as DS_Printf except
+; the default parameter size is a word (the h option is implicit).
+;
+
+DS_GetRegisterSet equ 75h ; get the debugger's registers
+
+; This function copies the current register set.
+;
+; ENTRY: (AX) = 0075h
+; (DS:ESI) = address of SaveRegs_Struc structure
+;
+; EXIT: NONE
+;
+
+DS_SetAlternateRegisterSet equ 76h ; set the debugger's registers
+
+; This function temporary sets the debugger's registers to values
+; passed in the structure. If an "r" command is executed or the
+; debugged code is returned to (via the "g", "t" or "p" commands),
+; the register set reverts to the debugged code's registers.
+;
+; ENTRY: (AX) = 0076h
+; (CX) = thread ID, 0 use current thread ID
+; (DS:ESI) = address of SaveRegs_Struc structure
+;
+; EXIT: NONE
+;
+
+DS_GetCommandLineChar equ 77h ; get a character from the command line
+
+; This services gets the next character off the command line.
+;
+; ENTRY: (AX) = 0077h
+; (BL) == 0 just peek the character, don't increment text pointer
+; leading white space isn't ignored
+; (BL) != 0 get the character, increment text pointer
+; leading white space is skipped
+;
+; EXIT: (AL) = command line character
+; (AH) == 0 if no more characters (EOL)
+; (AH) != 0 if more characters
+;
+
+DS_EvaluateExpression equ 78h ; evaluate debugger command line expression
+
+; Expressions can be numbers of various radices, symbols, addresses
+; or an combination of the above hooked together with various
+; operators. Expressions are separated by blanks or commas. This
+; function is passed a pointer to the beginning of the text of the
+; expression (i.e. "%80003444+4232"). The expression is either
+; evaluated down into a dword value if there are no addresses or
+; into a linear address.
+;
+; ENTRY: (AX) = 0078h
+;
+; EXIT: (AX) == 0, returning a data value
+; (AX) != 0, returning a linear address
+; (EBX) = return value
+;
+; NOTE: If the expression is invalid, this service will not
+; return. A message is printed and control returns to
+; the command loop.
+;
+
+DS_VerifyMemory equ 79h ; verify the memory is valid and present
+
+; ENTRY: (AX) = 0079h
+; (ECX) = length of memory region
+; (DS:ESI) = address of memory to verify
+;
+; EXIT: (AX) == 0, no errors
+; (AX) != 0, invalid memory
+
+DS_PrintRegisters equ 7ah ; print the register set (the "r" command)
+
+; This function prints (just like the "r" command) the either the
+; debugged code's registers or the alternate register set, set with
+; DS_SetAlternateRegisterSet function.
+;
+; ENTRY: (AX) = 007ah
+;
+; EXIT: NONE
+;
+; NOTE: If the CS:EIP is invalid, this service will not return
+; because of an error when the code is disassembled. A
+; message is printed and control returns to the command loop.
+;
+
+DS_PrintStackDump equ 7bh ; dumps the [E]BP stack chain (the "k" command)
+
+; This function prints (just like the "k" command) the stack dump
+; based on the current register set that may have been set with
+; DS_SetAlternateRegisterSet function.
+;
+; ENTRY: (AX) = 007bh
+; (BX) = flags
+; 01h - verbose stack dump
+; 02h - 16 bit stack dump
+; 04h - 32 bit stack dump
+;
+; EXIT: NONE
+;
+; NOTE: If the CS:EIP or SS:EBP are invalid, this service will not
+; return because of an error when accessing the stack. A
+; message is printed and control returns to the command loop.
+;
+
+DS_SetThreadID equ 7ch ; sets the debugger's thread ID
+
+; This function sets what the debugger thinks the thread ID is
+; for memory address in other address contexts. It stays set
+; until the debugged code is returned to (via "g", "t" or "p")
+; or set back to 0.
+;
+; ENTRY: (AX) = 007ch
+; (CX) = thread ID or 0 for currently executed thread
+;
+; EXIT: NONE
+
+DS_ExecDebugCommand equ 7dh ; execute debugger command script
+
+; This service allows any debugger command to be executed. In can
+; be a multi-lined script with the lines separated by CR, LF. MUST
+; have a "g" command at the end of script so the debugger doesn't
+; stop while in the INT 41.
+;
+; ENTRY: (AX) = 007dh
+; (DS:ESI) = pointer to debugger command script string
+; (CX) = size of script
+;
+; EXIT: NONE
+
+;
+; Interupt and services that Win386 provides to the debugger
+;
+
+Win386_Query_Int equ 22h ; interrupt for Win386 protected mode
+ ; interface requests
+
+Win386_Alive equ 0 ; function 0, query Win386 installation
+Win386_Q_Ack equ 0F386h ; good response from func 43h, of
+ ; INT 68h & func 4fh of INT 41h
+
+Win386_Query equ 1 ; function 1, query Win386 state
+ ; ds:esi points to command string
+ ; that Win386 needs to process
+ ; ds:edi points to the SaveRegs_Struc
+ ; that the debugger has stored all the
+ ; client register state into.
+ ; (Win386 just writes the query
+ ; answers directly to the output
+ ; device, so no response is
+ ; returned)
+
+Win386_PhysToLinr equ 2 ; function 2, have Win386 convert a
+ ; physical address into a valid
+ ; linear address that Deb386 can
+ ; use. esi is physicaladdress
+ ; cx is # of bytes required
+ ; returns esi as linear address
+ ; returns ax = 1, if okay, else
+ ; 0, if request couldn't be
+ ; completed
+
+Win386_AddrValid equ 3 ; function 3, have Win386 check the
+ ; validity of a linear address
+ ; esi is linear address to check
+ ; cx is # of bytes required
+ ; returns ax = 1, if address okay
+ ; else ax = 0
+
+Win386_MapVM equ 4 ; function 4, make sure that the VM's
+ ; low memory is mapped in, in case
+ ; it is touched (a count is maintained)
+Win386_UnmapVM equ 5 ; function 5, map out the VM's low
+ ; memory (dec the count)
+Win386_GetDLAddr equ 6 ; function 6, return offset of dyna-link
+ ; service. EBX = Device ID << 10h +
+ ; Service #. Returns EAX = Offset.
+Max_Win386_Services equ 6
+
+
+SaveRegs_Struc STRUC
+Debug_EAX dd ?
+Debug_EBX dd ?
+Debug_ECX dd ?
+Debug_EDX dd ?
+Debug_ESP dd ?
+Debug_EBP dd ?
+Debug_ESI dd ?
+Debug_EDI dd ?
+Debug_ES dw ?
+Debug_SS dw ?
+Debug_DS dw ?
+Debug_FS dw ?
+Debug_GS dw ?
+Debug_EIP dd ?
+Debug_CS dw ?
+ dd ?
+Debug_EFlags dd ?
+Debug_CR0 dd ?
+Debug_GDT dq ?
+Debug_IDT dq ?
+Debug_LDT dw ?
+Debug_TR dw ?
+Debug_CR2 dd ?
+Debug_CR3 dd ?
+Debug_DR0 dd ?
+Debug_DR1 dd ?
+Debug_DR2 dd ?
+Debug_DR3 dd ?
+Debug_DR6 dd ?
+Debug_DR7 dd ?
+Debug_DR7_2 dd ?
+Debug_TR6 dd ?
+Debug_TR7 dd ?
+Debug_TrapNumber dw -1 ; -1 means no trap number
+Debug_ErrorCode dw 0 ; 0 means no error code
+SaveRegs_Struc ENDS
diff --git a/private/mvdm/wow16/inc/dlgs.h b/private/mvdm/wow16/inc/dlgs.h
new file mode 100644
index 000000000..d701b0f05
--- /dev/null
+++ b/private/mvdm/wow16/inc/dlgs.h
@@ -0,0 +1,192 @@
+/*****************************************************************************\
+* *
+* dlgs.h - Common dialog's dialog element ID numbers *
+* *
+* Version 1.0 *
+* *
+* Copyright (c) 1992, Microsoft Corp. All rights reserved. *
+* *
+\*****************************************************************************/
+
+#ifndef _INC_DLGS
+#define _INC_DLGS
+
+#define ctlFirst 0x0400
+#define ctlLast 0x04ff
+ /* Push buttons */
+#define psh1 0x0400
+#define psh2 0x0401
+#define psh3 0x0402
+#define psh4 0x0403
+#define psh5 0x0404
+#define psh6 0x0405
+#define psh7 0x0406
+#define psh8 0x0407
+#define psh9 0x0408
+#define psh10 0x0409
+#define psh11 0x040a
+#define psh12 0x040b
+#define psh13 0x040c
+#define psh14 0x040d
+#define psh15 0x040e
+#define pshHelp psh15
+#define psh16 0x040f
+ /* Checkboxes */
+#define chx1 0x0410
+#define chx2 0x0411
+#define chx3 0x0412
+#define chx4 0x0413
+#define chx5 0x0414
+#define chx6 0x0415
+#define chx7 0x0416
+#define chx8 0x0417
+#define chx9 0x0418
+#define chx10 0x0419
+#define chx11 0x041a
+#define chx12 0x041b
+#define chx13 0x041c
+#define chx14 0x041d
+#define chx15 0x041e
+#define chx16 0x041f
+ /* Radio buttons */
+#define rad1 0x0420
+#define rad2 0x0421
+#define rad3 0x0422
+#define rad4 0x0423
+#define rad5 0x0424
+#define rad6 0x0425
+#define rad7 0x0426
+#define rad8 0x0427
+#define rad9 0x0428
+#define rad10 0x0429
+#define rad11 0x042a
+#define rad12 0x042b
+#define rad13 0x042c
+#define rad14 0x042d
+#define rad15 0x042e
+#define rad16 0x042f
+ /* Groups, frames, rectangles, and icons */
+#define grp1 0x0430
+#define grp2 0x0431
+#define grp3 0x0432
+#define grp4 0x0433
+#define frm1 0x0434
+#define frm2 0x0435
+#define frm3 0x0436
+#define frm4 0x0437
+#define rct1 0x0438
+#define rct2 0x0439
+#define rct3 0x043a
+#define rct4 0x043b
+#define ico1 0x043c
+#define ico2 0x043d
+#define ico3 0x043e
+#define ico4 0x043f
+ /* Static text */
+#define stc1 0x0440
+#define stc2 0x0441
+#define stc3 0x0442
+#define stc4 0x0443
+#define stc5 0x0444
+#define stc6 0x0445
+#define stc7 0x0446
+#define stc8 0x0447
+#define stc9 0x0448
+#define stc10 0x0449
+#define stc11 0x044a
+#define stc12 0x044b
+#define stc13 0x044c
+#define stc14 0x044d
+#define stc15 0x044e
+#define stc16 0x044f
+#define stc17 0x0450
+#define stc18 0x0451
+#define stc19 0x0452
+#define stc20 0x0453
+#define stc21 0x0454
+#define stc22 0x0455
+#define stc23 0x0456
+#define stc24 0x0457
+#define stc25 0x0458
+#define stc26 0x0459
+#define stc27 0x045a
+#define stc28 0x045b
+#define stc29 0x045c
+#define stc30 0x045d
+#define stc31 0x045e
+#define stc32 0x045f
+ /* Listboxes */
+#define lst1 0x0460
+#define lst2 0x0461
+#define lst3 0x0462
+#define lst4 0x0463
+#define lst5 0x0464
+#define lst6 0x0465
+#define lst7 0x0466
+#define lst8 0x0467
+#define lst9 0x0468
+#define lst10 0x0469
+#define lst11 0x046a
+#define lst12 0x046b
+#define lst13 0x046c
+#define lst14 0x046d
+#define lst15 0x046e
+#define lst16 0x046f
+ /* Combo boxes */
+#define cmb1 0x0470
+#define cmb2 0x0471
+#define cmb3 0x0472
+#define cmb4 0x0473
+#define cmb5 0x0474
+#define cmb6 0x0475
+#define cmb7 0x0476
+#define cmb8 0x0477
+#define cmb9 0x0478
+#define cmb10 0x0479
+#define cmb11 0x047a
+#define cmb12 0x047b
+#define cmb13 0x047c
+#define cmb14 0x047d
+#define cmb15 0x047e
+#define cmb16 0x047f
+ /* Edit controls */
+#define edt1 0x0480
+#define edt2 0x0481
+#define edt3 0x0482
+#define edt4 0x0483
+#define edt5 0x0484
+#define edt6 0x0485
+#define edt7 0x0486
+#define edt8 0x0487
+#define edt9 0x0488
+#define edt10 0x0489
+#define edt11 0x048a
+#define edt12 0x048b
+#define edt13 0x048c
+#define edt14 0x048d
+#define edt15 0x048e
+#define edt16 0x048f
+ /* Scroll bars */
+#define scr1 0x0490
+#define scr2 0x0491
+#define scr3 0x0492
+#define scr4 0x0493
+#define scr5 0x0494
+#define scr6 0x0495
+#define scr7 0x0496
+#define scr8 0x0497
+
+/* These dialog resource ordinals really start at 0x0600, but the
+ * RC Compiler can't handle hex for resource IDs, hence the decimal.
+ */
+#define FILEOPENORD 1536
+#define MULTIFILEOPENORD 1537
+#define PRINTDLGORD 1538
+#define PRNSETUPDLGORD 1539
+#define FINDDLGORD 1540
+#define REPLACEDLGORD 1541
+#define FONTDLGORD 1542
+#define FORMATDLGORD31 1543
+#define FORMATDLGORD30 1544
+
+#endif /* !_INC_DLGS */
diff --git a/private/mvdm/wow16/inc/dosx.inc b/private/mvdm/wow16/inc/dosx.inc
new file mode 100644
index 000000000..4fab86669
--- /dev/null
+++ b/private/mvdm/wow16/inc/dosx.inc
@@ -0,0 +1,47 @@
+;******************************************************************************
+;
+; Copyright (c) Microsoft Corporation 1989-1990.
+;
+; Title: DOSX.INC - Equates and Structures for 286 DOS Extender
+; Int 2Fh Interface
+;
+; Version: 3.00
+;
+; Date: 27-Jun-1989
+;
+; Author: JEM
+;
+;------------------------------------------------------------------------------
+;
+; Change log:
+;
+; DATE REV DESCRIPTION
+; ----------- --- -----------------------------------------------------------
+; 27-Jun-1989 JEM Original
+;
+;==============================================================================
+
+
+DOSXFunc EQU 46h ;286 DOS Extender Int 2Fh Multiplex ID
+
+
+; DOSX Int 2Fh subfunctions
+
+DOSXQuery EQU 00h ;Query DOS Extender installation
+DOSXSuspend EQU 01h ;Suspend Network posting call
+DOSXResume EQU 02h ;Resume Network posting call
+DOSXAbort EQU 03h ;Abort Child application call
+DOSXInfo EQU 04h ;Get Info structure pointer call
+
+DOSXLast EQU DOSXInfo ;Last valid Int 2Fh request
+
+
+; Structure returned in ES:BX by DOSXInfo call
+
+DOSXInfoTbl struc
+DOSXInfoVer dw ? ;version # of info structure
+hXMSHeap dw ? ;XMS handle to DOSX heap block
+selAppBlk dw ? ;1st selector to application memory blk
+cbAppBlk dd ? ;size in bytes of app memory block
+ckReservedLow dw ? ;size in K of low memory to reserve
+DOSXInfoTbl ends
diff --git a/private/mvdm/wow16/inc/drivinit.h b/private/mvdm/wow16/inc/drivinit.h
new file mode 100644
index 000000000..9db28db67
--- /dev/null
+++ b/private/mvdm/wow16/inc/drivinit.h
@@ -0,0 +1,2 @@
+/* OBSOLETE: Use print.h instead */
+#include <print.h>
diff --git a/private/mvdm/wow16/inc/gdidefs.inc b/private/mvdm/wow16/inc/gdidefs.inc
new file mode 100644
index 000000000..c59fcc16b
--- /dev/null
+++ b/private/mvdm/wow16/inc/gdidefs.inc
@@ -0,0 +1,1292 @@
+;/*
+;***************************************************************************
+; *
+; Copyright (C) 1983,1984,1985 by Microsoft Inc. *
+; *
+;***************************************************************************
+
+
+
+; GDI Definitions for Device Drivers
+;
+; Since most of the routines only need a portion of these definitions,
+; conditional assembly flags have been defined in the various files
+; to only include portions as needed (as opposed to having a lot of
+; include files to mess with). The flags are as follows:
+;
+; incFont include font definitions
+; incDevice include device definitions
+; incLogical include logical object definitions
+; incDrawmode include DrawMode structure definition
+; incOutput include Output definitions
+; incControl include Control definitions
+
+page
+; General definitions that almost everyone will use.
+
+
+
+; Physical Bitmap Structure
+;
+; Bitmap data structure passed to OEM routines. Defines the location and
+; size of a main memory bitmap.
+
+
+
+BITMAP struc ;*/ typedef struct { /*
+
+ bmType dw 0 ; 0 means main memory bitmap. Non-zero ;*/ short int bmType; /*
+ ; is number of physical display and format
+ ; of the rest of the structure known only
+ ; to device driver
+ bmWidth dw 0 ; Width of bitmap in pixels ;*/ unsigned short int bmWidth; /*
+ bmHeight dw 0 ; Height of bitmap in pixels ;*/ unsigned short int bmHeight; /*
+ bmWidthBytes dw 0 ; #bytes per scan line ;*/ unsigned short int bmWidthBytes; /*
+ bmPlanes db 0 ; # of planes in bitmap ;*/ BYTE bmPlanes; /*
+ bmBitsPixel db 0 ; # of bits per pixel ;*/ BYTE bmBitsPixel; /*
+ bmBits dd 0 ; Far pointer to bits of main memory bitmap ;*/ BYTE FAR *bmBits; /*
+ bmWidthPlanes dd 0 ; Product of bmWidthBytes and bmHeight ;*/ unsigned long int bmWidthPlanes;/*
+ bmlpPDevice dd 0 ; Pointer to associated PDevice ;*/ BYTE FAR *bmlpPDevice; /*
+ bmSegmentIndex dw 0 ; Index to plaens next segment if non-zero ;*/ unsigned short int bmSegmentIndex; /*
+ bmScanSegment dw 0 ; Number of scans per segment ;*/ unsigned short int bmScanSegment; /*
+ bmFillBytes dw 0 ; Number of unused bytes per segment ;*/ unsigned short int bmFillBytes; /*
+ dw 0 ;*/ unsigned short int futureUse4; /*
+ dw 0 ;*/ unsigned short int futureUse5; /*
+BITMAP ends ;*/ } BITMAP; /*
+
+; structures used for Device Independent Bitmap (DIB) processing.
+; all taken out of Presentation Manager's documentation
+; Tuesday 25-October-1988 15:04 -by- Ron Gery [rong]
+
+; C definitions are provided below (separately).
+
+; triple used in PM1.1 (BitmapCoreInfo) format color table
+RGBTriple struc
+ rgbtBlue db 0
+ rgbtGreen db 0
+ rgbtRed db 0
+RGBTriple ends
+
+; RGB DWORD used in PM2.0 format color table
+RGBQuad struc
+ rgbBlue db 0
+ rgbGreen db 0
+ rgbRed db 0
+ rgbReserved db 0
+RGBQuad ends
+
+BitmapCoreHeader struc
+ bcSize dd 0
+ bcWidth dw 0
+ bcHeight dw 0
+ bcPlanes dw 0
+ bcBitCount dw 0
+BitmapCoreHeader ends
+
+; new format bitmap structure based on PM2.0 format DCR.
+; Tuesday 23-May-1989 16:05 -by- Ron Gery [rong]
+
+BitmapInfoHeader struc
+ biSize dd 0
+ biWidth dd 0
+ biHeight dd 0
+ biPlanes dw 0
+ biBitCount dw 0
+
+ biCompression dd 0
+ biSizeImage dd 0
+ biXPelsPerMeter dd 0
+ biYPelsPerMeter dd 0
+ biClrUsed dd 0
+ biClrImportant dd 0
+BitmapInfoHeader ends
+
+BitmapInfo struc
+ bmiHeader db (size BitmapInfoHeader) DUP (?)
+ bmiColors db ? ; array of RGBQUADS
+BitmapInfo ends
+
+BitmapCoreInfo struc
+ bmciHeader db (size BitmapCoreHeader) DUP (?)
+ bmciColors db ? ; array of RGBTRIPLES
+BitmapCoreInfo ends
+
+BI_RGB equ 0h
+BI_RLE8 equ 1h
+BI_RLE4 equ 2h
+
+ if 0
+
+*/
+/* C definitions for DIBs, as defined in windows.h */
+
+typedef struct {
+ DWORD bcSize;
+ WORD bcWidth;
+ WORD bcHeight;
+ WORD bcPlanes;
+ WORD bcBitCount;
+} BITMAPCOREHEADER;
+typedef BITMAPCOREHEADER FAR *LPBITMAPCOREHEADER;
+typedef BITMAPCOREHEADER *PBITMAPCOREHEADER;
+
+typedef struct {
+ DWORD biSize;
+ DWORD biWidth;
+ DWORD biHeight;
+ WORD biPlanes;
+ WORD biBitCount;
+
+ DWORD biCompression;
+ DWORD biSizeImage;
+ DWORD biXPelsPerMeter;
+ DWORD biYPelsPerMeter;
+ DWORD biClrUsed;
+ DWORD biClrImportant;
+} BITMAPINFOHEADER;
+
+typedef BITMAPINFOHEADER FAR *LPBITMAPINFOHEADER;
+typedef BITMAPINFOHEADER *PBITMAPINFOHEADER;
+
+typedef struct {
+ BYTE rgbtBlue;
+ BYTE rgbtGreen;
+ BYTE rgbtRed;
+} RGBTRIPLE;
+
+typedef struct {
+ BYTE rgbBlue;
+ BYTE rgbGreen;
+ BYTE rgbRed;
+ BYTE rgbReserved;
+} RGBQUAD;
+
+typedef struct {
+ BITMAPCOREHEADER bmicHeader;
+ RGBQUAD bmiColors[1];
+} BITMAPINFO;
+
+typedef BITMAPINFO FAR *LPBITMAPINFO;
+typedef BITMAPINFO *PBITMAPINFO;
+
+
+/* currently, if the low byte of biCompression is non zero,
+ * it must be one of following */
+
+#define BI_RGB 0x00
+#define BI_RLE8 0x01
+#define BI_RLE4 0x02
+
+#define BITMAP_SELECTED 0x01
+#define BITMAP_64K 0x01
+
+#define DIBSIGNATURE 0x4944
+/*
+ endif
+
+ if 0
+*/
+#ifndef NOPTRC
+/*
+ endif
+
+
+PTTYPE struc ;*/ typedef struct { /*
+
+ xcoord dw 0 ;x coordinate of point ;*/ short int xcoord; /*
+ ycoord dw 0 ;y coordinate of point ;*/ short int ycoord; /*
+
+PTTYPE ends ;*/ } PTTYPE; /*
+ ;*/ typedef PTTYPE *PPOINT; /*
+ ;*/ typedef PTTYPE FAR *LPPOINT; /*
+ if 0
+*/
+#define POINT PTTYPE
+/*
+ endif
+
+
+
+RECT struc ;*/ typedef struct { /*
+
+ left dw 0 ;*/ short int left, /*
+ top dw 0 ;*/ top, /*
+ right dw 0 ;*/ right, /*
+ bottom dw 0 ;*/ bottom; /*
+
+RECT ends ;*/ } RECT; /*
+ ;*/ typedef RECT *PRECT; /*
+
+ if 0
+*/
+#endif
+/*
+ endif
+
+
+BOXTYPE struc ;*/ typedef struct { /*
+
+ min db SIZE PTTYPE dup (?) ;x,y starting coord ;*/ PTTYPE min; /*
+ ext db SIZE PTTYPE dup (?) ;x,y extents ;*/ PTTYPE ext; /*
+
+BOXTYPE ends ;*/ } BOXTYPE; /*
+
+
+ ;*/ typedef RECT FAR * LPRECT; /*
+
+page
+; Logical Object Definitions - incLogical
+ ifdef incLogical
+ if incLogical
+
+
+
+OBJ_PEN equ 1
+OBJ_BRUSH equ 2
+OBJ_FONT equ 3
+
+ if 0
+*/
+/* Object definitions used by GDI support routines written in C */
+
+#define OBJ_PEN 1
+#define OBJ_BRUSH 2
+#define OBJ_FONT 3
+/*
+ endif
+
+
+LogBrush struc ;*/ typedef struct { /*
+
+ lbStyle dw 0 ;Style of logical BRUSH ;*/ unsigned short int lbStyle; /*
+ lbColor dd 0 ;RGB color ;*/ unsigned long int lbColor; /*
+ lbHatch dw 0 ;Hatching style ;*/ unsigned short int lbHatch; /*
+ lbBkColor dd 0 ;Background color for hatched brush ;*/ unsigned long int lbBkColor;/*
+
+LogBrush ends ;*/ } LOGBRUSH; /*
+
+lbPattern = lbColor ; pointer to physical pattern
+
+ if 0
+*/
+#define lbPattern lbColor
+/*
+ endif
+
+
+
+; Brush styles defined by GDI
+
+BS_SOLID equ 0
+BS_HOLLOW equ 1
+BS_HATCHED equ 2
+BS_PATTERN equ 3
+
+MaxBrushStyle equ 3
+
+
+
+; Hatched Brush hatching styles defined by GDI
+
+HS_HORIZONTAL equ 0 ; Horizontal -----
+HS_VERTICAL equ 1 ; Vertical |||||
+HS_FDIAGONAL equ 2 ; Foreward Diagonal /////
+HS_BDIAGONAL equ 3 ; Backward Diagonal \\\\\
+HS_CROSS equ 4 ; Cross +++++
+HS_DIAGCROSS equ 5 ; Diagonal Cross XXXXX
+
+MaxHatchStyle equ 5
+
+ if 0
+*/
+/* Brush Style definitions used by GDI support routines written in C */
+
+#define BS_SOLID 0
+#define BS_HOLLOW 1
+#define BS_HATCHED 2
+#define BS_PATTERN 3
+
+#define MaxBrushStyle 3
+
+
+/* Hatch Style definitions used by GDI support routines written in C */
+
+#define HS_HORIZONTAL 0 /* ----- */
+#define HS_VERTICAL 1 /* ||||| */
+#define HS_FDIAGONAL 2 /* ///// */
+#define HS_BDIAGONAL 3 /* \\\\\ */
+#define HS_CROSS 4 /* +++++ */
+#define HS_DIAGCROSS 5 /* xxxxx */
+
+#define MaxHatchStyle 5
+/*
+ endif
+
+
+
+
+; Logical Pen Structure
+
+LogPen struc ;*/ typedef struct { /*
+
+ lopnStyle dw 0 ;(solid, hollow, dashed..) ;*/ unsigned short int lopnStyle;/*
+ lopnWidth dw 0 ;This is really a point type ;*/ PTTYPE lopnWidth;/*
+ dw 0
+ lopnColor dd 0 ;*/ unsigned long int lopnColor;/*
+
+LogPen ends ;*/ } LOGPEN; /*
+
+ errnz <(SIZE PTTYPE) -4>
+
+
+
+; Line Style definitions
+
+LS_SOLID equ 0
+LS_DASHED equ 1
+LS_DOTTED equ 2
+LS_DOTDASHED equ 3
+LS_DASHDOTDOT equ 4
+LS_NOLINE equ 5
+LS_INSIDEFRAME equ 6
+
+MaxLineStyle equ LS_NOLINE
+
+ if 0
+*/
+/* Line Style definitions used by GDI support routines written in C */
+
+#define LS_SOLID 0
+#define LS_DASHED 1
+#define LS_DOTTED 2
+#define LS_DOTDASHED 3
+#define LS_DASHDOTDOT 4
+#define LS_NOLINE 5
+#define LS_INSIDEFRAME 6
+#define MaxLineStyle LS_NOLINE
+/*
+ endif
+
+
+
+; Various constants for defining a logical font.
+OUT_DEFAULT_PRECIS equ 0
+OUT_STRING_PRECIS equ 1
+OUT_CHARACTER_PRECIS equ 2
+OUT_STROKE_PRECIS equ 3
+OUT_TT_PRECIS equ 4
+OUT_DEVICE_PRECIS equ 5
+OUT_RASTER_PRECIS equ 6
+OUT_TT_ONLY_PRECIS equ 7
+
+CLIP_DEFAULT_PRECIS equ 0
+CLIP_CHARACTER_PRECIS equ 1
+CLIP_STROKE_PRECIS equ 2
+CLIP_MASK equ 00Fh
+CLIP_LH_ANGLES equ 010h
+CLIP_TT_ALWAYS equ 020h
+CLIP_EMBEDDED equ 080h
+
+DEFAULT_QUALITY equ 0
+DRAFT_QUALITY equ 1
+PROOF_QUALITY equ 2
+
+DEFAULT_PITCH equ 0
+FIXED_PITCH equ 1
+VARIABLE_PITCH equ 2
+
+ANSI_CHARSET equ 0
+DEFAULT_CHARSET equ 1
+SYMBOL_CHARSET equ 2
+SHIFTJIS_CHARSET equ 128
+HANGEUL_CHARSET equ 129
+CHINESEBIG5_CHARSET equ 136
+OEM_CHARSET equ 255
+
+
+
+; GDI font families.
+FF_DONTCARE equ 00000000b ; Don't care or don't know.
+FF_ROMAN equ 00010000b ; Variable stroke width, serifed.
+ ; Times Roman, Century Schoolbook, etc.
+FF_SWISS equ 00100000b ; Variable stroke width, sans-serifed.
+ ; Helvetica, Swiss, etc.
+FF_MODERN equ 00110000b ; Constant stroke width, serifed or sans-serifed.
+ ; Pica, Elite, Courier, etc.
+FF_SCRIPT equ 01000000b ; Cursive, etc.
+FF_DECORATIVE equ 01010000b ; Old English, etc.
+
+
+; Font weights lightest to darkest.
+FW_DONTCARE equ 0d
+FW_THIN equ 100d
+FW_EXTRALIGHT equ 200d
+FW_LIGHT equ 300d
+FW_NORMAL equ 400d
+FW_MEDIUM equ 500d
+FW_SEMIBOLD equ 600d
+FW_BOLD equ 700d
+FW_EXTRABOLD equ 800d
+FW_HEAVY equ 900d
+
+FW_ULTRALIGHT equ FW_EXTRALIGHT
+FW_REGULAR equ FW_NORMAL
+FW_DEMIBOLD equ FW_SEMIBOLD
+FW_ULTRABOLD equ FW_EXTRABOLD
+FW_BLACK equ FW_HEAVY
+
+
+; Enumeration font types.
+RASTER_FONTTYPE equ 1
+DEVICE_FONTTYPE equ 2
+
+ if 0
+*/
+
+/* The size to allocate for the lfFaceName field in the logical font. */
+#ifndef LF_FACESIZE
+#define LF_FACESIZE 32
+#endif
+
+/* Various constants for defining a logical font. */
+#define OUT_DEFAULT_PRECIS 0
+#define OUT_STRING_PRECIS 1
+#define OUT_CHARACTER_PRECIS 2
+#define OUT_STROKE_PRECIS 3
+#define OUT_TT_PRECIS 4
+#define OUT_DEVICE_PRECIS 5
+#define OUT_RASTER_PRECIS 6
+#define OUT_TT_ONLY_PRECIS 7
+
+#define CLIP_DEFAULT_PRECIS 0
+#define CLIP_CHARACTER_PRECIS 1
+#define CLIP_STROKE_PRECIS 2
+#define CLIP_MASK 0x0F
+#define CLIP_LH_ANGLES 0x10
+#define CLIP_TT_ALWAYS 0x20
+#define CLIP_EMBEDDED 0x80
+
+#define DEFAULT_QUALITY 0
+#define DRAFT_QUALITY 1
+#define PROOF_QUALITY 2
+
+#define DEFAULT_PITCH 0
+#define FIXED_PITCH 1
+#define VARIABLE_PITCH 2
+
+#define ANSI_CHARSET 0
+#define DEFAULT_CHARSET 1
+#define SYMBOL_CHARSET 2
+#define SHIFTJIS_CHARSET 128
+#define HANGEUL_CHARSET 129
+#define CHINESEBIG5_CHARSET 136
+#define OEM_CHARSET 255
+
+
+/* GDI font families. */
+#define FF_DONTCARE (0<<4) /* Don't care or don't know. */
+#define FF_ROMAN (1<<4) /* Variable stroke width, serifed. */
+ /* Times Roman, Century Schoolbook, etc.*/
+#define FF_SWISS (2<<4) /* Variable stroke width, sans-serifed. */
+ /* Helvetica, Swiss, etc. */
+#define FF_MODERN (3<<4) /* Constant stroke width, serifed or sans-serifed. */
+ /* Pica, Elite, Courier, etc. */
+#define FF_SCRIPT (4<<4) /* Cursive, etc. */
+#define FF_DECORATIVE (5<<4) /* Old English, etc. */
+
+
+/* Font weights lightest to darkest. */
+#define FW_DONTCARE 0
+#define FW_THIN 100
+#define FW_EXTRALIGHT 200
+#define FW_LIGHT 300
+#define FW_NORMAL 400
+#define FW_MEDIUM 500
+#define FW_SEMIBOLD 600
+#define FW_BOLD 700
+#define FW_EXTRABOLD 800
+#define FW_HEAVY 900
+
+#define FW_ULTRALIGHT FW_EXTRALIGHT
+#define FW_REGULAR FW_NORMAL
+#define FW_DEMIBOLD FW_SEMIBOLD
+#define FW_ULTRABOLD FW_EXTRABOLD
+#define FW_BLACK FW_HEAVY
+
+/* Enumeration font types. */
+#define RASTER_FONTTYPE 1
+#define DEVICE_FONTTYPE 2
+
+/*
+ endif
+
+
+LogFont struc ;*/ typedef struct { /*
+
+ lfHeight dw 0 ;*/ short int lfHeight; /*
+ lfWidth dw 0 ;*/ short int lfWidth; /*
+ lfEscapement dw 0 ;*/ short int lfEscapement; /*
+ lfOrientation dw 0 ;*/ short int lfOrientation; /*
+ lfWeight dw 0 ;*/ short int lfWeight; /*
+ lfItalic db 0 ;*/ BYTE lfItalic; /*
+ lfUnderline db 0 ;*/ BYTE lfUnderline; /*
+ lfStrikeOut db 0 ;*/ BYTE lfStrikeOut; /*
+ lfCharSet db 0 ;*/ BYTE lfCharSet; /*
+ lfOutPrecision db 0 ;*/ BYTE lfOutPrecision; /*
+ lfClipPrecision db 0 ;*/ BYTE lfClipPrecision; /*
+ lfQuality db 0 ;*/ BYTE lfQuality; /*
+ lfPitchAndFamily db 0 ;*/ BYTE lfPitchAndFamily; /*
+ lfFaceName db 0 ; A variable length field for the face name.;*/ BYTE lfFaceName[LF_FACESIZE]; /*
+
+LogFont ends ;*/ } LOGFONT; /*
+
+
+ endif
+ endif
+page
+; Device Definitions - incDevice
+
+
+ ifdef incDevice
+ if incDevice
+
+
+InquireInfo = 00000001b ;Inquire Device GDI Info
+EnableDevice = 00000000b ;Enable Device
+InfoContext = 8000h ;Inquire/Enable for information context
+
+
+
+; Device Technologies
+
+DT_PLOTTER equ 0 ; Vector plotter
+DT_RASDISPLAY equ 1 ; Raster display
+DT_RASPRINTER equ 2 ; Raster printer
+DT_RASCAMERA equ 3 ; Raster camera
+DT_CHARSTREAM equ 4 ; Character-stream, PLP
+DT_METAFILE equ 5 ; Metafile, VDM
+DT_DISPFILE equ 6 ; Display-file
+
+
+; Curve Capabilities
+
+CC_NONE equ 00000000B ; Curves not supported
+CC_CIRCLES equ 00000001B ; Can do circles
+CC_PIE equ 00000010B ; Can do pie wedges
+CC_CHORD equ 00000100B ; Can do chord arcs
+CC_ELLIPSES equ 00001000B ; Can do ellipese
+CC_WIDE equ 00010000B ; Can do wide lines
+CC_STYLED equ 00100000B ; Can do styled lines
+CC_WIDESTYLED equ 01000000B ; Can do wide styled lines
+CC_INTERIORS equ 10000000B ; Can do interiors
+CC_ROUNDRECT equ 0100000000B ; Can do round rectangles
+
+
+; Line Capabilities
+
+LC_NONE equ 00000000B ; Lines not supported
+; equ 00000001B ;
+LC_POLYLINE equ 00000010B ; Can do polylines
+LC_MARKER equ 00000100B ; Can do markers
+LC_POLYMARKER equ 00001000B ; Can do polymarkers
+LC_WIDE equ 00010000B ; Can do wide lines
+LC_STYLED equ 00100000B ; Can do styled lines
+LC_WIDESTYLED equ 01000000B ; Can do wide styled lines
+LC_INTERIORS equ 10000000B ; Can do interiors
+
+
+; Polygonal Capabilities
+
+PC_NONE equ 00000000B ; Polygonals not supported
+PC_POLYGON equ 00000001B ; Can do polygons
+PC_RECTANGLE equ 00000010B ; Can do rectangles
+PC_WINDPOLYGON equ 00000100B ; Can do winding polygons
+PC_TRAPEZOID equ 00000100B ; Can do trapezoids
+PC_SCANLINE equ 00001000B ; Can do scanlines
+PC_WIDE equ 00010000B ; Can do wide borders
+PC_STYLED equ 00100000B ; Can do styled borders
+PC_WIDESTYLED equ 01000000B ; Can do wide styled borders
+PC_INTERIORS equ 10000000B ; Can do interiors
+
+; Clipping Capabilities
+
+CP_NONE equ 00000000B ; No clipping at device level
+CP_RECTANGLE equ 00000001B ; Device Output clips to rectangles
+
+; Text Capabilities
+
+TC_NONE equ 0000000000000000B ; Text not supported
+TC_OP_CHARACTER equ 0000000000000001B ; Can do OutputPrecision CHARACTER
+TC_OP_STROKE equ 0000000000000010B ; Can do OutputPrecision STROKE
+TC_CP_STROKE equ 0000000000000100B ; Can do ClipPrecision STROKE
+TC_CR_90 equ 0000000000001000B ; Can do CharRotAbility 90
+TC_CR_ANY equ 0000000000010000B ; Can do CharRotAbility ANY
+TC_SF_X_YINDEP equ 0000000000100000B ; Can do ScaleFreedom X_YINDEPENDENT
+TC_SA_DOUBLE equ 0000000001000000B ; Can do ScaleAbility DOUBLE
+TC_SA_INTEGER equ 0000000010000000B ; Can do ScaleAbility INTEGER
+TC_SA_CONTIN equ 0000000100000000B ; Can do ScaleAbility CONTINUOUS
+TC_EA_DOUBLE equ 0000001000000000B ; Can do EmboldenAbility DOUBLE
+TC_IA_ABLE equ 0000010000000000B ; Can do ItalisizeAbility ABLE
+TC_UA_ABLE equ 0000100000000000B ; Can do UnderlineAbility ABLE
+TC_SO_ABLE equ 0001000000000000B ; Can do StrikeOutAbility ABLE
+TC_RA_ABLE equ 0010000000000000B ; Can do RasterFontAble ABLE
+TC_VA_ABLE equ 0100000000000000B ; Can do VectorFontAble ABLE
+TC_RESERVED equ 1000000000000000B ; Reserved. Must be returned zero.
+
+
+; Raster Capabilities
+
+RC_NONE equ 0000000000000000b ; No Raster Capabilities
+RC_BITBLT equ 0000000000000001b ; Can do bitblt
+RC_BANDING equ 0000000000000010b ; Requires banding support
+RC_SCALING equ 0000000000000100b ; Requires scaling support
+RC_BITMAP64 equ 0000000000001000b ; supports >64k bitmaps
+RC_GDI20_OUTPUT equ 0000000000010000b ; supports Window 2.0 output functions
+RC_GDI20_STATE equ 0000000000100000b ; DC has state block
+RC_SAVEBITMAP equ 0000000001000000b ; can save bitmaps locally
+RC_DI_BITMAP equ 0000000010000000b ; can do device independent bitmaps
+RC_PALETTE equ 0000000100000000b ; can do color palette management
+RC_DIBTODEV equ 0000001000000000b ; can do SetDIBitsToDevice
+RC_BIGFONT equ 0000010000000000b ; does BIGFONTs
+RC_STRETCHBLT equ 0000100000000000b ; can do StretchBlt
+RC_FLOODFILL equ 0001000000000000b ; can do FloodFill
+RC_STRETCHDIB equ 0010000000000000b ; can do StretchDIBits
+RC_OP_DX_OUTPUT equ 0100000000000000b ; can do opaque ext text out
+
+; DC Management Flags
+
+DC_SPDevice equ 00000001b ;Seperate PDevice required per device/filename
+DC_1PDevice equ 00000010b ;Only 1 PDevice allowed per device/filename
+DC_IgnoreDFNP equ 00000100b ;Ignore device/filename pairs when matching
+
+
+; dpCaps1 capability bits
+
+C1_TRANSPARENT equ 0000000000000001b ; supports transparency
+TC_TT_ABLE equ 0000000000000010b ; can do TT fonts through DDI or brute
+C1_TT_CR_ANY equ 0000000000000100b ; can do rotated TT fonts
+
+ if 0
+*/
+
+#define InquireInfo 0x01 /* Inquire Device GDI Info */
+#define EnableDevice 0x00 /* Enable Device */
+#define InfoContext 0x8000 /* Inquire/Enable for info context */
+
+
+/* Device Technologies */
+
+#define DT_PLOTTER 0 /* Vector plotter */
+#define DT_RASDISPLAY 1 /* Raster display */
+#define DT_RASPRINTER 2 /* Raster printer */
+#define DT_RASCAMERA 3 /* Raster camera */
+#define DT_CHARSTREAM 4 /* Character-stream, PLP */
+#define DT_METAFILE 5 /* Metafile, VDM */
+#define DT_DISPFILE 6 /* Display-file */
+
+/* Curve Capabilities */
+
+#define CC_NONE 00000000 /* Curves not supported */
+#define CC_CIRCLES 00000001 /* Can do circles */
+#define CC_PIE 00000002 /* Can do pie wedges */
+#define CC_CHORD 00000004 /* Can do chord arcs */
+#define CC_ELLIPSES 00000010 /* Can do ellipese */
+#define CC_WIDE 00000020 /* Can do wide lines */
+#define CC_STYLED 00000040 /* Can do styled lines */
+#define CC_WIDESTYLED 00000100 /* Can do wide styled lines*/
+#define CC_INTERIORS 00000200 /* Can do interiors */
+#define CC_ROUNDRECT 0x0100 /* Can do round rectangles */
+
+/* Line Capabilities */
+
+#define LC_NONE 00000000 /* Lines not supported */
+#define LC_POLYLINE 00000002 /* Can do polylines */
+#define LC_MARKER 00000004 /* Can do markers */
+#define LC_POLYMARKER 00000010 /* Can do polymarkers */
+#define LC_WIDE 00000020 /* Can do wide lines */
+#define LC_STYLED 00000040 /* Can do styled lines */
+#define LC_WIDESTYLED 00000100 /* Can do wide styled lines*/
+#define LC_INTERIORS 00000200 /* Can do interiors */
+
+/* Polygonal Capabilities */
+
+#define PC_NONE 00000000 /* Polygonals not supported*/
+#define PC_POLYGON 00000001 /* Can do polygons */
+#define PC_RECTANGLE 00000002 /* Can do rectangles */
+#define PC_WINDPOLYGON 00000004 /* Can do winding polygons */
+#define PC_TRAPEZOID 00000004 /* Can do trapezoids */
+#define PC_SCANLINE 00000010 /* Can do scanlines */
+#define PC_WIDE 00000020 /* Can do wide borders */
+#define PC_STYLED 00000040 /* Can do styled borders */
+#define PC_WIDESTYLED 00000100 /* Can do wide styled borders*/
+#define PC_INTERIORS 00000200 /* Can do interiors */
+
+/* Polygonal Capabilities */
+
+#define CP_NONE 00000000 /* no clipping of Output */
+#define CP_RECTANGLE 00000001 /* Output clipped to Rects */
+
+/* Text Capabilities */
+
+#define TC_OP_CHARACTER 0000001 /* Can do OutputPrecision CHARACTER */
+#define TC_OP_STROKE 0000002 /* Can do OutputPrecision STROKE */
+#define TC_CP_STROKE 0000004 /* Can do ClipPrecision STROKE */
+#define TC_CR_90 0000010 /* Can do CharRotAbility 90 */
+#define TC_CR_ANY 0000020 /* Can do CharRotAbility ANY */
+#define TC_SF_X_YINDEP 0000040 /* Can do ScaleFreedom X_YINDEPENDENT */
+#define TC_SA_DOUBLE 0000100 /* Can do ScaleAbility DOUBLE */
+#define TC_SA_INTEGER 0000200 /* Can do ScaleAbility INTEGER */
+#define TC_SA_CONTIN 0000400 /* Can do ScaleAbility CONTINUOUS */
+#define TC_EA_DOUBLE 0001000 /* Can do EmboldenAbility DOUBLE */
+#define TC_IA_ABLE 0002000 /* Can do ItalisizeAbility ABLE */
+#define TC_UA_ABLE 0004000 /* Can do UnderlineAbility ABLE */
+#define TC_SO_ABLE 0010000 /* Can do StrikeOutAbility ABLE */
+#define TC_RA_ABLE 0020000 /* Can do RasterFontAble ABLE */
+#define TC_VA_ABLE 0040000 /* Can do VectorFontAble ABLE */
+#define TC_RESERVED 0100000 /* Reserved. Must be returned zero. */
+
+/* Raster Capabilities */
+
+#define RC_NONE 00000000 /* No Raster Capabilities */
+#define RC_BITBLT 00000001 /* Can do bitblt */
+#define RC_BANDING 00000002 /* Requires banding support */
+#define RC_SCALING 00000004 /* Requires scaling support */
+#define RC_BITMAP64 00000010 /* supports >64k bitmaps */
+#define RC_GDI20_OUTPUT 00000020 /* support Windows 2.0 functions */
+#define RC_GDI20_STATE 00000040 /* dc has a state block */
+#define RC_SAVEBITMAP 00000100 /* can save bitmaps locally */
+
+#define RC_DI_BITMAP 00000200 /* can do device independent bitmaps*/
+#define RC_PALETTE 00000400 /* can do color palette management */
+#define RC_DIBTODEV 00001000 /* can do SetDIBitsToDevice */
+#define RC_BIGFONT 00002000 /* does BIGFONTs */
+#define RC_STRETCHBLT 00004000 /* can do StretchBlt */
+#define RC_FLOODFILL 00010000 /* can do FloodFill */
+#define RC_STRETCHDIB 00020000 /* can do StretchDIBits */
+
+/* DC Management Flags */
+
+#define DC_SPDevice 0000001 /* Seperate PDevice required per device/filename */
+#define DC_1PDevice 0000002 /* Only 1 PDevice allowed per device/filename */
+#define DC_IgnoreDFNP 0000004 /* Ignore device/filename pairs when matching */
+
+/* dpCaps1 capability bits */
+
+#define C1_TRANSPARENT 0x0001 /* supports transparency */
+#define TC_TT_ABLE 0x0002 /* can do TT fonts through DDI or brute */
+#define C1_TT_CR_ANY 0x0004 /* can do rotated TT fonts */
+
+/*
+ endif
+
+GDIINFO struc ;*/ typedef struct { /*
+
+ dpVersion dw 0 ; Version = 0100h for now ;*/ short int dpVersion; /*
+ dpTechnology dw 0 ; Device classification ;*/ short int dpTechnology; /*
+ dpHorzSize dw 0 ; Horizontal size in millimeters ;*/ short int dpHorzSize; /*
+ dpVertSize dw 0 ; Vertical size in millimeters ;*/ short int dpVertSize; /*
+ dpHorzRes dw 0 ; Horizontal width in pixels ;*/ short int dpHorzRes; /*
+ dpVertRes dw 0 ; Vertical width in pixels ;*/ short int dpVertRes; /*
+ dpBitsPixel dw 0 ; Number of bits per pixel ;*/ short int dpBitsPixel; /*
+ dpPlanes dw 0 ; Number of planes ;*/ short int dpPlanes; /*
+ dpNumBrushes dw 0 ; Number of brushes the device has ;*/ short int dpNumBrushes; /*
+ dpNumPens dw 0 ; Number of pens the device has ;*/ short int dpNumPens; /*
+ dw 0 ; Number of markers the device has ;*/ short int futureuse; /*
+ dpNumFonts dw 0 ; Number of fonts the device has ;*/ short int dpNumFonts; /*
+ dpNumColors dw 0 ; Number of colors in color table ;*/ short int dpNumColors; /*
+ dpDEVICEsize dw 0 ; Size required for the device descriptor ;*/ short int dpDEVICEsize; /*
+ dpCurves dw 0 ; Curves capabilities ;*/ unsigned short int /*
+ ;*/ dpCurves; /*
+ dpLines dw 0 ; Line capabilities ;*/ unsigned short int /*
+ ;*/ dpLines; /*
+ dpPolygonals dw 0 ; Polygonal capabilities ;*/ unsigned short int /*
+ ;*/ dpPolygonals; /*
+ dpText dw 0 ; Text capabilities ;*/ unsigned short int /*
+ ;*/ dpText; /*
+ dpClip dw 0 ; Clipping capabilities ;*/ unsigned short int /*
+ ;*/ dpClip; /*
+ dpRaster dw 0 ; Bitblt capabilities ;*/ unsigned short int /*
+ ;*/ dpRaster; /*
+ dpAspectX dw 0 ; Length of X leg ;*/ short int dpAspectX; /*
+ dpAspectY dw 0 ; Length of Y leg ;*/ short int dpAspectY; /*
+ dpAspectXY dw 0 ; Length of hypotenuse ;*/ short int dpAspectXY; /*
+ dpStyleLen dw 0 ; Length of segment for line styles ;*/ short int dpStyleLen; /*
+ dpMLoWin dw 0 ; Metric Lo res WinX,WinY (PTTYPE) ;*/ PTTYPE dpMLoWin; /*
+ dw 0
+ dpMLoVpt dw 0 ; Metric Lo res VptX,VptY (PTTYPE) ;*/ PTTYPE dpMLoVpt; /*
+ dw 0
+ dpMHiWin dw 0 ; Metric Hi res WinX,WinY (PTTYPE) ;*/ PTTYPE dpMHiWin; /*
+ dw 0
+ dpMHiVpt dw 0 ; Metric Hi res VptX,VptY (PTTYPE) ;*/ PTTYPE dpMHiVpt; /*
+ dw 0
+ dpELoWin dw 0 ; English Lo res WinX,WinY (PTTYPE) ;*/ PTTYPE dpELoWin; /*
+ dw 0
+ dpELoVpt dw 0 ; English Lo res VptX,VptY (PTTYPE) ;*/ PTTYPE dpELoVpt; /*
+ dw 0
+ dpEHiWin dw 0 ; English Hi res WinX,WinY (PTTYPE) ;*/ PTTYPE dpEHiWin; /*
+ dw 0
+ dpEHiVpt dw 0 ; English Hi res VptX,VptY (PTTYPE) ;*/ PTTYPE dpEHiVpt; /*
+ dw 0
+ dpTwpWin dw 0 ; Twips WinX,WinY (PTTYPE) ;*/ PTTYPE dpTwpWin; /*
+ dw 0
+ dpTwpVpt dw 0 ; Twips VptX,VptY (PTTYPE) ;*/ PTTYPE dpTwpVpt; /*
+ dw 0
+ dpLogPixelsX dw 0 ;Logical pixels/inch in X ;*/ short int dpLogPixelsX; /*
+ dpLogPixelsY dw 0 ;Logical pixels/inch in Y ;*/ short int dpLogPixelsY; /*
+ dpDCManage dw 0 ;DC Management flags ;*/ short int dpDCManage; /*
+ dpCaps1 dw 0 ; more capability bits ;*/ unsigned short int dpCaps1; /*
+ dpSpotSizeX dw 0 ;*/ short int futureuse4; /*
+ dw 0 ;*/ short int futureuse5; /*
+ dpSpotSizeY dw 0 ;*/ short int futureuse6; /*
+ dw 0 ;*/ short int futureuse7; /*
+
+; start of entries in version 3.0 of this structure
+
+ dpNumPalReg dw 0 ; Number of entries in device's palette ;*/ WORD dpNumPalReg; /*
+ dpPalReserved dw 0 ; Number of reserved entries palette ;*/ WORD dpPalReserved; /*
+ dpColorRes dw 0 ; bits of color resolution (total) ;*/ WORD dpColorRes; /*
+GDIINFO ends ;*/ } GDIINFO; /*
+
+ endif
+ endif
+
+
+page
+; Font Definitions
+ ifdef incFont
+ if incFont
+
+
+PF_BITS_IS_ADDRESS equ 4
+PF_DEVICE_REALIZED equ 10000000B
+PF_RASTER_TYPE equ 0
+PF_VECTOR_TYPE equ 1
+PF_OTHER1_TYPE equ 2
+PF_OTHER2_TYPE equ 3
+
+
+ if 0
+*/
+
+/* This bit in the dfType field signals that the dfBitsOffset field is an
+ absolute memory address and should not be altered. */
+#define PF_BITS_IS_ADDRESS 4
+
+/* This bit in the dfType field signals that the font is device realized. */
+#define PF_DEVICE_REALIZED 0x80
+
+/* These bits in the dfType give the fonttype -
+ raster, vector, other1, other2. */
+#define PF_RASTER_TYPE 0
+#define PF_VECTOR_TYPE 1
+#define PF_OTHER1_TYPE 2
+#define PF_OTHER2_TYPE 3
+
+/* The size to allocate for the dfMaps field in the physical font. */
+#ifndef DF_MAPSIZE
+#define DF_MAPSIZE 1
+#endif
+
+/*
+ endif
+
+
+; Font data structure passed to OEM routines. Refer to chapters 12 and
+; 13 of the OEM adaptation guide for a complete description.
+
+
+FONTINFO struc ;*/ typedef struct { /*
+
+ dfType dw 0 ; Type field for the font. ;*/ short int dfType; /*
+ dfPoints dw 0 ; Point size of font. ;*/ short int dfPoints; /*
+ dfVertRes dw 0 ; Vertical digitization. ;*/ short int dfVertRes; /*
+ dfHorizRes dw 0 ; Horizontal digitization. ;*/ short int dfHorizRes; /*
+ dfAscent dw 0 ; Baseline offset from char cell top. ;*/ short int dfAscent; /*
+ dfInternalLeading dw 0 ; Internal leading included in font ;*/ short int dfInternalLeading; /*
+ dfExternalLeading dw 0 ; Prefered extra space between lines ;*/ short int dfExternalLeading; /*
+ dfItalic db 0 ; Flag specifying if italic. ;*/ BYTE dfItalic; /*
+ dfUnderline db 0 ; Flag specifying if underlined. ;*/ BYTE dfUnderline; /*
+ dfStrikeOut db 0 ; Flag specifying if struck out. ;*/ BYTE dfStrikeOut; /*
+ dfWeight dw 0 ; Weight of font. ;*/ short int dfWeight; /*
+ dfCharSet db 0 ; Character set of font. ;*/ BYTE dfCharSet; /*
+ dfPixWidth dw 0 ; Width field for the font. ;*/ short int dfPixWidth; /*
+ dfPixHeight dw 0 ; Height field for the font. ;*/ short int dfPixHeight; /*
+ dfPitchAndFamily db 0 ; Flag specifying variable pitch, family. ;*/ BYTE dfPitchAndFamily; /*
+ dfAvgWidth dw 0 ; Average character width. ;*/ short int dfAvgWidth; /*
+ dfMaxWidth dw 0 ; Maximum character width. ;*/ short int dfMaxWidth; /*
+ dfFirstChar db 0 ; First character in the font. ;*/ BYTE dfFirstChar; /*
+ dfLastChar db 0 ; Last character in the font. ;*/ BYTE dfLastChar; /*
+ dfDefaultChar db 0 ; Default character for out of range. ;*/ BYTE dfDefaultChar; /*
+ dfBreakChar db 0 ; Character to define wordbreaks. ;*/ BYTE dfBreakChar; /*
+ dfWidthBytes dw 0 ; Number of bytes in each row. ;*/ short int dfWidthBytes; /*
+ dfDevice dd 0 ; Offset to device name. ;*/ unsigned long int dfDevice; /*
+ dfFace dd 0 ; Offset to face name. ;*/ unsigned long int dfFace; /*
+ dfBitsPointer dd 0 ; Bits pointer. ;*/ unsigned long int dfBitsPointer;/*
+ dfBitsOffset dd 0 ; Offset to the begining of the bitmap. ;*/ unsigned long int dfBitsOffset;/*
+ ; On the disk, this is relative to the
+ ; begining of the file. In memory this is
+ ; relative to the begining of this structure.
+ dfReservedByte db 0 ; filler byte to WORD-align charoffset ;*/ BYTE dfReservedByte; /*
+ dfCharOffset dw 0 ; Area for storing the character offsets, ;*/ unsigned short dfMaps[DF_MAPSIZE];/*
+ ; facename, device name (opt), and bitmap.
+
+FONTINFO ends ;*/ } FONTINFO; /*
+
+SCALABLEFONTINFO struc ;*/ typedef struct { /*
+ erType dw 0 ; Type field for the font. ;*/ short int erType; /*
+ erPoints dw 0 ; Point size of font. ;*/ short int erPoints; /*
+ erVertRes dw 0 ; Vertical digitization. ;*/ short int erVertRes; /*
+ erHorizRes dw 0 ; Horizontal digitization. ;*/ short int erHorizRes; /*
+ erAscent dw 0 ; Baseline offset from char cell top. ;*/ short int erAscent; /*
+ erInternalLeading dw 0 ; Internal leading included in font ;*/ short int erInternalLeading; /*
+ erExternalLeading dw 0 ; Prefered extra space between lines ;*/ short int erExternalLeading; /*
+ erItalic db 0 ; Flag specifying if italic. ;*/ BYTE erItalic; /*
+ erUnderline db 0 ; Flag specifying if underlined. ;*/ BYTE erUnderline; /*
+ erStrikeOut db 0 ; Flag specifying if struck out. ;*/ BYTE erStrikeOut; /*
+ erWeight dw 0 ; Weight of font. ;*/ short int erWeight; /*
+ erCharSet db 0 ; Character set of font. ;*/ BYTE erCharSet; /*
+ erPixWidth dw 0 ; Width field for the font. ;*/ short int erPixWidth; /*
+ erPixHeight dw 0 ; Height field for the font. ;*/ short int erPixHeight; /*
+ erPitchAndFamily db 0 ; Flag specifying pitch and family. ;*/ BYTE erPitchAndFamily; /*
+ erAvgWidth dw 0 ; Average character width. ;*/ short int erAvgWidth; /*
+ erMaxWidth dw 0 ; Maximum character width. ;*/ short int erMaxWidth; /*
+ erFirstChar db 0 ; First character in the font. ;*/ BYTE erFirstChar; /*
+ erLastChar db 0 ; Last character in the font. ;*/ BYTE erLastChar; /*
+ erDefaultChar db 0 ; Default character for out of range. ;*/ BYTE erDefaultChar; /*
+ erBreakChar db 0 ; Character to define wordbreaks. ;*/ BYTE erBreakChar; /*
+ erWidthBytes dw 0 ; Number of bytes in each row. ;*/ short int erWidthBytes; /*
+ erDevice dd 0 ; Offset to device name. ;*/ unsigned long int erDevice; /*
+ erFace dd 0 ; Offset to face name. ;*/ unsigned long int erFace; /*
+ erBitsPointer dd 0 ; Bits pointer. ;*/ unsigned long int erBitsPointer;/*
+ erBitsOffset dd 0 ; Offset to the begining of the bitmap. ;*/ unsigned long int erBitsOffset;/*
+ erFlags db 0 ; flags, and word align the stuff to come ;*/ BYTE erReservedByte; /*
+ erUnderlinePos dw 0 ; underline position relative to cell origin ;*/ short int erUnderlinePos; /*
+ erUnderlineThick dw 0 ; underline thickness ;*/ short int erUnderlineThick;/*
+ erStrikeoutPos dw 0 ; Strikeout position relative to cell origin ;*/ short int erStrikeoutPos; /*
+ erStrikeoutThick dw 0 ; strikeout thickness ;*/ short int erStrikeoutThick;/*
+SCALABLEFONTINFO ends ;*/ } SCALABLEFONTINFO; /*
+
+
+
+
+TEXTXFORM struc ;*/ typedef struct { /*
+
+ ftHeight dw 0 ;*/ short int ftHeight; /*
+ ftWidth dw 0 ;*/ short int ftWidth; /*
+ ftEscapement dw 0 ;*/ short int ftEscapement; /*
+ ftOrientation dw 0 ;*/ short int ftOrientation; /*
+ ftWeight dw 0 ;*/ short int ftWeight; /*
+ ftItalic db 0 ;*/ BYTE ftItalic; /*
+ ftUnderline db 0 ;*/ BYTE ftUnderline; /*
+ ftStrikeOut db 0 ;*/ BYTE ftStrikeOut; /*
+ ftOutPrecision db 0 ;*/ BYTE ftOutPrecision; /*
+ ftClipPrecision db 0 ;*/ BYTE ftClipPrecision; /*
+ ftAccelerator dw 0 ;*/ unsigned short int /*
+ ;*/ ftAccelerator; /*
+ ftOverhang dw 0 ;*/ short int ftOverhang; /*
+
+TEXTXFORM ends ;*/ } TEXTXFORM; /*
+
+
+
+TEXTMETRIC struc ;*/ typedef struct { /*
+
+ tmHeight dw 0 ; Ascent+Descent ;*/ short int tmHeight; /*
+ tmAscent dw 0 ; Pixels above the baseline ;*/ short int tmAscent; /*
+ tmDescent dw 0 ; Pixels below the baseline ;*/ short int tmDescent; /*
+ tmInternalLeading dw 0 ; Internal leading included in font ;*/ short int tmInternalLeading; /*
+ tmExternalLeading dw 0 ; Prefered extra space between lines ;*/ short int tmExternalLeading; /*
+ tmAveCharWidth dw 0 ; Of the letter 'X' ;*/ short int tmAveCharWidth; /*
+ tmMaxCharWidth dw 0 ;*/ short int tmMaxCharWidth; /*
+ tmWeight dw 0 ;*/ short int tmWeight; /*
+ tmItalic db 0 ;*/ BYTE tmItalic; /*
+ tmUnderlined db 0 ;*/ BYTE tmUnderlined; /*
+ tmStruckOut db 0 ;*/ BYTE tmStruckOut; /*
+ tmFirstChar db 0 ;*/ BYTE tmFirstChar; /*
+ tmLastChar db 0 ;*/ BYTE tmLastChar; /*
+ tmDefaultChar db 0 ; dfDefaultChar+dfFirstChar ;*/ BYTE tmDefaultChar; /*
+ tmBreakChar db 0 ; dfBreakChar+dfFirstChar ;*/ BYTE tmBreakChar; /*
+ tmPitchAndFamily db 0 ; Low bit zero if fixed pitch, one if ;*/ BYTE tmPitchAndFamily; /*
+ ; variable. Family in high nibble.
+ tmCharSet db 0 ;*/ BYTE tmCharSet; /*
+ tmOverhang dw 0 ;*/ short int tmOverhang; /*
+ tmDigitizedAspectX dw 0 ; Digitization aspect ratio ;*/ short int tmDigitizedAspectX; /*
+ tmDigitizedAspectY dw 0 ; in X and Y. ;*/ short int tmDigitizedAspectY; /*
+
+TEXTMETRIC ends ;*/ } TEXTMETRIC; /*
+
+
+
+ endif
+ endif
+page
+; Drawing mode definitions - incDrawMode
+
+
+ ifdef incDrawMode
+ if incDrawMode
+
+
+DRAWMODE struc ;*/ typedef struct { /*
+
+ Rop2 dw 0 ;The 16-bit encoded Logical op ;*/ short int Rop2; /*
+ bkMode dw 0 ;Background Mode (for text only) ;*/ short int bkMode; /*
+ bkColor dd 0 ;Physical background Color ;*/ unsigned long int bkColor; /*
+ TextColor dd 0 ;Physical text (forground) color ;*/ unsigned long int TextColor; /*
+ TBreakExtra dw 0 ; total pixles to stuff into a line ;*/ short int TBreakExtra;/*
+ BreakExtra dw 0 ; div(TBreakExtra, BreakCount) ;*/ short int BreakExtra; /*
+ BreakErr dw 0 ; running error term ;*/ short int BreakErr; /*
+ BreakRem dw 0 ; mod(TBreakExtra, BreakCount) ;*/ short int BreakRem; /*
+ BreakCount dw 0 ; count of breaks in the line ;*/ short int BreakCount; /*
+ CharExtra dw 0 ; extra pixles to stuff after each char ;*/ short int CharExtra; /*
+ ; (used to space out a font)
+ LbkColor dd 0 ;Logical background color ;*/ unsigned long int LbkColor; /*
+ LTextColor dd 0 ;Logical Text (forground) color ;*/ unsigned long int LTextColor; /*
+
+DRAWMODE ends ;*/ } DRAWMODE; /*
+
+
+
+; Background Mode definitions
+
+TRANSPARENT equ 1
+OPAQUE equ 2
+
+ if 0
+*/
+/* Background Mode definitions used by GDI support routines written in C */
+
+#define TRANSPARENT 1
+#define OPAQUE 2
+/*
+ endif
+
+
+
+ endif
+ endif
+page
+; Output Definitions - incOutput
+
+ ifdef incOutput
+ if incOutput
+
+
+; Output Style definitions used by GDI
+
+
+OS_ARC equ 3
+OS_SCANLINES equ 4
+OS_RECTANGLE equ 6
+OS_ELLIPSE equ 7
+OS_MARKER equ 8
+OS_POLYLINE equ 18
+OS_TRAPEZOID equ 20
+OS_POLYGON equ 22
+OS_PIE equ 23
+OS_POLYMARKER equ 24
+OS_CHORD equ 39
+OS_CIRCLE equ 55
+
+OS_BEGINNSCAN equ 80
+OS_ENDNSCAN equ 81
+ if 0
+*/
+
+/* Output Style definitions used by GDI support routines written in C */
+
+#define OS_ARC 3
+#define OS_SCANLINES 4
+#define OS_RECTANGLE 6
+#define OS_ELLIPSE 7
+#define OS_MARKER 8
+#define OS_POLYLINE 18
+#define OS_TRAPEZOID 20
+#define OS_POLYGON 22
+#define OS_PIE 23
+#define OS_POLYMARKER 24
+#define OS_CHORD 39
+#define OS_CIRCLE 55
+
+#define OS_BEGINNSCAN 80
+#define OS_ENDNSCAN 81
+/*
+ endif
+
+
+ endif
+ endif
+
+
+ ifdef incControl
+ if incControl
+
+OEM_FAILED equ 8000000
+
+; GDI escape constants
+
+NEWFRAME equ 1
+ABORTDOC equ 2
+NEXTBAND equ 3
+SETCOLORTABLE equ 4
+GETCOLORTABLE equ 5
+FLUSHOUTPUT equ 6
+DRAFTMODE equ 7
+QUERYESCSUPPORT equ 8
+SETPRINTERDC equ 9
+SETABORTPROC equ 9
+STARTDOC equ 10
+ENDDOC equ 11
+GETPHYSPAGESIZE equ 12
+GETPRINTINGOFFSET equ 13
+GETSCALINGFACTOR equ 14
+MFCOMMENT equ 15
+GETPENWIDTH equ 16
+SETCOPYCOUNT equ 17
+SELECTPAPERSOURCE equ 18
+DEVICEDATA equ 19
+PASSTHROUGH equ 19
+GETTECHNOLGY equ 20
+GETTECHNOLOGY equ 20
+SETLINECAP equ 21
+SETLINEJOIN equ 22
+SETMITERLIMIT equ 23
+BANDINFO equ 24
+DRAWPATTERNRECT equ 25
+GETVECTORPENSIZE equ 26
+GETVECTORBRUSHSIZE equ 27
+ENABLEDUPLEX equ 28
+GETSETPAPERBINS equ 29
+GETSETPRINTORIENT equ 30
+ENUMPAPERBINS equ 31
+SETDIBSCALING equ 32
+EPSPRINTING equ 33
+ENUMPAPERMETRICS equ 34
+GETSETPAPERMETRICS equ 35
+POSTSCRIPT_DATA equ 37
+POSTSCRIPT_IGNORE equ 38
+MOUSETRAILS equ 39
+RESETDEVICE equ 128
+GETEXTENDEDTEXTMETRICS equ 256
+GETEXTENTTABLE equ 257
+GETPAIRKERNTABLE equ 258
+GETTRACKKERNTABLE equ 259
+EXTTEXTOUT equ 512
+GETFACENAME equ 513
+ENABLERELATIVEWIDTHS equ 768
+ENABLEPAIRKERNING equ 769
+SETKERNTRACK equ 770
+SETALLJUSTVALUES equ 771
+SETCHARSET equ 772
+
+STRETCHBLT equ 2048
+BEGIN_PATH equ 4096
+CLIP_TO_PATH equ 4097
+END_PATH equ 4098
+EXT_DEVICE_CAPS equ 4099
+RESTORE_CTM equ 4100
+SAVE_CTM equ 4101
+SET_ARC_DIRECTION equ 4102
+SET_BACKGROUND_COLOR equ 4103
+SET_POLY_MODE equ 4104
+SET_SCREEN_ANGLE equ 4105
+SET_SPREAD equ 4106
+TRANSFORM_CTM equ 4107
+SET_CLIP_BOX equ 4108
+SET_BOUNDS equ 4109
+
+
+ if 0
+*/
+#define OEM_FAILED 0x80000000L
+
+#define NEWFRAME 1
+#define ABORTDOC 2
+#define NEXTBAND 3
+#define SETCOLORTABLE 4
+#define GETCOLORTABLE 5
+#define FLUSHOUTPUT 6
+#define DRAFTMODE 7
+#define QUERYESCSUPPORT 8
+#define SETPRINTERDC 9 // DDK - between GDI and Driver
+#define SETABORTPROC 9 // SDK - between APP and GDI
+#define STARTDOC 10
+#define ENDDOC 11
+#define GETPHYSPAGESIZE 12
+#define GETPRINTINGOFFSET 13
+#define GETSCALINGFACTOR 14
+#define MFCOMMENT 15
+#define GETPENWIDTH 16
+#define SETCOPYCOUNT 17
+#define SELECTPAPERSOURCE 18
+#define DEVICEDATA 19
+#define PASSTHROUGH 19
+#define GETTECHNOLGY 20
+#define GETTECHNOLOGY 20
+#define SETLINECAP 21
+#define SETLINEJOIN 22
+#define SETMITERLIMIT 23
+#define BANDINFO 24
+#define DRAWPATTERNRECT 25
+#define GETVECTORPENSIZE 26
+#define GETVECTORBRUSHSIZE 27
+#define ENABLEDUPLEX 28
+#define GETSETPAPERBINS 29
+#define GETSETPRINTORIENT 30
+#define ENUMPAPERBINS 31
+#define SETDIBSCALING 32
+#define EPSPRINTING 33
+#define ENUMPAPERMETRICS 34
+#define GETSETPAPERMETRICS 35
+#define POSTSCRIPT_DATA 37
+#define POSTSCRIPT_IGNORE 38
+#define RESETDEVICE 128
+#define GETEXTENDEDTEXTMETRICS 256
+#define GETEXTENTTABLE 257
+#define GETPAIRKERNTABLE 258
+#define GETTRACKKERNTABLE 259
+#define EXTTEXTOUT 512
+#define GETFACENAME 513
+#define ENABLERELATIVEWIDTHS 768
+#define ENABLEPAIRKERNING 769
+#define SETKERNTRACK 770
+#define SETALLJUSTVALUES 771
+#define SETCHARSET 772
+
+#define STRETCHBLT 2048
+#define BEGIN_PATH 4096
+#define CLIP_TO_PATH 4097
+#define END_PATH 4098
+#define EXT_DEVICE_CAPS 4099
+#define RESTORE_CTM 4100
+#define SAVE_CTM 4101
+#define SET_ARC_DIRECTION 4102
+#define SET_BACKGROUND_COLOR 4103
+#define SET_POLY_MODE 4104
+#define SET_SCREEN_ANGLE 4105
+#define SET_SPREAD 4106
+#define TRANSFORM_CTM 4107
+#define SET_CLIP_BOX 4108
+#define SET_BOUNDS 4109
+
+typedef FONTINFO FAR *LPFONTINFO;
+typedef DRAWMODE FAR *LPDRAWMODE;
+typedef TEXTXFORM FAR *LPTEXTXFORM;
+typedef TEXTMETRIC FAR *LPTEXTMETRIC;
+typedef LOGFONT FAR *LPLOGFONT;
+typedef LOGPEN FAR *LPLOGPEN;
+typedef LOGBRUSH FAR *LPLOGBRUSH;
+typedef BITMAP FAR *LPBITMAP;
+typedef FARPROC FAR *LPFARPROC;
+typedef GDIINFO FAR *LPGDIINFO;
+typedef SCALABLEFONTINFO FAR * LPSCALABLEFONTINFO;
+
+
+/*
+ endif
+
+
+
+ endif
+ endif
+;*/
diff --git a/private/mvdm/wow16/inc/gpfix.inc b/private/mvdm/wow16/inc/gpfix.inc
new file mode 100644
index 000000000..9126a3808
--- /dev/null
+++ b/private/mvdm/wow16/inc/gpfix.inc
@@ -0,0 +1,62 @@
+; GPFix.inc - definitions for GP exception handler code
+; usage -
+; 1) include gpfix.inc
+; 2) bracket critical code with "beg_fault_trap handler" and
+; "end_fault_trap"
+; 3) define a handler entry point where execution should continue
+; a) this must be in the same code segment as the faulty code
+; b) two extra words (fault IP/fault) will be pushed on the stack when
+; an exception occurs. They should be popped before continuing.
+; This can be done with the 'fault_fix_stack' macro.
+; They are there if you want to determine which instruction faulted.
+; c) This handler can do whatever it likes. Usually, it will return
+; an error code to the caller.
+; 4) if you don't want to worry about the extra values on the stack,
+; use the fix_fault_stack macro to remove them
+
+_bft_count = 0
+_eft_count = 0
+
+_bft_ macro handler, count
+ _bft_&count:
+ _hft_&count = handler
+endm
+
+;
+; Begin fault critical region. 'handler' is the address of
+; the exception handler to jmp to if a fault occurs.
+;
+beg_fault_trap macro handler
+ if _bft_count - _eft_count
+ .err
+ %out Mismatched beg_fault_trap/end_fault_trap pairs in beg_fault_trap
+ endif
+ _bft_ handler, %_bft_count
+ _bft_count = _bft_count + 1
+endm
+
+_eft_ macro count
+ _eft_&count:
+ _GPFIX SEGMENT WORD PUBLIC 'CODE'
+ dw seg _bft_&count, _bft_&count, _eft_&count, _hft_&count
+ _GPFIX ENDS
+endm
+
+;
+; End fault critical region.
+;
+end_fault_trap macro
+ _eft_ %_eft_count
+ _eft_count = _eft_count+1
+ if _bft_count - _eft_count
+ .err
+ %out Mismatched beg_fault_trap/end_fault_trap pairs in end_fault_trap
+ endif
+endm
+
+;
+; Clean up stack in fault handler.
+;
+fault_fix_stack macro
+ add sp, 4
+endm
diff --git a/private/mvdm/wow16/inc/header.txt b/private/mvdm/wow16/inc/header.txt
new file mode 100644
index 000000000..05837cef7
--- /dev/null
+++ b/private/mvdm/wow16/inc/header.txt
@@ -0,0 +1,364 @@
+ Header File Organization
+ ------------------------
+
+This document describes the rules for public Windows 3.1 header files. These
+rules are designed to promote consistency, clarity, Win32 compatibility, ANSI
+compatibility, motherhood, and apple pie a la mode.
+
+In the past, windows.h has been fairly randomly organized: it wasn't very
+easy to look in the file and figure out how constants, types, and functions
+are related. However, the new windows.h is much more rationally organized,
+and it's now far easier to understand and modify. In interests of
+consistency, readability, and maintainability, it's important that all of our
+public header files are consistently organized.
+
+ * Include a copyright banner at the top of the file. Something like:
+
+/*****************************************************************************\
+* *
+* header.h - Brief description of purpose of header file *
+* *
+* Version 3.10 * *
+* *
+* Copyright (c) 1992, Microsoft Corp. All rights reserved. *
+* *
+\*****************************************************************************/
+
+ If this header file has been released before, the copyright date
+ should be something like: 1985-1992.
+
+ * Arrange your header in functional groups, like windows.h. Try to
+ keep related types, structures, constants and functions as close
+ together as possible in the header. Separate functional groups
+ within the header with a banner comment, as in windows.h.
+
+ * Within a functional group, general typedefs and constants should come
+ first, followed by logically organized function prototypes.
+
+ * Constants or types used by only one or two functions should be
+ declared near the function.
+
+ * Make sure that everything defined in the header file is included by
+ default: don't require people to #define things to get certain
+ definitions.
+
+ * If you do want to break up your header file, use the #define NOXXX
+ convention used by windows.h. Try not to have too many groups
+ controled by NOXXX #defines, because they get confusing and hard to
+ deal with. Compiler speed and memory capacity is not the problem it
+ once was, especially with precompiled headers.
+
+ * Constants designed to be ANDed or ORed should be defined in hex.
+ The number of digits should reflect the data size: 2 for bytes,
+ 4 for words, and 8 for longs. Long hex constants should have
+ an appended L, e.g., 0x12345678L.
+
+ * Ordinal constants values (e.g., 1, 2, 3, 4) should be declared
+ in decimal.
+
+ * Provide a comment on all #else's and #endif's that suggests its
+ corresponding #ifdef: e.g.
+
+ #ifdef FOO
+ ...
+ #else /* FOO */
+
+ #endif /* !FOO */
+
+ * Precede the header file with #pragma pack(1), and terminate with
+ #pragma pack(). This ensures that the structures declared in the
+ header will be packed properly, regardless of what compiler packing
+ options the user is using for his own code. Because the Windows RC
+ compiler chokes on #pragma statements in .rc files, it's a good idea
+ to include this (and any other #pragmas) in an #ifndef RC_INVOKED.
+
+ #ifndef RC_INVOKED
+ #pragma pack(1) /* Assume byte packing throughout */
+ #endif /* RC_INVOKED */
+
+ and:
+
+ #ifndef RC_INVOKED
+ #pragma pack() /* Revert to default packing */
+ #endif /* RC_INVOKED */
+
+ * Prevent multiple inclusion of your header file with the following
+ construct:
+
+ #ifndef _INC_MYHEADER
+ #define _INC_MYHEADER
+
+ ...body of header...
+
+ #endif /* _INC_MYHEADER */
+
+ This is the convention used by the C runtimes. For each header there
+ is a #define that can be used to determine whether the header has
+ already been included.
+
+
+
+ Win32 Upward Compatibility
+ --------------------------
+
+Part of the goal of 3.1 is to provide a more unified API that will scale with
+minimal pain to 32 bits in Win32. To this end, there are a few things you
+have to worry about in your headers (and in your code, but that's a different
+story...)
+
+In 32-bit Windows, almost all 16 bit parameters, return values, and field
+types have been widened to 32 bits. This allows us to generate much more
+efficient code on the 386 and on RISC machines.
+
+We need a way of declaring the quantities that will "float" to 32 bits in
+32-bit Windows. It turns out that the C language already provides for this
+capability: the "int" type, for example, is 16 bits on 16 bit platforms, but
+is 32 bits on 32 bit platforms. "short" is always 16 bits on any platform,
+"long" is always 32 bits, and "char" is always 8 bits.
+
+So, functions and structures with "int" declarations are already portably
+declared. The problem, though is with the WORD type. "WORD" has become an
+industry-wide synonym for a 16 bit unsigned quantity. But, it's also used
+widely in Windows header files.
+
+Enter the UINT type. The new UINT type is typedef'd as "unsigned int": an
+unsigned value that is 16 bits on 16 bit platforms, and floats to 32 bits on
+32 bit platforms. In the 3.1 headers, UINT is used in place of WORD wherever
+the size of the return value, parameter, or field will change depending on
+the platform.
+
+This is a rule that applies to code you write too: on 32 bit platforms, use
+of the UINT type rather than WORD will generate faster smaller code. But be
+careful of hard-coded size dependencies on WORD: be sure to use sizeof()
+instead of constants, etc.
+
+In some cases there may be structure fields whose size WON'T be changing in
+32-bit windows, perhaps because the structure is used in a file format and
+compatibility is required. If you know ahead of time that this is the case,
+be sure to use short and WORD to indicate 16 bit quantities across platforms.
+There are a few of these exceptions with the 3.1 bitmap information
+structures in windows.h. If you don't know, then use UINT and int.
+
+The new WPARAM, LPARAM, and LRESULT types, used for polymorphic or arbitrary
+parameters and return values (e.g., the SendMessage() function), also provide
+a useful degree of platform isolation. The WPARAM type is similar to UINT in
+that its size varies with the platform. WPARAM should be used in function
+parameter, return value, AND structure declarations, even though its size may
+vary. The use of these types indicates to the programmer that the value must
+be cast and assigned to the proper type before use.
+
+Hence, the following rules:
+
+ * Use int and UINT instead of short or WORD, UNLESS you know for sure
+ that the quantity will remain 16 bits in 32-bit Windows. The Windows
+ HIWORD and LOWORD macros use WORD, for example. Be sure to check your
+ uses of short as well as WORD: there are probably a few lurking out
+ there that should be changed to int. Use int FAR* or UINT FAR* instead
+ of LPINT or LPWORD.
+
+ * Use the LPARAM, WPARAM, and LRESULT types instead of WORD, LONG, or
+ DWORD as appropriate.
+
+
+ ANSI Compatibility
+ ------------------
+
+Public header files should be ANSI compliant so that people can take
+advantage of the highest compiler warning levels possible. This also helps
+ensure that our header files work with a wider range of development tools.
+
+ * Don't define constants, typedefs, or functions named with a preceding
+ underscore. This violates the ANSI namespace conventions. There are
+ a few violations of this rule already in existence (e.g., _lread), but
+ try not to create any new problems. (The rules are actually more
+ complicated than "don't use underscores", but you're safe if you keep
+ away from them).
+
+ * Don't use "//" style comments in the header: these are convenient
+ but non-ANSI, and warning level 4 complains.
+
+ * Always test your header file by compiling it with the -W4 compiler
+ option to ensure that it's ANSI-compatible.
+
+ * Make sure that you have no identifier conflicts with the following
+ C library header files (NOTE: This list may be incomplete. It's
+ a good start, though).
+
+ assert.h
+ ctype.h
+ errno.h
+ float.h
+ limits.h
+ locale.h
+ math.h
+ setjmp.h
+ signal.h
+ stdarg.h
+ stddef.h
+ stdio.h
+ stdlib.h
+ string.h
+ time.h
+
+ * Structure declarations should be declared with the "tag" prefix, rather
+ than a leading underscore, as shown below:
+
+ typedef struct tagFOO
+ {
+ int i;
+ UINT u;
+ } FOO;
+
+ * Declare fully-prototyped typedefs for all callback functions. By
+ convention, the type name should be all caps and end in PROC. For
+ example, the window procedure callback function typedef from windows.h:
+
+ typedef LRESULT (CALLBACK* WNDPROC)(HWND, UINT, WPARAM, LPARAM);
+
+ Windows 3.0 Backward Compatibility
+ ----------------------------------
+
+In order to allow users to develop applications with 3.1 headers that will
+still run on 3.0, users can #define the WINVER constant to be equal to the
+version number of Windows they are compiling against. For 3.0, this would be
+0x0300. This constant should be used to ensure that new, non-3.0 compatible
+features are not declared when the user is compiling a 3.0 application. Keep
+in mind that this version number is hex, not decimal (to be compatible with
+the GetExpWinVer() API).
+
+Some of you may own headers that are designed to work with windows 3.0 as
+well as 3.1: in this case, you won't have some of the new 3.1 typedefs and
+macros defined (e.g., UINT). You can use #ifdef _INC_WINDOWS to determine
+whether you've included the 3.1 windows.h. Because yours may not be the only
+header that will want to define certain types like UINT and LPCSTR, you
+should #define these to be WORD and LPSTR, respectively, since you cannot
+typedef something twice. The other option, of course, is to have separate
+3.0 and 3.1 versions of your header.
+
+ * New, non-3.0 compatible declarations and definitions should be inside
+ #ifdef (WINVER >= 0x030a)/#endif so that the 3.1 headers can be used
+ to create 3.0-compatible applications.
+
+ * If your header must be compatible with the 3.0 windows.h, use #ifdef
+ _INC_WINDOWS around #definitions that define the missing types. The
+ 3.0 windows.h file did not #define _INC_WINDOWS.
+ Use #define rather than typedef to ensure that other headers can
+ safely do the same thing. Here's an example that will handle
+ most of the common problems:
+
+ #ifndef _INC_WINDOWS /* If not included with 3.1 headers... */
+ #define LPCSTR LPSTR
+ #define WINAPI FAR PASCAL
+ #define CALLBACK FAR PASCAL
+ #define UINT WORD
+ #define LPARAM LONG
+ #define WPARAM WORD
+ #define LRESULT LONG
+ #define HMODULE HANDLE
+ #define HINSTANCE HANDLE
+ #define HLOCAL HANDLE
+ #define HGLOBAL HANDLE
+ #endif /* _INC_WINDOWS */
+
+ C++ Compatibility
+ -----------------
+
+To be able to use functions declared in your header directly from C++, you
+need to do one thing:
+
+ * Bracket the header file typedefs inside an extern "c" {} block,
+ conditionally using the __cplusplus #define:
+ Near the beginning of your header:
+
+ #ifdef __cplusplus
+ extern "C" { /* Assume C declarations for C++ */
+ #endif /* __cplusplus */
+
+ And at the end:
+
+ #ifdef __cplusplus
+ }
+ #endif
+
+
+ STRICT Compatibility and Windows 3.0 Backward Compatibility
+ -----------------------------------------------------------
+
+One of the most important features of STRICT is that handle types are no
+longer defined as WORDs. They are declared in such a way that will cause a
+compiler error if you try to pass the wrong type of handle or a non-handle
+value to a function, for example. It's important that all of our handle
+types be declared this way when the user #defines STRICT.
+
+A number of new types and such have been defined in windows.h, such as
+HINSTANCE, HGLOBAL, and HLOCAL, which should be used where appropriate in
+place of the generic HANDLE type. HANDLE should be used only in cases of
+an arbitrary handle type.
+
+The WPARAM, LPARAM, and LRESULT types should be used for arbitrary or
+polymorphic parameters or return values. Typedefs exist for all callback
+functions, which are used in place of FARPROC.
+
+In most cases, functions declared with these types are fully 3.0 compatible
+unless STRICT is #defined. It may sometimes be necessary to use #ifdef
+STRICT/#else/#endif to provide 3.0-compatible, non-STRICT declarations in
+some cases.
+
+ * Use DECLARE_HANDLE() to declare handle types. If you have polymorphic
+ API parameters (or structure fields) that are designed to accept more
+ than one type of handle (e.g., the GDI SelectObject function), there
+ are a few tricks you can employ. 1) Declare a generic handle type
+ like HGDIOBJ as void _near*, which will accept any handle type. The
+ HANDLE type can be used for this purpose. 2) if the number of
+ polymorphic types is small, and there are lots of cases where they can
+ be used polymorphically, use DECLARE_HANDLE to declare one handle
+ type, and typedef the rest to be the same as the first one (e.g,
+ HMODULE and HINSTANCE in windows.h).
+
+ * Structure and function declarations should use the appropriate STRICT
+ type, rather than the generic HANDLE,
+
+ * Declare arbitrarily or polymorphic types with LPARAM, WPARAM, and
+ LRESULT instead of WORD, LONG, or DWORD. This indicates to a
+ programmer that these values should not be used directly, but should
+ instead be cast and assigned to the proper type of value before use.
+
+ * Declare arbitrarily or polymorphic pointer types with void FAR*
+ instead of LPSTR or BYTE FAR*. The nice thing about the void FAR*
+ type is that you can pass any type of pointer to it without having to
+ cast first.
+
+ * If any of the above STRICT rules result in declarations that are
+ not compatible with previously released versions of the header file,
+ use #ifdef STRICT/#else/#endif to ensure that both declarations
+ are present.
+
+ * Use WINAPI instead of FAR PASCAL for declaring APIs. Use CALLBACK
+ instead of FAR PASCAL in callback function typedefs.
+
+ * Be sure to use "const" where appropriate in your pointer parameters.
+ If the pointer is read-only, then it should be const. If the function
+ writes through the pointer, it must not be const. For const
+ zero-terminated string pointers, use LPCSTR instead of LPSTR.
+
+ * Don't declare NPXXX or SPXXX pointer parameter types for new structures.
+ (but don't remove them if they've already been defined in a shipped
+ header). Users are encouraged to use "*", const, _near, _far, and
+ _huge explicitly where appropriate. Now that our headers contain
+ "const" pointer types, having LP, NP, and const pointer type variants
+ for every structure would just clog the compiler up with typedefs.
+
+ * Spell out pointer declarations, rather than using the LPXXX type form.
+ This allows for use of const and _huge where appropriate, without
+ having to define lots of new typedefs:
+
+ SetFoo(const FOO FAR* pfoo);
+ GetFoo(FOO FAR* pfoo);
+
+ * Use parameter names in your API function prototypes. This greatly
+ contributes to the readability and usefulness of your header, at
+ very little cost. Make sure all your APIs and callback declarations
+ are fully prototyped. Use the same naming conventions as in our
+ documentation (contact gregro or ralphw for a summary of those
+ conventions). NOTE: As of this writing, windows.h does not yet
+ include function prototype names.
diff --git a/private/mvdm/wow16/inc/ime.h b/private/mvdm/wow16/inc/ime.h
new file mode 100644
index 000000000..9c999b0e4
--- /dev/null
+++ b/private/mvdm/wow16/inc/ime.h
@@ -0,0 +1,210 @@
+//
+//
+// IME.H - Far East Input Method Editor definitions
+//
+//
+
+#ifdef DBCS_IME
+
+//
+// virtual key
+//
+#ifdef JAPAN
+#define VK_DBE_ALPHANUMERIC 0x0f0
+#define VK_DBE_KATAKANA 0x0f1
+#define VK_DBE_HIRAGANA 0x0f2
+#define VK_DBE_SBCSCHAR 0x0f3
+#define VK_DBE_DBCSCHAR 0x0f4
+#define VK_DBE_ROMAN 0x0f5
+#define VK_DBE_NOROMAN 0x0f6
+#define VK_DBE_IME_WORDREGISTER 0x0f7
+#define VK_DBE_IME_DIALOG 0x0f8
+#define VK_DBE_FLUSH 0x0f9
+#define VK_DBE_CODEINPUT 0x0fa
+#define VK_DBE_NOCODEINPUT 0x0fb
+#endif // JAPAN
+#ifdef TAIWAN
+#define VK_OEM_SEMICLN 0x0ba // ; ** :
+#define VK_OEM_EQUAL 0x0bb // = ** +
+#define VK_OEM_COMMA 0x0bc // , ** <
+#define VK_OEM_MINUS 0x0bd // - ** _
+#define VK_OEM_PERIOD 0x0be // . ** >
+#define VK_OEM_SLASH 0x0bf // / ** ?
+#define VK_OEM_3 0x0c0 // ` ** ~
+#define VK_OEM_LBRACKET 0x0db // [ ** {
+#define VK_OEM_BSLASH 0x0dc // \ ** |
+#define VK_OEM_RBRACKET 0x0dd // ] ** |
+#define VK_OEM_QUOTE 0x0de // ' ** "
+#endif // TAIWAN
+
+//
+// switch for wParam of IME_MOVECONVERTWINDOW
+//
+#define MCW_DEFAULT 0x00
+#define MCW_RECT 0x01
+#define MCW_WINDOW 0x02
+#define MCW_SCREEN 0x04
+#define MCW_VERTICAL 0x08
+#define MCW_CMD 0x06 // command mask
+
+//
+// switch for wParam of IME_SET_MODE and IME_GET_MODE
+//
+//
+#if defined(JAPAN) || defined(TAIWAN)
+#define IME_MODE_ALPHANUMERIC 0x0001
+#define IME_MODE_KATAKANA 0x0002
+#define IME_MODE_HIRAGANA 0x0004
+#define IME_MODE_SBCSCHAR 0x0008
+#define IME_MODE_DBCSCHAR 0x0010
+#define IME_MODE_ROMAN 0x0020
+#define IME_MODE_NOROMAN 0x0040
+#define IME_MODE_CODEINPUT 0x0080
+#define IME_MODE_NOCODEINPUT 0x0100
+#endif // JAPAN || TAIWAN
+#ifdef KOREA
+#define IME_MODE_ALPHANUMERIC 0x0001
+#define IME_MODE_SBCSCHAR 0x0002
+#define IME_MODE_HANJACONVERT 0x0004
+#endif // KOREA
+
+//
+// IME function code
+//
+#define IME_QUERY 0x03
+#define IME_SETOPEN 0x04
+#define IME_GETOPEN 0x05
+#define IME_ENABLE 0x06 /* ;Internal */
+#define IME_MOVECONVERTWINDOW 0x08
+#define IME_SET_MODE 0x10
+#define IME_GET_MODE 0x11
+#define IME_SETFONT 0x12
+#define IME_SENDKEY 0x13
+#define IME_DESTROY 0x14 /* ;Internal */
+#define IME_PRIVATE 0x15
+#define IME_WINDOWUPDATE 0x16
+#define IME_SELECT 0x17 /* ;Internal */
+#define IME_WORDREGISTER 0x18
+#ifdef KOREA
+#define IME_CODECONVERT 0x20
+#define IME_CONVERTLIST 0x21
+#define IME_AUTOMATA 0x30
+#define IME_HANJAMODE 0x31
+#define IME_GETLEVEL 0x40
+#define IME_SETLEVEL 0x41
+#endif // KOREA
+#ifdef TAIWAN
+#define IME_SETUSRFONT 0x20
+#define IME_QUERYUSRFONT 0x21
+#define IME_INPUTKEYTOSEQUENCE 0x22
+#define IME_SEQUENCETOINTERNAL 0x23
+#define IME_QUERYIMEINFO 0x24
+#define IME_DIALOG 0x25
+#endif // TAIWAN
+
+//
+// error code
+//
+#define IME_RS_ERROR 0x01 // genetal error
+#define IME_RS_NOIME 0x02 // IME is not installed
+#define IME_RS_TOOLONG 0x05 // given string is too long
+#define IME_RS_ILLEGAL 0x06 // illegal charactor(s) is string
+#define IME_RS_NOTFOUND 0x07 // no (more) candidate
+#define IME_RS_NOROOM 0x0a // no disk/memory space
+#define IME_RS_DISKERROR 0x0e // disk I/O error
+
+//
+// messge id
+//
+#define WM_IME_REPORT 0x0280 // WM_KANJIFIRST
+#define IR_STRINGSTART 0x100
+#define IR_STRINGEND 0x101
+#define IR_MOREROOM 0x110
+#define IR_OPENCONVERT 0x120
+#define IR_CHANGECONVERT 0x121
+#define IR_CLOSECONVERT 0x122
+#define IR_FULLCONVERT 0x123
+#define IR_IMESELECT 0x130
+#define IR_STRING 0x140
+
+//
+// IMM functions
+//
+typedef struct tagIMESTRUCT {
+ WORD fnc; // function code
+ WORD wParam; // word parameter
+ WORD wCount; // word counter
+ WORD dchSource; // offset to src from top of memory object
+ WORD dchDest; // offset to dst from top of memory object
+ LONG lParam1;
+ LONG lParam2;
+ LONG lParam3;
+} IMESTRUCT;
+typedef IMESTRUCT *PIMESTRUCT;
+typedef IMESTRUCT NEAR *NPIMESTRUCT;
+typedef IMESTRUCT FAR *LPIMESTRUCT;
+
+short FAR PASCAL SendIMEMessage( HWND, DWORD );
+#ifdef TAIWAN
+LONG FAR PASCAL WINNLSIMEControl(HWND,HWND,LPIMESTRUCT);
+#endif
+
+//
+// miscellaneous
+//
+#ifdef TAIWAN
+#define STATUSWINEXTRA 10
+#endif
+
+#ifdef KOREA
+//
+// ----- definitions for level2 apps -----
+//
+
+typedef unsigned char far *LPKSTR ;
+
+/* VK from the keyboard driver */
+#define VK_FINAL 0x18 // dummy VK to make final on mouse down
+#define VK_IME_DIALOG 0xf1
+
+#define CP_HWND 0
+#define CP_OPEN 1
+//#define CP_DIRECT 2
+#define CP_LEVEL 3
+
+#define lpSource(lpks) (LPSTR)((LPSTR)lpks+lpks->dchSource)
+#define lpDest(lpks) (LPSTR)((LPSTR)lpks+lpks->dchDest)
+
+//
+// ----- definitions for level3 apps -----
+//
+
+/* VK to send to Applications */
+#define VK_CONVERT 0x1C
+#define VK_NONCONVERT 0x1D
+#define VK_ACCEPT 0x1E
+#define VK_MODECHANGE 0x1F
+
+/* IME_CODECONVERT subfunctions */
+#define IME_BANJAtoJUNJA 0x13
+#define IME_JUNJAtoBANJA 0x14
+#define IME_JOHABtoKS 0x15
+#define IME_KStoJOHAB 0x16
+
+/* IME_AUTOMATA subfunctions */
+#define IMEA_INIT 0x01
+#define IMEA_NEXT 0x02
+#define IMEA_PREV 0x03
+
+/* IME_HANJAMODE subfunctions */
+#define IME_REQUEST_CONVERT 0x01
+#define IME_ENABLE_CONVERT 0x02
+
+/* IME_MOVEIMEWINDOW subfunctions */
+#define INTERIM_WINDOW 0x00
+#define MODE_WINDOW 0x01
+#define HANJA_WINDOW 0x02
+
+#endif // KOREA
+
+#endif // DBCS_IME
diff --git a/private/mvdm/wow16/inc/int31.inc b/private/mvdm/wow16/inc/int31.inc
new file mode 100644
index 000000000..83eca01d7
--- /dev/null
+++ b/private/mvdm/wow16/inc/int31.inc
@@ -0,0 +1,136 @@
+;******************************************************************************
+;
+; (C) Copyright MICROSOFT Corp., 1989-1990
+;
+; Title: INT31.INC - Equates and Structures for Int 31h Interface
+;
+; Version: 3.00
+;
+; Date: 22-May-1989
+;
+; Author: RAL
+;
+;------------------------------------------------------------------------------
+;
+; Change log:
+;
+; DATE REV DESCRIPTION
+; ----------- --- -----------------------------------------------------------
+; 22-May-1989 RAL Original
+;
+;==============================================================================
+
+
+
+Int31_Sel_Mgt EQU 00h
+ SelMgt_Alloc_Sel EQU 00h
+ SelMgt_Free_Sel EQU 01h
+ SelMgt_Seg_To_Sel EQU 02h
+ SelMgt_Get_LDT_Base EQU 03h
+ SelMgt_Lock_Sel EQU 04h
+ SelMgt_Unlock_Sel EQU 05h
+ SelMgt_Get_Base EQU 06h
+ SelMgt_Set_Base EQU 07h
+ SelMgt_Set_Limit EQU 08h
+ SelMgt_Set_Acc_Bits EQU 09h
+ SelMgt_Alias_Sel EQU 0Ah
+ SelMgt_Get_Desc EQU 0Bh
+ SelMgt_Set_Desc EQU 0Ch
+
+Int31_DOS_Mem_Mgt EQU 01h
+ DOSMem_Allocate EQU 00h
+ DOSMem_Free EQU 01h
+ DOSMem_Resize EQU 02h
+
+Int31_Int_Serv EQU 02h
+ Int_Get_Real_Vec EQU 00h
+ Int_Set_Real_Vec EQU 01h
+ Int_Get_Excep_Vec EQU 02h
+ Int_Set_Excep_Vec EQU 03h
+
+Int31_Trans_Serv EQU 03h
+ Trans_Sim_Int EQU 00h
+ Trans_Far_Call EQU 01h
+ Trans_Call_Int_Proc EQU 02h
+ Trans_Call_Back EQU 03h
+ Trans_Free_CB EQU 04h
+
+Int31_Get_Version EQU 04h
+
+Int31_Mem_Mgt EQU 05h
+ MemMgt_Get_Info EQU 00h
+ MemMgt_Allocate EQU 01h
+ MemMgt_Free EQU 02h
+ MemMgt_Resize EQU 03h
+
+Int31_Page_Lock EQU 06h
+ Lock_Region EQU 00h
+ Unlock_Region EQU 01h
+ Mark_Pageable EQU 02h
+ Mark_Not_Pageable EQU 03h
+
+Int31_Demand_Page_Tune EQU 07h
+ Page_Candidate EQU 00h
+ Page_Discard EQU 01h
+
+Int31_Map_Phys_Addr EQU 08h
+
+Int31_Virt_Int_State EQU 09h
+ Get_Clear_Int_State EQU 00h
+ Get_Set_Int_State EQU 01h
+ Get_Int_State EQU 02h
+
+
+Real_Mode_Call_Struc STRUC
+RealMode_EDI dd ?
+RealMode_ESI dd ?
+RealMode_EBP dd ?
+ dd ?
+RealMode_EBX dd ?
+RealMode_EDX dd ?
+RealMode_ECX dd ?
+RealMode_EAX dd ?
+RealMode_Flags dw ?
+RealMode_ES dw ?
+RealMode_DS dw ?
+RealMode_FS dw ?
+RealMode_GS dw ?
+RealMode_IP dw ?
+RealMode_CS dw ?
+RealMode_SP dw ?
+RealMode_SS dw ?
+Real_Mode_Call_Struc ENDS
+
+
+Real_Mode_Word_Regs STRUC
+RealMode_DI dw ?
+ dw ?
+RealMode_SI dw ?
+ dw ?
+RealMode_BP dw ?
+ dw ?
+ dd ?
+RealMode_BX dw ?
+ dw ?
+RealMode_DX dw ?
+ dw ?
+RealMode_CX dw ?
+ dw ?
+RealMode_AX dw ?
+Real_Mode_Word_Regs ENDS
+
+
+Real_Mode_Byte_Regs STRUC
+ dd 4 dup (?)
+RealMode_BL db ?
+RealMode_BH db ?
+ dw ?
+RealMode_DL db ?
+RealMode_DH db ?
+ dw ?
+RealMode_CL db ?
+RealMode_CH db ?
+ dw ?
+RealMode_AL db ?
+RealMode_AH db ?
+Real_Mode_Byte_Regs ENDS
diff --git a/private/mvdm/wow16/inc/io.h b/private/mvdm/wow16/inc/io.h
new file mode 100644
index 000000000..17771c35e
--- /dev/null
+++ b/private/mvdm/wow16/inc/io.h
@@ -0,0 +1,47 @@
+/***
+*io.h - declarations for low-level file handling and I/O functions
+*
+* Copyright (c) 1985-1990, Microsoft Corporation. All rights reserved.
+*
+*Purpose:
+* This file contains the function declarations for the low-level
+* file handling and I/O functions.
+*
+****/
+
+#if defined(_DLL) && !defined(_MT)
+#error Cannot define _DLL without _MT
+#endif
+
+#ifdef _MT
+#define _FAR_ _far
+#else
+#define _FAR_
+#endif
+
+/* function prototypes */
+
+int _FAR_ _cdecl access(const char _FAR_ *, int);
+int _FAR_ _cdecl chmod(const char _FAR_ *, int);
+int _FAR_ _cdecl chsize(int, long);
+int _FAR_ _cdecl close(int);
+int _FAR_ _cdecl creat(const char _FAR_ *, int);
+int _FAR_ _cdecl dup(int);
+int _FAR_ _cdecl dup2(int, int);
+int _FAR_ _cdecl eof(int);
+long _FAR_ _cdecl filelength(int);
+int _FAR_ _cdecl isatty(int);
+int _FAR_ _cdecl locking(int, int, long);
+long _FAR_ _cdecl lseek(int, long, int);
+char _FAR_ * _FAR_ _cdecl mktemp(char _FAR_ *);
+int _FAR_ _cdecl open(const char _FAR_ *, int, ...);
+int _FAR_ _cdecl _pipe(int _FAR_ *, unsigned int, int);
+int _FAR_ _cdecl read(int, void _FAR_ *, unsigned int);
+int _FAR_ _cdecl remove(const char _FAR_ *);
+int _FAR_ _cdecl rename(const char _FAR_ *, const char _FAR_ *);
+int _FAR_ _cdecl setmode(int, int);
+int _FAR_ _cdecl sopen(const char _FAR_ *, int, int, ...);
+long _FAR_ _cdecl tell(int);
+int _FAR_ _cdecl umask(int);
+int _FAR_ _cdecl unlink(const char _FAR_ *);
+int _FAR_ _cdecl write(int, const void _FAR_ *, unsigned int);
diff --git a/private/mvdm/wow16/inc/klayer.inc b/private/mvdm/wow16/inc/klayer.inc
new file mode 100644
index 000000000..afb0f1ad1
--- /dev/null
+++ b/private/mvdm/wow16/inc/klayer.inc
@@ -0,0 +1,1367 @@
+;=======================================================
+;
+; Macros stolen from cmacros.inc (so we don't have to include it all)
+;
+ .286p
+
+externNP macro n
+ irp x,<n>
+ extrn x:near
+ endm
+endm
+
+externFP macro n
+ irp x,<n>
+ extrn x:far
+ endm
+endm
+
+externW macro w
+ irp x,<w>
+ extrn x:word
+ endm
+endm
+
+assumes macro s,ln
+ assume s:_&ln
+endm
+
+createSeg macro n,ln,a,co,cl,grp
+ n segment a co '&cl'
+ n ends
+endm
+
+sBegin macro seg
+ assume cs:_&seg
+ _&seg segment
+endm
+
+sEnd macro seg
+ _&seg ends
+ assume cs:nothing
+endm
+
+errnz macro x ;;display error if expression is <>0
+ if2
+ if x ;;if expression is non-zero,
+ errnz1 <x>,%(x)
+ endif
+ endif
+endm
+
+errnz1 macro x1,x2
+ = *errnz* x1 = x2
+ .err
+endm
+
+errn$ macro l,x ;;error if <$-label1 (exp2)> <>0
+ errnz <offset $ - offset l x>
+endm
+
+createSeg _DATA,DATA,WORD,PUBLIC,DATA
+
+;=======================================================
+;
+; Error API definitions
+;
+ExternFP <HandleParamError>
+
+; error codes
+include logerror.inc
+
+;================================================================
+; Variable and temporary initialization
+
+VLseg equ <> ; Holds current segment name
+
+VLopen = 0
+VLerrnotinvoked = 0
+ifndef VLnogenpall
+VLnogenpall = 0
+endif
+
+VLnogen = 0
+VLnogenparm = 0
+
+VLsavees = 0
+VLsavebx = 0
+
+;if1
+if 1
+
+;================================================================
+; Utility macros
+
+;---------------------------------------------------------------------------
+;
+; lodsw cs:[si]
+;
+cslodsw macro
+ db 2eh ;; CS override
+ lodsw
+endm
+
+;---------------------------------------------------------------------------
+;
+; lodsb cs:[si]
+;
+cslodsb macro
+ db 2eh ;; CS override
+ lodsb
+endm
+
+SkipTwoBytes macro
+ db 0A9h ;; Opcode for CMP AX,(immediate word)
+endm
+
+;---------------------------------------------------------------------------
+;
+; Define a as the concatenation of b & c
+;
+concat macro a,b,c,d,e,f
+a equ <b&c&d&e&f>
+endm
+
+;---------------------------------------------------------------------------
+;
+; Assign a to b.
+;
+equate macro a,b
+ a = b
+endm
+
+;
+; Print a message
+;
+_print macro a,b,c
+if2
+ %out a&b&c
+endif
+endm
+
+
+;===============================================================
+
+;---------------------------------------------------------------------------
+;
+; _gensub LABEL
+;
+; Causes per-segment subroutine code associated with type LABEL
+; to be generated, by setting the genLABEL&lseg flag.
+;
+_gensub2 macro l,s
+ gen&l&s = 1
+endm
+
+_gensub macro l
+ _gensub2 <l>,%VLseg
+endm
+
+;---------------------------------------------------------------------------
+; _SwitchSeg
+;
+; Switches current segment to seg, creating the segment if needed.
+;
+_SwitchSeg macro seg,oldseg
+ ifdifi <&seg>,<oldseg>
+
+ ifnb <oldseg>
+sEnd oldseg
+ endif
+
+ concat <VLseg>,seg,
+
+createSeg _&seg,seg,WORD,PUBLIC,CODE
+
+sBegin seg
+assumes CS,seg
+
+ endif
+endm
+
+
+;---------------------------------------------------------------------------
+; API
+;
+API macro rettype,name,seg,optlist
+
+ if VLopen
+ APIEND
+ endif
+
+VLname equ <name>
+VLcbparms = 0
+VLcbskip = 0
+VLerrnotinvoked= 1
+VLopen = 1
+VLnogen = 0
+VLnogenparm = 0
+VLasm = 0
+VLfunnyframe = 0
+VLnodata = 0
+VLcargs = 0
+VLplist equ <>
+VLATMframe = 0 ; special entry/exit code sequence for ATM's patching
+VLATMfrmds = 0 ; ATM entry/exit code: mov ax,_DATA at beginning.
+
+VLsavees = 0
+VLsavebx = 0
+ _SwitchSeg seg,%VLseg
+
+ irp opt,<optlist>
+
+ ifidni <opt>,<NOGEN>
+ VLnogen = 1
+ endif
+
+ ifidni <opt>,<VOID>
+ VLnogen = 1
+ endif
+
+ ifidni <opt>,<ASM>
+ VLasm = 1
+ endif
+
+ ifidni <opt>,<ATMFRAME>
+ VLATMframe = 1
+ endif
+
+ ifidni <opt>,<ATMFRAMEDS>
+ VLATMfrmds = 1
+ VLATMframe = 1
+ endif
+
+ ifidni <opt>,<FUNNYFRAME>
+ VLfunnyframe = 1
+ endif
+
+ ifidni <opt>,<NODATA>
+ VLnodata = 1
+ endif
+
+ ifidni <opt>,<DEBUGONLY>
+ ifndef DEBUG
+ VLnogen = 1
+ endif
+ endif
+
+ ifidni <opt>,<C>
+ VLcargs = 1
+ endif
+
+ ifidni <opt>,<SAVEES>
+ VLsavees = 2 ; sizeof(ES)
+ endif
+
+ ifidni <opt>,<SAVEBX>
+ VLsavebx = 2 ; sizeof(BX)
+ endif
+
+ endm
+
+concat <VLsegoffset>,<seg>,<offset>
+concat <VLnameerror>,<name>,<_error>
+concat <VLnamecbparms>,<name>,<cbparms>
+
+ if1
+equate %VLnamecbparms, %VLcbparms
+ else
+equate %VLnamecbparms, %VLnamecbparms
+ endif
+
+ ife VLnogen
+
+ ife VLcargs
+concat <VLiname>,<I>,<name>
+ExternNP I&name
+
+public name
+name:
+ else
+concat <VLiname>,<_I>,<name>
+ExternNP _I&name
+
+public _&name
+_&name:
+ endif
+
+VLframe = 0 ; no frame set up yet.
+
+ endif ; VLnogen
+
+endm ;; VL
+
+;---------------------------------------------------------------------------
+; APIERR
+;
+; Optionally used after parameter decls to begin error handling code
+;
+APIERR macro opts
+
+ ife VLnogen
+ ife VLframe
+ _print <Nothing to validate for >,%VLiname
+ else
+ pop dx ; pop off error handler address
+ pop bp ; restore BP
+ if VLATMframe
+ dec bp ; fix BP back up
+ endif
+ if VLsavees
+ pop es
+ endif
+ if VLsavebx
+ pop bx
+ endif
+ endif
+ jmp VLiname ; jmp to internal routine.
+
+equate %VLnamecbparms, %VLcbparms
+
+VLnameerror:
+ VLerrnotinvoked = 0
+
+ endif ; VLnogen
+
+endm ;; APIERR
+
+;---------------------------------------------------------------------------
+; APIEND
+;
+; Used after APIERR to terminate error handling code.
+;
+APIEND macro
+
+_PurgeParms %VLplist
+
+ ife VLnogen
+
+ if VLerrnotinvoked
+ APIERR
+ endif
+ if VLsavees
+ pop es
+ endif
+ if VLsavebx
+ pop bx
+ endif
+ ife VLcargs
+ retf VLcbparms
+ else
+ retf
+ endif
+
+VLopen = 0
+
+ endif ; VLnogen
+
+endm ;; APIEND
+
+;---------------------------------------------------------------------------
+;
+; _FlsFrame - Generate frame code
+;
+_FlsFrame macro
+ ife VLframe
+ if VLATMfrmds
+ mov ax,_DATA
+ endif
+ if VLsavebx
+ push bx
+ endif
+ if VLsavees
+ push es
+ endif
+ if VLATMframe
+ inc bp
+ push bp
+ mov bp,sp
+ push ds ; push ds and pop it off.
+ pop ds ; (we need to pop DS rather than
+ ; something fast like pop AX because
+ ; ATM doesn't preserve DS itself)
+ else
+ push bp
+ mov bp,sp
+ endif
+ push offset VLnameerror ; push address of error handler
+ VLframe = 1
+ endif
+endm
+
+;---------------------------------------------------------------------------
+; _ChkName
+;
+; Ensure name was specified
+
+_ChkName macro name
+ ifb <name>
+ _print <Missing parameter name in >,%VLiname
+ endif
+endm
+
+;---------------------------------------------------------------------------
+; _ParmOpts
+;
+; Parse parameter option flags
+;
+_ParmOpts macro opts
+
+ VLnogenparm = VLnogenpall
+
+ irp opt,<opts>
+ ifidni <opt>,<DEBUGONLY>
+ ifndef DEBUG
+ VLnogenparm = 1
+ endif
+ ifidni <opt>,<NOGEN>
+ VLnogenparm = 1
+ endif
+ endif
+ endm
+endm
+
+;---------------------------------------------------------------------------
+; _DefParm name,cb,opts
+;
+; Take care of default parameter stuff, such as defining argument.
+;
+_DP_Add macro old,new
+ ifb <old>
+VLplist equ <new>
+ else
+VLplist equ <old,new>
+ endif
+endm
+
+_DefParm macro name,cb,opts
+ _ChkName <name>
+ _ParmOpts <opts>
+
+ if VLcargs
+concat _P_&name,<[bp]+6+>,%(VLcbparms+VLsavees+VLsavebx)
+ VLcbparms=VLcbparms+(cb)
+ else
+ VLcbparms=VLcbparms+(cb)
+concat _P_&name,<[bp]+6->,%VLcbparms,<+>,%(VLnamecbparms+VLsavees+VLsavebx)
+ endif
+
+_DP_Add %VLplist,<_P_&name>
+
+ VLgen = 1
+ if VLnogenparm or VLnogen
+ VLgen = 0
+ endif
+endm
+
+;----------------------------------------------------------------------------
+;
+; _GenParm name, cb, opts
+;
+_GenParm macro name,cb,opts
+ _DefParm <name>,<cb>,<opts>
+ if VLgen
+ _FlsFrame
+ endif
+endm
+
+lcall2 macro op,label,seg
+ op label&seg
+endm
+
+lcall macro label
+ lcall2 <call>,<label>,%VLseg
+endm
+
+ljmp macro label
+ lcall2 <jmp>,<label>,%VLseg
+endm
+
+;
+; _PurgeParms - purge list of parameters we've defined
+;
+_PurgeParms macro list
+ irp sym,<list>
+sym equ <>
+ endm
+endm
+
+;---------------------------------------------------------------------------
+; LAYER_START
+;
+; Used before any VL invocations
+;
+LAYER_START macro
+assumes ds,DATA
+
+endm
+
+;---------------------------------------------------------------------------
+; LAYER_END
+;
+; Ends all VL definitions
+;
+LAYER_END macro
+ if VLsopen
+ ENDSTRUCT
+ endif
+ if VLopen
+ APIEND
+ endif
+ if VLerrnotinvoked
+ APIERR
+ endif
+endm
+
+;=========================================================================
+;
+; Structure related macros
+;
+; Structure globals
+
+VLsopen =0
+
+;
+; STRUCT - begins a structure declaration
+;
+STRUCT macro name,opts
+ if VLsopen
+ ENDSTRUCT
+ endif
+ VLsopen=1
+
+concat VLcbs,<VLcbs>,name
+VLcbstruct = 0
+endm
+
+;
+; ENDSTRUCT macro - terminates a STRUCT declaration
+;
+ENDSTRUCT macro
+equate %VLcbs,%VLcbstruct
+
+VLsopen =0
+endm
+
+;
+; Define simple field macro, given:
+; f = macro name
+; cb = size of field
+;
+_SSize macro cb,opts
+VLcbstruct = VLcbstruct + (cb)
+endm
+
+_DefSimpleF macro f,cb
+ f &macro name,opts
+ equate _F_&&name,%VLcbstruct
+ _SSize cb
+ &endm
+endm
+
+_DefSimpleF F_char,1
+_DefSimpleF F_BYTE,1
+
+_DefSimpleF F_int,2
+_DefSimpleF F_WORD,2
+_DefSimpleF F_BOOL,2
+_DefSimpleF F_FLAGS,2
+
+_DefSimpleF F_LONG,4
+_DefSimpleF F_DWORD,4
+
+_DefSimpleF F_intMBZ,2
+_DefSimpleF F_DWORDMBZ,4
+
+_DefSimpleF F_LPVOID,4
+_DefSimpleF F_CLPSTR,4
+_DefSimpleF F_CLPSTR0,4
+_DefSimpleF F_LPSTR,4
+
+_DefSimpleF F_POINT,4
+_DefSimpleF F_RECT,8
+
+F_RGB macro name,cb,opts
+ equate _F_&name,%VLcbstruct
+ _SSize cb
+endm
+
+F_RGCH equ <F_RGB>
+
+F_RGW macro name,cw,opts
+ equate _F_&name,%VLcbstruct
+ _SSize (cw*2)
+endm
+
+;
+; Generate a P_?LP???? macro, given:
+;
+; n = parameter macro name (e.g., P_LPRECT)
+; r = handler routine name (e.g., LP)
+; cb = size of buffer
+;
+; The generated macro checks only whether the
+; buffer is big enough.
+;
+_GenLP macro n,r,cb
+ &n &macro name,opts
+ _GenParm <name>,4,<opts>
+ if VLgen
+ mov ax,_P_&&name
+ mov cx,_P_&&name+2
+ mov bx,cb
+ lcall &r
+ _gensub <LP>
+ endif
+ &endm
+endm
+
+;=========================================================================
+;
+; Generic parameter macros
+;
+P_2 macro name, opts
+ _DefParm <name>,2,<opts>
+endm
+
+P_4 macro name, opts
+ _DefParm <name>,4,<opts>
+endm
+
+P_char equ <P_2>
+P_int equ <P_2>
+P_BYTE equ <P_2>
+P_BOOL equ <P_2>
+P_WORD equ <P_2>
+
+P_WORDMBZ equ <P_2>
+P_WORDMBNZ equ <P_2>
+
+P_LONG equ <P_4>
+P_DWORD equ <P_4>
+
+;
+; Generic handle
+;
+P_H macro name, opts
+ _GenParm <name>,2,<opts>
+ if VLgen
+ mov ax,_P_&name
+ lcall H
+ _gensub H
+ endif
+endm
+
+;
+; Generic handle or NULL
+;
+P_H0 equ <P_2>
+
+;
+; Ensure signed value is min <= value <= max
+;
+P_RVALUE macro name, min, max, opts
+ local valok
+ _GenParm <name>,2,<opts>
+ if VLgen
+ mov ax,_P_&name
+ cmp ax,min
+ jl @F
+ cmp ax,max
+ jle valok
+@@:
+ mov bx,ERR_BAD_VALUE or ERR_WARNING
+ lcall Inval_Param_
+valok:
+ endif
+endm
+
+;
+; Ensure signed value is 0 <= value <= max
+;
+P_VALUE macro name, max, opts
+ _GenParm <name>,2,<opts>
+ if VLgen
+ mov ax,_P_&name
+ cmp ax,max
+ jbe @F ;; unsigned comparison to catch < 0.
+ mov bx,ERR_BAD_VALUE or ERR_WARNING
+ lcall Inval_Param_
+@@:
+ endif
+endm
+
+;
+; Ensure unsigned value is value <= max
+;
+P_UVALUE equ <P_VALUE>
+
+;
+; Ensure signed value is 0 <= value <= max
+;
+P_VALUEW macro name, max, opts
+ _GenParm <name>,2,<opts>
+ if VLgen
+ mov ax,_P_&name
+ cmp ax,max
+ jbe @F ;; unsigned comparison to catch < 0.
+ mov bx,ERR_BAD_VALUE or ERR_WARNING
+ lcall Inval_Param_
+@@:
+ endif
+endm
+
+;
+; Ensure unsigned value is value <= max
+;
+P_UVALUEW equ <P_VALUEW>
+
+;
+; Ensure signed byte value is min <= value <= max
+;
+if 0
+P_BVALUE macro name,max,opts
+ _GenParm <name>,2,<opts>
+ if VLGen
+ mov al,_P_&name
+ cmp al,max
+ jle @F
+ lcall ErrorBValue
+@@:
+ endif
+endm
+else
+P_BVALUE equ <P_2>
+endif
+
+;
+; Ensure that no incorrect bits are set in a flags word
+; (i.e., (name & ~valid) == 0)
+;
+P_FLAGS macro name, valid, opts
+ _DefParm <name>,2,<opts>
+ if not(valid)
+ if VLgen
+ _FlsFrame
+ mov ax,_P_&name
+ ife (low(not(valid)))
+ test ah,high(not(valid))
+ else
+ ife (high(not(valid)))
+ test al,low(not(valid))
+ else
+ test ax,not(valid)
+ endif
+ endif
+ jz @F
+ mov bx,ERR_BAD_FLAGS or ERR_WARNING
+ lcall Inval_Param_
+@@:
+ endif
+ endif
+endm
+
+;
+; Ensure that no incorrect bits are set in a flags dword
+; (i.e., (name & ~valid) == 0)
+;
+P_DFLAGS macro name, valid_l, valid_h, opts
+ local flagok
+ _DefParm <name>,4,<opts>
+ if not(valid_l) or not(valid_h)
+ if VLgen
+ _FlsFrame
+ mov ax,_P_&name
+ mov cx,_P_&name+2
+ if not(valid_l)
+ test ax,not(valid_l)
+ if not(valid_h)
+ jnz @F
+ else
+ jz flagok
+ endif
+ endif
+ if not(valid_h)
+ test cx,not(valid_h)
+ jz flagok
+@@:
+ endif
+ mov bx,ERR_BAD_DFLAGS or ERR_WARNING
+ lcall Inval_Param_
+flagok:
+ endif
+ endif
+endm
+
+;
+; P_LPFN - function pointer
+; P_LPFN0 - function pointer or NULL
+;
+P_LPFN macro name, opts
+ _GenParm <name>,4,<opts>
+ if VLgen
+ mov ax,_P_&name
+ mov cx,_P_&name+2
+ lcall LPFN
+ _gensub LPFN
+ endif
+endm
+
+P_LPFN0 macro name, opts
+ _GenParm <name>,4,<opts>
+ if VLgen
+ mov ax,_P_&name
+ mov cx,_P_&name+2
+ lcall LPFN0
+ _gensub LPFN
+ endif
+endm
+
+_GenBuf macro p,r
+ P_&p &macro lpch, cch, opts
+ _DefParm <lpch>,4,<opts>
+ _DefParm <cch>,2,<opts>
+ if VLgen
+ _FlsFrame
+ mov ax,_P_&&lpch
+ mov cx,_P_&&lpch+2
+ mov bx,_P_&&cch
+ lcall &r
+ _gensub LP
+ endif
+ &endm
+endm
+
+_GenBufspl macro p,r
+ P_&p &macro lpch, cch, opts
+ _DefParm <lpch>,4,<opts>
+ _DefParm <cch>,2,<opts>
+ if VLgen
+ _FlsFrame
+ mov ax,_P_&&lpch
+ mov cx,_P_&&lpch+2
+ lea bx,_P_&&cch
+ lcall &r
+ _gensub LPBUF
+ endif
+ &endm
+endm
+
+_GenBufspl <LPBUFFER>,<LPBUF>
+_GenBuf <CLPBUFFER>,<CLP>
+_GenBufspl <LPBUFFER0>,<LPBUF0>
+_GenBuf <CLPBUFFER0>,<CLP0>
+
+;
+; If pszBuf is valid, set its first byte to 0
+;
+E_SETEMPTY macro pszBuf,cchBuf,opts
+ push bp
+ mov bp,sp
+ mov cx,_P_&cchBuf
+ mov bx,_P_&pszBuf
+ mov dx,_P_&pszBuf+2
+ pop bp
+ lcall SETEMPTY
+ _gensub SETEMPTY
+endm
+
+; Same as above, but with no supplied count
+;
+E_SETEMPTYNC macro pszBuf,opts
+ push bp
+ mov bp,sp
+ mov cx,1
+ mov bx,_P_&pszBuf
+ mov dx,_P_&pszBuf+2
+ pop bp
+ lcall SETEMPTY
+ _gensub SETEMPTY
+endm
+
+_GenLP <P_LPSTR>,<LP>,1
+_GenLP <P_LPSTR0>,<LP0>,1
+
+P_CLPSTR macro name,cch,opts
+ _GenParm <name>,4,<opts>
+ if VLgen
+ mov ax,_P_&name
+ mov cx,_P_&name+2
+ ifb <cch>
+ mov bx,-1
+ else
+ mov bx,cch
+ endif
+ lcall CLPSZ
+ _gensub LPSZ
+ endif
+endm
+
+P_CLPSTR0 macro name,cch,opts
+ _GenParm <name>,4,<opts>
+ if VLgen
+ mov ax,_P_&name
+ mov cx,_P_&name+2
+ ifb <cch>
+ mov bx,-1
+ else
+ mov bx,cch
+ endif
+ lcall CLPSZ0
+ _gensub LPSZ
+ endif
+endm
+
+_GenLP <P_LPVOID>,<LP>,1
+_GenLP <P_LPVOID0>,<LP0>,1
+_GenLP <P_CLPVOID>,<CLP>,1
+_GenLP <P_CLPVOID0>,<CLP0>,1
+
+_GenLP <P_LPBYTE>,<LP>,1
+_GenLP <P_LPBYTE0>,<LP0>,1
+_GenLP <P_CLPBYTE>,<CLP>,1
+_GenLP <P_CLPBYTE0>,<CLP0>,1
+
+_GenLP <P_LPINT>,<LP>,2
+_GenLP <P_LPINT0>,<LP0>,2
+_GenLP <P_CLPINT>,<CLP>,2
+_GenLP <P_CLPINT0>,<CLP0>,2
+
+_GenLP <P_LPWORD>,<LP>,2
+_GenLP <P_LPWORD0>,<LP0>,2
+_GenLP <P_CLPWORD>,<CLP>,2
+_GenLP <P_CLPWORD0>,<CLP0>,2
+
+_GenLP <P_LPBOOL>,<LP>,2
+_GenLP <P_LPBOOL0>,<LP0>,2
+_GenLP <P_CLPBOOL>,<CLP>,2
+_GenLP <P_CLPBOOL0>,<CLP0>,2
+
+_GenLP <P_LPLONG>,<LP>,4
+_GenLP <P_LPLONG0>,<LP0>,4
+_GenLP <P_CLPLONG>,<CLP>,4
+_GenLP <P_CLPLONG0>,<CLP0>,4
+
+_GenLP <P_LPDWORD>,<LP>,4
+_GenLP <P_LPDWORD0>,<LP0>,4
+_GenLP <P_CLPDWORD>,<CLP>,4
+_GenLP <P_CLPDWORD0>,<CLP0>,4
+
+;=======================================================================
+;
+; Common USER types
+;
+STRUCT <POINT>
+F_int x
+F_int y
+ENDSTRUCT
+
+_GenLP <P_LPPOINT>,<LP>,%VLcbsPOINT
+_GenLP <P_LPPOINT0>,<LP0>,%VLcbsPOINT
+_GenLP <P_CLPPOINT>,<CLP>,%VLcbsPOINT
+_GenLP <P_CLPPOINT0>,<CLP0>,%VLcbsPOINT
+P_POINT equ <P_4>
+
+STRUCT <RECT>
+F_int left
+F_int top
+F_int right
+F_int bottom
+ENDSTRUCT
+
+_GenLP <P_LPRECT>,<LP>,%VLcbsRECT
+_GenLP <P_LPRECT0>,<LP0>,%VLcbsRECT
+_GenLP <P_CLPRECT>,<CLP>,%VLcbsRECT
+_GenLP <P_CLPRECT0>,<CLP0>,%VLcbsRECT
+
+;=======================================================================
+;
+; Common KERNEL types
+;
+P_GHANDLE macro h,opts
+ _GenParm <h>,2,<opts>
+ if VLgen
+ mov ax,_P_&h
+ lcall GHANDLE
+ _gensub GHANDLE
+ endif
+
+endm
+
+P_GHANDLE0 macro h,opts
+ _GenParm <h>,2,<opts>
+ if VLgen
+ mov ax,_P_&h
+ lcall GHANDLE0
+ _gensub GHANDLE
+ endif
+endm
+
+P_GHANDLE32 macro h,opts
+ _GenParm <h>,2,<opts>
+ if VLgen
+ mov ax,_P_&h
+ test al, 0100b;
+ jz @F
+ lcall GHANDLE
+ @@:
+ endif
+endm
+
+P_HANDLE equ <P_H>
+P_HANDLE0 equ <P_H0>
+
+P_ATOM equ <P_H>
+
+P_HINSTANCE equ <P_GHANDLE>
+P_HINSTANCE0 equ <P_GHANDLE0>
+
+P_HMODULE equ <P_GHANDLE>
+P_HMODULE0 equ <P_GHANDLE0>
+P_HMODULE32 equ <P_GHANDLE32>
+
+P_HTASK equ <P_GHANDLE>
+P_HTASK0 equ <P_GHANDLE0>
+
+P_CLPSTRATOM macro name, opts
+ _GenParm <name>,4,<opts>
+ if VLgen
+ mov ax,_P_&name
+ mov cx,_P_&name+2
+ lcall CLPSTRATOM
+ _gensub LPSZ
+ endif
+endm
+
+P_CLPSTRATOM0 macro name, opts
+ _GenParm <name>,4,<opts>
+ if VLgen
+ mov ax,_P_&name
+ mov cx,_P_&name+2
+ lcall CLPSTRATOM0
+ _gensub LPSZ
+ endif
+endm
+
+P_CLPSTRRSRC equ <P_CLPSTRATOM>
+P_CLPSTRRSRC0 equ <P_CLPSTRATOM0>
+
+;---------------------------------------------------------------------------
+; LAYER_EXPAND lseg
+;
+; Expands per-segment validation boilerplate code into segment lseg
+;
+LAYER_EXPAND macro lseg
+.list
+.lall
+ _SwitchSeg &lseg,%VLseg
+
+public VStart&lseg
+VStart&lseg:
+
+EXTRA_EXPAND lseg
+
+;
+; Handle validation
+;
+ifdef genH&lseg
+
+public H&lseg
+H&lseg:
+ or ax,ax
+ jz @F
+ ret
+@@:
+ mov bx,ERR_BAD_HANDLE
+ jmp short Inval_Param_&lseg
+
+endif ; genH&lseg
+
+ifdef genGHANDLE&lseg
+
+public GHANDLE0&lseg
+GHANDLE0&lseg:
+ or ax,ax ; accept NULL
+ jz GHexit&lseg
+
+public GHANDLE&lseg
+GHANDLE&lseg:
+ test al,0100b ; Reject GDT selectors
+ jnz GHldt&lseg
+ ; not yet. Some WOW cursor/icon handles
+ cmp ax, 0f000h ; look like GDT sels and are > 0xf000
+ jae GHexit&lseg
+ jmp GHerr&lseg ; Reject GDT sels now.
+
+GHldt&lseg:
+ cmp ax,0ffffh ; special case: -1 -> DS
+ jz GHexit&lseg
+ lar dx,ax ; is it a valid selector?
+ jnz GHerr&lseg
+GHexit&lseg:
+ ret
+
+GHerr&lseg:
+ mov bx,ERR_BAD_GLOBAL_HANDLE
+ jmp short Inval_Param_&lseg
+
+endif ; genGHANDLE&lseg
+
+ifdef genLPFN&lseg
+
+;
+; Function pointer validation
+;
+public LPFN0&lseg
+LPFN0&lseg:
+ mov bx,ax ; Allow NULL
+ or bx,cx
+ jz LPFN_exit&lseg
+
+public LPFN&lseg
+LPFN&lseg:
+beg_fault_trap LPFNbad&lseg
+ lar bx,cx
+ jnz LPFNerr&lseg
+ test bh,8
+ jz LPFNerr&lseg
+ mov es,cx ; validate pointer & offset
+ mov bx,ax
+ mov al,es:[bx]
+end_fault_trap
+
+ifdef DEBUG
+;
+; Make sure the function is exported by
+; ensuring that the first instructions are NOT
+; push ds, pop ax or mov ax,ds.
+;
+ mov bx,es:[bx]+2
+
+ cmp bx,0581eh ; Push ds, pop ax instructions?
+ jz LPFNerr&lseg ; Yes, must be an error.
+ cmp bx,0d88ch ; Mov ax,ds instruction?
+ jz LPFNerr&lseg ; No, we're ok, so jump ahead
+endif ; DEBUG
+
+LPFN_exit&lseg:
+ ret
+
+LPFNbad&lseg:
+ fault_fix_stack
+LPFNerr&lseg:
+ mov bx,ERR_BAD_FUNC_PTR
+ jmp short Inval_Param_&lseg
+
+endif ; genLPFN&lseg
+
+public Inval_Param_&lseg
+Inval_Param_&lseg:
+ pop dx ; convert near return addr to far
+ push cs
+ push dx
+ jmp HandleParamError
+
+ifdef genLP&lseg
+
+public LP0&lseg
+LP0&lseg:
+ or ax,ax ; if cx:ax == NULL, exit
+ jnz @F
+ jcxz CLPexit&lseg
+@@:
+public LP&lseg
+LP&lseg:
+beg_fault_trap CLPbad&lseg
+ mov es,cx
+ or bx,bx ; cb == 0?
+ jz CLPexit&lseg ; yes: just check selector
+ dec bx
+ add bx,ax
+ jc CLPbad1&lseg ; check 16 bit overflow
+ or byte ptr es:[bx],0 ; check write permission, limit
+end_fault_trap
+ ret
+
+public CLP0&lseg
+CLP0&lseg:
+ or ax,ax ; Accept ax:cx == 0
+ jnz @F
+ jcxz CLPexit&lseg
+@@:
+public CLP&lseg
+CLP&lseg:
+beg_fault_trap CLPbad&lseg
+ mov es,cx
+ or bx,bx ; cb == 0?
+ jz CLPexit&lseg ; yes: just check selector
+ dec bx
+ add bx,ax
+ jc CLPbad1&lseg ; check 16 bit overflow
+ mov bl,es:[bx] ; check read permission, limit
+end_fault_trap
+
+public CLPexit&lseg
+CLPexit&lseg:
+ ret
+
+CLPbad&lseg:
+ fault_fix_stack
+CLPbad1&lseg:
+ mov bx,ERR_BAD_PTR
+ jmp Inval_Param_&lseg
+
+endif ; genLP&lseg
+
+ifdef genLPBUF&lseg
+public LPBUF0&lseg
+LPBUF0&lseg:
+ or ax,ax ; if cx:ax == NULL, exit
+ jnz @F
+ jcxz LPBUFexit&lseg
+@@:
+public LPBUF&lseg
+LPBUF&lseg:
+beg_fault_trap LPBUFbad&lseg
+ mov es,cx
+ mov cx, word ptr ss:[bx] ; cb == 0?
+ jcxz LPBUFexit&lseg ; yes: just check selector
+ mov dx, bx
+ mov bx, ax
+ or byte ptr es:[bx],0 ; check write permission, start
+ mov bx, dx
+LPBUFpast1&lseg:
+ dec cx
+ add cx,ax
+ jnc @f ; 16-bit overflow
+ mov bx, 0ffffh
+ mov cx, bx
+ or byte ptr es:[bx],0 ; check write permission, 64k-1
+ jmp LPBUFov&lseg
+@@:
+ mov bx, cx
+ or byte ptr es:[bx],0 ; check write permission, end
+ ret
+end_fault_trap
+
+public LPBUFexit&lseg
+LPBUFexit&lseg:
+ ret
+LPBUFbad&lseg:
+ mov bx, dx
+ pop dx ; fault ip
+ add sp, 2 ; fault
+ cmp dx, offset LPBUFpast1&lseg
+ jb LPBUFbad1&lseg
+
+ mov dx, es
+ lsl cx, dx
+ jnz LPBUFbad1&lseg ; should not occur, we have loaded es
+LPBUFov&lseg:
+ sub cx, ax ; max legal cb
+ inc cx
+ mov word ptr ss:[bx], cx ; fix cb passed by user on stack
+ mov cx, es ; HandleParamError prints cx:ax
+ mov bx,ERR_BAD_PTR or ERR_WARNING
+ jmp Inval_Param_&lseg
+LPBUFbad1&lseg:
+ mov cx, es ; HandleParamError prints cx:ax
+ mov bx,ERR_BAD_PTR
+ jmp Inval_Param_&lseg
+endif ; genLPBUF&lseg
+
+ifdef genLPSZ&lseg
+
+;
+; cx:ax -> const pointer to z-terminated string or MAKEINTATOM atom.
+;
+public CLPSTRATOM0&lseg
+CLPSTRATOM0&lseg:
+ jcxz CLPSZexit&lseg ; If selector is NULL, then all is well.
+
+public CLPSTRATOM&lseg
+CLPSTRATOM&lseg:
+ jcxz @F ; if selector == 0, then may be atom.
+ mov bx,256 ; max string length of 255 characters.
+ jmp short CLPSZ&lseg
+@@:
+ or ax,ax ; offset == 0? if so, it's bogus
+ jz ErrorStrPtr&lseg
+CLPSZexit&lseg:
+ ret
+;
+; cx:ax => const pointer to zero-terminated string.
+; bx => Maximum string length (including zero terminator)
+;
+public CLPSZ0&lseg
+CLPSZ0&lseg:
+ mov dx,ax
+ or dx,cx
+ jz CLPSZexit&lseg
+public CLPSZ&lseg
+CLPSZ&lseg:
+ push di ; preserve these regs
+ push cx
+ mov dx,ax ; preserve original ax in dx
+beg_fault_trap LPSZfault&lseg
+ mov es,cx
+ mov di,ax
+
+ xor ax,ax
+ mov cx,-1
+ cld
+ repnz scasb
+end_fault_trap
+ neg cx ; cx = string length + 1
+ dec cx
+ cmp cx,bx ; error if string length + 1 > cchMax
+
+ pop cx ; restore regs before branching
+ pop di
+ xchg ax,dx
+
+ ja ErrorStrPtr&lseg ; jump if error
+ ret
+
+LPSZfault&lseg:
+ fault_fix_stack
+ pop cx ; restore regs
+ pop di
+ xchg ax,dx
+
+public ErrorStrPtr&lseg
+ErrorStrPtr&lseg:
+ mov bx,ERR_BAD_STRING_PTR
+ jmp Inval_Param_&lseg
+
+endif ; genLPSZ&lseg
+
+ifdef genSETEMPTY&lseg
+
+public SETEMPTY&lseg
+SETEMPTY&lseg:
+ jcxz SETEMPTYexit&lseg ; 0-length buffer: do nothing.
+beg_fault_trap SETEMPTYbad&lseg
+ mov es,dx
+ mov byte ptr es:[bx],0 ; jam in a zero terminator
+end_fault_trap
+SETEMPTYexit&lseg:
+ xor ax,ax
+ cwd
+ ret
+
+SETEMPTYbad&lseg:
+ fault_fix_stack
+ jmp short SETEMPTYexit&lseg
+
+endif ; genSETEMPTY&lseg
+
+public VEnd&lseg
+VEnd&lseg:
+
+sEnd %VLseg
+VLseg equ <>
+
+endm ;LAYER_EXPAND
+
+endif ;; IF1
diff --git a/private/mvdm/wow16/inc/layer.inc b/private/mvdm/wow16/inc/layer.inc
new file mode 100644
index 000000000..47bf6c0f1
--- /dev/null
+++ b/private/mvdm/wow16/inc/layer.inc
@@ -0,0 +1,1386 @@
+;=======================================================
+;
+; Macros stolen from cmacros.inc (so we don't have to include it all)
+;
+ .286p
+
+externNP macro n
+ irp x,<n>
+ extrn x:near
+ endm
+endm
+
+externFP macro n
+ irp x,<n>
+ extrn x:far
+ endm
+endm
+
+externW macro w
+ irp x,<w>
+ extrn x:word
+ endm
+endm
+
+assumes macro s,ln
+ assume s:_&ln
+endm
+
+createSeg macro n,ln,a,co,cl,grp
+ n segment a co '&cl'
+ n ends
+endm
+
+sBegin macro seg
+ assume cs:_&seg
+ _&seg segment
+endm
+
+sEnd macro seg
+ _&seg ends
+ assume cs:nothing
+endm
+
+errnz macro x ;;display error if expression is <>0
+ if2
+ if x ;;if expression is non-zero,
+ errnz1 <x>,%(x)
+ endif
+ endif
+endm
+
+errnz1 macro x1,x2
+ = *errnz* x1 = x2
+ .err
+endm
+
+errn$ macro l,x ;;error if <$-label1 (exp2)> <>0
+ errnz <offset $ - offset l x>
+endm
+
+createSeg _DATA,DATA,WORD,PUBLIC,DATA
+
+;=======================================================
+;
+; Error API definitions
+;
+ExternFP <HandleParamError>
+
+; error codes
+include logerror.inc
+
+;================================================================
+; Variable and temporary initialization
+
+VLseg equ <> ; Holds current segment name
+
+VLopen = 0
+VLerrnotinvoked = 0
+ifndef VLnogenpall
+VLnogenpall = 0
+endif
+
+VLnogen = 0
+VLnogenparm = 0
+
+VLsavees = 0
+VLsavebx = 0
+
+;if1
+if 1
+
+;================================================================
+; Utility macros
+
+;---------------------------------------------------------------------------
+;
+; lodsw cs:[si]
+;
+cslodsw macro
+ db 2eh ;; CS override
+ lodsw
+endm
+
+;---------------------------------------------------------------------------
+;
+; lodsb cs:[si]
+;
+cslodsb macro
+ db 2eh ;; CS override
+ lodsb
+endm
+
+SkipTwoBytes macro
+ db 0A9h ;; Opcode for CMP AX,(immediate word)
+endm
+
+;---------------------------------------------------------------------------
+;
+; Define a as the concatenation of b & c
+;
+concat macro a,b,c,d,e,f
+a equ <b&c&d&e&f>
+endm
+
+;---------------------------------------------------------------------------
+;
+; Assign a to b.
+;
+equate macro a,b
+ a = b
+endm
+
+;
+; Print a message
+;
+_print macro a,b,c
+if2
+ %out a&b&c
+endif
+endm
+
+
+;===============================================================
+
+;---------------------------------------------------------------------------
+;
+; _gensub LABEL
+;
+; Causes per-segment subroutine code associated with type LABEL
+; to be generated, by setting the genLABEL&lseg flag.
+;
+_gensub2 macro l,s
+ gen&l&s = 1
+endm
+
+_gensub macro l
+ _gensub2 <l>,%VLseg
+endm
+
+;---------------------------------------------------------------------------
+; _SwitchSeg
+;
+; Switches current segment to seg, creating the segment if needed.
+;
+_SwitchSeg macro seg,oldseg
+ ifdifi <&seg>,<oldseg>
+
+ ifnb <oldseg>
+sEnd oldseg
+ endif
+
+ concat <VLseg>,seg,
+
+;createSeg _&seg,seg,BYTE,PUBLIC,CODE
+createSeg _&seg,seg,WORD,PUBLIC,CODE
+
+sBegin seg
+assumes CS,seg
+
+ endif
+endm
+
+
+;---------------------------------------------------------------------------
+; API
+;
+API macro rettype,name,seg,optlist
+
+ if VLopen
+ APIEND
+ endif
+
+VLname equ <name>
+VLcbparms = 0
+VLcbskip = 0
+VLerrnotinvoked= 1
+VLopen = 1
+VLnogen = 0
+VLnogenparm = 0
+VLasm = 0
+VLfunnyframe = 0
+VLnodata = 0
+VLcargs = 0
+VLplist equ <>
+VLATMframe = 0 ; special entry/exit code sequence for ATM's patching
+VLATMfrmds = 0 ; ATM entry/exit code: mov ax,_DATA at beginning.
+
+VLsavees = 0
+VLsavebx = 0
+ _SwitchSeg seg,%VLseg
+
+ irp opt,<optlist>
+
+ ifidni <opt>,<NOGEN>
+ VLnogen = 1
+ endif
+
+ ifidni <opt>,<VOID>
+ VLnogen = 1
+ endif
+
+ ifidni <opt>,<ASM>
+ VLasm = 1
+ endif
+
+ifndef WOW
+ ; don't need that bp and ds stuff
+
+ ifidni <opt>,<ATMFRAME>
+ VLATMframe = 1
+ endif
+
+ ifidni <opt>,<ATMFRAMEDS>
+ VLATMfrmds = 1
+ VLATMframe = 1
+ endif
+endif
+
+ ifidni <opt>,<FUNNYFRAME>
+ VLfunnyframe = 1
+ endif
+
+ ifidni <opt>,<NODATA>
+ VLnodata = 1
+ endif
+
+ ifidni <opt>,<DEBUGONLY>
+ ifndef DEBUG
+ VLnogen = 1
+ endif
+ endif
+
+ ifidni <opt>,<C>
+ VLcargs = 1
+ endif
+
+ ifidni <opt>,<SAVEES>
+ VLsavees = 2 ; sizeof(ES)
+ endif
+
+ ifidni <opt>,<SAVEBX>
+ VLsavebx = 2 ; sizeof(BX)
+ endif
+
+ endm
+
+concat <VLsegoffset>,<seg>,<offset>
+concat <VLnameerror>,<name>,<_error>
+concat <VLnamecbparms>,<name>,<cbparms>
+
+ if1
+equate %VLnamecbparms, %VLcbparms
+ else
+equate %VLnamecbparms, %VLnamecbparms
+ endif
+
+ ife VLnogen
+
+ ife VLcargs
+concat <VLiname>,<I>,<name>
+ExternNP I&name
+
+public name
+name:
+
+ else
+concat <VLiname>,<_I>,<name>
+ExternNP _I&name
+
+public _&name
+_&name:
+
+ endif
+
+VLframe = 0 ; no frame set up yet.
+
+ endif ; VLnogen
+
+endm ;; VL
+
+;---------------------------------------------------------------------------
+; APIERR
+;
+; Optionally used after parameter decls to begin error handling code
+;
+APIERR macro opts
+
+ ife VLnogen
+ ife VLframe
+ _print <Nothing to validate for >,%VLiname
+ else
+ pop dx ; pop off error handler address
+ pop bp ; restore BP
+ if VLATMframe
+ dec bp ; fix BP back up
+ endif
+ if VLsavees
+ pop es
+ endif
+ if VLsavebx
+ pop bx
+ endif
+ endif
+ jmp VLiname ; jmp to internal routine.
+
+equate %VLnamecbparms, %VLcbparms
+
+VLnameerror:
+ VLerrnotinvoked = 0
+
+ endif ; VLnogen
+
+endm ;; APIERR
+
+;---------------------------------------------------------------------------
+; APIEND
+;
+; Used after APIERR to terminate error handling code.
+;
+APIEND macro
+
+_PurgeParms %VLplist
+
+ ife VLnogen
+
+ if VLerrnotinvoked
+ APIERR
+ endif
+ if VLsavees
+ pop es
+ endif
+ if VLsavebx
+ pop bx
+ endif
+ ife VLcargs
+ retf VLcbparms
+ else
+ retf
+ endif
+
+VLopen = 0
+
+ endif ; VLnogen
+
+endm ;; APIEND
+
+;---------------------------------------------------------------------------
+;
+; _FlsFrame - Generate frame code
+;
+_FlsFrame macro
+ ife VLframe
+ if VLATMfrmds
+ mov ax,_DATA
+ endif
+ if VLsavebx
+ push bx
+ endif
+ if VLsavees
+ push es
+ endif
+ if VLATMframe
+ inc bp
+ push bp
+ mov bp,sp
+ push ds ; push ds and pop it off.
+ pop ds ; (we need to pop DS rather than
+ ; something fast like pop AX because
+ ; ATM doesn't preserve DS itself)
+ else
+ push bp
+ mov bp,sp
+ endif
+ push offset VLnameerror ; push address of error handler
+ VLframe = 1
+ endif
+endm
+
+;---------------------------------------------------------------------------
+; _ChkName
+;
+; Ensure name was specified
+
+_ChkName macro name
+ ifb <name>
+ _print <Missing parameter name in >,%VLiname
+ endif
+endm
+
+;---------------------------------------------------------------------------
+; _ParmOpts
+;
+; Parse parameter option flags
+;
+_ParmOpts macro opts
+
+ VLnogenparm = VLnogenpall
+
+ irp opt,<opts>
+ ifidni <opt>,<DEBUGONLY>
+ ifndef DEBUG
+ VLnogenparm = 1
+ endif
+ ifidni <opt>,<NOGEN>
+ VLnogenparm = 1
+ endif
+ endif
+ endm
+endm
+
+;---------------------------------------------------------------------------
+; _DefParm name,cb,opts
+;
+; Take care of default parameter stuff, such as defining argument.
+;
+_DP_Add macro old,new
+ ifb <old>
+VLplist equ <new>
+ else
+VLplist equ <old,new>
+ endif
+endm
+
+_DefParm macro name,cb,opts
+ _ChkName <name>
+ _ParmOpts <opts>
+
+ if VLcargs
+concat _P_&name,<[bp]+6+>,%(VLcbparms+VLsavees+VLsavebx)
+ VLcbparms=VLcbparms+(cb)
+ else
+ VLcbparms=VLcbparms+(cb)
+concat _P_&name,<[bp]+6->,%VLcbparms,<+>,%(VLnamecbparms+VLsavees+VLsavebx)
+ endif
+
+_DP_Add %VLplist,<_P_&name>
+
+ VLgen = 1
+ if VLnogenparm or VLnogen
+ VLgen = 0
+ endif
+endm
+
+;----------------------------------------------------------------------------
+;
+; _GenParm name, cb, opts
+;
+_GenParm macro name,cb,opts
+ _DefParm <name>,<cb>,<opts>
+ if VLgen
+ _FlsFrame
+ endif
+endm
+
+lcall2 macro op,label,seg
+ op label&seg
+endm
+
+lcall macro label
+ lcall2 <call>,<label>,%VLseg
+endm
+
+ljmp macro label
+ lcall2 <jmp>,<label>,%VLseg
+endm
+
+;
+; _PurgeParms - purge list of parameters we've defined
+;
+_PurgeParms macro list
+ irp sym,<list>
+sym equ <>
+ endm
+endm
+
+;---------------------------------------------------------------------------
+; LAYER_START
+;
+; Used before any VL invocations
+;
+LAYER_START macro
+assumes ds,DATA
+
+endm
+
+;---------------------------------------------------------------------------
+; LAYER_END
+;
+; Ends all VL definitions
+;
+LAYER_END macro
+ if VLsopen
+ ENDSTRUCT
+ endif
+ if VLopen
+ APIEND
+ endif
+ if VLerrnotinvoked
+ APIERR
+ endif
+endm
+
+;=========================================================================
+;
+; Structure related macros
+;
+; Structure globals
+
+VLsopen =0
+
+;
+; STRUCT - begins a structure declaration
+;
+STRUCT macro name,opts
+ if VLsopen
+ ENDSTRUCT
+ endif
+ VLsopen=1
+
+concat VLcbs,<VLcbs>,name
+VLcbstruct = 0
+endm
+
+;
+; ENDSTRUCT macro - terminates a STRUCT declaration
+;
+ENDSTRUCT macro
+equate %VLcbs,%VLcbstruct
+
+VLsopen =0
+endm
+
+;
+; Define simple field macro, given:
+; f = macro name
+; cb = size of field
+;
+_SSize macro cb,opts
+VLcbstruct = VLcbstruct + (cb)
+endm
+
+_DefSimpleF macro f,cb
+ f &macro name,opts
+ equate _F_&&name,%VLcbstruct
+ _SSize cb
+ &endm
+endm
+
+_DefSimpleF F_char,1
+_DefSimpleF F_BYTE,1
+
+_DefSimpleF F_int,2
+_DefSimpleF F_WORD,2
+_DefSimpleF F_BOOL,2
+_DefSimpleF F_FLAGS,2
+
+_DefSimpleF F_LONG,4
+_DefSimpleF F_DWORD,4
+
+_DefSimpleF F_intMBZ,2
+_DefSimpleF F_DWORDMBZ,4
+
+_DefSimpleF F_LPVOID,4
+_DefSimpleF F_CLPSTR,4
+_DefSimpleF F_CLPSTR0,4
+_DefSimpleF F_LPSTR,4
+
+_DefSimpleF F_POINT,4
+_DefSimpleF F_RECT,8
+
+ifdef WOW
+_DefSimpleF F_LARGEPOINT,8
+endif
+
+F_RGB macro name,cb,opts
+ equate _F_&name,%VLcbstruct
+ _SSize cb
+endm
+
+F_RGCH equ <F_RGB>
+
+F_RGW macro name,cw,opts
+ equate _F_&name,%VLcbstruct
+ _SSize (cw*2)
+endm
+
+;
+; Generate a P_?LP???? macro, given:
+;
+; n = parameter macro name (e.g., P_LPRECT)
+; r = handler routine name (e.g., LP)
+; cb = size of buffer
+;
+; The generated macro checks only whether the
+; buffer is big enough.
+;
+_GenLP macro n,r,cb
+ &n &macro name,opts
+ _GenParm <name>,4,<opts>
+ if VLgen
+ mov ax,_P_&&name
+ mov cx,_P_&&name+2
+ mov bx,cb
+ lcall &r
+ _gensub <LP>
+ endif
+ &endm
+endm
+
+;=========================================================================
+;
+; Generic parameter macros
+;
+P_2 macro name, opts
+ _DefParm <name>,2,<opts>
+endm
+
+P_4 macro name, opts
+ _DefParm <name>,4,<opts>
+endm
+
+P_8 macro name, opts
+ _DefParm <name>,8,<opts>
+endm
+
+P_char equ <P_2>
+P_int equ <P_2>
+P_BYTE equ <P_2>
+P_BOOL equ <P_2>
+P_WORD equ <P_2>
+
+P_WORDMBZ equ <P_2>
+P_WORDMBNZ equ <P_2>
+
+P_LONG equ <P_4>
+P_DWORD equ <P_4>
+
+;
+; Generic handle
+;
+P_H macro name, opts
+ _GenParm <name>,2,<opts>
+ if VLgen
+; mov ax,_P_&name
+; lcall H
+; _gensub H
+ endif
+endm
+
+;
+; Generic handle or NULL
+;
+P_H0 equ <P_2>
+
+;
+; Ensure signed value is min <= value <= max
+;
+P_RVALUE macro name, min, max, opts
+ local valok
+ _GenParm <name>,2,<opts>
+ if VLgen
+ mov ax,_P_&name
+ cmp ax,min
+ jl @F
+ cmp ax,max
+ jle valok
+@@:
+ mov bx,ERR_BAD_VALUE or ERR_WARNING
+ lcall Inval_Param_
+valok:
+ endif
+endm
+
+;
+; Ensure signed value is 0 <= value <= max
+;
+P_VALUE macro name, max, opts
+ _GenParm <name>,2,<opts>
+ if VLgen
+ mov ax,_P_&name
+ cmp ax,max
+ jbe @F ;; unsigned comparison to catch < 0.
+ mov bx,ERR_BAD_VALUE or ERR_WARNING
+ lcall Inval_Param_
+@@:
+ endif
+endm
+
+;
+; Ensure unsigned value is value <= max
+;
+P_UVALUE equ <P_VALUE>
+
+;
+; Ensure signed value is 0 <= value <= max
+;
+P_VALUEW macro name, max, opts
+ _GenParm <name>,2,<opts>
+ if VLgen
+ mov ax,_P_&name
+ cmp ax,max
+ jbe @F ;; unsigned comparison to catch < 0.
+ mov bx,ERR_BAD_VALUE or ERR_WARNING
+ lcall Inval_Param_
+@@:
+ endif
+endm
+
+;
+; Ensure unsigned value is value <= max
+;
+P_UVALUEW equ <P_VALUEW>
+
+;
+; Ensure signed byte value is min <= value <= max
+;
+if 0
+P_BVALUE macro name,max,opts
+ _GenParm <name>,2,<opts>
+ if VLGen
+ mov al,_P_&name
+ cmp al,max
+ jle @F
+ lcall ErrorBValue
+@@:
+ endif
+endm
+else
+P_BVALUE equ <P_2>
+endif
+
+;
+; Ensure that no incorrect bits are set in a flags word
+; (i.e., (name & ~valid) == 0)
+;
+P_FLAGS macro name, valid, opts
+ _DefParm <name>,2,<opts>
+ if not(valid)
+ if VLgen
+ _FlsFrame
+ mov ax,_P_&name
+ ife (low(not(valid)))
+ test ah,high(not(valid))
+ else
+ ife (high(not(valid)))
+ test al,low(not(valid))
+ else
+ test ax,not(valid)
+ endif
+ endif
+ jz @F
+ mov bx,ERR_BAD_FLAGS or ERR_WARNING
+ lcall Inval_Param_
+@@:
+ endif
+ endif
+endm
+
+;
+; Ensure that no incorrect bits are set in a flags dword
+; (i.e., (name & ~valid) == 0)
+;
+P_DFLAGS macro name, valid_l, valid_h, opts
+ local flagok
+ _DefParm <name>,4,<opts>
+ if not(valid_l) or not(valid_h)
+ if VLgen
+ _FlsFrame
+ mov ax,_P_&name
+ mov cx,_P_&name+2
+ if not(valid_l)
+ test ax,not(valid_l)
+ if not(valid_h)
+ jnz @F
+ else
+ jz flagok
+ endif
+ endif
+ if not(valid_h)
+ test cx,not(valid_h)
+ jz flagok
+@@:
+ endif
+ mov bx,ERR_BAD_DFLAGS or ERR_WARNING
+ lcall Inval_Param_
+flagok:
+ endif
+ endif
+endm
+
+;
+; P_LPFN - function pointer
+; P_LPFN0 - function pointer or NULL
+;
+P_LPFN macro name, opts
+ _GenParm <name>,4,<opts>
+ if VLgen
+ mov ax,_P_&name
+ mov cx,_P_&name+2
+ lcall LPFN
+ _gensub LPFN
+ endif
+endm
+
+P_LPFN0 macro name, opts
+ _GenParm <name>,4,<opts>
+ if VLgen
+ mov ax,_P_&name
+ mov cx,_P_&name+2
+ lcall LPFN0
+ _gensub LPFN
+ endif
+endm
+
+_GenBuf macro p,r
+ P_&p &macro lpch, cch, opts
+ _DefParm <lpch>,4,<opts>
+ _DefParm <cch>,2,<opts>
+ if VLgen
+ _FlsFrame
+ mov ax,_P_&&lpch
+ mov cx,_P_&&lpch+2
+ mov bx,_P_&&cch
+ lcall &r
+ _gensub LP
+ endif
+ &endm
+endm
+
+_GenBufspl macro p,r
+ P_&p &macro lpch, cch, opts
+ _DefParm <lpch>,4,<opts>
+ _DefParm <cch>,2,<opts>
+ if VLgen
+ _FlsFrame
+ mov ax,_P_&&lpch
+ mov cx,_P_&&lpch+2
+ lea bx,_P_&&cch
+ lcall &r
+ _gensub LPBUF
+ endif
+ &endm
+endm
+
+_GenBufspl <LPBUFFER>,<LPBUF>
+_GenBuf <CLPBUFFER>,<CLP>
+_GenBufspl <LPBUFFER0>,<LPBUF0>
+_GenBuf <CLPBUFFER0>,<CLP0>
+
+;
+; If pszBuf is valid, set its first byte to 0
+;
+E_SETEMPTY macro pszBuf,cchBuf,opts
+ push bp
+ mov bp,sp
+ mov cx,_P_&cchBuf
+ mov bx,_P_&pszBuf
+ mov dx,_P_&pszBuf+2
+ pop bp
+ lcall SETEMPTY
+ _gensub SETEMPTY
+endm
+
+; Same as above, but with no supplied count
+;
+E_SETEMPTYNC macro pszBuf,opts
+ push bp
+ mov bp,sp
+ mov cx,1
+ mov bx,_P_&pszBuf
+ mov dx,_P_&pszBuf+2
+ pop bp
+ lcall SETEMPTY
+ _gensub SETEMPTY
+endm
+
+_GenLP <P_LPSTR>,<LP>,1
+_GenLP <P_LPSTR0>,<LP0>,1
+
+P_CLPSTR macro name,cch,opts
+ _GenParm <name>,4,<opts>
+ if VLgen
+ mov ax,_P_&name
+ mov cx,_P_&name+2
+ ifb <cch>
+ mov bx,-1
+ else
+ mov bx,cch
+ endif
+ lcall CLPSZ
+ _gensub LPSZ
+ endif
+endm
+
+P_CLPSTR0 macro name,cch,opts
+ _GenParm <name>,4,<opts>
+ if VLgen
+ mov ax,_P_&name
+ mov cx,_P_&name+2
+ ifb <cch>
+ mov bx,-1
+ else
+ mov bx,cch
+ endif
+ lcall CLPSZ0
+ _gensub LPSZ
+ endif
+endm
+
+_GenLP <P_LPVOID>,<LP>,1
+_GenLP <P_LPVOID0>,<LP0>,1
+_GenLP <P_CLPVOID>,<CLP>,1
+_GenLP <P_CLPVOID0>,<CLP0>,1
+
+_GenLP <P_LPBYTE>,<LP>,1
+_GenLP <P_LPBYTE0>,<LP0>,1
+_GenLP <P_CLPBYTE>,<CLP>,1
+_GenLP <P_CLPBYTE0>,<CLP0>,1
+
+_GenLP <P_LPINT>,<LP>,2
+_GenLP <P_LPINT0>,<LP0>,2
+_GenLP <P_CLPINT>,<CLP>,2
+_GenLP <P_CLPINT0>,<CLP0>,2
+
+_GenLP <P_LPWORD>,<LP>,2
+_GenLP <P_LPWORD0>,<LP0>,2
+_GenLP <P_CLPWORD>,<CLP>,2
+_GenLP <P_CLPWORD0>,<CLP0>,2
+
+_GenLP <P_LPBOOL>,<LP>,2
+_GenLP <P_LPBOOL0>,<LP0>,2
+_GenLP <P_CLPBOOL>,<CLP>,2
+_GenLP <P_CLPBOOL0>,<CLP0>,2
+
+_GenLP <P_LPLONG>,<LP>,4
+_GenLP <P_LPLONG0>,<LP0>,4
+_GenLP <P_CLPLONG>,<CLP>,4
+_GenLP <P_CLPLONG0>,<CLP0>,4
+
+_GenLP <P_LPDWORD>,<LP>,4
+_GenLP <P_LPDWORD0>,<LP0>,4
+_GenLP <P_CLPDWORD>,<CLP>,4
+_GenLP <P_CLPDWORD0>,<CLP0>,4
+
+;=======================================================================
+;
+; Common USER types
+;
+STRUCT <POINT>
+F_int x
+F_int y
+ENDSTRUCT
+
+STRUCT <LARGEPOINT>
+F_LONG x
+F_LONG y
+ENDSTRUCT
+
+
+_GenLP <P_LPPOINT>,<LP>,%VLcbsPOINT
+_GenLP <P_LPPOINT0>,<LP0>,%VLcbsPOINT
+_GenLP <P_CLPPOINT>,<CLP>,%VLcbsPOINT
+_GenLP <P_CLPPOINT0>,<CLP0>,%VLcbsPOINT
+P_POINT equ <P_4>
+
+_GenLP <P_LPLARGEPOINT>,<LP>,%VLcbsLARGEPOINT
+P_LARGEPOINT equ <P_8>
+
+STRUCT <RECT>
+F_int left
+F_int top
+F_int right
+F_int bottom
+ENDSTRUCT
+
+_GenLP <P_LPRECT>,<LP>,%VLcbsRECT
+_GenLP <P_LPRECT0>,<LP0>,%VLcbsRECT
+_GenLP <P_CLPRECT>,<CLP>,%VLcbsRECT
+_GenLP <P_CLPRECT0>,<CLP0>,%VLcbsRECT
+
+;=======================================================================
+;
+; Common KERNEL types
+;
+P_GHANDLE macro h,opts
+ _GenParm <h>,2,<opts>
+ if VLgen
+ mov ax,_P_&h
+ lcall GHANDLE
+ _gensub GHANDLE
+ endif
+
+endm
+
+P_GHANDLE0 macro h,opts
+ _GenParm <h>,2,<opts>
+ if VLgen
+ mov ax,_P_&h
+ lcall GHANDLE0
+ _gensub GHANDLE
+ endif
+endm
+
+P_GHANDLE32 macro h,opts
+ _GenParm <h>,2,<opts>
+ if VLgen
+ mov ax,_P_&h
+ test al, 0100b ;let zero & BOGUSGDT hInst's through
+ jz @F
+ lcall GHANDLE
+ _gensub GHANDLE
+ @@:
+ endif
+endm
+
+P_HANDLE equ <P_H>
+P_HANDLE0 equ <P_H0>
+
+P_ATOM equ <P_H>
+
+P_HINSTANCE equ <P_GHANDLE>
+P_HINSTANCE0 equ <P_GHANDLE0>
+P_HINSTANCE32 equ <P_GHANDLE32>
+
+P_HMODULE equ <P_GHANDLE>
+P_HMODULE0 equ <P_GHANDLE0>
+
+P_HTASK equ <P_GHANDLE>
+P_HTASK0 equ <P_GHANDLE0>
+
+P_CLPSTRATOM macro name, opts
+ _GenParm <name>,4,<opts>
+ if VLgen
+ mov ax,_P_&name
+ mov cx,_P_&name+2
+ lcall CLPSTRATOM
+ _gensub LPSZ
+ endif
+endm
+
+P_CLPSTRATOM0 macro name, opts
+ _GenParm <name>,4,<opts>
+ if VLgen
+ mov ax,_P_&name
+ mov cx,_P_&name+2
+ lcall CLPSTRATOM0
+ _gensub LPSZ
+ endif
+endm
+
+P_CLPSTRRSRC equ <P_CLPSTRATOM>
+P_CLPSTRRSRC0 equ <P_CLPSTRATOM0>
+
+;---------------------------------------------------------------------------
+; LAYER_EXPAND lseg
+;
+; Expands per-segment validation boilerplate code into segment lseg
+;
+LAYER_EXPAND macro lseg
+.list
+.lall
+ _SwitchSeg &lseg,%VLseg
+
+public VStart&lseg
+VStart&lseg:
+
+EXTRA_EXPAND lseg
+
+;
+; Handle validation
+;
+ifdef genH&lseg
+
+public H&lseg
+H&lseg:
+ or ax,ax
+ jz @F
+ ret
+@@:
+ mov bx,ERR_BAD_HANDLE
+ jmp short Inval_Param_&lseg
+
+endif ; genH&lseg
+
+ifdef genGHANDLE&lseg
+
+public GHANDLE0&lseg
+GHANDLE0&lseg:
+ or ax,ax ; accept NULL
+ jz GHexit&lseg
+
+public GHANDLE&lseg
+GHANDLE&lseg:
+ test al,0100b ; Reject GDT selectors
+ jz GHerr&lseg
+ cmp ax,0ffffh ; special case: -1 -> DS
+ jz GHexit&lseg
+ lar dx,ax ; is it a valid selector?
+ jnz GHerr&lseg
+GHexit&lseg:
+ ret
+
+GHerr&lseg:
+ mov bx,ERR_BAD_GLOBAL_HANDLE
+ jmp short Inval_Param_&lseg
+
+endif ; genGHANDLE&lseg
+
+ifdef genLPFN&lseg
+
+;
+; Function pointer validation
+;
+public LPFN0&lseg
+LPFN0&lseg:
+ mov bx,ax ; Allow NULL
+ or bx,cx
+ jz LPFN_exit&lseg
+
+public LPFN&lseg
+LPFN&lseg:
+beg_fault_trap LPFNbad&lseg
+ lar bx,cx
+ jnz LPFNerr&lseg
+ test bh,8
+ jz LPFNerr&lseg
+ mov es,cx ; validate pointer & offset
+ mov bx,ax
+ mov al,es:[bx]
+end_fault_trap
+
+ifdef DEBUG
+;
+; Make sure the function is exported by
+; ensuring that the first instructions are NOT
+; push ds, pop ax or mov ax,ds.
+;
+ mov bx,es:[bx]+2
+
+ cmp bx,0581eh ; Push ds, pop ax instructions?
+ jz LPFNerr&lseg ; Yes, must be an error.
+ cmp bx,0d88ch ; Mov ax,ds instruction?
+ jz LPFNerr&lseg ; No, we're ok, so jump ahead
+endif ; DEBUG
+
+LPFN_exit&lseg:
+ ret
+
+LPFNbad&lseg:
+ fault_fix_stack
+LPFNerr&lseg:
+ mov bx,ERR_BAD_FUNC_PTR
+ jmp short Inval_Param_&lseg
+
+endif ; genLPFN&lseg
+
+public Inval_Param_&lseg
+Inval_Param_&lseg:
+ pop dx ; convert near return addr to far
+ push cs
+ push dx
+ jmp HandleParamError
+
+ifdef genLP&lseg
+
+public LP0&lseg
+LP0&lseg:
+ or ax,ax ; if cx:ax == NULL, exit
+ jnz @F
+ jcxz CLPexit&lseg
+@@:
+public LP&lseg
+LP&lseg:
+beg_fault_trap CLPbad&lseg
+ mov es,cx
+ or bx,bx ; cb == 0?
+ jz CLPexit&lseg ; yes: just check selector
+ dec bx
+ add bx,ax
+ jc CLPbad1&lseg ; check 16 bit overflow
+ or byte ptr es:[bx],0 ; check write permission, limit
+end_fault_trap
+ ret
+
+public CLP0&lseg
+CLP0&lseg:
+ or ax,ax ; Accept ax:cx == 0
+ jnz @F
+ jcxz CLPexit&lseg
+@@:
+public CLP&lseg
+CLP&lseg:
+beg_fault_trap CLPbad&lseg
+ mov es,cx
+ or bx,bx ; cb == 0?
+ jz CLPexit&lseg ; yes: just check selector
+ dec bx
+ add bx,ax
+ jc CLPbad1&lseg ; check 16 bit overflow
+ mov bl,es:[bx] ; check read permission, limit
+end_fault_trap
+
+public CLPexit&lseg
+CLPexit&lseg:
+ ret
+
+CLPbad&lseg:
+ fault_fix_stack
+CLPbad1&lseg:
+ mov bx,ERR_BAD_PTR
+ jmp Inval_Param_&lseg
+
+endif ; genLP&lseg
+
+ifdef genLPBUF&lseg
+public LPBUF0&lseg
+LPBUF0&lseg:
+ or ax,ax ; if cx:ax == NULL, exit
+ jnz @F
+ jcxz LPBUFexit&lseg
+@@:
+public LPBUF&lseg
+LPBUF&lseg:
+beg_fault_trap LPBUFbad&lseg
+ mov es,cx
+ mov cx, word ptr ss:[bx] ; cb == 0?
+ jcxz LPBUFexit&lseg ; yes: just check selector
+ mov dx, bx
+ mov bx, ax
+ or byte ptr es:[bx],0 ; check write permission, start
+ mov bx, dx
+LPBUFpast1&lseg:
+ dec cx
+ add cx,ax
+ jnc @f ; 16-bit overflow
+ mov bx, 0ffffh
+ mov cx, bx
+ or byte ptr es:[bx],0 ; check write permission, 64k-1
+ jmp LPBUFov&lseg
+@@:
+ mov bx, cx
+ or byte ptr es:[bx],0 ; check write permission, end
+ ret
+end_fault_trap
+
+public LPBUFexit&lseg
+LPBUFexit&lseg:
+ ret
+LPBUFbad&lseg:
+ mov bx, dx
+ pop dx ; fault ip
+ add sp, 2 ; fault
+ cmp dx, offset LPBUFpast1&lseg
+ jb LPBUFbad1&lseg
+
+ mov dx, es
+ lsl cx, dx
+ jnz LPBUFbad1&lseg ; should not occur, we have loaded es
+LPBUFov&lseg:
+ sub cx, ax ; max legal cb
+ inc cx
+ mov word ptr ss:[bx], cx ; fix cb passed by user on stack
+ mov cx, es ; HandleParamError prints cx:ax
+ mov bx,ERR_BAD_PTR or ERR_WARNING
+ jmp Inval_Param_&lseg
+LPBUFbad1&lseg:
+ mov cx, es ; HandleParamError prints cx:ax
+ mov bx,ERR_BAD_PTR
+ jmp Inval_Param_&lseg
+endif ; genLPBUF&lseg
+
+ifdef genLPSZ&lseg
+
+;
+; cx:ax -> const pointer to z-terminated string or MAKEINTATOM atom.
+;
+public CLPSTRATOM0&lseg
+CLPSTRATOM0&lseg:
+ jcxz CLPSZexit&lseg ; If selector is NULL, then all is well.
+
+public CLPSTRATOM&lseg
+CLPSTRATOM&lseg:
+ jcxz @F ; if selector == 0, then may be atom.
+ mov bx,256 ; max string length of 255 characters.
+ jmp short CLPSZ&lseg
+@@:
+ or ax,ax ; offset == 0? if so, it's bogus
+ jz ErrorStrPtr&lseg
+CLPSZexit&lseg:
+ ret
+;
+; cx:ax => const pointer to zero-terminated string.
+; bx => Maximum string length (including zero terminator)
+;
+public CLPSZ0&lseg
+CLPSZ0&lseg:
+ mov dx,ax
+ or dx,cx
+ jz CLPSZexit&lseg
+public CLPSZ&lseg
+CLPSZ&lseg:
+ push di ; preserve these regs
+ push cx
+ mov dx,ax ; preserve original ax in dx
+beg_fault_trap LPSZfault&lseg
+ mov es,cx
+ mov di,ax
+
+ xor ax,ax
+ mov cx,-1
+ cld
+ repnz scasb
+end_fault_trap
+ neg cx ; cx = string length + 1
+ dec cx
+ cmp cx,bx ; error if string length + 1 > cchMax
+
+ pop cx ; restore regs before branching
+ pop di
+ xchg ax,dx
+
+ ja ErrorStrPtr&lseg ; jump if error
+ ret
+
+LPSZfault&lseg:
+ fault_fix_stack
+ pop cx ; restore regs
+ pop di
+ xchg ax,dx
+
+public ErrorStrPtr&lseg
+ErrorStrPtr&lseg:
+ mov bx,ERR_BAD_STRING_PTR
+ jmp Inval_Param_&lseg
+
+endif ; genLPSZ&lseg
+
+ifdef genSETEMPTY&lseg
+
+public SETEMPTY&lseg
+SETEMPTY&lseg:
+ jcxz SETEMPTYexit&lseg ; 0-length buffer: do nothing.
+beg_fault_trap SETEMPTYbad&lseg
+ mov es,dx
+ mov byte ptr es:[bx],0 ; jam in a zero terminator
+end_fault_trap
+SETEMPTYexit&lseg:
+ xor ax,ax
+ cwd
+ ret
+
+SETEMPTYbad&lseg:
+ fault_fix_stack
+ jmp short SETEMPTYexit&lseg
+
+endif ; genSETEMPTY&lseg
+
+public VEnd&lseg
+VEnd&lseg:
+
+sEnd %VLseg
+VLseg equ <>
+
+endm ;LAYER_EXPAND
+
+endif ;; IF1
diff --git a/private/mvdm/wow16/inc/logerror.h b/private/mvdm/wow16/inc/logerror.h
new file mode 100644
index 000000000..785efeb91
--- /dev/null
+++ b/private/mvdm/wow16/inc/logerror.h
@@ -0,0 +1,186 @@
+/****************************************************************************\
+ *
+ * LogError() and LogParamError() definitions
+ *
+ * Excerpted from WINDOWS.H, since that file isn't included by GDI & KERNEL.
+\****************************************************************************/
+
+/* If windows.h already included, don't redefine any of this. */
+/* Include the stuff if NOLOGERROR was defined, though. */
+#if (!defined(_INC_WINDOWS) || defined(NOLOGERROR))
+
+#ifdef WINAPI
+void WINAPI LogError(WORD err, void FAR* lpInfo);
+void WINAPI LogParamError(WORD err, FARPROC lpfn, void FAR* param);
+#endif
+
+/****** LogParamError/LogError values */
+
+/* Error modifier bits */
+
+#define ERR_WARNING 0x8000
+#define ERR_PARAM 0x4000
+
+/* Internal error value masks */ /* ;Internal */
+#define ERR_TYPE_MASK 0x0fff /* ;Internal */
+#define ERR_FLAGS_MASK 0xc000 /* ;Internal */
+ /* ;Internal */
+#define ERR_SIZE_MASK 0x3000
+#define ERR_SIZE_SHIFT 12
+#define ERR_BYTE 0x1000
+#define ERR_WORD 0x2000
+#define ERR_DWORD 0x3000
+
+/****** LogParamError() values */
+
+/* Generic parameter values */
+#define ERR_BAD_VALUE 0x6001
+#define ERR_BAD_FLAGS 0x6002
+#define ERR_BAD_INDEX 0x6003
+#define ERR_BAD_DVALUE 0x7004
+#define ERR_BAD_DFLAGS 0x7005
+#define ERR_BAD_DINDEX 0x7006
+#define ERR_BAD_PTR 0x7007
+#define ERR_BAD_FUNC_PTR 0x7008
+#define ERR_BAD_SELECTOR 0x6009
+#define ERR_BAD_STRING_PTR 0x700a
+#define ERR_BAD_HANDLE 0x600b
+
+/* KERNEL parameter errors */
+#define ERR_BAD_HINSTANCE 0x6020
+#define ERR_BAD_HMODULE 0x6021
+#define ERR_BAD_GLOBAL_HANDLE 0x6022
+#define ERR_BAD_LOCAL_HANDLE 0x6023
+#define ERR_BAD_ATOM 0x6024
+#define ERR_BAD_HFILE 0x6025
+
+/* USER parameter errors */
+#define ERR_BAD_HWND 0x6040
+#define ERR_BAD_HMENU 0x6041
+#define ERR_BAD_HCURSOR 0x6042
+#define ERR_BAD_HICON 0x6043
+#define ERR_BAD_HDWP 0x6044
+#define ERR_BAD_CID 0x6045
+#define ERR_BAD_HDRVR 0x6046
+
+/* GDI parameter errors */
+#define ERR_BAD_COORDS 0x7060
+#define ERR_BAD_GDI_OBJECT 0x6061
+#define ERR_BAD_HDC 0x6062
+#define ERR_BAD_HPEN 0x6063
+#define ERR_BAD_HFONT 0x6064
+#define ERR_BAD_HBRUSH 0x6065
+#define ERR_BAD_HBITMAP 0x6066
+#define ERR_BAD_HRGN 0x6067
+#define ERR_BAD_HPALETTE 0x6068
+#define ERR_BAD_HMETAFILE 0x6069
+
+/* Debug fill constants */
+
+#define DBGFILL_ALLOC 0xfd
+#define DBGFILL_FREE 0xfb
+#define DBGFILL_BUFFER 0xf9
+#define DBGFILL_STACK 0xf7
+
+/**** LogError() values */
+
+/* KERNEL errors */
+#define ERR_GALLOC 0x0001 /* GlobalAlloc Failed */
+#define ERR_GREALLOC 0x0002 /* GlobalReAlloc Failed */
+#define ERR_GLOCK 0x0003 /* GlobalLock Failed */
+#define ERR_LALLOC 0x0004 /* LocalAlloc Failed */
+#define ERR_LREALLOC 0x0005 /* LocalReAlloc Failed */
+#define ERR_LLOCK 0x0006 /* LocalLock Failed */
+#define ERR_ALLOCRES 0x0007 /* AllocResource Failed */
+#define ERR_LOCKRES 0x0008 /* LockResource Failed */
+#define ERR_LOADMODULE 0x0009 /* LoadModule failed */
+
+/* USER errors */
+#define ERR_CREATEDLG 0x0040 /* Create Dlg failure due to LoadMenu failure */
+#define ERR_CREATEDLG2 0x0041 /* Create Dlg failure due to CreateWindow Failure */
+#define ERR_REGISTERCLASS 0x0042 /* RegisterClass failure due to Class already registered */
+#define ERR_DCBUSY 0x0043 /* DC Cache is full */
+#define ERR_CREATEWND 0x0044 /* Create Wnd failed due to class not found */
+#define ERR_STRUCEXTRA 0x0045 /* Unallocated Extra space is used */
+#define ERR_LOADSTR 0x0046 /* LoadString() failed */
+#define ERR_LOADMENU 0x0047 /* LoadMenu Failed */
+#define ERR_NESTEDBEGINPAINT 0x0048 /* Nested BeginPaint() calls */
+#define ERR_BADINDEX 0x0049 /* Bad index to Get/Set Class/Window Word/Long */
+#define ERR_CREATEMENU 0x004a /* Error creating menu */
+
+/* GDI errors */
+#define ERR_CREATEDC 0x0080 /* CreateDC/CreateIC etc., failure */
+#define ERR_CREATEMETA 0x0081 /* CreateMetafile failure */
+#define ERR_DELOBJSELECTED 0x0082 /* Bitmap being deleted is selected into DC */
+#define ERR_SELBITMAP 0x0083 /* Bitmap being selected is already selected elsewhere */
+
+/* Debugging information support (DEBUG SYSTEM ONLY) */
+
+#ifdef WINAPI
+
+typedef struct tagWINDEBUGINFO
+{
+ UINT flags;
+ DWORD dwOptions;
+ DWORD dwFilter;
+ char achAllocModule[8];
+ DWORD dwAllocBreak;
+ DWORD dwAllocCount;
+} WINDEBUGINFO;
+
+BOOL WINAPI GetWinDebugInfo(WINDEBUGINFO FAR* lpwdi, UINT flags);
+BOOL WINAPI SetWinDebugInfo(const WINDEBUGINFO FAR* lpwdi);
+
+void FAR _cdecl DebugOutput(UINT flags, LPCSTR lpsz, ...);
+void WINAPI DebugFillBuffer(void FAR* lpb, UINT cb);
+
+#endif
+
+/* WINDEBUGINFO flags values */
+#define WDI_OPTIONS 0x0001
+#define WDI_FILTER 0x0002
+#define WDI_ALLOCBREAK 0x0004
+#define WDI_VALID 0x0007 /* ;Internal */
+
+/* dwOptions values */
+#define DBO_CHECKHEAP 0x0001
+#define DBO_FREEFILL 0x0002
+#define DBO_BUFFERFILL 0x0004
+#define DBO_COMPAT 0x0008
+#define DBO_DISABLEGPTRAPPING 0x0010
+#define DBO_CHECKFREE 0x0020
+#define DBO_RIP_STACK 0x0040
+
+#define DBO_SILENT 0x8000
+
+#define DBO_PARAMBREAK 0x0000 /* ;Internal *//* Obsolete: was 0x4000 */
+#define DBO_TRACEBREAK 0x2000
+#define DBO_WARNINGBREAK 0x1000
+#define DBO_NOERRORBREAK 0x0800
+#define DBO_NOFATALBREAK 0x0400
+#define DBO_TRACEON 0x0000 /* ;Internal *//* Obsolete: was 0x0200 */
+#define DBO_INT3BREAK 0x0100
+
+/* dwFilter values */
+#define DBF_TRACE 0x0000
+#define DBF_WARNING 0x4000
+#define DBF_ERROR 0x8000
+#define DBF_FATAL 0xc000
+#define DBF_SEVMASK 0xc000 /* ;Internal */
+#define DBF_FILTERMASK 0x3fff /* ;Internal */
+#define DBF_INTERNAL 0x0000 /* ;Internal *//* Obsolete: was 0x2000 */
+#define DBF_KERNEL 0x1000
+#define DBF_KRN_MEMMAN 0x0001
+#define DBF_KRN_LOADMODULE 0x0002
+#define DBF_KRN_SEGMENTLOAD 0x0004
+#define DBF_USER 0x0800
+#define DBF_GDI 0x0400
+#define DBF_COMPAT 0x0000 /* ;Internal *//* Obsolete: was 0x0200 */
+#define DBF_LOGERROR 0x0000 /* ;Internal *//* Obsolete: was 0x0100 */
+#define DBF_PARAMERROR 0x0000 /* ;Internal *//* Obsolete: was 0x0080 */
+#define DBF_MMSYSTEM 0x0040
+#define DBF_PENWIN 0x0020
+#define DBF_APPLICATION 0x0010
+#define DBF_DRIVER 0x0008
+
+#endif /* _INC_WINDOWS */
diff --git a/private/mvdm/wow16/inc/logerror.inc b/private/mvdm/wow16/inc/logerror.inc
new file mode 100644
index 000000000..dfbcbdd1c
--- /dev/null
+++ b/private/mvdm/wow16/inc/logerror.inc
@@ -0,0 +1,159 @@
+;---------------------------------------------------------------------------
+; Added for Win 31 style Parameter Validation.
+;
+; Note: This file was copied AS IT IS from Win 31 golden sources and MUST
+; NOT be changed unless it changes in Win 31.
+;
+; History : Added on 14-April-92 by Chandan Chauhan (ChandanC)
+;
+;---------------------------------------------------------------------------
+
+
+;/****** LogParamError/LogError values */
+
+;/* Error modifier bits */
+
+ERR_WARNING equ 08000h
+ERR_PARAM equ 04000h
+
+;/* Internal error value masks */ ;/* ;Internal */
+ERR_TYPE_MASK equ 00fffh ;/* ;Internal */
+ERR_FLAGS_MASK equ 0c000h ;/* ;Internal */
+ ;/* ;Internal */
+ERR_SIZE_MASK equ 03000h
+ERR_SIZE_SHIFT equ 12
+ERR_BYTE equ 01000h
+ERR_WORD equ 02000h
+ERR_DWORD equ 03000h
+
+;/****** LogParamError() values */
+
+;/* Generic parameter values */
+ERR_BAD_VALUE equ 06001h
+ERR_BAD_FLAGS equ 06002h
+ERR_BAD_INDEX equ 06003h
+ERR_BAD_DVALUE equ 07004h
+ERR_BAD_DFLAGS equ 07005h
+ERR_BAD_DINDEX equ 07006h
+ERR_BAD_PTR equ 07007h
+ERR_BAD_FUNC_PTR equ 07008h
+ERR_BAD_SELECTOR equ 06009h
+ERR_BAD_STRING_PTR equ 0700ah
+ERR_BAD_HANDLE equ 0600bh
+
+;/* KERNEL parameter errors */
+ERR_BAD_HINSTANCE equ 06020h
+ERR_BAD_HMODULE equ 06021h
+ERR_BAD_GLOBAL_HANDLE equ 06022h
+ERR_BAD_LOCAL_HANDLE equ 06023h
+ERR_BAD_ATOM equ 06024h
+ERR_BAD_HFILE equ 06025h
+
+;/* USER parameter errors */
+ERR_BAD_HWND equ 06040h
+ERR_BAD_HMENU equ 06041h
+ERR_BAD_HCURSOR equ 06042h
+ERR_BAD_HICON equ 06043h
+ERR_BAD_HDWP equ 06044h
+ERR_BAD_CID equ 06045h
+ERR_BAD_HDRVR equ 06046h
+
+;/* GDI parameter errors */
+ERR_BAD_COORDS equ 07060h
+ERR_BAD_GDI_OBJECT equ 06061h
+ERR_BAD_HDC equ 06062h
+ERR_BAD_HPEN equ 06063h
+ERR_BAD_HFONT equ 06064h
+ERR_BAD_HBRUSH equ 06065h
+ERR_BAD_HBITMAP equ 06066h
+ERR_BAD_HRGN equ 06067h
+ERR_BAD_HPALETTE equ 06068h
+ERR_BAD_HMETAFILE equ 06069h
+
+;/* Debug fill constants */
+
+DBGFILL_ALLOC equ 0fdh
+DBGFILL_FREE equ 0fbh
+DBGFILL_BUFFER equ 0f9h
+DBGFILL_STACK equ 0f7h
+
+;/**** LogError() values */
+
+;/* KERNEL errors */
+ERR_GALLOC equ 00001h ;/* GlobalAlloc Failed */
+ERR_GREALLOC equ 00002h ;/* GlobalReAlloc Failed */
+ERR_GLOCK equ 00003h ;/* GlobalLock Failed */
+ERR_LALLOC equ 00004h ;/* LocalAlloc Failed */
+ERR_LREALLOC equ 00005h ;/* LocalReAlloc Failed */
+ERR_LLOCK equ 00006h ;/* LocalLock Failed */
+ERR_ALLOCRES equ 00007h ;/* AllocResource Failed */
+ERR_LOCKRES equ 00008h ;/* LockResource Failed */
+ERR_LOADMODULE equ 00009h ;/* LoadModule failed */
+
+;/* USER errors */
+ERR_CREATEDLG equ 00040h ;/* Create Dlg failure due to LoadMenu failure */
+ERR_CREATEDLG2 equ 00041h ;/* Create Dlg failure due to CreateWindow Failure */
+ERR_REGISTERCLASS equ 00042h ;/* RegisterClass failure due to Class already registered */
+ERR_DCBUSY equ 00043h ;/* DC Cache is full */
+ERR_CREATEWND equ 00044h ;/* Create Wnd failed due to class not found */
+ERR_STRUCEXTRA equ 00045h ;/* Unallocated Extra space is used */
+ERR_LOADSTR equ 00046h ;/* LoadString() failed */
+ERR_LOADMENU equ 00047h ;/* LoadMenu Failed */
+ERR_NESTEDBEGINPAINT equ 00048h ;/* Nested BeginPaint() calls */
+ERR_BADINDEX equ 00049h ;/* Bad index to Get/Set Class/Window Word/Long */
+ERR_CREATEMENU equ 0004ah ;/* Error creating menu */
+
+;/* GDI errors */
+ERR_CREATEDC equ 00080h ;/* CreateDC/CreateIC etc., failure */
+ERR_CREATEMETA equ 00081h ;/* CreateMetafile failure */
+ERR_DELOBJSELECTED equ 00082h ;/* Bitmap being deleted is selected into DC */
+ERR_SELBITMAP equ 00083h ;/* Bitmap being selected is already selected elsewhere */
+
+;****** DebugOutput definitions
+
+; [Windows] DebugOptions field values
+
+DBO_CHECKHEAP equ 00001h
+
+DBO_BUFFERFILL equ 00004h
+DBO_COMPAT equ 00008h
+DBO_DISABLEGPTRAPPING equ 00010h
+DBO_CHECKFREE equ 00020h
+DBO_RIP_STACK equ 00040h
+
+DBO_SILENT equ 08000h
+
+DBO_PARAMBREAK equ 00000h ; Obsolete: was 04000h
+DBO_TRACEBREAK equ 02000h
+DBO_WARNINGBREAK equ 01000h
+DBO_NOERRORBREAK equ 00800h
+DBO_NOFATALBREAK equ 00400h
+DBO_TRACEON equ 00000h ; Obsolete: was 00200h
+DBO_INT3BREAK equ 00100h
+
+; flags values
+
+DBF_TRACE equ 00000h
+DBF_WARNING equ 04000h
+DBF_ERROR equ 08000h
+DBF_FATAL equ 0c000h
+
+DBF_SEVMASK equ 0c000h
+DBF_FILTERMASK equ 03fffh
+
+; [Windows] DebugFilter and flags values
+
+DBF_INTERNAL equ 00000h ; Obsolete: was 02000h
+DBF_KERNEL equ 01000h
+DBF_KRN_MEMMAN equ 00001h
+DBF_KRN_LOADMODULE equ 00002h
+DBF_KRN_SEGMENTLOAD equ 00004h
+DBF_USER equ 00800h
+DBF_GDI equ 00400h
+DBF_COMPAT equ 00000h ; Obsolete: was 00200h
+DBF_LOGERROR equ 00000h ; Obsolete: was 00100h
+DBF_PARAMERROR equ 00000h ; Obsolete: was 00080h
+DBF_MMSYSTEM equ 00040h
+DBF_PENWIN equ 00020h
+DBF_APPLICATION equ 00010h
+DBF_DRIVER equ 00008h
diff --git a/private/mvdm/wow16/inc/lzdos.h b/private/mvdm/wow16/inc/lzdos.h
new file mode 100644
index 000000000..79b44677d
--- /dev/null
+++ b/private/mvdm/wow16/inc/lzdos.h
@@ -0,0 +1,5 @@
+/* OBSOLETE: Replaced by #define LIB/#include <lzexpand.h> */
+#ifndef LIB
+#define LIB
+#endif
+#include <lzexpand.h>
diff --git a/private/mvdm/wow16/inc/lzexpand.h b/private/mvdm/wow16/inc/lzexpand.h
new file mode 100644
index 000000000..29264d387
--- /dev/null
+++ b/private/mvdm/wow16/inc/lzexpand.h
@@ -0,0 +1,95 @@
+/*****************************************************************************\
+* *
+* lzexpand.h Public interfaces for LZEXPAND.DLL. *
+* *
+* Version 3.10 *
+* *
+* NOTE: windows.h must be included first if LIB is NOT #defined *
+* *
+* Copyright (c) 1992, Microsoft Corp. All rights reserved. *
+* *
+*******************************************************************************
+*
+* #define LIB - To be used with LZEXP?.LIB (default is for LZEXPAND.DLL)
+* NOTE: Not compatible with windows.h if LIB is #defined
+*
+\*****************************************************************************/
+
+#ifndef _INC_LZEXPAND
+#define _INC_LZEXPAND
+
+#ifdef __cplusplus
+extern "C" { /* Assume C declarations for C++ */
+#endif /* __cplusplus */
+
+/*
+ * If .lib version is being used, declare types used in this file.
+ */
+#ifdef LIB
+
+#define LZAPI _pascal
+
+#ifndef WINAPI /* don't declare if they're already declared */
+#define WINAPI _far _pascal
+#define NEAR _near
+#define FAR _far
+#define PASCAL _pascal
+typedef int BOOL;
+#define TRUE 1
+#define FALSE 0
+typedef unsigned char BYTE;
+typedef unsigned short WORD;
+typedef unsigned int UINT;
+typedef signed long LONG;
+typedef unsigned long DWORD;
+typedef char far* LPSTR;
+typedef const char far* LPCSTR;
+typedef int HFILE;
+#define OFSTRUCT void /* Not used by the .lib version */
+#endif /* WINAPI */
+
+#else /* LIB */
+
+#define LZAPI _far _pascal
+
+/* If .dll version is being used and we're being included with
+ * the 3.0 windows.h, #define compatible type aliases.
+ * If included with the 3.0 windows.h, #define compatible aliases
+ */
+#ifndef _INC_WINDOWS
+#define UINT WORD
+#define LPCSTR LPSTR
+#define HFILE int
+#endif /* !_INC_WINDOWS */
+
+#endif /* !LIB */
+
+/****** Error return codes ***************************************************/
+
+#define LZERROR_BADINHANDLE (-1) /* invalid input handle */
+#define LZERROR_BADOUTHANDLE (-2) /* invalid output handle */
+#define LZERROR_READ (-3) /* corrupt compressed file format */
+#define LZERROR_WRITE (-4) /* out of space for output file */
+#define LZERROR_GLOBALLOC (-5) /* insufficient memory for LZFile struct */
+#define LZERROR_GLOBLOCK (-6) /* bad global handle */
+#define LZERROR_BADVALUE (-7) /* input parameter out of range */
+#define LZERROR_UNKNOWNALG (-8) /* compression algorithm not recognized */
+
+/****** Public functions *****************************************************/
+
+int LZAPI LZStart(void);
+void LZAPI LZDone(void);
+LONG LZAPI CopyLZFile(HFILE, HFILE);
+LONG LZAPI LZCopy(HFILE, HFILE);
+HFILE LZAPI LZInit(HFILE);
+int LZAPI GetExpandedName(LPCSTR, LPSTR);
+HFILE LZAPI LZOpenFile(LPCSTR, OFSTRUCT FAR*, UINT);
+LONG LZAPI LZSeek(HFILE, LONG, int);
+int LZAPI LZRead(HFILE, void FAR*, int);
+void LZAPI LZClose(HFILE);
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* _INC_LZEXPAND */
diff --git a/private/mvdm/wow16/inc/memory.h b/private/mvdm/wow16/inc/memory.h
new file mode 100644
index 000000000..4729feee8
--- /dev/null
+++ b/private/mvdm/wow16/inc/memory.h
@@ -0,0 +1,56 @@
+/***
+*memory.h - declarations for buffer (memory) manipulation routines
+*
+* Copyright (c) 1985-1990, Microsoft Corporation. All rights reserved.
+*
+*Purpose:
+* This include file contains the function declarations for the
+* buffer (memory) manipulation routines.
+* [System V]
+*
+****/
+
+#if defined(_DLL) && !defined(_MT)
+#error Cannot define _DLL without _MT
+#endif
+
+#ifdef _MT
+#define _FAR_ _far
+#else
+#define _FAR_
+#endif
+
+#ifndef _SIZE_T_DEFINED
+typedef unsigned int size_t;
+#define _SIZE_T_DEFINED
+#endif
+
+
+/* function prototypes */
+
+void _FAR_ * _FAR_ _cdecl memccpy(void _FAR_ *, const void _FAR_ *,
+ int, unsigned int);
+void _FAR_ * _FAR_ _cdecl memchr(const void _FAR_ *, int, size_t);
+int _FAR_ _cdecl memcmp(const void _FAR_ *, const void _FAR_ *,
+ size_t);
+void _FAR_ * _FAR_ _cdecl memcpy(void _FAR_ *, const void _FAR_ *,
+ size_t);
+int _FAR_ _cdecl memicmp(const void _FAR_ *, const void _FAR_ *,
+ unsigned int);
+void _FAR_ * _FAR_ _cdecl memset(void _FAR_ *, int, size_t);
+void _FAR_ _cdecl movedata(unsigned int, unsigned int, unsigned int,
+ unsigned int, unsigned int);
+
+
+/* model independent function prototypes */
+
+void _far * _far _cdecl _fmemccpy(void _far *, const void _far *,
+ int, unsigned int);
+void _far * _far _cdecl _fmemchr(const void _far *, int, size_t);
+int _far _cdecl _fmemcmp(const void _far *, const void _far *,
+ size_t);
+void _far * _far _cdecl _fmemcpy(void _far *, const void _far *,
+ size_t);
+int _far _cdecl _fmemicmp(const void _far *, const void _far *,
+ unsigned int);
+void _far * _far _cdecl _fmemset(void _far *, int, size_t);
diff --git a/private/mvdm/wow16/inc/mmddk.h b/private/mvdm/wow16/inc/mmddk.h
new file mode 100644
index 000000000..05be56420
--- /dev/null
+++ b/private/mvdm/wow16/inc/mmddk.h
@@ -0,0 +1,414 @@
+/****************************************************************************/
+/* */
+/* MMDDK.H - Include file for Multimedia Device Development Kit */
+/* */
+/* Note: You must include the WINDOWS.H and MMSYSTEM.H header files */
+/* before including this file. */
+/* */
+/* Copyright (c) 1990-1991, Microsoft Corp. All rights reserved. */
+/* */
+/****************************************************************************/
+
+
+/* If defined, the following flags inhibit inclusion
+ * of the indicated items:
+ *
+ * MMNOMIDIDEV - MIDI support
+ * MMNOWAVEDEV - Waveform support
+ * MMNOAUXDEV - Auxiliary output support
+ * MMNOTIMERDEV - Timer support
+ * MMNOJOYDEV - Joystick support
+ * MMNOMCIDEV - MCI support
+ * MMNOTASKDEV - Task support
+ */
+#ifdef NOMIDIDEV /* ;Internal */
+#define MMNOMIDIDEV /* ;Internal */
+#endif /*ifdef NOMIDIDEV */ /* ;Internal */
+#ifdef NOWAVEDEV /* ;Internal */
+#define MMNOWAVEDEV /* ;Internal */
+#endif /*ifdef NOWAVEDEV */ /* ;Internal */
+#ifdef NOAUXDEV /* ;Internal */
+#define MMNOAUXDEV /* ;Internal */
+#endif /*ifdef NOAUXDEV */ /* ;Internal */
+#ifdef NOTIMERDEV /* ;Internal */
+#define MMNOTIMERDEV /* ;Internal */
+#endif /*ifdef NOTIMERDEV */ /* ;Internal */
+#ifdef NOJOYDEV /* ;Internal */
+#define MMNOJOYDEV /* ;Internal */
+#endif /*ifdef NOJOYDEV */ /* ;Internal */
+#ifdef NOMCIDEV /* ;Internal */
+#define MMNOMCIDEV /* ;Internal */
+#endif /*ifdef NOMCIDEV */ /* ;Internal */
+#ifdef NOTASKDEV /* ;Internal */
+#define MMNOTASKDEV /* ;Internal */
+#endif /*ifdef NOTASKDEV*/ /* ;Internal */
+
+#ifndef _INC_MMDDK
+#define _INC_MMDDK /* #defined if mmddk.h has been included */
+
+#ifndef RC_INVOKED
+#pragma pack(1) /* Assume byte packing throughout */
+#endif
+
+#ifdef __cplusplus
+extern "C" { /* Assume C declarations for C++ */
+#endif /* __cplusplus */
+
+/***************************************************************************
+
+ Helper functions for drivers
+
+***************************************************************************/
+
+#define DCB_NOSWITCH 0x0008 /* don't switch stacks for callback */
+#define DCB_TYPEMASK 0x0007 /* callback type mask */
+#define DCB_NULL 0x0000 /* unknown callback type */
+
+/* flags for wFlags parameter of DriverCallback() */
+#define DCB_WINDOW 0x0001 /* dwCallback is a HWND */
+#define DCB_TASK 0x0002 /* dwCallback is a HTASK */
+#define DCB_FUNCTION 0x0003 /* dwCallback is a FARPROC */
+
+BOOL WINAPI DriverCallback(DWORD dwCallback, UINT uFlags,
+ HANDLE hDevice, UINT uMessage, DWORD dwUser, DWORD dwParam1, DWORD dwParam2);
+void WINAPI StackEnter(void);
+void WINAPI StackLeave(void);
+
+/* generic prototype for audio device driver entry-point functions */
+/* midMessage(), modMessage(), widMessage(), wodMessage(), auxMessage() */
+typedef DWORD (CALLBACK SOUNDDEVMSGPROC)(UINT uDeviceID, UINT uMessage,
+ DWORD dwInstance, DWORD dwParam1, DWORD dwParam2);
+typedef SOUNDDEVMSGPROC FAR *LPSOUNDDEVMSGPROC;
+
+/* device ID for 386 AUTODMA VxD */
+#define VADMAD_Device_ID 0X0444
+
+#ifndef MMNOWAVEDEV
+/****************************************************************************
+
+ Waveform device driver support
+
+****************************************************************************/
+
+/* maximum number of wave device drivers loaded */
+#define MAXWAVEDRIVERS 10
+
+
+/* waveform input and output device open information structure */
+typedef struct waveopendesc_tag {
+ HWAVE hWave; /* handle */
+ const WAVEFORMAT FAR* lpFormat; /* format of wave data */
+ DWORD dwCallback; /* callback */
+ DWORD dwInstance; /* app's private instance information */
+} WAVEOPENDESC;
+typedef WAVEOPENDESC FAR *LPWAVEOPENDESC;
+
+#define DRVM_USER 0x4000
+
+/*
+ * Message sent by mmsystem to wodMessage(), widMessage(), modMessage(),
+ * and midMessage() when it initializes the wave and midi drivers
+ */
+
+#define DRVM_INIT 100
+#define WODM_INIT DRVM_INIT
+#define WIDM_INIT DRVM_INIT
+#define MODM_INIT DRVM_INIT
+#define MIDM_INIT DRVM_INIT
+#define AUXM_INIT DRVM_INIT
+
+/* messages sent to wodMessage() entry-point function */
+#define WODM_GETNUMDEVS 3
+#define WODM_GETDEVCAPS 4
+#define WODM_OPEN 5
+#define WODM_CLOSE 6
+#define WODM_PREPARE 7
+#define WODM_UNPREPARE 8
+#define WODM_WRITE 9
+#define WODM_PAUSE 10
+#define WODM_RESTART 11
+#define WODM_RESET 12
+#define WODM_GETPOS 13
+#define WODM_GETPITCH 14
+#define WODM_SETPITCH 15
+#define WODM_GETVOLUME 16
+#define WODM_SETVOLUME 17
+#define WODM_GETPLAYBACKRATE 18
+#define WODM_SETPLAYBACKRATE 19
+#define WODM_BREAKLOOP 20
+
+/* messages sent to widMessage() entry-point function */
+#define WIDM_GETNUMDEVS 50
+#define WIDM_GETDEVCAPS 51
+#define WIDM_OPEN 52
+#define WIDM_CLOSE 53
+#define WIDM_PREPARE 54
+#define WIDM_UNPREPARE 55
+#define WIDM_ADDBUFFER 56
+#define WIDM_START 57
+#define WIDM_STOP 58
+#define WIDM_RESET 59
+#define WIDM_GETPOS 60
+
+#endif /*ifndef MMNOWAVEDEV */
+
+
+#ifndef MMNOMIDIDEV
+/****************************************************************************
+
+ MIDI device driver support
+
+****************************************************************************/
+
+/* maximum number of MIDI device drivers loaded */
+#define MAXMIDIDRIVERS 10
+
+/* MIDI input and output device open information structure */
+typedef struct midiopendesc_tag {
+ HMIDI hMidi; /* handle */
+ DWORD dwCallback; /* callback */
+ DWORD dwInstance; /* app's private instance information */
+} MIDIOPENDESC;
+typedef MIDIOPENDESC FAR *LPMIDIOPENDESC;
+
+/* messages sent to modMessage() entry-point function */
+#define MODM_GETNUMDEVS 1
+#define MODM_GETDEVCAPS 2
+#define MODM_OPEN 3
+#define MODM_CLOSE 4
+#define MODM_PREPARE 5
+#define MODM_UNPREPARE 6
+#define MODM_DATA 7
+#define MODM_LONGDATA 8
+#define MODM_RESET 9
+#define MODM_GETVOLUME 10
+#define MODM_SETVOLUME 11
+#define MODM_CACHEPATCHES 12
+#define MODM_CACHEDRUMPATCHES 13
+
+/* messages sent to midMessage() entry-point function */
+#define MIDM_GETNUMDEVS 53
+#define MIDM_GETDEVCAPS 54
+#define MIDM_OPEN 55
+#define MIDM_CLOSE 56
+#define MIDM_PREPARE 57
+#define MIDM_UNPREPARE 58
+#define MIDM_ADDBUFFER 59
+#define MIDM_START 60
+#define MIDM_STOP 61
+#define MIDM_RESET 62
+
+#endif /*ifndef MMNOMIDIDEV */
+
+
+#ifndef MMNOAUXDEV
+/****************************************************************************
+
+ Auxiliary audio device driver support
+
+****************************************************************************/
+
+/* maximum number of auxiliary device drivers loaded */
+#define MAXAUXDRIVERS 10
+
+/* messages sent to auxMessage() entry-point function */
+#define AUXDM_GETNUMDEVS 3
+#define AUXDM_GETDEVCAPS 4
+#define AUXDM_GETVOLUME 5
+#define AUXDM_SETVOLUME 6
+
+#endif /*ifndef MMNOAUXDEV */
+
+
+#ifndef MMNOTIMERDEV
+/****************************************************************************
+
+ Timer device driver support
+
+****************************************************************************/
+
+typedef struct timerevent_tag {
+ UINT wDelay; /* delay required */
+ UINT wResolution; /* resolution required */
+ LPTIMECALLBACK lpFunction; /* ptr to callback function */
+ DWORD dwUser; /* user DWORD */
+ UINT wFlags; /* defines how to program event */
+} TIMEREVENT;
+typedef TIMEREVENT FAR *LPTIMEREVENT;
+
+/* messages sent to tddMessage() function */
+#define TDD_KILLTIMEREVENT DRV_RESERVED+0 /* indices into a table of */
+#define TDD_SETTIMEREVENT DRV_RESERVED+4 /* functions; thus offset by */
+#define TDD_GETSYSTEMTIME DRV_RESERVED+8 /* four each time... */
+#define TDD_GETDEVCAPS DRV_RESERVED+12 /* room for future expansion */
+#define TDD_BEGINMINPERIOD DRV_RESERVED+16 /* room for future expansion */
+#define TDD_ENDMINPERIOD DRV_RESERVED+20 /* room for future expansion */
+
+#endif /*ifndef MMNOTIMERDEV */
+
+
+#ifndef MMNOJOYDEV
+/****************************************************************************
+
+ Joystick device driver support
+
+****************************************************************************/
+
+/* joystick calibration info structure */
+typedef struct joycalibrate_tag {
+ UINT wXbase;
+ UINT wXdelta;
+ UINT wYbase;
+ UINT wYdelta;
+ UINT wZbase;
+ UINT wZdelta;
+} JOYCALIBRATE;
+typedef JOYCALIBRATE FAR *LPJOYCALIBRATE;
+
+/* prototype for joystick message function */
+typedef UINT (CALLBACK JOYDEVMSGPROC)(DWORD dwID, UINT uMessage, LPARAM lParam1, LPARAM lParam2);
+typedef JOYDEVMSGPROC FAR *LPJOYDEVMSGPROC;
+
+/* messages sent to joystick driver's DriverProc() function */
+#define JDD_GETNUMDEVS DRV_RESERVED+0x0001
+#define JDD_GETDEVCAPS DRV_RESERVED+0x0002
+#define JDD_GETPOS DRV_RESERVED+0x0101
+#define JDD_SETCALIBRATION DRV_RESERVED+0x0102
+
+#endif /*ifndef MMNOJOYDEV */
+
+
+#ifndef MMNOMCIDEV
+/****************************************************************************
+
+ MCI device driver support
+
+****************************************************************************/
+
+/* internal MCI messages */
+#define MCI_OPEN_DRIVER 0x0801
+#define MCI_CLOSE_DRIVER 0x0802
+
+#define MAKEMCIRESOURCE(wRet, wRes) MAKELRESULT((wRet), (wRes))
+
+/* string return values only used with MAKEMCIRESOURCE */
+#define MCI_FALSE (MCI_STRING_OFFSET + 19)
+#define MCI_TRUE (MCI_STRING_OFFSET + 20)
+
+/* resource string return values */
+#define MCI_FORMAT_RETURN_BASE MCI_FORMAT_MILLISECONDS_S
+#define MCI_FORMAT_MILLISECONDS_S (MCI_STRING_OFFSET + 21)
+#define MCI_FORMAT_HMS_S (MCI_STRING_OFFSET + 22)
+#define MCI_FORMAT_MSF_S (MCI_STRING_OFFSET + 23)
+#define MCI_FORMAT_FRAMES_S (MCI_STRING_OFFSET + 24)
+#define MCI_FORMAT_SMPTE_24_S (MCI_STRING_OFFSET + 25)
+#define MCI_FORMAT_SMPTE_25_S (MCI_STRING_OFFSET + 26)
+#define MCI_FORMAT_SMPTE_30_S (MCI_STRING_OFFSET + 27)
+#define MCI_FORMAT_SMPTE_30DROP_S (MCI_STRING_OFFSET + 28)
+#define MCI_FORMAT_BYTES_S (MCI_STRING_OFFSET + 29)
+#define MCI_FORMAT_SAMPLES_S (MCI_STRING_OFFSET + 30)
+#define MCI_FORMAT_TMSF_S (MCI_STRING_OFFSET + 31)
+
+#define MCI_VD_FORMAT_TRACK_S (MCI_VD_OFFSET + 5)
+
+#define WAVE_FORMAT_PCM_S (MCI_WAVE_OFFSET + 0)
+#define WAVE_MAPPER_S (MCI_WAVE_OFFSET + 1)
+
+#define MCI_SEQ_MAPPER_S (MCI_SEQ_OFFSET + 5)
+#define MCI_SEQ_FILE_S (MCI_SEQ_OFFSET + 6)
+#define MCI_SEQ_MIDI_S (MCI_SEQ_OFFSET + 7)
+#define MCI_SEQ_SMPTE_S (MCI_SEQ_OFFSET + 8)
+#define MCI_SEQ_FORMAT_SONGPTR_S (MCI_SEQ_OFFSET + 9)
+#define MCI_SEQ_NONE_S (MCI_SEQ_OFFSET + 10)
+#define MIDIMAPPER_S (MCI_SEQ_OFFSET + 11)
+
+/* parameters for internal version of MCI_OPEN message sent from */
+/* mciOpenDevice() to the driver */
+typedef struct {
+ UINT wDeviceID; /* device ID */
+ LPCSTR lpstrParams; /* parameter string for entry in SYSTEM.INI */
+ UINT wCustomCommandTable; /* custom command table (0xFFFF if none) */
+ /* filled in by the driver */
+ UINT wType; /* driver type */
+ /* filled in by the driver */
+} MCI_OPEN_DRIVER_PARMS;
+typedef MCI_OPEN_DRIVER_PARMS FAR * LPMCI_OPEN_DRIVER_PARMS;
+
+/* maximum length of an MCI device type */
+#define MCI_MAX_DEVICE_TYPE_LENGTH 80
+
+/* flags for mciSendCommandInternal() which direct mciSendString() how to */
+/* interpret the return value */
+#define MCI_RESOURCE_RETURNED 0x00010000 /* resource ID */
+#define MCI_COLONIZED3_RETURN 0x00020000 /* colonized ID, 3 bytes data */
+#define MCI_COLONIZED4_RETURN 0x00040000 /* colonized ID, 4 bytes data */
+#define MCI_INTEGER_RETURNED 0x00080000 /* integer conversion needed */
+#define MCI_RESOURCE_DRIVER 0x00100000 /* driver owns returned resource */
+
+/* invalid command table ID */
+#define MCI_NO_COMMAND_TABLE 0xFFFF
+
+/* command table information type tags */
+#define MCI_COMMAND_HEAD 0
+#define MCI_STRING 1
+#define MCI_INTEGER 2
+#define MCI_END_COMMAND 3
+#define MCI_RETURN 4
+#define MCI_FLAG 5
+#define MCI_END_COMMAND_LIST 6
+#define MCI_RECT 7
+#define MCI_CONSTANT 8
+#define MCI_END_CONSTANT 9
+
+/* function prototypes for MCI driver functions */
+DWORD WINAPI mciGetDriverData(UINT uDeviceID);
+BOOL WINAPI mciSetDriverData(UINT uDeviceID, DWORD dwData);
+UINT WINAPI mciDriverYield(UINT uDeviceID);
+BOOL WINAPI mciDriverNotify(HWND hwndCallback, UINT uDeviceID,
+ UINT uStatus);
+UINT WINAPI mciLoadCommandResource(HINSTANCE hInstance,
+ LPCSTR lpResName, UINT uType);
+BOOL WINAPI mciFreeCommandResource(UINT uTable);
+
+#endif /*ifndef MMNOMCIDEV */
+
+
+#ifndef MMNOTASKDEV
+/*****************************************************************************
+
+ Task support
+
+*****************************************************************************/
+
+/* error return values */
+#define TASKERR_NOTASKSUPPORT 1
+#define TASKERR_OUTOFMEMORY 2
+
+/* task support function prototypes */
+#ifdef BUILDDLL /* ;Internal */
+typedef void (FAR PASCAL TASKCALLBACK) (DWORD dwInst); /* ;Internal */
+#else /*ifdef BUILDDLL*/ /* ;Internal */
+typedef void (CALLBACK TASKCALLBACK) (DWORD dwInst);
+#endif /*ifdef BUILDDLL*/ /* ;Internal */
+
+typedef TASKCALLBACK FAR *LPTASKCALLBACK;
+
+UINT WINAPI mmTaskCreate(LPTASKCALLBACK lpfnTaskProc, HTASK FAR * lphTask, DWORD dwInst);
+UINT WINAPI mmTaskBlock(HTASK h);
+BOOL WINAPI mmTaskSignal(HTASK h);
+void WINAPI mmTaskYield(void);
+HTASK WINAPI mmGetCurrentTask(void);
+
+#endif /*ifndef MMNOTASKDEV */
+
+#define MMDDKINC /* ;Internal */
+
+#ifdef __cplusplus
+} /* End of extern "C" { */
+#endif /* __cplusplus */
+
+#ifndef RC_INVOKED
+#pragma pack() /* Revert to default packing */
+#endif
+
+#endif /* _INC_MMDDK */
diff --git a/private/mvdm/wow16/inc/mmddk.inc b/private/mvdm/wow16/inc/mmddk.inc
new file mode 100644
index 000000000..efdc04c1e
--- /dev/null
+++ b/private/mvdm/wow16/inc/mmddk.inc
@@ -0,0 +1,337 @@
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;
+; MMDDK.INC - Multimedia assembly language structures & constants
+; for the Development Kit
+;
+; Copyright (c) Microsoft Corporation 1990. All rights reserved
+;
+;
+; If defined, the following flags inhibit inclusion of the indicated items:
+;
+; NOTIMERDEV - The Timer Device
+; NOJOYDEV - The Joystick Device
+;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+; If defined, the following flags inhibit inclusion
+; of the indicated items:
+;
+; MMNOMIDIDEV - MIDI support
+; MMNOWAVEDEV - Waveform support
+; MMNOAUXDEV - Auxiliary output support
+; MMNOTIMERDEV - Timer support
+; MMNOJOYDEV - Joystick support
+; MMNOMCIDEV - MCI support
+; MMNOTASKDEV - Task support
+;
+
+OFFSEL STRUC
+Off dw ?
+Sel dw ?
+OFFSEL ENDS
+
+LOHI STRUC
+Lo dw ?
+Hi dw ?
+LOHI ENDS
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;
+; Helper functions for drivers
+;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+DCB_NOSWITCH equ 0008h ; don't switch stacks for callback
+DCB_TYPEMASK equ 0007h ; callback type mask
+DCB_NULL equ 0000h ; unknown callback type
+
+; flags for wFlags parameter of DriverCallback()
+DCB_WINDOW equ 0001h ; dwCallback is a HWND
+DCB_TASK equ 0002h ; dwCallback is a HTASK
+DCB_FUNCTION equ 0003h ; dwCallback is a FARPROC
+
+; device ID for 386 AUTODMA VxD
+VADMAD_Device_ID equ 0444h
+
+ifndef MMNOWAVEDEV
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;
+; Waveform device driver support
+;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+; maximum number of wave device drivers loaded
+MAXWAVEDRIVERS equ 10
+
+
+; waveform input and output device open information structure
+WAVEOPENDESC struc
+ wod_hWave dw ? ; handle
+ wod_lpFormat dd ? ; format of wave data
+ wod_dwCallback dd ? ; callback
+ wod_dwInstance dd ? ; app's private instance information
+WAVEOPENDESC ends
+
+; message sent by mmsystem to wodMessage(), widMessage(), modMessage(),
+; and midMessage() when it initializes the wave and midi drivers
+
+DRVM_USER equ 4000h
+DRVM_INIT equ 100
+WODM_INIT equ DRVM_INIT
+WIDM_INIT equ DRVM_INIT
+MODM_INIT equ DRVM_INIT
+MIDM_INIT equ DRVM_INIT
+AUXM_INIT equ DRVM_INIT
+
+; messages sent to wodMessage() entry-point function
+WODM_GETNUMDEVS equ 3
+WODM_GETDEVCAPS equ 4
+WODM_OPEN equ 5
+WODM_CLOSE equ 6
+WODM_PREPARE equ 7
+WODM_UNPREPARE equ 8
+WODM_WRITE equ 9
+WODM_PAUSE equ 10
+WODM_RESTART equ 11
+WODM_RESET equ 12
+WODM_GETPOS equ 13
+WODM_GETPITCH equ 14
+WODM_SETPITCH equ 15
+WODM_GETVOLUME equ 16
+WODM_SETVOLUME equ 17
+WODM_GETPLAYBACKRATE equ 18
+WODM_SETPLAYBACKRATE equ 19
+WODM_BREAKLOOP equ 20
+
+; messages sent to widMessage() entry-point function
+WIDM_GETNUMDEVS equ 50
+WIDM_GETDEVCAPS equ 51
+WIDM_OPEN equ 52
+WIDM_CLOSE equ 53
+WIDM_PREPARE equ 54
+WIDM_UNPREPARE equ 55
+WIDM_ADDBUFFER equ 56
+WIDM_START equ 57
+WIDM_STOP equ 58
+WIDM_RESET equ 59
+WIDM_GETPOS equ 60
+
+endif ;ifndef MMNOWAVEDEV
+
+
+ifndef MMNOMIDIDEV
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;
+; MIDI device driver support
+;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+; maximum number of MIDI device drivers loaded
+MAXMIDIDRIVERS equ 10
+
+; MIDI input and output device open information structure
+MIDIOPENDESC struc
+ mod_hMidi dw ? ; handle
+ mod_dwCallback dd ? ; callback
+ mod_dwInstance dd ? ; app's private instance information
+MIDIOPENDESC ends
+
+; messages sent to modMessage() entry-point function
+MODM_GETNUMDEVS equ 1
+MODM_GETDEVCAPS equ 2
+MODM_OPEN equ 3
+MODM_CLOSE equ 4
+MODM_PREPARE equ 5
+MODM_UNPREPARE equ 6
+MODM_DATA equ 7
+MODM_LONGDATA equ 8
+MODM_RESET equ 9
+MODM_GETVOLUME equ 10
+MODM_SETVOLUME equ 11
+MODM_CACHEPATCHES equ 12
+MODM_CACHEDRUMPATCHES equ 13
+
+; messages sent to midMessage() entry-point function
+MIDM_GETNUMDEVS equ 53
+MIDM_GETDEVCAPS equ 54
+MIDM_OPEN equ 55
+MIDM_CLOSE equ 56
+MIDM_PREPARE equ 57
+MIDM_UNPREPARE equ 58
+MIDM_ADDBUFFER equ 59
+MIDM_START equ 60
+MIDM_STOP equ 61
+MIDM_RESET equ 62
+
+endif ;ifndef MMNOMIDIDEV
+
+
+ifndef MMNOAUXDEV
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;
+; Auxiliary audio device driver support
+;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+; maximum number of auxiliary device drivers loaded
+MAXAUXDRIVERS equ 10
+
+; messages sent to auxMessage() entry-point function
+AUXDM_GETNUMDEVS equ 3
+AUXDM_GETDEVCAPS equ 4
+AUXDM_GETVOLUME equ 5
+AUXDM_SETVOLUME equ 6
+
+endif ;ifndef MMNOAUXDEV
+
+
+ifndef MMNOTIMERDEV
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;
+; Timer device driver support
+;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+TIMEREVENT struc
+ te_wDelay dw ? ; delay required
+ te_wResolution dw ? ; resolution required
+ te_lpFunction dd ? ; ptr to callback function
+ te_dwUser dd ? ; user DWORD
+ te_wFlags dw ? ; defines how to program event
+TIMEREVENT ends
+
+; messages sent to tddMessage() function
+TDD_KILLTIMEREVENT equ DRV_RESERVED+0 ; indices into a table of
+TDD_SETTIMEREVENT equ DRV_RESERVED+4 ; functions; thus offset by
+TDD_GETSYSTEMTIME equ DRV_RESERVED+8 ; four each time...
+TDD_GETDEVCAPS equ DRV_RESERVED+12 ; room for future expansion
+TDD_BEGINMINPERIOD equ DRV_RESERVED+16 ; room for future expansion
+TDD_ENDMINPERIOD equ DRV_RESERVED+20 ; room for future expansion
+
+endif ;ifndef MMNOTIMERDEV
+
+
+ifndef MMNOJOYDEV
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;
+; Joystick device driver support
+;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+; joystick calibration info structure
+JOYCALIBRATE struc
+ jcal_wXbase dw ?
+ jcal_wXdelta dw ?
+ jcal_wYbase dw ?
+ jcal_wYdelta dw ?
+ jcal_wZbase dw ?
+ jcal_wZdelta dw ?
+JOYCALIBRATE ends
+
+; messages sent to joystick driver's DriverProc() function
+JDD_GETNUMDEVS equ DRV_RESERVED+0001h
+JDD_GETDEVCAPS equ DRV_RESERVED+0002h
+JDD_GETPOS equ DRV_RESERVED+0101h
+JDD_SETCALIBRATION equ DRV_RESERVED+0102h
+
+endif ;ifndef MMNOJOYDEV
+
+
+ifndef MMNOMCIDEV
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;
+; MCI device driver support
+;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+; internal MCI messages
+MCI_OPEN_DRIVER equ 0801h
+MCI_CLOSE_DRIVER equ 0802h
+
+MAKEMCIRESOURCE MACRO a,b
+ mov ax,a
+ mov dx,b
+ ENDM
+
+; string return values only used with MAKEMCIRESOURCE
+MCI_FALSE equ (MCI_STRING_OFFSET + 19)
+MCI_TRUE equ (MCI_STRING_OFFSET + 20)
+
+; resource string return values
+MCI_FORMAT_RETURN_BASE equ MCI_FORMAT_MILLISECONDS_S
+MCI_FORMAT_MILLISECONDS_S equ (MCI_STRING_OFFSET + 21)
+MCI_FORMAT_HMS_S equ (MCI_STRING_OFFSET + 22)
+MCI_FORMAT_MSF_S equ (MCI_STRING_OFFSET + 23)
+MCI_FORMAT_FRAMES_S equ (MCI_STRING_OFFSET + 24)
+MCI_FORMAT_SMPTE_24_S equ (MCI_STRING_OFFSET + 25)
+MCI_FORMAT_SMPTE_25_S equ (MCI_STRING_OFFSET + 26)
+MCI_FORMAT_SMPTE_30_S equ (MCI_STRING_OFFSET + 27)
+MCI_FORMAT_SMPTE_30DROP_S equ (MCI_STRING_OFFSET + 28)
+MCI_FORMAT_BYTES_S equ (MCI_STRING_OFFSET + 29)
+MCI_FORMAT_SAMPLES_S equ (MCI_STRING_OFFSET + 30)
+MCI_FORMAT_TMSF_S equ (MCI_STRING_OFFSET + 31)
+
+MCI_VD_FORMAT_TRACK_S equ (MCI_VD_OFFSET + 5)
+
+WAVE_FORMAT_PCM_S equ (MCI_WAVE_OFFSET + 0)
+WAVE_MAPPER_S equ (MCI_WAVE_OFFSET + 1)
+
+MCI_SEQ_MAPPER_S equ (MCI_SEQ_OFFSET + 5)
+MCI_SEQ_FILE_S equ (MCI_SEQ_OFFSET + 6)
+MCI_SEQ_MIDI_S equ (MCI_SEQ_OFFSET + 7)
+MCI_SEQ_SMPTE_S equ (MCI_SEQ_OFFSET + 8)
+MCI_SEQ_FORMAT_SONGPTR_S equ (MCI_SEQ_OFFSET + 9)
+MCI_SEQ_NONE_S equ (MCI_SEQ_OFFSET + 10)
+MIDIMAPPER_S equ (MCI_SEQ_OFFSET + 11)
+
+; parameters for internal version of MCI_OPEN message sent from
+; mciOpenDevice() to the driver
+MCI_OPEN_DRIVER_PARMS struc
+ mciodrv_wDeviceID dw ? ; device ID
+ mciodrv_lpstrParams dw ? ; parameter string for entry in SYSTEM.INI
+ mciodrv_wCustomCommandTable dw ? ; custom command table (0FFFFh if none)
+ ; filled in by the driver
+ mciodrv_wType dw ? ; driver type filled in by the driver
+MCI_OPEN_DRIVER_PARMS ends
+
+; maximum length of an MCI device type
+MCI_MAX_DEVICE_TYPE_LENGTH equ 80
+
+; flags for mciSendCommandInternal() which direct mciSendString() how to
+; interpret the return value
+MCI_RESOURCE_RETURNED equ 00010000h ; resource ID
+MCI_COLONIZED3_RETURN equ 00020000h ; colonized ID, 3 bytes data
+MCI_COLONIZED4_RETURN equ 00040000h ; colonized ID, 4 bytes data
+MCI_INTEGER_RETURNED equ 00080000h ; integer conversion needed
+MCI_RESOURCE_DRIVER equ 00100000h ; driver owns returned resource
+
+; invalid command table ID
+MCI_NO_COMMAND_TABLE equ 0FFFFh
+
+; command table information type tags
+MCI_COMMAND_HEAD equ 0
+MCI_STRING equ 1
+MCI_INTEGER equ 2
+MCI_END_COMMAND equ 3
+MCI_RETURN equ 4
+MCI_FLAG equ 5
+MCI_END_COMMAND_LIST equ 6
+MCI_RECT equ 7
+MCI_CONSTANT equ 8
+MCI_END_CONSTANT equ 9
+
+endif ;ifndef MMNOMCIDEV
+
+
+ifndef MMNOTASKDEV
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;
+; Task support
+;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+; error return values
+TASKERR_NOTASKSUPPORT equ 1
+TASKERR_OUTOFMEMORY equ 2
+
+endif ;ifndef MMNOTASKDEV
diff --git a/private/mvdm/wow16/inc/mmsystem.h b/private/mvdm/wow16/inc/mmsystem.h
new file mode 100644
index 000000000..f951dd297
--- /dev/null
+++ b/private/mvdm/wow16/inc/mmsystem.h
@@ -0,0 +1,1954 @@
+/****************************************************************************/
+/* */
+/* MMSYSTEM.H - Include file for Multimedia APIs */
+/* */
+/* Note: You must include WINDOWS.H before including this file. */
+/* */
+/* Copyright (c) 1990-1992, Microsoft Corp. All rights reserved. */
+/* */
+/****************************************************************************/
+#define BUILDDLL
+
+
+
+/* If defined, the following flags inhibit inclusion
+ * of the indicated items:
+ *
+ * MMNODRV - Installable driver support
+ * MMNOSOUND - Sound support
+ * MMNOWAVE - Waveform support
+ * MMNOMIDI - MIDI support
+ * MMNOAUX - Auxiliary audio support
+ * MMNOTIMER - Timer support
+ * MMNOJOY - Joystick support
+ * MMNOMCI - MCI support
+ * MMNOMMIO - Multimedia file I/O support
+ * MMNOMMSYSTEM - General MMSYSTEM functions
+ */
+
+#ifndef _INC_MMSYSTEM
+#define _INC_MMSYSTEM /* #defined if mmsystem.h has been included */
+
+#ifndef RC_INVOKED
+#pragma pack(1) /* Assume byte packing throughout */
+#endif
+
+#ifdef __cplusplus
+extern "C" { /* Assume C declarations for C++ */
+#endif /* __cplusplus */
+
+#ifdef BUILDDLL /* ;Internal */
+#undef WINAPI /* ;Internal */
+#define WINAPI _loadds _far _pascal /* ;Internal */
+#undef CALLBACK /* ;Internal */
+#define CALLBACK _loadds _far _pascal /* ;Internal */
+#endif /* ifdef BUILDDLL */ /* ;Internal */
+
+/****************************************************************************
+
+ General constants and data types
+
+****************************************************************************/
+
+/* general constants */
+#define MAXPNAMELEN 32 /* max product name length (including NULL) */
+#define MAXERRORLENGTH 128 /* max error text length (including NULL) */
+
+/* general data types */
+typedef WORD VERSION; /* major (high byte), minor (low byte) */
+
+/* MMTIME data structure */
+typedef struct mmtime_tag {
+ UINT wType; /* indicates the contents of the union */
+ union {
+ DWORD ms; /* milliseconds */
+ DWORD sample; /* samples */
+ DWORD cb; /* byte count */
+ struct { /* SMPTE */
+ BYTE hour; /* hours */
+ BYTE min; /* minutes */
+ BYTE sec; /* seconds */
+ BYTE frame; /* frames */
+ BYTE fps; /* frames per second */
+ BYTE dummy; /* pad */
+ } smpte;
+ struct { /* MIDI */
+ DWORD songptrpos; /* song pointer position */
+ } midi;
+ } u;
+ } MMTIME;
+typedef MMTIME *PMMTIME;
+typedef MMTIME NEAR *NPMMTIME;
+typedef MMTIME FAR *LPMMTIME;
+
+/* types for wType field in MMTIME struct */
+#define TIME_MS 0x0001 /* time in milliseconds */
+#define TIME_SAMPLES 0x0002 /* number of wave samples */
+#define TIME_BYTES 0x0004 /* current byte offset */
+#define TIME_SMPTE 0x0008 /* SMPTE time */
+#define TIME_MIDI 0x0010 /* MIDI time */
+
+
+/****************************************************************************
+
+ Multimedia Extensions Window Messages
+
+****************************************************************************/
+
+#define MM_JOY1MOVE 0x3A0 /* joystick */
+#define MM_JOY2MOVE 0x3A1
+#define MM_JOY1ZMOVE 0x3A2
+#define MM_JOY2ZMOVE 0x3A3
+#define MM_JOY1BUTTONDOWN 0x3B5
+#define MM_JOY2BUTTONDOWN 0x3B6
+#define MM_JOY1BUTTONUP 0x3B7
+#define MM_JOY2BUTTONUP 0x3B8
+
+#define MM_MCINOTIFY 0x3B9 /* MCI */
+#define MM_MCISYSTEM_STRING 0x3CA /* ;Internal */
+
+#define MM_WOM_OPEN 0x3BB /* waveform output */
+#define MM_WOM_CLOSE 0x3BC
+#define MM_WOM_DONE 0x3BD
+
+#define MM_WIM_OPEN 0x3BE /* waveform input */
+#define MM_WIM_CLOSE 0x3BF
+#define MM_WIM_DATA 0x3C0
+
+#define MM_MIM_OPEN 0x3C1 /* MIDI input */
+#define MM_MIM_CLOSE 0x3C2
+#define MM_MIM_DATA 0x3C3
+#define MM_MIM_LONGDATA 0x3C4
+#define MM_MIM_ERROR 0x3C5
+#define MM_MIM_LONGERROR 0x3C6
+
+#define MM_MOM_OPEN 0x3C7 /* MIDI output */
+#define MM_MOM_CLOSE 0x3C8
+#define MM_MOM_DONE 0x3C9
+
+
+/****************************************************************************
+
+ String resource number bases (internal use)
+
+****************************************************************************/
+
+#define MMSYSERR_BASE 0
+#define WAVERR_BASE 32
+#define MIDIERR_BASE 64
+#define TIMERR_BASE 96
+#define JOYERR_BASE 160
+#define MCIERR_BASE 256
+
+#define MCI_STRING_OFFSET 512
+#define MCI_VD_OFFSET 1024
+#define MCI_CD_OFFSET 1088
+#define MCI_WAVE_OFFSET 1152
+#define MCI_SEQ_OFFSET 1216
+
+/****************************************************************************
+
+ General error return values
+
+****************************************************************************/
+
+/* general error return values */
+#define MMSYSERR_NOERROR 0 /* no error */
+#define MMSYSERR_ERROR (MMSYSERR_BASE + 1) /* unspecified error */
+#define MMSYSERR_BADDEVICEID (MMSYSERR_BASE + 2) /* device ID out of range */
+#define MMSYSERR_NOTENABLED (MMSYSERR_BASE + 3) /* driver failed enable */
+#define MMSYSERR_ALLOCATED (MMSYSERR_BASE + 4) /* device already allocated */
+#define MMSYSERR_INVALHANDLE (MMSYSERR_BASE + 5) /* device handle is invalid */
+#define MMSYSERR_NODRIVER (MMSYSERR_BASE + 6) /* no device driver present */
+#define MMSYSERR_NOMEM (MMSYSERR_BASE + 7) /* memory allocation error */
+#define MMSYSERR_NOTSUPPORTED (MMSYSERR_BASE + 8) /* function isn't supported */
+#define MMSYSERR_BADERRNUM (MMSYSERR_BASE + 9) /* error value out of range */
+#define MMSYSERR_INVALFLAG (MMSYSERR_BASE + 10) /* invalid flag passed */
+#define MMSYSERR_INVALPARAM (MMSYSERR_BASE + 11) /* invalid parameter passed */
+#define MMSYSERR_LASTERROR (MMSYSERR_BASE + 11) /* last error in range */
+
+
+#if (WINVER < 0x030a)
+DECLARE_HANDLE(HDRVR);
+#endif /* ifdef WINVER < 0x030a */
+
+#ifndef MMNODRV
+/****************************************************************************
+
+ Installable driver support
+
+****************************************************************************/
+
+#if (WINVER < 0x030a)
+
+/* return values from DriverProc() function */
+#define DRV_CANCEL 0x0000
+#define DRV_OK 0x0001
+#define DRV_RESTART 0x0002
+
+/* Driver messages */
+#define DRV_LOAD 0x0001
+#define DRV_ENABLE 0x0002
+#define DRV_OPEN 0x0003
+#define DRV_CLOSE 0x0004
+#define DRV_DISABLE 0x0005
+#define DRV_FREE 0x0006
+#define DRV_CONFIGURE 0x0007
+#define DRV_QUERYCONFIGURE 0x0008
+#define DRV_INSTALL 0x0009
+#define DRV_REMOVE 0x000A
+#define DRV_RESERVED 0x0800
+#define DRV_USER 0x4000
+
+/* LPARAM of DRV_CONFIGURE message */
+typedef struct tagDRVCONFIGINFO {
+ DWORD dwDCISize;
+ LPCSTR lpszDCISectionName;
+ LPCSTR lpszDCIAliasName;
+} DRVCONFIGINFO;
+typedef DRVCONFIGINFO *PDRVCONFIGINFO;
+typedef DRVCONFIGINFO NEAR *NPDRVCONFIGINFO;
+typedef DRVCONFIGINFO FAR *LPDRVCONFIGINFO;
+
+/* installable driver function prototypes */
+LRESULT WINAPI DrvClose(HDRVR hDriver, LPARAM lParam1, LPARAM lParam2);
+HDRVR WINAPI DrvOpen(LPCSTR szDriverName, LPCSTR szSectionName,
+ LPARAM lParam2);
+LRESULT WINAPI DrvSendMessage(HDRVR hDriver, UINT uMessage,
+ LPARAM lParam1, LPARAM lParam2);
+HINSTANCE WINAPI DrvGetModuleHandle(HDRVR hDriver);
+
+LRESULT WINAPI DrvDefDriverProc(DWORD dwDriverIdentifier, HDRVR driverID,
+ UINT uMessage, LPARAM lParam1, LPARAM lParam2);
+
+#define DefDriverProc DrvDefDriverProc
+
+#endif /* ifdef WINVER < 0x030a */
+
+#if (WINVER >= 0x030a)
+
+#ifdef DEBUG /* ;Internal */
+ LRESULT WINAPI DrvClose(HDRVR,LPARAM,LPARAM); /* ;Internal */
+ HDRVR WINAPI DrvOpen(LPCSTR,LPCSTR,LPARAM); /* ;Internal */
+ #define OpenDriver DrvOpen /* ;Internal */
+ #define CloseDriver DrvClose /* ;Internal */
+#endif /* ;Internal */
+
+/* return values from DriverProc() function */
+#define DRV_CANCEL DRVCNF_CANCEL
+#define DRV_OK DRVCNF_OK
+#define DRV_RESTART DRVCNF_RESTART
+
+#endif /* ifdef WINVER >= 0x030a */
+
+#define DRV_MCI_FIRST DRV_RESERVED
+#define DRV_MCI_LAST (DRV_RESERVED + 0xFFF)
+
+#endif /* ifndef MMNODRV */
+
+
+/****************************************************************************
+
+ Driver callback support
+
+****************************************************************************/
+
+/* flags used with waveOutOpen(), waveInOpen(), midiInOpen(), and */
+/* midiOutOpen() to specify the type of the dwCallback parameter. */
+
+#define CALLBACK_TYPEMASK 0x00070000l /* callback type mask */
+#define CALLBACK_NULL 0x00000000l /* no callback */
+#define CALLBACK_WINDOW 0x00010000l /* dwCallback is a HWND */
+#define CALLBACK_TASK 0x00020000l /* dwCallback is a HTASK */
+#define CALLBACK_FUNCTION 0x00030000l /* dwCallback is a FARPROC */
+
+/* driver callback prototypes */
+#ifdef BUILDDLL /* ;Internal */
+typedef void (FAR PASCAL DRVCALLBACK) (HDRVR h, UINT uMessage, DWORD dwUser, DWORD dw1, DWORD dw2); /* ;Internal */
+#else /* ifdef BUILDDLL */ /* ;Internal */
+typedef void (CALLBACK DRVCALLBACK) (HDRVR h, UINT uMessage, DWORD dwUser, DWORD dw1, DWORD dw2);
+#endif /* ifdef BUILDDLL */ /* ;Internal */
+
+typedef DRVCALLBACK FAR *LPDRVCALLBACK;
+
+/****************************************************************************
+
+ Manufacturer and product IDs
+
+ Used with wMid and wPid fields in WAVEOUTCAPS, WAVEINCAPS,
+ MIDIOUTCAPS, MIDIINCAPS, AUXCAPS, JOYCAPS structures.
+
+****************************************************************************/
+
+/* manufacturer IDs */
+#define MM_MICROSOFT 1 /* Microsoft Corp. */
+
+/* product IDs */
+#define MM_MIDI_MAPPER 1 /* MIDI Mapper */
+#define MM_WAVE_MAPPER 2 /* Wave Mapper */
+
+#define MM_SNDBLST_MIDIOUT 3 /* Sound Blaster MIDI output port */
+#define MM_SNDBLST_MIDIIN 4 /* Sound Blaster MIDI input port */
+#define MM_SNDBLST_SYNTH 5 /* Sound Blaster internal synthesizer */
+#define MM_SNDBLST_WAVEOUT 6 /* Sound Blaster waveform output */
+#define MM_SNDBLST_WAVEIN 7 /* Sound Blaster waveform input */
+
+#define MM_ADLIB 9 /* Ad Lib-compatible synthesizer */
+
+#define MM_MPU401_MIDIOUT 10 /* MPU401-compatible MIDI output port */
+#define MM_MPU401_MIDIIN 11 /* MPU401-compatible MIDI input port */
+
+#define MM_PC_JOYSTICK 12 /* Joystick adapter */
+
+
+#ifndef MMNOMMSYSTEM
+/****************************************************************************
+
+ General MMSYSTEM support
+
+****************************************************************************/
+
+WORD WINAPI mmsystemGetVersion(void);
+void WINAPI OutputDebugStr(LPCSTR);
+
+#endif /* ifndef MMNOMMSYSTEM */
+
+
+#ifndef MMNOSOUND
+/****************************************************************************
+
+ Sound support
+
+****************************************************************************/
+
+BOOL WINAPI sndPlaySound(LPCSTR lpszSoundName, UINT uFlags);
+
+/* flag values for wFlags parameter */
+#define SND_SYNC 0x0000 /* play synchronously (default) */
+#define SND_ASYNC 0x0001 /* play asynchronously */
+#define SND_NODEFAULT 0x0002 /* don't use default sound */
+#define SND_MEMORY 0x0004 /* lpszSoundName points to a memory file */
+#define SND_LOOP 0x0008 /* loop the sound until next sndPlaySound */
+#define SND_NOSTOP 0x0010 /* don't stop any currently playing sound */
+#define SND_VALID 0x001F /* valid flags */ /* ;Internal */
+
+#endif /* ifndef MMNOSOUND */
+
+
+#ifndef MMNOWAVE
+/****************************************************************************
+
+ Waveform audio support
+
+****************************************************************************/
+
+/* waveform audio error return values */
+#define WAVERR_BADFORMAT (WAVERR_BASE + 0) /* unsupported wave format */
+#define WAVERR_STILLPLAYING (WAVERR_BASE + 1) /* still something playing */
+#define WAVERR_UNPREPARED (WAVERR_BASE + 2) /* header not prepared */
+#define WAVERR_SYNC (WAVERR_BASE + 3) /* device is synchronous */
+#define WAVERR_LASTERROR (WAVERR_BASE + 3) /* last error in range */
+
+/* waveform audio data types */
+DECLARE_HANDLE(HWAVE);
+DECLARE_HANDLE(HWAVEIN);
+DECLARE_HANDLE(HWAVEOUT);
+typedef HWAVEIN FAR *LPHWAVEIN;
+typedef HWAVEOUT FAR *LPHWAVEOUT;
+typedef DRVCALLBACK WAVECALLBACK;
+typedef WAVECALLBACK FAR *LPWAVECALLBACK;
+
+/* wave callback messages */
+#define WOM_OPEN MM_WOM_OPEN
+#define WOM_CLOSE MM_WOM_CLOSE
+#define WOM_DONE MM_WOM_DONE
+#define WIM_OPEN MM_WIM_OPEN
+#define WIM_CLOSE MM_WIM_CLOSE
+#define WIM_DATA MM_WIM_DATA
+
+/* device ID for wave device mapper */
+#define WAVE_MAPPER (-1)
+
+/* flags for dwFlags parameter in waveOutOpen() and waveInOpen() */
+#define WAVE_FORMAT_QUERY 0x0001
+#define WAVE_ALLOWSYNC 0x0002
+#define WAVE_VALID 0x0003 /* ;Internal */
+
+/* wave data block header */
+typedef struct wavehdr_tag {
+ LPSTR lpData; /* pointer to locked data buffer */
+ DWORD dwBufferLength; /* length of data buffer */
+ DWORD dwBytesRecorded; /* used for input only */
+ DWORD dwUser; /* for client's use */
+ DWORD dwFlags; /* assorted flags (see defines) */
+ DWORD dwLoops; /* loop control counter */
+ struct wavehdr_tag far *lpNext; /* reserved for driver */
+ DWORD reserved; /* reserved for driver */
+} WAVEHDR;
+typedef WAVEHDR *PWAVEHDR;
+typedef WAVEHDR NEAR *NPWAVEHDR;
+typedef WAVEHDR FAR *LPWAVEHDR;
+
+/* flags for dwFlags field of WAVEHDR */
+#define WHDR_DONE 0x00000001 /* done bit */
+#define WHDR_PREPARED 0x00000002 /* set if this header has been prepared */
+#define WHDR_BEGINLOOP 0x00000004 /* loop start block */
+#define WHDR_ENDLOOP 0x00000008 /* loop end block */
+#define WHDR_INQUEUE 0x00000010 /* reserved for driver */
+#define WHDR_VALID 0x0000001F /* valid flags */ /* ;Internal */
+
+/* waveform output device capabilities structure */
+typedef struct waveoutcaps_tag {
+ UINT wMid; /* manufacturer ID */
+ UINT wPid; /* product ID */
+ VERSION vDriverVersion; /* version of the driver */
+ char szPname[MAXPNAMELEN]; /* product name (NULL terminated string) */
+ DWORD dwFormats; /* formats supported */
+ UINT wChannels; /* number of sources supported */
+ DWORD dwSupport; /* functionality supported by driver */
+} WAVEOUTCAPS;
+typedef WAVEOUTCAPS *PWAVEOUTCAPS;
+typedef WAVEOUTCAPS NEAR *NPWAVEOUTCAPS;
+typedef WAVEOUTCAPS FAR *LPWAVEOUTCAPS;
+
+/* flags for dwSupport field of WAVEOUTCAPS */
+#define WAVECAPS_PITCH 0x0001 /* supports pitch control */
+#define WAVECAPS_PLAYBACKRATE 0x0002 /* supports playback rate control */
+#define WAVECAPS_VOLUME 0x0004 /* supports volume control */
+#define WAVECAPS_LRVOLUME 0x0008 /* separate left-right volume control */
+#define WAVECAPS_SYNC 0x0010
+
+/* waveform input device capabilities structure */
+typedef struct waveincaps_tag {
+ UINT wMid; /* manufacturer ID */
+ UINT wPid; /* product ID */
+ VERSION vDriverVersion; /* version of the driver */
+ char szPname[MAXPNAMELEN]; /* product name (NULL terminated string) */
+ DWORD dwFormats; /* formats supported */
+ UINT wChannels; /* number of channels supported */
+} WAVEINCAPS;
+typedef WAVEINCAPS *PWAVEINCAPS;
+typedef WAVEINCAPS NEAR *NPWAVEINCAPS;
+typedef WAVEINCAPS FAR *LPWAVEINCAPS;
+
+/* defines for dwFormat field of WAVEINCAPS and WAVEOUTCAPS */
+#define WAVE_INVALIDFORMAT 0x00000000 /* invalid format */
+#define WAVE_FORMAT_1M08 0x00000001 /* 11.025 kHz, Mono, 8-bit */
+#define WAVE_FORMAT_1S08 0x00000002 /* 11.025 kHz, Stereo, 8-bit */
+#define WAVE_FORMAT_1M16 0x00000004 /* 11.025 kHz, Mono, 16-bit */
+#define WAVE_FORMAT_1S16 0x00000008 /* 11.025 kHz, Stereo, 16-bit */
+#define WAVE_FORMAT_2M08 0x00000010 /* 22.05 kHz, Mono, 8-bit */
+#define WAVE_FORMAT_2S08 0x00000020 /* 22.05 kHz, Stereo, 8-bit */
+#define WAVE_FORMAT_2M16 0x00000040 /* 22.05 kHz, Mono, 16-bit */
+#define WAVE_FORMAT_2S16 0x00000080 /* 22.05 kHz, Stereo, 16-bit */
+#define WAVE_FORMAT_4M08 0x00000100 /* 44.1 kHz, Mono, 8-bit */
+#define WAVE_FORMAT_4S08 0x00000200 /* 44.1 kHz, Stereo, 8-bit */
+#define WAVE_FORMAT_4M16 0x00000400 /* 44.1 kHz, Mono, 16-bit */
+#define WAVE_FORMAT_4S16 0x00000800 /* 44.1 kHz, Stereo, 16-bit */
+
+/* general waveform format structure (information common to all formats) */
+typedef struct waveformat_tag {
+ WORD wFormatTag; /* format type */
+ WORD nChannels; /* number of channels (i.e. mono, stereo, etc.) */
+ DWORD nSamplesPerSec; /* sample rate */
+ DWORD nAvgBytesPerSec; /* for buffer estimation */
+ WORD nBlockAlign; /* block size of data */
+} WAVEFORMAT;
+typedef WAVEFORMAT *PWAVEFORMAT;
+typedef WAVEFORMAT NEAR *NPWAVEFORMAT;
+typedef WAVEFORMAT FAR *LPWAVEFORMAT;
+
+/* flags for wFormatTag field of WAVEFORMAT */
+#define WAVE_FORMAT_PCM 1
+
+/* specific waveform format structure for PCM data */
+typedef struct pcmwaveformat_tag {
+ WAVEFORMAT wf;
+ WORD wBitsPerSample;
+} PCMWAVEFORMAT;
+typedef PCMWAVEFORMAT *PPCMWAVEFORMAT;
+typedef PCMWAVEFORMAT NEAR *NPPCMWAVEFORMAT;
+typedef PCMWAVEFORMAT FAR *LPPCMWAVEFORMAT;
+
+/* waveform audio function prototypes */
+UINT WINAPI waveOutGetNumDevs(void);
+UINT WINAPI waveOutGetDevCaps(UINT uDeviceID, WAVEOUTCAPS FAR* lpCaps,
+ UINT uSize);
+UINT WINAPI waveOutGetVolume(UINT uDeviceID, DWORD FAR* lpdwVolume);
+UINT WINAPI waveOutSetVolume(UINT uDeviceID, DWORD dwVolume);
+UINT WINAPI waveOutGetErrorText(UINT uError, LPSTR lpText, UINT uSize);
+UINT WINAPI waveOutOpen(HWAVEOUT FAR* lphWaveOut, UINT uDeviceID,
+ const WAVEFORMAT FAR* lpFormat, DWORD dwCallback, DWORD dwInstance, DWORD dwFlags);
+UINT WINAPI waveOutClose(HWAVEOUT hWaveOut);
+UINT WINAPI waveOutPrepareHeader(HWAVEOUT hWaveOut,
+ WAVEHDR FAR* lpWaveOutHdr, UINT uSize);
+UINT WINAPI waveOutUnprepareHeader(HWAVEOUT hWaveOut,
+ WAVEHDR FAR* lpWaveOutHdr, UINT uSize);
+UINT WINAPI waveOutWrite(HWAVEOUT hWaveOut, WAVEHDR FAR* lpWaveOutHdr,
+ UINT uSize);
+UINT WINAPI waveOutPause(HWAVEOUT hWaveOut);
+UINT WINAPI waveOutRestart(HWAVEOUT hWaveOut);
+UINT WINAPI waveOutReset(HWAVEOUT hWaveOut);
+UINT WINAPI waveOutBreakLoop(HWAVEOUT hWaveOut);
+UINT WINAPI waveOutGetPosition(HWAVEOUT hWaveOut, MMTIME FAR* lpInfo,
+ UINT uSize);
+UINT WINAPI waveOutGetPitch(HWAVEOUT hWaveOut, DWORD FAR* lpdwPitch);
+UINT WINAPI waveOutSetPitch(HWAVEOUT hWaveOut, DWORD dwPitch);
+UINT WINAPI waveOutGetPlaybackRate(HWAVEOUT hWaveOut, DWORD FAR* lpdwRate);
+UINT WINAPI waveOutSetPlaybackRate(HWAVEOUT hWaveOut, DWORD dwRate);
+UINT WINAPI waveOutGetID(HWAVEOUT hWaveOut, UINT FAR* lpuDeviceID);
+
+#if (WINVER >= 0x030a)
+DWORD WINAPI waveOutMessage(HWAVEOUT hWaveOut, UINT uMessage, DWORD dw1, DWORD dw2);
+#endif /* ifdef WINVER >= 0x030a */
+
+UINT WINAPI waveInGetNumDevs(void);
+UINT WINAPI waveInGetDevCaps(UINT uDeviceID, WAVEINCAPS FAR* lpCaps,
+ UINT uSize);
+UINT WINAPI waveInGetErrorText(UINT uError, LPSTR lpText, UINT uSize);
+UINT WINAPI waveInOpen(HWAVEIN FAR* lphWaveIn, UINT uDeviceID,
+ const WAVEFORMAT FAR* lpFormat, DWORD dwCallback, DWORD dwInstance, DWORD dwFlags);
+UINT WINAPI waveInClose(HWAVEIN hWaveIn);
+UINT WINAPI waveInPrepareHeader(HWAVEIN hWaveIn,
+ WAVEHDR FAR* lpWaveInHdr, UINT uSize);
+UINT WINAPI waveInUnprepareHeader(HWAVEIN hWaveIn,
+ WAVEHDR FAR* lpWaveInHdr, UINT uSize);
+UINT WINAPI waveInAddBuffer(HWAVEIN hWaveIn,
+ WAVEHDR FAR* lpWaveInHdr, UINT uSize);
+UINT WINAPI waveInStart(HWAVEIN hWaveIn);
+UINT WINAPI waveInStop(HWAVEIN hWaveIn);
+UINT WINAPI waveInReset(HWAVEIN hWaveIn);
+UINT WINAPI waveInGetPosition(HWAVEIN hWaveIn, MMTIME FAR* lpInfo,
+ UINT uSize);
+UINT WINAPI waveInGetID(HWAVEIN hWaveIn, UINT FAR* lpuDeviceID);
+
+#if (WINVER >= 0x030a)
+DWORD WINAPI waveInMessage(HWAVEIN hWaveIn, UINT uMessage, DWORD dw1, DWORD dw2);
+#endif /* ifdef WINVER >= 0x030a */
+
+#endif /* ifndef MMNOWAVE */
+
+
+#ifndef MMNOMIDI
+/****************************************************************************
+
+ MIDI audio support
+
+****************************************************************************/
+
+/* MIDI error return values */
+#define MIDIERR_UNPREPARED (MIDIERR_BASE + 0) /* header not prepared */
+#define MIDIERR_STILLPLAYING (MIDIERR_BASE + 1) /* still something playing */
+#define MIDIERR_NOMAP (MIDIERR_BASE + 2) /* no current map */
+#define MIDIERR_NOTREADY (MIDIERR_BASE + 3) /* hardware is still busy */
+#define MIDIERR_NODEVICE (MIDIERR_BASE + 4) /* port no longer connected */
+#define MIDIERR_INVALIDSETUP (MIDIERR_BASE + 5) /* invalid setup */
+#define MIDIERR_LASTERROR (MIDIERR_BASE + 5) /* last error in range */
+
+/* MIDI audio data types */
+DECLARE_HANDLE(HMIDI);
+DECLARE_HANDLE(HMIDIIN);
+DECLARE_HANDLE(HMIDIOUT);
+typedef HMIDIIN FAR *LPHMIDIIN;
+typedef HMIDIOUT FAR *LPHMIDIOUT;
+typedef DRVCALLBACK MIDICALLBACK;
+typedef MIDICALLBACK FAR *LPMIDICALLBACK;
+#define MIDIPATCHSIZE 128
+typedef WORD PATCHARRAY[MIDIPATCHSIZE];
+typedef WORD FAR *LPPATCHARRAY;
+typedef WORD KEYARRAY[MIDIPATCHSIZE];
+typedef WORD FAR *LPKEYARRAY;
+
+/* MIDI callback messages */
+#define MIM_OPEN MM_MIM_OPEN
+#define MIM_CLOSE MM_MIM_CLOSE
+#define MIM_DATA MM_MIM_DATA
+#define MIM_LONGDATA MM_MIM_LONGDATA
+#define MIM_ERROR MM_MIM_ERROR
+#define MIM_LONGERROR MM_MIM_LONGERROR
+#define MOM_OPEN MM_MOM_OPEN
+#define MOM_CLOSE MM_MOM_CLOSE
+#define MOM_DONE MM_MOM_DONE
+
+/* device ID for MIDI mapper */
+#define MIDIMAPPER (-1)
+#define MIDI_MAPPER (-1)
+
+/* flags for wFlags parm of midiOutCachePatches(), midiOutCacheDrumPatches() */
+#define MIDI_CACHE_ALL 1
+#define MIDI_CACHE_BESTFIT 2
+#define MIDI_CACHE_QUERY 3
+#define MIDI_UNCACHE 4
+#define MIDI_CACHE_VALID (MIDI_CACHE_ALL | MIDI_CACHE_BESTFIT | MIDI_CACHE_QUERY | MIDI_UNCACHE) /* ;Internal */
+
+/* MIDI output device capabilities structure */
+typedef struct midioutcaps_tag {
+ UINT wMid; /* manufacturer ID */
+ UINT wPid; /* product ID */
+ VERSION vDriverVersion; /* version of the driver */
+ char szPname[MAXPNAMELEN]; /* product name (NULL terminated string) */
+ UINT wTechnology; /* type of device */
+ UINT wVoices; /* # of voices (internal synth only) */
+ UINT wNotes; /* max # of notes (internal synth only) */
+ UINT wChannelMask; /* channels used (internal synth only) */
+ DWORD dwSupport; /* functionality supported by driver */
+} MIDIOUTCAPS;
+typedef MIDIOUTCAPS *PMIDIOUTCAPS;
+typedef MIDIOUTCAPS NEAR *NPMIDIOUTCAPS;
+typedef MIDIOUTCAPS FAR *LPMIDIOUTCAPS;
+
+/* flags for wTechnology field of MIDIOUTCAPS structure */
+#define MOD_MIDIPORT 1 /* output port */
+#define MOD_SYNTH 2 /* generic internal synth */
+#define MOD_SQSYNTH 3 /* square wave internal synth */
+#define MOD_FMSYNTH 4 /* FM internal synth */
+#define MOD_MAPPER 5 /* MIDI mapper */
+
+/* flags for dwSupport field of MIDIOUTCAPS structure */
+#define MIDICAPS_VOLUME 0x0001 /* supports volume control */
+#define MIDICAPS_LRVOLUME 0x0002 /* separate left-right volume control */
+#define MIDICAPS_CACHE 0x0004
+
+/* MIDI output device capabilities structure */
+typedef struct midiincaps_tag {
+ UINT wMid; /* manufacturer ID */
+ UINT wPid; /* product ID */
+ VERSION vDriverVersion; /* version of the driver */
+ char szPname[MAXPNAMELEN]; /* product name (NULL terminated string) */
+} MIDIINCAPS;
+typedef MIDIINCAPS *PMIDIINCAPS;
+typedef MIDIINCAPS NEAR *NPMIDIINCAPS;
+typedef MIDIINCAPS FAR *LPMIDIINCAPS;
+
+/* MIDI data block header */
+typedef struct midihdr_tag {
+ LPSTR lpData; /* pointer to locked data block */
+ DWORD dwBufferLength; /* length of data in data block */
+ DWORD dwBytesRecorded; /* used for input only */
+ DWORD dwUser; /* for client's use */
+ DWORD dwFlags; /* assorted flags (see defines) */
+ struct midihdr_tag far *lpNext; /* reserved for driver */
+ DWORD reserved; /* reserved for driver */
+} MIDIHDR;
+typedef MIDIHDR *PMIDIHDR;
+typedef MIDIHDR NEAR *NPMIDIHDR;
+typedef MIDIHDR FAR *LPMIDIHDR;
+
+/* flags for dwFlags field of MIDIHDR structure */
+#define MHDR_DONE 0x00000001 /* done bit */
+#define MHDR_PREPARED 0x00000002 /* set if header prepared */
+#define MHDR_INQUEUE 0x00000004 /* reserved for driver */
+#define MHDR_VALID 0x00000007 /* valid flags */ /* ;Internal */
+
+/* MIDI function prototypes */
+UINT WINAPI midiOutGetNumDevs(void);
+UINT WINAPI midiOutGetDevCaps(UINT uDeviceID,
+ MIDIOUTCAPS FAR* lpCaps, UINT uSize);
+UINT WINAPI midiOutGetVolume(UINT uDeviceID, DWORD FAR* lpdwVolume);
+UINT WINAPI midiOutSetVolume(UINT uDeviceID, DWORD dwVolume);
+UINT WINAPI midiOutGetErrorText(UINT uError, LPSTR lpText, UINT uSize);
+UINT WINAPI midiOutOpen(HMIDIOUT FAR* lphMidiOut, UINT uDeviceID,
+ DWORD dwCallback, DWORD dwInstance, DWORD dwFlags);
+UINT WINAPI midiOutClose(HMIDIOUT hMidiOut);
+UINT WINAPI midiOutPrepareHeader(HMIDIOUT hMidiOut,
+ MIDIHDR FAR* lpMidiOutHdr, UINT uSize);
+UINT WINAPI midiOutUnprepareHeader(HMIDIOUT hMidiOut,
+ MIDIHDR FAR* lpMidiOutHdr, UINT uSize);
+UINT WINAPI midiOutShortMsg(HMIDIOUT hMidiOut, DWORD dwMsg);
+UINT WINAPI midiOutLongMsg(HMIDIOUT hMidiOut,
+ MIDIHDR FAR* lpMidiOutHdr, UINT uSize);
+UINT WINAPI midiOutReset(HMIDIOUT hMidiOut);
+UINT WINAPI midiOutCachePatches(HMIDIOUT hMidiOut,
+ UINT uBank, WORD FAR* lpwPatchArray, UINT uFlags);
+UINT WINAPI midiOutCacheDrumPatches(HMIDIOUT hMidiOut,
+ UINT uPatch, WORD FAR* lpwKeyArray, UINT uFlags);
+UINT WINAPI midiOutGetID(HMIDIOUT hMidiOut, UINT FAR* lpuDeviceID);
+
+#if (WINVER >= 0x030a)
+DWORD WINAPI midiOutMessage(HMIDIOUT hMidiOut, UINT uMessage, DWORD dw1, DWORD dw2);
+#endif /* ifdef WINVER >= 0x030a */
+
+UINT WINAPI midiInGetNumDevs(void);
+UINT WINAPI midiInGetDevCaps(UINT uDeviceID,
+ LPMIDIINCAPS lpCaps, UINT uSize);
+UINT WINAPI midiInGetErrorText(UINT uError, LPSTR lpText, UINT uSize);
+UINT WINAPI midiInOpen(HMIDIIN FAR* lphMidiIn, UINT uDeviceID,
+ DWORD dwCallback, DWORD dwInstance, DWORD dwFlags);
+UINT WINAPI midiInClose(HMIDIIN hMidiIn);
+UINT WINAPI midiInPrepareHeader(HMIDIIN hMidiIn,
+ MIDIHDR FAR* lpMidiInHdr, UINT uSize);
+UINT WINAPI midiInUnprepareHeader(HMIDIIN hMidiIn,
+ MIDIHDR FAR* lpMidiInHdr, UINT uSize);
+UINT WINAPI midiInAddBuffer(HMIDIIN hMidiIn,
+ MIDIHDR FAR* lpMidiInHdr, UINT uSize);
+UINT WINAPI midiInStart(HMIDIIN hMidiIn);
+UINT WINAPI midiInStop(HMIDIIN hMidiIn);
+UINT WINAPI midiInReset(HMIDIIN hMidiIn);
+UINT WINAPI midiInGetID(HMIDIIN hMidiIn, UINT FAR* lpuDeviceID);
+
+#if (WINVER >= 0x030a)
+DWORD WINAPI midiInMessage(HMIDIIN hMidiIn, UINT uMessage, DWORD dw1, DWORD dw2);
+#endif /* ifdef WINVER >= 0x030a */
+
+#endif /* ifndef MMNOMIDI */
+
+
+#ifndef MMNOAUX
+/****************************************************************************
+
+ Auxiliary audio support
+
+****************************************************************************/
+
+/* device ID for aux device mapper */
+#define AUX_MAPPER (-1)
+
+/* Auxiliary audio device capabilities structure */
+typedef struct auxcaps_tag {
+ UINT wMid; /* manufacturer ID */
+ UINT wPid; /* product ID */
+ VERSION vDriverVersion; /* version of the driver */
+ char szPname[MAXPNAMELEN]; /* product name (NULL terminated string) */
+ UINT wTechnology; /* type of device */
+ DWORD dwSupport; /* functionality supported by driver */
+} AUXCAPS;
+typedef AUXCAPS *PAUXCAPS;
+typedef AUXCAPS NEAR *NPAUXCAPS;
+typedef AUXCAPS FAR *LPAUXCAPS;
+
+/* flags for wTechnology field in AUXCAPS structure */
+#define AUXCAPS_CDAUDIO 1 /* audio from internal CD-ROM drive */
+#define AUXCAPS_AUXIN 2 /* audio from auxiliary input jacks */
+
+/* flags for dwSupport field in AUXCAPS structure */
+#define AUXCAPS_VOLUME 0x0001 /* supports volume control */
+#define AUXCAPS_LRVOLUME 0x0002 /* separate left-right volume control */
+
+/* auxiliary audio function prototypes */
+UINT WINAPI auxGetNumDevs(void);
+UINT WINAPI auxGetDevCaps(UINT uDeviceID, AUXCAPS FAR* lpCaps, UINT uSize);
+UINT WINAPI auxSetVolume(UINT uDeviceID, DWORD dwVolume);
+UINT WINAPI auxGetVolume(UINT uDeviceID, DWORD FAR* lpdwVolume);
+
+#if (WINVER >= 0x030a)
+DWORD WINAPI auxOutMessage(UINT uDeviceID, UINT uMessage, DWORD dw1, DWORD dw2);
+#endif /* ifdef WINVER >= 0x030a */
+
+#endif /* ifndef MMNOAUX */
+
+
+#ifndef MMNOTIMER
+/****************************************************************************
+
+ Timer support
+
+****************************************************************************/
+
+/* timer error return values */
+#define TIMERR_NOERROR (0) /* no error */
+#define TIMERR_NOCANDO (TIMERR_BASE+1) /* request not completed */
+#define TIMERR_STRUCT (TIMERR_BASE+33) /* time struct size */
+
+/* timer data types */
+#ifdef BUILDDLL /* ;Internal */
+typedef void (FAR PASCAL TIMECALLBACK) (UINT uTimerID, UINT uMessage, DWORD dwUser, DWORD dw1, DWORD dw2); /* ;Internal */
+#else /* ifdef BUILDDLL */ /* ;Internal */
+typedef void (CALLBACK TIMECALLBACK) (UINT uTimerID, UINT uMessage, DWORD dwUser, DWORD dw1, DWORD dw2);
+#endif /* ifdef BUILDDLL */ /* ;Internal */
+
+typedef TIMECALLBACK FAR *LPTIMECALLBACK;
+
+/* flags for wFlags parameter of timeSetEvent() function */
+#define TIME_ONESHOT 0 /* program timer for single event */
+#define TIME_PERIODIC 1 /* program for continuous periodic event */
+
+/* timer device capabilities data structure */
+typedef struct timecaps_tag {
+ UINT wPeriodMin; /* minimum period supported */
+ UINT wPeriodMax; /* maximum period supported */
+ } TIMECAPS;
+typedef TIMECAPS *PTIMECAPS;
+typedef TIMECAPS NEAR *NPTIMECAPS;
+typedef TIMECAPS FAR *LPTIMECAPS;
+
+/* timer function prototypes */
+UINT WINAPI timeGetSystemTime(MMTIME FAR* lpTime, UINT uSize);
+DWORD WINAPI timeGetTime(void);
+UINT WINAPI timeSetEvent(UINT uDelay, UINT uResolution,
+ LPTIMECALLBACK lpFunction, DWORD dwUser, UINT uFlags);
+UINT WINAPI timeKillEvent(UINT uTimerID);
+UINT WINAPI timeGetDevCaps(TIMECAPS FAR* lpTimeCaps, UINT uSize);
+UINT WINAPI timeBeginPeriod(UINT uPeriod);
+UINT WINAPI timeEndPeriod(UINT uPeriod);
+
+#endif /* ifndef MMNOTIMER */
+
+
+#ifndef MMNOJOY
+/****************************************************************************
+
+ Joystick support
+
+****************************************************************************/
+
+/* joystick error return values */
+#define JOYERR_NOERROR (0) /* no error */
+#define JOYERR_PARMS (JOYERR_BASE+5) /* bad parameters */
+#define JOYERR_NOCANDO (JOYERR_BASE+6) /* request not completed */
+#define JOYERR_UNPLUGGED (JOYERR_BASE+7) /* joystick is unplugged */
+
+/* constants used with JOYINFO structure and MM_JOY* messages */
+#define JOY_BUTTON1 0x0001
+#define JOY_BUTTON2 0x0002
+#define JOY_BUTTON3 0x0004
+#define JOY_BUTTON4 0x0008
+#define JOY_BUTTON1CHG 0x0100
+#define JOY_BUTTON2CHG 0x0200
+#define JOY_BUTTON3CHG 0x0400
+#define JOY_BUTTON4CHG 0x0800
+
+/* joystick ID constants */
+#define JOYSTICKID1 0
+#define JOYSTICKID2 1
+
+/* joystick device capabilities data structure */
+typedef struct joycaps_tag {
+ UINT wMid; /* manufacturer ID */
+ UINT wPid; /* product ID */
+ char szPname[MAXPNAMELEN]; /* product name (NULL terminated string) */
+ UINT wXmin; /* minimum x position value */
+ UINT wXmax; /* maximum x position value */
+ UINT wYmin; /* minimum y position value */
+ UINT wYmax; /* maximum y position value */
+ UINT wZmin; /* minimum z position value */
+ UINT wZmax; /* maximum z position value */
+ UINT wNumButtons; /* number of buttons */
+ UINT wPeriodMin; /* minimum message period when captured */
+ UINT wPeriodMax; /* maximum message period when captured */
+ } JOYCAPS;
+typedef JOYCAPS *PJOYCAPS;
+typedef JOYCAPS NEAR *NPJOYCAPS;
+typedef JOYCAPS FAR *LPJOYCAPS;
+
+/* joystick information data structure */
+typedef struct joyinfo_tag {
+ UINT wXpos; /* x position */
+ UINT wYpos; /* y position */
+ UINT wZpos; /* z position */
+ UINT wButtons; /* button states */
+ } JOYINFO;
+typedef JOYINFO *PJOYINFO;
+typedef JOYINFO NEAR *NPJOYINFO;
+typedef JOYINFO FAR *LPJOYINFO;
+
+/* joystick function prototypes */
+UINT WINAPI joyGetDevCaps(UINT uJoyID, JOYCAPS FAR* lpCaps, UINT uSize);
+UINT WINAPI joyGetNumDevs(void);
+UINT WINAPI joyGetPos(UINT uJoyID, JOYINFO FAR* lpInfo);
+UINT WINAPI joyGetThreshold(UINT uJoyID, UINT FAR* lpuThreshold);
+UINT WINAPI joyReleaseCapture(UINT uJoyID);
+UINT WINAPI joySetCapture(HWND hwnd, UINT uJoyID, UINT uPeriod,
+ BOOL bChanged);
+UINT WINAPI joySetThreshold(UINT uJoyID, UINT uThreshold);
+UINT WINAPI joySetCalibration(UINT uJoyID, UINT FAR* puXbase, /* ;Internal */
+ UINT FAR* puXdelta, UINT FAR* puYbase, UINT FAR* puYdelta,/* ;Internal */
+ UINT FAR* puZbase, UINT FAR* puZdelta); /* ;Internal */
+
+#endif /* ifndef MMNOJOY */
+
+
+#ifndef MMNOMMIO
+/****************************************************************************
+
+ Multimedia File I/O support
+
+****************************************************************************/
+
+/* MMIO error return values */
+#define MMIOERR_BASE 256
+#define MMIOERR_FILENOTFOUND (MMIOERR_BASE + 1) /* file not found */
+#define MMIOERR_OUTOFMEMORY (MMIOERR_BASE + 2) /* out of memory */
+#define MMIOERR_CANNOTOPEN (MMIOERR_BASE + 3) /* cannot open */
+#define MMIOERR_CANNOTCLOSE (MMIOERR_BASE + 4) /* cannot close */
+#define MMIOERR_CANNOTREAD (MMIOERR_BASE + 5) /* cannot read */
+#define MMIOERR_CANNOTWRITE (MMIOERR_BASE + 6) /* cannot write */
+#define MMIOERR_CANNOTSEEK (MMIOERR_BASE + 7) /* cannot seek */
+#define MMIOERR_CANNOTEXPAND (MMIOERR_BASE + 8) /* cannot expand file */
+#define MMIOERR_CHUNKNOTFOUND (MMIOERR_BASE + 9) /* chunk not found */
+#define MMIOERR_UNBUFFERED (MMIOERR_BASE + 10) /* file is unbuffered */
+
+/* MMIO constants */
+#define CFSEPCHAR '+' /* compound file name separator char. */
+
+/* MMIO data types */
+typedef DWORD FOURCC; /* a four character code */
+typedef char _huge * HPSTR; /* a huge version of LPSTR */
+DECLARE_HANDLE(HMMIO); /* a handle to an open file */
+typedef LRESULT (CALLBACK MMIOPROC)(LPSTR lpmmioinfo, UINT uMessage,
+ LPARAM lParam1, LPARAM lParam2);
+typedef MMIOPROC FAR *LPMMIOPROC;
+
+/* general MMIO information data structure */
+typedef struct _MMIOINFO
+{
+ /* general fields */
+ DWORD dwFlags; /* general status flags */
+ FOURCC fccIOProc; /* pointer to I/O procedure */
+ LPMMIOPROC pIOProc; /* pointer to I/O procedure */
+ UINT wErrorRet; /* place for error to be returned */
+ HTASK htask; /* alternate local task */
+
+ /* fields maintained by MMIO functions during buffered I/O */
+ LONG cchBuffer; /* size of I/O buffer (or 0L) */
+ HPSTR pchBuffer; /* start of I/O buffer (or NULL) */
+ HPSTR pchNext; /* pointer to next byte to read/write */
+ HPSTR pchEndRead; /* pointer to last valid byte to read */
+ HPSTR pchEndWrite; /* pointer to last byte to write */
+ LONG lBufOffset; /* disk offset of start of buffer */
+
+ /* fields maintained by I/O procedure */
+ LONG lDiskOffset; /* disk offset of next read or write */
+ DWORD adwInfo[3]; /* data specific to type of MMIOPROC */
+
+ /* other fields maintained by MMIO */
+ DWORD dwReserved1; /* reserved for MMIO use */
+ DWORD dwReserved2; /* reserved for MMIO use */
+ HMMIO hmmio; /* handle to open file */
+} MMIOINFO;
+typedef MMIOINFO *PMMIOINFO;
+typedef MMIOINFO NEAR *NPMMIOINFO;
+typedef MMIOINFO FAR *LPMMIOINFO;
+
+/* RIFF chunk information data structure */
+typedef struct _MMCKINFO
+{
+ FOURCC ckid; /* chunk ID */
+ DWORD cksize; /* chunk size */
+ FOURCC fccType; /* form type or list type */
+ DWORD dwDataOffset; /* offset of data portion of chunk */
+ DWORD dwFlags; /* flags used by MMIO functions */
+} MMCKINFO;
+typedef MMCKINFO *PMMCKINFO;
+typedef MMCKINFO NEAR *NPMMCKINFO;
+typedef MMCKINFO FAR *LPMMCKINFO;
+
+/* bit field masks */
+#define MMIO_RWMODE 0x00000003 /* open file for reading/writing/both */
+#define MMIO_SHAREMODE 0x00000070 /* file sharing mode number */
+
+/* constants for dwFlags field of MMIOINFO */
+#define MMIO_CREATE 0x00001000 /* create new file (or truncate file) */
+#define MMIO_PARSE 0x00000100 /* parse new file returning path */
+#define MMIO_DELETE 0x00000200 /* create new file (or truncate file) */
+#define MMIO_EXIST 0x00004000 /* checks for existence of file */
+#define MMIO_ALLOCBUF 0x00010000 /* mmioOpen() should allocate a buffer */
+#define MMIO_GETTEMP 0x00020000 /* mmioOpen() should retrieve temp name */
+
+#define MMIO_DIRTY 0x10000000 /* I/O buffer is dirty */
+
+#define MMIO_OPEN_VALID 0x0003FFFF /* valid flags for mmioOpen */ /* ;Internal */
+#define MMIO_FLUSH_VALID MMIO_EMPTYBUF /* valid flags for mmioFlush */ /* ;Internal */
+#define MMIO_ADVANCE_VALID (MMIO_WRITE | MMIO_READ) /* valid flags for mmioAdvance */ /* ;Internal */
+#define MMIO_FOURCC_VALID MMIO_TOUPPER /* valid flags for mmioStringToFOURCC */ /* ;Internal */
+#define MMIO_DESCEND_VALID (MMIO_FINDCHUNK | MMIO_FINDRIFF | MMIO_FINDLIST) /* ;Internal */
+#define MMIO_CREATE_VALID (MMIO_CREATERIFF | MMIO_CREATELIST) /* ;Internal */
+
+/* read/write mode numbers (bit field MMIO_RWMODE) */
+#define MMIO_READ 0x00000000 /* open file for reading only */
+#define MMIO_WRITE 0x00000001 /* open file for writing only */
+#define MMIO_READWRITE 0x00000002 /* open file for reading and writing */
+
+/* share mode numbers (bit field MMIO_SHAREMODE) */
+#define MMIO_COMPAT 0x00000000 /* compatibility mode */
+#define MMIO_EXCLUSIVE 0x00000010 /* exclusive-access mode */
+#define MMIO_DENYWRITE 0x00000020 /* deny writing to other processes */
+#define MMIO_DENYREAD 0x00000030 /* deny reading to other processes */
+#define MMIO_DENYNONE 0x00000040 /* deny nothing to other processes */
+
+/* various MMIO flags */
+#define MMIO_FHOPEN 0x0010 /* mmioClose: keep file handle open */
+#define MMIO_EMPTYBUF 0x0010 /* mmioFlush: empty the I/O buffer */
+#define MMIO_TOUPPER 0x0010 /* mmioStringToFOURCC: to u-case */
+#define MMIO_INSTALLPROC 0x00010000 /* mmioInstallIOProc: install MMIOProc */
+#define MMIO_GLOBALPROC 0x10000000 /* mmioInstallIOProc: install globally */
+#define MMIO_REMOVEPROC 0x00020000 /* mmioInstallIOProc: remove MMIOProc */
+#define MMIO_FINDPROC 0x00040000 /* mmioInstallIOProc: find an MMIOProc */
+#define MMIO_FINDCHUNK 0x0010 /* mmioDescend: find a chunk by ID */
+#define MMIO_FINDRIFF 0x0020 /* mmioDescend: find a LIST chunk */
+#define MMIO_FINDLIST 0x0040 /* mmioDescend: find a RIFF chunk */
+#define MMIO_CREATERIFF 0x0020 /* mmioCreateChunk: make a LIST chunk */
+#define MMIO_CREATELIST 0x0040 /* mmioCreateChunk: make a RIFF chunk */
+
+#define MMIO_VALIDPROC 0x10070000 /* valid for mmioInstallIOProc */ /* ;Internal */
+
+/* message numbers for MMIOPROC I/O procedure functions */
+#define MMIOM_READ MMIO_READ /* read */
+#define MMIOM_WRITE MMIO_WRITE /* write */
+#define MMIOM_SEEK 2 /* seek to a new position in file */
+#define MMIOM_OPEN 3 /* open file */
+#define MMIOM_CLOSE 4 /* close file */
+#define MMIOM_WRITEFLUSH 5 /* write and flush */
+
+#if (WINVER >= 0x030a)
+#define MMIOM_RENAME 6 /* rename specified file */
+#endif /* ifdef WINVER >= 0x030a */
+
+#define MMIOM_USER 0x8000 /* beginning of user-defined messages */
+
+/* standard four character codes */
+#define FOURCC_RIFF mmioFOURCC('R', 'I', 'F', 'F')
+#define FOURCC_LIST mmioFOURCC('L', 'I', 'S', 'T')
+
+/* four character codes used to identify standard built-in I/O procedures */
+#define FOURCC_DOS mmioFOURCC('D', 'O', 'S', ' ')
+#define FOURCC_MEM mmioFOURCC('M', 'E', 'M', ' ')
+
+/* flags for mmioSeek() */
+#ifndef SEEK_SET
+#define SEEK_SET 0 /* seek to an absolute position */
+#define SEEK_CUR 1 /* seek relative to current position */
+#define SEEK_END 2 /* seek relative to end of file */
+#endif /* ifndef SEEK_SET */
+
+/* other constants */
+#define MMIO_DEFAULTBUFFER 8192 /* default buffer size */
+
+/* MMIO macros */
+#define mmioFOURCC( ch0, ch1, ch2, ch3 ) \
+ ( (DWORD)(BYTE)(ch0) | ( (DWORD)(BYTE)(ch1) << 8 ) | \
+ ( (DWORD)(BYTE)(ch2) << 16 ) | ( (DWORD)(BYTE)(ch3) << 24 ) )
+
+/* MMIO function prototypes */
+FOURCC WINAPI mmioStringToFOURCC(LPCSTR sz, UINT uFlags);
+LPMMIOPROC WINAPI mmioInstallIOProc(FOURCC fccIOProc, LPMMIOPROC pIOProc,
+ DWORD dwFlags);
+HMMIO WINAPI mmioOpen(LPSTR szFileName, MMIOINFO FAR* lpmmioinfo,
+ DWORD dwOpenFlags);
+
+#if (WINVER >= 0x030a)
+UINT WINAPI mmioRename(LPCSTR szFileName, LPCSTR szNewFileName,
+ MMIOINFO FAR* lpmmioinfo, DWORD dwRenameFlags);
+#endif /* ifdef WINVER >= 0x030a */
+
+UINT WINAPI mmioClose(HMMIO hmmio, UINT uFlags);
+LONG WINAPI mmioRead(HMMIO hmmio, HPSTR pch, LONG cch);
+LONG WINAPI mmioWrite(HMMIO hmmio, const char _huge* pch, LONG cch);
+LONG WINAPI mmioSeek(HMMIO hmmio, LONG lOffset, int iOrigin);
+UINT WINAPI mmioGetInfo(HMMIO hmmio, MMIOINFO FAR* lpmmioinfo, UINT uFlags);
+UINT WINAPI mmioSetInfo(HMMIO hmmio, const MMIOINFO FAR* lpmmioinfo, UINT uFlags);
+UINT WINAPI mmioSetBuffer(HMMIO hmmio, LPSTR pchBuffer, LONG cchBuffer,
+ UINT uFlags);
+UINT WINAPI mmioFlush(HMMIO hmmio, UINT uFlags);
+UINT WINAPI mmioAdvance(HMMIO hmmio, MMIOINFO FAR* lpmmioinfo, UINT uFlags);
+LRESULT WINAPI mmioSendMessage(HMMIO hmmio, UINT uMessage,
+ LPARAM lParam1, LPARAM lParam2);
+UINT WINAPI mmioDescend(HMMIO hmmio, MMCKINFO FAR* lpck,
+ const MMCKINFO FAR* lpckParent, UINT uFlags);
+UINT WINAPI mmioAscend(HMMIO hmmio, MMCKINFO FAR* lpck, UINT uFlags);
+UINT WINAPI mmioCreateChunk(HMMIO hmmio, MMCKINFO FAR* lpck, UINT uFlags);
+
+#endif /* ifndef MMNOMMIO */
+
+
+#ifndef MMNOMCI
+/****************************************************************************
+
+ MCI support
+
+****************************************************************************/
+
+typedef UINT (CALLBACK *YIELDPROC) (UINT uDeviceID, DWORD dwYieldData);
+
+/* MCI function prototypes */
+DWORD WINAPI mciSendCommand (UINT uDeviceID, UINT uMessage,
+ DWORD dwParam1, DWORD dwParam2);
+DWORD WINAPI mciSendString (LPCSTR lpstrCommand,
+ LPSTR lpstrReturnString, UINT uReturnLength, HWND hwndCallback);
+UINT WINAPI mciGetDeviceID (LPCSTR lpstrName);
+UINT WINAPI mciGetDeviceIDFromElementID (DWORD dwElementID,
+ LPCSTR lpstrType);
+BOOL WINAPI mciGetErrorString (DWORD wError, LPSTR lpstrBuffer,
+ UINT uLength);
+BOOL WINAPI mciSetYieldProc (UINT uDeviceID, YIELDPROC fpYieldProc,
+ DWORD dwYieldData);
+
+#if (WINVER >= 0x030a)
+HTASK WINAPI mciGetCreatorTask(UINT uDeviceID);
+YIELDPROC WINAPI mciGetYieldProc (UINT uDeviceID, DWORD FAR* lpdwYieldData);
+#endif /* ifdef WINVER >= 0x030a */
+
+#if (WINVER < 0x030a)
+BOOL WINAPI mciExecute (LPCSTR lpstrCommand);
+#endif /* ifdef WINVER < 0x030a */
+
+/* MCI error return values */
+#define MCIERR_INVALID_DEVICE_ID (MCIERR_BASE + 1)
+#define MCIERR_UNRECOGNIZED_KEYWORD (MCIERR_BASE + 3)
+#define MCIERR_UNRECOGNIZED_COMMAND (MCIERR_BASE + 5)
+#define MCIERR_HARDWARE (MCIERR_BASE + 6)
+#define MCIERR_INVALID_DEVICE_NAME (MCIERR_BASE + 7)
+#define MCIERR_OUT_OF_MEMORY (MCIERR_BASE + 8)
+#define MCIERR_DEVICE_OPEN (MCIERR_BASE + 9)
+#define MCIERR_CANNOT_LOAD_DRIVER (MCIERR_BASE + 10)
+#define MCIERR_MISSING_COMMAND_STRING (MCIERR_BASE + 11)
+#define MCIERR_PARAM_OVERFLOW (MCIERR_BASE + 12)
+#define MCIERR_MISSING_STRING_ARGUMENT (MCIERR_BASE + 13)
+#define MCIERR_BAD_INTEGER (MCIERR_BASE + 14)
+#define MCIERR_PARSER_INTERNAL (MCIERR_BASE + 15)
+#define MCIERR_DRIVER_INTERNAL (MCIERR_BASE + 16)
+#define MCIERR_MISSING_PARAMETER (MCIERR_BASE + 17)
+#define MCIERR_UNSUPPORTED_FUNCTION (MCIERR_BASE + 18)
+#define MCIERR_FILE_NOT_FOUND (MCIERR_BASE + 19)
+#define MCIERR_DEVICE_NOT_READY (MCIERR_BASE + 20)
+#define MCIERR_INTERNAL (MCIERR_BASE + 21)
+#define MCIERR_DRIVER (MCIERR_BASE + 22)
+#define MCIERR_CANNOT_USE_ALL (MCIERR_BASE + 23)
+#define MCIERR_MULTIPLE (MCIERR_BASE + 24)
+#define MCIERR_EXTENSION_NOT_FOUND (MCIERR_BASE + 25)
+#define MCIERR_OUTOFRANGE (MCIERR_BASE + 26)
+#define MCIERR_FLAGS_NOT_COMPATIBLE (MCIERR_BASE + 28)
+#define MCIERR_FILE_NOT_SAVED (MCIERR_BASE + 30)
+#define MCIERR_DEVICE_TYPE_REQUIRED (MCIERR_BASE + 31)
+#define MCIERR_DEVICE_LOCKED (MCIERR_BASE + 32)
+#define MCIERR_DUPLICATE_ALIAS (MCIERR_BASE + 33)
+#define MCIERR_BAD_CONSTANT (MCIERR_BASE + 34)
+#define MCIERR_MUST_USE_SHAREABLE (MCIERR_BASE + 35)
+#define MCIERR_MISSING_DEVICE_NAME (MCIERR_BASE + 36)
+#define MCIERR_BAD_TIME_FORMAT (MCIERR_BASE + 37)
+#define MCIERR_NO_CLOSING_QUOTE (MCIERR_BASE + 38)
+#define MCIERR_DUPLICATE_FLAGS (MCIERR_BASE + 39)
+#define MCIERR_INVALID_FILE (MCIERR_BASE + 40)
+#define MCIERR_NULL_PARAMETER_BLOCK (MCIERR_BASE + 41)
+#define MCIERR_UNNAMED_RESOURCE (MCIERR_BASE + 42)
+#define MCIERR_NEW_REQUIRES_ALIAS (MCIERR_BASE + 43)
+#define MCIERR_NOTIFY_ON_AUTO_OPEN (MCIERR_BASE + 44)
+#define MCIERR_NO_ELEMENT_ALLOWED (MCIERR_BASE + 45)
+#define MCIERR_NONAPPLICABLE_FUNCTION (MCIERR_BASE + 46)
+#define MCIERR_ILLEGAL_FOR_AUTO_OPEN (MCIERR_BASE + 47)
+#define MCIERR_FILENAME_REQUIRED (MCIERR_BASE + 48)
+#define MCIERR_EXTRA_CHARACTERS (MCIERR_BASE + 49)
+#define MCIERR_DEVICE_NOT_INSTALLED (MCIERR_BASE + 50)
+#define MCIERR_GET_CD (MCIERR_BASE + 51)
+#define MCIERR_SET_CD (MCIERR_BASE + 52)
+#define MCIERR_SET_DRIVE (MCIERR_BASE + 53)
+#define MCIERR_DEVICE_LENGTH (MCIERR_BASE + 54)
+#define MCIERR_DEVICE_ORD_LENGTH (MCIERR_BASE + 55)
+#define MCIERR_NO_INTEGER (MCIERR_BASE + 56)
+
+#define MCIERR_WAVE_OUTPUTSINUSE (MCIERR_BASE + 64)
+#define MCIERR_WAVE_SETOUTPUTINUSE (MCIERR_BASE + 65)
+#define MCIERR_WAVE_INPUTSINUSE (MCIERR_BASE + 66)
+#define MCIERR_WAVE_SETINPUTINUSE (MCIERR_BASE + 67)
+#define MCIERR_WAVE_OUTPUTUNSPECIFIED (MCIERR_BASE + 68)
+#define MCIERR_WAVE_INPUTUNSPECIFIED (MCIERR_BASE + 69)
+#define MCIERR_WAVE_OUTPUTSUNSUITABLE (MCIERR_BASE + 70)
+#define MCIERR_WAVE_SETOUTPUTUNSUITABLE (MCIERR_BASE + 71)
+#define MCIERR_WAVE_INPUTSUNSUITABLE (MCIERR_BASE + 72)
+#define MCIERR_WAVE_SETINPUTUNSUITABLE (MCIERR_BASE + 73)
+
+#define MCIERR_SEQ_DIV_INCOMPATIBLE (MCIERR_BASE + 80)
+#define MCIERR_SEQ_PORT_INUSE (MCIERR_BASE + 81)
+#define MCIERR_SEQ_PORT_NONEXISTENT (MCIERR_BASE + 82)
+#define MCIERR_SEQ_PORT_MAPNODEVICE (MCIERR_BASE + 83)
+#define MCIERR_SEQ_PORT_MISCERROR (MCIERR_BASE + 84)
+#define MCIERR_SEQ_TIMER (MCIERR_BASE + 85)
+#define MCIERR_SEQ_PORTUNSPECIFIED (MCIERR_BASE + 86)
+#define MCIERR_SEQ_NOMIDIPRESENT (MCIERR_BASE + 87)
+
+#define MCIERR_NO_WINDOW (MCIERR_BASE + 90)
+#define MCIERR_CREATEWINDOW (MCIERR_BASE + 91)
+#define MCIERR_FILE_READ (MCIERR_BASE + 92)
+#define MCIERR_FILE_WRITE (MCIERR_BASE + 93)
+
+/* all custom device driver errors must be >= than this value */
+#define MCIERR_CUSTOM_DRIVER_BASE (MCIERR_BASE + 256)
+
+/* MCI command message identifiers */
+#define MCI_OPEN 0x0803
+#define MCI_CLOSE 0x0804
+#define MCI_ESCAPE 0x0805
+#define MCI_PLAY 0x0806
+#define MCI_SEEK 0x0807
+#define MCI_STOP 0x0808
+#define MCI_PAUSE 0x0809
+#define MCI_INFO 0x080A
+#define MCI_GETDEVCAPS 0x080B
+#define MCI_SPIN 0x080C
+#define MCI_SET 0x080D
+#define MCI_STEP 0x080E
+#define MCI_RECORD 0x080F
+#define MCI_SYSINFO 0x0810
+#define MCI_BREAK 0x0811
+#define MCI_SOUND 0x0812
+#define MCI_SAVE 0x0813
+#define MCI_STATUS 0x0814
+#define MCI_CUE 0x0830
+#define MCI_REALIZE 0x0840
+#define MCI_WINDOW 0x0841
+#define MCI_PUT 0x0842
+#define MCI_WHERE 0x0843
+#define MCI_FREEZE 0x0844
+#define MCI_UNFREEZE 0x0845
+#define MCI_LOAD 0x0850
+#define MCI_CUT 0x0851
+#define MCI_COPY 0x0852
+#define MCI_PASTE 0x0853
+#define MCI_UPDATE 0x0854
+#define MCI_RESUME 0x0855
+#define MCI_DELETE 0x0856
+
+/* all custom MCI command messages must be >= than this value */
+#define MCI_USER_MESSAGES (0x400 + DRV_MCI_FIRST)
+
+
+/* device ID for "all devices" */
+#define MCI_ALL_DEVICE_ID 0xFFFF
+
+/* constants for predefined MCI device types */
+#define MCI_DEVTYPE_VCR (MCI_STRING_OFFSET + 1)
+#define MCI_DEVTYPE_VIDEODISC (MCI_STRING_OFFSET + 2)
+#define MCI_DEVTYPE_OVERLAY (MCI_STRING_OFFSET + 3)
+#define MCI_DEVTYPE_CD_AUDIO (MCI_STRING_OFFSET + 4)
+#define MCI_DEVTYPE_DAT (MCI_STRING_OFFSET + 5)
+#define MCI_DEVTYPE_SCANNER (MCI_STRING_OFFSET + 6)
+#define MCI_DEVTYPE_ANIMATION (MCI_STRING_OFFSET + 7)
+#define MCI_DEVTYPE_DIGITAL_VIDEO (MCI_STRING_OFFSET + 8)
+#define MCI_DEVTYPE_OTHER (MCI_STRING_OFFSET + 9)
+#define MCI_DEVTYPE_WAVEFORM_AUDIO (MCI_STRING_OFFSET + 10)
+#define MCI_DEVTYPE_SEQUENCER (MCI_STRING_OFFSET + 11)
+
+#define MCI_DEVTYPE_FIRST MCI_DEVTYPE_VCR
+#define MCI_DEVTYPE_LAST MCI_DEVTYPE_SEQUENCER
+
+/* return values for 'status mode' command */
+#define MCI_MODE_NOT_READY (MCI_STRING_OFFSET + 12)
+#define MCI_MODE_STOP (MCI_STRING_OFFSET + 13)
+#define MCI_MODE_PLAY (MCI_STRING_OFFSET + 14)
+#define MCI_MODE_RECORD (MCI_STRING_OFFSET + 15)
+#define MCI_MODE_SEEK (MCI_STRING_OFFSET + 16)
+#define MCI_MODE_PAUSE (MCI_STRING_OFFSET + 17)
+#define MCI_MODE_OPEN (MCI_STRING_OFFSET + 18)
+
+/* constants used in 'set time format' and 'status time format' commands */
+#define MCI_FORMAT_MILLISECONDS 0
+#define MCI_FORMAT_HMS 1
+#define MCI_FORMAT_MSF 2
+#define MCI_FORMAT_FRAMES 3
+#define MCI_FORMAT_SMPTE_24 4
+#define MCI_FORMAT_SMPTE_25 5
+#define MCI_FORMAT_SMPTE_30 6
+#define MCI_FORMAT_SMPTE_30DROP 7
+#define MCI_FORMAT_BYTES 8
+#define MCI_FORMAT_SAMPLES 9
+#define MCI_FORMAT_TMSF 10
+
+/* MCI time format conversion macros */
+#define MCI_MSF_MINUTE(msf) ((BYTE)(msf))
+#define MCI_MSF_SECOND(msf) ((BYTE)(((WORD)(msf)) >> 8))
+#define MCI_MSF_FRAME(msf) ((BYTE)((msf)>>16))
+
+#define MCI_MAKE_MSF(m, s, f) ((DWORD)(((BYTE)(m) | \
+ ((WORD)(s)<<8)) | \
+ (((DWORD)(BYTE)(f))<<16)))
+
+#define MCI_TMSF_TRACK(tmsf) ((BYTE)(tmsf))
+#define MCI_TMSF_MINUTE(tmsf) ((BYTE)(((WORD)(tmsf)) >> 8))
+#define MCI_TMSF_SECOND(tmsf) ((BYTE)((tmsf)>>16))
+#define MCI_TMSF_FRAME(tmsf) ((BYTE)((tmsf)>>24))
+
+#define MCI_MAKE_TMSF(t, m, s, f) ((DWORD)(((BYTE)(t) | \
+ ((WORD)(m)<<8)) | \
+ (((DWORD)(BYTE)(s) | \
+ ((WORD)(f)<<8))<<16)))
+
+#define MCI_HMS_HOUR(hms) ((BYTE)(hms))
+#define MCI_HMS_MINUTE(hms) ((BYTE)(((WORD)(hms)) >> 8))
+#define MCI_HMS_SECOND(hms) ((BYTE)((hms)>>16))
+
+#define MCI_MAKE_HMS(h, m, s) ((DWORD)(((BYTE)(h) | \
+ ((WORD)(m)<<8)) | \
+ (((DWORD)(BYTE)(s))<<16)))
+
+
+/* flags for wParam of MM_MCINOTIFY message */
+#define MCI_NOTIFY_SUCCESSFUL 0x0001
+#define MCI_NOTIFY_SUPERSEDED 0x0002
+#define MCI_NOTIFY_ABORTED 0x0004
+#define MCI_NOTIFY_FAILURE 0x0008
+
+
+/* common flags for dwFlags parameter of MCI command messages */
+#define MCI_NOTIFY 0x00000001L
+#define MCI_WAIT 0x00000002L
+#define MCI_FROM 0x00000004L
+#define MCI_TO 0x00000008L
+#define MCI_TRACK 0x00000010L
+
+/* flags for dwFlags parameter of MCI_OPEN command message */
+#define MCI_OPEN_SHAREABLE 0x00000100L
+#define MCI_OPEN_ELEMENT 0x00000200L
+#define MCI_OPEN_ALIAS 0x00000400L
+#define MCI_OPEN_ELEMENT_ID 0x00000800L
+#define MCI_OPEN_TYPE_ID 0x00001000L
+#define MCI_OPEN_TYPE 0x00002000L
+
+/* flags for dwFlags parameter of MCI_SEEK command message */
+#define MCI_SEEK_TO_START 0x00000100L
+#define MCI_SEEK_TO_END 0x00000200L
+
+/* flags for dwFlags parameter of MCI_STATUS command message */
+#define MCI_STATUS_ITEM 0x00000100L
+#define MCI_STATUS_START 0x00000200L
+
+/* flags for dwItem field of the MCI_STATUS_PARMS parameter block */
+#define MCI_STATUS_LENGTH 0x00000001L
+#define MCI_STATUS_POSITION 0x00000002L
+#define MCI_STATUS_NUMBER_OF_TRACKS 0x00000003L
+#define MCI_STATUS_MODE 0x00000004L
+#define MCI_STATUS_MEDIA_PRESENT 0x00000005L
+#define MCI_STATUS_TIME_FORMAT 0x00000006L
+#define MCI_STATUS_READY 0x00000007L
+#define MCI_STATUS_CURRENT_TRACK 0x00000008L
+
+/* flags for dwFlags parameter of MCI_INFO command message */
+#define MCI_INFO_PRODUCT 0x00000100L
+#define MCI_INFO_FILE 0x00000200L
+
+/* flags for dwFlags parameter of MCI_GETDEVCAPS command message */
+#define MCI_GETDEVCAPS_ITEM 0x00000100L
+
+/* flags for dwItem field of the MCI_GETDEVCAPS_PARMS parameter block */
+#define MCI_GETDEVCAPS_CAN_RECORD 0x00000001L
+#define MCI_GETDEVCAPS_HAS_AUDIO 0x00000002L
+#define MCI_GETDEVCAPS_HAS_VIDEO 0x00000003L
+#define MCI_GETDEVCAPS_DEVICE_TYPE 0x00000004L
+#define MCI_GETDEVCAPS_USES_FILES 0x00000005L
+#define MCI_GETDEVCAPS_COMPOUND_DEVICE 0x00000006L
+#define MCI_GETDEVCAPS_CAN_EJECT 0x00000007L
+#define MCI_GETDEVCAPS_CAN_PLAY 0x00000008L
+#define MCI_GETDEVCAPS_CAN_SAVE 0x00000009L
+
+/* flags for dwFlags parameter of MCI_SYSINFO command message */
+#define MCI_SYSINFO_QUANTITY 0x00000100L
+#define MCI_SYSINFO_OPEN 0x00000200L
+#define MCI_SYSINFO_NAME 0x00000400L
+#define MCI_SYSINFO_INSTALLNAME 0x00000800L
+
+/* flags for dwFlags parameter of MCI_SET command message */
+#define MCI_SET_DOOR_OPEN 0x00000100L
+#define MCI_SET_DOOR_CLOSED 0x00000200L
+#define MCI_SET_TIME_FORMAT 0x00000400L
+#define MCI_SET_AUDIO 0x00000800L
+#define MCI_SET_VIDEO 0x00001000L
+#define MCI_SET_ON 0x00002000L
+#define MCI_SET_OFF 0x00004000L
+
+/* flags for dwAudio field of MCI_SET_PARMS or MCI_SEQ_SET_PARMS */
+#define MCI_SET_AUDIO_ALL 0x00000000L
+#define MCI_SET_AUDIO_LEFT 0x00000001L
+#define MCI_SET_AUDIO_RIGHT 0x00000002L
+
+/* flags for dwFlags parameter of MCI_BREAK command message */
+#define MCI_BREAK_KEY 0x00000100L
+#define MCI_BREAK_HWND 0x00000200L
+#define MCI_BREAK_OFF 0x00000400L
+
+/* flags for dwFlags parameter of MCI_RECORD command message */
+#define MCI_RECORD_INSERT 0x00000100L
+#define MCI_RECORD_OVERWRITE 0x00000200L
+
+/* flags for dwFlags parameter of MCI_SOUND command message */
+#define MCI_SOUND_NAME 0x00000100L
+
+/* flags for dwFlags parameter of MCI_SAVE command message */
+#define MCI_SAVE_FILE 0x00000100L
+
+/* flags for dwFlags parameter of MCI_LOAD command message */
+#define MCI_LOAD_FILE 0x00000100L
+
+/* generic parameter block for MCI command messages with no special parameters */
+typedef struct tagMCI_GENERIC_PARMS {
+ DWORD dwCallback;
+} MCI_GENERIC_PARMS;
+typedef MCI_GENERIC_PARMS FAR *LPMCI_GENERIC_PARMS;
+
+/* parameter block for MCI_OPEN command message */
+typedef struct tagMCI_OPEN_PARMS {
+ DWORD dwCallback;
+ UINT wDeviceID;
+ UINT wReserved0;
+ LPCSTR lpstrDeviceType;
+ LPCSTR lpstrElementName;
+ LPCSTR lpstrAlias;
+} MCI_OPEN_PARMS;
+typedef MCI_OPEN_PARMS FAR *LPMCI_OPEN_PARMS;
+
+/* parameter block for MCI_PLAY command message */
+typedef struct tagMCI_PLAY_PARMS {
+ DWORD dwCallback;
+ DWORD dwFrom;
+ DWORD dwTo;
+} MCI_PLAY_PARMS;
+typedef MCI_PLAY_PARMS FAR *LPMCI_PLAY_PARMS;
+
+/* parameter block for MCI_SEEK command message */
+typedef struct tagMCI_SEEK_PARMS {
+ DWORD dwCallback;
+ DWORD dwTo;
+} MCI_SEEK_PARMS;
+typedef MCI_SEEK_PARMS FAR *LPMCI_SEEK_PARMS;
+
+/* parameter block for MCI_STATUS command message */
+typedef struct tagMCI_STATUS_PARMS {
+ DWORD dwCallback;
+ DWORD dwReturn;
+ DWORD dwItem;
+ DWORD dwTrack;
+} MCI_STATUS_PARMS;
+typedef MCI_STATUS_PARMS FAR * LPMCI_STATUS_PARMS;
+
+/* parameter block for MCI_INFO command message */
+typedef struct tagMCI_INFO_PARMS {
+ DWORD dwCallback;
+ LPSTR lpstrReturn;
+ DWORD dwRetSize;
+} MCI_INFO_PARMS;
+typedef MCI_INFO_PARMS FAR * LPMCI_INFO_PARMS;
+
+/* parameter block for MCI_GETDEVCAPS command message */
+typedef struct tagMCI_GETDEVCAPS_PARMS {
+ DWORD dwCallback;
+ DWORD dwReturn;
+ DWORD dwItem;
+} MCI_GETDEVCAPS_PARMS;
+typedef MCI_GETDEVCAPS_PARMS FAR * LPMCI_GETDEVCAPS_PARMS;
+
+/* parameter block for MCI_SYSINFO command message */
+typedef struct tagMCI_SYSINFO_PARMS {
+ DWORD dwCallback;
+ LPSTR lpstrReturn;
+ DWORD dwRetSize;
+ DWORD dwNumber;
+ UINT wDeviceType;
+ UINT wReserved0;
+} MCI_SYSINFO_PARMS;
+typedef MCI_SYSINFO_PARMS FAR * LPMCI_SYSINFO_PARMS;
+
+/* parameter block for MCI_SET command message */
+typedef struct tagMCI_SET_PARMS {
+ DWORD dwCallback;
+ DWORD dwTimeFormat;
+ DWORD dwAudio;
+} MCI_SET_PARMS;
+typedef MCI_SET_PARMS FAR *LPMCI_SET_PARMS;
+
+/* parameter block for MCI_BREAK command message */
+typedef struct tagMCI_BREAK_PARMS {
+ DWORD dwCallback;
+ int nVirtKey;
+ UINT wReserved0;
+ HWND hwndBreak;
+ UINT wReserved1;
+} MCI_BREAK_PARMS;
+typedef MCI_BREAK_PARMS FAR * LPMCI_BREAK_PARMS;
+
+/* parameter block for MCI_SOUND command message */
+typedef struct tagMCI_SOUND_PARMS {
+ DWORD dwCallback;
+ LPCSTR lpstrSoundName;
+} MCI_SOUND_PARMS;
+typedef MCI_SOUND_PARMS FAR * LPMCI_SOUND_PARMS;
+
+/* parameter block for MCI_SAVE command message */
+typedef struct tagMCI_SAVE_PARMS {
+ DWORD dwCallback;
+ LPCSTR lpfilename;
+} MCI_SAVE_PARMS;
+typedef MCI_SAVE_PARMS FAR * LPMCI_SAVE_PARMS;
+
+/* parameter block for MCI_LOAD command message */
+typedef struct tagMCI_LOAD_PARMS {
+ DWORD dwCallback;
+ LPCSTR lpfilename;
+} MCI_LOAD_PARMS;
+typedef MCI_LOAD_PARMS FAR * LPMCI_LOAD_PARMS;
+
+/* parameter block for MCI_RECORD command message */
+typedef struct tagMCI_RECORD_PARMS {
+ DWORD dwCallback;
+ DWORD dwFrom;
+ DWORD dwTo;
+} MCI_RECORD_PARMS;
+typedef MCI_RECORD_PARMS FAR *LPMCI_RECORD_PARMS;
+
+
+/* MCI extensions for videodisc devices */
+
+/* flag for dwReturn field of MCI_STATUS_PARMS */
+/* MCI_STATUS command, (dwItem == MCI_STATUS_MODE) */
+#define MCI_VD_MODE_PARK (MCI_VD_OFFSET + 1)
+
+/* flag for dwReturn field of MCI_STATUS_PARMS */
+/* MCI_STATUS command, (dwItem == MCI_VD_STATUS_MEDIA_TYPE) */
+#define MCI_VD_MEDIA_CLV (MCI_VD_OFFSET + 2)
+#define MCI_VD_MEDIA_CAV (MCI_VD_OFFSET + 3)
+#define MCI_VD_MEDIA_OTHER (MCI_VD_OFFSET + 4)
+
+#define MCI_VD_FORMAT_TRACK 0x4001
+
+/* flags for dwFlags parameter of MCI_PLAY command message */
+#define MCI_VD_PLAY_REVERSE 0x00010000L
+#define MCI_VD_PLAY_FAST 0x00020000L
+#define MCI_VD_PLAY_SPEED 0x00040000L
+#define MCI_VD_PLAY_SCAN 0x00080000L
+#define MCI_VD_PLAY_SLOW 0x00100000L
+
+/* flag for dwFlags parameter of MCI_SEEK command message */
+#define MCI_VD_SEEK_REVERSE 0x00010000L
+
+/* flags for dwItem field of MCI_STATUS_PARMS parameter block */
+#define MCI_VD_STATUS_SPEED 0x00004002L
+#define MCI_VD_STATUS_FORWARD 0x00004003L
+#define MCI_VD_STATUS_MEDIA_TYPE 0x00004004L
+#define MCI_VD_STATUS_SIDE 0x00004005L
+#define MCI_VD_STATUS_DISC_SIZE 0x00004006L
+
+/* flags for dwFlags parameter of MCI_GETDEVCAPS command message */
+#define MCI_VD_GETDEVCAPS_CLV 0x00010000L
+#define MCI_VD_GETDEVCAPS_CAV 0x00020000L
+
+#define MCI_VD_SPIN_UP 0x00010000L
+#define MCI_VD_SPIN_DOWN 0x00020000L
+
+/* flags for dwItem field of MCI_GETDEVCAPS_PARMS parameter block */
+#define MCI_VD_GETDEVCAPS_CAN_REVERSE 0x00004002L
+#define MCI_VD_GETDEVCAPS_FAST_RATE 0x00004003L
+#define MCI_VD_GETDEVCAPS_SLOW_RATE 0x00004004L
+#define MCI_VD_GETDEVCAPS_NORMAL_RATE 0x00004005L
+
+/* flags for the dwFlags parameter of MCI_STEP command message */
+#define MCI_VD_STEP_FRAMES 0x00010000L
+#define MCI_VD_STEP_REVERSE 0x00020000L
+
+/* flag for the MCI_ESCAPE command message */
+#define MCI_VD_ESCAPE_STRING 0x00000100L
+
+/* parameter block for MCI_PLAY command message */
+typedef struct tagMCI_VD_PLAY_PARMS {
+ DWORD dwCallback;
+ DWORD dwFrom;
+ DWORD dwTo;
+ DWORD dwSpeed;
+ } MCI_VD_PLAY_PARMS;
+typedef MCI_VD_PLAY_PARMS FAR *LPMCI_VD_PLAY_PARMS;
+
+/* parameter block for MCI_STEP command message */
+typedef struct tagMCI_VD_STEP_PARMS {
+ DWORD dwCallback;
+ DWORD dwFrames;
+} MCI_VD_STEP_PARMS;
+typedef MCI_VD_STEP_PARMS FAR *LPMCI_VD_STEP_PARMS;
+
+/* parameter block for MCI_ESCAPE command message */
+typedef struct tagMCI_VD_ESCAPE_PARMS {
+ DWORD dwCallback;
+ LPCSTR lpstrCommand;
+} MCI_VD_ESCAPE_PARMS;
+typedef MCI_VD_ESCAPE_PARMS FAR *LPMCI_VD_ESCAPE_PARMS;
+
+
+/* MCI extensions for waveform audio devices */
+
+/* flags for the dwFlags parameter of MCI_OPEN command message */
+#define MCI_WAVE_OPEN_BUFFER 0x00010000L
+
+/* flags for the dwFlags parameter of MCI_SET command message */
+#define MCI_WAVE_SET_FORMATTAG 0x00010000L
+#define MCI_WAVE_SET_CHANNELS 0x00020000L
+#define MCI_WAVE_SET_SAMPLESPERSEC 0x00040000L
+#define MCI_WAVE_SET_AVGBYTESPERSEC 0x00080000L
+#define MCI_WAVE_SET_BLOCKALIGN 0x00100000L
+#define MCI_WAVE_SET_BITSPERSAMPLE 0x00200000L
+
+/* flags for the dwFlags parameter of MCI_STATUS, MCI_SET command messages */
+#define MCI_WAVE_INPUT 0x00400000L
+#define MCI_WAVE_OUTPUT 0x00800000L
+
+/* flags for the dwItem field of MCI_STATUS_PARMS parameter block */
+#define MCI_WAVE_STATUS_FORMATTAG 0x00004001L
+#define MCI_WAVE_STATUS_CHANNELS 0x00004002L
+#define MCI_WAVE_STATUS_SAMPLESPERSEC 0x00004003L
+#define MCI_WAVE_STATUS_AVGBYTESPERSEC 0x00004004L
+#define MCI_WAVE_STATUS_BLOCKALIGN 0x00004005L
+#define MCI_WAVE_STATUS_BITSPERSAMPLE 0x00004006L
+#define MCI_WAVE_STATUS_LEVEL 0x00004007L
+
+/* flags for the dwFlags parameter of MCI_SET command message */
+#define MCI_WAVE_SET_ANYINPUT 0x04000000L
+#define MCI_WAVE_SET_ANYOUTPUT 0x08000000L
+
+/* flags for the dwFlags parameter of MCI_GETDEVCAPS command message */
+#define MCI_WAVE_GETDEVCAPS_INPUTS 0x00004001L
+#define MCI_WAVE_GETDEVCAPS_OUTPUTS 0x00004002L
+
+/* parameter block for MCI_OPEN command message */
+typedef struct tagMCI_WAVE_OPEN_PARMS {
+ DWORD dwCallback;
+ UINT wDeviceID;
+ UINT wReserved0;
+ LPCSTR lpstrDeviceType;
+ LPCSTR lpstrElementName;
+ LPCSTR lpstrAlias;
+ DWORD dwBufferSeconds;
+} MCI_WAVE_OPEN_PARMS;
+typedef MCI_WAVE_OPEN_PARMS FAR *LPMCI_WAVE_OPEN_PARMS;
+
+/* parameter block for MCI_DELETE command message */
+typedef struct tagMCI_WAVE_DELETE_PARMS {
+ DWORD dwCallback;
+ DWORD dwFrom;
+ DWORD dwTo;
+} MCI_WAVE_DELETE_PARMS;
+typedef MCI_WAVE_DELETE_PARMS FAR *LPMCI_WAVE_DELETE_PARMS;
+
+/* parameter block for MCI_SET command message */
+typedef struct tagMCI_WAVE_SET_PARMS {
+ DWORD dwCallback;
+ DWORD dwTimeFormat;
+ DWORD dwAudio;
+ UINT wInput;
+ UINT wReserved0;
+ UINT wOutput;
+ UINT wReserved1;
+ UINT wFormatTag;
+ UINT wReserved2;
+ UINT nChannels;
+ UINT wReserved3;
+ DWORD nSamplesPerSec;
+ DWORD nAvgBytesPerSec;
+ UINT nBlockAlign;
+ UINT wReserved4;
+ UINT wBitsPerSample;
+ UINT wReserved5;
+} MCI_WAVE_SET_PARMS;
+typedef MCI_WAVE_SET_PARMS FAR * LPMCI_WAVE_SET_PARMS;
+
+
+/* MCI extensions for MIDI sequencer devices */
+
+/* flags for the dwReturn field of MCI_STATUS_PARMS parameter block */
+/* MCI_STATUS command, (dwItem == MCI_SEQ_STATUS_DIVTYPE) */
+#define MCI_SEQ_DIV_PPQN (0 + MCI_SEQ_OFFSET)
+#define MCI_SEQ_DIV_SMPTE_24 (1 + MCI_SEQ_OFFSET)
+#define MCI_SEQ_DIV_SMPTE_25 (2 + MCI_SEQ_OFFSET)
+#define MCI_SEQ_DIV_SMPTE_30DROP (3 + MCI_SEQ_OFFSET)
+#define MCI_SEQ_DIV_SMPTE_30 (4 + MCI_SEQ_OFFSET)
+
+/* flags for the dwMaster field of MCI_SEQ_SET_PARMS parameter block */
+/* MCI_SET command, (dwFlags == MCI_SEQ_SET_MASTER) */
+#define MCI_SEQ_FORMAT_SONGPTR 0x4001
+#define MCI_SEQ_FILE 0x4002
+#define MCI_SEQ_MIDI 0x4003
+#define MCI_SEQ_SMPTE 0x4004
+#define MCI_SEQ_NONE 65533
+
+/* flags for the dwItem field of MCI_STATUS_PARMS parameter block */
+#define MCI_SEQ_STATUS_TEMPO 0x00004002L
+#define MCI_SEQ_STATUS_PORT 0x00004003L
+#define MCI_SEQ_STATUS_SLAVE 0x00004007L
+#define MCI_SEQ_STATUS_MASTER 0x00004008L
+#define MCI_SEQ_STATUS_OFFSET 0x00004009L
+#define MCI_SEQ_STATUS_DIVTYPE 0x0000400AL
+
+/* flags for the dwFlags parameter of MCI_SET command message */
+#define MCI_SEQ_SET_TEMPO 0x00010000L
+#define MCI_SEQ_SET_PORT 0x00020000L
+#define MCI_SEQ_SET_SLAVE 0x00040000L
+#define MCI_SEQ_SET_MASTER 0x00080000L
+#define MCI_SEQ_SET_OFFSET 0x01000000L
+
+/* parameter block for MCI_SET command message */
+typedef struct tagMCI_SEQ_SET_PARMS {
+ DWORD dwCallback;
+ DWORD dwTimeFormat;
+ DWORD dwAudio;
+ DWORD dwTempo;
+ DWORD dwPort;
+ DWORD dwSlave;
+ DWORD dwMaster;
+ DWORD dwOffset;
+} MCI_SEQ_SET_PARMS;
+typedef MCI_SEQ_SET_PARMS FAR * LPMCI_SEQ_SET_PARMS;
+
+
+/* MCI extensions for animation devices */
+
+/* flags for dwFlags parameter of MCI_OPEN command message */
+#define MCI_ANIM_OPEN_WS 0x00010000L
+#define MCI_ANIM_OPEN_PARENT 0x00020000L
+#define MCI_ANIM_OPEN_NOSTATIC 0x00040000L
+
+/* flags for dwFlags parameter of MCI_PLAY command message */
+#define MCI_ANIM_PLAY_SPEED 0x00010000L
+#define MCI_ANIM_PLAY_REVERSE 0x00020000L
+#define MCI_ANIM_PLAY_FAST 0x00040000L
+#define MCI_ANIM_PLAY_SLOW 0x00080000L
+#define MCI_ANIM_PLAY_SCAN 0x00100000L
+
+/* flags for dwFlags parameter of MCI_STEP command message */
+#define MCI_ANIM_STEP_REVERSE 0x00010000L
+#define MCI_ANIM_STEP_FRAMES 0x00020000L
+
+/* flags for dwItem field of MCI_STATUS_PARMS parameter block */
+#define MCI_ANIM_STATUS_SPEED 0x00004001L
+#define MCI_ANIM_STATUS_FORWARD 0x00004002L
+#define MCI_ANIM_STATUS_HWND 0x00004003L
+#define MCI_ANIM_STATUS_HPAL 0x00004004L
+#define MCI_ANIM_STATUS_STRETCH 0x00004005L
+
+/* flags for the dwFlags parameter of MCI_INFO command message */
+#define MCI_ANIM_INFO_TEXT 0x00010000L
+
+/* flags for dwItem field of MCI_GETDEVCAPS_PARMS parameter block */
+#define MCI_ANIM_GETDEVCAPS_CAN_REVERSE 0x00004001L
+#define MCI_ANIM_GETDEVCAPS_FAST_RATE 0x00004002L
+#define MCI_ANIM_GETDEVCAPS_SLOW_RATE 0x00004003L
+#define MCI_ANIM_GETDEVCAPS_NORMAL_RATE 0x00004004L
+#define MCI_ANIM_GETDEVCAPS_PALETTES 0x00004006L
+#define MCI_ANIM_GETDEVCAPS_CAN_STRETCH 0x00004007L
+#define MCI_ANIM_GETDEVCAPS_MAX_WINDOWS 0x00004008L
+
+/* flags for the MCI_REALIZE command message */
+#define MCI_ANIM_REALIZE_NORM 0x00010000L
+#define MCI_ANIM_REALIZE_BKGD 0x00020000L
+
+/* flags for dwFlags parameter of MCI_WINDOW command message */
+#define MCI_ANIM_WINDOW_HWND 0x00010000L
+#define MCI_ANIM_WINDOW_STATE 0x00040000L
+#define MCI_ANIM_WINDOW_TEXT 0x00080000L
+#define MCI_ANIM_WINDOW_ENABLE_STRETCH 0x00100000L
+#define MCI_ANIM_WINDOW_DISABLE_STRETCH 0x00200000L
+
+/* flags for hWnd field of MCI_ANIM_WINDOW_PARMS parameter block */
+/* MCI_WINDOW command message, (dwFlags == MCI_ANIM_WINDOW_HWND) */
+#define MCI_ANIM_WINDOW_DEFAULT 0x00000000L
+
+/* flags for dwFlags parameter of MCI_PUT command message */
+#define MCI_ANIM_RECT 0x00010000L
+#define MCI_ANIM_PUT_SOURCE 0x00020000L
+#define MCI_ANIM_PUT_DESTINATION 0x00040000L
+
+/* flags for dwFlags parameter of MCI_WHERE command message */
+#define MCI_ANIM_WHERE_SOURCE 0x00020000L
+#define MCI_ANIM_WHERE_DESTINATION 0x00040000L
+
+/* flags for dwFlags parameter of MCI_UPDATE command message */
+#define MCI_ANIM_UPDATE_HDC 0x00020000L
+
+/* parameter block for MCI_OPEN command message */
+typedef struct tagMCI_ANIM_OPEN_PARMS {
+ DWORD dwCallback;
+ UINT wDeviceID;
+ UINT wReserved0;
+ LPCSTR lpstrDeviceType;
+ LPCSTR lpstrElementName;
+ LPCSTR lpstrAlias;
+ DWORD dwStyle;
+ HWND hWndParent;
+ UINT wReserved1;
+} MCI_ANIM_OPEN_PARMS;
+typedef MCI_ANIM_OPEN_PARMS FAR *LPMCI_ANIM_OPEN_PARMS;
+
+/* parameter block for MCI_PLAY command message */
+typedef struct tagMCI_ANIM_PLAY_PARMS {
+ DWORD dwCallback;
+ DWORD dwFrom;
+ DWORD dwTo;
+ DWORD dwSpeed;
+} MCI_ANIM_PLAY_PARMS;
+typedef MCI_ANIM_PLAY_PARMS FAR *LPMCI_ANIM_PLAY_PARMS;
+
+/* parameter block for MCI_STEP command message */
+typedef struct tagMCI_ANIM_STEP_PARMS {
+ DWORD dwCallback;
+ DWORD dwFrames;
+} MCI_ANIM_STEP_PARMS;
+typedef MCI_ANIM_STEP_PARMS FAR *LPMCI_ANIM_STEP_PARMS;
+
+/* parameter block for MCI_WINDOW command message */
+typedef struct tagMCI_ANIM_WINDOW_PARMS {
+ DWORD dwCallback;
+ HWND hWnd;
+ UINT wReserved1;
+ UINT nCmdShow;
+ UINT wReserved2;
+ LPCSTR lpstrText;
+} MCI_ANIM_WINDOW_PARMS;
+typedef MCI_ANIM_WINDOW_PARMS FAR * LPMCI_ANIM_WINDOW_PARMS;
+
+/* parameter block for MCI_PUT, MCI_UPDATE, MCI_WHERE command messages */
+typedef struct tagMCI_ANIM_RECT_PARMS {
+ DWORD dwCallback;
+#ifdef MCI_USE_OFFEXT
+ POINT ptOffset;
+ POINT ptExtent;
+#else /* ifdef MCI_USE_OFFEXT */
+ RECT rc;
+#endif /* ifdef MCI_USE_OFFEXT */
+} MCI_ANIM_RECT_PARMS;
+typedef MCI_ANIM_RECT_PARMS FAR * LPMCI_ANIM_RECT_PARMS;
+
+/* parameter block for MCI_UPDATE PARMS */
+typedef struct tagMCI_ANIM_UPDATE_PARMS {
+ DWORD dwCallback;
+ RECT rc;
+ HDC hDC;
+} MCI_ANIM_UPDATE_PARMS;
+typedef MCI_ANIM_UPDATE_PARMS FAR * LPMCI_ANIM_UPDATE_PARMS;
+
+
+/* MCI extensions for video overlay devices */
+
+/* flags for dwFlags parameter of MCI_OPEN command message */
+#define MCI_OVLY_OPEN_WS 0x00010000L
+#define MCI_OVLY_OPEN_PARENT 0x00020000L
+
+/* flags for dwFlags parameter of MCI_STATUS command message */
+#define MCI_OVLY_STATUS_HWND 0x00004001L
+#define MCI_OVLY_STATUS_STRETCH 0x00004002L
+
+/* flags for dwFlags parameter of MCI_INFO command message */
+#define MCI_OVLY_INFO_TEXT 0x00010000L
+
+/* flags for dwItem field of MCI_GETDEVCAPS_PARMS parameter block */
+#define MCI_OVLY_GETDEVCAPS_CAN_STRETCH 0x00004001L
+#define MCI_OVLY_GETDEVCAPS_CAN_FREEZE 0x00004002L
+#define MCI_OVLY_GETDEVCAPS_MAX_WINDOWS 0x00004003L
+
+/* flags for dwFlags parameter of MCI_WINDOW command message */
+#define MCI_OVLY_WINDOW_HWND 0x00010000L
+#define MCI_OVLY_WINDOW_STATE 0x00040000L
+#define MCI_OVLY_WINDOW_TEXT 0x00080000L
+#define MCI_OVLY_WINDOW_ENABLE_STRETCH 0x00100000L
+#define MCI_OVLY_WINDOW_DISABLE_STRETCH 0x00200000L
+
+/* flags for hWnd parameter of MCI_OVLY_WINDOW_PARMS parameter block */
+#define MCI_OVLY_WINDOW_DEFAULT 0x00000000L
+
+/* flags for dwFlags parameter of MCI_PUT command message */
+#define MCI_OVLY_RECT 0x00010000L
+#define MCI_OVLY_PUT_SOURCE 0x00020000L
+#define MCI_OVLY_PUT_DESTINATION 0x00040000L
+#define MCI_OVLY_PUT_FRAME 0x00080000L
+#define MCI_OVLY_PUT_VIDEO 0x00100000L
+
+/* flags for dwFlags parameter of MCI_WHERE command message */
+#define MCI_OVLY_WHERE_SOURCE 0x00020000L
+#define MCI_OVLY_WHERE_DESTINATION 0x00040000L
+#define MCI_OVLY_WHERE_FRAME 0x00080000L
+#define MCI_OVLY_WHERE_VIDEO 0x00100000L
+
+/* parameter block for MCI_OPEN command message */
+typedef struct tagMCI_OVLY_OPEN_PARMS {
+ DWORD dwCallback;
+ UINT wDeviceID;
+ UINT wReserved0;
+ LPCSTR lpstrDeviceType;
+ LPCSTR lpstrElementName;
+ LPCSTR lpstrAlias;
+ DWORD dwStyle;
+ HWND hWndParent;
+ UINT wReserved1;
+ } MCI_OVLY_OPEN_PARMS;
+typedef MCI_OVLY_OPEN_PARMS FAR *LPMCI_OVLY_OPEN_PARMS;
+
+/* parameter block for MCI_WINDOW command message */
+typedef struct tagMCI_OVLY_WINDOW_PARMS {
+ DWORD dwCallback;
+ HWND hWnd;
+ UINT wReserved1;
+ UINT nCmdShow;
+ UINT wReserved2;
+ LPCSTR lpstrText;
+} MCI_OVLY_WINDOW_PARMS;
+typedef MCI_OVLY_WINDOW_PARMS FAR * LPMCI_OVLY_WINDOW_PARMS;
+
+/* parameter block for MCI_PUT, MCI_UPDATE, and MCI_WHERE command messages */
+typedef struct tagMCI_OVLY_RECT_PARMS {
+ DWORD dwCallback;
+#ifdef MCI_USE_OFFEXT
+ POINT ptOffset;
+ POINT ptExtent;
+#else /* ifdef MCI_USE_OFFEXT */
+ RECT rc;
+#endif /* ifdef MCI_USE_OFFEXT */
+} MCI_OVLY_RECT_PARMS;
+typedef MCI_OVLY_RECT_PARMS FAR * LPMCI_OVLY_RECT_PARMS;
+
+/* parameter block for MCI_SAVE command message */
+typedef struct tagMCI_OVLY_SAVE_PARMS {
+ DWORD dwCallback;
+ LPCSTR lpfilename;
+ RECT rc;
+} MCI_OVLY_SAVE_PARMS;
+typedef MCI_OVLY_SAVE_PARMS FAR * LPMCI_OVLY_SAVE_PARMS;
+
+/* parameter block for MCI_LOAD command message */
+typedef struct tagMCI_OVLY_LOAD_PARMS {
+ DWORD dwCallback;
+ LPCSTR lpfilename;
+ RECT rc;
+} MCI_OVLY_LOAD_PARMS;
+typedef MCI_OVLY_LOAD_PARMS FAR * LPMCI_OVLY_LOAD_PARMS;
+
+#endif /* ifndef MMNOMCI */
+
+/****************************************************************************
+
+ DISPLAY Driver extensions
+
+****************************************************************************/
+
+#ifndef C1_TRANSPARENT
+ #define CAPS1 94 /* other caps */
+ #define C1_TRANSPARENT 0x0001 /* new raster cap */
+ #define NEWTRANSPARENT 3 /* use with SetBkMode() */
+
+ #define QUERYROPSUPPORT 40 /* use to determine ROP support */
+#endif /* ifndef C1_TRANSPARENT */
+
+/****************************************************************************
+
+ DIB Driver extensions
+
+****************************************************************************/
+
+#define SELECTDIB 41 /* DIB.DRV select dib escape */
+#define DIBINDEX(n) MAKELONG((n),0x10FF)
+
+
+/****************************************************************************
+
+ ScreenSaver support
+
+ The current application will receive a syscommand of SC_SCREENSAVE just
+ before the screen saver is invoked. If the app wishes to prevent a
+ screen save, return non-zero value, otherwise call DefWindowProc().
+
+****************************************************************************/
+
+#ifndef SC_SCREENSAVE
+
+ #define SC_SCREENSAVE 0xF140
+
+#endif /* ifndef SC_SCREENSAVE */
+
+#ifdef __cplusplus
+} /* End of extern "C" { */
+#endif /* __cplusplus */
+
+#ifndef RC_INVOKED
+#pragma pack() /* Revert to default packing */
+#endif
+
+#endif /* _INC_MMSYSTEM */
diff --git a/private/mvdm/wow16/inc/mmsystem.inc b/private/mvdm/wow16/inc/mmsystem.inc
new file mode 100644
index 000000000..3e13c6dee
--- /dev/null
+++ b/private/mvdm/wow16/inc/mmsystem.inc
@@ -0,0 +1,1490 @@
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;
+; MMSYSTEM.INC - Multimedia assembly language structures & constants
+;
+; Copyright (c) 1990-1992, Microsoft Corp. All rights reserved.
+;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+
+
+; If defined, the following flags inhibit inclusion
+; of the indicated items:
+;
+; MMNODRV - Installable driver support
+; MMNOSOUND - Sound support
+; MMNOWAVE - Waveform support
+; MMNOMIDI - MIDI support
+; MMNOAUX - Auxiliary audio support
+; MMNOTIMER - Timer support
+; MMNOJOY - Joystick support
+; MMNOMCI - MCI support
+; MMNOMMIO - Multimedia file I/O support
+;
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;
+; General constants and data types
+;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+; general constants
+MAXPNAMELEN equ 32 ; max product name length (including NULL)
+MAXERRORLENGTH equ 128 ; max error text length (including NULL)
+
+; MMTIME data structure
+MMTIME struc
+ mmt_wType dw ? ; indicates the contents of the union
+ mmt_TimeUnion dd ? ; union
+MMTIME ends
+
+SMPTE struc
+ smpte_hour db ? ; hours
+ smpte_min db ? ; minutes
+ smpte_sec db ? ; seconds
+ smpte_frame db ? ; frames
+ smpte_fps db ? ; frames per second
+ smpte_reserved db ? ; pad
+SMPTE ends
+
+; types for wType field in MMTIME struct
+TIME_MS equ 0001h ; time in milliseconds
+TIME_SAMPLES equ 0002h ; number of wave samples
+TIME_BYTES equ 0004h ; current byte offset
+TIME_SMPTE equ 0008h ; SMPTE time
+TIME_MIDI equ 0010h ; MIDI time
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;
+; Multimedia Extensions Window Messages
+;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+MM_JOY1MOVE equ 3A0h ; joystick
+MM_JOY2MOVE equ 3A1h
+MM_JOY1ZMOVE equ 3A2h
+MM_JOY2ZMOVE equ 3A3h
+MM_JOY1BUTTONDOWN equ 3B5h
+MM_JOY2BUTTONDOWN equ 3B6h
+MM_JOY1BUTTONUP equ 3B7h
+MM_JOY2BUTTONUP equ 3B8h
+
+MM_MCINOTIFY equ 3B9h ; MCI
+MM_MCISYSTEM_STRING equ 3CAh
+
+MM_WOM_OPEN equ 3BBh ; waveform output
+MM_WOM_CLOSE equ 3BCh
+MM_WOM_DONE equ 3BDh
+
+MM_WIM_OPEN equ 3BEh ; waveform input
+MM_WIM_CLOSE equ 3BFh
+MM_WIM_DATA equ 3C0h
+
+MM_MIM_OPEN equ 3C1h ; MIDI input
+MM_MIM_CLOSE equ 3C2h
+MM_MIM_DATA equ 3C3h
+MM_MIM_LONGDATA equ 3C4h
+MM_MIM_ERROR equ 3C5h
+MM_MIM_LONGERROR equ 3C6h
+
+MM_MOM_OPEN equ 3C7h ; MIDI output
+MM_MOM_CLOSE equ 3C8h
+MM_MOM_DONE equ 3C9h
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;
+; String resource number bases (internal use)
+;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+MMSYSERR_BASE equ 0
+WAVERR_BASE equ 32
+MIDIERR_BASE equ 64
+TIMERR_BASE equ 96
+JOYERR_BASE equ 160
+MCIERR_BASE equ 256
+
+MCI_STRING_OFFSET equ 512
+MCI_VD_OFFSET equ 1024
+MCI_CD_OFFSET equ 1088
+MCI_WAVE_OFFSET equ 1152
+MCI_SEQ_OFFSET equ 1216
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;
+; General error return values
+;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+; general error return values
+MMSYSERR_NOERROR equ 0 ; no error
+MMSYSERR_ERROR equ (MMSYSERR_BASE + 1) ; unspecified error
+MMSYSERR_BADDEVICEID equ (MMSYSERR_BASE + 2) ; device ID out of range
+MMSYSERR_NOTENABLED equ (MMSYSERR_BASE + 3) ; driver failed enable
+MMSYSERR_ALLOCATED equ (MMSYSERR_BASE + 4) ; device already allocated
+MMSYSERR_INVALHANDLE equ (MMSYSERR_BASE + 5) ; device handle is invalid
+MMSYSERR_NODRIVER equ (MMSYSERR_BASE + 6) ; no device driver present
+MMSYSERR_NOMEM equ (MMSYSERR_BASE + 7) ; memory allocation error
+MMSYSERR_NOTSUPPORTED equ (MMSYSERR_BASE + 8) ; function isn't supported
+MMSYSERR_BADERRNUM equ (MMSYSERR_BASE + 9) ; error value out of range
+MMSYSERR_INVALFLAG equ (MMSYSERR_BASE + 10) ; invalid flags passed
+MMSYSERR_INVALPARAM equ (MMSYSERR_BASE + 11) ; invalid parameter passed
+MMSYSERR_LASTERROR equ (MMSYSERR_BASE + 11) ; last error in range
+
+
+ifndef MMNODRV
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;
+; Installable driver support
+;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+DRV_MCI_FIRST equ DRV_RESERVED
+DRV_MCI_LAST equ (DRV_RESERVED + 0FFFh)
+
+endif ;ifndef MMNODRV
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;
+; Driver callback support
+;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+; flags used with waveOutOpen(), waveInOpen(), midiInOpen(), and
+; midiOutOpen() to specify the type of the dwCallback parameter.
+CALLBACK_TYPEMASK equ 00070000h ; callback type mask
+CALLBACK_NULL equ 00000000h ; no callback
+CALLBACK_WINDOW equ 00010000h ; dwCallback is a HWND
+CALLBACK_TASK equ 00020000h ; dwCallback is a HTASK
+CALLBACK_FUNCTION equ 00030000h ; dwCallback is a FARPROC
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;
+; Manufacturer and product IDs
+;
+; Used with wMid and wPid fields in WAVEOUTCAPS, WAVEINCAPS,
+; MIDIOUTCAPS, MIDIINCAPS, AUXCAPS, JOYCAPS structures.
+;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+; manufacturer IDs
+MM_MICROSOFT equ 1 ; Microsoft Corp.
+
+; product IDs
+MM_MIDI_MAPPER equ 1 ; MIDI Mapper
+MM_WAVE_MAPPER equ 2 ; Wave Mapper
+
+MM_SNDBLST_MIDIOUT equ 3 ; Sound Blaster MIDI output port
+MM_SNDBLST_MIDIIN equ 4 ; Sound Blaster MIDI input port
+MM_SNDBLST_SYNTH equ 5 ; Sound Blaster internal synthesizer
+MM_SNDBLST_WAVEOUT equ 6 ; Sound Blaster waveform output
+MM_SNDBLST_WAVEIN equ 7 ; Sound Blaster waveform input
+
+MM_ADLIB equ 9 ; Ad Lib-compatible synthesizer
+
+MM_MPU401_MIDIOUT equ 10 ; MPU401-compatible MIDI output port
+MM_MPU401_MIDIIN equ 11 ; MPU401-compatible MIDI input port
+
+MM_PC_JOYSTICK equ 12 ; Joystick adapter
+
+
+ifndef MMNOSOUND
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;
+; Sound support
+;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+; flag values for wFlags parameter
+SND_SYNC equ 0000h ; play synchronously (default)
+SND_ASYNC equ 0001h ; play asynchronously
+SND_NODEFAULT equ 0002h ; don't use default sound
+SND_MEMORY equ 0004h ; lpszSoundName points to a memory file
+SND_LOOP equ 0008h ; loop the sound until next sndPlaySound
+SND_NOSTOP equ 0010h ; don't stop any currently playing sound
+SND_VALID equ 001Fh ;Internal
+
+endif ;ifndef MMNOSOUND
+
+
+ifndef MMNOWAVE
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;
+; Waveform audio support
+;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+; waveform audio error return values
+WAVERR_BADFORMAT equ (WAVERR_BASE + 0) ; unsupported wave format
+WAVERR_STILLPLAYING equ (WAVERR_BASE + 1) ; still something playing
+WAVERR_UNPREPARED equ (WAVERR_BASE + 2) ; header not prepared
+WAVERR_SYNC equ (WAVERR_BASE + 3) ; device is synchronous
+WAVERR_LASTERROR equ (WAVERR_BASE + 3) ; last error in range
+
+; wave callback messages
+WOM_OPEN equ MM_WOM_OPEN
+WOM_CLOSE equ MM_WOM_CLOSE
+WOM_DONE equ MM_WOM_DONE
+WIM_OPEN equ MM_WIM_OPEN
+WIM_CLOSE equ MM_WIM_CLOSE
+WIM_DATA equ MM_WIM_DATA
+
+; device ID for wave device mapper
+WAVE_MAPPER equ (-1)
+
+; flags for dwFlags parameter in waveOutOpen() and waveInOpen()
+WAVE_FORMAT_QUERY equ 0001h
+WAVE_ALLOWSYNC equ 0002h
+WAVE_VALID equ 0003h ;Internal
+
+; wave data block header
+WAVEHDR struc
+ lpWaveData dd ? ; pointer to locked data buffer
+ dwWaveBufferLength dd ? ; length of data buffer
+ dwWaveBytesRecorded dd ? ; used for input only
+ dwWaveUser dd ? ; for client's use
+ dwWaveFlags dd ? ; assorted flags (see defines)
+ dwWaveLoops dd ? ; loop control counter
+ lpWaveNext dd ? ; reserved for driver
+ Wavereserved dd ? ; reserved for driver
+WAVEHDR ends
+
+; flags for dwFlags field of WAVEHDR
+WHDR_DONE equ 00000001h ; done bit
+WHDR_PREPARED equ 00000002h ; set if this header has been prepared
+WHDR_BEGINLOOP equ 00000004h ; loop start block
+WHDR_ENDLOOP equ 00000008h ; loop end block
+WHDR_INQUEUE equ 00000010h ; reserved for driver
+WHDR_VALID equ 0000001Fh ;Internal
+
+; waveform output device capabilities structure
+WAVEOUTCAPS struc
+ woc_wMid dw ? ; manufacturer ID
+ woc_wPid dw ? ; product ID
+ woc_vDriverVersion dw ? ; version of the driver
+ woc_szPname db MAXPNAMELEN dup (?) ; product name (NULL terminated string)
+ woc_dwFormats dd ? ; formats supported
+ woc_wChannels dw ? ; number of sources supported
+ woc_dwSupport dd ? ; functionality supported by driver
+WAVEOUTCAPS ends
+
+; flags for dwSupport field of WAVEOUTCAPS
+WAVECAPS_PITCH equ 0001h ; supports pitch control
+WAVECAPS_PLAYBACKRATE equ 0002h ; supports playback rate control
+WAVECAPS_VOLUME equ 0004h ; supports volume control
+WAVECAPS_LRVOLUME equ 0008h ; separate left-right volume control
+WAVECAPS_SYNC equ 0010h
+
+; waveform input device capabilities structure
+WAVEINCAPS struc
+ wic_wMid dw ? ; manufacturer ID
+ wic_wPid dw ? ; product ID
+ wic_vDriverVersion dw ? ; version of the driver
+ wic_szPname db MAXPNAMELEN dup (?) ; product name (NULL terminated string)
+ wic_dwFormats dd ? ; formats supported
+ wic_wChannels dw ? ; number of channels supported
+WAVEINCAPS ends
+
+; defines for dwFormat field of WAVEINCAPS and WAVEOUTCAPS
+WAVE_INVALIDFORMAT equ 00000000h ; invalid format
+WAVE_FORMAT_1M08 equ 00000001h ; 11.025 kHz, Mono, 8-bit
+WAVE_FORMAT_1S08 equ 00000002h ; 11.025 kHz, Stereo, 8-bit
+WAVE_FORMAT_1M16 equ 00000004h ; 11.025 kHz, Mono, 16-bit
+WAVE_FORMAT_1S16 equ 00000008h ; 11.025 kHz, Stereo, 16-bit
+WAVE_FORMAT_2M08 equ 00000010h ; 22.05 kHz, Mono, 8-bit
+WAVE_FORMAT_2S08 equ 00000020h ; 22.05 kHz, Stereo, 8-bit
+WAVE_FORMAT_2M16 equ 00000040h ; 22.05 kHz, Mono, 16-bit
+WAVE_FORMAT_2S16 equ 00000080h ; 22.05 kHz, Stereo, 16-bit
+WAVE_FORMAT_4M08 equ 00000100h ; 44.1 kHz, Mono, 8-bit
+WAVE_FORMAT_4S08 equ 00000200h ; 44.1 kHz, Stereo, 8-bit
+WAVE_FORMAT_4M16 equ 00000400h ; 44.1 kHz, Mono, 16-bit
+WAVE_FORMAT_4S16 equ 00000800h ; 44.1 kHz, Stereo, 16-bit
+
+; general waveform format structure (information common to all formats)
+WAVEFORMAT struc
+ wfmt_wFormatTag dw ? ; format type
+ wfmt_nChannels dw ? ; number of channels (i.e. mono, stereo, etc.)
+ wfmt_nSamplesPerSec dd ? ; sample rate
+ wfmt_nAvgBytesPerSec dd ? ; for buffer estimation
+ wfmt_nBlockAlign dw ? ; block size of data
+WAVEFORMAT ends
+
+; flags for wFormatTag field of WAVEFORMAT
+WAVE_FORMAT_PCM equ 1
+
+; specific waveform format structure for PCM data
+PCMWAVEFORMAT struc
+ pcm_wf db (SIZE WAVEFORMAT) dup (?)
+ pcm_wBitsPerSample dw ?
+PCMWAVEFORMAT ends
+
+endif ;ifndef MMNOWAVE
+
+
+ifndef MMNOMIDI
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;
+; MIDI audio support
+;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+; MIDI error return values
+MIDIERR_UNPREPARED equ (MIDIERR_BASE + 0) ; header not prepared
+MIDIERR_STILLPLAYING equ (MIDIERR_BASE + 1) ; still something playing
+MIDIERR_NOMAP equ (MIDIERR_BASE + 2) ; no current map
+MIDIERR_NOTREADY equ (MIDIERR_BASE + 3) ; hardware is still busy
+MIDIERR_NODEVICE equ (MIDIERR_BASE + 4) ; port no longer connected
+MIDIERR_INVALIDSETUP equ (MIDIERR_BASE + 5) ; invalid setup
+MIDIERR_LASTERROR equ (MIDIERR_BASE + 5) ; last error in range
+
+; MIDI audio data types
+MIDIPATCHSIZE equ 128
+
+; MIDI callback messages
+MIM_OPEN equ MM_MIM_OPEN
+MIM_CLOSE equ MM_MIM_CLOSE
+MIM_DATA equ MM_MIM_DATA
+MIM_LONGDATA equ MM_MIM_LONGDATA
+MIM_ERROR equ MM_MIM_ERROR
+MIM_LONGERROR equ MM_MIM_LONGERROR
+MOM_OPEN equ MM_MOM_OPEN
+MOM_CLOSE equ MM_MOM_CLOSE
+MOM_DONE equ MM_MOM_DONE
+
+; device ID for MIDI mapper
+MIDIMAPPER equ (-1)
+MIDI_MAPPER equ (-1)
+
+; flags for wFlags parm of midiOutCachePatches(),
+; midiOutCacheDrumPatches()
+MIDI_CACHE_ALL equ 1
+MIDI_CACHE_BESTFIT equ 2
+MIDI_CACHE_QUERY equ 3
+MIDI_UNCACHE equ 4
+
+; MIDI output device capabilities structure
+MIDIOUTCAPS struc
+ moc_wMid dw ? ; manufacturer ID
+ moc_wPid dw ? ; product ID
+ moc_vDriverVersion dw ? ; version of the driver
+ moc_szPname db MAXPNAMELEN dup (?) ; product name (NULL terminated string)
+ moc_wTechnology dw ? ; type of device
+ moc_wVoices dw ? ; # of voices (internal synth only)
+ moc_wNotes dw ? ; max # of notes (internal synth only)
+ moc_wChannelMask dw ? ; channels used (internal synth only)
+ moc_dwSupport dd ? ; functionality supported by driver
+MIDIOUTCAPS ends
+
+; flags for wTechnology field of MIDIOUTCAPS structure
+MOD_MIDIPORT equ 1 ; output port
+MOD_SYNTH equ 2 ; generic internal synth
+MOD_SQSYNTH equ 3 ; square wave internal synth
+MOD_FMSYNTH equ 4 ; FM internal synth
+MOD_MAPPER equ 5 ; MIDI mapper
+
+; flags for dwSupport field of MIDIOUTCAPS structure
+MIDICAPS_VOLUME equ 0001h ; supports volume control
+MIDICAPS_LRVOLUME equ 0002h ; separate left-right volume control
+MIDICAPS_CACHE equ 0004h
+
+; MIDI output device capabilities structure
+MIDIINCAPS struc
+ mic_wMid dw ? ; manufacturer ID
+ mic_wPid dw ? ; product ID
+ mic_vDriverVersion dw ? ; version of the driver
+ mic_szPname db MAXPNAMELEN dup (?) ; product name (NULL terminated string)
+MIDIINCAPS ends
+
+; MIDI data block header
+MIDIHDR struc
+ lpMidiData dd ? ; pointer to locked data block
+ dwMidiBufferLength dd ? ; length of data in data block
+ dwMidiBytesRecorded dd ? ; used for input only
+ dwMidiUser dd ? ; for client's use
+ dwMidiFlags dd ? ; assorted flags (see defines)
+ lpMidiNext dd ? ; reserved for driver
+ Midireserved dd ? ; reserved for driver
+MIDIHDR ends
+
+; flags for dwFlags field of MIDIHDR structure
+MHDR_DONE equ 00000001h ; done bit
+MHDR_PREPARED equ 00000002h ; set if header prepared
+MHDR_INQUEUE equ 00000004h ; reserved for driver
+MHDR_VALID equ 00000007h ;Internal
+
+endif ;ifndef MMNOMIDI
+
+
+ifndef MMNOAUX
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;
+; Auxiliary audio support
+;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+; device ID for aux device mapper
+AUX_MAPPER equ (-1)
+
+; Auxiliary audio device capabilities structure
+AUXCAPS struc
+ acaps_wMid dw ? ; manufacturer ID
+ acaps_wPid dw ? ; product ID
+ acaps_vDriverVersion dw ? ; version of the driver
+ acaps_szPname db MAXPNAMELEN dup (?) ; product name (NULL terminated string)
+ acaps_wTechnology dw ? ; type of device
+ acaps_dwSupport dd ? ; functionality supported by driver
+AUXCAPS ends
+
+; flags for wTechnology field in AUXCAPS structure
+AUXCAPS_CDAUDIO equ 1 ; audio from internal CD-ROM drive
+AUXCAPS_AUXIN equ 2 ; audio from auxiliary input jacks
+
+; flags for dwSupport field in AUXCAPS structure
+AUXCAPS_VOLUME equ 0001h ; supports volume control
+AUXCAPS_LRVOLUME equ 0002h ; separate left-right volume control
+
+endif ;ifndef MMNOAUX
+
+
+ifndef MMNOTIMER
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;
+; Timer support
+;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+; timer error return values
+TIMERR_NOERROR equ (0) ; no error
+TIMERR_NOCANDO equ (TIMERR_BASE+1) ; request not completed
+TIMERR_STRUCT equ (TIMERR_BASE+33) ; time struct size
+
+; flags for wFlags parameter of timeSetEvent() function
+TIME_ONESHOT equ 0 ; program timer for single event
+TIME_PERIODIC equ 1 ; program for continuous periodic event
+
+; timer device capabilities data structure
+TIMECAPS struc
+ tc_wPeriodMin dw ? ; minimum period supported
+ tc_wPeriodMax dw ? ; maximum period supported
+TIMECAPS ends
+
+endif ;ifndef MMNOTIMER
+
+
+ifndef MMNOJOY
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;
+; Joystick support
+;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+; joystick error return values
+JOYERR_NOERROR equ (0) ; no error
+JOYERR_PARMS equ (JOYERR_BASE+5) ; bad parameters
+JOYERR_NOCANDO equ (JOYERR_BASE+6) ; request not completed
+JOYERR_UNPLUGGED equ (JOYERR_BASE+7) ; joystick is unplugged
+
+; constants used with JOYINFO structure and MM_JOY* messages
+JOY_BUTTON1 equ 0001h
+JOY_BUTTON2 equ 0002h
+JOY_BUTTON3 equ 0004h
+JOY_BUTTON4 equ 0008h
+JOY_BUTTON1CHG equ 0100h
+JOY_BUTTON2CHG equ 0200h
+JOY_BUTTON3CHG equ 0400h
+JOY_BUTTON4CHG equ 0800h
+
+; joystick ID constants
+JOYSTICKID1 equ 0
+JOYSTICKID2 equ 1
+
+; joystick device capabilities data structure
+JOYCAPS struc
+ jcaps_wMid dw ? ; manufacturer ID
+ jcaps_wPid dw ? ; product ID
+ jcaps_szPname db MAXPNAMELEN dup (?) ; product name (NULL terminated string)
+ jcaps_wXmin dw ? ; minimum x position value
+ jcaps_wXmax dw ? ; maximum x position value
+ jcaps_wYmin dw ? ; minimum y position value
+ jcaps_wYmax dw ? ; maximum y position value
+ jcaps_wZmin dw ? ; minimum z position value
+ jcaps_wZmax dw ? ; maximum z position value
+ jcaps_wNumButtons dw ? ; number of buttons
+ jcaps_wPeriodMin dw ? ; minimum message period when captured
+ jcaps_wPeriodMax dw ? ; maximum message period when captured
+JOYCAPS ends
+
+; joystick information data structure
+JOYINFO struc
+ jinfo_wXpos dw ? ; x position
+ jinfo_wYpos dw ? ; y position
+ jinfo_wZpos dw ? ; z position
+ jinfo_wButtons dw ? ; button states
+JOYINFO ends
+
+endif ;ifndef MMNOJOY
+
+ifndef MMNOMMIO
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;
+; Multimedia File I/O support
+;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+; MMIO error return values
+MMIOERR_BASE equ 256
+MMIOERR_FILENOTFOUND equ (MMIOERR_BASE + 1) ; file not found
+MMIOERR_OUTOFMEMORY equ (MMIOERR_BASE + 2) ; out of memory
+MMIOERR_CANNOTOPEN equ (MMIOERR_BASE + 3) ; cannot open
+MMIOERR_CANNOTCLOSE equ (MMIOERR_BASE + 4) ; cannot close
+MMIOERR_CANNOTREAD equ (MMIOERR_BASE + 5) ; cannot read
+MMIOERR_CANNOTWRITE equ (MMIOERR_BASE + 6) ; cannot write
+MMIOERR_CANNOTSEEK equ (MMIOERR_BASE + 7) ; cannot seek
+MMIOERR_CANNOTEXPAND equ (MMIOERR_BASE + 8) ; cannot expand file
+MMIOERR_CHUNKNOTFOUND equ (MMIOERR_BASE + 9) ; chunk not found
+MMIOERR_UNBUFFERED equ (MMIOERR_BASE + 10) ; file is unbuffered
+
+; MMIO constants
+CFSEPCHAR equ '+' ; compound file name separator char.
+
+; general MMIO information data structure
+MMIOINFO struc
+ ; general fields
+ mmio_dwFlags dd ? ; general status flags
+ mmio_fccIOProc dd ? ; pointer to I/O procedure
+ mmio_pIOProc dd ? ; pointer to I/O procedure
+ mmio_wErrorRet dw ? ; place for error to be returned
+ mmio_htask dw ? ; alternate local task
+
+ ; fields maintained by MMIO functions during buffered I/O
+ mmio_cchBuffer dd ? ; size of I/O buffer (or 0L)
+ mmio_pchBuffer dd ? ; start of I/O buffer (or NULL)
+ mmio_pchNext dd ? ; pointer to next byte to read/write
+ mmio_pchEndRead dd ? ; pointer to last valid byte to read
+ mmio_pchEndWrite dd ? ; pointer to last byte to write
+ mmio_lBufOffset dd ? ; disk offset of start of buffer
+
+ ; fields maintained by I/O procedure
+ mmio_lDiskOffset dd ? ; disk offset of next read or write
+ mmio_adwInfo dd 3 dup (?) ; data specific to type of MMIOPROC
+
+ ; other fields maintained by MMIO
+ mmio_dwReserved1 dd ? ; reserved for MMIO use
+ mmio_dwReserved2 dd ? ; reserved for MMIO use
+ mmio_hmmio dw ? ; handle to open file
+MMIOINFO ends
+
+; RIFF chunk information data structure
+MMCKINFO struc
+ mmck_ckid dd ? ; chunk ID
+ mmck_cksize dd ? ; chunk size
+ mmck_fccType dd ? ; form type or list type
+ mmck_dwDataOffset dd ? ; offset of data portion of chunk
+ mmck_dwFlags dd ? ; flags used by MMIO functions
+MMCKINFO ends
+
+; bit field masks
+MMIO_RWMODE equ 00000003h ; open file for reading/writing/both
+MMIO_SHAREMODE equ 00000070h ; file sharing mode number
+
+; constants for dwFlags field of MMIOINFO
+MMIO_CREATE equ 00001000h ; create new file (or truncate file)
+MMIO_PARSE equ 00000100h ; parse new file returning path
+MMIO_DELETE equ 00000200h ; create new file (or truncate file)
+MMIO_EXIST equ 00004000h ; checks for existence of file
+MMIO_ALLOCBUF equ 00010000h ; mmioOpen() should allocate a buffer
+MMIO_GETTEMP equ 00020000h ; mmioOpen() should retrieve temp name
+
+MMIO_DIRTY equ 10000000h ; I/O buffer is dirty
+
+MMIO_OPEN_VALID equ 0003FFFFh ;Internal
+
+; read/write mode numbers (bit field MMIO_RWMODE)
+MMIO_READ equ 00000000h ; open file for reading only
+MMIO_WRITE equ 00000001h ; open file for writing only
+MMIO_READWRITE equ 00000002h ; open file for reading and writing
+
+; share mode numbers (bit field MMIO_SHAREMODE)
+MMIO_COMPAT equ 00000000h ; compatibility mode
+MMIO_EXCLUSIVE equ 00000010h ; exclusive-access mode
+MMIO_DENYWRITE equ 00000020h ; deny writing to other processes
+MMIO_DENYREAD equ 00000030h ; deny reading to other processes
+MMIO_DENYNONE equ 00000040h ; deny nothing to other processes
+
+; various MMIO flags
+MMIO_FHOPEN equ 0010h ; mmioClose: keep file handle open
+MMIO_EMPTYBUF equ 0010h ; mmioFlush: empty the I/O buffer
+MMIO_TOUPPER equ 0010h ; mmioStringToFOURCC: to u-case
+MMIO_INSTALLPROC equ 00010000h ; mmioInstallIOProc: install MMIOProc
+MMIO_GLOBALPROC equ 10000000h ; mmioInstallIOProc: install globally
+MMIO_REMOVEPROC equ 00020000h ; mmioInstallIOProc: remove MMIOProc
+MMIO_FINDPROC equ 00040000h ; mmioInstallIOProc: find an MMIOProc
+MMIO_FINDCHUNK equ 0010h ; mmioDescend: find a chunk by ID
+MMIO_FINDRIFF equ 0020h ; mmioDescend: find a LIST chunk
+MMIO_FINDLIST equ 0040h ; mmioDescend: find a RIFF chunk
+MMIO_CREATERIFF equ 0020h ; mmioCreateChunk: make a LIST chunk
+MMIO_CREATELIST equ 0040h ; mmioCreateChunk: make a RIFF chunk
+
+MMIO_VALIDPROC equ 10070000h ;Internal
+
+; message numbers for MMIOPROC I/O procedure functions
+MMIOM_READ equ MMIO_READ ; read
+MMIOM_WRITE equ MMIO_WRITE ; write
+MMIOM_SEEK equ 2 ; seek to a new position in file
+MMIOM_OPEN equ 3 ; open file
+MMIOM_CLOSE equ 4 ; close file
+MMIOM_WRITEFLUSH equ 5 ; write and flush
+MMIOM_RENAME equ 6 ; rename specified file
+MMIOM_USER equ 8000h ; beginning of user-defined messages
+
+mmioFOURCC MACRO ch0,ch1,ch2,ch3
+ mov al,ch0
+ mov ah,ch1
+ mov dl,ch2
+ mov dh,ch3
+ ENDM
+
+; standard four character codes
+FOURCC_RIFF equ mmioFOURCC('R', 'I', 'F', 'F')
+FOURCC_LIST equ mmioFOURCC('L', 'I', 'S', 'T')
+
+; four character codes used to identify standard built-in I/O procedures
+FOURCC_DOS equ mmioFOURCC('D', 'O', 'S', ' ')
+FOURCC_MEM equ mmioFOURCC('M', 'E', 'M', ' ')
+
+; flags for mmioSeek()
+ifndef SEEK_SET
+SEEK_SET equ 0 ; seek to an absolute position
+SEEK_CUR equ 1 ; seek relative to current position
+SEEK_END equ 2 ; seek relative to end of file
+endif ;ifndef SEEK_SET
+
+; other constants
+MMIO_DEFAULTBUFFER equ 8192 ; default buffer size
+
+endif ;ifndef MMNOMMIO
+
+ifndef MMNOMCI
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;
+; MCI support
+;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+; MCI error return values
+MCIERR_INVALID_DEVICE_ID equ (MCIERR_BASE + 1)
+MCIERR_UNRECOGNIZED_KEYWORD equ (MCIERR_BASE + 3)
+MCIERR_UNRECOGNIZED_COMMAND equ (MCIERR_BASE + 5)
+MCIERR_HARDWARE equ (MCIERR_BASE + 6)
+MCIERR_INVALID_DEVICE_NAME equ (MCIERR_BASE + 7)
+MCIERR_OUT_OF_MEMORY equ (MCIERR_BASE + 8)
+MCIERR_DEVICE_OPEN equ (MCIERR_BASE + 9)
+MCIERR_CANNOT_LOAD_DRIVER equ (MCIERR_BASE + 10)
+MCIERR_MISSING_COMMAND_STRING equ (MCIERR_BASE + 11)
+MCIERR_PARAM_OVERFLOW equ (MCIERR_BASE + 12)
+MCIERR_MISSING_STRING_ARGUMENT equ (MCIERR_BASE + 13)
+MCIERR_BAD_INTEGER equ (MCIERR_BASE + 14)
+MCIERR_PARSER_INTERNAL equ (MCIERR_BASE + 15)
+MCIERR_DRIVER_INTERNAL equ (MCIERR_BASE + 16)
+MCIERR_MISSING_PARAMETER equ (MCIERR_BASE + 17)
+MCIERR_UNSUPPORTED_FUNCTION equ (MCIERR_BASE + 18)
+MCIERR_FILE_NOT_FOUND equ (MCIERR_BASE + 19)
+MCIERR_DEVICE_NOT_READY equ (MCIERR_BASE + 20)
+MCIERR_INTERNAL equ (MCIERR_BASE + 21)
+MCIERR_DRIVER equ (MCIERR_BASE + 22)
+MCIERR_CANNOT_USE_ALL equ (MCIERR_BASE + 23)
+MCIERR_MULTIPLE equ (MCIERR_BASE + 24)
+MCIERR_EXTENSION_NOT_FOUND equ (MCIERR_BASE + 25)
+MCIERR_OUTOFRANGE equ (MCIERR_BASE + 26)
+MCIERR_FLAGS_NOT_COMPATIBLE equ (MCIERR_BASE + 28)
+MCIERR_FILE_NOT_SAVED equ (MCIERR_BASE + 30)
+MCIERR_DEVICE_TYPE_REQUIRED equ (MCIERR_BASE + 31)
+MCIERR_DEVICE_LOCKED equ (MCIERR_BASE + 32)
+MCIERR_DUPLICATE_ALIAS equ (MCIERR_BASE + 33)
+MCIERR_BAD_CONSTANT equ (MCIERR_BASE + 34)
+MCIERR_MUST_USE_SHAREABLE equ (MCIERR_BASE + 35)
+MCIERR_MISSING_DEVICE_NAME equ (MCIERR_BASE + 36)
+MCIERR_BAD_TIME_FORMAT equ (MCIERR_BASE + 37)
+MCIERR_NO_CLOSING_QUOTE equ (MCIERR_BASE + 38)
+MCIERR_DUPLICATE_FLAGS equ (MCIERR_BASE + 39)
+MCIERR_INVALID_FILE equ (MCIERR_BASE + 40)
+MCIERR_NULL_PARAMETER_BLOCK equ (MCIERR_BASE + 41)
+MCIERR_UNNAMED_RESOURCE equ (MCIERR_BASE + 42)
+MCIERR_NEW_REQUIRES_ALIAS equ (MCIERR_BASE + 43)
+MCIERR_NOTIFY_ON_AUTO_OPEN equ (MCIERR_BASE + 44)
+MCIERR_NO_ELEMENT_ALLOWED equ (MCIERR_BASE + 45)
+MCIERR_NONAPPLICABLE_FUNCTION equ (MCIERR_BASE + 46)
+MCIERR_ILLEGAL_FOR_AUTO_OPEN equ (MCIERR_BASE + 47)
+MCIERR_FILENAME_REQUIRED equ (MCIERR_BASE + 48)
+MCIERR_EXTRA_CHARACTERS equ (MCIERR_BASE + 49)
+MCIERR_DEVICE_NOT_INSTALLED equ (MCIERR_BASE + 50)
+MCIERR_GET_CD equ (MCIERR_BASE + 51)
+MCIERR_SET_CD equ (MCIERR_BASE + 52)
+MCIERR_SET_DRIVE equ (MCIERR_BASE + 53)
+MCIERR_DEVICE_LENGTH equ (MCIERR_BASE + 54)
+MCIERR_DEVICE_ORD_LENGTH equ (MCIERR_BASE + 55)
+MCIERR_NO_INTEGER equ (MCIERR_BASE + 56)
+
+MCIERR_WAVE_OUTPUTSINUSE equ (MCIERR_BASE + 64)
+MCIERR_WAVE_SETOUTPUTINUSE equ (MCIERR_BASE + 65)
+MCIERR_WAVE_INPUTSINUSE equ (MCIERR_BASE + 66)
+MCIERR_WAVE_SETINPUTINUSE equ (MCIERR_BASE + 67)
+MCIERR_WAVE_OUTPUTUNSPECIFIED equ (MCIERR_BASE + 68)
+MCIERR_WAVE_INPUTUNSPECIFIED equ (MCIERR_BASE + 69)
+MCIERR_WAVE_OUTPUTSUNSUITABLE equ (MCIERR_BASE + 70)
+MCIERR_WAVE_SETOUTPUTUNSUITABLE equ (MCIERR_BASE + 71)
+MCIERR_WAVE_INPUTSUNSUITABLE equ (MCIERR_BASE + 72)
+MCIERR_WAVE_SETINPUTUNSUITABLE equ (MCIERR_BASE + 73)
+
+MCIERR_SEQ_DIV_INCOMPATIBLE equ (MCIERR_BASE + 80)
+MCIERR_SEQ_PORT_INUSE equ (MCIERR_BASE + 81)
+MCIERR_SEQ_PORT_NONEXISTENT equ (MCIERR_BASE + 82)
+MCIERR_SEQ_PORT_MAPNODEVICE equ (MCIERR_BASE + 83)
+MCIERR_SEQ_PORT_MISCERROR equ (MCIERR_BASE + 84)
+MCIERR_SEQ_TIMER equ (MCIERR_BASE + 85)
+MCIERR_SEQ_PORTUNSPECIFIED equ (MCIERR_BASE + 86)
+MCIERR_SEQ_NOMIDIPRESENT equ (MCIERR_BASE + 87)
+
+MCIERR_NO_WINDOW equ (MCIERR_BASE + 90)
+MCIERR_CREATEWINDOW equ (MCIERR_BASE + 91)
+MCIERR_FILE_READ equ (MCIERR_BASE + 92)
+MCIERR_FILE_WRITE equ (MCIERR_BASE + 93)
+
+; all custom device driver errors must be >= than this value
+MCIERR_CUSTOM_DRIVER_BASE equ (MCIERR_BASE + 256)
+
+; MCI command message identifiers
+MCI_OPEN equ 0803h
+MCI_CLOSE equ 0804h
+MCI_ESCAPE equ 0805h
+MCI_PLAY equ 0806h
+MCI_SEEK equ 0807h
+MCI_STOP equ 0808h
+MCI_PAUSE equ 0809h
+MCI_INFO equ 080Ah
+MCI_GETDEVCAPS equ 080Bh
+MCI_SPIN equ 080Ch
+MCI_SET equ 080Dh
+MCI_STEP equ 080Eh
+MCI_RECORD equ 080Fh
+MCI_SYSINFO equ 0810h
+MCI_BREAK equ 0811h
+MCI_SOUND equ 0812h
+MCI_SAVE equ 0813h
+MCI_STATUS equ 0814h
+MCI_CUE equ 0830h
+MCI_REALIZE equ 0840h
+MCI_WINDOW equ 0841h
+MCI_PUT equ 0842h
+MCI_WHERE equ 0843h
+MCI_FREEZE equ 0844h
+MCI_UNFREEZE equ 0845h
+MCI_LOAD equ 0850h
+MCI_CUT equ 0851h
+MCI_COPY equ 0852h
+MCI_PASTE equ 0853h
+MCI_UPDATE equ 0854h
+MCI_RESUME equ 0855h
+MCI_DELETE equ 0856h
+
+; all custom MCI command messages must be >= than this value
+MCI_USER_MESSAGES equ (400h + DRV_MCI_FIRST)
+
+
+; device ID for "all devices"
+MCI_ALL_DEVICE_ID equ 0FFFFh
+
+; constants for predefined MCI device types
+MCI_DEVTYPE_VCR equ (MCI_STRING_OFFSET + 1)
+MCI_DEVTYPE_VIDEODISC equ (MCI_STRING_OFFSET + 2)
+MCI_DEVTYPE_OVERLAY equ (MCI_STRING_OFFSET + 3)
+MCI_DEVTYPE_CD_AUDIO equ (MCI_STRING_OFFSET + 4)
+MCI_DEVTYPE_DAT equ (MCI_STRING_OFFSET + 5)
+MCI_DEVTYPE_SCANNER equ (MCI_STRING_OFFSET + 6)
+MCI_DEVTYPE_ANIMATION equ (MCI_STRING_OFFSET + 7)
+MCI_DEVTYPE_DIGITAL_VIDEO equ (MCI_STRING_OFFSET + 8)
+MCI_DEVTYPE_OTHER equ (MCI_STRING_OFFSET + 9)
+MCI_DEVTYPE_WAVEFORM_AUDIO equ (MCI_STRING_OFFSET + 10)
+MCI_DEVTYPE_SEQUENCER equ (MCI_STRING_OFFSET + 11)
+
+MCI_DEVTYPE_FIRST equ MCI_DEVTYPE_VCR
+MCI_DEVTYPE_LAST equ MCI_DEVTYPE_SEQUENCER
+
+; return values for 'status mode' command
+MCI_MODE_NOT_READY equ (MCI_STRING_OFFSET + 12)
+MCI_MODE_STOP equ (MCI_STRING_OFFSET + 13)
+MCI_MODE_PLAY equ (MCI_STRING_OFFSET + 14)
+MCI_MODE_RECORD equ (MCI_STRING_OFFSET + 15)
+MCI_MODE_SEEK equ (MCI_STRING_OFFSET + 16)
+MCI_MODE_PAUSE equ (MCI_STRING_OFFSET + 17)
+MCI_MODE_OPEN equ (MCI_STRING_OFFSET + 18)
+
+; constants used in 'set time format' and 'status time format' commands
+MCI_FORMAT_MILLISECONDS equ 0
+MCI_FORMAT_HMS equ 1
+MCI_FORMAT_MSF equ 2
+MCI_FORMAT_FRAMES equ 3
+MCI_FORMAT_SMPTE_24 equ 4
+MCI_FORMAT_SMPTE_25 equ 5
+MCI_FORMAT_SMPTE_30 equ 6
+MCI_FORMAT_SMPTE_30DROP equ 7
+MCI_FORMAT_BYTES equ 8
+MCI_FORMAT_SAMPLES equ 9
+MCI_FORMAT_TMSF equ 10
+
+; flags for wParam of MM_MCINOTIFY message
+MCI_NOTIFY_SUCCESSFUL equ 0001h
+MCI_NOTIFY_SUPERSEDED equ 0002h
+MCI_NOTIFY_ABORTED equ 0004h
+MCI_NOTIFY_FAILURE equ 0008h
+
+
+; common flags for dwFlags parameter of MCI command messages
+MCI_NOTIFY equ 00000001h
+MCI_WAIT equ 00000002h
+MCI_FROM equ 00000004h
+MCI_TO equ 00000008h
+MCI_TRACK equ 00000010h
+
+; flags for dwFlags parameter of MCI_OPEN command message
+MCI_OPEN_SHAREABLE equ 00000100h
+MCI_OPEN_ELEMENT equ 00000200h
+MCI_OPEN_ALIAS equ 00000400h
+MCI_OPEN_ELEMENT_ID equ 00000800h
+MCI_OPEN_TYPE_ID equ 00001000h
+MCI_OPEN_TYPE equ 00002000h
+
+; flags for dwFlags parameter of MCI_SEEK command message
+MCI_SEEK_TO_START equ 00000100h
+MCI_SEEK_TO_END equ 00000200h
+
+; flags for dwFlags parameter of MCI_STATUS command message
+MCI_STATUS_ITEM equ 00000100h
+MCI_STATUS_START equ 00000200h
+
+; flags for dwItem field of the MCI_STATUS_PARMS parameter block
+MCI_STATUS_LENGTH equ 00000001h
+MCI_STATUS_POSITION equ 00000002h
+MCI_STATUS_NUMBER_OF_TRACKS equ 00000003h
+MCI_STATUS_MODE equ 00000004h
+MCI_STATUS_MEDIA_PRESENT equ 00000005h
+MCI_STATUS_TIME_FORMAT equ 00000006h
+MCI_STATUS_READY equ 00000007h
+MCI_STATUS_CURRENT_TRACK equ 00000008h
+
+; flags for dwFlags parameter of MCI_INFO command message
+MCI_INFO_PRODUCT equ 00000100h
+MCI_INFO_FILE equ 00000200h
+
+; flags for dwFlags parameter of MCI_GETDEVCAPS command message
+MCI_GETDEVCAPS_ITEM equ 00000100h
+
+; flags for dwItem field of the MCI_GETDEVCAPS_PARMS parameter block
+MCI_GETDEVCAPS_CAN_RECORD equ 00000001h
+MCI_GETDEVCAPS_HAS_AUDIO equ 00000002h
+MCI_GETDEVCAPS_HAS_VIDEO equ 00000003h
+MCI_GETDEVCAPS_DEVICE_TYPE equ 00000004h
+MCI_GETDEVCAPS_USES_FILES equ 00000005h
+MCI_GETDEVCAPS_COMPOUND_DEVICE equ 00000006h
+MCI_GETDEVCAPS_CAN_EJECT equ 00000007h
+MCI_GETDEVCAPS_CAN_PLAY equ 00000008h
+MCI_GETDEVCAPS_CAN_SAVE equ 00000009h
+
+; flags for dwFlags parameter of MCI_SYSINFO command message
+MCI_SYSINFO_QUANTITY equ 00000100h
+MCI_SYSINFO_OPEN equ 00000200h
+MCI_SYSINFO_NAME equ 00000400h
+MCI_SYSINFO_INSTALLNAME equ 00000800h
+
+; flags for dwFlags parameter of MCI_SET command message
+MCI_SET_DOOR_OPEN equ 00000100h
+MCI_SET_DOOR_CLOSED equ 00000200h
+MCI_SET_TIME_FORMAT equ 00000400h
+MCI_SET_AUDIO equ 00000800h
+MCI_SET_VIDEO equ 00001000h
+MCI_SET_ON equ 00002000h
+MCI_SET_OFF equ 00004000h
+
+; flags for dwAudio field of MCI_SET_PARMS or MCI_SEQ_SET_PARMS
+MCI_SET_AUDIO_ALL equ 00000000h
+MCI_SET_AUDIO_LEFT equ 00000001h
+MCI_SET_AUDIO_RIGHT equ 00000002h
+
+; flags for dwFlags parameter of MCI_BREAK command message
+MCI_BREAK_KEY equ 00000100h
+MCI_BREAK_HWND equ 00000200h
+MCI_BREAK_OFF equ 00000400h
+
+; flags for dwFlags parameter of MCI_RECORD command message
+MCI_RECORD_INSERT equ 00000100h
+MCI_RECORD_OVERWRITE equ 00000200h
+
+; flags for dwFlags parameter of MCI_SOUND command message
+MCI_SOUND_NAME equ 00000100h
+
+; flags for dwFlags parameter of MCI_SAVE command message
+MCI_SAVE_FILE equ 00000100h
+
+; flags for dwFlags parameter of MCI_LOAD command message
+MCI_LOAD_FILE equ 00000100h
+
+; generic parameter block for MCI command messages with no special parameters
+MCI_GENERIC_PARMS struc
+ mcigen_dwCallback dd ?
+MCI_GENERIC_PARMS ends
+
+; parameter block for MCI_OPEN command message
+MCI_OPEN_PARMS struc
+ mciopen_dwCallback dd ?
+ mciopen_wDeviceID dw ?
+ mciopen_wReserved0 dw ?
+ mciopen_lpstrDeviceType dd ?
+ mciopen_lpstrElementName dd ?
+ mciopen_lpstrAlias dd ?
+MCI_OPEN_PARMS ends
+
+; parameter block for MCI_PLAY command message
+MCI_PLAY_PARMS struc
+ mciplay_dwCallback dd ?
+ mciplay_dwFrom dd ?
+ mciplay_dwTo dd ?
+MCI_PLAY_PARMS ends
+
+; parameter block for MCI_SEEK command message
+MCI_SEEK_PARMS struc
+ mciseek_dwCallback dd ?
+ mciseek_dwTo dd ?
+MCI_SEEK_PARMS ends
+
+; parameter block for MCI_STATUS command message
+MCI_STATUS_PARMS struc
+ mcistat_dwCallback dd ?
+ mcistat_dwReturn dd ?
+ mcistat_dwItem dd ?
+ mcistat_dwTrack dd ?
+MCI_STATUS_PARMS ends
+
+; parameter block for MCI_INFO command message
+MCI_INFO_PARMS struc
+ mciinfo_dwCallback dd ?
+ mciinfo_lpstrReturn dd ?
+ mciinfo_dwRetSize dd ?
+MCI_INFO_PARMS ends
+
+; parameter block for MCI_GETDEVCAPS command message
+MCI_GETDEVCAPS_PARMS struc
+ mcigdc_dwCallback dd ?
+ mcigdc_dwReturn dd ?
+ mcigdc_dwItem dd ?
+MCI_GETDEVCAPS_PARMS ends
+
+; parameter block for MCI_SYSINFO command message
+MCI_SYSINFO_PARMS struc
+ mcisi_dwCallback dd ?
+ mcisi_lpstrReturn dd ?
+ mcisi_dwRetSize dd ?
+ mcisi_dwNumber dd ?
+ mcisi_wDeviceType dw ?
+ mcisi_wReserved0 dw ?
+MCI_SYSINFO_PARMS ends
+
+; parameter block for MCI_SET command message
+MCI_SET_PARMS struc
+ mciset_dwCallback dd ?
+ mciset_dwTimeFormat dd ?
+ mciset_dwAudio dd ?
+MCI_SET_PARMS ends
+
+; parameter block for MCI_BREAK command message
+MCI_BREAK_PARMS struc
+ mcibreak_dwCallback dd ?
+ mcibreak_nVirtKey dw ?
+ mcibreak_wReserved0 dw ?
+ mcibreak_hwndBreak dw ?
+ mcibreak_wReserved1 dw ?
+MCI_BREAK_PARMS ends
+
+; parameter block for MCI_SOUND command message
+MCI_SOUND_PARMS struc
+ mcisnd_dwCallback dd ?
+ mcisnd_lpstrSoundName dd ?
+MCI_SOUND_PARMS ends
+
+; parameter block for MCI_SAVE command message
+MCI_SAVE_PARMS struc
+ mcisave_dwCallback dd ?
+ mcisave_lpfilename dd ?
+MCI_SAVE_PARMS ends
+
+; parameter block for MCI_LOAD command message
+MCI_LOAD_PARMS struc
+ mciload_dwCallback dd ?
+ mciload_lpfilename dd ?
+MCI_LOAD_PARMS ends
+
+; parameter block for MCI_RECORD command message
+MCI_RECORD_PARMS struc
+ mcirec_dwCallback dd ?
+ mcirec_dwFrom dd ?
+ mcirec_dwTo dd ?
+MCI_RECORD_PARMS ends
+
+
+;
+; MCI extensions for videodisc devices
+;
+
+; flag for dwReturn field of MCI_STATUS_PARMS
+; MCI_STATUS command, (dwItem == MCI_STATUS_MODE)
+MCI_VD_MODE_PARK equ (MCI_VD_OFFSET + 1)
+
+; flag for dwReturn field of MCI_STATUS_PARMS
+; MCI_STATUS command, (dwItem == MCI_VD_STATUS_MEDIA_TYPE)
+MCI_VD_MEDIA_CLV equ (MCI_VD_OFFSET + 2)
+MCI_VD_MEDIA_CAV equ (MCI_VD_OFFSET + 3)
+MCI_VD_MEDIA_OTHER equ (MCI_VD_OFFSET + 4)
+
+MCI_VD_FORMAT_TRACK equ 4001h
+
+; flags for dwFlags parameter of MCI_PLAY command message
+MCI_VD_PLAY_REVERSE equ 00010000h
+MCI_VD_PLAY_FAST equ 00020000h
+MCI_VD_PLAY_SPEED equ 00040000h
+MCI_VD_PLAY_SCAN equ 00080000h
+MCI_VD_PLAY_SLOW equ 00100000h
+
+; flag for dwFlags parameter of MCI_SEEK command message
+MCI_VD_SEEK_REVERSE equ 00010000h
+
+; flags for dwItem field of MCI_STATUS_PARMS parameter block
+MCI_VD_STATUS_SPEED equ 00004002h
+MCI_VD_STATUS_FORWARD equ 00004003h
+MCI_VD_STATUS_MEDIA_TYPE equ 00004004h
+MCI_VD_STATUS_SIDE equ 00004005h
+MCI_VD_STATUS_DISC_SIZE equ 00004006h
+
+; flags for dwFlags parameter of MCI_GETDEVCAPS command message
+MCI_VD_GETDEVCAPS_CLV equ 00010000h
+MCI_VD_GETDEVCAPS_CAV equ 00020000h
+
+MCI_VD_SPIN_UP equ 0001h
+MCI_VD_SPIN_DOWN equ 0002h
+
+; flags for dwItem field of MCI_GETDEVCAPS_PARMS parameter block
+MCI_VD_GETDEVCAPS_CAN_REVERSE equ 00004002h
+MCI_VD_GETDEVCAPS_FAST_RATE equ 00004003h
+MCI_VD_GETDEVCAPS_SLOW_RATE equ 00004004h
+MCI_VD_GETDEVCAPS_NORMAL_RATE equ 00004005h
+
+; flags for the dwFlags parameter of MCI_STEP command message
+MCI_VD_STEP_FRAMES equ 00010000h
+MCI_VD_STEP_REVERSE equ 00020000h
+
+; flag for the MCI_ESCAPE command message
+MCI_VD_ESCAPE_STRING equ 00000100h
+
+; parameter block for MCI_PLAY command message
+MCI_VD_PLAY_PARMS struc
+ mcivdplay_dwCallback dd ?
+ mcivdplay_dwFrom dd ?
+ mcivdplay_dwTo dd ?
+ mcivdplay_dwSpeed dd ?
+MCI_VD_PLAY_PARMS ends
+
+; parameter block for MCI_STEP command message
+MCI_VD_STEP_PARMS struc
+ mcivdstep_dwCallback dd ?
+ mcivdstep_dwFrames dd ?
+MCI_VD_STEP_PARMS ends
+
+; parameter block for MCI_ESCAPE command message
+MCI_VD_ESCAPE_PARMS struc
+ mcivcesc_dwCallback dd ?
+ mcivcesc_lpstrCommand dd ?
+MCI_VD_ESCAPE_PARMS ends
+
+
+;
+; MCI extensions for waveform audio devices
+;
+
+; flags for the dwFlags parameter of MCI_OPEN command message
+MCI_WAVE_OPEN_BUFFER equ 00010000h
+
+; flags for the dwFlags parameter of MCI_SET command message
+MCI_WAVE_SET_FORMATTAG equ 00010000h
+MCI_WAVE_SET_CHANNELS equ 00020000h
+MCI_WAVE_SET_SAMPLESPERSEC equ 00040000h
+MCI_WAVE_SET_AVGBYTESPERSEC equ 00080000h
+MCI_WAVE_SET_BLOCKALIGN equ 00100000h
+MCI_WAVE_SET_BITSPERSAMPLE equ 00200000h
+
+; flags for the dwFlags parameter of MCI_STATUS, MCI_SET command messages
+MCI_WAVE_INPUT equ 00400000h
+MCI_WAVE_OUTPUT equ 00800000h
+
+; flags for the dwItem field of MCI_STATUS_PARMS parameter block
+MCI_WAVE_STATUS_FORMATTAG equ 00004001h
+MCI_WAVE_STATUS_CHANNELS equ 00004002h
+MCI_WAVE_STATUS_SAMPLESPERSEC equ 00004003h
+MCI_WAVE_STATUS_AVGBYTESPERSEC equ 00004004h
+MCI_WAVE_STATUS_BLOCKALIGN equ 00004005h
+MCI_WAVE_STATUS_BITSPERSAMPLE equ 00004006h
+MCI_WAVE_STATUS_LEVEL equ 00004007h
+
+; flags for the dwFlags parameter of MCI_SET command message
+MCI_WAVE_SET_ANYINPUT equ 04000000h
+MCI_WAVE_SET_ANYOUTPUT equ 08000000h
+
+; flags for the dwFlags parameter of MCI_GETDEVCAPS command message
+MCI_WAVE_GETDEVCAPS_INPUTS equ 00004001h
+MCI_WAVE_GETDEVCAPS_OUTPUTS equ 00004002h
+
+; parameter block for MCI_OPEN command message
+MCI_WAVE_OPEN_PARMS struc
+ mciwopen_dwCallback dd ?
+ mciwopen_wDeviceID dw ?
+ mciwopen_wReserved0 dw ?
+ mciwopen_lpstrDeviceType dd ?
+ mciwopen_lpstrElementName dd ?
+ mciwopen_lpstrAlias dd ?
+ mciwopen_dwBufferSeconds dd ?
+MCI_WAVE_OPEN_PARMS ends
+
+; parameter block for MCI_DELETE command message
+MCI_WAVE_DELETE_PARMS struc
+ mciwdel_dwCallback dd ?
+ mciwdel_dwFrom dd ?
+ mciwdel_dwTo dd ?
+MCI_WAVE_DELETE_PARMS ends
+
+; parameter block for MCI_SET command message
+MCI_WAVE_SET_PARMS struc
+ mciwset_dwCallback dd ?
+ mciwset_dwTimeFormat dd ?
+ mciwset_dwAudio dd ?
+ mciwset_wInput dw ?
+ mciwset_wReserved0 dw ?
+ mciwset_wOutput dw ?
+ mciwset_wReserved1 dw ?
+ mciwset_wFormatTag dw ?
+ mciwset_wReserved2 dw ?
+ mciwset_nChannels dw ?
+ mciwset_wReserved3 dw ?
+ mciwset_nSamplesPerSec dw ?
+ mciwset_nAvgBytesPerSec dw ?
+ mciwset_nBlockAlign dw ?
+ mciwset_wReserved4 dw ?
+ mciwset_wBitsPerSample dw ?
+ mciwset_wReserved5 dw ?
+MCI_WAVE_SET_PARMS ends
+
+
+;
+; MCI extensions for MIDI sequencer devices
+;
+
+; flags for the dwReturn field of MCI_STATUS_PARMS parameter block
+; MCI_STATUS command, (dwItem == MCI_SEQ_STATUS_DIVTYPE)
+MCI_SEQ_DIV_PPQN equ (0 + MCI_SEQ_OFFSET)
+MCI_SEQ_DIV_SMPTE_24 equ (1 + MCI_SEQ_OFFSET)
+MCI_SEQ_DIV_SMPTE_25 equ (2 + MCI_SEQ_OFFSET)
+MCI_SEQ_DIV_SMPTE_30DROP equ (3 + MCI_SEQ_OFFSET)
+MCI_SEQ_DIV_SMPTE_30 equ (4 + MCI_SEQ_OFFSET)
+
+; flags for the dwMaster field of MCI_SEQ_SET_PARMS parameter block
+; MCI_SET command, (dwFlags == MCI_SEQ_SET_MASTER)
+MCI_SEQ_FORMAT_SONGPTR equ 4001h
+MCI_SEQ_FILE equ 4002h
+MCI_SEQ_MIDI equ 4003h
+MCI_SEQ_SMPTE equ 4004h
+MCI_SEQ_NONE equ 65533
+
+; flags for the dwItem field of MCI_STATUS_PARMS parameter block
+MCI_SEQ_STATUS_TEMPO equ 00004002h
+MCI_SEQ_STATUS_PORT equ 00004003h
+MCI_SEQ_STATUS_SLAVE equ 00004007h
+MCI_SEQ_STATUS_MASTER equ 00004008h
+MCI_SEQ_STATUS_OFFSET equ 00004009h
+MCI_SEQ_STATUS_DIVTYPE equ 0000400Ah
+
+; flags for the dwFlags parameter of MCI_SET command message
+MCI_SEQ_SET_TEMPO equ 00010000h
+MCI_SEQ_SET_PORT equ 00020000h
+MCI_SEQ_SET_SLAVE equ 00040000h
+MCI_SEQ_SET_MASTER equ 00080000h
+MCI_SEQ_SET_OFFSET equ 01000000h
+
+; parameter block for MCI_SET command message
+MCI_SEQ_SET_PARMS struc
+ mcisset_dwCallback dd ?
+ mcisset_dwTimeFormat dd ?
+ mcisset_dwAudio dd ?
+ mcisset_dwTempo dd ?
+ mcisset_dwPort dd ?
+ mcisset_dwSlave dd ?
+ mcisset_dwMaster dd ?
+ mcisset_dwOffset dd ?
+MCI_SEQ_SET_PARMS ends
+
+
+;
+; MCI extensions for animation devices
+;
+
+; flags for dwFlags parameter of MCI_OPEN command message
+MCI_ANIM_OPEN_WS equ 00010000h
+MCI_ANIM_OPEN_PARENT equ 00020000h
+MCI_ANIM_OPEN_NOSTATIC equ 00040000h
+
+; flags for dwFlags parameter of MCI_PLAY command message
+MCI_ANIM_PLAY_SPEED equ 00010000h
+MCI_ANIM_PLAY_REVERSE equ 00020000h
+MCI_ANIM_PLAY_FAST equ 00040000h
+MCI_ANIM_PLAY_SLOW equ 00080000h
+MCI_ANIM_PLAY_SCAN equ 00100000h
+
+; flags for dwFlags parameter of MCI_STEP command message
+MCI_ANIM_STEP_REVERSE equ 00010000h
+MCI_ANIM_STEP_FRAMES equ 00020000h
+
+; flags for dwItem field of MCI_STATUS_PARMS parameter block
+MCI_ANIM_STATUS_SPEED equ 00004001h
+MCI_ANIM_STATUS_FORWARD equ 00004002h
+MCI_ANIM_STATUS_HWND equ 00004003h
+MCI_ANIM_STATUS_HPAL equ 00004004h
+MCI_ANIM_STATUS_STRETCH equ 00004005h
+
+; flags for the dwFlags parameter of MCI_INFO command message
+MCI_ANIM_INFO_TEXT equ 00010000h
+
+; flags for dwItem field of MCI_GETDEVCAPS_PARMS parameter block
+MCI_ANIM_GETDEVCAPS_CAN_REVERSE equ 00004001h
+MCI_ANIM_GETDEVCAPS_FAST_RATE equ 00004002h
+MCI_ANIM_GETDEVCAPS_SLOW_RATE equ 00004003h
+MCI_ANIM_GETDEVCAPS_NORMAL_RATE equ 00004004h
+MCI_ANIM_GETDEVCAPS_PALETTES equ 00004006h
+MCI_ANIM_GETDEVCAPS_CAN_STRETCH equ 00004007h
+MCI_ANIM_GETDEVCAPS_MAX_WINDOWS equ 00004008h
+
+; flags for the MCI_REALIZE command message
+MCI_ANIM_REALIZE_NORM equ 00010000h
+MCI_ANIM_REALIZE_BKGD equ 00020000h
+
+; flags for dwFlags parameter of MCI_WINDOW command message
+MCI_ANIM_WINDOW_HWND equ 00010000h
+MCI_ANIM_WINDOW_STATE equ 00040000h
+MCI_ANIM_WINDOW_TEXT equ 00080000h
+MCI_ANIM_WINDOW_ENABLE_STRETCH equ 00100000h
+MCI_ANIM_WINDOW_DISABLE_STRETCH equ 00200000h
+
+; flags for hWnd field of MCI_ANIM_WINDOW_PARMS parameter block
+; MCI_WINDOW command message, (dwFlags == MCI_ANIM_WINDOW_HWND)
+MCI_ANIM_WINDOW_DEFAULT equ 00000000h
+
+; flags for dwFlags parameter of MCI_PUT command message
+MCI_ANIM_RECT equ 00010000h
+MCI_ANIM_PUT_SOURCE equ 00020000h
+MCI_ANIM_PUT_DESTINATION equ 00040000h
+
+; flags for dwFlags parameter of MCI_WHERE command message
+MCI_ANIM_WHERE_SOURCE equ 00020000h
+MCI_ANIM_WHERE_DESTINATION equ 00040000h
+
+; flags for dwFlags parameter of MCI_UPDATE command message
+MCI_ANIM_UPDATE_HDC equ 00020000h
+
+; parameter block for MCI_OPEN command message
+MCI_ANIM_OPEN_PARMS struc
+ mciaopen_dwCallback dd ?
+ mciaopen_wDeviceID dw ?
+ mciaopen_wReserved0 dw ?
+ mciaopen_lpstrDeviceType dd ?
+ mciaopen_lpstrElementName dd ?
+ mciaopen_lpstrAlias dd ?
+ mciaopen_dwStyle dd ?
+ mciaopen_hWndParent dw ?
+ mciaopen_wReserved1 dw ?
+MCI_ANIM_OPEN_PARMS ends
+
+; parameter block for MCI_PLAY command message
+MCI_ANIM_PLAY_PARMS struc
+ mciaplay_dwCallback dd ?
+ mciaplay_dwFrom dd ?
+ mciaplay_dwTo dd ?
+ mciaplay_dwSpeed dd ?
+MCI_ANIM_PLAY_PARMS ends
+
+; parameter block for MCI_STEP command message
+MCI_ANIM_STEP_PARMS struc
+ mciastep_dwCallback dd ?
+ mciastep_dwFrames dd ?
+MCI_ANIM_STEP_PARMS ends
+
+; parameter block for MCI_WINDOW command message
+MCI_ANIM_WINDOW_PARMS struc
+ mciawin_dwCallback dd ?
+ mciawin_hWnd dw ?
+ mciawin_wReserved1 dw ?
+ mciawin_nCmdShow dw ?
+ mciawin_wReserved2 dw ?
+ mciawin_lpstrText dd ?
+MCI_ANIM_WINDOW_PARMS ends
+
+; parameter block for MCI_PUT, MCI_UPDATE, MCI_WHERE command messages
+MCI_ANIM_RECT_PARMS struc
+ mciarect_dwCallback dd ?
+ifdef MCI_USE_OFFEXT
+ mciarect_ptOffset db (SIZE POINT) dup (?)
+ mciarect_ptExtent db (SIZE POINT) dup (?)
+else ;ifdef MCI_USE_OFFEXT
+ mciarect_rc db (SIZE RECT) dup (?)
+endif ;ifdef MCI_USE_OFFEXT
+MCI_ANIM_RECT_PARMS ends
+
+; parameter block for MCI_UPDATE PARMS
+MCI_ANIM_UPDATE_PARMS struc
+ mciaupd_dwCallback dd ?
+ mciaupd_rc db (SIZE RECT) dup (?)
+ mciaupd_hDC dw ?
+MCI_ANIM_UPDATE_PARMS ends
+
+
+;
+; MCI extensions for video overlay devices
+;
+
+; flags for dwFlags parameter of MCI_OPEN command message
+MCI_OVLY_OPEN_WS equ 00010000h
+MCI_OVLY_OPEN_PARENT equ 00020000h
+
+; flags for dwFlags parameter of MCI_STATUS command message
+MCI_OVLY_STATUS_HWND equ 00004001h
+MCI_OVLY_STATUS_STRETCH equ 00004002h
+
+; flags for dwFlags parameter of MCI_INFO command message
+MCI_OVLY_INFO_TEXT equ 00010000h
+
+; flags for dwItem field of MCI_GETDEVCAPS_PARMS parameter block
+MCI_OVLY_GETDEVCAPS_CAN_STRETCH equ 00004001h
+MCI_OVLY_GETDEVCAPS_CAN_FREEZE equ 00004002h
+MCI_OVLY_GETDEVCAPS_MAX_WINDOWS equ 00004003h
+
+; flags for dwFlags parameter of MCI_WINDOW command message
+MCI_OVLY_WINDOW_HWND equ 00010000h
+MCI_OVLY_WINDOW_STATE equ 00040000h
+MCI_OVLY_WINDOW_TEXT equ 00080000h
+MCI_OVLY_WINDOW_ENABLE_STRETCH equ 00100000h
+MCI_OVLY_WINDOW_DISABLE_STRETCH equ 00200000h
+
+; flags for hWnd parameter of MCI_OVLY_WINDOW_PARMS parameter block
+MCI_OVLY_WINDOW_DEFAULT equ 00000000h
+
+; flags for dwFlags parameter of MCI_PUT command message
+MCI_OVLY_RECT equ 00010000h
+MCI_OVLY_PUT_SOURCE equ 00020000h
+MCI_OVLY_PUT_DESTINATION equ 00040000h
+MCI_OVLY_PUT_FRAME equ 00080000h
+MCI_OVLY_PUT_VIDEO equ 00100000h
+
+; flags for dwFlags parameter of MCI_WHERE command message
+MCI_OVLY_WHERE_SOURCE equ 00020000h
+MCI_OVLY_WHERE_DESTINATION equ 00040000h
+MCI_OVLY_WHERE_FRAME equ 00080000h
+MCI_OVLY_WHERE_VIDEO equ 00100000h
+
+; parameter block for MCI_OPEN command message
+MCI_OVLY_OPEN_PARMS struc
+ mcioopen_dwCallback dd ?
+ mcioopen_wDeviceID dw ?
+ mcioopen_wReserved0 dw ?
+ mcioopen_lpstrDeviceType dd ?
+ mcioopen_lpstrElementName dd ?
+ mcioopen_lpstrAlias dd ?
+ mcioopen_dwStyle dd ?
+ mcioopen_hWndParent dw ?
+ mcioopen_wReserved1 dw ?
+MCI_OVLY_OPEN_PARMS ends
+
+; parameter block for MCI_WINDOW command message
+MCI_OVLY_WINDOW_PARMS struc
+ mciowin_dwCallback dd ?
+ mciowin_hWnd dw ?
+ mciowin_wReserved1 dw ?
+ mciowin_nCmdShow dw ?
+ mciowin_wReserved2 dw ?
+ mciowin_lpstrText dd ?
+MCI_OVLY_WINDOW_PARMS ends
+
+; parameter block for MCI_PUT, MCI_UPDATE, and MCI_WHERE command messages
+MCI_OVLY_RECT_PARMS struc
+ mciorect_dwCallback dd ?
+ifdef MCI_USE_OFFEXT
+ mciorect_ptOffset db (SIZE POINT) dup (?)
+ mciorect_ptExtent db (SIZE POINT) dup (?)
+else ;ifdef MCI_USE_OFFEXT
+ mciorect_rc db (SIZE RECT) dup (?)
+endif ;ifdef MCI_USE_OFFEXT
+MCI_OVLY_RECT_PARMS ends
+
+; parameter block for MCI_SAVE command message
+MCI_OVLY_SAVE_PARMS struc
+ mciosave_dwCallback dd ?
+ mciosave_lpfilename dd ?
+ mciosave_rc db (SIZE RECT) dup (?)
+MCI_OVLY_SAVE_PARMS ends
+
+; parameter block for MCI_LOAD command message
+MCI_OVLY_LOAD_PARMS struc
+ mcioload_dwCallback dd ?
+ mcioload_lpfilename dd ?
+ mcioload_rc db (SIZE RECT) dup (?)
+MCI_OVLY_LOAD_PARMS ends
+
+endif ;ifndef MMNOMCI
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;
+; DISPLAY Driver extensions
+;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+ifndef C1_TRANSPARENT
+ CAPS1 equ 94 ; other caps
+ C1_TRANSPARENT equ 0001h ; new raster cap
+ NEWTRANSPARENT equ 3 ; use with SetBkMode()
+
+ QUERYROPSUPPORT equ 40 ; use to determine ROP support
+endif ;ifndef C1_TRANSPARENT
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;
+; DIB Driver extensions
+;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+SELECTDIB equ 41 ; DIB.DRV select dib escape
+DIBINDEX MACRO a
+ mov ax,a
+ mov dx,10ffh
+ ENDM
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;
+; ScreenSaver support
+;
+; The current application will receive a syscommand of SC_SCREENSAVE just
+; before the screen saver is invoked. If the app wishes to prevent a
+; screen save, return non-zero value, otherwise call DefWindowProc().
+;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+ifndef SC_SCREENSAVE
+
+ SC_SCREENSAVE equ 0F140h
+
+endif ;ifndef SC_SCREENSAVE
diff --git a/private/mvdm/wow16/inc/multires.h b/private/mvdm/wow16/inc/multires.h
new file mode 100644
index 000000000..0cc669ccc
--- /dev/null
+++ b/private/mvdm/wow16/inc/multires.h
@@ -0,0 +1,71 @@
+/************************************************************************/
+/* */
+/* MultiRes.H */
+/* */
+/* This contains the data structures of the new format */
+/* for the resources; */
+/* */
+/* History: */
+/* Created Nov, 1988 by Sankar */
+/* */
+/************************************************************************/
+
+
+
+/* The width of the name field in the Data for the group resources */
+#define NAMELEN 14
+
+/* The bits per pixel can be 1, 4, 8 or 24 in the PM bitmap format */
+#define MAXBITSPERPIXEL 24
+
+#define DEVICEDEP 1
+#define DEVICEINDEP 2
+
+
+/* Header of the resource file in the new format */
+
+struct tagNEWHEADER
+{
+ WORD Reserved;
+ WORD ResType;
+ WORD ResCount;
+};
+
+typedef struct tagNEWHEADER FAR *LPNEWHEADER;
+
+struct tagICONDIR
+{
+ BYTE Width; /* 16, 32, 64 */
+ BYTE Height; /* 16, 32, 64 */
+ BYTE ColorCount; /* 2, 8, 16 */
+ BYTE reserved;
+};
+
+struct tagCURSORDIR
+{
+ WORD Width;
+ WORD Height;
+};
+
+
+/* Structure of each entry in resource directory */
+
+struct tagRESDIR
+{
+ union
+ {
+ struct tagICONDIR Icon;
+ struct tagCURSORDIR Cursor;
+ } ResInfo;
+
+ WORD Planes;
+ WORD BitCount;
+ DWORD BytesInRes;
+ WORD idIcon;
+};
+
+typedef struct tagRESDIR FAR *LPRESDIR;
+
+typedef BITMAPINFOHEADER *PBMPHEADER;
+typedef BITMAPINFOHEADER FAR *LPBMPHEADER;
+
diff --git a/private/mvdm/wow16/inc/newexe.inc b/private/mvdm/wow16/inc/newexe.inc
new file mode 100644
index 000000000..6aad0a98f
--- /dev/null
+++ b/private/mvdm/wow16/inc/newexe.inc
@@ -0,0 +1,332 @@
+savedCS = 4
+savedIP = 2
+savedBP = 0
+savedDS = -2
+
+EMAGIC = 05A4Dh
+ERESWDS = 0010h
+ENEWHDR = 003Eh
+ENEWEXE = 0040h
+
+EXE_HDR STRUC
+e_magic DW ? ; magic in same location
+e_cblp DW ?
+e_cp DW ?
+e_crlc DW ?
+e_cparhdr DW ?
+e_minalloc DW ?
+e_maxalloc DW ?
+e_ss DW ?
+e_sp DW ?
+e_csum DW ?
+e_cs DW ?
+e_ip DW ?
+e_lfarlc DW ?
+e_ovno DW ?
+e_res DW ERESWDS DUP (?)
+e_lfanew DD ?
+EXE_HDR ENDS
+
+
+NEMAGIC = 454Eh
+NERESBYTES = 0
+
+NEW_EXE STRUC
+ne_magic DW ? ; Magic value 'NE'
+ne_ver DB ? ; version number
+ne_rev DB ? ; revision number
+ne_enttab DW ? ; offset to entry table
+ne_cbenttab DW ? ; number of bytes in entry table
+
+ne_crc DD ? ; CRC of file
+
+ne_flags DW ? ; flag word
+ne_autodata DW ? ; segment number of auto data segment
+ne_heap DW ? ; initial size of local heap
+ne_stack DW ? ; initial size of stack
+
+ne_csip DD ? ; CS:IP start address
+ne_sssp DD ? ; SS:SP initial stack pointer. 0 if
+ ; stack size word non-zero
+
+ne_cseg DW ? ; number of segment in segment table
+ne_cmod DW ? ; number of entries in module reference table
+ne_cbnrestab DW ? ; number of bytes in non-resident name table
+
+ne_segtab DW ? ; NE relative offset to segment table
+ne_rsrctab DW ? ; NE relative offset to resource table
+ne_restab DW ? ; NE relative offset to resident name table
+ne_modtab DW ? ; NE relative offset to module reference table
+ne_imptab DW ? ; NE relative offset to imported name table
+ne_nrestab DD ? ; file offset to non-resident name table
+ne_cmovent DW ? ; Count of movable entries
+ne_align DW ? ; Alignment shift count for segment data
+ne_cres DW ? ; Count of resource segments
+ne_exetyp DB ? ; Target operating system
+ne_flagsothers DB ? ; Other .EXE flags
+ne_pretthunks DW ? ; offset to return thunks
+ne_psegrefbytes DW ? ; offset to segment ref. bytes
+ne_swaparea DW ? ; Minimum code swap area size
+ne_expver DW ? ; Expected Windows version number
+NEW_EXE ENDS
+
+; Chksum not supported unless ne_psegcsum defined in NEW_EXE structure
+
+ne_psegcsum = word ptr ne_exetyp
+ne_onextexe = word ptr ne_crc
+
+; New 3.0 Gang Load area description
+
+ne_gang_start = ne_pretthunks
+ne_gang_length = ne_psegrefbytes
+
+NEW_EXE1 STRUC
+ DW ?
+ne_usage DW ?
+ DW ?
+ne_pnextexe DW ?
+ne_pautodata DW ?
+ne_pfileinfo DW ?
+NEW_EXE1 ENDS
+
+NENOTP = 8000h ; Not a process (i.e. a library module)
+NEPRIVLIB = 4000h ; A library which lives above the line
+NEIERR = 2000h ; Errors in image
+NEAPPTYP = 0700h ; Application type mask
+NENOTWINCOMPAT = 0100h ; Not compatible with P.M. Windowing
+NEWINCOMPAT = 0200h ; Compatible with P.M. Windowing
+NEWINAPI = 0300h ; Uses P.M. Windowing API
+NEFLTP = 0080h ; Floating-point instructions
+NEI386 = 0040h ; 386 instructions
+NEI286 = 0020h ; 286 instructions
+NEI086 = 0010h ; 8086 instructions
+NEPROT = 0008h ; Runs in protected mode only
+NEPPLI = 0004h ; Per-Process Library Initialization
+NEINST = 0002h ; Instance data
+NESOLO = 0001h ; Solo data
+
+; Below are the private bits used by the Windows 2.0 loader. All are
+; in the file, with the exception of NENONRES and NEWINPROT which are
+; runtime only flags.
+;
+
+NEWINPROT = NEIERR
+NENONRES = NEFLTP ; Contains non-resident code segments
+NEALLOCHIGH = NEI386 ; Private allocs above the line okay
+NEEMSSEPINST = NEI286 ; Want each instance in separate
+NELIM32 = NEI086 ; Uses LIM 3.2 API (Intel Above board)
+
+; Following private bit is a runtime only flag used only ROM Windows.
+
+NEMODINROM = NEEMSSEPINST ; Module loaded from ROM
+
+;
+; Format of NE_FLAGSOTHERS(x):
+;
+; 7 6 5 4 3 2 1 0 - bit no
+; | | | |
+; | | | +---------------- Support for long file names
+; | | +------------------ 2.x app runs in protect mode
+; | +-------------------- 2.x app gets prop. font
+; +---------------------- Contains gangload area
+;
+
+NELONGNAMES = 1h
+NEINFONT = 2h ; WIN30 - 2.x app runs in 3.x prot mode
+NEINPROT = 4h ; WIN30 - 2.x app gets proportional font
+NEGANGLOAD = 8h ; WIN30 - Contains gangload area
+NEASSUMENODEP = 10h ; WIN40 - DllEntryPoint known not to exit
+NEINTLAPP = 40h ; WIN31 - intl versions use this.
+NEHASPATCH = 80h ; WIN40 - Some segs of this module get patched
+
+; Target operating systems
+
+NE_UNKNOWN = 0 ; Unknown (any "new-format" OS)
+NE_OS2 = 1 ; Microsoft/IBM OS/2 (default)
+NE_WINDOWS = 2 ; Microsoft Windows
+NE_DOS4 = 3 ; Microsoft MS-DOS 4.x
+NE_DEV386 = 4 ; Microsoft Windows 386
+
+
+ifndef NO_APPLOADER
+NEAPPLOADER = 0800h ; set if application has its own loader
+endif ;!NO_APPLOADER
+
+
+NEW_SEG STRUC
+ns_sector DW ? ; logical sector number in file of start of segment
+ns_cbseg DW ? ; number bytes in file
+ns_flags DW ? ; segment flags
+ns_minalloc DW ? ; minimum number bytes to allocate for segment
+NEW_SEG ENDS
+
+NEW_SEG1 STRUC
+ DB SIZE NEW_SEG DUP (?)
+ns_handle DW ? ; Handle to segment (0 if not loaded)
+NEW_SEG1 ENDS
+
+NSTYPE = 0007h ; Segment type mask
+NSCODE = 0000h ; Code segment
+NSDATA = 0001h ; Data segment
+NSITER = 0008h ; Iterated segment data
+NSMOVE = 0010h ; Moveable segment
+NSSHARE = 0020h ; Shareable segment
+NSPRELOAD = 0040h ; Preload this segment
+NSERONLY = 0080h ; EXECUTE ONLY code/READ ONLY data segment
+NSRELOC = 0100h ; Relocation information following segment data
+NSDPL = 0C00h ; 286 DPL bits
+NSDISCARD = 1000h ; Discard priority bits
+NS286DOS = 0EE06h ; These bits only used by 286DOS
+
+NSALIGN = 9 ; Default alignment shift count for seg. data
+
+NSALLOCED = 0002h ; set if ns_handle points to uninitialized mem.
+NSLOADED = 0004h ; set if ns_handle points to initialized mem.
+NSUSESDATA = 0400h ; set if an entry point in this segment uses
+ ; the automatic data segment of a SOLO library
+
+NSGETHIGH = 0200h
+NSINDIRECT = 2000h
+NSWINCODE = 4000h ; flag for code
+
+NSKCACHED = 0800h ; cached by kernel
+NSPRIVLIB = NSITER
+NSNOTP = 8000h
+
+NSINROM = NSINDIRECT ; segment is loaded in ROM
+NSCOMPR = NSGETHIGH ; segment is compressed in ROM
+
+ifndef NO_APPLOADER
+NSCACHED = 8000h ;* in AppLoader Cache
+endif ;!NO_APPLOADER
+
+
+NEW_RSRC STRUC
+rs_align DW ?
+NEW_RSRC ENDS
+
+RSORDID = 08000h ; If high bit of rt_id or rn_id set then integer id
+
+RSRC_TYPEINFO STRUC
+rt_id DW ?
+rt_nres DW ?
+rt_proc DD ?
+RSRC_TYPEINFO ENDS
+
+RSRC_NAMEINFO STRUC
+rn_offset DW ?
+rn_length DW ?
+rn_flags DW ?
+rn_id DW ?
+rn_handle DW ?
+rn_usage DW ?
+RSRC_NAMEINFO ENDS
+RNMOVE = 00010h ; Moveable resource
+RNPURE = 00020h ; Pure resource (read only)
+RNPRELOAD = 00040h ; Preload this resource
+RNDISCARD = 01000h ; Discard bit
+RNLOADED = 00004h ; True if handler proc return handle
+RNCOMPR = 00200h ; Resource is compressed in ROM
+RNINROM = 02000h ; Resource is loaded in ROM (run time flag)
+
+RNUNUSED = 0CD8Bh ; Unused resource flags
+
+ENTFIXED STRUC
+entflags DB ?
+entoffset DW ?
+ENTFIXED ENDS
+
+if SWAPPRO
+
+ENTMOVEABLE STRUC
+ DB ? ; Entry flags
+entsar DB 5 DUP (?) ; sar cs:[xxxx] instruction
+ DW ? ; INT 0F0H for swap profiler
+entjmpfarop DB ?
+entjmpfaroff DW ?
+entjmpfarseg DW ?
+ENTMOVEABLE ENDS
+
+ENTSWAPPED STRUC
+ DB ? ; Entry flags
+ DB 5 DUP (?) ; sar cs:[xxxx] instruction
+ DW ? ; INT 0F0H for swap profiler
+entintop DB ?
+entintvec DB ?
+entintsegno DB ?
+entintoff DW ?
+ENTSWAPPED ENDS
+
+else ; no swap profiler
+
+ENTMOVEABLE STRUC
+ DB ? ; Entry flags
+entsar DB 5 DUP (?) ; sar cs:[xxxx] instruction
+entjmpfarop DB ?
+entjmpfaroff DW ?
+entjmpfarseg DW ?
+ENTMOVEABLE ENDS
+
+ENTSWAPPED STRUC
+ DB ? ; Entry flags
+ DB 5 DUP (?) ; sar cs:[xxxx] instruction
+entintop DB ?
+entintvec DB ?
+entintsegno DB ?
+entintoff DW ?
+ENTSWAPPED ENDS
+
+endif ; if swap profiler
+
+errnz <SIZE ENTMOVEABLE - SIZE ENTSWAPPED>
+
+PENT STRUC
+penttype DB ?
+pentflags DB ?
+pentsegno DB ?
+pentoffset DW ?
+PENT ENDS
+
+PM_EntStruc STRUC
+PM_EntStart dw ?
+PM_EntEnd dw ?
+PM_EntNext dw ?
+PM_EntStruc ENDS
+
+ENT_UNUSED = 000h
+ENT_ABSSEG = 0FEh
+ENT_MOVEABLE = 0FFh
+ENT_PUBLIC = 001h
+ENT_DATA = 002h
+INTOPCODE = 0CDh
+
+if SWAPPRO
+SWAPVECTOR = 0F0h
+endif
+
+NEW_RLCINFO STRUC
+nr_nreloc DW ?
+NEW_RLCINFO ENDS
+
+NEW_RLC STRUC
+nr_stype DB ?
+nr_flags DB ?
+nr_soff DW ?
+nr_mod DW ?
+nr_proc DW ?
+NEW_RLC ENDS
+nr_segno EQU nr_flags+3
+nr_entry EQU nr_proc
+
+NRSTYP = 07h
+NRSBYTE = 00h
+NRSSEG = 02h
+NRSPTR = 03h
+NRSOFF = 05h
+
+NRADD = 04h
+NRRTYP = 03h
+NRRINT = 00h
+NRRORD = 01h
+NRRNAM = 02h
+OSFIXUP = 03h
diff --git a/private/mvdm/wow16/inc/ole.h b/private/mvdm/wow16/inc/ole.h
new file mode 100644
index 000000000..37bcf9cad
--- /dev/null
+++ b/private/mvdm/wow16/inc/ole.h
@@ -0,0 +1,504 @@
+/*****************************************************************************\
+* *
+* ole.h - Object Linking and Embedding functions, types, and definitions*
+* *
+* Version 1.0 *
+* *
+* NOTE: windows.h must be #included first *
+* *
+* Copyright (c) 1990-1992, Microsoft Corp. All rights reserved.*
+* *
+\*****************************************************************************/
+
+#ifndef _INC_OLE
+#define _INC_OLE
+
+#ifndef RC_INVOKED
+#pragma pack(1) /* Assume byte packing throughout */
+#endif /* !RC_INVOKED */
+
+#ifdef __cplusplus
+extern "C" { /* Assume C declarations for C++ */
+#endif /* __cplusplus */
+
+#ifndef WINAPI /* If not included with 3.1 headers... */
+#define WINAPI FAR PASCAL
+#define CALLBACK FAR PASCAL
+#define LPCSTR LPSTR
+#define UINT WORD
+#define LPARAM LONG
+#define WPARAM WORD
+#define LRESULT LONG
+#define HMODULE HANDLE
+#define HINSTANCE HANDLE
+#define HLOCAL HANDLE
+#define HGLOBAL HANDLE
+#endif /* _INC_WINDOWS */
+
+#ifdef STRICT
+#define OLE_LPCSTR LPCSTR
+#define OLE_CONST const
+#else /* STRICT */
+#define OLE_LPCSTR LPSTR
+#define OLE_CONST
+#endif /* !STRICT */
+
+
+/* Object types */
+#define OT_LINK 1L
+#define OT_EMBEDDED 2L
+#define OT_STATIC 3L
+
+/* activate verbs */
+#define OLEVERB_PRIMARY 0
+
+/* target device info structure */
+typedef struct _OLETARGETDEVICE
+{
+ UINT otdDeviceNameOffset;
+ UINT otdDriverNameOffset;
+ UINT otdPortNameOffset;
+ UINT otdExtDevmodeOffset;
+ UINT otdExtDevmodeSize;
+ UINT otdEnvironmentOffset;
+ UINT otdEnvironmentSize;
+ BYTE otdData[1];
+} OLETARGETDEVICE;
+typedef OLETARGETDEVICE FAR* LPOLETARGETDEVICE;
+
+/* flags used in some methods */
+#define OF_SET 0x0001
+#define OF_GET 0x0002
+#define OF_HANDLER 0x0004
+
+/* return codes for OLE functions */
+typedef enum
+{
+ OLE_OK, /* 0 Function operated correctly */
+
+ OLE_WAIT_FOR_RELEASE, /* 1 Command has been initiated, client */
+ /* must wait for release. keep dispatching */
+ /* messages till OLE_RELESE in callback */
+
+ OLE_BUSY, /* 2 Tried to execute a method while another */
+ /* method is in progress. */
+
+ OLE_ERROR_PROTECT_ONLY, /* 3 Ole APIs are called in real mode */
+ OLE_ERROR_MEMORY, /* 4 Could not alloc or lock memory */
+ OLE_ERROR_STREAM, /* 5 (OLESTREAM) stream error */
+ OLE_ERROR_STATIC, /* 6 Non static object expected */
+ OLE_ERROR_BLANK, /* 7 Critical data missing */
+ OLE_ERROR_DRAW, /* 8 Error while drawing */
+ OLE_ERROR_METAFILE, /* 9 Invalid metafile */
+ OLE_ERROR_ABORT, /* 10 Client chose to abort metafile drawing */
+ OLE_ERROR_CLIPBOARD, /* 11 Failed to get/set clipboard data */
+ OLE_ERROR_FORMAT, /* 12 Requested format is not available */
+ OLE_ERROR_OBJECT, /* 13 Not a valid object */
+ OLE_ERROR_OPTION, /* 14 Invalid option(link update / render) */
+ OLE_ERROR_PROTOCOL, /* 15 Invalid protocol */
+ OLE_ERROR_ADDRESS, /* 16 One of the pointers is invalid */
+ OLE_ERROR_NOT_EQUAL, /* 17 Objects are not equal */
+ OLE_ERROR_HANDLE, /* 18 Invalid handle encountered */
+ OLE_ERROR_GENERIC, /* 19 Some general error */
+ OLE_ERROR_CLASS, /* 20 Invalid class */
+ OLE_ERROR_SYNTAX, /* 21 Command syntax is invalid */
+ OLE_ERROR_DATATYPE, /* 22 Data format is not supported */
+ OLE_ERROR_PALETTE, /* 23 Invalid color palette */
+ OLE_ERROR_NOT_LINK, /* 24 Not a linked object */
+ OLE_ERROR_NOT_EMPTY, /* 25 Client doc contains objects. */
+ OLE_ERROR_SIZE, /* 26 Incorrect buffer size passed to the api */
+ /* that places some string in caller's */
+ /* buffer */
+
+ OLE_ERROR_DRIVE, /* 27 Drive letter in doc name is invalid */
+ OLE_ERROR_NETWORK, /* 28 Failed to establish connection to a */
+ /* network share on which the document */
+ /* is located */
+
+ OLE_ERROR_NAME, /* 29 Invalid name(doc name, object name), */
+ /* etc.. passed to the APIs */
+
+ OLE_ERROR_TEMPLATE, /* 30 Server failed to load template */
+ OLE_ERROR_NEW, /* 31 Server failed to create new doc */
+ OLE_ERROR_EDIT, /* 32 Server failed to create embedded */
+ /* instance */
+ OLE_ERROR_OPEN, /* 33 Server failed to open document, */
+ /* possible invalid link */
+
+ OLE_ERROR_NOT_OPEN, /* 34 Object is not open for editing */
+ OLE_ERROR_LAUNCH, /* 35 Failed to launch server */
+ OLE_ERROR_COMM, /* 36 Failed to communicate with server */
+ OLE_ERROR_TERMINATE, /* 37 Error in termination */
+ OLE_ERROR_COMMAND, /* 38 Error in execute */
+ OLE_ERROR_SHOW, /* 39 Error in show */
+ OLE_ERROR_DOVERB, /* 40 Error in sending do verb, or invalid */
+ /* verb */
+ OLE_ERROR_ADVISE_NATIVE, /* 41 Item could be missing */
+ OLE_ERROR_ADVISE_PICT, /* 42 Item could be missing or server doesn't */
+ /* this format. */
+
+ OLE_ERROR_ADVISE_RENAME, /* 43 Server doesn't support rename */
+ OLE_ERROR_POKE_NATIVE, /* 44 Failure of poking native data to server */
+ OLE_ERROR_REQUEST_NATIVE, /* 45 Server failed to render native data */
+ OLE_ERROR_REQUEST_PICT, /* 46 Server failed to render presentation */
+ /* data */
+ OLE_ERROR_SERVER_BLOCKED, /* 47 Trying to block a blocked server or */
+ /* trying to revoke a blocked server */
+ /* or document */
+
+ OLE_ERROR_REGISTRATION, /* 48 Server is not registered in regestation */
+ /* data base */
+ OLE_ERROR_ALREADY_REGISTERED,/*49 Trying to register same doc multiple */
+ /* times */
+ OLE_ERROR_TASK, /* 50 Server or client task is invalid */
+ OLE_ERROR_OUTOFDATE, /* 51 Object is out of date */
+ OLE_ERROR_CANT_UPDATE_CLIENT,/* 52 Embed doc's client doesn't accept */
+ /* updates */
+ OLE_ERROR_UPDATE, /* 53 erorr while trying to update */
+ OLE_ERROR_SETDATA_FORMAT, /* 54 Server app doesn't understand the */
+ /* format given to its SetData method */
+ OLE_ERROR_STATIC_FROM_OTHER_OS,/* 55 trying to load a static object created */
+ /* on another Operating System */
+
+ /* Following are warnings */
+ OLE_WARN_DELETE_DATA = 1000 /* Caller must delete the data when he is */
+ /* done with it. */
+} OLESTATUS;
+
+
+
+/* Codes for CallBack events */
+typedef enum
+{
+ OLE_CHANGED, /* 0 */
+ OLE_SAVED, /* 1 */
+ OLE_CLOSED, /* 2 */
+ OLE_RENAMED, /* 3 */
+ OLE_QUERY_PAINT, /* 4 Interruptible paint support */
+ OLE_RELEASE, /* 5 Object is released(asynchronous operation */
+ /* is completed) */
+ OLE_QUERY_RETRY /* 6 Query for retry when server sends busy ACK */
+} OLE_NOTIFICATION;
+
+typedef enum
+{
+ OLE_NONE, /* 0 no method active */
+ OLE_DELETE, /* 1 object delete */
+ OLE_LNKPASTE, /* 2 PasteLink(auto reconnect) */
+ OLE_EMBPASTE, /* 3 paste(and update) */
+ OLE_SHOW, /* 4 Show */
+ OLE_RUN, /* 5 Run */
+ OLE_ACTIVATE, /* 6 Activate */
+ OLE_UPDATE, /* 7 Update */
+ OLE_CLOSE, /* 8 Close */
+ OLE_RECONNECT, /* 9 Reconnect */
+ OLE_SETUPDATEOPTIONS, /* 10 setting update options */
+ OLE_SERVERUNLAUNCH, /* 11 server is being unlaunched */
+ OLE_LOADFROMSTREAM, /* 12 LoadFromStream(auto reconnect) */
+ OLE_SETDATA, /* 13 OleSetData */
+ OLE_REQUESTDATA, /* 14 OleRequestData */
+ OLE_OTHER, /* 15 other misc async operations */
+ OLE_CREATE, /* 16 create */
+ OLE_CREATEFROMTEMPLATE, /* 17 CreatefromTemplate */
+ OLE_CREATELINKFROMFILE, /* 18 CreateLinkFromFile */
+ OLE_COPYFROMLNK, /* 19 CopyFromLink(auto reconnect) */
+ OLE_CREATEFROMFILE, /* 20 CreateFromFile */
+ OLE_CREATEINVISIBLE /* 21 CreateInvisible */
+} OLE_RELEASE_METHOD;
+
+/* rendering options */
+typedef enum
+{
+ olerender_none,
+ olerender_draw,
+ olerender_format
+} OLEOPT_RENDER;
+
+/* standard clipboard format type */
+typedef WORD OLECLIPFORMAT;
+
+/* Link update options */
+typedef enum
+{
+ oleupdate_always,
+ oleupdate_onsave,
+#ifndef OLE_INTERNAL
+ oleupdate_oncall
+#else
+ oleupdate_oncall,
+ oleupdate_onclose
+#endif /* OLE_INTERNAL */
+} OLEOPT_UPDATE;
+
+typedef HANDLE HOBJECT;
+typedef LONG LHSERVER;
+typedef LONG LHCLIENTDOC;
+typedef LONG LHSERVERDOC;
+
+typedef struct _OLEOBJECT FAR* LPOLEOBJECT;
+typedef struct _OLESTREAM FAR* LPOLESTREAM;
+typedef struct _OLECLIENT FAR* LPOLECLIENT;
+
+
+#ifndef OLE_INTERNAL
+/* object method table definitions. */
+typedef struct _OLEOBJECTVTBL
+{
+ void FAR* (CALLBACK* QueryProtocol) (LPOLEOBJECT, OLE_LPCSTR);
+ OLESTATUS (CALLBACK* Release) (LPOLEOBJECT);
+ OLESTATUS (CALLBACK* Show) (LPOLEOBJECT, BOOL);
+ OLESTATUS (CALLBACK* DoVerb) (LPOLEOBJECT, UINT, BOOL, BOOL);
+ OLESTATUS (CALLBACK* GetData) (LPOLEOBJECT, OLECLIPFORMAT, HANDLE FAR*);
+ OLESTATUS (CALLBACK* SetData) (LPOLEOBJECT, OLECLIPFORMAT, HANDLE);
+ OLESTATUS (CALLBACK* SetTargetDevice) (LPOLEOBJECT, HGLOBAL);
+ OLESTATUS (CALLBACK* SetBounds) (LPOLEOBJECT, OLE_CONST RECT FAR*);
+ OLECLIPFORMAT (CALLBACK* EnumFormats) (LPOLEOBJECT, OLECLIPFORMAT);
+ OLESTATUS (CALLBACK* SetColorScheme) (LPOLEOBJECT, OLE_CONST LOGPALETTE FAR*);
+ /* Server has to implement only the above methods. */
+
+#ifndef SERVERONLY
+ /* Extra methods required for client. */
+ OLESTATUS (CALLBACK* Delete) (LPOLEOBJECT);
+ OLESTATUS (CALLBACK* SetHostNames) (LPOLEOBJECT, OLE_LPCSTR, OLE_LPCSTR);
+ OLESTATUS (CALLBACK* SaveToStream) (LPOLEOBJECT, LPOLESTREAM);
+ OLESTATUS (CALLBACK* Clone) (LPOLEOBJECT, LPOLECLIENT, LHCLIENTDOC, OLE_LPCSTR, LPOLEOBJECT FAR*);
+ OLESTATUS (CALLBACK* CopyFromLink) (LPOLEOBJECT, LPOLECLIENT, LHCLIENTDOC, OLE_LPCSTR, LPOLEOBJECT FAR*);
+ OLESTATUS (CALLBACK* Equal) (LPOLEOBJECT, LPOLEOBJECT);
+ OLESTATUS (CALLBACK* CopyToClipboard) (LPOLEOBJECT);
+ OLESTATUS (CALLBACK* Draw) (LPOLEOBJECT, HDC, OLE_CONST RECT FAR*, OLE_CONST RECT FAR*, HDC);
+ OLESTATUS (CALLBACK* Activate) (LPOLEOBJECT, UINT, BOOL, BOOL, HWND, OLE_CONST RECT FAR*);
+ OLESTATUS (CALLBACK* Execute) (LPOLEOBJECT, HGLOBAL, UINT);
+ OLESTATUS (CALLBACK* Close) (LPOLEOBJECT);
+ OLESTATUS (CALLBACK* Update) (LPOLEOBJECT);
+ OLESTATUS (CALLBACK* Reconnect) (LPOLEOBJECT);
+
+ OLESTATUS (CALLBACK* ObjectConvert) (LPOLEOBJECT, OLE_LPCSTR, LPOLECLIENT, LHCLIENTDOC, OLE_LPCSTR, LPOLEOBJECT FAR*);
+ OLESTATUS (CALLBACK* GetLinkUpdateOptions) (LPOLEOBJECT, OLEOPT_UPDATE FAR*);
+ OLESTATUS (CALLBACK* SetLinkUpdateOptions) (LPOLEOBJECT, OLEOPT_UPDATE);
+
+ OLESTATUS (CALLBACK* Rename) (LPOLEOBJECT, OLE_LPCSTR);
+ OLESTATUS (CALLBACK* QueryName) (LPOLEOBJECT, LPSTR, UINT FAR*);
+
+ OLESTATUS (CALLBACK* QueryType) (LPOLEOBJECT, LONG FAR*);
+ OLESTATUS (CALLBACK* QueryBounds) (LPOLEOBJECT, RECT FAR*);
+ OLESTATUS (CALLBACK* QuerySize) (LPOLEOBJECT, DWORD FAR*);
+ OLESTATUS (CALLBACK* QueryOpen) (LPOLEOBJECT);
+ OLESTATUS (CALLBACK* QueryOutOfDate) (LPOLEOBJECT);
+
+ OLESTATUS (CALLBACK* QueryReleaseStatus) (LPOLEOBJECT);
+ OLESTATUS (CALLBACK* QueryReleaseError) (LPOLEOBJECT);
+ OLE_RELEASE_METHOD (CALLBACK* QueryReleaseMethod)(LPOLEOBJECT);
+
+ OLESTATUS (CALLBACK* RequestData) (LPOLEOBJECT, OLECLIPFORMAT);
+ OLESTATUS (CALLBACK* ObjectLong) (LPOLEOBJECT, UINT, LONG FAR*);
+
+/* This method is internal only */
+ OLESTATUS (CALLBACK* ChangeData) (LPOLEOBJECT, HANDLE, LPOLECLIENT, BOOL);
+#endif /* !SERVERONLY */
+} OLEOBJECTVTBL;
+typedef OLEOBJECTVTBL FAR* LPOLEOBJECTVTBL;
+
+typedef struct _OLEOBJECT
+{
+ LPOLEOBJECTVTBL lpvtbl;
+} OLEOBJECT;
+#endif /* !OLE_NTERNAL */
+
+/* ole client definitions */
+typedef struct _OLECLIENTVTBL
+{
+ int (CALLBACK* CallBack)(LPOLECLIENT, OLE_NOTIFICATION, LPOLEOBJECT);
+} OLECLIENTVTBL;
+
+typedef OLECLIENTVTBL FAR* LPOLECLIENTVTBL;
+
+typedef struct _OLECLIENT
+{
+ LPOLECLIENTVTBL lpvtbl;
+} OLECLIENT;
+
+/* Stream definitions */
+typedef struct _OLESTREAMVTBL
+{
+ DWORD (CALLBACK* Get)(LPOLESTREAM, void FAR*, DWORD);
+ DWORD (CALLBACK* Put)(LPOLESTREAM, OLE_CONST void FAR*, DWORD);
+} OLESTREAMVTBL;
+typedef OLESTREAMVTBL FAR* LPOLESTREAMVTBL;
+
+typedef struct _OLESTREAM
+{
+ LPOLESTREAMVTBL lpstbl;
+} OLESTREAM;
+
+/* Public Function Prototypes */
+OLESTATUS WINAPI OleDelete(LPOLEOBJECT);
+OLESTATUS WINAPI OleRelease(LPOLEOBJECT);
+OLESTATUS WINAPI OleSaveToStream(LPOLEOBJECT, LPOLESTREAM);
+OLESTATUS WINAPI OleEqual(LPOLEOBJECT, LPOLEOBJECT );
+OLESTATUS WINAPI OleCopyToClipboard(LPOLEOBJECT);
+OLESTATUS WINAPI OleSetHostNames(LPOLEOBJECT, LPCSTR, LPCSTR);
+OLESTATUS WINAPI OleSetTargetDevice(LPOLEOBJECT, HGLOBAL);
+OLESTATUS WINAPI OleSetBounds(LPOLEOBJECT, const RECT FAR*);
+OLESTATUS WINAPI OleSetColorScheme(LPOLEOBJECT, const LOGPALETTE FAR*);
+OLESTATUS WINAPI OleQueryBounds(LPOLEOBJECT, RECT FAR*);
+OLESTATUS WINAPI OleQuerySize(LPOLEOBJECT, DWORD FAR*);
+OLESTATUS WINAPI OleDraw(LPOLEOBJECT, HDC, const RECT FAR*, const RECT FAR*, HDC);
+OLESTATUS WINAPI OleQueryOpen(LPOLEOBJECT);
+OLESTATUS WINAPI OleActivate(LPOLEOBJECT, UINT, BOOL, BOOL, HWND, const RECT FAR*);
+OLESTATUS WINAPI OleExecute(LPOLEOBJECT, HGLOBAL, UINT);
+OLESTATUS WINAPI OleClose(LPOLEOBJECT);
+OLESTATUS WINAPI OleUpdate(LPOLEOBJECT);
+OLESTATUS WINAPI OleReconnect(LPOLEOBJECT);
+OLESTATUS WINAPI OleGetLinkUpdateOptions(LPOLEOBJECT, OLEOPT_UPDATE FAR*);
+OLESTATUS WINAPI OleSetLinkUpdateOptions(LPOLEOBJECT, OLEOPT_UPDATE);
+void FAR* WINAPI OleQueryProtocol(LPOLEOBJECT, LPCSTR);
+
+/* Routines related to asynchronous operations. */
+OLESTATUS WINAPI OleQueryReleaseStatus(LPOLEOBJECT);
+OLESTATUS WINAPI OleQueryReleaseError(LPOLEOBJECT);
+OLE_RELEASE_METHOD WINAPI OleQueryReleaseMethod(LPOLEOBJECT);
+
+OLESTATUS WINAPI OleQueryType(LPOLEOBJECT, LONG FAR*);
+
+/* LOWORD is major version, HIWORD is minor version */
+DWORD WINAPI OleQueryClientVersion(void);
+DWORD WINAPI OleQueryServerVersion(void);
+
+/* Converting to format (as in clipboard): */
+OLECLIPFORMAT WINAPI OleEnumFormats(LPOLEOBJECT, OLECLIPFORMAT);
+OLESTATUS WINAPI OleGetData(LPOLEOBJECT, OLECLIPFORMAT, HANDLE FAR*);
+OLESTATUS WINAPI OleSetData(LPOLEOBJECT, OLECLIPFORMAT, HANDLE);
+OLESTATUS WINAPI OleQueryOutOfDate(LPOLEOBJECT);
+OLESTATUS WINAPI OleRequestData(LPOLEOBJECT, OLECLIPFORMAT);
+
+/* Query apis for creation from clipboard */
+OLESTATUS WINAPI OleQueryLinkFromClip(LPCSTR, OLEOPT_RENDER, OLECLIPFORMAT);
+OLESTATUS WINAPI OleQueryCreateFromClip(LPCSTR, OLEOPT_RENDER, OLECLIPFORMAT);
+
+/* Object creation functions */
+OLESTATUS WINAPI OleCreateFromClip(LPCSTR, LPOLECLIENT, LHCLIENTDOC, LPCSTR, LPOLEOBJECT FAR*, OLEOPT_RENDER, OLECLIPFORMAT);
+OLESTATUS WINAPI OleCreateLinkFromClip(LPCSTR, LPOLECLIENT, LHCLIENTDOC, LPCSTR, LPOLEOBJECT FAR*, OLEOPT_RENDER, OLECLIPFORMAT);
+OLESTATUS WINAPI OleCreateFromFile(LPCSTR, LPOLECLIENT, LPCSTR, LPCSTR, LHCLIENTDOC, LPCSTR, LPOLEOBJECT FAR*, OLEOPT_RENDER, OLECLIPFORMAT);
+OLESTATUS WINAPI OleCreateLinkFromFile(LPCSTR, LPOLECLIENT, LPCSTR, LPCSTR, LPCSTR, LHCLIENTDOC, LPCSTR, LPOLEOBJECT FAR*, OLEOPT_RENDER, OLECLIPFORMAT);
+OLESTATUS WINAPI OleLoadFromStream(LPOLESTREAM, LPCSTR, LPOLECLIENT, LHCLIENTDOC, LPCSTR, LPOLEOBJECT FAR*);
+OLESTATUS WINAPI OleCreate(LPCSTR, LPOLECLIENT, LPCSTR, LHCLIENTDOC, LPCSTR, LPOLEOBJECT FAR*, OLEOPT_RENDER, OLECLIPFORMAT);
+OLESTATUS WINAPI OleCreateInvisible(LPCSTR, LPOLECLIENT, LPCSTR, LHCLIENTDOC, LPCSTR, LPOLEOBJECT FAR*, OLEOPT_RENDER, OLECLIPFORMAT, BOOL);
+OLESTATUS WINAPI OleCreateFromTemplate(LPCSTR, LPOLECLIENT, LPCSTR, LHCLIENTDOC, LPCSTR, LPOLEOBJECT FAR*, OLEOPT_RENDER, OLECLIPFORMAT);
+OLESTATUS WINAPI OleClone(LPOLEOBJECT, LPOLECLIENT, LHCLIENTDOC, LPCSTR, LPOLEOBJECT FAR*);
+OLESTATUS WINAPI OleCopyFromLink(LPOLEOBJECT, LPCSTR, LPOLECLIENT, LHCLIENTDOC, LPCSTR, LPOLEOBJECT FAR*);
+OLESTATUS WINAPI OleObjectConvert(LPOLEOBJECT, LPCSTR, LPOLECLIENT, LHCLIENTDOC, LPCSTR, LPOLEOBJECT FAR*);
+OLESTATUS WINAPI OleRename(LPOLEOBJECT, LPCSTR);
+OLESTATUS WINAPI OleQueryName(LPOLEOBJECT, LPSTR, UINT FAR*);
+OLESTATUS WINAPI OleRevokeObject(LPOLECLIENT);
+BOOL WINAPI OleIsDcMeta(HDC);
+
+/* client document API */
+OLESTATUS WINAPI OleRegisterClientDoc(LPCSTR, LPCSTR, LONG, LHCLIENTDOC FAR*);
+OLESTATUS WINAPI OleRevokeClientDoc(LHCLIENTDOC);
+OLESTATUS WINAPI OleRenameClientDoc(LHCLIENTDOC, LPCSTR);
+OLESTATUS WINAPI OleRevertClientDoc(LHCLIENTDOC);
+OLESTATUS WINAPI OleSavedClientDoc(LHCLIENTDOC);
+OLESTATUS WINAPI OleEnumObjects(LHCLIENTDOC, LPOLEOBJECT FAR*);
+
+/* server usage definitions */
+typedef enum {
+ OLE_SERVER_MULTI, /* multiple instances */
+ OLE_SERVER_SINGLE /* single instance(multiple document) */
+} OLE_SERVER_USE;
+
+/* Server API */
+typedef struct _OLESERVER FAR* LPOLESERVER;
+
+OLESTATUS WINAPI OleRegisterServer(LPCSTR, LPOLESERVER, LHSERVER FAR*, HINSTANCE, OLE_SERVER_USE);
+OLESTATUS WINAPI OleRevokeServer(LHSERVER);
+OLESTATUS WINAPI OleBlockServer(LHSERVER);
+OLESTATUS WINAPI OleUnblockServer(LHSERVER, BOOL FAR*);
+
+/* APIs to keep server open */
+OLESTATUS WINAPI OleLockServer(LPOLEOBJECT, LHSERVER FAR*);
+OLESTATUS WINAPI OleUnlockServer(LHSERVER);
+
+/* Server document API */
+
+typedef struct _OLESERVERDOC FAR* LPOLESERVERDOC;
+
+OLESTATUS WINAPI OleRegisterServerDoc(LHSERVER, LPCSTR, LPOLESERVERDOC, LHSERVERDOC FAR*);
+OLESTATUS WINAPI OleRevokeServerDoc(LHSERVERDOC);
+OLESTATUS WINAPI OleRenameServerDoc(LHSERVERDOC, LPCSTR);
+OLESTATUS WINAPI OleRevertServerDoc(LHSERVERDOC);
+OLESTATUS WINAPI OleSavedServerDoc(LHSERVERDOC);
+
+typedef struct _OLESERVERVTBL
+{
+ OLESTATUS (CALLBACK* Open) (LPOLESERVER, LHSERVERDOC, OLE_LPCSTR, LPOLESERVERDOC FAR*);
+ /* long handle to doc(privtate to DLL) */
+ /* lp to OLESERVER */
+ /* document name */
+ /* place holder for returning oledoc. */
+
+ OLESTATUS (CALLBACK* Create)(LPOLESERVER, LHSERVERDOC, OLE_LPCSTR, OLE_LPCSTR, LPOLESERVERDOC FAR*);
+ /* long handle to doc(privtate to DLL) */
+ /* lp to OLESERVER */
+ /* lp class name */
+ /* lp doc name */
+ /* place holder for returning oledoc. */
+
+ OLESTATUS (CALLBACK* CreateFromTemplate)(LPOLESERVER, LHSERVERDOC, OLE_LPCSTR, OLE_LPCSTR, OLE_LPCSTR, LPOLESERVERDOC FAR*);
+ /* long handle to doc(privtate to DLL) */
+ /* lp to OLESERVER */
+ /* lp class name */
+ /* lp doc name */
+ /* lp template name */
+ /* place holder for returning oledoc. */
+
+ OLESTATUS (CALLBACK* Edit) (LPOLESERVER, LHSERVERDOC, OLE_LPCSTR, OLE_LPCSTR, LPOLESERVERDOC FAR*);
+ /* long handle to doc(privtate to DLL) */
+ /* lp to OLESERVER */
+ /* lp class name */
+ /* lp doc name */
+ /* place holder for returning oledoc. */
+
+ OLESTATUS (CALLBACK* Exit) (LPOLESERVER);
+ /* lp OLESERVER */
+
+ OLESTATUS (CALLBACK* Release) (LPOLESERVER);
+ /* lp OLESERVER */
+
+ OLESTATUS (CALLBACK* Execute)(LPOLESERVER, HGLOBAL);
+ /* lp OLESERVER */
+ /* handle to command strings */
+} OLESERVERVTBL;
+typedef OLESERVERVTBL FAR* LPOLESERVERVTBL;
+
+typedef struct _OLESERVER
+{
+ LPOLESERVERVTBL lpvtbl;
+} OLESERVER;
+
+typedef struct _OLESERVERDOCVTBL
+{
+ OLESTATUS (CALLBACK* Save) (LPOLESERVERDOC);
+ OLESTATUS (CALLBACK* Close) (LPOLESERVERDOC);
+ OLESTATUS (CALLBACK* SetHostNames)(LPOLESERVERDOC, OLE_LPCSTR, OLE_LPCSTR);
+ OLESTATUS (CALLBACK* SetDocDimensions)(LPOLESERVERDOC, OLE_CONST RECT FAR*);
+ OLESTATUS (CALLBACK* GetObject) (LPOLESERVERDOC, OLE_LPCSTR, LPOLEOBJECT FAR*, LPOLECLIENT);
+ OLESTATUS (CALLBACK* Release) (LPOLESERVERDOC);
+ OLESTATUS (CALLBACK* SetColorScheme)(LPOLESERVERDOC, OLE_CONST LOGPALETTE FAR*);
+ OLESTATUS (CALLBACK* Execute) (LPOLESERVERDOC, HGLOBAL);
+} OLESERVERDOCVTBL;
+typedef OLESERVERDOCVTBL FAR* LPOLESERVERDOCVTBL;
+
+typedef struct _OLESERVERDOC
+{
+ LPOLESERVERDOCVTBL lpvtbl;
+} OLESERVERDOC;
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#ifndef RC_INVOKED
+#pragma pack()
+#endif /* !RC_INVOKED */
+
+#endif /* !_INC_OLE */
diff --git a/private/mvdm/wow16/inc/paswindw.inc b/private/mvdm/wow16/inc/paswindw.inc
new file mode 100644
index 000000000..ab09aef7e
--- /dev/null
+++ b/private/mvdm/wow16/inc/paswindw.inc
@@ -0,0 +1,5327 @@
+TYPE {Standard C types}
+ int = INTEGERC;
+ short = INTEGER;
+ long = INTEGER4;
+ unsigned = WORD;
+ unsignedlong = INTEGER4;
+ LPshort = ADS OF short;
+
+CONST
+ FALSE_ = 0;
+ TRUE_ = 1;
+ NULL_ = 0;
+
+TYPE
+ DWORD = INTEGER4;
+ BOOL = int;
+ PSTR = ADR OF INTEGER1;
+ NPSTR = ADR OF INTEGER1;
+ LPSTR = ADS OF INTEGER1;
+ LPINT = ADS OF int;
+ LPWORD = ADS OF WORD;
+
+CONST
+ OBM_CLOSE = 32767;
+ OBM_SIZE = 32766;
+ OBM_UPARROW = 32765;
+ OBM_DNARROW = 32764;
+ OBM_RGARROW = 32763;
+ OBM_LfarROW = 32762;
+ OBM_BTSIZE = 32761;
+ OBM_CHECK = 32760;
+ OBM_CHECKBOXES = 32759;
+ OBM_BTNCORNERS = 32758;
+ OBM_REDUCE = 32757;
+ OBM_ZOOM = 32756;
+ OBM_RESTORE = 32755;
+ OCR_NORMAL = 32512;
+ OCR_IBEAM = 32513;
+ OCR_WAIT = 32514;
+ OCR_CROSS = 32515;
+ OCR_UP = 32516;
+ OCR_SIZE = 32640;
+ OCR_ICON = 32641;
+ OCR_SIZENWSE = 32642;
+ OCR_SIZENESW = 32643;
+ OCR_SIZEWE = 32644;
+ OCR_SIZENS = 32645;
+ OCR_SIZEALL = 32646;
+
+ OIC_SAMPLE = 32512;
+ OIC_HAND = 32513;
+ OIC_QUES = 32514;
+ OIC_BANG = 32515;
+ OIC_NOTE = 32516;
+
+(* Scroll bar constants *)
+ SB_HORZ = 0;
+ SB_VERT = 1;
+ SB_CTL = 2;
+ SB_BOTH = 3;
+
+(* Scroll Commands *)
+ SB_LINEUP = 0;
+ SB_LINEDOWN = 1;
+ SB_PAGEUP = 2;
+ SB_PAGEDOWN = 3;
+ SB_THUMBPOSITION = 4;
+ SB_THUMBTRACK = 5;
+ SB_TOP = 6;
+ SB_BOTTOM = 7;
+ SB_ENDSCROLL = 8;
+
+(* ShowWindow commands *)
+
+ SW_HIDE = 0;
+ SW_SHOWNORMAL = 1;
+ SW_RESTORE = 1;
+ SW_NORMAL = 1;
+ SW_SHOWMINIMIZED = 2;
+ SW_SHOWMAXIMIZED = 3;
+ SW_MAXIMIZE = 3;
+ SW_SHOWNOACTIVATE = 4;
+ SW_SHOW = 5;
+ SW_MINIMIZE = 6;
+ SW_SHOWMINNOACTIVE = 7;
+ SW_SHOWNA = 8;
+
+
+(* Old ShowWindow commands *)
+ HIDE_WINDOW = 0;
+ SHOW_OPENWINDOW = 1;
+ SHOW_ICONWINDOW = 2;
+ SHOW_FULLSCREEN = 3;
+ SHOW_OPENNOACTIVATE = 4;
+
+(* identifiers for the WM_SHOWWINDOW message *)
+ SW_PARENTCLOSING = 1;
+ SW_OTHERZOOM = 2;
+ SW_PARENTOPENING = 3;
+ SW_OTHERUNZOOM = 4;
+
+(* flags for regions *)
+ ERROR = 0;
+ NULLREGION = 1;
+ SIMPLEREGION = 2;
+ COMPLEXREGION = 3;
+
+(* styles for CombineRgn *)
+ RGN_AND = 1;
+ RGN_OR = 2;
+ RGN_XOR = 3;
+ RGN_DIFF = 4;
+ RGN_COPY = 5;
+
+(* Virtual Keys, Standard Set *)
+
+ VK_LBUTTON = #01;
+ VK_RBUTTON = #02;
+ VK_CANCEL = #03;
+ VK_MBUTTON = #04 (* NOT contiguous with L & RBUTTON *);
+ VK_BACK = #08;
+ VK_TAB = #09;
+ VK_CLEAR = #0c;
+ VK_RETURN = #0d;
+ VK_SHIFT = #10;
+ VK_CONTROL = #11;
+ VK_MENU = #12;
+ VK_PAUSE = #13;
+ VK_CAPITAL = #14;
+ VK_ESCAPE = #1b;
+ VK_SPACE = #20;
+
+ VK_PRIOR = #21;
+ VK_NEXT = #22;
+ VK_END = #23;
+ VK_HOME = #24;
+ VK_LEFT = #25;
+ VK_UP = #26;
+ VK_RIGHT = #27;
+ VK_DOWN = #28;
+
+(* VK_A thru VK_Z are the same as their ASCII equivalents: 'A' thru 'Z' *)
+(* VK_0 thru VK_9 are the same as their ASCII equivalents: '0' thru '0' *)
+
+ VK_SELECT = #29;
+ VK_PRINT = #2a;
+ VK_EXECUTE = #2b;
+ VK_INSERT = #2d;
+ VK_DELETE = #2e;
+ VK_HELP = #2f;
+
+ VK_NUMPAD0 = #60;
+ VK_NUMPAD1 = #61;
+ VK_NUMPAD2 = #62;
+ VK_NUMPAD3 = #63;
+ VK_NUMPAD4 = #64;
+ VK_NUMPAD5 = #65;
+ VK_NUMPAD6 = #66;
+ VK_NUMPAD7 = #67;
+ VK_NUMPAD8 = #68;
+ VK_NUMPAD9 = #69;
+ VK_MULTIPLY = #6A;
+ VK_ADD = #6B;
+ VK_SEPARATOR = #6C;
+ VK_SUBTRACT = #6D;
+ VK_DECIMAL = #6E;
+ VK_DIVIDE = #6F;
+
+ VK_F1 = #70;
+ VK_F2 = #71;
+ VK_F3 = #72;
+ VK_F4 = #73;
+ VK_F5 = #74;
+ VK_F6 = #75;
+ VK_F7 = #76;
+ VK_F8 = #77;
+ VK_F9 = #78;
+ VK_F10 = #79;
+ VK_F11 = #7a;
+ VK_F12 = #7b;
+ VK_F13 = #7c;
+ VK_F14 = #7d;
+ VK_F15 = #7e;
+ VK_F16 = #7f;
+
+ VK_NUMLOCK = #90;
+
+(* SetWindowsHook codes *)
+ WH_MSGFILTER = -1;
+ WH_JOURNALRECORD = 0;
+ WH_JOURNALPLAYBACK = 1;
+ WH_KEYBOARD = 2;
+ WH_GETMESSAGE = 3;
+ WH_CALLWNDPROC = 4;
+ WH_CBT = 5;
+ WH_SYSMSGFILTER = 6;
+ WH_WINDOWMGR = 7;
+
+(* HC_* Hook Codes *)
+ HC_LPLPFNNEXT = -2;
+ HC_LPFNNEXT = -1;
+ HC_ACTION = 0;
+ HC_GETNEXT = 1;
+ HC_SKIP = 2;
+ HC_NOREM = 3;
+
+(* CBT hook codes *)
+ HCBT_MOVESIZE = 0;
+ HCBT_MINMAX = 1;
+ HCBT_QS = 2;
+
+
+(* WH_MSGFILTER filter proc codes *)
+ MSGF_DIALOGBOX = 0;
+ MSGF_MESSAGEBOX = 1;
+ MSGF_MENU = 2;
+ MSGF_MOVE = 3;
+ MSGF_SIZE = 4;
+ MSGF_SCROLLBAR = 5;
+ MSGF_NEXTWINDOW = 6;
+
+(* Define window manager hook codes *)
+ WC_INIT = 1;
+ WC_SWP = 2;
+ WC_DEFWINDOWPROC = 3;
+ WC_MINMAX = 4;
+ WC_MOVE = 5;
+ WC_SIZE = 6;
+ WC_DRAWCAPTION = 7;
+
+(* message structure used in journaling *)
+
+TYPE
+
+ EVENTMSG = RECORD
+ message : unsigned;
+ paramL : WORD;
+ paramH : WORD;
+ time : DWORD;
+ END;
+ PEVENTMSGMSG = ADR OF EVENTMSG;
+ NPEVENTMSGMSG = ADR OF EVENTMSG;
+ LPEVENTMSGMSG = ADS OF EVENTMSG;
+
+CONST
+
+(* Binary raster ops *)
+ R2_BLACK = 1 (* 0 *);
+ R2_NOTMERGEPEN = 2 (* DPon *);
+ R2_MASKNOTPEN = 3 (* DPna *);
+ R2_NOTCOPYPEN = 4 (* PN *);
+ R2_MASKPENNOT = 5 (* PDna *);
+ R2_NOT = 6 (* Dn *);
+ R2_XORPEN = 7 (* DPx *);
+ R2_NOTMASKPEN = 8 (* DPan *);
+ R2_MASKPEN = 9 (* DPa *);
+ R2_NOTXORPEN = 10 (* DPxn *);
+ R2_NOP = 11 (* D *);
+ R2_MERGENOTPEN = 12 (* DPno *);
+ R2_COPYPEN = 13 (* P *);
+ R2_MERGEPENNOT = 14 (* PDno *);
+ R2_MERGEPEN = 15 (* DPo *);
+ R2_WHITE = 16 (* 1 *);
+
+(* Ternary raster operations *)
+ SRCCOPY = #00CC0020 (* dest=source *);
+ SRCPAINT = #00EE0086 (* dest=source OR dest *);
+ SRCAND = #008800C6 (* dest = source AND dest *);
+ SRCINVERT = #00660046 (* dest = source XOR dest *);
+ SRCERASE = #00440328 (* dest = source AND (not dest ) *);
+ NOTSRCCOPY = #00330008 (* dest = (not source) *);
+ NOTSRCERASE = #001100A6 (* dest = (not source) AND (not dest) *);
+ MERGECOPY = #00C000CA (* dest = (source AND pattern) *);
+ MERGEPAINT = #00BB0226 (* dest = (NOT source) OR dest *);
+ PATCOPY = #00F00021 (* dest = pattern *);
+ PATPAINT = #00FB0A09 (* dest = DPSnoo *);
+ PATINVERT = #005A0049 (* dest = pattern XOR dest *);
+ DSTINVERT = #00550009 (* dest = (not dest) *);
+ BLACKNESS = #00000042 (* dest = BLACK *);
+ WHITENESS = #00FF0062 (* dest = WHITE *);
+
+(* StretchBlt() modes *)
+ BLACKONWHITE = 1;
+ WHITEONBLACK = 2;
+ COLORONCOLOR = 3;
+
+(* PolyFill modes *)
+ ALTERNATE = 1;
+ WINDING = 2;
+
+(* text alignment options *)
+ TA_UPDATECP = 1;
+ TA_NOUPDATECP = 0;
+
+ TA_LEFT = 0;
+ TA_RIGHT = 2;
+ TA_CENTER = 6;
+
+ TA_TOP = 0;
+ TA_BOTTOM = 8;
+ TA_BASELINE = 24;
+
+ ETO_GRAYED = 1;
+ ETO_OPAQUE = 2;
+ ETO_CLIPPED = 4;
+
+
+
+ ASPECT_FILTERING = #0000001;
+
+(* Meta file function numbers *)
+ META_SETBKCOLOR = #201;
+ META_SETBKMODE = #102;
+ META_SETMAPMODE = #103;
+ META_SETROP2 = #104;
+ META_SETRELABS = #105;
+ META_SETPOLYFILLMODE = #106;
+ META_SETSTRETCHBLTMODE = #107;
+ META_SETTEXTCHAREXTRA = #108;
+ META_SETTEXTCOLOR = #209;
+ META_SETTEXTJUSTIFICATION = #20A;
+ META_SETWINDOWORG = #20B;
+ META_SETWINDOWEXT = #20C;
+ META_SETVIEWPORTORG = #20D;
+ META_SETVIEWPORTEXT = #20E;
+ META_OFFSETWINDOWORG = #20F;
+ META_SCALEWINDOWEXT = #400;
+ META_OFFSETVIEWPORTORG = #211;
+ META_SCALEVIEWPORTEXT = #412;
+ META_LINETO = #213;
+ META_MOVETO = #214;
+ META_EXCLUDECLIPRECT = #415;
+ META_INTERSECTCLIPRECT = #416;
+ META_ARC = #817;
+ META_ELLIPSE = #418;
+ META_FLOODFILL = #419;
+ META_PIE = #81A;
+ META_RECTANGLE = #41B;
+ META_ROUNDRECT = #61C;
+ META_PATBLT = #61D;
+ META_SAVEDC = #01E;
+ META_SETPIXEL = #41F;
+ META_OFFSETCLIPRGN = #220;
+ META_TEXTOUT = #521;
+ META_BITBLT = #922;
+ META_STRETCHBLT = #B23;
+ META_POLYGON = #324;
+ META_POLYLINE = #325;
+ META_ESCAPE = #626;
+ META_RESTOREDC = #127;
+ META_FILLREGION = #228;
+ META_FRAMEREGION = #429;
+ META_INVERTREGION = #12A;
+ META_PAINTREGION = #12B;
+ META_SELECTCLIPREGION = #12C;
+ META_SELECTOBJECT = #12D;
+ META_SETTEXTALIGN = #12E;
+ META_DRAWTEXT = #62F;
+ META_CHORD = #630;
+ META_CREATEBRUSH = #0F8;
+ META_CREATEPATTERNBRUSH = #1F9;
+ META_CREATEPENINDIRECT = #2FA;
+ META_CREATEFONTINDIRECT = #2FB;
+ META_CREATEBRUSHINDIRECT = #2FC;
+ META_CREATEBITMAPINDIRECT = #2FD;
+ META_CREATEBITMAP = #6FE;
+ META_CREATEREGION = #6FF;
+
+(* GDI escapes *)
+ NEWFRAME = 1;
+ ABORTDOC = 2;
+ NEXTBAND = 3;
+ SETCOLORTABLE = 4;
+ GETCOLORTABLE = 5;
+ FLUSHOUTPUT = 6;
+ DRAFTMODE = 7;
+ QUERYESCSUPPORT = 8;
+ SETABORTPROC = 9;
+ STARTDOC = 10;
+ ENDDOC = 11;
+ GETPHYSPAGESIZE = 12;
+ GETPRINTINGOFFSET = 13;
+ GETSCALINGFACTOR = 14;
+ MFCOMMENT = 15; (* Metafile comment escape *)
+ GETPENWIDTH = 16;
+ SETCOPYCOUNT = 17;
+ SELECTPAPERSOURCE = 18;
+ DEVICEDATA = 19;
+ PASSTHROUGH = 19;
+ GETTECHNOLGY = 20;
+ SETENDCAP = 21;
+ SETLINEJOIN = 22;
+ SETMITERLIMIT = 23;
+ BANDINFO = 24;
+ DRAWPATTERNRECT = 25;
+ GETVECTORPENSIZE = 26;
+ GETVECTORBRUSHSIZE = 27;
+ ENABLEDUPLEX = 28;
+ ENABLEMANUALFEED = 29;
+
+
+(* spooler error code *)
+ SP_NOTREPORTED = #4000 (* set if GDI did not report error *);
+ SP_ERROR = -1 (* general errors who know what went wrong *);
+ SP_APPABORT = -2 (* app aborted the job - callback function returned false *);
+ SP_USERABORT = -3 (* user aborted the job through spooler's front end *);
+ SP_OUTOFDISK = -4 (* not enough disk space to spool *);
+ SP_OUTOFMEMORY = -5;
+
+(* spooler WM_SPOOLERSTATUS wparm classes *)
+
+ PR_JOBSTATUS = #000;
+
+(* Object definitions for GDI EnumObjects. *)
+ OBJ_PEN = 1;
+ OBJ_BRUSH = 2;
+
+
+TYPE
+ HANDLE = WORD;
+ PHANDLE = ADR OF HANDLE;
+ SPHANDLE = ADR OF HANDLE;
+ LPHANDLE = ADS OF HANDLE;
+
+ FARPROC = ADSMEM;
+ NEARPROC = ADRMEM;
+(* GLOBALHANDLE = HANDLE; Conflict with function name *)
+(* LOCALHANDLE = HANDLE; Conflict with function name *)
+
+ BITMAP = RECORD
+ bmType : short;
+ bmWidth : short;
+ bmHeight : short;
+ bmWidthBytes : short;
+ bmPlanes : BYTE;
+ bmBitsPixel : BYTE;
+ bmBits : LPSTR;
+ END;
+ PBITMAP = ADR OF BITMAP;
+ NPBITMAP = ADR OF BITMAP;
+ LPBITMAP = ADS OF BITMAP;
+
+ HSTR = HANDLE;
+ HICON = HANDLE;
+ HDC = HANDLE;
+ HMENU = HANDLE;
+ HPEN = HANDLE;
+ HFONT = HANDLE;
+ HBRUSH = HANDLE;
+ HBITMAP = HANDLE;
+ HCURSOR = HANDLE;
+ HRGN = HANDLE;
+
+ POINT = RECORD
+ x : int;
+ y : int;
+ END;
+ PPOINT = ADR OF POINT;
+ NPPOINT = ADR OF POINT;
+ LPPOINT = ADS OF POINT;
+
+ RECT = RECORD
+ left : int;
+ top : int;
+ right : int;
+ bottom : int;
+ END;
+
+ PRECT = ADR OF RECT;
+ NPRECT = ADR OF RECT;
+ LPRECT = ADS OF RECT;
+
+ WNDCLASS = RECORD
+ style : WORD;
+ lpfnWndProc : FARPROC;
+ cbClsExtra : int;
+ cbWndExtra : int;
+ hInstance : HANDLE;
+ hIcon_ : HICON;
+ hCursor_ : HCURSOR;
+ hbrBackground : HBRUSH;
+ lpszMenuName : LPSTR;
+ lpszClassName : LPSTR;
+ END;
+ PWNDCLASS = ADR OF WNDCLASS;
+ NPWNDCLASS = ADR OF WNDCLASS;
+ LPWNDCLASS = ADS OF WNDCLASS;
+
+ HWND = HANDLE;
+
+(* Message structure *)
+ MSG = RECORD
+ hwnd_ : HWND;
+ message : WORD;
+ wParam : WORD;
+ lParam : LONG;
+ time : DWORD;
+ pt : POINT;
+ END;
+ PMSG = ADR OF MSG;
+ NPMSG = ADR OF MSG;
+ LPMSG = ADS OF MSG;
+
+(* Window field offsets for GetWindowLong & GetWindowWord *)
+
+CONST
+ GWL_WNDPROC = -4;
+ GWW_HINSTANCE = -6;
+ GWW_HWNDPARENT = -8;
+ GWW_HWNDTEXT = -10;
+ GWW_ID = -12;
+ GWL_STYLE = -16;
+
+(* Class field offsets for GetClassLong & GetClassWord *)
+ GCL_MENUNAME = -8;
+ GCW_HBRBACKGROUND = -10;
+ GCW_HCURSOR = -12;
+ GCW_HICON = -14;
+ GCW_HMODULE = -16;
+ GCW_CBWNDEXTRA = -18;
+ GCW_CBCLSEXTRA = -20;
+ GCL_WNDPROC = -24;
+ GCW_STYLE = -26;
+
+(* ** Window Procedure Messages *)
+
+ WM_NULL = #0000;
+ WM_CREATE = #0001;
+ WM_DESTROY = #0002;
+ WM_MOVE = #0003;
+ WM_SIZEWAIT = #0004;
+ WM_SIZE = #0005;
+ WM_ACTIVATE = #0006;
+ WM_SETFOCUS_ = #0007;
+ WM_KILLFOCUS_ = #0008;
+ WM_SETVISIBLE = #0009;
+ WM_ENABLE = #000a;
+ WM_SETREDRAW = #000b;
+ WM_SETTEXT = #000c;
+ WM_GETTEXT = #000d;
+ WM_GETTEXTLENGTH = #000e;
+ WM_PAINT = #000f;
+ WM_CLOSE = #0010;
+ WM_QUERYENDSESSION = #0011;
+ WM_QUIT = #0012;
+ WM_QUERYOPEN = #0013;
+ WM_ERASEBKGND = #0014;
+ WM_SYSCOLORCHANGE = #0015;
+ WM_ENDSESSION = #0016;
+ WM_SYSTEMERROR = #0017;
+ WM_SHOWWINDOW = #0018;
+ WM_CTLCOLOR = #0019;
+ WM_WININICHANGE = #001a;
+ WM_DEVMODECHANGE = #001b;
+ WM_ACTIVATEAPP = #001c;
+ WM_FONTCHANGE = #001d;
+ WM_TIMECHANGE = #001e;
+ WM_CANCELMODE = #001f;
+ WM_SETCURSOR = #0020;
+ WM_MOUSEACTIVATE = #0021;
+ WM_CHILDACTIVATE = #0022;
+ WM_QUEUESYNC = #0023;
+ WM_GETMINMAXINFO = #0024;
+ WM_PAINTICON = #0026;
+ WM_ICONERASEBKGND = #0027;
+ WM_NEXTDLGCTL = #0028;
+ WM_ALTTABACTIVE = #0029; (* for win386 only *)
+ WM_SPOOLERSTATUS = #002A;
+
+
+ WM_NCCREATE = #0081;
+ WM_NCDESTROY = #0082;
+ WM_NCCALCSIZE = #0083;
+ WM_NCHITTEST = #0084;
+ WM_NCPAINT = #0085;
+ WM_NCACTIVATE = #0086;
+ WM_GETDLGCODE = #0087;
+ WM_SYNCPAINT = #0088;
+ WM_SYNCTASK = #0089;
+
+ ST_BEGINSWP = 0;
+ ST_ENDSWP = 1;
+
+
+ WM_NCMOUSEMOVE = #00a0;
+ WM_NCLBUTTONDOWN = #00a1;
+ WM_NCLBUTTONUP = #00a2;
+ WM_NCLBUTTONDBLCLK = #00a3;
+ WM_NCRBUTTONDOWN = #00a4;
+ WM_NCRBUTTONUP = #00a5;
+ WM_NCRBUTTONDBLCLK = #00a6;
+ WM_NCMBUTTONDOWN = #00a7;
+ WM_NCMBUTTONUP = #00a8;
+ WM_NCMBUTTONDBLCLK = #00a9;
+
+(* WINWhere area codes *)
+ HTERROR = -2;
+ HTTRANSPARENT = -1;
+ HTNOWHERE = 0;
+ HTCLIENT = 1;
+ HTCAPTION = 2;
+ HTSYSMENU = 3;
+ HTGROWBOX = 4;
+ HTSIZE = HTGROWBOX;
+ HTMENU = 5;
+ HTHSCROLL = 6;
+ HTVSCROLL = 7;
+ HTREDUCE = 8;
+ HTZOOM = 9;
+ HTLEFT = 10;
+ HTRIGHT = 11;
+ HTTOP = 12;
+ HTTOPLEFT = 13;
+ HTTOPRIGHT = 14;
+ HTBOTTOM = 15;
+ HTBOTTOMLEFT = 16;
+ HTBOTTOMRIGHT = 17;
+ HTSIZEFIRST = HTLEFT;
+ HTSIZELAST = HTBOTTOMRIGHT;
+
+(* WM_MOUSEACTIVATE return codes *)
+ MA_ACTIVATE = 1;
+ MA_ACTIVATEANDEAT = 2;
+ MA_NOACTIVATE = 3;
+
+ WM_KEYFIRST = #0100;
+ WM_KEYLAST = #0107;
+
+ WM_KEYDOWN = #0100;
+ WM_KEYUP = #0101;
+ WM_CHAR = #0102;
+ WM_DEADCHAR = #0103;
+ WM_SYSKEYDOWN = #0104;
+ WM_SYSKEYUP = #0105;
+ WM_SYSCHAR = #0106;
+ WM_SYSDEADCHAR = #0107;
+ WM_YOMICHAR = #0108;
+ WM_MOVECONVERTWINDOW = #0109;
+ WM_CONVERTREQUEST = #010A;
+ WM_CONVERTRESULT = #010B;
+
+ WM_INITDIALOG = #0110;
+ WM_COMMAND = #0111;
+ WM_SYSCOMMAND = #0112;
+ WM_TIMER = #0113;
+ WM_HSCROLL = #0114;
+ WM_VSCROLL = #0115;
+ WM_INITMENU = #0116;
+ WM_INITMENUPOPUP = #0117;
+ WM_SYSTIMER = #0118;
+ WM_MENUSELECT = #011f;
+ WM_MENUCHAR = #0120;
+ WM_ENTERIDLE = #0121;
+
+ WM_MOUSEFIRST = #0200;
+ WM_MOUSELAST = #0209;
+
+ WM_MOUSEMOVE = #0200 (* mouse related constants *);
+ WM_LBUTTONDOWN = #0201;
+ WM_LBUTTONUP = #0202;
+ WM_LBUTTONDBLCLK = #0203;
+ WM_RBUTTONDOWN = #0204;
+ WM_RBUTTONUP = #0205;
+ WM_RBUTTONDBLCLK = #0206;
+ WM_MBUTTONDOWN = #0207;
+ WM_MBUTTONUP = #0208;
+ WM_MBUTTONDBLCLK = #0209;
+
+ WM_KANJIFIRST = #0280;
+ WM_KANJILAST = #029f;
+
+(* clipboard messages *)
+ WM_CUT = #0300;
+ WM_COPY = #0301;
+ WM_PASTE = #0302;
+ WM_CLEAR = #0303;
+ WM_UNDO = #0304;
+ WM_RENDERFORMAT = #0305;
+ WM_RENDERALLFORMATS = #0306;
+ WM_DESTROYCLIPBOARD = #0307;
+ WM_DRAWCLIPBOARD = #0308;
+ WM_PAINTCLIPBOARD = #0309;
+ WM_VSCROLLCLIPBOARD = #030a;
+ WM_SIZECLIPBOARD = #030b;
+ WM_ASKCBFORMATNAME = #030c;
+ WM_CHANGECBCHAIN = #030d;
+ WM_HSCROLLCLIPBOARD = #030e;
+
+(* 0x03f0 to 0x03ff are reserved *)
+(* private window messages start here *)
+ WM_USER = #0400;
+
+
+
+{ $IFDECL MAKELONG $THEN BEGIN }
+ FUNCTION MAKELONG (
+ w1_,w2_ : WORD
+ ) : LONG;
+{ $END }
+
+{ $IFDECL LOWORD $THEN BEGIN }
+ FUNCTION LOWORD (
+ l_ : LONG
+ ) : WORD;
+{ $END }
+
+{ $IFDECL HIWORD $THEN BEGIN }
+ FUNCTION HIWORD (
+ l_ : LONG
+ ) : WORD;
+{ $END }
+
+{ $IFDECL LOBYTE $THEN BEGIN }
+ FUNCTION LOBYTE (
+ w_ : WORD
+ ) : BYTE;
+{ $END }
+
+{ $IFDECL HIBYTE $THEN BEGIN }
+ FUNCTION HIBYTE (
+ w_ : WORD
+ ) : BYTE;
+{ $END }
+
+{ $IFDECL MAKEPOINT $THEN BEGIN }
+ FUNCTION MAKEPOINT (
+ l_ : LONG
+ ) : POINT;
+{ $END }
+
+{ $IFDECL RegisterWindowMessage $THEN BEGIN }
+ FUNCTION RegisterWindowMessage (
+ l_ : LPSTR
+ ) : WORD;
+{ $END }
+
+(* Size message commands *)
+
+CONST
+ SIZENORMAL = 0;
+ SIZEICONIC = 1;
+ SIZEFULLSCREEN = 2;
+ SIZEZOOMSHOW = 3;
+ SIZEZOOMHIDE = 4;
+
+(* Key state masks for mouse messages *)
+ MK_LBUTTON = #0001;
+ MK_RBUTTON = #0002;
+ MK_SHIFT = #0004;
+ MK_CONTROL = #0008;
+ MK_MBUTTON = #0010;
+
+(* Window styles *)
+ WS_TILED = #00000000;
+ WS_OVERLAPPED = WS_TILED;
+ WS_ICONICPOPUP = #c0000000;
+ WS_POPUP = #80000000;
+ WS_CHILD = #40000000;
+ WS_MINIMIZE = #20000000;
+ WS_VISIBLE = #10000000;
+ WS_DISABLED = #08000000;
+ WS_CLIPSIBLINGS = #04000000;
+ WS_CLIPCHILDREN = #02000000;
+ WS_MAXIMIZE = #01000000;
+
+ WS_BORDER = #00800000;
+ WS_CAPTION = #00c00000;
+ WS_DLGFRAME = #00400000;
+ WS_VSCROLL = #00200000;
+ WS_HSCROLL = #00100000;
+ WS_SYSMENU = #00080000;
+ WS_SIZEBOX = #00040000;
+ WS_THICKFRAME = #00040000;
+ WS_GROUP = #00020000;
+ WS_TABSTOP = #00010000;
+
+ WS_MINIMIZEBOX = #00020000;
+ WS_MAXIMIZEBOX = #00010000;
+
+ WS_ICONIC = WS_MINIMIZE;
+
+
+(* Class styles *)
+ CS_VREDRAW = #0001;
+ CS_HREDRAW = #0002;
+ CS_KEYCVTWINDOW = #0004;
+ CS_DBLCLKS = #0008;
+ CS_OEMCHARS = #0010;
+ CS_OWNDC = #0020;
+ CS_CLASSDC = #0040;
+ CS_PARENTDC = #0080;
+ CS_NOKEYCVT = #0100;
+ CS_SAVEBITS = #0800;
+ CS_NOCLOSE = #0200;
+ CS_BYTEALIGNCLIENT = #1000;
+ CS_BYTEALIGNWINDOW = #2000;
+
+(* Shorthand for the common cases *)
+ WS_TILEDWINDOW = #00CF0000; (* WS_TILED | WS_CAPTION | WS_SYSMENU | WS_SIZEBOX *)
+ WS_OVERLAPPEDWINDOW = WS_TILEDWINDOW;
+ WS_POPUPWINDOW = #80880000; (* WS_POPUP | WS_BORDER | WS_SYSMENU *)
+ WS_CHILDWINDOW = (WS_CHILD);
+
+(* clipboard metafile picture structure *)
+TYPE
+ HANDLETABLE = RECORD
+ objectHandle[1] : HANDLE;
+ END;
+ PHANDLETABLE = ADR OF HANDLETABLE;
+ LPHANDLETABLE = ADS OF HANDLETABLE;
+
+ METARECORD = RECORD
+ rdSize : DWORD;
+ rdFunction : WORD;
+ rdParm[1] : WORD;
+ END;
+ PMETARECORD = ADR OF METARECORD;
+ LPMETARECORD = ADS OF METARECORD;
+
+ METAFILEPICT = RECORD
+ mm : int;
+ xExt : int;
+ yExt : int;
+ hMF : HANDLE;
+ END;
+ LPMETAFILEPICT = ADS OF METAFILEPICT;
+
+(* predefined clipboard formats *)
+
+CONST
+ CF_TEXT = 1;
+ CF_BITMAP = 2;
+ CF_METAFILEPICT = 3;
+ CF_SYLK = 4;
+ CF_DIF = 5;
+ CF_TIFF = 6;
+ CF_OEMTEXT = 7;
+
+ CF_OWNERDISPLAY = #80 (* owner display *);
+ CF_DSPTEXT = #81 (* display text *);
+ CF_DSPBITMAP = #82 (* display bitmap *);
+ CF_DSPMETAFILEPICT = #83 (* display metafile *);
+
+(* Private clipboard format range *)
+ CF_PRIVATEFIRST = #200 (* Anything in this range doesn't *);
+ CF_PRIVATELAST = #2ff (* get GlobalFree'd *);
+ CF_GDIOBJFIRST = #300 (* Anything in this range gets *);
+ CF_GDIOBJLAST = #3ff (* DeleteObject'ed *);
+
+
+TYPE
+ PAINTSTRUCT = RECORD
+ hdc_ : HDC;
+ fErase : BOOL;
+ rcPaint : RECT;
+ fRestore : BOOL;
+ fIncUpdate : BOOL;
+ rgbReserved : ARRAY [0..15] OF BYTE;
+ END;
+ PPAINTSTRUCT = ADR OF PAINTSTRUCT;
+ NPPAINTSTRUCT = ADR OF PAINTSTRUCT;
+ LPPAINTSTRUCT = ADS OF PAINTSTRUCT;
+
+ CREATESTRUCT = RECORD
+ lpCreateParams : LPSTR;
+ hInstance : HANDLE;
+ hMenu : HANDLE;
+ hwndParent : HWND;
+ cy : int;
+ cx : int;
+ y : int;
+ x : int;
+ style : long;
+ lpszName : LPSTR;
+ lpszClass : LPSTR;
+ END;
+ LPCREATESTRUCT = ADS OF CREATESTRUCT;
+
+(* TextMetric structure *)
+ TEXTMETRIC = RECORD
+ tmHeight : INTEGER2;
+ tmAscent : INTEGER2;
+ tmDescent : INTEGER2;
+ tmInternalLeading : INTEGER2;
+ tmExternalLeading : INTEGER2;
+ tmAveCharWidth : INTEGER2;
+ tmMaxCharWidth : INTEGER2;
+ tmWeight : INTEGER2;
+ tmItalic : BYTE;
+ tmUnderlined : BYTE;
+ tmStruckOut : BYTE;
+ tmFirstChar : BYTE;
+ tmLastChar : BYTE;
+ tmDefaultChar : BYTE;
+ tmBreakChar : BYTE;
+ tmPitchAndFamily : BYTE;
+ tmCharSet : BYTE;
+ tmOverhang : INTEGER2;
+ tmDigitizedAspectX : INTEGER2;
+ tmDigitizedAspectY : INTEGER2;
+ END;
+ PTEXTMETRIC = ADR OF TEXTMETRIC;
+ NPTEXTMETRIC = ADR OF TEXTMETRIC;
+ LPTEXTMETRIC = ADS OF TEXTMETRIC;
+
+(* GDI logical objects *)
+(* Pel Array *)
+ PELARRAY = RECORD
+ paXCount : INTEGER2;
+ paYCount : INTEGER2;
+ paXExt : INTEGER2;
+ paYExt : INTEGER2;
+ paRGBs : BYTE;
+ END;
+ PPELARRAY = ADR OF PELARRAY;
+ NPPELARRAY = ADR OF PELARRAY;
+ LPPELARRAY = ADS OF PELARRAY;
+
+(* Logical Brush *)
+ LOGBRUSH = RECORD
+ lbStyle : WORD;
+ lbColor : DWORD;
+ lbHatch : INTEGER2;
+ END;
+ PLOGBRUSH = ADR OF LOGBRUSH;
+ NPLOGBRUSH = ADR OF LOGBRUSH;
+ LPLOGBRUSH = ADS OF LOGBRUSH;
+
+(* A PATTERN and a LOGBRUSH are the same thing *)
+ PATTERN = LOGBRUSH;
+ PPATTERN = ADR OF PATTERN;
+ NPPATTERN = ADR OF PATTERN;
+ LPPATTERN = ADS OF PATTERN;
+
+(* Logical Pen *)
+ LOGPEN = RECORD
+ lopnStyle : WORD;
+ lopnWidth : POINT;
+ lopnColor : DWORD;
+ END;
+ PLOGPEN = ADR OF LOGPEN;
+ NPLOGPEN = ADR OF LOGPEN;
+ LPLOGPEN = ADS OF LOGPEN;
+
+(* Logical Font *)
+
+
+CONST
+ LF_FACESIZE = 32;
+
+
+TYPE
+ LOGFONT = RECORD
+ lfHeight : INTEGER2;
+ lfWidth : INTEGER2;
+ lfEscapement : INTEGER2;
+ lfOrientation : INTEGER2;
+ lfWeight : INTEGER2;
+ lfItalic : BYTE;
+ lfUnderline : BYTE;
+ lfStrikeOut : BYTE;
+ lfCharSet : BYTE;
+ lfOutPrecision : BYTE;
+ lfClipPrecision : BYTE;
+ lfQuality : BYTE;
+ lfPitchAndFamily : BYTE;
+ lfFaceName : ARRAY [0..LF_FACESIZE-1] OF BYTE;
+ END;
+ PLOGFONT = ADR OF LOGFONT;
+ NPLOGFONT = ADR OF LOGFONT;
+ LPLOGFONT = ADS OF LOGFONT;
+
+
+(* Logical font constants *)
+
+CONST
+ OUT_DEFAULT_PRECIS = 0;
+ OUT_STRING_PRECIS = 1;
+ OUT_CHARACTER_PRECIS = 2;
+ OUT_STROKE_PRECIS = 3;
+
+ CLIP_DEFAULT_PRECIS = 0;
+ CLIP_CHARACTER_PRECIS = 1;
+ CLIP_STROKE_PRECIS = 2;
+
+ DEFAULT_QUALITY = 0;
+ DRAFT_QUALITY = 1;
+ PROOF_QUALITY = 2;
+
+ DEFAULT_PITCH = 0;
+ FIXED_PITCH = 1;
+ VARIABLE_PITCH = 2;
+
+ ANSI_CHARSET = 0;
+ SHIFTJIS_CHARSET = 128; (* Kanji CharSet *)
+ OEM_CHARSET = 255;
+
+(* GDI font families. *)
+ FF_DONTCARE = 0 (* Don't care or don't know. *);
+ FF_ROMAN = 16 (* Variable stroke width, serifed. *);
+ (* Times Roman, Century Schoolbook, etc. *)
+ FF_SWISS = 32 (* Variable stroke width, sans-serifed. *);
+ (* Helvetica, Swiss, etc. *)
+ FF_MODERN = 48 (* Constant stroke width, serifed or sans-serifed. *);
+ (* Pica, Elite, Courier, etc. *)
+ FF_SCRIPT = 64 (* Cursive, etc. *);
+ FF_DECORATIVE = 80 (* Old English, etc. *);
+
+(* Font weights lightest to darkest. *)
+ FW_DONTCARE = 0;
+ FW_THIN = 100;
+ FW_EXTRALIGHT = 200;
+ FW_LIGHT = 300;
+ FW_NORMAL = 400;
+ FW_MEDIUM = 500;
+ FW_SEMIBOLD = 600;
+ FW_BOLD = 700;
+ FW_EXTRABOLD = 800;
+ FW_HEAVY = 900;
+
+ FW_ULTRALIGHT = (FW_EXTRALIGHT);
+ FW_REGULAR = (FW_NORMAL);
+ FW_DEMIBOLD = (FW_SEMIBOLD);
+ FW_ULTRABOLD = (FW_EXTRABOLD);
+ FW_BLACK = (FW_HEAVY);
+
+
+(* EnumFonts masks. *)
+ RASTER_FONTTYPE = #0001;
+ DEVICE_FONTTYPE = #0002;
+
+
+(* GDI rgb values packed into a dword *)
+
+{ $IFDECL RGB $THEN BEGIN }
+ FUNCTION RGB (
+ r,g,b : BYTE
+ ) : DWORD;
+{ $END }
+
+{ $IFDECL GetRValue $THEN BEGIN }
+ FUNCTION GetRValue (
+ d_ : DWORD
+ ) : BYTE;
+{ $END }
+
+{ $IFDECL GetGValue $THEN BEGIN }
+ FUNCTION GetGValue (
+ d_ : DWORD
+ ) : BYTE;
+{ $END }
+
+{ $IFDECL GetBValue $THEN BEGIN }
+ FUNCTION GetBValue (
+ d_ : DWORD
+ ) : BYTE;
+{ $END }
+
+(* GDI Background Modes *)
+
+CONST
+ TRANSPARENT = 1;
+ OPAQUE = 2;
+
+(* GDI map modes *)
+ MM_TEXT = 1;
+ MM_LOMETRIC = 2;
+ MM_HIMETRIC = 3;
+ MM_LOENGLISH = 4;
+ MM_HIENGLISH = 5;
+ MM_TWIPS = 6;
+ MM_ISOTROPIC = 7;
+ MM_ANISOTROPIC = 8;
+
+(* GDI coordinate modes *)
+
+ ABSOLUTE = 1;
+ RELATIVE = 2;
+
+(* Stock Logical Objects *)
+ WHITE_BRUSH = 0;
+ LTGRAY_BRUSH = 1;
+ GRAY_BRUSH = 2;
+ DKGRAY_BRUSH = 3;
+ BLACK_BRUSH = 4;
+ NULL_BRUSH = 5;
+ HOLLOW_BRUSH = (NULL_BRUSH);
+ WHITE_PEN = 6;
+ BLACK_PEN = 7;
+ NULL_PEN = 8;
+ OEM_FIXED_FONT = 10;
+ ANSI_FIXED_FONT = 11;
+ ANSI_VAR_FONT = 12;
+ SYSTEM_FONT = 13;
+ DEVICEDEFAULT_FONT = 14;
+
+(* GDI Brush Style definitions. *)
+
+ BS_SOLID = 0;
+ BS_NULL = 1;
+ BS_HOLLOW = (BS_NULL);
+ BS_HATCHED = 2;
+ BS_PATTERN = 3;
+ BS_INDEXED = 4;
+
+
+(* GDI Hatch Style definitions. *)
+
+ HS_HORIZONTAL = 0 (* ----- *);
+ HS_VERTICAL = 1 (* ||||| *);
+ HS_FDIAGONAL = 2 (* ///// *);
+ HS_BDIAGONAL = 3 (* \\\\\ *);
+ HS_CROSS = 4 (* +++++ *);
+ HS_DIAGCROSS = 5 (* xxxxx *);
+
+
+(* GDI Pen Style definitions *)
+ PS_SOLID = 0 (* solid pen *);
+ PS_DASH = 1 (* ------- *);
+ PS_DOT = 2 (* ....... *);
+ PS_DASHDOT = 3 (* _._._._ *);
+ PS_DASHDOTDOT = 4 (* _.._.._ *);
+ PS_NULL = 5 (* *);
+
+(* Device Parameters for GetDeviceCaps() *)
+
+ DRIVERVERSION = 0 (* Device driver version *);
+ TECHNOLOGY = 2 (* Device classification *);
+ HORZSIZE = 4 (* Horizontal size in millimeters *);
+ VERTSIZE = 6 (* Vertical size in millimeters *);
+ HORZRES = 8 (* Horizontal width in pixels *);
+ VERTRES = 10 (* Vertical width in pixels *);
+ BITSPIXEL = 12 (* Number of bits per pixel *);
+ PLANES = 14 (* Number of planes *);
+ NUMBRUSHES = 16 (* Number of brushes the device has *);
+ NUMPENS = 18 (* Number of pens the device has *);
+ NUMMARKERS = 20 (* Number of markers the device has *);
+ NUMFONTS = 22 (* Number of fonts the device has *);
+ NUMCOLORS = 24;
+ PDEVICESIZE = 26 (* Size required for device descriptor *);
+ CURVECAPS = 28 (* Curves capabilities *);
+ LINECAPS = 30 (* Line capabilities *);
+ POLYGONALCAPS = 32 (* Polygonal capabilities *);
+ TEXTCAPS = 34 (* Text capabilities *);
+ CLIPCAPS = 36 (* Clipping capabilities *);
+ RASTERCAPS = 38 (* Bitblt capabilities *);
+ ASPECTX = 40 (* Length of the X leg *);
+ ASPECTY = 42 (* Length of the Y leg *);
+ ASPECTXY = 44 (* Length of the hypotenuse *);
+
+ LOGPIXELSX = 88 (* Logical pixels/inch in X *);
+ LOGPIXELSY = 90 (* Logical pixels/inch in Y *);
+
+
+(* Device capability masks *)
+(* Device Technologies *)
+
+ DT_PLOTTER = 0 (* Vector plotter *);
+ DT_RASDISPLAY = 1 (* Raster display *);
+ DT_RASPRINTER = 2 (* Raster printer *);
+ DT_RASCAMERA = 3 (* Raster camera *);
+ DT_CHARSTREAM = 4 (* Character-stream, PLP *);
+ DT_METAFILE = 5 (* Metafile, VDM *);
+ DT_DISPFILE = 6 (* Display-file *);
+
+(* Curve Capabilities *)
+
+ CC_NONE = 0 (* Curves not supported *);
+ CC_CIRCLES = 1 (* Can do circles *);
+ CC_PIE = 2 (* Can do pie wedges *);
+ CC_CHORD = 4 (* Can do chord arcs *);
+ CC_ELLIPSES = 8 (* Can do ellipese *);
+ CC_WIDE = 16 (* Can do wide lines *);
+ CC_STYLED = 32 (* Can do styled lines *);
+ CC_WIDESTYLED = 64 (* Can do wide styled lines*);
+ CC_INTERIORS = 128 (* Can do interiors *);
+
+(* Line Capabilities *)
+
+ LC_NONE = 0 (* Lines not supported *);
+ LC_POLYLINE = 2 (* Can do polylines *);
+ LC_MARKER = 4 (* Can do markers *);
+ LC_POLYMARKER = 8 (* Can do polymarkers *);
+ LC_WIDE = 16 (* Can do wide lines *);
+ LC_STYLED = 32 (* Can do styled lines *);
+ LC_WIDESTYLED = 64 (* Can do wide styled lines*);
+ LC_INTERIORS = 128 (* Can do interiors *);
+
+(* Polygonal Capabilities *)
+
+ PC_NONE = 0 (* Polygonals not supported*);
+ PC_POLYGON = 1 (* Can do polygons *);
+ PC_RECTANGLE = 2 (* Can do rectangles *);
+ PC_TRAPEZOID = 4 (* Can do trapezoids *);
+ PC_SCANLINE = 8 (* Can do scanlines *);
+ PC_WIDE = 16 (* Can do wide borders *);
+ PC_STYLED = 32 (* Can do styled borders *);
+ PC_WIDESTYLED = 64 (* Can do wide styled borders*);
+ PC_INTERIORS = 128 (* Can do interiors *);
+
+(* Polygonal Capabilities *)
+
+ CP_NONE = 0 (* no clipping of Output *);
+ CP_RECTANGLE = 1 (* Output clipped to Rects *);
+
+(* Text Capabilities *)
+
+ TC_OP_CHARACTER = #0001 (* Can do OutputPrecision CHARACTER *);
+ TC_OP_STROKE = #0002 (* Can do OutputPrecision STROKE *);
+ TC_CP_STROKE = #0004 (* Can do ClipPrecision STROKE *);
+ TC_CR_90 = #0008 (* Can do CharRotAbility 90 *);
+ TC_CR_ANY = #0010 (* Can do CharRotAbility ANY *);
+ TC_SF_X_YINDEP = #0020 (* Can do ScaleFreedom X_YINDEPENDENT *);
+ TC_SA_DOUBLE = #0040 (* Can do ScaleAbility DOUBLE *);
+ TC_SA_INTEGER = #0080 (* Can do ScaleAbility INTEGER *);
+ TC_SA_CONTIN = #0100 (* Can do ScaleAbility CONTINUOUS *);
+ TC_EA_DOUBLE = #0200 (* Can do EmboldenAbility DOUBLE *);
+ TC_IA_ABLE = #0400 (* Can do ItalisizeAbility ABLE *);
+ TC_UA_ABLE = #0800 (* Can do UnderlineAbility ABLE *);
+ TC_SO_ABLE = #1000 (* Can do StrikeOutAbility ABLE *);
+ TC_RA_ABLE = #2000 (* Can do RasterFontAble ABLE *);
+ TC_VA_ABLE = #4000 (* Can do VectorFontAble ABLE *);
+ TC_RESERVED = #8000 (* Reserved. *);
+(* Raster Capabilities *)
+
+ RC_BITBLT = 1 (* Can do standard non-stretching, non-inverting BLT. *);
+ RC_BANDING = 2 (* Device requires banding support *);
+ RC_SCALING = 4 (* Device requires scaling support *);
+ RC_BITMAP64 = 8 (* Device can support >64K bitmap *);
+
+(* PeekMessage options *)
+
+ PM_REMOVE = TRUE_;
+ PM_NOREMOVE = FALSE_;
+ PM_NOYIELD = #02;
+
+
+{ $IFDECL GetMessage $THEN BEGIN }
+ FUNCTION GetMessage (
+ l_ : LPMSG;
+ h_ : HWND;
+ w_,x_ : WORD
+ ) : BOOL;
+{ $END }
+
+{ $IFDECL PeekMessage $THEN BEGIN }
+ FUNCTION PeekMessage (
+ l_ : LPMSG;
+ h_ : HWND;
+ w_,x_ : WORD;
+ b_ : BOOL
+ ) : BOOL;
+{ $END }
+
+{ $IFDECL TranslateMessage $THEN BEGIN }
+ FUNCTION TranslateMessage (
+ l_ : LPMSG
+ ) : BOOL;
+{ $END }
+
+{ $IFDECL DispatchMessage $THEN BEGIN }
+ FUNCTION DispatchMessage (
+ l_ : LPMSG
+ ) : LONG;
+{ $END }
+
+
+{ $IFDECL SwapMouseButton $THEN BEGIN }
+ FUNCTION SwapMouseButton (
+ b_ : BOOL
+ ) : BOOL;
+{ $END }
+
+{ $IFDECL GetMessagePos $THEN BEGIN }
+ FUNCTION GetMessagePos : DWORD;
+{ $END }
+
+{ $IFDECL GetMessageTime $THEN BEGIN }
+ FUNCTION GetMessageTime : long;
+{ $END }
+
+
+{ $IFDECL GetSysModalWindow $THEN BEGIN }
+ FUNCTION GetSysModalWindow : HWND;
+{ $END }
+
+{ $IFDECL SetSysModalWindow $THEN BEGIN }
+ FUNCTION SetSysModalWindow (
+ h_ : HWND
+ ) : HWND;
+{ $END }
+
+
+{ $IFDECL SendMessage $THEN BEGIN }
+ FUNCTION SendMessage (
+ h_ : HWND;
+ w_,x_ : WORD;
+ l_ : LONG
+ ) : long;
+{ $END }
+
+{ $IFDECL PostMessage $THEN BEGIN }
+ FUNCTION PostMessage (
+ h_ : HWND;
+ w_,x_ : WORD;
+ l_ : LONG
+ ) : BOOL;
+{ $END }
+
+{ $IFDECL PostAppMessage $THEN BEGIN }
+ FUNCTION PostAppMessage (
+ h_ : HANDLE;
+ w_,x_ : WORD;
+ l_ : LONG
+ ) : BOOL;
+{ $END }
+
+{ $IFDECL ReplyMessage $THEN BEGIN }
+ PROCEDURE ReplyMessage (
+ l_ : long
+ );
+{ $END }
+
+{ $IFDECL WaitMessage $THEN BEGIN }
+ PROCEDURE WaitMessage;
+{ $END }
+
+{ $IFDECL DefWindowProc $THEN BEGIN }
+ FUNCTION DefWindowProc (
+ h_ : HWND;
+ w_,x_ : WORD;
+ l_ : LONG
+ ) : long;
+{ $END }
+
+{ $IFDECL PostQuitMessage $THEN BEGIN }
+ PROCEDURE PostQuitMessage (
+ i_ : int
+ );
+{ $END }
+
+{ $IFDECL CallWindowProc $THEN BEGIN }
+ FUNCTION CallWindowProc (
+ f_ : FARPROC;
+ h_ : HWND;
+ w_,x_ : WORD;
+ l_ : LONG
+ ) : long;
+{ $END }
+
+{ $IFDECL InSendMessage $THEN BEGIN }
+ FUNCTION InSendMessage : BOOL;
+{ $END }
+
+
+{ $IFDECL GetDoubleClickTime $THEN BEGIN }
+ FUNCTION GetDoubleClickTime : WORD;
+{ $END }
+
+{ $IFDECL SetDoubleClickTime $THEN BEGIN }
+ FUNCTION SetDoubleClickTime (
+ w_ : WORD
+ );
+{ $END }
+
+{ $IFDECL RegisterClass $THEN BEGIN }
+ FUNCTION RegisterClass (
+ l_ : LPWNDCLASS
+ ) : BOOL;
+{ $END }
+
+{ $IFDECL SetMessageQueue $THEN BEGIN }
+ FUNCTION SetMessageQueue (
+ i_ : int
+ ) : BOOL;
+{ $END }
+
+{ $IFDECL CreateWindow $THEN BEGIN }
+ FUNCTION CreateWindow (
+ l_,m_ : LPSTR;
+ d_ : DWORD;
+ i_,j_,k_,n_ : int;
+ h_ : HWND;
+ o_ : HMENU;
+ p_ : HANDLE;
+ q_ : LPSTR
+ ) : HWND;
+{ $END }
+
+CONST
+ CW_USEDEFAULT = RETYPE( int, #8000); { used on both x and cx }
+
+{ $IFDECL IsWindow $THEN BEGIN }
+ FUNCTION IsWindow (
+ h_ : HWND
+ ) : BOOL;
+{ $END }
+
+{ $IFDECL DestroyWindow $THEN BEGIN }
+ FUNCTION DestroyWindow (
+ h_ : HWND
+ ) : BOOL;
+{ $END }
+
+
+{ $IFDECL ShowWindow $THEN BEGIN }
+ FUNCTION ShowWindow (
+ h_ : HWND;
+ i_ : int
+ ) : BOOL;
+{ $END }
+
+{ $IFDECL FlashWindow $THEN BEGIN }
+ FUNCTION FlashWindow (
+ h_ : HWND;
+ b_ : BOOL
+ ) : BOOL;
+{ $END }
+
+
+{ $IFDECL OpenIcon $THEN BEGIN }
+ FUNCTION OpenIcon (
+ h_ : HWND
+ ) : BOOL;
+{ $END }
+
+{ $IFDECL CloseWindow $THEN BEGIN }
+ FUNCTION CloseWindow (
+ h_ : HWND
+ ) : int;
+{ $END }
+
+{ $IFDECL MoveWindow $THEN BEGIN }
+ PROCEDURE MoveWindow (
+ h_ : HWND;
+ i_,j_,k_,l_ : int;
+ b_ : BOOL
+ );
+{ $END }
+
+{ $IFDECL IsWindowVisible $THEN BEGIN }
+ FUNCTION IsWindowVisible (
+ h_ : HWND
+ ) : BOOL;
+{ $END }
+
+{ $IFDECL IsIconic $THEN BEGIN }
+ FUNCTION IsIconic (
+ h_ : HWND
+ ) : BOOL;
+{ $END }
+
+{ $IFDECL AnyPopup $THEN BEGIN }
+ FUNCTION AnyPopup : BOOL;
+{ $END }
+
+{ $IFDECL BringWindowToTop $THEN BEGIN }
+ PROCEDURE BringWindowToTop (
+ h_ : HWND
+ );
+{ $END }
+
+{ $IFDECL IsZoomed $THEN BEGIN }
+ FUNCTION IsZoomed (
+ h_ : HWND
+ ) : BOOL;
+{ $END }
+
+(* SetWindowPos flags *)
+
+CONST
+ SWP_NOSIZE = #01;
+ SWP_NOMOVE = #02;
+ SWP_NOZORDER = #04;
+ SWP_NOREDRAW = #08;
+ SWP_NOACTIVATE = #10;
+ SWP_DRAWFRAME = #20;
+ SWP_SHOWWINDOW = #40;
+ SWP_HIDEWINDOW = #80;
+ SWP_NOCOPYBITS = #0100;
+ SWP_NOREPOSITION = #200;
+
+
+(* DrawFrame and associated defines *)
+ DF_SHIFT0 = #0000;
+ DF_SHIFT1 = #0001;
+ DF_SHIFT2 = #0002;
+ DF_SHIFT3 = #0003;
+ DF_PATCOPY = #0000;
+ DF_PATINVERT = #0004;
+
+ DF_SCROLLBAR = 0;
+ DF_BACKGROUND = 8;
+ DF_ACTIVECAPTION = 16;
+ DF_INACTIVECAPTION = 24;
+ DF_MENU = 32;
+ DF_WINDOW = 40;
+ DF_WINDOWFRAME = 48;
+ DF_MENUTEXT = 56;
+ DF_WINDOWTEXT = 64;
+ DF_CAPTIONTEXT = 72;
+ DF_ACTIVEBORDER = 80;
+ DF_INACTIVEBORDER = 88;
+ DF_APPWORKSPACE = 96;
+ DF_GRAY = 104;
+
+(* DrawText format flags *)
+
+
+ DT_LEFT = #00;
+ DT_CENTER = #01;
+ DT_RIGHT = #02;
+ DT_TOP = #00;
+ DT_VCENTER = #04;
+ DT_BOTTOM = #08;
+ DT_WORDBREAK = #10;
+ DT_SINGLELINE = #20;
+ DT_EXPANDTABS = #40;
+ DT_TABSTOP = #80;
+ DT_NOCLIP = #100;
+ DT_EXTERNALLEADING = #200;
+ DT_CALCRECT = #400;
+ DT_NOPREFIX = #800;
+ DT_INTERNAL = #1000;
+
+
+{ $IFDECL DrawText $THEN BEGIN }
+ PROCEDURE DrawText (
+ h_ : HDC;
+ l_ : LPSTR;
+ i_ : int;
+ m_ : LPRECT;
+ w_ : WORD
+ );
+{ $END }
+
+{ $IFDECL DrawIcon $THEN BEGIN }
+ FUNCTION DrawIcon (
+ h_ : HDC;
+ i_,j_ : int;
+ k_ : HICON
+ ) : BOOL;
+{ $END }
+
+
+{ $IFDECL CreateDialog $THEN BEGIN }
+ FUNCTION CreateDialog (
+ h_ : HANDLE;
+ l_ : LPSTR;
+ i_ : HWND;
+ f_ : FARPROC
+ ) : HWND;
+{ $END }
+
+{ $IFDECL CreateDialogIndirect $THEN BEGIN }
+ FUNCTION CreateDialogIndirect (
+ h_ : HANDLE;
+ l_ : LPSTR;
+ i_ : HWND;
+ f_ : FARPROC
+ ) : HWND;
+{ $END }
+
+{ $IFDECL DialogBox $THEN BEGIN }
+ FUNCTION DialogBox (
+ h_ : HANDLE;
+ l_ : LPSTR;
+ i_ : HWND;
+ f_ : FARPROC
+ ) : int;
+{ $END }
+
+{ $IFDECL DialogBoxIndirect $THEN BEGIN }
+ FUNCTION DialogBoxIndirect (
+ h_ : HANDLE;
+ h_ : HANDLE;
+ i_ : HWND;
+ f_ : FARPROC
+ ) : int;
+{ $END }
+
+{ $IFDECL EndDialog $THEN BEGIN }
+ PROCEDURE EndDialog (
+ h_ : HWND;
+ i_ : int
+ );
+{ $END }
+
+{ $IFDECL GetDlgItem $THEN BEGIN }
+ FUNCTION GetDlgItem (
+ h_ : HWND;
+ i_ : int
+ ) : HWND;
+{ $END }
+
+{ $IFDECL SetDlgItemInt $THEN BEGIN }
+ PROCEDURE SetDlgItemInt (
+ h_ : HWND;
+ i_ : int;
+ w_ : WORD;
+ b_ : BOOL
+ );
+{ $END }
+
+{ $IFDECL GetDlgItemInt $THEN BEGIN }
+ FUNCTION GetDlgItemInt (
+ h_ : HWND;
+ i_ : int;
+ b_ : LPBOOL;
+ c_ : BOOL
+ ) : WORD;
+{ $END }
+
+{ $IFDECL SetDlgItemText $THEN BEGIN }
+ PROCEDURE SetDlgItemText (
+ h_ : HWND;
+ i_ : int;
+ l_ : LPSTR
+ );
+{ $END }
+
+{ $IFDECL GetDlgItemText $THEN BEGIN }
+ FUNCTION GetDlgItemText (
+ h_ : HWND;
+ i_ : int;
+ l_ : LPSTR;
+ j_ : int
+ ) : int;
+{ $END }
+
+{ $IFDECL CheckDlgButton $THEN BEGIN }
+ PROCEDURE CheckDlgButton (
+ h_ : HWND;
+ i_ : int;
+ w_ : WORD
+ );
+{ $END }
+
+{ $IFDECL CheckRadioButton $THEN BEGIN }
+ PROCEDURE CheckRadioButton (
+ h_ : HWND;
+ i_,j_,k_ : int
+ );
+{ $END }
+
+{ $IFDECL IsDlgButtonChecked $THEN BEGIN }
+ FUNCTION IsDlgButtonChecked (
+ h_ : HWND;
+ i_ : int
+ ) : WORD;
+{ $END }
+
+{ $IFDECL SendDlgItemMessage $THEN BEGIN }
+ FUNCTION SendDlgItemMessage (
+ h_ : HWND;
+ i_ : int;
+ w_,x_ : WORD;
+ l_ : LONG
+ ) : long;
+{ $END }
+
+
+{ $IFDECL CallMsgFilter $THEN BEGIN }
+ FUNCTION CallMsgFilter (
+ l_ : LPMSG;
+ i_ : int
+ ) : BOOL;
+{ $END }
+
+(* Clipboard manager routines *)
+
+{ $IFDECL OpenClipboard $THEN BEGIN }
+ FUNCTION OpenClipboard (
+ h_ : HWND
+ ) : BOOL;
+{ $END }
+
+{ $IFDECL CloseClipboard $THEN BEGIN }
+ FUNCTION CloseClipboard : BOOL;
+{ $END }
+
+{ $IFDECL GetClipboardOwner $THEN BEGIN }
+ FUNCTION GetClipboardOwner : HWND;
+{ $END }
+
+{ $IFDECL SetClipboardViewer $THEN BEGIN }
+ FUNCTION SetClipboardViewer (
+ h_ : HWND
+ ) : HWND;
+{ $END }
+
+{ $IFDECL GetClipboardViewer $THEN BEGIN }
+ FUNCTION GetClipboardViewer : HWND;
+{ $END }
+
+{ $IFDECL ChangeClipboardChain $THEN BEGIN }
+ FUNCTION ChangeClipboardChain (
+ h_,i_ : HWND
+ ) : BOOL;
+{ $END }
+
+{ $IFDECL SetClipboardData $THEN BEGIN }
+ FUNCTION SetClipboardData (
+ w_ : WORD;
+ h_ : HANDLE
+ ) : HANDLE;
+{ $END }
+
+{ $IFDECL GetClipboardData $THEN BEGIN }
+ FUNCTION GetClipboardData (
+ w_ : WORD
+ ) : HANDLE;
+{ $END }
+
+{ $IFDECL RegisterClipboardFormat $THEN BEGIN }
+ FUNCTION RegisterClipboardFormat (
+ l_ : LPSTR
+ ) : WORD;
+{ $END }
+
+{ $IFDECL CountClipboardFormats $THEN BEGIN }
+ FUNCTION CountClipboardFormats : int;
+{ $END }
+
+{ $IFDECL EnumClipboardFormats $THEN BEGIN }
+ FUNCTION EnumClipboardFormats (
+ w_ : WORD
+ ) : WORD;
+{ $END }
+
+{ $IFDECL GetClipboardFormatName $THEN BEGIN }
+ FUNCTION GetClipboardFormatName (
+ w_ : WORD;
+ l_ : LPSTR;
+ i_ : int
+ ) : int;
+{ $END }
+
+{ $IFDECL EmptyClipboard $THEN BEGIN }
+ FUNCTION EmptyClipboard : BOOL;
+{ $END }
+
+{ $IFDECL IsClipboardFormatAvailable $THEN BEGIN }
+ FUNCTION IsClipboardFormatAvailable (
+ w_ : WORD
+ ) : BOOL;
+{ $END }
+
+
+{ $IFDECL SetFocus $THEN BEGIN }
+ FUNCTION SetFocus (
+ h_ : HWND
+ ) : HWND;
+{ $END }
+
+{ $IFDECL GetFocus $THEN BEGIN }
+ FUNCTION GetFocus : HWND;
+{ $END }
+
+{ $IFDECL GetActiveWindow $THEN BEGIN }
+ FUNCTION GetActiveWindow : HWND;
+{ $END }
+
+
+{ $IFDECL GetKeyState $THEN BEGIN }
+ FUNCTION GetKeyState (
+ i_ : int
+ ) : int;
+{ $END }
+
+{ $IFDECL GetAsyncKeyState $THEN BEGIN }
+ FUNCTION GetAsyncKeyState (
+ i_ : int
+ ) : int;
+{ $END }
+
+{ $IFDECL GetKeyboardState $THEN BEGIN }
+ PROCEDURE GetKeyboardState (
+ b_ : ADS OF BYTE
+ );
+{ $END }
+
+{ $IFDECL SetKeyboardState $THEN BEGIN }
+ PROCEDURE SetKeyboardState (
+ b_ : ADS OF BYTE
+ );
+{ $END }
+
+{ $IFDECL EnableHardwareInput $THEN BEGIN }
+ FUNCTION EnableHardwareInput (
+ b_ : BOOL
+ ) : BOOL;
+{ $END }
+
+{ $IFDECL GetInputState $THEN BEGIN }
+ FUNCTION GetInputState (
+ ) : BOOL;
+{ $END }
+
+{ $IFDECL GetCapture $THEN BEGIN }
+ FUNCTION GetCapture;
+{ $END }
+
+{ $IFDECL SetCapture $THEN BEGIN }
+ FUNCTION SetCapture (
+ h_ : HWND
+ ) : HWND;
+{ $END }
+
+{ $IFDECL ReleaseCapture $THEN BEGIN }
+ PROCEDURE ReleaseCapture;
+{ $END }
+
+(* Windows Functions *)
+
+{ $IFDECL SetTimer $THEN BEGIN }
+ FUNCTION SetTimer (
+ h_ : HWND;
+ s_ : short;
+ w_ : WORD;
+ f_ : FARPROC
+ ) : WORD;
+{ $END }
+
+{ $IFDECL KillTimer $THEN BEGIN }
+ FUNCTION KillTimer (
+ h_ : HWND;
+ s_ : short
+ ) : BOOL;
+{ $END }
+
+
+{ $IFDECL EnableWindow $THEN BEGIN }
+ FUNCTION EnableWindow (
+ h_ : HWND;
+ b_ : BOOL
+ ) : BOOL;
+{ $END }
+
+{ $IFDECL IsWindowEnabled $THEN BEGIN }
+ FUNCTION IsWindowEnabled (
+ h_ : HWND
+ ) : BOOL;
+{ $END }
+
+
+{ $IFDECL LoadAccelerators $THEN BEGIN }
+ FUNCTION LoadAccelerators (
+ h_ : HANDLE;
+ l_ : LPSTR
+ ) : HANDLE;
+{ $END }
+
+
+{ $IFDECL TranslateAccelerator $THEN BEGIN }
+ FUNCTION TranslateAccelerator (
+ h_ : HWND;
+ i_ : HANDLE;
+ l_ : LPMSG
+ ) : int;
+{ $END }
+
+
+(* GetSystemMetrics codes *)
+
+CONST
+ SM_CXSCREEN = 0;
+ SM_CYSCREEN = 1;
+ SM_CXVSCROLL = 2;
+ SM_CYHSCROLL = 3;
+ SM_CYCAPTION = 4;
+ SM_CXBORDER = 5;
+ SM_CYBORDER = 6;
+ SM_CXDLGFRAME = 7;
+ SM_CYDLGFRAME = 8;
+ SM_CYVTHUMB = 9;
+ SM_CXHTHUMB = 10;
+ SM_CXICON = 11;
+ SM_CYICON = 12;
+ SM_CXCURSOR = 13;
+ SM_CYCURSOR = 14;
+ SM_CYMENU = 15;
+ SM_CXFULLSCREEN = 16;
+ SM_CYFULLSCREEN = 17;
+ SM_CYKANJIWINDOW = 18;
+ SM_MOUSEPRESENT = 19;
+ SM_CYVSCROLL = 20;
+ SM_CXHSCROLL = 21;
+ SM_DEBUG = 22;
+ SM_SWAPBUTTON = 23;
+ SM_RESERVED1 = 24;
+ SM_RESERVED2 = 25;
+ SM_RESERVED3 = 26;
+ SM_RESERVED4 = 27;
+ SM_CXMIN = 28;
+ SM_CYMIN = 29;
+ SM_CXSIZE = 30;
+ SM_CYSIZE = 31;
+ SM_CXFRAME = 32;
+ SM_CYFRAME = 33;
+ SM_CXMINTRACK = 34;
+ SM_CYMINTRACK = 35;
+ SM_CMETRICS = 36;
+
+
+{ $IFDECL GetSystemMetrics $THEN BEGIN }
+ FUNCTION GetSystemMetrics (
+ i_ : int
+ ) : int;
+{ $END }
+
+
+{ $IFDECL HiliteMenuItem $THEN BEGIN }
+ FUNCTION HiliteMenuItem (
+ h_ : HWND;
+ i_ : HMENU;
+ w_,x_ : WORD
+ ) : BOOL;
+{ $END }
+
+{ $IFDECL GetMenuString $THEN BEGIN }
+ FUNCTION GetMenuString (
+ h_ : HMENU;
+ w_ : WORD;
+ l_ : LPSTR;
+ i_ : int;
+ x_ : WORD
+ ) : int;
+{ $END }
+
+{ $IFDECL GetMenuState $THEN BEGIN }
+ FUNCTION GetMenuState (
+ h_ : HMENU;
+ w_ : WORD;
+ w_ : WORD
+ ) : WORD;
+{ $END }
+
+{ $IFDECL GetMenuItemID $THEN BEGIN }
+ FUNCTION GetMenuItemID (
+ h_ : HMENU;
+ i_ : int
+ ) : WORD;
+{ $END }
+
+{ $IFDECL GetMenuItemCount $THEN BEGIN }
+ FUNCTION GetMenuItemCount (
+ h_ : HMENU
+ ) : WORD;
+{ $END }
+
+{ $IFDECL DrawMenuBar $THEN BEGIN }
+ PROCEDURE DrawMenuBar (
+ h_ : HWND
+ );
+{ $END }
+
+{ $IFDECL GetSystemMenu $THEN BEGIN }
+ FUNCTION GetSystemMenu (
+ h_ : HWND;
+ b_ : BOOL
+ ) : HMENU;
+{ $END }
+
+{ $IFDECL CreateMenu $THEN BEGIN }
+ FUNCTION CreateMenu : HMENU;
+{ $END }
+
+{ $IFDECL DestroyMenu $THEN BEGIN }
+ FUNCTION DestroyMenu (
+ h_ : HMENU
+ ) : BOOL;
+{ $END }
+
+{ $IFDECL ChangeMenu $THEN BEGIN }
+ FUNCTION ChangeMenu (
+ h_ : HMENU;
+ w_ : WORD;
+ l_ : LPSTR;
+ x_,y_ : WORD
+ ) : BOOL;
+{ $END }
+
+{ $IFDECL CheckMenuItem $THEN BEGIN }
+ FUNCTION CheckMenuItem (
+ h_ : HMENU;
+ w_,x_ : WORD
+ ) : BOOL;
+{ $END }
+
+{ $IFDECL EnableMenuItem $THEN BEGIN }
+ FUNCTION EnableMenuItem (
+ h_ : HMENU;
+ w_,x_ : WORD
+ ) : BOOL;
+{ $END }
+
+{ $IFDECL GetSubMenu $THEN BEGIN }
+ FUNCTION GetSubMenu (
+ h_ : HMENU;
+ i_ : int
+ ) : HMENU;
+{ $END }
+
+{ $IFDECL EndMenu $THEN BEGIN }
+ PROCEDURE EndMenu;
+{ $END }
+
+
+{ $IFDECL GrayString $THEN BEGIN }
+ FUNCTION GrayString (
+ h_ : HDC;
+ i_ : HBRUSH;
+ f_ : FARPROC;
+ d_ : DWORD;
+ j_,k_,l_,m_,n_ : int
+ ) : BOOL;
+{ $END }
+
+{ $IFDECL UpdateWindow $THEN BEGIN }
+ PROCEDURE UpdateWindow (
+ h_ : HWND
+ );
+{ $END }
+
+{ $IFDECL SetActiveWindow $THEN BEGIN }
+ FUNCTION SetActiveWindow (
+ h_ : HWND
+ ) : HWND;
+{ $END }
+
+
+{ $IFDECL GetWindowDC $THEN BEGIN }
+ FUNCTION GetWindowDC (
+ h_ : HWND
+ ) : HDC;
+{ $END }
+
+{ $IFDECL GetDC $THEN BEGIN }
+ FUNCTION GetDC (
+ h_ : HWND
+ ) : HDC;
+{ $END }
+
+{ $IFDECL ReleaseDC $THEN BEGIN }
+ FUNCTION ReleaseDC (
+ h_ : HWND;
+ i_ : HDC
+ ) : int;
+{ $END }
+
+
+{ $IFDECL BeginPaint $THEN BEGIN }
+ FUNCTION BeginPaint (
+ h_ : HWND;
+ l_ : LPPAINTSTRUCT
+ ) : HDC;
+{ $END }
+
+
+{ $IFDECL EndPaint $THEN BEGIN }
+ PROCEDURE EndPaint (
+ h_ : HWND;
+ l_ : LPPAINTSTRUCT
+ );
+{ $END }
+
+{ $IFDECL GetUpdateRect $THEN BEGIN }
+ FUNCTION GetUpdateRect (
+ h_ : HWND;
+ l_ : LPRECT;
+ b_ : BOOL
+ ) : BOOL;
+{ $END }
+
+{ $IFDECL GetUpdateRgn $THEN BEGIN }
+ FUNCTION GetUpdateRgn (
+ h_ : HWND;
+ r_ : HRGN;
+ b_ : BOOL
+ ) : int;
+{ $END }
+
+{ $IFDECL GetUpdateRgn $THEN BEGIN }
+ FUNCTION GetUpdateRgn (
+ d_ : HDC;
+ h_ : HWND
+ ) : short;
+{ $END }
+
+{ $IFDECL InvalidateRect $THEN BEGIN }
+ PROCEDURE InvalidateRect (
+ h_ : HWND;
+ l_ : LPRECT;
+ b_ : BOOL
+ );
+{ $END }
+
+{ $IFDECL ValidateRect $THEN BEGIN }
+ PROCEDURE ValidateRect (
+ h_ : HWND;
+ l_ : LPRECT
+ );
+{ $END }
+
+
+{ $IFDECL InvalidateRgn $THEN BEGIN }
+ PROCEDURE InvalidateRgn (
+ h_ : HWND;
+ i_ : HRGN;
+ b_ : BOOL
+ );
+{ $END }
+
+{ $IFDECL ValidateRgn $THEN BEGIN }
+ PROCEDURE ValidateRgn (
+ h_ : HWND;
+ i_ : HRGN
+ );
+{ $END }
+
+
+{ $IFDECL ScrollWindow $THEN BEGIN }
+ PROCEDURE ScrollWindow (
+ h_ : HWND;
+ i_,j_ : int;
+ l_,m_ : LPRECT
+ );
+{ $END }
+
+{ $IFDECL ScrollDC $THEN BEGIN }
+ FUNCTION ScrollDC (
+ h_ : HDC;
+ i_,j_ : int;
+ l_,m_ : LPRECT;
+ r_ : HRGN;
+ p_ : LPRECT
+ ) : BOOL;
+{ $END }
+
+{ $IFDECL SetScrollPos $THEN BEGIN }
+ FUNCTION SetScrollPos (
+ h_ : HWND;
+ i_,j_ : int;
+ b_ : BOOL
+ ) : int;
+{ $END }
+
+{ $IFDECL GetScrollPos $THEN BEGIN }
+ FUNCTION GetScrollPos (
+ h_ : HWND;
+ i_ : int
+ ) : int;
+{ $END }
+
+{ $IFDECL SetScrollRange $THEN BEGIN }
+ PROCEDURE SetScrollRange (
+ h_ : HWND;
+ i_,j_,k_ : int;
+ b_ : BOOL
+ );
+{ $END }
+
+{ $IFDECL GetScrollRange $THEN BEGIN }
+ PROCEDURE GetScrollRange (
+ h_ : HWND;
+ i_ : int;
+ l_,m_ : LPINT
+ );
+{ $END }
+
+{ $IFDECL ShowScrollBar $THEN BEGIN }
+ PROCEDURE ShowScrollBar (
+ h_ : HWND;
+ w_ : WORD;
+ b_ : BOOL
+ );
+{ $END }
+
+{ $IFDECL SetProp $THEN BEGIN }
+ FUNCTION SetProp (
+ h_ : HWND;
+ l_ : LPSTR;
+ i_ : HANDLE
+ ) : BOOL;
+{ $END }
+
+{ $IFDECL GetProp $THEN BEGIN }
+ FUNCTION GetProp (
+ h_ : HWND;
+ l_ : LPSTR
+ ) : HANDLE;
+{ $END }
+
+{ $IFDECL RemoveProp $THEN BEGIN }
+ FUNCTION RemoveProp (
+ h_ : HWND;
+ l_ : LPSTR
+ ) : HANDLE;
+{ $END }
+
+{ $IFDECL EnumProps $THEN BEGIN }
+ FUNCTION EnumProps (
+ h_ : HWND;
+ f_ : FARPROC
+ ) : int;
+{ $END }
+
+{ $IFDECL SetWindowText $THEN BEGIN }
+ PROCEDURE SetWindowText (
+ h_ : HWND;
+ l_ : LPSTR
+ );
+{ $END }
+
+{ $IFDECL GetWindowText $THEN BEGIN }
+ FUNCTION GetWindowText (
+ h_ : HWND;
+ l_ : LPSTR;
+ i_ : int
+ ) : int;
+{ $END }
+
+{ $IFDECL GetWindowTextLength $THEN BEGIN }
+ FUNCTION GetWindowTextLength (
+ h_ : HWND
+ ) : int;
+{ $END }
+
+{ $IFDECL SetMenu $THEN BEGIN }
+ FUNCTION SetMenu (
+ h_ : HWND;
+ i_ : HMENU
+ ) : BOOL;
+{ $END }
+
+{ $IFDECL GetMenu $THEN BEGIN }
+ FUNCTION GetMenu (
+ h_ : HWND
+ ) : HMENU;
+{ $END }
+
+
+{ $IFDECL GetClientRect $THEN BEGIN }
+ PROCEDURE GetClientRect (
+ h_ : HWND;
+ l_ : LPRECT
+ );
+{ $END }
+
+{ $IFDECL GetWindowRect $THEN BEGIN }
+ PROCEDURE GetWindowRect (
+ h_ : HWND;
+ l_ : LPRECT
+ );
+{ $END }
+
+{ $IFDECL AdjustWindowRect $THEN BEGIN }
+ PROCEDURE AdjustWindowRect (
+ l_ : LPRECT
+ l2_ : long;
+ b_ : BOOL
+ );
+{ $END }
+
+(* MessageBox type_flags *)
+
+CONST
+ MB_OK = #0000;
+ MB_OKCANCEL = #0001;
+ MB_ABORTRETRYIGNORE = #0002;
+ MB_YESNOCANCEL = #0003;
+ MB_YESNO = #0004;
+ MB_RETRYCANCEL = #0005;
+
+ MB_ICONHAND = #0010;
+ MB_ICONQUESTION = #0020;
+ MB_ICONEXCLAMATION = #0030;
+ MB_ICONASTERISK = #0040;
+
+ MB_DEFBUTTON1 = #0000;
+ MB_DEFBUTTON2 = #0100;
+ MB_DEFBUTTON3 = #0200;
+
+ MB_APPLMODAL = #0000;
+ MB_SYSTEMMODAL = #1000;
+ MB_NOFOCUS = #8000;
+ MB_MISCMASK = #c000;
+ MB_TYPEMASK = #000f;
+ MB_ICONMASK = #00f0;
+ MB_DEFMASK = #0f00;
+ MB_MODEMASK = #3000;
+
+
+{ $IFDECL MessageBox $THEN BEGIN }
+ FUNCTION MessageBox (
+ h_ : HWND;
+ l_,m_ : LPSTR;
+ w_ : WORD
+ ) : int;
+{ $END }
+
+{ $IFDECL MessageBeep $THEN BEGIN }
+ FUNCTION MessageBeep (
+ w_ : WORD
+ ) : BOOL;
+{ $END }
+
+
+{ $IFDECL ShowCursor $THEN BEGIN }
+ FUNCTION ShowCursor (
+ b_ : BOOL
+ ) : int;
+{ $END }
+
+
+{ $IFDECL SetCursor $THEN BEGIN }
+ FUNCTION SetCursor (
+ h_ : HCURSOR
+ ) : HCURSOR;
+{ $END }
+
+
+{ $IFDECL SetCursorPos $THEN BEGIN }
+ PROCEDURE SetCursorPos (
+ i_,j_ : int
+ );
+{ $END }
+
+
+{ $IFDECL GetCursorPos $THEN BEGIN }
+ PROCEDURE GetCursorPos (
+ l_ : LPPOINT
+ );
+{ $END }
+
+
+{ $IFDECL ClipCursor $THEN BEGIN }
+ PROCEDURE ClipCursor (
+ l_ : LPRECT
+ );
+{ $END }
+
+
+{ $IFDECL CreateCaret $THEN BEGIN }
+ PROCEDURE CreateCaret (
+ h_ : HWND;
+ i_ : HBITMAP;
+ j_,k_ : int
+ );
+{ $END }
+
+
+
+{ $IFDECL GetCaretBlinkTime $THEN BEGIN }
+ FUNCTION GetCaretBlinkTime : WORD;
+{ $END }
+
+{ $IFDECL SetCaretBlinkTime $THEN BEGIN }
+ PROCEDURE SetCaretBlinkTime (
+ w_ : WORD
+ );
+{ $END }
+
+{ $IFDECL DestroyCaret $THEN BEGIN }
+ PROCEDURE DestroyCaret;
+{ $END }
+
+{ $IFDECL HideCaret $THEN BEGIN }
+ PROCEDURE HideCaret (
+ h_ : HWND
+ );
+{ $END }
+
+{ $IFDECL ShowCaret $THEN BEGIN }
+ PROCEDURE ShowCaret (
+ h_ : HWND
+ );
+{ $END }
+
+{ $IFDECL SetCaretPos $THEN BEGIN }
+ PROCEDURE SetCaretPos (
+ i_,j_ : int
+ );
+{ $END }
+
+{ $IFDECL GetCaretPos $THEN BEGIN }
+ PROCEDURE GetCaretPos (
+ l_ : LPPOINT
+ );
+{ $END }
+
+{ $IFDECL ClientToScreen $THEN BEGIN }
+ PROCEDURE ClientToScreen (
+ h_ : HWND;
+ l_ : LPPOINT
+ );
+{ $END }
+
+{ $IFDECL ScreenToClient $THEN BEGIN }
+ PROCEDURE ScreenToClient (
+ h_ : HWND;
+ l_ : LPPOINT
+ );
+{ $END }
+
+{ $IFDECL WindowFromPoint $THEN BEGIN }
+ FUNCTION WindowFromPoint (
+ p_ : POINT
+ ) : HWND;
+{ $END }
+
+{ $IFDECL ChildWindowFromPoint $THEN BEGIN }
+ FUNCTION ChildWindowFromPoint (
+ h_ : HWND;
+ p_ : POINT
+ ) : HWND;
+{ $END }
+
+(* color type_indices *)
+(* for the WM_CTLCOLOR message *)
+
+CONST
+ CTLCOLOR_MSGBOX = 0;
+ CTLCOLOR_EDIT = 1;
+ CTLCOLOR_LISTBOX = 2;
+ CTLCOLOR_BTN = 3;
+ CTLCOLOR_DLG = 4;
+ CTLCOLOR_SCROLLBAR = 5;
+ CTLCOLOR_STATIC = 6;
+ CTLCOLOR_MAX = 8 (* three bits max *);
+
+ COLOR_SCROLLBAR = 0;
+ COLOR_BACKGROUND = 1;
+ COLOR_ACTIVECAPTION = 2;
+ COLOR_INACTIVECAPTION = 3;
+ COLOR_MENU = 4;
+ COLOR_WINDOW = 5;
+ COLOR_WINDOWFRAME = 6;
+ COLOR_MENUTEXT = 7;
+ COLOR_WINDOWTEXT = 8;
+ COLOR_CAPTIONTEXT = 9;
+ COLOR_ACTIVEBORDER = 10;
+ COLOR_INACTIVEBORDER = 11;
+ COLOR_APPWORKSPACE = 12;
+
+
+{ $IFDECL GetSysColor $THEN BEGIN }
+ FUNCTION GetSysColor (
+ i_ : int
+ ) : DWORD;
+{ $END }
+
+{ $IFDECL SetSysColors $THEN BEGIN }
+ PROCEDURE SetSysColors (
+ i_ : int;
+ l_ : LPINT;
+ m_ : LPlong
+ );
+{ $END }
+
+ CP_GETBEEP = 1;
+ CP_SETBEEP = 2;
+ CP_GETMOUSE = 3;
+ CP_SETMOUSE = 4;
+ CP_GETBORDER = 5;
+ CP_SETBORDER = 6;
+ CP_TIMEOUTS = 7;
+ CP_KANJIMENU = 8;
+
+{ $IFDECL ControlPanelInfo $THEN BEGIN }
+ PROCEDURE ControlPanelInfo (
+ w_,x_ : WORD;
+ l_ : LONG
+ );
+{ $END }
+
+{ $IFDECL CreateDC $THEN BEGIN }
+ FUNCTION CreateDC (
+ l_,m_,n_,o_ : LPSTR
+ ) : HDC;
+{ $END }
+
+{ $IFDECL CreateIC $THEN BEGIN }
+ FUNCTION CreateIC (
+ l_,m_,n_,o_ : LPSTR
+ ) : HDC;
+{ $END }
+
+{ $IFDECL CreateCompatibleDC $THEN BEGIN }
+ FUNCTION CreateCompatibleDC (
+ h_ : HDC
+ ) : HDC;
+{ $END }
+
+{ $IFDECL DeleteDC $THEN BEGIN }
+ FUNCTION DeleteDC (
+ h_ : HDC
+ ) : BOOL;
+{ $END }
+
+{ $IFDECL SaveDC $THEN BEGIN }
+ FUNCTION SaveDC (
+ h_ : HDC
+ ) : short;
+{ $END }
+
+{ $IFDECL RestoreDC $THEN BEGIN }
+ FUNCTION RestoreDC (
+ h_ : HDC;
+ s_ : short
+ ) : BOOL;
+{ $END }
+
+{ $IFDECL MoveTo $THEN BEGIN }
+ FUNCTION MoveTo (
+ h_ : HDC;
+ s_,t_ : short
+ ) : DWORD;
+{ $END }
+
+{ $IFDECL GetCurrentPosition $THEN BEGIN }
+ FUNCTION GetCurrentPosition (
+ h_ : HDC
+ ) : DWORD;
+{ $END }
+
+{ $IFDECL LineTo $THEN BEGIN }
+ FUNCTION LineTo (
+ h_ : HDC;
+ s_,t_ : short
+ ) : BOOL;
+{ $END }
+
+{ $IFDECL GetDCOrg $THEN BEGIN }
+ FUNCTION GetDCOrg (
+ h_ : HDC
+ ) : DWORD;
+{ $END }
+
+{ $IFDECL ExtTextOut $THEN BEGIN }
+ FUNCTION ExtTextOut (
+ h_ : HDC;
+ s_,t_ : short;
+ w_ : WORD;
+ l_ : LPRECT;
+ p_ : LPSTR;
+ i_ : WORD;
+ n_ : LPINT
+ ) : BOOL;
+{ $END }
+
+{ $IFDECL FastWindowFrame $THEN BEGIN }
+ FUNCTION FastWindowFrame (
+ h_ : HDC;
+ l_ : LPRECT;
+ w_,x_ : WORD;
+ i_ : DWORD
+ ) : BOOL;
+{ $END }
+
+{ $IFDECL Polyline $THEN BEGIN }
+ FUNCTION Polyline (
+ h_ : HDC;
+ l_ : LPPOINT;
+ s_ : short
+ ) : BOOL;
+{ $END }
+
+{ $IFDECL Polygon $THEN BEGIN }
+ FUNCTION Polygon (
+ h_ : HDC;
+ l_ : LPPOINT;
+ s_ : short
+ ) : BOOL;
+{ $END }
+
+
+{ $IFDECL Rectangle $THEN BEGIN }
+ FUNCTION Rectangle (
+ h_ : HDC;
+ s_,t_,u_,v_ : short
+ ) : BOOL;
+{ $END }
+
+{ $IFDECL RoundRect $THEN BEGIN }
+ FUNCTION RoundRect (
+ h_ : HDC;
+ s_,t_,u_,v_,w_,x_ : short
+ ) : BOOL;
+{ $END }
+
+{ $IFDECL Ellipse $THEN BEGIN }
+ FUNCTION Ellipse (
+ h_ : HDC;
+ s_,t_,u_,v_ : short
+ ) : BOOL;
+{ $END }
+
+{ $IFDECL Arc $THEN BEGIN }
+ FUNCTION Arc (
+ h_ : HDC;
+ s_,t_,u_,v_,w_,x_,y_,z_ : short
+ ) : BOOL;
+{ $END }
+
+{ $IFDECL Chord $THEN BEGIN }
+ FUNCTION Chord (
+ h_ : HDC;
+ s_,t_,u_,v_,w_,x_,y_,z_ : short
+ ) : BOOL;
+{ $END }
+
+{ $IFDECL Pie $THEN BEGIN }
+ FUNCTION Pie (
+ h_ : HDC;
+ s_,t_,u_,v_,w_,x_,y_,z_ : short
+ ) : BOOL;
+{ $END }
+
+{ $IFDECL PatBlt $THEN BEGIN }
+ FUNCTION PatBlt (
+ h_ : HDC;
+ s_,t_,u_,v_ : short;
+ d_ : DWORD
+ ) : BOOL;
+{ $END }
+
+{ $IFDECL BitBlt $THEN BEGIN }
+ FUNCTION BitBlt (
+ h_ : HDC;
+ s_,t_,u_,v_ : short;
+ i_ : HDC;
+ w_,x_ : short;
+ d_ : DWORD
+ ) : BOOL;
+{ $END }
+
+{ $IFDECL StretchBlt $THEN BEGIN }
+ FUNCTION StretchBlt (
+ h_ : HDC;
+ s_,t_,u_,v_ : short;
+ i_ : HDC;
+ w_,x_,y_,z_ : short;
+ d_ : DWORD
+ ) : BOOL;
+{ $END }
+
+{ $IFDECL TextOut $THEN BEGIN }
+ FUNCTION TextOut (
+ h_ : HDC;
+ s_,t_ : short;
+ l_ : LPSTR;
+ u_ : short
+ ) : BOOL;
+{ $END }
+
+{ $IFDECL GetCharWidth $THEN BEGIN }
+ FUNCTION GetCharWidth (
+ h_ : HDC;
+ w_,x_ : WORD;
+ l_ : LPINT
+ ) : BOOL;
+{ $END }
+
+{ $IFDECL SetPixel $THEN BEGIN }
+ FUNCTION SetPixel (
+ h_ : HDC;
+ s_,t_ : short;
+ d_ : DWORD
+ ) : DWORD;
+{ $END }
+
+{ $IFDECL GetPixel $THEN BEGIN }
+ FUNCTION GetPixel (
+ h_ : HDC;
+ s_,t_ : short
+ ) : DWORD;
+{ $END }
+
+{ $IFDECL FloodFill $THEN BEGIN }
+ FUNCTION FloodFill (
+ h_ : HDC;
+ s_,t_ : short;
+ d_ : DWORD
+ ) : BOOL;
+{ $END }
+
+
+{ $IFDECL LineDDA $THEN BEGIN }
+ PROCEDURE LineDDA (
+ s_,t_,u_,v_ : short;
+ f_ : FARPROC;
+ l_ : LPSTR
+ );
+{ $END }
+
+
+{ $IFDECL FillRect $THEN BEGIN }
+ FUNCTION FillRect (
+ h_ : HDC;
+ l_ : LPRECT;
+ i_ : HBRUSH
+ ) : int;
+{ $END }
+
+{ $IFDECL FrameRect $THEN BEGIN }
+ FUNCTION FrameRect (
+ h_ : HDC;
+ l_ : LPRECT;
+ i_ : HBRUSH
+ ) : int;
+{ $END }
+
+{ $IFDECL InvertRect $THEN BEGIN }
+ FUNCTION InvertRect (
+ h_ : HDC;
+ l_ : LPRECT
+ ) : int;
+{ $END }
+
+
+
+{ $IFDECL FillRgn $THEN BEGIN }
+ FUNCTION FillRgn (
+ h_ : HDC;
+ i_ : HRGN;
+ j_ : HBRUSH
+ ) : BOOL;
+{ $END }
+
+{ $IFDECL FrameRgn $THEN BEGIN }
+ FUNCTION FrameRgn (
+ h_ : HDC;
+ i_ : HRGN;
+ j_ : HBRUSH;
+ s_,t_ : short
+ ) : BOOL;
+{ $END }
+
+{ $IFDECL InvertRgn $THEN BEGIN }
+ FUNCTION InvertRgn (
+ h_ : HDC;
+ i_ : HRGN
+ ) : BOOL;
+{ $END }
+
+{ $IFDECL PaintRgn $THEN BEGIN }
+ FUNCTION PaintRgn (
+ h_ : HDC;
+ i_ : HRGN
+ ) : BOOL;
+{ $END }
+
+{ $IFDECL PtInRegion $THEN BEGIN }
+ FUNCTION PtInRegion (
+ h_ : HRGN;
+ s_,t_ : short
+ ) : BOOL;
+{ $END }
+
+
+{ $IFDECL GetStockObject $THEN BEGIN }
+ FUNCTION GetStockObject (
+ s_ : short
+ ) : HANDLE;
+{ $END }
+
+
+{ $IFDECL CreatePen $THEN BEGIN }
+ FUNCTION CreatePen (
+ s_,t_ : short;
+ d_ : DWORD
+ ) : HPEN;
+{ $END }
+
+{ $IFDECL CreatePenIndirect $THEN BEGIN }
+ FUNCTION CreatePenIndirect (
+ l_ : LPLOGPEN
+ ) : HPEN;
+{ $END }
+
+
+{ $IFDECL CreateSolidBrush $THEN BEGIN }
+ FUNCTION CreateSolidBrush (
+ d_ : DWORD
+ ) : HBRUSH;
+{ $END }
+
+{ $IFDECL CreateHatchBrush $THEN BEGIN }
+ FUNCTION CreateHatchBrush (
+ s_ : short;
+ d_ : DWORD
+ ) : HBRUSH;
+{ $END }
+
+{ $IFDECL SetBrushOrg $THEN BEGIN }
+ FUNCTION SetBrushOrg (
+ h_ : HDC;
+ i_,j_ : int
+ ) : DWORD;
+{ $END }
+
+{ $IFDECL GetBrushOrg $THEN BEGIN }
+ FUNCTION GetBrushOrg (
+ h_ : HDC
+ ) : DWORD;
+{ $END }
+
+{ $IFDECL UnrealizeObject $THEN BEGIN }
+ FUNCTION UnrealizeObject (
+ h_ : HBRUSH
+ ) : BOOL;
+{ $END }
+
+
+{ $IFDECL CreatePatternBrush $THEN BEGIN }
+ FUNCTION CreatePatternBrush (
+ h_ : HBITMAP
+ ) : HBRUSH;
+{ $END }
+
+{ $IFDECL CreateBrushIndirect $THEN BEGIN }
+ FUNCTION CreateBrushIndirect (
+ l_ : LPLOGBRUSH
+ ) : HBRUSH;
+{ $END }
+
+
+
+{ $IFDECL CreateBitmap $THEN BEGIN }
+ FUNCTION CreateBitmap (
+ s_,t_ : short;
+ b_,c_ : BYTE;
+ l_ : LPSTR
+ ) : HBITMAP;
+{ $END }
+
+{ $IFDECL CreateBitmapIndirect $THEN BEGIN }
+ FUNCTION CreateBitmapIndirect (
+ b_ : LPBITMAP
+ ) : HBITMAP;
+{ $END }
+
+{ $IFDECL CreateCompatibleBitmap $THEN BEGIN }
+ FUNCTION CreateCompatibleBitmap (
+ h_ : HDC;
+ s_,t_ : short
+ ) : HBITMAP;
+{ $END }
+
+{ $IFDECL CreateDiscardableBitmap $THEN BEGIN }
+ FUNCTION CreateDiscardableBitmap (
+ h_ : HDC;
+ s_,t_ : short
+ ) : HBITMAP;
+{ $END }
+
+{ $IFDECL SetBitmapBits $THEN BEGIN }
+ FUNCTION SetBitmapBits (
+ h_ : HBITMAP;
+ d_ : DWORD;
+ l_ : LPSTR
+ ) : long;
+{ $END }
+
+{ $IFDECL GetBitmapBits $THEN BEGIN }
+ FUNCTION GetBitmapBits (
+ h_ : HBITMAP;
+ l_ : long;
+ m_ : LPSTR
+ ) : long;
+{ $END }
+
+{ $IFDECL SetBitmapDimension $THEN BEGIN }
+ FUNCTION SetBitmapDimension (
+ h_ : HBITMAP;
+ s_,t_ : short
+ ) : DWORD;
+{ $END }
+
+{ $IFDECL GetBitmapDimension $THEN BEGIN }
+ FUNCTION GetBitmapDimension (
+ h_ : HBITMAP
+ ) : DWORD;
+{ $END }
+
+
+{ $IFDECL CreateFont $THEN BEGIN }
+ FUNCTION CreateFont (
+ s_,t_,u_,v_,w_ : short;
+ b_,c_,d_,e_,f_,g_,h_,i_ : BYTE;
+ l_ : LPSTR
+ ) : HFONT;
+{ $END }
+
+{ $IFDECL CreateFontIndirect $THEN BEGIN }
+ FUNCTION CreateFontIndirect (
+ l_ : LPLOGFONT
+ ) : HFONT;
+{ $END }
+
+
+{ $IFDECL CreateRectRgn $THEN BEGIN }
+ FUNCTION CreateRectRgn (
+ s_,t_,u_,v_ : short
+ ) : HRGN;
+{ $END }
+
+{ $IFDECL SetRectRgn $THEN BEGIN }
+ PROCEDURE SetRectRgn (
+ h_ : HRGN;
+ s_,t_,u_,v_ : short;
+ );
+{ $END }
+
+
+{ $IFDECL CreateRectRgnIndirect $THEN BEGIN }
+ FUNCTION CreateRectRgnIndirect (
+ l_ : LPRECT
+ ) : HRGN;
+{ $END }
+
+{ $IFDECL CreateEllipticRgnIndirect $THEN BEGIN }
+ FUNCTION CreateEllipticRgnIndirect (
+ l_ : LPRECT
+ ) : HRGN;
+{ $END }
+
+
+{ $IFDECL CreateEllipticRgn $THEN BEGIN }
+ FUNCTION CreateEllipticRgn (
+ s_,t_,u_,v_ : short
+ ) : HRGN;
+{ $END }
+
+{ $IFDECL CreatePolygonRgn $THEN BEGIN }
+ FUNCTION CreatePolygonRgn (
+ l_ : LPPOINT;
+ s_,t_ : short
+ ) : HRGN;
+{ $END }
+
+
+{ $IFDECL DeleteObject $THEN BEGIN }
+ FUNCTION DeleteObject (
+ h_ : HANDLE
+ ) : BOOL;
+{ $END }
+
+{ $IFDECL SelectObject $THEN BEGIN }
+ FUNCTION SelectObject (
+ h_ : HDC;
+ i_ : HANDLE
+ ) : HANDLE;
+{ $END }
+
+
+{ $IFDECL SelectClipRgn $THEN BEGIN }
+ FUNCTION SelectClipRgn (
+ h_ : HDC;
+ i_ : HRGN
+ ) : short;
+{ $END }
+
+
+{ $IFDECL GetObject $THEN BEGIN }
+ FUNCTION GetObject (
+ h_ : HANDLE;
+ s_ : short;
+ l_ : LPSTR
+ ) : short;
+{ $END }
+
+
+{ $IFDECL SetRelAbs $THEN BEGIN }
+ FUNCTION SetRelAbs (
+ h_ : HDC;
+ s_ : short
+ ) : short;
+{ $END }
+
+{ $IFDECL GetRelAbs $THEN BEGIN }
+ FUNCTION GetRelAbs (
+ h_ : HDC
+ ) : short;
+{ $END }
+
+{ $IFDECL SetBkColor $THEN BEGIN }
+ FUNCTION SetBkColor (
+ h_ : HDC;
+ d_ : DWORD
+ ) : DWORD;
+{ $END }
+
+{ $IFDECL GetBkColor $THEN BEGIN }
+ FUNCTION GetBkColor (
+ h_ : HDC
+ ) : DWORD;
+{ $END }
+
+{ $IFDECL SetBkMode $THEN BEGIN }
+ FUNCTION SetBkMode (
+ h_ : HDC;
+ s_ : short
+ ) : short;
+{ $END }
+
+{ $IFDECL GetBkMode $THEN BEGIN }
+ FUNCTION GetBkMode (
+ h_ : HDC
+ ) : short;
+{ $END }
+
+{ $IFDECL SetTextColor $THEN BEGIN }
+ FUNCTION SetTextColor (
+ h_ : HDC;
+ d_ : DWORD
+ ) : DWORD;
+{ $END }
+
+{ $IFDECL GetTextColor $THEN BEGIN }
+ FUNCTION GetTextColor (
+ h_ : HDC
+ ) : DWORD;
+{ $END }
+
+{ $IFDECL SetTextAlign $THEN BEGIN }
+ FUNCTION SetTextAlign (
+ h_ : HDC;
+ w_ : WORD
+ ) : WORD;
+{ $END }
+
+{ $IFDECL GetTextAlign $THEN BEGIN }
+ FUNCTION GetTextAlign (
+ h_ : HDC
+ ) : WORD;
+{ $END }
+
+{ $IFDECL SetMapperFlags $THEN BEGIN }
+ FUNCTION SetMapperFlags (
+ h_ : HDC;
+ w_ : WORD
+ ) : DWORD;
+{ $END }
+
+{ $IFDECL GetAspectRatioFilter $THEN BEGIN }
+ FUNCTION GetAspectRatioFilter (
+ h_ : HDC
+ ) : DWORD;
+{ $END }
+
+{ $IFDECL GetNearestColor $THEN BEGIN }
+ FUNCTION GetNearestColor (
+ h_ : HDC;
+ d_ : DWORD
+ ) : DWORD;
+{ $END }
+
+{ $IFDECL SetROP2 $THEN BEGIN }
+ FUNCTION SetROP2 (
+ h_ : HDC;
+ s_ : short
+ ) : short;
+{ $END }
+
+{ $IFDECL GetROP2 $THEN BEGIN }
+ FUNCTION GetROP2 (
+ h_ : HDC
+ ) : short;
+{ $END }
+
+{ $IFDECL SetStretchBltMode $THEN BEGIN }
+ FUNCTION SetStretchBltMode (
+ h_ : HDC;
+ s_ : short
+ ) : short;
+{ $END }
+
+{ $IFDECL GetStretchBltMode $THEN BEGIN }
+ FUNCTION GetStretchBltMode (
+ h_ : HDC
+ ) : short;
+{ $END }
+
+{ $IFDECL SetPolyFillMode $THEN BEGIN }
+ FUNCTION SetPolyFillMode (
+ h_ : HDC;
+ s_ : short
+ ) : short;
+{ $END }
+
+{ $IFDECL GetPolyFillMode $THEN BEGIN }
+ FUNCTION GetPolyFillMode (
+ h_ : HDC
+ ) : short;
+{ $END }
+
+{ $IFDECL SetMapMode $THEN BEGIN }
+ FUNCTION SetMapMode (
+ h_ : HDC;
+ s_ : short
+ ) : short;
+{ $END }
+
+{ $IFDECL GetMapMode $THEN BEGIN }
+ FUNCTION GetMapMode (
+ h_ : HDC
+ ) : short;
+{ $END }
+
+{ $IFDECL SetWindowOrg $THEN BEGIN }
+ FUNCTION SetWindowOrg (
+ h_ : HDC;
+ s_,t_ : short
+ ) : DWORD;
+{ $END }
+
+{ $IFDECL GetWindowOrg $THEN BEGIN }
+ FUNCTION GetWindowOrg (
+ h_ : HDC
+ ) : DWORD;
+{ $END }
+
+{ $IFDECL SetWindowExt $THEN BEGIN }
+ FUNCTION SetWindowExt (
+ h_ : HDC;
+ s_,t_ : short
+ ) : DWORD;
+{ $END }
+
+{ $IFDECL GetWindowExt $THEN BEGIN }
+ FUNCTION GetWindowExt (
+ h_ : HDC
+ ) : DWORD;
+{ $END }
+
+{ $IFDECL SetViewportOrg $THEN BEGIN }
+ FUNCTION SetViewportOrg (
+ h_ : HDC;
+ s_,t_ : short
+ ) : DWORD;
+{ $END }
+
+{ $IFDECL GetViewportOrg $THEN BEGIN }
+ FUNCTION GetViewportOrg (
+ h_ : HDC
+ ) : DWORD;
+{ $END }
+
+{ $IFDECL SetViewportExt $THEN BEGIN }
+ FUNCTION SetViewportExt (
+ h_ : HDC;
+ s_,t_ : short
+ ) : DWORD;
+{ $END }
+
+{ $IFDECL GetViewportExt $THEN BEGIN }
+ FUNCTION GetViewportExt (
+ h_ : HDC
+ ) : DWORD;
+{ $END }
+
+{ $IFDECL OffsetViewportOrg $THEN BEGIN }
+ FUNCTION OffsetViewportOrg (
+ h_ : HDC;
+ s_,t_ : short
+ ) : DWORD;
+{ $END }
+
+{ $IFDECL ScaleViewportExt $THEN BEGIN }
+ FUNCTION ScaleViewportExt (
+ h_ : HDC;
+ s_,t_,r_,q_ : short
+ ) : DWORD;
+{ $END }
+
+{ $IFDECL OffsetWindowOrg $THEN BEGIN }
+ FUNCTION OffsetWindowOrg (
+ h_ : HDC;
+ s_,t_ : short
+ ) : DWORD;
+{ $END }
+
+{ $IFDECL ScaleWindowExt $THEN BEGIN }
+ FUNCTION ScaleWindowExt (
+ h_ : HDC;
+ s_,t_,r_,q_ : short
+ ) : DWORD;
+{ $END }
+
+
+{ $IFDECL GetClipBox $THEN BEGIN }
+ FUNCTION GetClipBox (
+ h_ : HDC;
+ l_ : LPRECT
+ ) : short;
+{ $END }
+
+
+{ $IFDECL IntersectClipRect $THEN BEGIN }
+ FUNCTION IntersectClipRect (
+ h_ : HDC;
+ s_,t_,u_,v_ : short
+ ) : short;
+{ $END }
+
+{ $IFDECL OffsetClipRgn $THEN BEGIN }
+ FUNCTION OffsetClipRgn (
+ h_ : HDC;
+ s_,t_ : short
+ ) : short;
+{ $END }
+
+{ $IFDECL ExcludeClipRect $THEN BEGIN }
+ FUNCTION ExcludeClipRect (
+ h_ : HDC;
+ s_,t_,u_,v_ : short
+ ) : short;
+{ $END }
+
+{ $IFDECL PtVisible $THEN BEGIN }
+ FUNCTION PtVisible (
+ h_ : HDC;
+ s_,t_ : short
+ ) : BOOL;
+{ $END }
+
+
+{ $IFDECL SetRect $THEN BEGIN }
+ FUNCTION SetRect (
+ l_ : LPRECT;
+ i_,j_,k_,m_ : int
+ ) : int;
+{ $END }
+
+{ $IFDECL SetRectEmpty $THEN BEGIN }
+ FUNCTION SetRectEmpty (
+ l_ : LPRECT
+ ) : int;
+{ $END }
+
+{ $IFDECL CopyRect $THEN BEGIN }
+ FUNCTION CopyRect (
+ l_,m_ : LPRECT
+ ) : int;
+{ $END }
+
+{ $IFDECL InflateRect $THEN BEGIN }
+ FUNCTION InflateRect (
+ l_ : LPRECT;
+ i_,j_ : int
+ ) : int;
+{ $END }
+
+{ $IFDECL IntersectRect $THEN BEGIN }
+ FUNCTION IntersectRect (
+ l_,m_,n_ : LPRECT
+ ) : int;
+{ $END }
+
+{ $IFDECL UnionRect $THEN BEGIN }
+ FUNCTION UnionRect (
+ l_,m_,n_ : LPRECT
+ ) : int;
+{ $END }
+
+{ $IFDECL OffsetRect $THEN BEGIN }
+ FUNCTION OffsetRect (
+ l_ : LPRECT;
+ i_,j_ : int
+ ) : int;
+{ $END }
+
+{ $IFDECL IsRectEmpty $THEN BEGIN }
+ FUNCTION IsRectEmpty (
+ l_ : LPRECT
+ ) : BOOL;
+{ $END }
+
+{ $IFDECL EqualRect $THEN BEGIN }
+ FUNCTION EqualRect (
+ l_,k_ : LPRECT
+ ) : BOOL;
+{ $END }
+
+{ $IFDECL PtInRect $THEN BEGIN }
+ FUNCTION PtInRect (
+ l_ : LPRECT;
+ p_ : POINT
+ ) : BOOL;
+{ $END }
+
+
+{ $IFDECL RectVisible $THEN BEGIN }
+ FUNCTION RectVisible (
+ h_ : HDC;
+ l_ : LPRECT
+ ) : BOOL;
+{ $END }
+
+
+{ $IFDECL CombineRgn $THEN BEGIN }
+ FUNCTION CombineRgn (
+ h_,i_,j_ : HRGN;
+ s_ : short
+ ) : short;
+{ $END }
+
+{ $IFDECL EqualRgn $THEN BEGIN }
+ FUNCTION EqualRgn (
+ h_,i_ : HRGN
+ ) : BOOL;
+{ $END }
+
+{ $IFDECL OffsetRgn $THEN BEGIN }
+ FUNCTION OffsetRgn (
+ h_ : HRGN;
+ s_,t_ : short
+ ) : short;
+{ $END }
+
+
+{ $IFDECL SetTextJustification $THEN BEGIN }
+ FUNCTION SetTextJustification (
+ h_ : HDC;
+ s_,t_ : short
+ ) : short;
+{ $END }
+
+{ $IFDECL GetTextExtent $THEN BEGIN }
+ FUNCTION GetTextExtent (
+ h_ : HDC;
+ l_ : LPSTR;
+ s_ : short
+ ) : DWORD;
+{ $END }
+
+{ $IFDECL SetTextCharacterExtra $THEN BEGIN }
+ FUNCTION SetTextCharacterExtra (
+ h_ : HDC;
+ s_ : short
+ ) : short;
+{ $END }
+
+{ $IFDECL GetTextCharacterExtra $THEN BEGIN }
+ FUNCTION GetTextCharacterExtra (
+ h_ : HDC
+ ) : short;
+{ $END }
+
+
+{ $IFDECL GetMetaFile $THEN BEGIN }
+ FUNCTION GetMetaFile (
+ l_ : LPSTR
+ ) : HANDLE;
+{ $END }
+
+{ $IFDECL DeleteMetaFile $THEN BEGIN }
+ FUNCTION DeleteMetaFile (
+ h_ : HANDLE
+ ) : BOOL;
+{ $END }
+
+{ $IFDECL CopyMetaFile $THEN BEGIN }
+ FUNCTION CopyMetaFile (
+ h_ : HANDLE;
+ l_ : LPSTR
+ ) : HANDLE;
+{ $END }
+
+{ $IFDECL PlayMetaFileRecord $THEN BEGIN }
+ PROCEDURE PlayMetaFileRecord (
+ h_ : HDC;
+ i_ : LPHANDLETABLE;
+ j_ : LPMETARECORD;
+ w_ : WORD;
+ );
+{ $END }
+
+{ $IFDECL EnumMetaFile $THEN BEGIN }
+ FUNCTION EnumMetaFile (
+ h_ : HDC;
+ i_ : LOCALHANDLE;
+ f_ : FARPROC;
+ a_ ; ADS OF BYTE
+ ) : BOOL;
+{ $END }
+
+
+{ $IFDECL PlayMetaFile $THEN BEGIN }
+ FUNCTION PlayMetaFile (
+ h_ : HDC;
+ i_ : HANDLE
+ ) : BOOL;
+{ $END }
+
+{ $IFDECL Escape $THEN BEGIN }
+ FUNCTION Escape (
+ h_ : HDC;
+ s_,t_ : short;
+ l_,m_ : LPSTR
+ ) : short;
+{ $END }
+
+{ $IFDECL EnumFonts $THEN BEGIN }
+ FUNCTION EnumFonts (
+ h_ : HDC;
+ l_ : LPSTR;
+ f_ : FARPROC;
+ m_ : LPSTR
+ ) : short;
+{ $END }
+
+{ $IFDECL EnumObjects $THEN BEGIN }
+ FUNCTION EnumObjects (
+ h_ : HDC;
+ s_ : short;
+ f_ : FARPROC;
+ l_ : LPSTR
+ ) : short;
+{ $END }
+
+{ $IFDECL GetTextFace $THEN BEGIN }
+ FUNCTION GetTextFace (
+ h_ : HDC;
+ s_ : short;
+ l_ : LPSTR
+ ) : short;
+{ $END }
+
+{ $IFDECL GetTextMetrics $THEN BEGIN }
+ FUNCTION GetTextMetrics (
+ h_ : HDC;
+ l_ : LPTEXTMETRIC
+ ) : BOOL;
+{ $END }
+
+{ $IFDECL GetDeviceCaps $THEN BEGIN }
+ FUNCTION GetDeviceCaps (
+ h_ : HDC;
+ s_ : short
+ ) : short;
+{ $END }
+
+
+{ $IFDECL DeviceModes $THEN BEGIN }
+ FUNCTION DeviceModes (
+ h_ : HWND;
+ i_ : HANDLE;
+ l_,m_ : LPSTR
+ ) : LPSTR;
+{ $END }
+
+{ $IFDECL SetEnvironment $THEN BEGIN }
+ FUNCTION SetEnvironment (
+ l_,m_ : LPSTR;
+ w_ : WORD
+ ) : short;
+{ $END }
+
+{ $IFDECL GetEnvironment $THEN BEGIN }
+ FUNCTION GetEnvironment (
+ l_,m_ : LPSTR;
+ w_ : WORD
+ ) : short;
+{ $END }
+
+
+{ $IFDECL DPtoLP $THEN BEGIN }
+ FUNCTION DPtoLP (
+ h_ : HDC;
+ l_ : LPPOINT;
+ s_ : short
+ ) : BOOL;
+{ $END }
+
+{ $IFDECL LPtoDP $THEN BEGIN }
+ FUNCTION LPtoDP (
+ h_ : HDC;
+ l_ : LPPOINT;
+ s_ : short
+ ) : BOOL;
+{ $END }
+
+(* Interface to the dynamic loader/linker *)
+
+
+{ $IFDECL GetVersion $THEN BEGIN }
+ FUNCTION GetVersion : WORD;
+{ $END }
+
+{ $IFDECL GetNumTasks $THEN BEGIN }
+ FUNCTION GetNumTasks : WORD;
+{ $END }
+
+{ $IFDECL GetCodeHandle $THEN BEGIN }
+ FUNCTION GetCodeHandle (
+ f_ : FARPROC
+ ) : HANDLE;
+{ $END }
+
+{ $IFDECL GetModuleHandle $THEN BEGIN }
+ FUNCTION GetModuleHandle (
+ l_ : LPSTR
+ ) : HANDLE;
+{ $END }
+
+{ $IFDECL GetModuleUsage $THEN BEGIN }
+ FUNCTION GetModuleUsage (
+ h_ : HANDLE
+ ) : int;
+{ $END }
+
+{ $IFDECL GetModuleFileName $THEN BEGIN }
+ FUNCTION GetModuleFileName (
+ h_ : HANDLE;
+ l_ : LPSTR;
+ i_ : int
+ ) : int;
+{ $END }
+
+{ $IFDECL GetInstanceData $THEN BEGIN }
+ FUNCTION GetInstanceData (
+ h_ : HANDLE;
+ n_ : NPSTR;
+ i_ : int
+ ) : int;
+{ $END }
+
+{ $IFDECL GetProcAddress $THEN BEGIN }
+ FUNCTION GetProcAddress (
+ h_ : HANDLE;
+ l_ : LPSTR
+ ) : FARPROC;
+{ $END }
+
+{ $IFDECL MakeProcInstance $THEN BEGIN }
+ FUNCTION MakeProcInstance (
+ f_ : FARPROC;
+ h_ : HANDLE
+ ) : FARPROC;
+{ $END }
+
+{ $IFDECL FreeProcInstance $THEN BEGIN }
+ PROCEDURE FreeProcInstance (
+ f_ : FARPROC
+ );
+{ $END }
+
+{ $IFDECL LoadLibrary $THEN BEGIN }
+ FUNCTION LoadLibrary (
+ l_ : LPSTR
+ ) : HANDLE;
+{ $END }
+
+{ $IFDECL FreeLibrary $THEN BEGIN }
+ FUNCTION FreeLibrary (
+ h_ : HANDLE
+ ) : HANDLE;
+{ $END }
+
+
+{ $IFDECL AnsiToOem $THEN BEGIN }
+ FUNCTION AnsiToOem (
+ l_,m_ : LPSTR
+ ) : BOOL;
+{ $END }
+
+{ $IFDECL OemToAnsi $THEN BEGIN }
+ FUNCTION OemToAnsi (
+ l_,m_ : LPSTR
+ ) : BOOL;
+{ $END }
+
+{ $IFDECL AnsiUpper $THEN BEGIN }
+ FUNCTION AnsiUpper (
+ l_ : LPSTR
+ ) : BYTE;
+{ $END }
+
+{ $IFDECL AnsiLower $THEN BEGIN }
+ FUNCTION AnsiLower (
+ l_ : LPSTR
+ ) : BYTE;
+{ $END }
+
+{ $IFDECL AnsiNext $THEN BEGIN }
+ FUNCTION AnsiNext (
+ l_ : LPSTR
+ ) : LPSTR;
+{ $END }
+
+{ $IFDECL AnsiPrev $THEN BEGIN }
+ FUNCTION AnsiPrev (
+ l_,m_ : LPSTR
+ ) : LPSTR;
+{ $END }
+
+
+
+TYPE
+ OFSTRUCT = RECORD
+ cBytes : BYTE; (* length of structure *)
+ fFixedDisk : BYTE; (* non-zero if file located on non- *)
+ (* removeable media *)
+ nErrCode : WORD; (* DOS error code if OpenFile fails *)
+ reserved : ARRAY [0..3] OF BYTE;
+ szPathName : ARRAY [0..127] OF BYTE;
+ END;
+ POFSTRUCT = ADR OF OFSTRUCT;
+ NPOFSTRUCT = ADR OF OFSTRUCT;
+ LPOFSTRUCT = ADS OF OFSTRUCT;
+
+
+{ $IFDECL GetTempDrive $THEN BEGIN }
+ FUNCTION GetTempDrive (
+ b_ : BYTE
+ ) : BYTE;
+{ $END }
+
+
+{ $IFDECL GetTempFileName $THEN BEGIN }
+ FUNCTION GetTempFileName (
+ b_ : BYTE;
+ l_ : LPSTR;
+ w_ : WORD;
+ m_ : LPSTR
+ ) : int;
+{ $END }
+
+{ $IFDECL OpenFile $THEN BEGIN }
+ FUNCTION OpenFile (
+ l_ : LPSTR;
+ m_ : LPOFSTRUCT;
+ w_ : WORD
+ ) : int;
+{ $END }
+
+(* Flags for GetTempFileName *)
+
+CONST
+ TF_FORCEDRIVE = #80; (* Forces use of current dir of passed *)
+ (* drive *)
+
+(* Flags for OpenFile *)
+
+CONST
+ OF_REOPEN = #8000;
+ OF_EXIST = #4000;
+ OF_PROMPT = #2000;
+ OF_CREATE = #1000;
+ OF_CANCEL = #0800;
+ OF_VERIFY = #0400;
+ OF_DELETE = #0200;
+ OF_PARSE = #0100;
+
+ OF_READ = 0;
+ OF_WRITE = 1;
+ OF_READWRITE = 2;
+
+(* Interface to global memory manager *)
+ GMEM_FIXED = #0000;
+ GMEM_MOVEABLE = #0002;
+ GMEM_NOCOMPACT = #0010;
+ GMEM_NODISCARD = #0020;
+ GMEM_ZEROINIT = #0040;
+ GMEM_MODIFY = #0080;
+ GMEM_DISCARDABLE = #0F00;
+ GHND = (GMEM_MOVEABLE OR GMEM_ZEROINIT);
+ GPTR = (GMEM_FIXED OR GMEM_ZEROINIT);
+ GMEM_SHARE = #2000;
+ GMEM_DDESHARE = #2000;
+ GMEM_LOWER = #1000;
+ GMEM_NOTIFY = #4000;
+ GMEM_NOT_BANKED = #1000;
+
+
+{ $IFDECL GlobalAlloc $THEN BEGIN }
+ FUNCTION GlobalAlloc (
+ w_ : WORD;
+ d_ : DWORD
+ ) : HANDLE;
+{ $END }
+
+{ $IFDECL GlobalCompact $THEN BEGIN }
+ FUNCTION GlobalCompact (
+ d_ : DWORD
+ ) : DWORD;
+{ $END }
+
+{ $IFDECL GlobalDiscard $THEN BEGIN }
+ FUNCTION GlobalDiscard (
+ h_ : HANDLE;
+ ) : HANDLE;
+{ $END }
+
+{ $IFDECL GlobalFree $THEN BEGIN }
+ FUNCTION GlobalFree (
+ h_ : HANDLE
+ ) : HANDLE;
+{ $END }
+
+{ $IFDECL GlobalHandle $THEN BEGIN }
+ FUNCTION GlobalHandle (
+ w_ : WORD
+ ) : DWORD;
+{ $END }
+
+{ $IFDECL GlobalLock $THEN BEGIN }
+ FUNCTION GlobalLock (
+ h_ : HANDLE
+ ) : LPSTR;
+{ $END }
+
+{ $IFDECL GlobalReAlloc $THEN BEGIN }
+ FUNCTION GlobalReAlloc (
+ h_ : HANDLE;
+ d_ : DWORD;
+ w_ : WORD
+ ) : HANDLE;
+{ $END }
+
+{ $IFDECL GlobalSize $THEN BEGIN }
+ FUNCTION GlobalSize (
+ h_ : HANDLE
+ ) : DWORD;
+{ $END }
+
+{ $IFDECL GlobalFlags $THEN BEGIN }
+ FUNCTION GlobalFlags (
+ h_ : HANDLE
+ ) : WORD;
+{ $END }
+
+{ $IFDECL GlobalWire $THEN BEGIN }
+ FUNCTION GlobalWire (
+ h_ : HANDLE
+ ) : LPSTR;
+{ $END }
+
+{ $IFDECL GlobalUnWire $THEN BEGIN }
+ FUNCTION GlobalUnWire (
+ h_ : HANDLE
+ ) : BOOL;
+{ $END }
+
+{ $IFDECL GlobalUnlock $THEN BEGIN }
+ FUNCTION GlobalUnlock (
+ h_ : HANDLE
+ ) : BOOL;
+{ $END }
+
+{ $IFDECL UnlockResource $THEN BEGIN }
+ FUNCTION UnlockResource ( h_ : HANDLE) : BOOL;
+ BEGIN
+ UnlockResource := GlobalUnlock(h_)
+ END;
+{ $END }
+
+{ $IFDECL GlobalLRUNewest $THEN BEGIN }
+ FUNCTION GlobalLRUNewest (
+ h_ : HANDLE
+ ) : HANDLE;
+{ $END }
+
+{ $IFDECL GlobalLRUOldest $THEN BEGIN }
+ FUNCTION GlobalLRUOldest (
+ h_ : HANDLE
+ ) : HANDLE;
+{ $END }
+
+{ $IFDECL GlobalNotify $THEN BEGIN }
+ PROCEDURE GlobalNotify (
+ l_ : LPSTR
+ );
+{ $END }
+
+(* Flags returned by GlobalFlags (in addition to GMEM_DISCARDABLE) *)
+
+CONST
+ GMEM_DISCARDED = #4000;
+ GMEM_SWAPPED = #8000;
+ GMEM_LOCKCOUNT = #00FF;
+
+{ $IFDECL LockData $THEN BEGIN }
+ FUNCTION LockData (
+ i_ : int
+ ) : HANDLE;
+{ $END }
+
+{ $IFDECL UnlockData $THEN BEGIN }
+ FUNCTION UnlockData (
+ i_ : int
+ ) : HANDLE;
+{ $END }
+
+
+{ $IFDECL LockSegment $THEN BEGIN }
+ FUNCTION LockSegment (
+ w_ : WORD
+ ) : HANDLE;
+{ $END }
+
+{ $IFDECL UnlockSegment $THEN BEGIN }
+ FUNCTION UnlockSegment (
+ w_ : WORD
+ ) : HANDLE;
+{ $END }
+
+(* Interface to local memory manager *)
+
+
+CONST
+ LMEM_FIXED = #0000;
+ LMEM_MOVEABLE = #0002;
+ LMEM_NOCOMPACT = #0010;
+ LMEM_NODISCARD = #0020;
+ LMEM_ZEROINIT = #0040;
+ LMEM_MODIFY = #0080;
+ LMEM_DISCARDABLE = #0F00;
+ LHND = (LMEM_MOVEABLE OR LMEM_ZEROINIT);
+ LPTR = (LMEM_FIXED OR LMEM_ZEROINIT);
+ NONZEROLHND = (LMEM_MOVEABLE);
+ NONZEROLPTR = (LMEM_FIXED);
+
+ LNOTIFY_OUTOFMEM = 0;
+ LNOTIFY_MOVE = 1;
+ LNOTIFY_DISCARD = 2;
+
+
+{ $IFDECL LocalAlloc $THEN BEGIN }
+ FUNCTION LocalAlloc (
+ w_,x_ : WORD
+ ) : HANDLE;
+{ $END }
+
+{ $IFDECL LocalCompact $THEN BEGIN }
+ FUNCTION LocalCompact (
+ w_ : WORD
+ ) : WORD;
+{ $END }
+
+{ $IFDECL LocalDiscard $THEN BEGIN }
+ FUNCTION LocalDiscard (
+ h_ : HANDLE
+ ) : HANDLE;
+{ $END }
+
+{ $IFDECL LocalFree $THEN BEGIN }
+ FUNCTION LocalFree (
+ h_ : HANDLE
+ ) : HANDLE;
+{ $END }
+
+{ $IFDECL LocalHandle $THEN BEGIN }
+ FUNCTION LocalHandle (
+ w_ : WORD
+ ) : HANDLE;
+{ $END }
+
+{ $IFDECL LocalFreeze $THEN BEGIN }
+ PROCEDURE LocalFreeze (
+ i_ : int
+ );
+{ $END }
+
+{ $IFDECL LocalHandleDelta $THEN BEGIN }
+ FUNCTION LocalHandleDelta (
+ i_ : int
+ ) : int;
+{ $END }
+
+{ $IFDECL LocalInit $THEN BEGIN }
+ FUNCTION LocalInit (
+ w_ : WORD;
+ p_,q_ : PSTR
+ ) : BOOL;
+{ $END }
+
+{ $IFDECL LocalLock $THEN BEGIN }
+ FUNCTION LocalLock (
+ h_ : HANDLE
+ ) : PSTR;
+{ $END }
+
+{ $IFDECL LocalMelt $THEN BEGIN }
+ PROCEDURE LocalMelt (
+ i_ : int
+ );
+{ $END }
+
+{ $IFDECL LocalNotify $THEN BEGIN }
+ FUNCTION LocalNotify (
+ f_ : FARPROC
+ ) : FARPROC;
+{ $END }
+
+{ $IFDECL LocalReAlloc $THEN BEGIN }
+ FUNCTION LocalReAlloc (
+ h_ : HANDLE;
+ w_,x_ : WORD
+ ) : HANDLE;
+{ $END }
+
+{ $IFDECL LocalSize $THEN BEGIN }
+ FUNCTION LocalSize (
+ h_ : HANDLE
+ ) : WORD;
+{ $END }
+
+{ $IFDECL LocalUnlock $THEN BEGIN }
+ FUNCTION LocalUnlock (
+ h_ : HANDLE
+ ) : BOOL;
+{ $END }
+
+{ $IFDECL LocalFlags $THEN BEGIN }
+ FUNCTION LocalFlags (
+ h_ : HANDLE
+ ) : WORD;
+{ $END }
+
+{ $IFDECL LocalShrink $THEN BEGIN }
+ FUNCTION LocalShrink (
+ h_ : HANDLE;
+ w_ : WORD
+ ) : WORD;
+{ $END }
+
+(* Flags returned by LocalFlags (in addition to LMEM_DISCARDABLE) *)
+
+CONST
+ LMEM_DISCARDED = #4000;
+ LMEM_LOCKCOUNT = #00FF;
+
+(* SetSwapAreaSize really returns 2 words -
+ lo word is Size actually set (or current size if you passed in 0)
+ hi word is Max size you can get
+*)
+
+{ $IFDECL SetSwapAreaSize $THEN BEGIN }
+ FUNCTION SetSwapAreaSize (
+ w_ : WORD
+ ) : LONG;
+{ $END }
+
+{ $IFDECL ValidateFreeSpaces $THEN BEGIN }
+ FUNCTION ValidateFreeSpaces : LPSTR;
+{ $END }
+
+{ $IFDECL LimitEmsPages $THEN BEGIN }
+ PROCEDURE LimitEmsPages (
+ w_ : DWORD
+ );
+{ $END }
+
+{ $IFDECL SetErrorMode $THEN BEGIN }
+ FUNCTION SetErrorMode (
+ w_ : WORD
+ ) : BOOL;
+{ $END }
+
+
+(* Interface to the resource manager *)
+
+
+{ $IFDECL FindResource $THEN BEGIN }
+ FUNCTION FindResource (
+ h_ : HANDLE;
+ l_,m_ : LPSTR
+ ) : HANDLE;
+{ $END }
+
+{ $IFDECL LoadResource $THEN BEGIN }
+ FUNCTION LoadResource (
+ h_,i_ : HANDLE
+ ) : HANDLE;
+{ $END }
+
+{ $IFDECL FreeResource $THEN BEGIN }
+ FUNCTION FreeResource (
+ h_ : HANDLE
+ ) : BOOL;
+{ $END }
+
+
+{ $IFDECL LockResource $THEN BEGIN }
+ FUNCTION LockResource (
+ h_ : HANDLE
+ ) : LPSTR;
+{ $END }
+
+
+{ $IFDECL SetResourceHandler $THEN BEGIN }
+ FUNCTION SetResourceHandler (
+ h_ : HANDLE;
+ l_ : LPSTR;
+ f_ : FARPROC
+ ) : FARPROC;
+{ $END }
+
+{ $IFDECL AllocResource $THEN BEGIN }
+ FUNCTION AllocResource (
+ h_,i_ : HANDLE;
+ d_ : DWORD
+ ) : HANDLE;
+{ $END }
+
+{ $IFDECL SizeofResource $THEN BEGIN }
+ FUNCTION SizeofResource (
+ h_,i_ : HANDLE
+ ) : WORD;
+{ $END }
+
+{ $IFDECL AccessResource $THEN BEGIN }
+ FUNCTION AccessResource (
+ h_,i_ : HANDLE
+ ) : int;
+{ $END }
+
+{ $IFDECL MAKEINTRESOURCE $THEN BEGIN }
+ FUNCTION MAKEINTRESOURCE (
+ i_ : int
+ ) : LPSTR;
+{ $END }
+
+(* Predefined resource types *)
+CONST
+ RT_CURSOR = RETYPE( LPSTR, BYLONG(0, 1) );
+ RT_BITMAP = RETYPE( LPSTR, BYLONG(0, 2) );
+ RT_ICON = RETYPE( LPSTR, BYLONG(0, 3) );
+ RT_MENU = RETYPE( LPSTR, BYLONG(0, 4) );
+ RT_DIALOG = RETYPE( LPSTR, BYLONG(0, 5) );
+ RT_STRING = RETYPE( LPSTR, BYLONG(0, 6) );
+ RT_FONTDIR = RETYPE( LPSTR, BYLONG(0, 7) );
+ RT_FONT = RETYPE( LPSTR, BYLONG(0, 8) );
+ RT_ACCELERATOR = RETYPE( LPSTR, BYLONG(0, 9) );
+ RT_RCDATA = RETYPE( LPSTR, BYLONG(0, 10) );
+
+(* Interface to the task scheduler *)
+
+
+{ $IFDECL Yield $THEN BEGIN }
+ FUNCTION Yield : BOOL;
+{ $END }
+
+{ $IFDECL GetCurrentTask $THEN BEGIN }
+ FUNCTION GetCurrentTask : HANDLE;
+{ $END }
+
+{ $IFDECL SetPriority $THEN BEGIN }
+ FUNCTION SetPriority (
+ h_ : HANDLE;
+ i_ : int
+ ) : int;
+{ $END }
+
+(* Interface to the atom manager *)
+
+
+TYPE
+ ATOM = WORD;
+
+
+{ $IFDECL InitAtomTable $THEN BEGIN }
+ FUNCTION InitAtomTable (
+ i_ : int
+ ) : BOOL;
+{ $END }
+
+
+{ $IFDECL AddAtom $THEN BEGIN }
+ FUNCTION AddAtom (
+ l_ : LPSTR
+ ) : ATOM;
+{ $END }
+
+{ $IFDECL DeleteAtom $THEN BEGIN }
+ FUNCTION DeleteAtom (
+ a_ : ATOM
+ ) : ATOM;
+{ $END }
+
+{ $IFDECL FindAtom $THEN BEGIN }
+ FUNCTION FindAtom (
+ l_ : LPSTR
+ ) : ATOM;
+{ $END }
+
+{ $IFDECL GetAtomName $THEN BEGIN }
+ FUNCTION GetAtomName (
+ a_ : ATOM;
+ l_ : LPSTR;
+ i_ : int
+ ) : WORD;
+{ $END }
+
+{ $IFDECL GlobalAddAtom $THEN BEGIN }
+ FUNCTION GlobalAddAtom (
+ l_ : LPSTR
+ ) : ATOM;
+{ $END }
+
+{ $IFDECL GlobalDeleteAtom $THEN BEGIN }
+ FUNCTION GlobalDeleteAtom (
+ a_ : ATOM
+ ) : ATOM;
+{ $END }
+
+{ $IFDECL GlobalFindAtom $THEN BEGIN }
+ FUNCTION GlobalFindAtom (
+ l_ : LPSTR
+ ) : ATOM;
+{ $END }
+
+{ $IFDECL GlobalGetAtomName $THEN BEGIN }
+ FUNCTION GlobalGetAtomName (
+ a_ : ATOM;
+ l_ : LPSTR;
+ i_ : int
+ ) : WORD;
+{ $END }
+
+{ $IFDECL GetAtomHandle $THEN BEGIN }
+ FUNCTION GetAtomHandle (
+ a_ : ATOM
+ ) : HANDLE;
+{ $END }
+
+{ $IFDECL MAKEINTATOM $THEN BEGIN }
+ FUNCTION MAKEINTATOM (
+ i_ : int
+ ) : LPSTR;
+{ $END }
+
+(* Interface to the user profile *)
+
+{ $IFDECL GetProfileInt $THEN BEGIN }
+ FUNCTION GetProfileInt (
+ l_,m_ : LPSTR;
+ i_ : int
+ ) : int;
+{ $END }
+
+{ $IFDECL GetProfileString $THEN BEGIN }
+ FUNCTION GetProfileString (
+ l_,m_,n_,o_ : LPSTR;
+ i_ : int
+ ) : int;
+{ $END }
+
+{ $IFDECL WriteProfileString $THEN BEGIN }
+ FUNCTION WriteProfileString (
+ l_,m_,n_ : LPSTR
+ ) : BOOL;
+{ $END }
+
+(* Interface to FatalExit procedure *)
+
+
+{ $IFDECL FatalExit $THEN BEGIN }
+ PROCEDURE FatalExit (
+ i_ : int
+ );
+{ $END }
+
+(* Interface to Catch and Throw procedures *)
+
+
+TYPE
+ CATCHBUF = ARRAY [0..8] OF int;
+ LPCATCHBUF = ADS OF int;
+
+{ $IFDECL Catch $THEN BEGIN }
+ FUNCTION Catch (
+ l_ : LPCATCHBUF
+ ) : int;
+{ $END }
+
+{ $IFDECL Throw $THEN BEGIN }
+ PROCEDURE Throw (
+ l_ : LPCATCHBUF;
+ i_ : int
+ );
+{ $END }
+
+
+{ $IFDECL CreateMetaFile $THEN BEGIN }
+ FUNCTION CreateMetaFile (
+ l_ : LPSTR
+ ) : HANDLE;
+{ $END }
+
+{ $IFDECL CloseMetaFile $THEN BEGIN }
+ FUNCTION CloseMetaFile (
+ h_ : HANDLE
+ ) : HANDLE;
+{ $END }
+
+{ $IFDECL GetMetaFileBits $THEN BEGIN }
+ FUNCTION GetMetaFileBits (
+ h_ : HANDLE
+ ) : HANDLE;
+{ $END }
+
+{ $IFDECL SetMetaFileBits $THEN BEGIN }
+ FUNCTION SetMetaFileBits (
+ h_ : HANDLE
+ ) : HANDLE;
+{ $END }
+
+
+{ $IFDECL GetCurrentTime $THEN BEGIN }
+ FUNCTION GetCurrentTime : DWORD;
+{ $END }
+
+{ $IFDECL GetTickCount $THEN BEGIN }
+ FUNCTION GetTickCount : DWORD;
+{ $END }
+
+{ $IFDECL GetTimerResolution $THEN BEGIN }
+ FUNCTION GetTimerResolution : DWORD;
+{ $END }
+
+{ $IFDECL IsChild $THEN BEGIN }
+ FUNCTION IsChild (
+ h_,i_ : HWND
+ ) : BOOL;
+{ $END }
+
+
+{ $IFDECL GetWindowWord $THEN BEGIN }
+ FUNCTION GetWindowWord (
+ h_ : HWND;
+ i_ : int
+ ) : WORD;
+{ $END }
+
+{ $IFDECL SetWindowWord $THEN BEGIN }
+ FUNCTION SetWindowWord (
+ h_ : HWND;
+ i_ : int;
+ w_ : WORD
+ ) : WORD;
+{ $END }
+
+{ $IFDECL GetWindowLong $THEN BEGIN }
+ FUNCTION GetWindowLong (
+ h_ : HWND;
+ i_ : int
+ ) : LONG;
+{ $END }
+
+{ $IFDECL SetWindowLong $THEN BEGIN }
+ FUNCTION SetWindowLong (
+ h_ : HWND;
+ i_ : int;
+ l_ : LONG
+ ) : LONG;
+{ $END }
+
+{ $IFDECL GetClassWord $THEN BEGIN }
+ FUNCTION GetClassWord (
+ h_ : HWND;
+ i_ : int
+ ) : WORD;
+{ $END }
+
+{ $IFDECL SetClassWord $THEN BEGIN }
+ FUNCTION SetClassWord (
+ h_ : HWND;
+ i_ : int;
+ w_ : WORD
+ ) : WORD;
+{ $END }
+
+{ $IFDECL GetClassLong $THEN BEGIN }
+ FUNCTION GetClassLong (
+ h_ : HWND;
+ i_ : int
+ ) : LONG;
+{ $END }
+
+{ $IFDECL SetClassLong $THEN BEGIN }
+ FUNCTION SetClassLong (
+ h_ : HWND;
+ i_ : int;
+ l_ : LONG
+ ) : LONG;
+{ $END }
+
+
+{ $IFDECL GetParent $THEN BEGIN }
+ FUNCTION GetParent (
+ h_ : HWND
+ ) : HWND;
+{ $END }
+
+{ $IFDECL SetParent $THEN BEGIN }
+ FUNCTION SetParent (
+ h_,w_ : HWND
+ ) : HWND;
+{ $END }
+
+{ $IFDECL EnumChildWindows $THEN BEGIN }
+ FUNCTION EnumChildWindows (
+ h_ : HWND;
+ f_ : FARPROC;
+ l_ : LONG
+ ) : BOOL;
+{ $END }
+
+{ $IFDECL FindWindow $THEN BEGIN }
+ FUNCTION FindWindow (
+ l_,m_ : LPSTR
+ ) : HWND;
+{ $END }
+
+{ $IFDECL EnumWindows $THEN BEGIN }
+ FUNCTION EnumWindows (
+ f_ : FARPROC;
+ l_ : LONG
+ ) : BOOL;
+{ $END }
+
+{ $IFDECL EnumTaskWindows $THEN BEGIN }
+ FUNCTION EnumTaskWindows (
+ h_ : HANDLE;
+ f_ : FARPROC;
+ l_ : LONG
+ ) : BOOL;
+{ $END }
+
+{ $IFDECL GetClassName $THEN BEGIN }
+ FUNCTION GetClassName (
+ h_ : HWND;
+ l_ : LPSTR;
+ i_ : int
+ ) : int;
+{ $END }
+
+{ $IFDECL GetTopWindow $THEN BEGIN }
+ FUNCTION GetTopWindow (
+ h_ : HWND
+ ) : HWND;
+{ $END }
+
+{ $IFDECL GetNextWindow $THEN BEGIN }
+ FUNCTION GetNextWindow (
+ h_ : HWND;
+ W_ : WORD
+ ) : HWND;
+{ $END }
+
+{ $IFDECL GetWindowTask $THEN BEGIN }
+ FUNCTION GetWindowTask (
+ h_ : HWND
+ ) : HANDLE;
+{ $END }
+
+(* GetWindow() and constants *)
+{ $IFDECL GetWindow $THEN BEGIN }
+ FUNCTION GetWindow (
+ h_ : HWND;
+ w_ : WORD
+ ) : HWND;
+{ $END }
+
+
+{ $IFDECL SetWindowsHook $THEN BEGIN }
+ FUNCTION SetWindowsHook (
+ i_ : int;
+ f_ : FARPROC
+ ) : FARPROC;
+{ $END }
+
+{ $IFDECL UnhookWindowsHook $THEN BEGIN }
+ FUNCTION UnhookWindowsHook (
+ i_ : int;
+ f_ : FARPROC
+ ) : BOOL;
+{ $END }
+
+{ $IFDECL DefHookProc $THEN BEGIN }
+ FUNCTION DefHookProc (
+ i_ : int;
+ w_ : WORD;
+ d_ : DWORD;
+ f_ : ADS OF FARPROC
+ ) : DWORD;
+{ $END }
+
+(* Key conversion window *)
+
+{ $IFDECL CreateConvertWindow $THEN BEGIN }
+ FUNCTION CreateConvertWindow (
+ l_ : LPSTR;
+ h_ : HANDLE;
+ m_ : LPSTR
+ ) : HWND;
+{ $END }
+
+{ $IFDECL ShowConvertWindow $THEN BEGIN }
+ PROCEDURE ShowConvertWindow (
+ h_ : HWND;
+ b_ : BOOL
+ );
+{ $END }
+
+{ $IFDECL SetConvertWindowHeight $THEN BEGIN }
+ PROCEDURE SetConvertWindowHeight (
+ i_ : int
+ );
+{ $END }
+
+{ $IFDECL IsTwoByteCharPrefix $THEN BEGIN }
+ FUNCTION IsTwoByteCharPrefix (
+ i_ : INTEGER1
+ ) : BOOL;
+{ $END }
+
+CONST
+ GW_HWNDFIRST = 0;
+ GW_HWNDLAST = 1;
+ GW_HWNDNEXT = 2;
+ GW_HWNDPREV = 3;
+ GW_OWNER = 4;
+ GW_CHILD = 5;
+
+(* Menu flags for Add/Check/EnableMenuItem *)
+
+ MF_CHANGE = #0080;
+ MF_INSERT = #0000;
+ MF_APPEND = #0100;
+ MF_DELETE = #0200;
+ MF_BYPOSITION = #0400;
+ MF_SEPARATOR = #0800;
+ MF_REMOVE = #1000;
+ MF_BYCOMMAND = #0000;
+ MF_GRAYED = #0001;
+ MF_DISABLED = #0002;
+ MF_ENABLED = #0000;
+ MF_CHECKED = #0008;
+ MF_UNCHECKED = #0000;
+ MF_BITMAP = #0004;
+ MF_STRING = #0000;
+ MF_POPUP = #0010;
+ MF_MENUBARBREAK = #0020;
+ MF_MENUBREAK = #0040;
+ MF_HILITE = #0080;
+ MF_UNHILITE = #0000;
+ MF_HELP = #4000;
+ MF_SYSMENU = #2000;
+ MF_MOUSESELECT = #8000;
+
+
+(* System Menu Command Values *)
+ SC_SIZE = #f000;
+ SC_MOVE = #f010;
+ SC_MINIMIZE = #f020;
+ SC_MAXIMIZE = #f030;
+ SC_NEXTWINDOW = #f040;
+ SC_PREVWINDOW = #f050;
+ SC_CLOSE = #f060;
+ SC_VSCROLL = #f070;
+ SC_HSCROLL = #f080;
+ SC_MOUSEMENU = #f090;
+ SC_KEYMENU = #f100;
+ SC_ARRANGE = #F110;
+ SC_RESTORE = #F120;
+ SC_ICON = SC_MINIMIZE;
+ SC_ZOOM = SC_MAXIMIZE;
+
+(* Resource loading routines *)
+
+
+{ $IFDECL LoadBitmap $THEN BEGIN }
+ FUNCTION LoadBitmap (
+ h_ : HANDLE;
+ l_ : LPSTR
+ ) : HBITMAP;
+{ $END }
+
+
+{ $IFDECL LoadCursor $THEN BEGIN }
+ FUNCTION LoadCursor (
+ h_ : HANDLE;
+ l_ : LPSTR
+ ) : HCURSOR;
+{ $END }
+
+(* Standard cursor IDs *)
+CONST
+ IDC_ARROW = RETYPE( LPSTR, BYLONG(0,32512) );
+ IDC_IBEAM = RETYPE( LPSTR, BYLONG(0,32513) );
+ IDC_WAIT = RETYPE( LPSTR, BYLONG(0,32514) );
+ IDC_CROSS = RETYPE( LPSTR, BYLONG(0,32515) );
+ IDC_UPARROW = RETYPE( LPSTR, BYLONG(0,32516) );
+ IDC_SIZE = RETYPE( LPSTR, BYLONG(0,32640) );
+ IDC_ICON = RETYPE( LPSTR, BYLONG(0,32641) );
+ IDC_SIZENWSE = RETYPE( LPSTR, BYLONG(0,32642) );
+ IDC_SIZENESW = RETYPE( LPSTR, BYLONG(0,32643) );
+ IDC_SIZEWE = RETYPE( LPSTR, BYLONG(0,32644) );
+ IDC_SIZENS = RETYPE( LPSTR, BYLONG(0,32645) );
+
+
+
+{ $IFDECL LoadIcon $THEN BEGIN }
+ FUNCTION LoadIcon (
+ h_ : HANDLE;
+ l_ : LPSTR
+ ) : HICON;
+{ $END }
+
+(* Standard icon IDs *)
+CONST
+ IDI_APPLICATION = RETYPE( LPSTR, BYLONG(0,32512) );
+ IDI_HAND = RETYPE( LPSTR, BYLONG(0,32513) );
+ IDI_QUESTION = RETYPE( LPSTR, BYLONG(0,32514) );
+ IDI_EXCLAMATION = RETYPE( LPSTR, BYLONG(0,32515) );
+ IDI_ASTERISK = RETYPE( LPSTR, BYLONG(0,32516) );
+
+
+
+{ $IFDECL LoadMenu $THEN BEGIN }
+ FUNCTION LoadMenu (
+ h_ : HANDLE;
+ l_ : LPSTR
+ ) : HMENU;
+{ $END }
+
+{ $IFDECL LoadMenuIndirect $THEN BEGIN }
+ FUNCTION LoadMenuIndirect (
+ l_ : LPSTR
+ ) : HMENU;
+{ $END }
+
+{ $IFDECL LoadString $THEN BEGIN }
+ FUNCTION LoadString (
+ h_ : HANDLE;
+ w_ : WORD;
+ l_ : LPSTR;
+ i_ : int
+ ) : int;
+{ $END }
+
+
+{ $IFDECL AddFontResource $THEN BEGIN }
+ FUNCTION AddFontResource (
+ l_ : LPSTR
+ ) : short;
+{ $END }
+
+{ $IFDECL RemoveFontResource $THEN BEGIN }
+ FUNCTION RemoveFontResource (
+ l_ : LPSTR
+ ) : BOOL;
+{ $END }
+
+
+CONST
+ CP_HWND = 0;
+ CP_OPEN = 1;
+ CP_DIRECT = 2;
+
+(* VK from the keyboard driver *)
+ VK_KANA = #15;
+ VK_ROMAJI = #16;
+ VK_ZENKAKU = #17;
+ VK_HIRAGANA = #18;
+ VK_KANJI = #19;
+
+(* VK to send to Applications *)
+ VK_CONVERT = #1C;
+ VK_NONCONVERT = #1D;
+ VK_ACCEPT = #1E;
+ VK_MODECHANGE = #1F;
+
+
+(* Conversion function numbers *)
+ KNJ_START = #01;
+ KNJ_END = #02;
+ KNJ_QUERY = #03;
+
+ KNJ_LEARN_MODE = #10;
+ KNJ_GETMODE = #11;
+ KNJ_SETMODE = #12;
+
+ KNJ_CODECONVERT = #20;
+ KNJ_CONVERT = #21;
+ KNJ_NEXT = #22;
+ KNJ_PREVIOUS = #23;
+ KNJ_ACCEPT = #24;
+
+ KNJ_LEARN = #30;
+ KNJ_REGISTER = #31;
+ KNJ_REMOVE = #32;
+ KNJ_CHANGE_UDIC = #33;
+
+(* note: DEFAULT = 0
+ JIS1 = 1
+ JIS2 = 2
+ SJIS2 = 3
+ JIS1KATAKANA = 4
+ SJIS2HIRAGANA = 5
+ SJIS2KATAKANA = 6
+ OEM = F
+*)
+
+ KNJ_JIS1toJIS1KATAKANA = #14;
+ KNJ_JIS1toSJIS2 = #13;
+ KNJ_JIS1toSJIS2HIRAGANA = #15;
+ KNJ_JIS1toSJIS2KATAKANA = #16;
+ KNJ_JIS1toDEFAULT = #10;
+ KNJ_JIS1toSJIS2OEM = #1F;
+ KNJ_JIS2toSJIS2 = #23;
+ KNJ_SJIS2toJIS2 = #32;
+
+(* see KNJ_GETMODE for definition *)
+ KNJ_MD_ALPHA = #01;
+ KNJ_MD_HIRAGANA = #02;
+ KNJ_MD_HALF = #04;
+ KNJ_MD_JIS = #08;
+ KNJ_MD_SPECIAL = #10;
+
+(* conversion modes, low word of lParam when VK_CONVERT is sent to the app *)
+ KNJ_CVT_NEXT = #01;
+ KNJ_CVT_PREV = #02;
+ KNJ_CVT_KATAKANA = #03;
+ KNJ_CVT_HIRAGANA = #04;
+ KNJ_CVT_JIS1 = #05;
+ KNJ_CVT_SJIS2 = #06;
+ KNJ_CVT_DEFAULT = #07;
+ KNJ_CVT_TYPED = #08;
+
+(* WM_YOMICHAR = #0108;
+ WM_CONVERTREQUEST = #010A;
+ WM_CONVERTRESULT = #010B; Previously defined constants.
+*)
+
+
+TYPE
+ KANJISTRUCT = RECORD
+ fnc : short;
+ wParam : short;
+ lpSource : LPSTR;
+ lpdest : LPSTR;
+ wCount : short;
+ lpReserved1 : LPSTR;
+ lpReserved2 : LPSTR;
+ END;
+
+ LPKANJISTRUCT = ADS OF KANJISTRUCT;
+
+
+{ $IFDECL MoveConvertWindow $THEN BEGIN }
+ PROCEDURE MoveConvertWindow (
+ s_,t_ : short
+ );
+{ $END }
+
+{ $IFDECL ConvertRequest $THEN BEGIN }
+ FUNCTION ConvertRequest (
+ h_ : HWND;
+ l_ : LPKANJISTRUCT
+ ) : short;
+{ $END }
+
+{ $IFDECL SetConvertParams $THEN BEGIN }
+ FUNCTION SetConvertParams (
+ s_,t_ : short
+ ) : BOOL;
+{ $END }
+
+{ $IFDECL SetConvertHook $THEN BEGIN }
+ PROCEDURE SetConvertHook (
+ b_ : BOOL
+ );
+{ $END }
+
+(* Conventional dialog box and message box command IDs *)
+
+CONST
+ IDOK = 1;
+ IDCANCEL = 2;
+ IDABORT = 3;
+ IDRETRY = 4;
+ IDIGNORE = 5;
+ IDYES = 6;
+ IDNO = 7;
+
+
+(* Control manager structures & definitions *)
+(* Edit control class stuff *)
+
+(* styles *)
+ ES_LEFT = BYLONG(0,0);
+ ES_CENTER = BYLONG(0,1);
+ ES_RIGHT = BYLONG(0,2);
+ ES_MULTILINE = BYLONG(0,4);
+ ES_AUTOVSCROLL = BYLONG(0,64);
+ ES_AUTOHSCROLL = BYLONG(0,128);
+ ES_NOHIDESEL = BYLONG(0,256);
+
+(* notification codes *)
+ EN_SETFOCUS_ = #0100;
+ EN_KILLFOCUS_ = #0200;
+ EN_CHANGE = #0300;
+ EN_UPDATE = #0400;
+ EN_ERRSPACE = #0500;
+ EN_HSCROLL = #0601;
+ EN_VSCROLL = #0602;
+
+(* control messages: *)
+ EM_GETSEL = WM_USER+0;
+ EM_SETSEL = WM_USER+1;
+ EM_GETRECT = WM_USER+2;
+ EM_SETRECT = WM_USER+3;
+ EM_SETRECTNP = WM_USER+4;
+ EM_SCROLL = WM_USER+5;
+ EM_LINESCROLL = WM_USER+6;
+ EM_GETMODIFY = WM_USER+8;
+ EM_SETMODIFY = WM_USER+9;
+ EM_GETLINECOUNT = WM_USER+10;
+ EM_LINEINDEX = WM_USER+11;
+ EM_SETHANDLE = WM_USER+12;
+ EM_GETHANDLE = WM_USER+13;
+ EM_GETTHUMB = WM_USER+14;
+ EM_LINELENGTH = WM_USER+17;
+ EM_REPLACESEL = WM_USER+18;
+ EM_SETFONT = WM_USER+19;
+ EM_GETLINE = WM_USER+20;
+ EM_LIMITTEXT = WM_USER+21;
+ EM_CANUNDO = WM_USER+22;
+ EM_UNDO = WM_USER+23;
+ EM_FMTLINES = WM_USER+24;
+ EM_LINEFROMCHAR = WM_USER+25;
+ EM_SETWORDBREAK = WM_USER+26;
+
+(* button control styles *)
+ BS_PUSHBUTTON = BYLONG(0,0);
+ BS_DEFPUSHBUTTON = BYLONG(0,1);
+ BS_CHECKBOX = BYLONG(0,2);
+ BS_AUTOCHECKBOX = BYLONG(0,3);
+ BS_RADIOBUTTON = BYLONG(0,4);
+ BS_3STATE = BYLONG(0,5);
+ BS_AUTO3STATE = BYLONG(0,6);
+ BS_GROUPBOX = BYLONG(0,7);
+ BS_USERBUTTON = BYLONG(0,8);
+ BS_AUTORADIOBUTTON = BYLONG(0,9);
+ BS_PUSHBOX = BYLONG(0,10);
+ BS_LEFTTEXT = BYLONG(0,20);
+
+(* user button notification codes *)
+ BN_CLICKED = 0;
+ BN_PAINT = 1;
+ BN_HILITE = 2;
+ BN_UNHILITE = 3;
+ BN_DISABLE = 4;
+ BN_DOUBLECLICKED = 5;
+
+(* control messages *)
+ BM_GETCHECK = WM_USER+0;
+ BM_SETCHECK = WM_USER+1;
+ BM_GETSTATE = WM_USER+2;
+ BM_SETSTATE = WM_USER+3;
+ BM_SETSTYLE = WM_USER+4;
+
+(* Static control constants *)
+
+ SS_LEFT = BYLONG(0,0);
+ SS_CENTER = BYLONG(0,1);
+ SS_RIGHT = BYLONG(0,2);
+ SS_ICON = BYLONG(0,3);
+ SS_BLACKRECT = BYLONG(0,4);
+ SS_GRAYRECT = BYLONG(0,5);
+ SS_WHITERECT = BYLONG(0,6);
+ SS_BLACKFRAME = BYLONG(0,7);
+ SS_GRAYFRAME = BYLONG(0,8);
+ SS_WHITEFRAME = BYLONG(0,9);
+ SS_USERITEM = BYLONG(0,10);
+ SS_SIMPLE = BYLONG(0,11);
+ SS_NOPREFIX = BYLONG(0,128);
+ (* 0x80 - don't do "&" character translation *)
+
+(* Dialog manager routines *)
+
+
+{ $IFDECL IsDialogMessage $THEN BEGIN }
+ FUNCTION IsDialogMessage (
+ h_ : HWND;
+ l_ : LPMSG
+ ) : BOOL;
+{ $END }
+
+
+{ $IFDECL MapDialogRect $THEN BEGIN }
+ PROCEDURE MapDialogRect (
+ h_ : HWND;
+ l_ : LPRECT
+ );
+{ $END }
+
+
+{ $IFDECL DlgDirList $THEN BEGIN }
+ FUNCTION DlgDirList (
+ h_ : HWND;
+ l_ : LPSTR;
+ i_,j_ : int;
+ w_ : WORD
+ ) : int;
+{ $END }
+
+{ $IFDECL DlgDirSelect $THEN BEGIN }
+ FUNCTION DlgDirSelect (
+ h_ : HWND;
+ l_ : LPSTR;
+ i_ : int
+ ) : BOOL;
+{ $END }
+
+(* Dialog style bits *)
+
+CONST
+ DS_ABSALIGN = #000000001;
+ DS_SYSMODAL = #000000002;
+ DS_LOCALEDIT = #000000020; (* Edit items get Local storage. *)
+
+ DM_GETDEFID = WM_USER+0;
+ DM_SETDEFID = WM_USER+1;
+ DC_HASDEFID = #534B;
+
+(* Dialog codes (returned by WM_GETDLGCODE message) *)
+
+ DLGC_WANTARROWS = #0001; (* control wants arrow keys *)
+ DLGC_WANTTAB = #0002; (* control wants tab keys *)
+ DLGC_WANTALLKEYS = #0004; (* control wants all keys *)
+ DLGC_HASSETSEL = #0008; (* understands EM_SETSEL message *)
+ DLGC_WANTMESSAGE = #0004; (* pass message to control *)
+ DLGC_DEFPUSHBUTTON = #0010; (* Default pushbutton *)
+ DLGC_UNDEFPUSHBUTTON = #0020; (* Non-default pushbutton *)
+ DLGC_RADIOBUTTON = #0040; (* radio button *)
+ DLGC_WANTCHARS = #0080; (* Want WM_CHAR messages *)
+ DLGC_STATIC = #0100; (* Static item: don't include *)
+ DLGC_BUTTON = #2000; (* Button item: can be checked *)
+
+ LB_CTLCODE = BYLONG(0,0);
+
+(* Listbox control return values *)
+ LB_OKAY = 0;
+ LB_ERR = -1;
+ LB_ERRSPACE = -2;
+
+(* listbox notification codes *)
+ LBN_ERRSPACE = -2;
+ LBN_SELCHANGE = 1;
+ LBN_DBLCLK = 2;
+
+(* listbox messages *)
+ LB_ADDSTRING = 1+WM_USER;
+ LB_INSERTSTRING = 2+WM_USER;
+ LB_DELETESTRING = 3+WM_USER;
+ LB_REPLACESTRING = 4+WM_USER;
+ LB_RESETCONTENT = 5+WM_USER;
+ LB_SETSEL = 6+WM_USER;
+ LB_SETCURSEL = 7+WM_USER;
+ LB_GETSEL = 8+WM_USER;
+ LB_GETCURSEL = 9+WM_USER;
+ LB_GETTEXT = 10+WM_USER;
+ LB_GETTEXTLEN = 11+WM_USER;
+ LB_GETCOUNT = 12+WM_USER;
+ LB_SELECTSTRING = 13+WM_USER;
+ LB_DIR = 14+WM_USER;
+ LB_GETTOPINDEX = 15+WM_USER;
+ LB_MSGMAX = 16+WM_USER;
+
+(* listbox style bits *)
+ LBS_NOTIFY = #00000001;
+ LBS_SORT = #00000002;
+ LBS_NOREDRAW = #00000004;
+ LBS_MULTIPLESEL = #00000008;
+ LBS_STANDARD = #00A00003; (*LBS_NOTIFY | LBS_SORT | WS_VSCROLL | WS_BORDER *)
+
+
+(* scroll bar styles *)
+ SBS_HORZ = #00000000;
+ SBS_VERT = #00000001;
+ SBS_TOPALIGN = #00000002;
+ SBS_LEFTALIGN = #00000002;
+ SBS_BOTTOMALIGN = #00000004;
+ SBS_RIGHTALIGN = #00000004;
+ SBS_SIZEBOXTOPLEFTALIGN = #00000002;
+ SBS_SIZEBOXBOTTOMRIGHTALIGN = #00000004;
+ SBS_SIZEBOX = #00000008;
+
+
+{ $IFDECL OpenSound $THEN BEGIN }
+ FUNCTION OpenSound : int;
+{ $END }
+
+{ $IFDECL CloseSound $THEN BEGIN }
+ FUNCTION CloseSound : int;
+{ $END }
+
+{ $IFDECL SetVoiceQueueSize $THEN BEGIN }
+ FUNCTION SetVoiceQueueSize (
+ i_,j_ : int
+ ) : int;
+{ $END }
+
+{ $IFDECL SetVoiceNote $THEN BEGIN }
+ FUNCTION SetVoiceNote (
+ i_,j_,k_,l_ : int
+ ) : int;
+{ $END }
+
+{ $IFDECL SetVoiceAccent $THEN BEGIN }
+ FUNCTION SetVoiceAccent (
+ i_,j_,k_,l_,m_ : int
+ ) : int;
+{ $END }
+
+{ $IFDECL SetVoiceEnvelope $THEN BEGIN }
+ FUNCTION SetVoiceEnvelope (
+ i_,j_,k_ : int
+ ) : int;
+{ $END }
+
+{ $IFDECL SetSoundNoise $THEN BEGIN }
+ FUNCTION SetSoundNoise (
+ i_,j_ : int
+ ) : int;
+{ $END }
+
+{ $IFDECL SetVoiceSound $THEN BEGIN }
+ FUNCTION SetVoiceSound (
+ i_,j_,k_ : int
+ ) : int;
+{ $END }
+
+{ $IFDECL StartSound $THEN BEGIN }
+ FUNCTION StartSound : int;
+{ $END }
+
+{ $IFDECL StopSound $THEN BEGIN }
+ FUNCTION StopSound : int;
+{ $END }
+
+{ $IFDECL WaitSoundState $THEN BEGIN }
+ FUNCTION WaitSoundState (
+ i_ : int
+ ) : int;
+{ $END }
+
+{ $IFDECL SyncAllVoices $THEN BEGIN }
+ FUNCTION SyncAllVoices : int;
+{ $END }
+
+{ $IFDECL CountVoiceNotes $THEN BEGIN }
+ FUNCTION CountVoiceNotes (
+ i_ : int
+ ) : int;
+{ $END }
+
+{ $IFDECL GetThresholdEvent $THEN BEGIN }
+ FUNCTION GetThresholdEvent : LPINT;
+{ $END }
+
+{ $IFDECL GetThresholdStatus $THEN BEGIN }
+ FUNCTION GetThresholdStatus : int;
+{ $END }
+
+{ $IFDECL SetVoiceThreshold $THEN BEGIN }
+ FUNCTION SetVoiceThreshold (
+ i_,j_ : int
+ ) : int;
+{ $END }
+
+(* constants used to specify return condition for WaitSoundState *)
+
+
+CONST
+ QUEUEEMPTY = 0;
+ THRESHOLD = 1;
+ ALLTHRESHOLD = 2;
+
+(* constants used to specify accent mode *)
+
+ S_NORMAL = 0;
+ S_LEGATO = 1;
+ S_STACCATO = 2;
+
+(* constants used to specify source in SetSoundNoise *)
+ S_PERIOD512 = 0 (* freq = N/512 high pitch, less coarse hiss *);
+ S_PERIOD1024 = 1 (* freq = N/1024 *);
+ S_PERIOD2048 = 2 (* freq = N/2048 low pitch, more coarse hiss *);
+ S_PERIODVOICE = 3 (* source is frequency from voice channel (3) *);
+
+ S_WHITE512 = 4 (* freq = N/512 high pitch, less coarse hiss *);
+ S_WHITE1024 = 5 (* freq = N/1024 *);
+ S_WHITE2048 = 6 (* freq = N/2048 low pitch, more coarse hiss *);
+ S_WHITEVOICE = 7 (* source is frequency from voice channel (3) *);
+
+ S_SERDVNA = -1 (* device not available *);
+ S_SEROFM = -2 (* out of memory *);
+ S_SERMACT = -3 (* music active *);
+ S_SERQFUL = -4 (* queue full *);
+ S_SERBDNT = -5 (* invalid note *);
+ S_SERDLN = -6 (* invalid note length *);
+ S_SERDCC = -7 (* invalid note count *);
+ S_SERDTP = -8 (* invalid tempo *);
+ S_SERDVL = -9 (* invalid volume *);
+ S_SERDMD = -10 (* invalid mode *);
+ S_SERDSH = -11 (* invalid shape *);
+ S_SERDPT = -12 (* invalid pitch *);
+ S_SERDFQ = -13 (* invalid frequency *);
+ S_SERDDR = -14 (* invalid duration *);
+ S_SERDSR = -15 (* invalid source *);
+ S_SERDST = -16 (* invalid state *);
+
+
+
+(*************************************************************************
+**
+** dcb field definitions.
+**
+*************************************************************************)
+
+ NOPARITY = 0;
+ ODDPARITY = 1;
+ EVENPARITY = 2;
+ MARKPARITY = 3;
+ SPACEPARITY = 4;
+
+ ONESTOPBIT = 0;
+ ONE5STOPBITS = 1;
+ TWOSTOPBITS = 2;
+
+ IGNORE = 0 (* Ignore signal *);
+ INFINITE = #ffff (* Infinite timeout *);
+
+
+
+(*************************************************************************
+**
+** Comm Device Driver Error Bits.
+**
+*************************************************************************)
+
+ CE_RXOVER = #0001 (* Receive Queue overflow *);
+ CE_OVERRUN = #0002 (* Receive Overrun Error *);
+ CE_RXPARITY = #0004 (* Receive Parity Error *);
+ CE_FRAME = #0008 (* Receive Framing error *);
+ CE_BREAK = #0010 (* Break Detected *);
+ CE_CTSTO = #0020 (* CTS Timeout *);
+ CE_DSRTO = #0040 (* DSR Timeout *);
+ CE_RLSDTO = #0080 (* RLSD Timeout *);
+ CE_TXFULL = #0100 (* TX QUEUE IS FULL *);
+ CE_PTO = #0200 (* LPTx Timeout *);
+ CE_IOE = #0400 (* LPTx I/O Error *);
+ CE_DNS = #0800 (* LPTx Device not selected *);
+ CE_OOP = #1000 (* LPTx Out-Of-Paper *);
+ CE_MODE = #8000 (* Requested mode unsupported *);
+
+
+(*************************************************************************
+**
+** Initialization Error Codes
+**
+*************************************************************************)
+
+ IE_BADID = -1 (* Invalid or unsupported id *);
+ IE_OPEN = -2 (* Device Already Open *);
+ IE_NOPEN = -3 (* Device Not Open *);
+ IE_MEMORY = -4 (* Unable to allocate queues *);
+ IE_DEFAULT = -5 (* Error in default parameters *);
+ IE_HARDWARE = -10 (* Hardware Not Present *);
+ IE_BYTESIZE = -11 (* Illegal Byte Size *);
+ IE_BAUDRATE = -12 (* Unsupported BaudRate *);
+
+
+(*************************************************************************
+**
+** Event Definitions
+**
+*************************************************************************)
+
+ EV_RXCHAR = #0001 (* Any Character received *);
+ EV_RXFLAG = #0002 (* Received certain INTEGER1acter *);
+ EV_TXEMPTY = #0004 (* Transmitt Queue Empty *);
+ EV_CTS = #0008 (* CTS changed state *);
+ EV_DSR = #0010 (* DSR changed state *);
+ EV_RLSD = #0020 (* RLSD changed state *);
+ EV_BREAK = #0040 (* BREAK received *);
+ EV_ERR = #0080 (* Line status error occurred *);
+ EV_RING = #0100 (* Ring signal detected *);
+ EV_PERR = #0200 (* Printer error occured *);
+
+
+(*************************************************************************
+**
+** Escape Functions
+**
+*************************************************************************)
+
+ SETXOFF = 1 (* Simulate XOFF received *);
+ SETXON = 2 (* Simulate XON received *);
+ SETRTS = 3 (* Set RTS high *);
+ CLRRTS = 4 (* Set RTS low *);
+ SETDTR = 5 (* Set DTR high *);
+ CLRDTR = 6 (* Set DTR low *);
+ RESETDEV = 7 (* Reset device if possible *);
+
+
+(*************************************************************************
+**
+** Device Descriptor Block Definition
+**
+*************************************************************************)
+
+ LPTx = #80 (* Set if ID is for LPT device *);
+
+ (* Bitfield locators for 'bitField1' in DCB record type *)
+ fBinary = 1;
+ fRtsDisable = 2;
+ fParity = 4;
+ fOutxCtsFlow = 8;
+ fOutxDsrFlow = 16;
+ fDtrDisable = 128;
+
+ (* Bitfield locators for 'bitField2' in DCB record type *)
+ fOutX = 1;
+ fInX = 2;
+ fPeChar = 4;
+ fNull = 8;
+ fChEvt = 16;
+ fDtrflow = 32;
+ fRtsflow = 64;
+
+TYPE
+ DCB = RECORD
+ Id : BYTE; (* Internal Device ID *)
+ BaudRate : WORD; (* Baudrate at which runing *)
+ ByteSize : BYTE; (* Number of bits/byte, 4-8 *)
+ Parity : BYTE; (* 0-4=None,Odd,Even,Mark,Space *)
+ StopBits : BYTE; (* 0,1,2 = 1, 1.5, 2 *)
+ RlsTimeout : WORD; (* Timeout for RLSD to be set *)
+ CtsTimeout : WORD; (* Timeout for CTS to be set *)
+ DsrTimeout : WORD; (* Timeout for DSR to be set *)
+
+ bitField1 : BYTE;
+ (* Packed bits. Access with constants defined above.
+ * BYTE fBinary: 1; - Binary Mode (skip EOF check)
+ * BYTE fRtsDisable:1; - Don't assert RTS at init time
+ * BYTE fParity: 1; - Enable parity checking
+ * BYTE fOutxCtsFlow:1; - CTS handshaking on output
+ * BYTE fOutxDsrFlow:1; - DSR handshaking on output
+ * BYTE fDummy: 2; - Reserved
+ * BYTE fDtrDisable:1; - Don't assert DTR at init time
+ *)
+ bitField2 : BYTE;
+ (* Packed bits. Access with constants defined above.
+ * BYTE fOutX: 1; - Enable output X-ON/X-OFF
+ * BYTE fInX: 1; - Enable input X-ON/X-OFF
+ * BYTE fPeChar: 1; - Enable Parity Err Replacement
+ * BYTE fNull: 1; - Enable Null stripping
+ * BYTE fChEvt: 1; - Enable Rx INTEGER1acter event.
+ * BYTE fDtrflow: 1; - DTR handshake on input
+ * BYTE fRtsflow: 1; - RTS handshake on input
+ * BYTE fDummy2: 1; }
+ *)
+ XonChar : INTEGER1; (* Tx and Rx X-ON INTEGER1acter *)
+ XoffChar : INTEGER1; (* Tx and Rx X-OFF INTEGER1acter *)
+ XonLim : WORD; (* Transmit X-ON threshold *)
+ XoffLim : WORD; (* Transmit X-OFF threshold *)
+ PeChar : INTEGER1; (* Parity error replacement INTEGER1*)
+ EofChar : INTEGER1; (* End of Input INTEGER1acter *)
+ EvtChar : INTEGER1; (* Recieved Event INTEGER1acter *)
+ TxDelay : WORD; (* Amount of time between INTEGER1s *)
+ END;
+ LPDCB = ADS OF DCB;
+
+
+(*************************************************************************
+**
+** Status record returned by GetCommError
+**
+*************************************************************************)
+
+CONST
+ fCtsHold = 1;
+ fDsrHold = 2;
+ fRlsdHold = 4;
+ fXoffHold = 8;
+ fXoffSent = 16;
+ fEof = 32;
+ fTxim = 64;
+
+TYPE
+ COMSTAT = RECORD
+ bitField : BYTE;
+ (* Packed bits. Access with constants defined above.
+ * BYTE fCtsHold: 1; - Transmit is on CTS hold
+ * BYTE fDsrHold: 1; - Transmit is on DSR hold
+ * BYTE fRlsdHold: 1; - Transmit is on RLSD hold
+ * BYTE fXoffHold: 1; - Received handshake
+ * BYTE fXoffSent: 1; - Issued handshake
+ * BYTE fEof: 1; - End of file INTEGER1acter found
+ * BYTE fTxim: 1; - Character being transmitted
+ *)
+ cbInQue : WORD; (* count of characters in Rx Que*)
+ cbOutQue : WORD; (* count of characters in Tx Que*)
+ END;
+ LPCOMSTAT = ADS OF COMSTAT;
+
+{ $IFDECL OpenComm $THEN BEGIN }
+ FUNCTION OpenComm (
+ l_ : LPSTR;
+ w_,x_ : WORD
+ ) : short;
+{ $END }
+
+{ $IFDECL SetCommState $THEN BEGIN }
+ FUNCTION SetCommState (
+ d_ : LPDCB
+ ) : short;
+{ $END }
+
+{ $IFDECL GetCommState $THEN BEGIN }
+ FUNCTION GetCommState (
+ s_ : short;
+ d_ : LPDCB
+ ) : short;
+{ $END }
+
+{ $IFDECL ReadComm $THEN BEGIN }
+ FUNCTION ReadComm (
+ s_ : short;
+ l_ : LPSTR;
+ i_ : int
+ ) : short;
+{ $END }
+
+{ $IFDECL UngetCommChar $THEN BEGIN }
+ FUNCTION UngetCommChar (
+ s_ : short;
+ i_ : INTEGER1
+ ) : short;
+{ $END }
+
+{ $IFDECL WriteComm $THEN BEGIN }
+ FUNCTION WriteComm (
+ s_ : short;
+ l_ : LPSTR;
+ i_ : int
+ ) : short;
+{ $END }
+
+{ $IFDECL CloseComm $THEN BEGIN }
+ FUNCTION CloseComm (
+ s_ : short
+ ) : short;
+{ $END }
+
+{ $IFDECL GetCommError $THEN BEGIN }
+ FUNCTION GetCommError (
+ s_ : short;
+ c_ : LPCOMSTAT
+ ) : short;
+{ $END }
+
+{ $IFDECL BuildCommDCB $THEN BEGIN }
+ FUNCTION BuildCommDCB (
+ l_ : LPSTR;
+ d_ : LPDCB
+ ) : short;
+{ $END }
+
+{ $IFDECL TransmitCommChar $THEN BEGIN }
+ FUNCTION TransmitCommChar (
+ s_ : short;
+ i_ : INTEGER1
+ ) : short;
+{ $END }
+
+{ $IFDECL SetCommEventMask $THEN BEGIN }
+ FUNCTION SetCommEventMask (
+ s_ : short;
+ w_ : WORD
+ ) : LPWORD;
+{ $END }
+
+{ $IFDECL GetCommEventMask $THEN BEGIN }
+ FUNCTION GetCommEventMask (
+ s_ : short;
+ i_ : int
+ ) : WORD;
+{ $END }
+
+{ $IFDECL SetCommBreak $THEN BEGIN }
+ FUNCTION SetCommBreak (
+ s_ : short
+ ) : short;
+{ $END }
+
+{ $IFDECL ClearCommBreak $THEN BEGIN }
+ FUNCTION ClearCommBreak (
+ s_ : short
+ ) : short;
+{ $END }
+
+{ $IFDECL FlushComm $THEN BEGIN }
+ FUNCTION FlushComm (
+ s_ : short;
+ i_ : int
+ ) : short;
+{ $END }
+
+{ $IFDECL EscapeCommFunction $THEN BEGIN }
+ FUNCTION EscapeCommFunction (
+ s_ : short;
+ i_ : int
+ ) : short;
+{ $END }
+END;
diff --git a/private/mvdm/wow16/inc/penwin.h b/private/mvdm/wow16/inc/penwin.h
new file mode 100644
index 000000000..fbe2d112e
--- /dev/null
+++ b/private/mvdm/wow16/inc/penwin.h
@@ -0,0 +1,818 @@
+/*****************************************************************************\
+* *
+* penwin.h - Pen Windows functions, types, and definitions *
+* *
+* Version 1.0 *
+* *
+* Copyright (c) 1992, Microsoft Corp. All rights reserved. *
+* *
+\*****************************************************************************/
+
+#ifndef _INC_WINDOWS
+#include <windows.h> /* <windows.h> must be pre-included */
+#endif /* _INC_WINDOWS */
+
+#ifndef _INC_PENWIN /* prevent multiple includes */
+#define _INC_PENWIN
+
+#ifndef RC_INVOKED
+#pragma pack(1)
+#endif /* RC_INVOKED */
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+/****** General Pen Windows Definitions *************************************/
+
+typedef int REC;
+typedef LONG SYV;
+typedef SYV FAR *LPSYV;
+typedef HANDLE HREC;
+typedef int CL;
+typedef LONG ALC;
+typedef UINT HKP;
+typedef int (CALLBACK * LPDF)(int, LPVOID, LPVOID, int, DWORD, DWORD);
+
+#define BITPENUP 0x8000
+#define FPenUpX(x) (((x) & BITPENUP)!=0)
+
+/* Default pen cursor to indicate writing, points northwest */
+#define IDC_PEN MAKEINTRESOURCE(32631)
+
+/* alternate select cursor: upsidedown standard arrow, points southeast */
+#define IDC_ALTSELECT MAKEINTRESOURCE(32501)
+
+#define RC_WDEFAULT (0xFFFF)
+#define RC_LDEFAULT (0xFFFFFFFFL)
+#define RC_WDEFAULTFLAGS (0x8000)
+#define RC_LDEFAULTFLAGS (0x80000000L)
+
+/* HIWORD(SYV) defines and detection macros */
+
+#define SYVHI_SPECIAL 0
+#define FIsSpecial(syv) (HIWORD((syv))==SYVHI_SPECIAL)
+#define SYVHI_ANSI 1
+#define FIsAnsi(syv) (HIWORD((syv))==SYVHI_ANSI)
+#define SYVHI_GESTURE 2
+#define FIsGesture(syv) (HIWORD((syv))==SYVHI_GESTURE)
+#define SYVHI_KANJI 3
+#define FIsKanji(syv) (HIWORD((syv))==SYVHI_KANJI)
+#define SYVHI_SHAPE 4
+#define FIsShape(syv) (HIWORD((syv))==SYVHI_SHAPE)
+#define SYVHI_UNICODE 5
+#define FIsUniCode(syv) (HIWORD((syv))==SYVHI_UNICODE)
+#define SYVHI_VKEY 6
+#define FIsVKey(syv) (HIWORD((syv))==SYVHI_VKEY)
+
+/* Macros to convert between SYV and ANSI */
+
+#define ChSyvToAnsi(syv) ((BYTE) (LOBYTE(LOWORD((syv)))))
+#define SyvCharacterToSymbol(c) ((LONG)(unsigned char)(c) | 0x00010000)
+#define SyvKanjiToSymbol(c) ((LONG)(WORD)(c) | 0x00030000)
+
+/* SYV values with special meanings to Pen Windows */
+
+#define SYV_NULL 0x00000000L
+#define SYV_UNKNOWN 0x00000001L
+#define SYV_EMPTY 0x00000003L
+#define SYV_BEGINOR 0x00000010L
+#define SYV_ENDOR 0x00000011L
+#define SYV_OR 0x00000012L
+#define SYV_SOFTNEWLINE 0x00000020L
+#define SYV_SPACENULL SyvCharacterToSymbol('\0')
+
+/* SYV values for gestures (map into UNICODE space) */
+
+#define SYV_KKCONVERT 0x0002FFD4L
+#define SYV_CLEAR 0x0002FFD5L
+#define SYV_EXTENDSELECT 0x0002FFD8L
+#define SYV_UNDO 0x0002FFD9L
+#define SYV_COPY 0x0002FFDAL
+#define SYV_CUT 0x0002FFDBL
+#define SYV_PASTE 0x0002FFDCL
+#define SYV_CLEARWORD 0x0002FFDDL
+#define SYV_USER 0x0002FFDEL /* ;Reserved */
+#define SYV_CORRECT 0x0002FFDFL
+
+#define SYV_BACKSPACE 0x00020008L
+#define SYV_TAB 0x00020009L
+#define SYV_RETURN 0x0002000DL
+#define SYV_SPACE 0x00020020L
+
+#define FIsStdGesture(syv) \
+ ((syv) == SYV_CLEAR \
+ || (syv) == SYV_EXTENDSELECT\
+ || (syv) == SYV_UNDO \
+ || (syv) == SYV_COPY \
+ || (syv) == SYV_CUT \
+ || (syv) == SYV_PASTE \
+ || (syv) == SYV_CLEARWORD \
+ || (syv) == SYV_KKCONVERT \
+ || (syv) == SYV_USER \
+ || (syv) == SYV_CORRECT)
+
+#define FIsAnsiGesture(syv) \
+ ((syv) == SYV_BACKSPACE \
+ || (syv) == SYV_TAB \
+ || (syv) == SYV_RETURN \
+ || (syv) == SYV_SPACE)
+
+/* Application specific gestures, Circle a-z and Circle A-Z */
+
+#define SYV_APPGESTUREMASK 0x00020000L
+#define SYV_CIRCLEUPA 0x000224B6L
+#define SYV_CIRCLEUPZ 0x000224CFL
+#define SYV_CIRCLELOA 0x000224D0L
+#define SYV_CIRCLELOZ 0x000224E9L
+
+/* Gesture Macros */
+
+#define FIsLoAppGesture(syv) (syv >= SYV_CIRCLELOA && syv <= SYV_CIRCLELOZ)
+#define FIsUpAppGesture(syv) (syv >= SYV_CIRCLEUPA && syv <= SYV_CIRCLEUPZ)
+#define FIsAppGesture(syv) (syv>=SYV_CIRCLEUPA && syv<=SYV_CIRCLELOZ)
+
+#define SyvAppGestureFromLoAnsi(ansi) ((DWORD)(BYTE)ansi- 'a' + SYV_CIRCLELOA)
+#define SyvAppGestureFromUpAnsi(ansi) ((DWORD)(BYTE)ansi- 'A' + SYV_CIRCLEUPA)
+#define AnsiFromSyvAppGesture(syv) ChSyvToAnsi( \
+ syv-(FIsUpAppGesture(syv)? SYV_CIRCLEUPA-(SYV)'A': SYV_CIRCLELOA-(SYV)'a'))
+
+/* SYV definitions for shapes */
+
+#define SYV_SHAPELINE 0x00040001L
+#define SYV_SHAPEELLIPSE 0x00040002L
+#define SYV_SHAPERECT 0x00040003L
+#define SYV_SHAPEMIN SYV_SHAPELINE
+#define SYV_SHAPEMAX SYV_SHAPERECT
+
+/****** Recognition Error Codes *********************************************/
+
+#define REC_OEM (-1024)
+#define REC_LANGUAGE (-48)
+#define REC_GUIDE (-47)
+#define REC_PARAMERROR (-46)
+#define REC_INVALIDREF (-45)
+#define REC_RECTEXCLUDE (-44)
+#define REC_RECTBOUND (-43)
+#define REC_PCM (-42)
+#define REC_RESULTMODE (-41)
+#define REC_HWND (-40)
+#define REC_ALC (-39)
+#define REC_ERRORLEVEL (-38)
+#define REC_CLVERIFY (-37)
+#define REC_DICT (-36)
+#define REC_HREC (-35)
+#define REC_BADEVENTREF (-33)
+#define REC_NOCOLLECTION (-32)
+
+#define REC_DEBUG (-32)
+
+#define REC_POINTEREVENT (-31)
+#define REC_BADHPENDATA (-9)
+#define REC_OOM (-8)
+#define REC_NOINPUT (-7)
+#define REC_NOTABLET (-6)
+#define REC_BUSY (-5)
+#define REC_BUFFERTOOSMALL (-4)
+#define REC_ABORT (-3)
+
+#define REC_OVERFLOW (-1)
+
+#define REC_OK 0
+#define REC_TERMBOUND 1
+#define REC_TERMEX 2
+#define REC_TERMPENUP 3
+#define REC_TERMRANGE 4
+#define REC_TERMTIMEOUT 5
+#define REC_DONE 6
+#define REC_TERMOEM 512
+
+/****** Pen Driver Structures and Entry points ******************************/
+
+typedef struct tagOEMPENINFO
+ {
+ UINT wPdt;
+ UINT wValueMax;
+ UINT wDistinct;
+ }
+ OEMPENINFO, FAR *LPOEMPENINFO;
+
+#define PDT_NULL 0
+#define PDT_PRESSURE 1
+#define PDT_HEIGHT 2
+#define PDT_ANGLEXY 3
+#define PDT_ANGLEZ 4
+#define PDT_BARRELROTATION 5
+#define PDT_OEMSPECIFIC 16
+
+#define MAXOEMDATAWORDS 6
+
+typedef struct tagPENPACKET
+ {
+ UINT wTabletX;
+ UINT wTabletY;
+ UINT wPDK;
+ UINT rgwOemData[MAXOEMDATAWORDS];
+ }
+ PENPACKET, FAR *LPPENPACKET;
+
+typedef BOOL (CALLBACK * LPFNRAWHOOK)(LPPENPACKET);
+
+typedef struct tagPENINFO
+ {
+ UINT cxRawWidth;
+ UINT cyRawHeight;
+ UINT wDistinctWidth;
+ UINT wDistinctHeight;
+ int nSamplingRate;
+ int nSamplingDist;
+ LONG lPdc;
+ int cPens;
+ int cbOemData;
+ OEMPENINFO rgoempeninfo[MAXOEMDATAWORDS];
+ UINT rgwReserved[8];
+ }
+ PENINFO, FAR *LPPENINFO;
+
+#define PDC_INTEGRATED 0x00000001L
+#define PDC_PROXIMITY 0x00000002L
+#define PDC_RANGE 0x00000004L
+#define PDC_INVERT 0x00000008L
+#define PDC_RELATIVE 0x00000010L
+#define PDC_BARREL1 0x00000020L
+#define PDC_BARREL2 0x00000040L
+#define PDC_BARREL3 0x00000080L
+
+typedef struct tagSTROKEINFO
+ {
+ UINT cPnt;
+ UINT cbPnts;
+ UINT wPdk;
+ DWORD dwTick;
+ }
+ STROKEINFO, FAR *LPSTROKEINFO;
+
+typedef struct tagCALBSTRUCT
+ {
+ int wOffsetX;
+ int wOffsetY;
+ int wDistinctWidth;
+ int wDistinctHeight;
+ }
+ CALBSTRUCT, FAR *LPCALBSTRUCT;
+
+/****** DRV_ values for pen driver specific messages ************************/
+
+#define DRV_SetPenDriverEntryPoints DRV_RESERVED+1
+#define DRV_RemovePenDriverEntryPoints DRV_RESERVED+2
+#define DRV_SetPenSamplingRate DRV_RESERVED+3
+#define DRV_SetPenSamplingDist DRV_RESERVED+4
+#define DRV_GetName DRV_RESERVED+5
+#define DRV_GetVersion DRV_RESERVED+6
+#define DRV_GetPenInfo DRV_RESERVED+7
+#define DRV_GetCalibration DRV_RESERVED+11
+#define DRV_SetCalibration DRV_RESERVED+12
+
+VOID WINAPI UpdatePenInfo(LPPENINFO);
+BOOL WINAPI EndPenCollection(REC);
+REC WINAPI GetPenHwData(LPPOINT, LPVOID, int, UINT, LPSTROKEINFO);
+REC WINAPI GetPenHwEventData(UINT, UINT, LPPOINT, LPVOID, int, LPSTROKEINFO);
+VOID WINAPI PenPacket(VOID);
+BOOL WINAPI SetPenHook(HKP, LPFNRAWHOOK);
+
+/****** Pen Hardware Constants **********************************************/
+
+#define PDK_UP 0x0000
+#define PDK_DOWN 0x0001
+#define PDK_BARREL1 0x0002
+#define PDK_BARREL2 0x0004
+#define PDK_BARREL3 0x0008
+#define PDK_TRANSITION 0x0010
+#define PDK_INVERTED 0x0080
+#define PDK_OUTOFRANGE 0x4000
+#define PDK_DRIVER 0x8000
+#define PDK_TIPMASK 0x0001
+#define PDK_SWITCHES (PDK_DOWN|PDK_BARREL1|PDK_BARREL2|PDK_BARREL3)
+
+#define PCM_PENUP 0x00000001L
+#define PCM_RANGE 0x00000002L
+#define PCM_INVERT 0x00000020L
+#define PCM_RECTEXCLUDE 0x00002000L
+#define PCM_RECTBOUND 0x00004000L
+#define PCM_TIMEOUT 0x00008000L
+#define PCM_ADDDEFAULTS RC_LDEFAULTFLAGS /* 0x80000000L */
+
+/****** Virtual Event Layer *************************************************/
+
+VOID WINAPI PostVirtualKeyEvent(UINT, BOOL);
+VOID WINAPI PostVirtualMouseEvent(UINT, int, int);
+VOID WINAPI AtomicVirtualEvent(BOOL);
+
+#define VWM_MOUSEMOVE 0x0001
+#define VWM_MOUSELEFTDOWN 0x0002
+#define VWM_MOUSELEFTUP 0x0004
+#define VWM_MOUSERIGHTDOWN 0x0008
+#define VWM_MOUSERIGHTUP 0x0010
+
+/****** RC Definition *************************************************************/
+
+#define CL_NULL 0
+#define CL_MINIMUM 1
+#define CL_MAXIMUM 100
+#define INKWIDTH_MINIMUM 0
+#define INKWIDTH_MAXIMUM 15
+#define ENUM_MINIMUM 1
+#define ENUM_MAXIMUM 4096
+#define MAXDICTIONARIES 16
+
+typedef struct tagGUIDE
+ {
+ int xOrigin;
+ int yOrigin;
+ int cxBox;
+ int cyBox;
+ int cxBase;
+ int cyBase;
+ int cHorzBox;
+ int cVertBox;
+ int cyMid;
+ }
+ GUIDE, FAR *LPGUIDE;
+
+typedef BOOL (CALLBACK * RCYIELDPROC)(VOID);
+
+#define cbRcLanguageMax 44
+#define cbRcUserMax 32
+#define cbRcrgbfAlcMax 32
+#define cwRcReservedMax 8
+
+typedef struct tagRC
+ {
+ HREC hrec;
+ HWND hwnd;
+ UINT wEventRef;
+ UINT wRcPreferences;
+ LONG lRcOptions;
+ RCYIELDPROC lpfnYield;
+ BYTE lpUser[cbRcUserMax];
+ UINT wCountry;
+ UINT wIntlPreferences;
+ char lpLanguage[cbRcLanguageMax];
+ LPDF rglpdf[MAXDICTIONARIES];
+ UINT wTryDictionary;
+ CL clErrorLevel;
+ ALC alc;
+ ALC alcPriority;
+ BYTE rgbfAlc[cbRcrgbfAlcMax];
+ UINT wResultMode;
+ UINT wTimeOut;
+ LONG lPcm;
+ RECT rectBound;
+ RECT rectExclude;
+ GUIDE guide;
+ UINT wRcOrient;
+ UINT wRcDirect;
+ int nInkWidth;
+ COLORREF rgbInk;
+ DWORD dwAppParam;
+ DWORD dwDictParam;
+ DWORD dwRecognizer;
+ UINT rgwReserved[cwRcReservedMax];
+ }
+ RC, FAR *LPRC;
+
+typedef HANDLE HPENDATA;
+
+typedef struct tagSYC
+ {
+ UINT wStrokeFirst;
+ UINT wPntFirst;
+ UINT wStrokeLast;
+ UINT wPntLast;
+ BOOL fLastSyc;
+ }
+ SYC, FAR *LPSYC;
+
+#define wPntAll (UINT)0xFFFF
+#define iSycNull (-1)
+
+typedef struct tagSYE
+ {
+ SYV syv;
+ LONG lRecogVal;
+ CL cl;
+ int iSyc;
+ }
+ SYE, FAR *LPSYE;
+
+#define MAXHOTSPOT 8
+
+typedef struct tagSYG
+ {
+ POINT rgpntHotSpots[MAXHOTSPOT];
+ int cHotSpot;
+ int nFirstBox;
+ LONG lRecogVal;
+ LPSYE lpsye;
+ int cSye;
+ LPSYC lpsyc;
+ int cSyc;
+ }
+ SYG, FAR *LPSYG;
+
+typedef int (CALLBACK *ENUMPROC)(LPSYV, int, VOID FAR *);
+
+typedef struct tagRCRESULT
+ {
+ SYG syg;
+ UINT wResultsType;
+ int cSyv;
+ LPSYV lpsyv;
+ HANDLE hSyv;
+ int nBaseLine;
+ int nMidLine;
+ HPENDATA hpendata;
+ RECT rectBoundInk;
+ POINT pntEnd;
+ LPRC lprc;
+ }
+ RCRESULT, FAR *LPRCRESULT;
+
+#define RCRT_DEFAULT 0x0000
+#define RCRT_UNIDENTIFIED 0x0001
+#define RCRT_GESTURE 0x0002
+#define RCRT_NOSYMBOLMATCH 0x0004
+#define RCRT_PRIVATE 0x4000
+#define RCRT_NORECOG 0x8000
+#define RCRT_ALREADYPROCESSED 0x0008
+#define RCRT_GESTURETRANSLATED 0x0010
+#define RCRT_GESTURETOKEYS 0x0020
+
+#define HKP_SETHOOK 0
+#define HKP_UNHOOK 0xFFFF
+#define HWR_RESULTS 0
+#define HWR_APPWIDE 1
+
+#define PEN_NOINKWIDTH 0
+#define LPDFNULL ((LPDF)NULL)
+
+#define RPA_DEFAULT 1
+
+/* GetGlobalRC return codes */
+#define GGRC_OK 0
+#define GGRC_DICTBUFTOOSMALL 1
+#define GGRC_PARAMERROR 2
+
+/* SetGlobalRC return code flags */
+#define SGRC_OK 0x0000
+#define SGRC_USER 0x0001
+#define SGRC_PARAMERROR 0x0002
+#define SGRC_RC 0x0004
+#define SGRC_RECOGNIZER 0x0008
+#define SGRC_DICTIONARY 0x0010
+#define SGRC_INIFILE 0x0020
+
+#define GetWEventRef() (LOWORD(GetMessageExtraInfo()))
+
+HREC WINAPI InstallRecognizer(LPSTR);
+VOID WINAPI UninstallRecognizer(HREC);
+UINT WINAPI GetGlobalRC(LPRC, LPSTR, LPSTR, int);
+UINT WINAPI SetGlobalRC(LPRC, LPSTR, LPSTR);
+VOID WINAPI RegisterPenApp(UINT, BOOL);
+UINT WINAPI IsPenAware(VOID);
+BOOL WINAPI SetRecogHook(UINT, UINT, HWND);
+VOID WINAPI InitRC(HWND, LPRC);
+REC WINAPI Recognize(LPRC);
+REC WINAPI RecognizeData(LPRC, HPENDATA);
+BOOL WINAPI TrainInk(LPRC, HPENDATA, LPSYV);
+BOOL WINAPI TrainContext(LPRCRESULT, LPSYE, int, LPSYC, int);
+REC WINAPI ProcessWriting(HWND, LPRC);
+BOOL WINAPI CorrectWriting(HWND, LPSTR, UINT, LPRC, DWORD, DWORD);
+VOID WINAPI EmulatePen(BOOL);
+int WINAPI GetSymbolMaxLength(LPSYG);
+int WINAPI GetSymbolCount(LPSYG);
+VOID WINAPI FirstSymbolFromGraph(LPSYG, LPSYV, int, int FAR *);
+UINT WINAPI EnumSymbols(LPSYG, WORD, ENUMPROC, LPVOID);
+
+/****** Miscellaneous Functions *********************************************/
+
+BOOL WINAPI TPtoDP(LPPOINT, int);
+BOOL WINAPI DPtoTP(LPPOINT, int);
+VOID WINAPI BoundingRectFromPoints(LPPOINT, int, LPRECT);
+BOOL WINAPI SymbolToCharacter(LPSYV, int, LPSTR, LPINT);
+int WINAPI CharacterToSymbol(LPSTR, int, LPSYV);
+UINT WINAPI GetVersionPenWin(VOID);
+BOOL WINAPI ExecuteGesture(HWND, SYV, LPRCRESULT);
+
+/****** RC Options and Flags ***********************************************/
+
+#define ALC_ALL 0x000043FFL
+#define ALC_DEFAULT 0x00000000L
+#define ALC_LCALPHA 0x00000001L
+#define ALC_UCALPHA 0x00000002L
+#define ALC_ALPHA 0x00000003L
+#define ALC_NUMERIC 0x00000004L
+#define ALC_ALPHANUMERIC 0x00000007L
+#define ALC_PUNC 0x00000008L
+#define ALC_MATH 0x00000010L
+#define ALC_MONETARY 0x00000020L
+#define ALC_OTHER 0x00000040L
+#define ALC_WHITE 0x00000100L
+#define ALC_NONPRINT 0x00000200L
+#define ALC_GESTURE 0x00004000L
+#define ALC_USEBITMAP 0x00008000L
+#define ALC_DBCS 0x00000400L
+#define ALC_HIRAGANA 0x00010000L
+#define ALC_KATAKANA 0x00020000L
+#define ALC_KANJI 0x00040000L
+#define ALC_OEM 0x0FF80000L
+#define ALC_RESERVED 0xF0003800L
+#define ALC_NOPRIORITY 0x00000000L
+#define ALC_SYSMINIMUM (ALC_ALPHANUMERIC | ALC_PUNC | ALC_WHITE | ALC_GESTURE)
+
+#define MpAlcB(lprc,i) ((lprc)->rgbfAlc[((i) & 0xff) >> 3])
+#define MpIbf(i) ((BYTE)(1 << ((i) & 7)))
+
+#define SetAlcBitAnsi(lprc,i) do {MpAlcB(lprc,i) |= MpIbf(i);} while (0)
+#define ResetAlcBitAnsi(lprc,i) do {MpAlcB(lprc,i) &= ~MpIbf(i);} while (0)
+#define IsAlcBitAnsi(lprc, i) ((MpAlcB(lprc,i) & MpIbf(i)) != 0)
+
+#define RCD_DEFAULT 0
+#define RCD_LR 1
+#define RCD_RL 2
+#define RCD_TB 3
+#define RCD_BT 4
+
+#define RCO_NOPOINTEREVENT 0x00000001L
+#define RCO_SAVEALLDATA 0x00000002L
+#define RCO_SAVEHPENDATA 0x00000004L
+#define RCO_NOFLASHUNKNOWN 0x00000008L
+#define RCO_TABLETCOORD 0x00000010L
+#define RCO_NOSPACEBREAK 0x00000020L
+#define RCO_NOHIDECURSOR 0x00000040L
+#define RCO_NOHOOK 0x00000080L
+#define RCO_BOXED 0x00000100L
+#define RCO_SUGGEST 0x00000200L
+#define RCO_DISABLEGESMAP 0x00000400L
+#define RCO_NOFLASHCURSOR 0x00000800L
+#define RCO_COLDRECOG 0x00008000L
+
+#define RCP_LEFTHAND 0x0001
+#define RCP_MAPCHAR 0x0004
+
+#define RCOR_NORMAL 1
+#define RCOR_RIGHT 2
+#define RCOR_UPSIDEDOWN 3
+#define RCOR_LEFT 4
+
+#define RRM_STROKE 0
+#define RRM_SYMBOL 1
+#define RRM_WORD 2
+#define RRM_NEWLINE 3
+#define RRM_COMPLETE 16
+
+#define RCIP_ALLANSICHAR 0x0001
+#define RCIP_MASK 0x0001
+
+#define CWR_STRIPCR 0x00000001L
+#define CWR_STRIPLF 0x00000002L
+#define CWR_STRIPTAB 0x00000004L
+#define CWR_SINGLELINEEDIT 0x00000007L
+#define CWR_TITLE 0x00000010L
+#define CWR_KKCONVERT 0x00000020L
+
+#define MAP_GESTOGES (RCRT_GESTURE|RCRT_GESTURETRANSLATED)
+#define MAP_GESTOVKEYS (RCRT_GESTURETOKEYS|RCRT_ALREADYPROCESSED)
+
+#define IsGestureToGesture(lprcresult) (((lprcresult)->wResultstype & MAP_GESTOGES \
+ ) == MAP_GESTOGES)
+
+#define IsGestureToVkeys(lprcresult) (((lprcresult)->wResultstype & MAP_GESTOVKEYS \
+ ) == MAP_GESTOVKEYS)
+
+#define SetAlreadyProcessed(lprcresult) ((lprcresult)->wResultsType = ((lprcresult)->wResultsType \
+ & ~RCRT_GESTURETOKEYS) | RCRT_ALREADYPROCESSED)
+
+/****** Pen Data Type *******************************************************/
+
+typedef struct tagPENDATAHEADER
+ {
+ UINT wVersion;
+ UINT cbSizeUsed;
+ UINT cStrokes;
+ UINT cPnt;
+ UINT cPntStrokeMax;
+ RECT rectBound;
+ UINT wPndts;
+ int nInkWidth;
+ DWORD rgbInk;
+ }
+ PENDATAHEADER, FAR *LPPENDATAHEADER, FAR *LPPENDATA;
+
+#define PDTS_LOMETRIC 0x0000
+#define PDTS_HIMETRIC 0x0001
+#define PDTS_HIENGLISH 0x0002
+#define PDTS_SCALEMAX 0x0003
+#define PDTS_DISPLAY 0x0003
+#define PDTS_ARBITRARY 0x0004
+#define PDTS_SCALEMASK 0x000F
+#define PDTS_STANDARDSCALE PDTS_HIENGLISH
+
+#define PDTS_NOPENINFO 0x0100
+#define PDTS_NOUPPOINTS 0x0200
+#define PDTS_NOOEMDATA 0x0400
+#define PDTS_NOCOLINEAR 0x0800
+#define PDTS_COMPRESSED 0x8000
+#define PDTS_COMPRESSMETHOD 0x00F0
+#define PDTS_COMPRESS2NDDERIV 0x0010
+
+#define PDTT_DEFAULT 0x0000
+#define PDTT_PENINFO PDTS_NOPENINFO
+#define PDTT_UPPOINTS PDTS_NOUPPOINTS
+#define PDTT_OEMDATA PDTS_NOOEMDATA
+#define PDTT_COLINEAR PDTS_NOCOLINEAR
+#define PDTT_COMPRESS PDTS_COMPRESSED
+#define PDTT_DECOMPRESS 0x4000
+#define PDTT_ALL (PDTT_PENINFO|PDTT_UPPOINTS|PDTT_OEMDATA|PDTT_COLINEAR)
+
+#define DestroyPenData(hpendata) (GlobalFree(hpendata)==NULL)
+#define EndEnumStrokes(hpendata) GlobalUnlock(hpendata)
+
+BOOL WINAPI IsPenEvent(UINT, LONG);
+BOOL WINAPI GetPenAsyncState(UINT);
+
+BOOL WINAPI GetPenDataInfo(HPENDATA, LPPENDATAHEADER, LPPENINFO, DWORD);
+BOOL WINAPI GetPenDataStroke(LPPENDATA, UINT, LPPOINT FAR *, LPVOID FAR *, LPSTROKEINFO );
+BOOL WINAPI GetPointsFromPenData(HPENDATA, UINT, UINT, UINT, LPPOINT);
+VOID WINAPI DrawPenData(HDC, LPRECT, HPENDATA);
+BOOL WINAPI MetricScalePenData(HPENDATA, UINT);
+BOOL WINAPI ResizePenData(HPENDATA, LPRECT);
+BOOL WINAPI OffsetPenData(HPENDATA, int, int);
+BOOL WINAPI RedisplayPenData(HDC, HPENDATA, LPPOINT, LPPOINT, int, DWORD);
+HPENDATA WINAPI CompactPenData(HPENDATA, UINT );
+HPENDATA WINAPI DuplicatePenData(HPENDATA, UINT);
+HPENDATA WINAPI CreatePenData(LPPENINFO, int, UINT, UINT);
+HPENDATA WINAPI AddPointsPenData(HPENDATA, LPPOINT, LPVOID, LPSTROKEINFO);
+LPPENDATA WINAPI BeginEnumStrokes(HPENDATA );
+
+/****** New Windows Messages ************************************************/
+
+#define WM_RCRESULT (WM_PENWINFIRST+1)
+#define WM_HOOKRCRESULT (WM_PENWINFIRST+2)
+#define WM_GLOBALRCCHANGE (WM_PENWINFIRST+3)
+#define WM_SKB (WM_PENWINFIRST+4)
+#define WM_HEDITCTL (WM_PENWINFIRST+5)
+
+/****** Dictionary **********************************************************/
+
+#define cbDictPathMax 255
+#define DIRQ_QUERY 1
+#define DIRQ_DESCRIPTION 2
+#define DIRQ_CONFIGURE 3
+#define DIRQ_OPEN 4
+#define DIRQ_CLOSE 5
+#define DIRQ_SETWORDLISTS 6
+#define DIRQ_STRING 7
+#define DIRQ_SUGGEST 8
+#define DIRQ_ADD 9
+#define DIRQ_DELETE 10
+#define DIRQ_FLUSH 11
+#define DIRQ_RCCHANGE 12
+#define DIRQ_SYMBOLGRAPH 13
+#define DIRQ_INIT 14
+#define DIRQ_CLEANUP 15
+#define DIRQ_COPYRIGHT 16
+
+
+#define DIRQ_USER 4096
+
+BOOL WINAPI DictionarySearch(LPRC, LPSYE, int, LPSYV, int);
+
+/****** Handwriting Edit Control ********************************************/
+
+#define HE_GETRC 3
+#define HE_SETRC 4
+#define HE_GETINFLATE 5
+#define HE_SETINFLATE 6
+#define HE_GETUNDERLINE 7
+#define HE_SETUNDERLINE 8
+#define HE_GETINKHANDLE 9
+#define HE_SETINKMODE 10
+#define HE_STOPINKMODE 11
+#define HE_GETRCRESULTCODE 12
+#define HE_DEFAULTFONT 13
+#define HE_CHARPOSITION 14
+#define HE_CHAROFFSET 15
+
+#define HE_GETRCRESULT 22
+
+#define HE_KKCONVERT 30
+#define HE_GETKKCONVERT 31
+#define HE_CANCELKKCONVERT 32
+#define HE_FIXKKCONVERT 33
+
+#define HEKK_DEFAULT 0
+#define HEKK_CONVERT 1
+#define HEKK_CANDIDATE 2
+
+#define HEP_NORECOG 0
+#define HEP_RECOG 1
+#define HEP_WAITFORTAP 2
+
+#define HN_ENDREC 4
+#define HN_DELAYEDRECOGFAIL 5
+
+#define HN_RCRESULT 20
+
+#define HN_ENDKKCONVERT 30
+
+typedef struct tagRECTOFS
+ {
+ int dLeft;
+ int dTop;
+ int dRight;
+ int dBottom;
+ }
+ RECTOFS, FAR *LPRECTOFS;
+
+/****** Boxed Edit Control **************************************************/
+
+typedef struct tagBOXLAYOUT
+ {
+ int cyCusp;
+ int cyEndCusp;
+ UINT style;
+ DWORD rgbText;
+ DWORD rgbBox;
+ DWORD rgbSelect;
+ }
+ BOXLAYOUT, FAR *LPBOXLAYOUT;
+
+#define BXS_NONE 0U
+#define BXS_RECT 1U
+#define BXS_ENDTEXTMARK 2U
+#define BXS_MASK 3U
+
+#define HE_GETBOXLAYOUT 20
+#define HE_SETBOXLAYOUT 21
+
+#define BXD_CELLWIDTH 12
+#define BXD_CELLHEIGHT 16
+#define BXD_BASEHEIGHT 13
+#define BXD_BASEHORZ 0
+#define BXD_CUSPHEIGHT 2
+#define BXD_ENDCUSPHEIGHT 4
+
+/****** Screen Keyboard *****************************************************/
+
+typedef struct tagSKBINFO
+ {
+ HWND hwnd;
+ UINT nPad;
+ BOOL fVisible;
+ BOOL fMinimized;
+ RECT rect;
+ DWORD dwReserved;
+ }
+ SKBINFO, FAR *LPSKBINFO;
+
+#define SKB_QUERY 0x0000
+#define SKB_SHOW 0x0001
+#define SKB_HIDE 0x0002
+#define SKB_CENTER 0x0010
+#define SKB_MOVE 0x0020
+#define SKB_MINIMIZE 0x0040
+#define SKB_FULL 0x0100
+#define SKB_BASIC 0x0200
+#define SKB_NUMPAD 0x0400
+
+#define OBM_SKBBTNUP 32767
+#define OBM_SKBBTNDOWN 32766
+#define OBM_SKBBTNDISABLED 32765
+
+#define SKN_CHANGED 1
+
+#define SKN_POSCHANGED 1
+#define SKN_PADCHANGED 2
+#define SKN_MINCHANGED 4
+#define SKN_VISCHANGED 8
+#define SKN_TERMINATED 0xffff
+
+BOOL WINAPI ShowKeyboard(HWND, UINT, LPPOINT, LPSKBINFO);
+
+/****** New ComboBox Notifications *****************************************/
+
+#define CBN_ENDREC 16
+#define CBN_DELAYEDRECOGFAIL 17
+#define CBN_RCRESULT 18
+
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#ifndef RC_INVOKED
+#pragma pack()
+#endif /* RC_INVOKED */
+
+#endif /* #define _INC_PENWIN */
diff --git a/private/mvdm/wow16/inc/prd.inc b/private/mvdm/wow16/inc/prd.inc
new file mode 100644
index 000000000..c85c5c385
--- /dev/null
+++ b/private/mvdm/wow16/inc/prd.inc
@@ -0,0 +1,69 @@
+NAME_LEN equ 32
+BLOCK_SIZE equ 512
+DEV_PRD equ 8888h
+DEV_PORT equ 8888h
+DEV_LAND equ 8889h
+
+HSIZE equ 8d ;HorzSize
+VSIZE equ 11d ;VertSize
+VSIZE_LEGAL equ 14d ;VertSize
+
+MM_HSIZE equ 203 ;Horizontal size in millimeter
+MM_HSIZE0 equ 2032
+MM_HSIZE00 equ 20320
+MM_VSIZE equ 279 ;Vertical size in millimeter
+MM_VSIZE0 equ 2794
+MM_VSIZE00 equ 27940
+MM_VSIZE_LEGAL equ 356 ;Vertical size in millimeter
+MM_VSIZE0_LEGAL equ 3556
+MM_VSIZE00_LEGAL equ 35560
+
+EnglishLo1 equ 800 ;HorzSize * 1000 scaled (/254)
+EnglishLo2 equ 1100 ;VertSize * 1000 scaled (/254)
+
+EnglishHi1 equ 8000 ;HorzSize * 10000 scaled (/254)
+EnglishHi2 equ 11000 ;VertSize * 10000 scaled (/254)
+EnglishHi3 equ EnglishLo3
+EnglishHi4 equ EnglishLo4
+
+Twips1 equ 11520 ;HorzSize * 14400 scaled (/254)
+Twips2 equ 15840 ;VertSize * 14400 scaled (/254)
+Twips3 equ EnglishLo3
+Twips4 equ EnglishLo4
+
+EnglishLo2_LEGAL equ 1400
+EnglishHi2_LEGAL equ 14000 ;VertSize * 10000 scaled (/254)
+EnglishHi4_LEGAL equ EnglishLo4_LEGAL
+
+Twips2_LEGAL equ 20160
+Twips4_LEGAL equ EnglishLo4_LEGAL
+
+yMinorDist = Hypotenuse-xMajorDist
+xMinorDist = Hypotenuse-yMajorDist
+
+MaxStyleErr = Hypotenuse*2 ;Max error before updating
+ ;rotating bit mask
+
+DEVICE struc
+ deType dw 0 ;
+ deMode dw 0 ;
+ deJob dw 0 ;job number
+ deWheel dw 0 ;font wheel number
+ dePtr dw 0 ;spooler buffer pointer
+ deYPQ dw 0
+ deXPQ dw 0
+ deCurx dw 0
+ deCury dw 0
+ deXcurwidth dw 0
+ deYcurwidth dw 0
+ deDoc dw 0 ;job spooled as a document or by the page
+ deHeap dw 0
+ deHPsize dw 0
+ deHPptr dw 0
+ dePhySize dd 0
+DEVICE ends
+
+BUFFER struc
+ dePort db NAME_LEN dup (?); port name
+ deSpool db BLOCK_SIZE dup (?)
+BUFFER ends
diff --git a/private/mvdm/wow16/inc/print.h b/private/mvdm/wow16/inc/print.h
new file mode 100644
index 000000000..263dff97d
--- /dev/null
+++ b/private/mvdm/wow16/inc/print.h
@@ -0,0 +1,302 @@
+/*****************************************************************************\
+* *
+* print.h - Printing helper functions, types, and definitions *
+* *
+* Copyright (c) 1985-1992. Microsoft Corp. All rights reserved.*
+* *
+*******************************************************************************
+*
+* PRINTDRIVER - For inclusion with a printer driver
+* NOPQ - Prevent inclusion of priority queue APIs
+*
+\*****************************************************************************/
+
+#ifndef _INC_PRINT
+#define _INC_PRINT
+
+#ifndef RC_INVOKED
+#pragma pack(1) /* Assume byte packing throughout */
+#endif /* !RC_INVOKED */
+
+#ifdef __cplusplus
+extern "C" { /* Assume C declarations for C++ */
+#endif /* __cplusplus */
+
+#ifdef PRINTDRIVER
+
+#define NORASTEROPS
+#define NOTEXTMETRICS
+#define NOGDICAPMASKS
+#define NOGDIOBJ
+#define NOBITMAP
+#define NOSOUND
+#define NOTEXTMETRIC
+#define NOCOMM
+#define NOKANJI
+
+#include <windows.h>
+
+#undef NORASTEROPS
+#undef NOTEXTMETRICS
+#undef NOGDICAPMASKS
+#undef NOGDICAPMASKS
+#undef NOGDIOBJ
+#undef NOBITMAP
+#undef NOSOUND
+#undef NOTEXTMETRIC
+#undef NOCOMM
+#undef NOKANJI
+
+#define NOPTRC /* don't allow gdidefs.inc to redef these */
+#define PTTYPE POINT
+
+#define PQERROR (-1)
+
+#ifndef NOPQ
+
+DECLARE_HANDLE(HPQ);
+
+HPQ WINAPI CreatePQ(int);
+int WINAPI MinPQ(HPQ);
+int WINAPI ExtractPQ(HPQ);
+int WINAPI InsertPQ(HPQ, int, int);
+int WINAPI SizePQ(HPQ, int);
+void WINAPI DeletePQ(HPQ);
+#endif /* !NOPQ */
+
+/* Spool routines for use by printer drivers */
+
+DECLARE_HANDLE(HPJOB);
+
+HPJOB WINAPI OpenJob(LPSTR, LPSTR, HPJOB);
+int WINAPI StartSpoolPage(HPJOB);
+int WINAPI EndSpoolPage(HPJOB);
+int WINAPI WriteSpool(HPJOB, LPSTR, int);
+int WINAPI CloseJob(HPJOB);
+int WINAPI DeleteJob(HPJOB, int);
+int WINAPI WriteDialog(HPJOB, LPSTR, int);
+int WINAPI DeleteSpoolPage(HPJOB);
+
+#endif /* !PRINTDRIVER */
+
+typedef struct tagBANDINFOSTRUCT
+{
+ BOOL fGraphics;
+ BOOL fText;
+ RECT rcGraphics;
+} BANDINFOSTRUCT, FAR* LPBI;
+
+#define USA_COUNTRYCODE 1
+
+/*
+ * Printer driver initialization using ExtDeviceMode()
+ * and DeviceCapabilities().
+ * This replaces Drivinit.h
+ */
+
+/* size of a device name string */
+#define CCHDEVICENAME 32
+#define CCHPAPERNAME 64
+
+/* current version of specification */
+#define DM_SPECVERSION 0x30A
+
+/* field selection bits */
+#define DM_ORIENTATION 0x0000001L
+#define DM_PAPERSIZE 0x0000002L
+#define DM_PAPERLENGTH 0x0000004L
+#define DM_PAPERWIDTH 0x0000008L
+#define DM_SCALE 0x0000010L
+#define DM_COPIES 0x0000100L
+#define DM_DEFAULTSOURCE 0x0000200L
+#define DM_PRINTQUALITY 0x0000400L
+#define DM_COLOR 0x0000800L
+#define DM_DUPLEX 0x0001000L
+#define DM_YRESOLUTION 0x0002000L
+#define DM_TTOPTION 0x0004000L
+
+/* orientation selections */
+#define DMORIENT_PORTRAIT 1
+#define DMORIENT_LANDSCAPE 2
+
+/* paper selections */
+/* Warning: The PostScript driver mistakingly uses DMPAPER_ values between
+ * 50 and 56. Don't use this range when defining new paper sizes.
+ */
+#define DMPAPER_FIRST DMPAPER_LETTER
+#define DMPAPER_LETTER 1 /* Letter 8 1/2 x 11 in */
+#define DMPAPER_LETTERSMALL 2 /* Letter Small 8 1/2 x 11 in */
+#define DMPAPER_TABLOID 3 /* Tabloid 11 x 17 in */
+#define DMPAPER_LEDGER 4 /* Ledger 17 x 11 in */
+#define DMPAPER_LEGAL 5 /* Legal 8 1/2 x 14 in */
+#define DMPAPER_STATEMENT 6 /* Statement 5 1/2 x 8 1/2 in */
+#define DMPAPER_EXECUTIVE 7 /* Executive 7 1/4 x 10 1/2 in */
+#define DMPAPER_A3 8 /* A3 297 x 420 mm */
+#define DMPAPER_A4 9 /* A4 210 x 297 mm */
+#define DMPAPER_A4SMALL 10 /* A4 Small 210 x 297 mm */
+#define DMPAPER_A5 11 /* A5 148 x 210 mm */
+#define DMPAPER_B4 12 /* B4 250 x 354 */
+#define DMPAPER_B5 13 /* B5 182 x 257 mm */
+#define DMPAPER_FOLIO 14 /* Folio 8 1/2 x 13 in */
+#define DMPAPER_QUARTO 15 /* Quarto 215 x 275 mm */
+#define DMPAPER_10X14 16 /* 10x14 in */
+#define DMPAPER_11X17 17 /* 11x17 in */
+#define DMPAPER_NOTE 18 /* Note 8 1/2 x 11 in */
+#define DMPAPER_ENV_9 19 /* Envelope #9 3 7/8 x 8 7/8 */
+#define DMPAPER_ENV_10 20 /* Envelope #10 4 1/8 x 9 1/2 */
+#define DMPAPER_ENV_11 21 /* Envelope #11 4 1/2 x 10 3/8 */
+#define DMPAPER_ENV_12 22 /* Envelope #12 4 \276 x 11 */
+#define DMPAPER_ENV_14 23 /* Envelope #14 5 x 11 1/2 */
+#define DMPAPER_CSHEET 24 /* C size sheet */
+#define DMPAPER_DSHEET 25 /* D size sheet */
+#define DMPAPER_ESHEET 26 /* E size sheet */
+#define DMPAPER_ENV_DL 27 /* Envelope DL 110 x 220mm */
+#define DMPAPER_ENV_C5 28 /* Envelope C5 162 x 229 mm */
+#define DMPAPER_ENV_C3 29 /* Envelope C3 324 x 458 mm */
+#define DMPAPER_ENV_C4 30 /* Envelope C4 229 x 324 mm */
+#define DMPAPER_ENV_C6 31 /* Envelope C6 114 x 162 mm */
+#define DMPAPER_ENV_C65 32 /* Envelope C65 114 x 229 mm */
+#define DMPAPER_ENV_B4 33 /* Envelope B4 250 x 353 mm */
+#define DMPAPER_ENV_B5 34 /* Envelope B5 176 x 250 mm */
+#define DMPAPER_ENV_B6 35 /* Envelope B6 176 x 125 mm */
+#define DMPAPER_ENV_ITALY 36 /* Envelope 110 x 230 mm */
+#define DMPAPER_ENV_MONARCH 37 /* Envelope Monarch 3.875 x 7.5 in */
+#define DMPAPER_ENV_PERSONAL 38 /* 6 3/4 Envelope 3 5/8 x 6 1/2 in */
+#define DMPAPER_FANFOLD_US 39 /* US Std Fanfold 14 7/8 x 11 in */
+#define DMPAPER_FANFOLD_STD_GERMAN 40 /* German Std Fanfold 8 1/2 x 12 in */
+#define DMPAPER_FANFOLD_LGL_GERMAN 41 /* German Legal Fanfold 8 1/2 x 13 in */
+
+#define DMPAPER_LAST DMPAPER_FANFOLD_LGL_GERMAN
+
+#define DMPAPER_USER 256
+
+/* bin selections */
+#define DMBIN_FIRST DMBIN_UPPER
+#define DMBIN_UPPER 1
+#define DMBIN_ONLYONE 1
+#define DMBIN_LOWER 2
+#define DMBIN_MIDDLE 3
+#define DMBIN_MANUAL 4
+#define DMBIN_ENVELOPE 5
+#define DMBIN_ENVMANUAL 6
+#define DMBIN_AUTO 7
+#define DMBIN_TRACTOR 8
+#define DMBIN_SMALLFMT 9
+#define DMBIN_LARGEFMT 10
+#define DMBIN_LARGECAPACITY 11
+#define DMBIN_CASSETTE 14
+#define DMBIN_LAST DMBIN_CASSETTE
+
+#define DMBIN_USER 256 /* device specific bins start here */
+
+/* print qualities */
+#define DMRES_DRAFT (-1)
+#define DMRES_LOW (-2)
+#define DMRES_MEDIUM (-3)
+#define DMRES_HIGH (-4)
+
+/* color enable/disable for color printers */
+#define DMCOLOR_MONOCHROME 1
+#define DMCOLOR_COLOR 2
+
+/* duplex enable */
+#define DMDUP_SIMPLEX 1
+#define DMDUP_VERTICAL 2
+#define DMDUP_HORIZONTAL 3
+
+/* TrueType options */
+#define DMTT_BITMAP 1 /* print TT fonts as graphics */
+#define DMTT_DOWNLOAD 2 /* download TT fonts as soft fonts */
+#define DMTT_SUBDEV 3 /* substitute device fonts for TT fonts */
+
+typedef struct tagDEVMODE
+{
+ char dmDeviceName[CCHDEVICENAME];
+ UINT dmSpecVersion;
+ UINT dmDriverVersion;
+ UINT dmSize;
+ UINT dmDriverExtra;
+ DWORD dmFields;
+ int dmOrientation;
+ int dmPaperSize;
+ int dmPaperLength;
+ int dmPaperWidth;
+ int dmScale;
+ int dmCopies;
+ int dmDefaultSource;
+ int dmPrintQuality;
+ int dmColor;
+ int dmDuplex;
+ int dmYResolution;
+ int dmTTOption;
+} DEVMODE;
+
+typedef DEVMODE* PDEVMODE, NEAR* NPDEVMODE, FAR* LPDEVMODE;
+
+/* mode selections for the device mode function */
+#define DM_UPDATE 1
+#define DM_COPY 2
+#define DM_PROMPT 4
+#define DM_MODIFY 8
+
+#define DM_IN_BUFFER DM_MODIFY
+#define DM_IN_PROMPT DM_PROMPT
+#define DM_OUT_BUFFER DM_COPY
+#define DM_OUT_DEFAULT DM_UPDATE
+
+/* device capabilities indices */
+#define DC_FIELDS 1
+#define DC_PAPERS 2
+#define DC_PAPERSIZE 3
+#define DC_MINEXTENT 4
+#define DC_MAXEXTENT 5
+#define DC_BINS 6
+#define DC_DUPLEX 7
+#define DC_SIZE 8
+#define DC_EXTRA 9
+#define DC_VERSION 10
+#define DC_DRIVER 11
+#define DC_BINNAMES 12
+#define DC_ENUMRESOLUTIONS 13
+#define DC_FILEDEPENDENCIES 14
+#define DC_TRUETYPE 15
+#define DC_PAPERNAMES 16
+#define DC_ORIENTATION 17
+#define DC_COPIES 18
+
+/* bit fields of the return value (DWORD) for DC_TRUETYPE */
+#define DCTT_BITMAP 0x0000001L
+#define DCTT_DOWNLOAD 0x0000002L
+#define DCTT_SUBDEV 0x0000004L
+
+/* export ordinal definitions */
+#define PROC_EXTDEVICEMODE MAKEINTRESOURCE(90)
+#define PROC_DEVICECAPABILITIES MAKEINTRESOURCE(91)
+#define PROC_OLDDEVICEMODE MAKEINTRESOURCE(13)
+
+/* define types of pointers to ExtDeviceMode() and DeviceCapabilities()
+ * functions
+ */
+typedef UINT (CALLBACK* LPFNDEVMODE)(HWND, HMODULE, DEVMODE FAR*,
+ LPSTR, LPSTR, DEVMODE FAR*, LPSTR, UINT);
+
+typedef DWORD (CALLBACK* LPFNDEVCAPS)(LPSTR, LPSTR, UINT, LPSTR, DEVMODE FAR*);
+
+HDC WINAPI ResetDC(HDC, const DEVMODE FAR*);
+
+/* this structure is used by the GETSETSCREENPARAMS escape */
+typedef struct tagSCREENPARAMS
+{
+ int angle;
+ int frequency;
+} SCREENPARAMS;
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#ifndef RC_INVOKED
+#pragma pack()
+#endif /* !RC_INVOKED */
+
+#endif /* !_INC_PRINT */
diff --git a/private/mvdm/wow16/inc/printer.h b/private/mvdm/wow16/inc/printer.h
new file mode 100644
index 000000000..8a34f5065
--- /dev/null
+++ b/private/mvdm/wow16/inc/printer.h
@@ -0,0 +1,258 @@
+/* printer.h
+ contains the definitions of the functions in _SORT,
+ _BRUTE, _SPOOL.
+*/
+
+#ifdef OLDWAY
+
+#define PASCAL
+#define LONG long
+#define NULL 0
+#define TRUE 1
+#define FALSE 0
+#define ERROR (-1)
+#define FAR far
+#define NEAR near
+#define VOID void
+#define REGISTER register
+
+
+/* file IO flags */
+
+#define O_RDONLY 0x0000
+#define O_WRONLY 0x0001
+#define O_RDWR 0x0002
+#define O_APPEND 0x0008 /* writes done at eof */
+
+#define OF_REOPEN 0x8000
+#define OF_EXIST 0x4000
+#define OF_PROMPT 0x2000
+#define OF_CREATE 0x1000
+#define OF_CANCEL 0x0800
+#define OF_VERIFY 0x0400
+#define OF_DELETE 0x0200
+
+#define O_TEXT 0x4000 /* file mode is text (translated) */
+#define O_BINARY 0x8000 /* file mode is binary (untranslated) */
+
+#define SP_CREATE O_WRONLY | OF_CREATE
+#define SP_OPEN O_RDONLY | OF_EXIST
+#define SP_REOPEN O_RDWR | OF_REOPEN | OF_PROMPT | OF_CANCEL
+
+typedef int (FAR * FARPROC)();
+typedef int (NEAR * NEARPROC)();
+typedef unsigned LONG DWORD;
+typedef DWORD (FAR * DWORDFARPROC)();
+typedef unsigned short int WORD;
+typedef unsigned char BYTE;
+typedef WORD HANDLE;
+typedef HANDLE HWND;
+typedef HANDLE HDC;
+typedef WORD ATOM;
+typedef int BOOLEAN;
+typedef char *NEARP;
+typedef char FAR *FARP;
+typedef HANDLE GLOBALHANDLE;
+typedef HANDLE LOCALHANDLE;
+typedef unsigned char *PSTR;
+typedef unsigned char far *LPSTR;
+typedef short BOOL;
+typedef long FAR *LPLONG;
+
+#define MAX(a,b) ((a)>(b)?(a):(b))
+#define MIN(a,b) ((a)<=(b)?(a):(b))
+#define ABS(x) (((x) >= 0) ? (x) : (-(x)))
+#define LWORD(x) ((short)((x)&0xFFFF))
+#define HWORD(y) ((short)(((y)>>16)&0xFFFF))
+#define MAKELONG(h,l) ((long)(((WORD)l)|(((long)h)<<16)))
+#define LOBYTE(w) ((BYTE)w)
+#define HIBYTE(w) (((WORD)w >> 8) & 0xff)
+#define MAKEPOINT(l) (*((POINT *)&l))
+
+/* Interface to global memory manager */
+
+#define GMEM_SHAREALL 0x2000
+#define GMEM_FIXED 0x00
+#define GMEM_MOVEABLE 0x02
+#define GMEM_ZEROINIT 0x40
+#define GMEM_DISCARDABLE 0x0F00
+#define GHND (GMEM_MOVEABLE | GMEM_ZEROINIT)
+#define GPTR (GMEM_FIXED | GMEM_ZEROINIT)
+
+/* Interface to local memory manager */
+
+#define LMEM_FIXED 0x0000
+#define LMEM_MOVEABLE 0x0002
+#define LMEM_NOCOMPACT 0x0010
+#define LMEM_NODISCARD 0x0020
+#define LMEM_ZEROINIT 0x0040
+#define LMEM_MODIFY 0x0080
+#define LMEM_DISCARDABLE 0x0F00
+
+/* Exported procedures for KERNEL module */
+
+/* Spooler escapes */
+#define SE_JOBTIME 0x0001 /* time out for printer */
+#define SE_SETCALLBACK 0x0002 /* set callback function */
+#define SE_MARKCALLBACK 0x0003 /* write mark for call back */
+
+
+/* Exported procedures for KERNEL module */
+VOID far PASCAL FatalExit( int );
+
+HANDLE far PASCAL LoadModule(LPSTR, LPSTR);
+VOID far PASCAL FreeModule(HANDLE);
+HANDLE far PASCAL GetModuleHandle(FARP);
+FARPROC far PASCAL GetProcAddress(HANDLE, FARP);
+
+HANDLE far PASCAL GlobalAlloc( WORD, DWORD );
+HANDLE far PASCAL GlobalReAlloc( HANDLE, DWORD, WORD );
+HANDLE far PASCAL GlobalFree( HANDLE );
+FARP far PASCAL GlobalLock( HANDLE );
+BOOL far PASCAL GlobalUnlock( HANDLE );
+LONG far PASCAL GlobalSize( HANDLE );
+LONG far PASCAL GlobalFlags( HANDLE );
+
+/* task scheduler routines */
+
+extern void far PASCAL Yield(void);
+extern BOOL far PASCAL WaitEvent(HANDLE);
+extern BOOL far PASCAL PostEvent(HANDLE);
+extern HANDLE far PASCAL GetCurrentTask(void);
+
+short FAR PASCAL GetProfileString(LPSTR, LPSTR, LPSTR, LPSTR, short);
+BOOL FAR PASCAL WriteProfileString( LPSTR, LPSTR, LPSTR );
+
+/* Interface to the resource manager */
+
+HANDLE FAR PASCAL FindResource( HANDLE, LPSTR, LPSTR );
+HANDLE FAR PASCAL LoadResource( HANDLE, HANDLE );
+BOOL FAR PASCAL FreeResource( HANDLE );
+
+char FAR * FAR PASCAL LockResource( HANDLE );
+
+FARPROC FAR PASCAL SetResourceHandler( HANDLE, LPSTR, FARPROC );
+HANDLE FAR PASCAL AllocResource( HANDLE, HANDLE, DWORD );
+WORD FAR PASCAL SizeofResource( HANDLE, HANDLE );
+int FAR PASCAL AccessResource( HANDLE, HANDLE );
+
+
+#define WM_INITDIALOG 0x0110
+#define WM_COMMAND 0x0111
+#define WM_ENDDIALOG 0x0088
+#define WM_SPOOLERSTATUS 0x002a /* ;Internal */
+#define PR_JOBSTATUS 0x0000
+
+typedef struct
+{
+ BYTE cBytes; /* length of structure */
+ BYTE fFixedDisk; /* non-zero if file located on non- */
+ /* removeable media */
+ WORD nErrCode; /* DOS error code if OpenFile fails */
+ BYTE reserved[ 4 ];
+ BYTE szPathName[ 128 ];
+} OFSTRUCT;
+
+typedef OFSTRUCT FAR * LPOFSTRUCT;
+
+int FAR PASCAL OpenFile( LPSTR, LPOFSTRUCT, WORD );
+BYTE FAR PASCAL GetTempDrive( BYTE );
+int far PASCAL OpenPathname( LPSTR, int );
+int far PASCAL DeletePathname( LPSTR );
+int far PASCAL _lopen( LPSTR, int );
+void far PASCAL _lclose( int );
+int far PASCAL _lcreat( LPSTR, int );
+BOOL far PASCAL _ldelete( LPSTR );
+WORD far PASCAL _ldup( int );
+LONG far PASCAL _llseek( int, long, int );
+WORD far PASCAL _lread( int, LPSTR, int );
+WORD far PASCAL _lwrite( int, LPSTR, int );
+
+int far PASCAL lstrcmp( LPSTR, LPSTR );
+LPSTR far PASCAL lstrcpy( LPSTR, LPSTR );
+LPSTR far PASCAL lstrcat( LPSTR, LPSTR );
+int far PASCAL lstrlen( LPSTR );
+LPSTR far PASCAL lstrbscan( LPSTR, LPSTR );
+LPSTR far PASCAL lstrbskip( LPSTR, LPSTR );
+
+/* new Escape support */
+#define GETEXTENDEDTEXTMETRICS 256
+#define GETEXTENTTABLE 257
+#define EXTTEXTOUT 512
+
+#else
+
+#define NOATOM
+#define NOGDI
+#define NOGDICAPMASKS
+#define NOMETAFILE
+#define NOMSG
+#define NORASTEROPS
+#define NOSCROLL
+#define NOSOUND
+#define NOSYSMETRICS
+#define NOTEXTMETRIC
+#define NOWH
+#define NOCOMM
+#define NOKANJI
+
+#include "Windows.h"
+#include "winexp.h"
+
+#undef NOATOM
+#undef NOGDI
+#undef NOGDICAPMASKS
+#undef NOMETAFILE
+#undef NOMSG
+#undef NORASTEROPS
+#undef NOSCROLL
+#undef NOSOUND
+#undef NOSYSMETRICS
+#undef NOTEXTMETRIC
+#undef NOWH
+#undef NOCOMM
+#undef NOKANJI
+
+#define NOPTRC /* don't allow gdidefs.inc to redef these */
+#define PTTYPE POINT
+
+#endif /* OLDWAY */
+
+/* GDI internal routines */
+
+short FAR PASCAL SetEnvironment(LPSTR, LPSTR, WORD);
+short FAR PASCAL GetEnvironment(LPSTR, LPSTR, WORD);
+
+/* _SORT export routines */
+
+HANDLE FAR PASCAL CreatePQ(short);
+short FAR PASCAL MinPQ(HANDLE);
+short FAR PASCAL ExtractPQ(HANDLE);
+short FAR PASCAL InsertPQ(HANDLE, short, short);
+short FAR PASCAL SizePQ(HANDLE, short);
+void FAR PASCAL DeletePQ(HANDLE);
+
+/* _SPOOL export routines */
+
+HANDLE FAR PASCAL OpenJob(LPSTR, LPSTR, HANDLE);
+short FAR PASCAL StartSpoolPage(HANDLE);
+short FAR PASCAL EndSpoolPage(HANDLE);
+short FAR PASCAL WriteSpool(HANDLE, LPSTR, short);
+short FAR PASCAL CloseJob(HANDLE);
+short FAR PASCAL DeleteJob(HANDLE, short);
+short FAR PASCAL WriteDialog(HANDLE, LPSTR, short);
+short FAR PASCAL WriteMark(HANDLE, LPSTR, short);
+BOOL FAR PASCAL AddFileSpoolJob(LPSTR, LPSTR, BOOL, LPSTR);
+BOOL FAR PASCAL SpoolEscape(HANDLE, short, short, LPSTR, LPSTR);
+
+
+long FAR PASCAL QueryJob(HANDLE, short);
+short FAR PASCAL QueryAbort(HANDLE, short);
+
+/* _SPOOL constants for queryjob */
+#define SP_QUERYVALIDJOB 30
+#define SP_QUERYDISKAVAIL 0x1004
+
+#define USA_COUNTRYCODE 1
+
+#define PQERROR (-1)
diff --git a/private/mvdm/wow16/inc/rom.inc b/private/mvdm/wow16/inc/rom.inc
new file mode 100644
index 000000000..ee4cb8297
--- /dev/null
+++ b/private/mvdm/wow16/inc/rom.inc
@@ -0,0 +1,50 @@
+; ROM Windows specific include file
+
+;
+; INT 2F subfunction
+; if ROM installed, returns 0 in AX and RM segment of ROMTOC in
+; BX. Hooked by WIN.COM to pass ROMTOC to other components
+;
+ROMINSTALLCHECK equ 160Ch
+
+; ROM Table of Contents structure
+
+ROMTOC STRUC
+ROMSignature db 55h, 0AAh ; IBM standard ROM signature
+ROMLength db ? ; IBM length (/512)
+ROMEntryPoint db 5 dup (?) ; jmp near + retf + pad
+szID db 10 dup (?) ; ID string "ROMWINTOC\0"
+DOSX_CSIP dd ? ; DOSX initial CS:IP (seg:off)
+KRNL_CSIP dd ? ; Kernel initial CS:IP (sel:off)
+lmaROMLDT dd ? ; lma of ROM prototype LDT
+cROMsels dw ? ; # descriptors used in ROM proto LDT
+FirstROMsel dw ? ; first LDT selector in ROM proto LDT
+offSysDir dw ? ; offset to system directory string
+lmaHigh dd ? ; lma of high ROM
+lenHigh dd ? ; length in bytes of High ROM
+cModules dw ? ; # modules defined in ROM TOC
+cFiles dw ? ; # files defined in ROM TOC
+ModEntries db ? ; start of module entries
+
+; module entries follow at this point...
+; file entries start at ModEntries + cModules*(SIZE MODENT)
+
+ROMTOC ENDS
+
+
+; Module entry format in ROM TOC
+
+File_Name_Len = 13
+Module_Name_Len = 9
+
+MODENT STRUC
+ModNameStr db Module_Name_Len dup (?) ; Module name (null padded)
+FileNameStr db File_Name_Len dup (?) ; File name (null padded)
+lmaExeHdr dd ? ; lma of module EXE header
+MODENT ENDS
+
+FILENT STRUC
+fname db File_Name_Len dup(?) ; file name
+lma dd ? ; lma of start of file
+fsize dd ?
+FILENT ENDS
diff --git a/private/mvdm/wow16/inc/shellapi.h b/private/mvdm/wow16/inc/shellapi.h
new file mode 100644
index 000000000..4c5af9991
--- /dev/null
+++ b/private/mvdm/wow16/inc/shellapi.h
@@ -0,0 +1,99 @@
+/*****************************************************************************\
+* *
+* shellapi.h - SHELL.DLL functions, types, and definitions *
+* *
+* Copyright (c) 1992, Microsoft Corp. All rights reserved *
+* *
+\*****************************************************************************/
+
+#ifndef _INC_SHELLAPI
+#define _INC_SHELLAPI
+
+#ifndef RC_INVOKED
+#pragma pack(1) /* Assume byte packing throughout */
+#endif /* RC_INVOKED */
+
+#ifdef __cplusplus
+extern "C" { /* Assume C declarations for C++ */
+#endif /* __cplusplus */
+
+/* If included with Windows 3.0 windows.h: define 3.1-compatible types */
+
+#ifndef _INC_WINDOWS
+
+#define HDROP HANDLE
+#define WINAPI FAR PASCAL
+#define LPCSTR LPSTR
+#define UINT WORD
+
+#else
+
+DECLARE_HANDLE(HDROP);
+
+#endif
+
+/* return codes from Registration functions */
+#define ERROR_SUCCESS 0L
+#define ERROR_BADDB 1L
+#define ERROR_BADKEY 2L
+#define ERROR_CANTOPEN 3L
+#define ERROR_CANTREAD 4L
+#define ERROR_CANTWRITE 5L
+#define ERROR_OUTOFMEMORY 6L
+#define ERROR_INVALID_PARAMETER 7L
+#define ERROR_ACCESS_DENIED 8L
+
+#define REG_SZ 1 /* string type */
+
+#define HKEY_CLASSES_ROOT 0x80000000
+
+typedef DWORD HKEY;
+typedef HKEY FAR* PHKEY;
+ /* ;Internal */
+typedef struct _dropfilestruct { /* ;Internal */
+ WORD pFiles; /* offset of file list*//* ;Internal */
+ POINT pt; /* drop point *//* ;Internal */
+ BOOL fNC; /* is it on NC area *//* ;Internal */
+} DROPFILESTRUCT, FAR* LPDROPFILESTRUCT; /* ;Internal */
+
+LONG WINAPI RegOpenKey(HKEY, LPCSTR, HKEY FAR*);
+LONG WINAPI RegCreateKey(HKEY, LPCSTR, HKEY FAR*);
+LONG WINAPI RegCloseKey(HKEY);
+LONG WINAPI RegDeleteKey(HKEY, LPCSTR);
+LONG WINAPI RegSetValue(HKEY, LPCSTR, DWORD, LPCSTR, DWORD);
+LONG WINAPI RegQueryValue(HKEY, LPCSTR, LPSTR, LONG FAR*);
+LONG WINAPI RegEnumKey(HKEY, DWORD, LPSTR, DWORD);
+
+UINT WINAPI DragQueryFile(HDROP, UINT, LPSTR, UINT);
+BOOL WINAPI DragQueryPoint(HDROP, POINT FAR*);
+void WINAPI DragFinish(HDROP);
+void WINAPI DragAcceptFiles(HWND, BOOL);
+
+HICON WINAPI ExtractIcon(HINSTANCE hInst, LPCSTR lpszExeFileName, UINT nIconIndex);
+
+/* error values for ShellExecute() beyond the regular WinExec() codes */
+#define SE_ERR_SHARE 26
+#define SE_ERR_ASSOCINCOMPLETE 27
+#define SE_ERR_DDETIMEOUT 28
+#define SE_ERR_DDEFAIL 29
+#define SE_ERR_DDEBUSY 30
+#define SE_ERR_NOASSOC 31
+
+HINSTANCE WINAPI ShellExecute(HWND hwnd, LPCSTR lpOperation, LPCSTR lpFile, LPCSTR lpParameters, LPCSTR lpDirectory, int iShowCmd);
+HINSTANCE WINAPI FindExecutable(LPCSTR lpFile, LPCSTR lpDirectory, LPSTR lpResult);
+
+int WINAPI ShellAbout(HWND hWnd, LPCSTR szApp, LPCSTR szOtherStuff, HICON hIcon); /* ;Internal */
+HICON WINAPI ExtractAssociatedIcon(HANDLE hInst, LPSTR lpIconPath, WORD FAR* lpiIcon); /* ;Internal */
+HICON WINAPI InternalExtractIcon(HANDLE hInst, LPCSTR lpszExeFileName, WORD nIconIndex, WORD nIcons); /* ;Internal */
+DWORD WINAPI DoEnvironmentSubst(LPSTR szString, WORD cbString); /* ;Internal */
+BOOL WINAPI RegisterShellHook(HWND, BOOL); /* ;Internal */
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#ifndef RC_INVOKED
+#pragma pack()
+#endif /* RC_INVOKED */
+
+#endif /* _INC_SHELLAPI */
diff --git a/private/mvdm/wow16/inc/spl_wnt.h b/private/mvdm/wow16/inc/spl_wnt.h
new file mode 100644
index 000000000..f227c97d7
--- /dev/null
+++ b/private/mvdm/wow16/inc/spl_wnt.h
@@ -0,0 +1,248 @@
+/*****************************************************************/
+/** Microsoft Windows for Workgroups **/
+/** Copyright (C) Microsoft Corp., 1991-1992 **/
+/*****************************************************************/
+
+#ifndef _spl_wnt_h_
+#define _spl_wnt_h_
+
+/*
+ * Print Manager Administration APIs
+ * for later inclusion into WINNET.H once they settle down
+ *
+ * JONN 4/19/91 Trimmed out unnecessary stuff
+ * JONN 5/3/91 Added type WNETERR
+ */
+
+
+/*
+ Codes for WNetPrintMgrSelNotify's "type" variable, indicating
+ what's selected: a queue, a job, or nothing.
+*/
+
+#define WNPMSEL_NOTHING 0
+#define WNPMSEL_QUEUE 1
+#define WNPMSEL_JOB 2
+
+#define PRIORITY 10 /* menu uses 10, 11, 12, 13 */
+#define ABOUT 24
+#define EXIT 25
+#define PRINT_LOG 28
+#define NETWORK 29
+#define HELP_NDEX 30
+#define HELP_MOUSE 31
+#define HELP_KEYBOARD 32
+#define HELP_HELP 33
+#define HELP_COMMANDS 34
+#define HELP_PROCEDURES 35
+
+#define SHOW_TIME 51
+#define SHOW_SIZE 52
+#define SHOW_DETAIL 53
+#define UPDATE 54
+#define SHOW_LOCAL 55
+#define SHOW_NET 56
+#define SHOW_QUEUE 57
+#define SHOW_OTHER 58
+
+#define ALERT_ALWAYS 100
+#define ALERT_FLASH 101
+#define ALERT_IGNORE 102
+
+#define PRT_SETUP 8001 // These have to match the stuff in control
+#define NETWK_CONNECTIONS 8021 // panel
+
+#define PM_REFRESH WM_USER + 100 // BUGBUG: Need to define proper manifest
+#define PM_SELQUEUE WM_USER + 101
+#define PM_QUERYSEL WM_USER + 102
+
+typedef struct _wnpmsel { /* structure returned by PM_QUERYSEL */
+ WORD wJobID;
+ char szQueueName [260]; /* in the form "LPT1\0HP LaserJet III\0" */
+} WNPMSEL, far *LPWNPMSEL;
+
+#define IDM_PROPERTIES 202
+#define IDM_CHANGE_MENUS 212
+
+/*
+ * added JONN 2/26/91
+ * Print Manager Extensions
+ */
+
+typedef struct _queuestruct2
+{
+ WORD pq2Name; /* offset to queue name */
+ /* in the form "LPT1\0HP LaserJet III\0" */
+ WORD pq2Comment; /* offset to queue comment */
+ WORD pq2Driver; /* offset to driver name */
+ WORD pq2Status; /* status flags */
+ WORD pq2Jobcount; /* number of jobs in this queue */
+ WORD pq2Flags; /* miscellaneous flags */
+
+} QUEUESTRUCT2, FAR *LPQS2;
+
+#define QNAME(buf,qs) ((LPSTR)(buf) + (qs).pq2Name)
+#define QCOMMENT(buf,qs) ((LPSTR)(buf) + (qs).pq2Comment)
+#define QDRIVER(buf,qs) ((LPSTR)(buf) + (qs).pq2Driver)
+
+#define QF_REDIRECTED 0x0001
+#define QF_SHARED 0x0002
+
+typedef struct _jobstruct2 {
+ WORD pj2Id; // job ID
+ WORD pj2Username; // name of owner (offset to string)
+// WORD pj2Parms;
+ WORD pj2Position; // 0-based position in queue
+ WORD pj2Status; // status flags (WNPRJ_XXXXX)
+ DWORD pj2Submitted;
+ DWORD pj2Size; // size of job in bytes
+ DWORD pj2SubmitSize; // bytes submitted so far
+// WORD pj2Copies;
+ WORD pj2Comment; // comment/app name (offset to string)
+ WORD pj2Document; // document name (offset to string)
+ WORD pj2StatusText; // verbose status (offset to string)
+ WORD pj2PrinterName; // name of port job is printing on (offs to str)
+} JOBSTRUCT2;
+
+typedef JOBSTRUCT2 far * LPJOBSTRUCT2;
+
+#define JOBNAME(buf,job) ((LPSTR)(buf) + (job).pj2Username)
+#define JOBCOMMENT(buf,job) ((LPSTR)(buf) + (job).pj2Comment)
+#define JOBDOCUMENT(buf,job) ((LPSTR)(buf) + (job).pj2Document)
+#define JOBSTATUS(buf,job) ((LPSTR)(buf) + (job).pj2StatusText)
+#define JOBPRINTER(buf,job) ((LPSTR)(buf) + (job).pj2PrinterName)
+
+/*
+ * Type WNETERR distinguishes WN_ error codes from other WORD
+ * values. Added JONN 5/3/91
+ */
+typedef WORD WNETERR;
+
+// new Print Manager Extensions APIs
+/* All queue names are in the form "LPT1\0HP LaserJet III\0" */
+#ifdef C700
+extern void far pascal __loadds WNetPrintMgrSelNotify (BYTE, LPQS2, LPQS2,
+ LPJOBSTRUCT2, LPJOBSTRUCT2, LPWORD, LPSTR, WORD);
+extern WNETERR far pascal __loadds WNetPrintMgrPrinterEnum (LPSTR lpszQueueName,
+ LPSTR lpBuffer, LPWORD pcbBuffer, LPWORD cAvail, WORD usLevel);
+extern WNETERR far pascal __loadds WNetPrintMgrChangeMenus(HWND, HANDLE FAR *, BOOL FAR *);
+extern WNETERR far pascal __loadds WNetPrintMgrCommand (HWND, WORD);
+extern void far pascal __loadds WNetPrintMgrExiting (void);
+extern BOOL far pascal __loadds WNetPrintMgrExtHelp (DWORD);
+extern WORD far pascal __loadds WNetPrintMgrMoveJob (HWND, LPSTR, WORD, int);
+#else
+extern void API WNetPrintMgrSelNotify (BYTE, LPQS2, LPQS2,
+ LPJOBSTRUCT2, LPJOBSTRUCT2,
+ LPWORD, LPSTR, WORD);
+extern WNETERR API WNetPrintMgrPrinterEnum (LPSTR lpszQueueName,
+ LPSTR lpBuffer, LPWORD pcbBuffer,
+ LPWORD cAvail, WORD usLevel);
+extern WNETERR API WNetPrintMgrChangeMenus(HWND, HANDLE FAR *, BOOL FAR *);
+extern WNETERR API WNetPrintMgrCommand (HWND, WORD);
+extern void API WNetPrintMgrExiting (void);
+extern BOOL API WNetPrintMgrExtHelp (DWORD);
+extern WORD API WNetPrintMgrMoveJob (HWND, LPSTR, WORD, int);
+#endif
+
+
+#define WINBALL
+#ifdef WINBALL
+#define WNNC_PRINTMGRNOTIFY 0x000C
+#ifdef C700
+extern void far pascal __loadds WNetPrintMgrStatusChange (LPSTR lpszQueueName,
+ LPSTR lpszPortName, WORD wQueueStatus, WORD cJobsLeft, HANDLE hJCB,
+ BOOL fDeleted);
+#else
+extern void API WNetPrintMgrStatusChange (LPSTR lpszQueueName,
+ LPSTR lpszPortName,
+ WORD wQueueStatus,
+ WORD cJobsLeft,
+ HANDLE hJCB,
+ BOOL fDeleted);
+#endif
+
+#define PM_QUERYQDATA WM_USER + 104
+
+typedef struct _PMQUEUE {
+ WORD dchPortName; /* offset to port name string */
+ WORD dchPrinterName; /* offset to printer name string */
+ WORD dchRemoteName; /* offset to remote name string */
+ WORD cJobs; /* count of jobs */
+ WORD fwStatus; /* queue status */
+} PMQUEUE, FAR *LPPMQUEUE;
+
+#define PMQPORTNAME(buf,queue) ((LPSTR)(buf) + (queue).dchPortName)
+#define PMQPRINTERNAME(buf,queue) ((LPSTR)(buf) + (queue).dchPrinterName)
+#define PMQREMOTENAME(buf,queue) ((LPSTR)(buf) + (queue).dchRemoteName)
+
+typedef struct _PMJOB {
+ DWORD dwTime; /* date/time job was spooled */
+ DWORD cbJob; /* job size in bytes */
+ DWORD cbSubmitted; /* bytes submitted so far */
+ WORD dchJobName; /* offset to job name (doc name) string */
+ HANDLE hJCB; /* hJCB to refer to the job */
+} PMJOB, FAR *LPPMJOB;
+
+#define PMJOBNAME(buf,job) ((LPSTR)(buf) + (job).dchJobName)
+
+
+#endif
+
+// new values for WNetGetCaps()
+#define WNNC_PRINTMGREXT 0x000B
+// returns extensions version number, re: GetVersion(),
+// or 0 if not supported
+
+// QUEUESTRUCT2.pq2Status and .pq2Jobcount for WNetPrintMgrPrinterEnum[2]
+#define WNQ_UNKNOWN -1
+
+#define WNPRS_CANPAUSE 0x0001
+#define WNPRS_CANRESUME 0x0002
+#define WNPRS_CANDELETE 0x0004
+#define WNPRS_CANMOVE 0x0008
+#define WNPRS_CANDISCONNECT 0x0010
+#define WNPRS_CANSTOPSHARE 0x0020
+#define WNPRS_ISPAUSED 0x0040
+#define WNPRS_ISRESUMED 0x0080
+
+// help contexts, were previously in sphelp.h
+#define IDH_HELPFIRST 5000
+#define IDH_SYSMENU (IDH_HELPFIRST + 2000)
+#define IDH_MBFIRST (IDH_HELPFIRST + 2001)
+#define IDH_MBLAST (IDH_HELPFIRST + 2099)
+#define IDH_DLGFIRST (IDH_HELPFIRST + 3000)
+
+
+#define IDH_PRIORITY (IDH_HELPFIRST + PRIORITY )
+#define IDH_PRIORITY1 (IDH_HELPFIRST + PRIORITY + 1)
+#define IDH_PRIORITY2 (IDH_HELPFIRST + PRIORITY + 2)
+#define IDH_ABOUT (IDH_HELPFIRST + ABOUT )
+#define IDH_EXIT (IDH_HELPFIRST + EXIT)
+#define IDH_NETWORK (IDH_HELPFIRST + NETWORK)
+#define IDH_HELP_NDEX (IDH_HELPFIRST + HELP_NDEX)
+#define IDH_HELP_MOUSE (IDH_HELPFIRST + HELP_MOUSE)
+#define IDH_HELP_KEYBOARD (IDH_HELPFIRST + HELP_KEYBOARD)
+#define IDH_HELP_HELP (IDH_HELPFIRST + HELP_HELP)
+#define IDH_HELP_COMMANDS (IDH_HELPFIRST + HELP_COMMANDS)
+#define IDH_HELP_PROCEDURES (IDH_HELPFIRST + HELP_PROCEDURES)
+#define IDH_SHOW_TIME (IDH_HELPFIRST + SHOW_TIME)
+#define IDH_SHOW_SIZE (IDH_HELPFIRST + SHOW_SIZE)
+#define IDH_UPDATE (IDH_HELPFIRST + UPDATE)
+#define IDH_SHOW_QUEUE (IDH_HELPFIRST + SHOW_QUEUE)
+#define IDH_SHOW_OTHER (IDH_HELPFIRST + SHOW_OTHER)
+#define IDH_ALERT_ALWAYS (IDH_HELPFIRST + ALERT_ALWAYS)
+#define IDH_ALERT_FLASH (IDH_HELPFIRST + ALERT_FLASH)
+#define IDH_ALERT_IGNORE (IDH_HELPFIRST + ALERT_IGNORE)
+
+
+// was in spoolids.h
+
+#define IDS_A_BASE 4096
+
+/* also used as button IDs */
+#define ID_ABORT 4
+#define ID_PAUSE 2
+#define ID_RESUME 3
+#define ID_EXPLAIN 5
+
+#endif /* _spl_wnt_h_ */
diff --git a/private/mvdm/wow16/inc/spool.h b/private/mvdm/wow16/inc/spool.h
new file mode 100644
index 000000000..f600010dc
--- /dev/null
+++ b/private/mvdm/wow16/inc/spool.h
@@ -0,0 +1,175 @@
+#ifndef WINAPI
+#ifdef BUILDDLL /* ;Internal */
+#define WINAPI _loadds far pascal /* ;Internal */
+#define CALLBACK _loadds far pascal /* ;Internal */
+#else /* ;Internal */
+#define WINAPI far pascal
+#define CALLBACK far pascal
+#endif /* ;Internal */
+#endif
+
+#define LWORD(x) ((int)((x)&0xFFFF))
+
+
+/* spooler error code */
+#define SP_ERROR (-1) /* general error - mostly used when spooler isn't loaded */
+#define SP_APPABORT (-2) /* app aborted the job through the driver */
+#define SP_USERABORT (-3) /* user aborted the job through spooler's front end */
+#define SP_OUTOFDISK (-4) /* simply no disk to spool */
+#define SP_OUTOFMEMORY (-5)
+#define SP_RETRY (-6) /* retry sending to the port again */
+#define SP_NOTREPORTED 0x4000 /* set if GDI did not report error */
+
+/* subfunctions of the Spooler support function, GetSpoolJob()
+ * CP_* are used by the control panel for modifying the printer setup/
+ */
+#define SP_PRINTERNAME 20
+#define SP_REGISTER 21
+#define SP_CONNECTEDPORTCNT 25
+#define SP_QUERYDISKUSAGE 26
+#define SP_DISKFREED 27
+#define SP_INIT 28
+#define SP_LISTEDPORTCNT 29
+#define CP_ISPORTFREE 30
+#define CP_REINIT 31
+#define SP_TXTIMEOUT 32
+#define SP_DNSTIMEOUT 33
+#define CP_CHECKSPOOLER 34
+#define CP_SET_TT_ONLY 35
+#define CP_SETSPOOLER 36
+#define CP_SETDOSPRINT 37
+
+
+#define SP_DISK_BUFFER (20000) /* wait for about 20 K of disk space to free
+ free up before attempting to write to disk */
+
+/* messages posted or sent to the spooler window
+ */
+#define SP_NEWJOB 0x1001
+#define SP_DELETEJOB 0x1002
+#define SP_DISKNEEDED 0x1003
+#define SP_QUERYDISKAVAIL 0x1004
+#define SP_ISPORTFREE 0x1005
+#define SP_CHANGEPORT 0x1006
+
+/* in /windows/oem/printer.h */
+
+
+/* job status flag bits in the type field of the JCB structure
+ */
+#define JB_ENDDOC 0x0001
+#define JB_INVALIDDOC 0x0002
+#define JB_DIRECT_SPOOL 0x8000 /* go directly to the printer without the spooler */
+#define JB_FILE_PORT 0x4000 /* were given a file for a port name */
+#define JB_VALID_SPOOL 0x2000 /* everything is cool, continue to spool normally */
+#define JB_NOTIFIED_SPOOLER 0x1000 /* already notified the spooler of this job */
+#define JB_WAITFORDISK 0x0800 /* out of disk condition has been detected previously */
+#define JB_DEL_FILE 0x0400 /* no deletion of file after spool */
+#define JB_FILE_SPOOL 0x0200 /* spooling a file */
+#define JB_NET_SPOOL 0x0100 /* sending directly to network */
+
+/* allow 2 dialog box messages initially and increment 8 at a time */
+#define SP_DLGINC 8
+#define SP_DLGINIT 8
+
+#define NAME_LEN 32
+#define BUF_SIZE 128
+#define MAX_PROFILE 80
+#define JCBBUF_LEN 256
+
+#define lower(c) ((c > 'A' && c < 'Z') ? (c - 'A' + 'a') : c)
+
+#define IDS_LENGTH 60
+
+/* comm driver stuff */
+#define COMM_INQUE 0x010 /* wm091385 */
+#define COMM_OUTQUE 0x030 /* wm091385 */
+#define COMM_OUTQUEPMODE 0x400 /* New size for pmode */
+
+#define COMM_ERR_BIT 0x8000
+#define TXTIMEOUT 45000 /* milliseconds */
+#define DNSTIMEOUT 15000 /* milliseconds */
+
+#define BAUDRATE 0
+#define PARITY 1
+#define BYTESIZE 2
+#define STOPBITS 3
+#define REPEAT 4
+
+
+typedef struct {
+ int type; /* type of dialog. This will tell whether it is */
+ /* call back function or pure dialog etc */
+ int size; /* size of special function data */
+ int adr;
+}DIALOGMARK;
+
+#define SP_TEXT 0 /* text type */
+#define SP_NOTTEXT 1 /* not text type */
+#define SP_DIALOG 2 /* dialog type data */
+#define SP_CALLBACK 3 /* call back type function */
+
+#define MAXPORTLIST 20 /* max # ports listed in win.ini [ports] */
+#define MAXPORT MAXPORTLIST
+#define MAXSPOOL 100 /* max # jobs spooled per port */
+#define MAXMAP 18
+#define PORTINDENT 2
+#define JOBINDENT 3
+#define MAXPAGE 7 /* allow 7 pages at first */
+#define INC_PAGE 8 /* increase by 8 pages at a time */
+
+typedef struct {
+ int pnum;
+ int printeratom;
+ long txtimeout;
+ long dnstimeout;
+}JCBQ;
+
+typedef struct jcb {
+ unsigned type;
+ int pagecnt;
+ int maxpage;
+ int portnum;
+ HDC hDC;
+ int chBuf;
+ long timeSpooled;
+ char buffer[JCBBUF_LEN];
+ unsigned long size;
+ unsigned long iLastPage;
+ WORD psp; // the PSP of the app that started printing
+ char jobName[NAME_LEN];
+ int page[MAXPAGE];
+}JCB;
+
+typedef struct page {
+ int filenum;
+ unsigned maxdlg; /* max number of dialog */
+ unsigned dlgptr; /* number of dialogs */
+ long spoolsize;
+ OFSTRUCT fileBuf;
+ DIALOGMARK dialog[SP_DLGINIT];
+}PAGE;
+
+#define SP_COMM_PORT 0
+#define SP_FILE_PORT 1
+#define SP_REMOTE_QUEUE 2
+#define SP_QUERYVALIDJOB 30
+
+
+typedef struct
+{
+ int type;
+ int fn;
+ long retry; /* system timer on first error */
+} PORT;
+
+
+/* exported routines */
+BOOL WINAPI QueryJob(HANDLE, int);
+BOOL WINAPI QueryAbort(HANDLE, int);
+
+int WINAPI WriteDialog(HANDLE hJCB, LPSTR str, int n);
+int WINAPI WriteSpool(HANDLE hJCB, LPSTR str, int n);
+
+LONG WINAPI GetSpoolJob(int, long);
+char WINAPI GetSpoolTempDrive(void);
diff --git a/private/mvdm/wow16/inc/stdarg.h b/private/mvdm/wow16/inc/stdarg.h
new file mode 100644
index 000000000..0bad49596
--- /dev/null
+++ b/private/mvdm/wow16/inc/stdarg.h
@@ -0,0 +1,42 @@
+/***
+*stdarg.h - defines ANSI-style macros for variable argument functions
+*
+* Copyright (c) 1985-1990, Microsoft Corporation. All rights reserved.
+*
+*Purpose:
+* This file defines ANSI-style macros for accessing arguments
+* of functions which take a variable number of arguments.
+* [ANSI]
+*
+****/
+
+#if defined(_DLL) && !defined(_MT)
+#error Cannot define _DLL without _MT
+#endif
+
+#ifdef _MT
+#define _FAR_ _far
+#else
+#define _FAR_
+#endif
+
+/* define NULL pointer value */
+
+#ifndef NULL
+#if (_MSC_VER >= 600)
+#define NULL ((void *)0)
+#elif (defined(M_I86SM) || defined(M_I86MM))
+#define NULL 0
+#else
+#define NULL 0L
+#endif
+#endif
+
+#ifndef _VA_LIST_DEFINED
+typedef char _FAR_ *va_list;
+#define _VA_LIST_DEFINED
+#endif
+
+#define va_start(ap,v) ap = (va_list)&v + sizeof(v)
+#define va_arg(ap,t) ((t _FAR_ *)(ap += sizeof(t)))[-1]
+#define va_end(ap) ap = NULL
diff --git a/private/mvdm/wow16/inc/stdio.h b/private/mvdm/wow16/inc/stdio.h
new file mode 100644
index 000000000..cedc1195e
--- /dev/null
+++ b/private/mvdm/wow16/inc/stdio.h
@@ -0,0 +1,254 @@
+/***
+*stdio.h - definitions/declarations for standard I/O routines
+*
+* Copyright (c) 1985-1990, Microsoft Corporation. All rights reserved.
+*
+*Purpose:
+* This file defines the structures, values, macros, and functions
+* used by the level 2 I/O ("standard I/O") routines.
+* [ANSI/System V]
+*
+****/
+
+#if defined(_DLL) && !defined(_MT)
+#error Cannot define _DLL without _MT
+#endif
+
+#ifdef _MT
+#define _FAR_ _far
+#else
+#define _FAR_
+#endif
+
+#ifndef _SIZE_T_DEFINED
+typedef unsigned int size_t;
+#define _SIZE_T_DEFINED
+#endif
+
+#ifndef _VA_LIST_DEFINED
+typedef char _FAR_ *va_list;
+#define _VA_LIST_DEFINED
+#endif
+
+/* buffered I/O macros */
+
+#define BUFSIZ 512
+#ifdef _MT
+#define _NFILE 40
+#else
+#define _NFILE 20
+#endif
+#define EOF (-1)
+
+#ifndef _FILE_DEFINED
+struct _iobuf {
+ char _FAR_ *_ptr;
+ int _cnt;
+ char _FAR_ *_base;
+ char _flag;
+ char _file;
+ };
+typedef struct _iobuf FILE;
+#define _FILE_DEFINED
+#endif
+
+
+/* P_tmpnam: Directory where temporary files may be created.
+ * L_tmpnam size = size of P_tmpdir
+ * + 1 (in case P_tmpdir does not end in "\\")
+ * + 6 (for the temp number string)
+ * + 1 (for the null terminator)
+ */
+
+#define P_tmpdir "\\"
+#define L_tmpnam sizeof(P_tmpdir)+8
+
+
+/* fseek constants */
+
+#define SEEK_CUR 1
+#define SEEK_END 2
+#define SEEK_SET 0
+
+
+/* minimum guaranteed filename length, open file count, and unique
+ * tmpnam filenames.
+ */
+
+#define FILENAME_MAX 63
+#define FOPEN_MAX 20
+#define SYS_OPEN 20
+#define TMP_MAX 32767
+
+
+/* define NULL pointer value */
+
+#ifndef NULL
+#if (_MSC_VER >= 600)
+#define NULL ((void *)0)
+#elif (defined(M_I86SM) || defined(M_I86MM))
+#define NULL 0
+#else
+#define NULL 0L
+#endif
+#endif
+
+
+/* declare _iob[] array */
+
+#ifndef _STDIO_DEFINED
+#ifdef _DLL
+extern FILE _FAR_ _cdecl _iob[];
+#else
+extern FILE _near _cdecl _iob[];
+#endif
+#endif
+
+
+/* define file position type */
+
+#ifndef _FPOS_T_DEFINED
+typedef long fpos_t;
+#define _FPOS_T_DEFINED
+#endif
+
+
+/* standard file pointers */
+
+#ifndef _WINDOWS
+#define stdin (&_iob[0])
+#define stdout (&_iob[1])
+#define stderr (&_iob[2])
+#define stdaux (&_iob[3])
+#define stdprn (&_iob[4])
+#endif
+
+
+#define _IOREAD 0x01
+#define _IOWRT 0x02
+
+#define _IOFBF 0x0
+#define _IOLBF 0x40
+#define _IONBF 0x04
+
+#define _IOMYBUF 0x08
+#define _IOEOF 0x10
+#define _IOERR 0x20
+#define _IOSTRG 0x40
+#define _IORW 0x80
+
+
+/* function prototypes */
+
+#ifndef _STDIO_DEFINED
+int _FAR_ _cdecl _filbuf(FILE _FAR_ *);
+int _FAR_ _cdecl _flsbuf(int, FILE _FAR_ *);
+FILE _FAR_ * _FAR_ _cdecl _fsopen(const char _FAR_ *,
+ const char _FAR_ *, int);
+void _FAR_ _cdecl clearerr(FILE _FAR_ *);
+int _FAR_ _cdecl fclose(FILE _FAR_ *);
+int _FAR_ _cdecl fcloseall(void);
+FILE _FAR_ * _FAR_ _cdecl fdopen(int, const char _FAR_ *);
+int _FAR_ _cdecl feof(FILE _FAR_ *);
+int _FAR_ _cdecl ferror(FILE _FAR_ *);
+int _FAR_ _cdecl fflush(FILE _FAR_ *);
+int _FAR_ _cdecl fgetc(FILE _FAR_ *);
+#ifndef _WINDOWS
+int _FAR_ _cdecl fgetchar(void);
+#endif
+int _FAR_ _cdecl fgetpos(FILE _FAR_ *, fpos_t _FAR_ *);
+char _FAR_ * _FAR_ _cdecl fgets(char _FAR_ *, int, FILE _FAR_ *);
+int _FAR_ _cdecl fileno(FILE _FAR_ *);
+int _FAR_ _cdecl flushall(void);
+FILE _FAR_ * _FAR_ _cdecl fopen(const char _FAR_ *,
+ const char _FAR_ *);
+#ifndef _WINDLL
+int _FAR_ _cdecl fprintf(FILE _FAR_ *, const char _FAR_ *, ...);
+#endif
+int _FAR_ _cdecl fputc(int, FILE _FAR_ *);
+#ifndef _WINDOWS
+int _FAR_ _cdecl fputchar(int);
+#endif
+int _FAR_ _cdecl fputs(const char _FAR_ *, FILE _FAR_ *);
+size_t _FAR_ _cdecl fread(void _FAR_ *, size_t, size_t, FILE _FAR_ *);
+FILE _FAR_ * _FAR_ _cdecl freopen(const char _FAR_ *,
+ const char _FAR_ *, FILE _FAR_ *);
+#ifndef _WINDLL
+int _FAR_ _cdecl fscanf(FILE _FAR_ *, const char _FAR_ *, ...);
+#endif
+int _FAR_ _cdecl fsetpos(FILE _FAR_ *, const fpos_t _FAR_ *);
+int _FAR_ _cdecl fseek(FILE _FAR_ *, long, int);
+long _FAR_ _cdecl ftell(FILE _FAR_ *);
+size_t _FAR_ _cdecl fwrite(const void _FAR_ *, size_t, size_t,
+ FILE _FAR_ *);
+int _FAR_ _cdecl getc(FILE _FAR_ *);
+#ifndef _WINDOWS
+int _FAR_ _cdecl getchar(void);
+char _FAR_ * _FAR_ _cdecl gets(char _FAR_ *);
+#endif
+int _FAR_ _cdecl getw(FILE _FAR_ *);
+#ifndef _WINDOWS
+void _FAR_ _cdecl perror(const char _FAR_ *);
+#endif
+int _FAR_ _cdecl _pclose(FILE _FAR_ *);
+FILE _FAR_ * _FAR_ _cdecl _popen(const char _FAR_ *,
+ const char _FAR_ *);
+#ifndef _WINDOWS
+int _FAR_ _cdecl printf(const char _FAR_ *, ...);
+#endif
+int _FAR_ _cdecl putc(int, FILE _FAR_ *);
+#ifndef _WINDOWS
+int _FAR_ _cdecl putchar(int);
+int _FAR_ _cdecl puts(const char _FAR_ *);
+#endif
+int _FAR_ _cdecl putw(int, FILE _FAR_ *);
+int _FAR_ _cdecl remove(const char _FAR_ *);
+int _FAR_ _cdecl rename(const char _FAR_ *, const char _FAR_ *);
+void _FAR_ _cdecl rewind(FILE _FAR_ *);
+int _FAR_ _cdecl rmtmp(void);
+#ifndef _WINDOWS
+int _FAR_ _cdecl scanf(const char _FAR_ *, ...);
+#endif
+void _FAR_ _cdecl setbuf(FILE _FAR_ *, char _FAR_ *);
+int _FAR_ _cdecl setvbuf(FILE _FAR_ *, char _FAR_ *, int, size_t);
+#ifndef _WINDLL
+int _FAR_ _cdecl sprintf(char _FAR_ *, const char _FAR_ *, ...);
+int _FAR_ _cdecl sscanf(const char _FAR_ *, const char _FAR_ *, ...);
+#endif
+char _FAR_ * _FAR_ _cdecl tempnam(char _FAR_ *, char _FAR_ *);
+FILE _FAR_ * _FAR_ _cdecl tmpfile(void);
+char _FAR_ * _FAR_ _cdecl tmpnam(char _FAR_ *);
+int _FAR_ _cdecl ungetc(int, FILE _FAR_ *);
+int _FAR_ _cdecl unlink(const char _FAR_ *);
+#ifndef _WINDLL
+int _FAR_ _cdecl vfprintf(FILE _FAR_ *, const char _FAR_ *, va_list);
+#endif
+#ifndef _WINDOWS
+int _FAR_ _cdecl vprintf(const char _FAR_ *, va_list);
+#endif
+#ifndef _WINDLL
+int _FAR_ _cdecl vsprintf(char _FAR_ *, const char _FAR_ *, va_list);
+#endif
+#define _STDIO_DEFINED
+#endif
+
+/* macro definitions */
+
+#define feof(_stream) ((_stream)->_flag & _IOEOF)
+#define ferror(_stream) ((_stream)->_flag & _IOERR)
+#define fileno(_stream) ((int)(unsigned char)(_stream)->_file)
+#define getc(_stream) (--(_stream)->_cnt >= 0 ? 0xff & *(_stream)->_ptr++ \
+ : _filbuf(_stream))
+#define putc(_c,_stream) (--(_stream)->_cnt >= 0 \
+ ? 0xff & (*(_stream)->_ptr++ = (char)(_c)) : _flsbuf((_c),(_stream)))
+#ifndef _WINDOWS
+#define getchar() getc(stdin)
+#define putchar(_c) putc((_c),stdout)
+#endif
+
+#ifdef _MT
+#undef getc
+#undef putc
+#undef getchar
+#undef putchar
+#endif
diff --git a/private/mvdm/wow16/inc/stdlib.h b/private/mvdm/wow16/inc/stdlib.h
new file mode 100644
index 000000000..7a0f532ea
--- /dev/null
+++ b/private/mvdm/wow16/inc/stdlib.h
@@ -0,0 +1,212 @@
+/***
+*stdlib.h - declarations/definitions for commonly used library functions
+*
+* Copyright (c) 1985-1990, Microsoft Corporation. All rights reserved.
+*
+*Purpose:
+* This include file contains the function declarations for
+* commonly used library functions which either don't fit somewhere
+* else, or, like toupper/tolower, can't be declared in the normal
+* place for other reasons.
+* [ANSI]
+*
+****/
+
+#if defined(_DLL) && !defined(_MT)
+#error Cannot define _DLL without _MT
+#endif
+
+#ifdef _MT
+#define _FAR_ _far
+#else
+#define _FAR_
+#endif
+
+#ifdef _DLL
+#define _LOADDS_ _loadds
+#else
+#define _LOADDS_
+#endif
+
+#ifndef _SIZE_T_DEFINED
+typedef unsigned int size_t;
+#define _SIZE_T_DEFINED
+#endif
+
+/* define NULL pointer value */
+
+#ifndef NULL
+#if (_MSC_VER >= 600)
+#define NULL ((void *)0)
+#elif (defined(M_I86SM) || defined(M_I86MM))
+#define NULL 0
+#else
+#define NULL 0L
+#endif
+#endif
+
+/* definition of the return type for the onexit() function */
+
+#define EXIT_SUCCESS 0
+#define EXIT_FAILURE 1
+
+#ifndef _ONEXIT_T_DEFINED
+typedef int (_FAR_ _cdecl _LOADDS_ * _cdecl onexit_t)();
+#define _ONEXIT_T_DEFINED
+#endif
+
+
+/* data structure definitions for div and ldiv runtimes. */
+
+#ifndef _DIV_T_DEFINED
+
+typedef struct _div_t {
+ int quot;
+ int rem;
+} div_t;
+
+typedef struct _ldiv_t {
+ long quot;
+ long rem;
+} ldiv_t;
+
+#define _DIV_T_DEFINED
+#endif
+
+/* maximum value that can be returned by the rand function. */
+
+#define RAND_MAX 0x7fff
+
+
+/* min and max macros */
+
+#define max(a,b) (((a) > (b)) ? (a) : (b))
+#define min(a,b) (((a) < (b)) ? (a) : (b))
+
+
+/* sizes for buffers used by the _makepath() and _splitpath() functions.
+ * note that the sizes include space for 0-terminator
+ */
+
+#define _MAX_PATH 260 /* max. length of full pathname */
+#define _MAX_DRIVE 3 /* max. length of drive component */
+#define _MAX_DIR 256 /* max. length of path component */
+#define _MAX_FNAME 256 /* max. length of file name component */
+#define _MAX_EXT 256 /* max. length of extension component */
+
+/* external variable declarations */
+
+#ifdef _MT
+extern int _far * _cdecl _far volatile _errno(void);
+extern unsigned _far * _cdecl _far __doserrno(void);
+#define errno (*_errno())
+#define _doserrno (*__doserrno())
+#else
+extern int _near _cdecl volatile errno; /* XENIX style error number */
+extern int _near _cdecl _doserrno; /* MS-DOS system error value */
+#endif
+extern char * _near _cdecl sys_errlist[]; /* perror error message table */
+extern int _near _cdecl sys_nerr; /* # of entries in sys_errlist table */
+
+#ifdef _DLL
+extern char ** _FAR_ _cdecl environ; /* pointer to environment table */
+extern int _FAR_ _cdecl _fmode; /* default file translation mode */
+extern int _FAR_ _cdecl _fileinfo; /* open file info mode (for spawn) */
+#else
+extern char ** _near _cdecl environ; /* pointer to environment table */
+extern int _near _cdecl _fmode; /* default file translation mode */
+extern int _near _cdecl _fileinfo; /* open file info mode (for spawn) */
+#endif
+
+extern unsigned int _near _cdecl _psp; /* Program Segment Prefix */
+
+/* OS major/minor version numbers */
+
+#ifndef _WINDLL
+extern unsigned char _near _cdecl _osmajor;
+extern unsigned char _near _cdecl _osminor;
+#endif
+
+#define DOS_MODE 0 /* Real Address Mode */
+#define OS2_MODE 1 /* Protected Address Mode */
+
+extern unsigned char _near _cdecl _osmode;
+
+
+/* function prototypes */
+
+#ifdef _MT
+double _FAR_ _pascal atof(const char _FAR_ *);
+double _FAR_ _pascal strtod(const char _FAR_ *, char _FAR_ * _FAR_ *);
+ldiv_t _FAR_ _pascal ldiv(long, long);
+#else /* not _MT */
+double _FAR_ _cdecl atof(const char _FAR_ *);
+double _FAR_ _cdecl strtod(const char _FAR_ *, char _FAR_ * _FAR_ *);
+ldiv_t _FAR_ _cdecl ldiv(long, long);
+#endif
+
+void _FAR_ _cdecl abort(void);
+int _FAR_ _cdecl abs(int);
+int _FAR_ _cdecl atexit(void (_cdecl _FAR_ _LOADDS_ *)(void));
+int _FAR_ _cdecl atoi(const char _FAR_ *);
+long _FAR_ _cdecl atol(const char _FAR_ *);
+long double _FAR_ _cdecl _atold(const char _FAR_ *);
+void _FAR_ * _FAR_ _cdecl bsearch(const void _FAR_ *, const void _FAR_ *,
+ size_t, size_t, int (_FAR_ _cdecl *)(const void _FAR_ *,
+ const void _FAR_ *));
+void _FAR_ * _FAR_ _cdecl calloc(size_t, size_t);
+div_t _FAR_ _cdecl div(int, int);
+char _FAR_ * _FAR_ _cdecl ecvt(double, int, int _FAR_ *, int _FAR_ *);
+void _FAR_ _cdecl exit(int);
+void _FAR_ _cdecl _exit(int);
+char _FAR_ * _FAR_ _cdecl fcvt(double, int, int _FAR_ *, int _FAR_ *);
+void _FAR_ _cdecl free(void _FAR_ *);
+char _FAR_ * _FAR_ _cdecl _fullpath(char _FAR_ *, const char _FAR_ *,
+ size_t);
+#ifndef _WINDLL
+char _FAR_ * _FAR_ _cdecl gcvt(double, int, char _FAR_ *);
+#endif
+char _FAR_ * _FAR_ _cdecl getenv(const char _FAR_ *);
+char _FAR_ * _FAR_ _cdecl itoa(int, char _FAR_ *, int);
+long _FAR_ _cdecl labs(long);
+unsigned long _FAR_ _cdecl _lrotl(unsigned long, int);
+unsigned long _FAR_ _cdecl _lrotr(unsigned long, int);
+char _FAR_ * _FAR_ _cdecl ltoa(long, char _FAR_ *, int);
+void _FAR_ _cdecl _makepath(char _FAR_ *, const char _FAR_ *,
+ const char _FAR_ *, const char _FAR_ *, const char _FAR_ *);
+void _FAR_ * _FAR_ _cdecl malloc(size_t);
+onexit_t _FAR_ _cdecl onexit(onexit_t);
+#ifndef _WINDOWS
+void _FAR_ _cdecl perror(const char _FAR_ *);
+#endif
+int _FAR_ _cdecl putenv(const char _FAR_ *);
+void _FAR_ _cdecl qsort(void _FAR_ *, size_t, size_t, int (_FAR_ _cdecl *)
+ (const void _FAR_ *, const void _FAR_ *));
+unsigned int _FAR_ _cdecl _rotl(unsigned int, int);
+unsigned int _FAR_ _cdecl _rotr(unsigned int, int);
+int _FAR_ _cdecl rand(void);
+void _FAR_ * _FAR_ _cdecl realloc(void _FAR_ *, size_t);
+void _FAR_ _cdecl _searchenv(const char _FAR_ *, const char _FAR_ *,
+ char _FAR_ *);
+void _FAR_ _cdecl _splitpath(const char _FAR_ *, char _FAR_ *,
+ char _FAR_ *, char _FAR_ *, char _FAR_ *);
+void _FAR_ _cdecl srand(unsigned int);
+long _FAR_ _cdecl strtol(const char _FAR_ *, char _FAR_ * _FAR_ *,
+ int);
+long double _FAR_ _cdecl _strtold(const char _FAR_ *,
+ char _FAR_ * _FAR_ *);
+unsigned long _FAR_ _cdecl strtoul(const char _FAR_ *,
+ char _FAR_ * _FAR_ *, int);
+void _FAR_ _cdecl swab(char _FAR_ *, char _FAR_ *, int);
+#ifndef _WINDOWS
+int _FAR_ _cdecl system(const char _FAR_ *);
+#endif
+char _FAR_ * _FAR_ _cdecl ultoa(unsigned long, char _FAR_ *, int);
+
+#ifndef tolower /* tolower has been undefined - use function */
+int _FAR_ _cdecl tolower(int);
+#endif /* tolower */
+
+#ifndef toupper /* toupper has been undefined - use function */
+int _FAR_ _cdecl toupper(int);
+#endif /* toupper */
diff --git a/private/mvdm/wow16/inc/string.h b/private/mvdm/wow16/inc/string.h
new file mode 100644
index 000000000..2c39b8d91
--- /dev/null
+++ b/private/mvdm/wow16/inc/string.h
@@ -0,0 +1,121 @@
+/***
+*string.h - declarations for string manipulation functions
+*
+* Copyright (c) 1985-1990, Microsoft Corporation. All rights reserved.
+*
+*Purpose:
+* This file contains the function declarations for the string
+* manipulation functions.
+* [ANSI/System V]
+*
+****/
+
+#if defined(_DLL) && !defined(_MT)
+#error Cannot define _DLL without _MT
+#endif
+
+#ifdef _MT
+#define _FAR_ _far
+#else
+#define _FAR_
+#endif
+
+#ifndef _SIZE_T_DEFINED
+typedef unsigned int size_t;
+#define _SIZE_T_DEFINED
+#endif
+
+/* function prototypes */
+
+void _FAR_ * _FAR_ _cdecl memccpy(void _FAR_ *, const void _FAR_ *,
+ int, unsigned int);
+void _FAR_ * _FAR_ _cdecl memchr(const void _FAR_ *, int, size_t);
+int _FAR_ _cdecl memcmp(const void _FAR_ *, const void _FAR_ *,
+ size_t);
+int _FAR_ _cdecl memicmp(const void _FAR_ *, const void _FAR_ *,
+ unsigned int);
+void _FAR_ * _FAR_ _cdecl memcpy(void _FAR_ *, const void _FAR_ *,
+ size_t);
+void _FAR_ * _FAR_ _cdecl memmove(void _FAR_ *, const void _FAR_ *,
+ size_t);
+void _FAR_ * _FAR_ _cdecl memset(void _FAR_ *, int, size_t);
+void _FAR_ _cdecl movedata(unsigned int, unsigned int, unsigned int,
+ unsigned int, unsigned int);
+char _FAR_ * _FAR_ _cdecl strcat(char _FAR_ *, const char _FAR_ *);
+char _FAR_ * _FAR_ _cdecl strchr(const char _FAR_ *, int);
+int _FAR_ _cdecl strcmp(const char _FAR_ *, const char _FAR_ *);
+int _FAR_ _cdecl strcmpi(const char _FAR_ *, const char _FAR_ *);
+int _FAR_ _cdecl strcoll(const char _FAR_ *, const char _FAR_ *);
+int _FAR_ _cdecl stricmp(const char _FAR_ *, const char _FAR_ *);
+char _FAR_ * _FAR_ _cdecl strcpy(char _FAR_ *, const char _FAR_ *);
+size_t _FAR_ _cdecl strcspn(const char _FAR_ *, const char _FAR_ *);
+char _FAR_ * _FAR_ _cdecl strdup(const char _FAR_ *);
+char _FAR_ * _FAR_ _cdecl _strerror(const char _FAR_ *);
+char _FAR_ * _FAR_ _cdecl strerror(int);
+size_t _FAR_ _cdecl strlen(const char _FAR_ *);
+char _FAR_ * _FAR_ _cdecl strlwr(char _FAR_ *);
+char _FAR_ * _FAR_ _cdecl strncat(char _FAR_ *, const char _FAR_ *,
+ size_t);
+int _FAR_ _cdecl strncmp(const char _FAR_ *, const char _FAR_ *,
+ size_t);
+int _FAR_ _cdecl strnicmp(const char _FAR_ *, const char _FAR_ *,
+ size_t);
+char _FAR_ * _FAR_ _cdecl strncpy(char _FAR_ *, const char _FAR_ *,
+ size_t);
+char _FAR_ * _FAR_ _cdecl strnset(char _FAR_ *, int, size_t);
+char _FAR_ * _FAR_ _cdecl strpbrk(const char _FAR_ *,
+ const char _FAR_ *);
+char _FAR_ * _FAR_ _cdecl strrchr(const char _FAR_ *, int);
+char _FAR_ * _FAR_ _cdecl strrev(char _FAR_ *);
+char _FAR_ * _FAR_ _cdecl strset(char _FAR_ *, int);
+size_t _FAR_ _cdecl strspn(const char _FAR_ *, const char _FAR_ *);
+char _FAR_ * _FAR_ _cdecl strstr(const char _FAR_ *,
+ const char _FAR_ *);
+char _FAR_ * _FAR_ _cdecl strtok(char _FAR_ *, const char _FAR_ *);
+char _FAR_ * _FAR_ _cdecl strupr(char _FAR_ *);
+size_t _FAR_ _cdecl strxfrm (char _FAR_ *, const char _FAR_ *,
+ size_t);
+
+/* model independent function prototypes */
+
+void _far * _far _cdecl _fmemccpy(void _far *, const void _far *,
+ int, unsigned int);
+void _far * _far _cdecl _fmemchr(const void _far *, int, size_t);
+int _far _cdecl _fmemcmp(const void _far *, const void _far *,
+ size_t);
+void _far * _far _cdecl _fmemcpy(void _far *, const void _far *,
+ size_t);
+int _far _cdecl _fmemicmp(const void _far *, const void _far *,
+ unsigned int);
+void _far * _far _cdecl _fmemmove(void _far *, const void _far *,
+ size_t);
+void _far * _far _cdecl _fmemset(void _far *, int, size_t);
+char _far * _far _cdecl _fstrcat(char _far *, const char _far *);
+char _far * _far _cdecl _fstrchr(const char _far *, int);
+int _far _cdecl _fstrcmp(const char _far *, const char _far *);
+int _far _cdecl _fstricmp(const char _far *, const char _far *);
+char _far * _far _cdecl _fstrcpy(char _far *, const char _far *);
+size_t _far _cdecl _fstrcspn(const char _far *, const char _far *);
+char _far * _far _cdecl _fstrdup(const char _far *);
+char _near * _far _cdecl _nstrdup(const char _far *);
+size_t _far _cdecl _fstrlen(const char _far *);
+char _far * _far _cdecl _fstrlwr(char _far *);
+char _far * _far _cdecl _fstrncat(char _far *, const char _far *,
+ size_t);
+int _far _cdecl _fstrncmp(const char _far *, const char _far *,
+ size_t);
+int _far _cdecl _fstrnicmp(const char _far *, const char _far *,
+ size_t);
+char _far * _far _cdecl _fstrncpy(char _far *, const char _far *,
+ size_t);
+char _far * _far _cdecl _fstrnset(char _far *, int, size_t);
+char _far * _far _cdecl _fstrpbrk(const char _far *,
+ const char _far *);
+char _far * _far _cdecl _fstrrchr(const char _far *, int);
+char _far * _far _cdecl _fstrrev(char _far *);
+char _far * _far _cdecl _fstrset(char _far *, int);
+size_t _far _cdecl _fstrspn(const char _far *, const char _far *);
+char _far * _far _cdecl _fstrstr(const char _far *,
+ const char _far *);
+char _far * _far _cdecl _fstrtok(char _far *, const char _far *);
+char _far * _far _cdecl _fstrupr(char _far *);
diff --git a/private/mvdm/wow16/inc/strtable.h b/private/mvdm/wow16/inc/strtable.h
new file mode 100644
index 000000000..c9cc7a357
--- /dev/null
+++ b/private/mvdm/wow16/inc/strtable.h
@@ -0,0 +1,136 @@
+/****************************************************************************/
+/* */
+/* STRTABLE.H - */
+/* */
+/* StringTable Defines */
+/* */
+/****************************************************************************/
+
+/* STRINGTABLE Defines */
+#define STR_WINDOWS 0
+#define STR_COLORS 1
+#define STR_DESKPATTERN 2
+#define STR_FONTS 3
+#define STR_BLINK 4
+#define STR_SWAPBUTTONS 5
+#define STR_DBLCLKSPEED 6
+#define STR_TYPEAHEAD 7
+#define STR_GRID 8
+#define STR_BEEP 9
+#define STR_MOUSETHRESH1 10
+#define STR_MOUSETHRESH2 11
+#define STR_MOUSESPEED 12
+#define STR_KEYSPEED 13
+#define STR_BORDER 14
+#define STR_QSIZE 15
+
+#define STR_CLASSSTART 16
+#define STR_BUTTONCLASS 16
+#define STR_EDITCLASS 17
+#define STR_STATICCLASS 18
+#define STR_LISTBOXCLASS 19
+#define STR_SCROLLBARCLASS 20
+#define STR_COMBOBOXCLASS 21
+#define STR_MDICLASS 22
+#define STR_COMBOLISTBOXCLASS 23
+
+#define STR_COLORSTART 32
+#define STR_SCROLLBAR 32
+#define STR_BACKGROUND 33
+#define STR_ACTIVETITLE 34
+#define STR_INACTIVETITLE 35
+#define STR_MENU 36
+#define STR_WINDOW 37
+#define STR_WINDOWFRAME 38
+#define STR_MENUTEXT 39
+#define STR_WINDOWTEXT 40
+#define STR_TITLETEXT 41
+#define STR_ACTIVEBORDER 42
+#define STR_INACTIVEBORDER 43
+#define STR_APPWORKSPACE 44
+#define STR_HIGHLIGHT 45
+#define STR_HIGHLIGHTTEXT 46
+#define STR_BTNFACE 47
+#define STR_BTNSHADOW 48
+#define STR_GRAYTEXT 49
+#define STR_BTNTEXT 50
+#define STR_INACTIVECAPTIONTEXT 51
+
+#define STR_FILEPORT 60
+#define STR_CANTOPEN 61
+#define STR_OVERWRITE 62
+#define STR_MOREWINDOWS 63
+
+#define STR_ICONHORZSPACING 64
+#define STR_ICONVERTSPACING 65
+#define STR_ICONTITLEWRAP 66
+
+#define STR_DTBITMAP 67
+#define STR_DTSTYLE 68
+#define STR_DTORIGINX 69
+#define STR_DTORIGINY 70
+
+#define STR_NETDRIVER 71
+#define STR_BOOT 72
+#define STR_LANGDRIVER 73
+#define STR_SYSTEMINI 74
+#define STR_SYSERR 75
+#define STR_DIVBYZERO 76
+#define STR_UNTITLED 77
+#define STR_ERROR 78
+#define STR_TASKMAN 79
+
+#define STR_DESKTOP 80
+#define STR_PATTERNS 81
+#define STR_NONE 82
+#define STR_TILEWALL 83
+
+#define STR_OK 84
+#define STR_CANCEL 85
+#define STR_ABORT 86
+#define STR_RETRY 87
+#define STR_IGNORE 88
+#define STR_YES 89
+#define STR_NO 90
+#define STR_ACCELERATORS 91
+#define STR_AM 92
+#define STR_PM 93
+#define STR_MENUSHOWDELAY 94
+#define STR_MENUHIDEDELAY 95
+#define STR_MENUDROPALIGNMENT 96
+#define STR_DOUBLECLICKWIDTH 97
+#define STR_DOUBLECLICKHEIGHT 98
+#define STR_SCREENSAVETIMEOUT 99
+#define STR_SCREENSAVEACTIVE 100
+#define STR_SCREENSAVEEXE 101
+#define STR_DRIVERS 102
+#define STR_NOMEMBITMAP 103
+#define STR_BEEPYES 104
+#define STR_BEEPNO 105
+#define STR_KEYDELAY 106
+#define STR_DRAGFULLWINDOWS 107
+#define STR_ICONTITLEFACENAME 108
+#define STR_ICONTITLESIZE 109
+#define STR_ICONTITLESTYLE 110
+#define STR_FASTALTTAB 111
+#define STR_INRESTORENETCONNECT 112
+
+#define STR_COMMMODULENAME 200
+#define STR_COMMWRITESTRING 201
+#define STR_COMMREADSTRING 202
+#define STR_COMMENABLENOTIFICATION 203
+#define STR_MOUSEMODULENAME 204
+
+
+ /* 256 - 512 are strings for network errors
+ */
+
+#define STR_NETCONNMSG 256
+#define STR_NETCONNTTL 257
+#define STR_NETCRASHEDTITLE 258
+#define STR_NETCRASHEDMSG 259
+#define STR_NETERRORS 275
+
+#define STR_SEARCH_TAG 513 // don't change, these are hard
+#define STR_USER_NAME 514 // coded in SHELL.DLL
+#define STR_ORG_NAME 515 // ugh!
diff --git a/private/mvdm/wow16/inc/style.h b/private/mvdm/wow16/inc/style.h
new file mode 100644
index 000000000..0e5bbd7fe
--- /dev/null
+++ b/private/mvdm/wow16/inc/style.h
@@ -0,0 +1,206 @@
+/* Window styles */
+#define WS_TILED 0x00000000L
+#define WS_ICONICPOPUP 0xc0000000L
+#define WS_POPUP 0x80000000L
+#define WS_CHILD 0x40000000L
+#define WS_MINIMIZE 0x20000000L
+#define WS_VISIBLE 0x10000000L
+#define WS_DISABLED 0x08000000L
+#define WS_CLIPSIBLINGS 0x04000000L
+#define WS_CLIPCHILDREN 0x02000000L
+#define WS_MAXIMIZE 0x01000000L
+
+#define WS_BORDER 0x00800000L
+#define WS_CAPTION 0x00c00000L
+#define WS_DLGFRAME 0x00400000L
+#define WS_VSCROLL 0x00200000L
+#define WS_HSCROLL 0x00100000L
+#define WS_SYSMENU 0x00080000L
+#define WS_SIZEBOX 0x00040000L
+#define WS_GROUP 0x00020000L
+#define WS_TABSTOP 0x00010000L
+
+#define WS_ICONIC WS_MINIMIZE
+
+/* Class styles */
+#define CS_VREDRAW 0x0001
+#define CS_HREDRAW 0x0002
+#define CS_KEYCVTWINDOW 0x0004
+#define CS_DBLCLKS 0x0008
+ /* 0x0010 reserved */
+#define CS_OWNDC 0x0020
+#define CS_CLASSDC 0x0040
+#define CS_MENUPOPUP 0x0080
+#define CS_NOKEYCVT 0x0100
+#define CS_SAVEBITS 0x0800
+
+/* Shorthand for the common cases */
+#define WS_TILEDWINDOW (WS_TILED | WS_CAPTION | WS_SYSMENU | WS_SIZEBOX)
+#define WS_POPUPWINDOW (WS_POPUP | WS_BORDER | WS_SYSMENU)
+#define WS_CHILDWINDOW (WS_CHILD)
+
+/* Edit control styles */
+#define ES_LEFT 0x0000L
+#define ES_CENTER 0x0001L
+#define ES_RIGHT 0x0002L
+#define ES_MULTILINE 0x0004L
+#define ES_UPPERCASE 0x0008L
+#define ES_LOWERCASE 0x0010L
+#define ES_PASSWORD 0x0020L
+#define ES_AUTOVSCROLL 0x0040L
+#define ES_AUTOHSCROLL 0x0080L
+#define ES_NOHIDESEL 0x0100L
+#define ES_OEMCONVERT 0x0400L
+
+/* button control styles */
+#define BS_PUSHBUTTON 0L
+#define BS_DEFPUSHBUTTON 1L
+#define BS_CHECKBOX 2L
+#define BS_AUTOCHECKBOX 3L
+#define BS_RADIOBUTTON 4L
+#define BS_3STATE 5L
+#define BS_AUTO3STATE 6L
+#define BS_GROUPBOX 7L
+#define BS_USERBUTTON 8L
+#define BS_AUTORADIOBUTTON 9L
+#define BS_PUSHBOX 10L
+#define BS_OWNERDRAW 0x0BL
+#define BS_LEFTTEXT 0x20L
+
+/* Dialog Styles */
+#define DS_ABSALIGN 0x01L
+#define DS_SYSMODAL 0x02L
+#define DS_LOCALEDIT 0x20L /* Edit items get Local storage. */
+#define DS_SETFONT 0x40L /* User specified font for Dlg controls */
+#define DS_MODALFRAME 0x80L /* Can be combined with WS_CAPTION */
+#define DS_NOIDLEMSG 0x100L /* WM_ENTERIDLE message will not be sent */
+
+/* listbox style bits */
+#define LBS_NOTIFY 0x0001L
+#define LBS_SORT 0x0002L
+#define LBS_NOREDRAW 0x0004L
+#define LBS_MULTIPLESEL 0x0008L
+#define LBS_OWNERDRAWFIXED 0x0010L
+#define LBS_OWNERDRAWVARIABLE 0x0020L
+#define LBS_HASSTRINGS 0x0040L
+#define LBS_USETABSTOPS 0x0080L
+#define LBS_NOINTEGRALHEIGHT 0x0100L
+#define LBS_MULTICOLUMN 0x0200L
+#define LBS_WANTKEYBOARDINPUT 0x0400L
+#define LBS_EXTENDEDSEL 0x0800L
+#define LBS_STANDARD (LBS_NOTIFY | LBS_SORT | WS_VSCROLL | WS_BORDER)
+
+/* Combo Box styles */
+#define CBS_SIMPLE 0x0001L
+#define CBS_DROPDOWN 0x0002L
+#define CBS_DROPDOWNLIST 0x0003L
+#define CBS_OWNERDRAWFIXED 0x0010L
+#define CBS_OWNERDRAWVARIABLE 0x0020L
+#define CBS_AUTOHSCROLL 0x0040L
+#define CBS_SORT 0x0100L
+#define CBS_HASSTRINGS 0x0200L
+
+/* scroll bar styles */
+#define SBS_HORZ 0x0000L
+#define SBS_VERT 0x0001L
+#define SBS_TOPALIGN 0x0002L
+#define SBS_LEFTALIGN 0x0002L
+#define SBS_BOTTOMALIGN 0x0004L
+#define SBS_RIGHTALIGN 0x0004L
+#define SBS_SIZEBOXTOPLEFTALIGN 0x0002L
+#define SBS_SIZEBOXBOTTOMRIGHTALIGN 0x0004L
+#define SBS_SIZEBOX 0x0008L
+
+/* Conventional dialog box and message box command IDs */
+#define IDOK 1
+#define IDCANCEL 2
+#define IDABORT 3
+#define IDRETRY 4
+#define IDIGNORE 5
+#define IDYES 6
+#define IDNO 7
+
+/* Static control constants */
+#define SS_LEFT 0L
+#define SS_CENTER 1L
+#define SS_RIGHT 2L
+#define SS_ICON 3L
+#define SS_BLACKRECT 4L
+#define SS_GRAYRECT 5L
+#define SS_WHITERECT 6L
+#define SS_BLACKFRAME 7L
+#define SS_GRAYFRAME 8L
+#define SS_WHITEFRAME 9L
+#define SS_USERITEM 10L
+
+/* Virtual Keys, Standard Set */
+
+#define VK_LBUTTON 0x01
+#define VK_RBUTTON 0x02
+#define VK_CANCEL 0x03
+#define VK_MBUTTON 0x04 /* NOT contiguous with L & RBUTTON */
+#define VK_BACK 0x08
+#define VK_TAB 0x09
+#define VK_CLEAR 0x0c
+#define VK_RETURN 0x0d
+#define VK_SHIFT 0x10
+#define VK_CONTROL 0x11
+#define VK_MENU 0x12
+#define VK_PAUSE 0x13
+#define VK_CAPITAL 0x14
+#define VK_ESCAPE 0x1b
+#define VK_SPACE 0x20
+
+#define VK_PRIOR 0x21
+#define VK_NEXT 0x22
+#define VK_END 0x23
+#define VK_HOME 0x24
+#define VK_LEFT 0x25
+#define VK_UP 0x26
+#define VK_RIGHT 0x27
+#define VK_DOWN 0x28
+
+/* VK_A thru VK_Z are the same as their ASCII equivalents: 'A' thru 'Z' */
+/* VK_0 thru VK_9 are the same as their ASCII equivalents: '0' thru '0' */
+
+#define VK_SELECT 0x29
+#define VK_PRINT 0x2a
+#define VK_EXECUTE 0x2b
+#define VK_SNAPSHOT 0x2c
+#define VK_INSERT 0x2d
+#define VK_DELETE 0x2e
+#define VK_HELP 0x2f
+
+#define VK_NUMPAD0 0x60
+#define VK_NUMPAD1 0x61
+#define VK_NUMPAD2 0x62
+#define VK_NUMPAD3 0x63
+#define VK_NUMPAD4 0x64
+#define VK_NUMPAD5 0x65
+#define VK_NUMPAD6 0x66
+#define VK_NUMPAD7 0x67
+#define VK_NUMPAD8 0x68
+#define VK_NUMPAD9 0x69
+#define VK_MULTIPLY 0x6A
+#define VK_ADD 0x6B
+#define VK_SEPARATOR 0x6C
+#define VK_SUBTRACT 0x6D
+#define VK_DECIMAL 0x6E
+#define VK_DIVIDE 0x6F
+
+#define VK_F1 0x70
+#define VK_F2 0x71
+#define VK_F3 0x72
+#define VK_F4 0x73
+#define VK_F5 0x74
+#define VK_F6 0x75
+#define VK_F7 0x76
+#define VK_F8 0x77
+#define VK_F9 0x78
+#define VK_F10 0x79
+#define VK_F11 0x7a
+#define VK_F12 0x7b
+#define VK_F13 0x7c
+#define VK_F14 0x7d
+#define VK_F15 0x7e
+#define VK_F16 0x7f
diff --git a/private/mvdm/wow16/inc/testing.h b/private/mvdm/wow16/inc/testing.h
new file mode 100644
index 000000000..3773e4b3b
--- /dev/null
+++ b/private/mvdm/wow16/inc/testing.h
@@ -0,0 +1,50 @@
+/*---------------------------------------------------------*\
+| |
+| TESTING.H |
+| |
+| Testing's very own include file! |
+\*---------------------------------------------------------*/
+
+
+
+/* This has all of the defines for the wParam and lParam that go along with
+ * the WM_TESTING message
+ */
+/* wParam defines - Area
+ */
+#define TEST_PRINTMAN 0x0001
+#define TEST_GDI 0x0002
+
+
+/* lParam defines - Details (in LOWORD)
+ */
+#define TEST_PRINTJOB_START 0x0001 /* when bits start going to the port */
+#define TEST_PRINTJOB_END 0x0002 /* when bits stop going to the port */
+#define TEST_QUEUE_READY 0x0003 /* when the queue is ready to accept a job */
+#define TEST_QUEUE_EMPTY 0x0004 /* when the last job is done being sent */
+
+#define TEST_START_DOC 0x0001 /* print job is started */
+#define TEST_END_DOC 0x0002 /* print job is ended */
+
+
+/* Defines for UserSeeUserDo and GDISeeGDIDo functions
+ */
+LONG API UserSeeUserDo(WORD wMsg, WORD wParam, LONG lParam);
+LONG API GDISeeGDIDo(WORD wMsg, WORD wParam, LONG lParam);
+
+/* Defines for the various messages one can pass for the SeeDo functions.
+ */
+#define SD_LOCALALLOC 0x0001 /* Alloc using flags wParam and lParam bytes.
+ * Returns handle to data.
+ */
+#define SD_LOCALFREE 0x0002 /* Free the memory allocated by handle wParam
+ */
+#define SD_LOCALCOMPACT 0x0003 /* Return the number of free bytes available
+ */
+#define SD_GETUSERMENUHEAP 0x0004 /* Return the handle to the far menu heap
+ * maintained by user.
+ */
+#define SD_GETCLASSHEADPTR 0x0005 /* Return the near pointer to the head of
+ * the linked list of CLS structures.
+ * Interface: wParam = NULL; lParam = NULL;
+ */
diff --git a/private/mvdm/wow16/inc/time.h b/private/mvdm/wow16/inc/time.h
new file mode 100644
index 000000000..565ae77e4
--- /dev/null
+++ b/private/mvdm/wow16/inc/time.h
@@ -0,0 +1,118 @@
+/***
+*time.h - definitions/declarations for time routines
+*
+* Copyright (c) 1985-1990, Microsoft Corporation. All rights reserved.
+*
+*Purpose:
+* This file contains the various declarations and definitions
+* for the time routines.
+* [ANSI/System V]
+*
+****/
+
+#if defined(_DLL) && !defined(_MT)
+#error Cannot define _DLL without _MT
+#endif
+
+#ifdef _MT
+#define _FAR_ _far
+#else
+#define _FAR_
+#endif
+
+/* implementation defined time types */
+
+#ifndef _TIME_T_DEFINED
+typedef long time_t;
+#define _TIME_T_DEFINED
+#endif
+
+#ifndef _CLOCK_T_DEFINED
+typedef long clock_t;
+#define _CLOCK_T_DEFINED
+#endif
+
+#ifndef _SIZE_T_DEFINED
+typedef unsigned int size_t;
+#define _SIZE_T_DEFINED
+#endif
+
+/* structure for use with localtime(), gmtime(), etc. */
+
+#ifndef _TM_DEFINED
+struct tm {
+ int tm_sec; /* seconds after the minute - [0,59] */
+ int tm_min; /* minutes after the hour - [0,59] */
+ int tm_hour; /* hours since midnight - [0,23] */
+ int tm_mday; /* day of the month - [1,31] */
+ int tm_mon; /* months since January - [0,11] */
+ int tm_year; /* years since 1900 */
+ int tm_wday; /* days since Sunday - [0,6] */
+ int tm_yday; /* days since January 1 - [0,365] */
+ int tm_isdst; /* daylight savings time flag */
+ };
+#define _TM_DEFINED
+#endif
+
+
+/* define NULL pointer value */
+
+#ifndef NULL
+#if (_MSC_VER >= 600)
+#define NULL ((void *)0)
+#elif (defined(M_I86SM) || defined(M_I86MM))
+#define NULL 0
+#else
+#define NULL 0L
+#endif
+#endif
+
+
+/* clock ticks macro - ANSI version */
+
+#define CLOCKS_PER_SEC 1000
+
+/* clock ticks macro - archaic version */
+
+#define CLK_TCK 1000
+
+
+/* extern declarations for the global variables used by the ctime family of
+ * routines.
+ */
+
+#ifdef _DLL
+extern int _FAR_ _cdecl daylight; /* non-zero if daylight savings time is used */
+extern long _FAR_ _cdecl timezone; /* difference in seconds between GMT and local time */
+extern char _FAR_ * _FAR_ _cdecl tzname[2]; /* standard/daylight savings time zone names */
+#else
+extern int _near _cdecl daylight; /* non-zero if daylight savings time is used */
+extern long _near _cdecl timezone; /* difference in seconds between GMT and local time */
+extern char * _near _cdecl tzname[2]; /* standard/daylight savings time zone names */
+#endif
+
+
+/* function prototypes */
+
+#ifdef _MT
+double _FAR_ _pascal difftime(time_t, time_t);
+#else
+double _FAR_ _cdecl difftime(time_t, time_t);
+#endif
+
+char _FAR_ * _FAR_ _cdecl asctime(const struct tm _FAR_ *);
+char _FAR_ * _FAR_ _cdecl ctime(const time_t _FAR_ *);
+#ifndef _WINDLL
+clock_t _FAR_ _cdecl clock(void);
+#endif
+struct tm _FAR_ * _FAR_ _cdecl gmtime(const time_t _FAR_ *);
+struct tm _FAR_ * _FAR_ _cdecl localtime(const time_t _FAR_ *);
+time_t _FAR_ _cdecl mktime(struct tm _FAR_ *);
+#ifndef _WINDLL
+size_t _FAR_ _cdecl strftime(char _FAR_ *, size_t, const char _FAR_ *,
+ const struct tm _FAR_ *);
+#endif
+char _FAR_ * _FAR_ _cdecl _strdate(char _FAR_ *);
+char _FAR_ * _FAR_ _cdecl _strtime(char _FAR_ *);
+time_t _FAR_ _cdecl time(time_t _FAR_ *);
+void _FAR_ _cdecl tzset(void);
diff --git a/private/mvdm/wow16/inc/userproc.h b/private/mvdm/wow16/inc/userproc.h
new file mode 100644
index 000000000..04c9d0152
--- /dev/null
+++ b/private/mvdm/wow16/inc/userproc.h
@@ -0,0 +1,38 @@
+/*
+ *
+ * UserProc.H
+ *
+ * Addition exports from USER.EXE
+ */
+
+/* lParam of WM_DROPOBJECT and WM_QUERYDROPOBJECT points to one of these.
+ */
+typedef struct _dropstruct
+ {
+ HWND hwndSource;
+ HWND hwndSink;
+ WORD wFmt;
+ LPARAM dwData;
+ POINT ptDrop;
+ LPARAM dwControlData;
+ } DROPSTRUCT;
+
+#define DOF_EXECUTABLE 0x8001
+#define DOF_DOCUMENT 0x8002
+#define DOF_DIRECTORY 0x8003
+#define DOF_MULTIPLE 0x8004
+
+typedef DROPSTRUCT FAR * LPDROPSTRUCT;
+
+WORD FAR PASCAL GetInternalWindowPos(HWND,LPRECT,LPPOINT);
+BOOL FAR PASCAL SetInternalWindowPos(HWND,WORD,LPRECT,LPPOINT);
+
+void FAR PASCAL CalcChildScroll(HWND,WORD);
+void FAR PASCAL ScrollChildren(HWND,WORD,WORD,LONG);
+
+LRESULT FAR PASCAL DragObject(HWND hwndParent, HWND hwndFrom, WORD wFmt,
+ LPARAM dwData, HANDLE hCursor);
+BOOL FAR PASCAL DragDetect(HWND hwnd, POINT pt);
+
+void FAR PASCAL FillWindow(HWND hwndBrush, HWND hwndPaint, HDC hdc,
+ HBRUSH hBrush);
diff --git a/private/mvdm/wow16/inc/ver.h b/private/mvdm/wow16/inc/ver.h
new file mode 100644
index 000000000..cc8f0501e
--- /dev/null
+++ b/private/mvdm/wow16/inc/ver.h
@@ -0,0 +1,255 @@
+/*****************************************************************************\
+* *
+* ver.h - Version management functions, types, and definitions *
+* *
+* Include file for VER.DLL and VER.LIB. These libraries are *
+* designed to allow version stamping of Windows executable files*
+* and of special .VER files for DOS executable files. *
+* *
+* The API is unchanged for LIB and DLL versions. *
+* *
+* Copyright (c) 1992, Microsoft Corp. All rights reserved *
+* *
+*******************************************************************************
+*
+* #define LIB - To be used with VER.LIB (default is for VER.DLL)
+*
+\*****************************************************************************/
+
+#ifndef _INC_VER
+#define _INC_VER
+
+#ifndef RC_INVOKED
+#pragma pack(1) /* Assume byte packing throughout */
+#endif /* RC_INVOKED */
+
+#ifdef __cplusplus
+extern "C" { /* Assume C declarations for C++ */
+#endif /* __cplusplus */
+
+/*
+ * If .lib version is being used, declare types used in this file.
+ */
+#ifdef LIB
+
+#ifndef WINAPI /* don't declare if they're already declared */
+#define WINAPI _far _pascal
+#define NEAR _near
+#define FAR _far
+#define PASCAL _pascal
+typedef int BOOL;
+#define TRUE 1
+#define FALSE 0
+typedef unsigned char BYTE;
+typedef unsigned short WORD;
+typedef unsigned int UINT;
+typedef signed long LONG;
+typedef unsigned long DWORD;
+typedef char far* LPSTR;
+typedef const char far* LPCSTR;
+typedef int HFILE;
+#define OFSTRUCT void /* Not used by the .lib version */
+#define LOWORD(l) ((WORD)(l))
+#define HIWORD(l) ((WORD)(((DWORD)(l) >> 16) & 0xFFFF))
+#define MAKEINTRESOURCE(i) (LPSTR)((DWORD)((WORD)(i)))
+#endif /* WINAPI */
+
+#else /* LIB */
+
+/* If .dll version is being used and we're being included with
+ * the 3.0 windows.h, #define compatible type aliases.
+ * If included with the 3.0 windows.h, #define compatible aliases
+ */
+#ifndef _INC_WINDOWS
+#define UINT WORD
+#define LPCSTR LPSTR
+#define HFILE int
+#endif /* !_INC_WINDOWS */
+
+#endif /* !LIB */
+
+/* ----- RC defines ----- */
+#ifdef RC_INVOKED
+#define ID(id) id
+#else
+#define ID(id) MAKEINTRESOURCE(id)
+#endif
+
+/* ----- Symbols ----- */
+#define VS_FILE_INFO ID(16) /* Version stamp res type */
+#define VS_VERSION_INFO ID(1) /* Version stamp res ID */
+#define VS_USER_DEFINED ID(100) /* User-defined res IDs */
+
+/* ----- VS_VERSION.dwFileFlags ----- */
+#define VS_FFI_SIGNATURE 0xFEEF04BDL
+#define VS_FFI_STRUCVERSION 0x00010000L
+#define VS_FFI_FILEFLAGSMASK 0x0000003FL
+
+/* ----- VS_VERSION.dwFileFlags ----- */
+#define VS_FF_DEBUG 0x00000001L
+#define VS_FF_PRERELEASE 0x00000002L
+#define VS_FF_PATCHED 0x00000004L
+#define VS_FF_PRIVATEBUILD 0x00000008L
+#define VS_FF_INFOINFERRED 0x00000010L
+#define VS_FF_SPECIALBUILD 0x00000020L
+
+/* ----- VS_VERSION.dwFileOS ----- */
+#define VOS_UNKNOWN 0x00000000L
+#define VOS_DOS 0x00010000L
+#define VOS_OS216 0x00020000L
+#define VOS_OS232 0x00030000L
+#define VOS_NT 0x00040000L
+
+#define VOS__BASE 0x00000000L
+#define VOS__WINDOWS16 0x00000001L
+#define VOS__PM16 0x00000002L
+#define VOS__PM32 0x00000003L
+#define VOS__WINDOWS32 0x00000004L
+
+#define VOS_DOS_WINDOWS16 0x00010001L
+#define VOS_DOS_WINDOWS32 0x00010004L
+#define VOS_OS216_PM16 0x00020002L
+#define VOS_OS232_PM32 0x00030003L
+#define VOS_NT_WINDOWS32 0x00040004L
+
+/* ----- VS_VERSION.dwFileType ----- */
+#define VFT_UNKNOWN 0x00000000L
+#define VFT_APP 0x00000001L
+#define VFT_DLL 0x00000002L
+#define VFT_DRV 0x00000003L
+#define VFT_FONT 0x00000004L
+#define VFT_VXD 0x00000005L
+#define VFT_STATIC_LIB 0x00000007L
+
+/* ----- VS_VERSION.dwFileSubtype for VFT_WINDOWS_DRV ----- */
+#define VFT2_UNKNOWN 0x00000000L
+#define VFT2_DRV_PRINTER 0x00000001L
+#define VFT2_DRV_KEYBOARD 0x00000002L
+#define VFT2_DRV_LANGUAGE 0x00000003L
+#define VFT2_DRV_DISPLAY 0x00000004L
+#define VFT2_DRV_MOUSE 0x00000005L
+#define VFT2_DRV_NETWORK 0x00000006L
+#define VFT2_DRV_SYSTEM 0x00000007L
+#define VFT2_DRV_INSTALLABLE 0x00000008L
+#define VFT2_DRV_SOUND 0x00000009L
+#define VFT2_DRV_COMM 0x0000000AL
+
+/* ----- VS_VERSION.dwFileSubtype for VFT_WINDOWS_FONT ----- */
+#define VFT2_FONT_RASTER 0x00000001L
+#define VFT2_FONT_VECTOR 0x00000002L
+#define VFT2_FONT_TRUETYPE 0x00000003L
+
+/* ----- VerFindFile() flags ----- */
+#define VFFF_ISSHAREDFILE 0x0001
+
+#define VFF_CURNEDEST 0x0001
+#define VFF_FILEINUSE 0x0002
+#define VFF_BUFFTOOSMALL 0x0004
+
+/* ----- VerInstallFile() flags ----- */
+#define VIFF_FORCEINSTALL 0x0001
+#define VIFF_DONTDELETEOLD 0x0002
+
+#define VIF_TEMPFILE 0x00000001L
+#define VIF_MISMATCH 0x00000002L
+#define VIF_SRCOLD 0x00000004L
+
+#define VIF_DIFFLANG 0x00000008L
+#define VIF_DIFFCODEPG 0x00000010L
+#define VIF_DIFFTYPE 0x00000020L
+
+#define VIF_WRITEPROT 0x00000040L
+#define VIF_FILEINUSE 0x00000080L
+#define VIF_OUTOFSPACE 0x00000100L
+#define VIF_ACCESSVIOLATION 0x00000200L
+#define VIF_SHARINGVIOLATION 0x00000400L
+#define VIF_CANNOTCREATE 0x00000800L
+#define VIF_CANNOTDELETE 0x00001000L
+#define VIF_CANNOTRENAME 0x00002000L
+#define VIF_CANNOTDELETECUR 0x00004000L
+#define VIF_OUTOFMEMORY 0x00008000L
+
+#define VIF_CANNOTREADSRC 0x00010000L
+#define VIF_CANNOTREADDST 0x00020000L
+
+#define VIF_BUFFTOOSMALL 0x00040000L
+
+#ifndef RC_INVOKED /* RC doesn't need to see the rest of this */
+
+/* ----- Types and structures ----- */
+
+typedef signed short int SHORT;
+
+typedef struct tagVS_FIXEDFILEINFO
+{
+ DWORD dwSignature; /* e.g. 0xfeef04bd */
+ DWORD dwStrucVersion; /* e.g. 0x00000042 = "0.42" */
+ DWORD dwFileVersionMS; /* e.g. 0x00030075 = "3.75" */
+ DWORD dwFileVersionLS; /* e.g. 0x00000031 = "0.31" */
+ DWORD dwProductVersionMS; /* e.g. 0x00030010 = "3.10" */
+ DWORD dwProductVersionLS; /* e.g. 0x00000031 = "0.31" */
+ DWORD dwFileFlagsMask; /* = 0x3F for version "0.42" */
+ DWORD dwFileFlags; /* e.g. VFF_DEBUG | VFF_PRERELEASE */
+ DWORD dwFileOS; /* e.g. VOS_DOS_WINDOWS16 */
+ DWORD dwFileType; /* e.g. VFT_DRIVER */
+ DWORD dwFileSubtype; /* e.g. VFT2_DRV_KEYBOARD */
+ DWORD dwFileDateMS; /* e.g. 0 */
+ DWORD dwFileDateLS; /* e.g. 0 */
+} VS_FIXEDFILEINFO;
+
+/* ----- Function prototypes ----- */
+
+UINT WINAPI VerFindFile(UINT uFlags, LPCSTR szFileName,
+ LPCSTR szWinDir, LPCSTR szAppDir,
+ LPSTR szCurDir, UINT FAR* lpuCurDirLen,
+ LPSTR szDestDir, UINT FAR* lpuDestDirLen);
+
+DWORD WINAPI VerInstallFile(UINT uFlags,
+ LPCSTR szSrcFileName, LPCSTR szDestFileName, LPCSTR szSrcDir,
+ LPCSTR szDestDir, LPCSTR szCurDir, LPSTR szTmpFile, UINT FAR* lpuTmpFileLen);
+
+/* Returns size of version info in bytes */
+DWORD WINAPI GetFileVersionInfoSize(
+ LPCSTR lpstrFilename, /* Filename of version stamped file */
+ DWORD FAR *lpdwHandle); /* Information for use by GetFileVersionInfo */
+
+/* Read version info into buffer */
+BOOL WINAPI GetFileVersionInfo(
+ LPCSTR lpstrFilename, /* Filename of version stamped file */
+ DWORD dwHandle, /* Information from GetFileVersionSize */
+ DWORD dwLen, /* Length of buffer for info */
+ void FAR* lpData); /* Buffer to place the data structure */
+
+/* Returns size of resource in bytes */
+DWORD WINAPI GetFileResourceSize(
+ LPCSTR lpstrFilename, /* Filename of version stamped file */
+ LPCSTR lpstrResType, /* Type: normally VS_FILE_INFO */
+ LPCSTR lpstrResID, /* ID: normally VS_VERSION_INFO */
+ DWORD FAR *lpdwFileOffset); /* Returns file offset of resource */
+
+/* Reads file resource into buffer */
+BOOL WINAPI GetFileResource(
+ LPCSTR lpstrFilename, /* Filename of version stamped file */
+ LPCSTR lpstrResType, /* Type: normally VS_FILE_INFO */
+ LPCSTR lpstrResID, /* ID: normally VS_VERSION_INFO */
+ DWORD dwFileOffset, /* File offset or NULL */
+ DWORD dwResLen, /* Length of resource to read or NULL */
+ void FAR* lpData); /* Pointer to data buffer */
+
+UINT WINAPI VerLanguageName(UINT wLang, LPSTR szLang, UINT nSize);
+
+UINT WINAPI GetWindowsDir(LPCSTR szAppDir, LPSTR lpBuffer, int nSize);
+
+UINT WINAPI GetSystemDir(LPCSTR szAppDir, LPSTR lpBuffer, int nSize);
+
+BOOL WINAPI VerQueryValue(const void FAR* pBlock, LPCSTR lpSubBlock,
+ void FAR* FAR* lplpBuffer, UINT FAR* lpuLen);
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#pragma pack()
+
+#endif /* !RC_INVOKED */
+#endif /* !_INC_VER */
diff --git a/private/mvdm/wow16/inc/version.h b/private/mvdm/wow16/inc/version.h
new file mode 100644
index 000000000..3219b33a7
--- /dev/null
+++ b/private/mvdm/wow16/inc/version.h
@@ -0,0 +1,64 @@
+/****************************************************************************
+ * *
+ * VERSION.H -- Version information for internal builds *
+ * *
+ * This file is only modified by the official builder to update the *
+ * VERSION, VER_PRODUCTVERSION and VER_PRODUCTVERSION_STR values *
+ * *
+ ****************************************************************************/
+
+#ifndef VS_FF_DEBUG
+/* ver.h defines constants needed by the VS_VERSION_INFO structure */
+#include <ver.h>
+#endif
+
+/*--------------------------------------------------------------*/
+/* the following entry should be phased out in favor of */
+/* VER_PRODUCTVERSION_STR, but is used in the shell today. */
+/*--------------------------------------------------------------*/
+
+
+/*--------------------------------------------------------------*/
+/* the following values should be modified by the official */
+/* builder for each build */
+/*--------------------------------------------------------------*/
+
+#define VERSION "3.1"
+#define VER_PRODUCTVERSION_STR "3.10\0"
+#define VER_PRODUCTVERSION 3,10,0,103
+
+/*--------------------------------------------------------------*/
+/* the following section defines values used in the version */
+/* data structure for all files, and which do not change. */
+/*--------------------------------------------------------------*/
+
+/* default is nodebug */
+#ifndef DEBUG
+#define VER_DEBUG 0
+#else
+#define VER_DEBUG VS_FF_DEBUG
+#endif
+
+/* default is privatebuild */
+#ifndef OFFICIAL
+#define VER_PRIVATEBUILD VS_FF_PRIVATEBUILD
+#else
+#define VER_PRIVATEBUILD 0
+#endif
+
+/* default is prerelease */
+#ifndef FINAL
+#define VER_PRERELEASE VS_FF_PRERELEASE
+#else
+#define VER_PRERELEASE 0
+#endif
+
+#define VER_FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
+#define VER_FILEOS VOS_DOS_WINDOWS16
+#define VER_FILEFLAGS (VER_PRIVATEBUILD|VER_PRERELEASE|VER_DEBUG)
+
+#define VER_COMPANYNAME_STR "Microsoft Corporation\0"
+#define VER_PRODUCTNAME_STR "Microsoft\256 Windows(TM) Operating System\0"
+#define VER_LEGALTRADEMARKS_STR \
+"Microsoft\256 is a registered trademark of Microsoft Corporation. Windows(TM) is a trademark of Microsoft Corporation.\0"
+
diff --git a/private/mvdm/wow16/inc/w32sys.h b/private/mvdm/wow16/inc/w32sys.h
new file mode 100644
index 000000000..425bdba76
--- /dev/null
+++ b/private/mvdm/wow16/inc/w32sys.h
@@ -0,0 +1,24 @@
+/*************************************************************************\
+* w32sys.h
+*
+* Win32S i/f
+*
+* 11-18-91 AviN Created
+\*************************************************************************/
+
+#ifndef APIENTRY
+#define APIENTRY _far _pascal _loadds
+#endif
+
+HANDLE APIENTRY GetPEResourceTable(WORD hFile);
+HANDLE APIENTRY LoadPEResource(HANDLE hFile, LPSTR lpResTable, LPSTR lpId, LPSTR lpType);
+WORD APIENTRY GetW32SysVersion(VOID);
+BOOL APIENTRY GetPEExeInfo(LPSTR lpFileName, LPSTR lpBuff, WORD cbBuff, WORD iInfo);
+WORD APIENTRY ExecPE(LPSTR lpPath, LPSTR lpCmd, WORD nCmdShow);
+BOOL APIENTRY IsPEFormat(LPSTR lpFileName, WORD hFile);
+
+/*
+ * Constants for GetPEExeInfo iInfo parameter
+ */
+#define GPEI_MODNAME 1
+#define GPEI_DESCRIPTION 2
diff --git a/private/mvdm/wow16/inc/wfwnet.h b/private/mvdm/wow16/inc/wfwnet.h
new file mode 100644
index 000000000..4848062ff
--- /dev/null
+++ b/private/mvdm/wow16/inc/wfwnet.h
@@ -0,0 +1,72 @@
+
+/*
+ * Windows/Network Interface
+ * Copyright (C) Microsoft 1989-1992
+ *
+ * Standard WINNET Driver Header File, spec version 3.10
+ * rev. 3.10.05 ;Internal
+ */
+
+
+#ifndef _INC_WFWNET
+#define _INC_WFWNET /* #defined if windows.h has been included */
+
+#ifndef RC_INVOKED
+#pragma pack(1) /* Assume byte packing throughout */
+#endif /* RC_INVOKED */
+
+#ifdef __cplusplus
+extern "C" { /* Assume C declarations for C++ */
+#endif /* __cplusplus */
+
+
+#define CHAR char
+#define SHORT short
+#define LONG long
+
+typedef WORD far * LPWORD;
+
+typedef unsigned char UCHAR;
+typedef unsigned short USHORT;
+typedef unsigned long ULONG;
+
+typedef unsigned short SHANDLE;
+typedef void far *LHANDLE;
+
+typedef unsigned char far *PSZ;
+typedef unsigned char near *NPSZ;
+
+typedef unsigned char far *PCH;
+typedef unsigned char near *NPCH;
+
+typedef UCHAR FAR *PUCHAR;
+typedef USHORT FAR *PUSHORT;
+typedef ULONG FAR *PULONG;
+
+
+#ifndef DRIVDATA
+/* structure for Device Driver data */
+
+typedef struct _DRIVDATA { /* driv */
+ LONG cb;
+ LONG lVersion;
+ CHAR szDeviceName[32];
+ CHAR abGeneralData[1];
+} DRIVDATA;
+typedef DRIVDATA far *PDRIVDATA;
+#endif
+
+#ifndef API
+#define API WINAPI
+#endif
+
+#ifndef RC_INVOKED
+#pragma pack() /* Revert to default packing */
+#endif /* RC_INVOKED */
+
+#ifdef __cplusplus
+} /* End of extern "C" { */
+#endif /* __cplusplus */
+
+#endif /* _INC_WFWNET */
+
diff --git a/private/mvdm/wow16/inc/wife.h b/private/mvdm/wow16/inc/wife.h
new file mode 100644
index 000000000..7b1e51510
--- /dev/null
+++ b/private/mvdm/wow16/inc/wife.h
@@ -0,0 +1,1103 @@
+/****************************************************************************\
+*
+* WIFE.H : Far East Windows Intelligent Font Environment definitions
+*
+******************************************************************************
+*
+* History:
+* 21-Oct-1991 bent
+* initial merge of Far East 3.0 versions
+* Should be updated to resolve local inconsistencies.
+*
+* Copyright (c) 1990 Microsoft Corporation
+*
+* Brief instruction
+* -----------------
+*
+* This header file is a common single header for WIFE drivers. *
+* If you are a developer of FontDriver, please write coding as follow *
+*
+* #define WIFE_CREATE_FONTDRIVER *
+* #include <wife.h> *
+*
+* If you are a developer of DeviceDriver which are display or printer
+* drivers, please write coding as follow. *
+*
+* #define WIFE_CREATE_DEVICEDRIVER *
+* #include <wife.h> *
+*
+* If you don't define both of symbols, only common defenitions are
+* available.
+*
+* Aug.17,1990 Akira Kawamata [AkiraK] *
+*
+\****************************************************************************/
+
+/****** OS/2-like common data type definitions ******************************/
+
+#ifndef WIFEH_NODATATYPES
+typedef unsigned short int USHORT;
+typedef short int SHORT;
+typedef unsigned long ULONG;
+typedef LONG FAR * LPLONG;
+typedef LONG NEAR * NPLONG;
+typedef ULONG FAR * LPULONG;
+typedef ULONG NEAR * NPULONG;
+typedef SHORT FAR * LPSHORT;
+typedef SHORT NEAR * NPSHORT;
+typedef USHORT FAR * LPUSHORT;
+typedef USHORT NEAR * NPUSHORT;
+typedef char CHAR;
+typedef unsigned char UCHAR;
+
+typedef VOID NEAR * NPVOID;
+
+/* FIXED Number */
+typedef struct {
+ USHORT Fraction;
+ SHORT Integer;
+} FIXED;
+#endif //WIFEH_NODATATYPES
+
+/****** Graphics handling support definitions *******************************/
+
+#ifndef WIFEH_NOGRAPHSUPPORT
+/* rotation angle by 90degree */
+typedef enum {
+ ANGLE000 = 0,
+ ANGLE090 = 1,
+ ANGLE180 = 2,
+ ANGLE270 = 3
+} QUOTER_ANGLE;
+#define FixedToQuoterAngle(f) ((f.Integer/90)%4)
+#define RotationToQuoterAngle(r) ((r/900)%4)
+
+typedef DWORD PACKEDPOINT;
+typedef DWORD PACKEDLOGICALPOINT;
+typedef DWORD PACKEDPHYSICALPOINT;
+typedef struct {
+ short x,y;
+} XYPOINT;
+typedef union {
+ PACKEDPOINT packed;
+ XYPOINT point;
+} UNIONPOINT, NEAR * NPUNIONPOINT, FAR * LPUNIONPOINT;
+
+#define PartOfX(xy) ((SHORT)(xy))
+#define PartOfY(xy) ((SHORT)(((DWORD)(xy) >> 16) & 0xFFFF))
+#define MAKELONG_LO_HI MAKELONG
+#define PackXY(x,y) ((DWORD)MAKELONG_LO_HI((WORD)x,(WORD)y))
+#endif //WIFEH_NOGRAPHSUPPORT
+
+/****** UBCS : Unified Byte Character Set, data types defenition **********/
+
+#ifndef WIFEH_NOUBCS
+typedef USHORT UBCHAR;
+typedef UBCHAR NEAR * NPUBCHAR;
+typedef UBCHAR FAR * LPUBCHAR;
+
+#define UBEOS (0) /* End Of String */
+#define UBNEWLINE (0x0a0d) /* New Line (CR/LF) */
+
+#define IsSbcsUBChar(uc) ((uc & 0xff00) == 0x2000)
+#define IsDbcsUBChar(uc) ((uc & 0xff00) != 0x2000)
+#endif //WIFEH_NOUBCS
+
+/****** Utility macros *****************************************************/
+
+#ifndef WIFEH_NOUTILITYMACROS
+/* return type of GlobalLock is LPSTR, but it's to be LPVOID */
+#define AnyGlobalLock(h) ((LPVOID)GlobalLock(h))
+#define AnyLocalLock(h) ((NPVOID)LocalLock(h))
+#define TypedLocalLock(h,t) ((t NEAR *)LocalLock(h))
+#define TypedGlobalLock(h,t) ((t FAR *)GlobalLock(h))
+
+/* utility macro which is not included windows.h */
+#define MAKEWORD(l,h) ((WORD)((BYTE)l+(((BYTE)h) << 8)))
+#endif //WIFEH_NOUTILITYMACROS
+
+/****** GDIDEFS.H support definitions **************************************/
+
+#ifdef WIFE_ENABLE_GDIDEFS_SUPPORT
+typedef FONTINFO FAR * LPFONTINFO;
+typedef DRAWMODE FAR * LPDRAWMODE;
+typedef TEXTXFORM FAR * LPTEXTXFORM;
+#endif //WIFE_ENABLE_GDIDEFS_SUPPORT
+
+/****** Character set definitions ******************************************/
+
+#ifndef WIFEH_NOCHARSET
+typedef enum {
+ CHARSET_ANSI = 0,
+ CHARSET_SYMBOL = 2,
+ CHARSET_SHIFTJIS = 128,
+ CHARSET_KOREA = 129,
+ CHARSET_CHINESEBIG5 = 136,
+ CHARSET_OEM = 255
+} CHAR_SET;
+#endif //WIFEH_NOCHARSET
+
+
+/***************************************************************************/
+/****** Control function support definitions ******************************/
+
+#ifndef WIFEH_NOCONTROL
+
+/******************************************/
+/* FONT DRIVER MEDIA DESCRIPTER */
+/******************************************/
+#ifndef WIFEWH_NOMEDIA
+/* FDMEDIA enumration type */
+typedef enum {
+ FDMEDIA_ON_FILE = 1,
+ FDMEDIA_ON_DRIVER = 2,
+ FDMEDIA_ON_REMOVEABLE_HARDWARE = 4,
+ FDMEDIA_ON_FIXED_HARDWARE = 8,
+ FDMEDIA_UNDEFINED = 0x4000,
+ FDMEDIA_ANY_MEDIA = 0x7fff
+} FDMEDIA;
+#endif
+
+
+/******************************************/
+/* MINOR CHARACTER SETS DEFENITION */
+/******************************************/
+#ifndef WIFEH_NOMINORCHARSET_IN_JAPAN
+
+/* general default minor character set */
+#define FD_MINOR_CHARSET_DEFAULT 1
+
+/* Minor Character Set in Japan */
+#define FD_MINOR_CHARSET_NEW_JIS 1 /* new JIS */
+#define FD_MINOR_CHARSET_OLD_JIS 2 /* old JIS */
+#define FD_MINOR_CHARSET_IBM_JIS 4 /* IBM JIS */
+#define FD_MINOR_CHARSET_NEC_JIS 8 /* NEC JIS */
+
+#endif
+
+/******************************************/
+/* CODE AREA STRUCTURE */
+/******************************************/
+#ifndef WIFEH_NOCODEAREA
+
+typedef struct {
+ UBCHAR CodeFrom;
+ UBCHAR CodeTo;
+} CODEAREA, NEAR * NPCODEAREA, FAR * LPCODEAREA;
+
+#endif
+
+/******************************************/
+/* SPECIAL ESCAPE FUNCTION ORDERS */
+/******************************************/
+
+/* subfunction orders in WIFE */
+#define FD_CONTROL_RESERVED (0xa20)
+#define FD_CONTROL_RESERVED_LIMIT (FD_CONTROL_RESERVED+0x3f)
+
+/* standard subfunctions */
+#define FD_CONTROL_QUERY_ESC_SUPPORT (FD_CONTROL_RESERVED+0)
+#define FD_CONTROL_SUPPORT_CODES (FD_CONTROL_RESERVED+1)
+#define FD_CONTROL_NUMBER_OF_ATTRIBUTE (FD_CONTROL_RESERVED+2)
+#define FD_CONTROL_NAME_OF_ATTRIBUTE (FD_CONTROL_RESERVED+3)
+#define FD_CONTROL_SET_ATTRIBUTE (FD_CONTROL_RESERVED+4)
+#define FD_CONTROL_GET_ATTRIBUTE (FD_CONTROL_RESERVED+5)
+#define FD_CONTROL_SET_MINOR_CHARSET (FD_CONTROL_RESERVED+6)
+#define FD_CONTROL_GET_MINOR_CHARSET (FD_CONTROL_RESERVED+7)
+#define FD_CONTROL_GET_FONT_DRIVER_NAME (FD_CONTROL_RESERVED+8)
+#define FD_CONTROL_GET_FONT_PACK_NAME (FD_CONTROL_RESERVED+9)
+#define FD_CONTROL_GET_MEDIA (FD_CONTROL_RESERVED+10)
+#define FD_CONTROL_GET_DBCS_STRING_KERN (FD_CONTROL_RESERVED+11)
+
+/* EUDC related subfunctions */
+#define FD_CONTROL_LEVEL2_EUDC_INFO (FD_CONTROL_RESERVED+12)
+
+/* private interface subfunctions */
+#define FD_CONTROL_USER (FD_CONTROL_RESERVED+0x10)
+#define FD_CONTROL_USER_LIMIT (FD_CONTROL_RESERVED+0x1f)
+
+/* Chinese related functions */
+#define FD_CONTROL_GET_USERFONT_TECH (FD_CONTROL_RESERVED+0x20)
+#define FD_CONTROL_SET_USERFONT (FD_CONTROL_RESERVED+0x21)
+#define FD_CONTROL_SETUP_DIALOG (FD_CONTROL_RESERVED+0x22)
+#define FD_CONTROL_SET_DEFAULT_CHAR (FD_CONTROL_RESERVED+0x23)
+
+#ifdef WIFE_ENABLE_EUDC_SUPPORT
+
+typedef struct {
+ ULONG cb; /* length of this structure */
+ BOOL bForceFixedPitch; /* force fixed pitch */
+ BOOL bVerticalFont; /* vertical font flag */
+ FIXED fxCharRot; /* character rotation */
+ FIXED fxInlineDir; /* inline rotation */
+ USHORT usLimitWidth; /* maximum width of cachable */
+ SHORT sFixedASpace; /* font width when bForceFixedPitch is TRUE */
+ USHORT usFixedBSpace; /* font width when bForceFixedPitch is TRUE */
+ SHORT sFixedCSpace; /* font width when bForceFixedPitch is TRUE */
+} EUDC_CONTEXT, NEAR * NPEUDC_CONTEXT, FAR * LPEUDC_CONTEXT;
+
+#endif
+
+#endif
+
+
+#ifndef WIFEH_NOFDCOMMONDEFENITION
+typedef LONG HFF;
+typedef LONG HFC;
+typedef HANDLE HFD;
+typedef HANDLE HFB;
+
+#define FACESIZE 32
+#define GLYPHNAMESIZE 16
+
+#define WIFEERR_FACENAME_NOT_FOUND 23004L
+#define WIFEERR_FD_ALREADY_INSTALLED 23005L
+#define WIFEERR_INVALID_CONTEXTINFO 23006L
+#define WIFEERR_NOT_A_FONT_FILE 23007L
+#define WIFEERR_INVALID_FONT_SELECTION 23008L
+#define WIFEERR_INVALID_FORMAT 23009L
+#define WIFEERR_BUSY_HFC 230010L
+#define WIFEERR_INVALID_HFC 230011L
+#define WIFEERR_INVALID_INDEX 230012L
+#define WIFEERR_INVALID_QUERY_TYPE 230013L
+#define WIFEERR_CONTEXT_NOT_SET 230014L
+
+#define FD_QUERY_ABC_WIDTHS 2L
+#define FD_QUERY_KERNINGPAIRS 3L
+
+#define FD_QUERY_CHARIMAGE 1L
+#define FD_QUERY_OUTLINE 2L
+#define FD_QUERY_BITMAPMETRICS 4L
+
+typedef UBCHAR GLYPH; /* gi */
+typedef LPUBCHAR LPGLYPH; /* lpgi */
+
+typedef struct _POINTFX { /* ptfx, npptfx, lpptfx */
+ FIXED x;
+ FIXED y;
+} POINTFX, NEAR * NPPOINTFX, FAR * LPPOINTFX;
+
+typedef struct _ABC_TRIPLETS { /* abc, npabc, lpabc */
+ SHORT sA;
+ USHORT usB;
+ SHORT sC;
+} ABC_TRIPLETS, NEAR * NPABC_TRIPLETS, FAR * LPABC_TRIPLETS;
+
+typedef struct _SIZEL { /* sizl */
+ ULONG cx; // Width.
+ ULONG cy; // Height.
+} SIZEL;
+
+typedef struct _BITMAPMETRICS { /* bmm, npbmm, lpbmm */
+ SIZEL sizlExtent;
+ POINTFX pfxOrigin; /* Return character origin. */
+ POINTFX pfxCharInc; /* Return the device advance width */
+} BITMAPMETRICS, NEAR * NPBITMAPMETRICS, FAR * LPBITMAPMETRICS;
+
+typedef struct _MAT2 { /* mat */
+ FIXED eM11;
+ FIXED eM12;
+ FIXED eM21;
+ FIXED eM22;
+} MAT2;
+
+typedef struct _FD_KERNINGPAIRS { /* krnpr, npkrnpr, lpkrnpr */
+ GLYPH giFirst;
+ GLYPH giSecond;
+ LONG eKerningAmount;
+} FD_KERNINGPAIRS, NEAR * NPFD_KERNINGPAIRS, FAR * LPFD_KERNINGPAIRS;
+
+
+typedef struct _CONTEXTINFO { /* ci */
+ ULONG cb; /* Length in bytes of this structure. */
+ ULONG fl; /* Flags. */
+ SIZEL sizlPPM; /* Device resolution in pels/meter. */
+ POINTFX pfxSpot; /* Spot size in pels. */
+ MAT2 matXform; /* Notional to Device transform. */
+} CONTEXTINFO, NEAR * NPCONTEXTINFO, FAR * LPCONTEXTINFO;
+
+
+typedef struct _CHARATTR { /* chattr */
+ ULONG cb;
+ ULONG iQuery; /* Query type. */
+ GLYPH gi; /* Glyph index in font. */
+ LPBYTE lpBuffer; /* Bitmap buffer. */
+ ULONG cbLen; /* Size of buffer in bytes. */
+} CHARATTR, NEAR * NPCHARATTR, FAR * LPCHARATTR;
+
+
+/* bit-constants for fsType in IFIMETRICS */
+
+#define IFIMETRICS_FIXED 0x0001 /* Fixed pitch */
+#define IFIMETRICS_LICENSED 0x0002 /* dummy defenition */
+#define IFIMETRICS_SPARSE 0x0004 /* Incomplete font */
+#define IFIMETRICS_SCALEABLE 0x8000 /* scalable font */
+
+/* bit-constant for fsDefn in IFIMETRICS */
+
+#define IFIMETRICS_OUTLINE 0x0001 /* dummy definition */
+ /* 1 - Outline. 0 - Raster */
+
+/* bit-constant for fsSelection in IFIMETRICS */
+
+#define IFIMETRICS_ITALIC 0x8000 /*Italic */
+#define IFIMETRICS_UNDERSCORE 0x4000 /*Underscored */
+#define IFIMETRICS_OVERSTRUCK 0x2000 /*Overstruck */
+
+/* bit-constant for fsSelection in IFIMETRICS valid for bitmap fonts */
+
+#define IFIMETRICS_NEGATIVE 0x1000 /*Negative image */
+#define IFIMETRICS_HOLLOW 0x0800 /*Outline (hollow) */
+
+
+typedef struct _IFIMETRICS { /* ifim */
+ /* UNITS */
+ UCHAR szFamilyname[FACESIZE]; /*Font Family Name, e.g. Roman */
+ UCHAR szFacename[FACESIZE]; /*Face name, e.g. Tms Rmn Bold Italic */
+ UCHAR szGlyphlistName[GLYPHNAMESIZE]; /*e.g. PM316, Latin-2, Greek */
+ USHORT idRegistry; /*Dummy I */
+ SHORT sCapEmHeight; /*Height of uppercase M N */
+ SHORT sXHeight; /*Nominal height of lowercase N */
+ SHORT sMaxAscender; /*Maximum height above baseline of any char N */
+ SHORT sMaxDescender; /*Maximum depth below baseline of any char N */
+ SHORT sLowerCaseAscent; /*Maximum height above baseline of any a-z N */
+ SHORT sLowerCaseDescent; /*Maximum depth below basiline of any a-z N */
+ SHORT sInternalLeading; /*White space within character N */
+ SHORT sExternalLeading; /*White space between lines N */
+ SHORT sAveCharWidth; /*Weighted average character width N */
+ SHORT sMaxCharInc; /*Maximum character increment N */
+ SHORT sEmInc; /*Increment for Capitals (typically 'M') N */
+ SHORT sMaxBaselineExt; /*Height of character cell N */
+ FIXED fxCharSlope; /*Slope angle, degrees, clockwise D */
+ FIXED fxInlineDir; /*Drawing direction, degrees clockwise D */
+ FIXED fxCharRot; /*Glyph rotation in cell, degrees clockwise D */
+ USHORT usWeightClass; /*Character weight, 1-9 (1=ultra-light) I */
+ USHORT usWidthClass; /*Character width, 1-9 (1=ultra condensed) I */
+ SHORT sEmSquareSize; /*Em Square size, x-direction N */
+ GLYPH giFirstChar; /*Number of first glyph in font I */
+ GLYPH giLastChar; /*Number of last glyph in font I */
+ GLYPH giDefaultChar; /*Glyph used if requested glyph invalid I */
+ GLYPH giBreakChar; /*Space glyph I */
+ ULONG aulPanose [1]; /*Panose Number */
+ USHORT usNominalPointSize; /*Point size for which font was designed N */
+ USHORT usMinimumPointSize; /*Minimum point size scaling for font N */
+ USHORT usMaximumPointSize; /*Maximum point size scaling for font N */
+ USHORT fsType; /*Type indicators (see #defines) B */
+ USHORT fsDefn; /*Font definition data (see #defines) B */
+ USHORT fsSelection; /*Font selection flags (see #defines) B */
+ USHORT fsCapabilities; /*Font capabilities must be 0 B */
+ SHORT sSubscriptXSize; /*Size in x-direction of subscript N */
+ SHORT sSubscriptYSize; /*Size in y-direction of subscript N */
+ SHORT sSubscriptXOffset; /*Offset in x-direction of subscript N */
+ SHORT sSubscriptYOffset; /*Offset in y-direction of subscript N */
+ SHORT sSuperscriptXSize; /*Size in x-direction of superscript N */
+ SHORT sSuperscriptYSize; /*Size in y-direction of superscript N */
+ SHORT sSuperscriptXOffset; /*Offset in x-direction of superscript N */
+ SHORT sSuperscriptYOffset; /*Offset in y-direction of superscript N */
+ SHORT sUnderscoreSize; /*Underscore size N */
+ SHORT sUnderscorePosition; /*Underscore position N */
+ SHORT sStrikeoutSize; /*Strikeout size N */
+ SHORT sStrikeoutPosition; /*Strikeout position N */
+ SHORT cKerningPairs; /*Number of kerning pairs in pair table I */
+ ULONG ulFontClass; /*IBM font classification B */
+} IFIMETRICS, NEAR * NPIFIMETRICS, FAR * LPIFIMETRICS;
+
+#ifdef ENABLE_CONTROL_TAG
+
+/* Tag structure for Fd(i)Control */
+typedef struct {
+ USHORT SubFunction;
+ LPDEVICE lpDevice;
+ LPFONTINFO lpFontStructure;
+ LPTEXTXFORM lpXform;
+ LPVOID lpInData;
+} CONTROLTAG, FAR * LPCONTROLTAG;
+#else
+typedef struct {
+ USHORT SubFunction;
+ LPVOID lpDevice;
+ LPVOID lpFontStructure;
+ LPVOID lpXform;
+ LPVOID lpInData;
+} CONTROLTAG, FAR * LPCONTROLTAG;
+#endif
+
+#endif
+
+
+/****************************************/
+/* Attribute bits for FdOpenFontContext */
+/****************************************/
+#ifndef WIFEH_NOWIFEMAN_EUDCFONTCONTEXT
+#define OFC_EUDC_CONTEXT (0x80000000L)
+#endif
+
+
+#ifdef WIFE_CREATE_FONTDRIVER
+
+/***********************************************/
+/* PROTO-TYPE FOR EACH FUNCTION in FONT DRIVER */
+/***********************************************/
+
+LONG FAR PASCAL FdClaimFontFile( LPSTR lpszFileName );
+
+LONG FAR PASCAL FdConvertFontFile(
+ LPSTR lpszSrcFileName,
+ LPSTR lpszDestDirName,
+ LPSTR lpszResultPackName
+);
+HFF FAR PASCAL FdLoadFontFile( LPSTR lpszPackName );
+
+LONG FAR PASCAL FdUnloadFontFile( HFF hFF );
+
+LONG FAR PASCAL FdQueryFaces(
+ HFF hFF,
+ LPIFIMETRICS lpIfiMetrics,
+ ULONG cMetricLen,
+ ULONG cFontCount,
+ ULONG cStart
+);
+
+HFC FAR PASCAL FdOpenFontContext( HFF hFF, ULONG ulFont );
+
+LONG FAR PASCAL FdSetFontContext(
+ HFC hFC,
+ LPCONTEXTINFO lpContextInfo
+);
+
+LONG FAR PASCAL FdCloseFontContext( HFC hFC );
+
+LONG FAR PASCAL FdQueryFaceAttr(
+ HFC hFC,
+ ULONG iQuery,
+ LPVOID lpBuffer,
+ ULONG cb,
+ LPVOID lpIndex,
+ SHORT Start
+);
+
+LONG FAR PASCAL FdQueryCharAttr(
+ HFC hFC,
+ LPCHARATTR lpCharAttr,
+ LPBITMAPMETRICS lpbmm
+);
+
+SHORT FAR PASCAL FdControl(
+ HFC hFC,
+ LPCONTROLTAG lpControlTag,
+ LPVOID lpOutData
+);
+
+
+/******************************************/
+/* FAR PTR TO EACH FUNCTION */
+/******************************************/
+typedef LONG (FAR PASCAL * LPFDCLF)( LPSTR lpszFileName );
+
+typedef LONG (FAR PASCAL * LPFDCFF)(
+ LPSTR lpszSrcFileName,
+ LPSTR lpszDestDirName,
+ LPSTR lpszResultPackName
+);
+
+typedef HFF (FAR PASCAL * LPFDLFF)( LPSTR lpszPackName );
+
+typedef LONG (FAR PASCAL * LPFDQF)(
+ HFF hFF,
+ LPIFIMETRICS lpIfiMetrics,
+ ULONG cMetricLen,
+ ULONG cFontCount,
+ ULONG cStart
+);
+
+typedef LONG (FAR PASCAL * LPFDUFF)( HFF hFF );
+
+typedef HFC (FAR PASCAL * LPFDOFC)( HFF hFF, ULONG ulFont );
+
+typedef LONG (FAR PASCAL * LPFDSFC)(
+ HFC hFC,
+ LPCONTEXTINFO lpContextInfo
+);
+
+typedef LONG (FAR PASCAL * LPFDCFC)( HFC hFC );
+
+typedef LONG (FAR PASCAL * LPFDQFA)(
+ HFC hFC,
+ ULONG iQuery,
+ LPVOID lpBuffer,
+ ULONG cb,
+ LPVOID lpIndex,
+ SHORT Start
+);
+
+typedef LONG (FAR PASCAL * LPFDQCA)(
+ HFC hFC,
+ LPCHARATTR lpCharAttr,
+ LPBITMAPMETRICS lpbmm
+);
+
+typedef SHORT (FAR PASCAL * LPFDCTL)(
+ HFC hFC,
+ LPCONTROLTAG lpControlTag,
+ LPVOID lpOutData
+);
+
+typedef struct _FDHEADER { /* fdhdr */
+ ULONG cbLength; /* Length of FDHEADER */
+ UCHAR strId[16]; /* String 'WIFE FONT DRIVER' */
+ UCHAR szTechnology[40]; /* Identifier of Font Driver technology */
+ ULONG ulVersion; /* IFI version number (0x0100) */
+ ULONG ufDeviceCaps; /* Capabilities of device */
+ NPVOID npfddisp;
+ SHORT dummy1;
+} FDHEADER, NEAR * NPFDHEADER, FAR * LPFDHEADER;
+
+#endif
+
+#ifdef WIFE_CREATE_DEVICEDRIVER
+
+/***********************************************/
+/* PROTO-TYPE FOR EACH FUNCTION in WIFEMAN.DLL */
+/***********************************************/
+
+/***********************************************/
+/* Module Install Manager */
+/***********************************************/
+#ifndef WIFEH_NOWIFEMAN_MIM
+
+typedef BOOL (FAR PASCAL * LPCBMEAD)
+ ( LPSTR lpszFoundFileName, LPSTR lpszDescriptionName );
+BOOL FAR PASCAL MimEnumAvailableDrivers
+ ( LPSTR lpszSeachFilePath, LPCBMEAD lpfCallBack );
+
+typedef BOOL (FAR PASCAL * LPCBMEAP)
+ ( HFD hFD, LPSTR lpszPackName );
+BOOL FAR PASCAL MimEnumAvailablePacks
+ ( HFD hFD, LPSTR lpszPackName, LPCBMEAP lpfCallBack );
+
+HFD FAR PASCAL MimAddFontDriver( LPSTR lpszFileName );
+
+HFF FAR PASCAL MimAddFontPack( HFD hFD, LPSTR lpszPackName );
+
+BOOL FAR PASCAL MimRemoveFontDriver( HFD hFD );
+
+BOOL FAR PASCAL MimRemoveFontPack( HFD hFD, HFF hFontPack );
+
+HFD FAR PASCAL MimEnumFontDrivers( HFD hLastDriver );
+
+HFF FAR PASCAL MimEnumFontPacks( HFD hFD, HFF hLastPack );
+
+HFC FAR PASCAL MimOpenFontContext( HFD hFD, HFF hFF, ULONG ulFont );
+
+LONG FAR PASCAL MimCloseFontContext( HFD hFD, HFF hFF, HFC hFC );
+
+typedef enum {
+ MIMGETINFO_FD_DESCRIPTION = 0,
+ MIMGETINFO_FF_DESCRIPTION = 1,
+ MIMGETINFO_FD_FILENAME = 2,
+ MIMGETINFO_FF_FILENAME = 3,
+ MIMGETINFO_FD_USAGE = 4,
+ MIMGETINFO_FF_USAGE = 5,
+ MIMGETINFO_FD_INSTALL_COUNT = 6,
+ MIMGETINFO_FF_INSTALL_COUNT = 7
+} MIMGETINFO_ORDER;
+
+SHORT FAR PASCAL MimGetInformations(
+ MIMGETINFO_ORDER order,
+ HFD hFD,
+ HFF hFF,
+ LPVOID AnswerBuffer,
+ USHORT SizeOfBuffer
+);
+
+#endif
+
+/***********************************************/
+/* Font Driver Interface */
+/***********************************************/
+#ifndef WIFEH_NOWIFEMAN_FDI
+
+LONG FAR PASCAL FdiClaimFontFile( HFD hFD, LPSTR lpszFileName );
+
+LONG FAR PASCAL FdiConvertFontFile(
+ HFD hFD,
+ LPSTR lpszSrcFileName,
+ LPSTR lpszDestDirName,
+ LPSTR lpszResultPackName
+);
+
+HFF FAR PASCAL FdiLoadFontFile( HFD hFD, LPSTR lpszPackName );
+
+LONG FAR PASCAL FdiUnloadFontFile( HFD hFD, HFF hFF );
+
+LONG FAR PASCAL FdiQueryFaces(
+ HFD hFD,
+ HFF hFF, // Font File handle
+ LPIFIMETRICS lpIfiMetrics, // Buffer for the metrics
+ ULONG cMetricLen, // Length of the metrics structure
+ ULONG cFontCount, // # of fonts wanted.
+ ULONG cStart // index of the font to start with
+);
+
+HFC FAR PASCAL FdiOpenFontContext( HFD hFD, HFF hFF, ULONG ulFont );
+
+LONG FAR PASCAL FdiSetFontContext(
+ HFD hFD,
+ HFC hFC,
+ LPCONTEXTINFO lpContextInfo
+);
+
+LONG FAR PASCAL FdiCloseFontContext( HFD hFD, HFC hFC );
+
+LONG FAR PASCAL FdiQueryFaceAttr(
+ HFD hFD,
+ HFC hFC,
+ ULONG iQuery,
+ LPVOID lpBuffer,
+ ULONG cb,
+ LPVOID lpIndex,
+ SHORT Start
+);
+
+LONG FAR PASCAL FdiQueryCharAttr(
+ HFD hFD,
+ HFC hFC,
+ LPCHARATTR lpCharAttr,
+ LPBITMAPMETRICS lpbmm
+);
+
+SHORT FAR PASCAL FdiControl(
+ HFD hFD,
+ HFC hFC,
+ LPCONTROLTAG lpControlTag,
+ LPVOID lpOutData
+);
+
+#endif
+
+/***********************************************/
+/* Font Cacheing Manager */
+/***********************************************/
+#ifdef WIFE_ENABLE_FCM
+
+#define FCM_WIFE_CHARACTER 1
+#define FCM_CLIP_OUT 2
+#define FCM_LEFT_CLIP 0x0100
+#define FCM_RIGHT_CLIP 0x0200
+#define FCM_TOP_CLIP 0x0400
+#define FCM_BOTTOM_CLIP 0x0800
+
+typedef struct {
+ USHORT SizeOfStruct; /* size of structire */
+ WORD WifeFlag; /* FCM processing flags */
+ UBCHAR ubCode; /* character code */
+ LPSTR lpCacheBuffer; /* long ptr to cache bitmap */
+ SHORT nBitWidth; /* x size of character image */
+ SHORT nBitHeight; /* y size of character image */
+ SHORT nByteWidth; /* byte width size in alloctaed buffer */
+ USHORT InternalIndex; /* RESERVED FOR SYSTEM USE */
+} FCM_CHARACTERISTIC, NEAR *NP_FCM_CHARACTERISTIC, FAR *LP_FCM_CHARACTERISTIC;
+
+typedef struct {
+ USHORT SizeOfStruct; /* size of structire */
+ WORD WifeFlag; /* FCM processing flags */
+ UBCHAR ubCode; /* character code */
+ LPSTR lpCacheBuffer; /* long ptr to cache bitmap */
+ SHORT nBitWidth; /* x size of character image */
+ SHORT nBitHeight; /* y size of character image */
+ SHORT nByteWidth; /* byte width size in alloctaed buffer */
+ USHORT InternalIndex; /* RESERVED FOR SYSTEM USE */
+
+ SHORT xPosOnDst; /* x position on dst device */
+ SHORT yPosOnDst; /* y position on dst device */
+
+} FCM_EXTCHARACTERISTIC,
+ NEAR * NP_FCM_EXTCHARACTERISTIC, FAR * LP_FCM_EXTCHARACTERISTIC;
+
+
+HFB FAR PASCAL FcmCreateCacheBuffer(
+ HFD hFD,
+ HFF hFF,
+ ULONG ulFont,
+ LPTEXTXFORM lpXform,
+ USHORT usMinorCharSet,
+ USHORT usAttribute
+);
+
+BOOL FAR PASCAL FcmDeleteCacheBuffer( HFB hFontBuffer );
+
+SHORT FAR PASCAL FcmRequestImages(
+ HFB hFontBuffer,
+ LP_FCM_CHARACTERISTIC AnswerBuffer,
+ short length
+);
+
+BOOL FAR PASCAL FcmReleaseImages(
+ HFB hFontBuffer,
+ LP_FCM_CHARACTERISTIC AnswerBuffer,
+ short length
+);
+
+HFB FAR PASCAL FcmRequestDefaultFB(
+ LPFONTINFO lpFont,
+ LPTEXTXFORM lpTextXform
+);
+
+BOOL FAR PASCAL FcmReleaseDefaultFB( HFB hFB );
+
+#define FCMCALC_BIGFONT 1
+#define FCMCALC_ROUGHCLIPINFO 2
+#define FCMCALC_DETAILCLIPINFO 4
+
+DWORD FAR PASCAL FcmCalculateTextExtent(
+ HFB hFB,
+ LPSTR lpString,
+ short count,
+ LPFONTINFO lpFont,
+ LPDRAWMODE lpDrawMode,
+ LPTEXTXFORM lpXform,
+ LPSHORT lpCharWidths,
+ USHORT usMode
+);
+
+SHORT FAR PASCAL FcmCalculateOutputPositions(
+ HFB hFB,
+ LP_FCM_EXTCHARACTERISTIC lpFcmCharacteristics,
+ SHORT nArrayLength,
+ LPSHORT lpx,
+ LPSHORT lpy,
+ LPRECT lpClipRect,
+ LPSTR FAR * lplpString,
+ LPSHORT lpcount,
+ LPFONTINFO lpFont,
+ LPDRAWMODE lpDrawMode,
+ LPTEXTXFORM lpXform,
+ LPSHORT FAR * lplpCharWidths,
+ USHORT usMode
+);
+
+
+SHORT FAR PASCAL FcmCleanUp( VOID );
+
+HFB FAR PASCAL FcmEnumFontBuffers( HFB hLastBuffer );
+
+HFC FAR PASCAL FcmGetFontContext( HFB hFB );
+
+SHORT FAR PASCAL FcmCalcByteWidth( SHORT nBitWidth );
+
+SHORT FAR PASCAL FcmForceCacheIn( HFB hFB, LPUBCHAR lpubStr );
+
+BOOL FAR PASCAL FcmValidateFC( HFB hFB );
+
+BOOL FAR PASCAL FcmUnvalidateFC( HFB hFB );
+
+LONG FAR PASCAL FcmQueryFaceAttr(
+ HFB hFB,
+ ULONG iQuery,
+ LPABC_TRIPLETS lpBuffer,
+ ULONG cb,
+ LPUBCHAR lpIndex,
+ UBCHAR Start
+);
+
+#ifdef WIFE_ENABLE_FCM_CONTROL
+
+SHORT FAR PASCAL FcmIsProcessableDeviceControl(
+ HFB hFB,
+ SHORT nFunction,
+ GAIJIINFO FAR * lpGI
+);
+
+SHORT FAR PASCAL FcmProcessDeviceControl(
+ HFB hFB,
+ SHORT nFunction,
+ GAIJIINFO FAR * lpGI,
+ LPVOID lpOutData
+);
+
+#endif
+
+USHORT FAR PASCAL FcmGetEUDCLeadByteRange( HFB hFB );
+
+HFB FAR PASCAL FcmGetEUDCFB( HFB hFB );
+
+USHORT FAR PASCAL FcmGetCharWidth(
+ HFB hFB,
+ LPUSHORT lpBuffer,
+ USHORT wFirstChar,
+ USHORT wLastChar,
+ LPFONTINFO lpFont,
+ LPDRAWMODE lpDrawMode,
+ LPTEXTXFORM lpFontTrans,
+ USHORT usExpandPixels,
+ USHORT usMode
+);
+
+#endif
+
+#endif
+
+/***********************************************/
+/* WIFEMAN's Miscellaneous Service Functions */
+/***********************************************/
+#ifndef WIFEH_NOWIFEMAN_MISC
+
+BOOL FAR PASCAL MiscIsDBCSLeadByte( CHAR_SET CharSet, USHORT ch );
+
+#define MiscIsMBCSCharSet(c) (MiscIsDBCSLeadByte(c,0xffff))
+
+VOID FAR PASCAL MiscSetErroInfo( ULONG ErrorCode );
+
+ULONG FAR PASCAL MiscGetErroInfo( VOID );
+
+SHORT FAR PASCAL MiscWarningMessage(
+ HANDLE hInst,
+ USHORT idsMsg,
+ USHORT idsTitle,
+ USHORT mode
+);
+
+SHORT FAR PASCAL MiscWarningMessageWithArgument(
+ HANDLE hInst,
+ USHORT idsMsg,
+ USHORT idsTitle,
+ LPSTR lpszArgument,
+ USHORT mode
+);
+
+#ifdef ENABLE_MESSAGEBOX
+
+/* MessageBox() Flags */
+#define MB_OK 0x0000
+#define MB_OKCANCEL 0x0001
+#define MB_ABORTRETRYIGNORE 0x0002
+#define MB_YESNOCANCEL 0x0003
+#define MB_YESNO 0x0004
+#define MB_RETRYCANCEL 0x0005
+
+#define MB_ICONHAND 0x0010
+#define MB_ICONQUESTION 0x0020
+#define MB_ICONEXCLAMATION 0x0030
+#define MB_ICONASTERISK 0x0040
+
+#define MB_ICONINFORMATION MB_ICONASTERISK
+#define MB_ICONSTOP MB_ICONHAND
+
+#define MB_DEFBUTTON1 0x0000
+#define MB_DEFBUTTON2 0x0100
+#define MB_DEFBUTTON3 0x0200
+
+#define MB_APPLMODAL 0x0000
+#define MB_SYSTEMMODAL 0x1000
+#define MB_TASKMODAL 0x2000
+
+#define MB_NOFOCUS 0x8000
+
+#define MB_TYPEMASK 0x000F
+#define MB_ICONMASK 0x00F0
+#define MB_DEFMASK 0x0F00
+#define MB_MODEMASK 0x3000
+#define MB_MISCMASK 0xC000
+
+#endif /* ENABLE_MESSAGEBOX */
+
+USHORT FAR PASCAL ubstrlen( LPUBCHAR cp );
+
+LPUBCHAR FAR PASCAL ubstrcpy( LPUBCHAR dst, LPUBCHAR src );
+
+LPUBCHAR FAR PASCAL ubstrncpy( LPUBCHAR dst, LPUBCHAR src, USHORT limit );
+
+LPUBCHAR FAR PASCAL ubstrcat( LPUBCHAR dst, LPUBCHAR src );
+
+LPUBCHAR FAR PASCAL ubstrncat( LPUBCHAR dst, LPUBCHAR src, USHORT limit );
+
+SHORT FAR PASCAL ubstrcmp( LPUBCHAR str1, LPUBCHAR str2 );
+
+USHORT FAR PASCAL AscizToUz(
+ LPUBCHAR dst,
+ LPSTR src,
+ USHORT limit,
+ CHAR_SET CharSet
+);
+
+USHORT FAR PASCAL UzToAsciz(
+ LPSTR dst,
+ LPUBCHAR src,
+ USHORT limit
+);
+
+VOID FAR PASCAL MiscTrancateString(
+ LPSTR lpszStr,
+ SHORT length,
+ SHORT CharSet
+);
+
+#define MiscTrancateByDefaultCharSet(s,l) MiscTrancateString(s,l,-1)
+
+ULONG FAR PASCAL MiscGetVersion( VOID );
+
+USHORT FAR PASCAL MiscGetEUDCLeadByteRange( CHAR_SET csCharSet );
+
+BYTE FAR PASCAL MiscConvertFontFamily( LPSTR szFamilyName );
+
+BYTE FAR PASCAL MiscConvertCharSet( LPSTR CharSetString );
+
+#ifdef WIFE_ENABLE_FONT_STRUCT_CONVERT
+
+/* follow two values are only for usLogicalMapFlag parameter */
+/* in MiscIfiMetricsToLogFont function. */
+#define LOGMAP_IGNORE_DESCENT 1
+#define LOGMAP_IGNORE_INTERNAL_LEADING 2
+#define LOGMAP_NEGATIVE (0x8000)
+
+VOID FAR PASCAL MiscIfiMetricsToLogFont(
+ LPLOGFONT lpLogFont,
+ LPIFIMETRICS lpIFIMetrics,
+ USHORT usLogicalMapFlag
+);
+
+VOID FAR PASCAL MiscIfiMetricsToTextMetrics(
+ LPTEXTMETRIC lpTextMetrics,
+ LPIFIMETRICS lpIFIMetrics
+);
+
+#endif
+
+#ifdef WIFE_ENABLE_FONT_STRUCT_MAKE
+
+VOID FAR PASCAL MiscMakeTextXform(
+ LPTEXTXFORM lpTXF,
+ LPIFIMETRICS lpIM,
+ LPLOGFONT lpLF
+);
+
+#endif
+
+#ifndef WIFEH_NO_HUGE_SUPPORT
+LPVOID FAR PASCAL MiscAddHugePtr( LPVOID src, ULONG offset );
+USHORT FAR PASCAL MiscGetSegmentIncrement( VOID );
+#endif
+
+#ifndef WIFEH_NO_CONTROL_RANGES
+BOOL FAR PASCAL MiscIsWifeControl( SHORT function );
+BOOL FAR PASCAL MiscIsGaijiControl( SHORT function );
+#endif
+
+#ifndef WIFEH_NO_STRETCHER
+BOOL FAR PASCAL MiscStretchMonoFontImage(
+ LPVOID lpDestImage,
+ USHORT usSizeOfDestX,
+ USHORT usSizeOfDestY,
+ LPVOID lpSrcImage,
+ USHORT usSizeOfSrcX,
+ USHORT usSizeOfSrcY
+);
+#endif
+
+#ifdef WIFE_ENABLE_QUICK_SEARCH_TABLE
+
+typedef struct {
+ HFD hFD;
+ HFF hFF;
+ ULONG ulFont;
+ BOOL bScalable;
+ LOGFONT LogFont;
+}QUICK_SEARCH_TABLE, NEAR * NP_QUICK_SEARCH_TABLE, FAR * LP_QUICK_SEARCH_TABLE;
+
+LP_QUICK_SEARCH_TABLE FAR PASCAL MiscValidateQuickSearchTable(
+ USHORT usLogicalMapFlag
+);
+
+BOOL FAR PASCAL MiscUnvalidateQuickSearchTable(
+ USHORT usLogicalMapFlag
+);
+
+typedef LP_QUICK_SEARCH_TABLE (FAR PASCAL * LPMISCVALIDATEQST)(
+ USHORT usLogicalMapFlag
+);
+
+typedef BOOL (FAR PASCAL * LPMISCUNVALIDATEQST)(
+ USHORT usLogicalMapFlag
+);
+
+#define NMISCVALIDATEQST (67)
+#define NMISCUNVALIDATEQST (68)
+
+#endif
+
+#ifdef WIFE_ENABLE_NOTIFY_FUNCTIONS
+
+typedef enum {
+ WN_ADD_FONTDRIVER = 0,
+ WN_ADD_FONTPACKAGE = 1,
+ WN_REMOVE_FONTDRIVER = 2,
+ WN_REMOVE_FONTPACKAGE = 3,
+ WN_REGISTER_SYSTEM_EUDC_CHAR = 4,
+ WN_CHANGE_SYSTEM_EUDC_FILE = 5
+} WIFENOTIFY_ORDER;
+
+typedef struct {
+ HFD hTargetFontDriver;
+} WNS_FONTDRIVER;
+
+typedef struct {
+ HFD hTargetFontDriver;
+ HFF hTargetFontPackage;
+} WNS_FONTPACKAGE;
+
+typedef struct {
+ HFD hTargetFontDriver;
+ HFF hTargetFontPackage;
+ UBCHAR ubRegistedCharCode;
+} WNS_REGISTER_SYSTEM_EUDC_CHAR;
+
+typedef struct {
+ HFD hTargetFontDriver;
+ HFF hTargetFontPackage;
+ LPSTR lpszNewFileName;
+} WNS_WN_CHANGE_SYSTEM_EUDC_FILE;
+
+typedef BOOL (FAR PASCAL * LPNOTIFYCALLBACKFUNC)(
+ WIFENOTIFY_ORDER NotifyOrder,
+ LPVOID lpParamBlock
+);
+
+BOOL FAR PASCAL MiscRegisterNotifyFunction(
+ LPNOTIFYCALLBACKFUNC lpfnCallBack
+);
+
+BOOL FAR PASCAL MiscUnregisterNotifyFunction(
+ LPNOTIFYCALLBACKFUNC lpfnCallBack
+);
+
+#endif
+
+#endif
+
+
+/***********************************************/
+/* DIAGNOSTIC TEST&CHECKING FUNCTIONS */
+/***********************************************/
+#ifdef ENABLE_DIAGNOSTIC_FUNCTION
+
+/* test and return error code */
+SHORT FAR PASCAL DiagSelfCheck( VOID );
+
+/* invoke self test and make error record file, display warning dialog */
+SHORT FAR PASCAL DiagSelfCheckAndWarning( VOID );
+
+#endif
+
+
+/************************************************/
+/* THESE ARE PRIVATE INTERFACE FOR TEST PROGRAM */
+/************************************************/
+#ifdef ENABLE_TEST_PROGRAM_INTERFACE
+
+LPVOID FAR PASCAL DiagLocalLockAnything( LOCALHANDLE hAny );
+LPVOID FAR PASCAL DiagLocalUnlockAnything( LOCALHANDLE hAny );
+SHORT FAR PASCAL DiagGetConfirmString( LPSTR buffer, SHORT length );
+
+#endif
+
+/* end of wife.h */
diff --git a/private/mvdm/wow16/inc/win3deb.inc b/private/mvdm/wow16/inc/win3deb.inc
new file mode 100644
index 000000000..faf9579ad
--- /dev/null
+++ b/private/mvdm/wow16/inc/win3deb.inc
@@ -0,0 +1,186 @@
+; declare a simple interface to control debugging messages
+
+BegData macro
+ _DATA SEGMENT PARA PUBLIC 'DATA'
+endm
+
+EndData macro
+ _DATA ENDS
+endm
+
+DEB_ERROR = 1
+DEB_WARN = 2
+DEB_TRACE = 4
+DEB_FERROR = 8 ;; fatal error - terminate app
+DEB_IERROR = 10h
+DEB_IWARN = 20h
+DEB_ITRACE = 40h
+DEB_IFERROR = 80h ;; fatal error - terminate app
+DEB_FERRORS = DEB_FERROR or DEB_IFERROR
+DEB_ERRORS = DEB_ERROR OR DEB_IERROR OR DEB_FERRORS
+DEB_WARNS = DEB_WARN OR DEB_IWARN
+DEB_TRACES = DEB_TRACE OR DEB_ITRACE
+DEB_NOCRLF = 8000h ;; No CR/LF in string
+DEB_BREAKLEVEL = DEB_ERRORS or 0ff00h
+DEB_INFOLEVEL = DEB_BREAKLEVEL or DEB_WARNS
+
+DECLARE_DEBUG macro comp
+
+ ifdef Win3DebData
+ else
+ extrn _Win3InfoLevel:word, _Win3BreakLevel:word
+
+; BegData
+ extrn _&comp&InfoLevel:word, _&comp&BreakLevel:word
+; EndData
+
+ endif
+ ifdef Win3Deb
+ else
+ extrn _&comp&DebugTest:far
+ endif
+
+ &comp&DebugOut macro flag, string, vals
+ local sloc, cnt
+ BegData
+ sloc label byte
+ db string
+ ife (flag) and DEB_NOCRLF
+ db 13, 10
+ endif
+ db 0
+ EndData
+ cnt = 0
+ irp foo, <vals>
+ push foo
+ cnt = cnt + 1
+ endm
+ push offset sloc
+ push flag AND NOT DEB_NOCRLF
+ call _&comp&DebugTest
+ add sp, 4+(2*cnt)
+ endm
+endm
+
+declare_areas macro name, comp, list
+ deb_loc = 100h
+ deb_areas equ <list>
+
+ irp val, <list>
+ DEB_&comp&&val = deb_loc
+ deb_loc = deb_loc + deb_loc
+ ifdef Win3Deb
+ BegData
+ STR_&comp&&val label byte
+ db "&name &val: ", 0
+ EndData
+ endif
+ endm
+ ifdef Win3Deb
+ BegData
+ STR_&comp&Trace db "Trace: ", 0
+ STR_&comp&Warn db "Warning: ", 0
+ STR_&comp&Error db "Error: ", 0
+ STR_&comp db "&name: ", 0
+ STR_&comp&table dw dataoffset STR_&comp
+ irp val, <list>
+ dw dataoffset STR_&comp&&val
+ endm
+ EndData
+ endif
+endm
+
+declare_infolevel macro comp
+ local skip
+ BegData
+; public _&comp&InfoLevel, _&comp&BreakLevel
+; _&comp&InfoLevel dw DEB_INFOLEVEL ;; component can override
+; _&comp&BreakLevel dw DEB_BREAKLEVEL
+ EndData
+
+ _&comp&DebugTest proc far ;; Per-component - check right flags
+ public _&comp&DebugTest
+ push bp
+ mov bp, sp
+ push ds
+ push ax
+ mov ax, _DATA
+ cmp ax, 1000h ;; DATA should be selector, not addr
+ jnc skip
+ mov ds, ax
+ assume ds:_DATA
+
+ mov ax, [bp+6] ;; See if component enabled
+ and ax, [_&comp&InfoLevel]
+ cmp ax, [bp+6]
+ jnz skip
+
+ push es ;; See if system enabled
+ push seg _Win3InfoLevel
+ pop es
+ and al, byte ptr es:[_Win3InfoLevel] ;; test low 8 bits for system-wide
+ pop es
+ cmp ax, [bp+6]
+ jnz skip
+
+ ;; Print it, so format message
+ push bx
+ test al, DEB_ERRORS
+ mov bx, dataoffset STR_&comp&Error
+ jnz @F
+ test al, DEB_WARNS
+ mov bx, dataoffset STR_&comp&Warn
+ jnz @F
+ test al, DEB_TRACES
+ mov bx, dataoffset STR_&comp&Trace
+ jnz @F
+ jmp short deb_no_msg_type
+
+@@:
+ push bx
+ call KOutDSStr
+deb_no_msg_type:
+ mov bx, dataoffset STR_&comp&Table
+ or ah, ah
+ jz deb_show_it
+@@:
+ add bx, 2
+ shr ah, 1
+ jnz @B
+deb_show_it:
+ push [bx] ;; push parameter
+ call KOutDSStr
+ pop bx ;; restore reg
+
+ pop ax
+ push [bp+8]
+ call KOutDSStr
+ push ax
+ mov ax, [bp+6]
+ and ax, [_&comp&BreakLevel]
+ jz skip
+
+ push es
+ push seg _Win3BreakLevel
+ pop es
+ and ax, es:_Win3BreakLevel
+ pop es
+ jz skip
+
+ int 3
+ skip:
+ test byte ptr [bp+6], DEB_FERRORS
+ jz @F
+ push 0
+ push DGROUP
+ push word ptr [bp+8]
+ cCall FatalAppExit ;,<0,DGROUP,[bp+8]>
+@@:
+ pop ax
+ pop ds
+ pop bp
+ retf
+ _&comp&DebugTest endp
+endm
+
+
diff --git a/private/mvdm/wow16/inc/windefs.inc b/private/mvdm/wow16/inc/windefs.inc
new file mode 100644
index 000000000..c4b619ab8
--- /dev/null
+++ b/private/mvdm/wow16/inc/windefs.inc
@@ -0,0 +1,124 @@
+;***************************************************************************
+; *
+; Copyright (C) 1983,1984 by Microsoft Inc. *
+; *
+;***************************************************************************
+
+; Macros for disabling and restoring hardware interrupt enable flag
+;
+; The LeaveCrit macro has been updated for the mask problem on
+; the 80286 processor.
+
+include vint.inc
+
+
+EnterCrit MACRO
+ pushf
+ FCLI
+ENDM
+
+LeaveCrit macro reg ;;this macro will restore the state of
+ifnb <reg> ;;the interrupt flag to what is was
+ pop reg&x ;;before EnterCrit. All other flags
+ test reg&h, 2 ;;are discarded.
+ jz @f
+ FSTI
+@@:
+else
+ push bp
+ mov bp, sp
+ test byte ptr [bp+3], 2
+ jz @f
+ FSTI
+@@:
+ pop bp
+ popf
+endif
+ endm
+
+
+if 0
+POPFF equ <LeaveCrit>
+
+LeaveCrit MACRO
+ POPFF
+ENDM
+endif
+
+POPFF MACRO ;;this macro will restore ALL flags,
+ local a ;;EXCEPT the interrupt flag, to
+ jmp $+3 ;;their previous state
+a label near
+ iret
+ push cs
+ call a
+ENDM
+
+
+
+
+;***************************************************************************
+; *
+; Inquire data structures for Timer, Keyboard, Mouse and Cursor modules *
+; *
+;***************************************************************************
+
+TIMERINFO STRUC
+tiResolution DD 0 ; #microseconds each timer tick
+TIMERINFO ENDS
+
+KBINFO STRUC
+kbRanges DB 4 dup (0) ; Far East ranges for KANJI
+kbStateSize DW 0 ; #bytes of state info maintained by TOASCII
+KBINFO ENDS
+
+
+MOUSEINFO STRUC
+msExists DB 0 ; true => mouse exists
+msRelative DB 0 ; true => relative coordinate
+msNumButtons DW 0 ; number of buttons on the mouse
+msRate DW 0 ; maximum rate of mouse input events
+msXThresh DW 0 ; threshold before acceleration
+msYThresh DW 0 ;
+msXRes DW 0 ; x resolution
+msYRes DW 0 ; y resolution
+MOUSEINFO ENDS
+
+
+CURSORINFO STRUC
+dpXRate DW 0 ; horizontal mickey/pixel ratio
+dpYRate DW 0 ; vertical mickey/pixel ratio
+CURSORINFO ENDS
+
+
+;***************************************************************************
+; *
+; Cursor data structure passed to OEM routines. Defines a graphics display*
+; cursor in terms of a hotspot, an AND mask and an XOR mask. The hot *
+; spot defines the pixel within the cursor that is the cursor is "pointing"*
+; to. So when displaying a cursor at location X,Y the pixel that *
+; is the hot spot should be painted at that X,Y coordinate. The "shape" *
+; of the cursor is defined by two pixel masks. The first mask is ANDed *
+; with the bits in the display bitmap and the second mask is XORed with *
+; the result to determine the bits that will be placed in the display *
+; bitmap. The bits for the masks are in the byte array that begins *
+; at the csBits field, with the AND mask bits first, followed by the *
+; XOR mask bits. The csWidthBytes field is the width of ONE mask, in *
+; bytes. Currently, MS-WIN will only generate cursors whose width and *
+; height are both 16. *
+; *
+;***************************************************************************
+
+cursorShape STRUC
+csHotX DW 0
+csHotY DW 0
+csWidth DW 0
+csHeight DW 0
+csWidthBytes DW 0
+csColor DW 0
+ ; Beginning of an array of bytes that contain the bits for the AND and
+ ; XOR masks. The first csHeight * csWidthBytes bytes contain the bits
+ ; for the AND mask and the next csHeight * csWidthBytes bytes contain
+ ; the bits for the XOR mask.
+;csBits DB 2*2*16 DUP (?)
+cursorShape ENDS
diff --git a/private/mvdm/wow16/inc/windows.h b/private/mvdm/wow16/inc/windows.h
new file mode 100644
index 000000000..6895b3330
--- /dev/null
+++ b/private/mvdm/wow16/inc/windows.h
@@ -0,0 +1,5724 @@
+/*****************************************************************************\
+* *
+* windows.h - Windows functions, types, and definitions *
+* *
+* Version 3.10 *
+* *
+* Copyright (c) 1985-1992, Microsoft Corp. All rights reserved. *
+* *
+*******************************************************************************
+*
+* The following symbols control inclusion of various parts of this file:
+*
+* WINVER Windows version number (0x030a). To exclude
+* definitions introduced in version 3.1 (or above)
+* #define WINVER 0x0300 before #including <windows.h>
+*
+* #define: To prevent inclusion of:
+*
+* NOKERNEL KERNEL APIs and definitions
+* NOGDI GDI APIs and definitions
+* NOUSER USER APIs and definitions
+* NOSOUND Sound APIs and definitions
+* NOCOMM Comm driver APIs and definitions
+* NODRIVERS Installable driver APIs and definitions
+*
+* NOMINMAX min() and max() macros
+* NOLOGERROR LogError() and related definitions
+* NOPROFILER Profiler APIs
+* NOMEMMGR Local and global memory management
+* NOLFILEIO _l* file I/O routines
+* NOOPENFILE OpenFile and related definitions
+* NORESOURCE Resource management
+* NOATOM Atom management
+* NOLANGUAGE Character test routines
+* NOLSTRING lstr* string management routines
+* NODBCS Double-byte character set routines
+* NOKEYBOARDINFO Keyboard driver routines
+* NOGDICAPMASKS GDI device capability constants
+* NOCOLOR COLOR_* color values
+* NOGDIOBJ GDI pens, brushes, fonts
+* NODRAWTEXT DrawText() and related definitions
+* NOTEXTMETRIC TEXTMETRIC and related APIs
+* NOSCALABLEFONT Truetype scalable font support
+* NOBITMAP Bitmap support
+* NORASTEROPS GDI Raster operation definitions
+* NOMETAFILE Metafile support
+* NOSYSMETRICS GetSystemMetrics() and related SM_* definitions
+* NOSYSTEMPARAMSINFO SystemParametersInfo() and SPI_* definitions
+* NOMSG APIs and definitions that use MSG structure
+* NOWINSTYLES Window style definitions
+* NOWINOFFSETS Get/SetWindowWord/Long offset definitions
+* NOSHOWWINDOW ShowWindow and related definitions
+* NODEFERWINDOWPOS DeferWindowPos and related definitions
+* NOVIRTUALKEYCODES VK_* virtual key codes
+* NOKEYSTATES MK_* message key state flags
+* NOWH SetWindowsHook and related WH_* definitions
+* NOMENUS Menu APIs
+* NOSCROLL Scrolling APIs and scroll bar control
+* NOCLIPBOARD Clipboard APIs and definitions
+* NOICONS IDI_* icon IDs
+* NOMB MessageBox and related definitions
+* NOSYSCOMMANDS WM_SYSCOMMAND SC_* definitions
+* NOMDI MDI support
+* NOCTLMGR Control management and controls
+* NOWINMESSAGES WM_* window messages
+* NOHELP Help support
+*
+\****************************************************************************/
+
+#ifndef _INC_WINDOWS
+#define _INC_WINDOWS /* #defined if windows.h has been included */
+
+#ifndef RC_INVOKED
+#pragma pack(1) /* Assume byte packing throughout */
+#endif /* RC_INVOKED */
+
+#ifdef __cplusplus
+extern "C" { /* Assume C declarations for C++ */
+#endif /* __cplusplus */
+
+#ifdef NOWIN31 /* ;Internal */
+#define WINVER 0x0300 /* ;Internal */
+#endif /* ;Internal */
+ /* ;Internal */
+/* If WINVER is not defined, assume version 3.1 */
+#ifndef WINVER
+#define WINVER 0x030a
+#endif
+
+#ifdef RC_INVOKED
+/* Don't include definitions that RC.EXE can't parse */
+#define NOATOM
+#define NOGDI
+#define NOGDICAPMASKS
+#define NOMETAFILE
+#define NOMINMAX
+#define NOMSG
+#define NOOPENFILE
+#define NORASTEROPS
+#define NOSCROLL
+#define NOSOUND
+#define NOSYSMETRICS
+#define NOTEXTMETRIC
+#define NOWH
+#define NODBCS
+#define NOSYSTEMPARAMSINFO
+#define NOCOMM
+#define NOOEMRESOURCE
+#endif /* RC_INVOKED */
+
+/* Temp internal compatibility hacks */ /* ;Internal */
+#define NOOEMRESOURCE /* ;Internal */
+#ifdef OEMRESOURCE /* ;Internal */
+#undef NOOEMRESOURCE /* ;Internal */
+#endif /* ;Internal */
+#define NOCOMM /* ;Internal */
+#ifdef USECOMM /* ;Internal */
+#undef NOCOMM /* ;Internal */
+#endif /* ;Internal */
+ /* ;Internal */
+/* Handle OEMRESOURCE for 3.0 compatibility */
+#if (WINVER < 0x030a)
+#define NOOEMRESOURCE
+#ifdef OEMRESOURCE
+#undef NOOEMRESOURCE
+#endif
+#endif
+
+/******* Common definitions and typedefs ***********************************/
+
+#define VOID void
+
+#define FAR _far
+#define NEAR _near
+#define PASCAL _pascal
+#define CDECL _cdecl
+#define CONST const /* ;Internal */
+
+#ifdef BUILDDLL /* ;Internal */
+#define WINAPI _loadds _far _pascal /* ;Internal */
+#define CALLBACK _loadds _far _pascal /* ;Internal */
+#else /* ;Internal */
+#define WINAPI _far _pascal
+#define CALLBACK _far _pascal
+#endif /* ;Internal */
+ /* ;Internal */
+#define API WINAPI /* ;Internal */
+
+/****** Simple types & common helper macros *********************************/
+
+typedef int BOOL;
+#define FALSE 0
+#define TRUE 1
+
+typedef unsigned char BYTE;
+typedef unsigned short WORD;
+typedef unsigned long DWORD;
+
+typedef unsigned int UINT;
+
+#ifdef STRICT
+typedef signed long LONG;
+#else
+#define LONG long
+#endif
+
+#define LOBYTE(w) ((BYTE)(w))
+#define HIBYTE(w) ((BYTE)(((UINT)(w) >> 8) & 0xFF))
+
+#define LOWORD(l) ((WORD)(DWORD)(l))
+#define HIWORD(l) ((WORD)((((DWORD)(l)) >> 16) & 0xFFFF))
+
+#define MAKELONG(low, high) ((LONG)(((WORD)(low)) | (((DWORD)((WORD)(high))) << 16)))
+
+#ifndef NOMINMAX
+#ifndef max
+#define max(a,b) (((a) > (b)) ? (a) : (b))
+#endif
+#ifndef min
+#define min(a,b) (((a) < (b)) ? (a) : (b))
+#endif
+#endif /* NOMINMAX */
+
+/* Types use for passing & returning polymorphic values */
+typedef UINT WPARAM;
+typedef LONG LPARAM;
+typedef LONG LRESULT;
+
+#define MAKELPARAM(low, high) ((LPARAM)MAKELONG(low, high))
+#define MAKELRESULT(low, high) ((LRESULT)MAKELONG(low, high))
+
+/****** Common pointer types ************************************************/
+
+#ifndef NULL
+#define NULL 0
+#endif
+
+typedef char NEAR* PSTR;
+typedef char NEAR* NPSTR;
+
+#define SZ char /* ;Internal */
+
+typedef char FAR* LPSTR;
+typedef const char FAR* LPCSTR;
+
+typedef BYTE NEAR* PBYTE;
+typedef BYTE FAR* LPBYTE;
+
+typedef int NEAR* PINT;
+typedef int FAR* LPINT;
+
+typedef WORD NEAR* PWORD;
+typedef WORD FAR* LPWORD;
+
+typedef long NEAR* PLONG;
+typedef long FAR* LPLONG;
+
+typedef DWORD NEAR* PDWORD;
+typedef DWORD FAR* LPDWORD;
+
+typedef void FAR* LPVOID;
+
+#define MAKELP(sel, off) ((void FAR*)MAKELONG((off), (sel)))
+#define SELECTOROF(lp) HIWORD(lp)
+#define OFFSETOF(lp) LOWORD(lp)
+
+#define FIELDOFFSET(type, field) ((int)(&((type NEAR*)1)->field)-1)
+
+/****** Common handle types *************************************************/
+
+#ifdef STRICT
+typedef const void NEAR* HANDLE;
+#define DECLARE_HANDLE(name) struct name##__ { int unused; }; \
+ typedef const struct name##__ NEAR* name
+#define DECLARE_HANDLE32(name) struct name##__ { int unused; }; \
+ typedef const struct name##__ FAR* name
+#else /* STRICT */
+typedef UINT HANDLE;
+#define DECLARE_HANDLE(name) typedef UINT name
+#define DECLARE_HANDLE32(name) typedef DWORD name
+#endif /* !STRICT */
+
+typedef HANDLE* PHANDLE;
+typedef HANDLE NEAR* SPHANDLE;
+typedef HANDLE FAR* LPHANDLE;
+
+typedef HANDLE HGLOBAL;
+typedef HANDLE HLOCAL;
+
+typedef HANDLE GLOBALHANDLE;
+typedef HANDLE LOCALHANDLE;
+
+typedef UINT ATOM;
+
+#ifdef STRICT
+typedef void (CALLBACK* FARPROC)(void);
+typedef void (NEAR PASCAL* NEARPROC)(void);
+#else
+typedef int (CALLBACK* FARPROC)();
+typedef int (NEAR PASCAL* NEARPROC)();
+#endif
+
+DECLARE_HANDLE(HSTR);
+
+/****** KERNEL typedefs, structures, and functions **************************/
+
+DECLARE_HANDLE(HINSTANCE);
+typedef HINSTANCE HMODULE; /* HMODULEs can be used in place of HINSTANCEs */
+
+#ifndef NOKERNEL
+
+/****** Application entry point function ************************************/
+
+#ifdef STRICT
+int PASCAL WinMain(HINSTANCE, HINSTANCE, LPSTR, int);
+#endif
+
+/****** System Information **************************************************/
+
+DWORD WINAPI GetVersion(void);
+
+DWORD WINAPI GetFreeSpace(UINT);
+UINT WINAPI GetCurrentPDB(void);
+
+UINT WINAPI GetWindowsDirectory(LPSTR, UINT);
+UINT WINAPI GetSystemDirectory(LPSTR, UINT);
+
+#if (WINVER >= 0x030a)
+UINT WINAPI GetFreeSystemResources(UINT);
+#define GFSR_SYSTEMRESOURCES 0x0000
+#define GFSR_GDIRESOURCES 0x0001
+#define GFSR_USERRESOURCES 0x0002
+#define GFSR_VALID 0x0002 /* ;Internal */
+#endif /* WINVER >= 0x030a */
+
+DWORD WINAPI GetWinFlags(void);
+
+#define WF_PMODE 0x0001
+#define WF_CPU286 0x0002
+#define WF_CPU386 0x0004
+#define WF_CPU486 0x0008
+#define WF_STANDARD 0x0010
+#define WF_WIN286 0x0010
+#define WF_ENHANCED 0x0020
+#define WF_WIN386 0x0020
+#define WF_CPU086 0x0040
+#define WF_CPU186 0x0080
+#define WF_LARGEFRAME 0x0100
+#define WF_CPUEM 0x0100
+#define WF_SMALLFRAME 0x0200
+#define WF_80x87 0x0400
+#define WF_PAGING 0x0800
+#define WF_WINNT 0x4000
+#define WF_WLO 0x8000
+
+LPSTR WINAPI GetDOSEnvironment(void);
+
+DWORD WINAPI GetCurrentTime(void);
+DWORD WINAPI GetTickCount(void);
+DWORD WINAPI GetTimerResolution(void);
+
+/****** Error handling ******************************************************/
+
+#if (WINVER >= 0x030a)
+#ifndef NOLOGERROR
+
+void WINAPI LogError(UINT err, void FAR* lpInfo);
+void WINAPI LogParamError(UINT err, FARPROC lpfn, void FAR* param);
+
+/****** LogParamError/LogError values */
+
+/* Error modifier bits */
+
+#define ERR_WARNING 0x8000
+#define ERR_PARAM 0x4000
+
+/* Internal error value masks */ /* ;Internal */
+#define ERR_TYPE_MASK 0x0fff /* ;Internal */
+#define ERR_FLAGS_MASK 0xc000 /* ;Internal */
+ /* ;Internal */
+#define ERR_SIZE_MASK 0x3000
+#define ERR_SIZE_SHIFT 12 /* ;Internal */
+#define ERR_BYTE 0x1000
+#define ERR_WORD 0x2000
+#define ERR_DWORD 0x3000
+ /* ;Internal */
+/* Error option flags (set by [kernel] ErrorOptions win.ini variable) *//* ;Internal */
+ /* ;Internal */
+#define ERO_PARAM_ERROR_BREAK 0x0001 /* ;Internal */
+#define ERO_BUFFER_FILL 0x0002 /* ;Internal */
+
+/****** LogParamError() values */
+
+/* Generic parameter values */
+#define ERR_BAD_VALUE 0x6001
+#define ERR_BAD_FLAGS 0x6002
+#define ERR_BAD_INDEX 0x6003
+#define ERR_BAD_DVALUE 0x7004
+#define ERR_BAD_DFLAGS 0x7005
+#define ERR_BAD_DINDEX 0x7006
+#define ERR_BAD_PTR 0x7007
+#define ERR_BAD_FUNC_PTR 0x7008
+#define ERR_BAD_SELECTOR 0x6009
+#define ERR_BAD_STRING_PTR 0x700a
+#define ERR_BAD_HANDLE 0x600b
+
+/* KERNEL parameter errors */
+#define ERR_BAD_HINSTANCE 0x6020
+#define ERR_BAD_HMODULE 0x6021
+#define ERR_BAD_GLOBAL_HANDLE 0x6022
+#define ERR_BAD_LOCAL_HANDLE 0x6023
+#define ERR_BAD_ATOM 0x6024
+#define ERR_BAD_HFILE 0x6025
+
+/* USER parameter errors */
+#define ERR_BAD_HWND 0x6040
+#define ERR_BAD_HMENU 0x6041
+#define ERR_BAD_HCURSOR 0x6042
+#define ERR_BAD_HICON 0x6043
+#define ERR_BAD_HDWP 0x6044
+#define ERR_BAD_CID 0x6045
+#define ERR_BAD_HDRVR 0x6046
+
+/* GDI parameter errors */
+#define ERR_BAD_COORDS 0x7060
+#define ERR_BAD_GDI_OBJECT 0x6061
+#define ERR_BAD_HDC 0x6062
+#define ERR_BAD_HPEN 0x6063
+#define ERR_BAD_HFONT 0x6064
+#define ERR_BAD_HBRUSH 0x6065
+#define ERR_BAD_HBITMAP 0x6066
+#define ERR_BAD_HRGN 0x6067
+#define ERR_BAD_HPALETTE 0x6068
+#define ERR_BAD_HMETAFILE 0x6069
+
+/* Debug fill constants */ /* ;Internal */
+ /* ;Internal */
+#define DBGFILL_ALLOC 0xfd /* ;Internal */
+#define DBGFILL_FREE 0xfb /* ;Internal */
+#define DBGFILL_BUFFER 0xf9 /* ;Internal */
+#define DBGFILL_STACK 0xf7 /* ;Internal */
+
+/**** LogError() values */
+
+/* KERNEL errors */
+#define ERR_GALLOC 0x0001
+#define ERR_GREALLOC 0x0002
+#define ERR_GLOCK 0x0003
+#define ERR_LALLOC 0x0004
+#define ERR_LREALLOC 0x0005
+#define ERR_LLOCK 0x0006
+#define ERR_ALLOCRES 0x0007
+#define ERR_LOCKRES 0x0008
+#define ERR_LOADMODULE 0x0009
+
+/* USER errors */
+#define ERR_CREATEDLG 0x0040
+#define ERR_CREATEDLG2 0x0041
+#define ERR_REGISTERCLASS 0x0042
+#define ERR_DCBUSY 0x0043
+#define ERR_CREATEWND 0x0044
+#define ERR_STRUCEXTRA 0x0045
+#define ERR_LOADSTR 0x0046
+#define ERR_LOADMENU 0x0047
+#define ERR_NESTEDBEGINPAINT 0x0048
+#define ERR_BADINDEX 0x0049
+#define ERR_CREATEMENU 0x004a
+
+/* GDI errors */
+#define ERR_CREATEDC 0x0080
+#define ERR_CREATEMETA 0x0081
+#define ERR_DELOBJSELECTED 0x0082
+#define ERR_SELBITMAP 0x0083
+
+/* Debugging support (DEBUG SYSTEM ONLY) */
+typedef struct tagWINDEBUGINFO
+{
+ UINT flags;
+ DWORD dwOptions;
+ DWORD dwFilter;
+ char achAllocModule[8];
+ DWORD dwAllocBreak;
+ DWORD dwAllocCount;
+} WINDEBUGINFO;
+
+BOOL WINAPI GetWinDebugInfo(WINDEBUGINFO FAR* lpwdi, UINT flags);
+BOOL WINAPI SetWinDebugInfo(const WINDEBUGINFO FAR* lpwdi);
+
+void FAR _cdecl DebugOutput(UINT flags, LPCSTR lpsz, ...);
+void WINAPI DebugFillBuffer(void FAR* lpb, UINT cb); /* ;Internal */
+
+/* WINDEBUGINFO flags values */
+#define WDI_OPTIONS 0x0001
+#define WDI_FILTER 0x0002
+#define WDI_ALLOCBREAK 0x0004
+#define WDI_VALID 0x0007 /* ;Internal */
+
+/* dwOptions values */
+#define DBO_CHECKHEAP 0x0001
+#define DBO_BUFFERFILL 0x0004
+#define DBO_DISABLEGPTRAPPING 0x0010
+#define DBO_CHECKFREE 0x0020
+
+#define DBO_SILENT 0x8000
+
+#define DBO_TRACEBREAK 0x2000
+#define DBO_WARNINGBREAK 0x1000
+#define DBO_NOERRORBREAK 0x0800
+#define DBO_NOFATALBREAK 0x0400
+#define DBO_INT3BREAK 0x0100
+
+/* DebugOutput flags values */
+#define DBF_TRACE 0x0000
+#define DBF_WARNING 0x4000
+#define DBF_ERROR 0x8000
+#define DBF_FATAL 0xc000
+#define DBF_SEVMASK 0xc000 /* ;Internal */
+#define DBF_FILTERMASK 0x3fff /* ;Internal */
+
+/* dwFilter values */
+#define DBF_KERNEL 0x1000
+#define DBF_KRN_MEMMAN 0x0001
+#define DBF_KRN_LOADMODULE 0x0002
+#define DBF_KRN_SEGMENTLOAD 0x0004
+#define DBF_USER 0x0800
+#define DBF_GDI 0x0400
+#define DBF_MMSYSTEM 0x0040
+#define DBF_PENWIN 0x0020
+#define DBF_APPLICATION 0x0008
+#define DBF_DRIVER 0x0010
+
+#endif /* NOLOGERROR */
+#endif /* WINVER >= 0x030a */
+
+void WINAPI FatalExit(int);
+void WINAPI FatalAppExit(UINT, LPCSTR);
+
+BOOL WINAPI ExitWindows(DWORD dwReturnCode, UINT wReserved);
+
+#define EW_RESTARTWINDOWS 0x42
+#if (WINVER >= 0x030a)
+#define EW_REBOOTSYSTEM 0x43
+#define EW_EXITANDEXECAPP 0x44 /* ;Internal */
+
+BOOL WINAPI ExitWindowsExec(LPCSTR, LPCSTR);
+#endif /* WINVER >= 0x030a */
+
+void WINAPI DebugBreak(void);
+void WINAPI OutputDebugString(LPCSTR);
+
+/* SetErrorMode() constants */
+#define SEM_FAILCRITICALERRORS 0x0001
+#define SEM_NOGPFAULTERRORBOX 0x0002
+#define SEM_NOOPENFILEERRORBOX 0x8000
+
+UINT WINAPI SetErrorMode(UINT);
+
+/****** Pointer validation **************************************************/
+
+#if (WINVER >= 0x030a)
+
+BOOL WINAPI IsBadReadPtr(const void FAR* lp, UINT cb);
+BOOL WINAPI IsBadWritePtr(void FAR* lp, UINT cb);
+BOOL WINAPI IsBadHugeReadPtr(const void _huge* lp, DWORD cb);
+BOOL WINAPI IsBadHugeWritePtr(void _huge* lp, DWORD cb);
+BOOL WINAPI IsBadCodePtr(FARPROC lpfn);
+BOOL WINAPI IsBadStringPtr(const void FAR* lpsz, UINT cchMax);
+#endif /* WINVER >= 0x030a */
+
+/****** Profiling support ***************************************************/
+
+#ifndef NOPROFILER
+
+int WINAPI ProfInsChk(void);
+void WINAPI ProfSetup(int,int);
+void WINAPI ProfSampRate(int,int);
+void WINAPI ProfStart(void);
+void WINAPI ProfStop(void);
+void WINAPI ProfClear(void);
+void WINAPI ProfFlush(void);
+void WINAPI ProfFinish(void);
+#endif /* NOPROFILER */
+
+/****** Catch/Throw and stack management ************************************/
+
+typedef int CATCHBUF[9];
+typedef int FAR* LPCATCHBUF;
+
+int WINAPI Catch(int FAR*);
+void WINAPI Throw(const int FAR*, int);
+
+void WINAPI SwitchStackBack(void);
+void WINAPI SwitchStackTo(UINT, UINT, UINT);
+
+/****** Module Management ***************************************************/
+
+#define HINSTANCE_ERROR ((HINSTANCE)32)
+
+LONG WINAPI GetExpWinVer(HINSTANCE); /* ;Internal */
+
+HINSTANCE WINAPI LoadModule(LPCSTR, LPVOID);
+BOOL WINAPI FreeModule(HINSTANCE);
+
+HINSTANCE WINAPI LoadLibrary(LPCSTR);
+void WINAPI FreeLibrary(HINSTANCE);
+
+UINT WINAPI WinExec(LPCSTR, UINT);
+
+HMODULE WINAPI GetModuleHandle(LPCSTR);
+
+int WINAPI GetModuleUsage(HINSTANCE);
+int WINAPI GetModuleFileName(HINSTANCE, LPSTR, int);
+
+FARPROC WINAPI GetProcAddress(HINSTANCE, LPCSTR);
+
+int WINAPI GetInstanceData(HINSTANCE, BYTE*, int);
+
+HGLOBAL WINAPI GetCodeHandle(FARPROC);
+
+typedef struct tagSEGINFO
+{
+ UINT offSegment;
+ UINT cbSegment;
+ UINT flags;
+ UINT cbAlloc;
+ HGLOBAL h;
+ UINT alignShift;
+ UINT reserved[2];
+} SEGINFO;
+typedef SEGINFO FAR* LPSEGINFO;
+
+void WINAPI GetCodeInfo(FARPROC lpProc, SEGINFO FAR* lpSegInfo);
+
+FARPROC WINAPI MakeProcInstance(FARPROC, HINSTANCE);
+void WINAPI FreeProcInstance(FARPROC);
+
+LONG WINAPI SetSwapAreaSize(UINT);
+void WINAPI SwapRecording(UINT);
+void WINAPI ValidateCodeSegments(void);
+
+/* Windows Exit Procedure flag values */
+#define WEP_SYSTEM_EXIT 1
+#define WEP_FREE_DLL 0
+
+/****** Task Management *****************************************************/
+
+#endif /* NOKERNEL */
+
+DECLARE_HANDLE(HTASK);
+
+#ifndef NOKERNEL
+
+UINT WINAPI GetNumTasks(void);
+
+#if (WINVER >= 0x030a)
+BOOL WINAPI IsTask(HTASK);
+#endif /* WINVER >= 0x030a */
+
+HTASK WINAPI GetCurrentTask(void);
+int WINAPI SetPriority(HTASK, int); /* ;Internal */
+
+void WINAPI Yield(void);
+void WINAPI DirectedYield(HTASK);
+
+DWORD WINAPI GetAppCompatFlags(HTASK); /* ;Internal */
+ /* ;Internal */
+/* GetAppCompatFlags flag values */ /* ;Internal */
+#define GACF_IGNORENODISCARD 0x0001 /* ;Internal */
+#define GACF_FORCETEXTBAND 0x0002 /* ;Internal */
+#define GACF_ONELANDGRXBAND 0x0004 /* ;Internal */
+#define GACF_IGNORETOPMOST 0x0008 /* ;Internal */
+#define GACF_CALLTTDEVICE 0x0010 /* ;Internal */
+#define GACF_MULTIPLEBANDS 0x0020 /* ;Internal */
+#define GACF_ALWAYSSENDNCPAINT 0x0040 /* ;Internal */
+#define GACF_EDITSETTEXTMUNGE 0x0080 /* ;Internal */
+#define GACF_MOREEXTRAWNDWORDS 0x0100 /* ;Internal */
+#define GACF_TTIGNORERASTERDUPE 0x0200 /* ;Internal */
+#define GACF_HACKWINFLAGS 0x0400 /* ;Internal */
+#define GACF_DELAYHWHNDSHAKECHK 0x0800 /* ;Internal */
+#define GACF_ENUMHELVNTMSRMN 0x1000 /* ;Internal */
+#define GACF_ENUMTTNOTDEVICE 0x2000 /* ;Internal */
+#define GACF_SUBTRACTCLIPSIBS 0x4000 /* ;Internal */
+#define GACF_FORCETTGRAPHICS 0x8000 /* ;Internal */
+#define GACF_NOHRGN1 0x00010000 /* ;Internal */
+#define GACF_NCCALCSIZEONMOVE 0x00020000 /* ;Internal */
+#define GACF_SENDMENUDBLCLK 0x00040000 /* ;Internal */
+#define GACF_30AVGWIDTH 0x00080000 /* ;Internal */
+
+/****** Global memory management ********************************************/
+
+#ifndef NOMEMMGR
+
+/* Global Memory Flags */
+
+#define GMEM_FIXED 0x0000
+#define GMEM_MOVEABLE 0x0002
+#define GMEM_NOCOMPACT 0x0010
+#define GMEM_NODISCARD 0x0020
+#define GMEM_ZEROINIT 0x0040
+#define GMEM_MODIFY 0x0080
+#define GMEM_DISCARDABLE 0x0100
+#define GMEM_NOT_BANKED 0x1000
+#define GMEM_SHARE 0x2000
+#define GMEM_DDESHARE 0x2000
+#define GMEM_NOTIFY 0x4000
+#define GMEM_LOWER GMEM_NOT_BANKED
+
+#define GHND (GMEM_MOVEABLE | GMEM_ZEROINIT)
+#define GPTR (GMEM_FIXED | GMEM_ZEROINIT)
+
+#define GlobalDiscard(h) GlobalReAlloc(h, 0L, GMEM_MOVEABLE)
+
+HGLOBAL WINAPI GlobalAlloc(UINT, DWORD);
+HGLOBAL WINAPI GlobalReAlloc(HGLOBAL, DWORD, UINT);
+HGLOBAL WINAPI GlobalFree(HGLOBAL);
+
+DWORD WINAPI GlobalDosAlloc(DWORD);
+UINT WINAPI GlobalDosFree(UINT);
+
+#ifdef STRICT
+void FAR* WINAPI GlobalLock(HGLOBAL);
+#else
+char FAR* WINAPI GlobalLock(HGLOBAL);
+#endif
+
+BOOL WINAPI GlobalUnlock(HGLOBAL);
+
+DWORD WINAPI GlobalSize(HGLOBAL);
+DWORD WINAPI GlobalHandle(UINT);
+
+/* GlobalFlags return flags (in addition to GMEM_DISCARDABLE) */
+#define GMEM_DISCARDED 0x4000
+#define GMEM_LOCKCOUNT 0x00FF
+UINT WINAPI GlobalFlags(HGLOBAL);
+
+#ifdef STRICT
+void FAR* WINAPI GlobalWire(HGLOBAL);
+#else
+char FAR* WINAPI GlobalWire(HGLOBAL);
+#endif
+
+BOOL WINAPI GlobalUnWire(HGLOBAL);
+
+UINT WINAPI GlobalPageLock(HGLOBAL);
+UINT WINAPI GlobalPageUnlock(HGLOBAL);
+
+void WINAPI GlobalFix(HGLOBAL);
+void WINAPI GlobalUnfix(HGLOBAL);
+
+HGLOBAL WINAPI GlobalLRUNewest(HGLOBAL);
+HGLOBAL WINAPI GlobalLRUOldest(HGLOBAL);
+
+DWORD WINAPI GlobalCompact(DWORD);
+
+#ifdef STRICT
+typedef BOOL (CALLBACK* GNOTIFYPROC)(HGLOBAL);
+#else
+typedef FARPROC GNOTIFYPROC;
+#endif
+
+void WINAPI GlobalNotify(GNOTIFYPROC);
+
+HGLOBAL WINAPI LockSegment(UINT);
+void WINAPI UnlockSegment(UINT);
+
+#define LockData(dummy) LockSegment((UINT)-1)
+#define UnlockData(dummy) UnlockSegment((UINT)-1)
+
+UINT WINAPI AllocSelector(UINT);
+UINT WINAPI FreeSelector(UINT);
+UINT WINAPI AllocDStoCSAlias(UINT);
+UINT WINAPI PrestoChangoSelector(UINT sourceSel, UINT destSel);
+DWORD WINAPI GetSelectorBase(UINT);
+UINT WINAPI SetSelectorBase(UINT, DWORD);
+DWORD WINAPI GetSelectorLimit(UINT);
+UINT WINAPI SetSelectorLimit(UINT, DWORD);
+
+void WINAPI LimitEmsPages(DWORD);
+
+void WINAPI ValidateFreeSpaces(void);
+
+/* Low system memory notification message */
+#define WM_COMPACTING 0x0041
+
+/***** Local Memory Management */
+
+/* Local Memory Flags */
+#define LMEM_FIXED 0x0000
+#define LMEM_MOVEABLE 0x0002
+#define LMEM_NOCOMPACT 0x0010
+#define LMEM_NODISCARD 0x0020
+#define LMEM_ZEROINIT 0x0040
+#define LMEM_MODIFY 0x0080
+#define LMEM_DISCARDABLE 0x0F00
+
+#define LHND (LMEM_MOVEABLE | LMEM_ZEROINIT)
+#define LPTR (LMEM_FIXED | LMEM_ZEROINIT)
+
+#define NONZEROLHND (LMEM_MOVEABLE)
+#define NONZEROLPTR (LMEM_FIXED)
+
+extern UINT NEAR* PASCAL pLocalHeap; /* ;Internal */
+#define LocalFreeze(dummy) (*(pLocalHeap+1) += 1) /* ;Internal */
+#define LocalMelt(dummy) (*(pLocalHeap+1) -= 1) /* ;Internal */
+
+#define LocalDiscard(h) LocalReAlloc(h, 0, LMEM_MOVEABLE)
+
+
+HLOCAL WINAPI LocalAlloc(UINT, UINT);
+HLOCAL WINAPI LocalReAlloc(HLOCAL, UINT, UINT);
+HLOCAL WINAPI LocalFree(HLOCAL);
+
+#ifdef STRICT
+void NEAR* WINAPI LocalLock(HLOCAL);
+#else
+char NEAR* WINAPI LocalLock(HLOCAL);
+#endif
+
+BOOL WINAPI LocalUnlock(HLOCAL);
+
+UINT WINAPI LocalSize(HLOCAL);
+#ifdef STRICT
+HLOCAL WINAPI LocalHandle(void NEAR*);
+#else
+HLOCAL WINAPI LocalHandle(UINT);
+#endif
+UINT WINAPI LocalHandleDelta(UINT); /* ;Internal */
+
+/* LocalFlags return flags (in addition to LMEM_DISCARDABLE) */
+#define LMEM_DISCARDED 0x4000
+#define LMEM_LOCKCOUNT 0x00FF
+
+UINT WINAPI LocalFlags(HLOCAL);
+
+BOOL WINAPI LocalInit(UINT, UINT, UINT);
+UINT WINAPI LocalCompact(UINT);
+UINT WINAPI LocalShrink(HLOCAL, UINT);
+
+/* LocalNotify callback */ /* ;Internal */
+#ifdef STRICT /* ;Internal */
+typedef BOOL (CALLBACK* LNOTIFYPROC)(UINT, HLOCAL, void NEAR*); /* ;Internal */
+#else /* ;Internal */
+typedef FARPROC LNOTIFYPROC; /* ;Internal */
+#endif /* ;Internal */
+ /* ;Internal */
+#define LNOTIFY_OUTOFMEM 0 /* ;Internal */
+#define LNOTIFY_MOVE 1 /* ;Internal */
+#define LNOTIFY_DISCARD 2 /* ;Internal */
+ /* ;Internal */
+LNOTIFYPROC WINAPI LocalNotify(LNOTIFYPROC); /* ;Internal */
+ /* ;Internal */
+#endif /* NOMEMMGR */
+
+/****** File I/O ************************************************************/
+
+#ifndef NOLFILEIO
+
+typedef int HFILE; /* Polymorphic with C runtime file handle type */
+
+#define HFILE_ERROR ((HFILE)-1)
+
+#ifndef NOOPENFILE
+
+/* OpenFile() Structure */
+typedef struct tagOFSTRUCT
+{
+ BYTE cBytes;
+ BYTE fFixedDisk;
+ UINT nErrCode;
+ BYTE reserved[4];
+ char szPathName[128];
+} OFSTRUCT;
+typedef OFSTRUCT* POFSTRUCT;
+typedef OFSTRUCT NEAR* NPOFSTRUCT;
+typedef OFSTRUCT FAR* LPOFSTRUCT;
+
+/* OpenFile() Flags */
+#define OF_READ 0x0000
+#define OF_WRITE 0x0001
+#define OF_READWRITE 0x0002
+#define OF_SHARE_COMPAT 0x0000
+#define OF_SHARE_EXCLUSIVE 0x0010
+#define OF_SHARE_DENY_WRITE 0x0020
+#define OF_SHARE_DENY_READ 0x0030
+#define OF_SHARE_DENY_NONE 0x0040
+#define OF_PARSE 0x0100
+#define OF_DELETE 0x0200
+#define OF_VERIFY 0x0400 /* Used with OF_REOPEN */
+#define OF_SEARCH 0x0400 /* Used without OF_REOPEN */
+#define OF_CANCEL 0x0800
+#define OF_CREATE 0x1000
+#define OF_PROMPT 0x2000
+#define OF_EXIST 0x4000
+#define OF_REOPEN 0x8000
+
+HFILE WINAPI OpenFile(LPCSTR, OFSTRUCT FAR*, UINT);
+
+#endif /* NOOPENFILE */
+
+/* _lopen() flags */
+#define READ 0
+#define WRITE 1
+#define READ_WRITE 2
+
+HFILE WINAPI _lopen(LPCSTR, int);
+HFILE WINAPI _lcreat(LPCSTR, int);
+
+HFILE WINAPI _lclose(HFILE);
+
+LONG WINAPI _llseek(HFILE, LONG, int);
+
+/* _llseek origin values */
+#define SEEK_SET 0
+#define SEEK_CUR 1
+#define SEEK_END 2
+
+UINT WINAPI _lread(HFILE, void _huge*, UINT);
+UINT WINAPI _lwrite(HFILE, const void _huge*, UINT);
+
+#if (WINVER >= 0x030a)
+long WINAPI _hread(HFILE, void _huge*, long);
+long WINAPI _hwrite(HFILE, const void _huge*, long);
+#endif /* WINVER >= 0x030a */
+
+UINT WINAPI DeletePathname(LPCSTR); /* ;Internal */
+
+#endif /* NOLFILEIO */
+
+/* GetTempFileName() Flags */
+#define TF_FORCEDRIVE (BYTE)0x80
+
+int WINAPI GetTempFileName(BYTE, LPCSTR, UINT, LPSTR);
+BYTE WINAPI GetTempDrive(char);
+
+/* GetDriveType return values */
+#define DRIVE_REMOVABLE 2
+#define DRIVE_FIXED 3
+#define DRIVE_REMOTE 4
+UINT WINAPI GetDriveType(int);
+
+UINT WINAPI SetHandleCount(UINT);
+
+/****** Network support *****************************************************/
+UINT WINAPI WNetAddConnection(LPSTR, LPSTR, LPSTR);
+UINT WINAPI WNetGetConnection(LPSTR, LPSTR, UINT FAR*);
+UINT WINAPI WNetCancelConnection(LPSTR, BOOL);
+/* Errors */
+#define WN_SUCCESS 0x0000
+#define WN_NOT_SUPPORTED 0x0001
+#define WN_NET_ERROR 0x0002
+#define WN_MORE_DATA 0x0003
+#define WN_BAD_POINTER 0x0004
+#define WN_BAD_VALUE 0x0005
+#define WN_BAD_PASSWORD 0x0006
+#define WN_ACCESS_DENIED 0x0007
+#define WN_FUNCTION_BUSY 0x0008
+#define WN_WINDOWS_ERROR 0x0009
+#define WN_BAD_USER 0x000A
+#define WN_OUT_OF_MEMORY 0x000B
+#define WN_CANCEL 0x000C
+#define WN_CONTINUE 0x000D
+
+/* Connection errors */
+#define WN_NOT_CONNECTED 0x0030
+#define WN_OPEN_FILES 0x0031
+#define WN_BAD_NETNAME 0x0032
+#define WN_BAD_LOCALNAME 0x0033
+#define WN_ALREADY_CONNECTED 0x0034
+#define WN_DEVICE_ERROR 0x0035
+#define WN_CONNECTION_CLOSED 0x0036
+
+/****** Resource Management *************************************************/
+
+DECLARE_HANDLE(HRSRC);
+
+HRSRC WINAPI FindResource(HINSTANCE, LPCSTR, LPCSTR);
+HGLOBAL WINAPI LoadResource(HINSTANCE, HRSRC);
+BOOL WINAPI FreeResource(HGLOBAL);
+
+#ifdef STRICT
+void FAR* WINAPI LockResource(HGLOBAL);
+#else
+char FAR* WINAPI LockResource(HGLOBAL);
+#endif
+
+#define UnlockResource(h) GlobalUnlock(h)
+
+DWORD WINAPI SizeofResource(HINSTANCE, HRSRC);
+
+int WINAPI AccessResource(HINSTANCE, HRSRC);
+
+HGLOBAL WINAPI AllocResource(HINSTANCE, HRSRC, DWORD);
+
+#ifdef STRICT
+typedef HGLOBAL (CALLBACK* RSRCHDLRPROC)(HGLOBAL, HINSTANCE, HRSRC);
+#else
+typedef FARPROC RSRCHDLRPROC;
+#endif
+
+RSRCHDLRPROC WINAPI SetResourceHandler(HINSTANCE, LPCSTR, RSRCHDLRPROC);
+
+#define MAKEINTRESOURCE(i) ((LPCSTR)MAKELP(0, (i)))
+
+#ifndef NORESOURCE
+
+/* Predefined Resource Types */
+#define RT_CURSOR MAKEINTRESOURCE(1)
+#define RT_BITMAP MAKEINTRESOURCE(2)
+#define RT_ICON MAKEINTRESOURCE(3)
+#define RT_MENU MAKEINTRESOURCE(4)
+#define RT_DIALOG MAKEINTRESOURCE(5)
+#define RT_STRING MAKEINTRESOURCE(6)
+#define RT_FONTDIR MAKEINTRESOURCE(7)
+#define RT_FONT MAKEINTRESOURCE(8)
+#define RT_ACCELERATOR MAKEINTRESOURCE(9)
+#define RT_RCDATA MAKEINTRESOURCE(10)
+
+/* If any new types are added above this point, */ /* ;Internal */
+/* DIFFERENCE must be changed. The GROUP_* */ /* ;Internal */
+/* values minus the non-GROUP values must be */ /* ;Internal */
+/* equal to DIFFERENCE */ /* ;Internal */
+#define DIFFERENCE 11 /* ;Internal */
+#define RT_GROUP_CURSOR MAKEINTRESOURCE(12)
+#define RT_GROUP_ICON MAKEINTRESOURCE(14)
+
+#endif /* NORESOURCE */
+
+#ifdef OEMRESOURCE
+
+/* OEM Resource Ordinal Numbers */
+#define OBM_CLOSE 32754
+#define OBM_UPARROW 32753
+#define OBM_DNARROW 32752
+#define OBM_RGARROW 32751
+#define OBM_LFARROW 32750
+#define OBM_REDUCE 32749
+#define OBM_ZOOM 32748
+#define OBM_RESTORE 32747
+#define OBM_REDUCED 32746
+#define OBM_ZOOMD 32745
+#define OBM_RESTORED 32744
+#define OBM_UPARROWD 32743
+#define OBM_DNARROWD 32742
+#define OBM_RGARROWD 32741
+#define OBM_LFARROWD 32740
+#define OBM_MNARROW 32739
+#define OBM_COMBO 32738
+#if (WINVER >= 0x030a)
+#define OBM_UPARROWI 32737
+#define OBM_DNARROWI 32736
+#define OBM_RGARROWI 32735
+#define OBM_LFARROWI 32734
+#endif /* WINVER >= 0x030a */
+
+#define OBM_OLD_CLOSE 32767
+#define OBM_SIZE 32766
+#define OBM_OLD_UPARROW 32765
+#define OBM_OLD_DNARROW 32764
+#define OBM_OLD_RGARROW 32763
+#define OBM_OLD_LFARROW 32762
+#define OBM_BTSIZE 32761
+#define OBM_CHECK 32760
+#define OBM_CHECKBOXES 32759
+#define OBM_BTNCORNERS 32758
+#define OBM_OLD_REDUCE 32757
+#define OBM_OLD_ZOOM 32756
+#define OBM_OLD_RESTORE 32755
+
+#define OCR_NORMAL 32512
+#define OCR_IBEAM 32513
+#define OCR_WAIT 32514
+#define OCR_CROSS 32515
+#define OCR_UP 32516
+#define OCR_SIZE 32640
+#define OCR_ICON 32641
+#define OCR_SIZENWSE 32642
+#define OCR_SIZENESW 32643
+#define OCR_SIZEWE 32644
+#define OCR_SIZENS 32645
+#define OCR_SIZEALL 32646
+#define OCR_ICOCUR 32647
+
+#define OIC_SAMPLE 32512
+#define OIC_HAND 32513
+#define OIC_QUES 32514
+#define OIC_BANG 32515
+#define OIC_NOTE 32516
+
+#endif /* OEMRESOURCE */
+
+/****** Atom Management *****************************************************/
+
+#define MAKEINTATOM(i) ((LPCSTR)MAKELP(0, (i)))
+
+#ifndef NOATOM
+
+BOOL WINAPI InitAtomTable(int);
+ATOM WINAPI AddAtom(LPCSTR);
+ATOM WINAPI DeleteAtom(ATOM);
+ATOM WINAPI FindAtom(LPCSTR);
+UINT WINAPI GetAtomName(ATOM, LPSTR, int);
+ATOM WINAPI GlobalAddAtom(LPCSTR);
+ATOM WINAPI GlobalDeleteAtom(ATOM);
+ATOM WINAPI GlobalFindAtom(LPCSTR);
+UINT WINAPI GlobalGetAtomName(ATOM, LPSTR, int);
+HLOCAL WINAPI GetAtomHandle(ATOM);
+
+#endif /* NOATOM */
+
+/****** WIN.INI Support *****************************************************/
+
+/* User Profile Routines */
+UINT WINAPI GetProfileInt(LPCSTR, LPCSTR, int);
+int WINAPI GetProfileString(LPCSTR, LPCSTR, LPCSTR, LPSTR, int);
+BOOL WINAPI WriteProfileString(LPCSTR, LPCSTR, LPCSTR);
+
+UINT WINAPI GetPrivateProfileInt(LPCSTR, LPCSTR, int, LPCSTR);
+int WINAPI GetPrivateProfileString(LPCSTR, LPCSTR, LPCSTR, LPSTR, int, LPCSTR);
+BOOL WINAPI WritePrivateProfileString(LPCSTR, LPCSTR, LPCSTR, LPCSTR);
+
+#define WM_WININICHANGE 0x001A
+
+/****** International & Char Translation Support ****************************/
+
+void WINAPI AnsiToOem(const char _huge*, char _huge*);
+void WINAPI OemToAnsi(const char _huge*, char _huge*);
+
+void WINAPI AnsiToOemBuff(LPCSTR, LPSTR, UINT);
+void WINAPI OemToAnsiBuff(LPCSTR, LPSTR, UINT);
+
+LPSTR WINAPI AnsiNext(LPCSTR);
+LPSTR WINAPI AnsiPrev(LPCSTR, LPCSTR);
+
+LPSTR WINAPI AnsiUpper(LPSTR);
+LPSTR WINAPI AnsiLower(LPSTR);
+
+UINT WINAPI AnsiUpperBuff(LPSTR, UINT);
+UINT WINAPI AnsiLowerBuff(LPSTR, UINT);
+
+/* Language driver entry point ordinal */ /* ;Internal */
+#define ORD_LANGDRIVER 1 /* ;Internal */
+
+#ifndef NOLANGUAGE
+BOOL WINAPI IsCharAlpha(char);
+BOOL WINAPI IsCharAlphaNumeric(char);
+BOOL WINAPI IsCharUpper(char);
+BOOL WINAPI IsCharLower(char);
+#endif
+
+#ifndef NOLSTRING
+int WINAPI lstrcmp(LPCSTR, LPCSTR);
+int WINAPI lstrcmpi(LPCSTR, LPCSTR);
+LPSTR WINAPI lstrcpy(LPSTR, LPCSTR);
+LPSTR WINAPI lstrcat(LPSTR, LPCSTR);
+int WINAPI lstrlen(LPCSTR);
+#if (WINVER >= 0x030a)
+LPSTR WINAPI lstrcpyn(LPSTR, LPCSTR, int);
+void WINAPI hmemcpy(void _huge*, const void _huge*, long);
+#endif /* WINVER >= 0x030a */
+#endif /* NOLSTRING */
+
+#if (WINVER >= 0x030a)
+#ifndef NODBCS
+BOOL WINAPI IsDBCSLeadByte(BYTE);
+#endif /* NODBCS */
+#endif /* WINVER >= 0x030a */
+
+int WINAPI LoadString(HINSTANCE, UINT, LPSTR, int);
+
+/****** Keyboard Driver Functions *******************************************/
+
+#ifndef NOKEYBOARDINFO
+
+DWORD WINAPI OemKeyScan(UINT);
+UINT WINAPI VkKeyScan(UINT);
+int WINAPI GetKeyboardType(int);
+UINT WINAPI MapVirtualKey(UINT, UINT);
+int WINAPI GetKBCodePage(void);
+int WINAPI GetKeyNameText(LONG, LPSTR, int);
+int WINAPI ToAscii(UINT wVirtKey, UINT wScanCode, BYTE FAR* lpKeyState, DWORD FAR* lpChar, UINT wFlags);
+
+#endif
+
+#endif /* NOKERNEL */
+
+/****** GDI typedefs, structures, and functions *****************************/
+
+DECLARE_HANDLE(HDC);
+
+#ifndef NOGDI
+
+#ifdef STRICT
+typedef const void NEAR* HGDIOBJ;
+#else
+DECLARE_HANDLE(HGDIOBJ);
+#endif
+
+#endif /* NOGDI */
+
+DECLARE_HANDLE(HBITMAP);
+DECLARE_HANDLE(HPEN);
+DECLARE_HANDLE(HBRUSH);
+DECLARE_HANDLE(HRGN);
+DECLARE_HANDLE(HPALETTE);
+DECLARE_HANDLE(HFONT);
+
+typedef struct tagRECT
+{
+ int left;
+ int top;
+ int right;
+ int bottom;
+} RECT;
+typedef RECT* PRECT;
+typedef RECT NEAR* NPRECT;
+typedef RECT FAR* LPRECT;
+
+typedef struct tagPOINT
+{
+ int x;
+ int y;
+} POINT;
+typedef POINT* PPOINT;
+typedef POINT NEAR* NPPOINT;
+typedef POINT FAR* LPPOINT;
+
+#if (WINVER >= 0x030a)
+typedef struct tagSIZE
+{
+ int cx;
+ int cy;
+} SIZE;
+typedef SIZE* PSIZE;
+typedef SIZE NEAR* NPSIZE;
+typedef SIZE FAR* LPSIZE;
+#endif /* WINVER >= 0x030a */
+
+#define MAKEPOINT(l) (*((POINT FAR*)&(l)))
+
+#ifndef NOGDI
+
+/****** DC Management *******************************************************/
+
+HDC WINAPI CreateDC(LPCSTR, LPCSTR, LPCSTR, const void FAR*);
+HDC WINAPI CreateIC(LPCSTR, LPCSTR, LPCSTR, const void FAR*);
+HDC WINAPI CreateCompatibleDC(HDC);
+
+BOOL WINAPI DeleteDC(HDC);
+
+DWORD WINAPI GetDCOrg(HDC);
+DWORD WINAPI SetDCOrg(HDC, int, int); /* ;Internal */
+
+int WINAPI SaveDC(HDC);
+BOOL WINAPI RestoreDC(HDC, int);
+
+int WINAPI SetEnvironment(LPCSTR, const void FAR*, UINT);
+int WINAPI GetEnvironment(LPCSTR, void FAR*, UINT);
+
+int WINAPI MulDiv(int, int, int);
+
+#if (WINVER >= 0x030a)
+/* Drawing bounds accumulation APIs */
+UINT WINAPI SetBoundsRect(HDC hDC, const RECT FAR* lprcBounds, UINT flags);
+UINT WINAPI GetBoundsRect(HDC hDC, RECT FAR* lprcBounds, UINT flags);
+
+#define DCB_RESET 0x0001
+#define DCB_ACCUMULATE 0x0002
+#define DCB_DIRTY DCB_ACCUMULATE
+#define DCB_SET (DCB_RESET | DCB_ACCUMULATE)
+#define DCB_ENABLE 0x0004
+#define DCB_DISABLE 0x0008
+#define DCB_WINDOWMGR 0x8000 /* ;Internal */
+ /* ;Internal */
+/* Internal SelectBitmap stuff */ /* ;Internal */
+/*HBITMAP WINAPI SelectBitmap(HDC hDC, HBITMAP hbm);*/ /* ;Internal */
+#endif /* WINVER >= 0x030a */
+
+/****** Device Capabilities *************************************************/
+
+int WINAPI GetDeviceCaps(HDC, int);
+
+/* Device Parameters for GetDeviceCaps() */
+#define DRIVERVERSION 0
+#define TECHNOLOGY 2
+#define HORZSIZE 4
+#define VERTSIZE 6
+#define HORZRES 8
+#define VERTRES 10
+#define BITSPIXEL 12
+#define PLANES 14
+#define NUMBRUSHES 16
+#define NUMPENS 18
+#define NUMMARKERS 20
+#define NUMFONTS 22
+#define NUMCOLORS 24
+#define PDEVICESIZE 26
+#define CURVECAPS 28
+#define LINECAPS 30
+#define POLYGONALCAPS 32
+#define TEXTCAPS 34
+#define CLIPCAPS 36
+#define RASTERCAPS 38
+#define ASPECTX 40
+#define ASPECTY 42
+#define ASPECTXY 44
+
+#define LOGPIXELSX 88
+#define LOGPIXELSY 90
+
+#define SIZEPALETTE 104
+#define NUMRESERVED 106
+#define COLORRES 108
+
+#ifndef NOGDICAPMASKS
+
+/* GetDeviceCaps() return value masks */
+
+/* TECHNOLOGY */
+#define DT_PLOTTER 0
+#define DT_RASDISPLAY 1
+#define DT_RASPRINTER 2
+#define DT_RASCAMERA 3
+#define DT_CHARSTREAM 4
+#define DT_METAFILE 5
+#define DT_DISPFILE 6
+
+/* CURVECAPS */
+#define CC_NONE 0x0000
+#define CC_CIRCLES 0x0001
+#define CC_PIE 0x0002
+#define CC_CHORD 0x0004
+#define CC_ELLIPSES 0x0008
+#define CC_WIDE 0x0010
+#define CC_STYLED 0x0020
+#define CC_WIDESTYLED 0x0040
+#define CC_INTERIORS 0x0080
+#define CC_ROUNDRECT 0x0100
+
+/* LINECAPS */
+#define LC_NONE 0x0000
+#define LC_POLYLINE 0x0002
+#define LC_MARKER 0x0004
+#define LC_POLYMARKER 0x0008
+#define LC_WIDE 0x0010
+#define LC_STYLED 0x0020
+#define LC_WIDESTYLED 0x0040
+#define LC_INTERIORS 0x0080
+
+/* POLYGONALCAPS */
+#define PC_NONE 0x0000
+#define PC_POLYGON 0x0001
+#define PC_RECTANGLE 0x0002
+#define PC_WINDPOLYGON 0x0004
+#define PC_SCANLINE 0x0008
+#define PC_WIDE 0x0010
+#define PC_STYLED 0x0020
+#define PC_WIDESTYLED 0x0040
+#define PC_INTERIORS 0x0080
+
+/* TEXTCAPS */
+#define TC_OP_CHARACTER 0x0001
+#define TC_OP_STROKE 0x0002
+#define TC_CP_STROKE 0x0004
+#define TC_CR_90 0x0008
+#define TC_CR_ANY 0x0010
+#define TC_SF_X_YINDEP 0x0020
+#define TC_SA_DOUBLE 0x0040
+#define TC_SA_INTEGER 0x0080
+#define TC_SA_CONTIN 0x0100
+#define TC_EA_DOUBLE 0x0200
+#define TC_IA_ABLE 0x0400
+#define TC_UA_ABLE 0x0800
+#define TC_SO_ABLE 0x1000
+#define TC_RA_ABLE 0x2000
+#define TC_VA_ABLE 0x4000
+#define TC_RESERVED 0x8000
+
+/* CLIPCAPS */
+#define CP_NONE 0x0000
+#define CP_RECTANGLE 0x0001
+#define CP_REGION 0x0002
+
+/* RASTERCAPS */
+#define RC_NONE
+#define RC_BITBLT 0x0001
+#define RC_BANDING 0x0002
+#define RC_SCALING 0x0004
+#define RC_BITMAP64 0x0008
+#define RC_GDI20_OUTPUT 0x0010
+#define RC_GDI20_STATE 0x0020
+#define RC_SAVEBITMAP 0x0040
+#define RC_DI_BITMAP 0x0080
+#define RC_PALETTE 0x0100
+#define RC_DIBTODEV 0x0200
+#define RC_BIGFONT 0x0400
+#define RC_STRETCHBLT 0x0800
+#define RC_FLOODFILL 0x1000
+#define RC_STRETCHDIB 0x2000
+#define RC_OP_DX_OUTPUT 0x4000
+#define RC_DEVBITS 0x8000
+
+#endif /* NOGDICAPMASKS */
+
+/****** Coordinate transformation support ***********************************/
+
+int WINAPI SetMapMode(HDC, int);
+int WINAPI GetMapMode(HDC);
+
+/* Map modes */
+#define MM_TEXT 1
+#define MM_LOMETRIC 2
+#define MM_HIMETRIC 3
+#define MM_LOENGLISH 4
+#define MM_HIENGLISH 5
+#define MM_TWIPS 6
+#define MM_ISOTROPIC 7
+#define MM_ANISOTROPIC 8
+
+DWORD WINAPI SetWindowOrg(HDC, int, int);
+DWORD WINAPI GetWindowOrg(HDC);
+
+DWORD WINAPI SetWindowExt(HDC, int, int);
+DWORD WINAPI GetWindowExt(HDC);
+
+DWORD WINAPI OffsetWindowOrg(HDC, int, int);
+DWORD WINAPI ScaleWindowExt(HDC, int, int, int, int);
+
+DWORD WINAPI SetViewportOrg(HDC, int, int);
+DWORD WINAPI GetViewportOrg(HDC);
+
+DWORD WINAPI SetViewportExt(HDC, int, int);
+DWORD WINAPI GetViewportExt(HDC);
+
+DWORD WINAPI OffsetViewportOrg(HDC, int, int);
+DWORD WINAPI ScaleViewportExt(HDC, int, int, int, int);
+
+#if (WINVER >= 0x030a)
+BOOL WINAPI SetWindowOrgEx(HDC, int, int, POINT FAR*);
+BOOL WINAPI GetWindowOrgEx(HDC, POINT FAR*);
+
+BOOL WINAPI SetWindowExtEx(HDC, int, int, SIZE FAR*);
+BOOL WINAPI GetWindowExtEx(HDC, SIZE FAR*);
+
+BOOL WINAPI OffsetWindowOrgEx(HDC, int, int, POINT FAR*);
+BOOL WINAPI ScaleWindowExtEx(HDC, int, int, int, int, SIZE FAR*);
+
+BOOL WINAPI SetViewportExtEx(HDC, int, int, SIZE FAR*);
+BOOL WINAPI GetViewportExtEx(HDC, SIZE FAR*);
+
+BOOL WINAPI SetViewportOrgEx(HDC, int, int, POINT FAR*);
+BOOL WINAPI GetViewportOrgEx(HDC, POINT FAR*);
+
+BOOL WINAPI OffsetViewportOrgEx(HDC, int, int, POINT FAR*);
+BOOL WINAPI ScaleViewportExtEx(HDC, int, int, int, int, SIZE FAR*);
+#endif /* WINVER >= 0x030a */
+
+BOOL WINAPI DPtoLP(HDC, POINT FAR*, int);
+BOOL WINAPI LPtoDP(HDC, POINT FAR*, int);
+
+int WINAPI SetRelAbs(HDC, int); /* ;Internal */
+int WINAPI GetRelAbs(HDC); /* ;Internal */
+
+/* Coordinate Modes */
+#define ABSOLUTE 1
+#define RELATIVE 2
+
+/****** Color support *******************************************************/
+
+typedef DWORD COLORREF;
+
+#define RGB(r,g,b) ((COLORREF)(((BYTE)(r)|((WORD)(g)<<8))|(((DWORD)(BYTE)(b))<<16)))
+
+#define GetRValue(rgb) ((BYTE)(rgb))
+#define GetGValue(rgb) ((BYTE)(((WORD)(rgb)) >> 8))
+#define GetBValue(rgb) ((BYTE)((rgb)>>16))
+
+COLORREF WINAPI GetNearestColor(HDC, COLORREF);
+
+#ifndef NOCOLOR
+
+COLORREF WINAPI GetSysColor(int);
+void WINAPI SetSysColors(int, const int FAR*, const COLORREF FAR*);
+
+#define COLOR_SCROLLBAR 0
+#define COLOR_BACKGROUND 1
+#define COLOR_ACTIVECAPTION 2
+#define COLOR_INACTIVECAPTION 3
+#define COLOR_MENU 4
+#define COLOR_WINDOW 5
+#define COLOR_WINDOWFRAME 6
+#define COLOR_MENUTEXT 7
+#define COLOR_WINDOWTEXT 8
+#define COLOR_CAPTIONTEXT 9
+#define COLOR_ACTIVEBORDER 10
+#define COLOR_INACTIVEBORDER 11
+#define COLOR_APPWORKSPACE 12
+#define COLOR_HIGHLIGHT 13
+#define COLOR_HIGHLIGHTTEXT 14
+#define COLOR_BTNFACE 15
+#define COLOR_BTNSHADOW 16
+#define COLOR_GRAYTEXT 17
+#define COLOR_BTNTEXT 18
+#if (WINVER >= 0x030a)
+#define COLOR_INACTIVECAPTIONTEXT 19
+#define COLOR_BTNHIGHLIGHT 20
+#define COLOR_MAX 20 /* ;Internal */
+#else /* WINVER >= 0x030a */ /* ;Internal */
+#define COLOR_MAX 18 /* ;Internal */
+#endif /* WINVER >= 0x030a */
+#define COLOR_ENDCOLORS COLOR_MAX /* ;Internal */
+
+#endif /* NOCOLOR */
+
+#define WM_SYSCOLORCHANGE 0x0015
+
+/****** GDI Object Support **************************************************/
+
+#ifndef NOGDIOBJ
+
+HGDIOBJ WINAPI GetStockObject(int);
+
+BOOL WINAPI IsGDIObject(HGDIOBJ);
+#define GDIOBJ_PEN 1 /* ;Internal */
+#define GDIOBJ_BRUSH 2 /* ;Internal */
+#define GDIOBJ_FONT 3 /* ;Internal */
+#define GDIOBJ_PALETTE 4 /* ;Internal */
+#define GDIOBJ_BITMAP 5 /* ;Internal */
+#define GDIOBJ_RGN 6 /* ;Internal */
+#define GDIOBJ_DC 7 /* ;Internal */
+#define GDIOBJ_IC 8 /* ;Internal */
+#define GDIOBJ_DISABLEDDC 9 /* ;Internal */
+#define GDIOBJ_METADC 10 /* ;Internal */
+#define GDIOBJ_METAFILE 11 /* ;Internal */
+
+BOOL WINAPI DeleteObject(HGDIOBJ);
+HGDIOBJ WINAPI SelectObject(HDC, HGDIOBJ);
+int WINAPI GetObject(HGDIOBJ, int, void FAR*);
+BOOL WINAPI UnrealizeObject(HGDIOBJ);
+
+#ifdef STRICT
+typedef (CALLBACK* GOBJENUMPROC)(void FAR*, LPARAM);
+#else
+typedef FARPROC GOBJENUMPROC;
+#endif
+
+#ifdef STRICT
+int WINAPI EnumObjects(HDC, int, GOBJENUMPROC, LPARAM);
+#else
+int WINAPI EnumObjects(HDC, int, GOBJENUMPROC, LPSTR);
+#endif
+
+/* Object types for EnumObjects() */
+#define OBJ_PEN 1
+#define OBJ_BRUSH 2
+
+/****** Pen support *********************************************************/
+
+/* Logical Pen */
+typedef struct tagLOGPEN
+{
+ UINT lopnStyle;
+ POINT lopnWidth;
+ COLORREF lopnColor;
+} LOGPEN;
+typedef LOGPEN* PLOGPEN;
+typedef LOGPEN NEAR* NPLOGPEN;
+typedef LOGPEN FAR* LPLOGPEN;
+
+/* Pen Styles */
+#define PS_SOLID 0
+#define PS_DASH 1
+#define PS_DOT 2
+#define PS_DASHDOT 3
+#define PS_DASHDOTDOT 4
+#define PS_NULL 5
+#define PS_INSIDEFRAME 6
+
+HPEN WINAPI CreatePen(int, int, COLORREF);
+HPEN WINAPI CreatePenIndirect(LOGPEN FAR*);
+
+/* Stock pens for use with GetStockObject(); */
+#define WHITE_PEN 6
+#define BLACK_PEN 7
+#define NULL_PEN 8
+
+/****** Brush support *******************************************************/
+
+/* Brush Styles */
+#define BS_SOLID 0
+#define BS_NULL 1
+#define BS_HOLLOW BS_NULL
+#define BS_HATCHED 2
+#define BS_PATTERN 3
+#define BS_INDEXED 4
+#define BS_DIBPATTERN 5
+
+/* Hatch Styles */
+#define HS_HORIZONTAL 0
+#define HS_VERTICAL 1
+#define HS_FDIAGONAL 2
+#define HS_BDIAGONAL 3
+#define HS_CROSS 4
+#define HS_DIAGCROSS 5
+
+/* Logical Brush (or Pattern) */
+typedef struct tagLOGBRUSH
+{
+ UINT lbStyle;
+ COLORREF lbColor;
+ int lbHatch;
+} LOGBRUSH;
+typedef LOGBRUSH* PLOGBRUSH;
+typedef LOGBRUSH NEAR* NPLOGBRUSH;
+typedef LOGBRUSH FAR* LPLOGBRUSH;
+
+typedef LOGBRUSH PATTERN;
+typedef PATTERN* PPATTERN;
+typedef PATTERN NEAR* NPPATTERN;
+typedef PATTERN FAR* LPPATTERN;
+
+HBRUSH WINAPI CreateSolidBrush(COLORREF);
+HBRUSH WINAPI CreateHatchBrush(int, COLORREF);
+HBRUSH WINAPI CreatePatternBrush(HBITMAP);
+HBRUSH WINAPI CreateDIBPatternBrush(HGLOBAL, UINT);
+HBRUSH WINAPI CreateBrushIndirect(LOGBRUSH FAR*);
+
+/* Stock brushes for use with GetStockObject() */
+#define WHITE_BRUSH 0
+#define LTGRAY_BRUSH 1
+#define GRAY_BRUSH 2
+#define DKGRAY_BRUSH 3
+#define BLACK_BRUSH 4
+#define NULL_BRUSH 5
+#define HOLLOW_BRUSH NULL_BRUSH
+
+DWORD WINAPI SetBrushOrg(HDC, int, int);
+DWORD WINAPI GetBrushOrg(HDC);
+
+#if (WINVER >= 0x030a)
+BOOL WINAPI GetBrushOrgEx(HDC, POINT FAR*);
+#endif /* WINVER >= 0x030a */
+#endif /* NOGDIOBJ */
+
+/****** Region support ******************************************************/
+
+HRGN WINAPI CreateRectRgn(int, int, int, int);
+HRGN WINAPI CreateRectRgnIndirect(const RECT FAR*);
+HRGN WINAPI CreateEllipticRgnIndirect(const RECT FAR*);
+HRGN WINAPI CreateEllipticRgn(int, int, int, int);
+HRGN WINAPI CreatePolygonRgn(const POINT FAR*, int, int);
+HRGN WINAPI CreatePolyPolygonRgn(const POINT FAR*, const int FAR*, int, int);
+HRGN WINAPI CreateRoundRectRgn(int, int, int, int, int, int);
+
+/* Region type flags */
+#define ERROR 0
+#define NULLREGION 1
+#define SIMPLEREGION 2
+#define COMPLEXREGION 3
+
+void WINAPI SetRectRgn(HRGN, int, int, int, int);
+
+int WINAPI CombineRgn(HRGN, HRGN, HRGN, int);
+
+/* CombineRgn() command values */
+#define RGN_AND 1
+#define RGN_OR 2
+#define RGN_XOR 3
+#define RGN_DIFF 4
+#define RGN_COPY 5
+
+BOOL WINAPI EqualRgn(HRGN, HRGN);
+int WINAPI OffsetRgn(HRGN, int, int);
+
+int WINAPI GetRgnBox(HRGN, RECT FAR*);
+
+BOOL WINAPI RectInRegion(HRGN, const RECT FAR*);
+BOOL WINAPI PtInRegion(HRGN, int, int);
+
+/****** Color palette Support ************************************************/
+
+#define PALETTERGB(r,g,b) (0x02000000L | RGB(r,g,b))
+#define PALETTEINDEX(i) ((COLORREF)(0x01000000L | (DWORD)(WORD)(i)))
+
+typedef struct tagPALETTEENTRY
+{
+ BYTE peRed;
+ BYTE peGreen;
+ BYTE peBlue;
+ BYTE peFlags;
+} PALETTEENTRY;
+typedef PALETTEENTRY FAR* LPPALETTEENTRY;
+
+/* Palette entry flags */
+#define PC_RESERVED 0x01 /* palette index used for animation */
+#define PC_EXPLICIT 0x02 /* palette index is explicit to device */
+#define PC_NOCOLLAPSE 0x04 /* do not match color to system palette */
+
+/* Logical Palette */
+typedef struct tagLOGPALETTE
+{
+ WORD palVersion;
+ WORD palNumEntries;
+ PALETTEENTRY palPalEntry[1];
+} LOGPALETTE;
+typedef LOGPALETTE* PLOGPALETTE;
+typedef LOGPALETTE NEAR* NPLOGPALETTE;
+typedef LOGPALETTE FAR* LPLOGPALETTE;
+
+HPALETTE WINAPI CreatePalette(const LOGPALETTE FAR*);
+
+HPALETTE WINAPI SelectPalette(HDC, HPALETTE, BOOL);
+
+UINT WINAPI RealizePalette(HDC);
+
+int WINAPI UpdateColors(HDC);
+void WINAPI AnimatePalette(HPALETTE, UINT, UINT, const PALETTEENTRY FAR*);
+
+UINT WINAPI SetPaletteEntries(HPALETTE, UINT, UINT, const PALETTEENTRY FAR*);
+UINT WINAPI GetPaletteEntries(HPALETTE, UINT, UINT, PALETTEENTRY FAR*);
+
+UINT WINAPI GetNearestPaletteIndex(HPALETTE, COLORREF);
+
+BOOL WINAPI ResizePalette(HPALETTE, UINT);
+
+UINT WINAPI GetSystemPaletteEntries(HDC, UINT, UINT, PALETTEENTRY FAR*);
+
+UINT WINAPI GetSystemPaletteUse(HDC);
+UINT WINAPI SetSystemPaletteUse(HDC, UINT);
+
+/* Get/SetSystemPaletteUse() values */
+#define SYSPAL_STATIC 1
+#define SYSPAL_NOSTATIC 2
+
+/* Palette window messages */
+#define WM_QUERYNEWPALETTE 0x030F
+#define WM_PALETTEISCHANGING 0x0310
+#define WM_PALETTECHANGED 0x0311
+#define WM_PALETTEGONNACHANGE WM_PALETTEISCHANGING /* ;Internal */
+#define WM_CHANGEPALETTE WM_PALETTECHANGED /* ;Internal */
+
+/****** Clipping support *****************************************************/
+
+int WINAPI SelectClipRgn(HDC, HRGN);
+int WINAPI GetClipBox(HDC, RECT FAR*);
+
+int WINAPI IntersectClipRect(HDC, int, int, int, int);
+int WINAPI OffsetClipRgn(HDC, int, int);
+int WINAPI ExcludeClipRect(HDC, int, int, int, int);
+
+BOOL WINAPI PtVisible(HDC, int, int);
+BOOL WINAPI RectVisible(HDC, const RECT FAR*);
+
+#if (WINVER >= 0x030a) /* ;Internal */
+/* DC hook callback function */ /* ;Internal */
+ /* ;Internal */
+typedef UINT (CALLBACK* DCHOOKPROC)(HDC hDC, UINT code, DWORD data, DWORD lParam); /* ;Internal */
+ /* ;Internal */
+BOOL WINAPI SetDCHook(HDC hDC, DCHOOKPROC lpNewProc, DWORD data); /* ;Internal */
+DWORD WINAPI GetDCHook(HDC hDC, DCHOOKPROC FAR* lplpproc); /* ;Internal */
+ /* ;Internal */
+/* Callback reason code values */ /* ;Internal */
+ /* ;Internal */
+#define DCHC_INVALIDVISRGN 0x0001 /* ;Internal */
+#define DCHC_DELETEDC 0x0002 /* ;Internal */
+ /* ;Internal */
+UINT WINAPI SetHookFlags(HDC hDC, UINT flags); /* ;Internal */
+ /* ;Internal */
+#define DCHF_INVALIDATEVISRGN 0x0001 /* ;Internal */
+#define DCHF_VALIDATEVISRGN 0x0002 /* ;Internal */
+#endif /* WINVER >= 0x030a */ /* ;Internal */
+
+/****** General drawing support ********************************************/
+
+DWORD WINAPI MoveTo(HDC, int, int);
+DWORD WINAPI GetCurrentPosition(HDC);
+
+#if (WINVER >= 0x030a)
+BOOL WINAPI MoveToEx(HDC, int, int, POINT FAR*);
+BOOL WINAPI GetCurrentPositionEx(HDC, POINT FAR*);
+#endif /* WINVER >= 0x030a */
+
+BOOL WINAPI LineTo(HDC, int, int);
+BOOL WINAPI Polyline(HDC, const POINT FAR*, int);
+
+#ifdef STRICT
+typedef void (CALLBACK* LINEDDAPROC)(int, int, LPARAM);
+#else
+typedef FARPROC LINEDDAPROC;
+#endif
+
+void WINAPI LineDDA(int, int, int, int, LINEDDAPROC, LPARAM);
+
+BOOL WINAPI Rectangle(HDC, int, int, int, int);
+BOOL WINAPI RoundRect(HDC, int, int, int, int, int, int);
+
+BOOL WINAPI Ellipse(HDC, int, int, int, int);
+BOOL WINAPI Arc(HDC, int, int, int, int, int, int, int, int);
+BOOL WINAPI Chord(HDC, int, int, int, int, int, int, int, int);
+BOOL WINAPI Pie(HDC, int, int, int, int, int, int, int, int);
+
+BOOL WINAPI Polygon(HDC, const POINT FAR*, int);
+BOOL WINAPI PolyPolygon(HDC, const POINT FAR*, int FAR*, int);
+
+/* PolyFill Modes */
+#define ALTERNATE 1
+#define WINDING 2
+
+int WINAPI SetPolyFillMode(HDC, int);
+int WINAPI GetPolyFillMode(HDC);
+
+BOOL WINAPI FloodFill(HDC, int, int, COLORREF);
+BOOL WINAPI ExtFloodFill(HDC, int, int, COLORREF, UINT);
+
+/* ExtFloodFill style flags */
+#define FLOODFILLBORDER 0
+#define FLOODFILLSURFACE 1
+
+BOOL WINAPI FillRgn(HDC, HRGN, HBRUSH);
+BOOL WINAPI FrameRgn(HDC, HRGN, HBRUSH, int, int);
+BOOL WINAPI InvertRgn(HDC, HRGN);
+BOOL WINAPI PaintRgn(HDC, HRGN);
+
+/* Rectangle output routines */
+int WINAPI FillRect(HDC, const RECT FAR*, HBRUSH);
+int WINAPI FrameRect(HDC, const RECT FAR*, HBRUSH);
+void WINAPI InvertRect(HDC, const RECT FAR*);
+
+void WINAPI DrawFocusRect(HDC, const RECT FAR*);
+
+BOOL WINAPI FastWindowFrame(HDC, const RECT FAR*, UINT, UINT, DWORD); /* ;Internal */
+
+/****** Text support ********************************************************/
+
+BOOL WINAPI TextOut(HDC, int, int, LPCSTR, int);
+LONG WINAPI TabbedTextOut(HDC, int, int, LPCSTR, int, int, int FAR*, int);
+BOOL WINAPI ExtTextOut(HDC, int, int, UINT, const RECT FAR*, LPCSTR, UINT, int FAR*);
+
+#define ETO_GRAYED 0x0001
+#define ETO_OPAQUE 0x0002
+#define ETO_CLIPPED 0x0004
+
+DWORD WINAPI GetTextExtent(HDC, LPCSTR, int);
+DWORD WINAPI GetTabbedTextExtent(HDC, LPCSTR, int, int, int FAR*);
+
+#if (WINVER >= 0x030a)
+BOOL WINAPI GetTextExtentPoint(HDC, LPCSTR, int, SIZE FAR*);
+#endif /* WINVER >= 0x030a */
+
+/* DrawText() Format Flags */
+#ifndef NODRAWTEXT
+#define DT_TOP 0x0000
+#define DT_LEFT 0x0000
+#define DT_CENTER 0x0001
+#define DT_RIGHT 0x0002
+#define DT_VCENTER 0x0004
+#define DT_BOTTOM 0x0008
+#define DT_WORDBREAK 0x0010
+#define DT_SINGLELINE 0x0020
+#define DT_EXPANDTABS 0x0040
+#define DT_TABSTOP 0x0080
+#define DT_NOCLIP 0x0100
+#define DT_EXTERNALLEADING 0x0200
+#define DT_CALCRECT 0x0400
+#define DT_NOPREFIX 0x0800
+#define DT_INTERNAL 0x1000
+#define DT_VALID 0x1fff /* ;Internal: Union of all those above */
+
+int WINAPI DrawText(HDC, LPCSTR, int, RECT FAR*, UINT);
+#endif /* NODRAWTEXT */
+
+#ifdef STRICT
+typedef BOOL (CALLBACK* GRAYSTRINGPROC)(HDC, LPARAM, int);
+#else
+typedef FARPROC GRAYSTRINGPROC;
+#endif
+
+BOOL WINAPI GrayString(HDC, HBRUSH, GRAYSTRINGPROC, LPARAM, int, int, int, int, int);
+
+BOOL WINAPI GetCharWidth(HDC, UINT, UINT, int FAR*);
+
+COLORREF WINAPI SetTextColor(HDC, COLORREF);
+COLORREF WINAPI GetTextColor(HDC);
+
+COLORREF WINAPI SetBkColor(HDC, COLORREF);
+COLORREF WINAPI GetBkColor(HDC);
+
+int WINAPI SetBkMode(HDC, int);
+int WINAPI GetBkMode(HDC);
+
+/* Background Modes */
+#define TRANSPARENT 1
+#define OPAQUE 2
+#define TRANSPARENT1 3 /* ;Internal */
+
+UINT WINAPI SetTextAlign(HDC, UINT);
+UINT WINAPI GetTextAlign(HDC);
+
+/* Text Alignment Options */
+#define TA_NOUPDATECP 0x0000
+#define TA_UPDATECP 0x0001
+#define TA_LEFT 0x0000
+#define TA_RIGHT 0x0002
+#define TA_CENTER 0x0006
+#define TA_TOP 0x0000
+#define TA_BOTTOM 0x0008
+#define TA_BASELINE 0x0018
+
+int WINAPI SetTextCharacterExtra(HDC, int);
+int WINAPI GetTextCharacterExtra(HDC);
+
+int WINAPI SetTextJustification(HDC, int, int);
+
+/****** Font support ********************************************************/
+
+#ifndef NOGDIOBJ
+/* Logical Font */
+#define LF_FACESIZE 32
+typedef struct tagLOGFONT
+{
+ int lfHeight;
+ int lfWidth;
+ int lfEscapement;
+ int lfOrientation;
+ int lfWeight;
+ BYTE lfItalic;
+ BYTE lfUnderline;
+ BYTE lfStrikeOut;
+ BYTE lfCharSet;
+ BYTE lfOutPrecision;
+ BYTE lfClipPrecision;
+ BYTE lfQuality;
+ BYTE lfPitchAndFamily;
+ char lfFaceName[LF_FACESIZE];
+} LOGFONT;
+typedef LOGFONT* PLOGFONT;
+typedef LOGFONT NEAR* NPLOGFONT;
+typedef LOGFONT FAR* LPLOGFONT;
+
+/* weight values */
+#define FW_DONTCARE 0
+#define FW_THIN 100
+#define FW_EXTRALIGHT 200
+#define FW_LIGHT 300
+#define FW_NORMAL 400
+#define FW_MEDIUM 500
+#define FW_SEMIBOLD 600
+#define FW_BOLD 700
+#define FW_EXTRABOLD 800
+#define FW_HEAVY 900
+
+#define FW_ULTRALIGHT FW_EXTRALIGHT
+#define FW_REGULAR FW_NORMAL
+#define FW_DEMIBOLD FW_SEMIBOLD
+#define FW_ULTRABOLD FW_EXTRABOLD
+#define FW_BLACK FW_HEAVY
+
+/* CharSet values */
+#define ANSI_CHARSET 0
+#define DEFAULT_CHARSET 1
+#define SYMBOL_CHARSET 2
+#define SHIFTJIS_CHARSET 128
+#define HANGEUL_CHARSET 129
+#define CHINESEBIG5_CHARSET 136
+#define OEM_CHARSET 255
+
+/* OutPrecision values */
+#define OUT_DEFAULT_PRECIS 0
+#define OUT_STRING_PRECIS 1
+#define OUT_CHARACTER_PRECIS 2
+#define OUT_STROKE_PRECIS 3
+#if (WINVER >= 0x030a)
+#define OUT_TT_PRECIS 4
+#define OUT_DEVICE_PRECIS 5
+#define OUT_RASTER_PRECIS 6
+#define OUT_TT_ONLY_PRECIS 7
+#endif /* WINVER >= 0x030a */
+
+/* ClipPrecision values */
+#define CLIP_DEFAULT_PRECIS 0x00
+#define CLIP_CHARACTER_PRECIS 0x01
+#define CLIP_STROKE_PRECIS 0x02
+#define CLIP_MASK 0x0F
+#if (WINVER >= 0x030a)
+#define CLIP_LH_ANGLES 0x10
+#define CLIP_TT_ALWAYS 0x20
+#define CLIP_EMBEDDED 0x80
+#endif /* WINVER >= 0x030a */
+
+/* Quality values */
+#define DEFAULT_QUALITY 0
+#define DRAFT_QUALITY 1
+#define PROOF_QUALITY 2
+
+/* PitchAndFamily pitch values (low 4 bits) */
+#define DEFAULT_PITCH 0x00
+#define FIXED_PITCH 0x01
+#define VARIABLE_PITCH 0x02
+
+/* PitchAndFamily family values (high 4 bits) */
+#define FF_DONTCARE 0x00
+#define FF_ROMAN 0x10
+#define FF_SWISS 0x20
+#define FF_MODERN 0x30
+#define FF_SCRIPT 0x40
+#define FF_DECORATIVE 0x50
+
+HFONT WINAPI CreateFont(int, int, int, int, int, BYTE, BYTE, BYTE, BYTE, BYTE, BYTE, BYTE, BYTE, LPCSTR);
+HFONT WINAPI CreateFontIndirect(const LOGFONT FAR*);
+
+/* Stock fonts for use with GetStockObject() */
+#define OEM_FIXED_FONT 10
+#define ANSI_FIXED_FONT 11
+#define ANSI_VAR_FONT 12
+#define SYSTEM_FONT 13
+#define DEVICE_DEFAULT_FONT 14
+#define DEFAULT_PALETTE 15
+#define SYSTEM_FIXED_FONT 16
+
+
+DWORD WINAPI SetMapperFlags(HDC, DWORD);
+#define ASPECT_FILTERING 0x00000001L
+
+int WINAPI AddFontResource(LPCSTR);
+BOOL WINAPI RemoveFontResource(LPCSTR);
+
+#define WM_FONTCHANGE 0x001D
+
+int WINAPI GetTextFace(HDC, int, LPSTR);
+
+DWORD WINAPI GetAspectRatioFilter(HDC);
+#if (WINVER >= 0x030a)
+BOOL WINAPI GetAspectRatioFilterEx(HDC, SIZE FAR*);
+#endif /* WINVER >= 0x030a */
+
+#endif /* NOGDIOBJ */
+
+#ifndef NOTEXTMETRIC
+
+typedef struct tagTEXTMETRIC
+{
+ int tmHeight;
+ int tmAscent;
+ int tmDescent;
+ int tmInternalLeading;
+ int tmExternalLeading;
+ int tmAveCharWidth;
+ int tmMaxCharWidth;
+ int tmWeight;
+ BYTE tmItalic;
+ BYTE tmUnderlined;
+ BYTE tmStruckOut;
+ BYTE tmFirstChar;
+ BYTE tmLastChar;
+ BYTE tmDefaultChar;
+ BYTE tmBreakChar;
+ BYTE tmPitchAndFamily;
+ BYTE tmCharSet;
+ int tmOverhang;
+ int tmDigitizedAspectX;
+ int tmDigitizedAspectY;
+} TEXTMETRIC;
+typedef TEXTMETRIC* PTEXTMETRIC;
+typedef TEXTMETRIC NEAR* NPTEXTMETRIC;
+typedef TEXTMETRIC FAR* LPTEXTMETRIC;
+
+/* tmPitchAndFamily values */
+#define TMPF_FIXED_PITCH 0x01
+#define TMPF_VECTOR 0x02
+#define TMPF_DEVICE 0x08
+#if (WINVER >= 0x030a)
+#define TMPF_TRUETYPE 0x04
+#endif /* WINVER >= 0x030a */
+
+BOOL WINAPI GetTextMetrics(HDC, TEXTMETRIC FAR*);
+
+#if (WINVER >= 0x030a)
+#ifndef NOSCALABLEFONT
+
+typedef struct tagPANOSE
+{
+ BYTE bFamilyType;
+ BYTE bSerifStyle;
+ BYTE bWeight;
+ BYTE bProportion;
+ BYTE bContrast;
+ BYTE bStrokeVariation;
+ BYTE bArmStyle;
+ BYTE bLetterform;
+ BYTE bMidline;
+ BYTE bXHeight;
+} PANOSE, FAR* LPPANOSE;
+
+typedef struct tagOUTLINETEXTMETRIC
+{
+ UINT otmSize;
+ TEXTMETRIC otmTextMetrics;
+ BYTE otmFiller;
+ PANOSE otmPanoseNumber;
+ UINT otmfsSelection;
+ UINT otmfsType;
+ int otmsCharSlopeRise;
+ int otmsCharSlopeRun;
+ int otmItalicAngle;
+ UINT otmEMSquare;
+ int otmAscent;
+ int otmDescent;
+ UINT otmLineGap;
+ UINT otmsCapEmHeight;
+ UINT otmsXHeight;
+ RECT otmrcFontBox;
+ int otmMacAscent;
+ int otmMacDescent;
+ UINT otmMacLineGap;
+ UINT otmusMinimumPPEM;
+ POINT otmptSubscriptSize;
+ POINT otmptSubscriptOffset;
+ POINT otmptSuperscriptSize;
+ POINT otmptSuperscriptOffset;
+ UINT otmsStrikeoutSize;
+ int otmsStrikeoutPosition;
+ int otmsUnderscorePosition;
+ int otmsUnderscoreSize;
+ PSTR otmpFamilyName;
+ PSTR otmpFaceName;
+ PSTR otmpStyleName;
+ PSTR otmpFullName;
+} OUTLINETEXTMETRIC, FAR* LPOUTLINETEXTMETRIC;
+
+WORD WINAPI GetOutlineTextMetrics(HDC, UINT, OUTLINETEXTMETRIC FAR*);
+
+#endif /* WINVER >= 0x030a */
+#endif /* NOSCALABLEFONT */
+
+#ifndef NOGDIOBJ
+#if (WINVER >= 0x030a)
+
+/* Structure passed to FONTENUMPROC */
+/* NOTE: NEWTEXTMETRIC is the same as TEXTMETRIC plus 4 new fields */
+typedef struct tagNEWTEXTMETRIC
+{
+ int tmHeight;
+ int tmAscent;
+ int tmDescent;
+ int tmInternalLeading;
+ int tmExternalLeading;
+ int tmAveCharWidth;
+ int tmMaxCharWidth;
+ int tmWeight;
+ BYTE tmItalic;
+ BYTE tmUnderlined;
+ BYTE tmStruckOut;
+ BYTE tmFirstChar;
+ BYTE tmLastChar;
+ BYTE tmDefaultChar;
+ BYTE tmBreakChar;
+ BYTE tmPitchAndFamily;
+ BYTE tmCharSet;
+ int tmOverhang;
+ int tmDigitizedAspectX;
+ int tmDigitizedAspectY;
+ DWORD ntmFlags;
+ UINT ntmSizeEM;
+ UINT ntmCellHeight;
+ UINT ntmAvgWidth;
+} NEWTEXTMETRIC;
+typedef NEWTEXTMETRIC* PNEWTEXTMETRIC;
+typedef NEWTEXTMETRIC NEAR* NPNEWTEXTMETRIC;
+typedef NEWTEXTMETRIC FAR* LPNEWTEXTMETRIC;
+
+/* ntmFlags field flags */
+#define NTM_REGULAR 0x00000040L
+#define NTM_BOLD 0x00000020L
+#define NTM_ITALIC 0x00000001L
+
+#define LF_FULLFACESIZE 64
+
+/* Structure passed to FONTENUMPROC */
+typedef struct tagENUMLOGFONT
+{
+ LOGFONT elfLogFont;
+ char elfFullName[LF_FULLFACESIZE];
+ char elfStyle[LF_FACESIZE];
+} ENUMLOGFONT, FAR* LPENUMLOGFONT;
+
+#endif /* WINVER >= 0x030a */
+#endif /* NOGDIOBJ */
+
+#ifdef STRICT
+#ifndef NOGDIOBJ
+
+typedef int (CALLBACK* OLDFONTENUMPROC)(const LOGFONT FAR*, const TEXTMETRIC FAR*, int, LPARAM);
+
+#if (WINVER >= 0x030a)
+typedef int (CALLBACK* FONTENUMPROC)(const ENUMLOGFONT FAR*, const NEWTEXTMETRIC FAR*, int, LPARAM);
+
+int WINAPI EnumFontFamilies(HDC, LPCSTR, FONTENUMPROC, LPARAM);
+
+#else /* WINVER >= 0x030a */
+typedef OLDFONTENUMPROC FONTENUMPROC;
+#endif /* WINVER >= 0x030a) */
+
+int WINAPI EnumFonts(HDC, LPCSTR, OLDFONTENUMPROC, LPARAM);
+#endif /* NOGDIOBJ */
+
+#else /* STRICT */
+
+typedef FARPROC OLDFONTENUMPROC;
+typedef FARPROC FONTENUMPROC;
+
+int WINAPI EnumFonts(HDC, LPCSTR, OLDFONTENUMPROC, LPSTR);
+
+#if (WINVER >= 0x030a)
+int WINAPI EnumFontFamilies(HDC, LPCSTR, FONTENUMPROC, LPSTR);
+#endif /* WINVER >= 0x030a */
+
+#endif /* !STRICT */
+
+/* EnumFonts font type values */
+#define RASTER_FONTTYPE 0x0001
+#define DEVICE_FONTTYPE 0X0002
+#if (WINVER >= 0x030a)
+#define TRUETYPE_FONTTYPE 0x0004
+#endif /* WINVER >= 0x030a */
+
+#endif /* NOTEXTMETRIC */
+
+#ifndef NOSCALABLEFONT
+#if (WINVER >= 0x030a)
+
+DWORD WINAPI ConvertOutlineFontFile(LPCSTR, LPCSTR, LPCSTR); /* ;Internal */
+DWORD WINAPI GetFontData(HDC, DWORD, DWORD, void FAR*, DWORD);
+BOOL WINAPI CreateScalableFontResource(UINT, LPCSTR, LPCSTR, LPCSTR);
+
+typedef struct tagGLYPHMETRICS
+{
+ UINT gmBlackBoxX;
+ UINT gmBlackBoxY;
+ POINT gmptGlyphOrigin;
+ int gmCellIncX;
+ int gmCellIncY;
+} GLYPHMETRICS, FAR* LPGLYPHMETRICS;
+
+typedef struct tagFIXED
+{
+ UINT fract;
+ int value;
+} FIXED, FAR* LPFIXED;
+
+typedef struct tagMAT2
+{
+ FIXED eM11;
+ FIXED eM12;
+ FIXED eM21;
+ FIXED eM22;
+} MAT2, FAR* LPMAT2;
+
+DWORD WINAPI GetGlyphOutline(HDC, UINT, UINT, GLYPHMETRICS FAR*, DWORD, void FAR*, const MAT2 FAR*);
+
+/* GetGlyphOutline constants */
+#define GGO_METRICS 0
+#define GGO_BITMAP 1
+#define GGO_NATIVE 2
+
+#define TT_POLYGON_TYPE 24
+
+#define TT_PRIM_LINE 1
+#define TT_PRIM_QSPLINE 2
+
+typedef struct tagPOINTFX
+{
+ FIXED x;
+ FIXED y;
+} POINTFX, FAR* LPPOINTFX;
+
+typedef struct tagTTPOLYCURVE
+{
+ UINT wType;
+ UINT cpfx;
+ POINTFX apfx[1];
+} TTPOLYCURVE, FAR* LPTTPOLYCURVE;
+
+typedef struct tagTTPOLYGONHEADER
+{
+ DWORD cb;
+ DWORD dwType;
+ POINTFX pfxStart;
+} TTPOLYGONHEADER, FAR* LPTTPOLYGONHEADER;
+
+typedef UINT FAR* LPFONTDIR; /* ;Internal */
+ /* ;Internal */
+DWORD WINAPI EngineMakeFontDir(HDC, LPFONTDIR, LPCSTR); /* ;Internal */
+ /* ;Internal */
+typedef struct tagABC
+{
+ int abcA;
+ UINT abcB;
+ int abcC;
+} ABC;
+typedef ABC FAR* LPABC;
+
+BOOL WINAPI GetCharABCWidths(HDC, UINT, UINT, ABC FAR*);
+
+typedef struct tagKERNINGPAIR
+{
+ WORD wFirst;
+ WORD wSecond;
+ int iKernAmount;
+} KERNINGPAIR, FAR* LPKERNINGPAIR;
+
+int WINAPI GetKerningPairs(HDC, int, KERNINGPAIR FAR*);
+
+typedef struct tagRASTERIZER_STATUS
+{
+ int nSize;
+ int wFlags;
+ int nLanguageID;
+} RASTERIZER_STATUS;
+typedef RASTERIZER_STATUS FAR* LPRASTERIZER_STATUS;
+
+/* bits defined in wFlags of RASTERIZER_STATUS */
+#define TT_AVAILABLE 0x0001
+#define TT_ENABLED 0x0002
+
+BOOL WINAPI GetRasterizerCaps(RASTERIZER_STATUS FAR*, int);
+
+#endif /* WINVER >= 0x030a */
+#endif /* NOSCALABLEFONT */
+
+/****** Bitmap support ******************************************************/
+
+#ifndef NOBITMAP
+typedef struct tagBITMAP
+{
+ int bmType;
+ int bmWidth;
+ int bmHeight;
+ int bmWidthBytes;
+ BYTE bmPlanes;
+ BYTE bmBitsPixel;
+ void FAR* bmBits;
+} BITMAP;
+typedef BITMAP* PBITMAP;
+typedef BITMAP NEAR* NPBITMAP;
+typedef BITMAP FAR* LPBITMAP;
+
+/* Bitmap Header structures */
+typedef struct tagRGBTRIPLE
+{
+ BYTE rgbtBlue;
+ BYTE rgbtGreen;
+ BYTE rgbtRed;
+} RGBTRIPLE;
+typedef RGBTRIPLE FAR* LPRGBTRIPLE;
+
+typedef struct tagRGBQUAD
+{
+ BYTE rgbBlue;
+ BYTE rgbGreen;
+ BYTE rgbRed;
+ BYTE rgbReserved;
+} RGBQUAD;
+typedef RGBQUAD FAR* LPRGBQUAD;
+
+/* structures for defining DIBs */
+typedef struct tagBITMAPCOREHEADER
+{
+ DWORD bcSize;
+ short bcWidth;
+ short bcHeight;
+ WORD bcPlanes;
+ WORD bcBitCount;
+} BITMAPCOREHEADER;
+typedef BITMAPCOREHEADER* PBITMAPCOREHEADER;
+typedef BITMAPCOREHEADER FAR* LPBITMAPCOREHEADER;
+
+typedef struct tagBITMAPINFOHEADER
+{
+ DWORD biSize;
+ LONG biWidth;
+ LONG biHeight;
+ WORD biPlanes;
+ WORD biBitCount;
+ DWORD biCompression;
+ DWORD biSizeImage;
+ LONG biXPelsPerMeter;
+ LONG biYPelsPerMeter;
+ DWORD biClrUsed;
+ DWORD biClrImportant;
+} BITMAPINFOHEADER;
+typedef BITMAPINFOHEADER* PBITMAPINFOHEADER;
+typedef BITMAPINFOHEADER FAR* LPBITMAPINFOHEADER;
+
+/* constants for the biCompression field */
+#define BI_RGB 0L
+#define BI_RLE8 1L
+#define BI_RLE4 2L
+
+typedef struct tagBITMAPINFO
+{
+ BITMAPINFOHEADER bmiHeader;
+ RGBQUAD bmiColors[1];
+} BITMAPINFO;
+typedef BITMAPINFO* PBITMAPINFO;
+typedef BITMAPINFO FAR* LPBITMAPINFO;
+
+typedef struct tagBITMAPCOREINFO
+{
+ BITMAPCOREHEADER bmciHeader;
+ RGBTRIPLE bmciColors[1];
+} BITMAPCOREINFO;
+typedef BITMAPCOREINFO* PBITMAPCOREINFO;
+typedef BITMAPCOREINFO FAR* LPBITMAPCOREINFO;
+
+typedef struct tagBITMAPFILEHEADER
+{
+ UINT bfType;
+ DWORD bfSize;
+ UINT bfReserved1;
+ UINT bfReserved2;
+ DWORD bfOffBits;
+} BITMAPFILEHEADER;
+typedef BITMAPFILEHEADER* PBITMAPFILEHEADER;
+typedef BITMAPFILEHEADER FAR* LPBITMAPFILEHEADER;
+
+/* Pel Array */ /* ;Internal */
+typedef struct tagPELARRAY /* ;Internal */
+{ /* ;Internal */
+ int paXCount; /* ;Internal */
+ int paYCount; /* ;Internal */
+ int paXExt; /* ;Internal */
+ int paYExt; /* ;Internal */
+ BYTE paRGBs; /* ;Internal */
+} PELARRAY; /* ;Internal */
+typedef PELARRAY* PPELARRAY; /* ;Internal */
+typedef PELARRAY NEAR* NPPELARRAY; /* ;Internal */
+typedef PELARRAY FAR* LPPELARRAY; /* ;Internal */
+
+HBITMAP WINAPI CreateBitmap(int, int, UINT, UINT, const void FAR*);
+HBITMAP WINAPI CreateBitmapIndirect(BITMAP FAR* );
+HBITMAP WINAPI CreateCompatibleBitmap(HDC, int, int);
+HBITMAP WINAPI CreateDiscardableBitmap(HDC, int, int);
+HBITMAP WINAPI CreateDIBitmap(HDC, BITMAPINFOHEADER FAR*, DWORD, const void FAR*, BITMAPINFO FAR*, UINT);
+
+HBITMAP WINAPI LoadBitmap(HINSTANCE, LPCSTR);
+
+/* DIB color table identifiers */
+#define DIB_RGB_COLORS 0
+#define DIB_PAL_COLORS 1
+
+/* constants for CreateDIBitmap */
+#define CBM_INIT 0x00000004L
+#endif /* NOBITMAP */
+
+#ifndef NORASTEROPS
+
+/* Binary raster ops */
+#define R2_BLACK 1
+#define R2_NOTMERGEPEN 2
+#define R2_MASKNOTPEN 3
+#define R2_NOTCOPYPEN 4
+#define R2_MASKPENNOT 5
+#define R2_NOT 6
+#define R2_XORPEN 7
+#define R2_NOTMASKPEN 8
+#define R2_MASKPEN 9
+#define R2_NOTXORPEN 10
+#define R2_NOP 11
+#define R2_MERGENOTPEN 12
+#define R2_COPYPEN 13
+#define R2_MERGEPENNOT 14
+#define R2_MERGEPEN 15
+#define R2_WHITE 16
+
+/* Ternary raster operations */
+#define SRCCOPY 0x00CC0020L
+#define SRCPAINT 0x00EE0086L
+#define SRCAND 0x008800C6L
+#define SRCINVERT 0x00660046L
+#define SRCERASE 0x00440328L
+#define NOTSRCCOPY 0x00330008L
+#define NOTSRCERASE 0x001100A6L
+#define MERGECOPY 0x00C000CAL
+#define MERGEPAINT 0x00BB0226L
+#define PATCOPY 0x00F00021L
+#define PATPAINT 0x00FB0A09L
+#define PATINVERT 0x005A0049L
+#define DSTINVERT 0x00550009L
+#define BLACKNESS 0x00000042L
+#define WHITENESS 0x00FF0062L
+
+#endif /* NORASTEROPS */
+
+#ifndef NOBITMAP
+BOOL WINAPI BitBlt(HDC, int, int, int, int, HDC, int, int, DWORD);
+
+BOOL WINAPI PatBlt(HDC, int, int, int, int, DWORD);
+
+BOOL WINAPI StretchBlt(HDC, int, int, int, int, HDC, int, int, int, int, DWORD);
+int WINAPI StretchDIBits(HDC, int, int, int, int, int,
+ int, int, int, const void FAR*, LPBITMAPINFO, UINT, DWORD);
+
+COLORREF WINAPI SetPixel(HDC, int, int, COLORREF);
+COLORREF WINAPI GetPixel(HDC, int, int);
+
+/* StretchBlt() Modes */
+#define BLACKONWHITE 1
+#define WHITEONBLACK 2
+#define COLORONCOLOR 3
+
+/* new StretchBlt() Modes (simpler names) */
+#define STRETCH_ANDSCANS 1
+#define STRETCH_ORSCANS 2
+#define STRETCH_DELETESCANS 3
+
+int WINAPI SetStretchBltMode(HDC, int);
+int WINAPI GetStretchBltMode(HDC);
+
+DWORD WINAPI SetBitmapDimension(HBITMAP, int, int);
+DWORD WINAPI GetBitmapDimension(HBITMAP);
+#if (WINVER >= 0x030a)
+BOOL WINAPI SetBitmapDimensionEx(HBITMAP, int, int, SIZE FAR*);
+BOOL WINAPI GetBitmapDimensionEx(HBITMAP, SIZE FAR*);
+#endif /* WINVER >= 0x030a */
+int WINAPI SetROP2(HDC, int);
+int WINAPI GetROP2(HDC);
+
+LONG WINAPI SetBitmapBits(HBITMAP, DWORD, const void FAR*);
+LONG WINAPI GetBitmapBits(HBITMAP, LONG, void FAR*);
+
+int WINAPI SetDIBits(HDC, HBITMAP, UINT, UINT, const void FAR*, BITMAPINFO FAR*, UINT);
+int WINAPI GetDIBits(HDC, HBITMAP, UINT, UINT, void FAR*, BITMAPINFO FAR*, UINT);
+
+int WINAPI SetDIBitsToDevice(HDC, int, int, int, int, int, int, UINT, UINT,
+ void FAR*, BITMAPINFO FAR*, UINT);
+#endif /* NOBITMAP */
+
+/****** Metafile support ****************************************************/
+
+#ifndef NOMETAFILE
+
+DECLARE_HANDLE(HMETAFILE);
+
+HDC WINAPI CreateMetaFile(LPCSTR);
+HMETAFILE WINAPI CloseMetaFile(HDC);
+
+HMETAFILE WINAPI GetMetaFile(LPCSTR);
+BOOL WINAPI DeleteMetaFile(HMETAFILE);
+HMETAFILE WINAPI CopyMetaFile(HMETAFILE, LPCSTR);
+
+BOOL WINAPI PlayMetaFile(HDC, HMETAFILE);
+
+HGLOBAL WINAPI GetMetaFileBits(HMETAFILE);
+HMETAFILE WINAPI SetMetaFileBits(HGLOBAL);
+#if (WINVER >= 0x030a)
+HMETAFILE WINAPI SetMetaFileBitsBetter(HGLOBAL);
+#endif /* WINVER >= 0x030a */
+
+/* Clipboard Metafile Picture Structure */
+typedef struct tagMETAFILEPICT
+{
+ int mm;
+ int xExt;
+ int yExt;
+ HMETAFILE hMF;
+} METAFILEPICT;
+typedef METAFILEPICT FAR* LPMETAFILEPICT;
+
+typedef struct tagMETAHEADER
+{
+ UINT mtType;
+ UINT mtHeaderSize;
+ UINT mtVersion;
+ DWORD mtSize;
+ UINT mtNoObjects;
+ DWORD mtMaxRecord;
+ UINT mtNoParameters;
+} METAHEADER;
+
+typedef struct tagHANDLETABLE
+{
+ HGDIOBJ objectHandle[1];
+} HANDLETABLE;
+typedef HANDLETABLE* PHANDLETABLE;
+typedef HANDLETABLE FAR* LPHANDLETABLE;
+
+typedef struct tagMETARECORD
+{
+ DWORD rdSize;
+ UINT rdFunction;
+ UINT rdParm[1];
+} METARECORD;
+typedef METARECORD* PMETARECORD;
+typedef METARECORD FAR* LPMETARECORD;
+
+/* Metafile Functions */
+#define META_SETBKCOLOR 0x0201
+#define META_SETBKMODE 0x0102
+#define META_SETMAPMODE 0x0103
+#define META_SETROP2 0x0104
+#define META_SETRELABS 0x0105
+#define META_SETPOLYFILLMODE 0x0106
+#define META_SETSTRETCHBLTMODE 0x0107
+#define META_SETTEXTCHAREXTRA 0x0108
+#define META_SETTEXTCOLOR 0x0209
+#define META_SETTEXTJUSTIFICATION 0x020A
+#define META_SETWINDOWORG 0x020B
+#define META_SETWINDOWEXT 0x020C
+#define META_SETVIEWPORTORG 0x020D
+#define META_SETVIEWPORTEXT 0x020E
+#define META_OFFSETWINDOWORG 0x020F
+#define META_SCALEWINDOWEXT 0x0410
+#define META_OFFSETVIEWPORTORG 0x0211
+#define META_SCALEVIEWPORTEXT 0x0412
+#define META_LINETO 0x0213
+#define META_MOVETO 0x0214
+#define META_EXCLUDECLIPRECT 0x0415
+#define META_INTERSECTCLIPRECT 0x0416
+#define META_ARC 0x0817
+#define META_ELLIPSE 0x0418
+#define META_FLOODFILL 0x0419
+#define META_PIE 0x081A
+#define META_RECTANGLE 0x041B
+#define META_ROUNDRECT 0x061C
+#define META_PATBLT 0x061D
+#define META_SAVEDC 0x001E
+#define META_SETPIXEL 0x041F
+#define META_OFFSETCLIPRGN 0x0220
+#define META_TEXTOUT 0x0521
+#define META_BITBLT 0x0922
+#define META_STRETCHBLT 0x0B23
+#define META_POLYGON 0x0324
+#define META_POLYLINE 0x0325
+#define META_ESCAPE 0x0626
+#define META_RESTOREDC 0x0127
+#define META_FILLREGION 0x0228
+#define META_FRAMEREGION 0x0429
+#define META_INVERTREGION 0x012A
+#define META_PAINTREGION 0x012B
+#define META_SELECTCLIPREGION 0x012C
+#define META_SELECTOBJECT 0x012D
+#define META_SETTEXTALIGN 0x012E
+#define META_DRAWTEXT 0x062F
+
+#define META_CHORD 0x0830
+#define META_SETMAPPERFLAGS 0x0231
+#define META_EXTTEXTOUT 0x0a32
+#define META_SETDIBTODEV 0x0d33
+#define META_SELECTPALETTE 0x0234
+#define META_REALIZEPALETTE 0x0035
+#define META_ANIMATEPALETTE 0x0436
+#define META_SETPALENTRIES 0x0037
+#define META_POLYPOLYGON 0x0538
+#define META_RESIZEPALETTE 0x0139
+
+#define META_DIBBITBLT 0x0940
+#define META_DIBSTRETCHBLT 0x0b41
+#define META_DIBCREATEPATTERNBRUSH 0x0142
+#define META_STRETCHDIB 0x0f43
+
+#define META_EXTFLOODFILL 0x0548
+
+#define META_RESETDC 0x014C
+#define META_STARTDOC 0x014D
+#define META_STARTPAGE 0x004F
+#define META_ENDPAGE 0x0050
+#define META_ABORTDOC 0x0052
+#define META_ENDDOC 0x005E
+
+#define META_DELETEOBJECT 0x01f0
+
+#define META_CREATEPALETTE 0x00f7
+#define META_CREATEBRUSH 0x00F8
+#define META_CREATEPATTERNBRUSH 0x01F9
+#define META_CREATEPENINDIRECT 0x02FA
+#define META_CREATEFONTINDIRECT 0x02FB
+#define META_CREATEBRUSHINDIRECT 0x02FC
+#define META_CREATEBITMAPINDIRECT 0x02FD
+#define META_CREATEBITMAP 0x06FE
+#define META_CREATEREGION 0x06FF
+
+void WINAPI PlayMetaFileRecord(HDC, HANDLETABLE FAR*, METARECORD FAR*, UINT);
+
+#ifdef STRICT
+typedef int (CALLBACK* MFENUMPROC)(HDC, HANDLETABLE FAR*, METARECORD FAR*, int, LPARAM);
+#else
+typedef FARPROC MFENUMPROC;
+#endif
+
+BOOL WINAPI EnumMetaFile(HDC, HMETAFILE, MFENUMPROC, LPARAM);
+
+#endif /* NOMETAFILE */
+
+/****** Printing support ****************************************************/
+
+#ifdef STRICT
+typedef BOOL (CALLBACK* ABORTPROC)(HDC, int);
+#else
+typedef FARPROC ABORTPROC;
+#endif
+
+#if (WINVER >= 0x030a)
+
+typedef struct
+{
+ int cbSize;
+ LPCSTR lpszDocName;
+ LPCSTR lpszOutput;
+} DOCINFO;
+typedef DOCINFO FAR* LPDOCINFO;
+
+int WINAPI StartDoc(HDC, DOCINFO FAR*);
+int WINAPI StartPage(HDC);
+int WINAPI EndPage(HDC);
+int WINAPI EndDoc(HDC);
+int WINAPI AbortDoc(HDC);
+
+int WINAPI SetAbortProc(HDC, ABORTPROC);
+HANDLE WINAPI SpoolFile(LPSTR, LPSTR, LPSTR, LPSTR);
+BOOL WINAPI QueryJob(HANDLE, int); /* ;Internal */
+#endif /* WINVER >= 0x030a */
+
+BOOL WINAPI QueryAbort(HDC, int);
+
+/* Spooler Error Codes */
+#define SP_NOTREPORTED 0x4000
+#define SP_ERROR (-1)
+#define SP_APPABORT (-2)
+#define SP_USERABORT (-3)
+#define SP_OUTOFDISK (-4)
+#define SP_OUTOFMEMORY (-5)
+
+#define PR_JOBSTATUS 0x0000
+
+#endif /* NOGDI */
+
+/* Spooler status notification message */
+#define WM_SPOOLERSTATUS 0x002A
+
+#ifndef NOGDI
+
+/******* GDI Escape support *************************************************/
+
+int WINAPI Escape(HDC, int, int, LPCSTR, void FAR*);
+
+/* GDI Escapes */
+#define NEWFRAME 1
+#define ABORTDOC 2
+#define NEXTBAND 3
+#define SETCOLORTABLE 4
+#define GETCOLORTABLE 5
+#define FLUSHOUTPUT 6
+#define DRAFTMODE 7
+#define QUERYESCSUPPORT 8
+#define SETABORTPROC 9
+#define STARTDOC 10
+#define ENDDOC 11
+#define GETPHYSPAGESIZE 12
+#define GETPRINTINGOFFSET 13
+#define GETSCALINGFACTOR 14
+#define MFCOMMENT 15
+#define GETPENWIDTH 16
+#define SETCOPYCOUNT 17
+#define SELECTPAPERSOURCE 18
+#define DEVICEDATA 19
+#define PASSTHROUGH 19
+#define GETTECHNOLGY 20
+#define GETTECHNOLOGY 20
+#define SETLINECAP 21
+#define SETLINEJOIN 22
+#define SETMITERLIMIT 23
+#define BANDINFO 24
+#define DRAWPATTERNRECT 25
+#define GETVECTORPENSIZE 26
+#define GETVECTORBRUSHSIZE 27
+#define ENABLEDUPLEX 28
+#define GETSETPAPERBINS 29
+#define GETSETPRINTORIENT 30
+#define ENUMPAPERBINS 31
+#define SETDIBSCALING 32
+#define EPSPRINTING 33
+#define ENUMPAPERMETRICS 34
+#define GETSETPAPERMETRICS 35
+#define POSTSCRIPT_DATA 37
+#define POSTSCRIPT_IGNORE 38
+#define MOUSETRAILS 39
+
+#define GETEXTENDEDTEXTMETRICS 256
+#define GETEXTENTTABLE 257
+#define GETPAIRKERNTABLE 258
+#define GETTRACKKERNTABLE 259
+#define EXTTEXTOUT 512
+#define GETFACENAME 513
+#define ENABLERELATIVEWIDTHS 768
+#define ENABLEPAIRKERNING 769
+#define SETKERNTRACK 770
+#define SETALLJUSTVALUES 771
+#define SETCHARSET 772
+
+#define STRETCHBLT 2048
+
+#define GETSETSCREENPARAMS 3072
+
+#define BEGIN_PATH 4096
+#define CLIP_TO_PATH 4097
+#define END_PATH 4098
+#define EXT_DEVICE_CAPS 4099
+#define RESTORE_CTM 4100
+#define SAVE_CTM 4101
+#define SET_ARC_DIRECTION 4102
+#define SET_BACKGROUND_COLOR 4103
+#define SET_POLY_MODE 4104
+#define SET_SCREEN_ANGLE 4105
+#define SET_SPREAD 4106
+#define TRANSFORM_CTM 4107
+#define SET_CLIP_BOX 4108
+#define SET_BOUNDS 4109
+
+#endif /* NOGDI */
+
+/****** USER typedefs, structures, and functions *****************************/
+
+#ifdef tagWND /* ;Internal */
+typedef struct tagWND NEAR* HWND; /* ;Internal */
+#else /* ;Internal */
+DECLARE_HANDLE(HWND);
+#endif /* ;Internal */
+
+#ifndef NOUSER
+
+DECLARE_HANDLE(HMENU);
+
+DECLARE_HANDLE(HICON);
+typedef HICON HCURSOR; /* HICONs & HCURSORs are polymorphic */
+
+/****** System Metrics *******************************************************/
+
+#ifndef NOSYSMETRICS
+
+int WINAPI GetSystemMetrics(int);
+
+/* GetSystemMetrics() codes */
+#define SM_CXSCREEN 0
+#define SM_CYSCREEN 1
+#define SM_CXVSCROLL 2
+#define SM_CYHSCROLL 3
+#define SM_CYCAPTION 4
+#define SM_CXBORDER 5
+#define SM_CYBORDER 6
+#define SM_CXDLGFRAME 7
+#define SM_CYDLGFRAME 8
+#define SM_CYVTHUMB 9
+#define SM_CXHTHUMB 10
+#define SM_CXICON 11
+#define SM_CYICON 12
+#define SM_CXCURSOR 13
+#define SM_CYCURSOR 14
+#define SM_CYMENU 15
+#define SM_CXFULLSCREEN 16
+#define SM_CYFULLSCREEN 17
+#define SM_CYKANJIWINDOW 18
+#define SM_MOUSEPRESENT 19
+#define SM_CYVSCROLL 20
+#define SM_CXHSCROLL 21
+#define SM_DEBUG 22
+#define SM_SWAPBUTTON 23
+#define SM_RESERVED1 24
+#define SM_RESERVED2 25
+#define SM_RESERVED3 26
+#define SM_RESERVED4 27
+#define SM_CXMIN 28
+#define SM_CYMIN 29
+#define SM_CXSIZE 30
+#define SM_CYSIZE 31
+#define SM_CXFRAME 32
+#define SM_CYFRAME 33
+#define SM_CXMINTRACK 34
+#define SM_CYMINTRACK 35
+
+#if (WINVER >= 0x030a)
+#define SM_CXDOUBLECLK 36
+#define SM_CYDOUBLECLK 37
+#define SM_CXICONSPACING 38
+#define SM_CYICONSPACING 39
+#define SM_MENUDROPALIGNMENT 40
+#define SM_PENWINDOWS 41
+#define SM_DBCSENABLED 42
+#endif /* WINVER >= 0x030a */
+
+#define SM_MAX 42 /* ;Internal */
+#define SM_CMETRICS 43
+
+#endif /* NOSYSMETRICS */
+
+UINT WINAPI GetDoubleClickTime(void);
+void WINAPI SetDoubleClickTime(UINT);
+
+#define WM_DEVMODECHANGE 0x001B
+#define WM_TIMECHANGE 0x001E
+#define WM_FILESYSCHANGE 0x0034 /* ;Internal */
+
+/****** System Parameters support ********************************************/
+
+#if (WINVER >= 0x030a)
+#ifndef NOSYSTEMPARAMSINFO
+
+BOOL WINAPI SystemParametersInfo(UINT, UINT, VOID FAR*, UINT);
+
+#define SPI_GETBEEP 1
+#define SPI_SETBEEP 2
+#define SPI_GETMOUSE 3
+#define SPI_SETMOUSE 4
+#define SPI_GETBORDER 5
+#define SPI_SETBORDER 6
+#define SPI_TIMEOUTS 7 /* ;Internal */
+#define SPI_KANJIMENU 8 /* ;Internal */
+#define SPI_GETKEYBOARDSPEED 10
+#define SPI_SETKEYBOARDSPEED 11
+#define SPI_LANGDRIVER 12
+#define SPI_ICONHORIZONTALSPACING 13
+#define SPI_GETSCREENSAVETIMEOUT 14
+#define SPI_SETSCREENSAVETIMEOUT 15
+#define SPI_GETSCREENSAVEACTIVE 16
+#define SPI_SETSCREENSAVEACTIVE 17
+#define SPI_GETGRIDGRANULARITY 18
+#define SPI_SETGRIDGRANULARITY 19
+#define SPI_SETDESKWALLPAPER 20
+#define SPI_SETDESKPATTERN 21
+#define SPI_GETKEYBOARDDELAY 22
+#define SPI_SETKEYBOARDDELAY 23
+#define SPI_ICONVERTICALSPACING 24
+#define SPI_GETICONTITLEWRAP 25
+#define SPI_SETICONTITLEWRAP 26
+#define SPI_GETMENUDROPALIGNMENT 27
+#define SPI_SETMENUDROPALIGNMENT 28
+#define SPI_SETDOUBLECLKWIDTH 29
+#define SPI_SETDOUBLECLKHEIGHT 30
+#define SPI_GETICONTITLELOGFONT 31
+#define SPI_SETDOUBLECLICKTIME 32
+#define SPI_SETMOUSEBUTTONSWAP 33
+#define SPI_SETICONTITLELOGFONT 34
+#define SPI_GETFASTTASKSWITCH 35
+#define SPI_SETFASTTASKSWITCH 36
+#define SPI_MAX 36 /* ;Internal */
+
+/* SystemParametersInfo flags */
+#define SPIF_UPDATEINIFILE 0x0001
+#define SPIF_SENDWININICHANGE 0x0002
+#define SPIF_VALID 0x0003 /* ;Internal */
+
+#endif /* NOSYSTEMPARAMSINFO */
+#endif /* WINVER >= 0x030a */
+
+/****** Rectangle support ****************************************************/
+
+void WINAPI SetRect(RECT FAR*, int, int, int, int);
+void WINAPI SetRectEmpty(RECT FAR*);
+
+void WINAPI CopyRect(RECT FAR*, const RECT FAR*);
+
+BOOL WINAPI IsRectEmpty(const RECT FAR*);
+
+BOOL WINAPI EqualRect(const RECT FAR*, const RECT FAR*);
+
+BOOL WINAPI IntersectRect(RECT FAR*, const RECT FAR*, const RECT FAR*);
+BOOL WINAPI UnionRect(RECT FAR*, const RECT FAR*, const RECT FAR*);
+BOOL WINAPI SubtractRect(RECT FAR*, const RECT FAR*, const RECT FAR*);
+
+void WINAPI OffsetRect(RECT FAR*, int, int);
+void WINAPI InflateRect(RECT FAR*, int, int);
+
+BOOL WINAPI PtInRect(const RECT FAR*, POINT);
+
+/****** Window message support ***********************************************/
+
+UINT WINAPI RegisterWindowMessage(LPCSTR);
+
+#define WM_NULL 0x0000
+
+/* NOTE: All messages below 0x0400 are RESERVED by Windows */
+#define WM_USER 0x0400
+
+#ifndef NOMSG
+
+/* Queued message structure */
+typedef struct tagMSG
+{
+ HWND hwnd;
+ UINT message;
+ WPARAM wParam;
+ LPARAM lParam;
+ DWORD time;
+ POINT pt;
+} MSG;
+typedef MSG* PMSG;
+typedef MSG NEAR* NPMSG;
+typedef MSG FAR* LPMSG;
+
+BOOL WINAPI GetMessage(MSG FAR*, HWND, UINT, UINT);
+BOOL WINAPI PeekMessage(MSG FAR*, HWND, UINT, UINT, UINT);
+
+/* PeekMessage() options */
+#define PM_NOREMOVE 0x0000
+#define PM_REMOVE 0x0001
+#define PM_NOYIELD 0x0002
+#define PM_VALID 0x0003 /* ;Internal */
+
+void WINAPI WaitMessage(void);
+
+DWORD WINAPI GetMessagePos(void);
+LONG WINAPI GetMessageTime(void);
+#if (WINVER >= 0x030a)
+LPARAM WINAPI GetMessageExtraInfo(void);
+#endif /* WINVER >= 0x030a */
+
+BOOL WINAPI TranslateMessage(const MSG FAR*);
+LONG WINAPI DispatchMessage(const MSG FAR*);
+
+BOOL WINAPI SetMessageQueue(int);
+
+BOOL WINAPI GetInputState(void);
+
+#if (WINVER >= 0x030a)
+DWORD WINAPI GetQueueStatus(UINT flags);
+
+/* GetQueueStatus flags */
+#define QS_KEY 0x0001
+#define QS_MOUSEMOVE 0x0002
+#define QS_MOUSEBUTTON 0x0004
+#define QS_MOUSE (QS_MOUSEMOVE | QS_MOUSEBUTTON)
+#define QS_POSTMESSAGE 0x0008
+#define QS_TIMER 0x0010
+#define QS_PAINT 0x0020
+#define QS_SENDMESSAGE 0x0040
+
+#define QS_ALLINPUT 0x007f
+#define QS_VALID 0x007f /* ;Internal */
+#endif /* WINVER >= 0x030a */
+
+#endif /* NOMSG */
+
+BOOL WINAPI PostMessage(HWND, UINT, WPARAM, LPARAM);
+LRESULT WINAPI SendMessage(HWND, UINT, WPARAM, LPARAM);
+
+#ifndef NOMSG
+
+BOOL WINAPI PostAppMessage(HTASK, UINT, WPARAM, LPARAM);
+
+void WINAPI ReplyMessage(LRESULT);
+BOOL WINAPI InSendMessage(void);
+
+/* Special HWND value for use with PostMessage() and SendMessage() */
+#define HWND_BROADCAST ((HWND)0xffff)
+
+BOOL WINAPI CallMsgFilter(MSG FAR*, int);
+
+#define WH_GETMESSAGE 3
+
+#define WH_CALLWNDPROC 4
+
+#define WH_MSGFILTER (-1)
+#define WH_SYSMSGFILTER 6
+
+/* CallMsgFilter() and WH_SYS/MSGFILTER context codes */
+#define MSGF_DIALOGBOX 0
+#define MSGF_MESSAGEBOX 1 /* ;Internal */
+#define MSGF_MENU 2
+#define MSGF_MOVE 3
+#define MSGF_SIZE 4
+#define MSGF_SCROLLBAR 5
+#define MSGF_NEXTWINDOW 6
+#define MSGF_CBTHOSEBAGSUSEDTHIS 7 /* ;Internal */
+#define MSGF_MAINLOOP 8
+#define MSGF_USER 4096
+#endif /* NOMSG */
+
+/* Standard window messages */
+/* PenWindows specific messages */
+#define WM_PENWINFIRST 0x0380
+#define WM_PENWINLAST 0x038F
+
+/* Coalescing messages */
+#define WM_COALESCE_FIRST 0x0390
+#define WM_COALESCE_LAST 0x039F
+
+/* Reserved message ranges */ /* ;Internal */
+#define WM_KANJIFIRST 0x0280 /* JAPAN */ /* ;Internal */
+#define WM_KANJILAST 0x029F /* JAPAN */ /* ;Internal */
+#define WM_HANGEULFIRST 0x0280 /* KOREA */ /* ;Internal */
+#define WM_HANGEULLAST 0x029F /* KOREA */ /* ;Internal */
+ /* ;Internal */
+ /* ;Internal */
+#define WM_INTERNAL_COALESCE_FIRST 0x0390 /* ;Internal */
+ /* ;Internal */
+ /* ;Internal */
+/* The following message range reserved */ /* ;Internal */
+/* for multi-media */ /* ;Internal */
+#define WM_MM_RESERVED_FIRST 0x03A0 /* ;Internal */
+#define WM_MM_RESERVED_LAST 0x03DF /* ;Internal */
+#define WM_INTERNAL_COALESCE_LAST 0x03b0 /* ;Internal */
+ /* ;Internal */
+#define WM_INTERNAL_DDE_FIRST 0x03E0 /* ;Internal */
+#define WM_INTERNAL_DDE_LAST 0x03EF /* ;Internal */
+ /* ;Internal */
+/* The following message range reserved */ /* ;Internal */
+/* for CBT */ /* ;Internal */
+#define WM_CBT_RESERVED_FIRST 0x03F0 /* ;Internal */
+#define WM_CBT_RESERVED_LAST 0x03FF /* ;Internal */
+
+#if (WINVER >= 0x030a)
+/****** Power management ****************************************************/
+#define WM_POWER 0x0048
+
+/* wParam for WM_POWER window message and DRV_POWER driver notification */
+#define PWR_OK 1
+#define PWR_FAIL (-1)
+#define PWR_SUSPENDREQUEST 1
+#define PWR_SUSPENDRESUME 2
+#define PWR_CRITICALRESUME 3
+#endif /* WINVER >= 0x030a */
+
+/****** Application termination *********************************************/
+
+#define WM_QUERYENDSESSION 0x0011
+#define WM_ENDSESSION 0x0016
+
+#define WM_QUIT 0x0012
+
+void WINAPI PostQuitMessage(int);
+
+#define WM_SYSTEMERROR 0x0017
+
+/****** Window class management *********************************************/
+
+typedef LRESULT (CALLBACK* WNDPROC)(HWND, UINT, WPARAM, LPARAM);
+
+typedef struct tagWNDCLASS
+{
+ UINT style;
+ WNDPROC lpfnWndProc;
+ int cbClsExtra;
+ int cbWndExtra;
+ HINSTANCE hInstance;
+ HICON hIcon;
+ HCURSOR hCursor;
+ HBRUSH hbrBackground;
+ LPCSTR lpszMenuName;
+ LPCSTR lpszClassName;
+} WNDCLASS;
+typedef WNDCLASS* PWNDCLASS;
+typedef WNDCLASS NEAR* NPWNDCLASS;
+typedef WNDCLASS FAR* LPWNDCLASS;
+
+ATOM WINAPI RegisterClass(const WNDCLASS FAR*);
+BOOL WINAPI UnregisterClass(LPCSTR, HINSTANCE);
+
+BOOL WINAPI GetClassInfo(HINSTANCE, LPCSTR, WNDCLASS FAR*);
+int WINAPI GetClassName(HWND, LPSTR, int);
+
+#ifndef NOWINSTYLES
+
+/* Class styles */
+#define CS_VREDRAW 0x0001
+#define CS_HREDRAW 0x0002
+
+#define CS_OWNDC 0x0020
+#define CS_CLASSDC 0x0040
+#define CS_PARENTDC 0x0080
+
+#define CS_SAVEBITS 0x0800
+
+#define CS_DBLCLKS 0x0008
+
+#define CS_BYTEALIGNCLIENT 0x1000
+#define CS_BYTEALIGNWINDOW 0x2000
+
+#define CS_NOCLOSE 0x0200
+
+#define CS_KEYCVTWINDOW 0x0004
+#define CS_NOKEYCVT 0x0100
+
+#define CS_GLOBALCLASS 0x4000
+#define CS_VALID 0x7fef /* ;Internal */
+#endif /* NOWINSTYLES */
+
+#ifndef NOWINOFFSETS
+
+WORD WINAPI GetClassWord(HWND, int);
+WORD WINAPI SetClassWord(HWND, int, WORD);
+LONG WINAPI GetClassLong(HWND, int);
+LONG WINAPI SetClassLong(HWND, int, LONG);
+
+/* Class field offsets for GetClassLong() and GetClassWord() */
+#define GCL_MENUNAME (-8)
+#define GCW_HBRBACKGROUND (-10)
+#define GCW_HCURSOR (-12)
+#define GCW_HICON (-14)
+#define GCW_HMODULE (-16)
+#define GCW_CBWNDEXTRA (-18)
+#define GCW_CBCLSEXTRA (-20)
+#define GCL_WNDPROC (-24)
+#define GCW_STYLE (-26)
+
+#if (WINVER >= 0x030a)
+#define GCW_ATOM (-32)
+#endif /* WINVER >= 0x030a */
+
+#endif /* NOWINOFFSETS */
+
+/****** Window creation/destroy *********************************************/
+
+/* Window Styles */
+#ifndef NOWINSTYLES
+
+/* Basic window types */
+#define WS_OVERLAPPED 0x00000000L
+#define WS_POPUP 0x80000000L
+#define WS_CHILD 0x40000000L
+
+/* Clipping styles */
+#define WS_CLIPSIBLINGS 0x04000000L
+#define WS_CLIPCHILDREN 0x02000000L
+
+/* Generic window states */
+#define WS_VISIBLE 0x10000000L
+#define WS_DISABLED 0x08000000L
+
+/* Main window states */
+#define WS_MINIMIZE 0x20000000L
+#define WS_MAXIMIZE 0x01000000L
+
+/* Main window styles */
+#define WS_CAPTION 0x00C00000L /* WS_BORDER | WS_DLGFRAME */
+#define WS_BORDER 0x00800000L
+#define WS_DLGFRAME 0x00400000L
+#define WS_VSCROLL 0x00200000L
+#define WS_HSCROLL 0x00100000L
+#define WS_SYSMENU 0x00080000L
+#define WS_THICKFRAME 0x00040000L
+#define WS_MINIMIZEBOX 0x00020000L
+#define WS_MAXIMIZEBOX 0x00010000L
+
+/* Control window styles */
+#define WS_GROUP 0x00020000L
+#define WS_TABSTOP 0x00010000L
+
+/* Common Window Styles */
+#define WS_OVERLAPPEDWINDOW (WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME | WS_MINIMIZEBOX | WS_MAXIMIZEBOX)
+#define WS_POPUPWINDOW (WS_POPUP | WS_BORDER | WS_SYSMENU)
+#define WS_CHILDWINDOW (WS_CHILD)
+
+/* Extended Window Styles */
+#define WS_EX_DLGMODALFRAME 0x00000001L
+#define WS_EX_DRAGOBJECT 0x00000002L /* ;Internal */
+#define WS_EX_NOPARENTNOTIFY 0x00000004L
+
+#if (WINVER >= 0x030a)
+#define WS_EX_TOPMOST 0x00000008L
+#define WS_EX_ACCEPTFILES 0x00000010L
+#define WS_EX_TRANSPARENT 0x00000020L
+#define WS_EX_VALID 0x0000003fL /* ;Internal */
+#endif /* WINVER >= 0x030a */
+
+/* Obsolete style names */
+#define WS_TILED WS_OVERLAPPED
+#define WS_ICONIC WS_MINIMIZE
+#define WS_SIZEBOX WS_THICKFRAME
+#define WS_TILEDWINDOW WS_OVERLAPPEDWINDOW
+
+#define WS_VALID 0xffff0000L /* ;Internal */
+
+#endif /* NOWINSTYLES */
+
+/* Special value for CreateWindow, et al. */
+#define HWND_DESKTOP ((HWND)0)
+
+BOOL WINAPI IsWindow(HWND);
+
+HWND WINAPI CreateWindowEx(DWORD, LPCSTR, LPCSTR, DWORD, int, int, int, int, HWND, HMENU, HINSTANCE, void FAR*);
+HWND WINAPI CreateWindow(LPCSTR, LPCSTR, DWORD, int, int, int, int, HWND, HMENU, HINSTANCE, void FAR*);
+
+#define WM_CREATE 0x0001
+#define WM_NCCREATE 0x0081
+
+/* WM_CREATE/WM_NCCREATE lParam struct */
+typedef struct tagCREATESTRUCT
+{
+ void FAR* lpCreateParams;
+ HINSTANCE hInstance;
+ HMENU hMenu;
+ HWND hwndParent;
+ int cy;
+ int cx;
+ int y;
+ int x;
+ LONG style;
+ LPCSTR lpszName;
+ LPCSTR lpszClass;
+ DWORD dwExStyle;
+} CREATESTRUCT;
+typedef CREATESTRUCT FAR* LPCREATESTRUCT;
+
+BOOL WINAPI DestroyWindow(HWND);
+
+#define WM_DESTROY 0x0002
+#define WM_NCDESTROY 0x0082
+
+/* Basic window attributes */
+
+HTASK WINAPI GetWindowTask(HWND);
+
+BOOL WINAPI IsChild(HWND, HWND);
+
+HWND WINAPI GetParent(HWND);
+HWND WINAPI SetParent(HWND, HWND);
+
+BOOL WINAPI IsWindowVisible(HWND);
+
+BOOL WINAPI ShowWindow(HWND, int);
+
+#define WM_SETVISIBLE 0x0009 /* ;Internal */
+
+#ifndef NOSHOWWINDOW
+
+#define SW_HIDE 0
+#define SW_SHOWNORMAL 1
+#define SW_NORMAL 1
+#define SW_SHOWMINIMIZED 2
+#define SW_SHOWMAXIMIZED 3
+#define SW_MAXIMIZE 3
+#define SW_SHOWNOACTIVATE 4
+#define SW_SHOW 5
+#define SW_MINIMIZE 6
+#define SW_SHOWMINNOACTIVE 7
+#define SW_SHOWNA 8
+#define SW_RESTORE 9
+#define SW_MAX 9 /* ;Internal */
+
+/* Obsolete ShowWindow() command names */
+#define HIDE_WINDOW 0
+#define SHOW_OPENWINDOW 1
+#define SHOW_ICONWINDOW 2
+#define SHOW_FULLSCREEN 3
+#define SHOW_OPENNOACTIVATE 4
+
+#define WM_SHOWWINDOW 0x0018
+
+/* WM_SHOWWINDOW wParam codes */
+#define SW_PARENTCLOSING 1
+#define SW_OTHERMAXIMIZED 2
+#define SW_PARENTOPENING 3
+#define SW_OTHERRESTORED 4
+
+/* Obsolete constant names */
+#define SW_OTHERZOOM SW_OTHERMAXIMIZED
+#define SW_OTHERUNZOOM SW_OTHERRESTORED
+#endif /* NOSHOWWINDOW */
+
+#define WM_SETREDRAW 0x000B
+
+/* Enabled state */
+BOOL WINAPI EnableWindow(HWND,BOOL);
+BOOL WINAPI IsWindowEnabled(HWND);
+
+#define WM_ENABLE 0x000A
+
+/* Window text */
+void WINAPI SetWindowText(HWND, LPCSTR);
+int WINAPI GetWindowText(HWND, LPSTR, int);
+int WINAPI GetWindowTextLength(HWND);
+
+#define WM_SETTEXT 0x000C
+#define WM_GETTEXT 0x000D
+#define WM_GETTEXTLENGTH 0x000E
+
+/* Window words */
+WORD WINAPI GetWindowWord(HWND, int);
+WORD WINAPI SetWindowWord(HWND, int, WORD);
+LONG WINAPI GetWindowLong(HWND, int);
+LONG WINAPI SetWindowLong(HWND, int, LONG);
+
+/* Window field offsets for GetWindowLong() and GetWindowWord() */
+#ifndef NOWINOFFSETS
+#define GWL_WNDPROC (-4)
+#define GWW_HINSTANCE (-6)
+#define GWW_HWNDPARENT (-8)
+#define GWW_ID (-12)
+#define GWL_STYLE (-16)
+#define GWL_EXSTYLE (-20)
+#endif /* NOWINOFFSETS */
+
+/****** Window size, position, Z-order, and visibility **********************/
+
+#define CW_USEDEFAULT ((int)0x8000)
+
+void WINAPI GetClientRect(HWND, RECT FAR*);
+void WINAPI GetWindowRect(HWND, RECT FAR*);
+
+
+#if (WINVER >= 0x030a)
+typedef struct tagWINDOWPLACEMENT
+{
+ UINT length;
+ UINT flags;
+ UINT showCmd;
+ POINT ptMinPosition;
+ POINT ptMaxPosition;
+ RECT rcNormalPosition;
+} WINDOWPLACEMENT;
+typedef WINDOWPLACEMENT *PWINDOWPLACEMENT;
+typedef WINDOWPLACEMENT FAR* LPWINDOWPLACEMENT;
+
+#define WPF_SETMINPOSITION 0x0001
+#define WPF_RESTORETOMAXIMIZED 0x0002
+#define WPF_VALID 0x0003 /* ;Internal */
+
+BOOL WINAPI GetWindowPlacement(HWND, WINDOWPLACEMENT FAR*);
+BOOL WINAPI SetWindowPlacement(HWND, const WINDOWPLACEMENT FAR*);
+#endif /* WINVER >= 0x030a */
+
+BOOL WINAPI SetWindowPos(HWND, HWND, int, int, int, int, UINT);
+
+/* SetWindowPos() and WINDOWPOS flags */
+#define SWP_NOSIZE 0x0001
+#define SWP_NOMOVE 0x0002
+#define SWP_NOZORDER 0x0004
+#define SWP_NOREDRAW 0x0008
+#define SWP_NOACTIVATE 0x0010
+#define SWP_FRAMECHANGED 0x0020 /* The frame changed: send WM_NCCALCSIZE */
+#define SWP_SHOWWINDOW 0x0040
+#define SWP_HIDEWINDOW 0x0080
+#define SWP_NOCOPYBITS 0x0100
+#define SWP_NOOWNERZORDER 0x0200 /* Don't do owner Z ordering */
+
+#define SWP_DRAWFRAME SWP_FRAMECHANGED
+#define SWP_NOREPOSITION SWP_NOOWNERZORDER
+
+#define SWP_NOCLIENTSIZE 0x0800 /* Client didn't resize */ /* ;Internal */
+#define SWP_NOCLIENTMOVE 0x1000 /* Client didn't move */ /* ;Internal */
+#define SWP_NOSENDCHANGING 0x0400
+#define SWP_DEFERERASE 0x2000
+#define SWP_DEFERDRAWING SWP_DEFERERASE /* Don't do any drawing or erasing */ /* ;Internal */
+ /* ;Internal */
+#define SWP_CHANGEMASK (SWP_NOSIZE | SWP_NOMOVE | SWP_NOZORDER | /* ;Internal */ \
+ SWP_FRAMECHANGED | /* ;Internal */ \
+ SWP_SHOWWINDOW | SWP_HIDEWINDOW | /* ;Internal */ \
+ SWP_NOCLIENTSIZE | SWP_NOCLIENTMOVE) /* ;Internal */
+ /* ;Internal */
+#define SWP_NOCHANGE (SWP_NOSIZE | SWP_NOMOVE | SWP_NOZORDER | /* ;Internal */ \
+ SWP_NOCLIENTSIZE | SWP_NOCLIENTMOVE) /* ;Internal */
+#define SWP_VALID 0x27ff /* ;Internal */
+
+/* SetWindowPos() hwndInsertAfter field values */
+#define HWND_TOP ((HWND)0)
+#define HWND_BOTTOM ((HWND)1)
+#define HWND_TOPMOST ((HWND)-1)
+#define HWND_NOTOPMOST ((HWND)-2)
+#define HWND_GROUPTOTOP HWND_TOPMOST /* ;Internal */
+
+#ifndef NODEFERWINDOWPOS
+
+DECLARE_HANDLE(HDWP);
+
+HDWP WINAPI BeginDeferWindowPos(int);
+HDWP WINAPI DeferWindowPos(HDWP, HWND, HWND, int, int, int, int, UINT);
+BOOL WINAPI EndDeferWindowPos(HDWP);
+
+#endif /* NODEFERWINDOWPOS */
+
+BOOL WINAPI MoveWindow(HWND, int, int, int, int, BOOL);
+BOOL WINAPI BringWindowToTop(HWND);
+
+#if (WINVER >= 0x030a)
+
+#define WM_WINDOWPOSCHANGING 0x0046
+#define WM_WINDOWPOSCHANGED 0x0047
+
+/* WM_WINDOWPOSCHANGING/CHANGED struct pointed to by lParam */
+typedef struct tagWINDOWPOS
+{
+ HWND hwnd;
+ HWND hwndInsertAfter;
+ int x;
+ int y;
+ int cx;
+ int cy;
+ UINT flags;
+} WINDOWPOS;
+typedef WINDOWPOS FAR* LPWINDOWPOS;
+#endif /* WINVER >= 0x030a */
+
+#define WM_MOVE 0x0003
+#define WM_SIZEWAIT 0x0004 /* ;Internal */
+#define WM_SIZE 0x0005
+
+/* WM_SIZE message wParam values */
+#define SIZE_RESTORED 0
+#define SIZE_MINIMIZED 1
+#define SIZE_MAXIMIZED 2
+#define SIZE_MAXSHOW 3
+#define SIZE_MAXHIDE 4
+
+/* Obsolete constant names */
+#define SIZENORMAL SIZE_RESTORED
+#define SIZEICONIC SIZE_MINIMIZED
+#define SIZEFULLSCREEN SIZE_MAXIMIZED
+#define SIZEZOOMSHOW SIZE_MAXSHOW
+#define SIZEZOOMHIDE SIZE_MAXHIDE
+
+/****** Window proc implementation & subclassing support *********************/
+
+LRESULT WINAPI DefWindowProc(HWND, UINT, WPARAM, LPARAM);
+
+#ifdef STRICT
+LRESULT WINAPI CallWindowProc(WNDPROC, HWND, UINT, WPARAM, LPARAM);
+#else
+LRESULT WINAPI CallWindowProc(FARPROC, HWND, UINT, WPARAM, LPARAM);
+#endif
+
+/****** Main window support **************************************************/
+
+void WINAPI AdjustWindowRect(RECT FAR*, DWORD, BOOL);
+void WINAPI AdjustWindowRectEx(RECT FAR*, DWORD, BOOL, DWORD);
+
+#define WM_QUERYOPEN 0x0013
+#define WM_CLOSE 0x0010
+
+/* Struct pointed to by WM_GETMINMAXINFO lParam */
+typedef struct tagMINMAXINFO
+{
+ POINT ptReserved;
+ POINT ptMaxSize;
+ POINT ptMaxPosition;
+ POINT ptMinTrackSize;
+ POINT ptMaxTrackSize;
+} MINMAXINFO;
+#define WM_GETMINMAXINFO 0x0024
+
+#define WM_ENTERSIZEMOVE 0x0231 /* ;Internal */
+#define WM_EXITSIZEMOVE 0x0232 /* ;Internal */
+#define WM_ISACTIVEICON 0x0035 /* ;Internal */
+#define WM_UNUSED0036 0x0036 /* ;Internal */
+#define WM_TESTING 0x0040 /* ;Internal */
+
+BOOL WINAPI FlashWindow(HWND, BOOL);
+
+void WINAPI ShowOwnedPopups(HWND, BOOL);
+
+/* Obsolete functions */
+BOOL WINAPI OpenIcon(HWND);
+void WINAPI CloseWindow(HWND);
+BOOL WINAPI AnyPopup(void);
+BOOL WINAPI IsIconic(HWND);
+BOOL WINAPI IsZoomed(HWND);
+
+/****** Window coordinate mapping and hit-testing ***************************/
+
+void WINAPI ClientToScreen(HWND, POINT FAR*);
+void WINAPI ScreenToClient(HWND, POINT FAR*);
+
+#if (WINVER >= 0x030a)
+void WINAPI MapWindowPoints(HWND hwndFrom, HWND hwndTo, POINT FAR* lppt, UINT cpt);
+#endif /* WINVER >= 0x030a */
+
+HWND WINAPI WindowFromPoint(POINT);
+HWND WINAPI ChildWindowFromPoint(HWND, POINT);
+
+/****** Window query and enumeration ****************************************/
+
+HWND WINAPI GetDesktopWindow(void);
+
+HWND WINAPI FindWindow(LPCSTR, LPCSTR);
+
+#ifdef STRICT
+typedef BOOL (CALLBACK* WNDENUMPROC)(HWND, LPARAM);
+#else
+typedef FARPROC WNDENUMPROC;
+#endif
+
+BOOL WINAPI EnumWindows(WNDENUMPROC, LPARAM);
+BOOL WINAPI EnumChildWindows(HWND, WNDENUMPROC, LPARAM);
+BOOL WINAPI EnumTaskWindows(HTASK, WNDENUMPROC, LPARAM);
+
+HWND WINAPI GetTopWindow(HWND);
+
+HWND WINAPI GetWindow(HWND, UINT);
+HWND WINAPI GetNextWindow(HWND, UINT);
+
+/* GetWindow() constants */
+#define GW_HWNDFIRST 0
+#define GW_HWNDLAST 1
+#define GW_HWNDNEXT 2
+#define GW_HWNDPREV 3
+#define GW_OWNER 4
+#define GW_CHILD 5
+#define GW_MAX 5 /* ;Internal */
+
+HWND WINAPI GetNextQueueWindow(HWND, int); /* ;Internal */
+
+/****** Window property support *********************************************/
+
+BOOL WINAPI SetProp(HWND, LPCSTR, HANDLE);
+HANDLE WINAPI GetProp(HWND, LPCSTR);
+HANDLE WINAPI RemoveProp(HWND, LPCSTR);
+
+#ifdef STRICT
+typedef BOOL (CALLBACK* PROPENUMPROC)(HWND, LPCSTR, HANDLE);
+#else
+typedef FARPROC PROPENUMPROC;
+#endif
+
+int WINAPI EnumProps(HWND, PROPENUMPROC);
+
+/****** Window drawing support **********************************************/
+
+HDC WINAPI GetDC(HWND);
+int WINAPI ReleaseDC(HWND, HDC);
+
+HDC WINAPI GetWindowDC(HWND);
+
+#if (WINVER >= 0x030a)
+HDC WINAPI GetDCEx(register HWND hwnd, HRGN hrgnClip, DWORD flags);
+
+#define DCX_WINDOW 0x00000001L
+#define DCX_CACHE 0x00000002L
+#define DCX_NORESETATTRS 0x00000004L /* ;Internal */
+#define DCX_CLIPCHILDREN 0x00000008L
+#define DCX_CLIPSIBLINGS 0x00000010L
+#define DCX_PARENTCLIP 0x00000020L
+
+#define DCX_EXCLUDERGN 0x00000040L
+#define DCX_INTERSECTRGN 0x00000080L
+
+#define DCX_EXCLUDEUPDATE 0x00000100L /* ;Internal */
+#define DCX_INTERSECTUPDATE 0x00000200L /* ;Internal */
+
+#define DCX_LOCKWINDOWUPDATE 0x00000400L
+
+#define DCX_INVALID 0x00000800L /* ;Internal */
+#define DCX_INUSE 0x00001000L /* ;Internal */
+#define DCX_SAVEDRGNINVALID 0x00002000L /* ;Internal */
+
+#define DCX_USESTYLE 0x00010000L
+#define DCX_NEEDFONT 0x00020000L /* ;Internal */
+#define DCX_NODELETERGN 0x00040000L /* ;Internal */
+#define DCX_NOCLIPCHILDREN 0x00080000L /* ;Internal */
+#define DCX_NORECOMPUTE 0x00100000L /* ;Internal */
+#define DCX_VALIDATE 0x00200000L /* ;Internal */
+
+#define DCX_MATCHMASK (DCX_WINDOW | DCX_CACHE | /* ;Internal */ \
+ DCX_CLIPCHILDREN | DCX_CLIPSIBLINGS | /* ;Internal */ \
+ DCX_LOCKWINDOWUPDATE /* ;Internal */ \
+ ) /* ;Internal */
+#define DCX_VALID 0x000104fbL /* ;Internal */
+#endif /* WINVER >= 0x030a */
+
+/****** Window repainting ***************************************************/
+
+#define WM_PAINT 0x000F
+#define WM_ERASEBKGND 0x0014
+#define WM_PAINTICON 0x0026 /* ;Internal */
+#define WM_ICONERASEBKGND 0x0027
+#define WM_SYNCPAINT 0x0088 /* ;Internal */
+#define WM_SYNCTASK 0x0089 /* ;Internal */
+
+/* BeginPaint() return structure */
+typedef struct tagPAINTSTRUCT
+{
+ HDC hdc;
+ BOOL fErase;
+ RECT rcPaint;
+ BOOL fRestore;
+ BOOL fIncUpdate;
+ BYTE rgbReserved[16];
+} PAINTSTRUCT;
+typedef PAINTSTRUCT* PPAINTSTRUCT;
+typedef PAINTSTRUCT NEAR* NPPAINTSTRUCT;
+typedef PAINTSTRUCT FAR* LPPAINTSTRUCT;
+
+HDC WINAPI BeginPaint(HWND, PAINTSTRUCT FAR*);
+void WINAPI EndPaint(HWND, const PAINTSTRUCT FAR*);
+
+void WINAPI UpdateWindow(HWND);
+
+int WINAPI ExcludeUpdateRgn(HDC, HWND);
+
+#if (WINVER >= 0x030a)
+BOOL WINAPI LockWindowUpdate(HWND hwndLock);
+#endif /* WINVER >= 0x030a */
+
+BOOL WINAPI GetUpdateRect(HWND, RECT FAR*, BOOL);
+int WINAPI GetUpdateRgn(HWND, HRGN, BOOL);
+
+void WINAPI InvalidateRect(HWND, const RECT FAR*, BOOL);
+void WINAPI ValidateRect(HWND, const RECT FAR*);
+
+void WINAPI InvalidateRgn(HWND, HRGN, BOOL);
+void WINAPI ValidateRgn(HWND, HRGN);
+
+#if (WINVER >= 0x030a)
+BOOL WINAPI RedrawWindow(HWND hwnd, const RECT FAR* lprcUpdate, HRGN hrgnUpdate, UINT flags);
+
+#define RDW_INVALIDATE 0x0001
+#define RDW_INTERNALPAINT 0x0002
+#define RDW_ERASE 0x0004
+
+#define RDW_VALIDATE 0x0008
+#define RDW_NOINTERNALPAINT 0x0010
+#define RDW_NOERASE 0x0020
+
+#define RDW_NOCHILDREN 0x0040
+#define RDW_ALLCHILDREN 0x0080
+
+#define RDW_UPDATENOW 0x0100
+#define RDW_ERASENOW 0x0200
+
+#define RDW_FRAME 0x0400
+#define RDW_NOFRAME 0x0800
+ /* ;Internal */
+#define RDW_REDRAWWINDOW 0x1000 /* Called from RedrawWindow()*/ /* ;Internal */
+#define RDW_SUBTRACTSELF 0x2000 /* Subtract self from hrgn */ /* ;Internal */
+ /* ;Internal */
+#define RDW_COPYRGN 0x4000 /* Copy the passed-in region */ /* ;Internal */
+#define RDW_VALID 0x0fff /* ;Internal */
+
+#endif /* WINVER >= 0x030a */
+
+/****** Window scrolling ****************************************************/
+
+void WINAPI ScrollWindow(HWND, int, int, const RECT FAR*, const RECT FAR*);
+BOOL WINAPI ScrollDC(HDC, int, int, const RECT FAR*, const RECT FAR*, HRGN, RECT FAR*);
+
+#if (WINVER >= 0x030a)
+
+int WINAPI ScrollWindowEx(HWND hwnd, int dx, int dy,
+ const RECT FAR* prcScroll, const RECT FAR* prcClip,
+ HRGN hrgnUpdate, RECT FAR* prcUpdate, UINT flags);
+
+#define SW_SCROLLCHILDREN 0x0001
+#define SW_INVALIDATE 0x0002
+#define SW_ERASE 0x0004
+
+#define SW_SCROLLWINDOW 0x8000 /* ;Internal */
+#define SW_VALID 0x8007 /* ;Internal */
+
+#endif /* WINVER >= 0x030a */
+
+/****** Non-client window area management ************************************/
+
+#define WM_NCPAINT 0x0085
+
+#define WM_NCCALCSIZE 0x0083
+
+#if (WINVER >= 0x030a)
+/* WM_NCCALCSIZE return flags */
+#define WVR_ALIGNTOP 0x0010
+#define WVR_ALIGNLEFT 0x0020
+#define WVR_ALIGNBOTTOM 0x0040
+#define WVR_ALIGNRIGHT 0x0080
+#define WVR_HREDRAW 0x0100
+#define WVR_VREDRAW 0x0200
+#define WVR_REDRAW (WVR_HREDRAW | WVR_VREDRAW)
+#define WVR_VALIDRECTS 0x0400
+
+#define WVR_MINVALID WVR_ALIGNTOP /* ;Internal */
+#define WVR_MAXVALID WVR_VALIDRECTS /* ;Internal */
+
+/* WM_NCCALCSIZE parameter structure */
+typedef struct tagNCCALCSIZE_PARAMS
+{
+ RECT rgrc[3];
+ WINDOWPOS FAR* lppos;
+} NCCALCSIZE_PARAMS;
+#else /* WINVER >= 0x030a */
+typedef struct tagNCCALCSIZE_PARAMS
+{
+ RECT rgrc[2];
+} NCCALCSIZE_PARAMS;
+#endif /* WINVER >= 0x030a */
+typedef NCCALCSIZE_PARAMS FAR* LPNCCALCSIZE_PARAMS;
+
+#define WM_NCHITTEST 0x0084
+
+/* WM_NCHITTEST return codes */
+#define HTERROR (-2)
+#define HTTRANSPARENT (-1)
+#define HTNOWHERE 0
+#define HTCLIENT 1
+#define HTCAPTION 2
+#define HTSYSMENU 3
+#define HTSIZE 4
+#define HTMENU 5
+#define HTHSCROLL 6
+#define HTVSCROLL 7
+#define HTMINBUTTON 8
+#define HTMAXBUTTON 9
+#define HTLEFT 10
+#define HTRIGHT 11
+#define HTTOP 12
+#define HTTOPLEFT 13
+#define HTTOPRIGHT 14
+#define HTBOTTOM 15
+#define HTBOTTOMLEFT 16
+#define HTBOTTOMRIGHT 17
+#define HTBORDER 18
+#define HTGROWBOX HTSIZE
+#define HTREDUCE HTMINBUTTON
+#define HTZOOM HTMAXBUTTON
+#define HTSIZEFIRST HTLEFT /* ;Internal */
+#define HTSIZELAST HTBOTTOMRIGHT /* ;Internal */
+
+/****** Drag-and-drop support ***********************************************/
+
+#define WM_DROPOBJECT 0x022A /* ;Internal */
+#define WM_QUERYDROPOBJECT 0x022B /* ;Internal */
+#define WM_BEGINDRAG 0x022C /* ;Internal */
+#define WM_DRAGLOOP 0x022D /* ;Internal */
+#define WM_DRAGSELECT 0x022E /* ;Internal */
+#define WM_DRAGMOVE 0x022F /* ;Internal */
+#define WM_QUERYDRAGICON 0x0037
+#define WM_DROPFILES 0x0233
+
+/****** Window activation ***************************************************/
+
+HWND WINAPI SetActiveWindow(HWND);
+HWND WINAPI GetActiveWindow(void);
+
+HWND WINAPI GetLastActivePopup(HWND);
+
+/* WM_ACTIVATE state values */
+#define WA_INACTIVE 0
+#define WA_ACTIVE 1
+#define WA_CLICKACTIVE 2
+
+#define WM_ACTIVATE 0x0006
+#define WM_ACTIVATEAPP 0x001C
+#define WM_NCACTIVATE 0x0086
+
+/****** Keyboard input support **********************************************/
+
+HWND WINAPI SetFocus(HWND);
+HWND WINAPI GetFocus(void);
+
+int WINAPI GetKeyState(int);
+int WINAPI GetAsyncKeyState(int);
+
+void WINAPI GetKeyboardState(BYTE FAR* );
+void WINAPI SetKeyboardState(BYTE FAR* );
+
+#define WM_SETFOCUS 0x0007
+#define WM_KILLFOCUS 0x0008
+
+#define WM_KEYDOWN 0x0100
+#define WM_KEYUP 0x0101
+
+#define WM_CHAR 0x0102
+#define WM_DEADCHAR 0x0103
+
+#define WM_SYSKEYDOWN 0x0104
+#define WM_SYSKEYUP 0x0105
+
+#define WM_SYSCHAR 0x0106
+#define WM_SYSDEADCHAR 0x0107
+
+#define WM_YOMICHAR 0x0108 /* JAPAN */ /* ;Internal */
+#define WM_CONVERTREQUEST 0x010A /* JAPAN */ /* ;Internal */
+#define WM_CONVERTRESULT 0x010B /* JAPAN */ /* ;Internal */
+#define WM_INTERIM 0x010C /* KOREA */ /* ;Internal */
+
+/* Keyboard message range */
+#define WM_KEYFIRST 0x0100
+#define WM_KEYLAST 0x0108
+
+/* WM_KEYUP/DOWN/CHAR HIWORD(lParam) flags */
+#define KF_EXTENDED 0x0100
+#define KF_DLGMODE 0x0800
+#define KF_MENUMODE 0x1000
+#define KF_ALTDOWN 0x2000
+#define KF_REPEAT 0x4000
+#define KF_UP 0x8000
+
+/* Virtual key codes */
+#ifndef NOVIRTUALKEYCODES
+#define VK_LBUTTON 0x01
+#define VK_RBUTTON 0x02
+#define VK_CANCEL 0x03
+#define VK_MBUTTON 0x04
+#define VK_BACK 0x08
+#define VK_TAB 0x09
+#define VK_CLEAR 0x0C
+#define VK_RETURN 0x0D
+#define VK_SHIFT 0x10
+#define VK_CONTROL 0x11
+#define VK_MENU 0x12
+#define VK_PAUSE 0x13
+#define VK_CAPITAL 0x14
+#define VK_KANA 0x15 /* JAPAN */ /* ;Internal */
+#define VK_KANJI 0x19 /* JAPAN */ /* ;Internal */
+#define VK_HANGEUL 0x15 /* KOREA */ /* ;Internal */
+#define VK_JUNJA 0x17 /* KOREA */ /* ;Internal */
+#define VK_HANJA 0x19 /* KOREA */ /* ;Internal */
+#define VK_ESCAPE 0x1B
+#define VK_SPACE 0x20
+#define VK_PRIOR 0x21
+#define VK_NEXT 0x22
+#define VK_END 0x23
+#define VK_HOME 0x24
+#define VK_LEFT 0x25
+#define VK_UP 0x26
+#define VK_RIGHT 0x27
+#define VK_DOWN 0x28
+#define VK_SELECT 0x29
+#define VK_PRINT 0x2A
+#define VK_EXECUTE 0x2B
+#define VK_SNAPSHOT 0x2C
+#define VK_INSERT 0x2D
+#define VK_DELETE 0x2E
+#define VK_HELP 0x2F
+#define VK_NUMPAD0 0x60
+#define VK_NUMPAD1 0x61
+#define VK_NUMPAD2 0x62
+#define VK_NUMPAD3 0x63
+#define VK_NUMPAD4 0x64
+#define VK_NUMPAD5 0x65
+#define VK_NUMPAD6 0x66
+#define VK_NUMPAD7 0x67
+#define VK_NUMPAD8 0x68
+#define VK_NUMPAD9 0x69
+#define VK_MULTIPLY 0x6A
+#define VK_ADD 0x6B
+#define VK_SEPARATOR 0x6C
+#define VK_SUBTRACT 0x6D
+#define VK_DECIMAL 0x6E
+#define VK_DIVIDE 0x6F
+#define VK_F1 0x70
+#define VK_F2 0x71
+#define VK_F3 0x72
+#define VK_F4 0x73
+#define VK_F5 0x74
+#define VK_F6 0x75
+#define VK_F7 0x76
+#define VK_F8 0x77
+#define VK_F9 0x78
+#define VK_F10 0x79
+#define VK_F11 0x7A
+#define VK_F12 0x7B
+#define VK_F13 0x7C
+#define VK_F14 0x7D
+#define VK_F15 0x7E
+#define VK_F16 0x7F
+#define VK_F17 0x80
+#define VK_F18 0x81
+#define VK_F19 0x82
+#define VK_F20 0x83
+#define VK_F21 0x84
+#define VK_F22 0x85
+#define VK_F23 0x86
+#define VK_F24 0x87
+#define VK_NUMLOCK 0x90
+#define VK_SCROLL 0x91
+
+/* VK_A thru VK_Z are the same as their ASCII equivalents: 'A' thru 'Z' */
+/* VK_0 thru VK_9 are the same as their ASCII equivalents: '0' thru '0' */
+
+#endif /* NOVIRTUALKEYCODES */
+
+BOOL WINAPI IsTwoByteCharPrefix(char); /* ;Internal */
+
+/* SetWindowsHook() keyboard hook */
+#define WH_KEYBOARD 2
+
+/****** Mouse input support *************************************************/
+
+HWND WINAPI SetCapture(HWND);
+void WINAPI ReleaseCapture(void);
+HWND WINAPI GetCapture(void);
+
+BOOL WINAPI SwapMouseButton(BOOL);
+
+/* Mouse input messages */
+#define WM_MOUSEMOVE 0x0200
+#define WM_LBUTTONDOWN 0x0201
+#define WM_LBUTTONUP 0x0202
+#define WM_LBUTTONDBLCLK 0x0203
+#define WM_RBUTTONDOWN 0x0204
+#define WM_RBUTTONUP 0x0205
+#define WM_RBUTTONDBLCLK 0x0206
+#define WM_MBUTTONDOWN 0x0207
+#define WM_MBUTTONUP 0x0208
+#define WM_MBUTTONDBLCLK 0x0209
+
+/* Mouse input message range */
+#define WM_MOUSEFIRST 0x0200
+#define WM_MOUSELAST 0x0209
+
+/* Mouse message wParam key states */
+#ifndef NOKEYSTATES
+#define MK_LBUTTON 0x0001
+#define MK_RBUTTON 0x0002
+#define MK_SHIFT 0x0004
+#define MK_CONTROL 0x0008
+#define MK_MBUTTON 0x0010
+#endif /* NOKEYSTATES */
+
+/* Non-client mouse messages */
+#define WM_NCMOUSEMOVE 0x00A0
+#define WM_NCLBUTTONDOWN 0x00A1
+#define WM_NCLBUTTONUP 0x00A2
+#define WM_NCLBUTTONDBLCLK 0x00A3
+#define WM_NCRBUTTONDOWN 0x00A4
+#define WM_NCRBUTTONUP 0x00A5
+#define WM_NCRBUTTONDBLCLK 0x00A6
+#define WM_NCMBUTTONDOWN 0x00A7
+#define WM_NCMBUTTONUP 0x00A8
+#define WM_NCMBUTTONDBLCLK 0x00A9
+
+/* Mouse click activation support */
+#define WM_MOUSEACTIVATE 0x0021
+
+/* WM_MOUSEACTIVATE return codes */
+#define MA_ACTIVATE 1
+#define MA_ACTIVATEANDEAT 2
+#define MA_NOACTIVATE 3
+#if (WINVER >= 0x030a)
+#define MA_NOACTIVATEANDEAT 4
+#endif /* WINVER >= 0x030a */
+
+/* SetWindowsHook() mouse hook */
+#ifndef NOWH
+#define WH_MOUSE 7
+
+typedef struct tagMOUSEHOOKSTRUCT
+{
+ POINT pt;
+ HWND hwnd;
+ UINT wHitTestCode;
+ DWORD dwExtraInfo;
+} MOUSEHOOKSTRUCT;
+typedef MOUSEHOOKSTRUCT FAR* LPMOUSEHOOKSTRUCT;
+#endif /* NOWH */
+
+/****** Mode control ********************************************************/
+
+#define WM_CANCELMODE 0x001F
+
+/****** System modal window support *****************************************/
+
+HWND WINAPI GetSysModalWindow(void);
+HWND WINAPI SetSysModalWindow(HWND);
+
+/****** Timer support *******************************************************/
+
+#ifdef STRICT
+typedef void (CALLBACK* TIMERPROC)(HWND, UINT, UINT, DWORD);
+#else
+typedef FARPROC TIMERPROC;
+#endif
+
+UINT WINAPI SetTimer(HWND, UINT, UINT, TIMERPROC);
+
+BOOL WINAPI KillTimer(HWND, UINT);
+
+#define WM_TIMER 0x0113
+#define WM_SYSTIMER 0x0118 /* ;Internal */
+
+/****** Accelerator support *************************************************/
+
+DECLARE_HANDLE(HACCEL);
+
+HACCEL WINAPI LoadAccelerators(HINSTANCE, LPCSTR);
+
+#ifndef NOMSG
+int WINAPI TranslateAccelerator(HWND, HACCEL, MSG FAR*);
+#endif
+
+/****** Menu support ********************************************************/
+
+#ifndef NOMENUS
+
+/* Menu template header */
+typedef struct
+{
+ UINT versionNumber;
+ UINT offset;
+} MENUITEMTEMPLATEHEADER;
+
+/* Menu template item struct */
+typedef struct
+{
+ UINT mtOption;
+ UINT mtID;
+ char mtString[1];
+} MENUITEMTEMPLATE;
+
+#if (WINVER >= 0x030a)
+BOOL WINAPI IsMenu(HMENU);
+#endif /* WINVER >= 0x030a */
+
+HMENU WINAPI CreateMenu(void);
+HMENU WINAPI CreatePopupMenu(void);
+HMENU WINAPI LoadMenu(HINSTANCE, LPCSTR);
+HMENU WINAPI LoadMenuIndirect(const void FAR*);
+
+BOOL WINAPI DestroyMenu(HMENU);
+
+HMENU WINAPI GetMenu(HWND);
+BOOL WINAPI SetMenu(HWND, HMENU);
+
+HMENU WINAPI GetSystemMenu(HWND, BOOL);
+BOOL WINAPI SetSystemMenu(HWND, HMENU); /* ;Internal */
+
+void WINAPI DrawMenuBar(HWND);
+
+BOOL WINAPI HiliteMenuItem(HWND, HMENU, UINT, UINT);
+
+BOOL WINAPI InsertMenu(HMENU, UINT, UINT, UINT, LPCSTR);
+BOOL WINAPI AppendMenu(HMENU, UINT, UINT, LPCSTR);
+BOOL WINAPI ModifyMenu(HMENU, UINT, UINT, UINT, LPCSTR);
+BOOL WINAPI RemoveMenu(HMENU, UINT, UINT);
+BOOL WINAPI DeleteMenu(HMENU, UINT, UINT);
+
+BOOL WINAPI ChangeMenu(HMENU, UINT, LPCSTR, UINT, UINT);
+
+#define MF_INSERT 0x0000
+#define MF_CHANGE 0x0080
+#define MF_APPEND 0x0100
+#define MF_DELETE 0x0200
+#define MF_REMOVE 0x1000
+
+/* Menu flags for Add/Check/EnableMenuItem() */
+#define MF_BYCOMMAND 0x0000
+#define MF_BYPOSITION 0x0400
+
+#define MF_SEPARATOR 0x0800
+
+#define MF_ENABLED 0x0000
+#define MF_GRAYED 0x0001
+#define MF_DISABLED 0x0002
+
+#define MF_UNCHECKED 0x0000
+#define MF_CHECKED 0x0008
+#define MF_USECHECKBITMAPS 0x0200
+
+#define MF_STRING 0x0000
+#define MF_BITMAP 0x0004
+#define MF_OWNERDRAW 0x0100
+
+#define MF_POPUP 0x0010
+#define MF_MENUBARBREAK 0x0020
+#define MF_MENUBREAK 0x0040
+
+#define MF_UNHILITE 0x0000
+#define MF_HILITE 0x0080
+
+#define MF_SYSMENU 0x2000
+#define MF_HELP 0x4000
+#define MF_MOUSESELECT 0x8000
+
+#define MF_VALID 0x4fff /* ;Internal */
+#define MF_CHANGE_VALID 0x5fff /* ;Internal */
+
+#define MF_END 0x0080 /* Only valid in menu resource templates */
+
+BOOL WINAPI EnableMenuItem(HMENU, UINT, UINT);
+BOOL WINAPI CheckMenuItem(HMENU, UINT, UINT);
+
+HMENU WINAPI GetSubMenu(HMENU, int);
+
+int WINAPI GetMenuItemCount(HMENU);
+UINT WINAPI GetMenuItemID(HMENU, int);
+
+int WINAPI GetMenuString(HMENU, UINT, LPSTR, int, UINT);
+UINT WINAPI GetMenuState(HMENU, UINT, UINT);
+
+BOOL WINAPI SetMenuItemBitmaps(HMENU, UINT, UINT, HBITMAP, HBITMAP);
+DWORD WINAPI GetMenuCheckMarkDimensions(void);
+
+BOOL WINAPI TrackPopupMenu(HMENU, UINT, int, int, int, HWND, const RECT FAR*);
+
+/* Flags for TrackPopupMenu */
+#define TPM_LEFTBUTTON 0x0000
+#if (WINVER >= 0x030a)
+#define TPM_RIGHTBUTTON 0x0002
+#define TPM_LEFTALIGN 0x0000
+#define TPM_CENTERALIGN 0x0004
+#define TPM_RIGHTALIGN 0x0008
+#define TPM_VALID 0x000f /* ;Internal */
+#endif /* WINVER >= 0x030a */
+
+#endif /* NOMENUS */
+
+/* Menu messages */
+#define WM_INITMENU 0x0116
+#define WM_INITMENUPOPUP 0x0117
+
+#ifndef NOMENUS
+
+#define WM_MENUSELECT 0x011F
+#define WM_MENUCHAR 0x0120
+#define WM_ENTERMENULOOP 0x0211 /* ;Internal */
+#define WM_EXITMENULOOP 0x0212 /* ;Internal */
+#define WM_NEXTMENU 0x0213 /* ;Internal */
+
+#endif /* NOMENUS */
+
+/* Menu and control command messages */
+#define WM_COMMAND 0x0111
+
+/****** Scroll bar support **************************************************/
+
+#ifndef NOSCROLL
+
+#define WM_HSCROLL 0x0114
+#define WM_VSCROLL 0x0115
+
+/* WM_H/VSCROLL commands */
+#define SB_LINEUP 0
+#define SB_LINELEFT 0
+#define SB_LINEDOWN 1
+#define SB_LINERIGHT 1
+#define SB_PAGEUP 2
+#define SB_PAGELEFT 2
+#define SB_PAGEDOWN 3
+#define SB_PAGERIGHT 3
+#define SB_THUMBPOSITION 4
+#define SB_THUMBTRACK 5
+#define SB_TOP 6
+#define SB_LEFT 6
+#define SB_BOTTOM 7
+#define SB_RIGHT 7
+#define SB_ENDSCROLL 8
+#define SB_MSGCMD_MAX 8 /* ;Internal */
+
+/* Scroll bar selection constants */
+#define SB_HORZ 0
+#define SB_VERT 1
+#define SB_CTL 2
+#define SB_BOTH 3
+#define SB_MAX 3 /* ;Internal */
+
+int WINAPI SetScrollPos(HWND, int, int, BOOL);
+int WINAPI GetScrollPos(HWND, int);
+void WINAPI SetScrollRange(HWND, int, int, int, BOOL);
+void WINAPI GetScrollRange(HWND, int, int FAR*, int FAR*);
+void WINAPI ShowScrollBar(HWND, int, BOOL);
+BOOL WINAPI EnableScrollBar(HWND, int, UINT);
+
+/* EnableScrollBar() flags */
+#define ESB_ENABLE_BOTH 0x0000
+#define ESB_DISABLE_BOTH 0x0003
+
+#define ESB_DISABLE_LEFT 0x0001
+#define ESB_DISABLE_RIGHT 0x0002
+
+#define ESB_DISABLE_UP 0x0001
+#define ESB_DISABLE_DOWN 0x0002
+
+#define ESB_DISABLE_LTUP ESB_DISABLE_LEFT
+#define ESB_DISABLE_RTDN ESB_DISABLE_RIGHT
+
+#define ESB_MAX 0x0003 /* ;Internal */
+#define SB_DISABLE_MASK ESB_DISABLE_BOTH /* ;Internal */
+#endif /* NOSCROLL */
+
+/******* Clipboard manager **************************************************/
+
+#ifndef NOCLIPBOARD
+
+/* Predefined Clipboard Formats */
+#define CF_TEXT 1
+#define CF_BITMAP 2
+#define CF_METAFILEPICT 3
+#define CF_SYLK 4
+#define CF_DIF 5
+#define CF_TIFF 6
+#define CF_OEMTEXT 7
+#define CF_DIB 8
+#define CF_PALETTE 9
+#define CF_PENDATA 10
+#define CF_RIFF 11
+#define CF_WAVE 12
+
+#define CF_OWNERDISPLAY 0x0080
+#define CF_DSPTEXT 0x0081
+#define CF_DSPBITMAP 0x0082
+#define CF_DSPMETAFILEPICT 0x0083
+
+/* "Private" formats don't get GlobalFree()'d */
+#define CF_PRIVATEFIRST 0x0200
+#define CF_PRIVATELAST 0x02FF
+
+/* "GDIOBJ" formats do get DeleteObject()'d */
+#define CF_GDIOBJFIRST 0x0300
+#define CF_GDIOBJLAST 0x03FF
+
+/* Clipboard Manager Functions */
+BOOL WINAPI OpenClipboard(HWND);
+BOOL WINAPI CloseClipboard(void);
+BOOL WINAPI EmptyClipboard(void);
+
+#if (WINVER >= 0x030a)
+HWND WINAPI GetOpenClipboardWindow(void);
+#endif /* WINVER >= 0x030a */
+
+HWND WINAPI GetClipboardOwner(void);
+
+HWND WINAPI SetClipboardViewer(HWND);
+HWND WINAPI GetClipboardViewer(void);
+
+HANDLE WINAPI SetClipboardData(UINT, HANDLE);
+HANDLE WINAPI GetClipboardData(UINT);
+
+BOOL WINAPI IsClipboardFormatAvailable(UINT);
+int WINAPI GetPriorityClipboardFormat(UINT FAR*, int);
+
+UINT WINAPI RegisterClipboardFormat(LPCSTR);
+int WINAPI CountClipboardFormats(void);
+UINT WINAPI EnumClipboardFormats(UINT);
+int WINAPI GetClipboardFormatName(UINT, LPSTR, int);
+
+BOOL WINAPI ChangeClipboardChain(HWND, HWND);
+
+/* Clipboard command messages */
+#define WM_CUT 0x0300
+#define WM_COPY 0x0301
+#define WM_PASTE 0x0302
+#define WM_CLEAR 0x0303
+#define WM_UNDO 0x0304
+
+/* Clipboard owner messages */
+#define WM_RENDERFORMAT 0x0305
+#define WM_RENDERALLFORMATS 0x0306
+#define WM_DESTROYCLIPBOARD 0x0307
+
+/* Clipboard viewer messages */
+#define WM_DRAWCLIPBOARD 0x0308
+#define WM_PAINTCLIPBOARD 0x0309
+#define WM_SIZECLIPBOARD 0x030B
+#define WM_VSCROLLCLIPBOARD 0x030A
+#define WM_HSCROLLCLIPBOARD 0x030E
+#define WM_ASKCBFORMATNAME 0x030C
+#define WM_CHANGECBCHAIN 0x030D
+
+#endif /* NOCLIPBOARD */
+
+/****** Mouse cursor support *************************************************/
+
+HCURSOR WINAPI LoadCursor(HINSTANCE, LPCSTR);
+HCURSOR WINAPI CreateCursor(HINSTANCE, int, int, int, int, const void FAR*, const void FAR*);
+BOOL WINAPI DestroyCursor(HCURSOR);
+
+#if (WINVER >= 0x030a)
+HCURSOR WINAPI CopyCursor(HINSTANCE, HCURSOR);
+#endif /* WINVER >= 0x030a */
+
+int WINAPI ShowCursor(BOOL);
+
+void WINAPI SetCursorPos(int, int);
+void WINAPI GetCursorPos(POINT FAR*);
+
+HCURSOR WINAPI SetCursor(HCURSOR);
+
+#if (WINVER >= 0x030a)
+HCURSOR WINAPI GetCursor(void);
+#endif /* WINVER >= 0x030a */
+
+void WINAPI ClipCursor(const RECT FAR*);
+#if (WINVER >= 0x030a)
+void WINAPI GetClipCursor(RECT FAR*);
+#endif /* WINVER >= 0x030a */
+
+/* Standard cursor resource IDs */
+#define IDC_ARROW MAKEINTRESOURCE(32512)
+#define IDC_IBEAM MAKEINTRESOURCE(32513)
+#define IDC_WAIT MAKEINTRESOURCE(32514)
+#define IDC_CROSS MAKEINTRESOURCE(32515)
+#define IDC_UPARROW MAKEINTRESOURCE(32516)
+#define IDC_SIZE MAKEINTRESOURCE(32640)
+#define IDC_ICON MAKEINTRESOURCE(32641)
+#define IDC_SIZENWSE MAKEINTRESOURCE(32642)
+#define IDC_SIZENESW MAKEINTRESOURCE(32643)
+#define IDC_SIZEWE MAKEINTRESOURCE(32644)
+#define IDC_SIZENS MAKEINTRESOURCE(32645)
+
+#define WM_SETCURSOR 0x0020
+
+/****** Icon support *********************************************************/
+
+HICON WINAPI LoadIcon(HINSTANCE, LPCSTR);
+HICON WINAPI CreateIcon(HINSTANCE, int, int, BYTE, BYTE, const void FAR*, const void FAR*);
+BOOL WINAPI DestroyIcon(HICON);
+
+#if (WINVER >= 0x030a)
+HICON WINAPI CopyIcon(HINSTANCE, HICON);
+#endif /* WINVER >= 0x030a */
+
+BOOL WINAPI DrawIcon(HDC, int, int, HICON);
+
+#ifndef NOICONS
+
+/* Standard icon resource IDs */
+#define IDI_APPLICATION MAKEINTRESOURCE(32512)
+#define IDI_HAND MAKEINTRESOURCE(32513)
+#define IDI_QUESTION MAKEINTRESOURCE(32514)
+#define IDI_EXCLAMATION MAKEINTRESOURCE(32515)
+#define IDI_ASTERISK MAKEINTRESOURCE(32516)
+
+#endif /* NOICONS */
+
+/****** Message Box support *************************************************/
+
+#ifndef NOMB
+
+int WINAPI MessageBox(HWND, LPCSTR, LPCSTR, UINT);
+void WINAPI MessageBeep(UINT);
+
+#define MB_OK 0x0000
+#define MB_OKCANCEL 0x0001
+#define MB_ABORTRETRYIGNORE 0x0002
+#define MB_YESNOCANCEL 0x0003
+#define MB_YESNO 0x0004
+#define MB_RETRYCANCEL 0x0005
+#define MB_TYPEMASK 0x000F
+
+#define MB_ICONHAND 0x0010
+#define MB_ICONQUESTION 0x0020
+#define MB_ICONEXCLAMATION 0x0030
+#define MB_ICONASTERISK 0x0040
+#define MB_ICONMASK 0x00F0
+
+#define MB_ICONINFORMATION MB_ICONASTERISK
+#define MB_ICONSTOP MB_ICONHAND
+
+#define MB_DEFBUTTON1 0x0000
+#define MB_DEFBUTTON2 0x0100
+#define MB_DEFBUTTON3 0x0200
+#define MB_DEFMASK 0x0F00
+
+#define MB_APPLMODAL 0x0000
+#define MB_SYSTEMMODAL 0x1000
+#define MB_TASKMODAL 0x2000
+
+#define MB_NOFOCUS 0x8000
+
+#define MB_TYPEMASK 0x000F /* ;Internal */
+#define MB_ICONMASK 0x00F0 /* ;Internal */
+#define MB_DEFMASK 0x0F00 /* ;Internal */
+#define MB_MODEMASK 0x3000 /* ;Internal */
+#define MB_MISCMASK 0xC000 /* ;Internal */
+#define MB_VALID 0xb377 /* ;Internal */
+
+
+#endif /* NOMB */
+
+/****** Caret support ********************************************************/
+
+void WINAPI CreateCaret(HWND, HBITMAP, int, int);
+void WINAPI DestroyCaret(void);
+
+void WINAPI SetCaretPos(int, int);
+void WINAPI GetCaretPos(POINT FAR*);
+
+void WINAPI HideCaret(HWND);
+void WINAPI ShowCaret(HWND);
+
+UINT WINAPI GetCaretBlinkTime(void);
+void WINAPI SetCaretBlinkTime(UINT);
+
+/****** WM_SYSCOMMAND support ***********************************************/
+
+#define WM_SYSCOMMAND 0x0112
+
+#ifndef NOSYSCOMMANDS
+
+/* System Menu Command Values */
+#define SC_SIZE 0xF000
+#define SC_MOVE 0xF010
+#define SC_MINIMIZE 0xF020
+#define SC_MAXIMIZE 0xF030
+#define SC_NEXTWINDOW 0xF040
+#define SC_PREVWINDOW 0xF050
+#define SC_CLOSE 0xF060
+#define SC_VSCROLL 0xF070
+#define SC_HSCROLL 0xF080
+#define SC_MOUSEMENU 0xF090
+#define SC_KEYMENU 0xF100
+#define SC_ARRANGE 0xF110
+#define SC_RESTORE 0xF120
+#define SC_TASKLIST 0xF130
+#define SC_SCREENSAVE 0xF140
+#define SC_HOTKEY 0xF150
+
+/* Obsolete names */
+#define SC_ICON SC_MINIMIZE
+#define SC_ZOOM SC_MAXIMIZE
+
+/* SC_HOTKEY support messages */ /* ;Internal */
+#define WM_SETHOTKEY 0x0032 /* ;Internal */
+#define WM_GETHOTKEY 0x0033 /* ;Internal */
+
+#endif /* NOSYSCOMMANDS */
+
+/****** MDI Support *********************************************************/
+
+#ifndef NOMDI
+
+/* CreateWindow lpParams structure for creating MDI client */
+typedef struct tagCLIENTCREATESTRUCT
+{
+ HMENU hWindowMenu;
+ UINT idFirstChild;
+} CLIENTCREATESTRUCT;
+typedef CLIENTCREATESTRUCT FAR* LPCLIENTCREATESTRUCT;
+
+/* MDI client style bits */
+#if (WINVER >= 0x030a)
+#define MDIS_ALLCHILDSTYLES 0x0001
+#endif /* WINVER >= 0x030a */
+
+/* MDI messages */
+#define WM_MDICREATE 0x0220
+#define WM_MDIDESTROY 0x0221
+#define WM_MDIACTIVATE 0x0222
+#define WM_MDIRESTORE 0x0223
+#define WM_MDINEXT 0x0224
+#define WM_MDIMAXIMIZE 0x0225
+#define WM_MDITILE 0x0226
+#define WM_MDICASCADE 0x0227
+#define WM_MDIICONARRANGE 0x0228
+#define WM_MDIGETACTIVE 0x0229
+#define WM_MDISETMENU 0x0230
+
+/* WM_MDICREATE message structure */
+typedef struct tagMDICREATESTRUCT
+{
+ LPCSTR szClass;
+ LPCSTR szTitle;
+ HINSTANCE hOwner;
+ int x;
+ int y;
+ int cx;
+ int cy;
+ DWORD style;
+ LPARAM lParam;
+} MDICREATESTRUCT;
+typedef MDICREATESTRUCT FAR* LPMDICREATESTRUCT;
+
+#if (WINVER >= 0x030a)
+/* wParam values for WM_MDITILE and WM_MDICASCADE messages. */
+#define MDITILE_VERTICAL 0x0000
+#define MDITILE_HORIZONTAL 0x0001
+#define MDITILE_SKIPDISABLED 0x0002
+#endif /* WINVER >= 0x030a */
+
+#define WM_CHILDACTIVATE 0x0022
+
+LRESULT WINAPI DefFrameProc(HWND, HWND, UINT, WPARAM, LPARAM);
+LRESULT WINAPI DefMDIChildProc(HWND, UINT, WPARAM, LPARAM);
+
+#ifndef NOMSG
+BOOL WINAPI TranslateMDISysAccel(HWND, MSG FAR*);
+#endif
+
+UINT WINAPI ArrangeIconicWindows(HWND);
+
+#endif /* NOMDI */
+
+/****** Dialog and Control Management ***************************************/
+
+#ifndef NOCTLMGR
+
+/* Dialog window class */
+#define WC_DIALOG (MAKEINTATOM(0x8002))
+
+/* cbWndExtra bytes needed by dialog manager for dialog classes */
+#define DLGWINDOWEXTRA 30
+
+/* Dialog styles */
+#define DS_ABSALIGN 0x01L
+#define DS_SYSMODAL 0x02L
+#define DS_LOCALEDIT 0x20L
+#define DS_SETFONT 0x40L
+#define DS_MODALFRAME 0x80L
+#define DS_NOIDLEMSG 0x100L
+
+/* Dialog messages */
+#define DM_GETDEFID (WM_USER+0)
+#define DM_SETDEFID (WM_USER+1)
+
+/* Returned in HIWORD() of DM_GETDEFID result if msg is supported */
+#define DC_HASDEFID 0x534B
+
+#endif /* NOCTLMGR */
+
+/* Dialog notification messages */
+#define WM_INITDIALOG 0x0110
+#define WM_NEXTDLGCTL 0x0028
+#define WM_ALTTABACTIVE 0x0029 /* ;Internal */
+
+#define WM_PARENTNOTIFY 0x0210
+
+#define WM_ENTERIDLE 0x0121
+
+
+#ifndef NOCTLMGR
+
+#ifdef STRICT
+typedef BOOL (CALLBACK* DLGPROC)(HWND, UINT, WPARAM, LPARAM);
+#else
+typedef FARPROC DLGPROC;
+#endif
+
+/* Get/SetWindowWord/Long offsets for use with WC_DIALOG windows */
+#define DWL_MSGRESULT 0
+#define DWL_DLGPROC 4
+#define DWL_USER 8
+
+#ifndef NOMSG
+BOOL WINAPI IsDialogMessage(HWND, MSG FAR*);
+#endif
+
+LRESULT WINAPI DefDlgProc(HWND, UINT, WPARAM, LPARAM);
+
+HWND WINAPI CreateDialog(HINSTANCE, LPCSTR, HWND, DLGPROC);
+HWND WINAPI CreateDialogIndirect(HINSTANCE, const void FAR*, HWND, DLGPROC);
+HWND WINAPI CreateDialogParam(HINSTANCE, LPCSTR, HWND, DLGPROC, LPARAM);
+HWND WINAPI CreateDialogIndirectParam(HINSTANCE, const void FAR*, HWND, DLGPROC, LPARAM);
+
+int WINAPI DialogBox(HINSTANCE, LPCSTR, HWND, DLGPROC);
+int WINAPI DialogBoxIndirect(HINSTANCE, HGLOBAL, HWND, DLGPROC);
+int WINAPI DialogBoxParam(HINSTANCE, LPCSTR, HWND, DLGPROC, LPARAM);
+int WINAPI DialogBoxIndirectParam(HINSTANCE, HGLOBAL, HWND, DLGPROC, LPARAM);
+
+void WINAPI EndDialog(HWND, int);
+
+int WINAPI GetDlgCtrlID(HWND);
+HWND WINAPI GetDlgItem(HWND, int);
+LRESULT WINAPI SendDlgItemMessage(HWND, int, UINT, WPARAM, LPARAM);
+
+void WINAPI SetDlgItemInt(HWND, int, UINT, BOOL);
+UINT WINAPI GetDlgItemInt(HWND, int, BOOL FAR* , BOOL);
+
+void WINAPI SetDlgItemText(HWND, int, LPCSTR);
+int WINAPI GetDlgItemText(HWND, int, LPSTR, int);
+
+void WINAPI CheckDlgButton(HWND, int, UINT);
+void WINAPI CheckRadioButton(HWND, int, int, int);
+UINT WINAPI IsDlgButtonChecked(HWND, int);
+
+HWND WINAPI GetNextDlgGroupItem(HWND, HWND, BOOL);
+HWND WINAPI GetNextDlgTabItem(HWND, HWND, BOOL);
+
+void WINAPI MapDialogRect(HWND, RECT FAR*);
+DWORD WINAPI GetDialogBaseUnits(void);
+
+#define WM_GETDLGCODE 0x0087
+
+/* dialog codes */
+#define DLGC_WANTARROWS 0x0001
+#define DLGC_WANTTAB 0x0002
+#define DLGC_WANTALLKEYS 0x0004
+#define DLGC_WANTMESSAGE 0x0004
+#define DLGC_HASSETSEL 0x0008
+#define DLGC_DEFPUSHBUTTON 0x0010
+#define DLGC_UNDEFPUSHBUTTON 0x0020
+#define DLGC_RADIOBUTTON 0x0040
+#define DLGC_WANTCHARS 0x0080
+#define DLGC_STATIC 0x0100
+#define DLGC_BUTTON 0x2000
+
+#define WM_CTLCOLOR 0x0019
+
+/* WM_CTLCOLOR control IDs */
+#define CTLCOLOR_MSGBOX 0
+#define CTLCOLOR_EDIT 1
+#define CTLCOLOR_LISTBOX 2
+#define CTLCOLOR_BTN 3
+#define CTLCOLOR_DLG 4
+#define CTLCOLOR_SCROLLBAR 5
+#define CTLCOLOR_STATIC 6
+#define CTLCOLOR_MAX 8 /* ;Internal */
+
+#define WM_SETFONT 0x0030
+#define WM_GETFONT 0x0031
+
+#endif /* NOCTLMGR */
+
+/* Standard dialog button IDs */
+#define IDOK 1
+#define IDCANCEL 2
+#define IDABORT 3
+#define IDRETRY 4
+#define IDIGNORE 5
+#define IDYES 6
+#define IDNO 7
+
+/****** Owner draw control support ******************************************/
+
+/* Owner draw control types */
+#define ODT_MENU 1
+#define ODT_LISTBOX 2
+#define ODT_COMBOBOX 3
+#define ODT_BUTTON 4
+
+/* Owner draw actions */
+#define ODA_DRAWENTIRE 0x0001
+#define ODA_SELECT 0x0002
+#define ODA_FOCUS 0x0004
+
+/* Owner draw state */
+#define ODS_SELECTED 0x0001
+#define ODS_GRAYED 0x0002
+#define ODS_DISABLED 0x0004
+#define ODS_CHECKED 0x0008
+#define ODS_FOCUS 0x0010
+
+#define WM_DRAWITEM 0x002B
+
+typedef struct tagDRAWITEMSTRUCT
+{
+ UINT CtlType;
+ UINT CtlID;
+ UINT itemID;
+ UINT itemAction;
+ UINT itemState;
+ HWND hwndItem;
+ HDC hDC;
+ RECT rcItem;
+ DWORD itemData;
+} DRAWITEMSTRUCT;
+typedef DRAWITEMSTRUCT NEAR* PDRAWITEMSTRUCT;
+typedef DRAWITEMSTRUCT FAR* LPDRAWITEMSTRUCT;
+
+#define WM_MEASUREITEM 0x002C
+
+typedef struct tagMEASUREITEMSTRUCT
+{
+ UINT CtlType;
+ UINT CtlID;
+ UINT itemID;
+ UINT itemWidth;
+ UINT itemHeight;
+ DWORD itemData;
+} MEASUREITEMSTRUCT;
+typedef MEASUREITEMSTRUCT NEAR* PMEASUREITEMSTRUCT;
+typedef MEASUREITEMSTRUCT FAR* LPMEASUREITEMSTRUCT;
+
+#define WM_DELETEITEM 0x002D
+
+typedef struct tagDELETEITEMSTRUCT
+{
+ UINT CtlType;
+ UINT CtlID;
+ UINT itemID;
+ HWND hwndItem;
+ DWORD itemData;
+} DELETEITEMSTRUCT;
+typedef DELETEITEMSTRUCT NEAR* PDELETEITEMSTRUCT;
+typedef DELETEITEMSTRUCT FAR* LPDELETEITEMSTRUCT;
+
+#define WM_COMPAREITEM 0x0039
+
+typedef struct tagCOMPAREITEMSTRUCT
+{
+ UINT CtlType;
+ UINT CtlID;
+ HWND hwndItem;
+ UINT itemID1;
+ DWORD itemData1;
+ UINT itemID2;
+ DWORD itemData2;
+} COMPAREITEMSTRUCT;
+typedef COMPAREITEMSTRUCT NEAR* PCOMPAREITEMSTRUCT;
+typedef COMPAREITEMSTRUCT FAR* LPCOMPAREITEMSTRUCT;
+
+/****** Static control ******************************************************/
+
+#ifndef NOCTLMGR
+
+/* Static Control Styles */
+#define SS_LEFT 0x00000000L
+#define SS_CENTER 0x00000001L
+#define SS_RIGHT 0x00000002L
+#define SS_ICON 0x00000003L
+#define SS_BLACKRECT 0x00000004L
+#define SS_GRAYRECT 0x00000005L
+#define SS_WHITERECT 0x00000006L
+#define SS_BLACKFRAME 0x00000007L
+#define SS_GRAYFRAME 0x00000008L
+#define SS_WHITEFRAME 0x00000009L
+#define SS_USERITEM 0x0000000AL /* ;Internal */
+#define SS_SIMPLE 0x0000000BL
+#define SS_LEFTNOWORDWRAP 0x0000000CL
+#define SS_NOPREFIX 0x00000080L
+
+#if (WINVER >= 0x030a)
+#ifndef NOWINMESSAGES
+/* Static Control Mesages */
+#define STM_SETICON (WM_USER+0)
+#define STM_GETICON (WM_USER+1)
+#define STM_MSGMAX (WM_USER+2) /* ;Internal */
+#endif /* NOWINMESSAGES */
+#endif /* WINVER >= 0x030a */
+
+#endif /* NOCTLMGR */
+
+/****** Button control *****************************************************/
+
+#ifndef NOCTLMGR
+
+/* Button Control Styles */
+#define BS_PUSHBUTTON 0x00000000L
+#define BS_DEFPUSHBUTTON 0x00000001L
+#define BS_CHECKBOX 0x00000002L
+#define BS_AUTOCHECKBOX 0x00000003L
+#define BS_RADIOBUTTON 0x00000004L
+#define BS_3STATE 0x00000005L
+#define BS_AUTO3STATE 0x00000006L
+#define BS_GROUPBOX 0x00000007L
+#define BS_USERBUTTON 0x00000008L
+#define BS_AUTORADIOBUTTON 0x00000009L
+#define BS_PUSHBOX 0x0000000AL /* ;Internal */
+#define BS_OWNERDRAW 0x0000000BL
+#define BS_LEFTTEXT 0x00000020L
+
+/* Button Control Messages */
+#define BM_GETCHECK (WM_USER+0)
+#define BM_SETCHECK (WM_USER+1)
+#define BM_GETSTATE (WM_USER+2)
+#define BM_SETSTATE (WM_USER+3)
+#define BM_SETSTYLE (WM_USER+4)
+
+/* User Button Notification Codes */
+#define BN_CLICKED 0
+#define BN_PAINT 1
+#define BN_HILITE 2
+#define BN_UNHILITE 3
+#define BN_DISABLE 4
+#define BN_DOUBLECLICKED 5
+
+#endif /* NOCTLMGR */
+
+/****** Edit control *******************************************************/
+
+#ifndef NOCTLMGR
+
+/* Edit control styles */
+#ifndef NOWINSTYLES
+#define ES_LEFT 0x00000000L
+#define ES_CENTER 0x00000001L
+#define ES_RIGHT 0x00000002L
+#define ES_MULTILINE 0x00000004L
+#define ES_UPPERCASE 0x00000008L
+#define ES_LOWERCASE 0x00000010L
+#define ES_PASSWORD 0x00000020L
+#define ES_AUTOVSCROLL 0x00000040L
+#define ES_AUTOHSCROLL 0x00000080L
+#define ES_NOHIDESEL 0x00000100L
+#define ES_OEMCONVERT 0x00000400L
+#if (WINVER >= 0x030a)
+#define ES_READONLY 0x00000800L
+#define ES_WANTRETURN 0x00001000L
+#endif /* WINVER >= 0x030a */
+#endif /* NOWINSTYLES */
+
+/* Edit control messages */
+#ifndef NOWINMESSAGES
+#define EM_GETSEL (WM_USER+0)
+#define EM_SETSEL (WM_USER+1)
+#define EM_GETRECT (WM_USER+2)
+#define EM_SETRECT (WM_USER+3)
+#define EM_SETRECTNP (WM_USER+4)
+#define EM_SCROLL (WM_USER+5) /* ;Internal */
+#define EM_LINESCROLL (WM_USER+6)
+#define EM_GETMODIFY (WM_USER+8)
+#define EM_SETMODIFY (WM_USER+9)
+#define EM_GETLINECOUNT (WM_USER+10)
+#define EM_LINEINDEX (WM_USER+11)
+#define EM_SETHANDLE (WM_USER+12)
+#define EM_GETHANDLE (WM_USER+13)
+#define EM_GETTHUMB (WM_USER+14) /* ;Internal */
+#define EM_LINELENGTH (WM_USER+17)
+#define EM_REPLACESEL (WM_USER+18)
+#define EM_SETFONT (WM_USER+19) /* NOT IMPLEMENTED: use WM_SETFONT */
+#define EM_GETLINE (WM_USER+20)
+#define EM_LIMITTEXT (WM_USER+21)
+#define EM_CANUNDO (WM_USER+22)
+#define EM_UNDO (WM_USER+23)
+#define EM_FMTLINES (WM_USER+24)
+#define EM_LINEFROMCHAR (WM_USER+25)
+#define EM_SETWORDBREAK (WM_USER+26) /* NOT IMPLEMENTED: use EM_SETWORDBREAK */
+#define EM_SETTABSTOPS (WM_USER+27)
+#define EM_SETPASSWORDCHAR (WM_USER+28)
+#define EM_EMPTYUNDOBUFFER (WM_USER+29)
+#if (WINVER >= 0x030a)
+#define EM_GETFIRSTVISIBLELINE (WM_USER+30)
+#define EM_SETREADONLY (WM_USER+31)
+#define EM_SETWORDBREAKPROC (WM_USER+32)
+#define EM_GETWORDBREAKPROC (WM_USER+33)
+#define EM_GETPASSWORDCHAR (WM_USER+34)
+#endif /* WINVER >= 0x030a */
+#define EM_MSGMAX (WM_USER+35) /* ;Internal */
+#endif /* NOWINMESSAGES */
+
+#if (WINVER >= 0x030a)
+typedef int (CALLBACK* EDITWORDBREAKPROC)(LPSTR lpch, int ichCurrent, int cch, int code);
+
+/* EDITWORDBREAKPROC code values */
+#define WB_LEFT 0
+#define WB_RIGHT 1
+#define WB_ISDELIMITER 2
+#endif /* WINVER >= 0x030a */
+
+/* Edit control notification codes */
+#define EN_SETFOCUS 0x0100
+#define EN_KILLFOCUS 0x0200
+#define EN_CHANGE 0x0300
+#define EN_UPDATE 0x0400
+#define EN_ERRSPACE 0x0500
+#define EN_MAXTEXT 0x0501
+#define EN_HSCROLL 0x0601
+#define EN_VSCROLL 0x0602
+
+#endif /* NOCTLMGR */
+
+/****** Scroll bar control *************************************************/
+/* Also see scrolling support */
+
+#ifndef NOCTLMGR
+
+#ifndef NOWINSTYLES
+
+/* Scroll bar styles */
+#define SBS_HORZ 0x0000L
+#define SBS_VERT 0x0001L
+#define SBS_TOPALIGN 0x0002L
+#define SBS_LEFTALIGN 0x0002L
+#define SBS_BOTTOMALIGN 0x0004L
+#define SBS_RIGHTALIGN 0x0004L
+#define SBS_SIZEBOXTOPLEFTALIGN 0x0002L
+#define SBS_SIZEBOXBOTTOMRIGHTALIGN 0x0004L
+#define SBS_SIZEBOX 0x0008L
+
+#endif /* NOWINSTYLES */
+
+#endif /* NOCTLMGR */
+
+/****** Listbox control ****************************************************/
+
+#ifndef NOCTLMGR
+
+/* Listbox styles */
+#ifndef NOWINSTYLES
+#define LBS_NOTIFY 0x0001L
+#define LBS_SORT 0x0002L
+#define LBS_NOREDRAW 0x0004L
+#define LBS_MULTIPLESEL 0x0008L
+#define LBS_OWNERDRAWFIXED 0x0010L
+#define LBS_OWNERDRAWVARIABLE 0x0020L
+#define LBS_HASSTRINGS 0x0040L
+#define LBS_USETABSTOPS 0x0080L
+#define LBS_NOINTEGRALHEIGHT 0x0100L
+#define LBS_MULTICOLUMN 0x0200L
+#define LBS_WANTKEYBOARDINPUT 0x0400L
+#define LBS_EXTENDEDSEL 0x0800L
+#if (WINVER >= 0x030a)
+#define LBS_DISABLENOSCROLL 0x1000L
+#endif /* WINVER >= 0x030a */
+#define LBS_STANDARD (LBS_NOTIFY | LBS_SORT | WS_VSCROLL | WS_BORDER)
+#endif /* NOWINSTYLES */
+
+/* Listbox messages */
+#ifndef NOWINMESSAGES
+#define LB_ADDSTRING (WM_USER+1)
+#define LB_INSERTSTRING (WM_USER+2)
+#define LB_DELETESTRING (WM_USER+3)
+#define LB_RESETCONTENT (WM_USER+5)
+#define LB_SETSEL (WM_USER+6)
+#define LB_SETCURSEL (WM_USER+7)
+#define LB_GETSEL (WM_USER+8)
+#define LB_GETCURSEL (WM_USER+9)
+#define LB_GETTEXT (WM_USER+10)
+#define LB_GETTEXTLEN (WM_USER+11)
+#define LB_GETCOUNT (WM_USER+12)
+#define LB_SELECTSTRING (WM_USER+13)
+#define LB_DIR (WM_USER+14)
+#define LB_GETTOPINDEX (WM_USER+15)
+#define LB_FINDSTRING (WM_USER+16)
+#define LB_GETSELCOUNT (WM_USER+17)
+#define LB_GETSELITEMS (WM_USER+18)
+#define LB_SETTABSTOPS (WM_USER+19)
+#define LB_GETHORIZONTALEXTENT (WM_USER+20)
+#define LB_SETHORIZONTALEXTENT (WM_USER+21)
+#define LB_SETCOLUMNWIDTH (WM_USER+22)
+#define LB_ADDFILE (WM_USER+23) /* ;Internal */
+#define LB_SETTOPINDEX (WM_USER+24)
+#define LB_GETITEMRECT (WM_USER+25)
+#define LB_GETITEMDATA (WM_USER+26)
+#define LB_SETITEMDATA (WM_USER+27)
+#define LB_SELITEMRANGE (WM_USER+28)
+#define LB_SETANCHORINDEX (WM_USER+29) /* ;Internal */
+#define LB_GETANCHORINDEX (WM_USER+30) /* ;Internal */
+#define LB_SETCARETINDEX (WM_USER+31)
+#define LB_GETCARETINDEX (WM_USER+32)
+
+#if (WINVER >= 0x030a)
+#define LB_SETITEMHEIGHT (WM_USER+33)
+#define LB_GETITEMHEIGHT (WM_USER+34)
+#define LB_FINDSTRINGEXACT (WM_USER+35)
+#endif /* WINVER >= 0x030a */
+#define LBCB_CARETON (WM_USER+36) /* ;Internal */
+#define LBCB_CARETOFF (WM_USER+37) /* ;Internal */
+#define LB_MSGMAX (WM_USER+38) /* ;Internal */
+
+#endif /* NOWINMESSAGES */
+
+/* Listbox notification codes */
+#define LBN_ERRSPACE (-2)
+#define LBN_SELCHANGE 1
+#define LBN_DBLCLK 2
+#define LBN_SELCANCEL 3
+#define LBN_SETFOCUS 4
+#define LBN_KILLFOCUS 5
+
+/* Listbox notification messages */
+#define WM_VKEYTOITEM 0x002E
+#define WM_CHARTOITEM 0x002F
+#define WM_LBTRACKPOINT 0x0131 /* ;Internal */
+
+/* Listbox message return values */
+#define LB_OKAY 0
+#define LB_ERR (-1)
+#define LB_ERRSPACE (-2)
+
+#define LB_CTLCODE 0L
+
+/****** Dialog directory support ********************************************/
+
+int WINAPI DlgDirList(HWND, LPSTR, int, int, UINT);
+BOOL WINAPI DlgDirSelect(HWND, LPSTR, int);
+
+int WINAPI DlgDirListComboBox(HWND, LPSTR, int, int, UINT);
+BOOL WINAPI DlgDirSelectComboBox(HWND, LPSTR, int);
+
+#if (WINVER >= 0x030a)
+BOOL WINAPI DlgDirSelectEx(HWND, LPSTR, int, int);
+BOOL WINAPI DlgDirSelectComboBoxEx(HWND, LPSTR, int, int);
+#endif /* WINVER >= 0x030a */
+
+#define LBD_UPPERCASE 0x8001 /* ;Internal */
+#define LBD_SIZE 0x8002 /* ;Internal */
+#define LBD_DATE 0x8004 /* ;Internal */
+#define LBD_TIME 0x8008 /* ;Internal */
+#define LBD_ATTRIBUTE 0x8010 /* ;Internal */
+#define LBD_FULLDETAILS 0x801E /* ;Internal */
+#define LBD_SENDDETAILS 0x8020 /* ;Internal */
+
+/* DlgDirList, DlgDirListComboBox flags values */
+#define DDL_READWRITE 0x0000
+#define DDL_READONLY 0x0001
+#define DDL_HIDDEN 0x0002
+#define DDL_SYSTEM 0x0004
+#define DDL_DIRECTORY 0x0010
+#define DDL_ARCHIVE 0x0020
+
+#define DDL_POSTMSGS 0x2000
+#define DDL_DRIVES 0x4000
+#define DDL_EXCLUSIVE 0x8000
+#define DDL_VALID 0xe03f /* ;Internal */
+
+#endif /* NOCTLMGR */
+
+/****** Combo box control **************************************************/
+
+#ifndef NOCTLMGR
+
+/* Combo box styles */
+#ifndef NOWINSTYLES
+#define CBS_SIMPLE 0x0001L
+#define CBS_DROPDOWN 0x0002L
+#define CBS_DROPDOWNLIST 0x0003L
+#define CBS_OWNERDRAWFIXED 0x0010L
+#define CBS_OWNERDRAWVARIABLE 0x0020L
+#define CBS_AUTOHSCROLL 0x0040L
+#define CBS_OEMCONVERT 0x0080L
+#define CBS_SORT 0x0100L
+#define CBS_HASSTRINGS 0x0200L
+#define CBS_NOINTEGRALHEIGHT 0x0400L
+#if (WINVER >= 0x030a)
+#define CBS_DISABLENOSCROLL 0x0800L
+#endif /* WINVER >= 0x030a */
+#endif /* NOWINSTYLES */
+
+/* Combo box messages */
+#ifndef NOWINMESSAGES
+#define CB_GETEDITSEL (WM_USER+0)
+#define CB_LIMITTEXT (WM_USER+1)
+#define CB_SETEDITSEL (WM_USER+2)
+#define CB_ADDSTRING (WM_USER+3)
+#define CB_DELETESTRING (WM_USER+4)
+#define CB_DIR (WM_USER+5)
+#define CB_GETCOUNT (WM_USER+6)
+#define CB_GETCURSEL (WM_USER+7)
+#define CB_GETLBTEXT (WM_USER+8)
+#define CB_GETLBTEXTLEN (WM_USER+9)
+#define CB_INSERTSTRING (WM_USER+10)
+#define CB_RESETCONTENT (WM_USER+11)
+#define CB_FINDSTRING (WM_USER+12)
+#define CB_SELECTSTRING (WM_USER+13)
+#define CB_SETCURSEL (WM_USER+14)
+#define CB_SHOWDROPDOWN (WM_USER+15)
+#define CB_GETITEMDATA (WM_USER+16)
+#define CB_SETITEMDATA (WM_USER+17)
+#if (WINVER >= 0x030a)
+#define CB_GETDROPPEDCONTROLRECT (WM_USER+18)
+#define CB_SETITEMHEIGHT (WM_USER+19)
+#define CB_GETITEMHEIGHT (WM_USER+20)
+#define CB_SETEXTENDEDUI (WM_USER+21)
+#define CB_GETEXTENDEDUI (WM_USER+22)
+#define CB_GETDROPPEDSTATE (WM_USER+23)
+#define CB_FINDSTRINGEXACT (WM_USER+24)
+#endif /* WINVER >= 0x030a */
+#define CB_MSGMAX (WM_USER+25) /* ;Internal */
+
+#endif /* NOWINMESSAGES */
+
+/* Combo box notification codes */
+#define CBN_ERRSPACE (-1)
+#define CBN_SELCHANGE 1
+#define CBN_DBLCLK 2
+#define CBN_SETFOCUS 3
+#define CBN_KILLFOCUS 4
+#define CBN_EDITCHANGE 5
+#define CBN_EDITUPDATE 6
+#define CBN_DROPDOWN 7
+#if (WINVER >= 0x030a)
+#define CBN_CLOSEUP 8
+#define CBN_SELENDOK 9
+#define CBN_SELENDCANCEL 10
+#endif /* WINVER >= 0x030a */
+
+/* Combo box message return values */
+#define CB_OKAY 0
+#define CB_ERR (-1)
+#define CB_ERRSPACE (-2)
+
+#endif /* NOCTLMGR */
+
+/******* Windows hook support **********************************************/
+
+#ifndef NOWH
+
+DECLARE_HANDLE32(HHOOK);
+
+#ifdef STRICT
+typedef LRESULT (CALLBACK* HOOKPROC)(int code, WPARAM wParam, LPARAM lParam);
+#else
+typedef FARPROC HOOKPROC;
+#endif
+
+#ifdef STRICT
+HHOOK WINAPI SetWindowsHook(int, HOOKPROC);
+LRESULT WINAPI DefHookProc(int, WPARAM, LPARAM, HHOOK FAR*);
+#else
+HOOKPROC WINAPI SetWindowsHook(int, HOOKPROC);
+LRESULT WINAPI DefHookProc(int, WPARAM, LPARAM, HOOKPROC FAR*);
+#endif
+BOOL WINAPI UnhookWindowsHook(int, HOOKPROC);
+
+#if (WINVER >= 0x030a)
+
+HHOOK WINAPI SetWindowsHookEx(int idHook, HOOKPROC lpfn, HINSTANCE hInstance, HTASK hTask);
+BOOL WINAPI UnhookWindowsHookEx(HHOOK hHook);
+LRESULT WINAPI CallNextHookEx(HHOOK hHook, int code, WPARAM wParam, LPARAM lParam);
+
+#endif /* WINVER >= 0x030a */
+
+#define WH_MIN (-1) /* ;Internal */
+#define WH_MAX 10 /* ;Internal */
+#define WH_MINHOOK WH_MIN /* ;Internal */
+#define WH_MAXHOOK WH_MAX /* ;Internal */
+#define WH_CHOOKS (WH_MAXHOOK - WH_MINHOOK + 1) /* ;Internal */
+
+/* Standard hook code */
+#define HC_ACTION 0
+
+/* Obsolete hook codes (NO LONGER SUPPORTED) */
+#define HC_GETLPLPFN (-3)
+#define HC_LPLPFNNEXT (-2)
+#define HC_LPFNNEXT (-1)
+
+#endif /* NOWH */
+
+/****** Computer-based-training (CBT) support *******************************/
+
+#define WM_QUEUESYNC 0x0023
+
+#ifndef NOWH
+
+/* SetWindowsHook() code */
+#define WH_CBT 5
+
+#define HCBT_MOVESIZE 0
+#define HCBT_MINMAX 1
+#define HCBT_QS 2
+#define HCBT_CREATEWND 3
+#define HCBT_DESTROYWND 4
+#define HCBT_ACTIVATE 5
+#define HCBT_CLICKSKIPPED 6
+#define HCBT_KEYSKIPPED 7
+#define HCBT_SYSCOMMAND 8
+#define HCBT_SETFOCUS 9
+
+#if (WINVER >= 0x030a)
+/* HCBT_CREATEWND parameters pointed to by lParam */
+typedef struct tagCBT_CREATEWND
+{
+ CREATESTRUCT FAR* lpcs;
+ HWND hwndInsertAfter;
+} CBT_CREATEWND;
+typedef CBT_CREATEWND FAR* LPCBT_CREATEWND;
+
+/* HCBT_ACTIVATE structure pointed to by lParam */
+typedef struct tagCBTACTIVATESTRUCT
+{
+ BOOL fMouse;
+ HWND hWndActive;
+} CBTACTIVATESTRUCT;
+
+#endif /* WINVER >= 0x030a */
+#endif /* NOWH */
+
+/****** Hardware hook support ***********************************************/
+
+#ifndef NOWH
+#if (WINVER >= 0x030a)
+#define WH_HARDWARE 8
+
+typedef struct tagHARDWAREHOOKSTRUCT
+{
+ HWND hWnd;
+ UINT wMessage;
+ WPARAM wParam;
+ LPARAM lParam;
+} HARDWAREHOOKSTRUCT;
+#endif /* WINVER >= 0x030a */
+#endif /* NOWH */
+
+/****** Shell support *******************************************************/
+
+#ifndef NOWH
+#if (WINVER >= 0x030a)
+/* SetWindowsHook() Shell hook code */
+#define WH_SHELL 10
+
+#define HSHELL_WINDOWCREATED 1
+#define HSHELL_WINDOWDESTROYED 2
+#define HSHELL_ACTIVATESHELLWINDOW 3
+
+#endif /* WINVER >= 0x030a */
+#endif /* NOWH */
+
+/****** Journalling support *************************************************/
+
+#ifndef NOWH
+#define WH_JOURNALRECORD 0
+#define WH_JOURNALPLAYBACK 1
+
+/* Journalling hook codes */
+#define HC_GETNEXT 1
+#define HC_SKIP 2
+#define HC_NOREMOVE 3
+#define HC_NOREM HC_NOREMOVE
+#define HC_SYSMODALON 4
+#define HC_SYSMODALOFF 5
+
+/* Journalling message structure */
+typedef struct tagEVENTMSG
+{
+ UINT message;
+ UINT paramL;
+ UINT paramH;
+ DWORD time;
+} EVENTMSG;
+typedef EVENTMSG *PEVENTMSG;
+typedef EVENTMSG *PEVENTMSGMSG; /* ;Internal */
+typedef EVENTMSG NEAR* NPEVENTMSG;
+typedef EVENTMSG FAR* LPEVENTMSG;
+typedef EVENTMSG FAR* LPEVENTMSGMSG; /* ;Internal */
+
+BOOL WINAPI EnableHardwareInput(BOOL);
+
+#endif /* NOWH */
+
+
+/****** Debugger support ****************************************************/
+
+#if (WINVER >= 0x030a)
+/* SetWindowsHook debug hook support */
+#define WH_DEBUG 9
+
+typedef struct tagDEBUGHOOKINFO
+{
+ HMODULE hModuleHook;
+ LPARAM reserved;
+ LPARAM lParam;
+ WPARAM wParam;
+ int code;
+} DEBUGHOOKINFO;
+typedef DEBUGHOOKINFO FAR* LPDEBUGHOOKINFO;
+
+#ifndef NOMSG
+BOOL WINAPI QuerySendMessage(HANDLE h1, HANDLE h2, HANDLE h3, LPMSG lpmsg);
+#endif /* NOMSG */
+
+BOOL WINAPI LockInput(HANDLE h1, HWND hwndInput, BOOL fLock);
+
+LONG WINAPI GetSystemDebugState(void);
+/* Flags returned by GetSystemDebugState.
+ */
+#define SDS_MENU 0x0001
+#define SDS_SYSMODAL 0x0002
+#define SDS_NOTASKQUEUE 0x0004
+#define SDS_DIALOG 0x0008
+#define SDS_TASKLOCKED 0x0010
+#endif /* WINVER >= 0x030a */
+
+/****** Help support ********************************************************/
+
+#ifndef NOHELP
+
+BOOL WINAPI WinHelp(HWND hwndMain, LPCSTR lpszHelp, UINT usCommand, DWORD ulData);
+
+/* WinHelp() commands */
+#define HELP_CONTEXT 0x0001
+#define HELP_QUIT 0x0002
+#define HELP_INDEX 0x0003
+#define HELP_CONTENTS 0x0003
+#define HELP_HELPONHELP 0x0004
+#define HELP_SETINDEX 0x0005
+#define HELP_SETCONTENTS 0x0005
+#define HELP_CONTEXTPOPUP 0x0008
+#define HELP_FORCEFILE 0x0009
+#define HELP_KEY 0x0101
+#define HELP_COMMAND 0x0102
+#define HELP_PARTIALKEY 0x0105
+#define HELP_MULTIKEY 0x0201
+#define HELP_SETWINPOS 0x0203
+
+typedef struct tagMULTIKEYHELP
+{
+ UINT mkSize;
+ BYTE mkKeylist;
+ BYTE szKeyphrase[1];
+} MULTIKEYHELP;
+
+
+typedef struct
+{
+ int wStructSize;
+ int x;
+ int y;
+ int dx;
+ int dy;
+ int wMax;
+ char rgchMember[2];
+} HELPWININFO;
+typedef HELPWININFO NEAR* PHELPWININFO;
+typedef HELPWININFO FAR* LPHELPWININFO;
+
+#endif /* NOHELP */
+
+/****** Sound support ******************************************************/
+
+#ifndef NOSOUND
+
+int WINAPI OpenSound(void);
+void WINAPI CloseSound(void);
+
+int WINAPI StartSound(void);
+int WINAPI StopSound(void);
+
+int WINAPI SetVoiceQueueSize(int, int);
+int WINAPI SetVoiceNote(int, int, int, int);
+int WINAPI SetVoiceAccent(int, int, int, int, int);
+int WINAPI SetVoiceEnvelope(int, int, int);
+int WINAPI SetVoiceSound(int, DWORD, int);
+
+int WINAPI SetVoiceThreshold(int, int);
+int FAR* WINAPI GetThresholdEvent(void);
+int WINAPI GetThresholdStatus(void);
+
+int WINAPI SetSoundNoise(int, int);
+
+/* SetSoundNoise() Sources */
+#define S_PERIOD512 0
+#define S_PERIOD1024 1
+#define S_PERIOD2048 2
+#define S_PERIODVOICE 3
+#define S_WHITE512 4
+#define S_WHITE1024 5
+#define S_WHITE2048 6
+#define S_WHITEVOICE 7
+
+int WINAPI WaitSoundState(int);
+
+/* WaitSoundState() constants */
+#define S_QUEUEEMPTY 0
+#define S_THRESHOLD 1
+#define S_ALLTHRESHOLD 2
+
+int WINAPI SyncAllVoices(void);
+int WINAPI CountVoiceNotes(int);
+
+/* Accent Modes */
+#define S_NORMAL 0
+#define S_LEGATO 1
+#define S_STACCATO 2
+
+/* Error return values */
+#define S_SERDVNA (-1)
+#define S_SEROFM (-2)
+#define S_SERMACT (-3)
+#define S_SERQFUL (-4)
+#define S_SERBDNT (-5)
+#define S_SERDLN (-6)
+#define S_SERDCC (-7)
+#define S_SERDTP (-8)
+#define S_SERDVL (-9)
+#define S_SERDMD (-10)
+#define S_SERDSH (-11)
+#define S_SERDPT (-12)
+#define S_SERDFQ (-13)
+#define S_SERDDR (-14)
+#define S_SERDSR (-15)
+#define S_SERDST (-16)
+
+#endif /* NOSOUND */
+
+/****** Comm support ******************************************************/
+
+#ifndef NOCOMM
+
+#define NOPARITY 0
+#define ODDPARITY 1
+#define EVENPARITY 2
+#define MARKPARITY 3
+#define SPACEPARITY 4
+
+#define ONESTOPBIT 0
+#define ONE5STOPBITS 1
+#define TWOSTOPBITS 2
+
+#define IGNORE 0
+#define INFINITE 0xFFFF
+
+/* Error Flags */
+#define CE_RXOVER 0x0001
+#define CE_OVERRUN 0x0002
+#define CE_RXPARITY 0x0004
+#define CE_FRAME 0x0008
+#define CE_BREAK 0x0010
+#define CE_CTSTO 0x0020
+#define CE_DSRTO 0x0040
+#define CE_RLSDTO 0x0080
+#define CE_TXFULL 0x0100
+#define CE_PTO 0x0200
+#define CE_IOE 0x0400
+#define CE_DNS 0x0800
+#define CE_OOP 0x1000
+#define CE_MODE 0x8000
+
+#define IE_BADID (-1)
+#define IE_OPEN (-2)
+#define IE_NOPEN (-3)
+#define IE_MEMORY (-4)
+#define IE_DEFAULT (-5)
+#define IE_HARDWARE (-10)
+#define IE_BYTESIZE (-11)
+#define IE_BAUDRATE (-12)
+
+/* Events */
+#define EV_RXCHAR 0x0001
+#define EV_RXFLAG 0x0002
+#define EV_TXEMPTY 0x0004
+#define EV_CTS 0x0008
+#define EV_DSR 0x0010
+#define EV_RLSD 0x0020
+#define EV_BREAK 0x0040
+#define EV_ERR 0x0080
+#define EV_RING 0x0100
+#define EV_PERR 0x0200
+#define EV_CTSS 0x0400
+#define EV_DSRS 0x0800
+#define EV_RLSDS 0x1000
+#define EV_RingTe 0x2000
+#define EV_RINGTE EV_RingTe
+#define EV_VALID 0x3fff /* ;Internal */
+
+/* Escape Functions */
+#define SETXOFF 1
+#define SETXON 2
+#define SETRTS 3
+#define CLRRTS 4
+#define SETDTR 5
+#define CLRDTR 6
+#define RESETDEV 7
+
+#define LPTx 0x80
+
+#if (WINVER >= 0x030a)
+
+/* new escape functions */
+#define GETMAXLPT 8
+#define GETMAXCOM 9
+#define GETBASEIRQ 10
+
+/* Comm Baud Rate indices */
+#define CBR_110 0xFF10
+#define CBR_300 0xFF11
+#define CBR_600 0xFF12
+#define CBR_1200 0xFF13
+#define CBR_2400 0xFF14
+#define CBR_4800 0xFF15
+#define CBR_9600 0xFF16
+#define CBR_14400 0xFF17
+#define CBR_19200 0xFF18
+#define CBR_38400 0xFF1B
+#define CBR_56000 0xFF1F
+#define CBR_128000 0xFF23
+#define CBR_256000 0xFF27
+
+/* notifications passed in low word of lParam on WM_COMMNOTIFY messages */
+#define CN_RECEIVE 0x0001
+#define CN_TRANSMIT 0x0002
+#define CN_EVENT 0x0004
+
+#endif /* WINVER >= 0x030a */
+
+typedef struct tagDCB
+{
+ BYTE Id;
+ UINT BaudRate;
+ BYTE ByteSize;
+ BYTE Parity;
+ BYTE StopBits;
+ UINT RlsTimeout;
+ UINT CtsTimeout;
+ UINT DsrTimeout;
+
+ UINT fBinary :1;
+ UINT fRtsDisable :1;
+ UINT fParity :1;
+ UINT fOutxCtsFlow :1;
+ UINT fOutxDsrFlow :1;
+ UINT fDummy :2;
+ UINT fDtrDisable :1;
+
+ UINT fOutX :1;
+ UINT fInX :1;
+ UINT fPeChar :1;
+ UINT fNull :1;
+ UINT fChEvt :1;
+ UINT fDtrflow :1;
+ UINT fRtsflow :1;
+ UINT fDummy2 :1;
+
+ char XonChar;
+ char XoffChar;
+ UINT XonLim;
+ UINT XoffLim;
+ char PeChar;
+ char EofChar;
+ char EvtChar;
+ UINT TxDelay;
+} DCB;
+typedef DCB FAR* LPDCB;
+
+#if (defined(STRICT) | (WINVER >= 0x030a))
+
+typedef struct tagCOMSTAT
+{
+ BYTE status;
+ UINT cbInQue;
+ UINT cbOutQue;
+} COMSTAT;
+
+#define CSTF_CTSHOLD 0x01
+#define CSTF_DSRHOLD 0x02
+#define CSTF_RLSDHOLD 0x04
+#define CSTF_XOFFHOLD 0x08
+#define CSTF_XOFFSENT 0x10
+#define CSTF_EOF 0x20
+#define CSTF_TXIM 0x40
+
+#else /* (STRICT | WINVER >= 0x030a) */
+
+/* NOTE: This structure declaration is not ANSI compatible! */
+typedef struct tagCOMSTAT
+{
+ BYTE fCtsHold :1;
+ BYTE fDsrHold :1;
+ BYTE fRlsdHold :1;
+ BYTE fXoffHold :1;
+ BYTE fXoffSent :1;
+ BYTE fEof :1;
+ BYTE fTxim :1;
+ UINT cbInQue;
+ UINT cbOutQue;
+} COMSTAT;
+
+#endif /* !(STRICT | WINVER >= 0x030a */
+
+int WINAPI BuildCommDCB(LPCSTR, DCB FAR*);
+
+int WINAPI OpenComm(LPCSTR, UINT, UINT);
+int WINAPI CloseComm(int);
+
+int WINAPI ReadComm(int, void FAR*, int);
+int WINAPI WriteComm(int, const void FAR*, int);
+int WINAPI UngetCommChar(int, char);
+int WINAPI FlushComm(int, int);
+int WINAPI TransmitCommChar(int, char);
+
+int WINAPI SetCommState(const DCB FAR*);
+int WINAPI GetCommState(int, DCB FAR*);
+int WINAPI GetCommError(int, COMSTAT FAR* );
+
+int WINAPI SetCommBreak(int);
+int WINAPI ClearCommBreak(int);
+
+UINT FAR* WINAPI SetCommEventMask(int, UINT);
+UINT WINAPI GetCommEventMask(int, int);
+
+LONG WINAPI EscapeCommFunction(int, int);
+
+#if (WINVER >= 0x030a)
+BOOL WINAPI EnableCommNotification(int, HWND, int, int);
+
+#define WM_COMMNOTIFY 0x0044
+#endif /* WINVER >= 0x030a */
+
+#endif /* NOCOMM */
+
+/****** String formatting support *******************************************/
+
+int WINAPI wvsprintf(LPSTR lpszOut, LPCSTR lpszFmt, const void FAR* lpParams);
+
+int FAR CDECL wsprintf(LPSTR lpszOut, LPCSTR lpszFmt, ...);
+
+
+/****** Driver support ******************************************************/
+
+#if (WINVER >= 0x030a)
+
+#ifndef NODRIVERS
+
+DECLARE_HANDLE(HDRVR);
+
+typedef LRESULT (CALLBACK* DRIVERPROC)(DWORD, HDRVR, UINT, LPARAM, LPARAM);
+
+/* Driver messages */
+#define DRV_LOAD 0x0001
+#define DRV_ENABLE 0x0002
+#define DRV_OPEN 0x0003
+#define DRV_CLOSE 0x0004
+#define DRV_DISABLE 0x0005
+#define DRV_FREE 0x0006
+#define DRV_CONFIGURE 0x0007
+#define DRV_QUERYCONFIGURE 0x0008
+#define DRV_INSTALL 0x0009
+#define DRV_REMOVE 0x000A
+#define DRV_EXITSESSION 0x000B
+#define DRV_EXITAPPLICATION 0x000C
+#define DRV_POWER 0x000F
+
+#define DRV_RESERVED 0x0800
+#define DRV_USER 0x4000
+
+/* LPARAM of DRV_CONFIGURE message */
+typedef struct tagDRVCONFIGINFO
+{
+ DWORD dwDCISize;
+ LPCSTR lpszDCISectionName;
+ LPCSTR lpszDCIAliasName;
+} DRVCONFIGINFO;
+typedef DRVCONFIGINFO NEAR* PDRVCONFIGINFO;
+typedef DRVCONFIGINFO FAR* LPDRVCONFIGINFO;
+
+/* Supported return values for DRV_CONFIGURE message */
+#define DRVCNF_CANCEL 0x0000
+#define DRVCNF_OK 0x0001
+#define DRVCNF_RESTART 0x0002
+
+/* Supported lParam1 of DRV_EXITAPPLICATION notification */
+#define DRVEA_NORMALEXIT 0x0001
+#define DRVEA_ABNORMALEXIT 0x0002
+
+LRESULT WINAPI DefDriverProc(DWORD dwDriverIdentifier, HDRVR driverID, UINT message, LPARAM lParam1, LPARAM lParam2);
+
+HDRVR WINAPI OpenDriver(LPCSTR szDriverName, LPCSTR szSectionName, LPARAM lParam2);
+LRESULT WINAPI CloseDriver(HDRVR hDriver, LPARAM lParam1, LPARAM lParam2);
+
+LRESULT WINAPI SendDriverMessage(HDRVR hDriver, UINT message, LPARAM lParam1, LPARAM lParam2);
+
+HINSTANCE WINAPI GetDriverModuleHandle(HDRVR hDriver);
+
+HDRVR WINAPI GetNextDriver(HDRVR, DWORD);
+
+/* GetNextDriver flags */
+#define GND_FIRSTINSTANCEONLY 0x00000001
+
+#define GND_FORWARD 0x00000000
+#define GND_REVERSE 0x00000002
+#define GND_VALID 0x00000003 /* ;Internal */
+
+typedef struct tagDRIVERINFOSTRUCT
+{
+ UINT length;
+ HDRVR hDriver;
+ HINSTANCE hModule;
+ char szAliasName[128];
+} DRIVERINFOSTRUCT;
+typedef DRIVERINFOSTRUCT FAR* LPDRIVERINFOSTRUCT;
+
+BOOL WINAPI GetDriverInfo(HDRVR, DRIVERINFOSTRUCT FAR*);
+
+#endif /* !NODRIVERS */
+#endif /* WINVER >= 0x030a */
+#endif /* NOUSER */
+
+#ifndef NOWINDOWSX /* ;Internal */
+#ifndef RC_INVOKED /* ;Internal */
+#include "windowsx.h" /* ;Internal */
+#ifndef STRICT /* ;Internal */
+#undef SelectFont /* ;Internal */
+#endif /* STRICT */ /* ;Internal */
+#endif /* RC_INVOKED */ /* ;Internal */
+#endif /* NOWINDOWSX */ /* ;Internal */
+#ifndef RC_INVOKED
+#pragma pack() /* Revert to default packing */
+#endif /* RC_INVOKED */
+
+#ifdef __cplusplus
+} /* End of extern "C" { */
+#endif /* __cplusplus */
+
+#endif /* _INC_WINDOWS */
+
+// WOW Section //
+
+int FAR PASCAL WowGetNextVdmCommand(LPVOID);
+int FAR PASCAL WOWRegisterShellWindowHandle(HWND,LPVOID, HWND);
+int FAR PASCAL WowFailedExec(void);
+void FAR PASCAL ExitKernelThunk(WORD wExitCode);
+WORD FAR PASCAL WowSetExitOnLastApp(WORD fExitOnLastApp);
+
+// Pickup WOW Generic Thunk Interfaces from wownt16,h //
+
+#include "\nt\public\sdk\inc\wownt16.h"
+
+// this is a bogus prototype. CallProc32W is a screwed up vararg function
+// however rasapi16.c uses it.
+
+DWORD FAR PASCAL CallProc32W(LPVOID, DWORD, DWORD);
diff --git a/private/mvdm/wow16/inc/windows.inc b/private/mvdm/wow16/inc/windows.inc
new file mode 100644
index 000000000..44d9c0c99
--- /dev/null
+++ b/private/mvdm/wow16/inc/windows.inc
@@ -0,0 +1,2418 @@
+;*************************************************************************
+;
+; WINDOWS.INC - Windows assembly language structures & constants
+;
+;*************************************************************************
+;
+; Conditional Block includes: (True states)
+; NOTEXT - don't include TextMetric struc & text drawing modes & stock objs.
+; NORASTOPS - don't include binary and ternary raster ops.
+; NOVK - don't include virtual key definitions
+; NOMB - don't include message box definitions
+; NOWM - don't include window messages
+;
+;
+FALSE = 0
+TRUE = 1
+NULL = 0
+
+;*******************************************************************
+;
+; Rectangle
+;
+;*******************************************************************
+
+RECT struc
+ rcLeft dw ?
+ rcTop dw ?
+ rcRight dw ?
+ rcBottom dw ?
+RECT ends
+
+;*******************************************************************
+;
+; Window Class structure
+;
+;*******************************************************************
+
+WNDCLASS struc
+ clsStyle dw ? ; class style
+ clsLpfnWndProc dd ?
+ clsCbClsExtra dw ?
+ clsCbWndExtra dw ?
+ clsHInstance dw ? ; instance handle
+ clsHIcon dw ? ; class icon handle
+ clsHCursor dw ? ; class cursor handle
+ clsHbrBackground dw ? ; class background brush
+ clsLpszMenuName dd ? ; menu name
+ clsLpszClassName dd ? ; far ptr to class name
+WNDCLASS ends
+
+IFNDEF NOTEXT
+TEXTMETRIC struc
+ tmHeight dw ?
+ tmAscent dw ?
+ tmDescent dw ?
+ tmIntLeading dw ?
+ tmExtLeading dw ?
+ tmAveCharWidth dw ?
+ tmMaxCharWidth dw ?
+ tmWeight dw ?
+ tmItalic db ?
+ tmUnderlined db ?
+ tmStruckOut db ?
+ tmFirstChar db ?
+ tmLastChar db ?
+ tmDefaultChar db ?
+ tmBreakChar db ?
+ tmPitch db ?
+ tmCharSet db ?
+ tmOverhang dw ?
+ tmAspectX dw ?
+ tmAspectY dw ?
+TEXTMETRIC ends
+
+LF_FACESIZE EQU 32
+
+LOGFONT struc
+ lfHeight dw ?
+ lfWidth dw ?
+ lfEscapement dw ?
+ lfOrientation dw ?
+ lfWeight dw ?
+ lfItalic db ?
+ lfUnderline db ?
+ lfStrikeOut db ?
+ lfCharSet db ?
+ lfOutPrecision db ?
+ lfClipPrecision db ?
+ lfQuality db ?
+ lfPitchAndFamily db ?
+ lfFaceName db LF_FACESIZE dup(?)
+LOGFONT ends
+
+LOGBRUSH struc
+ lbStyle dw ?
+ lbColor dd ?
+ lbHatch dw ?
+LOGBRUSH ends
+
+;
+; Text Drawing modes
+;
+TRANSPARENT = 1
+OPAQUE = 2
+;
+; Mapping Modes
+;
+MM_TEXT = 1
+MM_LOMETRIC = 2
+MM_HIMETRIC = 3
+MM_LOENGLISH = 4
+MM_HIENGLISH = 5
+MM_TWIPS = 6
+MM_ISOTROPIC = 7
+MM_ANISOTROPIC = 8
+;
+; Coordinate Modes
+;
+ABSOLUTE = 1
+RELATIVE = 2
+;
+; Stock Logical Objects
+;
+WHITE_BRUSH = 0
+LTGRAY_BRUSH = 1
+GRAY_BRUSH = 2
+DKGRAY_BRUSH = 3
+BLACK_BRUSH = 4
+NULL_BRUSH = 5
+HOLLOW_BRUSH = 5
+WHITE_PEN = 6
+BLACK_PEN = 7
+NULL_PEN = 8
+DOT_MARKER = 9
+OEM_FIXED_FONT = 10
+ANSI_FIXED_FONT = 11
+ANSI_VAR_FONT = 12
+SYSTEM_FONT = 13
+DEVICE_DEFAULT_FONT = 14
+DEFAULT_PALETTE = 15
+SYSTEM_FIXED_FONT = 16
+ENDIF
+;
+; Brush Styles
+;
+BS_SOLID = 0
+BS_NULL = 1
+BS_HOLLOW = BS_NULL
+BS_HATCHED = 2
+BS_PATTERN = 3
+BS_INDEXED = 4
+BS_DIBPATTERN = 5
+;
+; Hatch Styles
+;
+HS_HORIZONTAL = 0 ; -----
+HS_VERTICAL = 1 ; |||||
+HS_FDIAGONAL = 2 ; \\\\\
+HS_BDIAGONAL = 3 ; /////
+HS_CROSS = 4 ; +++++
+HS_DIAGCROSS = 5 ; xxxxx
+;
+; Pen Styles
+;
+PS_SOLID = 0
+PS_DASH = 1 ; -------
+PS_DOT = 2 ; .......
+PS_DASHDOT = 3 ; _._._._
+PS_DASHDOTDOT = 4 ; _.._.._
+PS_NULL = 5
+PS_INSIDEFRAME = 6
+;
+; Device Parameters for GetDeviceCaps()
+;
+DRIVERVERSION =0 ; Device driver version
+TECHNOLOGY =2 ; Device classification
+HORZSIZE =4 ; Horizontal size in millimeters
+VERTSIZE =6 ; Vertical size in millimeters
+HORZRES =8 ; Horizontal width in pixels
+VERTRES =10 ; Vertical width in pixels
+BITSPIXEL =12 ; Number of bits per pixel
+PLANES =14 ; Number of planes
+NUMBRUSHES =16 ; Number of brushes the device has
+NUMPENS =18 ; Number of pens the device has
+NUMMARKERS =20 ; Number of markers the device has
+NUMFONTS =22 ; Number of fonts the device has
+NUMCOLORS =24 ; Number of colors the device supports
+PDEVICESIZE =26 ; Size required for device descriptor
+CURVECAPS =28 ; Curve capabilities
+LINECAPS =30 ; Line capabilities
+POLYGONALCAPS =32 ; Polygonal capabilities
+TEXTCAPS =34 ; Text capabilities
+CLIPCAPS =36 ; Clipping capabilities
+RASTERCAPS =38 ; Bitblt capabilities
+ASPECTX =40 ; Length of the X leg
+ASPECTY =42 ; Length of the Y leg
+ASPECTXY =44 ; Length of the hypotenuse
+
+LOGPIXELSX =88 ; Logical pixels/inch in X
+LOGPIXELSY =90 ; Logical pixels/inch in Y
+
+SIZEPALETTE =104 ; Number of entries in physical palette
+NUMRESERVED =106 ; Number of reserved entries in palette
+COLORRES =108 ; Actual color resolution
+;
+ifndef NOGDICAPMASKS
+;
+; Device Capability Masks:
+;
+; Device Technologies
+DT_PLOTTER = 0 ; /* Vector plotter */
+DT_RASDISPLAY = 1 ; /* Raster display */
+DT_RASPRINTER = 2 ; /* Raster printer */
+DT_RASCAMERA = 3 ; /* Raster camera */
+DT_CHARSTREAM = 4 ; /* Character-stream, PLP */
+DT_METAFILE = 5 ; /* Metafile, VDM */
+DT_DISPFILE = 6 ; /* Display-file */
+;
+; Curve Capabilities
+CC_NONE = 0 ; /* Curves not supported */
+CC_CIRCLES = 1 ; /* Can do circles */
+CC_PIE = 2 ; /* Can do pie wedges */
+CC_CHORD = 4 ; /* Can do chord arcs */
+CC_ELLIPSES = 8 ; /* Can do ellipese */
+CC_WIDE = 16 ; /* Can do wide lines */
+CC_STYLED = 32 ; /* Can do styled lines */
+CC_WIDESTYLED = 64 ; /* Can do wide styled lines */
+CC_INTERIORS = 128; /* Can do interiors */
+;
+; Line Capabilities
+LC_NONE = 0 ; /* Lines not supported */
+LC_POLYLINE = 2 ; /* Can do polylines */
+LC_MARKER = 4 ; /* Can do markers */
+LC_POLYMARKER = 8 ; /* Can do polymarkers */
+LC_WIDE = 16 ; /* Can do wide lines */
+LC_STYLED = 32 ; /* Can do styled lines */
+LC_WIDESTYLED = 64 ; /* Can do wide styled lines */
+LC_INTERIORS = 128; /* Can do interiors */
+;
+; Polygonal Capabilities
+PC_NONE = 0 ; /* Polygonals not supported */
+PC_POLYGON = 1 ; /* Can do polygons */
+PC_RECTANGLE = 2 ; /* Can do rectangles */
+PC_WINDPOLYGON = 4 ; /* Can do winding polygons */
+PC_TRAPEZOID = 4 ; /* Can do trapezoids */
+PC_SCANLINE = 8 ; /* Can do scanlines */
+PC_WIDE = 16 ; /* Can do wide borders */
+PC_STYLED = 32 ; /* Can do styled borders */
+PC_WIDESTYLED = 64 ; /* Can do wide styled borders */
+PC_INTERIORS = 128; /* Can do interiors */
+;
+; Polygonal Capabilities */
+CP_NONE = 0 ; /* No clipping of output */
+CP_RECTANGLE = 1 ; /* Output clipped to rects */
+;
+; Text Capabilities
+TC_OP_CHARACTER = 0001h ; /* Can do OutputPrecision CHARACTER */
+TC_OP_STROKE = 0002h ; /* Can do OutputPrecision STROKE */
+TC_CP_STROKE = 0004h ; /* Can do ClipPrecision STROKE */
+TC_CR_90 = 0008h ; /* Can do CharRotAbility 90 */
+TC_CR_ANY = 0010h ; /* Can do CharRotAbility ANY */
+TC_SF_X_YINDEP = 0020h ; /* Can do ScaleFreedom X_YINDEPENDENT */
+TC_SA_DOUBLE = 0040h ; /* Can do ScaleAbility DOUBLE */
+TC_SA_INTEGER = 0080h ; /* Can do ScaleAbility INTEGER */
+TC_SA_CONTIN = 0100h ; /* Can do ScaleAbility CONTINUOUS */
+TC_EA_DOUBLE = 0200h ; /* Can do EmboldenAbility DOUBLE */
+TC_IA_ABLE = 0400h ; /* Can do ItalisizeAbility ABLE */
+TC_UA_ABLE = 0800h ; /* Can do UnderlineAbility ABLE */
+TC_SO_ABLE = 1000h ; /* Can do StrikeOutAbility ABLE */
+TC_RA_ABLE = 2000h ; /* Can do RasterFontAble ABLE */
+TC_VA_ABLE = 4000h ; /* Can do VectorFontAble ABLE */
+TC_RESERVED = 8000h
+;
+; Raster Capabilities
+RC_BITBLT = 1 ; /* Can do standard BLT. */
+RC_BANDING = 2 ; /* Device requires banding support */
+RC_SCALING = 4 ; /* Device requires scaling support */
+RC_BITMAP64 = 8 ; /* Device can support >64K bitmap */
+RC_GDI20_OUTPUT = 0010h ; /* has 2.0 output calls */
+RC_DI_BITMAP = 0080h ; /* supports DIB to memory */
+RC_PALETTE = 0100h ; /* supports a palette */
+RC_DIBTODEV = 0200h ; /* supports DIBitsToDevice */
+RC_BIGFONT = 0400h ; /* supports >64K fonts */
+RC_STRETCHBLT = 0800h ; /* supports StretchBlt */
+RC_FLOODFILL = 1000h ; /* supports FloodFill */
+RC_STRETCHDIB = 2000h ; /* supports StretchDIBits */
+
+endif ;NOGDICAPMASKS
+
+; palette entry flags
+;
+PC_RESERVED = 1 ;/* palette index used for animation */
+PC_EXPLICIT = 2 ;/* palette index is explicit to device */
+PC_NOCOLLAPSE = 4 ;/* do not match color to system palette */
+
+; DIB color table identifiers
+;
+DIB_RGB_COLORS = 0 ;/* color table in RGBTriples */
+DIB_PAL_COLORS = 1 ;/* color table in palette indices */
+;
+
+;constants for Get/SetSystemPaletteUse()
+;
+SYSPAL_STATIC = 1
+SYSPAL_NOSTATIC = 2
+
+; constants for CreateDIBitmap
+CBM_INIT = 4 ;/* initialize bitmap */
+;
+; Bitmap format constants
+BI_RGB = 0
+BI_RLE8 = 1
+BI_RLE4 = 2
+;
+;
+ANSI_CHARSET = 0
+SYMBOL_CHARSET = 2
+OEM_CHARSET = 255
+;
+; styles for CombineRgn
+;
+RGN_AND = 1
+RGN_OR = 2
+RGN_XOR = 3
+RGN_DIFF = 4
+RGN_COPY = 5
+;
+; Predefined cursor & icon IDs
+;
+IDC_ARROW = 32512
+IDC_IBEAM = 32513
+IDC_WAIT = 32514
+IDC_CROSS = 32515
+IDC_UPARROW = 32516
+IDC_SIZE = 32640
+IDC_ICON = 32641
+IDC_SIZENWSE = 32642
+IDC_SIZENESW = 32643
+IDC_SIZEWE = 32644
+IDC_SIZENS = 32645
+
+IDI_APPLICATION = 32512
+IDI_HAND = 32513
+IDI_QUESTION = 32514
+IDI_EXCLAMATION = 32515
+IDI_ASTERISK = 32516
+
+;
+; OEM Resource Ordinal Numbers */
+;
+OBM_CLOSE = 32754
+OBM_UPARROW = 32753
+OBM_DNARROW = 32752
+OBM_RGARROW = 32751
+OBM_LFARROW = 32750
+OBM_REDUCE = 32749
+OBM_ZOOM = 32748
+OBM_RESTORE = 32747
+OBM_REDUCED = 32746
+OBM_ZOOMD = 32745
+OBM_RESTORED = 32744
+OBM_UPARROWD = 32743
+OBM_DNARROWD = 32742
+OBM_RGARROWD = 32741
+OBM_LFARROWD = 32740
+OBM_MNARROW = 32739
+OBM_COMBO = 32738
+OBM_UPARROWI = 32737
+OBM_DNARROWI = 32736
+OBM_RGARROWI = 32735
+OBM_LFARROWI = 32734
+
+OBM_OLD_CLOSE = 32767
+OBM_SIZE = 32766
+OBM_OLD_UPARROW = 32765
+OBM_OLD_DNARROW = 32764
+OBM_OLD_RGARROW = 32763
+OBM_OLD_LFARROW = 32762
+OBM_BTSIZE = 32761
+OBM_CHECK = 32760
+OBM_CHECKBOXES = 32759
+OBM_BTNCORNERS = 32758
+OBM_OLD_REDUCE = 32757
+OBM_OLD_ZOOM = 32756
+OBM_OLD_RESTORE = 32755
+
+OCR_NORMAL = 32512
+OCR_IBEAM = 32513
+OCR_WAIT = 32514
+OCR_CROSS = 32515
+OCR_UP = 32516
+OCR_SIZE = 32640
+OCR_ICON = 32641
+OCR_SIZENWSE = 32642
+OCR_SIZENESW = 32643
+OCR_SIZEWE = 32644
+OCR_SIZENS = 32645
+OCR_SIZEALL = 32646
+OCR_ICOCUR = 32647
+
+OIC_SAMPLE = 32512
+OIC_HAND = 32513
+OIC_QUES = 32514
+OIC_BANG = 32515
+OIC_NOTE = 32516
+
+;
+; Scroll bar constants
+;
+SB_HORZ = 0
+SB_VERT = 1
+SB_CTL = 2
+SB_BOTH = 3
+;
+; Scroll Commands
+;
+SB_LINEUP = 0
+SB_LINEDOWN = 1
+SB_PAGEUP = 2
+SB_PAGEDOWN = 3
+SB_THUMBPOSITION = 4
+SB_THUMBTRACK = 5
+SB_TOP = 6
+SB_BOTTOM = 7
+SB_ENDSCROLL = 8
+;
+; MessageBox type flags
+;
+IFNDEF NOMB
+MB_OK = 0000H
+MB_OKCANCEL = 0001H
+MB_ABORTRETRYIGNORE = 0002H
+MB_YESNOCANCEL = 0003H
+MB_YESNO = 0004H
+MB_RETRYCANCEL = 0005H
+
+MB_ICONHAND = 0010H
+MB_ICONQUESTION = 0020H
+MB_ICONEXCLAMATION = 0030H
+MB_ICONASTERISK = 0040H
+
+MB_DEFBUTTON1 = 0000H
+MB_DEFBUTTON2 = 0100H
+MB_DEFBUTTON3 = 0200H
+
+MB_APPLMODAL = 0000H
+MB_SYSTEMMODAL = 1000H
+MB_TASKMODAL = 2000H
+
+MB_NOFOCUS = 8000H
+
+;
+; Conventional dialog box and message box command IDs
+;
+IDOK = 1
+IDCANCEL = 2
+IDABORT = 3
+IDRETRY = 4
+IDIGNORE = 5
+IDYES = 6
+IDNO = 7
+;
+; Flags for OpenFile
+;
+OF_READ = 0000H
+OF_WRITE = 0001H
+OF_READWRITE = 0002H
+OF_SHARE_COMPAT = 0000H
+OF_SHARE_EXCLUSIVE = 0010H
+OF_SHARE_DENY_WRITE = 0020H
+OF_SHARE_DENY_READ = 0030H
+OF_SHARE_DENY_NONE = 0040H
+OF_PARSE = 0100H
+OF_DELETE = 0200H
+OF_VERIFY = 0400H ; Used with OF_REOPEN
+OF_SEARCH = 0400H ; Used without OF_REOPEN
+OF_CANCEL = 0800H
+OF_CREATE = 1000H
+OF_PROMPT = 2000H
+OF_EXIST = 4000H
+OF_REOPEN = 8000H
+
+TF_FORCEDRIVE = 80H
+
+OPENSTRUC STRUC
+opLen db ?
+opDisk db ?
+opXtra dw ?
+opDate dw ?
+opTime dw ?
+opFile db 120 dup (?)
+OPENSTRUC ENDS
+;
+; DrawText format flags
+;
+DT_LEFT = 00H
+DT_CENTER = 01H
+DT_RIGHT = 02H
+DT_TOP = 00H
+DT_VCENTER = 04H
+DT_BOTTOM = 08H
+DT_WORDBREAK = 10H
+DT_SINGLELINE = 20H
+DT_EXPANDTABS = 40H
+DT_TABSTOP = 80H
+DT_NOCLIP = 0100H
+DT_EXTERNALLEADING = 0200H
+DT_CALCRECT = 0400H
+DT_NOPREFIX = 0800H
+DT_INTERNAL = 1000H
+ENDIF
+
+;
+; ExtFloodFill style flags
+;
+FLOODFILLBORDER = 0
+FLOODFILLSURFACE = 1
+
+;
+; Memory manager flags
+;
+LMEM_FIXED = 0000h
+LMEM_MOVEABLE = 0002h
+LMEM_NOCOMPACT = 0010H
+LMEM_NODISCARD = 0020H
+LMEM_ZEROINIT = 0040h
+LMEM_MODIFY = 0080H
+LMEM_DISCARDABLE= 0F00h
+LHND = LMEM_MOVEABLE+LMEM_ZEROINIT
+LPTR = LMEM_FIXED+LMEM_ZEROINIT
+; Flags returned by LocalFlags (in addition to LMEM_DISCARDABLE)
+LMEM_DISCARDED = 4000H
+LMEM_LOCKCOUNT = 00FFH
+
+NONZEROLHND = LMEM_MOVEABLE
+NONZEROLPTR = LMEM_FIXED
+
+LNOTIFY_OUTOFMEM = 0 ;Internal
+LNOTIFY_MOVE = 1 ;Internal
+LNOTIFY_DISCARD = 2 ;Internal
+
+
+GMEM_FIXED = 0000h
+GMEM_MOVEABLE = 0002h
+GMEM_NOCOMPACT = 0010h
+GMEM_NODISCARD = 0020h
+GMEM_ZEROINIT = 0040h
+GMEM_MODIFY = 0080h
+GMEM_DISCARDABLE= 0100h
+GMEM_NOT_BANKED = 1000h
+GMEM_DDESHARE = 2000h
+GMEM_SHARE = 2000h
+GMEM_NOTIFY = 4000h
+GMEM_LOWER = GMEM_NOT_BANKED
+GHND = GMEM_MOVEABLE+GMEM_ZEROINIT
+GPTR = GMEM_FIXED+GMEM_ZEROINIT
+
+; Flags returned by GlobalFlags (in addition to GMEM_DISCARDABLE)
+GMEM_DISCARDED = 4000h
+GMEM_LOCKCOUNT = 00FFh
+
+; Flags returned by GetWinFlags
+
+WF_PMODE = 0001h
+WF_CPU286 = 0002h
+WF_CPU386 = 0004h
+WF_CPU486 = 0008h
+WF_STANDARD = 0010h
+WF_WIN286 = 0010h
+WF_ENHANCED = 0020h
+WF_WIN386 = 0020h
+WF_CPU086 = 0040h
+WF_CPU186 = 0080h
+WF_LARGEFRAME = 0100h
+WF_SMALLFRAME = 0200h
+WF_80x87 = 0400h
+WF_PAGING = 0800h
+WF_WLO = 8000h
+
+; WEP fSystemExit flag values
+WEP_SYSTEM_EXIT = 1
+WEP_FREE_DLL = 0
+
+; GetAppCompatFlags flag values ;Internal
+GACF_IGNORENODISCARD = 0001h ;Internal
+GACF_FORCETEXTBAND = 0002h ;Internal
+GACF_ONELANDGRXBAND = 0004h ;Internal
+GACF_IGNORETOPMOST = 0008h ;Internal
+GACF_CALLTTDEVICE = 0010h ;Internal
+GACF_MULTIPLEBANDS = 0020h ;Internal
+GACF_ALWAYSSENDNCPAINT = 0040h ;Internal
+GACF_EDITSETTEXTMUNGE = 0080h ;Internal
+GACF_MOREEXTRAWNDWORDS = 0100h ;Internal
+GACF_TTIGNORERASTERDUPE = 0200h ;Internal
+GACF_HACKWINFLAGS = 0400h ;Internal
+GACF_DELAYHWHNDSHAKECHK = 0800h ;Internal
+
+; Virtual Keys, Standard Set
+
+IFNDEF NOVK
+VK_LBUTTON = 01H
+VK_RBUTTON = 02H
+VK_CANCEL = 03H
+VK_BACK = 08H
+VK_TAB = 09H
+VK_CLEAR = 0cH
+VK_RETURN = 0dH
+VK_SHIFT = 10H
+VK_CONTROL = 11H
+VK_MENU = 12H
+VK_PAUSE = 13H
+VK_CAPITAL = 14H
+VK_ESCAPE = 1bH
+VK_SPACE = 20H
+
+VK_PRIOR = 21H
+VK_NEXT = 22H
+VK_END = 23H
+VK_HOME = 24H
+VK_LEFT = 25H
+VK_UP = 26H
+VK_RIGHT = 27H
+VK_DOWN = 28H
+
+; VK_A thru VK_Z are the same as their ASCII equivalents: 'A' thru 'Z'
+; VK_0 thru VK_9 are the same as their ASCII equivalents: '0' thru '0'
+
+VK_PRINT = 2aH
+VK_EXECUTE = 2bH
+VK_SNAPSHOT = 2ch ; Printscreen key..
+VK_INSERT = 2dH
+VK_DELETE = 2eH
+VK_HELP = 2fH
+
+VK_NUMPAD0 = 60H
+VK_NUMPAD1 = 61H
+VK_NUMPAD2 = 62H
+VK_NUMPAD3 = 63H
+VK_NUMPAD4 = 64H
+VK_NUMPAD5 = 65H
+VK_NUMPAD6 = 66H
+VK_NUMPAD7 = 67H
+VK_NUMPAD8 = 68H
+VK_NUMPAD9 = 69H
+VK_MULTIPLY = 6AH
+VK_ADD = 6BH
+VK_SEPARATER = 6CH
+VK_SUBTRACT = 6DH
+VK_DECIMAL = 6EH
+VK_DIVIDE = 6FH
+
+VK_F1 = 70H
+VK_F2 = 71H
+VK_F3 = 72H
+VK_F4 = 73H
+VK_F5 = 74H
+VK_F6 = 75H
+VK_F7 = 76H
+VK_F8 = 77H
+VK_F9 = 78H
+VK_F10 = 79H
+VK_F11 = 7aH
+VK_F12 = 7bH
+VK_F13 = 7cH
+VK_F14 = 7dH
+VK_F15 = 7eH
+VK_F16 = 7fH
+VK_F17 = 80H
+VK_F18 = 81H
+VK_F19 = 82H
+VK_F20 = 83H
+VK_F21 = 84H
+VK_F22 = 85H
+VK_F23 = 86H
+VK_F24 = 87H
+
+VK_NUMLOCK = 90H
+VK_SCROLL = 91H
+ENDIF
+
+IFNDEF NOWH
+
+; SetWindowsHook() codes
+WH_NULLNODE = (-100) ;Internal
+WH_MSGFILTER = (-1)
+WH_JOURNALRECORD = 0
+WH_JOURNALPLAYBACK = 1
+WH_KEYBOARD = 2
+WH_GETMESSAGE = 3
+WH_CALLWNDPROC = 4
+IFNDEF NOWIN31
+WH_CBT = 5
+WH_SYSMSGFILTER = 6
+WH_MOUSE = 7
+WH_HARDWARE = 8
+WH_DEBUG = 9
+ENDIF
+;
+; Hook Codes
+HC_GETLPLPFN = (-3)
+HC_LPLPFNNEXT = (-2)
+HC_LPFNNEXT = (-1)
+HC_ACTION = 0
+HC_GETNEXT = 1
+HC_SKIP = 2
+HC_NOREM = 3
+HC_NOREMOVE = 3
+HC_SYSMODALON = 4
+HC_SYSMODALOFF = 5
+;
+; CBT Hook Codes
+HCBT_MOVESIZE = 0
+HCBT_MINMAX = 1
+HCBT_QS = 2
+HCBT_CREATEWND = 3
+HCBT_DESTROYWND = 4
+HCBT_ACTIVATE = 5
+HCBT_CLICKSKIPPED = 6
+HCBT_KEYSKIPPED = 7
+HCBT_SYSCOMMAND = 8
+HCBT_SETFOCUS = 9
+
+;
+; WH_MSGFILTER Filter Proc Codes
+MSGF_DIALOGBOX = 0
+MSGF_MESSAGEBOX = 1 ;Internal
+MSGF_MENU = 2
+MSGF_MOVE = 3
+MSGF_SIZE = 4
+MSGF_SCROLLBAR = 5
+MSGF_NEXTWINDOW = 6
+;
+; Window Manager Hook Codes
+WC_INIT = 1
+WC_SWP = 2
+WC_DEFWINDOWPROC = 3
+WC_MINMAX = 4
+WC_MOVE = 5
+WC_SIZE = 6
+WC_DRAWCAPTION = 7
+;
+
+; Message Structure used in Journaling
+EVENTMSG struc
+ message dw ?
+ paramL dw ?
+ paramH dw ?
+ time dd ?
+EVENTMSG ends
+
+ENDIF ;NOWH
+
+; Window field offsets for GetWindowLong() and GetWindowWord()
+GWL_WNDPROC = (-4)
+GWW_HINSTANCE = (-6)
+GWW_HWNDPARENT = (-8)
+GWW_ID = (-12)
+GWL_STYLE = (-16)
+GWL_EXSTYLE = (-20)
+
+; GetWindow() Constants
+GW_HWNDFIRST = 0
+GW_HWNDLAST = 1
+GW_HWNDNEXT = 2
+GW_HWNDPREV = 3
+GW_OWNER = 4
+GW_CHILD = 5
+
+; Class field offsets for GetClassLong() and GetClassWord()
+GCL_MENUNAME = (-8)
+GCW_HBRBACKGROUND = (-10)
+GCW_HCURSOR = (-12)
+GCW_HICON = (-14)
+GCW_HMODULE = (-16)
+GCW_CBWNDEXTRA = (-18)
+GCW_CBCLSEXTRA = (-20)
+GCL_WNDPROC = (-24)
+GCW_STYLE = (-26)
+
+; WinWhere() Area Codes
+HTERROR = (-2)
+HTTRANSPARENT = (-1)
+HTNOWHERE = 0
+HTCLIENT = 1
+HTCAPTION = 2
+HTSYSMENU = 3
+HTGROWBOX = 4
+HTSIZE = HTGROWBOX
+HTMENU = 5
+HTHSCROLL = 6
+HTVSCROLL = 7
+HTREDUCE = 8
+HTZOOM = 9
+HTLEFT = 10
+HTRIGHT = 11
+HTTOP = 12
+HTTOPLEFT = 13
+HTTOPRIGHT = 14
+HTBOTTOM = 15
+HTBOTTOMLEFT = 16
+HTBOTTOMRIGHT = 17
+HTSIZEFIRST = HTLEFT
+HTSIZELAST = HTBOTTOMRIGHT
+
+
+
+;*************************************************************************
+;
+; Misc structures & constants
+;
+;*************************************************************************
+
+IFNDEF NOMST
+POINT struc
+ ptX dw ?
+ ptY dw ?
+POINT ends
+
+LOGPEN struc
+ lopnStyle dw ?
+ lopnWidth db (SIZE POINT) DUP(?)
+ lopnColor dd ?
+LOGPEN ends
+
+
+BITMAP STRUC
+ bmType DW ?
+ bmWidth DW ?
+ bmHeight DW ?
+ bmWidthBytes DW ?
+ bmPlanes DB ?
+ bmBitsPixel DB ?
+ bmBits DD ?
+BITMAP ENDS
+
+RGBTRIPLE struc
+ rgbBlue db ?
+ rgbGreen db ?
+ rgbRed db ?
+RGBTRIPLE ends
+
+RGBQUAD struc
+ rgbqBlue db ?
+ rgbqGreen db ?
+ rgbqRed db ?
+ rgbqReserved db ?
+RGBQUAD ends
+
+; structures for defining DIBs
+BITMAPCOREHEADER struc
+ bcSize dd ?
+ bcWidth dw ?
+ bcHeight dw ?
+ bcPlanes dw ?
+ bcBitCount dw ?
+BITMAPCOREHEADER ends
+
+BITMAPINFOHEADER struc
+ biSize dd ?
+ biWidth dd ?
+ biHeight dd ?
+ biPlanes dw ?
+ biBitCount dw ?
+
+ biCompression dd ?
+ biSizeImage dd ?
+ biXPelsPerMeter dd ?
+ biYPelsPerMeter dd ?
+ biClrUsed dd ?
+ biClrImportant dd ?
+BITMAPINFOHEADER ends
+
+BITMAPINFO struc
+ bmiHeader db (SIZE BITMAPINFOHEADER) DUP (?)
+ bmiColors db ? ; array of RGBQUADs
+BITMAPINFO ends
+
+BITMAPCOREINFO struc
+ bmciHeader db (SIZE BITMAPCOREHEADER) DUP (?)
+ bmciColors db ? ; array of RGBTRIPLEs
+BITMAPCOREINFO ends
+
+BITMAPFILEHEADER struc
+ bfType dw ?
+ bfSize dd ?
+ bfReserved1 dw ?
+ bfReserved2 dw ?
+ bfOffBits dd ?
+BITMAPFILEHEADER ends
+
+
+WNDSTRUC struc
+ WSwndStyle dd ?
+ WSwndID dw ?
+ WSwndText dw ?
+ WSwndParent dw ?
+ WSwndInstance dw ?
+ WSwndClassProc dd ?
+WNDSTRUC ends
+;
+; Message structure
+;
+MSGSTRUCT struc
+msHWND dw ?
+msMESSAGE dw ?
+msWPARAM dw ?
+msLPARAM dd ?
+msTIME dd ?
+msPT dd ?
+MSGSTRUCT ends
+
+NEWPARMS struc
+ nprmHwnd dw ?
+ nprmCmd db ?
+NEWPARMS ends
+ENDIF
+
+PAINTSTRUCT STRUC
+ PShdc DW ?
+ PSfErase DW ?
+ PSrcPaint DB size RECT dup(?)
+ PSfRestore DW ?
+ PSfIncUpdate DW ?
+ PSrgbReserved DB 16 dup(?)
+PAINTSTRUCT ENDS
+
+
+CREATESTRUCT struc
+ cs_lpCreateParams dd ?
+ cs_hInstance dw ?
+ cs_hMenu dw ?
+ cs_hwndParent dw ?
+ cs_cy dw ?
+ cs_cx dw ?
+ cs_y dw ?
+ cs_x dw ?
+ cs_style dd ?
+ cs_lpszName dd ?
+ cs_lpszClass dd ?
+ cs_dwExStyle dd ?
+CREATESTRUCT ends
+;
+; PostError constants
+;
+WARNING = 0 ; command codes
+MINOR_ERROR = 1
+FATAL_ERROR = 2
+
+IGNORE = 0 ; response codes
+RETRY = 1
+ABORT = 2
+;
+; GDI-related constants & commands
+;
+ERRORREGION = 0
+NULLREGION = 1
+SIMPLEREGION = 2
+COMPLEXREGION = 3
+
+IFNDEF NORASTOPS
+;
+; Binary raster ops
+;
+R2_BLACK = 1
+R2_NOTMERGEPEN = 2
+R2_MASKNOTPEN = 3
+R2_NOTCOPYPEN = 4
+R2_MASKPENNOT = 5
+R2_NOT = 6
+R2_XORPEN = 7
+R2_NOTMASKPEN = 8
+R2_MASKPEN = 9
+R2_NOTXORPEN = 10
+R2_NOP = 11
+R2_MERGENOTPEN = 12
+R2_COPYPEN = 13
+R2_MERGEPENNOT = 14
+R2_MERGEPEN = 15
+R2_WHITE = 16
+;
+; Ternary raster ops
+;
+SRCCOPY_L = 0020h ;dest=source
+SRCCOPY_H = 00CCh
+SRCPAINT_L = 0086h ;dest=source OR dest
+SRCPAINT_H = 00EEh
+SRCAND_L = 00C6h ;dest=source AND dest
+SRCAND_H = 0088h
+SRCINVERT_L = 0046h ;dest= source XOR dest
+SRCINVERT_H = 0066h
+SRCERASE_L = 0328h ;dest= source AND (not dest )
+SRCERASE_H = 0044h
+NOTSRCCOPY_L = 0008h ;dest= (not source)
+NOTSRCCOPY_H = 0033h
+NOTSRCERASE_L = 00A6h ;dest= (not source) AND (not dest)
+NOTSRCERASE_H = 0011h
+MERGECOPY_L = 00CAh ;dest= (source AND pattern)
+MERGECOPY_H = 00C0h
+MERGEPAINT_L = 0226h ;dest= (source AND pattern) OR dest
+MERGEPAINT_H = 00BBh
+PATCOPY_L = 0021h ;dest= pattern
+PATCOPY_H = 00F0h
+PATPAINT_L = 0A09h ;DPSnoo
+PATPAINT_H = 00FBh
+PATINVERT_L = 0049h ;dest= pattern XOR dest
+PATINVERT_H = 005Ah
+DSTINVERT_L = 0009h ;dest= (not dest)
+DSTINVERT_H = 0055h
+BLACKNESS_L = 0042h ;dest= BLACK
+BLACKNESS_H = 0000h
+WHITENESS_L = 0062h ;dest= WHITE
+WHITENESS_H = 00FFh
+;
+; StretchBlt modes
+;
+BLACKONWHITE = 1
+WHITEONBLACK = 2
+COLORONCOLOR = 3
+;
+; New StretchBlt modes
+;
+STRETCH_ANDSCANS = 1
+STRETCH_ORSCANS = 2
+STRETCH_DELETESCANS = 3
+;
+; PolyFill modes
+;
+ALTERNATE = 1
+WINDING = 2
+ENDIF
+;
+; Text Alignment Options
+;
+TA_NOUPDATECP = 0
+TA_UPDATECP = 1
+
+TA_LEFT = 0
+TA_RIGHT = 2
+TA_CENTER = 6
+
+TA_TOP = 0
+TA_BOTTOM = 8
+TA_BASELINE = 24
+
+ETO_GRAYED = 1
+ETO_OPAQUE = 2
+ETO_CLIPPED = 4
+
+ASPECT_FILTERING = 1
+
+ifndef NOMETAFILE
+
+; Metafile Functions */
+META_SETBKCOLOR = 0201h
+META_SETBKMODE = 0102h
+META_SETMAPMODE = 0103h
+META_SETROP2 = 0104h
+META_SETRELABS = 0105h
+META_SETPOLYFILLMODE = 0106h
+META_SETSTRETCHBLTMODE = 0107h
+META_SETTEXTCHAREXTRA = 0108h
+META_SETTEXTCOLOR = 0209h
+META_SETTEXTJUSTIFICATION = 020Ah
+META_SETWINDOWORG = 020Bh
+META_SETWINDOWEXT = 020Ch
+META_SETVIEWPORTORG = 020Dh
+META_SETVIEWPORTEXT = 020Eh
+META_OFFSETWINDOWORG = 020Fh
+META_SCALEWINDOWEXT = 0400h
+META_OFFSETVIEWPORTORG = 0211h
+META_SCALEVIEWPORTEXT = 0412h
+META_LINETO = 0213h
+META_MOVETO = 0214h
+META_EXCLUDECLIPRECT = 0415h
+META_INTERSECTCLIPRECT = 0416h
+META_ARC = 0817h
+META_ELLIPSE = 0418h
+META_FLOODFILL = 0419h
+META_PIE = 081Ah
+META_RECTANGLE = 041Bh
+META_ROUNDRECT = 061Ch
+META_PATBLT = 061Dh
+META_SAVEDC = 001Eh
+META_SETPIXEL = 041Fh
+META_OFFSETCLIPRGN = 0220h
+META_TEXTOUT = 0521h
+META_BITBLT = 0922h
+META_STRETCHBLT = 0B23h
+META_POLYGON = 0324h
+META_POLYLINE = 0325h
+META_ESCAPE = 0626h
+META_RESTOREDC = 0127h
+META_FILLREGION = 0228h
+META_FRAMEREGION = 0429h
+META_INVERTREGION = 012Ah
+META_PAINTREGION = 012Bh
+META_SELECTCLIPREGION = 012Ch
+META_SELECTOBJECT = 012Dh
+META_SETTEXTALIGN = 012Eh
+META_DRAWTEXT = 062Fh
+
+META_CHORD = 0830h
+META_SETMAPPERFLAGS = 0231h
+META_EXTTEXTOUT = 0a32h
+META_SETDIBTODEV = 0d33h
+META_SELECTPALETTE = 0234h
+META_REALIZEPALETTE = 0035h
+META_ANIMATEPALETTE = 0436h
+META_SETPALENTRIES = 0037h
+META_POLYPOLYGON = 0538h
+META_RESIZEPALETTE = 0139h
+
+META_DIBBITBLT = 0940h
+META_DIBSTRETCHBLT = 0b41h
+META_DIBCREATEPATTERNBRUSH = 0142h
+META_STRETCHDIB = 0f43h
+
+META_DELETEOBJECT = 01f0h
+
+META_CREATEPALETTE = 00f7h
+META_CREATEBRUSH = 00F8h
+META_CREATEPATTERNBRUSH = 01F9h
+META_CREATEPENINDIRECT = 02FAh
+META_CREATEFONTINDIRECT = 02FBh
+META_CREATEBRUSHINDIRECT = 02FCh
+META_CREATEBITMAPINDIRECT = 02FDh
+META_CREATEBITMAP = 06FEh
+META_CREATEREGION = 06FFh
+
+; /* Clipboard Metafile Picture Structure */
+HANDLETABLE struc
+ ht_objectHandle dw ?
+HANDLETABLE ends
+
+METARECORD struc
+ mr_rdSize dd ?
+ mr_rdFunction dw ?
+ mr_rdParm dw ?
+METARECORD ends
+
+METAFILEPICT struc
+ mfp_mm dw ?
+ mfp_xExt dw ?
+ mfp_yExt dw ?
+ mfp_hMF dw ?
+METAFILEPICT ends
+
+METAHEADER struc
+ mtType dw ?
+ mtHeaderSize dw ?
+ mtVersion dw ?
+ mtSize dd ?
+ mtNoObjects dw ?
+ mtMaxRecord dd ?
+ mtNoParameters dw ?
+METAHEADER ends
+
+endif ; NOMETAFILE
+
+; GDI Escapes
+NEWFRAME = 1
+ABORTDOC = 2
+NEXTBAND = 3
+SETCOLORTABLE = 4
+GETCOLORTABLE = 5
+FLUSHOUTPUT = 6
+DRAFTMODE = 7
+QUERYESCSUPPORT = 8
+SETABORTPROC = 9
+STARTDOC = 10
+;; This value conflicts with a std WIN386 MACRO definition
+;;ENDDOC = 11
+GETPHYSPAGESIZE = 12
+GETPRINTINGOFFSET = 13
+GETSCALINGFACTOR = 14
+MFCOMMENT = 15
+GETPENWIDTH = 16
+SETCOPYCOUNT = 17
+SELECTPAPERSOURCE = 18
+DEVICEDATA = 19
+PASSTHROUGH = 19
+GETTECHNOLGY = 20
+GETTECHNOLOGY = 20
+SETENDCAP = 21
+SETLINEJOIN = 22
+SETMITERLIMIT = 23
+BANDINFO = 24
+DRAWPATTERNRECT = 25
+GETVECTORPENSIZE = 26
+GETVECTORBRUSHSIZE = 27
+ENABLEDUPLEX = 28
+ENABLEMANUALFEED = 29
+GETSETPAPERBINS = 29
+GETSETPRINTORIENT = 30
+ENUMPAPERBINS = 31
+
+GETEXTENDEDTEXTMETRICS = 256
+GETEXTENTTABLE = 257
+GETPAIRKERNTABLE = 258
+GETTRACKKERNTABLE = 259
+
+EXTTEXTOUT = 512
+
+ENABLERELATIVEWIDTHS = 768
+ENABLEPAIRKERNING = 769
+SETKERNTRACK = 770
+SETALLJUSTVALUES = 771
+SETCHARSET = 772
+
+GETSETSCREENPARAMS = 3072
+
+STRETCHBLT = 2048
+
+
+; Spooler Error Codes
+SP_NOTREPORTED = 4000h
+SP_ERROR = (-1)
+SP_APPABORT = (-2)
+SP_USERABORT = (-3)
+SP_OUTOFDISK = (-4)
+SP_OUTOFMEMORY = (-5)
+
+PR_JOBSTATUS = 0000
+
+; Object Definitions for EnumObjects()
+OBJ_PEN = 1
+OBJ_BRUSH = 2
+
+;
+; Menu flags for Change/Check/Enable MenuItem
+;
+MF_INSERT = 0000h
+MF_CHANGE = 0080h
+MF_APPEND = 0100h
+MF_DELETE = 0200h
+MF_REMOVE = 1000h
+
+MF_BYCOMMAND = 0000h
+MF_BYPOSITION = 0400h
+
+MF_SEPARATOR = 0800h
+
+MF_ENABLED = 0000h
+MF_GRAYED = 0001h
+MF_DISABLED = 0002h
+
+MF_UNCHECKED = 0000h
+MF_CHECKED = 0008h
+MF_USECHECKBITMAPS= 0200h
+
+MF_STRING = 0000h
+MF_BITMAP = 0004h
+MF_OWNERDRAW = 0100h
+
+MF_POPUP = 0010h
+MF_MENUBARBREAK = 0020h
+MF_MENUBREAK = 0040h
+
+MF_UNHILITE = 0000h
+MF_HILITE = 0080h
+
+MF_SYSMENU = 2000h
+MF_HELP = 4000h
+MF_MOUSESELECT = 8000h
+
+
+;
+; System Menu Command Values
+;
+SC_SIZE = 0F000h
+SC_MOVE = 0F010h
+SC_MINIMIZE = 0F020h
+SC_MAXIMIZE = 0F030h
+SC_NEXTWINDOW = 0F040h
+SC_PREVWINDOW = 0F050h
+SC_CLOSE = 0F060h
+SC_VSCROLL = 0F070h
+SC_HSCROLL = 0F080h
+SC_MOUSEMENU = 0F090h
+SC_KEYMENU = 0F100h
+SC_ARRANGE = 0F110h
+SC_RESTORE = 0F120h
+SC_TASKLIST = 0F130h
+SC_SCREENSAVE = 0F140h
+SC_HOTKEY = 0F150h
+
+SC_ICON = SC_MINIMIZE
+SC_ZOOM = SC_MAXIMIZE
+
+;
+; Window State Messages
+;
+IFNDEF NOWM
+WM_STATE = 0000H
+
+WM_NULL = 0000h
+WM_CREATE = 0001h
+WM_DESTROY = 0002h
+WM_MOVE = 0003h
+WM_SIZEWAIT = 0004h ;Internal
+WM_SIZE = 0005h
+WM_ACTIVATE = 0006h
+WM_SETFOCUS = 0007h
+WM_KILLFOCUS = 0008h
+WM_SETVISIBLE = 0009h ;Internal
+WM_ENABLE = 000Ah
+WM_SETREDRAW = 000Bh
+WM_SETTEXT = 000Ch
+WM_GETTEXT = 000Dh
+WM_GETTEXTLENGTH = 000Eh
+WM_PAINT = 000Fh
+WM_CLOSE = 0010h
+WM_QUERYENDSESSION = 0011h
+WM_QUIT = 0012h
+WM_QUERYOPEN = 0013h
+WM_ERASEBKGND = 0014h
+WM_SYSCOLORCHANGE = 0015h
+WM_ENDSESSION = 0016h
+WM_SYSTEMERROR = 0017h
+WM_SHOWWINDOW = 0018h
+WM_CTLCOLOR = 0019h
+WM_WININICHANGE = 001Ah
+WM_DEVMODECHANGE = 001Bh
+WM_ACTIVATEAPP = 001Ch
+WM_FONTCHANGE = 001Dh
+WM_TIMECHANGE = 001Eh
+WM_CANCELMODE = 001Fh
+WM_SETCURSOR = 0020h
+WM_MOUSEACTIVATE = 0021h
+WM_CHILDACTIVATE = 0022h
+WM_QUEUESYNC = 0023h
+WM_GETMINMAXINFO = 0024h
+WM_PAINTICON = 0026h
+WM_ICONERASEBKGND = 0027h
+WM_NEXTDLGCTL = 0028h
+WM_ALTTABACTIVE = 0029h ;Internal
+WM_SPOOLERSTATUS = 002Ah
+WM_DRAWITEM = 002Bh
+WM_MEASUREITEM = 002Ch
+WM_DELETEITEM = 002Dh
+WM_VKEYTOITEM = 002Eh
+WM_CHARTOITEM = 002Fh
+WM_SETFONT = 0030h
+WM_GETFONT = 0031h
+WM_SETHOTKEY = 0032h ;Internal
+WM_GETHOTKEY = 0033h ;Internal
+WM_FILESYSCHANGE = 0034h ;Internal
+WM_ISACTIVEICON = 0035h ;Internal
+WM_UNUSED0036 = 0036h ;Internal
+WM_QUERYDRAGICON = 0037h
+WM_COMPAREITEM = 0039h
+WM_TESTING = 0040h ;Internal
+WM_COMPACTING = 0041h
+; 0042h ;Internal
+; 0043h ;Internal
+IFNDEF NOWIN31
+WM_COMMNOTIFY = 0044h
+; = 0045h ;Internal
+WM_WINDOWPOSCHANGING= 0046h
+WM_WINDOWPOSCHANGED = 0047h
+WM_POWER = 0048h
+ENDIF
+
+
+WM_NCCREATE = 0081h
+WM_NCDESTROY = 0082h
+WM_NCCALCSIZE = 0083h
+WM_NCHITTEST = 0084h
+WM_NCPAINT = 0085h
+WM_NCACTIVATE = 0086h
+WM_GETDLGCODE = 0087h
+WM_SYNCPAINT = 0088h ;Internal
+WM_SYNCTASK = 0089h ;Internal
+WM_NCMOUSEMOVE = 00A0h
+WM_NCLBUTTONDOWN = 00A1h
+WM_NCLBUTTONUP = 00A2h
+WM_NCLBUTTONDBLCLK = 00A3h
+WM_NCRBUTTONDOWN = 00A4h
+WM_NCRBUTTONUP = 00A5h
+WM_NCRBUTTONDBLCLK = 00A6h
+WM_NCMBUTTONDOWN = 00A7h
+WM_NCMBUTTONUP = 00A8h
+WM_NCMBUTTONDBLCLK = 00A9h
+
+WM_KEYFIRST = 0100h
+WM_KEYDOWN = 0100h
+WM_KEYUP = 0101h
+WM_CHAR = 0102h
+WM_DEADCHAR = 0103h
+WM_SYSKEYDOWN = 0104h
+WM_SYSKEYUP = 0105h
+WM_SYSCHAR = 0106h
+WM_SYSDEADCHAR = 0107h
+WM_YOMICHAR = 0108h ;Internal
+WM_KEYLAST = 0108h
+
+WM_CONVERTREQUEST = 010Ah ;Internal
+WM_CONVERTRESULT = 010Bh ;Internal
+WM_INITDIALOG = 0110h
+WM_COMMAND = 0111h
+WM_SYSCOMMAND = 0112h
+WM_TIMER = 0113h
+WM_HSCROLL = 0114h
+WM_VSCROLL = 0115h
+WM_INITMENU = 0116h
+WM_INITMENUPOPUP = 0117h
+WM_SYSTIMER = 0118h ;Internal
+WM_MENUSELECT = 011Fh
+WM_MENUCHAR = 0120h
+WM_ENTERIDLE = 0121h
+
+WM_LBTRACKPOINT = 0131h ;Internal
+
+WM_MOUSEFIRST = 0200h
+WM_MOUSEMOVE = 0200h
+WM_LBUTTONDOWN = 0201h
+WM_LBUTTONUP = 0202h
+WM_LBUTTONDBLCLK = 0203h
+WM_RBUTTONDOWN = 0204h
+WM_RBUTTONUP = 0205h
+WM_RBUTTONDBLCLK = 0206h
+WM_MBUTTONDOWN = 0207h
+WM_MBUTTONUP = 0208h
+WM_MBUTTONDBLCLK = 0209h
+WM_MOUSELAST = 0209h
+
+WM_PARENTNOTIFY = 0210h
+WM_ENTERMENULOOP = 0211h ;Internal
+WM_EXITMENULOOP = 0212h ;Internal
+WM_NEXTMENU = 0213h ;Internal
+WM_MDICREATE = 0220h
+WM_MDIDESTROY = 0221h
+WM_MDIACTIVATE = 0222h
+WM_MDIRESTORE = 0223h
+WM_MDINEXT = 0224h
+WM_MDIMAXIMIZE = 0225h
+WM_MDITILE = 0226h
+WM_MDICASCADE = 0227h
+WM_MDIICONARRANGE = 0228h
+WM_MDIGETACTIVE = 0229h
+WM_DROPOBJECT = 022Ah ;Internal
+WM_QUERYDROPOBJECT = 022Bh ;Internal
+WM_BEGINDRAG = 022Ch ;Internal
+WM_DRAGLOOP = 022Dh ;Internal
+WM_DRAGSELECT = 022Eh ;Internal
+WM_DRAGMOVE = 022Fh ;Internal
+WM_MDISETMENU = 0230h
+WM_ENTERSIZEMOVE = 0231h ;Internal
+WM_EXITSIZEMOVE = 0232h ;Internal
+WM_DROPFILES = 0233h
+
+WM_KANJIFIRST = 0280h ;Internal
+WM_KANJILAST = 029Fh ;Internal
+
+WM_CUT = 0300h
+WM_COPY = 0301h
+WM_PASTE = 0302h
+WM_CLEAR = 0303h
+WM_UNDO = 0304h
+WM_RENDERFORMAT = 0305h
+WM_RENDERALLFORMATS = 0306h
+WM_DESTROYCLIPBOARD = 0307h
+WM_DRAWCLIPBOARD = 0308h
+WM_PAINTCLIPBOARD = 0309h
+WM_VSCROLLCLIPBOARD = 030Ah
+WM_SIZECLIPBOARD = 030Bh
+WM_ASKCBFORMATNAME = 030Ch
+WM_CHANGECBCHAIN = 030Dh
+WM_HSCROLLCLIPBOARD = 030Eh
+WM_QUERYNEWPALETTE = 030Fh
+WM_PALETTEGONNACHANGE = 0310h ;Internal
+WM_PALETTEISCHANGING = 0310h
+WM_CHANGEPALETTE = 0311h ;Internal
+WM_PALETTECHANGED = 0311h
+
+IFNDEF NOWIN31
+WM_PENWINFIRST equ 0380h
+WM_PENWINLAST equ 038Fh
+
+WM_INTERNAL_COALESCE_FIRST equ 0390h ;Internal
+
+WM_COALESCE_FIRST equ 0390h
+WM_COALESCE_LAST equ 039Fh
+
+; The following message range reserved ;Internal
+; for multi-media ;Internal
+
+WM_MM_RESERVED_FIRST equ 03A0h ;Internal
+WM_MM_RESERVED_LAST equ 03DFh ;Internal
+
+WM_INTERNAL_COALESCE_LAST equ (WM_MM_RESERVED_FIRST+16) ;Internal
+
+ENDIF
+
+WM_INTERNAL_DDE_FIRST equ 03E0h ;Internal
+WM_INTERNAL_DDE_LAST equ 03EFh ;Internal
+
+; The following messages are reserved for CBT ;Internal
+WM_CBT_RESERVED_FIRST equ 03F0h ;Internal
+WM_CBT_RESERVED_LAST equ 03FFh ;Internal
+
+; private window messages start here
+WM_USER = 0400H
+ENDIF ; NOWM
+
+; WM_MOUSEACTIVATE Return Codes
+MA_ACTIVATE = 1
+MA_ACTIVATEANDEAT = 2
+MA_NOACTIVATE = 3
+
+; Size message commands
+SIZENORMAL = 0
+SIZEICONIC = 1
+SIZEFULLSCREEN = 2
+SIZEZOOMSHOW = 3
+SIZEZOOMHIDE = 4
+
+; ShowWindow() Commands
+SW_HIDE = 0
+SW_SHOWNORMAL = 1
+SW_NORMAL = 1
+SW_SHOWMINIMIZED = 2
+SW_SHOWMAXIMIZED = 3
+SW_MAXIMIZE = 3
+SW_SHOWNOACTIVATE = 4
+SW_SHOW = 5
+SW_MINIMIZE = 6
+SW_SHOWMINNOACTIVE = 7
+SW_SHOWNA = 8
+SW_RESTORE = 9
+
+; Old ShowWindow() Commands
+HIDE_WINDOW = 0
+SHOW_OPENWINDOW = 1
+SHOW_ICONWINDOW = 2
+SHOW_FULLSCREEN = 3
+SHOW_OPENNOACTIVATE= 4
+
+; identifiers for the WM_SHOWWINDOW message
+SW_PARENTCLOSING = 1
+SW_OTHERZOOM = 2
+SW_PARENTOPENING = 3
+SW_OTHERUNZOOM = 4
+;
+; Key state masks for mouse messages
+;
+MK_LBUTTON = 0001h
+MK_RBUTTON = 0002h
+MK_SHIFT = 0004h
+MK_CONTROL = 0008h
+MK_MBUTTON = 0010h
+;
+; Class styles
+;
+CS_VREDRAW = 0001h
+CS_HREDRAW = 0002h
+CS_KEYCVTWINDOW = 0004H
+CS_DBLCLKS = 0008h
+; 0010h reserved
+CS_OWNDC = 0020h
+CS_CLASSDC = 0040h
+CS_PARENTDC = 0080h
+CS_NOKEYCVT = 0100h
+CS_SAVEBITS = 0800h
+CS_NOCLOSE = 0200h
+CS_BYTEALIGNCLIENT = 1000h
+CS_BYTEALIGNWINDOW = 2000h
+CS_GLOBALCLASS = 4000h ; Global window class
+
+;
+; Special CreateWindow position value
+;
+CW_USEDEFAULT EQU 8000h
+
+;
+; Windows styles (the high words)
+;
+WS_OVERLAPPED = 00000h
+WS_ICONICPOPUP = 0C000h
+WS_POPUP = 08000h
+WS_CHILD = 04000h
+WS_MINIMIZE = 02000h
+WS_VISIBLE = 01000h
+WS_DISABLED = 00800h
+WS_CLIPSIBLINGS = 00400h
+WS_CLIPCHILDREN = 00200h
+WS_MAXIMIZE = 00100h
+WS_CAPTION = 000C0h ; WS_BORDER | WS_DLGFRAME
+WS_BORDER = 00080h
+WS_DLGFRAME = 00040h
+WS_VSCROLL = 00020h
+WS_HSCROLL = 00010h
+WS_SYSMENU = 00008h
+WS_THICKFRAME = 00004h
+WS_HREDRAW = 00002h
+WS_VREDRAW = 00001h
+WS_GROUP = 00002h
+WS_TABSTOP = 00001h
+WS_MINIMIZEBOX = 00002h
+WS_MAXIMIZEBOX = 00001h
+
+; Common Window Styles
+
+WS_OVERLAPPEDWINDOW = WS_OVERLAPPED + WS_CAPTION + WS_SYSMENU + WS_THICKFRAME + WS_MINIMIZEBOX + WS_MAXIMIZEBOX
+WS_POPUPWINDOW = WS_POPUP + WS_BORDER + WS_SYSMENU
+WS_CHILDWINDOW = WS_CHILD
+WS_TILEDWINDOW = WS_OVERLAPPEDWINDOW
+
+WS_TILED = WS_OVERLAPPED
+WS_ICONIC = WS_MINIMIZE
+WS_SIZEBOX = WS_THICKFRAME
+
+; Extended Window Styles (low words)
+WS_EX_DLGMODALFRAME = 0001
+WS_EX_DRAGOBJECT = 0002
+WS_EX_NOPARENTNOTIFY = 0004
+WS_EX_TOPMOST = 0008
+
+;
+; predefined clipboard formats
+;
+CF_TEXT = 1
+CF_BITMAP = 2
+CF_METAFILEPICT = 3
+CF_SYLK = 4
+CF_DIF = 5
+CF_TIFF = 6
+CF_OEMTEXT = 7
+CF_DIB = 8
+CF_PALETTE = 9
+CF_PENDATA = 10
+CF_RIFF = 11
+CF_WAVE = 12
+
+CF_OWNERDISPLAY = 80h ; owner display
+CF_DSPTEXT = 81h ; display text
+CF_DSPBITMAP = 82h ; display bitmap
+CF_DSPMETAFILEPICT = 83h ; display metafile
+;
+; Private clipboard format range
+;
+CF_PRIVATEFIRST = 200h ; Anything in this range doesn't
+CF_PRIVATELAST = 2ffh ; get GlobalFree'd
+CF_GDIOBJFIRST = 300h ; Anything in this range gets
+CF_GDIOBJLAST = 3ffh ; DeleteObject'ed
+
+
+MAKEINTRESOURCE MACRO a
+ mov ax,a
+ xor dx,dx
+ ENDM
+;
+; Predefined resource types
+;
+RT_CURSOR = 1 ; must be passed through MAKEINTRESOURCE
+RT_BITMAP = 2
+RT_ICON = 3
+RT_MENU = 4
+RT_DIALOG = 5
+RT_STRING = 6
+RT_FONTDIR = 7
+RT_FONT = 8
+RT_ACCELERATOR = 9
+RT_RCDATA = 10
+
+;** NOTE: if any new resource types are introduced above this point, then the
+;** value of DIFFERENCE must be changed.
+;** (RT_GROUP_CURSOR - RT_CURSOR) must always be equal to DIFFERENCE
+;** (RT_GROUP_ICON - RT_ICON) must always be equal to DIFFERENCE
+
+DIFFERENCE = 11
+
+RT_GROUP_CURSOR = RT_CURSOR + DIFFERENCE
+RT_GROUP_ICON = RT_ICON + DIFFERENCE
+
+
+
+IFNDEF NOMDI
+MDICREATESTRUCT struc
+ szClass dd ?
+ szTitle dd ?
+ hOwner dw ?
+ x dw ?
+ y dw ?
+ cxc dw ?
+ cyc dw ?
+ style dd ?
+MDICREATESTRUCT ends
+
+CLIENTCREATESTRUCT struc
+ hWindowMenu dw ?
+ idFirstChild dw ?
+CLIENTCREATESTRUCT ends
+ENDIF
+
+; NOMDI
+
+
+PALETTEENTRY struc
+ peRed db ?
+ peGreen db ?
+ peBlue db ?
+ peFlags db ?
+PALETTEENTRY ends
+
+; Logical Palette
+LOGPALETTE struc
+ palVersion dw ?
+ palNumEntries dw ?
+ palPalEntry db ? ; array of PALETTEENTRY
+LOGPALETTE ends
+
+; DRAWITEMSTRUCT for ownerdraw
+DRAWITEMSTRUCT struc
+ drCtlType dw ?
+ drCtlID dw ?
+ dritemID dw ?
+ dritemAction dw ?
+ dritemState dw ?
+ drhwndItem dw ?
+ drhDC dw ?
+ drrcItem DB size RECT dup(?)
+ dritemData dd ?
+DRAWITEMSTRUCT ends
+
+; DELETEITEMSTRUCT for ownerdraw
+DELETEITEMSTRUCT struc
+ deCtlType dw ?
+ deCtlID dw ?
+ deitemID dw ?
+ dehwndItem dw ?
+ deitemData dd ?
+DELETEITEMSTRUCT ends
+
+; MEASUREITEMSTRUCT for ownerdraw
+MEASUREITEMSTRUCT struc
+ meCtlType dw ?
+ meCtlID dw ?
+ meitemID dw ?
+ meitemWidth dw ?
+ meitemHeight dw ?
+ meitemData dd ?
+MEASUREITEMSTRUCT ends
+
+; COMPAREITEMSTUCT for ownerdraw sorting
+COMPAREITEMSTRUCT struc
+ coCtlType dw ?
+ coCtlID dw ?
+ cohwndItem dw ?
+ coitemID1 dw ?
+ coitemData1 dd ?
+ coitemID2 dw ?
+ coitemData2 dd ?
+COMPAREITEMSTRUCT ends
+
+; Owner draw control types
+ODT_MENU = 1
+ODT_LISTBOX = 2
+ODT_COMBOBOX = 3
+ODT_BUTTON = 4
+
+; Owner draw actions
+ODA_DRAWENTIRE = 1
+ODA_SELECT = 2
+ODA_FOCUS = 4
+
+; Owner draw state
+ODS_SELECTED = 0001h
+ODS_GRAYED = 0002h
+ODS_DISABLED = 0004h
+ODS_CHECKED = 0008h
+ODS_FOCUS = 0010h
+
+; PeekMessage() Options
+PM_NOREMOVE = 0000h
+PM_REMOVE = 0001h
+PM_NOYIELD = 0002h
+
+; SetWindowPos Flags
+SWP_NOSIZE = 0001h
+SWP_NOMOVE = 0002h
+SWP_NOZORDER = 0004h
+SWP_NOREDRAW = 0008h
+SWP_NOACTIVATE = 0010h
+SWP_DRAWFRAME = 0020h
+SWP_SHOWWINDOW = 0040h
+SWP_HIDEWINDOW = 0080h
+SWP_NOCOPYBITS = 0100h
+SWP_NOREPOSITION = 0200h
+
+
+IFNDEF NOWINMESSAGES
+
+; Listbox messages
+LB_ADDSTRING = (WM_USER+1)
+LB_INSERTSTRING = (WM_USER+2)
+LB_DELETESTRING = (WM_USER+3)
+LB_RESETCONTENT = (WM_USER+5)
+LB_SETSEL = (WM_USER+6)
+LB_SETCURSEL = (WM_USER+7)
+LB_GETSEL = (WM_USER+8)
+LB_GETCURSEL = (WM_USER+9)
+LB_GETTEXT = (WM_USER+10)
+LB_GETTEXTLEN = (WM_USER+11)
+LB_GETCOUNT = (WM_USER+12)
+LB_SELECTSTRING = (WM_USER+13)
+LB_DIR = (WM_USER+14)
+LB_GETTOPINDEX = (WM_USER+15)
+LB_FINDSTRING = (WM_USER+16)
+LB_GETSELCOUNT = (WM_USER+17)
+LB_GETSELITEMS = (WM_USER+18)
+LB_SETTABSTOPS = (WM_USER+19)
+LB_GETHORIZONTALEXTENT = (WM_USER+20)
+LB_SETHORIZONTALEXTENT = (WM_USER+21)
+LB_ADDFILE = (WM_USER+23) ;Internal
+LB_SETTOPINDEX = (WM_USER+24)
+LB_GETITEMRECT = (WM_USER+25)
+LB_GETITEMDATA = (WM_USER+26)
+LB_SETITEMDATA = (WM_USER+27)
+LB_SELITEMRANGE = (WM_USER+28)
+LB_SETANCHORINDEX = (WM_USER+29) ;Internal
+LB_GETANCHORINDEX = (WM_USER+30) ;Internal
+LB_SETCARETINDEX = (WM_USER+31)
+LB_GETCARETINDEX = (WM_USER+32)
+IFNDEF NOWIN31
+LB_SETITEMHEIGHT = (WM_USER+33)
+LB_GETITEMHEIGHT = (WM_USER+34)
+LB_FINDSTRINGEXACT = (WM_USER+35)
+ENDIF
+LBCB_CARETON = (WM_USER+36) ;Internal
+LBCB_CARETOFF = (WM_USER+37) ;Internal
+LB_MSGMAX = (WM_USER+38) ;Internal
+
+ENDIF
+; NOWINMESSAGES
+
+; Listbox Styles
+LBS_NOTIFY = 0001h
+LBS_SORT = 0002h
+LBS_NOREDRAW = 0004h
+LBS_MULTIPLESEL = 0008h
+LBS_OWNERDRAWFIXED = 0010h
+LBS_OWNERDRAWVARIABLE = 0020h
+LBS_HASSTRINGS = 0040h
+LBS_USETABSTOPS = 0080h
+LBS_NOINTEGRALHEIGHT = 0100h
+LBS_MULTICOLUMN = 0200h
+LBS_WANTKEYBOARDINPUT = 0400h
+LBS_EXTENDEDSEL = 0800h
+LBS_STANDARD = LBS_NOTIFY + LBS_SORT + WS_VSCROLL + WS_BORDER
+LBS_DISABLENOSCROLL = 1000h
+
+; Listbox Notification Codes
+LBN_ERRSPACE = (-2)
+LBN_SELCHANGE = 1
+LBN_DBLCLK = 2
+LBN_SELCANCEL = 3
+LBN_SETFOCUS = 4
+LBN_KILLFOCUS = 5
+
+IFNDEF NOWINMESSAGES
+
+; Edit Control Messages
+EM_GETSEL = (WM_USER+0)
+EM_SETSEL = (WM_USER+1)
+EM_GETRECT = (WM_USER+2)
+EM_SETRECT = (WM_USER+3)
+EM_SETRECTNP = (WM_USER+4)
+EM_SCROLL = (WM_USER+5)
+EM_LINESCROLL = (WM_USER+6)
+EM_GETMODIFY = (WM_USER+8)
+EM_SETMODIFY = (WM_USER+9)
+EM_GETLINECOUNT = (WM_USER+10)
+EM_LINEINDEX = (WM_USER+11)
+EM_SETHANDLE = (WM_USER+12)
+EM_GETHANDLE = (WM_USER+13)
+EM_GETTHUMB = (WM_USER+14) ;Internal
+EM_LINELENGTH = (WM_USER+17)
+EM_REPLACESEL = (WM_USER+18)
+EM_SETFONT = (WM_USER+19)
+EM_GETLINE = (WM_USER+20)
+EM_LIMITTEXT = (WM_USER+21)
+EM_CANUNDO = (WM_USER+22)
+EM_UNDO = (WM_USER+23)
+EM_FMTLINES = (WM_USER+24)
+EM_LINEFROMCHAR = (WM_USER+25)
+EM_SETWORDBREAK = (WM_USER+26)
+EM_SETTABSTOPS = (WM_USER+27)
+EM_SETPASSWORDCHAR = (WM_USER+28)
+EM_EMPTYUNDOBUFFER = (WM_USER+29)
+IFNDEF NOWIN31
+EM_GETFIRSTVISIBLELINE = (WM_USER+30)
+EM_SETREADONLY = (WM_USER+31)
+EM_SETWORDBREAKPROC = (WM_USER+32)
+EM_GETWORDBREAKPROC = (WM_USER+33)
+EM_GETPASSWORDCHAR = (WM_USER+34)
+ENDIF
+EM_MSGMAX = (WM_USER+35) ;Internal
+
+ENDIF
+; NOWINMESSAGES
+
+
+; Edit Control Styles (low word)
+ES_LEFT = 0000h
+ES_CENTER = 0001h
+ES_RIGHT = 0002h
+ES_MULTILINE = 0004h
+ES_UPPERCASE = 0008h
+ES_LOWERCASE = 0010h
+ES_PASSWORD = 0020h
+ES_AUTOVSCROLL = 0040h
+ES_AUTOHSCROLL = 0080h
+ES_NOHIDESEL = 0100h
+ES_OEMCONVERT = 0400h
+IFNDEF NOWIN31
+ES_READONLY = 0800h
+ES_WANTRETURN = 1000h
+ENDIF
+
+
+; Edit Control Notification Codes
+EN_SETFOCUS = 0100h
+EN_KILLFOCUS = 0200h
+EN_CHANGE = 0300h
+EN_UPDATE = 0400h
+EN_ERRSPACE = 0500h
+EN_MAXTEXT = 0501h
+EN_HSCROLL = 0601h
+EN_VSCROLL = 0602h
+
+IFNDEF NOWINMESSAGES
+
+; Button Control Messages
+BM_GETCHECK = (WM_USER+0)
+BM_SETCHECK = (WM_USER+1)
+BM_GETSTATE = (WM_USER+2)
+BM_SETSTATE = (WM_USER+3)
+BM_SETSTYLE = (WM_USER+4)
+
+ENDIF
+; NOWINMESSAGES
+
+; Button Control Styles (low word)
+BS_PUSHBUTTON = 00h
+BS_DEFPUSHBUTTON = 01h
+BS_CHECKBOX = 02h
+BS_AUTOCHECKBOX = 03h
+BS_RADIOBUTTON = 04h
+BS_3STATE = 05h
+BS_AUTO3STATE = 06h
+BS_GROUPBOX = 07h
+BS_USERBUTTON = 08h
+BS_AUTORADIOBUTTON = 09h
+BS_PUSHBOX = 0Ah ;Internal
+BS_OWNERDRAW = 0Bh
+BS_LEFTTEXT = 20h
+
+; User Button Notification Codes
+BN_CLICKED = 0
+BN_PAINT = 1
+BN_HILITE = 2
+BN_UNHILITE = 3
+BN_DISABLE = 4
+BN_DOUBLECLICKED = 5
+
+; Dialog Styles (low words)
+DS_ABSALIGN = 01h
+DS_SYSMODAL = 02h
+DS_LOCALEDIT = 20h ;/* Edit items get Local storage. */
+DS_SETFONT = 40h ;/* User specified font for Dlg controls */
+DS_MODALFRAME = 80h ;/* Can be combined with WS_CAPTION */
+DS_NOIDLEMSG = 100h ;/* WM_ENTERIDLE message will not be sent */
+
+IFNDEF NOWINMESSAGES
+
+; Dialog box messages
+DM_GETDEFID = (WM_USER+0)
+DM_SETDEFID = (WM_USER+1)
+
+ENDIF ;NOWINMESSAGES
+
+; Dialog Codes
+DLGC_WANTARROWS = 0001h ; /* Control wants arrow keys */
+DLGC_WANTTAB = 0002h ; /* Control wants tab keys */
+DLGC_WANTALLKEYS = 0004h ; /* Control wants all keys */
+DLGC_WANTMESSAGE = 0004h ; /* Pass message to control */
+DLGC_HASSETSEL = 0008h ; /* Understands EM_SETSEL message */
+DLGC_DEFPUSHBUTTON = 0010h ; /* Default pushbutton */
+DLGC_UNDEFPUSHBUTTON= 0020h ; /* Non-default pushbutton */
+DLGC_RADIOBUTTON = 0040h ; /* Radio button */
+DLGC_WANTCHARS = 0080h ; /* Want WM_CHAR messages */
+DLGC_STATIC = 0100h ; /* Static item: don't include */
+DLGC_BUTTON = 2000h ; /* Button item: can be checked */
+
+; Combo Box return Values
+CB_OKAY = 0
+CB_ERR = (-1)
+CB_ERRSPACE = (-2)
+
+; Combo Box Notification Codes
+CBN_ERRSPACE = (-1)
+CBN_SELCHANGE = 1
+CBN_DBLCLK = 2
+CBN_SETFOCUS = 3
+CBN_KILLFOCUS = 4
+CBN_EDITCHANGE = 5
+CBN_EDITUPDATE = 6
+CBN_DROPDOWN = 7
+
+; Combo Box styles (low words)
+CBS_SIMPLE = 0001h
+CBS_DROPDOWN = 0002h
+CBS_DROPDOWNLIST = 0003h
+CBS_OWNERDRAWFIXED = 0010h
+CBS_OWNERDRAWVARIABLE= 0020h
+CBS_AUTOHSCROLL = 0040h
+CBS_OEMCONVERT = 0080h
+CBS_SORT = 0100h
+CBS_HASSTRINGS = 0200h
+CBS_NOINTEGRALHEIGHT = 0400h
+
+IFNDEF NOWINMESSAGES
+
+; Combo Box messages
+CB_GETEDITSEL = (WM_USER+0)
+CB_LIMITTEXT = (WM_USER+1)
+CB_SETEDITSEL = (WM_USER+2)
+CB_ADDSTRING = (WM_USER+3)
+CB_DELETESTRING = (WM_USER+4)
+CB_DIR = (WM_USER+5)
+CB_GETCOUNT = (WM_USER+6)
+CB_GETCURSEL = (WM_USER+7)
+CB_GETLBTEXT = (WM_USER+8)
+CB_GETLBTEXTLEN = (WM_USER+9)
+CB_INSERTSTRING = (WM_USER+10)
+CB_RESETCONTENT = (WM_USER+11)
+CB_FINDSTRING = (WM_USER+12)
+CB_SELECTSTRING = (WM_USER+13)
+CB_SETCURSEL = (WM_USER+14)
+CB_SHOWDROPDOWN = (WM_USER+15)
+CB_GETITEMDATA = (WM_USER+16)
+CB_SETITEMDATA = (WM_USER+17)
+IFNDEF NOWIN31
+CB_GETDROPPEDCONTROLRECT = (WM_USER+18)
+CB_SETITEMHEIGHT = (WM_USER+19)
+CB_GETITEMHEIGHT = (WM_USER+20)
+CB_SETEXTENDEDUI = (WM_USER+21)
+CB_GETEXTENDEDUI = (WM_USER+22)
+CB_GETDROPPEDSTATE = (WM_USER+23)
+CB_FINDSTRINGEXACT = (WM_USER+24)
+ENDIF
+CB_MSGMAX = (WM_USER+25) ;Internal
+
+ENDIF ; NOWINMESSAGES
+
+; Static Control styles (low word)
+SS_LEFT = 00h
+SS_CENTER = 01h
+SS_RIGHT = 02h
+SS_ICON = 03h
+SS_BLACKRECT = 04h
+SS_GRAYRECT = 05h
+SS_WHITERECT = 06h
+SS_BLACKFRAME = 07h
+SS_GRAYFRAME = 08h
+SS_WHITEFRAME = 09h
+SS_USERITEM = 0Ah ;Internal
+SS_SIMPLE = 0Bh
+SS_LEFTNOWORDWRAP = 0Ch
+SS_NOPREFIX = 80h ; Don't do "&" character translation
+
+IFNDEF NOWIN31
+IFNDEF NOWINMESSAGES
+
+;Static Control Messages
+STM_SETICON = (WM_USER+0)
+STM_GETICON = (WM_USER+1)
+STM_MSGMAX = (WM_USER+2) ;Internal
+ENDIF
+ENDIF
+
+; Scroll Bar Styles (low word)
+SBS_HORZ = 0000h
+SBS_VERT = 0001h
+SBS_TOPALIGN = 0002h
+SBS_LEFTALIGN = 0002h
+SBS_BOTTOMALIGN = 0004h
+SBS_RIGHTALIGN = 0004h
+SBS_SIZEBOXTOPLEFTALIGN = 0002h
+SBS_SIZEBOXBOTTOMRIGHTALIGN = 0004h
+SBS_SIZEBOX = 0008h
+
+IFNDEF NOSYSMETRICS
+
+; GetSystemMetrics() codes
+SM_CXSCREEN = 0
+SM_CYSCREEN = 1
+SM_CXVSCROLL = 2
+SM_CYHSCROLL = 3
+SM_CYCAPTION = 4
+SM_CXBORDER = 5
+SM_CYBORDER = 6
+SM_CXDLGFRAME = 7
+SM_CYDLGFRAME = 8
+SM_CYVTHUMB = 9
+SM_CXHTHUMB = 10
+SM_CXICON = 11
+SM_CYICON = 12
+SM_CXCURSOR = 13
+SM_CYCURSOR = 14
+SM_CYMENU = 15
+SM_CXFULLSCREEN = 16
+SM_CYFULLSCREEN = 17
+SM_CYKANJIWINDOW = 18
+SM_MOUSEPRESENT = 19
+SM_CYVSCROLL = 20
+SM_CXHSCROLL = 21
+SM_DEBUG = 22
+SM_SWAPBUTTON = 23
+SM_RESERVED1 = 24
+SM_RESERVED2 = 25
+SM_RESERVED3 = 26
+SM_RESERVED4 = 27
+SM_CXMIN = 28
+SM_CYMIN = 29
+SM_CXSIZE = 30
+SM_CYSIZE = 31
+SM_CXFRAME = 32
+SM_CYFRAME = 33
+SM_CXMINTRACK = 34
+SM_CYMINTRACK = 35
+IFNDEF NOWIN31
+SM_CXDOUBLECLK = 36
+SM_CYDOUBLECLK = 37
+SM_CXICONSPACING = 38
+SM_CYICONSPACING = 39
+SM_MENUDROPALIGNMENT = 40
+SM_PENWINDOWS = 41
+SM_DBCSENABLED = 42
+ENDIF
+SM_CMETRICSMAX = 43
+
+ENDIF ;NOSYSMETRICS
+
+IFNDEF NOCOLOR
+
+COLOR_SCROLLBAR = 0
+COLOR_BACKGROUND = 1
+COLOR_ACTIVECAPTION = 2
+COLOR_INACTIVECAPTION = 3
+COLOR_MENU = 4
+COLOR_WINDOW = 5
+COLOR_WINDOWFRAME = 6
+COLOR_MENUTEXT = 7
+COLOR_WINDOWTEXT = 8
+COLOR_CAPTIONTEXT = 9
+COLOR_ACTIVEBORDER = 10
+COLOR_INACTIVEBORDER = 11
+COLOR_APPWORKSPACE = 12
+COLOR_HIGHLIGHT = 13
+COLOR_HIGHLIGHTTEXT = 14
+COLOR_BTNFACE = 15
+COLOR_BTNSHADOW = 16
+COLOR_GRAYTEXT = 17
+COLOR_BTNTEXT = 18
+IFNDEF NOWIN31
+COLOR_INACTIVECAPTIONTEXT = 19
+COLOR_BTNHILIGHT = 20
+ENDIF
+ENDIF ;NOCOLOR
+
+; Commands to pass WinHelp()
+HELP_CONTEXT =0001h ;/* Display topic in ulTopic */
+HELP_QUIT =0002h ;/* Terminate help */
+HELP_INDEX =0003h ;/* Display index */
+HELP_HELPONHELP =0004h ;/* Display help on using help */
+HELP_SETINDEX =0005h ;/* Set the current Index for multi index help */
+HELP_KEY =0101h ;/* Display topic for keyword in offabData */
+
+IFNDEF NOCOMM
+
+NOPARITY = 0
+ODDPARITY = 1
+EVENPARITY = 2
+MARKPARITY = 3
+SPACEPARITY = 4
+
+ONESTOPBIT = 0
+ONE5STOPBITS = 1
+TWOSTOPBITS = 2
+
+IGNORE = 0 ; /* Ignore signal */
+INFINITE = 0FFFFh ; /* Infinite timeout */
+
+; Error Flags
+CE_RXOVER = 0001h ; /* Receive Queue overflow */
+CE_OVERRUN = 0002h ; /* Receive Overrun Error */
+CE_RXPARITY = 0004h ; /* Receive Parity Error */
+CE_FRAME = 0008h ; /* Receive Framing error */
+CE_BREAK = 0010h ; /* Break Detected */
+CE_CTSTO = 0020h ; /* CTS Timeout */
+CE_DSRTO = 0040h ; /* DSR Timeout */
+CE_RLSDTO = 0080h ; /* RLSD Timeout */
+CE_TXFULL = 0100h ; /* TX Queue is full */
+CE_PTO = 0200h ; /* LPTx Timeout */
+CE_IOE = 0400h ; /* LPTx I/O Error */
+CE_DNS = 0800h ; /* LPTx Device not selected */
+CE_OOP = 1000h ; /* LPTx Out-Of-Paper */
+CE_MODE = 8000h ; /* Requested mode unsupported */
+
+IE_BADID = (-1) ; /* Invalid or unsupported id */
+IE_OPEN = (-2) ; /* Device Already Open */
+IE_NOPEN = (-3) ; /* Device Not Open */
+IE_MEMORY = (-4) ; /* Unable to allocate queues */
+IE_DEFAULT = (-5) ; /* Error in default parameters */
+IE_HARDWARE = (-10) ; /* Hardware Not Present */
+IE_BYTESIZE = (-11) ; /* Illegal Byte Size */
+IE_BAUDRATE = (-12) ; /* Unsupported BaudRate */
+
+; Events
+EV_RXCHAR = 0001h ; /* Any Character received */
+EV_RXFLAG = 0002h ; /* Received certain character */
+EV_TXEMPTY = 0004h ; /* Transmitt Queue Empty */
+EV_CTS = 0008h ; /* CTS changed state */
+EV_DSR = 0010h ; /* DSR changed state */
+EV_RLSD = 0020h ; /* RLSD changed state */
+EV_BREAK = 0040h ; /* BREAK received */
+EV_ERR = 0080h ; /* Line status error occurred */
+EV_RING = 0100h ; /* Ring signal detected */
+EV_PERR = 0200h ; /* Printer error occured */
+EV_CTSS = 0400h ; /* CTS state */
+EV_DSRS = 0800h ; /* DSR state */
+EV_RLSDS = 1000h ; /* RLSD state */
+EV_RingTe = 2000h ; /* Ring Trailing Edge Indicator */
+
+
+; Escape Functions
+SETXOFF = 1 ; /* Simulate XOFF received */
+SETXON = 2 ; /* Simulate XON received */
+SETRTS = 3 ; /* Set RTS high */
+CLRRTS = 4 ; /* Set RTS low */
+SETDTR = 5 ; /* Set DTR high */
+CLRDTR = 6 ; /* Set DTR low */
+RESETDEV = 7 ; /* Reset device if possible */
+
+LPTx = 80h ; /* Set if ID is for LPT device */
+
+IFNDEF NOWIN31
+; new escape functions
+GETMAXLPT equ 8 ; Max supported LPT id
+GETMAXCOM equ 9 ; Max supported COM id
+GETBASEIRQ equ 10 ; Get port base & irq for a port
+
+; Comm Baud Rate indices
+CBR_110 equ 0FF10h
+CBR_300 equ 0FF11h
+CBR_600 equ 0FF12h
+CBR_1200 equ 0FF13h
+CBR_2400 equ 0FF14h
+CBR_4800 equ 0FF15h
+CBR_9600 equ 0FF16h
+CBR_14400 equ 0FF17h
+CBR_19200 equ 0FF18h
+; 0FF19h (reserved)
+; 0FF1Ah (reserved)
+CBR_38400 equ 0FF1Bh
+; 0FF1Ch (reserved)
+; 0FF1Dh (reserved)
+; 0FF1Eh (reserved)
+CBR_56000 equ 0FF1Fh
+; 0FF20h (reserved)
+; 0FF21h (reserved)
+; 0FF22h (reserved)
+CBR_128000 equ 0FF23h
+; 0FF24h (reserved)
+; 0FF25h (reserved)
+; 0FF26h (reserved)
+CBR_256000 equ 0FF27h
+
+; notifications passed in low word of lParam on WM_COMMNOTIFY messages
+CN_RECEIVE equ 1 ; bytes are available in the input queue
+CN_TRANSMIT equ 2 ; fewer than wOutTrigger bytes still
+ ; remain in the output queue waiting
+ ; to be transmitted.
+CN_EVENT equ 4 ; an enabled event has occurred
+
+ENDIF
+
+
+DCB struc
+ DCB_Id db ? ; /* Internal Device ID */
+ DCB_BaudRate dw ? ; /* Baudrate at which runing */
+ DCB_ByteSize db ? ; /* Number of bits/byte, 4-8 */
+ DCB_Parity db ? ; /* 0-4=None,Odd,Even,Mark,Space */
+ DCB_StopBits db ? ; /* 0,1,2 = 1, 1.5, 2 */
+ DCB_RlsTimeout dw ? ; /* Timeout for RLSD to be set */
+ DCB_CtsTimeout dw ? ; /* Timeout for CTS to be set */
+ DCB_DsrTimeout dw ? ; /* Timeout for DSR to be set */
+
+ DCB_BitMask1 db ?
+
+ ; BYTE fBinary: 1; /* Binary Mode (skip EOF check */
+ ; BYTE fRtsDisable:1; /* Don't assert RTS at init time */
+ ; BYTE fParity: 1; /* Enable parity checking */
+ ; BYTE fOutxCtsFlow:1; /* CTS handshaking on output */
+ ; BYTE fOutxDsrFlow:1; /* DSR handshaking on output */
+ ; BYTE fDummy: 2; /* Reserved */
+ ; BYTE fDtrDisable:1; /* Don't assert DTR at init time */
+
+ DCB_BitMask2 db ?
+
+ ; BYTE fOutX: 1; /* Enable output X-ON/X-OFF */
+ ; BYTE fInX: 1; /* Enable input X-ON/X-OFF */
+ ; BYTE fPeChar: 1; /* Enable Parity Err Replacement */
+ ; BYTE fNull: 1; /* Enable Null stripping */
+ ; BYTE fChEvt: 1; /* Enable Rx character event. */
+ ; BYTE fDtrflow: 1; /* DTR handshake on input */
+ ; BYTE fRtsflow: 1; /* RTS handshake on input */
+ ; BYTE fDummy2: 1;
+
+ DCB_XonChar db ? ; /* Tx and Rx X-ON character */
+ DCB_XoffChar db ? ; /* Tx and Rx X-OFF character */
+ DCB_XonLim dw ? ; /* Transmit X-ON threshold */
+ DCB_XoffLim dw ? ; /* Transmit X-OFF threshold */
+ DCB_PeChar db ? ; /* Parity error replacement char */
+ DCB_EofChar db ? ; /* End of Input character */
+ DCB_EvtChar db ? ; /* Recieved Event character */
+ DCB_TxDelay dw ? ; /* Amount of time between chars */
+DCB ends
+
+COMSTAT struc
+ COMS_BitMask1 db ?
+
+; BYTE fCtsHold: 1; /* Transmit is on CTS hold */
+; BYTE fDsrHold: 1; /* Transmit is on DSR hold */
+; BYTE fRlsdHold: 1; /* Transmit is on RLSD hold */
+; BYTE fXoffHold: 1; /* Received handshake */
+; BYTE fXoffSent: 1; /* Issued handshake */
+; BYTE fEof: 1; /* End of file character found */
+; BYTE fTxim: 1; /* Character being transmitted */
+
+
+ COMS_cbInQue dw ? ; /* count of characters in Rx Queue */
+ COMS_cbOutQue dw ? ; /* count of characters in Tx Queue */
+COMSTAT ends
+
+ENDIF ;NOCOM
+
+;
+; Installable Driver Support
+;
+; Driver Messages
+DRV_LOAD = 0001h
+DRV_ENABLE = 0002h
+DRV_OPEN = 0003h
+DRV_CLOSE = 0004h
+DRV_DISABLE = 0005h
+DRV_FREE = 0006h
+DRV_CONFIGURE = 0007h
+DRV_QUERYCONFIGURE = 0008h
+DRV_INSTALL = 0009h
+DRV_REMOVE = 000Ah
+DRV_EXITSESSION = 000Bh
+DRV_POWER = 000Fh
+DRV_RESERVED = 0800h
+DRV_USER = 4000h
+
+;LPARAM of DRV_CONFIGURE message and return values
+DRVCONFIGINFO struc
+ DRVCNF_dwDCISize dw ?
+ DRVCNF_lpszDCISectionName dd ?
+ DRVCNF_lpszDCIAliasName dd ?
+DRVCONFIGINFO ends
+
+DRVCNF_CANCEL = 0000h
+DRVCNF_OK = 0001h
+DRVCNF_RESTART = 0002h
+
+
+IFNDEF NOKERNEL
+;
+; Common Kernel errors
+;
+ERR_GALLOC = 01030h ; GlobalAlloc Failed
+ERR_GREALLOC = 01031h ; GlobalReAlloc Failed
+ERR_GLOCK = 01032h ; GlobalLock Failed
+ERR_LALLOC = 01033h ; LocalAlloc Failed
+ERR_LREALLOC = 01034h ; LocalReAlloc Failed
+ERR_LLOCK = 01035h ; LocalLock Failed
+ERR_ALLOCRES = 01036h ; AllocResource Failed
+ERR_LOCKRES = 01037h ; LockResource Failed
+ERR_LOADMODULE = 01038h ; LoadModule failed
+
+;
+; Common User Errors
+;
+ERR_CREATEDLG = 01045h ; /* Create Dlg failure due to LoadMenu failure */
+ERR_CREATEDLG2 = 01046h ; /* Create Dlg failure due to CreateWindow Failure */
+ERR_REGISTERCLASS = 01047h ; /* RegisterClass failure due to Class already registered */
+ERR_DCBUSY = 01048h ; /* DC Cache is full */
+ERR_CREATEWND = 01049h ; /* Create Wnd failed due to class not found */
+ERR_STRUCEXTRA = 01050h ; /* Unallocated Extra space is used */
+ERR_LOADSTR = 01051h ; /* LoadString() failed */
+ERR_LOADMENU = 01052h ; /* LoadMenu Failed */
+ERR_NESTEDBEGINPAINT = 01053h ; /* Nested BeginPaint() calls */
+ERR_BADINDEX = 01054h ; /* Bad index to Get/Set Class/Window Word/Long */
+ERR_CREATEMENU = 01055h ; /* Error creating menu */
+
+;
+; Common GDI Errors
+;
+ERR_CREATEDC = 01070h ; /* CreateDC/CreateIC etc., failure */
+ERR_CREATEMETA = 01071h ; /* CreateMetafile failure */
+ERR_DELOBJSELECTED = 01072h ; /* Bitmap being deleted is selected into DC */
+ERR_SELBITMAP = 01073h ; /* Bitmap being selected is already selected elsewhere */
+
+ENDIF ;NOKERNEL
diff --git a/private/mvdm/wow16/inc/windowsx.h b/private/mvdm/wow16/inc/windowsx.h
new file mode 100644
index 000000000..a37eb53f6
--- /dev/null
+++ b/private/mvdm/wow16/inc/windowsx.h
@@ -0,0 +1,1112 @@
+/*****************************************************************************\
+* *
+* windowsx.h - Macro APIs, window message crackers, and control APIs *
+* *
+* Version 3.10 *
+* *
+* Copyright (c) 1992, Microsoft Corp. All rights reserved. *
+* *
+\*****************************************************************************/
+
+#ifndef _INC_WINDOWSX
+#define _INC_WINDOWSX
+
+#ifndef RC_INVOKED
+#pragma pack(1) /* Assume byte packing throughout */
+#endif /* RC_INVOKED */
+
+#ifdef __cplusplus
+extern "C" { /* Assume C declarations for C++ */
+#endif /* __cplusplus */
+
+/****** KERNEL Macro APIs ****************************************************/
+
+#define GetInstanceModule(hInstance) \
+ GetModuleHandle((LPCSTR)MAKELP(0, hInstance))
+
+#define GlobalPtrHandle(lp) \
+ ((HGLOBAL)LOWORD(GlobalHandle(SELECTOROF(lp))))
+
+#define GlobalLockPtr(lp) \
+ ((BOOL)SELECTOROF(GlobalLock(GlobalPtrHandle(lp))))
+#define GlobalUnlockPtr(lp) \
+ GlobalUnlock(GlobalPtrHandle(lp))
+
+#define GlobalAllocPtr(flags, cb) \
+ (GlobalLock(GlobalAlloc((flags), (cb))))
+#define GlobalReAllocPtr(lp, cbNew, flags) \
+ (GlobalUnlockPtr(lp), GlobalLock(GlobalReAlloc(GlobalPtrHandle(lp) , (cbNew), (flags))))
+#define GlobalFreePtr(lp) \
+ (GlobalUnlockPtr(lp), (BOOL)GlobalFree(GlobalPtrHandle(lp)))
+
+/****** GDI Macro APIs *******************************************************/
+
+#define DeletePen(hpen) DeleteObject((HGDIOBJ)(HPEN)(hpen))
+#define SelectPen(hdc, hpen) ((HPEN)SelectObject((hdc), (HGDIOBJ)(HPEN)(hpen)))
+#define GetStockPen(i) ((HPEN)GetStockObject(i))
+
+#define DeleteBrush(hbr) DeleteObject((HGDIOBJ)(HBRUSH)(hbr))
+#define SelectBrush(hdc, hbr) ((HBRUSH)SelectObject((hdc), (HGDIOBJ)(HBRUSH)(hbr)))
+#define GetStockBrush(i) ((HBRUSH)GetStockObject(i))
+
+#define DeleteRgn(hrgn) DeleteObject((HGDIOBJ)(HRGN)(hrgn))
+
+#define CopyRgn(hrgnDst, hrgnSrc) CombineRgn(hrgnDst, hrgnSrc, 0, RGN_COPY)
+#define IntersectRgn(hrgnResult, hrgnA, hrgnB) CombineRgn(hrgnResult, hrgnA, hrgnB, RGN_AND)
+#define SubtractRgn(hrgnResult, hrgnA, hrgnB) CombineRgn(hrgnResult, hrgnA, hrgnB, RGN_DIFF)
+#define UnionRgn(hrgnResult, hrgnA, hrgnB) CombineRgn(hrgnResult, hrgnA, hrgnB, RGN_OR)
+#define XorRgn(hrgnResult, hrgnA, hrgnB) CombineRgn(hrgnResult, hrgnA, hrgnB, RGN_XOR)
+
+#define DeletePalette(hpal) DeleteObject((HGDIOBJ)(HPALETTE)(hpal))
+
+#define DeleteFont(hfont) DeleteObject((HGDIOBJ)(HFONT)(hfont))
+#define SelectFont(hdc, hfont) ((HFONT)SelectObject((hdc), (HGDIOBJ)(HFONT)(hfont)))
+#define GetStockFont(i) ((HFONT)GetStockObject(i))
+
+#define DeleteBitmap(hbm) DeleteObject((HGDIOBJ)(HBITMAP)(hbm))
+#define SelectBitmap(hdc, hbm) ((HBITMAP)SelectObject((hdc), (HGDIOBJ)(HBITMAP)(hbm)))
+
+#define InsetRect(lprc, dx, dy) InflateRect((lprc), -(dx), -(dy))
+
+/****** USER Macro APIs ******************************************************/
+
+#define GetWindowInstance(hwnd) ((HINSTANCE)GetWindowWord(hwnd, GWW_HINSTANCE))
+
+#define GetWindowStyle(hwnd) ((DWORD)GetWindowLong(hwnd, GWL_STYLE))
+#define GetWindowExStyle(hwnd) ((DWORD)GetWindowLong(hwnd, GWL_EXSTYLE))
+
+#define GetWindowOwner(hwnd) GetWindow(hwnd, GW_OWNER)
+
+#define GetFirstChild(hwnd) GetTopWindow(hwnd)
+#define GetFirstSibling(hwnd) GetWindow(hwnd, GW_HWNDFIRST)
+#define GetLastSibling(hwnd) GetWindow(hwnd, GW_HWNDLAST)
+#define GetNextSibling(hwnd) GetWindow(hwnd, GW_HWNDNEXT)
+#define GetPrevSibling(hwnd) GetWindow(hwnd, GW_HWNDPREV)
+
+#define GetWindowID(hwnd) GetDlgCtrlID(hwnd)
+
+#define SetWindowRedraw(hwnd, fRedraw) \
+ ((void)SendMessage(hwnd, WM_SETREDRAW, (WPARAM)(BOOL)(fRedraw), 0L))
+
+#define SubclassWindow(hwnd, lpfn) \
+ ((WNDPROC)SetWindowLong((hwnd), GWL_WNDPROC, (LPARAM)(WNDPROC)(lpfn)))
+
+#define IsMinimized(hwnd) IsIconic(hwnd)
+#define IsMaximized(hwnd) IsZoomed(hwnd)
+#define IsRestored(hwnd) ((GetWindowStyle(hwnd) & (WS_MINIMIZE | WS_MAXIMIZE)) == 0L)
+
+#define SetWindowFont(hwnd, hfont, fRedraw) FORWARD_WM_SETFONT((hwnd), (hfont), (fRedraw), SendMessage)
+
+#define GetWindowFont(hwnd) FORWARD_WM_GETFONT((hwnd), SendMessage)
+
+#if (WINVER >= 0x030a)
+#define MapWindowRect(hwndFrom, hwndTo, lprc) \
+ MapWindowPoints((hwndFrom), (hwndTo), (POINT FAR*)(lprc), 2)
+#endif /* WINVER >= 0x030a */
+
+#define IsLButtonDown() (GetKeyState(VK_LBUTTON) < 0)
+#define IsRButtonDown() (GetKeyState(VK_RBUTTON) < 0)
+#define IsMButtonDown() (GetKeyState(VK_MBUTTON) < 0)
+
+#define SubclassDialog(hwndDlg, lpfn) \
+ ((DLGPROC)SetWindowLong(hwndDlg, DWL_DLGPROC, (LPARAM)(DLGPROC)(lpfn)))
+
+#define SetDlgMsgResult(hwnd, msg, result) \
+ (((msg) == WM_CTLCOLOR || (msg) == WM_COMPAREITEM || (msg) == WM_VKEYTOITEM || \
+ (msg) == WM_CHARTOITEM || (msg) == WM_QUERYDRAGICON || (msg) == WM_INITDIALOG) \
+ ? (BOOL)LOWORD(result) : (SetWindowLong((hwnd), DWL_MSGRESULT, (LPARAM)(LRESULT)(result)), TRUE))
+
+#define DefDlgProcEx(hwnd, msg, wParam, lParam, pfRecursion) \
+ (*(pfRecursion) = TRUE, DefDlgProc(hwnd, msg, wParam, lParam))
+
+#define CheckDefDlgRecursion(pfRecursion) \
+ if (*(pfRecursion)) { *(pfRecursion) = FALSE; return FALSE; }
+
+/****** Message crackers ****************************************************/
+
+#define HANDLE_MSG(hwnd, message, fn) \
+ case (message): return HANDLE_##message((hwnd), (wParam), (lParam), (fn))
+
+/* void Cls_OnCompacting(HWND hwnd, UINT compactRatio); */
+#define HANDLE_WM_COMPACTING(hwnd, wParam, lParam, fn) \
+ ((fn)((hwnd), (UINT)(wParam)), 0L)
+#define FORWARD_WM_COMPACTING(hwnd, compactRatio, fn) \
+ (void)(fn)((hwnd), WM_COMPACTING, (WPARAM)(UINT)(compactRatio), 0L)
+
+/* void Cls_OnWinIniChange(HWND hwnd, LPCSTR lpszSectionName); */
+#define HANDLE_WM_WININICHANGE(hwnd, wParam, lParam, fn) \
+ ((fn)((hwnd), (LPCSTR)(lParam)), 0L)
+#define FORWARD_WM_WININICHANGE(hwnd, lpszSectionName, fn) \
+ (void)(fn)((hwnd), WM_WININICHANGE, 0, (LPARAM)(LPCSTR)(lpszSectionName))
+
+/* void Cls_OnSysColorChange(HWND hwnd); */
+#define HANDLE_WM_SYSCOLORCHANGE(hwnd, wParam, lParam, fn) \
+ ((fn)(hwnd), 0L)
+#define FORWARD_WM_SYSCOLORCHANGE(hwnd, fn) \
+ (void)(fn)((hwnd), WM_SYSCOLORCHANGE, 0, 0L)
+
+/* BOOL Cls_OnQueryNewPalette(HWND hwnd); */
+#define HANDLE_WM_QUERYNEWPALETTE(hwnd, wParam, lParam, fn) \
+ MAKELRESULT((BOOL)(fn)(hwnd), 0)
+#define FORWARD_WM_QUERYNEWPALETTE(hwnd, fn) \
+ (BOOL)(DWORD)(fn)((hwnd), WM_QUERYNEWPALETTE, 0, 0L)
+
+/* void Cls_OnPaletteIsChanging(HWND hwnd, HWND hwndPaletteChange); */
+#define HANDLE_WM_PALETTEISCHANGING(hwnd, wParam, lParam, fn) \
+ ((fn)((hwnd), (HWND)(wParam)), 0L)
+#define FORWARD_WM_PALETTEISCHANGING(hwnd, hwndPaletteChange, fn) \
+ (void)(fn)((hwnd), WM_PALETTEISCHANGING, (WPARAM)(HWND)(hwndPaletteChange), 0L)
+
+/* void Cls_OnPaletteChanged(HWND hwnd, HWND hwndPaletteChange); */
+#define HANDLE_WM_PALETTECHANGED(hwnd, wParam, lParam, fn) \
+ ((fn)((hwnd), (HWND)(wParam)), 0L)
+#define FORWARD_WM_PALETTECHANGED(hwnd, hwndPaletteChange, fn) \
+ (void)(fn)((hwnd), WM_PALETTECHANGED, (WPARAM)(HWND)(hwndPaletteChange), 0L)
+
+/* void Cls_OnFontChange(HWND hwnd); */
+#define HANDLE_WM_FONTCHANGE(hwnd, wParam, lParam, fn) \
+ ((fn)(hwnd), 0L)
+#define FORWARD_WM_FONTCHANGE(hwnd, fn) \
+ (void)(fn)((hwnd), WM_FONTCHANGE, 0, 0L)
+
+/* void Cls_OnSpoolerStatus(HWND hwnd, UINT status, int cJobInQueue); */
+#define HANDLE_WM_SPOOLERSTATUS(hwnd, wParam, lParam, fn) \
+ ((fn)((hwnd), (UINT)(wParam), (int)LOWORD(lParam)), 0L)
+#define FORWARD_WM_SPOOLERSTATUS(hwnd, status, cJobInQueue, fn) \
+ (void)(fn)((hwnd), WM_SPOOLERSTATUS, (WPARAM)(status), MAKELPARAM((UINT)(cJobInQueue), 0))
+
+/* void Cls_OnDevModeChange(HWND hwnd, LPCSTR lpszDeviceName); */
+#define HANDLE_WM_DEVMODECHANGE(hwnd, wParam, lParam, fn) \
+ ((fn)((hwnd), (LPCSTR)(lParam)), 0L)
+#define FORWARD_WM_DEVMODECHANGE(hwnd, lpszDeviceName, fn) \
+ (void)(fn)((hwnd), WM_DEVMODECHANGE, 0,(LPARAM)(LPCSTR)(lpszDeviceName))
+
+/* void Cls_OnTimeChange(HWND hwnd); */
+#define HANDLE_WM_TIMECHANGE(hwnd, wParam, lParam, fn) \
+ ((fn)(hwnd), 0L)
+#define FORWARD_WM_TIMECHANGE(hwnd, fn) \
+ (void)(fn)((hwnd), WM_TIMECHANGE, 0, 0L)
+
+/* void Cls_OnPower(HWND hwnd, int code); */
+#define HANDLE_WM_POWER(hwnd, wParam, lParam, fn) \
+ ((fn)((hwnd), (int)(wParam)), 0L)
+#define FORWARD_WM_POWER(hwnd, code, fn) \
+ (void)(fn)((hwnd), WM_POWER, (WPARAM)(code), 0L)
+
+/* BOOL Cls_OnQueryEndSession(HWND hwnd); */
+#define HANDLE_WM_QUERYENDSESSION(hwnd, wParam, lParam, fn) \
+ MAKELRESULT((BOOL)(fn)(hwnd), 0)
+#define FORWARD_WM_QUERYENDSESSION(hwnd, fn) \
+ (BOOL)(DWORD)(fn)((hwnd), WM_QUERYENDSESSION, 0, 0L)
+
+/* void Cls_OnEndSession(HWND hwnd, BOOL fEnding); */
+#define HANDLE_WM_ENDSESSION(hwnd, wParam, lParam, fn) \
+ ((fn)((hwnd), (BOOL)(wParam)), 0L)
+#define FORWARD_WM_ENDSESSION(hwnd, fEnding, fn) \
+ (void)(fn)((hwnd), WM_ENDSESSION, (WPARAM)(BOOL)(fEnding), 0L)
+
+/* void Cls_OnQuit(HWND hwnd, int exitCode); */
+#define HANDLE_WM_QUIT(hwnd, wParam, lParam, fn) \
+ ((fn)((hwnd), (int)(wParam)), 0L)
+#define FORWARD_WM_QUIT(hwnd, exitCode, fn) \
+ (void)(fn)((hwnd), WM_QUIT, (WPARAM)(exitCode), 0L)
+
+/* void Cls_OnSystemError(HWND hwnd, int errCode); */
+#define HANDLE_WM_SYSTEMERROR(hwnd, wParam, lParam, fn) \
+ ((fn)((hwnd), (int)(wParam)), 0L)
+#define FORWARD_WM_SYSTEMERROR(hwnd, errCode, fn) \
+ (void)(fn)((hwnd), WM_SYSTEMERROR, (WPARAM)(errCode), 0L)
+
+/* BOOL Cls_OnCreate(HWND hwnd, CREATESTRUCT FAR* lpCreateStruct) */
+#define HANDLE_WM_CREATE(hwnd, wParam, lParam, fn) \
+ ((fn)((hwnd), (CREATESTRUCT FAR*)(lParam)) ? 0L : (LRESULT)-1L)
+#define FORWARD_WM_CREATE(hwnd, lpCreateStruct, fn) \
+ (BOOL)(DWORD)(fn)((hwnd), WM_CREATE, 0, (LPARAM)(CREATESTRUCT FAR*)(lpCreateStruct))
+
+/* BOOL Cls_OnNCCreate(HWND hwnd, CREATESTRUCT FAR* lpCreateStruct) */
+#define HANDLE_WM_NCCREATE(hwnd, wParam, lParam, fn) \
+ (LRESULT)(DWORD)(BOOL)(fn)((hwnd), (CREATESTRUCT FAR*)(lParam))
+#define FORWARD_WM_NCCREATE(hwnd, lpCreateStruct, fn) \
+ (BOOL)(DWORD)(fn)((hwnd), WM_NCCREATE, 0, (LPARAM)(CREATESTRUCT FAR*)(lpCreateStruct))
+
+/* void Cls_OnDestroy(HWND hwnd); */
+#define HANDLE_WM_DESTROY(hwnd, wParam, lParam, fn) \
+ ((fn)(hwnd), 0L)
+#define FORWARD_WM_DESTROY(hwnd, fn) \
+ (void)(fn)((hwnd), WM_DESTROY, 0, 0L)
+
+/* void Cls_OnNCDestroy(HWND hwnd); */
+#define HANDLE_WM_NCDESTROY(hwnd, wParam, lParam, fn) \
+ ((fn)(hwnd), 0L)
+#define FORWARD_WM_NCDESTROY(hwnd, fn) \
+ (void)(fn)((hwnd), WM_NCDESTROY, 0, 0L)
+
+/* void Cls_OnShowWindow(HWND hwnd, BOOL fShow, UINT status); */
+#define HANDLE_WM_SHOWWINDOW(hwnd, wParam, lParam, fn) \
+ ((fn)((hwnd), (BOOL)(wParam), LOWORD(lParam)), 0L)
+#define FORWARD_WM_SHOWWINDOW(hwnd, fShow, status, fn) \
+ (void)(fn)((hwnd), WM_SHOWWINDOW, (WPARAM)(BOOL)(fShow), MAKELPARAM((UINT)(status), 0))
+
+/* void Cls_OnSetRedraw(HWND hwnd, BOOL fRedraw); */
+#define HANDLE_WM_SETREDRAW(hwnd, wParam, lParam, fn) \
+ ((fn)((hwnd), (BOOL)(wParam)), 0L)
+#define FORWARD_WM_SETREDRAW(hwnd, fRedraw, fn) \
+ (void)(fn)((hwnd), WM_SETREDRAW, (WPARAM)(fRedraw), 0L)
+
+/* void Cls_OnEnable(HWND hwnd, BOOL fEnable); */
+#define HANDLE_WM_ENABLE(hwnd, wParam, lParam, fn) \
+ ((fn)((hwnd), (BOOL)(wParam)), 0L)
+#define FORWARD_WM_ENABLE(hwnd, fEnable, fn) \
+ (void)(fn)((hwnd), WM_ENABLE, (WPARAM)(BOOL)(fEnable), 0L)
+
+/* void Cls_OnSetText(HWND hwnd, LPCSTR lpszText); */
+#define HANDLE_WM_SETTEXT(hwnd, wParam, lParam, fn) \
+ ((fn)((hwnd), (LPCSTR)(lParam)), 0L)
+#define FORWARD_WM_SETTEXT(hwnd, lpszText, fn) \
+ (void)(fn)((hwnd), WM_SETTEXT, 0, (LPARAM)(LPCSTR)(lpszText))
+
+/* INT Cls_OnGetText(HWND hwnd, int cchTextMax, LPSTR lpszText) */
+#define HANDLE_WM_GETTEXT(hwnd, wParam, lParam, fn) \
+ (LRESULT)(DWORD)(int)(fn)((hwnd), (int)(wParam), (LPSTR)(lParam))
+#define FORWARD_WM_GETTEXT(hwnd, cchTextMax, lpszText, fn) \
+ (int)(DWORD)(fn)((hwnd), WM_GETTEXT, (WPARAM)(int)(cchTextMax), (LPARAM)(LPSTR)(lpszText))
+
+/* INT Cls_OnGetTextLength(HWND hwnd); */
+#define HANDLE_WM_GETTEXTLENGTH(hwnd, wParam, lParam, fn) \
+ (LRESULT)(DWORD)(int)(fn)(hwnd)
+#define FORWARD_WM_GETTEXTLENGTH(hwnd, fn) \
+ (int)(DWORD)(fn)((hwnd), WM_GETTEXTLENGTH, 0, 0L)
+
+/* BOOL Cls_OnWindowPosChanging(HWND hwnd, WINDOWPOS FAR* lpwpos); */
+#define HANDLE_WM_WINDOWPOSCHANGING(hwnd, wParam, lParam, fn) \
+ (LRESULT)(DWORD)(BOOL)(fn)((hwnd), (WINDOWPOS FAR*)(lParam))
+#define FORWARD_WM_WINDOWPOSCHANGING(hwnd, lpwpos, fn) \
+ (BOOL)(DWORD)(fn)((hwnd), WM_WINDOWPOSCHANGING, 0, (LPARAM)(WINDOWPOS FAR*)(lpwpos))
+
+/* void Cls_OnWindowPosChanged(HWND hwnd, const WINDOWPOS FAR* lpwpos); */
+#define HANDLE_WM_WINDOWPOSCHANGED(hwnd, wParam, lParam, fn) \
+ ((fn)((hwnd), (const WINDOWPOS FAR*)(lParam)), 0L)
+#define FORWARD_WM_WINDOWPOSCHANGED(hwnd, lpwpos, fn) \
+ (void)(fn)((hwnd), WM_WINDOWPOSCHANGED, 0, (LPARAM)(const WINDOWPOS FAR*)(lpwpos))
+
+/* void Cls_OnMove(HWND hwnd, int x, int y); */
+#define HANDLE_WM_MOVE(hwnd, wParam, lParam, fn) \
+ ((fn)((hwnd), (int)LOWORD(lParam), (int)HIWORD(lParam)), 0L)
+#define FORWARD_WM_MOVE(hwnd, x, y, fn) \
+ (void)(fn)((hwnd), WM_MOVE, 0, MAKELPARAM((int)(x), (int)(y)))
+
+/* void Cls_OnSize(HWND hwnd, UINT state, int cx, int cy); */
+#define HANDLE_WM_SIZE(hwnd, wParam, lParam, fn) \
+ ((fn)((hwnd), (UINT)(wParam), (int)LOWORD(lParam), (int)HIWORD(lParam)), 0L)
+#define FORWARD_WM_SIZE(hwnd, state, cx, cy, fn) \
+ (void)(fn)((hwnd), WM_SIZE, (WPARAM)(UINT)(state), MAKELPARAM((int)(cx), (int)(cy)))
+
+/* void Cls_OnClose(HWND hwnd); */
+#define HANDLE_WM_CLOSE(hwnd, wParam, lParam, fn) \
+ ((fn)(hwnd), 0L)
+#define FORWARD_WM_CLOSE(hwnd, fn) \
+ (void)(fn)((hwnd), WM_CLOSE, 0, 0L)
+
+/* BOOL Cls_OnQueryOpen(HWND hwnd); */
+#define HANDLE_WM_QUERYOPEN(hwnd, wParam, lParam, fn) \
+ MAKELRESULT((BOOL)(fn)(hwnd), 0)
+#define FORWARD_WM_QUERYOPEN(hwnd, fn) \
+ (BOOL)(DWORD)(fn)((hwnd), WM_QUERYOPEN, 0, 0L)
+
+/* void Cls_OnGetMinMaxInfo(HWND hwnd, MINMAXINFO FAR* lpMinMaxInfo); */
+#define HANDLE_WM_GETMINMAXINFO(hwnd, wParam, lParam, fn) \
+ ((fn)((hwnd), (MINMAXINFO FAR*)(lParam)), 0L)
+#define FORWARD_WM_GETMINMAXINFO(hwnd, lpMinMaxInfo, fn) \
+ (void)(fn)((hwnd), WM_GETMINMAXINFO, 0, (LPARAM)(MINMAXINFO FAR*)(lpMinMaxInfo))
+
+/* void Cls_OnPaint(HWND hwnd); */
+#define HANDLE_WM_PAINT(hwnd, wParam, lParam, fn) \
+ ((fn)(hwnd), 0L)
+#define FORWARD_WM_PAINT(hwnd, fn) \
+ (void)(fn)((hwnd), WM_PAINT, 0, 0L)
+
+/* BOOL Cls_OnEraseBkgnd(HWND hwnd, HDC hdc); */
+#define HANDLE_WM_ERASEBKGND(hwnd, wParam, lParam, fn) \
+ (LRESULT)(DWORD)(BOOL)(fn)((hwnd), (HDC)(wParam))
+#define FORWARD_WM_ERASEBKGND(hwnd, hdc, fn) \
+ (BOOL)(DWORD)(fn)((hwnd), WM_ERASEBKGND, (WPARAM)(HDC)(hdc), 0L)
+
+/* BOOL Cls_OnIconEraseBkgnd(HWND hwnd, HDC hdc); */
+#define HANDLE_WM_ICONERASEBKGND(hwnd, wParam, lParam, fn) \
+ (LRESULT)(DWORD)(BOOL)(fn)((hwnd), (HDC)(wParam))
+#define FORWARD_WM_ICONERASEBKGND(hwnd, hdc, fn) \
+ (BOOL)(DWORD)(fn)((hwnd), WM_ICONERASEBKGND, (WPARAM)(HDC)(hdc), 0L)
+
+/* void Cls_OnNCPaint(HWND hwnd, HRGN hrgn); */
+#define HANDLE_WM_NCPAINT(hwnd, wParam, lParam, fn) \
+ ((fn)((hwnd), (HRGN)(wParam)), 0L)
+#define FORWARD_WM_NCPAINT(hwnd, hrgn, fn) \
+ (void)(fn)((hwnd), WM_NCPAINT, (WPARAM)(HRGN)(hrgn), 0L)
+
+/* UINT Cls_OnNCCalcSize(HWND hwnd, BOOL fCalcValidRects, NCCALCSIZE_PARAMS FAR* lpcsp) */
+#define HANDLE_WM_NCCALCSIZE(hwnd, wParam, lParam, fn) \
+ (LRESULT)(DWORD)(UINT)(fn)((hwnd), (BOOL)(wParam), (NCCALCSIZE_PARAMS FAR*)(lParam))
+#define FORWARD_WM_NCCALCSIZE(hwnd, fCalcValidRects, lpcsp, fn) \
+ (UINT)(DWORD)(fn)((hwnd), WM_NCCALCSIZE, (WPARAM)(fCalcValidRects), (LPARAM)(NCCALCSIZE_PARAMS FAR*)(lpcsp))
+
+/* UINT Cls_OnNCHitTest(HWND hwnd, int x, int y); */
+#define HANDLE_WM_NCHITTEST(hwnd, wParam, lParam, fn) \
+ (LRESULT)(DWORD)(UINT)(fn)((hwnd), (int)LOWORD(lParam), (int)HIWORD(lParam))
+#define FORWARD_WM_NCHITTEST(hwnd, x, y, fn) \
+ (UINT)(DWORD)(fn)((hwnd), WM_NCHITTEST, 0, MAKELPARAM((int)(x), (int)(y)))
+
+/* HICON Cls_OnQueryDragIcon(HWND hwnd); */
+#define HANDLE_WM_QUERYDRAGICON(hwnd, wParam, lParam, fn) \
+ (LRESULT)(DWORD)(UINT)(fn)(hwnd)
+#define FORWARD_WM_QUERYDRAGICON(hwnd, fn) \
+ (HICON)(UINT)(DWORD)(fn)((hwnd), WM_QUERYDRAGICON, 0, 0L)
+
+#ifdef _INC_SHELLAPI
+/* void Cls_OnDropFiles(HWND hwnd, HDROP hdrop); */
+#define HANDLE_WM_DROPFILES(hwnd, wParam, lParam, fn) \
+ ((fn)((hwnd), (HDROP)(wParam)), 0L)
+#define FORWARD_WM_DROPFILES(hwnd, hdrop, fn) \
+ (void)(fn)((hwnd), WM_DROPFILES, (WPARAM)(hdrop), 0L)
+#endif /* _INC_SHELLAPI */
+
+/* void Cls_OnActivate(HWND hwnd, UINT state, HWND hwndActDeact, BOOL fMinimized); */
+#define HANDLE_WM_ACTIVATE(hwnd, wParam, lParam, fn) \
+ ((fn)((hwnd), (UINT)(wParam), (HWND)LOWORD(lParam), (BOOL)HIWORD(lParam)), 0L)
+#define FORWARD_WM_ACTIVATE(hwnd, state, hwndActDeact, fMinimized, fn) \
+ (void)(fn)((hwnd), WM_ACTIVATE, (WPARAM)(UINT)(state), MAKELPARAM((UINT)(HWND)(hwndActDeact), (UINT)(BOOL)(fMinimized)))
+
+/* void Cls_OnActivateApp(HWND hwnd, BOOL fActivate, HTASK htaskActDeact); */
+#define HANDLE_WM_ACTIVATEAPP(hwnd, wParam, lParam, fn) \
+ ((fn)((hwnd), (BOOL)(wParam), (HTASK)LOWORD(lParam)), 0L)
+#define FORWARD_WM_ACTIVATEAPP(hwnd, fActivate, htaskActDeact, fn) \
+ (void)(fn)((hwnd), WM_ACTIVATEAPP, (WPARAM)(BOOL)(fActivate), MAKELPARAM((htaskActDeact),0))
+
+/* BOOL Cls_OnNCActivate(HWND hwnd, BOOL fActive, HWND hwndActDeact, BOOL fMinimized); */
+#define HANDLE_WM_NCACTIVATE(hwnd, wParam, lParam, fn) \
+ (LRESULT)(DWORD)(BOOL)(fn)((hwnd), (BOOL)(wParam), (HWND)LOWORD(lParam), (BOOL)HIWORD(lParam))
+#define FORWARD_WM_NCACTIVATE(hwnd, fActive, hwndActDeact, fMinimized, fn) \
+ (BOOL)(DWORD)(fn)((hwnd), WM_NCACTIVATE, (WPARAM)(BOOL)(fActive), MAKELPARAM((UINT)(HWND)(hwndActDeact), (UINT)(BOOL)(fMinimized)))
+
+/* void Cls_OnSetFocus(HWND hwnd, HWND hwndOldFocus) */
+#define HANDLE_WM_SETFOCUS(hwnd, wParam, lParam, fn) \
+ ((fn)((hwnd), (HWND)(wParam)), 0L)
+#define FORWARD_WM_SETFOCUS(hwnd, hwndOldFocus, fn) \
+ (void)(fn)((hwnd), WM_SETFOCUS, (WPARAM)(HWND)(hwndOldFocus), 0L)
+
+/* void Cls_OnKillFocus(HWND hwnd, HWND hwndNewFocus); */
+#define HANDLE_WM_KILLFOCUS(hwnd, wParam, lParam, fn) \
+ ((fn)((hwnd), (HWND)(wParam)), 0L)
+#define FORWARD_WM_KILLFOCUS(hwnd, hwndNewFocus, fn) \
+ (void)(fn)((hwnd), WM_KILLFOCUS, (WPARAM)(HWND)(hwndNewFocus), 0L)
+
+/* void Cls_OnKey(HWND hwnd, UINT vk, BOOL fDown, int cRepeat, UINT flags); */
+#define HANDLE_WM_KEYDOWN(hwnd, wParam, lParam, fn) \
+ ((fn)((hwnd), (UINT)(wParam), TRUE, (int)LOWORD(lParam), (UINT)HIWORD(lParam)), 0L)
+#define FORWARD_WM_KEYDOWN(hwnd, vk, cRepeat, flags, fn) \
+ (void)(fn)((hwnd), WM_KEYDOWN, (WPARAM)(UINT)(vk), MAKELPARAM((UINT)(cRepeat), (UINT)(flags)))
+
+/* void Cls_OnKey(HWND hwnd, UINT vk, BOOL fDown, int cRepeat, UINT flags); */
+#define HANDLE_WM_KEYUP(hwnd, wParam, lParam, fn) \
+ ((fn)((hwnd), (UINT)(wParam), FALSE, (int)LOWORD(lParam), (UINT)HIWORD(lParam)), 0L)
+#define FORWARD_WM_KEYUP(hwnd, vk, cRepeat, flags, fn) \
+ (void)(fn)((hwnd), WM_KEYUP, (WPARAM)(UINT)(vk), MAKELPARAM((UINT)(cRepeat), (UINT)(flags)))
+
+/* void Cls_OnChar(HWND hwnd, UINT ch, int cRepeat); */
+#define HANDLE_WM_CHAR(hwnd, wParam, lParam, fn) \
+ ((fn)((hwnd), (UINT)(wParam), (int)LOWORD(lParam)), 0L)
+#define FORWARD_WM_CHAR(hwnd, ch, cRepeat, fn) \
+ (void)(fn)((hwnd), WM_CHAR, (WPARAM)(UINT)(ch), MAKELPARAM((UINT)(cRepeat),0))
+
+/* void Cls_OnDeadChar(HWND hwnd, UINT ch, int cRepeat); */
+#define HANDLE_WM_DEADCHAR(hwnd, wParam, lParam, fn) \
+ ((fn)((hwnd), (UINT)(wParam), (int)LOWORD(lParam)), 0L)
+#define FORWARD_WM_DEADCHAR(hwnd, ch, cRepeat, fn) \
+ (void)(fn)((hwnd), WM_DEADCHAR, (WPARAM)(UINT)(ch), MAKELPARAM((UINT)(cRepeat),0))
+
+/* void Cls_OnSysKey(HWND hwnd, UINT vk, BOOL fDown, int cRepeat, UINT flags); */
+#define HANDLE_WM_SYSKEYDOWN(hwnd, wParam, lParam, fn) \
+ ((fn)((hwnd), (UINT)(wParam), TRUE, (int)LOWORD(lParam), (UINT)HIWORD(lParam)), 0L)
+#define FORWARD_WM_SYSKEYDOWN(hwnd, vk, cRepeat, flags, fn) \
+ (void)(fn)((hwnd), WM_SYSKEYDOWN, (WPARAM)(UINT)(vk), MAKELPARAM((UINT)(cRepeat), (UINT)(flags)))
+
+/* void Cls_OnSysKey(HWND hwnd, UINT vk, BOOL fDown, int cRepeat, UINT flags); */
+#define HANDLE_WM_SYSKEYUP(hwnd, wParam, lParam, fn) \
+ ((fn)((hwnd), (UINT)(wParam), FALSE, (int)LOWORD(lParam), (UINT)HIWORD(lParam)), 0L)
+#define FORWARD_WM_SYSKEYUP(hwnd, vk, cRepeat, flags, fn) \
+ (void)(fn)((hwnd), WM_SYSKEYUP, (WPARAM)(UINT)(vk), MAKELPARAM((UINT)(cRepeat), (UINT)(flags)))
+
+/* void Cls_OnSysChar(HWND hwnd, UINT ch, int cRepeat); */
+#define HANDLE_WM_SYSCHAR(hwnd, wParam, lParam, fn) \
+ ((fn)((hwnd), (UINT)(wParam), (int)LOWORD(lParam)), 0L)
+#define FORWARD_WM_SYSCHAR(hwnd, ch, cRepeat, fn) \
+ (void)(fn)((hwnd), WM_SYSCHAR, (WPARAM)(UINT)(ch), MAKELPARAM((UINT)(cRepeat), 0))
+
+/* void Cls_OnSysDeadChar(HWND hwnd, UINT ch, int cRepeat); */
+#define HANDLE_WM_SYSDEADCHAR(hwnd, wParam, lParam, fn) \
+ ((fn)((hwnd), (UINT)(wParam), (int)LOWORD(lParam)), 0L)
+#define FORWARD_WM_SYSDEADCHAR(hwnd, ch, cRepeat, fn) \
+ (void)(fn)((hwnd), WM_SYSDEADCHAR, (WPARAM)(UINT)(ch), MAKELPARAM((UINT)(cRepeat), 0))
+
+/* void Cls_OnMouseMove(HWND hwnd, int x, int y, UINT keyFlags); */
+#define HANDLE_WM_MOUSEMOVE(hwnd, wParam, lParam, fn) \
+ ((fn)((hwnd), (int)LOWORD(lParam), (int)HIWORD(lParam), (UINT)(wParam)), 0L)
+#define FORWARD_WM_MOUSEMOVE(hwnd, x, y, keyFlags, fn) \
+ (void)(fn)((hwnd), WM_MOUSEMOVE, (WPARAM)(UINT)(keyFlags), MAKELPARAM((x), (y)))
+
+/* void Cls_OnLButtonDown(HWND hwnd, BOOL fDoubleClick, int x, int y, UINT keyFlags); */
+#define HANDLE_WM_LBUTTONDOWN(hwnd, wParam, lParam, fn) \
+ ((fn)((hwnd), FALSE, (int)LOWORD(lParam), (int)HIWORD(lParam), (UINT)(wParam)), 0L)
+#define FORWARD_WM_LBUTTONDOWN(hwnd, fDoubleClick, x, y, keyFlags, fn) \
+ (void)(fn)((hwnd), (fDoubleClick) ? WM_LBUTTONDBLCLK : WM_LBUTTONDOWN, (WPARAM)(UINT)(keyFlags), MAKELPARAM((x), (y)))
+
+/* void Cls_OnLButtonDown(HWND hwnd, BOOL fDoubleClick, int x, int y, UINT keyFlags); */
+#define HANDLE_WM_LBUTTONDBLCLK(hwnd, wParam, lParam, fn) \
+ ((fn)((hwnd), TRUE, (int)LOWORD(lParam), (int)HIWORD(lParam), (UINT)(wParam)), 0L)
+
+/* void Cls_OnLButtonUp(HWND hwnd, int x, int y, UINT keyFlags); */
+#define HANDLE_WM_LBUTTONUP(hwnd, wParam, lParam, fn) \
+ ((fn)((hwnd), (int)LOWORD(lParam), (int)HIWORD(lParam), (UINT)(wParam)), 0L)
+#define FORWARD_WM_LBUTTONUP(hwnd, x, y, keyFlags, fn) \
+ (void)(fn)((hwnd), WM_LBUTTONUP, (WPARAM)(UINT)(keyFlags), MAKELPARAM((x), (y)))
+
+/* void Cls_OnRButtonDown(HWND hwnd, BOOL fDoubleClick, int x, int y, UINT keyFlags); */
+#define HANDLE_WM_RBUTTONDOWN(hwnd, wParam, lParam, fn) \
+ ((fn)((hwnd), FALSE, (int)LOWORD(lParam), (int)HIWORD(lParam), (UINT)(wParam)), 0L)
+#define FORWARD_WM_RBUTTONDOWN(hwnd, fDoubleClick, x, y, keyFlags, fn) \
+ (void)(fn)((hwnd), (fDoubleClick) ? WM_RBUTTONDBLCLK : WM_RBUTTONDOWN, (WPARAM)(UINT)(keyFlags), MAKELPARAM((x), (y)))
+
+/* void Cls_OnRButtonDown(HWND hwnd, BOOL fDoubleClick, int x, int y, UINT keyFlags); */
+#define HANDLE_WM_RBUTTONDBLCLK(hwnd, wParam, lParam, fn) \
+ ((fn)((hwnd), TRUE, (int)LOWORD(lParam), (int)HIWORD(lParam), (UINT)(wParam)), 0L)
+
+/* void Cls_OnRButtonUp(HWND hwnd, int x, int y, UINT flags); */
+#define HANDLE_WM_RBUTTONUP(hwnd, wParam, lParam, fn) \
+ ((fn)((hwnd), (int)LOWORD(lParam), (int)HIWORD(lParam), (UINT)(wParam)), 0L)
+#define FORWARD_WM_RBUTTONUP(hwnd, x, y, keyFlags, fn) \
+ (void)(fn)((hwnd), WM_RBUTTONUP, (WPARAM)(UINT)(keyFlags), MAKELPARAM((x), (y)))
+
+/* void Cls_OnMButtonDown(HWND hwnd, BOOL fDoubleClick, int x, int y, UINT keyFlags); */
+#define HANDLE_WM_MBUTTONDOWN(hwnd, wParam, lParam, fn) \
+ ((fn)((hwnd), FALSE, (int)LOWORD(lParam), (int)HIWORD(lParam), (UINT)(wParam)), 0L)
+#define FORWARD_WM_MBUTTONDOWN(hwnd, fDoubleClick, x, y, keyFlags, fn) \
+ (void)(fn)((hwnd), (fDoubleClick) ? WM_MBUTTONDBLCLK : WM_MBUTTONDOWN, (WPARAM)(UINT)(keyFlags), MAKELPARAM((x), (y)))
+
+/* void Cls_OnMButtonDown(HWND hwnd, BOOL fDoubleClick, int x, int y, UINT keyFlags); */
+#define HANDLE_WM_MBUTTONDBLCLK(hwnd, wParam, lParam, fn) \
+ ((fn)((hwnd), TRUE, (int)LOWORD(lParam), (int)HIWORD(lParam), (UINT)(wParam)), 0L)
+
+/* void Cls_OnMButtonUp(HWND hwnd, int x, int y, UINT flags); */
+#define HANDLE_WM_MBUTTONUP(hwnd, wParam, lParam, fn) \
+ ((fn)((hwnd), (int)LOWORD(lParam), (int)HIWORD(lParam), (UINT)(wParam)), 0L)
+#define FORWARD_WM_MBUTTONUP(hwnd, x, y, keyFlags, fn) \
+ (void)(fn)((hwnd), WM_MBUTTONUP, (WPARAM)(UINT)(keyFlags), MAKELPARAM((x), (y)))
+
+/* void Cls_OnNCMouseMove(HWND hwnd, int x, int y, UINT codeHitTest); */
+#define HANDLE_WM_NCMOUSEMOVE(hwnd, wParam, lParam, fn) \
+ ((fn)((hwnd), (int)LOWORD(lParam), (int)HIWORD(lParam), (UINT)(wParam)), 0L)
+#define FORWARD_WM_NCMOUSEMOVE(hwnd, x, y, codeHitTest, fn) \
+ (void)(fn)((hwnd), WM_NCMOUSEMOVE, (WPARAM)(UINT)(codeHitTest), MAKELPARAM((x), (y)))
+
+/* void Cls_OnNCLButtonDown(HWND hwnd, BOOL fDoubleClick, int x, int y, UINT codeHitTest); */
+#define HANDLE_WM_NCLBUTTONDOWN(hwnd, wParam, lParam, fn) \
+ ((fn)((hwnd), FALSE, (int)LOWORD(lParam), (int)HIWORD(lParam), (UINT)(wParam)), 0L)
+#define FORWARD_WM_NCLBUTTONDOWN(hwnd, fDoubleClick, x, y, codeHitTest, fn) \
+ (void)(fn)((hwnd), (fDoubleClick) ? WM_NCLBUTTONDBLCLK : WM_NCLBUTTONDOWN, (WPARAM)(UINT)(codeHitTest), MAKELPARAM((x), (y)))
+
+/* void Cls_OnNCLButtonDown(HWND hwnd, BOOL fDoubleClick, int x, int y, UINT codeHitTest); */
+#define HANDLE_WM_NCLBUTTONDBLCLK(hwnd, wParam, lParam, fn) \
+ ((fn)((hwnd), TRUE, (int)LOWORD(lParam), (int)HIWORD(lParam), (UINT)(wParam)), 0L)
+
+/* void Cls_OnNCLButtonUp(HWND hwnd, int x, int y, UINT codeHitTest); */
+#define HANDLE_WM_NCLBUTTONUP(hwnd, wParam, lParam, fn) \
+ ((fn)((hwnd), (int)LOWORD(lParam), (int)HIWORD(lParam), (UINT)(wParam)), 0L)
+#define FORWARD_WM_NCLBUTTONUP(hwnd, x, y, codeHitTest, fn) \
+ (void)(fn)((hwnd), WM_NCLBUTTONUP, (WPARAM)(UINT)(codeHitTest), MAKELPARAM((x), (y)) )
+
+/* void Cls_OnNCRButtonDown(HWND hwnd, BOOL fDoubleClick, int x, int y, UINT codeHitTest); */
+#define HANDLE_WM_NCRBUTTONDOWN(hwnd, wParam, lParam, fn) \
+ ((fn)((hwnd), FALSE, (int)LOWORD(lParam), (int)HIWORD(lParam), (UINT)(wParam)), 0L)
+#define FORWARD_WM_NCRBUTTONDOWN(hwnd, fDoubleClick, x, y, codeHitTest, fn) \
+ (void)(fn)((hwnd), (fDoubleClick) ? WM_NCRBUTTONDBLCLK : WM_NCRBUTTONDOWN, (WPARAM)(UINT)(codeHitTest), MAKELPARAM((x), (y)) )
+
+/* void Cls_OnNCRButtonDown(HWND hwnd, BOOL fDoubleClick, int x, int y, UINT codeHitTest); */
+#define HANDLE_WM_NCRBUTTONDBLCLK(hwnd, wParam, lParam, fn) \
+ ((fn)((hwnd), TRUE, (int)LOWORD(lParam), (int)HIWORD(lParam), (UINT)(wParam)), 0L)
+
+/* void Cls_OnNCRButtonUp(HWND hwnd, int x, int y, UINT codeHitTest); */
+#define HANDLE_WM_NCRBUTTONUP(hwnd, wParam, lParam, fn) \
+ ((fn)((hwnd), (int)LOWORD(lParam), (int)HIWORD(lParam), (UINT)(wParam)), 0L)
+#define FORWARD_WM_NCRBUTTONUP(hwnd, x, y, codeHitTest, fn) \
+ (void)(fn)((hwnd), WM_NCRBUTTONUP, (WPARAM)(UINT)(codeHitTest), MAKELPARAM((x), (y)) )
+
+/* void Cls_OnNCMButtonDown(HWND hwnd, BOOL fDoubleClick, int x, int y, UINT codeHitTest); */
+#define HANDLE_WM_NCMBUTTONDOWN(hwnd, wParam, lParam, fn) \
+ ((fn)((hwnd), FALSE, (int)LOWORD(lParam), (int)HIWORD(lParam), (UINT)(wParam)), 0L)
+#define FORWARD_WM_NCMBUTTONDOWN(hwnd, fDoubleClick, x, y, codeHitTest, fn) \
+ (void)(fn)((hwnd), (fDoubleClick) ? WM_NCMBUTTONDBLCLK : WM_NCMBUTTONDOWN, (WPARAM)(UINT)(codeHitTest), MAKELPARAM((x), (y)) )
+
+/* void Cls_OnNCMButtonDown(HWND hwnd, BOOL fDoubleClick, int x, int y, UINT codeHitTest); */
+#define HANDLE_WM_NCMBUTTONDBLCLK(hwnd, wParam, lParam, fn) \
+ ((fn)((hwnd), TRUE, (int)LOWORD(lParam), (int)HIWORD(lParam), (UINT)(wParam)), 0L)
+
+/* void Cls_OnNCMButtonUp(HWND hwnd, int x, int y, UINT codeHitTest); */
+#define HANDLE_WM_NCMBUTTONUP(hwnd, wParam, lParam, fn) \
+ ((fn)((hwnd), (int)LOWORD(lParam), (int)HIWORD(lParam), (UINT)(wParam)), 0L)
+#define FORWARD_WM_NCMBUTTONUP(hwnd, x, y, codeHitTest, fn) \
+ (void)(fn)((hwnd), WM_NCMBUTTONUP, (WPARAM)(UINT)(codeHitTest), MAKELPARAM((x), (y)) )
+
+/* int Cls_OnMouseActivate(HWND hwnd, HWND hwndTopLevel, UINT codeHitTest, UINT msg); */
+#define HANDLE_WM_MOUSEACTIVATE(hwnd, wParam, lParam, fn) \
+ (LRESULT)(DWORD)(int)(fn)((hwnd), (HWND)(wParam), (UINT)LOWORD(lParam), (UINT)HIWORD(lParam))
+#define FORWARD_WM_MOUSEACTIVATE(hwnd, hwndTopLevel, codeHitTest, msg, fn) \
+ (int)(DWORD)(fn)((hwnd), WM_MOUSEACTIVATE, (WPARAM)(HWND)(hwndTopLevel), MAKELPARAM((codeHitTest), (msg)))
+
+/* void Cls_OnCancelMode(HWND hwnd); */
+#define HANDLE_WM_CANCELMODE(hwnd, wParam, lParam, fn) \
+ ((fn)(hwnd), 0L)
+#define FORWARD_WM_CANCELMODE(hwnd, fn) \
+ (void)(fn)((hwnd), WM_CANCELMODE, 0, 0L)
+
+/* void Cls_OnTimer(HWND hwnd, UINT id); */
+#define HANDLE_WM_TIMER(hwnd, wParam, lParam, fn) \
+ ((fn)((hwnd), (UINT)(wParam)), 0L)
+#define FORWARD_WM_TIMER(hwnd, id, fn) \
+ (void)(fn)((hwnd), WM_TIMER, (WPARAM)(UINT)(id), 0L)
+
+/* void Cls_OnInitMenu(HWND hwnd, HMENU hMenu); */
+#define HANDLE_WM_INITMENU(hwnd, wParam, lParam, fn) \
+ ((fn)((hwnd), (HMENU)(wParam)), 0L)
+#define FORWARD_WM_INITMENU(hwnd, hMenu, fn) \
+ (void)(fn)((hwnd), WM_INITMENU, (WPARAM)(HMENU)(hMenu), 0L)
+
+/* void Cls_OnInitMenuPopup(HWND hwnd, HMENU hMenu, int item, BOOL fSystemMenu); */
+#define HANDLE_WM_INITMENUPOPUP(hwnd, wParam, lParam, fn) \
+ ((fn)((hwnd), (HMENU)(wParam), (int)LOWORD(lParam), (BOOL)HIWORD(lParam)), 0L)
+#define FORWARD_WM_INITMENUPOPUP(hwnd, hMenu, item, fSystemMenu, fn) \
+ (void)(fn)((hwnd), WM_INITMENUPOPUP, (WPARAM)(HMENU)(hMenu), MAKELPARAM((item),(fSystemMenu)))
+
+/* void Cls_OnMenuSelect(HWND hwnd, HMENU hmenu, int item, HMENU hmenuPopup, UINT flags); */
+#define HANDLE_WM_MENUSELECT(hwnd, wParam, lParam, fn) \
+ ((fn)((hwnd), (HMENU)HIWORD(lParam), (LOWORD(lParam) & MF_POPUP) ? 0 : (int)(wParam), \
+ (LOWORD(lParam) & MF_POPUP) ? (HMENU)(wParam) : 0, LOWORD(lParam)), 0L)
+#define FORWARD_WM_MENUSELECT(hwnd, hmenu, item, hmenuPopup, flags, fn) \
+ (void)(fn)((hwnd), WM_MENUSELECT, ((flags) & MF_POPUP) ? (WPARAM)(HMENU)(hmenuPopup) : (WPARAM)(int)(item), MAKELPARAM((flags), (hmenu)))
+
+/* DWORD Cls_OnMenuChar(HWND hwnd, UINT ch, UINT flags, HMENU hmenu); */
+#define HANDLE_WM_MENUCHAR(hwnd, wParam, lParam, fn) \
+ (LRESULT)(DWORD)(fn)((hwnd), (UINT)(wParam), LOWORD(lParam), (HMENU)HIWORD(lParam));
+#define FORWARD_WM_MENUCHAR(hwnd, ch, flags, hmenu, fn) \
+ (DWORD)(fn)((hwnd), WM_MENUCHAR, (WPARAM)(UINT)(ch), MAKELPARAM((flags), (UINT)(hmenu)))
+
+/* void Cls_OnCommand(HWND hwnd, int id, HWND hwndCtl, UINT codeNotify); */
+#define HANDLE_WM_COMMAND(hwnd, wParam, lParam, fn) \
+ ((fn)((hwnd), (int)(wParam), (HWND)LOWORD(lParam), (UINT)HIWORD(lParam)), 0L)
+#define FORWARD_WM_COMMAND(hwnd, id, hwndCtl, codeNotify, fn) \
+ (void)(fn)((hwnd), WM_COMMAND, (WPARAM)(int)(id), MAKELPARAM((UINT)(hwndCtl), (codeNotify)))
+
+/* void Cls_OnHScroll(HWND hwnd, HWND hwndCtl, UINT code, int pos); */
+#define HANDLE_WM_HSCROLL(hwnd, wParam, lParam, fn) \
+ ((fn)((hwnd), (HWND)HIWORD(lParam), (UINT)(wParam), (int)LOWORD(lParam)), 0L)
+#define FORWARD_WM_HSCROLL(hwnd, hwndCtl, code, pos, fn) \
+ (void)(fn)((hwnd), WM_HSCROLL, (WPARAM)(UINT)(code), MAKELPARAM((pos), (UINT)(hwndCtl)))
+
+/* void Cls_OnVScroll(HWND hwnd, HWND hwndCtl, UINT code, int pos); */
+#define HANDLE_WM_VSCROLL(hwnd, wParam, lParam, fn) \
+ ((fn)((hwnd), (HWND)HIWORD(lParam), (UINT)(wParam), (int)LOWORD(lParam)), 0L)
+#define FORWARD_WM_VSCROLL(hwnd, hwndCtl, code, pos, fn) \
+ (void)(fn)((hwnd), WM_VSCROLL, (WPARAM)(UINT)(code), MAKELPARAM((pos), (UINT)(hwndCtl)))
+
+/* void Cls_OnCut(HWND hwnd); */
+#define HANDLE_WM_CUT(hwnd, wParam, lParam, fn) \
+ ((fn)(hwnd), 0L)
+#define FORWARD_WM_CUT(hwnd, fn) \
+ (void)(fn)((hwnd), WM_CUT, 0, 0L)
+
+/* void Cls_OnCopy(HWND hwnd); */
+#define HANDLE_WM_COPY(hwnd, wParam, lParam, fn) \
+ ((fn)(hwnd), 0L)
+#define FORWARD_WM_COPY(hwnd, fn) \
+ (void)(fn)((hwnd), WM_COPY, 0, 0L)
+
+/* void Cls_OnPaste(HWND hwnd); */
+#define HANDLE_WM_PASTE(hwnd, wParam, lParam, fn) \
+ ((fn)(hwnd), 0L)
+#define FORWARD_WM_PASTE(hwnd, fn) \
+ (void)(fn)((hwnd), WM_PASTE, 0, 0L)
+
+/* void Cls_OnClear(HWND hwnd); */
+#define HANDLE_WM_CLEAR(hwnd, wParam, lParam, fn) \
+ ((fn)(hwnd), 0L)
+#define FORWARD_WM_CLEAR(hwnd, fn) \
+ (void)(fn)((hwnd), WM_CLEAR, 0, 0L)
+
+/* void Cls_OnUndo(HWND hwnd); */
+#define HANDLE_WM_UNDO(hwnd, wParam, lParam, fn) \
+ ((fn)(hwnd), 0L)
+#define FORWARD_WM_UNDO(hwnd, fn) \
+ (void)(fn)((hwnd), WM_UNDO, 0, 0L)
+
+/* HANDLE Cls_OnRenderFormat(HWND hwnd, UINT fmt); */
+#define HANDLE_WM_RENDERFORMAT(hwnd, wParam, lParam, fn) \
+ (LRESULT)(DWORD)(UINT)(HANDLE)(fn)((hwnd), (UINT)(wParam))
+#define FORWARD_WM_RENDERFORMAT(hwnd, fmt, fn) \
+ (HANDLE)(UINT)(DWORD)(fn)((hwnd), WM_RENDERFORMAT, (WPARAM)(UINT)(fmt), 0L)
+
+/* void Cls_OnRenderAllFormats(HWND hwnd); */
+#define HANDLE_WM_RENDERALLFORMATS(hwnd, wParam, lParam, fn) \
+ ((fn)(hwnd), 0L)
+#define FORWARD_WM_RENDERALLFORMATS(hwnd, fn) \
+ (void)(fn)((hwnd), WM_RENDERALLFORMATS, 0, 0L)
+
+/* void Cls_OnDestroyClipboard(HWND hwnd); */
+#define HANDLE_WM_DESTROYCLIPBOARD(hwnd, wParam, lParam, fn) \
+ ((fn)(hwnd), 0L)
+#define FORWARD_WM_DESTROYCLIPBOARD(hwnd, fn) \
+ (void)(fn)((hwnd), WM_DESTROYCLIPBOARD, 0, 0L)
+
+/* void Cls_OnDrawClipboard(HWND hwnd); */
+#define HANDLE_WM_DRAWCLIPBOARD(hwnd, wParam, lParam, fn) \
+ ((fn)(hwnd), 0L)
+#define FORWARD_WM_DRAWCLIPBOARD(hwnd, fn) \
+ (void)(fn)((hwnd), WM_DRAWCLIPBOARD, 0, 0L)
+
+/* void Cls_OnPaintClipboard(HWND hwnd, HWND hwndCBViewer, const PAINTSTRUCT FAR* lpPaintStruct) */
+#define HANDLE_WM_PAINTCLIPBOARD(hwnd, wParam, lParam, fn) \
+ ((fn)((hwnd), (HWND)(wParam), (const PAINTSTRUCT FAR*)GlobalLock((HGLOBAL)LOWORD(lParam))), GlobalUnlock((HGLOBAL)LOWORD(lParam)), 0L)
+#define FORWARD_WM_PAINTCLIPBOARD(hwnd, hwndCBViewer, lpPaintStruct, fn) \
+ (void)(fn)((hwnd), WM_PAINTCLIPBOARD, (WPARAM)(HWND)(hwndCBViewer), (LPARAM)(lpPaintStruct))
+
+/* void Cls_OnSizeClipboard(HWND hwnd, HWND hwndCBViewer, const RECT FAR* lprc); */
+#define HANDLE_WM_SIZECLIPBOARD(hwnd, wParam, lParam, fn) \
+ ((fn)((hwnd), (HWND)(wParam), (const RECT FAR*)GlobalLock((HGLOBAL)LOWORD(lParam))), GlobalUnlock((HGLOBAL)LOWORD(lParam)), 0L)
+#define FORWARD_WM_SIZECLIPBOARD(hwnd, hwndCBViewer, lprc, fn) \
+ (void)(fn)((hwnd), WM_SIZECLIPBOARD, (WPARAM)(HWND)(hwndCBViewer), (LPARAM)(lprc))
+
+/* void Cls_OnVScrollClipboard(HWND hwnd, HWND hwndCBViewer, UINT code, int pos); */
+#define HANDLE_WM_VSCROLLCLIPBOARD(hwnd, wParam, lParam, fn) \
+ ((fn)((hwnd), (HWND)(wParam), LOWORD(lParam), (int)HIWORD(lParam)), 0L)
+#define FORWARD_WM_VSCROLLCLIPBOARD(hwnd, hwndCBViewer, code, pos, fn) \
+ (void)(fn)((hwnd), WM_VSCROLLCLIPBOARD, (WPARAM)(HWND)(hwndCBViewer), MAKELPARAM((code), (pos)))
+
+/* void Cls_OnHScrollClipboard(HWND hwnd, HWND hwndCBViewer, UINT code, int pos); */
+#define HANDLE_WM_HSCROLLCLIPBOARD(hwnd, wParam, lParam, fn) \
+ ((fn)((hwnd), (HWND)(wParam), LOWORD(lParam), (int)HIWORD(lParam)), 0L)
+#define FORWARD_WM_HSCROLLCLIPBOARD(hwnd, hwndCBViewer, code, pos, fn) \
+ (void)(fn)((hwnd), WM_HSCROLLCLIPBOARD, (WPARAM)(HWND)(hwndCBViewer), MAKELPARAM((code), (pos)))
+
+/* void Cls_OnAskCBFormatName(HWND hwnd, int cchMax, LPSTR rgchName); */
+#define HANDLE_WM_ASKCBFORMATNAME(hwnd, wParam, lParam, fn) \
+ ((fn)((hwnd), (int)(wParam), (LPSTR)(lParam)), 0L)
+#define FORWARD_WM_ASKCBFORMATNAME(hwnd, cchMax, rgchName, fn) \
+ (void)(fn)((hwnd), WM_ASKCBFORMATNAME, (WPARAM)(int)(cchMax), (LPARAM)(rgchName))
+
+/* void Cls_OnChangeCBChain(HWND hwnd, HWND hwndRemove, HWND hwndNext); */
+#define HANDLE_WM_CHANGECBCHAIN(hwnd, wParam, lParam, fn) \
+ ((fn)((hwnd), (HWND)(wParam), (HWND)LOWORD(lParam)), 0L)
+#define FORWARD_WM_CHANGECBCHAIN(hwnd, hwndRemove, hwndNext, fn) \
+ (void)(fn)((hwnd), WM_CHANGECBCHAIN, (WPARAM)(HWND)(hwndRemove), MAKELPARAM((UINT)(hwndNext), 0))
+
+/* BOOL Cls_OnSetCursor(HWND hwnd, HWND hwndCursor, UINT codeHitTest, UINT msg); */
+#define HANDLE_WM_SETCURSOR(hwnd, wParam, lParam, fn) \
+ (LRESULT)(DWORD)(BOOL)(fn)((hwnd), (HWND)(wParam), (UINT)LOWORD(lParam), (UINT)HIWORD(lParam));
+#define FORWARD_WM_SETCURSOR(hwnd, hwndCursor, codeHitTest, msg, fn) \
+ (BOOL)(DWORD)(fn)((hwnd), WM_SETCURSOR, (WPARAM)(HWND)(hwndCursor), MAKELPARAM((codeHitTest), (msg)))
+
+/* void Cls_OnSysCommand(HWND hwnd, UINT cmd, int x, int y); */
+#define HANDLE_WM_SYSCOMMAND(hwnd, wParam, lParam, fn) \
+ ((fn)((hwnd), (UINT)(wParam), (int)LOWORD(lParam), (int)HIWORD(lParam)), 0L)
+#define FORWARD_WM_SYSCOMMAND(hwnd, cmd, x, y, fn) \
+ (void)(fn)((hwnd), WM_SYSCOMMAND, (WPARAM)(UINT)(cmd), MAKELPARAM((x), (y)))
+
+/* HWND Cls_MDICreate(HWND hwnd, const MDICREATESTRUCT FAR* lpmcs); */
+#define HANDLE_WM_MDICREATE(hwnd, wParam, lParam, fn) \
+ (LRESULT)(DWORD)(UINT)(fn)((hwnd), (MDICREATESTRUCT FAR*)(lParam))
+#define FORWARD_WM_MDICREATE(hwnd, lpmcs, fn) \
+ (HWND)(UINT)(DWORD)(fn)((hwnd), WM_MDICREATE, 0, (LPARAM)(lpmcs))
+
+/* void Cls_MDIDestroy(HWND hwnd, HWND hwndDestroy); */
+#define HANDLE_WM_MDIDESTROY(hwnd, wParam, lParam, fn) \
+ ((fn)((hwnd), (HWND)(wParam)), 0L)
+#define FORWARD_WM_MDIDESTROY(hwnd, hwndDestroy, fn) \
+ (void)(fn)((hwnd), WM_MDIDESTROY, (WPARAM)(hwndDestroy), 0L)
+
+/* NOTE: Usable only by MDI client windows */
+/* void Cls_MDIActivate(HWND hwnd, BOOL fActive, HWND hwndActivate, HWND hwndDeactivate); */
+#define HANDLE_WM_MDIACTIVATE(hwnd, wParam, lParam, fn) \
+ ((fn)((hwnd), (BOOL)(wParam), (HWND)LOWORD(lParam), (HWND)HIWORD(lParam)), 0L)
+#define FORWARD_WM_MDIACTIVATE(hwnd, fActive, hwndActivate, hwndDeactivate, fn) \
+ (void)(fn)(hwnd, WM_MDIACTIVATE, (WPARAM)(fActive), MAKELPARAM((hwndActivate), (hwndDeactivate)))
+
+/* void Cls_MDIRestore(HWND hwnd, HWND hwndRestore); */
+#define HANDLE_WM_MDIRESTORE(hwnd, wParam, lParam, fn) \
+ ((fn)((hwnd), (HWND)(wParam)), 0L)
+#define FORWARD_WM_MDIRESTORE(hwnd, hwndRestore, fn) \
+ (void)(fn)((hwnd), WM_MDIRESTORE, (WPARAM)(hwndRestore), 0L)
+
+/* HWND Cls_MDINext(HWND hwnd, HWND hwndCur, BOOL fPrev); */
+#define HANDLE_WM_MDINEXT(hwnd, wParam, lParam, fn) \
+ ((fn)((hwnd), (HWND)(wParam), (BOOL)LOWORD(lParam)), 0L)
+#define FORWARD_WM_MDINEXT(hwnd, hwndCur, fPrev, fn) \
+ (HWND)(UINT)(DWORD)(fn)((hwnd), WM_MDINEXT, (WPARAM)(hwndCur), MAKELPARAM((fPrev), 0))
+
+/* void Cls_MDIMaximize(HWND hwnd, HWND hwndMaximize); */
+#define HANDLE_WM_MDIMAXIMIZE(hwnd, wParam, lParam, fn) \
+ ((fn)((hwnd), (HWND)(wParam)), 0L)
+#define FORWARD_WM_MDIMAXIMIZE(hwnd, hwndMaximize, fn) \
+ (void)(fn)((hwnd), WM_MDIMAXIMIZE, (WPARAM)(hwndMaximize), 0L)
+
+/* BOOL Cls_MDITile(HWND hwnd, UINT cmd); */
+#define HANDLE_WM_MDITILE(hwnd, wParam, lParam, fn) \
+ (LRESULT)(DWORD)(fn)((hwnd), (UINT)(wParam))
+#define FORWARD_WM_MDITILE(hwnd, cmd, fn) \
+ (BOOL)(DWORD)(fn)((hwnd), WM_MDITILE, (WPARAM)(cmd), 0L)
+
+/* BOOL Cls_MDICascade(HWND hwnd, UINT cmd); */
+#define HANDLE_WM_MDICASCADE(hwnd, wParam, lParam, fn) \
+ (LRESULT)(DWORD)(fn)((hwnd), (UINT)(wParam))
+#define FORWARD_WM_MDICASCADE(hwnd, cmd, fn) \
+ (BOOL)(DWORD)(fn)((hwnd), WM_MDICASCADE, (WPARAM)(cmd), 0L)
+
+/* void Cls_MDIIconArrange(HWND hwnd); */
+#define HANDLE_WM_MDIICONARRANGE(hwnd, wParam, lParam, fn) \
+ ((fn)(hwnd), 0L)
+#define FORWARD_WM_MDIICONARRANGE(hwnd, fn) \
+ (void)(fn)((hwnd), WM_MDIICONARRANGE, 0, 0L)
+
+/* HWND Cls_MDIGetActive(HWND hwnd); */
+#define HANDLE_WM_MDIGETACTIVE(hwnd, wParam, lParam, fn) \
+ (LRESULT)(DWORD)(UINT)(fn)(hwnd)
+#define FORWARD_WM_MDIGETACTIVE(hwnd, fn) \
+ (HWND)(UINT)(DWORD)(fn)((hwnd), WM_MDIGETACTIVE, 0, 0L)
+
+/* HMENU Cls_MDISetMenu(HWND hwnd, BOOL fRefresh, HMENU hmenuFrame, HMENU hmenuWindow); */
+#define HANDLE_WM_MDISETMENU(hwnd, wParam, lParam, fn) \
+ (LRESULT)(DWORD)(UINT)(fn)((hwnd), (BOOL)(wParam), (HMENU)LOWORD(lParam), (HMENU)HIWORD(lParam))
+#define FORWARD_WM_MDISETMENU(hwnd, fRefresh, hmenuFrame, hmenuWindow, fn) \
+ (HMENU)(UINT)(DWORD)(fn)((hwnd), WM_MDISETMENU, (WPARAM)(fRefresh), MAKELPARAM((hmenuFrame), (hmenuWindow)))
+
+/* void Cls_OnChildActivate(HWND hwnd); */
+#define HANDLE_WM_CHILDACTIVATE(hwnd, wParam, lParam, fn) \
+ ((fn)(hwnd), 0L)
+#define FORWARD_WM_CHILDACTIVATE(hwnd, fn) \
+ (void)(fn)((hwnd), WM_CHILDACTIVATE, 0, 0L)
+
+/* BOOL Cls_OnInitDialog(HWND hwnd, HWND hwndFocus, LPARAM lParam); */
+#define HANDLE_WM_INITDIALOG(hwnd, wParam, lParam, fn) \
+ (LRESULT)(DWORD)(UINT)(BOOL)(fn)((hwnd), (HWND)(wParam), lParam);
+#define FORWARD_WM_INITDIALOG(hwnd, hwndFocus, lParam, fn) \
+ (BOOL)(DWORD)(fn)((hwnd), WM_INITDIALOG, (WPARAM)(HWND)(hwndFocus), (lParam))
+
+/* HWND Cls_OnNextDlgCtl(HWND hwnd, HWND hwndSetFocus, BOOL fNext) */
+#define HANDLE_WM_NEXTDLGCTL(hwnd, wParam, lParam, fn) \
+ (LRESULT)(DWORD)(UINT)(HWND)(fn)((hwnd), (HWND)(wParam), (BOOL)LOWORD(lParam))
+#define FORWARD_WM_NEXTDLGCTL(hwnd, hwndSetFocus, fNext, fn) \
+ (HWND)(UINT)(DWORD)(fn)((hwnd), WM_NEXTDLGCTL, (WPARAM)(HWND)(hwndSetFocus), MAKELPARAM((fNext), 0))
+
+/* void Cls_OnParentNotify(HWND hwnd, UINT msg, HWND hwndChild, int idChild); */
+#define HANDLE_WM_PARENTNOTIFY(hwnd, wParam, lParam, fn) \
+ ((fn)((hwnd), (UINT)(wParam), (HWND)LOWORD(lParam), (UINT)HIWORD(lParam)), 0L)
+#define FORWARD_WM_PARENTNOTIFY(hwnd, msg, hwndChild, idChild, fn) \
+ (void)(fn)((hwnd), WM_PARENTNOTIFY, (WPARAM)(UINT)(msg), MAKELPARAM((UINT)(HWND)(hwndChild), (UINT)(idChild)))
+
+/* void Cls_OnEnterIdle(HWND hwnd, UINT source, HWND hwndSource); */
+#define HANDLE_WM_ENTERIDLE(hwnd, wParam, lParam, fn) \
+ ((fn)((hwnd), (UINT)(wParam), (HWND)LOWORD(lParam)), 0L)
+#define FORWARD_WM_ENTERIDLE(hwnd, source, hwndSource, fn) \
+ (void)(fn)((hwnd), WM_ENTERIDLE, (WPARAM)(UINT)(source), MAKELPARAM((UINT)(HWND)(hwndSource), 0))
+
+/* UINT Cls_OnGetDlgCode(HWND hwnd, MSG FAR* lpmsg); */
+#define HANDLE_WM_GETDLGCODE(hwnd, wParam, lParam, fn) \
+ (LRESULT)(DWORD)(UINT)(fn)(hwnd, (MSG FAR*)(lParam))
+#define FORWARD_WM_GETDLGCODE(hwnd, lpmsg, fn) \
+ (UINT)(DWORD)(fn)((hwnd), WM_GETDLGCODE, (SELECTOROF(lpmsg) ? lpmsg->wParam : 0), (LPARAM)(lpmsg))
+
+/* HBRUSH Cls_OnCtlColor(HWND hwnd, HDC hdc, HWND hwndChild, int type); */
+#define HANDLE_WM_CTLCOLOR(hwnd, wParam, lParam, fn) \
+ (LRESULT)(DWORD)(UINT)(HBRUSH)(fn)((hwnd), (HDC)(wParam), (HWND)LOWORD(lParam), (int)(HIWORD(lParam)))
+#define FORWARD_WM_CTLCOLOR(hwnd, hdc, hwndChild, type, fn) \
+ (HBRUSH)(UINT)(DWORD)(fn)((hwnd), WM_CTLCOLOR, (WPARAM)(HDC)(hdc), MAKELPARAM((UINT)(HWND)(hwndChild), (UINT)(int)(type)))
+
+/* void Cls_OnSetFont(HWND hwndCtl, HFONT hfont, BOOL fRedraw); */
+#define HANDLE_WM_SETFONT(hwnd, wParam, lParam, fn) \
+ ((fn)((hwnd), (HFONT)(wParam), (BOOL)LOWORD(lParam)), 0L)
+#define FORWARD_WM_SETFONT(hwnd, hfont, fRedraw, fn) \
+ (void)(fn)((hwnd), WM_SETFONT, (WPARAM)(HFONT)(hfont), MAKELPARAM((UINT)(BOOL)(fRedraw), 0))
+
+/* HFONT Cls_OnGetFont(HWND hwnd); */
+#define HANDLE_WM_GETFONT(hwnd, wParam, lParam, fn) \
+ (LRESULT)(DWORD)(UINT)(HFONT)(fn)(hwnd)
+#define FORWARD_WM_GETFONT(hwnd, fn) \
+ (HFONT)(UINT)(DWORD)(fn)((hwnd), WM_GETFONT, 0, 0L)
+
+/* void Cls_OnDrawItem(HWND hwnd, const DRAWITEMSTRUCT FAR* lpDrawItem); */
+#define HANDLE_WM_DRAWITEM(hwnd, wParam, lParam, fn) \
+ ((fn)((hwnd), (const DRAWITEMSTRUCT FAR*)(lParam)), 0L)
+#define FORWARD_WM_DRAWITEM(hwnd, lpDrawItem, fn) \
+ (void)(fn)((hwnd), WM_DRAWITEM, 0, (LPARAM)(const DRAWITEMSTRUCT FAR*)(lpDrawItem))
+
+/* void Cls_OnMeasureItem(HWND hwnd, MEASUREITEMSTRUCT FAR* lpMeasureItem); */
+#define HANDLE_WM_MEASUREITEM(hwnd, wParam, lParam, fn) \
+ ((fn)((hwnd), (MEASUREITEMSTRUCT FAR*)(lParam)), 0L)
+#define FORWARD_WM_MEASUREITEM(hwnd, lpMeasureItem, fn) \
+ (void)(fn)((hwnd), WM_MEASUREITEM, 0, (LPARAM)(MEASUREITEMSTRUCT FAR*)(lpMeasureItem))
+
+/* void Cls_OnDeleteItem(HWND hwnd, const DELETEITEMSTRUCT FAR* lpDeleteItem) */
+#define HANDLE_WM_DELETEITEM(hwnd, wParam, lParam, fn) \
+ ((fn)((hwnd), (const DELETEITEMSTRUCT FAR*)(lParam)), 0L)
+#define FORWARD_WM_DELETEITEM(hwnd, lpDeleteItem, fn) \
+ (void)(fn)((hwnd), WM_DELETEITEM, 0, (LPARAM)(const DELETEITEMSTRUCT FAR*)(lpDeleteItem))
+
+/* int Cls_OnCompareItem(HWND hwnd, const COMPAREITEMSTRUCT FAR* lpCompareItem); */
+#define HANDLE_WM_COMPAREITEM(hwnd, wParam, lParam, fn) \
+ (LRESULT)(DWORD)(int)(fn)((hwnd), (const COMPAREITEMSTRUCT FAR*)(lParam))
+#define FORWARD_WM_COMPAREITEM(hwnd, lpCompareItem, fn) \
+ (int)(DWORD)(fn)((hwnd), WM_COMPAREITEM, 0, (LPARAM)(const COMPAREITEMSTRUCT FAR*)(lpCompareItem))
+
+/* int Cls_OnVkeyToItem(HWND hwnd, UINT vk, HWND hwndListbox, int iCaret); */
+#define HANDLE_WM_VKEYTOITEM(hwnd, wParam, lParam, fn) \
+ (LRESULT)(DWORD)(int)(fn)((hwnd), (UINT)(wParam), (HWND)LOWORD(lParam), (int)HIWORD(lParam))
+#define FORWARD_WM_VKEYTOITEM(hwnd, vk, hwndListBox, iCaret, fn) \
+ (int)(DWORD)(fn)((hwnd), WM_VKEYTOITEM, (WPARAM)(UINT)(vk), MAKELPARAM((UINT)(hwndListBox), (UINT)(iCaret)))
+
+/* int Cls_OnCharToItem(HWND hwnd, UINT ch, HWND hwndListbox, int iCaret); */
+#define HANDLE_WM_CHARTOITEM(hwnd, wParam, lParam, fn) \
+ (LRESULT)(DWORD)(int)(fn)((hwnd), (UINT)(wParam), (HWND)LOWORD(lParam), (int)HIWORD(lParam))
+#define FORWARD_WM_CHARTOITEM(hwnd, ch, hwndListBox, iCaret, fn) \
+ (int)(DWORD)(fn)((hwnd), WM_CHARTOITEM, (WPARAM)(UINT)(ch), MAKELPARAM((UINT)(hwndListBox), (UINT)(iCaret)))
+
+/* void Cls_OnQueueSync(HWND hwnd); */
+#define HANDLE_WM_QUEUESYNC(hwnd, wParam, lParam, fn) \
+ ((fn)(hwnd), 0L)
+#define FORWARD_WM_QUEUESYNC(hwnd, fn) \
+ (void)(fn)((hwnd), WM_QUEUESYNC, 0, 0L)
+
+/* void Cls_OnCommNotify(HWND hwnd, int cid, UINT flags); */
+#define HANDLE_WM_COMMNOTIFY(hwnd, wParam, lParam, fn) \
+ ((fn)((hwnd), (int)(wParam), LOWORD(lParam)), 0L)
+#define FORWARD_WM_COMMNOTIFY(hwnd, cid, flags, fn) \
+ (void)(fn)((hwnd), WM_COMMNOTIFY, (WPARAM)(cid), MAKELPARAM((flags), 0))
+
+/****** Static control message APIs ******************************************/
+
+#define Static_Enable(hwndCtl, fEnable) EnableWindow((hwndCtl), (fEnable))
+
+#define Static_GetText(hwndCtl, lpch, cchMax) GetWindowText((hwndCtl), (lpch), (cchMax))
+#define Static_GetTextLength(hwndCtl) GetWindowTextLength(hwndCtl)
+#define Static_SetText(hwndCtl, lpsz) SetWindowText((hwndCtl), (lpsz))
+
+#define Static_SetIcon(hwndCtl, hIcon) ((HICON)(UINT)(DWORD)SendMessage((hwndCtl), STM_SETICON, (WPARAM)(HICON)(hIcon), 0L))
+#define Static_GetIcon(hwndCtl, hIcon) ((HICON)(UINT)(DWORD)SendMessage((hwndCtl), STM_GETICON, 0, 0L))
+
+/****** Button control message APIs ******************************************/
+
+#define Button_Enable(hwndCtl, fEnable) EnableWindow((hwndCtl), (fEnable))
+
+#define Button_GetText(hwndCtl, lpch, cchMax) GetWindowText((hwndCtl), (lpch), (cchMax))
+#define Button_GetTextLength(hwndCtl) GetWindowTextLength(hwndCtl)
+#define Button_SetText(hwndCtl, lpsz) SetWindowText((hwndCtl), (lpsz))
+
+#define Button_GetCheck(hwndCtl) ((int)(DWORD)SendMessage((hwndCtl), BM_GETCHECK, 0, 0L))
+#define Button_SetCheck(hwndCtl, check) ((void)SendMessage((hwndCtl), BM_SETCHECK, (WPARAM)(int)(check), 0L))
+
+#define Button_GetState(hwndCtl) ((int)(DWORD)SendMessage((hwndCtl), BM_GETSTATE, 0, 0L))
+#define Button_SetState(hwndCtl, state) ((UINT)(DWORD)SendMessage((hwndCtl), BM_SETSTATE, (WPARAM)(int)(state), 0L))
+
+#define Button_SetStyle(hwndCtl, style, fRedraw) ((void)SendMessage((hwndCtl), BM_SETSTYLE, (WPARAM)LOWORD(style), MAKELPARAM(((fRedraw) ? TRUE : FALSE), 0)))
+
+/****** Edit control message APIs ********************************************/
+
+#define Edit_Enable(hwndCtl, fEnable) EnableWindow((hwndCtl), (fEnable))
+
+#define Edit_GetText(hwndCtl, lpch, cchMax) GetWindowText((hwndCtl), (lpch), (cchMax))
+#define Edit_GetTextLength(hwndCtl) GetWindowTextLength(hwndCtl)
+#define Edit_SetText(hwndCtl, lpsz) SetWindowText((hwndCtl), (lpsz))
+
+#define Edit_LimitText(hwndCtl, cchMax) ((void)SendMessage((hwndCtl), EM_LIMITTEXT, (WPARAM)(cchMax), 0L))
+
+#define Edit_GetLineCount(hwndCtl) ((int)(DWORD)SendMessage((hwndCtl), EM_GETLINECOUNT, 0, 0L))
+#define Edit_GetLine(hwndCtl, line, lpch, cchMax) ((*((int FAR*)(lpch)) = (cchMax)), ((int)(DWORD)SendMessage((hwndCtl), EM_GETLINE, (WPARAM)(int)(line), (LPARAM)(LPSTR)(lpch))))
+
+#define Edit_GetRect(hwndCtl, lprc) ((void)SendMessage((hwndCtl), EM_GETRECT, 0, (LPARAM)(RECT FAR*)(lprc)))
+#define Edit_SetRect(hwndCtl, lprc) ((void)SendMessage((hwndCtl), EM_SETRECT, 0, (LPARAM)(const RECT FAR*)(lprc)))
+#define Edit_SetRectNoPaint(hwndCtl, lprc) ((void)SendMessage((hwndCtl), EM_SETRECTNP, 0, (LPARAM)(const RECT FAR*)(lprc)))
+
+#define Edit_GetSel(hwndCtl) ((DWORD)SendMessage((hwndCtl), EM_GETSEL, 0, 0L))
+#define Edit_SetSel(hwndCtl, ichStart, ichEnd) ((void)SendMessage((hwndCtl), EM_SETSEL, 0, MAKELPARAM((ichStart), (ichEnd))))
+#define Edit_ReplaceSel(hwndCtl, lpszReplace) ((void)SendMessage((hwndCtl), EM_REPLACESEL, 0, (LPARAM)(LPCSTR)(lpszReplace)))
+
+#define Edit_GetModify(hwndCtl) ((BOOL)(DWORD)SendMessage((hwndCtl), EM_GETMODIFY, 0, 0L))
+#define Edit_SetModify(hwndCtl, fModified) ((void)SendMessage((hwndCtl), EM_SETMODIFY, (WPARAM)(UINT)(fModified), 0L))
+
+#define Edit_LineFromChar(hwndCtl, ich) ((int)(DWORD)SendMessage((hwndCtl), EM_LINEFROMCHAR, (WPARAM)(int)(ich), 0L))
+#define Edit_LineIndex(hwndCtl, line) ((int)(DWORD)SendMessage((hwndCtl), EM_LINEINDEX, (WPARAM)(int)(line), 0L))
+#define Edit_LineLength(hwndCtl, line) ((int)(DWORD)SendMessage((hwndCtl), EM_LINELENGTH, (WPARAM)(int)(line), 0L))
+
+#define Edit_Scroll(hwndCtl, dv, dh) ((void)SendMessage((hwndCtl), EM_LINESCROLL, 0, MAKELPARAM((dv), (dh))))
+
+#define Edit_CanUndo(hwndCtl) ((BOOL)(DWORD)SendMessage((hwndCtl), EM_CANUNDO, 0, 0L))
+#define Edit_Undo(hwndCtl) ((BOOL)(DWORD)SendMessage((hwndCtl), EM_UNDO, 0, 0L))
+#define Edit_EmptyUndoBuffer(hwndCtl) ((void)SendMessage((hwndCtl), EM_EMPTYUNDOBUFFER, 0, 0L))
+
+#define Edit_SetPasswordChar(hwndCtl, ch) ((void)SendMessage((hwndCtl), EM_SETPASSWORDCHAR, (WPARAM)(UINT)(ch), 0L))
+
+#define Edit_SetTabStops(hwndCtl, cTabs, lpTabs) ((void)SendMessage((hwndCtl), EM_SETTABSTOPS, (WPARAM)(int)(cTabs), (LPARAM)(const int FAR*)(lpTabs)))
+
+#define Edit_FmtLines(hwndCtl, fAddEOL) ((BOOL)(DWORD)SendMessage((hwndCtl), EM_FMTLINES, (WPARAM)(BOOL)(fAddEOL), 0L))
+
+#define Edit_GetHandle(hwndCtl) ((HLOCAL)(UINT)(DWORD)SendMessage((hwndCtl), EM_GETHANDLE, 0, 0L))
+#define Edit_SetHandle(hwndCtl, h) ((void)SendMessage((hwndCtl), EM_SETHANDLE, (WPARAM)(UINT)(HLOCAL)(h), 0L))
+
+#if (WINVER >= 0x030a)
+#define Edit_GetFirstVisibleLine(hwndCtl) ((int)(DWORD)SendMessage((hwndCtl), EM_GETFIRSTVISIBLELINE, 0, 0L))
+
+#define Edit_SetReadOnly(hwndCtl, fReadOnly) ((BOOL)(DWORD)SendMessage((hwndCtl), EM_SETREADONLY, (WPARAM)(BOOL)(fReadOnly), 0L))
+
+#define Edit_GetPasswordChar(hwndCtl) ((char)(DWORD)SendMessage((hwndCtl), EM_GETPASSWORDCHAR, 0, 0L))
+
+#define Edit_SetWordBreakProc(hwndCtl, lpfnWordBreak) ((void)SendMessage((hwndCtl), EM_SETWORDBREAKPROC, 0, (LPARAM)(EDITWORDBREAKPROC)(lpfnWordBreak)))
+#define Edit_GetWordBreakProc(hwndCtl) ((EDITWORDBREAKPROC)SendMessage((hwndCtl), EM_GETWORDBREAKPROC, 0, 0L))
+#endif /* WINVER >= 0x030a */
+
+/****** ScrollBar control message APIs ***************************************/
+
+/* NOTE: flags parameter is a collection of ESB_* values, NOT a boolean! */
+#define ScrollBar_Enable(hwndCtl, flags) EnableScrollBar((hwndCtl), SB_CTL, (flags))
+
+#define ScrollBar_Show(hwndCtl, fShow) ShowWindow((hwndCtl), (fShow) ? SW_SHOWNORMAL : SW_HIDE)
+
+#define ScrollBar_SetPos(hwndCtl, pos, fRedraw) SetScrollPos((hwndCtl), SB_CTL, (pos), (fRedraw))
+#define ScrollBar_GetPos(hwndCtl) GetScrollPos((hwndCtl), SB_CTL)
+
+#define ScrollBar_SetRange(hwndCtl, posMin, posMax, fRedraw) SetScrollRange((hwndCtl), SB_CTL, (posMin), (posMax), (fRedraw))
+#define ScrollBar_GetRange(hwndCtl, lpposMin, lpposMax) GetScrollRange((hwndCtl), SB_CTL, (lpposMin), (lpposMax))
+
+/****** ListBox control message APIs *****************************************/
+
+#define ListBox_Enable(hwndCtl, fEnable) EnableWindow((hwndCtl), (fEnable))
+
+#define ListBox_GetCount(hwndCtl) ((int)(DWORD)SendMessage((hwndCtl), LB_GETCOUNT, 0, 0L))
+#define ListBox_ResetContent(hwndCtl) ((BOOL)(DWORD)SendMessage((hwndCtl), LB_RESETCONTENT, 0, 0L))
+
+#define ListBox_AddString(hwndCtl, lpsz) ((int)(DWORD)SendMessage((hwndCtl), LB_ADDSTRING, 0, (LPARAM)(LPCSTR)(lpsz)))
+#define ListBox_InsertString(hwndCtl, index, lpsz) ((int)(DWORD)SendMessage((hwndCtl), LB_INSERTSTRING, (WPARAM)(int)(index), (LPARAM)(LPCSTR)(lpsz)))
+
+#define ListBox_AddItemData(hwndCtl, data) ((int)(DWORD)SendMessage((hwndCtl), LB_ADDSTRING, 0, (LPARAM)(data)))
+#define ListBox_InsertItemData(hwndCtl, index, data) ((int)(DWORD)SendMessage((hwndCtl), LB_INSERTSTRING, (WPARAM)(int)(index), (LPARAM)(data)))
+
+#define ListBox_DeleteString(hwndCtl, index) ((int)(DWORD)SendMessage((hwndCtl), LB_DELETESTRING, (WPARAM)(int)(index), 0L))
+
+#define ListBox_GetTextLen(hwndCtl, index) ((int)(DWORD)SendMessage((hwndCtl), LB_GETTEXTLEN, (WPARAM)(int)(index), 0L))
+#define ListBox_GetText(hwndCtl, index, lpszBuffer) ((int)(DWORD)SendMessage((hwndCtl), LB_GETTEXT, (WPARAM)(int)(index), (LPARAM)(LPCSTR)(lpszBuffer)))
+
+#define ListBox_GetItemData(hwndCtl, index) ((LRESULT)(DWORD)SendMessage((hwndCtl), LB_GETITEMDATA, (WPARAM)(int)(index), 0L))
+#define ListBox_SetItemData(hwndCtl, index, data) ((int)(DWORD)SendMessage((hwndCtl), LB_SETITEMDATA, (WPARAM)(int)(index), (LPARAM)(data)))
+
+#define ListBox_FindString(hwndCtl, indexStart, lpszFind) ((int)(DWORD)SendMessage((hwndCtl), LB_FINDSTRING, (WPARAM)(int)(indexStart), (LPARAM)(LPCSTR)(lpszFind)))
+#define ListBox_FindItemData(hwndCtl, indexStart, data) ((int)(DWORD)SendMessage((hwndCtl), LB_FINDSTRING, (WPARAM)(int)(indexStart), (LPARAM)(data)))
+
+#define ListBox_SetSel(hwndCtl, fSelect, index) ((int)(DWORD)SendMessage((hwndCtl), LB_SETSEL, (WPARAM)(BOOL)(fSelect), MAKELPARAM((index), 0)))
+#define ListBox_SelItemRange(hwndCtl, fSelect, first, last) ((int)(DWORD)SendMessage((hwndCtl), LB_SELITEMRANGE, (WPARAM)(BOOL)(fSelect), MAKELPARAM((first), (last))))
+
+#define ListBox_GetCurSel(hwndCtl) ((int)(DWORD)SendMessage((hwndCtl), LB_GETCURSEL, 0, 0L))
+#define ListBox_SetCurSel(hwndCtl, index) ((int)(DWORD)SendMessage((hwndCtl), LB_SETCURSEL, (WPARAM)(int)(index), 0L))
+
+#define ListBox_SelectString(hwndCtl, indexStart, lpszFind) ((int)(DWORD)SendMessage((hwndCtl), LB_SELECTSTRING, (WPARAM)(int)(indexStart), (LPARAM)(LPCSTR)(lpszFind)))
+#define ListBox_SelectItemData(hwndCtl, indexStart, data) ((int)(DWORD)SendMessage((hwndCtl), LB_SELECTSTRING, (WPARAM)(int)(indexStart), (LPARAM)(data)))
+
+#define ListBox_GetSel(hwndCtl, index) ((int)(DWORD)SendMessage((hwndCtl), LB_GETSEL, (WPARAM)(int)(index), 0L))
+#define ListBox_GetSelCount(hwndCtl) ((int)(DWORD)SendMessage((hwndCtl), LB_GETSELCOUNT, 0, 0L))
+#define ListBox_GetTopIndex(hwndCtl) ((int)(DWORD)SendMessage((hwndCtl), LB_GETTOPINDEX, 0, 0L))
+#define ListBox_GetSelItems(hwndCtl, cItems, lpItems) ((int)(DWORD)SendMessage((hwndCtl), LB_GETSELITEMS, (WPARAM)(int)(cItems), (LPARAM)(int FAR*)(lpItems)))
+
+#define ListBox_SetTopIndex(hwndCtl, indexTop) ((int)(DWORD)SendMessage((hwndCtl), LB_SETTOPINDEX, (WPARAM)(int)(indexTop), 0L))
+
+#define ListBox_SetColumnWidth(hwndCtl, cxColumn) ((void)SendMessage((hwndCtl), LB_SETCOLUMNWIDTH, (WPARAM)(int)(cxColumn), 0L))
+#define ListBox_GetHorizontalExtent(hwndCtl) ((int)(DWORD)SendMessage((hwndCtl), LB_GETHORIZONTALEXTENT, 0, 0L))
+#define ListBox_SetHorizontalExtent(hwndCtl, cxExtent) ((void)SendMessage((hwndCtl), LB_SETHORIZONTALEXTENT, (WPARAM)(int)(cxExtent), 0L))
+
+#define ListBox_SetTabStops(hwndCtl, cTabs, lpTabs) ((BOOL)(DWORD)SendMessage((hwndCtl), LB_SETTABSTOPS, (WPARAM)(int)(cTabs), (LPARAM)(int FAR*)(lpTabs)))
+
+#define ListBox_GetItemRect(hwndCtl, index, lprc) ((int)(DWORD)SendMessage((hwndCtl), LB_GETITEMRECT, (WPARAM)(int)(index), (LPARAM)(RECT FAR*)(lprc)))
+
+#define ListBox_SetCaretIndex(hwndCtl, index) ((int)(DWORD)SendMessage((hwndCtl), LB_SETCARETINDEX, (WPARAM)(int)(index), 0L))
+#define ListBox_GetCaretIndex(hwndCtl) ((int)(DWORD)SendMessage((hwndCtl), LB_GETCARETINDEX, 0, 0L))
+
+#define ListBox_SetAnchorIndex(hwndCtl, index) ((void)SendMessage((hwndCtl), LB_SETANCHORINDEX, (WPARAM)(int)(index), 0L)) /* ;Internal */
+#define ListBox_GetAnchorIndex(hwndCtl) ((int)(DWORD)SendMessage((hwndCtl), LB_GETANCHORINDEX, 0, 0L)) /* ;Internal */
+
+#if (WINVER >= 0x030a)
+#define ListBox_FindStringExact(hwndCtl, indexStart, lpszFind) ((int)(DWORD)SendMessage((hwndCtl), LB_FINDSTRINGEXACT, (WPARAM)(int)(indexStart), (LPARAM)(LPCSTR)(lpszFind)))
+
+#define ListBox_SetItemHeight(hwndCtl, index, cy) ((int)(DWORD)SendMessage((hwndCtl), LB_SETITEMHEIGHT, (WPARAM)(int)(index), MAKELPARAM((cy), 0)))
+#define ListBox_GetItemHeight(hwndCtl, index) ((int)(DWORD)SendMessage((hwndCtl), LB_GETITEMHEIGHT, (WPARAM)(int)(index), 0L))
+#endif /* WINVER >= 0x030a */
+
+#define ListBox_Dir(hwndCtl, attrs, lpszFileSpec) ((int)(DWORD)SendMessage((hwndCtl), LB_DIR, (WPARAM)(UINT)(attrs), (LPARAM)(LPCSTR)(lpszFileSpec)))
+#define ListBox_AddFile(hwndCtl, lpszFilename) ((int)(DWORD)SendMessage((hwndCtl), LB_ADDFILE, 0, (LPARAM)(LPCSTR)(lpszFilename))) /* ;Internal */
+
+/****** ComboBox control message APIs ****************************************/
+
+#define ComboBox_Enable(hwndCtl, fEnable) EnableWindow((hwndCtl), (fEnable))
+
+#define ComboBox_GetText(hwndCtl, lpch, cchMax) GetWindowText((hwndCtl), (lpch), (cchMax))
+#define ComboBox_GetTextLength(hwndCtl) GetWindowTextLength(hwndCtl)
+#define ComboBox_SetText(hwndCtl, lpsz) SetWindowText((hwndCtl), (lpsz))
+
+#define ComboBox_LimitText(hwndCtl, cchLimit) ((int)(DWORD)SendMessage((hwndCtl), CB_LIMITTEXT, (WPARAM)(int)(cchLimit), 0L))
+
+#define ComboBox_GetEditSel(hwndCtl) ((DWORD)SendMessage((hwndCtl), CB_GETEDITSEL, 0, 0L))
+#define ComboBox_SetEditSel(hwndCtl, ichStart, ichEnd) ((int)(DWORD)SendMessage((hwndCtl), CB_SETEDITSEL, 0, MAKELPARAM((ichStart), (ichEnd))))
+
+#define ComboBox_GetCount(hwndCtl) ((int)(DWORD)SendMessage((hwndCtl), CB_GETCOUNT, 0, 0L))
+#define ComboBox_ResetContent(hwndCtl) ((int)(DWORD)SendMessage((hwndCtl), CB_RESETCONTENT, 0, 0L))
+
+#define ComboBox_AddString(hwndCtl, lpsz) ((int)(DWORD)SendMessage((hwndCtl), CB_ADDSTRING, 0, (LPARAM)(LPCSTR)(lpsz)))
+#define ComboBox_InsertString(hwndCtl, index, lpsz) ((int)(DWORD)SendMessage((hwndCtl), CB_INSERTSTRING, (WPARAM)(int)(index), (LPARAM)(LPCSTR)(lpsz)))
+
+#define ComboBox_AddItemData(hwndCtl, data) ((int)(DWORD)SendMessage((hwndCtl), CB_ADDSTRING, 0, (LPARAM)(data)))
+#define ComboBox_InsertItemData(hwndCtl, index, data) ((int)(DWORD)SendMessage((hwndCtl), CB_INSERTSTRING, (WPARAM)(int)(index), (LPARAM)(data)))
+
+#define ComboBox_DeleteString(hwndCtl, index) ((int)(DWORD)SendMessage((hwndCtl), CB_DELETESTRING, (WPARAM)(int)(index), 0L))
+
+#define ComboBox_GetLBTextLen(hwndCtl, index) ((int)(DWORD)SendMessage((hwndCtl), CB_GETLBTEXTLEN, (WPARAM)(int)(index), 0L))
+#define ComboBox_GetLBText(hwndCtl, index, lpszBuffer) ((int)(DWORD)SendMessage((hwndCtl), CB_GETLBTEXT, (WPARAM)(int)(index), (LPARAM)(LPCSTR)(lpszBuffer)))
+
+#define ComboBox_GetItemData(hwndCtl, index) ((LRESULT)(DWORD)SendMessage((hwndCtl), CB_GETITEMDATA, (WPARAM)(int)(index), 0L))
+#define ComboBox_SetItemData(hwndCtl, index, data) ((int)(DWORD)SendMessage((hwndCtl), CB_SETITEMDATA, (WPARAM)(int)(index), (LPARAM)(data)))
+
+#define ComboBox_FindString(hwndCtl, indexStart, lpszFind) ((int)(DWORD)SendMessage((hwndCtl), CB_FINDSTRING, (WPARAM)(int)(indexStart), (LPARAM)(LPCSTR)(lpszFind)))
+#define ComboBox_FindItemData(hwndCtl, indexStart, data) ((int)(DWORD)SendMessage((hwndCtl), CB_FINDSTRING, (WPARAM)(int)(indexStart), (LPARAM)(data)))
+
+#define ComboBox_GetCurSel(hwndCtl) ((int)(DWORD)SendMessage((hwndCtl), CB_GETCURSEL, 0, 0L))
+#define ComboBox_SetCurSel(hwndCtl, index) ((int)(DWORD)SendMessage((hwndCtl), CB_SETCURSEL, (WPARAM)(int)(index), 0L))
+
+#define ComboBox_SelectString(hwndCtl, indexStart, lpszSelect) ((int)(DWORD)SendMessage((hwndCtl), CB_SELECTSTRING, (WPARAM)(int)(indexStart), (LPARAM)(LPCSTR)(lpszSelect)))
+#define ComboBox_SelectItemData(hwndCtl, indexStart, data) ((int)(DWORD)SendMessage((hwndCtl), CB_SELECTSTRING, (WPARAM)(int)(indexStart), (LPARAM)(data)))
+
+#define ComboBox_Dir(hwndCtl, attrs, lpszFileSpec) ((int)(DWORD)SendMessage((hwndCtl), CB_DIR, (WPARAM)(UINT)(attrs), (LPARAM)(LPCSTR)(lpszFileSpec)))
+
+#define ComboBox_ShowDropdown(hwndCtl, fShow) ((BOOL)(DWORD)SendMessage((hwndCtl), CB_SHOWDROPDOWN, (WPARAM)(BOOL)(fShow), 0L))
+
+#if (WINVER >= 0x030a)
+#define ComboBox_FindStringExact(hwndCtl, indexStart, lpszFind) ((int)(DWORD)SendMessage((hwndCtl), CB_FINDSTRINGEXACT, (WPARAM)(int)(indexStart), (LPARAM)(LPCSTR)(lpszFind)))
+
+#define ComboBox_GetDroppedState(hwndCtl) ((BOOL)(DWORD)SendMessage((hwndCtl), CB_GETDROPPEDSTATE, 0, 0L))
+#define ComboBox_GetDroppedControlRect(hwndCtl, lprc) ((void)SendMessage((hwndCtl), CB_GETDROPPEDCONTROLRECT, 0, (LPARAM)(RECT FAR*)(lprc)))
+
+#define ComboBox_GetItemHeight(hwndCtl) ((int)(DWORD)SendMessage((hwndCtl), CB_GETITEMHEIGHT, 0, 0L))
+#define ComboBox_SetItemHeight(hwndCtl, cyItem) ((int)(DWORD)SendMessage((hwndCtl), CB_SETITEMHEIGHT, (WPARAM)(int)(index), 0L))
+
+#define ComboBox_GetExtendedUI(hwndCtl) ((UINT)(DWORD)SendMessage((hwndCtl), CB_GETEXTENDEDUI, 0, 0L))
+#define ComboBox_SetExtendedUI(hwndCtl, flags) ((int)(DWORD)SendMessage((hwndCtl), CB_SETEXTENDEDUI, (WPARAM)(UINT)(flags), 0L))
+#endif /* WINVER >= 0x030a */
+
+#ifndef RC_INVOKED
+#pragma pack() /* Revert to default packing */
+#endif /* RC_INVOKED */
+
+#ifdef __cplusplus
+} /* End of extern "C" { */
+#endif /* __cplusplus */
+
+#endif /* !_INC_WINDOWSX */
diff --git a/private/mvdm/wow16/inc/winexp.h b/private/mvdm/wow16/inc/winexp.h
new file mode 100644
index 000000000..672c8bb59
--- /dev/null
+++ b/private/mvdm/wow16/inc/winexp.h
@@ -0,0 +1,47 @@
+#ifndef NOATOM
+/* atom manager internals */
+#define ATOMSTRUC struct atomstruct
+typedef ATOMSTRUC *PATOM;
+typedef ATOMSTRUC {
+ PATOM chain;
+ WORD usage; /* Atoms are usage counted. */
+ BYTE len; /* length of ASCIZ name string */
+ BYTE name; /* beginning of ASCIZ name string */
+} ATOMENTRY;
+
+typedef struct {
+ int numEntries;
+ PATOM pAtom[ 1 ];
+} ATOMTABLE;
+ATOMTABLE * PASCAL pAtomTable;
+#endif
+
+LPSTR API lstrbscan(LPSTR, LPSTR);
+LPSTR API lstrbskip(LPSTR, LPSTR);
+
+int API OpenPathName(LPSTR, int);
+int API DeletePathName(LPSTR);
+WORD API _ldup(int);
+
+
+/* scheduler things that the world knows not */
+BOOL API WaitEvent( HANDLE );
+BOOL API PostEvent( HANDLE );
+BOOL API KillTask( HANDLE );
+
+/* print screen hooks */
+BOOL API SetPrtScHook(FARPROC);
+FARPROC API GetPrtScHook(void);
+
+
+/* scroll bar messages */
+#define SBM_SETPOS WM_USER+0
+#define SBM_GETPOS WM_USER+1
+#define SBM_SETRANGE WM_USER+2
+#define SBM_GETRANGE WM_USER+3
+#define SBM_ENABLE_ARROWS WM_USER+4
+
+/* module stuff */
+HANDLE API GetDSModule( WORD );
+HANDLE API GetDSInstance( WORD );
+
diff --git a/private/mvdm/wow16/inc/winnet.h b/private/mvdm/wow16/inc/winnet.h
new file mode 100644
index 000000000..cfa78729f
--- /dev/null
+++ b/private/mvdm/wow16/inc/winnet.h
@@ -0,0 +1,507 @@
+
+/*
+ * Windows/Network Interface
+ * Copyright (C) Microsoft 1989-1993
+ *
+ * Standard WINNET Driver Header File, spec version 3.10
+ */
+
+
+#ifndef _INC_WINNET
+#define _INC_WINNET /* #defined if windows.h has been included */
+
+#ifndef RC_INVOKED
+#pragma pack(1) /* Assume byte packing throughout */
+#endif /* RC_INVOKED */
+
+#ifdef __cplusplus
+extern "C" { /* Assume C declarations for C++ */
+#endif /* __cplusplus */
+
+typedef WORD far * LPWORD;
+
+#ifndef API
+#define API WINAPI
+#endif
+
+
+/*
+ * SPOOLING - CONTROLLING JOBS
+ */
+
+#define WNJ_NULL_JOBID 0
+
+
+WORD API WNetOpenJob(LPSTR,LPSTR,WORD,LPINT);
+WORD API WNetCloseJob(WORD,LPINT,LPSTR);
+WORD API WNetWriteJob(HANDLE,LPSTR,LPINT);
+WORD API WNetAbortJob(WORD,LPSTR);
+WORD API WNetHoldJob(LPSTR,WORD);
+WORD API WNetReleaseJob(LPSTR,WORD);
+WORD API WNetCancelJob(LPSTR,WORD);
+WORD API WNetSetJobCopies(LPSTR,WORD,WORD);
+
+/*
+ * SPOOLING - QUEUE AND JOB INFO
+ */
+
+typedef struct _queuestruct {
+ WORD pqName;
+ WORD pqComment;
+ WORD pqStatus;
+ WORD pqJobcount;
+ WORD pqPrinters;
+} QUEUESTRUCT;
+
+typedef QUEUESTRUCT far * LPQUEUESTRUCT;
+
+#define WNPRQ_ACTIVE 0x0
+#define WNPRQ_PAUSE 0x1
+#define WNPRQ_ERROR 0x2
+#define WNPRQ_PENDING 0x3
+#define WNPRQ_PROBLEM 0x4
+
+
+typedef struct _jobstruct {
+ WORD pjId;
+ WORD pjUsername;
+ WORD pjParms;
+ WORD pjPosition;
+ WORD pjStatus;
+ DWORD pjSubmitted;
+ DWORD pjSize;
+ WORD pjCopies;
+ WORD pjComment;
+} JOBSTRUCT;
+
+typedef JOBSTRUCT far * LPJOBSTRUCT;
+
+#define WNPRJ_QSTATUS 0x0007
+#define WNPRJ_QS_QUEUED 0x0000
+#define WNPRJ_QS_PAUSED 0x0001
+#define WNPRJ_QS_SPOOLING 0x0002
+#define WNPRJ_QS_PRINTING 0x0003
+#define WNPRJ_DEVSTATUS 0x0FF8
+#define WNPRJ_DS_COMPLETE 0x0008
+#define WNPRJ_DS_INTERV 0x0010
+#define WNPRJ_DS_ERROR 0x0020
+#define WNPRJ_DS_DESTOFFLINE 0x0040
+#define WNPRJ_DS_DESTPAUSED 0x0080
+#define WNPRJ_DS_NOTIFY 0x0100
+#define WNPRJ_DS_DESTNOPAPER 0x0200
+#define WNPRJ_DS_DESTFORMCHG 0x0400
+#define WNPRJ_DS_DESTCRTCHG 0x0800
+#define WNPRJ_DS_DESTPENCHG 0x1000
+
+#define SP_QUEUECHANGED 0x0500
+
+
+WORD API WNetWatchQueue(HWND,LPSTR,LPSTR,WORD);
+WORD API WNetUnwatchQueue(LPSTR);
+WORD API WNetLockQueueData(LPSTR,LPSTR,LPQUEUESTRUCT FAR *);
+WORD API WNetUnlockQueueData(LPSTR);
+
+
+/*
+ * CONNECTIONS
+ */
+
+UINT API WNetAddConnection(LPSTR,LPSTR,LPSTR);
+UINT API WNetCancelConnection(LPSTR,BOOL);
+UINT API WNetGetConnection(LPSTR,LPSTR, UINT FAR *);
+UINT API WNetRestoreConnection(HWND,LPSTR);
+
+/*
+ * CAPABILITIES
+ */
+
+#define WNNC_SPEC_VERSION 0x0001
+
+#define WNNC_NET_TYPE 0x0002
+#define WNNC_NET_NONE 0x0000
+#define WNNC_NET_MSNet 0x0100
+#define WNNC_NET_LanMan 0x0200
+#define WNNC_NET_NetWare 0x0300
+#define WNNC_NET_Vines 0x0400
+#define WNNC_NET_10NET 0x0500
+#define WNNC_NET_Locus 0x0600
+#define WNNC_NET_Sun_PC_NFS 0x0700
+#define WNNC_NET_LANstep 0x0800
+#define WNNC_NET_9TILES 0x0900
+#define WNNC_NET_LANtastic 0x0A00
+#define WNNC_NET_AS400 0x0B00
+#define WNNC_NET_FTP_NFS 0x0C00
+#define WNNC_NET_PATHWORKS 0x0D00
+#define WNNC_NET_MultiNet 0x8000
+#define WNNC_SUBNET_NONE 0x0000
+#define WNNC_SUBNET_MSNet 0x0001
+#define WNNC_SUBNET_LanMan 0x0002
+#define WNNC_SUBNET_WinWorkgroups 0x0004
+#define WNNC_SUBNET_NetWare 0x0008
+#define WNNC_SUBNET_Vines 0x0010
+#define WNNC_SUBNET_Other 0x0080
+
+#define WNNC_DRIVER_VERSION 0x0003
+
+#define WNNC_USER 0x0004
+#define WNNC_USR_GetUser 0x0001
+
+#define WNNC_CONNECTION 0x0006
+#define WNNC_CON_AddConnection 0x0001
+#define WNNC_CON_CancelConnection 0x0002
+#define WNNC_CON_GetConnections 0x0004
+#define WNNC_CON_AutoConnect 0x0008
+#define WNNC_CON_BrowseDialog 0x0010
+#define WNNC_CON_RestoreConnection 0x0020
+
+#define WNNC_PRINTING 0x0007
+#define WNNC_PRT_OpenJob 0x0002
+#define WNNC_PRT_CloseJob 0x0004
+#define WNNC_PRT_HoldJob 0x0010
+#define WNNC_PRT_ReleaseJob 0x0020
+#define WNNC_PRT_CancelJob 0x0040
+#define WNNC_PRT_SetJobCopies 0x0080
+#define WNNC_PRT_WatchQueue 0x0100
+#define WNNC_PRT_UnwatchQueue 0x0200
+#define WNNC_PRT_LockQueueData 0x0400
+#define WNNC_PRT_UnlockQueueData 0x0800
+#define WNNC_PRT_ChangeMsg 0x1000
+#define WNNC_PRT_AbortJob 0x2000
+#define WNNC_PRT_NoArbitraryLock 0x4000
+#define WNNC_PRT_WriteJob 0x8000
+
+#define WNNC_DIALOG 0x0008
+#define WNNC_DLG_DeviceMode 0x0001
+#define WNNC_DLG_BrowseDialog 0x0002
+#define WNNC_DLG_ConnectDialog 0x0004
+#define WNNC_DLG_DisconnectDialog 0x0008
+#define WNNC_DLG_ViewQueueDialog 0x0010
+#define WNNC_DLG_PropertyDialog 0x0020
+#define WNNC_DLG_ConnectionDialog 0x0040
+#define WNNC_DLG_PrinterConnectDialog 0x0080
+#define WNNC_DLG_SharesDialog 0x0100
+#define WNNC_DLG_ShareAsDialog 0x0200
+
+
+#define WNNC_ADMIN 0x0009
+#define WNNC_ADM_GetDirectoryType 0x0001
+#define WNNC_ADM_DirectoryNotify 0x0002
+#define WNNC_ADM_LongNames 0x0004
+#define WNNC_ADM_SetDefaultDrive 0x0008
+
+#define WNNC_ERROR 0x000A
+#define WNNC_ERR_GetError 0x0001
+#define WNNC_ERR_GetErrorText 0x0002
+
+
+WORD API WNetGetCaps(WORD);
+
+/*
+ * OTHER
+ */
+
+WORD API WNetGetUser(LPSTR,LPINT);
+
+/*
+ * BROWSE DIALOG
+ */
+
+#define WNBD_CONN_UNKNOWN 0x0
+#define WNBD_CONN_DISKTREE 0x1
+#define WNBD_CONN_PRINTQ 0x3
+#define WNBD_MAX_LENGTH 0x80 // path length, includes the NULL
+
+#define WNTYPE_DRIVE 1
+#define WNTYPE_FILE 2
+#define WNTYPE_PRINTER 3
+#define WNTYPE_COMM 4
+
+#define WNPS_FILE 0
+#define WNPS_DIR 1
+#define WNPS_MULT 2
+
+WORD API WNetDeviceMode(HWND);
+WORD API WNetBrowseDialog(HWND,WORD,LPSTR);
+WORD API WNetConnectDialog(HWND,WORD);
+WORD API WNetDisconnectDialog(HWND,WORD);
+WORD API WNetConnectionDialog(HWND,WORD);
+WORD API WNetViewQueueDialog(HWND,LPSTR);
+WORD API WNetPropertyDialog(HWND hwndParent, WORD iButton, WORD nPropSel,
+ LPSTR lpszName, WORD nType);
+WORD API WNetGetPropertyText(WORD iButton, WORD nPropSel, LPSTR lpszName,
+ LPSTR lpszButtonName, WORD cbButtonName, WORD nType);
+
+/*
+ The following APIs are not exported from USER.EXE. They must be
+ loaded from the active network driver like this:
+
+ HINSTANCE hinstNetDriver;
+ LPWNETSERVERBROWSEDIALOG lpDialogAPI;
+
+ hinstNetDriver = (HINSTANCE)WNetGetCaps(0xFFFF);
+ if (hinstNetDriver == NULL) {
+ // no network driver loaded
+ }
+ else {
+ lpDialogAPI = (LPWNETSERVERBROWSEDIALOG)GetProcAddress(hinstNetDriver,
+ (LPSTR)ORD_WNETSERVERBROWSEDIALOG);
+
+ if (lpDialogAPI == NULL) {
+ // currently installed network doesn't support this API
+ }
+ else {
+ (*lpDialogAPI)(hwndParent, lpszSectionName, lpszBuffer, cbBuffer, 0L);
+ }
+ }
+*/
+
+typedef WORD (API *LPWNETSHAREASDIALOG)(HWND hwndParent, WORD iType,
+ LPSTR lpszPath);
+typedef WORD (API *LPWNETSTOPSHAREDIALOG)(HWND hwndParent, WORD iType,
+ LPSTR lpszPath);
+typedef WORD (API *LPWNETSETDEFAULTDRIVE)(WORD idriveDefault);
+typedef WORD (API *LPWNETGETSHARECOUNT)(WORD iType);
+typedef WORD (API *LPWNETGETSHARENAME)(LPSTR lpszPath, LPSTR lpszBuf,
+ WORD cbBuf);
+typedef WORD (API *LPWNETSERVERBROWSEDIALOG)(HWND hwndParent,
+ LPSTR lpszSectionName,
+ LPSTR lpszBuffer,
+ WORD cbBuffer,
+ DWORD flFlags);
+typedef WORD (API *LPWNETGETSHAREPATH)(LPSTR lpszName, LPSTR lpszBuf,
+ WORD cbBuf);
+typedef WORD (API *LPWNETGETLASTCONNECTION)(WORD iType, LPWORD lpwConnIndex);
+typedef WORD (API *LPWNETEXITCONFIRM)(HWND hwndOwner, WORD iExitType);
+
+typedef BOOL (API *LPI_AUTOLOGON)(HWND hwndOwner, LPSTR lpszReserved,
+ BOOL fPrompt, BOOL FAR *lpfLoggedOn);
+typedef BOOL (API *LPI_LOGOFF)(HWND hwndOwner, LPSTR lpszReserved);
+typedef VOID (API *LPI_CHANGEPASSWORD)(HWND hwndOwner);
+typedef VOID (API *LPI_CHANGECACHEPASSWORD)(HWND hwndOwner);
+typedef WORD (API *LPI_CONNECTDIALOG)(HWND hwndParent, WORD iType);
+typedef WORD (API *LPI_CONNECTIONDIALOG)(HWND hwndParent, WORD iType);
+
+
+typedef struct tagPASSWORD_CACHE_ENTRY {
+ WORD cbEntry;
+ WORD cbResource;
+ WORD cbPassword;
+ BYTE iEntry;
+ BYTE nType;
+ BYTE abResource[1]; /* resource name, cbResource bytes long */
+ /* password follows immediately after */
+} PASSWORD_CACHE_ENTRY;
+
+typedef PASSWORD_CACHE_ENTRY FAR *LPPASSWORD_CACHE_ENTRY;
+
+typedef WORD (API *LPWNETCACHEPASSWORD)(LPSTR pbResource, WORD cbResource,
+ LPSTR pbPassword, WORD cbPassword,
+ BYTE nType);
+
+typedef WORD (API *LPWNETGETCACHEDPASSWORD)(LPSTR pbResource, WORD cbResource,
+ LPSTR pbPassword, LPWORD pcbPassword,
+ BYTE nType);
+
+typedef WORD (API *LPWNETREMOVECACHEDPASSWORD)(LPSTR pbResource,
+ WORD cbResource,
+ BYTE nType);
+
+/*
+ Typedef for the callback routine passed to WNetEnumCachedPasswords.
+ It will be called once for each entry that matches the criteria
+ requested. It should return TRUE if it wants the enumeration to
+ continue, FALSE to stop.
+*/
+typedef BOOL (API *CACHECALLBACK)( LPPASSWORD_CACHE_ENTRY pce );
+
+
+typedef WORD (API *LPWNETENUMCACHEDPASSWORDS)(LPSTR pbPrefix, WORD cbPrefix,
+ BYTE nType,
+ CACHECALLBACK pfnCallback);
+
+/*
+ * Ordinals in the network driver for APIs not exported by USER.
+ */
+#define ORD_I_AUTOLOGON 530
+#define ORD_I_CHANGEPASSWORD 531
+#define ORD_I_LOGOFF 532
+#define ORD_I_CONNECTIONDIALOG 533
+#define ORD_I_CHANGECACHEPASSWORD 534
+#define ORD_I_CONNECTDIALOG 535
+#define ORD_WNETSHARESDIALOG 140
+#define ORD_WNETSHAREASDIALOG 141
+#define ORD_WNETSTOPSHAREDIALOG 142
+#define ORD_WNETSETDEFAULTDRIVE 143
+#define ORD_WNETGETSHARECOUNT 144
+#define ORD_WNETGETSHARENAME 145
+
+#define ORD_WNETSERVERBROWSEDIALOG 146
+
+#define ORD_WNETGETSHAREPATH 147
+
+#define ORD_WNETGETLASTCONNECTION 148
+
+#define ORD_WNETEXITCONFIRM 149
+
+#define ORD_WNETCACHEPASSWORD 150
+#define ORD_WNETGETCACHEDPASSWORD 151
+#define ORD_WNETREMOVECACHEDPASSWORD 152
+#define ORD_WNETENUMCACHEDPASSWORDS 153
+
+/*
+ * the following nType values are only for the purposes of enumerating
+ * entries from the cache. note that PCE_ALL is reserved and should not
+ * be the nType value for any entry.
+*/
+
+#define PCE_DOMAIN 0x01 /* entry is for a domain */
+#define PCE_SERVER 0x02 /* entry is for a server */
+#define PCE_UNC 0x03 /* entry is for a server/share combo */
+
+#define PCE_NOTMRU 0x80 /* bit set if entry is exempt from MRU aging */
+#define PCE_ALL 0xff /* retrieve all entries */
+
+
+/*
+ * Defines for iExitType on WNetExitConfirm
+ */
+#define EXIT_CONFIRM 0
+#define EXIT_EXITING 1
+#define EXIT_CANCELED 2
+
+/*
+ * ADMIN
+ */
+
+#define WNDT_NORMAL 0
+#define WNDT_NETWORK 1
+
+#define WNDN_MKDIR 1
+#define WNDN_RMDIR 2
+#define WNDN_MVDIR 3
+
+WORD API WNetGetDirectoryType(LPSTR,LPINT);
+WORD API WNetDirectoryNotify(HWND,LPSTR,WORD);
+
+/*
+ * ERRORS
+ */
+
+WORD API WNetGetError(LPINT);
+WORD API WNetGetErrorText(WORD,LPSTR,LPINT);
+
+
+/*
+ * STATUS CODES
+ */
+
+/* General */
+
+#define WN_SUCCESS 0x0000
+#define WN_NOT_SUPPORTED 0x0001
+#define WN_NET_ERROR 0x0002
+#define WN_MORE_DATA 0x0003
+#define WN_BAD_POINTER 0x0004
+#define WN_BAD_VALUE 0x0005
+#define WN_BAD_PASSWORD 0x0006
+#define WN_ACCESS_DENIED 0x0007
+#define WN_FUNCTION_BUSY 0x0008
+#define WN_WINDOWS_ERROR 0x0009
+#define WN_BAD_USER 0x000A
+#define WN_OUT_OF_MEMORY 0x000B
+#define WN_CANCEL 0x000C
+#define WN_CONTINUE 0x000D
+
+/* Connection */
+
+#define WN_NOT_CONNECTED 0x0030
+#define WN_OPEN_FILES 0x0031
+#define WN_BAD_NETNAME 0x0032
+#define WN_BAD_LOCALNAME 0x0033
+#define WN_ALREADY_CONNECTED 0x0034
+#define WN_DEVICE_ERROR 0x0035
+#define WN_CONNECTION_CLOSED 0x0036
+
+/* Printing */
+
+#define WN_BAD_JOBID 0x0040
+#define WN_JOB_NOT_FOUND 0x0041
+#define WN_JOB_NOT_HELD 0x0042
+#define WN_BAD_QUEUE 0x0043
+#define WN_BAD_FILE_HANDLE 0x0044
+#define WN_CANT_SET_COPIES 0x0045
+#define WN_ALREADY_LOCKED 0x0046
+
+#define WN_NO_ERROR 0x0050
+
+/* stuff in user, not driver, for shell apps ;Internal */
+WORD API WNetErrorText(WORD,LPSTR,WORD); /* ;Internal */
+
+#ifdef LFN
+
+/* this is the data structure returned from LFNFindFirst and
+ * LFNFindNext. The last field, achName, is variable length. The size
+ * of the name in that field is given by cchName, plus 1 for the zero
+ * terminator.
+ */
+typedef struct _filefindbuf2
+ {
+ WORD fdateCreation;
+ WORD ftimeCreation;
+ WORD fdateLastAccess;
+ WORD ftimeLastAccess;
+ WORD fdateLastWrite;
+ WORD ftimeLastWrite;
+ DWORD cbFile;
+ DWORD cbFileAlloc;
+ WORD attr;
+ DWORD cbList;
+ BYTE cchName;
+ BYTE achName[1];
+ } FILEFINDBUF2, FAR * PFILEFINDBUF2;
+
+typedef BOOL (API *PQUERYPROC)( void );
+
+WORD API LFNFindFirst(LPSTR,WORD,LPINT,LPINT,WORD,PFILEFINDBUF2);
+WORD API LFNFindNext(HANDLE,LPINT,WORD,PFILEFINDBUF2);
+WORD API LFNFindClose(HANDLE);
+WORD API LFNGetAttribute(LPSTR,LPINT);
+WORD API LFNSetAttribute(LPSTR,WORD);
+WORD API LFNCopy(LPSTR,LPSTR,PQUERYPROC);
+WORD API LFNMove(LPSTR,LPSTR);
+WORD API LFNDelete(LPSTR);
+WORD API LFNMKDir(LPSTR);
+WORD API LFNRMDir(LPSTR);
+WORD API LFNGetVolumeLabel(WORD,LPSTR);
+WORD API LFNSetVolumeLabel(WORD,LPSTR);
+WORD API LFNParse(LPSTR,LPSTR,LPSTR);
+WORD API LFNVolumeType(WORD,LPINT);
+
+/* return values from LFNParse
+ */
+#define FILE_83_CI 0
+#define FILE_83_CS 1
+#define FILE_LONG 2
+
+/* volumes types from LFNVolumeType
+ */
+#define VOLUME_STANDARD 0
+#define VOLUME_LONGNAMES 1
+
+// will add others later, == DOS int 21h error codes.
+
+// this error code causes a call to WNetGetError, WNetGetErrorText
+// to get the error text.
+#define ERROR_NETWORKSPECIFIC 0xFFFF
+
+#endif
+
+#ifndef RC_INVOKED
+#pragma pack() /* Revert to default packing */
+#endif /* RC_INVOKED */
+
+#ifdef __cplusplus
+} /* End of extern "C" { */
+#endif /* __cplusplus */
+
+#endif /* _INC_WINDOWS */
diff --git a/private/mvdm/wow16/inc/winnls.h b/private/mvdm/wow16/inc/winnls.h
new file mode 100644
index 000000000..02ab30248
--- /dev/null
+++ b/private/mvdm/wow16/inc/winnls.h
@@ -0,0 +1,91 @@
+/***********************************************************************\
+* *
+* WINNLS.H - Far East input method editor (DBCS_IME) definitions *
+* *
+* History: *
+* 21-Oct-1991 bent *
+* initial merge of Far East 3.0 versions *
+* Should be updated to resolve local inconsistencies. *
+* *
+* Copyright (c) 1990 Microsoft Corporation *
+* *
+\***********************************************************************/
+
+typedef struct _tagDATETIME {
+ WORD year;
+ WORD month;
+ WORD day;
+ WORD hour;
+ WORD min;
+ WORD sec;
+} DATETIME;
+
+typedef struct _tagIMEPRO {
+ HWND hWnd;
+ DATETIME InstDate;
+ WORD wVersion;
+ BYTE szDescription[50];
+ BYTE szName[80];
+ BYTE szOptions[30];
+#ifdef TAIWAN
+ BYTE szUsrFontName[80];
+ BOOL fEnable;
+#endif
+} IMEPRO;
+typedef IMEPRO *PIMEPRO;
+typedef IMEPRO near *NPIMEPRO;
+typedef IMEPRO far *LPIMEPRO;
+
+void FAR PASCAL InquireWINNLS( void ); /* ;Internal */
+BOOL FAR PASCAL IMPGetIME( HWND, LPIMEPRO );
+BOOL FAR PASCAL IMPQueryIME( LPIMEPRO );
+BOOL FAR PASCAL IMPDeleteIME( LPIMEPRO );
+BOOL FAR PASCAL IMPAddIME( LPIMEPRO );
+BOOL FAR PASCAL IMPSetIME( HWND, LPIMEPRO );
+BOOL FAR PASCAL IMEModifyIME( LPSTR, LPIMEPRO ); /* ;Internal */
+WORD FAR PASCAL IMPGetDefaultIME( LPIMEPRO ); /* ;Internal */
+WORD FAR PASCAL IMPSetDefaultIME( LPIMEPRO ); /* ;Internal */
+BOOL FAR PASCAL WINNLSSetIMEHandle( LPSTR, HWND ); /* ;Internal */
+BOOL FAR PASCAL WINNLSSetIMEStatus( HWND, BOOL ); /* ;Internal */
+
+BOOL FAR PASCAL WINNLSEnableIME( HWND, BOOL );
+WORD FAR PASCAL WINNLSGetKeyState( void ); /* ;Internal */
+VOID FAR PASCAL WINNLSSetKeyState( WORD ); /* ;Internal */
+BOOL FAR PASCAL WINNLSGetEnableStatus( HWND );
+BOOL FAR PASCAL WINNLSSetKeyboardHook (BOOL); /* ;Internal */
+
+#ifdef KOREA
+BOOL FAR PASCAL WINNLSSetIMEHotkey( HWND, WORD, WORD );
+LONG FAR PASCAL WINNLSGetIMEHotkey( HWND );
+#else
+BOOL FAR PASCAL WINNLSSetIMEHotkey( HWND, WORD ); /* ;Internal */
+WORD FAR PASCAL WINNLSGetIMEHotkey( HWND );
+#endif //KOREA
+
+#ifdef TAIWAN
+typedef HANDLE HIME;
+
+/* Extended IME information*/
+typedef struct _tagIMEInfo {
+ BYTE szIMEName[7];
+ BYTE szPrompMessage[32];
+ WORD nMaxKeyLen;
+} IMEINFO;
+typedef IMEINFO far *LPIMEINFO;
+
+HWND FAR PASCAL WINNLSGetSysIME(void);
+void FAR PASCAL WINNLSSetSysIME(HWND);
+BOOL FAR PASCAL SwitchIM( WORD , WORD );
+BOOL ToNextIM(void);
+void SetFullAbcState(BOOL);
+BOOL EngChiSwitch(BOOL);
+void FAR PASCAL TimerProc(HWND,int,WORD,LONG);
+HWND FAR PASCAL IMPGetFullShapeHWnd(void);
+void FAR PASCAL IMPSetFullShapeHWnd(HWND);
+BOOL FAR PASCAL IMPSetFirstIME(HWND,LPIMEPRO);
+BOOL FAR PASCAL IMPGetFirstIME(HWND,LPIMEPRO);
+BOOL FAR PASCAL IMPDialogIME(LPIMEPRO,HWND);
+BOOL FAR PASCAL IMPEnableIME(HWND,LPIMEPRO,BOOL);
+BOOL FAR PASCAL IMPSetUsrFont(HWND,LPIMEPRO);
+BOOL FAR PASCAL WINNLSQueryIMEInfo(HWND,HWND,LPIMEINFO);
+#endif //TAIWAN
diff --git a/private/mvdm/wow16/inc/wmsyserr.h b/private/mvdm/wow16/inc/wmsyserr.h
new file mode 100644
index 000000000..086cd7a48
--- /dev/null
+++ b/private/mvdm/wow16/inc/wmsyserr.h
@@ -0,0 +1,37 @@
+/****************************************************************************/
+/* */
+/* WMSYSERR.H - */
+/* */
+/* Message Box String Defines */
+/* */
+/****************************************************************************/
+
+/* SysErrorBox() stuff */
+
+#define MAX_SEB_STYLES 7 /* number of SEB_* values */
+
+#define SEB_OK 1 /* Button with "OK". */
+#define SEB_CANCEL 2 /* Button with "Cancel" */
+#define SEB_YES 3 /* Button with "&Yes" */
+#define SEB_NO 4 /* Button with "&No" */
+#define SEB_RETRY 5 /* Button with "&Retry" */
+#define SEB_ABORT 6 /* Button with "&Abort" */
+#define SEB_IGNORE 7 /* Button with "&Ignore" */
+
+#define SEB_DEFBUTTON 0x8000 /* Mask to make this button default */
+
+#define SEB_BTN1 1 /* Button 1 was selected */
+#define SEB_BTN2 2 /* Button 1 was selected */
+#define SEB_BTN3 3 /* Button 1 was selected */
+
+/* SysErrorBox() button structure definition */
+
+typedef struct tagSEBBTN
+ {
+ unsigned int style;
+ BOOL finvert;
+ RECT rcbtn;
+ POINT pttext;
+ LPSTR psztext;
+ BYTE chaccel;
+ } SEBBTN;