HighTechTalks DotNet Forums  

Dsofile.dll Access Denied error

Dotnet Academic General Discussions microsoft.public.dotnet.academic


Discuss Dsofile.dll Access Denied error in the Dotnet Academic General Discussions forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
mldavis99
 
Posts: n/a

Default Dsofile.dll Access Denied error - 08-07-2006 , 01:58 PM






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 :>}


Reply With Quote
  #2  
Old   
Gorgoroth
 
Posts: n/a

Default RE: Dsofile.dll Access Denied error - 10-18-2006 , 03:52 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.

"mldavis99" wrote:

Quote:
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 :>}


Reply With Quote
  #3  
Old   
Ken
 
Posts: n/a

Default Re: Dsofile.dll Access Denied error - 12-04-2006 , 06:05 PM




Gorgoroth wrote:
Quote:
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



Reply With Quote
  #4  
Old   
Ken
 
Posts: n/a

Default Re: Dsofile.dll Access Denied error - 12-04-2006 , 06:23 PM




Gorgoroth wrote:
Quote:
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...



Reply With Quote
  #5  
Old   
carsten.luening@googlemail.com
 
Posts: n/a

Default Re: Dsofile.dll Access Denied error - 12-11-2006 , 04:28 PM



Can you send me a copy of this new dll because I don't know how to fix
the problem?

Ken schrieb:

Quote:
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...


Reply With Quote
  #6  
Old   
carsten.luening@googlemail.com
 
Posts: n/a

Default Re: Dsofile.dll Access Denied error - 12-11-2006 , 05:05 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 (AT) googlemail (DOT) com schrieb:

Quote:
Can you send me a copy of this new dll because I don't know how to fix
the problem?

Ken schrieb:

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...


Reply With Quote
  #7  
Old   
nyousfi@gmail.com
 
Posts: n/a

Default Re: Dsofile.dll Access Denied error - 01-29-2007 , 06:27 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... (AT) googlemail (DOT) com"
<carsten.luen... (AT) googlemail (DOT) com> wrote:
Quote:
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... (AT) googlemail (DOT) com schrieb:



Can you send me a copy of this new dll because I don't know how to fix
the problem?

Ken schrieb:

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...- Hide quoted text -- Show quoted text -


Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.