diff options
author | uid56437 <none@none> | 2001-07-04 14:05:09 +0000 |
---|---|---|
committer | uid56437 <none@none> | 2001-07-04 14:05:09 +0000 |
commit | 0342d76c613911b282e14a1188326075d1d43bca (patch) | |
tree | 0547e6dd8fa7fa400a06d793642cd03855d6ccc5 /src/libw32dll/wine/win32.c | |
parent | 2806c8c5cd03db19886b75fa05b6e50d7d4815e1 (diff) | |
download | xine-lib-0342d76c613911b282e14a1188326075d1d43bca.tar.gz xine-lib-0342d76c613911b282e14a1188326075d1d43bca.tar.bz2 |
Add prototypes for all functions in wine/*, to catch __stdcall function
attribute mismatches between function prototypes and function definitions.
Such a __stdcall mismatch can corrupt the cpu's stack, because both the
caller and the callee clean up function parameter from the stack (or none
of them removes the function parameters)
wine/* should be less sensitive to optimzation options due to this change.
CVS patchset: 245
CVS date: 2001/07/04 14:05:09
Diffstat (limited to 'src/libw32dll/wine/win32.c')
-rw-r--r-- | src/libw32dll/wine/win32.c | 32 |
1 files changed, 15 insertions, 17 deletions
diff --git a/src/libw32dll/wine/win32.c b/src/libw32dll/wine/win32.c index 294616efc..df06fe53b 100644 --- a/src/libw32dll/wine/win32.c +++ b/src/libw32dll/wine/win32.c @@ -31,7 +31,7 @@ #include "winerror.h" #include "debugtools.h" #include "module.h" - +#include "resource.h" #include "registry.h" #include "loader.h" @@ -98,7 +98,7 @@ static void longcount(long long* z) } #endif -void dbgprintf(char* fmt, ...) +static void dbgprintf(char* fmt, ...) { #ifdef DETAILED_OUT #if 1 @@ -127,7 +127,7 @@ char export_names[500][30]={ static unsigned char* heap=NULL; static int heap_counter=0; -void test_heap() +static void test_heap() { int offset=0; if(heap==0) @@ -211,7 +211,7 @@ void* my_mreq(int size, int to_zero) *(int*)answer=size; return (int*)answer+1; } -int my_release(char* memory) +int my_release(void* memory) { if(memory==0)return 0; free(memory-4); @@ -301,17 +301,15 @@ int CDECL exp_initterm(int v1, int v2) 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; + else + result = (void*)pdrv->hDriverModule; dbgprintf("GetDriverModuleHandle(%x)\n", pdrv); - return pdrv->hDriverModule; + return result; } void* WINAPI expGetModuleHandleA(const char* name) @@ -728,14 +726,14 @@ int WINAPI expGetCurrentThreadId() dbgprintf("GetCurrentThreadId() \n"); 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; @@ -826,14 +824,14 @@ int WINAPI expLoadStringA(long instance, long id, void* buf, long size) return LoadStringA(instance, id, buf, size); } -long WINAPI expMultiByteToWideChar(long v1, long v2, char* s1, long siz1, char* s2, int siz2) +long WINAPI expMultiByteToWideChar(long v1, long v2, char* s1, long siz1, short* s2, int siz2) { #warning FIXME dbgprintf("MB2WCh\n"); dbgprintf("WARNING: Unsupported call: MBToWCh %s\n", s1); if(s2==0) return 1; - s2[0]=s2[1]=0; + s2[0]=0; return 1; } long WINAPI expWideCharToMultiByte(long v1, long v2, short* s1, long siz1, char* s2, int siz2, char* c3, int* siz3) |