From 6235c076a4ea9d1ac1e1e6ae8dba1a192fa0ff2d Mon Sep 17 00:00:00 2001 From: Michael Jung Date: Mon, 22 Aug 2005 18:56:36 +0000 Subject: [PATCH] Initialize all members in UnixFolder constructor. Support NULL value pidls in GetDisplayNameOf method. --- dlls/shell32/shfldr_unixfs.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dlls/shell32/shfldr_unixfs.c b/dlls/shell32/shfldr_unixfs.c index a10c67d2ce3..288be55d580 100644 --- a/dlls/shell32/shfldr_unixfs.c +++ b/dlls/shell32/shfldr_unixfs.c @@ -798,7 +798,7 @@ static HRESULT WINAPI UnixFolder_IShellFolder2_GetDisplayNameOf(IShellFolder2* i if ((GET_SHGDN_FOR(uFlags) & SHGDN_FORPARSING) && (GET_SHGDN_RELATION(uFlags) != SHGDN_INFOLDER)) { - if (!pidl->mkid.cb) { + if (!pidl || !pidl->mkid.cb) { lpName->uType = STRRET_CSTR; if (This->m_dwPathMode == PATHMODE_UNIX) { strcpy(lpName->u.cStr, This->m_pszPath); @@ -1523,7 +1523,9 @@ static HRESULT CreateUnixFolder(IUnknown *pUnkOuter, REFIID riid, LPVOID *ppv, D pUnixFolder->lpISFHelperVtbl = &UnixFolder_ISFHelper_Vtbl; pUnixFolder->m_cRef = 0; pUnixFolder->m_pszPath = NULL; + pUnixFolder->m_pidlLocation = NULL; pUnixFolder->m_dwPathMode = dwPathMode; + pUnixFolder->m_dwAttributes = 0; pUnixFolder->m_pCLSID = pCLSID; UnixFolder_IShellFolder2_AddRef(STATIC_CAST(IShellFolder2, pUnixFolder));