comparison loader/driver.c @ 1307:d8c1b0b38edc

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.
author jkeil
date Thu, 12 Jul 2001 15:27:48 +0000
parents 1f7c824033fb
children 3189c317dfc1
comparison
equal deleted inserted replaced
1306:7ce37211e454 1307:d8c1b0b38edc
1 #include <config.h> 1 #include <config.h>
2 #include <stdio.h> 2 #include <stdio.h>
3
4 #ifdef HAVE_MALLOC_H 3 #ifdef HAVE_MALLOC_H
5 #include <malloc.h> 4 #include <malloc.h>
6 #else 5 #endif
7 #include <stdlib.h> 6 #include <stdlib.h>
8 #endif 7 #ifdef __FreeBSD__
9 8 #include <sys/time.h>
9 #endif
10
11 #include <win32.h>
10 #include <wine/driver.h> 12 #include <wine/driver.h>
11 #include <wine/pe_image.h> 13 #include <wine/pe_image.h>
12 #include <wine/winreg.h> 14 #include <wine/winreg.h>
13 #include <wine/vfw.h> 15 #include <wine/vfw.h>
14 #include <registry.h> 16 #include <registry.h>
15 17 #include <setup_FS.h>
16 //#include "com.h" 18 #include "driver.h"
17 //typedef long STDCALL (*GETCLASS) (GUID*, GUID*, void**); 19
18 20
19 21 #if 1
20 #ifdef __FreeBSD__ 22 /*
21 #include <sys/time.h> 23 * STORE_ALL/REST_ALL seems like an attempt to workaround problems due to
22 #endif 24 * WINAPI/no-WINAPI bustage.
23 25 *
24 26 * There should be no need for the STORE_ALL/REST_ALL hack once all
27 * function definitions agree with their prototypes (WINAPI-wise) and
28 * we make sure, that we do not call these functions without a proper
29 * prototype in scope.
30 */
31 #define STORE_ALL /**/
32 #define REST_ALL /**/
33 #else
25 #define STORE_ALL \ 34 #define STORE_ALL \
26 __asm__ ( \ 35 __asm__( \
27 "push %%ebx\n\t" \ 36 "push %%ebx\n\t" \
28 "push %%ecx\n\t" \ 37 "push %%ecx\n\t" \
29 "push %%edx\n\t" \ 38 "push %%edx\n\t" \
30 "push %%esi\n\t" \ 39 "push %%esi\n\t" \
31 "push %%edi\n\t"::) 40 "push %%edi\n\t"::)
32 41
33 #define REST_ALL \ 42 #define REST_ALL \
34 __asm__ ( \ 43 __asm__( \
35 "pop %%edi\n\t" \ 44 "pop %%edi\n\t" \
36 "pop %%esi\n\t" \ 45 "pop %%esi\n\t" \
37 "pop %%edx\n\t" \ 46 "pop %%edx\n\t" \
38 "pop %%ecx\n\t" \ 47 "pop %%ecx\n\t" \
39 "pop %%ebx\n\t"::) 48 "pop %%ebx\n\t"::)
40 49 #endif
41 50
42 51
43 typedef struct { 52
44 UINT uDriverSignature;
45 HINSTANCE hDriverModule;
46 DRIVERPROC DriverProc;
47 DWORD dwDriverID;
48 } DRVR;
49
50 typedef DRVR *PDRVR;
51 typedef DRVR *NPDRVR;
52 typedef DRVR *LPDRVR;
53 53
54 static DWORD dwDrvID = 0; 54 static DWORD dwDrvID = 0;
55 55
56 56
57 LRESULT WINAPI SendDriverMessage( HDRVR hDriver, UINT message, 57 LRESULT WINAPI SendDriverMessage( HDRVR hDriver, UINT message,
117 { 117 {
118 DrvFree(hdrvr); 118 DrvFree(hdrvr);
119 } 119 }
120 120
121 121
122 extern char* def_path; //=WIN32_PATH; // path to codecs
123 char* win32_codec_name=NULL; // must be set before calling DrvOpen() !!! 122 char* win32_codec_name=NULL; // must be set before calling DrvOpen() !!!
124 123
125 HDRVR 124 HDRVR VFWAPI
126 DrvOpen(LPARAM lParam2) 125 DrvOpen(LPARAM lParam2)
127 { 126 {
128 ICOPEN *icopen=(ICOPEN *) lParam2; 127 ICOPEN *icopen=(ICOPEN *) lParam2;
129 UINT uDrvResult; 128 UINT uDrvResult;
130 HDRVR hDriver; 129 HDRVR hDriver;