- forgot one file

svn path=/trunk/; revision=29510
This commit is contained in:
Johannes Anderwald 2007-10-11 19:26:16 +00:00
parent 01a2631183
commit 8b2f309588

View file

@ -16,7 +16,7 @@
* *
* You should have received a copy of the GNU Lesser General Public * You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#include "config.h" #include "config.h"
@ -37,7 +37,6 @@
#include "winuser.h" #include "winuser.h"
#include "wingdi.h" #include "wingdi.h"
#include "shlobj.h" #include "shlobj.h"
#include "shlguid.h"
#include "shlwapi.h" #include "shlwapi.h"
#include "undocshell.h" #include "undocshell.h"
@ -120,7 +119,7 @@ LPWSTR* WINAPI CommandLineToArgvW(LPCWSTR lpCmdline, int* numargs)
return argv; return argv;
} }
/* to get a writeable copy */ /* to get a writable copy */
argc=0; argc=0;
bcount=0; bcount=0;
in_quotes=0; in_quotes=0;
@ -275,6 +274,9 @@ static DWORD shgfi_get_exe_type(LPCWSTR szFullPath)
SetFilePointer( hfile, mz_header.e_lfanew, NULL, SEEK_SET ); SetFilePointer( hfile, mz_header.e_lfanew, NULL, SEEK_SET );
ReadFile( hfile, &nt, sizeof(nt), &len, NULL ); ReadFile( hfile, &nt, sizeof(nt), &len, NULL );
CloseHandle( hfile ); CloseHandle( hfile );
/* DLL files are not executable and should return 0 */
if (nt.FileHeader.Characteristics & IMAGE_FILE_DLL)
return 0;
if (nt.OptionalHeader.Subsystem == IMAGE_SUBSYSTEM_WINDOWS_GUI) if (nt.OptionalHeader.Subsystem == IMAGE_SUBSYSTEM_WINDOWS_GUI)
{ {
return IMAGE_NT_SIGNATURE | return IMAGE_NT_SIGNATURE |
@ -348,7 +350,7 @@ DWORD_PTR WINAPI SHGetFileInfoW(LPCWSTR path,DWORD dwFileAttributes,
BOOL IconNotYetLoaded=TRUE; BOOL IconNotYetLoaded=TRUE;
UINT uGilFlags = 0; UINT uGilFlags = 0;
TRACE("%s fattr=0x%lx sfi=%p(attr=0x%08lx) size=0x%x flags=0x%x\n", TRACE("%s fattr=0x%x sfi=%p(attr=0x%08x) size=0x%x flags=0x%x\n",
(flags & SHGFI_PIDL)? "pidl" : debugstr_w(path), dwFileAttributes, (flags & SHGFI_PIDL)? "pidl" : debugstr_w(path), dwFileAttributes,
psfi, psfi->dwAttributes, sizeofpsfi, flags); psfi, psfi->dwAttributes, sizeofpsfi, flags);
@ -356,7 +358,7 @@ DWORD_PTR WINAPI SHGetFileInfoW(LPCWSTR path,DWORD dwFileAttributes,
(flags & (SHGFI_ATTRIBUTES|SHGFI_EXETYPE|SHGFI_PIDL))) (flags & (SHGFI_ATTRIBUTES|SHGFI_EXETYPE|SHGFI_PIDL)))
return FALSE; return FALSE;
/* windows initializes this values regardless of the flags */ /* windows initializes these values regardless of the flags */
if (psfi != NULL) if (psfi != NULL)
{ {
psfi->szDisplayName[0] = '\0'; psfi->szDisplayName[0] = '\0';
@ -509,58 +511,57 @@ DWORD_PTR WINAPI SHGetFileInfoW(LPCWSTR path,DWORD dwFileAttributes,
/* get the iconlocation */ /* get the iconlocation */
if (SUCCEEDED(hr) && (flags & SHGFI_ICONLOCATION )) if (SUCCEEDED(hr) && (flags & SHGFI_ICONLOCATION ))
{ {
if (!(flags & SHGFI_USEFILEATTRIBUTES)) UINT uDummy,uFlags;
if (flags & SHGFI_USEFILEATTRIBUTES)
{ {
UINT uDummy,uFlags; if (dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
hr = IShellFolder_GetUIObjectOf(psfParent, 0, 1,
(LPCITEMIDLIST*)&pidlLast, &IID_IExtractIconA,
&uDummy, (LPVOID*)&pei);
if (SUCCEEDED(hr))
{ {
hr = IExtractIconW_GetIconLocation(pei, uGilFlags, lstrcpyW(psfi->szDisplayName, swShell32Name);
szLocation, MAX_PATH, &iIndex, &uFlags); psfi->iIcon = -IDI_SHELL_FOLDER;
psfi->iIcon = iIndex; }
else
{
WCHAR* szExt;
static const WCHAR p1W[] = {'%','1',0};
WCHAR sTemp [MAX_PATH];
if (!(uFlags & GIL_NOTFILENAME)) szExt = (LPWSTR) PathFindExtensionW(szFullPath);
lstrcpyW (psfi->szDisplayName, szLocation); TRACE("szExt=%s\n", debugstr_w(szExt));
if ( szExt &&
HCR_MapTypeToValueW(szExt, sTemp, MAX_PATH, TRUE) &&
HCR_GetDefaultIconW(sTemp, sTemp, MAX_PATH, &psfi->iIcon))
{
if (lstrcmpW(p1W, sTemp))
strcpyW(psfi->szDisplayName, sTemp);
else
{
/* the icon is in the file */
strcpyW(psfi->szDisplayName, szFullPath);
}
}
else else
ret = FALSE; ret = FALSE;
IExtractIconA_Release(pei);
} }
} }
else else
{ {
if (dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) hr = IShellFolder_GetUIObjectOf(psfParent, 0, 1,
(LPCITEMIDLIST*)&pidlLast, &IID_IExtractIconW,
&uDummy, (LPVOID*)&pei);
if (SUCCEEDED(hr))
{ {
strcpyW(psfi->szDisplayName, swShell32Name); hr = IExtractIconW_GetIconLocation(pei, uGilFlags,
psfi->iIcon = SIC_GetIconIndex(swShell32Name, -IDI_SHELL_FOLDER, 0); szLocation, MAX_PATH, &iIndex, &uFlags);
}
else
{
WCHAR sTemp [MAX_PATH];
WCHAR * szExt;
DWORD dwNr=0;
static const WCHAR p1W[] = {'%','1',0};
lstrcpynW(sTemp, szFullPath, MAX_PATH); if (uFlags & GIL_NOTFILENAME)
ret = FALSE;
psfi->iIcon = 0; else
szExt = (LPWSTR) PathFindExtensionW(sTemp);
if ( szExt &&
HCR_MapTypeToValueW(szExt, sTemp, MAX_PATH, TRUE) &&
HCR_GetDefaultIconW(sTemp, sTemp, MAX_PATH, &dwNr))
{ {
if (!lstrcmpW(p1W,sTemp)) /* icon is in the file */ lstrcpyW (psfi->szDisplayName, szLocation);
strcpyW(psfi->szDisplayName, szFullPath); psfi->iIcon = iIndex;
else
strcpyW(psfi->szDisplayName, sTemp);
psfi->iIcon = SIC_GetIconIndex(psfi->szDisplayName, dwNr, 0);
if (psfi->iIcon == -1)
psfi->iIcon = 0;
} }
IExtractIconW_Release(pei);
} }
} }
} }
@ -572,7 +573,7 @@ DWORD_PTR WINAPI SHGetFileInfoW(LPCWSTR path,DWORD dwFileAttributes,
{ {
WCHAR sTemp [MAX_PATH]; WCHAR sTemp [MAX_PATH];
WCHAR * szExt; WCHAR * szExt;
DWORD dwNr=0; int icon_idx=0;
lstrcpynW(sTemp, szFullPath, MAX_PATH); lstrcpynW(sTemp, szFullPath, MAX_PATH);
@ -586,14 +587,14 @@ DWORD_PTR WINAPI SHGetFileInfoW(LPCWSTR path,DWORD dwFileAttributes,
szExt = (LPWSTR) PathFindExtensionW(sTemp); szExt = (LPWSTR) PathFindExtensionW(sTemp);
if ( szExt && if ( szExt &&
HCR_MapTypeToValueW(szExt, sTemp, MAX_PATH, TRUE) && HCR_MapTypeToValueW(szExt, sTemp, MAX_PATH, TRUE) &&
HCR_GetDefaultIconW(sTemp, sTemp, MAX_PATH, &dwNr)) HCR_GetDefaultIconW(sTemp, sTemp, MAX_PATH, &icon_idx))
{ {
if (!lstrcmpW(p1W,sTemp)) /* icon is in the file */ if (!lstrcmpW(p1W,sTemp)) /* icon is in the file */
strcpyW(sTemp, szFullPath); strcpyW(sTemp, szFullPath);
if (flags & SHGFI_SYSICONINDEX) if (flags & SHGFI_SYSICONINDEX)
{ {
psfi->iIcon = SIC_GetIconIndex(sTemp,dwNr,0); psfi->iIcon = SIC_GetIconIndex(sTemp,icon_idx,0);
if (psfi->iIcon == -1) if (psfi->iIcon == -1)
psfi->iIcon = 0; psfi->iIcon = 0;
} }
@ -601,16 +602,16 @@ DWORD_PTR WINAPI SHGetFileInfoW(LPCWSTR path,DWORD dwFileAttributes,
{ {
IconNotYetLoaded=FALSE; IconNotYetLoaded=FALSE;
if (flags & SHGFI_SMALLICON) if (flags & SHGFI_SMALLICON)
PrivateExtractIconsW( sTemp,dwNr, PrivateExtractIconsW( sTemp,icon_idx,
GetSystemMetrics( SM_CXSMICON ), GetSystemMetrics( SM_CXSMICON ),
GetSystemMetrics( SM_CYSMICON ), GetSystemMetrics( SM_CYSMICON ),
&psfi->hIcon, 0, 1, 0); &psfi->hIcon, 0, 1, 0);
else else
PrivateExtractIconsW( sTemp, dwNr, PrivateExtractIconsW( sTemp, icon_idx,
GetSystemMetrics( SM_CXICON), GetSystemMetrics( SM_CXICON),
GetSystemMetrics( SM_CYICON), GetSystemMetrics( SM_CYICON),
&psfi->hIcon, 0, 1, 0); &psfi->hIcon, 0, 1, 0);
psfi->iIcon = dwNr; psfi->iIcon = icon_idx;
} }
} }
} }
@ -650,11 +651,10 @@ DWORD_PTR WINAPI SHGetFileInfoW(LPCWSTR path,DWORD dwFileAttributes,
if (hr != S_OK) if (hr != S_OK)
ret = FALSE; ret = FALSE;
if (pidlLast) SHFree(pidlLast);
SHFree(pidlLast);
#ifdef MORE_DEBUG #ifdef MORE_DEBUG
TRACE ("icon=%p index=0x%08x attr=0x%08lx name=%s type=%s ret=0x%08lx\n", TRACE ("icon=%p index=0x%08x attr=0x%08x name=%s type=%s ret=0x%08lx\n",
psfi->hIcon, psfi->iIcon, psfi->dwAttributes, psfi->hIcon, psfi->iIcon, psfi->dwAttributes,
debugstr_w(psfi->szDisplayName), debugstr_w(psfi->szTypeName), ret); debugstr_w(psfi->szDisplayName), debugstr_w(psfi->szTypeName), ret);
#endif #endif
@ -670,29 +670,31 @@ DWORD_PTR WINAPI SHGetFileInfoA(LPCSTR path,DWORD dwFileAttributes,
UINT flags ) UINT flags )
{ {
INT len; INT len;
LPWSTR temppath; LPWSTR temppath = NULL;
LPCWSTR pathW;
DWORD ret; DWORD ret;
SHFILEINFOW temppsfi; SHFILEINFOW temppsfi;
if (flags & SHGFI_PIDL) if (flags & SHGFI_PIDL)
{ {
/* path contains a pidl */ /* path contains a pidl */
temppath = (LPWSTR) path; pathW = (LPCWSTR)path;
} }
else else
{ {
len = MultiByteToWideChar(CP_ACP, 0, path, -1, NULL, 0); len = MultiByteToWideChar(CP_ACP, 0, path, -1, NULL, 0);
temppath = HeapAlloc(GetProcessHeap(), 0, len*sizeof(WCHAR)); temppath = HeapAlloc(GetProcessHeap(), 0, len*sizeof(WCHAR));
MultiByteToWideChar(CP_ACP, 0, path, -1, temppath, len); MultiByteToWideChar(CP_ACP, 0, path, -1, temppath, len);
pathW = temppath;
} }
if (psfi && (flags & SHGFI_ATTR_SPECIFIED)) if (psfi && (flags & SHGFI_ATTR_SPECIFIED))
temppsfi.dwAttributes=psfi->dwAttributes; temppsfi.dwAttributes=psfi->dwAttributes;
if (psfi == NULL) if (psfi == NULL)
ret = SHGetFileInfoW(temppath, dwFileAttributes, NULL, sizeof(temppsfi), flags); ret = SHGetFileInfoW(pathW, dwFileAttributes, NULL, sizeof(temppsfi), flags);
else else
ret = SHGetFileInfoW(temppath, dwFileAttributes, &temppsfi, sizeof(temppsfi), flags); ret = SHGetFileInfoW(pathW, dwFileAttributes, &temppsfi, sizeof(temppsfi), flags);
if (psfi) if (psfi)
{ {
@ -714,8 +716,7 @@ DWORD_PTR WINAPI SHGetFileInfoA(LPCSTR path,DWORD dwFileAttributes,
} }
} }
if (!(flags & SHGFI_PIDL)) HeapFree(GetProcessHeap(), 0, temppath);
HeapFree(GetProcessHeap(), 0, temppath);
return ret; return ret;
} }
@ -829,7 +830,7 @@ VOID WINAPI Printer_LoadIconsW(LPCWSTR wsPrinterName, HICON * pLargeIcon, HICON
BOOL WINAPI Printers_RegisterWindowW(LPCWSTR wsPrinter, DWORD dwType, BOOL WINAPI Printers_RegisterWindowW(LPCWSTR wsPrinter, DWORD dwType,
HANDLE * phClassPidl, HWND * phwnd) HANDLE * phClassPidl, HWND * phwnd)
{ {
FIXME("(%s, %lx, %p (%p), %p (%p)) stub!\n", debugstr_w(wsPrinter), dwType, FIXME("(%s, %x, %p (%p), %p (%p)) stub!\n", debugstr_w(wsPrinter), dwType,
phClassPidl, (phClassPidl != NULL) ? *(phClassPidl) : NULL, phClassPidl, (phClassPidl != NULL) ? *(phClassPidl) : NULL,
phwnd, (phwnd != NULL) ? *(phwnd) : NULL); phwnd, (phwnd != NULL) ? *(phwnd) : NULL);
@ -900,8 +901,8 @@ UINT WINAPI SHAppBarMessage(DWORD msg, PAPPBARDATA data)
data->hWnd=GetActiveWindow(); data->hWnd=GetActiveWindow();
return TRUE; return TRUE;
case ABM_NEW: case ABM_NEW:
SetWindowPos(data->hWnd,HWND_TOP,rec.left,rec.top, /* cbSize, hWnd, and uCallbackMessage are used. All other ignored */
width,height,SWP_SHOWWINDOW); SetWindowPos(data->hWnd,HWND_TOP,0,0,0,0,SWP_SHOWWINDOW|SWP_NOMOVE|SWP_NOSIZE);
return TRUE; return TRUE;
case ABM_QUERYPOS: case ABM_QUERYPOS:
GetWindowRect(data->hWnd, &(data->rc)); GetWindowRect(data->hWnd, &(data->rc));
@ -932,7 +933,7 @@ UINT WINAPI SHAppBarMessage(DWORD msg, PAPPBARDATA data)
*/ */
DWORD WINAPI SHHelpShortcuts_RunDLLA(DWORD dwArg1, DWORD dwArg2, DWORD dwArg3, DWORD dwArg4) DWORD WINAPI SHHelpShortcuts_RunDLLA(DWORD dwArg1, DWORD dwArg2, DWORD dwArg3, DWORD dwArg4)
{ {
FIXME("(%lx, %lx, %lx, %lx) stub!\n", dwArg1, dwArg2, dwArg3, dwArg4); FIXME("(%x, %x, %x, %x) stub!\n", dwArg1, dwArg2, dwArg3, dwArg4);
return 0; return 0;
} }
@ -942,7 +943,7 @@ DWORD WINAPI SHHelpShortcuts_RunDLLA(DWORD dwArg1, DWORD dwArg2, DWORD dwArg3, D
*/ */
DWORD WINAPI SHHelpShortcuts_RunDLLW(DWORD dwArg1, DWORD dwArg2, DWORD dwArg3, DWORD dwArg4) DWORD WINAPI SHHelpShortcuts_RunDLLW(DWORD dwArg1, DWORD dwArg2, DWORD dwArg3, DWORD dwArg4)
{ {
FIXME("(%lx, %lx, %lx, %lx) stub!\n", dwArg1, dwArg2, dwArg3, dwArg4); FIXME("(%x, %x, %x, %x) stub!\n", dwArg1, dwArg2, dwArg3, dwArg4);
return 0; return 0;
} }
@ -999,8 +1000,8 @@ INT_PTR CALLBACK AboutDlgProc( HWND hWnd, UINT msg, WPARAM wParam,
while (*pstr) while (*pstr)
{ {
WCHAR name[64]; WCHAR name[64];
/* authors list is in iso-8859-1 format */ /* authors list is in utf-8 format */
MultiByteToWideChar( 28591, 0, *pstr, -1, name, sizeof(name)/sizeof(WCHAR) ); MultiByteToWideChar( CP_UTF8, 0, *pstr, -1, name, sizeof(name)/sizeof(WCHAR) );
SendMessageW( hWndCtl, LB_ADDSTRING, (WPARAM)-1, (LPARAM)name ); SendMessageW( hWndCtl, LB_ADDSTRING, (WPARAM)-1, (LPARAM)name );
pstr++; pstr++;
} }
@ -1109,9 +1110,17 @@ BOOL WINAPI ShellAboutW( HWND hWnd, LPCWSTR szApp, LPCWSTR szOtherStuff,
*/ */
void WINAPI FreeIconList( DWORD dw ) void WINAPI FreeIconList( DWORD dw )
{ {
FIXME("%lx: stub\n",dw); FIXME("%x: stub\n",dw);
} }
/*************************************************************************
* SHLoadNonloadedIconOverlayIdentifiers (SHELL32.@)
*/
HRESULT WINAPI SHLoadNonloadedIconOverlayIdentifiers( VOID )
{
FIXME("stub\n");
return S_OK;
}
/*********************************************************************** /***********************************************************************
* DllGetVersion [SHELL32.@] * DllGetVersion [SHELL32.@]
@ -1149,7 +1158,7 @@ HRESULT WINAPI DllGetVersion (DLLVERSIONINFO *pdvi)
WINE_FILEVERSION_BUILD, WINE_FILEVERSION_BUILD,
WINE_FILEVERSION_PLATFORMID); WINE_FILEVERSION_PLATFORMID);
} }
TRACE("%lu.%lu.%lu.%lu\n", TRACE("%u.%u.%u.%u\n",
pdvi->dwMajorVersion, pdvi->dwMinorVersion, pdvi->dwMajorVersion, pdvi->dwMinorVersion,
pdvi->dwBuildNumber, pdvi->dwPlatformID); pdvi->dwBuildNumber, pdvi->dwPlatformID);
return S_OK; return S_OK;
@ -1179,7 +1188,7 @@ HIMAGELIST ShellBigIconList = 0;
*/ */
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID fImpLoad) BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID fImpLoad)
{ {
TRACE("%p 0x%lx %p\n", hinstDLL, fdwReason, fImpLoad); TRACE("%p 0x%x %p\n", hinstDLL, fdwReason, fImpLoad);
switch (fdwReason) switch (fdwReason)
{ {