DEFINE_GUID(CLSID_RecycleBin, 0x645FF040, 0x5081, 0x101B, 0x9F, 0x08, 0x00, 0xAA, 0x00, 0x2F, 0x95, 0x4E);
DEFINE_GUID(CLSID_ControlPanel, 0x21EC2020, 0x3AEA, 0x1069, 0xA2, 0xDD, 0x08, 0x00, 0x2B, 0x30, 0x30, 0x9D);
DEFINE_GUID(CLSID_Printers, 0x2227A280, 0x3AEA, 0x1069, 0xA2, 0xDE, 0x08, 0x00, 0x2B, 0x30, 0x30, 0x9D);
+DEFINE_GUID(CLSID_MyDocuments, 0x450d8fba, 0xad25, 0x11d0, 0x98, 0xa8, 0x08, 0x00, 0x36, 0x1b, 0x11, 0x03);
DEFINE_GUID(IID_IQueryAssociations, 0xc46ca590, 0x3c3f, 0x11d2, 0xbe, 0xe6, 0x00, 0x00, 0xf8, 0x05, 0xca, 0x57);
mycomputer.ico \
netdrive.ico \
netdrive2.ico \
+ printer.ico \
ramdisk.ico
C_SRCS16 = shell.c
#define _ICOM_THIS_From_IAutoComplete2(class, name) class* This = (class*)(((char*)name)-_IAutoComplete2_Offset);
/*
- converts This to a interface pointer
+ converts This to an interface pointer
*/
#define _IUnknown_(This) (IUnknown*)&(This->lpVtbl)
#define _IAutoComplete2_(This) (IAutoComplete2*)&(This->lpvtblAutoComplete2)
if (pUnkOuter && !IsEqualIID (riid, &IID_IUnknown))
return CLASS_E_NOAGGREGATION;
- lpac = (IAutoCompleteImpl*)HeapAlloc(GetProcessHeap(),
- HEAP_ZERO_MEMORY, sizeof(IAutoCompleteImpl));
+ lpac = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IAutoCompleteImpl));
if (!lpac)
return E_OUTOFMEMORY;
LONG len;
/* pwszRegKeyPath contains the key as well as the value, so we split */
- key = (WCHAR*)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, (lstrlenW(pwzsRegKeyPath)+1)*sizeof(WCHAR));
+ key = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, (lstrlenW(pwzsRegKeyPath)+1)*sizeof(WCHAR));
strcpyW(key, pwzsRegKeyPath);
value = strrchrW(key, '\\');
*value = 0;
if (res == ERROR_SUCCESS) {
res = RegQueryValueW(hKey, value, result, &len);
if (res == ERROR_SUCCESS) {
- This->quickComplete = (WCHAR*)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, len*sizeof(WCHAR));
+ This->quickComplete = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, len*sizeof(WCHAR));
strcpyW(This->quickComplete, result);
}
RegCloseKey(hKey);
}
if ((pwszQuickComplete) && (!This->quickComplete)) {
- This->quickComplete = (WCHAR*)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, (lstrlenW(pwszQuickComplete)+1)*sizeof(WCHAR));
+ This->quickComplete = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, (lstrlenW(pwszQuickComplete)+1)*sizeof(WCHAR));
lstrcpyW(This->quickComplete, pwszQuickComplete);
}
/* If quickComplete is set and control is pressed, replace the string */
control = GetKeyState(VK_CONTROL) & 0x8000;
if (control && This->quickComplete) {
- hwndQCText = (WCHAR*)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY,
+ hwndQCText = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY,
(lstrlenW(This->quickComplete)+lstrlenW(hwndText))*sizeof(WCHAR));
sel = sprintfW(hwndQCText, This->quickComplete, hwndText);
SendMessageW(hwnd, WM_SETTEXT, 0, (LPARAM)hwndQCText);
int len;
len = SendMessageW(This->hwndListBox, LB_GETTEXTLEN, sel, (LPARAM)NULL);
- msg = (WCHAR*) HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, (len+1)*sizeof(WCHAR));
+ msg = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, (len+1)*sizeof(WCHAR));
SendMessageW(This->hwndListBox, LB_GETTEXT, sel, (LPARAM)msg);
SendMessageW(hwnd, WM_SETTEXT, 0, (LPARAM)msg);
SendMessageW(hwnd, EM_SETSEL, lstrlenW(msg), lstrlenW(msg));
SendMessageW(This->hwndListBox, LB_RESETCONTENT, 0, 0);
HeapFree(GetProcessHeap(), 0, This->txtbackup);
- This->txtbackup = (WCHAR*) HeapAlloc(GetProcessHeap(),
+ This->txtbackup = HeapAlloc(GetProcessHeap(),
HEAP_ZERO_MEMORY, (lstrlenW(hwndText)+1)*sizeof(WCHAR));
lstrcpyW(This->txtbackup, hwndText);
break;
case WM_LBUTTONDOWN:
len = SendMessageW(This->hwndListBox, LB_GETTEXTLEN, sel, (LPARAM)NULL);
- msg = (WCHAR*) HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, (len+1)*sizeof(WCHAR));
+ msg = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, (len+1)*sizeof(WCHAR));
sel = (INT)SendMessageW(hwnd, LB_GETCURSEL, 0, 0);
SendMessageW(hwnd, LB_GETTEXT, sel, (LPARAM)msg);
SendMessageW(This->hwndEdit, WM_SETTEXT, 0, (LPARAM)msg);
ret = HCR_RegGetDefaultIconW(hkey, szDest, len, dwNr);
RegCloseKey(hkey);
}
- TRACE("-- %s %li\n", debugstr_w(szDest), *dwNr );
+
+ if(ret)
+ TRACE("-- %s %li\n", debugstr_w(szDest), *dwNr );
+ else
+ TRACE("-- not found\n");
+
return ret;
}
/*
- converts This to a interface pointer
+ converts This to an interface pointer
*/
#define _IUnknown_(This) (IUnknown*)&(This->lpVtbl)
#define _IShellFolder_(This) (IShellFolder*)&(This->lpVtbl)
if (pUnkOuter && !IsEqualIID (riid, &IID_IUnknown))
return CLASS_E_NOAGGREGATION;
- sf = (ICPanelImpl *) LocalAlloc(GMEM_ZEROINIT, sizeof(ICPanelImpl));
+ sf = (ICPanelImpl *) LocalAlloc(LMEM_ZEROINIT, sizeof(ICPanelImpl));
if (!sf)
return E_OUTOFMEMORY;
ICPanel_PersistFolder2_GetCurFolder
};
-HRESULT WINAPI CPanel_GetIconLocationA(LPITEMIDLIST pidl, LPSTR szIconFile, UINT cchMax, int* piIndex)
-{
- PIDLCPanelStruct* pcpanel = _ILGetCPanelPointer(pidl);
-
- if (!pcpanel)
- return E_INVALIDARG;
-
- lstrcpyA(szIconFile, pcpanel->szName);
- *piIndex = pcpanel->iconIdx!=-1? pcpanel->iconIdx: 0;
-
- return S_OK;
-}
-
-HRESULT WINAPI CPanel_GetIconLocationW(LPITEMIDLIST pidl, LPWSTR szIconFile, UINT cchMax, int* piIndex)
+HRESULT CPanel_GetIconLocationW(LPITEMIDLIST pidl,
+ LPWSTR szIconFile, UINT cchMax, int* piIndex)
{
PIDLCPanelStruct* pcpanel = _ILGetCPanelPointer(pidl);
* IShellExecuteHookW Implementation
*/
-static HRESULT WINAPI IShellExecuteHookW_fnQueryInterface(IShellExecuteHookW* iface, REFIID riid, void** ppvObject)
+static HRESULT WINAPI IShellExecuteHookW_fnQueryInterface(
+ IShellExecuteHookW* iface, REFIID riid, void** ppvObject)
{
_ICOM_THIS_From_IShellExecuteHookW(ICPanelImpl, iface);
static IShellExecuteHookAVtbl vt_ShellExecuteHookA =
{
-
IShellExecuteHookA_fnQueryInterface,
IShellExecuteHookA_fnAddRef,
IShellExecuteHookA_fnRelease,
-
IShellExecuteHookA_fnExecute
};
LPFORMATETC pFmt;
} IEnumFORMATETCImpl;
-static HRESULT WINAPI IEnumFORMATETC_fnQueryInterface(LPENUMFORMATETC iface, REFIID riid, LPVOID* ppvObj);
-static ULONG WINAPI IEnumFORMATETC_fnAddRef(LPENUMFORMATETC iface);
-static ULONG WINAPI IEnumFORMATETC_fnRelease(LPENUMFORMATETC iface);
-static HRESULT WINAPI IEnumFORMATETC_fnNext(LPENUMFORMATETC iface, ULONG celt, FORMATETC* rgelt, ULONG* pceltFethed);
-static HRESULT WINAPI IEnumFORMATETC_fnSkip(LPENUMFORMATETC iface, ULONG celt);
-static HRESULT WINAPI IEnumFORMATETC_fnReset(LPENUMFORMATETC iface);
-static HRESULT WINAPI IEnumFORMATETC_fnClone(LPENUMFORMATETC iface, LPENUMFORMATETC* ppenum);
-
-static struct IEnumFORMATETCVtbl efvt =
-{
- IEnumFORMATETC_fnQueryInterface,
- IEnumFORMATETC_fnAddRef,
- IEnumFORMATETC_fnRelease,
- IEnumFORMATETC_fnNext,
- IEnumFORMATETC_fnSkip,
- IEnumFORMATETC_fnReset,
- IEnumFORMATETC_fnClone
-};
-
-LPENUMFORMATETC IEnumFORMATETC_Constructor(UINT cfmt, const FORMATETC afmt[])
-{
- IEnumFORMATETCImpl* ef;
- DWORD size=cfmt * sizeof(FORMATETC);
-
- ef=(IEnumFORMATETCImpl*)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IEnumFORMATETCImpl));
-
- if(ef)
- {
- ef->ref=1;
- ef->lpVtbl=&efvt;
-
- ef->countFmt = cfmt;
- ef->pFmt = SHAlloc (size);
-
- if (ef->pFmt)
- {
- memcpy(ef->pFmt, afmt, size);
- }
- }
-
- TRACE("(%p)->(%u,%p)\n",ef, cfmt, afmt);
- return (LPENUMFORMATETC)ef;
-}
-
-static HRESULT WINAPI IEnumFORMATETC_fnQueryInterface(LPENUMFORMATETC iface, REFIID riid, LPVOID* ppvObj)
+static HRESULT WINAPI IEnumFORMATETC_fnQueryInterface(
+ LPENUMFORMATETC iface, REFIID riid, LPVOID* ppvObj)
{
IEnumFORMATETCImpl *This = (IEnumFORMATETCImpl *)iface;
TRACE("(%p)->(\n\tIID:\t%s,%p)\n",This,debugstr_guid(riid),ppvObj);
}
TRACE("-- Interface: E_NOINTERFACE\n");
return E_NOINTERFACE;
-
}
static ULONG WINAPI IEnumFORMATETC_fnAddRef(LPENUMFORMATETC iface)
return S_OK;
}
+static struct IEnumFORMATETCVtbl efvt =
+{
+ IEnumFORMATETC_fnQueryInterface,
+ IEnumFORMATETC_fnAddRef,
+ IEnumFORMATETC_fnRelease,
+ IEnumFORMATETC_fnNext,
+ IEnumFORMATETC_fnSkip,
+ IEnumFORMATETC_fnReset,
+ IEnumFORMATETC_fnClone
+};
+
+LPENUMFORMATETC IEnumFORMATETC_Constructor(UINT cfmt, const FORMATETC afmt[])
+{
+ IEnumFORMATETCImpl* ef;
+ DWORD size=cfmt * sizeof(FORMATETC);
+
+ ef = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IEnumFORMATETCImpl));
+
+ if(ef)
+ {
+ ef->ref=1;
+ ef->lpVtbl=&efvt;
+
+ ef->countFmt = cfmt;
+ ef->pFmt = SHAlloc (size);
+
+ if (ef->pFmt)
+ memcpy(ef->pFmt, afmt, size);
+ }
+
+ TRACE("(%p)->(%u,%p)\n",ef, cfmt, afmt);
+ return (LPENUMFORMATETC)ef;
+}
+
/***********************************************************************
* IDataObject implementation
} IDataObjectImpl;
-static struct IDataObjectVtbl dtovt;
-
-/**************************************************************************
-* IDataObject_Constructor
-*/
-LPDATAOBJECT IDataObject_Constructor(HWND hwndOwner, LPCITEMIDLIST pMyPidl, LPCITEMIDLIST * apidl, UINT cidl)
-{
- IDataObjectImpl* dto;
-
- dto = (IDataObjectImpl*)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDataObjectImpl));
-
- if (dto)
- {
- dto->ref = 1;
- dto->lpVtbl = &dtovt;
- dto->pidl = ILClone(pMyPidl);
- dto->apidl = _ILCopyaPidl(apidl, cidl);
- dto->cidl = cidl;
-
- dto->cfShellIDList = RegisterClipboardFormatA(CFSTR_SHELLIDLIST);
- dto->cfFileNameA = RegisterClipboardFormatA(CFSTR_FILENAMEA);
- dto->cfFileNameW = RegisterClipboardFormatA(CFSTR_FILENAMEW);
- InitFormatEtc(dto->pFormatEtc[0], dto->cfShellIDList, TYMED_HGLOBAL);
- InitFormatEtc(dto->pFormatEtc[1], CF_HDROP, TYMED_HGLOBAL);
- InitFormatEtc(dto->pFormatEtc[2], dto->cfFileNameA, TYMED_HGLOBAL);
- InitFormatEtc(dto->pFormatEtc[3], dto->cfFileNameW, TYMED_HGLOBAL);
- }
-
- TRACE("(%p)->(apidl=%p cidl=%u)\n",dto, apidl, cidl);
- return (LPDATAOBJECT)dto;
-}
-
/***************************************************************************
* IDataObject_QueryInterface
*/
IDataObject_fnDUnadvise,
IDataObject_fnEnumDAdvise
};
+
+/**************************************************************************
+* IDataObject_Constructor
+*/
+LPDATAOBJECT IDataObject_Constructor(HWND hwndOwner,
+ LPCITEMIDLIST pMyPidl, LPCITEMIDLIST * apidl, UINT cidl)
+{
+ IDataObjectImpl* dto;
+
+ dto = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDataObjectImpl));
+
+ if (dto)
+ {
+ dto->ref = 1;
+ dto->lpVtbl = &dtovt;
+ dto->pidl = ILClone(pMyPidl);
+ dto->apidl = _ILCopyaPidl(apidl, cidl);
+ dto->cidl = cidl;
+
+ dto->cfShellIDList = RegisterClipboardFormatA(CFSTR_SHELLIDLIST);
+ dto->cfFileNameA = RegisterClipboardFormatA(CFSTR_FILENAMEA);
+ dto->cfFileNameW = RegisterClipboardFormatA(CFSTR_FILENAMEW);
+ InitFormatEtc(dto->pFormatEtc[0], dto->cfShellIDList, TYMED_HGLOBAL);
+ InitFormatEtc(dto->pFormatEtc[1], CF_HDROP, TYMED_HGLOBAL);
+ InitFormatEtc(dto->pFormatEtc[2], dto->cfFileNameA, TYMED_HGLOBAL);
+ InitFormatEtc(dto->pFormatEtc[3], dto->cfFileNameW, TYMED_HGLOBAL);
+ }
+
+ TRACE("(%p)->(apidl=%p cidl=%u)\n",dto, apidl, cidl);
+ return (LPDATAOBJECT)dto;
+}
{
case PT_SHELLEXT:
case PT_GUID:
+ case PT_YAGUID:
return &(pdata->u.guid.guid);
}
}
if (_dbg_ILIsDesktop(pidl))
{
/* desktop */
- if (szOut) strncpy(szOut, "Desktop", uOutSize);
+ if (szOut) lstrcpynA(szOut, "Desktop", uOutSize);
dwReturn = strlen ("Desktop");
}
else if (( szSrc = _dbg_ILGetTextPointer(pidl) ))
{
/* filesystem */
- if (szOut) strncpy(szOut, szSrc, uOutSize);
+ if (szOut) lstrcpynA(szOut, szSrc, uOutSize);
dwReturn = strlen(szSrc);
}
else if (( riid = _dbg_ILGetGUIDPointer(pidl) ))
pidltemp = _dbg_ILGetNext(pidltemp);
- } while (pidltemp->mkid.cb);
+ } while (pidltemp && pidltemp->mkid.cb);
}
else
{
pcheck(pidl);
}
}
-#define BYTES_PRINTED 32
-BOOL pcheck (LPCITEMIDLIST pidl)
+
+static void dump_pidl_hex( LPCITEMIDLIST pidl )
{
- DWORD type, ret=TRUE;
- LPCITEMIDLIST pidltemp = pidl;
-
- if (pidltemp && pidltemp->mkid.cb)
- { do
- { type = _dbg_ILGetDataPointer(pidltemp)->type;
- switch (type)
- { case PT_CPLAPPLET:
- case PT_GUID:
- case PT_SHELLEXT:
- case PT_DRIVE:
- case PT_DRIVE1:
- case PT_DRIVE2:
- case PT_DRIVE3:
- case PT_FOLDER:
- case PT_VALUE:
- case PT_FOLDER1:
- case PT_WORKGRP:
- case PT_COMP:
- case PT_NETPROVIDER:
- case PT_NETWORK:
- case PT_IESPECIAL1:
- case PT_YAGUID:
- case PT_IESPECIAL2:
- case PT_SHARE:
- break;
- default:
- {
- char szTemp[BYTES_PRINTED*4 + 1];
- int i;
- unsigned char c;
-
- memset(szTemp, ' ', BYTES_PRINTED*4 + 1);
- for ( i = 0; (i<pidltemp->mkid.cb) && (i<BYTES_PRINTED); i++)
- {
- c = ((const unsigned char *)pidltemp)[i];
-
- szTemp[i*3+0] = ((c>>4)>9)? (c>>4)+55 : (c>>4)+48;
- szTemp[i*3+1] = ((0x0F&c)>9)? (0x0F&c)+55 : (0x0F&c)+48;
- szTemp[i*3+2] = ' ';
- szTemp[i+BYTES_PRINTED*3] = (c>=0x20 && c <=0x80) ? c : '.';
- }
- szTemp[BYTES_PRINTED*4] = 0x00;
- ERR("unknown IDLIST %p [%p] size=%u type=%lx\n%s\n",pidl, pidltemp, pidltemp->mkid.cb,type, szTemp);
- ret = FALSE;
- }
- }
- pidltemp = _dbg_ILGetNext(pidltemp);
- } while (pidltemp->mkid.cb);
- }
- return ret;
+ const unsigned char *p = (const unsigned char *)pidl;
+ const int max_bytes = 0x80, max_line = 0x10;
+ char szHex[max_line*3+1], szAscii[max_line+1];
+ int i, n;
+
+ n = pidl->mkid.cb;
+ if( n>max_bytes )
+ n = max_bytes;
+ for( i=0; i<n; i++ )
+ {
+ sprintf( &szHex[ (i%max_line)*3 ], "%02X ", p[i] );
+ szAscii[ (i%max_line) ] = isprint( p[i] ) ? p[i] : '.';
+
+ /* print out at the end of each line and when we're finished */
+ if( i!=(n-1) && (i%max_line) != (max_line-1) )
+ continue;
+ szAscii[ (i%max_line)+1 ] = 0;
+ DPRINTF("%-*s %s\n", max_line*3, szHex, szAscii );
+ }
+}
+
+BOOL pcheck( LPCITEMIDLIST pidl )
+{
+ DWORD type;
+ LPCITEMIDLIST pidltemp = pidl;
+
+ while( pidltemp && pidltemp->mkid.cb )
+ {
+ type = _dbg_ILGetDataPointer(pidltemp)->type;
+ switch( type )
+ {
+ case PT_CPLAPPLET:
+ case PT_GUID:
+ case PT_SHELLEXT:
+ case PT_DRIVE:
+ case PT_DRIVE1:
+ case PT_DRIVE2:
+ case PT_DRIVE3:
+ case PT_FOLDER:
+ case PT_VALUE:
+ case PT_VALUEW:
+ case PT_FOLDER1:
+ case PT_WORKGRP:
+ case PT_COMP:
+ case PT_NETPROVIDER:
+ case PT_NETWORK:
+ case PT_IESPECIAL1:
+ case PT_YAGUID:
+ case PT_IESPECIAL2:
+ case PT_SHARE:
+ break;
+ default:
+ ERR("unknown IDLIST %p [%p] size=%u type=%lx\n",
+ pidl, pidltemp, pidltemp->mkid.cb,type );
+ dump_pidl_hex( pidltemp );
+ return FALSE;
+ }
+ pidltemp = _dbg_ILGetNext(pidltemp);
+ }
+ return TRUE;
}
static char shdebugstr_buf1[100];
{&IID_IDataObject, "IID_IDataObject"},
{&IID_IAutoComplete, "IID_IAutoComplete"},
{&IID_IAutoComplete2, "IID_IAutoComplete2"},
+ {&IID_IShellLinkA, "IID_IShellLinkA"},
+ {&IID_IShellLinkW, "IID_IShellLinkW"},
{NULL,NULL}};
const char * shdebugstr_guid( const struct _GUID *id )
if (pUnkOuter)
return CLASS_E_NOAGGREGATION;
- dth = (IDropTargetHelperImpl *) LocalAlloc (GMEM_ZEROINIT, sizeof (IDropTargetHelperImpl));
+ dth = (IDropTargetHelperImpl *) LocalAlloc (LMEM_ZEROINIT, sizeof (IDropTargetHelperImpl));
if (!dth) return E_OUTOFMEMORY;
dth->ref = 0;
IEnumIDList * IEnumIDList_Constructor(void)
{
- IEnumIDListImpl *lpeidl = (IEnumIDListImpl*)HeapAlloc(GetProcessHeap(),
+ IEnumIDListImpl *lpeidl = HeapAlloc(GetProcessHeap(),
HEAP_ZERO_MEMORY, sizeof(IEnumIDListImpl));
if (lpeidl)
#include "pidl.h"
#include "shell32_main.h"
#include "shfldr.h"
+#include "shresdef.h"
WINE_DEFAULT_DEBUG_CHANNEL(shell);
TRACE("%p\n", pidl);
- ei = (IExtractIconWImpl*)HeapAlloc(GetProcessHeap(),0,sizeof(IExtractIconWImpl));
+ ei = HeapAlloc(GetProcessHeap(),0,sizeof(IExtractIconWImpl));
ei->ref=1;
ei->lpVtbl = &eivt;
ei->lpvtblPersistFile = &pfvt;
if (!HCR_GetDefaultIconW(folder, szIconFile, cchMax, &dwNr))
{
lstrcpynW(szIconFile, swShell32Name, cchMax);
- dwNr = 3;
+ dwNr = IDI_SHELL_FOLDER;
}
- *piIndex = (uFlags & GIL_OPENICON) ? dwNr + 1 : dwNr;
+ *piIndex = -((uFlags & GIL_OPENICON) ? dwNr + 1 : dwNr);
}
return S_OK;
}
if (_ILIsDesktop(pSimplePidl))
{
lstrcpynW(szIconFile, swShell32Name, cchMax);
- *piIndex = 34;
+ *piIndex = -IDI_SHELL_DESKTOP;
}
/* my computer and other shell extensions */
else
{
lstrcpynW(szIconFile, swShell32Name, cchMax);
- *piIndex = 15;
+ if(IsEqualGUID(riid, &CLSID_MyComputer))
+ *piIndex = -IDI_SHELL_MY_COMPUTER;
+ else if(IsEqualGUID(riid, &CLSID_MyDocuments))
+ *piIndex = -IDI_SHELL_FOLDER;
+ else if(IsEqualGUID(riid, &CLSID_NetworkPlaces))
+ *piIndex = -IDI_SHELL_MY_NETWORK_PLACES;
+ else
+ *piIndex = -IDI_SHELL_FOLDER;
}
}
{
switch(GetDriveTypeA(sTemp))
{
- case DRIVE_REMOVABLE: icon_idx = 5; break;
- case DRIVE_CDROM: icon_idx = 11; break;
- case DRIVE_REMOTE: icon_idx = 9; break;
- case DRIVE_RAMDISK: icon_idx = 12; break;
+ case DRIVE_REMOVABLE: icon_idx = IDI_SHELL_FLOPPY; break;
+ case DRIVE_CDROM: icon_idx = IDI_SHELL_CDROM; break;
+ case DRIVE_REMOTE: icon_idx = IDI_SHELL_NETDRIVE; break;
+ case DRIVE_RAMDISK: icon_idx = IDI_SHELL_RAMDISK; break;
}
}
if (icon_idx != -1)
{
lstrcpynW(szIconFile, swShell32Name, cchMax);
- *piIndex = icon_idx;
+ *piIndex = -icon_idx;
}
else
{
else
{
lstrcpynW(szIconFile, swShell32Name, cchMax);
- *piIndex = 8;
+ *piIndex = -IDI_SHELL_DRIVE;
}
}
}
else if (_ILIsFolder (pSimplePidl))
{
- getIconLocationForFolder(iface, uFlags, szIconFile, cchMax, piIndex,
- pwFlags);
+ getIconLocationForFolder(iface, uFlags, szIconFile, cchMax, piIndex,
+ pwFlags);
}
else
{
static HRESULT WINAPI IExtractIconW_fnExtract(IExtractIconW * iface, LPCWSTR pszFile, UINT nIconIndex, HICON *phiconLarge, HICON *phiconSmall, UINT nIconSize)
{
IExtractIconWImpl *This = (IExtractIconWImpl *)iface;
+ int index;
- FIXME("(%p) (file=%p index=%u %p %p size=%u) semi-stub\n", This, debugstr_w(pszFile), nIconIndex, phiconLarge, phiconSmall, nIconSize);
+ FIXME("(%p) (file=%p index=%d %p %p size=%08x) semi-stub\n", This, debugstr_w(pszFile), (signed)nIconIndex,
+ phiconLarge, phiconSmall, nIconSize);
+
+ index = SIC_GetIconIndex(pszFile, nIconIndex);
if (phiconLarge)
- *phiconLarge = ImageList_GetIcon(ShellBigIconList, nIconIndex, ILD_TRANSPARENT);
+ *phiconLarge = ImageList_GetIcon(ShellBigIconList, index, ILD_TRANSPARENT);
if (phiconSmall)
- *phiconSmall = ImageList_GetIcon(ShellSmallIconList, nIconIndex, ILD_TRANSPARENT);
+ *phiconSmall = ImageList_GetIcon(ShellSmallIconList, index, ILD_TRANSPARENT);
return S_OK;
}
hSm = LoadImageA(shell32_hInstance, MAKEINTRESOURCEA(1), IMAGE_ICON, cx_small, cy_small, LR_SHARED);
hLg = LoadImageA(shell32_hInstance, MAKEINTRESOURCEA(1), IMAGE_ICON, cx_large, cy_large, LR_SHARED);
}
- SIC_IconAppend (swShell32Name, index, hSm, hLg);
+ SIC_IconAppend (swShell32Name, index - 1, hSm, hLg);
+ SIC_IconAppend (swShell32Name, -index, hSm, hLg);
}
TRACE("hIconSmall=%p hIconBig=%p\n",ShellSmallIconList, ShellBigIconList);
/*
- * this class implements a pure IStream object
- * and can be used for many purposes
+ * This class implements a pure IStream object
+ * and can be used for many purposes.
*
- * the main reason for implementing this was
+ * The main reason for implementing this was
* a cleaner implementation of IShellLink which
- * needs to be able to load lnk's from a IStream
+ * needs to be able to load lnks from an IStream
* interface so it was obvious to capsule the file
- * access in a IStream to.
+ * access in an IStream to.
*
* Copyright 1999 Juergen Schmied
* Copyright 2003 Mike McCormack for CodeWeavers
WINE_DEFAULT_DEBUG_CHANNEL(shell);
-static const IStreamVtbl stvt;
+#define STGM_ACCESS_MODE(stgm) ((stgm)&0x0000f)
+#define STGM_SHARE_MODE(stgm) ((stgm)&0x000f0)
+#define STGM_CREATE_MODE(stgm) ((stgm)&0x0f000)
typedef struct
{
const IStreamVtbl *lpvtst;
- DWORD ref;
- HANDLE handle;
+ DWORD ref;
+ HANDLE handle;
} ISHFileStream;
-/**************************************************************************
- * CreateStreamOnFile()
- *
- * similar to CreateStreamOnHGlobal
- */
-HRESULT CreateStreamOnFile (LPCWSTR pszFilename, DWORD grfMode, IStream ** ppstm)
-{
- ISHFileStream* fstr;
- HANDLE handle;
- DWORD access = GENERIC_READ, creat;
-
- if( grfMode & STGM_TRANSACTED )
- return E_INVALIDARG;
-
- if( grfMode & STGM_WRITE )
- access |= GENERIC_WRITE;
- if( grfMode & STGM_READWRITE )
- access = GENERIC_WRITE | GENERIC_READ;
-
- if( grfMode & STGM_CREATE )
- creat = CREATE_ALWAYS;
- else
- creat = OPEN_EXISTING;
-
- TRACE("Opening %s\n", debugstr_w(pszFilename) );
-
- handle = CreateFileW( pszFilename, access, FILE_SHARE_READ, NULL, creat, 0, NULL );
- if( handle == INVALID_HANDLE_VALUE )
- return HRESULT_FROM_WIN32(GetLastError());
-
- fstr = (ISHFileStream*)HeapAlloc(GetProcessHeap(),
- HEAP_ZERO_MEMORY,sizeof(ISHFileStream));
- if( !fstr )
- return E_OUTOFMEMORY;
- fstr->lpvtst=&stvt;
- fstr->ref = 1;
- fstr->handle = handle;
-
- (*ppstm) = (IStream*)fstr;
-
- return S_OK;
-}
-
/**************************************************************************
* IStream_fnQueryInterface
*/
*ppvObj = NULL;
- if(IsEqualIID(riid, &IID_IUnknown) ||
- IsEqualIID(riid, &IID_IStream))
- {
- *ppvObj = This;
- }
+ if(IsEqualIID(riid, &IID_IUnknown) || IsEqualIID(riid, &IID_IStream))
+ *ppvObj = This;
if(*ppvObj)
{
- IStream_AddRef((IStream*)*ppvObj);
- TRACE("-- Interface: (%p)->(%p)\n",ppvObj,*ppvObj);
- return S_OK;
+ IStream_AddRef((IStream*)*ppvObj);
+ TRACE("-- Interface: (%p)->(%p)\n",ppvObj,*ppvObj);
+ return S_OK;
}
TRACE("-- Interface: E_NOINTERFACE\n");
return E_NOINTERFACE;
IStream_fnUnlockRegion,
IStream_fnStat,
IStream_fnClone
-
};
+
+/**************************************************************************
+ * CreateStreamOnFile()
+ *
+ * similar to CreateStreamOnHGlobal
+ */
+HRESULT CreateStreamOnFile (LPCWSTR pszFilename, DWORD grfMode, IStream ** ppstm)
+{
+ ISHFileStream* fstr;
+ HANDLE handle;
+ DWORD access = GENERIC_READ, creat;
+
+ if( grfMode & STGM_TRANSACTED )
+ return E_INVALIDARG;
+
+ switch( STGM_ACCESS_MODE( grfMode ) )
+ {
+ case STGM_READ:
+ access = GENERIC_READ;
+ break;
+ case STGM_WRITE:
+ case STGM_READWRITE:
+ access = GENERIC_WRITE | GENERIC_READ;
+ break;
+ default:
+ return STG_E_INVALIDFLAG;
+ }
+
+ switch( STGM_CREATE_MODE( grfMode ) )
+ {
+ case STGM_CREATE:
+ creat = CREATE_ALWAYS;
+ break;
+ case STGM_FAILIFTHERE:
+ creat = OPEN_EXISTING;
+ break;
+ default:
+ return STG_E_INVALIDFLAG;
+ }
+
+ handle = CreateFileW( pszFilename, access,
+ FILE_SHARE_READ, NULL, creat, 0, NULL );
+ if( handle == INVALID_HANDLE_VALUE )
+ return HRESULT_FROM_WIN32(GetLastError());
+
+ fstr = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(ISHFileStream));
+ if( !fstr )
+ return E_OUTOFMEMORY;
+ fstr->lpvtst = &stvt;
+ fstr->ref = 1;
+ fstr->handle = handle;
+
+ (*ppstm) = (IStream*)fstr;
+
+ return S_OK;
+}
if (SUCCEEDED(hr))
PathAddBackslashA(pszPath);
}
- /* The only other valid case is a item ID list beginning at "My Computer" */
+ /* The only other valid case is an item ID list beginning at "My Computer" */
else if (_ILIsMyComputer(pidl))
pidl = ILGetNext(pidl);
if (SUCCEEDED(hr))
PathAddBackslashW(pszPath);
}
- /* The only other valid case is a item ID list beginning at "My Computer" */
+ /* The only other valid case is an item ID list beginning at "My Computer" */
else if (_ILIsMyComputer(pidl))
pidl = ILGetNext(pidl);
TRACE("(%p)\n",pidl);
- return (pidl && ( (lpPData && (PT_GUID== lpPData->type || PT_SHELLEXT== lpPData->type)) ||
+ return (pidl && ( (lpPData && (PT_GUID== lpPData->type || PT_SHELLEXT== lpPData->type || PT_YAGUID == lpPData->type)) ||
(pidl && pidl->mkid.cb == 0x00)
));
}
{
case PT_SHELLEXT:
case PT_GUID:
+ case PT_YAGUID:
return &(pdata->u.guid.guid);
default:
#define PT_FOLDER1 0x30
#define PT_FOLDER 0x31
#define PT_VALUE 0x32
+#define PT_VALUEW 0x34
#define PT_WORKGRP 0x41
#define PT_COMP 0x42
#define PT_NETPROVIDER 0x46
The second the dos name when needed or just 0x00 */
} FileStruct;
+typedef struct tagValueW
+{
+ WCHAR name[1];
+} ValueWStruct;
+
typedef struct tagPIDLDATA
{ PIDLTYPE type; /*00*/
union
CHAR szName[1]; /*06*/ /* terminated by 0x00 0x00 */
} htmlhelp;
struct tagPIDLCPanelStruct cpanel;
+ struct tagValueW valueW;
}u;
} PIDLDATA, *LPPIDLDATA;
#include "poppack.h"
"shell32.dll",
"Apartment"
},
+ { &CLSID_DragDropHelper,
+ "Shell Drag and Drop Helper",
+ NULL,
+ "shell32.dll",
+ "Apartment"
+ },
{ &CLSID_MyComputer,
"My Computer",
NULL,
int i;
if (phiconLarge)
- ilarge = (HICON*)HeapAlloc(GetProcessHeap(),0,nIcons*sizeof(HICON));
+ ilarge = HeapAlloc(GetProcessHeap(),0,nIcons*sizeof(HICON));
else
ilarge = NULL;
if (phiconSmall)
- ismall = (HICON*)HeapAlloc(GetProcessHeap(),0,nIcons*sizeof(HICON));
+ ismall = HeapAlloc(GetProcessHeap(),0,nIcons*sizeof(HICON));
else
ismall = NULL;
ret = HICON_16(ExtractIconExA(lpszFile,nIconIndex,ilarge,ismall,nIcons));
DWORD WINAPI DoEnvironmentSubst16(LPSTR str,WORD length)
{
LPSTR lpEnv = MapSL(GetDOSEnvironment16());
- LPSTR lpBuffer = (LPSTR)HeapAlloc( GetProcessHeap(), 0, length);
+ LPSTR lpBuffer = HeapAlloc( GetProcessHeap(), 0, length);
LPSTR lpstr = str;
LPSTR lpbstr = lpBuffer;
#include "pidl.h"
#include "shell32_main.h"
#include "version.h"
+#include "shresdef.h"
#include "wine/debug.h"
#include "wine/unicode.h"
lstrcpynW(sTemp, szFullPath, MAX_PATH);
if (dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
- psfi->iIcon = 2;
+ psfi->iIcon = SIC_GetIconIndex(swShell32Name, -IDI_SHELL_FOLDER);
else
{
static const WCHAR p1W[] = {'%','1',0};
HRESULT WINAPI IFileSystemBindData_Constructor(const WIN32_FIND_DATAW *pfd, LPBC *ppV);
HRESULT WINAPI IControlPanel_Constructor(IUnknown * pUnkOuter, REFIID riid, LPVOID * ppv);
HRESULT WINAPI UnixFolder_Constructor(IUnknown * pUnkOuter, REFIID riid, LPVOID * ppv);
-HRESULT WINAPI CPanel_GetIconLocationA(LPITEMIDLIST pidl, LPSTR szIconFile, UINT cchMax, int* piIndex);
-HRESULT WINAPI CPanel_GetIconLocationW(LPITEMIDLIST pidl, LPWSTR szIconFile, UINT cchMax, int* piIndex);
+extern HRESULT CPanel_GetIconLocationW(LPITEMIDLIST, LPWSTR, UINT, int*);
HRESULT WINAPI CPanel_ExtractIconA(LPITEMIDLIST pidl, LPCSTR pszFile, UINT nIconIndex, HICON *phiconLarge, HICON *phiconSmall, UINT nIconSize);
HRESULT WINAPI CPanel_ExtractIconW(LPITEMIDLIST pidl, LPCWSTR pszFile, UINT nIconIndex, HICON *phiconLarge, HICON *phiconSmall, UINT nIconSize);
/*
- * defines helperfunctions to manipulate the contents of a IShellFolder
+ * Defines helper functions to manipulate the contents of an IShellFolder
*
* Copyright 2000 Juergen Schmied
*
/* link file formats */
-/* flag1: lnk elements: simple link has 0x0B */
-#define SCF_PIDL 1
-#define SCF_LOCATION 2
-#define SCF_DESCRIPTION 4
-#define SCF_RELATIVE 8
-#define SCF_WORKDIR 0x10
-#define SCF_ARGS 0x20
-#define SCF_CUSTOMICON 0x40
-#define SCF_UNICODE 0x80
-#define SCF_PRODUCT 0x800
-#define SCF_COMPONENT 0x1000
-
#include "pshpack1.h"
typedef struct _LINK_HEADER
DWORD dwVolLabelOfs;
} LOCAL_VOLUME_INFO;
-typedef struct tagLINK_ADVERTISEINFO
-{
- DWORD size;
- DWORD magic;
- CHAR bufA[MAX_PATH];
- WCHAR bufW[MAX_PATH];
-} LINK_ADVERTISEINFO;
-
typedef struct volume_info_t
{
DWORD type;
HRESULT r;
IStream *stm;
- TRACE("(%p, %s)\n",This, debugstr_w(pszFileName));
+ TRACE("(%p, %s, %lx)\n",This, debugstr_w(pszFileName), dwMode);
r = CreateStreamOnFile(pszFileName, dwMode, &stm);
if( SUCCEEDED( r ) )
IStream_Release( stm );
This->bDirty = FALSE;
}
-
+ TRACE("-- returning hr %08lx\n", r);
return r;
}
DWORD size;
ULONG count;
HRESULT r;
- LINK_ADVERTISEINFO buffer;
+ EXP_DARWIN_LINK buffer;
TRACE("%p\n",stm);
- r = IStream_Read( stm, &buffer.size, sizeof (DWORD), &count );
+ r = IStream_Read( stm, &buffer.dbh.cbSize, sizeof (DWORD), &count );
if( FAILED( r ) )
return r;
/* make sure that we read the size of the structure even on error */
size = sizeof buffer - sizeof (DWORD);
- if( buffer.size != sizeof buffer )
+ if( buffer.dbh.cbSize != sizeof buffer )
{
ERR("Ooops. This structure is not as expected...\n");
return E_FAIL;
}
- r = IStream_Read( stm, &buffer.magic, size, &count );
+ r = IStream_Read( stm, &buffer.dbh.dwSignature, size, &count );
if( FAILED( r ) )
return r;
if( count != size )
return E_FAIL;
- TRACE("magic %08lx string = %s\n", buffer.magic, debugstr_w(buffer.bufW));
+ TRACE("magic %08lx string = %s\n", buffer.dbh.dwSignature, debugstr_w(buffer.szwDarwinID));
- if( (buffer.magic&0xffff0000) != 0xa0000000 )
+ if( (buffer.dbh.dwSignature&0xffff0000) != 0xa0000000 )
{
- ERR("Unknown magic number %08lx in advertised shortcut\n", buffer.magic);
+ ERR("Unknown magic number %08lx in advertised shortcut\n", buffer.dbh.dwSignature);
return E_FAIL;
}
*str = HeapAlloc( GetProcessHeap(), 0,
- (strlenW(buffer.bufW)+1) * sizeof(WCHAR) );
- strcpyW( *str, buffer.bufW );
+ (strlenW(buffer.szwDarwinID)+1) * sizeof(WCHAR) );
+ strcpyW( *str, buffer.szwDarwinID );
return S_OK;
}
* IPersistStream_Load (IPersistStream)
*/
static HRESULT WINAPI IPersistStream_fnLoad(
- IPersistStream* iface,
+ IPersistStream* iface,
IStream* stm)
{
LINK_HEADER hdr;
TRACE("%p %p\n", This, stm);
if( !stm )
- return STG_E_INVALIDPOINTER;
+ return STG_E_INVALIDPOINTER;
dwBytesRead = 0;
r = IStream_Read(stm, &hdr, sizeof(hdr), &dwBytesRead);
}
/* load all the new stuff */
- if( hdr.dwFlags & SCF_PIDL )
+ if( hdr.dwFlags & SLDF_HAS_ID_LIST )
{
r = ILLoadFromStream( stm, &This->pPidl );
if( FAILED( r ) )
pdump(This->pPidl);
/* load the location information */
- if( hdr.dwFlags & SCF_LOCATION )
+ if( hdr.dwFlags & SLDF_HAS_LINK_INFO )
r = Stream_LoadLocation( stm, &This->volume, &This->sPath );
if( FAILED( r ) )
goto end;
- unicode = hdr.dwFlags & SCF_UNICODE;
- if( hdr.dwFlags & SCF_DESCRIPTION )
+ unicode = hdr.dwFlags & SLDF_UNICODE;
+ if( hdr.dwFlags & SLDF_HAS_NAME )
{
r = Stream_LoadString( stm, unicode, &This->sDescription );
TRACE("Description -> %s\n",debugstr_w(This->sDescription));
if( FAILED( r ) )
goto end;
- if( hdr.dwFlags & SCF_RELATIVE )
+ if( hdr.dwFlags & SLDF_HAS_RELPATH )
{
r = Stream_LoadString( stm, unicode, &This->sPathRel );
TRACE("Relative Path-> %s\n",debugstr_w(This->sPathRel));
if( FAILED( r ) )
goto end;
- if( hdr.dwFlags & SCF_WORKDIR )
+ if( hdr.dwFlags & SLDF_HAS_WORKINGDIR )
{
r = Stream_LoadString( stm, unicode, &This->sWorkDir );
TRACE("Working Dir -> %s\n",debugstr_w(This->sWorkDir));
if( FAILED( r ) )
goto end;
- if( hdr.dwFlags & SCF_ARGS )
+ if( hdr.dwFlags & SLDF_HAS_ARGS )
{
r = Stream_LoadString( stm, unicode, &This->sArgs );
TRACE("Working Dir -> %s\n",debugstr_w(This->sArgs));
if( FAILED( r ) )
goto end;
- if( hdr.dwFlags & SCF_CUSTOMICON )
+ if( hdr.dwFlags & SLDF_HAS_ICONLOCATION )
{
r = Stream_LoadString( stm, unicode, &This->sIcoPath );
TRACE("Icon file -> %s\n",debugstr_w(This->sIcoPath));
if( FAILED( r ) )
goto end;
- if( hdr.dwFlags & SCF_PRODUCT )
+ if( hdr.dwFlags & SLDF_HAS_LOGO3ID )
{
r = Stream_LoadAdvertiseInfo( stm, &This->sProduct );
TRACE("Product -> %s\n",debugstr_w(This->sProduct));
if( FAILED( r ) )
goto end;
- if( hdr.dwFlags & SCF_COMPONENT )
+ if( hdr.dwFlags & SLDF_HAS_DARWINID )
{
r = Stream_LoadAdvertiseInfo( stm, &This->sComponent );
TRACE("Component -> %s\n",debugstr_w(This->sComponent));
static HRESULT Stream_WriteAdvertiseInfo( IStream* stm, LPCWSTR string, DWORD magic )
{
ULONG count;
- LINK_ADVERTISEINFO buffer;
+ EXP_DARWIN_LINK buffer;
TRACE("%p\n",stm);
memset( &buffer, 0, sizeof buffer );
- buffer.size = sizeof buffer;
- buffer.magic = magic;
- strncpyW( buffer.bufW, string, MAX_PATH );
- WideCharToMultiByte(CP_ACP, 0, string, -1, buffer.bufA, MAX_PATH, NULL, NULL );
+ buffer.dbh.cbSize = sizeof buffer;
+ buffer.dbh.dwSignature = magic;
+ lstrcpynW( buffer.szwDarwinID, string, MAX_PATH );
+ WideCharToMultiByte(CP_ACP, 0, string, -1, buffer.szDarwinID, MAX_PATH, NULL, NULL );
- return IStream_Write( stm, &buffer, buffer.size, &count );
+ return IStream_Write( stm, &buffer, buffer.dbh.cbSize, &count );
}
/************************************************************************
header.wHotKey = This->wHotKey;
header.nIcon = This->iIcoNdx;
- header.dwFlags = SCF_UNICODE; /* strings are in unicode */
+ header.dwFlags = SLDF_UNICODE; /* strings are in unicode */
if( This->pPidl )
- header.dwFlags |= SCF_PIDL;
+ header.dwFlags |= SLDF_HAS_ID_LIST;
if( This->sPath )
- header.dwFlags |= SCF_LOCATION;
+ header.dwFlags |= SLDF_HAS_LINK_INFO;
if( This->sDescription )
- header.dwFlags |= SCF_DESCRIPTION;
+ header.dwFlags |= SLDF_HAS_NAME;
if( This->sWorkDir )
- header.dwFlags |= SCF_WORKDIR;
+ header.dwFlags |= SLDF_HAS_WORKINGDIR;
if( This->sArgs )
- header.dwFlags |= SCF_ARGS;
+ header.dwFlags |= SLDF_HAS_ARGS;
if( This->sIcoPath )
- header.dwFlags |= SCF_CUSTOMICON;
+ header.dwFlags |= SLDF_HAS_ICONLOCATION;
if( This->sProduct )
- header.dwFlags |= SCF_PRODUCT;
+ header.dwFlags |= SLDF_HAS_LOGO3ID;
if( This->sComponent )
- header.dwFlags |= SCF_COMPONENT;
+ header.dwFlags |= SLDF_HAS_DARWINID;
SystemTimeToFileTime ( &This->time1, &header.Time1 );
SystemTimeToFileTime ( &This->time2, &header.Time2 );
r = Stream_WriteString( stm, This->sIcoPath );
if( This->sProduct )
- r = Stream_WriteAdvertiseInfo( stm, This->sProduct, 0xa0000007 );
+ r = Stream_WriteAdvertiseInfo( stm, This->sProduct, EXP_SZ_ICON_SIG );
if( This->sComponent )
- r = Stream_WriteAdvertiseInfo( stm, This->sComponent, 0xa0000006 );
+ r = Stream_WriteAdvertiseInfo( stm, This->sComponent, EXP_DARWIN_ID_SIG );
/* the last field is a single zero dword */
zero = 0;
/**************************************************************************
* IShellLink_Constructor
*/
-HRESULT WINAPI IShellLink_Constructor (
- IUnknown * pUnkOuter,
- REFIID riid,
- LPVOID * ppv)
+HRESULT WINAPI IShellLink_Constructor( IUnknown *pUnkOuter,
+ REFIID riid, LPVOID *ppv )
{
IShellLinkImpl * sl;
*ppv = NULL;
- if(pUnkOuter) return CLASS_E_NOAGGREGATION;
- sl = (IShellLinkImpl *) LocalAlloc(GMEM_ZEROINIT,sizeof(IShellLinkImpl));
- if (!sl) return E_OUTOFMEMORY;
+ if (pUnkOuter)
+ return CLASS_E_NOAGGREGATION;
+ sl = LocalAlloc(LMEM_ZEROINIT,sizeof(IShellLinkImpl));
+ if (!sl)
+ return E_OUTOFMEMORY;
sl->ref = 1;
sl->lpVtbl = &slvt;
/**************************************************************************
* IShellLink_ConstructFromFile
*/
-HRESULT WINAPI IShellLink_ConstructFromFile (
- IUnknown* pUnkOuter,
- REFIID riid,
- LPCITEMIDLIST pidl,
- LPVOID* ppv
-)
+HRESULT WINAPI IShellLink_ConstructFromFile( IUnknown* pUnkOuter, REFIID riid,
+ LPCITEMIDLIST pidl, LPVOID* ppv)
{
IShellLinkW* psl;
static HRESULT WINAPI IShellLinkA_fnResolve(IShellLinkA * iface, HWND hwnd, DWORD fFlags)
{
- HRESULT hr = S_OK;
-
IShellLinkImpl *This = (IShellLinkImpl *)iface;
TRACE("(%p)->(hwnd=%p flags=%lx)\n",This, hwnd, fFlags);
- /*FIXME: use IResolveShellLink interface */
-
- if (!This->sPath && This->pPidl) {
- WCHAR buffer[MAX_PATH];
-
- hr = SHELL_GetPathFromIDListW(This->pPidl, buffer, MAX_PATH);
-
- if (SUCCEEDED(hr) && *buffer) {
- This->sPath = (LPWSTR) HeapAlloc(GetProcessHeap(), 0, (lstrlenW(buffer)+1)*sizeof(WCHAR));
- if (!This->sPath)
- return E_OUTOFMEMORY;
-
- lstrcpyW(This->sPath, buffer);
-
- This->bDirty = TRUE;
- } else
- hr = S_OK; /* don't report an error occurred while just caching information */
- }
-
- if (!This->sIcoPath && This->sPath) {
- This->sIcoPath = (LPWSTR) HeapAlloc(GetProcessHeap(), 0, (lstrlenW(This->sPath)+1)*sizeof(WCHAR));
- if (!This->sIcoPath)
- return E_OUTOFMEMORY;
-
- lstrcpyW(This->sIcoPath, This->sPath);
- This->iIcoNdx = 0;
-
- This->bDirty = TRUE;
- }
-
- return hr;
+ return IShellLinkW_Resolve( (IShellLinkW*)&(This->lpvtblw), hwnd, fFlags );
}
static HRESULT WINAPI IShellLinkA_fnSetPath(IShellLinkA * iface, LPCSTR pszFile)
hr = SHELL_GetPathFromIDListW(This->pPidl, buffer, MAX_PATH);
if (SUCCEEDED(hr) && *buffer) {
- This->sPath = (LPWSTR) HeapAlloc(GetProcessHeap(), 0, (lstrlenW(buffer)+1)*sizeof(WCHAR));
+ This->sPath = HeapAlloc(GetProcessHeap(), 0, (lstrlenW(buffer)+1)*sizeof(WCHAR));
if (!This->sPath)
return E_OUTOFMEMORY;
}
if (!This->sIcoPath && This->sPath) {
- This->sIcoPath = (LPWSTR) HeapAlloc(GetProcessHeap(), 0, (lstrlenW(This->sPath)+1)*sizeof(WCHAR));
+ This->sIcoPath = HeapAlloc(GetProcessHeap(), 0, (lstrlenW(This->sPath)+1)*sizeof(WCHAR));
if (!This->sIcoPath)
return E_OUTOFMEMORY;
TRACE("WithoutCom=%u FromShell=%u\n", bLoadWithoutCOM, bLoadFromShell32);
- /* now we create a instance */
+ /* now we create an instance */
if (bLoadFromShell32) {
if (! SUCCEEDED(SHELL32_DllGetClassObject(myclsid, &IID_IClassFactory,(LPVOID*)&pcf))) {
ERR("LoadFromShell failed for CLSID=%s\n", shdebugstr_guid(myclsid));
}
} else if (bLoadWithoutCOM) {
- /* load a external dll without ole32 */
+ /* load an external dll without ole32 */
HANDLE hLibrary;
typedef HRESULT (CALLBACK *DllGetClassObjectFunc)(REFCLSID clsid, REFIID iid, LPVOID *ppv);
DllGetClassObjectFunc DllGetClassObject;
} else {
- /* load a external dll in the usual way */
+ /* load an external dll in the usual way */
hres = CoCreateInstance(myclsid, pUnkOuter, CLSCTX_INPROC_SERVER, refiid, ppv);
goto end;
}
}
/*************************************************************************
- * DllGetClassObject [SHELL32.128]
+ * DllGetClassObject [SHELL32.@]
*/
HRESULT WINAPI SHELL32_DllGetClassObject(REFCLSID rclsid, REFIID iid, LPVOID *ppv)
{
{
LPVOID addr;
- addr = (LPVOID) LocalAlloc(GMEM_ZEROINIT, cb);
+ addr = (LPVOID) LocalAlloc(LMEM_ZEROINIT, cb);
TRACE("(%p,%ld);\n",addr,cb);
return addr;
}
if (pv) {
if (cb) {
- addr = (LPVOID) LocalReAlloc((HANDLE) pv, cb, GMEM_ZEROINIT | GMEM_MOVEABLE);
+ addr = (LPVOID) LocalReAlloc((HANDLE) pv, cb, LMEM_ZEROINIT | LMEM_MOVEABLE);
} else {
LocalFree((HANDLE) pv);
addr = NULL;
}
} else {
if (cb) {
- addr = (LPVOID) LocalAlloc(GMEM_ZEROINIT, cb);
+ addr = (LPVOID) LocalAlloc(LMEM_ZEROINIT, cb);
} else {
addr = NULL;
}
* SHCreateDefClassObject
*
* NOTES
- * helper function for dll's without a own classfactory
- * a generic classfactory is returned
- * when the CreateInstance of the cf is called the callback is executed
+ * Helper function for dlls without their own classfactory.
+ * A generic classfactory is returned.
+ * When the CreateInstance of the cf is called the callback is executed.
*/
typedef struct
{
IDefClFImpl* lpclf;
- lpclf = (IDefClFImpl*)HeapAlloc(GetProcessHeap(),0,sizeof(IDefClFImpl));
+ lpclf = HeapAlloc(GetProcessHeap(),0,sizeof(IDefClFImpl));
lpclf->ref = 1;
lpclf->lpVtbl = &dclfvt;
lpclf->lpfnCI = lpfnCI;
}
/*************************************************************************
- * DragAcceptFiles [SHELL32.54]
+ * DragAcceptFiles [SHELL32.@]
*/
void WINAPI DragAcceptFiles(HWND hWnd, BOOL b)
{
}
/*************************************************************************
- * DragFinish [SHELL32.80]
+ * DragFinish [SHELL32.@]
*/
void WINAPI DragFinish(HDROP h)
{
}
/*************************************************************************
- * DragQueryPoint [SHELL32.135]
+ * DragQueryPoint [SHELL32.@]
*/
BOOL WINAPI DragQueryPoint(HDROP hDrop, POINT *p)
{
}
/*************************************************************************
- * DragQueryFile [SHELL32.81]
- * DragQueryFileA [SHELL32.82]
+ * DragQueryFile [SHELL32.@]
+ * DragQueryFileA [SHELL32.@]
*/
UINT WINAPI DragQueryFileA(
HDROP hDrop,
LPWSTR lpszFileW = NULL;
if(lpszFile) {
- lpszFileW = (LPWSTR) HeapAlloc(GetProcessHeap(), 0, lLength*sizeof(WCHAR));
+ lpszFileW = HeapAlloc(GetProcessHeap(), 0, lLength*sizeof(WCHAR));
if(lpszFileW == NULL) {
goto end;
}
}
/*************************************************************************
- * DragQueryFileW [SHELL32.133]
+ * DragQueryFileW [SHELL32.@]
*/
UINT WINAPI DragQueryFileW(
HDROP hDrop,
LPSTR lpszFileA = NULL;
if(lpszwFile) {
- lpszFileA = (LPSTR) HeapAlloc(GetProcessHeap(), 0, lLength);
+ lpszFileA = HeapAlloc(GetProcessHeap(), 0, lLength);
if(lpszFileA == NULL) {
goto end;
}
* mruhandle [IN] handle for created MRU list
* doc_name [IN] null termed pure doc name
* new_lnk_name [IN] null termed path and file name for .lnk file
- * buffer [IN/OUT] 2048 byte area to consturct MRU data
+ * buffer [IN/OUT] 2048 byte area to construct MRU data
* len [OUT] ptr to int to receive space used in buffer
*
* RETURNS
ret = E_INVALIDARG;
else
{
- LPVOID lpdata = 0;/*LocalAlloc(GMEM_ZEROINIT, 0x4E4);*/
+ LPVOID lpdata = 0;/*LocalAlloc(LMEM_ZEROINIT, 0x4E4);*/
if (!lpdata)
ret = E_OUTOFMEMORY;
if (!RegQueryValueExW(userShellFolderKey, value, NULL, &dwType,
(LPBYTE)path, &dwPathLen) && (dwType == REG_EXPAND_SZ || dwType == REG_SZ))
{
+ LONG ret;
+
path[dwPathLen / sizeof(WCHAR)] = '\0';
if (dwType == REG_EXPAND_SZ && path[0] == '%')
{
WCHAR szTemp[MAX_PATH];
_SHExpandEnvironmentStrings(path, szTemp);
- strncpyW(path, szTemp, MAX_PATH);
+ lstrcpynW(path, szTemp, MAX_PATH);
}
- RegSetValueExW(shellFolderKey, value, 0, REG_SZ, (LPBYTE)path,
+ ret = RegSetValueExW(shellFolderKey, value, 0, REG_SZ, (LPBYTE)path,
(strlenW(path) + 1) * sizeof(WCHAR));
- hr = S_OK;
+ if (ret != ERROR_SUCCESS)
+ hr = HRESULT_FROM_WIN32(ret);
+ else
+ hr = S_OK;
}
else
hr = E_FAIL;
}
else
{
- FIXME("(%d,%s), LoadString failed, missing translation?\n", folder, debugstr_w(pszPath));
+ FIXME("(%d,%s), LoadString failed, missing translation?\n", folder,
+ debugstr_w(pszPath));
hr = E_FAIL;
}
}
else
{
/* Missing or invalid value, set a default */
- strncpyW(szValue, szDefault, MAX_PATH);
- szValue[MAX_PATH - 1] = '\0';
+ lstrcpynW(szValue, szDefault, MAX_PATH);
TRACE("Setting missing value %s to %s\n", debugstr_w(szValueName),
- debugstr_w(szValue));
+ debugstr_w(szValue));
lRet = RegSetValueExW(profilesKey, szValueName, 0, REG_EXPAND_SZ,
- (LPBYTE)szValue, (strlenW(szValue) + 1) * sizeof(WCHAR));
+ (LPBYTE)szValue,
+ (strlenW(szValue) + 1) * sizeof(WCHAR));
if (lRet)
hr = HRESULT_FROM_WIN32(lRet);
else
}
/* For each folder in folders, if its value has not been set in the registry,
- * call _SHGetUserProfilePath or _SHGetAllUsersProfilePath (depending on the
+ * calls _SHGetUserProfilePath or _SHGetAllUsersProfilePath (depending on the
* folder's type) to get the unexpanded value first.
- * This will create the expanded value in the Shell Folders key, and
- * return the unexpanded value.
- * Write the unexpanded value to User Shell Folders, and query it with
- * SHGetFolderPath to force the creation of the directory if it doesn't
- * already exist.
+ * Writes the unexpanded value to User Shell Folders, and queries it with
+ * SHGetFolderPathW to force the creation of the directory if it doesn't
+ * already exist. SHGetFolderPathW also returns the expanded value, which
+ * this then writes to Shell Folders.
*/
static HRESULT _SHRegisterFolders(HKEY hRootKey, HANDLE hToken,
- LPCWSTR szUserShellFolderPath, const UINT folders[], UINT foldersLen)
+ LPCWSTR szUserShellFolderPath, LPCWSTR szShellFolderPath, const UINT folders[],
+ UINT foldersLen)
{
UINT i;
WCHAR path[MAX_PATH];
HRESULT hr = S_OK;
- HKEY hKey = NULL;
+ HKEY hUserKey = NULL, hKey = NULL;
DWORD dwDisp, dwType, dwPathLen;
LONG ret;
debugstr_w(szUserShellFolderPath), folders, foldersLen);
ret = RegCreateKeyExW(hRootKey, szUserShellFolderPath, 0, NULL, 0,
- KEY_ALL_ACCESS, NULL, &hKey, &dwDisp);
+ KEY_ALL_ACCESS, NULL, &hUserKey, &dwDisp);
if (ret)
hr = HRESULT_FROM_WIN32(ret);
+ else
+ {
+ ret = RegCreateKeyExW(hRootKey, szShellFolderPath, 0, NULL, 0,
+ KEY_ALL_ACCESS, NULL, &hKey, &dwDisp);
+ if (ret)
+ hr = HRESULT_FROM_WIN32(ret);
+ }
for (i = 0; SUCCEEDED(hr) && i < foldersLen; i++)
{
dwPathLen = MAX_PATH * sizeof(WCHAR);
- if (RegQueryValueExW(hKey, CSIDL_Data[folders[i]].szValueName, NULL,
+ if (RegQueryValueExW(hUserKey, CSIDL_Data[folders[i]].szValueName, NULL,
&dwType, (LPBYTE)path, &dwPathLen) || (dwType != REG_SZ &&
dwType != REG_EXPAND_SZ))
{
hr = E_FAIL;
if (*path)
{
- ret = RegSetValueExW(hKey, CSIDL_Data[folders[i]].szValueName,
- 0, REG_EXPAND_SZ, (LPBYTE)path,
- (strlenW(path) + 1) * sizeof(WCHAR));
+ ret = RegSetValueExW(hUserKey,
+ CSIDL_Data[folders[i]].szValueName, 0, REG_EXPAND_SZ,
+ (LPBYTE)path, (strlenW(path) + 1) * sizeof(WCHAR));
if (ret)
hr = HRESULT_FROM_WIN32(ret);
else
+ {
hr = SHGetFolderPathW(NULL, folders[i] | CSIDL_FLAG_CREATE,
- hToken, SHGFP_TYPE_DEFAULT, NULL);
+ hToken, SHGFP_TYPE_DEFAULT, path);
+ ret = RegSetValueExW(hKey,
+ CSIDL_Data[folders[i]].szValueName, 0, REG_SZ,
+ (LPBYTE)path, (strlenW(path) + 1) * sizeof(WCHAR));
+ if (ret)
+ hr = HRESULT_FROM_WIN32(ret);
+ }
}
}
}
+ if (hUserKey)
+ RegCloseKey(hUserKey);
if (hKey)
RegCloseKey(hKey);
CSIDL_COOKIES,
CSIDL_HISTORY,
};
- WCHAR userShellFolderPath[MAX_PATH];
- LPCWSTR pUserShellFolderPath;
+ WCHAR userShellFolderPath[MAX_PATH], shellFolderPath[MAX_PATH];
+ LPCWSTR pUserShellFolderPath, pShellFolderPath;
HRESULT hr = S_OK;
HKEY hRootKey;
HANDLE hToken;
PathAddBackslashW(userShellFolderPath);
strcatW(userShellFolderPath, szSHUserFolders);
pUserShellFolderPath = userShellFolderPath;
+ strcpyW(shellFolderPath, DefaultW);
+ PathAddBackslashW(shellFolderPath);
+ strcatW(shellFolderPath, szSHFolders);
+ pShellFolderPath = shellFolderPath;
}
else
{
hToken = NULL;
hRootKey = HKEY_CURRENT_USER;
pUserShellFolderPath = szSHUserFolders;
+ pShellFolderPath = szSHFolders;
}
hr = _SHRegisterFolders(hRootKey, hToken, pUserShellFolderPath,
- folders, sizeof(folders) / sizeof(folders[0]));
+ pShellFolderPath, folders, sizeof(folders) / sizeof(folders[0]));
TRACE("returning 0x%08lx\n", hr);
return hr;
}
TRACE("\n");
hr = _SHRegisterFolders(HKEY_LOCAL_MACHINE, NULL, szSHUserFolders,
- folders, sizeof(folders) / sizeof(folders[0]));
+ szSHFolders, folders, sizeof(folders) / sizeof(folders[0]));
TRACE("returning 0x%08lx\n", hr);
return hr;
}
CLSID *pclsid;
/* both paths are parsible from the desktop */
- LPSTR sPathTarget; /* complete path to target used for enumeration and ChangeNotify */
- LPITEMIDLIST pidlRoot; /* absolute pidl */
+ LPWSTR sPathTarget; /* complete path to target used for enumeration and ChangeNotify */
+ LPITEMIDLIST pidlRoot; /* absolute pidl */
int dwAttributes; /* attributes returned by GetAttributesOf FIXME: use it */
#define _IUnknown_(This) (IShellFolder*)&(This->lpVtbl)
#define _IShellFolder_(This) (IShellFolder*)&(This->lpVtbl)
-static struct IShellFolder2Vtbl vt_MCFldr_ShellFolder2;
-
static shvheader DesktopSFHeader[] = {
{IDS_SHV_COLUMN1, SHCOLSTATE_TYPE_STR | SHCOLSTATE_ONBYDEFAULT, LVCFMT_RIGHT, 15},
{IDS_SHV_COLUMN2, SHCOLSTATE_TYPE_STR | SHCOLSTATE_ONBYDEFAULT, LVCFMT_RIGHT, 10},
#define DESKTOPSHELLVIEWCOLUMNS 5
-/**************************************************************************
- * ISF_Desktop_Constructor
- */
-HRESULT WINAPI ISF_Desktop_Constructor (
- IUnknown * pUnkOuter, REFIID riid, LPVOID * ppv)
-{
- IGenericSFImpl *sf;
- char szMyPath[MAX_PATH];
-
- TRACE ("unkOut=%p %s\n", pUnkOuter, shdebugstr_guid (riid));
-
- if (!ppv)
- return E_POINTER;
- if (pUnkOuter)
- return CLASS_E_NOAGGREGATION;
-
- if (!SHGetSpecialFolderPathA (0, szMyPath, CSIDL_DESKTOPDIRECTORY, TRUE))
- return E_UNEXPECTED;
-
- sf = (IGenericSFImpl *) LocalAlloc (GMEM_ZEROINIT, sizeof (IGenericSFImpl));
- if (!sf)
- return E_OUTOFMEMORY;
-
- sf->ref = 0;
- sf->lpVtbl = &vt_MCFldr_ShellFolder2;
- sf->pidlRoot = _ILCreateDesktop (); /* my qualified pidl */
- sf->sPathTarget = SHAlloc (strlen (szMyPath) + 1);
- lstrcpyA (sf->sPathTarget, szMyPath);
-
- if (!SUCCEEDED (IUnknown_QueryInterface (_IUnknown_ (sf), riid, ppv)))
- {
- IUnknown_Release (_IUnknown_ (sf));
- return E_NOINTERFACE;
- }
-
- TRACE ("--(%p)\n", sf);
- return S_OK;
-}
-
/**************************************************************************
* ISF_Desktop_fnQueryInterface
*
LPWSTR pathPtr;
/* build a complete path to create a simple pidl */
- MultiByteToWideChar(CP_ACP, 0, This->sPathTarget, -1, szPath,
- sizeof(szPath) / sizeof(szPath[0]));
+ lstrcpynW(szPath, This->sPathTarget, MAX_PATH);
pathPtr = PathAddBackslashW(szPath);
if (pathPtr)
{
- lstrcpynW(pathPtr, lpszDisplayName,
- sizeof(szPath)/sizeof(szPath[0]) - (pathPtr - szPath));
+ lstrcpynW(pathPtr, lpszDisplayName, MAX_PATH - (pathPtr - szPath));
hr = _ILCreateFromPathW(szPath, &pidlTemp);
}
else
LPCITEMIDLIST pidl, LPBC pbcReserved, REFIID riid, LPVOID * ppvOut)
{
IGenericSFImpl *This = (IGenericSFImpl *)iface;
+ char szPath[MAX_PATH];
TRACE ("(%p)->(pidl=%p,%p,%s,%p)\n",
This, pidl, pbcReserved, shdebugstr_guid (riid), ppvOut);
- return SHELL32_BindToChild (This->pidlRoot, This->sPathTarget, pidl, riid, ppvOut);
+ WideCharToMultiByte( CP_ACP, 0, This->sPathTarget, -1,
+ szPath, MAX_PATH, NULL, NULL );
+ return SHELL32_BindToChild( This->pidlRoot, szPath, pidl, riid, ppvOut );
}
/**************************************************************************
if (!ppvOut)
return hr;
- if (IsEqualIID (riid, &IID_IDataObject) && (cidl >= 1))
- {
- pObj = (LPUNKNOWN) IDataObject_Constructor( hwndOwner,
- This->pidlRoot, apidl, cidl);
- hr = S_OK;
- }
- else if ((IsEqualIID(riid,&IID_IShellLinkW) ||
- IsEqualIID(riid,&IID_IShellLinkA)) && (cidl == 1))
- {
- pidl = ILCombine (This->pidlRoot, apidl[0]);
- hr = IShellLink_ConstructFromFile(NULL, riid, pidl, (LPVOID*)&pObj);
- SHFree (pidl);
- }
- else if (IsEqualIID (riid, &IID_IContextMenu))
+ *ppvOut = NULL;
+
+ if (IsEqualIID (riid, &IID_IContextMenu))
{
if (cidl > 0)
pObj = (LPUNKNOWN) ISvItemCm_Constructor( (IShellFolder *) iface, This->pidlRoot, apidl, cidl);
pObj = (LPUNKNOWN) ISvBgCm_Constructor( (IShellFolder *) iface, TRUE);
hr = S_OK;
}
+ else if (IsEqualIID (riid, &IID_IDataObject) && (cidl >= 1))
+ {
+ pObj = (LPUNKNOWN) IDataObject_Constructor( hwndOwner,
+ This->pidlRoot, apidl, cidl);
+ hr = S_OK;
+ }
else if (IsEqualIID (riid, &IID_IExtractIconA) && (cidl == 1))
{
pidl = ILCombine (This->pidlRoot, apidl[0]);
hr = IShellFolder_QueryInterface (iface,
&IID_IDropTarget, (LPVOID *) & pObj);
}
+ else if ((IsEqualIID(riid,&IID_IShellLinkW) ||
+ IsEqualIID(riid,&IID_IShellLinkA)) && (cidl == 1))
+ {
+ pidl = ILCombine (This->pidlRoot, apidl[0]);
+ hr = IShellLink_ConstructFromFile(NULL, riid, pidl, (LPVOID*)&pObj);
+ SHFree (pidl);
+ }
else
hr = E_NOINTERFACE;
LPCITEMIDLIST pidl, DWORD dwFlags, LPSTRRET strRet)
{
IGenericSFImpl *This = (IGenericSFImpl *)iface;
- CHAR szPath[MAX_PATH];
- GUID const *clsid;
HRESULT hr = S_OK;
- *szPath = '\0';
-
TRACE ("(%p)->(pidl=%p,0x%08lx,%p)\n", This, pidl, dwFlags, strRet);
pdump (pidl);
if (!strRet)
return E_INVALIDARG;
+ strRet->uType = STRRET_CSTR;
if (_ILIsDesktop (pidl))
{
if ((GET_SHGDN_RELATION (dwFlags) == SHGDN_NORMAL) &&
(GET_SHGDN_FOR (dwFlags) == SHGDN_FORPARSING))
{
- lstrcpyA (szPath, This->sPathTarget);
+ BOOL defCharUsed;
+
+ WideCharToMultiByte( CP_ACP, 0, This->sPathTarget, -1,
+ strRet->u.cStr, MAX_PATH, NULL, &defCharUsed );
+ if (defCharUsed)
+ {
+ strRet->u.pOleStr = SHAlloc((lstrlenW(This->sPathTarget)+1) *
+ sizeof(WCHAR));
+ if (!strRet->u.pOleStr)
+ hr = E_OUTOFMEMORY;
+ else
+ {
+ strcpyW(strRet->u.pOleStr, This->sPathTarget);
+ strRet->uType = STRRET_WSTR;
+ }
+ }
}
else
- HCR_GetClassNameA(&CLSID_ShellDesktop, szPath, MAX_PATH);
+ {
+ HCR_GetClassNameA(&CLSID_ShellDesktop, strRet->u.cStr, MAX_PATH);
+ }
}
else if (_ILIsPidlSimple (pidl))
{
+ GUID const *clsid;
+
if ((clsid = _ILGetGUIDPointer (pidl)))
{
if (GET_SHGDN_FOR (dwFlags) == SHGDN_FORPARSING)
*/
if (IsEqualIID (clsid, &CLSID_MyComputer))
{
- bWantsForParsing = 1;
+ bWantsForParsing = TRUE;
}
else
{
* Only the folder itself can know it
*/
hr = SHELL32_GetDisplayNameOfChild (iface, pidl, dwFlags,
- szPath, MAX_PATH);
+ strRet->u.cStr,
+ MAX_PATH);
}
else
{
/* parsing name like ::{...} */
- lstrcpyA (szPath, "::");
- SHELL32_GUIDToStringA (clsid, &szPath[2]);
+ lstrcpyA (strRet->u.cStr, "::");
+ SHELL32_GUIDToStringA (clsid, &strRet->u.cStr[2]);
}
}
else
{
/* user friendly name */
- HCR_GetClassNameA (clsid, szPath, MAX_PATH);
+ HCR_GetClassNameA (clsid, strRet->u.cStr, MAX_PATH);
}
}
else
{
/* file system folder */
- _ILSimpleGetText (pidl, szPath, MAX_PATH);
+ _ILSimpleGetText (pidl, strRet->u.cStr, MAX_PATH);
if (!_ILIsFolder(pidl))
- SHELL_FS_ProcessDisplayFilename(szPath, dwFlags);
+ SHELL_FS_ProcessDisplayFilename(strRet->u.cStr, dwFlags);
}
}
else
{
/* a complex pidl, let the subfolder do the work */
- hr = SHELL32_GetDisplayNameOfChild (iface, pidl, dwFlags, szPath, MAX_PATH);
+ hr = SHELL32_GetDisplayNameOfChild (iface, pidl, dwFlags,
+ strRet->u.cStr, MAX_PATH);
}
- if (SUCCEEDED (hr))
- {
- strRet->uType = STRRET_CSTR;
- lstrcpynA (strRet->u.cStr, szPath, MAX_PATH);
- }
-
- TRACE ("-- (%p)->(%s,0x%08lx)\n", This, szPath, hr);
+ TRACE ("-- (%p)->(%s,0x%08lx)\n", This,
+ strRet->uType == STRRET_CSTR ? strRet->u.cStr :
+ debugstr_w(strRet->u.pOleStr), hr);
return hr;
}
{
IGenericSFImpl *This = (IGenericSFImpl *)iface;
- HRESULT hr = E_FAIL;
+ HRESULT hr = S_OK;
TRACE ("(%p)->(%p %i %p)\n", This, pidl, iColumn, psd);
}
/* the data from the pidl */
+ psd->str.uType = STRRET_CSTR;
switch (iColumn)
{
case 0: /* name */
_ILGetFileAttributes (pidl, psd->str.u.cStr, MAX_PATH);
break;
}
- hr = S_OK;
- psd->str.uType = STRRET_CSTR;
return hr;
}
ISF_Desktop_fnGetDetailsOf,
ISF_Desktop_fnMapColumnToSCID
};
+
+/**************************************************************************
+ * ISF_Desktop_Constructor
+ */
+HRESULT WINAPI ISF_Desktop_Constructor (
+ IUnknown * pUnkOuter, REFIID riid, LPVOID * ppv)
+{
+ IGenericSFImpl *sf;
+ WCHAR szMyPath[MAX_PATH];
+ HRESULT r;
+
+ TRACE ("unkOut=%p %s\n", pUnkOuter, shdebugstr_guid (riid));
+
+ if (!ppv)
+ return E_POINTER;
+ if (pUnkOuter)
+ return CLASS_E_NOAGGREGATION;
+
+ if (!SHGetSpecialFolderPathW( 0, szMyPath, CSIDL_DESKTOPDIRECTORY, TRUE ))
+ return E_UNEXPECTED;
+
+ sf = LocalAlloc( LMEM_ZEROINIT, sizeof (IGenericSFImpl) );
+ if (!sf)
+ return E_OUTOFMEMORY;
+
+ sf->ref = 0;
+ sf->lpVtbl = &vt_MCFldr_ShellFolder2;
+ sf->pidlRoot = _ILCreateDesktop(); /* my qualified pidl */
+ sf->sPathTarget = SHAlloc( (lstrlenW(szMyPath) + 1)*sizeof(WCHAR) );
+ lstrcpyW( sf->sPathTarget, szMyPath );
+
+ r = IUnknown_QueryInterface( _IUnknown_(sf), riid, ppv );
+ if (!SUCCEEDED (r))
+ {
+ IUnknown_Release( _IUnknown_(sf) );
+ return r;
+ }
+
+ TRACE ("--(%p)\n", sf);
+ return S_OK;
+}
#define _ICOM_THIS_From_ISFHelper(class, name) class* This = (class*)(((char*)name)-_ISFHelper_Offset);
/*
- converts This to a interface pointer
+ converts This to an interface pointer
*/
#define _IUnknown_(This) (IUnknown*)&(This->lpVtbl)
#define _IShellFolder_(This) (IShellFolder*)&(This->lpvtblShellFolder)
if (pUnkOuter && !IsEqualIID (riid, &IID_IUnknown))
return CLASS_E_NOAGGREGATION;
- sf = (IGenericSFImpl *) LocalAlloc (GMEM_ZEROINIT, sizeof (IGenericSFImpl));
+ sf = (IGenericSFImpl *) LocalAlloc (LMEM_ZEROINIT, sizeof (IGenericSFImpl));
if (!sf)
return E_OUTOFMEMORY;
static const WCHAR NeverShowExtW[] = { 'N','e','v','e','r','S','h','o','w','E',
'x','t',0 };
-void SHELL_FS_ProcessDisplayFilename(LPSTR szPath, DWORD dwFlags)
+static BOOL hide_extension(LPWSTR szPath)
{
- /*FIXME: MSDN also mentions SHGDN_FOREDITING which is not yet handled. */
- if (!(dwFlags & SHGDN_FORPARSING) &&
- ((dwFlags & SHGDN_INFOLDER) || (dwFlags == SHGDN_NORMAL))) {
- HKEY hKey;
- DWORD dwData;
- DWORD dwDataSize = sizeof (DWORD);
- BOOL doHide = FALSE; /* The default value is FALSE (win98 at least) */
-
- if (!RegCreateKeyExW (HKEY_CURRENT_USER, AdvancedW,
- 0, 0, 0, KEY_ALL_ACCESS, 0, &hKey, 0)) {
- if (!RegQueryValueExW (hKey, HideFileExtW, 0, 0, (LPBYTE) &dwData,
- &dwDataSize))
- doHide = dwData;
-
- RegCloseKey (hKey);
- }
-
- if (!doHide) {
- LPSTR ext = PathFindExtensionA(szPath);
+ HKEY hKey;
+ DWORD dwData;
+ DWORD dwDataSize = sizeof (DWORD);
+ BOOL doHide = FALSE; /* The default value is FALSE (win98 at least) */
+
+ if (!RegCreateKeyExW(HKEY_CURRENT_USER, AdvancedW, 0, 0, 0, KEY_ALL_ACCESS, 0, &hKey, 0)) {
+ if (!RegQueryValueExW(hKey, HideFileExtW, 0, 0, (LPBYTE) &dwData, &dwDataSize))
+ doHide = dwData;
+ RegCloseKey (hKey);
+ }
- if (ext) {
- char classname[MAX_PATH];
- LONG classlen = MAX_PATH;
+ if (!doHide) {
+ LPWSTR ext = PathFindExtensionW(szPath);
- if (!RegQueryValueA(HKEY_CLASSES_ROOT, ext, classname,
- &classlen))
- if (!RegOpenKeyA(HKEY_CLASSES_ROOT, classname, &hKey)) {
- if (!RegQueryValueExW(hKey, NeverShowExtW, 0, NULL,
- NULL, NULL))
- doHide = TRUE;
+ if (*ext != '\0') {
+ WCHAR classname[MAX_PATH];
+ LONG classlen = sizeof(classname);
- RegCloseKey(hKey);
- }
- }
+ if (!RegQueryValueW(HKEY_CLASSES_ROOT, ext, classname, &classlen))
+ if (!RegOpenKeyW(HKEY_CLASSES_ROOT, classname, &hKey)) {
+ if (!RegQueryValueExW(hKey, NeverShowExtW, 0, NULL, NULL, NULL))
+ doHide = TRUE;
+ RegCloseKey(hKey);
+ }
}
+ }
+ return doHide;
+}
+
+void SHELL_FS_ProcessDisplayFilename(LPSTR szPath, DWORD dwFlags)
+{
+ WCHAR pathW[MAX_PATH];
- if (doHide && szPath[0] != '.')
+ /*FIXME: MSDN also mentions SHGDN_FOREDITING which is not yet handled. */
+ if (!(dwFlags & SHGDN_FORPARSING) &&
+ ((dwFlags & SHGDN_INFOLDER) || (dwFlags == SHGDN_NORMAL))) {
+ MultiByteToWideChar(CP_ACP, 0, szPath, -1, pathW, MAX_PATH);
+ if (hide_extension(pathW) && szPath[0] != '.')
PathRemoveExtensionA (szPath);
}
}
debugstr_w (lpName), dwFlags, pPidlOut);
/* build source path */
- if (dwFlags & SHGDN_INFOLDER) {
- MultiByteToWideChar(CP_ACP, 0, This->sPathTarget, -1, szSrc, MAX_PATH);
- ptr = PathAddBackslashW (szSrc);
- if (ptr)
- _ILSimpleGetTextW (pidl, ptr, MAX_PATH - (ptr - szSrc));
- } else {
- /* FIXME: Can this work with a simple PIDL? */
- SHGetPathFromIDListW (pidl, szSrc);
- }
+ MultiByteToWideChar(CP_ACP, 0, This->sPathTarget, -1, szSrc, MAX_PATH);
+ ptr = PathAddBackslashW (szSrc);
+ if (ptr)
+ _ILSimpleGetTextW (pidl, ptr, MAX_PATH - (ptr - szSrc));
/* build destination path */
- MultiByteToWideChar(CP_ACP, 0, This->sPathTarget, -1, szDest, MAX_PATH);
- ptr = PathAddBackslashW (szDest);
- if (ptr)
- lstrcpynW(ptr, lpName, MAX_PATH - (ptr - szDest));
+ if (dwFlags == SHGDN_NORMAL || dwFlags & SHGDN_INFOLDER) {
+ MultiByteToWideChar(CP_ACP, 0, This->sPathTarget, -1, szDest, MAX_PATH);
+ ptr = PathAddBackslashW (szDest);
+ if (ptr)
+ lstrcpynW(ptr, lpName, MAX_PATH - (ptr - szDest));
+ } else
+ lstrcpynW(szDest, lpName, MAX_PATH);
+
+ if(!(dwFlags & SHGDN_FORPARSING) && hide_extension(szSrc)) {
+ WCHAR *ext = PathFindExtensionW(szSrc);
+ if(*ext != '\0') {
+ INT len = strlenW(szDest);
+ lstrcpynW(szDest + len, ext, MAX_PATH - len);
+ }
+ }
+
TRACE ("src=%s dest=%s\n", debugstr_w(szSrc), debugstr_w(szDest));
+
if (MoveFileW (szSrc, szDest)) {
HRESULT hr = S_OK;
#define _ICOM_THIS_From_IPersistFolder2(class, name) class* This = (class*)(((char*)name)-_IPersistFolder2_Offset);
/*
- converts This to a interface pointer
+ converts This to an interface pointer
*/
#define _IUnknown_(This) (IUnknown*)&(This->lpVtbl)
#define _IShellFolder_(This) (IShellFolder*)&(This->lpVtbl)
if (pUnkOuter)
return CLASS_E_NOAGGREGATION;
- sf = LocalAlloc (GMEM_ZEROINIT, sizeof (IGenericSFImpl));
+ sf = LocalAlloc (LMEM_ZEROINIT, sizeof (IGenericSFImpl));
if (!sf)
return E_OUTOFMEMORY;
default:
/*
- * Check if this is a env-variable here...
+ * Check if this is an env-variable here...
*/
/* Make sure that we have at least one more %.*/
*tmpB++ = *fmt++;
*tmpB++ = 0;
- TRACE("Checking %s to be a env-var\n", debugstr_w(tmpBuffer));
+ TRACE("Checking %s to be an env-var\n", debugstr_w(tmpBuffer));
envRet = GetEnvironmentVariableW(tmpBuffer, tmpEnvBuff, MAX_PATH);
if (envRet == 0 || envRet > MAX_PATH)
LPWSTR beg = wszApplicationName/*sei_tmp.lpFile*/;
for(s=beg; (space=strchrW(s, ' ')); s=space+1) {
int idx = space-sei_tmp.lpFile;
- strncpyW(buffer, sei_tmp.lpFile, idx);
+ memcpy(buffer, sei_tmp.lpFile, idx * sizeof(WCHAR));
buffer[idx] = '\0';
/*FIXME This finds directory paths if the targeted file name contains spaces. */
TRACE("Got URL: %s\n", debugstr_w(lpFile));
/* Looking for ...protocol\shell\lpOperation\command */
- strncpyW(lpstrProtocol, lpFile, iSize);
+ memcpy(lpstrProtocol, lpFile, iSize*sizeof(WCHAR));
lpstrProtocol[iSize] = '\0';
strcatW(lpstrProtocol, wShell);
strcatW(lpstrProtocol, sei_tmp.lpVerb? sei_tmp.lpVerb: wszOpen);
sei->hInstApp = seiW.hInstApp;
+ if (sei->fMask & SEE_MASK_NOCLOSEPROCESS)
+ sei->hProcess = seiW.hProcess;
+
if (wVerb) SHFree(wVerb);
if (wFile) SHFree(wFile);
if (wParameters) SHFree(wParameters);
lstrcpyW(&pTo[i_len+1], pCatStr);
}
pToFile = StrRChrW(pTo,NULL,'\\');
+ if (!pToFile)
+ pToFile = pTo;
/* termination of the new string-group */
pTo[(lstrlenW(pTo)) + 1] = '\0';
}
if (OFl)
{
if (OFl & (~(FOF_CONFIRMMOUSE | FOF_SILENT | FOF_RENAMEONCOLLISION |
- FOF_NOCONFIRMMKDIR | FOF_NOERRORUI | FOF_NOCOPYSECURITYATTRIBS)))
+ FOF_NOCONFIRMMKDIR | FOF_NOERRORUI | FOF_NOCOPYSECURITYATTRIBS | FOF_ALLOWUNDO)))
{
- TRACE("%s level=%ld lpFileOp->fFlags=0x%x not implemented, Aborted=TRUE, stub\n",
+ FIXME("%s level=%ld lpFileOp->fFlags=0x%x not implemented, Aborted=TRUE, stub\n",
debug_shfileops_action(FuncSwitch), level, OFl);
return 0x403; /* 1027, we need an extension to shlfileop */
}
-
/*
* Shell Folder stuff
*
WINE_DEFAULT_DEBUG_CHANNEL (shell);
-/***************************************************************************
- * debughelper: print out the return address
- * helps especially to track down unbalanced AddRef/Release
- */
-#define MEM_DEBUG 0
-
-#if MEM_DEBUG
-#define _CALL_TRACE TRACE("called from: 0x%08x\n", *( ((UINT*)&iface)-1 ));
-#else
-#define _CALL_TRACE
-#endif
-
-static const WCHAR wszDotShellClassInfo[] = {'.','S','h','e','l','l','C','l','a','s','s','I','n','f','o',0};
+static const WCHAR wszDotShellClassInfo[] = {
+ '.','S','h','e','l','l','C','l','a','s','s','I','n','f','o',0};
/***************************************************************************
* SHELL32_GetCustomFolderAttribute (internal function)
LPCITEMIDLIST pidl, LPCWSTR pwszHeading, LPCWSTR pwszAttribute,
LPWSTR pwszValue, DWORD cchValue)
{
-#if 0 /* Hack around not having system attribute on non-Windows file systems */
- DWORD dwAttrib = _ILGetFileAttributes(pidl, NULL, 0);
-#else
+ static const WCHAR wszDesktopIni[] =
+ {'d','e','s','k','t','o','p','.','i','n','i',0};
+ static const WCHAR wszDefault[] = {0};
DWORD dwAttrib = FILE_ATTRIBUTE_SYSTEM;
-#endif
+
+ /* Hack around not having system attribute on non-Windows file systems */
+ if (0)
+ dwAttrib = _ILGetFileAttributes(pidl, NULL, 0);
+
if (dwAttrib & FILE_ATTRIBUTE_SYSTEM)
{
DWORD ret;
WCHAR wszDesktopIniPath[MAX_PATH];
- static const WCHAR wszDesktopIni[] =
- {'d','e','s','k','t','o','p','.','i','n','i',0};
- static const WCHAR wszDefault[] =
- {0};
+
if (!SHGetPathFromIDListW(pidl, wszDesktopIniPath))
return FALSE;
PathAppendW(wszDesktopIniPath, wszDesktopIni);
ret = GetPrivateProfileStringW(pwszHeading, pwszAttribute,
wszDefault, pwszValue, cchValue, wszDesktopIniPath);
- if (!ret) return FALSE;
- return TRUE;
+ return ret;
}
return FALSE;
}
* - asks it for the displayname of [subpidl2][subpidl3]
*
* Is possible the pidl is a simple pidl. In this case it asks the
- * subfolder for the displayname of a empty pidl. The subfolder
+ * subfolder for the displayname of an empty pidl. The subfolder
* returns the own displayname eg. "::{guid}". This is used for
* virtual folders with the registry key WantsFORPARSING set.
*/
}
} else if (_ILGetDataPointer (pidl)) {
dwAttributes = _ILGetFileAttributes (pidl, NULL, 0);
- *pdwAttributes &= ~SFGAO_FILESYSANCESTOR;
+
+ if ((SFGAO_FILESYSANCESTOR & *pdwAttributes) && !(dwAttributes & FILE_ATTRIBUTE_DIRECTORY))
+ *pdwAttributes &= ~SFGAO_FILESYSANCESTOR;
if ((SFGAO_FOLDER & *pdwAttributes) && !(dwAttributes & FILE_ATTRIBUTE_DIRECTORY))
*pdwAttributes &= ~(SFGAO_FOLDER | SFGAO_HASSUBFOLDER);
MENUINFO MenuInfo;
HMENU hMenuPopup = CreatePopupMenu();
- lpFmMi = (LPFMINFO) HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(FMINFO));
+ lpFmMi = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(FMINFO));
lpFmMi->pidl = ILCombine(pidl, pidlTemp);
lpFmMi->uEnumFlags = SHCONTF_FOLDERS | SHCONTF_NONFOLDERS;
TRACE("0x%08lx 0x%08x %p 0x%08x 0x%08x hMenu=%p\n",
crBorderColor, nBorderWidth, hBorderBmp, nSelHeight, uFlags, hMenu);
- menudata = (LPFMINFO)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(FMINFO));
+ menudata = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(FMINFO));
menudata->crBorderColor = crBorderColor;
menudata->nBorderWidth = nBorderWidth;
menudata->hBorderBmp = hBorderBmp;
* FileMenu_InitMenuPopup [SHELL32.109]
*
* NOTES
- * The filemenu is a ownerdrawn menu. Call this function responding to
+ * The filemenu is an ownerdrawn menu. Call this function responding to
* WM_INITPOPUPMENU
*
*/
*/
IShellView * IShellView_Constructor( IShellFolder * pFolder)
{ IShellViewImpl * sv;
- sv=(IShellViewImpl*)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IShellViewImpl));
+ sv=HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IShellViewImpl));
sv->ref=1;
sv->lpVtbl=&svvt;
sv->lpvtblOleCommandTarget=&ctvt;
{
TRACE("ICommDlgBrowser::OnDefaultCommand\n");
ret = ICommDlgBrowser_OnDefaultCommand(This->pCommDlgBrowser, (IShellView*)This);
- TRACE("--\n");
+ TRACE("-- returns %08lx\n", ret);
}
return ret;
}
if (uCommand==FCIDM_SHVIEW_OPEN && IsInCommDlg(This))
{
TRACE("-- dlg: OnDefaultCommand\n");
- if (FAILED(OnDefaultCommand(This)))
+ if (OnDefaultCommand(This) != S_OK)
{
ShellView_OpenSelectedItems(This);
}
END
/* BINRES document.ico */
-1 ICON document.ico
+IDI_SHELL_DOCUMENT ICON document.ico
/* {
'00 00 01 00 0C 00 10 10 10 00 01 00 04 00 28 01'
'00 00 C6 00 00 00 10 10 00 00 01 00 08 00 68 05'
/* BINRES folder.ico */
-3 ICON folder.ico
+IDI_SHELL_FOLDER ICON folder.ico
/* {
'00 00 01 00 0C 00 10 10 10 00 01 00 04 00 28 01'
'00 00 C6 00 00 00 10 10 00 00 01 00 08 00 68 05'
/* BINRES folder_open.ico */
-4 ICON folder_open.ico
+IDI_SHELL_FOLDER_OPEN ICON folder_open.ico
/*{
'00 00 01 00 0B 00 10 10 10 00 01 00 04 00 28 01'
'00 00 B6 00 00 00 10 10 00 00 01 00 08 00 68 05'
/* BINRES floppy.ico */
-5 ICON floppy.ico
+IDI_SHELL_FLOPPY ICON floppy.ico
/* {
'00 00 01 00 09 00 20 20 00 00 01 00 08 00 A8 08'
'00 00 96 00 00 00 10 10 00 00 01 00 08 00 68 05'
/* BINRES drive.ico */
-8 ICON drive.ico
+IDI_SHELL_DRIVE ICON drive.ico
/* {
'00 00 01 00 0C 00 10 10 10 00 01 00 04 00 28 01'
'00 00 C6 00 00 00 10 10 00 00 01 00 08 00 68 05'
} */
/* BINRES netdrive.ico */
-9 ICON netdrive.ico
+IDI_SHELL_NETDRIVE ICON netdrive.ico
/* {
'00 00 01 00 09 00 20 20 00 00 01 00 08 00 A8 08'
'00 00 96 00 00 00 10 10 00 00 01 00 08 00 68 05'
} */
/* BINRES netdrive2.ico */
-10 ICON netdrive2.ico
+IDI_SHELL_NETDRIVE2 ICON netdrive2.ico
/* {
'00 00 01 00 09 00 20 20 00 00 01 00 08 00 A8 08'
'00 00 96 00 00 00 10 10 00 00 01 00 08 00 68 05'
} */
/* BINRES cdrom.ico */
-11 ICON cdrom.ico
+IDI_SHELL_CDROM ICON cdrom.ico
/* {
'00 00 01 00 09 00 20 20 00 00 01 00 08 00 A8 08'
'00 00 96 00 00 00 10 10 00 00 01 00 08 00 68 05'
} */
/* BINRES ramdisk.ico */
-12 ICON ramdisk.ico
+IDI_SHELL_RAMDISK ICON ramdisk.ico
/* {
'00 00 01 00 07 00 20 20 00 00 01 00 04 00 E8 02'
'00 00 76 00 00 00 10 10 00 00 01 00 08 00 68 05'
/* BINRES mycomputer.ico */
-15 ICON mycomputer.ico
+IDI_SHELL_MY_COMPUTER ICON mycomputer.ico
/*{
'00 00 01 00 0C 00 10 10 10 00 00 00 00 00 28 01'
'00 00 C6 00 00 00 10 10 00 00 00 00 00 00 68 05'
'FF FF FF FF FF FF'
}*/
-
+/* BINRES printer.ico */
+IDI_SHELL_PRINTER ICON printer.ico
+/* {
+ '00 00 01 00 02 00 20 20 10 00 00 00 00 00 E8 02'
+ '00 00 26 00 00 00 10 10 10 00 00 00 00 00 28 01'
+ '00 00 0E 03 00 00 28 00 00 00 20 00 00 00 40 00'
+ '00 00 01 00 04 00 00 00 00 00 80 02 00 00 00 00'
+ '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00'
+ '00 00 00 00 80 00 00 80 00 00 00 80 80 00 80 00'
+ '00 00 80 00 80 00 80 80 00 00 C0 C0 C0 00 80 80'
+ '80 00 00 00 FF 00 00 FF 00 00 00 FF FF 00 FF 00'
+ '00 00 FF 00 FF 00 FF FF 00 00 FF FF FF 00 00 00'
+ '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00'
+ '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00'
+ '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00'
+ '08 88 88 88 88 88 88 88 88 80 00 00 00 00 00 00'
+ '08 88 88 88 88 88 88 88 88 80 00 00 00 00 00 00'
+ '08 88 88 88 88 8A A8 89 98 80 00 00 00 00 00 00'
+ '08 88 88 88 88 8A A8 89 98 80 00 00 00 00 00 00'
+ '08 88 88 88 88 88 88 88 88 80 00 00 00 00 00 00'
+ '08 88 88 88 88 88 88 88 88 80 00 00 00 00 00 00'
+ '00 77 77 77 77 77 77 77 77 77 00 00 00 00 00 00'
+ '00 07 77 77 77 77 77 77 77 77 70 00 00 00 00 00'
+ '00 00 77 77 77 77 77 77 77 77 77 00 00 00 00 00'
+ '00 00 07 7F FF FF FF FF FF FF FF 70 00 00 00 00'
+ '00 00 00 7F FF FF FF FF FF FF FF 77 00 00 00 00'
+ '00 00 00 0F FF FF FF FF FF FF FF 77 70 00 00 00'
+ '00 00 00 0F FF 00 00 00 00 0F FF 00 00 00 00 00'
+ '00 00 00 00 FF FF FF FF FF FF FF F0 00 00 00 00'
+ '00 00 00 00 FF FF FF FF FF FF FF F0 00 00 00 00'
+ '00 00 00 00 FF F0 00 00 00 00 FF F0 00 00 00 00'
+ '00 00 00 00 FF FF FF FF FF FF FF F0 00 00 00 00'
+ '00 00 00 00 0F FF FF FF FF FF FF FF 00 00 00 00'
+ '00 00 00 00 0F FF 00 00 00 00 0F FF 00 00 00 00'
+ '00 00 00 00 0F FF FF FF FF FF FF FF 00 00 00 00'
+ '00 00 00 00 0F FF FF FF FF FF FF FF 00 00 00 00'
+ '00 00 00 00 00 FF F0 00 00 00 00 FF F0 00 00 00'
+ '00 00 00 00 00 FF FF FF FF FF FF FF F0 00 00 00'
+ '00 00 00 00 00 FF FF FF FF FF FF FF F0 00 00 00'
+ '00 00 00 00 00 FF FF FF FF FF FF FF F0 00 00 00'
+ '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00'
+ '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00'
+ '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00'
+ '00 00 00 00 00 00 00 00 00 00 00 00 00 00 FF FF'
+ 'FF FF FF FF FF FF FF FF FF FF F8 00 00 FF F8 00'
+ '00 7F F8 00 00 3F F8 00 00 1F F8 00 00 0F F8 00'
+ '00 07 FC 00 00 07 FE 00 00 07 FF 00 00 07 FF 80'
+ '00 07 FF C0 00 07 FF E0 00 07 FF E0 00 3F FF F0'
+ '00 1F FF F0 00 1F FF F0 00 1F FF F0 00 1F FF F8'
+ '00 0F FF F8 00 0F FF F8 00 0F FF F8 00 0F FF FC'
+ '00 07 FF FC 00 07 FF FC 00 07 FF FC 00 07 FF FF'
+ 'FF FF FF FF FF FF FF FF FF FF FF FF FF FF 28 00'
+ '00 00 10 00 00 00 20 00 00 00 01 00 04 00 00 00'
+ '00 00 C0 00 00 00 00 00 00 00 00 00 00 00 00 00'
+ '00 00 00 00 00 00 00 00 00 00 00 00 80 00 00 80'
+ '00 00 00 80 80 00 80 00 00 00 80 00 80 00 80 80'
+ '00 00 C0 C0 C0 00 80 80 80 00 00 00 FF 00 00 FF'
+ '00 00 00 FF FF 00 FF 00 00 00 FF 00 FF 00 FF FF'
+ '00 00 FF FF FF 00 00 00 00 00 00 00 00 00 00 00'
+ '00 00 00 00 00 00 00 88 88 88 88 88 00 00 00 88'
+ '88 AA 89 98 00 00 00 88 88 88 88 88 00 00 00 77'
+ '77 77 77 77 70 00 00 07 7F FF FF FF 77 00 00 00'
+ '7F FF FF FF 77 70 00 00 0F 00 00 0F 00 00 00 00'
+ '0F FF FF FF F0 00 00 00 00 F0 00 00 F0 00 00 00'
+ '00 FF FF FF FF 00 00 00 00 0F 00 00 0F 00 00 00'
+ '00 0F FF FF FF 00 00 00 00 00 00 00 00 00 00 00'
+ '00 00 00 00 00 00 FF FF 00 00 FF FF 00 00 C0 07'
+ '00 00 C0 03 00 00 C0 01 00 00 C0 01 00 00 E0 01'
+ '00 00 F0 01 00 00 F8 0F 00 00 F8 07 00 00 FC 07'
+ '00 00 FC 03 00 00 FE 03 00 00 FE 03 00 00 FF FF'
+ '00 00 FF FF 00 00'
+} */
/* BINRES desktop.ico */
-34 ICON desktop.ico
+IDI_SHELL_DESKTOP ICON desktop.ico
/* {
'00 00 01 00 09 00 20 20 00 00 01 00 08 00 A8 08'
'00 00 96 00 00 00 10 10 00 00 01 00 08 00 68 05'
#define IDD_TITLE 0x3742
#define IDD_TREEVIEW 0x3741
+#define IDI_SHELL_DOCUMENT 1
+#define IDI_SHELL_FOLDER 4
+#define IDI_SHELL_FOLDER_OPEN 5
+#define IDI_SHELL_5_12_FLOPPY 6
+#define IDI_SHELL_3_14_FLOPPY 7
+#define IDI_SHELL_FLOPPY 8
+#define IDI_SHELL_DRIVE 9
+#define IDI_SHELL_NETDRIVE 10
+#define IDI_SHELL_NETDRIVE2 11
+#define IDI_SHELL_CDROM 12
+#define IDI_SHELL_RAMDISK 13
+#define IDI_SHELL_ENTIRE_NETWORK 14
+#define IDI_SHELL_NETWORK 15
+#define IDI_SHELL_MY_COMPUTER 16
+#define IDI_SHELL_PRINTER 17
+#define IDI_SHELL_MY_NETWORK_PLACES 18
+#define IDI_SHELL_COMPUTERS_NEAR_ME 19
+#define IDI_SHELL_SEARCH 23
+#define IDI_SHELL_HELP 24
+#define IDI_SHELL_EMPTY_RECYCLE_BIN 32
+#define IDI_SHELL_FULL_RECYCLE_BIN 33
+#define IDI_SHELL_DESKTOP 35
+#define IDI_SHELL_CONTROL_PANEL 36
+#define IDI_SHELL_PRINTERS_FOLDER 38
+#define IDI_SHELL_FONTS_FOLDER 39
+
#endif
{
BgCmImpl* cm;
- cm = (BgCmImpl*)HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(BgCmImpl));
+ cm = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(BgCmImpl));
cm->lpVtbl = &cmvt;
cm->ref = 1;
cm->pSFParent = pSFParent;
break;
default:
- /* if it's a id just pass it to the parent shv */
+ /* if it's an id just pass it to the parent shv */
if (hWndSV) SendMessageA(hWndSV, WM_COMMAND, MAKEWPARAM(LOWORD(lpcmi->lpVerb), 0),0 );
break;
}
}
if (lpSV)
- IShellView_Release(lpSV); /* QueryActiveShellView does AddRef*/
+ IShellView_Release(lpSV); /* QueryActiveShellView does AddRef */
return NOERROR;
}
{ ItemCmImpl* cm;
UINT u;
- cm = (ItemCmImpl*)HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(ItemCmImpl));
+ cm = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(ItemCmImpl));
cm->lpVtbl = &cmvt;
cm->ref = 1;
cm->pidl = ILClone(pidl);
{
TTTOOLINFOA ti;
- strncpy(ptrayItem->notifyIcon.szTip, szTip, sizeof(ptrayItem->notifyIcon.szTip));
- ptrayItem->notifyIcon.szTip[sizeof(ptrayItem->notifyIcon.szTip)-1]=0;
+ lstrcpynA(ptrayItem->notifyIcon.szTip, szTip, sizeof(ptrayItem->notifyIcon.szTip));
ti.cbSize = sizeof(TTTOOLINFOA);
ti.uFlags = 0;
#define DEFINE_SHLGUID(n,l,w1,w2) DEFINE_GUID(n,l,w1,w2,0xC0,0,0,0,0,0,0,0x46)
#define SID_SShellBrowser IID_IShellBrowser
extern const GUID CLSID_MyComputer;
+extern const GUID CLSID_MyDocuments;
extern const GUID CLSID_ShellDesktop;
extern const GUID CLSID_ShellLink;
extern const GUID CLSID_ControlPanel;
#define SHFMT_ERROR 0xFFFFFFFFL
#define SHFMT_CANCEL 0xFFFFFFFEL
#define SHFMT_NOFORMAT 0xFFFFFFFDL
+#define EXP_SZ_LINK_SIG 0xa0000001
+#define NT_CONSOLE_PROPS_SIG 0xa0000002
+#define NT_FE_CONSOLE_PROPS_SIG 0xa0000004
+#define EXP_SPECIAL_FOLDER_SIG 0xa0000005
+#define EXP_DARWIN_ID_SIG 0xa0000006
+#define EXP_LOGO3_ID_SIG 0xa0000007
+#define EXP_SZ_ICON_SIG 0xa0000007
typedef ULONG SFGAOF;
typedef DWORD SHGDNF;
REST_NOFILEASSOCIATE, /* 0x41000003 */
} RESTRICTIONS;
+typedef enum {
+ SLDF_HAS_ID_LIST = 0x00000001,
+ SLDF_HAS_LINK_INFO = 0x00000002,
+ SLDF_HAS_NAME = 0x00000004,
+ SLDF_HAS_RELPATH = 0x00000008,
+ SLDF_HAS_WORKINGDIR = 0x00000010,
+ SLDF_HAS_ARGS = 0x00000020,
+ SLDF_HAS_ICONLOCATION = 0x00000040,
+ SLDF_UNICODE = 0x00000080,
+ SLDF_FORCE_NO_LINKINFO = 0x00000100,
+ SLDF_HAS_EXP_SZ = 0x00000200,
+ SLDF_RUN_IN_SEPERATE = 0x00000400,
+ SLDF_HAS_LOGO3ID = 0x00000800,
+ SLDF_HAS_DARWINID = 0x00001000,
+ SLDF_RUNAS_USER = 0x00002000,
+ SLDF_HAS_EXP_ICON_SZ = 0x00004000,
+ SLDF_NO_PIDL_ALIAS = 0x00008000,
+ SLDF_FORCE_UNCNAME = 0x00010000,
+ SLDF_RUN_WITH_SHIMLAYER = 0x00020000,
+ SLDF_RESERVED = 0x80000000,
+} SHELL_LINK_DATA_FLAGS;
+
+typedef struct tagDATABLOCKHEADER
+{
+ DWORD cbSize;
+ DWORD dwSignature;
+} DATABLOCK_HEADER, *LPDATABLOCK_HEADER, *LPDBLIST;
+
+typedef struct {
+ DATABLOCK_HEADER dbh;
+ CHAR szDarwinID[MAX_PATH];
+ WCHAR szwDarwinID[MAX_PATH];
+} EXP_DARWIN_LINK, *LPEXP_DARWIN_LINK;
+
DECLARE_ENUMERATOR_(IEnumIDList,LPITEMIDLIST);
typedef IEnumIDList *LPENUMIDLIST;