mirror of
https://github.com/UzixLS/KernelEx.git
synced 2025-07-18 23:11:19 +03:00
import KernelEx-4.5.1
This commit is contained in:
@ -4,7 +4,6 @@
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <assert.h>
|
||||
|
||||
void _assert(const char *expr, const char *file, unsigned int line)
|
||||
{
|
||||
|
@ -198,6 +198,11 @@ SOURCE=.\memswap.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\msvc\msvc8.c
|
||||
# PROP Exclude_From_Build 1
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\printf.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
@ -1,6 +1,6 @@
|
||||
OBJ = abort.obj assert.obj atoi.obj atol.obj atoll.obj ctypes.obj memccpy.obj memchr.obj memcmp.obj memcpy.obj memmem.obj memmove.obj memory.obj memory-cpp.obj memrchr.obj memset.obj memswap.obj printf.obj snprintf.obj sprintf.obj sscanf.obj strcat.obj strchr.obj strcmp.obj strcmpi.obj strcpy.obj strdup.obj strlen.obj strncat.obj strncmp.obj strncpy.obj strnicmp.obj strnlen.obj strntoimax.obj strntoumax.obj strpbrk.obj strrchr.obj strsep.obj strstr.obj strtok.obj strtok_r.obj strtol.obj strtoll.obj strtoul.obj strtoull.obj strtoumax.obj strupr.obj strxspn.obj vsnprintf.obj vsprintf.obj vsscanf.obj _vsnprintf.obj write.obj exit.obj \
|
||||
ctype/isalnum.obj ctype/isalpha.obj ctype/isascii.obj ctype/isblank.obj ctype/iscntrl.obj ctype/isdigit.obj ctype/isgraph.obj ctype/islower.obj ctype/isprint.obj ctype/ispunct.obj ctype/isspace.obj ctype/isupper.obj ctype/isxdigit.obj ctype/tolower.obj ctype/toupper.obj \
|
||||
msvc/init.obj msvc/dllcrt0.obj msvc/argcargv.obj msvc/concrt0.obj msvc/wincrt0.obj msvc/purecall.obj
|
||||
msvc/init.obj msvc/dllcrt0.obj msvc/argcargv.obj msvc/concrt0.obj msvc/wincrt0.obj msvc/purecall.obj msvc/msvc8.obj
|
||||
|
||||
CFLAGS = /O2 /Oi- /I. /nologo /D_CTYPE_DISABLE_MACROS
|
||||
|
||||
|
34
kexcrt/msvc/msvc8.c
Executable file
34
kexcrt/msvc/msvc8.c
Executable file
@ -0,0 +1,34 @@
|
||||
#include <windows.h>
|
||||
|
||||
#ifndef STATUS_INVALID_CRUNTIME_PARAMETER
|
||||
#define STATUS_INVALID_CRUNTIME_PARAMETER 0xC0000417
|
||||
#endif
|
||||
|
||||
__declspec(noreturn) void _invoke_watson(
|
||||
const wchar_t *pszExpression,
|
||||
const wchar_t *pszFunction,
|
||||
const wchar_t *pszFile,
|
||||
unsigned int nLine,
|
||||
void* pReserved
|
||||
)
|
||||
{
|
||||
MessageBox(NULL, "Invalid argument passed into a CRT function", "CRT error", MB_OK | MB_ICONERROR);
|
||||
RaiseException( STATUS_INVALID_CRUNTIME_PARAMETER, EXCEPTION_NONCONTINUABLE, 0, NULL );
|
||||
}
|
||||
|
||||
void _invalid_parameter(
|
||||
const wchar_t *pszExpression,
|
||||
const wchar_t *pszFunction,
|
||||
const wchar_t *pszFile,
|
||||
unsigned int nLine,
|
||||
void* pReserved
|
||||
)
|
||||
{
|
||||
_invoke_watson(pszExpression, pszFunction, pszFile, nLine, pReserved);
|
||||
}
|
||||
|
||||
void _invalid_parameter_noinfo(void)
|
||||
{
|
||||
_invalid_parameter(NULL, NULL, NULL, 0, 0);
|
||||
}
|
||||
|
@ -186,6 +186,7 @@ int vsnprintf(char *buffer, size_t n, const char *format, va_list ap)
|
||||
st_modifiers /* Length or conversion modifiers */
|
||||
} state = st_normal;
|
||||
const char *sarg; /* %s string argument */
|
||||
const wchar_t *warg; /* %S unicode string argument */
|
||||
char carg; /* %c char argument */
|
||||
int slen; /* String length */
|
||||
|
||||
@ -401,6 +402,13 @@ int vsnprintf(char *buffer, size_t n, const char *format, va_list ap)
|
||||
sarg = sarg ? sarg : "(null)";
|
||||
slen = strlen(sarg);
|
||||
goto is_string;
|
||||
case 'S': /* Unicode String */
|
||||
warg = va_arg(ap, const wchar_t *);
|
||||
warg = warg ? warg : L"(null)";
|
||||
rank = rank_long;
|
||||
sarg = (const char *) warg;
|
||||
for (slen = 0; warg[slen]; slen++) (void)0;
|
||||
goto is_string;
|
||||
|
||||
is_string:
|
||||
{
|
||||
@ -422,6 +430,7 @@ int vsnprintf(char *buffer, size_t n, const char *format, va_list ap)
|
||||
}
|
||||
for (i = slen; i; i--) {
|
||||
sch = *sarg++;
|
||||
if (rank > rank_int) sarg++;
|
||||
EMIT(sch);
|
||||
}
|
||||
if (width > slen
|
||||
|
Reference in New Issue
Block a user