Commit 8a169390 authored by Alexandre Julliard's avatar Alexandre Julliard

ntdll: Build with msvcrt.

parent f89f7a54
......@@ -3901,7 +3901,7 @@ static void test_wow64_redirection(void)
ok(pWow64RevertWow64FsRedirection(OldValue), "Re-enabling FS redirection failed\n");
}
static void test_dll_file( const char *name )
static void test_dll_file( const char *name, BOOL is_todo )
{
HMODULE module = GetModuleHandleA( name );
IMAGE_NT_HEADERS *nt, *nt_file;
......@@ -3926,27 +3926,29 @@ static void test_dll_file( const char *name )
nt_file = pRtlImageNtHeader( ptr );
ok( nt_file != NULL, "%s: invalid header\n", path );
#define OK_FIELD(x) ok( nt->x == nt_file->x, "%s:%u: wrong " #x " %x / %x\n", name, i, nt->x, nt_file->x )
todo_wine
todo_wine_if(is_todo)
OK_FIELD( FileHeader.NumberOfSections );
todo_wine
todo_wine_if(is_todo)
OK_FIELD( OptionalHeader.AddressOfEntryPoint );
OK_FIELD( OptionalHeader.NumberOfRvaAndSizes );
for (i = 0; i < nt->OptionalHeader.NumberOfRvaAndSizes; i++)
{
todo_wine_if( i == IMAGE_DIRECTORY_ENTRY_EXPORT ||
todo_wine_if( is_todo &&
(i == IMAGE_DIRECTORY_ENTRY_EXPORT ||
(i == IMAGE_DIRECTORY_ENTRY_IMPORT && nt->OptionalHeader.DataDirectory[i].Size) ||
i == IMAGE_DIRECTORY_ENTRY_RESOURCE ||
i == IMAGE_DIRECTORY_ENTRY_BASERELOC )
i == IMAGE_DIRECTORY_ENTRY_BASERELOC ))
OK_FIELD( OptionalHeader.DataDirectory[i].VirtualAddress );
todo_wine_if( i == IMAGE_DIRECTORY_ENTRY_EXPORT ||
todo_wine_if( is_todo &&
(i == IMAGE_DIRECTORY_ENTRY_EXPORT ||
(i == IMAGE_DIRECTORY_ENTRY_IMPORT && nt->OptionalHeader.DataDirectory[i].Size) ||
i == IMAGE_DIRECTORY_ENTRY_BASERELOC )
i == IMAGE_DIRECTORY_ENTRY_BASERELOC ))
OK_FIELD( OptionalHeader.DataDirectory[i].Size );
}
sec = (IMAGE_SECTION_HEADER *)((char *)&nt->OptionalHeader + nt->FileHeader.SizeOfOptionalHeader);
sec_file = (IMAGE_SECTION_HEADER *)((char *)&nt_file->OptionalHeader + nt_file->FileHeader.SizeOfOptionalHeader);
for (i = 0; i < nt->FileHeader.NumberOfSections; i++)
todo_wine
todo_wine_if(is_todo)
ok( !memcmp( sec + i, sec_file + i, sizeof(*sec) ), "%s: wrong section %d\n", name, i );
UnmapViewOfFile( ptr );
#undef OK_FIELD
......@@ -4040,10 +4042,10 @@ START_TEST(loader)
test_InMemoryOrderModuleList();
test_LoadPackagedLibrary();
test_wow64_redirection();
test_dll_file( "ntdll.dll" );
test_dll_file( "kernel32.dll" );
test_dll_file( "advapi32.dll" );
test_dll_file( "user32.dll" );
test_dll_file( "ntdll.dll", FALSE );
test_dll_file( "kernel32.dll", TRUE );
test_dll_file( "advapi32.dll", TRUE );
test_dll_file( "user32.dll", TRUE );
/* loader test must be last, it can corrupt the internal loader state on Windows */
test_Loader();
}
EXTRADEFS = -D_NTSYSTEM_
EXTRADEFS = -D_NTSYSTEM_ -D_ACRTIMP=
MODULE = ntdll.dll
IMPORTLIB = ntdll
IMPORTS = winecrt0
EXTRAINCL = $(UNWIND_CFLAGS)
EXTRALIBS = -lwine $(IOKIT_LIBS) $(COREFOUNDATION_LIBS) $(CORESERVICES_LIBS) $(RT_LIBS) $(PTHREAD_LIBS) $(UNWIND_LIBS) $(I386_LIBS)
EXTRADLLFLAGS = -nodefaultlibs -Wl,--image-base,0x7bc00000
EXTRADLLFLAGS = -mno-cygwin -nodefaultlibs -Wl,--image-base,0x7bc00000
C_SRCS = \
actctx.c \
......
......@@ -22,9 +22,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "config.h"
#include "wine/port.h"
#include <stdarg.h>
#include <stdio.h>
......
......@@ -19,9 +19,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "config.h"
#include "wine/port.h"
#include <stdlib.h>
#include <stdarg.h>
#include <stdio.h>
......
......@@ -18,9 +18,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "config.h"
#include "wine/port.h"
#include <assert.h>
#include <errno.h>
#include <stdarg.h>
......
......@@ -18,9 +18,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "config.h"
#include "wine/port.h"
#include <stdarg.h>
#include <stdlib.h>
#include <string.h>
......
......@@ -20,9 +20,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "config.h"
#include "wine/port.h"
#include <assert.h>
#include <sys/types.h>
#include <fcntl.h>
......
......@@ -18,21 +18,10 @@
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "config.h"
#include <assert.h>
#include <errno.h>
#include <stdarg.h>
#include <sys/types.h>
#ifdef HAVE_SYS_STAT_H
# include <sys/stat.h>
#endif
#ifdef HAVE_PWD_H
# include <pwd.h>
#endif
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
#include "ntstatus.h"
#define WIN32_NO_STATUS
......
......@@ -20,8 +20,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "config.h"
#include "wine/port.h"
#include <stdarg.h>
#include "ntstatus.h"
......
......@@ -19,9 +19,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "config.h"
#include "wine/port.h"
#include <assert.h>
#include <errno.h>
#include <signal.h>
......@@ -581,6 +578,17 @@ PRUNTIME_FUNCTION WINAPI RtlLookupFunctionEntry( ULONG_PTR pc, ULONG_PTR *base,
#endif /* __x86_64__ || __arm__ || __aarch64__ */
/*************************************************************
* _assert
*/
void __cdecl _assert( const char *str, const char *file, unsigned int line )
{
ERR( "%s:%u: Assertion failed %s\n", file, line, debugstr_a(str) );
RtlRaiseStatus( EXCEPTION_WINE_ASSERTION );
}
/*************************************************************
* __wine_spec_unimplemented_stub
*
......
......@@ -16,9 +16,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "config.h"
#include "wine/port.h"
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
......
......@@ -19,19 +19,13 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "config.h"
#include "wine/port.h"
#include <assert.h>
#include <stdlib.h>
#include <stdarg.h>
#include <stdio.h>
#include <string.h>
#ifdef HAVE_VALGRIND_MEMCHECK_H
#include <valgrind/memcheck.h>
#else
#define RUNNING_ON_VALGRIND 0
#endif
#define RUNNING_ON_VALGRIND 0 /* FIXME */
#include "ntstatus.h"
#define WIN32_NO_STATUS
......
......@@ -19,9 +19,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "config.h"
#include "wine/port.h"
#include <stdarg.h>
#include "ntstatus.h"
......@@ -547,11 +544,11 @@ NTSTATUS WINAPI RtlInt64ToUnicodeString(
/* those builtin functions use stdcall calling convention, but compilers reference them without stdcall declarations */
#if defined(__MINGW32__) || defined(_MSC_VER)
LONGLONG WINAPI _alldiv( LONGLONG a, LONGLONG b ) asm("_alldiv");
LONGLONG WINAPI _allmul( LONGLONG a, LONGLONG b ) asm("_allmul");
LONGLONG WINAPI _allrem( LONGLONG a, LONGLONG b ) asm("_allrem");
ULONGLONG WINAPI _aulldiv( ULONGLONG a, ULONGLONG b ) asm("_aulldiv");
ULONGLONG WINAPI _aullrem( ULONGLONG a, ULONGLONG b ) asm("_aullrem");
LONGLONG WINAPI _alldiv( LONGLONG a, LONGLONG b ) asm(__ASM_NAME("_alldiv"));
LONGLONG WINAPI _allmul( LONGLONG a, LONGLONG b ) asm(__ASM_NAME("_allmul"));
LONGLONG WINAPI _allrem( LONGLONG a, LONGLONG b ) asm(__ASM_NAME("_allrem"));
ULONGLONG WINAPI _aulldiv( ULONGLONG a, ULONGLONG b ) asm(__ASM_NAME("_aulldiv"));
ULONGLONG WINAPI _aullrem( ULONGLONG a, ULONGLONG b ) asm(__ASM_NAME("_aullrem"));
#endif
static ULONGLONG udivmod(ULONGLONG a, ULONGLONG b, ULONGLONG *rem)
......
......@@ -19,9 +19,6 @@
* 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>
......@@ -1005,9 +1002,8 @@ static SHORT alloc_tls_slot( LDR_DATA_TABLE_ENTRY *mod )
if (!new) return -1;
if (old) memcpy( new, old, tls_module_count * sizeof(*new) );
teb->ThreadLocalStoragePointer = new;
#if defined(__APPLE__) && defined(__x86_64__)
if (teb->Reserved5[0])
((TEB*)teb->Reserved5[0])->ThreadLocalStoragePointer = new;
#ifdef __x86_64__ /* macOS-specific hack */
if (teb->Reserved5[0]) ((TEB *)teb->Reserved5[0])->ThreadLocalStoragePointer = new;
#endif
TRACE( "thread %04lx tls block %p -> %p\n", (ULONG_PTR)teb->ClientId.UniqueThread, old, new );
/* FIXME: can't free old block here, should be freed at thread exit */
......@@ -1251,10 +1247,9 @@ static NTSTATUS alloc_thread_tls(void)
GetCurrentThreadId(), i, size, dir->SizeOfZeroFill, pointers[i] );
}
NtCurrentTeb()->ThreadLocalStoragePointer = pointers;
#if defined(__APPLE__) && defined(__x86_64__)
__asm__ volatile (".byte 0x65\n\tmovq %0,%c1"
:
: "r" (pointers), "n" (FIELD_OFFSET(TEB, ThreadLocalStoragePointer)));
#ifdef __x86_64__ /* macOS-specific hack */
if (NtCurrentTeb()->Reserved5[0])
((TEB *)NtCurrentTeb()->Reserved5[0])->ThreadLocalStoragePointer = pointers;
#endif
return STATUS_SUCCESS;
}
......
......@@ -19,9 +19,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "config.h"
#include "wine/port.h"
#include <stdarg.h>
#include <stdlib.h>
#include <string.h>
......@@ -64,7 +61,7 @@ static struct loadorder_list env_list;
* Sorting and comparing function used in sort and search of loadorder
* entries.
*/
static int cmp_sort_func(const void *s1, const void *s2)
static int __cdecl cmp_sort_func(const void *s1, const void *s2)
{
return wcsicmp(((const module_loadorder_t *)s1)->modulename, ((const module_loadorder_t *)s2)->modulename);
}
......
......@@ -19,8 +19,6 @@
*/
#define NONAMELESSUNION
#include "config.h"
#include "wine/port.h"
#include <stdarg.h>
#include <string.h>
......@@ -723,11 +721,6 @@ void init_locale( HMODULE module )
WCHAR user_locale[LOCALE_NAME_MAX_LENGTH];
LCID system_lcid, user_lcid;
#ifdef __APPLE__
const struct norm_table *info;
load_norm_table( NormalizationC, &info );
#endif
kernel32_handle = module;
unix_funcs->get_locales( system_locale, user_locale );
......@@ -754,13 +747,7 @@ DWORD ntdll_umbstowcs( const char *src, DWORD srclen, WCHAR *dst, DWORD dstlen )
RtlCustomCPToUnicodeN( &unix_table, dst, dstlen * sizeof(WCHAR), &reslen, src, srclen );
else
RtlUTF8ToUnicodeN( dst, dstlen * sizeof(WCHAR), &reslen, src, srclen );
reslen /= sizeof(WCHAR);
#ifdef __APPLE__ /* work around broken Mac OS X filesystem that enforces decomposed Unicode */
if (reslen && dst && norm_tables[NormalizationC])
reslen = compose_string( norm_tables[NormalizationC], dst, reslen );
#endif
return reslen;
return reslen / sizeof(WCHAR);
}
......
......@@ -19,8 +19,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "config.h"
#include <time.h>
#include <math.h>
......@@ -257,8 +255,8 @@ NTDLL_mergesort( void *arr, void *barr, size_t elemsize, int(__cdecl *compar)(co
/*********************************************************************
* qsort (NTDLL.@)
*/
void __cdecl NTDLL_qsort( void *base, size_t nmemb, size_t size,
int(__cdecl *compar)(const void *, const void *) )
void __cdecl qsort( void *base, size_t nmemb, size_t size,
int (__cdecl *compar)(const void *, const void *) )
{
void *secondarr;
if (nmemb < 2 || size == 0) return;
......@@ -270,8 +268,7 @@ void __cdecl NTDLL_qsort( void *base, size_t nmemb, size_t size,
/*********************************************************************
* bsearch (NTDLL.@)
*/
void * __cdecl
NTDLL_bsearch( const void *key, const void *base, size_t nmemb,
void * __cdecl bsearch( const void *key, const void *base, size_t nmemb,
size_t size, int (__cdecl *compar)(const void *, const void *) )
{
ssize_t min = 0;
......
......@@ -21,9 +21,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "config.h"
#include "wine/port.h"
#include <string.h>
#include <stdarg.h>
#include <stdio.h>
......
......@@ -1470,7 +1470,7 @@
@ cdecl _ui64tow(int64 ptr long)
@ cdecl _ultoa(long ptr long)
@ cdecl _ultow(long ptr long)
@ cdecl -norelay _vsnprintf(ptr long str ptr) NTDLL__vsnprintf
@ cdecl -norelay _vsnprintf(ptr long str ptr)
@ cdecl _vsnprintf_s(ptr long str ptr)
@ cdecl _vsnwprintf(ptr long wstr ptr) NTDLL__vsnwprintf
@ cdecl _vsnwprintf_s(ptr long long wstr ptr)
......@@ -1486,7 +1486,7 @@
@ cdecl atan(double) NTDLL_atan
@ cdecl atoi(str) NTDLL_atoi
@ cdecl atol(str) NTDLL_atol
@ cdecl bsearch(ptr ptr long long ptr) NTDLL_bsearch
@ cdecl bsearch(ptr ptr long long ptr)
@ cdecl ceil(double) NTDLL_ceil
@ cdecl cos(double) NTDLL_cos
@ cdecl fabs(double) NTDLL_fabs
......@@ -1512,12 +1512,12 @@
@ cdecl log(double) NTDLL_log
@ cdecl mbstowcs(ptr str long) NTDLL_mbstowcs
@ cdecl memchr(ptr long long) NTDLL_memchr
@ cdecl memcmp(ptr ptr long) NTDLL_memcmp
@ cdecl memcpy(ptr ptr long) NTDLL_memcpy
@ cdecl memmove(ptr ptr long) NTDLL_memmove
@ cdecl memset(ptr long long) NTDLL_memset
@ cdecl memcmp(ptr ptr long)
@ cdecl memcpy(ptr ptr long)
@ cdecl memmove(ptr ptr long)
@ cdecl memset(ptr long long)
@ cdecl pow(double double) NTDLL_pow
@ cdecl qsort(ptr long long ptr) NTDLL_qsort
@ cdecl qsort(ptr long long ptr)
@ cdecl sin(double) NTDLL_sin
@ varargs sprintf(ptr str) NTDLL_sprintf
@ varargs sprintf_s(ptr long str)
......
......@@ -20,9 +20,7 @@
#define __WINE_NTDLL_MISC_H
#include <stdarg.h>
#include <signal.h>
#include <sys/types.h>
#include <pthread.h>
#include "windef.h"
#include "winnt.h"
......@@ -129,7 +127,6 @@ struct ntdll_thread_data
int reply_fd; /* fd for receiving server replies */
int wait_fd[2]; /* fd for sleeping server requests */
BOOL wow64_redir; /* Wow64 filesystem redirection flag */
pthread_t pthread_id; /* pthread thread id */
};
C_ASSERT( sizeof(struct ntdll_thread_data) <= sizeof(((TEB *)0)->GdiTebBatch) );
......@@ -162,7 +159,6 @@ LONG __cdecl NTDLL_strtol( const char *s, char **end, int base );
ULONG __cdecl NTDLL_strtoul( const char *s, char **end, int base );
int __cdecl NTDLL_atoi( const char *nptr );
int __cdecl NTDLL_tolower( int c );
int __cdecl _stricmp( LPCSTR str1, LPCSTR str2 );
int __cdecl NTDLL__wcsicmp( LPCWSTR str1, LPCWSTR str2 );
int __cdecl NTDLL__wcsnicmp( LPCWSTR str1, LPCWSTR str2, size_t n );
int __cdecl NTDLL_wcscmp( LPCWSTR str1, LPCWSTR str2 );
......@@ -186,7 +182,6 @@ LPWSTR __cdecl NTDLL_wcstok( LPWSTR str, LPCWSTR delim );
LONG __cdecl NTDLL_wcstol( LPCWSTR s, LPWSTR *end, INT base );
ULONG __cdecl NTDLL_wcstoul( LPCWSTR s, LPWSTR *end, INT base );
int WINAPIV NTDLL_swprintf( WCHAR *str, const WCHAR *format, ... );
int WINAPIV _snwprintf_s( WCHAR *str, SIZE_T size, SIZE_T len, const WCHAR *format, ... );
#define memchr(p,c,n) NTDLL_memchr(p,c,n)
#define strcat(d,s) NTDLL_strcat(d,s)
......
......@@ -19,14 +19,9 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "config.h"
#include <stdarg.h>
#include <stdlib.h>
#include <string.h>
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
#include "ntstatus.h"
#define WIN32_NO_STATUS
......
......@@ -19,9 +19,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "config.h"
#include "wine/port.h"
#include <stdarg.h>
#include <sys/types.h>
......@@ -30,7 +27,6 @@
#include "windef.h"
#include "winioctl.h"
#include "wine/debug.h"
#include "wine/library.h"
#include "ntdll_misc.h"
WINE_DEFAULT_DEBUG_CHANNEL(file);
......
......@@ -19,9 +19,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "config.h"
#include "wine/port.h"
#include <assert.h>
#include <ctype.h>
#include <stdarg.h>
......@@ -593,7 +590,7 @@ static int pf_vsnprintf( pf_output *out, const WCHAR *format, __ms_va_list valis
/*********************************************************************
* _vsnprintf (NTDLL.@)
*/
int CDECL NTDLL__vsnprintf( char *str, SIZE_T len, const char *format, __ms_va_list args )
int CDECL _vsnprintf( char *str, size_t len, const char *format, __ms_va_list args )
{
DWORD sz;
LPWSTR formatW = NULL;
......@@ -646,7 +643,7 @@ int WINAPIV NTDLL__snprintf( char *str, SIZE_T len, const char *format, ... )
__ms_va_list valist;
__ms_va_start( valist, format );
ret = NTDLL__vsnprintf( str, len, format, valist );
ret = _vsnprintf( str, len, format, valist );
__ms_va_end( valist );
return ret;
}
......@@ -670,7 +667,7 @@ int WINAPIV NTDLL__snwprintf( WCHAR *str, SIZE_T len, const WCHAR *format, ... )
/*********************************************************************
* _vsnprintf_s (NTDLL.@)
*/
int CDECL _vsnprintf_s( char *str, SIZE_T size, SIZE_T len, const char *format, __ms_va_list args )
int CDECL _vsnprintf_s( char *str, size_t size, size_t len, const char *format, __ms_va_list args )
{
DWORD sz;
LPWSTR formatW = NULL;
......@@ -700,7 +697,7 @@ int CDECL _vsnprintf_s( char *str, SIZE_T size, SIZE_T len, const char *format,
/***********************************************************************
* _vsnwprintf_s (NTDLL.@)
*/
int CDECL _vsnwprintf_s( WCHAR *str, SIZE_T size, SIZE_T len, const WCHAR *format, __ms_va_list args )
int CDECL _vsnwprintf_s( WCHAR *str, size_t size, size_t len, const WCHAR *format, __ms_va_list args )
{
pf_output out;
int r;
......@@ -721,7 +718,7 @@ int CDECL _vsnwprintf_s( WCHAR *str, SIZE_T size, SIZE_T len, const WCHAR *forma
/*********************************************************************
* _snprintf_s (NTDLL.@)
*/
int WINAPIV _snprintf_s( char *str, SIZE_T size, SIZE_T len, const char *format, ... )
int WINAPIV _snprintf_s( char *str, size_t size, size_t len, const char *format, ... )
{
int ret;
__ms_va_list valist;
......@@ -736,7 +733,7 @@ int WINAPIV _snprintf_s( char *str, SIZE_T size, SIZE_T len, const char *format,
/*********************************************************************
* _snwprintf_s (NTDLL.@)
*/
int WINAPIV _snwprintf_s( WCHAR *str, SIZE_T size, SIZE_T len, const WCHAR *format, ... )
int WINAPIV _snwprintf_s( WCHAR *str, size_t size, size_t len, const WCHAR *format, ... )
{
int ret;
__ms_va_list valist;
......@@ -753,14 +750,14 @@ int WINAPIV _snwprintf_s( WCHAR *str, SIZE_T size, SIZE_T len, const WCHAR *form
*/
int CDECL NTDLL_vsprintf( char *str, const char *format, __ms_va_list args )
{
return NTDLL__vsnprintf( str, size_max, format, args );
return _vsnprintf( str, size_max, format, args );
}
/*********************************************************************
* vsprintf_s (NTDLL.@)
*/
int CDECL vsprintf_s( char *str, SIZE_T size, const char *format, __ms_va_list args )
int CDECL vsprintf_s( char *str, size_t size, const char *format, __ms_va_list args )
{
return _vsnprintf_s( str, size, size, format, args );
}
......@@ -778,7 +775,7 @@ int CDECL NTDLL__vswprintf( WCHAR *str, const WCHAR *format, __ms_va_list args )
/*********************************************************************
* vswprintf_s (NTDLL.@)
*/
int CDECL vswprintf_s( WCHAR *str, SIZE_T size, const WCHAR *format, __ms_va_list args )
int CDECL vswprintf_s( WCHAR *str, size_t size, const WCHAR *format, __ms_va_list args )
{
return _vsnwprintf_s( str, size, size, format, args );
}
......@@ -793,7 +790,7 @@ int WINAPIV NTDLL_sprintf( char *str, const char *format, ... )
__ms_va_list valist;
__ms_va_start( valist, format );
ret = NTDLL__vsnprintf( str, size_max, format, valist );
ret = _vsnprintf( str, size_max, format, valist );
__ms_va_end( valist );
return ret;
}
......@@ -802,7 +799,7 @@ int WINAPIV NTDLL_sprintf( char *str, const char *format, ... )
/*********************************************************************
* sprintf_s (NTDLL.@)
*/
int WINAPIV sprintf_s( char *str, SIZE_T size, const char *format, ... )
int WINAPIV sprintf_s( char *str, size_t size, const char *format, ... )
{
int ret;
__ms_va_list valist;
......@@ -832,7 +829,7 @@ int WINAPIV NTDLL_swprintf( WCHAR *str, const WCHAR *format, ... )
/***********************************************************************
* swprintf_s (NTDLL.@)
*/
int WINAPIV swprintf_s( WCHAR *str, SIZE_T size, const WCHAR *format, ... )
int WINAPIV swprintf_s( WCHAR *str, size_t size, const WCHAR *format, ... )
{
int ret;
__ms_va_list valist;
......
......@@ -19,9 +19,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "config.h"
#include "wine/port.h"
#include <errno.h>
#include <fcntl.h>
#include <stdarg.h>
......
......@@ -26,16 +26,12 @@
* HKEY_CLASSES \\REGISTRY\\MACHINE\\SOFTWARE\\CLASSES
*/
#include "config.h"
#include "wine/port.h"
#include <stdarg.h>
#include <stdio.h>
#include <string.h>
#include "ntstatus.h"
#define WIN32_NO_STATUS
#include "wine/library.h"
#include "ntdll_misc.h"
#include "wine/debug.h"
......
......@@ -19,9 +19,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "config.h"
#include "wine/port.h"
#include <assert.h>
#include <string.h>
#include <stdarg.h>
......
......@@ -25,9 +25,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "config.h"
#include "wine/port.h"
#include <stdarg.h>
#include <stdlib.h>
#include <sys/types.h>
......
......@@ -23,27 +23,18 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "config.h"
#include "wine/port.h"
#include <stdlib.h>
#include <stdarg.h>
#include <stdio.h>
#include <string.h>
#ifdef HAVE_NETINET_IN_H
#include <netinet/in.h>
#endif
#include "ntstatus.h"
#define NONAMELESSUNION
#define NONAMELESSSTRUCT
#define WIN32_NO_STATUS
#define USE_WS_PREFIX
#include "winsock2.h"
#include "windef.h"
#include "winternl.h"
#include "wine/debug.h"
#include "wine/exception.h"
#include "ntdll_misc.h"
#include "inaddr.h"
#include "in6addr.h"
#include "ddk/ntddk.h"
......@@ -333,7 +324,7 @@ NTSTATUS WINAPIV DbgPrint(LPCSTR fmt, ...)
__ms_va_list args;
__ms_va_start(args, fmt);
NTDLL__vsnprintf(buf, sizeof(buf), fmt, args);
_vsnprintf(buf, sizeof(buf), fmt, args);
__ms_va_end(args);
MESSAGE("DbgPrint says: %s",buf);
......@@ -371,7 +362,7 @@ NTSTATUS WINAPI vDbgPrintExWithPrefix( LPCSTR prefix, ULONG id, ULONG level, LPC
{
char buf[1024];
NTDLL__vsnprintf(buf, sizeof(buf), fmt, args);
_vsnprintf(buf, sizeof(buf), fmt, args);
switch (level & DPFLTR_MASK)
{
......
......@@ -662,7 +662,7 @@ CCHAR WINAPI RtlFindLeastSignificantBit(ULONGLONG ulLong)
*
* Internal helper: qsort comparison function for RTL_BITMAP_RUN arrays
*/
static int NTDLL_RunSortFn(const void *lhs, const void *rhs)
static int __cdecl NTDLL_RunSortFn(const void *lhs, const void *rhs)
{
if (((const RTL_BITMAP_RUN*)lhs)->NumberOfBits > ((const RTL_BITMAP_RUN*)rhs)->NumberOfBits)
return -1;
......
......@@ -20,8 +20,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "config.h"
#include <assert.h>
#include <stdarg.h>
#include <stdlib.h>
......
......@@ -19,25 +19,18 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "config.h"
#include "wine/port.h"
#include <stdarg.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <ctype.h>
#include <math.h>
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
#include "ntstatus.h"
#define WIN32_NO_STATUS
#include "windef.h"
#include "ntdll_misc.h"
#include "wine/exception.h"
#include "wine/library.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(ntdll);
......
......@@ -18,9 +18,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "config.h"
#include "wine/port.h"
#include <assert.h>
#include <ctype.h>
#include <stdarg.h>
......
......@@ -21,9 +21,6 @@
#ifdef __arm__
#include "config.h"
#include "wine/port.h"
#include <stdlib.h>
#include <stdarg.h>
......
......@@ -20,17 +20,11 @@
#ifdef __aarch64__
#include "config.h"
#include "wine/port.h"
#include <assert.h>
#include <signal.h>
#include <stdlib.h>
#include <stdarg.h>
#include <stdio.h>
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
#define NONAMELESSUNION
#define NONAMELESSSTRUCT
......
......@@ -20,21 +20,12 @@
#ifdef __i386__
#include "config.h"
#include "wine/port.h"
#include <errno.h>
#include <signal.h>
#include <stdlib.h>
#include <stdarg.h>
#include <stdio.h>
#include <sys/types.h>
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
#ifdef HAVE_SYS_PARAM_H
# include <sys/param.h>
#endif
#include "ntstatus.h"
#define WIN32_NO_STATUS
......
......@@ -20,9 +20,6 @@
#ifdef __x86_64__
#include "config.h"
#include "wine/port.h"
#include <stdlib.h>
#include <stdarg.h>
......
......@@ -20,9 +20,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "config.h"
#include "wine/port.h"
#include <limits.h>
#include <stdarg.h>
#include <stdlib.h>
......@@ -83,7 +80,7 @@ void * __cdecl NTDLL_memchr( const void *ptr, int c, size_t n )
/*********************************************************************
* memcmp (NTDLL.@)
*/
int __cdecl NTDLL_memcmp( const void *ptr1, const void *ptr2, size_t n )
int __cdecl memcmp( const void *ptr1, const void *ptr2, size_t n )
{
const unsigned char *p1, *p2;
......@@ -102,7 +99,7 @@ int __cdecl NTDLL_memcmp( const void *ptr1, const void *ptr2, size_t n )
* NOTES
* Behaves like memmove.
*/
void * __cdecl NTDLL_memcpy( void *dst, const void *src, size_t n )
void * __cdecl memcpy( void *dst, const void *src, size_t n )
{
volatile unsigned char *d = dst; /* avoid gcc optimizations */
const unsigned char *s = src;
......@@ -124,7 +121,7 @@ void * __cdecl NTDLL_memcpy( void *dst, const void *src, size_t n )
/*********************************************************************
* memmove (NTDLL.@)
*/
void * __cdecl NTDLL_memmove( void *dst, const void *src, size_t n )
void * __cdecl memmove( void *dst, const void *src, size_t n )
{
volatile unsigned char *d = dst; /* avoid gcc optimizations */
const unsigned char *s = src;
......@@ -146,7 +143,7 @@ void * __cdecl NTDLL_memmove( void *dst, const void *src, size_t n )
/*********************************************************************
* memset (NTDLL.@)
*/
void * __cdecl NTDLL_memset( void *dst, int c, size_t n )
void * __cdecl memset( void *dst, int c, size_t n )
{
volatile unsigned char *d = dst; /* avoid gcc optimizations */
while (n--) *d++ = c;
......@@ -729,10 +726,7 @@ ULONG __cdecl NTDLL_strtoul( const char *s, char **end, int base )
* - Does not check if radix is in the range of 2 to 36.
* - If str is NULL it crashes, as the native function does.
*/
char * __cdecl _ultoa(
ULONG value, /* [I] Value to be converted */
char *str, /* [O] Destination for the converted value */
int radix) /* [I] Number base for conversion */
char * __cdecl _ultoa( __msvcrt_ulong value, char *str, int radix )
{
char buffer[33];
char *pos;
......@@ -771,10 +765,7 @@ char * __cdecl _ultoa(
* - Does not check if radix is in the range of 2 to 36.
* - If str is NULL it crashes, as the native function does.
*/
char * __cdecl _ltoa(
LONG value, /* [I] Value to be converted */
char *str, /* [O] Destination for the converted value */
int radix) /* [I] Number base for conversion */
char * __cdecl _ltoa( __msvcrt_long value, char *str, int radix )
{
ULONG val;
int negative;
......
......@@ -21,9 +21,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "config.h"
#include "wine/port.h"
#include <limits.h>
#include <string.h>
#include <stdarg.h>
......
......@@ -18,9 +18,6 @@
* 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 <limits.h>
......
......@@ -19,9 +19,6 @@
* 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 <limits.h>
......
......@@ -23,18 +23,12 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "config.h"
#include "wine/port.h"
#include <stdarg.h>
#include <stdlib.h>
#include <errno.h>
#include <string.h>
#include <limits.h>
#include <time.h>
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
#include "ntstatus.h"
#define WIN32_NO_STATUS
......
......@@ -1558,7 +1558,6 @@ static void start_main_thread(void)
server_init_process();
startup_info_size = server_init_thread( teb->Peb, &suspend );
virtual_map_user_shared_data();
virtual_create_builtin_view( ntdll_module );
init_cpu_info();
init_files();
NtCreateKeyedEvent( &keyed_event, GENERIC_READ | GENERIC_WRITE, NULL, 0 );
......
......@@ -21,9 +21,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "config.h"
#include "wine/port.h"
#include <string.h>
#include <stdlib.h>
#include <stdarg.h>
......
......@@ -18,15 +18,8 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "config.h"
#include "wine/port.h"
#include <assert.h>
#include <errno.h>
#include <fcntl.h>
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
#include <stdarg.h>
#include <stdlib.h>
#include <stdio.h>
......
......@@ -20,8 +20,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "config.h"
#include <ctype.h>
#include <stdlib.h>
#include <string.h>
......@@ -573,10 +571,7 @@ ULONG __cdecl NTDLL_wcstoul(LPCWSTR s, LPWSTR *end, INT base)
* Does not check if radix is in the range of 2 to 36.
* If str is NULL it just returns NULL.
*/
LPWSTR __cdecl _ultow(
ULONG value, /* [I] Value to be converted */
LPWSTR str, /* [O] Destination for the converted value */
INT radix) /* [I] Number base for conversion */
LPWSTR __cdecl _ultow( __msvcrt_ulong value, LPWSTR str, INT radix )
{
WCHAR buffer[33];
PWCHAR pos;
......@@ -617,10 +612,7 @@ LPWSTR __cdecl _ultow(
* Does not check if radix is in the range of 2 to 36.
* If str is NULL it just returns NULL.
*/
LPWSTR __cdecl _ltow(
LONG value, /* [I] Value to be converted */
LPWSTR str, /* [O] Destination for the converted value */
INT radix) /* [I] Number base for conversion */
LPWSTR __cdecl _ltow( __msvcrt_long value, LPWSTR str, INT radix )
{
ULONG val;
int negative;
......@@ -819,7 +811,7 @@ LPWSTR __cdecl _i64tow(
* No check is made for value overflow, only the lower 32 bits are assigned.
* If str is NULL it crashes, as the native function does.
*/
LONG __cdecl _wtol( LPCWSTR str )
__msvcrt_long __cdecl _wtol( LPCWSTR str )
{
ULONG RunningTotal = 0;
BOOL bMinus = FALSE;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment