krnl386: Build with msvcrt.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alexandre Julliard 2020-04-02 10:54:08 +02:00
parent 2746797ad5
commit 024f9ebd1a
28 changed files with 41 additions and 178 deletions

View File

@ -1,8 +1,8 @@
MODULE = krnl386.exe16 MODULE = krnl386.exe16
IMPORTLIB = kernel IMPORTLIB = kernel
IMPORTS = winecrt0 kernel32 ntdll IMPORTS = kernel32 ntdll winecrt0
DELAYIMPORTS = user32 DELAYIMPORTS = user32
EXTRADLLFLAGS = -m16 -nodefaultlibs -Wb,--dll-name,kernel EXTRADLLFLAGS = -m16 -mno-cygwin -nodefaultlibs -Wb,--dll-name,kernel
C_SRCS = \ C_SRCS = \
atom.c \ atom.c \

View File

@ -25,9 +25,6 @@
* have to be changed. * have to be changed.
*/ */
#include "config.h"
#include "wine/port.h"
#include <stdlib.h> #include <stdlib.h>
#include <stdarg.h> #include <stdarg.h>
#include <stdio.h> #include <stdio.h>
@ -39,7 +36,6 @@
#include "winerror.h" #include "winerror.h"
#include "winternl.h" #include "winternl.h"
#include "wine/unicode.h"
#include "wine/winbase16.h" #include "wine/winbase16.h"
#include "kernel16_private.h" #include "kernel16_private.h"

View File

@ -25,7 +25,6 @@
#include <sys/types.h> #include <sys/types.h>
#include "windef.h" #include "windef.h"
#include "wine/library.h"
#include "wine/windef16.h" #include "wine/windef16.h"
#include "winbase.h" #include "winbase.h"
#include "winnt.h" /* for PCONTEXT */ #include "winnt.h" /* for PCONTEXT */

View File

@ -19,17 +19,11 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#include "config.h"
#include "wine/port.h"
#include <signal.h> #include <signal.h>
#include <stdarg.h> #include <stdarg.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <sys/types.h> #include <sys/types.h>
#ifdef HAVE_SYS_MMAN_H
# include <sys/mman.h>
#endif
#include "windef.h" #include "windef.h"
#include "winbase.h" #include "winbase.h"

View File

@ -23,11 +23,9 @@
* Right now, they simply call the CopyFile method. * Right now, they simply call the CopyFile method.
*/ */
#include "config.h"
#include "wine/port.h"
#include <stdarg.h> #include <stdarg.h>
#include <stdio.h> #include <stdio.h>
#include <string.h>
#include <assert.h> #include <assert.h>
#include "winerror.h" #include "winerror.h"
@ -36,7 +34,6 @@
#include "winternl.h" #include "winternl.h"
#include "wine/winbase16.h" #include "wine/winbase16.h"
#include "kernel16_private.h" #include "kernel16_private.h"
#include "wine/unicode.h"
#include "wine/debug.h" #include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(file); WINE_DEFAULT_DEBUG_CHANNEL(file);

View File

@ -19,23 +19,11 @@
*/ */
/* 0xffff sometimes seems to mean: CURRENT_DS */ /* 0xffff sometimes seems to mean: CURRENT_DS */
#include "config.h"
#include "wine/port.h"
#include <sys/types.h> #include <sys/types.h>
#include <stdlib.h> #include <stdlib.h>
#include <time.h> #include <time.h>
#include <stdio.h> #include <stdio.h>
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
#include <string.h> #include <string.h>
#ifdef HAVE_SYS_PARAM_H
#include <sys/param.h>
#endif
#ifdef HAVE_SYS_SYSCTL_H
#include <sys/sysctl.h>
#endif
#include "wine/winbase16.h" #include "wine/winbase16.h"
#include "winternl.h" #include "winternl.h"

View File

@ -20,9 +20,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#include "config.h"
#include "wine/port.h"
#include <stdarg.h> #include <stdarg.h>
#include "windef.h" #include "windef.h"

View File

@ -23,17 +23,9 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#include "config.h"
#include "wine/port.h"
#include <stdarg.h> #include <stdarg.h>
#include <stdio.h> #include <stdio.h>
#ifdef HAVE_SYS_STAT_H #include <string.h>
# include <sys/stat.h>
#endif
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
#include "windef.h" #include "windef.h"
#include "winbase.h" #include "winbase.h"
@ -45,7 +37,6 @@
#include "dosexe.h" #include "dosexe.h"
#include "winerror.h" #include "winerror.h"
#include "winuser.h" #include "winuser.h"
#include "wine/unicode.h"
#include "wine/server.h" #include "wine/server.h"
#include "wine/debug.h" #include "wine/debug.h"
#include "wine/exception.h" #include "wine/exception.h"
@ -3358,7 +3349,7 @@ static BOOL INT21_CreateTempFile( CONTEXT *context )
for (;;) for (;;)
{ {
sprintf( p, "wine%04x.%03d", (int)getpid(), counter ); sprintf( p, "wine%04x.%03d", GetCurrentThreadId(), counter );
counter = (counter + 1) % 1000; counter = (counter + 1) % 1000;
SET_AX( context, SET_AX( context,
@ -3423,7 +3414,7 @@ static BOOL INT21_ToDosFCBFormat( LPCWSTR name, LPWSTR buffer )
buffer[i] = '?'; buffer[i] = '?';
break; break;
default: default:
if (strchrW( invalid_chars, *p )) return FALSE; if (wcschr( invalid_chars, *p )) return FALSE;
buffer[i] = *p++; buffer[i] = *p++;
break; break;
} }
@ -3459,13 +3450,13 @@ static BOOL INT21_ToDosFCBFormat( LPCWSTR name, LPWSTR buffer )
buffer[i] = '?'; buffer[i] = '?';
break; break;
default: default:
if (strchrW( invalid_chars, *p )) return FALSE; if (wcschr( invalid_chars, *p )) return FALSE;
buffer[i] = *p++; buffer[i] = *p++;
break; break;
} }
} }
buffer[11] = '\0'; buffer[11] = '\0';
struprW( buffer ); wcsupr( buffer );
/* at most 3 character of the extension are processed /* at most 3 character of the extension are processed
* is something behind this ? * 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); path = CTX_SEG_OFF_TO_LIN(context, context->SegDs, context->Edx);
MultiByteToWideChar(CP_OEMCP, 0, path, -1, pathW, MAX_PATH); MultiByteToWideChar(CP_OEMCP, 0, path, -1, pathW, MAX_PATH);
p = strrchrW( pathW, '\\'); p = wcsrchr( pathW, '\\');
q = strrchrW( pathW, '/'); q = wcsrchr( pathW, '/');
if (q>p) p = q; if (q>p) p = q;
if (!p) if (!p)
{ {

View File

@ -18,15 +18,11 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#include "config.h"
#include <stdlib.h> #include <stdlib.h>
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include <fcntl.h> #include <fcntl.h>
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
#include "dosexe.h" #include "dosexe.h"
#include "wine/debug.h" #include "wine/debug.h"

View File

@ -18,14 +18,10 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#include "config.h"
#include <stdlib.h> #include <stdlib.h>
#include <stdio.h> #include <stdio.h>
#include <fcntl.h> #include <fcntl.h>
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
#include "dosexe.h" #include "dosexe.h"
#include "wine/debug.h" #include "wine/debug.h"

View File

@ -21,8 +21,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#include "config.h"
#include <string.h> #include <string.h>
#include "ntstatus.h" #include "ntstatus.h"

View File

@ -18,9 +18,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#include "config.h"
#include "wine/port.h"
#include <stdarg.h> #include <stdarg.h>
#include "windef.h" #include "windef.h"

View File

@ -18,8 +18,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#include "config.h"
#include <stdio.h> #include <stdio.h>
#include "wine/winbase16.h" #include "wine/winbase16.h"

View File

@ -26,14 +26,9 @@
fix that, I guess. fix that, I guess.
*/ */
#include "config.h"
#include <stdarg.h> #include <stdarg.h>
#include <stdlib.h> #include <stdlib.h>
#include <sys/types.h> #include <sys/types.h>
#ifdef HAVE_SYS_STAT_H
# include <sys/stat.h>
#endif
#include "windef.h" #include "windef.h"
#include "winbase.h" #include "winbase.h"
@ -42,7 +37,6 @@
#include "winternl.h" #include "winternl.h"
#include "kernel16_private.h" #include "kernel16_private.h"
#include "dosexe.h" #include "dosexe.h"
#include "wine/unicode.h"
#include "wine/debug.h" #include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(int); WINE_DEFAULT_DEBUG_CHANNEL(int);

View File

@ -35,6 +35,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(module);
extern DWORD WINAPI GetProcessFlags( DWORD processid ); extern DWORD WINAPI GetProcessFlags( DWORD processid );
void *dummy = RaiseException; /* force importing it from kernel32 */
static DWORD process_dword; static DWORD process_dword;
/*********************************************************************** /***********************************************************************

View File

@ -25,7 +25,6 @@
#include "winreg.h" #include "winreg.h"
#include "winternl.h" #include "winternl.h"
#include "wine/asm.h" #include "wine/asm.h"
#include "wine/library.h"
#include "pshpack1.h" #include "pshpack1.h"

View File

@ -27,10 +27,7 @@
* parameter than usual. * parameter than usual.
*/ */
#include "config.h"
#define NONAMELESSUNION #define NONAMELESSUNION
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include "wine/winbase16.h" #include "wine/winbase16.h"

View File

@ -18,18 +18,12 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#include "config.h"
#include "wine/port.h"
#include <assert.h> #include <assert.h>
#include <fcntl.h> #include <fcntl.h>
#include <stdarg.h> #include <stdarg.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
#include <ctype.h> #include <ctype.h>
#include "windef.h" #include "windef.h"
@ -398,7 +392,6 @@ FARPROC16 NE_GetEntryPointEx( HMODULE16 hModule, WORD ordinal, BOOL16 snoop )
ET_BUNDLE *bundle; ET_BUNDLE *bundle;
if (!(pModule = NE_GetPtr( hModule ))) return 0; if (!(pModule = NE_GetPtr( hModule ))) return 0;
assert( !(pModule->ne_flags & NE_FFLAGS_WIN32) );
bundle = (ET_BUNDLE *)((BYTE *)pModule + pModule->ne_enttab); bundle = (ET_BUNDLE *)((BYTE *)pModule + pModule->ne_enttab);
while ((ordinal < bundle->first + 1) || (ordinal > bundle->last)) while ((ordinal < bundle->first + 1) || (ordinal > bundle->last))
@ -452,7 +445,6 @@ BOOL16 NE_SetEntryPoint( HMODULE16 hModule, WORD ordinal, WORD offset )
int i; int i;
if (!(pModule = NE_GetPtr( hModule ))) return FALSE; if (!(pModule = NE_GetPtr( hModule ))) return FALSE;
assert( !(pModule->ne_flags & NE_FFLAGS_WIN32) );
bundle = (ET_BUNDLE *)((BYTE *)pModule + pModule->ne_enttab); bundle = (ET_BUNDLE *)((BYTE *)pModule + pModule->ne_enttab);
while ((ordinal < bundle->first + 1) || (ordinal > bundle->last)) 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; ofs->fFixedDisk = 1;
strcpy( ofs->szPathName, path ); strcpy( ofs->szPathName, path );
pData += ofs->cBytes + 1; pData += ofs->cBytes + 1;
assert( (BYTE *)pModule + size <= pData );
/* Get the non-resident names table */ /* Get the non-resident names table */
@ -1938,7 +1929,6 @@ static HMODULE16 create_dummy_module( HMODULE module32 )
/* Module name */ /* Module name */
pStr = (char *)pSegment; pStr = (char *)pSegment;
pModule->ne_restab = pStr - (char *)pModule; pModule->ne_restab = pStr - (char *)pModule;
assert(len<256);
*pStr = len; *pStr = len;
lstrcpynA( pStr+1, basename, len+1 ); lstrcpynA( pStr+1, basename, len+1 );
pStr += len+2; pStr += len+2;

View File

@ -19,24 +19,16 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#include "config.h"
#include "wine/port.h"
#include <assert.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <sys/types.h> #include <sys/types.h>
#include <fcntl.h> #include <fcntl.h>
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
#include <ctype.h> #include <ctype.h>
#include <string.h> #include <string.h>
#include "wine/winbase16.h" #include "wine/winbase16.h"
#include "wownt32.h" #include "wownt32.h"
#include "winternl.h" #include "winternl.h"
#include "wine/library.h"
#include "kernel16_private.h" #include "kernel16_private.h"
#include "wine/debug.h" #include "wine/debug.h"
@ -625,13 +617,10 @@ static VOID NE_GetDLLInitParams( NE_MODULE *pModule,
{ {
/* Not SINGLEDATA */ /* Not SINGLEDATA */
ERR_(dll)("Library is not marked SINGLEDATA\n"); 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 */ else /* DATA SINGLE DLL */
{ {
@ -715,7 +704,6 @@ void NE_InitializeDLLs( HMODULE16 hModule )
HMODULE16 *pDLL; HMODULE16 *pDLL;
if (!(pModule = NE_GetPtr( hModule ))) return; if (!(pModule = NE_GetPtr( hModule ))) return;
assert( !(pModule->ne_flags & NE_FFLAGS_WIN32) );
if (pModule->dlls_to_init) if (pModule->dlls_to_init)
{ {
@ -879,7 +867,6 @@ static void fill_init_list( struct ne_init_list *list, HMODULE16 hModule )
int i; int i;
if (!(pModule = NE_GetPtr( hModule ))) return; if (!(pModule = NE_GetPtr( hModule ))) return;
assert( !(pModule->ne_flags & NE_FFLAGS_WIN32) );
/* Never add a module twice */ /* Never add a module twice */
for ( i = 0; i < list->count; i++ ) for ( i = 0; i < list->count; i++ )
@ -1003,8 +990,6 @@ BOOL NE_CreateSegment( NE_MODULE *pModule, int segnum )
int minsize; int minsize;
unsigned char selflags; unsigned char selflags;
assert( !(pModule->ne_flags & NE_FFLAGS_WIN32) );
if ( segnum < 1 || segnum > pModule->ne_cseg ) if ( segnum < 1 || segnum > pModule->ne_cseg )
return FALSE; return FALSE;

View File

@ -18,9 +18,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#include "config.h"
#include "wine/port.h"
#include <assert.h> #include <assert.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
@ -33,8 +30,6 @@
#include "winternl.h" #include "winternl.h"
#include "kernel16_private.h" #include "kernel16_private.h"
#include "dosexe.h" #include "dosexe.h"
#include "wine/unicode.h"
#include "wine/library.h"
#include "wine/debug.h" #include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(relay); WINE_DEFAULT_DEBUG_CHANNEL(relay);
@ -76,14 +71,14 @@ static const char **build_list( const WCHAR *buffer )
const WCHAR *p = buffer; const WCHAR *p = buffer;
const char **ret; const char **ret;
while ((p = strchrW( p, ';' ))) while ((p = wcschr( p, ';' )))
{ {
count++; count++;
p++; p++;
} }
/* allocate count+1 pointers, plus the space for a copy of the string */ /* allocate count+1 pointers, plus the space for a copy of the string */
if ((ret = RtlAllocateHeap( GetProcessHeap(), 0, 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 *str = (char *)(ret + count + 1);
char *p = str; char *p = str;

View File

@ -21,9 +21,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#include "config.h"
#include "wine/port.h"
#include <stdarg.h> #include <stdarg.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
@ -35,7 +32,6 @@
#include "wownt32.h" #include "wownt32.h"
#include "wine/winbase16.h" #include "wine/winbase16.h"
#include "wine/winuser16.h" #include "wine/winuser16.h"
#include "wine/unicode.h"
#include "kernel16_private.h" #include "kernel16_private.h"
#include "wine/debug.h" #include "wine/debug.h"
@ -445,7 +441,7 @@ static void convert_name( LPVOID *dst, LPCVOID *src )
default: default:
len = WideCharToMultiByte( CP_ACP, 0, *src, -1, *dst, 0x7fffffff, NULL,NULL ); len = WideCharToMultiByte( CP_ACP, 0, *src, -1, *dst, 0x7fffffff, NULL,NULL );
*dst = (char *)*dst + len; *dst = (char *)*dst + len;
*src = (LPCWSTR)*src + strlenW( *src ) + 1; *src = (LPCWSTR)*src + lstrlenW( *src ) + 1;
break; break;
} }
} }
@ -487,7 +483,7 @@ VOID WINAPI ConvertDialog32To16( LPCVOID dialog32, DWORD size, LPVOID dialog16 )
/* Transfer window caption */ /* Transfer window caption */
WideCharToMultiByte( CP_ACP, 0, dialog32, -1, dialog16, 0x7fffffff, NULL, NULL ); WideCharToMultiByte( CP_ACP, 0, dialog32, -1, dialog16, 0x7fffffff, NULL, NULL );
dialog16 = (LPSTR)dialog16 + strlen( dialog16 ) + 1; dialog16 = (LPSTR)dialog16 + strlen( dialog16 ) + 1;
dialog32 = (LPCWSTR)dialog32 + strlenW( dialog32 ) + 1; dialog32 = (LPCWSTR)dialog32 + lstrlenW( dialog32 ) + 1;
/* Transfer font info */ /* Transfer font info */
if (style & DS_SETFONT) 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 */ WideCharToMultiByte( CP_ACP, 0, dialog32, -1, dialog16, 0x7fffffff, NULL, NULL ); /* faceName */
dialog16 = (LPSTR)dialog16 + strlen( dialog16 ) + 1; dialog16 = (LPSTR)dialog16 + strlen( dialog16 ) + 1;
dialog32 = (LPCWSTR)dialog32 + strlenW( dialog32 ) + 1; dialog32 = (LPCWSTR)dialog32 + lstrlenW( dialog32 ) + 1;
} }
/* Transfer dialog items */ /* Transfer dialog items */
@ -548,7 +544,7 @@ VOID WINAPI ConvertDialog32To16( LPCVOID dialog32, DWORD size, LPVOID dialog16 )
default: default:
WideCharToMultiByte( CP_ACP, 0, dialog32, -1, dialog16, 0x7fffffff, NULL, NULL ); WideCharToMultiByte( CP_ACP, 0, dialog32, -1, dialog16, 0x7fffffff, NULL, NULL );
dialog16 = (LPSTR)dialog16 + strlen( dialog16 ) + 1; dialog16 = (LPSTR)dialog16 + strlen( dialog16 ) + 1;
dialog32 = (LPCWSTR)dialog32 + strlenW( dialog32 ) + 1; dialog32 = (LPCWSTR)dialog32 + lstrlenW( dialog32 ) + 1;
break; break;
} }
@ -606,7 +602,7 @@ WORD WINAPI GetDialog32Size16( LPCVOID dialog32 )
{ {
case 0x0000: p = (const WORD *)p + 1; break; case 0x0000: p = (const WORD *)p + 1; break;
case 0xffff: p = (const WORD *)p + 2; 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 */ /* Skip class name */
@ -614,11 +610,11 @@ WORD WINAPI GetDialog32Size16( LPCVOID dialog32 )
{ {
case 0x0000: p = (const WORD *)p + 1; break; case 0x0000: p = (const WORD *)p + 1; break;
case 0xffff: p = (const WORD *)p + 2; 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 */ /* Skip window caption */
p = (LPCWSTR)p + strlenW( p ) + 1; p = (LPCWSTR)p + lstrlenW( p ) + 1;
/* Skip font info */ /* Skip font info */
if (style & DS_SETFONT) if (style & DS_SETFONT)
@ -629,7 +625,7 @@ WORD WINAPI GetDialog32Size16( LPCVOID dialog32 )
p = (const WORD *)p + 1; /* weight */ p = (const WORD *)p + 1; /* weight */
p = (const WORD *)p + 1; /* italic */ p = (const WORD *)p + 1; /* italic */
} }
p = (LPCWSTR)p + strlenW( p ) + 1; /* faceName */ p = (LPCWSTR)p + lstrlenW( p ) + 1; /* faceName */
} }
/* Skip dialog items */ /* Skip dialog items */
@ -665,7 +661,7 @@ WORD WINAPI GetDialog32Size16( LPCVOID dialog32 )
{ {
case 0x0000: p = (const WORD *)p + 1; break; case 0x0000: p = (const WORD *)p + 1; break;
case 0xffff: p = (const WORD *)p + 2; 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 */ /* Skip window name */
@ -673,7 +669,7 @@ WORD WINAPI GetDialog32Size16( LPCVOID dialog32 )
{ {
case 0x0000: p = (const WORD *)p + 1; break; case 0x0000: p = (const WORD *)p + 1; break;
case 0xffff: p = (const WORD *)p + 2; 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 */ /* 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 ); WideCharToMultiByte( CP_ACP, 0, menu32, -1, menu16, 0x7fffffff, NULL, NULL );
menu16 = (LPSTR)menu16 + strlen( menu16 ) + 1; menu16 = (LPSTR)menu16 + strlen( menu16 ) + 1;
menu32 = (LPCWSTR)menu32 + strlenW( menu32 ) + 1; menu32 = (LPCWSTR)menu32 + lstrlenW( menu32 ) + 1;
if ( flags & MF_END ) if ( flags & MF_END )
level--; level--;
@ -733,7 +729,7 @@ VOID WINAPI ConvertMenu32To16( LPCVOID menu32, DWORD size, LPVOID menu16 )
WideCharToMultiByte( CP_ACP, 0, menu32, -1, menu16, 0x7fffffff, NULL, NULL ); WideCharToMultiByte( CP_ACP, 0, menu32, -1, menu16, 0x7fffffff, NULL, NULL );
menu16 = (LPSTR)menu16 + strlen( menu16 ) + 1; 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) */ /* align on DWORD boundary (32-bit only) */
menu32 = (LPCVOID)(((UINT_PTR)menu32 + 3) & ~3); menu32 = (LPCVOID)(((UINT_PTR)menu32 + 3) & ~3);
@ -772,7 +768,7 @@ WORD WINAPI GetMenu32Size16( LPCVOID menu32 )
else else
level++; level++;
p = (LPCWSTR)p + strlenW( p ) + 1; p = (LPCWSTR)p + lstrlenW( p ) + 1;
if ( flags & MF_END ) if ( flags & MF_END )
level--; level--;
@ -784,7 +780,7 @@ WORD WINAPI GetMenu32Size16( LPCVOID menu32 )
p = (const DWORD *)p + 1; /* ID */ p = (const DWORD *)p + 1; /* ID */
flags = get_word(&p); flags = get_word(&p);
p = (LPCWSTR)p + strlenW( p ) + 1; p = (LPCWSTR)p + lstrlenW( p ) + 1;
/* align on DWORD boundary (32-bit only) */ /* align on DWORD boundary (32-bit only) */
p = (LPCVOID)(((UINT_PTR)p + 3) & ~3); p = (LPCVOID)(((UINT_PTR)p + 3) & ~3);

View File

@ -18,9 +18,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#include "config.h"
#include "wine/port.h"
#include <string.h> #include <string.h>
#include "wine/winbase16.h" #include "wine/winbase16.h"

View File

@ -18,9 +18,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#include "config.h"
#include "wine/port.h"
#include <assert.h> #include <assert.h>
#include <string.h> #include <string.h>
#include <stdarg.h> #include <stdarg.h>
@ -30,7 +27,6 @@
#include "winnt.h" #include "winnt.h"
#include "wine/winbase16.h" #include "wine/winbase16.h"
#include "winternl.h" #include "winternl.h"
#include "wine/library.h"
#include "kernel16_private.h" #include "kernel16_private.h"
#include "wine/debug.h" #include "wine/debug.h"

View File

@ -18,19 +18,14 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#include "config.h"
#include <stdarg.h> #include <stdarg.h>
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
#include <sys/types.h> #include <sys/types.h>
#include "windef.h" #include "windef.h"
#include "winbase.h" #include "winbase.h"
#include "winternl.h" #include "winternl.h"
#include "wine/winbase16.h" #include "wine/winbase16.h"
#include "kernel16_private.h" #include "kernel16_private.h"
#include "wine/library.h"
#include "wine/debug.h" #include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(syslevel); WINE_DEFAULT_DEBUG_CHANNEL(syslevel);

View File

@ -18,16 +18,10 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#include "config.h"
#include "wine/port.h"
#include <stdarg.h> #include <stdarg.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <assert.h> #include <assert.h>
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
#include "windef.h" #include "windef.h"
#include "winbase.h" #include "winbase.h"

View File

@ -20,16 +20,10 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#include "config.h"
#include "wine/port.h"
#include <string.h> #include <string.h>
#include <sys/types.h> #include <sys/types.h>
#include <stdarg.h> #include <stdarg.h>
#include <stdio.h> #include <stdio.h>
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
#include "windef.h" #include "windef.h"
#include "winbase.h" #include "winbase.h"
@ -39,7 +33,6 @@
#include "wine/winbase16.h" #include "wine/winbase16.h"
#include "wine/debug.h" #include "wine/debug.h"
#include "wine/library.h"
#include "kernel16_private.h" #include "kernel16_private.h"
WINE_DEFAULT_DEBUG_CHANNEL(thunk); WINE_DEFAULT_DEBUG_CHANNEL(thunk);

View File

@ -20,17 +20,8 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#include "config.h"
#include "wine/port.h"
#include <stdlib.h> #include <stdlib.h>
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
#include <sys/types.h> #include <sys/types.h>
#ifdef HAVE_SYS_STAT_H
# include <sys/stat.h>
#endif
#include <string.h> #include <string.h>
#include <stdarg.h> #include <stdarg.h>
@ -44,8 +35,6 @@
#include "winioctl.h" #include "winioctl.h"
#include "kernel16_private.h" #include "kernel16_private.h"
#include "dosexe.h" #include "dosexe.h"
#include "wine/library.h"
#include "wine/unicode.h"
#include "wine/server.h" #include "wine/server.h"
#include "wine/debug.h" #include "wine/debug.h"
@ -156,17 +145,17 @@ HANDLE __wine_vxd_open( LPCWSTR filenameW, DWORD access, SECURITY_ATTRIBUTES *sa
/* normalize the filename */ /* normalize the filename */
if (strlenW( filenameW ) >= ARRAY_SIZE(name) - 4 || if (lstrlenW( filenameW ) >= ARRAY_SIZE(name) - 4 ||
strchrW( filenameW, '/' ) || strchrW( filenameW, '\\' )) wcschr( filenameW, '/' ) || wcschr( filenameW, '\\' ))
{ {
SetLastError( ERROR_FILE_NOT_FOUND ); SetLastError( ERROR_FILE_NOT_FOUND );
return 0; return 0;
} }
strcpyW( name, filenameW ); lstrcpyW( name, filenameW );
strlwrW( name ); wcslwr( name );
p = strchrW( name, '.' ); p = wcschr( name, '.' );
if (!p) strcatW( name, dotVxDW ); if (!p) lstrcatW( name, dotVxDW );
else if (strcmpiW( p, dotVxDW )) /* existing extension has to be .vxd */ else if (wcsicmp( p, dotVxDW )) /* existing extension has to be .vxd */
{ {
SetLastError( ERROR_FILE_NOT_FOUND ); SetLastError( ERROR_FILE_NOT_FOUND );
return 0; return 0;

View File

@ -18,10 +18,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#include "config.h"
#include "wine/port.h"
#include <assert.h>
#include <stdarg.h> #include <stdarg.h>
#include <errno.h> #include <errno.h>
@ -424,8 +420,6 @@ BOOL WINAPI K32WOWCallback16Ex( DWORD vpfn16, DWORD dwFlags,
SYSLEVEL_CheckNotLevel( 2 ); SYSLEVEL_CheckNotLevel( 2 );
} }
assert( !(context->EFlags & 0x00020000) ); /* vm86 mode no longer supported */
/* push return address */ /* push return address */
if (dwFlags & WCB16_REGS_LONG) if (dwFlags & WCB16_REGS_LONG)
{ {