Groups | Blog | Home
all groups > dotnet academic > august 2006 >

dotnet academic : Dsofile.dll Access Denied error


mldavis99
8/7/2006 10:58:45 AM
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
10/18/2006 12:52:02 AM
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.

[quoted text, click to view]
Ken
12/4/2006 3:05:31 PM

[quoted text, click to view]

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
12/4/2006 3:23:50 PM

[quoted text, click to view]

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

to take out the (pLast == NULL) check...
carsten.luening NO[at]SPAM googlemail.com
12/11/2006 1:28:18 PM
Can you send me a copy of this new dll because I don't know how to fix
the problem?

Ken schrieb:

[quoted text, click to view]
carsten.luening NO[at]SPAM googlemail.com
12/11/2006 2:05:14 PM
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.luening@googlemail.com schrieb:

[quoted text, click to view]
nyousfi NO[at]SPAM gmail.com
1/29/2007 3:27:37 AM
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"
[quoted text, click to view]
AddThis Social Bookmark Button