ReactOS  0.4.14-dev-342-gdc047f9
mem.c File Reference
#include <rtl.h>
#include <debug.h>
Include dependency graph for mem.c:

Go to the source code of this file.

Macros

#define NDEBUG
 

Functions

SIZE_T NTAPI RtlCompareMemory (IN const VOID *Source1, IN const VOID *Source2, IN SIZE_T Length)
 
SIZE_T NTAPI RtlCompareMemoryUlong (IN PVOID Source, IN SIZE_T Length, IN ULONG Value)
 
VOID NTAPI RtlFillMemory (PVOID Destination, SIZE_T Length, UCHAR Fill)
 
VOID NTAPI RtlFillMemoryUlong (PVOID Destination, SIZE_T Length, ULONG Fill)
 
VOID NTAPI RtlMoveMemory (PVOID Destination, CONST VOID *Source, SIZE_T Length)
 
VOID NTAPI RtlZeroMemory (PVOID Destination, SIZE_T Length)
 

Macro Definition Documentation

◆ NDEBUG

#define NDEBUG

Definition at line 13 of file mem.c.

Function Documentation

◆ RtlCompareMemory()

SIZE_T NTAPI RtlCompareMemory ( IN const VOID Source1,
IN const VOID Source2,
IN SIZE_T  Length 
)

Definition at line 37 of file mem.c.

40 {
41  SIZE_T i;
42  for (i = 0; (i < Length) && (((PUCHAR)Source1)[i] == ((PUCHAR)Source2)[i]); i++)
43  ;
44 
45  return i;
46 }
unsigned char * PUCHAR
Definition: retypes.h:3
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
ULONG_PTR SIZE_T
Definition: typedefs.h:78

◆ RtlCompareMemoryUlong()

SIZE_T NTAPI RtlCompareMemoryUlong ( IN PVOID  Source,
IN SIZE_T  Length,
IN ULONG  Value 
)

Definition at line 61 of file mem.c.

64 {
66  ULONG_PTR len = Length / sizeof(ULONG);
67  ULONG_PTR i;
68 
69  for (i = 0; i < len; i++)
70  {
71  if (*ptr != Value)
72  break;
73 
74  ptr++;
75  }
76 
77  return (SIZE_T)((PCHAR)ptr - (PCHAR)Source);
78 }
_In_opt_ ULONG _Out_ PULONG Value
Definition: rtlfuncs.h:2343
signed char * PCHAR
Definition: retypes.h:7
uint32_t ULONG_PTR
Definition: typedefs.h:63
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
static PVOID ptr
Definition: dispmode.c:27
#define PCHAR
Definition: match.c:90
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
GLenum GLsizei len
Definition: glext.h:6722
ULONG_PTR SIZE_T
Definition: typedefs.h:78
unsigned int * PULONG
Definition: retypes.h:1
unsigned int ULONG
Definition: retypes.h:1
_In_ UINT _In_ UINT _In_ PNDIS_PACKET Source
Definition: ndis.h:3167

◆ RtlFillMemory()

VOID NTAPI RtlFillMemory ( PVOID  Destination,
SIZE_T  Length,
UCHAR  Fill 
)

Definition at line 87 of file mem.c.

90 {
92 }
void Fill(HDC hdc, LONG x, LONG y, COLORREF color)
Definition: drawing.cpp:109
_In_ PUNICODE_STRING _Inout_ PUNICODE_STRING Destination
Definition: rtlfuncs.h:2891
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
#define memset(x, y, z)
Definition: compat.h:39

Referenced by RtlZeroMemory().

◆ RtlFillMemoryUlong()

VOID NTAPI RtlFillMemoryUlong ( PVOID  Destination,
SIZE_T  Length,
ULONG  Fill 
)

Definition at line 101 of file mem.c.

104 {
105  PULONG Dest = Destination;
106  SIZE_T Count = Length / sizeof(ULONG);
107 
108  while (Count > 0)
109  {
110  *Dest = Fill;
111  Dest++;
112  Count--;
113  }
114 }
void Fill(HDC hdc, LONG x, LONG y, COLORREF color)
Definition: drawing.cpp:109
_Inout_ __drv_aliasesMem PSLIST_ENTRY _Inout_ PSLIST_ENTRY _In_ ULONG Count
Definition: exfuncs.h:1015
_In_ PUNICODE_STRING _Inout_ PUNICODE_STRING Destination
Definition: rtlfuncs.h:2891
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
ULONG_PTR SIZE_T
Definition: typedefs.h:78
unsigned int * PULONG
Definition: retypes.h:1
unsigned int ULONG
Definition: retypes.h:1

◆ RtlMoveMemory()

VOID NTAPI RtlMoveMemory ( PVOID  Destination,
CONST VOID Source,
SIZE_T  Length 
)

Definition at line 142 of file mem.c.

145 {
147 }
#define memmove(s1, s2, n)
Definition: mkisofs.h:881
_In_ PUNICODE_STRING _Inout_ PUNICODE_STRING Destination
Definition: rtlfuncs.h:2891
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
_In_ UINT _In_ UINT _In_ PNDIS_PACKET Source
Definition: ndis.h:3167

◆ RtlZeroMemory()

VOID NTAPI RtlZeroMemory ( PVOID  Destination,
SIZE_T  Length 
)

Definition at line 155 of file mem.c.

157 {
159 }
_In_ PUNICODE_STRING _Inout_ PUNICODE_STRING Destination
Definition: rtlfuncs.h:2891
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
VOID NTAPI RtlFillMemory(PVOID Destination, SIZE_T Length, UCHAR Fill)
Definition: mem.c:87

Referenced by _Ret_opt_bytecap_().