Commit c86bb606 authored by Alexandre Julliard's avatar Alexandre Julliard

comdlg32: Use nameless unions/structs.

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