Release 971101

Thu Oct 30 21:52:23 1997  Martin Boehme <boehme@informatik.mu-luebeck.de>

	* [windows/nonclient.c]
	Changed NC_TrackSysMenu to give the same behaviour as MS-Windows,
	i.e. system menu already appears when mouse button is depressed.
	Changed NC_HandleNCLButtonDblClk so that double clicks on scroll
	bar arrows are handled the same way as single clicks.

	* [windows/winpos.c]
	Fixed SetWindowPos32 to clear WIN_NO_REDRAW when SWP_SHOWWINDOW is
	set; this is the way MS-Windows behaves.

Thu Oct 30 21:08:57 1997  Morten Welinder  <terra@diku.dk>

	* [controls/status.c]
	In SW_SetText, fix condition, I hope.

	* [controls/menu.c]
 	(GetMenuState32): Don't mask return value. Print more debug info.
	(MENU_MenuBarCalcSize): Be more careful when printing debug
	information.
	(MENU_SetItemData): Empty strings are separators.

	* [graphics/x11drv/text.c]
	Don't prototype CLIPPING_IntersectClipRect.

	* [include/dc.h]
	Prototype CLIPPING_IntersectClipRect.

	* [objects/font.c]
	Remove non-portable (and faulty) smartness in FONT_TextMetric*to*.
	In CreateFont32W and CreateFont16, handle null font name.

	* [objects/text.c]
 	(TEXT_NextLine): Fix end-of-line bug.

	* [if1632/shell32.spec]
	Activate existing implementation of ExtractIconA.

	* [misc/shell.c]
	For Control_RunDLL, add types for parameters.

Thu Oct 30 14:54:11 1997  Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>

	* [controls/static.c] [include/windows.h] [misc/spy.c]
	Added some win32 defines to static controls, basic SS_BITMAP style
	handling implemented. [please add more, I am lacking knowledge and
	time]

	* [controls/status.c]
	part_num 255 seems to indicate whole statusline (win95 cdplayer.exe)

	* [if1632/thunk.c] [tools/build.c]
	Support lret and 0x66 lret calls for CallTo16_regs
	(needed for KERNEL32_45)
	Fixed KERNEL32_45, QT_Thunk (should work now).

	* [if1632/relay.c][if1632/builtin.c][tools/build.c][if1632/*32.spec]
	Added string dumping to relay debugging for win32 apifuncs.

	* [misc/ver.c]
	Fixed and cleaned up VerQueryValue*.

	* [multimedia/*.c][include/mmsystem.h][if1632/mmsystem.spec]
	  [if1632/winmm.spec]
	Win32 support for lowlevel multimedia functions.
	Added some mixer* lowlevel functions.
	Some small fixes in the audio lowlevel queue handling, code
	reformatting/cleanups.

	* [debugger/hash.c]
	Don't show difference between 16bit symbols if they are in
	different segments.

	* [objects/cursoricon.c]
	Added GetIconInfo (partial) and CreateIconIndirect.

	* [windows/mdi.c]
	Fixed some "bad class" problems and crashes in MDICreateChild,
	which happen in Win32 (jwp32.exe).

Wed Oct 29 00:57:27 1997  Bruce Milner  <Bruce.Milner@genetics.utah.edu>

	* [if1632/winaspi.spec] [misc/aspi.c] [include/aspi.c]
	  [documentation/aspi] [include/callback.h]
	Added support for 16 bit ASPI calls to linux generic SCSI.
	The support is not complete, but appears to run my Mustek
	scanner from within ipplus.exe.

Mon Oct 27 00:59:41 1997  Alex Korobka <alex@trantor.pharm.sunysb.edu>

	* [windows/dce.c]
	DC reuse framework.

Sun Oct 26 18:41:21 1997  Huw D M Davies <h.davies1@physics.oxford.ac.uk>

	* [graphics/x11drv/xfont.c]
	Substituted fonts are removed from the alias table. References to
	the old name are also updated.

	* [controls/combo.c]
	LB_SELECTSTRING32 not CB_SELECTSTRING32 should be sent to
	ComboLBox.

Sun Oct 26 14:25:00 1997  Nikita V. Youshchenko <yoush@cs.msu.su>

	* [include/drive.h] [files/drive.c] [msdos/int21.c]
	Partially implemented DOS drive mapping (int21 AX=440F).

Sat Oct 25 13:03:29 1997  Alexandre Julliard  <julliard@lrc.epfl.ch>

	* [debugger/debug.l]
	Support '.' in identifiers. Use "x . y" to access structure
	fields.

	* [debugger/hash.c] [loader/pe_image.c]
	Load entry points of Win32 modules only when entering the
	debugger.

	* [debugger/break.c]
	New function DEBUG_AddModuleBreakpoint() to set a breakpoint at
	the start of every module.

	* [files/file.c]
	FILE_mmap() can now fake mmap() for unaligned offsets or broken
	filesystems.

	* [include/callback.h] [misc/callback.c] [if1632/thunk.c]
	Use a table of callbacks instead of macros to differentiate
	between emulator and Winelib.

	* [loader/task.c]
	Initialize current directory from cwd, not from module path.

	* [tools/build.c]
	Read CallTo16 prototypes directly from thunk.c source file.

	* [windows/winproc.c] [windows/mdi.c]
	Added translation for WM_MDIACTIVATE and WM_MDIGETACTIVE.

Fri Oct 24 21:41:25 1997  Uwe Bonnes  <bon@elektron.ikp.tu-darmstadt.de>

	* [files/drive.c]
	Allow arguments like "a" for the drive related apis.

	* [memory/global.c]
	Keep the calculation for dwMemoryLoad in range.

	* [misc/crtdll.c]
	Make CRTDLL_getcwd use GetCurrentDirectory32A and alloc
	its memory if requested.
	Implemented CRTDLL_rename and CRTDLL_stat needed for
	lcc-win32:wedit.exe.
	Implemented CRTDLL__fullpath.

	* [misc/comm.c]
	High speed modes for the 16-bit mode Comm functions.

	* [misc/cpu.c]
	As applications may treat lpMaximumApplicationAddress as long,
	use a valid long number.

	* [misc/main.c]
	In SystemParametersInfo16 ignore SPI_GETHIGHCONTRAST too.

	* [misc/ole2nls.c]
	Implement LCMAP_UPPERCASE for LCMapString32.

	* [misc/wsprintf]
	Made WPRINTF_ParseFormatA understand %ws.

	* [win32/file.c]
	Ignore FILE_ATTRIBUTE_NORMAL.
	Stub for ReadFileEx.

Fri Oct 24 15:36:02 1997  Doug Ridgway <ridgway@routh.ucsd.edu>

	* [memory/local.c]
	Local heap exhaustion message now prints which builtin heap filled.

Fri Oct 24 00:46:34 1997  Huw D M Davies <h.davies1@physics.oxford.ac.uk>

	* [windows/dialog.c]
	Reversed CreateFont16/32W typo.

Thu Oct 23 23:44:20 1997  Kristian Nielsen  <kristian.nielsen@risoe.dk>

	* [if1632/user.spec]
	Fixed argument list for ChangeClipboardChain.

	* [windows/mdi.c]
	Pass correct hInstance to CreateWindow16() in MDICreateChild().

Mon Oct 20 11:51:24 1997  Carsten Fallesen <cf@it.dtu.dk>

	* [objects/metafile.c]
	Added support for META_SETTEXTCHAREXTRA.

	* [objects/region.c]
	Fixed crash in XPolygonRegion if there is only one point in 
	in the region.

	* [if1632/gdi32.spec][include/gdi.h][include/windows.h]
	  [objects/gdiobj.c]
	Completed OBJ_XXX defines in gdi.h, removed OBJ_XXX in gdiobj.c 
	and included gdi.h instead. Implemented GetObjectType32().

Thu Oct 16 17:21:32 1997  Philippe De Muyter  <phdm@info.ucl.ac.be>

	* [documentation/wine.texinfo]
	Fixed WIN32 and Makefiles entries of Reference manual node, that
	made makeinfo dump core.

Mon Oct 13 17:15:57 1997  Robert Wilhelm  <robert@physiol.med.tu-muenchen.de>

	* [if1632/crtdll.spec]
	Added missing math functions y0(), y1(), y2(), floor(), frexp(),
	ldexp(), modf().
diff --git a/include/aspi.h b/include/aspi.h
new file mode 100644
index 0000000..901aa9e
--- /dev/null
+++ b/include/aspi.h
@@ -0,0 +1,173 @@
+#if !defined(ASPI_H)
+#define ASPI_H
+
+#pragma pack(1)
+
+#define SS_PENDING	0x00
+#define SS_COMP		0x01
+#define SS_ABORTED	0x02
+#define SS_ERR		0x04
+#define SS_OLD_MANAGE	0xe1
+#define SS_ILLEGAL_MODE	0xe2
+#define SS_NO_ASPI	0xe3
+#define SS_FAILED_INIT	0xe4
+#define SS_INVALID_HA	0x81
+#define SS_INVALID_SRB	0xe0
+#define SS_ASPI_IS_BUSY	0xe5
+#define SS_BUFFER_TO_BIG	0xe6
+
+#define SC_HA_INQUIRY		0x00
+#define SC_GET_DEV_TYPE 	0x01
+#define SC_EXEC_SCSI_CMD	0x02
+#define SC_ABORT_SRB		0x03
+#define SC_RESET_DEV		0x04
+
+/* Host adapter status codes */
+#define HASTAT_OK		0x00
+#define HASTAT_SEL_TO		0x11
+#define HASTAT_DO_DU		0x12
+#define HASTAT_BUS_FREE		0x13
+#define HASTAT_PHASE_ERR	0x14
+
+/* Target status codes */
+#define STATUS_GOOD		0x00
+#define STATUS_CHKCOND		0x02
+#define STATUS_BUSY		0x08
+#define STATUS_RESCONF		0x18
+
+
+typedef union SRB16 * LPSRB16;
+
+struct SRB_HaInquiry16 {
+  BYTE	SRB_cmd;
+  BYTE	SRB_Status;
+  BYTE	SRB_HaId;
+  BYTE	SRB_Flags;
+  WORD	SRB_55AASignature;
+  WORD	SRB_ExtBufferSize;
+  BYTE	HA_Count;
+  BYTE	HA_SCSI_ID;
+  BYTE	HA_ManagerId[16];
+  BYTE	HA_Identifier[16];
+  BYTE	HA_Unique[16];
+  BYTE	HA_ExtBuffer[4];
+} WINE_PACKED;
+
+typedef struct SRB_HaInquiry16 SRB_HaInquiry16;
+
+struct SRB_ExecSCSICmd16 {
+  BYTE        SRB_Cmd;                // ASPI command code		(W)
+  BYTE        SRB_Status;             // ASPI command status byte	(R)
+  BYTE        SRB_HaId;               // ASPI host adapter number	(W)
+  BYTE        SRB_Flags;              // ASPI request flags		(W)
+  DWORD       SRB_Hdr_Rsvd;           // Reserved, MUST = 0		(-)
+  BYTE        SRB_Target;             // Target's SCSI ID		(W)
+  BYTE        SRB_Lun;                // Target's LUN number		(W)
+  DWORD       SRB_BufLen;             // Data Allocation LengthPG	(W/R)
+  BYTE        SRB_SenseLen;           // Sense Allocation Length	(W)
+  SEGPTR      SRB_BufPointer;         // Data Buffer Pointer		(W)
+  DWORD       SRB_Rsvd1;              // Reserved, MUST = 0		(-/W)
+  BYTE        SRB_CDBLen;             // CDB Length = 6			(W)
+  BYTE        SRB_HaStat;             // Host Adapter Status		(R)
+  BYTE        SRB_TargStat;           // Target Status			(R)
+  FARPROC16   SRB_PostProc;	      // Post routine			(W)
+  BYTE        SRB_Rsvd2[34];          // Reserved, MUST = 0
+  BYTE		CDBByte[0];	      // SCSI CBD - variable length	(W)
+  /* variable example for 6 byte cbd
+   * BYTE        CDBByte[6];             // SCSI CDB			(W)
+   * BYTE        SenseArea6[SENSE_LEN];  // Request Sense buffer 	(R)
+   */
+} WINE_PACKED ;
+
+typedef struct SRB_ExecSCSICmd16 SRB_ExecSCSICmd16;
+
+struct SRB_ExecSCSICmd32 {
+  BYTE        SRB_Cmd;            // ASPI command code = SC_EXEC_SCSI_CMD
+  BYTE        SRB_Status;         // ASPI command status byte
+  BYTE        SRB_HaId;           // ASPI host adapter number
+  BYTE        SRB_Flags;          // ASPI request flags
+  DWORD       SRB_Hdr_Rsvd;       // Reserved
+  BYTE        SRB_Target;         // Target's SCSI ID
+  BYTE        SRB_Lun;            // Target's LUN number
+  WORD        SRB_Rsvd1;          // Reserved for Alignment
+  DWORD       SRB_BufLen;         // Data Allocation Length
+  BYTE        *SRB_BufPointer;    // Data Buffer Point
+  BYTE        SRB_SenseLen;       // Sense Allocation Length
+  BYTE        SRB_CDBLen;         // CDB Length
+  BYTE        SRB_HaStat;         // Host Adapter Status
+  BYTE        SRB_TargStat;       // Target Status
+  void        (*SRB_PostProc)();  // Post routine
+  void        *SRB_Rsvd2;         // Reserved
+  BYTE        SRB_Rsvd3[16];      // Reserved for expansion
+  BYTE        CDBByte[16];        // SCSI CDB
+  BYTE        SenseArea[0];       // Request sense buffer - var length
+};
+
+typedef struct SRB_ExecSCSICmd32 SRB_ExecSCSICmd32;
+
+struct SRB_Abort16 {
+  BYTE        SRB_Cmd;            // ASPI command code = SC_ABORT_SRB
+  BYTE        SRB_Status;         // ASPI command status byte
+  BYTE        SRB_HaId;           // ASPI host adapter number
+  BYTE        SRB_Flags;          // ASPI request flags
+  DWORD       SRB_Hdr_Rsvd;       // Reserved, MUST = 0
+  LPSRB16     SRB_ToAbort;        // Pointer to SRB to abort
+} WINE_PACKED;
+
+typedef struct SRB_Abort16 SRB_Abort16;
+
+struct SRB_BusDeviceReset16 {
+  BYTE        SRB_Cmd;            // ASPI command code = SC_RESET_DEV
+  BYTE        SRB_Status;         // ASPI command status byte
+  BYTE        SRB_HaId;           // ASPI host adapter number
+  BYTE        SRB_Flags;          // ASPI request flags
+  DWORD       SRB_Hdr_Rsvd;       // Reserved, MUST = 0
+  BYTE        SRB_Target;         // Target's SCSI ID
+  BYTE        SRB_Lun;            // Target's LUN number
+  BYTE        SRB_ResetRsvd1[14]; // Reserved, MUST = 0
+  BYTE        SRB_HaStat;         // Host Adapter Status
+  BYTE        SRB_TargStat;       // Target Status
+  SEGPTR      SRB_PostProc;           // Post routine
+  BYTE        SRB_ResetRsvd2[34]; // Reserved, MUST = 0
+} WINE_PACKED;
+
+typedef struct SRB_BusDeviceReset16 SRB_BusDeviceReset16;
+
+struct SRB_GDEVBlock16 {
+  BYTE        SRB_Cmd;            // ASPI command code = SC_GET_DEV_TYPE
+  BYTE        SRB_Status;         // ASPI command status byte
+  BYTE        SRB_HaId;           // ASPI host adapter number
+  BYTE        SRB_Flags;          // ASPI request flags
+  DWORD       SRB_Hdr_Rsvd;       // Reserved, MUST = 0
+  BYTE        SRB_Target;         // Target's SCSI ID
+  BYTE        SRB_Lun;            // Target's LUN number
+  BYTE        SRB_DeviceType;     // Target's peripheral device type
+} WINE_PACKED;
+
+typedef struct SRB_GDEVBlock16 SRB_GDEVBlock16;
+
+
+
+struct SRB_Common16 {
+  BYTE	SRB_cmd;
+};
+
+
+typedef struct SRB_Common16 SRB_Common16;
+
+
+union SRB16 {
+  SRB_Common16		common;
+  SRB_HaInquiry16	inquiry;
+  SRB_ExecSCSICmd16	cmd;
+  SRB_Abort16		abort;
+  SRB_BusDeviceReset16	reset;
+  SRB_GDEVBlock16	devtype;
+};
+
+typedef union SRB16 SRB16;
+
+
+
+
+#endif
diff --git a/include/callback.h b/include/callback.h
index e2e230e..cbb235e 100644
--- a/include/callback.h
+++ b/include/callback.h
@@ -17,69 +17,48 @@
      IF1632_CallLargeStack( (int(*)())(func), (void *)(arg) ) : \
      ((int(*)())(func))((void *)arg))
 
-/* List of the 16-bit callback functions. This list is used  */
-/* by the build program to generate the file if1632/callto16.S */
+typedef struct
+{
+    VOID (CALLBACK *CallRegisterProc)( CONTEXT *, INT32 );
+    VOID (CALLBACK *CallTaskRescheduleProc)(void);
+    LRESULT (CALLBACK *CallWndProc)( WNDPROC16, HWND16, UINT16,
+                                     WPARAM16, LPARAM );
+    LRESULT (CALLBACK *CallDriverProc)( DRIVERPROC16, DWORD, HDRVR16,
+                                        UINT16, LPARAM, LPARAM );
+    LRESULT (CALLBACK *CallDriverCallback)( FARPROC16, HANDLE16, UINT16,
+                                            DWORD, LPARAM, LPARAM );
+    LRESULT (CALLBACK *CallTimeFuncProc)( FARPROC16, WORD, UINT16,
+                                          DWORD, LPARAM, LPARAM );
+    INT16 (CALLBACK *CallWindowsExitProc)( FARPROC16, INT16 );
+    INT16 (CALLBACK *CallWordBreakProc)( EDITWORDBREAKPROC16, SEGPTR, INT16,
+                                         INT16, INT16 );
+    VOID (CALLBACK *CallBootAppProc)( FARPROC16, HANDLE16, HFILE16 );
+    WORD (CALLBACK *CallLoadAppSegProc)( FARPROC16, HANDLE16, HFILE16, WORD );
+    VOID (CALLBACK *CallSystemTimerProc)( FARPROC16 );
+    LRESULT (CALLBACK *CallASPIPostProc)( FARPROC16, SEGPTR );
+    /* Following are the graphics driver callbacks */
+    WORD (CALLBACK *CallDrvControlProc)( FARPROC16, SEGPTR, WORD,
+                                         SEGPTR, SEGPTR );
+    WORD (CALLBACK *CallDrvEnableProc)( FARPROC16, SEGPTR, WORD, SEGPTR,
+                                        SEGPTR, SEGPTR );
+    WORD (CALLBACK *CallDrvEnumDFontsProc)( FARPROC16, SEGPTR, SEGPTR,
+                                            FARPROC16, SEGPTR );
+    WORD (CALLBACK *CallDrvEnumObjProc)( FARPROC16, SEGPTR, WORD, FARPROC16,
+                                         SEGPTR );
+    WORD (CALLBACK *CallDrvOutputProc)( FARPROC16, SEGPTR, WORD, WORD, SEGPTR,
+                                        SEGPTR, SEGPTR, SEGPTR, SEGPTR );
+    DWORD (CALLBACK *CallDrvRealizeProc)( FARPROC16, SEGPTR, WORD, SEGPTR,
+                                          SEGPTR, SEGPTR );
+    WORD (CALLBACK *CallDrvStretchBltProc)( FARPROC16, SEGPTR, WORD, WORD,
+                                            WORD, WORD, SEGPTR, WORD, WORD,
+                                            WORD, WORD, DWORD, SEGPTR, SEGPTR,
+                                            SEGPTR );
+    DWORD (CALLBACK *CallDrvExtTextOutProc)( FARPROC16, SEGPTR, WORD, WORD,
+                                             SEGPTR, SEGPTR, INT16, SEGPTR,
+                                             SEGPTR, SEGPTR, SEGPTR, SEGPTR,
+                                             WORD );
+} CALLBACKS_TABLE;
 
-#ifndef WINELIB
-
-extern LONG CALLBACK CallTo16_regs_     (const CONTEXT *context, INT32 offset);
-extern WORD CALLBACK CallTo16_word_     (FARPROC16);
-extern WORD CALLBACK CallTo16_word_w    (FARPROC16,WORD);
-extern LONG CALLBACK CallTo16_long_l    (FARPROC16,LONG);
-extern WORD CALLBACK CallTo16_word_ww   (FARPROC16,WORD,WORD);
-extern WORD CALLBACK CallTo16_word_wl   (FARPROC16,WORD,LONG);
-extern WORD CALLBACK CallTo16_word_ll   (FARPROC16,LONG,LONG);
-extern WORD CALLBACK CallTo16_word_www  (FARPROC16,WORD,WORD,WORD);
-extern WORD CALLBACK CallTo16_word_wwl  (FARPROC16,WORD,WORD,LONG);
-extern WORD CALLBACK CallTo16_word_wlw  (FARPROC16,WORD,LONG,WORD);
-extern LONG CALLBACK CallTo16_long_wwl  (FARPROC16,WORD,WORD,LONG);
-extern WORD CALLBACK CallTo16_word_llwl (FARPROC16,LONG,LONG,WORD,LONG);
-extern WORD CALLBACK CallTo16_word_lwll (FARPROC16,LONG,WORD,LONG,LONG);
-extern LONG CALLBACK CallTo16_long_wwwl (FARPROC16,WORD,WORD,WORD,LONG);
-extern WORD CALLBACK CallTo16_word_lwww (FARPROC16,LONG,WORD,WORD,WORD);
-extern WORD CALLBACK CallTo16_word_wwll (FARPROC16,WORD,WORD,LONG,LONG);
-extern WORD CALLBACK CallTo16_word_wllwl(FARPROC16,WORD,LONG,LONG,WORD,LONG);
-extern LONG CALLBACK CallTo16_long_lwwll(FARPROC16,LONG,WORD,WORD,LONG,LONG);
-extern WORD CALLBACK CallTo16_word_wwlll(FARPROC16,WORD,WORD,LONG,LONG,LONG);
-extern WORD CALLBACK CallTo16_word_wwwww(FARPROC16,WORD,WORD,WORD,WORD,WORD);
-extern WORD CALLBACK CallTo16_word_lwlll(FARPROC16,LONG,WORD,LONG,LONG,LONG);
-extern WORD CALLBACK CallTo16_word_llll (FARPROC16,LONG,LONG,LONG,LONG);
-extern LONG CALLBACK CallTo16_long_lwlll(FARPROC16,LONG,WORD,LONG,LONG,LONG);
-extern LONG CALLBACK CallTo16_word_lwwlllll(FARPROC16,LONG,WORD,WORD,LONG,LONG,
-                                            LONG,LONG,WORD);
-extern LONG CALLBACK CallTo16_long_lwwllwlllllw(FARPROC16,LONG,WORD,WORD,LONG,
-                                                LONG,WORD,LONG,LONG,LONG,LONG,
-                                                LONG,WORD);
-extern LONG CALLBACK CallTo16_word_lwwwwlwwwwllll(FARPROC16,LONG,WORD,WORD,
-                                                  WORD,WORD,LONG,WORD,WORD,
-                                                  WORD,WORD,LONG,LONG,LONG,
-                                                  LONG);
-
-#define CallDriverProc( func, dwId, msg, hdrvr, lparam1, lparam2 ) \
-    CallTo16_long_lwwll( func, dwId, msg, hdrvr, lparam1, lparam2 )
-#define CallDriverCallback( func, hdev, msg, user, lparam1, lparam2 ) \
-    CallTo16_word_wwlll( func, hdev, msg, user, lparam1, lparam2 )
-#define CallTimeFuncProc( func, id, msg, dwUser, dw1, dw2 ) \
-    CallTo16_word_wwlll( func, id, msg, dwUser, dw1, dw2 )
-#define CallWindowsExitProc( func, nExitType ) \
-    CallTo16_word_w( func, nExitType )
-#define CallWordBreakProc16( func, lpch, ichCurrent, cch, code ) \
-    CallTo16_word_lwww( func, lpch, ichCurrent, cch, code )
-
-#else  /* WINELIB */
-
-#define CallDriverProc( func, dwId, msg, hdrvr, lparam1, lparam2 ) \
-    (*func)( dwId, msg, hdrvr, lparam1, lparam2 )
-#define CallDriverCallback( func, hdev, msg, user, lparam1, lparam2 ) \
-    (*func)( hdev, msg, user, lparam1, lparam2 )
-#define CallTimeFuncProc( func, id, msg, dwUser, dw1, dw2 ) \
-    (*func)( id, msg, dwUser, dw1, dw2 )
-#define CallWindowsExitProc( func, nExitType ) \
-    (*func)( nExitType )
-#define CallWordBreakProc16( func, lpch, ichCurrent, cch, code ) \
-    (*func)( lpch, ichCurrent, cch, code )
-
-#endif  /* WINELIB */
-
+extern const CALLBACKS_TABLE *Callbacks;
 
 #endif /* __WINE_CALLBACK_H */
diff --git a/include/dc.h b/include/dc.h
index 192c2a3..f04a318 100644
--- a/include/dc.h
+++ b/include/dc.h
@@ -24,4 +24,7 @@
 
 extern const int DC_XROPfunction[];
 
+INT32 CLIPPING_IntersectClipRect( DC * dc, INT32 left, INT32 top,
+                                  INT32 right, INT32 bottom, UINT32 flags );
+
 #endif /* __WINE_DC_H */
diff --git a/include/dce.h b/include/dce.h
index 4fd109a..9718df6 100644
--- a/include/dce.h
+++ b/include/dce.h
@@ -20,6 +20,7 @@
 #define DCX_NORECOMPUTE      	0x00100000
 #define DCX_VALIDATE         	0x00200000
 
+#define DCX_DCEEMPTY		0x00000800
 #define DCX_DCEBUSY		0x00001000
 #define DCX_WINDOWPAINT		0x00020000
 #define DCX_KEEPCLIPRGN		0x00040000
@@ -47,7 +48,8 @@
 
 extern void  DCE_Init(void);
 extern DCE*  DCE_AllocDCE( HWND32 hWnd, DCE_TYPE type );
-extern void  DCE_FreeDCE( DCE *dce );
+extern DCE*  DCE_FreeDCE( DCE *dce );
+extern void  DCE_FreeWindowDCE( WND* );
 extern INT16 DCE_ExcludeRgn( HDC32, WND*, HRGN32 );
 extern HRGN32 DCE_GetVisRgn( HWND32, WORD );
 extern BOOL32 DCE_InvalidateDCE( WND*, RECT32* );
diff --git a/include/debug.h b/include/debug.h
index fc4dae8..365c0ea 100644
--- a/include/debug.h
+++ b/include/debug.h
@@ -7,6 +7,7 @@
 
 #ifdef DEBUG_NONE_EXT
 #undef DEBUG_ACCEL
+#undef DEBUG_ASPI
 #undef DEBUG_ATOM
 #undef DEBUG_BITBLT
 #undef DEBUG_BITMAP
@@ -27,7 +28,6 @@
 #undef DEBUG_DOSFS
 #undef DEBUG_DRIVER
 #undef DEBUG_EDIT
-#undef DEBUG_ENV
 #undef DEBUG_EVENT
 #undef DEBUG_EXEC
 #undef DEBUG_FILE
@@ -93,6 +93,7 @@
 
 #ifdef DEBUG_ALL_EXT
 #define DEBUG_ACCEL
+#define DEBUG_ASPI
 #define DEBUG_ATOM
 #define DEBUG_BITBLT
 #define DEBUG_BITMAP
@@ -113,7 +114,6 @@
 #define DEBUG_DOSFS
 #define DEBUG_DRIVER
 #define DEBUG_EDIT
-#define DEBUG_ENV
 #define DEBUG_EVENT
 #define DEBUG_EXEC
 #define DEBUG_FILE
@@ -185,6 +185,11 @@
 #else
     0,
 #endif
+#ifdef DEBUG_ASPI
+    1,
+#else
+    0,
+#endif
 #ifdef DEBUG_ATOM
     1,
 #else
@@ -285,11 +290,6 @@
 #else
     0,
 #endif
-#ifdef DEBUG_ENV
-    1,
-#else
-    0,
-#endif
 #ifdef DEBUG_EVENT
     1,
 #else
@@ -616,8 +616,21 @@
 #endif
 
 #ifdef DEBUG_RUNTIME
-#define dprintf_atom if(!debug_msg_enabled[1]) ; else fprintf
-#define debugging_atom debug_msg_enabled[1]
+#define dprintf_aspi if(!debug_msg_enabled[1]) ; else fprintf
+#define debugging_aspi debug_msg_enabled[1]
+#else
+#ifdef DEBUG_ASPI
+#define dprintf_aspi fprintf
+#define debugging_aspi 1
+#else
+#define dprintf_aspi while(0) fprintf
+#define debugging_aspi 0
+#endif
+#endif
+
+#ifdef DEBUG_RUNTIME
+#define dprintf_atom if(!debug_msg_enabled[2]) ; else fprintf
+#define debugging_atom debug_msg_enabled[2]
 #else
 #ifdef DEBUG_ATOM
 #define dprintf_atom fprintf
@@ -629,8 +642,8 @@
 #endif
 
 #ifdef DEBUG_RUNTIME
-#define dprintf_bitblt if(!debug_msg_enabled[2]) ; else fprintf
-#define debugging_bitblt debug_msg_enabled[2]
+#define dprintf_bitblt if(!debug_msg_enabled[3]) ; else fprintf
+#define debugging_bitblt debug_msg_enabled[3]
 #else
 #ifdef DEBUG_BITBLT
 #define dprintf_bitblt fprintf
@@ -642,8 +655,8 @@
 #endif
 
 #ifdef DEBUG_RUNTIME
-#define dprintf_bitmap if(!debug_msg_enabled[3]) ; else fprintf
-#define debugging_bitmap debug_msg_enabled[3]
+#define dprintf_bitmap if(!debug_msg_enabled[4]) ; else fprintf
+#define debugging_bitmap debug_msg_enabled[4]
 #else
 #ifdef DEBUG_BITMAP
 #define dprintf_bitmap fprintf
@@ -655,8 +668,8 @@
 #endif
 
 #ifdef DEBUG_RUNTIME
-#define dprintf_caret if(!debug_msg_enabled[4]) ; else fprintf
-#define debugging_caret debug_msg_enabled[4]
+#define dprintf_caret if(!debug_msg_enabled[5]) ; else fprintf
+#define debugging_caret debug_msg_enabled[5]
 #else
 #ifdef DEBUG_CARET
 #define dprintf_caret fprintf
@@ -668,8 +681,8 @@
 #endif
 
 #ifdef DEBUG_RUNTIME
-#define dprintf_cdaudio if(!debug_msg_enabled[5]) ; else fprintf
-#define debugging_cdaudio debug_msg_enabled[5]
+#define dprintf_cdaudio if(!debug_msg_enabled[6]) ; else fprintf
+#define debugging_cdaudio debug_msg_enabled[6]
 #else
 #ifdef DEBUG_CDAUDIO
 #define dprintf_cdaudio fprintf
@@ -681,8 +694,8 @@
 #endif
 
 #ifdef DEBUG_RUNTIME
-#define dprintf_class if(!debug_msg_enabled[6]) ; else fprintf
-#define debugging_class debug_msg_enabled[6]
+#define dprintf_class if(!debug_msg_enabled[7]) ; else fprintf
+#define debugging_class debug_msg_enabled[7]
 #else
 #ifdef DEBUG_CLASS
 #define dprintf_class fprintf
@@ -694,8 +707,8 @@
 #endif
 
 #ifdef DEBUG_RUNTIME
-#define dprintf_clipboard if(!debug_msg_enabled[7]) ; else fprintf
-#define debugging_clipboard debug_msg_enabled[7]
+#define dprintf_clipboard if(!debug_msg_enabled[8]) ; else fprintf
+#define debugging_clipboard debug_msg_enabled[8]
 #else
 #ifdef DEBUG_CLIPBOARD
 #define dprintf_clipboard fprintf
@@ -707,8 +720,8 @@
 #endif
 
 #ifdef DEBUG_RUNTIME
-#define dprintf_clipping if(!debug_msg_enabled[8]) ; else fprintf
-#define debugging_clipping debug_msg_enabled[8]
+#define dprintf_clipping if(!debug_msg_enabled[9]) ; else fprintf
+#define debugging_clipping debug_msg_enabled[9]
 #else
 #ifdef DEBUG_CLIPPING
 #define dprintf_clipping fprintf
@@ -720,8 +733,8 @@
 #endif
 
 #ifdef DEBUG_RUNTIME
-#define dprintf_combo if(!debug_msg_enabled[9]) ; else fprintf
-#define debugging_combo debug_msg_enabled[9]
+#define dprintf_combo if(!debug_msg_enabled[10]) ; else fprintf
+#define debugging_combo debug_msg_enabled[10]
 #else
 #ifdef DEBUG_COMBO
 #define dprintf_combo fprintf
@@ -733,8 +746,8 @@
 #endif
 
 #ifdef DEBUG_RUNTIME
-#define dprintf_comm if(!debug_msg_enabled[10]) ; else fprintf
-#define debugging_comm debug_msg_enabled[10]
+#define dprintf_comm if(!debug_msg_enabled[11]) ; else fprintf
+#define debugging_comm debug_msg_enabled[11]
 #else
 #ifdef DEBUG_COMM
 #define dprintf_comm fprintf
@@ -746,8 +759,8 @@
 #endif
 
 #ifdef DEBUG_RUNTIME
-#define dprintf_commdlg if(!debug_msg_enabled[11]) ; else fprintf
-#define debugging_commdlg debug_msg_enabled[11]
+#define dprintf_commdlg if(!debug_msg_enabled[12]) ; else fprintf
+#define debugging_commdlg debug_msg_enabled[12]
 #else
 #ifdef DEBUG_COMMDLG
 #define dprintf_commdlg fprintf
@@ -759,8 +772,8 @@
 #endif
 
 #ifdef DEBUG_RUNTIME
-#define dprintf_crtdll if(!debug_msg_enabled[12]) ; else fprintf
-#define debugging_crtdll debug_msg_enabled[12]
+#define dprintf_crtdll if(!debug_msg_enabled[13]) ; else fprintf
+#define debugging_crtdll debug_msg_enabled[13]
 #else
 #ifdef DEBUG_CRTDLL
 #define dprintf_crtdll fprintf
@@ -772,8 +785,8 @@
 #endif
 
 #ifdef DEBUG_RUNTIME
-#define dprintf_cursor if(!debug_msg_enabled[13]) ; else fprintf
-#define debugging_cursor debug_msg_enabled[13]
+#define dprintf_cursor if(!debug_msg_enabled[14]) ; else fprintf
+#define debugging_cursor debug_msg_enabled[14]
 #else
 #ifdef DEBUG_CURSOR
 #define dprintf_cursor fprintf
@@ -785,8 +798,8 @@
 #endif
 
 #ifdef DEBUG_RUNTIME
-#define dprintf_dc if(!debug_msg_enabled[14]) ; else fprintf
-#define debugging_dc debug_msg_enabled[14]
+#define dprintf_dc if(!debug_msg_enabled[15]) ; else fprintf
+#define debugging_dc debug_msg_enabled[15]
 #else
 #ifdef DEBUG_DC
 #define dprintf_dc fprintf
@@ -798,8 +811,8 @@
 #endif
 
 #ifdef DEBUG_RUNTIME
-#define dprintf_dde if(!debug_msg_enabled[15]) ; else fprintf
-#define debugging_dde debug_msg_enabled[15]
+#define dprintf_dde if(!debug_msg_enabled[16]) ; else fprintf
+#define debugging_dde debug_msg_enabled[16]
 #else
 #ifdef DEBUG_DDE
 #define dprintf_dde fprintf
@@ -811,8 +824,8 @@
 #endif
 
 #ifdef DEBUG_RUNTIME
-#define dprintf_dialog if(!debug_msg_enabled[16]) ; else fprintf
-#define debugging_dialog debug_msg_enabled[16]
+#define dprintf_dialog if(!debug_msg_enabled[17]) ; else fprintf
+#define debugging_dialog debug_msg_enabled[17]
 #else
 #ifdef DEBUG_DIALOG
 #define dprintf_dialog fprintf
@@ -824,8 +837,8 @@
 #endif
 
 #ifdef DEBUG_RUNTIME
-#define dprintf_dll if(!debug_msg_enabled[17]) ; else fprintf
-#define debugging_dll debug_msg_enabled[17]
+#define dprintf_dll if(!debug_msg_enabled[18]) ; else fprintf
+#define debugging_dll debug_msg_enabled[18]
 #else
 #ifdef DEBUG_DLL
 #define dprintf_dll fprintf
@@ -837,8 +850,8 @@
 #endif
 
 #ifdef DEBUG_RUNTIME
-#define dprintf_dosfs if(!debug_msg_enabled[18]) ; else fprintf
-#define debugging_dosfs debug_msg_enabled[18]
+#define dprintf_dosfs if(!debug_msg_enabled[19]) ; else fprintf
+#define debugging_dosfs debug_msg_enabled[19]
 #else
 #ifdef DEBUG_DOSFS
 #define dprintf_dosfs fprintf
@@ -850,8 +863,8 @@
 #endif
 
 #ifdef DEBUG_RUNTIME
-#define dprintf_driver if(!debug_msg_enabled[19]) ; else fprintf
-#define debugging_driver debug_msg_enabled[19]
+#define dprintf_driver if(!debug_msg_enabled[20]) ; else fprintf
+#define debugging_driver debug_msg_enabled[20]
 #else
 #ifdef DEBUG_DRIVER
 #define dprintf_driver fprintf
@@ -863,8 +876,8 @@
 #endif
 
 #ifdef DEBUG_RUNTIME
-#define dprintf_edit if(!debug_msg_enabled[20]) ; else fprintf
-#define debugging_edit debug_msg_enabled[20]
+#define dprintf_edit if(!debug_msg_enabled[21]) ; else fprintf
+#define debugging_edit debug_msg_enabled[21]
 #else
 #ifdef DEBUG_EDIT
 #define dprintf_edit fprintf
@@ -876,19 +889,6 @@
 #endif
 
 #ifdef DEBUG_RUNTIME
-#define dprintf_env if(!debug_msg_enabled[21]) ; else fprintf
-#define debugging_env debug_msg_enabled[21]
-#else
-#ifdef DEBUG_ENV
-#define dprintf_env fprintf
-#define debugging_env 1
-#else
-#define dprintf_env while(0) fprintf
-#define debugging_env 0
-#endif
-#endif
-
-#ifdef DEBUG_RUNTIME
 #define dprintf_event if(!debug_msg_enabled[22]) ; else fprintf
 #define debugging_event debug_msg_enabled[22]
 #else
@@ -1686,6 +1686,7 @@
 #ifdef DEBUG_DEFINE_VARIABLES
 static char *debug_msg_name[] = {
     "accel",
+    "aspi",
     "atom",
     "bitblt",
     "bitmap",
@@ -1706,7 +1707,6 @@
     "dosfs",
     "driver",
     "edit",
-    "env",
     "event",
     "exec",
     "file",
diff --git a/include/debugger.h b/include/debugger.h
index 9117373..2d7d025 100644
--- a/include/debugger.h
+++ b/include/debugger.h
@@ -145,6 +145,7 @@
 extern void DEBUG_DelBreakpoint( int num );
 extern void DEBUG_EnableBreakpoint( int num, BOOL32 enable );
 extern void DEBUG_InfoBreakpoints(void);
+extern void DEBUG_AddModuleBreakpoints(void);
 extern BOOL32 DEBUG_HandleTrap(void);
 extern BOOL32 DEBUG_ShouldContinue( enum exec_mode mode, int * count );
 extern enum exec_mode DEBUG_RestartExecution( enum exec_mode mode, int count );
diff --git a/include/drive.h b/include/drive.h
index f129bed..3520a1b 100644
--- a/include/drive.h
+++ b/include/drive.h
@@ -43,5 +43,6 @@
 extern int DRIVE_Chdir( int drive, const char *path );
 extern int DRIVE_Disable( int drive  );
 extern int DRIVE_Enable( int drive  );
+extern int DRIVE_SetLogicalMapping ( int existing_drive, int new_drive );
 
 #endif  /* __WINE_DRIVE_H */
diff --git a/include/file.h b/include/file.h
index bb33157..badc67a 100644
--- a/include/file.h
+++ b/include/file.h
@@ -43,10 +43,15 @@
 extern HFILE32 FILE_Dup2( HFILE32 hFile1, HFILE32 hFile2 );
 extern HFILE32 FILE_Open( LPCSTR path, INT32 mode );
 extern BOOL32 FILE_SetFileType( HFILE32 hFile, DWORD type );
-extern LPVOID FILE_mmap( FILE_OBJECT *file, LPVOID start,
+extern LPVOID FILE_mmap( HFILE32 hFile, LPVOID start,
                          DWORD size_high, DWORD size_low,
                          DWORD offset_high, DWORD offset_low,
                          int prot, int flags );
+extern LPVOID FILE_dommap( FILE_OBJECT *file, LPVOID start,
+                           DWORD size_high, DWORD size_low,
+                           DWORD offset_high, DWORD offset_low,
+                         int prot, int flags );
+extern int FILE_munmap( LPVOID start, DWORD size_high, DWORD size_low );
 extern HFILE32 _lcreat_uniq( LPCSTR path, INT32 attr );
 
 /* files/directory.c */
diff --git a/include/gdi.h b/include/gdi.h
index 17e2741..4f2c4e1 100644
--- a/include/gdi.h
+++ b/include/gdi.h
@@ -34,6 +34,21 @@
 } GDIOBJHDR;
 
 
+#define OBJ_PEN             1 
+#define OBJ_BRUSH           2 
+#define OBJ_DC              3 
+#define OBJ_METADC          4 
+#define OBJ_PAL             5 
+#define OBJ_FONT            6 
+#define OBJ_BITMAP          7 
+#define OBJ_REGION          8 
+#define OBJ_METAFILE        9 
+#define OBJ_MEMDC           10 
+#define OBJ_EXTPEN          11 
+#define OBJ_ENHMETADC       12 
+#define OBJ_ENHMETAFILE     13 
+
+
 typedef struct tagDeviceCaps
 {
     WORD   version;       /*   0: driver version */
diff --git a/include/mmsystem.h b/include/mmsystem.h
index 73b46d4..dce9cb0 100644
--- a/include/mmsystem.h
+++ b/include/mmsystem.h
@@ -8,35 +8,68 @@
 typedef LPSTR		    HPSTR;          /* a huge version of LPSTR */
 typedef LPCSTR			HPCSTR;         /* a huge version of LPCSTR */
 
-#define MAXWAVEDRIVERS 10
-#define MAXMIDIDRIVERS 10
-#define MAXAUXDRIVERS 10
-#define MAXMCIDRIVERS 32
+#pragma pack(1)
+
+#define MAXWAVEDRIVERS	10
+#define MAXMIDIDRIVERS	10
+#define MAXAUXDRIVERS	10
+#define MAXMCIDRIVERS	32
+#define MAXMIXERDRIVERS	10
 
 #define MAXPNAMELEN      32     /* max product name length (including NULL) */
 #define MAXERRORLENGTH   128    /* max error text length (including NULL) */
 
 typedef WORD    VERSION;        /* major (high byte), minor (low byte) */
 
+typedef UINT16	MMVERSION16;
+typedef UINT32	MMVERSION32;
+DECL_WINELIB_TYPE(MMVERSION);
+typedef UINT16	MCIDEVICEID16;
+typedef UINT32	MCIDEVICEID32;
+DECL_WINELIB_TYPE(MCIDEVICE);
+
 typedef struct {
-    UINT16    wType;              /* indicates the contents of the union */
+    UINT16    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,  *LPMMTIME;
+	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;
+} MMTIME16,  *LPMMTIME16;
+
+typedef struct {
+    UINT32    wType;
+    union {
+	DWORD ms;
+	DWORD sample;
+	DWORD cb;
+	struct {
+	    BYTE hour;
+	    BYTE min;
+	    BYTE sec;
+	    BYTE frame;
+	    BYTE fps;
+	    BYTE dummy;
+	    BYTE pad[2];
+	} smpte;
+	struct {
+	    DWORD songptrpos;
+	} midi;
+    } u;
+} MMTIME32,  *LPMMTIME32;
+DECL_WINELIB_TYPE(MMTIME);
+DECL_WINELIB_TYPE(LPMMTIME);
 
 #define TIME_MS         0x0001  /* time in milliseconds */
 #define TIME_SAMPLES    0x0002  /* number of wave samples */
@@ -129,7 +162,9 @@
 #define MM_PC_JOYSTICK          12      /* Joystick adapter */
 
 
-WORD WINAPI mmsystemGetVersion(void);
+UINT16 WINAPI mmsystemGetVersion16(void);
+UINT32 WINAPI mmsystemGetVersion32(void);
+#define mmsystemGetVersion WINELIB_NAME(mmsystemGetVersion)
 BOOL16 WINAPI sndPlaySound(LPCSTR lpszSoundName, UINT16 uFlags);
 BOOL32 WINAPI PlaySound32A(LPCSTR pszSound, HMODULE32 hmod, DWORD fdwSound);
 BOOL32 WINAPI PlaySound32W(LPCWSTR pszSound, HMODULE32 hmod, DWORD fdwSound);
@@ -158,6 +193,8 @@
 typedef HWAVEIN16 *LPHWAVEIN16;
 typedef HWAVEOUT16 *LPHWAVEOUT16;
 typedef LPDRVCALLBACK LPWAVECALLBACK;
+typedef HMIXER16 *LPHMIXER16;
+typedef HMIXER32 *LPHMIXER32;
 
 #define WOM_OPEN        MM_WOM_OPEN
 #define WOM_CLOSE       MM_WOM_CLOSE
@@ -172,15 +209,15 @@
 #define  WAVE_ALLOWSYNC        0x0002
 
 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 *lpNext;*/         
-    SEGPTR      lp16Next;               /* reserved for driver */
-    DWORD       reserved;               /* reserved for driver */
+    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 *lpNext;	/* reserved for driver */
+    DWORD       reserved;	/* reserved for driver */
 } WAVEHDR, *LPWAVEHDR;
 
 #define WHDR_DONE       0x00000001  /* done bit */
@@ -190,14 +227,38 @@
 #define WHDR_INQUEUE    0x00000010  /* reserved for driver */
 
 typedef struct {
-    UINT16    wMid;                  /* manufacturer ID */
-    UINT16    wPid;                  /* product ID */
-    VERSION vDriverVersion;        /* version of the driver */
-    char    szPname[MAXPNAMELEN];  /* product name (NULL terminated string) */
-    DWORD   dwFormats WINE_PACKED;             /* formats supported */
-    UINT16    wChannels;             /* number of sources supported */
-    DWORD   dwSupport WINE_PACKED;             /* functionality supported by driver */
-} WAVEOUTCAPS, *LPWAVEOUTCAPS;
+    WORD	wMid;			/* manufacturer ID */
+    WORD	wPid;			/* product ID */
+    MMVERSION16	vDriverVersion;		/* version of the driver */
+    CHAR	szPname[MAXPNAMELEN];	/* product name (0 terminated string) */
+    DWORD	dwFormats;		/* formats supported */
+    WORD	wChannels;		/* number of sources supported */
+    DWORD	dwSupport;		/* functionality supported by driver */
+} WAVEOUTCAPS16, *LPWAVEOUTCAPS16;
+
+typedef struct {
+    WORD	wMid;			/* manufacturer ID */
+    WORD	wPid;			/* product ID */
+    MMVERSION32	vDriverVersion;		/* version of the driver */
+    CHAR	szPname[MAXPNAMELEN];	/* product name (0 terminated string) */
+    DWORD	dwFormats;		/* formats supported */
+    WORD	wChannels;		/* number of sources supported */
+    WORD	wReserved1;		/* padding */
+    DWORD	dwSupport;		/* functionality supported by driver */
+} WAVEOUTCAPS32A, *LPWAVEOUTCAPS32A;
+
+typedef struct {
+    WORD	wMid;			/* manufacturer ID */
+    WORD	wPid;			/* product ID */
+    MMVERSION32	vDriverVersion;		/* version of the driver */
+    WCHAR	szPname[MAXPNAMELEN];	/* product name (0 terminated string) */
+    DWORD	dwFormats;		/* formats supported */
+    WORD	wChannels;		/* number of sources supported */
+    WORD	wReserved1;		/* padding */
+    DWORD	dwSupport;		/* functionality supported by driver */
+} WAVEOUTCAPS32W, *LPWAVEOUTCAPS32W;
+DECL_WINELIB_TYPE(WAVEOUTCAPS);
+DECL_WINELIB_TYPE(LPWAVEOUTCAPS);
 
 #define WAVECAPS_PITCH          0x0001   /* supports pitch control */
 #define WAVECAPS_PLAYBACKRATE   0x0002   /* supports playback rate control */
@@ -206,13 +267,34 @@
 #define WAVECAPS_SYNC           0x0010
 
 typedef struct {
-    UINT16    wMid;                    /* manufacturer ID */
-    UINT16    wPid;                    /* product ID */
-    VERSION vDriverVersion;          /* version of the driver */
-    char    szPname[MAXPNAMELEN];    /* product name (NULL terminated string) */
-    DWORD   dwFormats WINE_PACKED;               /* formats supported */
-    UINT16    wChannels;               /* number of channels supported */
-} WAVEINCAPS, *LPWAVEINCAPS;
+    WORD	wMid;			/* manufacturer ID */
+    WORD	wPid;			/* product ID */
+    MMVERSION16	vDriverVersion;		/* version of the driver */
+    CHAR	szPname[MAXPNAMELEN];	/* product name (0 terminated string) */
+    DWORD	dwFormats;		/* formats supported */
+    WORD	wChannels;		/* number of channels supported */
+} WAVEINCAPS16, *LPWAVEINCAPS16;
+
+typedef struct {
+    WORD	wMid;			/* manufacturer ID */
+    WORD	wPid;			/* product ID */
+    MMVERSION32	vDriverVersion;		/* version of the driver */
+    CHAR	szPname[MAXPNAMELEN];	/* product name (0 terminated string) */
+    DWORD	dwFormats;		/* formats supported */
+    WORD	wChannels;		/* number of channels supported */
+    WORD	wReserved1;
+} WAVEINCAPS32A, *LPWAVEINCAPS32A;
+typedef struct {
+    WORD	wMid;			/* manufacturer ID */
+    WORD	wPid;			/* product ID */
+    MMVERSION32	vDriverVersion;		/* version of the driver */
+    WCHAR	szPname[MAXPNAMELEN];	/* product name (0 terminated string) */
+    DWORD	dwFormats;		/* formats supported */
+    WORD	wChannels;		/* number of channels supported */
+    WORD	wReserved1;
+} WAVEINCAPS32W, *LPWAVEINCAPS32W;
+DECL_WINELIB_TYPE(WAVEINCAPS);
+DECL_WINELIB_TYPE(LPWAVEINCAPS);
 
 #define WAVE_INVALIDFORMAT     0x00000000       /* invalid format */
 #define WAVE_FORMAT_1M08       0x00000001       /* 11.025 kHz, Mono,   8-bit  */
@@ -228,76 +310,145 @@
 #define WAVE_FORMAT_4M16       0x00000400       /* 44.1   kHz, Mono,   16-bit */
 #define WAVE_FORMAT_4S16       0x00000800       /* 44.1   kHz, Stereo, 16-bit */
 
-/* general format structure common to all formats */
+/* General format structure common to all formats, same for Win16 and Win32 */
 typedef struct {
-    WORD    wFormatTag;						/* format type */
-    WORD    nChannels; 						/* number of channels */
-    DWORD   nSamplesPerSec WINE_PACKED;		/* sample rate */
-    DWORD   nAvgBytesPerSec WINE_PACKED;	/* for buffer estimation */
-    WORD    nBlockAlign; 					/* block size of data */
+    WORD	wFormatTag;	/* format type */
+    WORD	nChannels;	/* number of channels */
+    DWORD	nSamplesPerSec;	/* sample rate */
+    DWORD	nAvgBytesPerSec;/* for buffer estimation */
+    WORD	nBlockAlign; 	/* block size of data */
 } WAVEFORMAT, *LPWAVEFORMAT;
 
 #define WAVE_FORMAT_PCM     1
 
 typedef struct {
-    WAVEFORMAT  wf;
-    WORD        wBitsPerSample;
+    WAVEFORMAT	wf;
+    WORD	wBitsPerSample;
 } PCMWAVEFORMAT, *LPPCMWAVEFORMAT;
 
-UINT16 WINAPI waveOutGetNumDevs(void);
-UINT16 WINAPI waveOutGetDevCaps(UINT16 uDeviceID, WAVEOUTCAPS * lpCaps,
-                                UINT16 uSize);
-UINT16 WINAPI waveOutGetVolume(UINT16 uDeviceID, DWORD * lpdwVolume);
-UINT16 WINAPI waveOutSetVolume(UINT16 uDeviceID, DWORD dwVolume);
-UINT16 WINAPI waveOutGetErrorText(UINT16 uError, LPSTR lpText, UINT16 uSize);
-UINT16 WINAPI waveGetErrorText(UINT16 uError, LPSTR lpText, UINT16 uSize);
-UINT16 WINAPI waveOutOpen(HWAVEOUT16 * lphWaveOut, UINT16 uDeviceID,
-    const LPWAVEFORMAT lpFormat, DWORD dwCallback, DWORD dwInstance, DWORD dwFlags);
-UINT16 WINAPI waveOutClose(HWAVEOUT16 hWaveOut);
-UINT16 WINAPI waveOutPrepareHeader(HWAVEOUT16 hWaveOut,
-                                   WAVEHDR *lpWaveOutHdr, UINT16 uSize);
-UINT16 WINAPI waveOutUnprepareHeader(HWAVEOUT16 hWaveOut,
-                                     WAVEHDR *lpWaveOutHdr, UINT16 uSize);
-UINT16 WINAPI waveOutWrite(HWAVEOUT16 hWaveOut, WAVEHDR * lpWaveOutHdr,
-                           UINT16 uSize);
-UINT16 WINAPI waveOutPause(HWAVEOUT16 hWaveOut);
-UINT16 WINAPI waveOutRestart(HWAVEOUT16 hWaveOut);
-UINT16 WINAPI waveOutReset(HWAVEOUT16 hWaveOut);
-UINT16 WINAPI waveOutBreakLoop(HWAVEOUT16 hWaveOut);
-UINT16 WINAPI waveOutGetPosition(HWAVEOUT16 hWaveOut, MMTIME * lpInfo,
-                                 UINT16 uSize);
-UINT16 WINAPI waveOutGetPitch(HWAVEOUT16 hWaveOut, DWORD * lpdwPitch);
-UINT16 WINAPI waveOutSetPitch(HWAVEOUT16 hWaveOut, DWORD dwPitch);
-UINT16 WINAPI waveOutGetPlaybackRate(HWAVEOUT16 hWaveOut, DWORD * lpdwRate);
-UINT16 WINAPI waveOutSetPlaybackRate(HWAVEOUT16 hWaveOut, DWORD dwRate);
-UINT16 WINAPI waveOutGetID(HWAVEOUT16 hWaveOut, UINT16 * lpuDeviceID);
+/* dito same for Win16 / Win32 */
+typedef struct {
+    WORD	wFormatTag;	/* format type */
+    WORD	nChannels;	/* number of channels (i.e. mono, stereo...) */
+    DWORD	nSamplesPerSec;	/* sample rate */
+    DWORD	nAvgBytesPerSec;/* for buffer estimation */
+    WORD	nBlockAlign;	/* block size of data */
+    WORD	wBitsPerSample;	/* number of bits per sample of mono data */
+    WORD	cbSize;		/* the count in bytes of the size of */
+				/* extra information (after cbSize) */
+} WAVEFORMATEX,*LPWAVEFORMATEX;
 
-DWORD WINAPI waveOutMessage(HWAVEOUT16 hWaveOut, UINT16 uMessage, DWORD dw1,
-                            DWORD dw2);
+UINT16 WINAPI waveOutGetNumDevs16();
+UINT32 WINAPI waveOutGetNumDevs32();
+#define waveOutGetNumDevs WINELIB_NAME(waveOutGetNumDevs)
+UINT16 WINAPI waveOutGetDevCaps16(UINT16,LPWAVEOUTCAPS16,UINT16);
+UINT32 WINAPI waveOutGetDevCaps32A(UINT32,LPWAVEOUTCAPS32A,UINT32);
+UINT32 WINAPI waveOutGetDevCaps32W(UINT32,LPWAVEOUTCAPS32W,UINT32);
+#define waveOutGetDevCaps WINELIB_NAME_AW(waveOutGetDevCaps)
+UINT16 WINAPI waveOutGetVolume16(UINT16,DWORD*);
+UINT32 WINAPI waveOutGetVolume32(UINT32,DWORD*);
+#define waveOutGetVolume WINELIB_NAME(waveOutGetVolume)
+UINT16 WINAPI waveOutSetVolume16(UINT16,DWORD);
+UINT32 WINAPI waveOutSetVolume32(UINT32,DWORD);
+#define waveOutSetVolume WINELIB_NAME(waveOutSetVolume)
+UINT16 WINAPI waveOutGetErrorText16(UINT16,LPSTR,UINT16);
+UINT32 WINAPI waveOutGetErrorText32A(UINT32,LPSTR,UINT32);
+UINT32 WINAPI waveOutGetErrorText32W(UINT32,LPWSTR,UINT32);
+#define waveOutGetErrorText WINELIB_NAME_AW(waveOutGetErrorText)
+UINT16 WINAPI waveOutOpen16(HWAVEOUT16*,UINT16,const LPWAVEFORMATEX,DWORD,DWORD,DWORD);
+UINT32 WINAPI waveOutOpen32(HWAVEOUT32*,UINT32,const LPWAVEFORMATEX,DWORD,DWORD,DWORD);
+#define waveOutOpen WINELIB_NAME(waveOutOpen)
+UINT16 WINAPI waveOutClose16(HWAVEOUT16);
+UINT32 WINAPI waveOutClose32(HWAVEOUT32);
+#define waveOutClose WINELIB_NAME(waveOutClose)
+UINT16 WINAPI waveOutPrepareHeader16(HWAVEOUT16,WAVEHDR*,UINT16);
+UINT32 WINAPI waveOutPrepareHeader32(HWAVEOUT32,WAVEHDR*,UINT32);
+#define waveOutPrepareHeader WINELIB_NAME(waveOutPrepareHeader)
+UINT16 WINAPI waveOutUnprepareHeader16(HWAVEOUT16,WAVEHDR*,UINT16);
+UINT32 WINAPI waveOutUnprepareHeader32(HWAVEOUT32,WAVEHDR*,UINT32);
+#define waveOutUnprepareHeader WINELIB_NAME(waveOutUnprepareHeader)
+UINT16 WINAPI waveOutWrite16(HWAVEOUT16,WAVEHDR*,UINT16);
+UINT32 WINAPI waveOutWrite32(HWAVEOUT32,WAVEHDR*,UINT32);
+#define waveOutWrite WINELIB_NAME(waveOutWrite)
+UINT16 WINAPI waveOutPause16(HWAVEOUT16);
+UINT32 WINAPI waveOutPause32(HWAVEOUT32);
+#define waveOutPause WINELIB_NAME(waveOutPause)
+UINT16 WINAPI waveOutRestart16(HWAVEOUT16);
+UINT32 WINAPI waveOutRestart32(HWAVEOUT32);
+#define waveOutRestart WINELIB_NAME(waveOutRestart)
+UINT16 WINAPI waveOutReset16(HWAVEOUT16);
+UINT32 WINAPI waveOutReset32(HWAVEOUT32);
+#define waveOutReset WINELIB_NAME(waveOutReset)
+UINT16 WINAPI waveOutBreakLoop16(HWAVEOUT16);
+UINT32 WINAPI waveOutBreakLoop32(HWAVEOUT32);
+#define waveOutBreakLoop WINELIB_NAME(waveOutBreakLoop)
+UINT16 WINAPI waveOutGetPosition16(HWAVEOUT16,LPMMTIME16,UINT16);
+UINT32 WINAPI waveOutGetPosition32(HWAVEOUT32,LPMMTIME32,UINT32);
+#define waveOutGetPosition WINELIB_NAME(waveOutGetPosition)
+UINT16 WINAPI waveOutGetPitch16(HWAVEOUT16,DWORD*);
+UINT32 WINAPI waveOutGetPitch32(HWAVEOUT32,DWORD*);
+#define waveOutGetPitch WINELIB_NAME(waveOutGetPitch)
+UINT16 WINAPI waveOutSetPitch16(HWAVEOUT16,DWORD);
+UINT32 WINAPI waveOutSetPitch32(HWAVEOUT32,DWORD);
+#define waveOutSetPitch WINELIB_NAME(waveOutSetPitch)
+UINT16 WINAPI waveOutGetPlaybackRate16(HWAVEOUT16,DWORD*);
+UINT32 WINAPI waveOutGetPlaybackRate32(HWAVEOUT32,DWORD*);
+#define waveOutGetPlaybackRate WINELIB_NAME(waveOutGetPlaybackRate)
+UINT16 WINAPI waveOutSetPlaybackRate16(HWAVEOUT16,DWORD);
+UINT32 WINAPI waveOutSetPlaybackRate32(HWAVEOUT32,DWORD);
+#define waveOutSetPlaybackRate WINELIB_NAME(waveOutSetPlaybackRate)
+UINT16 WINAPI waveOutGetID16(HWAVEOUT16,UINT16*);
+UINT32 WINAPI waveOutGetID32(HWAVEOUT32,UINT32*);
+#define waveOutGetID WINELIB_NAME(waveOutGetID)
+DWORD WINAPI waveOutMessage16(HWAVEOUT16,UINT16,DWORD,DWORD);
+DWORD WINAPI waveOutMessage32(HWAVEOUT32,UINT32,DWORD,DWORD);
+#define waveOutMessage WINELIB_NAME(waveOutMessage)
 
-UINT16 WINAPI waveInGetNumDevs(void);
-UINT16 WINAPI waveInGetDevCaps(UINT16 uDeviceID, WAVEINCAPS * lpCaps,
-                               UINT16 uSize);
-UINT16 WINAPI waveInGetErrorText(UINT16 uError, LPSTR lpText, UINT16 uSize);
-UINT16 WINAPI waveInOpen(HWAVEIN16 * lphWaveIn, UINT16 uDeviceID,
-                         const LPWAVEFORMAT lpFormat, DWORD dwCallback,
-                         DWORD dwInstance, DWORD dwFlags);
-UINT16 WINAPI waveInClose(HWAVEIN16 hWaveIn);
-UINT16 WINAPI waveInPrepareHeader(HWAVEIN16 hWaveIn, WAVEHDR * lpWaveInHdr,
-                                  UINT16 uSize);
-UINT16 WINAPI waveInUnprepareHeader(HWAVEIN16 hWaveIn, WAVEHDR * lpWaveInHdr,
-                                    UINT16 uSize);
-UINT16 WINAPI waveInAddBuffer(HWAVEIN16 hWaveIn, WAVEHDR * lpWaveInHdr,
-                              UINT16 uSize);
-UINT16 WINAPI waveInStart(HWAVEIN16 hWaveIn);
-UINT16 WINAPI waveInStop(HWAVEIN16 hWaveIn);
-UINT16 WINAPI waveInReset(HWAVEIN16 hWaveIn);
-UINT16 WINAPI waveInGetPosition(HWAVEIN16 hWaveIn, MMTIME * lpInfo,
-                                UINT16 uSize);
-UINT16 WINAPI waveInGetID(HWAVEIN16 hWaveIn, UINT16 * lpuDeviceID);
+UINT16 WINAPI waveInGetNumDevs16();
+UINT32 WINAPI waveInGetNumDevs32();
+#define waveInGetNumDevs WINELIB_NAME(waveInGetNumDevs)
+UINT16 WINAPI waveInGetDevCaps16(UINT16,LPWAVEINCAPS16,UINT16);
+UINT32 WINAPI waveInGetDevCaps32A(UINT32,LPWAVEINCAPS32A,UINT32);
+UINT32 WINAPI waveInGetDevCaps32W(UINT32,LPWAVEINCAPS32W,UINT32);
+#define waveInGetDevCaps WINELIB_NAME_AW(waveInGetDevCaps)
+UINT16 WINAPI waveInGetErrorText16(UINT16,LPSTR,UINT16);
+UINT32 WINAPI waveInGetErrorText32A(UINT32,LPSTR,UINT32);
+UINT32 WINAPI waveInGetErrorText32W(UINT32,LPWSTR,UINT32);
+#define waveInGetErrorText WINELIB_NAME_AW(waveInGetErrorText)
+UINT16 WINAPI waveInOpen16(HWAVEIN16*,UINT16,const LPWAVEFORMAT,DWORD,DWORD,DWORD);
+UINT32 WINAPI waveInOpen32(HWAVEIN32*,UINT32,const LPWAVEFORMAT,DWORD,DWORD,DWORD);
+#define waveInOpen WINELIB_NAME(waveInOpen)
+UINT16 WINAPI waveInClose16(HWAVEIN16);
+UINT32 WINAPI waveInClose32(HWAVEIN32);
+#define waveInClose WINELIB_TYPE(waveInClose)
+UINT16 WINAPI waveInPrepareHeader16(HWAVEIN16,WAVEHDR*,UINT16);
+UINT32 WINAPI waveInPrepareHeader32(HWAVEIN32,WAVEHDR*,UINT32);
+#define waveInPrepareHeader WINELIB_NAME(waveInPrepareHeader)
+UINT16 WINAPI waveInUnprepareHeader16(HWAVEIN16,WAVEHDR*,UINT16);
+UINT32 WINAPI waveInUnprepareHeader32(HWAVEIN32,WAVEHDR*,UINT32);
+#define waveInUnprepareHeader WINELIB_NAME(waveInUnprepareHeader)
+UINT16 WINAPI waveInAddBuffer16(HWAVEIN16,WAVEHDR*,UINT16);
+UINT32 WINAPI waveInAddBuffer32(HWAVEIN32,WAVEHDR*,UINT32);
+#define waveInAddBuffer WINELIB_NAME(waveInAddBuffer)
+UINT16 WINAPI waveInStart16(HWAVEIN16);
+UINT32 WINAPI waveInStart32(HWAVEIN32);
+#define waveInStart WINELIB_NAME(waveInStart)
+UINT16 WINAPI waveInStop16(HWAVEIN16);
+UINT32 WINAPI waveInStop32(HWAVEIN32);
+#define waveInStop WINELIB_NAME(waveInStop)
+UINT16 WINAPI waveInReset16(HWAVEIN16);
+UINT32 WINAPI waveInReset32(HWAVEIN32);
+#define waveInReset WINELIB_NAME(waveInReset)
+UINT16 WINAPI waveInGetPosition16(HWAVEIN16,LPMMTIME16,UINT16);
+UINT32 WINAPI waveInGetPosition32(HWAVEIN32,LPMMTIME32,UINT32);
+#define waveInGetPosition WINELIB_NAME(waveInGetPosition)
+UINT16 WINAPI waveInGetID16(HWAVEIN16,UINT16*);
+UINT32 WINAPI waveInGetID32(HWAVEIN32,UINT32*);
+#define waveInGetID WINELIB_NAME(waveInGetID)
 
-DWORD WINAPI waveInMessage(HWAVEIN16 hWaveIn, UINT16 uMessage, DWORD dw1,
-                           DWORD dw2);
+DWORD WINAPI waveInMessage16(HWAVEIN16,UINT16,DWORD,DWORD);
+DWORD WINAPI waveInMessage32(HWAVEIN32,UINT32,DWORD,DWORD);
+#define waveInMessage WINELIB_NAME(waveInMessage)
 
 #define MIDIERR_UNPREPARED    (MIDIERR_BASE + 0)   /* header not prepared */
 #define MIDIERR_STILLPLAYING  (MIDIERR_BASE + 1)   /* still something playing */
@@ -338,16 +489,43 @@
 #define MIDI_UNCACHE        4
 
 typedef struct {
-    UINT16    wMid;                  /* manufacturer ID */
-    UINT16    wPid;                  /* product ID */
-    VERSION vDriverVersion;        /* version of the driver */
-    char    szPname[MAXPNAMELEN];  /* product name (NULL terminated string) */
-    UINT16    wTechnology;           /* type of device */
-    UINT16    wVoices;               /* # of voices (internal synth only) */
-    UINT16    wNotes;                /* max # of notes (internal synth only) */
-    UINT16    wChannelMask;          /* channels used (internal synth only) */
-    DWORD   dwSupport WINE_PACKED;             /* functionality supported by driver */
-} MIDIOUTCAPS, *LPMIDIOUTCAPS;
+    WORD	wMid;		/* manufacturer ID */
+    WORD	wPid;		/* product ID */
+    MMVERSION16	vDriverVersion;	/* version of the driver */
+    CHAR	szPname[MAXPNAMELEN];/* product name (NULL terminated string) */
+    WORD	wTechnology;	/* type of device */
+    WORD	wVoices;	/* # of voices (internal synth only) */
+    WORD	wNotes;		/* max # of notes (internal synth only) */
+    WORD	wChannelMask;	/* channels used (internal synth only) */
+    DWORD	dwSupport;	/* functionality supported by driver */
+} MIDIOUTCAPS16, *LPMIDIOUTCAPS16;
+
+typedef struct {
+    WORD	wMid;		/* manufacturer ID */
+    WORD	wPid;		/* product ID */
+    MMVERSION32	vDriverVersion;	/* version of the driver */
+    CHAR	szPname[MAXPNAMELEN];/* product name (NULL terminated string) */
+    WORD	wTechnology;	/* type of device */
+    WORD	wVoices;	/* # of voices (internal synth only) */
+    WORD	wNotes;		/* max # of notes (internal synth only) */
+    WORD	wChannelMask;	/* channels used (internal synth only) */
+    DWORD	dwSupport;	/* functionality supported by driver */
+} MIDIOUTCAPS32A, *LPMIDIOUTCAPS32A;
+
+typedef struct {
+    WORD	wMid;		/* manufacturer ID */
+    WORD	wPid;		/* product ID */
+    MMVERSION32	vDriverVersion;	/* version of the driver */
+    WCHAR	szPname[MAXPNAMELEN];/* product name (NULL terminated string) */
+    WORD	wTechnology;	/* type of device */
+    WORD	wVoices;	/* # of voices (internal synth only) */
+    WORD	wNotes;		/* max # of notes (internal synth only) */
+    WORD	wChannelMask;	/* channels used (internal synth only) */
+    DWORD	dwSupport;	/* functionality supported by driver */
+} MIDIOUTCAPS32W, *LPMIDIOUTCAPS32W;
+
+DECL_WINELIB_TYPE_AW(MIDIOUTCAPS);
+DECL_WINELIB_TYPE_AW(LPMIDIOUTCAPS);
 
 #define MOD_MIDIPORT    1  /* output port */
 #define MOD_SYNTH       2  /* generic internal synth */
@@ -355,87 +533,176 @@
 #define MOD_FMSYNTH     4  /* FM internal synth */
 #define MOD_MAPPER      5  /* MIDI mapper */
 
-#define MIDICAPS_VOLUME          0x0001  /* supports volume control */
-#define MIDICAPS_LRVOLUME        0x0002  /* separate left-right volume control */
-#define MIDICAPS_CACHE           0x0004
+#define MIDICAPS_VOLUME		0x0001  /* supports volume control */
+#define MIDICAPS_LRVOLUME	0x0002  /* separate left-right volume control */
+#define MIDICAPS_CACHE		0x0004
 
 typedef struct {
-    UINT16    wMid;                  /* manufacturer ID */
-    UINT16    wPid;                  /* product ID */
-    VERSION vDriverVersion;        /* version of the driver */
-    char    szPname[MAXPNAMELEN];  /* product name (NULL terminated string) */
-} MIDIINCAPS, *LPMIDIINCAPS;
+    WORD	wMid;		/* manufacturer ID */
+    WORD	wPid;		/* product ID */
+    MMVERSION16	vDriverVersion;	/* version of the driver */
+    CHAR	szPname[MAXPNAMELEN];/* product name (NULL terminated string) */
+    DWORD	dwSupport;	/* included in win95 and higher */
+} MIDIINCAPS16, *LPMIDIINCAPS16;
 
 typedef struct {
-    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 *lpNext;       /* reserved for driver */
-    DWORD       reserved;             /* reserved for driver */
+    WORD	wMid;		/* manufacturer ID */
+    WORD	wPid;		/* product ID */
+    MMVERSION32	vDriverVersion;	/* version of the driver */
+    CHAR	szPname[MAXPNAMELEN];/* product name (NULL terminated string) */
+    DWORD	dwSupport;	/* included in win95 and higher */
+} MIDIINCAPS32A, *LPMIDIINCAPS32A;
+
+typedef struct {
+    WORD	wMid;		/* manufacturer ID */
+    WORD	wPid;		/* product ID */
+    MMVERSION32	vDriverVersion;	/* version of the driver */
+    WCHAR	szPname[MAXPNAMELEN];/* product name (NULL terminated string) */
+    DWORD	dwSupport;	/* included in win95 and higher */
+} MIDIINCAPS32W, *LPMIDIINCAPS32W;
+
+DECL_WINELIB_TYPE_AW(MIDIINCAPS);
+DECL_WINELIB_TYPE_AW(LPMIDIINCAPS);
+
+typedef struct {
+    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 *lpNext;	/* reserved for driver */
+    DWORD	reserved;	/* reserved for driver */
 } MIDIHDR, *LPMIDIHDR;
 
 #define MHDR_DONE       0x00000001       /* done bit */
 #define MHDR_PREPARED   0x00000002       /* set if header prepared */
 #define MHDR_INQUEUE    0x00000004       /* reserved for driver */
 
-UINT16 WINAPI midiOutGetNumDevs(void);
-UINT16 WINAPI midiOutGetDevCaps(UINT16 uDeviceID,
-    MIDIOUTCAPS * lpCaps, UINT16 uSize);
-UINT16 WINAPI midiOutGetVolume(UINT16 uDeviceID, DWORD * lpdwVolume);
-UINT16 WINAPI midiOutSetVolume(UINT16 uDeviceID, DWORD dwVolume);
-UINT16 WINAPI midiOutGetErrorText(UINT16 uError, LPSTR lpText, UINT16 uSize);
-UINT16 WINAPI midiGetErrorText(UINT16 uError, LPSTR lpText, UINT16 uSize);
-UINT16 WINAPI midiOutOpen(HMIDIOUT16 * lphMidiOut, UINT16 uDeviceID,
-    DWORD dwCallback, DWORD dwInstance, DWORD dwFlags);
-UINT16 WINAPI midiOutClose(HMIDIOUT16 hMidiOut);
-UINT16 WINAPI midiOutPrepareHeader(HMIDIOUT16 hMidiOut,
-    MIDIHDR * lpMidiOutHdr, UINT16 uSize);
-UINT16 WINAPI midiOutUnprepareHeader(HMIDIOUT16 hMidiOut,
-    MIDIHDR * lpMidiOutHdr, UINT16 uSize);
-UINT16 WINAPI midiOutShortMsg(HMIDIOUT16 hMidiOut, DWORD dwMsg);
-UINT16 WINAPI midiOutLongMsg(HMIDIOUT16 hMidiOut,
-    MIDIHDR * lpMidiOutHdr, UINT16 uSize);
-UINT16 WINAPI midiOutReset(HMIDIOUT16 hMidiOut);
-UINT16 WINAPI midiOutCachePatches(HMIDIOUT16 hMidiOut,
-    UINT16 uBank, WORD * lpwPatchArray, UINT16 uFlags);
-UINT16 WINAPI midiOutCacheDrumPatches(HMIDIOUT16 hMidiOut,
-    UINT16 uPatch, WORD * lpwKeyArray, UINT16 uFlags);
-UINT16 WINAPI midiOutGetID(HMIDIOUT16 hMidiOut, UINT16 * lpuDeviceID);
+UINT16 WINAPI midiOutGetNumDevs16();
+UINT32 WINAPI midiOutGetNumDevs32();
+#define midiOutGetNumDevs WINELIB_NAME(midiOutGetNumDevs)
+UINT16 WINAPI midiOutGetDevCaps16(UINT16,LPMIDIOUTCAPS16,UINT16);
+UINT32 WINAPI midiOutGetDevCaps32A(UINT32,LPMIDIOUTCAPS32A,UINT32);
+UINT32 WINAPI midiOutGetDevCaps32W(UINT32,LPMIDIOUTCAPS32W,UINT32);
+#define midiOutGetDevCaps WINELIB_NAME_AW(midiOutGetDevCaps)
+UINT16 WINAPI midiOutGetVolume16(UINT16,DWORD*);
+UINT32 WINAPI midiOutGetVolume32(UINT32,DWORD*);
+#define midiOutGetVolume WINELIB_NAME(midiOutGetVolume)
+UINT16 WINAPI midiOutSetVolume16(UINT16,DWORD);
+UINT32 WINAPI midiOutSetVolume32(UINT32,DWORD);
+#define midiOutSetVolume WINELIB_NAME(midiOutSetVolume)
+UINT16 WINAPI midiOutGetErrorText16(UINT16,LPSTR,UINT16);
+UINT32 WINAPI midiOutGetErrorText32A(UINT32,LPSTR,UINT32);
+UINT32 WINAPI midiOutGetErrorText32W(UINT32,LPWSTR,UINT32);
+#define midiOutGetErrorText WINELIB_NAME_AW(midiOutGetErrorText)
+UINT16 WINAPI midiGetErrorText(UINT16,LPSTR,UINT16);
+UINT16 WINAPI midiOutOpen16(HMIDIOUT16*,UINT16,DWORD,DWORD,DWORD);
+UINT32 WINAPI midiOutOpen32(HMIDIOUT32*,UINT32,DWORD,DWORD,DWORD);
+#define midiOutOpen WINELIB_NAME(midiOutOpen)
+UINT16 WINAPI midiOutClose16(HMIDIOUT16);
+UINT32 WINAPI midiOutClose32(HMIDIOUT32);
+#define midiOutClose WINELIB_NAME(midiOutClose)
+UINT16 WINAPI midiOutPrepareHeader16(HMIDIOUT16,MIDIHDR*,UINT16);
+UINT32 WINAPI midiOutPrepareHeader32(HMIDIOUT32,MIDIHDR*,UINT32);
+#define midiOutPrepareHeader WINELIB_NAME(midiOutPrepareHeader)
+UINT16 WINAPI midiOutUnprepareHeader16(HMIDIOUT16,MIDIHDR*,UINT16);
+UINT32 WINAPI midiOutUnprepareHeader32(HMIDIOUT32,MIDIHDR*,UINT32);
+#define midiOutUnprepareHeader WINELIB_NAME(midiOutUnprepareHeader)
+UINT16 WINAPI midiOutShortMsg16(HMIDIOUT16,DWORD);
+UINT32 WINAPI midiOutShortMsg32(HMIDIOUT32,DWORD);
+#define midiOutShortMsg WINELIB_NAME(midiOutShortMsg)
+UINT16 WINAPI midiOutLongMsg16(HMIDIOUT16,MIDIHDR*,UINT16);
+UINT32 WINAPI midiOutLongMsg32(HMIDIOUT32,MIDIHDR*,UINT32);
+#define midiOutLongMsg WINELIB_NAME(midiOutLongMsg)
+UINT16 WINAPI midiOutReset16(HMIDIOUT16);
+UINT32 WINAPI midiOutReset32(HMIDIOUT32);
+#define midiOutReset WINELIB_NAME(midiOutReset)
+UINT16 WINAPI midiOutCachePatches16(HMIDIOUT16,UINT16,WORD*,UINT16);
+UINT32 WINAPI midiOutCachePatches32(HMIDIOUT32,UINT32,WORD*,UINT32);
+#define midiOutCachePatches WINELIB_NAME(midiOutCachePatches)
+UINT16 WINAPI midiOutCacheDrumPatches16(HMIDIOUT16,UINT16,WORD*,UINT16);
+UINT32 WINAPI midiOutCacheDrumPatches32(HMIDIOUT32,UINT32,WORD*,UINT32);
+#define midiOutCacheDrumPatches WINELIB_NAME(midiOutCacheDrumPatches)
+UINT16 WINAPI midiOutGetID16(HMIDIOUT16,UINT16*);
+UINT32 WINAPI midiOutGetID32(HMIDIOUT32,UINT32*);
+#define midiOutGetID WINELIB_NAME(midiOutGetID)
 
-DWORD WINAPI midiOutMessage(HMIDIOUT16 hMidiOut, UINT16 uMessage, DWORD dw1, DWORD dw2);
+DWORD WINAPI midiOutMessage16(HMIDIOUT16,UINT16,DWORD,DWORD);
+DWORD WINAPI midiOutMessage32(HMIDIOUT32,UINT32,DWORD,DWORD);
+#define midiOutMessage WINELIB_NAME(midiOutMessage)
 
-UINT16 WINAPI midiInGetNumDevs(void);
-UINT16 WINAPI midiInGetDevCaps(UINT16 uDeviceID,
-    LPMIDIINCAPS lpCaps, UINT16 uSize);
-UINT16 WINAPI midiInGetErrorText(UINT16 uError, LPSTR lpText, UINT16 uSize);
-UINT16 WINAPI midiInOpen(HMIDIIN16 * lphMidiIn, UINT16 uDeviceID,
-    DWORD dwCallback, DWORD dwInstance, DWORD dwFlags);
-UINT16 WINAPI midiInClose(HMIDIIN16 hMidiIn);
-UINT16 WINAPI midiInPrepareHeader(HMIDIIN16 hMidiIn,
-    MIDIHDR * lpMidiInHdr, UINT16 uSize);
-UINT16 WINAPI midiInUnprepareHeader(HMIDIIN16 hMidiIn,
-    MIDIHDR * lpMidiInHdr, UINT16 uSize);
-UINT16 WINAPI midiInAddBuffer(HMIDIIN16 hMidiIn,
-    MIDIHDR * lpMidiInHdr, UINT16 uSize);
-UINT16 WINAPI midiInStart(HMIDIIN16 hMidiIn);
-UINT16 WINAPI midiInStop(HMIDIIN16 hMidiIn);
-UINT16 WINAPI midiInReset(HMIDIIN16 hMidiIn);
-UINT16 WINAPI midiInGetID(HMIDIIN16 hMidiIn, UINT16 * lpuDeviceID);
-
-DWORD WINAPI midiInMessage(HMIDIIN16 hMidiIn, UINT16 uMessage, DWORD dw1, DWORD dw2);
+UINT16 WINAPI midiInGetNumDevs16(void);
+UINT32 WINAPI midiInGetNumDevs32(void);
+#define midiInGetNumDevs WINELIB_NAME(midiInGetNumDevs)
+UINT16 WINAPI midiInGetDevCaps16(UINT16,LPMIDIINCAPS16,UINT16);
+UINT32 WINAPI midiInGetDevCaps32A(UINT32,LPMIDIINCAPS32A,UINT32);
+UINT32 WINAPI midiInGetDevCaps32W(UINT32,LPMIDIINCAPS32W,UINT32);
+#define midiInGetDevCaps WINELIB_NAME_AW(midiInGetDevCaps)
+UINT16 WINAPI midiInGetErrorText16(UINT16,LPSTR,UINT16);
+UINT32 WINAPI midiInGetErrorText32A(UINT32,LPSTR,UINT32);
+UINT32 WINAPI midiInGetErrorText32W(UINT32,LPWSTR,UINT32);
+#define midiInGetErrorText WINELIB_NAME_AW(midiInGetErrorText)
+UINT16 WINAPI midiInOpen16(HMIDIIN16*,UINT16,DWORD,DWORD,DWORD);
+UINT32 WINAPI midiInOpen32(HMIDIIN32*,UINT32,DWORD,DWORD,DWORD);
+#define midiInOpen WINELIB_NAME(midiInOpen)
+UINT16 WINAPI midiInClose16(HMIDIIN16);
+UINT32 WINAPI midiInClose32(HMIDIIN32);
+#define midiInClose WINELIB_NAME(midiInClose)
+UINT16 WINAPI midiInPrepareHeader16(HMIDIIN16,MIDIHDR*,UINT16);
+UINT32 WINAPI midiInPrepareHeader32(HMIDIIN32,MIDIHDR*,UINT32);
+#define midiInPrepareHeader WINELIB_NAME(midiInPrepareHeader)
+UINT16 WINAPI midiInUnprepareHeader16(HMIDIIN16,MIDIHDR*,UINT16);
+UINT32 WINAPI midiInUnprepareHeader32(HMIDIIN32,MIDIHDR*,UINT32);
+#define midiInUnprepareHeader WINELIB_NAME(midiInUnprepareHeader)
+UINT16 WINAPI midiInAddBuffer16(HMIDIIN16,MIDIHDR*,UINT16);
+UINT32 WINAPI midiInAddBuffer32(HMIDIIN32,MIDIHDR*,UINT32);
+#define midiInAddBuffer WINELIB_NAME(midiInAddBuffer)
+UINT16 WINAPI midiInStart16(HMIDIIN16);
+UINT32 WINAPI midiInStart32(HMIDIIN32);
+#define midiInStart WINELIB_NAME(midiInStart)
+UINT16 WINAPI midiInStop16(HMIDIIN16);
+UINT32 WINAPI midiInStop32(HMIDIIN32);
+#define midiInStop WINELIB_NAME(midiInStop)
+UINT16 WINAPI midiInReset16(HMIDIIN16);
+UINT32 WINAPI midiInReset32(HMIDIIN32);
+#define midiInReset WINELIB_NAME(midiInReset)
+UINT16 WINAPI midiInGetID16(HMIDIIN16,UINT16*);
+UINT32 WINAPI midiInGetID32(HMIDIIN32,UINT32*);
+#define midiInGetID WINELIB_NAME(midiInGetID)
+DWORD WINAPI midiInMessage16(HMIDIIN16,UINT16,DWORD,DWORD);
+DWORD WINAPI midiInMessage32(HMIDIIN32,UINT32,DWORD,DWORD);
+#define midiInMessage WINELIB_NAME(midiInMessage)
 
 #define AUX_MAPPER     (-1)
 
 typedef struct {
-    UINT16    wMid;                  /* manufacturer ID */
-    UINT16    wPid;                  /* product ID */
-    VERSION vDriverVersion;        /* version of the driver */
-    char    szPname[MAXPNAMELEN];  /* product name (NULL terminated string) */
-    UINT16    wTechnology;           /* type of device */
-    DWORD   dwSupport WINE_PACKED;             /* functionality supported by driver */
-} AUXCAPS, *LPAUXCAPS;
+    WORD	wMid;			/* manufacturer ID */
+    WORD	wPid;			/* product ID */
+    MMVERSION16	vDriverVersion;		/* version of the driver */
+    CHAR	szPname[MAXPNAMELEN];	/* product name (NULL terminated string) */
+    WORD	wTechnology;		/* type of device */
+    DWORD	dwSupport;		/* functionality supported by driver */
+} AUXCAPS16, *LPAUXCAPS16;
+
+typedef struct {
+    WORD	wMid;			/* manufacturer ID */
+    WORD	wPid;			/* product ID */
+    MMVERSION32	vDriverVersion;		/* version of the driver */
+    CHAR	szPname[MAXPNAMELEN];	/* product name (NULL terminated string) */
+    WORD	wTechnology;		/* type of device */
+    WORD	wReserved1;		/* padding */
+    DWORD	dwSupport;		/* functionality supported by driver */
+} AUXCAPS32A, *LPAUXCAPS32A;
+
+typedef struct {
+    WORD	wMid;			/* manufacturer ID */
+    WORD	wPid;			/* product ID */
+    MMVERSION32	vDriverVersion;		/* version of the driver */
+    WCHAR	szPname[MAXPNAMELEN];	/* product name (NULL terminated string) */
+    WORD	wTechnology;		/* type of device */
+    WORD	wReserved1;		/* padding */
+    DWORD	dwSupport;		/* functionality supported by driver */
+} AUXCAPS32W, *LPAUXCAPS32W;
 
 #define AUXCAPS_CDAUDIO    1       /* audio from internal CD-ROM drive */
 #define AUXCAPS_AUXIN      2       /* audio from auxiliary input jacks */
@@ -443,12 +710,24 @@
 #define AUXCAPS_VOLUME          0x0001  /* supports volume control */
 #define AUXCAPS_LRVOLUME        0x0002  /* separate left-right volume control */
 
-UINT16 WINAPI auxGetNumDevs(void);
-UINT16 WINAPI auxGetDevCaps(UINT16 uDeviceID, AUXCAPS * lpCaps, UINT16 uSize);
-UINT16 WINAPI auxSetVolume(UINT16 uDeviceID, DWORD dwVolume);
-UINT16 WINAPI auxGetVolume(UINT16 uDeviceID, DWORD * lpdwVolume);
+UINT16 WINAPI auxGetNumDevs16();
+UINT32 WINAPI auxGetNumDevs32();
+#define auxGetNumDevs WINELIB_NAME(auxGetNumDevs)
+UINT16 WINAPI auxGetDevCaps16 (UINT16,LPAUXCAPS16,UINT16);
+UINT32 WINAPI auxGetDevCaps32A(UINT32,LPAUXCAPS32A,UINT32);
+UINT32 WINAPI auxGetDevCaps32W(UINT32,LPAUXCAPS32W,UINT32);
+#define auxGetDevCaps WINELIB_NAME_AW(auxGetDevCaps)
+UINT16 WINAPI auxSetVolume16(UINT16,DWORD);
+UINT32 WINAPI auxSetVolume32(UINT32,DWORD);
+#define auxSetVolume WINELIB_NAME(auxSetVolume)
 
-DWORD WINAPI auxOutMessage(UINT16 uDeviceID, UINT16 uMessage, DWORD dw1, DWORD dw2);
+UINT16 WINAPI auxGetVolume16(UINT16,LPDWORD);
+UINT32 WINAPI auxGetVolume32(UINT32,LPDWORD);
+#define auxGetVolume WINELIB_NAME(auxGetVolume)
+
+DWORD WINAPI auxOutMessage16(UINT16,UINT16,DWORD,DWORD);
+DWORD WINAPI auxOutMessage32(UINT32,UINT32,DWORD,DWORD);
+#define auxOutMessage WINELIB_NAME(auxOutMessage)
 
 #define TIMERR_NOERROR        (0)                  /* no error */
 #define TIMERR_NOCANDO        (TIMERR_BASE+1)      /* request not completed */
@@ -464,7 +743,7 @@
     UINT16    wPeriodMax;     /* maximum period supported  */
 } TIMECAPS, *LPTIMECAPS;
 
-UINT16 WINAPI timeGetSystemTime(MMTIME * lpTime, UINT16 uSize);
+UINT16 WINAPI timeGetSystemTime(LPMMTIME16 lpTime, UINT16 uSize);
 DWORD WINAPI timeGetTime(void);
 UINT16 WINAPI timeSetEvent(UINT16 uDelay, UINT16 uResolution,
     LPTIMECALLBACK lpFunction, DWORD dwUser, UINT16 uFlags);
@@ -521,6 +800,463 @@
     BOOL16 bChanged);
 UINT16 WINAPI joySetThreshold(UINT16 uJoyID, UINT16 uThreshold);
 
+typedef struct {
+	WORD		wMid;		/* manufacturer id */
+	WORD		wPid;		/* product id */
+	MMVERSION16	vDriverVersion;		/* version of the driver */
+	CHAR		szPname[MAXPNAMELEN];	/* product name */
+	DWORD		fdwSupport;	/* misc. support bits */
+	DWORD		cDestinations;	/* count of destinations */
+} MIXERCAPS16,*LPMIXERCAPS16;
+
+typedef struct {
+	WORD		wMid;
+	WORD		wPid;
+	MMVERSION32	vDriverVersion;
+	CHAR		szPname[MAXPNAMELEN];
+	DWORD		fdwSupport;
+	DWORD		cDestinations;
+} MIXERCAPS32A,*LPMIXERCAPS32A;
+
+typedef struct {
+	WORD		wMid;
+	WORD		wPid;
+	MMVERSION32	vDriverVersion;
+	WCHAR		szPname[MAXPNAMELEN];
+	DWORD		fdwSupport;
+	DWORD		cDestinations;
+} MIXERCAPS32W,*LPMIXERCAPS32W;
+
+DECL_WINELIB_TYPE_AW(MIXERCAPS);
+DECL_WINELIB_TYPE_AW(LPMIXERCAPS);
+
+#define MIXER_SHORT_NAME_CHARS	16
+#define MIXER_LONG_NAME_CHARS	64
+
+/*  MIXERLINE.fdwLine */
+#define	MIXERLINE_LINEF_ACTIVE		0x00000001
+#define	MIXERLINE_LINEF_DISCONNECTED	0x00008000
+#define	MIXERLINE_LINEF_SOURCE		0x80000000
+
+/*  MIXERLINE.dwComponentType */
+/*  component types for destinations and sources */
+#define	MIXERLINE_COMPONENTTYPE_DST_FIRST	0x00000000L
+#define	MIXERLINE_COMPONENTTYPE_DST_UNDEFINED	(MIXERLINE_COMPONENTTYPE_DST_FIRST + 0)
+#define	MIXERLINE_COMPONENTTYPE_DST_DIGITAL	(MIXERLINE_COMPONENTTYPE_DST_FIRST + 1)
+#define	MIXERLINE_COMPONENTTYPE_DST_LINE	(MIXERLINE_COMPONENTTYPE_DST_FIRST + 2)
+#define	MIXERLINE_COMPONENTTYPE_DST_MONITOR	(MIXERLINE_COMPONENTTYPE_DST_FIRST + 3)
+#define	MIXERLINE_COMPONENTTYPE_DST_SPEAKERS	(MIXERLINE_COMPONENTTYPE_DST_FIRST + 4)
+#define	MIXERLINE_COMPONENTTYPE_DST_HEADPHONES	(MIXERLINE_COMPONENTTYPE_DST_FIRST + 5)
+#define	MIXERLINE_COMPONENTTYPE_DST_TELEPHONE	(MIXERLINE_COMPONENTTYPE_DST_FIRST + 6)
+#define	MIXERLINE_COMPONENTTYPE_DST_WAVEIN	(MIXERLINE_COMPONENTTYPE_DST_FIRST + 7)
+#define	MIXERLINE_COMPONENTTYPE_DST_VOICEIN	(MIXERLINE_COMPONENTTYPE_DST_FIRST + 8)
+#define	MIXERLINE_COMPONENTTYPE_DST_LAST	(MIXERLINE_COMPONENTTYPE_DST_FIRST + 8)
+
+#define	MIXERLINE_COMPONENTTYPE_SRC_FIRST	0x00001000L
+#define	MIXERLINE_COMPONENTTYPE_SRC_UNDEFINED	(MIXERLINE_COMPONENTTYPE_SRC_FIRST + 0)
+#define	MIXERLINE_COMPONENTTYPE_SRC_DIGITAL	(MIXERLINE_COMPONENTTYPE_SRC_FIRST + 1)
+#define	MIXERLINE_COMPONENTTYPE_SRC_LINE	(MIXERLINE_COMPONENTTYPE_SRC_FIRST + 2)
+#define	MIXERLINE_COMPONENTTYPE_SRC_MICROPHONE	(MIXERLINE_COMPONENTTYPE_SRC_FIRST + 3)
+#define	MIXERLINE_COMPONENTTYPE_SRC_SYNTHESIZER	(MIXERLINE_COMPONENTTYPE_SRC_FIRST + 4)
+#define	MIXERLINE_COMPONENTTYPE_SRC_COMPACTDISC	(MIXERLINE_COMPONENTTYPE_SRC_FIRST + 5)
+#define	MIXERLINE_COMPONENTTYPE_SRC_TELEPHONE	(MIXERLINE_COMPONENTTYPE_SRC_FIRST + 6)
+#define	MIXERLINE_COMPONENTTYPE_SRC_PCSPEAKER	(MIXERLINE_COMPONENTTYPE_SRC_FIRST + 7)
+#define	MIXERLINE_COMPONENTTYPE_SRC_WAVEOUT	(MIXERLINE_COMPONENTTYPE_SRC_FIRST + 8)
+#define	MIXERLINE_COMPONENTTYPE_SRC_AUXILIARY	(MIXERLINE_COMPONENTTYPE_SRC_FIRST + 9)
+#define	MIXERLINE_COMPONENTTYPE_SRC_ANALOG	(MIXERLINE_COMPONENTTYPE_SRC_FIRST + 10)
+#define	MIXERLINE_COMPONENTTYPE_SRC_LAST	(MIXERLINE_COMPONENTTYPE_SRC_FIRST + 10)
+
+/*  MIXERLINE.Target.dwType */
+#define	MIXERLINE_TARGETTYPE_UNDEFINED	0
+#define	MIXERLINE_TARGETTYPE_WAVEOUT	1
+#define	MIXERLINE_TARGETTYPE_WAVEIN	2
+#define	MIXERLINE_TARGETTYPE_MIDIOUT	3
+#define	MIXERLINE_TARGETTYPE_MIDIIN	4
+#define MIXERLINE_TARGETTYPE_AUX	5
+
+typedef struct {
+    DWORD	cbStruct;		/* size of MIXERLINE structure */
+    DWORD	dwDestination;		/* zero based destination index */
+    DWORD	dwSource;		/* zero based source index (if source) */
+    DWORD	dwLineID;		/* unique line id for mixer device */
+    DWORD	fdwLine;		/* state/information about line */
+    DWORD	dwUser;			/* driver specific information */
+    DWORD	dwComponentType;	/* component type line connects to */
+    DWORD	cChannels;		/* number of channels line supports */
+    DWORD	cConnections;		/* number of connections [possible] */
+    DWORD	cControls;		/* number of controls at this line */
+    CHAR	szShortName[MIXER_SHORT_NAME_CHARS];
+    CHAR	szName[MIXER_LONG_NAME_CHARS];
+    struct {
+	DWORD	dwType;			/* MIXERLINE_TARGETTYPE_xxxx */
+	DWORD	dwDeviceID;		/* target device ID of device type */
+	WORD	wMid;			/* of target device */
+	WORD	wPid;			/*      " */
+	MMVERSION16	vDriverVersion;	/*      " */
+	CHAR	szPname[MAXPNAMELEN];	/*      " */
+    } Target;
+} MIXERLINE16, *LPMIXERLINE16;
+
+typedef struct {
+    DWORD	cbStruct;
+    DWORD	dwDestination;
+    DWORD	dwSource;
+    DWORD	dwLineID;
+    DWORD	fdwLine;
+    DWORD	dwUser;
+    DWORD	dwComponentType;
+    DWORD	cChannels;
+    DWORD	cConnections;
+    DWORD	cControls;
+    CHAR	szShortName[MIXER_SHORT_NAME_CHARS];
+    CHAR	szName[MIXER_LONG_NAME_CHARS];
+    struct {
+	DWORD	dwType;
+	DWORD	dwDeviceID;
+	WORD	wMid;
+	WORD	wPid;
+	MMVERSION32	vDriverVersion;
+	CHAR	szPname[MAXPNAMELEN];
+    } Target;
+} MIXERLINE32A, *LPMIXERLINE32A;
+
+typedef struct {
+    DWORD	cbStruct;
+    DWORD	dwDestination;
+    DWORD	dwSource;
+    DWORD	dwLineID;
+    DWORD	fdwLine;
+    DWORD	dwUser;
+    DWORD	dwComponentType;
+    DWORD	cChannels;
+    DWORD	cConnections;
+    DWORD	cControls;
+    WCHAR	szShortName[MIXER_SHORT_NAME_CHARS];
+    WCHAR	szName[MIXER_LONG_NAME_CHARS];
+    struct {
+	DWORD	dwType;
+	DWORD	dwDeviceID;
+	WORD	wMid;
+	WORD	wPid;
+	MMVERSION32	vDriverVersion;
+	WCHAR	szPname[MAXPNAMELEN];
+    } Target;
+} MIXERLINE32W, *LPMIXERLINE32W;
+
+DECL_WINELIB_TYPE_AW(MIXERLINE);
+DECL_WINELIB_TYPE_AW(LPMIXERLINE);
+
+/*  MIXERCONTROL.fdwControl */
+#define	MIXERCONTROL_CONTROLF_UNIFORM	0x00000001L
+#define	MIXERCONTROL_CONTROLF_MULTIPLE	0x00000002L
+#define	MIXERCONTROL_CONTROLF_DISABLED	0x80000000L
+
+/*  MIXERCONTROL_CONTROLTYPE_xxx building block defines */
+#define	MIXERCONTROL_CT_CLASS_MASK		0xF0000000L
+#define	MIXERCONTROL_CT_CLASS_CUSTOM		0x00000000L
+#define	MIXERCONTROL_CT_CLASS_METER		0x10000000L
+#define	MIXERCONTROL_CT_CLASS_SWITCH		0x20000000L
+#define	MIXERCONTROL_CT_CLASS_NUMBER		0x30000000L
+#define	MIXERCONTROL_CT_CLASS_SLIDER		0x40000000L
+#define	MIXERCONTROL_CT_CLASS_FADER		0x50000000L
+#define	MIXERCONTROL_CT_CLASS_TIME		0x60000000L
+#define	MIXERCONTROL_CT_CLASS_LIST		0x70000000L
+
+#define	MIXERCONTROL_CT_SUBCLASS_MASK		0x0F000000L
+
+#define	MIXERCONTROL_CT_SC_SWITCH_BOOLEAN	0x00000000L
+#define	MIXERCONTROL_CT_SC_SWITCH_BUTTON	0x01000000L
+
+#define	MIXERCONTROL_CT_SC_METER_POLLED		0x00000000L
+
+#define	MIXERCONTROL_CT_SC_TIME_MICROSECS	0x00000000L
+#define	MIXERCONTROL_CT_SC_TIME_MILLISECS	0x01000000L
+
+#define	MIXERCONTROL_CT_SC_LIST_SINGLE		0x00000000L
+#define	MIXERCONTROL_CT_SC_LIST_MULTIPLE	0x01000000L
+
+#define	MIXERCONTROL_CT_UNITS_MASK		0x00FF0000L
+#define	MIXERCONTROL_CT_UNITS_CUSTOM		0x00000000L
+#define	MIXERCONTROL_CT_UNITS_BOOLEAN		0x00010000L
+#define	MIXERCONTROL_CT_UNITS_SIGNED		0x00020000L
+#define	MIXERCONTROL_CT_UNITS_UNSIGNED		0x00030000L
+#define	MIXERCONTROL_CT_UNITS_DECIBELS		0x00040000L /* in 10ths */
+#define	MIXERCONTROL_CT_UNITS_PERCENT		0x00050000L /* in 10ths */
+
+/*  Commonly used control types for specifying MIXERCONTROL.dwControlType */
+#define MIXERCONTROL_CONTROLTYPE_CUSTOM		(MIXERCONTROL_CT_CLASS_CUSTOM | MIXERCONTROL_CT_UNITS_CUSTOM)
+#define MIXERCONTROL_CONTROLTYPE_BOOLEANMETER	(MIXERCONTROL_CT_CLASS_METER | MIXERCONTROL_CT_SC_METER_POLLED | MIXERCONTROL_CT_UNITS_BOOLEAN)
+#define MIXERCONTROL_CONTROLTYPE_SIGNEDMETER	(MIXERCONTROL_CT_CLASS_METER | MIXERCONTROL_CT_SC_METER_POLLED | MIXERCONTROL_CT_UNITS_SIGNED)
+#define MIXERCONTROL_CONTROLTYPE_PEAKMETER	(MIXERCONTROL_CONTROLTYPE_SIGNEDMETER + 1)
+#define MIXERCONTROL_CONTROLTYPE_UNSIGNEDMETER	(MIXERCONTROL_CT_CLASS_METER | MIXERCONTROL_CT_SC_METER_POLLED | MIXERCONTROL_CT_UNITS_UNSIGNED)
+#define MIXERCONTROL_CONTROLTYPE_BOOLEAN	(MIXERCONTROL_CT_CLASS_SWITCH | MIXERCONTROL_CT_SC_SWITCH_BOOLEAN | MIXERCONTROL_CT_UNITS_BOOLEAN)
+#define MIXERCONTROL_CONTROLTYPE_ONOFF		(MIXERCONTROL_CONTROLTYPE_BOOLEAN + 1)
+#define MIXERCONTROL_CONTROLTYPE_MUTE		(MIXERCONTROL_CONTROLTYPE_BOOLEAN + 2)
+#define MIXERCONTROL_CONTROLTYPE_MONO		(MIXERCONTROL_CONTROLTYPE_BOOLEAN + 3)
+#define MIXERCONTROL_CONTROLTYPE_LOUDNESS	(MIXERCONTROL_CONTROLTYPE_BOOLEAN + 4)
+#define MIXERCONTROL_CONTROLTYPE_STEREOENH	(MIXERCONTROL_CONTROLTYPE_BOOLEAN + 5)
+#define MIXERCONTROL_CONTROLTYPE_BUTTON		(MIXERCONTROL_CT_CLASS_SWITCH | MIXERCONTROL_CT_SC_SWITCH_BUTTON | MIXERCONTROL_CT_UNITS_BOOLEAN)
+#define MIXERCONTROL_CONTROLTYPE_DECIBELS	(MIXERCONTROL_CT_CLASS_NUMBER | MIXERCONTROL_CT_UNITS_DECIBELS)
+#define MIXERCONTROL_CONTROLTYPE_SIGNED		(MIXERCONTROL_CT_CLASS_NUMBER | MIXERCONTROL_CT_UNITS_SIGNED)
+#define MIXERCONTROL_CONTROLTYPE_UNSIGNED	(MIXERCONTROL_CT_CLASS_NUMBER | MIXERCONTROL_CT_UNITS_UNSIGNED)
+#define MIXERCONTROL_CONTROLTYPE_PERCENT	(MIXERCONTROL_CT_CLASS_NUMBER | MIXERCONTROL_CT_UNITS_PERCENT)
+#define MIXERCONTROL_CONTROLTYPE_SLIDER		(MIXERCONTROL_CT_CLASS_SLIDER | MIXERCONTROL_CT_UNITS_SIGNED)
+#define MIXERCONTROL_CONTROLTYPE_PAN		(MIXERCONTROL_CONTROLTYPE_SLIDER + 1)
+#define MIXERCONTROL_CONTROLTYPE_QSOUNDPAN	(MIXERCONTROL_CONTROLTYPE_SLIDER + 2)
+#define MIXERCONTROL_CONTROLTYPE_FADER		(MIXERCONTROL_CT_CLASS_FADER | MIXERCONTROL_CT_UNITS_UNSIGNED)
+#define MIXERCONTROL_CONTROLTYPE_VOLUME		(MIXERCONTROL_CONTROLTYPE_FADER + 1)
+#define MIXERCONTROL_CONTROLTYPE_BASS		(MIXERCONTROL_CONTROLTYPE_FADER + 2)
+#define MIXERCONTROL_CONTROLTYPE_TREBLE		(MIXERCONTROL_CONTROLTYPE_FADER + 3)
+#define MIXERCONTROL_CONTROLTYPE_EQUALIZER	(MIXERCONTROL_CONTROLTYPE_FADER + 4)
+#define MIXERCONTROL_CONTROLTYPE_SINGLESELECT	(MIXERCONTROL_CT_CLASS_LIST | MIXERCONTROL_CT_SC_LIST_SINGLE | MIXERCONTROL_CT_UNITS_BOOLEAN)
+#define MIXERCONTROL_CONTROLTYPE_MUX		(MIXERCONTROL_CONTROLTYPE_SINGLESELECT + 1)
+#define MIXERCONTROL_CONTROLTYPE_MULTIPLESELECT	(MIXERCONTROL_CT_CLASS_LIST | MIXERCONTROL_CT_SC_LIST_MULTIPLE | MIXERCONTROL_CT_UNITS_BOOLEAN)
+#define MIXERCONTROL_CONTROLTYPE_MIXER		(MIXERCONTROL_CONTROLTYPE_MULTIPLESELECT + 1)
+#define MIXERCONTROL_CONTROLTYPE_MICROTIME	(MIXERCONTROL_CT_CLASS_TIME | MIXERCONTROL_CT_SC_TIME_MICROSECS | MIXERCONTROL_CT_UNITS_UNSIGNED)
+#define MIXERCONTROL_CONTROLTYPE_MILLITIME	(MIXERCONTROL_CT_CLASS_TIME | MIXERCONTROL_CT_SC_TIME_MILLISECS | MIXERCONTROL_CT_UNITS_UNSIGNED)
+
+
+typedef struct {
+    DWORD		cbStruct;           /* size in bytes of MIXERCONTROL */
+    DWORD		dwControlID;        /* unique control id for mixer device */
+    DWORD		dwControlType;      /* MIXERCONTROL_CONTROLTYPE_xxx */
+    DWORD		fdwControl;         /* MIXERCONTROL_CONTROLF_xxx */
+    DWORD		cMultipleItems;     /* if MIXERCONTROL_CONTROLF_MULTIPLE set */
+    CHAR		szShortName[MIXER_SHORT_NAME_CHARS];
+    CHAR		szName[MIXER_LONG_NAME_CHARS];
+    union {
+	struct {
+	    LONG	lMinimum;	/* signed minimum for this control */
+	    LONG	lMaximum;	/* signed maximum for this control */
+	} l;
+	struct {
+	    DWORD	dwMinimum;	/* unsigned minimum for this control */
+	    DWORD	dwMaximum;	/* unsigned maximum for this control */
+	} dw;
+	DWORD       	dwReserved[6];
+    } Bounds;
+    union {
+	DWORD		cSteps;		/* # of steps between min & max */
+	DWORD		cbCustomData;	/* size in bytes of custom data */
+	DWORD		dwReserved[6];	/* !!! needed? we have cbStruct.... */
+    } Metrics;
+} MIXERCONTROL16, *LPMIXERCONTROL16;
+
+typedef struct {
+    DWORD		cbStruct;
+    DWORD		dwControlID;
+    DWORD		dwControlType;
+    DWORD		fdwControl;
+    DWORD		cMultipleItems;
+    CHAR		szShortName[MIXER_SHORT_NAME_CHARS];
+    CHAR		szName[MIXER_LONG_NAME_CHARS];
+    union {
+	struct {
+	    LONG	lMinimum;
+	    LONG	lMaximum;
+	} l;
+	struct {
+	    DWORD	dwMinimum;
+	    DWORD	dwMaximum;
+	} dw;
+	DWORD       	dwReserved[6];
+    } Bounds;
+    union {
+	DWORD		cSteps;
+	DWORD		cbCustomData;
+	DWORD		dwReserved[6];
+    } Metrics;
+} MIXERCONTROL32A, *LPMIXERCONTROL32A;
+
+typedef struct {
+    DWORD		cbStruct;
+    DWORD		dwControlID;
+    DWORD		dwControlType;
+    DWORD		fdwControl;
+    DWORD		cMultipleItems;
+    WCHAR		szShortName[MIXER_SHORT_NAME_CHARS];
+    WCHAR		szName[MIXER_LONG_NAME_CHARS];
+    union {
+	struct {
+	    LONG	lMinimum;
+	    LONG	lMaximum;
+	} l;
+	struct {
+	    DWORD	dwMinimum;
+	    DWORD	dwMaximum;
+	} dw;
+	DWORD       	dwReserved[6];
+    } Bounds;
+    union {
+	DWORD		cSteps;
+	DWORD		cbCustomData;
+	DWORD		dwReserved[6];
+    } Metrics;
+} MIXERCONTROL32W, *LPMIXERCONTROL32W;
+
+DECL_WINELIB_TYPE_AW(MIXERCONTROL);
+DECL_WINELIB_TYPE_AW(LPMIXERCONTROL);
+
+typedef struct {
+    DWORD	cbStruct;	/* size in bytes of MIXERLINECONTROLS */
+    DWORD	dwLineID;	/* line id (from MIXERLINE.dwLineID) */
+    union {
+	DWORD	dwControlID;	/* MIXER_GETLINECONTROLSF_ONEBYID */
+	DWORD	dwControlType;	/* MIXER_GETLINECONTROLSF_ONEBYTYPE */
+    } u;
+    DWORD	cControls;	/* count of controls pmxctrl points to */
+    DWORD	cbmxctrl;	/* size in bytes of _one_ MIXERCONTROL */
+    LPMIXERCONTROL16	pamxctrl;/* pointer to first MIXERCONTROL array */
+} MIXERLINECONTROLS16, *LPMIXERLINECONTROLS16;
+
+typedef struct {
+    DWORD	cbStruct;
+    DWORD	dwLineID;
+    union {
+	DWORD	dwControlID;
+	DWORD	dwControlType;
+    } u;
+    DWORD	cControls;
+    DWORD	cbmxctrl;
+    LPMIXERCONTROL32A	pamxctrl;
+} MIXERLINECONTROLS32A, *LPMIXERLINECONTROLS32A;
+
+typedef struct {
+    DWORD	cbStruct;
+    DWORD	dwLineID;
+    union {
+	DWORD	dwControlID;
+	DWORD	dwControlType;
+    } u;
+    DWORD	cControls;
+    DWORD	cbmxctrl;
+    LPMIXERCONTROL32W	pamxctrl;
+} MIXERLINECONTROLS32W, *LPMIXERLINECONTROLS32W;
+
+DECL_WINELIB_TYPE_AW(MIXERLINECONTROLS);
+DECL_WINELIB_TYPE_AW(LPMIXERLINECONTROLS);
+
+typedef struct {
+    DWORD	cbStruct;	/* size in bytes of MIXERCONTROLDETAILS */
+    DWORD	dwControlID;	/* control id to get/set details on */
+    DWORD	cChannels;	/* number of channels in paDetails array */
+    union {
+        HWND16	hwndOwner;	/* for MIXER_SETCONTROLDETAILSF_CUSTOM */
+        DWORD	cMultipleItems;	/* if _MULTIPLE, the number of items per channel */
+    } u;
+    DWORD	cbDetails;	/* size of _one_ details_XX struct */
+    LPVOID	paDetails;	/* pointer to array of details_XX structs */
+} MIXERCONTROLDETAILS16,*LPMIXERCONTROLDETAILS16;
+
+typedef struct {
+    DWORD	cbStruct;
+    DWORD	dwControlID;
+    DWORD	cChannels;
+    union {
+        HWND32	hwndOwner;
+        DWORD	cMultipleItems;
+    } u;
+    DWORD	cbDetails;
+    LPVOID	paDetails;
+} MIXERCONTROLDETAILS32,*LPMIXERCONTROLDETAILS32;
+
+DECL_WINELIB_TYPE(MIXERCONTROLDETAILS);
+DECL_WINELIB_TYPE(LPMIXERCONTROLDETAILS);
+
+typedef struct {
+    DWORD	dwParam1;
+    DWORD	dwParam2;
+    CHAR	szName[MIXER_LONG_NAME_CHARS];
+} MIXERCONTROLDETAILS_LISTTEXT16,*LPMIXERCONTROLDETAILS_LISTTEXT16;
+
+typedef struct {
+    DWORD	dwParam1;
+    DWORD	dwParam2;
+    CHAR	szName[MIXER_LONG_NAME_CHARS];
+} MIXERCONTROLDETAILS_LISTTEXT32A,*LPMIXERCONTROLDETAILS_LISTTEXT32A;
+
+typedef struct {
+    DWORD	dwParam1;
+    DWORD	dwParam2;
+    WCHAR	szName[MIXER_LONG_NAME_CHARS];
+} MIXERCONTROLDETAILS_LISTTEXT32W,*LPMIXERCONTROLDETAILS_LISTTEXT32W;
+
+DECL_WINELIB_TYPE_AW(MIXERCONTROLDETAILS);
+DECL_WINELIB_TYPE_AW(LPMIXERCONTROLDETAILS);
+
+/*  MIXER_GETCONTROLDETAILSF_VALUE */
+typedef struct {
+	LONG	fValue;
+} MIXERCONTROLDETAILS_BOOLEAN,*LPMIXERCONTROLDETAILS_BOOLEAN;
+
+typedef struct {
+	LONG	lValue;
+} MIXERCONTROLDETAILS_SIGNED,*LPMIXERCONTROLDETAILS_SIGNED;
+
+typedef struct {
+	DWORD	dwValue;
+} MIXERCONTROLDETAILS_UNSIGNED,*LPMIXERCONTROLDETAILS_UNSIGNED;
+
+/* bits passed to mixerGetLineInfo.fdwInfo */
+#define MIXER_GETLINEINFOF_DESTINATION		0x00000000L
+#define MIXER_GETLINEINFOF_SOURCE		0x00000001L
+#define MIXER_GETLINEINFOF_LINEID		0x00000002L
+#define MIXER_GETLINEINFOF_COMPONENTTYPE	0x00000003L
+#define MIXER_GETLINEINFOF_TARGETTYPE		0x00000004L
+#define MIXER_GETLINEINFOF_QUERYMASK		0x0000000FL
+
+/* bitmask passed to mixerGetLineControl */
+#define MIXER_GETLINECONTROLSF_ALL		0x00000000L
+#define MIXER_GETLINECONTROLSF_ONEBYID		0x00000001L
+#define MIXER_GETLINECONTROLSF_ONEBYTYPE	0x00000002L
+#define MIXER_GETLINECONTROLSF_QUERYMASK	0x0000000FL
+
+/* bitmask passed to mixerGetControlDetails */
+#define MIXER_GETCONTROLDETAILSF_VALUE		0x00000000L
+#define MIXER_GETCONTROLDETAILSF_LISTTEXT	0x00000001L
+#define MIXER_GETCONTROLDETAILSF_QUERYMASK	0x0000000FL
+
+/* bitmask passed to mixerSetControlDetails */
+#define	MIXER_SETCONTROLDETAILSF_VALUE		0x00000000L
+#define	MIXER_SETCONTROLDETAILSF_CUSTOM		0x00000001L
+#define	MIXER_SETCONTROLDETAILSF_QUERYMASK	0x0000000FL
+
+UINT16 WINAPI mixerGetNumDevs16();
+UINT32 WINAPI mixerGetNumDevs32();
+#define mixerGetNumDevs WINELIB_NAME(mixerGetNumDevs)
+UINT16 WINAPI mixerOpen16(LPHMIXER16,UINT16,DWORD,DWORD,DWORD);
+UINT32 WINAPI mixerOpen32(LPHMIXER32,UINT32,DWORD,DWORD,DWORD);
+#define mixerOpen WINELIB_NAME(mixerOpen)
+UINT16 WINAPI mixerClose16(HMIXER16);
+UINT32 WINAPI mixerClose32(HMIXER32);
+#define mixerClose WINELIB_NAME(mixerClose)
+UINT16 WINAPI mixerMessage16(HMIXER16,UINT16,DWORD,DWORD);
+UINT32 WINAPI mixerMessage32(HMIXER32,UINT32,DWORD,DWORD);
+#define mixerMessage WINELIB_NAME(mixerMessage)
+UINT16 WINAPI mixerGetDevCaps16(UINT16,LPMIXERCAPS16,UINT16);
+UINT32 WINAPI mixerGetDevCaps32A(UINT32,LPMIXERCAPS32A,UINT32);
+UINT32 WINAPI mixerGetDevCaps32W(UINT32,LPMIXERCAPS32W,UINT32);
+#define mixerGetDevCaps WINELIB_NAME_AW(mixerGetDevCaps)
+UINT16 WINAPI mixerGetLineInfo16(HMIXEROBJ16,LPMIXERLINE16,DWORD);
+UINT32 WINAPI mixerGetLineInfo32A(HMIXEROBJ32,LPMIXERLINE32A,DWORD);
+UINT32 WINAPI mixerGetLineInfo32W(HMIXEROBJ32,LPMIXERLINE32W,DWORD);
+#define mixerGetLineInfo WINELIB_NAME_AW(mixerGetLineInfo)
+UINT16 WINAPI mixerGetID16(HMIXEROBJ16,LPUINT16,DWORD);
+UINT32 WINAPI mixerGetID32(HMIXEROBJ32,LPUINT32,DWORD);
+#define mixerGetID WINELIB_NAME(mixerGetID)
+UINT16 WINAPI mixerGetLineControls16(HMIXEROBJ16,LPMIXERLINECONTROLS16,DWORD);
+UINT32 WINAPI mixerGetLineControls32A(HMIXEROBJ32,LPMIXERLINECONTROLS32A,DWORD);
+UINT32 WINAPI mixerGetLineControls32W(HMIXEROBJ32,LPMIXERLINECONTROLS32W,DWORD);
+#define mixerGetLineControl WINELIB_NAME_AW(mixerGetLineControl)
+UINT16 WINAPI mixerGetControlDetails16(HMIXEROBJ16,LPMIXERCONTROLDETAILS16,DWORD);
+UINT32 WINAPI mixerGetControlDetails32A(HMIXEROBJ32,LPMIXERCONTROLDETAILS32,DWORD);
+UINT32 WINAPI mixerGetControlDetails32W(HMIXEROBJ32,LPMIXERCONTROLDETAILS32,DWORD);
+#define mixerGetControlDetails WINELIB_NAME_AW(mixerGetControlDetails)
+UINT16 WINAPI mixerSetControlDetails16(HMIXEROBJ16,LPMIXERCONTROLDETAILS16,DWORD);
+UINT32 WINAPI mixerSetControlDetails32A(HMIXEROBJ16,LPMIXERCONTROLDETAILS32,DWORD);
+UINT32 WINAPI mixerSetControlDetails32W(HMIXEROBJ16,LPMIXERCONTROLDETAILS32,DWORD);
+#define mixerSetControlDetails WINELIB_NAME_AW(mixerSetControlDetails)
+
 #define MMIOERR_BASE            256
 #define MMIOERR_FILENOTFOUND    (MMIOERR_BASE + 1)  /* file not found */
 #define MMIOERR_OUTOFMEMORY     (MMIOERR_BASE + 2)  /* out of memory */
@@ -543,26 +1279,48 @@
 DECL_WINELIB_TYPE(LPMMIOPROC);
 
 typedef struct {
-        DWORD           dwFlags;        /* general status flags */
-        FOURCC          fccIOProc;      /* pointer to I/O procedure */
-        LPMMIOPROC16    pIOProc;        /* pointer to I/O procedure */
-        UINT16            wErrorRet;      /* place for error to be returned */
-        HTASK16         htask;          /* alternate local task */
+        DWORD		dwFlags;	/* general status flags */
+        FOURCC		fccIOProc;	/* pointer to I/O procedure */
+        LPMMIOPROC16	pIOProc;	/* pointer to I/O procedure */
+        UINT16		wErrorRet;	/* place for error to be returned */
+        HTASK16		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 */
+        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 */
+        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 */
-        HMMIO16         hmmio;          /* handle to open file */
-} MMIOINFO, *LPMMIOINFO;
+        DWORD		dwReserved1;	/* reserved for MMIO use */
+        DWORD		dwReserved2;	/* reserved for MMIO use */
+        HMMIO16		hmmio;		/* handle to open file */
+} MMIOINFO16, *LPMMIOINFO16;
+
+typedef struct {
+        DWORD		dwFlags;
+        FOURCC		fccIOProc;
+        LPMMIOPROC32	pIOProc;
+        UINT32		wErrorRet;
+        HTASK32		htask;
+        /* fields maintained by MMIO functions during buffered I/O */
+        LONG		cchBuffer;
+        HPSTR		pchBuffer;
+        HPSTR		pchNext;
+        HPSTR		pchEndRead;
+        HPSTR		pchEndWrite;
+        LONG		lBufOffset;
+        /* fields maintained by I/O procedure */
+        LONG		lDiskOffset;
+        DWORD		adwInfo[3];
+        /* other fields maintained by MMIO */
+        DWORD		dwReserved1;
+        DWORD		dwReserved2;
+        HMMIO32		hmmio;
+} MMIOINFO32, *LPMMIOINFO32;
 
 typedef struct _MMCKINFO
 {
@@ -640,23 +1398,28 @@
 LPMMIOPROC32 WINAPI mmioInstallIOProc32W(FOURCC,LPMMIOPROC32,DWORD);
 #define      mmioInstallIOPro WINELIB_NAME_AW(mmioInstallIOProc)
 
-FOURCC WINAPI mmioStringToFOURCC(LPCSTR sz, UINT16 uFlags);
-HMMIO16 WINAPI mmioOpen(LPSTR szFileName, MMIOINFO * lpmmioinfo,
-    DWORD dwOpenFlags);
+FOURCC WINAPI mmioStringToFOURCC16(LPCSTR sz, UINT16 uFlags);
+FOURCC WINAPI mmioStringToFOURCC32A(LPCSTR sz, UINT32 uFlags);
+FOURCC WINAPI mmioStringToFOURCC32W(LPCWSTR sz, UINT32 uFlags);
+#define mmioStringToFOURCC WINELIB_NAME_AW(mmioStringToFOURCC)
+HMMIO16 WINAPI mmioOpen16(LPSTR szFileName, MMIOINFO16 * lpmmioinfo, DWORD dwOpenFlags);
+HMMIO32 WINAPI mmioOpen32A(LPSTR szFileName, MMIOINFO32 * lpmmioinfo, DWORD dwOpenFlags);
+HMMIO32 WINAPI mmioOpen32W(LPWSTR szFileName, MMIOINFO32 * lpmmioinfo, DWORD dwOpenFlags);
+#define mmioOpen WINELIB_NAME_AW(mmioOpen)
 
 UINT16 WINAPI mmioRename(LPCSTR szFileName, LPCSTR szNewFileName,
-     MMIOINFO * lpmmioinfo, DWORD dwRenameFlags);
+     MMIOINFO16 * lpmmioinfo, DWORD dwRenameFlags);
 
 UINT16 WINAPI mmioClose(HMMIO16 hmmio, UINT16 uFlags);
 LONG WINAPI mmioRead(HMMIO16 hmmio, HPSTR pch, LONG cch);
 LONG WINAPI mmioWrite(HMMIO16 hmmio, HPCSTR pch, LONG cch);
 LONG WINAPI mmioSeek(HMMIO16 hmmio, LONG lOffset, int iOrigin);
-UINT16 WINAPI mmioGetInfo(HMMIO16 hmmio, MMIOINFO * lpmmioinfo, UINT16 uFlags);
-UINT16 WINAPI mmioSetInfo(HMMIO16 hmmio, const MMIOINFO * lpmmioinfo, UINT16 uFlags);
+UINT16 WINAPI mmioGetInfo(HMMIO16 hmmio, MMIOINFO16 * lpmmioinfo, UINT16 uFlags);
+UINT16 WINAPI mmioSetInfo(HMMIO16 hmmio, const MMIOINFO16 * lpmmioinfo, UINT16 uFlags);
 UINT16 WINAPI mmioSetBuffer(HMMIO16 hmmio, LPSTR pchBuffer, LONG cchBuffer,
     UINT16 uFlags);
 UINT16 WINAPI mmioFlush(HMMIO16 hmmio, UINT16 uFlags);
-UINT16 WINAPI mmioAdvance(HMMIO16 hmmio, MMIOINFO * lpmmioinfo, UINT16 uFlags);
+UINT16 WINAPI mmioAdvance(HMMIO16 hmmio, MMIOINFO16 * lpmmioinfo, UINT16 uFlags);
 LONG WINAPI mmioSendMessage(HMMIO16 hmmio, UINT16 uMessage,
     LPARAM lParam1, LPARAM lParam2);
 UINT16 WINAPI mmioDescend(HMMIO16 hmmio, MMCKINFO * lpck,
@@ -674,8 +1437,10 @@
 UINT16 WINAPI mciGetDeviceID (LPCSTR lpstrName);
 UINT16 WINAPI mciGetDeviceIDFromElementID (DWORD dwElementID,
                                            LPCSTR lpstrType);
-BOOL16 WINAPI mciGetErrorString (DWORD wError, LPSTR lpstrBuffer,
-                                 UINT16 uLength);
+BOOL16 WINAPI mciGetErrorString16 (DWORD,LPSTR,UINT16);
+BOOL32 WINAPI mciGetErrorString32A(DWORD,LPSTR,UINT32);
+BOOL32 WINAPI mciGetErrorString32W(DWORD,LPWSTR,UINT32);
+#define mciGetErrorString WINELIB_NAME_AW(mciGetErrorString)
 BOOL16 WINAPI mciSetYieldProc (UINT16 uDeviceID, YIELDPROC fpYieldProc,
                                DWORD dwYieldData);
 
@@ -945,13 +1710,32 @@
 } MCI_GENERIC_PARMS, *LPMCI_GENERIC_PARMS;
 
 typedef struct {
-	DWORD   dwCallback;
-	UINT16  wDeviceID;
-	UINT16  wReserved0;
-	SEGPTR  lpstrDeviceType;
-	SEGPTR  lpstrElementName;
-	SEGPTR  lpstrAlias;
-} MCI_OPEN_PARMS, *LPMCI_OPEN_PARMS;
+	DWORD	dwCallback;
+	WORD	wDeviceID;
+	WORD	wReserved0;
+	LPSTR	lpstrDeviceType;
+	LPSTR	lpstrElementName;
+	LPSTR	lpstrAlias;
+} MCI_OPEN_PARMS16, *LPMCI_OPEN_PARMS16;
+
+typedef struct {
+	DWORD		dwCallback;
+	MCIDEVICEID32	wDeviceID;
+	LPSTR		lpstrDeviceType;
+	LPSTR		lpstrElementName;
+	LPSTR		lpstrAlias;
+} MCI_OPEN_PARMS32A, *LPMCI_OPEN_PARMS32A;
+
+typedef struct {
+	DWORD		dwCallback;
+	MCIDEVICEID32	wDeviceID;
+	LPWSTR		lpstrDeviceType;
+	LPWSTR		lpstrElementName;
+	LPWSTR		lpstrAlias;
+} MCI_OPEN_PARMS32W, *LPMCI_OPEN_PARMS32W;
+
+DECL_WINELIB_TYPE_AW(MCI_OPEN_PARMS);
+DECL_WINELIB_TYPE_AW(LPMCI_OPEN_PARMS);
 
 typedef struct {
 	DWORD   dwCallback;
@@ -975,7 +1759,22 @@
 	DWORD   dwCallback;
 	LPSTR   lpstrReturn;
 	DWORD   dwRetSize;
-} MCI_INFO_PARMS, *LPMCI_INFO_PARMS;
+} MCI_INFO_PARMS16, *LPMCI_INFO_PARMS16;
+
+typedef struct {
+	DWORD   dwCallback;
+	LPSTR   lpstrReturn;
+	DWORD   dwRetSize;
+} MCI_INFO_PARMS32A, *LPMCI_INFO_PARMS32A;
+
+typedef struct {
+	DWORD   dwCallback;
+	LPSTR   lpstrReturn;
+	DWORD   dwRetSize;
+} MCI_INFO_PARMS32W, *LPMCI_INFO_PARMS32W;
+
+DECL_WINELIB_TYPE(MCI_INFO_PARMS);
+DECL_WINELIB_TYPE(LPMCI_INFO_PARMS);
 
 typedef struct {
 	DWORD   dwCallback;
@@ -984,13 +1783,32 @@
 } MCI_GETDEVCAPS_PARMS, *LPMCI_GETDEVCAPS_PARMS;
 
 typedef struct {
-	DWORD   dwCallback;
-	LPSTR   lpstrReturn;
-	DWORD   dwRetSize;
-	DWORD   dwNumber;
-	UINT16    wDeviceType;
-	UINT16    wReserved0;
-} MCI_SYSINFO_PARMS, *LPMCI_SYSINFO_PARMS;
+	DWORD	dwCallback;
+	LPSTR	lpstrReturn;
+	DWORD	dwRetSize;
+	DWORD	dwNumber;
+	WORD	wDeviceType;
+	WORD	wReserved0;
+} MCI_SYSINFO_PARMS16, *LPMCI_SYSINFO_PARMS16;
+
+typedef struct {
+	DWORD	dwCallback;
+	LPSTR	lpstrReturn;
+	DWORD	dwRetSize;
+	DWORD	dwNumber;
+	UINT32	wDeviceType;
+} MCI_SYSINFO_PARMS32A, *LPMCI_SYSINFO_PARMS32A;
+
+typedef struct {
+	DWORD	dwCallback;
+	LPWSTR	lpstrReturn;
+	DWORD	dwRetSize;
+	DWORD	dwNumber;
+	UINT32	wDeviceType;
+} MCI_SYSINFO_PARMS32W, *LPMCI_SYSINFO_PARMS32W;
+
+DECL_WINELIB_TYPE_AW(MCI_SYSINFO_PARMS);
+DECL_WINELIB_TYPE_AW(LPMCI_SYSINFO_PARMS);
 
 typedef struct {
 	DWORD   dwCallback;
@@ -999,12 +1817,21 @@
 } MCI_SET_PARMS, *LPMCI_SET_PARMS;
 
 typedef struct {
-	DWORD   dwCallback;
-	int     nVirtKey;
-	UINT16    wReserved0;
-	HWND16  hwndBreak;
-	UINT16    wReserved1;
-} MCI_BREAK_PARMS, *LPMCI_BREAK_PARMS;
+	DWORD	dwCallback;
+	UINT16	nVirtKey;
+	WORD	wReserved0;
+	HWND16	hwndBreak;
+	WORD	wReserved1;
+} MCI_BREAK_PARMS16, *LPMCI_BREAK_PARMS16;
+
+typedef struct {
+	DWORD	dwCallback;
+	INT32	nVirtKey;
+	HWND32	hwndBreak;
+} MCI_BREAK_PARMS32, *LPMCI_BREAK_PARMS32;
+
+DECL_WINELIB_TYPE(MCI_BREAK_PARMS);
+DECL_WINELIB_TYPE(LPMCI_BREAK_PARMS);
 
 typedef struct {
 	DWORD   dwCallback;
@@ -1017,9 +1844,22 @@
 } MCI_SAVE_PARMS, *LPMCI_SAVE_PARMS;
 
 typedef struct {
-	DWORD   dwCallback;
-	LPCSTR  lpfilename;
-} MCI_LOAD_PARMS, *LPMCI_LOAD_PARMS;
+	DWORD	dwCallback;
+	LPCSTR	lpfilename;
+} MCI_LOAD_PARMS16, *LPMCI_LOAD_PARMS16;
+
+typedef struct {
+	DWORD	dwCallback;
+	LPCSTR	lpfilename;
+} MCI_LOAD_PARMS32A, *LPMCI_LOAD_PARMS32A;
+
+typedef struct {
+	DWORD	dwCallback;
+	LPCWSTR	lpfilename;
+} MCI_LOAD_PARMS32W, *LPMCI_LOAD_PARMS32W;
+
+DECL_WINELIB_TYPE(MCI_LOAD_PARMS);
+DECL_WINELIB_TYPE(LPMCI_LOAD_PARMS);
 
 typedef struct {
 	DWORD   dwCallback;
@@ -1078,9 +1918,22 @@
 } MCI_VD_STEP_PARMS, *LPMCI_VD_STEP_PARMS;
 
 typedef struct {
-	DWORD   dwCallback;
-	LPCSTR  lpstrCommand;
-} MCI_VD_ESCAPE_PARMS, *LPMCI_VD_ESCAPE_PARMS;
+	DWORD	dwCallback;
+	LPCSTR	lpstrCommand;
+} MCI_VD_ESCAPE_PARMS16, *LPMCI_VD_ESCAPE_PARMS16;
+
+typedef struct {
+	DWORD	dwCallback;
+	LPCSTR	lpstrCommand;
+} MCI_VD_ESCAPE_PARMS32A, *LPMCI_VD_ESCAPE_PARMS32A;
+
+typedef struct {
+	DWORD	dwCallback;
+	LPCWSTR	lpstrCommand;
+} MCI_VD_ESCAPE_PARMS32W, *LPMCI_VD_ESCAPE_PARMS32W;
+
+DECL_WINELIB_TYPE(MCI_VD_ESCAPE_PARMS);
+DECL_WINELIB_TYPE(LPMCI_VD_ESCAPE_PARMS);
 
 #define MCI_WAVE_OPEN_BUFFER            0x00010000L
 
@@ -1109,14 +1962,35 @@
 #define MCI_WAVE_GETDEVCAPS_OUTPUTS     0x00004002L
 
 typedef struct {
-	DWORD   dwCallback;
-	UINT16  wDeviceID;
-	UINT16  wReserved0;
-	SEGPTR  lpstrDeviceType;
-	SEGPTR  lpstrElementName;
-	SEGPTR  lpstrAlias;
-	DWORD   dwBufferSeconds;
-} MCI_WAVE_OPEN_PARMS, *LPMCI_WAVE_OPEN_PARMS;
+	DWORD		dwCallback;
+	MCIDEVICEID16	wDeviceID;
+	WORD		wReserved0;
+	SEGPTR		lpstrDeviceType;
+	SEGPTR		lpstrElementName;
+	SEGPTR		lpstrAlias;
+	DWORD		dwBufferSeconds;
+} MCI_WAVE_OPEN_PARMS16, *LPMCI_WAVE_OPEN_PARMS16;
+
+typedef struct {
+	DWORD		dwCallback;
+	MCIDEVICEID32	wDeviceID;
+	LPCSTR		lpstrDeviceType;
+	LPCSTR		lpstrElementName;
+	LPCSTR		lpstrAlias;
+	DWORD   	dwBufferSeconds;
+} MCI_WAVE_OPEN_PARMS32A, *LPMCI_WAVE_OPEN_PARMS32A;
+
+typedef struct {
+	DWORD		dwCallback;
+	MCIDEVICEID32	wDeviceID;
+	LPCWSTR		lpstrDeviceType;
+	LPCWSTR		lpstrElementName;
+	LPCWSTR		lpstrAlias;
+	DWORD   	dwBufferSeconds;
+} MCI_WAVE_OPEN_PARMS32W, *LPMCI_WAVE_OPEN_PARMS32W;
+
+DECL_WINELIB_TYPE_AW(MCI_WAVE_OPEN_PARMS);
+DECL_WINELIB_TYPE_AW(LPMCI_WAVE_OPEN_PARMS);
 
 typedef struct {
 	DWORD   dwCallback;
@@ -1125,24 +1999,41 @@
 } MCI_WAVE_DELETE_PARMS, *LPMCI_WAVE_DELETE_PARMS;
 
 typedef struct {
-	DWORD   dwCallback;
-	DWORD   dwTimeFormat;
-	DWORD   dwAudio;
-	UINT16    wInput;
-	UINT16    wReserved0;
-	UINT16    wOutput;
-	UINT16    wReserved1;
-	UINT16    wFormatTag;
-	UINT16    wReserved2;
-	UINT16    nChannels;
-	UINT16    wReserved3;
-	DWORD   nSamplesPerSec;
-	DWORD   nAvgBytesPerSec;
-	UINT16    nBlockAlign;
-	UINT16    wReserved4;
-	UINT16    wBitsPerSample;
-	UINT16    wReserved5;
-} MCI_WAVE_SET_PARMS, * LPMCI_WAVE_SET_PARMS;
+	DWORD	dwCallback;
+	DWORD	dwTimeFormat;
+	DWORD	dwAudio;
+	UINT16	wInput;
+	UINT16	wReserved0;
+	UINT16	wOutput;
+	UINT16	wReserved1;
+	UINT16	wFormatTag;
+	UINT16	wReserved2;
+	UINT16	nChannels;
+	UINT16	wReserved3;
+	DWORD	nSamplesPerSec;
+	DWORD	nAvgBytesPerSec;
+	UINT16	nBlockAlign;
+	UINT16	wReserved4;
+	UINT16	wBitsPerSample;
+	UINT16	wReserved5;
+} MCI_WAVE_SET_PARMS16, * LPMCI_WAVE_SET_PARMS16;
+
+typedef struct {
+	DWORD	dwCallback;
+	DWORD	dwTimeFormat;
+	DWORD	dwAudio;
+	UINT32	wInput;
+	UINT32	wOutput;
+	UINT32	wFormatTag;
+	UINT32	nChannels;
+	DWORD	nSamplesPerSec;
+	DWORD	nAvgBytesPerSec;
+	UINT32	nBlockAlign;
+	UINT32	wBitsPerSample;
+} MCI_WAVE_SET_PARMS32, * LPMCI_WAVE_SET_PARMS32;
+
+DECL_WINELIB_TYPE(MCI_WAVE_SET_PARMS);
+DECL_WINELIB_TYPE(LPMCI_WAVE_SET_PARMS);
 
 #define     MCI_SEQ_DIV_PPQN            (0 + MCI_SEQ_OFFSET)
 #define     MCI_SEQ_DIV_SMPTE_24        (1 + MCI_SEQ_OFFSET)
@@ -1239,7 +2130,30 @@
 	DWORD   dwStyle;
 	HWND16  hWndParent;
 	UINT16  wReserved1;
-} MCI_ANIM_OPEN_PARMS, *LPMCI_ANIM_OPEN_PARMS;
+} MCI_ANIM_OPEN_PARMS16, *LPMCI_ANIM_OPEN_PARMS16;
+
+typedef struct {
+	DWORD		dwCallback;
+	MCIDEVICEID32	wDeviceID;
+	LPCSTR		lpstrDeviceType;
+	LPCSTR		lpstrElementName;
+	LPCSTR		lpstrAlias;
+	DWORD		dwStyle;
+	HWND32		hWndParent;
+} MCI_ANIM_OPEN_PARMS32A, *LPMCI_ANIM_OPEN_PARMS32A;
+
+typedef struct {
+	DWORD		dwCallback;
+	MCIDEVICEID32	wDeviceID;
+	LPCSTR		lpstrDeviceType;
+	LPCSTR		lpstrElementName;
+	LPCSTR		lpstrAlias;
+	DWORD		dwStyle;
+	HWND32		hWndParent;
+} MCI_ANIM_OPEN_PARMS32W, *LPMCI_ANIM_OPEN_PARMS32W;
+
+DECL_WINELIB_TYPE_AW(MCI_ANIM_OPEN_PARMS);
+DECL_WINELIB_TYPE_AW(LPMCI_ANIM_OPEN_PARMS);
 
 typedef struct {
 	DWORD   dwCallback;
@@ -1254,13 +2168,30 @@
 } MCI_ANIM_STEP_PARMS, *LPMCI_ANIM_STEP_PARMS;
 
 typedef struct {
-	DWORD   dwCallback;
-	HWND16  hWnd;
-	UINT16    wReserved1;
-	UINT16    nCmdShow;
-	UINT16    wReserved2;
-	LPCSTR  lpstrText;
-} MCI_ANIM_WINDOW_PARMS, *LPMCI_ANIM_WINDOW_PARMS;
+	DWORD	dwCallback;
+	HWND16	hWnd;
+	WORD	wReserved1;
+	WORD	nCmdShow;
+	WORD	wReserved2;
+	LPCSTR	lpstrText;
+} MCI_ANIM_WINDOW_PARMS16, *LPMCI_ANIM_WINDOW_PARMS16;
+
+typedef struct {
+	DWORD	dwCallback;
+	HWND32	hWnd;
+	UINT32	nCmdShow;
+	LPCSTR	lpstrText;
+} MCI_ANIM_WINDOW_PARMS32A, *LPMCI_ANIM_WINDOW_PARMS32A;
+
+typedef struct {
+	DWORD	dwCallback;
+	HWND32	hWnd;
+	UINT32	nCmdShow;
+	LPCWSTR	lpstrText;
+} MCI_ANIM_WINDOW_PARMS32W, *LPMCI_ANIM_WINDOW_PARMS32W;
+
+DECL_WINELIB_TYPE(MCI_ANIM_WINDOW_PARMS);
+DECL_WINELIB_TYPE(LPMCI_ANIM_WINDOW_PARMS);
 
 typedef struct {
 	DWORD   dwCallback;
@@ -1270,13 +2201,35 @@
 #else   /* ifdef MCI_USE_OFFEXT */
 	RECT16  rc;
 #endif  /* ifdef MCI_USE_OFFEXT */
-} MCI_ANIM_RECT_PARMS, *LPMCI_ANIM_RECT_PARMS;
+} MCI_ANIM_RECT_PARMS16, *LPMCI_ANIM_RECT_PARMS16;
+
+typedef struct {
+	DWORD	dwCallback;
+#ifdef MCI_USE_OFFEXT
+	POINT32	ptOffset;
+	POINT32	ptExtent;
+#else   /* ifdef MCI_USE_OFFEXT */
+	RECT32	rc;
+#endif  /* ifdef MCI_USE_OFFEXT */
+} MCI_ANIM_RECT_PARMS32, *LPMCI_ANIM_RECT_PARMS32;
+
+DECL_WINELIB_TYPE(MCI_ANIM_RECT_PARMS);
+DECL_WINELIB_TYPE(LPMCI_ANIM_RECT_PARMS);
 
 typedef struct {
 	DWORD   dwCallback;
 	RECT16  rc;
 	HDC16   hDC;
-} MCI_ANIM_UPDATE_PARMS, *LPMCI_ANIM_UPDATE_PARMS;
+} MCI_ANIM_UPDATE_PARMS16, *LPMCI_ANIM_UPDATE_PARMS16;
+
+typedef struct {
+	DWORD   dwCallback;
+	RECT32  rc;
+	HDC32   hDC;
+} MCI_ANIM_UPDATE_PARMS32, *LPMCI_ANIM_UPDATE_PARMS32;
+
+DECL_WINELIB_TYPE(MCI_ANIM_UPDATE_PARMS);
+DECL_WINELIB_TYPE(LPMCI_ANIM_UPDATE_PARMS);
 
 #define MCI_OVLY_OPEN_WS                0x00010000L
 #define MCI_OVLY_OPEN_PARENT            0x00020000L
@@ -1310,25 +2263,65 @@
 #define MCI_OVLY_WHERE_VIDEO            0x00100000L
 
 typedef struct {
-	DWORD   dwCallback;
-	UINT16    wDeviceID;
-	UINT16    wReserved0;
-	LPCSTR  lpstrDeviceType;
-	LPCSTR  lpstrElementName;
-	LPCSTR  lpstrAlias;
-	DWORD   dwStyle;
-	HWND16  hWndParent;
-	UINT16    wReserved1;
-} MCI_OVLY_OPEN_PARMS, *LPMCI_OVLY_OPEN_PARMS;
+	DWORD		dwCallback;
+	MCIDEVICEID16	wDeviceID;
+	WORD		wReserved0;
+	LPCSTR		lpstrDeviceType;
+	LPCSTR		lpstrElementName;
+	LPCSTR		lpstrAlias;
+	DWORD		dwStyle;
+	HWND16		hWndParent;
+	WORD		wReserved1;
+} MCI_OVLY_OPEN_PARMS16, *LPMCI_OVLY_OPEN_PARMS16;
 
 typedef struct {
-	DWORD   dwCallback;
-	HWND16  hWnd;
-	UINT16    wReserved1;
-	UINT16    nCmdShow;
-	UINT16    wReserved2;
-	LPCSTR  lpstrText;
-} MCI_OVLY_WINDOW_PARMS, *LPMCI_OVLY_WINDOW_PARMS;
+	DWORD		dwCallback;
+	MCIDEVICEID32	wDeviceID;
+	LPCSTR		lpstrDeviceType;
+	LPCSTR		lpstrElementName;
+	LPCSTR		lpstrAlias;
+	DWORD		dwStyle;
+	HWND32		hWndParent;
+} MCI_OVLY_OPEN_PARMS32A, *LPMCI_OVLY_OPEN_PARMS32A;
+
+typedef struct {
+	DWORD		dwCallback;
+	MCIDEVICEID32	wDeviceID;
+	LPCWSTR		lpstrDeviceType;
+	LPCWSTR		lpstrElementName;
+	LPCWSTR		lpstrAlias;
+	DWORD		dwStyle;
+	HWND32		hWndParent;
+} MCI_OVLY_OPEN_PARMS32W, *LPMCI_OVLY_OPEN_PARMS32W;
+
+DECL_WINELIB_TYPE_AW(MCI_OVLY_OPEN_PARMS);
+DECL_WINELIB_TYPE_AW(LPMCI_OVLY_OPEN_PARMS);
+
+typedef struct {
+	DWORD	dwCallback;
+	HWND16	hWnd;
+	WORD	wReserved1;
+	UINT16	nCmdShow;
+	WORD	wReserved2;
+	LPCSTR	lpstrText;
+} MCI_OVLY_WINDOW_PARMS16, *LPMCI_OVLY_WINDOW_PARMS16;
+
+typedef struct {
+	DWORD	dwCallback;
+	HWND32	hWnd;
+	UINT32	nCmdShow;
+	LPCSTR	lpstrText;
+} MCI_OVLY_WINDOW_PARMS32A, *LPMCI_OVLY_WINDOW_PARMS32A;
+
+typedef struct {
+	DWORD	dwCallback;
+	HWND32	hWnd;
+	UINT32	nCmdShow;
+	LPCWSTR	lpstrText;
+} MCI_OVLY_WINDOW_PARMS32W, *LPMCI_OVLY_WINDOW_PARMS32W;
+
+DECL_WINELIB_TYPE_AW(MCI_OVLY_OPEN_WINDOW_PARMS);
+DECL_WINELIB_TYPE_AW(LPMCI_OVLY_OPEN_WINDOW_PARMS);
 
 typedef struct {
 	DWORD   dwCallback;
@@ -1338,20 +2331,62 @@
 #else   /* ifdef MCI_USE_OFFEXT */
 	RECT16  rc;
 #endif  /* ifdef MCI_USE_OFFEXT */
-} MCI_OVLY_RECT_PARMS, *LPMCI_OVLY_RECT_PARMS;
+} MCI_OVLY_RECT_PARMS16, *LPMCI_OVLY_RECT_PARMS16;
+
+typedef struct {
+	DWORD   dwCallback;
+#ifdef MCI_USE_OFFEXT
+	POINT32 ptOffset;
+	POINT32 ptExtent;
+#else   /* ifdef MCI_USE_OFFEXT */
+	RECT32  rc;
+#endif  /* ifdef MCI_USE_OFFEXT */
+} MCI_OVLY_RECT_PARMS32, *LPMCI_OVLY_RECT_PARMS32;
+
+DECL_WINELIB_TYPE(MCI_OVLY_RECT_PARMS);
+DECL_WINELIB_TYPE(LPMCI_OVLY_RECT_PARMS);
 
 typedef struct {
 	DWORD   dwCallback;
 	LPCSTR  lpfilename;
 	RECT16  rc;
-} MCI_OVLY_SAVE_PARMS, *LPMCI_OVLY_SAVE_PARMS;
+} MCI_OVLY_SAVE_PARMS16, *LPMCI_OVLY_SAVE_PARMS16;
 
 typedef struct {
 	DWORD   dwCallback;
 	LPCSTR  lpfilename;
-	RECT16  rc;
-} MCI_OVLY_LOAD_PARMS, *LPMCI_OVLY_LOAD_PARMS;
+	RECT32  rc;
+} MCI_OVLY_SAVE_PARMS32A, *LPMCI_OVLY_SAVE_PARMS32A;
 
+typedef struct {
+	DWORD   dwCallback;
+	LPCWSTR  lpfilename;
+	RECT32  rc;
+} MCI_OVLY_SAVE_PARMS32W, *LPMCI_OVLY_SAVE_PARMS32W;
+
+DECL_WINELIB_TYPE_AW(MCI_OVLY_SAVE_PARMS);
+DECL_WINELIB_TYPE_AW(LPMCI_OVLY_SAVE_PARMS);
+
+typedef struct {
+	DWORD	dwCallback;
+	LPCSTR	lpfilename;
+	RECT16	rc;
+} MCI_OVLY_LOAD_PARMS16, *LPMCI_OVLY_LOAD_PARMS16;
+
+typedef struct {
+	DWORD	dwCallback;
+	LPCSTR	lpfilename;
+	RECT32	rc;
+} MCI_OVLY_LOAD_PARMS32A, *LPMCI_OVLY_LOAD_PARMS32A;
+
+typedef struct {
+	DWORD	dwCallback;
+	LPCWSTR	lpfilename;
+	RECT32	rc;
+} MCI_OVLY_LOAD_PARMS32W, *LPMCI_OVLY_LOAD_PARMS32W;
+
+DECL_WINELIB_TYPE_AW(MCI_OVLY_LOAD_PARMS);
+DECL_WINELIB_TYPE_AW(LPMCI_OVLY_LOAD_PARMS);
 
 /**************************************************************
  * 		Linux MMSYSTEM Internals & Sample Audio Drivers
@@ -1427,6 +2462,15 @@
 #define AUXDM_GETVOLUME     5
 #define AUXDM_SETVOLUME     6
 
+#define	MXDM_GETNUMDEVS		1
+#define	MXDM_GETDEVCAPS		2
+#define	MXDM_OPEN		3
+#define	MXDM_CLOSE		4
+#define	MXDM_GETLINEINFO	5
+#define	MXDM_GETLINECONTROLS	6
+#define	MXDM_GETCONTROLDETAILS	7
+#define	MXDM_SETCONTROLDETAILS	8
+
 #define MCI_MAX_DEVICE_TYPE_LENGTH 80
 
 #define MCI_FALSE                       (MCI_STRING_OFFSET + 19)
@@ -1493,6 +2537,7 @@
 
 #define MAKEMCIRESOURCE(wRet, wRes) MAKELRESULT((wRet), (wRes))
 
+/* the 95 DDK defines those slightly different, but they are internal anyway */
 typedef struct {
 	DWORD   	dwCallback;
 	DWORD   	dwInstance;
@@ -1501,35 +2546,42 @@
 } PORTALLOC, *LPPORTALLOC;
 
 typedef struct {
-	HWAVE16			hWave;
+	HWAVE16		hWave;
 	LPWAVEFORMAT	lpFormat;
-	DWORD			dwCallBack;
-	DWORD			dwInstance;
-	UINT16                  uDeviceID;
+	DWORD		dwCallBack;
+	DWORD		dwInstance;
+	UINT16		uDeviceID;
 } WAVEOPENDESC, *LPWAVEOPENDESC;
 
 typedef struct {
-	HMIDI16			hMidi;
-	DWORD			dwCallback;
-	DWORD			dwInstance;
+	HMIDI16		hMidi;
+	DWORD		dwCallback;
+	DWORD		dwInstance;
 } MIDIOPENDESC, *LPMIDIOPENDESC;
 
 typedef struct {
-	UINT16			wDelay;
-	UINT16			wResolution;
+	UINT16		wDelay;
+	UINT16		wResolution;
 	LPTIMECALLBACK	lpFunction;
-	DWORD			dwUser;
-	UINT16			wFlags;
+	DWORD		dwUser;
+	UINT16		wFlags;
 } TIMEREVENT, *LPTIMEREVENT;
 
+typedef struct tMIXEROPENDESC
+{
+	HMIXEROBJ16	hmx;
+	DWORD		dwCallback;
+	DWORD		dwInstance;
+	UINT16		uDeviceID;
+} MIXEROPENDESC,*LPMIXEROPENDESC;
+
 typedef struct {
-	UINT16    wDeviceID;				/* device ID */
-	LPSTR 	lpstrParams;			/* parameter string for entry in SYSTEM.INI */
-	UINT16    wCustomCommandTable;	/* custom command table (0xFFFF if none) */
-									/* filled in by the driver */
-	UINT16    wType;					/* driver type */
-									/* filled in by the driver */
-} MCI_OPEN_DRIVER_PARMS, * LPMCI_OPEN_DRIVER_PARMS;
+	UINT16	wDeviceID;	/* device ID */
+	LPSTR	lpstrParams;	/* parameter string for entry in SYSTEM.INI */
+	UINT16	wCustomCommandTable;	/* custom command table (0xFFFF if none)
+					 * filled in by the driver */
+	UINT16	wType;		/* driver type (filled in by the driver) */
+} MCI_OPEN_DRIVER_PARMS, *LPMCI_OPEN_DRIVER_PARMS;
 
 DWORD  WINAPI mciGetDriverData(UINT16 uDeviceID);
 BOOL16 WINAPI mciSetDriverData(UINT16 uDeviceID, DWORD dwData);
@@ -1551,6 +2603,8 @@
                              WORD wMsg, DWORD dwUser, DWORD dwParam1, DWORD dwParam2);
 DWORD WINAPI auxMessage(WORD wDevID, WORD wMsg, DWORD dwUser, 
 					DWORD dwParam1, DWORD dwParam2);
+DWORD WINAPI mixMessage(WORD wDevID, WORD wMsg, DWORD dwUser, 
+					DWORD dwParam1, DWORD dwParam2);
 DWORD WINAPI midMessage(WORD wDevID, WORD wMsg, DWORD dwUser, 
 					DWORD dwParam1, DWORD dwParam2);
 DWORD WINAPI modMessage(WORD wDevID, WORD wMsg, DWORD dwUser, 
@@ -1559,5 +2613,6 @@
 					DWORD dwParam1, DWORD dwParam2);
 DWORD WINAPI wodMessage(WORD wDevID, WORD wMsg, DWORD dwUser, 
 					DWORD dwParam1, DWORD dwParam2);
+#pragma pack(4)
 
 #endif /* __WINE_MMSYSTEM_H */
diff --git a/include/module.h b/include/module.h
index b411b97..5b7cb2b 100644
--- a/include/module.h
+++ b/include/module.h
@@ -135,7 +135,8 @@
 extern BOOL32 BUILTIN_Init(void);
 extern HMODULE16 BUILTIN_LoadModule( LPCSTR name, BOOL32 force );
 extern LPCSTR BUILTIN_GetEntryPoint16( WORD cs, WORD ip, WORD *pOrd );
-extern FARPROC32 BUILTIN_GetEntryPoint32( char *buffer, void *relay );
+extern FARPROC32 BUILTIN_GetEntryPoint32( char *buffer, void *relay,
+                                          DWORD *typemask );
 extern FARPROC32 BUILTIN_GetProcAddress32(NE_MODULE *pModule, LPCSTR function);
 extern BOOL32 BUILTIN_ParseDLLOptions( const char *str );
 extern void BUILTIN_PrintDLLs(void);
diff --git a/include/region.h b/include/region.h
index c5818f1..d53546a 100644
--- a/include/region.h
+++ b/include/region.h
@@ -20,5 +20,6 @@
 extern BOOL32 REGION_DeleteObject( HRGN32 hrgn, RGNOBJ * obj );
 extern BOOL32 REGION_UnionRectWithRgn( HRGN32 hrgn, const RECT32 *lpRect );
 extern BOOL32 REGION_FrameRgn( HRGN32 dest, HRGN32 src, INT32 x, INT32 y );
+extern BOOL32 REGION_IsEmpty( HRGN32 rgn );
 
 #endif  /* __WINE_REGION_H */
diff --git a/include/stddebug.h b/include/stddebug.h
index c5ac25b..8f73efc 100644
--- a/include/stddebug.h
+++ b/include/stddebug.h
@@ -77,6 +77,7 @@
 
 #ifdef DEBUG_NONE
 #undef DEBUG_ACCEL
+#undef DEBUG_ASPI
 #undef DEBUG_ATOM
 #undef DEBUG_BITBLT
 #undef DEBUG_BITMAP
@@ -97,7 +98,6 @@
 #undef DEBUG_DOSFS
 #undef DEBUG_DRIVER
 #undef DEBUG_EDIT
-#undef DEBUG_ENV
 #undef DEBUG_EVENT
 #undef DEBUG_EXEC
 #undef DEBUG_FILE
@@ -163,6 +163,7 @@
 
 #ifdef DEBUG_ALL
 #define DEBUG_ACCEL
+#define DEBUG_ASPI
 #define DEBUG_ATOM
 #define DEBUG_BITBLT
 #define DEBUG_BITMAP
@@ -183,7 +184,6 @@
 #define DEBUG_DOSFS
 #define DEBUG_DRIVER
 #define DEBUG_EDIT
-#define DEBUG_ENV
 #define DEBUG_EVENT
 #define DEBUG_EXEC
 #define DEBUG_FILE
diff --git a/include/windows.h b/include/windows.h
index 83d4603..a37a669 100644
--- a/include/windows.h
+++ b/include/windows.h
@@ -768,12 +768,21 @@
 #define DLGWINDOWEXTRA      30
 
   /* Dialog styles */
-#define DS_ABSALIGN         0x001
-#define DS_SYSMODAL         0x002
-#define DS_LOCALEDIT        0x020
-#define DS_SETFONT          0x040
-#define DS_MODALFRAME       0x080
-#define DS_NOIDLEMSG        0x100
+#define DS_ABSALIGN		0x0001
+#define DS_SYSMODAL		0x0002
+#define DS_3DLOOK		0x0004	/* win95 */
+#define DS_FIXEDSYS		0x0008	/* win95 */
+#define DS_NOFAILCREATE		0x0010	/* win95 */
+#define DS_LOCALEDIT		0x0020
+#define DS_SETFONT		0x0040
+#define DS_MODALFRAME		0x0080
+#define DS_NOIDLEMSG		0x0100
+#define DS_SETFOREGROUND	0x0200	/* win95 */
+#define DS_CONTROL		0x0400	/* win95 */
+#define DS_CENTER		0x0800	/* win95 */
+#define DS_CENTERMOUSE		0x1000	/* win95 */
+#define DS_CONTEXTHELP		0x2000	/* win95 */
+
 
   /* Dialog messages */
 #define DM_GETDEFID         (WM_USER+0)
@@ -1917,7 +1926,7 @@
 } DIBSECTION,*LPDIBSECTION;
 
 
-  /* Cursors / Icons */
+/* Cursors / Icons */
 
 typedef struct
 {
@@ -1929,7 +1938,14 @@
     BYTE    bBitsPerPixel;
 } CURSORICONINFO;
 
-
+/* only used by Win32 functions */
+typedef struct {
+	BOOL32		fIcon;
+	DWORD		xHotspot;
+	DWORD		yHotspot;
+	HBITMAP32	hbmMask;
+	HBITMAP32	hbmColor;
+} ICONINFO,*LPICONINFO;
 
 typedef struct {
 	BYTE i;  /* much more .... */
@@ -3227,13 +3243,34 @@
 #define SS_BLACKFRAME       0x00000007L
 #define SS_GRAYFRAME        0x00000008L
 #define SS_WHITEFRAME       0x00000009L
+
 #define SS_SIMPLE           0x0000000BL
 #define SS_LEFTNOWORDWRAP   0x0000000CL
+
+#define SS_OWNERDRAW        0x0000000DL
+#define SS_BITMAP           0x0000000EL
+#define SS_ENHMETAFILE      0x0000000FL
+
+#define SS_ETCHEDHORZ       0x00000010L
+#define SS_ETCHEDVERT       0x00000011L
+#define SS_ETCHEDFRAME      0x00000012L
+#define SS_TYPEMASK         0x0000001FL
+
 #define SS_NOPREFIX         0x00000080L
+#define SS_CENTERIMAGE      0x00000200L
+#define SS_RIGHTJUST        0x00000400L
+#define SS_REALSIZEIMAGE    0x00000800L
+#define SS_SUNKEN           0x00001000L
 
 /* Static Control Messages */
-#define STM_SETICON         (WM_USER+0)
-#define STM_GETICON         (WM_USER+1)
+#define STM_SETICON16       (WM_USER+0)
+#define STM_SETICON32       0x0170
+#define STM_SETICON	    WINELIB_NAME(STM_SETICON)
+#define STM_GETICON16       (WM_USER+1)
+#define STM_GETICON32       0x0171
+#define STM_GETICON	    WINELIB_NAME(STM_GETICON)
+#define STM_SETIMAGE        0x0172
+#define STM_GETIMAGE        0x0173
 
 /* WM_H/VSCROLL commands */
 #define SB_LINEUP           0
@@ -5430,6 +5467,7 @@
 HANDLE32    WINAPI CreateFileMapping32W(HANDLE32,LPSECURITY_ATTRIBUTES,DWORD,
                                         DWORD,DWORD,LPCWSTR);
 #define     CreateFileMapping WINELIB_NAME_AW(CreateFileMapping)
+HICON32     WINAPI CreateIconIndirect(LPICONINFO);
 HANDLE32    WINAPI CreateMutex32A(LPSECURITY_ATTRIBUTES,BOOL32,LPCSTR);
 HANDLE32    WINAPI CreateMutex32W(LPSECURITY_ATTRIBUTES,BOOL32,LPCWSTR);
 #define     CreateMutex WINELIB_NAME_AW(CreateMutex)
@@ -5508,6 +5546,7 @@
 BOOL32      WINAPI GetMenuItemInfo32A(HMENU32,UINT32,BOOL32,MENUITEMINFO32A*);
 BOOL32      WINAPI GetMenuItemInfo32W(HMENU32,UINT32,BOOL32,MENUITEMINFO32W*);
 #define     GetMenuItemInfo WINELIB_NAME_AW(GetMenuItemInfo)
+DWORD       WINAPI GetObjectType(HANDLE32);
 UINT32      WINAPI GetOEMCP(void);
 DWORD       WINAPI GetPriorityClass(HANDLE32);
 INT32       WINAPI GetPrivateProfileSection32A(LPCSTR,LPSTR,INT32,LPCSTR);
@@ -5562,6 +5601,9 @@
 BOOL32      WINAPI MoveFile32A(LPCSTR,LPCSTR);
 BOOL32      WINAPI MoveFile32W(LPCWSTR,LPCWSTR);
 #define     MoveFile WINELIB_NAME_AW(MoveFile)
+BOOL32      WINAPI MoveFileEx32A(LPCSTR,LPCSTR,DWORD);
+BOOL32      WINAPI MoveFileEx32W(LPCWSTR,LPCWSTR,DWORD);
+#define     MoveFileEx WINELIB_NAME_AW(MoveFileEx)
 HANDLE32    WINAPI OpenEvent32A(DWORD,BOOL32,LPCSTR);
 HANDLE32    WINAPI OpenEvent32W(DWORD,BOOL32,LPCWSTR);
 #define     OpenEvent WINELIB_NAME_AW(OpenEvent)
diff --git a/include/winproc.h b/include/winproc.h
index 592b357..83018a6 100644
--- a/include/winproc.h
+++ b/include/winproc.h
@@ -57,26 +57,22 @@
 extern INT32 WINPROC_MapMsg16To32W( UINT16 msg16, WPARAM16 wParam16,
                                     UINT32 *pmsg32, WPARAM32 *pwparam32,
                                     LPARAM *plparam );
-extern INT32 WINPROC_MapMsg32ATo16( UINT32 msg32, WPARAM32 wParam32,
-                                    UINT16 *pmsg16, WPARAM16 *pwparam16,
-                                    LPARAM *plparam );
-extern INT32 WINPROC_MapMsg32WTo16( UINT32 msg32, WPARAM32 wParam32,
-                                    UINT16 *pmsg16, WPARAM16 *pwparam16,
-                                    LPARAM *plparam );
+extern INT32 WINPROC_MapMsg32ATo16( HWND32 hwnd, UINT32 msg32,
+                                    WPARAM32 wParam32, UINT16 *pmsg16,
+                                    WPARAM16 *pwparam16, LPARAM *plparam );
+extern INT32 WINPROC_MapMsg32WTo16( HWND32 hwnd, UINT32 msg32,
+                                    WPARAM32 wParam32, UINT16 *pmsg16,
+                                    WPARAM16 *pwparam16, LPARAM *plparam );
 extern void WINPROC_UnmapMsg32ATo32W( UINT32 msg, WPARAM32 wParam,
                                       LPARAM lParam );
 extern void WINPROC_UnmapMsg32WTo32A( UINT32 msg, WPARAM32 wParam,
                                       LPARAM lParam );
-extern void WINPROC_UnmapMsg16To32A( UINT32 msg, WPARAM32 wParam,
-                                     LPARAM lParam );
-extern void WINPROC_UnmapMsg16To32W( UINT32 msg, WPARAM32 wParam,
-                                     LPARAM lParam );
+extern LRESULT WINPROC_UnmapMsg16To32A( UINT32 msg, WPARAM32 wParam,
+                                        LPARAM lParam, LRESULT result );
+extern LRESULT WINPROC_UnmapMsg16To32W( UINT32 msg, WPARAM32 wParam,
+                                        LPARAM lParam, LRESULT result );
 extern void WINPROC_UnmapMsg32ATo16( UINT32 msg, WPARAM32 wParam,
                                      LPARAM lParam, MSGPARAM16* pm16 );
 extern void WINPROC_UnmapMsg32WTo16( UINT32 msg, WPARAM32 wParam,
                                      LPARAM lParam, MSGPARAM16* pm16 );
-
-typedef LRESULT (*WINPROC_CALLWNDPROC16)(WNDPROC16,HWND16,UINT16,WPARAM16,LPARAM);
-extern void WINPROC_SetCallWndProc16( WINPROC_CALLWNDPROC16 proc );
-
 #endif  /* __WINE_WINPROC_H */
diff --git a/include/winsock.h b/include/winsock.h
index 84187ef..d202655 100644
--- a/include/winsock.h
+++ b/include/winsock.h
@@ -435,6 +435,7 @@
 
 /* ws_... struct conversion flags */
 
+#define WS_DUP_LINEAR		0x0000
 #define WS_DUP_NATIVE           0x0001		/* native structure format (not ws_..) */
 #define WS_DUP_OFFSET           0x0002		/* internal pointers are offsets */
 #define WS_DUP_SEGPTR           0x0004		/* internal pointers are SEGPTRs */
diff --git a/include/wintypes.h b/include/wintypes.h
index afbf781..7cf79d5 100644
--- a/include/wintypes.h
+++ b/include/wintypes.h
@@ -122,7 +122,6 @@
 typedef ACCESS_MASK     REGSAM;
 typedef HANDLE32        HHOOK;
 typedef HANDLE32        HKEY;
-typedef HANDLE32        HMIXEROBJ;
 typedef DWORD           LCID;
 typedef WORD            LANGID;
 typedef DWORD           LCTYPE;
@@ -145,7 +144,6 @@
 typedef INT32          *LPINT32;
 typedef UINT32         *LPUINT32;
 typedef HKEY           *LPHKEY;
-typedef HMIXEROBJ      *LPHMIXEROBJ;
 typedef FLOAT          *LPFLOAT;
 
 /* Special case: a segmented pointer is just a pointer in the user's code. */
@@ -179,6 +177,8 @@
 DECLARE_HANDLE(HMIDI);
 DECLARE_HANDLE(HMIDIIN);
 DECLARE_HANDLE(HMIDIOUT);
+DECLARE_HANDLE(HMIXER);
+DECLARE_HANDLE(HMIXEROBJ);
 DECLARE_HANDLE(HMMIO);
 DECLARE_HANDLE(HMODULE);
 DECLARE_HANDLE(HPALETTE);