Commit c86bb606 authored by Alexandre Julliard's avatar Alexandre Julliard

comdlg32: Use nameless unions/structs.

parent 22c56f97
......@@ -52,8 +52,6 @@
#include <string.h>
#define COBJMACROS
#define NONAMELESSUNION
#include "windef.h"
#include "winbase.h"
#include "winternl.h"
......@@ -3780,7 +3778,7 @@ void FILEDLG95_FILENAME_FillFromSelection (HWND hwnd)
if (FAILED(IDataObject_GetData(fodInfos->Shell.FOIDataObject, &formatetc, &medium)))
return;
cida = GlobalLock(medium.u.hGlobal);
cida = GlobalLock(medium.hGlobal);
nFileSelected = cida->cidl;
/* Allocate a buffer */
......@@ -3846,17 +3844,17 @@ static HRESULT COMDLG32_StrRetToStrNW (LPWSTR dest, DWORD len, LPSTRRET src, con
switch (src->uType)
{
case STRRET_WSTR:
lstrcpynW(dest, src->u.pOleStr, len);
CoTaskMemFree(src->u.pOleStr);
lstrcpynW(dest, src->pOleStr, len);
CoTaskMemFree(src->pOleStr);
break;
case STRRET_CSTR:
if (!MultiByteToWideChar( CP_ACP, 0, src->u.cStr, -1, dest, len ) && len)
if (!MultiByteToWideChar( CP_ACP, 0, src->cStr, -1, dest, len ) && len)
dest[len-1] = 0;
break;
case STRRET_OFFSET:
if (!MultiByteToWideChar( CP_ACP, 0, ((LPCSTR)&pidl->mkid)+src->u.uOffset, -1, dest, len ) && len)
if (!MultiByteToWideChar( CP_ACP, 0, ((LPCSTR)&pidl->mkid)+src->uOffset, -1, dest, len ) && len)
dest[len-1] = 0;
break;
......@@ -3911,8 +3909,8 @@ static void COMCTL32_ReleaseStgMedium (STGMEDIUM medium)
}
else
{
GlobalUnlock(medium.u.hGlobal);
GlobalFree(medium.u.hGlobal);
GlobalUnlock(medium.hGlobal);
GlobalFree(medium.hGlobal);
}
}
......@@ -3938,7 +3936,7 @@ LPITEMIDLIST GetPidlFromDataObject ( IDataObject *doSelected, UINT nPidlIndex)
/* Get the pidls from IDataObject */
if(SUCCEEDED(IDataObject_GetData(doSelected,&formatetc,&medium)))
{
LPIDA cida = GlobalLock(medium.u.hGlobal);
LPIDA cida = GlobalLock(medium.hGlobal);
if(nPidlIndex <= cida->cidl)
{
pidl = ILClone((LPITEMIDLIST)(&((LPBYTE)cida)[cida->aoffset[nPidlIndex]]));
......@@ -3967,7 +3965,7 @@ static UINT GetNumSelected( IDataObject *doSelected )
/* Get the pidls from IDataObject */
if(SUCCEEDED(IDataObject_GetData(doSelected,&formatetc,&medium)))
{
LPIDA cida = GlobalLock(medium.u.hGlobal);
LPIDA cida = GlobalLock(medium.hGlobal);
retVal = cida->cidl;
COMCTL32_ReleaseStgMedium(medium);
return retVal;
......
......@@ -24,8 +24,6 @@
#include <string.h>
#define COBJMACROS
#define NONAMELESSUNION
#include "windef.h"
#include "winbase.h"
#include "winnls.h"
......@@ -155,19 +153,19 @@ static BOOL COMDLG32_StrRetToStrNW (LPVOID dest, DWORD len, LPSTRRET src, LPCITE
switch (src->uType)
{
case STRRET_WSTR:
lstrcpynW(dest, src->u.pOleStr, len);
CoTaskMemFree(src->u.pOleStr);
lstrcpynW(dest, src->pOleStr, len);
CoTaskMemFree(src->pOleStr);
break;
case STRRET_CSTR:
if (len && !MultiByteToWideChar( CP_ACP, 0, src->u.cStr, -1, dest, len ))
if (len && !MultiByteToWideChar( CP_ACP, 0, src->cStr, -1, dest, len ))
((LPWSTR)dest)[len-1] = 0;
break;
case STRRET_OFFSET:
if (pidl)
{
if (len && !MultiByteToWideChar( CP_ACP, 0, ((LPCSTR)&pidl->mkid)+src->u.uOffset,
if (len && !MultiByteToWideChar( CP_ACP, 0, ((LPCSTR)&pidl->mkid)+src->uOffset,
-1, dest, len ))
((LPWSTR)dest)[len-1] = 0;
}
......
......@@ -21,8 +21,6 @@
#include <stdarg.h>
#define COBJMACROS
#define NONAMELESSUNION
#include "windef.h"
#include "winbase.h"
#include "winuser.h"
......
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