Commit 61a06d4b authored by Alexandre Julliard's avatar Alexandre Julliard

ole32: Use nameless unions/structs.

parent 34ab144f
...@@ -22,8 +22,6 @@ ...@@ -22,8 +22,6 @@
#include <string.h> #include <string.h>
#define COBJMACROS #define COBJMACROS
#define NONAMELESSUNION
#include "windef.h" #include "windef.h"
#include "winbase.h" #include "winbase.h"
#include "objbase.h" #include "objbase.h"
......
...@@ -64,8 +64,6 @@ ...@@ -64,8 +64,6 @@
#include <stdio.h> #include <stdio.h>
#define COBJMACROS #define COBJMACROS
#define NONAMELESSUNION
#include "windef.h" #include "windef.h"
#include "winbase.h" #include "winbase.h"
#include "wingdi.h" #include "wingdi.h"
...@@ -646,7 +644,7 @@ static HRESULT render_embed_source_hack(IDataObject *data, LPFORMATETC fmt) ...@@ -646,7 +644,7 @@ static HRESULT render_embed_source_hack(IDataObject *data, LPFORMATETC fmt)
return hr; return hr;
} }
hr = StgCreateDocfileOnILockBytes(ptrILockBytes, STGM_SHARE_EXCLUSIVE|STGM_READWRITE, 0, &std.u.pstg); hr = StgCreateDocfileOnILockBytes(ptrILockBytes, STGM_SHARE_EXCLUSIVE|STGM_READWRITE, 0, &std.pstg);
ILockBytes_Release(ptrILockBytes); ILockBytes_Release(ptrILockBytes);
if (FAILED(hr = IDataObject_GetDataHere(theOleClipboard->src_data, fmt, &std))) if (FAILED(hr = IDataObject_GetDataHere(theOleClipboard->src_data, fmt, &std)))
...@@ -675,7 +673,7 @@ static HRESULT render_embed_source_hack(IDataObject *data, LPFORMATETC fmt) ...@@ -675,7 +673,7 @@ static HRESULT render_embed_source_hack(IDataObject *data, LPFORMATETC fmt)
if (SUCCEEDED(hr = IDataObject_GetData(theOleClipboard->src_data, &fmt2, &std2))) if (SUCCEEDED(hr = IDataObject_GetData(theOleClipboard->src_data, &fmt2, &std2)))
{ {
mfp = GlobalLock(std2.u.hGlobal); mfp = GlobalLock(std2.hGlobal);
} }
if (mfp) if (mfp)
...@@ -704,7 +702,7 @@ static HRESULT render_embed_source_hack(IDataObject *data, LPFORMATETC fmt) ...@@ -704,7 +702,7 @@ static HRESULT render_embed_source_hack(IDataObject *data, LPFORMATETC fmt)
pdh.dwObjectExtentY = mfp->yExt; pdh.dwObjectExtentY = mfp->yExt;
pdh.dwSize = nSize; pdh.dwSize = nSize;
hr = IStorage_CreateStream(std.u.pstg, L"\2OlePres000", hr = IStorage_CreateStream(std.pstg, L"\2OlePres000",
STGM_CREATE|STGM_SHARE_EXCLUSIVE|STGM_READWRITE, 0, 0, &pStream); STGM_CREATE|STGM_SHARE_EXCLUSIVE|STGM_READWRITE, 0, 0, &pStream);
hr = IStream_Write(pStream, &pdh, sizeof(PresentationDataHeader), NULL); hr = IStream_Write(pStream, &pdh, sizeof(PresentationDataHeader), NULL);
...@@ -718,15 +716,15 @@ static HRESULT render_embed_source_hack(IDataObject *data, LPFORMATETC fmt) ...@@ -718,15 +716,15 @@ static HRESULT render_embed_source_hack(IDataObject *data, LPFORMATETC fmt)
HeapFree(GetProcessHeap(), 0, mfBits); HeapFree(GetProcessHeap(), 0, mfBits);
GlobalUnlock(std2.u.hGlobal); GlobalUnlock(std2.hGlobal);
ReleaseStgMedium(&std2); ReleaseStgMedium(&std2);
ReadClassStg(std.u.pstg, &clsID); ReadClassStg(std.pstg, &clsID);
ProgIDFromCLSID(&clsID, &strProgID); ProgIDFromCLSID(&clsID, &strProgID);
WideCharToMultiByte( CP_ACP, 0, strProgID, -1, strOleTypeName, sizeof(strOleTypeName), NULL, NULL ); WideCharToMultiByte( CP_ACP, 0, strProgID, -1, strOleTypeName, sizeof(strOleTypeName), NULL, NULL );
STORAGE_CreateOleStream(std.u.pstg, 0); STORAGE_CreateOleStream(std.pstg, 0);
OLECONVERT_CreateCompObjStream(std.u.pstg, strOleTypeName); OLECONVERT_CreateCompObjStream(std.pstg, strOleTypeName);
CoTaskMemFree(strProgID); CoTaskMemFree(strProgID);
} }
} }
...@@ -790,7 +788,7 @@ static HRESULT get_data_from_storage(IDataObject *data, FORMATETC *fmt, HGLOBAL ...@@ -790,7 +788,7 @@ static HRESULT get_data_from_storage(IDataObject *data, FORMATETC *fmt, HGLOBAL
stg_fmt = *fmt; stg_fmt = *fmt;
med.tymed = stg_fmt.tymed = TYMED_ISTORAGE; med.tymed = stg_fmt.tymed = TYMED_ISTORAGE;
med.u.pstg = stg; med.pstg = stg;
med.pUnkForRelease = NULL; med.pUnkForRelease = NULL;
hr = IDataObject_GetDataHere(data, &stg_fmt, &med); hr = IDataObject_GetDataHere(data, &stg_fmt, &med);
...@@ -800,7 +798,7 @@ static HRESULT get_data_from_storage(IDataObject *data, FORMATETC *fmt, HGLOBAL ...@@ -800,7 +798,7 @@ static HRESULT get_data_from_storage(IDataObject *data, FORMATETC *fmt, HGLOBAL
hr = IDataObject_GetData(data, &stg_fmt, &med); hr = IDataObject_GetData(data, &stg_fmt, &med);
if(FAILED(hr)) goto end; if(FAILED(hr)) goto end;
hr = IStorage_CopyTo(med.u.pstg, 0, NULL, NULL, stg); hr = IStorage_CopyTo(med.pstg, 0, NULL, NULL, stg);
ReleaseStgMedium(&med); ReleaseStgMedium(&med);
if(FAILED(hr)) goto end; if(FAILED(hr)) goto end;
} }
...@@ -835,7 +833,7 @@ static HRESULT get_data_from_stream(IDataObject *data, FORMATETC *fmt, HGLOBAL * ...@@ -835,7 +833,7 @@ static HRESULT get_data_from_stream(IDataObject *data, FORMATETC *fmt, HGLOBAL *
stm_fmt = *fmt; stm_fmt = *fmt;
med.tymed = stm_fmt.tymed = TYMED_ISTREAM; med.tymed = stm_fmt.tymed = TYMED_ISTREAM;
med.u.pstm = stm; med.pstm = stm;
med.pUnkForRelease = NULL; med.pUnkForRelease = NULL;
hr = IDataObject_GetDataHere(data, &stm_fmt, &med); hr = IDataObject_GetDataHere(data, &stm_fmt, &med);
...@@ -849,9 +847,9 @@ static HRESULT get_data_from_stream(IDataObject *data, FORMATETC *fmt, HGLOBAL * ...@@ -849,9 +847,9 @@ static HRESULT get_data_from_stream(IDataObject *data, FORMATETC *fmt, HGLOBAL *
if(FAILED(hr)) goto error; if(FAILED(hr)) goto error;
offs.QuadPart = 0; offs.QuadPart = 0;
IStream_Seek(med.u.pstm, offs, STREAM_SEEK_END, &pos); IStream_Seek(med.pstm, offs, STREAM_SEEK_END, &pos);
IStream_Seek(med.u.pstm, offs, STREAM_SEEK_SET, NULL); IStream_Seek(med.pstm, offs, STREAM_SEEK_SET, NULL);
hr = IStream_CopyTo(med.u.pstm, stm, pos, NULL, NULL); hr = IStream_CopyTo(med.pstm, stm, pos, NULL, NULL);
ReleaseStgMedium(&med); ReleaseStgMedium(&med);
if(FAILED(hr)) goto error; if(FAILED(hr)) goto error;
} }
...@@ -886,7 +884,7 @@ static HRESULT get_data_from_global(IDataObject *data, FORMATETC *fmt, HGLOBAL * ...@@ -886,7 +884,7 @@ static HRESULT get_data_from_global(IDataObject *data, FORMATETC *fmt, HGLOBAL *
hr = IDataObject_GetData(data, &mem_fmt, &med); hr = IDataObject_GetData(data, &mem_fmt, &med);
if(FAILED(hr)) return hr; if(FAILED(hr)) return hr;
hr = dup_global_mem(med.u.hGlobal, GMEM_DDESHARE|GMEM_MOVEABLE, &h); hr = dup_global_mem(med.hGlobal, GMEM_DDESHARE|GMEM_MOVEABLE, &h);
if(SUCCEEDED(hr)) *mem = h; if(SUCCEEDED(hr)) *mem = h;
...@@ -914,7 +912,7 @@ static HRESULT get_data_from_enhmetafile(IDataObject *data, FORMATETC *fmt, HGLO ...@@ -914,7 +912,7 @@ static HRESULT get_data_from_enhmetafile(IDataObject *data, FORMATETC *fmt, HGLO
hr = IDataObject_GetData(data, &mem_fmt, &med); hr = IDataObject_GetData(data, &mem_fmt, &med);
if(FAILED(hr)) return hr; if(FAILED(hr)) return hr;
copy = CopyEnhMetaFileW(med.u.hEnhMetaFile, NULL); copy = CopyEnhMetaFileW(med.hEnhMetaFile, NULL);
if(copy) *mem = (HGLOBAL)copy; if(copy) *mem = (HGLOBAL)copy;
else hr = E_FAIL; else hr = E_FAIL;
...@@ -942,7 +940,7 @@ static HRESULT get_data_from_metafilepict(IDataObject *data, FORMATETC *fmt, HGL ...@@ -942,7 +940,7 @@ static HRESULT get_data_from_metafilepict(IDataObject *data, FORMATETC *fmt, HGL
hr = IDataObject_GetData(data, &mem_fmt, &med); hr = IDataObject_GetData(data, &mem_fmt, &med);
if(FAILED(hr)) return hr; if(FAILED(hr)) return hr;
hr = dup_metafilepict(med.u.hMetaFilePict, &copy); hr = dup_metafilepict(med.hMetaFilePict, &copy);
if(SUCCEEDED(hr)) *mem = copy; if(SUCCEEDED(hr)) *mem = copy;
...@@ -972,7 +970,7 @@ static HRESULT get_data_from_bitmap(IDataObject *data, FORMATETC *fmt, HBITMAP * ...@@ -972,7 +970,7 @@ static HRESULT get_data_from_bitmap(IDataObject *data, FORMATETC *fmt, HBITMAP *
hr = IDataObject_GetData(data, &mem_fmt, &med); hr = IDataObject_GetData(data, &mem_fmt, &med);
if(FAILED(hr)) return hr; if(FAILED(hr)) return hr;
hr = dup_bitmap(med.u.hBitmap, &copy); hr = dup_bitmap(med.hBitmap, &copy);
if(SUCCEEDED(hr)) *hbm = copy; if(SUCCEEDED(hr)) *hbm = copy;
...@@ -1299,7 +1297,7 @@ static HRESULT get_stgmed_for_global(HGLOBAL h, STGMEDIUM *med) ...@@ -1299,7 +1297,7 @@ static HRESULT get_stgmed_for_global(HGLOBAL h, STGMEDIUM *med)
med->pUnkForRelease = NULL; med->pUnkForRelease = NULL;
med->tymed = TYMED_NULL; med->tymed = TYMED_NULL;
hr = dup_global_mem(h, GMEM_MOVEABLE, &med->u.hGlobal); hr = dup_global_mem(h, GMEM_MOVEABLE, &med->hGlobal);
if(SUCCEEDED(hr)) med->tymed = TYMED_HGLOBAL; if(SUCCEEDED(hr)) med->tymed = TYMED_HGLOBAL;
...@@ -1322,7 +1320,7 @@ static HRESULT get_stgmed_for_stream(HGLOBAL h, STGMEDIUM *med) ...@@ -1322,7 +1320,7 @@ static HRESULT get_stgmed_for_stream(HGLOBAL h, STGMEDIUM *med)
hr = dup_global_mem(h, GMEM_MOVEABLE, &dst); hr = dup_global_mem(h, GMEM_MOVEABLE, &dst);
if(FAILED(hr)) return hr; if(FAILED(hr)) return hr;
hr = CreateStreamOnHGlobal(dst, TRUE, &med->u.pstm); hr = CreateStreamOnHGlobal(dst, TRUE, &med->pstm);
if(FAILED(hr)) if(FAILED(hr))
{ {
GlobalFree(dst); GlobalFree(dst);
...@@ -1365,7 +1363,7 @@ static HRESULT get_stgmed_for_storage(HGLOBAL h, STGMEDIUM *med) ...@@ -1365,7 +1363,7 @@ static HRESULT get_stgmed_for_storage(HGLOBAL h, STGMEDIUM *med)
return SUCCEEDED(hr) ? E_FAIL : hr; return SUCCEEDED(hr) ? E_FAIL : hr;
} }
hr = StgOpenStorageOnILockBytes(lbs, NULL, STGM_SHARE_EXCLUSIVE | STGM_READWRITE, NULL, 0, &med->u.pstg); hr = StgOpenStorageOnILockBytes(lbs, NULL, STGM_SHARE_EXCLUSIVE | STGM_READWRITE, NULL, 0, &med->pstg);
ILockBytes_Release(lbs); ILockBytes_Release(lbs);
if(FAILED(hr)) if(FAILED(hr))
{ {
...@@ -1387,8 +1385,8 @@ static HRESULT get_stgmed_for_emf(HENHMETAFILE hemf, STGMEDIUM *med) ...@@ -1387,8 +1385,8 @@ static HRESULT get_stgmed_for_emf(HENHMETAFILE hemf, STGMEDIUM *med)
med->pUnkForRelease = NULL; med->pUnkForRelease = NULL;
med->tymed = TYMED_NULL; med->tymed = TYMED_NULL;
med->u.hEnhMetaFile = CopyEnhMetaFileW(hemf, NULL); med->hEnhMetaFile = CopyEnhMetaFileW(hemf, NULL);
if(!med->u.hEnhMetaFile) return E_OUTOFMEMORY; if(!med->hEnhMetaFile) return E_OUTOFMEMORY;
med->tymed = TYMED_ENHMF; med->tymed = TYMED_ENHMF;
return S_OK; return S_OK;
} }
...@@ -1405,7 +1403,7 @@ static HRESULT get_stgmed_for_bitmap(HBITMAP hbmp, STGMEDIUM *med) ...@@ -1405,7 +1403,7 @@ static HRESULT get_stgmed_for_bitmap(HBITMAP hbmp, STGMEDIUM *med)
med->pUnkForRelease = NULL; med->pUnkForRelease = NULL;
med->tymed = TYMED_NULL; med->tymed = TYMED_NULL;
hr = dup_bitmap(hbmp, &med->u.hBitmap); hr = dup_bitmap(hbmp, &med->hBitmap);
if (FAILED(hr)) if (FAILED(hr))
return hr; return hr;
...@@ -1603,15 +1601,15 @@ static HRESULT WINAPI snapshot_GetDataHere(IDataObject *iface, FORMATETC *fmt, ...@@ -1603,15 +1601,15 @@ static HRESULT WINAPI snapshot_GetDataHere(IDataObject *iface, FORMATETC *fmt,
case TYMED_HGLOBAL: case TYMED_HGLOBAL:
{ {
DWORD src_size = GlobalSize(h); DWORD src_size = GlobalSize(h);
DWORD dst_size = GlobalSize(med->u.hGlobal); DWORD dst_size = GlobalSize(med->hGlobal);
hr = E_FAIL; hr = E_FAIL;
if(dst_size >= src_size) if(dst_size >= src_size)
{ {
void *src = GlobalLock(h); void *src = GlobalLock(h);
void *dst = GlobalLock(med->u.hGlobal); void *dst = GlobalLock(med->hGlobal);
memcpy(dst, src, src_size); memcpy(dst, src, src_size);
GlobalUnlock(med->u.hGlobal); GlobalUnlock(med->hGlobal);
GlobalUnlock(h); GlobalUnlock(h);
hr = S_OK; hr = S_OK;
} }
...@@ -1621,7 +1619,7 @@ static HRESULT WINAPI snapshot_GetDataHere(IDataObject *iface, FORMATETC *fmt, ...@@ -1621,7 +1619,7 @@ static HRESULT WINAPI snapshot_GetDataHere(IDataObject *iface, FORMATETC *fmt,
{ {
DWORD src_size = GlobalSize(h); DWORD src_size = GlobalSize(h);
void *src = GlobalLock(h); void *src = GlobalLock(h);
hr = IStream_Write(med->u.pstm, src, src_size, NULL); hr = IStream_Write(med->pstm, src, src_size, NULL);
GlobalUnlock(h); GlobalUnlock(h);
break; break;
} }
...@@ -1636,7 +1634,7 @@ static HRESULT WINAPI snapshot_GetDataHere(IDataObject *iface, FORMATETC *fmt, ...@@ -1636,7 +1634,7 @@ static HRESULT WINAPI snapshot_GetDataHere(IDataObject *iface, FORMATETC *fmt,
hr = get_stgmed_for_storage(h, &copy); hr = get_stgmed_for_storage(h, &copy);
if(SUCCEEDED(hr)) if(SUCCEEDED(hr))
{ {
hr = IStorage_CopyTo(copy.u.pstg, 0, NULL, NULL, med->u.pstg); hr = IStorage_CopyTo(copy.pstg, 0, NULL, NULL, med->pstg);
ReleaseStgMedium(&copy); ReleaseStgMedium(&copy);
} }
break; break;
......
...@@ -40,8 +40,6 @@ ...@@ -40,8 +40,6 @@
#include <assert.h> #include <assert.h>
#define COBJMACROS #define COBJMACROS
#define NONAMELESSUNION
#include "ntstatus.h" #include "ntstatus.h"
#define WIN32_NO_STATUS #define WIN32_NO_STATUS
#include "windef.h" #include "windef.h"
......
...@@ -28,9 +28,6 @@ ...@@ -28,9 +28,6 @@
#include <limits.h> #include <limits.h>
#define COBJMACROS #define COBJMACROS
#define NONAMELESSUNION
#define NONAMELESSSTRUCT
#include "windef.h" #include "windef.h"
#include "winbase.h" #include "winbase.h"
#include "winuser.h" #include "winuser.h"
...@@ -189,7 +186,7 @@ static HRESULT WINAPI FileLockBytesImpl_ReadAt( ...@@ -189,7 +186,7 @@ static HRESULT WINAPI FileLockBytesImpl_ReadAt(
LARGE_INTEGER offset; LARGE_INTEGER offset;
ULONG cbRead; ULONG cbRead;
TRACE("%p, %ld, %p, %lu, %p.\n", iface, ulOffset.u.LowPart, pv, cb, pcbRead); TRACE("%p, %ld, %p, %lu, %p.\n", iface, ulOffset.LowPart, pv, cb, pcbRead);
/* verify a sane environment */ /* verify a sane environment */
if (!This) return E_FAIL; if (!This) return E_FAIL;
...@@ -244,7 +241,7 @@ static HRESULT WINAPI FileLockBytesImpl_WriteAt( ...@@ -244,7 +241,7 @@ static HRESULT WINAPI FileLockBytesImpl_WriteAt(
LARGE_INTEGER offset; LARGE_INTEGER offset;
ULONG cbWritten; ULONG cbWritten;
TRACE("%p, %ld, %p, %lu, %p.\n", iface, ulOffset.u.LowPart, pv, cb, pcbWritten); TRACE("%p, %ld, %p, %lu, %p.\n", iface, ulOffset.LowPart, pv, cb, pcbWritten);
/* verify a sane environment */ /* verify a sane environment */
if (!This) return E_FAIL; if (!This) return E_FAIL;
...@@ -297,7 +294,7 @@ static HRESULT WINAPI FileLockBytesImpl_SetSize(ILockBytes* iface, ULARGE_INTEGE ...@@ -297,7 +294,7 @@ static HRESULT WINAPI FileLockBytesImpl_SetSize(ILockBytes* iface, ULARGE_INTEGE
HRESULT hr = S_OK; HRESULT hr = S_OK;
LARGE_INTEGER newpos; LARGE_INTEGER newpos;
TRACE("new size %lu\n", newSize.u.LowPart); TRACE("new size %lu\n", newSize.LowPart);
newpos.QuadPart = newSize.QuadPart; newpos.QuadPart = newSize.QuadPart;
if (SetFilePointerEx(This->hfile, newpos, NULL, FILE_BEGIN)) if (SetFilePointerEx(This->hfile, newpos, NULL, FILE_BEGIN))
...@@ -328,7 +325,7 @@ static HRESULT WINAPI FileLockBytesImpl_LockRegion(ILockBytes* iface, ...@@ -328,7 +325,7 @@ static HRESULT WINAPI FileLockBytesImpl_LockRegion(ILockBytes* iface,
OVERLAPPED ol; OVERLAPPED ol;
DWORD lock_flags = LOCKFILE_FAIL_IMMEDIATELY; DWORD lock_flags = LOCKFILE_FAIL_IMMEDIATELY;
TRACE("ofs %lu count %lu flags %lx\n", libOffset.u.LowPart, cb.u.LowPart, dwLockType); TRACE("ofs %lu count %lu flags %lx\n", libOffset.LowPart, cb.LowPart, dwLockType);
if (dwLockType & LOCK_WRITE) if (dwLockType & LOCK_WRITE)
return STG_E_INVALIDFUNCTION; return STG_E_INVALIDFUNCTION;
...@@ -337,10 +334,10 @@ static HRESULT WINAPI FileLockBytesImpl_LockRegion(ILockBytes* iface, ...@@ -337,10 +334,10 @@ static HRESULT WINAPI FileLockBytesImpl_LockRegion(ILockBytes* iface,
lock_flags |= LOCKFILE_EXCLUSIVE_LOCK; lock_flags |= LOCKFILE_EXCLUSIVE_LOCK;
ol.hEvent = 0; ol.hEvent = 0;
ol.u.s.Offset = libOffset.u.LowPart; ol.Offset = libOffset.LowPart;
ol.u.s.OffsetHigh = libOffset.u.HighPart; ol.OffsetHigh = libOffset.HighPart;
if (LockFileEx(This->hfile, lock_flags, 0, cb.u.LowPart, cb.u.HighPart, &ol)) if (LockFileEx(This->hfile, lock_flags, 0, cb.LowPart, cb.HighPart, &ol))
return S_OK; return S_OK;
return get_lock_error(); return get_lock_error();
} }
...@@ -351,16 +348,16 @@ static HRESULT WINAPI FileLockBytesImpl_UnlockRegion(ILockBytes* iface, ...@@ -351,16 +348,16 @@ static HRESULT WINAPI FileLockBytesImpl_UnlockRegion(ILockBytes* iface,
FileLockBytesImpl* This = impl_from_ILockBytes(iface); FileLockBytesImpl* This = impl_from_ILockBytes(iface);
OVERLAPPED ol; OVERLAPPED ol;
TRACE("ofs %lu count %lu flags %lx\n", libOffset.u.LowPart, cb.u.LowPart, dwLockType); TRACE("ofs %lu count %lu flags %lx\n", libOffset.LowPart, cb.LowPart, dwLockType);
if (dwLockType & LOCK_WRITE) if (dwLockType & LOCK_WRITE)
return STG_E_INVALIDFUNCTION; return STG_E_INVALIDFUNCTION;
ol.hEvent = 0; ol.hEvent = 0;
ol.u.s.Offset = libOffset.u.LowPart; ol.Offset = libOffset.LowPart;
ol.u.s.OffsetHigh = libOffset.u.HighPart; ol.OffsetHigh = libOffset.HighPart;
if (UnlockFileEx(This->hfile, 0, cb.u.LowPart, cb.u.HighPart, &ol)) if (UnlockFileEx(This->hfile, 0, cb.LowPart, cb.HighPart, &ol))
return S_OK; return S_OK;
return get_lock_error(); return get_lock_error();
} }
...@@ -382,7 +379,7 @@ static HRESULT WINAPI FileLockBytesImpl_Stat(ILockBytes* iface, ...@@ -382,7 +379,7 @@ static HRESULT WINAPI FileLockBytesImpl_Stat(ILockBytes* iface,
pstatstg->type = STGTY_LOCKBYTES; pstatstg->type = STGTY_LOCKBYTES;
pstatstg->cbSize.u.LowPart = GetFileSize(This->hfile, &pstatstg->cbSize.u.HighPart); pstatstg->cbSize.LowPart = GetFileSize(This->hfile, &pstatstg->cbSize.HighPart);
/* FIXME: If the implementation is exported, we'll need to set other fields. */ /* FIXME: If the implementation is exported, we'll need to set other fields. */
pstatstg->grfLocksSupported = LOCK_EXCLUSIVE|LOCK_ONLYONCE|WINE_LOCK_READ; pstatstg->grfLocksSupported = LOCK_EXCLUSIVE|LOCK_ONLYONCE|WINE_LOCK_READ;
......
...@@ -24,8 +24,6 @@ ...@@ -24,8 +24,6 @@
#include <string.h> #include <string.h>
#define COBJMACROS #define COBJMACROS
#define NONAMELESSUNION
#include "windef.h" #include "windef.h"
#include "winbase.h" #include "winbase.h"
#include "winerror.h" #include "winerror.h"
......
...@@ -23,8 +23,6 @@ ...@@ -23,8 +23,6 @@
#include <string.h> #include <string.h>
#define COBJMACROS #define COBJMACROS
#define NONAMELESSUNION
#include "winerror.h" #include "winerror.h"
#include "windef.h" #include "windef.h"
#include "winbase.h" #include "winbase.h"
......
...@@ -24,8 +24,6 @@ ...@@ -24,8 +24,6 @@
#include <string.h> #include <string.h>
#define COBJMACROS #define COBJMACROS
#define NONAMELESSUNION
#include "windef.h" #include "windef.h"
#include "winbase.h" #include "winbase.h"
#include "winuser.h" #include "winuser.h"
...@@ -120,8 +118,8 @@ HRESULT WINAPI CreateILockBytesOnHGlobal(HGLOBAL global, BOOL delete_on_release, ...@@ -120,8 +118,8 @@ HRESULT WINAPI CreateILockBytesOnHGlobal(HGLOBAL global, BOOL delete_on_release,
/* /*
* Initialize the size of the array to the size of the handle. * Initialize the size of the array to the size of the handle.
*/ */
lockbytes->byteArraySize.u.HighPart = 0; lockbytes->byteArraySize.HighPart = 0;
lockbytes->byteArraySize.u.LowPart = GlobalSize(lockbytes->supportHandle); lockbytes->byteArraySize.LowPart = GlobalSize(lockbytes->supportHandle);
*ret = &lockbytes->ILockBytes_iface; *ret = &lockbytes->ILockBytes_iface;
...@@ -164,18 +162,18 @@ HRESULT WINAPI GetHGlobalFromILockBytes(ILockBytes* iface, HGLOBAL* phglobal) ...@@ -164,18 +162,18 @@ HRESULT WINAPI GetHGlobalFromILockBytes(ILockBytes* iface, HGLOBAL* phglobal)
return hres; return hres;
} }
TRACE("cbSize is %s\n", wine_dbgstr_longlong(stbuf.cbSize.QuadPart)); TRACE("cbSize is %s\n", wine_dbgstr_longlong(stbuf.cbSize.QuadPart));
*phglobal = GlobalAlloc( GMEM_MOVEABLE|GMEM_SHARE, stbuf.cbSize.u.LowPart); *phglobal = GlobalAlloc( GMEM_MOVEABLE|GMEM_SHARE, stbuf.cbSize.LowPart);
if (!*phglobal) if (!*phglobal)
return E_INVALIDARG; return E_INVALIDARG;
memset(&start,0,sizeof(start)); memset(&start,0,sizeof(start));
hres = ILockBytes_ReadAt(iface, start, GlobalLock(*phglobal), stbuf.cbSize.u.LowPart, &xread); hres = ILockBytes_ReadAt(iface, start, GlobalLock(*phglobal), stbuf.cbSize.LowPart, &xread);
GlobalUnlock(*phglobal); GlobalUnlock(*phglobal);
if (hres != S_OK) { if (hres != S_OK) {
FIXME("%p->ReadAt failed with %lx\n",iface,hres); FIXME("%p->ReadAt failed with %lx\n",iface,hres);
return hres; return hres;
} }
if (stbuf.cbSize.u.LowPart != xread) { if (stbuf.cbSize.LowPart != xread) {
FIXME("Read size is not requested size %ld vs %ld?\n",stbuf.cbSize.u.LowPart, xread); FIXME("Read size is not requested size %ld vs %ld?\n",stbuf.cbSize.LowPart, xread);
} }
return S_OK; return S_OK;
} }
...@@ -279,15 +277,14 @@ static HRESULT WINAPI HGLOBALLockBytesImpl_ReadAt( ...@@ -279,15 +277,14 @@ static HRESULT WINAPI HGLOBALLockBytesImpl_ReadAt(
/* /*
* Make sure the offset is valid. * Make sure the offset is valid.
*/ */
if (ulOffset.u.LowPart > This->byteArraySize.u.LowPart) if (ulOffset.LowPart > This->byteArraySize.LowPart)
return E_FAIL; return E_FAIL;
/* /*
* Using the known size of the array, calculate the number of bytes * Using the known size of the array, calculate the number of bytes
* to read. * to read.
*/ */
bytesToReadFromBuffer = min(This->byteArraySize.u.LowPart - bytesToReadFromBuffer = min(This->byteArraySize.LowPart - ulOffset.LowPart, cb);
ulOffset.u.LowPart, cb);
/* /*
* Lock the buffer in position and copy the data. * Lock the buffer in position and copy the data.
...@@ -295,7 +292,7 @@ static HRESULT WINAPI HGLOBALLockBytesImpl_ReadAt( ...@@ -295,7 +292,7 @@ static HRESULT WINAPI HGLOBALLockBytesImpl_ReadAt(
supportBuffer = GlobalLock(This->supportHandle); supportBuffer = GlobalLock(This->supportHandle);
memcpy(pv, memcpy(pv,
(char *) supportBuffer + ulOffset.u.LowPart, (char *) supportBuffer + ulOffset.LowPart,
bytesToReadFromBuffer); bytesToReadFromBuffer);
/* /*
...@@ -354,14 +351,14 @@ static HRESULT WINAPI HGLOBALLockBytesImpl_WriteAt( ...@@ -354,14 +351,14 @@ static HRESULT WINAPI HGLOBALLockBytesImpl_WriteAt(
} }
else else
{ {
newSize.u.HighPart = 0; newSize.HighPart = 0;
newSize.u.LowPart = ulOffset.u.LowPart + cb; newSize.LowPart = ulOffset.LowPart + cb;
} }
/* /*
* Verify if we need to grow the stream * Verify if we need to grow the stream
*/ */
if (newSize.u.LowPart > This->byteArraySize.u.LowPart) if (newSize.LowPart > This->byteArraySize.LowPart)
{ {
/* grow stream */ /* grow stream */
if (ILockBytes_SetSize(iface, newSize) == STG_E_MEDIUMFULL) if (ILockBytes_SetSize(iface, newSize) == STG_E_MEDIUMFULL)
...@@ -373,7 +370,7 @@ static HRESULT WINAPI HGLOBALLockBytesImpl_WriteAt( ...@@ -373,7 +370,7 @@ static HRESULT WINAPI HGLOBALLockBytesImpl_WriteAt(
*/ */
supportBuffer = GlobalLock(This->supportHandle); supportBuffer = GlobalLock(This->supportHandle);
memcpy((char *) supportBuffer + ulOffset.u.LowPart, pv, cb); memcpy((char *) supportBuffer + ulOffset.LowPart, pv, cb);
/* /*
* Return the number of bytes written. * Return the number of bytes written.
...@@ -415,22 +412,22 @@ static HRESULT WINAPI HGLOBALLockBytesImpl_SetSize( ...@@ -415,22 +412,22 @@ static HRESULT WINAPI HGLOBALLockBytesImpl_SetSize(
/* /*
* As documented. * As documented.
*/ */
if (libNewSize.u.HighPart != 0) if (libNewSize.HighPart != 0)
return STG_E_INVALIDFUNCTION; return STG_E_INVALIDFUNCTION;
if (This->byteArraySize.u.LowPart == libNewSize.u.LowPart) if (This->byteArraySize.LowPart == libNewSize.LowPart)
return S_OK; return S_OK;
/* /*
* Re allocate the HGlobal to fit the new size of the stream. * Re allocate the HGlobal to fit the new size of the stream.
*/ */
supportHandle = GlobalReAlloc(This->supportHandle, libNewSize.u.LowPart, GMEM_MOVEABLE); supportHandle = GlobalReAlloc(This->supportHandle, libNewSize.LowPart, GMEM_MOVEABLE);
if (supportHandle == 0) if (supportHandle == 0)
return STG_E_MEDIUMFULL; return STG_E_MEDIUMFULL;
This->supportHandle = supportHandle; This->supportHandle = supportHandle;
This->byteArraySize.u.LowPart = libNewSize.u.LowPart; This->byteArraySize.LowPart = libNewSize.LowPart;
return S_OK; return S_OK;
} }
......
...@@ -31,8 +31,6 @@ ...@@ -31,8 +31,6 @@
#include <string.h> #include <string.h>
#define COBJMACROS #define COBJMACROS
#define NONAMELESSUNION
#include "windef.h" #include "windef.h"
#include "winbase.h" #include "winbase.h"
#include "winerror.h" #include "winerror.h"
...@@ -2010,64 +2008,64 @@ void WINAPI ReleaseStgMedium( ...@@ -2010,64 +2008,64 @@ void WINAPI ReleaseStgMedium(
case TYMED_HGLOBAL: case TYMED_HGLOBAL:
{ {
if ( (pmedium->pUnkForRelease==0) && if ( (pmedium->pUnkForRelease==0) &&
(pmedium->u.hGlobal!=0) ) (pmedium->hGlobal!=0) )
GlobalFree(pmedium->u.hGlobal); GlobalFree(pmedium->hGlobal);
break; break;
} }
case TYMED_FILE: case TYMED_FILE:
{ {
if (pmedium->u.lpszFileName!=0) if (pmedium->lpszFileName!=0)
{ {
if (pmedium->pUnkForRelease==0) if (pmedium->pUnkForRelease==0)
{ {
DeleteFileW(pmedium->u.lpszFileName); DeleteFileW(pmedium->lpszFileName);
} }
CoTaskMemFree(pmedium->u.lpszFileName); CoTaskMemFree(pmedium->lpszFileName);
} }
break; break;
} }
case TYMED_ISTREAM: case TYMED_ISTREAM:
{ {
if (pmedium->u.pstm!=0) if (pmedium->pstm!=0)
{ {
IStream_Release(pmedium->u.pstm); IStream_Release(pmedium->pstm);
} }
break; break;
} }
case TYMED_ISTORAGE: case TYMED_ISTORAGE:
{ {
if (pmedium->u.pstg!=0) if (pmedium->pstg!=0)
{ {
IStorage_Release(pmedium->u.pstg); IStorage_Release(pmedium->pstg);
} }
break; break;
} }
case TYMED_GDI: case TYMED_GDI:
{ {
if ( (pmedium->pUnkForRelease==0) && if ( (pmedium->pUnkForRelease==0) &&
(pmedium->u.hBitmap!=0) ) (pmedium->hBitmap!=0) )
DeleteObject(pmedium->u.hBitmap); DeleteObject(pmedium->hBitmap);
break; break;
} }
case TYMED_MFPICT: case TYMED_MFPICT:
{ {
if ( (pmedium->pUnkForRelease==0) && if ( (pmedium->pUnkForRelease==0) &&
(pmedium->u.hMetaFilePict!=0) ) (pmedium->hMetaFilePict!=0) )
{ {
LPMETAFILEPICT pMP = GlobalLock(pmedium->u.hMetaFilePict); LPMETAFILEPICT pMP = GlobalLock(pmedium->hMetaFilePict);
DeleteMetaFile(pMP->hMF); DeleteMetaFile(pMP->hMF);
GlobalUnlock(pmedium->u.hMetaFilePict); GlobalUnlock(pmedium->hMetaFilePict);
GlobalFree(pmedium->u.hMetaFilePict); GlobalFree(pmedium->hMetaFilePict);
} }
break; break;
} }
case TYMED_ENHMF: case TYMED_ENHMF:
{ {
if ( (pmedium->pUnkForRelease==0) && if ( (pmedium->pUnkForRelease==0) &&
(pmedium->u.hEnhMetaFile!=0) ) (pmedium->hEnhMetaFile!=0) )
{ {
DeleteEnhMetaFile(pmedium->u.hEnhMetaFile); DeleteEnhMetaFile(pmedium->hEnhMetaFile);
} }
break; break;
} }
...@@ -2782,7 +2780,7 @@ static HRESULT get_storage(IDataObject *data, IStorage *stg, UINT *src_cf, BOOL ...@@ -2782,7 +2780,7 @@ static HRESULT get_storage(IDataObject *data, IStorage *stg, UINT *src_cf, BOOL
/* CF_EMBEDEDOBJECT */ /* CF_EMBEDEDOBJECT */
init_fmtetc(&fmt, embedded_object_clipboard_format, TYMED_ISTORAGE); init_fmtetc(&fmt, embedded_object_clipboard_format, TYMED_ISTORAGE);
med.tymed = TYMED_ISTORAGE; med.tymed = TYMED_ISTORAGE;
med.u.pstg = stg; med.pstg = stg;
med.pUnkForRelease = NULL; med.pUnkForRelease = NULL;
hr = IDataObject_GetDataHere(data, &fmt, &med); hr = IDataObject_GetDataHere(data, &fmt, &med);
if(SUCCEEDED(hr)) if(SUCCEEDED(hr))
...@@ -2794,7 +2792,7 @@ static HRESULT get_storage(IDataObject *data, IStorage *stg, UINT *src_cf, BOOL ...@@ -2794,7 +2792,7 @@ static HRESULT get_storage(IDataObject *data, IStorage *stg, UINT *src_cf, BOOL
/* CF_EMBEDSOURCE */ /* CF_EMBEDSOURCE */
init_fmtetc(&fmt, embed_source_clipboard_format, TYMED_ISTORAGE); init_fmtetc(&fmt, embed_source_clipboard_format, TYMED_ISTORAGE);
med.tymed = TYMED_ISTORAGE; med.tymed = TYMED_ISTORAGE;
med.u.pstg = stg; med.pstg = stg;
med.pUnkForRelease = NULL; med.pUnkForRelease = NULL;
hr = IDataObject_GetDataHere(data, &fmt, &med); hr = IDataObject_GetDataHere(data, &fmt, &med);
if(SUCCEEDED(hr)) if(SUCCEEDED(hr))
......
...@@ -24,8 +24,6 @@ ...@@ -24,8 +24,6 @@
#include <string.h> #include <string.h>
#define COBJMACROS #define COBJMACROS
#define NONAMELESSUNION
#include "windef.h" #include "windef.h"
#include "winbase.h" #include "winbase.h"
#include "winuser.h" #include "winuser.h"
...@@ -767,7 +765,7 @@ static HRESULT WINAPI DataAdviseHolder_SendOnDataChange(IDataAdviseHolder *iface ...@@ -767,7 +765,7 @@ static HRESULT WINAPI DataAdviseHolder_SendOnDataChange(IDataAdviseHolder *iface
{ {
STGMEDIUM stg; STGMEDIUM stg;
stg.tymed = TYMED_NULL; stg.tymed = TYMED_NULL;
stg.u.pstg = NULL; stg.pstg = NULL;
stg.pUnkForRelease = NULL; stg.pUnkForRelease = NULL;
if(!(statdata.advf & ADVF_NODATA)) if(!(statdata.advf & ADVF_NODATA))
......
...@@ -23,8 +23,6 @@ ...@@ -23,8 +23,6 @@
#include <string.h> #include <string.h>
#define COBJMACROS #define COBJMACROS
#define NONAMELESSUNION
#include "windef.h" #include "windef.h"
#include "winbase.h" #include "winbase.h"
#include "winerror.h" #include "winerror.h"
......
...@@ -44,8 +44,6 @@ ...@@ -44,8 +44,6 @@
#include <string.h> #include <string.h>
#define COBJMACROS #define COBJMACROS
#define NONAMELESSUNION
#include "windef.h" #include "windef.h"
#include "winbase.h" #include "winbase.h"
#include "winnls.h" #include "winnls.h"
...@@ -499,7 +497,7 @@ static HRESULT WINAPI IPropertyStorage_fnReadMultiple( ...@@ -499,7 +497,7 @@ static HRESULT WINAPI IPropertyStorage_fnReadMultiple(
if (rgpspec[i].ulKind == PRSPEC_LPWSTR) if (rgpspec[i].ulKind == PRSPEC_LPWSTR)
{ {
PROPVARIANT *prop = PropertyStorage_FindPropertyByName(This, PROPVARIANT *prop = PropertyStorage_FindPropertyByName(This,
rgpspec[i].u.lpwstr); rgpspec[i].lpwstr);
if (prop) if (prop)
PropertyStorage_PropVariantCopy(&rgpropvar[i], prop, GetACP(), PropertyStorage_PropVariantCopy(&rgpropvar[i], prop, GetACP(),
...@@ -507,7 +505,7 @@ static HRESULT WINAPI IPropertyStorage_fnReadMultiple( ...@@ -507,7 +505,7 @@ static HRESULT WINAPI IPropertyStorage_fnReadMultiple(
} }
else else
{ {
switch (rgpspec[i].u.propid) switch (rgpspec[i].propid)
{ {
case PID_CODEPAGE: case PID_CODEPAGE:
rgpropvar[i].vt = VT_I2; rgpropvar[i].vt = VT_I2;
...@@ -520,7 +518,7 @@ static HRESULT WINAPI IPropertyStorage_fnReadMultiple( ...@@ -520,7 +518,7 @@ static HRESULT WINAPI IPropertyStorage_fnReadMultiple(
default: default:
{ {
PROPVARIANT *prop = PropertyStorage_FindProperty(This, PROPVARIANT *prop = PropertyStorage_FindProperty(This,
rgpspec[i].u.propid); rgpspec[i].propid);
if (prop) if (prop)
PropertyStorage_PropVariantCopy(&rgpropvar[i], prop, PropertyStorage_PropVariantCopy(&rgpropvar[i], prop,
...@@ -765,7 +763,7 @@ static HRESULT WINAPI IPropertyStorage_fnWriteMultiple( ...@@ -765,7 +763,7 @@ static HRESULT WINAPI IPropertyStorage_fnWriteMultiple(
if (rgpspec[i].ulKind == PRSPEC_LPWSTR) if (rgpspec[i].ulKind == PRSPEC_LPWSTR)
{ {
PROPVARIANT *prop = PropertyStorage_FindPropertyByName(This, PROPVARIANT *prop = PropertyStorage_FindPropertyByName(This,
rgpspec[i].u.lpwstr); rgpspec[i].lpwstr);
if (prop) if (prop)
PropVariantCopy(prop, &rgpropvar[i]); PropVariantCopy(prop, &rgpropvar[i]);
...@@ -782,7 +780,7 @@ static HRESULT WINAPI IPropertyStorage_fnWriteMultiple( ...@@ -782,7 +780,7 @@ static HRESULT WINAPI IPropertyStorage_fnWriteMultiple(
PROPID nextId = max(propidNameFirst, This->highestProp + 1); PROPID nextId = max(propidNameFirst, This->highestProp + 1);
hr = PropertyStorage_StoreNameWithId(This, hr = PropertyStorage_StoreNameWithId(This,
(LPCSTR)rgpspec[i].u.lpwstr, CP_UNICODE, nextId); (LPCSTR)rgpspec[i].lpwstr, CP_UNICODE, nextId);
if (SUCCEEDED(hr)) if (SUCCEEDED(hr))
hr = PropertyStorage_StorePropWithId(This, nextId, hr = PropertyStorage_StorePropWithId(This, nextId,
&rgpropvar[i], GetACP()); &rgpropvar[i], GetACP());
...@@ -791,7 +789,7 @@ static HRESULT WINAPI IPropertyStorage_fnWriteMultiple( ...@@ -791,7 +789,7 @@ static HRESULT WINAPI IPropertyStorage_fnWriteMultiple(
} }
else else
{ {
switch (rgpspec[i].u.propid) switch (rgpspec[i].propid)
{ {
case PID_DICTIONARY: case PID_DICTIONARY:
/* Can't set the dictionary */ /* Can't set the dictionary */
...@@ -823,11 +821,11 @@ static HRESULT WINAPI IPropertyStorage_fnWriteMultiple( ...@@ -823,11 +821,11 @@ static HRESULT WINAPI IPropertyStorage_fnWriteMultiple(
/* silently ignore like MSDN says */ /* silently ignore like MSDN says */
break; break;
default: default:
if (rgpspec[i].u.propid >= PID_MIN_READONLY) if (rgpspec[i].propid >= PID_MIN_READONLY)
hr = STG_E_INVALIDPARAMETER; hr = STG_E_INVALIDPARAMETER;
else else
hr = PropertyStorage_StorePropWithId(This, hr = PropertyStorage_StorePropWithId(This,
rgpspec[i].u.propid, &rgpropvar[i], GetACP()); rgpspec[i].propid, &rgpropvar[i], GetACP());
} }
} }
} }
...@@ -864,14 +862,14 @@ static HRESULT WINAPI IPropertyStorage_fnDeleteMultiple( ...@@ -864,14 +862,14 @@ static HRESULT WINAPI IPropertyStorage_fnDeleteMultiple(
{ {
void *propid; void *propid;
if (dictionary_find(This->name_to_propid, rgpspec[i].u.lpwstr, &propid)) if (dictionary_find(This->name_to_propid, rgpspec[i].lpwstr, &propid))
dictionary_remove(This->propid_to_prop, propid); dictionary_remove(This->propid_to_prop, propid);
} }
else else
{ {
if (rgpspec[i].u.propid >= PID_FIRST_USABLE && if (rgpspec[i].propid >= PID_FIRST_USABLE &&
rgpspec[i].u.propid < PID_MIN_READONLY) rgpspec[i].propid < PID_MIN_READONLY)
dictionary_remove(This->propid_to_prop, UlongToPtr(rgpspec[i].u.propid)); dictionary_remove(This->propid_to_prop, UlongToPtr(rgpspec[i].propid));
else else
hr = STG_E_INVALIDPARAMETER; hr = STG_E_INVALIDPARAMETER;
} }
...@@ -1746,20 +1744,20 @@ static HRESULT PropertyStorage_ReadFromStream(PropertyStorage_impl *This) ...@@ -1746,20 +1744,20 @@ static HRESULT PropertyStorage_ReadFromStream(PropertyStorage_impl *This)
hr = IStream_Stat(This->stm, &stat, STATFLAG_NONAME); hr = IStream_Stat(This->stm, &stat, STATFLAG_NONAME);
if (FAILED(hr)) if (FAILED(hr))
goto end; goto end;
if (stat.cbSize.u.HighPart) if (stat.cbSize.HighPart)
{ {
WARN("stream too big\n"); WARN("stream too big\n");
/* maximum size varies, but it can't be this big */ /* maximum size varies, but it can't be this big */
hr = STG_E_INVALIDHEADER; hr = STG_E_INVALIDHEADER;
goto end; goto end;
} }
if (stat.cbSize.u.LowPart == 0) if (stat.cbSize.LowPart == 0)
{ {
/* empty stream is okay */ /* empty stream is okay */
hr = S_OK; hr = S_OK;
goto end; goto end;
} }
else if (stat.cbSize.u.LowPart < sizeof(PROPERTYSETHEADER) + else if (stat.cbSize.LowPart < sizeof(PROPERTYSETHEADER) +
sizeof(FORMATIDOFFSET)) sizeof(FORMATIDOFFSET))
{ {
WARN("stream too small\n"); WARN("stream too small\n");
...@@ -1794,9 +1792,9 @@ static HRESULT PropertyStorage_ReadFromStream(PropertyStorage_impl *This) ...@@ -1794,9 +1792,9 @@ static HRESULT PropertyStorage_ReadFromStream(PropertyStorage_impl *This)
hr = PropertyStorage_ReadFmtIdOffsetFromStream(This->stm, &fmtOffset); hr = PropertyStorage_ReadFmtIdOffsetFromStream(This->stm, &fmtOffset);
if (FAILED(hr)) if (FAILED(hr))
goto end; goto end;
if (fmtOffset.dwOffset > stat.cbSize.u.LowPart) if (fmtOffset.dwOffset > stat.cbSize.LowPart)
{ {
WARN("invalid offset %ld (stream length is %ld)\n", fmtOffset.dwOffset, stat.cbSize.u.LowPart); WARN("invalid offset %ld (stream length is %ld)\n", fmtOffset.dwOffset, stat.cbSize.LowPart);
hr = STG_E_INVALIDHEADER; hr = STG_E_INVALIDHEADER;
goto end; goto end;
} }
......
...@@ -29,8 +29,6 @@ ...@@ -29,8 +29,6 @@
#include <string.h> #include <string.h>
#define COBJMACROS #define COBJMACROS
#define NONAMELESSUNION
#include "windef.h" #include "windef.h"
#include "winbase.h" #include "winbase.h"
#include "winerror.h" #include "winerror.h"
...@@ -272,7 +270,7 @@ static HRESULT WINAPI StgStreamImpl_Seek( ...@@ -272,7 +270,7 @@ static HRESULT WINAPI StgStreamImpl_Seek(
DirEntry currentEntry; DirEntry currentEntry;
HRESULT hr; HRESULT hr;
TRACE("%p, %ld, %ld, %p.\n", iface, dlibMove.u.LowPart, dwOrigin, plibNewPosition); TRACE("%p, %ld, %ld, %p.\n", iface, dlibMove.LowPart, dwOrigin, plibNewPosition);
/* /*
* fail if the stream has no parent (as does windows) * fail if the stream has no parent (as does windows)
...@@ -342,7 +340,7 @@ static HRESULT WINAPI StgStreamImpl_SetSize( ...@@ -342,7 +340,7 @@ static HRESULT WINAPI StgStreamImpl_SetSize(
HRESULT hr; HRESULT hr;
TRACE("%p, %ld.\n", iface, libNewSize.u.LowPart); TRACE("%p, %ld.\n", iface, libNewSize.LowPart);
if(!This->parentStorage) if(!This->parentStorage)
{ {
...@@ -353,9 +351,9 @@ static HRESULT WINAPI StgStreamImpl_SetSize( ...@@ -353,9 +351,9 @@ static HRESULT WINAPI StgStreamImpl_SetSize(
/* /*
* As documented. * As documented.
*/ */
if (libNewSize.u.HighPart != 0) if (libNewSize.HighPart != 0)
{ {
WARN("invalid value for libNewSize.u.HighPart %ld\n", libNewSize.u.HighPart); WARN("invalid value for libNewSize.HighPart %ld\n", libNewSize.HighPart);
return STG_E_INVALIDFUNCTION; return STG_E_INVALIDFUNCTION;
} }
...@@ -397,7 +395,7 @@ static HRESULT WINAPI StgStreamImpl_CopyTo( ...@@ -397,7 +395,7 @@ static HRESULT WINAPI StgStreamImpl_CopyTo(
ULARGE_INTEGER totalBytesRead; ULARGE_INTEGER totalBytesRead;
ULARGE_INTEGER totalBytesWritten; ULARGE_INTEGER totalBytesWritten;
TRACE("%p, %p, %ld, %p, %p.\n", iface, pstm, cb.u.LowPart, pcbRead, pcbWritten); TRACE("%p, %p, %ld, %p, %p.\n", iface, pstm, cb.LowPart, pcbRead, pcbWritten);
/* /*
* Sanity check * Sanity check
...@@ -420,7 +418,7 @@ static HRESULT WINAPI StgStreamImpl_CopyTo( ...@@ -420,7 +418,7 @@ static HRESULT WINAPI StgStreamImpl_CopyTo(
if ( cb.QuadPart >= sizeof(tmpBuffer) ) if ( cb.QuadPart >= sizeof(tmpBuffer) )
copySize = sizeof(tmpBuffer); copySize = sizeof(tmpBuffer);
else else
copySize = cb.u.LowPart; copySize = cb.LowPart;
IStream_Read(iface, tmpBuffer, copySize, &bytesRead); IStream_Read(iface, tmpBuffer, copySize, &bytesRead);
...@@ -696,8 +694,8 @@ StgStreamImpl* StgStreamImpl_Construct( ...@@ -696,8 +694,8 @@ StgStreamImpl* StgStreamImpl_Construct(
/* /*
* Start the stream at the beginning. * Start the stream at the beginning.
*/ */
newStream->currentPosition.u.HighPart = 0; newStream->currentPosition.HighPart = 0;
newStream->currentPosition.u.LowPart = 0; newStream->currentPosition.LowPart = 0;
/* add us to the storage's list of active streams */ /* add us to the storage's list of active streams */
StorageBaseImpl_AddStream(parentStorage, newStream); StorageBaseImpl_AddStream(parentStorage, newStream);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment