From 024f9ebd1a1aaf07b853f00efca9480d956312bf Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Thu, 2 Apr 2020 10:54:08 +0200 Subject: [PATCH] krnl386: Build with msvcrt. Signed-off-by: Alexandre Julliard --- dlls/krnl386.exe16/Makefile.in | 4 ++-- dlls/krnl386.exe16/atom.c | 4 ---- dlls/krnl386.exe16/dosexe.h | 1 - dlls/krnl386.exe16/dosmem.c | 6 ----- dlls/krnl386.exe16/file.c | 5 +---- dlls/krnl386.exe16/global.c | 12 ---------- dlls/krnl386.exe16/instr.c | 3 --- dlls/krnl386.exe16/int21.c | 23 ++++++------------- dlls/krnl386.exe16/int25.c | 6 +---- dlls/krnl386.exe16/int26.c | 6 +---- dlls/krnl386.exe16/int2f.c | 2 -- dlls/krnl386.exe16/int31.c | 3 --- dlls/krnl386.exe16/interrupts.c | 2 -- dlls/krnl386.exe16/ioports.c | 6 ----- dlls/krnl386.exe16/kernel.c | 2 ++ dlls/krnl386.exe16/kernel16_private.h | 1 - dlls/krnl386.exe16/local.c | 3 --- dlls/krnl386.exe16/ne_module.c | 10 --------- dlls/krnl386.exe16/ne_segment.c | 21 +++--------------- dlls/krnl386.exe16/relay.c | 9 ++------ dlls/krnl386.exe16/resource.c | 32 ++++++++++++--------------- dlls/krnl386.exe16/selector.c | 3 --- dlls/krnl386.exe16/snoop.c | 4 ---- dlls/krnl386.exe16/syslevel.c | 7 +----- dlls/krnl386.exe16/task.c | 6 ----- dlls/krnl386.exe16/thunk.c | 7 ------ dlls/krnl386.exe16/vxd.c | 25 ++++++--------------- dlls/krnl386.exe16/wowthunk.c | 6 ----- 28 files changed, 41 insertions(+), 178 deletions(-) diff --git a/dlls/krnl386.exe16/Makefile.in b/dlls/krnl386.exe16/Makefile.in index 22ab15de90c..906ea5c5224 100644 --- a/dlls/krnl386.exe16/Makefile.in +++ b/dlls/krnl386.exe16/Makefile.in @@ -1,8 +1,8 @@ MODULE = krnl386.exe16 IMPORTLIB = kernel -IMPORTS = winecrt0 kernel32 ntdll +IMPORTS = kernel32 ntdll winecrt0 DELAYIMPORTS = user32 -EXTRADLLFLAGS = -m16 -nodefaultlibs -Wb,--dll-name,kernel +EXTRADLLFLAGS = -m16 -mno-cygwin -nodefaultlibs -Wb,--dll-name,kernel C_SRCS = \ atom.c \ diff --git a/dlls/krnl386.exe16/atom.c b/dlls/krnl386.exe16/atom.c index 23ef717c7b6..b100ce13af0 100644 --- a/dlls/krnl386.exe16/atom.c +++ b/dlls/krnl386.exe16/atom.c @@ -25,9 +25,6 @@ * have to be changed. */ -#include "config.h" -#include "wine/port.h" - #include #include #include @@ -39,7 +36,6 @@ #include "winerror.h" #include "winternl.h" -#include "wine/unicode.h" #include "wine/winbase16.h" #include "kernel16_private.h" diff --git a/dlls/krnl386.exe16/dosexe.h b/dlls/krnl386.exe16/dosexe.h index efdf9641edf..c4c8def5dce 100644 --- a/dlls/krnl386.exe16/dosexe.h +++ b/dlls/krnl386.exe16/dosexe.h @@ -25,7 +25,6 @@ #include #include "windef.h" -#include "wine/library.h" #include "wine/windef16.h" #include "winbase.h" #include "winnt.h" /* for PCONTEXT */ diff --git a/dlls/krnl386.exe16/dosmem.c b/dlls/krnl386.exe16/dosmem.c index d3cf64b1c87..d847bdbb8f3 100644 --- a/dlls/krnl386.exe16/dosmem.c +++ b/dlls/krnl386.exe16/dosmem.c @@ -19,17 +19,11 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include "config.h" -#include "wine/port.h" - #include #include #include #include #include -#ifdef HAVE_SYS_MMAN_H -# include -#endif #include "windef.h" #include "winbase.h" diff --git a/dlls/krnl386.exe16/file.c b/dlls/krnl386.exe16/file.c index e44455a021c..6e50baf0fe1 100644 --- a/dlls/krnl386.exe16/file.c +++ b/dlls/krnl386.exe16/file.c @@ -23,11 +23,9 @@ * Right now, they simply call the CopyFile method. */ -#include "config.h" -#include "wine/port.h" - #include #include +#include #include #include "winerror.h" @@ -36,7 +34,6 @@ #include "winternl.h" #include "wine/winbase16.h" #include "kernel16_private.h" -#include "wine/unicode.h" #include "wine/debug.h" WINE_DEFAULT_DEBUG_CHANNEL(file); diff --git a/dlls/krnl386.exe16/global.c b/dlls/krnl386.exe16/global.c index e7801ef18c9..e66007784ee 100644 --- a/dlls/krnl386.exe16/global.c +++ b/dlls/krnl386.exe16/global.c @@ -19,23 +19,11 @@ */ /* 0xffff sometimes seems to mean: CURRENT_DS */ -#include "config.h" -#include "wine/port.h" - #include #include #include #include -#ifdef HAVE_UNISTD_H -# include -#endif #include -#ifdef HAVE_SYS_PARAM_H -#include -#endif -#ifdef HAVE_SYS_SYSCTL_H -#include -#endif #include "wine/winbase16.h" #include "winternl.h" diff --git a/dlls/krnl386.exe16/instr.c b/dlls/krnl386.exe16/instr.c index d02f1eee955..ff7f866f9e0 100644 --- a/dlls/krnl386.exe16/instr.c +++ b/dlls/krnl386.exe16/instr.c @@ -20,9 +20,6 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include "config.h" -#include "wine/port.h" - #include #include "windef.h" diff --git a/dlls/krnl386.exe16/int21.c b/dlls/krnl386.exe16/int21.c index feab712af09..24909eadddc 100644 --- a/dlls/krnl386.exe16/int21.c +++ b/dlls/krnl386.exe16/int21.c @@ -23,17 +23,9 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include "config.h" -#include "wine/port.h" - #include #include -#ifdef HAVE_SYS_STAT_H -# include -#endif -#ifdef HAVE_UNISTD_H -# include -#endif +#include #include "windef.h" #include "winbase.h" @@ -45,7 +37,6 @@ #include "dosexe.h" #include "winerror.h" #include "winuser.h" -#include "wine/unicode.h" #include "wine/server.h" #include "wine/debug.h" #include "wine/exception.h" @@ -3358,7 +3349,7 @@ static BOOL INT21_CreateTempFile( CONTEXT *context ) for (;;) { - sprintf( p, "wine%04x.%03d", (int)getpid(), counter ); + sprintf( p, "wine%04x.%03d", GetCurrentThreadId(), counter ); counter = (counter + 1) % 1000; SET_AX( context, @@ -3423,7 +3414,7 @@ static BOOL INT21_ToDosFCBFormat( LPCWSTR name, LPWSTR buffer ) buffer[i] = '?'; break; default: - if (strchrW( invalid_chars, *p )) return FALSE; + if (wcschr( invalid_chars, *p )) return FALSE; buffer[i] = *p++; break; } @@ -3459,13 +3450,13 @@ static BOOL INT21_ToDosFCBFormat( LPCWSTR name, LPWSTR buffer ) buffer[i] = '?'; break; default: - if (strchrW( invalid_chars, *p )) return FALSE; + if (wcschr( invalid_chars, *p )) return FALSE; buffer[i] = *p++; break; } } buffer[11] = '\0'; - struprW( buffer ); + wcsupr( buffer ); /* at most 3 character of the extension are processed * is something behind this ? @@ -3491,8 +3482,8 @@ static BOOL INT21_FindFirst( CONTEXT *context ) path = CTX_SEG_OFF_TO_LIN(context, context->SegDs, context->Edx); MultiByteToWideChar(CP_OEMCP, 0, path, -1, pathW, MAX_PATH); - p = strrchrW( pathW, '\\'); - q = strrchrW( pathW, '/'); + p = wcsrchr( pathW, '\\'); + q = wcsrchr( pathW, '/'); if (q>p) p = q; if (!p) { diff --git a/dlls/krnl386.exe16/int25.c b/dlls/krnl386.exe16/int25.c index 0513c8fdac1..1f3f80a6e63 100644 --- a/dlls/krnl386.exe16/int25.c +++ b/dlls/krnl386.exe16/int25.c @@ -18,15 +18,11 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include "config.h" - #include #include #include #include -#ifdef HAVE_UNISTD_H -# include -#endif + #include "dosexe.h" #include "wine/debug.h" diff --git a/dlls/krnl386.exe16/int26.c b/dlls/krnl386.exe16/int26.c index bb3d90bc662..0fc15eba2e6 100644 --- a/dlls/krnl386.exe16/int26.c +++ b/dlls/krnl386.exe16/int26.c @@ -18,14 +18,10 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include "config.h" - #include #include #include -#ifdef HAVE_UNISTD_H -# include -#endif + #include "dosexe.h" #include "wine/debug.h" diff --git a/dlls/krnl386.exe16/int2f.c b/dlls/krnl386.exe16/int2f.c index b0a36e3c059..a50486c28d2 100644 --- a/dlls/krnl386.exe16/int2f.c +++ b/dlls/krnl386.exe16/int2f.c @@ -21,8 +21,6 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include "config.h" - #include #include "ntstatus.h" diff --git a/dlls/krnl386.exe16/int31.c b/dlls/krnl386.exe16/int31.c index 82ee9e97fc6..d5cf02896ab 100644 --- a/dlls/krnl386.exe16/int31.c +++ b/dlls/krnl386.exe16/int31.c @@ -18,9 +18,6 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include "config.h" -#include "wine/port.h" - #include #include "windef.h" diff --git a/dlls/krnl386.exe16/interrupts.c b/dlls/krnl386.exe16/interrupts.c index a8177ffd6cf..e2a129e4a20 100644 --- a/dlls/krnl386.exe16/interrupts.c +++ b/dlls/krnl386.exe16/interrupts.c @@ -18,8 +18,6 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include "config.h" - #include #include "wine/winbase16.h" diff --git a/dlls/krnl386.exe16/ioports.c b/dlls/krnl386.exe16/ioports.c index 0700ae43a3d..8a95dc9aa7b 100644 --- a/dlls/krnl386.exe16/ioports.c +++ b/dlls/krnl386.exe16/ioports.c @@ -26,14 +26,9 @@ fix that, I guess. */ -#include "config.h" - #include #include #include -#ifdef HAVE_SYS_STAT_H -# include -#endif #include "windef.h" #include "winbase.h" @@ -42,7 +37,6 @@ #include "winternl.h" #include "kernel16_private.h" #include "dosexe.h" -#include "wine/unicode.h" #include "wine/debug.h" WINE_DEFAULT_DEBUG_CHANNEL(int); diff --git a/dlls/krnl386.exe16/kernel.c b/dlls/krnl386.exe16/kernel.c index b1cfccacc75..07a57d0d937 100644 --- a/dlls/krnl386.exe16/kernel.c +++ b/dlls/krnl386.exe16/kernel.c @@ -35,6 +35,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(module); extern DWORD WINAPI GetProcessFlags( DWORD processid ); +void *dummy = RaiseException; /* force importing it from kernel32 */ + static DWORD process_dword; /*********************************************************************** diff --git a/dlls/krnl386.exe16/kernel16_private.h b/dlls/krnl386.exe16/kernel16_private.h index 7f4d7629b1b..f15934daa0e 100644 --- a/dlls/krnl386.exe16/kernel16_private.h +++ b/dlls/krnl386.exe16/kernel16_private.h @@ -25,7 +25,6 @@ #include "winreg.h" #include "winternl.h" #include "wine/asm.h" -#include "wine/library.h" #include "pshpack1.h" diff --git a/dlls/krnl386.exe16/local.c b/dlls/krnl386.exe16/local.c index 3b275948c07..bb8fcdb44f2 100644 --- a/dlls/krnl386.exe16/local.c +++ b/dlls/krnl386.exe16/local.c @@ -27,10 +27,7 @@ * parameter than usual. */ -#include "config.h" - #define NONAMELESSUNION - #include #include #include "wine/winbase16.h" diff --git a/dlls/krnl386.exe16/ne_module.c b/dlls/krnl386.exe16/ne_module.c index b8c658566d1..822a5df4c37 100644 --- a/dlls/krnl386.exe16/ne_module.c +++ b/dlls/krnl386.exe16/ne_module.c @@ -18,18 +18,12 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include "config.h" -#include "wine/port.h" - #include #include #include #include #include #include -#ifdef HAVE_UNISTD_H -# include -#endif #include #include "windef.h" @@ -398,7 +392,6 @@ FARPROC16 NE_GetEntryPointEx( HMODULE16 hModule, WORD ordinal, BOOL16 snoop ) ET_BUNDLE *bundle; if (!(pModule = NE_GetPtr( hModule ))) return 0; - assert( !(pModule->ne_flags & NE_FFLAGS_WIN32) ); bundle = (ET_BUNDLE *)((BYTE *)pModule + pModule->ne_enttab); while ((ordinal < bundle->first + 1) || (ordinal > bundle->last)) @@ -452,7 +445,6 @@ BOOL16 NE_SetEntryPoint( HMODULE16 hModule, WORD ordinal, WORD offset ) int i; if (!(pModule = NE_GetPtr( hModule ))) return FALSE; - assert( !(pModule->ne_flags & NE_FFLAGS_WIN32) ); bundle = (ET_BUNDLE *)((BYTE *)pModule + pModule->ne_enttab); while ((ordinal < bundle->first + 1) || (ordinal > bundle->last)) @@ -693,7 +685,6 @@ static HMODULE16 build_module( const void *mapping, SIZE_T mapping_size, LPCSTR ofs->fFixedDisk = 1; strcpy( ofs->szPathName, path ); pData += ofs->cBytes + 1; - assert( (BYTE *)pModule + size <= pData ); /* Get the non-resident names table */ @@ -1938,7 +1929,6 @@ static HMODULE16 create_dummy_module( HMODULE module32 ) /* Module name */ pStr = (char *)pSegment; pModule->ne_restab = pStr - (char *)pModule; - assert(len<256); *pStr = len; lstrcpynA( pStr+1, basename, len+1 ); pStr += len+2; diff --git a/dlls/krnl386.exe16/ne_segment.c b/dlls/krnl386.exe16/ne_segment.c index 318c7cd40b2..aa886148029 100644 --- a/dlls/krnl386.exe16/ne_segment.c +++ b/dlls/krnl386.exe16/ne_segment.c @@ -19,24 +19,16 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include "config.h" -#include "wine/port.h" - -#include #include #include #include #include -#ifdef HAVE_UNISTD_H -# include -#endif #include #include #include "wine/winbase16.h" #include "wownt32.h" #include "winternl.h" -#include "wine/library.h" #include "kernel16_private.h" #include "wine/debug.h" @@ -625,13 +617,10 @@ static VOID NE_GetDLLInitParams( NE_MODULE *pModule, { /* Not SINGLEDATA */ ERR_(dll)("Library is not marked SINGLEDATA\n"); - exit(1); - } - else /* DATA NONE DLL */ - { - *ds = 0; - *heap = 0; } + /* DATA NONE DLL */ + *ds = 0; + *heap = 0; } else /* DATA SINGLE DLL */ { @@ -715,7 +704,6 @@ void NE_InitializeDLLs( HMODULE16 hModule ) HMODULE16 *pDLL; if (!(pModule = NE_GetPtr( hModule ))) return; - assert( !(pModule->ne_flags & NE_FFLAGS_WIN32) ); if (pModule->dlls_to_init) { @@ -879,7 +867,6 @@ static void fill_init_list( struct ne_init_list *list, HMODULE16 hModule ) int i; if (!(pModule = NE_GetPtr( hModule ))) return; - assert( !(pModule->ne_flags & NE_FFLAGS_WIN32) ); /* Never add a module twice */ for ( i = 0; i < list->count; i++ ) @@ -1003,8 +990,6 @@ BOOL NE_CreateSegment( NE_MODULE *pModule, int segnum ) int minsize; unsigned char selflags; - assert( !(pModule->ne_flags & NE_FFLAGS_WIN32) ); - if ( segnum < 1 || segnum > pModule->ne_cseg ) return FALSE; diff --git a/dlls/krnl386.exe16/relay.c b/dlls/krnl386.exe16/relay.c index c7bdab6f958..3543898d799 100644 --- a/dlls/krnl386.exe16/relay.c +++ b/dlls/krnl386.exe16/relay.c @@ -18,9 +18,6 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include "config.h" -#include "wine/port.h" - #include #include #include @@ -33,8 +30,6 @@ #include "winternl.h" #include "kernel16_private.h" #include "dosexe.h" -#include "wine/unicode.h" -#include "wine/library.h" #include "wine/debug.h" WINE_DEFAULT_DEBUG_CHANNEL(relay); @@ -76,14 +71,14 @@ static const char **build_list( const WCHAR *buffer ) const WCHAR *p = buffer; const char **ret; - while ((p = strchrW( p, ';' ))) + while ((p = wcschr( p, ';' ))) { count++; p++; } /* allocate count+1 pointers, plus the space for a copy of the string */ if ((ret = RtlAllocateHeap( GetProcessHeap(), 0, - (count + 1) * sizeof(char *) + (strlenW(buffer) + 1) ))) + (count + 1) * sizeof(char *) + (lstrlenW(buffer) + 1) ))) { char *str = (char *)(ret + count + 1); char *p = str; diff --git a/dlls/krnl386.exe16/resource.c b/dlls/krnl386.exe16/resource.c index 42a6d143a34..0be9e2906eb 100644 --- a/dlls/krnl386.exe16/resource.c +++ b/dlls/krnl386.exe16/resource.c @@ -21,9 +21,6 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include "config.h" -#include "wine/port.h" - #include #include #include @@ -35,7 +32,6 @@ #include "wownt32.h" #include "wine/winbase16.h" #include "wine/winuser16.h" -#include "wine/unicode.h" #include "kernel16_private.h" #include "wine/debug.h" @@ -445,7 +441,7 @@ static void convert_name( LPVOID *dst, LPCVOID *src ) default: len = WideCharToMultiByte( CP_ACP, 0, *src, -1, *dst, 0x7fffffff, NULL,NULL ); *dst = (char *)*dst + len; - *src = (LPCWSTR)*src + strlenW( *src ) + 1; + *src = (LPCWSTR)*src + lstrlenW( *src ) + 1; break; } } @@ -487,7 +483,7 @@ VOID WINAPI ConvertDialog32To16( LPCVOID dialog32, DWORD size, LPVOID dialog16 ) /* Transfer window caption */ WideCharToMultiByte( CP_ACP, 0, dialog32, -1, dialog16, 0x7fffffff, NULL, NULL ); dialog16 = (LPSTR)dialog16 + strlen( dialog16 ) + 1; - dialog32 = (LPCWSTR)dialog32 + strlenW( dialog32 ) + 1; + dialog32 = (LPCWSTR)dialog32 + lstrlenW( dialog32 ) + 1; /* Transfer font info */ if (style & DS_SETFONT) @@ -500,7 +496,7 @@ VOID WINAPI ConvertDialog32To16( LPCVOID dialog32, DWORD size, LPVOID dialog16 ) } WideCharToMultiByte( CP_ACP, 0, dialog32, -1, dialog16, 0x7fffffff, NULL, NULL ); /* faceName */ dialog16 = (LPSTR)dialog16 + strlen( dialog16 ) + 1; - dialog32 = (LPCWSTR)dialog32 + strlenW( dialog32 ) + 1; + dialog32 = (LPCWSTR)dialog32 + lstrlenW( dialog32 ) + 1; } /* Transfer dialog items */ @@ -548,7 +544,7 @@ VOID WINAPI ConvertDialog32To16( LPCVOID dialog32, DWORD size, LPVOID dialog16 ) default: WideCharToMultiByte( CP_ACP, 0, dialog32, -1, dialog16, 0x7fffffff, NULL, NULL ); dialog16 = (LPSTR)dialog16 + strlen( dialog16 ) + 1; - dialog32 = (LPCWSTR)dialog32 + strlenW( dialog32 ) + 1; + dialog32 = (LPCWSTR)dialog32 + lstrlenW( dialog32 ) + 1; break; } @@ -606,7 +602,7 @@ WORD WINAPI GetDialog32Size16( LPCVOID dialog32 ) { case 0x0000: p = (const WORD *)p + 1; break; case 0xffff: p = (const WORD *)p + 2; break; - default: p = (LPCWSTR)p + strlenW( p ) + 1; break; + default: p = (LPCWSTR)p + lstrlenW( p ) + 1; break; } /* Skip class name */ @@ -614,11 +610,11 @@ WORD WINAPI GetDialog32Size16( LPCVOID dialog32 ) { case 0x0000: p = (const WORD *)p + 1; break; case 0xffff: p = (const WORD *)p + 2; break; - default: p = (LPCWSTR)p + strlenW( p ) + 1; break; + default: p = (LPCWSTR)p + lstrlenW( p ) + 1; break; } /* Skip window caption */ - p = (LPCWSTR)p + strlenW( p ) + 1; + p = (LPCWSTR)p + lstrlenW( p ) + 1; /* Skip font info */ if (style & DS_SETFONT) @@ -629,7 +625,7 @@ WORD WINAPI GetDialog32Size16( LPCVOID dialog32 ) p = (const WORD *)p + 1; /* weight */ p = (const WORD *)p + 1; /* italic */ } - p = (LPCWSTR)p + strlenW( p ) + 1; /* faceName */ + p = (LPCWSTR)p + lstrlenW( p ) + 1; /* faceName */ } /* Skip dialog items */ @@ -665,7 +661,7 @@ WORD WINAPI GetDialog32Size16( LPCVOID dialog32 ) { case 0x0000: p = (const WORD *)p + 1; break; case 0xffff: p = (const WORD *)p + 2; break; - default: p = (LPCWSTR)p + strlenW( p ) + 1; break; + default: p = (LPCWSTR)p + lstrlenW( p ) + 1; break; } /* Skip window name */ @@ -673,7 +669,7 @@ WORD WINAPI GetDialog32Size16( LPCVOID dialog32 ) { case 0x0000: p = (const WORD *)p + 1; break; case 0xffff: p = (const WORD *)p + 2; break; - default: p = (LPCWSTR)p + strlenW( p ) + 1; break; + default: p = (LPCWSTR)p + lstrlenW( p ) + 1; break; } /* Skip data */ @@ -718,7 +714,7 @@ VOID WINAPI ConvertMenu32To16( LPCVOID menu32, DWORD size, LPVOID menu16 ) WideCharToMultiByte( CP_ACP, 0, menu32, -1, menu16, 0x7fffffff, NULL, NULL ); menu16 = (LPSTR)menu16 + strlen( menu16 ) + 1; - menu32 = (LPCWSTR)menu32 + strlenW( menu32 ) + 1; + menu32 = (LPCWSTR)menu32 + lstrlenW( menu32 ) + 1; if ( flags & MF_END ) level--; @@ -733,7 +729,7 @@ VOID WINAPI ConvertMenu32To16( LPCVOID menu32, DWORD size, LPVOID menu16 ) WideCharToMultiByte( CP_ACP, 0, menu32, -1, menu16, 0x7fffffff, NULL, NULL ); menu16 = (LPSTR)menu16 + strlen( menu16 ) + 1; - menu32 = (LPCWSTR)menu32 + strlenW( menu32 ) + 1; + menu32 = (LPCWSTR)menu32 + lstrlenW( menu32 ) + 1; /* align on DWORD boundary (32-bit only) */ menu32 = (LPCVOID)(((UINT_PTR)menu32 + 3) & ~3); @@ -772,7 +768,7 @@ WORD WINAPI GetMenu32Size16( LPCVOID menu32 ) else level++; - p = (LPCWSTR)p + strlenW( p ) + 1; + p = (LPCWSTR)p + lstrlenW( p ) + 1; if ( flags & MF_END ) level--; @@ -784,7 +780,7 @@ WORD WINAPI GetMenu32Size16( LPCVOID menu32 ) p = (const DWORD *)p + 1; /* ID */ flags = get_word(&p); - p = (LPCWSTR)p + strlenW( p ) + 1; + p = (LPCWSTR)p + lstrlenW( p ) + 1; /* align on DWORD boundary (32-bit only) */ p = (LPCVOID)(((UINT_PTR)p + 3) & ~3); diff --git a/dlls/krnl386.exe16/selector.c b/dlls/krnl386.exe16/selector.c index fd29081900b..94088276d69 100644 --- a/dlls/krnl386.exe16/selector.c +++ b/dlls/krnl386.exe16/selector.c @@ -18,9 +18,6 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include "config.h" -#include "wine/port.h" - #include #include "wine/winbase16.h" diff --git a/dlls/krnl386.exe16/snoop.c b/dlls/krnl386.exe16/snoop.c index 4953e7e7ac0..170796da390 100644 --- a/dlls/krnl386.exe16/snoop.c +++ b/dlls/krnl386.exe16/snoop.c @@ -18,9 +18,6 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include "config.h" -#include "wine/port.h" - #include #include #include @@ -30,7 +27,6 @@ #include "winnt.h" #include "wine/winbase16.h" #include "winternl.h" -#include "wine/library.h" #include "kernel16_private.h" #include "wine/debug.h" diff --git a/dlls/krnl386.exe16/syslevel.c b/dlls/krnl386.exe16/syslevel.c index f9f0f2de138..cd93b9a0480 100644 --- a/dlls/krnl386.exe16/syslevel.c +++ b/dlls/krnl386.exe16/syslevel.c @@ -18,19 +18,14 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include "config.h" - #include -#ifdef HAVE_UNISTD_H -# include -#endif #include + #include "windef.h" #include "winbase.h" #include "winternl.h" #include "wine/winbase16.h" #include "kernel16_private.h" -#include "wine/library.h" #include "wine/debug.h" WINE_DEFAULT_DEBUG_CHANNEL(syslevel); diff --git a/dlls/krnl386.exe16/task.c b/dlls/krnl386.exe16/task.c index 0a2875b5b02..39a60cb97a9 100644 --- a/dlls/krnl386.exe16/task.c +++ b/dlls/krnl386.exe16/task.c @@ -18,16 +18,10 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include "config.h" -#include "wine/port.h" - #include #include #include #include -#ifdef HAVE_UNISTD_H -# include -#endif #include "windef.h" #include "winbase.h" diff --git a/dlls/krnl386.exe16/thunk.c b/dlls/krnl386.exe16/thunk.c index a9d81c5b3fa..78925f594ba 100644 --- a/dlls/krnl386.exe16/thunk.c +++ b/dlls/krnl386.exe16/thunk.c @@ -20,16 +20,10 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include "config.h" -#include "wine/port.h" - #include #include #include #include -#ifdef HAVE_UNISTD_H -# include -#endif #include "windef.h" #include "winbase.h" @@ -39,7 +33,6 @@ #include "wine/winbase16.h" #include "wine/debug.h" -#include "wine/library.h" #include "kernel16_private.h" WINE_DEFAULT_DEBUG_CHANNEL(thunk); diff --git a/dlls/krnl386.exe16/vxd.c b/dlls/krnl386.exe16/vxd.c index 1b50b150272..ab9d916d834 100644 --- a/dlls/krnl386.exe16/vxd.c +++ b/dlls/krnl386.exe16/vxd.c @@ -20,17 +20,8 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include "config.h" -#include "wine/port.h" - #include -#ifdef HAVE_UNISTD_H -# include -#endif #include -#ifdef HAVE_SYS_STAT_H -# include -#endif #include #include @@ -44,8 +35,6 @@ #include "winioctl.h" #include "kernel16_private.h" #include "dosexe.h" -#include "wine/library.h" -#include "wine/unicode.h" #include "wine/server.h" #include "wine/debug.h" @@ -156,17 +145,17 @@ HANDLE __wine_vxd_open( LPCWSTR filenameW, DWORD access, SECURITY_ATTRIBUTES *sa /* normalize the filename */ - if (strlenW( filenameW ) >= ARRAY_SIZE(name) - 4 || - strchrW( filenameW, '/' ) || strchrW( filenameW, '\\' )) + if (lstrlenW( filenameW ) >= ARRAY_SIZE(name) - 4 || + wcschr( filenameW, '/' ) || wcschr( filenameW, '\\' )) { SetLastError( ERROR_FILE_NOT_FOUND ); return 0; } - strcpyW( name, filenameW ); - strlwrW( name ); - p = strchrW( name, '.' ); - if (!p) strcatW( name, dotVxDW ); - else if (strcmpiW( p, dotVxDW )) /* existing extension has to be .vxd */ + lstrcpyW( name, filenameW ); + wcslwr( name ); + p = wcschr( name, '.' ); + if (!p) lstrcatW( name, dotVxDW ); + else if (wcsicmp( p, dotVxDW )) /* existing extension has to be .vxd */ { SetLastError( ERROR_FILE_NOT_FOUND ); return 0; diff --git a/dlls/krnl386.exe16/wowthunk.c b/dlls/krnl386.exe16/wowthunk.c index 616a0a1052d..2dddbf93289 100644 --- a/dlls/krnl386.exe16/wowthunk.c +++ b/dlls/krnl386.exe16/wowthunk.c @@ -18,10 +18,6 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include "config.h" -#include "wine/port.h" - -#include #include #include @@ -424,8 +420,6 @@ BOOL WINAPI K32WOWCallback16Ex( DWORD vpfn16, DWORD dwFlags, SYSLEVEL_CheckNotLevel( 2 ); } - assert( !(context->EFlags & 0x00020000) ); /* vm86 mode no longer supported */ - /* push return address */ if (dwFlags & WCB16_REGS_LONG) {