Implement SHGetFileInfoW

James Juran jamesjuran at alumni.psu.edu
Wed Mar 7 22:02:37 CST 2001


ChangeLog:
	James Juran <jamesjuran at alumni.psu.edu>
	Implement SHGetFileInfoW by calling SHGetFileInfoA.

Index: dlls/shell32/shell32_main.c
===================================================================
RCS file: /home/wine/wine/dlls/shell32/shell32_main.c,v
retrieving revision 1.72
diff -u -r1.72 shell32_main.c
--- dlls/shell32/shell32_main.c	2001/02/23 01:12:26	1.72
+++ dlls/shell32/shell32_main.c	2001/03/08 03:56:57
@@ -317,9 +317,29 @@
 DWORD WINAPI SHGetFileInfoW(LPCWSTR path,DWORD dwFileAttributes,
                               SHFILEINFOW *psfi, UINT sizeofpsfi,
                               UINT flags )
-{	FIXME("(%s,0x%lx,%p,0x%x,0x%x)\n",
-	      debugstr_w(path),dwFileAttributes,psfi,sizeofpsfi,flags);
-	return 0;
+{
+	INT len;
+	LPSTR temppath;
+	DWORD ret;
+	SHFILEINFOA temppsfi;
+
+	len = WideCharToMultiByte(CP_ACP, 0, path, -1, NULL, 0, NULL, NULL);
+	temppath = HeapAlloc(GetProcessHeap(), 0, len * sizeof(CHAR));
+	WideCharToMultiByte(CP_ACP, 0, path, -1, temppath, len, NULL, NULL);
+
+	len = WideCharToMultiByte(CP_ACP, 0, psfi->szDisplayName, -1, NULL, 0, NULL, NULL);
+	WideCharToMultiByte(CP_ACP, 0, psfi->szDisplayName, -1, temppsfi.szDisplayName,
+			    len, NULL, NULL);
+
+	len = WideCharToMultiByte(CP_ACP, 0, psfi->szTypeName, -1, NULL, 0, NULL, NULL);
+	WideCharToMultiByte(CP_ACP, 0, psfi->szTypeName, -1, temppsfi.szTypeName,
+			    len, NULL, NULL);
+	
+	ret = SHGetFileInfoA(temppath, dwFileAttributes, &temppsfi, sizeof(temppsfi), flags);
+
+	HeapFree(GetProcessHeap(), 0, temppath);
+	
+	return ret;
 }
 
 /*************************************************************************




More information about the wine-patches mailing list