ReactOS  0.4.13-dev-249-gcba1a2f
FsRtlTunnel.c File Reference
#include <kmt_test.h>
#include <debug.h>
Include dependency graph for FsRtlTunnel.c:

Go to the source code of this file.

Macros

#define NDEBUG
 
#define BufSize   10000
 

Functions

PUNICODE_STRING CopyUS (PUNICODE_STRING a)
 
void TestFsRtlInitializeTunnelCache ()
 
void TestFsRtlAddToTunnelCache (ULONGLONG DirectoryKey, PUNICODE_STRING s_name, PUNICODE_STRING l_name, BOOLEAN KeyByShortName)
 
BOOLEAN TestFsRtlFindInTunnelCache (ULONG DirectoryKey, PUNICODE_STRING name, PUNICODE_STRING s_name, PUNICODE_STRING l_name)
 
void TestFsRtlDeleteKeyFromTunnelCache (ULONGLONG a)
 
static void DuplicatesTest ()
 
 START_TEST (FsRtlTunnel)
 

Variables

static PTUNNEL T
 
static PTUNNEL Tb
 

Macro Definition Documentation

◆ BufSize

#define BufSize   10000

Definition at line 28 of file FsRtlTunnel.c.

◆ NDEBUG

#define NDEBUG

Definition at line 12 of file FsRtlTunnel.c.

Function Documentation

◆ CopyUS()

Definition at line 30 of file FsRtlTunnel.c.

31 {
33  ok(b != NULL, "US is NULL after allocated memory\n");
34  b->Length = 0;
35  b->MaximumLength =a->MaximumLength;
36  if (b->MaximumLength)
37  {
38  b->Buffer = (PWSTR)ExAllocatePoolWithTag(PagedPool, b->MaximumLength, 1633);
39  ok(b->Buffer != NULL, "US->Buffer is NULL after allocated memory\n");
41  }
42  else
43  {
44  b->Buffer = NULL;
45  }
46  return b;
47 }
uint16_t * PWSTR
Definition: typedefs.h:54
NTSYSAPI VOID NTAPI RtlCopyUnicodeString(PUNICODE_STRING DestinationString, PUNICODE_STRING SourceString)
#define ok(value,...)
smooth NULL
Definition: ftsmooth.c:416
#define b
Definition: ke_i.h:79
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
#define ExAllocatePool(type, size)
Definition: fbtusb.h:44
UNICODE_STRING * PUNICODE_STRING
Definition: env_spec_w32.h:373
GLboolean GLboolean GLboolean GLboolean a
Definition: glext.h:6204

Referenced by TestFsRtlAddToTunnelCache().

◆ DuplicatesTest()

static void DuplicatesTest ( )
static

Definition at line 125 of file FsRtlTunnel.c.

126 {
127  UNICODE_STRING ShortName, LongName, OutShort, OutLong, ShortName2, LongName2;
128  ULONG First, Second, OutLength, OutData;
129  PTUNNEL Tunnel;
130  PVOID Buffer;
131 
132  First = 1;
133  Second = 2;
134  RtlInitUnicodeString(&ShortName, L"LONGFI~1.TXT");
135  RtlInitUnicodeString(&LongName, L"Longfilename.txt");
136  RtlInitUnicodeString(&ShortName2, L"LONGFI~2.TXT");
137  RtlInitUnicodeString(&LongName2, L"Longfilenamr.txt");
138  Tunnel = ExAllocatePool(NonPagedPool, sizeof(TUNNEL));
139  RtlZeroMemory(Tunnel, sizeof(TUNNEL));
140  OutShort.MaximumLength = 13 * sizeof(WCHAR);
141  OutShort.Buffer = ExAllocatePool(PagedPool, OutShort.MaximumLength);
142  OutLong.MaximumLength = 17 * sizeof(WCHAR);
143  OutLong.Buffer = Buffer = ExAllocatePool(PagedPool, OutLong.MaximumLength);
144 
146  FsRtlAddToTunnelCache(Tunnel, 1, &ShortName, &LongName, TRUE, sizeof(ULONG), &First);
147  ok_bool_true(FsRtlFindInTunnelCache(Tunnel, 1, &ShortName, &OutShort, &OutLong, &OutLength, &OutData), "First call");
148  ok_eq_ulong(OutLength, sizeof(ULONG));
149  ok_eq_ulong(OutData, 1);
150  ok_eq_pointer(OutLong.Buffer, Buffer);
151 
152  FsRtlAddToTunnelCache(Tunnel, 1, &ShortName, &LongName, TRUE, sizeof(ULONG), &Second);
153  ok_bool_true(FsRtlFindInTunnelCache(Tunnel, 1, &ShortName, &OutShort, &OutLong, &OutLength, &OutData), "Second call");
154  ok_eq_ulong(OutLength, sizeof(ULONG));
155  ok_eq_ulong(OutData, 2);
156  ok_eq_pointer(OutLong.Buffer, Buffer);
157 
158  OutLong.MaximumLength = 13 * sizeof(WCHAR);
159  ok_bool_true(FsRtlFindInTunnelCache(Tunnel, 1, &ShortName, &OutShort, &OutLong, &OutLength, &OutData), "Third call");
160  ok_eq_ulong(OutLength, sizeof(ULONG));
161  ok_eq_ulong(OutData, 2);
162  ok(OutLong.Buffer != Buffer, "Buffer didn't get reallocated!\n");
163  ok_eq_uint(OutLong.MaximumLength, 16 * sizeof(WCHAR));
164 
166  ok_bool_false(FsRtlFindInTunnelCache(Tunnel, 1, &ShortName, &OutShort, &OutLong, &OutLength, &OutData), "Fourth call");
167 
168  FsRtlAddToTunnelCache(Tunnel, 1, &ShortName, &LongName, TRUE, sizeof(ULONG), &First);
169  ok_bool_true(FsRtlFindInTunnelCache(Tunnel, 1, &ShortName, &OutShort, &OutLong, &OutLength, &OutData), "Fifth call");
170  ok_eq_ulong(OutLength, sizeof(ULONG));
171  ok_eq_ulong(OutData, 1);
172 
173  FsRtlAddToTunnelCache(Tunnel, 1, &ShortName2, &LongName2, TRUE, sizeof(ULONG), &First);
174  ok_bool_true(FsRtlFindInTunnelCache(Tunnel, 1, &ShortName, &OutShort, &OutLong, &OutLength, &OutData), "Sixth call");
175  ok_eq_ulong(OutLength, sizeof(ULONG));
176  ok_eq_ulong(OutData, 1);
177  ok_bool_true(FsRtlFindInTunnelCache(Tunnel, 1, &ShortName2, &OutShort, &OutLong, &OutLength, &OutData), "Seventh call");
178  ok_eq_ulong(OutLength, sizeof(ULONG));
179  ok_eq_ulong(OutData, 1);
180 
181  FsRtlAddToTunnelCache(Tunnel, 1, &ShortName, &LongName, TRUE, sizeof(ULONG), &Second);
182  ok_bool_true(FsRtlFindInTunnelCache(Tunnel, 1, &ShortName, &OutShort, &OutLong, &OutLength, &OutData), "Eighth call");
183  ok_eq_ulong(OutLength, sizeof(ULONG));
184  ok_eq_ulong(OutData, 2);
185  ok_bool_true(FsRtlFindInTunnelCache(Tunnel, 1, &ShortName2, &OutShort, &OutLong, &OutLength, &OutData), "Ninth call");
186  ok_eq_ulong(OutLength, sizeof(ULONG));
187  ok_eq_ulong(OutData, 1);
188 
189  FsRtlAddToTunnelCache(Tunnel, 1, &ShortName2, &LongName2, TRUE, sizeof(ULONG), &Second);
190  ok_bool_true(FsRtlFindInTunnelCache(Tunnel, 1, &ShortName, &OutShort, &OutLong, &OutLength, &OutData), "Tenth call");
191  ok_eq_ulong(OutLength, sizeof(ULONG));
192  ok_eq_ulong(OutData, 2);
193  ok_bool_true(FsRtlFindInTunnelCache(Tunnel, 1, &ShortName2, &OutShort, &OutLong, &OutLength, &OutData), "Eleventh call");
194  ok_eq_ulong(OutLength, sizeof(ULONG));
195  ok_eq_ulong(OutData, 2);
196 
198  ok_bool_false(FsRtlFindInTunnelCache(Tunnel, 1, &ShortName, &OutShort, &OutLong, &OutLength, &OutData), "Twelfth call");
199  ok_bool_false(FsRtlFindInTunnelCache(Tunnel, 1, &ShortName2, &OutShort, &OutLong, &OutLength, &OutData), "Thirteenth call");
200 
201  FsRtlAddToTunnelCache(Tunnel, 1, &ShortName, &LongName, TRUE, sizeof(ULONG), &First);
202  ok_bool_true(FsRtlFindInTunnelCache(Tunnel, 1, &ShortName, &OutShort, &OutLong, &OutLength, &OutData), "Fourteenth call");
203  ok_eq_ulong(OutLength, sizeof(ULONG));
204  ok_eq_ulong(OutData, 1);
205 
206  FsRtlAddToTunnelCache(Tunnel, 1, &ShortName, &LongName, TRUE, sizeof(ULONG), &Second);
207  ok_bool_true(FsRtlFindInTunnelCache(Tunnel, 1, &ShortName, &OutShort, &OutLong, &OutLength, &OutData), "Fifteenth call");
208  ok_eq_ulong(OutLength, sizeof(ULONG));
209  ok_eq_ulong(OutData, 2);
210 
211  FsRtlAddToTunnelCache(Tunnel, 1, &ShortName2, &LongName2, TRUE, sizeof(ULONG), &First);
212  ok_bool_true(FsRtlFindInTunnelCache(Tunnel, 1, &ShortName, &OutShort, &OutLong, &OutLength, &OutData), "Sixteenth call");
213  ok_eq_ulong(OutLength, sizeof(ULONG));
214  ok_eq_ulong(OutData, 2);
215  ok_bool_true(FsRtlFindInTunnelCache(Tunnel, 1, &ShortName2, &OutShort, &OutLong, &OutLength, &OutData), "Seventeenth call");
216  ok_eq_ulong(OutLength, sizeof(ULONG));
217  ok_eq_ulong(OutData, 1);
218 
219  FsRtlAddToTunnelCache(Tunnel, 1, &ShortName2, &LongName2, TRUE, sizeof(ULONG), &Second);
220  ok_bool_true(FsRtlFindInTunnelCache(Tunnel, 1, &ShortName, &OutShort, &OutLong, &OutLength, &OutData), "Eighteenth call");
221  ok_eq_ulong(OutLength, sizeof(ULONG));
222  ok_eq_ulong(OutData, 2);
223  ok_bool_true(FsRtlFindInTunnelCache(Tunnel, 1, &ShortName2, &OutShort, &OutLong, &OutLength, &OutData), "Nineteenth call");
224  ok_eq_ulong(OutLength, sizeof(ULONG));
225  ok_eq_ulong(OutData, 2);
226 
227  FsRtlDeleteTunnelCache(Tunnel);
228  ExFreePool(OutShort.Buffer);
229  ExFreePool(OutLong.Buffer);
231  ExFreePool(Tunnel);
232 }
IN PDCB IN POEM_STRING IN PUNICODE_STRING IN OUT POEM_STRING ShortName
Definition: fatprocs.h:1294
#define ok_eq_ulong(value, expected)
#define TRUE
Definition: types.h:120
USHORT MaximumLength
Definition: env_spec_w32.h:370
WCHAR Second[]
Definition: FormatMessage.c:12
#define ok_eq_pointer(value, expected)
VOID NTAPI FsRtlDeleteKeyFromTunnelCache(IN PTUNNEL Cache, IN ULONGLONG DirectoryKey)
Definition: tunnel.c:588
#define ok_bool_false(value, desc)
Definition: kmt_test.h:257
WCHAR First[]
Definition: FormatMessage.c:11
#define ok_bool_true(value, desc)
Definition: kmt_test.h:256
VOID NTAPI FsRtlAddToTunnelCache(IN PTUNNEL Cache, IN ULONGLONG DirectoryKey, IN PUNICODE_STRING ShortName, IN PUNICODE_STRING LongName, IN BOOLEAN KeyByShortName, IN ULONG DataLength, IN PVOID Data)
Definition: tunnel.c:341
BOOLEAN NTAPI FsRtlFindInTunnelCache(IN PTUNNEL Cache, IN ULONGLONG DirectoryKey, IN PUNICODE_STRING Name, OUT PUNICODE_STRING ShortName, OUT PUNICODE_STRING LongName, IN OUT PULONG DataLength, OUT PVOID Data)
Definition: tunnel.c:765
#define ok(value,...)
Definition: bufpool.h:45
__wchar_t WCHAR
Definition: xmlstorage.h:180
VOID NTAPI FsRtlInitializeTunnelCache(IN PTUNNEL Cache)
Definition: tunnel.c:891
static const WCHAR L[]
Definition: oid.c:1250
#define ExAllocatePool(type, size)
Definition: fbtusb.h:44
_In_ ULONGLONG _In_ PUNICODE_STRING _In_ PUNICODE_STRING LongName
Definition: fsrtlfuncs.h:336
unsigned int ULONG
Definition: retypes.h:1
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:261
#define ok_eq_uint(value, expected)
Definition: kmt_test.h:239
VOID NTAPI FsRtlDeleteTunnelCache(IN PTUNNEL Cache)
Definition: tunnel.c:690
IN BOOLEAN OUT PSTR Buffer
Definition: progress.h:34
#define ExFreePool(addr)
Definition: env_spec_w32.h:352

Referenced by START_TEST().

◆ START_TEST()

START_TEST ( FsRtlTunnel  )

Definition at line 234 of file FsRtlTunnel.c.

235 {
236  UNICODE_STRING s_name;
237  UNICODE_STRING l_name;
240  BOOLEAN is;
241 
242  //Initialize Cash
244 
245  s_name.Length = 0;
246  s_name.MaximumLength = 64 * sizeof(WCHAR);
247  s_name.Buffer = ExAllocatePoolWithTag(PagedPool, s_name.MaximumLength, 'sFmK');
248  ok(s_name.Buffer != NULL, "s_name.Buffer in TestFsRtlAddToTunnelCache is NULL after allocated memory\n");
249  RtlAppendUnicodeToString(&s_name, L"smal");
250 
251  l_name.Length = 0;
252  l_name.MaximumLength = 64 * sizeof(WCHAR);
253  l_name.Buffer = ExAllocatePoolWithTag(PagedPool, l_name.MaximumLength, 'lFmK');
254  ok(l_name.Buffer != NULL, "l_name.Buffer in TestFsRtlAddToTunnelCache is NULL after allocated memory\n");
255  RtlAppendUnicodeToString(&l_name, L"bigbigbigbigbig");
256 
257  // Add elem
258  TestFsRtlAddToTunnelCache(12345, &s_name, &l_name, TRUE);
259 
260  name.Length = 0;
261  name.MaximumLength = 64 * sizeof(WCHAR);
262  name.Buffer = ExAllocatePoolWithTag(PagedPool, name.MaximumLength, 'nFmK');
263  ok(name.Buffer != NULL, "name.Buffer in FsRtlFindInTunnelCache is NULL after allocated memory\n");
265 
266  // Find
267  is = TestFsRtlFindInTunnelCache(12345, &name, &s_name, &l_name);
268  ok(is == TRUE, "FsRtlFindInTunnelCache dosn't find elem id = 12345\n");
269 
270  TestFsRtlDeleteKeyFromTunnelCache(12345); //Delete
271  is = TestFsRtlFindInTunnelCache(12345, &name, &s_name, &l_name);
272  ok(is == FALSE, "TestFsRtlDeleteKeyFromTunnelCache dosn't delete elem id = 12345\n");
273 
274  is = TestFsRtlFindInTunnelCache(12347, &name, &s_name, &l_name);
275  ok(is == FALSE, "FsRtlDeleteTunnelCache dosn't clear cash\n");
276 
277  TestFsRtlAddToTunnelCache(12345, &s_name, &l_name, TRUE);
278  TestFsRtlAddToTunnelCache(12347, &s_name, &l_name, TRUE);
280  TestFsRtlAddToTunnelCache(12346, &a, &l_name, FALSE);
281 
282  //Clear all
284 
285  is = TestFsRtlFindInTunnelCache(12345, &name, &s_name, &l_name);
286  ok(is == FALSE, "FsRtlDeleteTunnelCache dosn't clear cash\n");
287 
288  is = TestFsRtlFindInTunnelCache(12346, &name, &a, &l_name);
289  ok(is == FALSE, "FsRtlDeleteTunnelCache dosn't clear cash\n");
290 
291  is = TestFsRtlFindInTunnelCache(12347, &name, &s_name, &l_name);
292  ok(is == FALSE, "FsRtlDeleteTunnelCache dosn't clear cash\n");
293 
294  ExFreePoolWithTag(name.Buffer, 'nFmK');
295  ExFreePoolWithTag(l_name.Buffer, 'lFmK');
296  ExFreePoolWithTag(s_name.Buffer, 'sFmK');
297 
298  ExFreePool(Tb);
299  ExFreePool(T);
300 
301  DuplicatesTest();
302 }
#define TRUE
Definition: types.h:120
USHORT MaximumLength
Definition: env_spec_w32.h:370
static PTUNNEL T
Definition: FsRtlTunnel.c:25
#define a
Definition: ke_i.h:78
#define ok(value,...)
unsigned char BOOLEAN
smooth NULL
Definition: ftsmooth.c:416
BOOLEAN TestFsRtlFindInTunnelCache(ULONG DirectoryKey, PUNICODE_STRING name, PUNICODE_STRING s_name, PUNICODE_STRING l_name)
Definition: FsRtlTunnel.c:109
NTSTATUS RtlAppendUnicodeToString(IN PUNICODE_STRING Str1, IN PWSTR Str2)
Definition: string_lib.cpp:62
void TestFsRtlDeleteKeyFromTunnelCache(ULONGLONG a)
Definition: FsRtlTunnel.c:119
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
static const WCHAR L[]
Definition: oid.c:1250
static void DuplicatesTest()
Definition: FsRtlTunnel.c:125
void TestFsRtlAddToTunnelCache(ULONGLONG DirectoryKey, PUNICODE_STRING s_name, PUNICODE_STRING l_name, BOOLEAN KeyByShortName)
Definition: FsRtlTunnel.c:67
void TestFsRtlInitializeTunnelCache()
Definition: FsRtlTunnel.c:49
Definition: name.c:36
static PTUNNEL Tb
Definition: FsRtlTunnel.c:26
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
#define ExFreePoolWithTag(_P, _T)
Definition: module.h:1099
GLboolean GLboolean GLboolean GLboolean a
Definition: glext.h:6204
VOID NTAPI FsRtlDeleteTunnelCache(IN PTUNNEL Cache)
Definition: tunnel.c:690
#define ExFreePool(addr)
Definition: env_spec_w32.h:352
GLuint const GLchar * name
Definition: glext.h:6031

◆ TestFsRtlAddToTunnelCache()

void TestFsRtlAddToTunnelCache ( ULONGLONG  DirectoryKey,
PUNICODE_STRING  s_name,
PUNICODE_STRING  l_name,
BOOLEAN  KeyByShortName 
)

Definition at line 67 of file FsRtlTunnel.c.

68 {
69  SIZE_T eq;
70  LONG b;
71  PUNICODE_STRING bs_name;
72  PUNICODE_STRING bl_name;
73  PVOID Bufb;
74  PVOID Buf;
75 
77  ok(Buf != NULL, "Buff in TestFsRtlAddToTunnelCache is NULL after allocated memory\n");
79  ok(Bufb != NULL, "Buff in TestFsRtlAddToTunnelCache is NULL after allocated memory\n");
80 
81  // Allocate memory for the bufs_name
82  bs_name = CopyUS(s_name);
83 
84  // Allocate memory for the l_name and bl_name
85  bl_name = CopyUS(l_name);
86 
87  memset((void*)Buf, 0, BufSize);
88  memset((void*)Bufb, 0, BufSize);
89 
91 
92  eq = RtlCompareMemory((const VOID*)Buf, (const VOID*)Bufb, BufSize);
93 
94  ok( eq != sizeof(TUNNEL),"FsRtlAddToTunnelCache function did not change anything in the memory at the address Buf.\n");
95 
96  b = RtlCompareUnicodeString(l_name, bl_name, TRUE);
97  ok (b == 0, "long name after call FsRtlAddToTunnelCache != long name befo call FsRtlAddToTunnelCache\n\n");
98  b = RtlCompareUnicodeString(s_name, bs_name, TRUE);
99  ok (b == 0, "short name after call FsRtlAddToTunnelCache != short name befo call FsRtlAddToTunnelCache\n\n");
100 
101  if (bs_name->Buffer) ExFreePool(bs_name->Buffer);
102  ExFreePool(bs_name);
103  if (bl_name->Buffer) ExFreePool(bl_name->Buffer);
104  ExFreePool(bl_name);
105  ExFreePool(Bufb);
106  ExFreePool(Buf);
107 }
#define TRUE
Definition: types.h:120
#define eq(received, expected, label, type)
Definition: locale.c:144
static PTUNNEL T
Definition: FsRtlTunnel.c:25
VOID NTAPI FsRtlAddToTunnelCache(IN PTUNNEL Cache, IN ULONGLONG DirectoryKey, IN PUNICODE_STRING ShortName, IN PUNICODE_STRING LongName, IN BOOLEAN KeyByShortName, IN ULONG DataLength, IN PVOID Data)
Definition: tunnel.c:341
long LONG
Definition: pedump.c:60
#define ok(value,...)
smooth NULL
Definition: ftsmooth.c:416
#define BufSize
Definition: FsRtlTunnel.c:28
_In_ ULONGLONG _In_ PUNICODE_STRING _In_ PUNICODE_STRING _In_ BOOLEAN KeyByShortName
Definition: fsrtlfuncs.h:336
#define b
Definition: ke_i.h:79
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
_In_ ULONGLONG DirectoryKey
Definition: fsrtlfuncs.h:336
ULONG RtlCompareUnicodeString(PUNICODE_STRING s1, PUNICODE_STRING s2, BOOLEAN UpCase)
Definition: string_lib.cpp:31
#define ExAllocatePool(type, size)
Definition: fbtusb.h:44
PUNICODE_STRING CopyUS(PUNICODE_STRING a)
Definition: FsRtlTunnel.c:30
ULONG_PTR SIZE_T
Definition: typedefs.h:78
#define memset(x, y, z)
Definition: compat.h:39
#define ExFreePool(addr)
Definition: env_spec_w32.h:352
#define RtlCompareMemory(s1, s2, l)
Definition: env_spec_w32.h:465

Referenced by START_TEST().

◆ TestFsRtlDeleteKeyFromTunnelCache()

void TestFsRtlDeleteKeyFromTunnelCache ( ULONGLONG  a)

Definition at line 119 of file FsRtlTunnel.c.

120 {
122 }
VOID NTAPI FsRtlDeleteKeyFromTunnelCache(IN PTUNNEL Cache, IN ULONGLONG DirectoryKey)
Definition: tunnel.c:588
static PTUNNEL T
Definition: FsRtlTunnel.c:25
GLboolean GLboolean GLboolean GLboolean a
Definition: glext.h:6204

Referenced by START_TEST().

◆ TestFsRtlFindInTunnelCache()

BOOLEAN TestFsRtlFindInTunnelCache ( ULONG  DirectoryKey,
PUNICODE_STRING  name,
PUNICODE_STRING  s_name,
PUNICODE_STRING  l_name 
)

Definition at line 109 of file FsRtlTunnel.c.

110 {
111  // Allocate memory for the Buf
112  ULONG BufsizeTemp = BufSize;
114  ok(Buf != NULL, "Buff in FsRtlFindInTunnelCache is NULL after allocated memory\n");
115 
116  return FsRtlFindInTunnelCache(T, DirectoryKey, name, s_name, l_name, &BufsizeTemp, Buf);
117 }
static PTUNNEL T
Definition: FsRtlTunnel.c:25
BOOLEAN NTAPI FsRtlFindInTunnelCache(IN PTUNNEL Cache, IN ULONGLONG DirectoryKey, IN PUNICODE_STRING Name, OUT PUNICODE_STRING ShortName, OUT PUNICODE_STRING LongName, IN OUT PULONG DataLength, OUT PVOID Data)
Definition: tunnel.c:765
#define ok(value,...)
smooth NULL
Definition: ftsmooth.c:416
#define BufSize
Definition: FsRtlTunnel.c:28
_In_ ULONGLONG DirectoryKey
Definition: fsrtlfuncs.h:336
#define ExAllocatePool(type, size)
Definition: fbtusb.h:44
Definition: name.c:36
unsigned int ULONG
Definition: retypes.h:1

Referenced by START_TEST().

◆ TestFsRtlInitializeTunnelCache()

void TestFsRtlInitializeTunnelCache ( )

Definition at line 49 of file FsRtlTunnel.c.

50 {
51  SIZE_T eq;
52  T = ExAllocatePool(PagedPool, sizeof(TUNNEL));
53  ok(T != NULL, "PTUNEL is NULL after allocated memory\n");
54  Tb = ExAllocatePool(PagedPool, sizeof(TUNNEL));
55  ok(Tb != NULL, "PTUNEL is NULL after allocated memory\n");
56 
57  memset((void*)T, 0, sizeof(TUNNEL));
58  memset((void*)Tb, 0, sizeof(TUNNEL));
59 
61 
62  eq = RtlCompareMemory((const VOID*)T, (const VOID*)Tb, sizeof(TUNNEL));
63 
64  ok ( eq != sizeof(TUNNEL), "FsRtlInitializeTunnelCache function did not change anything in the memory at the address PTUNEL.\n");
65 }
#define eq(received, expected, label, type)
Definition: locale.c:144
static PTUNNEL T
Definition: FsRtlTunnel.c:25
#define ok(value,...)
smooth NULL
Definition: ftsmooth.c:416
VOID NTAPI FsRtlInitializeTunnelCache(IN PTUNNEL Cache)
Definition: tunnel.c:891
#define ExAllocatePool(type, size)
Definition: fbtusb.h:44
ULONG_PTR SIZE_T
Definition: typedefs.h:78
static PTUNNEL Tb
Definition: FsRtlTunnel.c:26
#define memset(x, y, z)
Definition: compat.h:39
#define RtlCompareMemory(s1, s2, l)
Definition: env_spec_w32.h:465

Referenced by START_TEST().

Variable Documentation

◆ T

◆ Tb

PTUNNEL Tb
static

Definition at line 26 of file FsRtlTunnel.c.

Referenced by START_TEST(), SwapSplayLinks(), and TestFsRtlInitializeTunnelCache().