Hi,
> I meant that you should remove the dwAttributes member from
> IGenericFSFolder and call SHELL32_GetItemAttributes in shfldr_fs's
> GetAttributesOf method passing the rfgInOut parameter. You don't have to
> modify the Initialize[Ex] methods.
>
> That said, this is the preferable option in my opinion. At the end of the
> day, it's up to you (or in effect Alexandre).
Done so, see the attached patch. No crash, Word is happy. If the folder I want 
to write to _is_ write protected, the new code also doesn't return the write 
protection flag, but it looks like Win2k does the same for write protected 
folders on VFAT file systems(haven't tested ntfs)

Any further suggestions? If not, I'll modify the other shflrds and send a 
patch to wine-patches ;-)

Greetings,
Stefan
Index: shfldr_fs.c
===================================================================
RCS file: /home/wine/wine/dlls/shell32/shfldr_fs.c,v
retrieving revision 1.40
diff -u -r1.40 shfldr_fs.c
--- shfldr_fs.c	23 May 2005 16:31:42 -0000	1.40
+++ shfldr_fs.c	26 May 2005 09:11:09 -0000
@@ -76,8 +76,6 @@
 
     LPITEMIDLIST pidlRoot; /* absolute pidl */
 
-    int dwAttributes;      /* attributes returned by GetAttributesOf FIXME: use it */
-
     UINT cfShellIDList;    /* clipboardformat for IDropTarget */
     BOOL fAcceptFmt;       /* flag for pending Drop */
 } IGenericSFImpl;
@@ -575,6 +573,8 @@
     _ICOM_THIS_From_IShellFolder2 (IGenericSFImpl, iface)
 
     HRESULT hr = S_OK;
+    IShellFolder *psfParent = NULL;
+    LPCITEMIDLIST rpidl = NULL;
 
     TRACE ("(%p)->(cidl=%d apidl=%p mask=%p (0x%08lx))\n", This, cidl, apidl,
      rgfInOut, rgfInOut ? *rgfInOut : 0);
@@ -587,11 +587,18 @@
     if (*rgfInOut == 0)
         *rgfInOut = ~0;
 
-    while (cidl > 0 && *apidl) {
-        pdump (*apidl);
-        SHELL32_GetItemAttributes (_IShellFolder_ (This), *apidl, rgfInOut);
-        apidl++;
-        cidl--;
+    if(cidl == 0){
+        hr = SHBindToParent(This->pidlRoot, &IID_IShellFolder, (LPVOID*)&psfParent, (LPCITEMIDLIST*)&rpidl);
+        if(SUCCEEDED(hr))
+            SHELL32_GetItemAttributes (psfParent, rpidl, rgfInOut);
+    }
+    else {
+        while (cidl > 0 && *apidl) {
+            pdump (*apidl);
+            SHELL32_GetItemAttributes (_IShellFolder_ (This), *apidl, rgfInOut);
+            apidl++;
+            cidl--;
+        }
     }
     /* make sure SFGAO_VALIDATE is cleared, some apps depend on that */
     *rgfInOut &= ~SFGAO_VALIDATE;

Reply via email to