Write problem with MS Office 2003

Juan Lang juan_lang at yahoo.com
Mon May 23 15:50:55 CDT 2005


Stefan wrote:
> 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?

There is a special case for cidl == 0, some apps expect to be able to call
GetAttributesOf with cidl == 0, apidl == NULL.  See the patch that
introduced it here:
http://www.winehq.org/hypermail/wine-patches/2005/05/0156.html

The special case, in particular, is to handle SFGAO_VALIDATE, described on
the MSDN page for IShellFolder::GetAttributesOf.  I'm guessing this bit is
what the app writers were reading when they decided to call
GetAttributesOf with cidl == 0:
"When used with the file system folder, SFGAO_VALIDATE instructs the
folder to discard cached properties retrieved by clients of
IShellFolder2::GetDetailsEx that may have accumulated for the specified
items."

The correct fix is to modify SHELL32_GetItemAttributes to clear
SFGAO_READONLY if the file is not read-only.

--Juan


		
__________________________________ 
Do you Yahoo!? 
Yahoo! Small Business - Try our new Resources site
http://smallbusiness.yahoo.com/resources/



More information about the wine-devel mailing list