48{
49 const char data[] =
"Test String";
55 STATSTG statstg;
57
59 ok(
hr ==
S_OK,
"Failed to create a stream, hr %#x.\n",
hr);
60
62 hr = IStream_SetSize(pStream, ull);
64
67
69 hr = IStream_Seek(pStream,
ll, STREAM_SEEK_SET,
NULL);
71
72
76
77
80 hr = IStream_SetSize(pStream, ull);
82
83
86 hr = IStream_Seek(pStream,
ll, STREAM_SEEK_CUR,
NULL);
88
89
90 ull.
u.HighPart = 0xCAFECAFE;
91 ull.
u.LowPart = 0xCAFECAFE;
94 hr = IStream_Seek(pStream,
ll, STREAM_SEEK_CUR, &ull);
96 ok(ull.
u.LowPart ==
sizeof(
data),
"LowPart set to %d\n", ull.
u.LowPart);
97 ok(ull.
u.HighPart == 0,
"should have set HighPart to 0 instead of %d\n", ull.
u.HighPart);
98
99
100 ull.
u.HighPart = 0xCAFECAFE;
101 ull.
u.LowPart = 0xCAFECAFE;
104 hr = IStream_Seek(pStream,
ll, STREAM_SEEK_END+1, &ull);
105 ok(
hr ==
STG_E_SEEKERROR,
"IStream_Seek should have returned STG_E_SEEKERROR instead of 0x%08x\n",
hr);
106 ok(ull.
u.LowPart ==
sizeof(
data),
"LowPart set to %d\n", ull.
u.LowPart);
107 ok(ull.
u.HighPart == 0,
"should not have changed HighPart, got %d\n", ull.
u.HighPart);
108
109
110 ull.
u.HighPart = 0xCAFECAFE;
111 ull.
u.LowPart = 0xCAFECAFE;
114 hr = IStream_Seek(pStream,
ll, STREAM_SEEK_SET, &ull);
116 ok(ull.
u.LowPart == 0,
"should have set LowPart to 0 instead of %d\n", ull.
u.LowPart);
117 ok(ull.
u.HighPart == 0,
"should have set HighPart to 0 instead of %d\n", ull.
u.HighPart);
118
119
120 ull.
u.HighPart = 0xCAFECAFE;
121 ull.
u.LowPart = 0xCAFECAFE;
124 hr = IStream_Seek(pStream,
ll, STREAM_SEEK_END, &ull);
126 ok(ull.
u.LowPart == 0,
"should have set LowPart to 0 instead of %d\n", ull.
u.LowPart);
127 ok(ull.
u.HighPart == 0,
"should have set HighPart to 0 instead of %d\n", ull.
u.HighPart);
128
129
131 ll.u.LowPart =
sizeof(
data);
132 hr = IStream_Seek(pStream,
ll, STREAM_SEEK_SET, &ull);
134
135 ull.
u.HighPart = 0xCAFECAFE;
136 ull.
u.LowPart = 0xCAFECAFE;
139 hr = IStream_Seek(pStream,
ll, STREAM_SEEK_CUR, &ull);
141 ok(ull.
u.LowPart ==
sizeof(
data),
"LowPart set to %d\n", ull.
u.LowPart);
142 ok(ull.
u.HighPart == 0,
"should have set HighPart to 0 instead of %d\n", ull.
u.HighPart);
143
144
146 ll.u.LowPart =
sizeof(
data);
147 hr = IStream_Seek(pStream,
ll, STREAM_SEEK_SET, &ull);
149
150 ull.
u.HighPart = 0xCAFECAFE;
151 ull.
u.LowPart = 0xCAFECAFE;
154 hr = IStream_Seek(pStream,
ll, STREAM_SEEK_SET, &ull);
156 ok(ull.
u.LowPart == 0,
"should have set LowPart to 0 instead of %d\n", ull.
u.LowPart);
157 ok(ull.
u.HighPart == 0,
"should have set HighPart to 0 instead of %d\n", ull.
u.HighPart);
158
159
161 ll.u.LowPart =
sizeof(
data);
162 hr = IStream_Seek(pStream,
ll, STREAM_SEEK_SET, &ull);
164
165 ull.
u.HighPart = 0xCAFECAFE;
166 ull.
u.LowPart = 0xCAFECAFE;
168 ll.u.LowPart = 0x80000000;
169 hr = IStream_Seek(pStream,
ll, STREAM_SEEK_CUR, &ull);
170 ok(
hr ==
STG_E_SEEKERROR,
"IStream_Seek should have returned STG_E_SEEKERROR instead of 0x%08x\n",
hr);
171 ok(ull.
u.LowPart ==
sizeof(
data),
"LowPart set to %d\n", ull.
u.LowPart);
172 ok(ull.
u.HighPart == 0,
"should have set HighPart to 0 instead of %d\n", ull.
u.HighPart);
173
174
176 ll.u.LowPart =
sizeof(
data);
177 hr = IStream_Seek(pStream,
ll, STREAM_SEEK_SET, &ull);
179
180 ull.
u.HighPart = 0xCAFECAFE;
181 ull.
u.LowPart = 0xCAFECAFE;
184 hr = IStream_Seek(pStream,
ll, STREAM_SEEK_CUR, &ull);
186 ok(ull.
u.LowPart == 0,
"LowPart set to %d\n", ull.
u.LowPart);
187 ok(ull.
u.HighPart == 0,
"should have set HighPart to 0 instead of %d\n", ull.
u.HighPart);
188
189
191 ll.u.LowPart =
sizeof(
data);
192 hr = IStream_Seek(pStream,
ll, STREAM_SEEK_SET, &ull);
194
195 ull.
u.HighPart = 0xCAFECAFE;
196 ull.
u.LowPart = 0xCAFECAFE;
199 hr = IStream_Seek(pStream,
ll, STREAM_SEEK_CUR, &ull);
200 ok(
hr ==
STG_E_SEEKERROR,
"IStream_Seek should have returned STG_E_SEEKERROR instead of 0x%08x\n",
hr);
201 ok(ull.
u.LowPart ==
sizeof(
data),
"LowPart set to %d\n", ull.
u.LowPart);
202 ok(ull.
u.HighPart == 0,
"should have set HighPart to 0 instead of %d\n", ull.
u.HighPart);
203
204
206 ll.u.LowPart =
sizeof(
data);
207 hr = IStream_Seek(pStream,
ll, STREAM_SEEK_SET, &ull);
209
210 ull.
u.HighPart = 0xCAFECAFE;
211 ull.
u.LowPart = 0xCAFECAFE;
213 ll.u.LowPart = 0x80000000 -
sizeof(
data);
214 hr = IStream_Seek(pStream,
ll, STREAM_SEEK_CUR, &ull);
216 ok(ull.
u.LowPart == 0x80000000,
"LowPart set to %d\n", ull.
u.LowPart);
217 ok(ull.
u.HighPart == 0,
"should have set HighPart to 0 instead of %d\n", ull.
u.HighPart);
218
219
221 ll.u.LowPart =
sizeof(
data);
222 hr = IStream_Seek(pStream,
ll, STREAM_SEEK_SET, &ull);
224
225 ull.
u.HighPart = 0xCAFECAFE;
226 ull.
u.LowPart = 0xCAFECAFE;
228 ll.u.LowPart = 0x80000000;
229 hr = IStream_Seek(pStream,
ll, STREAM_SEEK_SET, &ull);
230 ok(
hr ==
STG_E_SEEKERROR,
"IStream_Seek should have returned STG_E_SEEKERROR instead of 0x%08x\n",
hr);
231 ok(ull.
u.LowPart ==
sizeof(
data),
"LowPart set to %d\n", ull.
u.LowPart);
232 ok(ull.
u.HighPart == 0,
"should have set HighPart to 0 instead of %d\n", ull.
u.HighPart);
233
234
235 ull.
u.HighPart = 0xCAFECAFE;
236 ull.
u.LowPart = 0xCAFECAFE;
238 ll.u.LowPart = 0x7FFFFFFF;
239 hr = IStream_Seek(pStream,
ll, STREAM_SEEK_SET, &ull);
241 ok(ull.
u.LowPart == 0x7FFFFFFF,
"should have set LowPart to 0x7FFFFFFF instead of %08x\n", ull.
u.LowPart);
242 ok(ull.
u.HighPart == 0,
"should have set HighPart to 0 instead of %d\n", ull.
u.HighPart);
243
244
247 hr = IStream_Seek(pStream,
ll, STREAM_SEEK_SET, &ull);
249
250 ull.
u.HighPart = 0xCAFECAFE;
251 ull.
u.LowPart = 0xCAFECAFE;
253 ll.u.LowPart = 0x7FFFFFFF;
254 hr = IStream_Seek(pStream,
ll, STREAM_SEEK_CUR, &ull);
256 ok(ull.
u.LowPart == 0x7FFFFFFF,
"should have set LowPart to 0x7FFFFFFF instead of %08x\n", ull.
u.LowPart);
257 ok(ull.
u.HighPart == 0,
"should have set HighPart to 0 instead of %d\n", ull.
u.HighPart);
258
259
260 ull.
u.HighPart = 0xCAFECAFE;
261 ull.
u.LowPart = 0xCAFECAFE;
264 hr = IStream_Seek(pStream,
ll, STREAM_SEEK_CUR, &ull);
266 ok(ull.
u.LowPart == 0x80000008,
"should have set LowPart to 0x80000008 instead of %08x\n", ull.
u.LowPart);
267 ok(ull.
u.HighPart == 0,
"should have set HighPart to 0 instead of %d\n", ull.
u.HighPart);
268
269
270 ull.
u.HighPart = 0xCAFECAFE;
271 ull.
u.LowPart = 0xCAFECAFE;
273 ll.u.LowPart = 0x7FFFFFFF;
274 hr = IStream_Seek(pStream,
ll, STREAM_SEEK_CUR, &ull);
277 ok(ull.
u.LowPart == 0x00000007,
"should have set LowPart to 0x00000007 instead of %08x\n", ull.
u.LowPart);
278 else
279 ok(ull.
u.LowPart == 0x80000008,
"should have set LowPart to 0x80000008 instead of %08x\n", ull.
u.LowPart);
280 ok(ull.
u.HighPart == 0,
"should have set HighPart to 0 instead of %d\n", ull.
u.HighPart);
281
282 hr = IStream_Commit(pStream, STGC_DEFAULT);
284
285 hr = IStream_Revert(pStream);
287
288 hr = IStream_LockRegion(pStream, ull, ull, LOCK_WRITE);
290
291 hr = IStream_Stat(pStream, &statstg, STATFLAG_DEFAULT);
293 ok(statstg.type == STGTY_STREAM,
"statstg.type should have been STGTY_STREAM instead of %d\n", statstg.type);
294
295
298 hr = IStream_SetSize(pStream, ull);
300 "IStream_SetSize with large size should have returned E_OUTOFMEMORY instead of 0x%08x\n",
hr);
301
302 IStream_Release(pStream);
303}
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
struct _ULARGE_INTEGER::@4136 u
#define STG_E_INVALIDFUNCTION