21 trace(
"FinalRelease CALLED.\n");
29 trace(
"FinalRelease CALLED.\n");
38 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);}
39 if (pold->RefCount != pnew->RefCount) {
if (
equal) {
trace(
"%s:\n", at);
equal =
FALSE; }
trace(
"RefCount changed from %ld to %ld\n", pold->RefCount, pnew->RefCount); }
40 if (pold->Unk1 != pnew->Unk1) {
if (
equal) {
trace(
"%s:\n", at);
equal =
FALSE; }
trace(
"Unk1 changed from %lu to %lu\n", pold->Unk1, pnew->Unk1); }
41 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); }
42 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); }
43 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); }
44 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); }
45 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); }
48 pold->Vtbl = pnew->Vtbl;
49 pold->RefCount = pnew->RefCount;
50 pold->Unk1 = pnew->Unk1;
51 pold->Current = pnew->Current;
52 pold->Start = pnew->Start;
53 pold->End = pnew->End;
54 pold->FinalRelease = pnew->FinalRelease;
55 pold->ProcessHandle = pnew->ProcessHandle;
68 RTL_MEMORY_STREAM previous;
80 for (
i = 0;
i <
sizeof(buffer2);
i++)
86 memset(&previous, 0x00,
sizeof(previous));
98 ok(
stream.RefCount == 0,
"RefCount has a wrong value: %ld (expected %d).\n",
stream.RefCount, 0);
102 stream.End = buffer2 +
sizeof(buffer2);
121 ok(
res ==
S_OK,
"QueryInterface to IStream returned wrong hResult: 0x%08lx.\n",
res);
122 ok(
stream.RefCount == 2,
"RefCount has a wrong value: %ld (expected %d).\n",
stream.RefCount, 2);
134 ok(
res ==
S_OK,
"Stat to IStream returned wrong hResult: 0x%08lx.\n",
res);
138 "stream.Current points to the wrong address 0x%p (expected 0x%p)\n",
140 ok(
stream.Start == buffer2,
"stream.Start was changed unexpectedly\n");
141 ok(
stream.End == buffer2 +
sizeof(buffer2),
"stream.End was changed unexpectedly\n");
144 "stat.cbSize has the wrong value %I64u (expected %d)\n",
151 ok(
res == 3,
"AddRef to IStream returned wrong hResult: %ld.\n",
res);
156 ok(
res == 4,
"AddRef to IStream returned wrong hResult: %ld.\n",
res);
161 ok(
res == 3,
"Release to IStream returned wrong hResult: %ld.\n",
res);
166 ok(
res == 4,
"AddRef to IStream returned wrong hResult: %ld.\n",
res);
171 ok(
res == 3,
"Release to IStream returned wrong hResult: %ld.\n",
res);
176 ok(
res == 2,
"Release to IStream returned wrong hResult: %ld.\n",
res);
183 ok(
res ==
S_OK,
"Read to IStream returned wrong hResult: 0x%08lx.\n",
res);
188 ok(
res ==
S_OK,
"Read to IStream returned wrong hResult: 0x%08lx.\n",
res);
193 ok(
res ==
S_OK,
"Read to IStream returned wrong hResult: 0x%08lx.\n",
res);
199 for (
i = 0;
i < bytesRead;
i++)
201 ok(
buffer[
i] ==
i,
"Buffer[%lu] contains a wrong number %u (expected %lu).\n",
i,
buffer[
i],
i);
206 "stream.Current points to the wrong address 0x%p (expected 0x%p)\n",
208 ok(
stream.Start == buffer2,
"stream.Start was changed unexpectedly\n");
209 ok(
stream.End == buffer2 +
sizeof(buffer2),
"stream.End was changed unexpectedly\n");
213 size.QuadPart = 0x9090909090909090ull;
219 ok(
size.QuadPart == 0x9090909090909090ull,
"Seek modified the new location in an error (0x%08lx,0x%08lx).\n",
size.HighPart,
size.LowPart);
225 ok(
res ==
S_OK,
"Seek to IStream returned wrong hResult: 0x%08lx.\n",
res);
229 size.QuadPart = 0x9090909090909090ull;
234 ok(
res ==
S_OK,
"Seek to IStream returned wrong hResult: 0x%08lx.\n",
res);
238 size.QuadPart = 0x9090909090909090ull;
243 ok(
res ==
S_OK,
"Seek to IStream returned wrong hResult: 0x%08lx.\n",
res);
247 size.QuadPart = 0x9090909090909090ull;
253 ok(
size.QuadPart == 0x9090909090909090ull,
"Seek modified the new location in an error.\n");
260 ok(
size.QuadPart == 0x9090909090909090ull,
"Seek modified the new location in an error.\n");
268 ok(
size.QuadPart == 0x9090909090909090ull,
"Seek modified the new location in an error (0x%08lx,0x%08lx).\n",
size.HighPart,
size.LowPart);
270 ok(
res ==
S_OK,
"Seek to IStream returned wrong hResult: 0x%08lx.\n",
res);
271 ok(
size.QuadPart == 0,
"Seek new location unexpected value: 0x%08lx.\n",
size.LowPart);
279 ok(
res ==
S_OK,
"Seek to IStream returned wrong hResult: 0x%08lx.\n",
res);
280 ok(
size.QuadPart == 0,
"Seek new location unexpected value: 0x%08lx.\n",
size.LowPart);
284 size.QuadPart = 0x9090909090909090ull;
290 ok(
size.QuadPart == 0x9090909090909090ull,
"Seek modified the new location in an error (0x%08lx,0x%08lx).\n",
size.HighPart,
size.LowPart);
298 ok(
size.QuadPart == 0x9090909090909090ull,
"Seek modified the new location in an error (0x%08lx,0x%08lx).\n",
size.HighPart,
size.LowPart);
300 ok(
res ==
S_OK,
"Seek to IStream returned wrong hResult: 0x%08lx.\n",
res);
301 ok(
size.QuadPart == 0,
"Seek new location unexpected value: 0x%08lx.\n",
size.LowPart);
308 ok(
res ==
S_OK,
"Seek to IStream returned wrong hResult: 0x%08lx.\n",
res);
312 "Seek returned wrong offset %I64u (expected %d)\n",
316 "stream.Current points to the wrong address 0x%p (expected 0x%p)\n",
318 ok(
stream.Start == buffer2,
"stream.Start was changed unexpectedly\n");
319 ok(
stream.End == buffer2 +
sizeof(buffer2),
"stream.End was changed unexpectedly\n");
325 ok(
res ==
S_OK,
"Read to IStream returned wrong hResult: 0x%08lx.\n",
res);
329 for (
i = 0;
i < bytesRead;
i++)
331 ok(
buffer[
i] == (
i + 40),
"Buffer[%lu] contains a wrong number %u (expected %lu).\n",
i,
buffer[
i],
i + 40);
336 "stream.Current points to the wrong address 0x%p (expected 0x%p)\n",
338 ok(
stream.Start == buffer2,
"stream.Start was changed unexpectedly\n");
339 ok(
stream.End == buffer2 +
sizeof(buffer2),
"stream.End was changed unexpectedly\n");
345 ok(
res == 1,
"Release to IStream returned wrong hResult: 0x%08lx.\n",
res);
347 ok(
stream.RefCount == 1,
"RefCount has a wrong value: %ld (expected %d).\n",
stream.RefCount, 1);
351 ok(
res ==
S_OK,
"Release to IStream returned wrong hResult: 0x%08lx.\n",
res);
353 ok(
stream.RefCount == 0,
"RefCount has a wrong value: %ld (expected %d).\n",
stream.RefCount, 0);
367 RTL_MEMORY_STREAM previous;
379 for (
i = 0;
i <
sizeof(buffer2);
i++)
385 memset(&previous, 0x00,
sizeof(previous));
392 "stream.FinalRelease unexpected %p != %p.\n",
395 ok(
stream.RefCount == 0,
"RefCount has a wrong value: %ld (expected %d).\n",
stream.RefCount, 0);
401 stream.End = buffer2 +
sizeof(buffer2);
409 ok(
res ==
S_OK,
"QueryInterface to IStream returned wrong hResult: 0x%08lx.\n",
res);
411 ok(
stream.RefCount == 1,
"RefCount has a wrong value: %ld (expected %d).\n",
stream.RefCount, 1);
414 "ProcessHandle changed unexpectedly: 0x%p (expected 0x%p)\n",
421 ok(
res ==
S_OK,
"Stat to IStream returned wrong hResult: 0x%08lx.\n",
res);
424 "stream.Current points to the wrong address 0x%p (expected 0x%p)\n",
426 ok(
stream.Start == buffer2,
"stream.Start was changed unexpectedly\n");
427 ok(
stream.End == buffer2 +
sizeof(buffer2),
"stream.End was changed unexpectedly\n");
429 "ProcessHandle changed unexpectedly: 0x%p (expected 0x%p)\n",
433 "stat.cbSize has the wrong value %I64u (expected %d)\n",
440 ok(
res ==
S_OK,
"Read to IStream returned wrong hResult: 0x%08lx.\n",
res);
444 for (
i = 0;
i < bytesRead;
i++)
446 ok(
buffer[
i] ==
i,
"Buffer[%lu] contains a wrong number %u (expected %lu).\n",
i,
buffer[
i],
i);
451 "stream.Current points to the wrong address 0x%p (expected 0x%p)\n",
453 ok(
stream.Start == buffer2,
"stream.Start was changed unexpectedly\n");
454 ok(
stream.End == buffer2 +
sizeof(buffer2),
"stream.End was changed unexpectedly\n");
456 "ProcessHandle changed unexpectedly: 0x%p (expected 0x%p)\n",
465 ok(
res ==
S_OK,
"Seek to IStream returned wrong hResult: 0x%08lx.\n",
res);
468 "Seek returned wrong offset %I64u (expected %d)\n",
472 "stream.Current points to the wrong address 0x%p (expected 0x%p)\n",
474 ok(
stream.Start == buffer2,
"stream.Start was changed unexpectedly\n");
475 ok(
stream.End == buffer2 +
sizeof(buffer2),
"stream.End was changed unexpectedly\n");
477 "ProcessHandle changed unexpectedly: 0x%p (expected 0x%p)\n",
484 ok(
res ==
S_OK,
"Read to IStream returned wrong hResult: 0x%08lx.\n",
res);
488 for (
i = 0;
i < bytesRead;
i++)
490 ok(
buffer[
i] == (
i + 40),
"Buffer[%lu] contains a wrong number %u (expected %lu).\n",
i,
buffer[
i],
i + 40);
495 "stream.Current points to the wrong address 0x%p (expected 0x%p)\n",
497 ok(
stream.Start == buffer2,
"stream.Start was changed unexpectedly\n");
498 ok(
stream.End == buffer2 +
sizeof(buffer2),
"stream.End was changed unexpectedly\n");
500 "ProcessHandle changed unexpectedly: 0x%p (expected 0x%p)\n",
507 ok(
res ==
S_OK,
"Release to IStream returned wrong hResult: 0x%08lx.\n",
res);
509 ok(
stream.RefCount == 0,
"RefCount has a wrong value: %ld (expected %d).\n",
stream.RefCount, 0);
VOID NTAPI CustomFinalReleaseMemoryStream(PRTL_MEMORY_STREAM stream)
ULONG finalReleaseCallCount
VOID NTAPI CustomFinalReleaseOutOfProcessMemoryStream(PRTL_MEMORY_STREAM stream)
BOOL CompareStructsAndSaveForLater(PRTL_MEMORY_STREAM pold, PRTL_MEMORY_STREAM pnew, PSTR at)
basic_istream< char, char_traits< char > > istream
#define EndSeh(ExpectedStatus)
#define GetCurrentProcess()
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
VOID NTAPI RtlFinalReleaseOutOfProcessMemoryStream(_In_ PRTL_MEMORY_STREAM Stream)
VOID NTAPI RtlInitMemoryStream(_Out_ PRTL_MEMORY_STREAM Stream)
VOID NTAPI RtlInitOutOfProcessMemoryStream(_Out_ PRTL_MEMORY_STREAM Stream)
#define STATUS_ACCESS_VIOLATION
#define STG_E_INVALIDPOINTER