diff --git a/freeldr/freeldr/include/rtl.h b/freeldr/freeldr/include/rtl.h index 6ee208545fa..7b7c5ed99e5 100644 --- a/freeldr/freeldr/include/rtl.h +++ b/freeldr/freeldr/include/rtl.h @@ -46,11 +46,13 @@ int strnicmp(const char *string1, const char *string2, size_t length); /////////////////////////////////////////////////////////////////////////////////////// int memcmp(const void *buf1, const void *buf2, size_t count); void * memcpy(void *to, const void *from, size_t count); +void * memmove(void *dest, const void *src, size_t count); void * memset(void *src, int val, size_t count); #define RtlCompareMemory(Source1, Source2, Length) memcmp(Source1, Source2, Length) #define RtlCopyMemory(Destination, Source, Length) memcpy(Destination, Source, Length) #define RtlFillMemory(Destination, Length, Fill) memset(Destination, Fill, Length) +#define RtlMoveMemory(Destination, Source, Length) memmove(Destination, Source, Length) #define RtlZeroMemory(Destination, Length) memset(Destination, 0, Length) /////////////////////////////////////////////////////////////////////////////////////// diff --git a/freeldr/freeldr/include/version.h b/freeldr/freeldr/include/version.h index 6a81f062cdd..3055fc7ded3 100644 --- a/freeldr/freeldr/include/version.h +++ b/freeldr/freeldr/include/version.h @@ -22,7 +22,7 @@ /* just some stuff */ -#define VERSION "FreeLoader v1.8.7" +#define VERSION "FreeLoader v1.8.8" #define COPYRIGHT "Copyright (C) 1998-2003 Brian Palmer " #define AUTHOR_EMAIL "" #define BY_AUTHOR "by Brian Palmer" @@ -36,7 +36,7 @@ // #define FREELOADER_MAJOR_VERSION 1 #define FREELOADER_MINOR_VERSION 8 -#define FREELOADER_PATCH_VERSION 7 +#define FREELOADER_PATCH_VERSION 8 PUCHAR GetFreeLoaderVersionString(VOID); diff --git a/freeldr/freeldr/rtl/memmove.c b/freeldr/freeldr/rtl/memmove.c new file mode 100644 index 00000000000..6232685fefa --- /dev/null +++ b/freeldr/freeldr/rtl/memmove.c @@ -0,0 +1,54 @@ +/* + * FreeLoader + * Copyright (C) 1998-2003 Brian Palmer + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include + +void *memmove(void *dest, const void *src, size_t count) +{ + char *char_dest = (char *)dest; + char *char_src = (char *)src; + + if ((char_dest <= char_src) || (char_dest >= (char_src+count))) + { + /* non-overlapping buffers */ + while(count > 0) + { + *char_dest = *char_src; + char_dest++; + char_src++; + count--; + } + } + else + { + /* overlaping buffers */ + char_dest = (char *)dest + count - 1; + char_src = (char *)src + count - 1; + + while(count > 0) + { + *char_dest = *char_src; + char_dest--; + char_src--; + count--; + } + } + + return dest; +}