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

rtmisc1.c File Reference

#include "cmp.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

Go to the source code of this file.

Defines

#define TITLE_INDEX_1   122259
#define TITLE_INDEX_2   120858
#define TITLE_INDEX_3   120159
#define TYPE_1   666
#define TYPE_2   1066

Functions

void __cdecl main (int, char *)
VOID NameClassAndTitle (KEY_NODE_INFORMATION *NodeInformation, UNICODE_STRING ClassName, ULONG TitleIndex, UNICODE_STRING KeyName, LARGE_INTEGER CompTime, BOOLEAN Strong, PUCHAR TestName)
VOID expectstring (PWSTR expected, ULONG expectedlength, PWSTR actual, ULONG actuallength)
VOID expecttime (LARGE_INTEGER ExpectTime, LARGE_INTEGER ActualTime)

Variables

ULONG failure = 0


Define Documentation

#define TITLE_INDEX_1   122259
 

Definition at line 64 of file rtmisc1.c.

Referenced by main().

#define TITLE_INDEX_2   120858
 

Definition at line 65 of file rtmisc1.c.

Referenced by main().

#define TITLE_INDEX_3   120159
 

Definition at line 66 of file rtmisc1.c.

Referenced by main().

#define TYPE_1   666
 

Definition at line 67 of file rtmisc1.c.

Referenced by main().

#define TYPE_2   1066
 

Definition at line 68 of file rtmisc1.c.

Referenced by main().


Function Documentation

VOID expectstring (  PWSTR  expected,
ULONG  expectedlength,
PWSTR  actual,
ULONG  actuallength
) 
 

Definition at line 823 of file rtmisc1.c.

Referenced by main(), and NameClassAndTitle().

00829 { 00830 ULONG i; 00831 00832 printf("Expected Len %d Str = '", expectedlength); 00833 for (i = 0; i < expectedlength; i++) { 00834 printf("%c", (UCHAR)(expected[i])); 00835 } 00836 printf("'\n"); 00837 00838 printf("Got Len %d Str = '", actuallength); 00839 for (i = 0; i < actuallength; i++) { 00840 printf("%c", (UCHAR)(actual[i])); 00841 } 00842 printf("'\n"); 00843 return; 00844 }

VOID expecttime (  LARGE_INTEGER  ExpectTime,
LARGE_INTEGER  ActualTime
) 
 

Definition at line 812 of file rtmisc1.c.

Referenced by NameClassAndTitle().

00816 { 00817 printf("Expected %08lx%08lx\n", ExpectTime.HighPart, ExpectTime.LowPart); 00818 printf("Got %08lx%08lx\n", ActualTime.HighPart, ActualTime.LowPart); 00819 return; 00820 }

void __cdecl main (  int  ,
char * 
) 
 

VOID NameClassAndTitle (  KEY_NODE_INFORMATION *  NodeInformation,
UNICODE_STRING  ClassName,
ULONG  TitleIndex,
UNICODE_STRING  KeyName,
LARGE_INTEGER  CompTime,
BOOLEAN  Strong,
PUCHAR  TestName
) 
 

Definition at line 739 of file rtmisc1.c.

References expectstring(), expecttime(), failure, and KeyName.

Referenced by main().

00748 { 00749 PWSTR p; 00750 00751 if (Strong) { 00752 00753 // 00754 // require exact match 00755 // 00756 00757 if ((CompTime.HighPart != NodeInformation->LastWriteTime.HighPart) || 00758 (CompTime.LowPart != NodeInformation->LastWriteTime.LowPart)) 00759 { 00760 printf("%s Wrong time (a)\n", TestName); 00761 expecttime(CompTime, NodeInformation->LastWriteTime); 00762 failure++; 00763 } 00764 00765 00766 } else { 00767 00768 // 00769 // >= will do 00770 // 00771 00772 if ( (CompTime.HighPart > NodeInformation->LastWriteTime.HighPart) || 00773 ((CompTime.HighPart == NodeInformation->LastWriteTime.HighPart) && 00774 (CompTime.LowPart > NodeInformation->LastWriteTime.LowPart)) ) 00775 { 00776 printf("%s Wrong time (b)\n", TestName); 00777 expecttime(CompTime, NodeInformation->LastWriteTime); 00778 failure++; 00779 } 00780 } 00781 00782 00783 p = (PWSTR)((PUCHAR)NodeInformation + NodeInformation->ClassOffset); 00784 if ( (NodeInformation->ClassLength != ClassName.Length) || 00785 (wcsncmp(ClassName.Buffer, p, (ClassName.Length/sizeof(WCHAR))) != 0)) 00786 { 00787 printf("%s wrong class name\n", TestName); 00788 failure++; 00789 } 00790 00791 if (NodeInformation->TitleIndex != TitleIndex) { 00792 printf("%s wrong title index\n", TestName); 00793 failure++; 00794 } 00795 00796 p = (PWSTR)(&(NodeInformation->Name[0])); 00797 if ( (NodeInformation->NameLength != KeyName.Length) || 00798 (wcsncmp(KeyName.Buffer, p, (KeyName.Length/sizeof(WCHAR))) != 0)) 00799 { 00800 printf("%s wrong name\n", TestName); 00801 expectstring( 00802 KeyName.Buffer, 00803 (KeyName.Length/sizeof(WCHAR)), 00804 (PWSTR)&(NodeInformation->Name[0]), 00805 (NodeInformation->NameLength/sizeof(WCHAR)) 00806 ); 00807 failure++; 00808 } 00809 }


Variable Documentation

ULONG failure = 0
 

Definition at line 71 of file rtmisc1.c.


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