[PATCH] comdlg32: Avoid passing NULL to FILEDLG95_LOOKIN_InsertItemAfterParent.

Lei Zhang thestig at google.com
Thu Dec 4 16:57:34 CST 2008


Hi,

This is my second attempt to fix bug 16332. We can make sure
FILEDLG95_LOOKIN_InsertItemAfterParent() doesn't infinite loop by
always giving it a non-null pidl. The Desktop folder seems like a
sensible default.
-------------- next part --------------
From a6c3c0549d6f35da8fd7f2a7ed0c17a17390e695 Mon Sep 17 00:00:00 2001
From: Lei Zhang <thestig at google.com>
Date: Thu, 4 Dec 2008 14:52:18 -0800
Subject: [PATCH] comdlg32: Avoid passing NULL to FILEDLG95_LOOKIN_InsertItemAfterParent.

---
 dlls/comdlg32/filedlg.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/dlls/comdlg32/filedlg.c b/dlls/comdlg32/filedlg.c
index e1eedd1..0ea5284 100644
--- a/dlls/comdlg32/filedlg.c
+++ b/dlls/comdlg32/filedlg.c
@@ -2920,6 +2920,9 @@ int FILEDLG95_LOOKIN_SelectItem(HWND hwnd,LPITEMIDLIST pidl)
 
   TRACE("\n");
 
+  if (!pidl)
+      SHGetSpecialFolderLocation(0,CSIDL_DESKTOP,&pidl);
+
   iItemPos = FILEDLG95_LOOKIN_SearchItem(hwnd,(WPARAM)pidl,SEARCH_PIDL);
 
   liInfos = GetPropA(hwnd,LookInInfosStr);
-- 
1.5.4.5


More information about the wine-patches mailing list