shell32 patch 10

Martin Fuchs martin-fuchs at gmx.net
Tue Jan 20 15:33:38 CST 2004


Changelog:
- implemented SHGetRealIDL()


Index: pidl.c
===================================================================
RCS file: /home/wine/wine/dlls/shell32/pidl.c,v
retrieving revision 1.96
diff -u -p -d -r1.96 pidl.c
--- pidl.c	18 Jan 2004 22:08:46 -0000	1.96
+++ pidl.c	20 Jan 2004 21:32:24 -0000
@@ -688,6 +688,7 @@ LPITEMIDLIST WINAPI ILCombine(LPCITEMIDL
 	/*  TRACE(pidl,"--new pidl=%p\n",pidlNew);*/
 	return pidlNew;
 }
+
 /*************************************************************************
  *  SHGetRealIDL [SHELL32.98]
  *
@@ -695,10 +696,37 @@ LPITEMIDLIST WINAPI ILCombine(LPCITEMIDL
  */
 HRESULT WINAPI SHGetRealIDL(LPSHELLFOLDER lpsf, LPCITEMIDLIST pidlSimple, LPITEMIDLIST *pidlReal)
 {
-	FIXME("sf=%p pidlSimple=%p pidlReal=%p\n", lpsf, pidlSimple, pidlReal);
+	UINT cfShellIDList = RegisterClipboardFormatA(CFSTR_SHELLIDLIST);
 
-	pdump (pidlSimple);
-	return 0;
+	STGMEDIUM medium = {0, {0}, 0};
+	FORMATETC fmt = {cfShellIDList, 0, DVASPECT_CONTENT, -1, TYMED_HGLOBAL};
+
+	IDataObject* pDataObj;
+	HRESULT hr = IShellFolder_GetUIObjectOf(lpsf, 0, 1, &pidlSimple, &IID_IDataObject, 0, (LPVOID*)&pDataObj);
+
+	if (SUCCEEDED(hr)) {
+	    hr = IDataObject_GetData(pDataObj, &fmt, &medium);
+
+	    IDataObject_Release(pDataObj);
+
+	    if (SUCCEEDED(hr)) {
+		/*assert(pida->cidl==1);*/
+		LPIDA pida = (LPIDA)GlobalLock(medium.hGlobal);
+
+		LPCITEMIDLIST pidl_folder = (LPCITEMIDLIST) ((LPBYTE)pida+pida->aoffset[0]);
+		LPCITEMIDLIST pidl_child = (LPCITEMIDLIST) ((LPBYTE)pida+pida->aoffset[1]);
+
+		*pidlReal = ILCombine(pidl_folder, pidl_child);
+
+		if (!*pidlReal)
+			hr = E_OUTOFMEMORY;
+
+		GlobalUnlock(medium.hGlobal);
+		GlobalFree(medium.hGlobal);
+	    }
+	}
+
+	return hr;
 }
 
 /*************************************************************************





More information about the wine-devel mailing list