2001-05-24 21:32:00 +02:00
|
|
|
/*
|
|
|
|
* Kernel string functions
|
2002-03-10 00:29:33 +01:00
|
|
|
*
|
2003-09-16 22:35:42 +02:00
|
|
|
* Copyright 1993 Yngvi Sigurjonsson
|
|
|
|
* Copyright 1996 Alexandre Julliard
|
2003-09-08 21:38:45 +02:00
|
|
|
* Copyright 2001 Dmitry Timoshkov for CodeWeavers
|
2002-03-10 00:29:33 +01:00
|
|
|
*
|
|
|
|
* 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
|
2006-05-18 14:49:52 +02:00
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
2001-05-24 21:32:00 +02:00
|
|
|
*/
|
|
|
|
|
2003-11-27 01:59:36 +01:00
|
|
|
#include "config.h"
|
|
|
|
#include "wine/port.h"
|
|
|
|
|
2001-05-24 21:32:00 +02:00
|
|
|
#include <ctype.h>
|
2003-09-06 01:08:26 +02:00
|
|
|
#include <stdarg.h>
|
2001-05-24 21:32:00 +02:00
|
|
|
#include <string.h>
|
|
|
|
|
2005-02-22 16:50:13 +01:00
|
|
|
#define WINE_NO_INLINE_STRING
|
2003-09-06 01:08:26 +02:00
|
|
|
#include "windef.h"
|
2001-05-24 21:32:00 +02:00
|
|
|
#include "winbase.h"
|
2003-09-16 22:35:42 +02:00
|
|
|
#include "wine/unicode.h"
|
|
|
|
#include "wine/exception.h"
|
2001-05-24 21:32:00 +02:00
|
|
|
|
|
|
|
|
2003-09-16 22:35:42 +02:00
|
|
|
/***********************************************************************
|
|
|
|
* lstrcatA (KERNEL32.@)
|
2005-11-08 12:01:03 +01:00
|
|
|
* lstrcat (KERNEL32.@)
|
2003-09-16 22:35:42 +02:00
|
|
|
*/
|
|
|
|
LPSTR WINAPI lstrcatA( LPSTR dst, LPCSTR src )
|
|
|
|
{
|
|
|
|
__TRY
|
|
|
|
{
|
|
|
|
strcat( dst, src );
|
|
|
|
}
|
2005-12-16 17:17:57 +01:00
|
|
|
__EXCEPT_PAGE_FAULT
|
2003-09-16 22:35:42 +02:00
|
|
|
{
|
|
|
|
SetLastError( ERROR_INVALID_PARAMETER );
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
__ENDTRY
|
|
|
|
return dst;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* lstrcatW (KERNEL32.@)
|
|
|
|
*/
|
|
|
|
LPWSTR WINAPI lstrcatW( LPWSTR dst, LPCWSTR src )
|
|
|
|
{
|
|
|
|
__TRY
|
|
|
|
{
|
|
|
|
strcatW( dst, src );
|
|
|
|
}
|
2005-12-16 17:17:57 +01:00
|
|
|
__EXCEPT_PAGE_FAULT
|
2003-09-16 22:35:42 +02:00
|
|
|
{
|
|
|
|
SetLastError( ERROR_INVALID_PARAMETER );
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
__ENDTRY
|
|
|
|
return dst;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* lstrcpyA (KERNEL32.@)
|
2005-11-08 12:01:03 +01:00
|
|
|
* lstrcpy (KERNEL32.@)
|
2003-09-16 22:35:42 +02:00
|
|
|
*/
|
|
|
|
LPSTR WINAPI lstrcpyA( LPSTR dst, LPCSTR src )
|
|
|
|
{
|
|
|
|
__TRY
|
|
|
|
{
|
|
|
|
/* this is how Windows does it */
|
|
|
|
memmove( dst, src, strlen(src)+1 );
|
|
|
|
}
|
2005-12-16 17:17:57 +01:00
|
|
|
__EXCEPT_PAGE_FAULT
|
2003-09-16 22:35:42 +02:00
|
|
|
{
|
|
|
|
SetLastError( ERROR_INVALID_PARAMETER );
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
__ENDTRY
|
|
|
|
return dst;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* lstrcpyW (KERNEL32.@)
|
|
|
|
*/
|
|
|
|
LPWSTR WINAPI lstrcpyW( LPWSTR dst, LPCWSTR src )
|
|
|
|
{
|
|
|
|
__TRY
|
|
|
|
{
|
|
|
|
strcpyW( dst, src );
|
|
|
|
}
|
2005-12-16 17:17:57 +01:00
|
|
|
__EXCEPT_PAGE_FAULT
|
2003-09-16 22:35:42 +02:00
|
|
|
{
|
|
|
|
SetLastError( ERROR_INVALID_PARAMETER );
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
__ENDTRY
|
|
|
|
return dst;
|
|
|
|
}
|