* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
+#define WIN32_NO_STATUS
+#define _INC_WINDOWS
+#define COM_NO_WINDOWS_H
+
#define COBJMACROS
#include <stdarg.h>
-#include "windef.h"
-#include "winbase.h"
-#include "objbase.h"
+#include <windef.h>
+#include <winbase.h>
+#include <ole2.h>
+//#include "objbase.h"
-#include "wine/test.h"
+#include <wine/test.h>
#define ok_ole_success(hr, func) ok(hr == S_OK, func " failed with error 0x%08x\n", hr)
ull.u.HighPart = 0xCAFECAFE;
ull.u.LowPart = 0xCAFECAFE;
ll.u.HighPart = 0;
- ll.u.LowPart = -sizeof(data);
+ ll.u.LowPart = -(DWORD)sizeof(data);
hr = IStream_Seek(pStream, ll, STREAM_SEEK_CUR, &ull);
ok_ole_success(hr, "IStream_Seek");
ok(ull.u.LowPart == 0, "LowPart set to %d\n", ull.u.LowPart);
ull.u.HighPart = 0xCAFECAFE;
ull.u.LowPart = 0xCAFECAFE;
ll.u.HighPart = 0;
- ll.u.LowPart = -sizeof(data)-1;
+ ll.u.LowPart = -(DWORD)sizeof(data)-1;
hr = IStream_Seek(pStream, ll, STREAM_SEEK_CUR, &ull);
ok(hr == STG_E_SEEKERROR, "IStream_Seek should have returned STG_E_SEEKERROR instead of 0x%08x\n", hr);
ok(ull.u.LowPart == sizeof(data), "LowPart set to %d\n", ull.u.LowPart);
ok(ull.u.LowPart == 0x80000008, "should have set LowPart to 0x80000008 instead of %08x\n", ull.u.LowPart);
ok(ull.u.HighPart == 0, "should have set HighPart to 0 instead of %d\n", ull.u.HighPart);
- /* IStream_Seek -- seek wraps position/size on integer overflow */
+ /* IStream_Seek -- seek wraps position/size on integer overflow, but not on win8 */
ull.u.HighPart = 0xCAFECAFE;
ull.u.LowPart = 0xCAFECAFE;
ll.u.HighPart = 0;
ll.u.LowPart = 0x7FFFFFFF;
hr = IStream_Seek(pStream, ll, STREAM_SEEK_CUR, &ull);
- ok_ole_success(hr, "IStream_Seek");
- ok(ull.u.LowPart == 0x00000007, "should have set LowPart to 0x00000007 instead of %08x\n", ull.u.LowPart);
+ ok(hr == S_OK || hr == STG_E_SEEKERROR /* win8 */, "IStream_Seek\n");
+ if (SUCCEEDED(hr))
+ ok(ull.u.LowPart == 0x00000007, "should have set LowPart to 0x00000007 instead of %08x\n", ull.u.LowPart);
+ else
+ ok(ull.u.LowPart == 0x80000008, "should have set LowPart to 0x80000008 instead of %08x\n", ull.u.LowPart);
ok(ull.u.HighPart == 0, "should have set HighPart to 0 instead of %d\n", ull.u.HighPart);
hr = IStream_Commit(pStream, STGC_DEFAULT);
IsEqualIID(riid, &IID_IStream))
{
*ppv = iface;
- IUnknown_AddRef(iface);
+ IStream_AddRef(iface);
return S_OK;
}
*ppv = NULL;
static const LARGE_INTEGER llZero;
char buffer[15];
+ ok_ole_success(hr, "CreateStreamOnHGlobal");
+
expected_method_list = methods_copyto;
hr = IStream_Write(pStream, szHello, sizeof(szHello), &written);