Commit 374d74e8 authored by Alexandre Julliard's avatar Alexandre Julliard

oleaut32: Use nameless unions/structs.

parent 36963b6d
...@@ -26,9 +26,6 @@ ...@@ -26,9 +26,6 @@
#include <string.h> #include <string.h>
#define COBJMACROS #define COBJMACROS
#define NONAMELESSUNION
#define NONAMELESSSTRUCT
#include "winerror.h" #include "winerror.h"
#include "windef.h" #include "windef.h"
#include "winbase.h" #include "winbase.h"
...@@ -331,8 +328,8 @@ HRESULT WINAPI OleCreateFontIndirect( ...@@ -331,8 +328,8 @@ HRESULT WINAPI OleCreateFontIndirect(
fd.cbSizeofstruct = sizeof(fd); fd.cbSizeofstruct = sizeof(fd);
fd.lpstrName = fname; fd.lpstrName = fname;
fd.cySize.s.Lo = 80000; fd.cySize.Lo = 80000;
fd.cySize.s.Hi = 0; fd.cySize.Hi = 0;
fd.sWeight = 0; fd.sWeight = 0;
fd.sCharset = 0; fd.sCharset = 0;
fd.fItalic = FALSE; fd.fItalic = FALSE;
...@@ -586,7 +583,7 @@ static void realize_font(OLEFontImpl *This) ...@@ -586,7 +583,7 @@ static void realize_font(OLEFontImpl *This)
* Ratio is applied here relative to the standard. * Ratio is applied here relative to the standard.
*/ */
fontHeight = MulDiv( This->description.cySize.s.Lo, This->cyLogical*635, This->cyHimetric*18 ); fontHeight = MulDiv( This->description.cySize.Lo, This->cyLogical*635, This->cyHimetric*18 );
logFont.lfHeight = ((fontHeight%10000L)>5000L) ? (-fontHeight/10000L) - 1 : logFont.lfHeight = ((fontHeight%10000L)>5000L) ? (-fontHeight/10000L) - 1 :
(-fontHeight/10000L); (-fontHeight/10000L);
...@@ -685,10 +682,8 @@ static HRESULT WINAPI OLEFontImpl_get_Size( ...@@ -685,10 +682,8 @@ static HRESULT WINAPI OLEFontImpl_get_Size(
* Convert realized font height in pixels to points descaled by current * Convert realized font height in pixels to points descaled by current
* scaling ratio then scaled up by 10000. * scaling ratio then scaled up by 10000.
*/ */
psize->s.Lo = MulDiv(this->nRealHeight, psize->Lo = MulDiv(this->nRealHeight, this->cyHimetric * 72 * 10000, this->cyLogical * 2540);
this->cyHimetric * 72 * 10000, psize->Hi = 0;
this->cyLogical * 2540);
psize->s.Hi = 0;
return S_OK; return S_OK;
} }
...@@ -696,9 +691,9 @@ static HRESULT WINAPI OLEFontImpl_get_Size( ...@@ -696,9 +691,9 @@ static HRESULT WINAPI OLEFontImpl_get_Size(
static HRESULT WINAPI OLEFontImpl_put_Size(IFont *iface, CY size) static HRESULT WINAPI OLEFontImpl_put_Size(IFont *iface, CY size)
{ {
OLEFontImpl *this = impl_from_IFont(iface); OLEFontImpl *this = impl_from_IFont(iface);
TRACE("%p, %ld.\n", iface, size.s.Lo); TRACE("%p, %ld.\n", iface, size.Lo);
this->description.cySize.s.Hi = 0; this->description.cySize.Hi = 0;
this->description.cySize.s.Lo = size.s.Lo; this->description.cySize.Lo = size.Lo;
OLEFont_SendNotify(this, DISPID_FONT_SIZE); OLEFont_SendNotify(this, DISPID_FONT_SIZE);
return S_OK; return S_OK;
...@@ -997,9 +992,9 @@ static HRESULT WINAPI OLEFontImpl_IsEqual( ...@@ -997,9 +992,9 @@ static HRESULT WINAPI OLEFontImpl_IsEqual(
if(pFontOther == NULL) if(pFontOther == NULL)
return E_POINTER; return E_POINTER;
else if (left->description.cySize.s.Lo != right->description.cySize.s.Lo) else if (left->description.cySize.Lo != right->description.cySize.Lo)
return S_FALSE; return S_FALSE;
else if (left->description.cySize.s.Hi != right->description.cySize.s.Hi) else if (left->description.cySize.Hi != right->description.cySize.Hi)
return S_FALSE; return S_FALSE;
else if (left->description.sWeight != right->description.sWeight) else if (left->description.sWeight != right->description.sWeight)
return S_FALSE; return S_FALSE;
...@@ -1600,10 +1595,10 @@ static HRESULT WINAPI OLEFontImpl_Load( ...@@ -1600,10 +1595,10 @@ static HRESULT WINAPI OLEFontImpl_Load(
if (cbRead != sizeof(WORD)) return E_FAIL; if (cbRead != sizeof(WORD)) return E_FAIL;
/* Size */ /* Size */
IStream_Read(pLoadStream, &this->description.cySize.s.Lo, sizeof(DWORD), &cbRead); IStream_Read(pLoadStream, &this->description.cySize.Lo, sizeof(DWORD), &cbRead);
if (cbRead != sizeof(DWORD)) return E_FAIL; if (cbRead != sizeof(DWORD)) return E_FAIL;
this->description.cySize.s.Hi = 0; this->description.cySize.Hi = 0;
/* Name */ /* Name */
IStream_Read(pLoadStream, &string_size, sizeof(BYTE), &cbRead); IStream_Read(pLoadStream, &string_size, sizeof(BYTE), &cbRead);
...@@ -1671,7 +1666,7 @@ static HRESULT WINAPI OLEFontImpl_Save( ...@@ -1671,7 +1666,7 @@ static HRESULT WINAPI OLEFontImpl_Save(
if (written != sizeof(WORD)) return E_FAIL; if (written != sizeof(WORD)) return E_FAIL;
/* Size */ /* Size */
IStream_Write(pOutStream, &this->description.cySize.s.Lo, sizeof(DWORD), &written); IStream_Write(pOutStream, &this->description.cySize.Lo, sizeof(DWORD), &written);
if (written != sizeof(DWORD)) return E_FAIL; if (written != sizeof(DWORD)) return E_FAIL;
/* FontName */ /* FontName */
......
...@@ -41,8 +41,6 @@ ...@@ -41,8 +41,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"
...@@ -201,8 +199,8 @@ static void OLEPictureImpl_SetBitmap(OLEPictureImpl *This) ...@@ -201,8 +199,8 @@ static void OLEPictureImpl_SetBitmap(OLEPictureImpl *This)
BITMAP bm; BITMAP bm;
HDC hdcRef; HDC hdcRef;
TRACE("bitmap handle %p\n", This->desc.u.bmp.hbitmap); TRACE("bitmap handle %p\n", This->desc.bmp.hbitmap);
if(GetObjectW(This->desc.u.bmp.hbitmap, sizeof(bm), &bm) != sizeof(bm)) { if(GetObjectW(This->desc.bmp.hbitmap, sizeof(bm), &bm) != sizeof(bm)) {
ERR("GetObject fails\n"); ERR("GetObject fails\n");
return; return;
} }
...@@ -230,8 +228,8 @@ static void OLEPictureImpl_SetIcon(OLEPictureImpl * This) ...@@ -230,8 +228,8 @@ static void OLEPictureImpl_SetIcon(OLEPictureImpl * This)
{ {
ICONINFO infoIcon; ICONINFO infoIcon;
TRACE("icon handle %p\n", This->desc.u.icon.hicon); TRACE("icon handle %p\n", This->desc.icon.hicon);
if (GetIconInfo(This->desc.u.icon.hicon, &infoIcon)) { if (GetIconInfo(This->desc.icon.hicon, &infoIcon)) {
HDC hdcRef; HDC hdcRef;
BITMAP bm; BITMAP bm;
...@@ -254,7 +252,7 @@ static void OLEPictureImpl_SetIcon(OLEPictureImpl * This) ...@@ -254,7 +252,7 @@ static void OLEPictureImpl_SetIcon(OLEPictureImpl * This)
DeleteObject(infoIcon.hbmMask); DeleteObject(infoIcon.hbmMask);
if (infoIcon.hbmColor) DeleteObject(infoIcon.hbmColor); if (infoIcon.hbmColor) DeleteObject(infoIcon.hbmColor);
} else { } else {
ERR("GetIconInfo() fails on icon %p\n", This->desc.u.icon.hicon); ERR("GetIconInfo() fails on icon %p\n", This->desc.icon.hicon);
} }
} }
...@@ -326,9 +324,9 @@ static HRESULT OLEPictureImpl_Construct(LPPICTDESC pictDesc, BOOL fOwn, OLEPictu ...@@ -326,9 +324,9 @@ static HRESULT OLEPictureImpl_Construct(LPPICTDESC pictDesc, BOOL fOwn, OLEPictu
break; break;
case PICTYPE_METAFILE: case PICTYPE_METAFILE:
TRACE("metafile handle %p\n", pictDesc->u.wmf.hmeta); TRACE("metafile handle %p\n", pictDesc->wmf.hmeta);
newObject->himetricWidth = pictDesc->u.wmf.xExt; newObject->himetricWidth = pictDesc->wmf.xExt;
newObject->himetricHeight = pictDesc->u.wmf.yExt; newObject->himetricHeight = pictDesc->wmf.yExt;
break; break;
case PICTYPE_NONE: case PICTYPE_NONE:
...@@ -375,18 +373,18 @@ static void OLEPictureImpl_Destroy(OLEPictureImpl* Obj) ...@@ -375,18 +373,18 @@ static void OLEPictureImpl_Destroy(OLEPictureImpl* Obj)
if(Obj->fOwn) { /* We need to destroy the picture */ if(Obj->fOwn) { /* We need to destroy the picture */
switch(Obj->desc.picType) { switch(Obj->desc.picType) {
case PICTYPE_BITMAP: case PICTYPE_BITMAP:
DeleteObject(Obj->desc.u.bmp.hbitmap); DeleteObject(Obj->desc.bmp.hbitmap);
if (Obj->hbmMask != NULL) DeleteObject(Obj->hbmMask); if (Obj->hbmMask != NULL) DeleteObject(Obj->hbmMask);
if (Obj->hbmXor != NULL) DeleteObject(Obj->hbmXor); if (Obj->hbmXor != NULL) DeleteObject(Obj->hbmXor);
break; break;
case PICTYPE_METAFILE: case PICTYPE_METAFILE:
DeleteMetaFile(Obj->desc.u.wmf.hmeta); DeleteMetaFile(Obj->desc.wmf.hmeta);
break; break;
case PICTYPE_ICON: case PICTYPE_ICON:
DestroyIcon(Obj->desc.u.icon.hicon); DestroyIcon(Obj->desc.icon.hicon);
break; break;
case PICTYPE_ENHMETAFILE: case PICTYPE_ENHMETAFILE:
DeleteEnhMetaFile(Obj->desc.u.emf.hemf); DeleteEnhMetaFile(Obj->desc.emf.hemf);
break; break;
case PICTYPE_NONE: case PICTYPE_NONE:
case PICTYPE_UNINITIALIZED: case PICTYPE_UNINITIALIZED:
...@@ -503,16 +501,16 @@ static HRESULT WINAPI OLEPictureImpl_get_Handle(IPicture *iface, ...@@ -503,16 +501,16 @@ static HRESULT WINAPI OLEPictureImpl_get_Handle(IPicture *iface,
*phandle = 0; *phandle = 0;
break; break;
case PICTYPE_BITMAP: case PICTYPE_BITMAP:
*phandle = HandleToUlong(This->desc.u.bmp.hbitmap); *phandle = HandleToUlong(This->desc.bmp.hbitmap);
break; break;
case PICTYPE_METAFILE: case PICTYPE_METAFILE:
*phandle = HandleToUlong(This->desc.u.wmf.hmeta); *phandle = HandleToUlong(This->desc.wmf.hmeta);
break; break;
case PICTYPE_ICON: case PICTYPE_ICON:
*phandle = HandleToUlong(This->desc.u.icon.hicon); *phandle = HandleToUlong(This->desc.icon.hicon);
break; break;
case PICTYPE_ENHMETAFILE: case PICTYPE_ENHMETAFILE:
*phandle = HandleToUlong(This->desc.u.emf.hemf); *phandle = HandleToUlong(This->desc.emf.hemf);
break; break;
default: default:
FIXME("Unimplemented type %d\n", This->desc.picType); FIXME("Unimplemented type %d\n", This->desc.picType);
...@@ -536,7 +534,7 @@ static HRESULT WINAPI OLEPictureImpl_get_hPal(IPicture *iface, ...@@ -536,7 +534,7 @@ static HRESULT WINAPI OLEPictureImpl_get_hPal(IPicture *iface,
if (This->desc.picType == PICTYPE_BITMAP) if (This->desc.picType == PICTYPE_BITMAP)
{ {
*phandle = HandleToUlong(This->desc.u.bmp.hpal); *phandle = HandleToUlong(This->desc.bmp.hpal);
return S_OK; return S_OK;
} }
...@@ -661,7 +659,7 @@ static HRESULT WINAPI OLEPictureImpl_Render(IPicture *iface, HDC hdc, ...@@ -661,7 +659,7 @@ static HRESULT WINAPI OLEPictureImpl_Render(IPicture *iface, HDC hdc,
else else
{ {
hbmMask = 0; hbmMask = 0;
hbmXor = This->desc.u.bmp.hbitmap; hbmXor = This->desc.bmp.hbitmap;
} }
render_masked_bitmap(This, hdc, x, y, cx, cy, xSrc, ySrc, cxSrc, cySrc, hbmMask, hbmXor); render_masked_bitmap(This, hdc, x, y, cx, cy, xSrc, ySrc, cxSrc, cySrc, hbmMask, hbmXor);
...@@ -672,7 +670,7 @@ static HRESULT WINAPI OLEPictureImpl_Render(IPicture *iface, HDC hdc, ...@@ -672,7 +670,7 @@ static HRESULT WINAPI OLEPictureImpl_Render(IPicture *iface, HDC hdc,
{ {
ICONINFO info; ICONINFO info;
if (!GetIconInfo(This->desc.u.icon.hicon, &info)) if (!GetIconInfo(This->desc.icon.hicon, &info))
return E_FAIL; return E_FAIL;
render_masked_bitmap(This, hdc, x, y, cx, cy, xSrc, ySrc, cxSrc, cySrc, info.hbmMask, info.hbmColor); render_masked_bitmap(This, hdc, x, y, cx, cy, xSrc, ySrc, cxSrc, cySrc, info.hbmMask, info.hbmColor);
...@@ -698,7 +696,7 @@ static HRESULT WINAPI OLEPictureImpl_Render(IPicture *iface, HDC hdc, ...@@ -698,7 +696,7 @@ static HRESULT WINAPI OLEPictureImpl_Render(IPicture *iface, HDC hdc,
SetViewportOrgEx(hdc, x, y, &prevOrg); SetViewportOrgEx(hdc, x, y, &prevOrg);
SetViewportExtEx(hdc, cx, cy, &prevExt); SetViewportExtEx(hdc, cx, cy, &prevExt);
if (!PlayMetaFile(hdc, This->desc.u.wmf.hmeta)) if (!PlayMetaFile(hdc, This->desc.wmf.hmeta))
ERR("PlayMetaFile failed!\n"); ERR("PlayMetaFile failed!\n");
/* We're done, restore the DC to the previous settings for converting /* We're done, restore the DC to the previous settings for converting
...@@ -714,7 +712,7 @@ static HRESULT WINAPI OLEPictureImpl_Render(IPicture *iface, HDC hdc, ...@@ -714,7 +712,7 @@ static HRESULT WINAPI OLEPictureImpl_Render(IPicture *iface, HDC hdc,
case PICTYPE_ENHMETAFILE: case PICTYPE_ENHMETAFILE:
{ {
RECT rc = { x, y, x + cx, y + cy }; RECT rc = { x, y, x + cx, y + cy };
PlayEnhMetaFile(hdc, This->desc.u.emf.hemf, &rc); PlayEnhMetaFile(hdc, This->desc.emf.hemf, &rc);
break; break;
} }
...@@ -737,7 +735,7 @@ static HRESULT WINAPI OLEPictureImpl_set_hPal(IPicture *iface, ...@@ -737,7 +735,7 @@ static HRESULT WINAPI OLEPictureImpl_set_hPal(IPicture *iface,
if (This->desc.picType == PICTYPE_BITMAP) if (This->desc.picType == PICTYPE_BITMAP)
{ {
This->desc.u.bmp.hpal = ULongToHandle(hpal); This->desc.bmp.hpal = ULongToHandle(hpal);
OLEPicture_SendNotify(This,DISPID_PICT_HPAL); OLEPicture_SendNotify(This,DISPID_PICT_HPAL);
return S_OK; return S_OK;
} }
...@@ -771,10 +769,10 @@ static HRESULT WINAPI OLEPictureImpl_SelectPicture(IPicture *iface, ...@@ -771,10 +769,10 @@ static HRESULT WINAPI OLEPictureImpl_SelectPicture(IPicture *iface,
if (phdcOut) if (phdcOut)
*phdcOut = This->hDCCur; *phdcOut = This->hDCCur;
if (This->hDCCur) SelectObject(This->hDCCur,This->stock_bitmap); if (This->hDCCur) SelectObject(This->hDCCur,This->stock_bitmap);
if (hdcIn) SelectObject(hdcIn,This->desc.u.bmp.hbitmap); if (hdcIn) SelectObject(hdcIn,This->desc.bmp.hbitmap);
This->hDCCur = hdcIn; This->hDCCur = hdcIn;
if (phbmpOut) if (phbmpOut)
*phbmpOut = HandleToUlong(This->desc.u.bmp.hbitmap); *phbmpOut = HandleToUlong(This->desc.bmp.hbitmap);
return S_OK; return S_OK;
} else { } else {
FIXME("Don't know how to select picture type %d\n",This->desc.picType); FIXME("Don't know how to select picture type %d\n",This->desc.picType);
...@@ -993,7 +991,7 @@ static HRESULT OLEPictureImpl_LoadDIB(OLEPictureImpl *This, BYTE *xbuf, ULONG xr ...@@ -993,7 +991,7 @@ static HRESULT OLEPictureImpl_LoadDIB(OLEPictureImpl *This, BYTE *xbuf, ULONG xr
* components which are in both * components which are in both
*/ */
hdcref = GetDC(0); hdcref = GetDC(0);
This->desc.u.bmp.hbitmap = CreateDIBitmap( This->desc.bmp.hbitmap = CreateDIBitmap(
hdcref, hdcref,
&(bi->bmiHeader), &(bi->bmiHeader),
CBM_INIT, CBM_INIT,
...@@ -1002,7 +1000,7 @@ static HRESULT OLEPictureImpl_LoadDIB(OLEPictureImpl *This, BYTE *xbuf, ULONG xr ...@@ -1002,7 +1000,7 @@ static HRESULT OLEPictureImpl_LoadDIB(OLEPictureImpl *This, BYTE *xbuf, ULONG xr
DIB_RGB_COLORS DIB_RGB_COLORS
); );
ReleaseDC(0, hdcref); ReleaseDC(0, hdcref);
if (This->desc.u.bmp.hbitmap == 0) if (This->desc.bmp.hbitmap == 0)
return E_FAIL; return E_FAIL;
This->desc.picType = PICTYPE_BITMAP; This->desc.picType = PICTYPE_BITMAP;
OLEPictureImpl_SetBitmap(This); OLEPictureImpl_SetBitmap(This);
...@@ -1060,7 +1058,7 @@ static HRESULT OLEPictureImpl_LoadWICSource(OLEPictureImpl *This, IWICBitmapSour ...@@ -1060,7 +1058,7 @@ static HRESULT OLEPictureImpl_LoadWICSource(OLEPictureImpl *This, IWICBitmapSour
goto end; goto end;
hdcref = GetDC(0); hdcref = GetDC(0);
This->desc.u.bmp.hbitmap = CreateDIBitmap( This->desc.bmp.hbitmap = CreateDIBitmap(
hdcref, hdcref,
&bih, &bih,
CBM_INIT, CBM_INIT,
...@@ -1068,7 +1066,7 @@ static HRESULT OLEPictureImpl_LoadWICSource(OLEPictureImpl *This, IWICBitmapSour ...@@ -1068,7 +1066,7 @@ static HRESULT OLEPictureImpl_LoadWICSource(OLEPictureImpl *This, IWICBitmapSour
(BITMAPINFO*)&bih, (BITMAPINFO*)&bih,
DIB_RGB_COLORS); DIB_RGB_COLORS);
if (This->desc.u.bmp.hbitmap == 0) if (This->desc.bmp.hbitmap == 0)
{ {
hr = E_FAIL; hr = E_FAIL;
ReleaseDC(0, hdcref); ReleaseDC(0, hdcref);
...@@ -1111,7 +1109,7 @@ static HRESULT OLEPictureImpl_LoadWICSource(OLEPictureImpl *This, IWICBitmapSour ...@@ -1111,7 +1109,7 @@ static HRESULT OLEPictureImpl_LoadWICSource(OLEPictureImpl *This, IWICBitmapSour
hdcXor = CreateCompatibleDC(NULL); hdcXor = CreateCompatibleDC(NULL);
hdcMask = CreateCompatibleDC(NULL); hdcMask = CreateCompatibleDC(NULL);
hbmoldBmp = SelectObject(hdcBmp,This->desc.u.bmp.hbitmap); hbmoldBmp = SelectObject(hdcBmp,This->desc.bmp.hbitmap);
hbmoldXor = SelectObject(hdcXor,This->hbmXor); hbmoldXor = SelectObject(hdcXor,This->hbmXor);
hbmoldMask = SelectObject(hdcMask,This->hbmMask); hbmoldMask = SelectObject(hdcMask,This->hbmMask);
...@@ -1273,7 +1271,7 @@ static HRESULT OLEPictureImpl_LoadIcon(OLEPictureImpl *This, BYTE *xbuf, ULONG x ...@@ -1273,7 +1271,7 @@ static HRESULT OLEPictureImpl_LoadIcon(OLEPictureImpl *This, BYTE *xbuf, ULONG x
return E_FAIL; return E_FAIL;
} else { } else {
This->desc.picType = PICTYPE_ICON; This->desc.picType = PICTYPE_ICON;
This->desc.u.icon.hicon = hicon; This->desc.icon.hicon = hicon;
This->origWidth = cifd->idEntries[i].bWidth; This->origWidth = cifd->idEntries[i].bWidth;
This->origHeight = cifd->idEntries[i].bHeight; This->origHeight = cifd->idEntries[i].bHeight;
hdcRef = CreateCompatibleDC(0); hdcRef = CreateCompatibleDC(0);
...@@ -1296,7 +1294,7 @@ static HRESULT OLEPictureImpl_LoadEnhMetafile(OLEPictureImpl *This, ...@@ -1296,7 +1294,7 @@ static HRESULT OLEPictureImpl_LoadEnhMetafile(OLEPictureImpl *This,
GetEnhMetaFileHeader(hemf, sizeof(hdr), &hdr); GetEnhMetaFileHeader(hemf, sizeof(hdr), &hdr);
This->desc.picType = PICTYPE_ENHMETAFILE; This->desc.picType = PICTYPE_ENHMETAFILE;
This->desc.u.emf.hemf = hemf; This->desc.emf.hemf = hemf;
This->origWidth = 0; This->origWidth = 0;
This->origHeight = 0; This->origHeight = 0;
...@@ -1322,9 +1320,9 @@ static HRESULT OLEPictureImpl_LoadAPM(OLEPictureImpl *This, ...@@ -1322,9 +1320,9 @@ static HRESULT OLEPictureImpl_LoadAPM(OLEPictureImpl *This,
if (!hmf) return E_FAIL; if (!hmf) return E_FAIL;
This->desc.picType = PICTYPE_METAFILE; This->desc.picType = PICTYPE_METAFILE;
This->desc.u.wmf.hmeta = hmf; This->desc.wmf.hmeta = hmf;
This->desc.u.wmf.xExt = 0; This->desc.wmf.xExt = 0;
This->desc.u.wmf.yExt = 0; This->desc.wmf.yExt = 0;
This->origWidth = 0; This->origWidth = 0;
This->origHeight = 0; This->origHeight = 0;
...@@ -1771,7 +1769,7 @@ static HRESULT WINAPI OLEPictureImpl_Save( ...@@ -1771,7 +1769,7 @@ static HRESULT WINAPI OLEPictureImpl_Save(
case PICTYPE_ICON: case PICTYPE_ICON:
if (This->bIsDirty || !This->data) { if (This->bIsDirty || !This->data) {
if (!serializeIcon(This->desc.u.icon.hicon, &pIconData, &iDataSize)) { if (!serializeIcon(This->desc.icon.hicon, &pIconData, &iDataSize)) {
ERR("(%p,%p,%d), serializeIcon() failed\n", This, pStm, fClearDirty); ERR("(%p,%p,%d), serializeIcon() failed\n", This, pStm, fClearDirty);
hResult = E_FAIL; hResult = E_FAIL;
break; break;
...@@ -1791,7 +1789,7 @@ static HRESULT WINAPI OLEPictureImpl_Save( ...@@ -1791,7 +1789,7 @@ static HRESULT WINAPI OLEPictureImpl_Save(
if (This->bIsDirty || !This->data) { if (This->bIsDirty || !This->data) {
switch (This->keepOrigFormat ? This->loadtime_format : BITMAP_FORMAT_BMP) { switch (This->keepOrigFormat ? This->loadtime_format : BITMAP_FORMAT_BMP) {
case BITMAP_FORMAT_BMP: case BITMAP_FORMAT_BMP:
serializeResult = serializeBMP(This->desc.u.bmp.hbitmap, &pIconData, &iDataSize); serializeResult = serializeBMP(This->desc.bmp.hbitmap, &pIconData, &iDataSize);
break; break;
case BITMAP_FORMAT_JPEG: case BITMAP_FORMAT_JPEG:
FIXME("(%p,%p,%d), PICTYPE_BITMAP (format JPEG) not implemented!\n",This,pStm,fClearDirty); FIXME("(%p,%p,%d), PICTYPE_BITMAP (format JPEG) not implemented!\n",This,pStm,fClearDirty);
......
...@@ -22,8 +22,6 @@ ...@@ -22,8 +22,6 @@
#include <stdarg.h> #include <stdarg.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"
...@@ -244,14 +242,14 @@ HRESULT WINAPI OleCreatePropertyFrameIndirect(LPOCPFIPARAMS lpParams) ...@@ -244,14 +242,14 @@ HRESULT WINAPI OleCreatePropertyFrameIndirect(LPOCPFIPARAMS lpParams)
property_sheet.pszCaption = lpParams->lpszCaption; property_sheet.pszCaption = lpParams->lpszCaption;
} }
property_sheet.u3.phpage = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, property_sheet.phpage = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY,
lpParams->cPages*sizeof(HPROPSHEETPAGE)); lpParams->cPages*sizeof(HPROPSHEETPAGE));
property_page = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, property_page = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY,
lpParams->cPages*sizeof(IPropertyPage*)); lpParams->cPages*sizeof(IPropertyPage*));
dialogs = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, dialogs = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY,
lpParams->cPages*sizeof(*dialogs)); lpParams->cPages*sizeof(*dialogs));
if(!property_sheet.u3.phpage || !property_page || !dialogs) { if(!property_sheet.phpage || !property_page || !dialogs) {
HeapFree(GetProcessHeap(), 0, property_sheet.u3.phpage); HeapFree(GetProcessHeap(), 0, property_sheet.phpage);
HeapFree(GetProcessHeap(), 0, property_page); HeapFree(GetProcessHeap(), 0, property_page);
HeapFree(GetProcessHeap(), 0, dialogs); HeapFree(GetProcessHeap(), 0, dialogs);
return E_OUTOFMEMORY; return E_OUTOFMEMORY;
...@@ -295,11 +293,11 @@ HRESULT WINAPI OleCreatePropertyFrameIndirect(LPOCPFIPARAMS lpParams) ...@@ -295,11 +293,11 @@ HRESULT WINAPI OleCreatePropertyFrameIndirect(LPOCPFIPARAMS lpParams)
dialogs[i].template.cx = MulDiv(page_info.size.cx, 4, font_width); dialogs[i].template.cx = MulDiv(page_info.size.cx, 4, font_width);
dialogs[i].template.cy = MulDiv(page_info.size.cy, 8, font_height); dialogs[i].template.cy = MulDiv(page_info.size.cy, 8, font_height);
property_sheet_page.u.pResource = &dialogs[i].template; property_sheet_page.pResource = &dialogs[i].template;
property_sheet_page.lParam = (LPARAM)property_page[i]; property_sheet_page.lParam = (LPARAM)property_page[i];
property_sheet_page.pszTitle = page_info.pszTitle; property_sheet_page.pszTitle = page_info.pszTitle;
property_sheet.u3.phpage[property_sheet.nPages++] = property_sheet.phpage[property_sheet.nPages++] =
CreatePropertySheetPageW(&property_sheet_page); CreatePropertySheetPageW(&property_sheet_page);
} }
...@@ -312,7 +310,7 @@ HRESULT WINAPI OleCreatePropertyFrameIndirect(LPOCPFIPARAMS lpParams) ...@@ -312,7 +310,7 @@ HRESULT WINAPI OleCreatePropertyFrameIndirect(LPOCPFIPARAMS lpParams)
HeapFree(GetProcessHeap(), 0, dialogs); HeapFree(GetProcessHeap(), 0, dialogs);
HeapFree(GetProcessHeap(), 0, property_page); HeapFree(GetProcessHeap(), 0, property_page);
HeapFree(GetProcessHeap(), 0, property_sheet.u3.phpage); HeapFree(GetProcessHeap(), 0, property_sheet.phpage);
return S_OK; return S_OK;
} }
......
...@@ -19,8 +19,6 @@ ...@@ -19,8 +19,6 @@
#include <stdarg.h> #include <stdarg.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"
...@@ -639,7 +637,7 @@ HRESULT WINAPI GetRecordInfoFromTypeInfo(ITypeInfo* pTI, IRecordInfo** ppRecInfo ...@@ -639,7 +637,7 @@ HRESULT WINAPI GetRecordInfoFromTypeInfo(ITypeInfo* pTI, IRecordInfo** ppRecInfo
} }
if(typeattr->typekind == TKIND_ALIAS) { if(typeattr->typekind == TKIND_ALIAS) {
hres = ITypeInfo_GetRefTypeInfo(pTI, typeattr->tdescAlias.u.hreftype, &pTypeInfo); hres = ITypeInfo_GetRefTypeInfo(pTI, typeattr->tdescAlias.hreftype, &pTypeInfo);
guid = typeattr->guid; guid = typeattr->guid;
ITypeInfo_ReleaseTypeAttr(pTI, typeattr); ITypeInfo_ReleaseTypeAttr(pTI, typeattr);
if(FAILED(hres)) { if(FAILED(hres)) {
...@@ -695,7 +693,7 @@ HRESULT WINAPI GetRecordInfoFromTypeInfo(ITypeInfo* pTI, IRecordInfo** ppRecInfo ...@@ -695,7 +693,7 @@ HRESULT WINAPI GetRecordInfoFromTypeInfo(ITypeInfo* pTI, IRecordInfo** ppRecInfo
} }
ret->fields[i].vt = vardesc->elemdescVar.tdesc.vt; ret->fields[i].vt = vardesc->elemdescVar.tdesc.vt;
ret->fields[i].varkind = vardesc->varkind; ret->fields[i].varkind = vardesc->varkind;
ret->fields[i].offset = vardesc->u.oInst; ret->fields[i].offset = vardesc->oInst;
hres = ITypeInfo_GetDocumentation(pTypeInfo, vardesc->memid, &ret->fields[i].name, hres = ITypeInfo_GetDocumentation(pTypeInfo, vardesc->memid, &ret->fields[i].name,
NULL, NULL, NULL); NULL, NULL, NULL);
if(FAILED(hres)) if(FAILED(hres))
......
...@@ -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 "wingdi.h" #include "wingdi.h"
...@@ -1441,12 +1439,12 @@ static void free_embedded_arraydesc(ARRAYDESC *adesc) ...@@ -1441,12 +1439,12 @@ static void free_embedded_arraydesc(ARRAYDESC *adesc)
{ {
case VT_PTR: case VT_PTR:
case VT_SAFEARRAY: case VT_SAFEARRAY:
free_embedded_typedesc(adesc->tdescElem.u.lptdesc); free_embedded_typedesc(adesc->tdescElem.lptdesc);
CoTaskMemFree(adesc->tdescElem.u.lptdesc); CoTaskMemFree(adesc->tdescElem.lptdesc);
break; break;
case VT_CARRAY: case VT_CARRAY:
free_embedded_arraydesc(adesc->tdescElem.u.lpadesc); free_embedded_arraydesc(adesc->tdescElem.lpadesc);
CoTaskMemFree(adesc->tdescElem.u.lpadesc); CoTaskMemFree(adesc->tdescElem.lpadesc);
break; break;
} }
} }
...@@ -1457,12 +1455,12 @@ static void free_embedded_typedesc(TYPEDESC *tdesc) ...@@ -1457,12 +1455,12 @@ static void free_embedded_typedesc(TYPEDESC *tdesc)
{ {
case VT_PTR: case VT_PTR:
case VT_SAFEARRAY: case VT_SAFEARRAY:
free_embedded_typedesc(tdesc->u.lptdesc); free_embedded_typedesc(tdesc->lptdesc);
CoTaskMemFree(tdesc->u.lptdesc); CoTaskMemFree(tdesc->lptdesc);
break; break;
case VT_CARRAY: case VT_CARRAY:
free_embedded_arraydesc(tdesc->u.lpadesc); free_embedded_arraydesc(tdesc->lpadesc);
CoTaskMemFree(tdesc->u.lpadesc); CoTaskMemFree(tdesc->lpadesc);
break; break;
} }
} }
...@@ -1470,8 +1468,8 @@ static void free_embedded_typedesc(TYPEDESC *tdesc) ...@@ -1470,8 +1468,8 @@ static void free_embedded_typedesc(TYPEDESC *tdesc)
static void free_embedded_elemdesc(ELEMDESC *edesc) static void free_embedded_elemdesc(ELEMDESC *edesc)
{ {
free_embedded_typedesc(&edesc->tdesc); free_embedded_typedesc(&edesc->tdesc);
if(edesc->u.paramdesc.wParamFlags & PARAMFLAG_FHASDEFAULT) if(edesc->paramdesc.wParamFlags & PARAMFLAG_FHASDEFAULT)
CoTaskMemFree(edesc->u.paramdesc.pparamdescex); CoTaskMemFree(edesc->paramdesc.pparamdescex);
} }
/* ITypeComp */ /* ITypeComp */
...@@ -1999,7 +1997,7 @@ void CALLBACK ITypeInfo_ReleaseVarDesc_Proxy( ...@@ -1999,7 +1997,7 @@ void CALLBACK ITypeInfo_ReleaseVarDesc_Proxy(
CoTaskMemFree(pVarDesc->lpstrSchema); CoTaskMemFree(pVarDesc->lpstrSchema);
if(pVarDesc->varkind == VAR_CONST) if(pVarDesc->varkind == VAR_CONST)
CoTaskMemFree(pVarDesc->u.lpvarValue); CoTaskMemFree(pVarDesc->lpvarValue);
free_embedded_elemdesc(&pVarDesc->elemdescVar); free_embedded_elemdesc(&pVarDesc->elemdescVar);
CoTaskMemFree(pVarDesc); CoTaskMemFree(pVarDesc);
......
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