]> git.sesse.net Git - vlc/commitdiff
Remove loader
authorJean-Baptiste Kempf <jb@videolan.org>
Tue, 2 Apr 2013 10:42:44 +0000 (12:42 +0200)
committerJean-Baptiste Kempf <jb@videolan.org>
Tue, 2 Apr 2013 10:56:03 +0000 (12:56 +0200)
49 files changed:
NEWS
configure.ac
modules/codec/Modules.am
modules/codec/loader/afl.c [deleted file]
modules/codec/loader/com.h [deleted file]
modules/codec/loader/driver.c [deleted file]
modules/codec/loader/driver.h [deleted file]
modules/codec/loader/ext.c [deleted file]
modules/codec/loader/ext.h [deleted file]
modules/codec/loader/kludge.c [deleted file]
modules/codec/loader/ldt_keeper.c [deleted file]
modules/codec/loader/ldt_keeper.h [deleted file]
modules/codec/loader/loader.h [deleted file]
modules/codec/loader/module.c [deleted file]
modules/codec/loader/pe_image.c [deleted file]
modules/codec/loader/pe_resource.c [deleted file]
modules/codec/loader/qtx/qtxsdk/components.h [deleted file]
modules/codec/loader/registry.c [deleted file]
modules/codec/loader/registry.h [deleted file]
modules/codec/loader/resource.c [deleted file]
modules/codec/loader/stubs.s [deleted file]
modules/codec/loader/vfl.c [deleted file]
modules/codec/loader/win32.c [deleted file]
modules/codec/loader/win32.h [deleted file]
modules/codec/loader/wine/avifmt.h [deleted file]
modules/codec/loader/wine/basetsd.h [deleted file]
modules/codec/loader/wine/debugtools.h [deleted file]
modules/codec/loader/wine/driver.h [deleted file]
modules/codec/loader/wine/heap.h [deleted file]
modules/codec/loader/wine/mmreg.h [deleted file]
modules/codec/loader/wine/module.h [deleted file]
modules/codec/loader/wine/msacm.h [deleted file]
modules/codec/loader/wine/msacmdrv.h [deleted file]
modules/codec/loader/wine/pe_image.h [deleted file]
modules/codec/loader/wine/poppack.h [deleted file]
modules/codec/loader/wine/pshpack1.h [deleted file]
modules/codec/loader/wine/pshpack2.h [deleted file]
modules/codec/loader/wine/vfw.h [deleted file]
modules/codec/loader/wine/winbase.h [deleted file]
modules/codec/loader/wine/windef.h [deleted file]
modules/codec/loader/wine/winerror.h [deleted file]
modules/codec/loader/wine/winestring.h [deleted file]
modules/codec/loader/wine/winnt.h [deleted file]
modules/codec/loader/wine/winreg.h [deleted file]
modules/codec/loader/wine/winuser.h [deleted file]
modules/codec/loader/wineacm.h [deleted file]
modules/codec/loader/wrapper.S [deleted file]
modules/codec/loader/wrapper.h [deleted file]
po/POTFILES.skip

diff --git a/NEWS b/NEWS
index 14ac28655abb38e2b642dd1b59f732ebe2644b4a..9f1a21f9bb057f3f85158e92b9c59610408ef76f 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -189,6 +189,7 @@ Removed modules:
  * Switcher module
  * OSD parser and menu
  * Xscreensaver: use xdg-screensaver
+ * Removed DLL loader for non-Windows Operating Systems
 
 
 Changes between 2.0.4 and 2.0.5:
index b04cbf006cc6af9cf89ec5444ab6a812f31c7b55..08e0971d28cc486f4d8cc2bb12b6ba3c11c96f62 100644 (file)
@@ -4004,20 +4004,7 @@ AC_SUBST(soliddatadir)
 AM_CONDITIONAL(KDE_SOLID, [test "x${soliddatadir}" != "x"])
 
 dnl
-dnl  DLL loader copied from MPlayer copied from somewhere else (WINE ?)
-dnl
-loader=false
-AC_ARG_ENABLE(loader,
-  AS_HELP_STRING([--enable-loader],[build DLL loader for ELF i386 platforms
-          (default disabled)]))
-AM_CONDITIONAL(LOADER, [test "${enable_loader}" = "yes"])
-AS_IF([test "${enable_loader}" = "yes"],
-  [ VLC_ADD_PLUGIN([dmo])
-    VLC_ADD_CPPFLAGS([dmo quicktime ],[-I\\\$(srcdir)/loader])
-    VLC_ADD_LIBS([dmo quicktime ],[libloader.la])
-    VLC_ADD_LIBS([dmo quicktime], [-lpthread])
-  ])
-
+dnl  DMO codec
 AS_IF([test "${SYS}" = "mingw32"], [VLC_ADD_PLUGIN([dmo]) VLC_ADD_LIBS([dmo],[-lole32 -luuid]) ])
 
 EXTEND_HELP_STRING([Components:])
index 74019882fb20d5dd09ccdda95ab6040144c354ec..8113d8a2de4ae5641d8f60eefe6953da4fe9a26f 100644 (file)
@@ -207,34 +207,3 @@ if HAVE_ANDROID
 libvlc_LTLIBRARIES += libiomx_plugin.la libmediacodec_plugin.la
 endif
 
-### Windows DLL loader ###
-
-# TODO: real check for vsscanf() and <sys/mmap.h>
-noinst_HEADERS += loader/com.h loader/driver.h loader/ext.h loader/ldt_keeper.h
-       loader/loader.h loader/registry.h \
-       loader/win32.h loader/wineacm.h loader/wrapper.h \
-       loader/qtx/qtxsdk/components.h \
-       loader/wine/avifmt.h loader/wine/basetsd.h loader/wine/debugtools.h \
-       loader/wine/driver.h loader/wine/heap.h loader/wine/mmreg.h \
-       loader/wine/module.h loader/wine/msacmdrv.h loader/wine/msacm.h \
-       loader/wine/pe_image.h loader/wine/poppack.h loader/wine/pshpack1.h \
-       loader/wine/pshpack2.h loader/wine/vfw.h loader/wine/winbase.h \
-       loader/wine/windef.h loader/wine/winerror.h \
-       loaeder/wine/winestring.h loader/wine/winnt.h loader/wine/winreg.h \
-       loader/wine/winuser.h
-
-libloader_la_CPPFLAGS = -D__WINE__ -DHAVE_SYS_MMAN_H=1 -DHAVE_VSSCANF=1 \
-       -DWIN32_PATH=\"\" -DTRACE\(...\)=\(void\)0
-libloader_la_CFLAGS = -fno-PIC -U_FILE_OFFSET_BITS \
-       -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer
-libloader_la_SOURCES = loader/ldt_keeper.c loader/pe_image.c loader/module.c \
-       loader/ext.c loader/win32.c loader/driver.c loader/pe_resource.c \
-       loader/resource.c loader/registry.c loader/afl.c loader/vfl.c \
-       loader/wrapper.S loader/stubs.s loader/kludge.c
-libloader_la_LIBADD = -lpthread
-libloader_la_LDFLAGS = -static
-if LOADER
-noinst_LTLIBRARIES = libloader.la
-libdmo_plugin_la_DEPENDENCIES = libloader.la
-libquicktime_plugin_la_DEPENDENCIES = libloader.la
-endif
diff --git a/modules/codec/loader/afl.c b/modules/codec/loader/afl.c
deleted file mode 100644 (file)
index 7cb0eb8..0000000
+++ /dev/null
@@ -1,791 +0,0 @@
-/*
- * $Id$
- *
- * Copyright (C) 1998 Patrick Stridvall
- * Copyright (C) 1999 Eric Pouech
- *
- * Originally distributed under LPGL 2.1 (or later) by the Wine project.
- *
- * Modified for use with MPlayer, detailed CVS changelog at
- * http://www.mplayerhq.hu/cgi-bin/cvsweb.cgi/main/
- *
- * File now distributed as part of VLC media player with no modifications.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
- */
-
-/**************************************************************************
-
-
-  This file will contain an interface to ACM drivers.
-  Its content will be based mainly on wine/dlls/msacm32
-  actually, for audio decompression only the following functions
-  are needed:
-  
-  acmStreamOpen ( takes formats of src and dest, returns stream handle )
-  acmStreamPrepareHeader ( takes stream handler and info on data )
-  acmStreamConvert ( the same as PrepareHeader )
-  acmStreamUnprepareHeader
-  acmStreamClose
-  acmStreamSize
-  maybe acmStreamReset
-  
-  In future I'll also add functions for format enumeration, 
-  but not right now.
-
-  Modified for use with MPlayer, detailed CVS changelog at
-  http://www.mplayerhq.hu/cgi-bin/cvsweb.cgi/main/
-  
-***************************************************************************/
-#include "config.h"
-
-#include "wine/winbase.h"
-#include "wine/windef.h"
-#include "wine/winuser.h"
-#include "wine/vfw.h"
-#include "wine/winestring.h"
-#include "wine/driver.h"
-#include "wine/winerror.h"
-#include "wine/msacm.h"
-#include "wine/msacmdrv.h"
-#include "wineacm.h"
-#ifndef __MINGW32__
-#include "ext.h"
-#endif
-#include "driver.h"
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#pragma pack(1)
-#define OpenDriverA DrvOpen
-#define CloseDriver DrvClose
-
-static inline PWINE_ACMSTREAM ACM_GetStream(HACMSTREAM has)
-{
-    return (PWINE_ACMSTREAM)has;
-}
-
-/***********************************************************************
- *           acmDriverAddA (MSACM32.2)
- */
-MMRESULT WINAPI acmDriverAddA(PHACMDRIVERID phadid, HINSTANCE hinstModule,
-                             LPARAM lParam, DWORD dwPriority, DWORD fdwAdd)
-{
-    if (!phadid)
-       return MMSYSERR_INVALPARAM;
-    
-    /* Check if any unknown flags */
-    if (fdwAdd & 
-       ~(ACM_DRIVERADDF_FUNCTION|ACM_DRIVERADDF_NOTIFYHWND|
-         ACM_DRIVERADDF_GLOBAL))
-       return MMSYSERR_INVALFLAG;
-    
-    /* Check if any incompatible flags */
-    if ((fdwAdd & ACM_DRIVERADDF_FUNCTION) && 
-       (fdwAdd & ACM_DRIVERADDF_NOTIFYHWND))
-       return MMSYSERR_INVALFLAG;
-    
-    /* FIXME: in fact, should GetModuleFileName(hinstModule) and do a 
-     * LoadDriver on it, to be sure we can call SendDriverMessage on the
-     * hDrvr handle.
-     */
-    *phadid = (HACMDRIVERID) MSACM_RegisterDriver(NULL, 0, hinstModule);
-    
-    /* FIXME: lParam, dwPriority and fdwAdd ignored */
-    
-    return MMSYSERR_NOERROR;
-}
-
-/***********************************************************************
- *           acmDriverClose (MSACM32.4)
- */
-MMRESULT WINAPI acmDriverClose(HACMDRIVER had, DWORD fdwClose)
-{
-    PWINE_ACMDRIVER  p;
-    PWINE_ACMDRIVER* tp;
-    
-    if (fdwClose)
-       return MMSYSERR_INVALFLAG;
-    
-    p = MSACM_GetDriver(had);
-    if (!p)
-       return MMSYSERR_INVALHANDLE;
-
-    for (tp = &(p->obj.pACMDriverID->pACMDriverList); *tp; *tp = (*tp)->pNextACMDriver) {
-       if (*tp == p) {
-           *tp = (*tp)->pNextACMDriver;
-           break;
-       }
-    }
-    
-    if (p->hDrvr && !p->obj.pACMDriverID->pACMDriverList)
-       CloseDriver(p->hDrvr);
-    
-    HeapFree(MSACM_hHeap, 0, p);
-    
-    return MMSYSERR_NOERROR;
-}
-
-/***********************************************************************
- *           acmDriverEnum (MSACM32.7)
- */
-MMRESULT WINAPI acmDriverEnum(ACMDRIVERENUMCB fnCallback, DWORD dwInstance, DWORD fdwEnum)
-{
-    PWINE_ACMDRIVERID  p;
-    DWORD              fdwSupport;
-
-    if (!fnCallback) {
-       return MMSYSERR_INVALPARAM;
-    }
-    
-    if (fdwEnum && ~(ACM_DRIVERENUMF_NOLOCAL|ACM_DRIVERENUMF_DISABLED)) {
-       return MMSYSERR_INVALFLAG;
-    }
-    
-    for (p = MSACM_pFirstACMDriverID; p; p = p->pNextACMDriverID) {
-       fdwSupport = ACMDRIVERDETAILS_SUPPORTF_CODEC;
-       if (!p->bEnabled) {
-           if (fdwEnum & ACM_DRIVERENUMF_DISABLED)
-               fdwSupport |= ACMDRIVERDETAILS_SUPPORTF_DISABLED;
-           else
-               continue;
-       }
-       (*fnCallback)((HACMDRIVERID) p, dwInstance, fdwSupport);
-    }
-    
-    return MMSYSERR_NOERROR;
-}
-
-/***********************************************************************
- *           acmDriverID (MSACM32.8)
- */
-MMRESULT WINAPI acmDriverID(HACMOBJ hao, PHACMDRIVERID phadid, DWORD fdwDriverID)
-{
-    PWINE_ACMOBJ pao;
-    
-    pao = MSACM_GetObj(hao);
-    if (!pao)
-       return MMSYSERR_INVALHANDLE;
-    
-    if (!phadid)
-       return MMSYSERR_INVALPARAM;
-    
-    if (fdwDriverID)
-       return MMSYSERR_INVALFLAG;
-    
-    *phadid = (HACMDRIVERID) pao->pACMDriverID;
-    
-    return MMSYSERR_NOERROR;
-}
-
-/***********************************************************************
- *           acmDriverMessage (MSACM32.9)
- * FIXME
- *   Not implemented
- */
-LRESULT WINAPI acmDriverMessage(HACMDRIVER had, UINT uMsg, LPARAM lParam1, LPARAM lParam2)
-{
-    PWINE_ACMDRIVER pad = MSACM_GetDriver(had);
-    if (!pad)
-       return MMSYSERR_INVALPARAM;
-    
-    /* FIXME: Check if uMsg legal */
-    
-    if (!SendDriverMessage(pad->hDrvr, uMsg, lParam1, lParam2))
-       return MMSYSERR_NOTSUPPORTED;
-    
-    return MMSYSERR_NOERROR;
-}
-
-
-/***********************************************************************
- *           acmDriverOpen (MSACM32.10)
- */
-MMRESULT WINAPI acmDriverOpen(PHACMDRIVER phad, HACMDRIVERID hadid, DWORD fdwOpen)
-{
-    PWINE_ACMDRIVERID  padid;
-    PWINE_ACMDRIVER    pad;
-    ICOPEN             icopen;
-    HDRVR              hdrv;
-
-
-    TRACE("(%p, %x, %08lu)\n", phad, hadid, fdwOpen);
-
-    if (!phad)
-       return MMSYSERR_INVALPARAM;
-    
-    padid = MSACM_GetDriverID(hadid); 
-    if (!padid)
-       return MMSYSERR_INVALHANDLE;
-    
-    if (fdwOpen)
-       return MMSYSERR_INVALFLAG;
-    
-    pad = (PWINE_ACMDRIVER) HeapAlloc(MSACM_hHeap, 0, sizeof(WINE_ACMDRIVER));
-    if (!pad)
-       return MMSYSERR_NOMEM;
-
-    pad->obj.pACMDriverID = padid;
-    icopen.fccType             = mmioFOURCC('a', 'u', 'd', 'c');
-    icopen.fccHandler          = (long)padid->pszFileName;
-    icopen.dwSize              = sizeof(ICOPEN);
-    icopen.dwFlags             = 0;
-
-    icopen.pV1Reserved = padid->pszFileName;
-    if (!padid->hInstModule)
-       pad->hDrvr = OpenDriverA((long)&icopen);
-    else
-       pad->hDrvr = padid->hInstModule;
-    
-    if (!pad->hDrvr) {
-       HeapFree(MSACM_hHeap, 0, pad);
-       return MMSYSERR_ERROR;
-    }
-
-    pad->pfnDriverProc = GetProcAddress(pad->hDrvr, "DriverProc");
-
-    /* insert new pad at beg of list */
-    pad->pNextACMDriver = padid->pACMDriverList;
-    padid->pACMDriverList = pad;
-
-    /* FIXME: Create a WINE_ACMDRIVER32 */
-    *phad = (HACMDRIVER)pad;
-
-    return MMSYSERR_NOERROR;
-}
-
-/***********************************************************************
- *           acmDriverRemove (MSACM32.12)
- */
-MMRESULT WINAPI acmDriverRemove(HACMDRIVERID hadid, DWORD fdwRemove)
-{
-    PWINE_ACMDRIVERID padid;
-    
-    padid = MSACM_GetDriverID(hadid);
-    if (!padid)
-       return MMSYSERR_INVALHANDLE;
-    
-    if (fdwRemove)
-       return MMSYSERR_INVALFLAG;
-    
-    MSACM_UnregisterDriver(padid);
-    
-    return MMSYSERR_NOERROR;
-}
-
-
-
-/**********************************************************************/
-
-HANDLE MSACM_hHeap = (HANDLE) NULL;
-PWINE_ACMDRIVERID MSACM_pFirstACMDriverID = NULL;
-PWINE_ACMDRIVERID MSACM_pLastACMDriverID = NULL;
-
-/***********************************************************************
- *           MSACM_RegisterDriver32() 
- */
-PWINE_ACMDRIVERID MSACM_RegisterDriver(const char* pszFileName,
-                                      WORD wFormatTag,
-                                      HINSTANCE hinstModule)
-{
-    PWINE_ACMDRIVERID padid;
-
-    TRACE("('%s', '%x', 0x%08x)\n", pszFileName, wFormatTag, hinstModule);
-
-#ifndef WIN32_LOADER
-       MSACM_hHeap = GetProcessHeap();
-#endif
-    padid = (PWINE_ACMDRIVERID) HeapAlloc(MSACM_hHeap, 0, sizeof(WINE_ACMDRIVERID));
-    padid->pszFileName = (char*)malloc(strlen(pszFileName)+1);
-    strcpy(padid->pszFileName, pszFileName);
-//    1~strdup(pszDriverAlias);
-    padid->wFormatTag = wFormatTag;
-    padid->hInstModule = hinstModule;
-    padid->bEnabled = TRUE;
-    padid->pACMDriverList = NULL;
-    padid->pNextACMDriverID = NULL;
-    padid->pPrevACMDriverID = MSACM_pLastACMDriverID;
-    if (MSACM_pLastACMDriverID)
-       MSACM_pLastACMDriverID->pNextACMDriverID = padid;
-    MSACM_pLastACMDriverID = padid;
-    if (!MSACM_pFirstACMDriverID)
-       MSACM_pFirstACMDriverID = padid;
-    
-    return padid;
-}
-
-
-/***********************************************************************
- *           MSACM_UnregisterDriver32()
- */
-PWINE_ACMDRIVERID MSACM_UnregisterDriver(PWINE_ACMDRIVERID p)
-{
-    PWINE_ACMDRIVERID pNextACMDriverID;
-    
-    while (p->pACMDriverList)
-       acmDriverClose((HACMDRIVER) p->pACMDriverList, 0);
-    
-    free( p->pszFileName );
-    
-    if (p == MSACM_pFirstACMDriverID)
-       MSACM_pFirstACMDriverID = p->pNextACMDriverID;
-    if (p == MSACM_pLastACMDriverID)
-       MSACM_pLastACMDriverID = p->pPrevACMDriverID;
-
-    if (p->pPrevACMDriverID)
-       p->pPrevACMDriverID->pNextACMDriverID = p->pNextACMDriverID;
-    if (p->pNextACMDriverID)
-       p->pNextACMDriverID->pPrevACMDriverID = p->pPrevACMDriverID;
-    
-    pNextACMDriverID = p->pNextACMDriverID;
-    
-    HeapFree(MSACM_hHeap, 0, p);
-    
-    return pNextACMDriverID;
-}
-
-/***********************************************************************
- *           MSACM_UnregisterAllDrivers32()
- * FIXME
- *   Where should this function be called?
- */
-void MSACM_UnregisterAllDrivers(void)
-{
-    PWINE_ACMDRIVERID p;
-
-    for (p = MSACM_pFirstACMDriverID; p; p = MSACM_UnregisterDriver(p));
-}
-
-/***********************************************************************
- *           MSACM_GetDriverID32() 
- */
-PWINE_ACMDRIVERID MSACM_GetDriverID(HACMDRIVERID hDriverID)
-{
-    return (PWINE_ACMDRIVERID)hDriverID;
-}
-
-/***********************************************************************
- *           MSACM_GetDriver32()
- */
-PWINE_ACMDRIVER MSACM_GetDriver(HACMDRIVER hDriver)
-{
-    return (PWINE_ACMDRIVER)hDriver;
-}
-
-/***********************************************************************
- *           MSACM_GetObj32()
- */
-PWINE_ACMOBJ MSACM_GetObj(HACMOBJ hObj)
-{
-    return (PWINE_ACMOBJ)hObj;
-}
-
-
-
-/***********************************************************************
- *           acmStreamOpen (MSACM32.40)
- */
-MMRESULT WINAPI acmStreamOpen(PHACMSTREAM phas, HACMDRIVER had, PWAVEFORMATEX pwfxSrc,
-                             PWAVEFORMATEX pwfxDst, PWAVEFILTER pwfltr, DWORD dwCallback,
-                             DWORD dwInstance, DWORD fdwOpen)
-{
-    PWINE_ACMSTREAM    was;
-    PWINE_ACMDRIVER    wad;
-    MMRESULT           ret;
-    int                        wfxSrcSize;
-    int                        wfxDstSize;
-    
-    TRACE("(%p, 0x%08x, %p, %p, %p, %ld, %ld, %ld)\n",
-         phas, had, pwfxSrc, pwfxDst, pwfltr, dwCallback, dwInstance, fdwOpen);
-
-    TRACE("src [wFormatTag=%u, nChannels=%u, nSamplesPerSec=%lu, nAvgBytesPerSec=%lu, nBlockAlign=%u, wBitsPerSample=%u, cbSize=%u]\n", 
-         pwfxSrc->wFormatTag, pwfxSrc->nChannels, pwfxSrc->nSamplesPerSec, pwfxSrc->nAvgBytesPerSec, 
-         pwfxSrc->nBlockAlign, pwfxSrc->wBitsPerSample, pwfxSrc->cbSize);
-
-    TRACE("dst [wFormatTag=%u, nChannels=%u, nSamplesPerSec=%lu, nAvgBytesPerSec=%lu, nBlockAlign=%u, wBitsPerSample=%u, cbSize=%u]\n", 
-         pwfxDst->wFormatTag, pwfxDst->nChannels, pwfxDst->nSamplesPerSec, pwfxDst->nAvgBytesPerSec, 
-         pwfxDst->nBlockAlign, pwfxDst->wBitsPerSample, pwfxDst->cbSize);
-
-#define SIZEOF_WFX(wfx) (sizeof(WAVEFORMATEX) + ((wfx->wFormatTag == WAVE_FORMAT_PCM) ? 0 : wfx->cbSize))
-    wfxSrcSize = SIZEOF_WFX(pwfxSrc);
-    wfxDstSize = SIZEOF_WFX(pwfxDst);
-#undef SIZEOF_WFX
-
-    was = (PWINE_ACMSTREAM) HeapAlloc(MSACM_hHeap, 0, sizeof(*was) + wfxSrcSize + wfxDstSize + ((pwfltr) ? sizeof(WAVEFILTER) : 0));
-    if (was == NULL)
-       return MMSYSERR_NOMEM;
-    was->drvInst.cbStruct = sizeof(was->drvInst);
-    was->drvInst.pwfxSrc = (PWAVEFORMATEX)((LPSTR)was + sizeof(*was));
-    memcpy(was->drvInst.pwfxSrc, pwfxSrc, wfxSrcSize);
-    // LHACM is checking for 0x1
-    // but if this will not help
-    // was->drvInst.pwfxSrc->wFormatTag = 1;
-    was->drvInst.pwfxDst = (PWAVEFORMATEX)((LPSTR)was + sizeof(*was) + wfxSrcSize);
-    memcpy(was->drvInst.pwfxDst, pwfxDst, wfxDstSize);
-    if (pwfltr) {
-       was->drvInst.pwfltr = (PWAVEFILTER)((LPSTR)was + sizeof(*was) + wfxSrcSize + wfxDstSize);
-       memcpy(was->drvInst.pwfltr, pwfltr, sizeof(WAVEFILTER));
-    } else {
-       was->drvInst.pwfltr = NULL;
-    }
-    was->drvInst.dwCallback = dwCallback;    
-    was->drvInst.dwInstance = dwInstance;
-    was->drvInst.fdwOpen = fdwOpen;
-    was->drvInst.fdwDriver = 0L;  
-    was->drvInst.dwDriver = 0L;     
-    was->drvInst.has = (HACMSTREAM)was;
-    
-    if (had) {
-       if (!(wad = MSACM_GetDriver(had))) {
-           ret = MMSYSERR_INVALPARAM;
-           goto errCleanUp;
-       }
-       
-       was->obj.pACMDriverID = wad->obj.pACMDriverID;
-       was->pDrv = wad;
-       was->hAcmDriver = 0; /* not to close it in acmStreamClose */
-
-       ret = SendDriverMessage(wad->hDrvr, ACMDM_STREAM_OPEN, (DWORD)&was->drvInst, 0L);
-       if (ret != MMSYSERR_NOERROR)
-           goto errCleanUp;
-    } else {
-       PWINE_ACMDRIVERID wadi;
-       short drv_tag;
-       ret = ACMERR_NOTPOSSIBLE;
-/*     if(pwfxSrc->wFormatTag==1)//compression
-           drv_tag=pwfxDst->wFormatTag;
-           else
-           if(pwfxDst->wFormatTag==1)//decompression
-               drv_tag=pwfxSrc->wFormatTag;
-               else
-               goto errCleanUp;
-
-           ret=acmDriverOpen2(drv_tag); 
-           if (ret == MMSYSERR_NOERROR) {
-               if ((wad = MSACM_GetDriver(had)) != 0) {
-                   was->obj.pACMDriverID = wad->obj.pACMDriverID;
-                   was->pDrv = wad;
-                   was->hAcmDriver = had;
-                   
-                   ret = SendDriverMessage(wad->hDrvr, ACMDM_STREAM_OPEN, (DWORD)&was->drvInst, 0L);
-                   if (ret == MMSYSERR_NOERROR) {
-                       if (fdwOpen & ACM_STREAMOPENF_QUERY) {
-                           acmDriverClose(had, 0L);
-                       }
-                       break;
-                   }
-               }
-               acmDriverClose(had, 0L);*/
-       //if(MSACM_pFirstACMDriverID==NULL)
-       //    MSACM_RegisterAllDrivers();
-       
-       for (wadi = MSACM_pFirstACMDriverID; wadi; wadi = wadi->pNextACMDriverID)
-       {
-           /* Check Format */
-           if ((int)wadi->wFormatTag != (int)pwfxSrc->wFormatTag) continue;
-
-           ret = acmDriverOpen(&had, (HACMDRIVERID)wadi, 0L);
-           if (ret == MMSYSERR_NOERROR) {
-               if ((wad = MSACM_GetDriver(had)) != NULL) {
-                   was->obj.pACMDriverID = wad->obj.pACMDriverID;
-                   was->pDrv = wad;
-                   was->hAcmDriver = had;
-                   
-                   ret = SendDriverMessage(wad->hDrvr, ACMDM_STREAM_OPEN, (DWORD)&was->drvInst, 0L);
-                   //lhacm - crash printf("RETOPEN %d\n", ret);
-                    //ret = 0;
-                   if (ret == MMSYSERR_NOERROR) {
-                       if (fdwOpen & ACM_STREAMOPENF_QUERY) {
-                           acmDriverClose(had, 0L);
-                       }
-                       break;
-                   }
-               }
-               // no match, close this acm driver and try next one 
-               acmDriverClose(had, 0L);
-           }
-       }
-       if (ret != MMSYSERR_NOERROR) {
-           ret = ACMERR_NOTPOSSIBLE;
-           goto errCleanUp;
-       }
-    }
-    ret = MMSYSERR_NOERROR;
-    if (!(fdwOpen & ACM_STREAMOPENF_QUERY)) {
-       if (phas)
-           *phas = (HACMSTREAM)was;
-       TRACE("=> (%d)\n", ret);
-#ifdef WIN32_LOADER
-        CodecAlloc();
-#endif
-       return ret;
-    }
-errCleanUp:            
-    if (phas)
-       *phas = (HACMSTREAM)0;
-    HeapFree(MSACM_hHeap, 0, was);
-    TRACE("=> (%d)\n", ret);
-    return ret;
-}
-
-
-MMRESULT WINAPI acmStreamClose(HACMSTREAM has, DWORD fdwClose)
-{
-    PWINE_ACMSTREAM    was;
-    MMRESULT           ret;
-               
-    TRACE("(0x%08x, %ld)\n", has, fdwClose);
-    
-    if ((was = ACM_GetStream(has)) == NULL) {
-       return MMSYSERR_INVALHANDLE;
-    }
-    ret = SendDriverMessage(was->pDrv->hDrvr, ACMDM_STREAM_CLOSE, (DWORD)&was->drvInst, 0);
-    if (ret == MMSYSERR_NOERROR) {
-       if (was->hAcmDriver)
-           acmDriverClose(was->hAcmDriver, 0L);        
-       HeapFree(MSACM_hHeap, 0, was);
-#ifdef WIN32_LOADER
-        CodecRelease();
-#endif
-    }
-    TRACE("=> (%d)\n", ret);
-    return ret;
-}
-
-/***********************************************************************
- *           acmStreamConvert (MSACM32.38)
- */
-MMRESULT WINAPI acmStreamConvert(HACMSTREAM has, PACMSTREAMHEADER pash, 
-                                DWORD fdwConvert)
-{
-    PWINE_ACMSTREAM    was;
-    MMRESULT           ret = MMSYSERR_NOERROR;
-    PACMDRVSTREAMHEADER        padsh;
-
-    TRACE("(0x%08x, %p, %ld)\n", has, pash, fdwConvert);
-
-    if ((was = ACM_GetStream(has)) == NULL)
-       return MMSYSERR_INVALHANDLE;
-    if (!pash || pash->cbStruct < sizeof(ACMSTREAMHEADER))
-       return MMSYSERR_INVALPARAM;
-
-    if (!(pash->fdwStatus & ACMSTREAMHEADER_STATUSF_PREPARED))
-       return ACMERR_UNPREPARED;
-
-    /* Note: the ACMSTREAMHEADER and ACMDRVSTREAMHEADER structs are of same
-     * size. some fields are private to msacm internals, and are exposed
-     * in ACMSTREAMHEADER in the dwReservedDriver array
-     */
-    padsh = (PACMDRVSTREAMHEADER)pash;
-
-    /* check that pointers have not been modified */
-    if (padsh->pbPreparedSrc != padsh->pbSrc ||
-       padsh->cbPreparedSrcLength < padsh->cbSrcLength ||
-       padsh->pbPreparedDst != padsh->pbDst ||
-       padsh->cbPreparedDstLength < padsh->cbDstLength) {
-       return MMSYSERR_INVALPARAM;
-    }  
-
-    padsh->fdwConvert = fdwConvert;
-
-    ret = SendDriverMessage(was->pDrv->hDrvr, ACMDM_STREAM_CONVERT, (DWORD)&was->drvInst, (DWORD)padsh);
-    if (ret == MMSYSERR_NOERROR) {
-       padsh->fdwStatus |= ACMSTREAMHEADER_STATUSF_DONE;
-    }
-    TRACE("=> (%d)\n", ret);
-    return ret;
-}
-
-
-/***********************************************************************
- *           acmStreamPrepareHeader (MSACM32.41)
- */
-MMRESULT WINAPI acmStreamPrepareHeader(HACMSTREAM has, PACMSTREAMHEADER pash, 
-                                      DWORD fdwPrepare)
-{
-    PWINE_ACMSTREAM    was;
-    MMRESULT           ret = MMSYSERR_NOERROR;
-    PACMDRVSTREAMHEADER        padsh;
-
-    TRACE("(0x%08x, %p, %ld)\n", has, pash, fdwPrepare);
-    
-    if ((was = ACM_GetStream(has)) == NULL)
-       return MMSYSERR_INVALHANDLE;
-    if (!pash || pash->cbStruct < sizeof(ACMSTREAMHEADER))
-       return MMSYSERR_INVALPARAM;
-    if (fdwPrepare)
-       ret = MMSYSERR_INVALFLAG;
-
-    if (pash->fdwStatus & ACMSTREAMHEADER_STATUSF_DONE)
-       return MMSYSERR_NOERROR;
-
-    /* Note: the ACMSTREAMHEADER and ACMDRVSTREAMHEADER structs are of same
-     * size. some fields are private to msacm internals, and are exposed
-     * in ACMSTREAMHEADER in the dwReservedDriver array
-     */
-    padsh = (PACMDRVSTREAMHEADER)pash;
-
-    padsh->fdwConvert = fdwPrepare;
-    padsh->padshNext = NULL;
-    padsh->fdwDriver = padsh->dwDriver = 0L;
-
-    padsh->fdwPrepared = 0;
-    padsh->dwPrepared = 0;
-    padsh->pbPreparedSrc = 0;
-    padsh->cbPreparedSrcLength = 0;
-    padsh->pbPreparedDst = 0;
-    padsh->cbPreparedDstLength = 0;
-
-    ret = SendDriverMessage(was->pDrv->hDrvr, ACMDM_STREAM_PREPARE, (DWORD)&was->drvInst, (DWORD)padsh);
-    if (ret == MMSYSERR_NOERROR || ret == MMSYSERR_NOTSUPPORTED) {
-       ret = MMSYSERR_NOERROR;
-       padsh->fdwStatus &= ~(ACMSTREAMHEADER_STATUSF_DONE|ACMSTREAMHEADER_STATUSF_INQUEUE);
-       padsh->fdwStatus |= ACMSTREAMHEADER_STATUSF_PREPARED;
-       padsh->fdwPrepared = padsh->fdwStatus;
-       padsh->dwPrepared = 0;
-       padsh->pbPreparedSrc = padsh->pbSrc;
-       padsh->cbPreparedSrcLength = padsh->cbSrcLength;
-       padsh->pbPreparedDst = padsh->pbDst;
-       padsh->cbPreparedDstLength = padsh->cbDstLength;
-    } else {
-       padsh->fdwPrepared = 0;
-       padsh->dwPrepared = 0;
-       padsh->pbPreparedSrc = 0;
-       padsh->cbPreparedSrcLength = 0;
-       padsh->pbPreparedDst = 0;
-       padsh->cbPreparedDstLength = 0;
-    }
-    TRACE("=> (%d)\n", ret);
-    return ret;
-}
-
-/***********************************************************************
- *           acmStreamReset (MSACM32.42)
- */
-MMRESULT WINAPI acmStreamReset(HACMSTREAM has, DWORD fdwReset)
-{
-    PWINE_ACMSTREAM    was;
-    MMRESULT           ret = MMSYSERR_NOERROR;
-
-    TRACE("(0x%08x, %ld)\n", has, fdwReset);
-
-    if (fdwReset) {
-       ret = MMSYSERR_INVALFLAG;
-    } else if ((was = ACM_GetStream(has)) == NULL) {
-       return MMSYSERR_INVALHANDLE;
-    } else if (was->drvInst.fdwOpen & ACM_STREAMOPENF_ASYNC) {
-       ret = SendDriverMessage(was->pDrv->hDrvr, ACMDM_STREAM_RESET, (DWORD)&was->drvInst, 0);
-    }
-    TRACE("=> (%d)\n", ret);
-    return ret;
-}
-
-/***********************************************************************
- *           acmStreamSize (MSACM32.43)
- */
-MMRESULT WINAPI acmStreamSize(HACMSTREAM has, DWORD cbInput, 
-                             LPDWORD pdwOutputBytes, DWORD fdwSize)
-{
-    PWINE_ACMSTREAM    was;
-    ACMDRVSTREAMSIZE   adss;
-    MMRESULT           ret;
-    
-    TRACE("(0x%08x, %ld, %p, %ld)\n", has, cbInput, pdwOutputBytes, fdwSize);
-    
-    if ((was = ACM_GetStream(has)) == NULL) {
-       return MMSYSERR_INVALHANDLE;
-    }
-    if ((fdwSize & ~ACM_STREAMSIZEF_QUERYMASK) != 0) {
-       return MMSYSERR_INVALFLAG;
-    }
-
-    *pdwOutputBytes = 0L;
-    
-    switch (fdwSize & ACM_STREAMSIZEF_QUERYMASK) {
-    case ACM_STREAMSIZEF_DESTINATION:
-       adss.cbDstLength = cbInput;
-       adss.cbSrcLength = 0;
-       break;
-    case ACM_STREAMSIZEF_SOURCE:
-       adss.cbSrcLength = cbInput;
-       adss.cbDstLength = 0;
-       break;
-    default:   
-       return MMSYSERR_INVALFLAG;
-    }
-    
-    adss.cbStruct = sizeof(adss);
-    adss.fdwSize = fdwSize;
-    ret = SendDriverMessage(was->pDrv->hDrvr, ACMDM_STREAM_SIZE, 
-                           (DWORD)&was->drvInst, (DWORD)&adss);
-    if (ret == MMSYSERR_NOERROR) {
-       switch (fdwSize & ACM_STREAMSIZEF_QUERYMASK) {
-       case ACM_STREAMSIZEF_DESTINATION:
-           *pdwOutputBytes = adss.cbSrcLength;
-           break;
-       case ACM_STREAMSIZEF_SOURCE:
-           *pdwOutputBytes = adss.cbDstLength;
-           break;
-       }
-    }
-    TRACE("=> (%d) [%lu]\n", ret, *pdwOutputBytes);
-    return ret;
-}
-
-/***********************************************************************
- *           acmStreamUnprepareHeader (MSACM32.44)
- */
-MMRESULT WINAPI acmStreamUnprepareHeader(HACMSTREAM has, PACMSTREAMHEADER pash, 
-                                        DWORD fdwUnprepare)
-{
-    PWINE_ACMSTREAM    was;
-    MMRESULT           ret = MMSYSERR_NOERROR;
-    PACMDRVSTREAMHEADER        padsh;
-
-    TRACE("(0x%08x, %p, %ld)\n", has, pash, fdwUnprepare);
-    
-    if ((was = ACM_GetStream(has)) == NULL)
-       return MMSYSERR_INVALHANDLE;
-    if (!pash || pash->cbStruct < sizeof(ACMSTREAMHEADER))
-       return MMSYSERR_INVALPARAM;
-
-    if (!(pash->fdwStatus & ACMSTREAMHEADER_STATUSF_PREPARED))
-       return ACMERR_UNPREPARED;
-
-    /* Note: the ACMSTREAMHEADER and ACMDRVSTREAMHEADER structs are of same
-     * size. some fields are private to msacm internals, and are exposed
-     * in ACMSTREAMHEADER in the dwReservedDriver array
-     */
-    padsh = (PACMDRVSTREAMHEADER)pash;
-
-    /* check that pointers have not been modified */
-    if (padsh->pbPreparedSrc != padsh->pbSrc ||
-       padsh->cbPreparedSrcLength < padsh->cbSrcLength ||
-       padsh->pbPreparedDst != padsh->pbDst ||
-       padsh->cbPreparedDstLength < padsh->cbDstLength) {
-       return MMSYSERR_INVALPARAM;
-    }  
-
-    padsh->fdwConvert = fdwUnprepare;
-
-    ret = SendDriverMessage(was->pDrv->hDrvr, ACMDM_STREAM_UNPREPARE, (DWORD)&was->drvInst, (DWORD)padsh);
-    if (ret == MMSYSERR_NOERROR || ret == MMSYSERR_NOTSUPPORTED) {
-       ret = MMSYSERR_NOERROR;
-       padsh->fdwStatus &= ~(ACMSTREAMHEADER_STATUSF_DONE|ACMSTREAMHEADER_STATUSF_INQUEUE|ACMSTREAMHEADER_STATUSF_PREPARED);
-    }
-    TRACE("=> (%d)\n", ret);
-    return ret;
-}
diff --git a/modules/codec/loader/com.h b/modules/codec/loader/com.h
deleted file mode 100644 (file)
index a647235..0000000
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * Modified for use with MPlayer, detailed CVS changelog at
- * http://www.mplayerhq.hu/cgi-bin/cvsweb.cgi/main/
- * $Id$
- */
-
-#ifndef AVIFILE_COM_H
-#define AVIFILE_COM_H
-
-#include "config.h"
-
-#ifdef HAVE_STDINT_H
-#include <stdint.h>
-#else
-#include <inttypes.h>
-#endif
-
-/**
- * Internal functions and structures for COM emulation code.
- */
-
-#if !defined(WIN32) || defined(__CYGWIN__) || defined(__MINGW32__)
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void* CoTaskMemAlloc(unsigned long cb);
-void CoTaskMemFree(void* cb);
-
-#ifndef GUID_TYPE
-#define GUID_TYPE
-typedef struct
-{
-    uint32_t f1;
-    uint16_t f2;
-    uint16_t f3;
-    uint8_t  f4[8];
-} GUID;
-#endif
-
-extern const GUID IID_IUnknown;
-extern const GUID IID_IClassFactory;
-
-typedef long (*GETCLASSOBJECT) (GUID* clsid, const GUID* iid, void** ppv);
-int RegisterComClass(const GUID* clsid, GETCLASSOBJECT gcs);
-int UnregisterComClass(const GUID* clsid, GETCLASSOBJECT gcs);
-
-#ifndef STDCALL
-#define STDCALL __attribute__((__stdcall__))
-#endif
-
-struct IUnknown;
-struct IClassFactory;
-struct IUnknown_vt
-{
-    long STDCALL (*QueryInterface)(struct IUnknown* _this, const GUID* iid, void** ppv);
-    long STDCALL (*AddRef)(struct IUnknown* _this) ;
-    long STDCALL (*Release)(struct IUnknown* _this) ;
-} ;
-
-typedef struct IUnknown
-{
-    struct IUnknown_vt* vt;
-} IUnknown;
-
-struct IClassFactory_vt
-{
-    long STDCALL (*QueryInterface)(struct IUnknown* _this, const GUID* iid, void** ppv);
-    long STDCALL (*AddRef)(struct IUnknown* _this) ;
-    long STDCALL (*Release)(struct IUnknown* _this) ;
-    long STDCALL (*CreateInstance)(struct IClassFactory* _this, struct IUnknown* pUnkOuter, const GUID* riid, void** ppvObject);
-};
-
-struct IClassFactory
-{
-    struct IClassFactory_vt* vt;
-};
-
-long CoCreateInstance(GUID* rclsid, struct IUnknown* pUnkOuter,
-                     long dwClsContext, const GUID* riid, void** ppv);
-
-#ifdef __cplusplus
-};
-#endif /* __cplusplus */
-
-#endif /* WIN32 */
-
-#endif /* AVIFILE_COM_H */
diff --git a/modules/codec/loader/driver.c b/modules/codec/loader/driver.c
deleted file mode 100644 (file)
index dde6a1d..0000000
+++ /dev/null
@@ -1,225 +0,0 @@
-/*
- * $Id$
- *
- * Copyright 1993, 1994 Martin Ayotte
- * Copyright 1998 Marcus Meissner
- * Copyright 1999 Eric Pouech
- *
- * Originally distributed under LPGL 2.1 (or later) by the Wine project.
- *
- * Modified for use with MPlayer, detailed CVS changelog at
- * http://www.mplayerhq.hu/cgi-bin/cvsweb.cgi/main/
- *
- * File now distributed as part of VLC media player with no modifications.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
- */
-
-#include "config.h"
-
-#include <stdio.h>
-#ifdef HAVE_MALLOC_H
-#include <malloc.h>
-#endif
-#include <stdlib.h>
-#ifdef __FreeBSD__
-#include <sys/time.h>
-#endif
-
-#include "win32.h"
-#include "wine/driver.h"
-#include "wine/pe_image.h"
-#include "wine/winreg.h"
-#include "wine/vfw.h"
-#include "registry.h"
-#ifdef WIN32_LOADER
-#include "ldt_keeper.h"
-#endif
-#include "driver.h"
-#ifndef __MINGW32__
-#include "ext.h"
-#endif
-
-#ifndef WIN32_LOADER
-char* def_path=WIN32_PATH;
-#else
-extern char* def_path;
-#endif
-
-#if 1
-
-/*
- * STORE_ALL/REST_ALL seems like an attempt to workaround problems due to
- * WINAPI/no-WINAPI bustage.
- *
- * There should be no need for the STORE_ALL/REST_ALL hack once all
- * function definitions agree with their prototypes (WINAPI-wise) and
- * we make sure, that we do not call these functions without a proper
- * prototype in scope.
- */
-
-#define STORE_ALL
-#define REST_ALL
-#else
-// this asm code is no longer needed
-#define STORE_ALL \
-    __asm__ __volatile__ ( \
-    "push %%ebx\n\t" \
-    "push %%ecx\n\t" \
-    "push %%edx\n\t" \
-    "push %%esi\n\t" \
-    "push %%edi\n\t"::)
-
-#define REST_ALL \
-    __asm__ __volatile__ ( \
-    "pop %%edi\n\t" \
-    "pop %%esi\n\t" \
-    "pop %%edx\n\t" \
-    "pop %%ecx\n\t" \
-    "pop %%ebx\n\t"::)
-#endif
-
-static int needs_free=0;
-void SetCodecPath(const char* path)
-{
-    if(needs_free)free(def_path);
-    if(path==NULL)
-    {
-       def_path=WIN32_PATH;
-       needs_free=0;
-       return;
-    }
-    def_path = (char*) malloc(strlen(path)+1);
-    strcpy(def_path, path);
-    needs_free=1;
-}
-
-static DWORD dwDrvID = 0;
-
-LRESULT WINAPI SendDriverMessage(HDRVR hDriver, UINT message,
-                                LPARAM lParam1, LPARAM lParam2)
-{
-    DRVR* module=(DRVR*)hDriver;
-    int result;
-#ifndef __svr4__
-    char qw[300];
-#endif
-#ifdef DETAILED_OUT
-    printf("SendDriverMessage: driver %X, message %X, arg1 %X, arg2 %X\n", hDriver, message, lParam1, lParam2);
-#endif
-    if (!module || !module->hDriverModule || !module->DriverProc) return -1;
-#ifndef __svr4__
-    __asm__ __volatile__ ("fsave (%0)\n\t": :"r"(&qw));
-#endif
-
-#ifdef WIN32_LOADER
-    Setup_FS_Segment();
-#endif
-
-    STORE_ALL;
-    result=module->DriverProc(module->dwDriverID, hDriver, message, lParam1, lParam2);
-    REST_ALL;
-
-#ifndef __svr4__
-    __asm__ __volatile__ ("frstor (%0)\n\t": :"r"(&qw));
-#endif
-
-#ifdef DETAILED_OUT
-    printf("\t\tResult: %X\n", result);
-#endif
-    return result;
-}
-
-void DrvClose(HDRVR hDriver)
-{
-    if (hDriver)
-    {
-       DRVR* d = (DRVR*)hDriver;
-       if (d->hDriverModule)
-       {
-#ifdef WIN32_LOADER
-           Setup_FS_Segment();
-#endif
-           if (d->DriverProc)
-           {
-               SendDriverMessage(hDriver, DRV_CLOSE, 0, 0);
-               d->dwDriverID = 0;
-               SendDriverMessage(hDriver, DRV_FREE, 0, 0);
-           }
-           FreeLibrary(d->hDriverModule);
-       }
-       free(d);
-    }
-#ifdef WIN32_LOADER
-    CodecRelease();
-#endif
-}
-
-//DrvOpen(LPCSTR lpszDriverName, LPCSTR lpszSectionName, LPARAM lParam2)
-HDRVR DrvOpen(LPARAM lParam2)
-{
-    NPDRVR hDriver;
-    int i;
-    char unknown[0x124];
-    const char* filename = (const char*) ((ICOPEN*) lParam2)->pV1Reserved;
-
-#ifdef MPLAYER
-#ifdef WIN32_LOADER
-    Setup_LDT_Keeper();
-#endif
-    printf("Loading codec DLL: '%s'\n",filename);
-#endif
-
-    hDriver = (NPDRVR) malloc(sizeof(DRVR));
-    if (!hDriver)
-       return ((HDRVR) 0);
-    memset((void*)hDriver, 0, sizeof(DRVR));
-
-#ifdef WIN32_LOADER
-    CodecAlloc();
-    Setup_FS_Segment();
-#endif
-
-    hDriver->hDriverModule = LoadLibraryA(filename);
-    if (!hDriver->hDriverModule)
-    {
-       printf("Can't open library %s\n", filename);
-       DrvClose((HDRVR)hDriver);
-       return ((HDRVR) 0);
-    }
-
-    hDriver->DriverProc = (DRIVERPROC) GetProcAddress(hDriver->hDriverModule,
-                                                     "DriverProc");
-    if (!hDriver->DriverProc)
-    {
-       printf("Library %s is not a valid VfW/ACM codec\n", filename);
-       DrvClose((HDRVR)hDriver);
-       return ((HDRVR) 0);
-    }
-
-    TRACE("DriverProc == %X\n", hDriver->DriverProc);
-    SendDriverMessage((HDRVR)hDriver, DRV_LOAD, 0, 0);
-    TRACE("DRV_LOAD Ok!\n");
-    SendDriverMessage((HDRVR)hDriver, DRV_ENABLE, 0, 0);
-    TRACE("DRV_ENABLE Ok!\n");
-    hDriver->dwDriverID = ++dwDrvID; // generate new id
-
-    // open driver and remmeber proper DriverID
-    hDriver->dwDriverID = SendDriverMessage((HDRVR)hDriver, DRV_OPEN, (LPARAM) unknown, lParam2);
-    TRACE("DRV_OPEN Ok!(%X)\n", hDriver->dwDriverID);
-
-    printf("Loaded DLL driver %s at %x\n", filename, hDriver->hDriverModule);
-    return (HDRVR)hDriver;
-}
diff --git a/modules/codec/loader/driver.h b/modules/codec/loader/driver.h
deleted file mode 100644 (file)
index f7e369d..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Modified for use with MPlayer, detailed CVS changelog at
- * http://www.mplayerhq.hu/cgi-bin/cvsweb.cgi/main/
- * $Id$
- */
-
-#ifndef loader_driver_h
-#define        loader_driver_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include "wine/windef.h"
-#include "wine/driver.h"
-
-void SetCodecPath(const char* path);
-void CodecAlloc(void);
-void CodecRelease(void);
-
-HDRVR DrvOpen(LPARAM lParam2);
-void DrvClose(HDRVR hdrvr);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/modules/codec/loader/ext.c b/modules/codec/loader/ext.c
deleted file mode 100644 (file)
index 3d6b9a7..0000000
+++ /dev/null
@@ -1,645 +0,0 @@
-/********************************************************
- *
- *
- *      Stub functions for Wine module
- *
- *
- ********************************************************/
-
-/*
- * Modified for use with MPlayer, detailed CVS changelog at
- * http://www.mplayerhq.hu/cgi-bin/cvsweb.cgi/main/
- * $Id$
- */
-
-#include "config.h"
-#include <stdio.h>
-#include <stdlib.h>
-#ifdef HAVE_MALLOC_H
-#include <malloc.h>
-#endif
-#include <unistd.h>
-#include <sys/mman.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <string.h>
-#include <stdarg.h>
-#include <ctype.h>
-
-#include "wine/windef.h"
-#include "wine/winbase.h"
-#include "wine/debugtools.h"
-#include "wine/heap.h"
-#include "ext.h"
-
-#if 0
-//REMOVE SIMPLIFY
-static void* mymalloc(unsigned int size)
-{
-    printf("malloc %d\n", size);
-    return malloc(size);
-}
-
-#undef malloc
-#define malloc mymalloc
-#endif
-
-int dbg_header_err( const char *dbg_channel, const char *func )
-{
-    return 0;
-}
-int dbg_header_warn( const char *dbg_channel, const char *func )
-{
-    return 0;
-}
-int dbg_header_fixme( const char *dbg_channel, const char *func )
-{
-    return 0;
-}
-int dbg_header_trace( const char *dbg_channel, const char *func )
-{
-    return 0;
-}
-int dbg_vprintf( const char *format, va_list args )
-{
-    return 0;
-}
-int __vprintf( const char *format, ... )
-{
-#ifdef DETAILED_OUT
-    va_list va;
-    va_start(va, format);
-    vprintf(format, va);
-    va_end(va);
-#endif
-    return 0;
-}
-
-HANDLE WINAPI GetProcessHeap(void)
-{
-    return 1;
-}
-
-LPVOID WINAPI HeapAlloc(HANDLE heap, DWORD flags, DWORD size)
-{
-    static int i = 5;
-    void* m = (flags & 0x8) ? calloc(size, 1) : malloc(size);
-    //printf("HeapAlloc %p  %d  (%d)\n", m, size, flags);
-    //if (--i == 0)
-    //    abort();
-    return m;
-}
-
-WIN_BOOL WINAPI HeapFree(HANDLE heap, DWORD flags, LPVOID mem)
-{
-    free( mem );
-    //printf("HeapFree  %p\n", mem);
-    //if (!mem)
-    //    abort();
-    return 1;
-}
-
-static int last_error;
-
-DWORD WINAPI GetLastError(void)
-{
-    return last_error;
-}
-
-VOID WINAPI SetLastError(DWORD error)
-{
-    last_error=error;
-}
-
-WIN_BOOL WINAPI ReadFile(HANDLE handle, LPVOID mem, DWORD size, LPDWORD result, LPOVERLAPPED flags)
-{
-    *result=read(handle, mem, size);
-    return *result;
-}
-INT WINAPI lstrcmpiA(LPCSTR c1, LPCSTR c2)
-{
-    return strcasecmp(c1,c2);
-}
-LPSTR WINAPI lstrcpynA(LPSTR dest, LPCSTR src, INT num)
-{
-    return strncpy(dest,src,num);
-}
-INT WINAPI lstrlenA(LPCSTR s)
-{
-    return strlen(s);
-}
-INT WINAPI lstrlenW(LPCWSTR s)
-{
-    int l;
-    if(!s)
-       return 0;
-    l=0;
-    while(s[l])
-       l++;
-     return l;
-}
-LPSTR WINAPI lstrcpynWtoA(LPSTR dest, LPCWSTR src, INT count)
-{
-    LPSTR result = dest;
-    int moved=0;
-    if((dest==NULL) || (src==NULL))
-       return 0;
-    while(moved<count)
-    {
-        *dest=*src;
-       moved++;
-       if(*src==0)
-           break;
-       src++;
-       dest++;
-    }
-    return result;
-}
-/* i stands here for ignore case! */
-int wcsnicmp(const unsigned short* s1, const unsigned short* s2, int n)
-{
-    /*
-    if(s1==0)
-       return;
-    if(s2==0)
-        return;
-    */
-    while(n>0)
-    {
-       if (((*s1 | *s2) & 0xff00) || toupper((char)*s1) != toupper((char)*s2))
-       {
-
-           if(*s1<*s2)
-               return -1;
-           else
-               if(*s1>*s2)
-                   return 1;
-               else
-                   if(*s1==0)
-                       return 0;
-       }
-       s1++;
-       s2++;
-       n--;
-    }
-    return 0;
-}
-
-WIN_BOOL WINAPI IsBadReadPtr(LPCVOID data, UINT size)
-{
-    if(size==0)
-       return 0;
-    if(data==NULL)
-        return 1;
-    return 0;
-}
-LPSTR HEAP_strdupA(HANDLE heap, DWORD flags, LPCSTR string)
-{
-//    return strdup(string);
-    char* answ = (char*) malloc(strlen(string) + 1);
-    strcpy(answ, string);
-    return answ;
-}
-LPWSTR HEAP_strdupAtoW(HANDLE heap, DWORD flags, LPCSTR string)
-{
-    int size, i;
-    WCHAR* answer;
-    if(string==NULL)
-       return 0;
-    size=strlen(string);
-    answer = (WCHAR*) malloc(sizeof(WCHAR) * (size + 1));
-    for(i=0; i<=size; i++)
-       answer[i]=(short)string[i];
-    return answer;
-}
-LPSTR HEAP_strdupWtoA(HANDLE heap, DWORD flags, LPCWSTR string)
-{
-    int size, i;
-    char* answer;
-    if(string==NULL)
-       return 0;
-    size=0;
-    while(string[size])
-       size++;
-    answer = (char*) malloc(size + 2);
-    for(i=0; i<=size; i++)
-       answer[i]=(char)string[i];
-    return answer;
-}
-
-/***********************************************************************
- *           FILE_dommap
- */
-
-//#define MAP_PRIVATE
-//#define MAP_SHARED
-#undef MAP_ANON
-LPVOID FILE_dommap( int unix_handle, LPVOID start,
-                    DWORD size_high, DWORD size_low,
-                    DWORD offset_high, DWORD offset_low,
-                    int prot, int flags )
-{
-    int fd = -1;
-    int pos;
-    LPVOID ret;
-
-    if (size_high || offset_high)
-        printf("offsets larger than 4Gb not supported\n");
-
-    if (unix_handle == -1)
-    {
-#ifdef MAP_ANON
-//     printf("Anonymous\n");
-        flags |= MAP_ANON;
-#else
-        static int fdzero = -1;
-
-        if (fdzero == -1)
-        {
-            if ((fdzero = open( "/dev/zero", O_RDONLY )) == -1)
-            {
-               perror( "Cannot open /dev/zero for READ. Check permissions! error: " );
-                exit(1);
-            }
-        }
-        fd = fdzero;
-#endif  /* MAP_ANON */
-       /* Linux EINVAL's on us if we don't pass MAP_PRIVATE to an anon mmap */
-#ifdef MAP_SHARED
-       flags &= ~MAP_SHARED;
-#endif
-#ifdef MAP_PRIVATE
-       flags |= MAP_PRIVATE;
-#endif
-    }
-    else fd = unix_handle;
-//    printf("fd %x, start %x, size %x, pos %x, prot %x\n",fd,start,size_low, offset_low, prot);
-//    if ((ret = mmap( start, size_low, prot,
-//                     flags, fd, offset_low )) != (LPVOID)-1)
-    if ((ret = mmap( start, size_low, prot,
-                     MAP_PRIVATE | MAP_FIXED, fd, offset_low )) != (LPVOID)-1)
-    {
-//         printf("address %08x\n", *(int*)ret);
-//     printf("%x\n", ret);
-           return ret;
-    }
-
-//    printf("mmap %d\n", errno);
-
-    /* mmap() failed; if this is because the file offset is not    */
-    /* page-aligned (EINVAL), or because the underlying filesystem */
-    /* does not support mmap() (ENOEXEC), we do it by hand.        */
-
-    if (unix_handle == -1) return ret;
-    if ((errno != ENOEXEC) && (errno != EINVAL)) return ret;
-    if (prot & PROT_WRITE)
-    {
-        /* We cannot fake shared write mappings */
-#ifdef MAP_SHARED
-       if (flags & MAP_SHARED) return ret;
-#endif
-#ifdef MAP_PRIVATE
-       if (!(flags & MAP_PRIVATE)) return ret;
-#endif
-    }
-/*    printf( "FILE_mmap: mmap failed (%d), faking it\n", errno );*/
-    /* Reserve the memory with an anonymous mmap */
-    ret = FILE_dommap( -1, start, size_high, size_low, 0, 0,
-                       PROT_READ | PROT_WRITE, flags );
-    if (ret == (LPVOID)-1)
-//    {
-//     perror(
-        return ret;
-    /* Now read in the file */
-    if ((pos = lseek( fd, offset_low, SEEK_SET )) == -1)
-    {
-        FILE_munmap( ret, size_high, size_low );
-//     printf("lseek\n");
-        return (LPVOID)-1;
-    }
-    read( fd, ret, size_low );
-    lseek( fd, pos, SEEK_SET );  /* Restore the file pointer */
-    mprotect( ret, size_low, prot );  /* Set the right protection */
-//    printf("address %08x\n", *(int*)ret);
-    return ret;
-}
-
-
-/***********************************************************************
- *           FILE_munmap
- */
-int FILE_munmap( LPVOID start, DWORD size_high, DWORD size_low )
-{
-    if (size_high)
-      printf("offsets larger than 4Gb not supported\n");
-    return munmap( start, size_low );
-}
-static int mapping_size=0;
-
-struct file_mapping_s;
-typedef struct file_mapping_s
-{
-    int mapping_size;
-    char* name;
-    LPVOID handle;
-    struct file_mapping_s* next;
-    struct file_mapping_s* prev;
-}file_mapping;
-static file_mapping* fm=0;
-
-
-
-#define        PAGE_NOACCESS           0x01
-#define        PAGE_READONLY           0x02
-#define        PAGE_READWRITE          0x04
-#define        PAGE_WRITECOPY          0x08
-#define        PAGE_EXECUTE            0x10
-#define        PAGE_EXECUTE_READ       0x20
-#define        PAGE_EXECUTE_READWRITE  0x40
-#define        PAGE_EXECUTE_WRITECOPY  0x80
-#define        PAGE_GUARD              0x100
-#define        PAGE_NOCACHE            0x200
-
-HANDLE WINAPI CreateFileMappingA(HANDLE handle, LPSECURITY_ATTRIBUTES lpAttr,
-                                DWORD flProtect,
-                                DWORD dwMaxHigh, DWORD dwMaxLow,
-                                LPCSTR name)
-{
-    int hFile = (int)handle;
-    unsigned int len;
-    LPVOID answer;
-    int anon=0;
-    int mmap_access=0;
-    if(hFile<0)
-    {
-       anon=1;
-       hFile=open("/dev/zero", O_RDWR);
-       if(hFile<0){
-           perror( "Cannot open /dev/zero for READ+WRITE. Check permissions! error: " );
-           return 0;
-       }
-    }
-    if(!anon)
-    {
-        len=lseek(hFile, 0, SEEK_END);
-       lseek(hFile, 0, SEEK_SET);
-    }
-    else len=dwMaxLow;
-
-    if(flProtect & PAGE_READONLY)
-       mmap_access |=PROT_READ;
-    else
-       mmap_access |=PROT_READ|PROT_WRITE;
-
-    answer=mmap(NULL, len, mmap_access, MAP_PRIVATE, hFile, 0);
-    if(anon)
-        close(hFile);
-    if(answer!=(LPVOID)-1)
-    {
-       if(fm==NULL)
-       {
-           fm = (file_mapping*) malloc(sizeof(file_mapping));
-           fm->prev=NULL;
-       }
-       else
-       {
-           fm->next = (file_mapping*) malloc(sizeof(file_mapping));
-           fm->next->prev=fm;
-           fm=fm->next;
-       }
-       fm->next=NULL;
-       fm->handle=answer;
-       if(name)
-       {
-           fm->name = (char*) malloc(strlen(name)+1);
-           strcpy(fm->name, name);
-       }
-       else
-           fm->name=NULL;
-       fm->mapping_size=len;
-
-       if(anon)
-           close(hFile);
-       return (HANDLE)answer;
-    }
-    return (HANDLE)0;
-}
-WIN_BOOL WINAPI UnmapViewOfFile(LPVOID handle)
-{
-    file_mapping* p;
-    int result;
-    if(fm==NULL)
-       return 0;
-    for(p=fm; p; p=p->next)
-    {
-       if(p->handle==handle)
-       {
-           result=munmap((void*)handle, p->mapping_size);
-           if(p->next)p->next->prev=p->prev;
-           if(p->prev)p->prev->next=p->next;
-            free(p->name);
-           if(p==fm)
-               fm=p->prev;
-           free(p);
-           return result;
-       }
-    }
-    return 0;
-}
-//static int va_size=0;
-struct virt_alloc_s;
-typedef struct virt_alloc_s
-{
-    int mapping_size;
-    char* address;
-    struct virt_alloc_s* next;
-    struct virt_alloc_s* prev;
-    int state;
-}virt_alloc;
-static virt_alloc* vm=0;
-#define MEM_COMMIT              0x00001000
-#define MEM_RESERVE             0x00002000
-
-LPVOID WINAPI VirtualAlloc(LPVOID address, DWORD size, DWORD type,  DWORD protection)
-{
-    void* answer;
-    int fd;
-    long pgsz;
-
-    //printf("VirtualAlloc(0x%08X, %u, 0x%08X, 0x%08X)\n", (unsigned)address, size, type, protection);
-
-    if ((type&(MEM_RESERVE|MEM_COMMIT)) == 0) return NULL;
-
-    fd=open("/dev/zero", O_RDWR);
-    if(fd<0){
-        perror( "Cannot open /dev/zero for READ+WRITE. Check permissions! error: " );
-       return NULL;
-    }
-
-    if (type&MEM_RESERVE && (unsigned)address&0xffff) {
-       size += (unsigned)address&0xffff;
-       address = (unsigned)address&~0xffff;
-    }
-    pgsz = sysconf(_SC_PAGESIZE);
-    if (type&MEM_COMMIT && (unsigned)address%pgsz) {
-       size += (unsigned)address%pgsz;
-       address -= (unsigned)address%pgsz;
-    }
-
-    if (type&MEM_RESERVE && size<0x10000) size = 0x10000;
-    if (size%pgsz) size += pgsz - size%pgsz;
-
-    if(address!=NULL)
-    {
-    //check whether we can allow to allocate this
-        virt_alloc* str=vm;
-        while(str)
-        {
-           if((unsigned)address>=(unsigned)str->address+str->mapping_size)
-           {
-               str=str->prev;
-               continue;
-           }
-           if((unsigned)address+size<=(unsigned)str->address)
-           {
-               str=str->prev;
-               continue;
-           }
-           if(str->state==0)
-           {
-#warning FIXME
-               if(   ((unsigned)address >= (unsigned)str->address)
-                  && ((unsigned)address+size<=(unsigned)str->address+str->mapping_size)
-                  && (type & MEM_COMMIT))
-               {
-                   close(fd);
-                   return address; //returning previously reserved memory
-               }
-               //printf(" VirtualAlloc(...) does not commit or not entirely within reserved, and\n");
-           }
-           /*printf(" VirtualAlloc(...) (0x%08X, %u) overlaps with (0x%08X, %u, state=%d)\n",
-                  (unsigned)address, size, (unsigned)str->address, str->mapping_size, str->state);*/
-           close(fd);
-           return NULL;
-       }
-    }
-
-    answer=mmap(address, size, PROT_READ | PROT_WRITE | PROT_EXEC,
-               MAP_PRIVATE, fd, 0);
-//    answer=FILE_dommap(-1, address, 0, size, 0, 0,
-//     PROT_READ | PROT_WRITE | PROT_EXEC, MAP_PRIVATE);
-    close(fd);
-    if (answer != (void *)-1 && address && answer != address) {
-       /* It is dangerous to try mmap() with MAP_FIXED since it does not
-          always detect conflicts or non-allocation and chaos ensues after
-          a successful call but an overlapping or non-allocated region.  */
-       munmap(answer, size);
-       answer = (void *) -1;
-       errno = EINVAL;
-       //printf(" VirtualAlloc(...) cannot satisfy requested address but address=NULL would work.\n");
-    }
-    if(answer==(void*)-1)
-    {
-       /*printf(" VirtualAlloc(...) mmap(0x%08X, %u, ...) failed with errno=%d (\"%s\")\n",
-              (unsigned)address, size, errno, strerror(errno));*/
-       return NULL;
-    }
-    else
-    {
-       virt_alloc *new_vm = (virt_alloc*) malloc(sizeof(virt_alloc));
-       new_vm->mapping_size=size;
-       new_vm->address=(char*)answer;
-        new_vm->prev=vm;
-       if(type == MEM_RESERVE)
-           new_vm->state=0;
-       else
-           new_vm->state=1;
-       if(vm)
-           vm->next=new_vm;
-       vm=new_vm;
-       vm->next=0;
-       //if(va_size!=0)
-       //    printf("Multiple VirtualAlloc!\n");
-       //printf(" VirtualAlloc(...) provides (0x%08X, %u)\n", (unsigned)answer, size);
-        return answer;
-    }
-}
-
-WIN_BOOL WINAPI VirtualFree(LPVOID  address, SIZE_T dwSize, DWORD dwFreeType)//not sure
-{
-    virt_alloc* str=vm;
-    int answer;
-
-    //printf("VirtualFree(0x%08X, %d, 0x%08X)\n", (unsigned)address, dwSize, dwFreeType);
-    while(str)
-    {
-       if(address!=str->address)
-       {
-           str=str->prev;
-           continue;
-       }
-       //printf(" VirtualFree(...) munmap(0x%08X, %d)\n", (unsigned)str->address, str->mapping_size);
-       answer=munmap(str->address, str->mapping_size);
-       if(str->next)str->next->prev=str->prev;
-       if(str->prev)str->prev->next=str->next;
-       if(vm==str)vm=str->prev;
-       free(str);
-       return 0;
-    }
-    return -1;
-}
-
-INT WINAPI WideCharToMultiByte(UINT codepage, DWORD flags, LPCWSTR src,
-     INT srclen,LPSTR dest, INT destlen, LPCSTR defch, WIN_BOOL* used_defch)
-{
-    int i;
-    if(src==NULL)
-       return 0;
-    if ((srclen==-1)&&(dest==NULL)) return 0;
-    if(srclen==-1){srclen=0; while(src[srclen++]);}
-//    for(i=0; i<srclen; i++)
-//     printf("%c", src[i]);
-//    printf("\n");
-    if(dest==NULL)
-    {
-    for(i=0; i<srclen; i++)
-    {
-       src++;
-       if(*src==0)
-           return i+1;
-    }
-       return srclen+1;
-    }
-    if(used_defch)
-       *used_defch=0;
-    for(i=0; i<min(srclen, destlen); i++)
-    {
-       *dest=(char)*src;
-       dest++;
-       src++;
-       if(*src==0)
-           return i+1;
-    }
-    return min(srclen, destlen);
-}
-INT WINAPI MultiByteToWideChar(UINT codepage,DWORD flags, LPCSTR src, INT srclen,
-    LPWSTR dest, INT destlen)
-{
-    return 0;
-}
-HANDLE WINAPI OpenFileMappingA(DWORD access, WIN_BOOL prot, LPCSTR name)
-{
-    file_mapping* p;
-    if(fm==NULL)
-       return (HANDLE)0;
-    if(name==NULL)
-       return (HANDLE)0;
-    for(p=fm; p; p=p->prev)
-    {
-       if(p->name==NULL)
-           continue;
-       if(strcmp(p->name, name)==0)
-           return (HANDLE)p->handle;
-    }
-    return 0;
-}
diff --git a/modules/codec/loader/ext.h b/modules/codec/loader/ext.h
deleted file mode 100644 (file)
index 668219f..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Modified for use with MPlayer, detailed CVS changelog at
- * http://www.mplayerhq.hu/cgi-bin/cvsweb.cgi/main/
- * $Id$
- */
-
-#ifndef loader_ext_h
-#define loader_ext_h
-
-#include "wine/windef.h"
-
-extern LPVOID FILE_dommap( int unix_handle, 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 int wcsnicmp(const unsigned short* s1, const unsigned short* s2, int n);
-extern int __vprintf( const char *format, ... );
-
-#endif
diff --git a/modules/codec/loader/kludge.c b/modules/codec/loader/kludge.c
deleted file mode 100644 (file)
index a22af0a..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-/*****************************************************************************
- * kludge.c
- *****************************************************************************
- * Copyright (C) 2005 Rémi Denis-Courmont
- * $Id$
- *
- * Authors: Rémi Denis-Courmont <rem # videolan.org>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
- *****************************************************************************/
-
-int dbg_printf(const char *format, ...)
-{
-       return 0;
-}
diff --git a/modules/codec/loader/ldt_keeper.c b/modules/codec/loader/ldt_keeper.c
deleted file mode 100644 (file)
index 4bf5d04..0000000
+++ /dev/null
@@ -1,308 +0,0 @@
-/*
- * $Id$
- *
- * Copyright 1993 Robert J. Amstadt
- * Copyright 1995 Alexandre Julliard
- *
- * Originally distributed under LPGL 2.1 (or later) by the Wine project.
- *
- * Modified for use with MPlayer, detailed CVS changelog at
- * http://www.mplayerhq.hu/cgi-bin/cvsweb.cgi/main/
- *
- * File now distributed as part of VLC media player with no modifications.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
- */
-
-/**
- * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
- * This file MUST be in main library because LDT must
- * be modified before program creates first thread
- * - avifile includes this file from C++ code
- * and initializes it at the start of player!
- * it might sound like a hack and it really is - but
- * as aviplay is deconding video with more than just one
- * thread currently it's necessary to do it this way
- * this might change in the future
- */
-
-/* applied some modification to make make our xine friend more happy */
-
-#include "ldt_keeper.h"
-
-#include <string.h>
-#include <stdlib.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <sys/mman.h>
-#include <sys/types.h>
-#include <stdio.h>
-#include <unistd.h>
-#ifdef __linux__
-#include <asm/unistd.h>
-#include <asm/ldt.h>
-// 2.5.xx+ calls this user_desc:
-#include <linux/version.h>
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,47)
-#define modify_ldt_ldt_s user_desc
-#endif
-/* prototype it here, so we won't depend on kernel headers */
-#ifdef  __cplusplus
-extern "C" {
-#endif
-/// declare modify_ldt with the _syscall3 macro for older glibcs
-#if defined(__GLIBC__) &&  (__GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ == 0))
-_syscall3( int, modify_ldt, int, func, void *, ptr, unsigned long, bytecount );
-#else
-int modify_ldt(int func, void *ptr, unsigned long bytecount);
-#endif
-#ifdef  __cplusplus
-}
-#endif
-#else
-#if defined(__NetBSD__) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__DragonFly__)
-#include <machine/segments.h>
-#include <machine/sysarch.h>
-#endif
-
-#ifdef __svr4__
-#include <sys/segment.h>
-#include <sys/sysi86.h>
-
-/* solaris x86: add missing prototype for sysi86() */
-#ifdef  __cplusplus
-extern "C" {
-#endif
-int sysi86(int, void*);
-#ifdef  __cplusplus
-}
-#endif
-
-#ifndef NUMSYSLDTS             /* SunOS 2.5.1 does not define NUMSYSLDTS */
-#define NUMSYSLDTS     6       /* Let's hope the SunOS 5.8 value is OK */
-#endif
-
-#define       TEB_SEL_IDX     NUMSYSLDTS
-#endif
-
-#define LDT_ENTRIES     8192
-#define LDT_ENTRY_SIZE  8
-#pragma pack(4)
-struct modify_ldt_ldt_s {
-        unsigned int  entry_number;
-        unsigned long base_addr;
-        unsigned int  limit;
-        unsigned int  seg_32bit:1;
-        unsigned int  contents:2;
-        unsigned int  read_exec_only:1;
-        unsigned int  limit_in_pages:1;
-        unsigned int  seg_not_present:1;
-        unsigned int  useable:1;
-};
-
-#define MODIFY_LDT_CONTENTS_DATA        0
-#define MODIFY_LDT_CONTENTS_STACK       1
-#define MODIFY_LDT_CONTENTS_CODE        2
-#endif
-
-
-/* user level (privilege level: 3) ldt (1<<2) segment selector */
-#define       LDT_SEL(idx) ((idx) << 3 | 1 << 2 | 3)
-
-/* i got this value from wine sources, it's the first free LDT entry */
-#if defined(__FreeBSD__) && defined(LDT_AUTO_ALLOC)
-#define       TEB_SEL_IDX     LDT_AUTO_ALLOC
-#endif
-
-#ifndef       TEB_SEL_IDX
-#define       TEB_SEL_IDX     17
-#endif
-
-static unsigned int fs_ldt = TEB_SEL_IDX;
-
-
-/**
- * here is a small logical problem with Restore for multithreaded programs -
- * in C++ we use static class for this...
- */
-
-#ifdef __cplusplus
-extern "C"
-#endif
-void Setup_FS_Segment(void)
-{
-    unsigned int ldt_desc = LDT_SEL(fs_ldt);
-
-    __asm__ __volatile__(
-       "movl %0,%%eax; movw %%ax, %%fs" : : "r" (ldt_desc)
-       :"eax"
-    );
-}
-
-/* we don't need this - use modify_ldt instead */
-#if 0
-#ifdef __linux__
-/* XXX: why is this routine from libc redefined here? */
-/* NOTE: the redefined version ignores the count param, count is hardcoded as 16 */
-static int LDT_Modify( int func, struct modify_ldt_ldt_s *ptr,
-                      unsigned long count )
-{
-    int res;
-#ifdef __PIC__
-    __asm__ __volatile__( "pushl %%ebx\n\t"
-                         "movl %2,%%ebx\n\t"
-                         "int $0x80\n\t"
-                         "popl %%ebx"
-                         : "=a" (res)
-                         : "0" (__NR_modify_ldt),
-                         "r" (func),
-                         "c" (ptr),
-                         "d"(16)//sizeof(*ptr) from kernel point of view
-                         :"esi"     );
-#else
-    __asm__ __volatile__("int $0x80"
-                        : "=a" (res)
-                        : "0" (__NR_modify_ldt),
-                        "b" (func),
-                        "c" (ptr),
-                        "d"(16)
-                        :"esi");
-#endif  /* __PIC__ */
-    if (res >= 0) return res;
-    errno = -res;
-    return -1;
-}
-#endif
-#endif
-
-#if defined(__NetBSD__) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__DragonFly__)
-static void LDT_EntryToBytes( unsigned long *buffer, const struct modify_ldt_ldt_s *content )
-{
-    *buffer++ = ((content->base_addr & 0x0000ffff) << 16) |
-       (content->limit & 0x0ffff);
-    *buffer = (content->base_addr & 0xff000000) |
-       ((content->base_addr & 0x00ff0000)>>16) |
-       (content->limit & 0xf0000) |
-       (content->contents << 10) |
-       ((content->read_exec_only == 0) << 9) |
-       ((content->seg_32bit != 0) << 22) |
-       ((content->limit_in_pages != 0) << 23) |
-       0xf000;
-}
-#endif
-
-void* fs_seg=0;
-
-ldt_fs_t* Setup_LDT_Keeper(void)
-{
-    struct modify_ldt_ldt_s array;
-    int ret;
-    ldt_fs_t* ldt_fs = (ldt_fs_t*) malloc(sizeof(ldt_fs_t));
-
-    if (!ldt_fs)
-       return NULL;
-
-    ldt_fs->fd = open("/dev/zero", O_RDWR);
-    if(ldt_fs->fd<0){
-        perror( "Cannot open /dev/zero for READ+WRITE. Check permissions! error: ");
-        free(ldt_fs);
-       return NULL;
-    }
-    fs_seg=
-    ldt_fs->fs_seg = mmap(NULL, getpagesize(), PROT_READ | PROT_WRITE, MAP_PRIVATE,
-                         ldt_fs->fd, 0);
-    if (ldt_fs->fs_seg == (void*)-1)
-    {
-       perror("ERROR: Couldn't allocate memory for fs segment");
-        close(ldt_fs->fd);
-        free(ldt_fs);
-       return NULL;
-    }
-    *(void**)((char*)ldt_fs->fs_seg+0x18) = ldt_fs->fs_seg;
-    memset(&array, 0, sizeof(array));
-    array.base_addr=(int)ldt_fs->fs_seg;
-    array.entry_number=TEB_SEL_IDX;
-    array.limit=array.base_addr+getpagesize()-1;
-    array.seg_32bit=1;
-    array.read_exec_only=0;
-    array.seg_not_present=0;
-    array.contents=MODIFY_LDT_CONTENTS_DATA;
-    array.limit_in_pages=0;
-#ifdef __linux__
-    //ret=LDT_Modify(0x1, &array, sizeof(struct modify_ldt_ldt_s));
-    ret=modify_ldt(0x1, &array, sizeof(struct modify_ldt_ldt_s));
-    if(ret<0)
-    {
-       perror("install_fs");
-       printf("Couldn't install fs segment, expect segfault\n");
-    }
-#endif /*linux*/
-
-#if defined(__NetBSD__) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__DragonFly__)
-    {
-        unsigned long d[2];
-
-        LDT_EntryToBytes( d, &array );
-#if defined(__FreeBSD__) && defined(LDT_AUTO_ALLOC)
-        ret = i386_set_ldt(LDT_AUTO_ALLOC, (union descriptor *)d, 1);
-        array.entry_number = ret;
-        fs_ldt = ret;
-#else
-        ret = i386_set_ldt(array.entry_number, (union descriptor *)d, 1);
-#endif
-        if (ret < 0)
-        {
-            perror("install_fs");
-           printf("Couldn't install fs segment, expect segfault\n");
-            printf("Did you reconfigure the kernel with \"options USER_LDT\"?\n");
-        }
-    }
-#endif  /* __NetBSD__ || __FreeBSD__ || __OpenBSD__ || __DragonFly__ */
-
-#if defined(__svr4__)
-    {
-       struct ssd ssd;
-       ssd.sel = LDT_SEL(TEB_SEL_IDX);
-       ssd.bo = array.base_addr;
-       ssd.ls = array.limit - array.base_addr;
-       ssd.acc1 = ((array.read_exec_only == 0) << 1) |
-           (array.contents << 2) |
-           0xf0;   /* P(resent) | DPL3 | S */
-       ssd.acc2 = 0x4;   /* byte limit, 32-bit segment */
-       if (sysi86(SI86DSCR, &ssd) < 0) {
-           perror("sysi86(SI86DSCR)");
-           printf("Couldn't install fs segment, expect segfault\n");
-       }
-    }
-#endif
-
-    Setup_FS_Segment();
-
-    ldt_fs->prev_struct = (char*)malloc(sizeof(char) * 8);
-    *(void**)array.base_addr = ldt_fs->prev_struct;
-
-    return ldt_fs;
-}
-
-void Restore_LDT_Keeper(ldt_fs_t* ldt_fs)
-{
-    if (ldt_fs == NULL || ldt_fs->fs_seg == NULL)
-       return;
-    free(ldt_fs->prev_struct);
-    munmap((char*)ldt_fs->fs_seg, getpagesize());
-    ldt_fs->fs_seg = 0;
-    close(ldt_fs->fd);
-    free(ldt_fs);
-}
diff --git a/modules/codec/loader/ldt_keeper.h b/modules/codec/loader/ldt_keeper.h
deleted file mode 100644 (file)
index d36ebb8..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-#ifndef LDT_KEEPER_H
-#define LDT_KEEPER_H
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-typedef struct {
-  void* fs_seg;
-  char* prev_struct;
-  int fd;
-} ldt_fs_t;
-
-void Setup_FS_Segment(void);
-ldt_fs_t* Setup_LDT_Keeper(void);
-void Restore_LDT_Keeper(ldt_fs_t* ldt_fs);
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* LDT_KEEPER_H */
diff --git a/modules/codec/loader/loader.h b/modules/codec/loader/loader.h
deleted file mode 100644 (file)
index ec29983..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Win32 binary loader interface
- * $Id$
- *
- * Copyright 2000 Eugene Kuznetsov (divx@euro.ru)
- * Copyright (C) the Wine project
- *
- * Originally distributed under LPGL 2.1 (or later) by the Wine project.
- *
- * Modified for use with MPlayer, detailed CVS changelog at
- * http://www.mplayerhq.hu/cgi-bin/cvsweb.cgi/main/
- *
- * File now distributed as part of VLC media player with no modifications.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
- */
-
-#ifndef _LOADER_H
-#define _LOADER_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include "wine/windef.h"
-#include "wine/driver.h"
-#include "wine/mmreg.h"
-#include "wine/vfw.h"
-#include "wine/msacm.h"
-
-unsigned int _GetPrivateProfileIntA(const char* appname, const char* keyname, int default_value, const char* filename);
-int _GetPrivateProfileStringA(const char* appname, const char* keyname,
-       const char* def_val, char* dest, unsigned int len, const char* filename);
-int _WritePrivateProfileStringA(const char* appname, const char* keyname,
-       const char* string, const char* filename);
-
-INT WINAPI LoadStringA( HINSTANCE instance, UINT resource_id,
-                            LPSTR buffer, INT buflen );
-
-#ifdef __cplusplus
-}
-#endif
-#endif /* __LOADER_H */
-
diff --git a/modules/codec/loader/module.c b/modules/codec/loader/module.c
deleted file mode 100644 (file)
index 635f4b5..0000000
+++ /dev/null
@@ -1,1106 +0,0 @@
-/*
- * Modules
- *
- * $Id$
- *
- * Copyright 1995 Alexandre Julliard
- *
- * Originally distributed under LPGL 2.1 (or later) by the Wine project.
- *
- * Modified for use with MPlayer, detailed CVS changelog at
- * http://www.mplayerhq.hu/cgi-bin/cvsweb.cgi/main/
- *
- * File now distributed as part of VLC media player with no modifications.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
- */
-
-// define for quicktime calls debugging and/or MacOS-level emulation:
-#define EMU_QTX_API
-
-// define for quicktime debugging (verbose logging):
-//#define DEBUG_QTX_API
-
-#include "config.h"
-
-#include <assert.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-#include <sys/mman.h>
-#include <inttypes.h>
-
-#include "wine/windef.h"
-#include "wine/winerror.h"
-#include "wine/heap.h"
-#include "wine/module.h"
-#include "wine/pe_image.h"
-#include "wine/debugtools.h"
-
-#undef HAVE_LIBDL
-
-#ifdef HAVE_LIBDL
-#include <dlfcn.h>
-#include "wine/elfdll.h"
-#endif
-#include "win32.h"
-#include "driver.h"
-
-#ifdef EMU_QTX_API
-#include "wrapper.h"
-static int report_func(void *stack_base, int stack_size, reg386_t *reg, uint32_t *flags);
-static int report_func_ret(void *stack_base, int stack_size, reg386_t *reg, uint32_t *flags);
-#endif
-
-//#undef TRACE
-//#define TRACE printf
-
-//WINE_MODREF *local_wm=NULL;
-modref_list* local_wm=NULL;
-
-HANDLE SegptrHeap;
-
-WINE_MODREF* MODULE_FindModule(LPCSTR m)
-{
-    modref_list* list=local_wm;
-    TRACE("FindModule: Module %s request\n", m);
-    if(list==NULL)
-       return NULL;
-//    while(strcmp(m, list->wm->filename))
-    while(!strstr(list->wm->filename, m))
-    {
-       TRACE("%s: %x\n", list->wm->filename, list->wm->module);
-       list=list->prev;
-       if(list==NULL)
-           return NULL;
-    }
-    TRACE("Resolved to %s\n", list->wm->filename);
-    return list->wm;
-}
-
-static void MODULE_RemoveFromList(WINE_MODREF *mod)
-{
-    modref_list* list=local_wm;
-    if(list==NULL)
-       return;
-    if(mod==NULL)
-       return;
-    if((list->prev==NULL)&&(list->next==NULL))
-    {
-       free(list);
-       local_wm=NULL;
-//     uninstall_fs();
-       return;
-    }
-    for(;list;list=list->prev)
-    {
-       if(list->wm==mod)
-       {
-           if(list->prev)
-               list->prev->next=list->next;
-           if(list->next)
-               list->next->prev=list->prev;
-           if(list==local_wm)
-               local_wm=list->prev;
-           free(list);
-           return;
-       }
-    }
-
-}
-
-WINE_MODREF *MODULE32_LookupHMODULE(HMODULE m)
-{
-    modref_list* list=local_wm;
-    TRACE("LookupHMODULE: Module %X request\n", m);
-    if(list==NULL)
-    {
-       TRACE("LookupHMODULE failed\n");
-       return NULL;
-    }
-    while(m!=list->wm->module)
-    {
-//      printf("Checking list %X wm %X module %X\n",
-//     list, list->wm, list->wm->module);
-       list=list->prev;
-       if(list==NULL)
-       {
-           TRACE("LookupHMODULE failed\n");
-           return NULL;
-       }
-    }
-    TRACE("LookupHMODULE hit %p\n", list->wm);
-    return list->wm;
-}
-
-/*************************************************************************
- *             MODULE_InitDll
- */
-static WIN_BOOL MODULE_InitDll( WINE_MODREF *wm, DWORD type, LPVOID lpReserved )
-{
-    WIN_BOOL retv = TRUE;
-
-    static LPCSTR typeName[] = { "PROCESS_DETACH", "PROCESS_ATTACH",
-                                 "THREAD_ATTACH", "THREAD_DETACH" };
-    assert( wm );
-
-
-    /* Skip calls for modules loaded with special load flags */
-
-    if (    ( wm->flags & WINE_MODREF_DONT_RESOLVE_REFS )
-         || ( wm->flags & WINE_MODREF_LOAD_AS_DATAFILE ) )
-        return TRUE;
-
-
-    TRACE("(%s,%s,%p) - CALL\n", wm->modname, typeName[type], lpReserved );
-
-    /* Call the initialization routine */
-    switch ( wm->type )
-    {
-    case MODULE32_PE:
-        retv = PE_InitDLL( wm, type, lpReserved );
-        break;
-
-    case MODULE32_ELF:
-        /* no need to do that, dlopen() already does */
-        break;
-
-    default:
-        ERR("wine_modref type %d not handled.\n", wm->type );
-        retv = FALSE;
-        break;
-    }
-
-    /* The state of the module list may have changed due to the call
-       to PE_InitDLL. We cannot assume that this module has not been
-       deleted.  */
-    TRACE("(%p,%s,%p) - RETURN %d\n", wm, typeName[type], lpReserved, retv );
-
-    return retv;
-}
-
-/*************************************************************************
- *             MODULE_DllProcessAttach
- *
- * Send the process attach notification to all DLLs the given module
- * depends on (recursively). This is somewhat complicated due to the fact that
- *
- * - we have to respect the module dependencies, i.e. modules implicitly
- *   referenced by another module have to be initialized before the module
- *   itself can be initialized
- *
- * - the initialization routine of a DLL can itself call LoadLibrary,
- *   thereby introducing a whole new set of dependencies (even involving
- *   the 'old' modules) at any time during the whole process
- *
- * (Note that this routine can be recursively entered not only directly
- *  from itself, but also via LoadLibrary from one of the called initialization
- *  routines.)
- *
- * Furthermore, we need to rearrange the main WINE_MODREF list to allow
- * the process *detach* notifications to be sent in the correct order.
- * This must not only take into account module dependencies, but also
- * 'hidden' dependencies created by modules calling LoadLibrary in their
- * attach notification routine.
- *
- * The strategy is rather simple: we move a WINE_MODREF to the head of the
- * list after the attach notification has returned.  This implies that the
- * detach notifications are called in the reverse of the sequence the attach
- * notifications *returned*.
- *
- * NOTE: Assumes that the process critical section is held!
- *
- */
-static WIN_BOOL MODULE_DllProcessAttach( WINE_MODREF *wm, LPVOID lpReserved )
-{
-    WIN_BOOL retv = TRUE;
-    int i;
-    assert( wm );
-
-    /* prevent infinite recursion in case of cyclical dependencies */
-    if (    ( wm->flags & WINE_MODREF_MARKER )
-         || ( wm->flags & WINE_MODREF_PROCESS_ATTACHED ) )
-        return retv;
-
-    TRACE("(%s,%p) - START\n", wm->modname, lpReserved );
-
-    /* Tag current MODREF to prevent recursive loop */
-    wm->flags |= WINE_MODREF_MARKER;
-
-    /* Recursively attach all DLLs this one depends on */
-/*    for ( i = 0; retv && i < wm->nDeps; i++ )
-        if ( wm->deps[i] )
-            retv = MODULE_DllProcessAttach( wm->deps[i], lpReserved );
-*/
-    /* Call DLL entry point */
-
-    //local_wm=wm;
-    if(local_wm)
-    {
-       local_wm->next = (modref_list*) malloc(sizeof(modref_list));
-        local_wm->next->prev=local_wm;
-        local_wm->next->next=NULL;
-        local_wm->next->wm=wm;
-        local_wm=local_wm->next;
-    }
-    else
-    {
-       local_wm = (modref_list*)malloc(sizeof(modref_list));
-       local_wm->next=local_wm->prev=NULL;
-       local_wm->wm=wm;
-    }
-    /* Remove recursion flag */
-    wm->flags &= ~WINE_MODREF_MARKER;
-
-    if ( retv )
-    {
-        retv = MODULE_InitDll( wm, DLL_PROCESS_ATTACH, lpReserved );
-        if ( retv )
-            wm->flags |= WINE_MODREF_PROCESS_ATTACHED;
-    }
-
-
-    TRACE("(%s,%p) - END\n", wm->modname, lpReserved );
-
-    return retv;
-}
-
-/*************************************************************************
- *             MODULE_DllProcessDetach
- *
- * Send DLL process detach notifications.  See the comment about calling
- * sequence at MODULE_DllProcessAttach.  Unless the bForceDetach flag
- * is set, only DLLs with zero refcount are notified.
- */
-static void MODULE_DllProcessDetach( WINE_MODREF* wm, WIN_BOOL bForceDetach, LPVOID lpReserved )
-{
-    //    WINE_MODREF *wm=local_wm;
-    modref_list* l = local_wm;
-    wm->flags &= ~WINE_MODREF_PROCESS_ATTACHED;
-    MODULE_InitDll( wm, DLL_PROCESS_DETACH, lpReserved );
-/*    while (l)
-    {
-       modref_list* f = l;
-       l = l->next;
-       free(f);
-    }
-    local_wm = 0;*/
-}
-
-/***********************************************************************
- *     MODULE_LoadLibraryExA   (internal)
- *
- * Load a PE style module according to the load order.
- *
- * The HFILE parameter is not used and marked reserved in the SDK. I can
- * only guess that it should force a file to be mapped, but I rather
- * ignore the parameter because it would be extremely difficult to
- * integrate this with different types of module represenations.
- *
- */
-static WINE_MODREF *MODULE_LoadLibraryExA( LPCSTR libname, HFILE hfile, DWORD flags )
-{
-       DWORD err = GetLastError();
-       WINE_MODREF *pwm;
-       int i;
-//     module_loadorder_t *plo;
-
-        SetLastError( ERROR_FILE_NOT_FOUND );
-       TRACE("Trying native dll '%s'\n", libname);
-       pwm = PE_LoadLibraryExA(libname, flags);
-#ifdef HAVE_LIBDL
-       if(!pwm)
-       {
-           TRACE("Trying ELF dll '%s'\n", libname);
-           pwm=(WINE_MODREF*)ELFDLL_LoadLibraryExA(libname, flags);
-       }
-#endif
-//             printf("0x%08x\n", pwm);
-//             break;
-       if(pwm)
-       {
-               /* Initialize DLL just loaded */
-               TRACE("Loaded module '%s' at 0x%08x, \n", libname, pwm->module);
-               /* Set the refCount here so that an attach failure will */
-               /* decrement the dependencies through the MODULE_FreeLibrary call. */
-               pwm->refCount++;
-
-                SetLastError( err );  /* restore last error */
-               return pwm;
-       }
-
-
-       WARN("Failed to load module '%s'; error=0x%08lx, \n", libname, GetLastError());
-       return NULL;
-}
-
-/***********************************************************************
- *           MODULE_FreeLibrary
- *
- * NOTE: Assumes that the process critical section is held!
- */
-static WIN_BOOL MODULE_FreeLibrary( WINE_MODREF *wm )
-{
-    TRACE("(%s) - START\n", wm->modname );
-
-    /* Recursively decrement reference counts */
-    //MODULE_DecRefCount( wm );
-
-    /* Call process detach notifications */
-    MODULE_DllProcessDetach( wm, FALSE, NULL );
-
-    PE_UnloadLibrary(wm);
-
-    TRACE("END\n");
-
-    return TRUE;
-}
-
-/***********************************************************************
- *           LoadLibraryExA   (KERNEL32)
- */
-HMODULE WINAPI LoadLibraryExA(LPCSTR libname, HANDLE hfile, DWORD flags)
-{
-       WINE_MODREF *wm = 0;
-       char* listpath[] = { "", "", "/usr/lib/win32", "/usr/local/lib/win32", "/usr/lib/codecs", "/usr/local/lib/codecs", 0 };
-       extern char* def_path;
-       char path[512];
-       char checked[2000];
-        int i = -1;
-
-        checked[0] = 0;
-       if(!libname)
-       {
-               SetLastError(ERROR_INVALID_PARAMETER);
-               return 0;
-       }
-
-       wm=MODULE_FindModule(libname);
-       if(wm) return wm->module;
-
-//     if(fs_installed==0)
-//         install_fs();
-
-       while (wm == NULL && listpath[++i])
-       {
-           if (i < 2)
-           {
-               if (i == 0)
-                   /* check just original file name */
-                   strncpy(path, libname, 511);
-                else
-                   /* check default user path */
-                   strncpy(path, def_path, 300);
-           }
-           else if (strcmp(def_path, listpath[i]))
-                /* path from the list */
-               strncpy(path, listpath[i], 300);
-           else
-               continue;
-
-           if (i > 0)
-           {
-               strcat(path, "/");
-               strncat(path, libname, 100);
-           }
-           path[511] = 0;
-           wm = MODULE_LoadLibraryExA( path, hfile, flags );
-
-           if (!wm)
-           {
-               if (checked[0])
-                   strcat(checked, ", ");
-               strcat(checked, path);
-                checked[1500] = 0;
-
-           }
-       }
-       if ( wm )
-       {
-               if ( !MODULE_DllProcessAttach( wm, NULL ) )
-               {
-                       WARN_(module)("Attach failed for module '%s', \n", libname);
-                       MODULE_FreeLibrary(wm);
-                       SetLastError(ERROR_DLL_INIT_FAILED);
-                       MODULE_RemoveFromList(wm);
-                       wm = NULL;
-               }
-       }
-
-       if (!wm)
-           printf("Win32 LoadLibrary failed to load: %s\n", checked);
-
-       if (strstr(libname,"vp31vfw.dll") && wm)
-       {
-           int i;
-
-         // sse hack moved from patch dll into runtime patching
-          if (PE_FindExportedFunction(wm, "DriverProc", TRUE)==(void*)0x10001000) {
-           fprintf(stderr, "VP3 DLL found\n");
-           for (i=0;i<18;i++) ((char*)0x10004bd6)[i]=0x90;
-         }
-       }
-
-        // remove a few divs in the VP codecs that make trouble
-        if (strstr(libname,"vp5vfw.dll") && wm)
-        {
-          int i;
-          if (PE_FindExportedFunction(wm, "DriverProc", TRUE)==(void*)0x10003930) {
-            for (i=0;i<3;i++) ((char*)0x10004e86)[i]=0x90;
-            for (i=0;i<3;i++) ((char*)0x10005a23)[i]=0x90;
-            for (i=0;i<3;i++) ((char*)0x10005bff)[i]=0x90;
-          } else {
-            fprintf(stderr, "Unsupported VP5 version\n");
-            return 0;
-          }
-        }
-
-        if (strstr(libname,"vp6vfw.dll") && wm)
-        {
-          int i;
-          if (PE_FindExportedFunction(wm, "DriverProc", TRUE)==(void*)0x10003ef0) {
-            // looks like VP 6.1.0.2
-            for (i=0;i<6;i++) ((char*)0x10007268)[i]=0x90;
-            for (i=0;i<6;i++) ((char*)0x10007e83)[i]=0x90;
-            for (i=0;i<6;i++) ((char*)0x1000806a)[i]=0x90;
-          } else if (PE_FindExportedFunction(wm, "DriverProc", TRUE)==(void*)0x10004120) {
-            // looks like VP 6.2.0.10
-            for (i=0;i<6;i++) ((char*)0x10007688)[i]=0x90;
-            for (i=0;i<6;i++) ((char*)0x100082c3)[i]=0x90;
-            for (i=0;i<6;i++) ((char*)0x100084aa)[i]=0x90;
-          } else if (PE_FindExportedFunction(wm, "DriverProc", TRUE)==(void*)0x10003e70) {
-            // looks like VP 6.0.7.3
-            for (i=0;i<6;i++) ((char*)0x10007559)[i]=0x90;
-            for (i=0;i<6;i++) ((char*)0x100081c3)[i]=0x90;
-            for (i=0;i<6;i++) ((char*)0x1000839e)[i]=0x90;
-          } else {
-            fprintf(stderr, "Unsupported VP6 version\n");
-            return 0;
-          }
-        }
-
-        // Windows Media Video 9 Advanced
-        if (strstr(libname,"wmvadvd.dll") && wm)
-        {
-          // The codec calls IsRectEmpty with coords 0,0,0,0 => result is 0
-          // but it really wants the rectangle to be not empty
-          if (PE_FindExportedFunction(wm, "CreateInstance", TRUE)==(void*)0x08c4b812) {
-            // Dll version is 10.0.0.3645
-            *((char*)0x08c48b0f)=0xeb; // Jump always, ignoring IsRectEmpty result
-          } else {
-            fprintf(stderr, "Unsupported WMVA version\n");
-            return 0;
-          }
-        }
-
-       if (strstr(libname,"QuickTime.qts") && wm)
-       {
-           void** ptr;
-           void *dispatch_addr;
-           int i;
-
-//         dispatch_addr = GetProcAddress(wm->module, "theQuickTimeDispatcher", TRUE);
-           dispatch_addr = PE_FindExportedFunction(wm, "theQuickTimeDispatcher", TRUE);
-           if (dispatch_addr == (void *)0x62924c30)
-           {
-               fprintf(stderr, "QuickTime5 DLLs found\n");
-               ptr = (void **)0x62b75ca4; // dispatch_ptr
-               for (i=0;i<5;i++)  ((char*)0x6299e842)[i]=0x90; // make_new_region ?
-               for (i=0;i<28;i++) ((char*)0x6299e86d)[i]=0x90; // call__call_CreateCompatibleDC ?
-               for (i=0;i<5;i++)  ((char*)0x6299e898)[i]=0x90; // jmp_to_call_loadbitmap ?
-               for (i=0;i<9;i++)  ((char*)0x6299e8ac)[i]=0x90; // call__calls_OLE_shit ?
-               for (i=0;i<106;i++) ((char*)0x62a61b10)[i]=0x90; // disable threads
-#if 0
-               /* CreateThread callers */
-               for (i=0;i<5;i++) ((char*)0x629487c5)[i]=0x90;
-               for (i=0;i<5;i++) ((char*)0x6294b275)[i]=0x90;
-               for (i=0;i<5;i++) ((char*)0x629a24b1)[i]=0x90;
-               for (i=0;i<5;i++) ((char*)0x629afc5a)[i]=0x90;
-               for (i=0;i<5;i++) ((char*)0x62af799c)[i]=0x90;
-               for (i=0;i<5;i++) ((char*)0x62af7efe)[i]=0x90;
-               for (i=0;i<5;i++) ((char*)0x62afa33e)[i]=0x90;
-#endif
-
-#if 0
-               /* TerminateQTML fix */
-               for (i=0;i<47;i++) ((char*)0x62afa3b8)[i]=0x90; // terminate thread
-               for (i=0;i<47;i++) ((char*)0x62af7f78)[i]=0x90; // terminate thread
-               for (i=0;i<77;i++) ((char*)0x629a13d5)[i]=0x90;
-               ((char *)0x6288e0ae)[0] = 0xc3; // font/dc remover
-               for (i=0;i<24;i++) ((char*)0x6287a1ad)[i]=0x90; // destroy window
-#endif
-           } else if (dispatch_addr == (void *)0x6693b330)
-           {
-               fprintf(stderr, "QuickTime6 DLLs found\n");
-               ptr = (void **)0x66bb9524; // dispatcher_ptr
-               for (i=0;i<5;i++)  ((char *)0x66a730cc)[i]=0x90; // make_new_region
-               for (i=0;i<28;i++) ((char *)0x66a730f7)[i]=0x90; // call__call_CreateCompatibleDC
-               for (i=0;i<5;i++)  ((char *)0x66a73122)[i]=0x90; // jmp_to_call_loadbitmap
-               for (i=0;i<9;i++)  ((char *)0x66a73131)[i]=0x90; // call__calls_OLE_shit
-               for (i=0;i<96;i++) ((char *)0x66aac852)[i]=0x90; // disable threads
-           } else if (dispatch_addr == (void *)0x6693c3e0)
-           {
-               fprintf(stderr, "QuickTime6.3 DLLs found\n");
-               ptr = (void **)0x66bca01c; // dispatcher_ptr
-               for (i=0;i<5;i++)  ((char *)0x66a68f6c)[i]=0x90; // make_new_region
-               for (i=0;i<28;i++) ((char *)0x66a68f97)[i]=0x90; // call__call_CreateCompatibleDC
-               for (i=0;i<5;i++)  ((char *)0x66a68fc2)[i]=0x90; // jmp_to_call_loadbitmap
-               for (i=0;i<9;i++)  ((char *)0x66a68fd1)[i]=0x90; // call__calls_OLE_shit
-               for (i=0;i<96;i++) ((char *)0x66ab4722)[i]=0x90; // disable threads
-           } else
-           {
-               fprintf(stderr, "Unsupported QuickTime version (%p)\n",
-                   dispatch_addr);
-               return 0;
-           }
-
-           fprintf(stderr,"QuickTime.qts patched!!! old entry=%p\n",ptr[0]);
-
-#ifdef EMU_QTX_API
-           report_entry = report_func;
-           report_ret   = report_func_ret;
-           wrapper_target=ptr[0];
-           ptr[0]=wrapper;
-#endif
-       }
-
-       return wm ? wm->module : 0;
-}
-
-
-/***********************************************************************
- *           LoadLibraryA         (KERNEL32)
- */
-HMODULE WINAPI LoadLibraryA(LPCSTR libname) {
-       return LoadLibraryExA(libname,0,0);
-}
-
-/***********************************************************************
- *           FreeLibrary
- */
-WIN_BOOL WINAPI FreeLibrary(HINSTANCE hLibModule)
-{
-    WIN_BOOL retv = FALSE;
-    WINE_MODREF *wm;
-
-    wm=MODULE32_LookupHMODULE(hLibModule);
-
-    if ( !wm || !hLibModule )
-    {
-        SetLastError( ERROR_INVALID_HANDLE );
-       return 0;
-    }
-    else
-        retv = MODULE_FreeLibrary( wm );
-
-    MODULE_RemoveFromList(wm);
-
-    /* garbage... */
-    if (local_wm == NULL) my_garbagecollection();
-
-    return retv;
-}
-
-/***********************************************************************
- *           MODULE_DecRefCount
- *
- * NOTE: Assumes that the process critical section is held!
- */
-static void MODULE_DecRefCount( WINE_MODREF *wm )
-{
-    int i;
-
-    if ( wm->flags & WINE_MODREF_MARKER )
-        return;
-
-    if ( wm->refCount <= 0 )
-        return;
-
-    --wm->refCount;
-    TRACE("(%s) refCount: %d\n", wm->modname, wm->refCount );
-
-    if ( wm->refCount == 0 )
-    {
-        wm->flags |= WINE_MODREF_MARKER;
-
-        for ( i = 0; i < wm->nDeps; i++ )
-            if ( wm->deps[i] )
-                MODULE_DecRefCount( wm->deps[i] );
-
-        wm->flags &= ~WINE_MODREF_MARKER;
-    }
-}
-
-/***********************************************************************
- *           GetProcAddress            (KERNEL32.257)
- */
-FARPROC WINAPI GetProcAddress( HMODULE hModule, LPCSTR function )
-{
-    return MODULE_GetProcAddress( hModule, function, TRUE );
-}
-
-#ifdef DEBUG_QTX_API
-
-/* 
-http://lists.apple.com/archives/quicktime-api/2003/Jan/msg00278.html
-*/
-
-struct ComponentParameters {
-    unsigned char                   flags;                      /* call modifiers: sync/async, deferred, immed, etc */
-    unsigned char                   paramSize;                  /* size in bytes of actual parameters passed to this call */
-    short                           what;                       /* routine selector, negative for Component management calls */
-    long                            params[1];                  /* actual parameters for the indicated routine */
-};
-typedef struct ComponentParameters      ComponentParameters;
-
-static char* component_func(int what){
-if (what < 0) // Range 0: Standard Component Calls
-switch(what){
-case -1: return "kComponentOpenSelect";
-case -2: return "kComponentCloseSelect";
-case -3: return "kComponentCanDoSelect";
-case -4: return "kComponentVersionSelect";
-case -5: return "kComponentRegisterSelect";
-case -6: return "kComponentTargetSelect";
-case -7: return "kComponentUnregisterSelect";
-}
-
-if (what >= 0 && what <= 0xff) // Range 1: Generic codecs
-switch(what & 0xff){
-case 0: return "kImageCodecGetCodecInfoSelect";
-case 1: return "kImageCodecGetCompressionTimeSelect";
-case 2: return "kImageCodecGetMaxCompressionSizeSelect";
-case 3: return "kImageCodecPreCompressSelect";
-case 4: return "kImageCodecBandCompressSelect";
-case 5: return "kImageCodecPreDecompressSelect";
-case 6: return "kImageCodecBandDecompressSelect";
-case 7: return "kImageCodecBusySelect";
-// finish this list from the above URL
-case 0x10: return "kImageCodecIsImageDescriptionEquivalentSelect";
-case 0x12: return "kImageCodecDisposeMemorySelect";
-case 0x14: return "kImageCodecNewImageBufferMemorySelect";
-case 0x28: return "kImageCodecRequestGammaLevelSelect";
-}
-
-//if (what >= 0x100 && what <= 0x1ff) // Range 2: Specific to QT Photo JPEG codecs
-
-if (what >= 0x200 && what <= 0x2ff) // Range 3: Base Decompressor
-switch(what & 0xff){
-case 0: return "Preflight";
-case 1: return "Initialize";
-case 2: return "BeginBand";
-case 3: return "DrawBand";
-case 4: return "EndBand";
-case 5: return "QueueStarting";
-case 6: return "QueueStopping";
-}
-
-return "???";
-}
-
-static int c_level=0;
-
-static int dump_component(char* name,int type,void* _orig, ComponentParameters *params,void** glob){
-    int ( *orig)(ComponentParameters *params, void** glob) = _orig;
-    int ret,i;
-
-    fprintf(stderr,"%*sComponentCall: %s  flags=0x%X  size=%d  what=0x%X %s\n",3*c_level,"",name,params->flags, params->paramSize, params->what, component_func(params->what));
-
-    for(i=0;i<params->paramSize/4;i++)
-       fprintf(stderr,"%*s param[%d] = 0x%X\n",3*c_level,"",i,params->params[i]);
-
-    ++c_level;
-    ret=orig(params,glob);
-    --c_level;
-    
-    if(ret>=0x1000)
-       fprintf(stderr,"%*s return=0x%X\n",3*c_level,"",ret);
-    else
-       fprintf(stderr,"%*s return=%d\n",3*c_level,"",ret);
-    return ret;
-}
-
-#define DECL_COMPONENT(sname,name,type) \
-    static void* real_ ## sname = NULL; \
-    static int fake_ ## sname(ComponentParameters *params,void** glob){ \
-       return dump_component(name,type,real_ ## sname, params, glob); \
-    }
-
-#include "qt_comp.h"
-
-#undef DECL_COMPONENT
-
-#include "qt_fv.h"
-
-#endif
-
-#ifdef EMU_QTX_API
-
-static uint32_t ret_array[4096];
-static int ret_i=0;
-
-static int report_func(void *stack_base, int stack_size, reg386_t *reg, uint32_t *flags)
-{
-#ifdef DEBUG_QTX_API
-  int i;
-  int* dptr;
-  void* pwrapper=NULL;
-  void* pptr=NULL;
-  char* pname=NULL;
-  int plen=-1;
-  // find the code:
-  
-  dptr=0x62b67ae0;dptr+=2*((reg->eax>>16)&255);
-//  printf("FUNC: flag=%d ptr=%p\n",dptr[0],dptr[1]);
-  if(dptr[0]&255){
-      dptr=dptr[1];dptr+=4*(reg->eax&65535);
-//      printf("FUNC: ptr2=%p  eax=%p  edx=%p\n",dptr[1],dptr[0],dptr[2]);
-      pwrapper=dptr[1]; pptr=dptr[0]; plen=dptr[2]; 
-  } else {
-      pwrapper=0x62924910;
-      switch(dptr[1]){
-      case 0x629248d0:
-          dptr=0x62b672c0;dptr+=2*(reg->eax&65535);
-//          printf("FUNC: ptr2=%p  eax=%p  edx=%p\n",0x62924910,dptr[0],dptr[1]);
-          pptr=dptr[0]; plen=dptr[1]; 
-         break;
-      case 0x62924e40:
-          dptr=0x62b67c70;dptr+=2*(reg->eax&65535);
-//          printf("FUNC: ptr2=%p  eax=%p  edx=%p\n",0x62924910,dptr[0],dptr[1]);
-          pptr=dptr[0]; plen=dptr[1]; 
-         break;
-      case 0x62924e60:
-          dptr=0x62b68108;if(reg->eax&0x8000) dptr+=2*(reg->eax|0xffff0000); else dptr+=2*(reg->eax&65535);
-//          printf("FUNC: ptr2=%p  eax=%p  edx=%p\n",0x62924910,dptr[0],dptr[1]);
-          pptr=dptr[0]; plen=dptr[1]; 
-         break;
-      case 0x62924e80:
-          dptr=0x62b68108;if(reg->eax&0x8000) dptr+=2*(reg->eax|0xffff0000); else dptr+=2*(reg->eax&65535);
-//          printf("FUNC: ptr2=%p  eax=%p  edx=%p\n",0x62924910,dptr[0],dptr[1]);
-          pptr=dptr[0]; plen=dptr[1]; 
-         break;
-      default:
-          printf("FUNC: unknown ptr & psize!\n");
-         pwrapper=dptr[1];
-      }
-  }
-
-  for(i=0;qt_fv_list[i].name;i++){
-          if(qt_fv_list[i].id==reg->eax){
-             pname=qt_fv_list[i].name;
-             break;
-         }
-  }
-
-  printf("FUNC[%X/%s]: wrapper=%p  func=%p  len=%d\n",reg->eax,
-      pname?pname:"???",pwrapper,pptr,plen);
-
-  printf("FUNC: caller=%p  ebx=%p\n",((uint32_t *)stack_base)[0],reg->ebx);
-
-  if(pname)
-      printf("%*sENTER(%d): %s(",ret_i*2,"",ret_i,pname);
-  else
-      printf("%*sENTER(%d): %X(",ret_i*2,"",ret_i,reg->eax);
-  for (i=0;i<plen/4;i++){
-    unsigned int val=((uint32_t *)stack_base)[1+i];
-    unsigned char* fcc=&val;
-    printf("%s0x%X", i?", ":"",val);
-    if(fcc[0]>=0x20 && fcc[0]<128 &&
-       fcc[1]>=0x20 && fcc[1]<128 &&
-       fcc[2]>=0x20 && fcc[2]<128 &&
-       fcc[3]>=0x20 && fcc[3]<128) printf("='%c%c%c%c'",fcc[3],fcc[2],fcc[1],fcc[0]);
-    else if(val>=8 && val<65536) printf("=%d",val);
-  }
-  printf(")\n");
-  fflush(stdout);
-
-#endif
-  
-#if 1
-  // emulate some functions:
-  switch(reg->eax){
-  // memory management:
-  case 0x150011: //NewPtrClear
-  case 0x150012: //NewPtrSysClear
-      reg->eax=(uint32_t)malloc(((uint32_t *)stack_base)[1]);
-      memset((void *)reg->eax,0,((uint32_t *)stack_base)[1]);
-#ifdef DEBUG_QTX_API
-      printf("%*sLEAVE(%d): EMULATED! 0x%X\n",ret_i*2,"",ret_i, reg->eax);
-#endif
-      return 1;
-  case 0x15000F: //NewPtr
-  case 0x150010: //NewPtrSys
-      reg->eax=(uint32_t)malloc(((uint32_t *)stack_base)[1]);
-#ifdef DEBUG_QTX_API
-      printf("%*sLEAVE(%d): EMULATED! 0x%X\n",ret_i*2,"",ret_i, reg->eax);
-#endif
-      return 1;
-  case 0x15002f: //DisposePtr
-      if(((uint32_t *)stack_base)[1]>=0x60000000)
-          printf("WARNING! Invalid Ptr handle!\n");
-      else
-          free((void *)((uint32_t *)stack_base)[1]);
-      reg->eax=0;
-#ifdef DEBUG_QTX_API
-      printf("%*sLEAVE(%d): EMULATED! 0x%X\n",ret_i*2,"",ret_i, reg->eax);
-#endif
-      return 1;
-  // mutexes:
-  case 0x1d0033: //QTMLCreateMutex
-      reg->eax=0xdeadbabe;
-#ifdef DEBUG_QTX_API
-      printf("%*sLEAVE(%d): EMULATED! 0x%X\n",ret_i*2,"",ret_i, reg->eax);
-#endif
-      return 1;
-  case 0x1d0034: //QTMLDestroyMutex
-  case 0x1d0035: //QTMLGrabMutex
-  case 0x1d0036: //QTMLReturnMutex
-  case 0x1d003d: //QTMLTryGrabMutex
-      reg->eax=0;
-#ifdef DEBUG_QTX_API
-      printf("%*sLEAVE(%d): EMULATED! 0x%X\n",ret_i*2,"",ret_i, reg->eax);
-#endif
-      return 1;
-  }
-#endif
-
-#if 0
-  switch(reg->eax){
-//  case 0x00010000:
-//      printf("FUNC: ImageCodecInitialize/ImageCodecGetCodecInfo(ci=%p,&icap=%p)\n",((uint32_t *)stack_base)[1],((uint32_t *)stack_base)[4]);
-//      break;
-  case 0x00010003:
-      printf("FUNC: CountComponents(&desc=%p)\n",((uint32_t *)stack_base)[1]);
-      break;
-  case 0x00010004:
-      printf("FUNC: FindNextComponent(prev=%p,&desc=%p)\n",((uint32_t *)stack_base)[1],((uint32_t *)stack_base)[2]);
-      break;
-  case 0x00010007:
-      printf("FUNC: OpenComponent(prev=%p)\n",((uint32_t *)stack_base)[1]);
-      break;
-  case 0x0003008b:
-      printf("FUNC: QTNewGWorldFromPtr(&pts=%p,fourcc=%.4s,&rect=%p,x1=%p,x2=%p,x3=%p,plane=%p,stride=%d)\n",
-          ((uint32_t *)stack_base)[1],
-          &(((uint32_t *)stack_base)[2]),
-          ((uint32_t *)stack_base)[3],
-          ((uint32_t *)stack_base)[4],
-          ((uint32_t *)stack_base)[5],
-          ((uint32_t *)stack_base)[6],
-          ((uint32_t *)stack_base)[7],
-          ((uint32_t *)stack_base)[8]);
-      break;
-  case 0x001c0018:
-      printf("FUNC: GetGWorldPixMap(gworld=%p)\n",((uint32_t *)stack_base)[1]);
-      break;
-  case 0x00110001:
-      printf("FUNC: Gestalt(fourcc=%.4s, &ret=%p)\n",&(((uint32_t *)stack_base)[1]),((uint32_t *)stack_base)[2]);
-      break;
-  default: {
-      int i;
-      for(i=0;qt_fv_list[i].name;i++){
-          if(qt_fv_list[i].id==reg->eax){
-             printf("FUNC: %s\n",qt_fv_list[i].name);
-             break;
-         }
-      }
-      }
-  }
-
-  // print stack/reg information 
-  printf("ENTER(%d) stack = %d bytes @ %p\n"
-        "eax = 0x%08x edx = 0x%08x ebx = 0x%08x ecx = 0x%08x\n"
-        "esp = 0x%08x ebp = 0x%08x esi = 0x%08x edi = 0x%08x\n"
-        "flags = 0x%08x\n", ret_i,
-        stack_size, stack_base,
-        reg->eax, reg->edx, reg->ebx, reg->ecx,
-        reg->esp, reg->ebp, reg->esi, reg->edi,
-        *flags);
-#endif
-
-  // save ret addr:
-  ret_array[ret_i]=((uint32_t *)stack_base)[0];
-  ++ret_i;
-
-#if 0
-  // print first 7 longs in the stack (return address, arg[1], arg[2] ... ) 
-  printf("stack[] = { ");
-  for (i=0;i<7;i++) {
-    printf("%08x ", ((uint32_t *)stack_base)[i]);
-  }
-  printf("}\n\n");
-#endif
-  
-//  // mess with function parameters 
-//  ((uint32_t *)stack_base)[1] = 0x66554433;
-
-//  // mess with return address...
-//  reg->eax = 0x11223344;
-    return 0;
-}
-
-static int report_func_ret(void *stack_base, int stack_size, reg386_t *reg, uint32_t *flags)
-{
-  int i;
-  short err;
-
-  // restore ret addr:
-  --ret_i;
-  ((uint32_t *)stack_base)[0]=ret_array[ret_i];
-
-#ifdef DEBUG_QTX_API
-
-#if 1
-  printf("%*sLEAVE(%d): 0x%X",ret_i*2,"",ret_i, reg->eax);
-  err=reg->eax;
-  if(err && (reg->eax>>16)==0) printf(" = %d",err);
-  printf("\n");
-  fflush(stdout);
-#else
-  // print stack/reg information 
-  printf("LEAVE(%d) stack = %d bytes @ %p\n"
-        "eax = 0x%08x edx = 0x%08x ebx = 0x%08x ecx = 0x%08x\n"
-        "esp = 0x%08x ebp = 0x%08x esi = 0x%08x edi = 0x%08x\n"
-        "flags = 0x%08x\n", ret_i,
-        stack_size, stack_base,
-        reg->eax, reg->edx, reg->ebx, reg->ecx,
-        reg->esp, reg->ebp, reg->esi, reg->edi,
-        *flags);
-#endif
-
-#if 0
-  // print first 7 longs in the stack (return address, arg[1], arg[2] ... ) 
-  printf("stack[] = { ");
-  for (i=0;i<7;i++) {
-    printf("%08x ", ((uint32_t *)stack_base)[i]);
-  }
-  printf("}\n\n");
-#endif
-
-#endif
-  
-//  // mess with function parameters 
-//  ((uint32_t *)stack_base)[1] = 0x66554433;
-
-//  // mess with return address...
-//  reg->eax = 0x11223344;
-    return 0;
-}
-
-#endif
-
-/***********************************************************************
- *           MODULE_GetProcAddress             (internal)
- */
-FARPROC MODULE_GetProcAddress(
-       HMODULE hModule,        /* [in] current module handle */
-       LPCSTR function,        /* [in] function to be looked up */
-       WIN_BOOL snoop )
-{
-    WINE_MODREF        *wm = MODULE32_LookupHMODULE( hModule );
-//    WINE_MODREF *wm=local_wm;
-    FARPROC    retproc;
-
-#ifdef DEBUG_QTX_API
-    if (HIWORD(function))
-       fprintf(stderr,"XXX GetProcAddress(%08lx,%s)\n",(DWORD)hModule,function);
-    else
-       fprintf(stderr,"XXX GetProcAddress(%08lx,%p)\n",(DWORD)hModule,function);
-#endif
-
-//     TRACE_(win32)("(%08lx,%s)\n",(DWORD)hModule,function);
-//    else
-//     TRACE_(win32)("(%08lx,%p)\n",(DWORD)hModule,function);
-
-    if (!wm) {
-       SetLastError(ERROR_INVALID_HANDLE);
-        return (FARPROC)0;
-    }
-    switch (wm->type)
-    {
-    case MODULE32_PE:
-       retproc = PE_FindExportedFunction( wm, function, snoop );
-       if (!retproc) SetLastError(ERROR_PROC_NOT_FOUND);
-       break;
-#ifdef HAVE_LIBDL
-    case MODULE32_ELF:
-       retproc = (FARPROC) dlsym( (void*) wm->module, function);
-       if (!retproc) SetLastError(ERROR_PROC_NOT_FOUND);
-       return retproc;
-#endif
-    default:
-       ERR("wine_modref type %d not handled.\n",wm->type);
-       SetLastError(ERROR_INVALID_HANDLE);
-       return (FARPROC)0;
-    }
-
-#ifdef EMU_QTX_API
-    if (HIWORD(function) && retproc){
-
-#ifdef DEBUG_QTX_API
-#define DECL_COMPONENT(sname,name,type) \
-    if(!strcmp(function,name)){ \
-       fprintf(stderr,name "dispatcher catched -> %p\n",retproc); \
-       real_ ## sname = retproc; retproc = fake_ ## sname; \
-    }
-#include "qt_comp.h"
-#undef DECL_COMPONENT
-#endif
-
-    if(!strcmp(function,"theQuickTimeDispatcher")
-//      || !strcmp(function,"_CallComponentFunctionWithStorage")
-//      || !strcmp(function,"_CallComponent")
-      ){
-       fprintf(stderr,"theQuickTimeDispatcher catched -> %p\n",retproc);
-      report_entry = report_func;
-      report_ret   = report_func_ret;
-      wrapper_target=(void(*)(void))retproc;
-      retproc=(FARPROC)wrapper;
-    }
-
-    }
-#endif
-
-    return retproc;
-}
-
-static int acounter = 0;
-void CodecAlloc(void)
-{
-    acounter++;
-    //printf("**************CODEC ALLOC %d\n", acounter);
-}
-
-void CodecRelease(void)
-{
-    acounter--;
-    //printf("**************CODEC RELEASE %d\n", acounter);
-    if (acounter == 0)
-    {
-       for (;;)
-       {
-           modref_list* list = local_wm;
-           if (!local_wm)
-               break;
-           //printf("CODECRELEASE %p\n", list);
-            MODULE_FreeLibrary(list->wm);
-           MODULE_RemoveFromList(list->wm);
-            if (local_wm == NULL)
-               my_garbagecollection();
-       }
-    }
-}
diff --git a/modules/codec/loader/pe_image.c b/modules/codec/loader/pe_image.c
deleted file mode 100644 (file)
index 8c6f542..0000000
+++ /dev/null
@@ -1,980 +0,0 @@
-/*
- * $Id$
- *
- *  Copyright  1994    Eric Youndale & Erik Bos
- *  Copyright  1995    Martin von Löwis
- *  Copyright   1996-98 Marcus Meissner
- *
- *     based on Eric Youndale's pe-test and:
- *
- *     ftp.microsoft.com:/pub/developer/MSDN/CD8/PEFILE.ZIP
- * make that:
- *     ftp.microsoft.com:/developr/MSDN/OctCD/PEFILE.ZIP
- *
- * Modified for use with MPlayer, detailed CVS changelog at
- * http://www.mplayerhq.hu/cgi-bin/cvsweb.cgi/main/
- *
- * File now distributed as part of VLC media player with no modifications.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
- */
-/* Notes:
- * Before you start changing something in this file be aware of the following:
- *
- * - There are several functions called recursively. In a very subtle and 
- *   obscure way. DLLs can reference each other recursively etc.
- * - If you want to enhance, speed up or clean up something in here, think
- *   twice WHY it is implemented in that strange way. There is usually a reason.
- *   Though sometimes it might just be lazyness ;)
- * - In PE_MapImage, right before fixup_imports() all external and internal 
- *   state MUST be correct since this function can be called with the SAME image
- *   AGAIN. (Thats recursion for you.) That means MODREF.module and
- *   NE_MODULE.module32.
- * - Sometimes, we can't use Linux mmap() to mmap() the images directly.
- *
- *   The problem is, that there is not direct 1:1 mapping from a diskimage and
- *   a memoryimage. The headers at the start are mapped linear, but the sections
- *   are not. Older x86 pe binaries are 512 byte aligned in file and 4096 byte
- *   aligned in memory. Linux likes them 4096 byte aligned in memory (due to
- *   x86 pagesize, this cannot be fixed without a rather large kernel rewrite)
- *   and 'blocksize' file-aligned (offsets). Since we have 512/1024/2048 (CDROM)
- *   and other byte blocksizes, we can't always do this.  We *can* do this for
- *   newer pe binaries produced by MSVC 5 and later, since they are also aligned
- *   to 4096 byte boundaries on disk.
- */
-#include "config.h"
-
-#include <errno.h>
-#include <assert.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#ifdef HAVE_SYS_MMAN_H
-#include <sys/mman.h>
-#endif
-#include "wine/windef.h"
-#include "wine/winbase.h"
-#include "wine/winerror.h"
-#include "wine/heap.h"
-#include "wine/pe_image.h"
-#include "wine/module.h"
-#include "wine/debugtools.h"
-#include "ext.h"
-#include "win32.h"
-
-#define RVA(x) ((void *)((char *)load_addr+(unsigned int)(x)))
-
-#define AdjustPtr(ptr,delta) ((char *)(ptr) + (delta))
-
-extern void* LookupExternal(const char* library, int ordinal);
-extern void* LookupExternalByName(const char* library, const char* name);
-
-static void dump_exports( HMODULE hModule )
-{ 
-  char         *Module;
-  unsigned int i, j;
-  u_short      *ordinal;
-  u_long       *function,*functions;
-  u_char       **name;
-  unsigned int load_addr = hModule;
-
-  DWORD rva_start = PE_HEADER(hModule)->OptionalHeader
-                   .DataDirectory[IMAGE_DIRECTORY_ENTRY_EXPORT].VirtualAddress;
-  DWORD rva_end = rva_start + PE_HEADER(hModule)->OptionalHeader
-                   .DataDirectory[IMAGE_DIRECTORY_ENTRY_EXPORT].Size;
-  IMAGE_EXPORT_DIRECTORY *pe_exports = (IMAGE_EXPORT_DIRECTORY*)RVA(rva_start);
-
-  Module = (char*)RVA(pe_exports->Name);
-  TRACE("*******EXPORT DATA*******\n");
-  TRACE("Module name is %s, %ld functions, %ld names\n", 
-        Module, pe_exports->NumberOfFunctions, pe_exports->NumberOfNames);
-
-  ordinal=(u_short*) RVA(pe_exports->AddressOfNameOrdinals);
-  functions=function=(u_long*) RVA(pe_exports->AddressOfFunctions);
-  name=(u_char**) RVA(pe_exports->AddressOfNames);
-
-  TRACE(" Ord    RVA     Addr   Name\n" );
-  for (i=0;i<pe_exports->NumberOfFunctions;i++, function++)
-  {
-      if (!*function) continue;  
-      if (TRACE_ON(win32))
-      {
-       DPRINTF( "%4ld %08lx %p", i + pe_exports->Base, *function, RVA(*function) );
-       
-       for (j = 0; j < pe_exports->NumberOfNames; j++)
-          if (ordinal[j] == i)
-          {
-              DPRINTF( "  %s", (char*)RVA(name[j]) );
-              break;
-          }
-       if ((*function >= rva_start) && (*function <= rva_end))
-         DPRINTF(" (forwarded -> %s)", (char *)RVA(*function));
-       DPRINTF("\n");
-      }
-  }
-}
-
-/* Look up the specified function or ordinal in the exportlist:
- * If it is a string:
- *     - look up the name in the Name list. 
- *     - look up the ordinal with that index.
- *     - use the ordinal as offset into the functionlist
- * If it is a ordinal:
- *     - use ordinal-pe_export->Base as offset into the functionlist
- */
-FARPROC PE_FindExportedFunction( 
-       WINE_MODREF *wm,        
-       LPCSTR funcName,        
-        WIN_BOOL snoop )
-{
-       u_short                         * ordinals;
-       u_long                          * function;
-       u_char                          ** name;
-       const char *ename = NULL;
-       int                             i, ordinal;
-       PE_MODREF                       *pem = &(wm->binfmt.pe);
-       IMAGE_EXPORT_DIRECTORY          *exports = pem->pe_export;
-       unsigned int                    load_addr = wm->module;
-       u_long                          rva_start, rva_end, addr;
-       char                            * forward;
-
-       if (HIWORD(funcName))
-               TRACE("(%s)\n",funcName);
-       else
-               TRACE("(%d)\n",(int)funcName);
-       if (!exports) {
-               /* Not a fatal problem, some apps do
-                * GetProcAddress(0,"RegisterPenApp") which triggers this
-                * case.
-                */
-               WARN("Module %08x(%s)/MODREF %p doesn't have a exports table.\n",wm->module,wm->modname,pem);
-               return NULL;
-       }
-       ordinals= (u_short*)  RVA(exports->AddressOfNameOrdinals);
-       function= (u_long*)   RVA(exports->AddressOfFunctions);
-       name    = (u_char **) RVA(exports->AddressOfNames);
-       forward = NULL;
-       rva_start = PE_HEADER(wm->module)->OptionalHeader
-               .DataDirectory[IMAGE_DIRECTORY_ENTRY_EXPORT].VirtualAddress;
-       rva_end = rva_start + PE_HEADER(wm->module)->OptionalHeader
-               .DataDirectory[IMAGE_DIRECTORY_ENTRY_EXPORT].Size;
-
-       if (HIWORD(funcName))
-        {
-            
-            int min = 0, max = exports->NumberOfNames - 1;
-            while (min <= max)
-            {
-                int res, pos = (min + max) / 2;
-               ename = (const char*) RVA(name[pos]);
-               if (!(res = strcmp( ename, funcName )))
-                {
-                    ordinal = ordinals[pos];
-                    goto found;
-                }
-                if (res > 0) max = pos - 1;
-                else min = pos + 1;
-            }
-            
-           for (i = 0; i < exports->NumberOfNames; i++)
-            {
-               ename = (const char*) RVA(name[i]);
-                if (!strcmp( ename, funcName ))
-                {
-                   ERR( "%s.%s required a linear search\n", wm->modname, funcName );
-                    ordinal = ordinals[i];
-                    goto found;
-                }
-            }
-            return NULL;
-       }
-        else  
-        {
-            ordinal = LOWORD(funcName) - exports->Base;
-            if (snoop && name)  
-            {
-                for (i = 0; i < exports->NumberOfNames; i++)
-                    if (ordinals[i] == ordinal)
-                    {
-                        ename = RVA(name[i]);
-                        break;
-                    }
-            }
-       }
-
- found:
-        if (ordinal >= exports->NumberOfFunctions)
-        {
-            TRACE("    ordinal %ld out of range!\n", ordinal + exports->Base );
-            return NULL;
-        }
-        addr = function[ordinal];
-        if (!addr) return NULL;
-        if ((addr < rva_start) || (addr >= rva_end))
-        {
-            FARPROC proc = RVA(addr);
-            if (snoop)
-            {
-                if (!ename) ename = "@";
-//                proc = SNOOP_GetProcAddress(wm->module,ename,ordinal,proc);
-               TRACE("SNOOP_GetProcAddress n/a\n");
-               
-            }
-            return proc;
-        }
-        else  
-        {
-                WINE_MODREF *wm;
-                char *forward = RVA(addr);
-               char module[256];
-               char *end = strchr(forward, '.');
-
-               if (!end) return NULL;
-                if (end - forward >= sizeof(module)) return NULL;
-                memcpy( module, forward, end - forward );
-               module[end-forward] = 0;
-                if (!(wm = MODULE_FindModule( module )))
-                {
-                    ERR("module not found for forward '%s'\n", forward );
-                    return NULL;
-                }
-               return MODULE_GetProcAddress( wm->module, end + 1, snoop );
-       }
-}
-
-static DWORD fixup_imports( WINE_MODREF *wm )
-{
-    IMAGE_IMPORT_DESCRIPTOR    *pe_imp;
-    PE_MODREF                  *pem;
-    unsigned int load_addr     = wm->module;
-    int                                i,characteristics_detection=1;
-    char                       *modname;
-    
-    assert(wm->type==MODULE32_PE);
-    pem = &(wm->binfmt.pe);
-    if (pem->pe_export)
-       modname = (char*) RVA(pem->pe_export->Name);
-    else
-        modname = "<unknown>";
-
-    
-    TRACE("Dumping imports list\n");
-
-    
-    pe_imp = pem->pe_import;
-    if (!pe_imp) return 0;
-
-    /* We assume that we have at least one import with !0 characteristics and
-     * detect broken imports with all characteristsics 0 (notably Borland) and
-     * switch the detection off for them.
-     */
-    for (i = 0; pe_imp->Name ; pe_imp++) {
-       if (!i && !pe_imp->u.Characteristics)
-               characteristics_detection = 0;
-       if (characteristics_detection && !pe_imp->u.Characteristics)
-               break;
-       i++;
-    }
-    if (!i) return 0;  
-
-    
-    wm->nDeps = i;
-    wm->deps  = HeapAlloc( GetProcessHeap(), 0, i*sizeof(WINE_MODREF *) );
-
-    /* load the imported modules. They are automatically 
-     * added to the modref list of the process.
-     */
-    for (i = 0, pe_imp = pem->pe_import; pe_imp->Name ; pe_imp++) {
-       IMAGE_IMPORT_BY_NAME    *pe_name;
-       PIMAGE_THUNK_DATA       import_list,thunk_list;
-       char                    *name = (char *) RVA(pe_imp->Name);
-
-       if (characteristics_detection && !pe_imp->u.Characteristics)
-               break;
-
-//#warning FIXME: here we should fill imports
-        TRACE("Loading imports for %s.dll\n", name);
-    
-       if (pe_imp->u.OriginalFirstThunk != 0) { 
-           TRACE("Microsoft style imports used\n");
-           import_list =(PIMAGE_THUNK_DATA) RVA(pe_imp->u.OriginalFirstThunk);
-           thunk_list = (PIMAGE_THUNK_DATA) RVA(pe_imp->FirstThunk);
-
-           while (import_list->u1.Ordinal) {
-               if (IMAGE_SNAP_BY_ORDINAL(import_list->u1.Ordinal)) {
-                   int ordinal = IMAGE_ORDINAL(import_list->u1.Ordinal);
-
-//                 TRACE("--- Ordinal %s,%d\n", name, ordinal);
-                   
-                   thunk_list->u1.Function=LookupExternal(name, ordinal);
-               } else {                
-                   pe_name = (PIMAGE_IMPORT_BY_NAME)RVA(import_list->u1.AddressOfData);
-//                 TRACE("--- %s %s.%d\n", pe_name->Name, name, pe_name->Hint);
-                   thunk_list->u1.Function=LookupExternalByName(name, pe_name->Name);
-               }
-               import_list++;
-               thunk_list++;
-           }
-       } else {        
-           TRACE("Borland style imports used\n");
-           thunk_list = (PIMAGE_THUNK_DATA) RVA(pe_imp->FirstThunk);
-           while (thunk_list->u1.Ordinal) {
-               if (IMAGE_SNAP_BY_ORDINAL(thunk_list->u1.Ordinal)) {
-                   
-                   int ordinal = IMAGE_ORDINAL(thunk_list->u1.Ordinal);
-
-                   TRACE("--- Ordinal %s.%d\n",name,ordinal);
-                   thunk_list->u1.Function=LookupExternal(
-                     name, ordinal);
-               } else {
-                   pe_name=(PIMAGE_IMPORT_BY_NAME) RVA(thunk_list->u1.AddressOfData);
-                   TRACE("--- %s %s.%d\n",
-                                 pe_name->Name,name,pe_name->Hint);
-                   thunk_list->u1.Function=LookupExternalByName(
-                     name, pe_name->Name);
-               }
-               thunk_list++;
-           }
-       }
-    }
-    return 0;
-}
-
-static int calc_vma_size( HMODULE hModule )
-{
-    int i,vma_size = 0;
-    IMAGE_SECTION_HEADER *pe_seg = PE_SECTIONS(hModule);
-
-    TRACE("Dump of segment table\n");
-    TRACE("   Name    VSz  Vaddr     SzRaw   Fileadr  *Reloc *Lineum #Reloc #Linum Char\n");
-    for (i = 0; i< PE_HEADER(hModule)->FileHeader.NumberOfSections; i++)
-    {
-        TRACE("%8s: %4.4lx %8.8lx %8.8lx %8.8lx %8.8lx %8.8lx %4.4x %4.4x %8.8lx\n", 
-                      pe_seg->Name, 
-                      pe_seg->Misc.VirtualSize,
-                      pe_seg->VirtualAddress,
-                      pe_seg->SizeOfRawData,
-                      pe_seg->PointerToRawData,
-                      pe_seg->PointerToRelocations,
-                      pe_seg->PointerToLinenumbers,
-                      pe_seg->NumberOfRelocations,
-                      pe_seg->NumberOfLinenumbers,
-                      pe_seg->Characteristics);
-        vma_size=max(vma_size, pe_seg->VirtualAddress+pe_seg->SizeOfRawData);
-        vma_size=max(vma_size, pe_seg->VirtualAddress+pe_seg->Misc.VirtualSize);
-        pe_seg++;
-    }
-    return vma_size;
-}
-
-static void do_relocations( unsigned int load_addr, IMAGE_BASE_RELOCATION *r )
-{
-    int delta = load_addr - PE_HEADER(load_addr)->OptionalHeader.ImageBase;
-    int        hdelta = (delta >> 16) & 0xFFFF;
-    int        ldelta = delta & 0xFFFF;
-
-       if(delta == 0)
-               
-               return;
-       while(r->VirtualAddress)
-       {
-               char *page = (char*) RVA(r->VirtualAddress);
-               int count = (r->SizeOfBlock - 8)/2;
-               int i;
-               TRACE_(fixup)("%x relocations for page %lx\n",
-                       count, r->VirtualAddress);
-               
-               for(i=0;i<count;i++)
-               {
-                       int offset = r->TypeOffset[i] & 0xFFF;
-                       int type = r->TypeOffset[i] >> 12;
-//                     TRACE_(fixup)("patching %x type %x\n", offset, type);
-                       switch(type)
-                       {
-                       case IMAGE_REL_BASED_ABSOLUTE: break;
-                       case IMAGE_REL_BASED_HIGH:
-                               *(short*)(page+offset) += hdelta;
-                               break;
-                       case IMAGE_REL_BASED_LOW:
-                               *(short*)(page+offset) += ldelta;
-                               break;
-                       case IMAGE_REL_BASED_HIGHLOW:
-                               *(int*)(page+offset) += delta;
-                               
-                               break;
-                       case IMAGE_REL_BASED_HIGHADJ:
-                               FIXME("Don't know what to do with IMAGE_REL_BASED_HIGHADJ\n");
-                               break;
-                       case IMAGE_REL_BASED_MIPS_JMPADDR:
-                               FIXME("Is this a MIPS machine ???\n");
-                               break;
-                       default:
-                               FIXME("Unknown fixup type\n");
-                               break;
-                       }
-               }
-               r = (IMAGE_BASE_RELOCATION*)((char*)r + r->SizeOfBlock);
-       }
-}
-               
-
-       
-       
-
-/**********************************************************************
- *                     PE_LoadImage
- * Load one PE format DLL/EXE into memory
- * 
- * Unluckily we can't just mmap the sections where we want them, for 
- * (at least) Linux does only support offsets which are page-aligned.
- *
- * BUT we have to map the whole image anyway, for Win32 programs sometimes
- * want to access them. (HMODULE32 point to the start of it)
- */
-HMODULE PE_LoadImage( int handle, LPCSTR filename, WORD *version )
-{
-    (void)filename;
-    HMODULE    hModule;
-    HANDLE     mapping;
-
-    IMAGE_NT_HEADERS *nt;
-    IMAGE_SECTION_HEADER *pe_sec;
-    IMAGE_DATA_DIRECTORY *dir;
-    int        i, rawsize, lowest_va, vma_size, file_size = 0;
-    DWORD load_addr = 0, aoep, reloc = 0;
-//    struct get_read_fd_request *req = get_req_buffer();
-    int unix_handle = handle;
-    int page_size = getpagesize();
-
-    
-//    if ( GetFileInformationByHandle( hFile, &bhfi ) ) 
-//     file_size = bhfi.nFileSizeLow; 
-    file_size=lseek(handle, 0, SEEK_END);
-    lseek(handle, 0, SEEK_SET);
-
-//#warning fix CreateFileMappingA
-    mapping = CreateFileMappingA( handle, NULL, PAGE_READONLY | SEC_COMMIT,
-                                    0, 0, NULL );
-    if (!mapping)
-    {
-        WARN("CreateFileMapping error %ld\n", GetLastError() );
-        return 0;
-    }
-//    hModule = (HMODULE)MapViewOfFile( mapping, FILE_MAP_READ, 0, 0, 0 );
-    hModule=(HMODULE)mapping;
-//    CloseHandle( mapping );
-    if (!hModule)
-    {
-        WARN("MapViewOfFile error %ld\n", GetLastError() );
-        return 0;
-    }
-    if ( *(WORD*)hModule !=IMAGE_DOS_SIGNATURE)
-    {
-        WARN("%s image doesn't have DOS signature, but 0x%04x\n", filename,*(WORD*)hModule);
-        goto error;
-    }
-
-    nt = PE_HEADER( hModule );
-
-    
-    if ( nt->Signature != IMAGE_NT_SIGNATURE )
-    {
-        WARN("%s image doesn't have PE signature, but 0x%08lx\n", filename, nt->Signature );
-        goto error;
-    }
-
-    
-    if ( nt->FileHeader.Machine != IMAGE_FILE_MACHINE_I386 )
-    {
-        MESSAGE("Trying to load PE image for unsupported architecture (");
-        switch (nt->FileHeader.Machine)
-        {
-        case IMAGE_FILE_MACHINE_UNKNOWN: MESSAGE("Unknown"); break;
-        case IMAGE_FILE_MACHINE_I860:    MESSAGE("I860"); break;
-        case IMAGE_FILE_MACHINE_R3000:   MESSAGE("R3000"); break;
-        case IMAGE_FILE_MACHINE_R4000:   MESSAGE("R4000"); break;
-        case IMAGE_FILE_MACHINE_R10000:  MESSAGE("R10000"); break;
-        case IMAGE_FILE_MACHINE_ALPHA:   MESSAGE("Alpha"); break;
-        case IMAGE_FILE_MACHINE_POWERPC: MESSAGE("PowerPC"); break;
-        default: MESSAGE("Unknown-%04x", nt->FileHeader.Machine); break;
-        }
-        MESSAGE(")\n");
-        goto error;
-    }
-
-    
-    pe_sec = PE_SECTIONS( hModule );
-    rawsize = 0; lowest_va = 0x10000;
-    for (i = 0; i < nt->FileHeader.NumberOfSections; i++) 
-    {
-        if (lowest_va > pe_sec[i].VirtualAddress)
-           lowest_va = pe_sec[i].VirtualAddress;
-       if (pe_sec[i].Characteristics & IMAGE_SCN_CNT_UNINITIALIZED_DATA)
-           continue;
-       if (pe_sec[i].PointerToRawData+pe_sec[i].SizeOfRawData > rawsize)
-           rawsize = pe_sec[i].PointerToRawData+pe_sec[i].SizeOfRawData;
-    }
-    
-    if ( file_size && file_size < rawsize )
-    {
-        ERR("PE module is too small (header: %d, filesize: %d), "
-                    "probably truncated download?\n", 
-                    rawsize, file_size );
-        goto error;
-    }
-
-    
-    aoep = nt->OptionalHeader.AddressOfEntryPoint;
-    if (aoep && (aoep < lowest_va))
-        FIXME("VIRUS WARNING: '%s' has an invalid entrypoint (0x%08lx) "
-                      "below the first virtual address (0x%08x) "
-                      "(possibly infected by Tchernobyl/SpaceFiller virus)!\n",
-                       filename, aoep, lowest_va );
-
-
-    /* FIXME:  Hack!  While we don't really support shared sections yet,
-     *         this checks for those special cases where the whole DLL
-     *         consists only of shared sections and is mapped into the
-     *         shared address space > 2GB.  In this case, we assume that
-     *         the module got mapped at its base address. Thus we simply
-     *         check whether the module has actually been mapped there
-     *         and use it, if so.  This is needed to get Win95 USER32.DLL
-     *         to work (until we support shared sections properly).
-     */
-
-    if ( nt->OptionalHeader.ImageBase & 0x80000000 )
-    {
-        HMODULE sharedMod = (HMODULE)nt->OptionalHeader.ImageBase; 
-        IMAGE_NT_HEADERS *sharedNt = (PIMAGE_NT_HEADERS)
-               ( (LPBYTE)sharedMod + ((LPBYTE)nt - (LPBYTE)hModule) );
-
-        /* Well, this check is not really comprehensive, 
-           but should be good enough for now ... */
-        if (    !IsBadReadPtr( (LPBYTE)sharedMod, sizeof(IMAGE_DOS_HEADER) )
-             && memcmp( (LPBYTE)sharedMod, (LPBYTE)hModule, sizeof(IMAGE_DOS_HEADER) ) == 0
-             && !IsBadReadPtr( sharedNt, sizeof(IMAGE_NT_HEADERS) )
-             && memcmp( sharedNt, nt, sizeof(IMAGE_NT_HEADERS) ) == 0 )
-        {
-            UnmapViewOfFile( (LPVOID)hModule );
-            return sharedMod;
-        }
-    }
-
-
-    
-    load_addr = nt->OptionalHeader.ImageBase;
-    vma_size = calc_vma_size( hModule );
-
-    load_addr = (DWORD)VirtualAlloc( (void*)load_addr, vma_size,
-                                     MEM_RESERVE | MEM_COMMIT,
-                                     PAGE_EXECUTE_READWRITE );
-    if (load_addr == 0) 
-    {
-        
-        FIXME("We need to perform base relocations for %s\n", filename);
-       dir = nt->OptionalHeader.DataDirectory+IMAGE_DIRECTORY_ENTRY_BASERELOC;
-        if (dir->Size)
-            reloc = dir->VirtualAddress;
-        else 
-        {
-            FIXME( "FATAL: Need to relocate %s, but no relocation records present (%s). Try to run that file directly !\n",
-                   filename,
-                   (nt->FileHeader.Characteristics&IMAGE_FILE_RELOCS_STRIPPED)?
-                   "stripped during link" : "unknown reason" );
-            goto error;
-        }
-
-        /* FIXME: If we need to relocate a system DLL (base > 2GB) we should
-         *        really make sure that the *new* base address is also > 2GB.
-         *        Some DLLs really check the MSB of the module handle :-/
-         */
-        if ( nt->OptionalHeader.ImageBase & 0x80000000 )
-            ERR( "Forced to relocate system DLL (base > 2GB). This is not good.\n" );
-
-        load_addr = (DWORD)VirtualAlloc( NULL, vma_size,
-                                        MEM_RESERVE | MEM_COMMIT,
-                                        PAGE_EXECUTE_READWRITE );
-       if (!load_addr) {
-            FIXME_(win32)(
-                   "FATAL: Couldn't load module %s (out of memory, %d needed)!\n", filename, vma_size);
-            goto error;
-       }
-    }
-
-    TRACE("Load addr is %lx (base %lx), range %x\n",
-          load_addr, nt->OptionalHeader.ImageBase, vma_size );
-    TRACE_(segment)("Loading %s at %lx, range %x\n",
-                    filename, load_addr, vma_size );
-
-#if 0
-    
-    *(PIMAGE_DOS_HEADER)load_addr = *(PIMAGE_DOS_HEADER)hModule;
-    *PE_HEADER( load_addr ) = *nt;
-    memcpy( PE_SECTIONS(load_addr), PE_SECTIONS(hModule),
-            sizeof(IMAGE_SECTION_HEADER) * nt->FileHeader.NumberOfSections );
-
-    
-    memcpy( load_addr, hModule, lowest_fa );
-#endif
-
-    if ((void*)FILE_dommap( handle, (void *)load_addr, 0, nt->OptionalHeader.SizeOfHeaders,
-                     0, 0, PROT_EXEC | PROT_WRITE | PROT_READ,
-                     MAP_PRIVATE | MAP_FIXED ) != (void*)load_addr)
-    {
-        ERR_(win32)( "Critical Error: failed to map PE header to necessary address.\n");       
-        goto error;
-    }
-
-    
-    pe_sec = PE_SECTIONS( hModule );
-    for (i = 0; i < nt->FileHeader.NumberOfSections; i++, pe_sec++)
-    {
-        if (!pe_sec->SizeOfRawData || !pe_sec->PointerToRawData) continue;
-        TRACE("%s: mmaping section %s at %p off %lx size %lx/%lx\n",
-              filename, pe_sec->Name, (void*)RVA(pe_sec->VirtualAddress),
-              pe_sec->PointerToRawData, pe_sec->SizeOfRawData, pe_sec->Misc.VirtualSize );
-        if ((void*)FILE_dommap( unix_handle, (void*)RVA(pe_sec->VirtualAddress),
-                         0, pe_sec->SizeOfRawData, 0, pe_sec->PointerToRawData,
-                         PROT_EXEC | PROT_WRITE | PROT_READ,
-                         MAP_PRIVATE | MAP_FIXED ) != (void*)RVA(pe_sec->VirtualAddress))
-        {
-            
-            ERR_(win32)( "Critical Error: failed to map PE section to necessary address.\n");
-            goto error;
-        }
-        if ((pe_sec->SizeOfRawData < pe_sec->Misc.VirtualSize) &&
-            (pe_sec->SizeOfRawData & (page_size-1)))
-        {
-            DWORD end = (pe_sec->SizeOfRawData & ~(page_size-1)) + page_size;
-            if (end > pe_sec->Misc.VirtualSize) end = pe_sec->Misc.VirtualSize;
-            TRACE("clearing %p - %p\n",
-                  RVA(pe_sec->VirtualAddress) + pe_sec->SizeOfRawData,
-                  RVA(pe_sec->VirtualAddress) + end );
-            memset( (char*)RVA(pe_sec->VirtualAddress) + pe_sec->SizeOfRawData, 0,
-                    end - pe_sec->SizeOfRawData );
-        }
-    }
-
-    
-    if ( reloc )
-        do_relocations( load_addr, (IMAGE_BASE_RELOCATION *)RVA(reloc) );
-
-    
-    *version =   ( (nt->OptionalHeader.MajorSubsystemVersion & 0xff) << 8 )
-               |   (nt->OptionalHeader.MinorSubsystemVersion & 0xff);
-
-    
-    UnmapViewOfFile( (LPVOID)hModule );
-    return (HMODULE)load_addr;
-
-error:
-    if (unix_handle != -1) close( unix_handle );
-    if (load_addr) 
-    VirtualFree( (LPVOID)load_addr, 0, MEM_RELEASE );
-    UnmapViewOfFile( (LPVOID)hModule );
-    return 0;
-}
-
-/**********************************************************************
- *                 PE_CreateModule
- *
- * Create WINE_MODREF structure for loaded HMODULE32, link it into
- * process modref_list, and fixup all imports.
- *
- * Note: hModule must point to a correctly allocated PE image,
- *       with base relocations applied; the 16-bit dummy module
- *       associated to hModule must already exist.
- *
- * Note: This routine must always be called in the context of the
- *       process that is to own the module to be created.
- */
-WINE_MODREF *PE_CreateModule( HMODULE hModule, 
-                              LPCSTR filename, DWORD flags, WIN_BOOL builtin )
-{
-    DWORD load_addr = (DWORD)hModule;  
-    IMAGE_NT_HEADERS *nt = PE_HEADER(hModule);
-    IMAGE_DATA_DIRECTORY *dir;
-    IMAGE_IMPORT_DESCRIPTOR *pe_import = NULL;
-    IMAGE_EXPORT_DIRECTORY *pe_export = NULL;
-    IMAGE_RESOURCE_DIRECTORY *pe_resource = NULL;
-    WINE_MODREF *wm;
-
-    dir = nt->OptionalHeader.DataDirectory+IMAGE_DIRECTORY_ENTRY_EXPORT;
-    if (dir->Size)
-        pe_export = (PIMAGE_EXPORT_DIRECTORY)RVA(dir->VirtualAddress);
-
-    dir = nt->OptionalHeader.DataDirectory+IMAGE_DIRECTORY_ENTRY_IMPORT;
-    if (dir->Size)
-        pe_import = (PIMAGE_IMPORT_DESCRIPTOR)RVA(dir->VirtualAddress);
-
-    dir = nt->OptionalHeader.DataDirectory+IMAGE_DIRECTORY_ENTRY_RESOURCE;
-    if (dir->Size)
-        pe_resource = (PIMAGE_RESOURCE_DIRECTORY)RVA(dir->VirtualAddress);
-
-    dir = nt->OptionalHeader.DataDirectory+IMAGE_DIRECTORY_ENTRY_EXCEPTION;
-    if (dir->Size) FIXME("Exception directory ignored\n" );
-
-    dir = nt->OptionalHeader.DataDirectory+IMAGE_DIRECTORY_ENTRY_SECURITY;
-    if (dir->Size) FIXME("Security directory ignored\n" );
-
-    
-    
-
-    dir = nt->OptionalHeader.DataDirectory+IMAGE_DIRECTORY_ENTRY_DEBUG;
-    if (dir->Size) TRACE("Debug directory ignored\n" );
-
-    dir = nt->OptionalHeader.DataDirectory+IMAGE_DIRECTORY_ENTRY_COPYRIGHT;
-    if (dir->Size) FIXME("Copyright string ignored\n" );
-
-    dir = nt->OptionalHeader.DataDirectory+IMAGE_DIRECTORY_ENTRY_GLOBALPTR;
-    if (dir->Size) FIXME("Global Pointer (MIPS) ignored\n" );
-
-    
-
-    dir = nt->OptionalHeader.DataDirectory+IMAGE_DIRECTORY_ENTRY_LOAD_CONFIG;
-    if (dir->Size) FIXME("Load Configuration directory ignored\n" );
-
-    dir = nt->OptionalHeader.DataDirectory+IMAGE_DIRECTORY_ENTRY_BOUND_IMPORT;
-    if (dir->Size) TRACE("Bound Import directory ignored\n" );
-
-    dir = nt->OptionalHeader.DataDirectory+IMAGE_DIRECTORY_ENTRY_IAT;
-    if (dir->Size) TRACE("Import Address Table directory ignored\n" );
-
-    dir = nt->OptionalHeader.DataDirectory+IMAGE_DIRECTORY_ENTRY_DELAY_IMPORT;
-    if (dir->Size)
-    {
-               TRACE("Delayed import, stub calls LoadLibrary\n" );
-               /*
-                * Nothing to do here.
-                */
-
-#ifdef ImgDelayDescr
-               /*
-                * This code is useful to observe what the heck is going on.
-                */
-               {
-               ImgDelayDescr *pe_delay = NULL;
-        pe_delay = (PImgDelayDescr)RVA(dir->VirtualAddress);
-        TRACE_(delayhlp)("pe_delay->grAttrs = %08x\n", pe_delay->grAttrs);
-        TRACE_(delayhlp)("pe_delay->szName = %s\n", pe_delay->szName);
-        TRACE_(delayhlp)("pe_delay->phmod = %08x\n", pe_delay->phmod);
-        TRACE_(delayhlp)("pe_delay->pIAT = %08x\n", pe_delay->pIAT);
-        TRACE_(delayhlp)("pe_delay->pINT = %08x\n", pe_delay->pINT);
-        TRACE_(delayhlp)("pe_delay->pBoundIAT = %08x\n", pe_delay->pBoundIAT);
-        TRACE_(delayhlp)("pe_delay->pUnloadIAT = %08x\n", pe_delay->pUnloadIAT);
-        TRACE_(delayhlp)("pe_delay->dwTimeStamp = %08x\n", pe_delay->dwTimeStamp);
-        }
-#endif 
-       }
-
-    dir = nt->OptionalHeader.DataDirectory+IMAGE_DIRECTORY_ENTRY_COM_DESCRIPTOR;
-    if (dir->Size) FIXME("Unknown directory 14 ignored\n" );
-
-    dir = nt->OptionalHeader.DataDirectory+15;
-    if (dir->Size) FIXME("Unknown directory 15 ignored\n" );
-
-
-    
-
-    wm = (WINE_MODREF *)HeapAlloc( GetProcessHeap(), 
-                                   HEAP_ZERO_MEMORY, sizeof(*wm) );
-    wm->module = hModule;
-
-    if ( builtin ) 
-        wm->flags |= WINE_MODREF_INTERNAL;
-    if ( flags & DONT_RESOLVE_DLL_REFERENCES )
-        wm->flags |= WINE_MODREF_DONT_RESOLVE_REFS;
-    if ( flags & LOAD_LIBRARY_AS_DATAFILE )
-        wm->flags |= WINE_MODREF_LOAD_AS_DATAFILE;
-
-    wm->type = MODULE32_PE;
-    wm->binfmt.pe.pe_export = pe_export;
-    wm->binfmt.pe.pe_import = pe_import;
-    wm->binfmt.pe.pe_resource = pe_resource;
-    wm->binfmt.pe.tlsindex = -1;
-
-    wm->filename = malloc(strlen(filename)+1);
-    strcpy(wm->filename, filename );
-    wm->modname = strrchr( wm->filename, '\\' );
-    if (!wm->modname) wm->modname = wm->filename;
-    else wm->modname++;
-
-    if ( pe_export )
-        dump_exports( hModule );
-
-    /* Fixup Imports */
-
-    if (    pe_import
-         && !( wm->flags & WINE_MODREF_LOAD_AS_DATAFILE )
-         && !( wm->flags & WINE_MODREF_DONT_RESOLVE_REFS ) 
-         && fixup_imports( wm ) ) 
-    {
-        /* remove entry from modref chain */
-         return NULL;
-    }
-
-    return wm;
-
-    return wm;
-}
-
-/******************************************************************************
- * The PE Library Loader frontend. 
- * FIXME: handle the flags.
- */
-WINE_MODREF *PE_LoadLibraryExA (LPCSTR name, DWORD flags)
-{
-       HMODULE         hModule32;
-       WINE_MODREF     *wm;
-       char            filename[256];
-       int hFile;
-       WORD            version = 0;
-
-       
-       strncpy(filename, name, sizeof(filename));      
-       hFile=open(filename, O_RDONLY);
-       if(hFile==-1)
-           return NULL;
-       
-       
-       hModule32 = PE_LoadImage( hFile, filename, &version );
-       if (!hModule32)
-       {
-               SetLastError( ERROR_OUTOFMEMORY );      
-               return NULL;
-       }
-
-       if ( !(wm = PE_CreateModule( hModule32, filename, flags, FALSE )) )
-       {
-               ERR( "can't load %s\n", filename );
-               SetLastError( ERROR_OUTOFMEMORY );
-               return NULL;
-       }
-       close(hFile);
-       //printf("^^^^^^^^^^^^^^^^Alloc VM1  %p\n", wm);
-       return wm;
-}
-
-
-/*****************************************************************************
- *     PE_UnloadLibrary
- *
- * Unload the library unmapping the image and freeing the modref structure.
- */
-void PE_UnloadLibrary(WINE_MODREF *wm)
-{
-    TRACE(" unloading %s\n", wm->filename);
-
-    free(wm->filename);
-    free(wm->short_filename);
-    HeapFree( GetProcessHeap(), 0, wm->deps );
-    VirtualFree( (LPVOID)wm->module, 0, MEM_RELEASE );
-    HeapFree( GetProcessHeap(), 0, wm );
-    //printf("^^^^^^^^^^^^^^^^Free VM1  %p\n", wm);
-}
-
-/*****************************************************************************
- * Load the PE main .EXE. All other loading is done by PE_LoadLibraryExA
- * FIXME: this function should use PE_LoadLibraryExA, but currently can't
- * due to the PROCESS_Create stuff.
- */
-
-
-/*
- * This is a dirty hack.
- * The win32 DLLs contain an alloca routine, that first probes the soon
- * to be allocated new memory *below* the current stack pointer in 4KByte
- * increments.  After the mem probing below the current %esp,  the stack
- * pointer is finally decremented to make room for the "alloca"ed memory.
- * Maybe the probing code is intended to extend the stack on a windows box.
- * Anyway, the linux kernel does *not* extend the stack by simply accessing
- * memory below %esp;  it segfaults.
- * The extend_stack_for_dll_alloca() routine just preallocates a big chunk
- * of memory on the stack, for use by the DLLs alloca routine.
- * Added the noinline attribute as e.g. gcc 3.2.2 inlines this function
- * in a way that breaks it.
- */
-static void __attribute__((noinline)) extend_stack_for_dll_alloca(void)
-{
-#if !defined(__FreeBSD__) && !defined(__DragonFly__)
-    volatile int* mem=alloca(0x20000);
-    *mem=0x1234;
-#endif
-}
-
-/* Called if the library is loaded or freed.
- * NOTE: if a thread attaches a DLL, the current thread will only do
- * DLL_PROCESS_ATTACH. Only new created threads do DLL_THREAD_ATTACH
- * (SDK)
- */
-WIN_BOOL PE_InitDLL( WINE_MODREF *wm, DWORD type, LPVOID lpReserved )
-{
-    WIN_BOOL retv = TRUE;
-    assert( wm->type == MODULE32_PE );
-
-    
-    if ((PE_HEADER(wm->module)->FileHeader.Characteristics & IMAGE_FILE_DLL) &&
-        (PE_HEADER(wm->module)->OptionalHeader.AddressOfEntryPoint)
-    ) {
-       DLLENTRYPROC entry ;
-       entry = (void*)PE_FindExportedFunction(wm, "DllMain", 0);
-       if(entry==NULL)
-           entry = (void*)RVA_PTR( wm->module,OptionalHeader.AddressOfEntryPoint );
-        
-       TRACE_(relay)("CallTo32(entryproc=%p,module=%08x,type=%ld,res=%p)\n",
-                       entry, wm->module, type, lpReserved );
-       
-       
-       TRACE("Entering DllMain(");
-       switch(type)
-       {
-           case DLL_PROCESS_DETACH:
-               TRACE("DLL_PROCESS_DETACH) ");
-               break;
-           case DLL_PROCESS_ATTACH:
-               TRACE("DLL_PROCESS_ATTACH) ");
-               break;
-           case DLL_THREAD_DETACH:
-               TRACE("DLL_THREAD_DETACH) ");
-               break;
-           case DLL_THREAD_ATTACH:
-               TRACE("DLL_THREAD_ATTACH) ");
-               break;
-       }       
-       TRACE("for %s\n", wm->filename);
-       extend_stack_for_dll_alloca();
-        retv = entry( wm->module, type, lpReserved );
-    }
-
-    return retv;
-}
-
-static LPVOID
-_fixup_address(PIMAGE_OPTIONAL_HEADER opt,int delta,LPVOID addr) {
-       if (    ((DWORD)addr>opt->ImageBase) &&
-               ((DWORD)addr<opt->ImageBase+opt->SizeOfImage)
-       )
-               
-               return (LPVOID)(((DWORD)addr)+delta);
-       else
-               
-               return addr;
-}
diff --git a/modules/codec/loader/pe_resource.c b/modules/codec/loader/pe_resource.c
deleted file mode 100644 (file)
index 5e54e5e..0000000
+++ /dev/null
@@ -1,412 +0,0 @@
-/*
- * PE (Portable Execute) File Resources
- * $Id$
- *
- * Copyright 1995 Thomas Sandford
- * Copyright 1996 Martin von Loewis
- *
- * Based on the Win16 resource handling code in loader/resource.c
- * Copyright 1993 Robert J. Amstadt
- * Copyright 1995 Alexandre Julliard
- * Copyright 1997 Marcus Meissner
- *
- * Modified for use with MPlayer, detailed CVS changelog at
- * http://www.mplayerhq.hu/cgi-bin/cvsweb.cgi/main/
- *
- * File now distributed as part of VLC media player with no modifications.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
- */
-#include "config.h"
-
-#include <stdlib.h>
-#include <sys/types.h>
-#include "wine/winestring.h"
-#include "wine/windef.h"
-#include "wine/pe_image.h"
-#include "wine/module.h"
-#include "wine/heap.h"
-//#include "task.h"
-//#include "process.h"
-//#include "stackframe.h"
-#include "wine/debugtools.h"
-#include "ext.h"
-
-/**********************************************************************
- *  HMODULE32toPE_MODREF 
- *
- * small helper function to get a PE_MODREF from a passed HMODULE32
- */
-static PE_MODREF*
-HMODULE32toPE_MODREF(HMODULE hmod) {
-       WINE_MODREF     *wm;
-
-       wm = MODULE32_LookupHMODULE( hmod );
-       if (!wm || wm->type!=MODULE32_PE)
-               return NULL;
-       return &(wm->binfmt.pe);
-}
-
-/**********************************************************************
- *         GetResDirEntryW
- *
- *     Helper function - goes down one level of PE resource tree
- *
- */
-PIMAGE_RESOURCE_DIRECTORY GetResDirEntryW(PIMAGE_RESOURCE_DIRECTORY resdirptr,
-                                          LPCWSTR name,DWORD root,
-                                          WIN_BOOL allowdefault)
-{
-    int entrynum;
-    PIMAGE_RESOURCE_DIRECTORY_ENTRY entryTable;
-    int namelen;
-
-    if (HIWORD(name)) {
-       if (name[0]=='#') {
-               char    buf[10];
-
-               lstrcpynWtoA(buf,name+1,10);
-               return GetResDirEntryW(resdirptr,(LPCWSTR)atoi(buf),root,allowdefault);
-       }
-       entryTable = (PIMAGE_RESOURCE_DIRECTORY_ENTRY) (
-                       (BYTE *) resdirptr + 
-                        sizeof(IMAGE_RESOURCE_DIRECTORY));
-       namelen = lstrlenW(name);
-       for (entrynum = 0; entrynum < resdirptr->NumberOfNamedEntries; entrynum++)
-       {
-               PIMAGE_RESOURCE_DIR_STRING_U str =
-               (PIMAGE_RESOURCE_DIR_STRING_U) (root + 
-                       entryTable[entrynum].u1.s.NameOffset);
-               if(namelen != str->Length)
-                       continue;
-               if(wcsnicmp(name,str->NameString,str->Length)==0)
-                       return (PIMAGE_RESOURCE_DIRECTORY) (
-                               root +
-                               entryTable[entrynum].u2.s.OffsetToDirectory);
-       }
-       return NULL;
-    } else {
-       entryTable = (PIMAGE_RESOURCE_DIRECTORY_ENTRY) (
-                       (BYTE *) resdirptr + 
-                        sizeof(IMAGE_RESOURCE_DIRECTORY) +
-                       resdirptr->NumberOfNamedEntries * sizeof(IMAGE_RESOURCE_DIRECTORY_ENTRY));
-       for (entrynum = 0; entrynum < resdirptr->NumberOfIdEntries; entrynum++)
-           if ((DWORD)entryTable[entrynum].u1.Name == (DWORD)name)
-               return (PIMAGE_RESOURCE_DIRECTORY) (
-                       root +
-                       entryTable[entrynum].u2.s.OffsetToDirectory);
-       /* just use first entry if no default can be found */
-       if (allowdefault && !name && resdirptr->NumberOfIdEntries)
-               return (PIMAGE_RESOURCE_DIRECTORY) (
-                       root +
-                       entryTable[0].u2.s.OffsetToDirectory);
-       return NULL;
-    }
-}
-
-/**********************************************************************
- *         GetResDirEntryA
- */
-PIMAGE_RESOURCE_DIRECTORY GetResDirEntryA( PIMAGE_RESOURCE_DIRECTORY resdirptr,
-                                          LPCSTR name, DWORD root,
-                                          WIN_BOOL allowdefault )
-{
-    PIMAGE_RESOURCE_DIRECTORY retv;
-    LPWSTR nameW = HIWORD(name)? HEAP_strdupAtoW( GetProcessHeap(), 0, name ) 
-                               : (LPWSTR)name;
-
-    retv = GetResDirEntryW( resdirptr, nameW, root, allowdefault );
-
-    if ( HIWORD(name) ) HeapFree( GetProcessHeap(), 0, nameW );
-
-    return retv;
-}
-
-/**********************************************************************
- *         PE_FindResourceEx32W
- */
-HANDLE PE_FindResourceExW(
-       WINE_MODREF *wm,LPCWSTR name,LPCWSTR type,WORD lang
-) {
-    PIMAGE_RESOURCE_DIRECTORY resdirptr;
-    DWORD root;
-    HANDLE result;
-    PE_MODREF  *pem = &(wm->binfmt.pe);
-
-    if (!pem || !pem->pe_resource)
-       return 0;
-
-    resdirptr = pem->pe_resource;
-    root = (DWORD) resdirptr;
-    if ((resdirptr = GetResDirEntryW(resdirptr, type, root, FALSE)) == NULL)
-       return 0;
-    if ((resdirptr = GetResDirEntryW(resdirptr, name, root, FALSE)) == NULL)
-       return 0;
-    result = (HANDLE)GetResDirEntryW(resdirptr, (LPCWSTR)(UINT)lang, root, FALSE);
-       /* Try LANG_NEUTRAL, too */
-    if(!result)
-        return (HANDLE)GetResDirEntryW(resdirptr, (LPCWSTR)0, root, TRUE);
-    return result;
-}
-
-
-/**********************************************************************
- *         PE_LoadResource32
- */
-HANDLE PE_LoadResource( WINE_MODREF *wm, HANDLE hRsrc )
-{
-    if (!hRsrc || !wm || wm->type!=MODULE32_PE)
-       return 0;
-    return (HANDLE) (wm->module + ((PIMAGE_RESOURCE_DATA_ENTRY)hRsrc)->OffsetToData);
-}
-
-
-/**********************************************************************
- *         PE_SizeofResource32
- */
-DWORD PE_SizeofResource( HINSTANCE hModule, HANDLE hRsrc )
-{
-    /* we don't need hModule */
-    if (!hRsrc)
-        return 0;
-    return ((PIMAGE_RESOURCE_DATA_ENTRY)hRsrc)->Size;
-}
-
-/**********************************************************************
- *         PE_EnumResourceTypes32A
- */
-WIN_BOOL
-PE_EnumResourceTypesA(HMODULE hmod,ENUMRESTYPEPROCA lpfun,LONG lparam) {
-    PE_MODREF  *pem = HMODULE32toPE_MODREF(hmod);
-    int                i;
-    PIMAGE_RESOURCE_DIRECTORY          resdir;
-    PIMAGE_RESOURCE_DIRECTORY_ENTRY    et;
-    WIN_BOOL   ret;
-    HANDLE     heap = GetProcessHeap();        
-
-    if (!pem || !pem->pe_resource)
-       return FALSE;
-
-    resdir = (PIMAGE_RESOURCE_DIRECTORY)pem->pe_resource;
-    et =(PIMAGE_RESOURCE_DIRECTORY_ENTRY)((LPBYTE)resdir+sizeof(IMAGE_RESOURCE_DIRECTORY));
-    ret = FALSE;
-    for (i=0;i<resdir->NumberOfNamedEntries+resdir->NumberOfIdEntries;i++) {
-       LPSTR   name;
-
-       if (et[i].u1.s.NameIsString)
-               name = HEAP_strdupWtoA(heap,0,(LPWSTR)((LPBYTE)pem->pe_resource+et[i].u1.s.NameOffset));
-       else
-               name = (LPSTR)(int)et[i].u1.Id;
-       ret = lpfun(hmod,name,lparam);
-       if (HIWORD(name))
-               HeapFree(heap,0,name);
-       if (!ret)
-               break;
-    }
-    return ret;
-}
-
-/**********************************************************************
- *         PE_EnumResourceTypes32W
- */
-WIN_BOOL
-PE_EnumResourceTypesW(HMODULE hmod,ENUMRESTYPEPROCW lpfun,LONG lparam) {
-    PE_MODREF  *pem = HMODULE32toPE_MODREF(hmod);
-    int                i;
-    PIMAGE_RESOURCE_DIRECTORY          resdir;
-    PIMAGE_RESOURCE_DIRECTORY_ENTRY    et;
-    WIN_BOOL   ret;
-
-    if (!pem || !pem->pe_resource)
-       return FALSE;
-
-    resdir = (PIMAGE_RESOURCE_DIRECTORY)pem->pe_resource;
-    et =(PIMAGE_RESOURCE_DIRECTORY_ENTRY)((LPBYTE)resdir+sizeof(IMAGE_RESOURCE_DIRECTORY));
-    ret = FALSE;
-    for (i=0;i<resdir->NumberOfNamedEntries+resdir->NumberOfIdEntries;i++) {
-       LPWSTR  type;
-       if (et[i].u1.s.NameIsString)
-               type = (LPWSTR)((LPBYTE)pem->pe_resource+et[i].u1.s.NameOffset);
-       else
-               type = (LPWSTR)(int)et[i].u1.Id;
-
-       ret = lpfun(hmod,type,lparam);
-       if (!ret)
-               break;
-    }
-    return ret;
-}
-
-/**********************************************************************
- *         PE_EnumResourceNames32A
- */
-WIN_BOOL
-PE_EnumResourceNamesA(
-       HMODULE hmod,LPCSTR type,ENUMRESNAMEPROCA lpfun,LONG lparam
-) {
-    PE_MODREF  *pem = HMODULE32toPE_MODREF(hmod);
-    int                i;
-    PIMAGE_RESOURCE_DIRECTORY          resdir;
-    PIMAGE_RESOURCE_DIRECTORY_ENTRY    et;
-    WIN_BOOL   ret;
-    HANDLE     heap = GetProcessHeap();        
-    LPWSTR     typeW;
-
-    if (!pem || !pem->pe_resource)
-       return FALSE;
-    resdir = (PIMAGE_RESOURCE_DIRECTORY)pem->pe_resource;
-    if (HIWORD(type))
-       typeW = HEAP_strdupAtoW(heap,0,type);
-    else
-       typeW = (LPWSTR)type;
-    resdir = GetResDirEntryW(resdir,typeW,(DWORD)pem->pe_resource,FALSE);
-    if (HIWORD(typeW))
-       HeapFree(heap,0,typeW);
-    if (!resdir)
-       return FALSE;
-    et =(PIMAGE_RESOURCE_DIRECTORY_ENTRY)((LPBYTE)resdir+sizeof(IMAGE_RESOURCE_DIRECTORY));
-    ret = FALSE;
-    for (i=0;i<resdir->NumberOfNamedEntries+resdir->NumberOfIdEntries;i++) {
-       LPSTR   name;
-
-       if (et[i].u1.s.NameIsString)
-           name = HEAP_strdupWtoA(heap,0,(LPWSTR)((LPBYTE)pem->pe_resource+et[i].u1.s.NameOffset));
-       else
-           name = (LPSTR)(int)et[i].u1.Id;
-       ret = lpfun(hmod,type,name,lparam);
-       if (HIWORD(name)) HeapFree(heap,0,name);
-       if (!ret)
-               break;
-    }
-    return ret;
-}
-
-/**********************************************************************
- *         PE_EnumResourceNames32W
- */
-WIN_BOOL
-PE_EnumResourceNamesW(
-       HMODULE hmod,LPCWSTR type,ENUMRESNAMEPROCW lpfun,LONG lparam
-) {
-    PE_MODREF  *pem = HMODULE32toPE_MODREF(hmod);
-    int                i;
-    PIMAGE_RESOURCE_DIRECTORY          resdir;
-    PIMAGE_RESOURCE_DIRECTORY_ENTRY    et;
-    WIN_BOOL   ret;
-
-    if (!pem || !pem->pe_resource)
-       return FALSE;
-
-    resdir = (PIMAGE_RESOURCE_DIRECTORY)pem->pe_resource;
-    resdir = GetResDirEntryW(resdir,type,(DWORD)pem->pe_resource,FALSE);
-    if (!resdir)
-       return FALSE;
-    et =(PIMAGE_RESOURCE_DIRECTORY_ENTRY)((LPBYTE)resdir+sizeof(IMAGE_RESOURCE_DIRECTORY));
-    ret = FALSE;
-    for (i=0;i<resdir->NumberOfNamedEntries+resdir->NumberOfIdEntries;i++) {
-       LPWSTR  name;
-       if (et[i].u1.s.NameIsString)
-               name = (LPWSTR)((LPBYTE)pem->pe_resource+et[i].u1.s.NameOffset);
-       else
-               name = (LPWSTR)(int)et[i].u1.Id;
-       ret = lpfun(hmod,type,name,lparam);
-       if (!ret)
-               break;
-    }
-    return ret;
-}
-
-/**********************************************************************
- *         PE_EnumResourceNames32A
- */
-WIN_BOOL
-PE_EnumResourceLanguagesA(
-       HMODULE hmod,LPCSTR name,LPCSTR type,ENUMRESLANGPROCA lpfun,
-       LONG lparam
-) {
-    PE_MODREF  *pem = HMODULE32toPE_MODREF(hmod);
-    int                i;
-    PIMAGE_RESOURCE_DIRECTORY          resdir;
-    PIMAGE_RESOURCE_DIRECTORY_ENTRY    et;
-    WIN_BOOL   ret;
-    HANDLE     heap = GetProcessHeap();        
-    LPWSTR     nameW,typeW;
-
-    if (!pem || !pem->pe_resource)
-       return FALSE;
-
-    resdir = (PIMAGE_RESOURCE_DIRECTORY)pem->pe_resource;
-    if (HIWORD(name))
-       nameW = HEAP_strdupAtoW(heap,0,name);
-    else
-       nameW = (LPWSTR)name;
-    resdir = GetResDirEntryW(resdir,nameW,(DWORD)pem->pe_resource,FALSE);
-    if (HIWORD(nameW))
-       HeapFree(heap,0,nameW);
-    if (!resdir)
-       return FALSE;
-    if (HIWORD(type))
-       typeW = HEAP_strdupAtoW(heap,0,type);
-    else
-       typeW = (LPWSTR)type;
-    resdir = GetResDirEntryW(resdir,typeW,(DWORD)pem->pe_resource,FALSE);
-    if (HIWORD(typeW))
-       HeapFree(heap,0,typeW);
-    if (!resdir)
-       return FALSE;
-    et =(PIMAGE_RESOURCE_DIRECTORY_ENTRY)((LPBYTE)resdir+sizeof(IMAGE_RESOURCE_DIRECTORY));
-    ret = FALSE;
-    for (i=0;i<resdir->NumberOfNamedEntries+resdir->NumberOfIdEntries;i++) {
-       /* languages are just ids... I hopem */
-       ret = lpfun(hmod,name,type,et[i].u1.Id,lparam);
-       if (!ret)
-               break;
-    }
-    return ret;
-}
-
-/**********************************************************************
- *         PE_EnumResourceLanguages32W
- */
-WIN_BOOL
-PE_EnumResourceLanguagesW(
-       HMODULE hmod,LPCWSTR name,LPCWSTR type,ENUMRESLANGPROCW lpfun,
-       LONG lparam
-) {
-    PE_MODREF  *pem = HMODULE32toPE_MODREF(hmod);
-    int                i;
-    PIMAGE_RESOURCE_DIRECTORY          resdir;
-    PIMAGE_RESOURCE_DIRECTORY_ENTRY    et;
-    WIN_BOOL   ret;
-
-    if (!pem || !pem->pe_resource)
-       return FALSE;
-
-    resdir = (PIMAGE_RESOURCE_DIRECTORY)pem->pe_resource;
-    resdir = GetResDirEntryW(resdir,name,(DWORD)pem->pe_resource,FALSE);
-    if (!resdir)
-       return FALSE;
-    resdir = GetResDirEntryW(resdir,type,(DWORD)pem->pe_resource,FALSE);
-    if (!resdir)
-       return FALSE;
-    et =(PIMAGE_RESOURCE_DIRECTORY_ENTRY)((LPBYTE)resdir+sizeof(IMAGE_RESOURCE_DIRECTORY));
-    ret = FALSE;
-    for (i=0;i<resdir->NumberOfNamedEntries+resdir->NumberOfIdEntries;i++) {
-       ret = lpfun(hmod,name,type,et[i].u1.Id,lparam);
-       if (!ret)
-               break;
-    }
-    return ret;
-}
diff --git a/modules/codec/loader/qtx/qtxsdk/components.h b/modules/codec/loader/qtx/qtxsdk/components.h
deleted file mode 100644 (file)
index 4609124..0000000
+++ /dev/null
@@ -1,741 +0,0 @@
-// Basic types:
-
-typedef char *                          Ptr;
-typedef Ptr *                           Handle;
-typedef int32_t                         Size;
-typedef unsigned char                   Boolean;
-typedef unsigned char                   Str31[32];
-typedef int32_t                         Fixed;
-
-typedef int32_t OSErr;
-typedef int OSType;
-
-typedef int32_t ComponentResult;
-typedef unsigned char                   UInt8;
-typedef signed char                     SInt8;
-typedef unsigned short                  UInt16;
-typedef signed short                    SInt16;
-typedef uint32_t                        UInt32;
-typedef int32_t                         SInt32;
-
-#define FOUR_CHAR_CODE(a,b,c,d)       ((uint32_t)(a)<<24 | (uint32_t)(b)<<16 | (uint32_t)(c)<<8 | (uint32_t)(d)) /* otherwise compiler will complain about values with high bit set */
-
-// codec private shit:
-typedef void *GlobalsPtr;
-typedef void **Globals;
-
-//==================== COMPONENTS ===========================
-
-struct __attribute__((__packed__)) ComponentParameters {
-    UInt8                           flags;                      /* call modifiers: sync/async, deferred, immed, etc */
-    UInt8                           paramSize;                  /* size in bytes of actual parameters passed to this call */
-    short                           what;                       /* routine selector, negative for Component management calls */
-    int32_t                         params[1];                  /* actual parameters for the indicated routine */
-};
-typedef struct ComponentParameters      ComponentParameters;
-
-
-struct __attribute__((__packed__)) ComponentDescription {
-    OSType                          componentType;              /* A unique 4-byte code indentifying the command set */
-    OSType                          componentSubType;           /* Particular flavor of this instance */
-    OSType                          componentManufacturer;      /* Vendor indentification */
-    uint32_t                        componentFlags;             /* 8 each for Component,Type,SubType,Manuf/revision */
-    uint32_t                        componentFlagsMask;         /* Mask for specifying which flags to consider in search, zero during registration */
-};
-typedef struct ComponentDescription     ComponentDescription;
-
-
-struct __attribute__((__packed__)) ResourceSpec {
-    OSType                          resType;                    /* 4-byte code    */
-    short                           resID;                      /*         */
-};
-typedef struct ResourceSpec             ResourceSpec;
-
-
-struct __attribute__((__packed__)) ComponentResource {
-    ComponentDescription            cd;                         /* Registration parameters */
-    ResourceSpec                    component;                  /* resource where Component code is found */
-    ResourceSpec                    componentName;              /* name string resource */
-    ResourceSpec                    componentInfo;              /* info string resource */
-    ResourceSpec                    componentIcon;              /* icon resource */
-};
-typedef struct ComponentResource        ComponentResource;
-typedef ComponentResource *             ComponentResourcePtr;
-typedef ComponentResourcePtr *          ComponentResourceHandle;
-
-
-struct __attribute__((__packed__)) ComponentRecord {
-    int32_t                            data[1];
-};
-typedef struct ComponentRecord          ComponentRecord;
-typedef ComponentRecord *               Component;
-
-
-struct __attribute__((__packed__)) ComponentInstanceRecord {
-    int32_t                            data[1];
-};
-typedef struct ComponentInstanceRecord  ComponentInstanceRecord;
-
-typedef ComponentInstanceRecord *       ComponentInstance;
-
-// ========================= QUICKDRAW =========================
-
-struct __attribute__((__packed__)) Rect {
-    short                           top;
-    short                           left;
-    short                           bottom;
-    short                           right;
-};
-typedef struct Rect                     Rect;
-typedef Rect *                          RectPtr;
-
-struct __attribute__((__packed__)) RGBColor {
-    unsigned short                  red;                        /*magnitude of red component*/
-    unsigned short                  green;                      /*magnitude of green component*/
-    unsigned short                  blue;                       /*magnitude of blue component*/
-};
-typedef struct RGBColor                 RGBColor;
-typedef RGBColor *                      RGBColorPtr;
-typedef RGBColorPtr *                   RGBColorHdl;
-
-struct __attribute__((__packed__)) ColorSpec {
-    short                           value;                      /*index or other value*/
-    RGBColor                        rgb;                        /*true color*/
-};
-typedef struct ColorSpec                ColorSpec;
-typedef ColorSpec *                     ColorSpecPtr;
-typedef ColorSpec                       CSpecArray[1];
-
-struct __attribute__((__packed__)) ColorTable {
-    int32_t                         ctSeed;                     /*unique identifier for table*/
-    short                           ctFlags;                    /*high bit: 0 = PixMap; 1 = device*/
-    short                           ctSize;                     /*number of entries in CTTable*/
-    CSpecArray                      ctTable;                    /*array [0..0] of ColorSpec*/
-};
-typedef struct ColorTable               ColorTable;
-typedef ColorTable *                    CTabPtr;
-typedef CTabPtr *                       CTabHandle;
-
-struct __attribute__((__packed__)) MatrixRecord {
-    Fixed                           matrix[3][3];
-};
-typedef struct MatrixRecord             MatrixRecord;
-typedef MatrixRecord *                  MatrixRecordPtr;
-
-typedef int32_t                         ImageSequence;
-typedef OSType                          CodecType;
-typedef unsigned short                  CodecFlags;
-typedef uint32_t                        CodecQ;
-
-struct __attribute__((__packed__)) ImageDescription {
-    int32_t                         idSize;                     /* total size of ImageDescription including extra data ( CLUTs and other per sequence data ) */
-    CodecType                       cType;                      /* what kind of codec compressed this data */
-    int32_t                         resvd1;                     /* reserved for Apple use */
-    short                           resvd2;                     /* reserved for Apple use */
-    short                           dataRefIndex;               /* set to zero  */
-    short                           version;                    /* which version is this data */
-    short                           revisionLevel;              /* what version of that codec did this */
-    int32_t                         vendor;                     /* whose  codec compressed this data */
-    CodecQ                          temporalQuality;            /* what was the temporal quality factor  */
-    CodecQ                          spatialQuality;             /* what was the spatial quality factor */
-    short                           width;                      /* how many pixels wide is this data */
-    short                           height;                     /* how many pixels high is this data */
-    Fixed                           hRes;                       /* horizontal resolution */
-    Fixed                           vRes;                       /* vertical resolution */
-    int32_t                         dataSize;                   /* if known, the size of data for this image descriptor */
-    short                           frameCount;                 /* number of frames this description applies to */
-    Str31                           name;                       /* name of codec ( in case not installed )  */
-    short                           depth;                      /* what depth is this data (1-32) or ( 33-40 grayscale ) */
-    short                           clutID;                     /* clut id or if 0 clut follows  or -1 if no clut */
-};
-typedef struct ImageDescription         ImageDescription;
-typedef ImageDescription *              ImageDescriptionPtr;
-typedef ImageDescriptionPtr *           ImageDescriptionHandle;
-
-/* values for PixMap.pixelFormat*/
-enum {
-    k16LE555PixelFormat         = FOUR_CHAR_CODE('L','5','5','5'),       /* 16 bit LE rgb 555 (PC)*/
-    k16LE5551PixelFormat        = FOUR_CHAR_CODE('5','5','5','1'),       /* 16 bit LE rgb 5551*/
-    k16BE565PixelFormat         = FOUR_CHAR_CODE('B','5','6','5'),       /* 16 bit BE rgb 565*/
-    k16LE565PixelFormat         = FOUR_CHAR_CODE('L','5','6','5'),       /* 16 bit LE rgb 565*/
-    k24BGRPixelFormat           = FOUR_CHAR_CODE('2','4','B','G'),       /* 24 bit bgr */
-    k32BGRAPixelFormat          = FOUR_CHAR_CODE('B','G','R','A'),       /* 32 bit bgra    (Matrox)*/
-    k32ABGRPixelFormat          = FOUR_CHAR_CODE('A','B','G','R'),       /* 32 bit abgr    */
-    k32RGBAPixelFormat          = FOUR_CHAR_CODE('R','G','B','A'),       /* 32 bit rgba    */
-    kYUVSPixelFormat            = FOUR_CHAR_CODE('y','u','v','s'),       /* YUV 4:2:2 byte ordering 16-unsigned = 'YUY2'*/
-    kYUVUPixelFormat            = FOUR_CHAR_CODE('y','u','v','u'),       /* YUV 4:2:2 byte ordering 16-signed*/
-    kYVU9PixelFormat            = FOUR_CHAR_CODE('Y','V','U','9'),       /* YVU9 Planar    9*/
-    kYUV411PixelFormat          = FOUR_CHAR_CODE('Y','4','1','1'),       /* YUV 4:1:1 Interleaved  16*/
-    kYVYU422PixelFormat         = FOUR_CHAR_CODE('Y','V','Y','U'),       /* YVYU 4:2:2 byte ordering   16*/
-    kUYVY422PixelFormat         = FOUR_CHAR_CODE('U','Y','V','Y'),       /* UYVY 4:2:2 byte ordering   16*/
-    kYUV211PixelFormat          = FOUR_CHAR_CODE('Y','2','1','1'),       /* YUV 2:1:1 Packed   8*/
-    k2vuyPixelFormat            = FOUR_CHAR_CODE('2','v','u','y')        /* UYVY 4:2:2 byte ordering   16*/
-};
-
-struct __attribute__((__packed__)) PixMapExtension {
-    int32_t                         extSize;                    /*size of struct, duh!*/
-    uint32_t                        pmBits;                     /*pixmap attributes bitfield*/
-    void *                          pmGD;                       /*this is a GDHandle*/
-    int32_t                         pmSeed;
-    Fixed                           gammaLevel;                 /*pixmap gammalevel*/
-    Fixed                           requestedGammaLevel;
-    uint32_t                        reserved2;
-    int32_t                         longRowBytes;               /*used when rowBytes > 16382*/
-    uint32_t                        signature;
-    Handle                          baseAddrHandle;
-};
-typedef struct PixMapExtension          PixMapExtension;
-
-typedef PixMapExtension *               PixMapExtPtr;
-typedef PixMapExtPtr *                  PixMapExtHandle;
-
-
-struct __attribute__((__packed__)) PixMap {
-    Ptr                             baseAddr;                   /*pointer to pixels*/
-    short                           rowBytes;                   /*offset to next line*/
-    Rect                            bounds;                     /*encloses bitmap*/
-    short                           pmVersion;                  /*pixMap version number*/
-    short                           packType;                   /*defines packing format*/
-    int32_t                         packSize;                   /*length of pixel data*/
-    Fixed                           hRes;                       /*horiz. resolution (ppi)*/
-    Fixed                           vRes;                       /*vert. resolution (ppi)*/
-    short                           pixelType;                  /*defines pixel type*/
-    short                           pixelSize;                  /*# bits in pixel*/
-    short                           cmpCount;                   /*# components in pixel*/
-    short                           cmpSize;                    /*# bits per component*/
-    OSType                          pixelFormat;                /*fourCharCode representation*/
-    CTabHandle                      pmTable;                    /*color map for this pixMap*/
-    PixMapExtHandle                 pmExt;                      /*Handle to pixMap extension*/
-};
-typedef struct PixMap                   PixMap;
-typedef PixMap *                        PixMapPtr;
-typedef PixMapPtr *                     PixMapHandle;
-
-
-struct __attribute__((__packed__)) BitMap {
-    Ptr                             baseAddr;
-    short                           rowBytes;
-    Rect                            bounds;
-};
-typedef struct BitMap                   BitMap;
-typedef BitMap *                        BitMapPtr;
-typedef BitMapPtr *                     BitMapHandle;
-typedef struct OpaqueRgnHandle*         RgnHandle;
-
-struct Pattern {
-    UInt8                           pat[8];
-};
-typedef struct Pattern                  Pattern;
-typedef unsigned char                   Style;
-typedef Style                           StyleField;
-struct __attribute__((__packed__)) Point {
-    short                           v;
-    short                           h;
-};
-typedef struct Point                    Point;
-struct __attribute__((__packed__)) GrafPort {
-    short                           device;
-    BitMap                          portBits;
-    Rect                            portRect;
-    RgnHandle                       visRgn;
-    RgnHandle                       clipRgn;
-    Pattern                         bkPat;
-    Pattern                         fillPat;
-    Point                           pnLoc;
-    Point                           pnSize;
-    short                           pnMode;
-    Pattern                         pnPat;
-    short                           pnVis;
-    short                           txFont;
-    StyleField                      txFace;                     /*StyleField occupies 16-bits, but only first 8-bits are used*/
-    UInt8                           txFlags;                    /* QuickTime uses second 8 bits of StyleField for txFlags */
-    short                           txMode;
-    short                           txSize;
-    Fixed                           spExtra;
-    int32_t                         fgColor;
-    int32_t                         bkColor;
-    short                           colrBit;
-    short                           patStretch;
-    Handle                          picSave;
-    Handle                          rgnSave;
-    Handle                          polySave;
-    /*QDProcsPtr*/void*                      grafProcs;
-};
-typedef struct GrafPort                 GrafPort;
-typedef GrafPort *GWorldPtr;
-typedef GWorldPtr *GWorldHandle;
-#define anyCodec                ((CodecComponent)0)
-enum {
-                                                                /* transfer modes */
-    srcCopy                     = 0,                            /*the 16 transfer modes*/
-    srcOr                       = 1,
-    srcXor                      = 2,
-    srcBic                      = 3,
-    notSrcCopy                  = 4,
-    notSrcOr                    = 5,
-    notSrcXor                   = 6,
-    notSrcBic                   = 7,
-    patCopy                     = 8,
-    patOr                       = 9,
-    patXor                      = 10,
-    patBic                      = 11,
-    notPatCopy                  = 12,
-    notPatOr                    = 13,
-    notPatXor                   = 14,
-    notPatBic                   = 15,                           /* Special Text Transfer Mode */
-    grayishTextOr               = 49,
-    hilitetransfermode          = 50,
-    hilite                      = 50,                           /* Arithmetic transfer modes */
-    blend                       = 32,
-    addPin                      = 33,
-    addOver                     = 34,
-    subPin                      = 35,
-    addMax                      = 37,
-    adMax                       = 37,
-    subOver                     = 38,
-    adMin                       = 39,
-    ditherCopy                  = 64,                           /* Transparent mode constant */
-    transparent                 = 36
-};
-
-typedef uint32_t                   GWorldFlags;
-
-
-
-// ============================== CODECS ===========================
-
-typedef Component                       CompressorComponent;
-typedef Component                       DecompressorComponent;
-typedef Component                       CodecComponent;
-
-enum {
-    codecLosslessQuality        = 0x00000400,
-    codecMaxQuality             = 0x000003FF,
-    codecMinQuality             = 0x00000000,
-    codecLowQuality             = 0x00000100,
-    codecNormalQuality          = 0x00000200,
-    codecHighQuality            = 0x00000300
-};
-
-
-
-// callbacks:
-typedef void* ImageCodecDrawBandCompleteUPP;
-typedef int64_t ICMProgressProcRecord;
-typedef int64_t ICMCompletionProcRecord;
-typedef ICMCompletionProcRecord* ICMCompletionProcRecordPtr;
-typedef int64_t ICMDataProcRecord;
-typedef void* ICMFrameTimePtr;
-typedef void* CDSequenceDataSourcePtr;
-typedef void* ICMFrameTimeInfoPtr;
-
-// graphics port
-typedef struct OpaqueGrafPtr*           GrafPtr;
-typedef GrafPtr                         CGrafPtr;
-
-
-/*  codec capabilities flags    */
-enum {
-    codecCanScale               = 1L << 0,     // 1
-    codecCanMask                = 1L << 1,     // 2
-    codecCanMatte               = 1L << 2,     // 4
-    codecCanTransform           = 1L << 3,     // 8
-    codecCanTransferMode        = 1L << 4,     // 10
-    codecCanCopyPrev            = 1L << 5,     // 20
-    codecCanSpool               = 1L << 6,     // 40
-    codecCanClipVertical        = 1L << 7,     // 80
-    codecCanClipRectangular     = 1L << 8,     // 100
-    codecCanRemapColor          = 1L << 9,     // 200
-    codecCanFastDither          = 1L << 10,    // 400
-    codecCanSrcExtract          = 1L << 11,    // 800
-    codecCanCopyPrevComp        = 1L << 12,    // 1000
-    codecCanAsync               = 1L << 13,    // 2000
-    codecCanMakeMask            = 1L << 14,    // 4000
-    codecCanShift               = 1L << 15,    // 8000
-    codecCanAsyncWhen           = 1L << 16,    // 10000
-    codecCanShieldCursor        = 1L << 17,    // 20000
-    codecCanManagePrevBuffer    = 1L << 18,    // 40000
-    codecHasVolatileBuffer      = 1L << 19,     // 80000                /* codec requires redraw after window movement */
-    codecWantsRegionMask        = 1L << 20,    // 100000
-    codecImageBufferIsOnScreen  = 1L << 21,     // 200000                /* old def of codec using overlay surface, = ( codecIsDirectToScreenOnly | codecUsesOverlaySurface | codecImageBufferIsOverlaySurface | codecSrcMustBeImageBuffer ) */
-    codecWantsDestinationPixels = 1L << 22,     // 400000
-    codecWantsSpecialScaling    = 1L << 23,     // 800000
-    codecHandlesInputs          = 1L << 24,    // 1000000
-    codecCanDoIndirectSurface   = 1L << 25,                     /* codec can handle indirect surface (GDI) */
-    codecIsSequenceSensitive    = 1L << 26,
-    codecRequiresOffscreen      = 1L << 27,
-    codecRequiresMaskBits       = 1L << 28,
-    codecCanRemapResolution     = 1L << 29,
-    codecIsDirectToScreenOnly   = 1L << 30,                     /* codec can only decompress data to the screen */
-    codecCanLockSurface         = 1L << 31                      /* codec can lock destination surface, icm doesn't lock for you */
-};
-
-/*  codec capabilities flags2   */
-enum {
-    codecUsesOverlaySurface     = 1L << 0,                      /* codec uses overlay surface */
-    codecImageBufferIsOverlaySurface = 1L << 1,                 /* codec image buffer is overlay surface, the bits in the buffer are on the screen */
-    codecSrcMustBeImageBuffer   = 1L << 2,                      /* codec can only source data from an image buffer */
-    codecImageBufferIsInAGPMemory = 1L << 4,                    /* codec image buffer is in AGP space, byte writes are OK */
-    codecImageBufferIsInPCIMemory = 1L << 5                     /* codec image buffer is across a PCI bus; byte writes are bad */
-};
-
-/*  codec condition flags   */
-// FFD =  13 = 8+4+1
-enum {
-    codecConditionFirstBand     = 1L << 0,     // 1
-    codecConditionLastBand      = 1L << 1,     // 2
-    codecConditionFirstFrame    = 1L << 2,     // 4
-    codecConditionNewDepth      = 1L << 3,     // 8
-    codecConditionNewTransform  = 1L << 4,     // 10
-    codecConditionNewSrcRect    = 1L << 5,     // 20
-    codecConditionNewMask       = 1L << 6,     // 40
-    codecConditionNewMatte      = 1L << 7,     // 80
-    codecConditionNewTransferMode = 1L << 8,   // 100
-    codecConditionNewClut       = 1L << 9,     // 200
-    codecConditionNewAccuracy   = 1L << 10,    // 400
-    codecConditionNewDestination = 1L << 11,   // 800
-    codecConditionFirstScreen   = 1L << 12,    // 1000
-    codecConditionDoCursor      = 1L << 13,    // 2000
-    codecConditionCatchUpDiff   = 1L << 14,    // 4000
-    codecConditionMaskMayBeChanged = 1L << 15, // 8000
-    codecConditionToBuffer      = 1L << 16,    // 10000
-    codecConditionCodecChangedMask = 1L << 31  // 20000
-};
-
-
-
-struct __attribute__((__packed__)) CodecCapabilities {
-    int32_t                         flags;
-    short                           wantedPixelSize;
-    short                           extendWidth;
-    short                           extendHeight;
-    short                           bandMin;
-    short                           bandInc;
-    short                           pad;
-    uint32_t                        time;
-    int32_t                         flags2;                     /* field new in QuickTime 4.0 */
-};
-typedef struct CodecCapabilities        CodecCapabilities;
-
-struct __attribute__((__packed__)) CodecDecompressParams {
-    ImageSequence                   sequenceID;                 /* predecompress,banddecompress */
-    ImageDescriptionHandle          imageDescription;           /* predecompress,banddecompress */
-    Ptr                             data;
-    int32_t                         bufferSize;
-
-    int32_t                         frameNumber;
-    int32_t                         startLine;
-    int32_t                         stopLine;
-    int32_t                         conditionFlags;
-
-    CodecFlags                      callerFlags; // short
-    CodecCapabilities *             capabilities;               /* predecompress,banddecompress */
-    ICMProgressProcRecord           progressProcRecord;
-    ICMCompletionProcRecord         completionProcRecord;
-
-    ICMDataProcRecord               dataProcRecord;
-    CGrafPtr                        port;                       /* predecompress,banddecompress */
-    PixMap                          dstPixMap;                  /* predecompress,banddecompress */
-    BitMapPtr                       maskBits;
-    PixMapPtr                       mattePixMap;
-    Rect                            srcRect;                    /* predecompress,banddecompress */
-    MatrixRecord *                  matrix;                     /* predecompress,banddecompress */
-    CodecQ                          accuracy;                   /* predecompress,banddecompress */
-    short                           transferMode;               /* predecompress,banddecompress */
-    ICMFrameTimePtr                 frameTime;                  /* banddecompress */
-    int32_t                         reserved[1];
-
-                                                                /* The following fields only exist for QuickTime 2.0 and greater */
-    SInt8                           matrixFlags;                /* high bit set if 2x resize */
-    SInt8                           matrixType;
-    Rect                            dstRect;                    /* only valid for simple transforms */
-
-                                                                /* The following fields only exist for QuickTime 2.1 and greater */
-    UInt16                          majorSourceChangeSeed;
-    UInt16                          minorSourceChangeSeed;
-    CDSequenceDataSourcePtr         sourceData;
-
-    RgnHandle                       maskRegion;
-
-                                                                /* The following fields only exist for QuickTime 2.5 and greater */
-    OSType **                       wantedDestinationPixelTypes; /* Handle to 0-terminated list of OSTypes */
-
-    int32_t                         screenFloodMethod;
-    int32_t                         screenFloodValue;
-    short                           preferredOffscreenPixelSize;
-
-                                                                /* The following fields only exist for QuickTime 3.0 and greater */
-    ICMFrameTimeInfoPtr             syncFrameTime;              /* banddecompress */
-    Boolean                         needUpdateOnTimeChange;     /* banddecompress */
-    Boolean                         enableBlackLining;
-    Boolean                         needUpdateOnSourceChange;   /* band decompress */
-    Boolean                         pad;
-
-    int32_t                         unused;
-
-    CGrafPtr                        finalDestinationPort;
-
-    int32_t                         requestedBufferWidth;       /* must set codecWantsSpecialScaling to indicate this field is valid*/
-    int32_t                         requestedBufferHeight;      /* must set codecWantsSpecialScaling to indicate this field is valid*/
-
-                                                                /* The following fields only exist for QuickTime 4.0 and greater */
-    Rect                            displayableAreaOfRequestedBuffer; /* set in predecompress*/
-    Boolean                         requestedSingleField;
-    Boolean                         needUpdateOnNextIdle;
-    Boolean                         pad2[2];
-    Fixed                           bufferGammaLevel;
-
-                                                                /* The following fields only exist for QuickTime 5.0 and greater */
-    UInt32                          taskWeight;                 /* preferred weight for MP tasks implementing this operation*/
-    OSType                          taskName;                   /* preferred name (type) for MP tasks implementing this operation*/
-};
-typedef struct CodecDecompressParams    CodecDecompressParams;
-
-
-
-struct __attribute__((__packed__)) ImageSubCodecDecompressCapabilities {
-    int32_t                         recordSize;                 /* sizeof(ImageSubCodecDecompressCapabilities)*/
-    int32_t                         decompressRecordSize;       /* size of your codec's decompress record*/
-    Boolean                         canAsync;                   /* default true*/
-    UInt8                           pad0;
-
-                                                                /* The following fields only exist for QuickTime 4.0 and greater */
-    UInt16                          suggestedQueueSize;
-    Boolean                         canProvideTrigger;
-
-                                                                /* The following fields only exist for QuickTime 5.0 and greater */
-    Boolean                         subCodecFlushesScreen;      /* only used on Mac OS X*/
-    Boolean                         subCodecCallsDrawBandComplete;
-    UInt8                           pad2[1];
-
-                                                                /* The following fields only exist for QuickTime 5.1 and greater */
-    Boolean                         isChildCodec;               /* set by base codec before calling Initialize*/
-    UInt8                           pad3[3];
-};
-typedef struct ImageSubCodecDecompressCapabilities ImageSubCodecDecompressCapabilities;
-
-
-struct __attribute__((__packed__)) ImageSubCodecDecompressRecord {
-    Ptr                             baseAddr;
-    int32_t                         rowBytes;
-    Ptr                             codecData;
-    ICMProgressProcRecord           progressProcRecord;
-    ICMDataProcRecord               dataProcRecord;
-    void *                          userDecompressRecord;       /* pointer to codec-specific per-band data*/
-    UInt8                           frameType;
-    Boolean                         inhibitMP;                  /* set this in BeginBand to tell the base decompressor not to call DrawBand from an MP task for this frame.  (Only has any effect for MP-capable subcodecs.  New in QuickTime 5.0.)*/
-    UInt8                           pad[2];
-    int32_t                         priv[2];
-
-                                                                /* The following fields only exist for QuickTime 5.0 and greater */
-    ImageCodecDrawBandCompleteUPP   drawBandCompleteUPP;        /* only used if subcodec set subCodecCallsDrawBandComplete; if drawBandCompleteUPP is non-nil, codec must call it when a frame is finished, but may return from DrawBand before the frame is finished. */
-    void *                          drawBandCompleteRefCon;     /* Note: do not call drawBandCompleteUPP directly from a hardware interrupt; instead, use DTInstall to run a function at deferred task time, and call drawBandCompleteUPP from that. */
-};
-typedef struct ImageSubCodecDecompressRecord ImageSubCodecDecompressRecord;
-
-
-/* These are the bits that are set in the Component flags, and also in the codecInfo struct. */
-enum {
-    codecInfoDoes1              = (1L << 0),                    /* codec can work with 1-bit pixels */
-    codecInfoDoes2              = (1L << 1),                    /* codec can work with 2-bit pixels */
-    codecInfoDoes4              = (1L << 2),                    /* codec can work with 4-bit pixels */
-    codecInfoDoes8              = (1L << 3),                    /* codec can work with 8-bit pixels */
-    codecInfoDoes16             = (1L << 4),                    /* codec can work with 16-bit pixels */
-    codecInfoDoes32             = (1L << 5),                    /* codec can work with 32-bit pixels */
-    codecInfoDoesDither         = (1L << 6),                    /* codec can do ditherMode */
-    codecInfoDoesStretch        = (1L << 7),                    /* codec can stretch to arbitrary sizes */
-    codecInfoDoesShrink         = (1L << 8),                    /* codec can shrink to arbitrary sizes */
-    codecInfoDoesMask           = (1L << 9),                    /* codec can mask to clipping regions */
-    codecInfoDoesTemporal       = (1L << 10),                   /* codec can handle temporal redundancy */
-    codecInfoDoesDouble         = (1L << 11),                   /* codec can stretch to double size exactly */
-    codecInfoDoesQuad           = (1L << 12),                   /* codec can stretch to quadruple size exactly */
-    codecInfoDoesHalf           = (1L << 13),                   /* codec can shrink to half size */
-    codecInfoDoesQuarter        = (1L << 14),                   /* codec can shrink to quarter size */
-    codecInfoDoesRotate         = (1L << 15),                   /* codec can rotate on decompress */
-    codecInfoDoesHorizFlip      = (1L << 16),                   /* codec can flip horizontally on decompress */
-    codecInfoDoesVertFlip       = (1L << 17),                   /* codec can flip vertically on decompress */
-    codecInfoHasEffectParameterList = (1L << 18),               /* codec implements get effects parameter list call, once was codecInfoDoesSkew */
-    codecInfoDoesBlend          = (1L << 19),                   /* codec can blend on decompress */
-    codecInfoDoesWarp           = (1L << 20),                   /* codec can warp arbitrarily on decompress */
-    codecInfoDoesRecompress     = (1L << 21),                   /* codec can recompress image without accumulating errors */
-    codecInfoDoesSpool          = (1L << 22),                   /* codec can spool image data */
-    codecInfoDoesRateConstrain  = (1L << 23)                    /* codec can data rate constrain */
-};
-
-
-enum {
-    codecInfoDepth1             = (1L << 0),                    /* compressed data at 1 bpp depth available */
-    codecInfoDepth2             = (1L << 1),                    /* compressed data at 2 bpp depth available */
-    codecInfoDepth4             = (1L << 2),                    /* compressed data at 4 bpp depth available */
-    codecInfoDepth8             = (1L << 3),                    /* compressed data at 8 bpp depth available */
-    codecInfoDepth16            = (1L << 4),                    /* compressed data at 16 bpp depth available */
-    codecInfoDepth32            = (1L << 5),                    /* compressed data at 32 bpp depth available */
-    codecInfoDepth24            = (1L << 6),                    /* compressed data at 24 bpp depth available */
-    codecInfoDepth33            = (1L << 7),                    /* compressed data at 1 bpp monochrome depth  available */
-    codecInfoDepth34            = (1L << 8),                    /* compressed data at 2 bpp grayscale depth available */
-    codecInfoDepth36            = (1L << 9),                    /* compressed data at 4 bpp grayscale depth available */
-    codecInfoDepth40            = (1L << 10),                   /* compressed data at 8 bpp grayscale depth available */
-    codecInfoStoresClut         = (1L << 11),                   /* compressed data can have custom cluts */
-    codecInfoDoesLossless       = (1L << 12),                   /* compressed data can be stored in lossless format */
-    codecInfoSequenceSensitive  = (1L << 13)                    /* compressed data is sensitive to out of sequence decoding */
-};
-
-struct __attribute__((__packed__)) CodecInfo {
-    Str31                           typeName;                   /* name of the codec type i.e.: 'Apple Image Compression' */
-    short                           version;                    /* version of the codec data that this codec knows about */
-    short                           revisionLevel;              /* revision level of this codec i.e: 0x00010001 (1.0.1) */
-    int32_t                         vendor;                     /* Maker of this codec i.e: 'appl' */
-    int32_t                         decompressFlags;            /* codecInfo flags for decompression capabilities */
-    int32_t                         compressFlags;              /* codecInfo flags for compression capabilities */
-    int32_t                         formatFlags;                /* codecInfo flags for compression format details */
-    UInt8                           compressionAccuracy;        /* measure (1-255) of accuracy of this codec for compress (0 if unknown) */
-    UInt8                           decompressionAccuracy;      /* measure (1-255) of accuracy of this codec for decompress (0 if unknown) */
-    unsigned short                  compressionSpeed;           /* ( millisecs for compressing 320x240 on base mac II) (0 if unknown)  */
-    unsigned short                  decompressionSpeed;         /* ( millisecs for decompressing 320x240 on mac II)(0 if unknown)  */
-    UInt8                           compressionLevel;           /* measure (1-255) of compression level of this codec (0 if unknown)  */
-    UInt8                           resvd;                      /* pad */
-    short                           minimumHeight;              /* minimum height of image (block size) */
-    short                           minimumWidth;               /* minimum width of image (block size) */
-    short                           decompressPipelineLatency;  /* in milliseconds ( for asynchronous codecs ) */
-    short                           compressPipelineLatency;    /* in milliseconds ( for asynchronous codecs ) */
-    int32_t                         privateData;
-};
-typedef struct CodecInfo                CodecInfo;
-
-enum {
-    codecFlagUseImageBuffer     = (1L << 0),                    /* decompress*/
-    codecFlagUseScreenBuffer    = (1L << 1),                    /* decompress*/
-    codecFlagUpdatePrevious     = (1L << 2),                    /* compress*/
-    codecFlagNoScreenUpdate     = (1L << 3),                    /* decompress*/
-    codecFlagWasCompressed      = (1L << 4),                    /* compress*/
-    codecFlagDontOffscreen      = (1L << 5),                    /* decompress*/
-    codecFlagUpdatePreviousComp = (1L << 6),                    /* compress*/
-    codecFlagForceKeyFrame      = (1L << 7),                    /* compress*/
-    codecFlagOnlyScreenUpdate   = (1L << 8),                    /* decompress*/
-    codecFlagLiveGrab           = (1L << 9),                    /* compress*/
-    codecFlagDiffFrame          = (1L << 9),                    /* decompress*/
-    codecFlagDontUseNewImageBuffer = (1L << 10),                /* decompress*/
-    codecFlagInterlaceUpdate    = (1L << 11),                   /* decompress*/
-    codecFlagCatchUpDiff        = (1L << 12),                   /* decompress*/
-    codecFlagSupportDisable     = (1L << 13),                   /* decompress*/
-    codecFlagReenable           = (1L << 14)                    /* decompress*/
-};
-
-static inline void dump_ImageDescription(void* xxx){
-    ImageDescription* id=(ImageDescription*)xxx;
-    unsigned char* x;
-    int i;
-
-    for(i=0;i<id->idSize;i++){
-       printf(" %02X",((unsigned char*)id)[i]);
-       if((i%16)==15) printf("\n");
-    }
-    printf("\n");
-
-
-    printf("=============== ImageDescription at %p ==================\n",xxx);
-    printf("idSize=0x%X  fourcc=0x%08X\n",id->idSize,id->cType);
-    printf("ver=%d rev=%d vendor=0x%08X\n",id->version,id->revisionLevel,id->vendor);
-    printf("tempQ=%d spatQ=%d  dim: %d x %d  dpi: %d x %d  depth: %d\n",
-       id->temporalQuality,id->spatialQuality,
-       id->width, id->height,
-       id->hRes, id->vRes,
-       id->depth);
-    printf("dataSize=%d frameCount=%d clutID=%d\n",id->dataSize, id->frameCount, id->clutID);
-    printf("name='%.*s'\n",((char*)(&id->name))[0],((char*)(&id->name))+1);
-    x=((char*)(&id->clutID))+2;
-    if(id->idSize>sizeof(ImageDescription)){
-       printf("%02X %02X %02X %02X | %02X %02X %02X %02X | %02X %02X %02X %02X | %02X %02X %02X %02X\n",
-       x[0],x[1],x[2],x[3],x[4],x[5],x[6],x[7],x[8],x[9],x[10],x[11],x[12],x[13],x[14],x[15]);
-    }
-    printf("=========================================================\n");
-}
-
-static inline void dump_Rect(char* title,Rect *r){
-    printf("%s: %d;%d - %d;%d\n",title,
-        (int)r->top,(int)r->left,(int)r->bottom,(int)r->right);
-}
-
-static inline void dump_MatrixRecord(char* title, MatrixRecord *m){
-    printf("%s: [%d %d %d][%d %d %d][%d %d %d]\n",title,
-       m->matrix[0][0],m->matrix[0][1],m->matrix[0][2],
-       m->matrix[1][0],m->matrix[1][1],m->matrix[1][2],
-       m->matrix[2][0],m->matrix[2][1],m->matrix[2][2]);
-}
-
-static inline void dump_PixMap(void* xxx){
-    PixMap *p=xxx;
-    printf("=============== PixMap at %p ==================\n",xxx);
-    printf("base=%p  stride=%d\n",p->baseAddr, p->rowBytes);
-    dump_Rect("bounds",&p->bounds);
-    printf("pmVersion=0x%X packType=0x%X\n packSize=0x%X\n",
-       p->pmVersion,p->packType, p->packSize);
-    printf("hRes=0x%X vRes=0x%X pixelType=0x%X pixelSize=0x%X\n",
-       p->hRes,p->vRes,p->pixelType,p->pixelSize);
-    printf("cmpCount=0x%X cmpSize=0x%X pixelFormat=0x%X\n",
-       p->cmpCount,p->cmpSize,p->pixelFormat);
-    printf("pmTable=%p pmExt=%p\n",p->pmTable,p->pmExt);
-    printf("=========================================================\n");
-}
-
-static inline void dump_CodecCapabilities(void* xxx){
-    CodecCapabilities* cc=xxx;
-    if(!xxx) return;
-    printf("=============== CodecCapabilities at %p =================\n",xxx);
-    printf("flags=0x%X  flags2=0x%X\n",cc->flags,cc->flags2);
-    printf("wantedPixelSize=%d extendWidth=%d extendHeight=%d band=%d+%d\n",
-       cc->wantedPixelSize,cc->extendWidth,cc->extendHeight,
-       cc->bandMin,cc->bandInc);
-    printf("pad=0x%X  time=0x%X\n",cc->pad,cc->time);
-    printf("=========================================================\n");
-}
-
-static inline void dump_CodecDecompressParams(void* xxx){
-    CodecDecompressParams* cd=xxx;
-    ImageDescription **idh;
-    int i;
-    if(!xxx) return;
-    printf("=============== CodecDecompressParams at %p ==================\n",xxx);
-    printf("sequenceID=%d\n",cd->sequenceID);
-    idh=cd->imageDescription;
-    if(idh && idh[0]) dump_ImageDescription(idh[0]);
-    
-    for(i=0;i<sizeof(CodecDecompressParams);i++){
-       printf(" %02X",((unsigned char*)cd)[i]);
-       if((i%16)==15) printf("\n");
-    }
-    printf("\n");
-    
-    printf("data=%p  size=%d\n",cd->data,cd->bufferSize);
-    printf("frameno=%d  lines: %d .. %d   condflags=0x%X  callerflags=0x%X\n",
-       cd->frameNumber, cd->startLine, cd->stopLine, cd->conditionFlags,cd->callerFlags);
-//    printf("maskBits=%p mattePixMap=%p\n",
-//     cd->maskBits,cd->mattePixMap);
-    dump_PixMap(&cd->dstPixMap);
-//    if(cd->mattePixMap) dump_PixMap(cd->mattePixMap);
-    if(cd->matrix) dump_MatrixRecord("matrix",cd->matrix);
-    if(cd->capabilities) dump_CodecCapabilities(cd->capabilities);
-    printf("accuracy=%d  transferMode=%d  matrixFlags=0x%X matrixType=%d\n",
-       (int)cd->accuracy, (int)cd->transferMode, (int)cd->matrixFlags, (int)cd->matrixType);
-    printf("srcrect: %d;%d - %d;%d\n",cd->srcRect.top,cd->srcRect.left,cd->srcRect.bottom,cd->srcRect.right);
-    printf("dstrect: %d;%d - %d;%d\n",cd->dstRect.top,cd->dstRect.left,cd->dstRect.bottom,cd->dstRect.right);
-    printf("wantedDestinationPixelTypes=%p\n",cd->wantedDestinationPixelTypes);
-    if(cd->wantedDestinationPixelTypes){
-       unsigned int* p=cd->wantedDestinationPixelTypes;
-       while(p[0]){
-           printf("  0x%08X %.4s\n",p[0],&p[0]);
-           ++p;
-       }
-    }
-    printf("screenFloodMethod=%d value=%d  preferredOffscreenPixelSize=%d\n",
-       cd->screenFloodMethod, cd->screenFloodValue, cd->preferredOffscreenPixelSize);
-    printf("callbacks: progress=%p compl=%p data=%p ftime=%p srcdata=%p sync=%p\n",
-     cd->progressProcRecord, cd->completionProcRecord,
-     cd->dataProcRecord, cd->frameTime, cd->sourceData, cd->syncFrameTime);
-//    printf("\n");
-
-    printf("=========================================================\n");
-
-
-}
-
diff --git a/modules/codec/loader/registry.c b/modules/codec/loader/registry.c
deleted file mode 100644 (file)
index 5bc802f..0000000
+++ /dev/null
@@ -1,551 +0,0 @@
-/*
- * $Id$
- *
- * Copyright (C) 1999 Alexandre Julliard
- *
- * Originally distributed under LPGL 2.1 (or later) by the Wine project.
- *
- * Modified for use with MPlayer, detailed CVS changelog at
- * http://www.mplayerhq.hu/cgi-bin/cvsweb.cgi/main/
- *
- * File now distributed as part of VLC media player with no modifications.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
- */
-
-#include "config.h"
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <pwd.h>
-#include <sys/types.h>
-
-#include "wine/winbase.h"
-#include "wine/winreg.h"
-#include "wine/winnt.h"
-#include "wine/winerror.h"
-
-#include "ext.h"
-#include "registry.h"
-
-//#undef TRACE
-//#define TRACE printf
-
-extern char *get_path ( char * );
-
-// ...can be set before init_registry() call
-char* regpathname = NULL;
-
-static char* localregpathname = NULL;
-
-typedef struct reg_handle_s
-{
-       int handle;
-       char* name;
-       struct reg_handle_s* next;
-       struct reg_handle_s* prev;
-} reg_handle_t;
-
-struct reg_value
-{
-       int type;
-       char* name;
-       int len;
-       char* value;
-};
-
-static struct reg_value* regs = NULL;
-static int reg_size;
-static reg_handle_t* head = NULL;
-
-#define DIR -25
-
-static void create_registry(void);
-static void open_registry(void);
-static void save_registry(void);
-static void init_registry(void);
-
-
-static void create_registry(void){
-    if(regs)
-    {
-       printf("Logic error: create_registry() called with existing registry\n");
-       save_registry();
-       return;
-    }
-    regs=(struct reg_value*)malloc(3*sizeof(struct reg_value));
-    regs[0].type=regs[1].type=DIR;
-    regs[0].name=(char*)malloc(5);
-    strcpy(regs[0].name, "HKLM");
-    regs[1].name=(char*)malloc(5);
-    strcpy(regs[1].name, "HKCU");
-    regs[0].value=regs[1].value=NULL;
-    regs[0].len=regs[1].len=0;
-    reg_size=2;
-    head = 0;
-    save_registry();
-}
-
-static void open_registry(void)
-{
-       int fd;
-       int i;
-       unsigned int len;
-       if(regs)
-       {
-               printf("Multiple open_registry(>\n");
-               return;
-       }
-       fd = open(localregpathname, O_RDONLY);
-       if (fd == -1)
-       {
-           printf("Creating new registry\n");
-           create_registry();
-           return;
-       }
-       read(fd, &reg_size, 4);
-       regs=(struct reg_value*)malloc(reg_size*sizeof(struct reg_value));
-       head = 0;
-       for(i=0; i<reg_size; i++)
-       {
-               read(fd,&regs[i].type,4);
-               read(fd,&len,4);
-               regs[i].name=(char*)malloc(len+1);
-               if(regs[i].name==NULL)
-               {
-                       reg_size=i+1;
-                       goto error;
-               }
-               read(fd, regs[i].name, len);
-               regs[i].name[len]=0;
-               read(fd,&regs[i].len,4);
-               regs[i].value=(char*)malloc(regs[i].len+1);
-               if(regs[i].value==NULL)
-               {
-                       free(regs[i].name);
-                       reg_size=i+1;
-                       goto error;
-               }
-               read(fd, regs[i].value, regs[i].len);
-               regs[i].value[regs[i].len]=0;
-       }
-error:
-       close(fd);
-       return;
-}
-
-static void save_registry(void)
-{
-       int fd, i;
-       if (!regs)
-               init_registry();
-       fd = open(localregpathname, O_WRONLY | O_CREAT, 00666);
-       if (fd == -1)
-       {
-           printf("Failed to open registry file '%s' for writing.\n",
-                  localregpathname);
-           return;
-       }
-       write(fd, &reg_size, 4);
-       for(i=0; i<reg_size; i++)
-       {
-               unsigned len=strlen(regs[i].name);
-               write(fd, &regs[i].type, 4);
-               write(fd, &len, 4);
-               write(fd, regs[i].name, len);
-               write(fd, &regs[i].len, 4);
-               write(fd, regs[i].value, regs[i].len);
-       }
-       close(fd);
-}
-
-void free_registry(void)
-{
-    reg_handle_t* t = head;
-    while (t)
-    {
-       reg_handle_t* f = t;
-       free(t->name);
-       t=t->prev;
-        free(f);
-    }
-    head = 0;
-    if (regs)
-    {
-        int i;
-       for(i=0; i<reg_size; i++)
-       {
-           free(regs[i].name);
-           free(regs[i].value);
-       }
-       free(regs);
-       regs = 0;
-    }
-
-    if (localregpathname != regpathname)
-       free(localregpathname);
-    localregpathname = 0;
-}
-
-
-static reg_handle_t* find_handle_by_name(const char* name)
-{
-       reg_handle_t* t;
-       for(t=head; t; t=t->prev)
-       {
-               if(!strcmp(t->name, name))
-               {
-                       return t;
-               }
-       }
-       return 0;
-}
-static struct reg_value* find_value_by_name(const char* name)
-{
-       int i;
-       for(i=0; i<reg_size; i++)
-               if(!strcmp(regs[i].name, name))
-                       return regs+i;
-       return 0;
-}
-static reg_handle_t* find_handle(int handle)
-{
-       reg_handle_t* t;
-       for(t=head; t; t=t->prev)
-       {
-               if(t->handle==handle)
-               {
-                       return t;
-               }
-       }
-       return 0;
-}
-static int generate_handle()
-{
-       static unsigned int zz=249;
-       zz++;
-       while((zz==HKEY_LOCAL_MACHINE) || (zz==HKEY_CURRENT_USER))
-               zz++;
-       return zz;
-}
-
-static reg_handle_t* insert_handle(long handle, const char* name)
-{
-       reg_handle_t* t;
-       t=(reg_handle_t*)malloc(sizeof(reg_handle_t));
-       if(head==NULL)
-       {
-               t->prev=0;
-       }
-       else
-       {
-               head->next=t;
-               t->prev=head;
-       }
-       t->next=0;
-       t->name=(char*)malloc(strlen(name)+1);
-       strcpy(t->name, name);
-       t->handle=handle;
-       head=t;
-       return t;
-}
-static char* build_keyname(long key, const char* subkey)
-{
-       char* full_name;
-       reg_handle_t* t;
-        if((t=find_handle(key))==NULL)
-       {
-               TRACE("Invalid key\n");
-               return NULL;
-       }
-       if(subkey==NULL)
-               subkey="<default>";
-       full_name=(char*)malloc(strlen(t->name)+strlen(subkey)+10);
-       strcpy(full_name, t->name);
-       strcat(full_name, "\\");
-       strcat(full_name, subkey);
-       return full_name;
-}
-static struct reg_value* insert_reg_value(int handle, const char* name, int type, const void* value, int len)
-{
-       reg_handle_t* t;
-       struct reg_value* v;
-       char* fullname;
-       if((fullname=build_keyname(handle, name))==NULL)
-       {
-               TRACE("Invalid handle\n");
-               return NULL;
-       }
-
-       if((v=find_value_by_name(fullname))==NULL)
-       //creating new value in registry
-       {
-               if(regs==NULL)
-                   create_registry();
-               regs=(struct reg_value*)realloc(regs, sizeof(struct reg_value)*(reg_size+1));
-               //regs=(struct reg_value*)my_realloc(regs, sizeof(struct reg_value)*(reg_size+1));
-               v=regs+reg_size;
-               reg_size++;
-       }
-       else
-       //replacing old one
-       {
-           free(v->value);
-           free(v->name);
-       }
-       TRACE("RegInsert '%s'  %p  v:%d  len:%d\n", name, value, *(int*)value, len);
-       v->type=type;
-       v->len=len;
-       v->value=(char*)malloc(len);
-       memcpy(v->value, value, len);
-       v->name=(char*)malloc(strlen(fullname)+1);
-       strcpy(v->name, fullname);
-        free(fullname);
-       save_registry();
-       return v;
-}
-
-static void init_registry(void)
-{
-       TRACE("Initializing registry\n");
-       // can't be free-ed - it's static and probably thread
-       // unsafe structure which is stored in glibc
-
-#ifdef MPLAYER
-       regpathname = get_path("registry");
-       localregpathname = regpathname;
-#else
-       // regpathname is an external pointer
-        //
-       // registry.c is holding its own internal pointer
-       // localregpathname  - which is being allocate/deallocated
-
-       if (localregpathname == NULL)
-       {
-            const char* pthn = regpathname;
-           if (!regpathname)
-           {
-               // avifile - for now reading data from user's home
-               struct passwd* pwent;
-               pwent = getpwuid(geteuid());
-                pthn = pwent->pw_dir;
-           }
-
-           localregpathname = (char*)malloc(strlen(pthn)+20);
-           strcpy(localregpathname, pthn);
-           strcat(localregpathname, "/.registry");
-       }
-#endif
-
-       open_registry();
-       insert_handle(HKEY_LOCAL_MACHINE, "HKLM");
-       insert_handle(HKEY_CURRENT_USER, "HKCU");
-}
-
-static reg_handle_t* find_handle_2(long key, const char* subkey)
-{
-       char* full_name;
-       reg_handle_t* t;
-        if((t=find_handle(key))==NULL)
-       {
-               TRACE("Invalid key\n");
-               return (reg_handle_t*)-1;
-       }
-       if(subkey==NULL)
-               return t;
-       full_name=(char*)malloc(strlen(t->name)+strlen(subkey)+10);
-       strcpy(full_name, t->name);
-       strcat(full_name, "\\");
-       strcat(full_name, subkey);
-       t=find_handle_by_name(full_name);
-       free(full_name);
-       return t;
-}
-
-long __stdcall RegOpenKeyExA(long key, const char* subkey, long reserved, long access, int* newkey)
-{
-    char* full_name;
-    reg_handle_t* t;
-    struct reg_value* v;
-    TRACE("Opening key %s\n", subkey);
-
-    if(!regs)
-        init_registry()
-;
-/*     t=find_handle_2(key, subkey);
-
-       if(t==0)
-               return -1;
-
-       if(t==(reg_handle_t*)-1)
-               return -1;
-*/
-    full_name=build_keyname(key, subkey);
-    if(!full_name)
-        return -1;
-    TRACE("Opening key Fullname %s\n", full_name);
-    v=find_value_by_name(full_name);
-
-    t=insert_handle(generate_handle(), full_name);
-    *newkey=t->handle;
-    free(full_name);
-
-    return 0;
-}
-long __stdcall RegCloseKey(long key)
-{
-    reg_handle_t *handle;
-    if(key==(long)HKEY_LOCAL_MACHINE)
-       return 0;
-    if(key==(long)HKEY_CURRENT_USER)
-       return 0;
-    handle=find_handle(key);
-    if(handle==NULL)
-       return 0;
-    if(handle->prev)
-       handle->prev->next=handle->next;
-    if(handle->next)
-       handle->next->prev=handle->prev;
-    free(handle->name);
-    if(handle==head)
-       head=head->prev;
-    free(handle);
-    return 1;
-}
-
-long __stdcall RegQueryValueExA(long key, const char* value, int* reserved, int* type, int* data, int* count)
-{
-    struct reg_value* t;
-    char* c;
-    TRACE("Querying value %s\n", value);
-    if(!regs)
-       init_registry();
-
-    c=build_keyname(key, value);
-    if (!c)
-       return 1;
-    t=find_value_by_name(c);
-    free(c);
-    if (t==NULL)
-       return 2;
-    if (type)
-       *type=t->type;
-    if (data)
-    {
-       memcpy(data, t->value, (t->len<*count)?t->len:*count);
-       TRACE("returning %d bytes: %d\n", t->len, *(int*)data);
-    }
-    if(*count<t->len)
-    {
-       *count=t->len;
-       return ERROR_MORE_DATA;
-    }
-    else
-    {
-       *count=t->len;
-    }
-    return 0;
-}
-long __stdcall RegCreateKeyExA(long key, const char* name, long reserved,
-                    void* classs, long options, long security,
-                    void* sec_attr, int* newkey, int* status)
-{
-    reg_handle_t* t;
-    char* fullname;
-    struct reg_value* v;
-    //        TRACE("Creating/Opening key %s\n", name);
-    if(!regs)
-       init_registry();
-
-    fullname=build_keyname(key, name);
-    if (!fullname)
-       return 1;
-    TRACE("Creating/Opening key %s\n", fullname);
-    v=find_value_by_name(fullname);
-    if(v==NULL)
-    {
-       int qw=45708;
-       v=insert_reg_value(key, name, DIR, &qw, 4);
-       if (status) *status=REG_CREATED_NEW_KEY;
-       //              return 0;
-    }
-
-    t=insert_handle(generate_handle(), fullname);
-    *newkey=t->handle;
-    free(fullname);
-    return 0;
-}
-
-/*
-LONG RegEnumValue(
-  HKEY hKey,              // handle to key to query
-  DWORD dwIndex,          // index of value to query
-  LPTSTR lpValueName,     // address of buffer for value string
-  LPDWORD lpcbValueName,  // address for size of value buffer
-  LPDWORD lpReserved,     // reserved
-  LPDWORD lpType,         // address of buffer for type code
-  LPBYTE lpData,          // address of buffer for value data
-  LPDWORD lpcbData        // address for size of data buffer
-);
-*/
-
-long __stdcall RegEnumValueA(HKEY hkey, DWORD index, LPSTR value, LPDWORD val_count,
-                  LPDWORD reserved, LPDWORD type, LPBYTE data, LPDWORD count)
-{
-    // currenly just made to support MSZH & ZLIB
-    //printf("Reg Enum 0x%x %d  %s %d   data: %p %d  %d >%s<\n", hkey, index,
-    //       value, *val_count, data, *count, reg_size, data);
-    reg_handle_t* t = find_handle(hkey);
-    if (t && index < 10)
-    {
-       struct reg_value* v=find_value_by_name(t->name);
-       if (v)
-       {
-           memcpy(data, v->value, (v->len < *count) ? v->len : *count);
-           if(*count < v->len)
-               *count = v->len;
-           if (type)
-               *type = v->type;
-           //printf("Found handle  %s\n", v->name);
-           return 0;
-       }
-    }
-    return ERROR_NO_MORE_ITEMS;
-}
-
-long __stdcall RegSetValueExA(long key, const char* name, long v1, long v2, const void* data, long size)
-{
-    struct reg_value* t;
-    char* c;
-    TRACE("Request to set value %s %d\n", name, *(const int*)data);
-    if(!regs)
-       init_registry();
-
-    c=build_keyname(key, name);
-    if(c==NULL)
-       return 1;
-    insert_reg_value(key, name, v2, data, size);
-    free(c);
-    return 0;
-}
-
-long __stdcall RegEnumKeyExA(HKEY hKey, DWORD dwIndex, LPSTR lpName, LPDWORD lpcbName,
-                  LPDWORD lpReserved, LPSTR lpClass, LPDWORD lpcbClass,
-                  LPFILETIME lpftLastWriteTime)
-{
-    return ERROR_NO_MORE_ITEMS;
-}
diff --git a/modules/codec/loader/registry.h b/modules/codec/loader/registry.h
deleted file mode 100644 (file)
index fd27576..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-#ifndef AVIFILE_REGISTRY_H
-#define AVIFILE_REGISTRY_H
-
-/********************************************************
- *
- *       Declaration of registry access functions
- *       Copyright 2000 Eugene Kuznetsov  (divx@euro.ru)
- *
- ********************************************************/
-
-/*
- * Modified for use with MPlayer, detailed CVS changelog at
- * http://www.mplayerhq.hu/cgi-bin/cvsweb.cgi/main/
- * $Id$
- */
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void free_registry(void);
-
-long __stdcall RegOpenKeyExA(long key, const char* subkey, long reserved,
-                  long access, int* newkey);
-long __stdcall RegCloseKey(long key);
-long __stdcall RegQueryValueExA(long key, const char* value, int* reserved,
-                     int* type, int* data, int* count);
-long __stdcall RegCreateKeyExA(long key, const char* name, long reserved,
-                    void* classs, long options, long security,
-                    void* sec_attr, int* newkey, int* status);
-long __stdcall RegSetValueExA(long key, const char* name, long v1, long v2,
-                   const void* data, long size);
-
-#ifdef __WINE_WINERROR_H
-
-long __stdcall RegEnumKeyExA(HKEY hKey, DWORD dwIndex, LPSTR lpName, LPDWORD lpcbName,
-                  LPDWORD lpReserved, LPSTR lpClass, LPDWORD lpcbClass,
-                  LPFILETIME lpftLastWriteTime);
-long __stdcall RegEnumValueA(HKEY hkey, DWORD index, LPSTR value, LPDWORD val_count,
-                  LPDWORD reserved, LPDWORD type, LPBYTE data, LPDWORD count);
-#endif
-#ifdef __cplusplus
-};
-#endif
-
-#endif // AVIFILE_REGISTRY_H
diff --git a/modules/codec/loader/resource.c b/modules/codec/loader/resource.c
deleted file mode 100644 (file)
index 3560dd0..0000000
+++ /dev/null
@@ -1,504 +0,0 @@
-/*
- * Resources
- * $Id$
- *
- * Copyright 1993 Robert J. Amstadt
- * Copyright 1995 Alexandre Julliard
- *
- * Originally distributed under LPGL 2.1 (or later) by the Wine project.
- *
- * Modified for use with MPlayer, detailed CVS changelog at
- * http://www.mplayerhq.hu/cgi-bin/cvsweb.cgi/main/
- *
- * File now distributed as part of VLC media player with no modifications.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
- */
-#include "config.h"
-
-#include <assert.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <unistd.h>
-
-#include "wine/winbase.h"
-#include "wine/windef.h"
-#include "wine/winuser.h"
-#include "wine/heap.h"
-#include "wine/module.h"
-#include "wine/debugtools.h"
-#include "wine/winerror.h"
-#include "loader.h"
-
-#define CP_ACP                                 0
-
-WORD WINE_LanguageId=0x409;//english
-
-#define HRSRC_MAP_BLOCKSIZE 16
-
-typedef struct _HRSRC_ELEM
-{
-    HANDLE hRsrc;
-    WORD     type;
-} HRSRC_ELEM;
-
-typedef struct _HRSRC_MAP
-{
-    int nAlloc;
-    int nUsed;
-    HRSRC_ELEM *elem;
-} HRSRC_MAP;
-
-static HRSRC RES_FindResource2( HMODULE hModule, LPCSTR type,
-                               LPCSTR name, WORD lang, int unicode)
-{
-    HRSRC hRsrc = 0;
-    LPWSTR typeStr, nameStr;    
-    WINE_MODREF *wm = MODULE32_LookupHMODULE( hModule );
-
-    if(!wm)
-       return 0;    
-    /* 32-bit PE module */
-
-    
-    if ( HIWORD( type ) && (!unicode))
-       typeStr = HEAP_strdupAtoW( GetProcessHeap(), 0, type );
-    else
-       typeStr = (LPWSTR)type;
-    if ( HIWORD( name ) && (!unicode))
-       nameStr = HEAP_strdupAtoW( GetProcessHeap(), 0, name );
-    else
-       nameStr = (LPWSTR)name;
-    
-    hRsrc = PE_FindResourceExW( wm, nameStr, typeStr, lang );
-    
-    if ( HIWORD( type ) && (!unicode)) 
-       HeapFree( GetProcessHeap(), 0, typeStr );
-    if ( HIWORD( name ) && (!unicode)) 
-       HeapFree( GetProcessHeap(), 0, nameStr );
-
-    return hRsrc;
-}
-
-/**********************************************************************
- *          RES_FindResource
- */
-
-static HRSRC RES_FindResource( HMODULE hModule, LPCSTR type,
-                               LPCSTR name, WORD lang, int unicode )
-{
-    HRSRC hRsrc;
-//    __TRY
-//    {
-       hRsrc = RES_FindResource2(hModule, type, name, lang, unicode);
-//    }
-//    __EXCEPT(page_fault)
-//    {
-//     WARN("page fault\n");
-//     SetLastError(ERROR_INVALID_PARAMETER);
-//     return 0;
-//    }
-//    __ENDTRY
-    return hRsrc;
-}
-
-/**********************************************************************
- *          RES_SizeofResource
- */
-static DWORD RES_SizeofResource( HMODULE hModule, HRSRC hRsrc)
-{
-    DWORD size = 0;
-    HRSRC hRsrc32;
-
-//    HMODULE16 hMod16   = MapHModuleLS( hModule );
-//    NE_MODULE *pModule = NE_GetPtr( hMod16 );
-//    WINE_MODREF *wm    = pModule && pModule->module32? 
-//                         MODULE32_LookupHMODULE( pModule->module32 ) : NULL;
-    WINE_MODREF *wm = MODULE32_LookupHMODULE( hModule );
-
-    if ( !hModule || !hRsrc ) return 0;
-
-    /* 32-bit PE module */
-    /* If we got a 16-bit hRsrc, convert it */
-//    hRsrc32  = HIWORD(hRsrc)? hRsrc : MapHRsrc16To32( pModule, hRsrc );
-    if(!HIWORD(hRsrc))
-    {
-       printf("16-bit hRsrcs not supported\n");
-       return 0;
-    }  
-    size = PE_SizeofResource( hModule, hRsrc );
-    return size;
-}
-
-/**********************************************************************
- *          RES_AccessResource
- */
-static HFILE RES_AccessResource( HMODULE hModule, HRSRC hRsrc )
-{
-    HFILE hFile = HFILE_ERROR;
-
-    WINE_MODREF *wm = MODULE32_LookupHMODULE( hModule );
-
-    if ( !hModule || !hRsrc ) return HFILE_ERROR;
-
-    /* 32-bit PE module */
-    FIXME("32-bit modules not yet supported.\n" );
-    hFile = HFILE_ERROR;
-
-    return hFile;
-}
-
-/**********************************************************************
- *          RES_LoadResource
- */
-static HGLOBAL RES_LoadResource( HMODULE hModule, HRSRC hRsrc)
-{
-    HGLOBAL hMem = 0;
-    HRSRC hRsrc32;
-    WINE_MODREF *wm = MODULE32_LookupHMODULE( hModule );
-
-
-    if ( !hModule || !hRsrc ) return 0;
-
-    /* 32-bit PE module */
-
-    /* If we got a 16-bit hRsrc, convert it */
-//    hRsrc32 = HIWORD(hRsrc)? hRsrc : MapHRsrc16To32( pModule, hRsrc );
-    if(!HIWORD(hRsrc))
-    {
-       printf("16-bit hRsrcs not supported\n");
-       return 0;
-    }
-    hMem = PE_LoadResource( wm, hRsrc );
-
-    return hMem;
-}
-
-/**********************************************************************
- *          RES_LockResource
- */
-static LPVOID RES_LockResource( HGLOBAL handle )
-{
-    LPVOID bits = NULL;
-
-    TRACE("(%08x, %s)\n", handle, "PE" );
-
-    bits = (LPVOID)handle;
-
-    return bits;
-}
-
-/**********************************************************************
- *          RES_FreeResource
- */
-static WIN_BOOL RES_FreeResource( HGLOBAL handle )
-{
-    HGLOBAL retv = handle;
-    return (WIN_BOOL)retv;
-}
-
-/**********************************************************************
- *         FindResourceA    (KERNEL32.128)
- */
-HANDLE WINAPI FindResourceA( HMODULE hModule, LPCSTR name, LPCSTR type )
-{
-    return RES_FindResource( hModule, type, name, 
-                             WINE_LanguageId, 0);
-}
-HANDLE WINAPI FindResourceW( HMODULE hModule, LPCWSTR name, LPCWSTR type )
-{
-    return RES_FindResource( hModule, (LPCSTR)type, (LPCSTR)name, 
-                             WINE_LanguageId, 1);
-}
-
-/**********************************************************************
- *         FindResourceExA  (KERNEL32.129)
- */
-HANDLE WINAPI FindResourceExA( HMODULE hModule, 
-                               LPCSTR type, LPCSTR name, WORD lang )
-{
-    return RES_FindResource( hModule, type, name, 
-                             lang, 0 );
-}
-
-HANDLE WINAPI FindResourceExW( HMODULE hModule, 
-                               LPCWSTR type, LPCWSTR name, WORD lang )
-{
-    return RES_FindResource( hModule, (LPCSTR)type, (LPCSTR)name, 
-                             lang, 1 );
-}
-
-
-
-/**********************************************************************
- *         LockResource     (KERNEL32.384)
- */
-LPVOID WINAPI LockResource( HGLOBAL handle )
-{
-    return RES_LockResource( handle );
-}
-
-
-/**********************************************************************
- *         FreeResource     (KERNEL32.145)
- */
-WIN_BOOL WINAPI FreeResource( HGLOBAL handle )
-{
-    return RES_FreeResource( handle );
-}
-
-
-/**********************************************************************
- *         AccessResource   (KERNEL32.64)
- */
-INT WINAPI AccessResource( HMODULE hModule, HRSRC hRsrc )
-{
-    return RES_AccessResource( hModule, hRsrc );
-}
-/**********************************************************************
- *         SizeofResource   (KERNEL32.522)
- */
-DWORD WINAPI SizeofResource( HINSTANCE hModule, HRSRC hRsrc )
-{
-    return RES_SizeofResource( hModule, hRsrc );
-}
-
-
-INT WINAPI LoadStringW( HINSTANCE instance, UINT resource_id,
-                            LPWSTR buffer, INT buflen );
-
-/**********************************************************************
- *     LoadStringA     (USER32.375)
- */
-INT WINAPI LoadStringA( HINSTANCE instance, UINT resource_id,
-                            LPSTR buffer, INT buflen )
-{
-    INT    retval;
-    INT    wbuflen;
-    INT    abuflen;
-    LPWSTR wbuf = NULL;
-    LPSTR  abuf = NULL;
-
-    if ( buffer != NULL && buflen > 0 )
-       *buffer = 0;
-
-    wbuflen = LoadStringW(instance,resource_id,NULL,0);
-    if ( !wbuflen )
-       return 0;
-    wbuflen ++;
-
-    retval = 0;
-    wbuf = (LPWSTR) HeapAlloc( GetProcessHeap(), 0, wbuflen * sizeof(WCHAR) );
-    wbuflen = LoadStringW(instance,resource_id,wbuf,wbuflen);
-    if ( wbuflen > 0 )
-    {
-       abuflen = WideCharToMultiByte(CP_ACP,0,wbuf,wbuflen,NULL,0,NULL,NULL);
-       if ( abuflen > 0 )
-       {
-           if ( buffer == NULL || buflen == 0 )
-               retval = abuflen;
-           else
-           {
-               abuf = (LPSTR) HeapAlloc( GetProcessHeap(), 0, abuflen * sizeof(CHAR) );
-               abuflen = WideCharToMultiByte(CP_ACP,0,wbuf,wbuflen,abuf,abuflen,NULL,NULL);
-               if ( abuflen > 0 )
-               {
-                   abuflen = min(abuflen,buflen - 1);
-                   memcpy( buffer, abuf, abuflen );
-                   buffer[abuflen] = 0;
-                   retval = abuflen;
-               }
-               HeapFree( GetProcessHeap(), 0, abuf );
-           }
-       }
-    }
-    HeapFree( GetProcessHeap(), 0, wbuf );
-
-    return retval;
-}
-
-/**********************************************************************
- *     LoadStringW             (USER32.376)
- */
-INT WINAPI LoadStringW( HINSTANCE instance, UINT resource_id,
-                            LPWSTR buffer, INT buflen )
-{
-    HGLOBAL hmem;
-    HRSRC hrsrc;
-    WCHAR *p;
-    int string_num;
-    int i;
-
-    if (HIWORD(resource_id)==0xFFFF) /* netscape 3 passes this */
-       resource_id = (UINT)(-((INT)resource_id));
-    TRACE("instance = %04x, id = %04x, buffer = %08x, "
-          "length = %d\n", instance, (int)resource_id, (int) buffer, buflen);
-
-    /* Use bits 4 - 19 (incremented by 1) as resourceid, mask out 
-     * 20 - 31. */
-    hrsrc = FindResourceW( instance, (LPCWSTR)(((resource_id>>4)&0xffff)+1),
-                             RT_STRINGW );
-    if (!hrsrc) return 0;
-    hmem = LoadResource( instance, hrsrc );
-    if (!hmem) return 0;
-    
-    p = (WCHAR*) LockResource(hmem);
-    string_num = resource_id & 0x000f;
-    for (i = 0; i < string_num; i++)
-       p += *p + 1;
-    
-    TRACE("strlen = %d\n", (int)*p );
-    
-    if (buffer == NULL) return *p;
-    i = min(buflen - 1, *p);
-    if (i > 0) {
-       memcpy(buffer, p + 1, i * sizeof (WCHAR));
-       buffer[i] = (WCHAR) 0;
-    } else {
-       if (buflen > 1) {
-           buffer[0] = (WCHAR) 0;
-           return 0;
-       }
-#if 0
-       WARN("Don't know why caller give buflen=%d *p=%d trying to obtain string '%s'\n", buflen, *p, p + 1);
-#endif
-    }
-
-    TRACE("String loaded !\n");
-    return i;
-}
-
-/* Messages...used by FormatMessage32* (KERNEL32.something)
- * 
- * They can be specified either directly or using a message ID and
- * loading them from the resource.
- * 
- * The resourcedata has following format:
- * start:
- * 0: DWORD nrofentries
- * nrofentries * subentry:
- *     0: DWORD firstentry
- *     4: DWORD lastentry
- *      8: DWORD offset from start to the stringentries
- *
- * (lastentry-firstentry) * stringentry:
- * 0: WORD len (0 marks end)
- * 2: WORD flags
- * 4: CHAR[len-4]
- *     (stringentry i of a subentry refers to the ID 'firstentry+i')
- *
- * Yes, ANSI strings in win32 resources. Go figure.
- */
-
-/**********************************************************************
- *     LoadMessageA            (internal)
- */
-INT WINAPI LoadMessageA( HMODULE instance, UINT id, WORD lang,
-                      LPSTR buffer, INT buflen )
-{
-    HGLOBAL    hmem;
-    HRSRC      hrsrc;
-    PMESSAGE_RESOURCE_DATA     mrd;
-    PMESSAGE_RESOURCE_BLOCK    mrb;
-    PMESSAGE_RESOURCE_ENTRY    mre;
-    int                i,slen;
-
-    TRACE("instance = %08lx, id = %08lx, buffer = %p, length = %ld\n", (DWORD)instance, (DWORD)id, buffer, (DWORD)buflen);
-
-    /*FIXME: I am not sure about the '1' ... But I've only seen those entries*/
-    hrsrc = FindResourceExW(instance,RT_MESSAGELISTW,(LPWSTR)1,lang);
-    if (!hrsrc) return 0;
-    hmem = LoadResource( instance, hrsrc );
-    if (!hmem) return 0;
-    
-    mrd = (PMESSAGE_RESOURCE_DATA)LockResource(hmem);
-    mre = NULL;
-    mrb = &(mrd->Blocks[0]);
-    for (i=mrd->NumberOfBlocks;i--;) {
-       if ((id>=mrb->LowId) && (id<=mrb->HighId)) {
-           mre = (PMESSAGE_RESOURCE_ENTRY)(((char*)mrd)+mrb->OffsetToEntries);
-           id  -= mrb->LowId;
-           break;
-       }
-       mrb++;
-    }
-    if (!mre)
-       return 0;
-    for (i=id;i--;) {
-       if (!mre->Length)
-               return 0;
-       mre = (PMESSAGE_RESOURCE_ENTRY)(((char*)mre)+(mre->Length));
-    }
-    slen=mre->Length;
-    TRACE("    - strlen=%d\n",slen);
-    i = min(buflen - 1, slen);
-    if (buffer == NULL)
-       return slen;
-    if (i>0) {
-       lstrcpynA(buffer,(char*)mre->Text,i);
-       buffer[i]=0;
-    } else {
-       if (buflen>1) {
-           buffer[0]=0;
-           return 0;
-       }
-    }
-    if (buffer)
-           TRACE("'%s' copied !\n", buffer);
-    return i;
-}
-
-
-
-/**********************************************************************
- *     EnumResourceTypesA      (KERNEL32.90)
- */
-WIN_BOOL WINAPI EnumResourceTypesA( HMODULE hmodule,ENUMRESTYPEPROCA lpfun,
-                                    LONG lParam)
-{
-       /* FIXME: move WINE_MODREF stuff here */
-    return PE_EnumResourceTypesA(hmodule,lpfun,lParam);
-}
-
-/**********************************************************************
- *     EnumResourceNamesA      (KERNEL32.88)
- */
-WIN_BOOL WINAPI EnumResourceNamesA( HMODULE hmodule, LPCSTR type,
-                                    ENUMRESNAMEPROCA lpfun, LONG lParam )
-{
-       /* FIXME: move WINE_MODREF stuff here */
-    return PE_EnumResourceNamesA(hmodule,type,lpfun,lParam);
-}
-/**********************************************************************
- *     EnumResourceLanguagesA  (KERNEL32.86)
- */
-WIN_BOOL WINAPI EnumResourceLanguagesA( HMODULE hmodule, LPCSTR type,
-                                        LPCSTR name, ENUMRESLANGPROCA lpfun,
-                                        LONG lParam)
-{
-       /* FIXME: move WINE_MODREF stuff here */
-    return PE_EnumResourceLanguagesA(hmodule,type,name,lpfun,lParam);
-}
-/**********************************************************************
- *         LoadResource     (KERNEL32.370)
- */
-HGLOBAL WINAPI LoadResource( HINSTANCE hModule, HRSRC hRsrc )
-{
-    return RES_LoadResource( hModule, hRsrc);
-}
diff --git a/modules/codec/loader/stubs.s b/modules/codec/loader/stubs.s
deleted file mode 100644 (file)
index 24d99aa..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-       .data
-.LC0:  .string "Called unk_%s\n"
-       .balign 4
-.globl unk_exp1
-unk_exp1:
-       pushl %ebp
-       movl %esp,%ebp
-       subl $4,%esp
-       movl $1,-4(%ebp)
-       movl -4(%ebp),%eax
-       movl %eax,%ecx
-       movl %ecx,%edx
-       sall $4,%edx
-       subl %eax,%edx
-       leal 0(,%edx,2),%eax
-       movl %eax,%edx
-       addl $export_names,%edx
-       pushl %edx
-       pushl $.LC0
-       call printf
-       addl $8,%esp
-       xorl %eax,%eax
-       leave
-       ret
-.globl exp_EH_prolog
-exp_EH_prolog:
-       pushl $0xff
-       pushl %eax
-       pushl %fs:0
-       movl  %esp, %fs:0
-       movl  12(%esp), %eax
-       movl  %ebp, 12(%esp)
-       leal  12(%esp), %ebp
-       pushl %eax
-       ret
diff --git a/modules/codec/loader/vfl.c b/modules/codec/loader/vfl.c
deleted file mode 100644 (file)
index cc3b866..0000000
+++ /dev/null
@@ -1,247 +0,0 @@
-/*
- * $Id$
- *
- * Copyright 1998 Marcus Meissner
- *
- * Modified for use with MPlayer, detailed CVS changelog at
- * http://www.mplayerhq.hu/cgi-bin/cvsweb.cgi/main/
- *
- * File now distributed as part of VLC media player with no modifications.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
- */
-#include <config.h>
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "win32.h"
-#include "loader.h"
-
-#include "wine/winbase.h"
-#include "wine/windef.h"
-#include "wine/winuser.h"
-#include "wine/vfw.h"
-#include "wine/winestring.h"
-#include "wine/driver.h"
-#include "wine/avifmt.h"
-#include "driver.h"
-
-#define OpenDriverA DrvOpen
-#define CloseDriver DrvClose
-
-/***********************************************************************
- *             VideoForWindowsVersion          [MSVFW.2][MSVIDEO.2]
- * Returns the version in major.minor form.
- * In Windows95 this returns 0x040003b6 (4.950)
- */
-long VFWAPI VideoForWindowsVersion(void) {
-       return 0x040003B6; /* 4.950 */
-}
-
-/* system.ini: [drivers] */
-
-/***********************************************************************
- *             ICInfo                          [MSVFW.33]
- * Get information about an installable compressor. Return TRUE if there
- * is one.
- */
-int VFWAPI
-ICInfo(
-       long fccType,           /* [in] type of compressor ('vidc') */
-       long fccHandler,        /* [in] <n>th compressor */
-       ICINFO *lpicinfo        /* [out] information about compressor */
-) {
-       /* does OpenDriver/CloseDriver */
-       lpicinfo->dwSize = sizeof(ICINFO);
-       lpicinfo->fccType = fccType;
-       lpicinfo->dwFlags = 0;
-       return TRUE;
-}
-
-/***********************************************************************
- *             ICOpen                          [MSVFW.37]
- * Opens an installable compressor. Return special handle.
- */
-HIC VFWAPI
-//ICOpen(long fccType,long fccHandler,unsigned int wMode) {
-ICOpen(long filename,long fccHandler,unsigned int wMode) {
-       ICOPEN          icopen;
-       HDRVR           hdrv;
-       WINE_HIC        *whic;
-
-       /* Well, lParam2 is in fact a LPVIDEO_OPEN_PARMS, but it has the 
-        * same layout as ICOPEN
-        */
-       icopen.fccType          = 0x63646976; // "vidc" //fccType;
-       icopen.fccHandler       = fccHandler;
-       icopen.dwSize           = sizeof(ICOPEN);
-       icopen.dwFlags          = wMode;
-       icopen.pV1Reserved      = (void*)filename;
-       /* FIXME: do we need to fill out the rest too? */
-       hdrv=OpenDriverA((long)&icopen);
-       if (!hdrv) return 0;
-       whic = (WINE_HIC*)malloc(sizeof(WINE_HIC));
-       whic->hdrv      = hdrv;
-       whic->driverproc= ((DRVR*)hdrv)->DriverProc;
-//     whic->private   = ICSendMessage((HIC)whic,DRV_OPEN,0,(long)&icopen);
-       whic->driverid  = ((DRVR*)hdrv)->dwDriverID;
-       return (HIC)whic;
-}
-
-/***********************************************************************
- *             ICGetInfo                       [MSVFW.30]
- */
-LRESULT VFWAPI
-ICGetInfo(HIC hic,ICINFO *picinfo,long cb) {
-       LRESULT         ret;
-
-       ret = ICSendMessage(hic,ICM_GETINFO,(long)picinfo,cb);
-       
-       return ret;
-}
-
-/***********************************************************************
- *             ICCompress                      [MSVFW.23]
- */
-long VFWAPIV
-ICCompress(
-       HIC hic,long dwFlags,LPBITMAPINFOHEADER lpbiOutput,void* lpData,
-       LPBITMAPINFOHEADER lpbiInput,void* lpBits,long* lpckid,
-       long* lpdwFlags,long lFrameNum,long dwFrameSize,long dwQuality,
-       LPBITMAPINFOHEADER lpbiPrev,void* lpPrev
-) {
-       ICCOMPRESS      iccmp;
-
-       iccmp.dwFlags           = dwFlags;
-
-       iccmp.lpbiOutput        = lpbiOutput;
-       iccmp.lpOutput          = lpData;
-       iccmp.lpbiInput         = lpbiInput;
-       iccmp.lpInput           = lpBits;
-
-       iccmp.lpckid            = lpckid;
-       iccmp.lpdwFlags         = lpdwFlags;
-       iccmp.lFrameNum         = lFrameNum;
-       iccmp.dwFrameSize       = dwFrameSize;
-       iccmp.dwQuality         = dwQuality;
-       iccmp.lpbiPrev          = lpbiPrev;
-       iccmp.lpPrev            = lpPrev;
-       return ICSendMessage(hic,ICM_COMPRESS,(long)&iccmp,sizeof(iccmp));
-}
-
-/***********************************************************************
- *             ICDecompress                    [MSVFW.26]
- */
-long VFWAPIV 
-ICDecompress(HIC hic,long dwFlags,LPBITMAPINFOHEADER lpbiFormat,void* lpData,LPBITMAPINFOHEADER  lpbi,void* lpBits) {
-       ICDECOMPRESS    icd;
-       int result;
-       icd.dwFlags     = dwFlags;
-       icd.lpbiInput   = lpbiFormat;
-       icd.lpInput     = lpData;
-
-       icd.lpbiOutput  = lpbi;
-       icd.lpOutput    = lpBits;
-       icd.ckid        = 0;
-       result=ICSendMessage(hic,ICM_DECOMPRESS,(long)&icd,sizeof(icd));
-       return result;
-}
-
-/***********************************************************************
- *             ICDecompressEx                  [MSVFW.26]
- */
-long VFWAPIV 
-ICDecompressEx(HIC hic,long dwFlags,LPBITMAPINFOHEADER lpbiFormat,void* lpData,LPBITMAPINFOHEADER  lpbi,void* lpBits) {
-       ICDECOMPRESSEX  icd;
-       int result;
-       
-       icd.dwFlags     = dwFlags;
-
-       icd.lpbiSrc     = lpbiFormat;
-       icd.lpSrc       = lpData;
-
-       icd.lpbiDst     = lpbi;
-       icd.lpDst       = lpBits;
-       
-       icd.xSrc=icd.ySrc=0;
-       icd.dxSrc=lpbiFormat->biWidth;
-       icd.dySrc=abs(lpbiFormat->biHeight);
-
-       icd.xDst=icd.yDst=0;
-       icd.dxDst=lpbi->biWidth;
-       icd.dyDst=abs(lpbi->biHeight);
-       
-       //icd.ckid      = 0;
-       result=ICSendMessage(hic,ICM_DECOMPRESSEX,(long)&icd,sizeof(icd));
-       return result;
-}
-
-long VFWAPIV 
-ICUniversalEx(HIC hic,int command,LPBITMAPINFOHEADER lpbiFormat,LPBITMAPINFOHEADER lpbi) {
-       ICDECOMPRESSEX  icd;
-       int result;
-       
-       icd.dwFlags     = 0;
-
-       icd.lpbiSrc     = lpbiFormat;
-       icd.lpSrc       = 0;
-
-       icd.lpbiDst     = lpbi;
-       icd.lpDst       = 0;
-       
-       icd.xSrc=icd.ySrc=0;
-       icd.dxSrc=lpbiFormat->biWidth;
-       icd.dySrc=abs(lpbiFormat->biHeight);
-
-       icd.xDst=icd.yDst=0;
-       icd.dxDst=lpbi->biWidth;
-       icd.dyDst=abs(lpbi->biHeight);
-       
-       //icd.ckid      = 0;
-       result=ICSendMessage(hic,command,(long)&icd,sizeof(icd));
-       return result;
-}
-
-
-/***********************************************************************
- *             ICSendMessage                   [MSVFW.40]
- */
-LRESULT VFWAPI
-ICSendMessage(HIC hic,unsigned int msg,long lParam1,long lParam2) {
-    WINE_HIC   *whic = (WINE_HIC*)hic;
-    return SendDriverMessage(whic->hdrv, msg, lParam1,lParam2);
-}
-
-
-/***********************************************************************
- *             ICClose                 [MSVFW.22]
- */
-LRESULT VFWAPI ICClose(HIC hic) {
-       WINE_HIC        *whic = (WINE_HIC*)hic;
-       /* FIXME: correct? */
-//     CloseDriver(whic->hdrv,0,0);
-        DrvClose(whic->hdrv);
-//#warning FIXME: DrvClose
-       free(whic);
-       return 0;
-}
-
-int VFWAPI ICDoSomething()
-{
-  return 0;
-}
-
diff --git a/modules/codec/loader/win32.c b/modules/codec/loader/win32.c
deleted file mode 100644 (file)
index 7f4acf1..0000000
+++ /dev/null
@@ -1,5416 +0,0 @@
-/*
- * $Id$
- *
- * Originally distributed under LPGL 2.1 (or later) by the Wine project.
- *
- * Modified for use with MPlayer, detailed CVS changelog at
- * http://www.mplayerhq.hu/cgi-bin/cvsweb.cgi/main/
- *
- * File now distributed as part of VLC media player with no modifications.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
- */
-
-/***********************************************************
-
-Win32 emulation code. Functions that emulate
-responses from corresponding Win32 API calls.
-Since we are not going to be able to load
-virtually any DLL, we can only implement this
-much, adding needed functions with each new codec.
-
-Basic principle of implementation: it's not good
-for DLL to know too much about its environment.
-
-************************************************************/
-
-#include "config.h"
-
-#ifdef MPLAYER
-#ifdef USE_QTX_CODECS
-#define QTX
-#endif
-#define REALPLAYER
-//#define LOADLIB_TRY_NATIVE
-#endif
-
-#ifdef QTX
-#define PSEUDO_SCREEN_WIDTH    /*640*/800
-#define PSEUDO_SCREEN_HEIGHT   /*480*/600
-#endif
-
-#include "wine/winbase.h"
-#include "wine/winreg.h"
-#include "wine/winnt.h"
-#include "wine/winerror.h"
-#include "wine/debugtools.h"
-#include "wine/module.h"
-#include "wine/winuser.h"
-
-#include <stdio.h>
-#include "win32.h"
-
-#include "registry.h"
-#include "loader.h"
-#include "com.h"
-#include "ext.h"
-
-#include <stdlib.h>
-#include <assert.h>
-#include <stdarg.h>
-#include <ctype.h>
-#include <pthread.h>
-#include <errno.h>
-#ifdef HAVE_MALLOC_H
-#include <malloc.h>
-#endif
-#include <time.h>
-#include <math.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <sys/types.h>
-#include <dirent.h>
-#include <sys/time.h>
-#include <sys/timeb.h>
-#ifdef HAVE_KSTAT
-#include <kstat.h>
-#endif
-
-#if HAVE_VSSCANF
-int vsscanf( const char *str, const char *format, va_list ap);
-#else
-/* system has no vsscanf.  try to provide one */
-static int vsscanf( const char *str, const char *format, va_list ap)
-{
-    long p1 = va_arg(ap, long);
-    long p2 = va_arg(ap, long);
-    long p3 = va_arg(ap, long);
-    long p4 = va_arg(ap, long);
-    long p5 = va_arg(ap, long);
-    return sscanf(str, format, p1, p2, p3, p4, p5);
-}
-#endif
-
-static char* def_path = WIN32_PATH;
-
-static void do_cpuid(unsigned int ax, unsigned int *regs)
-{
-    __asm__ __volatile__
-       (
-        "pushl %%ebx; pushl %%ecx; pushl %%edx;"
-        ".byte  0x0f, 0xa2;"
-        "movl   %%eax, (%2);"
-        "movl   %%ebx, 4(%2);"
-        "movl   %%ecx, 8(%2);"
-        "movl   %%edx, 12(%2);"
-        "popl %%edx; popl %%ecx; popl %%ebx;"
-        : "=a" (ax)
-        :  "0" (ax), "S" (regs)
-       );
-}
-static unsigned int c_localcount_tsc()
-{
-    int a;
-    __asm__ __volatile__
-       (
-        "rdtsc\n\t"
-        :"=a"(a)
-        :
-        :"edx"
-       );
-    return a;
-}
-static void c_longcount_tsc(long long* z)
-{
-    __asm__ __volatile__
-       (
-        "pushl %%ebx\n\t"
-        "movl %%eax, %%ebx\n\t"
-        "rdtsc\n\t"
-        "movl %%eax, 0(%%ebx)\n\t"
-        "movl %%edx, 4(%%ebx)\n\t"
-        "popl %%ebx\n\t"
-        ::"a"(z)
-        :"edx"
-       );
-}
-static unsigned int c_localcount_notsc()
-{
-    struct timeval tv;
-    unsigned limit=~0;
-    limit/=1000000;
-    gettimeofday(&tv, 0);
-    return limit*tv.tv_usec;
-}
-static void c_longcount_notsc(long long* z)
-{
-    struct timeval tv;
-    unsigned long long result;
-    unsigned limit=~0;
-    if(!z)return;
-    limit/=1000000;
-    gettimeofday(&tv, 0);
-    result=tv.tv_sec;
-    result<<=32;
-    result+=limit*tv.tv_usec;
-    *z=result;
-}
-static unsigned int localcount_stub(void);
-static void longcount_stub(long long*);
-static unsigned int (*localcount)()=localcount_stub;
-static void (*longcount)(long long*)=longcount_stub;
-
-static pthread_mutex_t memmut;
-
-static unsigned int localcount_stub(void)
-{
-    unsigned int regs[4];
-    do_cpuid(1, regs);
-    if ((regs[3] & 0x00000010) != 0)
-    {
-       localcount=c_localcount_tsc;
-       longcount=c_longcount_tsc;
-    }
-    else
-    {
-       localcount=c_localcount_notsc;
-       longcount=c_longcount_notsc;
-    }
-    return localcount();
-}
-static void longcount_stub(long long* z)
-{
-    unsigned int regs[4];
-    do_cpuid(1, regs);
-    if ((regs[3] & 0x00000010) != 0)
-    {
-       localcount=c_localcount_tsc;
-       longcount=c_longcount_tsc;
-    }
-    else
-    {
-       localcount=c_localcount_notsc;
-       longcount=c_longcount_notsc;
-    }
-    longcount(z);
-}
-
-#ifdef MPLAYER
-#include "../mp_msg.h"
-#endif
-int LOADER_DEBUG=1; // active only if compiled with -DDETAILED_OUT
-//#define DETAILED_OUT
-static inline void dbgprintf(const char* fmt, ...)
-{
-#ifdef DETAILED_OUT
-    if(LOADER_DEBUG)
-    {
-       FILE* f;
-       va_list va;
-       va_start(va, fmt);
-       f=fopen("./log", "a");
-       vprintf(fmt, va);
-       fflush(stdout);
-       if(f)
-       {
-           vfprintf(f, fmt, va);
-           fsync(fileno(f));
-           fclose(f);
-       }
-       va_end(va);
-    }
-#endif
-#ifdef MPLAYER
-    if (verbose > 2)
-    {
-       va_list va;
-       
-       va_start(va, fmt);
-       vprintf(fmt, va);
-//     mp_dbg(MSGT_WIN32, MSGL_DBG3, fmt, va);
-       va_end(va);
-    }
-  fflush(stdout);
-#endif
-}
-
-
-char export_names[300][32]={
-    "name1",
-    //"name2",
-    //"name3"
-};
-//#define min(x,y) ((x)<(y)?(x):(y))
-
-void destroy_event(void* event);
-
-struct th_list_t;
-typedef struct th_list_t{
-    int id;
-    void* thread;
-    struct th_list_t* next;
-    struct th_list_t* prev;
-} th_list;
-
-
-// have to be cleared by GARBAGE COLLECTOR
-static unsigned char* heap=NULL;
-static int heap_counter=0;
-static tls_t* g_tls=NULL;
-static th_list* list=NULL;
-
-static void test_heap(void)
-{
-    int offset=0;
-    if(heap==0)
-       return;
-    while(offset<heap_counter)
-    {
-       if(*(int*)(heap+offset)!=0x433476)
-       {
-           printf("Heap corruption at address %d\n", offset);
-           return;
-       }
-       offset+=8+*(int*)(heap+offset+4);
-    }
-    for(;offset<min(offset+1000, 20000000); offset++)
-       if(heap[offset]!=0xCC)
-       {
-           printf("Free heap corruption at address %d\n", offset);
-       }
-}
-#undef MEMORY_DEBUG
-
-#ifdef MEMORY_DEBUG
-
-static void* my_mreq(int size, int to_zero)
-{
-    static int test=0;
-    test++;
-    if(test%10==0)printf("Memory: %d bytes allocated\n", heap_counter);
-    //    test_heap();
-    if(heap==NULL)
-    {
-       heap=malloc(20000000);
-       memset(heap, 0xCC,20000000);
-    }
-    if(heap==0)
-    {
-       printf("No enough memory\n");
-       return 0;
-    }
-    if(heap_counter+size>20000000)
-    {
-       printf("No enough memory\n");
-       return 0;
-    }
-    *(int*)(heap+heap_counter)=0x433476;
-    heap_counter+=4;
-    *(int*)(heap+heap_counter)=size;
-    heap_counter+=4;
-    printf("Allocated %d bytes of memory: sys %d, user %d-%d\n", size, heap_counter-8, heap_counter, heap_counter+size);
-    if(to_zero)
-       memset(heap+heap_counter, 0, size);
-    else
-       memset(heap+heap_counter, 0xcc, size);  // make crash reproducable
-    heap_counter+=size;
-    return heap+heap_counter-size;
-}
-static int my_release(char* memory)
-{
-    //    test_heap();
-    if(memory==NULL)
-    {
-       printf("ERROR: free(0)\n");
-       return 0;
-    }
-    if(*(int*)(memory-8)!=0x433476)
-    {
-       printf("MEMORY CORRUPTION !!!!!!!!!!!!!!!!!!!\n");
-       return 0;
-    }
-    printf("Freed %d bytes of memory\n", *(int*)(memory-4));
-    //    memset(memory-8, *(int*)(memory-4), 0xCC);
-    return 0;
-}
-
-#else
-#define GARBAGE
-typedef struct alloc_header_t alloc_header;
-struct alloc_header_t
-{
-    // let's keep allocated data 16 byte aligned
-    alloc_header* prev;
-    alloc_header* next;
-    long deadbeef;
-    long size;
-    long type;
-    long reserved1;
-    long reserved2;
-    long reserved3;
-};
-
-#ifdef GARBAGE
-static alloc_header* last_alloc = NULL;
-static int alccnt = 0;
-#endif
-
-#define AREATYPE_CLIENT 0
-#define AREATYPE_EVENT 1
-#define AREATYPE_MUTEX 2
-#define AREATYPE_COND 3
-#define AREATYPE_CRITSECT 4
-
-/* -- critical sections -- */
-struct CRITSECT
-{
-    pthread_t id;
-    pthread_mutex_t mutex;
-    int locked;
-    long deadbeef;
-};
-
-void* mreq_private(int size, int to_zero, int type);
-void* mreq_private(int size, int to_zero, int type)
-{
-    int nsize = size + sizeof(alloc_header);
-    alloc_header* header = (alloc_header* ) malloc(nsize);
-    if (!header)
-        return 0;
-    if (to_zero)
-       memset(header, 0, nsize);
-#ifdef GARBAGE
-    if (!last_alloc)
-    {
-       pthread_mutex_init(&memmut, NULL);
-       pthread_mutex_lock(&memmut);
-    }
-    else
-    {
-       pthread_mutex_lock(&memmut);
-       last_alloc->next = header;  /* set next */
-    }
-
-    header->prev = last_alloc;
-    header->next = 0;
-    last_alloc = header;
-    alccnt++;
-    pthread_mutex_unlock(&memmut);
-#endif
-    header->deadbeef = 0xdeadbeef;
-    header->size = size;
-    header->type = type;
-
-    //if (alccnt < 40000) printf("MY_REQ: %p\t%d   t:%d  (cnt:%d)\n",  header, size, type, alccnt);
-    return header + 1;
-}
-
-static int my_release(void* memory)
-{
-    alloc_header* header = (alloc_header*) memory - 1;
-#ifdef GARBAGE
-    alloc_header* prevmem;
-    alloc_header* nextmem;
-
-    if (memory == 0)
-       return 0;
-
-    if (header->deadbeef != (long) 0xdeadbeef)
-    {
-       dbgprintf("FATAL releasing corrupted memory! %p  0x%lx  (%d)\n", header, header->deadbeef, alccnt);
-       return 0;
-    }
-
-    pthread_mutex_lock(&memmut);
-
-    switch(header->type)
-    {
-    case AREATYPE_EVENT:
-       destroy_event(memory);
-       break;
-    case AREATYPE_COND:
-       pthread_cond_destroy((pthread_cond_t*)memory);
-       break;
-    case AREATYPE_MUTEX:
-       pthread_mutex_destroy((pthread_mutex_t*)memory);
-       break;
-    case AREATYPE_CRITSECT:
-       pthread_mutex_destroy(&((struct CRITSECT*)memory)->mutex);
-       break;
-    default:
-       //memset(memory, 0xcc, header->size);
-       ;
-    }
-
-    header->deadbeef = 0;
-    prevmem = header->prev;
-    nextmem = header->next;
-
-    if (prevmem)
-       prevmem->next = nextmem;
-    if (nextmem)
-       nextmem->prev = prevmem;
-
-    if (header == last_alloc)
-       last_alloc = prevmem;
-
-    alccnt--;
-
-    if (last_alloc)
-       pthread_mutex_unlock(&memmut);
-    else
-       pthread_mutex_destroy(&memmut);
-
-    //if (alccnt < 40000) printf("MY_RELEASE: %p\t%ld    (%d)\n", header, header->size, alccnt);
-#else
-    if (memory == 0)
-       return 0;
-#endif
-    //memset(header + 1, 0xcc, header->size);
-    free(header);
-    return 0;
-}
-#endif
-
-static inline void* my_mreq(int size, int to_zero)
-{
-    return mreq_private(size, to_zero, AREATYPE_CLIENT);
-}
-
-static int my_size(void* memory)
-{
-    if(!memory) return 0;
-    return ((alloc_header*)memory)[-1].size;
-}
-
-static void* my_realloc(void* memory, int size)
-{
-    void *ans = memory;
-    int osize;
-    if (memory == NULL)
-       return my_mreq(size, 0);
-    osize = my_size(memory);
-    if (osize < size)
-    {
-       ans = my_mreq(size, 0);
-       memcpy(ans, memory, osize);
-       my_release(memory);
-    }
-    return ans;
-}
-
-/*
- *
- *  WINE  API  - native implementation for several win32 libraries
- *
- */
-
-static int WINAPI ext_unknown()
-{
-    printf("Unknown func called\n");
-    return 0;
-}
-
-static int  WINAPI expGetVolumeInformationA( const char *root, char *label,
-                                       unsigned int label_len, unsigned int *serial,
-                                       unsigned int *filename_len,unsigned int *flags,
-                                       char *fsname, unsigned int fsname_len )
-{
-dbgprintf("GetVolumeInformationA( %s, 0x%x, %ld, 0x%x, 0x%x, 0x%x, 0x%x, %ld) => 1\n",
-                     root,label,label_len,serial,filename_len,flags,fsname,fsname_len);
-//hack Do not return any real data - do nothing
-return 1;
-}
-
-static unsigned int WINAPI expGetDriveTypeA( const char *root )
-{
- dbgprintf("GetDriveTypeA( %s ) => %d\n",root,DRIVE_FIXED);
- // hack return as Fixed Drive Type
- return DRIVE_FIXED;
-}
-
-static unsigned int WINAPI expGetLogicalDriveStringsA( unsigned int len, char *buffer )
-{
- dbgprintf("GetLogicalDriveStringsA(%d, 0x%x) => 4\n",len,buffer);
- // hack only have one drive c:\ in this hack
-  *buffer++='c';
-  *buffer++=':';
-  *buffer++='\\';
-  *buffer++='\0';
-  *buffer= '\0';
-return 4; // 1 drive * 4 bytes (includes null)
-}
-
-
-static int WINAPI expIsBadWritePtr(void* ptr, unsigned int count)
-{
-    int result = (count == 0 || ptr != 0) ? 0 : 1;
-    dbgprintf("IsBadWritePtr(0x%x, 0x%x) => %d\n", ptr, count, result);
-    return result;
-}
-static int WINAPI expIsBadReadPtr(void* ptr, unsigned int count)
-{
-    int result = (count == 0 || ptr != 0) ? 0 : 1;
-    dbgprintf("IsBadReadPtr(0x%x, 0x%x) => %d\n", ptr, count, result);
-    return result;
-}
-static int WINAPI expDisableThreadLibraryCalls(int module)
-{
-    dbgprintf("DisableThreadLibraryCalls(0x%x) => 0\n", module);
-    return 0;
-}
-
-static HMODULE WINAPI expGetDriverModuleHandle(DRVR* pdrv)
-{
-    HMODULE result;
-    if (pdrv==NULL)
-       result=0;
-    else
-       result=pdrv->hDriverModule;
-    dbgprintf("GetDriverModuleHandle(%p) => %p\n", pdrv, result);
-    return result;
-}
-
-#define        MODULE_HANDLE_kernel32  ((HMODULE)0x120)
-#define        MODULE_HANDLE_user32    ((HMODULE)0x121)
-#ifdef QTX
-#define        MODULE_HANDLE_wininet   ((HMODULE)0x122)
-#define        MODULE_HANDLE_ddraw     ((HMODULE)0x123)
-#define        MODULE_HANDLE_advapi32  ((HMODULE)0x124)
-#endif
-#define        MODULE_HANDLE_comdlg32  ((HMODULE)0x125)
-#define        MODULE_HANDLE_msvcrt    ((HMODULE)0x126)
-#define        MODULE_HANDLE_ole32     ((HMODULE)0x127)
-#define        MODULE_HANDLE_winmm     ((HMODULE)0x128)
-
-static HMODULE WINAPI expGetModuleHandleA(const char* name)
-{
-    WINE_MODREF* wm;
-    HMODULE result;
-    if(!name)
-#ifdef QTX
-       result=1;
-#else
-       result=0;
-#endif
-    else
-    {
-       wm=MODULE_FindModule(name);
-       if(wm==0)result=0;
-       else
-           result=(HMODULE)(wm->module);
-    }
-    if(!result)
-    {
-       if(name && (strcasecmp(name, "kernel32")==0 || !strcasecmp(name, "kernel32.dll")))
-           result=MODULE_HANDLE_kernel32;
-#ifdef QTX
-       if(name && strcasecmp(name, "user32")==0)
-           result=MODULE_HANDLE_user32;
-#endif
-    }
-    dbgprintf("GetModuleHandleA('%s') => 0x%x\n", name, result);
-    return result;
-}
-
-static void* WINAPI expCreateThread(void* pSecAttr, long dwStackSize,
-                                   void* lpStartAddress, void* lpParameter,
-                                   long dwFlags, long* dwThreadId)
-{
-    pthread_t *pth;
-    //    printf("CreateThread:");
-    pth = (pthread_t*) my_mreq(sizeof(pthread_t), 0);
-    pthread_create(pth, NULL, (void*(*)(void*))lpStartAddress, lpParameter);
-    if(dwFlags)
-       printf( "WARNING: CreateThread flags not supported\n");
-    if(dwThreadId)
-       *dwThreadId=(long)pth;
-    if(list==NULL)
-    {
-       list=my_mreq(sizeof(th_list), 1);
-       list->next=list->prev=NULL;
-    }
-    else
-    {
-       list->next=my_mreq(sizeof(th_list), 0);
-       list->next->prev=list;
-       list->next->next=NULL;
-       list=list->next;
-    }
-    list->thread=pth;
-    dbgprintf("CreateThread(0x%x, 0x%x, 0x%x, 0x%x, 0x%x, 0x%x) => 0x%x\n",
-             pSecAttr, dwStackSize, lpStartAddress, lpParameter, dwFlags, dwThreadId, pth);
-    return pth;
-}
-
-struct mutex_list_t;
-
-struct mutex_list_t
-{
-    char type;
-    pthread_mutex_t *pm;
-    pthread_cond_t  *pc;
-    char state;
-    char reset;
-    char name[128];
-    int  semaphore;
-    struct mutex_list_t* next;
-    struct mutex_list_t* prev;
-};
-typedef struct mutex_list_t mutex_list;
-static mutex_list* mlist=NULL;
-
-void destroy_event(void* event)
-{
-    mutex_list* pp=mlist;
-    //    printf("garbage collector: destroy_event(%x)\n", event);
-    while(pp)
-    {
-       if(pp==(mutex_list*)event)
-       {
-           if(pp->next)
-               pp->next->prev=pp->prev;
-           if(pp->prev)
-               pp->prev->next=pp->next;
-           if(mlist==(mutex_list*)event)
-               mlist=mlist->prev;
-           /*
-            pp=mlist;
-            while(pp)
-            {
-            printf("%x => ", pp);
-            pp=pp->prev;
-            }
-            printf("0\n");
-            */
-           return;
-       }
-       pp=pp->prev;
-    }
-}
-
-static void* WINAPI expCreateEventA(void* pSecAttr, char bManualReset,
-                                   char bInitialState, const char* name)
-{
-    pthread_mutex_t *pm;
-    pthread_cond_t  *pc;
-    /*
-     mutex_list* pp;
-     pp=mlist;
-     while(pp)
-     {
-     printf("%x => ", pp);
-     pp=pp->prev;
-     }
-     printf("0\n");
-     */
-    if(mlist!=NULL)
-    {
-       mutex_list* pp=mlist;
-       if(name!=NULL)
-           do
-       {
-           if((strcmp(pp->name, name)==0) && (pp->type==0))
-           {
-               dbgprintf("CreateEventA(0x%x, 0x%x, 0x%x, 0x%x='%s') => 0x%x\n",
-                         pSecAttr, bManualReset, bInitialState, name, name, pp->pm);
-               return pp->pm;
-           }
-       }while((pp=pp->prev) != NULL);
-    }
-    pm=mreq_private(sizeof(pthread_mutex_t), 0, AREATYPE_MUTEX);
-    pthread_mutex_init(pm, NULL);
-    pc=mreq_private(sizeof(pthread_cond_t), 0, AREATYPE_COND);
-    pthread_cond_init(pc, NULL);
-    if(mlist==NULL)
-    {
-       mlist=mreq_private(sizeof(mutex_list), 00, AREATYPE_EVENT);
-       mlist->next=mlist->prev=NULL;
-    }
-    else
-    {
-       mlist->next=mreq_private(sizeof(mutex_list), 00, AREATYPE_EVENT);
-       mlist->next->prev=mlist;
-       mlist->next->next=NULL;
-       mlist=mlist->next;
-    }
-    mlist->type=0; /* Type Event */
-    mlist->pm=pm;
-    mlist->pc=pc;
-    mlist->state=bInitialState;
-    mlist->reset=bManualReset;
-    if(name)
-       strncpy(mlist->name, name, 127);
-    else
-       mlist->name[0]=0;
-    if(pm==NULL)
-       dbgprintf("ERROR::: CreateEventA failure\n");
-    /*
-     if(bInitialState)
-     pthread_mutex_lock(pm);
-     */
-    if(name)
-       dbgprintf("CreateEventA(0x%x, 0x%x, 0x%x, 0x%x='%s') => 0x%x\n",
-                 pSecAttr, bManualReset, bInitialState, name, name, mlist);
-    else
-       dbgprintf("CreateEventA(0x%x, 0x%x, 0x%x, NULL) => 0x%x\n",
-                 pSecAttr, bManualReset, bInitialState, mlist);
-    return mlist;
-}
-
-static void* WINAPI expSetEvent(void* event)
-{
-    mutex_list *ml = (mutex_list *)event;
-    dbgprintf("SetEvent(%x) => 0x1\n", event);
-    pthread_mutex_lock(ml->pm);
-    if (ml->state == 0) {
-       ml->state = 1;
-       pthread_cond_signal(ml->pc);
-    }
-    pthread_mutex_unlock(ml->pm);
-
-    return (void *)1;
-}
-static void* WINAPI expResetEvent(void* event)
-{
-    mutex_list *ml = (mutex_list *)event;
-    dbgprintf("ResetEvent(0x%x) => 0x1\n", event);
-    pthread_mutex_lock(ml->pm);
-    ml->state = 0;
-    pthread_mutex_unlock(ml->pm);
-
-    return (void *)1;
-}
-
-static void* WINAPI expWaitForSingleObject(void* object, int duration)
-{
-    mutex_list *ml = (mutex_list *)object;
-    // FIXME FIXME FIXME - this value is sometime unititialize !!!
-    int ret = WAIT_FAILED;
-    mutex_list* pp=mlist;
-    if(object == (void*)0xcfcf9898)
-    {
-       /**
-        From GetCurrentThread() documentation:
-        A pseudo handle is a special constant that is interpreted as the current thread handle. The calling thread can use this handle to specify itself whenever a thread handle is required. Pseudo handles are not inherited by child processes.
-
-        This handle has the maximum possible access to the thread object. For systems that support security descriptors, this is the maximum access allowed by the security descriptor for the calling process. For systems that do not support security descriptors, this is THREAD_ALL_ACCESS.
-
-        The function cannot be used by one thread to create a handle that can be used by other threads to refer to the first thread. The handle is always interpreted as referring to the thread that is using it. A thread can create a "real" handle to itself that can be used by other threads, or inherited by other processes, by specifying the pseudo handle as the source handle in a call to the DuplicateHandle function.
-        **/
-       dbgprintf("WaitForSingleObject(thread_handle) called\n");
-       return (void*)WAIT_FAILED;
-    }
-    dbgprintf("WaitForSingleObject(0x%x, duration %d) =>\n",object, duration);
-
-    // loop below was slightly fixed - its used just for checking if
-    // this object really exists in our list
-    if (!ml)
-       return (void*) ret;
-    while (pp && (pp->pm != ml->pm))
-       pp = pp->prev;
-    if (!pp) {
-       dbgprintf("WaitForSingleObject: NotFound\n");
-       return (void*)ret;
-    }
-
-    pthread_mutex_lock(ml->pm);
-
-    switch(ml->type) {
-    case 0: /* Event */
-       if (duration == 0) { /* Check Only */
-           if (ml->state == 1) ret = WAIT_FAILED;
-           else                   ret = WAIT_OBJECT_0;
-       }
-       if (duration == -1) { /* INFINITE */
-           if (ml->state == 0)
-               pthread_cond_wait(ml->pc,ml->pm);
-           if (ml->reset)
-               ml->state = 0;
-           ret = WAIT_OBJECT_0;
-       }
-       if (duration > 0) {  /* Timed Wait */
-           struct timespec abstime;
-           struct timeval now;
-           gettimeofday(&now, 0);
-           abstime.tv_sec = now.tv_sec + (now.tv_usec+duration)/1000000;
-           abstime.tv_nsec = ((now.tv_usec+duration)%1000000)*1000;
-           if (ml->state == 0)
-               ret=pthread_cond_timedwait(ml->pc,ml->pm,&abstime);
-           if (ret == ETIMEDOUT) ret = WAIT_TIMEOUT;
-           else                  ret = WAIT_OBJECT_0;
-           if (ml->reset)
-               ml->state = 0;
-       }
-       break;
-    case 1:  /* Semaphore */
-       if (duration == 0) {
-           if(ml->semaphore==0) ret = WAIT_FAILED;
-           else {
-               ml->semaphore++;
-               ret = WAIT_OBJECT_0;
-           }
-       }
-       if (duration == -1) {
-           if (ml->semaphore==0)
-               pthread_cond_wait(ml->pc,ml->pm);
-           ml->semaphore--;
-       }
-       break;
-    }
-    pthread_mutex_unlock(ml->pm);
-
-    dbgprintf("WaitForSingleObject(0x%x, %d): 0x%x => 0x%x \n",object,duration,ml,ret);
-    return (void *)ret;
-}
-
-#ifdef QTX
-static void* WINAPI expWaitForMultipleObjects(int count, const void** objects,
-                   int WaitAll, int duration)
-{
-    int i;
-    void *object;
-    void *ret;
-
-    dbgprintf("WaitForMultipleObjects(%d, 0x%x, %d, duration %d) =>\n",
-       count, objects, WaitAll, duration);
-    
-    for (i = 0; i < count; i++)
-    {
-       object = (void *)objects[i];
-       ret = expWaitForSingleObject(object, duration);
-       if (WaitAll)
-           dbgprintf("WaitAll flag not yet supported...\n");
-       else
-           return ret;
-    }
-    return NULL;
-}
-
-static void WINAPI expExitThread(int retcode)
-{
-    dbgprintf("ExitThread(%d)\n", retcode);
-    pthread_exit(&retcode);
-}
-
-static HANDLE WINAPI expCreateMutexA(void *pSecAttr,
-                   char bInitialOwner, const char *name)
-{
-    HANDLE mlist = (HANDLE)expCreateEventA(pSecAttr, 0, 0, name);
-    
-    if (name)
-       dbgprintf("CreateMutexA(0x%x, %d, '%s') => 0x%x\n",
-           pSecAttr, bInitialOwner, name, mlist);
-    else
-       dbgprintf("CreateMutexA(0x%x, %d, NULL) => 0x%x\n",
-           pSecAttr, bInitialOwner, mlist);
-#ifndef QTX
-    /* 10l to QTX, if CreateMutex returns a real mutex, WaitForSingleObject
-       waits for ever, else it works ;) */
-    return mlist;
-#endif
-}
-
-static int WINAPI expReleaseMutex(HANDLE hMutex)
-{
-    dbgprintf("ReleaseMutex(%x) => 1\n", hMutex);
-    /* FIXME:XXX !! not yet implemented */
-    return 1;
-}
-#endif
-
-static int pf_set = 0;
-static BYTE PF[64] = {0,};
-
-static void DumpSystemInfo(const SYSTEM_INFO* si)
-{
-    dbgprintf("  Processor architecture %d\n", si->u.s.wProcessorArchitecture);
-    dbgprintf("  Page size: %d\n", si->dwPageSize);
-    dbgprintf("  Minimum app address: %d\n", si->lpMinimumApplicationAddress);
-    dbgprintf("  Maximum app address: %d\n", si->lpMaximumApplicationAddress);
-    dbgprintf("  Active processor mask: 0x%x\n", si->dwActiveProcessorMask);
-    dbgprintf("  Number of processors: %d\n", si->dwNumberOfProcessors);
-    dbgprintf("  Processor type: 0x%x\n", si->dwProcessorType);
-    dbgprintf("  Allocation granularity: 0x%x\n", si->dwAllocationGranularity);
-    dbgprintf("  Processor level: 0x%x\n", si->wProcessorLevel);
-    dbgprintf("  Processor revision: 0x%x\n", si->wProcessorRevision);
-}
-
-static void WINAPI expGetSystemInfo(SYSTEM_INFO* si)
-{
-    /* FIXME: better values for the two entries below... */
-    static int cache = 0;
-    static SYSTEM_INFO cachedsi;
-    unsigned int regs[4];
-    dbgprintf("GetSystemInfo(%p) =>\n", si);
-
-    if (cache) {
-       memcpy(si,&cachedsi,sizeof(*si));
-       DumpSystemInfo(si);
-       return;
-    }
-    memset(PF,0,sizeof(PF));
-    pf_set = 1;
-
-    cachedsi.u.s.wProcessorArchitecture     = PROCESSOR_ARCHITECTURE_INTEL;
-    cachedsi.dwPageSize                        = getpagesize();
-
-    /* FIXME: better values for the two entries below... */
-    cachedsi.lpMinimumApplicationAddress       = (void *)0x00000000;
-    cachedsi.lpMaximumApplicationAddress       = (void *)0x7FFFFFFF;
-    cachedsi.dwActiveProcessorMask             = 1;
-    cachedsi.dwNumberOfProcessors              = 1;
-    cachedsi.dwProcessorType           = PROCESSOR_INTEL_386;
-    cachedsi.dwAllocationGranularity   = 0x10000;
-    cachedsi.wProcessorLevel           = 5; /* pentium */
-    cachedsi.wProcessorRevision                = 0x0101;
-
-#ifdef MPLAYER
-    /* mplayer's way to detect PF's */
-    {
-#include "../cpudetect.h"
-       extern CpuCaps gCpuCaps;
-
-       if (gCpuCaps.hasMMX)
-           PF[PF_MMX_INSTRUCTIONS_AVAILABLE] = TRUE;
-       if (gCpuCaps.hasSSE)
-           PF[PF_XMMI_INSTRUCTIONS_AVAILABLE] = TRUE;
-       if (gCpuCaps.has3DNow)
-           PF[PF_AMD3D_INSTRUCTIONS_AVAILABLE] = TRUE;
-
-           if (gCpuCaps.cpuType == 4)
-           {
-               cachedsi.dwProcessorType = PROCESSOR_INTEL_486;
-               cachedsi.wProcessorLevel = 4;
-           }
-           else if (gCpuCaps.cpuType >= 5)
-           {
-               cachedsi.dwProcessorType = PROCESSOR_INTEL_PENTIUM;
-               cachedsi.wProcessorLevel = 5;
-           }
-           else
-           {
-               cachedsi.dwProcessorType = PROCESSOR_INTEL_386;
-               cachedsi.wProcessorLevel = 3;
-           }
-           cachedsi.wProcessorRevision = gCpuCaps.cpuStepping;
-           cachedsi.dwNumberOfProcessors = 1;  /* hardcoded */
-    }
-#endif
-
-/* disable cpuid based detection (mplayer's cpudetect.c does this - see above) */
-#ifndef MPLAYER
-#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__svr4__) || defined(__DragonFly__)
-    do_cpuid(1, regs);
-    switch ((regs[0] >> 8) & 0xf) {                    // cpu family
-    case 3: cachedsi.dwProcessorType = PROCESSOR_INTEL_386;
-    cachedsi.wProcessorLevel= 3;
-    break;
-    case 4: cachedsi.dwProcessorType = PROCESSOR_INTEL_486;
-    cachedsi.wProcessorLevel= 4;
-    break;
-    case 5: cachedsi.dwProcessorType = PROCESSOR_INTEL_PENTIUM;
-    cachedsi.wProcessorLevel= 5;
-    break;
-    case 6: cachedsi.dwProcessorType = PROCESSOR_INTEL_PENTIUM;
-    cachedsi.wProcessorLevel= 5;
-    break;
-    default:cachedsi.dwProcessorType = PROCESSOR_INTEL_PENTIUM;
-    cachedsi.wProcessorLevel= 5;
-    break;
-    }
-    cachedsi.wProcessorRevision = regs[0] & 0xf;       // stepping
-    if (regs[3] & (1 <<  8))
-       PF[PF_COMPARE_EXCHANGE_DOUBLE] = TRUE;
-    if (regs[3] & (1 << 23))
-       PF[PF_MMX_INSTRUCTIONS_AVAILABLE] = TRUE;
-    if (regs[3] & (1 << 25))
-       PF[PF_XMMI_INSTRUCTIONS_AVAILABLE] = TRUE;
-    if (regs[3] & (1 << 31))
-       PF[PF_AMD3D_INSTRUCTIONS_AVAILABLE] = TRUE;
-    cachedsi.dwNumberOfProcessors=1;
-#endif
-#endif /* MPLAYER */
-
-/* MPlayer: linux detection enabled (based on proc/cpuinfo) for checking
-   fdiv_bug and fpu emulation flags -- alex/MPlayer */
-#ifdef __linux__
-    {
-       char buf[20];
-       char line[200];
-       FILE *f = fopen ("/proc/cpuinfo", "r");
-
-       if (!f)
-           return;
-       while (fgets(line,200,f)!=NULL) {
-           char        *s,*value;
-
-           /* NOTE: the ':' is the only character we can rely on */
-           if (!(value = strchr(line,':')))
-               continue;
-           /* terminate the valuename */
-           *value++ = '\0';
-           /* skip any leading spaces */
-           while (*value==' ') value++;
-           if ((s=strchr(value,'\n')))
-               *s='\0';
-
-           /* 2.1 method */
-           if (!lstrncmpiA(line, "cpu family",strlen("cpu family"))) {
-               if (isdigit (value[0])) {
-                   switch (value[0] - '0') {
-                   case 3: cachedsi.dwProcessorType = PROCESSOR_INTEL_386;
-                   cachedsi.wProcessorLevel= 3;
-                   break;
-                   case 4: cachedsi.dwProcessorType = PROCESSOR_INTEL_486;
-                   cachedsi.wProcessorLevel= 4;
-                   break;
-                   case 5: cachedsi.dwProcessorType = PROCESSOR_INTEL_PENTIUM;
-                   cachedsi.wProcessorLevel= 5;
-                   break;
-                   case 6: cachedsi.dwProcessorType = PROCESSOR_INTEL_PENTIUM;
-                   cachedsi.wProcessorLevel= 5;
-                   break;
-                   default:cachedsi.dwProcessorType = PROCESSOR_INTEL_PENTIUM;
-                   cachedsi.wProcessorLevel= 5;
-                   break;
-                   }
-               }
-               /* set the CPU type of the current processor */
-               sprintf(buf,"CPU %ld",cachedsi.dwProcessorType);
-               continue;
-           }
-           /* old 2.0 method */
-           if (!lstrncmpiA(line, "cpu",strlen("cpu"))) {
-               if (    isdigit (value[0]) && value[1] == '8' &&
-                       value[2] == '6' && value[3] == 0
-                  ) {
-                   switch (value[0] - '0') {
-                   case 3: cachedsi.dwProcessorType = PROCESSOR_INTEL_386;
-                   cachedsi.wProcessorLevel= 3;
-                   break;
-                   case 4: cachedsi.dwProcessorType = PROCESSOR_INTEL_486;
-                   cachedsi.wProcessorLevel= 4;
-                   break;
-                   case 5: cachedsi.dwProcessorType = PROCESSOR_INTEL_PENTIUM;
-                   cachedsi.wProcessorLevel= 5;
-                   break;
-                   case 6: cachedsi.dwProcessorType = PROCESSOR_INTEL_PENTIUM;
-                   cachedsi.wProcessorLevel= 5;
-                   break;
-                   default:cachedsi.dwProcessorType = PROCESSOR_INTEL_PENTIUM;
-                   cachedsi.wProcessorLevel= 5;
-                   break;
-                   }
-               }
-               /* set the CPU type of the current processor */
-               sprintf(buf,"CPU %ld",cachedsi.dwProcessorType);
-               continue;
-           }
-           if (!lstrncmpiA(line,"fdiv_bug",strlen("fdiv_bug"))) {
-               if (!lstrncmpiA(value,"yes",3))
-                   PF[PF_FLOATING_POINT_PRECISION_ERRATA] = TRUE;
-
-               continue;
-           }
-           if (!lstrncmpiA(line,"fpu",strlen("fpu"))) {
-               if (!lstrncmpiA(value,"no",2))
-                   PF[PF_FLOATING_POINT_EMULATED] = TRUE;
-
-               continue;
-           }
-           if (!lstrncmpiA(line,"processor",strlen("processor"))) {
-               /* processor number counts up...*/
-               unsigned int x;
-
-               if (sscanf(value,"%d",&x))
-                   if (x+1>cachedsi.dwNumberOfProcessors)
-                       cachedsi.dwNumberOfProcessors=x+1;
-
-               /* Create a new processor subkey on a multiprocessor
-                * system
-                */
-               sprintf(buf,"%d",x);
-           }
-           if (!lstrncmpiA(line,"stepping",strlen("stepping"))) {
-               int     x;
-
-               if (sscanf(value,"%d",&x))
-                   cachedsi.wProcessorRevision = x;
-           }
-           if
-               ( (!lstrncmpiA(line,"flags",strlen("flags")))
-                 || (!lstrncmpiA(line,"features",strlen("features"))) )
-           {
-               if (strstr(value,"cx8"))
-                   PF[PF_COMPARE_EXCHANGE_DOUBLE] = TRUE;
-               if (strstr(value,"mmx"))
-                   PF[PF_MMX_INSTRUCTIONS_AVAILABLE] = TRUE;
-               if (strstr(value,"tsc"))
-                   PF[PF_RDTSC_INSTRUCTION_AVAILABLE] = TRUE;
-               if (strstr(value,"xmm"))
-                   PF[PF_XMMI_INSTRUCTIONS_AVAILABLE] = TRUE;
-               if (strstr(value,"3dnow"))
-                   PF[PF_AMD3D_INSTRUCTIONS_AVAILABLE] = TRUE;
-           }
-       }
-       fclose (f);
-       /*
-        *      ad hoc fix for smp machines.
-        *      some problems on WaitForSingleObject,CreateEvent,SetEvent
-        *                      CreateThread ...etc..
-        *
-        */
-       cachedsi.dwNumberOfProcessors=1;
-    }
-#endif /* __linux__ */
-    cache = 1;
-    memcpy(si,&cachedsi,sizeof(*si));
-    DumpSystemInfo(si);
-}
-
-// avoid undefined expGetSystemInfo
-static WIN_BOOL WINAPI expIsProcessorFeaturePresent(DWORD v)
-{
-    WIN_BOOL result = 0;
-    if (!pf_set)
-    {
-       SYSTEM_INFO si;
-       expGetSystemInfo(&si);
-    }
-    if(v<64) result=PF[v];
-    dbgprintf("IsProcessorFeaturePresent(0x%x) => 0x%x\n", v, result);
-    return result;
-}
-
-
-static long WINAPI expGetVersion()
-{
-    dbgprintf("GetVersion() => 0xC0000004\n");
-    return 0xC0000004;//Windows 95
-}
-
-static HANDLE WINAPI expHeapCreate(long flags, long init_size, long max_size)
-{
-    //    printf("HeapCreate:");
-    HANDLE result;
-    if(init_size==0)
-       result=(HANDLE)my_mreq(0x110000, 0);
-    else
-       result=(HANDLE)my_mreq((init_size + 0xfff) & 0x7ffff000 , 0);
-    dbgprintf("HeapCreate(flags 0x%x, initial size %d, maximum size %d) => 0x%x\n", flags, init_size, max_size, result);
-    return result;
-}
-
-// this is another dirty hack
-// VP31 is releasing one allocated Heap chunk twice
-// we will silently ignore this second call...
-static void* heapfreehack = 0;
-static int heapfreehackshown = 0;
-//extern void trapbug(void);
-static void* WINAPI expHeapAlloc(HANDLE heap, int flags, int size)
-{
-    void* z;
-    /**
-     Morgan's m3jpeg32.dll v. 2.0 encoder expects that request for
-     HeapAlloc returns area larger than size argument :-/
-
-     actually according to M$ Doc  HeapCreate size should be rounded
-     to page boundaries thus we should simulate this
-     **/
-    //if (size == 22276) trapbug();
-    z=my_mreq((size + 0xfff) & 0x7ffff000, (flags & HEAP_ZERO_MEMORY));
-    if(z==0)
-       printf("HeapAlloc failure\n");
-    dbgprintf("HeapAlloc(heap 0x%x, flags 0x%x, size %d) => 0x%x\n", heap, flags, size, z);
-    heapfreehack = 0; // reset
-    return z;
-}
-static long WINAPI expHeapDestroy(void* heap)
-{
-    dbgprintf("HeapDestroy(heap 0x%x) => 1\n", heap);
-    my_release(heap);
-    return 1;
-}
-
-static long WINAPI expHeapFree(HANDLE heap, DWORD dwFlags, LPVOID lpMem)
-{
-    dbgprintf("HeapFree(0x%x, 0x%x, pointer 0x%x) => 1\n", heap, dwFlags, lpMem);
-    if (heapfreehack != lpMem && lpMem != (void*)0xffffffff
-       && lpMem != (void*)0xbdbdbdbd)
-       // 0xbdbdbdbd is for i263_drv.drv && libefence
-       // it seems to be reading from relased memory
-        // EF_PROTECT_FREE doens't show any probleme
-       my_release(lpMem);
-    else
-    {
-       if (!heapfreehackshown++)
-           printf("Info: HeapFree deallocating same memory twice! (%p)\n", lpMem);
-    }
-    heapfreehack = lpMem;
-    return 1;
-}
-static long WINAPI expHeapSize(int heap, int flags, void* pointer)
-{
-    long result=my_size(pointer);
-    dbgprintf("HeapSize(heap 0x%x, flags 0x%x, pointer 0x%x) => %d\n", heap, flags, pointer, result);
-    return result;
-}
-static void* WINAPI expHeapReAlloc(HANDLE heap,int flags,void *lpMem,int size)
-{
-    long orgsize = my_size(lpMem);
-    dbgprintf("HeapReAlloc() Size %ld org %d\n",orgsize,size);
-    return my_realloc(lpMem, size);
-}
-static long WINAPI expGetProcessHeap(void)
-{
-    dbgprintf("GetProcessHeap() => 1\n");
-    return 1;
-}
-static void* WINAPI expVirtualAlloc(void* v1, long v2, long v3, long v4)
-{
-    void* z = VirtualAlloc(v1, v2, v3, v4);
-    if(z==0)
-       printf("VirtualAlloc failure\n");
-    dbgprintf("VirtualAlloc(0x%x, %d, %d, %d) => 0x%x \n",v1,v2,v3,v4, z);
-    return z;
-}
-static int WINAPI expVirtualFree(void* v1, int v2, int v3)
-{
-    int result = VirtualFree(v1,v2,v3);
-    dbgprintf("VirtualFree(0x%x, %d, %d) => %d\n",v1,v2,v3, result);
-    return result;
-}
-
-/* we're building a table of critical sections. cs_win pointer uses the DLL
- cs_unix is the real structure, we're using cs_win only to identifying cs_unix */
-struct critsecs_list_t
-{
-    CRITICAL_SECTION *cs_win;
-    struct CRITSECT *cs_unix;
-};
-
-/* 'NEWTYPE' is working with VIVO, 3ivX and QTX dll (no more segfaults) -- alex */
-#undef CRITSECS_NEWTYPE
-//#define CRITSECS_NEWTYPE 1
-
-#ifdef CRITSECS_NEWTYPE
-/* increased due to ucod needs more than 32 entries */
-/* and 64 should be enough for everything */
-#define CRITSECS_LIST_MAX 64
-static struct critsecs_list_t critsecs_list[CRITSECS_LIST_MAX];
-
-static int critsecs_get_pos(CRITICAL_SECTION *cs_win)
-{
-    int i;
-
-    for (i=0; i < CRITSECS_LIST_MAX; i++)
-       if (critsecs_list[i].cs_win == cs_win)
-           return(i);
-    return(-1);
-}
-
-static int critsecs_get_unused(void)
-{
-    int i;
-
-    for (i=0; i < CRITSECS_LIST_MAX; i++)
-       if (critsecs_list[i].cs_win == NULL)
-           return(i);
-    return(-1);
-}
-
-struct CRITSECT *critsecs_get_unix(CRITICAL_SECTION *cs_win)
-{
-    int i;
-
-    for (i=0; i < CRITSECS_LIST_MAX; i++)
-       if (critsecs_list[i].cs_win == cs_win && critsecs_list[i].cs_unix)
-           return(critsecs_list[i].cs_unix);
-    return(NULL);
-}
-#endif
-
-static void WINAPI expInitializeCriticalSection(CRITICAL_SECTION* c)
-{
-    dbgprintf("InitializeCriticalSection(0x%x)\n", c);
-    /*    if(sizeof(pthread_mutex_t)>sizeof(CRITICAL_SECTION))
-     {
-     printf(" ERROR:::: sizeof(pthread_mutex_t) is %d, expected <=%d!\n",
-     sizeof(pthread_mutex_t), sizeof(CRITICAL_SECTION));
-     return;
-     }*/
-    /*    pthread_mutex_init((pthread_mutex_t*)c, NULL);   */
-#ifdef CRITSECS_NEWTYPE
-    {
-       struct CRITSECT *cs;
-       int i = critsecs_get_unused();
-
-       if (i < 0)
-       {
-           printf("InitializeCriticalSection(%p) - no more space in list\n", c);
-           return;
-       }
-       dbgprintf("got unused space at %d\n", i);
-       cs = malloc(sizeof(struct CRITSECT));
-       if (!cs)
-       {
-           printf("InitializeCriticalSection(%p) - out of memory\n", c);
-           return;
-       }
-       pthread_mutex_init(&cs->mutex, NULL);
-       cs->locked = 0;
-       critsecs_list[i].cs_win = c;
-       critsecs_list[i].cs_unix = cs;
-       dbgprintf("InitializeCriticalSection -> itemno=%d, cs_win=%p, cs_unix=%p\n",
-                 i, c, cs);
-    }
-#else
-    {
-       struct CRITSECT* cs = mreq_private(sizeof(struct CRITSECT) + sizeof(CRITICAL_SECTION),
-                                          0, AREATYPE_CRITSECT);
-       pthread_mutex_init(&cs->mutex, NULL);
-       cs->locked=0;
-        cs->deadbeef = 0xdeadbeef;
-       *(void**)c = cs;
-    }
-#endif
-    return;
-}
-
-static void WINAPI expEnterCriticalSection(CRITICAL_SECTION* c)
-{
-#ifdef CRITSECS_NEWTYPE
-    struct CRITSECT* cs = critsecs_get_unix(c);
-#else
-    struct CRITSECT* cs = (*(struct CRITSECT**)c);
-#endif
-    dbgprintf("EnterCriticalSection(0x%x) %p\n",c, cs);
-    if (!cs)
-    {
-       dbgprintf("entered uninitialized critisec!\n");
-       expInitializeCriticalSection(c);
-#ifdef CRITSECS_NEWTYPE
-       cs=critsecs_get_unix(c);
-#else
-       cs = (*(struct CRITSECT**)c);
-#endif
-       dbgprintf("Win32 Warning: Accessed uninitialized Critical Section (%p)!\n", c);
-    }
-    if(cs->locked)
-       if(cs->id==pthread_self())
-           return;
-    pthread_mutex_lock(&(cs->mutex));
-    cs->locked=1;
-    cs->id=pthread_self();
-    return;
-}
-static void WINAPI expLeaveCriticalSection(CRITICAL_SECTION* c)
-{
-#ifdef CRITSECS_NEWTYPE
-    struct CRITSECT* cs = critsecs_get_unix(c);
-#else
-    struct CRITSECT* cs = (*(struct CRITSECT**)c);
-#endif
-    //    struct CRITSECT* cs=(struct CRITSECT*)c;
-    dbgprintf("LeaveCriticalSection(0x%x) 0x%x\n",c, cs);
-    if (!cs)
-    {
-       dbgprintf("Win32 Warning: Leaving uninitialized Critical Section %p!!\n", c);
-       return;
-    }
-    if (cs->locked)
-    {
-       cs->locked=0;
-       pthread_mutex_unlock(&(cs->mutex));
-    }
-    else
-       dbgprintf("Win32 Warning: Unlocking unlocked Critical Section %p!!\n", c);
-    return;
-}
-
-static void expfree(void* mem); /* forward declaration */
-
-static void WINAPI expDeleteCriticalSection(CRITICAL_SECTION *c)
-{
-#ifdef CRITSECS_NEWTYPE
-    struct CRITSECT* cs = critsecs_get_unix(c);
-#else
-    struct CRITSECT* cs= (*(struct CRITSECT**)c);
-#endif
-    //    struct CRITSECT* cs=(struct CRITSECT*)c;
-    dbgprintf("DeleteCriticalSection(0x%x)\n",c);
-
-    if (!cs)
-    {
-       dbgprintf("Win32 Warning: Deleting uninitialized Critical Section %p!!\n", c);
-       return;
-    }
-    
-    if (cs->locked)
-    {
-       dbgprintf("Win32 Warning: Deleting unlocked Critical Section %p!!\n", c);
-       pthread_mutex_unlock(&(cs->mutex));
-    }
-
-#ifndef GARBAGE
-    pthread_mutex_destroy(&(cs->mutex));
-    // released by GarbageCollector in my_relase otherwise
-#endif
-    my_release(cs);
-#ifdef CRITSECS_NEWTYPE
-    {
-       int i = critsecs_get_pos(c);
-
-       if (i < 0)
-       {
-           printf("DeleteCriticalSection(%p) error (critsec not found)\n", c);
-           return;
-       }
-
-       critsecs_list[i].cs_win = NULL;
-       expfree(critsecs_list[i].cs_unix);
-       critsecs_list[i].cs_unix = NULL;
-       dbgprintf("DeleteCriticalSection -> itemno=%d\n", i);
-    }
-#endif
-    return;
-}
-static int WINAPI expGetCurrentThreadId()
-{
-    dbgprintf("GetCurrentThreadId() => %d\n", pthread_self());
-    return pthread_self();
-}
-static int WINAPI expGetCurrentProcess()
-{
-    dbgprintf("GetCurrentProcess() => %d\n", getpid());
-    return getpid();
-}
-
-#ifdef QTX
-// this version is required for Quicktime codecs (.qtx/.qts) to work.
-// (they assume some pointers at FS: segment)
-
-extern void* fs_seg;
-
-//static int tls_count;
-static int tls_use_map[64];
-static int WINAPI expTlsAlloc()
-{
-    int i;
-    for(i=0; i<64; i++)
-       if(tls_use_map[i]==0)
-       {
-           tls_use_map[i]=1;
-           dbgprintf("TlsAlloc() => %d\n",i);
-           return i;
-       }
-    dbgprintf("TlsAlloc() => -1 (ERROR)\n");
-    return -1;
-}
-
-//static int WINAPI expTlsSetValue(DWORD index, void* value)
-static int WINAPI expTlsSetValue(int index, void* value)
-{
-    dbgprintf("TlsSetValue(%d,0x%x) => 1\n",index,value);
-//    if((index<0) || (index>64))
-    if((index>=64))
-       return 0;
-    *(void**)((char*)fs_seg+0x88+4*index) = value;
-    return 1;
-}
-
-static void* WINAPI expTlsGetValue(DWORD index)
-{
-    dbgprintf("TlsGetValue(%d)\n",index);
-//    if((index<0) || (index>64))
-    if((index>=64)) return NULL;
-    return *(void**)((char*)fs_seg+0x88+4*index);
-}
-
-static int WINAPI expTlsFree(int idx)
-{
-    int index = (int) idx;
-    dbgprintf("TlsFree(%d)\n",index);
-    if((index<0) || (index>64))
-       return 0;
-    tls_use_map[index]=0;
-    return 1;
-}
-
-#else
-struct tls_s {
-    void* value;
-    int used;
-    struct tls_s* prev;
-    struct tls_s* next;
-};
-
-static void* WINAPI expTlsAlloc()
-{
-    if (g_tls == NULL)
-    {
-       g_tls=my_mreq(sizeof(tls_t), 0);
-       g_tls->next=g_tls->prev=NULL;
-    }
-    else
-    {
-       g_tls->next=my_mreq(sizeof(tls_t), 0);
-       g_tls->next->prev=g_tls;
-       g_tls->next->next=NULL;
-       g_tls=g_tls->next;
-    }
-    dbgprintf("TlsAlloc() => 0x%x\n", g_tls);
-    if (g_tls)
-       g_tls->value=0; /* XXX For Divx.dll */
-    return g_tls;
-}
-
-static int WINAPI expTlsSetValue(void* idx, void* value)
-{
-    tls_t* index = (tls_t*) idx;
-    int result;
-    if(index==0)
-       result=0;
-    else
-    {
-       index->value=value;
-       result=1;
-    }
-    dbgprintf("TlsSetValue(index 0x%x, value 0x%x) => %d \n", index, value, result );
-    return result;
-}
-static void* WINAPI expTlsGetValue(void* idx)
-{
-    tls_t* index = (tls_t*) idx;
-    void* result;
-    if(index==0)
-       result=0;
-    else
-       result=index->value;
-    dbgprintf("TlsGetValue(index 0x%x) => 0x%x\n", index, result);
-    return result;
-}
-static int WINAPI expTlsFree(void* idx)
-{
-    tls_t* index = (tls_t*) idx;
-    int result;
-    if(index==0)
-       result=0;
-    else
-    {
-       if(index->next)
-           index->next->prev=index->prev;
-       if(index->prev)
-           index->prev->next=index->next;
-       if (g_tls == index)
-            g_tls = index->prev;
-       my_release((void*)index);
-       result=1;
-    }
-    dbgprintf("TlsFree(index 0x%x) => %d\n", index, result);
-    return result;
-}
-#endif
-
-static void* WINAPI expLocalAlloc(int flags, int size)
-{
-    void* z = my_mreq(size, (flags & GMEM_ZEROINIT));
-    if (z == 0)
-       printf("LocalAlloc() failed\n");
-    dbgprintf("LocalAlloc(%d, flags 0x%x) => 0x%x\n", size, flags, z);
-    return z;
-}
-
-static void* WINAPI expLocalReAlloc(int handle,int size, int flags)
-{
-    void *newpointer;
-    int oldsize;
-
-    newpointer=NULL;
-    if (flags & LMEM_MODIFY) {
-       dbgprintf("LocalReAlloc MODIFY\n");
-       return (void *)handle;
-    }
-    oldsize = my_size((void *)handle);
-    newpointer = my_realloc((void *)handle,size);
-    dbgprintf("LocalReAlloc(%x %d(old %d), flags 0x%x) => 0x%x\n", handle,size,oldsize, flags,newpointer);
-
-    return newpointer;
-}
-
-static void* WINAPI expLocalLock(void* z)
-{
-    dbgprintf("LocalLock(0x%x) => 0x%x\n", z, z);
-    return z;
-}
-
-static void* WINAPI expGlobalAlloc(int flags, int size)
-{
-    void* z;
-    dbgprintf("GlobalAlloc(%d, flags 0x%X)\n", size, flags);
-
-    z=my_mreq(size, (flags & GMEM_ZEROINIT));
-    //z=calloc(size, 1);
-    //z=malloc(size);
-    if(z==0)
-       printf("GlobalAlloc() failed\n");
-    dbgprintf("GlobalAlloc(%d, flags 0x%x) => 0x%x\n", size, flags, z);
-    return z;
-}
-static void* WINAPI expGlobalLock(void* z)
-{
-    dbgprintf("GlobalLock(0x%x) => 0x%x\n", z, z);
-    return z;
-}
-// pvmjpg20 - but doesn't work anyway
-static int WINAPI expGlobalSize(void* amem)
-{
-    int size = 100000;
-#ifdef GARBAGE
-    alloc_header* header = last_alloc;
-    alloc_header* mem = (alloc_header*) amem - 1;
-    if (amem == 0)
-       return 0;
-    pthread_mutex_lock(&memmut);
-    while (header)
-    {
-       if (header->deadbeef != 0xdeadbeef)
-       {
-           dbgprintf("FATAL found corrupted memory! %p  0x%lx  (%d)\n", header, header->deadbeef, alccnt);
-           break;
-       }
-
-       if (header == mem)
-       {
-           size = header->size;
-           break;
-       }
-
-       header = header->prev;
-    }
-    pthread_mutex_unlock(&memmut);
-#endif
-
-    dbgprintf("GlobalSize(0x%x)\n", amem);
-    return size;
-}
-
-static int WINAPI expLoadIconA( long hinstance, char *name )
-{
- dbgprintf("LoadIconA( %ld, 0x%x ) => 1\n",hinstance,name);
- return 1;
-}
-
-static int WINAPI expLoadStringA(long instance, long  id, void* buf, long size)
-{
-    int result=LoadStringA(instance, id, buf, size);
-    //    if(buf)
-    dbgprintf("LoadStringA(instance 0x%x, id 0x%x, buffer 0x%x, size %d) => %d ( %s )\n",
-             instance, id, buf, size, result, buf);
-    //    else
-    //    dbgprintf("LoadStringA(instance 0x%x, id 0x%x, buffer 0x%x, size %d) => %d\n",
-    // instance, id, buf, size, result);
-    return result;
-}
-
-static long WINAPI expMultiByteToWideChar(long v1, long v2, char* s1, long siz1, short* s2, int siz2)
-{
-#warning FIXME
-    int i;
-    int result;
-    if(s2==0)
-       result=1;
-    else
-    {
-       if(siz1>siz2/2)siz1=siz2/2;
-       for(i=1; i<=siz1; i++)
-       {
-           *s2=*s1;
-           if(!*s1)break;
-           s2++;
-           s1++;
-       }
-       result=i;
-    }
-    if(s1)
-       dbgprintf("MultiByteToWideChar(codepage %d, flags 0x%x, string 0x%x='%s',"
-                 "size %d, dest buffer 0x%x, dest size %d) => %d\n",
-                 v1, v2, s1, s1, siz1, s2, siz2, result);
-    else
-       dbgprintf("MultiByteToWideChar(codepage %d, flags 0x%x, string NULL,"
-                 "size %d, dest buffer 0x%x, dest size %d) =>\n",
-                 v1, v2, siz1, s2, siz2, result);
-    return result;
-}
-static void wch_print(const short* str)
-{
-    dbgprintf("  src: ");
-    while(*str)dbgprintf("%c", *str++);
-    dbgprintf("\n");
-}
-static long WINAPI expWideCharToMultiByte(long v1, long v2, short* s1, long siz1,
-                                         char* s2, int siz2, char* c3, int* siz3)
-{
-    int result;
-    dbgprintf("WideCharToMultiByte(codepage %d, flags 0x%x, src 0x%x, src size %d, "
-             "dest 0x%x, dest size %d, defch 0x%x, used_defch 0x%x)", v1, v2, s1, siz1, s2, siz2, c3, siz3);
-    result=WideCharToMultiByte(v1, v2, s1, siz1, s2, siz2, c3, siz3);
-    dbgprintf("=> %d\n", result);
-    //if(s1)wch_print(s1);
-    if(s2)dbgprintf("  dest: %s\n", s2);
-    return result;
-}
-static long WINAPI expGetVersionExA(OSVERSIONINFOA* c)
-{
-    dbgprintf("GetVersionExA(0x%x) => 1\n");
-    c->dwOSVersionInfoSize=sizeof(*c);
-    c->dwMajorVersion=4;
-    c->dwMinorVersion=0;
-    c->dwBuildNumber=0x4000457;
-#if 1
-    // leave it here for testing win9x-only codecs
-    c->dwPlatformId=VER_PLATFORM_WIN32_WINDOWS;
-    strcpy(c->szCSDVersion, " B");
-#else
-    c->dwPlatformId=VER_PLATFORM_WIN32_NT; // let's not make DLL assume that it can read CR* registers
-    strcpy(c->szCSDVersion, "Service Pack 3");
-#endif
-    dbgprintf("  Major version: 4\n  Minor version: 0\n  Build number: 0x4000457\n"
-             "  Platform Id: VER_PLATFORM_WIN32_NT\n Version string: 'Service Pack 3'\n");
-    return 1;
-}
-static HANDLE WINAPI expCreateSemaphoreA(char* v1, long init_count,
-                                        long max_count, char* name)
-{
-    pthread_mutex_t *pm;
-    pthread_cond_t  *pc;
-    mutex_list* pp;
-    /*
-     printf("CreateSemaphoreA(%p = %s)\n", name, (name ? name : "<null>"));
-     pp=mlist;
-     while(pp)
-     {
-     printf("%p => ", pp);
-     pp=pp->prev;
-     }
-     printf("0\n");
-     */
-    if(mlist!=NULL)
-    {
-       mutex_list* pp=mlist;
-       if(name!=NULL)
-           do
-       {
-           if((strcmp(pp->name, name)==0) && (pp->type==1))
-           {
-               dbgprintf("CreateSemaphoreA(0x%x, init_count %d, max_count %d, name 0x%x='%s') => 0x%x\n",
-                         v1, init_count, max_count, name, name, mlist);
-               return (HANDLE)mlist;
-           }
-       }while((pp=pp->prev) != NULL);
-    }
-    pm=mreq_private(sizeof(pthread_mutex_t), 0, AREATYPE_MUTEX);
-    pthread_mutex_init(pm, NULL);
-    pc=mreq_private(sizeof(pthread_cond_t), 0, AREATYPE_COND);
-    pthread_cond_init(pc, NULL);
-    if(mlist==NULL)
-    {
-       mlist=mreq_private(sizeof(mutex_list), 00, AREATYPE_EVENT);
-       mlist->next=mlist->prev=NULL;
-    }
-    else
-    {
-       mlist->next=mreq_private(sizeof(mutex_list), 00, AREATYPE_EVENT);
-       mlist->next->prev=mlist;
-       mlist->next->next=NULL;
-       mlist=mlist->next;
-       //      printf("new semaphore %p\n", mlist);
-    }
-    mlist->type=1; /* Type Semaphore */
-    mlist->pm=pm;
-    mlist->pc=pc;
-    mlist->state=0;
-    mlist->reset=0;
-    mlist->semaphore=init_count;
-    if(name!=NULL)
-       strncpy(mlist->name, name, 64);
-    else
-       mlist->name[0]=0;
-    if(pm==NULL)
-       dbgprintf("ERROR::: CreateSemaphoreA failure\n");
-    if(name)
-       dbgprintf("CreateSemaphoreA(0x%x, init_count %d, max_count %d, name 0x%x='%s') => 0x%x\n",
-                 v1, init_count, max_count, name, name, mlist);
-    else
-       dbgprintf("CreateSemaphoreA(0x%x, init_count %d, max_count %d, name 0) => 0x%x\n",
-                 v1, init_count, max_count, mlist);
-    return (HANDLE)mlist;
-}
-
-static long WINAPI expReleaseSemaphore(long hsem, long increment, long* prev_count)
-{
-    // The state of a semaphore object is signaled when its count
-    // is greater than zero and nonsignaled when its count is equal to zero
-    // Each time a waiting thread is released because of the semaphore's signaled
-    // state, the count of the semaphore is decreased by one.
-    mutex_list *ml = (mutex_list *)hsem;
-
-    pthread_mutex_lock(ml->pm);
-    if (prev_count != 0) *prev_count = ml->semaphore;
-    if (ml->semaphore == 0) pthread_cond_signal(ml->pc);
-    ml->semaphore += increment;
-    pthread_mutex_unlock(ml->pm);
-    dbgprintf("ReleaseSemaphore(semaphore 0x%x, increment %d, prev_count 0x%x) => 1\n",
-             hsem, increment, prev_count);
-    return 1;
-}
-
-
-static long WINAPI expRegOpenKeyExA(long key, const char* subkey, long reserved, long access, int* newkey)
-{
-    long result=RegOpenKeyExA(key, subkey, reserved, access, newkey);
-    dbgprintf("RegOpenKeyExA(key 0x%x, subkey %s, reserved %d, access 0x%x, pnewkey 0x%x) => %d\n",
-             key, subkey, reserved, access, newkey, result);
-    if(newkey)dbgprintf("  New key: 0x%x\n", *newkey);
-    return result;
-}
-static long WINAPI expRegCloseKey(long key)
-{
-    long result=RegCloseKey(key);
-    dbgprintf("RegCloseKey(0x%x) => %d\n", key, result);
-    return result;
-}
-static long WINAPI expRegQueryValueExA(long key, const char* value, int* reserved, int* type, int* data, int* count)
-{
-    long result=RegQueryValueExA(key, value, reserved, type, data, count);
-    dbgprintf("RegQueryValueExA(key 0x%x, value %s, reserved 0x%x, data 0x%x, count 0x%x)"
-             " => 0x%x\n", key, value, reserved, data, count, result);
-    if(data && count)dbgprintf("  read %d bytes: '%s'\n", *count, data);
-    return result;
-}
-
-//from wine source dlls/advapi32/registry.c
-static long WINAPI expRegCreateKeyA(long hkey, const char* name, int *retkey)
-{
-    dbgprintf("RegCreateKeyA(key 0x%x, name 0x%x='%s',newkey=0x%x)\n",hkey,name,retkey);
-    return RegCreateKeyExA( hkey, name, 0, NULL,REG_OPTION_NON_VOLATILE,
-                            KEY_ALL_ACCESS , NULL, retkey, NULL );
-}
-
-static long WINAPI expRegCreateKeyExA(long key, const char* name, long reserved,
-                                     void* classs, long options, long security,
-                                     void* sec_attr, int* newkey, int* status)
-{
-    long result=RegCreateKeyExA(key, name, reserved, classs, options, security, sec_attr, newkey, status);
-    dbgprintf("RegCreateKeyExA(key 0x%x, name 0x%x='%s', reserved=0x%x,"
-             " 0x%x, 0x%x, 0x%x, newkey=0x%x, status=0x%x) => %d\n",
-             key, name, name, reserved, classs, options, security, sec_attr, newkey, status, result);
-    if(!result && newkey) dbgprintf("  New key: 0x%x\n", *newkey);
-    if(!result && status) dbgprintf("  New key status: 0x%x\n", *status);
-    return result;
-}
-static long WINAPI expRegSetValueExA(long key, const char* name, long v1, long v2, void* data, long size)
-{
-    long result=RegSetValueExA(key, name, v1, v2, data, size);
-    dbgprintf("RegSetValueExA(key 0x%x, name '%s', 0x%x, 0x%x, data 0x%x -> 0x%x '%s', size=%d) => %d",
-             key, name, v1, v2, data, *(int*)data, data, size, result);
-    return result;
-}
-
-static long WINAPI expRegOpenKeyA (long hKey, LPCSTR lpSubKey, int* phkResult)
-{
-    long result=RegOpenKeyExA(hKey, lpSubKey, 0, 0, phkResult);
-    dbgprintf("RegOpenKeyExA(key 0x%x, subkey '%s', 0x%x) => %d\n",
-             hKey, lpSubKey, phkResult, result);
-    if(!result && phkResult) dbgprintf("  New key: 0x%x\n", *phkResult);
-    return result;
-}
-
-static DWORD WINAPI expRegEnumValueA(HKEY hkey, DWORD index, LPSTR value, LPDWORD val_count,
-                                    LPDWORD reserved, LPDWORD type, LPBYTE data, LPDWORD count)
-{
-    return RegEnumValueA(hkey, index, value, val_count,
-                        reserved, type, data, count);
-}
-
-static DWORD WINAPI expRegEnumKeyExA(HKEY hKey, DWORD dwIndex, LPSTR lpName, LPDWORD lpcbName,
-                                    LPDWORD lpReserved, LPSTR lpClass, LPDWORD lpcbClass,
-                                    LPFILETIME lpftLastWriteTime)
-{
-    return RegEnumKeyExA(hKey, dwIndex, lpName, lpcbName, lpReserved, lpClass,
-                        lpcbClass, lpftLastWriteTime);
-}
-
-static long WINAPI expQueryPerformanceCounter(long long* z)
-{
-    longcount(z);
-    dbgprintf("QueryPerformanceCounter(0x%x) => 1 ( %Ld )\n", z, *z);
-    return 1;
-}
-
-/*
- * dummy function RegQueryInfoKeyA(), required by vss codecs
- */
-static DWORD WINAPI expRegQueryInfoKeyA( HKEY hkey, LPSTR class, LPDWORD class_len, LPDWORD reserved,
-                                         LPDWORD subkeys, LPDWORD max_subkey, LPDWORD max_class,
-                                         LPDWORD values, LPDWORD max_value, LPDWORD max_data,
-                                         LPDWORD security, FILETIME *modif )
-{
-    return ERROR_SUCCESS;
-}
-
-/*
- * return CPU clock (in kHz), using linux's /proc filesystem (/proc/cpuinfo)
- */
-static double linux_cpuinfo_freq()
-{
-    double freq=-1;
-    FILE *f;
-    char line[200];
-    char *s,*value;
-
-    f = fopen ("/proc/cpuinfo", "r");
-    if (f != NULL) {
-       while (fgets(line,sizeof(line),f)!=NULL) {
-           /* NOTE: the ':' is the only character we can rely on */
-           if (!(value = strchr(line,':')))
-               continue;
-           /* terminate the valuename */
-           *value++ = '\0';
-           /* skip any leading spaces */
-           while (*value==' ') value++;
-           if ((s=strchr(value,'\n')))
-               *s='\0';
-
-           if (!strncasecmp(line, "cpu MHz",strlen("cpu MHz"))
-               && sscanf(value, "%lf", &freq) == 1) {
-               freq*=1000;
-               break;
-           }
-       }
-       fclose(f);
-    }
-    return freq;
-}
-
-
-static double solaris_kstat_freq()
-{
-#if    defined(HAVE_LIBKSTAT) && defined(KSTAT_DATA_INT32)
-    /*
-     * try to extract the CPU speed from the solaris kernel's kstat data
-     */
-    kstat_ctl_t   *kc;
-    kstat_t       *ksp;
-    kstat_named_t *kdata;
-    int            mhz = 0;
-
-    kc = kstat_open();
-    if (kc != NULL)
-    {
-       ksp = kstat_lookup(kc, "cpu_info", 0, "cpu_info0");
-
-       /* kstat found and name/value pairs? */
-       if (ksp != NULL && ksp->ks_type == KSTAT_TYPE_NAMED)
-       {
-           /* read the kstat data from the kernel */
-           if (kstat_read(kc, ksp, NULL) != -1)
-           {
-               /*
-                * lookup desired "clock_MHz" entry, check the expected
-                * data type
-                */
-               kdata = (kstat_named_t *)kstat_data_lookup(ksp, "clock_MHz");
-               if (kdata != NULL && kdata->data_type == KSTAT_DATA_INT32)
-                   mhz = kdata->value.i32;
-           }
-       }
-       kstat_close(kc);
-    }
-
-    if (mhz > 0)
-       return mhz * 1000.;
-#endif /* HAVE_LIBKSTAT */
-    return -1;         // kstat stuff is not available, CPU freq is unknown
-}
-
-/*
- * Measure CPU freq using the pentium's time stamp counter register (TSC)
- */
-static double tsc_freq()
-{
-    static double ofreq=0.0;
-    int i;
-    int x,y;
-    i=time(NULL);
-    if (ofreq != 0.0) return ofreq;
-    while(i==time(NULL));
-    x=localcount();
-    i++;
-    while(i==time(NULL));
-    y=localcount();
-    ofreq = (double)(y-x)/1000.;
-    return ofreq;
-}
-
-static double CPU_Freq()
-{
-    double freq;
-
-    if ((freq = linux_cpuinfo_freq()) > 0)
-       return freq;
-
-    if ((freq = solaris_kstat_freq()) > 0)
-       return freq;
-
-    return tsc_freq();
-}
-
-static long WINAPI expQueryPerformanceFrequency(long long* z)
-{
-    *z=(long long)CPU_Freq();
-    dbgprintf("QueryPerformanceFrequency(0x%x) => 1 ( %Ld )\n", z, *z);
-    return 1;
-}
-static long WINAPI exptimeGetTime()
-{
-    struct timeval t;
-    long result;
-    gettimeofday(&t, 0);
-    result=1000*t.tv_sec+t.tv_usec/1000;
-    dbgprintf("timeGetTime() => %d\n", result);
-    return result;
-}
-static void* WINAPI expLocalHandle(void* v)
-{
-    dbgprintf("LocalHandle(0x%x) => 0x%x\n", v, v);
-    return v;
-}
-
-static void* WINAPI expGlobalHandle(void* v)
-{
-    dbgprintf("GlobalHandle(0x%x) => 0x%x\n", v, v);
-    return v;
-}
-static int WINAPI expGlobalUnlock(void* v)
-{
-    dbgprintf("GlobalUnlock(0x%x) => 1\n", v);
-    return 1;
-}
-static void* WINAPI expGlobalFree(void* v)
-{
-    dbgprintf("GlobalFree(0x%x) => 0\n", v);
-    my_release(v);
-    //free(v);
-    return 0;
-}
-
-static void* WINAPI expGlobalReAlloc(void* v, int size, int flags)
-{
-    void* result=my_realloc(v, size);
-    //void* result=realloc(v, size);
-    dbgprintf("GlobalReAlloc(0x%x, size %d, flags 0x%x) => 0x%x\n", v,size,flags,result);
-    return result;
-}
-
-static int WINAPI expLocalUnlock(void* v)
-{
-    dbgprintf("LocalUnlock(0x%x) => 1\n", v);
-    return 1;
-}
-//
-static void* WINAPI expLocalFree(void* v)
-{
-    dbgprintf("LocalFree(0x%x) => 0\n", v);
-    my_release(v);
-    return 0;
-}
-static HRSRC WINAPI expFindResourceA(HMODULE module, char* name, char* type)
-{
-    HRSRC result;
-
-    result=FindResourceA(module, name, type);
-    dbgprintf("FindResourceA(module 0x%x, name 0x%x(%s), type 0x%x(%s)) => 0x%x\n",
-       module, name, HIWORD(name) ? name : "UNICODE", type, HIWORD(type) ? type : "UNICODE", result);
-    return result;
-}
-
-extern HRSRC WINAPI LoadResource(HMODULE, HRSRC);
-static HGLOBAL WINAPI expLoadResource(HMODULE module, HRSRC res)
-{
-    HGLOBAL result=LoadResource(module, res);
-    dbgprintf("LoadResource(module 0x%x, resource 0x%x) => 0x%x\n", module, res, result);
-    return result;
-}
-static void* WINAPI expLockResource(long res)
-{
-    void* result=LockResource(res);
-    dbgprintf("LockResource(0x%x) => 0x%x\n", res, result);
-    return result;
-}
-static int WINAPI expFreeResource(long res)
-{
-    int result=FreeResource(res);
-    dbgprintf("FreeResource(0x%x) => %d\n", res, result);
-    return result;
-}
-//bool fun(HANDLE)
-//!0 on success
-static int WINAPI expCloseHandle(long v1)
-{
-    dbgprintf("CloseHandle(0x%x) => 1\n", v1);
-    /* do not close stdin,stdout and stderr */
-    if (v1 > 2)
-       if (!close(v1))
-           return 0;
-    return 1;
-}
-
-static const char* WINAPI expGetCommandLineA()
-{
-    dbgprintf("GetCommandLineA() => \"c:\\aviplay.exe\"\n");
-    return "c:\\aviplay.exe";
-}
-static short envs[]={'p', 'a', 't', 'h', ' ', 'c', ':', '\\', 0, 0};
-static LPWSTR WINAPI expGetEnvironmentStringsW()
-{
-    dbgprintf("GetEnvironmentStringsW() => 0\n", envs);
-    return 0;
-}
-static void * WINAPI expRtlZeroMemory(void *p, size_t len)
-{
-    void* result=memset(p,0,len);
-    dbgprintf("RtlZeroMemory(0x%x, len %d) => 0x%x\n",p,len,result);
-    return result;
-}
-static void * WINAPI expRtlMoveMemory(void *dst, void *src, size_t len)
-{
-    void* result=memmove(dst,src,len);
-    dbgprintf("RtlMoveMemory (dest 0x%x, src 0x%x, len %d) => 0x%x\n",dst,src,len,result);
-    return result;
-}
-
-static void * WINAPI expRtlFillMemory(void *p, int ch, size_t len)
-{
-    void* result=memset(p,ch,len);
-    dbgprintf("RtlFillMemory(0x%x, char 0x%x, len %d) => 0x%x\n",p,ch,len,result);
-    return result;
-}
-static int WINAPI expFreeEnvironmentStringsW(short* strings)
-{
-    dbgprintf("FreeEnvironmentStringsW(0x%x) => 1\n", strings);
-    return 1;
-}
-static int WINAPI expFreeEnvironmentStringsA(char* strings)
-{
-    dbgprintf("FreeEnvironmentStringsA(0x%x) => 1\n", strings);
-    return 1;
-}
-
-static const char ch_envs[]=
-"__MSVCRT_HEAP_SELECT=__GLOBAL_HEAP_SELECTED,1\r\n"
-"PATH=C:\\;C:\\windows\\;C:\\windows\\system\r\n";
-static LPCSTR WINAPI expGetEnvironmentStrings()
-{
-    dbgprintf("GetEnvironmentStrings() => 0x%x\n", ch_envs);
-    return (LPCSTR)ch_envs;
-    // dbgprintf("GetEnvironmentStrings() => 0\n");
-    // return 0;
-}
-
-static int WINAPI expGetStartupInfoA(STARTUPINFOA *s)
-{
-    int i;
-    dbgprintf("GetStartupInfoA(0x%x) => 1\n");
-    memset(s, 0, sizeof(*s));
-    s->cb=sizeof(*s);
-    // s->lpReserved="Reserved";
-    // s->lpDesktop="Desktop";
-    // s->lpTitle="Title";
-    // s->dwX=s->dwY=0;
-    // s->dwXSize=s->dwYSize=200;
-    s->dwFlags=s->wShowWindow=1;
-    // s->hStdInput=s->hStdOutput=s->hStdError=0x1234;
-    dbgprintf("  cb=%d\n", s->cb);
-    dbgprintf("  lpReserved='%s'\n", s->lpReserved);
-    dbgprintf("  lpDesktop='%s'\n", s->lpDesktop);
-    dbgprintf("  lpTitle='%s'\n", s->lpTitle);
-    dbgprintf("  dwX=%d dwY=%d dwXSize=%d dwYSize=%d\n",
-             s->dwX, s->dwY, s->dwXSize, s->dwYSize);
-    dbgprintf("  dwXCountChars=%d dwYCountChars=%d dwFillAttribute=%d\n",
-             s->dwXCountChars, s->dwYCountChars, s->dwFillAttribute);
-    dbgprintf("  dwFlags=0x%x wShowWindow=0x%x cbReserved2=0x%x\n",
-             s->dwFlags, s->wShowWindow, s->cbReserved2);
-    dbgprintf("  lpReserved2=0x%x hStdInput=0x%x hStdOutput=0x%x hStdError=0x%x\n",
-             s->lpReserved2, s->hStdInput, s->hStdOutput, s->hStdError);
-    return 1;
-}
-
-static int WINAPI expGetStdHandle(int z)
-{
-    dbgprintf("GetStdHandle(0x%x) => 0x%x\n", z+0x1234);
-    return z+0x1234;
-}
-
-#ifdef QTX
-#define FILE_HANDLE_quicktimeqts       ((HANDLE)0x444)
-#define FILE_HANDLE_quicktimeqtx       ((HANDLE)0x445)
-#endif
-
-static int WINAPI expGetFileType(int handle)
-{
-    dbgprintf("GetFileType(0x%x) => 0x3 = pipe\n", handle);
-    return 0x3;
-}
-#ifdef QTX
-static int WINAPI expGetFileAttributesA(char *filename)
-{
-    dbgprintf("GetFileAttributesA(%s) => FILE_ATTR_NORMAL\n", filename);
-    if (strstr(filename, "QuickTime.qts"))
-       return FILE_ATTRIBUTE_SYSTEM;
-    return FILE_ATTRIBUTE_NORMAL;
-}
-#endif
-static int WINAPI expSetHandleCount(int count)
-{
-    dbgprintf("SetHandleCount(0x%x) => 1\n", count);
-    return 1;
-}
-static int WINAPI expGetACP(void)
-{
-    dbgprintf("GetACP() => 0\n");
-    return 0;
-}
-extern WINE_MODREF *MODULE32_LookupHMODULE(HMODULE m);
-static int WINAPI expGetModuleFileNameA(int module, char* s, int len)
-{
-    WINE_MODREF *mr;
-    int result;
-    //printf("File name of module %X (%s) requested\n", module, s);
-
-    if (module == 0 && len >= 12)
-    {
-       /* return caller program name */
-       strcpy(s, "aviplay.dll");
-       result=1;
-    }
-    else if(s==0)
-       result=0;
-    else
-       if(len<35)
-           result=0;
-       else
-       {
-           result=1;
-           strcpy(s, "c:\\windows\\system\\");
-           mr=MODULE32_LookupHMODULE(module);
-           if(mr==0)//oops
-               strcat(s, "aviplay.dll");
-           else
-               if(strrchr(mr->filename, '/')==NULL)
-                   strcat(s, mr->filename);
-               else
-                   strcat(s, strrchr(mr->filename, '/')+1);
-       }
-    if(!s)
-       dbgprintf("GetModuleFileNameA(0x%x, 0x%x, %d) => %d\n",
-                 module, s, len, result);
-    else
-       dbgprintf("GetModuleFileNameA(0x%x, 0x%x, %d) => %d ( '%s' )\n",
-                 module, s, len, result, s);
-    return result;
-}
-
-static int WINAPI expSetUnhandledExceptionFilter(void* filter)
-{
-    dbgprintf("SetUnhandledExceptionFilter(0x%x) => 1\n", filter);
-    return 1;//unsupported and probably won't ever be supported
-}
-
-static int WINAPI expLoadLibraryA(char* name)
-{
-    int result = 0;
-    char* lastbc;
-    int i;
-    if (!name)
-       return -1;
-    // we skip to the last backslash
-    // this is effectively eliminating weird characters in
-    // the text output windows
-
-    lastbc = strrchr(name, '\\');
-    if (lastbc)
-    {
-       int i;
-       lastbc++;
-       for (i = 0; 1 ;i++)
-       {
-           name[i] = *lastbc++;
-           if (!name[i])
-               break;
-       }
-    }
-    if(strncmp(name, "c:\\windows\\", 11)==0) name += 11;
-    if(strncmp(name, ".\\", 2)==0) name += 2;
-
-    dbgprintf("Entering LoadLibraryA(%s)\n", name);
-
-    // PIMJ and VIVO audio are loading  kernel32.dll
-    if (strcasecmp(name, "kernel32.dll") == 0 || strcasecmp(name, "kernel32") == 0)
-       return MODULE_HANDLE_kernel32;
-//     return ERROR_SUCCESS; /* yeah, we have also the kernel32 calls */
-                             /* exported -> do not return failed! */
-
-    if (strcasecmp(name, "user32.dll") == 0 || strcasecmp(name, "user32") == 0)
-//     return MODULE_HANDLE_kernel32;
-       return MODULE_HANDLE_user32;
-
-#ifdef QTX
-    if (strcasecmp(name, "wininet.dll") == 0 || strcasecmp(name, "wininet") == 0)
-       return MODULE_HANDLE_wininet;
-    if (strcasecmp(name, "ddraw.dll") == 0 || strcasecmp(name, "ddraw") == 0)
-       return MODULE_HANDLE_ddraw;
-    if (strcasecmp(name, "advapi32.dll") == 0 || strcasecmp(name, "advapi32") == 0)
-       return MODULE_HANDLE_advapi32;
-#endif
-
-    if (strcasecmp(name, "comdlg32.dll") == 0 || strcasecmp(name, "comdlg32") == 0)
-       return MODULE_HANDLE_comdlg32;
-    if (strcasecmp(name, "msvcrt.dll") == 0 || strcasecmp(name, "msvcrt") == 0)
-       return MODULE_HANDLE_msvcrt;
-    if (strcasecmp(name, "ole32.dll") == 0 || strcasecmp(name, "ole32") == 0)
-       return MODULE_HANDLE_ole32;
-    if (strcasecmp(name, "winmm.dll") == 0 || strcasecmp(name, "winmm") == 0)
-       return MODULE_HANDLE_winmm;
-
-    result=LoadLibraryA(name);
-    dbgprintf("Returned LoadLibraryA(0x%x='%s'), def_path=%s => 0x%x\n", name, name, def_path, result);
-
-    return result;
-}
-
-static int WINAPI expFreeLibrary(int module)
-{
-#ifdef QTX
-    int result=0; /* FIXME:XXX: qtx svq3 frees up qt.qts */
-#else
-    int result=FreeLibrary(module);
-#endif
-    dbgprintf("FreeLibrary(0x%x) => %d\n", module, result);
-    return result;
-}
-
-static void* WINAPI expGetProcAddress(HMODULE mod, char* name)
-{
-    void* result;
-    switch(mod){
-    case MODULE_HANDLE_kernel32:
-       result=LookupExternalByName("kernel32.dll", name); break;
-    case MODULE_HANDLE_user32:
-       result=LookupExternalByName("user32.dll", name); break;
-#ifdef QTX
-    case MODULE_HANDLE_wininet:
-       result=LookupExternalByName("wininet.dll", name); break;
-    case MODULE_HANDLE_ddraw:
-       result=LookupExternalByName("ddraw.dll", name); break;
-    case MODULE_HANDLE_advapi32:
-       result=LookupExternalByName("advapi32.dll", name); break;
-#endif
-    case MODULE_HANDLE_comdlg32:
-       result=LookupExternalByName("comdlg32.dll", name); break;
-    case MODULE_HANDLE_msvcrt:
-       result=LookupExternalByName("msvcrt.dll", name); break;
-    case MODULE_HANDLE_ole32:
-       result=LookupExternalByName("ole32.dll", name); break;
-    case MODULE_HANDLE_winmm:
-       result=LookupExternalByName("winmm.dll", name); break;
-    default:
-       result=GetProcAddress(mod, name);
-    }
-    dbgprintf("GetProcAddress(0x%x, '%s') => 0x%x\n", mod, name, result);
-    return result;
-}
-
-static long WINAPI expCreateFileMappingA(int hFile, void* lpAttr,
-                                        long flProtect, long dwMaxHigh,
-                                        long dwMaxLow, const char* name)
-{
-    long result=CreateFileMappingA(hFile, lpAttr, flProtect, dwMaxHigh, dwMaxLow, name);
-    if(!name)
-       dbgprintf("CreateFileMappingA(file 0x%x, lpAttr 0x%x,"
-                 "flProtect 0x%x, dwMaxHigh 0x%x, dwMaxLow 0x%x, name 0) => %d\n",
-                 hFile, lpAttr, flProtect, dwMaxHigh, dwMaxLow, result);
-    else
-       dbgprintf("CreateFileMappingA(file 0x%x, lpAttr 0x%x,"
-                 "flProtect 0x%x, dwMaxHigh 0x%x, dwMaxLow 0x%x, name 0x%x='%s') => %d\n",
-                 hFile, lpAttr, flProtect, dwMaxHigh, dwMaxLow, name, name, result);
-    return result;
-}
-
-static long WINAPI expOpenFileMappingA(long hFile, long hz, const char* name)
-{
-    long result=OpenFileMappingA(hFile, hz, name);
-    if(!name)
-       dbgprintf("OpenFileMappingA(0x%x, 0x%x, 0) => %d\n",
-                 hFile, hz, result);
-    else
-       dbgprintf("OpenFileMappingA(0x%x, 0x%x, 0x%x='%s') => %d\n",
-                 hFile, hz, name, name, result);
-    return result;
-}
-
-static void* WINAPI expMapViewOfFile(HANDLE file, DWORD mode, DWORD offHigh,
-                                    DWORD offLow, DWORD size)
-{
-    dbgprintf("MapViewOfFile(0x%x, 0x%x, 0x%x, 0x%x, size %d) => 0x%x\n",
-             file,mode,offHigh,offLow,size,(char*)file+offLow);
-    return (char*)file+offLow;
-}
-
-static void* WINAPI expUnmapViewOfFile(void* view)
-{
-    dbgprintf("UnmapViewOfFile(0x%x) => 0\n", view);
-    return 0;
-}
-
-static void* WINAPI expSleep(int time)
-{
-#if HAVE_NANOSLEEP
-    /* solaris doesn't have thread safe usleep */
-    struct timespec tsp;
-    tsp.tv_sec  =  time / 1000000;
-    tsp.tv_nsec = (time % 1000000) * 1000;
-    nanosleep(&tsp, NULL);
-#else
-    usleep(time);
-#endif
-    dbgprintf("Sleep(%d) => 0\n", time);
-    return 0;
-}
-
-// why does IV32 codec want to call this? I don't know ...
-static int WINAPI expCreateCompatibleDC(int hdc)
-{
-    int dc = 0;//0x81;
-    //dbgprintf("CreateCompatibleDC(%d) => 0x81\n", hdc);
-    dbgprintf("CreateCompatibleDC(%d) => %d\n", hdc, dc);
-    return dc;
-}
-
-static int WINAPI expGetDeviceCaps(int hdc, int unk)
-{
-    dbgprintf("GetDeviceCaps(0x%x, %d) => 0\n", hdc, unk);
-#ifdef QTX
-    #define BITSPIXEL 12
-    #define PLANES    14
-    if (unk == BITSPIXEL)
-       return 24;
-    if (unk == PLANES)
-       return 1;
-#endif
-    return 1;
-}
-
-static WIN_BOOL WINAPI expDeleteDC(int hdc)
-{
-    dbgprintf("DeleteDC(0x%x) => 0\n", hdc);
-    if (hdc == 0x81)
-       return 1;
-    return 0;
-}
-
-static WIN_BOOL WINAPI expDeleteObject(int hdc)
-{
-    dbgprintf("DeleteObject(0x%x) => 1\n", hdc);
-    /* FIXME - implement code here */
-    return 1;
-}
-
-/* btvvc32.drv wants this one */
-static void* WINAPI expGetWindowDC(int hdc)
-{
-    dbgprintf("GetWindowDC(%d) => 0x0\n", hdc);
-    return 0;
-}
-
-#ifdef QTX
-static int WINAPI expGetWindowRect(HWND win, RECT *r)
-{
-    dbgprintf("GetWindowRect(0x%x, 0x%x) => 1\n", win, r);
-    /* (win == 0) => desktop */
-    r->right = PSEUDO_SCREEN_WIDTH;
-    r->left = 0;
-    r->bottom = PSEUDO_SCREEN_HEIGHT;
-    r->top = 0;
-    return 1;
-}
-
-static int WINAPI expMonitorFromWindow(HWND win, int flags)
-{
-    dbgprintf("MonitorFromWindow(0x%x, 0x%x) => 0\n", win, flags);
-    return 0;
-}
-
-static int WINAPI expMonitorFromRect(RECT *r, int flags)
-{
-    dbgprintf("MonitorFromRect(0x%x, 0x%x) => 0\n", r, flags);
-    return 0;
-}
-
-static int WINAPI expMonitorFromPoint(void *p, int flags)
-{
-    dbgprintf("MonitorFromPoint(0x%x, 0x%x) => 0\n", p, flags);
-    return 0;
-}
-
-static int WINAPI expEnumDisplayMonitors(void *dc, RECT *r, 
-    int WINAPI (*callback_proc)(), void *callback_param)
-{
-    dbgprintf("EnumDisplayMonitors(0x%x, 0x%x, 0x%x, 0x%x) => ?\n",
-       dc, r, callback_proc, callback_param);
-    return callback_proc(0, dc, r, callback_param);
-}
-
-#if 0
-typedef struct tagMONITORINFO {
-    DWORD  cbSize; 
-    RECT   rcMonitor; 
-    RECT   rcWork; 
-    DWORD  dwFlags; 
-} MONITORINFO, *LPMONITORINFO; 
-#endif
-
-#define CCHDEVICENAME 8
-typedef struct tagMONITORINFOEX {  
-    DWORD  cbSize; 
-    RECT   rcMonitor; 
-    RECT   rcWork; 
-    DWORD  dwFlags; 
-    TCHAR  szDevice[CCHDEVICENAME];
-} MONITORINFOEX, *LPMONITORINFOEX; 
-
-static int WINAPI expGetMonitorInfoA(void *mon, LPMONITORINFO lpmi)
-{
-    dbgprintf("GetMonitorInfoA(0x%x, 0x%x) => 1\n", mon, lpmi);
-    
-    lpmi->rcMonitor.right = lpmi->rcWork.right = PSEUDO_SCREEN_WIDTH;
-    lpmi->rcMonitor.left = lpmi->rcWork.left = 0;
-    lpmi->rcMonitor.bottom = lpmi->rcWork.bottom = PSEUDO_SCREEN_HEIGHT;
-    lpmi->rcMonitor.top = lpmi->rcWork.top = 0;
-
-    lpmi->dwFlags = 1; /* primary monitor */
-
-    if (lpmi->cbSize == sizeof(MONITORINFOEX))
-    {
-       LPMONITORINFOEX lpmiex = (LPMONITORINFOEX)lpmi;
-       dbgprintf("MONITORINFOEX!\n");
-       strncpy(lpmiex->szDevice, "Monitor1", CCHDEVICENAME);
-    }
-    
-    return 1;
-}
-
-static int WINAPI expEnumDisplayDevicesA(const char *device, int devnum,
-       void *dispdev, int flags)
-{
-    dbgprintf("EnumDisplayDevicesA(0x%x = %s, %d, 0x%x, %x) => 1\n",
-       device, device, devnum, dispdev, flags);
-    return 1;
-}
-
-static int WINAPI expIsWindowVisible(HWND win)
-{
-    dbgprintf("IsWindowVisible(0x%x) => 1\n", win);
-    return 1;
-}
-
-static HWND WINAPI expGetActiveWindow(void)
-{
-    dbgprintf("GetActiveWindow() => 0\n");
-    return (HWND)0;
-}
-
-static int WINAPI expGetClassNameA(HWND win, LPTSTR classname, int maxcount)
-{
-    strncat(classname, "QuickTime", maxcount);
-    dbgprintf("GetClassNameA(0x%x, 0x%x, %d) => %d\n",
-       win, classname, maxcount, strlen(classname));
-    return strlen(classname);
-}
-
-#define LPWNDCLASS void *
-static int WINAPI expGetClassInfoA(HINSTANCE inst, LPCSTR classname, LPWNDCLASS wndclass)
-{
-    dbgprintf("GetClassInfoA(0x%x, 0x%x = %s, 0x%x) => 1\n", inst,
-       classname, classname, wndclass);
-    return 1;
-}
-
-static int WINAPI expGetWindowLongA(HWND win, int index)
-{
-    dbgprintf("GetWindowLongA(0x%x, %d) => 0\n", win, index);
-    return 1;
-}
-
-static int WINAPI expGetObjectA(HGDIOBJ hobj, int objsize, LPVOID obj)
-{
-    dbgprintf("GetObjectA(0x%x, %d, 0x%x) => %d\n", hobj, objsize, obj, objsize);
-    return objsize;
-}
-
-static int WINAPI expCreateRectRgn(int x, int y, int width, int height)
-{
-    dbgprintf("CreateRectRgn(%d, %d, %d, %d) => 0\n", x, y, width, height);
-    return 0;
-}
-
-static int WINAPI expEnumWindows(int (*callback_func)(), void *callback_param)
-{
-    int i, i2;
-    dbgprintf("EnumWindows(0x%x, 0x%x) => 1\n", callback_func, callback_param);
-    i = callback_func(0, callback_param);
-    i2 = callback_func(1, callback_param);
-    return i && i2;
-}
-
-static int WINAPI expGetWindowThreadProcessId(HWND win, int *pid_data)
-{
-    int tid = pthread_self();
-    dbgprintf("GetWindowThreadProcessId(0x%x, 0x%x) => %d\n",
-       win, pid_data, tid);
-    if (pid_data)
-       *(int*)pid_data = tid;
-    return tid;
-}
-
-//HWND      WINAPI CreateWindowExA(DWORD,LPCSTR,LPCSTR,DWORD,INT,INT,
-//                                INT,INT,HWND,HMENU,HINSTANCE,LPVOID);
-
-static HWND WINAPI expCreateWindowExA(int exstyle, const char *classname,
-    const char *winname, int style, int x, int y, int w, int h,
-    HWND parent, HMENU menu, HINSTANCE inst, LPVOID param)
-{
-    printf("CreateWindowEx() called\n");
-    dbgprintf("CreateWindowEx(%d, 0x%x = %s, 0x%x = %s, %d, %d, %d, %d, %d, 0x%x, 0x%x, 0x%x, 0x%x) => 1\n",
-       exstyle, classname, classname, winname, winname, style, x, y, w, h,
-       parent, menu, inst, param);
-    printf("CreateWindowEx() called okey\n");
-    return 1;
-}
-
-static int WINAPI expwaveOutGetNumDevs(void)
-{
-    dbgprintf("waveOutGetNumDevs() => 0\n");
-    return 0;
-}
-#endif
-
-/*
- * Returns the number of milliseconds, modulo 2^32, since the start
- * of the wineserver.
- */
-static int WINAPI expGetTickCount(void)
-{
-    static int tcstart = 0;
-    struct timeval t;
-    int tc;
-    gettimeofday( &t, NULL );
-    tc = ((t.tv_sec * 1000) + (t.tv_usec / 1000)) - tcstart;
-    if (tcstart == 0)
-    {
-       tcstart = 0;
-        tc = 0;
-    }
-    dbgprintf("GetTickCount() => %d\n", tc);
-    return tc;
-}
-
-static int WINAPI expCreateFontA(void)
-{
-    dbgprintf("CreateFontA() => 0x0\n");
-    return 1;
-}
-
-/* tried to get pvmjpg work in a different way - no success */
-static int WINAPI expDrawTextA(int hDC, char* lpString, int nCount,
-                              LPRECT lpRect, unsigned int uFormat)
-{
-    dbgprintf("expDrawTextA(%p,...) => 8\n", hDC);
-    return 8;
-}
-
-static int WINAPI expGetPrivateProfileIntA(const char* appname,
-                                          const char* keyname,
-                                          int default_value,
-                                          const char* filename)
-{
-    int size=255;
-    char buffer[256];
-    char* fullname;
-    int result;
-
-    buffer[255]=0;
-    if(!(appname && keyname && filename) )
-    {
-       dbgprintf("GetPrivateProfileIntA('%s', '%s', %d, '%s') => %d\n", appname, keyname, default_value, filename, default_value );
-       return default_value;
-    }
-    fullname=(char*)malloc(50+strlen(appname)+strlen(keyname)+strlen(filename));
-    strcpy(fullname, "Software\\IniFileMapping\\");
-    strcat(fullname, appname);
-    strcat(fullname, "\\");
-    strcat(fullname, keyname);
-    strcat(fullname, "\\");
-    strcat(fullname, filename);
-    result=RegQueryValueExA(HKEY_LOCAL_MACHINE, fullname, NULL, NULL, (int*)buffer, &size);
-    if((size>=0)&&(size<256))
-       buffer[size]=0;
-    //    printf("GetPrivateProfileIntA(%s, %s, %s) -> %s\n", appname, keyname, filename, buffer);
-    free(fullname);
-    if(result)
-       result=default_value;
-    else
-       result=atoi(buffer);
-    dbgprintf("GetPrivateProfileIntA('%s', '%s', %d, '%s') => %d\n", appname, keyname, default_value, filename, result);
-    return result;
-}
-static int WINAPI expGetProfileIntA(const char* appname,
-                                   const char* keyname,
-                                   int default_value)
-{
-    dbgprintf("GetProfileIntA -> ");
-    return expGetPrivateProfileIntA(appname, keyname, default_value, "default");
-}
-
-static int WINAPI expGetPrivateProfileStringA(const char* appname,
-                                             const char* keyname,
-                                             const char* def_val,
-                                             char* dest, unsigned int len,
-                                             const char* filename)
-{
-    int result;
-    int size;
-    char* fullname;
-    dbgprintf("GetPrivateProfileStringA('%s', '%s', def_val '%s', 0x%x, 0x%x, '%s')", appname, keyname, def_val, dest, len, filename );
-    if(!(appname && keyname && filename) ) return 0;
-    fullname=(char*)malloc(50+strlen(appname)+strlen(keyname)+strlen(filename));
-    strcpy(fullname, "Software\\IniFileMapping\\");
-    strcat(fullname, appname);
-    strcat(fullname, "\\");
-    strcat(fullname, keyname);
-    strcat(fullname, "\\");
-    strcat(fullname, filename);
-    size=len;
-    result=RegQueryValueExA(HKEY_LOCAL_MACHINE, fullname, NULL, NULL, (int*)dest, &size);
-    free(fullname);
-    if(result)
-    {
-       strncpy(dest, def_val, size);
-       if (strlen(def_val)< size) size = strlen(def_val);
-    }
-    dbgprintf(" => %d ( '%s' )\n", size, dest);
-    return size;
-}
-static int WINAPI expWritePrivateProfileStringA(const char* appname,
-                                               const char* keyname,
-                                               const char* string,
-                                               const char* filename)
-{
-    int size=256;
-    char* fullname;
-    dbgprintf("WritePrivateProfileStringA('%s', '%s', '%s', '%s')", appname, keyname, string, filename );
-    if(!(appname && keyname && filename) )
-    {
-       dbgprintf(" => -1\n");
-       return -1;
-    }
-    fullname=(char*)malloc(50+strlen(appname)+strlen(keyname)+strlen(filename));
-    strcpy(fullname, "Software\\IniFileMapping\\");
-    strcat(fullname, appname);
-    strcat(fullname, "\\");
-    strcat(fullname, keyname);
-    strcat(fullname, "\\");
-    strcat(fullname, filename);
-    RegSetValueExA(HKEY_LOCAL_MACHINE, fullname, 0, REG_SZ, (int*)string, strlen(string));
-    //    printf("RegSetValueExA(%s,%d)\n", string, strlen(string));
-    //    printf("WritePrivateProfileStringA(%s, %s, %s, %s)\n", appname, keyname, string, filename );
-    free(fullname);
-    dbgprintf(" => 0\n");
-    return 0;
-}
-
-unsigned int _GetPrivateProfileIntA(const char* appname, const char* keyname, INT default_value, const char* filename)
-{
-    return expGetPrivateProfileIntA(appname, keyname, default_value, filename);
-}
-int _GetPrivateProfileStringA(const char* appname, const char* keyname,
-                             const char* def_val, char* dest, unsigned int len, const char* filename)
-{
-    return expGetPrivateProfileStringA(appname, keyname, def_val, dest, len, filename);
-}
-int _WritePrivateProfileStringA(const char* appname, const char* keyname,
-                               const char* string, const char* filename)
-{
-    return expWritePrivateProfileStringA(appname, keyname, string, filename);
-}
-
-
-
-static int WINAPI expDefDriverProc(int _private, int id, int msg, int arg1, int arg2)
-{
-    dbgprintf("DefDriverProc(0x%x, 0x%x, 0x%x, 0x%x, 0x%x) => 0\n", _private, id, msg, arg1, arg2);
-    return 0;
-}
-
-static int WINAPI expSizeofResource(int v1, int v2)
-{
-    int result=SizeofResource(v1, v2);
-    dbgprintf("SizeofResource(0x%x, 0x%x) => %d\n", v1, v2, result);
-    return result;
-}
-
-static int WINAPI expGetLastError()
-{
-    int result=GetLastError();
-    dbgprintf("GetLastError() => 0x%x\n", result);
-    return result;
-}
-
-static void WINAPI expSetLastError(int error)
-{
-    dbgprintf("SetLastError(0x%x)\n", error);
-    SetLastError(error);
-}
-
-static int WINAPI expStringFromGUID2(GUID* guid, char* str, int cbMax)
-{
-    int result=snprintf(str, cbMax, "%.8x-%.4x-%.4x-%.2x%.2x%.2x%.2x%.2x%.2x%.2x%.2x",
-                       guid->f1, guid->f2, guid->f3,
-                       (unsigned char)guid->f4[0], (unsigned char)guid->f4[1],
-                       (unsigned char)guid->f4[2], (unsigned char)guid->f4[3],
-                       (unsigned char)guid->f4[4], (unsigned char)guid->f4[5],
-                       (unsigned char)guid->f4[6], (unsigned char)guid->f4[7]);
-    dbgprintf("StringFromGUID2(0x%x, 0x%x='%s', %d) => %d\n", guid, str, str, cbMax, result);
-    return result;
-}
-
-
-static int WINAPI expGetFileVersionInfoSizeA(const char* name, int* lpHandle)
-{
-    dbgprintf("GetFileVersionInfoSizeA(0x%x='%s', 0x%X) => 0\n", name, name, lpHandle);
-    return 0;
-}
-
-static int WINAPI expIsBadStringPtrW(const short* string, int nchars)
-{
-    int result;
-    if(string==0)result=1; else result=0;
-    dbgprintf("IsBadStringPtrW(0x%x, %d) => %d", string, nchars, result);
-    if(string)wch_print(string);
-    return result;
-}
-static int WINAPI expIsBadStringPtrA(const char* string, int nchars)
-{
-    return expIsBadStringPtrW((const short*)string, nchars);
-}
-static long WINAPI expInterlockedExchangeAdd( long* dest, long incr )
-{
-    long ret;
-    __asm__ __volatile__
-       (
-        "lock; xaddl %0,(%1)"
-        : "=r" (ret)
-        : "r" (dest), "0" (incr)
-        : "memory"
-       );
-    return ret;
-}
-
-static long WINAPI expInterlockedCompareExchange( unsigned long* dest, unsigned long exchange, unsigned long comperand)
-{
-    unsigned long retval = *dest;
-    if(*dest == comperand)
-       *dest = exchange;
-    return retval;
-}
-
-static long WINAPI expInterlockedIncrement( long* dest )
-{
-    long result=expInterlockedExchangeAdd( dest, 1 ) + 1;
-    dbgprintf("InterlockedIncrement(0x%x => %d) => %d\n", dest, *dest, result);
-    return result;
-}
-static long WINAPI expInterlockedDecrement( long* dest )
-{
-    long result=expInterlockedExchangeAdd( dest, -1 ) - 1;
-    dbgprintf("InterlockedDecrement(0x%x => %d) => %d\n", dest, *dest, result);
-    return result;
-}
-
-static void WINAPI expOutputDebugStringA( const char* string )
-{
-    dbgprintf("OutputDebugStringA(0x%x='%s')\n", string);
-    fprintf(stderr, "DEBUG: %s\n", string);
-}
-
-static int WINAPI expGetDC(int hwnd)
-{
-    dbgprintf("GetDC(0x%x) => 1\n", hwnd);
-    return 1;
-}
-
-static int WINAPI expReleaseDC(int hwnd, int hdc)
-{
-    dbgprintf("ReleaseDC(0x%x, 0x%x) => 1\n", hwnd, hdc);
-    return 1;
-}
-
-static int WINAPI expGetDesktopWindow()
-{
-    dbgprintf("GetDesktopWindow() => 0\n");
-    return 0;
-}
-
-static int cursor[100];
-
-static int WINAPI expLoadCursorA(int handle,LPCSTR name)
-{
-    dbgprintf("LoadCursorA(%d, 0x%x='%s') => 0x%x\n", handle, name, (int)&cursor[0]);
-    return (int)&cursor[0];
-}
-static int WINAPI expSetCursor(void *cursor)
-{
-    dbgprintf("SetCursor(0x%x) => 0x%x\n", cursor, cursor);
-    return (int)cursor;
-}
-static int WINAPI expGetCursorPos(void *cursor)
-{
-    dbgprintf("GetCursorPos(0x%x) => 0x%x\n", cursor, cursor);
-    return 1;
-}
-#ifdef QTX
-static int show_cursor = 0;
-static int WINAPI expShowCursor(int show)
-{
-    dbgprintf("ShowCursor(%d) => %d\n", show, show);
-    if (show)
-       show_cursor++;
-    else
-       show_cursor--;
-    return show_cursor;
-}
-#endif
-static int WINAPI expRegisterWindowMessageA(char *message)
-{
-    dbgprintf("RegisterWindowMessageA(%s)\n", message);
-    return 1;
-}
-static int WINAPI expGetProcessVersion(int pid)
-{
-    dbgprintf("GetProcessVersion(%d)\n", pid);
-    return 1;
-}
-static int WINAPI expGetCurrentThread(void)
-{
-#warning FIXME!
-    dbgprintf("GetCurrentThread() => %x\n", 0xcfcf9898);
-    return 0xcfcf9898;
-}
-static int WINAPI expGetOEMCP(void)
-{
-    dbgprintf("GetOEMCP()\n");
-    return 1;
-}
-static int WINAPI expGetCPInfo(int cp,void *info)
-{
-    dbgprintf("GetCPInfo()\n");
-    return 0;
-}
-#ifdef QTX
-#define SM_CXSCREEN            0
-#define SM_CYSCREEN            1
-#define SM_XVIRTUALSCREEN      76
-#define SM_YVIRTUALSCREEN      77
-#define SM_CXVIRTUALSCREEN     78
-#define SM_CYVIRTUALSCREEN     79
-#define SM_CMONITORS           80
-#endif
-static int WINAPI expGetSystemMetrics(int index)
-{
-    dbgprintf("GetSystemMetrics(%d)\n", index);
-#ifdef QTX
-    switch(index)
-    {
-       case SM_XVIRTUALSCREEN:
-       case SM_YVIRTUALSCREEN:
-           return 0;
-       case SM_CXSCREEN:
-       case SM_CXVIRTUALSCREEN:
-           return PSEUDO_SCREEN_WIDTH;
-       case SM_CYSCREEN:
-       case SM_CYVIRTUALSCREEN:
-           return PSEUDO_SCREEN_HEIGHT;
-       case SM_CMONITORS:
-           return 1;
-    }
-#endif
-    return 1;
-}
-static int WINAPI expGetSysColor(int index)
-{
-    dbgprintf("GetSysColor(%d) => 1\n", index);
-    return 1;
-}
-static int WINAPI expGetSysColorBrush(int index)
-{
-    dbgprintf("GetSysColorBrush(%d)\n", index);
-    return 1;
-}
-
-
-
-static int WINAPI expGetSystemPaletteEntries(int hdc, int iStartIndex, int nEntries, void* lppe)
-{
-    dbgprintf("GetSystemPaletteEntries(0x%x, 0x%x, 0x%x, 0x%x) => 0\n",
-             hdc, iStartIndex, nEntries, lppe);
-    return 0;
-}
-
-/*
- typedef struct _TIME_ZONE_INFORMATION {
- long Bias;
- char StandardName[32];
- SYSTEMTIME StandardDate;
- long StandardBias;
- char DaylightName[32];
- SYSTEMTIME DaylightDate;
- long DaylightBias;
- } TIME_ZONE_INFORMATION, *LPTIME_ZONE_INFORMATION;
- */
-
-static int WINAPI expGetTimeZoneInformation(LPTIME_ZONE_INFORMATION lpTimeZoneInformation)
-{
-    const short name[]={'C', 'e', 'n', 't', 'r', 'a', 'l', ' ', 'S', 't', 'a',
-    'n', 'd', 'a', 'r', 'd', ' ', 'T', 'i', 'm', 'e', 0};
-    const short pname[]={'C', 'e', 'n', 't', 'r', 'a', 'l', ' ', 'D', 'a', 'y',
-    'l', 'i', 'g', 'h', 't', ' ', 'T', 'i', 'm', 'e', 0};
-    dbgprintf("GetTimeZoneInformation(0x%x) => TIME_ZONE_ID_STANDARD\n");
-    memset(lpTimeZoneInformation, 0, sizeof(TIME_ZONE_INFORMATION));
-    lpTimeZoneInformation->Bias=360;//GMT-6
-    memcpy(lpTimeZoneInformation->StandardName, name, sizeof(name));
-    lpTimeZoneInformation->StandardDate.wMonth=10;
-    lpTimeZoneInformation->StandardDate.wDay=5;
-    lpTimeZoneInformation->StandardDate.wHour=2;
-    lpTimeZoneInformation->StandardBias=0;
-    memcpy(lpTimeZoneInformation->DaylightName, pname, sizeof(pname));
-    lpTimeZoneInformation->DaylightDate.wMonth=4;
-    lpTimeZoneInformation->DaylightDate.wDay=1;
-    lpTimeZoneInformation->DaylightDate.wHour=2;
-    lpTimeZoneInformation->DaylightBias=-60;
-    return TIME_ZONE_ID_STANDARD;
-}
-
-static void WINAPI expGetLocalTime(SYSTEMTIME* systime)
-{
-    time_t local_time;
-    struct tm *local_tm;
-    struct timeval tv;
-
-    dbgprintf("GetLocalTime(0x%x)\n");
-    gettimeofday(&tv, NULL);
-    local_time=tv.tv_sec;
-    local_tm=localtime(&local_time);
-
-    systime->wYear = local_tm->tm_year + 1900;
-    systime->wMonth = local_tm->tm_mon + 1;
-    systime->wDayOfWeek = local_tm->tm_wday;
-    systime->wDay = local_tm->tm_mday;
-    systime->wHour = local_tm->tm_hour;
-    systime->wMinute = local_tm->tm_min;
-    systime->wSecond = local_tm->tm_sec;
-    systime->wMilliseconds = (tv.tv_usec / 1000) % 1000;
-    dbgprintf("  Year: %d\n  Month: %d\n  Day of week: %d\n"
-             "  Day: %d\n  Hour: %d\n  Minute: %d\n  Second:  %d\n"
-             "  Milliseconds: %d\n",
-             systime->wYear, systime->wMonth, systime->wDayOfWeek, systime->wDay,
-             systime->wHour, systime->wMinute, systime->wSecond, systime->wMilliseconds);
-}
-
-static int WINAPI expGetSystemTime(SYSTEMTIME* systime)
-{
-    time_t local_time;
-    struct tm *local_tm;
-    struct timeval tv;
-
-    dbgprintf("GetSystemTime(0x%x)\n", systime);
-    gettimeofday(&tv, NULL);
-    local_time=tv.tv_sec;
-    local_tm=gmtime(&local_time);
-
-    systime->wYear = local_tm->tm_year + 1900;
-    systime->wMonth = local_tm->tm_mon + 1;
-    systime->wDayOfWeek = local_tm->tm_wday;
-    systime->wDay = local_tm->tm_mday;
-    systime->wHour = local_tm->tm_hour;
-    systime->wMinute = local_tm->tm_min;
-    systime->wSecond = local_tm->tm_sec;
-    systime->wMilliseconds = (tv.tv_usec / 1000) % 1000;
-    dbgprintf("  Year: %d\n  Month: %d\n  Day of week: %d\n"
-             "  Day: %d\n  Hour: %d\n  Minute: %d\n  Second:  %d\n"
-             "  Milliseconds: %d\n",
-             systime->wYear, systime->wMonth, systime->wDayOfWeek, systime->wDay,
-             systime->wHour, systime->wMinute, systime->wSecond, systime->wMilliseconds);
-    return 0;
-}
-
-#define SECS_1601_TO_1970  ((369 * 365 + 89) * 86400ULL)
-static void WINAPI expGetSystemTimeAsFileTime(FILETIME* systime)
-{
-    struct tm *local_tm;
-    struct timeval tv;
-    unsigned long long secs;
-
-    dbgprintf("GetSystemTime(0x%x)\n", systime);
-    gettimeofday(&tv, NULL);
-    secs = (tv.tv_sec + SECS_1601_TO_1970) * 10000000;
-    secs += tv.tv_usec * 10;
-    systime->dwLowDateTime = secs & 0xffffffff;
-    systime->dwHighDateTime = (secs >> 32);
-}
-
-static int WINAPI expGetEnvironmentVariableA(const char* name, char* field, int size)
-{
-    char *p;
-    //    printf("%s %x %x\n", name, field, size);
-    if(field)field[0]=0;
-    /*
-     p = getenv(name);
-     if (p) strncpy(field,p,size);
-     */
-    if (strcmp(name,"__MSVCRT_HEAP_SELECT")==0)
-       strcpy(field,"__GLOBAL_HEAP_SELECTED,1");
-    dbgprintf("GetEnvironmentVariableA(0x%x='%s', 0x%x, %d) => %d\n", name, name, field, size, strlen(field));
-    return strlen(field);
-}
-
-static int WINAPI expSetEnvironmentVariableA(const char *name, const char *value)
-{
-    dbgprintf("SetEnvironmentVariableA(%s, %s)\n", name, value);
-    return 0;
-}
-
-static void* WINAPI expCoTaskMemAlloc(ULONG cb)
-{
-    return my_mreq(cb, 0);
-}
-static void WINAPI expCoTaskMemFree(void* cb)
-{
-    my_release(cb);
-}
-
-
-
-
-void* CoTaskMemAlloc(unsigned long cb)
-{
-    return expCoTaskMemAlloc(cb);
-}
-void CoTaskMemFree(void* cb)
-{
-    expCoTaskMemFree(cb);
-}
-
-struct COM_OBJECT_INFO
-{
-    GUID clsid;
-    long (*GetClassObject) (GUID* clsid, const GUID* iid, void** ppv);
-};
-
-static struct COM_OBJECT_INFO* com_object_table=0;
-static int com_object_size=0;
-int RegisterComClass(const GUID* clsid, GETCLASSOBJECT gcs)
-{
-    if(!clsid || !gcs)
-       return -1;
-    com_object_table=realloc(com_object_table, sizeof(struct COM_OBJECT_INFO)*(++com_object_size));
-    com_object_table[com_object_size-1].clsid=*clsid;
-    com_object_table[com_object_size-1].GetClassObject=gcs;
-    return 0;
-}
-
-int UnregisterComClass(const GUID* clsid, GETCLASSOBJECT gcs)
-{
-    int found = 0;
-    int i = 0;
-    if(!clsid || !gcs)
-       return -1;
-
-    if (com_object_table == 0)
-       printf("Warning: UnregisterComClass() called without any registered class\n");
-    while (i < com_object_size)
-    {
-       if (found && i > 0)
-       {
-           memcpy(&com_object_table[i - 1].clsid,
-                  &com_object_table[i].clsid, sizeof(GUID));
-           com_object_table[i - 1].GetClassObject =
-               com_object_table[i].GetClassObject;
-       }
-       else if (memcmp(&com_object_table[i].clsid, clsid, sizeof(GUID)) == 0
-                && com_object_table[i].GetClassObject == gcs)
-       {
-           found++;
-       }
-       i++;
-    }
-    if (found)
-    {
-       if (--com_object_size == 0)
-       {
-           free(com_object_table);
-           com_object_table = 0;
-       }
-    }
-    return 0;
-}
-
-
-const GUID IID_IUnknown =
-{
-    0x00000000, 0x0000, 0x0000,
-    {0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46}
-};
-const GUID IID_IClassFactory =
-{
-    0x00000001, 0x0000, 0x0000,
-    {0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46}
-};
-
-static long WINAPI expCoCreateInstance(GUID* rclsid, struct IUnknown* pUnkOuter,
-                                      long dwClsContext, const GUID* riid, void** ppv)
-{
-    int i;
-    struct COM_OBJECT_INFO* ci=0;
-    for(i=0; i<com_object_size; i++)
-       if(!memcmp(rclsid, &com_object_table[i].clsid, sizeof(GUID)))
-           ci=&com_object_table[i];
-    if(!ci)return REGDB_E_CLASSNOTREG;
-    // in 'real' world we should mess with IClassFactory here
-    i=ci->GetClassObject(rclsid, riid, ppv);
-    return i;
-}
-
-long CoCreateInstance(GUID* rclsid, struct IUnknown* pUnkOuter,
-                     long dwClsContext, const GUID* riid, void** ppv)
-{
-    return expCoCreateInstance(rclsid, pUnkOuter, dwClsContext, riid, ppv);
-}
-
-static int WINAPI expIsRectEmpty(CONST RECT *lprc)
-{
-    int r = 0;
-    int w,h;
-//trapbug();
-    if (lprc)
-    {
-       w = lprc->right - lprc->left;
-       h = lprc->bottom - lprc->top;
-       if (w <= 0 || h <= 0)
-           r = 1;
-    }
-    else
-       r = 1;
-
-    dbgprintf("IsRectEmpty(%p) => %s\n", lprc, (r) ? "TRUE" : "FALSE");
-    //printf("Rect: left: %d, top: %d, right: %d, bottom: %d\n", lprc->left, lprc->top, lprc->right, lprc->bottom);
-//    return 0;        // wmv9?
-    return r; // TM20
-}
-
-static int _adjust_fdiv=0; //what's this? - used to adjust division
-
-
-
-
-static unsigned int WINAPI expGetTempPathA(unsigned int len, char* path)
-{
-    dbgprintf("GetTempPathA(%d, 0x%x)", len, path);
-    if(len<5)
-    {
-       dbgprintf(" => 0\n");
-       return 0;
-    }
-    strcpy(path, "/tmp");
-    dbgprintf(" => 5 ( '/tmp' )\n");
-    return 5;
-}
-/*
- FYI:
- typedef struct
- {
- DWORD     dwFileAttributes;
- FILETIME  ftCreationTime;
- FILETIME  ftLastAccessTime;
- FILETIME  ftLastWriteTime;
- DWORD     nFileSizeHigh;
- DWORD     nFileSizeLow;
- DWORD     dwReserved0;
- DWORD     dwReserved1;
- CHAR      cFileName[260];
- CHAR      cAlternateFileName[14];
- } WIN32_FIND_DATAA, *LPWIN32_FIND_DATAA;
- */
-
-static DIR* qtx_dir=NULL;
-
-static WIN_BOOL WINAPI expFindNextFileA(HANDLE h,LPWIN32_FIND_DATAA lpfd)
-{
-#ifdef QTX
-    dbgprintf("FindNextFileA(0x%x, 0x%x) => 0\n", h, lpfd);
-    if(h==FILE_HANDLE_quicktimeqtx){
-       struct dirent* d;
-       if(!qtx_dir) return 0;
-       while((d=readdir(qtx_dir))){
-           char* x=strrchr(d->d_name,'.');
-           if(!x) continue;
-           if(strcmp(x,".qtx")) continue;
-           strcpy(lpfd->cFileName,d->d_name);
-//         sprintf(lpfd->cAlternateFileName,"%-8s.qtx",d->d_name);
-           strcpy(lpfd->cAlternateFileName,"foobar.qtx");
-           printf("### FindNext: %s\n",lpfd->cFileName);
-           return 1;
-       }
-       closedir(qtx_dir); qtx_dir=NULL;
-       return 0;
-    }
-#endif
-    return 0;
-}
-
-static HANDLE WINAPI expFindFirstFileA(LPCSTR s, LPWIN32_FIND_DATAA lpfd)
-{
-    dbgprintf("FindFirstFileA(0x%x='%s', 0x%x) => 0\n", s, s, lpfd);
-//    printf("\n### FindFirstFileA('%s')...\n",s);
-#ifdef QTX
-    if(strstr(s, "quicktime\\*.QTX")){
-       dbgprintf("FindFirstFileA(0x%x='%s', 0x%x) => QTX\n", s, s, lpfd);
-       printf("\n### Searching for QuickTime plugins (*.qtx) at %s...\n",def_path);
-       qtx_dir=opendir(def_path);
-       if(!qtx_dir) return (HANDLE)-1;
-       memset(lpfd,0,sizeof(*lpfd));
-       if(expFindNextFileA(FILE_HANDLE_quicktimeqtx,lpfd))
-           return FILE_HANDLE_quicktimeqtx;
-       printf("loader: Couldn't find the QuickTime plugins (.qtx files) at %s\n",def_path);
-       return (HANDLE)-1;
-    }
-#if 0
-    if(strstr(s, "QuickTime.qts")){
-       dbgprintf("FindFirstFileA(0x%x='%s', 0x%x) => QTS\n", s, s, lpfd);
-//     if(!strcmp(s,"C:\\windows\\QuickTime.qts\\QuickTime.qts\\*.QTX"))
-//         return (HANDLE)-1;
-       strcpy(lpfd->cFileName, "QuickTime.qts");
-       strcpy(lpfd->cAlternateFileName, "QuickT~1.qts");
-       return FILE_HANDLE_quicktimeqts;
-    }
-#endif
-#endif
-    if(strstr(s, "*.vwp")){
-       // hack for VoxWare codec plugins:
-       strcpy(lpfd->cFileName, "msms001.vwp");
-       strcpy(lpfd->cAlternateFileName, "msms001.vwp");
-       return (HANDLE)0;
-    }
-    // return 'file not found'
-    return (HANDLE)-1;
-}
-
-static WIN_BOOL WINAPI expFindClose(HANDLE h)
-{
-    dbgprintf("FindClose(0x%x) => 0\n", h);
-#ifdef QTX
-//    if(h==FILE_HANDLE_quicktimeqtx && qtx_dir){
-//     closedir(qtx_dir);
-//     qtx_dir=NULL;
-//    }
-#endif
-    return 0;
-}
-static UINT WINAPI expSetErrorMode(UINT i)
-{
-    dbgprintf("SetErrorMode(%d) => 0\n", i);
-    return 0;
-}
-static UINT WINAPI expGetWindowsDirectoryA(LPSTR s,UINT c)
-{
-    char windir[]="c:\\windows";
-    int result;
-    strncpy(s, windir, c);
-    result=1+((c<strlen(windir))?c:strlen(windir));
-    dbgprintf("GetWindowsDirectoryA(0x%x, %d) => %d\n", s, c, result);
-    return result;
-}
-#ifdef QTX
-static UINT WINAPI expGetCurrentDirectoryA(UINT c, LPSTR s)
-{
-    char curdir[]="c:\\";
-    int result;
-    strncpy(s, curdir, c);
-    result=1+((c<strlen(curdir))?c:strlen(curdir));
-    dbgprintf("GetCurrentDirectoryA(0x%x, %d) => %d\n", s, c, result);
-    return result;
-}
-
-static int WINAPI expSetCurrentDirectoryA(const char *pathname)
-{
-    dbgprintf("SetCurrentDirectoryA(0x%x = %s) => 1\n", pathname, pathname);
-#if 0
-    if (strrchr(pathname, '\\'))
-       chdir(strcat(strrchr(pathname, '\\')+1, '/'));
-    else
-       chdir(pathname);
-#endif
-    return 1;
-}
-
-static int WINAPI expCreateDirectoryA(const char *pathname, void *sa)
-{
-    dbgprintf("CreateDirectory(0x%x = %s, 0x%x) => 1\n",
-       pathname, pathname, sa);
-#if 0
-    p = strrchr(pathname, '\\')+1;
-    strcpy(&buf[0], p); /* should be strncpy */
-    if (!strlen(p))
-    {
-       buf[0] = '.';
-       buf[1] = 0;
-    }
-#if 0    
-    if (strrchr(pathname, '\\'))
-       mkdir(strcat(strrchr(pathname, '\\')+1, '/'), 666);
-    else
-       mkdir(pathname, 666);
-#endif
-    mkdir(&buf);
-#endif
-    return 1;
-}
-#endif
-static WIN_BOOL  WINAPI expDeleteFileA(LPCSTR s)
-{
-    dbgprintf("DeleteFileA(0x%x='%s') => 0\n", s, s);
-    return 0;
-}
-static WIN_BOOL  WINAPI expFileTimeToLocalFileTime(const FILETIME* cpf, LPFILETIME pf)
-{
-    dbgprintf("FileTimeToLocalFileTime(0x%x, 0x%x) => 0\n", cpf, pf);
-    return 0;
-}
-
-static UINT WINAPI expGetTempFileNameA(LPCSTR cs1,LPCSTR cs2,UINT i,LPSTR ps)
-{
-    char mask[16]="/tmp/AP_XXXXXX";
-    int result;
-    dbgprintf("GetTempFileNameA(0x%x='%s', 0x%x='%s', %d, 0x%x)", cs1, cs1, cs2, cs2, i, ps);
-    if(i && i<10)
-    {
-       dbgprintf(" => -1\n");
-       return -1;
-    }
-    result=mkstemp(mask);
-    sprintf(ps, "AP%d", result);
-    dbgprintf(" => %d\n", strlen(ps));
-    return strlen(ps);
-}
-//
-// This func might need proper implementation if we want AngelPotion codec.
-// They try to open APmpeg4v1.apl with it.
-// DLL will close opened file with CloseHandle().
-//
-static HANDLE WINAPI expCreateFileA(LPCSTR cs1,DWORD i1,DWORD i2,
-                                   LPSECURITY_ATTRIBUTES p1, DWORD i3,DWORD i4,HANDLE i5)
-{
-    dbgprintf("CreateFileA(0x%x='%s', %d, %d, 0x%x, %d, %d, 0x%x)\n", cs1, cs1, i1,
-             i2, p1, i3, i4, i5);
-    if((!cs1) || (strlen(cs1)<2))return -1;
-
-#ifdef QTX
-    if(strstr(cs1, "QuickTime.qts"))
-    {
-       int result;
-       char* tmp=(char*)malloc(strlen(def_path)+50);
-       strcpy(tmp, def_path);
-       strcat(tmp, "/");
-       strcat(tmp, "QuickTime.qts");
-       result=open(tmp, O_RDONLY);
-       free(tmp);
-       return result;
-    }
-    if(strstr(cs1, ".qtx"))
-    {
-       int result;
-       char* tmp=(char*)malloc(strlen(def_path)+250);
-       char* x=strrchr(cs1,'\\');
-       sprintf(tmp,"%s/%s",def_path,x?(x+1):cs1);
-//     printf("### Open: %s -> %s\n",cs1,tmp);
-       result=open(tmp, O_RDONLY);
-       free(tmp);
-       return result;
-    }
-#endif
-
-    if(strncmp(cs1, "AP", 2) == 0)
-    {
-       int result;
-       char* tmp=(char*)malloc(strlen(def_path)+50);
-       strcpy(tmp, def_path);
-       strcat(tmp, "/");
-       strcat(tmp, "APmpg4v1.apl");
-       result=open(tmp, O_RDONLY);
-       free(tmp);
-       return result;
-    }
-    if (strstr(cs1, "vp3"))
-    {
-       int r;
-       int flg = 0;
-       char* tmp=(char*)malloc(20 + strlen(cs1));
-       strcpy(tmp, "/tmp/");
-       strcat(tmp, cs1);
-       r = 4;
-       while (tmp[r])
-       {
-           if (tmp[r] == ':' || tmp[r] == '\\')
-               tmp[r] = '_';
-           r++;
-       }
-       if (GENERIC_READ & i1)
-           flg |= O_RDONLY;
-       else if (GENERIC_WRITE & i1)
-       {
-           flg |= O_WRONLY;
-           printf("Warning: openning filename %s  %d (flags; 0x%x) for write\n", tmp, r, flg);
-       }
-       r=open(tmp, flg);
-       free(tmp);
-       return r;
-    }
-
-    // Needed by wnvplay1.dll
-    if (strstr(cs1, "WINNOV.bmp"))
-    {
-       int r;
-       r=open("/dev/null", 0);
-       return r;
-    }
-
-#if 0
-    /* we need this for some virtualdub filters */
-    {
-       int r;
-       int flg = 0;
-       if (GENERIC_READ & i1)
-           flg |= O_RDONLY;
-       else if (GENERIC_WRITE & i1)
-       {
-           flg |= O_WRONLY;
-           printf("Warning: openning filename %s  %d (flags; 0x%x) for write\n", cs1, r, flg);
-       }
-       r=open(cs1, flg);
-       return r;
-    }
-#endif
-
-    return atoi(cs1+2);
-}
-static UINT WINAPI expGetSystemDirectoryA(
-  char* lpBuffer,  // address of buffer for system directory
-  UINT uSize        // size of directory buffer
-){
-    dbgprintf("GetSystemDirectoryA(%p,%d)\n", lpBuffer,uSize);
-    if(!lpBuffer) strcpy(lpBuffer,".");
-    return 1;
-}
-/*
-static char sysdir[]=".";
-static LPCSTR WINAPI expGetSystemDirectoryA()
-{
-    dbgprintf("GetSystemDirectoryA() => 0x%x='%s'\n", sysdir, sysdir);
-    return sysdir;
-}
-*/
-static DWORD WINAPI expGetFullPathNameA
-(
-       LPCTSTR lpFileName,
-       DWORD nBufferLength,
-       LPTSTR lpBuffer,
-       LPTSTR lpFilePart
-){
-    if(!lpFileName) return 0;
-    dbgprintf("GetFullPathNameA('%s',%d,%p,%p)\n",lpFileName,nBufferLength,
-       lpBuffer, lpFilePart);
-#if 0
-#ifdef QTX
-    strcpy(lpFilePart, "Quick123.qts");
-#else
-    strcpy(lpFilePart, lpFileName);
-#endif
-#else
-    if (strrchr(lpFileName, '\\'))
-       lpFilePart = strrchr(lpFileName, '\\');
-    else
-       lpFilePart = (LPTSTR)lpFileName;
-#endif
-    strcpy(lpBuffer, lpFileName);
-//    strncpy(lpBuffer, lpFileName, rindex(lpFileName, '\\')-lpFileName);
-    return strlen(lpBuffer);
-}
-
-static DWORD WINAPI expGetShortPathNameA
-(
-        LPCSTR longpath,
-        LPSTR shortpath,
-        DWORD shortlen
-){
-    if(!longpath) return 0;
-    dbgprintf("GetShortPathNameA('%s',%p,%d)\n",longpath,shortpath,shortlen);
-    strcpy(shortpath,longpath);
-    return strlen(shortpath);
-}
-
-static WIN_BOOL WINAPI expReadFile(HANDLE h,LPVOID pv,DWORD size,LPDWORD rd,LPOVERLAPPED unused)
-{
-    int result;
-    dbgprintf("ReadFile(%d, 0x%x, %d -> 0x%x)\n", h, pv, size, rd);
-    result=read(h, pv, size);
-    if(rd)*rd=result;
-    if(!result)return 0;
-    return 1;
-}
-
-static WIN_BOOL WINAPI expWriteFile(HANDLE h,LPCVOID pv,DWORD size,LPDWORD wr,LPOVERLAPPED unused)
-{
-    int result;
-    dbgprintf("WriteFile(%d, 0x%x, %d -> 0x%x)\n", h, pv, size, wr);
-    if(h==1234)h=1;
-    result=write(h, pv, size);
-    if(wr)*wr=result;
-    if(!result)return 0;
-    return 1;
-}
-static DWORD  WINAPI expSetFilePointer(HANDLE h, LONG val, LPLONG ext, DWORD whence)
-{
-    int wh;
-    dbgprintf("SetFilePointer(%d, 0x%x, 0x%x = %d, %d)\n", h, val, ext, *ext, whence);
-    //why would DLL want temporary file with >2Gb size?
-    switch(whence)
-    {
-    case FILE_BEGIN:
-       wh=SEEK_SET;break;
-    case FILE_END:
-       wh=SEEK_END;break;
-    case FILE_CURRENT:
-       wh=SEEK_CUR;break;
-    default:
-       return -1;
-    }
-#ifdef QTX
-    if (val == 0 && ext != 0)
-       val = val&(*ext);
-#endif
-    return lseek(h, val, wh);
-}
-
-static HDRVR WINAPI expOpenDriverA(LPCSTR szDriverName, LPCSTR szSectionName,
-                                  LPARAM lParam2)
-{
-    dbgprintf("OpenDriverA(0x%x='%s', 0x%x='%s', 0x%x) => -1\n", szDriverName,  szDriverName, szSectionName, szSectionName, lParam2);
-    return -1;
-}
-static HDRVR WINAPI expOpenDriver(LPCSTR szDriverName, LPCSTR szSectionName,
-                                 LPARAM lParam2)
-{
-    dbgprintf("OpenDriver(0x%x='%s', 0x%x='%s', 0x%x) => -1\n", szDriverName, szDriverName, szSectionName, szSectionName, lParam2);
-    return -1;
-}
-
-
-static WIN_BOOL WINAPI expGetProcessAffinityMask(HANDLE hProcess,
-                                                LPDWORD lpProcessAffinityMask,
-                                                LPDWORD lpSystemAffinityMask)
-{
-    dbgprintf("GetProcessAffinityMask(0x%x, 0x%x, 0x%x) => 1\n",
-             hProcess, lpProcessAffinityMask, lpSystemAffinityMask);
-    if(lpProcessAffinityMask)*lpProcessAffinityMask=1;
-    if(lpSystemAffinityMask)*lpSystemAffinityMask=1;
-    return 1;
-}
-
-static int WINAPI expMulDiv(int nNumber, int nNumerator, int nDenominator)
-{
-    static const long long max_int=0x7FFFFFFFLL;
-    static const long long min_int=-0x80000000LL;
-    long long tmp=(long long)nNumber*(long long)nNumerator;
-    dbgprintf("expMulDiv %d * %d / %d\n", nNumber, nNumerator, nDenominator);
-    if(!nDenominator)return 1;
-    tmp/=nDenominator;
-    if(tmp<min_int) return 1;
-    if(tmp>max_int) return 1;
-    return (int)tmp;
-}
-
-static LONG WINAPI explstrcmpiA(const char* str1, const char* str2)
-{
-    LONG result=strcasecmp(str1, str2);
-    dbgprintf("strcmpi(0x%x='%s', 0x%x='%s') => %d\n", str1, str1, str2, str2, result);
-    return result;
-}
-
-static LONG WINAPI explstrlenA(const char* str1)
-{
-    LONG result=strlen(str1);
-    dbgprintf("strlen(0x%x='%.50s') => %d\n", str1, str1, result);
-    return result;
-}
-
-static LONG WINAPI explstrcpyA(char* str1, const char* str2)
-{
-    int result= (int) strcpy(str1, str2);
-    dbgprintf("strcpy(0x%.50x, 0x%.50x='%.50s') => %d\n", str1, str2, str2, result);
-    return result;
-}
-static LONG WINAPI explstrcpynA(char* str1, const char* str2,int len)
-{
-    int result;
-    if (strlen(str2)>len)
-       result = (int) strncpy(str1, str2,len);
-    else
-       result = (int) strcpy(str1,str2);
-    dbgprintf("strncpy(0x%x, 0x%x='%s' len %d strlen %d) => %x\n", str1, str2, str2,len, strlen(str2),result);
-    return result;
-}
-static LONG WINAPI explstrcatA(char* str1, const char* str2)
-{
-    int result= (int) strcat(str1, str2);
-    dbgprintf("strcat(0x%x, 0x%x='%s') => %d\n", str1, str2, str2, result);
-    return result;
-}
-
-
-static LONG WINAPI expInterlockedExchange(long *dest, long l)
-{
-    long retval = *dest;
-    *dest = l;
-    return retval;
-}
-
-static void WINAPI expInitCommonControls(void)
-{
-    dbgprintf("InitCommonControls called!\n");
-    return;
-}
-
-#ifdef QTX
-/* needed by QuickTime.qts */
-static HWND WINAPI expCreateUpDownControl (DWORD style, INT x, INT y, INT cx, INT cy,
-             HWND parent, INT id, HINSTANCE inst,
-              HWND buddy, INT maxVal, INT minVal, INT curVal)
-{
-    dbgprintf("CreateUpDownControl(...)\n");
-    return 0;
-}
-#endif
-
-/* alex: implement this call! needed for 3ivx */
-static HRESULT WINAPI expCoCreateFreeThreadedMarshaler(void *pUnkOuter, void **ppUnkInner)
-{
-    dbgprintf("CoCreateFreeThreadedMarshaler(%p, %p) called!\n",
-          pUnkOuter, ppUnkInner);
-//    return 0;
-    return ERROR_CALL_NOT_IMPLEMENTED;
-}
-
-
-static int WINAPI expDuplicateHandle(HANDLE hSourceProcessHandle,  // handle to source process
-                                    HANDLE hSourceHandle,         // handle to duplicate
-                                    HANDLE hTargetProcessHandle,  // handle to target process
-                                    HANDLE* lpTargetHandle,      // duplicate handle
-                                    DWORD dwDesiredAccess,        // requested access
-                                    int bInheritHandle,          // handle inheritance option
-                                    DWORD dwOptions               // optional actions
-                                   )
-{
-    dbgprintf("DuplicateHandle(%p, %p, %p, %p, 0x%x, %d, %d) called\n",
-             hSourceProcessHandle, hSourceHandle, hTargetProcessHandle,
-             lpTargetHandle, dwDesiredAccess, bInheritHandle, dwOptions);
-    *lpTargetHandle = hSourceHandle;
-    return 1;
-}
-
-// required by PIM1 codec (used by win98 PCTV Studio capture sw)
-static HRESULT WINAPI expCoInitialize(
-                                     LPVOID lpReserved /* [in] pointer to win32 malloc interface
-                                     (obsolete, should be NULL) */
-                                    )
-{
-    /*
-     * Just delegate to the newer method.
-     */
-    return 0; //CoInitializeEx(lpReserved, COINIT_APARTMENTTHREADED);
-}
-
-static DWORD WINAPI expSetThreadAffinityMask
-(
-        HANDLE hThread,
-        DWORD dwThreadAffinityMask
-){
-    return 0;
-};
-
-/*
- * no WINAPI functions - CDECL
- */
-static void* expmalloc(int size)
-{
-    //printf("malloc");
-    //    return malloc(size);
-    void* result=my_mreq(size,0);
-    dbgprintf("malloc(0x%x) => 0x%x\n", size,result);
-    if(result==0)
-       printf("WARNING: malloc() failed\n");
-    return result;
-}
-static void expfree(void* mem)
-{
-    //    return free(mem);
-    dbgprintf("free(%p)\n", mem);
-    my_release(mem);
-}
-/* needed by atrac3.acm */
-static void *expcalloc(int num, int size)
-{
-    void* result=my_mreq(num*size,1);
-    dbgprintf("calloc(%d,%d) => %p\n", num,size,result);
-    if(result==0)
-       printf("WARNING: calloc() failed\n");
-    return result;
-}
-static void* expnew(int size)
-{
-    //    printf("NEW:: Call from address %08x\n STACK DUMP:\n", *(-1+(int*)&size));
-    //    printf("%08x %08x %08x %08x\n",
-    //    size, *(1+(int*)&size),
-    //    *(2+(int*)&size),*(3+(int*)&size));
-    void* result;
-    assert(size >= 0);
-
-    result=my_mreq(size,0);
-    dbgprintf("new(%d) => %p\n", size, result);
-    if (result==0)
-       printf("WARNING: new() failed\n");
-    return result;
-
-}
-static int expdelete(void* memory)
-{
-    dbgprintf("delete(%p)\n", memory);
-    my_release(memory);
-    return 0;
-}
-
-/*
- * local definition - we need only the last two members at this point
- * otherwice we would have to introduce here GUIDs and some more types..
- */
-typedef struct __attribute__((__packed__))
-{
-    char hay[0x3C];
-    void*      pbUnknown;              //0x3C
-    unsigned long cbFormat;            //0x40
-    char*      pbFormat;               //0x44
-} MY_MEDIA_TYPE;
-static HRESULT WINAPI expMoCopyMediaType(MY_MEDIA_TYPE* dest, const MY_MEDIA_TYPE* src)
-{
-    if (!dest || !src)
-       return E_POINTER;
-    memcpy(dest, src, sizeof(MY_MEDIA_TYPE));
-    if (dest->cbFormat)
-    {
-       dest->pbFormat = (char*) my_mreq(dest->cbFormat, 0);
-       if (!dest->pbFormat)
-            return E_OUTOFMEMORY;
-       memcpy(dest->pbFormat, src->pbFormat, dest->cbFormat);
-    }
-    return S_OK;
-}
-static HRESULT WINAPI expMoInitMediaType(MY_MEDIA_TYPE* dest, DWORD cbFormat)
-{
-    if (!dest)
-        return E_POINTER;
-
-    dest->pbUnknown = NULL;
-    dest->cbFormat = cbFormat;
-    if (cbFormat)
-    {
-       dest->pbFormat = (char*) my_mreq(cbFormat, 0);
-       if (!dest->pbFormat)
-            return E_OUTOFMEMORY;
-    }
-    else 
-    {
-    dest->pbFormat=NULL;
-    }
-    return S_OK;
-}
-static HRESULT WINAPI expMoCreateMediaType(MY_MEDIA_TYPE** dest, DWORD cbFormat)
-{
-    if (!dest)
-       return E_POINTER;
-    *dest = my_mreq(sizeof(MY_MEDIA_TYPE), 0);
-    return expMoInitMediaType(*dest, cbFormat);
-}
-static HRESULT WINAPI expMoDuplicateMediaType(MY_MEDIA_TYPE** dest, const void* src)
-{
-    if (!dest)
-       return E_POINTER;
-    *dest = my_mreq(sizeof(MY_MEDIA_TYPE), 0);
-    return expMoCopyMediaType(*dest, src);
-}
-static HRESULT WINAPI expMoFreeMediaType(MY_MEDIA_TYPE* dest)
-{
-    if (!dest)
-       return E_POINTER;
-    if (dest->pbFormat)
-    {
-       my_release(dest->pbFormat);
-       dest->pbFormat = 0;
-        dest->cbFormat = 0;
-    }
-    return S_OK;
-}
-static HRESULT WINAPI expMoDeleteMediaType(MY_MEDIA_TYPE* dest)
-{
-    if (!dest)
-       return E_POINTER;
-    expMoFreeMediaType(dest);
-    my_release(dest);
-    return S_OK;
-}
-
-static int exp_snprintf( char *str, int size, const char *format, ... )
-{
-      int x;
-      va_list va;
-      va_start(va, format);
-      x=snprintf(str,size,format,va);
-      dbgprintf("_snprintf( 0x%x, %d, %s, ... ) => %d\n",str,size,format,x);
-      va_end(va);
-      return x;
-}
-
-#if 0
-static int exp_initterm(int v1, int v2)
-{
-    dbgprintf("_initterm(0x%x, 0x%x) => 0\n", v1, v2);
-    return 0;
-}
-#else
-/* merged from wine - 2002.04.21 */
-typedef void (*_INITTERMFUNC)();
-static int exp_initterm(_INITTERMFUNC *start, _INITTERMFUNC *end)
-{
-    dbgprintf("_initterm(0x%x, 0x%x) %p\n", start, end, *start);
-    while (start < end)
-    {
-       if (*start)
-       {
-           //printf("call _initfunc: from: %p %d\n", *start);
-           // ok this trick with push/pop is necessary as otherwice
-           // edi/esi registers are being trashed
-           void* p = *start;
-           __asm__ __volatile__
-               (
-                "pushl %%ebx           \n\t"
-                "pushl %%ecx           \n\t"
-                "pushl %%edx           \n\t"
-                "pushl %%edi           \n\t"
-                "pushl %%esi           \n\t"
-                "call  *%%eax          \n\t"
-                "popl  %%esi           \n\t"
-                "popl  %%edi           \n\t"
-                "popl  %%edx           \n\t"
-                "popl  %%ecx           \n\t"
-                "popl  %%ebx           \n\t"
-                :
-                : "a"(p)
-                : "memory"
-               );
-            //printf("done  %p  %d:%d\n", end);
-       }
-       start++;
-    }
-    return 0;
-}
-#endif
-
-static void* exp__dllonexit()
-{
-    // FIXME extract from WINE
-    return NULL;
-}
-
-static int expwsprintfA(char* string, const char* format, ...)
-{
-    va_list va;
-    int result;
-    va_start(va, format);
-    result = vsprintf(string, format, va);
-    dbgprintf("wsprintfA(0x%x, '%s', ...) => %d\n", string, format, result);
-    va_end(va);
-    return result;
-}
-
-static int expsprintf(char* str, const char* format, ...)
-{
-    va_list args;
-    int r;
-    dbgprintf("sprintf(0x%x, %s)\n", str, format);
-    va_start(args, format);
-    r = vsprintf(str, format, args);
-    va_end(args);
-    return r;
-}
-static int expsscanf(const char* str, const char* format, ...)
-{
-    va_list args;
-    int r;
-    dbgprintf("sscanf(%s, %s)\n", str, format);
-    va_start(args, format);
-    r = vsscanf(str, format, args);
-    va_end(args);
-    return r;
-}
-static void* expfopen(const char* path, const char* mode)
-{
-    printf("fopen: \"%s\"  mode:%s\n", path, mode);
-    //return fopen(path, mode);
-    return fdopen(0, mode); // everything on screen
-}
-static int expfprintf(void* stream, const char* format, ...)
-{
-    va_list args;
-    int r = 0;
-    dbgprintf("fprintf(%p, %s, ...)\n", stream, format);
-#if 1
-    va_start(args, format);
-    r = vfprintf((FILE*) stream, format, args);
-    va_end(args);
-#endif
-    return r;
-}
-
-static int expprintf(const char* format, ...)
-{
-    va_list args;
-    int r;
-    dbgprintf("printf(%s, ...)\n", format);
-    va_start(args, format);
-    r = vprintf(format, args);
-    va_end(args);
-    return r;
-}
-
-static char* expgetenv(const char* varname)
-{
-    char* v = getenv(varname);
-    dbgprintf("getenv(%s) => %s\n", varname, v);
-    return v;
-}
-
-static void* expwcscpy(WCHAR* dst, const WCHAR* src)
-{
-    WCHAR* p = dst;
-    while ((*p++ = *src++))
-       ;
-    return dst;
-}
-
-static char* expstrrchr(char* string, int value)
-{
-    char* result=strrchr(string, value);
-    if(result)
-       dbgprintf("strrchr(0x%x='%s', %d) => 0x%x='%s'", string, string, value, result, result);
-    else
-       dbgprintf("strrchr(0x%x='%s', %d) => 0", string, string, value);
-    return result;
-}
-
-static char* expstrchr(char* string, int value)
-{
-    char* result=strchr(string, value);
-    if(result)
-       dbgprintf("strchr(0x%x='%s', %d) => 0x%x='%s'", string, string, value, result, result);
-    else
-       dbgprintf("strchr(0x%x='%s', %d) => 0", string, string, value);
-    return result;
-}
-static int expstrlen(char* str)
-{
-    int result=strlen(str);
-    dbgprintf("strlen(0x%x='%s') => %d\n", str, str, result);
-    return result;
-}
-static char* expstrcpy(char* str1, const char* str2)
-{
-    char* result= strcpy(str1, str2);
-    dbgprintf("strcpy(0x%x, 0x%x='%s') => %p\n", str1, str2, str2, result);
-    return result;
-}
-static char* expstrncpy(char* str1, const char* str2, size_t count)
-{
-    char* result= strncpy(str1, str2, count);
-    dbgprintf("strncpy(0x%x, 0x%x='%s', %d) => %p\n", str1, str2, str2, count, result);
-    return result;
-}
-static int expstrcmp(const char* str1, const char* str2)
-{
-    int result=strcmp(str1, str2);
-    dbgprintf("strcmp(0x%x='%s', 0x%x='%s') => %d\n", str1, str1, str2, str2, result);
-    return result;
-}
-static int expstrncmp(const char* str1, const char* str2,int x)
-{
-    int result=strncmp(str1, str2,x);
-    dbgprintf("strcmp(0x%x='%s', 0x%x='%s') => %d\n", str1, str1, str2, str2, result);
-    return result;
-}
-static char* expstrcat(char* str1, const char* str2)
-{
-    char* result = strcat(str1, str2);
-    dbgprintf("strcat(0x%x='%s', 0x%x='%s') => %p\n", str1, str1, str2, str2, result);
-    return result;
-}
-static char* exp_strdup(const char* str1)
-{
-    int l = strlen(str1);
-    char* result = (char*) my_mreq(l + 1,0);
-    if (result)
-       strcpy(result, str1);
-    dbgprintf("_strdup(0x%x='%s') => %p\n", str1, str1, result);
-    return result;
-}
-static int expisalnum(int c)
-{
-    int result= (int) isalnum(c);
-    dbgprintf("isalnum(0x%x='%c' => %d\n", c, c, result);
-    return result;
-}
-static int expisspace(int c)
-{
-    int result= (int) isspace(c);
-    dbgprintf("isspace(0x%x='%c' => %d\n", c, c, result);
-    return result;
-}
-static int expisalpha(int c)
-{
-    int result= (int) isalpha(c);
-    dbgprintf("isalpha(0x%x='%c' => %d\n", c, c, result);
-    return result;
-}
-static int expisdigit(int c)
-{
-    int result= (int) isdigit(c);
-    dbgprintf("isdigit(0x%x='%c' => %d\n", c, c, result);
-    return result;
-}
-static void* expmemmove(void* dest, void* src, int n)
-{
-    void* result = memmove(dest, src, n);
-    dbgprintf("memmove(0x%x, 0x%x, %d) => %p\n", dest, src, n, result);
-    return result;
-}
-static int expmemcmp(void* dest, void* src, int n)
-{
-    int result = memcmp(dest, src, n);
-    dbgprintf("memcmp(0x%x, 0x%x, %d) => %d\n", dest, src, n, result);
-    return result;
-}
-static void* expmemcpy(void* dest, void* src, int n)
-{
-    void *result = memcpy(dest, src, n);
-    dbgprintf("memcpy(0x%x, 0x%x, %d) => %p\n", dest, src, n, result);
-    return result;
-}
-static void* expmemset(void* dest, int c, size_t n)
-{
-    void *result = memset(dest, c, n);
-    dbgprintf("memset(0x%x, %d, %d) => %p\n", dest, c, n, result);
-    return result;
-}
-static time_t exptime(time_t* t)
-{
-    time_t result = time(t);
-    dbgprintf("time(0x%x) => %d\n", t, result);
-    return result;
-}
-
-static int exprand(void)
-{
-    return rand();
-}
-
-static void expsrand(int seed)
-{
-    srand(seed);
-}
-
-#if 1
-
-// preferred compilation with  -O2 -ffast-math !
-
-static double explog10(double x)
-{
-    /*printf("Log10 %f => %f    0x%Lx\n", x, log10(x), *((int64_t*)&x));*/
-    return log10(x);
-}
-
-static double expcos(double x)
-{
-    /*printf("Cos %f => %f  0x%Lx\n", x, cos(x), *((int64_t*)&x));*/
-    return cos(x);
-}
-
-/* doens't work */
-static long exp_ftol_wrong(double x)
-{
-    return (long) x;
-}
-
-#else
-
-static void explog10(void)
-{
-    __asm__ __volatile__
-       (
-        "fldl 8(%esp)  \n\t"
-        "fldln2        \n\t"
-        "fxch %st(1)   \n\t"
-        "fyl2x         \n\t"
-       );
-}
-
-static void expcos(void)
-{
-    __asm__ __volatile__
-       (
-        "fldl 8(%esp)  \n\t"
-        "fcos          \n\t"
-       );
-}
-
-#endif
-
-// this seem to be the only how to make this function working properly
-// ok - I've spent tremendous amount of time (many many many hours
-// of debuging fixing & testing - it's almost unimaginable - kabi
-
-// _ftol - operated on the float value which is already on the FPU stack
-
-static void exp_ftol(void)
-{
-    __asm__ __volatile__
-       (
-        "sub $12, %esp         \n\t"
-        "fstcw   -2(%ebp)      \n\t"
-        "wait                  \n\t"
-        "movw    -2(%ebp), %ax \n\t"
-        "orb    $0x0C, %ah     \n\t"
-        "movw    %ax, -4(%ebp) \n\t"
-        "fldcw   -4(%ebp)      \n\t"
-        "fistpl -12(%ebp)      \n\t"
-        "fldcw   -2(%ebp)      \n\t"
-        "movl   -12(%ebp), %eax \n\t"
-        //Note: gcc 3.03 does not do the following op if it
-        //      knows that ebp=esp
-        "movl %ebp, %esp       \n\t"
-       );
-}
-
-#define FPU_DOUBLES(var1,var2) double var1,var2; \
-  __asm__ __volatile__( "fstpl %0;fwait" : "=m" (var2) : ); \
-  __asm__ __volatile__( "fstpl %0;fwait" : "=m" (var1) : )
-
-static double exp_CIpow(void)
-{
-    FPU_DOUBLES(x,y);
-
-    dbgprintf("_CIpow(%lf, %lf)\n", x, y);
-    return pow(x, y);
-}
-
-static double exppow(double x, double y)
-{
-    /*printf("Pow %f  %f    0x%Lx  0x%Lx  => %f\n", x, y, *((int64_t*)&x), *((int64_t*)&y), pow(x, y));*/
-    return pow(x, y);
-}
-
-static double expldexp(double x, int expo)
-{
-    /*printf("Cos %f => %f  0x%Lx\n", x, cos(x), *((int64_t*)&x));*/
-    return ldexp(x, expo);
-}
-
-static double expfrexp(double x, int* expo)
-{
-    /*printf("Cos %f => %f  0x%Lx\n", x, cos(x), *((int64_t*)&x));*/
-    return frexp(x, expo);
-}
-
-
-
-static int exp_stricmp(const char* s1, const char* s2)
-{
-    return strcasecmp(s1, s2);
-}
-
-/* from declaration taken from Wine sources - this fountion seems to be
- * undocumented in any M$ doc */
-static int exp_setjmp3(void* jmpbuf, int x)
-{
-    //dbgprintf("!!!!UNIMPLEMENTED: setjmp3(%p, %d) => 0\n", jmpbuf, x);
-    //return 0;
-    __asm__ __volatile__
-       (
-        //"mov 4(%%esp), %%edx \n\t"
-        "mov (%%esp), %%eax   \n\t"
-        "mov %%eax, (%%edx)    \n\t" // store ebp
-
-        //"mov %%ebp, (%%edx)  \n\t"
-        "mov %%ebx, 4(%%edx)   \n\t"
-        "mov %%edi, 8(%%edx)   \n\t"
-        "mov %%esi, 12(%%edx)  \n\t"
-        "mov %%esp, 16(%%edx)  \n\t"
-
-        "mov 4(%%esp), %%eax   \n\t"
-        "mov %%eax, 20(%%edx)  \n\t"
-
-        "movl $0x56433230, 32(%%edx)   \n\t" // VC20 ??
-        "movl $0, 36(%%edx)    \n\t"
-        : // output
-        : "d"(jmpbuf) // input
-        : "eax"
-       );
-#if 1
-    __asm__ __volatile__
-       (
-        "mov %%fs:0, %%eax     \n\t" // unsure
-        "mov %%eax, 24(%%edx)  \n\t"
-        "cmp $0xffffffff, %%eax \n\t"
-        "jnz l1                \n\t"
-        "mov %%eax, 28(%%edx)  \n\t"
-        "l1:                   \n\t"
-        :
-        :
-        : "eax"
-       );
-#endif
-
-       return 0;
-}
-
-static DWORD WINAPI expGetCurrentProcessId(void)
-{
-    dbgprintf("GetCurrentProcessId(void) => %d\n", getpid());
-    return getpid(); //(DWORD)NtCurrentTeb()->pid;
-}
-
-
-typedef struct {
-    UINT       wPeriodMin;
-    UINT       wPeriodMax;
-} TIMECAPS, *LPTIMECAPS;
-
-static MMRESULT WINAPI exptimeGetDevCaps(LPTIMECAPS lpCaps, UINT wSize)
-{
-    dbgprintf("timeGetDevCaps(%p, %u) !\n", lpCaps, wSize);
-
-    lpCaps->wPeriodMin = 1;
-    lpCaps->wPeriodMax = 65535;
-    return 0;
-}
-
-static MMRESULT WINAPI exptimeBeginPeriod(UINT wPeriod)
-{
-    dbgprintf("timeBeginPeriod(%u) !\n", wPeriod);
-
-    if (wPeriod < 1 || wPeriod > 65535) return 96+1; //TIMERR_NOCANDO;
-    return 0;
-}
-
-#ifdef QTX
-static MMRESULT WINAPI exptimeEndPeriod(UINT wPeriod)
-{
-    dbgprintf("timeEndPeriod(%u) !\n", wPeriod);
-
-    if (wPeriod < 1 || wPeriod > 65535) return 96+1; //TIMERR_NOCANDO;
-    return 0;
-}
-#endif
-
-static void WINAPI expGlobalMemoryStatus(
-            LPMEMORYSTATUS lpmem
-) {
-    static MEMORYSTATUS        cached_memstatus;
-    static int cache_lastchecked = 0;
-    SYSTEM_INFO si;
-    FILE *f;
-
-    if (time(NULL)==cache_lastchecked) {
-       memcpy(lpmem,&cached_memstatus,sizeof(MEMORYSTATUS));
-       return;
-    }
-
-#if 1
-    f = fopen( "/proc/meminfo", "r" );
-    if (f)
-    {
-        char buffer[256];
-        int total, used, free, shared, buffers, cached;
-
-        lpmem->dwLength = sizeof(MEMORYSTATUS);
-        lpmem->dwTotalPhys = lpmem->dwAvailPhys = 0;
-        lpmem->dwTotalPageFile = lpmem->dwAvailPageFile = 0;
-        while (fgets( buffer, sizeof(buffer), f ))
-        {
-           /* old style /proc/meminfo ... */
-            if (sscanf( buffer, "Mem: %d %d %d %d %d %d", &total, &used, &free, &shared, &buffers, &cached ))
-            {
-                lpmem->dwTotalPhys += total;
-                lpmem->dwAvailPhys += free + buffers + cached;
-            }
-            if (sscanf( buffer, "Swap: %d %d %d", &total, &used, &free ))
-            {
-                lpmem->dwTotalPageFile += total;
-                lpmem->dwAvailPageFile += free;
-            }
-
-           /* new style /proc/meminfo ... */
-           if (sscanf(buffer, "MemTotal: %d", &total))
-               lpmem->dwTotalPhys = total*1024;
-           if (sscanf(buffer, "MemFree: %d", &free))
-               lpmem->dwAvailPhys = free*1024;
-           if (sscanf(buffer, "SwapTotal: %d", &total))
-               lpmem->dwTotalPageFile = total*1024;
-           if (sscanf(buffer, "SwapFree: %d", &free))
-               lpmem->dwAvailPageFile = free*1024;
-           if (sscanf(buffer, "Buffers: %d", &buffers))
-               lpmem->dwAvailPhys += buffers*1024;
-           if (sscanf(buffer, "Cached: %d", &cached))
-               lpmem->dwAvailPhys += cached*1024;
-        }
-        fclose( f );
-
-        if (lpmem->dwTotalPhys)
-        {
-            DWORD TotalPhysical = lpmem->dwTotalPhys+lpmem->dwTotalPageFile;
-            DWORD AvailPhysical = lpmem->dwAvailPhys+lpmem->dwAvailPageFile;
-            lpmem->dwMemoryLoad = (TotalPhysical-AvailPhysical)
-                                      / (TotalPhysical / 100);
-        }
-    } else
-#endif
-    {
-       /* FIXME: should do something for other systems */
-       lpmem->dwMemoryLoad    = 0;
-       lpmem->dwTotalPhys     = 16*1024*1024;
-       lpmem->dwAvailPhys     = 16*1024*1024;
-       lpmem->dwTotalPageFile = 16*1024*1024;
-       lpmem->dwAvailPageFile = 16*1024*1024;
-    }
-    expGetSystemInfo(&si);
-    lpmem->dwTotalVirtual  = si.lpMaximumApplicationAddress-si.lpMinimumApplicationAddress;
-    /* FIXME: we should track down all the already allocated VM pages and substract them, for now arbitrarily remove 64KB so that it matches NT */
-    lpmem->dwAvailVirtual  = lpmem->dwTotalVirtual-64*1024;
-    memcpy(&cached_memstatus,lpmem,sizeof(MEMORYSTATUS));
-    cache_lastchecked = time(NULL);
-
-    /* it appears some memory display programs want to divide by these values */
-    if(lpmem->dwTotalPageFile==0)
-        lpmem->dwTotalPageFile++;
-
-    if(lpmem->dwAvailPageFile==0)
-        lpmem->dwAvailPageFile++;
-}
-
-/**********************************************************************
- * SetThreadPriority [KERNEL32.@]  Sets priority for thread.
- *
- * RETURNS
- *    Success: TRUE
- *    Failure: FALSE
- */
-static WIN_BOOL WINAPI expSetThreadPriority(
-    HANDLE hthread, /* [in] Handle to thread */
-    INT priority)   /* [in] Thread priority level */
-{
-    dbgprintf("SetThreadPriority(%p,%d)\n",hthread,priority);
-    return TRUE;
-}
-
-static void WINAPI expExitProcess( DWORD status )
-{
-    printf("EXIT - code %ld\n",status);
-    exit(status);
-}
-
-static INT WINAPI expMessageBoxA(HWND hWnd, LPCSTR text, LPCSTR title, UINT type){
-    printf("MSGBOX '%s' '%s' (%d)\n",text,title,type);
-#ifdef QTX
-    if (type == MB_ICONHAND && !strlen(text) && !strlen(title))
-       return IDIGNORE;
-#endif
-    return IDOK;
-}
-
-/* these are needed for mss1 */
-
-/* defined in stubs.s */
-void exp_EH_prolog(void);
-
-#include <netinet/in.h>
-static WINAPI inline unsigned long int exphtonl(unsigned long int hostlong)
-{
-//    dbgprintf("htonl(%x) => %x\n", hostlong, htonl(hostlong));
-    return htonl(hostlong);
-}
-
-static WINAPI inline unsigned long int expntohl(unsigned long int netlong)
-{
-//    dbgprintf("ntohl(%x) => %x\n", netlong, ntohl(netlong));
-    return ntohl(netlong);
-}
-static void WINAPI expVariantInit(void* p)
-{
-    printf("InitCommonControls called!\n");
-    return;
-}
-
-static int WINAPI expRegisterClassA(const void/*WNDCLASSA*/ *wc)
-{
-    dbgprintf("RegisterClassA(%p) => random id\n", wc);
-    return time(NULL); /* be precise ! */
-}
-
-static int WINAPI expUnregisterClassA(const char *className, HINSTANCE hInstance)
-{
-    dbgprintf("UnregisterClassA(%s, %p) => 0\n", className, hInstance);
-    return 0;
-}
-
-#ifdef QTX
-/* should be fixed bcs it's not fully strlen equivalent */
-static int expSysStringByteLen(void *str)
-{
-    dbgprintf("SysStringByteLen(%p) => %d\n", str, strlen(str));
-    return strlen(str);
-}
-
-static int expDirectDrawCreate(void)
-{
-    dbgprintf("DirectDrawCreate(...) => NULL\n");
-    return 0;
-}
-
-#if 1
-typedef struct tagPALETTEENTRY { 
-    BYTE peRed; 
-    BYTE peGreen; 
-    BYTE peBlue; 
-    BYTE peFlags; 
-} PALETTEENTRY; 
-
-/* reversed the first 2 entries */
-typedef struct tagLOGPALETTE { 
-    WORD         palNumEntries; 
-    WORD         palVersion; 
-    PALETTEENTRY palPalEntry[1]; 
-} LOGPALETTE; 
-
-static HPALETTE WINAPI expCreatePalette(CONST LOGPALETTE *lpgpl)
-{
-    HPALETTE test;
-    int i;
-    
-    dbgprintf("CreatePalette(%x) => NULL\n", lpgpl);
-
-    i = sizeof(LOGPALETTE)+((lpgpl->palNumEntries-1)*sizeof(PALETTEENTRY));
-    test = (HPALETTE)malloc(i);
-    memcpy((void *)test, lpgpl, i);
-
-    return test;
-}
-#else
-static int expCreatePalette(void)
-{
-    dbgprintf("CreatePalette(...) => NULL\n");
-    return NULL;
-}
-#endif
-
-static int WINAPI expGetClientRect(HWND win, RECT *r)
-{
-    dbgprintf("GetClientRect(0x%x, 0x%x) => 1\n", win, r);
-    r->right = PSEUDO_SCREEN_WIDTH;
-    r->left = 0;
-    r->bottom = PSEUDO_SCREEN_HEIGHT;
-    r->top = 0;
-    return 1;
-}
-
-#if 0
-typedef struct tagPOINT { 
-    LONG x; 
-    LONG y; 
-} POINT, *PPOINT; 
-#endif
-
-static int WINAPI expClientToScreen(HWND win, POINT *p)
-{
-    dbgprintf("ClientToScreen(0x%x, 0x%x = %d,%d) => 1\n", win, p, p->x, p->y);
-    p->x = 0;
-    p->y = 0;
-    return 1;
-}
-#endif
-
-/* for m3jpeg */
-static int WINAPI expSetThreadIdealProcessor(HANDLE thread, int proc)
-{
-    dbgprintf("SetThreadIdealProcessor(0x%x, %x) => 0\n", thread, proc);
-    return 0;
-}
-
-static int WINAPI expMessageBeep(int type)
-{
-    dbgprintf("MessageBeep(%d) => 1\n", type);
-    return 1;
-}
-
-static int WINAPI expDialogBoxParamA(void *inst, const char *name,
-    HWND parent, void *dialog_func, void *init_param)
-{
-    dbgprintf("DialogBoxParamA(0x%x, 0x%x = %s, 0x%x, 0x%x, 0x%x) => 0x42424242\n",
-       inst, name, name, parent, dialog_func, init_param);
-    return 0x42424242;
-}
-
-/* needed by imagepower mjpeg2k */
-static void *exprealloc(void *ptr, size_t size)
-{
-    dbgprintf("realloc(0x%x, %x)\n", ptr, size);
-    if (!ptr)
-       return my_mreq(size,0);
-    else
-       return my_realloc(ptr, size);        
-}
-
-/* Fake GetOpenFileNameA from comdlg32.dll for ViVD codec */
-static WIN_BOOL WINAPI expGetOpenFileNameA(/*LPOPENFILENAMEA*/ void* lpfn)
-{
-    return 1;
-}
-
-static double expfloor(double x)
-{
-    dbgprintf("floor(%lf)\n", x);
-    return floor(x);
-}
-
-#define FPU_DOUBLE(var) double var; \
-  __asm__ __volatile__( "fstpl %0;fwait" : "=m" (var) : )
-
-static double exp_CIcos(void)
-{
-    FPU_DOUBLE(x);
-
-    dbgprintf("_CIcos(%lf)\n", x);
-    return cos(x);
-}
-
-static double exp_CIsin(void)
-{
-    FPU_DOUBLE(x);
-
-    dbgprintf("_CIsin(%lf)\n", x);
-    return sin(x);
-}
-
-struct exports
-{
-    char name[64];
-    int id;
-    void* func;
-};
-struct libs
-{
-    char name[64];
-    int length;
-    struct exports* exps;
-};
-
-#define FF(X,Y) \
-    {#X, Y, (void*)exp##X},
-
-struct exports exp_kernel32[]=
-{
-    FF(GetVolumeInformationA,-1)
-    FF(GetDriveTypeA,-1)
-    FF(GetLogicalDriveStringsA,-1)
-    FF(IsBadWritePtr, 357)
-    FF(IsBadReadPtr, 354)
-    FF(IsBadStringPtrW, -1)
-    FF(IsBadStringPtrA, -1)
-    FF(DisableThreadLibraryCalls, -1)
-    FF(CreateThread, -1)
-    FF(CreateEventA, -1)
-    FF(SetEvent, -1)
-    FF(ResetEvent, -1)
-    FF(WaitForSingleObject, -1)
-#ifdef QTX
-    FF(WaitForMultipleObjects, -1)
-    FF(ExitThread, -1)
-    FF(CreateMutexA,-1)
-    FF(ReleaseMutex,-1)
-#endif
-    FF(GetSystemInfo, -1)
-    FF(GetVersion, 332)
-    FF(HeapCreate, 461)
-    FF(HeapAlloc, -1)
-    FF(HeapDestroy, -1)
-    FF(HeapFree, -1)
-    FF(HeapSize, -1)
-    FF(HeapReAlloc,-1)
-    FF(GetProcessHeap, -1)
-    FF(VirtualAlloc, -1)
-    FF(VirtualFree, -1)
-    FF(InitializeCriticalSection, -1)
-    FF(EnterCriticalSection, -1)
-    FF(LeaveCriticalSection, -1)
-    FF(DeleteCriticalSection, -1)
-    FF(TlsAlloc, -1)
-    FF(TlsFree, -1)
-    FF(TlsGetValue, -1)
-    FF(TlsSetValue, -1)
-    FF(GetCurrentThreadId, -1)
-    FF(GetCurrentProcess, -1)
-    FF(LocalAlloc, -1)
-    FF(LocalReAlloc,-1)
-    FF(LocalLock, -1)
-    FF(GlobalAlloc, -1)
-    FF(GlobalReAlloc, -1)
-    FF(GlobalLock, -1)
-    FF(GlobalSize, -1)
-    FF(MultiByteToWideChar, 427)
-    FF(WideCharToMultiByte, -1)
-    FF(GetVersionExA, -1)
-    FF(CreateSemaphoreA, -1)
-    FF(QueryPerformanceCounter, -1)
-    FF(QueryPerformanceFrequency, -1)
-    FF(LocalHandle, -1)
-    FF(LocalUnlock, -1)
-    FF(LocalFree, -1)
-    FF(GlobalHandle, -1)
-    FF(GlobalUnlock, -1)
-    FF(GlobalFree, -1)
-    FF(LoadResource, -1)
-    FF(ReleaseSemaphore, -1)
-    FF(FindResourceA, -1)
-    FF(LockResource, -1)
-    FF(FreeResource, -1)
-    FF(SizeofResource, -1)
-    FF(CloseHandle, -1)
-    FF(GetCommandLineA, -1)
-    FF(GetEnvironmentStringsW, -1)
-    FF(FreeEnvironmentStringsW, -1)
-    FF(FreeEnvironmentStringsA, -1)
-    FF(GetEnvironmentStrings, -1)
-    FF(GetStartupInfoA, -1)
-    FF(GetStdHandle, -1)
-    FF(GetFileType, -1)
-#ifdef QTX
-    FF(GetFileAttributesA, -1)
-#endif
-    FF(SetHandleCount, -1)
-    FF(GetACP, -1)
-    FF(GetModuleFileNameA, -1)
-    FF(SetUnhandledExceptionFilter, -1)
-    FF(LoadLibraryA, -1)
-    FF(GetProcAddress, -1)
-    FF(FreeLibrary, -1)
-    FF(CreateFileMappingA, -1)
-    FF(OpenFileMappingA, -1)
-    FF(MapViewOfFile, -1)
-    FF(UnmapViewOfFile, -1)
-    FF(Sleep, -1)
-    FF(GetModuleHandleA, -1)
-    FF(GetProfileIntA, -1)
-    FF(GetPrivateProfileIntA, -1)
-    FF(GetPrivateProfileStringA, -1)
-    FF(WritePrivateProfileStringA, -1)
-    FF(GetLastError, -1)
-    FF(SetLastError, -1)
-    FF(InterlockedIncrement, -1)
-    FF(InterlockedDecrement, -1)
-    FF(GetTimeZoneInformation, -1)
-    FF(OutputDebugStringA, -1)
-    FF(GetLocalTime, -1)
-    FF(GetSystemTime, -1)
-    FF(GetSystemTimeAsFileTime, -1)
-    FF(GetEnvironmentVariableA, -1)
-    FF(SetEnvironmentVariableA, -1)
-    FF(RtlZeroMemory,-1)
-    FF(RtlMoveMemory,-1)
-    FF(RtlFillMemory,-1)
-    FF(GetTempPathA,-1)
-    FF(FindFirstFileA,-1)
-    FF(FindNextFileA,-1)
-    FF(FindClose,-1)
-    FF(FileTimeToLocalFileTime,-1)
-    FF(DeleteFileA,-1)
-    FF(ReadFile,-1)
-    FF(WriteFile,-1)
-    FF(SetFilePointer,-1)
-    FF(GetTempFileNameA,-1)
-    FF(CreateFileA,-1)
-    FF(GetSystemDirectoryA,-1)
-    FF(GetWindowsDirectoryA,-1)
-#ifdef QTX
-    FF(GetCurrentDirectoryA,-1)
-    FF(SetCurrentDirectoryA,-1)
-    FF(CreateDirectoryA,-1)
-#endif
-    FF(GetShortPathNameA,-1)
-    FF(GetFullPathNameA,-1)
-    FF(SetErrorMode, -1)
-    FF(IsProcessorFeaturePresent, -1)
-    FF(GetProcessAffinityMask, -1)
-    FF(InterlockedExchange, -1)
-    FF(InterlockedCompareExchange, -1)
-    FF(MulDiv, -1)
-    FF(lstrcmpiA, -1)
-    FF(lstrlenA, -1)
-    FF(lstrcpyA, -1)
-    FF(lstrcatA, -1)
-    FF(lstrcpynA,-1)
-    FF(GetProcessVersion,-1)
-    FF(GetCurrentThread,-1)
-    FF(GetOEMCP,-1)
-    FF(GetCPInfo,-1)
-    FF(DuplicateHandle,-1)
-    FF(GetTickCount, -1)
-    FF(SetThreadAffinityMask,-1)
-    FF(GetCurrentProcessId,-1)
-    FF(GlobalMemoryStatus,-1)
-    FF(SetThreadPriority,-1)
-    FF(ExitProcess,-1)
-    {"LoadLibraryExA", -1, (void*)&LoadLibraryExA},
-    FF(SetThreadIdealProcessor,-1)
-};
-
-struct exports exp_msvcrt[]={
-    FF(malloc, -1)
-    FF(_initterm, -1)
-    FF(__dllonexit, -1)
-    FF(_snprintf,-1)
-    FF(free, -1)
-    {"??3@YAXPAX@Z", -1, expdelete},
-    {"??2@YAPAXI@Z", -1, expnew},
-    {"_adjust_fdiv", -1, (void*)&_adjust_fdiv},
-    FF(strrchr, -1)
-    FF(strchr, -1)
-    FF(strlen, -1)
-    FF(strcpy, -1)
-    FF(strncpy, -1)
-    FF(wcscpy, -1)
-    FF(strcmp, -1)
-    FF(strncmp, -1)
-    FF(strcat, -1)
-    FF(_stricmp,-1)
-    FF(_strdup,-1)
-    FF(_setjmp3,-1)
-    FF(isalnum, -1)
-    FF(isspace, -1)
-    FF(isalpha, -1)
-    FF(isdigit, -1)
-    FF(memmove, -1)
-    FF(memcmp, -1)
-    FF(memset, -1)
-    FF(memcpy, -1)
-    FF(time, -1)
-    FF(rand, -1)
-    FF(srand, -1)
-    FF(log10, -1)
-    FF(pow, -1)
-    FF(cos, -1)
-    FF(_ftol,-1)
-    FF(_CIpow,-1)
-    FF(_CIcos,-1)
-    FF(_CIsin,-1)
-    FF(ldexp,-1)
-    FF(frexp,-1)
-    FF(sprintf,-1)
-    FF(sscanf,-1)
-    FF(fopen,-1)
-    FF(fprintf,-1)
-    FF(printf,-1)
-    FF(getenv,-1)
-    FF(floor,-1)
-/* needed by frapsvid.dll */
-    {"strstr",-1,(char *)&strstr},
-    {"qsort",-1,(void *)&qsort},
-#ifdef MPLAYER
-    FF(_EH_prolog,-1)
-#endif
-    FF(calloc,-1)
-    {"ceil",-1,(void*)&ceil},
-/* needed by imagepower mjpeg2k */
-    {"clock",-1,(void*)&clock},
-    {"memchr",-1,(void*)&memchr},
-    {"vfprintf",-1,(void*)&vfprintf},
-//    {"realloc",-1,(void*)&realloc},
-    FF(realloc,-1)
-    {"puts",-1,(void*)&puts}
-};
-struct exports exp_winmm[]={
-    FF(GetDriverModuleHandle, -1)
-    FF(timeGetTime, -1)
-    FF(DefDriverProc, -1)
-    FF(OpenDriverA, -1)
-    FF(OpenDriver, -1)
-    FF(timeGetDevCaps, -1)
-    FF(timeBeginPeriod, -1)
-#ifdef QTX
-    FF(timeEndPeriod, -1)
-    FF(waveOutGetNumDevs, -1)
-#endif
-};
-struct exports exp_user32[]={
-    FF(LoadIconA,-1)
-    FF(LoadStringA, -1)
-    FF(wsprintfA, -1)
-    FF(GetDC, -1)
-    FF(GetDesktopWindow, -1)
-    FF(ReleaseDC, -1)
-    FF(IsRectEmpty, -1)
-    FF(LoadCursorA,-1)
-    FF(SetCursor,-1)
-    FF(GetCursorPos,-1)
-#ifdef QTX
-    FF(ShowCursor,-1)
-#endif
-    FF(RegisterWindowMessageA,-1)
-    FF(GetSystemMetrics,-1)
-    FF(GetSysColor,-1)
-    FF(GetSysColorBrush,-1)
-    FF(GetWindowDC, -1)
-    FF(DrawTextA, -1)
-    FF(MessageBoxA, -1)
-    FF(RegisterClassA, -1)
-    FF(UnregisterClassA, -1)
-#ifdef QTX
-    FF(GetWindowRect, -1)
-    FF(MonitorFromWindow, -1)
-    FF(MonitorFromRect, -1)
-    FF(MonitorFromPoint, -1)
-    FF(EnumDisplayMonitors, -1)
-    FF(GetMonitorInfoA, -1)
-    FF(EnumDisplayDevicesA, -1)
-    FF(GetClientRect, -1)
-    FF(ClientToScreen, -1)
-    FF(IsWindowVisible, -1)
-    FF(GetActiveWindow, -1)
-    FF(GetClassNameA, -1)
-    FF(GetClassInfoA, -1)
-    FF(GetWindowLongA, -1)
-    FF(EnumWindows, -1)
-    FF(GetWindowThreadProcessId, -1)
-    FF(CreateWindowExA, -1)
-#endif
-    FF(MessageBeep, -1)
-    FF(DialogBoxParamA, -1)
-};
-struct exports exp_advapi32[]={
-    FF(RegCloseKey, -1)
-    FF(RegCreateKeyA, -1)
-    FF(RegCreateKeyExA, -1)
-    FF(RegEnumKeyExA, -1)
-    FF(RegEnumValueA, -1)
-    FF(RegOpenKeyA, -1)
-    FF(RegOpenKeyExA, -1)
-    FF(RegQueryValueExA, -1)
-    FF(RegSetValueExA, -1)
-    FF(RegQueryInfoKeyA, -1)
-};
-struct exports exp_gdi32[]={
-    FF(CreateCompatibleDC, -1)
-    FF(CreateFontA, -1)
-    FF(DeleteDC, -1)
-    FF(DeleteObject, -1)
-    FF(GetDeviceCaps, -1)
-    FF(GetSystemPaletteEntries, -1)
-#ifdef QTX
-    FF(CreatePalette, -1)
-    FF(GetObjectA, -1)
-    FF(CreateRectRgn, -1)
-#endif
-};
-struct exports exp_version[]={
-    FF(GetFileVersionInfoSizeA, -1)
-};
-struct exports exp_ole32[]={
-    FF(CoCreateFreeThreadedMarshaler,-1)
-    FF(CoCreateInstance, -1)
-    FF(CoInitialize, -1)
-    FF(CoTaskMemAlloc, -1)
-    FF(CoTaskMemFree, -1)
-    FF(StringFromGUID2, -1)
-};
-// do we really need crtdll ???
-// msvcrt is the correct place probably...
-struct exports exp_crtdll[]={
-    FF(memcpy, -1)
-    FF(wcscpy, -1)
-};
-struct exports exp_comctl32[]={
-    FF(StringFromGUID2, -1)
-    FF(InitCommonControls, 17)
-#ifdef QTX
-    FF(CreateUpDownControl, 16)
-#endif
-};
-struct exports exp_wsock32[]={
-    FF(htonl,8)
-    FF(ntohl,14)
-};
-struct exports exp_msdmo[]={
-    FF(memcpy, -1) // just test
-    FF(MoCopyMediaType, -1)
-    FF(MoCreateMediaType, -1)
-    FF(MoDeleteMediaType, -1)
-    FF(MoDuplicateMediaType, -1)
-    FF(MoFreeMediaType, -1)
-    FF(MoInitMediaType, -1)
-};
-struct exports exp_oleaut32[]={
-    FF(VariantInit, 8)
-#ifdef QTX
-    FF(SysStringByteLen, 149)
-#endif
-};
-
-/*  realplayer8:
-       DLL Name: PNCRT.dll
-       vma:  Hint/Ord Member-Name
-       22ff4     615  free
-       2302e     250  _ftol
-       22fea     666  malloc
-       2303e     609  fprintf
-       2305e     167  _adjust_fdiv
-       23052     280  _initterm
-
-       22ffc     176  _beginthreadex
-       23036     284  _iob
-       2300e      85  __CxxFrameHandler
-       23022     411  _purecall
-*/
-#ifdef REALPLAYER
-struct exports exp_pncrt[]={
-    FF(malloc, -1) // just test
-    FF(free, -1) // just test
-    FF(fprintf, -1) // just test
-    {"_adjust_fdiv", -1, (void*)&_adjust_fdiv},
-    FF(_ftol,-1)
-    FF(_initterm, -1)
-    {"??3@YAXPAX@Z", -1, expdelete},
-    {"??2@YAPAXI@Z", -1, expnew},
-    FF(__dllonexit, -1)
-    FF(strncpy, -1)
-    FF(_CIpow,-1)
-    FF(calloc,-1)
-    FF(memmove, -1)
-};
-#endif
-
-#ifdef QTX
-struct exports exp_ddraw[]={
-    FF(DirectDrawCreate, -1)
-};
-#endif
-
-struct exports exp_comdlg32[]={
-    FF(GetOpenFileNameA, -1)
-};
-
-#define LL(X) \
-    {#X".dll", sizeof(exp_##X)/sizeof(struct exports), exp_##X},
-
-struct libs libraries[]={
-    LL(kernel32)
-    LL(msvcrt)
-    LL(winmm)
-    LL(user32)
-    LL(advapi32)
-    LL(gdi32)
-    LL(version)
-    LL(ole32)
-    LL(oleaut32)
-    LL(crtdll)
-    LL(comctl32)
-    LL(wsock32)
-    LL(msdmo)
-#ifdef REALPLAYER
-    LL(pncrt)
-#endif
-#ifdef QTX
-    LL(ddraw)
-#endif
-    LL(comdlg32)
-};
-
-static void ext_stubs(void)
-{
-    // expects:
-    //  ax  position index
-    //  cx  address of printf function
-#if 1
-    __asm__ __volatile__
-       (
-         "push %%edx           \n\t"
-        "movl $0xdeadbeef, %%eax \n\t"
-        "movl $0xdeadbeef, %%edx \n\t"
-        "shl $5, %%eax         \n\t"                   // ax * 32
-        "addl $0xdeadbeef, %%eax \n\t"                 // overwrite export_names
-        "pushl %%eax           \n\t"
-        "pushl $0xdeadbeef     \n\t"                   // overwrite called_unk
-        "call *%%edx           \n\t"                   // printf (via dx)
-        "addl $8, %%esp        \n\t"
-        "xorl %%eax, %%eax     \n\t"
-        "pop %%edx             \n\t"
-        :
-        :
-        : "eax"
-       );
-#else
-    __asm__ __volatile__
-       (
-         "push %%edx           \n\t"
-        "movl $0, %%eax        \n\t"
-        "movl $0, %%edx        \n\t"
-        "shl $5, %%eax         \n\t"                   // ax * 32
-        "addl %0, %%eax        \n\t"
-        "pushl %%eax           \n\t"
-        "pushl %1              \n\t"
-        "call *%%edx           \n\t"                   // printf (via dx)
-        "addl $8, %%esp        \n\t"
-        "xorl %%eax, %%eax     \n\t"
-        "pop %%edx             \n\t"
-        ::"m"(*export_names), "m"(*called_unk)
-       : "memory", "edx", "eax"
-       );
-#endif
-
-}
-
-//static void add_stub(int pos)
-
-extern int unk_exp1;
-static int pos=0;
-static char extcode[20000];// place for 200 unresolved exports
-static const char* called_unk = "Called unk_%s\n";
-
-static void* add_stub(void)
-{
-    // generated code in runtime!
-    char* answ = (char*)extcode+pos*0x30;
-#if 0
-    memcpy(answ, &unk_exp1, 0x64);
-    *(int*)(answ+9)=pos;
-    *(int*)(answ+47)-=((int)answ-(int)&unk_exp1);
-#endif
-    memcpy(answ, ext_stubs, 0x2f); // 0x2c is current size
-    //answ[4] = 0xb8; // movl $0, eax  (0xb8 0x00000000)
-    *((int*) (answ + 5)) = pos;
-    //answ[9] = 0xba; // movl $0, edx  (0xba 0x00000000)
-    *((long*) (answ + 10)) = (long)printf;
-    //answ[17] = 0x05; // addl $0, eax  (0x05 0x00000000)
-    *((long*) (answ + 18)) = (long)export_names;
-    //answ[23] = 0x68; // pushl $0  (0x68 0x00000000)
-    *((long*) (answ + 24)) = (long)called_unk;
-    pos++;
-    return (void*)answ;
-}
-
-void* LookupExternal(const char* library, int ordinal)
-{
-    int i,j;
-    if(library==0)
-    {
-       printf("ERROR: library=0\n");
-       return (void*)ext_unknown;
-    }
-    //    printf("%x %x\n", &unk_exp1, &unk_exp2);
-
-    dbgprintf("External func %s:%d\n", library, ordinal);
-
-    for(i=0; i<sizeof(libraries)/sizeof(struct libs); i++)
-    {
-       if(strcasecmp(library, libraries[i].name))
-           continue;
-       for(j=0; j<libraries[i].length; j++)
-       {
-           if(ordinal!=libraries[i].exps[j].id)
-               continue;
-           //printf("Hit: 0x%p\n", libraries[i].exps[j].func);
-           return libraries[i].exps[j].func;
-       }
-    }
-
-#ifndef LOADLIB_TRY_NATIVE
-  /* hack for truespeech and vssh264*/
-  if (!strcmp(library, "tsd32.dll") || !strcmp(library,"vssh264dec.dll") || !strcmp(library,"LCMW2.dll") || !strcmp(library,"VDODEC32.dll"))
-#endif
-    /* ok, this is a hack, and a big memory leak. should be fixed. - alex */
-    {
-       int hand;
-       WINE_MODREF *wm;
-       void *func;
-
-       hand = LoadLibraryA(library);
-       if (!hand)
-           goto no_dll;
-       wm = MODULE32_LookupHMODULE(hand);
-       if (!wm)
-       {
-           FreeLibrary(hand);
-           goto no_dll;
-       }
-       func = PE_FindExportedFunction(wm, (LPCSTR) ordinal, 0);
-       if (!func)
-       {
-           printf("No such ordinal in external dll\n");
-           FreeLibrary((int)hand);
-           goto no_dll;
-       }
-
-       printf("External dll loaded (offset: 0x%x, func: %p)\n",
-              hand, func);
-       return func;
-    }
-
-no_dll:
-    if(pos>150)return 0;
-    sprintf(export_names[pos], "%s:%d", library, ordinal);
-    return add_stub();
-}
-
-void* LookupExternalByName(const char* library, const char* name)
-{
-    char* answ;
-    int i,j;
-    //   return (void*)ext_unknown;
-    if(library==0)
-    {
-       printf("ERROR: library=0\n");
-       return (void*)ext_unknown;
-    }
-    if(name==0)
-    {
-       printf("ERROR: name=0\n");
-       return (void*)ext_unknown;
-    }
-    dbgprintf("External func %s:%s\n", library, name);
-    for(i=0; i<sizeof(libraries)/sizeof(struct libs); i++)
-    {
-       if(strcasecmp(library, libraries[i].name))
-           continue;
-       for(j=0; j<libraries[i].length; j++)
-       {
-           if(strcmp(name, libraries[i].exps[j].name))
-               continue;
-           //      printf("Hit: 0x%08X\n", libraries[i].exps[j].func);
-           return libraries[i].exps[j].func;
-       }
-    }
-
-#ifndef LOADLIB_TRY_NATIVE
-  /* hack for vss h264 */
-  if (!strcmp(library,"vssh264core.dll"))
-#endif
-    /* ok, this is a hack, and a big memory leak. should be fixed. - alex */
-    {
-       int hand;
-       WINE_MODREF *wm;
-       void *func;
-
-       hand = LoadLibraryA(library);
-       if (!hand)
-           goto no_dll_byname;
-       wm = MODULE32_LookupHMODULE(hand);
-       if (!wm)
-       {
-           FreeLibrary(hand);
-           goto no_dll_byname;
-       }
-       func = PE_FindExportedFunction(wm, name, 0);
-       if (!func)
-       {
-           printf("No such name in external dll\n");
-           FreeLibrary((int)hand);
-           goto no_dll_byname;
-       }
-
-       printf("External dll loaded (offset: 0x%x, func: %p)\n",
-              hand, func);
-       return func;
-    }
-
-no_dll_byname:
-    if(pos>150)return 0;// to many symbols
-    strcpy(export_names[pos], name);
-    return add_stub();
-}
-
-void my_garbagecollection(void)
-{
-#ifdef GARBAGE
-    int unfree = 0, unfreecnt = 0;
-
-    int max_fatal = 8;
-    free_registry();
-    while (last_alloc)
-    {
-       alloc_header* mem = last_alloc + 1;
-       unfree += my_size(mem);
-       unfreecnt++;
-       if (my_release(mem) != 0)
-           // avoid endless loop when memory is trashed
-           if (--max_fatal < 0)
-               break;
-    }
-    dbgprintf("Total Unfree %d bytes cnt %d [%p,%d]\n",unfree, unfreecnt, last_alloc, alccnt);
-#endif
-    g_tls = NULL;
-    list = NULL;
-}
diff --git a/modules/codec/loader/win32.h b/modules/codec/loader/win32.h
deleted file mode 100644 (file)
index 84dbf53..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Modified for use with MPlayer, detailed CVS changelog at
- * http://www.mplayerhq.hu/cgi-bin/cvsweb.cgi/main/
- * $Id$
- */
-
-#ifndef loader_win32_h
-#define loader_win32_h
-
-#include <time.h>
-
-#include "wine/windef.h"
-#include "wine/winbase.h"
-#include "com.h"
-
-#ifdef AVIFILE
-#ifdef __GNUC__
-#include "avm_output.h"
-#ifndef __cplusplus
-#define printf(a, ...)  avm_printf("Win32 plugin", a, ## __VA_ARGS__)
-#endif
-#endif
-#endif
-
-extern void my_garbagecollection(void);
-
-typedef struct {
-    UINT             uDriverSignature;
-    HINSTANCE        hDriverModule;
-    DRIVERPROC       DriverProc;
-    DWORD            dwDriverID;
-} DRVR;
-
-typedef DRVR  *PDRVR;
-typedef DRVR  *NPDRVR;
-typedef DRVR  *LPDRVR;
-
-typedef struct tls_s tls_t;
-
-
-extern void* LookupExternal(const char* library, int ordinal);
-extern void* LookupExternalByName(const char* library, const char* name);
-
-#endif
diff --git a/modules/codec/loader/wine/avifmt.h b/modules/codec/loader/wine/avifmt.h
deleted file mode 100644 (file)
index 09cf620..0000000
+++ /dev/null
@@ -1,244 +0,0 @@
-/****************************************************************************
- *
- *  AVIFMT - AVI file format definitions
- *
- ****************************************************************************/
-#ifndef AVIFMT 
-#define AVIFMT
-
-#ifndef NOAVIFMT 
-
-#ifndef  __WINE_WINDEF_H
-#include "wine/windef.h"
-#endif
-
-#ifndef __WINE_MMSYSTEM_H
-#ifndef __WINE_MSACM_H
-typedef DWORD FOURCC;
-#endif
-#endif
-
-
-#ifdef _MSC_VER
-#pragma warning(disable:4200)
-#endif
-    
-/* The following is a short description of the AVI file format.  Please
- * see the accompanying documentation for a full explanation.
- *
- * An AVI file is the following RIFF form:
- *
- *     RIFF('AVI' 
- *           LIST('hdrl'
- *                 avih(<MainAVIHeader>)
- *                  LIST ('strl'
- *                      strh(<Stream header>)
- *                      strf(<Stream format>)
- *                      ... additional header data
- *            LIST('movi'       
- *               { LIST('rec' 
- *                           SubChunk...
- *                        )
- *                   | SubChunk } ....     
- *            )
- *            [ <AVIIndex> ]
- *      )
- *
- *     The main file header specifies how many streams are present.  For
- *     each one, there must be a stream header chunk and a stream format
- *     chunk, enlosed in a 'strl' LIST chunk.  The 'strf' chunk contains
- *     type-specific format information; for a video stream, this should
- *     be a BITMAPINFO structure, including palette.  For an audio stream,
- *     this should be a WAVEFORMAT (or PCMWAVEFORMAT) structure.
- *
- *     The actual data is contained in subchunks within the 'movi' LIST 
- *     chunk.  The first two characters of each data chunk are the
- *     stream number with which that data is associated.
- *
- *     Some defined chunk types:
- *           Video Streams:
- *                  ##db:      RGB DIB bits
- *                  ##dc:      RLE8 compressed DIB bits
- *                  ##pc:      Palette Change
- *
- *           Audio Streams:
- *                  ##wb:      waveform audio bytes
- *
- * The grouping into LIST 'rec' chunks implies only that the contents of
- *   the chunk should be read into memory at the same time.  This
- *   grouping is used for files specifically intended to be played from 
- *   CD-ROM.
- *
- * The index chunk at the end of the file should contain one entry for 
- *   each data chunk in the file.
- *       
- * Limitations for the current software:
- *     Only one video stream and one audio stream are allowed.
- *     The streams must start at the beginning of the file.
- *
- * 
- * To register codec types please obtain a copy of the Multimedia
- * Developer Registration Kit from:
- *
- *  Microsoft Corporation
- *  Multimedia Systems Group
- *  Product Marketing
- *  One Microsoft Way
- *  Redmond, WA 98052-6399
- *
- */
-
-#ifndef mmioFOURCC
-#define mmioFOURCC( ch0, ch1, ch2, ch3 )                               \
-               ( (DWORD)(BYTE)(ch0) | ( (DWORD)(BYTE)(ch1) << 8 ) |    \
-               ( (DWORD)(BYTE)(ch2) << 16 ) | ( (DWORD)(BYTE)(ch3) << 24 ) )
-#endif
-
-/* Macro to make a TWOCC out of two characters */
-#ifndef aviTWOCC
-#define aviTWOCC(ch0, ch1) ((WORD)(BYTE)(ch0) | ((WORD)(BYTE)(ch1) << 8))
-#endif
-
-typedef WORD TWOCC;
-
-/* form types, list types, and chunk types */
-#define formtypeAVI             mmioFOURCC('A', 'V', 'I', ' ')
-#define listtypeAVIHEADER       mmioFOURCC('h', 'd', 'r', 'l')
-#define ckidAVIMAINHDR          mmioFOURCC('a', 'v', 'i', 'h')
-#define listtypeSTREAMHEADER    mmioFOURCC('s', 't', 'r', 'l')
-#define ckidSTREAMHEADER        mmioFOURCC('s', 't', 'r', 'h')
-#define ckidSTREAMFORMAT        mmioFOURCC('s', 't', 'r', 'f')
-#define ckidSTREAMHANDLERDATA   mmioFOURCC('s', 't', 'r', 'd')
-#define ckidSTREAMNAME         mmioFOURCC('s', 't', 'r', 'n')
-
-#define listtypeAVIMOVIE        mmioFOURCC('m', 'o', 'v', 'i')
-#define listtypeAVIRECORD       mmioFOURCC('r', 'e', 'c', ' ')
-
-#define ckidAVINEWINDEX         mmioFOURCC('i', 'd', 'x', '1')
-
-/*
-** Stream types for the <fccType> field of the stream header.
-*/
-#define streamtypeVIDEO         mmioFOURCC('v', 'i', 'd', 's')
-#define streamtypeAUDIO         mmioFOURCC('a', 'u', 'd', 's')
-#define streamtypeMIDI         mmioFOURCC('m', 'i', 'd', 's')
-#define streamtypeTEXT          mmioFOURCC('t', 'x', 't', 's')
-
-/* Basic chunk types */
-#define cktypeDIBbits           aviTWOCC('d', 'b')
-#define cktypeDIBcompressed     aviTWOCC('d', 'c')
-#define cktypePALchange         aviTWOCC('p', 'c')
-#define cktypeWAVEbytes         aviTWOCC('w', 'b')
-
-/* Chunk id to use for extra chunks for padding. */
-#define ckidAVIPADDING          mmioFOURCC('J', 'U', 'N', 'K')
-
-/*
-** Useful macros
-**
-** Warning: These are nasty macro, and MS C 6.0 compiles some of them
-** incorrectly if optimizations are on.  Ack.
-*/
-
-/* Macro to get stream number out of a FOURCC ckid */
-#define FromHex(n)     (((n) >= 'A') ? ((n) + 10 - 'A') : ((n) - '0'))
-#define StreamFromFOURCC(fcc) ((WORD) ((FromHex(LOBYTE(LOWORD(fcc))) << 4) + \
-                                             (FromHex(HIBYTE(LOWORD(fcc))))))
-
-/* Macro to get TWOCC chunk type out of a FOURCC ckid */
-#define TWOCCFromFOURCC(fcc)    HIWORD(fcc)
-
-/* Macro to make a ckid for a chunk out of a TWOCC and a stream number
-** from 0-255.
-*/
-#define ToHex(n)       ((BYTE) (((n) > 9) ? ((n) - 10 + 'A') : ((n) + '0')))
-#define MAKEAVICKID(tcc, stream) \
-        MAKELONG((ToHex((stream) & 0x0f) << 8) | \
-                           (ToHex(((stream) & 0xf0) >> 4)), tcc)
-
-/*
-** Main AVI File Header 
-*/          
-                    
-/* flags for use in <dwFlags> in AVIFileHdr */
-#define AVIF_HASINDEX          0x00000010      // Index at end of file?
-#define AVIF_MUSTUSEINDEX      0x00000020
-#define AVIF_ISINTERLEAVED     0x00000100
-#define AVIF_TRUSTCKTYPE       0x00000800      // Use CKType to find key frames?
-#define AVIF_WASCAPTUREFILE    0x00010000
-#define AVIF_COPYRIGHTED       0x00020000
-
-/* The AVI File Header LIST chunk should be padded to this size */
-#define AVI_HEADERSIZE  2048                    // size of AVI header list
-
-typedef struct
-{
-    DWORD              dwMicroSecPerFrame;     // frame display rate (or 0L)
-    DWORD              dwMaxBytesPerSec;       // max. transfer rate
-    DWORD              dwPaddingGranularity;   // pad to multiples of this
-                                                // size; normally 2K.
-    DWORD              dwFlags;                // the ever-present flags
-    DWORD              dwTotalFrames;          // # frames in file
-    DWORD              dwInitialFrames;
-    DWORD              dwStreams;
-    DWORD              dwSuggestedBufferSize;
-    
-    DWORD              dwWidth;
-    DWORD              dwHeight;
-    
-    DWORD              dwReserved[4];
-} MainAVIHeader;
-
-/*
-** Stream header
-*/
-
-#define AVISF_DISABLED                 0x00000001
-
-#define AVISF_VIDEO_PALCHANGES         0x00010000
-
-  
-typedef struct {
-    FOURCC             fccType;
-    FOURCC             fccHandler;
-    DWORD              dwFlags;        /* Contains AVITF_* flags */
-    WORD               wPriority;
-    WORD               wLanguage;
-    DWORD              dwInitialFrames;
-    DWORD              dwScale;        
-    DWORD              dwRate; /* dwRate / dwScale == samples/second */
-    DWORD              dwStart;
-    DWORD              dwLength; /* In units above... */
-    DWORD              dwSuggestedBufferSize;
-    DWORD              dwQuality;
-    DWORD              dwSampleSize;
-    RECT               rcFrame;
-} AVIStreamHeader;
-
-/* Flags for index */
-#define AVIIF_LIST          0x00000001L // chunk is a 'LIST'
-#define AVIIF_KEYFRAME      0x00000010L // this frame is a key frame.
-
-#define AVIIF_NOTIME       0x00000100L // this frame doesn't take any time
-#define AVIIF_COMPUSE       0x0FFF0000L // these bits are for compressor use
-
-#define FOURCC_RIFF     mmioFOURCC('R', 'I', 'F', 'F')
-#define FOURCC_LIST     mmioFOURCC('L', 'I', 'S', 'T')
-
-typedef struct
-{
-    DWORD              ckid;
-    DWORD              dwFlags;
-    DWORD              dwChunkOffset;          // Position of chunk
-    DWORD              dwChunkLength;          // Length of chunk
-} AVIINDEXENTRY;
-
-#define AVISTREAMREAD_CONVENIENT       (-1L)
-
-/*
-** Palette change chunk
-**
-** Used in video streams.
-*/
-#endif /* NOAVIFMT */
-#endif
diff --git a/modules/codec/loader/wine/basetsd.h b/modules/codec/loader/wine/basetsd.h
deleted file mode 100644 (file)
index 9f14971..0000000
+++ /dev/null
@@ -1,178 +0,0 @@
-/*
- * Compilers that uses ILP32, LP64 or P64 type models
- * for both Win32 and Win64 are supported by this file.
- */
-
-/*
- * Modified for use with MPlayer, detailed CVS changelog at
- * http://www.mplayerhq.hu/cgi-bin/cvsweb.cgi/main/
- * $Id$
- */
-
-#ifndef __WINE_BASETSD_H
-#define __WINE_BASETSD_H
-
-#ifdef __WINE__
-#include "config.h"
-#endif /* defined(__WINE__) */
-
-#ifdef __cplusplus
-extern "C" {
-#endif /* defined(__cplusplus) */
-
-/*
- * Win32 was easy to implement under Unix since most (all?) 32-bit
- * Unices uses the same type model (ILP32) as Win32, where int, long
- * and pointer are 32-bit.
- *
- * Win64, however, will cause some problems when implemented under Unix.
- * Linux/{Alpha, Sparc64} and most (all?) other 64-bit Unices uses
- * the LP64 type model where int is 32-bit and long and pointer are
- * 64-bit. Win64 on the other hand uses the P64 (sometimes called LLP64)
- * type model where int and long are 32 bit and pointer is 64-bit.
- */
-
-/* Type model indepent typedefs */
-
-#ifndef __INTEL_COMPILER
-
-#ifndef __int8
-typedef char          __int8;
-#endif
-#ifndef __uint8
-typedef unsigned char __uint8;
-#endif
-
-#ifndef __int16
-typedef short          __int16;
-#endif
-#ifndef __uint16
-typedef unsigned short __uint16;
-#endif
-
-#ifndef __int32
-typedef int          __int32;
-#endif
-#ifndef __uint32
-typedef unsigned int __uint32;
-#endif
-
-#ifndef __int64
-typedef long long          __int64;
-#endif
-#ifndef __uint64
-typedef unsigned long long __uint64;
-#endif
-
-#else
-
-typedef unsigned __int8  __uint8;
-typedef unsigned __int16 __uint16;
-typedef unsigned __int32 __uint32;
-typedef unsigned __int64 __uint64;
-
-#endif /* __INTEL_COMPILER */
-
-#if defined(_WIN64)
-
-typedef __uint32 __ptr32;
-typedef void    *__ptr64;
-
-#else /* FIXME: defined(_WIN32) */
-
-typedef void    *__ptr32;
-typedef __uint64 __ptr64;
-
-#endif
-
-/* Always signed and 32 bit wide */
-
-typedef __int32 LONG32;
-//typedef __int32 INT32;
-
-typedef LONG32 *PLONG32;
-//typedef INT32  *PINT32;
-
-/* Always unsigned and 32 bit wide */
-
-typedef __uint32 ULONG32;
-typedef __uint32 DWORD32;
-typedef __uint32 UINT32;
-
-typedef ULONG32 *PULONG32;
-typedef DWORD32 *PDWORD32;
-typedef UINT32  *PUINT32;
-
-/* Always signed and 64 bit wide */
-
-typedef __int64 LONG64;
-typedef __int64 INT64;
-
-typedef LONG64 *PLONG64;
-typedef INT64  *PINT64;
-
-/* Always unsigned and 64 bit wide */
-
-typedef __uint64 ULONG64;
-typedef __uint64 DWORD64;
-typedef __uint64 UINT64;
-
-typedef ULONG64 *PULONG64;
-typedef DWORD64 *PDWORD64;
-typedef UINT64  *PUINT64;
-
-/* Win32 or Win64 dependent typedef/defines. */
-
-#ifdef _WIN64
-
-typedef __int64 INT_PTR, *PINT_PTR;
-typedef __uint64 UINT_PTR, *PUINT_PTR;
-
-#define MAXINT_PTR 0x7fffffffffffffff
-#define MININT_PTR 0x8000000000000000
-#define MAXUINT_PTR 0xffffffffffffffff
-
-typedef __int32 HALF_PTR, *PHALF_PTR;
-typedef __int32 UHALF_PTR, *PUHALF_PTR;
-
-#define MAXHALF_PTR 0x7fffffff
-#define MINHALF_PTR 0x80000000
-#define MAXUHALF_PTR 0xffffffff
-
-typedef __int64 LONG_PTR, *PLONG_PTR;
-typedef __uint64 ULONG_PTR, *PULONG_PTR;
-typedef __uint64 DWORD_PTR, *PDWORD_PTR;
-
-#else /* FIXME: defined(_WIN32) */
-
-typedef __int32 INT_PTR, *PINT_PTR;
-typedef __uint32 UINT_PTR, *PUINT_PTR;
-
-#define MAXINT_PTR 0x7fffffff
-#define MININT_PTR 0x80000000
-#define MAXUINT_PTR 0xffffffff
-
-typedef __int16 HALF_PTR, *PHALF_PTR;
-typedef __uint16 UHALF_PTR, *PUHALF_PTR;
-
-#define MAXUHALF_PTR 0xffff
-#define MAXHALF_PTR 0x7fff
-#define MINHALF_PTR 0x8000
-
-typedef __int32 LONG_PTR, *PLONG_PTR;
-typedef __uint32 ULONG_PTR, *PULONG_PTR;
-typedef __uint32 DWORD_PTR, *PDWORD_PTR;
-
-#endif /* defined(_WIN64) || defined(_WIN32) */
-
-typedef INT_PTR SSIZE_T, *PSSIZE_T;
-typedef UINT_PTR SIZE_T, *PSIZE_T;
-
-#ifdef __cplusplus
-} /* extern "C" */
-#endif /* defined(__cplusplus) */
-
-#endif /* !defined(__WINE_BASETSD_H) */
-
-
-
diff --git a/modules/codec/loader/wine/debugtools.h b/modules/codec/loader/wine/debugtools.h
deleted file mode 100644 (file)
index ce2448d..0000000
+++ /dev/null
@@ -1,93 +0,0 @@
-
-#ifndef __WINE_DEBUGTOOLS_H
-#define __WINE_DEBUGTOOLS_H
-
-#ifdef __WINE__  /* Debugging interface is internal to Wine */
-
-#include <stdarg.h>
-#include "config.h"
-#include "windef.h"
-
-struct _GUID;
-
-/* Internal definitions (do not use these directly) */
-
-enum __DEBUG_CLASS { __DBCL_FIXME, __DBCL_ERR, __DBCL_WARN, __DBCL_TRACE, __DBCL_COUNT };
-
-#ifndef NO_TRACE_MSGS
-# define __GET_DEBUGGING_trace(dbch) ((dbch)[0] & (1 << __DBCL_TRACE))
-#else
-# define __GET_DEBUGGING_trace(dbch) 0
-#endif
-
-#ifndef NO_DEBUG_MSGS
-# define __GET_DEBUGGING_warn(dbch)  ((dbch)[0] & (1 << __DBCL_WARN))
-# define __GET_DEBUGGING_fixme(dbch) ((dbch)[0] & (1 << __DBCL_FIXME))
-#else
-# define __GET_DEBUGGING_warn(dbch)  0
-# define __GET_DEBUGGING_fixme(dbch) 0
-#endif
-
-/* define error macro regardless of what is configured */
-#define __GET_DEBUGGING_err(dbch)  ((dbch)[0] & (1 << __DBCL_ERR))
-
-#define __GET_DEBUGGING(dbcl,dbch)  __GET_DEBUGGING_##dbcl(dbch)
-#define __SET_DEBUGGING(dbcl,dbch,on) \
-    ((on) ? ((dbch)[0] |= 1 << (dbcl)) : ((dbch)[0] &= ~(1 << (dbcl))))
-
-#ifndef __GNUC__
-#define __FUNCTION__ ""
-#endif
-
-#define __DPRINTF(dbcl,dbch) \
-  (!__GET_DEBUGGING(dbcl,(dbch)) || (dbg_header_##dbcl((dbch),__FUNCTION__),0)) ? \
-     (void)0 : (void)dbg_printf
-
-/* Exported definitions and macros */
-
-/* These function return a printable version of a string, including
-   quotes.  The string will be valid for some time, but not indefinitely
-   as strings are re-used.  */
-extern LPCSTR debugstr_an (LPCSTR s, int n);
-extern LPCSTR debugstr_wn (LPCWSTR s, int n);
-extern LPCSTR debugres_a (LPCSTR res);
-extern LPCSTR debugres_w (LPCWSTR res);
-extern LPCSTR debugstr_guid( const struct _GUID *id );
-extern LPCSTR debugstr_hex_dump (const void *ptr, int len);
-extern int dbg_header_err( const char *dbg_channel, const char *func );
-extern int dbg_header_warn( const char *dbg_channel, const char *func );
-extern int dbg_header_fixme( const char *dbg_channel, const char *func );
-extern int dbg_header_trace( const char *dbg_channel, const char *func );
-extern int dbg_vprintf( const char *format, va_list args );
-
-static inline LPCSTR debugstr_a( LPCSTR s )  { return debugstr_an( s, 80 ); }
-static inline LPCSTR debugstr_w( LPCWSTR s ) { return debugstr_wn( s, 80 ); }
-
-#ifdef __GNUC__
-extern int dbg_printf(const char *format, ...) __attribute__((format (printf,1,2)));
-#else
-extern int dbg_printf(const char *format, ...);
-#endif
-
-#define TRACE_(X) TRACE
-#define WARN_(X) TRACE
-#define WARN TRACE
-#define ERR_(X) printf
-#define ERR printf
-#define FIXME_(X) TRACE
-#define FIXME TRACE
-
-#define TRACE_ON(X) 1
-#define ERR_ON(X) 1
-
-#define DECLARE_DEBUG_CHANNEL(ch) \
-    extern char dbch_##ch[];
-#define DEFAULT_DEBUG_CHANNEL(ch) \
-    extern char dbch_##ch[]; static char * const __dbch_default = dbch_##ch;
-
-#define DPRINTF dbg_printf
-#define MESSAGE dbg_printf
-
-#endif  /* __WINE__ */
-
-#endif  /* __WINE_DEBUGTOOLS_H */
diff --git a/modules/codec/loader/wine/driver.h b/modules/codec/loader/wine/driver.h
deleted file mode 100644 (file)
index dc8661a..0000000
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- * Drivers definitions
- */
-
-#ifndef __WINE_DRIVER_H
-#define __WINE_DRIVER_H
-
-#include "windef.h"
-
-#define MMSYSERR_BASE          0
-
-#define MMSYSERR_NOERROR       0                    /* no error */
-#define MMSYSERR_ERROR         (MMSYSERR_BASE + 1)  /* unspecified error */
-#define MMSYSERR_BADDEVICEID   (MMSYSERR_BASE + 2)  /* device ID out of range */
-#define MMSYSERR_NOTENABLED    (MMSYSERR_BASE + 3)  /* driver failed enable */
-#define MMSYSERR_ALLOCATED     (MMSYSERR_BASE + 4)  /* device already allocated */
-#define MMSYSERR_INVALHANDLE   (MMSYSERR_BASE + 5)  /* device handle is invalid */
-#define MMSYSERR_NODRIVER      (MMSYSERR_BASE + 6)  /* no device driver present */
-#define MMSYSERR_NOMEM         (MMSYSERR_BASE + 7)  /* memory allocation error */
-#define MMSYSERR_NOTSUPPORTED  (MMSYSERR_BASE + 8)  /* function isn't supported */
-#define MMSYSERR_BADERRNUM     (MMSYSERR_BASE + 9)  /* error value out of range */
-#define MMSYSERR_INVALFLAG     (MMSYSERR_BASE + 10) /* invalid flag passed */
-#define MMSYSERR_INVALPARAM    (MMSYSERR_BASE + 11) /* invalid parameter passed */
-#define MMSYSERR_LASTERROR     (MMSYSERR_BASE + 11) /* last error in range */
-
-#define DRV_LOAD                0x0001
-#define DRV_ENABLE              0x0002
-#define DRV_OPEN                0x0003
-#define DRV_CLOSE               0x0004
-#define DRV_DISABLE             0x0005
-#define DRV_FREE                0x0006
-#define DRV_CONFIGURE           0x0007
-#define DRV_QUERYCONFIGURE      0x0008
-#define DRV_INSTALL             0x0009
-#define DRV_REMOVE              0x000A
-#define DRV_EXITSESSION         0x000B
-#define DRV_EXITAPPLICATION     0x000C
-#define DRV_POWER               0x000F
-
-#define DRV_RESERVED            0x0800
-#define DRV_USER                0x4000
-
-#define DRVCNF_CANCEL           0x0000
-#define DRVCNF_OK               0x0001
-#define DRVCNF_RESTART                 0x0002
-
-#define DRVEA_NORMALEXIT       0x0001
-#define DRVEA_ABNORMALEXIT     0x0002
-
-#define DRV_SUCCESS            0x0001
-#define DRV_FAILURE            0x0000
-
-#define GND_FIRSTINSTANCEONLY  0x00000001
-
-#define GND_FORWARD            0x00000000
-#define GND_REVERSE                    0x00000002
-
-typedef struct {
-    DWORD                      dwDCISize;
-    LPCSTR                     lpszDCISectionName;
-    LPCSTR                     lpszDCIAliasName;
-} DRVCONFIGINFO16, *LPDRVCONFIGINFO16;
-
-typedef struct {
-    DWORD                      dwDCISize;
-    LPCWSTR                    lpszDCISectionName;
-    LPCWSTR                    lpszDCIAliasName;
-} DRVCONFIGINFO, *LPDRVCONFIGINFO;
-
-
-/* GetDriverInfo16 references this structure, so this a struct defined
- * in the Win16 API.
- * GetDriverInfo has been deprecated in Win32.
- */
-typedef struct
-{
-    UINT16                     length;
-    HDRVR16                    hDriver;
-    HINSTANCE16                hModule;
-    CHAR                       szAliasName[128];
-} DRIVERINFOSTRUCT16, *LPDRIVERINFOSTRUCT16;
-
-LRESULT WINAPI DefDriverProc16(DWORD dwDevID, HDRVR16 hDriv, UINT16 wMsg, 
-                               LPARAM dwParam1, LPARAM dwParam2);
-LRESULT WINAPI DefDriverProc(DWORD dwDriverIdentifier, HDRVR hdrvr,
-                               UINT Msg, LPARAM lParam1, LPARAM lParam2);
-HDRVR16 WINAPI OpenDriver16(LPCSTR szDriverName, LPCSTR szSectionName,
-                            LPARAM lParam2);
-HDRVR WINAPI OpenDriverA(LPCSTR szDriverName, LPCSTR szSectionName,
-                             LPARAM lParam2);
-HDRVR WINAPI OpenDriverW(LPCWSTR szDriverName, LPCWSTR szSectionName,
-                             LPARAM lParam2);
-#define OpenDriver WINELIB_NAME_AW(OpenDriver)
-LRESULT WINAPI CloseDriver16(HDRVR16 hDriver, LPARAM lParam1, LPARAM lParam2);
-LRESULT WINAPI CloseDriver(HDRVR hDriver, LPARAM lParam1, LPARAM lParam2);
-LRESULT WINAPI SendDriverMessage16( HDRVR16 hDriver, UINT16 message,
-                                    LPARAM lParam1, LPARAM lParam2 );
-LRESULT WINAPI SendDriverMessage( HDRVR hDriver, UINT message,
-                                    LPARAM lParam1, LPARAM lParam2 );
-HMODULE16 WINAPI GetDriverModuleHandle16(HDRVR16 hDriver);
-HMODULE WINAPI GetDriverModuleHandle(HDRVR hDriver);
-
-DWORD WINAPI GetDriverFlags( HDRVR hDriver );
-#ifdef __WINE__
-/* this call (GetDriverFlags) is not documented, nor the flags returned.
- * here are Wine only definitions
- */
-#define WINE_GDF_EXIST 0x80000000
-#define WINE_GDF_16BIT 0x10000000
-#endif
-
-#endif  /* __WINE_DRIVER_H */
diff --git a/modules/codec/loader/wine/heap.h b/modules/codec/loader/wine/heap.h
deleted file mode 100644 (file)
index bd0604b..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Win32 heap definitions
- *
- * Copyright 1996 Alexandre Julliard
- */
-
-#ifndef __WINE_HEAP_H
-#define __WINE_HEAP_H
-
-#include "config.h"
-
-#include "winbase.h"
-
-extern HANDLE SystemHeap;
-extern HANDLE SegptrHeap;
-
-extern int HEAP_IsInsideHeap( HANDLE heap, DWORD flags, LPCVOID ptr );
-extern SEGPTR HEAP_GetSegptr( HANDLE heap, DWORD flags, LPCVOID ptr );
-extern LPSTR HEAP_strdupA( HANDLE heap, DWORD flags, LPCSTR str );
-extern LPWSTR HEAP_strdupW( HANDLE heap, DWORD flags, LPCWSTR str );
-extern LPWSTR HEAP_strdupAtoW( HANDLE heap, DWORD flags, LPCSTR str );
-extern LPSTR HEAP_strdupWtoA( HANDLE heap, DWORD flags, LPCWSTR str );
-
-/* SEGPTR helper macros */
-
-#define SEGPTR_ALLOC(size) \
-         (HeapAlloc( SegptrHeap, 0, (size) ))
-#define SEGPTR_NEW(type) \
-         ((type *)HeapAlloc( SegptrHeap, 0, sizeof(type) ))
-#define SEGPTR_STRDUP(str) \
-         (HIWORD(str) ? HEAP_strdupA( SegptrHeap, 0, (str) ) : (LPSTR)(str))
-#define SEGPTR_STRDUP_WtoA(str) \
-         (HIWORD(str) ? HEAP_strdupWtoA( SegptrHeap, 0, (str) ) : (LPSTR)(str))
-       /* define an inline function, a macro won't do */
-static inline SEGPTR WINE_UNUSED SEGPTR_Get(LPCVOID ptr) {
-         return (HIWORD(ptr) ? HEAP_GetSegptr( SegptrHeap, 0, ptr ) : (SEGPTR)ptr);
-}
-#define SEGPTR_GET(ptr) SEGPTR_Get(ptr)
-#define SEGPTR_FREE(ptr) \
-         (HIWORD(ptr) ? HeapFree( SegptrHeap, 0, (ptr) ) : 0)
-
-/* system heap private data */
-/* you must lock the system heap before using this structure */
-typedef struct
-{
-    void     *gdi;        /* GDI heap */
-    void     *user;       /* USER handle table */
-    void     *cursor;     /* cursor information */
-    void     *queue;      /* message queues descriptor */
-    void     *win;        /* windows descriptor */
-    void     *root;       /* X11 root window */
-} SYSTEM_HEAP_DESCR;
-
-extern SYSTEM_HEAP_DESCR *SystemHeapDescr;
-
-#endif  /* __WINE_HEAP_H */
diff --git a/modules/codec/loader/wine/mmreg.h b/modules/codec/loader/wine/mmreg.h
deleted file mode 100644 (file)
index 8529569..0000000
+++ /dev/null
@@ -1,250 +0,0 @@
-/*
- *      mmreg.h   -       Declarations for ???
- *
- * Modified for use with MPlayer, detailed CVS changelog at
- * http://www.mplayerhq.hu/cgi-bin/cvsweb.cgi/main/
- * $Id$
- *
- */
-
-#ifndef __WINE_MMREG_H
-#define __WINE_MMREG_H
-
-/***********************************************************************
- * Defines/Enums
- */
-
-#ifndef _ACM_WAVEFILTER
-#define _ACM_WAVEFILTER
-
-#include "windef.h"
-
-#define WAVE_FILTER_UNKNOWN     0x0000
-#define WAVE_FILTER_DEVELOPMENT 0xFFFF
-
-typedef struct __attribute__((__packed__)) _WAVEFILTER {
-  DWORD   cbStruct;
-  DWORD   dwFilterTag;
-  DWORD   fdwFilter;
-  DWORD   dwReserved[5];
-} WAVEFILTER, *PWAVEFILTER, *NPWAVEFILTER, *LPWAVEFILTER;
-#endif /* _ACM_WAVEFILTER */
-
-#ifndef WAVE_FILTER_VOLUME
-#define WAVE_FILTER_VOLUME      0x0001
-
-typedef struct __attribute__((__packed__)) _WAVEFILTER_VOLUME {
-   WAVEFILTER      wfltr;
-   DWORD           dwVolume;
-} VOLUMEWAVEFILTER, *PVOLUMEWAVEFILTER, *NPVOLUMEWAVEFILTER, *LPVOLUMEWAVEFILTER;
-#endif  /* WAVE_FILTER_VOLUME */
-
-#ifndef WAVE_FILTER_ECHO
-#define WAVE_FILTER_ECHO        0x0002
-
-typedef struct __attribute__((__packed__)) WAVEFILTER_ECHO {
-   WAVEFILTER      wfltr;
-   DWORD           dwVolume;
-   DWORD           dwDelay;
-} ECHOWAVEFILTER, *PECHOWAVEFILTER, *NPECHOWAVEFILTER, *LPECHOWAVEFILTER;
-#endif  /* WAVEFILTER_ECHO */
-    
-#ifndef _WAVEFORMATEX_
-#define _WAVEFORMATEX_
-typedef struct __attribute__((__packed__)) _WAVEFORMATEX {
-  WORD   wFormatTag;
-  WORD   nChannels;
-  DWORD  nSamplesPerSec;
-  DWORD  nAvgBytesPerSec;
-  WORD   nBlockAlign;
-  WORD   wBitsPerSample;
-  WORD   cbSize;
-} WAVEFORMATEX, *PWAVEFORMATEX, *NPWAVEFORMATEX, *LPWAVEFORMATEX;
-#endif /* _WAVEFORMATEX_ */
-
-#ifndef GUID_TYPE
-#define GUID_TYPE
-typedef struct
-{
-    unsigned long f1;
-    unsigned short f2;
-    unsigned short f3;
-    unsigned char f4[8];
-} GUID;
-#endif
-
-#ifndef _WAVEFORMATEXTENSIBLE_
-#define _WAVEFORMATEXTENSIBLE_
-typedef struct {
-    WAVEFORMATEX    Format;
-    union {
-        WORD wValidBitsPerSample;       /* bits of precision  */
-        WORD wSamplesPerBlock;          /* valid if wBitsPerSample==0 */
-        WORD wReserved;                 /* If neither applies, set to zero. */
-    } Samples;
-    DWORD           dwChannelMask;      /* which channels are */
-                                        /* present in stream  */
-    GUID            SubFormat;
-} WAVEFORMATEXTENSIBLE, *PWAVEFORMATEXTENSIBLE;
-#endif // !_WAVEFORMATEXTENSIBLE_
-
-#ifndef _MPEGLAYER3WAVEFORMAT_
-#define _MPEGLAYER3WAVEFORMAT_
-typedef struct mpeglayer3waveformat_tag {
-  WORD   wFormatTag WINE_PACKED;
-  WORD   nChannels WINE_PACKED;
-  DWORD  nSamplesPerSec WINE_PACKED;
-  DWORD  nAvgBytesPerSec WINE_PACKED;
-  WORD   nBlockAlign WINE_PACKED;
-  WORD   wBitsPerSample WINE_PACKED;
-  WORD   cbSize WINE_PACKED;
-  WORD          wID WINE_PACKED;
-  DWORD         fdwFlags WINE_PACKED;
-  WORD          nBlockSize WINE_PACKED;
-  WORD          nFramesPerBlock WINE_PACKED;
-  WORD          nCodecDelay WINE_PACKED;
-} MPEGLAYER3WAVEFORMAT;
-#endif /* !_MPEGLAYER3WAVEFORMAT_ */
-
-/* WAVE form wFormatTag IDs */
-
-#define  WAVE_FORMAT_UNKNOWN                    0x0000 /* Microsoft Corporation */
-#define  WAVE_FORMAT_ADPCM                      0x0002 /* Microsoft Corporation */
-#define  WAVE_FORMAT_IEEE_FLOAT                 0x0003 /* Microsoft Corporation */
-#define  WAVE_FORMAT_VSELP                      0x0004 /* Compaq Computer Corp. */
-#define  WAVE_FORMAT_IBM_CVSD                   0x0005 /* IBM Corporation */
-#define  WAVE_FORMAT_ALAW                       0x0006 /* Microsoft Corporation */
-#define  WAVE_FORMAT_MULAW                      0x0007 /* Microsoft Corporation */
-#define  WAVE_FORMAT_DTS                        0x0008 /* Microsoft Corporation */
-#define  WAVE_FORMAT_OKI_ADPCM                  0x0010 /* OKI */
-#define  WAVE_FORMAT_DVI_ADPCM                  0x0011 /* Intel Corporation */
-#define  WAVE_FORMAT_IMA_ADPCM                  (WAVE_FORMAT_DVI_ADPCM) /*  Intel Corporation */
-#define  WAVE_FORMAT_MEDIASPACE_ADPCM           0x0012 /* Videologic */
-#define  WAVE_FORMAT_SIERRA_ADPCM               0x0013 /* Sierra Semiconductor Corp */
-#define  WAVE_FORMAT_G723_ADPCM                 0x0014 /* Antex Electronics Corporation */
-#define  WAVE_FORMAT_DIGISTD                    0x0015 /* DSP Solutions, Inc. */
-#define  WAVE_FORMAT_DIGIFIX                    0x0016 /* DSP Solutions, Inc. */
-#define  WAVE_FORMAT_DIALOGIC_OKI_ADPCM         0x0017 /* Dialogic Corporation */
-#define  WAVE_FORMAT_MEDIAVISION_ADPCM          0x0018 /* Media Vision, Inc. */
-#define  WAVE_FORMAT_CU_CODEC                   0x0019 /* Hewlett-Packard Company */
-#define  WAVE_FORMAT_YAMAHA_ADPCM               0x0020 /* Yamaha Corporation of America */
-#define  WAVE_FORMAT_SONARC                     0x0021 /* Speech Compression */
-#define  WAVE_FORMAT_DSPGROUP_TRUESPEECH        0x0022 /* DSP Group, Inc */
-#define  WAVE_FORMAT_ECHOSC1                    0x0023 /* Echo Speech Corporation */
-#define  WAVE_FORMAT_AUDIOFILE_AF36             0x0024 /* Virtual Music, Inc. */
-#define  WAVE_FORMAT_APTX                       0x0025 /* Audio Processing Technology */
-#define  WAVE_FORMAT_AUDIOFILE_AF10             0x0026 /* Virtual Music, Inc. */
-#define  WAVE_FORMAT_PROSODY_1612               0x0027 /* Aculab plc */
-#define  WAVE_FORMAT_LRC                        0x0028 /* Merging Technologies S.A. */
-#define  WAVE_FORMAT_DOLBY_AC2                  0x0030 /* Dolby Laboratories */
-#define  WAVE_FORMAT_GSM610                     0x0031 /* Microsoft Corporation */
-#define  WAVE_FORMAT_MSNAUDIO                   0x0032 /* Microsoft Corporation */
-#define  WAVE_FORMAT_ANTEX_ADPCME               0x0033 /* Antex Electronics Corporation */
-#define  WAVE_FORMAT_CONTROL_RES_VQLPC          0x0034 /* Control Resources Limited */
-#define  WAVE_FORMAT_DIGIREAL                   0x0035 /* DSP Solutions, Inc. */
-#define  WAVE_FORMAT_DIGIADPCM                  0x0036 /* DSP Solutions, Inc. */
-#define  WAVE_FORMAT_CONTROL_RES_CR10           0x0037 /* Control Resources Limited */
-#define  WAVE_FORMAT_NMS_VBXADPCM               0x0038 /* Natural MicroSystems */
-#define  WAVE_FORMAT_CS_IMAADPCM                0x0039 /* Crystal Semiconductor IMA ADPCM */
-#define  WAVE_FORMAT_ECHOSC3                    0x003A /* Echo Speech Corporation */
-#define  WAVE_FORMAT_ROCKWELL_ADPCM             0x003B /* Rockwell International */
-#define  WAVE_FORMAT_ROCKWELL_DIGITALK          0x003C /* Rockwell International */
-#define  WAVE_FORMAT_XEBEC                      0x003D /* Xebec Multimedia Solutions Limited */
-#define  WAVE_FORMAT_G721_ADPCM                 0x0040 /* Antex Electronics Corporation */
-#define  WAVE_FORMAT_G728_CELP                  0x0041 /* Antex Electronics Corporation */
-#define  WAVE_FORMAT_MSG723                     0x0042 /* Microsoft Corporation */
-#define  WAVE_FORMAT_MPEG                       0x0050 /* Microsoft Corporation */
-#define  WAVE_FORMAT_RT24                       0x0052 /* InSoft, Inc. */
-#define  WAVE_FORMAT_PAC                        0x0053 /* InSoft, Inc. */
-#define  WAVE_FORMAT_MPEGLAYER3                 0x0055 /* ISO/MPEG Layer3 Format Tag */
-#define  WAVE_FORMAT_LUCENT_G723                0x0059 /* Lucent Technologies */
-#define  WAVE_FORMAT_CIRRUS                     0x0060 /* Cirrus Logic */
-#define  WAVE_FORMAT_ESPCM                      0x0061 /* ESS Technology */
-#define  WAVE_FORMAT_VOXWARE                    0x0062 /* Voxware Inc */
-#define  WAVE_FORMAT_CANOPUS_ATRAC              0x0063 /* Canopus, co., Ltd. */
-#define  WAVE_FORMAT_G726_ADPCM                 0x0064 /* APICOM */
-#define  WAVE_FORMAT_G722_ADPCM                 0x0065 /* APICOM */
-#define  WAVE_FORMAT_DSAT_DISPLAY               0x0067 /* Microsoft Corporation */
-#define  WAVE_FORMAT_VOXWARE_BYTE_ALIGNED       0x0069 /* Voxware Inc */
-#define  WAVE_FORMAT_VOXWARE_AC8                0x0070 /* Voxware Inc */
-#define  WAVE_FORMAT_VOXWARE_AC10               0x0071 /* Voxware Inc */
-#define  WAVE_FORMAT_VOXWARE_AC16               0x0072 /* Voxware Inc */
-#define  WAVE_FORMAT_VOXWARE_AC20               0x0073 /* Voxware Inc */
-#define  WAVE_FORMAT_VOXWARE_RT24               0x0074 /* Voxware Inc */
-#define  WAVE_FORMAT_VOXWARE_RT29               0x0075 /* Voxware Inc */
-#define  WAVE_FORMAT_VOXWARE_RT29HW             0x0076 /* Voxware Inc */
-#define  WAVE_FORMAT_VOXWARE_VR12               0x0077 /* Voxware Inc */
-#define  WAVE_FORMAT_VOXWARE_VR18               0x0078 /* Voxware Inc */
-#define  WAVE_FORMAT_VOXWARE_TQ40               0x0079 /* Voxware Inc */
-#define  WAVE_FORMAT_SOFTSOUND                  0x0080 /* Softsound, Ltd. */
-#define  WAVE_FORMAT_VOXWARE_TQ60               0x0081 /* Voxware Inc */
-#define  WAVE_FORMAT_MSRT24                     0x0082 /* Microsoft Corporation */
-#define  WAVE_FORMAT_G729A                      0x0083 /* AT&T Labs, Inc. */
-#define  WAVE_FORMAT_MVI_MVI2                   0x0084 /* Motion Pixels */
-#define  WAVE_FORMAT_DF_G726                    0x0085 /* DataFusion Systems (Pty) (Ltd) */
-#define  WAVE_FORMAT_DF_GSM610                  0x0086 /* DataFusion Systems (Pty) (Ltd) */
-#define  WAVE_FORMAT_ISIAUDIO                   0x0088 /* Iterated Systems, Inc. */
-#define  WAVE_FORMAT_ONLIVE                     0x0089 /* OnLive! Technologies, Inc. */
-#define  WAVE_FORMAT_SBC24                      0x0091 /* Siemens Business Communications Sys */
-#define  WAVE_FORMAT_DOLBY_AC3_SPDIF            0x0092 /* Sonic Foundry */
-#define  WAVE_FORMAT_MEDIASONIC_G723            0x0093 /* MediaSonic */
-#define  WAVE_FORMAT_PROSODY_8KBPS              0x0094 /* Aculab plc */
-#define  WAVE_FORMAT_ZYXEL_ADPCM                0x0097 /* ZyXEL Communications, Inc. */
-#define  WAVE_FORMAT_PHILIPS_LPCBB              0x0098 /* Philips Speech Processing */
-#define  WAVE_FORMAT_PACKED                     0x0099 /* Studer Professional Audio AG */
-#define  WAVE_FORMAT_MALDEN_PHONYTALK           0x00A0 /* Malden Electronics Ltd. */
-#define  WAVE_FORMAT_RHETOREX_ADPCM             0x0100 /* Rhetorex Inc. */
-#define  WAVE_FORMAT_IRAT                       0x0101 /* BeCubed Software Inc. */
-#define  WAVE_FORMAT_VIVO_G723                  0x0111 /* Vivo Software */
-#define  WAVE_FORMAT_VIVO_SIREN                 0x0112 /* Vivo Software */
-#define  WAVE_FORMAT_DIGITAL_G723               0x0123 /* Digital Equipment Corporation */
-#define  WAVE_FORMAT_SANYO_LD_ADPCM             0x0125 /* Sanyo Electric Co., Ltd. */
-#define  WAVE_FORMAT_SIPROLAB_ACEPLNET          0x0130 /* Sipro Lab Telecom Inc. */
-#define  WAVE_FORMAT_SIPROLAB_ACELP4800         0x0131 /* Sipro Lab Telecom Inc. */
-#define  WAVE_FORMAT_SIPROLAB_ACELP8V3          0x0132 /* Sipro Lab Telecom Inc. */
-#define  WAVE_FORMAT_SIPROLAB_G729              0x0133 /* Sipro Lab Telecom Inc. */
-#define  WAVE_FORMAT_SIPROLAB_G729A             0x0134 /* Sipro Lab Telecom Inc. */
-#define  WAVE_FORMAT_SIPROLAB_KELVIN            0x0135 /* Sipro Lab Telecom Inc. */
-#define  WAVE_FORMAT_G726ADPCM                  0x0140 /* Dictaphone Corporation */
-#define  WAVE_FORMAT_QUALCOMM_PUREVOICE         0x0150 /* Qualcomm, Inc. */
-#define  WAVE_FORMAT_QUALCOMM_HALFRATE          0x0151 /* Qualcomm, Inc. */
-#define  WAVE_FORMAT_TUBGSM                     0x0155 /* Ring Zero Systems, Inc. */
-#define  WAVE_FORMAT_MSAUDIO1                   0x0160 /* Microsoft Corporation */
-#define  WAVE_FORMAT_CREATIVE_ADPCM             0x0200 /* Creative Labs, Inc */
-#define  WAVE_FORMAT_CREATIVE_FASTSPEECH8       0x0202 /* Creative Labs, Inc */
-#define  WAVE_FORMAT_CREATIVE_FASTSPEECH10      0x0203 /* Creative Labs, Inc */
-#define  WAVE_FORMAT_UHER_ADPCM                 0x0210 /* UHER informatic GmbH */
-#define  WAVE_FORMAT_QUARTERDECK                0x0220 /* Quarterdeck Corporation */
-#define  WAVE_FORMAT_ILINK_VC                   0x0230 /* I-link Worldwide */
-#define  WAVE_FORMAT_RAW_SPORT                  0x0240 /* Aureal Semiconductor */
-#define  WAVE_FORMAT_IPI_HSX                    0x0250 /* Interactive Products, Inc. */
-#define  WAVE_FORMAT_IPI_RPELP                  0x0251 /* Interactive Products, Inc. */
-#define  WAVE_FORMAT_CS2                        0x0260 /* Consistent Software */
-#define  WAVE_FORMAT_SONY_SCX                   0x0270 /* Sony Corp. */
-#define  WAVE_FORMAT_FM_TOWNS_SND               0x0300 /* Fujitsu Corp. */
-#define  WAVE_FORMAT_BTV_DIGITAL                0x0400 /* Brooktree Corporation */
-#define  WAVE_FORMAT_QDESIGN_MUSIC              0x0450 /* QDesign Corporation */
-#define  WAVE_FORMAT_VME_VMPCM                  0x0680 /* AT&T Labs, Inc. */
-#define  WAVE_FORMAT_TPC                        0x0681 /* AT&T Labs, Inc. */
-#define  WAVE_FORMAT_OLIGSM                     0x1000 /* Ing C. Olivetti & C., S.p.A. */
-#define  WAVE_FORMAT_OLIADPCM                   0x1001 /* Ing C. Olivetti & C., S.p.A. */
-#define  WAVE_FORMAT_OLICELP                    0x1002 /* Ing C. Olivetti & C., S.p.A. */
-#define  WAVE_FORMAT_OLISBC                     0x1003 /* Ing C. Olivetti & C., S.p.A. */
-#define  WAVE_FORMAT_OLIOPR                     0x1004 /* Ing C. Olivetti & C., S.p.A. */
-#define  WAVE_FORMAT_LH_CODEC                   0x1100 /* Lernout & Hauspie */
-#define  WAVE_FORMAT_NORRIS                     0x1400 /* Norris Communications, Inc. */
-#define  WAVE_FORMAT_SOUNDSPACE_MUSICOMPRESS    0x1500 /* AT&T Labs, Inc. */
-#define  WAVE_FORMAT_DVM                        0x2000 /* FAST Multimedia AG */
-
-#if !defined(WAVE_FORMAT_EXTENSIBLE)
-#define  WAVE_FORMAT_EXTENSIBLE                 0xFFFE /* Microsoft */
-#endif // !defined(WAVE_FORMAT_EXTENSIBLE)
-//
-//  the WAVE_FORMAT_DEVELOPMENT format tag can be used during the
-//  development phase of a new wave format.  Before shipping, you MUST
-//  acquire an official format tag from Microsoft.
-//
-#define WAVE_FORMAT_DEVELOPMENT         (0xFFFF)
-
-
-#endif /* __WINE_MMREG_H */
diff --git a/modules/codec/loader/wine/module.h b/modules/codec/loader/wine/module.h
deleted file mode 100644 (file)
index 6f6b31a..0000000
+++ /dev/null
@@ -1,149 +0,0 @@
-/*
- * Module definitions
- *
- * Copyright 1995 Alexandre Julliard
- */
-
-#ifndef __WINE_MODULE_H
-#define __WINE_MODULE_H
-
-#include "windef.h"
-#include "pe_image.h"
-
-
-typedef struct {
-    BYTE type;
-    BYTE flags;
-    BYTE segnum;
-    WORD offs WINE_PACKED;
-} ET_ENTRY;
-
-typedef struct {
-    WORD first; /* ordinal */
-    WORD last; /* ordinal */
-    WORD next; /* bundle */
-} ET_BUNDLE;
-
-
-  /* In-memory segment table */
-typedef struct
-{
-    WORD      filepos;   /* Position in file, in sectors */
-    WORD      size;      /* Segment size on disk */
-    WORD      flags;     /* Segment flags */
-    WORD      minsize;   /* Min. size of segment in memory */
-    HANDLE16  hSeg;      /* Selector or handle (selector - 1) */
-                         /* of segment in memory */
-} SEGTABLEENTRY;
-
-
-  /* Self-loading modules contain this structure in their first segment */
-
-#include "pshpack1.h"
-
-typedef struct
-{
-    WORD      version;       /* Must be "A0" (0x3041) */
-    WORD      reserved;
-    FARPROC16 BootApp;       /* startup procedure */
-    FARPROC16 LoadAppSeg;    /* procedure to load a segment */
-    FARPROC16 reserved2;
-    FARPROC16 MyAlloc;       /* memory allocation procedure, 
-                              * wine must write this field */
-    FARPROC16 EntryAddrProc;
-    FARPROC16 ExitProc;      /* exit procedure */
-    WORD      reserved3[4];
-    FARPROC16 SetOwner;      /* Set Owner procedure, exported by wine */
-} SELFLOADHEADER;
-
-  /* Parameters for LoadModule() */
-typedef struct
-{
-    HGLOBAL16 hEnvironment;         /* Environment segment */
-    SEGPTR    cmdLine WINE_PACKED;  /* Command-line */
-    SEGPTR    showCmd WINE_PACKED;  /* Code for ShowWindow() */
-    SEGPTR    reserved WINE_PACKED;
-} LOADPARAMS16;
-
-typedef struct 
-{
-    LPSTR lpEnvAddress;
-    LPSTR lpCmdLine;
-    UINT16 *lpCmdShow;
-    DWORD dwReserved;
-} LOADPARAMS;
-
-#include "poppack.h"
-
-/* internal representation of 32bit modules. per process. */
-typedef enum {
-       MODULE32_PE = 1,
-       MODULE32_ELF,
-       MODULE32_ELFDLL
-} MODULE32_TYPE;
-
-typedef struct _wine_modref
-{
-       struct _wine_modref     *next;
-       struct _wine_modref     *prev;
-       MODULE32_TYPE           type;
-       union {
-               PE_MODREF       pe;
-               ELF_MODREF      elf;
-       } binfmt;
-
-       HMODULE                 module;
-
-       int                     nDeps;
-       struct _wine_modref     **deps;
-
-       int                     flags;
-       int                     refCount;
-
-       char                    *filename;
-       char                    *modname;
-       char                    *short_filename;
-       char                    *short_modname;
-} WINE_MODREF;
-
-#define WINE_MODREF_INTERNAL              0x00000001
-#define WINE_MODREF_NO_DLL_CALLS          0x00000002
-#define WINE_MODREF_PROCESS_ATTACHED      0x00000004
-#define WINE_MODREF_LOAD_AS_DATAFILE      0x00000010
-#define WINE_MODREF_DONT_RESOLVE_REFS     0x00000020
-#define WINE_MODREF_MARKER                0x80000000
-
-
-
-/* Resource types */
-typedef struct resource_typeinfo_s NE_TYPEINFO;
-typedef struct resource_nameinfo_s NE_NAMEINFO;
-
-#define NE_SEG_TABLE(pModule) \
-    ((SEGTABLEENTRY *)((char *)(pModule) + (pModule)->seg_table))
-
-#define NE_MODULE_TABLE(pModule) \
-    ((WORD *)((char *)(pModule) + (pModule)->modref_table))
-
-#define NE_MODULE_NAME(pModule) \
-    (((OFSTRUCT *)((char*)(pModule) + (pModule)->fileinfo))->szPathName)
-
-struct modref_list_t;
-
-typedef struct modref_list_t
-{
-    WINE_MODREF* wm;
-    struct modref_list_t *next;
-    struct modref_list_t *prev;
-} modref_list;
-
-
-/* module.c */
-extern FARPROC MODULE_GetProcAddress( HMODULE hModule, LPCSTR function, WIN_BOOL snoop );
-extern WINE_MODREF *MODULE32_LookupHMODULE( HMODULE hModule );
-extern WINE_MODREF *MODULE_FindModule( LPCSTR path );
-
-/* resource.c */
-extern INT       WINAPI AccessResource(HMODULE,HRSRC); 
-
-#endif  /* __WINE_MODULE_H */
diff --git a/modules/codec/loader/wine/msacm.h b/modules/codec/loader/wine/msacm.h
deleted file mode 100644 (file)
index 10e87e6..0000000
+++ /dev/null
@@ -1,943 +0,0 @@
-/*
- *      msacm.h   -       Declarations for MSACM
- */
-
-#ifndef __WINE_MSACM_H
-#define __WINE_MSACM_H
-
-#include "windef.h"
-#include "driver.h"
-#include "mmreg.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif /* defined(__cplusplus) */
-
-//typedef WORD    VERSION;        /* major (high byte), minor (low byte) */
-
-typedef UINT16 MMVERSION16;
-typedef UINT   MMVERSION;
-typedef UINT16 MCIDEVICEID16;
-typedef UINT   MCIDEVICEID;
-typedef        UINT16  MMRESULT16;
-typedef        UINT    MMRESULT;
-typedef DWORD           FOURCC;         /* a four character code */
-
-
-
-#if !defined(WAVE_FORMAT_PCM)
-#define WAVE_FORMAT_PCM     1
-#endif
-
-/***********************************************************************
- * Defines/Enums
- */
-
-#define ACMERR_BASE        512
-#define ACMERR_NOTPOSSIBLE (ACMERR_BASE + 0)
-#define ACMERR_BUSY        (ACMERR_BASE + 1)
-#define ACMERR_UNPREPARED  (ACMERR_BASE + 2)
-#define ACMERR_CANCELED    (ACMERR_BASE + 3)
-
-#define MM_ACM_OPEN  MM_STREAM_OPEN
-#define MM_ACM_CLOSE MM_STREAM_CLOSE
-#define MM_ACM_DONE  MM_STREAM_DONE
-
-#define ACM_DRIVERADDF_FUNCTION   0x00000003L
-#define ACM_DRIVERADDF_NOTIFYHWND 0x00000004L
-#define ACM_DRIVERADDF_TYPEMASK   0x00000007L
-#define ACM_DRIVERADDF_LOCAL      0x00000000L
-#define ACM_DRIVERADDF_GLOBAL     0x00000008L
-
-#define ACMDRIVERDETAILS_SHORTNAME_CHARS  32
-#define ACMDRIVERDETAILS_LONGNAME_CHARS  128
-#define ACMDRIVERDETAILS_COPYRIGHT_CHARS  80
-#define ACMDRIVERDETAILS_LICENSING_CHARS 128
-#define ACMDRIVERDETAILS_FEATURES_CHARS  512
-
-#define ACMDRIVERDETAILS_FCCTYPE_AUDIOCODEC mmioFOURCC('a', 'u', 'd', 'c')
-#define ACMDRIVERDETAILS_FCCCOMP_UNDEFINED  mmioFOURCC('\0', '\0', '\0', '\0')
-
-#define ACMDRIVERDETAILS_SUPPORTF_CODEC     0x00000001L
-#define ACMDRIVERDETAILS_SUPPORTF_CONVERTER 0x00000002L
-#define ACMDRIVERDETAILS_SUPPORTF_FILTER    0x00000004L
-#define ACMDRIVERDETAILS_SUPPORTF_HARDWARE  0x00000008L
-#define ACMDRIVERDETAILS_SUPPORTF_ASYNC     0x00000010L
-#define ACMDRIVERDETAILS_SUPPORTF_LOCAL     0x40000000L
-#define ACMDRIVERDETAILS_SUPPORTF_DISABLED  0x80000000L
-
-#define ACM_DRIVERENUMF_NOLOCAL  0x40000000L
-#define ACM_DRIVERENUMF_DISABLED 0x80000000L
-
-#define ACM_DRIVERPRIORITYF_ENABLE    0x00000001L
-#define ACM_DRIVERPRIORITYF_DISABLE   0x00000002L
-#define ACM_DRIVERPRIORITYF_ABLEMASK  0x00000003L
-#define ACM_DRIVERPRIORITYF_BEGIN     0x00010000L
-#define ACM_DRIVERPRIORITYF_END       0x00020000L
-#define ACM_DRIVERPRIORITYF_DEFERMASK 0x00030000L
-
-#define MM_ACM_FILTERCHOOSE 0x8000
-
-#define FILTERCHOOSE_MESSAGE          0
-#define FILTERCHOOSE_FILTERTAG_VERIFY (FILTERCHOOSE_MESSAGE+0)
-#define FILTERCHOOSE_FILTER_VERIFY    (FILTERCHOOSE_MESSAGE+1)
-#define FILTERCHOOSE_CUSTOM_VERIFY    (FILTERCHOOSE_MESSAGE+2)
-
-#define ACMFILTERCHOOSE_STYLEF_SHOWHELP             0x00000004L
-#define ACMFILTERCHOOSE_STYLEF_ENABLEHOOK           0x00000008L
-#define ACMFILTERCHOOSE_STYLEF_ENABLETEMPLATE       0x00000010L
-#define ACMFILTERCHOOSE_STYLEF_ENABLETEMPLATEHANDLE 0x00000020L
-#define ACMFILTERCHOOSE_STYLEF_INITTOFILTERSTRUCT   0x00000040L
-#define ACMFILTERCHOOSE_STYLEF_CONTEXTHELP          0x00000080L
-
-#define ACMFILTERDETAILS_FILTER_CHARS 128
-
-#define ACM_FILTERDETAILSF_INDEX     0x00000000L
-#define ACM_FILTERDETAILSF_FILTER    0x00000001L
-#define ACM_FILTERDETAILSF_QUERYMASK 0x0000000FL
-
-#define ACMFILTERTAGDETAILS_FILTERTAG_CHARS 48
-
-#define ACM_FILTERTAGDETAILSF_INDEX       0x00000000L
-#define ACM_FILTERTAGDETAILSF_FILTERTAG   0x00000001L
-#define ACM_FILTERTAGDETAILSF_LARGESTSIZE 0x00000002L
-#define ACM_FILTERTAGDETAILSF_QUERYMASK   0x0000000FL
-
-#define ACM_FILTERENUMF_DWFILTERTAG 0x00010000L
-
-#define ACMHELPMSGSTRINGA       "acmchoose_help"
-#define ACMHELPMSGSTRINGW       L"acmchoose_help"
-#define ACMHELPMSGSTRING16       "acmchoose_help"
-
-#define ACMHELPMSGCONTEXTMENUA  "acmchoose_contextmenu"
-#define ACMHELPMSGCONTEXTMENUW  L"acmchoose_contextmenu"
-#define ACMHELPMSGCONTEXTMENU16   "acmchoose_contextmenu"
-
-#define ACMHELPMSGCONTEXTHELPA  "acmchoose_contexthelp"
-#define ACMHELPMSGCONTEXTHELPW  L"acmchoose_contexthelp"
-#define ACMHELPMSGCONTEXTHELP16   "acmchoose_contexthelp"
-
-#define MM_ACM_FORMATCHOOSE 0x8000
-
-#define FORMATCHOOSE_MESSAGE          0
-#define FORMATCHOOSE_FORMATTAG_VERIFY (FORMATCHOOSE_MESSAGE+0)
-#define FORMATCHOOSE_FORMAT_VERIFY    (FORMATCHOOSE_MESSAGE+1)
-#define FORMATCHOOSE_CUSTOM_VERIFY    (FORMATCHOOSE_MESSAGE+2)
-
-#define ACMFORMATCHOOSE_STYLEF_SHOWHELP             0x00000004L
-#define ACMFORMATCHOOSE_STYLEF_ENABLEHOOK           0x00000008L
-#define ACMFORMATCHOOSE_STYLEF_ENABLETEMPLATE       0x00000010L
-#define ACMFORMATCHOOSE_STYLEF_ENABLETEMPLATEHANDLE 0x00000020L
-#define ACMFORMATCHOOSE_STYLEF_INITTOWFXSTRUCT      0x00000040L
-#define ACMFORMATCHOOSE_STYLEF_CONTEXTHELP          0x00000080L
-
-#define ACMFORMATDETAILS_FORMAT_CHARS   128
-
-#define ACM_FORMATDETAILSF_INDEX     0x00000000L
-#define ACM_FORMATDETAILSF_FORMAT    0x00000001L
-#define ACM_FORMATDETAILSF_QUERYMASK 0x0000000FL
-
-#define ACM_FORMATENUMF_WFORMATTAG     0x00010000L
-#define ACM_FORMATENUMF_NCHANNELS      0x00020000L
-#define ACM_FORMATENUMF_NSAMPLESPERSEC 0x00040000L
-#define ACM_FORMATENUMF_WBITSPERSAMPLE 0x00080000L
-#define ACM_FORMATENUMF_CONVERT        0x00100000L
-#define ACM_FORMATENUMF_SUGGEST        0x00200000L
-#define ACM_FORMATENUMF_HARDWARE       0x00400000L
-#define ACM_FORMATENUMF_INPUT          0x00800000L
-#define ACM_FORMATENUMF_OUTPUT         0x01000000L
-
-#define ACM_FORMATSUGGESTF_WFORMATTAG     0x00010000L
-#define ACM_FORMATSUGGESTF_NCHANNELS      0x00020000L
-#define ACM_FORMATSUGGESTF_NSAMPLESPERSEC 0x00040000L
-#define ACM_FORMATSUGGESTF_WBITSPERSAMPLE 0x00080000L
-#define ACM_FORMATSUGGESTF_TYPEMASK       0x00FF0000L
-
-#define ACMFORMATTAGDETAILS_FORMATTAG_CHARS 48
-
-#define ACM_FORMATTAGDETAILSF_INDEX       0x00000000L
-#define ACM_FORMATTAGDETAILSF_FORMATTAG   0x00000001L
-#define ACM_FORMATTAGDETAILSF_LARGESTSIZE 0x00000002L
-#define ACM_FORMATTAGDETAILSF_QUERYMASK   0x0000000FL
-
-#define ACM_METRIC_COUNT_DRIVERS            1
-#define ACM_METRIC_COUNT_CODECS             2
-#define ACM_METRIC_COUNT_CONVERTERS         3
-#define ACM_METRIC_COUNT_FILTERS            4
-#define ACM_METRIC_COUNT_DISABLED           5
-#define ACM_METRIC_COUNT_HARDWARE           6
-#define ACM_METRIC_COUNT_LOCAL_DRIVERS     20
-#define ACM_METRIC_COUNT_LOCAL_CODECS      21
-#define ACM_METRIC_COUNT_LOCAL_CONVERTERS  22
-#define ACM_METRIC_COUNT_LOCAL_FILTERS     23
-#define ACM_METRIC_COUNT_LOCAL_DISABLED    24
-#define ACM_METRIC_HARDWARE_WAVE_INPUT     30
-#define ACM_METRIC_HARDWARE_WAVE_OUTPUT    31
-#define ACM_METRIC_MAX_SIZE_FORMAT         50
-#define ACM_METRIC_MAX_SIZE_FILTER         51
-#define ACM_METRIC_DRIVER_SUPPORT         100
-#define ACM_METRIC_DRIVER_PRIORITY        101
-
-#define ACM_STREAMCONVERTF_BLOCKALIGN 0x00000004
-#define ACM_STREAMCONVERTF_START      0x00000010
-#define ACM_STREAMCONVERTF_END        0x00000020
-
-#define ACMSTREAMHEADER_STATUSF_DONE     0x00010000L
-#define ACMSTREAMHEADER_STATUSF_PREPARED 0x00020000L
-#define ACMSTREAMHEADER_STATUSF_INQUEUE  0x00100000L
-
-#define ACM_STREAMOPENF_QUERY       0x00000001
-#define ACM_STREAMOPENF_ASYNC       0x00000002
-#define ACM_STREAMOPENF_NONREALTIME 0x00000004
-
-#define ACM_STREAMSIZEF_SOURCE      0x00000000L
-#define ACM_STREAMSIZEF_DESTINATION 0x00000001L
-#define ACM_STREAMSIZEF_QUERYMASK   0x0000000FL
-
-#define ACMDM_USER                  (DRV_USER + 0x0000)
-#define ACMDM_RESERVED_LOW          (DRV_USER + 0x2000)
-#define ACMDM_RESERVED_HIGH         (DRV_USER + 0x2FFF)
-
-#define ACMDM_BASE                  ACMDM_RESERVED_LOW
-
-#define ACMDM_DRIVER_ABOUT          (ACMDM_BASE + 11)
-
-/***********************************************************************
- * Callbacks
- */
-
-typedef WIN_BOOL CALLBACK ( *ACMDRIVERENUMCB)(
-  HACMDRIVERID hadid, DWORD dwInstance, DWORD fdwSupport
-);
-
-typedef WIN_BOOL16 CALLBACK ( *ACMDRIVERENUMCB16)(
-  HACMDRIVERID16 hadid, DWORD dwInstance, DWORD fdwSupport
-);
-
-typedef UINT CALLBACK ( *ACMFILTERCHOOSEHOOKPROCA)(
-  HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam
-);
-
-typedef UINT CALLBACK ( *ACMFILTERCHOOSEHOOKPROCW)(
-  HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam
-);
-
-typedef UINT CALLBACK ( *ACMFILTERCHOOSEHOOKPROC16)(
-  HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam
-);
-
-typedef UINT CALLBACK ( *ACMFORMATCHOOSEHOOKPROCA)(
-  HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam
-);
-
-typedef UINT CALLBACK ( *ACMFORMATCHOOSEHOOKPROCW)(
-  HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam
-);
-
-typedef UINT16 CALLBACK ( *ACMFORMATCHOOSEHOOKPROC16)(
-  HWND16 hwnd, UINT16 uMsg, WPARAM16 wParam, LPARAM lParam
-);
-
-/***********************************************************************
- * Structures
- */
-
-typedef struct _ACMDRIVERDETAILSA
-{
-  DWORD    cbStruct;
-
-  FOURCC   fccType;
-  FOURCC   fccComp;
-
-  WORD     wMid;
-  WORD     wPid;
-
-  DWORD    vdwACM;
-  DWORD    vdwDriver;
-
-  DWORD    fdwSupport;
-  DWORD    cFormatTags;
-  DWORD    cFilterTags;
-
-  HICON  hicon;
-
-  CHAR     szShortName[ACMDRIVERDETAILS_SHORTNAME_CHARS];
-  CHAR     szLongName[ACMDRIVERDETAILS_LONGNAME_CHARS];
-  CHAR     szCopyright[ACMDRIVERDETAILS_COPYRIGHT_CHARS];
-  CHAR     szLicensing[ACMDRIVERDETAILS_LICENSING_CHARS];
-  CHAR     szFeatures[ACMDRIVERDETAILS_FEATURES_CHARS];
-} ACMDRIVERDETAILSA, *PACMDRIVERDETAILSA;
-
-typedef struct _ACMDRIVERDETAILSW
-{
-  DWORD    cbStruct;
-
-  FOURCC   fccType;
-  FOURCC   fccComp;
-
-  WORD     wMid;
-  WORD     wPid;
-
-  DWORD    vdwACM;
-  DWORD    vdwDriver;
-
-  DWORD    fdwSupport;
-  DWORD    cFormatTags;
-  DWORD    cFilterTags;
-
-  HICON  hicon;
-
-  WCHAR    szShortName[ACMDRIVERDETAILS_SHORTNAME_CHARS];
-  WCHAR    szLongName[ACMDRIVERDETAILS_LONGNAME_CHARS];
-  WCHAR    szCopyright[ACMDRIVERDETAILS_COPYRIGHT_CHARS];
-  WCHAR    szLicensing[ACMDRIVERDETAILS_LICENSING_CHARS];
-  WCHAR    szFeatures[ACMDRIVERDETAILS_FEATURES_CHARS];
-} ACMDRIVERDETAILSW, *PACMDRIVERDETAILSW;
-
-typedef struct _ACMDRIVERDETAILS16
-{
-  DWORD   cbStruct;
-
-  FOURCC  fccType;
-  FOURCC  fccComp;
-
-  WORD    wMid;
-  WORD    wPid;
-
-  DWORD   vdwACM;
-  DWORD   vdwDriver;
-
-  DWORD   fdwSupport;
-  DWORD   cFormatTags;
-  DWORD   cFilterTags;
-
-  HICON16 hicon;
-
-  CHAR    szShortName[ACMDRIVERDETAILS_SHORTNAME_CHARS];
-  CHAR    szLongName[ACMDRIVERDETAILS_LONGNAME_CHARS];
-  CHAR    szCopyright[ACMDRIVERDETAILS_COPYRIGHT_CHARS];
-  CHAR    szLicensing[ACMDRIVERDETAILS_LICENSING_CHARS];
-  CHAR    szFeatures[ACMDRIVERDETAILS_FEATURES_CHARS];
-} ACMDRIVERDETAILS16, *NPACMDRIVERDETAILS16, *LPACMDRIVERDETAILS16;
-
-typedef struct _ACMFILTERCHOOSEA
-{
-  DWORD         cbStruct;
-  DWORD         fdwStyle;
-
-  HWND        hwndOwner;
-
-  PWAVEFILTER   pwfltr;
-  DWORD         cbwfltr;
-
-  LPCSTR        pszTitle;
-
-  CHAR          szFilterTag[ACMFILTERTAGDETAILS_FILTERTAG_CHARS];
-  CHAR          szFilter[ACMFILTERDETAILS_FILTER_CHARS];
-  LPSTR         pszName;
-  DWORD         cchName;
-
-  DWORD         fdwEnum;
-  PWAVEFILTER   pwfltrEnum;
-    
-  HINSTANCE   hInstance;
-  LPCSTR        pszTemplateName;
-  LPARAM        lCustData;
-  ACMFILTERCHOOSEHOOKPROCA pfnHook;
-} ACMFILTERCHOOSEA, *PACMFILTERCHOOSEA;
-
-typedef struct _ACMFILTERCHOOSEW
-{
-  DWORD         cbStruct;
-  DWORD         fdwStyle;
-
-  HWND        hwndOwner;
-
-  PWAVEFILTER   pwfltr;
-  DWORD         cbwfltr;
-
-  LPCWSTR       pszTitle;
-
-  WCHAR         szFilterTag[ACMFILTERTAGDETAILS_FILTERTAG_CHARS];
-  WCHAR         szFilter[ACMFILTERDETAILS_FILTER_CHARS];
-  LPWSTR        pszName;
-  DWORD         cchName;
-
-  DWORD         fdwEnum;
-  PWAVEFILTER   pwfltrEnum;
-    
-  HINSTANCE   hInstance;
-  LPCWSTR       pszTemplateName;
-  LPARAM        lCustData;
-  ACMFILTERCHOOSEHOOKPROCW pfnHook;
-} ACMFILTERCHOOSEW, *PACMFILTERCHOOSEW;
-
-typedef struct _ACMFILTERCHOOSE16
-{
-  DWORD          cbStruct;
-  DWORD          fdwStyle;
-
-  HWND16         hwndOwner;
-
-  LPWAVEFILTER   pwfltr;
-  DWORD          cbwfltr;
-
-  LPCSTR         pszTitle;
-
-  char           szFilterTag[ACMFILTERTAGDETAILS_FILTERTAG_CHARS];
-  char           szFilter[ACMFILTERDETAILS_FILTER_CHARS];
-  LPSTR          pszName;
-  DWORD          cchName;
-
-  DWORD          fdwEnum;
-  LPWAVEFILTER   pwfltrEnum;
-    
-  HINSTANCE16    hInstance;
-  LPCSTR         pszTemplateName;
-  LPARAM         lCustData;
-  ACMFILTERCHOOSEHOOKPROC16 pfnHook;
-} ACMFILTERCHOOSE16, *NPACMFILTERCHOOSE16, *LPACMFILTERCHOOSE16;
-
-typedef struct _ACMFILTERDETAILSA
-{
-  DWORD           cbStruct;
-  DWORD           dwFilterIndex;
-  DWORD           dwFilterTag;
-  DWORD           fdwSupport;
-  PWAVEFILTER     pwfltr;
-  DWORD           cbwfltr;
-  CHAR            szFilter[ACMFILTERDETAILS_FILTER_CHARS];
-} ACMFILTERDETAILSA, *PACMFILTERDETAILSA;
-
-typedef struct _ACMFILTERDETAILSW
-{
-  DWORD          cbStruct;
-  DWORD          dwFilterIndex;
-  DWORD          dwFilterTag;
-  DWORD          fdwSupport;
-  PWAVEFILTER    pwfltr;
-  DWORD          cbwfltr;
-  WCHAR          szFilter[ACMFILTERDETAILS_FILTER_CHARS];
-} ACMFILTERDETAILSW, *PACMFILTERDETAILSW;
-
-typedef struct _ACMFILTERDETAILS16
-{
-  DWORD          cbStruct;
-  DWORD          dwFilterIndex;
-  DWORD          dwFilterTag;
-  DWORD          fdwSupport;
-  LPWAVEFILTER   pwfltr;
-  DWORD          cbwfltr;
-  CHAR           szFilter[ACMFILTERDETAILS_FILTER_CHARS];
-} ACMFILTERDETAILS16, *NPACMFILTERDETAILS16, *LPACMFILTERDETAILS16;
-
-typedef struct _ACMFILTERTAGDETAILSA
-{
-  DWORD cbStruct;
-  DWORD dwFilterTagIndex;
-  DWORD dwFilterTag;
-  DWORD cbFilterSize;
-  DWORD fdwSupport;
-  DWORD cStandardFilters;
-  CHAR  szFilterTag[ACMFILTERTAGDETAILS_FILTERTAG_CHARS];
-} ACMFILTERTAGDETAILSA, *PACMFILTERTAGDETAILSA;
-
-typedef struct _ACMFILTERTAGDETAILSW
-{
-  DWORD cbStruct;
-  DWORD dwFilterTagIndex;
-  DWORD dwFilterTag;
-  DWORD cbFilterSize;
-  DWORD fdwSupport;
-  DWORD cStandardFilters;
-  WCHAR szFilterTag[ACMFILTERTAGDETAILS_FILTERTAG_CHARS];
-} ACMFILTERTAGDETAILSW, *PACMFILTERTAGDETAILSW;
-
-typedef struct _ACMFILTERTAGDETAILS16
-{
-  DWORD cbStruct;
-  DWORD dwFilterTagIndex;
-  DWORD dwFilterTag;
-  DWORD cbFilterSize;
-  DWORD fdwSupport;
-  DWORD cStandardFilters;
-  CHAR  szFilterTag[ACMFILTERTAGDETAILS_FILTERTAG_CHARS];
-} ACMFILTERTAGDETAILS16, *NPACMFILTERTAGDETAILS16, *LPACMFILTERTAGDETAILS16;
-
-typedef struct _ACMFORMATCHOOSEA
-{
-  DWORD           cbStruct;
-  DWORD           fdwStyle;
-  HWND          hwndOwner;
-
-  PWAVEFORMATEX   pwfx;
-  DWORD           cbwfx;
-  LPCSTR          pszTitle;
-    
-  CHAR            szFormatTag[ACMFORMATTAGDETAILS_FORMATTAG_CHARS];
-  CHAR            szFormat[ACMFORMATDETAILS_FORMAT_CHARS];    
-
-  LPSTR           pszName;
-  DWORD           cchName;
-
-  DWORD           fdwEnum;
-  PWAVEFORMATEX   pwfxEnum;
-    
-  HINSTANCE     hInstance;
-  LPCSTR          pszTemplateName;
-  LPARAM          lCustData;
-  ACMFORMATCHOOSEHOOKPROCA pfnHook;
-} ACMFORMATCHOOSEA, *PACMFORMATCHOOSEA;
-
-typedef struct _ACMFORMATCHOOSEW
-{
-  DWORD           cbStruct;
-  DWORD           fdwStyle;
-    
-  HWND          hwndOwner;
-
-  PWAVEFORMATEX   pwfx;
-  DWORD           cbwfx;
-  LPCWSTR         pszTitle;
-    
-  WCHAR           szFormatTag[ACMFORMATTAGDETAILS_FORMATTAG_CHARS];
-  WCHAR           szFormat[ACMFORMATDETAILS_FORMAT_CHARS];    
-
-  LPWSTR          pszName;
-  DWORD           cchName;
-
-  DWORD           fdwEnum;
-  LPWAVEFORMATEX  pwfxEnum;
-    
-  HINSTANCE     hInstance;
-  LPCWSTR         pszTemplateName;
-  LPARAM          lCustData;
-  ACMFORMATCHOOSEHOOKPROCW pfnHook;
-} ACMFORMATCHOOSEW, *PACMFORMATCHOOSEW;
-
-typedef struct _ACMFORMATCHOOSE16
-{
-  DWORD            cbStruct;
-  DWORD            fdwStyle;
-    
-  HWND16           hwndOwner;
-
-  LPWAVEFORMATEX   pwfx;
-  DWORD            cbwfx;
-  LPCSTR           pszTitle;
-    
-  CHAR             szFormatTag[ACMFORMATTAGDETAILS_FORMATTAG_CHARS];
-  CHAR             szFormat[ACMFORMATDETAILS_FORMAT_CHARS];    
-
-  LPSTR            pszName;
-  DWORD            cchName;
-
-  DWORD            fdwEnum;
-  LPWAVEFORMATEX   pwfxEnum;
-    
-  HINSTANCE16      hInstance;
-  LPCSTR           pszTemplateName;
-  LPARAM           lCustData;
-  ACMFORMATCHOOSEHOOKPROC16 pfnHook;
-} ACMFORMATCHOOSE16, *NPACMFORMATCHOOSE16, *LPACMFORMATCHOOSE16;
-
-typedef struct _ACMFORMATDETAILSA
-{
-  DWORD           cbStruct;
-  DWORD           dwFormatIndex;
-  DWORD           dwFormatTag;
-  DWORD           fdwSupport;
-  PWAVEFORMATEX   pwfx;
-  DWORD           cbwfx;
-  CHAR            szFormat[ACMFORMATDETAILS_FORMAT_CHARS];
-} ACMFORMATDETAILSA, *PACMFORMATDETAILSA;
-
-typedef struct _ACMFORMATDETAILSW
-{
-    DWORD           cbStruct;
-    DWORD           dwFormatIndex;
-    DWORD           dwFormatTag;
-    DWORD           fdwSupport;
-    PWAVEFORMATEX   pwfx;
-    DWORD           cbwfx;
-    WCHAR           szFormat[ACMFORMATDETAILS_FORMAT_CHARS];
-} ACMFORMATDETAILSW, *PACMFORMATDETAILSW;
-
-typedef struct _ACMFORMATDETAILS16
-{
-    DWORD            cbStruct;
-    DWORD            dwFormatIndex;
-    DWORD            dwFormatTag;
-    DWORD            fdwSupport;
-    LPWAVEFORMATEX   pwfx;
-    DWORD            cbwfx;
-    CHAR             szFormat[ACMFORMATDETAILS_FORMAT_CHARS];
-} ACMFORMATDETAILS16, *NPACMFORMATDETAILS16, *LPACMFORMATDETAILS16;
-
-typedef struct _ACMFORMATTAGDETAILSA
-{
-  DWORD cbStruct;
-  DWORD dwFormatTagIndex;
-  DWORD dwFormatTag;
-  DWORD cbFormatSize;
-  DWORD fdwSupport;
-  DWORD cStandardFormats;
-  CHAR  szFormatTag[ACMFORMATTAGDETAILS_FORMATTAG_CHARS];
-} ACMFORMATTAGDETAILSA, *PACMFORMATTAGDETAILSA;
-
-typedef struct _ACMFORMATTAGDETAILSW
-{
-  DWORD cbStruct;
-  DWORD dwFormatTagIndex;
-  DWORD dwFormatTag;
-  DWORD cbFormatSize;
-  DWORD fdwSupport;
-  DWORD cStandardFormats;
-  WCHAR szFormatTag[ACMFORMATTAGDETAILS_FORMATTAG_CHARS];
-} ACMFORMATTAGDETAILSW, *PACMFORMATTAGDETAILSW;
-
-typedef struct _ACMFORMATTAGDETAILS16
-{
-  DWORD cbStruct;
-  DWORD dwFormatTagIndex;
-  DWORD dwFormatTag;
-  DWORD cbFormatSize;
-  DWORD fdwSupport;
-  DWORD cStandardFormats;
-  CHAR  szFormatTag[ACMFORMATTAGDETAILS_FORMATTAG_CHARS];
-} ACMFORMATTAGDETAILS16, *NPACMFORMATTAGDETAILS16, *LPACMFORMATTAGDETAILS16;
-
-typedef struct _ACMSTREAMHEADER
-{
-  DWORD  cbStruct;
-  DWORD  fdwStatus;
-  DWORD  dwUser;
-  LPBYTE pbSrc;
-  DWORD  cbSrcLength;
-  DWORD  cbSrcLengthUsed;
-  DWORD  dwSrcUser;
-  LPBYTE pbDst;
-  DWORD  cbDstLength;
-  DWORD  cbDstLengthUsed;
-  DWORD  dwDstUser;
-  DWORD  dwReservedDriver[10];
-} ACMSTREAMHEADER16, *NPACMSTREAMHEADER16, *LPACMSTREAMHEADER16,
-  ACMSTREAMHEADER, *PACMSTREAMHEADER;
-
-/***********************************************************************
- * Callbacks 2
- */
-
-typedef WIN_BOOL CALLBACK ( *ACMFILTERENUMCBA)(
-  HACMDRIVERID hadid, PACMFILTERDETAILSA pafd,
-  DWORD dwInstance, DWORD fdwSupport
-);
-
-typedef WIN_BOOL CALLBACK ( *ACMFILTERENUMCBW)(
-  HACMDRIVERID hadid, PACMFILTERDETAILSW pafd,
-  DWORD dwInstance, DWORD fdwSupport
-);
-
-typedef WIN_BOOL16 CALLBACK ( *ACMFILTERENUMCB16)(
- HACMDRIVERID16 hadid, LPACMFILTERDETAILS16 pafd,
- DWORD dwInstance, DWORD fdwSupport
-);
-
-typedef WIN_BOOL CALLBACK ( *ACMFILTERTAGENUMCBA)(
-  HACMDRIVERID hadid, PACMFILTERTAGDETAILSA paftd,
-  DWORD dwInstance, DWORD fdwSupport
-);
-
-typedef WIN_BOOL CALLBACK ( *ACMFILTERTAGENUMCBW)(
-  HACMDRIVERID hadid, PACMFILTERTAGDETAILSW paftd,
-  DWORD dwInstance, DWORD fdwSupport
-);
-
-typedef WIN_BOOL16 CALLBACK ( *ACMFILTERTAGENUMCB16)(
-  HACMDRIVERID16 hadid, LPACMFILTERTAGDETAILS16 paftd,
-  DWORD dwInstance, DWORD fdwSupport
-);
-
-typedef WIN_BOOL CALLBACK ( *ACMFORMATENUMCBA)(
-  HACMDRIVERID hadid, PACMFORMATDETAILSA pafd,
-  DWORD dwInstance, DWORD fdwSupport
-);
-
-typedef WIN_BOOL CALLBACK ( *ACMFORMATENUMCBW)(
-  HACMDRIVERID hadid, PACMFORMATDETAILSW pafd,
-  DWORD dwInstance, DWORD fdwSupport
-);
-
-typedef WIN_BOOL16 CALLBACK ( *ACMFORMATENUMCB16)(
-  HACMDRIVERID16 hadid, LPACMFORMATDETAILS16 pafd,
-  DWORD dwInstance, DWORD fdwSupport
-);
-
-typedef WIN_BOOL CALLBACK ( *ACMFORMATTAGENUMCBA)(
-  HACMDRIVERID hadid, PACMFORMATTAGDETAILSA paftd,
-  DWORD dwInstance, DWORD fdwSupport
-);
-
-typedef WIN_BOOL CALLBACK ( *ACMFORMATTAGENUMCBW)(
-  HACMDRIVERID hadid, PACMFORMATTAGDETAILSW paftd,
-  DWORD dwInstance, DWORD fdwSupport
-);
-
-typedef WIN_BOOL16 CALLBACK ( *ACMFORMATTAGENUMCB16)(
-  HACMDRIVERID16 hadid, LPACMFORMATTAGDETAILS16 paftd,
-  DWORD dwInstance, DWORD fdwSupport
-);
-
-/***********************************************************************
- * Functions - Win16
- */
-
-DWORD WINAPI acmGetVersion16(
-);
-MMRESULT16 WINAPI acmMetrics16(
-  HACMOBJ16 hao, UINT16 uMetric, LPVOID pMetric
-);
-MMRESULT16 WINAPI acmDriverEnum16(
-  ACMDRIVERENUMCB16 fnCallback, DWORD dwInstance, DWORD fdwEnum
-);
-MMRESULT16 WINAPI acmDriverDetails16(
-  HACMDRIVERID16 hadid, LPACMDRIVERDETAILS16 padd, DWORD fdwDetails
-);
-MMRESULT16 WINAPI acmDriverAdd16(
-  LPHACMDRIVERID16 phadid, HINSTANCE16 hinstModule,
-  LPARAM lParam, DWORD dwPriority, DWORD fdwAdd
-);
-MMRESULT16 WINAPI acmDriverRemove16(
-  HACMDRIVERID16 hadid, DWORD fdwRemove
-);
-MMRESULT16 WINAPI acmDriverOpen16(
-  LPHACMDRIVER16 phad, HACMDRIVERID16 hadid, DWORD fdwOpen
-);
-MMRESULT16 WINAPI acmDriverClose16(
-  HACMDRIVER16 had, DWORD fdwClose
-);
-LRESULT WINAPI acmDriverMessage16(
-  HACMDRIVER16 had, UINT16 uMsg, LPARAM lParam1, LPARAM lParam2
-);
-MMRESULT16 WINAPI acmDriverID16(
-  HACMOBJ16 hao, LPHACMDRIVERID16 phadid, DWORD fdwDriverID
-);
-MMRESULT16 WINAPI acmDriverPriority16(
- HACMDRIVERID16 hadid, DWORD dwPriority, DWORD fdwPriority
-);
-MMRESULT16 WINAPI acmFormatTagDetails16(
-  HACMDRIVER16 had, LPACMFORMATTAGDETAILS16 paftd, DWORD fdwDetails
-);
-MMRESULT16 WINAPI acmFormatTagEnum16(
-  HACMDRIVER16 had, LPACMFORMATTAGDETAILS16 paftd,
-  ACMFORMATTAGENUMCB16 fnCallback, DWORD dwInstance, DWORD fdwEnum
-);
-MMRESULT16 WINAPI acmFormatChoose16(
-  LPACMFORMATCHOOSE16 pafmtc
-);
-MMRESULT16 WINAPI acmFormatDetails16(
-  HACMDRIVER16 had, LPACMFORMATDETAILS16 pafd, DWORD fdwDetails
-);
-MMRESULT16 WINAPI acmFormatEnum16(
-  HACMDRIVER16 had, LPACMFORMATDETAILS16 pafd,
-  ACMFORMATENUMCB16 fnCallback, DWORD dwInstance, DWORD fdwEnum
-);
-MMRESULT16 WINAPI acmFormatSuggest16(
-  HACMDRIVER16 had, LPWAVEFORMATEX pwfxSrc, 
-  LPWAVEFORMATEX pwfxDst, DWORD cbwfxDst, DWORD fdwSuggest
-);
-MMRESULT16 WINAPI acmFilterTagDetails16(
-  HACMDRIVER16 had, LPACMFILTERTAGDETAILS16 paftd, DWORD fdwDetails
-);
-MMRESULT16 WINAPI acmFilterTagEnum16(
-  HACMDRIVER16 had, LPACMFILTERTAGDETAILS16 paftd,
-  ACMFILTERTAGENUMCB16 fnCallback, DWORD dwInstance, DWORD fdwEnum
-);
-MMRESULT16 WINAPI acmFilterChoose16(
-  LPACMFILTERCHOOSE16 pafltrc
-);
-MMRESULT16 WINAPI acmFilterDetails16(
-  HACMDRIVER16 had, LPACMFILTERDETAILS16 pafd, DWORD fdwDetails
-);
-MMRESULT16 WINAPI acmFilterEnum16(
-  HACMDRIVER16 had, LPACMFILTERDETAILS16 pafd,
-  ACMFILTERENUMCB16 fnCallback, DWORD dwInstance, DWORD fdwEnum
-);
-MMRESULT16 WINAPI acmStreamOpen16(
-  LPHACMSTREAM16 phas, HACMDRIVER16 had,
-  LPWAVEFORMATEX pwfxSrc, LPWAVEFORMATEX pwfxDst,
-  LPWAVEFILTER pwfltr, DWORD dwCallback,
-  DWORD dwInstance, DWORD fdwOpen
-);
-MMRESULT16 WINAPI acmStreamClose16(
-  HACMSTREAM16 has, DWORD fdwClose
-);
-MMRESULT16 WINAPI acmStreamSize16(
-  HACMSTREAM16 has, DWORD cbInput, 
-  LPDWORD pdwOutputBytes, DWORD fdwSize
-);
-MMRESULT16 WINAPI acmStreamConvert16(
-  HACMSTREAM16 has, LPACMSTREAMHEADER16 pash, DWORD fdwConvert
-);
-MMRESULT16 WINAPI acmStreamReset16(
-  HACMSTREAM16 has, DWORD fdwReset
-);
-MMRESULT16 WINAPI acmStreamPrepareHeader16(
-  HACMSTREAM16 has, LPACMSTREAMHEADER16 pash, DWORD fdwPrepare
-);
-MMRESULT16 WINAPI acmStreamUnprepareHeader16(
-  HACMSTREAM16 has, LPACMSTREAMHEADER16 pash, DWORD fdwUnprepare
-);
-
-/***********************************************************************
- * Functions - Win32
- */
-
-MMRESULT WINAPI acmDriverAddA(
-  PHACMDRIVERID phadid, HINSTANCE hinstModule,
-  LPARAM lParam, DWORD dwPriority, DWORD fdwAdd
-);
-MMRESULT WINAPI acmDriverAddW(
-  PHACMDRIVERID phadid, HINSTANCE hinstModule,
-  LPARAM lParam, DWORD dwPriority, DWORD fdwAdd
-);
-MMRESULT WINAPI acmDriverClose(
-  HACMDRIVER had, DWORD fdwClose
-);
-MMRESULT WINAPI acmDriverDetailsA(
-  HACMDRIVERID hadid, PACMDRIVERDETAILSA padd, DWORD fdwDetails
-);
-MMRESULT WINAPI acmDriverDetailsW(
-  HACMDRIVERID hadid, PACMDRIVERDETAILSW padd, DWORD fdwDetails
-);
-MMRESULT WINAPI acmDriverEnum(
-  ACMDRIVERENUMCB fnCallback, DWORD dwInstance, DWORD fdwEnum
-);
-MMRESULT WINAPI acmDriverID(
-  HACMOBJ hao, PHACMDRIVERID phadid, DWORD fdwDriverID
-);
-LRESULT WINAPI acmDriverMessage(
-  HACMDRIVER had, UINT uMsg, LPARAM lParam1, LPARAM lParam2
-);
-MMRESULT WINAPI acmDriverOpen(
-  PHACMDRIVER phad, HACMDRIVERID hadid, DWORD fdwOpen
-);
-MMRESULT WINAPI acmDriverPriority(
-  HACMDRIVERID hadid, DWORD dwPriority, DWORD fdwPriority
-);
-MMRESULT WINAPI acmDriverRemove(
-  HACMDRIVERID hadid, DWORD fdwRemove
-);
-MMRESULT WINAPI acmFilterChooseA(
-  PACMFILTERCHOOSEA pafltrc
-);
-MMRESULT WINAPI acmFilterChooseW(
-  PACMFILTERCHOOSEW pafltrc
-);
-MMRESULT WINAPI acmFilterDetailsA(
-  HACMDRIVER had, PACMFILTERDETAILSA pafd, DWORD fdwDetails
-);
-MMRESULT WINAPI acmFilterDetailsW(
-  HACMDRIVER had, PACMFILTERDETAILSW pafd, DWORD fdwDetails
-);
-MMRESULT WINAPI acmFilterEnumA(
-  HACMDRIVER had, PACMFILTERDETAILSA pafd, 
-  ACMFILTERENUMCBA fnCallback, DWORD dwInstance, DWORD fdwEnum
-);
-MMRESULT WINAPI acmFilterEnumW(
-  HACMDRIVER had, PACMFILTERDETAILSW pafd, 
-  ACMFILTERENUMCBW fnCallback, DWORD dwInstance, DWORD fdwEnum
-);
-MMRESULT WINAPI acmFilterTagDetailsA(
-  HACMDRIVER had, PACMFILTERTAGDETAILSA paftd, DWORD fdwDetails
-);
-MMRESULT WINAPI acmFilterTagDetailsW(
-  HACMDRIVER had, PACMFILTERTAGDETAILSW paftd, DWORD fdwDetails
-);
-MMRESULT WINAPI acmFilterTagEnumA(
-  HACMDRIVER had, PACMFILTERTAGDETAILSA paftd,
-  ACMFILTERTAGENUMCBA fnCallback, DWORD dwInstance, DWORD fdwEnum
-);
-MMRESULT WINAPI acmFilterTagEnumW(
-  HACMDRIVER had, PACMFILTERTAGDETAILSW paftd,
-  ACMFILTERTAGENUMCBW fnCallback, DWORD dwInstance, DWORD fdwEnum
-);
-MMRESULT WINAPI acmFormatChooseA(
-  PACMFORMATCHOOSEA pafmtc
-);
-MMRESULT WINAPI acmFormatChooseW(
-  PACMFORMATCHOOSEW pafmtc
-);
-MMRESULT WINAPI acmFormatDetailsA(
-  HACMDRIVER had, PACMFORMATDETAILSA pafd, DWORD fdwDetails
-);
-MMRESULT WINAPI acmFormatDetailsW(
-  HACMDRIVER had, PACMFORMATDETAILSW pafd, DWORD fdwDetails
-);
-MMRESULT WINAPI acmFormatEnumA(
-  HACMDRIVER had, PACMFORMATDETAILSA pafd,
-  ACMFORMATENUMCBA fnCallback, DWORD dwInstance, DWORD fdwEnum
-);
-MMRESULT WINAPI acmFormatEnumW(
-  HACMDRIVER had, PACMFORMATDETAILSW pafd,
-  ACMFORMATENUMCBW fnCallback, DWORD dwInstance,  DWORD fdwEnum
-);
-MMRESULT WINAPI acmFormatSuggest(
-  HACMDRIVER had, PWAVEFORMATEX pwfxSrc, PWAVEFORMATEX pwfxDst,
-  DWORD cbwfxDst, DWORD fdwSuggest
-);
-MMRESULT WINAPI acmFormatTagDetailsA(
-  HACMDRIVER had, PACMFORMATTAGDETAILSA paftd, DWORD fdwDetails
-);
-MMRESULT WINAPI acmFormatTagDetailsW(
-  HACMDRIVER had, PACMFORMATTAGDETAILSW paftd, DWORD fdwDetails
-);
-MMRESULT WINAPI acmFormatTagEnumA(
-  HACMDRIVER had, PACMFORMATTAGDETAILSA paftd,
-  ACMFORMATTAGENUMCBA fnCallback, DWORD dwInstance, DWORD fdwEnum
-);
-MMRESULT WINAPI acmFormatTagEnumW(
-  HACMDRIVER had, PACMFORMATTAGDETAILSW paftd,
-  ACMFORMATTAGENUMCBW fnCallback, DWORD dwInstance, DWORD fdwEnum
-);
-DWORD WINAPI acmGetVersion(
-);
-MMRESULT WINAPI acmMetrics(
-  HACMOBJ hao, UINT  uMetric, LPVOID  pMetric
-);
-MMRESULT WINAPI acmStreamClose(
-  HACMSTREAM has, DWORD fdwClose
-);
-MMRESULT WINAPI acmStreamConvert(
-  HACMSTREAM has, PACMSTREAMHEADER pash, DWORD fdwConvert
-);
-MMRESULT WINAPI acmStreamMessage(
-  HACMSTREAM has, UINT uMsg, LPARAM lParam1, LPARAM lParam2
-);
-MMRESULT WINAPI acmStreamOpen(
-  PHACMSTREAM phas, HACMDRIVER had, PWAVEFORMATEX pwfxSrc,
-  PWAVEFORMATEX pwfxDst, PWAVEFILTER pwfltr, DWORD dwCallback,
-  DWORD dwInstance, DWORD fdwOpen
-);
-MMRESULT WINAPI acmStreamPrepareHeader(
-  HACMSTREAM has, PACMSTREAMHEADER pash, DWORD fdwPrepare
-);
-MMRESULT WINAPI acmStreamReset(
-  HACMSTREAM has, DWORD fdwReset
-);
-MMRESULT WINAPI acmStreamSize(
-  HACMSTREAM has, DWORD cbInput, 
-  LPDWORD pdwOutputBytes, DWORD fdwSize
-);
-MMRESULT WINAPI acmStreamUnprepareHeader(
-  HACMSTREAM has, PACMSTREAMHEADER pash, DWORD fdwUnprepare
-);
-
-#ifdef __cplusplus
-} /* extern "C" */
-#endif /* defined(__cplusplus) */
-
-#endif  /* __WINE_MSACM_H */
-
-
diff --git a/modules/codec/loader/wine/msacmdrv.h b/modules/codec/loader/wine/msacmdrv.h
deleted file mode 100644 (file)
index 2e23a17..0000000
+++ /dev/null
@@ -1,203 +0,0 @@
-/*
- *      msacmdrv.h   -       Declarations for MSACM driver
- */
-
-#ifndef __WINE_MSACMDRV_H
-#define __WINE_MSACMDRV_H
-
-#include "windef.h"
-#include "msacm.h"
-
-/***********************************************************************
- * Types
- */
-
-/***********************************************************************
- * Defines/Enums
- */
-
-#define MAKE_ACM_VERSION(mjr, mnr, bld) \
-  (((long)(mjr)<<24) | ((long)(mnr)<<16) | ((long)bld))
-
-#define ACMDRVOPENDESC_SECTIONNAME_CHARS    
-
-#define ACMDM_DRIVER_NOTIFY             (ACMDM_BASE + 1)
-#define ACMDM_DRIVER_DETAILS            (ACMDM_BASE + 10)
-
-#define ACMDM_HARDWARE_WAVE_CAPS_INPUT  (ACMDM_BASE + 20)
-#define ACMDM_HARDWARE_WAVE_CAPS_OUTPUT (ACMDM_BASE + 21)
-
-#define ACMDM_FORMATTAG_DETAILS         (ACMDM_BASE + 25)
-#define ACMDM_FORMAT_DETAILS            (ACMDM_BASE + 26)
-#define ACMDM_FORMAT_SUGGEST            (ACMDM_BASE + 27)
-
-#define ACMDM_FILTERTAG_DETAILS         (ACMDM_BASE + 50)
-#define ACMDM_FILTER_DETAILS            (ACMDM_BASE + 51)
-
-#define ACMDM_STREAM_OPEN               (ACMDM_BASE + 76)
-#define ACMDM_STREAM_CLOSE              (ACMDM_BASE + 77)
-#define ACMDM_STREAM_SIZE               (ACMDM_BASE + 78)
-#define ACMDM_STREAM_CONVERT            (ACMDM_BASE + 79)
-#define ACMDM_STREAM_RESET              (ACMDM_BASE + 80)
-#define ACMDM_STREAM_PREPARE            (ACMDM_BASE + 81)
-#define ACMDM_STREAM_UNPREPARE          (ACMDM_BASE + 82)
-#define ACMDM_STREAM_UPDATE             (ACMDM_BASE + 83)
-
-/***********************************************************************
- * Structures
- */
-
-typedef struct _ACMDRVOPENDESCA
-{
-  DWORD  cbStruct;
-  FOURCC fccType;
-  FOURCC fccComp;
-  DWORD  dwVersion;
-  DWORD  dwFlags;
-  DWORD  dwError;
-  LPCSTR pszSectionName;
-  LPCSTR pszAliasName;
-  DWORD  dnDevNode;
-} ACMDRVOPENDESCA, *PACMDRVOPENDESCA;
-
-typedef struct _ACMDRVOPENDESCW
-{
-  DWORD   cbStruct;
-  FOURCC  fccType;
-  FOURCC  fccComp;
-  DWORD   dwVersion;
-  DWORD   dwFlags;
-  DWORD   dwError;
-  LPCWSTR pszSectionName;
-  LPCWSTR pszAliasName;
-  DWORD   dnDevNode;
-} ACMDRVOPENDESCW, *PACMDRVOPENDESCW;
-
-typedef struct _ACMDRVOPENDESC16
-{
-  DWORD  cbStruct;
-  FOURCC fccType;
-  FOURCC fccComp;
-  DWORD  dwVersion;
-  DWORD  dwFlags;
-  DWORD  dwError;
-  LPCSTR pszSectionName;
-  LPCSTR pszAliasName;
-  DWORD  dnDevNode;
-} ACMDRVOPENDESC16, *NPACMDRVOPENDESC16, *LPACMDRVOPENDESC16;
-
-typedef struct _ACMDRVSTREAMINSTANCE16
-{
-  DWORD            cbStruct;
-  LPWAVEFORMATEX   pwfxSrc;
-  LPWAVEFORMATEX   pwfxDst;
-  LPWAVEFILTER     pwfltr;
-  DWORD            dwCallback;
-  DWORD            dwInstance;
-  DWORD            fdwOpen;
-  DWORD            fdwDriver;
-  DWORD            dwDriver;
-  HACMSTREAM16     has;
-} ACMDRVSTREAMINSTANCE16, *NPACMDRVSTREAMINSTANCE16, *LPACMDRVSTREAMINSTANCE16;
-
-typedef struct _ACMDRVSTREAMINSTANCE
-{
-  DWORD           cbStruct;
-  PWAVEFORMATEX   pwfxSrc;
-  PWAVEFORMATEX   pwfxDst;
-  PWAVEFILTER     pwfltr;
-  DWORD           dwCallback;
-  DWORD           dwInstance;
-  DWORD           fdwOpen;
-  DWORD           fdwDriver;
-  DWORD           dwDriver;
-  HACMSTREAM    has;
-} ACMDRVSTREAMINSTANCE, *PACMDRVSTREAMINSTANCE;
-
-
-typedef struct _ACMDRVSTREAMHEADER16 *LPACMDRVSTREAMHEADER16;
-typedef struct _ACMDRVSTREAMHEADER16 {
-  DWORD  cbStruct;
-  DWORD  fdwStatus;
-  DWORD  dwUser;
-  LPBYTE pbSrc;
-  DWORD  cbSrcLength;
-  DWORD  cbSrcLengthUsed;
-  DWORD  dwSrcUser;
-  LPBYTE pbDst;
-  DWORD  cbDstLength;
-  DWORD  cbDstLengthUsed;
-  DWORD  dwDstUser;
-
-  DWORD fdwConvert;
-  LPACMDRVSTREAMHEADER16 *padshNext;
-  DWORD fdwDriver;
-  DWORD dwDriver;
-
-  /* Internal fields for ACM */
-  DWORD  fdwPrepared;
-  DWORD  dwPrepared;
-  LPBYTE pbPreparedSrc;
-  DWORD  cbPreparedSrcLength;
-  LPBYTE pbPreparedDst;
-  DWORD  cbPreparedDstLength;
-} ACMDRVSTREAMHEADER16, *NPACMDRVSTREAMHEADER16;
-
-typedef struct _ACMDRVSTREAMHEADER *PACMDRVSTREAMHEADER;
-typedef struct _ACMDRVSTREAMHEADER {
-  DWORD  cbStruct;
-  DWORD  fdwStatus;
-  DWORD  dwUser;
-  LPBYTE pbSrc;
-  DWORD  cbSrcLength;
-  DWORD  cbSrcLengthUsed;
-  DWORD  dwSrcUser;
-  LPBYTE pbDst;
-  DWORD  cbDstLength;
-  DWORD  cbDstLengthUsed;
-  DWORD  dwDstUser;
-
-  DWORD fdwConvert;
-  PACMDRVSTREAMHEADER *padshNext;
-  DWORD fdwDriver;
-  DWORD dwDriver;
-
-  /* Internal fields for ACM */
-  DWORD  fdwPrepared;
-  DWORD  dwPrepared;
-  LPBYTE pbPreparedSrc;
-  DWORD  cbPreparedSrcLength;
-  LPBYTE pbPreparedDst;
-  DWORD  cbPreparedDstLength;
-} ACMDRVSTREAMHEADER;
-
-typedef struct _ACMDRVSTREAMSIZE
-{
-  DWORD cbStruct;
-  DWORD fdwSize;
-  DWORD cbSrcLength;
-  DWORD cbDstLength;
-} ACMDRVSTREAMSIZE16, *NPACMDRVSTREAMSIZE16, *LPACMDRVSTREAMSIZE16,
-  ACMDRVSTREAMSIZE, *PACMDRVSTREAMSIZE;
-
-typedef struct _ACMDRVFORMATSUGGEST16
-{
-  DWORD            cbStruct;
-  DWORD            fdwSuggest;
-  LPWAVEFORMATEX   pwfxSrc;
-  DWORD            cbwfxSrc;
-  LPWAVEFORMATEX   pwfxDst;
-  DWORD            cbwfxDst;
-} ACMDRVFORMATSUGGEST16, *NPACMDRVFORMATSUGGEST, *LPACMDRVFORMATSUGGEST;
-
-typedef struct _ACMDRVFORMATSUGGEST
-{
-  DWORD           cbStruct;
-  DWORD           fdwSuggest;
-  PWAVEFORMATEX   pwfxSrc;
-  DWORD           cbwfxSrc;
-  PWAVEFORMATEX   pwfxDst;
-  DWORD           cbwfxDst;
-} ACMDRVFORMATSUGGEST, *PACMDRVFORMATSUGGEST;
-
-#endif  /* __WINE_MSACMDRV_H */
diff --git a/modules/codec/loader/wine/pe_image.h b/modules/codec/loader/wine/pe_image.h
deleted file mode 100644 (file)
index 3f550ba..0000000
+++ /dev/null
@@ -1,81 +0,0 @@
-#ifndef __WINE_PE_IMAGE_H
-#define __WINE_PE_IMAGE_H
-
-#include "winnt.h"
-#include "winbase.h"
-
-#define PE_HEADER(module) \
-    ((IMAGE_NT_HEADERS*)((LPBYTE)(module) + \
-                         (((IMAGE_DOS_HEADER*)(module))->e_lfanew)))
-
-#define PE_SECTIONS(module) \
-    ((IMAGE_SECTION_HEADER*)((LPBYTE)&PE_HEADER(module)->OptionalHeader + \
-                           PE_HEADER(module)->FileHeader.SizeOfOptionalHeader))
-
-#define RVA_PTR(module,field) ((LPBYTE)(module) + PE_HEADER(module)->field)
-
-/* modreference used for attached processes
- * all section are calculated here, relocations etc.
- */
-typedef struct {
-       PIMAGE_IMPORT_DESCRIPTOR        pe_import;
-       PIMAGE_EXPORT_DIRECTORY pe_export;
-       PIMAGE_RESOURCE_DIRECTORY       pe_resource;
-       int                             tlsindex;
-} PE_MODREF;
-
-struct _wine_modref;
-extern int PE_unloadImage(HMODULE hModule);
-extern FARPROC PE_FindExportedFunction(struct _wine_modref *wm, LPCSTR funcName, WIN_BOOL snoop);
-extern WIN_BOOL PE_EnumResourceTypesA(HMODULE,ENUMRESTYPEPROCA,LONG);
-extern WIN_BOOL PE_EnumResourceTypesW(HMODULE,ENUMRESTYPEPROCW,LONG);
-extern WIN_BOOL PE_EnumResourceNamesA(HMODULE,LPCSTR,ENUMRESNAMEPROCA,LONG);
-extern WIN_BOOL PE_EnumResourceNamesW(HMODULE,LPCWSTR,ENUMRESNAMEPROCW,LONG);
-extern WIN_BOOL PE_EnumResourceLanguagesA(HMODULE,LPCSTR,LPCSTR,ENUMRESLANGPROCA,LONG);
-extern WIN_BOOL PE_EnumResourceLanguagesW(HMODULE,LPCWSTR,LPCWSTR,ENUMRESLANGPROCW,LONG);
-extern HRSRC PE_FindResourceExW(struct _wine_modref*,LPCWSTR,LPCWSTR,WORD);
-extern DWORD PE_SizeofResource(HMODULE,HRSRC);
-extern struct _wine_modref *PE_LoadLibraryExA(LPCSTR, DWORD);
-extern void PE_UnloadLibrary(struct _wine_modref *);
-extern HGLOBAL PE_LoadResource(struct _wine_modref *wm,HRSRC);
-extern HMODULE PE_LoadImage( int hFile, LPCSTR filename, WORD *version );
-extern struct _wine_modref *PE_CreateModule( HMODULE hModule, LPCSTR filename,
-                                             DWORD flags, WIN_BOOL builtin );
-extern WIN_BOOL PE_CreateProcess( HANDLE hFile, LPCSTR filename, LPCSTR cmd_line, LPCSTR env, 
-                              LPSECURITY_ATTRIBUTES psa, LPSECURITY_ATTRIBUTES tsa,
-                              WIN_BOOL inherit, DWORD flags, LPSTARTUPINFOA startup,
-                              LPPROCESS_INFORMATION info );
-
-extern void PE_InitTls(void);
-extern WIN_BOOL PE_InitDLL(struct _wine_modref *wm, DWORD type, LPVOID lpReserved);
-
-extern PIMAGE_RESOURCE_DIRECTORY GetResDirEntryA(PIMAGE_RESOURCE_DIRECTORY,LPCSTR,DWORD,WIN_BOOL);
-extern PIMAGE_RESOURCE_DIRECTORY GetResDirEntryW(PIMAGE_RESOURCE_DIRECTORY,LPCWSTR,DWORD,WIN_BOOL);
-
-typedef DWORD CALLBACK (*DLLENTRYPROC)(HMODULE,DWORD,LPVOID);
-
-typedef struct {
-       WORD    popl    WINE_PACKED;    /* 0x8f 0x05 */
-       DWORD   addr_popped WINE_PACKED;/* ...  */
-       BYTE    pushl1  WINE_PACKED;    /* 0x68 */
-       DWORD   newret WINE_PACKED;     /* ...  */
-       BYTE    pushl2  WINE_PACKED;    /* 0x68 */
-       DWORD   origfun WINE_PACKED;    /* original function */
-       BYTE    ret1    WINE_PACKED;    /* 0xc3 */
-       WORD    addesp  WINE_PACKED;    /* 0x83 0xc4 */
-       BYTE    nrofargs WINE_PACKED;   /* nr of arguments to add esp, */
-       BYTE    pushl3  WINE_PACKED;    /* 0x68 */
-       DWORD   oldret  WINE_PACKED;    /* Filled out from popl above  */
-       BYTE    ret2    WINE_PACKED;    /* 0xc3 */
-} ELF_STDCALL_STUB;
-
-typedef struct {
-       void*                   dlhandle;
-       ELF_STDCALL_STUB        *stubs;
-} ELF_MODREF;
-
-extern struct _wine_modref *ELF_LoadLibraryExA( LPCSTR libname, DWORD flags);
-extern void ELF_UnloadLibrary(struct _wine_modref *);
-extern FARPROC ELF_FindExportedFunction(struct _wine_modref *wm, LPCSTR funcName);
-
-#endif /* __WINE_PE_IMAGE_H */
diff --git a/modules/codec/loader/wine/poppack.h b/modules/codec/loader/wine/poppack.h
deleted file mode 100644 (file)
index e7a273f..0000000
+++ /dev/null
@@ -1,263 +0,0 @@
-/*
- * Copyright (C) 1999 Patrik Stridvall
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
- */
-
-#if defined(__WINE_PSHPACK_H15)
-#  ifndef __WINE_INTERNAL_POPPACK
-#    undef __WINE_PSHPACK_H15
-#  endif
-/* Depth == 15 */
-
-#  if __WINE_PSHPACK_H14 == 1
-#    pragma pack(1)
-#  elif __WINE_PSHPACK_H14 == 2
-#    pragma pack(2)
-#  elif __WINE_PSHPACK_H14 == 8
-#    pragma pack(8)
-#  else
-#    pragma pack(4)
-#  endif
-
-#elif defined(__WINE_PSHPACK_H14)
-#  ifndef __WINE_INTERNAL_POPPACK
-#    undef __WINE_PSHPACK_H14
-#  endif
-/* Depth == 14 */
-
-#  if __WINE_PSHPACK_H13 == 1
-#    pragma pack(1)
-#  elif __WINE_PSHPACK_H13 == 2
-#    pragma pack(2)
-#  elif __WINE_PSHPACK_H13 == 8
-#    pragma pack(8)
-#  else
-#    pragma pack(4)
-#  endif
-
-#elif defined(__WINE_PSHPACK_H13)
-#  ifndef __WINE_INTERNAL_POPPACK
-#    undef __WINE_PSHPACK_H13
-#  endif
-/* Depth == 13 */
-
-#  if __WINE_PSHPACK_H12 == 1
-#    pragma pack(1)
-#  elif __WINE_PSHPACK_H12 == 2
-#    pragma pack(2)
-#  elif __WINE_PSHPACK_H12 == 8
-#    pragma pack(8)
-#  else
-#    pragma pack(4)
-#  endif
-
-#elif defined(__WINE_PSHPACK_H12)
-#  ifndef __WINE_INTERNAL_POPPACK
-#    undef __WINE_PSHPACK_H12
-#  endif
-/* Depth == 12 */
-
-#  if __WINE_PSHPACK_H11 == 1
-#    pragma pack(1)
-#  elif __WINE_PSHPACK_H11 == 2
-#    pragma pack(2)
-#  elif __WINE_PSHPACK_H11 == 8
-#    pragma pack(8)
-#  else
-#    pragma pack(4)
-#  endif
-
-#elif defined(__WINE_PSHPACK_H11)
-#  ifndef __WINE_INTERNAL_POPPACK
-#    undef __WINE_PSHPACK_H11
-#  endif
-/* Depth == 11 */
-
-#  if __WINE_PSHPACK_H10 == 1
-#    pragma pack(1)
-#  elif __WINE_PSHPACK_H10 == 2
-#    pragma pack(2)
-#  elif __WINE_PSHPACK_H10 == 8
-#    pragma pack(8)
-#  else
-#    pragma pack(4)
-#  endif
-
-#elif defined(__WINE_PSHPACK_H10)
-#  ifndef __WINE_INTERNAL_POPPACK
-#    undef __WINE_PSHPACK_H10
-#  endif
-/* Depth == 10 */
-
-#  if __WINE_PSHPACK_H9 == 1
-#    pragma pack(1)
-#  elif __WINE_PSHPACK_H9 == 2
-#    pragma pack(2)
-#  elif __WINE_PSHPACK_H9 == 8
-#    pragma pack(8)
-#  else
-#    pragma pack(4)
-#  endif
-
-#elif defined(__WINE_PSHPACK_H9)
-#  ifndef __WINE_INTERNAL_POPPACK
-#    undef __WINE_PSHPACK_H9
-#  endif
-/* Depth == 9 */
-
-#  if __WINE_PSHPACK_H8 == 1
-#    pragma pack(1)
-#  elif __WINE_PSHPACK_H8 == 2
-#    pragma pack(2)
-#  elif __WINE_PSHPACK_H8 == 8
-#    pragma pack(8)
-#  else
-#    pragma pack(4)
-#  endif
-
-#elif defined(__WINE_PSHPACK_H8)
-#  ifndef __WINE_INTERNAL_POPPACK
-#    undef __WINE_PSHPACK_H8
-#  endif
-/* Depth == 8 */
-
-#  if __WINE_PSHPACK_H7 == 1
-#    pragma pack(1)
-#  elif __WINE_PSHPACK_H7 == 2
-#    pragma pack(2)
-#  elif __WINE_PSHPACK_H7 == 8
-#    pragma pack(8)
-#  else
-#    pragma pack(4)
-#  endif
-
-#elif defined(__WINE_PSHPACK_H7)
-#  ifndef __WINE_INTERNAL_POPPACK
-#    undef __WINE_PSHPACK_H7
-#  endif
-/* Depth == 7 */
-
-#  if __WINE_PSHPACK_H6 == 1
-#    pragma pack(1)
-#  elif __WINE_PSHPACK_H6 == 2
-#    pragma pack(2)
-#  elif __WINE_PSHPACK_H6 == 8
-#    pragma pack(8)
-#  else
-#    pragma pack(4)
-#  endif
-
-#elif defined(__WINE_PSHPACK_H6)
-#  ifndef __WINE_INTERNAL_POPPACK
-#    undef __WINE_PSHPACK_H6
-#  endif
-/* Depth == 6 */
-
-#  if __WINE_PSHPACK_H5 == 1
-#    pragma pack(1)
-#  elif __WINE_PSHPACK_H5 == 2
-#    pragma pack(2)
-#  elif __WINE_PSHPACK_H5 == 8
-#    pragma pack(8)
-#  else
-#    pragma pack(4)
-#  endif
-
-#elif defined(__WINE_PSHPACK_H5)
-#  ifndef __WINE_INTERNAL_POPPACK
-#    undef __WINE_PSHPACK_H5
-#  endif
-/* Depth == 5 */
-
-#  if __WINE_PSHPACK_H4 == 1
-#    pragma pack(1)
-#  elif __WINE_PSHPACK_H4 == 2
-#    pragma pack(2)
-#  elif __WINE_PSHPACK_H4 == 8
-#    pragma pack(8)
-#  else
-#    pragma pack(4)
-#  endif
-
-#elif defined(__WINE_PSHPACK_H4)
-#  ifndef __WINE_INTERNAL_POPPACK
-#    undef __WINE_PSHPACK_H4
-#  endif
-/* Depth == 4 */
-
-#  if __WINE_PSHPACK_H3 == 1
-#    pragma pack(1)
-#  elif __WINE_PSHPACK_H3 == 2
-#    pragma pack(2)
-#  elif __WINE_PSHPACK_H3 == 8
-#    pragma pack(8)
-#  else
-#    pragma pack(4)
-#  endif
-
-#elif defined(__WINE_PSHPACK_H3)
-#  ifndef __WINE_INTERNAL_POPPACK
-#    undef __WINE_PSHPACK_H3
-#  endif
-/* Depth == 3 */
-
-#  if __WINE_PSHPACK_H2 == 1
-#    pragma pack(1)
-#  elif __WINE_PSHPACK_H2 == 2
-#    pragma pack(2)
-#  elif __WINE_PSHPACK_H2 == 8
-#    pragma pack(8)
-#  else
-#    pragma pack(4)
-#  endif
-
-#elif defined(__WINE_PSHPACK_H2)
-#  ifndef __WINE_INTERNAL_POPPACK
-#    undef __WINE_PSHPACK_H2
-#  endif
-/* Depth == 2 */
-
-#  if __WINE_PSHPACK_H == 1
-#    pragma pack(1)
-#  elif __WINE_PSHPACK_H == 2
-#    pragma pack(2)
-#  elif __WINE_PSHPACK_H == 8
-#    pragma pack(8)
-#  else
-#    pragma pack(4)
-#  endif
-
-#elif defined(__WINE_PSHPACK_H)
-#  ifndef __WINE_INTERNAL_POPPACK
-#    undef __WINE_PSHPACK_H
-#  endif
-/* Depth == 1 */
-
-#  if defined(__SUNPRO_CC)
-#    warning "Assuming a default alignment of 4"
-#    pragma pack(4)
-#  else
-#    pragma pack()
-#  endif
-
-#else
-/* Depth == 0 ! */
-
-#error "Popping alignment isn't possible since no alignment has been pushed"
-
-#endif
-
-#undef __WINE_INTERNAL_POPPACK
diff --git a/modules/codec/loader/wine/pshpack1.h b/modules/codec/loader/wine/pshpack1.h
deleted file mode 100644 (file)
index dca14f6..0000000
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- * Copyright (C) 1999 Patrik Stridvall
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
- */
-
-#if defined(__WINE_PSHPACK_H15)
-
-/* Depth > 15 */
-#  error "Alignment nesting > 15 is not supported"
-
-#else
-
-#  if !defined(__WINE_PSHPACK_H)
-#    define __WINE_PSHPACK_H  1
-/* Depth == 1 */
-#  elif !defined(__WINE_PSHPACK_H2)
-#    define __WINE_PSHPACK_H2 1
-/* Depth == 2 */
-#    define __WINE_INTERNAL_POPPACK
-#    include <poppack.h>
-#  elif !defined(__WINE_PSHPACK_H3)
-#    define __WINE_PSHPACK_H3 1
-/* Depth == 3 */
-#    define __WINE_INTERNAL_POPPACK
-#    include <poppack.h>
-#  elif !defined(__WINE_PSHPACK_H4)
-#    define __WINE_PSHPACK_H4 1
-/* Depth == 4 */
-#    define __WINE_INTERNAL_POPPACK
-#    include <poppack.h>
-#  elif !defined(__WINE_PSHPACK_H5)
-#    define __WINE_PSHPACK_H5 1
-/* Depth == 5 */
-#    define __WINE_INTERNAL_POPPACK
-#    include <poppack.h>
-#  elif !defined(__WINE_PSHPACK_H6)
-#    define __WINE_PSHPACK_H6 1
-/* Depth == 6 */
-#    define __WINE_INTERNAL_POPPACK
-#    include <poppack.h>
-#  elif !defined(__WINE_PSHPACK_H7)
-#    define __WINE_PSHPACK_H7 1
-/* Depth == 7 */
-#    define __WINE_INTERNAL_POPPACK
-#    include <poppack.h>
-#  elif !defined(__WINE_PSHPACK_H8)
-#    define __WINE_PSHPACK_H8 1
-/* Depth == 8 */
-#    define __WINE_INTERNAL_POPPACK
-#    include <poppack.h>
-#  elif !defined(__WINE_PSHPACK_H9)
-#    define __WINE_PSHPACK_H9 1
-/* Depth == 9 */
-#    define __WINE_INTERNAL_POPPACK
-#    include <poppack.h>
-#  elif !defined(__WINE_PSHPACK_H10)
-#    define __WINE_PSHPACK_H10 1
-/* Depth == 10 */
-#    define __WINE_INTERNAL_POPPACK
-#    include <poppack.h>
-#  elif !defined(__WINE_PSHPACK_H11)
-#    define __WINE_PSHPACK_H11 1
-/* Depth == 11 */
-#    define __WINE_INTERNAL_POPPACK
-#    include <poppack.h>
-#  elif !defined(__WINE_PSHPACK_H12)
-#    define __WINE_PSHPACK_H12 1
-/* Depth == 12 */
-#    define __WINE_INTERNAL_POPPACK
-#    include <poppack.h>
-#  elif !defined(__WINE_PSHPACK_H13)
-#    define __WINE_PSHPACK_H13 1
-/* Depth == 13 */
-#    define __WINE_INTERNAL_POPPACK
-#    include <poppack.h>
-#  elif !defined(__WINE_PSHPACK_H14)
-#    define __WINE_PSHPACK_H14 1
-/* Depth == 14 */
-#    define __WINE_INTERNAL_POPPACK
-#    include <poppack.h>
-#  elif !defined(__WINE_PSHPACK_H15)
-#    define __WINE_PSHPACK_H15 1
-/* Depth == 15 */
-#    define __WINE_INTERNAL_POPPACK
-#    include <poppack.h>
-#  endif
-
-#  if defined(_MSC_VER) && (_MSC_VER >= 800)
-#   pragma warning(disable:4103)
-#  endif
-
-#  pragma pack(1)
-
-#endif
diff --git a/modules/codec/loader/wine/pshpack2.h b/modules/codec/loader/wine/pshpack2.h
deleted file mode 100644 (file)
index 4ce42a9..0000000
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- * Copyright (C) 1999 Patrik Stridvall
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
- */
-
-#if defined(__WINE_PSHPACK_H15)
-
-/* Depth > 15 */
-#  error "Alignment nesting > 15 is not supported"
-
-#else
-
-#  if !defined(__WINE_PSHPACK_H)
-#    define __WINE_PSHPACK_H  2
-/* Depth == 1 */
-#  elif !defined(__WINE_PSHPACK_H2)
-#    define __WINE_PSHPACK_H2 2
-/* Depth == 2 */
-#    define __WINE_INTERNAL_POPPACK
-#    include <poppack.h>
-#  elif !defined(__WINE_PSHPACK_H3)
-#    define __WINE_PSHPACK_H3 2
-/* Depth == 3 */
-#    define __WINE_INTERNAL_POPPACK
-#    include <poppack.h>
-#  elif !defined(__WINE_PSHPACK_H4)
-#    define __WINE_PSHPACK_H4 2
-/* Depth == 4 */
-#    define __WINE_INTERNAL_POPPACK
-#    include <poppack.h>
-#  elif !defined(__WINE_PSHPACK_H5)
-#    define __WINE_PSHPACK_H5 2
-/* Depth == 5 */
-#    define __WINE_INTERNAL_POPPACK
-#    include <poppack.h>
-#  elif !defined(__WINE_PSHPACK_H6)
-#    define __WINE_PSHPACK_H6 2
-/* Depth == 6 */
-#    define __WINE_INTERNAL_POPPACK
-#    include <poppack.h>
-#  elif !defined(__WINE_PSHPACK_H7)
-#    define __WINE_PSHPACK_H7 2
-/* Depth == 7 */
-#    define __WINE_INTERNAL_POPPACK
-#    include <poppack.h>
-#  elif !defined(__WINE_PSHPACK_H8)
-#    define __WINE_PSHPACK_H8 2
-/* Depth == 8 */
-#    define __WINE_INTERNAL_POPPACK
-#    include <poppack.h>
-#  elif !defined(__WINE_PSHPACK_H9)
-#    define __WINE_PSHPACK_H9 2
-/* Depth == 9 */
-#    define __WINE_INTERNAL_POPPACK
-#    include <poppack.h>
-#  elif !defined(__WINE_PSHPACK_H10)
-#    define __WINE_PSHPACK_H10 2
-/* Depth == 10 */
-#    define __WINE_INTERNAL_POPPACK
-#    include <poppack.h>
-#  elif !defined(__WINE_PSHPACK_H11)
-#    define __WINE_PSHPACK_H11 2
-/* Depth == 11 */
-#    define __WINE_INTERNAL_POPPACK
-#    include <poppack.h>
-#  elif !defined(__WINE_PSHPACK_H12)
-#    define __WINE_PSHPACK_H12 2
-/* Depth == 12 */
-#    define __WINE_INTERNAL_POPPACK
-#    include <poppack.h>
-#  elif !defined(__WINE_PSHPACK_H13)
-#    define __WINE_PSHPACK_H13 2
-/* Depth == 13 */
-#    define __WINE_INTERNAL_POPPACK
-#    include <poppack.h>
-#  elif !defined(__WINE_PSHPACK_H14)
-#    define __WINE_PSHPACK_H14 2
-/* Depth == 14 */
-#    define __WINE_INTERNAL_POPPACK
-#    include <poppack.h>
-#  elif !defined(__WINE_PSHPACK_H15)
-#    define __WINE_PSHPACK_H15 2
-/* Depth == 15 */
-#    define __WINE_INTERNAL_POPPACK
-#    include <poppack.h>
-#  endif
-
-#  if defined(_MSC_VER) && (_MSC_VER >= 800)
-#   pragma warning(disable:4103)
-#  endif
-
-#  pragma pack(2)
-
-#endif
diff --git a/modules/codec/loader/wine/vfw.h b/modules/codec/loader/wine/vfw.h
deleted file mode 100644 (file)
index 7957a83..0000000
+++ /dev/null
@@ -1,674 +0,0 @@
-/*
- * Modified for use with MPlayer, detailed CVS changelog at
- * http://www.mplayerhq.hu/cgi-bin/cvsweb.cgi/main/
- * $Id$
- */
-
-#ifndef __WINE_VFW_H
-#define __WINE_VFW_H
-//#include "pshpack1.h"
-#ifdef __cplusplus
-extern "C" {
-#endif
-#ifndef __WINE_WINGDI_H
-
-typedef struct __attribute__((__packed__))
-{
-    short    bfType;
-    long   bfSize;
-    short    bfReserved1;
-    short    bfReserved2;
-    long   bfOffBits;
-} BITMAPFILEHEADER;
-
-#ifndef _BITMAPINFOHEADER_
-#define _BITMAPINFOHEADER_
-typedef struct __attribute__((__packed__))
-{
-    long       biSize;
-    long       biWidth;
-    long       biHeight;
-    short      biPlanes;
-    short      biBitCount;
-    long       biCompression;
-    long       biSizeImage;
-    long       biXPelsPerMeter;
-    long       biYPelsPerMeter;
-    long       biClrUsed;
-    long       biClrImportant;
-} BITMAPINFOHEADER, *PBITMAPINFOHEADER, *LPBITMAPINFOHEADER;
-typedef struct {
-       BITMAPINFOHEADER bmiHeader;
-       int     bmiColors[1];
-} BITMAPINFO, *LPBITMAPINFO;
-#endif
-
-#endif
-#define VFWAPI 
-#define VFWAPIV        
-#ifndef __WINE_WINDEF_H
-typedef long (__stdcall__ *DRIVERPROC)(long,HDRVR,unsigned int,long,long);
-#endif
-
-
-
-#ifndef mmioFOURCC
-#define mmioFOURCC( ch0, ch1, ch2, ch3 )                               \
-       ( (long)(unsigned char)(ch0) | ( (long)(unsigned char)(ch1) << 8 ) |            \
-       ( (long)(unsigned char)(ch2) << 16 ) | ( (long)(unsigned char)(ch3) << 24 ) )
-#endif
-
-#ifndef aviTWOCC
-#define aviTWOCC(ch0, ch1) ((short)(unsigned char)(ch0) | ((short)(unsigned char)(ch1) << 8))
-#endif
-
-#define ICTYPE_VIDEO   mmioFOURCC('v', 'i', 'd', 'c')
-#define ICTYPE_AUDIO   mmioFOURCC('a', 'u', 'd', 'c')
-
-
-/* Installable Compressor M? */
-
-/* HIC struct (same layout as Win95 one) */
-typedef struct tagWINE_HIC {
-       long            magic;          /* 00: 'Smag' */
-       HANDLE  curthread;      /* 04: */
-       long            type;           /* 08: */
-       long            handler;        /* 0C: */
-       HDRVR           hdrv;           /* 10: */
-       long            driverid;       /* 14:(handled by SendDriverMessage)*/
-       DRIVERPROC      driverproc;     /* 18:(handled by SendDriverMessage)*/
-       long            x1;             /* 1c: name? */
-       short           x2;             /* 20: */
-       long            x3;             /* 22: */
-                                       /* 26: */
-} WINE_HIC;
-
-/* error return codes */
-#define        ICERR_OK                0
-#define        ICERR_DONTDRAW          1
-#define        ICERR_NEWPALETTE        2
-#define        ICERR_GOTOKEYFRAME      3
-#define        ICERR_STOPDRAWING       4
-
-#define        ICERR_UNSUPPORTED       -1
-#define        ICERR_BADFORMAT         -2
-#define        ICERR_MEMORY            -3
-#define        ICERR_INTERNAL          -4
-#define        ICERR_BADFLAGS          -5
-#define        ICERR_BADPARAM          -6
-#define        ICERR_BADSIZE           -7
-#define        ICERR_BADHANDLE         -8
-#define        ICERR_CANTUPDATE        -9
-#define        ICERR_ABORT             -10
-#define        ICERR_ERROR             -100
-#define        ICERR_BADBITDEPTH       -200
-#define        ICERR_BADIMAGESIZE      -201
-
-#define        ICERR_CUSTOM            -400
-
-/* ICM Messages */
-#define        ICM_USER                (DRV_USER+0x0000)
-
-/* ICM driver message range */
-#define        ICM_RESERVED_LOW        (DRV_USER+0x1000)
-#define        ICM_RESERVED_HIGH       (DRV_USER+0x2000)
-#define        ICM_RESERVED            ICM_RESERVED_LOW
-
-#define        ICM_GETSTATE            (ICM_RESERVED+0)
-#define        ICM_SETSTATE            (ICM_RESERVED+1)
-#define        ICM_GETINFO             (ICM_RESERVED+2)
-
-#define        ICM_CONFIGURE           (ICM_RESERVED+10)
-#define        ICM_ABOUT               (ICM_RESERVED+11)
-/* */
-
-#define        ICM_GETDEFAULTQUALITY   (ICM_RESERVED+30)
-#define        ICM_GETQUALITY          (ICM_RESERVED+31)
-#define        ICM_SETQUALITY          (ICM_RESERVED+32)
-
-#define        ICM_SET                 (ICM_RESERVED+40)
-#define        ICM_GET                 (ICM_RESERVED+41)
-
-/* 2 constant FOURCC codes */
-#define ICM_FRAMERATE          mmioFOURCC('F','r','m','R')
-#define ICM_KEYFRAMERATE       mmioFOURCC('K','e','y','R')
-
-#define        ICM_COMPRESS_GET_FORMAT         (ICM_USER+4)
-#define        ICM_COMPRESS_GET_SIZE           (ICM_USER+5)
-#define        ICM_COMPRESS_QUERY              (ICM_USER+6)
-#define        ICM_COMPRESS_BEGIN              (ICM_USER+7)
-#define        ICM_COMPRESS                    (ICM_USER+8)
-#define        ICM_COMPRESS_END                (ICM_USER+9)
-
-#define        ICM_DECOMPRESS_GET_FORMAT       (ICM_USER+10)
-#define        ICM_DECOMPRESS_QUERY            (ICM_USER+11)
-#define        ICM_DECOMPRESS_BEGIN            (ICM_USER+12)
-#define        ICM_DECOMPRESS                  (ICM_USER+13)
-#define        ICM_DECOMPRESS_END              (ICM_USER+14)
-#define        ICM_DECOMPRESS_SET_PALETTE      (ICM_USER+29)
-#define        ICM_DECOMPRESS_GET_PALETTE      (ICM_USER+30)
-
-#define        ICM_DRAW_QUERY                  (ICM_USER+31)
-#define        ICM_DRAW_BEGIN                  (ICM_USER+15)
-#define        ICM_DRAW_GET_PALETTE            (ICM_USER+16)
-#define        ICM_DRAW_START                  (ICM_USER+18)
-#define        ICM_DRAW_STOP                   (ICM_USER+19)
-#define        ICM_DRAW_END                    (ICM_USER+21)
-#define        ICM_DRAW_GETTIME                (ICM_USER+32)
-#define        ICM_DRAW                        (ICM_USER+33)
-#define        ICM_DRAW_WINDOW                 (ICM_USER+34)
-#define        ICM_DRAW_SETTIME                (ICM_USER+35)
-#define        ICM_DRAW_REALIZE                (ICM_USER+36)
-#define        ICM_DRAW_FLUSH                  (ICM_USER+37)
-#define        ICM_DRAW_RENDERBUFFER           (ICM_USER+38)
-
-#define        ICM_DRAW_START_PLAY             (ICM_USER+39)
-#define        ICM_DRAW_STOP_PLAY              (ICM_USER+40)
-
-#define        ICM_DRAW_SUGGESTFORMAT          (ICM_USER+50)
-#define        ICM_DRAW_CHANGEPALETTE          (ICM_USER+51)
-
-#define        ICM_GETBUFFERSWANTED            (ICM_USER+41)
-
-#define        ICM_GETDEFAULTKEYFRAMERATE      (ICM_USER+42)
-
-#define        ICM_DECOMPRESSEX_BEGIN          (ICM_USER+60)
-#define        ICM_DECOMPRESSEX_QUERY          (ICM_USER+61)
-#define        ICM_DECOMPRESSEX                (ICM_USER+62)
-#define        ICM_DECOMPRESSEX_END            (ICM_USER+63)
-
-#define        ICM_COMPRESS_FRAMES_INFO        (ICM_USER+70)
-#define        ICM_SET_STATUS_PROC             (ICM_USER+72)
-
-/* structs */
-
-typedef struct {
-       long    dwSize;         /* 00: size */
-       long    fccType;        /* 04: type 'vidc' usually */
-       long    fccHandler;     /* 08: */
-       long    dwVersion;      /* 0c: version of compman opening you */
-       long    dwFlags;        /* 10: LOshort is type specific */
-       LRESULT dwError;        /* 14: */
-       void*   pV1Reserved;    /* 18: */
-       void*   pV2Reserved;    /* 1c: */
-       long    dnDevNode;      /* 20: */
-                               /* 24: */
-} ICOPEN,*LPICOPEN;
-
-#define ICCOMPRESS_KEYFRAME     0x00000001L
-
-typedef struct {
-    long               dwFlags;
-    LPBITMAPINFOHEADER lpbiOutput;
-    void*              lpOutput;
-    LPBITMAPINFOHEADER lpbiInput;
-    const void*                lpInput;
-    long*              lpckid;
-    long*              lpdwFlags;
-    long               lFrameNum;
-    long               dwFrameSize;
-    long               dwQuality;
-    LPBITMAPINFOHEADER lpbiPrev;
-    void*              lpPrev;
-} ICCOMPRESS;
-
-long VFWAPIV ICCompress(
-       HIC hic,long dwFlags,LPBITMAPINFOHEADER lpbiOutput,void* lpData,
-       LPBITMAPINFOHEADER lpbiInput,void* lpBits,long* lpckid,
-       long* lpdwFlags,long lFrameNum,long dwFrameSize,long dwQuality,
-       LPBITMAPINFOHEADER lpbiPrev,void* lpPrev
-);
-
-
-#define ICCompressGetFormat(hic, lpbiInput, lpbiOutput)                \
-       ICSendMessage(                                                  \
-           hic,ICM_COMPRESS_GET_FORMAT,(long)(void*)(lpbiInput),       \
-           (long)(void*)(lpbiOutput)                                   \
-       )
-
-#define ICCompressGetFormatSize(hic,lpbi) ICCompressGetFormat(hic,lpbi,NULL)
-
-#define ICGetDefaultKeyFrameRate(hic,lpint)            \
-       ICSendMessage(                                  \
-           hic, ICM_GETDEFAULTKEYFRAMERATE,            \
-           (long)(void*)(lpint),                       \
-           0   )               
-
-#define ICGetDefaultQuality(hic,lpint)                         \
-       ICSendMessage(                                  \
-           hic, ICM_GETDEFAULTQUALITY,                 \
-           (long)(void*)(lpint),                       \
-           0   )               
-               
-
-#define ICCompressBegin(hic, lpbiInput, lpbiOutput)                    \
-    ICSendMessage(                                                     \
-       hic, ICM_COMPRESS_BEGIN, (long)(void*)(lpbiInput),              \
-       (long)(void*)(lpbiOutput)                                       \
-    )
-
-#define ICCompressGetSize(hic, lpbiInput, lpbiOutput)          \
-    ICSendMessage(                                                     \
-       hic, ICM_COMPRESS_GET_SIZE, (long)(void*)(lpbiInput),   \
-       (long)(void*)(lpbiOutput)                                       \
-    )
-
-#define ICCompressQuery(hic, lpbiInput, lpbiOutput)            \
-    ICSendMessage(                                             \
-       hic, ICM_COMPRESS_QUERY, (long)(void*)(lpbiInput),      \
-       (long)(void*)(lpbiOutput)                               \
-    )
-
-
-#define ICCompressEnd(hic) ICSendMessage(hic, ICM_COMPRESS_END, 0, 0)
-
-/* ICCOMPRESSFRAMES.dwFlags */
-#define ICCOMPRESSFRAMES_PADDING        0x00000001
-typedef struct {
-    long               dwFlags;
-    LPBITMAPINFOHEADER  lpbiOutput;
-    LPARAM              lOutput;
-    LPBITMAPINFOHEADER  lpbiInput;
-    LPARAM              lInput;
-    long                lStartFrame;
-    long                lFrameCount;
-    long                lQuality;
-    long                lDataRate;
-    long                lKeyRate;
-    long               dwRate;
-    long               dwScale;
-    long               dwOverheadPerFrame;
-    long               dwReserved2;
-    long CALLBACK (*GetData)(LPARAM lInput,long lFrame,void* lpBits,long len);
-    long CALLBACK (*PutData)(LPARAM lOutput,long lFrame,void* lpBits,long len);
-} ICCOMPRESSFRAMES;
-
-/* Values for wMode of ICOpen() */
-#define        ICMODE_COMPRESS         1
-#define        ICMODE_DECOMPRESS       2
-#define        ICMODE_FASTDECOMPRESS   3
-#define        ICMODE_QUERY            4
-#define        ICMODE_FASTCOMPRESS     5
-#define        ICMODE_DRAW             8
-
-/* quality flags */
-#define ICQUALITY_LOW       0
-#define ICQUALITY_HIGH      10000
-#define ICQUALITY_DEFAULT   -1
-
-typedef struct {
-       long    dwSize;         /* 00: */
-       long    fccType;        /* 04:compressor type     'vidc' 'audc' */
-       long    fccHandler;     /* 08:compressor sub-type 'rle ' 'jpeg' 'pcm '*/
-       long    dwFlags;        /* 0c:flags LOshort is type specific */
-       long    dwVersion;      /* 10:version of the driver */
-       long    dwVersionICM;   /* 14:version of the ICM used */
-       /*
-        * under Win32, the driver always returns UNICODE strings.
-        */
-       WCHAR   szName[16];             /* 18:short name */
-       WCHAR   szDescription[128];     /* 38:long name */
-       WCHAR   szDriver[128];          /* 138:driver that contains compressor*/
-                                       /* 238: */
-} ICINFO;
-
-/* ICINFO.dwFlags */
-#define        VIDCF_QUALITY           0x0001  /* supports quality */
-#define        VIDCF_CRUNCH            0x0002  /* supports crunching to a frame size */
-#define        VIDCF_TEMPORAL          0x0004  /* supports inter-frame compress */
-#define        VIDCF_COMPRESSFRAMES    0x0008  /* wants the compress all frames message */
-#define        VIDCF_DRAW              0x0010  /* supports drawing */
-#define        VIDCF_FASTTEMPORALC     0x0020  /* does not need prev frame on compress */
-#define        VIDCF_FASTTEMPORALD     0x0080  /* does not need prev frame on decompress */
-#define        VIDCF_QUALITYTIME       0x0040  /* supports temporal quality */
-
-#define        VIDCF_FASTTEMPORAL      (VIDCF_FASTTEMPORALC|VIDCF_FASTTEMPORALD)
-
-
-/* function shortcuts */
-/* ICM_ABOUT */
-#define ICMF_ABOUT_QUERY         0x00000001
-
-#define ICQueryAbout(hic) \
-       (ICSendMessage(hic,ICM_ABOUT,(long)-1,ICMF_ABOUT_QUERY)==ICERR_OK)
-
-#define ICAbout(hic, hwnd) ICSendMessage(hic,ICM_ABOUT,(long)(unsigned int)(hwnd),0)
-
-/* ICM_CONFIGURE */
-#define ICMF_CONFIGURE_QUERY   0x00000001
-#define ICQueryConfigure(hic) \
-       (ICSendMessage(hic,ICM_CONFIGURE,(long)-1,ICMF_CONFIGURE_QUERY)==ICERR_OK)
-
-#define ICConfigure(hic,hwnd) \
-       ICSendMessage(hic,ICM_CONFIGURE,(long)(unsigned int)(hwnd),0)
-
-/* Decompression stuff */
-#define ICDECOMPRESS_HURRYUP           0x80000000      /* don't draw just buffer (hurry up!) */
-#define ICDECOMPRESS_UPDATE            0x40000000      /* don't draw just update screen */
-#define ICDECOMPRESS_PREROL            0x20000000      /* this frame is before real start */
-#define ICDECOMPRESS_NULLFRAME         0x10000000      /* repeat last frame */
-#define ICDECOMPRESS_NOTKEYFRAME       0x08000000      /* this frame is not a key frame */
-
-typedef struct {
-    long               dwFlags;        /* flags (from AVI index...) */
-    LPBITMAPINFOHEADER lpbiInput;      /* BITMAPINFO of compressed data */
-    const void*                lpInput;        /* compressed data */
-    LPBITMAPINFOHEADER lpbiOutput;     /* DIB to decompress to */
-    void*              lpOutput;
-    long               ckid;           /* ckid from AVI file */
-} ICDECOMPRESS;
-
-typedef struct {
-    long               dwFlags;
-    LPBITMAPINFOHEADER lpbiSrc;
-    const void*                lpSrc;
-    LPBITMAPINFOHEADER lpbiDst;
-    void*              lpDst;
-
-    /* changed for ICM_DECOMPRESSEX */
-    INT                xDst;       /* destination rectangle */
-    INT                yDst;
-    INT                dxDst;
-    INT                dyDst;
-
-    INT                xSrc;       /* source rectangle */
-    INT                ySrc;
-    INT                dxSrc;
-    INT                dySrc;
-} ICDECOMPRESSEX;
-
-
-long VFWAPIV ICDecompress(HIC hic,long dwFlags,LPBITMAPINFOHEADER lpbiFormat,void* lpData,LPBITMAPINFOHEADER lpbi,void* lpBits);
-long VFWAPIV ICDecompressEx(HIC hic,long dwFlags,LPBITMAPINFOHEADER lpbiFormat,void* lpData,LPBITMAPINFOHEADER lpbi,void* lpBits);
-long VFWAPIV ICUniversalEx(HIC hic,int command,LPBITMAPINFOHEADER lpbiFormat,LPBITMAPINFOHEADER lpbi);
-
-
-#define ICDecompressBegin(hic, lpbiInput, lpbiOutput)  \
-    ICSendMessage(                                             \
-       hic, ICM_DECOMPRESS_BEGIN, (long)(void*)(lpbiInput),    \
-       (long)(void*)(lpbiOutput)                               \
-    )
-
-#define ICDecompressBeginEx(hic, lpbiInput, lpbiOutput)        \
-    ICUniversalEx(                                             \
-       hic, ICM_DECOMPRESSEX_BEGIN, (lpbiInput),               \
-       (lpbiOutput)                                            \
-    )
-
-#define ICDecompressQuery(hic, lpbiInput, lpbiOutput)          \
-    ICSendMessage(                                             \
-       hic,ICM_DECOMPRESS_QUERY, (long)(void*)(lpbiInput),     \
-       (long) (void*)(lpbiOutput)                              \
-    )
-
-#define ICDecompressQueryEx(hic, lpbiInput, lpbiOutput)        \
-    ICUniversalEx(                                             \
-       hic,ICM_DECOMPRESSEX_QUERY, (lpbiInput),                \
-       (lpbiOutput)                                            \
-    )
-
-#define ICDecompressGetFormat(hic, lpbiInput, lpbiOutput)              \
-    ((long)ICSendMessage(                                              \
-       hic,ICM_DECOMPRESS_GET_FORMAT, (long)(void*)(lpbiInput),        \
-       (long)(void*)(lpbiOutput)                                       \
-    ))
-
-#define ICDecompressGetFormatSize(hic, lpbi)                           \
-       ICDecompressGetFormat(hic, lpbi, NULL)
-
-#define ICDecompressGetPalette(hic, lpbiInput, lpbiOutput)             \
-    ICSendMessage(                                                     \
-       hic, ICM_DECOMPRESS_GET_PALETTE, (long)(void*)(lpbiInput),      \
-       (long)(void*)(lpbiOutput)                                       \
-    )
-
-#define ICDecompressSetPalette(hic,lpbiPalette)        \
-        ICSendMessage(                         \
-               hic,ICM_DECOMPRESS_SET_PALETTE,         \
-               (long)(void*)(lpbiPalette),0            \
-       )
-
-#define ICDecompressEnd(hic) ICSendMessage(hic, ICM_DECOMPRESS_END, 0, 0)
-#define ICDecompressEndEx(hic) ICSendMessage(hic,ICM_DECOMPRESSEX_END, 0, 0)
-
-#define ICDRAW_QUERY        0x00000001L   /* test for support */
-#define ICDRAW_FULLSCREEN   0x00000002L   /* draw to full screen */
-#define ICDRAW_HDC          0x00000004L   /* draw to a HDC/HWND */
-
-
-WIN_BOOL       VFWAPI  ICInfo(long fccType, long fccHandler, ICINFO * lpicinfo);
-LRESULT        VFWAPI  ICGetInfo(HIC hic,ICINFO *picinfo, long cb);
-HIC    VFWAPI  ICOpen(long fccType, long fccHandler, UINT wMode);
-//HIC  VFWAPI  ICOpenFunction(long fccType, long fccHandler, unsigned int wMode, void* lpfnHandler);
-
-LRESULT VFWAPI ICClose(HIC hic);
-LRESULT        VFWAPI ICSendMessage(HIC hic, unsigned int msg, long dw1, long dw2);
-//HIC  VFWAPI ICLocate(long fccType, long fccHandler, LPBITMAPINFOHEADER lpbiIn, LPBITMAPINFOHEADER lpbiOut, short wFlags);
-
-int VFWAPI ICDoSomething(void);
-
-long   VFWAPIV ICDrawBegin(
-        HIC                    hic,
-        long                   dwFlags,/* flags */
-        HPALETTE               hpal,   /* palette to draw with */
-        HWND                   hwnd,   /* window to draw to */
-        HDC                    hdc,    /* HDC to draw to */
-        INT                    xDst,   /* destination rectangle */
-        INT                    yDst,
-        INT                    dxDst,
-        INT                    dyDst,
-        LPBITMAPINFOHEADER     lpbi,   /* format of frame to draw */
-        INT                    xSrc,   /* source rectangle */
-        INT                    ySrc,
-        INT                    dxSrc,
-        INT                    dySrc,
-        long                   dwRate, /* frames/second = (dwRate/dwScale) */
-        long                   dwScale
-);
-
-/* as passed to ICM_DRAW_BEGIN (FIXME: correct only for Win32?)  */
-typedef struct {
-       long            dwFlags;
-       HPALETTE        hpal;
-       HWND            hwnd;
-       HDC             hdc;
-       INT             xDst;
-       INT             yDst;
-       INT             dxDst;
-       INT             dyDst;
-       LPBITMAPINFOHEADER      lpbi;
-       INT             xSrc;
-       INT             ySrc;
-       INT             dxSrc;
-       INT             dySrc;
-       long            dwRate;
-       long            dwScale;
-} ICDRAWBEGIN;
-
-#define ICDRAW_HURRYUP      0x80000000L   /* don't draw just buffer (hurry up!) */
-#define ICDRAW_UPDATE       0x40000000L   /* don't draw just update screen */
-#define ICDRAW_PREROLL      0x20000000L   /* this frame is before real start */
-#define ICDRAW_NULLFRAME    0x10000000L   /* repeat last frame */
-#define ICDRAW_NOTKEYFRAME  0x08000000L   /* this frame is not a key frame */
-
-typedef struct {
-       long    dwFlags;
-       void*   lpFormat;
-       void*   lpData;
-       long    cbData;
-       long    lTime;
-} ICDRAW;
-
-long VFWAPIV ICDraw(HIC hic,long dwFlags,void* lpFormat,void* lpData,long cbData,long lTime);
-
-
-#define        AVIGETFRAMEF_BESTDISPLAYFMT     1
-
-typedef struct _AVISTREAMINFOA {
-    long       fccType;
-    long       fccHandler;
-    long       dwFlags;        /* AVIIF_* */
-    long       dwCaps;
-    short      wPriority;
-    short      wLanguage;
-    long       dwScale;
-    long       dwRate;         /* dwRate / dwScale == samples/second */
-    long       dwStart;
-    long       dwLength;       /* In units above... */
-    long       dwInitialFrames;
-    long       dwSuggestedBufferSize;
-    long       dwQuality;
-    long       dwSampleSize;
-    RECT       rcFrame;
-    long       dwEditCount;
-    long       dwFormatChangeCount;
-    char       szName[64];
-} AVISTREAMINFOA, * LPAVISTREAMINFOA, *PAVISTREAMINFOA;
-
-typedef struct _AVISTREAMINFOW {
-    long       fccType;
-    long       fccHandler;
-    long       dwFlags;
-    long       dwCaps;
-    short      wPriority;
-    short      wLanguage;
-    long       dwScale;
-    long       dwRate;         /* dwRate / dwScale == samples/second */
-    long       dwStart;
-    long       dwLength;       /* In units above... */
-    long       dwInitialFrames;
-    long       dwSuggestedBufferSize;
-    long       dwQuality;
-    long       dwSampleSize;
-    RECT       rcFrame;
-    long       dwEditCount;
-    long       dwFormatChangeCount;
-    short      szName[64];
-} AVISTREAMINFOW, * LPAVISTREAMINFOW, *PAVISTREAMINFOW;
-DECL_WINELIB_TYPE_AW(AVISTREAMINFO)
-DECL_WINELIB_TYPE_AW(LPAVISTREAMINFO)
-DECL_WINELIB_TYPE_AW(PAVISTREAMINFO)
-
-#define AVISTREAMINFO_DISABLED         0x00000001
-#define AVISTREAMINFO_FORMATCHANGES    0x00010000
-
-/* AVIFILEINFO.dwFlags */
-#define AVIFILEINFO_HASINDEX           0x00000010
-#define AVIFILEINFO_MUSTUSEINDEX       0x00000020
-#define AVIFILEINFO_ISINTERLEAVED      0x00000100
-#define AVIFILEINFO_WASCAPTUREFILE     0x00010000
-#define AVIFILEINFO_COPYRIGHTED                0x00020000
-
-/* AVIFILEINFO.dwCaps */
-#define AVIFILECAPS_CANREAD            0x00000001
-#define AVIFILECAPS_CANWRITE           0x00000002
-#define AVIFILECAPS_ALLKEYFRAMES       0x00000010
-#define AVIFILECAPS_NOCOMPRESSION      0x00000020
-
-typedef struct _AVIFILEINFOW {
-    long               dwMaxBytesPerSec;
-    long               dwFlags;
-    long               dwCaps;
-    long               dwStreams;
-    long               dwSuggestedBufferSize;
-    long               dwWidth;
-    long               dwHeight;
-    long               dwScale;        
-    long               dwRate;
-    long               dwLength;
-    long               dwEditCount;
-    short               szFileType[64];
-} AVIFILEINFOW, * LPAVIFILEINFOW, *PAVIFILEINFOW;
-
-typedef struct _AVIFILEINFOA {
-    long               dwMaxBytesPerSec;
-    long               dwFlags;
-    long               dwCaps;
-    long               dwStreams;
-    long               dwSuggestedBufferSize;
-    long               dwWidth;
-    long               dwHeight;
-    long               dwScale;        
-    long               dwRate;
-    long               dwLength;
-    long               dwEditCount;
-    char               szFileType[64];
-} AVIFILEINFOA, * LPAVIFILEINFOA, *PAVIFILEINFOA;
-
-DECL_WINELIB_TYPE_AW(AVIFILEINFO)
-DECL_WINELIB_TYPE_AW(PAVIFILEINFO)
-DECL_WINELIB_TYPE_AW(LPAVIFILEINFO)
-
-/* AVICOMPRESSOPTIONS.dwFlags. determines presence of fields in below struct */
-#define AVICOMPRESSF_INTERLEAVE        0x00000001
-#define AVICOMPRESSF_DATARATE  0x00000002
-#define AVICOMPRESSF_KEYFRAMES 0x00000004
-#define AVICOMPRESSF_VALID     0x00000008
-
-typedef struct {
-    long       fccType;                /* stream type, for consistency */
-    long       fccHandler;             /* compressor */
-    long       dwKeyFrameEvery;        /* keyframe rate */
-    long       dwQuality;              /* compress quality 0-10,000 */
-    long       dwBytesPerSecond;       /* unsigned chars per second */
-    long       dwFlags;                /* flags... see below */
-    void*      lpFormat;               /* save format */
-    long       cbFormat;
-    void*      lpParms;                /* compressor options */
-    long       cbParms;
-    long       dwInterleaveEvery;      /* for non-video streams only */
-} AVICOMPRESSOPTIONS, *LPAVICOMPRESSOPTIONS,*PAVICOMPRESSOPTIONS;
-
-
-
-typedef struct {
-    long               cbSize;         // set to sizeof(COMPVARS) before
-                                       // calling ICCompressorChoose
-    long               dwFlags;        // see below...
-    HIC                        hic;            // HIC of chosen compressor
-    long               fccType;        // basically ICTYPE_VIDEO
-    long               fccHandler;     // handler of chosen compressor or
-                                       // "" or "DIB "
-    LPBITMAPINFO       lpbiIn;         // input format
-    LPBITMAPINFO       lpbiOut;        // output format - will compress to this
-    void*              lpBitsOut;
-    void*              lpBitsPrev;
-    long               lFrame;
-    long               lKey;           // key frames how often?
-    long               lDataRate;      // desired data rate KB/Sec
-    long               lQ;             // desired quality
-    long               lKeyCount;
-    void*              lpState;        // state of compressor
-    long               cbState;        // size of the state
-} COMPVARS, *PCOMPVARS;
-
-// FLAGS for dwFlags element of COMPVARS structure:
-
-
-#define AVIERR_OK              0
-#define MAKE_AVIERR(error)     MAKE_SCODE(SEVERITY_ERROR,FACILITY_ITF,0x4000+error)
-
-#define AVIERR_UNSUPPORTED     MAKE_AVIERR(101)
-#define AVIERR_BADFORMAT       MAKE_AVIERR(102)
-#define AVIERR_MEMORY          MAKE_AVIERR(103)
-#define AVIERR_INTERNAL                MAKE_AVIERR(104)
-#define AVIERR_BADFLAGS                MAKE_AVIERR(105)
-#define AVIERR_BADPARAM                MAKE_AVIERR(106)
-#define AVIERR_BADSIZE         MAKE_AVIERR(107)
-#define AVIERR_BADHANDLE       MAKE_AVIERR(108)
-#define AVIERR_FILEREAD                MAKE_AVIERR(109)
-#define AVIERR_FILEWRITE       MAKE_AVIERR(110)
-#define AVIERR_FILEOPEN                MAKE_AVIERR(111)
-#define AVIERR_COMPRESSOR      MAKE_AVIERR(112)
-#define AVIERR_NOCOMPRESSOR    MAKE_AVIERR(113)
-#define AVIERR_READONLY                MAKE_AVIERR(114)
-#define AVIERR_NODATA          MAKE_AVIERR(115)
-#define AVIERR_BUFFERTOOSMALL  MAKE_AVIERR(116)
-#define AVIERR_CANTCOMPRESS    MAKE_AVIERR(117)
-#define AVIERR_USERABORT       MAKE_AVIERR(198)
-#define AVIERR_ERROR           MAKE_AVIERR(199)
-
-#ifdef __cplusplus
-}
-#endif
-#endif /* __WINE_VFW_H */
diff --git a/modules/codec/loader/wine/winbase.h b/modules/codec/loader/wine/winbase.h
deleted file mode 100644 (file)
index 8746da8..0000000
+++ /dev/null
@@ -1,1791 +0,0 @@
-#ifndef __WINE_WINBASE_H
-#define __WINE_WINBASE_H
-
-#include "basetsd.h"
-#include "winnt.h"
-#include "winestring.h"
-#include "pshpack1.h"
-
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef struct tagCOORD {
-    INT16 x;
-    INT16 y;
-} COORD, *LPCOORD;
-
-
-  /* Windows Exit Procedure flag values */
-#define        WEP_FREE_DLL        0
-#define        WEP_SYSTEM_EXIT     1
-
-typedef DWORD CALLBACK (*LPTHREAD_START_ROUTINE)(LPVOID);
-
-#define EXCEPTION_DEBUG_EVENT       1
-#define CREATE_THREAD_DEBUG_EVENT   2
-#define CREATE_PROCESS_DEBUG_EVENT  3
-#define EXIT_THREAD_DEBUG_EVENT     4
-#define EXIT_PROCESS_DEBUG_EVENT    5
-#define LOAD_DLL_DEBUG_EVENT        6
-#define UNLOAD_DLL_DEBUG_EVENT      7
-#define OUTPUT_DEBUG_STRING_EVENT   8
-#define RIP_EVENT                   9
-
-typedef struct _EXCEPTION_DEBUG_INFO {
-    EXCEPTION_RECORD ExceptionRecord;
-    DWORD dwFirstChance;
-} EXCEPTION_DEBUG_INFO;
-
-typedef struct _CREATE_THREAD_DEBUG_INFO {
-    HANDLE hThread;
-    LPVOID lpThreadLocalBase;
-    LPTHREAD_START_ROUTINE lpStartAddress;
-} CREATE_THREAD_DEBUG_INFO;
-
-typedef struct _CREATE_PROCESS_DEBUG_INFO {
-    HANDLE hFile;
-    HANDLE hProcess;
-    HANDLE hThread;
-    LPVOID lpBaseOfImage;
-    DWORD dwDebugInfoFileOffset;
-    DWORD nDebugInfoSize;
-    LPVOID lpThreadLocalBase;
-    LPTHREAD_START_ROUTINE lpStartAddress;
-    LPVOID lpImageName;
-    WORD fUnicode;
-} CREATE_PROCESS_DEBUG_INFO;
-
-typedef struct _EXIT_THREAD_DEBUG_INFO {
-    DWORD dwExitCode;
-} EXIT_THREAD_DEBUG_INFO;
-
-typedef struct _EXIT_PROCESS_DEBUG_INFO {
-    DWORD dwExitCode;
-} EXIT_PROCESS_DEBUG_INFO;
-
-typedef struct _LOAD_DLL_DEBUG_INFO {
-    HANDLE hFile;
-    LPVOID   lpBaseOfDll;
-    DWORD    dwDebugInfoFileOffset;
-    DWORD    nDebugInfoSize;
-    LPVOID   lpImageName;
-    WORD     fUnicode;
-} LOAD_DLL_DEBUG_INFO;
-
-typedef struct _UNLOAD_DLL_DEBUG_INFO {
-    LPVOID lpBaseOfDll;
-} UNLOAD_DLL_DEBUG_INFO;
-
-typedef struct _OUTPUT_DEBUG_STRING_INFO {
-    LPSTR lpDebugStringData;
-    WORD  fUnicode;
-    WORD  nDebugStringLength;
-} OUTPUT_DEBUG_STRING_INFO;
-
-typedef struct _RIP_INFO {
-    DWORD dwError;
-    DWORD dwType;
-} RIP_INFO;
-
-typedef struct _DEBUG_EVENT {
-    DWORD dwDebugEventCode;
-    DWORD dwProcessId;
-    DWORD dwThreadId;
-    union {
-        EXCEPTION_DEBUG_INFO      Exception;
-        CREATE_THREAD_DEBUG_INFO  CreateThread;
-        CREATE_PROCESS_DEBUG_INFO CreateProcessInfo;
-        EXIT_THREAD_DEBUG_INFO    ExitThread;
-        EXIT_PROCESS_DEBUG_INFO   ExitProcess;
-        LOAD_DLL_DEBUG_INFO       LoadDll;
-        UNLOAD_DLL_DEBUG_INFO     UnloadDll;
-        OUTPUT_DEBUG_STRING_INFO  DebugString;
-        RIP_INFO                  RipInfo;
-    } u;
-} DEBUG_EVENT, *LPDEBUG_EVENT;
-
-#define OFS_MAXPATHNAME 128
-typedef struct
-{
-    BYTE cBytes;
-    BYTE fFixedDisk;
-    WORD nErrCode;
-    BYTE reserved[4];
-    BYTE szPathName[OFS_MAXPATHNAME];
-} OFSTRUCT, *LPOFSTRUCT;
-
-#define OF_READ               0x0000
-#define OF_WRITE              0x0001
-#define OF_READWRITE          0x0002
-#define OF_SHARE_COMPAT       0x0000
-#define OF_SHARE_EXCLUSIVE    0x0010
-#define OF_SHARE_DENY_WRITE   0x0020
-#define OF_SHARE_DENY_READ    0x0030
-#define OF_SHARE_DENY_NONE    0x0040
-#define OF_PARSE              0x0100
-#define OF_DELETE             0x0200
-#define OF_VERIFY             0x0400   /* Used with OF_REOPEN */
-#define OF_SEARCH             0x0400   /* Used without OF_REOPEN */
-#define OF_CANCEL             0x0800
-#define OF_CREATE             0x1000
-#define OF_PROMPT             0x2000
-#define OF_EXIST              0x4000
-#define OF_REOPEN             0x8000
-
-/* SetErrorMode values */
-#define SEM_FAILCRITICALERRORS      0x0001
-#define SEM_NOGPFAULTERRORBOX       0x0002
-#define SEM_NOALIGNMENTFAULTEXCEPT  0x0004
-#define SEM_NOOPENFILEERRORBOX      0x8000
-
-/* CopyFileEx flags */
-#define COPY_FILE_FAIL_IF_EXISTS        0x00000001
-#define COPY_FILE_RESTARTABLE           0x00000002
-#define COPY_FILE_OPEN_SOURCE_FOR_WRITE 0x00000004
-
-/* GetTempFileName() Flags */
-#define TF_FORCEDRIVE          0x80
-
-#define DRIVE_CANNOTDETERMINE      0
-#define DRIVE_DOESNOTEXIST         1
-#define DRIVE_REMOVABLE            2
-#define DRIVE_FIXED                3
-#define DRIVE_REMOTE               4
-/* Win32 additions */
-#define DRIVE_CDROM                5
-#define DRIVE_RAMDISK              6
-
-/* The security attributes structure */
-typedef struct _SECURITY_ATTRIBUTES
-{
-    DWORD   nLength;
-    LPVOID  lpSecurityDescriptor;
-    WIN_BOOL  bInheritHandle;
-} SECURITY_ATTRIBUTES, *PSECURITY_ATTRIBUTES, *LPSECURITY_ATTRIBUTES;
-
-#ifndef _FILETIME_
-#define _FILETIME_
-/* 64 bit number of 100 nanoseconds intervals since January 1, 1601 */
-typedef struct
-{
-  DWORD  dwLowDateTime;
-  DWORD  dwHighDateTime;
-} FILETIME, *LPFILETIME;
-#endif /* _FILETIME_ */
-
-/* Find* structures */
-typedef struct
-{
-    DWORD     dwFileAttributes;
-    FILETIME  ftCreationTime;
-    FILETIME  ftLastAccessTime;
-    FILETIME  ftLastWriteTime;
-    DWORD     nFileSizeHigh;
-    DWORD     nFileSizeLow;
-    DWORD     dwReserved0;
-    DWORD     dwReserved1;
-    CHAR      cFileName[260];
-    CHAR      cAlternateFileName[14];
-} WIN32_FIND_DATAA, *LPWIN32_FIND_DATAA;
-
-typedef struct
-{
-    DWORD     dwFileAttributes;
-    FILETIME  ftCreationTime;
-    FILETIME  ftLastAccessTime;
-    FILETIME  ftLastWriteTime;
-    DWORD     nFileSizeHigh;
-    DWORD     nFileSizeLow;
-    DWORD     dwReserved0;
-    DWORD     dwReserved1;
-    WCHAR     cFileName[260];
-    WCHAR     cAlternateFileName[14];
-} WIN32_FIND_DATAW, *LPWIN32_FIND_DATAW;
-
-DECL_WINELIB_TYPE_AW(WIN32_FIND_DATA)
-DECL_WINELIB_TYPE_AW(LPWIN32_FIND_DATA)
-
-typedef struct
-{
-    LPVOID lpData;
-    DWORD cbData;
-    BYTE cbOverhead;
-    BYTE iRegionIndex;
-    WORD wFlags;
-    union {
-        struct {
-            HANDLE hMem;
-            DWORD dwReserved[3];
-        } Block;
-        struct {
-            DWORD dwCommittedSize;
-            DWORD dwUnCommittedSize;
-            LPVOID lpFirstBlock;
-            LPVOID lpLastBlock;
-        } Region;
-    } Foo;
-} PROCESS_HEAP_ENTRY, *LPPROCESS_HEAP_ENTRY;
-
-#define PROCESS_HEAP_REGION                   0x0001
-#define PROCESS_HEAP_UNCOMMITTED_RANGE        0x0002
-#define PROCESS_HEAP_ENTRY_BUSY               0x0004
-#define PROCESS_HEAP_ENTRY_MOVEABLE           0x0010
-#define PROCESS_HEAP_ENTRY_DDESHARE           0x0020
-
-#define INVALID_HANDLE_VALUE16  ((HANDLE16) -1)
-#define INVALID_HANDLE_VALUE  ((HANDLE) -1)
-
-#define TLS_OUT_OF_INDEXES ((DWORD)0xFFFFFFFF)
-
-/* comm */
-
-#define CBR_110        0xFF10
-#define CBR_300        0xFF11
-#define CBR_600        0xFF12
-#define CBR_1200       0xFF13
-#define CBR_2400       0xFF14
-#define CBR_4800       0xFF15
-#define CBR_9600       0xFF16
-#define CBR_14400      0xFF17
-#define CBR_19200      0xFF18
-#define CBR_38400      0xFF1B
-#define CBR_56000      0xFF1F
-#define CBR_128000     0xFF23
-#define CBR_256000     0xFF27
-
-#define NOPARITY       0
-#define ODDPARITY      1
-#define EVENPARITY     2
-#define MARKPARITY     3
-#define SPACEPARITY    4
-#define ONESTOPBIT     0
-#define ONE5STOPBITS   1
-#define TWOSTOPBITS    2
-
-#define IGNORE         0
-#define INFINITE16      0xFFFF
-#define INFINITE      0xFFFFFFFF
-
-#define CE_RXOVER      0x0001
-#define CE_OVERRUN     0x0002
-#define CE_RXPARITY    0x0004
-#define CE_FRAME       0x0008
-#define CE_BREAK       0x0010
-#define CE_CTSTO       0x0020
-#define CE_DSRTO       0x0040
-#define CE_RLSDTO      0x0080
-#define CE_TXFULL      0x0100
-#define CE_PTO         0x0200
-#define CE_IOE         0x0400
-#define CE_DNS         0x0800
-#define CE_OOP         0x1000
-#define CE_MODE        0x8000
-
-#define IE_BADID       -1
-#define IE_OPEN        -2
-#define IE_NOPEN       -3
-#define IE_MEMORY      -4
-#define IE_DEFAULT     -5
-#define IE_HARDWARE    -10
-#define IE_BYTESIZE    -11
-#define IE_BAUDRATE    -12
-
-#define EV_RXCHAR      0x0001
-#define EV_RXFLAG      0x0002
-#define EV_TXEMPTY     0x0004
-#define EV_CTS         0x0008
-#define EV_DSR         0x0010
-#define EV_RLSD        0x0020
-#define EV_BREAK       0x0040
-#define EV_ERR         0x0080
-#define EV_RING        0x0100
-#define EV_PERR        0x0200
-#define EV_CTSS        0x0400
-#define EV_DSRS        0x0800
-#define EV_RLSDS       0x1000
-#define EV_RINGTE      0x2000
-#define EV_RingTe      EV_RINGTE
-
-#define SETXOFF        1
-#define SETXON         2
-#define SETRTS         3
-#define CLRRTS         4
-#define SETDTR         5
-#define CLRDTR         6
-#define RESETDEV       7
-#define SETBREAK       8
-#define CLRBREAK       9
-
-#define GETBASEIRQ     10
-
-/* Purge functions for Comm Port */
-#define PURGE_TXABORT       0x0001  /* Kill the pending/current writes to the 
-                                      comm port */
-#define PURGE_RXABORT       0x0002  /*Kill the pending/current reads to 
-                                    the comm port */
-#define PURGE_TXCLEAR       0x0004  /* Kill the transmit queue if there*/
-#define PURGE_RXCLEAR       0x0008  /* Kill the typeahead buffer if there*/
-
-
-/* Modem Status Flags */
-#define MS_CTS_ON           ((DWORD)0x0010)
-#define MS_DSR_ON           ((DWORD)0x0020)
-#define MS_RING_ON          ((DWORD)0x0040)
-#define MS_RLSD_ON          ((DWORD)0x0080)
-
-#define        RTS_CONTROL_DISABLE     0
-#define        RTS_CONTROL_ENABLE      1
-#define        RTS_CONTROL_HANDSHAKE   2
-#define        RTS_CONTROL_TOGGLE      3
-
-#define        DTR_CONTROL_DISABLE     0
-#define        DTR_CONTROL_ENABLE      1
-#define        DTR_CONTROL_HANDSHAKE   2
-
-#define CSTF_CTSHOLD   0x01
-#define CSTF_DSRHOLD   0x02
-#define CSTF_RLSDHOLD  0x04
-#define CSTF_XOFFHOLD  0x08
-#define CSTF_XOFFSENT  0x10
-#define CSTF_EOF       0x20
-#define CSTF_TXIM      0x40
-
-#define MAKEINTRESOURCEA(i) (LPSTR)((DWORD)((WORD)(i)))
-#define MAKEINTRESOURCEW(i) (LPWSTR)((DWORD)((WORD)(i)))
-#define MAKEINTRESOURCE WINELIB_NAME_AW(MAKEINTRESOURCE)
-
-/* Predefined resource types */
-#define RT_CURSORA         MAKEINTRESOURCEA(1)
-#define RT_CURSORW         MAKEINTRESOURCEW(1)
-#define RT_CURSOR            WINELIB_NAME_AW(RT_CURSOR)
-#define RT_BITMAPA         MAKEINTRESOURCEA(2)
-#define RT_BITMAPW         MAKEINTRESOURCEW(2)
-#define RT_BITMAP            WINELIB_NAME_AW(RT_BITMAP)
-#define RT_ICONA           MAKEINTRESOURCEA(3)
-#define RT_ICONW           MAKEINTRESOURCEW(3)
-#define RT_ICON              WINELIB_NAME_AW(RT_ICON)
-#define RT_MENUA           MAKEINTRESOURCEA(4)
-#define RT_MENUW           MAKEINTRESOURCEW(4)
-#define RT_MENU              WINELIB_NAME_AW(RT_MENU)
-#define RT_DIALOGA         MAKEINTRESOURCEA(5)
-#define RT_DIALOGW         MAKEINTRESOURCEW(5)
-#define RT_DIALOG            WINELIB_NAME_AW(RT_DIALOG)
-#define RT_STRINGA         MAKEINTRESOURCEA(6)
-#define RT_STRINGW         MAKEINTRESOURCEW(6)
-#define RT_STRING            WINELIB_NAME_AW(RT_STRING)
-#define RT_FONTDIRA        MAKEINTRESOURCEA(7)
-#define RT_FONTDIRW        MAKEINTRESOURCEW(7)
-#define RT_FONTDIR           WINELIB_NAME_AW(RT_FONTDIR)
-#define RT_FONTA           MAKEINTRESOURCEA(8)
-#define RT_FONTW           MAKEINTRESOURCEW(8)
-#define RT_FONT              WINELIB_NAME_AW(RT_FONT)
-#define RT_ACCELERATORA    MAKEINTRESOURCEA(9)
-#define RT_ACCELERATORW    MAKEINTRESOURCEW(9)
-#define RT_ACCELERATOR       WINELIB_NAME_AW(RT_ACCELERATOR)
-#define RT_RCDATAA         MAKEINTRESOURCEA(10)
-#define RT_RCDATAW         MAKEINTRESOURCEW(10)
-#define RT_RCDATA            WINELIB_NAME_AW(RT_RCDATA)
-#define RT_MESSAGELISTA    MAKEINTRESOURCEA(11)
-#define RT_MESSAGELISTW    MAKEINTRESOURCEW(11)
-#define RT_MESSAGELIST       WINELIB_NAME_AW(RT_MESSAGELIST)
-#define RT_GROUP_CURSORA   MAKEINTRESOURCEA(12)
-#define RT_GROUP_CURSORW   MAKEINTRESOURCEW(12)
-#define RT_GROUP_CURSOR      WINELIB_NAME_AW(RT_GROUP_CURSOR)
-#define RT_GROUP_ICONA     MAKEINTRESOURCEA(14)
-#define RT_GROUP_ICONW     MAKEINTRESOURCEW(14)
-#define RT_GROUP_ICON        WINELIB_NAME_AW(RT_GROUP_ICON)
-
-
-#define LMEM_FIXED          0   
-#define LMEM_MOVEABLE       0x0002
-#define LMEM_NOCOMPACT      0x0010
-#define LMEM_NODISCARD      0x0020
-#define LMEM_ZEROINIT       0x0040
-#define LMEM_MODIFY         0x0080
-#define LMEM_DISCARDABLE    0x0F00
-#define LMEM_DISCARDED     0x4000
-#define LMEM_LOCKCOUNT     0x00FF
-
-#define LPTR (LMEM_FIXED | LMEM_ZEROINIT)
-
-#define GMEM_FIXED          0x0000
-#define GMEM_MOVEABLE       0x0002
-#define GMEM_NOCOMPACT      0x0010
-#define GMEM_NODISCARD      0x0020
-#define GMEM_ZEROINIT       0x0040
-#define GMEM_MODIFY         0x0080
-#define GMEM_DISCARDABLE    0x0100
-#define GMEM_NOT_BANKED     0x1000
-#define GMEM_SHARE          0x2000
-#define GMEM_DDESHARE       0x2000
-#define GMEM_NOTIFY         0x4000
-#define GMEM_LOWER          GMEM_NOT_BANKED
-#define GMEM_DISCARDED      0x4000
-#define GMEM_LOCKCOUNT      0x00ff
-#define GMEM_INVALID_HANDLE 0x8000
-
-#define GHND                (GMEM_MOVEABLE | GMEM_ZEROINIT)
-#define GPTR                (GMEM_FIXED | GMEM_ZEROINIT)
-
-
-typedef struct tagMEMORYSTATUS
-{
-    DWORD    dwLength;
-    DWORD    dwMemoryLoad;
-    DWORD    dwTotalPhys;
-    DWORD    dwAvailPhys;
-    DWORD    dwTotalPageFile;
-    DWORD    dwAvailPageFile;
-    DWORD    dwTotalVirtual;
-    DWORD    dwAvailVirtual;
-} MEMORYSTATUS, *LPMEMORYSTATUS;
-
-
-#ifndef NOLOGERROR
-
-/* LogParamError and LogError values */
-
-/* Error modifier bits */
-#define ERR_WARNING             0x8000
-#define ERR_PARAM               0x4000
-
-#define ERR_SIZE_MASK           0x3000
-#define ERR_BYTE                0x1000
-#define ERR_WORD                0x2000
-#define ERR_DWORD               0x3000
-
-/* LogParamError() values */
-
-/* Generic parameter values */
-#define ERR_BAD_VALUE           0x6001
-#define ERR_BAD_FLAGS           0x6002
-#define ERR_BAD_INDEX           0x6003
-#define ERR_BAD_DVALUE          0x7004
-#define ERR_BAD_DFLAGS          0x7005
-#define ERR_BAD_DINDEX          0x7006
-#define ERR_BAD_PTR             0x7007
-#define ERR_BAD_FUNC_PTR        0x7008
-#define ERR_BAD_SELECTOR        0x6009
-#define ERR_BAD_STRING_PTR      0x700a
-#define ERR_BAD_HANDLE          0x600b
-
-/* KERNEL parameter errors */
-#define ERR_BAD_HINSTANCE       0x6020
-#define ERR_BAD_HMODULE         0x6021
-#define ERR_BAD_GLOBAL_HANDLE   0x6022
-#define ERR_BAD_LOCAL_HANDLE    0x6023
-#define ERR_BAD_ATOM            0x6024
-#define ERR_BAD_HFILE           0x6025
-
-/* USER parameter errors */
-#define ERR_BAD_HWND            0x6040
-#define ERR_BAD_HMENU           0x6041
-#define ERR_BAD_HCURSOR         0x6042
-#define ERR_BAD_HICON           0x6043
-#define ERR_BAD_HDWP            0x6044
-#define ERR_BAD_CID             0x6045
-#define ERR_BAD_HDRVR           0x6046
-
-/* GDI parameter errors */
-#define ERR_BAD_COORDS          0x7060
-#define ERR_BAD_GDI_OBJECT      0x6061
-#define ERR_BAD_HDC             0x6062
-#define ERR_BAD_HPEN            0x6063
-#define ERR_BAD_HFONT           0x6064
-#define ERR_BAD_HBRUSH          0x6065
-#define ERR_BAD_HBITMAP         0x6066
-#define ERR_BAD_HRGN            0x6067
-#define ERR_BAD_HPALETTE        0x6068
-#define ERR_BAD_HMETAFILE       0x6069
-
-
-/* LogError() values */
-
-/* KERNEL errors */
-#define ERR_GALLOC              0x0001
-#define ERR_GREALLOC            0x0002
-#define ERR_GLOCK               0x0003
-#define ERR_LALLOC              0x0004
-#define ERR_LREALLOC            0x0005
-#define ERR_LLOCK               0x0006
-#define ERR_ALLOCRES            0x0007
-#define ERR_LOCKRES             0x0008
-#define ERR_LOADMODULE          0x0009
-
-/* USER errors */
-#define ERR_CREATEDLG           0x0040
-#define ERR_CREATEDLG2          0x0041
-#define ERR_REGISTERCLASS       0x0042
-#define ERR_DCBUSY              0x0043
-#define ERR_CREATEWND           0x0044
-#define ERR_STRUCEXTRA          0x0045
-#define ERR_LOADSTR             0x0046
-#define ERR_LOADMENU            0x0047
-#define ERR_NESTEDBEGINPAINT    0x0048
-#define ERR_BADINDEX            0x0049
-#define ERR_CREATEMENU          0x004a
-
-/* GDI errors */
-#define ERR_CREATEDC            0x0080
-#define ERR_CREATEMETA          0x0081
-#define ERR_DELOBJSELECTED      0x0082
-#define ERR_SELBITMAP           0x0083
-
-
-
-/* Debugging support (DEBUG SYSTEM ONLY) */
-typedef struct
-{
-    UINT16  flags;
-    DWORD   dwOptions WINE_PACKED;
-    DWORD   dwFilter WINE_PACKED;
-    CHAR    achAllocModule[8] WINE_PACKED;
-    DWORD   dwAllocBreak WINE_PACKED;
-    DWORD   dwAllocCount WINE_PACKED;
-} WINDEBUGINFO, *LPWINDEBUGINFO;
-
-/* WINDEBUGINFO flags values */
-#define WDI_OPTIONS         0x0001
-#define WDI_FILTER          0x0002
-#define WDI_ALLOCBREAK      0x0004
-
-/* dwOptions values */
-#define DBO_CHECKHEAP       0x0001
-#define DBO_BUFFERFILL      0x0004
-#define DBO_DISABLEGPTRAPPING 0x0010
-#define DBO_CHECKFREE       0x0020
-
-#define DBO_SILENT          0x8000
-
-#define DBO_TRACEBREAK      0x2000
-#define DBO_WARNINGBREAK    0x1000
-#define DBO_NOERRORBREAK    0x0800
-#define DBO_NOFATALBREAK    0x0400
-#define DBO_INT3BREAK       0x0100
-
-/* DebugOutput flags values */
-#define DBF_TRACE           0x0000
-#define DBF_WARNING         0x4000
-#define DBF_ERROR           0x8000
-#define DBF_FATAL           0xc000
-
-/* dwFilter values */
-#define DBF_KERNEL          0x1000
-#define DBF_KRN_MEMMAN      0x0001
-#define DBF_KRN_LOADMODULE  0x0002
-#define DBF_KRN_SEGMENTLOAD 0x0004
-#define DBF_USER            0x0800
-#define DBF_GDI             0x0400
-#define DBF_MMSYSTEM        0x0040
-#define DBF_PENWIN          0x0020
-#define DBF_APPLICATION     0x0008
-#define DBF_DRIVER          0x0010
-
-#endif /* NOLOGERROR */
-
-typedef struct {
-        WORD wYear;
-        WORD wMonth;
-        WORD wDayOfWeek;
-        WORD wDay;
-        WORD wHour;
-        WORD wMinute;
-        WORD wSecond;
-        WORD wMilliseconds;
-} SYSTEMTIME, *LPSYSTEMTIME;
-
-/* The 'overlapped' data structure used by async I/O functions.
- */
-typedef struct {
-        DWORD Internal;
-        DWORD InternalHigh;
-        DWORD Offset;
-        DWORD OffsetHigh;
-        HANDLE hEvent;
-} OVERLAPPED, *LPOVERLAPPED;
-
-/* Process startup information.
- */
-
-/* STARTUPINFO.dwFlags */
-#define        STARTF_USESHOWWINDOW    0x00000001
-#define        STARTF_USESIZE          0x00000002
-#define        STARTF_USEPOSITION      0x00000004
-#define        STARTF_USECOUNTCHARS    0x00000008
-#define        STARTF_USEFILLATTRIBUTE 0x00000010
-#define        STARTF_RUNFULLSCREEN    0x00000020
-#define        STARTF_FORCEONFEEDBACK  0x00000040
-#define        STARTF_FORCEOFFFEEDBACK 0x00000080
-#define        STARTF_USESTDHANDLES    0x00000100
-#define        STARTF_USEHOTKEY        0x00000200
-
-typedef struct {
-        DWORD cb;              /* 00: size of struct */
-        LPSTR lpReserved;      /* 04: */
-        LPSTR lpDesktop;       /* 08: */
-        LPSTR lpTitle;         /* 0c: */
-        DWORD dwX;             /* 10: */
-        DWORD dwY;             /* 14: */
-        DWORD dwXSize;         /* 18: */
-        DWORD dwYSize;         /* 1c: */
-        DWORD dwXCountChars;   /* 20: */
-        DWORD dwYCountChars;   /* 24: */
-        DWORD dwFillAttribute; /* 28: */
-        DWORD dwFlags;         /* 2c: */
-        WORD wShowWindow;      /* 30: */
-        WORD cbReserved2;      /* 32: */
-        BYTE *lpReserved2;     /* 34: */
-        HANDLE hStdInput;      /* 38: */
-        HANDLE hStdOutput;     /* 3c: */
-        HANDLE hStdError;      /* 40: */
-} STARTUPINFOA, *LPSTARTUPINFOA;
-
-typedef struct {
-        DWORD cb;
-        LPWSTR lpReserved;
-        LPWSTR lpDesktop;
-        LPWSTR lpTitle;
-        DWORD dwX;
-        DWORD dwY;
-        DWORD dwXSize;
-        DWORD dwYSize;
-        DWORD dwXCountChars;
-        DWORD dwYCountChars;
-        DWORD dwFillAttribute;
-        DWORD dwFlags;
-        WORD wShowWindow;
-        WORD cbReserved2;
-        BYTE *lpReserved2;
-        HANDLE hStdInput;
-        HANDLE hStdOutput;
-        HANDLE hStdError;
-} STARTUPINFOW, *LPSTARTUPINFOW;
-
-DECL_WINELIB_TYPE_AW(STARTUPINFO)
-DECL_WINELIB_TYPE_AW(LPSTARTUPINFO)
-
-typedef struct {
-       HANDLE  hProcess;
-       HANDLE  hThread;
-       DWORD           dwProcessId;
-       DWORD           dwThreadId;
-} PROCESS_INFORMATION,*LPPROCESS_INFORMATION;
-
-typedef struct {
-        LONG Bias;
-        WCHAR StandardName[32];
-        SYSTEMTIME StandardDate;
-        LONG StandardBias;
-        WCHAR DaylightName[32];
-        SYSTEMTIME DaylightDate;
-        LONG DaylightBias;
-} TIME_ZONE_INFORMATION, *LPTIME_ZONE_INFORMATION;
-
-#define TIME_ZONE_ID_UNKNOWN    0
-#define TIME_ZONE_ID_STANDARD   1
-#define TIME_ZONE_ID_DAYLIGHT   2
-
-/* CreateProcess: dwCreationFlag values
- */
-#define DEBUG_PROCESS               0x00000001
-#define DEBUG_ONLY_THIS_PROCESS     0x00000002
-#define CREATE_SUSPENDED            0x00000004
-#define DETACHED_PROCESS            0x00000008
-#define CREATE_NEW_CONSOLE          0x00000010
-#define NORMAL_PRIORITY_CLASS       0x00000020
-#define IDLE_PRIORITY_CLASS         0x00000040
-#define HIGH_PRIORITY_CLASS         0x00000080
-#define REALTIME_PRIORITY_CLASS     0x00000100
-#define CREATE_NEW_PROCESS_GROUP    0x00000200
-#define CREATE_UNICODE_ENVIRONMENT  0x00000400
-#define CREATE_SEPARATE_WOW_VDM     0x00000800
-#define CREATE_SHARED_WOW_VDM       0x00001000
-#define CREATE_DEFAULT_ERROR_MODE   0x04000000
-#define CREATE_NO_WINDOW            0x08000000
-#define PROFILE_USER                0x10000000
-#define PROFILE_KERNEL              0x20000000
-#define PROFILE_SERVER              0x40000000
-
-
-/* File object type definitions
- */
-#define FILE_TYPE_UNKNOWN       0
-#define FILE_TYPE_DISK          1
-#define FILE_TYPE_CHAR          2
-#define FILE_TYPE_PIPE          3
-#define FILE_TYPE_REMOTE        32768
-
-/* File creation flags
- */
-#define FILE_FLAG_WRITE_THROUGH    0x80000000UL
-#define FILE_FLAG_OVERLAPPED      0x40000000L
-#define FILE_FLAG_NO_BUFFERING     0x20000000L
-#define FILE_FLAG_RANDOM_ACCESS    0x10000000L
-#define FILE_FLAG_SEQUENTIAL_SCAN  0x08000000L
-#define FILE_FLAG_DELETE_ON_CLOSE  0x04000000L
-#define FILE_FLAG_BACKUP_SEMANTICS 0x02000000L
-#define FILE_FLAG_POSIX_SEMANTICS  0x01000000L
-#define CREATE_NEW              1
-#define CREATE_ALWAYS           2
-#define OPEN_EXISTING           3
-#define OPEN_ALWAYS             4
-#define TRUNCATE_EXISTING       5
-
-/* Standard handle identifiers
- */
-#define STD_INPUT_HANDLE        ((DWORD) -10)
-#define STD_OUTPUT_HANDLE       ((DWORD) -11)
-#define STD_ERROR_HANDLE        ((DWORD) -12)
-
-typedef struct
-{
-  int dwFileAttributes;
-  FILETIME ftCreationTime;
-  FILETIME ftLastAccessTime;
-  FILETIME ftLastWriteTime;
-  int dwVolumeSerialNumber;
-  int nFileSizeHigh;
-  int nFileSizeLow;
-  int nNumberOfLinks;
-  int nFileIndexHigh;
-  int nFileIndexLow;
-} BY_HANDLE_FILE_INFORMATION ;
-
-
-typedef struct _SYSTEM_POWER_STATUS
-{
-  WIN_BOOL16  ACLineStatus;
-  BYTE    BatteryFlag;
-  BYTE    BatteryLifePercent;
-  BYTE    reserved;
-  DWORD   BatteryLifeTime;
-  DWORD   BatteryFullLifeTime;
-} SYSTEM_POWER_STATUS, *LPSYSTEM_POWER_STATUS;
-
-typedef struct _MEMORY_BASIC_INFORMATION
-{
-    LPVOID   BaseAddress;
-    LPVOID   AllocationBase;
-    DWORD    AllocationProtect;
-    DWORD    RegionSize;
-    DWORD    State;
-    DWORD    Protect;
-    DWORD    Type;
-} MEMORY_BASIC_INFORMATION,*LPMEMORY_BASIC_INFORMATION;
-
-
-typedef WIN_BOOL CALLBACK (*CODEPAGE_ENUMPROCA)(LPSTR);
-typedef WIN_BOOL CALLBACK (*CODEPAGE_ENUMPROCW)(LPWSTR);
-DECL_WINELIB_TYPE_AW(CODEPAGE_ENUMPROC)
-typedef WIN_BOOL CALLBACK (*LOCALE_ENUMPROCA)(LPSTR);
-typedef WIN_BOOL CALLBACK (*LOCALE_ENUMPROCW)(LPWSTR);
-DECL_WINELIB_TYPE_AW(LOCALE_ENUMPROC)
-
-typedef struct tagSYSTEM_INFO
-{
-    union {
-       DWORD   dwOemId; /* Obsolete field - do not use */
-       struct {
-               WORD wProcessorArchitecture;
-               WORD wReserved;
-       } DUMMYSTRUCTNAME;
-    } DUMMYUNIONNAME;
-    DWORD      dwPageSize;
-    LPVOID     lpMinimumApplicationAddress;
-    LPVOID     lpMaximumApplicationAddress;
-    DWORD      dwActiveProcessorMask;
-    DWORD      dwNumberOfProcessors;
-    DWORD      dwProcessorType;
-    DWORD      dwAllocationGranularity;
-    WORD       wProcessorLevel;
-    WORD       wProcessorRevision;
-} SYSTEM_INFO, *LPSYSTEM_INFO;
-
-/* {G,S}etPriorityClass */
-#define        NORMAL_PRIORITY_CLASS   0x00000020
-#define        IDLE_PRIORITY_CLASS     0x00000040
-#define        HIGH_PRIORITY_CLASS     0x00000080
-#define        REALTIME_PRIORITY_CLASS 0x00000100
-
-typedef WIN_BOOL CALLBACK (*ENUMRESTYPEPROCA)(HMODULE,LPSTR,LONG);
-typedef WIN_BOOL CALLBACK (*ENUMRESTYPEPROCW)(HMODULE,LPWSTR,LONG);
-typedef WIN_BOOL CALLBACK (*ENUMRESNAMEPROCA)(HMODULE,LPCSTR,LPSTR,LONG);
-typedef WIN_BOOL CALLBACK (*ENUMRESNAMEPROCW)(HMODULE,LPCWSTR,LPWSTR,LONG);
-typedef WIN_BOOL CALLBACK (*ENUMRESLANGPROCA)(HMODULE,LPCSTR,LPCSTR,WORD,LONG);
-typedef WIN_BOOL CALLBACK (*ENUMRESLANGPROCW)(HMODULE,LPCWSTR,LPCWSTR,WORD,LONG);
-
-DECL_WINELIB_TYPE_AW(ENUMRESTYPEPROC)
-DECL_WINELIB_TYPE_AW(ENUMRESNAMEPROC)
-DECL_WINELIB_TYPE_AW(ENUMRESLANGPROC)
-
-/* flags that can be passed to LoadLibraryEx */
-#define        DONT_RESOLVE_DLL_REFERENCES     0x00000001
-#define        LOAD_LIBRARY_AS_DATAFILE        0x00000002
-#define        LOAD_WITH_ALTERED_SEARCH_PATH   0x00000008
-
-/* ifdef _x86_ ... */
-typedef struct _LDT_ENTRY {
-    WORD       LimitLow;
-    WORD       BaseLow;
-    union {
-       struct {
-           BYTE        BaseMid;
-           BYTE        Flags1;/*Declare as bytes to avoid alignment problems */
-           BYTE        Flags2; 
-           BYTE        BaseHi;
-       } Bytes;
-       struct {            
-           unsigned    BaseMid         : 8;
-           unsigned    Type            : 5;
-           unsigned    Dpl             : 2;
-           unsigned    Pres            : 1;
-           unsigned    LimitHi         : 4;
-           unsigned    Sys             : 1;
-           unsigned    Reserved_0      : 1;
-           unsigned    Default_Big     : 1;
-           unsigned    Granularity     : 1;
-           unsigned    BaseHi          : 8;
-       } Bits;
-    } HighWord;
-} LDT_ENTRY, *LPLDT_ENTRY;
-
-
-typedef enum _GET_FILEEX_INFO_LEVELS {
-    GetFileExInfoStandard
-} GET_FILEEX_INFO_LEVELS;
-
-typedef struct _WIN32_FILE_ATTRIBUTES_DATA {
-    DWORD    dwFileAttributes;
-    FILETIME ftCreationTime;
-    FILETIME ftLastAccessTime;
-    FILETIME ftLastWriteTime;
-    DWORD    nFileSizeHigh;
-    DWORD    nFileSizeLow;
-} WIN32_FILE_ATTRIBUTE_DATA, *LPWIN32_FILE_ATTRIBUTE_DATA;
-
-typedef struct _DllVersionInfo {
-    DWORD cbSize;
-    DWORD dwMajorVersion;
-    DWORD dwMinorVersion;
-    DWORD dwBuildNumber;
-    DWORD dwPlatformID;
-} DLLVERSIONINFO;
-
-/*
- * This one seems to be a Win32 only definition. It also is defined with
- * WINAPI instead of CALLBACK in the windows headers.
- */
-typedef DWORD WINAPI (*LPPROGRESS_ROUTINE)(LARGE_INTEGER, LARGE_INTEGER, LARGE_INTEGER, 
-                                           LARGE_INTEGER, DWORD, DWORD, HANDLE,
-                                           HANDLE, LPVOID);
-
-
-#define WAIT_FAILED            0xffffffff
-#define WAIT_OBJECT_0          0
-#define WAIT_ABANDONED         STATUS_ABANDONED_WAIT_0
-#define WAIT_ABANDONED_0       STATUS_ABANDONED_WAIT_0
-#define WAIT_IO_COMPLETION     STATUS_USER_APC
-#define WAIT_TIMEOUT           STATUS_TIMEOUT
-#define STILL_ACTIVE            STATUS_PENDING
-
-#define        PAGE_NOACCESS           0x01
-#define        PAGE_READONLY           0x02
-#define        PAGE_READWRITE          0x04
-#define        PAGE_WRITECOPY          0x08
-#define        PAGE_EXECUTE            0x10
-#define        PAGE_EXECUTE_READ       0x20
-#define        PAGE_EXECUTE_READWRITE  0x40
-#define        PAGE_EXECUTE_WRITECOPY  0x80
-#define        PAGE_GUARD              0x100
-#define        PAGE_NOCACHE            0x200
-
-#define MEM_COMMIT              0x00001000
-#define MEM_RESERVE             0x00002000
-#define MEM_DECOMMIT            0x00004000
-#define MEM_RELEASE             0x00008000
-#define MEM_FREE                0x00010000
-#define MEM_PRIVATE             0x00020000
-#define MEM_MAPPED              0x00040000
-#define MEM_TOP_DOWN            0x00100000
-#ifdef __WINE__
-#define MEM_SYSTEM              0x80000000
-#endif
-
-#define SEC_FILE                0x00800000
-#define SEC_IMAGE               0x01000000
-#define SEC_RESERVE             0x04000000
-#define SEC_COMMIT              0x08000000
-#define SEC_NOCACHE             0x10000000
-
-#define FILE_BEGIN              0
-#define FILE_CURRENT            1
-#define FILE_END                2
-
-#define FILE_CASE_SENSITIVE_SEARCH      0x00000001
-#define FILE_CASE_PRESERVED_NAMES       0x00000002
-#define FILE_UNICODE_ON_DISK            0x00000004
-#define FILE_PERSISTENT_ACLS            0x00000008
-
-#define FILE_MAP_COPY                   0x00000001
-#define FILE_MAP_WRITE                  0x00000002
-#define FILE_MAP_READ                   0x00000004
-#define FILE_MAP_ALL_ACCESS             0x000f001f
-
-#define MOVEFILE_REPLACE_EXISTING       0x00000001
-#define MOVEFILE_COPY_ALLOWED           0x00000002
-#define MOVEFILE_DELAY_UNTIL_REBOOT     0x00000004
-
-#define FS_CASE_SENSITIVE               FILE_CASE_SENSITIVE_SEARCH
-#define FS_CASE_IS_PRESERVED            FILE_CASE_PRESERVED_NAMES
-#define FS_UNICODE_STORED_ON_DISK       FILE_UNICODE_ON_DISK
-
-#define EXCEPTION_ACCESS_VIOLATION          STATUS_ACCESS_VIOLATION
-#define EXCEPTION_DATATYPE_MISALIGNMENT     STATUS_DATATYPE_MISALIGNMENT
-#define EXCEPTION_BREAKPOINT                STATUS_BREAKPOINT
-#define EXCEPTION_SINGLE_STEP               STATUS_SINGLE_STEP
-#define EXCEPTION_ARRAY_BOUNDS_EXCEEDED     STATUS_ARRAY_BOUNDS_EXCEEDED
-#define EXCEPTION_FLT_DENORMAL_OPERAND      STATUS_FLOAT_DENORMAL_OPERAND
-#define EXCEPTION_FLT_DIVIDE_BY_ZERO        STATUS_FLOAT_DIVIDE_BY_ZERO
-#define EXCEPTION_FLT_INEXACT_RESULT        STATUS_FLOAT_INEXACT_RESULT
-#define EXCEPTION_FLT_INVALID_OPERATION     STATUS_FLOAT_INVALID_OPERATION
-#define EXCEPTION_FLT_OVERFLOW              STATUS_FLOAT_OVERFLOW
-#define EXCEPTION_FLT_STACK_CHECK           STATUS_FLOAT_STACK_CHECK
-#define EXCEPTION_FLT_UNDERFLOW             STATUS_FLOAT_UNDERFLOW
-#define EXCEPTION_INT_DIVIDE_BY_ZERO        STATUS_INTEGER_DIVIDE_BY_ZERO
-#define EXCEPTION_INT_OVERFLOW              STATUS_INTEGER_OVERFLOW
-#define EXCEPTION_PRIV_INSTRUCTION          STATUS_PRIVILEGED_INSTRUCTION
-#define EXCEPTION_IN_PAGE_ERROR             STATUS_IN_PAGE_ERROR
-#define EXCEPTION_ILLEGAL_INSTRUCTION       STATUS_ILLEGAL_INSTRUCTION
-#define EXCEPTION_NONCONTINUABLE_EXCEPTION  STATUS_NONCONTINUABLE_EXCEPTION
-#define EXCEPTION_STACK_OVERFLOW            STATUS_STACK_OVERFLOW
-#define EXCEPTION_INVALID_DISPOSITION       STATUS_INVALID_DISPOSITION
-#define EXCEPTION_GUARD_PAGE                STATUS_GUARD_PAGE_VIOLATION
-#define EXCEPTION_INVALID_HANDLE            STATUS_INVALID_HANDLE
-#define CONTROL_C_EXIT                      STATUS_CONTROL_C_EXIT
-
-/* Wine extension; Windows doesn't have a name for this code */
-#define EXCEPTION_CRITICAL_SECTION_WAIT     0xc0000194
-
-#define DUPLICATE_CLOSE_SOURCE         0x00000001
-#define DUPLICATE_SAME_ACCESS          0x00000002
-
-#define HANDLE_FLAG_INHERIT             0x00000001
-#define HANDLE_FLAG_PROTECT_FROM_CLOSE  0x00000002
-
-#define HINSTANCE_ERROR 32
-
-#define THREAD_PRIORITY_LOWEST          THREAD_BASE_PRIORITY_MIN
-#define THREAD_PRIORITY_BELOW_NORMAL    (THREAD_PRIORITY_LOWEST+1)
-#define THREAD_PRIORITY_NORMAL          0
-#define THREAD_PRIORITY_HIGHEST         THREAD_BASE_PRIORITY_MAX
-#define THREAD_PRIORITY_ABOVE_NORMAL    (THREAD_PRIORITY_HIGHEST-1)
-#define THREAD_PRIORITY_ERROR_RETURN    (0x7fffffff)
-#define THREAD_PRIORITY_TIME_CRITICAL   THREAD_BASE_PRIORITY_LOWRT
-#define THREAD_PRIORITY_IDLE            THREAD_BASE_PRIORITY_IDLE
-
-/* Could this type be considered opaque? */
-typedef struct {
-       LPVOID  DebugInfo;
-       LONG LockCount;
-       LONG RecursionCount;
-       HANDLE OwningThread;
-       HANDLE LockSemaphore;
-       DWORD Reserved;
-}CRITICAL_SECTION;
-
-#ifdef __WINE__
-#define CRITICAL_SECTION_INIT { 0, -1, 0, 0, 0, 0 }
-#endif
-
-typedef struct {
-        DWORD dwOSVersionInfoSize;
-        DWORD dwMajorVersion;
-        DWORD dwMinorVersion;
-        DWORD dwBuildNumber;
-        DWORD dwPlatformId;
-        CHAR szCSDVersion[128];
-} OSVERSIONINFO16;
-
-typedef struct {
-       DWORD dwOSVersionInfoSize;
-       DWORD dwMajorVersion;
-       DWORD dwMinorVersion;
-       DWORD dwBuildNumber;
-       DWORD dwPlatformId;
-       CHAR szCSDVersion[128];
-} OSVERSIONINFOA;
-
-typedef struct {
-       DWORD dwOSVersionInfoSize;
-       DWORD dwMajorVersion;
-       DWORD dwMinorVersion;
-       DWORD dwBuildNumber;
-       DWORD dwPlatformId;
-       WCHAR szCSDVersion[128];
-} OSVERSIONINFOW;
-
-DECL_WINELIB_TYPE_AW(OSVERSIONINFO)
-
-#define VER_PLATFORM_WIN32s             0
-#define VER_PLATFORM_WIN32_WINDOWS      1
-#define VER_PLATFORM_WIN32_NT           2
-
-typedef struct tagCOMSTAT
-{
-    DWORD status;
-    DWORD cbInQue;
-    DWORD cbOutQue;
-} COMSTAT,*LPCOMSTAT;
-
-typedef struct tagDCB
-{
-    DWORD DCBlength;
-    DWORD BaudRate;
-    unsigned fBinary               :1;
-    unsigned fParity               :1;
-    unsigned fOutxCtsFlow          :1;
-    unsigned fOutxDsrFlow          :1;
-    unsigned fDtrControl           :2;
-    unsigned fDsrSensitivity       :1;
-    unsigned fTXContinueOnXoff     :1;
-    unsigned fOutX                 :1;
-    unsigned fInX                  :1;
-    unsigned fErrorChar            :1;
-    unsigned fNull                 :1;
-    unsigned fRtsControl           :2;
-    unsigned fAbortOnError         :1;
-    unsigned fDummy2               :17;
-    WORD wReserved;
-    WORD XonLim;
-    WORD XoffLim;
-    BYTE ByteSize;
-    BYTE Parity;
-    BYTE StopBits;
-    char XonChar;
-    char XoffChar;
-    char ErrorChar;
-    char EofChar;
-    char EvtChar;
-} DCB, *LPDCB;
-
-
-
-typedef struct tagCOMMTIMEOUTS {
-       DWORD   ReadIntervalTimeout;
-       DWORD   ReadTotalTimeoutMultiplier;
-       DWORD   ReadTotalTimeoutConstant;
-       DWORD   WriteTotalTimeoutMultiplier;
-       DWORD   WriteTotalTimeoutConstant;
-} COMMTIMEOUTS,*LPCOMMTIMEOUTS;
-  
-#include "poppack.h"
-
-typedef void CALLBACK (*PAPCFUNC)(ULONG_PTR);
-typedef void CALLBACK (*PTIMERAPCROUTINE)(LPVOID,DWORD,DWORD);
-
-WIN_BOOL      WINAPI ClearCommError(INT,LPDWORD,LPCOMSTAT);
-WIN_BOOL      WINAPI BuildCommDCBA(LPCSTR,LPDCB);
-WIN_BOOL      WINAPI BuildCommDCBW(LPCWSTR,LPDCB);
-#define     BuildCommDCB WINELIB_NAME_AW(BuildCommDCB)
-WIN_BOOL      WINAPI BuildCommDCBAndTimeoutsA(LPCSTR,LPDCB,LPCOMMTIMEOUTS);
-WIN_BOOL      WINAPI BuildCommDCBAndTimeoutsW(LPCWSTR,LPDCB,LPCOMMTIMEOUTS);
-#define     BuildCommDCBAndTimeouts WINELIB_NAME_AW(BuildCommDCBAndTimeouts)
-WIN_BOOL      WINAPI GetCommTimeouts(HANDLE,LPCOMMTIMEOUTS);
-WIN_BOOL      WINAPI SetCommTimeouts(HANDLE,LPCOMMTIMEOUTS);
-WIN_BOOL      WINAPI GetCommState(INT,LPDCB);
-WIN_BOOL      WINAPI SetCommState(INT,LPDCB);
-WIN_BOOL      WINAPI TransmitCommChar(INT,CHAR);
-WIN_BOOL      WINAPI SetupComm(HANDLE, DWORD, DWORD);
-WIN_BOOL      WINAPI GetCommProperties(HANDLE, LPDCB *);
-  
-/*DWORD WINAPI GetVersion( void );*/
-WIN_BOOL16 WINAPI GetVersionEx16(OSVERSIONINFO16*);
-WIN_BOOL WINAPI GetVersionExA(OSVERSIONINFOA*);
-WIN_BOOL WINAPI GetVersionExW(OSVERSIONINFOW*);
-#define GetVersionEx WINELIB_NAME_AW(GetVersionEx)
-
-/*int WinMain(HINSTANCE, HINSTANCE prev, char *cmd, int show);*/
-
-void      WINAPI DeleteCriticalSection(CRITICAL_SECTION *lpCrit);
-void      WINAPI EnterCriticalSection(CRITICAL_SECTION *lpCrit);
-WIN_BOOL      WINAPI TryEnterCriticalSection(CRITICAL_SECTION *lpCrit);
-void      WINAPI InitializeCriticalSection(CRITICAL_SECTION *lpCrit);
-void      WINAPI LeaveCriticalSection(CRITICAL_SECTION *lpCrit);
-void      WINAPI MakeCriticalSectionGlobal(CRITICAL_SECTION *lpCrit);
-WIN_BOOL    WINAPI GetProcessWorkingSetSize(HANDLE,LPDWORD,LPDWORD);
-DWORD     WINAPI QueueUserAPC(PAPCFUNC,HANDLE,ULONG_PTR);
-void      WINAPI RaiseException(DWORD,DWORD,DWORD,const LPDWORD);
-WIN_BOOL    WINAPI SetProcessWorkingSetSize(HANDLE,DWORD,DWORD);
-WIN_BOOL    WINAPI TerminateProcess(HANDLE,DWORD);
-WIN_BOOL    WINAPI TerminateThread(HANDLE,DWORD);
-WIN_BOOL    WINAPI GetExitCodeThread(HANDLE,LPDWORD); 
-
-/* GetBinaryType return values.
- */
-
-#define SCS_32BIT_BINARY    0
-#define SCS_DOS_BINARY      1
-#define SCS_WOW_BINARY      2
-#define SCS_PIF_BINARY      3
-#define SCS_POSIX_BINARY    4
-#define SCS_OS216_BINARY    5
-
-WIN_BOOL WINAPI GetBinaryTypeA( LPCSTR lpApplicationName, LPDWORD lpBinaryType );
-WIN_BOOL WINAPI GetBinaryTypeW( LPCWSTR lpApplicationName, LPDWORD lpBinaryType );
-#define GetBinaryType WINELIB_NAME_AW(GetBinaryType)
-
-WIN_BOOL16      WINAPI GetWinDebugInfo16(LPWINDEBUGINFO,UINT16);
-WIN_BOOL16      WINAPI SetWinDebugInfo16(LPWINDEBUGINFO);
-/* Declarations for functions that exist only in Win32 */
-
-
-WIN_BOOL        WINAPI AttachThreadInput(DWORD,DWORD,WIN_BOOL);
-WIN_BOOL        WINAPI AccessCheck(PSECURITY_DESCRIPTOR,HANDLE,DWORD,PGENERIC_MAPPING,PPRIVILEGE_SET,LPDWORD,LPDWORD,LPWIN_BOOL);
-WIN_BOOL        WINAPI AdjustTokenPrivileges(HANDLE,WIN_BOOL,LPVOID,DWORD,LPVOID,LPDWORD);
-WIN_BOOL        WINAPI AllocateAndInitializeSid(PSID_IDENTIFIER_AUTHORITY,BYTE,DWORD,DWORD,DWORD,DWORD,DWORD,DWORD,DWORD,DWORD,PSID *);
-WIN_BOOL        WINAPI AllocateLocallyUniqueId(PLUID);
-WIN_BOOL      WINAPI AllocConsole(void);
-WIN_BOOL      WINAPI AreFileApisANSI(void);
-WIN_BOOL        WINAPI BackupEventLogA(HANDLE,LPCSTR);
-WIN_BOOL        WINAPI BackupEventLogW(HANDLE,LPCWSTR);
-#define     BackupEventLog WINELIB_NAME_AW(BackupEventLog)
-WIN_BOOL        WINAPI Beep(DWORD,DWORD);
-WIN_BOOL        WINAPI CancelWaitableTimer(HANDLE);
-WIN_BOOL        WINAPI ClearEventLogA(HANDLE,LPCSTR);
-WIN_BOOL        WINAPI ClearEventLogW(HANDLE,LPCWSTR);
-#define     ClearEventLog WINELIB_NAME_AW(ClearEventLog)
-WIN_BOOL        WINAPI CloseEventLog(HANDLE);
-WIN_BOOL      WINAPI CloseHandle(HANDLE);
-WIN_BOOL      WINAPI ContinueDebugEvent(DWORD,DWORD,DWORD);
-HANDLE    WINAPI ConvertToGlobalHandle(HANDLE hSrc);
-WIN_BOOL      WINAPI CopyFileA(LPCSTR,LPCSTR,WIN_BOOL);
-WIN_BOOL      WINAPI CopyFileW(LPCWSTR,LPCWSTR,WIN_BOOL);
-#define     CopyFile WINELIB_NAME_AW(CopyFile)
-WIN_BOOL      WINAPI CopyFileExA(LPCSTR, LPCSTR, LPPROGRESS_ROUTINE, LPVOID, LPWIN_BOOL, DWORD);
-WIN_BOOL      WINAPI CopyFileExW(LPCWSTR, LPCWSTR, LPPROGRESS_ROUTINE, LPVOID, LPWIN_BOOL, DWORD);
-#define     CopyFileEx WINELIB_NAME_AW(CopyFileEx)
-WIN_BOOL        WINAPI CopySid(DWORD,PSID,PSID);
-INT       WINAPI CompareFileTime(LPFILETIME,LPFILETIME);
-HANDLE    WINAPI CreateEventA(LPSECURITY_ATTRIBUTES,WIN_BOOL,WIN_BOOL,LPCSTR);
-HANDLE    WINAPI CreateEventW(LPSECURITY_ATTRIBUTES,WIN_BOOL,WIN_BOOL,LPCWSTR);
-#define     CreateEvent WINELIB_NAME_AW(CreateEvent)
-HANDLE     WINAPI CreateFileA(LPCSTR,DWORD,DWORD,LPSECURITY_ATTRIBUTES,
-                                 DWORD,DWORD,HANDLE);
-HANDLE     WINAPI CreateFileW(LPCWSTR,DWORD,DWORD,LPSECURITY_ATTRIBUTES,
-                                 DWORD,DWORD,HANDLE);
-#define     CreateFile WINELIB_NAME_AW(CreateFile)
-HANDLE    WINAPI CreateFileMappingA(HANDLE,LPSECURITY_ATTRIBUTES,DWORD,
-                                        DWORD,DWORD,LPCSTR);
-HANDLE    WINAPI CreateFileMappingW(HANDLE,LPSECURITY_ATTRIBUTES,DWORD,
-                                        DWORD,DWORD,LPCWSTR);
-#define     CreateFileMapping WINELIB_NAME_AW(CreateFileMapping)
-HANDLE    WINAPI CreateMutexA(LPSECURITY_ATTRIBUTES,WIN_BOOL,LPCSTR);
-HANDLE    WINAPI CreateMutexW(LPSECURITY_ATTRIBUTES,WIN_BOOL,LPCWSTR);
-#define     CreateMutex WINELIB_NAME_AW(CreateMutex)
-WIN_BOOL      WINAPI CreatePipe(PHANDLE,PHANDLE,LPSECURITY_ATTRIBUTES,DWORD);
-WIN_BOOL      WINAPI CreateProcessA(LPCSTR,LPSTR,LPSECURITY_ATTRIBUTES,
-                                    LPSECURITY_ATTRIBUTES,WIN_BOOL,DWORD,LPVOID,LPCSTR,
-                                    LPSTARTUPINFOA,LPPROCESS_INFORMATION);
-WIN_BOOL      WINAPI CreateProcessW(LPCWSTR,LPWSTR,LPSECURITY_ATTRIBUTES,
-                                    LPSECURITY_ATTRIBUTES,WIN_BOOL,DWORD,LPVOID,LPCWSTR,
-                                    LPSTARTUPINFOW,LPPROCESS_INFORMATION);
-#define     CreateProcess WINELIB_NAME_AW(CreateProcess)
-HANDLE    WINAPI CreateSemaphoreA(LPSECURITY_ATTRIBUTES,LONG,LONG,LPCSTR);
-HANDLE    WINAPI CreateSemaphoreW(LPSECURITY_ATTRIBUTES,LONG,LONG,LPCWSTR);
-#define     CreateSemaphore WINELIB_NAME_AW(CreateSemaphore)
-HANDLE      WINAPI CreateThread(LPSECURITY_ATTRIBUTES,DWORD,LPTHREAD_START_ROUTINE,LPVOID,DWORD,LPDWORD);
-HANDLE      WINAPI CreateWaitableTimerA(LPSECURITY_ATTRIBUTES,WIN_BOOL,LPCSTR);
-HANDLE      WINAPI CreateWaitableTimerW(LPSECURITY_ATTRIBUTES,WIN_BOOL,LPCWSTR);
-#define     CreateWaitableTimer WINELIB_NAME_AW(CreateWaitableTimer)
-WIN_BOOL        WINAPI DebugActiveProcess(DWORD);
-void        WINAPI DebugBreak(void);
-WIN_BOOL        WINAPI DeregisterEventSource(HANDLE);
-WIN_BOOL        WINAPI DisableThreadLibraryCalls(HMODULE);
-WIN_BOOL        WINAPI DosDateTimeToFileTime(WORD,WORD,LPFILETIME);
-WIN_BOOL        WINAPI DuplicateHandle(HANDLE,HANDLE,HANDLE,HANDLE*,DWORD,WIN_BOOL,DWORD);
-WIN_BOOL        WINAPI EnumDateFormatsA(DATEFMT_ENUMPROCA lpDateFmtEnumProc, LCID Locale, DWORD dwFlags);
-WIN_BOOL        WINAPI EnumDateFormatsW(DATEFMT_ENUMPROCW lpDateFmtEnumProc, LCID Locale, DWORD dwFlags);
-#define     EnumDateFormats WINELIB_NAME_AW(EnumDateFormats)
-WIN_BOOL      WINAPI EnumResourceLanguagesA(HMODULE,LPCSTR,LPCSTR,
-                                            ENUMRESLANGPROCA,LONG);
-WIN_BOOL      WINAPI EnumResourceLanguagesW(HMODULE,LPCWSTR,LPCWSTR,
-                                            ENUMRESLANGPROCW,LONG);
-#define     EnumResourceLanguages WINELIB_NAME_AW(EnumResourceLanguages)
-WIN_BOOL      WINAPI EnumResourceNamesA(HMODULE,LPCSTR,ENUMRESNAMEPROCA,
-                                        LONG);
-WIN_BOOL      WINAPI EnumResourceNamesW(HMODULE,LPCWSTR,ENUMRESNAMEPROCW,
-                                        LONG);
-#define     EnumResourceNames WINELIB_NAME_AW(EnumResourceNames)
-WIN_BOOL      WINAPI EnumResourceTypesA(HMODULE,ENUMRESTYPEPROCA,LONG);
-WIN_BOOL      WINAPI EnumResourceTypesW(HMODULE,ENUMRESTYPEPROCW,LONG);
-#define     EnumResourceTypes WINELIB_NAME_AW(EnumResourceTypes)
-WIN_BOOL      WINAPI EnumSystemCodePagesA(CODEPAGE_ENUMPROCA,DWORD);
-WIN_BOOL      WINAPI EnumSystemCodePagesW(CODEPAGE_ENUMPROCW,DWORD);
-#define     EnumSystemCodePages WINELIB_NAME_AW(EnumSystemCodePages)
-WIN_BOOL      WINAPI EnumSystemLocalesA(LOCALE_ENUMPROCA,DWORD);
-WIN_BOOL      WINAPI EnumSystemLocalesW(LOCALE_ENUMPROCW,DWORD);
-#define     EnumSystemLocales WINELIB_NAME_AW(EnumSystemLocales)
-WIN_BOOL      WINAPI EnumTimeFormatsA(TIMEFMT_ENUMPROCA lpTimeFmtEnumProc, LCID Locale, DWORD dwFlags);
-WIN_BOOL      WINAPI EnumTimeFormatsW(TIMEFMT_ENUMPROCW lpTimeFmtEnumProc, LCID Locale, DWORD dwFlags);
-#define     EnumTimeFormats WINELIB_NAME_AW(EnumTimeFormats)
-WIN_BOOL        WINAPI EqualSid(PSID, PSID);
-WIN_BOOL        WINAPI EqualPrefixSid(PSID,PSID);
-VOID        WINAPI ExitProcess(DWORD) WINE_NORETURN;
-VOID        WINAPI ExitThread(DWORD) WINE_NORETURN;
-DWORD       WINAPI ExpandEnvironmentStringsA(LPCSTR,LPSTR,DWORD);
-DWORD       WINAPI ExpandEnvironmentStringsW(LPCWSTR,LPWSTR,DWORD);
-#define     ExpandEnvironmentStrings WINELIB_NAME_AW(ExpandEnvironmentStrings)
-WIN_BOOL      WINAPI FileTimeToDosDateTime(const FILETIME*,LPWORD,LPWORD);
-WIN_BOOL      WINAPI FileTimeToLocalFileTime(const FILETIME*,LPFILETIME);
-WIN_BOOL      WINAPI FileTimeToSystemTime(const FILETIME*,LPSYSTEMTIME);
-HANDLE    WINAPI FindFirstChangeNotificationA(LPCSTR,WIN_BOOL,DWORD);
-HANDLE    WINAPI FindFirstChangeNotificationW(LPCWSTR,WIN_BOOL,DWORD);
-#define     FindFirstChangeNotification WINELIB_NAME_AW(FindFirstChangeNotification)
-WIN_BOOL      WINAPI FindNextChangeNotification(HANDLE);
-WIN_BOOL      WINAPI FindCloseChangeNotification(HANDLE);
-HRSRC     WINAPI FindResourceExA(HMODULE,LPCSTR,LPCSTR,WORD);
-HRSRC     WINAPI FindResourceExW(HMODULE,LPCWSTR,LPCWSTR,WORD);
-#define     FindResourceEx WINELIB_NAME_AW(FindResourceEx)
-WIN_BOOL      WINAPI FlushConsoleInputBuffer(HANDLE);
-WIN_BOOL      WINAPI FlushFileBuffers(HANDLE);
-WIN_BOOL      WINAPI FlushViewOfFile(LPCVOID, DWORD);
-DWORD       WINAPI FormatMessageA(DWORD,LPCVOID,DWORD,DWORD,LPSTR,
-                                   DWORD,LPDWORD);
-DWORD       WINAPI FormatMessageW(DWORD,LPCVOID,DWORD,DWORD,LPWSTR,
-                                   DWORD,LPDWORD);
-#define     FormatMessage WINELIB_NAME_AW(FormatMessage)
-WIN_BOOL      WINAPI FreeConsole(void);
-WIN_BOOL      WINAPI FreeEnvironmentStringsA(LPSTR);
-WIN_BOOL      WINAPI FreeEnvironmentStringsW(LPWSTR);
-#define     FreeEnvironmentStrings WINELIB_NAME_AW(FreeEnvironmentStrings)
-PVOID       WINAPI FreeSid(PSID);
-UINT      WINAPI GetACP(void);
-LPCSTR      WINAPI GetCommandLineA(void);
-LPCWSTR     WINAPI GetCommandLineW(void);
-#define     GetCommandLine WINELIB_NAME_AW(GetCommandLine)
-WIN_BOOL      WINAPI GetComputerNameA(LPSTR,LPDWORD);
-WIN_BOOL      WINAPI GetComputerNameW(LPWSTR,LPDWORD);
-#define     GetComputerName WINELIB_NAME_AW(GetComputerName)
-UINT      WINAPI GetConsoleCP(void);
-WIN_BOOL      WINAPI GetConsoleMode(HANDLE,LPDWORD);
-UINT      WINAPI GetConsoleOutputCP(void);
-DWORD       WINAPI GetConsoleTitleA(LPSTR,DWORD);
-DWORD       WINAPI GetConsoleTitleW(LPWSTR,DWORD);
-#define     GetConsoleTitle WINELIB_NAME_AW(GetConsoleTitle)
-WIN_BOOL        WINAPI GetCommMask(HANDLE, LPDWORD);
-WIN_BOOL        WINAPI GetCommModemStatus(HANDLE, LPDWORD);
-HANDLE      WINAPI GetCurrentProcess(void);
-HANDLE      WINAPI GetCurrentThread(void);
-INT         WINAPI GetDateFormatA(LCID,DWORD,LPSYSTEMTIME,LPCSTR,LPSTR,INT);
-INT         WINAPI GetDateFormatW(LCID,DWORD,LPSYSTEMTIME,LPCWSTR,LPWSTR,INT);
-#define     GetDateFormat WINELIB_NAME_AW(GetDateFormat)
-LPSTR       WINAPI GetEnvironmentStringsA(void);
-LPWSTR      WINAPI GetEnvironmentStringsW(void);
-#define     GetEnvironmentStrings WINELIB_NAME_AW(GetEnvironmentStrings)
-DWORD       WINAPI GetEnvironmentVariableA(LPCSTR,LPSTR,DWORD);
-DWORD       WINAPI GetEnvironmentVariableW(LPCWSTR,LPWSTR,DWORD);
-#define     GetEnvironmentVariable WINELIB_NAME_AW(GetEnvironmentVariable)
-WIN_BOOL      WINAPI GetFileAttributesExA(LPCSTR,GET_FILEEX_INFO_LEVELS,LPVOID);
-WIN_BOOL      WINAPI GetFileAttributesExW(LPCWSTR,GET_FILEEX_INFO_LEVELS,LPVOID);
-#define     GetFileattributesEx WINELIB_NAME_AW(GetFileAttributesEx)
-DWORD       WINAPI GetFileInformationByHandle(HANDLE,BY_HANDLE_FILE_INFORMATION*);
-WIN_BOOL        WINAPI GetFileSecurityA(LPCSTR,SECURITY_INFORMATION,PSECURITY_DESCRIPTOR,DWORD,LPDWORD);
-WIN_BOOL        WINAPI GetFileSecurityW(LPCWSTR,SECURITY_INFORMATION,PSECURITY_DESCRIPTOR,DWORD,LPDWORD);
-#define     GetFileSecurity WINELIB_NAME_AW(GetFileSecurity)
-DWORD       WINAPI GetFileSize(HANDLE,LPDWORD);
-WIN_BOOL        WINAPI GetFileTime(HANDLE,LPFILETIME,LPFILETIME,LPFILETIME);
-DWORD       WINAPI GetFileType(HANDLE);
-DWORD       WINAPI GetFullPathNameA(LPCSTR,DWORD,LPSTR,LPSTR*);
-DWORD       WINAPI GetFullPathNameW(LPCWSTR,DWORD,LPWSTR,LPWSTR*);
-#define     GetFullPathName WINELIB_NAME_AW(GetFullPathName)
-WIN_BOOL      WINAPI GetHandleInformation(HANDLE,LPDWORD);
-COORD       WINAPI GetLargestConsoleWindowSize(HANDLE);
-DWORD       WINAPI GetLengthSid(PSID);
-VOID        WINAPI GetLocalTime(LPSYSTEMTIME);
-DWORD       WINAPI GetLogicalDrives(void);
-DWORD       WINAPI GetLongPathNameA(LPCSTR,LPSTR,DWORD);
-DWORD       WINAPI GetLongPathNameW(LPCWSTR,LPWSTR,DWORD);
-#define     GetLongPathName WINELIB_NAME_AW(GetLongPathName)
-WIN_BOOL      WINAPI GetNumberOfConsoleInputEvents(HANDLE,LPDWORD);
-WIN_BOOL      WINAPI GetNumberOfConsoleMouseButtons(LPDWORD);
-WIN_BOOL        WINAPI GetNumberOfEventLogRecords(HANDLE,PDWORD);
-UINT      WINAPI GetOEMCP(void);
-WIN_BOOL        WINAPI GetOldestEventLogRecord(HANDLE,PDWORD);
-DWORD       WINAPI GetPriorityClass(HANDLE);
-DWORD       WINAPI GetProcessVersion(DWORD);
-WIN_BOOL        WINAPI GetSecurityDescriptorControl(PSECURITY_DESCRIPTOR,PSECURITY_DESCRIPTOR_CONTROL,LPDWORD);
-WIN_BOOL        WINAPI GetSecurityDescriptorDacl(PSECURITY_DESCRIPTOR,LPWIN_BOOL,PACL *,LPWIN_BOOL);
-WIN_BOOL        WINAPI GetSecurityDescriptorGroup(PSECURITY_DESCRIPTOR,PSID *,LPWIN_BOOL);
-DWORD       WINAPI GetSecurityDescriptorLength(PSECURITY_DESCRIPTOR);
-WIN_BOOL        WINAPI GetSecurityDescriptorOwner(PSECURITY_DESCRIPTOR,PSID *,LPWIN_BOOL);
-WIN_BOOL        WINAPI GetSecurityDescriptorSacl(PSECURITY_DESCRIPTOR,LPWIN_BOOL,PACL *,LPWIN_BOOL);
-PSID_IDENTIFIER_AUTHORITY WINAPI GetSidIdentifierAuthority(PSID);
-DWORD       WINAPI GetSidLengthRequired(BYTE);
-PDWORD      WINAPI GetSidSubAuthority(PSID,DWORD);
-PUCHAR      WINAPI GetSidSubAuthorityCount(PSID);
-DWORD       WINAPI GetShortPathNameA(LPCSTR,LPSTR,DWORD);
-DWORD       WINAPI GetShortPathNameW(LPCWSTR,LPWSTR,DWORD);
-#define     GetShortPathName WINELIB_NAME_AW(GetShortPathName)
-HFILE     WINAPI GetStdHandle(DWORD);
-WIN_BOOL      WINAPI GetStringTypeExA(LCID,DWORD,LPCSTR,INT,LPWORD);
-WIN_BOOL      WINAPI GetStringTypeExW(LCID,DWORD,LPCWSTR,INT,LPWORD);
-#define     GetStringTypeEx WINELIB_NAME_AW(GetStringTypeEx)
-VOID        WINAPI GetSystemInfo(LPSYSTEM_INFO);
-WIN_BOOL        WINAPI GetSystemPowerStatus(LPSYSTEM_POWER_STATUS);
-VOID        WINAPI GetSystemTime(LPSYSTEMTIME);
-VOID        WINAPI GetSystemTimeAsFileTime(LPFILETIME);
-INT         WINAPI GetTimeFormatA(LCID,DWORD,LPSYSTEMTIME,LPCSTR,LPSTR,INT);
-INT         WINAPI GetTimeFormatW(LCID,DWORD,LPSYSTEMTIME,LPCWSTR,LPWSTR,INT);
-#define     GetTimeFormat WINELIB_NAME_AW(GetTimeFormat)
-WIN_BOOL        WINAPI GetThreadContext(HANDLE,CONTEXT *);
-LCID        WINAPI GetThreadLocale(void);
-INT       WINAPI GetThreadPriority(HANDLE);
-WIN_BOOL      WINAPI GetThreadSelectorEntry(HANDLE,DWORD,LPLDT_ENTRY);
-WIN_BOOL        WINAPI GetThreadTimes(HANDLE,LPFILETIME,LPFILETIME,LPFILETIME,LPFILETIME);
-WIN_BOOL        WINAPI GetTokenInformation(HANDLE,TOKEN_INFORMATION_CLASS,LPVOID,DWORD,LPDWORD);
-WIN_BOOL        WINAPI GetUserNameA(LPSTR,LPDWORD);
-WIN_BOOL        WINAPI GetUserNameW(LPWSTR,LPDWORD);
-#define     GetUserName WINELIB_NAME_AW(GetUserName)
-VOID        WINAPI GlobalMemoryStatus(LPMEMORYSTATUS);
-LPVOID      WINAPI HeapAlloc(HANDLE,DWORD,DWORD);
-DWORD       WINAPI HeapCompact(HANDLE,DWORD);
-HANDLE    WINAPI HeapCreate(DWORD,DWORD,DWORD);
-WIN_BOOL      WINAPI HeapDestroy(HANDLE);
-WIN_BOOL      WINAPI HeapFree(HANDLE,DWORD,LPVOID);
-WIN_BOOL      WINAPI HeapLock(HANDLE);
-LPVOID      WINAPI HeapReAlloc(HANDLE,DWORD,LPVOID,DWORD);
-DWORD       WINAPI HeapSize(HANDLE,DWORD,LPVOID);
-WIN_BOOL      WINAPI HeapUnlock(HANDLE);
-WIN_BOOL      WINAPI HeapValidate(HANDLE,DWORD,LPCVOID);
-WIN_BOOL        WINAPI HeapWalk(HANDLE,LPPROCESS_HEAP_ENTRY);
-WIN_BOOL        WINAPI InitializeSid(PSID,PSID_IDENTIFIER_AUTHORITY,BYTE);
-WIN_BOOL        WINAPI IsValidSecurityDescriptor(PSECURITY_DESCRIPTOR);
-WIN_BOOL        WINAPI IsValidSid(PSID);
-WIN_BOOL        WINAPI ImpersonateSelf(SECURITY_IMPERSONATION_LEVEL);
-WIN_BOOL        WINAPI IsDBCSLeadByteEx(UINT,BYTE);
-WIN_BOOL        WINAPI IsProcessorFeaturePresent(DWORD);
-WIN_BOOL        WINAPI IsValidLocale(DWORD,DWORD);
-WIN_BOOL        WINAPI LookupAccountSidA(LPCSTR,PSID,LPSTR,LPDWORD,LPSTR,LPDWORD,PSID_NAME_USE);
-WIN_BOOL        WINAPI LookupAccountSidW(LPCWSTR,PSID,LPWSTR,LPDWORD,LPWSTR,LPDWORD,PSID_NAME_USE);
-#define     LookupAccountSid WINELIB_NAME_AW(LookupAccountSidW)
-WIN_BOOL        WINAPI LocalFileTimeToFileTime(const FILETIME*,LPFILETIME);
-WIN_BOOL        WINAPI LockFile(HANDLE,DWORD,DWORD,DWORD,DWORD);
-WIN_BOOL        WINAPI LockFileEx(HANDLE, DWORD, DWORD, DWORD, DWORD, LPOVERLAPPED);    
-WIN_BOOL        WINAPI LookupPrivilegeValueA(LPCSTR,LPCSTR,LPVOID);
-WIN_BOOL        WINAPI LookupPrivilegeValueW(LPCWSTR,LPCWSTR,LPVOID);
-#define     LookupPrivilegeValue WINELIB_NAME_AW(LookupPrivilegeValue)
-WIN_BOOL        WINAPI MakeSelfRelativeSD(PSECURITY_DESCRIPTOR,PSECURITY_DESCRIPTOR,LPDWORD);
-HMODULE   WINAPI MapHModuleSL(HMODULE16);
-HMODULE16   WINAPI MapHModuleLS(HMODULE);
-SEGPTR      WINAPI MapLS(LPVOID);
-LPVOID      WINAPI MapSL(SEGPTR);
-LPVOID      WINAPI MapViewOfFile(HANDLE,DWORD,DWORD,DWORD,DWORD);
-LPVOID      WINAPI MapViewOfFileEx(HANDLE,DWORD,DWORD,DWORD,DWORD,LPVOID);
-WIN_BOOL      WINAPI MoveFileA(LPCSTR,LPCSTR);
-WIN_BOOL      WINAPI MoveFileW(LPCWSTR,LPCWSTR);
-#define     MoveFile WINELIB_NAME_AW(MoveFile)
-WIN_BOOL      WINAPI MoveFileExA(LPCSTR,LPCSTR,DWORD);
-WIN_BOOL      WINAPI MoveFileExW(LPCWSTR,LPCWSTR,DWORD);
-#define     MoveFileEx WINELIB_NAME_AW(MoveFileEx)
-INT       WINAPI MultiByteToWideChar(UINT,DWORD,LPCSTR,INT,LPWSTR,INT);
-WIN_BOOL        WINAPI NotifyChangeEventLog(HANDLE,HANDLE);
-INT       WINAPI WideCharToMultiByte(UINT,DWORD,LPCWSTR,INT,LPSTR,INT,LPCSTR,WIN_BOOL*);
-HANDLE      WINAPI OpenBackupEventLogA(LPCSTR,LPCSTR);
-HANDLE      WINAPI OpenBackupEventLogW(LPCWSTR,LPCWSTR);
-#define     OpenBackupEventLog WINELIB_NAME_AW(OpenBackupEventLog)
-HANDLE    WINAPI OpenEventA(DWORD,WIN_BOOL,LPCSTR);
-HANDLE    WINAPI OpenEventW(DWORD,WIN_BOOL,LPCWSTR);
-#define     OpenEvent WINELIB_NAME_AW(OpenEvent)
-HANDLE      WINAPI OpenEventLogA(LPCSTR,LPCSTR);
-HANDLE      WINAPI OpenEventLogW(LPCWSTR,LPCWSTR);
-#define     OpenEventLog WINELIB_NAME_AW(OpenEventLog)
-HANDLE    WINAPI OpenFileMappingA(DWORD,WIN_BOOL,LPCSTR);
-HANDLE    WINAPI OpenFileMappingW(DWORD,WIN_BOOL,LPCWSTR);
-#define     OpenFileMapping WINELIB_NAME_AW(OpenFileMapping)
-HANDLE    WINAPI OpenMutexA(DWORD,WIN_BOOL,LPCSTR);
-HANDLE    WINAPI OpenMutexW(DWORD,WIN_BOOL,LPCWSTR);
-#define     OpenMutex WINELIB_NAME_AW(OpenMutex)
-HANDLE    WINAPI OpenProcess(DWORD,WIN_BOOL,DWORD);
-WIN_BOOL        WINAPI OpenProcessToken(HANDLE,DWORD,PHANDLE);
-HANDLE    WINAPI OpenSemaphoreA(DWORD,WIN_BOOL,LPCSTR);
-HANDLE    WINAPI OpenSemaphoreW(DWORD,WIN_BOOL,LPCWSTR);
-#define     OpenSemaphore WINELIB_NAME_AW(OpenSemaphore)
-WIN_BOOL        WINAPI OpenThreadToken(HANDLE,DWORD,WIN_BOOL,PHANDLE);
-HANDLE      WINAPI OpenWaitableTimerA(DWORD,WIN_BOOL,LPCSTR);
-HANDLE      WINAPI OpenWaitableTimerW(DWORD,WIN_BOOL,LPCWSTR);
-#define     OpenWaitableTimer WINELIB_NAME_AW(OpenWaitableTimer)
-WIN_BOOL        WINAPI PulseEvent(HANDLE);
-WIN_BOOL        WINAPI PurgeComm(HANDLE,DWORD);
-DWORD       WINAPI QueryDosDeviceA(LPCSTR,LPSTR,DWORD);
-DWORD       WINAPI QueryDosDeviceW(LPCWSTR,LPWSTR,DWORD);
-#define     QueryDosDevice WINELIB_NAME_AW(QueryDosDevice)
-WIN_BOOL      WINAPI QueryPerformanceCounter(PLARGE_INTEGER);
-WIN_BOOL      WINAPI ReadConsoleA(HANDLE,LPVOID,DWORD,LPDWORD,LPVOID);
-WIN_BOOL      WINAPI ReadConsoleW(HANDLE,LPVOID,DWORD,LPDWORD,LPVOID);
-#define     ReadConsole WINELIB_NAME_AW(ReadConsole)
-WIN_BOOL      WINAPI ReadConsoleOutputCharacterA(HANDLE,LPSTR,DWORD,
-                                                COORD,LPDWORD);
-#define     ReadConsoleOutputCharacter WINELIB_NAME_AW(ReadConsoleOutputCharacter)
-WIN_BOOL        WINAPI ReadEventLogA(HANDLE,DWORD,DWORD,LPVOID,DWORD,DWORD *,DWORD *);
-WIN_BOOL        WINAPI ReadEventLogW(HANDLE,DWORD,DWORD,LPVOID,DWORD,DWORD *,DWORD *);
-#define     ReadEventLog WINELIB_NAME_AW(ReadEventLog)
-WIN_BOOL      WINAPI ReadFile(HANDLE,LPVOID,DWORD,LPDWORD,LPOVERLAPPED);
-HANDLE      WINAPI RegisterEventSourceA(LPCSTR,LPCSTR);
-HANDLE      WINAPI RegisterEventSourceW(LPCWSTR,LPCWSTR);
-#define     RegisterEventSource WINELIB_NAME_AW(RegisterEventSource)
-WIN_BOOL      WINAPI ReleaseMutex(HANDLE);
-WIN_BOOL      WINAPI ReleaseSemaphore(HANDLE,LONG,LPLONG);
-WIN_BOOL        WINAPI ReportEventA(HANDLE,WORD,WORD,DWORD,PSID,WORD,DWORD,LPCSTR *,LPVOID);
-WIN_BOOL        WINAPI ReportEventW(HANDLE,WORD,WORD,DWORD,PSID,WORD,DWORD,LPCWSTR *,LPVOID);
-#define     ReportEvent WINELIB_NAME_AW(ReportEvent)
-WIN_BOOL      WINAPI ResetEvent(HANDLE);
-DWORD       WINAPI ResumeThread(HANDLE);
-WIN_BOOL        WINAPI RevertToSelf(void);
-DWORD       WINAPI SearchPathA(LPCSTR,LPCSTR,LPCSTR,DWORD,LPSTR,LPSTR*);
-DWORD       WINAPI SearchPathW(LPCWSTR,LPCWSTR,LPCWSTR,DWORD,LPWSTR,LPWSTR*);
-#define     SearchPath WINELIB_NAME_AW(SearchPath)
-WIN_BOOL      WINAPI SetCommMask(INT,DWORD);
-WIN_BOOL      WINAPI SetComputerNameA(LPCSTR);
-WIN_BOOL      WINAPI SetComputerNameW(LPCWSTR);
-#define     SetComputerName WINELIB_NAME_AW(SetComputerName)
-WIN_BOOL      WINAPI SetConsoleCursorPosition(HANDLE,COORD);
-WIN_BOOL      WINAPI SetConsoleMode(HANDLE,DWORD);
-WIN_BOOL      WINAPI SetConsoleTitleA(LPCSTR);
-WIN_BOOL      WINAPI SetConsoleTitleW(LPCWSTR);
-#define     SetConsoleTitle WINELIB_NAME_AW(SetConsoleTitle)
-WIN_BOOL      WINAPI SetEndOfFile(HANDLE);
-WIN_BOOL      WINAPI SetEnvironmentVariableA(LPCSTR,LPCSTR);
-WIN_BOOL      WINAPI SetEnvironmentVariableW(LPCWSTR,LPCWSTR);
-#define     SetEnvironmentVariable WINELIB_NAME_AW(SetEnvironmentVariable)
-WIN_BOOL      WINAPI SetEvent(HANDLE);
-VOID        WINAPI SetFileApisToANSI(void);
-VOID        WINAPI SetFileApisToOEM(void);
-DWORD       WINAPI SetFilePointer(HANDLE,LONG,LPLONG,DWORD);
-WIN_BOOL        WINAPI SetFileSecurityA(LPCSTR,SECURITY_INFORMATION,PSECURITY_DESCRIPTOR);
-WIN_BOOL        WINAPI SetFileSecurityW(LPCWSTR,SECURITY_INFORMATION,PSECURITY_DESCRIPTOR);
-#define     SetFileSecurity WINELIB_NAME_AW(SetFileSecurity)
-WIN_BOOL        WINAPI SetFileTime(HANDLE,const FILETIME*,const FILETIME*,const FILETIME*);
-WIN_BOOL        WINAPI SetHandleInformation(HANDLE,DWORD,DWORD);
-WIN_BOOL        WINAPI SetPriorityClass(HANDLE,DWORD);
-WIN_BOOL        WINAPI SetLocalTime(const SYSTEMTIME*);
-WIN_BOOL        WINAPI SetSecurityDescriptorDacl(PSECURITY_DESCRIPTOR,WIN_BOOL,PACL,WIN_BOOL);
-WIN_BOOL        WINAPI SetSecurityDescriptorGroup(PSECURITY_DESCRIPTOR,PSID,WIN_BOOL);
-WIN_BOOL        WINAPI SetSecurityDescriptorOwner(PSECURITY_DESCRIPTOR,PSID,WIN_BOOL);
-WIN_BOOL        WINAPI SetSecurityDescriptorSacl(PSECURITY_DESCRIPTOR,WIN_BOOL,PACL,WIN_BOOL);
-WIN_BOOL      WINAPI SetStdHandle(DWORD,HANDLE);
-WIN_BOOL      WINAPI SetSystemPowerState(WIN_BOOL,WIN_BOOL);
-WIN_BOOL      WINAPI SetSystemTime(const SYSTEMTIME*);
-DWORD       WINAPI SetThreadAffinityMask(HANDLE,DWORD);
-WIN_BOOL        WINAPI SetThreadContext(HANDLE,const CONTEXT *);
-WIN_BOOL        WINAPI SetThreadLocale(LCID);
-WIN_BOOL        WINAPI SetThreadPriority(HANDLE,INT);
-WIN_BOOL        WINAPI SetTimeZoneInformation(const LPTIME_ZONE_INFORMATION);
-WIN_BOOL        WINAPI SetWaitableTimer(HANDLE,const LARGE_INTEGER*,LONG,PTIMERAPCROUTINE,LPVOID,WIN_BOOL);
-VOID        WINAPI Sleep(DWORD);
-DWORD       WINAPI SleepEx(DWORD,WIN_BOOL);
-DWORD       WINAPI SuspendThread(HANDLE);
-WIN_BOOL      WINAPI SystemTimeToFileTime(const SYSTEMTIME*,LPFILETIME);
-DWORD       WINAPI TlsAlloc(void);
-WIN_BOOL      WINAPI TlsFree(DWORD);
-LPVOID      WINAPI TlsGetValue(DWORD);
-WIN_BOOL      WINAPI TlsSetValue(DWORD,LPVOID);
-VOID        WINAPI UnMapLS(SEGPTR);
-WIN_BOOL      WINAPI UnlockFile(HANDLE,DWORD,DWORD,DWORD,DWORD);
-WIN_BOOL      WINAPI UnmapViewOfFile(LPVOID);
-LPVOID      WINAPI VirtualAlloc(LPVOID,DWORD,DWORD,DWORD);
-WIN_BOOL      WINAPI VirtualFree(LPVOID,SIZE_T,DWORD);
-WIN_BOOL      WINAPI VirtualLock(LPVOID,DWORD);
-WIN_BOOL      WINAPI VirtualProtect(LPVOID,DWORD,DWORD,LPDWORD);
-WIN_BOOL      WINAPI VirtualProtectEx(HANDLE,LPVOID,DWORD,DWORD,LPDWORD);
-DWORD       WINAPI VirtualQuery(LPCVOID,LPMEMORY_BASIC_INFORMATION,DWORD);
-DWORD       WINAPI VirtualQueryEx(HANDLE,LPCVOID,LPMEMORY_BASIC_INFORMATION,DWORD);
-WIN_BOOL      WINAPI VirtualUnlock(LPVOID,DWORD);
-WIN_BOOL      WINAPI WaitCommEvent(HANDLE,LPDWORD,LPOVERLAPPED);
-WIN_BOOL      WINAPI WaitForDebugEvent(LPDEBUG_EVENT,DWORD);
-DWORD       WINAPI WaitForMultipleObjects(DWORD,const HANDLE*,WIN_BOOL,DWORD);
-DWORD       WINAPI WaitForMultipleObjectsEx(DWORD,const HANDLE*,WIN_BOOL,DWORD,WIN_BOOL);
-DWORD       WINAPI WaitForSingleObject(HANDLE,DWORD);
-DWORD       WINAPI WaitForSingleObjectEx(HANDLE,DWORD,WIN_BOOL);
-WIN_BOOL      WINAPI WriteConsoleA(HANDLE,LPCVOID,DWORD,LPDWORD,LPVOID);
-WIN_BOOL      WINAPI WriteConsoleW(HANDLE,LPCVOID,DWORD,LPDWORD,LPVOID);
-#define     WriteConsole WINELIB_NAME_AW(WriteConsole)
-WIN_BOOL      WINAPI WriteFile(HANDLE,LPCVOID,DWORD,LPDWORD,LPOVERLAPPED);
-LANGID      WINAPI GetSystemDefaultLangID(void);
-LCID        WINAPI GetSystemDefaultLCID(void);
-LANGID      WINAPI GetUserDefaultLangID(void);
-LCID        WINAPI GetUserDefaultLCID(void);
-ATOM        WINAPI AddAtomA(LPCSTR);
-ATOM        WINAPI AddAtomW(LPCWSTR);
-#define     AddAtom WINELIB_NAME_AW(AddAtom)
-UINT      WINAPI CompareStringA(DWORD,DWORD,LPCSTR,DWORD,LPCSTR,DWORD);
-UINT      WINAPI CompareStringW(DWORD,DWORD,LPCWSTR,DWORD,LPCWSTR,DWORD);
-#define     CompareString WINELIB_NAME_AW(CompareString)
-WIN_BOOL      WINAPI CreateDirectoryA(LPCSTR,LPSECURITY_ATTRIBUTES);
-WIN_BOOL      WINAPI CreateDirectoryW(LPCWSTR,LPSECURITY_ATTRIBUTES);
-#define     CreateDirectory WINELIB_NAME_AW(CreateDirectory)
-WIN_BOOL      WINAPI CreateDirectoryExA(LPCSTR,LPCSTR,LPSECURITY_ATTRIBUTES);
-WIN_BOOL      WINAPI CreateDirectoryExW(LPCWSTR,LPCWSTR,LPSECURITY_ATTRIBUTES);
-#define     CreateDirectoryEx WINELIB_NAME_AW(CreateDirectoryEx)
-WIN_BOOL        WINAPI DefineDosDeviceA(DWORD,LPCSTR,LPCSTR);
-#define     DefineHandleTable(w) ((w),TRUE)
-ATOM        WINAPI DeleteAtom(ATOM);
-WIN_BOOL      WINAPI DeleteFileA(LPCSTR);
-WIN_BOOL      WINAPI DeleteFileW(LPCWSTR);
-#define     DeleteFile WINELIB_NAME_AW(DeleteFile)
-void        WINAPI FatalAppExitA(UINT,LPCSTR);
-void        WINAPI FatalAppExitW(UINT,LPCWSTR);
-#define     FatalAppExit WINELIB_NAME_AW(FatalAppExit)
-ATOM        WINAPI FindAtomA(LPCSTR);
-ATOM        WINAPI FindAtomW(LPCWSTR);
-#define     FindAtom WINELIB_NAME_AW(FindAtom)
-WIN_BOOL      WINAPI FindClose(HANDLE);
-HANDLE16    WINAPI FindFirstFile16(LPCSTR,LPWIN32_FIND_DATAA);
-HANDLE    WINAPI FindFirstFileA(LPCSTR,LPWIN32_FIND_DATAA);
-HANDLE    WINAPI FindFirstFileW(LPCWSTR,LPWIN32_FIND_DATAW);
-#define     FindFirstFile WINELIB_NAME_AW(FindFirstFile)
-WIN_BOOL16      WINAPI FindNextFile16(HANDLE16,LPWIN32_FIND_DATAA);
-WIN_BOOL      WINAPI FindNextFileA(HANDLE,LPWIN32_FIND_DATAA);
-WIN_BOOL      WINAPI FindNextFileW(HANDLE,LPWIN32_FIND_DATAW);
-#define     FindNextFile WINELIB_NAME_AW(FindNextFile)
-HRSRC     WINAPI FindResourceA(HMODULE,LPCSTR,LPCSTR);
-HRSRC     WINAPI FindResourceW(HMODULE,LPCWSTR,LPCWSTR);
-#define     FindResource WINELIB_NAME_AW(FindResource)
-VOID        WINAPI FreeLibrary16(HINSTANCE16);
-WIN_BOOL      WINAPI FreeLibrary(HMODULE);
-#define     FreeModule(handle) FreeLibrary(handle)
-#define     FreeProcInstance(proc) /*nothing*/
-WIN_BOOL      WINAPI FreeResource(HGLOBAL);
-UINT      WINAPI GetAtomNameA(ATOM,LPSTR,INT);
-UINT      WINAPI GetAtomNameW(ATOM,LPWSTR,INT);
-#define     GetAtomName WINELIB_NAME_AW(GetAtomName)
-UINT      WINAPI GetCurrentDirectoryA(UINT,LPSTR);
-UINT      WINAPI GetCurrentDirectoryW(UINT,LPWSTR);
-#define     GetCurrentDirectory WINELIB_NAME_AW(GetCurrentDirectory)
-WIN_BOOL      WINAPI GetDiskFreeSpaceA(LPCSTR,LPDWORD,LPDWORD,LPDWORD,LPDWORD);
-WIN_BOOL      WINAPI GetDiskFreeSpaceW(LPCWSTR,LPDWORD,LPDWORD,LPDWORD,LPDWORD);
-#define     GetDiskFreeSpace WINELIB_NAME_AW(GetDiskFreeSpace)
-WIN_BOOL      WINAPI GetDiskFreeSpaceExA(LPCSTR,PULARGE_INTEGER,PULARGE_INTEGER,PULARGE_INTEGER);
-WIN_BOOL      WINAPI GetDiskFreeSpaceExW(LPCWSTR,PULARGE_INTEGER,PULARGE_INTEGER,PULARGE_INTEGER);
-#define     GetDiskFreeSpaceEx WINELIB_NAME_AW(GetDiskFreeSpaceEx)
-UINT      WINAPI GetDriveTypeA(LPCSTR);
-UINT      WINAPI GetDriveTypeW(LPCWSTR);
-#define     GetDriveType WINELIB_NAME_AW(GetDriveType)
-DWORD       WINAPI GetFileAttributesA(LPCSTR);
-DWORD       WINAPI GetFileAttributesW(LPCWSTR);
-#define     GetFileAttributes WINELIB_NAME_AW(GetFileAttributes)
-#define     GetFreeSpace(w) (0x100000L)
-UINT      WINAPI GetLogicalDriveStringsA(UINT,LPSTR);
-UINT      WINAPI GetLogicalDriveStringsW(UINT,LPWSTR);
-#define     GetLogicalDriveStrings WINELIB_NAME_AW(GetLogicalDriveStrings)
-INT       WINAPI GetLocaleInfoA(LCID,LCTYPE,LPSTR,INT);
-INT       WINAPI GetLocaleInfoW(LCID,LCTYPE,LPWSTR,INT);
-#define     GetLocaleInfo WINELIB_NAME_AW(GetLocaleInfo)
-DWORD       WINAPI GetModuleFileNameA(HMODULE,LPSTR,DWORD);
-DWORD       WINAPI GetModuleFileNameW(HMODULE,LPWSTR,DWORD);
-#define     GetModuleFileName WINELIB_NAME_AW(GetModuleFileName)
-HMODULE     WINAPI GetModuleHandleA(LPCSTR);
-HMODULE     WINAPI GetModuleHandleW(LPCWSTR);
-#define     GetModuleHandle WINELIB_NAME_AW(GetModuleHandle)
-WIN_BOOL        WINAPI GetOverlappedResult(HANDLE,LPOVERLAPPED,LPDWORD,WIN_BOOL);
-UINT        WINAPI GetPrivateProfileIntA(LPCSTR,LPCSTR,INT,LPCSTR);
-UINT        WINAPI GetPrivateProfileIntW(LPCWSTR,LPCWSTR,INT,LPCWSTR);
-#define     GetPrivateProfileInt WINELIB_NAME_AW(GetPrivateProfileInt)
-INT         WINAPI GetPrivateProfileSectionA(LPCSTR,LPSTR,DWORD,LPCSTR);
-INT         WINAPI GetPrivateProfileSectionW(LPCWSTR,LPWSTR,DWORD,LPCWSTR);
-#define     GetPrivateProfileSection WINELIB_NAME_AW(GetPrivateProfileSection)
-DWORD       WINAPI GetPrivateProfileSectionNamesA(LPSTR,DWORD,LPCSTR);
-DWORD       WINAPI GetPrivateProfileSectionNamesW(LPWSTR,DWORD,LPCWSTR);
-#define     GetPrivateProfileSectionNames WINELIB_NAME_AW(GetPrivateProfileSectionNames)
-INT       WINAPI GetPrivateProfileStringA(LPCSTR,LPCSTR,LPCSTR,LPSTR,UINT,LPCSTR);
-INT       WINAPI GetPrivateProfileStringW(LPCWSTR,LPCWSTR,LPCWSTR,LPWSTR,UINT,LPCWSTR);
-#define     GetPrivateProfileString WINELIB_NAME_AW(GetPrivateProfileString)
-WIN_BOOL      WINAPI GetPrivateProfileStructA(LPCSTR,LPCSTR,LPVOID,UINT,LPCSTR);
-WIN_BOOL      WINAPI GetPrivateProfileStructW(LPCWSTR,LPCWSTR,LPVOID,UINT,LPCWSTR);
-#define     GetPrivateProfileStruct WINELIB_NAME_AW(GetPrivateProfileStruct)
-FARPROC   WINAPI GetProcAddress(HMODULE,LPCSTR);
-UINT      WINAPI GetProfileIntA(LPCSTR,LPCSTR,INT);
-UINT      WINAPI GetProfileIntW(LPCWSTR,LPCWSTR,INT);
-#define     GetProfileInt WINELIB_NAME_AW(GetProfileInt)
-INT       WINAPI GetProfileSectionA(LPCSTR,LPSTR,DWORD);
-INT       WINAPI GetProfileSectionW(LPCWSTR,LPWSTR,DWORD);
-#define     GetProfileSection WINELIB_NAME_AW(GetProfileSection)
-INT       WINAPI GetProfileStringA(LPCSTR,LPCSTR,LPCSTR,LPSTR,UINT);
-INT       WINAPI GetProfileStringW(LPCWSTR,LPCWSTR,LPCWSTR,LPWSTR,UINT);
-#define     GetProfileString WINELIB_NAME_AW(GetProfileString)
-VOID        WINAPI GetStartupInfoA(LPSTARTUPINFOA);
-VOID        WINAPI GetStartupInfoW(LPSTARTUPINFOW);
-#define     GetStartupInfo WINELIB_NAME_AW(GetStartupInfo)
-WIN_BOOL      WINAPI GetStringTypeA(LCID,DWORD,LPCSTR,INT,LPWORD);
-WIN_BOOL      WINAPI GetStringTypeW(DWORD,LPCWSTR,INT,LPWORD);
-#define     GetStringType WINELIB_NAME_AW(GetStringType)
-UINT      WINAPI GetSystemDirectoryA(LPSTR,UINT);
-UINT      WINAPI GetSystemDirectoryW(LPWSTR,UINT);
-#define     GetSystemDirectory WINELIB_NAME_AW(GetSystemDirectory)
-UINT      WINAPI GetTempFileNameA(LPCSTR,LPCSTR,UINT,LPSTR);
-UINT      WINAPI GetTempFileNameW(LPCWSTR,LPCWSTR,UINT,LPWSTR);
-#define     GetTempFileName WINELIB_NAME_AW(GetTempFileName)
-UINT      WINAPI GetTempPathA(UINT,LPSTR);
-UINT      WINAPI GetTempPathW(UINT,LPWSTR);
-#define     GetTempPath WINELIB_NAME_AW(GetTempPath)
-LONG        WINAPI GetVersion(void);
-WIN_BOOL      WINAPI GetExitCodeProcess(HANDLE,LPDWORD);
-WIN_BOOL      WINAPI GetVolumeInformationA(LPCSTR,LPSTR,DWORD,LPDWORD,LPDWORD,LPDWORD,LPSTR,DWORD);
-WIN_BOOL      WINAPI GetVolumeInformationW(LPCWSTR,LPWSTR,DWORD,LPDWORD,LPDWORD,LPDWORD,LPWSTR,DWORD);
-#define     GetVolumeInformation WINELIB_NAME_AW(GetVolumeInformation)
-UINT      WINAPI GetWindowsDirectoryA(LPSTR,UINT);
-UINT      WINAPI GetWindowsDirectoryW(LPWSTR,UINT);
-#define     GetWindowsDirectory WINELIB_NAME_AW(GetWindowsDirectory)
-HGLOBAL16   WINAPI GlobalAlloc16(UINT16,DWORD);
-HGLOBAL   WINAPI GlobalAlloc(UINT,DWORD);
-DWORD       WINAPI GlobalCompact(DWORD);
-UINT      WINAPI GlobalFlags(HGLOBAL);
-HGLOBAL16   WINAPI GlobalFree16(HGLOBAL16);
-HGLOBAL   WINAPI GlobalFree(HGLOBAL);
-HGLOBAL   WINAPI GlobalHandle(LPCVOID);
-WORD        WINAPI GlobalFix16(HGLOBAL16);
-VOID        WINAPI GlobalFix(HGLOBAL);
-LPVOID      WINAPI GlobalLock16(HGLOBAL16);
-LPVOID      WINAPI GlobalLock(HGLOBAL);
-HGLOBAL   WINAPI GlobalReAlloc(HGLOBAL,DWORD,UINT);
-DWORD       WINAPI GlobalSize16(HGLOBAL16);
-DWORD       WINAPI GlobalSize(HGLOBAL);
-VOID        WINAPI GlobalUnfix16(HGLOBAL16);
-VOID        WINAPI GlobalUnfix(HGLOBAL);
-WIN_BOOL16      WINAPI GlobalUnlock16(HGLOBAL16);
-WIN_BOOL      WINAPI GlobalUnlock(HGLOBAL);
-WIN_BOOL16      WINAPI GlobalUnWire16(HGLOBAL16);
-WIN_BOOL      WINAPI GlobalUnWire(HGLOBAL);
-SEGPTR      WINAPI GlobalWire16(HGLOBAL16);
-LPVOID      WINAPI GlobalWire(HGLOBAL);
-WIN_BOOL      WINAPI InitAtomTable(DWORD);
-WIN_BOOL      WINAPI IsBadCodePtr(FARPROC);
-WIN_BOOL      WINAPI IsBadHugeReadPtr(LPCVOID,UINT);
-WIN_BOOL      WINAPI IsBadHugeWritePtr(LPVOID,UINT);
-WIN_BOOL      WINAPI IsBadReadPtr(LPCVOID,UINT);
-WIN_BOOL      WINAPI IsBadStringPtrA(LPCSTR,UINT);
-WIN_BOOL      WINAPI IsBadStringPtrW(LPCWSTR,UINT);
-#define     IsBadStringPtr WINELIB_NAME_AW(IsBadStringPtr)
-WIN_BOOL        WINAPI IsBadWritePtr(LPVOID,UINT);
-WIN_BOOL        WINAPI IsDBCSLeadByte(BYTE);
-WIN_BOOL        WINAPI IsDebuggerPresent(void);
-HINSTANCE16 WINAPI LoadLibrary16(LPCSTR);
-HMODULE   WINAPI LoadLibraryA(LPCSTR);
-HMODULE   WINAPI LoadLibraryW(LPCWSTR);
-#define     LoadLibrary WINELIB_NAME_AW(LoadLibrary)
-HMODULE   WINAPI LoadLibraryExA(LPCSTR,HANDLE,DWORD);
-HMODULE   WINAPI LoadLibraryExW(LPCWSTR,HANDLE,DWORD);
-#define     LoadLibraryEx WINELIB_NAME_AW(LoadLibraryEx)
-HINSTANCE16 WINAPI LoadModule16(LPCSTR,LPVOID);
-HINSTANCE WINAPI LoadModule(LPCSTR,LPVOID);
-HGLOBAL   WINAPI LoadResource(HMODULE,HRSRC);
-HLOCAL    WINAPI LocalAlloc(UINT,DWORD);
-UINT      WINAPI LocalCompact(UINT);
-UINT      WINAPI LocalFlags(HLOCAL);
-HLOCAL    WINAPI LocalFree(HLOCAL);
-HLOCAL    WINAPI LocalHandle(LPCVOID);
-LPVOID      WINAPI LocalLock(HLOCAL);
-HLOCAL    WINAPI LocalReAlloc(HLOCAL,DWORD,UINT);
-UINT      WINAPI LocalShrink(HGLOBAL,UINT);
-UINT      WINAPI LocalSize(HLOCAL);
-WIN_BOOL      WINAPI LocalUnlock(HLOCAL);
-LPVOID      WINAPI LockResource(HGLOBAL);
-#define     LockSegment(handle) GlobalFix((HANDLE)(handle))
-#define     MakeProcInstance(proc,inst) (proc)
-HFILE16     WINAPI OpenFile16(LPCSTR,OFSTRUCT*,UINT16);
-HFILE     WINAPI OpenFile(LPCSTR,OFSTRUCT*,UINT);
-VOID        WINAPI OutputDebugStringA(LPCSTR);
-VOID        WINAPI OutputDebugStringW(LPCWSTR);
-#define     OutputDebugString WINELIB_NAME_AW(OutputDebugString)
-WIN_BOOL        WINAPI ReadProcessMemory(HANDLE, LPCVOID, LPVOID, DWORD, LPDWORD);
-WIN_BOOL        WINAPI RemoveDirectoryA(LPCSTR);
-WIN_BOOL        WINAPI RemoveDirectoryW(LPCWSTR);
-#define     RemoveDirectory WINELIB_NAME_AW(RemoveDirectory)
-WIN_BOOL      WINAPI SetCurrentDirectoryA(LPCSTR);
-WIN_BOOL      WINAPI SetCurrentDirectoryW(LPCWSTR);
-#define     SetCurrentDirectory WINELIB_NAME_AW(SetCurrentDirectory)
-UINT      WINAPI SetErrorMode(UINT);
-WIN_BOOL      WINAPI SetFileAttributesA(LPCSTR,DWORD);
-WIN_BOOL      WINAPI SetFileAttributesW(LPCWSTR,DWORD);
-#define     SetFileAttributes WINELIB_NAME_AW(SetFileAttributes)
-UINT      WINAPI SetHandleCount(UINT);
-#define     SetSwapAreaSize(w) (w)
-WIN_BOOL        WINAPI SetVolumeLabelA(LPCSTR,LPCSTR);
-WIN_BOOL        WINAPI SetVolumeLabelW(LPCWSTR,LPCWSTR);
-#define     SetVolumeLabel WINELIB_NAME_AW(SetVolumeLabel)
-DWORD       WINAPI SizeofResource(HMODULE,HRSRC);
-#define     UnlockSegment(handle) GlobalUnfix((HANDLE)(handle))
-WIN_BOOL      WINAPI WritePrivateProfileSectionA(LPCSTR,LPCSTR,LPCSTR);
-WIN_BOOL      WINAPI WritePrivateProfileSectionW(LPCWSTR,LPCWSTR,LPCWSTR);
-#define     WritePrivateProfileSection WINELIB_NAME_AW(WritePrivateProfileSection)
-WIN_BOOL      WINAPI WritePrivateProfileStringA(LPCSTR,LPCSTR,LPCSTR,LPCSTR);
-WIN_BOOL      WINAPI WritePrivateProfileStringW(LPCWSTR,LPCWSTR,LPCWSTR,LPCWSTR);
-#define     WritePrivateProfileString WINELIB_NAME_AW(WritePrivateProfileString)
-WIN_BOOL            WINAPI WriteProfileSectionA(LPCSTR,LPCSTR);
-WIN_BOOL            WINAPI WriteProfileSectionW(LPCWSTR,LPCWSTR);
-#define     WritePrivateProfileSection WINELIB_NAME_AW(WritePrivateProfileSection)
-WIN_BOOL      WINAPI WritePrivateProfileStructA(LPCSTR,LPCSTR,LPVOID,UINT,LPCSTR);
-WIN_BOOL      WINAPI WritePrivateProfileStructW(LPCWSTR,LPCWSTR,LPVOID,UINT,LPCWSTR);
-#define     WritePrivateProfileStruct WINELIB_NAME_AW(WritePrivateProfileStruct)
-WIN_BOOL        WINAPI WriteProcessMemory(HANDLE, LPVOID, LPVOID, DWORD, LPDWORD);
-WIN_BOOL        WINAPI WriteProfileStringA(LPCSTR,LPCSTR,LPCSTR);
-WIN_BOOL        WINAPI WriteProfileStringW(LPCWSTR,LPCWSTR,LPCWSTR);
-#define     WriteProfileString WINELIB_NAME_AW(WriteProfileString)
-#define     Yield32()
-LPSTR       WINAPI lstrcatA(LPSTR,LPCSTR);
-LPWSTR      WINAPI lstrcatW(LPWSTR,LPCWSTR);
-#define     lstrcat WINELIB_NAME_AW(lstrcat)
-LPSTR       WINAPI lstrcpyA(LPSTR,LPCSTR);
-LPWSTR      WINAPI lstrcpyW(LPWSTR,LPCWSTR);
-#define     lstrcpy WINELIB_NAME_AW(lstrcpy)
-LPSTR       WINAPI lstrcpynA(LPSTR,LPCSTR,INT);
-LPWSTR      WINAPI lstrcpynW(LPWSTR,LPCWSTR,INT);
-#define     lstrcpyn WINELIB_NAME_AW(lstrcpyn)
-INT       WINAPI lstrlenA(LPCSTR);
-INT       WINAPI lstrlenW(LPCWSTR);
-#define     lstrlen WINELIB_NAME_AW(lstrlen)
-HINSTANCE WINAPI WinExec(LPCSTR,UINT);
-LONG        WINAPI _hread(HFILE,LPVOID,LONG);
-LONG        WINAPI _hwrite(HFILE,LPCSTR,LONG);
-HFILE     WINAPI _lcreat(LPCSTR,INT);
-HFILE     WINAPI _lclose(HFILE);
-LONG        WINAPI _llseek(HFILE,LONG,INT);
-HFILE     WINAPI _lopen(LPCSTR,INT);
-UINT      WINAPI _lread(HFILE,LPVOID,UINT);
-UINT      WINAPI _lwrite(HFILE,LPCSTR,UINT);
-SEGPTR      WINAPI WIN16_GlobalLock16(HGLOBAL16);
-INT       WINAPI lstrcmpA(LPCSTR,LPCSTR);
-INT       WINAPI lstrcmpW(LPCWSTR,LPCWSTR);
-#define     lstrcmp WINELIB_NAME_AW(lstrcmp)
-INT       WINAPI lstrcmpiA(LPCSTR,LPCSTR);
-INT       WINAPI lstrcmpiW(LPCWSTR,LPCWSTR);
-#define     lstrcmpi WINELIB_NAME_AW(lstrcmpi)
-
-/* compatibility macros */
-#define     FillMemory RtlFillMemory
-#define     MoveMemory RtlMoveMemory
-#define     ZeroMemory RtlZeroMemory
-#define     CopyMemory RtlCopyMemory
-
-DWORD       WINAPI GetCurrentProcessId(void);
-DWORD       WINAPI GetCurrentThreadId(void);
-DWORD       WINAPI GetLastError(void);
-HANDLE      WINAPI GetProcessHeap(void);
-PVOID       WINAPI InterlockedCompareExchange(PVOID*,PVOID,PVOID);
-LONG        WINAPI InterlockedDecrement(PLONG);
-LONG        WINAPI InterlockedExchange(PLONG,LONG);
-LONG        WINAPI InterlockedExchangeAdd(PLONG,LONG);
-LONG        WINAPI InterlockedIncrement(PLONG);
-VOID        WINAPI SetLastError(DWORD);
-
-#ifdef __WINE__
-#define GetCurrentProcess() ((HANDLE)0xffffffff)
-#define GetCurrentThread()  ((HANDLE)0xfffffffe)
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif  /* __WINE_WINBASE_H */
diff --git a/modules/codec/loader/wine/windef.h b/modules/codec/loader/wine/windef.h
deleted file mode 100644 (file)
index a84cf0e..0000000
+++ /dev/null
@@ -1,679 +0,0 @@
-/*
- * Basic types definitions
- *
- * Copyright 1996 Alexandre Julliard
- *
- * Modified for use with MPlayer, detailed CVS changelog at
- * http://www.mplayerhq.hu/cgi-bin/cvsweb.cgi/main/
- * $Id$
- *
- */
-
-#ifndef __WINE_WINDEF_H
-#define __WINE_WINDEF_H
-
-#ifdef __WINE__
-# include "config.h"
-# undef UNICODE
-#endif
-
-#ifdef _EGCS_
-#define __stdcall
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* Misc. constants. */
-
-#ifdef FALSE
-#undef FALSE
-#endif
-#define FALSE 0
-
-#ifdef TRUE
-#undef TRUE
-#endif
-#define TRUE  1
-
-#ifdef NULL
-#undef NULL
-#endif
-#define NULL  0
-
-/* Macros to map Winelib names to the correct implementation name */
-/* depending on __WINE__ and UNICODE macros.                      */
-/* Note that Winelib is purely Win32.                             */
-
-#ifdef __WINE__
-# define WINELIB_NAME_AW(func) \
-    func##_must_be_suffixed_with_W_or_A_in_this_context \
-    func##_must_be_suffixed_with_W_or_A_in_this_context
-#else  /* __WINE__ */
-# ifdef UNICODE
-#  define WINELIB_NAME_AW(func) func##W
-# else
-#  define WINELIB_NAME_AW(func) func##A
-# endif  /* UNICODE */
-#endif  /* __WINE__ */
-
-#ifdef __WINE__
-# define DECL_WINELIB_TYPE_AW(type)  /* nothing */
-#else   /* __WINE__ */
-# define DECL_WINELIB_TYPE_AW(type)  typedef WINELIB_NAME_AW(type) type;
-#endif  /* __WINE__ */
-
-#ifndef NONAMELESSSTRUCT
-# if defined(__WINE__) || !defined(_FORCENAMELESSSTRUCT)
-#  define NONAMELESSSTRUCT
-# endif
-#endif /* !defined(NONAMELESSSTRUCT) */
-
-#ifndef NONAMELESSUNION
-# if defined(__WINE__) || !defined(_FORCENAMELESSUNION) || !defined(__cplusplus)
-#  define NONAMELESSUNION
-# endif
-#endif /* !defined(NONAMELESSUNION) */
-
-#ifndef NONAMELESSSTRUCT
-#define DUMMYSTRUCTNAME
-#define DUMMYSTRUCTNAME1
-#define DUMMYSTRUCTNAME2
-#define DUMMYSTRUCTNAME3
-#define DUMMYSTRUCTNAME4
-#define DUMMYSTRUCTNAME5
-#else /* !defined(NONAMELESSSTRUCT) */
-#define DUMMYSTRUCTNAME   s
-#define DUMMYSTRUCTNAME1  s1
-#define DUMMYSTRUCTNAME2  s2
-#define DUMMYSTRUCTNAME3  s3
-#define DUMMYSTRUCTNAME4  s4
-#define DUMMYSTRUCTNAME5  s5
-#endif /* !defined(NONAMELESSSTRUCT) */
-
-#ifndef NONAMELESSUNION
-#define DUMMYUNIONNAME
-#define DUMMYUNIONNAME1
-#define DUMMYUNIONNAME2
-#define DUMMYUNIONNAME3
-#define DUMMYUNIONNAME4
-#define DUMMYUNIONNAME5
-#else /* !defined(NONAMELESSUNION) */
-#define DUMMYUNIONNAME   u
-#define DUMMYUNIONNAME1  u1
-#define DUMMYUNIONNAME2  u2
-#define DUMMYUNIONNAME3  u3
-#define DUMMYUNIONNAME4  u4
-#define DUMMYUNIONNAME5  u5
-#endif /* !defined(NONAMELESSUNION) */
-
-/* Calling conventions definitions */
-
-#ifdef __i386__
-# if defined(__GNUC__) && ((__GNUC__ > 2) || ((__GNUC__ == 2) && (__GNUC_MINOR__ >= 7)))
-#  ifndef _EGCS_ 
-#define __stdcall __attribute__((__stdcall__))
-#define __cdecl   __attribute__((__cdecl__))
-#  define __RESTORE_ES  __asm__ __volatile__("pushl %ds\n\tpopl %es")
-#  endif
-# else
-// #  error You need gcc >= 2.7 to build Wine on a 386
-# endif
-#else 
-# define __stdcall
-# define __cdecl
-# define __RESTORE_ES
-#endif
-
-#define CALLBACK    __stdcall
-#define WINAPI      __stdcall
-#define APIPRIVATE  __stdcall
-#define PASCAL      __stdcall
-#define pascal      __stdcall
-#define _pascal     __stdcall
-#if !defined(__CYGWIN__) && !defined(__MINGW32__)
-#define _stdcall    __stdcall
-#define _fastcall   __stdcall
-#define __fastcall  __stdcall
-#endif
-#define __export    __stdcall
-#define CDECL       __cdecl
-#define _CDECL      __cdecl
-#define cdecl       __cdecl
-#if !defined(__CYGWIN__) && !defined(__MINGW32__)
-#define _cdecl      __cdecl
-#endif
-#define WINAPIV     __cdecl
-#define APIENTRY    WINAPI
-
-#if !defined(__CYGWIN__) && !defined(__MINGW32__)
-#define __declspec(x)
-#endif
-#define dllimport
-#define dllexport
-
-#define CONST       const
-
-/* Standard data types. These are the same for emulator and library. */
-
-typedef void            VOID;
-typedef int             INT;
-typedef unsigned int    UINT;
-typedef unsigned short  WORD;
-typedef unsigned long   DWORD;
-typedef unsigned long   ULONG;
-typedef unsigned char   BYTE;
-typedef long            LONG;
-typedef short           SHORT;
-typedef unsigned short  USHORT;
-typedef char            CHAR;
-typedef unsigned char   UCHAR;
-
-typedef LONG SCODE;
-
-/* Some systems might have wchar_t, but we really need 16 bit characters */
-typedef unsigned short  WCHAR;
-typedef int             WIN_BOOL;
-typedef double          DATE;
-typedef double          DOUBLE;
-typedef long long       LONGLONG;
-typedef unsigned long long   ULONGLONG;
-
-/* FIXME: Wine does not compile with strict on, therefore strict
- * handles are presently only usable on machines where sizeof(UINT) ==
- * sizeof(void*).  HANDLEs are supposed to be void* but a large amount
- * of WINE code operates on HANDLES as if they are UINTs. So to WINE
- * they exist as UINTs but to the Winelib user who turns on strict,
- * they exist as void*. If there is a size difference between UINT and
- * void* then things get ugly.  */
-#ifdef STRICT
-typedef VOID*           HANDLE;
-#else
-typedef UINT            HANDLE;
-#endif
-
-
-typedef HANDLE         *LPHANDLE;
-
-/* Integer types. These are the same for emulator and library. */
-typedef UINT            WPARAM;
-typedef LONG            LPARAM;
-typedef LONG            HRESULT;
-typedef LONG            LRESULT;
-typedef WORD            ATOM;
-typedef WORD            CATCHBUF[9];
-typedef WORD           *LPCATCHBUF;
-typedef HANDLE          HHOOK;
-typedef HANDLE          HMONITOR;
-typedef DWORD           LCID;
-typedef WORD            LANGID;
-typedef DWORD           LCTYPE;
-typedef float           FLOAT;
-
-/* Pointers types. These are the same for emulator and library. */
-/* winnt types */
-typedef VOID           *PVOID;
-typedef const void     *PCVOID;
-typedef CHAR           *PCHAR;
-typedef UCHAR          *PUCHAR;
-typedef BYTE           *PBYTE;
-typedef WORD           *PWORD;
-typedef USHORT         *PUSHORT;
-typedef SHORT          *PSHORT;
-typedef ULONG          *PULONG;
-typedef LONG           *PLONG;
-typedef DWORD          *PDWORD;
-/* common win32 types */
-typedef CHAR           *LPSTR;
-typedef CHAR           *PSTR;
-typedef const CHAR     *LPCSTR;
-typedef const CHAR     *PCSTR;
-typedef WCHAR          *LPWSTR;
-typedef WCHAR          *PWSTR;
-typedef const WCHAR    *LPCWSTR;
-typedef const WCHAR    *PCWSTR;
-typedef BYTE           *LPBYTE;
-typedef WORD           *LPWORD;
-typedef DWORD          *LPDWORD;
-typedef LONG           *LPLONG;
-typedef VOID           *LPVOID;
-typedef const VOID     *LPCVOID;
-typedef INT            *PINT;
-typedef INT            *LPINT;
-typedef UINT           *PUINT;
-typedef UINT           *LPUINT;
-typedef FLOAT          *PFLOAT;
-typedef FLOAT          *LPFLOAT;
-typedef WIN_BOOL           *PWIN_BOOL;
-typedef WIN_BOOL           *LPWIN_BOOL;
-
-/* Special case: a segmented pointer is just a pointer in the user's code. */
-
-#ifdef __WINE__
-typedef DWORD SEGPTR;
-#else
-typedef void* SEGPTR;
-#endif /* __WINE__ */
-
-/* Handle types that exist both in Win16 and Win32. */
-
-#ifdef STRICT
-#define DECLARE_HANDLE(a) \
-       typedef struct a##__ { int unused; } *a; \
-       typedef a *P##a; \
-       typedef a *LP##a
-#else /*STRICT*/
-#define DECLARE_HANDLE(a) \
-       typedef HANDLE a; \
-       typedef a *P##a; \
-       typedef a *LP##a
-#endif /*STRICT*/
-
-DECLARE_HANDLE(HACMDRIVERID);
-DECLARE_HANDLE(HACMDRIVER);
-DECLARE_HANDLE(HACMOBJ);
-DECLARE_HANDLE(HACMSTREAM);
-DECLARE_HANDLE(HMETAFILEPICT);
-
-DECLARE_HANDLE(HACCEL);
-DECLARE_HANDLE(HBITMAP);
-DECLARE_HANDLE(HBRUSH);
-DECLARE_HANDLE(HCOLORSPACE);
-DECLARE_HANDLE(HCURSOR);
-DECLARE_HANDLE(HDC);
-DECLARE_HANDLE(HDROP);
-DECLARE_HANDLE(HDRVR);
-DECLARE_HANDLE(HDWP);
-DECLARE_HANDLE(HENHMETAFILE);
-DECLARE_HANDLE(HFILE);
-DECLARE_HANDLE(HFONT);
-DECLARE_HANDLE(HICON);
-DECLARE_HANDLE(HINSTANCE);
-DECLARE_HANDLE(HKEY);
-DECLARE_HANDLE(HMENU);
-DECLARE_HANDLE(HMETAFILE);
-DECLARE_HANDLE(HMIDI);
-DECLARE_HANDLE(HMIDIIN);
-DECLARE_HANDLE(HMIDIOUT);
-DECLARE_HANDLE(HMIDISTRM);
-DECLARE_HANDLE(HMIXER);
-DECLARE_HANDLE(HMIXEROBJ);
-DECLARE_HANDLE(HMMIO);
-DECLARE_HANDLE(HPALETTE);
-DECLARE_HANDLE(HPEN);
-DECLARE_HANDLE(HQUEUE);
-DECLARE_HANDLE(HRGN);
-DECLARE_HANDLE(HRSRC);
-DECLARE_HANDLE(HTASK);
-DECLARE_HANDLE(HWAVE);
-DECLARE_HANDLE(HWAVEIN);
-DECLARE_HANDLE(HWAVEOUT);
-DECLARE_HANDLE(HWINSTA);
-DECLARE_HANDLE(HDESK);
-DECLARE_HANDLE(HWND);
-DECLARE_HANDLE(HKL);
-DECLARE_HANDLE(HIC);
-DECLARE_HANDLE(HRASCONN);
-
-/* Handle types that must remain interchangeable even with strict on */
-
-typedef HINSTANCE HMODULE;
-typedef HANDLE HGDIOBJ;
-typedef HANDLE HGLOBAL;
-typedef HANDLE HLOCAL;
-typedef HANDLE GLOBALHANDLE;
-typedef HANDLE LOCALHANDLE;
-
-/* Callback function pointers types */
-//WIN_BOOL CALLBACK DATEFMT_ENUMPROCA(LPSTR);
-
-typedef WIN_BOOL  CALLBACK  (* DATEFMT_ENUMPROCA)(LPSTR);
-typedef WIN_BOOL    CALLBACK (* DATEFMT_ENUMPROCW)(LPWSTR);
-DECL_WINELIB_TYPE_AW(DATEFMT_ENUMPROC)
-typedef WIN_BOOL    CALLBACK (*DLGPROC)(HWND,UINT,WPARAM,LPARAM);
-typedef LRESULT CALLBACK (*DRIVERPROC)(DWORD,HDRVR,UINT,LPARAM,LPARAM);
-typedef INT     CALLBACK (*EDITWORDBREAKPROCA)(LPSTR,INT,INT,INT);
-typedef INT     CALLBACK (*EDITWORDBREAKPROCW)(LPWSTR,INT,INT,INT);
-DECL_WINELIB_TYPE_AW(EDITWORDBREAKPROC)
-typedef LRESULT CALLBACK (*FARPROC)();
-typedef INT     CALLBACK (*PROC)();
-typedef WIN_BOOL    CALLBACK (*GRAYSTRINGPROC)(HDC,LPARAM,INT);
-typedef LRESULT CALLBACK (*HOOKPROC)(INT,WPARAM,LPARAM);
-typedef WIN_BOOL    CALLBACK (*PROPENUMPROCA)(HWND,LPCSTR,HANDLE);
-typedef WIN_BOOL    CALLBACK (*PROPENUMPROCW)(HWND,LPCWSTR,HANDLE);
-DECL_WINELIB_TYPE_AW(PROPENUMPROC)
-typedef WIN_BOOL    CALLBACK (*PROPENUMPROCEXA)(HWND,LPCSTR,HANDLE,LPARAM);
-typedef WIN_BOOL    CALLBACK (*PROPENUMPROCEXW)(HWND,LPCWSTR,HANDLE,LPARAM);
-DECL_WINELIB_TYPE_AW(PROPENUMPROCEX)
-typedef WIN_BOOL    CALLBACK (* TIMEFMT_ENUMPROCA)(LPSTR);
-typedef WIN_BOOL    CALLBACK (* TIMEFMT_ENUMPROCW)(LPWSTR);
-DECL_WINELIB_TYPE_AW(TIMEFMT_ENUMPROC)
-typedef VOID    CALLBACK (*TIMERPROC)(HWND,UINT,UINT,DWORD);
-typedef WIN_BOOL CALLBACK (*WNDENUMPROC)(HWND,LPARAM);
-typedef LRESULT CALLBACK (*WNDPROC)(HWND,UINT,WPARAM,LPARAM);
-
-/*----------------------------------------------------------------------------
-** FIXME:  Better isolate Wine's reliance on the xxx16 type definitions.
-**         For now, we just isolate them to make the situation clear.
-**--------------------------------------------------------------------------*/
-/*
- * Basic type definitions for 16 bit variations on Windows types.
- * These types are provided mostly to insure compatibility with
- * 16 bit windows code.
- */
-
-#ifndef __WINE_WINDEF16_H
-#define __WINE_WINDEF16_H
-
-#include "windef.h"
-
-/* Standard data types */
-
-typedef short           INT16;
-typedef unsigned short  UINT16;
-typedef unsigned short  WIN_BOOL16;
-
-typedef UINT16          HANDLE16;
-typedef HANDLE16       *LPHANDLE16;
-
-typedef UINT16          WPARAM16;
-typedef INT16          *LPINT16;
-typedef UINT16         *LPUINT16;
-
-#define DECLARE_HANDLE16(a) \
-       typedef HANDLE16 a##16; \
-       typedef a##16 *P##a##16; \
-       typedef a##16 *NP##a##16; \
-       typedef a##16 *LP##a##16 
-
-DECLARE_HANDLE16(HACMDRIVERID);
-DECLARE_HANDLE16(HACMDRIVER);
-DECLARE_HANDLE16(HACMOBJ);
-DECLARE_HANDLE16(HACMSTREAM);
-DECLARE_HANDLE16(HMETAFILEPICT);
-
-DECLARE_HANDLE16(HACCEL);
-DECLARE_HANDLE16(HBITMAP);
-DECLARE_HANDLE16(HBRUSH);
-DECLARE_HANDLE16(HCOLORSPACE);
-DECLARE_HANDLE16(HCURSOR);
-DECLARE_HANDLE16(HDC);
-DECLARE_HANDLE16(HDROP);
-DECLARE_HANDLE16(HDRVR);
-DECLARE_HANDLE16(HDWP);
-DECLARE_HANDLE16(HENHMETAFILE);
-DECLARE_HANDLE16(HFILE);
-DECLARE_HANDLE16(HFONT);
-DECLARE_HANDLE16(HICON);
-DECLARE_HANDLE16(HINSTANCE);
-DECLARE_HANDLE16(HKEY);
-DECLARE_HANDLE16(HMENU);
-DECLARE_HANDLE16(HMETAFILE);
-DECLARE_HANDLE16(HMIDI);
-DECLARE_HANDLE16(HMIDIIN);
-DECLARE_HANDLE16(HMIDIOUT);
-DECLARE_HANDLE16(HMIDISTRM);
-DECLARE_HANDLE16(HMIXER);
-DECLARE_HANDLE16(HMIXEROBJ);
-DECLARE_HANDLE16(HMMIO);
-DECLARE_HANDLE16(HPALETTE);
-DECLARE_HANDLE16(HPEN);
-DECLARE_HANDLE16(HQUEUE);
-DECLARE_HANDLE16(HRGN);
-DECLARE_HANDLE16(HRSRC);
-DECLARE_HANDLE16(HTASK);
-DECLARE_HANDLE16(HWAVE);
-DECLARE_HANDLE16(HWAVEIN);
-DECLARE_HANDLE16(HWAVEOUT);
-DECLARE_HANDLE16(HWINSTA);
-DECLARE_HANDLE16(HDESK);
-DECLARE_HANDLE16(HWND);
-DECLARE_HANDLE16(HKL);
-DECLARE_HANDLE16(HIC);
-DECLARE_HANDLE16(HRASCONN);
-#undef DECLARE_HANDLE16
-
-typedef HINSTANCE16 HMODULE16;
-typedef HANDLE16 HGDIOBJ16;
-typedef HANDLE16 HGLOBAL16;
-typedef HANDLE16 HLOCAL16;
-
-/* The SIZE structure */
-typedef struct
-{
-    INT16  cx;
-    INT16  cy;
-} SIZE16, *PSIZE16, *LPSIZE16;
-
-/* The POINT structure */
-
-typedef struct
-{
-    INT16  x;
-    INT16  y;
-} POINT16, *PPOINT16, *LPPOINT16;
-
-/* The RECT structure */
-
-typedef struct
-{
-    INT16  left;
-    INT16  top;
-    INT16  right;
-    INT16  bottom;
-} RECT16, *LPRECT16;
-
-/* Callback function pointers types */
-
-typedef LRESULT CALLBACK (*DRIVERPROC16)(DWORD,HDRVR16,UINT16,LPARAM,LPARAM);
-typedef WIN_BOOL16  CALLBACK (*DLGPROC16)(HWND16,UINT16,WPARAM16,LPARAM);
-typedef INT16   CALLBACK (*EDITWORDBREAKPROC16)(LPSTR,INT16,INT16,INT16);
-typedef LRESULT CALLBACK (*FARPROC16)();
-typedef INT16   CALLBACK (*PROC16)();
-typedef WIN_BOOL16  CALLBACK (*GRAYSTRINGPROC16)(HDC16,LPARAM,INT16);
-typedef LRESULT CALLBACK (*HOOKPROC16)(INT16,WPARAM16,LPARAM);
-typedef WIN_BOOL16  CALLBACK (*PROPENUMPROC16)(HWND16,SEGPTR,HANDLE16);
-typedef VOID    CALLBACK (*TIMERPROC16)(HWND16,UINT16,UINT16,DWORD);
-typedef LRESULT CALLBACK (*WNDENUMPROC16)(HWND16,LPARAM);
-typedef LRESULT CALLBACK (*WNDPROC16)(HWND16,UINT16,WPARAM16,LPARAM);
-
-#endif /* __WINE_WINDEF16_H */
-
-/* Define some empty macros for compatibility with Windows code. */
-
-#ifndef __WINE__
-#define NEAR
-#define FAR
-#define near
-#define far
-#define _near
-#define _far
-#define IN
-#define OUT
-#define OPTIONAL
-#endif  /* __WINE__ */
-
-/* Macro for structure packing. */
-
-#ifdef __GNUC__
-#ifndef _EGCS_
-#define WINE_PACKED   __attribute__((packed))
-#define WINE_UNUSED   __attribute__((unused))
-#define WINE_NORETURN __attribute__((noreturn))
-#endif
-#else
-#define WINE_PACKED    /* nothing */
-#define WINE_UNUSED    /* nothing */
-#define WINE_NORETURN  /* nothing */
-#endif
-
-/* Macros to split words and longs. */
-
-#define LOBYTE(w)              ((BYTE)(WORD)(w))
-#define HIBYTE(w)              ((BYTE)((WORD)(w) >> 8))
-
-#define LOWORD(l)              ((WORD)(DWORD)(l))
-#define HIWORD(l)              ((WORD)((DWORD)(l) >> 16))
-
-#define SLOWORD(l)             ((INT16)(LONG)(l))
-#define SHIWORD(l)             ((INT16)((LONG)(l) >> 16))
-
-#define MAKEWORD(low,high)     ((WORD)(((BYTE)(low)) | ((WORD)((BYTE)(high))) << 8))
-#define MAKELONG(low,high)     ((LONG)(((WORD)(low)) | (((DWORD)((WORD)(high))) << 16)))
-#define MAKELPARAM(low,high)   ((LPARAM)MAKELONG(low,high))
-#define MAKEWPARAM(low,high)   ((WPARAM)MAKELONG(low,high))
-#define MAKELRESULT(low,high)  ((LRESULT)MAKELONG(low,high))
-#define MAKEINTATOM(atom)      ((LPCSTR)MAKELONG((atom),0))
-
-#define SELECTOROF(ptr)     (HIWORD(ptr))
-#define OFFSETOF(ptr)       (LOWORD(ptr))
-
-#ifdef __WINE__
-/* macros to set parts of a DWORD (not in the Windows API) */
-#define SET_LOWORD(dw,val)  ((dw) = ((dw) & 0xffff0000) | LOWORD(val))
-#define SET_LOBYTE(dw,val)  ((dw) = ((dw) & 0xffffff00) | LOBYTE(val))
-#define SET_HIBYTE(dw,val)  ((dw) = ((dw) & 0xffff00ff) | (LOWORD(val) & 0xff00))
-#define ADD_LOWORD(dw,val)  ((dw) = ((dw) & 0xffff0000) | LOWORD((DWORD)(dw)+(val)))
-#endif
-
-/* Macros to access unaligned or wrong-endian WORDs and DWORDs. */
-/* Note: These macros are semantically broken, at least for wrc.  wrc
-   spits out data in the platform's current binary format, *not* in 
-   little-endian format.  These macros are used throughout the resource
-   code to load and store data to the resources.  Since it is unlikely 
-   that we'll ever be dealing with little-endian resource data, the 
-   byte-swapping nature of these macros has been disabled.  Rather than 
-   remove the use of these macros from the resource loading code, the
-   macros have simply been disabled.  In the future, someone may want 
-   to reactivate these macros for other purposes.  In that case, the
-   resource code will have to be modified to use different macros. */ 
-
-#if 1
-#define PUT_WORD(ptr,w)   (*(WORD *)(ptr) = (w))
-#define GET_WORD(ptr)     (*(WORD *)(ptr))
-#define PUT_DWORD(ptr,dw) (*(DWORD *)(ptr) = (dw))
-#define GET_DWORD(ptr)    (*(DWORD *)(ptr))
-#else
-#define PUT_WORD(ptr,w)   (*(BYTE *)(ptr) = LOBYTE(w), \
-                           *((BYTE *)(ptr) + 1) = HIBYTE(w))
-#define GET_WORD(ptr)     ((WORD)(*(BYTE *)(ptr) | \
-                                  (WORD)(*((BYTE *)(ptr)+1) << 8)))
-#define PUT_DWORD(ptr,dw) (PUT_WORD((ptr),LOWORD(dw)), \
-                           PUT_WORD((WORD *)(ptr)+1,HIWORD(dw)))
-#define GET_DWORD(ptr)    ((DWORD)(GET_WORD(ptr) | \
-                                   ((DWORD)GET_WORD((WORD *)(ptr)+1) << 16)))
-#endif  /* 1 */
-
-/* min and max macros */
-#define __max(a,b) (((a) > (b)) ? (a) : (b))
-#define __min(a,b) (((a) < (b)) ? (a) : (b))
-#ifndef max
-#define max(a,b)   (((a) > (b)) ? (a) : (b))
-#endif
-#ifndef min
-#define min(a,b)   (((a) < (b)) ? (a) : (b))
-#endif
-
-#ifndef _MAX_PATH
-#define _MAX_PATH  260
-#endif
-#ifndef MAX_PATH
-#define MAX_PATH   260
-#endif
-#ifndef _MAX_DRIVE
-#define _MAX_DRIVE 3
-#endif
-#ifndef _MAX_DIR
-#define _MAX_DIR   256
-#endif
-#ifndef _MAX_FNAME
-#define _MAX_FNAME 255
-#endif
-#ifndef _MAX_EXT
-#define _MAX_EXT   256
-#endif
-
-#define HFILE_ERROR16   ((HFILE16)-1)
-#define HFILE_ERROR     ((HFILE)-1)
-
-/* The SIZE structure */
-typedef struct tagSIZE
-{
-    INT  cx;
-    INT  cy;
-} SIZE, *PSIZE, *LPSIZE;
-
-
-typedef SIZE SIZEL, *PSIZEL, *LPSIZEL;
-
-#define CONV_SIZE16TO32(s16,s32) \
-            ((s32)->cx = (INT)(s16)->cx, (s32)->cy = (INT)(s16)->cy)
-#define CONV_SIZE32TO16(s32,s16) \
-            ((s16)->cx = (INT16)(s32)->cx, (s16)->cy = (INT16)(s32)->cy)
-
-/* The POINT structure */
-typedef struct tagPOINT
-{
-    LONG  x;
-    LONG  y;
-} POINT, *PPOINT, *LPPOINT;
-
-typedef struct _POINTL
-{
-    LONG x;
-    LONG y;
-} POINTL;
-
-#define CONV_POINT16TO32(p16,p32) \
-            ((p32)->x = (INT)(p16)->x, (p32)->y = (INT)(p16)->y)
-#define CONV_POINT32TO16(p32,p16) \
-            ((p16)->x = (INT16)(p32)->x, (p16)->y = (INT16)(p32)->y)
-
-#define MAKEPOINT16(l) (*((POINT16 *)&(l)))
-
-/* The POINTS structure */
-
-typedef struct tagPOINTS
-{
-       SHORT x;
-       SHORT y;
-} POINTS, *PPOINTS, *LPPOINTS;
-
-
-#define MAKEPOINTS(l)  (*((POINTS *)&(l)))
-
-
-/* The RECT structure */
-typedef struct tagRECT
-{
-    short  left;
-    short  top;
-    short  right;
-    short  bottom;
-} RECT, *PRECT, *LPRECT;
-typedef const RECT *LPCRECT;
-
-
-typedef struct tagRECTL
-{
-    LONG left;
-    LONG top;  
-    LONG right;
-    LONG bottom;
-} RECTL, *PRECTL, *LPRECTL;
-
-typedef const RECTL *LPCRECTL;
-
-#define CONV_RECT16TO32(r16,r32) \
-    ((r32)->left  = (INT)(r16)->left,  (r32)->top    = (INT)(r16)->top, \
-     (r32)->right = (INT)(r16)->right, (r32)->bottom = (INT)(r16)->bottom)
-#define CONV_RECT32TO16(r32,r16) \
-    ((r16)->left  = (INT16)(r32)->left,  (r16)->top    = (INT16)(r32)->top, \
-     (r16)->right = (INT16)(r32)->right, (r16)->bottom = (INT16)(r32)->bottom)
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __WINE_WINDEF_H */
diff --git a/modules/codec/loader/wine/winerror.h b/modules/codec/loader/wine/winerror.h
deleted file mode 100644 (file)
index 0c78792..0000000
+++ /dev/null
@@ -1,1658 +0,0 @@
-#ifndef __WINE_WINERROR_H
-#define __WINE_WINERROR_H
-
-
-extern int WIN32_LastError;
-
-#define FACILITY_NULL      0
-#define FACILITY_RPC       1
-#define FACILITY_DISPATCH  2
-#define FACILITY_STORAGE   3
-#define FACILITY_ITF           4
-#define FACILITY_WIN32         7
-#define FACILITY_WINDOWS   8
-#define FACILITY_SSPI      9
-#define FACILITY_CONTROL   10
-#define FACILITY_CERT      11
-#define FACILITY_INTERNET  12
-
-#define SEVERITY_ERROR         1
-
-
-#define MAKE_HRESULT(sev,fac,code) \
-    ((HRESULT) (((unsigned long)(sev)<<31) | ((unsigned long)(fac)<<16) | ((unsigned long)(code))) )
-#define MAKE_SCODE(sev,fac,code) \
-        ((SCODE) (((unsigned long)(sev)<<31) | ((unsigned long)(fac)<<16) | ((unsigned long)(code))) )
-#define SUCCEEDED(stat) ((HRESULT)(stat)>=0)
-#define FAILED(stat) ((HRESULT)(stat)<0)
-
-#define HRESULT_CODE(hr) ((hr) & 0xFFFF)
-#define SCODE_CODE(sc)   ((sc) & 0xFFFF)
-
-#define HRESULT_FACILITY(hr)  (((hr) >> 16) & 0x1FFF)
-#define SCODE_FACILITY(sc)  (((sc) >> 16) & 0x1FFF)
-
-/* ERROR_UNKNOWN is a placeholder for error conditions which haven't
- * been tested yet so we're not exactly sure what will be returned.
- * All instances of ERROR_UNKNOWN should be tested under Win95/NT
- * and replaced.
- */
-#define ERROR_UNKNOWN               99999
-
-#define SEVERITY_SUCCESS    0
-#define SEVERITY_ERROR      1
-
-#define NO_ERROR                                           0
-#define ERROR_SUCCESS                                      0
-#define ERROR_INVALID_FUNCTION                             1
-#define ERROR_FILE_NOT_FOUND                               2
-#define ERROR_PATH_NOT_FOUND                               3
-#define ERROR_TOO_MANY_OPEN_FILES                          4
-#define ERROR_ACCESS_DENIED                                5
-#define ERROR_INVALID_HANDLE                               6
-#define ERROR_ARENA_TRASHED                                7
-#define ERROR_NOT_ENOUGH_MEMORY                            8
-#define ERROR_INVALID_BLOCK                                9
-#define ERROR_BAD_ENVIRONMENT                              10
-#define ERROR_BAD_FORMAT                                   11
-#define ERROR_INVALID_ACCESS                               12
-#define ERROR_INVALID_DATA                                 13
-#define ERROR_OUTOFMEMORY                                  14
-#define ERROR_INVALID_DRIVE                                15
-#define ERROR_CURRENT_DIRECTORY                            16
-#define ERROR_NOT_SAME_DEVICE                              17
-#define ERROR_NO_MORE_FILES                                18
-#define ERROR_WRITE_PROTECT                                19
-#define ERROR_BAD_UNIT                                     20
-#define ERROR_NOT_READY                                    21
-#define ERROR_BAD_COMMAND                                  22
-#define ERROR_CRC                                          23
-#define ERROR_BAD_LENGTH                                   24
-#define ERROR_SEEK                                         25
-#define ERROR_NOT_DOS_DISK                                 26
-#define ERROR_SECTOR_NOT_FOUND                             27
-#define ERROR_OUT_OF_PAPER                                 28
-#define ERROR_WRITE_FAULT                                  29
-#define ERROR_READ_FAULT                                   30
-#define ERROR_GEN_FAILURE                                  31
-#define ERROR_SHARING_VIOLATION                            32
-#define ERROR_LOCK_VIOLATION                               33
-#define ERROR_WRONG_DISK                                   34
-#define ERROR_SHARING_BUFFER_EXCEEDED                      36
-#define ERROR_HANDLE_EOF                                   38
-#define ERROR_HANDLE_DISK_FULL                             39
-#define ERROR_NOT_SUPPORTED                                50
-#define ERROR_REM_NOT_LIST                                 51
-#define ERROR_DUP_NAME                                     52
-#define ERROR_BAD_NETPATH                                  53
-#define ERROR_NETWORK_BUSY                                 54
-#define ERROR_DEV_NOT_EXIST                                55
-#define ERROR_TOO_MANY_CMDS                                56
-#define ERROR_ADAP_HDW_ERR                                 57
-#define ERROR_BAD_NET_RESP                                 58
-#define ERROR_UNEXP_NET_ERR                                59
-#define ERROR_BAD_REM_ADAP                                 60
-#define ERROR_PRINTQ_FULL                                  61
-#define ERROR_NO_SPOOL_SPACE                               62
-#define ERROR_PRINT_CANCELLED                              63
-#define ERROR_NETNAME_DELETED                              64
-#define ERROR_NETWORK_ACCESS_DENIED                        65
-#define ERROR_BAD_DEV_TYPE                                 66
-#define ERROR_BAD_NET_NAME                                 67
-#define ERROR_TOO_MANY_NAMES                               68
-#define ERROR_TOO_MANY_SESS                                69
-#define ERROR_SHARING_PAUSED                               70
-#define ERROR_REQ_NOT_ACCEP                                71
-#define ERROR_REDIR_PAUSED                                 72
-#define ERROR_FILE_EXISTS                                  80
-#define ERROR_CANNOT_MAKE                                  82
-#define ERROR_FAIL_I24                                     83
-#define ERROR_OUT_OF_STRUCTURES                            84
-#define ERROR_ALREADY_ASSIGNED                             85
-#define ERROR_INVALID_PASSWORD                             86
-#define ERROR_INVALID_PARAMETER                            87
-#define ERROR_NET_WRITE_FAULT                              88
-#define ERROR_NO_PROC_SLOTS                                89
-#define ERROR_TOO_MANY_SEMAPHORES                          100
-#define ERROR_EXCL_SEM_ALREADY_OWNED                       101
-#define ERROR_SEM_IS_SET                                   102
-#define ERROR_TOO_MANY_SEM_REQUESTS                        103
-#define ERROR_INVALID_AT_INTERRUPT_TIME                    104
-#define ERROR_SEM_OWNER_DIED                               105
-#define ERROR_SEM_USER_LIMIT                               106
-#define ERROR_DISK_CHANGE                                  107
-#define ERROR_DRIVE_LOCKED                                 108
-#define ERROR_BROKEN_PIPE                                  109
-#define ERROR_OPEN_FAILED                                  110
-#define ERROR_BUFFER_OVERFLOW                              111
-#define ERROR_DISK_FULL                                    112
-#define ERROR_NO_MORE_SEARCH_HANDLES                       113
-#define ERROR_INVALID_TARGET_HANDLE                        114
-#define ERROR_INVALID_CATEGORY                             117
-#define ERROR_INVALID_VERIFY_SWITCH                        118
-#define ERROR_BAD_DRIVER_LEVEL                             119
-#define ERROR_CALL_NOT_IMPLEMENTED                         120
-#define ERROR_SEM_TIMEOUT                                  121
-#define ERROR_INSUFFICIENT_BUFFER                          122
-#define ERROR_INVALID_NAME                                 123
-#define ERROR_INVALID_LEVEL                                124
-#define ERROR_NO_VOLUME_LABEL                              125
-#define ERROR_MOD_NOT_FOUND                                126
-#define ERROR_PROC_NOT_FOUND                               127
-#define ERROR_WAIT_NO_CHILDREN                             128
-#define ERROR_CHILD_NOT_COMPLETE                           129
-#define ERROR_DIRECT_ACCESS_HANDLE                         130
-#define ERROR_NEGATIVE_SEEK                                131
-#define ERROR_SEEK_ON_DEVICE                               132
-#define ERROR_IS_JOIN_TARGET                               133
-#define ERROR_IS_JOINED                                    134
-#define ERROR_IS_SUBSTED                                   135
-#define ERROR_NOT_JOINED                                   136
-#define ERROR_NOT_SUBSTED                                  137
-#define ERROR_JOIN_TO_JOIN                                 138
-#define ERROR_SUBST_TO_SUBST                               139
-#define ERROR_JOIN_TO_SUBST                                140
-#define ERROR_SUBST_TO_JOIN                                141
-#define ERROR_BUSY_DRIVE                                   142
-#define ERROR_SAME_DRIVE                                   143
-#define ERROR_DIR_NOT_ROOT                                 144
-#define ERROR_DIR_NOT_EMPTY                                145
-#define ERROR_IS_SUBST_PATH                                146
-#define ERROR_IS_JOIN_PATH                                 147
-#define ERROR_PATH_BUSY                                    148
-#define ERROR_IS_SUBST_TARGET                              149
-#define ERROR_SYSTEM_TRACE                                 150
-#define ERROR_INVALID_EVENT_COUNT                          151
-#define ERROR_TOO_MANY_MUXWAITERS                          152
-#define ERROR_INVALID_LIST_FORMAT                          153
-#define ERROR_LABEL_TOO_LONG                               154
-#define ERROR_TOO_MANY_TCBS                                155
-#define ERROR_SIGNAL_REFUSED                               156
-#define ERROR_DISCARDED                                    157
-#define ERROR_NOT_LOCKED                                   158
-#define ERROR_BAD_THREADID_ADDR                            159
-#define ERROR_BAD_ARGUMENTS                                160
-#define ERROR_BAD_PATHNAME                                 161
-#define ERROR_SIGNAL_PENDING                               162
-#define ERROR_MAX_THRDS_REACHED                            164
-#define ERROR_LOCK_FAILED                                  167
-#define ERROR_BUSY                                         170
-#define ERROR_CANCEL_VIOLATION                             173
-#define ERROR_ATOMIC_LOCKS_NOT_SUPPORTED                   174
-#define ERROR_INVALID_SEGMENT_NUMBER                       180
-#define ERROR_INVALID_ORDINAL                              182
-#define ERROR_ALREADY_EXISTS                               183
-#define ERROR_INVALID_FLAG_NUMBER                          186
-#define ERROR_SEM_NOT_FOUND                                187
-#define ERROR_INVALID_STARTING_CODESEG                     188
-#define ERROR_INVALID_STACKSEG                             189
-#define ERROR_INVALID_MODULETYPE                           190
-#define ERROR_INVALID_EXE_SIGNATURE                        191
-#define ERROR_EXE_MARKED_INVALID                           192
-#define ERROR_BAD_EXE_FORMAT                               193
-#define ERROR_ITERATED_DATA_EXCEEDS_64k                    194
-#define ERROR_INVALID_MINALLOCSIZE                         195
-#define ERROR_DYNLINK_FROM_INVALID_RING                    196
-#define ERROR_IOPL_NOT_ENABLED                             197
-#define ERROR_INVALID_SEGDPL                               198
-#define ERROR_AUTODATASEG_EXCEEDS_64k                      199
-#define ERROR_RING2SEG_MUST_BE_MOVABLE                     200
-#define ERROR_RELOC_CHAIN_XEEDS_SEGLIM                     201
-#define ERROR_INFLOOP_IN_RELOC_CHAIN                       202
-#define ERROR_ENVVAR_NOT_FOUND                             203
-#define ERROR_NO_SIGNAL_SENT                               205
-#define ERROR_FILENAME_EXCED_RANGE                         206
-#define ERROR_RING2_STACK_IN_USE                           207
-#define ERROR_META_EXPANSION_TOO_LONG                      208
-#define ERROR_INVALID_SIGNAL_NUMBER                        209
-#define ERROR_THREAD_1_INACTIVE                            210
-#define ERROR_LOCKED                                       212
-#define ERROR_TOO_MANY_MODULES                             214
-#define ERROR_NESTING_NOT_ALLOWED                          215
-#define ERROR_EXE_MACHINE_TYPE_MISMATCH                    216
-#define ERROR_BAD_PIPE                                     230
-#define ERROR_PIPE_BUSY                                    231
-#define ERROR_NO_DATA                                      232
-#define ERROR_PIPE_NOT_CONNECTED                           233
-#define ERROR_MORE_DATA                                    234
-#define ERROR_VC_DISCONNECTED                              240
-#define ERROR_INVALID_EA_NAME                              254
-#define ERROR_EA_LIST_INCONSISTENT                         255
-#define ERROR_NO_MORE_ITEMS                                259
-#define ERROR_CANNOT_COPY                                  266
-#define ERROR_DIRECTORY                                    267
-#define ERROR_EAS_DIDNT_FIT                                275
-#define ERROR_EA_FILE_CORRUPT                              276
-#define ERROR_EA_TABLE_FULL                                277
-#define ERROR_INVALID_EA_HANDLE                            278
-#define ERROR_EAS_NOT_SUPPORTED                            282
-#define ERROR_NOT_OWNER                                    288
-#define ERROR_TOO_MANY_POSTS                               298
-#define ERROR_PARTIAL_COPY                                 299
-#define ERROR_OPLOCK_NOT_GRANTED                           300
-#define ERROR_INVALID_OPLOCK_PROTOCOL                      301
-#define ERROR_MR_MID_NOT_FOUND                             317
-#define ERROR_INVALID_ADDRESS                              487
-#define ERROR_ARITHMETIC_OVERFLOW                          534
-#define ERROR_PIPE_CONNECTED                               535
-#define ERROR_PIPE_LISTENING                               536
-#define ERROR_EA_ACCESS_DENIED                             994
-#define ERROR_OPERATION_ABORTED                            995
-#define ERROR_IO_INCOMPLETE                                996
-#define ERROR_IO_PENDING                                   997
-#define ERROR_NOACCESS                                     998
-#define ERROR_SWAPERROR                                    999
-#define ERROR_STACK_OVERFLOW                               1001
-#define ERROR_INVALID_MESSAGE                              1002
-#define ERROR_CAN_NOT_COMPLETE                             1003
-#define ERROR_INVALID_FLAGS                                1004
-#define ERROR_UNRECOGNIZED_VOLUME                          1005
-#define ERROR_FILE_INVALID                                 1006
-#define ERROR_FULLSCREEN_MODE                              1007
-#define ERROR_NO_TOKEN                                     1008
-#define ERROR_BADDB                                        1009
-#define ERROR_BADKEY                                       1010
-#define ERROR_CANTOPEN                                     1011
-#define ERROR_CANTREAD                                     1012
-#define ERROR_CANTWRITE                                    1013
-#define ERROR_REGISTRY_RECOVERED                           1014
-#define ERROR_REGISTRY_CORRUPT                             1015
-#define ERROR_REGISTRY_IO_FAILED                           1016
-#define ERROR_NOT_REGISTRY_FILE                            1017
-#define ERROR_KEY_DELETED                                  1018
-#define ERROR_NO_LOG_SPACE                                 1019
-#define ERROR_KEY_HAS_CHILDREN                             1020
-#define ERROR_CHILD_MUST_BE_VOLATILE                       1021
-#define ERROR_NOTIFY_ENUM_DIR                              1022
-#define ERROR_DEPENDENT_SERVICES_RUNNING                   1051
-#define ERROR_INVALID_SERVICE_CONTROL                      1052
-#define ERROR_SERVICE_REQUEST_TIMEOUT                      1053
-#define ERROR_SERVICE_NO_THREAD                            1054
-#define ERROR_SERVICE_DATABASE_LOCKED                      1055
-#define ERROR_SERVICE_ALREADY_RUNNING                      1056
-#define ERROR_INVALID_SERVICE_ACCOUNT                      1057
-#define ERROR_SERVICE_DISABLED                             1058
-#define ERROR_CIRCULAR_DEPENDENCY                          1059
-#define ERROR_SERVICE_DOES_NOT_EXIST                       1060
-#define ERROR_SERVICE_CANNOT_ACCEPT_CTRL                   1061
-#define ERROR_SERVICE_NOT_ACTIVE                           1062
-#define ERROR_FAILED_SERVICE_CONTROLLER_CONNECT            1063
-#define ERROR_EXCEPTION_IN_SERVICE                         1064
-#define ERROR_DATABASE_DOES_NOT_EXIST                      1065
-#define ERROR_SERVICE_SPECIFIC_ERROR                       1066
-#define ERROR_PROCESS_ABORTED                              1067
-#define ERROR_SERVICE_DEPENDENCY_FAIL                      1068
-#define ERROR_SERVICE_LOGON_FAILED                         1069
-#define ERROR_SERVICE_START_HANG                           1070
-#define ERROR_INVALID_SERVICE_LOCK                         1071
-#define ERROR_SERVICE_MARKED_FOR_DELETE                    1072
-#define ERROR_SERVICE_EXISTS                               1073
-#define ERROR_ALREADY_RUNNING_LKG                          1074
-#define ERROR_SERVICE_DEPENDENCY_DELETED                   1075
-#define ERROR_BOOT_ALREADY_ACCEPTED                        1076
-#define ERROR_SERVICE_NEVER_STARTED                        1077
-#define ERROR_DUPLICATE_SERVICE_NAME                       1078
-#define ERROR_DIFFERENT_SERVICE_ACCOUNT                    1079
-#define ERROR_CANNOT_DETECT_DRIVER_FAILURE                 1080
-#define ERROR_CANNOT_DETECT_PROCESS_ABORT                  1081
-#define ERROR_NO_RECOVERY_PROGRAM                          1082
-#define ERROR_SERVICE_NOT_IN_EXE                           1083
-#define ERROR_END_OF_MEDIA                                 1100
-#define ERROR_FILEMARK_DETECTED                            1101
-#define ERROR_BEGINNING_OF_MEDIA                           1102
-#define ERROR_SETMARK_DETECTED                             1103
-#define ERROR_NO_DATA_DETECTED                             1104
-#define ERROR_PARTITION_FAILURE                            1105
-#define ERROR_INVALID_BLOCK_LENGTH                         1106
-#define ERROR_DEVICE_NOT_PARTITIONED                       1107
-#define ERROR_UNABLE_TO_LOCK_MEDIA                         1108
-#define ERROR_UNABLE_TO_UNLOAD_MEDIA                       1109
-#define ERROR_MEDIA_CHANGED                                1110
-#define ERROR_BUS_RESET                                    1111
-#define ERROR_NO_MEDIA_IN_DRIVE                            1112
-#define ERROR_NO_UNICODE_TRANSLATION                       1113
-#define ERROR_DLL_INIT_FAILED                              1114
-#define ERROR_SHUTDOWN_IN_PROGRESS                         1115
-#define ERROR_NO_SHUTDOWN_IN_PROGRESS                      1116
-#define ERROR_IO_DEVICE                                    1117
-#define ERROR_SERIAL_NO_DEVICE                             1118
-#define ERROR_IRQ_BUSY                                     1119
-#define ERROR_MORE_WRITES                                  1120
-#define ERROR_COUNTER_TIMEOUT                              1121
-#define ERROR_FLOPPY_ID_MARK_NOT_FOUND                     1122
-#define ERROR_FLOPPY_WRONG_CYLINDER                        1123
-#define ERROR_FLOPPY_UNKNOWN_ERROR                         1124
-#define ERROR_FLOPPY_BAD_REGISTERS                         1125
-#define ERROR_DISK_RECALIBRATE_FAILED                      1126
-#define ERROR_DISK_OPERATION_FAILED                        1127
-#define ERROR_DISK_RESET_FAILED                            1128
-#define ERROR_EOM_OVERFLOW                                 1129
-#define ERROR_NOT_ENOUGH_SERVER_MEMORY                     1130
-#define ERROR_POSSIBLE_DEADLOCK                            1131
-#define ERROR_MAPPED_ALIGNMENT                             1132
-#define ERROR_SET_POWER_STATE_VETOED                       1140
-#define ERROR_SET_POWER_STATE_FAILED                       1141
-#define ERROR_TOO_MANY_LINKS                               1142
-#define ERROR_OLD_WIN_VERSION                              1150
-#define ERROR_APP_WRONG_OS                                 1151
-#define ERROR_SINGLE_INSTANCE_APP                          1152
-#define ERROR_RMODE_APP                                    1153
-#define ERROR_INVALID_DLL                                  1154
-#define ERROR_NO_ASSOCIATION                               1155
-#define ERROR_DDE_FAIL                                     1156
-#define ERROR_DLL_NOT_FOUND                                1157
-#define ERROR_NO_MORE_USER_HANDLES                         1158
-#define ERROR_MESSAGE_SYNC_ONLY                            1159
-#define ERROR_SOURCE_ELEMENT_EMPTY                         1160
-#define ERROR_DESTINATION_ELEMENT_FULL                     1161
-#define ERROR_ILLEGAL_ELEMENT_ADDRESS                      1162
-#define ERROR_MAGAZINE_NOT_PRESENT                         1163
-#define ERROR_DEVICE_REINITIALIZATION_NEEDED               1164
-#define ERROR_DEVICE_REQUIRES_CLEANING                     1165
-#define ERROR_DEVICE_DOOR_OPEN                             1166
-#define ERROR_DEVICE_NOT_CONNECTED                         1167
-#define ERROR_NOT_FOUND                                    1168
-#define ERROR_NO_MATCH                                     1169
-#define ERROR_SET_NOT_FOUND                                1170
-#define ERROR_POINT_NOT_FOUND                              1171
-#define ERROR_NO_TRACKING_SERVICE                          1172
-#define ERROR_NO_VOLUME_ID                                 1173
-#define ERROR_UNABLE_TO_REMOVE_REPLACED                    1175
-#define ERROR_UNABLE_TO_MOVE_REPLACEMENT                   1176
-#define ERROR_UNABLE_TO_MOVE_REPLACEMENT_2                 1177
-#define ERROR_JOURNAL_DELETE_IN_PROGRESS                   1178
-#define ERROR_JOURNAL_NOT_ACTIVE                           1179
-#define ERROR_POTENTIAL_FILE_FOUND                         1180
-#define ERROR_JOURNAL_ENTRY_DELETED                        1181
-#define ERROR_BAD_DEVICE                                   1200
-#define ERROR_CONNECTION_UNAVAIL                           1201
-#define ERROR_DEVICE_ALREADY_REMEMBERED                    1202
-#define ERROR_NO_NET_OR_BAD_PATH                           1203
-#define ERROR_BAD_PROVIDER                                 1204
-#define ERROR_CANNOT_OPEN_PROFILE                          1205
-#define ERROR_BAD_PROFILE                                  1206
-#define ERROR_NOT_CONTAINER                                1207
-#define ERROR_EXTENDED_ERROR                               1208
-#define ERROR_INVALID_GROUPNAME                            1209
-#define ERROR_INVALID_COMPUTERNAME                         1210
-#define ERROR_INVALID_EVENTNAME                            1211
-#define ERROR_INVALID_DOMAINNAME                           1212
-#define ERROR_INVALID_SERVICENAME                          1213
-#define ERROR_INVALID_NETNAME                              1214
-#define ERROR_INVALID_SHARENAME                            1215
-#define ERROR_INVALID_PASSWORDNAME                         1216
-#define ERROR_INVALID_MESSAGENAME                          1217
-#define ERROR_INVALID_MESSAGEDEST                          1218
-#define ERROR_SESSION_CREDENTIAL_CONFLICT                  1219
-#define ERROR_REMOTE_SESSION_LIMIT_EXCEEDED                1220
-#define ERROR_DUP_DOMAINNAME                               1221
-#define ERROR_NO_NETWORK                                   1222
-#define ERROR_CANCELLED                                    1223
-#define ERROR_USER_MAPPED_FILE                             1224
-#define ERROR_CONNECTION_REFUSED                           1225
-#define ERROR_GRACEFUL_DISCONNECT                          1226
-#define ERROR_ADDRESS_ALREADY_ASSOCIATED                   1227
-#define ERROR_ADDRESS_NOT_ASSOCIATED                       1228
-#define ERROR_CONNECTION_INVALID                           1229
-#define ERROR_CONNECTION_ACTIVE                            1230
-#define ERROR_NETWORK_UNREACHABLE                          1231
-#define ERROR_HOST_UNREACHABLE                             1232
-#define ERROR_PROTOCOL_UNREACHABLE                         1233
-#define ERROR_PORT_UNREACHABLE                             1234
-#define ERROR_REQUEST_ABORTED                              1235
-#define ERROR_CONNECTION_ABORTED                           1236
-#define ERROR_RETRY                                        1237
-#define ERROR_CONNECTION_COUNT_LIMIT                       1238
-#define ERROR_LOGIN_TIME_RESTRICTION                       1239
-#define ERROR_LOGIN_WKSTA_RESTRICTION                      1240
-#define ERROR_INCORRECT_ADDRESS                            1241
-#define ERROR_ALREADY_REGISTERED                           1242
-#define ERROR_SERVICE_NOT_FOUND                            1243
-#define ERROR_NOT_AUTHENTICATED                            1244
-#define ERROR_NOT_LOGGED_ON                                1245
-#define ERROR_CONTINUE                                     1246
-#define ERROR_ALREADY_INITIALIZED                          1247
-#define ERROR_NO_MORE_DEVICES                              1248
-#define ERROR_NO_SUCH_SITE                                 1249
-#define ERROR_DOMAIN_CONTROLLER_EXISTS                     1250
-#define ERROR_ONLY_IF_CONNECTED                            1251
-#define ERROR_OVERRIDE_NOCHANGES                           1252
-#define ERROR_BAD_USER_PROFILE                             1253
-#define ERROR_NOT_SUPPORTED_ON_SBS                         1254
-#define ERROR_NOT_ALL_ASSIGNED                             1300
-#define ERROR_SOME_NOT_MAPPED                              1301
-#define ERROR_NO_QUOTAS_FOR_ACCOUNT                        1302
-#define ERROR_LOCAL_USER_SESSION_KEY                       1303
-#define ERROR_NULL_LM_PASSWORD                             1304
-#define ERROR_UNKNOWN_REVISION                             1305
-#define ERROR_REVISION_MISMATCH                            1306
-#define ERROR_INVALID_OWNER                                1307
-#define ERROR_INVALID_PRIMARY_GROUP                        1308
-#define ERROR_NO_IMPERSONATION_TOKEN                       1309
-#define ERROR_CANT_DISABLE_MANDATORY                       1310
-#define ERROR_NO_LOGON_SERVERS                             1311
-#define ERROR_NO_SUCH_LOGON_SESSION                        1312
-#define ERROR_NO_SUCH_PRIVILEGE                            1313
-#define ERROR_PRIVILEGE_NOT_HELD                           1314
-#define ERROR_INVALID_ACCOUNT_NAME                         1315
-#define ERROR_USER_EXISTS                                  1316
-#define ERROR_NO_SUCH_USER                                 1317
-#define ERROR_GROUP_EXISTS                                 1318
-#define ERROR_NO_SUCH_GROUP                                1319
-#define ERROR_MEMBER_IN_GROUP                              1320
-#define ERROR_MEMBER_NOT_IN_GROUP                          1321
-#define ERROR_LAST_ADMIN                                   1322
-#define ERROR_WRONG_PASSWORD                               1323
-#define ERROR_ILL_FORMED_PASSWORD                          1324
-#define ERROR_PASSWORD_RESTRICTION                         1325
-#define ERROR_LOGON_FAILURE                                1326
-#define ERROR_ACCOUNT_RESTRICTION                          1327
-#define ERROR_INVALID_LOGON_HOURS                          1328
-#define ERROR_INVALID_WORKSTATION                          1329
-#define ERROR_PASSWORD_EXPIRED                             1330
-#define ERROR_ACCOUNT_DISABLED                             1331
-#define ERROR_NONE_MAPPED                                  1332
-#define ERROR_TOO_MANY_LUIDS_REQUESTED                     1333
-#define ERROR_LUIDS_EXHAUSTED                              1334
-#define ERROR_INVALID_SUB_AUTHORITY                        1335
-#define ERROR_INVALID_ACL                                  1336
-#define ERROR_INVALID_SID                                  1337
-#define ERROR_INVALID_SECURITY_DESCR                       1338
-#define ERROR_BAD_INHERITANCE_ACL                          1340
-#define ERROR_SERVER_DISABLED                              1341
-#define ERROR_SERVER_NOT_DISABLED                          1342
-#define ERROR_INVALID_ID_AUTHORITY                         1343
-#define ERROR_ALLOTTED_SPACE_EXCEEDED                      1344
-#define ERROR_INVALID_GROUP_ATTRIBUTES                     1345
-#define ERROR_BAD_IMPERSONATION_LEVEL                      1346
-#define ERROR_CANT_OPEN_ANONYMOUS                          1347
-#define ERROR_BAD_VALIDATION_CLASS                         1348
-#define ERROR_BAD_TOKEN_TYPE                               1349
-#define ERROR_NO_SECURITY_ON_OBJECT                        1350
-#define ERROR_CANT_ACCESS_DOMAIN_INFO                      1351
-#define ERROR_INVALID_SERVER_STATE                         1352
-#define ERROR_INVALID_DOMAIN_STATE                         1353
-#define ERROR_INVALID_DOMAIN_ROLE                          1354
-#define ERROR_NO_SUCH_DOMAIN                               1355
-#define ERROR_DOMAIN_EXISTS                                1356
-#define ERROR_DOMAIN_LIMIT_EXCEEDED                        1357
-#define ERROR_INTERNAL_DB_CORRUPTION                       1358
-#define ERROR_INTERNAL_ERROR                               1359
-#define ERROR_GENERIC_NOT_MAPPED                           1360
-#define ERROR_BAD_DESCRIPTOR_FORMAT                        1361
-#define ERROR_NOT_LOGON_PROCESS                            1362
-#define ERROR_LOGON_SESSION_EXISTS                         1363
-#define ERROR_NO_SUCH_PACKAGE                              1364
-#define ERROR_BAD_LOGON_SESSION_STATE                      1365
-#define ERROR_LOGON_SESSION_COLLISION                      1366
-#define ERROR_INVALID_LOGON_TYPE                           1367
-#define ERROR_CANNOT_IMPERSONATE                           1368
-#define ERROR_RXACT_INVALID_STATE                          1369
-#define ERROR_RXACT_COMMIT_FAILURE                         1370
-#define ERROR_SPECIAL_ACCOUNT                              1371
-#define ERROR_SPECIAL_GROUP                                1372
-#define ERROR_SPECIAL_USER                                 1373
-#define ERROR_MEMBERS_PRIMARY_GROUP                        1374
-#define ERROR_TOKEN_ALREADY_IN_USE                         1375
-#define ERROR_NO_SUCH_ALIAS                                1376
-#define ERROR_MEMBER_NOT_IN_ALIAS                          1377
-#define ERROR_MEMBER_IN_ALIAS                              1378
-#define ERROR_ALIAS_EXISTS                                 1379
-#define ERROR_LOGON_NOT_GRANTED                            1380
-#define ERROR_TOO_MANY_SECRETS                             1381
-#define ERROR_SECRET_TOO_LONG                              1382
-#define ERROR_INTERNAL_DB_ERROR                            1383
-#define ERROR_TOO_MANY_CONTEXT_IDS                         1384
-#define ERROR_LOGON_TYPE_NOT_GRANTED                       1385
-#define ERROR_NT_CROSS_ENCRYPTION_REQUIRED                 1386
-#define ERROR_NO_SUCH_MEMBER                               1387
-#define ERROR_INVALID_MEMBER                               1388
-#define ERROR_TOO_MANY_SIDS                                1389
-#define ERROR_LM_CROSS_ENCRYPTION_REQUIRED                 1390
-#define ERROR_NO_INHERITANCE                               1391
-#define ERROR_FILE_CORRUPT                                 1392
-#define ERROR_DISK_CORRUPT                                 1393
-#define ERROR_NO_USER_SESSION_KEY                          1394
-#define ERROR_LICENSE_QUOTA_EXCEEDED                       1395
-#define ERROR_WRONG_TARGET_NAME                            1396
-#define ERROR_MUTUAL_AUTH_FAILED                           1397
-#define ERROR_TIME_SKEW                                    1398
-#define ERROR_INVALID_WINDOW_HANDLE                        1400
-#define ERROR_INVALID_MENU_HANDLE                          1401
-#define ERROR_INVALID_CURSOR_HANDLE                        1402
-#define ERROR_INVALID_ACCEL_HANDLE                         1403
-#define ERROR_INVALID_HOOK_HANDLE                          1404
-#define ERROR_INVALID_DWP_HANDLE                           1405
-#define ERROR_TLW_WITH_WSCHILD                             1406
-#define ERROR_CANNOT_FIND_WND_CLASS                        1407
-#define ERROR_WINDOW_OF_OTHER_THREAD                       1408
-#define ERROR_HOTKEY_ALREADY_REGISTERED                    1409
-#define ERROR_CLASS_ALREADY_EXISTS                         1410
-#define ERROR_CLASS_DOES_NOT_EXIST                         1411
-#define ERROR_CLASS_HAS_WINDOWS                            1412
-#define ERROR_INVALID_INDEX                                1413
-#define ERROR_INVALID_ICON_HANDLE                          1414
-#define ERROR_PRIVATE_DIALOG_INDEX                         1415
-#define ERROR_LISTBOX_ID_NOT_FOUND                         1416
-#define ERROR_NO_WILDCARD_CHARACTERS                       1417
-#define ERROR_CLIPBOARD_NOT_OPEN                           1418
-#define ERROR_HOTKEY_NOT_REGISTERED                        1419
-#define ERROR_WINDOW_NOT_DIALOG                            1420
-#define ERROR_CONTROL_ID_NOT_FOUND                         1421
-#define ERROR_INVALID_COMBOBOX_MESSAGE                     1422
-#define ERROR_WINDOW_NOT_COMBOBOX                          1423
-#define ERROR_INVALID_EDIT_HEIGHT                          1424
-#define ERROR_DC_NOT_FOUND                                 1425
-#define ERROR_INVALID_HOOK_FILTER                          1426
-#define ERROR_INVALID_FILTER_PROC                          1427
-#define ERROR_HOOK_NEEDS_HMOD                              1428
-#define ERROR_GLOBAL_ONLY_HOOK                             1429
-#define ERROR_JOURNAL_HOOK_SET                             1430
-#define ERROR_HOOK_NOT_INSTALLED                           1431
-#define ERROR_INVALID_LB_MESSAGE                           1432
-#define ERROR_SETCOUNT_ON_BAD_LB                           1433
-#define ERROR_LB_WITHOUT_TABSTOPS                          1434
-#define ERROR_DESTROY_OBJECT_OF_OTHER_THREAD               1435
-#define ERROR_CHILD_WINDOW_MENU                            1436
-#define ERROR_NO_SYSTEM_MENU                               1437
-#define ERROR_INVALID_MSGBOX_STYLE                         1438
-#define ERROR_INVALID_SPI_VALUE                            1439
-#define ERROR_SCREEN_ALREADY_LOCKED                        1440
-#define ERROR_HWNDS_HAVE_DIFF_PARENT                       1441
-#define ERROR_NOT_CHILD_WINDOW                             1442
-#define ERROR_INVALID_GW_COMMAND                           1443
-#define ERROR_INVALID_THREAD_ID                            1444
-#define ERROR_NON_MDICHILD_WINDOW                          1445
-#define ERROR_POPUP_ALREADY_ACTIVE                         1446
-#define ERROR_NO_SCROLLBARS                                1447
-#define ERROR_INVALID_SCROLLBAR_RANGE                      1448
-#define ERROR_INVALID_SHOWWIN_COMMAND                      1449
-#define ERROR_NO_SYSTEM_RESOURCES                          1450
-#define ERROR_NONPAGED_SYSTEM_RESOURCES                    1451
-#define ERROR_PAGED_SYSTEM_RESOURCES                       1452
-#define ERROR_WORKING_SET_QUOTA                            1453
-#define ERROR_PAGEFILE_QUOTA                               1454
-#define ERROR_COMMITMENT_LIMIT                             1455
-#define ERROR_MENU_ITEM_NOT_FOUND                          1456
-#define ERROR_INVALID_KEYBOARD_HANDLE                      1457
-#define ERROR_HOOK_TYPE_NOT_ALLOWED                        1458
-#define ERROR_REQUIRES_INTERACTIVE_WINDOWSTATION           1459
-#define ERROR_TIMEOUT                                      1460
-#define ERROR_INVALID_MONITOR_HANDLE                       1461
-#define ERROR_EVENTLOG_FILE_CORRUPT                        1500
-#define ERROR_EVENTLOG_CANT_START                          1501
-#define ERROR_LOG_FILE_FULL                                1502
-#define ERROR_EVENTLOG_FILE_CHANGED                        1503
-#define ERROR_INSTALL_SERVICE_FAILURE                      1601
-#define ERROR_INSTALL_USEREXIT                             1602
-#define ERROR_INSTALL_FAILURE                              1603
-#define ERROR_INSTALL_SUSPEND                              1604
-#define ERROR_UNKNOWN_PRODUCT                              1605
-#define ERROR_UNKNOWN_FEATURE                              1606
-#define ERROR_UNKNOWN_COMPONENT                            1607
-#define ERROR_UNKNOWN_PROPERTY                             1608
-#define ERROR_INVALID_HANDLE_STATE                         1609
-#define ERROR_BAD_CONFIGURATION                            1610
-#define ERROR_INDEX_ABSENT                                 1611
-#define ERROR_INSTALL_SOURCE_ABSENT                        1612
-#define ERROR_INSTALL_PACKAGE_VERSION                      1613
-#define ERROR_PRODUCT_UNINSTALLED                          1614
-#define ERROR_BAD_QUERY_SYNTAX                             1615
-#define ERROR_INVALID_FIELD                                1616
-#define ERROR_DEVICE_REMOVED                               1617
-#define ERROR_INSTALL_ALREADY_RUNNING                      1618
-#define ERROR_INSTALL_PACKAGE_OPEN_FAILED                  1619
-#define ERROR_INSTALL_PACKAGE_INVALID                      1620
-#define ERROR_INSTALL_UI_FAILURE                           1621
-#define ERROR_INSTALL_LOG_FAILURE                          1622
-#define ERROR_INSTALL_LANGUAGE_UNSUPPORTED                 1623
-#define ERROR_INSTALL_TRANSFORM_FAILURE                    1624
-#define ERROR_INSTALL_PACKAGE_REJECTED                     1625
-#define ERROR_FUNCTION_NOT_CALLED                          1626
-#define ERROR_FUNCTION_FAILED                              1627
-#define ERROR_INVALID_TABLE                                1628
-#define ERROR_DATATYPE_MISMATCH                            1629
-#define ERROR_UNSUPPORTED_TYPE                             1630
-#define ERROR_CREATE_FAILED                                1631
-#define ERROR_INSTALL_TEMP_UNWRITABLE                      1632
-#define ERROR_INSTALL_PLATFORM_UNSUPPORTED                 1633
-#define ERROR_INSTALL_NOTUSED                              1634
-#define ERROR_PATCH_PACKAGE_OPEN_FAILED                    1635
-#define ERROR_PATCH_PACKAGE_INVALID                        1636
-#define ERROR_PATCH_PACKAGE_UNSUPPORTED                    1637
-#define ERROR_PRODUCT_VERSION                              1638
-#define ERROR_INVALID_COMMAND_LINE                         1639
-#define ERROR_INSTALL_REMOTE_DISALLOWED                    1640
-#define ERROR_SUCCESS_REBOOT_INITIATED                     1641
-#define RPC_S_INVALID_STRING_BINDING                       1700
-#define RPC_S_WRONG_KIND_OF_BINDING                        1701
-#define RPC_S_INVALID_BINDING                              1702
-#define RPC_S_PROTSEQ_NOT_SUPPORTED                        1703
-#define RPC_S_INVALID_RPC_PROTSEQ                          1704
-#define RPC_S_INVALID_STRING_UUID                          1705
-#define RPC_S_INVALID_ENDPOINT_FORMAT                      1706
-#define RPC_S_INVALID_NET_ADDR                             1707
-#define RPC_S_NO_ENDPOINT_FOUND                            1708
-#define RPC_S_INVALID_TIMEOUT                              1709
-#define RPC_S_OBJECT_NOT_FOUND                             1710
-#define RPC_S_ALREADY_REGISTERED                           1711
-#define RPC_S_TYPE_ALREADY_REGISTERED                      1712
-#define RPC_S_ALREADY_LISTENING                            1713
-#define RPC_S_NO_PROTSEQS_REGISTERED                       1714
-#define RPC_S_NOT_LISTENING                                1715
-#define RPC_S_UNKNOWN_MGR_TYPE                             1716
-#define RPC_S_UNKNOWN_IF                                   1717
-#define RPC_S_NO_BINDINGS                                  1718
-#define RPC_S_NO_PROTSEQS                                  1719
-#define RPC_S_CANT_CREATE_ENDPOINT                         1720
-#define RPC_S_OUT_OF_RESOURCES                             1721
-#define RPC_S_SERVER_UNAVAILABLE                           1722
-#define RPC_S_SERVER_TOO_BUSY                              1723
-#define RPC_S_INVALID_NETWORK_OPTIONS                      1724
-#define RPC_S_NO_CALL_ACTIVE                               1725
-#define RPC_S_CALL_FAILED                                  1726
-#define RPC_S_CALL_FAILED_DNE                              1727
-#define RPC_S_PROTOCOL_ERROR                               1728
-#define RPC_S_UNSUPPORTED_TRANS_SYN                        1730
-#define RPC_S_UNSUPPORTED_TYPE                             1732
-#define RPC_S_INVALID_TAG                                  1733
-#define RPC_S_INVALID_BOUND                                1734
-#define RPC_S_NO_ENTRY_NAME                                1735
-#define RPC_S_INVALID_NAME_SYNTAX                          1736
-#define RPC_S_UNSUPPORTED_NAME_SYNTAX                      1737
-#define RPC_S_UUID_NO_ADDRESS                              1739
-#define RPC_S_DUPLICATE_ENDPOINT                           1740
-#define RPC_S_UNKNOWN_AUTHN_TYPE                           1741
-#define RPC_S_MAX_CALLS_TOO_SMALL                          1742
-#define RPC_S_STRING_TOO_LONG                              1743
-#define RPC_S_PROTSEQ_NOT_FOUND                            1744
-#define RPC_S_PROCNUM_OUT_OF_RANGE                         1745
-#define RPC_S_BINDING_HAS_NO_AUTH                          1746
-#define RPC_S_UNKNOWN_AUTHN_SERVICE                        1747
-#define RPC_S_UNKNOWN_AUTHN_LEVEL                          1748
-#define RPC_S_INVALID_AUTH_IDENTITY                        1749
-#define RPC_S_UNKNOWN_AUTHZ_SERVICE                        1750
-#define EPT_S_INVALID_ENTRY                                1751
-#define EPT_S_CANT_PERFORM_OP                              1752
-#define EPT_S_NOT_REGISTERED                               1753
-#define RPC_S_NOTHING_TO_EXPORT                            1754
-#define RPC_S_INCOMPLETE_NAME                              1755
-#define RPC_S_INVALID_VERS_OPTION                          1756
-#define RPC_S_NO_MORE_MEMBERS                              1757
-#define RPC_S_NOT_ALL_OBJS_UNEXPORTED                      1758
-#define RPC_S_INTERFACE_NOT_FOUND                          1759
-#define RPC_S_ENTRY_ALREADY_EXISTS                         1760
-#define RPC_S_ENTRY_NOT_FOUND                              1761
-#define RPC_S_NAME_SERVICE_UNAVAILABLE                     1762
-#define RPC_S_INVALID_NAF_ID                               1763
-#define RPC_S_CANNOT_SUPPORT                               1764
-#define RPC_S_NO_CONTEXT_AVAILABLE                         1765
-#define RPC_S_INTERNAL_ERROR                               1766
-#define RPC_S_ZERO_DIVIDE                                  1767
-#define RPC_S_ADDRESS_ERROR                                1768
-#define RPC_S_FP_DIV_ZERO                                  1769
-#define RPC_S_FP_UNDERFLOW                                 1770
-#define RPC_S_FP_OVERFLOW                                  1771
-#define RPC_X_NO_MORE_ENTRIES                              1772
-#define RPC_X_SS_CHAR_TRANS_OPEN_FAIL                      1773
-#define RPC_X_SS_CHAR_TRANS_SHORT_FILE                     1774
-#define RPC_X_SS_IN_NULL_CONTEXT                           1775
-#define RPC_X_SS_CONTEXT_DAMAGED                           1777
-#define RPC_X_SS_HANDLES_MISMATCH                          1778
-#define RPC_X_SS_CANNOT_GET_CALL_HANDLE                    1779
-#define RPC_X_NULL_REF_POINTER                             1780
-#define RPC_X_ENUM_VALUE_OUT_OF_RANGE                      1781
-#define RPC_X_BYTE_COUNT_TOO_SMALL                         1782
-#define RPC_X_BAD_STUB_DATA                                1783
-#define ERROR_INVALID_USER_BUFFER                          1784
-#define ERROR_UNRECOGNIZED_MEDIA                           1785
-#define ERROR_NO_TRUST_LSA_SECRET                          1786
-#define ERROR_NO_TRUST_SAM_ACCOUNT                         1787
-#define ERROR_TRUSTED_DOMAIN_FAILURE                       1788
-#define ERROR_TRUSTED_RELATIONSHIP_FAILURE                 1789
-#define ERROR_TRUST_FAILURE                                1790
-#define RPC_S_CALL_IN_PROGRESS                             1791
-#define ERROR_NETLOGON_NOT_STARTED                         1792
-#define ERROR_ACCOUNT_EXPIRED                              1793
-#define ERROR_REDIRECTOR_HAS_OPEN_HANDLES                  1794
-#define ERROR_PRINTER_DRIVER_ALREADY_INSTALLED             1795
-#define ERROR_UNKNOWN_PORT                                 1796
-#define ERROR_UNKNOWN_PRINTER_DRIVER                       1797
-#define ERROR_UNKNOWN_PRINTPROCESSOR                       1798
-#define ERROR_INVALID_SEPARATOR_FILE                       1799
-#define ERROR_INVALID_PRIORITY                             1800
-#define ERROR_INVALID_PRINTER_NAME                         1801
-#define ERROR_PRINTER_ALREADY_EXISTS                       1802
-#define ERROR_INVALID_PRINTER_COMMAND                      1803
-#define ERROR_INVALID_DATATYPE                             1804
-#define ERROR_INVALID_ENVIRONMENT                          1805
-#define RPC_S_NO_MORE_BINDINGS                             1806
-#define ERROR_NOLOGON_INTERDOMAIN_TRUST_ACCOUNT            1807
-#define ERROR_NOLOGON_WORKSTATION_TRUST_ACCOUNT            1808
-#define ERROR_NOLOGON_SERVER_TRUST_ACCOUNT                 1809
-#define ERROR_DOMAIN_TRUST_INCONSISTENT                    1810
-#define ERROR_SERVER_HAS_OPEN_HANDLES                      1811
-#define ERROR_RESOURCE_DATA_NOT_FOUND                      1812
-#define ERROR_RESOURCE_TYPE_NOT_FOUND                      1813
-#define ERROR_RESOURCE_NAME_NOT_FOUND                      1814
-#define ERROR_RESOURCE_LANG_NOT_FOUND                      1815
-#define ERROR_NOT_ENOUGH_QUOTA                             1816
-#define RPC_S_NO_INTERFACES                                1817
-#define RPC_S_CALL_CANCELLED                               1818
-#define RPC_S_BINDING_INCOMPLETE                           1819
-#define RPC_S_COMM_FAILURE                                 1820
-#define RPC_S_UNSUPPORTED_AUTHN_LEVEL                      1821
-#define RPC_S_NO_PRINC_NAME                                1822
-#define RPC_S_NOT_RPC_ERROR                                1823
-#define RPC_S_UUID_LOCAL_ONLY                              1824
-#define RPC_S_SEC_PKG_ERROR                                1825
-#define RPC_S_NOT_CANCELLED                                1826
-#define RPC_X_INVALID_ES_ACTION                            1827
-#define RPC_X_WRONG_ES_VERSION                             1828
-#define RPC_X_WRONG_STUB_VERSION                           1829
-#define RPC_X_INVALID_PIPE_OBJECT                          1830
-#define RPC_X_WRONG_PIPE_ORDER                             1831
-#define RPC_X_WRONG_PIPE_VERSION                           1832
-#define RPC_S_GROUP_MEMBER_NOT_FOUND                       1898
-#define EPT_S_CANT_CREATE                                  1899
-#define RPC_S_INVALID_OBJECT                               1900
-#define ERROR_INVALID_TIME                                 1901
-#define ERROR_INVALID_FORM_NAME                            1902
-#define ERROR_INVALID_FORM_SIZE                            1903
-#define ERROR_ALREADY_WAITING                              1904
-#define ERROR_PRINTER_DELETED                              1905
-#define ERROR_INVALID_PRINTER_STATE                        1906
-#define ERROR_PASSWORD_MUST_CHANGE                         1907
-#define ERROR_DOMAIN_CONTROLLER_NOT_FOUND                  1908
-#define ERROR_ACCOUNT_LOCKED_OUT                           1909
-#define OR_INVALID_OXID                                    1910
-#define OR_INVALID_OID                                     1911
-#define OR_INVALID_SET                                     1912
-#define RPC_S_SEND_INCOMPLETE                              1913
-#define RPC_S_INVALID_ASYNC_HANDLE                         1914
-#define RPC_S_INVALID_ASYNC_CALL                           1915
-#define RPC_X_PIPE_CLOSED                                  1916
-#define RPC_X_PIPE_DISCIPLINE_ERROR                        1917
-#define RPC_X_PIPE_EMPTY                                   1918
-#define ERROR_NO_SITENAME                                  1919
-#define ERROR_CANT_ACCESS_FILE                             1920
-#define ERROR_CANT_RESOLVE_FILENAME                        1921
-#define RPC_S_ENTRY_TYPE_MISMATCH                          1922
-#define RPC_S_NOT_ALL_OBJS_EXPORTED                        1923
-#define RPC_S_INTERFACE_NOT_EXPORTED                       1924
-#define RPC_S_PROFILE_NOT_ADDED                            1925
-#define RPC_S_PRF_ELT_NOT_ADDED                            1926
-#define RPC_S_PRF_ELT_NOT_REMOVED                          1927
-#define RPC_S_GRP_ELT_NOT_ADDED                            1928
-#define RPC_S_GRP_ELT_NOT_REMOVED                          1929
-#define ERROR_INVALID_PIXEL_FORMAT                         2000
-#define ERROR_BAD_DRIVER                                   2001
-#define ERROR_INVALID_WINDOW_STYLE                         2002
-#define ERROR_METAFILE_NOT_SUPPORTED                       2003
-#define ERROR_TRANSFORM_NOT_SUPPORTED                      2004
-#define ERROR_CLIPPING_NOT_SUPPORTED                       2005
-#define ERROR_INVALID_CMM                                  2010
-#define ERROR_INVALID_PROFILE                              2011
-#define ERROR_TAG_NOT_FOUND                                2012
-#define ERROR_TAG_NOT_PRESENT                              2013
-#define ERROR_DUPLICATE_TAG                                2014
-#define ERROR_PROFILE_NOT_ASSOCIATED_WITH_DEVICE           2015
-#define ERROR_PROFILE_NOT_FOUND                            2016
-#define ERROR_INVALID_COLORSPACE                           2017
-#define ERROR_ICM_NOT_ENABLED                              2018
-#define ERROR_DELETING_ICM_XFORM                           2019
-#define ERROR_INVALID_TRANSFORM                            2020
-#define ERROR_COLORSPACE_MISMATCH                          2021
-#define ERROR_INVALID_COLORINDEX                           2022
-#define ERROR_CONNECTED_OTHER_PASSWORD                     2108
-#define ERROR_BAD_USERNAME                                 2202
-#define ERROR_NOT_CONNECTED                                2250
-#define ERROR_OPEN_FILES                                   2401
-#define ERROR_ACTIVE_CONNECTIONS                           2402
-#define ERROR_DEVICE_IN_USE                                2404
-#define ERROR_UNKNOWN_PRINT_MONITOR                        3000
-#define ERROR_PRINTER_DRIVER_IN_USE                        3001
-#define ERROR_SPOOL_FILE_NOT_FOUND                         3002
-#define ERROR_SPL_NO_STARTDOC                              3003
-#define ERROR_SPL_NO_ADDJOB                                3004
-#define ERROR_PRINT_PROCESSOR_ALREADY_INSTALLED            3005
-#define ERROR_PRINT_MONITOR_ALREADY_INSTALLED              3006
-#define ERROR_INVALID_PRINT_MONITOR                        3007
-#define ERROR_PRINT_MONITOR_IN_USE                         3008
-#define ERROR_PRINTER_HAS_JOBS_QUEUED                      3009
-#define ERROR_SUCCESS_REBOOT_REQUIRED                      3010
-#define ERROR_SUCCESS_RESTART_REQUIRED                     3011
-#define ERROR_PRINTER_NOT_FOUND                            3012
-#define ERROR_WINS_INTERNAL                                4000
-#define ERROR_CAN_NOT_DEL_LOCAL_WINS                       4001
-#define ERROR_STATIC_INIT                                  4002
-#define ERROR_INC_BACKUP                                   4003
-#define ERROR_FULL_BACKUP                                  4004
-#define ERROR_REC_NON_EXISTENT                             4005
-#define ERROR_RPL_NOT_ALLOWED                              4006
-#define ERROR_DHCP_ADDRESS_CONFLICT                        4100
-#define ERROR_WMI_GUID_NOT_FOUND                           4200
-#define ERROR_WMI_INSTANCE_NOT_FOUND                       4201
-#define ERROR_WMI_ITEMID_NOT_FOUND                         4202
-#define ERROR_WMI_TRY_AGAIN                                4203
-#define ERROR_WMI_DP_NOT_FOUND                             4204
-#define ERROR_WMI_UNRESOLVED_INSTANCE_REF                  4205
-#define ERROR_WMI_ALREADY_ENABLED                          4206
-#define ERROR_WMI_GUID_DISCONNECTED                        4207
-#define ERROR_WMI_SERVER_UNAVAILABLE                       4208
-#define ERROR_WMI_DP_FAILED                                4209
-#define ERROR_WMI_INVALID_MOF                              4210
-#define ERROR_WMI_INVALID_REGINFO                          4211
-#define ERROR_WMI_ALREADY_DISABLED                         4212
-#define ERROR_WMI_READ_ONLY                                4213
-#define ERROR_WMI_SET_FAILURE                              4214
-#define ERROR_INVALID_MEDIA                                4300
-#define ERROR_INVALID_LIBRARY                              4301
-#define ERROR_INVALID_MEDIA_POOL                           4302
-#define ERROR_DRIVE_MEDIA_MISMATCH                         4303
-#define ERROR_MEDIA_OFFLINE                                4304
-#define ERROR_LIBRARY_OFFLINE                              4305
-#define ERROR_EMPTY                                        4306
-#define ERROR_NOT_EMPTY                                    4307
-#define ERROR_MEDIA_UNAVAILABLE                            4308
-#define ERROR_RESOURCE_DISABLED                            4309
-#define ERROR_INVALID_CLEANER                              4310
-#define ERROR_UNABLE_TO_CLEAN                              4311
-#define ERROR_OBJECT_NOT_FOUND                             4312
-#define ERROR_DATABASE_FAILURE                             4313
-#define ERROR_DATABASE_FULL                                4314
-#define ERROR_MEDIA_INCOMPATIBLE                           4315
-#define ERROR_RESOURCE_NOT_PRESENT                         4316
-#define ERROR_INVALID_OPERATION                            4317
-#define ERROR_MEDIA_NOT_AVAILABLE                          4318
-#define ERROR_DEVICE_NOT_AVAILABLE                         4319
-#define ERROR_REQUEST_REFUSED                              4320
-#define ERROR_INVALID_DRIVE_OBJECT                         4321
-#define ERROR_LIBRARY_FULL                                 4322
-#define ERROR_MEDIUM_NOT_ACCESSIBLE                        4323
-#define ERROR_UNABLE_TO_LOAD_MEDIUM                        4324
-#define ERROR_UNABLE_TO_INVENTORY_DRIVE                    4325
-#define ERROR_UNABLE_TO_INVENTORY_SLOT                     4326
-#define ERROR_UNABLE_TO_INVENTORY_TRANSPORT                4327
-#define ERROR_TRANSPORT_FULL                               4328
-#define ERROR_CONTROLLING_IEPORT                           4329
-#define ERROR_UNABLE_TO_EJECT_MOUNTED_MEDIA                4330
-#define ERROR_CLEANER_SLOT_SET                             4331
-#define ERROR_CLEANER_SLOT_NOT_SET                         4332
-#define ERROR_CLEANER_CARTRIDGE_SPENT                      4333
-#define ERROR_UNEXPECTED_OMID                              4334
-#define ERROR_CANT_DELETE_LAST_ITEM                        4335
-#define ERROR_MESSAGE_EXCEEDS_MAX_SIZE                     4336
-#define ERROR_VOLUME_CONTAINS_SYS_FILES                    4337
-#define ERROR_INDIGENOUS_TYPE                              4338
-#define ERROR_NO_SUPPORTING_DRIVES                         4339
-#define ERROR_FILE_OFFLINE                                 4350
-#define ERROR_REMOTE_STORAGE_NOT_ACTIVE                    4351
-#define ERROR_REMOTE_STORAGE_MEDIA_ERROR                   4352
-#define ERROR_NOT_A_REPARSE_POINT                          4390
-#define ERROR_REPARSE_ATTRIBUTE_CONFLICT                   4391
-#define ERROR_INVALID_REPARSE_DATA                         4392
-#define ERROR_REPARSE_TAG_INVALID                          4393
-#define ERROR_REPARSE_TAG_MISMATCH                         4394
-#define ERROR_VOLUME_NOT_SIS_ENABLED                       4500
-#define ERROR_DEPENDENT_RESOURCE_EXISTS                    5001
-#define ERROR_DEPENDENCY_NOT_FOUND                         5002
-#define ERROR_DEPENDENCY_ALREADY_EXISTS                    5003
-#define ERROR_RESOURCE_NOT_ONLINE                          5004
-#define ERROR_HOST_NODE_NOT_AVAILABLE                      5005
-#define ERROR_RESOURCE_NOT_AVAILABLE                       5006
-#define ERROR_RESOURCE_NOT_FOUND                           5007
-#define ERROR_SHUTDOWN_CLUSTER                             5008
-#define ERROR_CANT_EVICT_ACTIVE_NODE                       5009
-#define ERROR_OBJECT_ALREADY_EXISTS                        5010
-#define ERROR_OBJECT_IN_LIST                               5011
-#define ERROR_GROUP_NOT_AVAILABLE                          5012
-#define ERROR_GROUP_NOT_FOUND                              5013
-#define ERROR_GROUP_NOT_ONLINE                             5014
-#define ERROR_HOST_NODE_NOT_RESOURCE_OWNER                 5015
-#define ERROR_HOST_NODE_NOT_GROUP_OWNER                    5016
-#define ERROR_RESMON_CREATE_FAILED                         5017
-#define ERROR_RESMON_ONLINE_FAILED                         5018
-#define ERROR_RESOURCE_ONLINE                              5019
-#define ERROR_QUORUM_RESOURCE                              5020
-#define ERROR_NOT_QUORUM_CAPABLE                           5021
-#define ERROR_CLUSTER_SHUTTING_DOWN                        5022
-#define ERROR_INVALID_STATE                                5023
-#define ERROR_RESOURCE_PROPERTIES_STORED                   5024
-#define ERROR_NOT_QUORUM_CLASS                             5025
-#define ERROR_CORE_RESOURCE                                5026
-#define ERROR_QUORUM_RESOURCE_ONLINE_FAILED                5027
-#define ERROR_QUORUMLOG_OPEN_FAILED                        5028
-#define ERROR_CLUSTERLOG_CORRUPT                           5029
-#define ERROR_CLUSTERLOG_RECORD_EXCEEDS_MAXSIZE            5030
-#define ERROR_CLUSTERLOG_EXCEEDS_MAXSIZE                   5031
-#define ERROR_CLUSTERLOG_CHKPOINT_NOT_FOUND                5032
-#define ERROR_CLUSTERLOG_NOT_ENOUGH_SPACE                  5033
-#define ERROR_QUORUM_OWNER_ALIVE                           5034
-#define ERROR_NETWORK_NOT_AVAILABLE                        5035
-#define ERROR_NODE_NOT_AVAILABLE                           5036
-#define ERROR_ALL_NODES_NOT_AVAILABLE                      5037
-#define ERROR_RESOURCE_FAILED                              5038
-#define ERROR_CLUSTER_INVALID_NODE                         5039
-#define ERROR_CLUSTER_NODE_EXISTS                          5040
-#define ERROR_CLUSTER_JOIN_IN_PROGRESS                     5041
-#define ERROR_CLUSTER_NODE_NOT_FOUND                       5042
-#define ERROR_CLUSTER_LOCAL_NODE_NOT_FOUND                 5043
-#define ERROR_CLUSTER_NETWORK_EXISTS                       5044
-#define ERROR_CLUSTER_NETWORK_NOT_FOUND                    5045
-#define ERROR_CLUSTER_NETINTERFACE_EXISTS                  5046
-#define ERROR_CLUSTER_NETINTERFACE_NOT_FOUND               5047
-#define ERROR_CLUSTER_INVALID_REQUEST                      5048
-#define ERROR_CLUSTER_INVALID_NETWORK_PROVIDER             5049
-#define ERROR_CLUSTER_NODE_DOWN                            5050
-#define ERROR_CLUSTER_NODE_UNREACHABLE                     5051
-#define ERROR_CLUSTER_NODE_NOT_MEMBER                      5052
-#define ERROR_CLUSTER_JOIN_NOT_IN_PROGRESS                 5053
-#define ERROR_CLUSTER_INVALID_NETWORK                      5054
-#define ERROR_CLUSTER_NODE_UP                              5056
-#define ERROR_CLUSTER_IPADDR_IN_USE                        5057
-#define ERROR_CLUSTER_NODE_NOT_PAUSED                      5058
-#define ERROR_CLUSTER_NO_SECURITY_CONTEXT                  5059
-#define ERROR_CLUSTER_NETWORK_NOT_INTERNAL                 5060
-#define ERROR_CLUSTER_NODE_ALREADY_UP                      5061
-#define ERROR_CLUSTER_NODE_ALREADY_DOWN                    5062
-#define ERROR_CLUSTER_NETWORK_ALREADY_ONLINE               5063
-#define ERROR_CLUSTER_NETWORK_ALREADY_OFFLINE              5064
-#define ERROR_CLUSTER_NODE_ALREADY_MEMBER                  5065
-#define ERROR_CLUSTER_LAST_INTERNAL_NETWORK                5066
-#define ERROR_CLUSTER_NETWORK_HAS_DEPENDENTS               5067
-#define ERROR_INVALID_OPERATION_ON_QUORUM                  5068
-#define ERROR_DEPENDENCY_NOT_ALLOWED                       5069
-#define ERROR_CLUSTER_NODE_PAUSED                          5070
-#define ERROR_NODE_CANT_HOST_RESOURCE                      5071
-#define ERROR_CLUSTER_NODE_NOT_READY                       5072
-#define ERROR_CLUSTER_NODE_SHUTTING_DOWN                   5073
-#define ERROR_CLUSTER_JOIN_ABORTED                         5074
-#define ERROR_CLUSTER_INCOMPATIBLE_VERSIONS                5075
-#define ERROR_CLUSTER_MAXNUM_OF_RESOURCES_EXCEEDED         5076
-#define ERROR_CLUSTER_SYSTEM_CONFIG_CHANGED                5077
-#define ERROR_CLUSTER_RESOURCE_TYPE_NOT_FOUND              5078
-#define ERROR_CLUSTER_RESTYPE_NOT_SUPPORTED                5079
-#define ERROR_CLUSTER_RESNAME_NOT_FOUND                    5080
-#define ERROR_CLUSTER_NO_RPC_PACKAGES_REGISTERED           5081
-#define ERROR_CLUSTER_OWNER_NOT_IN_PREFLIST                5082
-#define ERROR_CLUSTER_DATABASE_SEQMISMATCH                 5083
-#define ERROR_RESMON_INVALID_STATE                         5084
-#define ERROR_CLUSTER_GUM_NOT_LOCKER                       5085
-#define ERROR_QUORUM_DISK_NOT_FOUND                        5086
-#define ERROR_DATABASE_BACKUP_CORRUPT                      5087
-#define ERROR_CLUSTER_NODE_ALREADY_HAS_DFS_ROOT            5088
-#define ERROR_RESOURCE_PROPERTY_UNCHANGEABLE               5089
-#define ERROR_ENCRYPTION_FAILED                            6000
-#define ERROR_DECRYPTION_FAILED                            6001
-#define ERROR_FILE_ENCRYPTED                               6002
-#define ERROR_NO_RECOVERY_POLICY                           6003
-#define ERROR_NO_EFS                                       6004
-#define ERROR_WRONG_EFS                                    6005
-#define ERROR_NO_USER_KEYS                                 6006
-#define ERROR_FILE_NOT_ENCRYPTED                           6007
-#define ERROR_NOT_EXPORT_FORMAT                            6008
-#define ERROR_FILE_READ_ONLY                               6009
-#define ERROR_DIR_EFS_DISALLOWED                           6010
-#define ERROR_EFS_SERVER_NOT_TRUSTED                       6011
-#define ERROR_NO_BROWSER_SERVERS_FOUND                     6118
-#define SCHED_E_SERVICE_NOT_LOCALSYSTEM                    6200
-#define ERROR_CTX_WINSTATION_NAME_INVALID                  7001
-#define ERROR_CTX_INVALID_PD                               7002
-#define ERROR_CTX_PD_NOT_FOUND                             7003
-#define ERROR_CTX_WD_NOT_FOUND                             7004
-#define ERROR_CTX_CANNOT_MAKE_EVENTLOG_ENTRY               7005
-#define ERROR_CTX_SERVICE_NAME_COLLISION                   7006
-#define ERROR_CTX_CLOSE_PENDING                            7007
-#define ERROR_CTX_NO_OUTBUF                                7008
-#define ERROR_CTX_MODEM_INF_NOT_FOUND                      7009
-#define ERROR_CTX_INVALID_MODEMNAME                        7010
-#define ERROR_CTX_MODEM_RESPONSE_ERROR                     7011
-#define ERROR_CTX_MODEM_RESPONSE_TIMEOUT                   7012
-#define ERROR_CTX_MODEM_RESPONSE_NO_CARRIER                7013
-#define ERROR_CTX_MODEM_RESPONSE_NO_DIALTONE               7014
-#define ERROR_CTX_MODEM_RESPONSE_BUSY                      7015
-#define ERROR_CTX_MODEM_RESPONSE_VOICE                     7016
-#define ERROR_CTX_TD_ERROR                                 7017
-#define ERROR_CTX_WINSTATION_NOT_FOUND                     7022
-#define ERROR_CTX_WINSTATION_ALREADY_EXISTS                7023
-#define ERROR_CTX_WINSTATION_BUSY                          7024
-#define ERROR_CTX_BAD_VIDEO_MODE                           7025
-#define ERROR_CTX_GRAPHICS_INVALID                         7035
-#define ERROR_CTX_LOGON_DISABLED                           7037
-#define ERROR_CTX_NOT_CONSOLE                              7038
-#define ERROR_CTX_CLIENT_QUERY_TIMEOUT                     7040
-#define ERROR_CTX_CONSOLE_DISCONNECT                       7041
-#define ERROR_CTX_CONSOLE_CONNECT                          7042
-#define ERROR_CTX_SHADOW_DENIED                            7044
-#define ERROR_CTX_WINSTATION_ACCESS_DENIED                 7045
-#define ERROR_CTX_INVALID_WD                               7049
-#define ERROR_CTX_SHADOW_INVALID                           7050
-#define ERROR_CTX_SHADOW_DISABLED                          7051
-#define ERROR_CTX_CLIENT_LICENSE_IN_USE                    7052
-#define ERROR_CTX_CLIENT_LICENSE_NOT_SET                   7053
-#define ERROR_CTX_LICENSE_NOT_AVAILABLE                    7054
-#define ERROR_CTX_LICENSE_CLIENT_INVALID                   7055
-#define ERROR_CTX_LICENSE_EXPIRED                          7056
-#define FRS_ERR_INVALID_API_SEQUENCE                       8001
-#define FRS_ERR_STARTING_SERVICE                           8002
-#define FRS_ERR_STOPPING_SERVICE                           8003
-#define FRS_ERR_INTERNAL_API                               8004
-#define FRS_ERR_INTERNAL                                   8005
-#define FRS_ERR_SERVICE_COMM                               8006
-#define FRS_ERR_INSUFFICIENT_PRIV                          8007
-#define FRS_ERR_AUTHENTICATION                             8008
-#define FRS_ERR_PARENT_INSUFFICIENT_PRIV                   8009
-#define FRS_ERR_PARENT_AUTHENTICATION                      8010
-#define FRS_ERR_CHILD_TO_PARENT_COMM                       8011
-#define FRS_ERR_PARENT_TO_CHILD_COMM                       8012
-#define FRS_ERR_SYSVOL_POPULATE                            8013
-#define FRS_ERR_SYSVOL_POPULATE_TIMEOUT                    8014
-#define FRS_ERR_SYSVOL_IS_BUSY                             8015
-#define FRS_ERR_SYSVOL_DEMOTE                              8016
-#define FRS_ERR_INVALID_SERVICE_PARAMETER                  8017
-#define ERROR_DS_NOT_INSTALLED                             8200
-#define ERROR_DS_MEMBERSHIP_EVALUATED_LOCALLY              8201
-#define ERROR_DS_NO_ATTRIBUTE_OR_VALUE                     8202
-#define ERROR_DS_INVALID_ATTRIBUTE_SYNTAX                  8203
-#define ERROR_DS_ATTRIBUTE_TYPE_UNDEFINED                  8204
-#define ERROR_DS_ATTRIBUTE_OR_VALUE_EXISTS                 8205
-#define ERROR_DS_BUSY                                      8206
-#define ERROR_DS_UNAVAILABLE                               8207
-#define ERROR_DS_NO_RIDS_ALLOCATED                         8208
-#define ERROR_DS_NO_MORE_RIDS                              8209
-#define ERROR_DS_INCORRECT_ROLE_OWNER                      8210
-#define ERROR_DS_RIDMGR_INIT_ERROR                         8211
-#define ERROR_DS_OBJ_CLASS_VIOLATION                       8212
-#define ERROR_DS_CANT_ON_NON_LEAF                          8213
-#define ERROR_DS_CANT_ON_RDN                               8214
-#define ERROR_DS_CANT_MOD_OBJ_CLASS                        8215
-#define ERROR_DS_CROSS_DOM_MOVE_ERROR                      8216
-#define ERROR_DS_GC_NOT_AVAILABLE                          8217
-#define ERROR_SHARED_POLICY                                8218
-#define ERROR_POLICY_OBJECT_NOT_FOUND                      8219
-#define ERROR_POLICY_ONLY_IN_DS                            8220
-#define ERROR_PROMOTION_ACTIVE                             8221
-#define ERROR_NO_PROMOTION_ACTIVE                          8222
-#define ERROR_DS_OPERATIONS_ERROR                          8224
-#define ERROR_DS_PROTOCOL_ERROR                            8225
-#define ERROR_DS_TIMELIMIT_EXCEEDED                        8226
-#define ERROR_DS_SIZELIMIT_EXCEEDED                        8227
-#define ERROR_DS_ADMIN_LIMIT_EXCEEDED                      8228
-#define ERROR_DS_COMPARE_FALSE                             8229
-#define ERROR_DS_COMPARE_TRUE                              8230
-#define ERROR_DS_AUTH_METHOD_NOT_SUPPORTED                 8231
-#define ERROR_DS_STRONG_AUTH_REQUIRED                      8232
-#define ERROR_DS_INAPPROPRIATE_AUTH                        8233
-#define ERROR_DS_AUTH_UNKNOWN                              8234
-#define ERROR_DS_REFERRAL                                  8235
-#define ERROR_DS_UNAVAILABLE_CRIT_EXTENSION                8236
-#define ERROR_DS_CONFIDENTIALITY_REQUIRED                  8237
-#define ERROR_DS_INAPPROPRIATE_MATCHING                    8238
-#define ERROR_DS_CONSTRAINT_VIOLATION                      8239
-#define ERROR_DS_NO_SUCH_OBJECT                            8240
-#define ERROR_DS_ALIAS_PROBLEM                             8241
-#define ERROR_DS_INVALID_DN_SYNTAX                         8242
-#define ERROR_DS_IS_LEAF                                   8243
-#define ERROR_DS_ALIAS_DEREF_PROBLEM                       8244
-#define ERROR_DS_UNWILLING_TO_PERFORM                      8245
-#define ERROR_DS_LOOP_DETECT                               8246
-#define ERROR_DS_NAMING_VIOLATION                          8247
-#define ERROR_DS_OBJECT_RESULTS_TOO_LARGE                  8248
-#define ERROR_DS_AFFECTS_MULTIPLE_DSAS                     8249
-#define ERROR_DS_SERVER_DOWN                               8250
-#define ERROR_DS_LOCAL_ERROR                               8251
-#define ERROR_DS_ENCODING_ERROR                            8252
-#define ERROR_DS_DECODING_ERROR                            8253
-#define ERROR_DS_FILTER_UNKNOWN                            8254
-#define ERROR_DS_PARAM_ERROR                               8255
-#define ERROR_DS_NOT_SUPPORTED                             8256
-#define ERROR_DS_NO_RESULTS_RETURNED                       8257
-#define ERROR_DS_CONTROL_NOT_FOUND                         8258
-#define ERROR_DS_CLIENT_LOOP                               8259
-#define ERROR_DS_REFERRAL_LIMIT_EXCEEDED                   8260
-#define ERROR_DS_ROOT_MUST_BE_NC                           8301
-#define ERROR_DS_ADD_REPLICA_INHIBITED                     8302
-#define ERROR_DS_ATT_NOT_DEF_IN_SCHEMA                     8303
-#define ERROR_DS_MAX_OBJ_SIZE_EXCEEDED                     8304
-#define ERROR_DS_OBJ_STRING_NAME_EXISTS                    8305
-#define ERROR_DS_NO_RDN_DEFINED_IN_SCHEMA                  8306
-#define ERROR_DS_RDN_DOESNT_MATCH_SCHEMA                   8307
-#define ERROR_DS_NO_REQUESTED_ATTS_FOUND                   8308
-#define ERROR_DS_USER_BUFFER_TO_SMALL                      8309
-#define ERROR_DS_ATT_IS_NOT_ON_OBJ                         8310
-#define ERROR_DS_ILLEGAL_MOD_OPERATION                     8311
-#define ERROR_DS_OBJ_TOO_LARGE                             8312
-#define ERROR_DS_BAD_INSTANCE_TYPE                         8313
-#define ERROR_DS_MASTERDSA_REQUIRED                        8314
-#define ERROR_DS_OBJECT_CLASS_REQUIRED                     8315
-#define ERROR_DS_MISSING_REQUIRED_ATT                      8316
-#define ERROR_DS_ATT_NOT_DEF_FOR_CLASS                     8317
-#define ERROR_DS_ATT_ALREADY_EXISTS                        8318
-#define ERROR_DS_CANT_ADD_ATT_VALUES                       8320
-#define ERROR_DS_SINGLE_VALUE_CONSTRAINT                   8321
-#define ERROR_DS_RANGE_CONSTRAINT                          8322
-#define ERROR_DS_ATT_VAL_ALREADY_EXISTS                    8323
-#define ERROR_DS_CANT_REM_MISSING_ATT                      8324
-#define ERROR_DS_CANT_REM_MISSING_ATT_VAL                  8325
-#define ERROR_DS_ROOT_CANT_BE_SUBREF                       8326
-#define ERROR_DS_NO_CHAINING                               8327
-#define ERROR_DS_NO_CHAINED_EVAL                           8328
-#define ERROR_DS_NO_PARENT_OBJECT                          8329
-#define ERROR_DS_PARENT_IS_AN_ALIAS                        8330
-#define ERROR_DS_CANT_MIX_MASTER_AND_REPS                  8331
-#define ERROR_DS_CHILDREN_EXIST                            8332
-#define ERROR_DS_OBJ_NOT_FOUND                             8333
-#define ERROR_DS_ALIASED_OBJ_MISSING                       8334
-#define ERROR_DS_BAD_NAME_SYNTAX                           8335
-#define ERROR_DS_ALIAS_POINTS_TO_ALIAS                     8336
-#define ERROR_DS_CANT_DEREF_ALIAS                          8337
-#define ERROR_DS_OUT_OF_SCOPE                              8338
-#define ERROR_DS_CANT_DELETE_DSA_OBJ                       8340
-#define ERROR_DS_GENERIC_ERROR                             8341
-#define ERROR_DS_DSA_MUST_BE_INT_MASTER                    8342
-#define ERROR_DS_CLASS_NOT_DSA                             8343
-#define ERROR_DS_INSUFF_ACCESS_RIGHTS                      8344
-#define ERROR_DS_ILLEGAL_SUPERIOR                          8345
-#define ERROR_DS_ATTRIBUTE_OWNED_BY_SAM                    8346
-#define ERROR_DS_NAME_TOO_MANY_PARTS                       8347
-#define ERROR_DS_NAME_TOO_LONG                             8348
-#define ERROR_DS_NAME_VALUE_TOO_LONG                       8349
-#define ERROR_DS_NAME_UNPARSEABLE                          8350
-#define ERROR_DS_NAME_TYPE_UNKNOWN                         8351
-#define ERROR_DS_NOT_AN_OBJECT                             8352
-#define ERROR_DS_SEC_DESC_TOO_SHORT                        8353
-#define ERROR_DS_SEC_DESC_INVALID                          8354
-#define ERROR_DS_NO_DELETED_NAME                           8355
-#define ERROR_DS_SUBREF_MUST_HAVE_PARENT                   8356
-#define ERROR_DS_NCNAME_MUST_BE_NC                         8357
-#define ERROR_DS_CANT_ADD_SYSTEM_ONLY                      8358
-#define ERROR_DS_CLASS_MUST_BE_CONCRETE                    8359
-#define ERROR_DS_INVALID_DMD                               8360
-#define ERROR_DS_OBJ_GUID_EXISTS                           8361
-#define ERROR_DS_NOT_ON_BACKLINK                           8362
-#define ERROR_DS_NO_CROSSREF_FOR_NC                        8363
-#define ERROR_DS_SHUTTING_DOWN                             8364
-#define ERROR_DS_UNKNOWN_OPERATION                         8365
-#define ERROR_DS_INVALID_ROLE_OWNER                        8366
-#define ERROR_DS_COULDNT_CONTACT_FSMO                      8367
-#define ERROR_DS_CROSS_NC_DN_RENAME                        8368
-#define ERROR_DS_CANT_MOD_SYSTEM_ONLY                      8369
-#define ERROR_DS_REPLICATOR_ONLY                           8370
-#define ERROR_DS_OBJ_CLASS_NOT_DEFINED                     8371
-#define ERROR_DS_OBJ_CLASS_NOT_SUBCLASS                    8372
-#define ERROR_DS_NAME_REFERENCE_INVALID                    8373
-#define ERROR_DS_CROSS_REF_EXISTS                          8374
-#define ERROR_DS_CANT_DEL_MASTER_CROSSREF                  8375
-#define ERROR_DS_SUBTREE_NOTIFY_NOT_NC_HEAD                8376
-#define ERROR_DS_NOTIFY_FILTER_TOO_COMPLEX                 8377
-#define ERROR_DS_DUP_RDN                                   8378
-#define ERROR_DS_DUP_OID                                   8379
-#define ERROR_DS_DUP_MAPI_ID                               8380
-#define ERROR_DS_DUP_SCHEMA_ID_GUID                        8381
-#define ERROR_DS_DUP_LDAP_DISPLAY_NAME                     8382
-#define ERROR_DS_SEMANTIC_ATT_TEST                         8383
-#define ERROR_DS_SYNTAX_MISMATCH                           8384
-#define ERROR_DS_EXISTS_IN_MUST_HAVE                       8385
-#define ERROR_DS_EXISTS_IN_MAY_HAVE                        8386
-#define ERROR_DS_NONEXISTENT_MAY_HAVE                      8387
-#define ERROR_DS_NONEXISTENT_MUST_HAVE                     8388
-#define ERROR_DS_AUX_CLS_TEST_FAIL                         8389
-#define ERROR_DS_NONEXISTENT_POSS_SUP                      8390
-#define ERROR_DS_SUB_CLS_TEST_FAIL                         8391
-#define ERROR_DS_BAD_RDN_ATT_ID_SYNTAX                     8392
-#define ERROR_DS_EXISTS_IN_AUX_CLS                         8393
-#define ERROR_DS_EXISTS_IN_SUB_CLS                         8394
-#define ERROR_DS_EXISTS_IN_POSS_SUP                        8395
-#define ERROR_DS_RECALCSCHEMA_FAILED                       8396
-#define ERROR_DS_TREE_DELETE_NOT_FINISHED                  8397
-#define ERROR_DS_CANT_DELETE                               8398
-#define ERROR_DS_ATT_SCHEMA_REQ_ID                         8399
-#define ERROR_DS_BAD_ATT_SCHEMA_SYNTAX                     8400
-#define ERROR_DS_CANT_CACHE_ATT                            8401
-#define ERROR_DS_CANT_CACHE_CLASS                          8402
-#define ERROR_DS_CANT_REMOVE_ATT_CACHE                     8403
-#define ERROR_DS_CANT_REMOVE_CLASS_CACHE                   8404
-#define ERROR_DS_CANT_RETRIEVE_DN                          8405
-#define ERROR_DS_MISSING_SUPREF                            8406
-#define ERROR_DS_CANT_RETRIEVE_INSTANCE                    8407
-#define ERROR_DS_CODE_INCONSISTENCY                        8408
-#define ERROR_DS_DATABASE_ERROR                            8409
-#define ERROR_DS_GOVERNSID_MISSING                         8410
-#define ERROR_DS_MISSING_EXPECTED_ATT                      8411
-#define ERROR_DS_NCNAME_MISSING_CR_REF                     8412
-#define ERROR_DS_SECURITY_CHECKING_ERROR                   8413
-#define ERROR_DS_SCHEMA_NOT_LOADED                         8414
-#define ERROR_DS_SCHEMA_ALLOC_FAILED                       8415
-#define ERROR_DS_ATT_SCHEMA_REQ_SYNTAX                     8416
-#define ERROR_DS_GCVERIFY_ERROR                            8417
-#define ERROR_DS_DRA_SCHEMA_MISMATCH                       8418
-#define ERROR_DS_CANT_FIND_DSA_OBJ                         8419
-#define ERROR_DS_CANT_FIND_EXPECTED_NC                     8420
-#define ERROR_DS_CANT_FIND_NC_IN_CACHE                     8421
-#define ERROR_DS_CANT_RETRIEVE_CHILD                       8422
-#define ERROR_DS_SECURITY_ILLEGAL_MODIFY                   8423
-#define ERROR_DS_CANT_REPLACE_HIDDEN_REC                   8424
-#define ERROR_DS_BAD_HIERARCHY_FILE                        8425
-#define ERROR_DS_BUILD_HIERARCHY_TABLE_FAILED              8426
-#define ERROR_DS_CONFIG_PARAM_MISSING                      8427
-#define ERROR_DS_COUNTING_AB_INDICES_FAILED                8428
-#define ERROR_DS_HIERARCHY_TABLE_MALLOC_FAILED             8429
-#define ERROR_DS_INTERNAL_FAILURE                          8430
-#define ERROR_DS_UNKNOWN_ERROR                             8431
-#define ERROR_DS_ROOT_REQUIRES_CLASS_TOP                   8432
-#define ERROR_DS_REFUSING_FSMO_ROLES                       8433
-#define ERROR_DS_MISSING_FSMO_SETTINGS                     8434
-#define ERROR_DS_UNABLE_TO_SURRENDER_ROLES                 8435
-#define ERROR_DS_DRA_GENERIC                               8436
-#define ERROR_DS_DRA_INVALID_PARAMETER                     8437
-#define ERROR_DS_DRA_BUSY                                  8438
-#define ERROR_DS_DRA_BAD_DN                                8439
-#define ERROR_DS_DRA_BAD_NC                                8440
-#define ERROR_DS_DRA_DN_EXISTS                             8441
-#define ERROR_DS_DRA_INTERNAL_ERROR                        8442
-#define ERROR_DS_DRA_INCONSISTENT_DIT                      8443
-#define ERROR_DS_DRA_CONNECTION_FAILED                     8444
-#define ERROR_DS_DRA_BAD_INSTANCE_TYPE                     8445
-#define ERROR_DS_DRA_OUT_OF_MEM                            8446
-#define ERROR_DS_DRA_MAIL_PROBLEM                          8447
-#define ERROR_DS_DRA_REF_ALREADY_EXISTS                    8448
-#define ERROR_DS_DRA_REF_NOT_FOUND                         8449
-#define ERROR_DS_DRA_OBJ_IS_REP_SOURCE                     8450
-#define ERROR_DS_DRA_DB_ERROR                              8451
-#define ERROR_DS_DRA_NO_REPLICA                            8452
-#define ERROR_DS_DRA_ACCESS_DENIED                         8453
-#define ERROR_DS_DRA_NOT_SUPPORTED                         8454
-#define ERROR_DS_DRA_RPC_CANCELLED                         8455
-#define ERROR_DS_DRA_SOURCE_DISABLED                       8456
-#define ERROR_DS_DRA_SINK_DISABLED                         8457
-#define ERROR_DS_DRA_NAME_COLLISION                        8458
-#define ERROR_DS_DRA_SOURCE_REINSTALLED                    8459
-#define ERROR_DS_DRA_MISSING_PARENT                        8460
-#define ERROR_DS_DRA_PREEMPTED                             8461
-#define ERROR_DS_DRA_ABANDON_SYNC                          8462
-#define ERROR_DS_DRA_SHUTDOWN                              8463
-#define ERROR_DS_DRA_INCOMPATIBLE_PARTIAL_SET              8464
-#define ERROR_DS_DRA_SOURCE_IS_PARTIAL_REPLICA             8465
-#define ERROR_DS_DRA_EXTN_CONNECTION_FAILED                8466
-#define ERROR_DS_INSTALL_SCHEMA_MISMATCH                   8467
-#define ERROR_DS_DUP_LINK_ID                               8468
-#define ERROR_DS_NAME_ERROR_RESOLVING                      8469
-#define ERROR_DS_NAME_ERROR_NOT_FOUND                      8470
-#define ERROR_DS_NAME_ERROR_NOT_UNIQUE                     8471
-#define ERROR_DS_NAME_ERROR_NO_MAPPING                     8472
-#define ERROR_DS_NAME_ERROR_DOMAIN_ONLY                    8473
-#define ERROR_DS_NAME_ERROR_NO_SYNTACTICAL_MAPPING         8474
-#define ERROR_DS_CONSTRUCTED_ATT_MOD                       8475
-#define ERROR_DS_WRONG_OM_OBJ_CLASS                        8476
-#define ERROR_DS_DRA_REPL_PENDING                          8477
-#define ERROR_DS_DS_REQUIRED                               8478
-#define ERROR_DS_INVALID_LDAP_DISPLAY_NAME                 8479
-#define ERROR_DS_NON_BASE_SEARCH                           8480
-#define ERROR_DS_CANT_RETRIEVE_ATTS                        8481
-#define ERROR_DS_BACKLINK_WITHOUT_LINK                     8482
-#define ERROR_DS_EPOCH_MISMATCH                            8483
-#define ERROR_DS_SRC_NAME_MISMATCH                         8484
-#define ERROR_DS_SRC_AND_DST_NC_IDENTICAL                  8485
-#define ERROR_DS_DST_NC_MISMATCH                           8486
-#define ERROR_DS_NOT_AUTHORITIVE_FOR_DST_NC                8487
-#define ERROR_DS_SRC_GUID_MISMATCH                         8488
-#define ERROR_DS_CANT_MOVE_DELETED_OBJECT                  8489
-#define ERROR_DS_PDC_OPERATION_IN_PROGRESS                 8490
-#define ERROR_DS_CROSS_DOMAIN_CLEANUP_REQD                 8491
-#define ERROR_DS_ILLEGAL_XDOM_MOVE_OPERATION               8492
-#define ERROR_DS_CANT_WITH_ACCT_GROUP_MEMBERSHPS           8493
-#define ERROR_DS_NC_MUST_HAVE_NC_PARENT                    8494
-#define ERROR_DS_CR_IMPOSSIBLE_TO_VALIDATE                 8495
-#define ERROR_DS_DST_DOMAIN_NOT_NATIVE                     8496
-#define ERROR_DS_MISSING_INFRASTRUCTURE_CONTAINER          8497
-#define ERROR_DS_CANT_MOVE_ACCOUNT_GROUP                   8498
-#define ERROR_DS_CANT_MOVE_RESOURCE_GROUP                  8499
-#define ERROR_DS_INVALID_SEARCH_FLAG                       8500
-#define ERROR_DS_NO_TREE_DELETE_ABOVE_NC                   8501
-#define ERROR_DS_COULDNT_LOCK_TREE_FOR_DELETE              8502
-#define ERROR_DS_COULDNT_IDENTIFY_OBJECTS_FOR_TREE_DELETE  8503
-#define ERROR_DS_SAM_INIT_FAILURE                          8504
-#define ERROR_DS_SENSITIVE_GROUP_VIOLATION                 8505
-#define ERROR_DS_CANT_MOD_PRIMARYGROUPID                   8506
-#define ERROR_DS_ILLEGAL_BASE_SCHEMA_MOD                   8507
-#define ERROR_DS_NONSAFE_SCHEMA_CHANGE                     8508
-#define ERROR_DS_SCHEMA_UPDATE_DISALLOWED                  8509
-#define ERROR_DS_CANT_CREATE_UNDER_SCHEMA                  8510
-#define ERROR_DS_INSTALL_NO_SRC_SCH_VERSION                8511
-#define ERROR_DS_INSTALL_NO_SCH_VERSION_IN_INIFILE         8512
-#define ERROR_DS_INVALID_GROUP_TYPE                        8513
-#define ERROR_DS_NO_NEST_GLOBALGROUP_IN_MIXEDDOMAIN        8514
-#define ERROR_DS_NO_NEST_LOCALGROUP_IN_MIXEDDOMAIN         8515
-#define ERROR_DS_GLOBAL_CANT_HAVE_LOCAL_MEMBER             8516
-#define ERROR_DS_GLOBAL_CANT_HAVE_UNIVERSAL_MEMBER         8517
-#define ERROR_DS_UNIVERSAL_CANT_HAVE_LOCAL_MEMBER          8518
-#define ERROR_DS_GLOBAL_CANT_HAVE_CROSSDOMAIN_MEMBER       8519
-#define ERROR_DS_LOCAL_CANT_HAVE_CROSSDOMAIN_LOCAL_MEMBER  8520
-#define ERROR_DS_HAVE_PRIMARY_MEMBERS                      8521
-#define ERROR_DS_STRING_SD_CONVERSION_FAILED               8522
-#define ERROR_DS_NAMING_MASTER_GC                          8523
-#define ERROR_DS_LOOKUP_FAILURE                            8524
-#define ERROR_DS_COULDNT_UPDATE_SPNS                       8525
-#define ERROR_DS_CANT_RETRIEVE_SD                          8526
-#define ERROR_DS_KEY_NOT_UNIQUE                            8527
-#define ERROR_DS_WRONG_LINKED_ATT_SYNTAX                   8528
-#define ERROR_DS_SAM_NEED_BOOTKEY_PASSWORD                 8529
-#define ERROR_DS_SAM_NEED_BOOTKEY_FLOPPY                   8530
-#define ERROR_DS_CANT_START                                8531
-#define ERROR_DS_INIT_FAILURE                              8532
-#define ERROR_DS_NO_PKT_PRIVACY_ON_CONNECTION              8533
-#define ERROR_DS_SOURCE_DOMAIN_IN_FOREST                   8534
-#define ERROR_DS_DESTINATION_DOMAIN_NOT_IN_FOREST          8535
-#define ERROR_DS_DESTINATION_AUDITING_NOT_ENABLED          8536
-#define ERROR_DS_CANT_FIND_DC_FOR_SRC_DOMAIN               8537
-#define ERROR_DS_SRC_OBJ_NOT_GROUP_OR_USER                 8538
-#define ERROR_DS_SRC_SID_EXISTS_IN_FOREST                  8539
-#define ERROR_DS_SRC_AND_DST_OBJECT_CLASS_MISMATCH         8540
-#define ERROR_SAM_INIT_FAILURE                             8541
-#define ERROR_DS_DRA_SCHEMA_INFO_SHIP                      8542
-#define ERROR_DS_DRA_SCHEMA_CONFLICT                       8543
-#define ERROR_DS_DRA_EARLIER_SCHEMA_CONLICT                8544
-#define ERROR_DS_DRA_OBJ_NC_MISMATCH                       8545
-#define ERROR_DS_NC_STILL_HAS_DSAS                         8546
-#define ERROR_DS_GC_REQUIRED                               8547
-#define ERROR_DS_LOCAL_MEMBER_OF_LOCAL_ONLY                8548
-#define ERROR_DS_NO_FPO_IN_UNIVERSAL_GROUPS                8549
-#define ERROR_DS_CANT_ADD_TO_GC                            8550
-#define ERROR_DS_NO_CHECKPOINT_WITH_PDC                    8551
-#define ERROR_DS_SOURCE_AUDITING_NOT_ENABLED               8552
-#define ERROR_DS_CANT_CREATE_IN_NONDOMAIN_NC               8553
-#define ERROR_DS_INVALID_NAME_FOR_SPN                      8554
-#define ERROR_DS_FILTER_USES_CONTRUCTED_ATTRS              8555
-#define ERROR_DS_UNICODEPWD_NOT_IN_QUOTES                  8556
-#define ERROR_DS_MACHINE_ACCOUNT_QUOTA_EXCEEDED            8557
-#define ERROR_DS_MUST_BE_RUN_ON_DST_DC                     8558
-#define ERROR_DS_SRC_DC_MUST_BE_SP4_OR_GREATER             8559
-#define ERROR_DS_CANT_TREE_DELETE_CRITICAL_OBJ             8560
-#define DNS_ERROR_RCODE_FORMAT_ERROR                       9001
-#define DNS_ERROR_RCODE_SERVER_FAILURE                     9002
-#define DNS_ERROR_RCODE_NAME_ERROR                         9003
-#define DNS_ERROR_RCODE_NOT_IMPLEMENTED                    9004
-#define DNS_ERROR_RCODE_REFUSED                            9005
-#define DNS_ERROR_RCODE_YXDOMAIN                           9006
-#define DNS_ERROR_RCODE_YXRRSET                            9007
-#define DNS_ERROR_RCODE_NXRRSET                            9008
-#define DNS_ERROR_RCODE_NOTAUTH                            9009
-#define DNS_ERROR_RCODE_NOTZONE                            9010
-#define DNS_ERROR_RCODE_BADSIG                             9016
-#define DNS_ERROR_RCODE_BADKEY                             9017
-#define DNS_ERROR_RCODE_BADTIME                            9018
-#define DNS_INFO_NO_RECORDS                                9501
-#define DNS_ERROR_BAD_PACKET                               9502
-#define DNS_ERROR_NO_PACKET                                9503
-#define DNS_ERROR_RCODE                                    9504
-#define DNS_ERROR_UNSECURE_PACKET                          9505
-#define DNS_ERROR_INVALID_TYPE                             9551
-#define DNS_ERROR_INVALID_IP_ADDRESS                       9552
-#define DNS_ERROR_INVALID_PROPERTY                         9553
-#define DNS_ERROR_TRY_AGAIN_LATER                          9554
-#define DNS_ERROR_NOT_UNIQUE                               9555
-#define DNS_ERROR_NON_RFC_NAME                             9556
-#define DNS_STATUS_FQDN                                    9557
-#define DNS_STATUS_DOTTED_NAME                             9558
-#define DNS_STATUS_SINGLE_PART_NAME                        9559
-#define DNS_ERROR_INVALID_NAME_CHAR                        9560
-#define DNS_ERROR_NUMERIC_NAME                             9561
-#define DNS_ERROR_ZONE_DOES_NOT_EXIST                      9601
-#define DNS_ERROR_NO_ZONE_INFO                             9602
-#define DNS_ERROR_INVALID_ZONE_OPERATION                   9603
-#define DNS_ERROR_ZONE_CONFIGURATION_ERROR                 9604
-#define DNS_ERROR_ZONE_HAS_NO_SOA_RECORD                   9605
-#define DNS_ERROR_ZONE_HAS_NO_NS_RECORDS                   9606
-#define DNS_ERROR_ZONE_LOCKED                              9607
-#define DNS_ERROR_ZONE_CREATION_FAILED                     9608
-#define DNS_ERROR_ZONE_ALREADY_EXISTS                      9609
-#define DNS_ERROR_AUTOZONE_ALREADY_EXISTS                  9610
-#define DNS_ERROR_INVALID_ZONE_TYPE                        9611
-#define DNS_ERROR_SECONDARY_REQUIRES_MASTER_IP             9612
-#define DNS_ERROR_ZONE_NOT_SECONDARY                       9613
-#define DNS_ERROR_NEED_SECONDARY_ADDRESSES                 9614
-#define DNS_ERROR_WINS_INIT_FAILED                         9615
-#define DNS_ERROR_NEED_WINS_SERVERS                        9616
-#define DNS_ERROR_NBSTAT_INIT_FAILED                       9617
-#define DNS_ERROR_SOA_DELETE_INVALID                       9618
-#define DNS_ERROR_PRIMARY_REQUIRES_DATAFILE                9651
-#define DNS_ERROR_INVALID_DATAFILE_NAME                    9652
-#define DNS_ERROR_DATAFILE_OPEN_FAILURE                    9653
-#define DNS_ERROR_FILE_WRITEBACK_FAILED                    9654
-#define DNS_ERROR_DATAFILE_PARSING                         9655
-#define DNS_ERROR_RECORD_DOES_NOT_EXIST                    9701
-#define DNS_ERROR_RECORD_FORMAT                            9702
-#define DNS_ERROR_NODE_CREATION_FAILED                     9703
-#define DNS_ERROR_UNKNOWN_RECORD_TYPE                      9704
-#define DNS_ERROR_RECORD_TIMED_OUT                         9705
-#define DNS_ERROR_NAME_NOT_IN_ZONE                         9706
-#define DNS_ERROR_CNAME_LOOP                               9707
-#define DNS_ERROR_NODE_IS_CNAME                            9708
-#define DNS_ERROR_CNAME_COLLISION                          9709
-#define DNS_ERROR_RECORD_ONLY_AT_ZONE_ROOT                 9710
-#define DNS_ERROR_RECORD_ALREADY_EXISTS                    9711
-#define DNS_ERROR_SECONDARY_DATA                           9712
-#define DNS_ERROR_NO_CREATE_CACHE_DATA                     9713
-#define DNS_ERROR_NAME_DOES_NOT_EXIST                      9714
-#define DNS_WARNING_PTR_CREATE_FAILED                      9715
-#define DNS_WARNING_DOMAIN_UNDELETED                       9716
-#define DNS_ERROR_DS_UNAVAILABLE                           9717
-#define DNS_ERROR_DS_ZONE_ALREADY_EXISTS                   9718
-#define DNS_ERROR_NO_BOOTFILE_IF_DS_ZONE                   9719
-#define DNS_INFO_AXFR_COMPLETE                             9751
-#define DNS_ERROR_AXFR                                     9752
-#define DNS_INFO_ADDED_LOCAL_WINS                          9753
-#define DNS_STATUS_CONTINUE_NEEDED                         9801
-#define DNS_ERROR_NO_TCPIP                                 9851
-#define DNS_ERROR_NO_DNS_SERVERS                           9852
-
-/* HRESULT values for OLE, SHELL and other Interface stuff */
-/* the codes 4000-40ff are reserved for OLE */
-#define NOERROR                                0L
-#define S_OK                                   ((HRESULT)0L)
-#define S_FALSE                                ((HRESULT)1L)
-
-#define DISP_E_UNKNOWNINTERFACE 0x80020001L
-#define DISP_E_MEMBERNOTFOUND   0x80020003L
-#define DISP_E_PARAMNOTFOUND    0x80020004L
-#define DISP_E_TYPEMISMATCH     0x80020005L
-#define DISP_E_UNKNOWNNAME      0x80020006L
-#define DISP_E_NONAMEDARGS      0x80020007L
-#define DISP_E_BADVARTYPE   0x80020008L
-#define DISP_E_EXCEPTION        0x80020009L
-#define DISP_E_OVERFLOW     0x8002000AL
-#define DISP_E_BADINDEX         0x8002000BL
-#define DISP_E_UNKNOWNLCID      0x8002000CL
-#define DISP_E_ARRAYISLOCKED    0x8002000DL
-#define DISP_E_BADPARAMCOUNT    0x8002000EL
-#define DISP_E_PARAMNOTOPTIONAL 0x8002000FL
-
-#define TYPE_E_ELEMENTNOTFOUND           0x8002802BL
-#define TYPE_E_CANTLOADLIBRARY  0x80029C4AL
-
-/* OLE Clipboard */
-#define CLIPBRD_E_FIRST         0x800401D0L
-#define CLIPBRD_E_LAST          0x800401DFL
-#define CLIPBRD_S_FIRST         0x000401D0L
-#define CLIPBRD_S_LAST          0x000401DFL
-#define CLIPBRD_E_CANT_OPEN     0x800401D0L
-#define CLIPBRD_E_CANT_EMPTY    0x800401D1L
-#define CLIPBRD_E_CANT_SET      0x800401D2L
-#define CLIPBRD_E_BAD_DATA      0x800401D3L
-#define CLIPBRD_E_CANT_CLOSE    0x800401D4L
-
-/* Drag and Drop */
-#define DRAGDROP_S_DROP   0x00040100L
-#define DRAGDROP_S_CANCEL 0x00040101L
-#define DRAGDROP_E_NOTREGISTERED      0x80040100L
-#define DRAGDROP_E_ALREADYREGISTERED  0x80040101L
-#define DRAGDROP_S_USEDEFAULTCURSORS  0x00040102L
-
-#define        E_UNEXPECTED                    0x8000FFFF
-
-#define E_NOTIMPL                      0x80004001
-#define E_NOINTERFACE                  0x80004002
-#define E_POINTER                      0x80004003
-#define E_ABORT                                0x80004004
-#define E_FAIL                         0x80004005
-#define E_UNSPEC E_FAIL /* must to be defined (used by FileMoniker, IOleLink and DoDragDrop as a return value) */
-
-/*#define CO_E_INIT_TLS                        0x80004006
-#define CO_E_INIT_SHARED_ALLOCATOR     0x80004007
-#define CO_E_INIT_MEMORY_ALLOCATOR     0x80004008
-#define CO_E_INIT_CLASS_CACHE          0x80004009
-#define CO_E_INIT_RPC_CHANNEL          0x8000400A
-#define CO_E_INIT_TLS_SET_CHANNEL_CONTROL      0x8000400B
-#define CO_E_INIT_TLS_CHANNEL_CONTROL  0x8000400C
-#define CO_E_INIT_UNACCEPTED_USER_ALLOCATOR    0x8000400D
-#define CO_E_INIT_SCM_MUTEX_EXISTS     0x8000400E
-#define CO_E_INIT_SCM_FILE_MAPPING_EXISTS      0x8000400F
-#define CO_E_INIT_SCM_MAP_VIEW_OF_FILE 0x80004010
-#define CO_E_INIT_SCM_EXEC_FAILURE     0x80004011
-#define CO_E_INIT_ONLY_SINGLE_THREADED 0x80004012 */
-
-#define CO_S_NOTALLINTERFACES           0x00080012
-#define CO_E_NOTINITIALIZED             0x800401F0
-#define CO_E_ERRORINDLL                 0x800401F9
-#define CO_E_OBJISREG                   0x800401FB
-
-#define OLE_E_FIRST 0x80040000L
-#define OLE_E_LAST  0x800400FFL
-#define OLE_S_FIRST 0x00040000L
-#define OLE_S_LAST  0x000400FFL
-
-#define        OLE_E_ENUM_NOMORE                     0x80040002
-#define        OLE_E_ADVISENOTSUPPORTED  0x80040003
-#define        OLE_E_NOCONNECTION        0x80040004
-#define        OLE_E_NOTRUNNING          0x80040005
-#define        OLE_E_NOCACHE             0x80040006
-#define        OLE_E_BLANK                         0x80040007
-#define        OLE_E_NOT_INPLACEACTIVE         0x80040010
-#define        OLE_E_STATIC              0x8004000B
-#define        OLE_E_PROMPTSAVECANCELLED 0x8004000C
-#define OLE_S_USEREG                            0x00040000
-#define OLE_S_STATIC              0x00040001
-
-#define DV_E_FORMATETC            0x80040064
-#define DV_E_DVASPECT             0x8004006B
-#define DV_E_LINDEX               0x80040068
-#define DV_E_TYMED                0x80040069
-
-#define CLASS_E_NOAGGREGATION     0x80040110
-#define        CLASS_E_CLASSNOTAVAILABLE 0x80040111
-
-#define DATA_S_SAMEFORMATETC      0x80040130
-
-#define E_ACCESSDENIED                       0x80070005
-#define E_HANDLE                               0x80070006
-#define        E_OUTOFMEMORY                           0x8007000E
-#define        E_INVALIDARG                            0x80070057
-
-/*#define OLE_E_FIRST 0x80040000L */
-/*#define OLE_E_LAST  0x800400FFL */
-/*#define OLE_S_FIRST 0x00040000L */
-/*#define OLE_S_LAST  0x000400FFL */
-
-#define MK_S_REDUCED_TO_SELF            0x000401E2
-#define MK_S_ME                         0x000401E4
-#define MK_S_HIM                        0x000401E5
-#define MK_S_US                         0x000401E6
-#define MK_S_MONIKERALREADYREGISTERED   0x000401E7
-
-#define MK_E_EXCEEDEDDEADLINE                     0x800401E1
-#define MK_E_NEEDGENERIC                          0x800401E2
-#define MK_E_UNAVAILABLE                          0x800401E3
-#define MK_E_SYNTAX                               0x800401E4
-#define MK_E_NOOBJECT                             0x800401E5
-#define MK_E_INVALIDEXTENSION                     0x800401E6
-#define MK_E_INTERMEDIATEINTERFACENOTSUPPORTED    0x800401E7
-#define MK_E_NOTBINDABLE                          0x800401E8
-#define MK_E_NOTBOUND                             0x800401E9
-#define MK_E_CANTOPENFILE                         0x800401EA
-#define MK_E_MIUSTBOTHERUSER                      0x800401EB
-#define MK_E_NOINVERSE                            0x800401EC
-#define MK_E_NOSTORAGE                            0x800401ED
-#define MK_E_NOPREFIX                             0x800401EE
-
-#define STG_E_INVALIDFUNCTION          0x80030001
-#define STG_E_FILENOTFOUND             0x80030002
-#define STG_E_PATHNOTFOUND             0x80030003
-#define STG_E_TOOMANYOPENFILES         0x80030004
-#define STG_E_ACCESSDENIED             0x80030005
-#define STG_E_INVALIDHANDLE            0x80030006
-#define STG_E_INSUFFICIENTMEMORY       0x80030008
-#define STG_E_INVALIDPOINTER           0x80030009
-#define STG_E_NOMOREFILES              0x80030012
-#define STG_E_DISKISWRITEPROTECTED     0x80030013
-#define STG_E_SEEKERROR                        0x80030019
-#define STG_E_WRITEFAULT               0x8003001D
-#define STG_E_READFAULT                        0x8003001E
-#define STG_E_SHAREVIOLATION           0x80030020
-#define STG_E_LOCKVIOLATION            0x80030021
-#define STG_E_FILEALREADYEXISTS                0x80030050
-#define STG_E_INVALIDPARAMETER         0x80030057
-#define STG_E_MEDIUMFULL               0x80030070
-#define STG_E_ABNORMALAPIEXIT          0x800300FA
-#define STG_E_INVALIDHEADER            0x800300FB
-#define STG_E_INVALIDNAME              0x800300FC
-#define STG_E_UNKNOWN                  0x800300FD
-#define STG_E_UNIMPLEMENTEDFUNCTION    0x800300FE
-#define STG_E_INVALIDFLAG              0x800300FF
-#define STG_E_INUSE                    0x80030100
-#define STG_E_NOTCURRENT               0x80030101
-#define STG_E_REVERTED                 0x80030102
-#define STG_E_CANTSAVE                 0x80030103
-#define STG_E_OLDFORMAT                        0x80030104
-#define STG_E_OLDDLL                   0x80030105
-#define STG_E_SHAREREQUIRED            0x80030106
-#define STG_E_NOTFILEBASEDSTORAGE      0x80030107
-#define STG_E_EXTANTMARSHALLINGS       0x80030108
-
-#define CONVERT10_E_OLESTREAM_GET       0x800401C0
-#define CONVERT10_E_OLESTREAM_PUT       0x800401C1
-#define CONVERT10_E_OLESTREAM_FMT       0x800401C2
-#define CONVERT10_E_OLESTREAM_BITMAP_TO_DIB 0x800401C3
-#define CONVERT10_E_STG_FMT             0x800401C4
-#define CONVERT10_E_STG_NO_STD_STREAM   0x800401C5
-#define CONVERT10_E_STG_DIB_TO_BITMAP   0x800401C6
-
-/* alten versionen
-#define E_NOTIMPL                      0x80000001
-#define E_OUTOFMEMORY                  0x80000002
-#define E_INVALIDARG                   0x80000003
-#define E_NOINTERFACE                  0x80000004
-#define E_POINTER                      0x80000005
-#define E_HANDLE                       0x80000006
-#define E_ABORT                                0x80000007
-#define        E_FAIL                          0x80000008
-#define E_ACCESSDENIED                 0x80000009 */
-
-/* Obtained from lcc-win32 include files */
-#define GDI_ERROR                      0xffffffff
-
-
-/* registry errors */
-#define REGDB_E_READREGDB               0x80040150
-#define REGDB_E_CLASSNOTREG             0x80040154
-
-#define INPLACE_E_NOTUNDOABLE           0x800401A0
-#define INPLACE_E_NOTOOLSPACE           0x800401A1
-
-#define DATA_E_FORMATETC                DV_E_FORMATETC
-
-#define CLASSFACTORY_E_FIRST            0x80040110L
-#define CLASSFACTORY_E_LAST             0x8004011FL
-#define CLASSFACTORY_S_FIRST            0x80040110L
-#define CLASSFACTORY_S_LAST             0x8004011FL
-
-#define CLASS_E_NOTLICENSED             (CLASSFACTORY_E_FIRST+2)
-#define CLASS_E_NOAGGREGATION           0x80040110
-#define        CLASS_E_CLASSNOTAVAILABLE             0x80040111
-
-
-#define OLEOBJ_E_NOVERBS                0x00040180L
-#define OLEOBJ_E_INVALIDVERB            0x00040181L
-#define OLEOBJ_S_INVALIDVERB            0x00040180L
-
-#endif  /* __WINE_WINERROR_H */
diff --git a/modules/codec/loader/wine/winestring.h b/modules/codec/loader/wine/winestring.h
deleted file mode 100644 (file)
index 5b66dc8..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-#ifndef __WINE_WINE_WINESTRING_H
-#define __WINE_WINE_WINESTRING_H
-
-#include "windef.h"
-
-LPWSTR      WINAPI lstrcpyAtoW(LPWSTR,LPCSTR);
-LPSTR       WINAPI lstrcpyWtoA(LPSTR,LPCWSTR);
-LPWSTR      WINAPI lstrcpynAtoW(LPWSTR,LPCSTR,INT);
-LPSTR       WINAPI lstrcpynWtoA(LPSTR,LPCWSTR,INT);
-
-#define lstrncmpiA strncasecmp
-
-#endif /* __WINE_WINE_WINESTRING_H */
diff --git a/modules/codec/loader/wine/winnt.h b/modules/codec/loader/wine/winnt.h
deleted file mode 100644 (file)
index 401c398..0000000
+++ /dev/null
@@ -1,2668 +0,0 @@
-/*
- * Win32 definitions for Windows NT
- *
- * Copyright 1996 Alexandre Julliard
- */
-
-#ifndef __WINE_WINNT_H
-#define __WINE_WINNT_H
-
-#include "windef.h"
-
-#ifndef RC_INVOKED
-#include <string.h>
-#endif
-
-#include "pshpack1.h"
-/* Defines */
-
-/* Argument 1 passed to the DllEntryProc. */
-#define        DLL_PROCESS_DETACH      0       /* detach process (unload library) */
-#define        DLL_PROCESS_ATTACH      1       /* attach process (load library) */
-#define        DLL_THREAD_ATTACH       2       /* attach new thread */
-#define        DLL_THREAD_DETACH       3       /* detach thread */
-
-
-/* u.x.wProcessorArchitecture (NT) */
-#define PROCESSOR_ARCHITECTURE_INTEL   0
-#define PROCESSOR_ARCHITECTURE_MIPS    1
-#define PROCESSOR_ARCHITECTURE_ALPHA   2
-#define PROCESSOR_ARCHITECTURE_PPC     3
-#define PROCESSOR_ARCHITECTURE_SHX     4
-#define PROCESSOR_ARCHITECTURE_ARM     5
-#define PROCESSOR_ARCHITECTURE_UNKNOWN 0xFFFF
-
-/* dwProcessorType */
-#define PROCESSOR_INTEL_386      386
-#define PROCESSOR_INTEL_486      486
-#define PROCESSOR_INTEL_PENTIUM  586
-#define PROCESSOR_INTEL_860      860
-#define PROCESSOR_MIPS_R2000     2000
-#define PROCESSOR_MIPS_R3000     3000
-#define PROCESSOR_MIPS_R4000     4000
-#define PROCESSOR_ALPHA_21064    21064
-#define PROCESSOR_PPC_601        601
-#define PROCESSOR_PPC_603        603
-#define PROCESSOR_PPC_604        604
-#define PROCESSOR_PPC_620        620
-#define PROCESSOR_HITACHI_SH3    10003
-#define PROCESSOR_HITACHI_SH3E   10004
-#define PROCESSOR_HITACHI_SH4    10005
-#define PROCESSOR_MOTOROLA_821   821
-#define PROCESSOR_SHx_SH3        103
-#define PROCESSOR_SHx_SH4        104
-#define PROCESSOR_STRONGARM      2577
-#define PROCESSOR_ARM720         1824    /* 0x720 */
-#define PROCESSOR_ARM820         2080    /* 0x820 */
-#define PROCESSOR_ARM920         2336    /* 0x920 */
-#define PROCESSOR_ARM_7TDMI      70001
-
-#define ANYSIZE_ARRAY 1
-
-#define MINCHAR       0x80
-#define MAXCHAR       0x7f
-#define MINSHORT      0x8000
-#define MAXSHORT      0x7fff
-#define MINLONG       0x80000000
-#define MAXLONG       0x7fffffff
-#define MAXBYTE       0xff
-#define MAXWORD       0xffff
-#define MAXDWORD      0xffffffff
-
-#define FIELD_OFFSET(type, field) \
-  ((LONG)(INT)&(((type *)0)->field))
-
-#define CONTAINING_RECORD(address, type, field) \
-  ((type *)((PCHAR)(address) - (PCHAR)(&((type *)0)->field)))
-
-/* Types */
-
-/* TCHAR data types definitions for Winelib. */
-/* These types are _not_ defined for the emulator, because they */
-/* depend on the UNICODE macro that only exists in user's code. */
-
-//#ifndef __WINE__
-# ifdef UNICODE
-typedef WCHAR TCHAR, *PTCHAR;
-typedef LPWSTR PTSTR, LPTSTR;
-typedef LPCWSTR PCTSTR, LPCTSTR;
-#define __TEXT(string) L##string /*probably wrong */
-# else  /* UNICODE */
-typedef char TCHAR, *PTCHAR;
-typedef LPSTR PTSTR, LPTSTR;
-typedef LPCSTR PCTSTR, LPCTSTR;
-#define __TEXT(string) string
-# endif /* UNICODE */
-//#endif   /* __WINE__ */
-#define TEXT(quote) __TEXT(quote)
-
-typedef BYTE     BOOLEAN;
-typedef BOOLEAN *PBOOLEAN;
-
-typedef struct _LIST_ENTRY {
-  struct _LIST_ENTRY *Flink;
-  struct _LIST_ENTRY *Blink;
-} LIST_ENTRY, *PLIST_ENTRY;
-
-typedef struct _SINGLE_LIST_ENTRY {
-  struct _SINGLE_LIST_ENTRY *Next;
-} SINGLE_LIST_ENTRY, *PSINGLE_LIST_ENTRY;
-
-/* Heap flags */
-
-#define HEAP_NO_SERIALIZE               0x00000001
-#define HEAP_GROWABLE                   0x00000002
-#define HEAP_GENERATE_EXCEPTIONS        0x00000004
-#define HEAP_ZERO_MEMORY                0x00000008
-#define HEAP_REALLOC_IN_PLACE_ONLY      0x00000010
-#define HEAP_TAIL_CHECKING_ENABLED      0x00000020
-#define HEAP_FREE_CHECKING_ENABLED      0x00000040
-#define HEAP_DISABLE_COALESCE_ON_FREE   0x00000080
-#define HEAP_CREATE_ALIGN_16            0x00010000
-#define HEAP_CREATE_ENABLE_TRACING      0x00020000
-#define HEAP_WINE_SEGPTR                0x01000000  /* Not a Win32 flag */
-#define HEAP_WINE_CODESEG               0x02000000  /* Not a Win32 flag */
-#define HEAP_WINE_CODE16SEG             0x04000000  /* Not a Win32 flag */
-#define HEAP_WINE_SHARED                0x08000000  /* Not a Win32 flag */
-
-/* Processor feature flags.  */
-#define PF_FLOATING_POINT_PRECISION_ERRATA     0
-#define PF_FLOATING_POINT_EMULATED             1
-#define PF_COMPARE_EXCHANGE_DOUBLE             2
-#define PF_MMX_INSTRUCTIONS_AVAILABLE          3
-#define PF_PPC_MOVEMEM_64BIT_OK                        4
-#define PF_ALPHA_BYTE_INSTRUCTIONS             5
-/* based on wine-20010510 -- alex */
-#define PF_XMMI_INSTRUCTIONS_AVAILABLE         6
-#define PF_AMD3D_INSTRUCTIONS_AVAILABLE                7
-#define PF_RDTSC_INSTRUCTION_AVAILABLE         8
-
-/* The Win32 register context */
-
-/* CONTEXT is the CPU-dependent context; it should be used        */
-/* wherever a platform-specific context is needed (e.g. exception */
-/* handling, Win32 register functions). */
-
-/* CONTEXT86 is the i386-specific context; it should be used     */
-/* wherever only a 386 context makes sense (e.g. DOS interrupts, */
-/* Win16 register functions), so that this code can be compiled  */
-/* on all platforms. */
-
-#define SIZE_OF_80387_REGISTERS      80
-
-typedef struct _FLOATING_SAVE_AREA
-{
-    DWORD   ControlWord;
-    DWORD   StatusWord;
-    DWORD   TagWord;    
-    DWORD   ErrorOffset;
-    DWORD   ErrorSelector;
-    DWORD   DataOffset;
-    DWORD   DataSelector;    
-    BYTE    RegisterArea[SIZE_OF_80387_REGISTERS];
-    DWORD   Cr0NpxState;
-} FLOATING_SAVE_AREA, *PFLOATING_SAVE_AREA;
-
-typedef struct _CONTEXT86
-{
-    DWORD   ContextFlags;
-
-    /* These are selected by CONTEXT_DEBUG_REGISTERS */
-    DWORD   Dr0;
-    DWORD   Dr1;
-    DWORD   Dr2;
-    DWORD   Dr3;
-    DWORD   Dr6;
-    DWORD   Dr7;
-
-    /* These are selected by CONTEXT_FLOATING_POINT */
-    FLOATING_SAVE_AREA FloatSave;
-
-    /* These are selected by CONTEXT_SEGMENTS */
-    DWORD   SegGs;
-    DWORD   SegFs;
-    DWORD   SegEs;
-    DWORD   SegDs;    
-
-    /* These are selected by CONTEXT_INTEGER */
-    DWORD   Edi;
-    DWORD   Esi;
-    DWORD   Ebx;
-    DWORD   Edx;    
-    DWORD   Ecx;
-    DWORD   Eax;
-
-    /* These are selected by CONTEXT_CONTROL */
-    DWORD   Ebp;    
-    DWORD   Eip;
-    DWORD   SegCs;
-    DWORD   EFlags;
-    DWORD   Esp;
-    DWORD   SegSs;
-} CONTEXT86;
-
-#define CONTEXT_X86       0x00010000
-#define CONTEXT_i386      CONTEXT_X86
-#define CONTEXT_i486      CONTEXT_X86
-
-#define CONTEXT86_CONTROL   (CONTEXT_i386 | 0x0001) /* SS:SP, CS:IP, FLAGS, BP */
-#define CONTEXT86_INTEGER   (CONTEXT_i386 | 0x0002) /* AX, BX, CX, DX, SI, DI */
-#define CONTEXT86_SEGMENTS  (CONTEXT_i386 | 0x0004) /* DS, ES, FS, GS */
-#define CONTEXT86_FLOATING_POINT  (CONTEXT_i386 | 0x0008L) /* 387 state */
-#define CONTEXT86_DEBUG_REGISTERS (CONTEXT_i386 | 0x0010L) /* DB 0-3,6,7 */
-#define CONTEXT86_FULL (CONTEXT86_CONTROL | CONTEXT86_INTEGER | CONTEXT86_SEGMENTS)
-
-/* i386 context definitions */
-#ifdef __i386__
-
-#define CONTEXT_CONTROL         CONTEXT86_CONTROL
-#define CONTEXT_INTEGER         CONTEXT86_INTEGER
-#define CONTEXT_SEGMENTS        CONTEXT86_SEGMENTS
-#define CONTEXT_FLOATING_POINT  CONTEXT86_FLOATING_POINT
-#define CONTEXT_DEBUG_REGISTERS CONTEXT86_DEBUG_REGISTERS
-#define CONTEXT_FULL            CONTEXT86_FULL
-
-typedef CONTEXT86 CONTEXT;
-
-#endif  /* __i386__ */
-
-/* Alpha context definitions */
-#if defined(_ALPHA_) || defined(__alpha__)
-
-#define CONTEXT_ALPHA   0x00020000
-#define CONTEXT_CONTROL                (CONTEXT_ALPHA | 0x00000001L)
-#define CONTEXT_FLOATING_POINT (CONTEXT_ALPHA | 0x00000002L)
-#define CONTEXT_INTEGER                (CONTEXT_ALPHA | 0x00000004L)
-#define CONTEXT_FULL  (CONTEXT_CONTROL | CONTEXT_FLOATING_POINT | CONTEXT_INTEGER)
-
-typedef struct _CONTEXT
-{
-    /* selected by CONTEXT_FLOATING_POINT */
-    ULONGLONG FltF0;
-    ULONGLONG FltF1;
-    ULONGLONG FltF2;
-    ULONGLONG FltF3;
-    ULONGLONG FltF4;
-    ULONGLONG FltF5;
-    ULONGLONG FltF6;
-    ULONGLONG FltF7;
-    ULONGLONG FltF8;
-    ULONGLONG FltF9;
-    ULONGLONG FltF10;
-    ULONGLONG FltF11;
-    ULONGLONG FltF12;
-    ULONGLONG FltF13;
-    ULONGLONG FltF14;
-    ULONGLONG FltF15;
-    ULONGLONG FltF16;
-    ULONGLONG FltF17;
-    ULONGLONG FltF18;
-    ULONGLONG FltF19;
-    ULONGLONG FltF20;
-    ULONGLONG FltF21;
-    ULONGLONG FltF22;
-    ULONGLONG FltF23;
-    ULONGLONG FltF24;
-    ULONGLONG FltF25;
-    ULONGLONG FltF26;
-    ULONGLONG FltF27;
-    ULONGLONG FltF28;
-    ULONGLONG FltF29;
-    ULONGLONG FltF30;
-    ULONGLONG FltF31;
-
-    /* selected by CONTEXT_INTEGER */
-    ULONGLONG IntV0;
-    ULONGLONG IntT0;
-    ULONGLONG IntT1;
-    ULONGLONG IntT2;
-    ULONGLONG IntT3;
-    ULONGLONG IntT4;
-    ULONGLONG IntT5;
-    ULONGLONG IntT6;
-    ULONGLONG IntT7;
-    ULONGLONG IntS0;
-    ULONGLONG IntS1;
-    ULONGLONG IntS2;
-    ULONGLONG IntS3;
-    ULONGLONG IntS4;
-    ULONGLONG IntS5;
-    ULONGLONG IntFp;
-    ULONGLONG IntA0;
-    ULONGLONG IntA1;
-    ULONGLONG IntA2;
-    ULONGLONG IntA3;
-    ULONGLONG IntA4;
-    ULONGLONG IntA5;
-    ULONGLONG IntT8;
-    ULONGLONG IntT9;
-    ULONGLONG IntT10;
-    ULONGLONG IntT11;
-    ULONGLONG IntRa;
-    ULONGLONG IntT12;
-    ULONGLONG IntAt;
-    ULONGLONG IntGp;
-    ULONGLONG IntSp;
-    ULONGLONG IntZero;
-
-    /* selected by CONTEXT_FLOATING_POINT */
-    ULONGLONG Fpcr;
-    ULONGLONG SoftFpcr;
-
-    /* selected by CONTEXT_CONTROL */
-    ULONGLONG Fir;
-    DWORD Psr;
-    DWORD ContextFlags;
-    DWORD Fill[4];
-} CONTEXT;
-
-#define _QUAD_PSR_OFFSET   HighSoftFpcr
-#define _QUAD_FLAGS_OFFSET HighFir
-
-#endif  /* _ALPHA_ */
-
-/* Mips context definitions */
-#ifdef _MIPS_
-
-#define CONTEXT_R4000   0x00010000
-
-#define CONTEXT_CONTROL         (CONTEXT_R4000 | 0x00000001)
-#define CONTEXT_FLOATING_POINT  (CONTEXT_R4000 | 0x00000002)
-#define CONTEXT_INTEGER         (CONTEXT_R4000 | 0x00000004)
-
-#define CONTEXT_FULL (CONTEXT_CONTROL | CONTEXT_FLOATING_POINT | CONTEXT_INTEGER)
-
-typedef struct _CONTEXT
-{
-    DWORD Argument[4];
-    /* These are selected by CONTEXT_FLOATING_POINT */
-    DWORD FltF0;
-    DWORD FltF1;
-    DWORD FltF2;
-    DWORD FltF3;
-    DWORD FltF4;
-    DWORD FltF5;
-    DWORD FltF6;
-    DWORD FltF7;
-    DWORD FltF8;
-    DWORD FltF9;
-    DWORD FltF10;
-    DWORD FltF11;
-    DWORD FltF12;
-    DWORD FltF13;
-    DWORD FltF14;
-    DWORD FltF15;
-    DWORD FltF16;
-    DWORD FltF17;
-    DWORD FltF18;
-    DWORD FltF19;
-    DWORD FltF20;
-    DWORD FltF21;
-    DWORD FltF22;
-    DWORD FltF23;
-    DWORD FltF24;
-    DWORD FltF25;
-    DWORD FltF26;
-    DWORD FltF27;
-    DWORD FltF28;
-    DWORD FltF29;
-    DWORD FltF30;
-    DWORD FltF31;
-
-    /* These are selected by CONTEXT_INTEGER */
-    DWORD IntZero;
-    DWORD IntAt;
-    DWORD IntV0;
-    DWORD IntV1;
-    DWORD IntA0;
-    DWORD IntA1;
-    DWORD IntA2;
-    DWORD IntA3;
-    DWORD IntT0;
-    DWORD IntT1;
-    DWORD IntT2;
-    DWORD IntT3;
-    DWORD IntT4;
-    DWORD IntT5;
-    DWORD IntT6;
-    DWORD IntT7;
-    DWORD IntS0;
-    DWORD IntS1;
-    DWORD IntS2;
-    DWORD IntS3;
-    DWORD IntS4;
-    DWORD IntS5;
-    DWORD IntS6;
-    DWORD IntS7;
-    DWORD IntT8;
-    DWORD IntT9;
-    DWORD IntK0;
-    DWORD IntK1;
-    DWORD IntGp;
-    DWORD IntSp;
-    DWORD IntS8;
-    DWORD IntRa;
-    DWORD IntLo;
-    DWORD IntHi;
-
-    /* These are selected by CONTEXT_FLOATING_POINT */
-    DWORD Fsr;
-
-    /* These are selected by CONTEXT_CONTROL */
-    DWORD Fir;
-    DWORD Psr;
-
-    DWORD ContextFlags;
-    DWORD Fill[2];
-} CONTEXT;
-
-#endif  /* _MIPS_ */
-
-/* PowerPC context definitions */
-#ifdef __PPC__
-
-#define CONTEXT_CONTROL         0x0001
-#define CONTEXT_FLOATING_POINT  0x0002
-#define CONTEXT_INTEGER         0x0004
-#define CONTEXT_DEBUG_REGISTERS 0x0008
-#define CONTEXT_FULL (CONTEXT_CONTROL | CONTEXT_FLOATING_POINT | CONTEXT_INTEGER)
-
-typedef struct
-{
-    /* These are selected by CONTEXT_FLOATING_POINT */
-    double Fpr0;
-    double Fpr1;
-    double Fpr2;
-    double Fpr3;
-    double Fpr4;
-    double Fpr5;
-    double Fpr6;
-    double Fpr7;
-    double Fpr8;
-    double Fpr9;
-    double Fpr10;
-    double Fpr11;
-    double Fpr12;
-    double Fpr13;
-    double Fpr14;
-    double Fpr15;
-    double Fpr16;
-    double Fpr17;
-    double Fpr18;
-    double Fpr19;
-    double Fpr20;
-    double Fpr21;
-    double Fpr22;
-    double Fpr23;
-    double Fpr24;
-    double Fpr25;
-    double Fpr26;
-    double Fpr27;
-    double Fpr28;
-    double Fpr29;
-    double Fpr30;
-    double Fpr31;
-    double Fpscr;
-
-    /* These are selected by CONTEXT_INTEGER */
-    DWORD Gpr0;
-    DWORD Gpr1;
-    DWORD Gpr2;
-    DWORD Gpr3;
-    DWORD Gpr4;
-    DWORD Gpr5;
-    DWORD Gpr6;
-    DWORD Gpr7;
-    DWORD Gpr8;
-    DWORD Gpr9;
-    DWORD Gpr10;
-    DWORD Gpr11;
-    DWORD Gpr12;
-    DWORD Gpr13;
-    DWORD Gpr14;
-    DWORD Gpr15;
-    DWORD Gpr16;
-    DWORD Gpr17;
-    DWORD Gpr18;
-    DWORD Gpr19;
-    DWORD Gpr20;
-    DWORD Gpr21;
-    DWORD Gpr22;
-    DWORD Gpr23;
-    DWORD Gpr24;
-    DWORD Gpr25;
-    DWORD Gpr26;
-    DWORD Gpr27;
-    DWORD Gpr28;
-    DWORD Gpr29;
-    DWORD Gpr30;
-    DWORD Gpr31;
-
-    DWORD Cr;
-    DWORD Xer;
-
-    /* These are selected by CONTEXT_CONTROL */
-    DWORD Msr;
-    DWORD Iar;
-    DWORD Lr;
-    DWORD Ctr;
-
-    DWORD ContextFlags;
-    DWORD Fill[3];
-
-    /* These are selected by CONTEXT_DEBUG_REGISTERS */
-    DWORD Dr0;
-    DWORD Dr1;
-    DWORD Dr2;
-    DWORD Dr3;
-    DWORD Dr4;
-    DWORD Dr5;
-    DWORD Dr6;
-    DWORD Dr7;
-} CONTEXT;
-
-typedef struct _STACK_FRAME_HEADER
-{
-    DWORD BackChain;
-    DWORD GlueSaved1;
-    DWORD GlueSaved2;
-    DWORD Reserved1;
-    DWORD Spare1;
-    DWORD Spare2;
-
-    DWORD Parameter0;
-    DWORD Parameter1;
-    DWORD Parameter2;
-    DWORD Parameter3;
-    DWORD Parameter4;
-    DWORD Parameter5;
-    DWORD Parameter6;
-    DWORD Parameter7;
-} STACK_FRAME_HEADER,*PSTACK_FRAME_HEADER;
-
-#endif  /* __PPC__ */
-
-#ifdef __sparc__
-
-/* 
- * FIXME:  
- *
- * There is no official CONTEXT structure defined for the SPARC 
- * architecture, so I just made one up.
- *
- * This structure is valid only for 32-bit SPARC architectures,
- * not for 64-bit SPARC.
- *
- * Note that this structure contains only the 'top-level' registers;
- * the rest of the register window chain is not visible.
- *
- * The layout follows the Solaris 'prgregset_t' structure.
- * 
- */ 
-
-#define CONTEXT_SPARC            0x10000000
-
-#define CONTEXT_CONTROL         (CONTEXT_SPARC | 0x00000001)
-#define CONTEXT_FLOATING_POINT  (CONTEXT_SPARC | 0x00000002)
-#define CONTEXT_INTEGER         (CONTEXT_SPARC | 0x00000004)
-
-#define CONTEXT_FULL (CONTEXT_CONTROL | CONTEXT_FLOATING_POINT | CONTEXT_INTEGER)
-
-typedef struct _CONTEXT
-{
-    DWORD ContextFlags;
-
-    /* These are selected by CONTEXT_INTEGER */
-    DWORD g0;
-    DWORD g1;
-    DWORD g2;
-    DWORD g3;
-    DWORD g4;
-    DWORD g5;
-    DWORD g6;
-    DWORD g7;
-    DWORD o0;
-    DWORD o1;
-    DWORD o2;
-    DWORD o3;
-    DWORD o4;
-    DWORD o5;
-    DWORD o6;
-    DWORD o7;
-    DWORD l0;
-    DWORD l1;
-    DWORD l2;
-    DWORD l3;
-    DWORD l4;
-    DWORD l5;
-    DWORD l6;
-    DWORD l7;
-    DWORD i0;
-    DWORD i1;
-    DWORD i2;
-    DWORD i3;
-    DWORD i4;
-    DWORD i5;
-    DWORD i6;
-    DWORD i7;
-
-    /* These are selected by CONTEXT_CONTROL */
-    DWORD psr;
-    DWORD pc;
-    DWORD npc;
-    DWORD y;
-    DWORD wim;
-    DWORD tbr;
-
-    /* FIXME: floating point registers missing */
-
-} CONTEXT;
-
-#endif  /* __sparc__ */
-
-#if !defined(CONTEXT_FULL) && !defined(RC_INVOKED)
-#error You need to define a CONTEXT for your CPU
-#endif
-
-typedef CONTEXT *PCONTEXT;
-typedef HANDLE *PHANDLE;
-
-#ifdef __WINE__
-
-/* Macros for easier access to i386 context registers */
-
-#define EAX_reg(context)     ((context)->Eax)
-#define EBX_reg(context)     ((context)->Ebx)
-#define ECX_reg(context)     ((context)->Ecx)
-#define EDX_reg(context)     ((context)->Edx)
-#define ESI_reg(context)     ((context)->Esi)
-#define EDI_reg(context)     ((context)->Edi)
-#define EBP_reg(context)     ((context)->Ebp)
-
-#define CS_reg(context)      ((context)->SegCs)
-#define DS_reg(context)      ((context)->SegDs)
-#define ES_reg(context)      ((context)->SegEs)
-#define FS_reg(context)      ((context)->SegFs)
-#define GS_reg(context)      ((context)->SegGs)
-#define SS_reg(context)      ((context)->SegSs)
-
-#define EFL_reg(context)     ((context)->EFlags)
-#define EIP_reg(context)     ((context)->Eip)
-#define ESP_reg(context)     ((context)->Esp)
-
-#define AX_reg(context)      (*(WORD*)&EAX_reg(context))
-#define BX_reg(context)      (*(WORD*)&EBX_reg(context))
-#define CX_reg(context)      (*(WORD*)&ECX_reg(context))
-#define DX_reg(context)      (*(WORD*)&EDX_reg(context))
-#define SI_reg(context)      (*(WORD*)&ESI_reg(context))
-#define DI_reg(context)      (*(WORD*)&EDI_reg(context))
-#define BP_reg(context)      (*(WORD*)&EBP_reg(context))
-
-#define AL_reg(context)      (*(BYTE*)&EAX_reg(context))
-#define AH_reg(context)      (*((BYTE*)&EAX_reg(context)+1))
-#define BL_reg(context)      (*(BYTE*)&EBX_reg(context))
-#define BH_reg(context)      (*((BYTE*)&EBX_reg(context)+1))
-#define CL_reg(context)      (*(BYTE*)&ECX_reg(context))
-#define CH_reg(context)      (*((BYTE*)&ECX_reg(context)+1))
-#define DL_reg(context)      (*(BYTE*)&EDX_reg(context))
-#define DH_reg(context)      (*((BYTE*)&EDX_reg(context)+1))
-                            
-#define SET_CFLAG(context)   (EFL_reg(context) |= 0x0001)
-#define RESET_CFLAG(context) (EFL_reg(context) &= ~0x0001)
-#define SET_ZFLAG(context)   (EFL_reg(context) |= 0x0040)
-#define RESET_ZFLAG(context) (EFL_reg(context) &= ~0x0040)
-
-#define ISV86(context)       (EFL_reg(context) & 0x00020000)
-#define V86BASE(context)     ((context)->Dr7) /* ugly */
-
-
-/* Macros to retrieve the current context */
-
-#ifdef __i386__
-
-#ifdef NEED_UNDERSCORE_PREFIX
-# define __ASM_NAME(name) "_" name
-#else
-# define __ASM_NAME(name) name
-#endif
-
-#ifdef __GNUC__
-# define __ASM_GLOBAL_FUNC(name,code) \
-      __asm__( ".align 4\n\t" \
-               ".globl " __ASM_NAME(#name) "\n\t" \
-               ".type " __ASM_NAME(#name) ",@function\n" \
-               __ASM_NAME(#name) ":\n\t" \
-               code );
-#else  /* __GNUC__ */
-# define __ASM_GLOBAL_FUNC(name,code) \
-      void __asm_dummy_##name(void) { \
-          asm( ".align 4\n\t" \
-               ".globl " __ASM_NAME(#name) "\n\t" \
-               ".type " __ASM_NAME(#name) ",@function\n" \
-               __ASM_NAME(#name) ":\n\t" \
-               code ); \
-      }
-#endif  /* __GNUC__ */
-
-#define _DEFINE_REGS_ENTRYPOINT( name, fn, args ) \
-    __ASM_GLOBAL_FUNC( name, \
-                       "call " __ASM_NAME("CALL32_Regs") "\n\t" \
-                       ".long " __ASM_NAME(#fn) "\n\t" \
-                       ".byte " #args ", " #args )
-#define DEFINE_REGS_ENTRYPOINT_0( name, fn ) \
-  _DEFINE_REGS_ENTRYPOINT( name, fn, 0 )
-#define DEFINE_REGS_ENTRYPOINT_1( name, fn, t1 ) \
-  _DEFINE_REGS_ENTRYPOINT( name, fn, 4 )
-#define DEFINE_REGS_ENTRYPOINT_2( name, fn, t1, t2 ) \
-  _DEFINE_REGS_ENTRYPOINT( name, fn, 8 )
-#define DEFINE_REGS_ENTRYPOINT_3( name, fn, t1, t2, t3 ) \
-  _DEFINE_REGS_ENTRYPOINT( name, fn, 12 )
-#define DEFINE_REGS_ENTRYPOINT_4( name, fn, t1, t2, t3, t4 ) \
-  _DEFINE_REGS_ENTRYPOINT( name, fn, 16 )
-
-#endif  /* __i386__ */
-
-#ifdef __sparc__
-/* FIXME: use getcontext() to retrieve full context */
-#define _GET_CONTEXT \
-    CONTEXT context;   \
-    do { memset(&context, 0, sizeof(CONTEXT));            \
-         context.ContextFlags = CONTEXT_CONTROL;          \
-         context.pc = (DWORD)__builtin_return_address(0); \
-       } while (0)
-
-#define DEFINE_REGS_ENTRYPOINT_0( name, fn ) \
-  void WINAPI name ( void ) \
-  { _GET_CONTEXT; fn( &context ); }
-#define DEFINE_REGS_ENTRYPOINT_1( name, fn, t1 ) \
-  void WINAPI name ( t1 a1 ) \
-  { _GET_CONTEXT; fn( a1, &context ); }
-#define DEFINE_REGS_ENTRYPOINT_2( name, fn, t1, t2 ) \
-  void WINAPI name ( t1 a1, t2 a2 ) \
-  { _GET_CONTEXT; fn( a1, a2, &context ); }
-#define DEFINE_REGS_ENTRYPOINT_3( name, fn, t1, t2, t3 ) \
-  void WINAPI name ( t1 a1, t2 a2, t3 a3 ) \
-  { _GET_CONTEXT; fn( a1, a2, a3, &context ); }
-#define DEFINE_REGS_ENTRYPOINT_4( name, fn, t1, t2, t3, t4 ) \
-  void WINAPI name ( t1 a1, t2 a2, t3 a3, t4 a4 ) \
-  { _GET_CONTEXT; fn( a1, a2, a3, a4, &context ); }
-
-#endif /* __sparc__ */
-
-#ifndef DEFINE_REGS_ENTRYPOINT_0
-#error You need to define DEFINE_REGS_ENTRYPOINT macros for your CPU
-#endif
-
-#ifdef __i386__
-# define GET_IP(context) ((LPVOID)(context)->Eip)
-#endif
-#ifdef __sparc__
-# define GET_IP(context) ((LPVOID)(context)->pc)
-#endif
-#if !defined(GET_IP) && !defined(RC_INVOKED)
-# error You must define GET_IP for this CPU
-#endif
-
-#endif  /* __WINE__ */
-
-/*
- * Exception codes
- */
-
-#define STATUS_SUCCESS                   0x00000000
-#define STATUS_WAIT_0                    0x00000000
-#define STATUS_ABANDONED_WAIT_0          0x00000080
-#define STATUS_USER_APC                  0x000000C0
-#define STATUS_TIMEOUT                   0x00000102
-#define STATUS_PENDING                   0x00000103
-
-#define STATUS_GUARD_PAGE_VIOLATION      0x80000001    
-#define STATUS_DATATYPE_MISALIGNMENT     0x80000002
-#define STATUS_BREAKPOINT                0x80000003
-#define STATUS_SINGLE_STEP               0x80000004
-#define        STATUS_BUFFER_OVERFLOW           0x80000005
-#define STATUS_NO_MORE_FILES             0x80000006
-#define STATUS_WAKE_SYSTEM_DEBUGGER      0x80000007
-
-#define STATUS_HANDLES_CLOSED            0x8000000A
-#define STATUS_NO_INHERITANCE            0x8000000B
-#define STATUS_GUID_SUBSTITUTION_MADE    0x8000000C
-#define STATUS_PARTIAL_COPY              0x8000000D
-#define STATUS_DEVICE_PAPER_EMPTY        0x8000000E
-#define STATUS_DEVICE_POWERED_OFF        0x8000000F
-#define STATUS_DEVICE_OFF_LINE           0x80000010
-#define STATUS_DEVICE_BUSY               0x80000011
-#define STATUS_NO_MORE_EAS               0x80000012
-#define STATUS_INVALID_EA_NAME           0x80000013
-#define STATUS_EA_LIST_INCONSISTENT      0x80000014
-#define STATUS_INVALID_EA_FLAG           0x80000015
-#define STATUS_VERIFY_REQUIRED           0x80000016
-#define STATUS_EXTRANEOUS_INFORMATION    0x80000017
-#define STATUS_RXACT_COMMIT_NECESSARY    0x80000018
-#define STATUS_NO_MORE_ENTRIES           0x8000001A
-#define STATUS_FILEMARK_DETECTED         0x8000001B
-#define STATUS_MEDIA_CHANGED             0x8000001C
-#define STATUS_BUS_RESET                 0x8000001D
-#define STATUS_END_OF_MEDIA              0x8000001E
-#define STATUS_BEGINNING_OF_MEDIA        0x8000001F
-#define STATUS_MEDIA_CHECK               0x80000020
-#define STATUS_SETMARK_DETECTED          0x80000021
-#define STATUS_NO_DATA_DETECTED          0x80000022
-#define STATUS_REDIRECTOR_HAS_OPEN_HANDLES 0x80000023
-#define STATUS_SERVER_HAS_OPEN_HANDLES   0x80000024
-#define STATUS_ALREADY_DISCONNECTED      0x80000025
-#define STATUS_LONGJUMP                  0x80000026
-
-#define STATUS_UNSUCCESSFUL              0xC0000001
-#define STATUS_NOT_IMPLEMENTED           0xC0000002
-#define STATUS_INVALID_INFO_CLASS        0xC0000003
-#define STATUS_INFO_LENGTH_MISMATCH      0xC0000004
-#define STATUS_ACCESS_VIOLATION          0xC0000005
-#define STATUS_IN_PAGE_ERROR             0xC0000006
-#define STATUS_PAGEFILE_QUOTA            0xC0000007
-#define STATUS_INVALID_HANDLE            0xC0000008
-#define STATUS_BAD_INITIAL_STACK         0xC0000009
-#define STATUS_BAD_INITIAL_PC            0xC000000A
-#define STATUS_INVALID_CID               0xC000000B
-#define STATUS_TIMER_NOT_CANCELED        0xC000000C
-#define STATUS_INVALID_PARAMETER         0xC000000D
-#define STATUS_NO_SUCH_DEVICE            0xC000000E
-#define STATUS_NO_SUCH_FILE              0xC000000F
-#define STATUS_INVALID_DEVICE_REQUEST    0xC0000010
-#define STATUS_END_OF_FILE               0xC0000011
-#define STATUS_WRONG_VOLUME              0xC0000012
-#define STATUS_NO_MEDIA_IN_DEVICE        0xC0000013
-#define STATUS_UNRECOGNIZED_MEDIA        0xC0000014
-#define STATUS_NONEXISTENT_SECTOR        0xC0000015
-#define STATUS_MORE_PROCESSING_REQUIRED  0xC0000016
-#define STATUS_NO_MEMORY                 0xC0000017
-#define STATUS_CONFLICTING_ADDRESSES     0xC0000018
-#define STATUS_NOT_MAPPED_VIEW           0xC0000019
-#define STATUS_UNABLE_TO_FREE_VM         0xC000001A
-#define STATUS_UNABLE_TO_DELETE_SECTION  0xC000001B
-#define STATUS_INVALID_SYSTEM_SERVICE    0xC000001C
-#define STATUS_ILLEGAL_INSTRUCTION       0xC000001D
-#define STATUS_INVALID_LOCK_SEQUENCE     0xC000001E
-#define STATUS_INVALID_VIEW_SIZE         0xC000001F
-#define STATUS_INVALID_FILE_FOR_SECTION  0xC0000020
-#define STATUS_ALREADY_COMMITTED         0xC0000021
-#define STATUS_ACCESS_DENIED             0xC0000022
-#define        STATUS_BUFFER_TOO_SMALL          0xC0000023
-#define STATUS_OBJECT_TYPE_MISMATCH      0xC0000024
-#define STATUS_NONCONTINUABLE_EXCEPTION  0xC0000025
-#define STATUS_INVALID_DISPOSITION       0xC0000026
-#define STATUS_UNWIND                    0xC0000027
-#define STATUS_BAD_STACK                 0xC0000028
-#define STATUS_INVALID_UNWIND_TARGET     0xC0000029
-#define STATUS_NOT_LOCKED                0xC000002A
-#define STATUS_PARITY_ERROR              0xC000002B
-#define STATUS_UNABLE_TO_DECOMMIT_VM     0xC000002C
-#define STATUS_NOT_COMMITTED             0xC000002D
-#define STATUS_INVALID_PORT_ATTRIBUTES   0xC000002E
-#define STATUS_PORT_MESSAGE_TOO_LONG     0xC000002F
-#define STATUS_INVALID_PARAMETER_MIX     0xC0000030
-#define STATUS_INVALID_QUOTA_LOWER       0xC0000031
-#define STATUS_DISK_CORRUPT_ERROR        0xC0000032
-#define STATUS_OBJECT_NAME_INVALID       0xC0000033
-#define STATUS_OBJECT_NAME_NOT_FOUND     0xC0000034
-#define STATUS_OBJECT_NAME_COLLISION     0xC0000035
-#define STATUS_PORT_DISCONNECTED         0xC0000037
-#define STATUS_DEVICE_ALREADY_ATTACHED   0xC0000038
-#define STATUS_OBJECT_PATH_INVALID       0xC0000039
-#define STATUS_OBJECT_PATH_NOT_FOUND     0xC000003A
-#define STATUS_PATH_SYNTAX_BAD           0xC000003B
-#define STATUS_DATA_OVERRUN              0xC000003C
-#define STATUS_DATA_LATE_ERROR           0xC000003D
-#define STATUS_DATA_ERROR                0xC000003E
-#define STATUS_CRC_ERROR                 0xC000003F
-#define STATUS_SECTION_TOO_BIG           0xC0000040
-#define STATUS_PORT_CONNECTION_REFUSED   0xC0000041
-#define STATUS_INVALID_PORT_HANDLE       0xC0000042
-#define STATUS_SHARING_VIOLATION         0xC0000043
-#define STATUS_QUOTA_EXCEEDED            0xC0000044
-#define STATUS_INVALID_PAGE_PROTECTION   0xC0000045
-#define STATUS_MUTANT_NOT_OWNED          0xC0000046
-#define STATUS_SEMAPHORE_LIMIT_EXCEEDED  0xC0000047
-#define STATUS_PORT_ALREADY_SET          0xC0000048
-#define STATUS_SUSPEND_COUNT_EXCEEDED    0xC000004A
-#define STATUS_LOCK_NOT_GRANTED          0xC0000054  /* FIXME: not sure */
-#define STATUS_FILE_LOCK_CONFLICT        0xC0000055  /* FIXME: not sure */
-#define        STATUS_UNKNOWN_REVISION          0xC0000058
-#define        STATUS_INVALID_SECURITY_DESCR    0xC0000079
-#define STATUS_DISK_FULL                 0xC000007F 
-#define STATUS_SECTION_NOT_EXTENDED      0xC0000087
-#define STATUS_ARRAY_BOUNDS_EXCEEDED     0xC000008C
-#define STATUS_FLOAT_DENORMAL_OPERAND    0xC000008D
-#define STATUS_FLOAT_DIVIDE_BY_ZERO      0xC000008E
-#define STATUS_FLOAT_INEXACT_RESULT      0xC000008F
-#define STATUS_FLOAT_INVALID_OPERATION   0xC0000090
-#define STATUS_FLOAT_OVERFLOW            0xC0000091
-#define STATUS_FLOAT_STACK_CHECK         0xC0000092
-#define STATUS_FLOAT_UNDERFLOW           0xC0000093
-#define STATUS_INTEGER_DIVIDE_BY_ZERO    0xC0000094
-#define STATUS_INTEGER_OVERFLOW          0xC0000095
-#define STATUS_PRIVILEGED_INSTRUCTION    0xC0000096
-#define STATUS_MEDIA_WRITE_PROTECTED     0XC00000A2
-#define        STATUS_INVALID_PARAMETER_2       0xC00000F0
-#define STATUS_STACK_OVERFLOW            0xC00000FD
-#define STATUS_DIRECTORY_NOT_EMPTY       0xC0000101
-#define STATUS_TOO_MANY_OPENED_FILES     0xC000011F
-#define STATUS_CONTROL_C_EXIT            0xC000013A
-#define STATUS_PIPE_BROKEN               0xC000014B
-#define STATUS_NOT_REGISTRY_FILE         0xC000015C
-#define STATUS_PARTITION_FAILURE         0xC0000172
-#define STATUS_INVALID_BLOCK_LENGTH      0xC0000173
-#define STATUS_DEVICE_NOT_PARTITIONED    0xC0000174
-#define STATUS_UNABLE_TO_LOCK_MEDIA      0xC0000175
-#define STATUS_UNABLE_TO_UNLOAD_MEDIA    0xC0000176
-#define STATUS_EOM_OVERFLOW              0xC0000177
-#define STATUS_NO_MEDIA                  0xC0000178
-#define STATUS_NO_SUCH_MEMBER            0xC000017A
-#define STATUS_INVALID_MEMBER            0xC000017B
-#define STATUS_KEY_DELETED               0xC000017C
-#define STATUS_NO_LOG_SPACE              0xC000017D
-#define STATUS_TOO_MANY_SIDS             0xC000017E
-#define STATUS_LM_CROSS_ENCRYPTION_REQUIRED 0xC000017F
-#define STATUS_KEY_HAS_CHILDREN          0xC0000180
-#define STATUS_CHILD_MUST_BE_VOLATILE    0xC0000181
-#define STATUS_DEVICE_CONFIGURATION_ERROR0xC0000182
-#define STATUS_DRIVER_INTERNAL_ERROR     0xC0000183
-#define STATUS_INVALID_DEVICE_STATE      0xC0000184
-#define STATUS_IO_DEVICE_ERROR           0xC0000185
-#define STATUS_DEVICE_PROTOCOL_ERROR     0xC0000186
-#define STATUS_BACKUP_CONTROLLER         0xC0000187
-#define STATUS_LOG_FILE_FULL             0xC0000188
-#define STATUS_TOO_LATE                  0xC0000189
-#define STATUS_NO_TRUST_LSA_SECRET       0xC000018A
-#define STATUS_NO_TRUST_SAM_ACCOUNT      0xC000018B
-#define STATUS_TRUSTED_DOMAIN_FAILURE    0xC000018C
-#define STATUS_TRUSTED_RELATIONSHIP_FAILURE 0xC000018D
-#define STATUS_EVENTLOG_FILE_CORRUPT     0xC000018E
-#define STATUS_EVENTLOG_CANT_START       0xC000018F
-#define STATUS_TRUST_FAILURE             0xC0000190
-#define STATUS_MUTANT_LIMIT_EXCEEDED     0xC0000191
-#define STATUS_NETLOGON_NOT_STARTED      0xC0000192
-#define STATUS_ACCOUNT_EXPIRED           0xC0000193
-#define STATUS_POSSIBLE_DEADLOCK         0xC0000194
-#define STATUS_NETWORK_CREDENTIAL_CONFLICT 0xC0000195
-#define STATUS_REMOTE_SESSION_LIMIT      0xC0000196
-#define STATUS_EVENTLOG_FILE_CHANGED     0xC0000197
-#define STATUS_NOLOGON_INTERDOMAIN_TRUST_ACCOUNT 0xC0000198
-#define STATUS_NOLOGON_WORKSTATION_TRUST_ACCOUNT 0xC0000199
-#define STATUS_NOLOGON_SERVER_TRUST_ACCOUNT 0xC000019A
-#define STATUS_DOMAIN_TRUST_INCONSISTENT 0xC000019B
-#define STATUS_FS_DRIVER_REQUIRED        0xC000019C
-
-#define STATUS_RESOURCE_LANG_NOT_FOUND   0xC0000204
-
-#define MAXIMUM_WAIT_OBJECTS 64
-#define MAXIMUM_SUSPEND_COUNT 127
-
-
-/*
- * Return values from the actual exception handlers
- */
-
-#define ExceptionContinueExecution 0
-#define ExceptionContinueSearch    1
-#define ExceptionNestedException   2
-#define ExceptionCollidedUnwind    3
-/*
- * Return values from filters in except() and from UnhandledExceptionFilter
- */
-#define EXCEPTION_EXECUTE_HANDLER        1
-#define EXCEPTION_CONTINUE_SEARCH        0
-#define EXCEPTION_CONTINUE_EXECUTION    -1
-
-/*
- * From OS/2 2.0 exception handling
- * Win32 seems to use the same flags as ExceptionFlags in an EXCEPTION_RECORD
- */
-
-#define EH_NONCONTINUABLE   0x01
-#define EH_UNWINDING        0x02
-#define EH_EXIT_UNWIND      0x04
-#define EH_STACK_INVALID    0x08
-#define EH_NESTED_CALL      0x10
-
-#define EXCEPTION_CONTINUABLE        0
-#define EXCEPTION_NONCONTINUABLE     EH_NONCONTINUABLE
-/*
- * The exception record used by Win32 to give additional information 
- * about exception to exception handlers.
- */
-
-#define EXCEPTION_MAXIMUM_PARAMETERS 15
-
-typedef struct __EXCEPTION_RECORD
-{
-    DWORD    ExceptionCode;
-    DWORD    ExceptionFlags;
-    struct __EXCEPTION_RECORD *ExceptionRecord;
-
-    LPVOID   ExceptionAddress;
-    DWORD    NumberParameters;
-    DWORD    ExceptionInformation[EXCEPTION_MAXIMUM_PARAMETERS];
-} EXCEPTION_RECORD, *PEXCEPTION_RECORD;
-
-/*
- * The exception pointers structure passed to exception filters
- * in except() and the UnhandledExceptionFilter().
- */
-typedef struct _EXCEPTION_POINTERS 
-{
-  PEXCEPTION_RECORD  ExceptionRecord;
-  PCONTEXT           ContextRecord;
-} EXCEPTION_POINTERS, *PEXCEPTION_POINTERS;
-
-
-/*
- * The exception frame, used for registering exception handlers 
- * Win32 cares only about this, but compilers generally emit 
- * larger exception frames for their own use.
- */
-
-struct __EXCEPTION_FRAME;
-
-typedef DWORD (*PEXCEPTION_HANDLER)(PEXCEPTION_RECORD,struct __EXCEPTION_FRAME*,
-                                    PCONTEXT,struct __EXCEPTION_FRAME **);
-
-typedef struct __EXCEPTION_FRAME
-{
-  struct __EXCEPTION_FRAME *Prev;
-  PEXCEPTION_HANDLER       Handler;
-} EXCEPTION_FRAME, *PEXCEPTION_FRAME;
-
-#include "poppack.h"
-
-/*
- * function pointer to a exception filter
- */
-
-typedef LONG CALLBACK (*PTOP_LEVEL_EXCEPTION_FILTER)(PEXCEPTION_POINTERS ExceptionInfo);
-typedef PTOP_LEVEL_EXCEPTION_FILTER LPTOP_LEVEL_EXCEPTION_FILTER;
-
-DWORD WINAPI UnhandledExceptionFilter( PEXCEPTION_POINTERS epointers );
-LPTOP_LEVEL_EXCEPTION_FILTER
-WINAPI SetUnhandledExceptionFilter( LPTOP_LEVEL_EXCEPTION_FILTER filter );
-
-/* status values for ContinueDebugEvent */
-#define DBG_CONTINUE                0x00010002
-#define DBG_TERMINATE_THREAD        0x40010003
-#define DBG_TERMINATE_PROCESS       0x40010004
-#define DBG_CONTROL_C               0x40010005
-#define DBG_CONTROL_BREAK           0x40010008
-#define DBG_EXCEPTION_NOT_HANDLED   0x80010001
-
-typedef struct _NT_TIB 
-{
-       struct _EXCEPTION_REGISTRATION_RECORD *ExceptionList;
-       PVOID StackBase;
-       PVOID StackLimit;
-       PVOID SubSystemTib;
-       union {
-          PVOID FiberData;
-          DWORD Version;
-       } DUMMYUNIONNAME;
-       PVOID ArbitraryUserPointer;
-       struct _NT_TIB *Self;
-} NT_TIB, *PNT_TIB;
-
-struct _TEB;
-/*
-#if defined(__i386__) && defined(__GNUC__)
-extern inline struct _TEB * WINAPI NtCurrentTeb(void);
-extern inline struct _TEB * WINAPI NtCurrentTeb(void)
-{
-    struct _TEB *teb;
-    __asm__(".byte 0x64\n\tmovl (0x18),%0" : "=r" (teb));
-    return teb;
-}
-#else
-extern struct _TEB * WINAPI NtCurrentTeb(void);
-#endif
-*/
-
-/*
- * File formats definitions
- */
-
-typedef struct _IMAGE_DOS_HEADER {
-    WORD  e_magic;      /* 00: MZ Header signature */
-    WORD  e_cblp;       /* 02: Bytes on last page of file */
-    WORD  e_cp;         /* 04: Pages in file */
-    WORD  e_crlc;       /* 06: Relocations */
-    WORD  e_cparhdr;    /* 08: Size of header in paragraphs */
-    WORD  e_minalloc;   /* 0a: Minimum extra paragraphs needed */
-    WORD  e_maxalloc;   /* 0c: Maximum extra paragraphs needed */
-    WORD  e_ss;         /* 0e: Initial (relative) SS value */
-    WORD  e_sp;         /* 10: Initial SP value */
-    WORD  e_csum;       /* 12: Checksum */
-    WORD  e_ip;         /* 14: Initial IP value */
-    WORD  e_cs;         /* 16: Initial (relative) CS value */
-    WORD  e_lfarlc;     /* 18: File address of relocation table */
-    WORD  e_ovno;       /* 1a: Overlay number */
-    WORD  e_res[4];     /* 1c: Reserved words */
-    WORD  e_oemid;      /* 24: OEM identifier (for e_oeminfo) */
-    WORD  e_oeminfo;    /* 26: OEM information; e_oemid specific */
-    WORD  e_res2[10];   /* 28: Reserved words */
-    DWORD e_lfanew;     /* 3c: Offset to extended header */
-} IMAGE_DOS_HEADER, *PIMAGE_DOS_HEADER;
-
-#define IMAGE_DOS_SIGNATURE    0x5A4D     /* MZ   */
-#define IMAGE_OS2_SIGNATURE    0x454E     /* NE   */
-#define IMAGE_OS2_SIGNATURE_LE 0x454C     /* LE   */
-#define IMAGE_OS2_SIGNATURE_LX 0x584C     /* LX */
-#define IMAGE_VXD_SIGNATURE    0x454C     /* LE   */
-#define IMAGE_NT_SIGNATURE     0x00004550 /* PE00 */
-
-/*
- * This is the Windows executable (NE) header.
- * the name IMAGE_OS2_HEADER is misleading, but in the SDK this way.
- */
-typedef struct 
-{
-    WORD  ne_magic;             /* 00 NE signature 'NE' */
-    BYTE  ne_ver;               /* 02 Linker version number */
-    BYTE  ne_rev;               /* 03 Linker revision number */
-    WORD  ne_enttab;            /* 04 Offset to entry table relative to NE */
-    WORD  ne_cbenttab;          /* 06 Length of entry table in bytes */
-    LONG  ne_crc;               /* 08 Checksum */
-    WORD  ne_flags;             /* 0c Flags about segments in this file */
-    WORD  ne_autodata;          /* 0e Automatic data segment number */
-    WORD  ne_heap;              /* 10 Initial size of local heap */
-    WORD  ne_stack;             /* 12 Initial size of stack */
-    DWORD ne_csip;              /* 14 Initial CS:IP */
-    DWORD ne_sssp;              /* 18 Initial SS:SP */
-    WORD  ne_cseg;              /* 1c # of entries in segment table */
-    WORD  ne_cmod;              /* 1e # of entries in module reference tab. */
-    WORD  ne_cbnrestab;         /* 20 Length of nonresident-name table     */
-    WORD  ne_segtab;            /* 22 Offset to segment table */
-    WORD  ne_rsrctab;           /* 24 Offset to resource table */
-    WORD  ne_restab;            /* 26 Offset to resident-name table */
-    WORD  ne_modtab;            /* 28 Offset to module reference table */
-    WORD  ne_imptab;            /* 2a Offset to imported name table */
-    DWORD ne_nrestab;           /* 2c Offset to nonresident-name table */
-    WORD  ne_cmovent;           /* 30 # of movable entry points */
-    WORD  ne_align;             /* 32 Logical sector alignment shift count */
-    WORD  ne_cres;              /* 34 # of resource segments */
-    BYTE  ne_exetyp;            /* 36 Flags indicating target OS */
-    BYTE  ne_flagsothers;       /* 37 Additional information flags */
-    WORD  fastload_offset;      /* 38 Offset to fast load area (should be ne_pretthunks)*/
-    WORD  fastload_length;      /* 3a Length of fast load area (should be ne_psegrefbytes) */
-    WORD  ne_swaparea;          /* 3c Reserved by Microsoft */
-    WORD  ne_expver;            /* 3e Expected Windows version number */
-} IMAGE_OS2_HEADER,*PIMAGE_OS2_HEADER;
-
-typedef struct _IMAGE_VXD_HEADER {
-  WORD  e32_magic;
-  BYTE  e32_border;
-  BYTE  e32_worder;
-  DWORD e32_level;
-  WORD  e32_cpu;
-  WORD  e32_os;
-  DWORD e32_ver;
-  DWORD e32_mflags;
-  DWORD e32_mpages;
-  DWORD e32_startobj;
-  DWORD e32_eip;
-  DWORD e32_stackobj;
-  DWORD e32_esp;
-  DWORD e32_pagesize;
-  DWORD e32_lastpagesize;
-  DWORD e32_fixupsize;
-  DWORD e32_fixupsum;
-  DWORD e32_ldrsize;
-  DWORD e32_ldrsum;
-  DWORD e32_objtab;
-  DWORD e32_objcnt;
-  DWORD e32_objmap;
-  DWORD e32_itermap;
-  DWORD e32_rsrctab;
-  DWORD e32_rsrccnt;
-  DWORD e32_restab;
-  DWORD e32_enttab;
-  DWORD e32_dirtab;
-  DWORD e32_dircnt;
-  DWORD e32_fpagetab;
-  DWORD e32_frectab;
-  DWORD e32_impmod;
-  DWORD e32_impmodcnt;
-  DWORD e32_impproc;
-  DWORD e32_pagesum;
-  DWORD e32_datapage;
-  DWORD e32_preload;
-  DWORD e32_nrestab;
-  DWORD e32_cbnrestab;
-  DWORD e32_nressum;
-  DWORD e32_autodata;
-  DWORD e32_debuginfo;
-  DWORD e32_debuglen;
-  DWORD e32_instpreload;
-  DWORD e32_instdemand;
-  DWORD e32_heapsize;
-  BYTE   e32_res3[12];
-  DWORD e32_winresoff;
-  DWORD e32_winreslen;
-  WORD  e32_devid;
-  WORD  e32_ddkver;
-} IMAGE_VXD_HEADER, *PIMAGE_VXD_HEADER;
-
-
-/* These defines describe the meanings of the bits in the Characteristics
-   field */
-
-#define IMAGE_FILE_RELOCS_STRIPPED     0x0001 /* No relocation info */
-#define IMAGE_FILE_EXECUTABLE_IMAGE    0x0002
-#define IMAGE_FILE_LINE_NUMS_STRIPPED   0x0004
-#define IMAGE_FILE_LOCAL_SYMS_STRIPPED  0x0008
-#define IMAGE_FILE_16BIT_MACHINE       0x0040
-#define IMAGE_FILE_BYTES_REVERSED_LO   0x0080
-#define IMAGE_FILE_32BIT_MACHINE       0x0100
-#define IMAGE_FILE_DEBUG_STRIPPED      0x0200
-#define IMAGE_FILE_SYSTEM              0x1000
-#define IMAGE_FILE_DLL                 0x2000
-#define IMAGE_FILE_BYTES_REVERSED_HI   0x8000
-
-/* These are the settings of the Machine field. */
-#define        IMAGE_FILE_MACHINE_UNKNOWN      0
-#define        IMAGE_FILE_MACHINE_I860         0x14d
-#define        IMAGE_FILE_MACHINE_I386         0x14c
-#define        IMAGE_FILE_MACHINE_R3000        0x162
-#define        IMAGE_FILE_MACHINE_R4000        0x166
-#define        IMAGE_FILE_MACHINE_R10000       0x168
-#define        IMAGE_FILE_MACHINE_ALPHA        0x184
-#define        IMAGE_FILE_MACHINE_POWERPC      0x1F0  
-
-#define        IMAGE_SIZEOF_FILE_HEADER        20
-
-/* Possible Magic values */
-#define IMAGE_NT_OPTIONAL_HDR_MAGIC        0x10b
-#define IMAGE_ROM_OPTIONAL_HDR_MAGIC       0x107
-
-/* These are indexes into the DataDirectory array */
-#define IMAGE_FILE_EXPORT_DIRECTORY            0
-#define IMAGE_FILE_IMPORT_DIRECTORY            1
-#define IMAGE_FILE_RESOURCE_DIRECTORY          2
-#define IMAGE_FILE_EXCEPTION_DIRECTORY         3
-#define IMAGE_FILE_SECURITY_DIRECTORY          4
-#define IMAGE_FILE_BASE_RELOCATION_TABLE       5
-#define IMAGE_FILE_DEBUG_DIRECTORY             6
-#define IMAGE_FILE_DESCRIPTION_STRING          7
-#define IMAGE_FILE_MACHINE_VALUE               8  /* Mips */
-#define IMAGE_FILE_THREAD_LOCAL_STORAGE                9
-#define IMAGE_FILE_CALLBACK_DIRECTORY          10
-
-/* Directory Entries, indices into the DataDirectory array */
-
-#define        IMAGE_DIRECTORY_ENTRY_EXPORT            0
-#define        IMAGE_DIRECTORY_ENTRY_IMPORT            1
-#define        IMAGE_DIRECTORY_ENTRY_RESOURCE          2
-#define        IMAGE_DIRECTORY_ENTRY_EXCEPTION         3
-#define        IMAGE_DIRECTORY_ENTRY_SECURITY          4
-#define        IMAGE_DIRECTORY_ENTRY_BASERELOC         5
-#define        IMAGE_DIRECTORY_ENTRY_DEBUG             6
-#define        IMAGE_DIRECTORY_ENTRY_COPYRIGHT         7
-#define        IMAGE_DIRECTORY_ENTRY_GLOBALPTR         8   /* (MIPS GP) */
-#define        IMAGE_DIRECTORY_ENTRY_TLS               9
-#define        IMAGE_DIRECTORY_ENTRY_LOAD_CONFIG       10
-#define        IMAGE_DIRECTORY_ENTRY_BOUND_IMPORT      11
-#define        IMAGE_DIRECTORY_ENTRY_IAT               12  /* Import Address Table */
-#define        IMAGE_DIRECTORY_ENTRY_DELAY_IMPORT      13
-#define        IMAGE_DIRECTORY_ENTRY_COM_DESCRIPTOR    14
-
-/* Subsystem Values */
-
-#define        IMAGE_SUBSYSTEM_UNKNOWN         0
-#define        IMAGE_SUBSYSTEM_NATIVE          1
-#define        IMAGE_SUBSYSTEM_WINDOWS_GUI     2       /* Windows GUI subsystem */
-#define        IMAGE_SUBSYSTEM_WINDOWS_CUI     3       /* Windows character subsystem*/
-#define        IMAGE_SUBSYSTEM_OS2_CUI         5
-#define        IMAGE_SUBSYSTEM_POSIX_CUI       7
-
-typedef struct _IMAGE_FILE_HEADER {
-  WORD  Machine;
-  WORD  NumberOfSections;
-  DWORD TimeDateStamp;
-  DWORD PointerToSymbolTable;
-  DWORD NumberOfSymbols;
-  WORD  SizeOfOptionalHeader;
-  WORD  Characteristics;
-} IMAGE_FILE_HEADER, *PIMAGE_FILE_HEADER;
-
-typedef struct _IMAGE_DATA_DIRECTORY {
-  DWORD VirtualAddress;
-  DWORD Size;
-} IMAGE_DATA_DIRECTORY, *PIMAGE_DATA_DIRECTORY;
-
-#define IMAGE_NUMBEROF_DIRECTORY_ENTRIES 16
-
-typedef struct _IMAGE_OPTIONAL_HEADER {
-
-  /* Standard fields */
-
-  WORD  Magic;
-  BYTE  MajorLinkerVersion;
-  BYTE  MinorLinkerVersion;
-  DWORD SizeOfCode;
-  DWORD SizeOfInitializedData;
-  DWORD SizeOfUninitializedData;
-  DWORD AddressOfEntryPoint;
-  DWORD BaseOfCode;
-  DWORD BaseOfData;
-
-  /* NT additional fields */
-
-  DWORD ImageBase;
-  DWORD SectionAlignment;
-  DWORD FileAlignment;
-  WORD  MajorOperatingSystemVersion;
-  WORD  MinorOperatingSystemVersion;
-  WORD  MajorImageVersion;
-  WORD  MinorImageVersion;
-  WORD  MajorSubsystemVersion;
-  WORD  MinorSubsystemVersion;
-  DWORD Win32VersionValue;
-  DWORD SizeOfImage;
-  DWORD SizeOfHeaders;
-  DWORD CheckSum;
-  WORD  Subsystem;
-  WORD  DllCharacteristics;
-  DWORD SizeOfStackReserve;
-  DWORD SizeOfStackCommit;
-  DWORD SizeOfHeapReserve;
-  DWORD SizeOfHeapCommit;
-  DWORD LoaderFlags;
-  DWORD NumberOfRvaAndSizes;
-  IMAGE_DATA_DIRECTORY DataDirectory[IMAGE_NUMBEROF_DIRECTORY_ENTRIES];
-} IMAGE_OPTIONAL_HEADER, *PIMAGE_OPTIONAL_HEADER;
-
-typedef struct _IMAGE_NT_HEADERS {
-  DWORD Signature;
-  IMAGE_FILE_HEADER FileHeader;
-  IMAGE_OPTIONAL_HEADER OptionalHeader;
-} IMAGE_NT_HEADERS, *PIMAGE_NT_HEADERS;
-
-#define IMAGE_SIZEOF_SHORT_NAME 8
-
-typedef struct _IMAGE_SECTION_HEADER {
-  BYTE  Name[IMAGE_SIZEOF_SHORT_NAME];
-  union {
-    DWORD PhysicalAddress;
-    DWORD VirtualSize;
-  } Misc;
-  DWORD VirtualAddress;
-  DWORD SizeOfRawData;
-  DWORD PointerToRawData;
-  DWORD PointerToRelocations;
-  DWORD PointerToLinenumbers;
-  WORD  NumberOfRelocations;
-  WORD  NumberOfLinenumbers;
-  DWORD Characteristics;
-} IMAGE_SECTION_HEADER, *PIMAGE_SECTION_HEADER;
-
-#define        IMAGE_SIZEOF_SECTION_HEADER 40
-
-#define IMAGE_FIRST_SECTION(ntheader) \
-  ((PIMAGE_SECTION_HEADER)((LPBYTE)&((PIMAGE_NT_HEADERS)(ntheader))->OptionalHeader + \
-                           ((PIMAGE_NT_HEADERS)(ntheader))->FileHeader.SizeOfOptionalHeader))
-
-/* These defines are for the Characteristics bitfield. */
-/* #define IMAGE_SCN_TYPE_REG                  0x00000000 - Reserved */
-/* #define IMAGE_SCN_TYPE_DSECT                        0x00000001 - Reserved */
-/* #define IMAGE_SCN_TYPE_NOLOAD               0x00000002 - Reserved */
-/* #define IMAGE_SCN_TYPE_GROUP                        0x00000004 - Reserved */
-/* #define IMAGE_SCN_TYPE_NO_PAD               0x00000008 - Reserved */
-/* #define IMAGE_SCN_TYPE_COPY                 0x00000010 - Reserved */
-
-#define IMAGE_SCN_CNT_CODE                     0x00000020
-#define IMAGE_SCN_CNT_INITIALIZED_DATA         0x00000040
-#define IMAGE_SCN_CNT_UNINITIALIZED_DATA       0x00000080
-
-#define        IMAGE_SCN_LNK_OTHER                     0x00000100 
-#define        IMAGE_SCN_LNK_INFO                      0x00000200  
-/* #define     IMAGE_SCN_TYPE_OVER             0x00000400 - Reserved */
-#define        IMAGE_SCN_LNK_REMOVE                    0x00000800
-#define        IMAGE_SCN_LNK_COMDAT                    0x00001000
-
-/*                                             0x00002000 - Reserved */
-/* #define IMAGE_SCN_MEM_PROTECTED             0x00004000 - Obsolete */
-#define        IMAGE_SCN_MEM_FARDATA                   0x00008000
-
-/* #define IMAGE_SCN_MEM_SYSHEAP               0x00010000 - Obsolete */
-#define        IMAGE_SCN_MEM_PURGEABLE                 0x00020000
-#define        IMAGE_SCN_MEM_16BIT                     0x00020000
-#define        IMAGE_SCN_MEM_LOCKED                    0x00040000
-#define        IMAGE_SCN_MEM_PRELOAD                   0x00080000
-
-#define        IMAGE_SCN_ALIGN_1BYTES                  0x00100000
-#define        IMAGE_SCN_ALIGN_2BYTES                  0x00200000
-#define        IMAGE_SCN_ALIGN_4BYTES                  0x00300000
-#define        IMAGE_SCN_ALIGN_8BYTES                  0x00400000
-#define        IMAGE_SCN_ALIGN_16BYTES                 0x00500000  /* Default */
-#define IMAGE_SCN_ALIGN_32BYTES                        0x00600000
-#define IMAGE_SCN_ALIGN_64BYTES                        0x00700000
-/*                                             0x00800000 - Unused */
-
-#define IMAGE_SCN_LNK_NRELOC_OVFL              0x01000000
-
-
-#define IMAGE_SCN_MEM_DISCARDABLE              0x02000000
-#define IMAGE_SCN_MEM_NOT_CACHED               0x04000000
-#define IMAGE_SCN_MEM_NOT_PAGED                        0x08000000
-#define IMAGE_SCN_MEM_SHARED                   0x10000000
-#define IMAGE_SCN_MEM_EXECUTE                  0x20000000
-#define IMAGE_SCN_MEM_READ                     0x40000000
-#define IMAGE_SCN_MEM_WRITE                    0x80000000
-
-#include "pshpack2.h"
-
-typedef struct _IMAGE_SYMBOL {
-    union {
-        BYTE    ShortName[8];
-        struct {
-            DWORD   Short;
-            DWORD   Long;
-        } Name;
-        DWORD   LongName[2];
-    } N;
-    DWORD   Value;
-    SHORT   SectionNumber;
-    WORD    Type;
-    BYTE    StorageClass;
-    BYTE    NumberOfAuxSymbols;
-} IMAGE_SYMBOL;
-typedef IMAGE_SYMBOL *PIMAGE_SYMBOL;
-
-#define IMAGE_SIZEOF_SYMBOL 18
-
-typedef struct _IMAGE_LINENUMBER {
-    union {
-        DWORD   SymbolTableIndex;
-        DWORD   VirtualAddress;
-    } Type;
-    WORD    Linenumber;
-} IMAGE_LINENUMBER;
-typedef IMAGE_LINENUMBER *PIMAGE_LINENUMBER;
-
-#define IMAGE_SIZEOF_LINENUMBER  6
-
-typedef union _IMAGE_AUX_SYMBOL {
-    struct {
-        DWORD    TagIndex;
-        union {
-            struct {
-                WORD    Linenumber;
-                WORD    Size;
-            } LnSz;
-           DWORD    TotalSize;
-        } Misc;
-        union {
-            struct {
-                DWORD    PointerToLinenumber;
-                DWORD    PointerToNextFunction;
-            } Function;
-            struct {
-                WORD     Dimension[4];
-            } Array;
-        } FcnAry;
-        WORD    TvIndex;
-    } Sym;
-    struct {
-        BYTE    Name[IMAGE_SIZEOF_SYMBOL];
-    } File;
-    struct {
-        DWORD   Length;
-        WORD    NumberOfRelocations;
-        WORD    NumberOfLinenumbers;
-        DWORD   CheckSum;
-        SHORT   Number;
-        BYTE    Selection;
-    } Section;
-} IMAGE_AUX_SYMBOL;
-typedef IMAGE_AUX_SYMBOL *PIMAGE_AUX_SYMBOL;
-
-#define IMAGE_SIZEOF_AUX_SYMBOL 18
-
-#include "poppack.h"
-
-#define IMAGE_SYM_UNDEFINED           (SHORT)0
-#define IMAGE_SYM_ABSOLUTE            (SHORT)-1
-#define IMAGE_SYM_DEBUG               (SHORT)-2
-
-#define IMAGE_SYM_TYPE_NULL                 0x0000
-#define IMAGE_SYM_TYPE_VOID                 0x0001
-#define IMAGE_SYM_TYPE_CHAR                 0x0002
-#define IMAGE_SYM_TYPE_SHORT                0x0003
-#define IMAGE_SYM_TYPE_INT                  0x0004
-#define IMAGE_SYM_TYPE_LONG                 0x0005
-#define IMAGE_SYM_TYPE_FLOAT                0x0006
-#define IMAGE_SYM_TYPE_DOUBLE               0x0007
-#define IMAGE_SYM_TYPE_STRUCT               0x0008
-#define IMAGE_SYM_TYPE_UNION                0x0009
-#define IMAGE_SYM_TYPE_ENUM                 0x000A
-#define IMAGE_SYM_TYPE_MOE                  0x000B
-#define IMAGE_SYM_TYPE_BYTE                 0x000C
-#define IMAGE_SYM_TYPE_WORD                 0x000D
-#define IMAGE_SYM_TYPE_UINT                 0x000E
-#define IMAGE_SYM_TYPE_DWORD                0x000F
-#define IMAGE_SYM_TYPE_PCODE                0x8000
-
-#define IMAGE_SYM_DTYPE_NULL                0
-#define IMAGE_SYM_DTYPE_POINTER             1
-#define IMAGE_SYM_DTYPE_FUNCTION            2
-#define IMAGE_SYM_DTYPE_ARRAY               3
-
-#define IMAGE_SYM_CLASS_END_OF_FUNCTION     (BYTE )-1
-#define IMAGE_SYM_CLASS_NULL                0x0000
-#define IMAGE_SYM_CLASS_AUTOMATIC           0x0001
-#define IMAGE_SYM_CLASS_EXTERNAL            0x0002
-#define IMAGE_SYM_CLASS_STATIC              0x0003
-#define IMAGE_SYM_CLASS_REGISTER            0x0004
-#define IMAGE_SYM_CLASS_EXTERNAL_DEF        0x0005
-#define IMAGE_SYM_CLASS_LABEL               0x0006
-#define IMAGE_SYM_CLASS_UNDEFINED_LABEL     0x0007
-#define IMAGE_SYM_CLASS_MEMBER_OF_STRUCT    0x0008
-#define IMAGE_SYM_CLASS_ARGUMENT            0x0009
-#define IMAGE_SYM_CLASS_STRUCT_TAG          0x000A
-#define IMAGE_SYM_CLASS_MEMBER_OF_UNION     0x000B
-#define IMAGE_SYM_CLASS_UNION_TAG           0x000C
-#define IMAGE_SYM_CLASS_TYPE_DEFINITION     0x000D
-#define IMAGE_SYM_CLASS_UNDEFINED_STATIC    0x000E
-#define IMAGE_SYM_CLASS_ENUM_TAG            0x000F
-#define IMAGE_SYM_CLASS_MEMBER_OF_ENUM      0x0010
-#define IMAGE_SYM_CLASS_REGISTER_PARAM      0x0011
-#define IMAGE_SYM_CLASS_BIT_FIELD           0x0012
-
-#define IMAGE_SYM_CLASS_FAR_EXTERNAL        0x0044
-#define IMAGE_SYM_CLASS_BLOCK               0x0064
-#define IMAGE_SYM_CLASS_FUNCTION            0x0065
-#define IMAGE_SYM_CLASS_END_OF_STRUCT       0x0066
-#define IMAGE_SYM_CLASS_FILE                0x0067
-#define IMAGE_SYM_CLASS_SECTION             0x0068
-#define IMAGE_SYM_CLASS_WEAK_EXTERNAL       0x0069
-
-#define N_BTMASK                            0x000F
-#define N_TMASK                             0x0030
-#define N_TMASK1                            0x00C0
-#define N_TMASK2                            0x00F0
-#define N_BTSHFT                            4
-#define N_TSHIFT                            2
-
-#define BTYPE(x) ((x) & N_BTMASK)
-
-#ifndef ISPTR
-#define ISPTR(x) (((x) & N_TMASK) == (IMAGE_SYM_DTYPE_POINTER << N_BTSHFT))
-#endif
-
-#ifndef ISFCN
-#define ISFCN(x) (((x) & N_TMASK) == (IMAGE_SYM_DTYPE_FUNCTION << N_BTSHFT))
-#endif
-
-#ifndef ISARY
-#define ISARY(x) (((x) & N_TMASK) == (IMAGE_SYM_DTYPE_ARRAY << N_BTSHFT))
-#endif
-
-#ifndef ISTAG
-#define ISTAG(x) ((x)==IMAGE_SYM_CLASS_STRUCT_TAG || (x)==IMAGE_SYM_CLASS_UNION_TAG || (x)==IMAGE_SYM_CLASS_ENUM_TAG)
-#endif
-
-#ifndef INCREF
-#define INCREF(x) ((((x)&~N_BTMASK)<<N_TSHIFT)|(IMAGE_SYM_DTYPE_POINTER<<N_BTSHFT)|((x)&N_BTMASK))
-#endif
-#ifndef DECREF
-#define DECREF(x) ((((x)>>N_TSHIFT)&~N_BTMASK)|((x)&N_BTMASK))
-#endif
-
-#define IMAGE_COMDAT_SELECT_NODUPLICATES    1
-#define IMAGE_COMDAT_SELECT_ANY             2
-#define IMAGE_COMDAT_SELECT_SAME_SIZE       3
-#define IMAGE_COMDAT_SELECT_EXACT_MATCH     4
-#define IMAGE_COMDAT_SELECT_ASSOCIATIVE     5
-#define IMAGE_COMDAT_SELECT_LARGEST         6
-#define IMAGE_COMDAT_SELECT_NEWEST          7
-
-#define IMAGE_WEAK_EXTERN_SEARCH_NOLIBRARY  1
-#define IMAGE_WEAK_EXTERN_SEARCH_LIBRARY    2
-#define IMAGE_WEAK_EXTERN_SEARCH_ALIAS      3
-
-/* Export module directory */
-
-typedef struct _IMAGE_EXPORT_DIRECTORY {
-       DWORD   Characteristics;
-       DWORD   TimeDateStamp;
-       WORD    MajorVersion;
-       WORD    MinorVersion;
-       DWORD   Name;
-       DWORD   Base;
-       DWORD   NumberOfFunctions;
-       DWORD   NumberOfNames;
-       LPDWORD *AddressOfFunctions;
-       LPDWORD *AddressOfNames;
-       LPWORD  *AddressOfNameOrdinals;
-} IMAGE_EXPORT_DIRECTORY,*PIMAGE_EXPORT_DIRECTORY;
-
-/* Import name entry */
-typedef struct _IMAGE_IMPORT_BY_NAME {
-       WORD    Hint;
-       BYTE    Name[1];
-} IMAGE_IMPORT_BY_NAME,*PIMAGE_IMPORT_BY_NAME;
-
-/* Import thunk */
-typedef struct _IMAGE_THUNK_DATA {
-       union {
-               LPBYTE    ForwarderString;
-               FARPROC Function;
-               DWORD     Ordinal;
-               PIMAGE_IMPORT_BY_NAME   AddressOfData;
-       } u1;
-} IMAGE_THUNK_DATA,*PIMAGE_THUNK_DATA;
-
-/* Import module directory */
-
-typedef struct _IMAGE_IMPORT_DESCRIPTOR {
-       union {
-               DWORD   Characteristics; /* 0 for terminating null import descriptor  */
-               PIMAGE_THUNK_DATA OriginalFirstThunk;   /* RVA to original unbound IAT */
-       } u;
-       DWORD   TimeDateStamp;  /* 0 if not bound,
-                                * -1 if bound, and real date\time stamp
-                                *    in IMAGE_DIRECTORY_ENTRY_BOUND_IMPORT
-                                * (new BIND)
-                                * otherwise date/time stamp of DLL bound to
-                                * (Old BIND)
-                                */
-       DWORD   ForwarderChain; /* -1 if no forwarders */
-       DWORD   Name;
-       /* RVA to IAT (if bound this IAT has actual addresses) */
-       PIMAGE_THUNK_DATA FirstThunk;   
-} IMAGE_IMPORT_DESCRIPTOR,*PIMAGE_IMPORT_DESCRIPTOR;
-
-#define        IMAGE_ORDINAL_FLAG              0x80000000
-#define        IMAGE_SNAP_BY_ORDINAL(Ordinal)  ((Ordinal & IMAGE_ORDINAL_FLAG) != 0)
-#define        IMAGE_ORDINAL(Ordinal)          (Ordinal & 0xffff)
-
-typedef struct _IMAGE_BOUND_IMPORT_DESCRIPTOR
-{
-    DWORD   TimeDateStamp;
-    WORD    OffsetModuleName;
-    WORD    NumberOfModuleForwarderRefs;
-/* Array of zero or more IMAGE_BOUND_FORWARDER_REF follows */
-} IMAGE_BOUND_IMPORT_DESCRIPTOR,  *PIMAGE_BOUND_IMPORT_DESCRIPTOR;
-
-typedef struct _IMAGE_BOUND_FORWARDER_REF
-{
-    DWORD   TimeDateStamp;
-    WORD    OffsetModuleName;
-    WORD    Reserved;
-} IMAGE_BOUND_FORWARDER_REF, *PIMAGE_BOUND_FORWARDER_REF;
-
-typedef struct _IMAGE_BASE_RELOCATION
-{
-       DWORD   VirtualAddress;
-       DWORD   SizeOfBlock;
-       WORD    TypeOffset[1];
-} IMAGE_BASE_RELOCATION,*PIMAGE_BASE_RELOCATION;
-
-typedef struct _IMAGE_RELOCATION
-{
-    union {
-        DWORD   VirtualAddress;
-        DWORD   RelocCount;
-    } u;
-    DWORD   SymbolTableIndex;
-    WORD    Type;
-} IMAGE_RELOCATION;
-typedef IMAGE_RELOCATION *PIMAGE_RELOCATION;
-
-#define IMAGE_SIZEOF_RELOCATION 10
-
-/* generic relocation types */
-#define IMAGE_REL_BASED_ABSOLUTE               0
-#define IMAGE_REL_BASED_HIGH                   1
-#define IMAGE_REL_BASED_LOW                    2
-#define IMAGE_REL_BASED_HIGHLOW                        3
-#define IMAGE_REL_BASED_HIGHADJ                        4
-#define IMAGE_REL_BASED_MIPS_JMPADDR           5
-#define IMAGE_REL_BASED_SECTION                        6
-#define        IMAGE_REL_BASED_REL                     7
-#define IMAGE_REL_BASED_MIPS_JMPADDR16         9
-#define IMAGE_REL_BASED_IA64_IMM64             9 /* yes, 9 too */
-#define IMAGE_REL_BASED_DIR64                  10
-#define IMAGE_REL_BASED_HIGH3ADJ               11
-
-/* I386 relocation types */
-#define        IMAGE_REL_I386_ABSOLUTE                 0
-#define        IMAGE_REL_I386_DIR16                    1
-#define        IMAGE_REL_I386_REL16                    2
-#define        IMAGE_REL_I386_DIR32                    6
-#define        IMAGE_REL_I386_DIR32NB                  7
-#define        IMAGE_REL_I386_SEG12                    9
-#define        IMAGE_REL_I386_SECTION                  10
-#define        IMAGE_REL_I386_SECREL                   11
-#define        IMAGE_REL_I386_REL32                    20
-
-/* MIPS relocation types */
-#define IMAGE_REL_MIPS_ABSOLUTE                0x0000
-#define IMAGE_REL_MIPS_REFHALF         0x0001
-#define IMAGE_REL_MIPS_REFWORD         0x0002
-#define IMAGE_REL_MIPS_JMPADDR         0x0003
-#define IMAGE_REL_MIPS_REFHI           0x0004
-#define IMAGE_REL_MIPS_REFLO           0x0005
-#define IMAGE_REL_MIPS_GPREL           0x0006
-#define IMAGE_REL_MIPS_LITERAL         0x0007
-#define IMAGE_REL_MIPS_SECTION         0x000A
-#define IMAGE_REL_MIPS_SECREL          0x000B
-#define IMAGE_REL_MIPS_SECRELLO                0x000C
-#define IMAGE_REL_MIPS_SECRELHI                0x000D
-#define        IMAGE_REL_MIPS_JMPADDR16        0x0010
-#define IMAGE_REL_MIPS_REFWORDNB       0x0022
-#define IMAGE_REL_MIPS_PAIR            0x0025
-
-/* ALPHA relocation types */
-#define IMAGE_REL_ALPHA_ABSOLUTE       0x0000
-#define IMAGE_REL_ALPHA_REFLONG                0x0001
-#define IMAGE_REL_ALPHA_REFQUAD                0x0002
-#define IMAGE_REL_ALPHA_GPREL          0x0003
-#define IMAGE_REL_ALPHA_LITERAL                0x0004
-#define IMAGE_REL_ALPHA_LITUSE         0x0005
-#define IMAGE_REL_ALPHA_GPDISP         0x0006
-#define IMAGE_REL_ALPHA_BRADDR         0x0007
-#define IMAGE_REL_ALPHA_HINT           0x0008
-#define IMAGE_REL_ALPHA_INLINE_REFLONG 0x0009
-#define IMAGE_REL_ALPHA_REFHI          0x000A
-#define IMAGE_REL_ALPHA_REFLO          0x000B
-#define IMAGE_REL_ALPHA_PAIR           0x000C
-#define IMAGE_REL_ALPHA_MATCH          0x000D
-#define IMAGE_REL_ALPHA_SECTION                0x000E
-#define IMAGE_REL_ALPHA_SECREL         0x000F
-#define IMAGE_REL_ALPHA_REFLONGNB      0x0010
-#define IMAGE_REL_ALPHA_SECRELLO       0x0011
-#define IMAGE_REL_ALPHA_SECRELHI       0x0012
-#define IMAGE_REL_ALPHA_REFQ3          0x0013
-#define IMAGE_REL_ALPHA_REFQ2          0x0014
-#define IMAGE_REL_ALPHA_REFQ1          0x0015
-#define IMAGE_REL_ALPHA_GPRELLO                0x0016
-#define IMAGE_REL_ALPHA_GPRELHI                0x0017
-
-/* PowerPC relocation types */
-#define IMAGE_REL_PPC_ABSOLUTE          0x0000
-#define IMAGE_REL_PPC_ADDR64            0x0001
-#define IMAGE_REL_PPC_ADDR            0x0002
-#define IMAGE_REL_PPC_ADDR24            0x0003
-#define IMAGE_REL_PPC_ADDR16            0x0004
-#define IMAGE_REL_PPC_ADDR14            0x0005
-#define IMAGE_REL_PPC_REL24             0x0006
-#define IMAGE_REL_PPC_REL14             0x0007
-#define IMAGE_REL_PPC_TOCREL16          0x0008
-#define IMAGE_REL_PPC_TOCREL14          0x0009
-#define IMAGE_REL_PPC_ADDR32NB          0x000A
-#define IMAGE_REL_PPC_SECREL            0x000B
-#define IMAGE_REL_PPC_SECTION           0x000C
-#define IMAGE_REL_PPC_IFGLUE            0x000D
-#define IMAGE_REL_PPC_IMGLUE            0x000E
-#define IMAGE_REL_PPC_SECREL16          0x000F
-#define IMAGE_REL_PPC_REFHI             0x0010
-#define IMAGE_REL_PPC_REFLO             0x0011
-#define IMAGE_REL_PPC_PAIR              0x0012
-#define IMAGE_REL_PPC_SECRELLO          0x0013
-#define IMAGE_REL_PPC_SECRELHI          0x0014
-#define IMAGE_REL_PPC_GPREL            0x0015
-#define IMAGE_REL_PPC_TYPEMASK          0x00FF
-/* modifier bits */
-#define IMAGE_REL_PPC_NEG               0x0100
-#define IMAGE_REL_PPC_BRTAKEN           0x0200
-#define IMAGE_REL_PPC_BRNTAKEN          0x0400
-#define IMAGE_REL_PPC_TOCDEFN           0x0800
-
-/* SH3 ? relocation type */
-#define IMAGE_REL_SH3_ABSOLUTE          0x0000
-#define IMAGE_REL_SH3_DIRECT16          0x0001
-#define IMAGE_REL_SH3_DIRECT          0x0002
-#define IMAGE_REL_SH3_DIRECT8           0x0003
-#define IMAGE_REL_SH3_DIRECT8_WORD      0x0004
-#define IMAGE_REL_SH3_DIRECT8_LONG      0x0005
-#define IMAGE_REL_SH3_DIRECT4           0x0006
-#define IMAGE_REL_SH3_DIRECT4_WORD      0x0007
-#define IMAGE_REL_SH3_DIRECT4_LONG      0x0008
-#define IMAGE_REL_SH3_PCREL8_WORD       0x0009
-#define IMAGE_REL_SH3_PCREL8_LONG       0x000A
-#define IMAGE_REL_SH3_PCREL12_WORD      0x000B
-#define IMAGE_REL_SH3_STARTOF_SECTION   0x000C
-#define IMAGE_REL_SH3_SIZEOF_SECTION    0x000D
-#define IMAGE_REL_SH3_SECTION           0x000E
-#define IMAGE_REL_SH3_SECREL            0x000F
-#define IMAGE_REL_SH3_DIRECT32_NB       0x0010
-
-/* ARM (Archimedes?) relocation types */
-#define IMAGE_REL_ARM_ABSOLUTE         0x0000
-#define IMAGE_REL_ARM_ADDR             0x0001
-#define IMAGE_REL_ARM_ADDR32NB         0x0002
-#define IMAGE_REL_ARM_BRANCH24         0x0003
-#define IMAGE_REL_ARM_BRANCH11         0x0004
-#define IMAGE_REL_ARM_SECTION          0x000E
-#define IMAGE_REL_ARM_SECREL           0x000F
-
-/* IA64 relocation types */
-#define IMAGE_REL_IA64_ABSOLUTE                0x0000
-#define IMAGE_REL_IA64_IMM14           0x0001
-#define IMAGE_REL_IA64_IMM22           0x0002
-#define IMAGE_REL_IA64_IMM64           0x0003
-#define IMAGE_REL_IA64_DIR             0x0004
-#define IMAGE_REL_IA64_DIR64           0x0005
-#define IMAGE_REL_IA64_PCREL21B                0x0006
-#define IMAGE_REL_IA64_PCREL21M                0x0007
-#define IMAGE_REL_IA64_PCREL21F                0x0008
-#define IMAGE_REL_IA64_GPREL22         0x0009
-#define IMAGE_REL_IA64_LTOFF22         0x000A
-#define IMAGE_REL_IA64_SECTION         0x000B
-#define IMAGE_REL_IA64_SECREL22                0x000C
-#define IMAGE_REL_IA64_SECREL64I       0x000D
-#define IMAGE_REL_IA64_SECREL          0x000E
-#define IMAGE_REL_IA64_LTOFF64         0x000F
-#define IMAGE_REL_IA64_DIR32NB         0x0010
-#define IMAGE_REL_IA64_RESERVED_11     0x0011
-#define IMAGE_REL_IA64_RESERVED_12     0x0012
-#define IMAGE_REL_IA64_RESERVED_13     0x0013
-#define IMAGE_REL_IA64_RESERVED_14     0x0014
-#define IMAGE_REL_IA64_RESERVED_15     0x0015
-#define IMAGE_REL_IA64_RESERVED_16     0x0016
-#define IMAGE_REL_IA64_ADDEND          0x001F
-
-/* archive format */
-
-#define IMAGE_ARCHIVE_START_SIZE             8
-#define IMAGE_ARCHIVE_START                  "!<arch>\n"
-#define IMAGE_ARCHIVE_END                    "`\n"
-#define IMAGE_ARCHIVE_PAD                    "\n"
-#define IMAGE_ARCHIVE_LINKER_MEMBER          "/               "
-#define IMAGE_ARCHIVE_LONGNAMES_MEMBER       "//              "
-
-typedef struct _IMAGE_ARCHIVE_MEMBER_HEADER
-{
-    BYTE     Name[16];
-    BYTE     Date[12];
-    BYTE     UserID[6];
-    BYTE     GroupID[6];
-    BYTE     Mode[8];
-    BYTE     Size[10];
-    BYTE     EndHeader[2];
-} IMAGE_ARCHIVE_MEMBER_HEADER, *PIMAGE_ARCHIVE_MEMBER_HEADER;
-
-#define IMAGE_SIZEOF_ARCHIVE_MEMBER_HDR 60
-
-/*
- * Resource directory stuff
- */
-typedef struct _IMAGE_RESOURCE_DIRECTORY {
-       DWORD   Characteristics;
-       DWORD   TimeDateStamp;
-       WORD    MajorVersion;
-       WORD    MinorVersion;
-       WORD    NumberOfNamedEntries;
-       WORD    NumberOfIdEntries;
-       /*  IMAGE_RESOURCE_DIRECTORY_ENTRY DirectoryEntries[]; */
-} IMAGE_RESOURCE_DIRECTORY,*PIMAGE_RESOURCE_DIRECTORY;
-
-#define        IMAGE_RESOURCE_NAME_IS_STRING           0x80000000
-#define        IMAGE_RESOURCE_DATA_IS_DIRECTORY        0x80000000
-
-typedef struct _IMAGE_RESOURCE_DIRECTORY_ENTRY {
-       union {
-               struct {
-                       unsigned NameOffset:31;
-                       unsigned NameIsString:1;
-               } s;
-               DWORD   Name;
-               WORD    Id;
-       } u1;
-       union {
-               DWORD   OffsetToData;
-               struct {
-                       unsigned OffsetToDirectory:31;
-                       unsigned DataIsDirectory:1;
-               } s;
-       } u2;
-} IMAGE_RESOURCE_DIRECTORY_ENTRY,*PIMAGE_RESOURCE_DIRECTORY_ENTRY;
-
-
-typedef struct _IMAGE_RESOURCE_DIRECTORY_STRING {
-       WORD    Length;
-       CHAR    NameString[ 1 ];
-} IMAGE_RESOURCE_DIRECTORY_STRING,*PIMAGE_RESOURCE_DIRECTORY_STRING;
-
-typedef struct _IMAGE_RESOURCE_DIR_STRING_U {
-       WORD    Length;
-       WCHAR   NameString[ 1 ];
-} IMAGE_RESOURCE_DIR_STRING_U,*PIMAGE_RESOURCE_DIR_STRING_U;
-
-typedef struct _IMAGE_RESOURCE_DATA_ENTRY {
-       DWORD   OffsetToData;
-       DWORD   Size;
-       DWORD   CodePage;
-       DWORD   ResourceHandle;
-} IMAGE_RESOURCE_DATA_ENTRY,*PIMAGE_RESOURCE_DATA_ENTRY;
-
-
-typedef VOID CALLBACK (*PIMAGE_TLS_CALLBACK)(
-       LPVOID DllHandle,DWORD Reason,LPVOID Reserved
-);
-
-typedef struct _IMAGE_TLS_DIRECTORY {
-       DWORD   StartAddressOfRawData;
-       DWORD   EndAddressOfRawData;
-       LPDWORD AddressOfIndex;
-       PIMAGE_TLS_CALLBACK *AddressOfCallBacks;
-       DWORD   SizeOfZeroFill;
-       DWORD   Characteristics;
-} IMAGE_TLS_DIRECTORY,*PIMAGE_TLS_DIRECTORY;
-
-typedef struct _IMAGE_DEBUG_DIRECTORY {
-  DWORD Characteristics;
-  DWORD TimeDateStamp;
-  WORD  MajorVersion;
-  WORD  MinorVersion;
-  DWORD Type;
-  DWORD SizeOfData;
-  DWORD AddressOfRawData;
-  DWORD PointerToRawData;
-} IMAGE_DEBUG_DIRECTORY, *PIMAGE_DEBUG_DIRECTORY;
-
-#define IMAGE_DEBUG_TYPE_UNKNOWN        0
-#define IMAGE_DEBUG_TYPE_COFF           1
-#define IMAGE_DEBUG_TYPE_CODEVIEW       2
-#define IMAGE_DEBUG_TYPE_FPO            3
-#define IMAGE_DEBUG_TYPE_MISC           4
-#define IMAGE_DEBUG_TYPE_EXCEPTION      5
-#define IMAGE_DEBUG_TYPE_FIXUP          6
-#define IMAGE_DEBUG_TYPE_OMAP_TO_SRC    7
-#define IMAGE_DEBUG_TYPE_OMAP_FROM_SRC  8
-#define IMAGE_DEBUG_TYPE_BORLAND        9
-#define IMAGE_DEBUG_TYPE_RESERVED10    10
-
-typedef struct _IMAGE_COFF_SYMBOLS_HEADER {
-  DWORD NumberOfSymbols;
-  DWORD LvaToFirstSymbol;
-  DWORD NumberOfLinenumbers;
-  DWORD LvaToFirstLinenumber;
-  DWORD RvaToFirstByteOfCode;
-  DWORD RvaToLastByteOfCode;
-  DWORD RvaToFirstByteOfData;
-  DWORD RvaToLastByteOfData;
-} IMAGE_COFF_SYMBOLS_HEADER, *PIMAGE_COFF_SYMBOLS_HEADER;
-
-#define FRAME_FPO       0
-#define FRAME_TRAP      1
-#define FRAME_TSS       2
-#define FRAME_NONFPO    3
-
-typedef struct _FPO_DATA {
-  DWORD ulOffStart;
-  DWORD cbProcSize;
-  DWORD cdwLocals;
-  WORD  cdwParams;
-  unsigned cbProlog : 8;
-  unsigned cbRegs   : 3;
-  unsigned fHasSEH  : 1;
-  unsigned fUseBP   : 1;
-  unsigned reserved : 1;
-  unsigned cbFrame  : 2;
-} FPO_DATA, *PFPO_DATA;
-
-typedef struct _IMAGE_LOAD_CONFIG_DIRECTORY {
-  DWORD Characteristics;
-  DWORD TimeDateStamp;
-  WORD  MajorVersion;
-  WORD  MinorVersion;
-  DWORD GlobalFlagsClear;
-  DWORD GlobalFlagsSet;
-  DWORD CriticalSectionDefaultTimeout;
-  DWORD DeCommitFreeBlockThreshold;
-  DWORD DeCommitTotalFreeThreshold;
-  PVOID LockPrefixTable;
-  DWORD MaximumAllocationSize;
-  DWORD VirtualMemoryThreshold;
-  DWORD ProcessHeapFlags;
-  DWORD ProcessAffinityMask;
-  WORD  CSDVersion;
-  WORD  Reserved1;
-  PVOID EditList;
-  DWORD Reserved[1];
-} IMAGE_LOAD_CONFIG_DIRECTORY, *PIMAGE_LOAD_CONFIG_DIRECTORY;
-
-typedef struct _IMAGE_FUNCTION_ENTRY {
-  DWORD StartingAddress;
-  DWORD EndingAddress;
-  DWORD EndOfPrologue;
-} IMAGE_FUNCTION_ENTRY, *PIMAGE_FUNCTION_ENTRY;
-
-/* This is the structure that appears at the very start of a .DBG file. */
-
-typedef struct _IMAGE_SEPARATE_DEBUG_HEADER {
-       WORD    Signature;
-       WORD    Flags;
-       WORD    Machine;
-       WORD    Characteristics;
-       DWORD   TimeDateStamp;
-       DWORD   CheckSum;
-       DWORD   ImageBase;
-       DWORD   SizeOfImage;
-       DWORD   NumberOfSections;
-       DWORD   ExportedNamesSize;
-       DWORD   DebugDirectorySize;
-       DWORD   SectionAlignment;
-       DWORD   Reserved[ 2 ];
-} IMAGE_SEPARATE_DEBUG_HEADER,*PIMAGE_SEPARATE_DEBUG_HEADER;
-
-#define IMAGE_SEPARATE_DEBUG_SIGNATURE 0x4944
-
-
-typedef struct tagMESSAGE_RESOURCE_ENTRY {
-       WORD    Length;
-       WORD    Flags;
-       BYTE    Text[1];
-} MESSAGE_RESOURCE_ENTRY,*PMESSAGE_RESOURCE_ENTRY;
-#define        MESSAGE_RESOURCE_UNICODE        0x0001
-
-typedef struct tagMESSAGE_RESOURCE_BLOCK {
-       DWORD   LowId;
-       DWORD   HighId;
-       DWORD   OffsetToEntries;
-} MESSAGE_RESOURCE_BLOCK,*PMESSAGE_RESOURCE_BLOCK;
-
-typedef struct tagMESSAGE_RESOURCE_DATA {
-       DWORD                   NumberOfBlocks;
-       MESSAGE_RESOURCE_BLOCK  Blocks[ 1 ];
-} MESSAGE_RESOURCE_DATA,*PMESSAGE_RESOURCE_DATA;
-
-/*
- * Here follows typedefs for security and tokens.
- */ 
-
-/*
- * First a constant for the following typdefs.
- */
-
-#define ANYSIZE_ARRAY   1
-
-/* FIXME:  Orphan.  What does it point to? */
-typedef PVOID PACCESS_TOKEN;
-
-/*
- * TOKEN_INFORMATION_CLASS
- */
-
-typedef enum _TOKEN_INFORMATION_CLASS {
-  TokenUser = 1, 
-  TokenGroups, 
-  TokenPrivileges, 
-  TokenOwner, 
-  TokenPrimaryGroup, 
-  TokenDefaultDacl, 
-  TokenSource, 
-  TokenType, 
-  TokenImpersonationLevel, 
-  TokenStatistics 
-} TOKEN_INFORMATION_CLASS; 
-
-#ifndef _SECURITY_DEFINED
-#define _SECURITY_DEFINED
-
-#include "pshpack1.h"
-
-typedef DWORD ACCESS_MASK, *PACCESS_MASK;
-
-typedef struct _GENERIC_MAPPING {
-    ACCESS_MASK GenericRead;
-    ACCESS_MASK GenericWrite;
-    ACCESS_MASK GenericExecute;
-    ACCESS_MASK GenericAll;
-} GENERIC_MAPPING, *PGENERIC_MAPPING;
-
-#ifndef SID_IDENTIFIER_AUTHORITY_DEFINED
-#define SID_IDENTIFIER_AUTHORITY_DEFINED
-typedef struct {
-    BYTE Value[6];
-} SID_IDENTIFIER_AUTHORITY,*PSID_IDENTIFIER_AUTHORITY,*LPSID_IDENTIFIER_AUTHORITY;
-#endif /* !defined(SID_IDENTIFIER_AUTHORITY_DEFINED) */
-
-#ifndef SID_DEFINED
-#define SID_DEFINED
-typedef struct _SID {
-    BYTE Revision;
-    BYTE SubAuthorityCount;
-    SID_IDENTIFIER_AUTHORITY IdentifierAuthority;
-    DWORD SubAuthority[1];
-} SID,*PSID;
-#endif /* !defined(SID_DEFINED) */
-
-#define        SID_REVISION                    (1)     /* Current revision */
-#define        SID_MAX_SUB_AUTHORITIES         (15)    /* current max subauths */
-#define        SID_RECOMMENDED_SUB_AUTHORITIES (1)     /* recommended subauths */
-
-
-/* 
- * ACL 
- */
-
-#define ACL_REVISION1 1
-#define ACL_REVISION2 2
-#define ACL_REVISION3 3
-#define ACL_REVISION4 4
-
-#define MIN_ACL_REVISION ACL_REVISION2
-#define MAX_ACL_REVISION ACL_REVISION4
-
-typedef struct _ACL {
-    BYTE AclRevision;
-    BYTE Sbz1;
-    WORD AclSize;
-    WORD AceCount;
-    WORD Sbz2;
-} ACL, *PACL;
-
-/* SECURITY_DESCRIPTOR */
-#define        SECURITY_DESCRIPTOR_REVISION    1
-#define        SECURITY_DESCRIPTOR_REVISION1   1
-
-
-#define        SE_OWNER_DEFAULTED      0x0001
-#define        SE_GROUP_DEFAULTED      0x0002
-#define        SE_DACL_PRESENT         0x0004
-#define        SE_DACL_DEFAULTED       0x0008
-#define        SE_SACL_PRESENT         0x0010
-#define        SE_SACL_DEFAULTED       0x0020
-#define        SE_SELF_RELATIVE        0x8000
-
-typedef DWORD SECURITY_INFORMATION, *PSECURITY_INFORMATION;
-typedef WORD SECURITY_DESCRIPTOR_CONTROL, *PSECURITY_DESCRIPTOR_CONTROL;
-
-/* The security descriptor structure */
-typedef struct {
-    BYTE Revision;
-    BYTE Sbz1;
-    SECURITY_DESCRIPTOR_CONTROL Control;
-    DWORD Owner;
-    DWORD Group;
-    DWORD Sacl;
-    DWORD Dacl;
-} SECURITY_DESCRIPTOR_RELATIVE, *PISECURITY_DESCRIPTOR_RELATIVE;
-
-typedef struct {
-    BYTE Revision;
-    BYTE Sbz1;
-    SECURITY_DESCRIPTOR_CONTROL Control;
-    PSID Owner;
-    PSID Group;
-    PACL Sacl;
-    PACL Dacl;
-} SECURITY_DESCRIPTOR, *PSECURITY_DESCRIPTOR;
-
-#define SECURITY_DESCRIPTOR_MIN_LENGTH   (sizeof(SECURITY_DESCRIPTOR)) 
-
-#include "poppack.h"
-
-#endif /* _SECURITY_DEFINED */
-
-#include "pshpack1.h"
-
-/* 
- * SID_AND_ATTRIBUTES
- */
-
-typedef struct _SID_AND_ATTRIBUTES {
-  PSID  Sid; 
-  DWORD Attributes; 
-} SID_AND_ATTRIBUTES ; 
-/* security entities */
-#define SECURITY_NULL_RID                      (0x00000000L)
-#define SECURITY_WORLD_RID                     (0x00000000L)
-#define SECURITY_LOCAL_RID                     (0X00000000L)
-
-#define SECURITY_NULL_SID_AUTHORITY            {0,0,0,0,0,0}
-
-/* S-1-1 */
-#define SECURITY_WORLD_SID_AUTHORITY           {0,0,0,0,0,1}
-
-/* S-1-2 */
-#define SECURITY_LOCAL_SID_AUTHORITY           {0,0,0,0,0,2}
-
-/* S-1-3 */
-#define SECURITY_CREATOR_SID_AUTHORITY         {0,0,0,0,0,3}
-#define SECURITY_CREATOR_OWNER_RID             (0x00000000L) 
-#define SECURITY_CREATOR_GROUP_RID             (0x00000001L)
-#define SECURITY_CREATOR_OWNER_SERVER_RID      (0x00000002L)
-#define SECURITY_CREATOR_GROUP_SERVER_RID      (0x00000003L)
-
-/* S-1-4 */
-#define SECURITY_NON_UNIQUE_AUTHORITY          {0,0,0,0,0,4}
-
-/* S-1-5 */
-#define SECURITY_NT_AUTHORITY                  {0,0,0,0,0,5} 
-#define SECURITY_DIALUP_RID                     0x00000001L
-#define SECURITY_NETWORK_RID                    0x00000002L
-#define SECURITY_BATCH_RID                      0x00000003L
-#define SECURITY_INTERACTIVE_RID                0x00000004L
-#define SECURITY_LOGON_IDS_RID                  0x00000005L
-#define SECURITY_SERVICE_RID                    0x00000006L
-#define SECURITY_ANONYMOUS_LOGON_RID            0x00000007L
-#define SECURITY_PROXY_RID                      0x00000008L
-#define SECURITY_ENTERPRISE_CONTROLLERS_RID     0x00000009L
-#define SECURITY_PRINCIPAL_SELF_RID             0x0000000AL
-#define SECURITY_AUTHENTICATED_USER_RID         0x0000000BL
-#define SECURITY_RESTRICTED_CODE_RID            0x0000000CL
-#define SECURITY_TERMINAL_SERVER_RID            0x0000000DL
-#define SECURITY_LOCAL_SYSTEM_RID               0x00000012L
-#define SECURITY_NT_NON_UNIQUE                  0x00000015L
-#define SECURITY_BUILTIN_DOMAIN_RID             0x00000020L
-
-#define DOMAIN_GROUP_RID_ADMINS                 0x00000200L
-#define DOMAIN_GROUP_RID_USERS                  0x00000201L
-#define DOMAIN_GROUP_RID_GUESTS                 0x00000202L
-
-#define DOMAIN_ALIAS_RID_ADMINS                 0x00000220L
-#define DOMAIN_ALIAS_RID_USERS                  0x00000221L
-#define DOMAIN_ALIAS_RID_GUESTS                 0x00000222L
-
-#define SECURITY_SERVER_LOGON_RID              SECURITY_ENTERPRISE_CONTROLLERS_RID
-
-#define SECURITY_LOGON_IDS_RID_COUNT           (3L)
-
-/*
- * TOKEN_USER
- */
-
-typedef struct _TOKEN_USER {
-  SID_AND_ATTRIBUTES User; 
-} TOKEN_USER; 
-
-/*
- * TOKEN_GROUPS
- */
-
-typedef struct _TOKEN_GROUPS  {
-  DWORD GroupCount; 
-  SID_AND_ATTRIBUTES Groups[ANYSIZE_ARRAY]; 
-} TOKEN_GROUPS; 
-
-/*
- * LUID_AND_ATTRIBUTES
- */
-
-typedef union _LARGE_INTEGER {
-    struct {
-        DWORD    LowPart;
-        LONG     HighPart;
-    } DUMMYSTRUCTNAME;
-    LONGLONG QuadPart;
-} LARGE_INTEGER, *LPLARGE_INTEGER, *PLARGE_INTEGER;
-
-typedef union _ULARGE_INTEGER {
-    struct {
-        DWORD    LowPart;
-        LONG     HighPart;
-    } DUMMYSTRUCTNAME;
-    LONGLONG QuadPart;
-} ULARGE_INTEGER, *LPULARGE_INTEGER, *PULARGE_INTEGER;
-
-/*
- * Locally Unique Identifier
- */
-
-typedef LARGE_INTEGER LUID,*PLUID;
-
-typedef struct _LUID_AND_ATTRIBUTES {
-  LUID   Luid; 
-  DWORD  Attributes; 
-} LUID_AND_ATTRIBUTES; 
-
-/*
- * PRIVILEGE_SET
- */
-
-typedef struct _PRIVILEGE_SET {
-    DWORD PrivilegeCount;
-    DWORD Control;
-    LUID_AND_ATTRIBUTES Privilege[ANYSIZE_ARRAY];
-} PRIVILEGE_SET, *PPRIVILEGE_SET;
-
-/*
- * TOKEN_PRIVILEGES
- */
-
-typedef struct _TOKEN_PRIVILEGES {
-  DWORD PrivilegeCount; 
-  LUID_AND_ATTRIBUTES Privileges[ANYSIZE_ARRAY]; 
-} TOKEN_PRIVILEGES, *PTOKEN_PRIVILEGES; 
-
-/*
- * TOKEN_OWNER
- */
-
-typedef struct _TOKEN_OWNER {
-  PSID Owner; 
-} TOKEN_OWNER; 
-
-/*
- * TOKEN_PRIMARY_GROUP
- */
-
-typedef struct _TOKEN_PRIMARY_GROUP {
-  PSID PrimaryGroup; 
-} TOKEN_PRIMARY_GROUP; 
-
-
-/*
- * TOKEN_DEFAULT_DACL
- */
-
-typedef struct _TOKEN_DEFAULT_DACL { 
-  PACL DefaultDacl; 
-} TOKEN_DEFAULT_DACL; 
-
-/*
- * TOKEN_SOURCEL
- */
-
-typedef struct _TOKEN_SOURCE {
-  char Sourcename[8]; 
-  LUID SourceIdentifier; 
-} TOKEN_SOURCE; 
-
-/*
- * TOKEN_TYPE
- */
-
-typedef enum tagTOKEN_TYPE {
-  TokenPrimary = 1, 
-  TokenImpersonation 
-} TOKEN_TYPE; 
-
-/*
- * SECURITY_IMPERSONATION_LEVEL
- */
-
-typedef enum _SECURITY_IMPERSONATION_LEVEL {
-  SecurityAnonymous, 
-  SecurityIdentification, 
-  SecurityImpersonation, 
-  SecurityDelegation 
-} SECURITY_IMPERSONATION_LEVEL, *PSECURITY_IMPERSONATION_LEVEL; 
-
-
-typedef BOOLEAN SECURITY_CONTEXT_TRACKING_MODE,
-       * PSECURITY_CONTEXT_TRACKING_MODE;
-/*
- *     Quality of Service
- */
-
-typedef struct _SECURITY_QUALITY_OF_SERVICE {
-  DWORD                                Length;
-  SECURITY_IMPERSONATION_LEVEL ImpersonationLevel;
-  SECURITY_CONTEXT_TRACKING_MODE ContextTrackingMode;
-  WIN_BOOL                             EffectiveOnly;
-} SECURITY_QUALITY_OF_SERVICE, *PSECURITY_QUALITY_OF_SERVICE;
-
-/*
- * TOKEN_STATISTICS
- */
-
-typedef struct _TOKEN_STATISTICS {
-  LUID  TokenId; 
-  LUID  AuthenticationId; 
-  LARGE_INTEGER ExpirationTime; 
-  TOKEN_TYPE    TokenType; 
-  SECURITY_IMPERSONATION_LEVEL ImpersonationLevel; 
-  DWORD DynamicCharged; 
-  DWORD DynamicAvailable; 
-  DWORD GroupCount; 
-  DWORD PrivilegeCount; 
-  LUID  ModifiedId; 
-} TOKEN_STATISTICS; 
-
-/* 
- *     ACLs of NT 
- */
-
-#define        ACL_REVISION    2
-
-#define        ACL_REVISION1   1
-#define        ACL_REVISION2   2
-
-/* ACEs, directly starting after an ACL */
-typedef struct _ACE_HEADER {
-       BYTE    AceType;
-       BYTE    AceFlags;
-       WORD    AceSize;
-} ACE_HEADER,*PACE_HEADER;
-
-/* AceType */
-#define        ACCESS_ALLOWED_ACE_TYPE         0
-#define        ACCESS_DENIED_ACE_TYPE          1
-#define        SYSTEM_AUDIT_ACE_TYPE           2
-#define        SYSTEM_ALARM_ACE_TYPE           3
-
-/* inherit AceFlags */
-#define        OBJECT_INHERIT_ACE              0x01
-#define        CONTAINER_INHERIT_ACE           0x02
-#define        NO_PROPAGATE_INHERIT_ACE        0x04
-#define        INHERIT_ONLY_ACE                0x08
-#define        VALID_INHERIT_FLAGS             0x0F
-
-/* AceFlags mask for what events we (should) audit */
-#define        SUCCESSFUL_ACCESS_ACE_FLAG      0x40
-#define        FAILED_ACCESS_ACE_FLAG          0x80
-
-/* different ACEs depending on AceType 
- * SidStart marks the begin of a SID
- * so the thing finally looks like this:
- * 0: ACE_HEADER
- * 4: ACCESS_MASK
- * 8... : SID
- */
-typedef struct _ACCESS_ALLOWED_ACE {
-       ACE_HEADER      Header;
-       DWORD           Mask;
-       DWORD           SidStart;
-} ACCESS_ALLOWED_ACE,*PACCESS_ALLOWED_ACE;
-
-typedef struct _ACCESS_DENIED_ACE {
-       ACE_HEADER      Header;
-       DWORD           Mask;
-       DWORD           SidStart;
-} ACCESS_DENIED_ACE,*PACCESS_DENIED_ACE;
-
-typedef struct _SYSTEM_AUDIT_ACE {
-       ACE_HEADER      Header;
-       DWORD           Mask;
-       DWORD           SidStart;
-} SYSTEM_AUDIT_ACE,*PSYSTEM_AUDIT_ACE;
-
-typedef struct _SYSTEM_ALARM_ACE {
-       ACE_HEADER      Header;
-       DWORD           Mask;
-       DWORD           SidStart;
-} SYSTEM_ALARM_ACE,*PSYSTEM_ALARM_ACE;
-
-typedef enum tagSID_NAME_USE {
-       SidTypeUser = 1,
-       SidTypeGroup,
-       SidTypeDomain,
-       SidTypeAlias,
-       SidTypeWellKnownGroup,
-       SidTypeDeletedAccount,
-       SidTypeInvalid,
-       SidTypeUnknown
-} SID_NAME_USE,*PSID_NAME_USE;
-
-/* Access rights */
-
-#define DELETE                     0x00010000
-#define READ_CONTROL               0x00020000
-#define WRITE_DAC                  0x00040000
-#define WRITE_OWNER                0x00080000
-#define SYNCHRONIZE                0x00100000
-#define STANDARD_RIGHTS_REQUIRED   0x000f0000
-
-#define STANDARD_RIGHTS_READ       READ_CONTROL
-#define STANDARD_RIGHTS_WRITE      READ_CONTROL
-#define STANDARD_RIGHTS_EXECUTE    READ_CONTROL
-
-#define STANDARD_RIGHTS_ALL        0x001f0000
-
-#define SPECIFIC_RIGHTS_ALL        0x0000ffff
-
-#define GENERIC_READ               0x80000000
-#define GENERIC_WRITE              0x40000000
-#define GENERIC_EXECUTE            0x20000000
-#define GENERIC_ALL                0x10000000
-
-#define MAXIMUM_ALLOWED            0x02000000
-#define ACCESS_SYSTEM_SECURITY     0x01000000
-
-#define EVENT_MODIFY_STATE         0x0002
-#define EVENT_ALL_ACCESS           (STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|0x3)
-
-#define SEMAPHORE_MODIFY_STATE     0x0002
-#define SEMAPHORE_ALL_ACCESS       (STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|0x3)
-
-#define MUTEX_MODIFY_STATE         0x0001
-#define MUTEX_ALL_ACCESS           (STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|0x1)
-
-#define PROCESS_TERMINATE          0x0001
-#define PROCESS_CREATE_THREAD      0x0002
-#define PROCESS_VM_OPERATION       0x0008
-#define PROCESS_VM_READ            0x0010
-#define PROCESS_VM_WRITE           0x0020
-#define PROCESS_DUP_HANDLE         0x0040
-#define PROCESS_CREATE_PROCESS     0x0080
-#define PROCESS_SET_QUOTA          0x0100
-#define PROCESS_SET_INFORMATION    0x0200
-#define PROCESS_QUERY_INFORMATION  0x0400
-#define PROCESS_ALL_ACCESS         (STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|0xfff)
-
-#define THREAD_TERMINATE           0x0001
-#define THREAD_SUSPEND_RESUME      0x0002
-#define THREAD_GET_CONTEXT         0x0008
-#define THREAD_SET_CONTEXT         0x0010
-#define THREAD_SET_INFORMATION     0x0020
-#define THREAD_QUERY_INFORMATION   0x0040
-#define THREAD_SET_THREAD_TOKEN    0x0080
-#define THREAD_IMPERSONATE         0x0100
-#define THREAD_DIRECT_IMPERSONATION 0x0200
-#define THREAD_ALL_ACCESS          (STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|0x3ff)
-
-#define THREAD_BASE_PRIORITY_LOWRT  15 
-#define THREAD_BASE_PRIORITY_MAX    2 
-#define THREAD_BASE_PRIORITY_MIN   -2
-#define THREAD_BASE_PRIORITY_IDLE  -15
-
-#define FILE_READ_DATA            0x0001    /* file & pipe */
-#define FILE_LIST_DIRECTORY       0x0001    /* directory */
-#define FILE_WRITE_DATA           0x0002    /* file & pipe */
-#define FILE_ADD_FILE             0x0002    /* directory */
-#define FILE_APPEND_DATA          0x0004    /* file */
-#define FILE_ADD_SUBDIRECTORY     0x0004    /* directory */
-#define FILE_CREATE_PIPE_INSTANCE 0x0004    /* named pipe */
-#define FILE_READ_EA              0x0008    /* file & directory */
-#define FILE_READ_PROPERTIES      FILE_READ_EA
-#define FILE_WRITE_EA             0x0010    /* file & directory */
-#define FILE_WRITE_PROPERTIES     FILE_WRITE_EA
-#define FILE_EXECUTE              0x0020    /* file */
-#define FILE_TRAVERSE             0x0020    /* directory */
-#define FILE_DELETE_CHILD         0x0040    /* directory */
-#define FILE_READ_ATTRIBUTES      0x0080    /* all */
-#define FILE_WRITE_ATTRIBUTES     0x0100    /* all */
-#define FILE_ALL_ACCESS           (STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|0x1ff)
-
-#define FILE_GENERIC_READ         (STANDARD_RIGHTS_READ | FILE_READ_DATA | \
-                                   FILE_READ_ATTRIBUTES | FILE_READ_EA | \
-                                   SYNCHRONIZE)
-#define FILE_GENERIC_WRITE        (STANDARD_RIGHTS_WRITE | FILE_WRITE_DATA | \
-                                   FILE_WRITE_ATTRIBUTES | FILE_WRITE_EA | \
-                                   FILE_APPEND_DATA | SYNCHRONIZE)
-#define FILE_GENERIC_EXECUTE      (STANDARD_RIGHTS_EXECUTE | FILE_EXECUTE | \
-                                   FILE_READ_ATTRIBUTES | SYNCHRONIZE)
-
-
-/* File attribute flags
- */
-#define FILE_SHARE_READ                        0x00000001L
-#define FILE_SHARE_WRITE               0x00000002L
-#define FILE_SHARE_DELETE              0x00000004L
-#define FILE_ATTRIBUTE_READONLY         0x00000001L
-#define FILE_ATTRIBUTE_HIDDEN           0x00000002L
-#define FILE_ATTRIBUTE_SYSTEM           0x00000004L
-#define FILE_ATTRIBUTE_LABEL            0x00000008L  /* Not in Windows API */
-#define FILE_ATTRIBUTE_DIRECTORY        0x00000010L
-#define FILE_ATTRIBUTE_ARCHIVE          0x00000020L
-#define FILE_ATTRIBUTE_NORMAL           0x00000080L
-#define FILE_ATTRIBUTE_TEMPORARY        0x00000100L
-#define FILE_ATTRIBUTE_ATOMIC_WRITE     0x00000200L
-#define FILE_ATTRIBUTE_XACTION_WRITE    0x00000400L
-#define FILE_ATTRIBUTE_COMPRESSED       0x00000800L
-#define FILE_ATTRIBUTE_OFFLINE         0x00001000L
-
-/* File alignments (NT) */
-#define        FILE_BYTE_ALIGNMENT             0x00000000
-#define        FILE_WORD_ALIGNMENT             0x00000001
-#define        FILE_LONG_ALIGNMENT             0x00000003
-#define        FILE_QUAD_ALIGNMENT             0x00000007
-#define        FILE_OCTA_ALIGNMENT             0x0000000f
-#define        FILE_32_BYTE_ALIGNMENT          0x0000001f
-#define        FILE_64_BYTE_ALIGNMENT          0x0000003f
-#define        FILE_128_BYTE_ALIGNMENT         0x0000007f
-#define        FILE_256_BYTE_ALIGNMENT         0x000000ff
-#define        FILE_512_BYTE_ALIGNMENT         0x000001ff
-
-#define REG_NONE               0       /* no type */
-#define REG_SZ                 1       /* string type (ASCII) */
-#define REG_EXPAND_SZ          2       /* string, includes %ENVVAR% (expanded by caller) (ASCII) */
-#define REG_BINARY             3       /* binary format, callerspecific */
-/* YES, REG_DWORD == REG_DWORD_LITTLE_ENDIAN */
-#define REG_DWORD              4       /* DWORD in little endian format */
-#define REG_DWORD_LITTLE_ENDIAN        4       /* DWORD in little endian format */
-#define REG_DWORD_BIG_ENDIAN   5       /* DWORD in big endian format  */
-#define REG_LINK               6       /* symbolic link (UNICODE) */
-#define REG_MULTI_SZ           7       /* multiple strings, delimited by \0, terminated by \0\0 (ASCII) */
-#define REG_RESOURCE_LIST      8       /* resource list? huh? */
-#define REG_FULL_RESOURCE_DESCRIPTOR   9       /* full resource descriptor? huh? */
-#define REG_RESOURCE_REQUIREMENTS_LIST 10
-
-/* ----------------------------- begin registry ----------------------------- */
-
-/* Registry security values */
-#define OWNER_SECURITY_INFORMATION     0x00000001
-#define GROUP_SECURITY_INFORMATION     0x00000002
-#define DACL_SECURITY_INFORMATION      0x00000004
-#define SACL_SECURITY_INFORMATION      0x00000008
-
-#define REG_OPTION_RESERVED            0x00000000
-#define REG_OPTION_NON_VOLATILE                0x00000000
-#define REG_OPTION_VOLATILE            0x00000001
-#define REG_OPTION_CREATE_LINK         0x00000002
-#define REG_OPTION_BACKUP_RESTORE      0x00000004 /* FIXME */
-#define REG_OPTION_OPEN_LINK           0x00000008
-#define REG_LEGAL_OPTION              (REG_OPTION_RESERVED|  \
-                                       REG_OPTION_NON_VOLATILE|  \
-                                       REG_OPTION_VOLATILE|  \
-                                       REG_OPTION_CREATE_LINK|  \
-                                       REG_OPTION_BACKUP_RESTORE|  \
-                                       REG_OPTION_OPEN_LINK)
-
-
-#define REG_CREATED_NEW_KEY    0x00000001
-#define REG_OPENED_EXISTING_KEY        0x00000002
-
-/* For RegNotifyChangeKeyValue */
-#define REG_NOTIFY_CHANGE_NAME 0x1
-
-#define KEY_QUERY_VALUE                0x00000001
-#define KEY_SET_VALUE          0x00000002
-#define KEY_CREATE_SUB_KEY     0x00000004
-#define KEY_ENUMERATE_SUB_KEYS 0x00000008
-#define KEY_NOTIFY             0x00000010
-#define KEY_CREATE_LINK                0x00000020
-
-#define KEY_READ             ((STANDARD_RIGHTS_READ|  \
-                               KEY_QUERY_VALUE|  \
-                               KEY_ENUMERATE_SUB_KEYS|  \
-                               KEY_NOTIFY)  \
-                               & (~SYNCHRONIZE)  \
-                             )
-#define KEY_WRITE            ((STANDARD_RIGHTS_WRITE|  \
-                               KEY_SET_VALUE|  \
-                               KEY_CREATE_SUB_KEY)  \
-                               & (~SYNCHRONIZE)  \
-                             )
-#define KEY_EXECUTE          ((KEY_READ)  \
-                               & (~SYNCHRONIZE))  \
-                             )
-#define KEY_ALL_ACCESS        ((STANDARD_RIGHTS_ALL|  \
-                               KEY_QUERY_VALUE|  \
-                               KEY_SET_VALUE|  \
-                               KEY_CREATE_SUB_KEY|  \
-                               KEY_ENUMERATE_SUB_KEYS|  \
-                               KEY_NOTIFY|  \
-                               KEY_CREATE_LINK)  \
-                               & (~SYNCHRONIZE)  \
-                             )
-/* ------------------------------ end registry ------------------------------ */
-
-
-#define RtlEqualMemory(Destination, Source, Length) (!memcmp((Destination),(Source),(Length)))
-#define RtlMoveMemory(Destination, Source, Length) memmove((Destination),(Source),(Length))
-#define RtlCopyMemory(Destination, Source, Length) memcpy((Destination),(Source),(Length))
-#define RtlFillMemory(Destination, Length, Fill) memset((Destination),(Fill),(Length))
-#define RtlZeroMemory(Destination, Length) memset((Destination),0,(Length))
-
-#include "poppack.h"
-
-#endif  /* __WINE_WINNT_H */
diff --git a/modules/codec/loader/wine/winreg.h b/modules/codec/loader/wine/winreg.h
deleted file mode 100644 (file)
index 8c290b5..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- *             Win32 registry defines (see also winnt.h)
- */
-#ifndef __WINE_WINREG_H
-#define __WINE_WINREG_H
-
-#include "winbase.h"
-#include "winnt.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif /* defined(__cplusplus) */
-
-/*
-#define SHELL_ERROR_SUCCESS           0L
-#define SHELL_ERROR_BADDB             1L
-#define SHELL_ERROR_BADKEY            2L
-#define SHELL_ERROR_CANTOPEN          3L
-#define SHELL_ERROR_CANTREAD          4L
-#define SHELL_ERROR_CANTWRITE         5L
-#define SHELL_ERROR_OUTOFMEMORY       6L
-#define SHELL_ERROR_INVALID_PARAMETER 7L
-#define SHELL_ERROR_ACCESS_DENIED     8L
-*/
-
-#define HKEY_CLASSES_ROOT       ((HKEY) 0x80000000)
-#define HKEY_CURRENT_USER       ((HKEY) 0x80000001)
-#define HKEY_LOCAL_MACHINE      ((HKEY) 0x80000002)
-#define HKEY_USERS              ((HKEY) 0x80000003)
-#define HKEY_PERFORMANCE_DATA   ((HKEY) 0x80000004)
-#define HKEY_CURRENT_CONFIG     ((HKEY) 0x80000005)
-#define HKEY_DYN_DATA           ((HKEY) 0x80000006)
-
-/*
- *     registry provider structs
- */
-typedef struct value_entA 
-{   LPSTR      ve_valuename;
-    DWORD      ve_valuelen;
-    DWORD_PTR  ve_valueptr;
-    DWORD      ve_type;
-} VALENTA, *PVALENTA;
-
-typedef struct value_entW {
-    LPWSTR     ve_valuename;
-    DWORD      ve_valuelen;
-    DWORD_PTR  ve_valueptr;
-    DWORD      ve_type;
-} VALENTW, *PVALENTW;
-
-typedef ACCESS_MASK REGSAM;
-
-#ifdef __cplusplus
-} /* extern "C" */
-#endif /* defined(__cplusplus) */
-
-#endif  /* __WINE_WINREG_H */
diff --git a/modules/codec/loader/wine/winuser.h b/modules/codec/loader/wine/winuser.h
deleted file mode 100644 (file)
index d74864e..0000000
+++ /dev/null
@@ -1,2929 +0,0 @@
-#ifndef _WINUSER_
-#define _WINUSER_
-
-#ifndef RC_INVOKED
-#include <stdarg.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include "pshpack1.h"
-
-/* flags for HIGHCONTRAST dwFlags field */
-#define HCF_HIGHCONTRASTON  0x00000001
-#define HCF_AVAILABLE       0x00000002
-#define HCF_HOTKEYACTIVE    0x00000004
-#define HCF_CONFIRMHOTKEY   0x00000008
-#define HCF_HOTKEYSOUND     0x00000010
-#define HCF_INDICATOR       0x00000020
-#define HCF_HOTKEYAVAILABLE 0x00000040
-
-typedef struct tagHIGHCONTRASTA
-{
-    UINT  cbSize;
-    DWORD   dwFlags;
-    LPSTR   lpszDefaultScheme;
-} HIGHCONTRASTA, *LPHIGHCONTRASTA;
-
-typedef struct tagHIGHCONTRASTW
-{
-    UINT  cbSize;
-    DWORD   dwFlags;
-    LPWSTR  lpszDefaultScheme;
-} HIGHCONTRASTW, *LPHIGHCONTRASTW;
-
-DECL_WINELIB_TYPE_AW(HIGHCONTRAST)
-DECL_WINELIB_TYPE_AW(LPHIGHCONTRAST)
-
-typedef struct
-{
-    UINT  message;
-    UINT  paramL;
-    UINT  paramH;
-    DWORD   time;
-    HWND  hwnd;
-} EVENTMSG, *LPEVENTMSG;
-
-
-    /* Mouse hook structure */
-
-typedef struct
-{
-    POINT pt;
-    HWND  hwnd;
-    UINT  wHitTestCode;
-    DWORD   dwExtraInfo;
-} MOUSEHOOKSTRUCT, *PMOUSEHOOKSTRUCT, *LPMOUSEHOOKSTRUCT;
-
-
-    /* Hardware hook structure */
-
-typedef struct
-{
-    HWND    hWnd;
-    UINT    wMessage;
-    WPARAM  wParam;
-    LPARAM    lParam;
-} HARDWAREHOOKSTRUCT, *LPHARDWAREHOOKSTRUCT;
-
-
-  /* Debug hook structure */
-
-typedef struct
-{
-    DWORD       idThread;
-    DWORD       idThreadInstaller;
-    LPARAM      lParam;
-    WPARAM    wParam;
-    INT       code;
-} DEBUGHOOKINFO, *LPDEBUGHOOKINFO;
-
-#define HKL_PREV   0
-#define HKL_NEXT   1
-
-#define KLF_ACTIVATE       0x00000001
-#define KLF_SUBSTITUTE_OK  0x00000002
-#define KLF_UNLOADPREVIOUS 0x00000004
-#define KLF_REORDER        0x00000008
-#define KLF_REPLACELANG    0x00000010
-#define KLF_NOTELLSHELL    0x00000080
-
-#define KL_NAMELENGTH      9
-
-  /***** Dialogs *****/
-#ifdef FSHIFT
-/* Gcc on Solaris has a version of this that we don't care about.  */
-#undef FSHIFT
-#endif
-
-#define        FVIRTKEY        TRUE          /* Assumed to be == TRUE */
-#define        FNOINVERT       0x02
-#define        FSHIFT          0x04
-#define        FCONTROL        0x08
-#define        FALT            0x10
-
-
-typedef struct tagANIMATIONINFO
-{
-       UINT          cbSize;
-       INT           iMinAnimate;
-} ANIMATIONINFO, *LPANIMATIONINFO;
-
-typedef struct tagNMHDR
-{
-    HWND  hwndFrom;
-    UINT  idFrom;
-    UINT  code;
-} NMHDR, *LPNMHDR;
-
-typedef struct
-{
-       UINT    cbSize;
-       INT     iTabLength;
-       INT     iLeftMargin;
-       INT     iRightMargin;
-       UINT    uiLengthDrawn;
-} DRAWTEXTPARAMS,*LPDRAWTEXTPARAMS;
-
-#define WM_USER             0x0400
-
-#define DT_EDITCONTROL      0x00002000
-#define DT_PATH_ELLIPSIS    0x00004000
-#define DT_END_ELLIPSIS     0x00008000
-#define DT_MODIFYSTRING     0x00010000
-#define DT_RTLREADING       0x00020000
-#define DT_WORD_ELLIPSIS    0x00040000
-
-typedef struct
-{
-   LPARAM   lParam;
-   WPARAM16 wParam;
-   UINT16   message;
-   HWND16   hwnd;
-} CWPSTRUCT16, *LPCWPSTRUCT16;
-
-typedef struct
-{
-  LPARAM        lParam;
-  WPARAM      wParam;
-  UINT        message;
-  HWND        hwnd;
-} CWPSTRUCT, *LPCWPSTRUCT;
-
-
-
-typedef struct
-{
-  LRESULT       lResult;
-  LPARAM        lParam;
-  WPARAM16      wParam;
-  DWORD         message;
-  HWND16        hwnd;
-} CWPRETSTRUCT16, *LPCWPRETSTRUCT16;
-
-typedef struct
-{
-  LRESULT       lResult;
-  LPARAM        lParam;
-  WPARAM      wParam;
-  DWORD         message;
-  HWND        hwnd;
-} CWPRETSTRUCT, *LPCWPRETSTRUCT;
-
-typedef struct
-{
-    UINT   length;
-    UINT   flags;
-    UINT   showCmd;
-    POINT  ptMinPosition WINE_PACKED;
-    POINT  ptMaxPosition WINE_PACKED;
-    RECT   rcNormalPosition WINE_PACKED;
-} WINDOWPLACEMENT, *LPWINDOWPLACEMENT;
-
-
-  /* WINDOWPLACEMENT flags */
-#define WPF_SETMINPOSITION      0x0001
-#define WPF_RESTORETOMAXIMIZED  0x0002
-
-/***** Dialogs *****/
-
-  /* cbWndExtra bytes for dialog class */
-#define DLGWINDOWEXTRA      30
-
-/* Button control styles */
-#define BS_PUSHBUTTON          0x00000000L
-#define BS_DEFPUSHBUTTON       0x00000001L
-#define BS_CHECKBOX            0x00000002L
-#define BS_AUTOCHECKBOX        0x00000003L
-#define BS_RADIOBUTTON         0x00000004L
-#define BS_3STATE              0x00000005L
-#define BS_AUTO3STATE          0x00000006L
-#define BS_GROUPBOX            0x00000007L
-#define BS_USERBUTTON          0x00000008L
-#define BS_AUTORADIOBUTTON     0x00000009L
-#define BS_OWNERDRAW           0x0000000BL
-#define BS_LEFTTEXT            0x00000020L
-
-#define BS_TEXT                0x00000000L
-#define BS_ICON                0x00000040L
-#define BS_BITMAP              0x00000080L
-#define BS_LEFT                0x00000100L
-#define BS_RIGHT               0x00000200L
-#define BS_CENTER              0x00000300L
-#define BS_TOP                 0x00000400L
-#define BS_BOTTOM              0x00000800L
-#define BS_VCENTER             0x00000C00L
-#define BS_PUSHLIKE            0x00001000L
-#define BS_MULTILINE           0x00002000L
-#define BS_NOTIFY              0x00004000L
-#define BS_FLAT                0x00008000L
-
-  /* Dialog styles */
-#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)
-#define DM_SETDEFID         (WM_USER+1)
-
-#define DC_HASDEFID         0x534b
-
-/* Owner draw control types */
-#define ODT_MENU        1
-#define ODT_LISTBOX     2
-#define ODT_COMBOBOX    3
-#define ODT_BUTTON      4
-#define ODT_STATIC      5
-
-/* Owner draw actions */
-#define ODA_DRAWENTIRE  0x0001
-#define ODA_SELECT      0x0002
-#define ODA_FOCUS       0x0004
-
-/* Owner draw state */
-#define ODS_SELECTED    0x0001
-#define ODS_GRAYED      0x0002
-#define ODS_DISABLED    0x0004
-#define ODS_CHECKED     0x0008
-#define ODS_FOCUS       0x0010
-#define ODS_COMBOBOXEDIT 0x1000
-#define ODS_HOTLIGHT    0x0040
-#define ODS_INACTIVE    0x0080
-
-/* Edit control styles */
-#define ES_LEFT         0x00000000
-#define ES_CENTER       0x00000001
-#define ES_RIGHT        0x00000002
-#define ES_MULTILINE    0x00000004
-#define ES_UPPERCASE    0x00000008
-#define ES_LOWERCASE    0x00000010
-#define ES_PASSWORD     0x00000020
-#define ES_AUTOVSCROLL  0x00000040
-#define ES_AUTOHSCROLL  0x00000080
-#define ES_NOHIDESEL    0x00000100
-#define ES_OEMCONVERT   0x00000400
-#define ES_READONLY     0x00000800
-#define ES_WANTRETURN   0x00001000
-#define ES_NUMBER       0x00002000
-
-/* OEM Resource Ordinal Numbers */
-#define OBM_CLOSED          32731
-#define OBM_RADIOCHECK      32732
-#define OBM_TRTYPE          32733
-#define OBM_LFARROWI        32734
-#define OBM_RGARROWI        32735
-#define OBM_DNARROWI        32736
-#define OBM_UPARROWI        32737
-#define OBM_COMBO           32738
-#define OBM_MNARROW         32739
-#define OBM_LFARROWD        32740
-#define OBM_RGARROWD        32741
-#define OBM_DNARROWD        32742
-#define OBM_UPARROWD        32743
-#define OBM_RESTORED        32744
-#define OBM_ZOOMD           32745
-#define OBM_REDUCED         32746
-#define OBM_RESTORE         32747
-#define OBM_ZOOM            32748
-#define OBM_REDUCE          32749
-#define OBM_LFARROW         32750
-#define OBM_RGARROW         32751
-#define OBM_DNARROW         32752
-#define OBM_UPARROW         32753
-#define OBM_CLOSE           32754
-#define OBM_OLD_RESTORE     32755
-#define OBM_OLD_ZOOM        32756
-#define OBM_OLD_REDUCE      32757
-#define OBM_BTNCORNERS      32758
-#define OBM_CHECKBOXES      32759
-#define OBM_CHECK           32760
-#define OBM_BTSIZE          32761
-#define OBM_OLD_LFARROW     32762
-#define OBM_OLD_RGARROW     32763
-#define OBM_OLD_DNARROW     32764
-#define OBM_OLD_UPARROW     32765
-#define OBM_SIZE            32766
-#define OBM_OLD_CLOSE       32767
-
-#define OCR_BUMMER         100
-#define OCR_DRAGOBJECT     101
-
-#define OCR_NORMAL          32512
-#define OCR_IBEAM           32513
-#define OCR_WAIT            32514
-#define OCR_CROSS           32515
-#define OCR_UP              32516
-#define OCR_SIZE            32640
-#define OCR_ICON            32641
-#define OCR_SIZENWSE        32642
-#define OCR_SIZENESW        32643
-#define OCR_SIZEWE          32644
-#define OCR_SIZENS          32645
-#define OCR_SIZEALL         32646
-#define OCR_ICOCUR          32647
-#define OCR_NO              32648
-#define OCR_APPSTARTING     32650
-#define OCR_HELP            32651  /* only defined in wine */
-
-#define OIC_SAMPLE          32512
-#define OIC_HAND            32513
-#define OIC_QUES            32514
-#define OIC_BANG            32515
-#define OIC_NOTE            32516
-#define OIC_PORTRAIT        32517
-#define OIC_LANDSCAPE       32518
-#define OIC_WINEICON        32519
-#define OIC_FOLDER          32520
-#define OIC_FOLDER2         32521
-#define OIC_FLOPPY          32522
-#define OIC_CDROM           32523
-#define OIC_HDISK           32524
-#define OIC_NETWORK         32525
-
-#define COLOR_SCROLLBAR                    0
-#define COLOR_BACKGROUND           1
-#define COLOR_ACTIVECAPTION        2
-#define COLOR_INACTIVECAPTION      3
-#define COLOR_MENU                 4
-#define COLOR_WINDOW               5
-#define COLOR_WINDOWFRAME          6
-#define COLOR_MENUTEXT             7
-#define COLOR_WINDOWTEXT           8
-#define COLOR_CAPTIONTEXT          9
-#define COLOR_ACTIVEBORDER        10
-#define COLOR_INACTIVEBORDER      11
-#define COLOR_APPWORKSPACE        12
-#define COLOR_HIGHLIGHT                   13
-#define COLOR_HIGHLIGHTTEXT       14
-#define COLOR_BTNFACE              15
-#define COLOR_BTNSHADOW            16
-#define COLOR_GRAYTEXT             17
-#define COLOR_BTNTEXT             18
-#define COLOR_INACTIVECAPTIONTEXT  19
-#define COLOR_BTNHIGHLIGHT         20
-/* win95 colors */
-#define COLOR_3DDKSHADOW           21
-#define COLOR_3DLIGHT              22
-#define COLOR_INFOTEXT             23
-#define COLOR_INFOBK               24
-#define COLOR_DESKTOP              COLOR_BACKGROUND
-#define COLOR_3DFACE               COLOR_BTNFACE
-#define COLOR_3DSHADOW             COLOR_BTNSHADOW
-#define COLOR_3DHIGHLIGHT          COLOR_BTNHIGHLIGHT
-#define COLOR_3DHILIGHT            COLOR_BTNHIGHLIGHT
-#define COLOR_BTNHILIGHT           COLOR_BTNHIGHLIGHT
-/* win98 colors */
-#define COLOR_ALTERNATEBTNFACE         25  /* undocumented, constant's name unknown */
-#define COLOR_HOTLIGHT                 26
-#define COLOR_GRADIENTACTIVECAPTION    27
-#define COLOR_GRADIENTINACTIVECAPTION  28
-
-  /* WM_CTLCOLOR values */
-#define CTLCOLOR_MSGBOX             0
-#define CTLCOLOR_EDIT               1
-#define CTLCOLOR_LISTBOX            2
-#define CTLCOLOR_BTN                3
-#define CTLCOLOR_DLG                4
-#define CTLCOLOR_SCROLLBAR          5
-#define CTLCOLOR_STATIC             6
-
-/* Edit control messages */
-#define EM_GETSEL                0x00b0
-#define EM_SETSEL                0x00b1
-#define EM_GETRECT               0x00b2
-#define EM_SETRECT               0x00b3
-#define EM_SETRECTNP             0x00b4
-#define EM_SCROLL                0x00b5
-#define EM_LINESCROLL            0x00b6
-#define EM_SCROLLCARET           0x00b7
-#define EM_GETMODIFY             0x00b8
-#define EM_SETMODIFY             0x00b9
-#define EM_GETLINECOUNT          0x00ba
-#define EM_LINEINDEX             0x00bb
-#define EM_SETHANDLE             0x00bc
-#define EM_GETHANDLE             0x00bd
-#define EM_GETTHUMB              0x00be
-/* FIXME : missing from specs 0x00bf and 0x00c0 */
-#define EM_LINELENGTH            0x00c1
-#define EM_REPLACESEL            0x00c2
-/* FIXME : missing from specs 0x00c3 */
-#define EM_GETLINE               0x00c4
-#define EM_LIMITTEXT             0x00c5
-#define EM_CANUNDO               0x00c6
-#define EM_UNDO                  0x00c7
-#define EM_FMTLINES              0x00c8
-#define EM_LINEFROMCHAR          0x00c9
-/* FIXME : missing from specs 0x00ca */
-#define EM_SETTABSTOPS           0x00cb
-#define EM_SETPASSWORDCHAR       0x00cc
-#define EM_EMPTYUNDOBUFFER       0x00cd
-#define EM_GETFIRSTVISIBLELINE   0x00ce
-#define EM_SETREADONLY           0x00cf
-#define EM_SETWORDBREAKPROC      0x00d0
-#define EM_GETWORDBREAKPROC      0x00d1
-#define EM_GETPASSWORDCHAR       0x00d2
-#define EM_SETMARGINS            0x00d3
-#define EM_GETMARGINS            0x00d4
-#define EM_GETLIMITTEXT          0x00d5
-#define EM_POSFROMCHAR           0x00d6
-#define EM_CHARFROMPOS           0x00d7
-/* a name change since win95 */
-#define EM_SETLIMITTEXT          EM_LIMITTEXT
-
-/* EDITWORDBREAKPROC code values */
-#define WB_LEFT         0
-#define WB_RIGHT        1
-#define WB_ISDELIMITER  2
-
-/* Edit control notification codes */
-#define EN_SETFOCUS     0x0100
-#define EN_KILLFOCUS    0x0200
-#define EN_CHANGE       0x0300
-#define EN_UPDATE       0x0400
-#define EN_ERRSPACE     0x0500
-#define EN_MAXTEXT      0x0501
-#define EN_HSCROLL      0x0601
-#define EN_VSCROLL      0x0602
-
-/* New since win95 : EM_SETMARGIN parameters */
-#define EC_LEFTMARGIN  0x0001
-#define EC_RIGHTMARGIN 0x0002
-#define EC_USEFONTINFO 0xffff
-
-
-/* Messages */
-
-  /* WM_GETDLGCODE values */
-
-
-#define WM_NULL                 0x0000
-#define WM_CREATE               0x0001
-#define WM_DESTROY              0x0002
-#define WM_MOVE                 0x0003
-#define WM_SIZEWAIT             0x0004
-#define WM_SIZE                 0x0005
-#define WM_ACTIVATE             0x0006
-#define WM_SETFOCUS             0x0007
-#define WM_KILLFOCUS            0x0008
-#define WM_SETVISIBLE           0x0009
-#define WM_ENABLE               0x000a
-#define WM_SETREDRAW            0x000b
-#define WM_SETTEXT              0x000c
-#define WM_GETTEXT              0x000d
-#define WM_GETTEXTLENGTH        0x000e
-#define WM_PAINT                0x000f
-#define WM_CLOSE                0x0010
-#define WM_QUERYENDSESSION      0x0011
-#define WM_QUIT                 0x0012
-#define WM_QUERYOPEN            0x0013
-#define WM_ERASEBKGND           0x0014
-#define WM_SYSCOLORCHANGE       0x0015
-#define WM_ENDSESSION           0x0016
-#define WM_SYSTEMERROR          0x0017
-#define WM_SHOWWINDOW           0x0018
-#define WM_CTLCOLOR             0x0019
-#define WM_WININICHANGE         0x001a
-#define WM_SETTINGCHANGE        WM_WININICHANGE
-#define WM_DEVMODECHANGE        0x001b
-#define WM_ACTIVATEAPP          0x001c
-#define WM_FONTCHANGE           0x001d
-#define WM_TIMECHANGE           0x001e
-#define WM_CANCELMODE           0x001f
-#define WM_SETCURSOR            0x0020
-#define WM_MOUSEACTIVATE        0x0021
-#define WM_CHILDACTIVATE        0x0022
-#define WM_QUEUESYNC            0x0023
-#define WM_GETMINMAXINFO        0x0024
-
-#define WM_PAINTICON            0x0026
-#define WM_ICONERASEBKGND       0x0027
-#define WM_NEXTDLGCTL           0x0028
-#define WM_ALTTABACTIVE         0x0029
-#define WM_SPOOLERSTATUS        0x002a
-#define WM_DRAWITEM             0x002b
-#define WM_MEASUREITEM          0x002c
-#define WM_DELETEITEM           0x002d
-#define WM_VKEYTOITEM           0x002e
-#define WM_CHARTOITEM           0x002f
-#define WM_SETFONT              0x0030
-#define WM_GETFONT              0x0031
-#define WM_SETHOTKEY            0x0032
-#define WM_GETHOTKEY            0x0033
-#define WM_FILESYSCHANGE        0x0034
-#define WM_ISACTIVEICON         0x0035
-#define WM_QUERYPARKICON        0x0036
-#define WM_QUERYDRAGICON        0x0037
-#define WM_QUERYSAVESTATE       0x0038
-#define WM_COMPAREITEM          0x0039
-#define WM_TESTING              0x003a
-
-#define WM_OTHERWINDOWCREATED  0x003c
-#define WM_OTHERWINDOWDESTROYED        0x003d
-#define WM_ACTIVATESHELLWINDOW 0x003e
-
-#define WM_COMPACTING          0x0041
-
-#define WM_COMMNOTIFY          0x0044
-#define WM_WINDOWPOSCHANGING   0x0046
-#define WM_WINDOWPOSCHANGED    0x0047
-#define WM_POWER               0x0048
-
-  /* Win32 4.0 messages */
-#define WM_COPYDATA            0x004a
-#define WM_CANCELJOURNAL       0x004b
-#define WM_NOTIFY              0x004e
-#define WM_HELP                        0x0053
-#define WM_NOTIFYFORMAT                0x0055
-
-#define WM_CONTEXTMENU         0x007b
-#define WM_STYLECHANGING       0x007c
-#define WM_STYLECHANGED                0x007d
-#define WM_DISPLAYCHANGE        0x007e
-#define WM_GETICON             0x007f
-#define WM_SETICON             0x0080
-
-  /* Non-client system messages */
-#define WM_NCCREATE         0x0081
-#define WM_NCDESTROY        0x0082
-#define WM_NCCALCSIZE       0x0083
-#define WM_NCHITTEST        0x0084
-#define WM_NCPAINT          0x0085
-#define WM_NCACTIVATE       0x0086
-
-#define WM_GETDLGCODE      0x0087
-#define WM_SYNCPAINT       0x0088
-#define WM_SYNCTASK        0x0089
-
-  /* Non-client mouse messages */
-#define WM_NCMOUSEMOVE      0x00a0
-#define WM_NCLBUTTONDOWN    0x00a1
-#define WM_NCLBUTTONUP      0x00a2
-#define WM_NCLBUTTONDBLCLK  0x00a3
-#define WM_NCRBUTTONDOWN    0x00a4
-#define WM_NCRBUTTONUP      0x00a5
-#define WM_NCRBUTTONDBLCLK  0x00a6
-#define WM_NCMBUTTONDOWN    0x00a7
-#define WM_NCMBUTTONUP      0x00a8
-#define WM_NCMBUTTONDBLCLK  0x00a9
-
-  /* Keyboard messages */
-#define WM_KEYDOWN          0x0100
-#define WM_KEYUP            0x0101
-#define WM_CHAR             0x0102
-#define WM_DEADCHAR         0x0103
-#define WM_SYSKEYDOWN       0x0104
-#define WM_SYSKEYUP         0x0105
-#define WM_SYSCHAR          0x0106
-#define WM_SYSDEADCHAR      0x0107
-#define WM_KEYFIRST         WM_KEYDOWN
-#define WM_KEYLAST          0x0108
-
-/* Win32 4.0 messages for IME */
-#define WM_IME_STARTCOMPOSITION     0x010d
-#define WM_IME_ENDCOMPOSITION       0x010e
-#define WM_IME_COMPOSITION          0x010f
-#define WM_IME_KEYLAST              0x010f
-
-#define WM_INITDIALOG       0x0110 
-#define WM_COMMAND          0x0111
-#define WM_SYSCOMMAND       0x0112
-#define WM_TIMER           0x0113
-#define WM_SYSTIMER        0x0118
-
-  /* scroll messages */
-#define WM_HSCROLL          0x0114
-#define WM_VSCROLL          0x0115
-
-/* Menu messages */
-#define WM_INITMENU         0x0116
-#define WM_INITMENUPOPUP    0x0117
-
-#define WM_MENUSELECT       0x011F
-#define WM_MENUCHAR         0x0120
-#define WM_ENTERIDLE        0x0121
-
-#define WM_LBTRACKPOINT     0x0131
-
-  /* Win32 CTLCOLOR messages */
-#define WM_CTLCOLORMSGBOX    0x0132
-#define WM_CTLCOLOREDIT      0x0133
-#define WM_CTLCOLORLISTBOX   0x0134
-#define WM_CTLCOLORBTN       0x0135
-#define WM_CTLCOLORDLG       0x0136
-#define WM_CTLCOLORSCROLLBAR 0x0137
-#define WM_CTLCOLORSTATIC    0x0138
-
-  /* Mouse messages */
-#define WM_MOUSEMOVE       0x0200
-#define WM_LBUTTONDOWN     0x0201
-#define WM_LBUTTONUP       0x0202
-#define WM_LBUTTONDBLCLK    0x0203
-#define WM_RBUTTONDOWN     0x0204
-#define WM_RBUTTONUP       0x0205
-#define WM_RBUTTONDBLCLK    0x0206
-#define WM_MBUTTONDOWN     0x0207
-#define WM_MBUTTONUP       0x0208
-#define WM_MBUTTONDBLCLK    0x0209
-#define WM_MOUSEWHEEL       0x020A
-#define WM_MOUSEFIRST      WM_MOUSEMOVE
-
-
-#define WM_MOUSELAST       WM_MOUSEWHEEL
-#define WHEEL_DELTA      120
-#define WHEEL_PAGESCROLL  (UINT_MAX)
-#define WM_PARENTNOTIFY     0x0210
-#define WM_ENTERMENULOOP    0x0211
-#define WM_EXITMENULOOP     0x0212
-#define WM_NEXTMENU        0x0213
-
-  /* Win32 4.0 messages */
-#define WM_SIZING          0x0214
-#define WM_CAPTURECHANGED   0x0215
-#define WM_MOVING          0x0216
-
-  /* MDI messages */
-#define WM_MDICREATE       0x0220
-#define WM_MDIDESTROY      0x0221
-#define WM_MDIACTIVATE     0x0222
-#define WM_MDIRESTORE      0x0223
-#define WM_MDINEXT         0x0224
-#define WM_MDIMAXIMIZE     0x0225
-#define WM_MDITILE         0x0226
-#define WM_MDICASCADE      0x0227
-#define WM_MDIICONARRANGE   0x0228
-#define WM_MDIGETACTIVE     0x0229
-#define WM_MDIREFRESHMENU   0x0234
-
-  /* D&D messages */
-#define WM_DROPOBJECT      0x022A
-#define WM_QUERYDROPOBJECT  0x022B
-#define WM_BEGINDRAG       0x022C
-#define WM_DRAGLOOP        0x022D
-#define WM_DRAGSELECT      0x022E
-#define WM_DRAGMOVE        0x022F
-#define WM_MDISETMENU      0x0230
-
-#define WM_ENTERSIZEMOVE    0x0231
-#define WM_EXITSIZEMOVE     0x0232
-#define WM_DROPFILES       0x0233
-
-
-/* Win32 4.0 messages for IME */
-#define WM_IME_SETCONTEXT           0x0281
-#define WM_IME_NOTIFY               0x0282
-#define WM_IME_CONTROL              0x0283
-#define WM_IME_COMPOSITIONFULL      0x0284
-#define WM_IME_SELECT               0x0285
-#define WM_IME_CHAR                 0x0286
-/* Win32 5.0 messages for IME */
-#define WM_IME_REQUEST              0x0288
-
-/* Win32 4.0 messages for IME */
-#define WM_IME_KEYDOWN              0x0290
-#define WM_IME_KEYUP                0x0291
-
-/* Clipboard command messages */
-#define WM_CUT               0x0300
-#define WM_COPY              0x0301
-#define WM_PASTE             0x0302
-#define WM_CLEAR             0x0303
-#define WM_UNDO              0x0304
-
-/* Clipboard owner messages */
-#define WM_RENDERFORMAT      0x0305
-#define WM_RENDERALLFORMATS  0x0306
-#define WM_DESTROYCLIPBOARD  0x0307
-
-/* Clipboard viewer messages */
-#define WM_DRAWCLIPBOARD     0x0308
-#define WM_PAINTCLIPBOARD    0x0309
-#define WM_VSCROLLCLIPBOARD  0x030A
-#define WM_SIZECLIPBOARD     0x030B
-#define WM_ASKCBFORMATNAME   0x030C
-#define WM_CHANGECBCHAIN     0x030D
-#define WM_HSCROLLCLIPBOARD  0x030E
-
-#define WM_QUERYNEWPALETTE   0x030F
-#define WM_PALETTEISCHANGING 0x0310
-#define WM_PALETTECHANGED    0x0311
-#define WM_HOTKEY           0x0312
-
-#define WM_PRINT             0x0317
-#define WM_PRINTCLIENT       0x0318
-
-  /* FIXME: This does not belong to any libwine interface header */
-  /* MFC messages [360-38f] */
-
-#define WM_QUERYAFXWNDPROC  0x0360
-#define WM_SIZEPARENT       0x0361
-#define WM_SETMESSAGESTRING 0x0362
-#define WM_IDLEUPDATECMDUI  0x0363 
-#define WM_INITIALUPDATE    0x0364
-#define WM_COMMANDHELP      0x0365
-#define WM_HELPHITTEST      0x0366
-#define WM_EXITHELPMODE     0x0367
-#define WM_RECALCPARENT     0x0368
-#define WM_SIZECHILD        0x0369
-#define WM_KICKIDLE         0x036A 
-#define WM_QUERYCENTERWND   0x036B
-#define WM_DISABLEMODAL     0x036C
-#define WM_FLOATSTATUS      0x036D 
-#define WM_ACTIVATETOPLEVEL 0x036E 
-#define WM_QUERY3DCONTROLS  0x036F 
-#define WM_SOCKET_NOTIFY    0x0373
-#define WM_SOCKET_DEAD      0x0374
-#define WM_POPMESSAGESTRING 0x0375
-#define WM_OCC_LOADFROMSTREAM           0x0376
-#define WM_OCC_LOADFROMSTORAGE          0x0377
-#define WM_OCC_INITNEW                  0x0378
-#define WM_OCC_LOADFROMSTREAM_EX        0x037A
-#define WM_OCC_LOADFROMSTORAGE_EX       0x037B
-#define WM_QUEUE_SENTINEL   0x0379
-
-#define WM_PENWINFIRST      0x0380
-#define WM_PENWINLAST       0x038F
-
-/* end of MFC messages */
-
-/* FIXME: The following two lines do not belong to any libwine interface header */
-#define WM_COALESCE_FIRST    0x0390
-#define WM_COALESCE_LAST     0x039F
-
-#define WM_APP               0x8000
-
-
-#define DLGC_WANTARROWS      0x0001
-#define DLGC_WANTTAB         0x0002
-#define DLGC_WANTALLKEYS     0x0004
-#define DLGC_WANTMESSAGE     0x0004
-#define DLGC_HASSETSEL       0x0008
-#define DLGC_DEFPUSHBUTTON   0x0010
-#define DLGC_UNDEFPUSHBUTTON 0x0020
-#define DLGC_RADIOBUTTON     0x0040
-#define DLGC_WANTCHARS       0x0080
-#define DLGC_STATIC          0x0100
-#define DLGC_BUTTON          0x2000
-
-/* Standard dialog button IDs */
-#define IDOK                1
-#define IDCANCEL            2
-#define IDABORT             3
-#define IDRETRY             4
-#define IDIGNORE            5
-#define IDYES               6
-#define IDNO                7
-#define IDCLOSE             8
-#define IDHELP              9      
-
-/****** Window classes ******/
-
-typedef struct tagCREATESTRUCTA
-{
-    LPVOID      lpCreateParams;
-    HINSTANCE hInstance;
-    HMENU     hMenu;
-    HWND      hwndParent;
-    INT       cy;
-    INT       cx;
-    INT       y;
-    INT       x;
-    LONG        style;
-    LPCSTR      lpszName;
-    LPCSTR      lpszClass;
-    DWORD       dwExStyle;
-} CREATESTRUCTA, *LPCREATESTRUCTA;
-
-typedef struct
-{
-    LPVOID      lpCreateParams;
-    HINSTANCE hInstance;
-    HMENU     hMenu;
-    HWND      hwndParent;
-    INT       cy;
-    INT       cx;
-    INT       y;
-    INT       x;
-    LONG        style;
-    LPCWSTR     lpszName;
-    LPCWSTR     lpszClass;
-    DWORD       dwExStyle;
-} CREATESTRUCTW, *LPCREATESTRUCTW;
-
-DECL_WINELIB_TYPE_AW(CREATESTRUCT)
-DECL_WINELIB_TYPE_AW(LPCREATESTRUCT)
-
-typedef struct
-{
-    HDC   hdc;
-    WIN_BOOL  fErase;
-    RECT  rcPaint;
-    WIN_BOOL  fRestore;
-    WIN_BOOL  fIncUpdate;
-    BYTE    rgbReserved[32];
-} PAINTSTRUCT, *PPAINTSTRUCT, *LPPAINTSTRUCT;
-
-typedef struct 
-{
-    HMENU   hWindowMenu;
-    UINT    idFirstChild;
-} CLIENTCREATESTRUCT, *LPCLIENTCREATESTRUCT;
-
-
-typedef struct
-{
-    LPCSTR       szClass;
-    LPCSTR       szTitle;
-    HINSTANCE  hOwner;
-    INT        x;
-    INT        y;
-    INT        cx;
-    INT        cy;
-    DWORD        style;
-    LPARAM       lParam;
-} MDICREATESTRUCTA, *LPMDICREATESTRUCTA;
-
-typedef struct
-{
-    LPCWSTR      szClass;
-    LPCWSTR      szTitle;
-    HINSTANCE  hOwner;
-    INT        x;
-    INT        y;
-    INT        cx;
-    INT        cy;
-    DWORD        style;
-    LPARAM       lParam;
-} MDICREATESTRUCTW, *LPMDICREATESTRUCTW;
-
-DECL_WINELIB_TYPE_AW(MDICREATESTRUCT)
-DECL_WINELIB_TYPE_AW(LPMDICREATESTRUCT)
-
-#define MDITILE_VERTICAL     0x0000   
-#define MDITILE_HORIZONTAL   0x0001
-#define MDITILE_SKIPDISABLED 0x0002
-
-#define MDIS_ALLCHILDSTYLES  0x0001
-
-typedef struct {
-    DWORD   styleOld;
-    DWORD   styleNew;
-} STYLESTRUCT, *LPSTYLESTRUCT;
-
-  /* Offsets for GetWindowLong() and GetWindowWord() */
-#define GWL_USERDATA        (-21)
-#define GWL_EXSTYLE         (-20)
-#define GWL_STYLE           (-16)
-#define GWW_ID              (-12)
-#define GWL_ID              GWW_ID
-#define GWW_HWNDPARENT      (-8)
-#define GWL_HWNDPARENT      GWW_HWNDPARENT
-#define GWW_HINSTANCE       (-6)
-#define GWL_HINSTANCE       GWW_HINSTANCE
-#define GWL_WNDPROC         (-4)
-#define DWL_MSGRESULT      0
-#define DWL_DLGPROC        4
-#define DWL_USER           8
-
-  /* GetWindow() constants */
-#define GW_HWNDFIRST   0
-#define GW_HWNDLAST    1
-#define GW_HWNDNEXT    2
-#define GW_HWNDPREV    3
-#define GW_OWNER       4
-#define GW_CHILD       5
-
-  /* WM_GETMINMAXINFO struct */
-typedef struct
-{
-    POINT   ptReserved;
-    POINT   ptMaxSize;
-    POINT   ptMaxPosition;
-    POINT   ptMinTrackSize;
-    POINT   ptMaxTrackSize;
-} MINMAXINFO, *PMINMAXINFO, *LPMINMAXINFO;
-
-
-  /* RedrawWindow() flags */
-#define RDW_INVALIDATE       0x0001
-#define RDW_INTERNALPAINT    0x0002
-#define RDW_ERASE            0x0004
-#define RDW_VALIDATE         0x0008
-#define RDW_NOINTERNALPAINT  0x0010
-#define RDW_NOERASE          0x0020
-#define RDW_NOCHILDREN       0x0040
-#define RDW_ALLCHILDREN      0x0080
-#define RDW_UPDATENOW        0x0100
-#define RDW_ERASENOW         0x0200
-#define RDW_FRAME            0x0400
-#define RDW_NOFRAME          0x0800
-
-/* debug flags */
-#define DBGFILL_ALLOC  0xfd
-#define DBGFILL_FREE   0xfb
-#define DBGFILL_BUFFER 0xf9
-#define DBGFILL_STACK  0xf7
-
-  /* WM_WINDOWPOSCHANGING/CHANGED struct */
-typedef struct tagWINDOWPOS
-{
-    HWND  hwnd;
-    HWND  hwndInsertAfter;
-    INT   x;
-    INT   y;
-    INT   cx;
-    INT   cy;
-    UINT  flags;
-} WINDOWPOS, *PWINDOWPOS, *LPWINDOWPOS;
-
-
-  /* WM_MOUSEACTIVATE return values */
-#define MA_ACTIVATE             1
-#define MA_ACTIVATEANDEAT       2
-#define MA_NOACTIVATE           3
-#define MA_NOACTIVATEANDEAT     4
-
-  /* WM_ACTIVATE wParam values */
-#define WA_INACTIVE             0
-#define WA_ACTIVE               1
-#define WA_CLICKACTIVE          2
-
-/* WM_GETICON/WM_SETICON params values */
-#define ICON_SMALL              0
-#define ICON_BIG                1
-
-  /* WM_NCCALCSIZE parameter structure */
-typedef struct
-{
-    RECT       rgrc[3];
-    WINDOWPOS *lppos;
-} NCCALCSIZE_PARAMS, *LPNCCALCSIZE_PARAMS;
-
-
-  /* WM_NCCALCSIZE return flags */
-#define WVR_ALIGNTOP        0x0010
-#define WVR_ALIGNLEFT       0x0020
-#define WVR_ALIGNBOTTOM     0x0040
-#define WVR_ALIGNRIGHT      0x0080
-#define WVR_HREDRAW         0x0100
-#define WVR_VREDRAW         0x0200
-#define WVR_REDRAW          (WVR_HREDRAW | WVR_VREDRAW)
-#define WVR_VALIDRECTS      0x0400
-
-  /* WM_NCHITTEST return codes */
-#define HTERROR             (-2)
-#define HTTRANSPARENT       (-1)
-#define HTNOWHERE           0
-#define HTCLIENT            1
-#define HTCAPTION           2
-#define HTSYSMENU           3
-#define HTSIZE              4
-#define HTMENU              5
-#define HTHSCROLL           6
-#define HTVSCROLL           7
-#define HTMINBUTTON         8
-#define HTMAXBUTTON         9
-#define HTLEFT              10
-#define HTRIGHT             11
-#define HTTOP               12
-#define HTTOPLEFT           13
-#define HTTOPRIGHT          14
-#define HTBOTTOM            15
-#define HTBOTTOMLEFT        16
-#define HTBOTTOMRIGHT       17
-#define HTBORDER            18
-#define HTGROWBOX           HTSIZE
-#define HTREDUCE            HTMINBUTTON
-#define HTZOOM              HTMAXBUTTON
-#define HTOBJECT            19
-#define HTCLOSE             20
-#define HTHELP              21
-#define HTSIZEFIRST         HTLEFT
-#define HTSIZELAST          HTBOTTOMRIGHT
-
-  /* WM_SYSCOMMAND parameters */
-#ifdef SC_SIZE /* at least HP-UX: already defined in /usr/include/sys/signal.h */
-#undef SC_SIZE
-#endif
-#define SC_SIZE         0xf000
-#define SC_MOVE         0xf010
-#define SC_MINIMIZE     0xf020
-#define SC_MAXIMIZE     0xf030
-#define SC_NEXTWINDOW   0xf040
-#define SC_PREVWINDOW   0xf050
-#define SC_CLOSE        0xf060
-#define SC_VSCROLL      0xf070
-#define SC_HSCROLL      0xf080
-#define SC_MOUSEMENU    0xf090
-#define SC_KEYMENU      0xf100
-#define SC_ARRANGE      0xf110
-#define SC_RESTORE      0xf120
-#define SC_TASKLIST     0xf130
-#define SC_SCREENSAVE   0xf140
-#define SC_HOTKEY       0xf150
-
-#define CS_VREDRAW          0x0001
-#define CS_HREDRAW          0x0002
-#define CS_KEYCVTWINDOW     0x0004
-#define CS_DBLCLKS          0x0008
-#define CS_OWNDC            0x0020
-#define CS_CLASSDC          0x0040
-#define CS_PARENTDC         0x0080
-#define CS_NOKEYCVT         0x0100
-#define CS_NOCLOSE          0x0200
-#define CS_SAVEBITS         0x0800
-#define CS_BYTEALIGNCLIENT  0x1000
-#define CS_BYTEALIGNWINDOW  0x2000
-#define CS_GLOBALCLASS      0x4000
-#define CS_IME              0x00010000
-
-#define PRF_CHECKVISIBLE    0x00000001L
-#define PRF_NONCLIENT       0x00000002L
-#define PRF_CLIENT          0x00000004L
-#define PRF_ERASEBKGND      0x00000008L
-#define PRF_CHILDREN        0x00000010L
-#define PRF_OWNED           0x00000020L
-  /* Offsets for GetClassLong() and GetClassWord() */
-#define GCL_MENUNAME        (-8)
-#define GCW_HBRBACKGROUND   (-10)
-#define GCL_HBRBACKGROUND   GCW_HBRBACKGROUND
-#define GCW_HCURSOR         (-12)
-#define GCL_HCURSOR         GCW_HCURSOR
-#define GCW_HICON           (-14)
-#define GCL_HICON           GCW_HICON
-#define GCW_HMODULE         (-16)
-#define GCL_HMODULE         GCW_HMODULE
-#define GCW_CBWNDEXTRA      (-18)
-#define GCL_CBWNDEXTRA      GCW_CBWNDEXTRA
-#define GCW_CBCLSEXTRA      (-20)
-#define GCL_CBCLSEXTRA      GCW_CBCLSEXTRA
-#define GCL_WNDPROC         (-24)
-#define GCW_STYLE           (-26)
-#define GCL_STYLE           GCW_STYLE
-#define GCW_ATOM            (-32)
-#define GCW_HICONSM         (-34)
-#define GCL_HICONSM         GCW_HICONSM
-
-
-/***** Window hooks *****/
-
-  /* Hook values */
-#define WH_MIN             (-1)
-#define WH_MSGFILTER       (-1)
-#define WH_JOURNALRECORD    0
-#define WH_JOURNALPLAYBACK  1
-#define WH_KEYBOARD        2
-#define WH_GETMESSAGE      3
-#define WH_CALLWNDPROC     4
-#define WH_CBT             5
-#define WH_SYSMSGFILTER            6
-#define WH_MOUSE           7
-#define WH_HARDWARE        8
-#define WH_DEBUG           9
-#define WH_SHELL            10
-#define WH_FOREGROUNDIDLE   11
-#define WH_CALLWNDPROCRET   12
-#define WH_MAX              12
-
-#define WH_MINHOOK          WH_MIN
-#define WH_MAXHOOK          WH_MAX
-#define WH_NB_HOOKS         (WH_MAXHOOK-WH_MINHOOK+1)
-
-  /* Hook action codes */
-#define HC_ACTION           0
-#define HC_GETNEXT          1
-#define HC_SKIP             2
-#define HC_NOREMOVE         3
-#define HC_NOREM            HC_NOREMOVE
-#define HC_SYSMODALON       4
-#define HC_SYSMODALOFF      5
-
-  /* CallMsgFilter() values */
-#define MSGF_DIALOGBOX      0
-#define MSGF_MESSAGEBOX     1
-#define MSGF_MENU           2
-#define MSGF_MOVE           3
-#define MSGF_SIZE           4
-#define MSGF_SCROLLBAR      5
-#define MSGF_NEXTWINDOW     6
-#define MSGF_MAINLOOP       8
-#define MSGF_USER        4096
-
-typedef struct
-{
-    UINT      style;
-    WNDPROC   lpfnWndProc;
-    INT       cbClsExtra;
-    INT       cbWndExtra;
-    HINSTANCE hInstance;
-    HICON     hIcon;
-    HCURSOR   hCursor;
-    HBRUSH    hbrBackground;
-    LPCSTR      lpszMenuName;
-    LPCSTR      lpszClassName;
-} WNDCLASSA, *LPWNDCLASSA;
-
-typedef struct
-{
-    UINT      style;
-    WNDPROC   lpfnWndProc;
-    INT       cbClsExtra;
-    INT       cbWndExtra;
-    HINSTANCE hInstance;
-    HICON     hIcon;
-    HCURSOR   hCursor;
-    HBRUSH    hbrBackground;
-    LPCWSTR     lpszMenuName;
-    LPCWSTR     lpszClassName;
-} WNDCLASSW, *LPWNDCLASSW;
-
-DECL_WINELIB_TYPE_AW(WNDCLASS)
-DECL_WINELIB_TYPE_AW(LPWNDCLASS)
-
-typedef struct {
-    DWORD dwData;
-    DWORD cbData;
-    LPVOID lpData;
-} COPYDATASTRUCT, *PCOPYDATASTRUCT, *LPCOPYDATASTRUCT;
-
-typedef struct {
-    HMENU hmenuIn;
-    HMENU hmenuNext;
-    HWND  hwndNext;
-} MDINEXTMENU, *PMDINEXTMENU, *LPMDINEXTMENU;
-
-/* WinHelp internal structure */
-typedef struct {
-       WORD size;
-       WORD command;
-       LONG data;
-       LONG reserved;
-       WORD ofsFilename;
-       WORD ofsData;
-} WINHELP,*LPWINHELP;
-
-typedef struct
-{
-    UINT16  mkSize;
-    BYTE    mkKeyList;
-    BYTE    szKeyphrase[1];
-} MULTIKEYHELP, *LPMULTIKEYHELP;
-
-typedef struct {
-       WORD wStructSize;
-       WORD x;
-       WORD y;
-       WORD dx;
-       WORD dy;
-       WORD wMax;
-       char rgchMember[2];
-} HELPWININFO, *LPHELPWININFO;
-
-#define HELP_CONTEXT        0x0001
-#define HELP_QUIT           0x0002
-#define HELP_INDEX          0x0003
-#define HELP_CONTENTS       0x0003
-#define HELP_HELPONHELP     0x0004
-#define HELP_SETINDEX       0x0005
-#define HELP_SETCONTENTS    0x0005
-#define HELP_CONTEXTPOPUP   0x0008
-#define HELP_FORCEFILE      0x0009
-#define HELP_KEY            0x0101
-#define HELP_COMMAND        0x0102
-#define HELP_PARTIALKEY     0x0105
-#define HELP_MULTIKEY       0x0201
-#define HELP_SETWINPOS      0x0203
-#define HELP_CONTEXTMENU    0x000a
-#define HELP_FINDER        0x000b
-#define HELP_WM_HELP       0x000c
-#define HELP_SETPOPUP_POS   0x000d
-
-#define HELP_TCARD         0x8000
-#define HELP_TCARD_DATA            0x0010
-#define HELP_TCARD_OTHER_CALLER 0x0011
-
-
-     /* ChangeDisplaySettings return codes */
-
-#define DISP_CHANGE_SUCCESSFUL 0
-#define DISP_CHANGE_RESTART    1
-#define DISP_CHANGE_FAILED     (-1)
-#define DISP_CHANGE_BADMODE    (-2)
-#define DISP_CHANGE_NOTUPDATED (-3)
-#define DISP_CHANGE_BADFLAGS   (-4)
-#define DISP_CHANGE_BADPARAM   (-5)
-
-/* ChangeDisplaySettings.dwFlags */
-#define        CDS_UPDATEREGISTRY      0x00000001
-#define        CDS_TEST                0x00000002
-#define        CDS_FULLSCREEN          0x00000004
-#define        CDS_GLOBAL              0x00000008
-#define        CDS_SET_PRIMARY         0x00000010
-#define        CDS_RESET               0x40000000
-#define        CDS_SETRECT             0x20000000
-#define        CDS_NORESET             0x10000000
-
-/* flags to FormatMessage */
-#define        FORMAT_MESSAGE_ALLOCATE_BUFFER  0x00000100
-#define        FORMAT_MESSAGE_IGNORE_INSERTS   0x00000200
-#define        FORMAT_MESSAGE_FROM_STRING      0x00000400
-#define        FORMAT_MESSAGE_FROM_HMODULE     0x00000800
-#define        FORMAT_MESSAGE_FROM_SYSTEM      0x00001000
-#define        FORMAT_MESSAGE_ARGUMENT_ARRAY   0x00002000
-#define        FORMAT_MESSAGE_MAX_WIDTH_MASK   0x000000FF
-
-typedef struct
-{
-    UINT      cbSize;
-    UINT      style;
-    WNDPROC   lpfnWndProc;
-    INT       cbClsExtra;
-    INT       cbWndExtra;
-    HINSTANCE hInstance;
-    HICON     hIcon;
-    HCURSOR   hCursor;
-    HBRUSH    hbrBackground;
-    LPCSTR      lpszMenuName;
-    LPCSTR      lpszClassName;
-    HICON     hIconSm;
-} WNDCLASSEXA, *LPWNDCLASSEXA;
-
-typedef struct
-{
-    UINT      cbSize;
-    UINT      style;
-    WNDPROC   lpfnWndProc;
-    INT       cbClsExtra;
-    INT       cbWndExtra;
-    HINSTANCE hInstance;
-    HICON     hIcon;
-    HCURSOR   hCursor;
-    HBRUSH    hbrBackground;
-    LPCWSTR     lpszMenuName;
-    LPCWSTR     lpszClassName;
-    HICON     hIconSm;
-} WNDCLASSEXW, *LPWNDCLASSEXW;
-
-DECL_WINELIB_TYPE_AW(WNDCLASSEX)
-DECL_WINELIB_TYPE_AW(LPWNDCLASSEX)
-
-typedef struct tagMSG
-{
-    HWND    hwnd;
-    UINT    message;
-    WPARAM  wParam;
-    LPARAM    lParam;
-    DWORD     time;
-    POINT   pt;
-} MSG, *LPMSG;
-
-#define POINTSTOPOINT(pt, pts)                          \
-        { (pt).x = (LONG)(SHORT)LOWORD(*(LONG*)&pts);   \
-          (pt).y = (LONG)(SHORT)HIWORD(*(LONG*)&pts); }          
-
-#define POINTTOPOINTS(pt)      (MAKELONG((short)((pt).x), (short)((pt).y)))
-
-
-/* Cursors / Icons */
-
-typedef struct {
-       WIN_BOOL        fIcon;
-       DWORD           xHotspot;
-       DWORD           yHotspot;
-       HBITMAP hbmMask;
-       HBITMAP hbmColor;
-} ICONINFO,*LPICONINFO;
-
-
-/* this is the 6 byte accel struct used in Win32 when presented to the user */
-typedef struct
-{
-    BYTE   fVirt;
-    BYTE   pad0;
-    WORD   key;
-    WORD   cmd;
-} ACCEL, *LPACCEL;
-
-/* this is the 8 byte accel struct used in Win32 resources (internal only) */
-typedef struct
-{
-    BYTE   fVirt;
-    BYTE   pad0;
-    WORD   key;
-    WORD   cmd;
-    WORD   pad1;
-} PE_ACCEL, *LPPE_ACCEL;
-
-
-/* Flags for TrackPopupMenu */
-#define TPM_LEFTBUTTON    0x0000
-#define TPM_RIGHTBUTTON   0x0002
-#define TPM_LEFTALIGN     0x0000
-#define TPM_CENTERALIGN   0x0004
-#define TPM_RIGHTALIGN    0x0008
-#define TPM_TOPALIGN      0x0000
-#define TPM_VCENTERALIGN  0x0010
-#define TPM_BOTTOMALIGN   0x0020
-#define TPM_HORIZONTAL    0x0000
-#define TPM_VERTICAL      0x0040
-#define TPM_NONOTIFY      0x0080
-#define TPM_RETURNCMD     0x0100
-
-typedef struct 
-{
-    UINT   cbSize;
-    RECT   rcExclude;
-} TPMPARAMS, *LPTPMPARAMS;
-
-/* FIXME: not sure this one is correct */
-typedef struct {
-  UINT    cbSize;
-  UINT    fMask;
-  UINT    fType;
-  UINT    fState;
-  UINT    wID;
-  HMENU   hSubMenu;
-  HBITMAP hbmpChecked;
-  HBITMAP hbmpUnchecked;
-  DWORD   dwItemData;
-  LPSTR   dwTypeData;
-  UINT    cch;
-  HBITMAP hbmpItem;
-} MENUITEMINFOA, *LPMENUITEMINFOA;
-
-typedef struct {
-  UINT    cbSize;
-  UINT    fMask;
-  UINT    fType;
-  UINT    fState;
-  UINT    wID;
-  HMENU   hSubMenu;
-  HBITMAP hbmpChecked;
-  HBITMAP hbmpUnchecked;
-  DWORD     dwItemData;
-  LPWSTR    dwTypeData;
-  UINT    cch;
-  HBITMAP hbmpItem;
-} MENUITEMINFOW, *LPMENUITEMINFOW;
-
-DECL_WINELIB_TYPE_AW(MENUITEMINFO)
-DECL_WINELIB_TYPE_AW(LPMENUITEMINFO)
-
-typedef struct {
-  DWORD   cbSize;
-  DWORD   fMask;
-  DWORD   dwStyle;
-  UINT    cyMax;
-  HBRUSH  hbrBack;
-  DWORD   dwContextHelpID;
-  DWORD   dwMenuData;
-} MENUINFO, *LPMENUINFO;
-
-typedef MENUINFO const * LPCMENUINFO;
-
-#define MIM_MAXHEIGHT          0x00000001
-#define MIM_BACKGROUND         0x00000002
-#define MIM_HELPID             0x00000004
-#define MIM_MENUDATA           0x00000008
-#define MIM_STYLE              0x00000010
-#define MIM_APPLYTOSUBMENUS    0x80000000
-
-typedef struct {
-  WORD versionNumber;
-  WORD offset;
-} MENUITEMTEMPLATEHEADER, *PMENUITEMTEMPLATEHEADER;
-
-
-typedef struct {
-  WORD mtOption;
-  WORD mtID;
-  WCHAR mtString[1];
-} MENUITEMTEMPLATE, *PMENUITEMTEMPLATE;
-
-
-typedef VOID   MENUTEMPLATE;
-typedef PVOID *LPMENUTEMPLATE;
-
-/* Field specifiers for MENUITEMINFO[AW] type.  */
-#define MIIM_STATE       0x00000001
-#define MIIM_ID          0x00000002
-#define MIIM_SUBMENU     0x00000004
-#define MIIM_CHECKMARKS  0x00000008
-#define MIIM_TYPE        0x00000010
-#define MIIM_DATA        0x00000020
-#define MIIM_STRING      0x00000040
-#define MIIM_BITMAP      0x00000080
-#define MIIM_FTYPE       0x00000100
-
-#define HBMMENU_CALLBACK       ((HBITMAP) -1)
-#define HBMMENU_SYSTEM         ((HBITMAP)  1)
-#define HBMMENU_MBAR_RESTORE   ((HBITMAP)  2)
-#define HBMMENU_MBAR_MINIMIZE  ((HBITMAP)  3)
-#define HBMMENU_MBAR_CLOSE     ((HBITMAP)  5)
-#define HBMMENU_MBAR_CLOSE_D   ((HBITMAP)  6)
-#define HBMMENU_MBAR_MINIMIZE_D        ((HBITMAP)  7)
-#define HBMMENU_POPUP_CLOSE    ((HBITMAP)  8)
-#define HBMMENU_POPUP_RESTORE  ((HBITMAP)  9)
-#define HBMMENU_POPUP_MAXIMIZE ((HBITMAP) 10)
-#define HBMMENU_POPUP_MINIMIZE ((HBITMAP) 11)
-
-/* DrawState defines ... */
-typedef WIN_BOOL CALLBACK (*DRAWSTATEPROC)(HDC,LPARAM,WPARAM,INT,INT);
-
-/* WM_H/VSCROLL commands */
-#define SB_LINEUP           0
-#define SB_LINELEFT         0
-#define SB_LINEDOWN         1
-#define SB_LINERIGHT        1
-#define SB_PAGEUP           2
-#define SB_PAGELEFT         2
-#define SB_PAGEDOWN         3
-#define SB_PAGERIGHT        3
-#define SB_THUMBPOSITION    4
-#define SB_THUMBTRACK       5
-#define SB_TOP              6
-#define SB_LEFT             6
-#define SB_BOTTOM           7
-#define SB_RIGHT            7
-#define SB_ENDSCROLL        8
-
-/* Scroll bar selection constants */
-#define SB_HORZ             0
-#define SB_VERT             1
-#define SB_CTL              2
-#define SB_BOTH             3
-
-/* Scrollbar styles */
-#define SBS_HORZ                    0x0000L
-#define SBS_VERT                    0x0001L
-#define SBS_TOPALIGN                0x0002L
-#define SBS_LEFTALIGN               0x0002L
-#define SBS_BOTTOMALIGN             0x0004L
-#define SBS_RIGHTALIGN              0x0004L
-#define SBS_SIZEBOXTOPLEFTALIGN     0x0002L
-#define SBS_SIZEBOXBOTTOMRIGHTALIGN 0x0004L
-#define SBS_SIZEBOX                 0x0008L
-#define SBS_SIZEGRIP                0x0010L
-
-/* EnableScrollBar() flags */
-#define ESB_ENABLE_BOTH     0x0000
-#define ESB_DISABLE_BOTH    0x0003
-
-#define ESB_DISABLE_LEFT    0x0001
-#define ESB_DISABLE_RIGHT   0x0002
-
-#define ESB_DISABLE_UP      0x0001
-#define ESB_DISABLE_DOWN    0x0002
-
-#define ESB_DISABLE_LTUP    ESB_DISABLE_LEFT
-#define ESB_DISABLE_RTDN    ESB_DISABLE_RIGHT
-
-/* Win32 button control messages */
-#define BM_GETCHECK          0x00f0
-#define BM_SETCHECK          0x00f1
-#define BM_GETSTATE          0x00f2
-#define BM_SETSTATE          0x00f3
-#define BM_SETSTYLE          0x00f4
-#define BM_CLICK             0x00f5
-#define BM_GETIMAGE          0x00f6
-#define BM_SETIMAGE          0x00f7
-/* Winelib button control messages */
-
-/* Button notification codes */
-#define BN_CLICKED             0
-#define BN_PAINT               1
-#define BN_HILITE              2
-#define BN_UNHILITE            3
-#define BN_DISABLE             4
-#define BN_DOUBLECLICKED       5
-
-/* Button states */
-#define BST_UNCHECKED        0x0000
-#define BST_CHECKED          0x0001
-#define BST_INDETERMINATE    0x0002
-#define BST_PUSHED           0x0004
-#define BST_FOCUS            0x0008      
-
-/* Static Control Styles */
-#define SS_LEFT             0x00000000L
-#define SS_CENTER           0x00000001L
-#define SS_RIGHT            0x00000002L
-#define SS_ICON             0x00000003L
-#define SS_BLACKRECT        0x00000004L
-#define SS_GRAYRECT         0x00000005L
-#define SS_WHITERECT        0x00000006L
-#define SS_BLACKFRAME       0x00000007L
-#define SS_GRAYFRAME        0x00000008L
-#define SS_WHITEFRAME       0x00000009L
-
-#define SS_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_NOTIFY           0x00000100L
-#define SS_CENTERIMAGE      0x00000200L
-#define SS_RIGHTJUST        0x00000400L
-#define SS_REALSIZEIMAGE    0x00000800L
-#define SS_SUNKEN           0x00001000L
-
-/* Static Control Messages */
-#define STM_SETICON       0x0170
-#define STM_GETICON       0x0171
-#define STM_SETIMAGE        0x0172
-#define STM_GETIMAGE        0x0173
-
-/* Scrollbar messages */
-#define SBM_SETPOS             0x00e0
-#define SBM_GETPOS             0x00e1
-#define SBM_SETRANGE           0x00e2
-#define SBM_GETRANGE           0x00e3
-#define SBM_ENABLE_ARROWS      0x00e4
-#define SBM_SETRANGEREDRAW     0x00e6
-#define SBM_SETSCROLLINFO      0x00e9
-#define SBM_GETSCROLLINFO      0x00ea
-
-/* Scrollbar info */
-typedef struct
-{
-    UINT    cbSize;
-    UINT    fMask;
-    INT     nMin;
-    INT     nMax;
-    UINT    nPage;
-    INT     nPos;
-    INT     nTrackPos;
-} SCROLLINFO, *LPSCROLLINFO;
-/* GetScrollInfo() flags */ 
-#define SIF_RANGE           0x0001
-#define SIF_PAGE            0x0002
-#define SIF_POS             0x0004
-#define SIF_DISABLENOSCROLL 0x0008
-#define SIF_TRACKPOS        0x0010
-#define SIF_ALL             (SIF_RANGE | SIF_PAGE | SIF_POS | SIF_TRACKPOS)
-
-/* Listbox styles */
-#define LBS_NOTIFY               0x0001
-#define LBS_SORT                 0x0002
-#define LBS_NOREDRAW             0x0004
-#define LBS_MULTIPLESEL          0x0008
-#define LBS_OWNERDRAWFIXED       0x0010
-#define LBS_OWNERDRAWVARIABLE    0x0020
-#define LBS_HASSTRINGS           0x0040
-#define LBS_USETABSTOPS          0x0080
-#define LBS_NOINTEGRALHEIGHT     0x0100
-#define LBS_MULTICOLUMN          0x0200
-#define LBS_WANTKEYBOARDINPUT    0x0400
-#define LBS_EXTENDEDSEL          0x0800
-#define LBS_DISABLENOSCROLL      0x1000
-#define LBS_NODATA               0x2000
-#define LBS_NOSEL                0x4000
-#define LBS_STANDARD  (LBS_NOTIFY | LBS_SORT | WS_VSCROLL | WS_BORDER)
-
-/* Listbox messages */
-#define LB_ADDSTRING           0x0180
-#define LB_INSERTSTRING        0x0181
-#define LB_DELETESTRING        0x0182
-#define LB_SELITEMRANGEEX      0x0183
-#define LB_RESETCONTENT        0x0184
-#define LB_SETSEL              0x0185
-#define LB_SETCURSEL           0x0186
-#define LB_GETSEL              0x0187
-#define LB_GETCURSEL           0x0188
-#define LB_GETTEXT             0x0189
-#define LB_GETTEXTLEN          0x018a
-#define LB_GETCOUNT            0x018b
-#define LB_SELECTSTRING        0x018c
-#define LB_DIR                 0x018d
-#define LB_GETTOPINDEX         0x018e
-#define LB_FINDSTRING          0x018f
-#define LB_GETSELCOUNT         0x0190
-#define LB_GETSELITEMS         0x0191
-#define LB_SETTABSTOPS         0x0192
-#define LB_GETHORIZONTALEXTENT 0x0193
-#define LB_SETHORIZONTALEXTENT 0x0194
-#define LB_SETCOLUMNWIDTH      0x0195
-#define LB_ADDFILE             0x0196
-#define LB_SETTOPINDEX         0x0197
-#define LB_GETITEMRECT         0x0198
-#define LB_GETITEMDATA         0x0199
-#define LB_SETITEMDATA         0x019a
-#define LB_SELITEMRANGE        0x019b
-#define LB_SETANCHORINDEX      0x019c
-#define LB_GETANCHORINDEX      0x019d
-#define LB_SETCARETINDEX       0x019e
-#define LB_GETCARETINDEX       0x019f
-#define LB_SETITEMHEIGHT       0x01a0
-#define LB_GETITEMHEIGHT       0x01a1
-#define LB_FINDSTRINGEXACT     0x01a2
-#define LB_CARETON             0x01a3
-#define LB_CARETOFF            0x01a4
-#define LB_SETLOCALE           0x01a5
-#define LB_GETLOCALE           0x01a6
-#define LB_SETCOUNT            0x01a7
-#define LB_INITSTORAGE         0x01a8
-#define LB_ITEMFROMPOINT       0x01a9
-
-/* Listbox notification codes */
-#define LBN_ERRSPACE        (-2)
-#define LBN_SELCHANGE       1
-#define LBN_DBLCLK          2
-#define LBN_SELCANCEL       3
-#define LBN_SETFOCUS        4
-#define LBN_KILLFOCUS       5
-
-/* Listbox message return values */
-#define LB_OKAY             0
-#define LB_ERR              (-1)
-#define LB_ERRSPACE         (-2)
-
-#define LB_CTLCODE          0L
-
-/* Combo box styles */
-#define CBS_SIMPLE            0x0001L
-#define CBS_DROPDOWN          0x0002L
-#define CBS_DROPDOWNLIST      0x0003L
-#define CBS_OWNERDRAWFIXED    0x0010L
-#define CBS_OWNERDRAWVARIABLE 0x0020L
-#define CBS_AUTOHSCROLL       0x0040L
-#define CBS_OEMCONVERT        0x0080L
-#define CBS_SORT              0x0100L
-#define CBS_HASSTRINGS        0x0200L
-#define CBS_NOINTEGRALHEIGHT  0x0400L
-#define CBS_DISABLENOSCROLL   0x0800L
-
-#define CBS_UPPERCASE        0x2000L
-#define CBS_LOWERCASE        0x4000L
-
-
-/* Combo box messages */
-#define CB_GETEDITSEL            0x0140
-#define CB_LIMITTEXT             0x0141
-#define CB_SETEDITSEL            0x0142
-#define CB_ADDSTRING             0x0143
-#define CB_DELETESTRING          0x0144
-#define CB_DIR                   0x0145
-#define CB_GETCOUNT              0x0146
-#define CB_GETCURSEL             0x0147
-#define CB_GETLBTEXT             0x0148
-#define CB_GETLBTEXTLEN          0x0149
-#define CB_INSERTSTRING          0x014a
-#define CB_RESETCONTENT          0x014b
-#define CB_FINDSTRING            0x014c
-#define CB_SELECTSTRING          0x014d
-#define CB_SETCURSEL             0x014e
-#define CB_SHOWDROPDOWN          0x014f
-#define CB_GETITEMDATA           0x0150
-#define CB_SETITEMDATA           0x0151
-#define CB_GETDROPPEDCONTROLRECT 0x0152
-#define CB_SETITEMHEIGHT         0x0153
-#define CB_GETITEMHEIGHT         0x0154
-#define CB_SETEXTENDEDUI         0x0155
-#define CB_GETEXTENDEDUI         0x0156
-#define CB_GETDROPPEDSTATE       0x0157
-#define CB_FINDSTRINGEXACT       0x0158
-#define CB_SETLOCALE             0x0159
-#define CB_GETLOCALE             0x015a
-#define CB_GETTOPINDEX           0x015b
-#define CB_SETTOPINDEX           0x015c
-#define CB_GETHORIZONTALEXTENT   0x015d
-#define CB_SETHORIZONTALEXTENT   0x015e
-#define CB_GETDROPPEDWIDTH       0x015f
-#define CB_SETDROPPEDWIDTH       0x0160
-#define CB_INITSTORAGE           0x0161
-
-/* Combo box notification codes */
-#define CBN_ERRSPACE        (-1)
-#define CBN_SELCHANGE       1
-#define CBN_DBLCLK          2
-#define CBN_SETFOCUS        3
-#define CBN_KILLFOCUS       4
-#define CBN_EDITCHANGE      5
-#define CBN_EDITUPDATE      6
-#define CBN_DROPDOWN        7
-#define CBN_CLOSEUP         8
-#define CBN_SELENDOK        9
-#define CBN_SELENDCANCEL    10
-
-/* Combo box message return values */
-#define CB_OKAY             0
-#define CB_ERR              (-1)
-#define CB_ERRSPACE         (-2)
-
-#define MB_OK                  0x00000000
-#define MB_OKCANCEL            0x00000001
-#define MB_ABORTRETRYIGNORE    0x00000002
-#define MB_YESNOCANCEL         0x00000003
-#define MB_YESNO               0x00000004
-#define MB_RETRYCANCEL         0x00000005
-#define MB_TYPEMASK            0x0000000F
-
-#define MB_ICONHAND            0x00000010
-#define MB_ICONQUESTION                0x00000020
-#define MB_ICONEXCLAMATION     0x00000030
-#define MB_ICONASTERISK                0x00000040
-#define        MB_USERICON             0x00000080
-#define MB_ICONMASK            0x000000F0
-
-#define MB_ICONINFORMATION     MB_ICONASTERISK
-#define MB_ICONSTOP            MB_ICONHAND
-#define MB_ICONWARNING         MB_ICONEXCLAMATION
-#define MB_ICONERROR           MB_ICONHAND
-
-#define MB_DEFBUTTON1          0x00000000
-#define MB_DEFBUTTON2          0x00000100
-#define MB_DEFBUTTON3          0x00000200
-#define MB_DEFBUTTON4          0x00000300
-#define MB_DEFMASK             0x00000F00
-
-#define MB_APPLMODAL           0x00000000
-#define MB_SYSTEMMODAL         0x00001000
-#define MB_TASKMODAL           0x00002000
-#define MB_MODEMASK            0x00003000
-
-#define MB_HELP                        0x00004000
-#define MB_NOFOCUS             0x00008000
-#define MB_MISCMASK            0x0000C000
-
-#define MB_SETFOREGROUND       0x00010000
-#define MB_DEFAULT_DESKTOP_ONLY        0x00020000
-#define MB_SERVICE_NOTIFICATION        0x00040000
-#define MB_TOPMOST             0x00040000
-#define MB_RIGHT               0x00080000
-#define MB_RTLREADING          0x00100000
-
-#define        HELPINFO_WINDOW         0x0001
-#define        HELPINFO_MENUITEM       0x0002
-
-/* Structure pointed to by lParam of WM_HELP */
-typedef struct                 
-{
-    UINT       cbSize;         /* Size in bytes of this struct  */
-    INT        iContextType;   /* Either HELPINFO_WINDOW or HELPINFO_MENUITEM */
-    INT        iCtrlId;        /* Control Id or a Menu item Id. */
-    HANDLE     hItemHandle;    /* hWnd of control or hMenu.     */
-    DWORD      dwContextId;    /* Context Id associated with this item */
-    POINT      MousePos;       /* Mouse Position in screen co-ordinates */
-}  HELPINFO,*LPHELPINFO;
-
-typedef void CALLBACK (*MSGBOXCALLBACK)(LPHELPINFO lpHelpInfo);
-
-typedef struct
-{
-    UINT       cbSize;
-    HWND       hwndOwner;
-    HINSTANCE  hInstance;
-    LPCSTR     lpszText;
-    LPCSTR     lpszCaption;
-    DWORD      dwStyle;
-    LPCSTR     lpszIcon;
-    DWORD      dwContextHelpId;
-    MSGBOXCALLBACK     lpfnMsgBoxCallback;
-    DWORD      dwLanguageId;
-} MSGBOXPARAMSA,*LPMSGBOXPARAMSA;
-
-typedef struct
-{
-    UINT       cbSize;
-    HWND       hwndOwner;
-    HINSTANCE  hInstance;
-    LPCWSTR    lpszText;
-    LPCWSTR    lpszCaption;
-    DWORD      dwStyle;
-    LPCWSTR    lpszIcon;
-    DWORD      dwContextHelpId;
-    MSGBOXCALLBACK     lpfnMsgBoxCallback;
-    DWORD      dwLanguageId;
-} MSGBOXPARAMSW,*LPMSGBOXPARAMSW;
-
-DECL_WINELIB_TYPE_AW(MSGBOXPARAMS)
-DECL_WINELIB_TYPE_AW(LPMSGBOXPARAMS)
-
-typedef struct _numberfmt32a {
-    UINT NumDigits;
-    UINT LeadingZero;
-    UINT Grouping;
-    LPCSTR lpDecimalSep;
-    LPCSTR lpThousandSep;
-    UINT NegativeOrder;
-} NUMBERFMTA;
-
-typedef struct _numberfmt32w {
-    UINT NumDigits;
-    UINT LeadingZero;
-    UINT Grouping;
-    LPCWSTR lpDecimalSep;
-    LPCWSTR lpThousandSep;
-    UINT NegativeOrder;
-} NUMBERFMTW;
-
-typedef struct _currencyfmt32a
-{   
-       UINT      NumDigits;   
-       UINT      LeadingZero; 
-       UINT      Grouping;   
-       LPCSTR    lpDecimalSep;   
-       LPCSTR    lpThousandSep; 
-       UINT      NegativeOrder;   
-       UINT      PositiveOrder; 
-       LPCSTR    lpCurrencySymbol;
-} CURRENCYFMTA; 
-
-typedef struct _currencyfmt32w
-{   
-       UINT      NumDigits;   
-       UINT      LeadingZero; 
-       UINT      Grouping;   
-       LPCWSTR   lpDecimalSep;   
-       LPCWSTR   lpThousandSep; 
-       UINT      NegativeOrder;   
-       UINT      PositiveOrder; 
-       LPCWSTR   lpCurrencySymbol;
-} CURRENCYFMTW; 
-
-#define MONITOR_DEFAULTTONULL       0x00000000
-#define MONITOR_DEFAULTTOPRIMARY    0x00000001
-#define MONITOR_DEFAULTTONEAREST    0x00000002
-
-#define MONITORINFOF_PRIMARY        0x00000001
-
-typedef struct tagMONITORINFO
-{
-    DWORD   cbSize;
-    RECT  rcMonitor;
-    RECT  rcWork;
-    DWORD   dwFlags;
-} MONITORINFO, *LPMONITORINFO;
-
-
-typedef WIN_BOOL  CALLBACK (*MONITORENUMPROC)(HMONITOR,HDC,LPRECT,LPARAM);
-
-/* FIXME: use this instead of LPCVOID for CreateDialogIndirectParam
-   and DialogBoxIndirectParam */
-typedef struct tagDLGTEMPLATE
-{
-    DWORD style;
-    DWORD dwExtendedStyle;
-    WORD cdit;
-    short x;
-    short y;
-    short cx;
-    short cy;
-} DLGTEMPLATE;
-
-typedef DLGTEMPLATE *LPDLGTEMPLATEA;
-typedef DLGTEMPLATE *LPDLGTEMPLATEW;
-#define LPDLGTEMPLATE WINELIB_NAME_AW(LPDLGTEMPLATE)
-typedef const DLGTEMPLATE *LPCDLGTEMPLATEA;
-typedef const DLGTEMPLATE *LPCDLGTEMPLATEW;
-#define LPCDLGTEMPLATE WINELIB_NAME_AW(LPCDLGTEMPLATE)
-
-typedef struct tagDLGITEMTEMPLATE
-{
-    DWORD style;
-    DWORD dwExtendedStyle;
-    short x;
-    short y;
-    short cx;
-    short cy;
-    WORD id;
-} DLGITEMTEMPLATE;
-
-typedef DLGITEMTEMPLATE *LPDLGITEMTEMPLATEA;
-typedef DLGITEMTEMPLATE *LPDLGITEMTEMPLATEW;
-#define LPDLGITEMTEMPLATE WINELIB_NAME_AW(LPDLGITEMTEMPLATE)
-typedef const DLGITEMTEMPLATE *LPCDLGITEMTEMPLATEA;
-typedef const DLGITEMTEMPLATE *LPCDLGITEMTEMPLATEW;
-#define LPCDLGITEMTEMPLATE WINELIB_NAME_AW(LPCDLGITEMTEMPLATE)
-
-
-  /* CBT hook values */
-#define HCBT_MOVESIZE      0
-#define HCBT_MINMAX        1
-#define HCBT_QS            2
-#define HCBT_CREATEWND     3
-#define HCBT_DESTROYWND            4
-#define HCBT_ACTIVATE      5
-#define HCBT_CLICKSKIPPED   6
-#define HCBT_KEYSKIPPED     7
-#define HCBT_SYSCOMMAND            8
-#define HCBT_SETFOCUS      9
-
-  /* CBT hook structures */
-
-typedef struct
-{
-    CREATESTRUCTA *lpcs;
-    HWND           hwndInsertAfter;
-} CBT_CREATEWNDA, *LPCBT_CREATEWNDA;
-
-typedef struct
-{
-    CREATESTRUCTW *lpcs;
-    HWND           hwndInsertAfter;
-} CBT_CREATEWNDW, *LPCBT_CREATEWNDW;
-
-DECL_WINELIB_TYPE_AW(CBT_CREATEWND)
-DECL_WINELIB_TYPE_AW(LPCBT_CREATEWND)
-
-typedef struct
-{
-    WIN_BOOL    fMouse;
-    HWND    hWndActive;
-} CBTACTIVATESTRUCT, *LPCBTACTIVATESTRUCT;
-
-
-/* modifiers for RegisterHotKey */
-#define        MOD_ALT         0x0001
-#define        MOD_CONTROL     0x0002
-#define        MOD_SHIFT       0x0004
-#define        MOD_WIN         0x0008
-
-/* ids for RegisterHotKey */
-#define        IDHOT_SNAPWINDOW        (-1)    /* SHIFT-PRINTSCRN  */
-#define        IDHOT_SNAPDESKTOP       (-2)    /* PRINTSCRN        */
-
-  /* keybd_event flags */
-#define KEYEVENTF_EXTENDEDKEY        0x0001
-#define KEYEVENTF_KEYUP              0x0002
-#define KEYEVENTF_WINE_FORCEEXTENDED 0x8000
-
-  /* mouse_event flags */
-#define MOUSEEVENTF_MOVE        0x0001
-#define MOUSEEVENTF_LEFTDOWN    0x0002
-#define MOUSEEVENTF_LEFTUP      0x0004
-#define MOUSEEVENTF_RIGHTDOWN   0x0008
-#define MOUSEEVENTF_RIGHTUP     0x0010
-#define MOUSEEVENTF_MIDDLEDOWN  0x0020
-#define MOUSEEVENTF_MIDDLEUP    0x0040
-#define MOUSEEVENTF_WHEEL       0x0800
-#define MOUSEEVENTF_ABSOLUTE    0x8000
-
-/* ExitWindows() flags */
-#define EW_RESTARTWINDOWS   0x0042
-#define EW_REBOOTSYSTEM     0x0043
-#define EW_EXITANDEXECAPP   0x0044
-
-/* ExitWindowsEx() flags */
-#define EWX_LOGOFF           0
-#define EWX_SHUTDOWN         1
-#define EWX_REBOOT           2
-#define EWX_FORCE            4
-#define EWX_POWEROFF         8
-
-/* SetLastErrorEx types */
-#define        SLE_ERROR       0x00000001
-#define        SLE_MINORERROR  0x00000002
-#define        SLE_WARNING     0x00000003
-
-/* Predefined resources */
-#define IDI_APPLICATIONA MAKEINTRESOURCEA(32512)
-#define IDI_APPLICATIONW MAKEINTRESOURCEW(32512)
-#define IDI_APPLICATION    WINELIB_NAME_AW(IDI_APPLICATION)
-#define IDI_HANDA        MAKEINTRESOURCEA(32513)
-#define IDI_HANDW        MAKEINTRESOURCEW(32513)
-#define IDI_HAND           WINELIB_NAME_AW(IDI_HAND)
-#define IDI_QUESTIONA    MAKEINTRESOURCEA(32514)
-#define IDI_QUESTIONW    MAKEINTRESOURCEW(32514)
-#define IDI_QUESTION       WINELIB_NAME_AW(IDI_QUESTION)
-#define IDI_EXCLAMATIONA MAKEINTRESOURCEA(32515)
-#define IDI_EXCLAMATIONW MAKEINTRESOURCEW(32515)
-#define IDI_EXCLAMATION    WINELIB_NAME_AW(IDI_EXCLAMATION)
-#define IDI_ASTERISKA    MAKEINTRESOURCEA(32516)
-#define IDI_ASTERISKW    MAKEINTRESOURCEW(32516)
-#define IDI_ASTERISK       WINELIB_NAME_AW(IDI_ASTERISK)
-
-#define IDC_BUMMERA      MAKEINTRESOURCEA(100)
-#define IDC_BUMMERW      MAKEINTRESOURCEW(100)
-#define IDC_BUMMER         WINELIB_NAME_AW(IDC_BUMMER)
-#define IDC_ARROWA       MAKEINTRESOURCEA(32512)
-#define IDC_ARROWW       MAKEINTRESOURCEW(32512)
-#define IDC_ARROW          WINELIB_NAME_AW(IDC_ARROW)
-#define IDC_IBEAMA       MAKEINTRESOURCEA(32513)
-#define IDC_IBEAMW       MAKEINTRESOURCEW(32513)
-#define IDC_IBEAM          WINELIB_NAME_AW(IDC_IBEAM)
-#define IDC_WAITA        MAKEINTRESOURCEA(32514)
-#define IDC_WAITW        MAKEINTRESOURCEW(32514)
-#define IDC_WAIT           WINELIB_NAME_AW(IDC_WAIT)
-#define IDC_CROSSA       MAKEINTRESOURCEA(32515)
-#define IDC_CROSSW       MAKEINTRESOURCEW(32515)
-#define IDC_CROSS          WINELIB_NAME_AW(IDC_CROSS)
-#define IDC_UPARROWA     MAKEINTRESOURCEA(32516)
-#define IDC_UPARROWW     MAKEINTRESOURCEW(32516)
-#define IDC_UPARROW        WINELIB_NAME_AW(IDC_UPARROW)
-#define IDC_SIZEA        MAKEINTRESOURCEA(32640)
-#define IDC_SIZEW        MAKEINTRESOURCEW(32640)
-#define IDC_SIZE           WINELIB_NAME_AW(IDC_SIZE)
-#define IDC_ICONA        MAKEINTRESOURCEA(32641)
-#define IDC_ICONW        MAKEINTRESOURCEW(32641)
-#define IDC_ICON           WINELIB_NAME_AW(IDC_ICON)
-#define IDC_SIZENWSEA    MAKEINTRESOURCEA(32642)
-#define IDC_SIZENWSEW    MAKEINTRESOURCEW(32642)
-#define IDC_SIZENWSE       WINELIB_NAME_AW(IDC_SIZENWSE)
-#define IDC_SIZENESWA    MAKEINTRESOURCEA(32643)
-#define IDC_SIZENESWW    MAKEINTRESOURCEW(32643)
-#define IDC_SIZENESW       WINELIB_NAME_AW(IDC_SIZENESW)
-#define IDC_SIZEWEA      MAKEINTRESOURCEA(32644)
-#define IDC_SIZEWEW      MAKEINTRESOURCEW(32644)
-#define IDC_SIZEWE         WINELIB_NAME_AW(IDC_SIZEWE)
-#define IDC_SIZENSA      MAKEINTRESOURCEA(32645)
-#define IDC_SIZENSW      MAKEINTRESOURCEW(32645)
-#define IDC_SIZENS         WINELIB_NAME_AW(IDC_SIZENS)
-#define IDC_SIZEALLA     MAKEINTRESOURCEA(32646)
-#define IDC_SIZEALLW     MAKEINTRESOURCEW(32646)
-#define IDC_SIZEALL        WINELIB_NAME_AW(IDC_SIZEALL)
-#define IDC_NOA          MAKEINTRESOURCEA(32648)
-#define IDC_NOW          MAKEINTRESOURCEW(32648)
-#define IDC_NO             WINELIB_NAME_AW(IDC_NO)
-#define IDC_APPSTARTINGA MAKEINTRESOURCEA(32650)
-#define IDC_APPSTARTINGW MAKEINTRESOURCEW(32650)
-#define IDC_APPSTARTING    WINELIB_NAME_AW(IDC_APPSTARTING)
-#define IDC_HELPA        MAKEINTRESOURCEA(32651)
-#define IDC_HELPW        MAKEINTRESOURCEW(32651)
-#define IDC_HELP           WINELIB_NAME_AW(IDC_HELP)
-
-#define MNC_IGNORE 0
-#define MNC_CLOSE 1
-#define MNC_EXECUTE 2
-#define MNC_SELECT 3 
-
-/* SystemParametersInfo */
-/* defines below are for all win versions */
-#define SPI_GETBEEP               1
-#define SPI_SETBEEP               2
-#define SPI_GETMOUSE              3
-#define SPI_SETMOUSE              4
-#define SPI_GETBORDER             5
-#define SPI_SETBORDER             6
-#define SPI_GETKEYBOARDSPEED      10
-#define SPI_SETKEYBOARDSPEED      11
-#define SPI_LANGDRIVER            12
-#define SPI_ICONHORIZONTALSPACING 13
-#define SPI_GETSCREENSAVETIMEOUT  14
-#define SPI_SETSCREENSAVETIMEOUT  15
-#define SPI_GETSCREENSAVEACTIVE   16
-#define SPI_SETSCREENSAVEACTIVE   17
-#define SPI_GETGRIDGRANULARITY    18
-#define SPI_SETGRIDGRANULARITY    19
-#define SPI_SETDESKWALLPAPER      20
-#define SPI_SETDESKPATTERN        21
-#define SPI_GETKEYBOARDDELAY      22
-#define SPI_SETKEYBOARDDELAY      23
-#define SPI_ICONVERTICALSPACING   24
-#define SPI_GETICONTITLEWRAP      25
-#define SPI_SETICONTITLEWRAP      26
-#define SPI_GETMENUDROPALIGNMENT  27
-#define SPI_SETMENUDROPALIGNMENT  28
-#define SPI_SETDOUBLECLKWIDTH     29
-#define SPI_SETDOUBLECLKHEIGHT    30
-#define SPI_GETICONTITLELOGFONT   31
-#define SPI_SETDOUBLECLICKTIME    32
-#define SPI_SETMOUSEBUTTONSWAP    33
-#define SPI_SETICONTITLELOGFONT   34
-#define SPI_GETFASTTASKSWITCH     35
-#define SPI_SETFASTTASKSWITCH     36
-#define SPI_SETDRAGFULLWINDOWS    37
-#define SPI_GETDRAGFULLWINDOWS   38
-
-#define SPI_GETFILTERKEYS         50
-#define SPI_SETFILTERKEYS         51
-#define SPI_GETTOGGLEKEYS         52
-#define SPI_SETTOGGLEKEYS         53
-#define SPI_GETMOUSEKEYS          54
-#define SPI_SETMOUSEKEYS          55
-#define SPI_GETSHOWSOUNDS         56
-#define SPI_SETSHOWSOUNDS         57
-#define SPI_GETSTICKYKEYS         58
-#define SPI_SETSTICKYKEYS         59
-#define SPI_GETACCESSTIMEOUT      60
-#define SPI_SETACCESSTIMEOUT      61
-
-#define SPI_GETSOUNDSENTRY        64
-#define SPI_SETSOUNDSENTRY        65
-
-/* defines below are for all win versions WINVER >= 0x0400 */
-#define SPI_SETDRAGFULLWINDOWS    37
-#define SPI_GETDRAGFULLWINDOWS    38
-#define SPI_GETNONCLIENTMETRICS   41
-#define SPI_SETNONCLIENTMETRICS   42
-#define SPI_GETMINIMIZEDMETRICS   43
-#define SPI_SETMINIMIZEDMETRICS   44
-#define SPI_GETICONMETRICS        45
-#define SPI_SETICONMETRICS        46
-#define SPI_SETWORKAREA           47
-#define SPI_GETWORKAREA           48
-#define SPI_SETPENWINDOWS         49
-
-#define SPI_GETSERIALKEYS         62
-#define SPI_SETSERIALKEYS         63
-#define SPI_GETHIGHCONTRAST       66
-#define SPI_SETHIGHCONTRAST       67
-#define SPI_GETKEYBOARDPREF       68
-#define SPI_SETKEYBOARDPREF       69
-#define SPI_GETSCREENREADER       70
-#define SPI_SETSCREENREADER       71
-#define SPI_GETANIMATION          72
-#define SPI_SETANIMATION          73
-#define SPI_GETFONTSMOOTHING      74
-#define SPI_SETFONTSMOOTHING      75
-#define SPI_SETDRAGWIDTH          76
-#define SPI_SETDRAGHEIGHT         77
-#define SPI_SETHANDHELD           78
-#define SPI_GETLOWPOWERTIMEOUT    79
-#define SPI_GETPOWEROFFTIMEOUT    80
-#define SPI_SETLOWPOWERTIMEOUT    81
-#define SPI_SETPOWEROFFTIMEOUT    82
-#define SPI_GETLOWPOWERACTIVE     83
-#define SPI_GETPOWEROFFACTIVE     84
-#define SPI_SETLOWPOWERACTIVE     85
-#define SPI_SETPOWEROFFACTIVE     86
-#define SPI_SETCURSORS            87
-#define SPI_SETICONS              88
-#define SPI_GETDEFAULTINPUTLANG   89
-#define SPI_SETDEFAULTINPUTLANG   90
-#define SPI_SETLANGTOGGLE         91
-#define SPI_GETWINDOWSEXTENSION   92
-#define SPI_SETMOUSETRAILS        93
-#define SPI_GETMOUSETRAILS        94
-#define SPI_SETSCREENSAVERRUNNING 97
-#define SPI_SCREENSAVERRUNNING    SPI_SETSCREENSAVERRUNNING
-
-/* defines below are for all win versions (_WIN32_WINNT >= 0x0400) ||
- *                                        (_WIN32_WINDOWS > 0x0400) */
-#define SPI_GETMOUSEHOVERWIDTH    98
-#define SPI_SETMOUSEHOVERWIDTH    99
-#define SPI_GETMOUSEHOVERHEIGHT   100
-#define SPI_SETMOUSEHOVERHEIGHT   101
-#define SPI_GETMOUSEHOVERTIME     102
-#define SPI_SETMOUSEHOVERTIME     103
-#define SPI_GETWHEELSCROLLLINES   104
-#define SPI_SETWHEELSCROLLLINES   105
-
-#define SPI_GETSHOWIMEUI          110
-#define SPI_SETSHOWIMEUI          111
-
-/* defines below are for all win versions WINVER >= 0x0500 */
-#define SPI_GETMOUSESPEED         112
-#define SPI_SETMOUSESPEED         113
-#define SPI_GETSCREENSAVERRUNNING 114
-
-#define SPI_GETACTIVEWINDOWTRACKING    0x1000
-#define SPI_SETACTIVEWINDOWTRACKING    0x1001
-#define SPI_GETMENUANIMATION           0x1002
-#define SPI_SETMENUANIMATION           0x1003
-#define SPI_GETCOMBOBOXANIMATION       0x1004
-#define SPI_SETCOMBOBOXANIMATION       0x1005
-#define SPI_GETLISTBOXSMOOTHSCROLLING  0x1006
-#define SPI_SETLISTBOXSMOOTHSCROLLING  0x1007
-#define SPI_GETGRADIENTCAPTIONS        0x1008
-#define SPI_SETGRADIENTCAPTIONS        0x1009
-#define SPI_GETMENUUNDERLINES          0x100A
-#define SPI_SETMENUUNDERLINES          0x100B
-#define SPI_GETACTIVEWNDTRKZORDER      0x100C
-#define SPI_SETACTIVEWNDTRKZORDER      0x100D
-#define SPI_GETHOTTRACKING             0x100E
-#define SPI_SETHOTTRACKING             0x100F
-#define SPI_GETFOREGROUNDLOCKTIMEOUT   0x2000
-#define SPI_SETFOREGROUNDLOCKTIMEOUT   0x2001
-#define SPI_GETACTIVEWNDTRKTIMEOUT     0x2002
-#define SPI_SETACTIVEWNDTRKTIMEOUT     0x2003
-#define SPI_GETFOREGROUNDFLASHCOUNT    0x2004
-#define SPI_SETFOREGROUNDFLASHCOUNT    0x2005
-
-/* SystemParametersInfo flags */
-
-#define SPIF_UPDATEINIFILE              1
-#define SPIF_SENDWININICHANGE           2
-#define SPIF_SENDCHANGE                 SPIF_SENDWININICHANGE
-
-
-
-
-/* Window Styles */
-#define WS_OVERLAPPED    0x00000000L
-#define WS_POPUP         0x80000000L
-#define WS_CHILD         0x40000000L
-#define WS_MINIMIZE      0x20000000L
-#define WS_VISIBLE       0x10000000L
-#define WS_DISABLED      0x08000000L
-#define WS_CLIPSIBLINGS  0x04000000L
-#define WS_CLIPCHILDREN  0x02000000L
-#define WS_MAXIMIZE      0x01000000L
-#define WS_CAPTION       0x00C00000L
-#define WS_BORDER        0x00800000L
-#define WS_DLGFRAME      0x00400000L
-#define WS_VSCROLL       0x00200000L
-#define WS_HSCROLL       0x00100000L
-#define WS_SYSMENU       0x00080000L
-#define WS_THICKFRAME    0x00040000L
-#define WS_GROUP         0x00020000L
-#define WS_TABSTOP       0x00010000L
-#define WS_MINIMIZEBOX   0x00020000L
-#define WS_MAXIMIZEBOX   0x00010000L
-#define WS_TILED         WS_OVERLAPPED
-#define WS_ICONIC        WS_MINIMIZE
-#define WS_SIZEBOX       WS_THICKFRAME
-#define WS_OVERLAPPEDWINDOW (WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME| WS_MINIMIZEBOX | WS_MAXIMIZEBOX)
-#define WS_POPUPWINDOW (WS_POPUP | WS_BORDER | WS_SYSMENU)
-#define WS_CHILDWINDOW (WS_CHILD)
-#define WS_TILEDWINDOW (WS_OVERLAPPEDWINDOW)
-
-/* Window extended styles */
-#define WS_EX_DLGMODALFRAME    0x00000001L
-#define WS_EX_DRAGDETECT       0x00000002L
-#define WS_EX_NOPARENTNOTIFY   0x00000004L
-#define WS_EX_TOPMOST          0x00000008L
-#define WS_EX_ACCEPTFILES      0x00000010L
-#define WS_EX_TRANSPARENT      0x00000020L
-
-/* New Win95/WinNT4 styles */
-#define WS_EX_MDICHILD         0x00000040L
-#define WS_EX_TOOLWINDOW       0x00000080L
-#define WS_EX_WINDOWEDGE       0x00000100L
-#define WS_EX_CLIENTEDGE       0x00000200L
-#define WS_EX_CONTEXTHELP      0x00000400L
-#define WS_EX_RIGHT            0x00001000L
-#define WS_EX_LEFT             0x00000000L
-#define WS_EX_RTLREADING       0x00002000L
-#define WS_EX_LTRREADING       0x00000000L
-#define WS_EX_LEFTSCROLLBAR    0x00004000L
-#define WS_EX_RIGHTSCROLLBAR   0x00000000L
-#define WS_EX_CONTROLPARENT    0x00010000L
-#define WS_EX_STATICEDGE       0x00020000L
-#define WS_EX_APPWINDOW        0x00040000L
-
-#define WS_EX_OVERLAPPEDWINDOW (WS_EX_WINDOWEDGE|WS_EX_CLIENTEDGE)
-#define WS_EX_PALETTEWINDOW    (WS_EX_WINDOWEDGE|WS_EX_TOOLWINDOW|WS_EX_TOPMOST)
-
-/* WINE internal... */
-#define WS_EX_TRAYWINDOW       0x80000000L
-
-/* Window scrolling */
-#define SW_SCROLLCHILDREN      0x0001
-#define SW_INVALIDATE          0x0002
-#define SW_ERASE               0x0004
-
-/* CreateWindow() coordinates */
-#define CW_USEDEFAULT ((INT)0x80000000)
-
-/* ChildWindowFromPointEx Flags */
-#define CWP_ALL                0x0000
-#define CWP_SKIPINVISIBLE      0x0001
-#define CWP_SKIPDISABLED       0x0002
-#define CWP_SKIPTRANSPARENT    0x0004
-
-  /* PeekMessage() options */
-#define PM_NOREMOVE    0x0000
-#define PM_REMOVE      0x0001
-#define PM_NOYIELD     0x0002
-
-/* WM_SHOWWINDOW wParam codes */
-#define SW_PARENTCLOSING    1
-#define SW_OTHERMAXIMIZED   2
-#define SW_PARENTOPENING    3
-#define SW_OTHERRESTORED    4
-
-  /* ShowWindow() codes */
-#define SW_HIDE             0
-#define SW_SHOWNORMAL       1
-#define SW_NORMAL           1
-#define SW_SHOWMINIMIZED    2
-#define SW_SHOWMAXIMIZED    3
-#define SW_MAXIMIZE         3
-#define SW_SHOWNOACTIVATE   4
-#define SW_SHOW             5
-#define SW_MINIMIZE         6
-#define SW_SHOWMINNOACTIVE  7
-#define SW_SHOWNA           8
-#define SW_RESTORE          9
-#define SW_SHOWDEFAULT     10
-#define SW_MAX             10
-#define SW_NORMALNA        0xCC        /* undoc. flag in MinMaximize */
-
-  /* WM_SIZE message wParam values */
-#define SIZE_RESTORED        0
-#define SIZE_MINIMIZED       1
-#define SIZE_MAXIMIZED       2
-#define SIZE_MAXSHOW         3
-#define SIZE_MAXHIDE         4
-#define SIZENORMAL           SIZE_RESTORED
-#define SIZEICONIC           SIZE_MINIMIZED
-#define SIZEFULLSCREEN       SIZE_MAXIMIZED
-#define SIZEZOOMSHOW         SIZE_MAXSHOW
-#define SIZEZOOMHIDE         SIZE_MAXHIDE
-
-/* SetWindowPos() and WINDOWPOS flags */
-#define SWP_NOSIZE          0x0001
-#define SWP_NOMOVE          0x0002
-#define SWP_NOZORDER        0x0004
-#define SWP_NOREDRAW        0x0008
-#define SWP_NOACTIVATE      0x0010
-#define SWP_FRAMECHANGED    0x0020  /* The frame changed: send WM_NCCALCSIZE */
-#define SWP_SHOWWINDOW      0x0040
-#define SWP_HIDEWINDOW      0x0080
-#define SWP_NOCOPYBITS      0x0100
-#define SWP_NOOWNERZORDER   0x0200  /* Don't do owner Z ordering */
-
-#define SWP_DRAWFRAME       SWP_FRAMECHANGED
-#define SWP_NOREPOSITION    SWP_NOOWNERZORDER
-
-#define SWP_NOSENDCHANGING  0x0400
-#define SWP_DEFERERASE      0x2000
-#define SWP_ASYNCWINDOWPOS  0x4000
-
-#define HWND_DESKTOP        ((HWND)0)
-#define HWND_BROADCAST      ((HWND)0xffff)
-
-/* SetWindowPos() hwndInsertAfter field values */
-#define HWND_TOP            ((HWND)0)
-#define HWND_BOTTOM         ((HWND)1)
-#define HWND_TOPMOST        ((HWND)-1)
-#define HWND_NOTOPMOST      ((HWND)-2)
-
-#define MF_INSERT          0x0000
-#define MF_CHANGE          0x0080
-#define MF_APPEND          0x0100
-#define MF_DELETE          0x0200
-#define MF_REMOVE          0x1000
-#define MF_END             0x0080
-
-#define MF_ENABLED         0x0000
-#define MF_GRAYED          0x0001
-#define MF_DISABLED        0x0002
-#define MF_STRING          0x0000
-#define MF_BITMAP          0x0004
-#define MF_UNCHECKED       0x0000
-#define MF_CHECKED         0x0008
-#define MF_POPUP           0x0010
-#define MF_MENUBARBREAK    0x0020
-#define MF_MENUBREAK       0x0040
-#define MF_UNHILITE        0x0000
-#define MF_HILITE          0x0080
-#define MF_OWNERDRAW       0x0100
-#define MF_USECHECKBITMAPS 0x0200
-#define MF_BYCOMMAND       0x0000
-#define MF_BYPOSITION      0x0400
-#define MF_SEPARATOR       0x0800
-#define MF_DEFAULT         0x1000
-#define MF_SYSMENU         0x2000
-#define MF_HELP            0x4000
-#define MF_RIGHTJUSTIFY    0x4000
-#define MF_MOUSESELECT     0x8000
-
-/* Flags for extended menu item types.  */
-#define MFT_STRING         MF_STRING
-#define MFT_BITMAP         MF_BITMAP
-#define MFT_MENUBARBREAK   MF_MENUBARBREAK
-#define MFT_MENUBREAK      MF_MENUBREAK
-#define MFT_OWNERDRAW      MF_OWNERDRAW
-#define MFT_RADIOCHECK     0x00000200L
-#define MFT_SEPARATOR      MF_SEPARATOR
-#define MFT_RIGHTORDER     0x00002000L
-#define MFT_RIGHTJUSTIFY   MF_RIGHTJUSTIFY
-
-/* Flags for extended menu item states.  */
-#define MFS_GRAYED          0x00000003L
-#define MFS_DISABLED        MFS_GRAYED
-#define MFS_CHECKED         MF_CHECKED
-#define MFS_HILITE          MF_HILITE
-#define MFS_ENABLED         MF_ENABLED
-#define MFS_UNCHECKED       MF_UNCHECKED
-#define MFS_UNHILITE        MF_UNHILITE
-#define MFS_DEFAULT         MF_DEFAULT
-#define MFS_MASK            0x0000108BL
-#define MFS_HOTTRACKDRAWN   0x10000000L
-#define MFS_CACHEDBMP       0x20000000L
-#define MFS_BOTTOMGAPDROP   0x40000000L
-#define MFS_TOPGAPDROP      0x80000000L
-#define MFS_GAPDROP         0xC0000000L
-
-/* for GetMenuDefaultItem */
-#define GMDI_USEDISABLED    0x0001L
-#define GMDI_GOINTOPOPUPS   0x0002L
-
-#define DT_TOP 0
-#define DT_LEFT 0
-#define DT_CENTER 1
-#define DT_RIGHT 2
-#define DT_VCENTER 4
-#define DT_BOTTOM 8
-#define DT_WORDBREAK 16
-#define DT_SINGLELINE 32
-#define DT_EXPANDTABS 64
-#define DT_TABSTOP 128
-#define DT_NOCLIP 256
-#define DT_EXTERNALLEADING 512
-#define DT_CALCRECT 1024
-#define DT_NOPREFIX 2048
-#define DT_INTERNAL 4096
-
-/* DrawCaption()/DrawCaptionTemp() flags */
-#define DC_ACTIVE              0x0001
-#define DC_SMALLCAP            0x0002
-#define DC_ICON                        0x0004
-#define DC_TEXT                        0x0008
-#define DC_INBUTTON            0x0010
-
-/* DrawEdge() flags */
-#define BDR_RAISEDOUTER    0x0001
-#define BDR_SUNKENOUTER    0x0002
-#define BDR_RAISEDINNER    0x0004
-#define BDR_SUNKENINNER    0x0008
-
-#define BDR_OUTER          0x0003
-#define BDR_INNER          0x000c
-#define BDR_RAISED         0x0005
-#define BDR_SUNKEN         0x000a
-
-#define EDGE_RAISED        (BDR_RAISEDOUTER | BDR_RAISEDINNER)
-#define EDGE_SUNKEN        (BDR_SUNKENOUTER | BDR_SUNKENINNER)
-#define EDGE_ETCHED        (BDR_SUNKENOUTER | BDR_RAISEDINNER)
-#define EDGE_BUMP          (BDR_RAISEDOUTER | BDR_SUNKENINNER)
-
-/* border flags */
-#define BF_LEFT            0x0001
-#define BF_TOP             0x0002
-#define BF_RIGHT           0x0004
-#define BF_BOTTOM          0x0008
-#define BF_DIAGONAL        0x0010
-#define BF_MIDDLE          0x0800  /* Fill in the middle */
-#define BF_SOFT            0x1000  /* For softer buttons */
-#define BF_ADJUST          0x2000  /* Calculate the space left over */
-#define BF_FLAT            0x4000  /* For flat rather than 3D borders */
-#define BF_MONO            0x8000  /* For monochrome borders */
-#define BF_TOPLEFT         (BF_TOP | BF_LEFT)
-#define BF_TOPRIGHT        (BF_TOP | BF_RIGHT)
-#define BF_BOTTOMLEFT      (BF_BOTTOM | BF_LEFT)
-#define BF_BOTTOMRIGHT     (BF_BOTTOM | BF_RIGHT)
-#define BF_RECT            (BF_LEFT | BF_TOP | BF_RIGHT | BF_BOTTOM)
-#define BF_DIAGONAL_ENDTOPRIGHT     (BF_DIAGONAL | BF_TOP | BF_RIGHT)
-#define BF_DIAGONAL_ENDTOPLEFT      (BF_DIAGONAL | BF_TOP | BF_LEFT)
-#define BF_DIAGONAL_ENDBOTTOMLEFT   (BF_DIAGONAL | BF_BOTTOM | BF_LEFT)
-#define BF_DIAGONAL_ENDBOTTOMRIGHT  (BF_DIAGONAL | BF_BOTTOM | BF_RIGHT)
-
-/* DrawFrameControl() uType's */
-
-#define DFC_CAPTION             1
-#define DFC_MENU                2
-#define DFC_SCROLL              3
-#define DFC_BUTTON              4
-
-/* uState's */
-
-#define DFCS_CAPTIONCLOSE       0x0000
-#define DFCS_CAPTIONMIN         0x0001
-#define DFCS_CAPTIONMAX         0x0002
-#define DFCS_CAPTIONRESTORE     0x0003
-#define DFCS_CAPTIONHELP        0x0004         /* Windows 95 only */
-
-#define DFCS_MENUARROW          0x0000
-#define DFCS_MENUCHECK          0x0001
-#define DFCS_MENUBULLET         0x0002
-#define DFCS_MENUARROWRIGHT     0x0004
-
-#define DFCS_SCROLLUP            0x0000
-#define DFCS_SCROLLDOWN          0x0001
-#define DFCS_SCROLLLEFT          0x0002
-#define DFCS_SCROLLRIGHT         0x0003
-#define DFCS_SCROLLCOMBOBOX      0x0005
-#define DFCS_SCROLLSIZEGRIP      0x0008
-#define DFCS_SCROLLSIZEGRIPRIGHT 0x0010
-
-#define DFCS_BUTTONCHECK        0x0000
-#define DFCS_BUTTONRADIOIMAGE   0x0001
-#define DFCS_BUTTONRADIOMASK    0x0002         /* to draw nonsquare button */
-#define DFCS_BUTTONRADIO        0x0004
-#define DFCS_BUTTON3STATE       0x0008
-#define DFCS_BUTTONPUSH         0x0010
-
-/* additional state of the control */
-
-#define DFCS_INACTIVE           0x0100
-#define DFCS_PUSHED             0x0200
-#define DFCS_CHECKED            0x0400
-#define DFCS_ADJUSTRECT         0x2000         /* exclude surrounding edge */
-#define DFCS_FLAT               0x4000
-#define DFCS_MONO               0x8000
-
-/* Image type */
-#define        DST_COMPLEX     0x0000
-#define        DST_TEXT        0x0001
-#define        DST_PREFIXTEXT  0x0002
-#define        DST_ICON        0x0003
-#define        DST_BITMAP      0x0004
-
-/* State type */
-#define        DSS_NORMAL      0x0000
-#define        DSS_UNION       0x0010  /* Gray string appearance */
-#define        DSS_DISABLED    0x0020
-#define        DSS_DEFAULT     0x0040  /* Make it bold */
-#define        DSS_MONO        0x0080
-#define        DSS_RIGHT       0x8000
-
-typedef struct
-{
-    UINT      CtlType;
-    UINT      CtlID;
-    UINT      itemID;
-    UINT      itemAction;
-    UINT      itemState;
-    HWND      hwndItem;
-    HDC       hDC;
-    RECT      rcItem WINE_PACKED;
-    DWORD       itemData WINE_PACKED;
-} DRAWITEMSTRUCT, *PDRAWITEMSTRUCT, *LPDRAWITEMSTRUCT;
-
-
-typedef struct
-{
-    UINT      CtlType;
-    UINT      CtlID;
-    UINT      itemID;
-    UINT      itemWidth;
-    UINT      itemHeight;
-    DWORD       itemData;
-} MEASUREITEMSTRUCT, *PMEASUREITEMSTRUCT, *LPMEASUREITEMSTRUCT;
-
-
-typedef struct
-{
-    UINT     CtlType;
-    UINT     CtlID;
-    UINT     itemID;
-    HWND     hwndItem;
-    DWORD      itemData;
-} DELETEITEMSTRUCT, *LPDELETEITEMSTRUCT;
-
-
-typedef struct
-{
-    UINT      CtlType;
-    UINT      CtlID;
-    HWND      hwndItem;
-    UINT      itemID1;
-    DWORD       itemData1;
-    UINT      itemID2;
-    DWORD       itemData2;
-    DWORD       dwLocaleId;
-} COMPAREITEMSTRUCT, *PCOMPAREITEMSTRUCT, *LPCOMPAREITEMSTRUCT;
-
-
-/* WM_KEYUP/DOWN/CHAR HIWORD(lParam) flags */
-#define KF_EXTENDED         0x0100
-#define KF_DLGMODE          0x0800
-#define KF_MENUMODE         0x1000
-#define KF_ALTDOWN          0x2000
-#define KF_REPEAT           0x4000
-#define KF_UP               0x8000
-
-/* Virtual key codes */
-#define VK_LBUTTON          0x01
-#define VK_RBUTTON          0x02
-#define VK_CANCEL           0x03
-#define VK_MBUTTON          0x04
-/*                          0x05-0x07  Undefined */
-#define VK_BACK             0x08
-#define VK_TAB              0x09
-/*                          0x0A-0x0B  Undefined */
-#define VK_CLEAR            0x0C
-#define VK_RETURN           0x0D
-/*                          0x0E-0x0F  Undefined */
-#define VK_SHIFT            0x10
-#define VK_CONTROL          0x11
-#define VK_MENU             0x12
-#define VK_PAUSE            0x13
-#define VK_CAPITAL          0x14
-/*                          0x15-0x19  Reserved for Kanji systems */
-/*                          0x1A       Undefined */
-#define VK_ESCAPE           0x1B
-/*                          0x1C-0x1F  Reserved for Kanji systems */
-#define VK_SPACE            0x20
-#define VK_PRIOR            0x21
-#define VK_NEXT             0x22
-#define VK_END              0x23
-#define VK_HOME             0x24
-#define VK_LEFT             0x25
-#define VK_UP               0x26
-#define VK_RIGHT            0x27
-#define VK_DOWN             0x28
-#define VK_SELECT           0x29
-#define VK_PRINT            0x2A /* OEM specific in Windows 3.1 SDK */
-#define VK_EXECUTE          0x2B
-#define VK_SNAPSHOT         0x2C
-#define VK_INSERT           0x2D
-#define VK_DELETE           0x2E
-#define VK_HELP             0x2F
-#define VK_0                0x30
-#define VK_1                0x31
-#define VK_2                0x32
-#define VK_3                0x33
-#define VK_4                0x34
-#define VK_5                0x35
-#define VK_6                0x36
-#define VK_7                0x37
-#define VK_8                0x38
-#define VK_9                0x39
-/*                          0x3A-0x40  Undefined */
-#define VK_A                0x41
-#define VK_B                0x42
-#define VK_C                0x43
-#define VK_D                0x44
-#define VK_E                0x45
-#define VK_F                0x46
-#define VK_G                0x47
-#define VK_H                0x48
-#define VK_I                0x49
-#define VK_J                0x4A
-#define VK_K                0x4B
-#define VK_L                0x4C
-#define VK_M                0x4D
-#define VK_N                0x4E
-#define VK_O                0x4F
-#define VK_P                0x50
-#define VK_Q                0x51
-#define VK_R                0x52
-#define VK_S                0x53
-#define VK_T                0x54
-#define VK_U                0x55
-#define VK_V                0x56
-#define VK_W                0x57
-#define VK_X                0x58
-#define VK_Y                0x59
-#define VK_Z                0x5A
-
-#define VK_LWIN             0x5B
-#define VK_RWIN             0x5C
-#define VK_APPS             0x5D
-/*                          0x5E-0x5F Unassigned */
-#define VK_NUMPAD0          0x60
-#define VK_NUMPAD1          0x61
-#define VK_NUMPAD2          0x62
-#define VK_NUMPAD3          0x63
-#define VK_NUMPAD4          0x64
-#define VK_NUMPAD5          0x65
-#define VK_NUMPAD6          0x66
-#define VK_NUMPAD7          0x67
-#define VK_NUMPAD8          0x68
-#define VK_NUMPAD9          0x69
-#define VK_MULTIPLY         0x6A
-#define VK_ADD              0x6B
-#define VK_SEPARATOR        0x6C
-#define VK_SUBTRACT         0x6D
-#define VK_DECIMAL          0x6E
-#define VK_DIVIDE           0x6F
-#define VK_F1               0x70
-#define VK_F2               0x71
-#define VK_F3               0x72
-#define VK_F4               0x73
-#define VK_F5               0x74
-#define VK_F6               0x75
-#define VK_F7               0x76
-#define VK_F8               0x77
-#define VK_F9               0x78
-#define VK_F10              0x79
-#define VK_F11              0x7A
-#define VK_F12              0x7B
-#define VK_F13              0x7C
-#define VK_F14              0x7D
-#define VK_F15              0x7E
-#define VK_F16              0x7F
-#define VK_F17              0x80
-#define VK_F18              0x81
-#define VK_F19              0x82
-#define VK_F20              0x83
-#define VK_F21              0x84
-#define VK_F22              0x85
-#define VK_F23              0x86
-#define VK_F24              0x87
-/*                          0x88-0x8F  Unassigned */
-#define VK_NUMLOCK          0x90
-#define VK_SCROLL           0x91
-/*                          0x92-0x9F  Unassigned */
-/*
- * differencing between right and left shift/control/alt key.
- * Used only by GetAsyncKeyState() and GetKeyState().
- */
-#define VK_LSHIFT           0xA0
-#define VK_RSHIFT           0xA1
-#define VK_LCONTROL         0xA2
-#define VK_RCONTROL         0xA3
-#define VK_LMENU            0xA4
-#define VK_RMENU            0xA5
-/*                          0xA6-0xB9  Unassigned */
-#define VK_OEM_1            0xBA
-#define VK_OEM_PLUS         0xBB
-#define VK_OEM_COMMA        0xBC
-#define VK_OEM_MINUS        0xBD
-#define VK_OEM_PERIOD       0xBE
-#define VK_OEM_2            0xBF
-#define VK_OEM_3            0xC0
-/*                          0xC1-0xDA  Unassigned */
-#define VK_OEM_4            0xDB
-#define VK_OEM_5            0xDC
-#define VK_OEM_6            0xDD
-#define VK_OEM_7            0xDE
-/*                          0xDF-0xE4  OEM specific */
-
-#define VK_PROCESSKEY       0xE5
-
-/*                          0xE6       OEM specific */
-/*                          0xE7-0xE8  Unassigned */
-/*                          0xE9-0xF5  OEM specific */
-
-#define VK_ATTN             0xF6
-#define VK_CRSEL            0xF7
-#define VK_EXSEL            0xF8
-#define VK_EREOF            0xF9
-#define VK_PLAY             0xFA
-#define VK_ZOOM             0xFB
-#define VK_NONAME           0xFC
-#define VK_PA1              0xFD
-#define VK_OEM_CLEAR        0xFE
-  
-  /* Key status flags for mouse events */
-#define MK_LBUTTON         0x0001
-#define MK_RBUTTON         0x0002
-#define MK_SHIFT           0x0004
-#define MK_CONTROL         0x0008
-#define MK_MBUTTON         0x0010
-
-  /* Queue status flags */
-#define QS_KEY         0x0001
-#define QS_MOUSEMOVE   0x0002
-#define QS_MOUSEBUTTON 0x0004
-#define QS_MOUSE       (QS_MOUSEMOVE | QS_MOUSEBUTTON)
-#define QS_POSTMESSAGE 0x0008
-#define QS_TIMER       0x0010
-#define QS_PAINT       0x0020
-#define QS_SENDMESSAGE 0x0040
-#define QS_HOTKEY      0x0080
-#define QS_INPUT       (QS_MOUSE | QS_KEY)
-#define QS_ALLEVENTS   (QS_INPUT | QS_POSTMESSAGE | QS_TIMER | QS_PAINT | QS_HOTKEY)
-#define QS_ALLINPUT     (QS_ALLEVENTS | QS_SENDMESSAGE)
-
-#define DDL_READWRITE  0x0000
-#define DDL_READONLY   0x0001
-#define DDL_HIDDEN     0x0002
-#define DDL_SYSTEM     0x0004
-#define DDL_DIRECTORY  0x0010
-#define DDL_ARCHIVE    0x0020
-
-#define DDL_POSTMSGS   0x2000
-#define DDL_DRIVES     0x4000
-#define DDL_EXCLUSIVE  0x8000
-
-  /* Shell hook values */
-#define HSHELL_WINDOWCREATED       1
-#define HSHELL_WINDOWDESTROYED     2
-#define HSHELL_ACTIVATESHELLWINDOW 3
-
-/* Predefined Clipboard Formats */
-#define CF_TEXT              1
-#define CF_BITMAP            2
-#define CF_METAFILEPICT      3
-#define CF_SYLK              4
-#define CF_DIF               5
-#define CF_TIFF              6
-#define CF_OEMTEXT           7
-#define CF_DIB               8
-#define CF_PALETTE           9
-#define CF_PENDATA          10
-#define CF_RIFF             11
-#define CF_WAVE             12
-#define CF_ENHMETAFILE      14
-#define CF_HDROP            15
-#define CF_LOCALE           16
-#define CF_MAX              17
-
-#define CF_OWNERDISPLAY     0x0080
-#define CF_DSPTEXT          0x0081
-#define CF_DSPBITMAP        0x0082
-#define CF_DSPMETAFILEPICT  0x0083
-
-/* "Private" formats don't get GlobalFree()'d */
-#define CF_PRIVATEFIRST     0x0200
-#define CF_PRIVATELAST      0x02FF
-
-/* "GDIOBJ" formats do get DeleteObject()'d */
-#define CF_GDIOBJFIRST      0x0300
-#define CF_GDIOBJLAST       0x03FF
-
-
-/* DragObject stuff */
-
-typedef struct
-{
-    HWND16     hWnd;
-    HANDLE16   hScope;
-    WORD       wFlags;
-    HANDLE16   hList;
-    HANDLE16   hOfStruct;
-    POINT16 pt WINE_PACKED;
-    LONG       l WINE_PACKED;
-} DRAGINFO, *LPDRAGINFO;
-
-#define DRAGOBJ_PROGRAM                0x0001
-#define DRAGOBJ_DATA           0x0002
-#define DRAGOBJ_DIRECTORY      0x0004
-#define DRAGOBJ_MULTIPLE       0x0008
-#define DRAGOBJ_EXTERNAL       0x8000
-
-#define DRAG_PRINT             0x544E5250
-#define DRAG_FILE              0x454C4946
-
-/* types of LoadImage */
-#define IMAGE_BITMAP   0
-#define IMAGE_ICON     1
-#define IMAGE_CURSOR   2
-#define IMAGE_ENHMETAFILE      3
-
-/* loadflags to LoadImage */
-#define LR_DEFAULTCOLOR                0x0000
-#define LR_MONOCHROME          0x0001
-#define LR_COLOR               0x0002
-#define LR_COPYRETURNORG       0x0004
-#define LR_COPYDELETEORG       0x0008
-#define LR_LOADFROMFILE                0x0010
-#define LR_LOADTRANSPARENT     0x0020
-#define LR_DEFAULTSIZE         0x0040
-#define LR_VGA_COLOR           0x0080
-#define LR_LOADMAP3DCOLORS     0x1000
-#define        LR_CREATEDIBSECTION     0x2000
-#define LR_COPYFROMRESOURCE    0x4000
-#define LR_SHARED              0x8000
-
-/* Flags for DrawIconEx.  */
-#define DI_MASK                 1
-#define DI_IMAGE                2
-#define DI_NORMAL               (DI_MASK | DI_IMAGE)
-#define DI_COMPAT               4
-#define DI_DEFAULTSIZE          8
-
-  /* misc messages */
-#define WM_CPL_LAUNCH       (WM_USER + 1000)
-#define WM_CPL_LAUNCHED     (WM_USER + 1001)
-
-/* WM_NOTIFYFORMAT commands and return values */
-#define NFR_ANSI           1
-#define NFR_UNICODE        2
-#define NF_QUERY           3
-#define NF_REQUERY         4
-
-#include "poppack.h"
-#define     EnumTaskWindows(handle,proc,lparam) \
-            EnumThreadWindows(handle,proc,lparam)
-#define     OemToAnsiA OemToCharA
-#define     OemToAnsiW OemToCharW
-#define     OemToAnsi WINELIB_NAME_AW(OemToAnsi)
-#define     OemToAnsiBuffA OemToCharBuffA
-#define     OemToAnsiBuffW OemToCharBuffW
-#define     OemToAnsiBuff WINELIB_NAME_AW(OemToAnsiBuff)
-#define     AnsiToOemA CharToOemA
-#define     AnsiToOemW CharToOemW
-#define     AnsiToOem WINELIB_NAME_AW(AnsiToOem)
-#define     AnsiToOemBuffA CharToOemBuffA
-#define     AnsiToOemBuffW CharToOemBuffW
-#define     AnsiToOemBuff WINELIB_NAME_AW(AnsiToOemBuff)
-/* NOTE: This is SYSTEM.3, not USER.182, which is also named KillSystemTimer */
-WORD        WINAPI SYSTEM_KillSystemTimer( WORD );
-
-/* Extra functions that don't exist in the Windows API */
-
-HPEN      WINAPI GetSysColorPen(INT);
-INT       WINAPI LoadMessageA(HMODULE,UINT,WORD,LPSTR,INT);
-INT       WINAPI LoadMessageW(HMODULE,UINT,WORD,LPWSTR,INT);
-
-VOID        WINAPI ScreenSwitchEnable16(WORD);
-
-#define WC_DIALOG    (LPSTR)((DWORD)((WORD)( 0x8002)))
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _WINUSER_ */
diff --git a/modules/codec/loader/wineacm.h b/modules/codec/loader/wineacm.h
deleted file mode 100644 (file)
index 959cb3d..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-#ifndef WINEACM_H
-#define WINEACM_H
-/* -*- tab-width: 8; c-basic-offset: 4 -*- */
-
-/***********************************************************************
- * Wine specific - Win32
- */
-
-
-#include "wine/msacmdrv.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif /* defined(__cplusplus) */
-
-
-typedef struct _WINE_ACMDRIVERID *PWINE_ACMDRIVERID;
-typedef struct _WINE_ACMDRIVER   *PWINE_ACMDRIVER;
-
-typedef struct _WINE_ACMOBJ
-{
-  PWINE_ACMDRIVERID    pACMDriverID;
-} WINE_ACMOBJ, *PWINE_ACMOBJ;
-
-typedef struct _WINE_ACMDRIVER
-{
-    WINE_ACMOBJ                obj;
-    HDRVR                      hDrvr;
-    DRIVERPROC         pfnDriverProc;
-    PWINE_ACMDRIVER    pNextACMDriver;
-    int                 iUsage;
-} WINE_ACMDRIVER;
-
-typedef struct _WINE_ACMSTREAM
-{
-    WINE_ACMOBJ                obj;
-    PWINE_ACMDRIVER    pDrv;
-    ACMDRVSTREAMINSTANCE drvInst;
-    HACMDRIVER         hAcmDriver;
-} WINE_ACMSTREAM, *PWINE_ACMSTREAM;
-
-typedef struct _WINE_ACMDRIVERID
-{
-    LPSTR               pszFileName;
-    WORD               wFormatTag;
-    HINSTANCE          hInstModule;          /* NULL if global */
-    DWORD              dwProcessID;          /* ID of process which installed a local driver */
-    WIN_BOOL                bEnabled;
-    PWINE_ACMDRIVER     pACMDriverList;
-    PWINE_ACMDRIVERID   pNextACMDriverID;
-    PWINE_ACMDRIVERID  pPrevACMDriverID;
-} WINE_ACMDRIVERID;
-
-/* From internal.c */
-extern HANDLE MSACM_hHeap;
-extern PWINE_ACMDRIVERID MSACM_pFirstACMDriverID;
-extern PWINE_ACMDRIVERID MSACM_pLastACMDriverID;
-
-PWINE_ACMDRIVERID MSACM_RegisterDriver(const char* pszFileName,
-                                      WORD wFormatTag,
-                                      HINSTANCE hinstModule);
-PWINE_ACMDRIVERID MSACM_UnregisterDriver(PWINE_ACMDRIVERID p);
-void MSACM_UnregisterAllDrivers(void);
-PWINE_ACMDRIVERID MSACM_GetDriverID(HACMDRIVERID hDriverID);
-PWINE_ACMDRIVER MSACM_GetDriver(HACMDRIVER hDriver);
-PWINE_ACMOBJ MSACM_GetObj(HACMOBJ hObj);
-
-#ifdef __cplusplus
-} /* extern "C" */
-#endif /* defined(__cplusplus) */
-
-#endif /* WINEACM_H */
diff --git a/modules/codec/loader/wrapper.S b/modules/codec/loader/wrapper.S
deleted file mode 100644 (file)
index fe2d856..0000000
+++ /dev/null
@@ -1,83 +0,0 @@
-.section .data
-.globl caller_return
-caller_return:
-       .long 0
-.globl report_entry
-report_entry:
-       .long null_call
-.globl report_ret
-report_ret:    
-       .long null_call
-.global wrapper_target
-wrapper_target:        
-       .long null_call
-
-.section .text
-.globl null_call
-       .type null_call, @function
-       .balign 16,0x90
-null_call:
-       ret
-.globl wrapper
-       .type wrapper, @function
-       .balign 16,0x90
-wrapper:
-       pusha                   # store registers (EAX, ECX, EDX, EBX, ESP, EBP, ESI, EDI) 
-       pushf                   # store flags
-       
-       push %ebp               # set up a stack frame 
-       movl %esp, %ebp
-
-       leal 4(%ebp), %eax      # push flags addr
-       push %eax
-       leal 8(%ebp), %eax      # push registers addr
-       push %eax
-       
-       leal 40(%ebp), %edx     
-       movl (%ebp), %eax
-       subl %edx, %eax
-       push %eax
-       push %edx
-       
-       call *report_entry      # report entry
-       
-       test %eax, %eax
-       jnz .Ldone
-
-       leave                   # restore %esp, %ebp
-       popf                    # restore flags
-       popa                    # restore registers
-       
-       popl caller_return      # switch return addresses
-       pushl $.Lwrapper_return 
-       
-       jmp *wrapper_target     # wrapper_target should return at .Lwrapper_return
-
-       .balign 16, 0x90
-.Lwrapper_return:      
-       pushl caller_return     # restore the original return address
-       pusha                   # more for reference sake here
-       pushf
-       
-       push %ebp               # set up a stack frame
-       movl %esp, %ebp
-
-       leal 4(%ebp), %eax      # push flags addr
-       push %eax
-       leal 8(%ebp), %eax      # push registers addr
-       push %eax
-
-       leal 40(%ebp), %edx     # push stack top address (relative to our entry)
-       movl (%ebp), %eax
-       subl %edx, %eax         # calculate difference between entry and previous frame
-       push %eax
-       push %edx
-
-       call *report_ret        # report the return information (same args)
-.Ldone:        
-
-       leave
-       popf
-       popa
-       ret
-       
diff --git a/modules/codec/loader/wrapper.h b/modules/codec/loader/wrapper.h
deleted file mode 100644 (file)
index d0ce2ca..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-#ifndef _WRAPPER_H
-#define _WRAPPER_H
-
-#include <inttypes.h>
-
-typedef struct {
-  uint32_t edi, esi, ebp, esp, ebx, edx, ecx, eax;
-} reg386_t;
-
-typedef int (*wrapper_func_t)(void *stack_base, int stack_size, reg386_t *reg,  uint32_t *flags);
-
-extern wrapper_func_t report_entry, report_ret;
-
-extern void (*wrapper_target)(void);
-
-extern int wrapper(void);
-extern int null_call(void);
-
-#endif /* _WRAPPER_H */
-
index cefa267255b1e1c41dc1af41ea4984a019294e52..cf9fefc8c9c5ae4db7f4611138337b614caea19f 100644 (file)
@@ -1,5 +1,3 @@
 extras/misc/mpris.xml
-modules/codec/loader/driver.c
-modules/codec/loader/ldt_keeper.c
 modules/codec/wmafixed/bswap.h
 modules/access/dvb/scan.c