mirror of
https://github.com/reactos/reactos.git
synced 2025-05-17 16:27:00 +00:00
[EXPLORER-NEW]
* Cleanup in case of error. CID 1248426 [RSHELL] * Add uninitialized class fields. CID 1248477 * Avoid leaking memory. CID 1248438 [BROWSEUI] * Fix potential overwriting of a variable. CID 716363 * Save the rshell handle instead of loading it every time. CID 1248435 * Fix leaked PIDL. CID 1248418 [SHELL32] * Fix GCC build. And one small nickpick that has been bothering me for a long time. svn path=/branches/shell-experiments/; revision=64864
This commit is contained in:
parent
96cdae0a7c
commit
9abc368186
7 changed files with 31 additions and 18 deletions
|
@ -61,7 +61,7 @@ HRESULT InitShellServices(HDPA * phdpa)
|
||||||
HRESULT hr = S_OK;
|
HRESULT hr = S_OK;
|
||||||
int count = 0;
|
int count = 0;
|
||||||
|
|
||||||
hdpa = DPA_Create(5);
|
*phdpa = NULL;
|
||||||
|
|
||||||
TRACE("Enumerating Shell Service Ojbect GUIDs...\n");
|
TRACE("Enumerating Shell Service Ojbect GUIDs...\n");
|
||||||
|
|
||||||
|
@ -73,6 +73,8 @@ HRESULT InitShellServices(HDPA * phdpa)
|
||||||
return HRESULT_FROM_WIN32(GetLastError());
|
return HRESULT_FROM_WIN32(GetLastError());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
hdpa = DPA_Create(5);
|
||||||
|
|
||||||
/* Enumerate */
|
/* Enumerate */
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
|
|
|
@ -35,8 +35,11 @@ HRESULT WINAPI CMenuDeskBar_Constructor(REFIID riid, LPVOID *ppv)
|
||||||
|
|
||||||
CMenuDeskBar::CMenuDeskBar() :
|
CMenuDeskBar::CMenuDeskBar() :
|
||||||
m_Client(NULL),
|
m_Client(NULL),
|
||||||
|
m_ClientWindow(NULL),
|
||||||
|
m_IconSize(0),
|
||||||
m_Banner(NULL),
|
m_Banner(NULL),
|
||||||
m_Shown(FALSE)
|
m_Shown(FALSE),
|
||||||
|
m_ShowFlags(0)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1191,7 +1191,10 @@ HRESULT CMenuStaticToolbar::FillToolbar(BOOL clearFirst)
|
||||||
|
|
||||||
HRESULT hr = m_menuBand->_CallCBWithItemId(info.wID, SMC_GETINFO, 0, reinterpret_cast<LPARAM>(sminfo));
|
HRESULT hr = m_menuBand->_CallCBWithItemId(info.wID, SMC_GETINFO, 0, reinterpret_cast<LPARAM>(sminfo));
|
||||||
if (FAILED_UNEXPECTEDLY(hr))
|
if (FAILED_UNEXPECTEDLY(hr))
|
||||||
|
{
|
||||||
|
delete sminfo;
|
||||||
return hr;
|
return hr;
|
||||||
|
}
|
||||||
|
|
||||||
AddButton(info.wID, info.dwTypeData, info.hSubMenu != NULL, sminfo->iIcon, reinterpret_cast<DWORD_PTR>(sminfo), last);
|
AddButton(info.wID, info.dwTypeData, info.hSubMenu != NULL, sminfo->iIcon, reinterpret_cast<DWORD_PTR>(sminfo), last);
|
||||||
|
|
||||||
|
|
|
@ -337,7 +337,6 @@ HRESULT STDMETHODCALLTYPE CBandSiteBase::AddBand(IUnknown *punk)
|
||||||
/* Initialize the added bands */
|
/* Initialize the added bands */
|
||||||
memset(&NewBand[fBandsAllocated], 0, (NewAllocated - fBandsAllocated) * sizeof(struct BandObject));
|
memset(&NewBand[fBandsAllocated], 0, (NewAllocated - fBandsAllocated) * sizeof(struct BandObject));
|
||||||
|
|
||||||
NewBand = &fBands[fBandsAllocated];
|
|
||||||
fBandsAllocated = NewAllocated;
|
fBandsAllocated = NewAllocated;
|
||||||
CoTaskMemFree(fBands);
|
CoTaskMemFree(fBands);
|
||||||
fBands = NewBand;
|
fBands = NewBand;
|
||||||
|
|
|
@ -30,6 +30,7 @@ toolbar, and address band for an explorer window
|
||||||
#define GET_Y_LPARAM(lp) ((int)(short)HIWORD(lp))
|
#define GET_Y_LPARAM(lp) ((int)(short)HIWORD(lp))
|
||||||
|
|
||||||
#define USE_CUSTOM_MENUBAND 1
|
#define USE_CUSTOM_MENUBAND 1
|
||||||
|
HMODULE g_hRShell = NULL;
|
||||||
|
|
||||||
#if 1
|
#if 1
|
||||||
// TODO: declare these GUIDs and interfaces in the right place (whatever that may be)
|
// TODO: declare these GUIDs and interfaces in the right place (whatever that may be)
|
||||||
|
@ -729,13 +730,13 @@ HRESULT CInternetToolbar::CreateMenuBar(IShellMenu **pMenuBar)
|
||||||
|
|
||||||
hResult = E_FAIL;
|
hResult = E_FAIL;
|
||||||
#if USE_CUSTOM_MENUBAND
|
#if USE_CUSTOM_MENUBAND
|
||||||
HMODULE hrs = GetModuleHandleW(L"rshell.dll");
|
if (!g_hRShell) g_hRShell = GetModuleHandleW(L"rshell.dll");
|
||||||
|
|
||||||
if (!hrs) hrs = LoadLibraryW(L"rshell.dll");
|
if (!g_hRShell) g_hRShell = LoadLibraryW(L"rshell.dll");
|
||||||
|
|
||||||
if (hrs)
|
if (g_hRShell)
|
||||||
{
|
{
|
||||||
PMENUBAND_CONSTRUCTOR func = (PMENUBAND_CONSTRUCTOR) GetProcAddress(hrs, "CMenuBand_Constructor");
|
PMENUBAND_CONSTRUCTOR func = (PMENUBAND_CONSTRUCTOR) GetProcAddress(g_hRShell, "CMenuBand_Constructor");
|
||||||
if (func)
|
if (func)
|
||||||
{
|
{
|
||||||
hResult = func(IID_PPV_ARG(IShellMenu, &menubar));
|
hResult = func(IID_PPV_ARG(IShellMenu, &menubar));
|
||||||
|
|
|
@ -897,28 +897,32 @@ HRESULT IEGetNameAndFlagsEx(LPITEMIDLIST pidl, SHGDNF uFlags, long param10,
|
||||||
LPWSTR pszBuf, UINT cchBuf, SFGAOF *rgfInOut)
|
LPWSTR pszBuf, UINT cchBuf, SFGAOF *rgfInOut)
|
||||||
{
|
{
|
||||||
CComPtr<IShellFolder> parentFolder;
|
CComPtr<IShellFolder> parentFolder;
|
||||||
LPITEMIDLIST childPIDL;
|
LPITEMIDLIST childPIDL = NULL;
|
||||||
STRRET L108;
|
STRRET L108;
|
||||||
HRESULT hResult;
|
HRESULT hResult;
|
||||||
|
|
||||||
hResult = SHBindToFolderIDListParent(NULL, pidl, &IID_PPV_ARG(IShellFolder, &parentFolder), &childPIDL);
|
hResult = SHBindToFolderIDListParent(NULL, pidl, &IID_PPV_ARG(IShellFolder, &parentFolder), &childPIDL);
|
||||||
if (FAILED(hResult))
|
if (FAILED(hResult))
|
||||||
return hResult;
|
goto cleanup;
|
||||||
|
|
||||||
hResult = parentFolder->GetDisplayNameOf(childPIDL, uFlags, &L108);
|
hResult = parentFolder->GetDisplayNameOf(childPIDL, uFlags, &L108);
|
||||||
if (FAILED(hResult))
|
if (FAILED(hResult))
|
||||||
return hResult;
|
goto cleanup;
|
||||||
|
|
||||||
StrRetToBufW(&L108, childPIDL, pszBuf, cchBuf);
|
StrRetToBufW(&L108, childPIDL, pszBuf, cchBuf);
|
||||||
if (rgfInOut)
|
if (rgfInOut)
|
||||||
{
|
{
|
||||||
hResult = parentFolder->GetAttributesOf(1, const_cast<LPCITEMIDLIST *>(&childPIDL), rgfInOut);
|
hResult = parentFolder->GetAttributesOf(1, const_cast<LPCITEMIDLIST *>(&childPIDL), rgfInOut);
|
||||||
if (FAILED(hResult))
|
if (FAILED(hResult))
|
||||||
return hResult;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
ILFree(childPIDL);
|
hResult = S_OK;
|
||||||
return S_OK;
|
|
||||||
|
cleanup:
|
||||||
|
if (childPIDL)
|
||||||
|
ILFree(childPIDL);
|
||||||
|
return hResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
long IEGetNameAndFlags(LPITEMIDLIST pidl, SHGDNF uFlags, LPWSTR pszBuf, UINT cchBuf, SFGAOF *rgfInOut)
|
long IEGetNameAndFlags(LPITEMIDLIST pidl, SHGDNF uFlags, LPWSTR pszBuf, UINT cchBuf, SFGAOF *rgfInOut)
|
||||||
|
|
|
@ -59,7 +59,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(shell);
|
||||||
static const WCHAR SV_CLASS_NAME[] = {'S', 'H', 'E', 'L', 'L', 'D', 'L', 'L', '_', 'D', 'e', 'f', 'V', 'i', 'e', 'w', 0};
|
static const WCHAR SV_CLASS_NAME[] = {'S', 'H', 'E', 'L', 'L', 'D', 'L', 'L', '_', 'D', 'e', 'f', 'V', 'i', 'e', 'w', 0};
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{ BOOL bIsAscending;
|
{
|
||||||
|
BOOL bIsAscending;
|
||||||
INT nHeaderID;
|
INT nHeaderID;
|
||||||
INT nLastHeaderID;
|
INT nLastHeaderID;
|
||||||
} LISTVIEW_SORT_INFO, *LPLISTVIEW_SORT_INFO;
|
} LISTVIEW_SORT_INFO, *LPLISTVIEW_SORT_INFO;
|
||||||
|
@ -358,10 +359,10 @@ CDefView::CDefView() :
|
||||||
m_isEditing(FALSE),
|
m_isEditing(FALSE),
|
||||||
m_hView(NULL)
|
m_hView(NULL)
|
||||||
{
|
{
|
||||||
m_FolderSettings = { 0 };
|
ZeroMemory(&m_FolderSettings, sizeof(m_FolderSettings));
|
||||||
m_sortInfo = { 0 };
|
ZeroMemory(&m_sortInfo, sizeof(m_sortInfo));
|
||||||
m_ptLastMousePos = { 0 };
|
ZeroMemory(&m_ptLastMousePos, sizeof(m_ptLastMousePos));
|
||||||
m_Category = { 0 };
|
ZeroMemory(&m_Category, sizeof(m_Category));
|
||||||
}
|
}
|
||||||
|
|
||||||
CDefView::~CDefView()
|
CDefView::~CDefView()
|
||||||
|
|
Loading…
Reference in a new issue