ntoskrnl: Make the standard C functions available for importing.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alexandre Julliard 2019-06-17 09:25:06 +02:00
parent 450f0fa696
commit 7cee5e2bdc
2 changed files with 92 additions and 115 deletions

View File

@ -1426,94 +1426,94 @@
@ cdecl -private -arch=i386 _CIsin() msvcrt._CIsin @ cdecl -private -arch=i386 _CIsin() msvcrt._CIsin
@ cdecl -private -arch=i386 _CIsqrt() msvcrt._CIsqrt @ cdecl -private -arch=i386 _CIsqrt() msvcrt._CIsqrt
@ cdecl -private _abnormal_termination() msvcrt._abnormal_termination @ cdecl -private _abnormal_termination() msvcrt._abnormal_termination
@ stdcall -private -arch=i386 -ret64 _alldiv(int64 int64) @ stdcall -arch=i386 -ret64 _alldiv(int64 int64)
@ stdcall -private -arch=i386 -norelay _alldvrm(int64 int64) @ stdcall -arch=i386 -norelay _alldvrm(int64 int64)
@ stdcall -private -arch=i386 -ret64 _allmul(int64 int64) @ stdcall -arch=i386 -ret64 _allmul(int64 int64)
@ stdcall -private -arch=i386 -norelay _alloca_probe() @ stdcall -arch=i386 -norelay _alloca_probe()
@ stdcall -private -arch=i386 -ret64 _allrem(int64 int64) @ stdcall -arch=i386 -ret64 _allrem(int64 int64)
@ stdcall -private -arch=i386 -ret64 _allshl(int64 long) @ stdcall -arch=i386 -ret64 _allshl(int64 long)
@ stdcall -private -arch=i386 -ret64 _allshr(int64 long) @ stdcall -arch=i386 -ret64 _allshr(int64 long)
@ stdcall -private -arch=i386 -ret64 _aulldiv(int64 int64) @ stdcall -arch=i386 -ret64 _aulldiv(int64 int64)
@ stdcall -private -arch=i386 -norelay _aulldvrm(int64 int64) @ stdcall -arch=i386 -norelay _aulldvrm(int64 int64)
@ stdcall -private -arch=i386 -ret64 _aullrem(int64 int64) @ stdcall -arch=i386 -ret64 _aullrem(int64 int64)
@ stdcall -private -arch=i386 -ret64 _aullshr(int64 long) @ stdcall -arch=i386 -ret64 _aullshr(int64 long)
@ stdcall -private -arch=i386 -norelay _chkstk() @ stdcall -arch=i386 -norelay _chkstk()
@ cdecl -private -arch=i386 _except_handler2(ptr ptr ptr ptr) msvcrt._except_handler2 @ cdecl -arch=i386 _except_handler2(ptr ptr ptr ptr) msvcrt._except_handler2
@ cdecl -private -arch=i386 _except_handler3(ptr ptr ptr ptr) msvcrt._except_handler3 @ cdecl -arch=i386 _except_handler3(ptr ptr ptr ptr) msvcrt._except_handler3
@ cdecl -private -arch=i386 _global_unwind2(ptr) msvcrt._global_unwind2 @ cdecl -arch=i386 _global_unwind2(ptr) msvcrt._global_unwind2
@ cdecl -private _itoa(long ptr long) msvcrt._itoa @ cdecl _itoa(long ptr long) msvcrt._itoa
@ cdecl -private _itow(long ptr long) msvcrt._itow @ cdecl _itow(long ptr long) msvcrt._itow
@ cdecl -private -arch=x86_64 _local_unwind(ptr ptr) msvcrt._local_unwind @ cdecl -arch=x86_64 _local_unwind(ptr ptr) msvcrt._local_unwind
@ cdecl -private -arch=i386 _local_unwind2(ptr long) msvcrt._local_unwind2 @ cdecl -arch=i386 _local_unwind2(ptr long) msvcrt._local_unwind2
@ cdecl -private _purecall() msvcrt._purecall @ cdecl _purecall() msvcrt._purecall
@ varargs -private _snprintf(ptr long str) msvcrt._snprintf @ varargs _snprintf(ptr long str) msvcrt._snprintf
@ varargs -private _snwprintf(ptr long wstr) msvcrt._snwprintf @ varargs _snwprintf(ptr long wstr) msvcrt._snwprintf
@ cdecl -private _stricmp(str str) NTOSKRNL__stricmp @ cdecl _stricmp(str str) NTOSKRNL__stricmp
@ cdecl -private _strlwr(str) msvcrt._strlwr @ cdecl _strlwr(str) msvcrt._strlwr
@ cdecl -private _strnicmp(str str long) NTOSKRNL__strnicmp @ cdecl _strnicmp(str str long) NTOSKRNL__strnicmp
@ cdecl -private _strnset(str long long) msvcrt._strnset @ cdecl _strnset(str long long) msvcrt._strnset
@ cdecl -private _strrev(str) msvcrt._strrev @ cdecl _strrev(str) msvcrt._strrev
@ cdecl -private _strset(str long) msvcrt._strset @ cdecl _strset(str long) msvcrt._strset
@ cdecl -private _strupr(str) msvcrt._strupr @ cdecl _strupr(str) msvcrt._strupr
@ cdecl _vsnprintf(ptr long str ptr) msvcrt._vsnprintf @ cdecl _vsnprintf(ptr long str ptr) msvcrt._vsnprintf
@ cdecl -private _vsnwprintf(ptr long wstr ptr) msvcrt._vsnwprintf @ cdecl _vsnwprintf(ptr long wstr ptr) msvcrt._vsnwprintf
@ cdecl -private _wcsicmp(wstr wstr) msvcrt._wcsicmp @ cdecl _wcsicmp(wstr wstr) msvcrt._wcsicmp
@ cdecl -private _wcslwr(wstr) msvcrt._wcslwr @ cdecl _wcslwr(wstr) msvcrt._wcslwr
@ cdecl -private _wcsnicmp(wstr wstr long) NTOSKRNL__wcsnicmp @ cdecl _wcsnicmp(wstr wstr long) NTOSKRNL__wcsnicmp
@ cdecl -private _wcsnset(wstr long long) msvcrt._wcsnset @ cdecl _wcsnset(wstr long long) msvcrt._wcsnset
@ cdecl -private _wcsrev(wstr) msvcrt._wcsrev @ cdecl _wcsrev(wstr) msvcrt._wcsrev
@ cdecl -private _wcsupr(wstr) msvcrt._wcsupr @ cdecl _wcsupr(wstr) msvcrt._wcsupr
@ cdecl -private atoi(str) msvcrt.atoi @ cdecl atoi(str) msvcrt.atoi
@ cdecl -private atol(str) msvcrt.atol @ cdecl atol(str) msvcrt.atol
@ cdecl -private isdigit(long) msvcrt.isdigit @ cdecl isdigit(long) msvcrt.isdigit
@ cdecl -private islower(long) msvcrt.islower @ cdecl islower(long) msvcrt.islower
@ cdecl -private isprint(long) msvcrt.isprint @ cdecl isprint(long) msvcrt.isprint
@ cdecl -private isspace(long) msvcrt.isspace @ cdecl isspace(long) msvcrt.isspace
@ cdecl -private isupper(long) msvcrt.isupper @ cdecl isupper(long) msvcrt.isupper
@ cdecl -private isxdigit(long) msvcrt.isxdigit @ cdecl isxdigit(long) msvcrt.isxdigit
@ cdecl -private mbstowcs(ptr str long) msvcrt.mbstowcs @ cdecl mbstowcs(ptr str long) msvcrt.mbstowcs
@ cdecl -private mbtowc(ptr str long) msvcrt.mbtowc @ cdecl mbtowc(ptr str long) msvcrt.mbtowc
@ cdecl -private memchr(ptr long long) msvcrt.memchr @ cdecl memchr(ptr long long) msvcrt.memchr
@ cdecl -private memcpy(ptr ptr long) NTOSKRNL_memcpy @ cdecl memcpy(ptr ptr long) NTOSKRNL_memcpy
@ cdecl -private memmove(ptr ptr long) msvcrt.memmove @ cdecl memmove(ptr ptr long) msvcrt.memmove
@ cdecl -private memset(ptr long long) NTOSKRNL_memset @ cdecl memset(ptr long long) NTOSKRNL_memset
@ cdecl -private qsort(ptr long long ptr) msvcrt.qsort @ cdecl qsort(ptr long long ptr) msvcrt.qsort
@ cdecl -private rand() msvcrt.rand @ cdecl rand() msvcrt.rand
@ varargs -private sprintf(ptr str) msvcrt.sprintf @ varargs sprintf(ptr str) msvcrt.sprintf
@ cdecl -private srand(long) msvcrt.srand @ cdecl srand(long) msvcrt.srand
@ cdecl -private strcat(str str) msvcrt.strcat @ cdecl strcat(str str) msvcrt.strcat
@ cdecl -private strchr(str long) msvcrt.strchr @ cdecl strchr(str long) msvcrt.strchr
@ cdecl -private strcmp(str str) msvcrt.strcmp @ cdecl strcmp(str str) msvcrt.strcmp
@ cdecl -private strcpy(ptr str) msvcrt.strcpy @ cdecl strcpy(ptr str) msvcrt.strcpy
@ cdecl -private strlen(str) msvcrt.strlen @ cdecl strlen(str) msvcrt.strlen
@ cdecl -private strncat(str str long) msvcrt.strncat @ cdecl strncat(str str long) msvcrt.strncat
@ cdecl -private strncmp(str str long) msvcrt.strncmp @ cdecl strncmp(str str long) msvcrt.strncmp
@ cdecl -private strncpy(ptr str long) msvcrt.strncpy @ cdecl strncpy(ptr str long) msvcrt.strncpy
@ cdecl -private strrchr(str long) msvcrt.strrchr @ cdecl strrchr(str long) msvcrt.strrchr
@ cdecl -private strspn(str str) msvcrt.strspn @ cdecl strspn(str str) msvcrt.strspn
@ cdecl -private strstr(str str) msvcrt.strstr @ cdecl strstr(str str) msvcrt.strstr
@ varargs -private swprintf(ptr wstr) msvcrt.swprintf @ varargs swprintf(ptr wstr) msvcrt.swprintf
@ cdecl -private tolower(long) msvcrt.tolower @ cdecl tolower(long) msvcrt.tolower
@ cdecl -private toupper(long) msvcrt.toupper @ cdecl toupper(long) msvcrt.toupper
@ cdecl -private towlower(long) msvcrt.towlower @ cdecl towlower(long) msvcrt.towlower
@ cdecl -private towupper(long) msvcrt.towupper @ cdecl towupper(long) msvcrt.towupper
@ stdcall vDbgPrintEx(long long str ptr) @ stdcall vDbgPrintEx(long long str ptr)
@ stdcall vDbgPrintExWithPrefix(str long long str ptr) @ stdcall vDbgPrintExWithPrefix(str long long str ptr)
@ cdecl -private vsprintf(ptr str ptr) msvcrt.vsprintf @ cdecl vsprintf(ptr str ptr) msvcrt.vsprintf
@ cdecl -private wcscat(wstr wstr) msvcrt.wcscat @ cdecl wcscat(wstr wstr) msvcrt.wcscat
@ cdecl -private wcschr(wstr long) msvcrt.wcschr @ cdecl wcschr(wstr long) msvcrt.wcschr
@ cdecl -private wcscmp(wstr wstr) msvcrt.wcscmp @ cdecl wcscmp(wstr wstr) msvcrt.wcscmp
@ cdecl -private wcscpy(ptr wstr) msvcrt.wcscpy @ cdecl wcscpy(ptr wstr) msvcrt.wcscpy
@ cdecl -private wcscspn(wstr wstr) msvcrt.wcscspn @ cdecl wcscspn(wstr wstr) msvcrt.wcscspn
@ cdecl -private wcslen(wstr) msvcrt.wcslen @ cdecl wcslen(wstr) msvcrt.wcslen
@ cdecl -private wcsncat(wstr wstr long) msvcrt.wcsncat @ cdecl wcsncat(wstr wstr long) msvcrt.wcsncat
@ cdecl -private wcsncmp(wstr wstr long) NTOSKRNL_wcsncmp @ cdecl wcsncmp(wstr wstr long) NTOSKRNL_wcsncmp
@ cdecl -private wcsncpy(ptr wstr long) msvcrt.wcsncpy @ cdecl wcsncpy(ptr wstr long) msvcrt.wcsncpy
@ cdecl -private wcsrchr(wstr long) msvcrt.wcsrchr @ cdecl wcsrchr(wstr long) msvcrt.wcsrchr
@ cdecl -private wcsspn(wstr wstr) msvcrt.wcsspn @ cdecl wcsspn(wstr wstr) msvcrt.wcsspn
@ cdecl -private wcsstr(wstr wstr) msvcrt.wcsstr @ cdecl wcsstr(wstr wstr) msvcrt.wcsstr
@ cdecl -private wcstombs(ptr ptr long) msvcrt.wcstombs @ cdecl wcstombs(ptr ptr long) msvcrt.wcstombs
@ cdecl -private wctomb(ptr long) msvcrt.wctomb @ cdecl wctomb(ptr long) msvcrt.wctomb
################################################################ ################################################################
# Wine internal extensions # Wine internal extensions

View File

@ -21,6 +21,7 @@
*/ */
#include <stdarg.h> #include <stdarg.h>
#include <stdio.h>
#include "ntstatus.h" #include "ntstatus.h"
#define WIN32_NO_STATUS #define WIN32_NO_STATUS
@ -63,13 +64,11 @@ void WINAPI ObfReferenceObject( void *obj );
NTSTATUS WINAPI ZwQueryInformationProcess(HANDLE,PROCESSINFOCLASS,void*,ULONG,ULONG*); NTSTATUS WINAPI ZwQueryInformationProcess(HANDLE,PROCESSINFOCLASS,void*,ULONG,ULONG*);
extern int CDECL _vsnprintf(char *str, size_t len, const char *format, __ms_va_list argptr);
static void kvprintf(const char *format, __ms_va_list ap) static void kvprintf(const char *format, __ms_va_list ap)
{ {
static char buffer[512]; static char buffer[512];
IO_STATUS_BLOCK io; IO_STATUS_BLOCK io;
int len = _vsnprintf(buffer, sizeof(buffer), format, ap); int len = vsnprintf(buffer, sizeof(buffer), format, ap);
ZwWriteFile(okfile, NULL, NULL, NULL, &io, buffer, len, NULL, NULL); ZwWriteFile(okfile, NULL, NULL, NULL, &io, buffer, len, NULL, NULL);
} }
@ -192,28 +191,6 @@ static int broken(int condition)
#define todo_wine_if(is_todo) todo_if((is_todo) && running_under_wine) #define todo_wine_if(is_todo) todo_if((is_todo) && running_under_wine)
#define win_skip(...) win_skip_(__FILE__, __LINE__, __VA_ARGS__) #define win_skip(...) win_skip_(__FILE__, __LINE__, __VA_ARGS__)
static unsigned int strlenW( const WCHAR *str )
{
const WCHAR *s = str;
while (*s) s++;
return s - str;
}
static void *kmemcpy(void *dest, const void *src, SIZE_T n)
{
const char *s = src;
char *d = dest;
while (n--) *d++ = *s++;
return dest;
}
static void *kmemset(void *dest, int c, SIZE_T n)
{
unsigned char *d = dest;
while (n--) *d++ = (unsigned char)c;
return dest;
}
static void *get_proc_address(const char *name) static void *get_proc_address(const char *name)
{ {
UNICODE_STRING name_u; UNICODE_STRING name_u;
@ -1041,10 +1018,10 @@ static void test_ob_reference(const WCHAR *test_path)
status = ZwCreateEvent(&event_handle, SYNCHRONIZE, &attr, NotificationEvent, TRUE); status = ZwCreateEvent(&event_handle, SYNCHRONIZE, &attr, NotificationEvent, TRUE);
ok(!status, "ZwCreateEvent failed: %#x\n", status); ok(!status, "ZwCreateEvent failed: %#x\n", status);
len = strlenW(test_path); len = wcslen(test_path);
tmp_path = ExAllocatePool(PagedPool, len * sizeof(WCHAR) + sizeof(tmpW)); tmp_path = ExAllocatePool(PagedPool, len * sizeof(WCHAR) + sizeof(tmpW));
kmemcpy(tmp_path, test_path, len * sizeof(WCHAR)); memcpy(tmp_path, test_path, len * sizeof(WCHAR));
kmemcpy(tmp_path + len, tmpW, sizeof(tmpW)); memcpy(tmp_path + len, tmpW, sizeof(tmpW));
RtlInitUnicodeString(&pathU, tmp_path); RtlInitUnicodeString(&pathU, tmp_path);
attr.ObjectName = &pathU; attr.ObjectName = &pathU;
@ -1226,7 +1203,7 @@ static void test_resource(void)
BOOLEAN ret; BOOLEAN ret;
HANDLE thread, thread2; HANDLE thread, thread2;
kmemset(&resource, 0xcc, sizeof(resource)); memset(&resource, 0xcc, sizeof(resource));
status = ExInitializeResourceLite(&resource); status = ExInitializeResourceLite(&resource);
ok(status == STATUS_SUCCESS, "got status %#x\n", status); ok(status == STATUS_SUCCESS, "got status %#x\n", status);
@ -1613,7 +1590,7 @@ static NTSTATUS test_basic_ioctl(IRP *irp, IO_STACK_LOCATION *stack, ULONG_PTR *
if (length < sizeof(teststr)) if (length < sizeof(teststr))
return STATUS_BUFFER_TOO_SMALL; return STATUS_BUFFER_TOO_SMALL;
kmemcpy(buffer, teststr, sizeof(teststr)); memcpy(buffer, teststr, sizeof(teststr));
*info = sizeof(teststr); *info = sizeof(teststr);
return STATUS_SUCCESS; return STATUS_SUCCESS;