From 4e8e7ffccd6c9265632826dbfe218b8764d392f9 Mon Sep 17 00:00:00 2001 From: Christoph von Wittich Date: Thu, 6 Mar 2008 11:30:26 +0000 Subject: [PATCH] =?UTF-8?q?Huw=20Davies=20:=20shell32:=20ABM=5FGETAUTOHIDE?= =?UTF-8?q?BAR=20should=20return=20a=20HWND=20or=20NULL=20Alexander=20Nico?= =?UTF-8?q?laysen=20S=C3=B8rnes=20:=20shell32:=20Use=20LocalFree=20in=20Co?= =?UTF-8?q?mmandLineToArgvW.=20Rob=20Shearman=20:=20shell32:=20Memory=20al?= =?UTF-8?q?located=20by=20CommandLineToArgvW=20should=20be=20that=20got=20?= =?UTF-8?q?from=20LocalAlloc/=20LocalReAlloc,=20not=20from=20GlobalAlloc.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit svn path=/trunk/; revision=32582 --- reactos/dll/win32/shell32/autocomplete.c | 2 +- reactos/dll/win32/shell32/brsfolder.c | 4 ++-- reactos/dll/win32/shell32/shell32_main.c | 21 ++++++++++----------- reactos/include/psdk/shellapi.h | 2 +- 4 files changed, 14 insertions(+), 15 deletions(-) diff --git a/reactos/dll/win32/shell32/autocomplete.c b/reactos/dll/win32/shell32/autocomplete.c index 985400cf035..0e3663fa9db 100644 --- a/reactos/dll/win32/shell32/autocomplete.c +++ b/reactos/dll/win32/shell32/autocomplete.c @@ -507,7 +507,7 @@ static LRESULT APIENTRY ACEditSubclassProc(HWND hwnd, UINT uMsg, WPARAM wParam, if ( (This->options & (ACO_AUTOSUGGEST | ACO_UPDOWNKEYDROPSLIST)) && (!IsWindowVisible(This->hwndListBox) && (! *hwndText)) ) { - /* We must dispays all the entries */ + /* We must display all the entries */ displayall = TRUE; } else { if (IsWindowVisible(This->hwndListBox)) { diff --git a/reactos/dll/win32/shell32/brsfolder.c b/reactos/dll/win32/shell32/brsfolder.c index c11219d88d5..8d5ff4ecd4d 100644 --- a/reactos/dll/win32/shell32/brsfolder.c +++ b/reactos/dll/win32/shell32/brsfolder.c @@ -50,7 +50,7 @@ typedef struct tagbrowse_info typedef struct tagTV_ITEMDATA { LPSHELLFOLDER lpsfParent; /* IShellFolder of the parent */ - LPITEMIDLIST lpi; /* PIDL relativ to parent */ + LPITEMIDLIST lpi; /* PIDL relative to parent */ LPITEMIDLIST lpifq; /* Fully qualified PIDL */ IEnumIDList* pEnumIL; /* Children iterator */ } TV_ITEMDATA, *LPTV_ITEMDATA; @@ -245,7 +245,7 @@ static BOOL GetName(LPSHELLFOLDER lpsf, LPCITEMIDLIST lpi, DWORD dwFlags, LPWSTR * PARAMS * info [I] data for the dialog * lpsf [I] IShellFolder interface of the item's parent shell folder - * pidl [I] ITEMIDLIST of the child to insert, relativ to parent + * pidl [I] ITEMIDLIST of the child to insert, relative to parent * pidlParent [I] ITEMIDLIST of the parent shell folder * pEnumIL [I] Iterator for the children of the item to be inserted * hParent [I] The treeview-item that represents the parent shell folder diff --git a/reactos/dll/win32/shell32/shell32_main.c b/reactos/dll/win32/shell32/shell32_main.c index 5276621bc25..fa2f3a04bec 100644 --- a/reactos/dll/win32/shell32/shell32_main.c +++ b/reactos/dll/win32/shell32/shell32_main.c @@ -85,7 +85,6 @@ extern const char * const SHELL_Authors[]; LPWSTR* WINAPI CommandLineToArgvW(LPCWSTR lpCmdline, int* numargs) { DWORD argc; - HGLOBAL hargv; LPWSTR *argv; LPCWSTR cs; LPWSTR arg,s,d; @@ -97,20 +96,18 @@ LPWSTR* WINAPI CommandLineToArgvW(LPCWSTR lpCmdline, int* numargs) /* Return the path to the executable */ DWORD len, size=16; - hargv=GlobalAlloc(GMEM_FIXED, size); - argv=GlobalLock(hargv); + argv=LocalAlloc(LMEM_FIXED, size); for (;;) { len = GetModuleFileNameW(0, (LPWSTR)(argv+1), (size-sizeof(LPWSTR))/sizeof(WCHAR)); if (!len) { - GlobalFree(hargv); + LocalFree(argv); return NULL; } if (len < size) break; size*=2; - hargv=GlobalReAlloc(hargv, size, 0); - argv=GlobalLock(hargv); + argv=LocalReAlloc(argv, size, 0); } argv[0]=(LPWSTR)(argv+1); if (numargs) @@ -160,8 +157,7 @@ LPWSTR* WINAPI CommandLineToArgvW(LPCWSTR lpCmdline, int* numargs) /* Allocate in a single lump, the string array, and the strings that go with it. * This way the caller can make a single GlobalFree call to free both, as per MSDN. */ - hargv=GlobalAlloc(0, argc*sizeof(LPWSTR)+(strlenW(lpCmdline)+1)*sizeof(WCHAR)); - argv=GlobalLock(hargv); + argv=LocalAlloc(LMEM_FIXED, argc*sizeof(LPWSTR)+(strlenW(lpCmdline)+1)*sizeof(WCHAR)); if (!argv) return NULL; cmdline=(LPWSTR)(argv+argc); @@ -860,12 +856,16 @@ typedef struct /************************************************************************* * SHAppBarMessage [SHELL32.@] */ -UINT WINAPI SHAppBarMessage(DWORD msg, PAPPBARDATA data) +UINT_PTR WINAPI SHAppBarMessage(DWORD msg, PAPPBARDATA data) { int width=data->rc.right - data->rc.left; int height=data->rc.bottom - data->rc.top; RECT rec=data->rc; + TRACE("msg=%d, data={cb=%d, hwnd=%p, callback=%x, edge=%d, rc=%s, lparam=%lx}\n", + msg, data->cbSize, data->hWnd, data->uCallbackMessage, data->uEdge, + wine_dbgstr_rect(&data->rc), data->lParam); + switch (msg) { case ABM_GETSTATE: @@ -878,8 +878,7 @@ UINT WINAPI SHAppBarMessage(DWORD msg, PAPPBARDATA data) SetActiveWindow(data->hWnd); return TRUE; case ABM_GETAUTOHIDEBAR: - data->hWnd=GetActiveWindow(); - return TRUE; + return 0; /* pretend there is no autohide bar */ case ABM_NEW: /* cbSize, hWnd, and uCallbackMessage are used. All other ignored */ SetWindowPos(data->hWnd,HWND_TOP,0,0,0,0,SWP_SHOWWINDOW|SWP_NOMOVE|SWP_NOSIZE); diff --git a/reactos/include/psdk/shellapi.h b/reactos/include/psdk/shellapi.h index 6fd753bafb6..e952d5a0dff 100644 --- a/reactos/include/psdk/shellapi.h +++ b/reactos/include/psdk/shellapi.h @@ -318,7 +318,7 @@ UINT WINAPI ExtractIconExA(LPCSTR,int,HICON*,HICON*,UINT); UINT WINAPI ExtractIconExW(LPCWSTR,int,HICON*,HICON*,UINT); HINSTANCE WINAPI FindExecutableA(LPCSTR,LPCSTR,LPSTR); HINSTANCE WINAPI FindExecutableW(LPCWSTR,LPCWSTR,LPWSTR); -UINT WINAPI SHAppBarMessage(DWORD,PAPPBARDATA); +UINT_PTR WINAPI SHAppBarMessage(DWORD,PAPPBARDATA); BOOL WINAPI Shell_NotifyIconA(DWORD,PNOTIFYICONDATAA); BOOL WINAPI Shell_NotifyIconW(DWORD,PNOTIFYICONDATAW); int WINAPI ShellAboutA(HWND,LPCSTR,LPCSTR,HICON);