mirror of
https://github.com/reactos/reactos.git
synced 2025-02-22 16:36:33 +00:00
Huw Davies : shell32: ABM_GETAUTOHIDEBAR should return a HWND or NULL
Alexander Nicolaysen Sørnes : shell32: Use LocalFree in CommandLineToArgvW. Rob Shearman : shell32: Memory allocated by CommandLineToArgvW should be that got from LocalAlloc/ LocalReAlloc, not from GlobalAlloc. svn path=/trunk/; revision=32582
This commit is contained in:
parent
ac8b86183a
commit
4e8e7ffccd
4 changed files with 14 additions and 15 deletions
|
@ -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)) {
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue