Write problem with MS Office 2003

Stefan Dösinger stefandoesinger at gmx.at
Mon May 23 16:12:52 CDT 2005

I'm doing a few test with Microsoft Office 2003, and one of the problems I 
notice is that any app(word, excel, powerpoint, access tested) refuses to 
save new files. Whenever I try to save a file Office tells me that the folder 
is write-protected. Opening an existing file and saving it again works.

I looked at a +shell log and 2 interesting lines are:
trace:shell:IShellFolder_fnGetAttributesOf (0x77c403a0)->(cidl=0 apidl=(nil) 
mask=0x77a820fc (0x00040000))
trace:shell:IShellFolder_fnGetAttributesOf -- result=0x00040000

The result 0x00040000 means SFGAO_READONLY, which the folder isn't, I veryfied 
that I can write it. As far as I understand Office tries to read the 
SFGAO_READONLY attribute passing 0x00040000 rgfInOut. But cidl and apidl are 
set to 0, so Wine's IShellFolder_fnGetAttributesOf doesn't check anything and 
just returns SFGAO_READONLY.

There's a check for this case:
    if (cidl && !apidl)
        return E_INVALIDARG;

MSDN doesn't give me a hint what to do if cidl is set to 0. If I change the if 
line to "if (!cidl && !apidl)" (so E_INVALIDARG is returned to office), 
saving the file works. Should this line be "if (!cidl || !apidl)", or is 
there a special case for cidl==0?


More information about the wine-devel mailing list