[Mplayer-cvslog] CVS: main/loader driver.h,NONE,1.1 ext.h,NONE,1.1 setup_FS.h,NONE,1.1 Makefile,1.2,1.3 afl.c,1.1.1.1,1.2 driver.c,1.5,1.6 elfdll.c,1.1.1.1,1.2 ext.c,1.2,1.3 loader.h,1.2,1.3 module.c,1.2,1.3 pe_image.c,1.2,1.3 pe_resource.c,1.1.1.1,1.2 registry.c,1.5,1.6 resource.c,1.1.1.1,1.2 setup_FS.c,1.3,1.4 vfl.c,1.4,1.5 win32.c,1.14,1.15 win32.h,1.1.1.1,1.2 config.h,1.1.1.1,NONE

Jürgen Keil jkeil at mplayer.dev.hu
Thu Jul 12 17:27:50 CEST 2001


Update of /cvsroot/mplayer/main/loader
In directory mplayer:/var/tmp.root/cvs-serv20694

Modified Files:
	Makefile afl.c driver.c elfdll.c ext.c loader.h module.c 
	pe_image.c pe_resource.c registry.c resource.c setup_FS.c 
	vfl.c win32.c win32.h 
Added Files:
	driver.h ext.h setup_FS.h 
Removed Files:
	config.h 
Log Message:
Add prototypes to wine/loader stuff, so that we can catch __stdcall function
attribute mismatch between caller/caller.  wine/loader is less sensitive to
optimization now.  (now that avifile-0.6 has the same patch installed, we're
a bit closer to their CVS tree)

Speed up win32 "QueryPerformanceFrequency" emulation on solaris.


--- NEW FILE ---

#ifndef loader_driver_h
#define	loader_driver_h

#include <wine/windef.h>
#include <wine/vfw.h>

extern HDRVR VFWAPI DrvOpen(LPARAM lParam2);
extern void DrvClose(HDRVR hdrvr);

#endif

--- NEW FILE ---

#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

--- NEW FILE ---

#ifndef setup_FS_h
#define setup_FS_h

extern void setup_FS_Segment(void);
extern void Setup_LDT_Keeper(void);
extern void Restore_LDT_Keeper(void);


#endif

Index: Makefile
===================================================================
RCS file: /cvsroot/mplayer/main/loader/Makefile,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- Makefile	28 Mar 2001 21:43:21 -0000	1.2
+++ Makefile	12 Jul 2001 15:27:47 -0000	1.3
@@ -1,18 +1,25 @@
 include ../config.mak
 
 # Generated automatically from Makefile.in by configure.
-DEFINES=-rdynamic -fPIC $(WIN32_PATH) $(CDOPT) -D__WINE__ -Ddbg_printf=__vprintf \
+DEFINES=$(WIN32_PATH) -D__WINE__ -Ddbg_printf=__vprintf \
 	-DTRACE=__vprintf # -DDETAILED_OUT
 
 LIB_OBJECTS= setup_FS.o pe_image.o module.o \
 ext.o win32.o driver.o pe_resource.o \
 resource.o registry.o elfdll.o afl.o vfl.o
 
-CFLAGS=-g -I.
+# gcc-3.0 produces buggy code for acmStreamOpen() with
+# "-O3 -fomit-frame-pointer" or "-O2 -fomit-frame-pointer
+# -finline-functions -frename-registers" (code is OK with sole -O2),
+# the bad code accesses parameters via %ebp without setting up a
+# propper %ebp first!
+# -fno-omit-frame-pointer works around this gcc-3.0 bug.  gcc-2.95.2 is OK.
+WARN_FLAGS = -Wmissing-prototypes -Wimplicit-function-declaration
+CFLAGS=-I. -I.. $(OPTFLAGS) $(EXTRA_INC) $(WARN_FLAGS) -fno-omit-frame-pointer
+#CFLAGS=-I. -I.. -O $(WARN_FLAGS) -g #-fno-omit-frame-pointer
 
-CDOPT=-g
 all: libloader.a
-    
+
 clean:
 	-rm -f *.o libloader.a
 

Index: afl.c
===================================================================
RCS file: /cvsroot/mplayer/main/loader/afl.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- afl.c	24 Feb 2001 20:30:14 -0000	1.1.1.1
+++ afl.c	12 Jul 2001 15:27:47 -0000	1.2
@@ -22,8 +22,11 @@
 #include <config.h>
 
 #include <stdio.h>
+#include <stdlib.h>
 #include <string.h>
 
+#include "win32.h"
+
 #include <wine/winbase.h>
 #include <wine/windef.h>
 #include <wine/winuser.h>
@@ -34,11 +37,13 @@
 #include <wine/msacm.h>
 #include <wine/msacmdrv.h>
 #include "wineacm.h"
-#pragma pack(1)
+#include "ext.h"
+#include "driver.h"
+
 #define OpenDriverA DrvOpen
-extern HDRVR VFWAPI DrvOpen(long);
 #define CloseDriver DrvClose
-extern HDRVR VFWAPI DrvClose(long);
+
+#pragma pack(1)
 
 static PWINE_ACMSTREAM	ACM_GetStream(HACMSTREAM has)
 {
@@ -394,6 +399,8 @@
     int			wfxSrcSize;
     int			wfxDstSize;
     
+    //printf("gcc-3.0 bug, pwfxSrc=%p, pwfxSrc->cbSize=%d\n", pwfxSrc, pwfxSrc->cbSize);
+
     TRACE("(%p, 0x%08x, %p, %p, %p, %ld, %ld, %ld)\n",
 	  phas, had, pwfxSrc, pwfxDst, pwfltr, dwCallback, dwInstance, fdwOpen);
 

Index: driver.c
===================================================================
RCS file: /cvsroot/mplayer/main/loader/driver.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- driver.c	11 Apr 2001 01:38:57 -0000	1.5
+++ driver.c	12 Jul 2001 15:27:47 -0000	1.6
@@ -1,29 +1,38 @@
 #include <config.h>
 #include <stdio.h>
-
 #ifdef HAVE_MALLOC_H
 #include <malloc.h>
-#else
+#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>
-
-//#include "com.h"
-//typedef long STDCALL (*GETCLASS) (GUID*, GUID*, void**);
-
-
-#ifdef __FreeBSD__
-#include <sys/time.h>
-#endif
+#include <setup_FS.h>
+#include "driver.h"
 
 
+#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
 #define STORE_ALL \
-    __asm__ ( \
+    __asm__( \
     "push %%ebx\n\t" \
     "push %%ecx\n\t" \
     "push %%edx\n\t" \
@@ -31,25 +40,16 @@
     "push %%edi\n\t"::)
 
 #define REST_ALL \
-    __asm__ ( \
+    __asm__( \
     "pop %%edi\n\t" \
     "pop %%esi\n\t" \
     "pop %%edx\n\t" \
     "pop %%ecx\n\t" \
     "pop %%ebx\n\t"::)
+#endif
 
 
 
-typedef struct {
-    UINT             uDriverSignature;
-    HINSTANCE        hDriverModule;
-    DRIVERPROC       DriverProc;
-    DWORD            dwDriverID;
-} DRVR;
-
-typedef DRVR  *PDRVR;
-typedef DRVR  *NPDRVR;
-typedef DRVR  *LPDRVR;
     
 static DWORD dwDrvID = 0;
 
@@ -119,10 +119,9 @@
 }
 
 
-extern char* def_path; //=WIN32_PATH;    // path to codecs
 char* win32_codec_name=NULL;  // must be set before calling DrvOpen() !!!
 
-HDRVR
+HDRVR VFWAPI
 DrvOpen(LPARAM lParam2)
 {
     ICOPEN *icopen=(ICOPEN *) lParam2;

Index: elfdll.c
===================================================================
RCS file: /cvsroot/mplayer/main/loader/elfdll.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- elfdll.c	24 Feb 2001 20:30:14 -0000	1.1.1.1
+++ elfdll.c	12 Jul 2001 15:27:47 -0000	1.2
@@ -9,9 +9,9 @@
 
 #include <string.h>
 #include <ctype.h>
+#include <stdio.h>
 #include <stdlib.h>
 
-#include <wine/config.h>
 #include <wine/windef.h>
 //#include <wine/global.h>
 //#include <wine/process.h>

Index: ext.c
===================================================================
RCS file: /cvsroot/mplayer/main/loader/ext.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- ext.c	18 Mar 2001 01:01:02 -0000	1.2
+++ ext.c	12 Jul 2001 15:27:47 -0000	1.3
@@ -6,10 +6,10 @@
  *
  ********************************************************/
 #include <config.h>
+#include <stdio.h>
+#include <stdlib.h>
 #ifdef HAVE_MALLOC_H
 #include <malloc.h>
-#else
-#include <stdlib.h>
 #endif
 #include <unistd.h>
 #include <sys/mman.h>
@@ -18,7 +18,11 @@
 #include <string.h>
 #include <stdarg.h>
 #include <wine/windef.h>
-//#include <wine/winbase.h>
+#include <wine/winbase.h>
+#include <wine/debugtools.h>
+#include <wine/heap.h>
+#include "ext.h"
+
 int dbg_header_err( const char *dbg_channel, const char *func )
 {
     return 0; 
@@ -35,7 +39,7 @@
 {
     return 0; 
 }
-int dbg_vprintf( const char *format, ... )
+int dbg_vprintf( const char *format, va_list args )
 {
     return 0; 
 }
@@ -50,12 +54,12 @@
     return 0; 
 }
     
-int GetProcessHeap()
+HANDLE WINAPI GetProcessHeap(void)
 {
     return 1;
 }
 
-void* HeapAlloc(int heap, int flags, int size)
+LPVOID WINAPI HeapAlloc(HANDLE heap, DWORD flags, DWORD size)
 {
     if(flags & 0x8)
 	return calloc(size, 1);
@@ -63,7 +67,7 @@
 	return malloc(size);
 }
 
-int HeapFree(int heap, int flags, void* mem)
+WIN_BOOL WINAPI HeapFree(HANDLE heap, DWORD flags,LPVOID mem)
 {
     if (mem) free(mem);
     return 1;
@@ -71,34 +75,34 @@
 
 static int last_error;
 
-int GetLastError()
+DWORD WINAPI GetLastError(void)
 {
     return last_error;
 }
 
-int SetLastError(int error)
+VOID WINAPI SetLastError(DWORD error)
 { 
-    return last_error=error;
+    last_error = error;
 }    
 
-int ReadFile(int handle, void* mem, unsigned long size, long* result, long flags)
+WIN_BOOL WINAPI ReadFile(HANDLE handle,LPVOID mem, DWORD size, LPDWORD result, LPOVERLAPPED flags)
 {
     *result=read(handle, mem, size);
     return *result;
 }    
-int lstrcmpiA(const char* c1, const char* c2)
+int WINAPI lstrcmpiA(const char* c1, const char* c2)
 {
     return strcasecmp(c1,c2);
 }
-int lstrcpynA(char* dest, const char* src, int num)
+LPSTR WINAPI lstrcpynA(LPSTR dest, LPCSTR src, INT num)
 {
-    return strncmp(dest,src,num);
+    return strncpy(dest,src,num);
 }
-int lstrlenA(const char* s)
+int WINAPI lstrlenA(const char* s)
 {
     return strlen(s);
 }   
-int lstrlenW(const short* s)
+INT WINAPI lstrlenW(LPCWSTR s)
 {
     int l;
     if(!s)
@@ -108,8 +112,9 @@
 	l++;
      return l;
 }
-int lstrcpynWtoA(char* dest, const char* src, int count)
+LPSTR WINAPI lstrcpynWtoA(LPSTR dest, LPCWSTR src, INT count)
 {
+    LPSTR rval = dest;
     int moved=0;
     if((dest==0) || (src==0))
 	return 0;
@@ -118,10 +123,11 @@
         *dest=*src;
 	moved++;
 	if(*src==0)
-	    return moved;
+	    break;
 	src++;
 	dest++;
     }
+    return rval;
 }
 int wcsnicmp(const unsigned short* s1, const unsigned short* s2, int n)
 {
@@ -147,7 +153,7 @@
 }			
 		
 		
-int IsBadReadPtr(void* data, int size)
+WIN_BOOL WINAPI IsBadReadPtr(LPCVOID data, UINT size)
 {
     if(size==0)
 	return 0;
@@ -155,14 +161,14 @@
         return 1;
     return 0;
 }   
-char* HEAP_strdupA(const char* string)
+LPSTR HEAP_strdupA(HANDLE heap, DWORD flags, LPCSTR string)
 {
 //    return strdup(string);
     char* answ=malloc(strlen(string)+1);
     strcpy(answ, string);
     return answ;
 }
-short* HEAP_strdupAtoW(void* heap, void* hz, const char* string)
+LPWSTR HEAP_strdupAtoW(HANDLE heap, DWORD flags, LPCSTR string)
 {
     int size, i;
     short* answer;
@@ -174,7 +180,7 @@
 	answer[i]=(short)string[i];
     return answer;	
 }
-char* HEAP_strdupWtoA(void* heap, void* hz, const short* string)
+LPSTR HEAP_strdupWtoA(HANDLE heap, DWORD flags, LPCWSTR string)
 {
     int size, i;
     char* answer;
@@ -322,9 +328,12 @@
 #define	PAGE_GUARD		0x100
 #define	PAGE_NOCACHE		0x200
 
-HANDLE CreateFileMappingA(int hFile, void* lpAttr,
-DWORD flProtect, DWORD dwMaxHigh, DWORD dwMaxLow, const char* name)
+HANDLE WINAPI CreateFileMappingA(HANDLE handle, LPSECURITY_ATTRIBUTES lpAttr,
+				 DWORD flProtect,
+				 DWORD dwMaxHigh, DWORD dwMaxLow,
+				 LPCSTR name)
 {
+    int hFile = (int)handle;
     unsigned int len;
     HANDLE answer;
     int anon=0;
@@ -381,7 +390,7 @@
     }
     return (HANDLE)0;
 }        
-int UnmapViewOfFile(HANDLE handle)
+WIN_BOOL WINAPI UnmapViewOfFile(LPVOID handle)
 {
     file_mapping* p;
     int result;
@@ -389,7 +398,7 @@
 	return (HANDLE)0;
     for(p=fm; p; p=p->next)
     {
-	if(p->handle==handle)
+	if(p->handle==(HANDLE)handle)
 	{
 	    result=munmap((void*)handle, p->mapping_size);
 	    if(p->next)p->next->prev=p->prev;
@@ -418,7 +427,7 @@
 #define MEM_COMMIT              0x00001000
 #define MEM_RESERVE             0x00002000
 
-void* VirtualAlloc(void* address, DWORD size, DWORD type,  DWORD protection)
+void* WINAPI VirtualAlloc(void* address, DWORD size, DWORD type,  DWORD protection)
 {
     void* answer;
     int fd=open("/dev/zero", O_RDWR);
@@ -488,7 +497,7 @@
         return answer;
     }	
 }    	
-int VirtualFree(void*  address, int t1, int t2)//not sure
+WIN_BOOL WINAPI VirtualFree(LPVOID address, DWORD t1, DWORD t2)//not sure
 {
     virt_alloc* str=vm;
     int answer;
@@ -509,8 +518,10 @@
     return -1;
 }
 
-int WideCharToMultiByte(unsigned int codepage, long flags, const short* src,
-     int srclen,char* dest, int destlen, const char* defch, int* used_defch)
+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==0)
@@ -541,12 +552,13 @@
     }	    
     return min(srclen, destlen);
 }
-int MultiByteToWideChar(unsigned int codepage,long flags, const char* src, int srclen,
-    short* dest, int destlen)
+INT WINAPI MultiByteToWideChar(UINT codepage, DWORD flags,
+			       LPCSTR src, INT srclen,
+			       LPWSTR dest, INT destlen)
 {
     return 0;
 }
-HANDLE OpenFileMappingA(long access, long prot, char* name)
+HANDLE WINAPI OpenFileMappingA(DWORD access, WIN_BOOL prot, LPCSTR name)
 {
     file_mapping* p;
     if(fm==0)

Index: loader.h
===================================================================
RCS file: /cvsroot/mplayer/main/loader/loader.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- loader.h	18 Mar 2001 01:01:02 -0000	1.2
+++ loader.h	12 Jul 2001 15:27:47 -0000	1.3
@@ -279,7 +279,8 @@
 );
 void MSACM_RegisterAllDrivers(void);
 
-int WINAPI LoadStringA(long instance, long  id, void* buf, long size);
+INT WINAPI LoadStringA( HINSTANCE instance, UINT resource_id,
+                            LPSTR buffer, INT buflen );
 
 #ifdef __cplusplus
 }

Index: module.c
===================================================================
RCS file: /cvsroot/mplayer/main/loader/module.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- module.c	18 Mar 2001 01:01:02 -0000	1.2
+++ module.c	12 Jul 2001 15:27:47 -0000	1.3
@@ -15,6 +15,11 @@
 
 #include <sys/mman.h>
 #include <sys/types.h>
+#ifdef HAVE_LIBDL
+#include <wine/elfdll.h>
+#include <dlfcn.h>
+#endif
+
 /*
 #ifdef __linux__
 #include <asm/unistd.h>
@@ -48,6 +53,7 @@
 #include <wine/module.h>
 #include <wine/pe_image.h>
 #include <wine/debugtools.h>
+#include "win32.h"
 
 struct modref_list_t;
 
@@ -79,7 +85,7 @@
     return list->wm;
 }    
 
-void MODULE_RemoveFromList(WINE_MODREF *mod)
+static void MODULE_RemoveFromList(WINE_MODREF *mod)
 {
     modref_list* list=local_wm;
     if(list==0)
@@ -478,7 +484,7 @@
 	return retproc;
 #ifdef HAVE_LIBDL	
     case MODULE32_ELF:
-	retproc = (FARPROC) dlsym( wm->module, function);
+	retproc = (FARPROC) dlsym( (void*)wm->module, function);
 	if (!retproc) SetLastError(ERROR_PROC_NOT_FOUND);
 	return retproc;
 #endif

Index: pe_image.c
===================================================================
RCS file: /cvsroot/mplayer/main/loader/pe_image.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- pe_image.c	18 Mar 2001 01:01:02 -0000	1.2
+++ pe_image.c	12 Jul 2001 15:27:47 -0000	1.3
@@ -34,16 +34,19 @@
  *   to 4096 byte boundaries on disk.
  */
 #include <config.h>
-#include <wine/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_ALLOCA_H
+#include <alloca.h>
+#endif
 #ifdef HAVE_SYS_MMAN_H
 #include <sys/mman.h>
 #endif
@@ -54,6 +57,7 @@
 #include <wine/pe_image.h>
 #include <wine/module.h>
 #include <wine/debugtools.h>
+#include <ext.h>
 
 #include "win32.h"
 
@@ -64,7 +68,7 @@
 extern void* LookupExternal(const char* library, int ordinal);
 extern void* LookupExternalByName(const char* library, const char* name);
 
-void dump_exports( HMODULE hModule )
+static void dump_exports( HMODULE hModule )
 { 
   char		*Module;
   int		i, j;
@@ -236,7 +240,7 @@
 	}
 }
 
-DWORD fixup_imports( WINE_MODREF *wm )
+static DWORD fixup_imports( WINE_MODREF *wm )
 {
     IMAGE_IMPORT_DESCRIPTOR	*pe_imp;
     PE_MODREF			*pem;
@@ -561,7 +565,6 @@
         }
     }
 
-
     
     load_addr = nt->OptionalHeader.ImageBase;
     vma_size = calc_vma_size( hModule );
@@ -881,17 +884,26 @@
  * due to the PROCESS_Create stuff.
  */
 
-/* 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)
+#if	0
+/*
+ * so this is a dirty hack.
+ * Why do we need it?
+ *
+ * Disable it for now, let's see if it breaks something
  */
-extern void This_Is_Dirty_Hack()
+static void This_Is_Dirty_Hack(void)
 {
     void* mem=alloca(0x20000);
     *(int*)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;
@@ -927,7 +939,9 @@
 		break;
 	}	
 	TRACE("for %s\n", wm->filename);
+#if 0
 	This_Is_Dirty_Hack();
+#endif
         retv = entry( wm->module, type, lpReserved );
     }
 

Index: pe_resource.c
===================================================================
RCS file: /cvsroot/mplayer/main/loader/pe_resource.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- pe_resource.c	24 Feb 2001 20:30:21 -0000	1.1.1.1
+++ pe_resource.c	12 Jul 2001 15:27:47 -0000	1.2
@@ -22,6 +22,7 @@
 //#include "process.h"
 //#include "stackframe.h"
 #include <wine/debugtools.h>
+#include <ext.h>
 
 /**********************************************************************
  *  HMODULE32toPE_MODREF 

Index: registry.c
===================================================================
RCS file: /cvsroot/mplayer/main/loader/registry.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- registry.c	11 Apr 2001 01:38:57 -0000	1.5
+++ registry.c	12 Jul 2001 15:27:47 -0000	1.6
@@ -1,7 +1,9 @@
 #include <config.h>
 
 #include <stdio.h>
+#include <stdlib.h>
 #include <fcntl.h>
+#include <unistd.h>
 #include <pwd.h>
 #include <sys/types.h>
 
@@ -11,6 +13,8 @@
 #include <wine/winerror.h>
 
 #include <registry.h>
+#include <ext.h>
+
 //#undef TRACE
 //#define TRACE printf
 struct reg_value
@@ -40,14 +44,14 @@
 
 extern char *get_path(char *);
 
-static void create_registry();
-static void open_registry();
-static void save_registry();
+static void create_registry(void);
+static void open_registry(void);
+static void save_registry(void);
 
 
 
 
-static void create_registry(){
+static void create_registry(void){
     if(regs)
     {
 	printf("Logic error: create_registry() called with existing registry\n");
@@ -65,7 +69,7 @@
     reg_size=2;
     save_registry();
 }
-static void open_registry()
+static void open_registry(void)
 {
 	int fd;
 	int i;
@@ -120,7 +124,7 @@
 	return;
 }
 
-static void save_registry()
+static void save_registry(void)
 {
 	int fd, i, len;
 //         struct passwd* pwent;
@@ -227,7 +231,7 @@
 	strcat(full_name, subkey);
 	return full_name;
 }
-struct reg_value* insert_reg_value(int handle, const char* name, int type, const void* value, int len)
+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;
@@ -263,7 +267,7 @@
 	return v;
 }
 
-static void init_registry()
+static void init_registry(void)
 {
 #ifdef DETAILED_OUT
 	printf("Initializing registry\n");

Index: resource.c
===================================================================
RCS file: /cvsroot/mplayer/main/loader/resource.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- resource.c	24 Feb 2001 20:30:21 -0000	1.1.1.1
+++ resource.c	12 Jul 2001 15:27:47 -0000	1.2
@@ -7,6 +7,7 @@
 #include <config.h>
 
 #include <assert.h>
+#include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 #include <sys/types.h>
@@ -20,6 +21,8 @@
 #include <wine/module.h>
 #include <wine/debugtools.h>
 #include <wine/winerror.h>
+#include <loader.h>
+
 #define CP_ACP					0
 
 WORD WINE_LanguageId=0x409;//english

Index: setup_FS.c
===================================================================
RCS file: /cvsroot/mplayer/main/loader/setup_FS.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- setup_FS.c	5 Jun 2001 02:26:56 -0000	1.3
+++ setup_FS.c	12 Jul 2001 15:27:47 -0000	1.4
@@ -10,7 +10,7 @@
 #ifdef __linux__
 #include <asm/unistd.h>
 #include <asm/ldt.h>
-#else
+#else /* !__linux__ */
 
 #if defined(__NetBSD__) || defined(__FreeBSD__) || defined(__OpenBSD__)
 #include <machine/sysarch.h>
@@ -22,7 +22,9 @@
 /* solaris x86: add missing prototype for sysi86() */
 extern int sysi86(int, void*);
 #define       TEB_SEL_IDX     NUMSYSLDTS
-#endif
+#endif /* __svr4__ */
+
+
 
 #define LDT_ENTRIES     8192
 #define LDT_ENTRY_SIZE  8
@@ -42,7 +44,10 @@
 #define MODIFY_LDT_CONTENTS_DATA        0
 #define MODIFY_LDT_CONTENTS_STACK       1
 #define MODIFY_LDT_CONTENTS_CODE        2
-#endif
+#endif /* !__linux__ */
+
+#include "setup_FS.h"
+
 
 
 /* user level (privilege level: 3) ldt (1<<2) segment selector */

Index: vfl.c
===================================================================
RCS file: /cvsroot/mplayer/main/loader/vfl.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- vfl.c	8 Jul 2001 17:19:01 -0000	1.4
+++ vfl.c	12 Jul 2001 15:27:47 -0000	1.5
@@ -6,6 +6,9 @@
 #include <stdio.h>
 #include <string.h>
 
+#include "win32.h"
+#include "loader.h"
+
 #include "wine/winbase.h"
 #include "wine/windef.h"
 #include "wine/winuser.h"
@@ -13,29 +16,31 @@
 #include "wine/winestring.h"
 #include "wine/driver.h"
 #include "wine/avifmt.h"
+#include "driver.h"
+
 
 #define FIXME_(X) printf
 #define FIXME printf
 
+#define OpenDriverA DrvOpen
+#define CloseDriver DrvClose
+
 long VFWAPI VideoForWindowsVersion(void);
 
-extern void* my_mreq(int size, int to_zero);
-extern      void DrvClose(HDRVR hdrvr);
-extern int my_release(void* memory);
-
-long VFWAPIV ICDecompress(HIC hic,long dwFlags,LPBITMAPINFOHEADER lpbiFormat,void* lpData,LPBITMAPINFOHEADER lpbi,void* lpBits);
-
-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);
 
-#define OpenDriverA DrvOpen
-extern HDRVR VFWAPI DrvOpen(long);
+#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
 #define STORE_ALL \
     __asm__ ( \
     "push %%ebx\n\t" \
@@ -51,15 +56,9 @@
     "pop %%edx\n\t" \
     "pop %%ecx\n\t" \
     "pop %%ebx\n\t"::)
+#endif
 
 
-typedef struct {
-    unsigned int               uDriverSignature;
-    void*        hDriverModule;
-    DRIVERPROC        DriverProc;
-    long                dwDriverID;
-} DRVR;
-
 /***********************************************************************
  *		VideoForWindowsVersion		[MSVFW.2][MSVIDEO.2]
  * Returns the version in major.minor form.
@@ -351,7 +350,9 @@
 	WINE_HIC	*whic = (WINE_HIC*)hic;
 	char qw[200];
 
+#if 0
     __asm__ __volatile__ ("fsave (%0)\n\t": :"r"(&qw));    
+#endif
     STORE_ALL;	
         /*__asm__
 	(
@@ -362,7 +363,9 @@
         );*/
     	ret = whic->driverproc(whic->private,1,msg,lParam1,lParam2);
     REST_ALL;	
+#if 0
     __asm__ __volatile__ ("frstor (%0)\n\t": :"r"(&qw));    
+#endif
 //	} else
 
 //		ret = SendDriverMessage(whic->hdrv,msg,lParam1,lParam2);

Index: win32.c
===================================================================
RCS file: /cvsroot/mplayer/main/loader/win32.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- win32.c	11 Jun 2001 12:46:53 -0000	1.14
+++ win32.c	12 Jul 2001 15:27:47 -0000	1.15
@@ -28,6 +28,9 @@
 #include <sys/types.h>
 #include <sys/time.h>
 #include <sys/timeb.h>
+#if HAVE_LIBKSTAT
+#include <kstat.h>
+#endif
 
 #include <wine/winbase.h>
 #include <wine/winreg.h>
@@ -77,8 +80,6 @@
     "popl %%ebx\n\t"
     ::"a"(z));
 }    
-#include <sys/time.h>
-#include <unistd.h>
 static unsigned int c_localcount_notsc()
 {
     struct timeval tv;
@@ -100,12 +101,13 @@
     result+=limit*tv.tv_usec;
     *z=result;
 }
-static unsigned int localcount_stub();
-static void longcount_stub(long long*);
+
+static unsigned int localcount_stub(void);
+static void longcount_stub(long long* z);
 static unsigned int (*localcount)()=localcount_stub;
 static void (*longcount)(long long*)=longcount_stub;
 
-static unsigned int localcount_stub()
+static unsigned int localcount_stub(void)
 {
     unsigned int regs[4];
     do_cpuid(regs);
@@ -139,7 +141,7 @@
 }
 
 int LOADER_DEBUG=1;
-inline void dbgprintf(char* fmt, ...)
+static inline void dbgprintf(char* fmt, ...)
 {
 #ifdef DETAILED_OUT
     if(LOADER_DEBUG)
@@ -168,7 +170,7 @@
 
 static unsigned char* heap=NULL; 
 static int heap_counter=0;
-void test_heap()
+static void test_heap()
 {
     int offset=0;	
     if(heap==0)
@@ -326,7 +328,7 @@
 char extcode[20000];// place for 200 unresolved exports
 int pos=0;
 
-int WINAPI ext_unknown()
+int WINAPI ext_unknown(void)
 {
     printf("Unknown func called\n");
     return 0;
@@ -403,18 +405,13 @@
     return 0;
 }    
 
-typedef struct {
-    unsigned int     	uDriverSignature;
-    void*        	hDriverModule;
-    void*    		DriverProc;
-    unsigned int        dwDriverID;
-} DRVR;
-
 void* WINAPI expGetDriverModuleHandle(DRVR* pdrv)
 {
     void* result;
-    if (pdrv==NULL) result=NULL;
-    result=pdrv->hDriverModule;
+    if (pdrv==NULL)
+	result=NULL;
+    else
+	result=(void*) pdrv->hDriverModule;
     dbgprintf("GetDriverModuleHandle(0x%x) => 0x%x\n", pdrv, result);
     return result;
 }
@@ -992,15 +989,14 @@
     dbgprintf("GetCurrentProcess() => %d\n", getpid());
     return getpid();
 }                  
-struct tls_s;
-typedef struct tls_s
+
+struct tls_s
 {
     void* value;
     int used;
     struct tls_s* prev;
     struct tls_s* next;
-}tls_t;
-
+};
 tls_t* g_tls=NULL;    
     
 void* WINAPI expTlsAlloc()
@@ -1131,12 +1127,12 @@
     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",
+    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",
+    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;
 }
@@ -1305,7 +1301,86 @@
     return 1; 
 }
 
-static double old_freq()
+/*
+ * 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	HAVE_LIBKSTAT
+    /*
+     * 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;
@@ -1320,48 +1395,18 @@
     ofreq = (double)(y-x)/1000.;
     return ofreq;
 }
+
 static double CPU_Freq()
 {
-//#ifdef USE_TSC
-	FILE *f = fopen ("/proc/cpuinfo", "r");
-	char line[200];
-	char model[200]="unknown";
-	char flags[500]="";
-	char	*s,*value;
-	double freq=-1;
+    double freq;
 	
-	if (!f)
-	{
-	    //printf("Can't open /proc/cpuinfo for reading\n");
-	    return old_freq();
-	}    
-	while (fgets(line,200,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 ((freq = linux_cpuinfo_freq()) > 0)
+	return freq;
 
-		if (!strncasecmp(line, "cpu MHz",strlen("cpu MHz"))) 
-		{
-		    sscanf(value, "%lf", &freq);
-		    freq*=1000;
-		    break;
-		}
-		continue;
-		
-	}
-	fclose(f);
-	if(freq<0)return old_freq();
+    if ((freq = solaris_kstat_freq()) > 0)
 	return freq;
-//#else
-//	return old_freq();
-//#endif    	
+
+    return tsc_freq();	
 }
 
 long WINAPI expQueryPerformanceFrequency(long long* z)
@@ -1658,12 +1703,12 @@
 {
     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",
+    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",
+    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;
 }    
@@ -2742,7 +2787,7 @@
 //    return (void*)ext_unknown;
 }
 
-int my_garbagecollection()
+int my_garbagecollection(void)
 {
 #ifdef GARBAGE
     alc_list* pp,*ppsv;

Index: win32.h
===================================================================
RCS file: /cvsroot/mplayer/main/loader/win32.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- win32.h	24 Feb 2001 20:30:26 -0000	1.1.1.1
+++ win32.h	12 Jul 2001 15:27:47 -0000	1.2
@@ -1 +1,210 @@
-int ext_unknown();
+#ifndef loader_win32_h
+#define loader_win32_h
+
+#include <time.h>
+
+#include <wine/windef.h>
+#include <wine/winbase.h>
+#include <com.h>
+
+extern void* my_mreq(int size, int to_zero);
+extern int my_release(void* memory);
+extern int my_size(char* memory);
+extern int 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 int WINAPI ext_unknown(void);
+
+extern int WINAPI expIsBadWritePtr(void* ptr, unsigned int count);
+extern int WINAPI expIsBadReadPtr(void* ptr, unsigned int count);
+extern int WINAPI expDisableThreadLibraryCalls(int module);
+extern void* WINAPI expGetDriverModuleHandle(DRVR* pdrv);
+extern void* WINAPI expGetModuleHandleA(const char* name);
+extern void* WINAPI expCreateThread(void* pSecAttr, long dwStackSize, void* lpStartAddress,
+				    void* lpParameter, long dwFlags, long* dwThreadId);
+extern void* WINAPI expCreateEventA(void* pSecAttr, char bManualReset,
+				    char bInitialState, const char* name);
+extern void* WINAPI expSetEvent(void* event);
+extern void* WINAPI expResetEvent(void* event);
+extern void* WINAPI expWaitForSingleObject(void* object, int duration);
+extern WIN_BOOL WINAPI expIsProcessorFeaturePresent(DWORD v);
+extern void WINAPI expGetSystemInfo(SYSTEM_INFO* si);
+extern long WINAPI expGetVersion(void);
+long WINAPI expGetVersionExA(OSVERSIONINFOA* c);
+extern HANDLE WINAPI expHeapCreate(long flags, long init_size, long max_size);
+extern void* WINAPI expHeapAlloc(HANDLE heap, int flags, int size);
+extern long WINAPI expHeapDestroy(void* heap);
+extern long WINAPI expHeapFree(int arg1, int arg2, void* ptr);
+extern long WINAPI expHeapSize(int heap, int flags, void* pointer);
+extern long WINAPI expGetProcessHeap(void);
+extern void* WINAPI expVirtualAlloc(void* v1, long v2, long v3, long v4);
+extern int WINAPI expVirtualFree(void* v1, int v2, int v3);
+extern void WINAPI expInitializeCriticalSection(CRITICAL_SECTION* c);
+extern void WINAPI expEnterCriticalSection(CRITICAL_SECTION* c);
+extern void WINAPI expLeaveCriticalSection(CRITICAL_SECTION* c);
+extern void WINAPI expDeleteCriticalSection(CRITICAL_SECTION *c);
+extern int WINAPI expGetCurrentThreadId(void);
+extern int WINAPI expGetCurrentProcess(void);
+extern void* WINAPI expTlsAlloc(void);
+extern int WINAPI expTlsSetValue(tls_t* index, void* value);
+extern void* WINAPI expTlsGetValue(tls_t* index);
+extern int WINAPI expTlsFree(tls_t* index);
+extern void* WINAPI expLocalAlloc(int flags, int size);
+extern void* WINAPI expLocalLock(void* z);
+extern void* WINAPI expGlobalAlloc(int flags, int size);
+extern void* WINAPI expGlobalLock(void* z);
+extern int WINAPI expLoadStringA(long instance, long  id, void* buf, long size);
+extern long WINAPI expMultiByteToWideChar(long v1, long v2, char* s1, long siz1, short* s2, int siz2);
+extern long WINAPI expWideCharToMultiByte(long v1, long v2, short* s1, long siz1, char* s2, int siz2, char* c3, int* siz3);
+extern long WINAPI expGetVersionExA(OSVERSIONINFOA* c);
+extern HANDLE WINAPI expCreateSemaphoreA(char* v1, long init_count, long max_count, char* name);
+extern long WINAPI expReleaseSemaphore(long hsem, long increment, long* prev_count);
+extern long WINAPI expRegOpenKeyExA(long key, const char* subkey, long reserved, long access, int* newkey);
+extern long WINAPI expRegCloseKey(long key);
+
+extern long WINAPI expRegQueryValueExA(long key, const char* value, int* reserved, int* type, int* data, int* count);
+extern long WINAPI expRegCreateKeyExA(long key, const char* name, long reserved,
+				      void* classs, long options, long security,
+				      void* sec_attr, int* newkey, int* status);
+extern long WINAPI expRegSetValueExA(long key, const char* name, long v1, long v2, void* data, long size);
+extern long WINAPI expRegOpenKeyA (long hKey, LPCSTR lpSubKey, int* phkResult);
+extern long WINAPI expQueryPerformanceCounter(long long* z);
+extern long WINAPI expQueryPerformanceFrequency(long long* z);
+extern long WINAPI exptimeGetTime(void);
+extern void* WINAPI expLocalHandle(void* v);
+extern void* WINAPI expGlobalHandle(void* v);
+extern int WINAPI expGlobalUnlock(void* v);
+extern void* WINAPI expGlobalFree(void* v);
+extern void* WINAPI expGlobalReAlloc(void* v, int size, int flags);
+extern int WINAPI expLocalUnlock(void* v);
+extern void* WINAPI expLocalFree(void* v);
+extern HRSRC WINAPI expFindResourceA(HMODULE module, char* name, char* type);
+extern HGLOBAL WINAPI expLoadResource(HMODULE module, HRSRC res);
+extern void* WINAPI expLockResource(long res);
+extern int WINAPI expFreeResource(long res);
+extern int WINAPI expCloseHandle(long v1);
+extern const char* WINAPI expGetCommandLineA(void);
+extern LPWSTR WINAPI expGetEnvironmentStringsW(void);
+extern void * WINAPI expRtlZeroMemory(void *p, size_t len);
+extern void * WINAPI expRtlMoveMemory(void *dst, void *src, size_t len);
+extern void * WINAPI expRtlFillMemory(void *p, int ch, size_t len);
+extern int WINAPI expFreeEnvironmentStringsW(short* strings);
+extern int WINAPI expFreeEnvironmentStringsA(char* strings);
+extern LPWSTR WINAPI expGetEnvironmentStringsW(void);
+LPCSTR WINAPI expGetEnvironmentStrings(void);
+extern int WINAPI expGetStartupInfoA(STARTUPINFOA *s);
+extern int WINAPI expGetStdHandle(int z);
+extern int WINAPI expGetFileType(int handle);
+extern int WINAPI expSetHandleCount(int count);
+extern int WINAPI expGetACP(void);
+extern int WINAPI expGetModuleFileNameA(int module, char* s, int len);
+extern int WINAPI expSetUnhandledExceptionFilter(void* filter);
+extern int WINAPI expLoadLibraryA(char* name);
+extern int WINAPI expFreeLibrary(int module);
+extern void* WINAPI expGetProcAddress(HMODULE mod, char* name);
+extern long WINAPI expCreateFileMappingA(int hFile, void* lpAttr,
+					 long flProtect, long dwMaxHigh, long dwMaxLow, const char* name);
+extern long WINAPI expOpenFileMappingA(long hFile, long hz, const char* name);
+extern void* WINAPI expMapViewOfFile(HANDLE file, DWORD mode, DWORD offHigh, DWORD offLow, DWORD size);
+extern void* WINAPI expUnmapViewOfFile(void* view);
+extern void* WINAPI expSleep(int time);
+extern void* WINAPI expCreateCompatibleDC(int hdc);
+extern int WINAPI expGetDeviceCaps(int hdc, int unk);
+extern WIN_BOOL WINAPI expDeleteDC(int hdc);
+extern int WINAPI expGetPrivateProfileIntA(const char* appname, const char* keyname, int default_value, const char* filename);
+extern int WINAPI expGetProfileIntA(const char* appname, const char* keyname, int default_value);
+extern int WINAPI expGetPrivateProfileStringA(const char* appname, const char* keyname,
+					      const char* def_val, char* dest, unsigned int len, const char* filename);
+extern int WINAPI expWritePrivateProfileStringA(const char* appname, const char* keyname,
+						const char* string, const char* filename);
+extern int WINAPI expDefDriverProc(int _private, int id, int msg, int arg1, int arg2);
+extern int WINAPI expSizeofResource(int v1, int v2);
+extern int WINAPI expGetLastError(void);
+extern void WINAPI expSetLastError(int error);
+extern long WINAPI exptimeGetTime(void);
+extern int WINAPI expStringFromGUID2(GUID* guid, char* str, int cbMax);
+extern int WINAPI expGetFileVersionInfoSizeA(const char* name, int* lpHandle);
+extern int WINAPI expIsBadStringPtrW(const short* string, int nchars);
+extern int WINAPI expIsBadStringPtrA(const char* string, int nchars);
+extern long WINAPI expInterlockedIncrement( long* dest );
+extern long WINAPI expInterlockedDecrement( long* dest );
+extern void WINAPI expOutputDebugStringA( const char* string );
+extern int WINAPI expGetDC(int hwnd);
+extern int WINAPI expGetDesktopWindow(void);
+extern int WINAPI expReleaseDC(int hwnd, int hdc);
+extern int WINAPI expLoadCursorA(int handle,LPCSTR name);
+extern int WINAPI expSetCursor(void *cursor);
+extern int WINAPI expGetSystemPaletteEntries(int hdc, int iStartIndex, int nEntries, void* lppe);
+extern int WINAPI expGetTimeZoneInformation(LPTIME_ZONE_INFORMATION lpTimeZoneInformation);
+extern void WINAPI expGetLocalTime(SYSTEMTIME* systime);
+extern int WINAPI expGetSystemTime(SYSTEMTIME* systime);
+extern int WINAPI expGetEnvironmentVariableA(const char* name, char* field, int size);
+extern void* WINAPI expCoTaskMemAlloc(ULONG cb);
+extern void WINAPI expCoTaskMemFree(void* cb);
+extern long WINAPI expCoCreateInstance(GUID* rclsid, struct IUnknown* pUnkOuter,
+				       long dwClsContext, GUID* riid, void** ppv);
+extern int WINAPI expIsRectEmpty(CONST RECT *lprc);
+extern unsigned int WINAPI expGetTempPathA(unsigned int len, char* path);
+extern HANDLE WINAPI expFindFirstFileA(LPCSTR s, LPWIN32_FIND_DATAA lpfd);
+extern WIN_BOOL WINAPI expFindNextFileA(HANDLE h,LPWIN32_FIND_DATAA p);
+extern WIN_BOOL WINAPI expFindClose(HANDLE h);
+extern UINT WINAPI expSetErrorMode(UINT i);
+extern UINT      WINAPI expGetWindowsDirectoryA(LPSTR s,UINT c);
+extern WIN_BOOL  WINAPI expDeleteFileA(LPCSTR s);
+extern WIN_BOOL  WINAPI expFileTimeToLocalFileTime(const FILETIME* cpf, LPFILETIME pf);
+extern UINT WINAPI expGetTempFileNameA(LPCSTR cs1,LPCSTR cs2,UINT i,LPSTR ps);
+extern HANDLE WINAPI expCreateFileA(LPCSTR cs1,DWORD i1,DWORD i2,
+				    LPSECURITY_ATTRIBUTES p1, DWORD i3,DWORD i4,HANDLE i5);
+extern LPCSTR WINAPI expGetSystemDirectoryA(void);
+extern WIN_BOOL WINAPI expReadFile(HANDLE h,LPVOID pv,DWORD size,LPDWORD rd,LPOVERLAPPED unused);
+extern WIN_BOOL WINAPI expWriteFile(HANDLE h,LPCVOID pv,DWORD size,LPDWORD wr,LPOVERLAPPED unused);
+extern DWORD  WINAPI expSetFilePointer(HANDLE h, LONG val, LPLONG ext, DWORD whence);
+extern HDRVR WINAPI expOpenDriverA(LPCSTR szDriverName, LPCSTR szSectionName,
+				   LPARAM lParam2);
+HDRVR WINAPI expOpenDriver(LPCSTR szDriverName, LPCSTR szSectionName,
+			   LPARAM lParam2) ;
+extern WIN_BOOL WINAPI expGetProcessAffinityMask(HANDLE hProcess,
+						 LPDWORD lpProcessAffinityMask,
+						 LPDWORD lpSystemAffinityMask);
+extern  DWORD WINAPI expRegEnumValueA( HKEY hkey, DWORD index, LPSTR value, LPDWORD val_count,
+				       LPDWORD reserved, LPDWORD type, LPBYTE data, LPDWORD count );
+extern INT WINAPI expMulDiv(int nNumber,int nNumerator,int nDenominator);
+extern LONG WINAPI explstrcmpiA(const char* str1, const char* str2);
+extern LONG WINAPI explstrlenA(const char* str1);
+extern LONG WINAPI explstrcpyA(char* str1, const char* str2);
+extern LONG WINAPI expInterlockedExchange(long *dest, long l);
+
+extern void* CDECL expmalloc(int size);
+extern void CDECL expfree(void* mem);
+extern void* CDECL expnew(int size);
+extern int CDECL expdelete(void* memory);
+extern int CDECL exp_initterm(int v1, int v2);
+
+extern int expwsprintfA(char* string, char* format, ...);
+extern char* expstrrchr(char* string, int value);
+extern char* expstrchr(char* string, int value);
+extern int expstrlen(char* str);
+extern int expstrcpy(char* str1, const char* str2);
+extern int expstrcmp(const char* str1, const char* str2);
+extern int expstrcat(char* str1, const char* str2);
+extern int expisalnum(int c);
+extern int expmemmove(void* dest, void* src, int n);
+extern int expmemcmp(void* dest, void* src, int n);
+extern void *expmemcpy(void* dest, void* src, int n) ;
+extern time_t exptime(time_t* t);
+extern void* LookupExternal(const char* library, int ordinal);
+
+#endif

--- config.h DELETED ---




More information about the MPlayer-cvslog mailing list