Commit 9f50d049 authored by Juergen Schmied's avatar Juergen Schmied Committed by Alexandre Julliard

Fixed definition of the RtlMemory functions. Use macros internally and

for Winelib, use real functions for exports from ntdll.
parent 61ef5111
......@@ -291,7 +291,7 @@ type win32
@ stub RtlClearAllBits
@ stdcall RtlClearBits(long long long) RtlClearBits
@ stub RtlCompactHeap
@ stub RtlCompareMemory
@ stdcall RtlCompareMemory(ptr ptr long) RtlCompareMemory
@ stub RtlCompareMemoryUlong
@ stub RtlCompareString
@ stdcall RtlCompareUnicodeString (ptr ptr long) RtlCompareUnicodeString
......
......@@ -503,6 +503,53 @@ NTSTATUS WINAPI RtlClearBits(DWORD x1,DWORD x2,DWORD x3)
}
/******************************************************************************
* RtlCopyMemory [NTDLL]
*
*/
#undef RtlCopyMemory
VOID WINAPI RtlCopyMemory( VOID *Destination, CONST VOID *Source, SIZE_T Length )
{
memcpy(Destination, Source, Length);
}
/******************************************************************************
* RtlMoveMemory [NTDLL]
*/
#undef RtlMoveMemory
VOID WINAPI RtlMoveMemory( VOID *Destination, CONST VOID *Source, SIZE_T Length )
{
memmove(Destination, Source, Length);
}
/******************************************************************************
* RtlFillMemory [NTDLL]
*/
#undef RtlFillMemory
VOID WINAPI RtlFillMemory( VOID *Destination, SIZE_T Length, BYTE Fill )
{
memset(Destination, Fill, Length);
}
/******************************************************************************
* RtlZeroMemory [NTDLL]
*/
#undef RtlZeroMemory
VOID WINAPI RtlZeroMemory( VOID *Destination, SIZE_T Length )
{
memset(Destination, 0, Length);
}
/******************************************************************************
* RtlCompareMemory [NTDLL]
*/
SIZE_T WINAPI RtlCompareMemory( const VOID *Source1, const VOID *Source2, SIZE_T Length)
{
int i;
for(i=0; (i<Length) && (((LPBYTE)Source1)[i]==((LPBYTE)Source2)[i]); i++);
return i;
}
/******************************************************************************
* RtlAssert [NTDLL]
*
* Not implemented in non-debug versions.
......
......@@ -1439,14 +1439,6 @@ BOOL WINAPI ReportEventW(HANDLE,WORD,WORD,DWORD,PSID,WORD,DWORD,LPCWSTR *
#define ReportEvent WINELIB_NAME_AW(ReportEvent)
BOOL WINAPI ResetEvent(HANDLE);
DWORD WINAPI ResumeThread(HANDLE);
VOID WINAPI RtlFillMemory(LPVOID,UINT,UINT);
#define FillMemory RtlFillMemory
VOID WINAPI RtlMoveMemory(LPVOID,LPCVOID,UINT);
#define MoveMemory RtlMoveMemory
VOID WINAPI RtlZeroMemory(LPVOID,UINT);
#define ZeroMemory RtlZeroMemory
VOID WINAPI RtlCopyMemory(LPVOID,const VOID*, DWORD);
#define CopyMemory RtlCopyMemory
BOOL WINAPI RevertToSelf(void);
DWORD WINAPI SearchPathA(LPCSTR,LPCSTR,LPCSTR,DWORD,LPSTR,LPSTR*);
DWORD WINAPI SearchPathW(LPCWSTR,LPCWSTR,LPCWSTR,DWORD,LPWSTR,LPWSTR*);
......@@ -1765,6 +1757,11 @@ INT WINAPI lstrcmpiA(LPCSTR,LPCSTR);
INT WINAPI lstrcmpiW(LPCWSTR,LPCWSTR);
#define lstrcmpi WINELIB_NAME_AW(lstrcmpi)
/* compatibility macros */
#define FillMemory RtlFillMemory
#define MoveMemory RtlMoveMemory
#define ZeroMemory RtlZeroMemory
#define CopyMemory RtlCopyMemory
/* the following may be macros when compiling Wine */
#ifndef SetLastError
......
......@@ -1625,6 +1625,12 @@ typedef enum tagSID_NAME_USE {
#define DACL_SECURITY_INFORMATION 0x00000004
#define SACL_SECURITY_INFORMATION 0x00000008
#define RtlEqualMemory(Destination, Source, Length) (!memcmp((Destination),(Source),(Length)))
#define RtlMoveMemory(Destination, Source, Length) memmove((Destination),(Source),(Length))
#define RtlCopyMemory(Destination, Source, Length) memcpy((Destination),(Source),(Length))
#define RtlFillMemory(Destination, Length, Fill) memset((Destination),(Fill),(Length))
#define RtlZeroMemory(Destination, Length) memset((Destination),0,(Length))
#include "poppack.h"
#endif /* __WINE_WINNT_H */
......@@ -477,34 +477,6 @@ void WINAPI Copy16( LPVOID src, LPVOID dst, WORD size )
memcpy( dst, src, size );
}
/***********************************************************************
* RtlFillMemory (KERNEL32.441)
*/
VOID WINAPI RtlFillMemory( LPVOID ptr, UINT len, UINT fill )
{
memset( ptr, fill, len );
}
/***********************************************************************
* RtlMoveMemory (KERNEL32.442)
*/
VOID WINAPI RtlMoveMemory( LPVOID dst, LPCVOID src, UINT len )
{
memmove( dst, src, len );
}
/***********************************************************************
* RtlZeroMemory (KERNEL32.444)
*/
VOID WINAPI RtlZeroMemory( LPVOID ptr, UINT len )
{
memset( ptr, 0, len );
}
/***********************************************************************
* AnsiToOem16 (KEYBOARD.5)
*/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment