2 * PROJECT: ReactOS api tests
3 * LICENSE: GPLv2+ - See COPYING in the top level directory
4 * PURPOSE: Test for the Rtl*MemoryStream* series of functions
5 * PROGRAMMER: David Quintana <gigaherz@gmail.com>
11 #include <ndk/rtlfuncs.h>
15 ULONG finalReleaseCallCount
= 0;
19 CustomFinalReleaseMemoryStream(PRTL_MEMORY_STREAM stream
)
21 finalReleaseCallCount
++;
22 trace("FinalRelease CALLED.\n");
27 CustomFinalReleaseOutOfProcessMemoryStream(PRTL_MEMORY_STREAM stream
)
29 finalReleaseCallCount
++;
30 trace("FinalRelease CALLED.\n");
31 RtlFinalReleaseOutOfProcessMemoryStream(stream
);
34 BOOL
CompareStructsAndSaveForLater(PRTL_MEMORY_STREAM pold
, PRTL_MEMORY_STREAM pnew
, PSTR at
)
39 if (pold
->Vtbl
!= pnew
->Vtbl
) { if (equal
) { trace("%s: \n", at
); equal
= FALSE
; } trace("Vtbl changed from %p to %p\n", pold
->Vtbl
, pnew
->Vtbl
);}
40 if (pold
->RefCount
!= pnew
->RefCount
) { if (equal
) { trace("%s: \n", at
); equal
= FALSE
; } trace("RefCount changed from %p to %p\n", pold
->RefCount
, pnew
->RefCount
); }
41 if (pold
->Unk1
!= pnew
->Unk1
) { if (equal
) { trace("%s: \n", at
); equal
= FALSE
; } trace("Unk1 changed from %p to %p\n", pold
->Unk1
, pnew
->Unk1
); }
42 if (pold
->Current
!= pnew
->Current
) { if (equal
) { trace("%s: \n", at
); equal
= FALSE
; } trace("Current changed from %p to %p\n", pold
->Current
, pnew
->Current
); }
43 if (pold
->Start
!= pnew
->Start
) { if (equal
) { trace("%s: \n", at
); equal
= FALSE
; } trace("Start changed from %p to %p\n", pold
->Start
, pnew
->Start
); }
44 if (pold
->End
!= pnew
->End
) { if (equal
) { trace("%s: \n", at
); equal
= FALSE
; } trace("End changed from %p to %p\n", pold
->End
, pnew
->End
); }
45 if (pold
->FinalRelease
!= pnew
->FinalRelease
) { if (equal
) { trace("%s: \n", at
); equal
= FALSE
; } trace("FinalRelease changed from %p to %p\n", pold
->FinalRelease
, pnew
->FinalRelease
); }
46 if (pold
->ProcessHandle
!= pnew
->ProcessHandle
) { if (equal
) { trace("%s: \n", at
); equal
= FALSE
; } trace("ProcessHandle changed from %p to %p\n", pold
->ProcessHandle
, pnew
->ProcessHandle
); }
49 pold
->Vtbl
= pnew
->Vtbl
;
50 pold
->RefCount
= pnew
->RefCount
;
51 pold
->Unk1
= pnew
->Unk1
;
52 pold
->Current
= pnew
->Current
;
53 pold
->Start
= pnew
->Start
;
54 pold
->End
= pnew
->End
;
55 pold
->FinalRelease
= pnew
->FinalRelease
;
56 pold
->ProcessHandle
= pnew
->ProcessHandle
;
68 RTL_MEMORY_STREAM stream
;
69 RTL_MEMORY_STREAM previous
;
79 finalReleaseCallCount
= 0;
81 for (i
= 0; i
< sizeof(buffer2
); i
++)
83 buffer2
[i
] = i
% UCHAR_MAX
;
86 memset(&stream
, 0x90, sizeof(stream
));
87 memset(&previous
, 0x00, sizeof(previous
));
90 RtlInitMemoryStream(NULL
);
91 EndSeh(STATUS_ACCESS_VIOLATION
);
94 RtlInitMemoryStream(&stream
);
95 EndSeh(STATUS_SUCCESS
);
97 CompareStructsAndSaveForLater(&previous
, &stream
, "After init");
99 ok(stream
.RefCount
== 0, "RefCount has a wrong value: %d (expected %d).\n", stream
.RefCount
, 0);
101 stream
.Current
= buffer2
;
102 stream
.Start
= buffer2
;
103 stream
.End
= buffer2
+ sizeof(buffer2
);
104 stream
.FinalRelease
= CustomFinalReleaseMemoryStream
;
106 CompareStructsAndSaveForLater(&previous
, &stream
, "After assigning");
109 res
= IStream_QueryInterface((struct IStream
*)&stream
, NULL
, NULL
);
110 ok(res
== E_INVALIDARG
, "QueryInterface to IStream returned wrong hResult: 0x%08x.\n", res
);
111 ok(stream
.RefCount
== 0, "RefCount has a wrong value: %d (expected %d).\n", stream
.RefCount
, 2);
112 EndSeh(STATUS_ACCESS_VIOLATION
);
115 res
= IStream_QueryInterface((struct IStream
*)&stream
, &IID_IStream
, NULL
);
116 ok(res
== E_INVALIDARG
, "QueryInterface to IStream returned wrong hResult: 0x%08x.\n", res
);
117 ok(stream
.RefCount
== 1, "RefCount has a wrong value: %d (expected %d).\n", stream
.RefCount
, 2);
118 EndSeh(STATUS_ACCESS_VIOLATION
);
121 res
= IStream_QueryInterface((struct IStream
*)&stream
, NULL
, (void**)&istream
);
122 ok(res
== E_INVALIDARG
, "QueryInterface to IStream returned wrong hResult: 0x%08x.\n", res
);
123 ok(stream
.RefCount
== 1, "RefCount has a wrong value: %d (expected %d).\n", stream
.RefCount
, 2);
124 EndSeh(STATUS_ACCESS_VIOLATION
);
127 res
= IStream_QueryInterface((struct IStream
*)&stream
, &IID_IStream
, (void**)&istream
);
128 ok(res
== S_OK
, "QueryInterface to IStream returned wrong hResult: 0x%08x.\n", res
);
129 ok(stream
.RefCount
== 2, "RefCount has a wrong value: %d (expected %d).\n", stream
.RefCount
, 2);
130 EndSeh(STATUS_SUCCESS
);
132 CompareStructsAndSaveForLater(&previous
, &stream
, "After QueryInterface");
135 res
= IStream_Stat(istream
, NULL
, 0);
136 ok(res
== STG_E_INVALIDPOINTER
, "Stat to IStream returned wrong hResult: 0x%08x.\n", res
);
137 EndSeh(STATUS_SUCCESS
);
140 res
= IStream_Stat(istream
, &stat
, STATFLAG_NONAME
);
141 ok(res
== S_OK
, "Stat to IStream returned wrong hResult: 0x%08x.\n", res
);
142 EndSeh(STATUS_SUCCESS
);
144 ok(stream
.Current
== buffer2
,
145 "stream.Current points to the wrong address 0x%p (expected 0x%p)\n",
146 stream
.Current
, buffer2
);
147 ok(stream
.Start
== buffer2
, "stream.Start was changed unexpectedly\n");
148 ok(stream
.End
== buffer2
+ sizeof(buffer2
), "stream.End was changed unexpectedly\n");
150 ok(stat
.cbSize
.QuadPart
== ((PUCHAR
)stream
.End
- (PUCHAR
)stream
.Start
),
151 "stat.cbSize has the wrong value %lld (expected %d)\n",
152 stat
.cbSize
.QuadPart
, (PUCHAR
)stream
.End
- (PUCHAR
)stream
.Start
);
154 CompareStructsAndSaveForLater(&previous
, &stream
, "After Stat");
157 res
= IStream_AddRef(istream
);
158 ok(res
== 3, "AddRef to IStream returned wrong hResult: %d.\n", res
);
159 EndSeh(STATUS_SUCCESS
);
162 res
= IStream_AddRef(istream
);
163 ok(res
== 4, "AddRef to IStream returned wrong hResult: %d.\n", res
);
164 EndSeh(STATUS_SUCCESS
);
167 res
= IStream_Release(istream
);
168 ok(res
== 3, "Release to IStream returned wrong hResult: %d.\n", res
);
169 EndSeh(STATUS_SUCCESS
);
172 res
= IStream_AddRef(istream
);
173 ok(res
== 4, "AddRef to IStream returned wrong hResult: %d.\n", res
);
174 EndSeh(STATUS_SUCCESS
);
177 res
= IStream_Release(istream
);
178 ok(res
== 3, "Release to IStream returned wrong hResult: %d.\n", res
);
179 EndSeh(STATUS_SUCCESS
);
182 res
= IStream_Release(istream
);
183 ok(res
== 2, "Release to IStream returned wrong hResult: %d.\n", res
);
184 EndSeh(STATUS_SUCCESS
);
186 CompareStructsAndSaveForLater(&previous
, &stream
, "After AddRef");
189 res
= IStream_Read(istream
, NULL
, 0, &bytesRead
);
190 ok(res
== S_OK
, "Read to IStream returned wrong hResult: 0x%08x.\n", res
);
191 EndSeh(STATUS_SUCCESS
);
194 res
= IStream_Read(istream
, buffer
, 40, NULL
);
195 ok(res
== S_OK
, "Read to IStream returned wrong hResult: 0x%08x.\n", res
);
196 EndSeh(STATUS_ACCESS_VIOLATION
);
199 res
= IStream_Read(istream
, buffer
+ 40, 39, &bytesRead
);
200 ok(res
== S_OK
, "Read to IStream returned wrong hResult: 0x%08x.\n", res
);
201 EndSeh(STATUS_SUCCESS
);
206 for (i
= 0; i
< bytesRead
; i
++)
208 ok(buffer
[i
] == i
, "Buffer[%d] contains a wrong number %d (expected %d).\n", i
, buffer
[i
], i
);
212 ok(stream
.Current
== buffer2
+ 79,
213 "stream.Current points to the wrong address 0x%p (expected 0x%p)\n",
214 stream
.Current
, buffer2
);
215 ok(stream
.Start
== buffer2
, "stream.Start was changed unexpectedly\n");
216 ok(stream
.End
== buffer2
+ sizeof(buffer2
), "stream.End was changed unexpectedly\n");
218 CompareStructsAndSaveForLater(&previous
, &stream
, "After Read 1");
220 size
.QuadPart
= 0x9090909090909090ull
;
224 res
= IStream_Seek(istream
, move
, STREAM_SEEK_END
, &size
);
225 ok(res
== STG_E_INVALIDPOINTER
, "Seek to IStream returned wrong hResult: 0x%08x.\n", res
);
226 ok(size
.QuadPart
== 0x9090909090909090ull
, "Seek modified the new location in an error (0x%08x,0x%08x).\n", size
.HighPart
, size
.LowPart
);
227 EndSeh(STATUS_SUCCESS
);
231 res
= IStream_Seek(istream
, move
, STREAM_SEEK_END
, &size
);
232 ok(res
== S_OK
, "Seek to IStream returned wrong hResult: 0x%08x.\n", res
);
233 ok(size
.QuadPart
== (PUCHAR
)stream
.End
- (PUCHAR
)stream
.Start
, "Seek new location unexpected value: 0x%08x.\n", size
.LowPart
);
234 EndSeh(STATUS_SUCCESS
);
236 size
.QuadPart
= 0x9090909090909090ull
;
240 res
= IStream_Seek(istream
, move
, STREAM_SEEK_END
, &size
);
241 ok(res
== S_OK
, "Seek to IStream returned wrong hResult: 0x%08x.\n", res
);
242 ok(size
.QuadPart
== (PUCHAR
)stream
.End
- (PUCHAR
)stream
.Start
- 1, "Seek new location unexpected value: 0x%08x.\n", size
.LowPart
);
243 EndSeh(STATUS_SUCCESS
);
245 size
.QuadPart
= 0x9090909090909090ull
;
249 res
= IStream_Seek(istream
, move
, STREAM_SEEK_END
, &size
);
250 ok(res
== S_OK
, "Seek to IStream returned wrong hResult: 0x%08x.\n", res
);
251 ok(size
.QuadPart
== (PUCHAR
)stream
.End
- (PUCHAR
)stream
.Start
- 2, "Seek new location unexpected value: 0x%08x.\n", size
.LowPart
);
252 EndSeh(STATUS_SUCCESS
);
254 size
.QuadPart
= 0x9090909090909090ull
;
258 res
= IStream_Seek(istream
, move
, STREAM_SEEK_SET
, &size
);
259 ok(res
== STG_E_INVALIDPOINTER
, "Seek to IStream returned wrong hResult: 0x%08x.\n", res
);
260 ok(size
.QuadPart
== 0x9090909090909090ull
, "Seek modified the new location in an error.\n");
261 EndSeh(STATUS_SUCCESS
);
264 move
.QuadPart
= 4000;
265 res
= IStream_Seek(istream
, move
, STREAM_SEEK_SET
, &size
);
266 ok(res
== STG_E_INVALIDPOINTER
, "Seek to IStream returned wrong hResult: 0x%08x.\n", res
);
267 ok(size
.QuadPart
== 0x9090909090909090ull
, "Seek modified the new location in an error.\n");
268 EndSeh(STATUS_SUCCESS
);
271 move
.QuadPart
= 0x100000000ull
;
272 res
= IStream_Seek(istream
, move
, STREAM_SEEK_SET
, &size
);
274 ok(res
== STG_E_INVALIDPOINTER
, "Seek to IStream returned wrong hResult: 0x%08x.\n", res
);
275 ok(size
.QuadPart
== 0x9090909090909090ull
, "Seek modified the new location in an error (0x%08x,0x%08x).\n", size
.HighPart
, size
.LowPart
);
277 ok(res
== S_OK
, "Seek to IStream returned wrong hResult: 0x%08x.\n", res
);
278 ok(size
.QuadPart
== 0, "Seek new location unexpected value: 0x%08x.\n", size
.LowPart
);
280 EndSeh(STATUS_SUCCESS
);
285 res
= IStream_Seek(istream
, move
, STREAM_SEEK_SET
, &size
);
286 ok(res
== S_OK
, "Seek to IStream returned wrong hResult: 0x%08x.\n", res
);
287 ok(size
.QuadPart
== 0, "Seek new location unexpected value: 0x%08x.\n", size
.LowPart
);
288 EndSeh(STATUS_SUCCESS
);
291 size
.QuadPart
= 0x9090909090909090ull
;
295 res
= IStream_Seek(istream
, move
, STREAM_SEEK_CUR
, &size
);
296 ok(res
== STG_E_INVALIDPOINTER
, "Seek to IStream returned wrong hResult: 0x%08x.\n", res
);
297 ok(size
.QuadPart
== 0x9090909090909090ull
, "Seek modified the new location in an error (0x%08x,0x%08x).\n", size
.HighPart
, size
.LowPart
);
298 EndSeh(STATUS_SUCCESS
);
301 move
.QuadPart
= 0x100000000ull
;
302 res
= IStream_Seek(istream
, move
, STREAM_SEEK_CUR
, &size
);
304 ok(res
== STG_E_INVALIDPOINTER
, "Seek to IStream returned wrong hResult: 0x%08x.\n", res
);
305 ok(size
.QuadPart
== 0x9090909090909090ull
, "Seek modified the new location in an error (0x%08x,0x%08x).\n", size
.HighPart
, size
.LowPart
);
307 ok(res
== S_OK
, "Seek to IStream returned wrong hResult: 0x%08x.\n", res
);
308 ok(size
.QuadPart
== 0, "Seek new location unexpected value: 0x%08x.\n", size
.LowPart
);
310 EndSeh(STATUS_SUCCESS
);
314 res
= IStream_Seek(istream
, move
, STREAM_SEEK_SET
, &size
);
315 ok(res
== S_OK
, "Seek to IStream returned wrong hResult: 0x%08x.\n", res
);
316 EndSeh(STATUS_SUCCESS
);
318 ok(size
.QuadPart
== 40,
319 "Seek returned wrong offset %lld (expected %d)\n",
322 ok(stream
.Current
== buffer2
+ 40,
323 "stream.Current points to the wrong address 0x%p (expected 0x%p)\n",
324 stream
.Current
, buffer2
);
325 ok(stream
.Start
== buffer2
, "stream.Start was changed unexpectedly\n");
326 ok(stream
.End
== buffer2
+ sizeof(buffer2
), "stream.End was changed unexpectedly\n");
328 CompareStructsAndSaveForLater(&previous
, &stream
, "After Seek");
330 res
= IStream_Read(istream
, buffer
, sizeof(buffer
), &bytesRead
);
332 ok(res
== S_OK
, "Read to IStream returned wrong hResult: 0x%08x.\n", res
);
336 for (i
= 0; i
< bytesRead
; i
++)
338 ok(buffer
[i
] == (i
+ 40), "Buffer[%d] contains a wrong number %d (expected %d).\n", i
, buffer
[i
], i
+ 40);
342 ok(stream
.Current
== buffer2
+ 40 + sizeof(buffer
),
343 "stream.Current points to the wrong address 0x%p (expected 0x%p)\n",
344 stream
.Current
, buffer2
);
345 ok(stream
.Start
== buffer2
, "stream.Start was changed unexpectedly\n");
346 ok(stream
.End
== buffer2
+ sizeof(buffer2
), "stream.End was changed unexpectedly\n");
348 CompareStructsAndSaveForLater(&previous
, &stream
, "After Read 2");
350 res
= IStream_Release(istream
);
352 ok(res
== 1, "Release to IStream returned wrong hResult: 0x%08x.\n", res
);
354 ok(stream
.RefCount
== 1, "RefCount has a wrong value: %d (expected %d).\n", stream
.RefCount
, 1);
356 res
= IStream_Release(istream
);
358 ok(res
== S_OK
, "Release to IStream returned wrong hResult: 0x%08x.\n", res
);
360 ok(stream
.RefCount
== 0, "RefCount has a wrong value: %d (expected %d).\n", stream
.RefCount
, 0);
362 ok(finalReleaseCallCount
== 1, "FinalRelease was called %d times instead of 1.\n", finalReleaseCallCount
);
365 void test_OutOfProcess()
373 RTL_MEMORY_STREAM stream
;
374 RTL_MEMORY_STREAM previous
;
384 finalReleaseCallCount
= 0;
386 for (i
= 0; i
< sizeof(buffer2
); i
++)
388 buffer2
[i
] = i
% UCHAR_MAX
;
391 memset(&stream
, 0x90, sizeof(stream
));
392 memset(&previous
, 0x00, sizeof(previous
));
394 process
= GetCurrentProcess();
396 RtlInitOutOfProcessMemoryStream(&stream
);
398 ok(stream
.FinalRelease
== RtlFinalReleaseOutOfProcessMemoryStream
,
399 "stream.FinalRelease unexpected %p != %p.\n",
400 stream
.FinalRelease
, RtlFinalReleaseOutOfProcessMemoryStream
);
402 ok(stream
.RefCount
== 0, "RefCount has a wrong value: %d (expected %d).\n", stream
.RefCount
, 0);
404 CompareStructsAndSaveForLater(&previous
, &stream
, "After init");
406 stream
.Current
= buffer2
;
407 stream
.Start
= buffer2
;
408 stream
.End
= buffer2
+ sizeof(buffer2
);
409 stream
.ProcessHandle
= process
;
410 stream
.FinalRelease
= CustomFinalReleaseOutOfProcessMemoryStream
;
412 CompareStructsAndSaveForLater(&previous
, &stream
, "After assigning");
414 res
= IStream_QueryInterface((struct IStream
*)&stream
, &IID_IStream
, (void**)&istream
);
416 ok(res
== S_OK
, "QueryInterface to IStream returned wrong hResult: 0x%08x.\n", res
);
418 ok(stream
.RefCount
== 1, "RefCount has a wrong value: %d (expected %d).\n", stream
.RefCount
, 1);
420 ok(stream
.ProcessHandle
== process
,
421 "ProcessHandle changed unexpectedly: 0x%08x (expected 0x%p)\n",
422 stream
.ProcessHandle
, process
);
424 CompareStructsAndSaveForLater(&previous
, &stream
, "After QueryInterface");
426 res
= IStream_Stat(istream
, &stat
, STATFLAG_NONAME
);
428 ok(res
== S_OK
, "Stat to IStream returned wrong hResult: 0x%08x.\n", res
);
430 ok(stream
.Current
== buffer2
,
431 "stream.Current points to the wrong address 0x%p (expected 0x%p)\n",
432 stream
.Current
, buffer2
);
433 ok(stream
.Start
== buffer2
, "stream.Start was changed unexpectedly\n");
434 ok(stream
.End
== buffer2
+ sizeof(buffer2
), "stream.End was changed unexpectedly\n");
435 ok(stream
.ProcessHandle
== process
,
436 "ProcessHandle changed unexpectedly: 0x%08x (expected 0x%p)\n",
437 stream
.ProcessHandle
, process
);
439 ok(stat
.cbSize
.QuadPart
== ((PUCHAR
)stream
.End
- (PUCHAR
)stream
.Start
),
440 "stat.cbSize has the wrong value %lld (expected %d)\n",
441 stat
.cbSize
.QuadPart
, (PUCHAR
)stream
.End
- (PUCHAR
)stream
.Start
);
443 CompareStructsAndSaveForLater(&previous
, &stream
, "After Stat");
445 res
= IStream_Read(istream
, buffer
, sizeof(buffer
), &bytesRead
);
447 ok(res
== S_OK
, "Read to IStream returned wrong hResult: 0x%08x.\n", res
);
451 for (i
= 0; i
< bytesRead
; i
++)
453 ok(buffer
[i
] == i
, "Buffer[%d] contains a wrong number %d (expected %d).\n", i
, buffer
[i
], i
);
457 ok(stream
.Current
== buffer2
+ sizeof(buffer
),
458 "stream.Current points to the wrong address 0x%p (expected 0x%p)\n",
459 stream
.Current
, buffer2
);
460 ok(stream
.Start
== buffer2
, "stream.Start was changed unexpectedly\n");
461 ok(stream
.End
== buffer2
+ sizeof(buffer2
), "stream.End was changed unexpectedly\n");
462 ok(stream
.ProcessHandle
== process
,
463 "ProcessHandle changed unexpectedly: 0x%08x (expected 0x%p)\n",
464 stream
.ProcessHandle
, process
);
466 CompareStructsAndSaveForLater(&previous
, &stream
, "After Read 1");
470 res
= IStream_Seek(istream
, move
, STREAM_SEEK_SET
, &size
);
472 ok(res
== S_OK
, "Seek to IStream returned wrong hResult: 0x%08x.\n", res
);
474 ok(size
.QuadPart
== 40,
475 "Seek returned wrong offset %lld (expected %d)\n",
478 ok(stream
.Current
== buffer2
+ 40,
479 "stream.Current points to the wrong address 0x%p (expected 0x%p)\n",
480 stream
.Current
, buffer2
);
481 ok(stream
.Start
== buffer2
, "stream.Start was changed unexpectedly\n");
482 ok(stream
.End
== buffer2
+ sizeof(buffer2
), "stream.End was changed unexpectedly\n");
483 ok(stream
.ProcessHandle
== process
,
484 "ProcessHandle changed unexpectedly: 0x%08x (expected 0x%p)\n",
485 stream
.ProcessHandle
, process
);
487 CompareStructsAndSaveForLater(&previous
, &stream
, "After Seek");
489 res
= IStream_Read(istream
, buffer
, sizeof(buffer
), &bytesRead
);
491 ok(res
== S_OK
, "Read to IStream returned wrong hResult: 0x%08x.\n", res
);
495 for (i
= 0; i
< bytesRead
; i
++)
497 ok(buffer
[i
] == (i
+ 40), "Buffer[%d] contains a wrong number %d (expected %d).\n", i
, buffer
[i
], i
+ 40);
501 ok(stream
.Current
== buffer2
+ 40 + sizeof(buffer
),
502 "stream.Current points to the wrong address 0x%p (expected 0x%p)\n",
503 stream
.Current
, buffer2
);
504 ok(stream
.Start
== buffer2
, "stream.Start was changed unexpectedly\n");
505 ok(stream
.End
== buffer2
+ sizeof(buffer2
), "stream.End was changed unexpectedly\n");
506 ok(stream
.ProcessHandle
== process
,
507 "ProcessHandle changed unexpectedly: 0x%08x (expected 0x%p)\n",
508 stream
.ProcessHandle
, process
);
510 CompareStructsAndSaveForLater(&previous
, &stream
, "After Read 2");
512 res
= IStream_Release(istream
);
514 ok(res
== S_OK
, "Release to IStream returned wrong hResult: 0x%08x.\n", res
);
516 ok(stream
.RefCount
== 0, "RefCount has a wrong value: %d (expected %d).\n", stream
.RefCount
, 0);
518 ok(finalReleaseCallCount
== 1, "FinalRelease was called %d times instead of 1.\n", finalReleaseCallCount
);
521 START_TEST(RtlMemoryStream
)