Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

tzermem.c File Reference

#include <nt.h>
#include <ntrtl.h>
#include <stdio.h>
#include "localrtl.h"

Go to the source code of this file.

Defines

#define BUFFER_SIZE   (MAX_MARGIN + MAX_OFFSET + MAX_LENGTH + MAX_MARGIN)

Functions

void __cdecl main ()

Variables

UCHAR Buffer1 [BUFFER_SIZE]
UCHAR Buffer2 [BUFFER_SIZE]


Define Documentation

#define BUFFER_SIZE   (MAX_MARGIN + MAX_OFFSET + MAX_LENGTH + MAX_MARGIN)
 

Definition at line 35 of file tzermem.c.


Function Documentation

void __cdecl main  ) 
 

Definition at line 42 of file tzermem.c.

References Buffer1, Buffer2, BUFFER_SIZE, FillPattern(), LocalCompareMemory(), LocalZeroMemory(), MAX_LENGTH, MAX_OFFSET, and Offset.

00043 { 00044 ULONG ErrorCount; 00045 ULONG Length; 00046 ULONG Offset; 00047 ULONG Result; 00048 ULONG TestCases; 00049 00050 fprintf(stderr, "Testing RtlZeroMemory\n"); 00051 ErrorCount = 0; 00052 TestCases = 0; 00053 00054 for (Offset = 0; Offset <= MAX_OFFSET; Offset += 1) { 00055 for (Length = 0; Length <= MAX_LENGTH; Length += 1) { 00056 00057 FillPattern(Buffer1, BUFFER_SIZE); 00058 FillPattern(Buffer2, BUFFER_SIZE); 00059 LocalZeroMemory(&Buffer1[Offset], Length); 00060 RtlZeroMemory(&Buffer2[Offset], Length); 00061 00062 Result = LocalCompareMemory(Buffer1, Buffer2, BUFFER_SIZE); 00063 00064 TestCases += 1; 00065 if (Result != BUFFER_SIZE) { 00066 ErrorCount += 1; 00067 00068 printf("ERROR: Offset = %d, Length = %d\n", Offset, Length); 00069 printf("Buffers differ starting at byte %d:\n", Result); 00070 printf("Buffer1 = <%*s>\n", BUFFER_SIZE, Buffer1); 00071 printf("Buffer2 = <%*s>\n", BUFFER_SIZE, Buffer2); 00072 printf("\n"); 00073 } 00074 } 00075 } 00076 00077 fprintf(stderr, "Test of RtlZeroMemory completed: "); 00078 fprintf(stderr, "%d test cases, %d errors found.\n", TestCases, ErrorCount); 00079 }


Variable Documentation

UCHAR Buffer1[BUFFER_SIZE]
 

Definition at line 37 of file tzermem.c.

UCHAR Buffer2[BUFFER_SIZE]
 

Definition at line 38 of file tzermem.c.


Generated on Sat May 15 19:45:50 2004 for test by doxygen 1.3.7