summaryrefslogtreecommitdiff
path: root/src/libw32dll/wine
diff options
context:
space:
mode:
Diffstat (limited to 'src/libw32dll/wine')
-rw-r--r--src/libw32dll/wine/afl.c1
-rw-r--r--src/libw32dll/wine/debugtools.h11
-rw-r--r--src/libw32dll/wine/driver.c8
-rw-r--r--src/libw32dll/wine/elfdll.c1
-rw-r--r--src/libw32dll/wine/ext.c4
-rw-r--r--src/libw32dll/wine/module.c43
-rw-r--r--src/libw32dll/wine/pe_image.c6
-rw-r--r--src/libw32dll/wine/registry.c4
-rw-r--r--src/libw32dll/wine/resource.c10
-rw-r--r--src/libw32dll/wine/vfw.h1
-rw-r--r--src/libw32dll/wine/win32.c43
-rw-r--r--src/libw32dll/wine/win32.h2
12 files changed, 79 insertions, 55 deletions
diff --git a/src/libw32dll/wine/afl.c b/src/libw32dll/wine/afl.c
index 6f3fb0eb6..8ea29ed6d 100644
--- a/src/libw32dll/wine/afl.c
+++ b/src/libw32dll/wine/afl.c
@@ -36,6 +36,7 @@
#include "msacmdrv.h"
#include "wineacm.h"
#include "ext.h"
+#include "debugtools.h"
#include "driver.h"
diff --git a/src/libw32dll/wine/debugtools.h b/src/libw32dll/wine/debugtools.h
index 79107ff1d..ef86580af 100644
--- a/src/libw32dll/wine/debugtools.h
+++ b/src/libw32dll/wine/debugtools.h
@@ -12,8 +12,13 @@
struct _GUID;
-#define TRACE __vprintf
-#define dbg_printf __vprintf
+#ifdef LOG
+# define TRACE __vprintf
+# define dbg_printf __vprintf
+#else
+# define TRACE(...)
+# define dbg_printf(...)
+#endif
/* Internal definitions (do not use these directly) */
@@ -66,11 +71,13 @@ static inline LPCSTR debugstr_a( LPCSTR s ) { return debugstr_an( s, 80 ); }
static inline LPCSTR debugstr_w( LPCWSTR s ) { return debugstr_wn( s, 80 ); }
#endif
+#if 0 /* dbg_printf already defined as a macro */
#ifdef __GNUC__
extern int dbg_printf(const char *format, ...) __attribute__((format (printf,1,2)));
#else
extern int dbg_printf(const char *format, ...);
#endif
+#endif
#define TRACE_(X) TRACE
#define WARN_(X) TRACE
diff --git a/src/libw32dll/wine/driver.c b/src/libw32dll/wine/driver.c
index 7720a4975..923622aaa 100644
--- a/src/libw32dll/wine/driver.c
+++ b/src/libw32dll/wine/driver.c
@@ -15,8 +15,8 @@
#include "vfw.h"
#include "registry.h"
#include "ldt_keeper.h"
-
-extern char* win32_def_path;
+#include "ext.h"
+#include "debugtools.h"
#if 1
@@ -52,6 +52,7 @@ extern char* win32_def_path;
"pop %%ebx\n\t"::)
#endif
+#if 0
static int needs_free=0;
void SetCodecPath(const char* path)
{
@@ -66,6 +67,7 @@ void SetCodecPath(const char* path)
strcpy(win32_def_path, path);
needs_free=1;
}
+#endif
static DWORD dwDrvID = 0;
@@ -130,7 +132,7 @@ void DrvClose(HDRVR hDriver)
HDRVR DrvOpen(LPARAM lParam2)
{
NPDRVR hDriver;
- int i;
+// int i;
char unknown[0x124];
const char* filename = (const char*) ((ICOPEN*) lParam2)->pV1Reserved;
diff --git a/src/libw32dll/wine/elfdll.c b/src/libw32dll/wine/elfdll.c
index ecee7a28c..d060c5810 100644
--- a/src/libw32dll/wine/elfdll.c
+++ b/src/libw32dll/wine/elfdll.c
@@ -33,7 +33,6 @@ extern void dump_exports(HMODULE hModule);
/*---------------- END HACKS ---------------*/
//char *extra_ld_library_path = "/usr/lib/win32";
-extern char* win32_def_path;
struct elfdll_image
{
diff --git a/src/libw32dll/wine/ext.c b/src/libw32dll/wine/ext.c
index 7cdfdedc8..dee474d39 100644
--- a/src/libw32dll/wine/ext.c
+++ b/src/libw32dll/wine/ext.c
@@ -74,7 +74,7 @@ HANDLE WINAPI GetProcessHeap(void)
LPVOID WINAPI HeapAlloc(HANDLE heap, DWORD flags, DWORD size)
{
- static int i = 5;
+ //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)
@@ -326,7 +326,7 @@ int FILE_munmap( LPVOID start, DWORD size_high, DWORD size_low )
printf("offsets larger than 4Gb not supported\n");
return munmap( start, size_low );
}
-static int mapping_size=0;
+//static int mapping_size=0;
struct file_mapping_s;
typedef struct file_mapping_s
diff --git a/src/libw32dll/wine/module.c b/src/libw32dll/wine/module.c
index 559f93201..4393f7f00 100644
--- a/src/libw32dll/wine/module.c
+++ b/src/libw32dll/wine/module.c
@@ -130,8 +130,10 @@ static WIN_BOOL MODULE_InitDll( WINE_MODREF *wm, DWORD type, LPVOID lpReserved )
{
WIN_BOOL retv = TRUE;
+#ifdef LOG
static LPCSTR typeName[] = { "PROCESS_DETACH", "PROCESS_ATTACH",
"THREAD_ATTACH", "THREAD_DETACH" };
+#endif
assert( wm );
@@ -353,7 +355,6 @@ HMODULE WINAPI LoadLibraryExA(LPCSTR libname, HANDLE hfile, DWORD flags)
{
WINE_MODREF *wm = 0;
char* listpath[] = { "", "", "/usr/lib/win32", "/usr/local/lib/win32", 0 };
- extern char* win32_def_path;
char path[512];
char checked[2000];
int i = -1;
@@ -428,10 +429,10 @@ HMODULE WINAPI LoadLibraryExA(LPCSTR libname, HANDLE hfile, DWORD flags)
// dispatch_addr = GetProcAddress(wm->module, "theQuickTimeDispatcher", TRUE);
dispatch_addr = PE_FindExportedFunction(wm, "theQuickTimeDispatcher", TRUE);
- if (dispatch_addr == 0x62924c30)
+ if (dispatch_addr == (void *)0x62924c30)
{
printf ("wine/module: QuickTime5 DLLs found\n");
- ptr = 0x62b75ca4; // dispatch_ptr
+ 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 ?
@@ -456,10 +457,10 @@ HMODULE WINAPI LoadLibraryExA(LPCSTR libname, HANDLE hfile, DWORD flags)
((char *)0x6288e0ae)[0] = 0xc3; // font/dc remover
for (i=0;i<24;i++) ((char*)0x6287a1ad)[i]=0x90; // destroy window
#endif
- } else if (dispatch_addr == 0x6693b330)
+ } else if (dispatch_addr == (void *)0x6693b330)
{
printf ("wine/module: QuickTime6 DLLs found\n");
- ptr = 0x66bb9524; // dispatcher_ptr
+ 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
@@ -467,9 +468,9 @@ HMODULE WINAPI LoadLibraryExA(LPCSTR libname, HANDLE hfile, DWORD flags)
for (i=0;i<96;i++) ((char *)0x66aac852)[i]=0x90; // disable threads
} else
{
- printf ("wine/module: Unsupported QuickTime version (0x%x)\n",
+ printf ("wine/module: Unsupported QuickTime version (%p)\n",
dispatch_addr);
- return NULL;
+ return 0;
}
printf ("wine/module: QuickTime.qts patched!!! old entry=%p\n",ptr[0]);
@@ -559,13 +560,13 @@ FARPROC WINAPI GetProcAddress( HMODULE hModule, LPCSTR function )
#ifdef DEBUG_QTX_API
-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;
+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){
switch(what){
@@ -722,15 +723,15 @@ static int report_func(void *stack_base, int stack_size, reg386_t *reg, u_int32_
// memory management:
case 0x150011: //NewPtrClear
case 0x150012: //NewPtrSysClear
- reg->eax=malloc(((u_int32_t *)stack_base)[1]);
- memset(reg->eax,0,((u_int32_t *)stack_base)[1]);
+ reg->eax=(u_int32_t)malloc(((u_int32_t *)stack_base)[1]);
+ memset((void *)reg->eax,0,((u_int32_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=malloc(((u_int32_t *)stack_base)[1]);
+ reg->eax=(u_int32_t)malloc(((u_int32_t *)stack_base)[1]);
#ifdef DEBUG_QTX_API
printf("%*sLEAVE(%d): EMULATED! 0x%X\n",ret_i*2,"",ret_i, reg->eax);
#endif
@@ -739,7 +740,7 @@ static int report_func(void *stack_base, int stack_size, reg386_t *reg, u_int32_
if(((u_int32_t *)stack_base)[1]>=0x60000000)
printf("WARNING! Invalid Ptr handle!\n");
else
- free(((u_int32_t *)stack_base)[1]);
+ free((void *)(((u_int32_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);
@@ -840,8 +841,10 @@ static int report_func(void *stack_base, int stack_size, reg386_t *reg, u_int32_
static int report_func_ret(void *stack_base, int stack_size, reg386_t *reg, u_int32_t *flags)
{
+#ifdef DEBUG_QTX_API
int i;
short err;
+#endif
// restore ret addr:
--ret_i;
@@ -953,8 +956,8 @@ FARPROC MODULE_GetProcAddress(
fprintf(stderr,"theQuickTimeDispatcher caught -> %p\n",retproc);
report_entry = report_func;
report_ret = report_func_ret;
- wrapper_target=retproc;
- retproc=wrapper;
+ wrapper_target=(void *)retproc;
+ retproc=(void *)wrapper;
}
}
diff --git a/src/libw32dll/wine/pe_image.c b/src/libw32dll/wine/pe_image.c
index c824933ad..92017f906 100644
--- a/src/libw32dll/wine/pe_image.c
+++ b/src/libw32dll/wine/pe_image.c
@@ -645,8 +645,8 @@ HMODULE PE_LoadImage( int handle, LPCSTR filename, WORD *version )
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 );
+ (char *)RVA(pe_sec->VirtualAddress) + pe_sec->SizeOfRawData,
+ (char *)RVA(pe_sec->VirtualAddress) + end );
memset( (char*)RVA(pe_sec->VirtualAddress) + pe_sec->SizeOfRawData, 0,
end - pe_sec->SizeOfRawData );
}
@@ -950,6 +950,7 @@ WIN_BOOL PE_InitDLL( WINE_MODREF *wm, DWORD type, LPVOID lpReserved )
return retv;
}
+#if 0
static LPVOID
_fixup_address(PIMAGE_OPTIONAL_HEADER opt,int delta,LPVOID addr) {
if ( ((DWORD)addr>opt->ImageBase) &&
@@ -961,3 +962,4 @@ _fixup_address(PIMAGE_OPTIONAL_HEADER opt,int delta,LPVOID addr) {
return addr;
}
+#endif
diff --git a/src/libw32dll/wine/registry.c b/src/libw32dll/wine/registry.c
index 7be9eab54..0f91499b3 100644
--- a/src/libw32dll/wine/registry.c
+++ b/src/libw32dll/wine/registry.c
@@ -15,6 +15,8 @@
#include "ext.h"
#include "registry.h"
+#include "debugtools.h"
+
#ifdef XINE_MAJOR
#include "xineutils.h"
#endif
@@ -180,6 +182,7 @@ void free_registry(void)
}
+#if 0
static reg_handle_t* find_handle_by_name(const char* name)
{
reg_handle_t* t;
@@ -192,6 +195,7 @@ static reg_handle_t* find_handle_by_name(const char* name)
}
return 0;
}
+#endif
static struct reg_value* find_value_by_name(const char* name)
{
int i;
diff --git a/src/libw32dll/wine/resource.c b/src/libw32dll/wine/resource.c
index 16e015e1f..4faa71e6e 100644
--- a/src/libw32dll/wine/resource.c
+++ b/src/libw32dll/wine/resource.c
@@ -101,13 +101,13 @@ static HRSRC RES_FindResource( HMODULE hModule, LPCSTR type,
static DWORD RES_SizeofResource( HMODULE hModule, HRSRC hRsrc)
{
DWORD size = 0;
- HRSRC hRsrc32;
-
+// 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 );
+// WINE_MODREF *wm = MODULE32_LookupHMODULE( hModule );
if ( !hModule || !hRsrc ) return 0;
@@ -130,7 +130,7 @@ static HFILE RES_AccessResource( HMODULE hModule, HRSRC hRsrc )
{
HFILE hFile = HFILE_ERROR;
- WINE_MODREF *wm = MODULE32_LookupHMODULE( hModule );
+// WINE_MODREF *wm = MODULE32_LookupHMODULE( hModule );
if ( !hModule || !hRsrc ) return HFILE_ERROR;
@@ -147,7 +147,7 @@ static HFILE RES_AccessResource( HMODULE hModule, HRSRC hRsrc )
static HGLOBAL RES_LoadResource( HMODULE hModule, HRSRC hRsrc)
{
HGLOBAL hMem = 0;
- HRSRC hRsrc32;
+// HRSRC hRsrc32;
WINE_MODREF *wm = MODULE32_LookupHMODULE( hModule );
diff --git a/src/libw32dll/wine/vfw.h b/src/libw32dll/wine/vfw.h
index d2917601e..f2e9364e2 100644
--- a/src/libw32dll/wine/vfw.h
+++ b/src/libw32dll/wine/vfw.h
@@ -430,6 +430,7 @@ long VFWAPIV ICUniversalEx(HIC hic,int command,LPBITMAPINFOHEADER lpbiFormat,LPB
#define ICDRAW_FULLSCREEN 0x00000002L /* draw to full screen */
#define ICDRAW_HDC 0x00000004L /* draw to a HDC/HWND */
+long VFWAPI VideoForWindowsVersion(void);
WIN_BOOL VFWAPI ICInfo(long fccType, long fccHandler, ICINFO * lpicinfo);
LRESULT VFWAPI ICGetInfo(HIC hic,ICINFO *picinfo, long cb);
diff --git a/src/libw32dll/wine/win32.c b/src/libw32dll/wine/win32.c
index 64a36867a..6bf7341c0 100644
--- a/src/libw32dll/wine/win32.c
+++ b/src/libw32dll/wine/win32.c
@@ -238,11 +238,16 @@ typedef struct th_list_t{
// 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;
+#undef MEMORY_DEBUG
+
+#ifdef MEMORY_DEBUG
+
+static unsigned char* heap=NULL;
+static int heap_counter=0;
+
static void test_heap(void)
{
int offset=0;
@@ -263,10 +268,6 @@ static void test_heap(void)
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;
@@ -819,7 +820,7 @@ static void* WINAPI expWaitForMultipleObjects(int count, const void** objects,
{
int i;
void *object;
- int ret;
+ void *ret;
dbgprintf("WaitForMultipleObjects(%d, 0x%x, %d, duration %d) =>\n",
count, objects, WaitAll, duration);
@@ -845,7 +846,7 @@ static void WINAPI expExitThread(int retcode)
static HANDLE WINAPI expCreateMutexA(void *pSecAttr,
char bInitialOwner, const char *name)
{
- HANDLE mlist = expCreateEventA(pSecAttr, 0, 0, name);
+ HANDLE mlist = (HANDLE)expCreateEventA(pSecAttr, 0, 0, name);
if (name)
dbgprintf("CreateMutexA(0x%x, %d, '%s') => 0x%x\n",
@@ -858,7 +859,7 @@ static HANDLE WINAPI expCreateMutexA(void *pSecAttr,
waits for ever, else it works ;) */
return mlist;
#else
- return NULL;
+ return 0;
#endif
}
@@ -892,7 +893,9 @@ static void WINAPI expGetSystemInfo(SYSTEM_INFO* si)
/* FIXME: better values for the two entries below... */
static int cache = 0;
static SYSTEM_INFO cachedsi;
+#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__svr4__)
unsigned int regs[4];
+#endif
dbgprintf("GetSystemInfo(%p) =>\n", si);
if (cache) {
@@ -2529,7 +2532,7 @@ static int WINAPI expGetMonitorInfoA(void *mon, LPMONITORINFO lpmi)
if (lpmi->cbSize == sizeof(MONITORINFOEX))
{
- LPMONITORINFOEX lpmiex = lpmi;
+ LPMONITORINFOEX lpmiex = (LPMONITORINFOEX)lpmi;
dbgprintf("MONITORINFOEX!\n");
strncpy(lpmiex->szDevice, "Monitor1", CCHDEVICENAME);
}
@@ -3570,9 +3573,9 @@ static DWORD WINAPI expGetFullPathNameA
#endif
#else
if (strrchr(lpFileName, '\\'))
- *lpFilePart = strrchr(lpFileName, '\\');
+ *lpFilePart = (int)strrchr(lpFileName, '\\');
else
- *lpFilePart = lpFileName;
+ *lpFilePart = (int)lpFileName;
#endif
strcpy(lpBuffer, lpFileName);
// strncpy(lpBuffer, lpFileName, rindex(lpFileName, '\\')-lpFileName);
@@ -4170,14 +4173,14 @@ static double expcos(double x)
return cos(x);
}
+#else
+
/* doens't work */
static long exp_ftol_wrong(double x)
{
return (long) x;
}
-#else
-
static void explog10(void)
{
__asm__ __volatile__
@@ -4413,7 +4416,7 @@ static void WINAPI expGlobalMemoryStatus(
lpmem->dwAvailPageFile = 16*1024*1024;
}
expGetSystemInfo(&si);
- lpmem->dwTotalVirtual = si.lpMaximumApplicationAddress-si.lpMinimumApplicationAddress;
+ lpmem->dwTotalVirtual = (char *)si.lpMaximumApplicationAddress-(char *)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));
@@ -4444,7 +4447,7 @@ static WIN_BOOL WINAPI expSetThreadPriority(
static void WINAPI expExitProcess( DWORD status )
{
- printf("EXIT - code %d\n",status);
+ printf("EXIT - code %d\n",(int)status);
exit(status);
}
@@ -4503,7 +4506,7 @@ static int expSysStringByteLen(void *str)
static int expDirectDrawCreate(void)
{
dbgprintf("DirectDrawCreate(...) => NULL\n");
- return NULL;
+ return 0;
}
#if 1
@@ -4529,8 +4532,8 @@ static HPALETTE WINAPI expCreatePalette(CONST LOGPALETTE *lpgpl)
dbgprintf("CreatePalette(%x) => NULL\n", lpgpl);
i = sizeof(LOGPALETTE)+((lpgpl->palNumEntries-1)*sizeof(PALETTEENTRY));
- test = malloc(i);
- memcpy(test, lpgpl, i);
+ test = (HPALETTE)malloc(i);
+ memcpy((void *)test, lpgpl, i);
return test;
}
@@ -5133,9 +5136,9 @@ void* LookupExternal(const char* library, int ordinal)
hand, func);
return func;
}
-#endif
no_dll:
+#endif
if(pos>150)return 0;
sprintf(export_names[pos], "%s:%d", library, ordinal);
return add_stub();
diff --git a/src/libw32dll/wine/win32.h b/src/libw32dll/wine/win32.h
index 79d6877e3..23590b320 100644
--- a/src/libw32dll/wine/win32.h
+++ b/src/libw32dll/wine/win32.h
@@ -7,6 +7,8 @@
#include "winbase.h"
#include "com.h"
+extern char* win32_def_path;
+
extern void my_garbagecollection(void);
typedef struct {