Module: wine Branch: master Commit: c7760ce7a247eeb9f15b51d0ec68ca0961efc0b0 URL: https://source.winehq.org/git/wine.git/?a=commit;h=c7760ce7a247eeb9f15b51d0e...
Author: Alexandre Julliard julliard@winehq.org Date: Tue May 26 14:57:31 2020 +0200
kernel32: Remove string.c.
Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/kernel32/Makefile.in | 1 - dlls/kernel32/string.c | 113 ---------------------------------------------- dlls/kernel32/virtual.c | 79 ++++++++++++++++++++++++++++++++ 3 files changed, 79 insertions(+), 114 deletions(-)
diff --git a/dlls/kernel32/Makefile.in b/dlls/kernel32/Makefile.in index 28a15f8bbe..7822309de5 100644 --- a/dlls/kernel32/Makefile.in +++ b/dlls/kernel32/Makefile.in @@ -24,7 +24,6 @@ C_SRCS = \ process.c \ profile.c \ resource.c \ - string.c \ sync.c \ tape.c \ term.c \ diff --git a/dlls/kernel32/string.c b/dlls/kernel32/string.c deleted file mode 100644 index 9e1450ca58..0000000000 --- a/dlls/kernel32/string.c +++ /dev/null @@ -1,113 +0,0 @@ -/* - * Kernel string functions - * - * Copyright 1993 Yngvi Sigurjonsson - * Copyright 1996 Alexandre Julliard - * Copyright 2001 Dmitry Timoshkov for CodeWeavers - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * 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 "wine/port.h" - -#include <ctype.h> -#include <stdarg.h> -#include <string.h> - -#define WINE_NO_INLINE_STRING -#include "windef.h" -#include "winbase.h" -#include "wine/unicode.h" -#include "wine/exception.h" - - -/*********************************************************************** - * lstrcatA (KERNEL32.@) - * lstrcat (KERNEL32.@) - */ -LPSTR WINAPI lstrcatA( LPSTR dst, LPCSTR src ) -{ - __TRY - { - strcat( dst, src ); - } - __EXCEPT_PAGE_FAULT - { - SetLastError( ERROR_INVALID_PARAMETER ); - return NULL; - } - __ENDTRY - return dst; -} - - -/*********************************************************************** - * lstrcatW (KERNEL32.@) - */ -LPWSTR WINAPI lstrcatW( LPWSTR dst, LPCWSTR src ) -{ - __TRY - { - strcatW( dst, src ); - } - __EXCEPT_PAGE_FAULT - { - SetLastError( ERROR_INVALID_PARAMETER ); - return NULL; - } - __ENDTRY - return dst; -} - - -/*********************************************************************** - * lstrcpyA (KERNEL32.@) - * lstrcpy (KERNEL32.@) - */ -LPSTR WINAPI lstrcpyA( LPSTR dst, LPCSTR src ) -{ - __TRY - { - /* this is how Windows does it */ - memmove( dst, src, strlen(src)+1 ); - } - __EXCEPT_PAGE_FAULT - { - SetLastError( ERROR_INVALID_PARAMETER ); - return NULL; - } - __ENDTRY - return dst; -} - - -/*********************************************************************** - * lstrcpyW (KERNEL32.@) - */ -LPWSTR WINAPI lstrcpyW( LPWSTR dst, LPCWSTR src ) -{ - __TRY - { - strcpyW( dst, src ); - } - __EXCEPT_PAGE_FAULT - { - SetLastError( ERROR_INVALID_PARAMETER ); - return NULL; - } - __ENDTRY - return dst; -} diff --git a/dlls/kernel32/virtual.c b/dlls/kernel32/virtual.c index 183a3fe05a..97581a5db1 100644 --- a/dlls/kernel32/virtual.c +++ b/dlls/kernel32/virtual.c @@ -30,6 +30,7 @@ # include <unistd.h> #endif
+#define WINE_NO_INLINE_STRING #include "ntstatus.h" #define WIN32_NO_STATUS #define NONAMELESSUNION @@ -40,6 +41,7 @@ #include "winerror.h" #include "psapi.h" #include "wine/exception.h" +#include "wine/unicode.h" #include "wine/debug.h"
#include "kernel_private.h" @@ -256,3 +258,80 @@ BOOL WINAPI IsBadStringPtrW( LPCWSTR str, UINT_PTR max ) __ENDTRY return FALSE; } +/*********************************************************************** + * lstrcatA (KERNEL32.@) + * lstrcat (KERNEL32.@) + */ +LPSTR WINAPI lstrcatA( LPSTR dst, LPCSTR src ) +{ + __TRY + { + strcat( dst, src ); + } + __EXCEPT( badptr_handler ) + { + SetLastError( ERROR_INVALID_PARAMETER ); + return NULL; + } + __ENDTRY + return dst; +} + + +/*********************************************************************** + * lstrcatW (KERNEL32.@) + */ +LPWSTR WINAPI lstrcatW( LPWSTR dst, LPCWSTR src ) +{ + __TRY + { + strcatW( dst, src ); + } + __EXCEPT( badptr_handler ) + { + SetLastError( ERROR_INVALID_PARAMETER ); + return NULL; + } + __ENDTRY + return dst; +} + + +/*********************************************************************** + * lstrcpyA (KERNEL32.@) + * lstrcpy (KERNEL32.@) + */ +LPSTR WINAPI lstrcpyA( LPSTR dst, LPCSTR src ) +{ + __TRY + { + /* this is how Windows does it */ + memmove( dst, src, strlen(src)+1 ); + } + __EXCEPT( badptr_handler ) + { + SetLastError( ERROR_INVALID_PARAMETER ); + return NULL; + } + __ENDTRY + return dst; +} + + +/*********************************************************************** + * lstrcpyW (KERNEL32.@) + */ +LPWSTR WINAPI lstrcpyW( LPWSTR dst, LPCWSTR src ) +{ + __TRY + { + strcpyW( dst, src ); + } + __EXCEPT( badptr_handler ) + { + SetLastError( ERROR_INVALID_PARAMETER ); + return NULL; + } + __ENDTRY + return dst; +}