[PATCH] kernel32: Fix definitions of some wine internal functions
Maarten Lankhorst
m.b.lankhorst at gmail.com
Tue Dec 16 09:16:10 CST 2008
---
dlls/kernel32/instr.c | 6 +++++-
dlls/kernel32/kernel16_private.h | 2 +-
dlls/kernel32/kernel32.spec | 2 +-
dlls/kernel32/path.c | 4 ++--
dlls/kernel32/process.c | 2 +-
dlls/kernel32/relay16.c | 2 +-
dlls/ntdll/loader.c | 2 +-
dlls/ntoskrnl.exe/ntoskrnl.c | 2 ++
include/winbase.h | 4 ++--
programs/start/start.c | 2 +-
programs/winepath/winepath.c | 4 ++--
11 files changed, 19 insertions(+), 13 deletions(-)
diff --git a/dlls/kernel32/instr.c b/dlls/kernel32/instr.c
index 73edf7b..d96739a 100644
--- a/dlls/kernel32/instr.c
+++ b/dlls/kernel32/instr.c
@@ -427,13 +427,14 @@ static void INSTR_outport( WORD port, int size, DWORD val, CONTEXT86 *context )
}
+#ifdef __i386__
/***********************************************************************
* __wine_emulate_instruction
*
* Emulate a privileged instruction.
* Returns exception continuation status.
*/
-DWORD __wine_emulate_instruction( EXCEPTION_RECORD *rec, CONTEXT86 *context )
+DWORD __cdecl __wine_emulate_instruction( EXCEPTION_RECORD *rec, CONTEXT86 *context )
{
int prefix, segprefix, prefixlen, len, repX, long_op, long_addr;
BYTE *instr;
@@ -868,6 +869,7 @@ DWORD __wine_emulate_instruction( EXCEPTION_RECORD *rec, CONTEXT86 *context )
}
return ExceptionContinueSearch; /* Unable to emulate it */
}
+#endif
/***********************************************************************
@@ -878,6 +880,7 @@ DWORD __wine_emulate_instruction( EXCEPTION_RECORD *rec, CONTEXT86 *context )
*/
LONG CALLBACK INSTR_vectored_handler( EXCEPTION_POINTERS *ptrs )
{
+#ifdef __i386__
EXCEPTION_RECORD *record = ptrs->ExceptionRecord;
CONTEXT86 *context = ptrs->ContextRecord;
@@ -888,6 +891,7 @@ LONG CALLBACK INSTR_vectored_handler( EXCEPTION_POINTERS *ptrs )
if (__wine_emulate_instruction( record, context ) == ExceptionContinueExecution)
return EXCEPTION_CONTINUE_EXECUTION;
}
+#endif
return EXCEPTION_CONTINUE_SEARCH;
}
diff --git a/dlls/kernel32/kernel16_private.h b/dlls/kernel32/kernel16_private.h
index 0c59bbd..d1c5e08 100644
--- a/dlls/kernel32/kernel16_private.h
+++ b/dlls/kernel32/kernel16_private.h
@@ -148,7 +148,7 @@ typedef struct _THHOOK
} THHOOK;
extern LONG __wine_call_from_16();
-extern void __wine_call_from_16_regs();
+extern void __cdecl __wine_call_from_16_regs();
extern THHOOK *pThhook;
diff --git a/dlls/kernel32/kernel32.spec b/dlls/kernel32/kernel32.spec
index 047a6b8..fa97e69 100644
--- a/dlls/kernel32/kernel32.spec
+++ b/dlls/kernel32/kernel32.spec
@@ -1254,7 +1254,7 @@
@ cdecl __wine_dll_register_16(ptr str)
@ cdecl __wine_dll_unregister_16(ptr)
@ varargs -private __wine_call_from_16_regs()
-@ cdecl __wine_emulate_instruction(ptr ptr)
+@ cdecl -i386 __wine_emulate_instruction(ptr ptr)
# Unix files
@ cdecl wine_get_unix_file_name(wstr)
diff --git a/dlls/kernel32/path.c b/dlls/kernel32/path.c
index fca12cc..16f51af 100644
--- a/dlls/kernel32/path.c
+++ b/dlls/kernel32/path.c
@@ -1583,7 +1583,7 @@ BOOL WINAPI NeedCurrentDirectoryForExePathA( LPCSTR name )
* Return the full Unix file name for a given path.
* Returned buffer must be freed by caller.
*/
-char *wine_get_unix_file_name( LPCWSTR dosW )
+char __cdecl *wine_get_unix_file_name( LPCWSTR dosW )
{
UNICODE_STRING nt_name;
ANSI_STRING unix_name;
@@ -1607,7 +1607,7 @@ char *wine_get_unix_file_name( LPCWSTR dosW )
* Return the full DOS file name for a given Unix path.
* Returned buffer must be freed by caller.
*/
-WCHAR *wine_get_dos_file_name( LPCSTR str )
+WCHAR __cdecl *wine_get_dos_file_name( LPCSTR str )
{
UNICODE_STRING nt_name;
ANSI_STRING unix_name;
diff --git a/dlls/kernel32/process.c b/dlls/kernel32/process.c
index 751480e..49ec154 100644
--- a/dlls/kernel32/process.c
+++ b/dlls/kernel32/process.c
@@ -961,7 +961,7 @@ static void set_process_name( int argc, char *argv[] )
*
* Wine initialisation: load and start the main exe file.
*/
-void __wine_kernel_init(void)
+void __cdecl __wine_kernel_init(void)
{
static const WCHAR kernel32W[] = {'k','e','r','n','e','l','3','2',0};
static const WCHAR dotW[] = {'.',0};
diff --git a/dlls/kernel32/relay16.c b/dlls/kernel32/relay16.c
index e34eb36..b8f167e 100644
--- a/dlls/kernel32/relay16.c
+++ b/dlls/kernel32/relay16.c
@@ -579,7 +579,7 @@ int relay_call_from_16( void *entry_point, unsigned char *args16, CONTEXT86 *con
/***********************************************************************
* __wine_call_from_16_regs (KERNEL32.@)
*/
-void __wine_call_from_16_regs(void)
+void __cdecl __wine_call_from_16_regs(void)
{
assert( FALSE );
}
diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c
index 3a2276f..ed792f2 100644
--- a/dlls/ntdll/loader.c
+++ b/dlls/ntdll/loader.c
@@ -2652,7 +2652,7 @@ void __wine_process_init(void)
WINE_MODREF *wm;
NTSTATUS status;
ANSI_STRING func_name;
- void (* DECLSPEC_NORETURN init_func)(void);
+ void (* DECLSPEC_NORETURN __cdecl init_func)(void);
extern mode_t FILE_umask;
main_exe_file = thread_init();
diff --git a/dlls/ntoskrnl.exe/ntoskrnl.c b/dlls/ntoskrnl.exe/ntoskrnl.c
index 3abe46d..d4e072e 100644
--- a/dlls/ntoskrnl.exe/ntoskrnl.c
+++ b/dlls/ntoskrnl.exe/ntoskrnl.c
@@ -116,6 +116,7 @@ static HANDLE get_device_manager(void)
/* exception handler for emulation of privileged instructions */
static LONG CALLBACK vectored_handler( EXCEPTION_POINTERS *ptrs )
{
+#ifdef __i386__
extern DWORD __wine_emulate_instruction( EXCEPTION_RECORD *rec, CONTEXT86 *context );
EXCEPTION_RECORD *record = ptrs->ExceptionRecord;
@@ -127,6 +128,7 @@ static LONG CALLBACK vectored_handler( EXCEPTION_POINTERS *ptrs )
if (__wine_emulate_instruction( record, context ) == ExceptionContinueExecution)
return EXCEPTION_CONTINUE_EXECUTION;
}
+#endif
return EXCEPTION_CONTINUE_SEARCH;
}
diff --git a/include/winbase.h b/include/winbase.h
index 8c25387..dd99bf2 100644
--- a/include/winbase.h
+++ b/include/winbase.h
@@ -2311,8 +2311,8 @@ WINBASEAPI VOID WINAPI _LeaveSysLevel(SYSLEVEL*);
/* Wine internal functions */
-extern char *wine_get_unix_file_name( LPCWSTR dos );
-extern WCHAR *wine_get_dos_file_name( LPCSTR str );
+extern char __cdecl *wine_get_unix_file_name( LPCWSTR dos );
+extern WCHAR __cdecl *wine_get_dos_file_name( LPCSTR str );
/* Interlocked functions */
diff --git a/programs/start/start.c b/programs/start/start.c
index 2009e78..83e6f18 100644
--- a/programs/start/start.c
+++ b/programs/start/start.c
@@ -258,7 +258,7 @@ int wmain (int argc, WCHAR *argv[])
sei.lpParameters = args;
if (unix_mode) {
- LPWSTR (*wine_get_dos_file_name_ptr)(LPCSTR);
+ LPWSTR (*__cdecl wine_get_dos_file_name_ptr)(LPCSTR);
char* multibyte_unixpath;
int multibyte_unixpath_len;
diff --git a/programs/winepath/winepath.c b/programs/winepath/winepath.c
index f4430d3..78907b2 100644
--- a/programs/winepath/winepath.c
+++ b/programs/winepath/winepath.c
@@ -142,8 +142,8 @@ static int parse_options(const WCHAR *argv[])
*/
int wmain(int argc, const WCHAR *argv[])
{
- LPSTR (*wine_get_unix_file_name_ptr)(LPCWSTR) = NULL;
- LPWSTR (*wine_get_dos_file_name_ptr)(LPCSTR) = NULL;
+ LPSTR (*__cdecl wine_get_unix_file_name_ptr)(LPCWSTR) = NULL;
+ LPWSTR (*__cdecl wine_get_dos_file_name_ptr)(LPCSTR) = NULL;
WCHAR dos_pathW[MAX_PATH];
char path[MAX_PATH];
int outputformats;
--
1.5.6.5
--------------050602010601090008020403--
More information about the wine-patches
mailing list