mirror of
git://source.winehq.org/git/wine.git
synced 2024-10-06 10:17:26 +00:00
shell32: Use nameless unions/structs.
This commit is contained in:
parent
7c1d8b29e5
commit
5cb7274403
|
@ -25,8 +25,6 @@
|
|||
#include <string.h>
|
||||
|
||||
#define COBJMACROS
|
||||
#define NONAMELESSUNION
|
||||
|
||||
#include "wine/debug.h"
|
||||
#include "pidl.h"
|
||||
#include "shell32_main.h"
|
||||
|
@ -384,7 +382,7 @@ static HTREEITEM InsertTreeViewItem( browse_info *info, IShellFolder * lpsf,
|
|||
lptvid->pEnumIL = pEnumIL;
|
||||
GetNormalAndSelectedIcons(lptvid->lpifq, &tvi);
|
||||
|
||||
tvins.u.item = tvi;
|
||||
tvins.item = tvi;
|
||||
tvins.hInsertAfter = NULL;
|
||||
tvins.hParent = hParent;
|
||||
|
||||
|
|
|
@ -24,8 +24,6 @@
|
|||
#include <stdio.h>
|
||||
|
||||
#define COBJMACROS
|
||||
#define NONAMELESSUNION
|
||||
|
||||
#include "winerror.h"
|
||||
#include "windef.h"
|
||||
#include "winbase.h"
|
||||
|
@ -715,7 +713,7 @@ static HRESULT WINAPI ISF_ControlPanel_fnGetDisplayNameOf(IShellFolder2 *iface,
|
|||
}
|
||||
|
||||
strRet->uType = STRRET_CSTR;
|
||||
lstrcpynA(strRet->u.cStr, szPath, MAX_PATH);
|
||||
lstrcpynA(strRet->cStr, szPath, MAX_PATH);
|
||||
|
||||
TRACE("--(%p)->(%s)\n", This, szPath);
|
||||
return S_OK;
|
||||
|
@ -799,7 +797,7 @@ static HRESULT WINAPI ISF_ControlPanel_fnGetDetailsOf(IShellFolder2 *iface, LPCI
|
|||
if (!pidl)
|
||||
return SHELL32_GetColumnDetails(ControlPanelSFHeader, iColumn, psd);
|
||||
|
||||
psd->str.u.cStr[0] = 0x00;
|
||||
psd->str.cStr[0] = 0x00;
|
||||
psd->str.uType = STRRET_CSTR;
|
||||
switch(iColumn)
|
||||
{
|
||||
|
@ -807,9 +805,9 @@ static HRESULT WINAPI ISF_ControlPanel_fnGetDetailsOf(IShellFolder2 *iface, LPCI
|
|||
pcpanel = _ILGetCPanelPointer(pidl);
|
||||
|
||||
if (pcpanel)
|
||||
lstrcpyA(psd->str.u.cStr, pcpanel->szName+pcpanel->offsComment);
|
||||
lstrcpyA(psd->str.cStr, pcpanel->szName+pcpanel->offsComment);
|
||||
else
|
||||
_ILGetFileType(pidl, psd->str.u.cStr, MAX_PATH);
|
||||
_ILGetFileType(pidl, psd->str.cStr, MAX_PATH);
|
||||
break;
|
||||
|
||||
default:
|
||||
|
|
|
@ -22,8 +22,6 @@
|
|||
#include <string.h>
|
||||
|
||||
#define COBJMACROS
|
||||
#define NONAMELESSUNION
|
||||
|
||||
#include "windef.h"
|
||||
#include "wingdi.h"
|
||||
#include "pidl.h"
|
||||
|
@ -295,29 +293,29 @@ static HRESULT WINAPI IDataObject_fnGetData(IDataObject *iface, LPFORMATETC pfor
|
|||
if (pformatetcIn->cfFormat == This->cfShellIDList)
|
||||
{
|
||||
if (This->cidl < 1) return(E_UNEXPECTED);
|
||||
pmedium->u.hGlobal = RenderSHELLIDLIST(This->pidl, This->apidl, This->cidl);
|
||||
pmedium->hGlobal = RenderSHELLIDLIST(This->pidl, This->apidl, This->cidl);
|
||||
}
|
||||
else if (pformatetcIn->cfFormat == CF_HDROP)
|
||||
{
|
||||
if (This->cidl < 1) return(E_UNEXPECTED);
|
||||
pmedium->u.hGlobal = RenderHDROP(This->pidl, This->apidl, This->cidl);
|
||||
pmedium->hGlobal = RenderHDROP(This->pidl, This->apidl, This->cidl);
|
||||
}
|
||||
else if (pformatetcIn->cfFormat == This->cfFileNameA)
|
||||
{
|
||||
if (This->cidl < 1) return(E_UNEXPECTED);
|
||||
pmedium->u.hGlobal = RenderFILENAMEA(This->pidl, This->apidl, This->cidl);
|
||||
pmedium->hGlobal = RenderFILENAMEA(This->pidl, This->apidl, This->cidl);
|
||||
}
|
||||
else if (pformatetcIn->cfFormat == This->cfFileNameW)
|
||||
{
|
||||
if (This->cidl < 1) return(E_UNEXPECTED);
|
||||
pmedium->u.hGlobal = RenderFILENAMEW(This->pidl, This->apidl, This->cidl);
|
||||
pmedium->hGlobal = RenderFILENAMEW(This->pidl, This->apidl, This->cidl);
|
||||
}
|
||||
else
|
||||
{
|
||||
FIXME("-- expected clipformat not implemented\n");
|
||||
return (E_INVALIDARG);
|
||||
}
|
||||
if (pmedium->u.hGlobal)
|
||||
if (pmedium->hGlobal)
|
||||
{
|
||||
pmedium->tymed = TYMED_HGLOBAL;
|
||||
pmedium->pUnkForRelease = NULL;
|
||||
|
|
|
@ -21,8 +21,6 @@
|
|||
#include <stdarg.h>
|
||||
|
||||
#define COBJMACROS
|
||||
#define NONAMELESSUNION
|
||||
|
||||
#include "winerror.h"
|
||||
#include "windef.h"
|
||||
#include "winbase.h"
|
||||
|
@ -1557,7 +1555,7 @@ static HRESULT WINAPI ICommDlgBrowser3_fnOnDefaultCommand(ICommDlgBrowser3 *ifac
|
|||
IDataObject_Release(pdo);
|
||||
if(SUCCEEDED(hr))
|
||||
{
|
||||
LPIDA pida = GlobalLock(medium.u.hGlobal);
|
||||
LPIDA pida = GlobalLock(medium.hGlobal);
|
||||
LPCITEMIDLIST pidl_child = (LPCITEMIDLIST) ((LPBYTE)pida+pida->aoffset[1]);
|
||||
|
||||
/* Handle folders by browsing to them. */
|
||||
|
@ -1566,8 +1564,8 @@ static HRESULT WINAPI ICommDlgBrowser3_fnOnDefaultCommand(ICommDlgBrowser3 *ifac
|
|||
IExplorerBrowser_BrowseToIDList(&This->IExplorerBrowser_iface, pidl_child, SBSP_RELATIVE);
|
||||
ret = S_OK;
|
||||
}
|
||||
GlobalUnlock(medium.u.hGlobal);
|
||||
GlobalFree(medium.u.hGlobal);
|
||||
GlobalUnlock(medium.hGlobal);
|
||||
GlobalFree(medium.hGlobal);
|
||||
}
|
||||
else
|
||||
ERR("Failed to get data from IDataObject.\n");
|
||||
|
|
|
@ -28,8 +28,6 @@
|
|||
#include <string.h>
|
||||
|
||||
#define COBJMACROS
|
||||
#define NONAMELESSUNION
|
||||
|
||||
#include "windef.h"
|
||||
#include "winbase.h"
|
||||
#include "winreg.h"
|
||||
|
@ -728,7 +726,7 @@ HRESULT WINAPI SHGetRealIDL(LPSHELLFOLDER lpsf, LPCITEMIDLIST pidlSimple, LPITEM
|
|||
if (SUCCEEDED(hr))
|
||||
{
|
||||
/*assert(pida->cidl==1);*/
|
||||
LPIDA pida = GlobalLock(medium.u.hGlobal);
|
||||
LPIDA pida = GlobalLock(medium.hGlobal);
|
||||
|
||||
LPCITEMIDLIST pidl_folder = (LPCITEMIDLIST) ((LPBYTE)pida+pida->aoffset[0]);
|
||||
LPCITEMIDLIST pidl_child = (LPCITEMIDLIST) ((LPBYTE)pida+pida->aoffset[1]);
|
||||
|
@ -738,8 +736,8 @@ HRESULT WINAPI SHGetRealIDL(LPSHELLFOLDER lpsf, LPCITEMIDLIST pidlSimple, LPITEM
|
|||
if (!*pidlReal)
|
||||
hr = E_OUTOFMEMORY;
|
||||
|
||||
GlobalUnlock(medium.u.hGlobal);
|
||||
GlobalFree(medium.u.hGlobal);
|
||||
GlobalUnlock(medium.hGlobal);
|
||||
GlobalFree(medium.hGlobal);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -21,7 +21,6 @@
|
|||
*/
|
||||
|
||||
#define COBJMACROS
|
||||
#define NONAMELESSUNION
|
||||
|
||||
#include <stdarg.h>
|
||||
|
||||
|
@ -915,7 +914,7 @@ static HRESULT WINAPI RecycleBin_GetDisplayNameOf(IShellFolder2 *This, LPCITEMID
|
|||
|
||||
TRACE("(%p, %p, %lx, %p)\n", This, pidl, uFlags, pName);
|
||||
pName->uType = STRRET_WSTR;
|
||||
return SHStrDupW(PathFindFileNameW(data->cFileName), &pName->u.pOleStr);
|
||||
return SHStrDupW(PathFindFileNameW(data->cFileName), &pName->pOleStr);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI RecycleBin_SetNameOf(IShellFolder2 *This, HWND hwnd, LPCITEMIDLIST pidl, LPCOLESTR pszName,
|
||||
|
@ -1032,7 +1031,7 @@ static HRESULT WINAPI RecycleBin_GetDetailsOf(IShellFolder2 *iface, LPCITEMIDLIS
|
|||
}
|
||||
|
||||
pDetails->str.uType = STRRET_WSTR;
|
||||
return SHStrDupW(buffer, &pDetails->str.u.pOleStr);
|
||||
return SHStrDupW(buffer, &pDetails->str.pOleStr);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI RecycleBin_MapColumnToSCID(IShellFolder2 *iface, UINT iColumn, SHCOLUMNID *pscid)
|
||||
|
|
|
@ -22,8 +22,6 @@
|
|||
#include <stdarg.h>
|
||||
|
||||
#define COBJMACROS
|
||||
#define NONAMELESSUNION
|
||||
|
||||
#include "windef.h"
|
||||
#include "winbase.h"
|
||||
#include "wine/debug.h"
|
||||
|
@ -827,7 +825,7 @@ HRESULT WINAPI SHGetItemFromDataObject(IDataObject *pdtobj,
|
|||
ret = IDataObject_GetData(pdtobj, &fmt, &medium);
|
||||
if(SUCCEEDED(ret))
|
||||
{
|
||||
LPIDA pida = GlobalLock(medium.u.hGlobal);
|
||||
LPIDA pida = GlobalLock(medium.hGlobal);
|
||||
|
||||
if((pida->cidl > 1 && !(dwFlags & DOGIF_ONLY_IF_ONE)) ||
|
||||
pida->cidl == 1)
|
||||
|
@ -846,8 +844,8 @@ HRESULT WINAPI SHGetItemFromDataObject(IDataObject *pdtobj,
|
|||
ret = E_FAIL;
|
||||
}
|
||||
|
||||
GlobalUnlock(medium.u.hGlobal);
|
||||
GlobalFree(medium.u.hGlobal);
|
||||
GlobalUnlock(medium.hGlobal);
|
||||
GlobalFree(medium.hGlobal);
|
||||
}
|
||||
|
||||
if(FAILED(ret) && !(dwFlags & DOGIF_NO_HDROP))
|
||||
|
@ -863,7 +861,7 @@ HRESULT WINAPI SHGetItemFromDataObject(IDataObject *pdtobj,
|
|||
ret = IDataObject_GetData(pdtobj, &fmt, &medium);
|
||||
if(SUCCEEDED(ret))
|
||||
{
|
||||
DROPFILES *df = GlobalLock(medium.u.hGlobal);
|
||||
DROPFILES *df = GlobalLock(medium.hGlobal);
|
||||
LPBYTE files = (LPBYTE)df + df->pFiles;
|
||||
BOOL multiple_files = FALSE;
|
||||
|
||||
|
@ -891,8 +889,8 @@ HRESULT WINAPI SHGetItemFromDataObject(IDataObject *pdtobj,
|
|||
ret = SHCreateItemFromParsingName(first_file, NULL, riid, ppv);
|
||||
}
|
||||
|
||||
GlobalUnlock(medium.u.hGlobal);
|
||||
GlobalFree(medium.u.hGlobal);
|
||||
GlobalUnlock(medium.hGlobal);
|
||||
GlobalFree(medium.hGlobal);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1405,7 +1403,7 @@ HRESULT WINAPI SHCreateShellItemArrayFromDataObject(IDataObject *pdo, REFIID rii
|
|||
ret = IDataObject_GetData(pdo, &fmt, &medium);
|
||||
if(SUCCEEDED(ret))
|
||||
{
|
||||
LPIDA pida = GlobalLock(medium.u.hGlobal);
|
||||
LPIDA pida = GlobalLock(medium.hGlobal);
|
||||
LPCITEMIDLIST parent_pidl;
|
||||
LPCITEMIDLIST *children;
|
||||
UINT i;
|
||||
|
@ -1421,8 +1419,8 @@ HRESULT WINAPI SHCreateShellItemArrayFromDataObject(IDataObject *pdo, REFIID rii
|
|||
|
||||
heap_free(children);
|
||||
|
||||
GlobalUnlock(medium.u.hGlobal);
|
||||
GlobalFree(medium.u.hGlobal);
|
||||
GlobalUnlock(medium.hGlobal);
|
||||
GlobalFree(medium.hGlobal);
|
||||
}
|
||||
|
||||
if(SUCCEEDED(ret))
|
||||
|
|
|
@ -33,8 +33,6 @@
|
|||
*/
|
||||
|
||||
#define COBJMACROS
|
||||
#define NONAMELESSUNION
|
||||
|
||||
#include "wine/debug.h"
|
||||
#include "winerror.h"
|
||||
#include "windef.h"
|
||||
|
@ -2369,19 +2367,19 @@ ShellLink_ExtInit_Initialize( IShellExtInit* iface, LPCITEMIDLIST pidlFolder,
|
|||
if( FAILED( IDataObject_GetData( pdtobj, &format, &stgm ) ) )
|
||||
return r;
|
||||
|
||||
count = DragQueryFileW( stgm.u.hGlobal, -1, NULL, 0 );
|
||||
count = DragQueryFileW( stgm.hGlobal, -1, NULL, 0 );
|
||||
if( count == 1 )
|
||||
{
|
||||
LPWSTR path;
|
||||
|
||||
count = DragQueryFileW( stgm.u.hGlobal, 0, NULL, 0 );
|
||||
count = DragQueryFileW( stgm.hGlobal, 0, NULL, 0 );
|
||||
count++;
|
||||
path = malloc( count * sizeof(WCHAR) );
|
||||
if( path )
|
||||
{
|
||||
IPersistFile *pf = &This->IPersistFile_iface;
|
||||
|
||||
count = DragQueryFileW( stgm.u.hGlobal, 0, path, count );
|
||||
count = DragQueryFileW( stgm.hGlobal, 0, path, count );
|
||||
r = IPersistFile_Load( pf, path, 0 );
|
||||
free( path );
|
||||
}
|
||||
|
|
|
@ -24,8 +24,6 @@
|
|||
#include <string.h>
|
||||
|
||||
#define COBJMACROS
|
||||
#define NONAMELESSUNION
|
||||
|
||||
#include "windef.h"
|
||||
#include "winbase.h"
|
||||
#include "shellapi.h"
|
||||
|
@ -699,7 +697,7 @@ HRESULT WINAPI SHPropStgCreate(IPropertySetStorage *psstg, REFFMTID fmtid,
|
|||
|
||||
if(puCodePage) {
|
||||
prop.ulKind = PRSPEC_PROPID;
|
||||
prop.u.propid = PID_CODEPAGE;
|
||||
prop.propid = PID_CODEPAGE;
|
||||
hres = IPropertyStorage_ReadMultiple(*ppstg, 1, &prop, &ret);
|
||||
if(FAILED(hres) || ret.vt!=VT_I2)
|
||||
*puCodePage = 0;
|
||||
|
@ -732,7 +730,7 @@ HRESULT WINAPI SHPropStgReadMultiple(IPropertyStorage *pps, UINT uCodePage,
|
|||
PROPVARIANT ret;
|
||||
|
||||
prop.ulKind = PRSPEC_PROPID;
|
||||
prop.u.propid = PID_CODEPAGE;
|
||||
prop.propid = PID_CODEPAGE;
|
||||
hres = IPropertyStorage_ReadMultiple(pps, 1, &prop, &ret);
|
||||
if(FAILED(hres) || ret.vt!=VT_I2)
|
||||
return S_OK;
|
||||
|
@ -771,7 +769,7 @@ HRESULT WINAPI SHPropStgWriteMultiple(IPropertyStorage *pps, UINT *uCodePage,
|
|||
PROPVARIANT ret;
|
||||
|
||||
prop.ulKind = PRSPEC_PROPID;
|
||||
prop.u.propid = PID_CODEPAGE;
|
||||
prop.propid = PID_CODEPAGE;
|
||||
hres = IPropertyStorage_ReadMultiple(pps, 1, &prop, &ret);
|
||||
if(FAILED(hres))
|
||||
return hres;
|
||||
|
|
|
@ -22,8 +22,6 @@
|
|||
#include <ctype.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#define NONAMELESSUNION
|
||||
|
||||
#include "windef.h"
|
||||
#include "winbase.h"
|
||||
#include "winnls.h"
|
||||
|
@ -67,14 +65,14 @@ BOOL WINAPI StrRetToStrNA(LPSTR dest, DWORD len, LPSTRRET src, const ITEMIDLIST
|
|||
switch (src->uType)
|
||||
{
|
||||
case STRRET_WSTR:
|
||||
WideCharToMultiByte(CP_ACP, 0, src->u.pOleStr, -1, dest, len, NULL, NULL);
|
||||
CoTaskMemFree(src->u.pOleStr);
|
||||
WideCharToMultiByte(CP_ACP, 0, src->pOleStr, -1, dest, len, NULL, NULL);
|
||||
CoTaskMemFree(src->pOleStr);
|
||||
break;
|
||||
case STRRET_CSTR:
|
||||
lstrcpynA(dest, src->u.cStr, len);
|
||||
lstrcpynA(dest, src->cStr, len);
|
||||
break;
|
||||
case STRRET_OFFSET:
|
||||
lstrcpynA(dest, ((LPCSTR)&pidl->mkid)+src->u.uOffset, len);
|
||||
lstrcpynA(dest, ((LPCSTR)&pidl->mkid)+src->uOffset, len);
|
||||
break;
|
||||
default:
|
||||
FIXME("unknown type %u!\n", src->uType);
|
||||
|
@ -98,15 +96,15 @@ BOOL WINAPI StrRetToStrNW(LPWSTR dest, DWORD len, LPSTRRET src, const ITEMIDLIST
|
|||
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)
|
||||
if (!MultiByteToWideChar(CP_ACP, 0, ((LPCSTR)&pidl->mkid)+src->uOffset, -1, dest, len)
|
||||
&& len)
|
||||
dest[len-1] = 0;
|
||||
break;
|
||||
|
|
|
@ -26,8 +26,6 @@
|
|||
#include <stdio.h>
|
||||
|
||||
#define COBJMACROS
|
||||
#define NONAMELESSUNION
|
||||
|
||||
#include "winerror.h"
|
||||
#include "windef.h"
|
||||
#include "winbase.h"
|
||||
|
@ -690,23 +688,23 @@ static HRESULT WINAPI ISF_Desktop_fnGetDisplayNameOf (IShellFolder2 * iface,
|
|||
if (GetVersion() & 0x80000000)
|
||||
{
|
||||
strRet->uType = STRRET_CSTR;
|
||||
if (!WideCharToMultiByte(CP_ACP, 0, pszPath, -1, strRet->u.cStr, MAX_PATH,
|
||||
if (!WideCharToMultiByte(CP_ACP, 0, pszPath, -1, strRet->cStr, MAX_PATH,
|
||||
NULL, NULL))
|
||||
strRet->u.cStr[0] = '\0';
|
||||
strRet->cStr[0] = '\0';
|
||||
CoTaskMemFree(pszPath);
|
||||
}
|
||||
else
|
||||
{
|
||||
strRet->uType = STRRET_WSTR;
|
||||
strRet->u.pOleStr = pszPath;
|
||||
strRet->pOleStr = pszPath;
|
||||
}
|
||||
}
|
||||
else
|
||||
CoTaskMemFree(pszPath);
|
||||
|
||||
TRACE ("-- (%p)->(%s,0x%08lx)\n", This,
|
||||
strRet->uType == STRRET_CSTR ? strRet->u.cStr :
|
||||
debugstr_w(strRet->u.pOleStr), hr);
|
||||
strRet->uType == STRRET_CSTR ? strRet->cStr :
|
||||
debugstr_w(strRet->pOleStr), hr);
|
||||
return hr;
|
||||
}
|
||||
|
||||
|
|
|
@ -26,8 +26,6 @@
|
|||
#include <stdio.h>
|
||||
|
||||
#define COBJMACROS
|
||||
#define NONAMELESSUNION
|
||||
|
||||
#include "winerror.h"
|
||||
#include "windef.h"
|
||||
#include "winbase.h"
|
||||
|
@ -891,18 +889,18 @@ IShellFolder_fnGetDisplayNameOf (IShellFolder2 * iface, LPCITEMIDLIST pidl,
|
|||
/* Win9x always returns ANSI strings, NT always returns Unicode strings */
|
||||
if (GetVersion() & 0x80000000) {
|
||||
strRet->uType = STRRET_CSTR;
|
||||
if (!WideCharToMultiByte(CP_ACP, 0, pszPath, -1, strRet->u.cStr, MAX_PATH,
|
||||
if (!WideCharToMultiByte(CP_ACP, 0, pszPath, -1, strRet->cStr, MAX_PATH,
|
||||
NULL, NULL))
|
||||
strRet->u.cStr[0] = '\0';
|
||||
strRet->cStr[0] = '\0';
|
||||
CoTaskMemFree(pszPath);
|
||||
} else {
|
||||
strRet->uType = STRRET_WSTR;
|
||||
strRet->u.pOleStr = pszPath;
|
||||
strRet->pOleStr = pszPath;
|
||||
}
|
||||
} else
|
||||
CoTaskMemFree(pszPath);
|
||||
|
||||
TRACE ("-- (%p)->(%s)\n", This, strRet->uType == STRRET_CSTR ? strRet->u.cStr : debugstr_w(strRet->u.pOleStr));
|
||||
TRACE ("-- (%p)->(%s)\n", This, strRet->uType == STRRET_CSTR ? strRet->cStr : debugstr_w(strRet->pOleStr));
|
||||
return hr;
|
||||
}
|
||||
|
||||
|
@ -1730,13 +1728,13 @@ ISFDropTarget_DragEnter (IDropTarget * iface, IDataObject * pDataObject,
|
|||
if (_ILIsFolder(ILFindLastID(This->pidlRoot)) && /* Only drop to folders, not to files */
|
||||
SUCCEEDED(IDataObject_GetData(pDataObject, &format, &medium))) /* Only ShellIDList format */
|
||||
{
|
||||
LPIDA pidaShellIDList = GlobalLock(medium.u.hGlobal);
|
||||
LPIDA pidaShellIDList = GlobalLock(medium.hGlobal);
|
||||
This->drop_effects_mask |= DROPEFFECT_COPY|DROPEFFECT_LINK;
|
||||
|
||||
if (pidaShellIDList) { /* Files can only be moved between two different folders */
|
||||
if (!ILIsEqual(HIDA_GetPIDLFolder(pidaShellIDList), This->pidlRoot))
|
||||
This->drop_effects_mask |= DROPEFFECT_MOVE;
|
||||
GlobalUnlock(medium.u.hGlobal);
|
||||
GlobalUnlock(medium.hGlobal);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1790,7 +1788,7 @@ ISFDropTarget_Drop (IDropTarget * iface, IDataObject * pDataObject,
|
|||
|
||||
if (medium.tymed == TYMED_HGLOBAL) {
|
||||
IShellFolder *psfSourceFolder, *psfDesktopFolder;
|
||||
LPIDA pidaShellIDList = GlobalLock(medium.u.hGlobal);
|
||||
LPIDA pidaShellIDList = GlobalLock(medium.hGlobal);
|
||||
STRRET strret;
|
||||
UINT i;
|
||||
|
||||
|
@ -1799,7 +1797,7 @@ ISFDropTarget_Drop (IDropTarget * iface, IDataObject * pDataObject,
|
|||
|
||||
hr = SHGetDesktopFolder(&psfDesktopFolder);
|
||||
if (FAILED(hr)) {
|
||||
GlobalUnlock(medium.u.hGlobal);
|
||||
GlobalUnlock(medium.hGlobal);
|
||||
return hr;
|
||||
}
|
||||
|
||||
|
@ -1807,7 +1805,7 @@ ISFDropTarget_Drop (IDropTarget * iface, IDataObject * pDataObject,
|
|||
&IID_IShellFolder, (LPVOID*)&psfSourceFolder);
|
||||
IShellFolder_Release(psfDesktopFolder);
|
||||
if (FAILED(hr)) {
|
||||
GlobalUnlock(medium.u.hGlobal);
|
||||
GlobalUnlock(medium.hGlobal);
|
||||
return hr;
|
||||
}
|
||||
|
||||
|
@ -1837,7 +1835,7 @@ ISFDropTarget_Drop (IDropTarget * iface, IDataObject * pDataObject,
|
|||
}
|
||||
|
||||
IShellFolder_Release(psfSourceFolder);
|
||||
GlobalUnlock(medium.u.hGlobal);
|
||||
GlobalUnlock(medium.hGlobal);
|
||||
return hr;
|
||||
}
|
||||
|
||||
|
|
|
@ -25,8 +25,6 @@
|
|||
#include <stdio.h>
|
||||
|
||||
#define COBJMACROS
|
||||
#define NONAMELESSUNION
|
||||
|
||||
#include "winerror.h"
|
||||
#include "windef.h"
|
||||
#include "winbase.h"
|
||||
|
@ -703,21 +701,21 @@ static HRESULT WINAPI ISF_MyComputer_fnGetDisplayNameOf (IShellFolder2 *iface,
|
|||
if (GetVersion() & 0x80000000)
|
||||
{
|
||||
strRet->uType = STRRET_CSTR;
|
||||
if (!WideCharToMultiByte(CP_ACP, 0, pszPath, -1, strRet->u.cStr, MAX_PATH,
|
||||
if (!WideCharToMultiByte(CP_ACP, 0, pszPath, -1, strRet->cStr, MAX_PATH,
|
||||
NULL, NULL))
|
||||
strRet->u.cStr[0] = '\0';
|
||||
strRet->cStr[0] = '\0';
|
||||
CoTaskMemFree(pszPath);
|
||||
}
|
||||
else
|
||||
{
|
||||
strRet->uType = STRRET_WSTR;
|
||||
strRet->u.pOleStr = pszPath;
|
||||
strRet->pOleStr = pszPath;
|
||||
}
|
||||
}
|
||||
else
|
||||
CoTaskMemFree(pszPath);
|
||||
|
||||
TRACE ("-- (%p)->(%s)\n", This, strRet->uType == STRRET_CSTR ? strRet->u.cStr : debugstr_w(strRet->u.pOleStr));
|
||||
TRACE ("-- (%p)->(%s)\n", This, strRet->uType == STRRET_CSTR ? strRet->cStr : debugstr_w(strRet->pOleStr));
|
||||
return hr;
|
||||
}
|
||||
|
||||
|
@ -806,7 +804,7 @@ static HRESULT WINAPI ISF_MyComputer_fnGetDetailsOf (IShellFolder2 *iface,
|
|||
if (!pidl)
|
||||
return SHELL32_GetColumnDetails(mycomputer_header, iColumn, psd);
|
||||
|
||||
psd->str.u.cStr[0] = 0;
|
||||
psd->str.cStr[0] = 0;
|
||||
psd->str.uType = STRRET_CSTR;
|
||||
|
||||
switch (iColumn)
|
||||
|
@ -820,8 +818,8 @@ static HRESULT WINAPI ISF_MyComputer_fnGetDetailsOf (IShellFolder2 *iface,
|
|||
break;
|
||||
|
||||
psd->str.uType = STRRET_WSTR;
|
||||
psd->str.u.pOleStr = CoTaskMemAlloc((MAX_PATH + 1) * sizeof(WCHAR));
|
||||
StrFormatByteSizeW(bytes.QuadPart, psd->str.u.pOleStr, MAX_PATH);
|
||||
psd->str.pOleStr = CoTaskMemAlloc((MAX_PATH + 1) * sizeof(WCHAR));
|
||||
StrFormatByteSizeW(bytes.QuadPart, psd->str.pOleStr, MAX_PATH);
|
||||
break;
|
||||
case 3: /* free size */
|
||||
if (!_ILIsDrive (pidl))
|
||||
|
@ -832,8 +830,8 @@ static HRESULT WINAPI ISF_MyComputer_fnGetDetailsOf (IShellFolder2 *iface,
|
|||
break;
|
||||
|
||||
psd->str.uType = STRRET_WSTR;
|
||||
psd->str.u.pOleStr = CoTaskMemAlloc((MAX_PATH + 1) * sizeof(WCHAR));
|
||||
StrFormatByteSizeW(bytes.QuadPart, psd->str.u.pOleStr, MAX_PATH);
|
||||
psd->str.pOleStr = CoTaskMemAlloc((MAX_PATH + 1) * sizeof(WCHAR));
|
||||
StrFormatByteSizeW(bytes.QuadPart, psd->str.pOleStr, MAX_PATH);
|
||||
break;
|
||||
default:
|
||||
return shellfolder_get_file_details( iface, pidl, mycomputer_header, iColumn, psd );
|
||||
|
|
|
@ -27,8 +27,6 @@
|
|||
#include <stdio.h>
|
||||
|
||||
#define COBJMACROS
|
||||
#define NONAMELESSUNION
|
||||
|
||||
#include "winerror.h"
|
||||
#include "windef.h"
|
||||
#include "winbase.h"
|
||||
|
@ -544,16 +542,16 @@ HRESULT SHELL32_GetColumnDetails(const shvheader *data, int column, SHELLDETAILS
|
|||
|
||||
if (SHELL_OsIsUnicode())
|
||||
{
|
||||
details->str.u.pOleStr = CoTaskMemAlloc(MAX_PATH * sizeof(WCHAR));
|
||||
if (!details->str.u.pOleStr) return E_OUTOFMEMORY;
|
||||
details->str.pOleStr = CoTaskMemAlloc(MAX_PATH * sizeof(WCHAR));
|
||||
if (!details->str.pOleStr) return E_OUTOFMEMORY;
|
||||
|
||||
details->str.uType = STRRET_WSTR;
|
||||
LoadStringW(shell32_hInstance, data[column].colnameid, details->str.u.pOleStr, MAX_PATH);
|
||||
LoadStringW(shell32_hInstance, data[column].colnameid, details->str.pOleStr, MAX_PATH);
|
||||
}
|
||||
else
|
||||
{
|
||||
details->str.uType = STRRET_CSTR;
|
||||
LoadStringA(shell32_hInstance, data[column].colnameid, details->str.u.cStr, MAX_PATH);
|
||||
LoadStringA(shell32_hInstance, data[column].colnameid, details->str.cStr, MAX_PATH);
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
|
@ -583,16 +581,16 @@ HRESULT shellfolder_get_file_details(IShellFolder2 *iface, LPCITEMIDLIST pidl, c
|
|||
case PID_STG_NAME:
|
||||
return IShellFolder2_GetDisplayNameOf( iface, pidl, SHGDN_NORMAL | SHGDN_INFOLDER, &psd->str );
|
||||
case PID_STG_SIZE:
|
||||
_ILGetFileSize( pidl, psd->str.u.cStr, MAX_PATH );
|
||||
_ILGetFileSize( pidl, psd->str.cStr, MAX_PATH );
|
||||
break;
|
||||
case PID_STG_STORAGETYPE:
|
||||
_ILGetFileType( pidl, psd->str.u.cStr, MAX_PATH );
|
||||
_ILGetFileType( pidl, psd->str.cStr, MAX_PATH );
|
||||
break;
|
||||
case PID_STG_WRITETIME:
|
||||
_ILGetFileDate( pidl, psd->str.u.cStr, MAX_PATH );
|
||||
_ILGetFileDate( pidl, psd->str.cStr, MAX_PATH );
|
||||
break;
|
||||
case PID_STG_ATTRIBUTES:
|
||||
_ILGetFileAttributes( pidl, psd->str.u.cStr, MAX_PATH );
|
||||
_ILGetFileAttributes( pidl, psd->str.cStr, MAX_PATH );
|
||||
break;
|
||||
}
|
||||
return S_OK;
|
||||
|
|
|
@ -42,7 +42,6 @@
|
|||
|
||||
#define CINTERFACE
|
||||
#define COBJMACROS
|
||||
#define NONAMELESSUNION
|
||||
|
||||
#include "windef.h"
|
||||
#include "winerror.h"
|
||||
|
@ -953,7 +952,7 @@ static HRESULT ShellView_OpenSelectedItems(IShellViewImpl * This)
|
|||
if (FAILED(hr))
|
||||
return hr;
|
||||
|
||||
pIDList = GlobalLock(stgm.u.hGlobal);
|
||||
pIDList = GlobalLock(stgm.hGlobal);
|
||||
|
||||
parent_pidl = (LPCITEMIDLIST) ((LPBYTE)pIDList+pIDList->aoffset[0]);
|
||||
hr = IShellFolder_GetAttributesOf(This->pSFParent, 1, &parent_pidl, &attribs);
|
||||
|
@ -992,7 +991,7 @@ static HRESULT ShellView_OpenSelectedItems(IShellViewImpl * This)
|
|||
}
|
||||
}
|
||||
|
||||
GlobalUnlock(stgm.u.hGlobal);
|
||||
GlobalUnlock(stgm.hGlobal);
|
||||
ReleaseStgMedium(&stgm);
|
||||
|
||||
IDataObject_Release(selection);
|
||||
|
@ -1436,7 +1435,7 @@ static LRESULT ShellView_OnNotify(IShellViewImpl * This, UINT CtlID, LPNMHDR lpn
|
|||
{
|
||||
/* set to empty on failure */
|
||||
sd.str.uType = STRRET_WSTR;
|
||||
sd.str.u.pOleStr = emptyW;
|
||||
sd.str.pOleStr = emptyW;
|
||||
}
|
||||
|
||||
if (lpnmh->code == LVN_GETDISPINFOW)
|
||||
|
|
|
@ -22,8 +22,6 @@
|
|||
#include <string.h>
|
||||
|
||||
#define COBJMACROS
|
||||
#define NONAMELESSUNION
|
||||
|
||||
#include "winerror.h"
|
||||
|
||||
#include "windef.h"
|
||||
|
@ -331,7 +329,7 @@ static void DoCopyOrCut(ContextMenu *This, HWND hwnd, BOOL cut)
|
|||
static BOOL CALLBACK Properties_AddPropSheetCallback(HPROPSHEETPAGE hpage, LPARAM lparam)
|
||||
{
|
||||
LPPROPSHEETHEADERW psh = (LPPROPSHEETHEADERW) lparam;
|
||||
psh->u3.phpage[psh->nPages++] = hpage;
|
||||
psh->phpage[psh->nPages++] = hpage;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -595,7 +593,7 @@ static void init_file_properties_pages(IDataObject *dataobject, LPFNADDPROPSHEET
|
|||
hr = IDataObject_GetData(dataobject, &format, &stgm);
|
||||
if (FAILED(hr)) goto error;
|
||||
|
||||
if (!DragQueryFileW((HDROP)stgm.u.hGlobal, 0, props->path, ARRAY_SIZE(props->path)))
|
||||
if (!DragQueryFileW((HDROP)stgm.hGlobal, 0, props->path, ARRAY_SIZE(props->path)))
|
||||
{
|
||||
ReleaseStgMedium(&stgm);
|
||||
goto error;
|
||||
|
@ -621,9 +619,9 @@ static void init_file_properties_pages(IDataObject *dataobject, LPFNADDPROPSHEET
|
|||
propsheet.dwFlags = PSP_DEFAULT | PSP_USECALLBACK;
|
||||
propsheet.hInstance = shell32_hInstance;
|
||||
if (props->attrib & FILE_ATTRIBUTE_DIRECTORY)
|
||||
propsheet.u.pszTemplate = (LPWSTR)MAKEINTRESOURCE(IDD_FOLDER_PROPERTIES);
|
||||
propsheet.pszTemplate = (LPWSTR)MAKEINTRESOURCE(IDD_FOLDER_PROPERTIES);
|
||||
else
|
||||
propsheet.u.pszTemplate = (LPWSTR)MAKEINTRESOURCE(IDD_FILE_PROPERTIES);
|
||||
propsheet.pszTemplate = (LPWSTR)MAKEINTRESOURCE(IDD_FILE_PROPERTIES);
|
||||
propsheet.pfnDlgProc = file_properties_proc;
|
||||
propsheet.pfnCallback = file_properties_callback;
|
||||
propsheet.lParam = (LPARAM)props;
|
||||
|
@ -658,8 +656,8 @@ static void DoOpenProperties(ContextMenu *This, HWND hwnd)
|
|||
psh.hwndParent = hwnd;
|
||||
psh.dwFlags = PSH_PROPTITLE;
|
||||
psh.nPages = 0;
|
||||
psh.u3.phpage = hpages;
|
||||
psh.u2.nStartPage = 0;
|
||||
psh.phpage = hpages;
|
||||
psh.nStartPage = 0;
|
||||
|
||||
_ILSimpleGetTextW(This->apidl[0], (LPVOID)wszFilename, MAX_PATH);
|
||||
psh.pszCaption = (LPCWSTR)wszFilename;
|
||||
|
@ -1185,7 +1183,7 @@ static HRESULT DoPaste(ContextMenu *This)
|
|||
LPITEMIDLIST * apidl;
|
||||
LPITEMIDLIST pidl;
|
||||
|
||||
LPIDA lpcida = GlobalLock(medium.u.hGlobal);
|
||||
LPIDA lpcida = GlobalLock(medium.hGlobal);
|
||||
TRACE("cida=%p\n", lpcida);
|
||||
if(lpcida)
|
||||
{
|
||||
|
@ -1198,7 +1196,7 @@ static HRESULT DoPaste(ContextMenu *This)
|
|||
}
|
||||
else
|
||||
hr = HRESULT_FROM_WIN32(GetLastError());
|
||||
GlobalUnlock(medium.u.hGlobal);
|
||||
GlobalUnlock(medium.hGlobal);
|
||||
}
|
||||
else
|
||||
hr = HRESULT_FROM_WIN32(GetLastError());
|
||||
|
@ -1215,14 +1213,14 @@ static HRESULT DoPaste(ContextMenu *This)
|
|||
UINT i, count;
|
||||
ITEMIDLIST **pidls;
|
||||
|
||||
TRACE("CF_HDROP=%p\n", medium.u.hGlobal);
|
||||
count = DragQueryFileW(medium.u.hGlobal, -1, NULL, 0);
|
||||
TRACE("CF_HDROP=%p\n", medium.hGlobal);
|
||||
count = DragQueryFileW(medium.hGlobal, -1, NULL, 0);
|
||||
pidls = SHAlloc(count*sizeof(ITEMIDLIST*));
|
||||
if (pidls)
|
||||
{
|
||||
for (i = 0; i < count; i++)
|
||||
{
|
||||
DragQueryFileW(medium.u.hGlobal, i, path, ARRAY_SIZE(path));
|
||||
DragQueryFileW(medium.hGlobal, i, path, ARRAY_SIZE(path));
|
||||
if ((pidls[i] = ILCreateFromPathW(path)) == NULL)
|
||||
{
|
||||
hr = E_FAIL;
|
||||
|
|
|
@ -20,8 +20,6 @@
|
|||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#define NONAMELESSUNION
|
||||
|
||||
#include <stdarg.h>
|
||||
|
||||
#include "windef.h"
|
||||
|
@ -107,7 +105,7 @@ BOOL WINAPI Shell_NotifyIconA(DWORD dwMessage, PNOTIFYICONDATAA pnid)
|
|||
MultiByteToWideChar(CP_ACP, 0, pnid->szInfoTitle, -1, nidW.szInfoTitle, ARRAY_SIZE(nidW.szInfoTitle));
|
||||
}
|
||||
|
||||
nidW.u.uTimeout = pnid->u.uTimeout;
|
||||
nidW.uTimeout = pnid->uTimeout;
|
||||
nidW.dwInfoFlags = pnid->dwInfoFlags;
|
||||
}
|
||||
|
||||
|
@ -234,13 +232,13 @@ noicon:
|
|||
{
|
||||
lstrcpynW( data->szInfo, nid->szInfo, ARRAY_SIZE(data->szInfo) );
|
||||
lstrcpynW( data->szInfoTitle, nid->szInfoTitle, ARRAY_SIZE(data->szInfoTitle));
|
||||
data->u.uTimeout = nid->u.uTimeout;
|
||||
data->u.uTimeout = nid->uTimeout;
|
||||
data->dwInfoFlags = nid->dwInfoFlags;
|
||||
}
|
||||
if (data->uFlags & NIF_GUID)
|
||||
data->guidItem = nid->guidItem;
|
||||
if (dwMessage == NIM_SETVERSION)
|
||||
data->u.uVersion = nid->u.uVersion;
|
||||
data->u.uVersion = nid->uVersion;
|
||||
/* FIXME: balloon icon */
|
||||
|
||||
cds.lpData = data;
|
||||
|
|
Loading…
Reference in a new issue