Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Dsofile.dll Access Denied error

205 views
Skip to first unread message

mldavis99

unread,
Aug 7, 2006, 1:58:45 PM8/7/06
to
The dsofile.dll version 2.0 provided by Microsoft throws an "access denied"
error whenever all of the Summary Properties are empty "null" and you attempt
to assign a bstr value to any of them in code.
Using the source code provided in KB224351 I've been able to trace this to
the fact that the Summary Propereties Set is added whenever one or more of
the properties is set in the Windows XP OS and the property set is REMOVED
when the last of any of the summary properties is removed!!!!
Note: The code does allow each of these properties to be added as a bstr
for COM compatibility but the code to automatically add the Summary Property
Set appears to be incorrectly examining the pointer by testing it directly
for a NULL...
Unfortunately I don't have the Win32 experties to correct this in the code
provided. Can anyone help?????

Thanks, mike :>}

Gorgoroth

unread,
Oct 18, 2006, 3:52:02 AM10/18/06
to
I noticed the same problem when trying to set the value of a summary-property
for a file that didn't have any yet.
The only way I have found around this is to manually change the DSOFile.dll
source code provided by the DSOFile-Installer and compile my own version.
If you open up the project and compare
CDsoCustomProperties::GetPropertyFromList to
CDsoSummaryProperties::GetPropertyFromList you will notice that the
CustomProperties one will behave differently depending on wether a previous
item already exists or not.
The SummaryProperties function only works if a previous item exists,
otherwise it throws an E_ACCESSDENIED. I modified
CDsoSummaryProperties::GetPropertyFromList to simply pass NULL as the last
parameter for InitProperty if no previous item exists.
This seems to work for me and had no obvious negative effects, however I
don't know if there was a specific reason for the difference in these
classes, or if it was simply a bug.
This approach might just fix your problem, however I suggest thorough
testing afterwards to make sure it doesn't break anything else that I am not
aware of.

Ken

unread,
Dec 4, 2006, 6:05:31 PM12/4/06
to

Gorgoroth wrote:
> CDsoSummaryProperties::GetPropertyFromList to simply pass NULL as the last
> parameter for InitProperty if no previous item exists.

Thanks, Gorgoroth. Looks like a bug to me as well. Not sure why MS
hasn't updated that KB entry. The previous code only worked if you
were modifying a file that already had document summary properties...

That section of code should look similar to the CustomProperties code:
CDsoDocProperty* pchain = NULL;
VARIANT var; var.vt = VT_EMPTY;
// If we are adding item to existing list, append the item...
if (plast) pchain = plast->AppendLink(pitem);

if (FAILED(pitem->InitProperty(NULL, id, &var, TRUE,
pchain)))

ken

Ken

unread,
Dec 4, 2006, 6:23:50 PM12/4/06
to

Gorgoroth wrote:
> CDsoSummaryProperties::GetPropertyFromList to simply pass NULL as the last
> parameter for InitProperty if no previous item exists.

Whoops...also remember to change this line:
if ((pitem == NULL) && (fAppendNew))

to take out the (pLast == NULL) check...

Message has been deleted
Message has been deleted

nyo...@gmail.com

unread,
Jan 29, 2007, 6:27:37 AM1/29/07
to
Hi,

Could someone please send me a copy of the patched file? I don't have
the expertise or the tools to correct the problem myself?

Thanks in advance!

On 11 Dec 2006, 22:05, "carsten.luen...@googlemail.com"
<carsten.luen...@googlemail.com> wrote:
> Or maybe you can send me a copy of the project so that I can see my
> errors and
> learn from them. Thanks a lot.
>
> carsten.luen...@googlemail.com schrieb:
>
>
>
> > Can you send me a copy of this new dll because I don't know how to fix
> > the problem?
>
> > Ken schrieb:

> > > to take out the (pLast == NULL) check...- Hide quoted text -- Show quoted text -

0 new messages