From 6d17c61096c3c3bb5b939ca23d79660b52c6af67 Mon Sep 17 00:00:00 2001 From: Juergen Schmied Date: Tue, 4 Jan 2000 00:33:56 +0000 Subject: [PATCH] Small fixes. --- dlls/shell32/shell32.spec | 4 ++-- dlls/shell32/shell32_main.c | 3 ++- dlls/shell32/shell32_main.h | 3 +++ dlls/shell32/shellord.c | 11 +++++++++++ dlls/shell32/shellpath.c | 39 +++++++++++++++---------------------- dlls/shell32/shlmenu.c | 20 +++++++++++++++---- dlls/shell32/systray.c | 18 +++++++++++++++++ 7 files changed, 68 insertions(+), 30 deletions(-) diff --git a/dlls/shell32/shell32.spec b/dlls/shell32/shell32.spec index 75b78f64299..115867f4ba3 100644 --- a/dlls/shell32/shell32.spec +++ b/dlls/shell32/shell32.spec @@ -77,7 +77,7 @@ init Shell32LibMain 69 stub SHGetNetResource 70 stdcall SHCreateDefClassObject(long long long long long)SHCreateDefClassObject 71 stdcall Shell_GetImageList(ptr ptr) Shell_GetImageList - 72 stdcall Shell_GetCachedImageIndex(ptr ptr long) Shell_GetCachedImageIndexA # ASCII!!! + 72 stdcall Shell_GetCachedImageIndex(ptr ptr long) Shell_GetCachedImageIndexAW 73 stdcall SHShellFolderView_Message(long long long) SHShellFolderView_Message 74 stub SHCreateStdEnumFmtEtc 75 stdcall PathYetAnotherMakeUniqueName(ptr ptr) PathYetAnotherMakeUniqueNameA @@ -304,7 +304,7 @@ init Shell32LibMain 295 stub ShellHookProc # exported by name 296 stdcall Shell_NotifyIcon(long ptr) Shell_NotifyIcon 297 stdcall Shell_NotifyIconA(long ptr) Shell_NotifyIconA - 298 stub Shell_NotifyIconW # exported by name + 298 stdcall Shell_NotifyIconW(long ptr) Shell_NotifyIconW 299 stub Shl1632_ThunkData32 300 stub Shl3216_ThunkData32 301 stub StrChrA # proper ordinal unknown diff --git a/dlls/shell32/shell32_main.c b/dlls/shell32/shell32_main.c index 77f59905f67..4cd76edc202 100644 --- a/dlls/shell32/shell32_main.c +++ b/dlls/shell32/shell32_main.c @@ -816,7 +816,8 @@ BOOL WINAPI Shell32LibMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID fImpLoad) } SIC_Initialize(); - + SYSTRAY_Init(); + break; case DLL_THREAD_ATTACH: diff --git a/dlls/shell32/shell32_main.h b/dlls/shell32/shell32_main.h index 60c3b009d52..b2a0547dfc5 100644 --- a/dlls/shell32/shell32_main.h +++ b/dlls/shell32/shell32_main.h @@ -138,4 +138,7 @@ HRESULT WINAPI Shell_MergeMenus (HMENU hmDst, HMENU hmSrc, UINT uInsert, UINT uI (((kst) & MK_SHIFT) ? DROPEFFECT_LINK : DROPEFFECT_COPY):\ DROPEFFECT_MOVE) +/* Systray */ +BOOL SYSTRAY_Init(void); + #endif diff --git a/dlls/shell32/shellord.c b/dlls/shell32/shellord.c index bbbf4ddc711..3fbabf4ab35 100644 --- a/dlls/shell32/shellord.c +++ b/dlls/shell32/shellord.c @@ -1454,3 +1454,14 @@ BOOL WINAPI Win32DeleteFile(LPSTR fName) return TRUE; } +/* +LPSTR WINAPI StrCpyNA(LPSTR psz1, LPCSTR psz2, int cchMax) +{ + return lstrcpynA(psz1, psz2, cchMax); +} + +LPWSTR WINAPI StrCpyNW(LPWSTR psz1, LPCWSTR psz2, int cchMax) +{ + return lstrcpynW(psz1, psz2, cchMax); +} +*/ diff --git a/dlls/shell32/shellpath.c b/dlls/shell32/shellpath.c index 40d5b7ca353..530271ce107 100644 --- a/dlls/shell32/shellpath.c +++ b/dlls/shell32/shellpath.c @@ -651,9 +651,11 @@ VOID WINAPI PathUnquoteSpacesW(LPWSTR str) return; } VOID WINAPI PathUnquoteSpacesAW(LPVOID str) -{ if(VERSION_OsIsUnicode()) +{ + if(VERSION_OsIsUnicode()) PathUnquoteSpacesW(str); - PathUnquoteSpacesA(str); + else + PathUnquoteSpacesA(str); } @@ -890,7 +892,7 @@ BOOL WINAPI SHGetSpecialFolderPathA ( case CSIDL_PROGRAMS: hRootKey = HKEY_CURRENT_USER; strcpy(szValueName, "Programs"); - strcpy(szDefaultPath, "StatrMenu\\Programs"); + strcpy(szDefaultPath, "StartMenu\\Programs"); break; case CSIDL_COMMON_PROGRAMS: @@ -1012,31 +1014,22 @@ BOOL WINAPI SHGetSpecialFolderPathAW ( * */ -LPSTR WINAPI PathRemoveBackslashA( - LPSTR lpPath - ) +LPSTR WINAPI PathRemoveBackslashA( LPSTR lpPath ) { - LPSTR temp = lpPath; - LPSTR prev = lpPath; + LPSTR p = lpPath; - while (*temp) - { - prev = temp++; - } - if ( *prev == (CHAR)'\\') - { - *prev = (CHAR)'\0'; - } - - return prev; + while (*lpPath) p = lpPath++; + if ( *p == (CHAR)'\\') *p = (CHAR)'\0'; + return p; } -LPWSTR WINAPI PathRemoveBackslashW( - LPWSTR lpPath - ) +LPWSTR WINAPI PathRemoveBackslashW( LPWSTR lpPath ) { - FIXME("(%p),stub!\n", lpPath); - return lpPath; + LPWSTR p = lpPath; + + while (*lpPath); p = lpPath++; + if ( *p == (WCHAR)'\\') *p = (WCHAR)'\0'; + return p; } /* diff --git a/dlls/shell32/shlmenu.c b/dlls/shell32/shlmenu.c index 064c70b9935..06c56530148 100644 --- a/dlls/shell32/shlmenu.c +++ b/dlls/shell32/shlmenu.c @@ -1,7 +1,6 @@ /* * see www.geocities.com/SiliconValley/4942/filemenu.html */ -#include #include #include "wine/obj_base.h" @@ -61,7 +60,11 @@ LPFMINFO FM_GetMenuInfo(HMENU hmenu) menudata = (LPFMINFO)MenuInfo.dwMenuData; - assert ((menudata != 0) && (MenuInfo.cbSize == sizeof(MENUINFO))); + if ((menudata == 0) || (MenuInfo.cbSize != sizeof(MENUINFO))) + { + ERR("menudata corrupt: %p %lu\n", menudata, MenuInfo.cbSize); + return 0; + } return menudata; @@ -122,7 +125,11 @@ static int FM_InitMenuPopup(HMENU hmenu, LPITEMIDLIST pAlternatePidl) menudata = (LPFMINFO)MenuInfo.dwMenuData; - assert ((menudata != 0) && (MenuInfo.cbSize == sizeof(MENUINFO))); + if ((menudata == 0) || (MenuInfo.cbSize != sizeof(MENUINFO))) + { + ERR("menudata corrupt: %p %lu\n", menudata, MenuInfo.cbSize); + return 0; + } if (menudata->bInitialized) return 0; @@ -334,7 +341,12 @@ BOOL WINAPI FileMenu_AppendItemA( return FALSE; menudata = (LPFMINFO)MenuInfo.dwMenuData; - assert ((menudata != 0) && (MenuInfo.cbSize == sizeof(MENUINFO))); + if ((menudata == 0) || (MenuInfo.cbSize != sizeof(MENUINFO))) + { + ERR("menudata corrupt: %p %lu\n", menudata, MenuInfo.cbSize); + return 0; + } + menudata->bFixedItems = TRUE; SetMenuInfo(hMenu, &MenuInfo); diff --git a/dlls/shell32/systray.c b/dlls/shell32/systray.c index 53d960b9cd8..acaa9e5e632 100644 --- a/dlls/shell32/systray.c +++ b/dlls/shell32/systray.c @@ -13,6 +13,7 @@ #include #include +#include "heap.h" #include "shellapi.h" #include "shell32_main.h" #include "windows.h" @@ -420,6 +421,23 @@ BOOL WINAPI Shell_NotifyIconA(DWORD dwMessage, PNOTIFYICONDATAA pnid ) return flag; } +/************************************************************************* + * Shell_NotifyIconA [SHELL32.297] + */ +BOOL WINAPI Shell_NotifyIconW (DWORD dwMessage, PNOTIFYICONDATAW pnid ) +{ + BOOL ret; + + PNOTIFYICONDATAA p = HeapAlloc(GetProcessHeap(),0,sizeof(NOTIFYICONDATAA)); + memcpy(p, pnid, sizeof(NOTIFYICONDATAA)); + if (*(pnid->szTip)) + lstrcpynWtoA (p->szTip, pnid->szTip, 64 ); + + ret = Shell_NotifyIconA(dwMessage, p ); + + HeapFree(GetProcessHeap(),0,p); + return ret; +} /************************************************************************* * Shell_NotifyIcon [SHELL32.296] */