Aric Stewart : shell32: Use _ILSimpleGetTextW instead of using _ILGetTextPointer

Alexandre Julliard julliard at wine.codeweavers.com
Wed Apr 11 06:42:11 CDT 2007


Module: wine
Branch: master
Commit: c465e11a6d61ccb6054839913d2f99ca4ccd565e
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=c465e11a6d61ccb6054839913d2f99ca4ccd565e

Author: Aric Stewart <aric at codeweavers.com>
Date:   Tue Apr 10 19:40:00 2007 +0900

shell32: Use _ILSimpleGetTextW instead of using _ILGetTextPointer
to be able to make use of FileStructW and avoid W->A->W roundtrips if
possible.

---

 dlls/shell32/shlfolder.c |   11 +++++------
 1 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/dlls/shell32/shlfolder.c b/dlls/shell32/shlfolder.c
index 6ab4908..b243412 100644
--- a/dlls/shell32/shlfolder.c
+++ b/dlls/shell32/shlfolder.c
@@ -222,13 +222,10 @@ static HRESULT SHELL32_CoCreateInitSF (LPCITEMIDLIST pidlRoot, LPCWSTR pathRoot,
 	    }
 
 	    if (pidlChild) {
-		LPCSTR pszChild = _ILGetTextPointer(pidlChild);
                 int len = lstrlenW(ppfti.szTargetParsingName);
 
-		if (pszChild)
-		    MultiByteToWideChar (CP_ACP, 0, pszChild, -1, ppfti.szTargetParsingName + len, MAX_PATH - len);
-		else
-		    hr = E_INVALIDARG;
+		if (!_ILSimpleGetTextW(pidlChild, ppfti.szTargetParsingName + len, MAX_PATH - len))
+			hr = E_INVALIDARG;
 	    }
 
 	    IPersistFolder3_InitializeEx (ppf, NULL, pidlAbsolute, &ppfti);
@@ -290,7 +287,9 @@ HRESULT SHELL32_BindToChild (LPCITEMIDLIST pidlRoot,
             lstrcpynW(wszFolderPath, pathRoot, MAX_PATH);
             pwszPathTail = PathAddBackslashW(wszFolderPath);
         }
-        MultiByteToWideChar(CP_ACP, 0, _ILGetTextPointer(pidlChild), -1, pwszPathTail, MAX_PATH - (int)(pwszPathTail - wszFolderPath));
+
+        _ILSimpleGetTextW(pidlChild,pwszPathTail,MAX_PATH - (int)(pwszPathTail - wszFolderPath));
+
         if (SHELL32_GetCustomFolderAttributeFromPath (wszFolderPath,
             wszDotShellClassInfo, wszCLSID, wszCLSIDValue, CHARS_IN_GUID))
             CLSIDFromString (wszCLSIDValue, &clsidFolder);




More information about the wine-cvs mailing list