mirror of
https://github.com/reactos/reactos.git
synced 2025-08-04 00:05:44 +00:00
[shell32.dll]
- Initialize uninitialized variables. - Add code to guard against potential NULL pointer dereferencing. Thanks to Amine Khaldi for pointing out all these. svn path=/branches/shell32_new-bringup/; revision=53633
This commit is contained in:
parent
ea0da4a0a3
commit
261ee4dd58
11 changed files with 1017 additions and 901 deletions
|
@ -147,8 +147,14 @@ HRESULT WINAPI CAutoComplete::Init(HWND hwndEdit, IUnknown *punkACL, LPCOLESTR p
|
||||||
|
|
||||||
/* pwszRegKeyPath contains the key as well as the value, so we split */
|
/* pwszRegKeyPath contains the key as well as the value, so we split */
|
||||||
key = (WCHAR *)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, (wcslen(pwzsRegKeyPath) + 1) * sizeof(WCHAR));
|
key = (WCHAR *)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, (wcslen(pwzsRegKeyPath) + 1) * sizeof(WCHAR));
|
||||||
|
|
||||||
|
if (key)
|
||||||
|
{
|
||||||
wcscpy(key, pwzsRegKeyPath);
|
wcscpy(key, pwzsRegKeyPath);
|
||||||
value = const_cast<WCHAR *>(strrchrW(key, '\\'));
|
value = const_cast<WCHAR *>(strrchrW(key, '\\'));
|
||||||
|
|
||||||
|
if (value)
|
||||||
|
{
|
||||||
*value = 0;
|
*value = 0;
|
||||||
value++;
|
value++;
|
||||||
/* Now value contains the value and buffer the key */
|
/* Now value contains the value and buffer the key */
|
||||||
|
@ -170,14 +176,31 @@ HRESULT WINAPI CAutoComplete::Init(HWND hwndEdit, IUnknown *punkACL, LPCOLESTR p
|
||||||
}
|
}
|
||||||
RegCloseKey(hKey);
|
RegCloseKey(hKey);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
HeapFree(GetProcessHeap(), 0, key);
|
HeapFree(GetProcessHeap(), 0, key);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
TRACE("HeapAlloc Failed when trying to alloca %d bytes\n", (wcslen(pwzsRegKeyPath) + 1) * sizeof(WCHAR));
|
||||||
|
return S_FALSE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if ((pwszQuickComplete) && (!quickComplete))
|
if ((pwszQuickComplete) && (!quickComplete))
|
||||||
{
|
{
|
||||||
quickComplete = (WCHAR *)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, (wcslen(pwszQuickComplete) + 1) * sizeof(WCHAR));
|
quickComplete = (WCHAR *)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, (wcslen(pwszQuickComplete) + 1) * sizeof(WCHAR));
|
||||||
|
|
||||||
|
if (quickComplete)
|
||||||
|
{
|
||||||
wcscpy(quickComplete, pwszQuickComplete);
|
wcscpy(quickComplete, pwszQuickComplete);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
TRACE("HeapAlloc Failed when trying to alloca %d bytes\n", (wcslen(pwszQuickComplete) + 1) * sizeof(WCHAR));
|
||||||
|
return S_FALSE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
@ -314,6 +337,8 @@ LRESULT APIENTRY CAutoComplete::ACEditSubclassProc(HWND hwnd, UINT uMsg, WPARAM
|
||||||
len = SendMessageW(pThis->hwndListBox, LB_GETTEXTLEN, sel, (LPARAM)NULL);
|
len = SendMessageW(pThis->hwndListBox, LB_GETTEXTLEN, sel, (LPARAM)NULL);
|
||||||
msg = (WCHAR *)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, (len + 1) * sizeof(WCHAR));
|
msg = (WCHAR *)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, (len + 1) * sizeof(WCHAR));
|
||||||
|
|
||||||
|
if (msg)
|
||||||
|
{
|
||||||
SendMessageW(pThis->hwndListBox, LB_GETTEXT, sel, (LPARAM)msg);
|
SendMessageW(pThis->hwndListBox, LB_GETTEXT, sel, (LPARAM)msg);
|
||||||
SendMessageW(hwnd, WM_SETTEXT, 0, (LPARAM)msg);
|
SendMessageW(hwnd, WM_SETTEXT, 0, (LPARAM)msg);
|
||||||
SendMessageW(hwnd, EM_SETSEL, wcslen(msg), wcslen(msg));
|
SendMessageW(hwnd, EM_SETSEL, wcslen(msg), wcslen(msg));
|
||||||
|
@ -321,6 +346,11 @@ LRESULT APIENTRY CAutoComplete::ACEditSubclassProc(HWND hwnd, UINT uMsg, WPARAM
|
||||||
HeapFree(GetProcessHeap(), 0, msg);
|
HeapFree(GetProcessHeap(), 0, msg);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
|
TRACE("HeapAlloc failed to allocate %d bytes\n", (len + 1) * sizeof(WCHAR));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
SendMessageW(hwnd, WM_SETTEXT, 0, (LPARAM)pThis->txtbackup);
|
SendMessageW(hwnd, WM_SETTEXT, 0, (LPARAM)pThis->txtbackup);
|
||||||
SendMessageW(hwnd, EM_SETSEL, wcslen(pThis->txtbackup), wcslen(pThis->txtbackup));
|
SendMessageW(hwnd, EM_SETSEL, wcslen(pThis->txtbackup), wcslen(pThis->txtbackup));
|
||||||
|
@ -362,9 +392,17 @@ LRESULT APIENTRY CAutoComplete::ACEditSubclassProc(HWND hwnd, UINT uMsg, WPARAM
|
||||||
SendMessageW(pThis->hwndListBox, LB_RESETCONTENT, 0, 0);
|
SendMessageW(pThis->hwndListBox, LB_RESETCONTENT, 0, 0);
|
||||||
|
|
||||||
HeapFree(GetProcessHeap(), 0, pThis->txtbackup);
|
HeapFree(GetProcessHeap(), 0, pThis->txtbackup);
|
||||||
pThis->txtbackup = (WCHAR *)HeapAlloc(GetProcessHeap(),
|
|
||||||
HEAP_ZERO_MEMORY, (wcslen(hwndText)+1)*sizeof(WCHAR));
|
pThis->txtbackup = (WCHAR *)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, (wcslen(hwndText)+1)*sizeof(WCHAR));
|
||||||
|
|
||||||
|
if (pThis->txtbackup)
|
||||||
|
{
|
||||||
wcscpy(pThis->txtbackup, hwndText);
|
wcscpy(pThis->txtbackup, hwndText);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
TRACE("HeapAlloc failed to allocate %d bytes\n", (wcslen(hwndText)+1)*sizeof(WCHAR));
|
||||||
|
}
|
||||||
|
|
||||||
/* Returns if there is no text to search and we doesn't want to display all the entries */
|
/* Returns if there is no text to search and we doesn't want to display all the entries */
|
||||||
if ((!displayall) && (! *hwndText) )
|
if ((!displayall) && (! *hwndText) )
|
||||||
|
@ -454,12 +492,19 @@ LRESULT APIENTRY CAutoComplete::ACLBoxSubclassProc(HWND hwnd, UINT uMsg, WPARAM
|
||||||
len = SendMessageW(pThis->hwndListBox, LB_GETTEXTLEN, sel, 0);
|
len = SendMessageW(pThis->hwndListBox, LB_GETTEXTLEN, sel, 0);
|
||||||
msg = (WCHAR *)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, (len + 1) * sizeof(WCHAR));
|
msg = (WCHAR *)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, (len + 1) * sizeof(WCHAR));
|
||||||
|
|
||||||
|
if (msg)
|
||||||
|
{
|
||||||
SendMessageW(hwnd, LB_GETTEXT, sel, (LPARAM)msg);
|
SendMessageW(hwnd, LB_GETTEXT, sel, (LPARAM)msg);
|
||||||
SendMessageW(pThis->hwndEdit, WM_SETTEXT, 0, (LPARAM)msg);
|
SendMessageW(pThis->hwndEdit, WM_SETTEXT, 0, (LPARAM)msg);
|
||||||
SendMessageW(pThis->hwndEdit, EM_SETSEL, 0, wcslen(msg));
|
SendMessageW(pThis->hwndEdit, EM_SETSEL, 0, wcslen(msg));
|
||||||
ShowWindow(hwnd, SW_HIDE);
|
ShowWindow(hwnd, SW_HIDE);
|
||||||
|
|
||||||
HeapFree(GetProcessHeap(), 0, msg);
|
HeapFree(GetProcessHeap(), 0, msg);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
TRACE("HeapAlloc failed to allocate %d bytes\n", (len + 1) * sizeof(WCHAR));
|
||||||
|
}
|
||||||
|
|
||||||
}; break;
|
}; break;
|
||||||
|
|
||||||
|
|
|
@ -340,7 +340,11 @@ BOOL pcheck( LPCITEMIDLIST pidl )
|
||||||
|
|
||||||
while( pidltemp && pidltemp->mkid.cb )
|
while( pidltemp && pidltemp->mkid.cb )
|
||||||
{
|
{
|
||||||
type = _dbg_ILGetDataPointer(pidltemp)->type;
|
LPPIDLDATA pidlData = _dbg_ILGetDataPointer(pidltemp);
|
||||||
|
|
||||||
|
if (pidlData)
|
||||||
|
{
|
||||||
|
type = pidlData->type;
|
||||||
switch( type )
|
switch( type )
|
||||||
{
|
{
|
||||||
case PT_CPLAPPLET:
|
case PT_CPLAPPLET:
|
||||||
|
@ -371,6 +375,11 @@ BOOL pcheck( LPCITEMIDLIST pidl )
|
||||||
}
|
}
|
||||||
pidltemp = _dbg_ILGetNext(pidltemp);
|
pidltemp = _dbg_ILGetNext(pidltemp);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
}
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -22,14 +22,14 @@
|
||||||
|
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
HWND hwndOwner ;
|
HWND hwndOwner ;
|
||||||
HICON hIcon ;
|
HICON hIcon ;
|
||||||
LPCWSTR lpstrDirectory ;
|
LPCWSTR lpstrDirectory ;
|
||||||
LPCWSTR lpstrTitle ;
|
LPCWSTR lpstrTitle ;
|
||||||
LPCWSTR lpstrDescription ;
|
LPCWSTR lpstrDescription ;
|
||||||
UINT uFlags ;
|
UINT uFlags ;
|
||||||
} RUNFILEDLGPARAMS ;
|
} RUNFILEDLGPARAMS ;
|
||||||
|
|
||||||
typedef BOOL (WINAPI * LPFNOFN) (OPENFILENAMEW *) ;
|
typedef BOOL (WINAPI * LPFNOFN) (OPENFILENAMEW *) ;
|
||||||
|
|
||||||
|
@ -309,6 +309,12 @@ static LPWSTR RunDlg_GetParentDir(LPCWSTR cmdline)
|
||||||
|
|
||||||
result = (WCHAR *)HeapAlloc(GetProcessHeap(), 0, sizeof(WCHAR)*(strlenW(cmdline)+5));
|
result = (WCHAR *)HeapAlloc(GetProcessHeap(), 0, sizeof(WCHAR)*(strlenW(cmdline)+5));
|
||||||
|
|
||||||
|
if (NULL == result)
|
||||||
|
{
|
||||||
|
TRACE("HeapAlloc couldn't allocate %d bytes\n", sizeof(WCHAR)*(strlenW(cmdline)+5));
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
src = cmdline;
|
src = cmdline;
|
||||||
dest = result;
|
dest = result;
|
||||||
|
|
||||||
|
@ -404,6 +410,9 @@ static INT_PTR CALLBACK RunDlgProc (HWND hwnd, UINT message, WPARAM wParam, LPAR
|
||||||
ZeroMemory (&sei, sizeof(sei)) ;
|
ZeroMemory (&sei, sizeof(sei)) ;
|
||||||
sei.cbSize = sizeof(sei) ;
|
sei.cbSize = sizeof(sei) ;
|
||||||
psz = (WCHAR *)HeapAlloc( GetProcessHeap(), 0, (ic + 1)*sizeof(WCHAR) );
|
psz = (WCHAR *)HeapAlloc( GetProcessHeap(), 0, (ic + 1)*sizeof(WCHAR) );
|
||||||
|
|
||||||
|
if (psz)
|
||||||
|
{
|
||||||
GetWindowTextW (htxt, psz, ic + 1) ;
|
GetWindowTextW (htxt, psz, ic + 1) ;
|
||||||
|
|
||||||
/* according to http://www.codeproject.com/KB/shell/runfiledlg.aspx we should send a
|
/* according to http://www.codeproject.com/KB/shell/runfiledlg.aspx we should send a
|
||||||
|
@ -435,6 +444,7 @@ static INT_PTR CALLBACK RunDlgProc (HWND hwnd, UINT message, WPARAM wParam, LPAR
|
||||||
EndDialog (hwnd, 0);
|
EndDialog (hwnd, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
case IDCANCEL :
|
case IDCANCEL :
|
||||||
EndDialog (hwnd, 0) ;
|
EndDialog (hwnd, 0) ;
|
||||||
|
@ -491,7 +501,7 @@ static INT_PTR CALLBACK RunDlgProc (HWND hwnd, UINT message, WPARAM wParam, LPAR
|
||||||
/* This grabs the MRU list from the registry and fills the combo for the "Run" dialog above */
|
/* This grabs the MRU list from the registry and fills the combo for the "Run" dialog above */
|
||||||
/* fShowDefault ignored if pszLatest != NULL */
|
/* fShowDefault ignored if pszLatest != NULL */
|
||||||
static void FillList (HWND hCb, char *pszLatest, BOOL fShowDefault)
|
static void FillList (HWND hCb, char *pszLatest, BOOL fShowDefault)
|
||||||
{
|
{
|
||||||
HKEY hkey ;
|
HKEY hkey ;
|
||||||
/* char szDbgMsg[256] = "" ; */
|
/* char szDbgMsg[256] = "" ; */
|
||||||
char *pszList = NULL, *pszCmd = NULL, cMatch = 0, cMax = 0x60, szIndex[2] = "-" ;
|
char *pszList = NULL, *pszCmd = NULL, cMatch = 0, cMax = 0x60, szIndex[2] = "-" ;
|
||||||
|
@ -510,8 +520,16 @@ static void FillList (HWND hCb, char *pszLatest, BOOL fShowDefault)
|
||||||
if (icList > 0)
|
if (icList > 0)
|
||||||
{
|
{
|
||||||
pszList = (char *)HeapAlloc( GetProcessHeap(), 0, icList) ;
|
pszList = (char *)HeapAlloc( GetProcessHeap(), 0, icList) ;
|
||||||
|
|
||||||
|
if (pszList)
|
||||||
|
{
|
||||||
if (ERROR_SUCCESS != RegQueryValueExA (hkey, "MRUList", NULL, NULL, (LPBYTE)pszList, &icList))
|
if (ERROR_SUCCESS != RegQueryValueExA (hkey, "MRUList", NULL, NULL, (LPBYTE)pszList, &icList))
|
||||||
MessageBoxA (hCb, "Unable to grab MRUList !", "Nix", MB_OK) ;
|
MessageBoxA (hCb, "Unable to grab MRUList !", "Nix", MB_OK);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
TRACE("HeapAlloc failed to allocate %d bytes\n", icList);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -567,7 +585,6 @@ static void FillList (HWND hCb, char *pszLatest, BOOL fShowDefault)
|
||||||
SetWindowTextA (hCb, pszCmd) ;
|
SetWindowTextA (hCb, pszCmd) ;
|
||||||
SendMessageA (hCb, CB_SETEDITSEL, 0, MAKELPARAM (0, -1)) ;
|
SendMessageA (hCb, CB_SETEDITSEL, 0, MAKELPARAM (0, -1)) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -598,21 +615,29 @@ static void FillList (HWND hCb, char *pszLatest, BOOL fShowDefault)
|
||||||
SendMessageA (hCb, CB_SETEDITSEL, 0, MAKELPARAM (0, -1)) ;
|
SendMessageA (hCb, CB_SETEDITSEL, 0, MAKELPARAM (0, -1)) ;
|
||||||
|
|
||||||
cMatch = ++cMax ;
|
cMatch = ++cMax ;
|
||||||
if( pszList )
|
if (pszList)
|
||||||
pszList = (char *)HeapReAlloc(GetProcessHeap(), 0, pszList, ++icList) ;
|
pszList = (char *)HeapReAlloc(GetProcessHeap(), 0, pszList, ++icList) ;
|
||||||
else
|
else
|
||||||
pszList = (char *)HeapAlloc(GetProcessHeap(), 0, ++icList) ;
|
pszList = (char *)HeapAlloc(GetProcessHeap(), 0, ++icList) ;
|
||||||
|
|
||||||
|
if (pszList)
|
||||||
|
{
|
||||||
memmove (&pszList[1], pszList, icList - 1) ;
|
memmove (&pszList[1], pszList, icList - 1) ;
|
||||||
pszList[0] = cMatch ;
|
pszList[0] = cMatch ;
|
||||||
szIndex[0] = cMatch ;
|
szIndex[0] = cMatch ;
|
||||||
RegSetValueExA (hkey, szIndex, 0, REG_SZ, (LPBYTE)pszLatest, strlen (pszLatest) + 1) ;
|
RegSetValueExA (hkey, szIndex, 0, REG_SZ, (LPBYTE)pszLatest, strlen (pszLatest) + 1) ;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
TRACE("HeapAlloc or HeapReAlloc failed to allocate enough bytes\n");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
RegSetValueExA (hkey, "MRUList", 0, REG_SZ, (LPBYTE)pszList, strlen (pszList) + 1) ;
|
RegSetValueExA (hkey, "MRUList", 0, REG_SZ, (LPBYTE)pszList, strlen (pszList) + 1) ;
|
||||||
|
|
||||||
HeapFree( GetProcessHeap(), 0, pszCmd) ;
|
HeapFree( GetProcessHeap(), 0, pszCmd) ;
|
||||||
HeapFree( GetProcessHeap(), 0, pszList) ;
|
HeapFree( GetProcessHeap(), 0, pszList) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************
|
/*************************************************************************
|
||||||
|
|
|
@ -101,8 +101,11 @@ BOOL IEnumIDListImpl::DeleteList()
|
||||||
BOOL IEnumIDListImpl::HasItemWithCLSID(LPITEMIDLIST pidl)
|
BOOL IEnumIDListImpl::HasItemWithCLSID(LPITEMIDLIST pidl)
|
||||||
{
|
{
|
||||||
ENUMLIST *pCur;
|
ENUMLIST *pCur;
|
||||||
REFIID refid = *_ILGetGUIDPointer(pidl);
|
IID *ptr = _ILGetGUIDPointer(pidl);
|
||||||
|
|
||||||
|
if (ptr)
|
||||||
|
{
|
||||||
|
REFIID refid = *ptr;
|
||||||
pCur = mpFirst;
|
pCur = mpFirst;
|
||||||
|
|
||||||
while(pCur)
|
while(pCur)
|
||||||
|
@ -114,6 +117,8 @@ BOOL IEnumIDListImpl::HasItemWithCLSID(LPITEMIDLIST pidl)
|
||||||
}
|
}
|
||||||
pCur = pCur->pNext;
|
pCur = pCur->pNext;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -179,6 +184,7 @@ BOOL IEnumIDListImpl::CreateFolderEnumList(
|
||||||
} while (succeeded && !findFinished);
|
} while (succeeded && !findFinished);
|
||||||
FindClose(hFile);
|
FindClose(hFile);
|
||||||
}
|
}
|
||||||
|
|
||||||
return succeeded;
|
return succeeded;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -77,6 +77,8 @@ CDrivesFolderEnum::~CDrivesFolderEnum()
|
||||||
|
|
||||||
HRESULT WINAPI CDrivesFolderEnum::Initialize(HWND hwndOwner, DWORD dwFlags)
|
HRESULT WINAPI CDrivesFolderEnum::Initialize(HWND hwndOwner, DWORD dwFlags)
|
||||||
{
|
{
|
||||||
|
DbgPrint("[shell32, CDrivesFolderEnum::Initialize] Called with flags = %d\n", dwFlags);
|
||||||
|
|
||||||
if (CreateMyCompEnumList(dwFlags) == FALSE)
|
if (CreateMyCompEnumList(dwFlags) == FALSE)
|
||||||
return E_FAIL;
|
return E_FAIL;
|
||||||
return S_OK;
|
return S_OK;
|
||||||
|
@ -97,6 +99,8 @@ BOOL CDrivesFolderEnum::CreateMyCompEnumList(DWORD dwFlags)
|
||||||
|
|
||||||
TRACE("(%p)->(flags=0x%08x)\n", this, dwFlags);
|
TRACE("(%p)->(flags=0x%08x)\n", this, dwFlags);
|
||||||
|
|
||||||
|
DbgPrint("[shell32, CDrivesFolderEnum::CreateMyCompEnumList] Called with flags = %d\n", dwFlags);
|
||||||
|
|
||||||
/* enumerate the folders */
|
/* enumerate the folders */
|
||||||
if (dwFlags & SHCONTF_FOLDERS)
|
if (dwFlags & SHCONTF_FOLDERS)
|
||||||
{
|
{
|
||||||
|
@ -114,7 +118,8 @@ BOOL CDrivesFolderEnum::CreateMyCompEnumList(DWORD dwFlags)
|
||||||
}
|
}
|
||||||
|
|
||||||
TRACE("-- (%p)-> enumerate (mycomputer shell extensions)\n", this);
|
TRACE("-- (%p)-> enumerate (mycomputer shell extensions)\n", this);
|
||||||
for (i=0; i<2; i++) {
|
for (i=0; i<2; i++)
|
||||||
|
{
|
||||||
if (ret && !RegOpenKeyExW(i == 0 ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER,
|
if (ret && !RegOpenKeyExW(i == 0 ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER,
|
||||||
MyComputer_NameSpaceW, 0, KEY_READ, &hkey))
|
MyComputer_NameSpaceW, 0, KEY_READ, &hkey))
|
||||||
{
|
{
|
||||||
|
@ -255,18 +260,26 @@ HRESULT WINAPI CDrivesFolder::EnumObjects (HWND hwndOwner, DWORD dwFlags, LPENUM
|
||||||
|
|
||||||
TRACE ("(%p)->(HWND=%p flags=0x%08x pplist=%p)\n", this, hwndOwner, dwFlags, ppEnumIDList);
|
TRACE ("(%p)->(HWND=%p flags=0x%08x pplist=%p)\n", this, hwndOwner, dwFlags, ppEnumIDList);
|
||||||
|
|
||||||
|
DbgPrint("[shell32, CDrivesFolder::EnumObjects] Called with flags = %d\n", dwFlags);
|
||||||
|
|
||||||
if (ppEnumIDList == NULL)
|
if (ppEnumIDList == NULL)
|
||||||
return E_POINTER;
|
return E_POINTER;
|
||||||
|
|
||||||
*ppEnumIDList = NULL;
|
*ppEnumIDList = NULL;
|
||||||
ATLTRY (theEnumerator = new CComObject<CDrivesFolderEnum>);
|
ATLTRY (theEnumerator = new CComObject<CDrivesFolderEnum>);
|
||||||
|
|
||||||
if (theEnumerator == NULL)
|
if (theEnumerator == NULL)
|
||||||
return E_OUTOFMEMORY;
|
return E_OUTOFMEMORY;
|
||||||
|
|
||||||
hResult = theEnumerator->QueryInterface (IID_IEnumIDList, (void **)&result);
|
hResult = theEnumerator->QueryInterface (IID_IEnumIDList, (void **)&result);
|
||||||
if (FAILED (hResult))
|
if (FAILED (hResult))
|
||||||
{
|
{
|
||||||
delete theEnumerator;
|
delete theEnumerator;
|
||||||
return hResult;
|
return hResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DbgPrint("[shell32, CDrivesFolder::EnumObjects] Calling theEnumerator->Initialize\n");
|
||||||
|
|
||||||
hResult = theEnumerator->Initialize (hwndOwner, dwFlags);
|
hResult = theEnumerator->Initialize (hwndOwner, dwFlags);
|
||||||
if (FAILED (hResult))
|
if (FAILED (hResult))
|
||||||
return hResult;
|
return hResult;
|
||||||
|
|
|
@ -327,6 +327,7 @@ CPrinterFolder::CPrinterFolder()
|
||||||
{
|
{
|
||||||
pidlRoot = NULL;
|
pidlRoot = NULL;
|
||||||
dwAttributes = 0;
|
dwAttributes = 0;
|
||||||
|
pclsid = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
CPrinterFolder::~CPrinterFolder()
|
CPrinterFolder::~CPrinterFolder()
|
||||||
|
|
|
@ -20,6 +20,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <precomp.h>
|
#include <precomp.h>
|
||||||
|
#include <windef.h>
|
||||||
|
|
||||||
WINE_DEFAULT_DEBUG_CHANNEL(exec);
|
WINE_DEFAULT_DEBUG_CHANNEL(exec);
|
||||||
|
|
||||||
|
|
|
@ -660,7 +660,7 @@ IDefaultContextMenuImpl::AddStaticContextMenusToMenu(
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
TRACE("Failed to laod string, defaulting to default (NULL) value for mii.dwTypeData\n");
|
TRACE("Failed to load string, defaulting to NULL value for mii.dwTypeData\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -87,6 +87,21 @@ GetKeyDescription(LPWSTR szKeyName, LPWSTR szResult)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CNewMenu::UnloadItem(SHELLNEW_ITEM *item)
|
||||||
|
{
|
||||||
|
// bail if the item is clearly invalid
|
||||||
|
if (NULL == item)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (NULL != item->szTarget)
|
||||||
|
free(item->szTarget);
|
||||||
|
|
||||||
|
free(item->szDesc);
|
||||||
|
free(item->szIcon);
|
||||||
|
free(item->szExt);
|
||||||
|
|
||||||
|
HeapFree(GetProcessHeap(), 0, item);
|
||||||
|
}
|
||||||
|
|
||||||
CNewMenu::SHELLNEW_ITEM *CNewMenu::LoadItem(LPWSTR szKeyName)
|
CNewMenu::SHELLNEW_ITEM *CNewMenu::LoadItem(LPWSTR szKeyName)
|
||||||
{
|
{
|
||||||
|
|
|
@ -56,6 +56,7 @@ public:
|
||||||
CNewMenu();
|
CNewMenu();
|
||||||
~CNewMenu();
|
~CNewMenu();
|
||||||
SHELLNEW_ITEM *LoadItem(LPWSTR szKeyName);
|
SHELLNEW_ITEM *LoadItem(LPWSTR szKeyName);
|
||||||
|
void UnloadItem(SHELLNEW_ITEM *item);
|
||||||
BOOL LoadShellNewItems();
|
BOOL LoadShellNewItems();
|
||||||
UINT InsertShellNewItems(HMENU hMenu, UINT idFirst, UINT idMenu);
|
UINT InsertShellNewItems(HMENU hMenu, UINT idFirst, UINT idMenu);
|
||||||
HRESULT DoShellNewCmd(LPCMINVOKECOMMANDINFO lpcmi);
|
HRESULT DoShellNewCmd(LPCMINVOKECOMMANDINFO lpcmi);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue