48{
49 const char data[] =
"Test String";
55 STATSTG statstg;
57
59 ok(
hr ==
S_OK,
"Failed to create a stream, hr %#lx.\n",
hr);
60
62 hr = IStream_SetSize(pStream, ull);
64
67
68
69 ll.QuadPart =
sizeof(
data) + 16;
70 hr = IStream_Seek(pStream,
ll, STREAM_SEEK_SET,
NULL);
72
75 ok(
read == 0,
"IStream_Read returned read %ld\n",
read);
76
77 ull.
u.HighPart = 0xCAFECAFE;
78 ull.
u.LowPart = 0xCAFECAFE;
81 hr = IStream_Seek(pStream,
ll, STREAM_SEEK_CUR, &ull);
83 ok(ull.
u.LowPart ==
sizeof(
data) + 16,
"LowPart set to %ld\n", ull.
u.LowPart);
84 ok(ull.
u.HighPart == 0,
"should have set HighPart to 0 instead of %ld\n", ull.
u.HighPart);
85
86
88 hr = IStream_Seek(pStream,
ll, STREAM_SEEK_SET,
NULL);
90
91
94 ok(
read ==
sizeof(
data),
"IStream_Read returned read %ld\n",
read);
95
96
99 hr = IStream_SetSize(pStream, ull);
101
102
105 hr = IStream_Seek(pStream,
ll, STREAM_SEEK_CUR,
NULL);
107
108
109 ull.
u.HighPart = 0xCAFECAFE;
110 ull.
u.LowPart = 0xCAFECAFE;
113 hr = IStream_Seek(pStream,
ll, STREAM_SEEK_CUR, &ull);
115 ok(ull.
u.LowPart ==
sizeof(
data),
"LowPart set to %ld\n", ull.
u.LowPart);
116 ok(ull.
u.HighPart == 0,
"should have set HighPart to 0 instead of %ld\n", ull.
u.HighPart);
117
118
119 ull.
u.HighPart = 0xCAFECAFE;
120 ull.
u.LowPart = 0xCAFECAFE;
123 hr = IStream_Seek(pStream,
ll, STREAM_SEEK_END+1, &ull);
124 ok(
hr ==
STG_E_SEEKERROR,
"IStream_Seek should have returned STG_E_SEEKERROR instead of 0x%08lx\n",
hr);
125 ok(ull.
u.LowPart ==
sizeof(
data),
"LowPart set to %ld\n", ull.
u.LowPart);
126 ok(ull.
u.HighPart == 0,
"should not have changed HighPart, got %ld\n", ull.
u.HighPart);
127
128
129 ull.
u.HighPart = 0xCAFECAFE;
130 ull.
u.LowPart = 0xCAFECAFE;
133 hr = IStream_Seek(pStream,
ll, STREAM_SEEK_SET, &ull);
135 ok(ull.
u.LowPart == 0,
"should have set LowPart to 0 instead of %ld\n", ull.
u.LowPart);
136 ok(ull.
u.HighPart == 0,
"should have set HighPart to 0 instead of %ld\n", ull.
u.HighPart);
137
138
139 ull.
u.HighPart = 0xCAFECAFE;
140 ull.
u.LowPart = 0xCAFECAFE;
143 hr = IStream_Seek(pStream,
ll, STREAM_SEEK_END, &ull);
145 ok(ull.
u.LowPart == 0,
"should have set LowPart to 0 instead of %ld\n", ull.
u.LowPart);
146 ok(ull.
u.HighPart == 0,
"should have set HighPart to 0 instead of %ld\n", ull.
u.HighPart);
147
148
150 ll.u.LowPart =
sizeof(
data);
151 hr = IStream_Seek(pStream,
ll, STREAM_SEEK_SET, &ull);
153
154 ull.
u.HighPart = 0xCAFECAFE;
155 ull.
u.LowPart = 0xCAFECAFE;
158 hr = IStream_Seek(pStream,
ll, STREAM_SEEK_CUR, &ull);
160 ok(ull.
u.LowPart ==
sizeof(
data),
"LowPart set to %ld\n", ull.
u.LowPart);
161 ok(ull.
u.HighPart == 0,
"should have set HighPart to 0 instead of %ld\n", ull.
u.HighPart);
162
163
165 ll.u.LowPart =
sizeof(
data);
166 hr = IStream_Seek(pStream,
ll, STREAM_SEEK_SET, &ull);
168
169 ull.
u.HighPart = 0xCAFECAFE;
170 ull.
u.LowPart = 0xCAFECAFE;
173 hr = IStream_Seek(pStream,
ll, STREAM_SEEK_SET, &ull);
175 ok(ull.
u.LowPart == 0,
"should have set LowPart to 0 instead of %ld\n", ull.
u.LowPart);
176 ok(ull.
u.HighPart == 0,
"should have set HighPart to 0 instead of %ld\n", ull.
u.HighPart);
177
178
180 ll.u.LowPart =
sizeof(
data);
181 hr = IStream_Seek(pStream,
ll, STREAM_SEEK_SET, &ull);
183
184 ull.
u.HighPart = 0xCAFECAFE;
185 ull.
u.LowPart = 0xCAFECAFE;
187 ll.u.LowPart = 0x80000000;
188 hr = IStream_Seek(pStream,
ll, STREAM_SEEK_CUR, &ull);
189 ok(
hr ==
STG_E_SEEKERROR,
"IStream_Seek should have returned STG_E_SEEKERROR instead of 0x%08lx\n",
hr);
190 ok(ull.
u.LowPart ==
sizeof(
data),
"LowPart set to %ld\n", ull.
u.LowPart);
191 ok(ull.
u.HighPart == 0,
"should have set HighPart to 0 instead of %ld\n", ull.
u.HighPart);
192
193
195 ll.u.LowPart =
sizeof(
data);
196 hr = IStream_Seek(pStream,
ll, STREAM_SEEK_SET, &ull);
198
199 ull.
u.HighPart = 0xCAFECAFE;
200 ull.
u.LowPart = 0xCAFECAFE;
203 hr = IStream_Seek(pStream,
ll, STREAM_SEEK_CUR, &ull);
205 ok(ull.
u.LowPart == 0,
"LowPart set to %ld\n", ull.
u.LowPart);
206 ok(ull.
u.HighPart == 0,
"should have set HighPart to 0 instead of %ld\n", ull.
u.HighPart);
207
208
210 ll.u.LowPart =
sizeof(
data);
211 hr = IStream_Seek(pStream,
ll, STREAM_SEEK_SET, &ull);
213
214 ull.
u.HighPart = 0xCAFECAFE;
215 ull.
u.LowPart = 0xCAFECAFE;
218 hr = IStream_Seek(pStream,
ll, STREAM_SEEK_CUR, &ull);
219 ok(
hr ==
STG_E_SEEKERROR,
"IStream_Seek should have returned STG_E_SEEKERROR instead of 0x%08lx\n",
hr);
220 ok(ull.
u.LowPart ==
sizeof(
data),
"LowPart set to %ld\n", ull.
u.LowPart);
221 ok(ull.
u.HighPart == 0,
"should have set HighPart to 0 instead of %ld\n", ull.
u.HighPart);
222
223
225 ll.u.LowPart =
sizeof(
data);
226 hr = IStream_Seek(pStream,
ll, STREAM_SEEK_SET, &ull);
228
229 ull.
u.HighPart = 0xCAFECAFE;
230 ull.
u.LowPart = 0xCAFECAFE;
232 ll.u.LowPart = 0x80000000 -
sizeof(
data);
233 hr = IStream_Seek(pStream,
ll, STREAM_SEEK_CUR, &ull);
235 ok(ull.
u.LowPart == 0x80000000,
"LowPart set to %ld\n", ull.
u.LowPart);
236 ok(ull.
u.HighPart == 0,
"should have set HighPart to 0 instead of %ld\n", ull.
u.HighPart);
237
238
240 ll.u.LowPart =
sizeof(
data);
241 hr = IStream_Seek(pStream,
ll, STREAM_SEEK_SET, &ull);
243
244 ull.
u.HighPart = 0xCAFECAFE;
245 ull.
u.LowPart = 0xCAFECAFE;
247 ll.u.LowPart = 0x80000000;
248 hr = IStream_Seek(pStream,
ll, STREAM_SEEK_SET, &ull);
249 ok(
hr ==
STG_E_SEEKERROR,
"IStream_Seek should have returned STG_E_SEEKERROR instead of 0x%08lx\n",
hr);
250 ok(ull.
u.LowPart ==
sizeof(
data),
"LowPart set to %ld\n", ull.
u.LowPart);
251 ok(ull.
u.HighPart == 0,
"should have set HighPart to 0 instead of %ld\n", ull.
u.HighPart);
252
253
254 ull.
u.HighPart = 0xCAFECAFE;
255 ull.
u.LowPart = 0xCAFECAFE;
257 ll.u.LowPart = 0x7FFFFFFF;
258 hr = IStream_Seek(pStream,
ll, STREAM_SEEK_SET, &ull);
260 ok(ull.
u.LowPart == 0x7FFFFFFF,
"should have set LowPart to 0x7FFFFFFF instead of %08lx\n", ull.
u.LowPart);
261 ok(ull.
u.HighPart == 0,
"should have set HighPart to 0 instead of %ld\n", ull.
u.HighPart);
262
263
266 hr = IStream_Seek(pStream,
ll, STREAM_SEEK_SET, &ull);
268
269 ull.
u.HighPart = 0xCAFECAFE;
270 ull.
u.LowPart = 0xCAFECAFE;
272 ll.u.LowPart = 0x7FFFFFFF;
273 hr = IStream_Seek(pStream,
ll, STREAM_SEEK_CUR, &ull);
275 ok(ull.
u.LowPart == 0x7FFFFFFF,
"should have set LowPart to 0x7FFFFFFF instead of %08lx\n", ull.
u.LowPart);
276 ok(ull.
u.HighPart == 0,
"should have set HighPart to 0 instead of %ld\n", ull.
u.HighPart);
277
278
279 ull.
u.HighPart = 0xCAFECAFE;
280 ull.
u.LowPart = 0xCAFECAFE;
283 hr = IStream_Seek(pStream,
ll, STREAM_SEEK_CUR, &ull);
285 ok(ull.
u.LowPart == 0x80000008,
"should have set LowPart to 0x80000008 instead of %08lx\n", ull.
u.LowPart);
286 ok(ull.
u.HighPart == 0,
"should have set HighPart to 0 instead of %ld\n", ull.
u.HighPart);
287
288
289 ull.
u.HighPart = 0xCAFECAFE;
290 ull.
u.LowPart = 0xCAFECAFE;
292 ll.u.LowPart = 0x7FFFFFFF;
293 hr = IStream_Seek(pStream,
ll, STREAM_SEEK_CUR, &ull);
296 ok(ull.
u.LowPart == 0x00000007,
"should have set LowPart to 0x00000007 instead of %08lx\n", ull.
u.LowPart);
297 else
298 ok(ull.
u.LowPart == 0x80000008,
"should have set LowPart to 0x80000008 instead of %08lx\n", ull.
u.LowPart);
299 ok(ull.
u.HighPart == 0,
"should have set HighPart to 0 instead of %ld\n", ull.
u.HighPart);
300
301 hr = IStream_Commit(pStream, STGC_DEFAULT);
303
304 hr = IStream_Revert(pStream);
306
307 hr = IStream_LockRegion(pStream, ull, ull, LOCK_WRITE);
309
310 hr = IStream_Stat(pStream, &statstg, STATFLAG_DEFAULT);
312 ok(statstg.type == STGTY_STREAM,
"statstg.type should have been STGTY_STREAM instead of %ld\n", statstg.type);
313
314
317 hr = IStream_SetSize(pStream, ull);
318 ok(
hr ==
S_OK,
"IStream_SetSize with large size should have returned S_OK instead of 0x%08lx\n",
hr);
319
320 IStream_Release(pStream);
321}
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
struct _ULARGE_INTEGER::@4461 u
#define STG_E_INVALIDFUNCTION