|
Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com |
From: Ramana Ulluri (ramana
LINQUP.CO.UK)Date: Tue Oct 23 2001 - 11:35:04 CDT
Thank you very much for trying to help me.
Let me give more details...
Currently I am running the Server as Service with SYSTEM a/c. And I am
running the client also on the same m/c where the service is running,
however logged-in as USER1.
When I check (via OutputDebugString) the user name using GetUserName();
before CoImpersonateClient call, I get 'SYSTEM',
and after CoImpersonateClient call, I get 'USER1'
I also verified impersonation by using OpenThreadToken, GetTokenInformation
and LookupAccountSid function calls and found alright as per my limited
knowledge.
However SHGetSpecialFolderLocation gives me 'C:\WINNT\Profiles\Default
User\Application Data' where as I am expecting
'C:\WINNT\Profiles\USER1\Application Data'.
For me the problem looks like with SHGetSpecialFolderLocation under NT4 or
some thing extra I should do to make it work. As I said in my previous mail,
Every thing is working fine under Win2K.
I have to use few other SHELL APIs, so please suggest any think that I need
to do to make it work under NT4.
Thanks a lot!
Ramana
-----Original Message-----
From: Distributed COM-Based Code [mailto:DCOM
DISCUSS.MICROSOFT.COM]On
Behalf Of Robert Szasz
Sent: 23 October 2001 15:37
To: DCOM
DISCUSS.MICROSOFT.COM
Subject: Re: SHGetSpecialFolderLocation is returning a wrong path in a
COM obj when Server is running as SERVICE under NT4, SP6 ...
I'm not familiar with the SHGetSpecialFolderLocation API but....
Your call to CoImpersonateClient leads me to think that the
information you want is specific to the user making the (DCOM) call and
maybe the data you want is stored in the the user's registry hive. If this
is so then the user's registry hive would need to be loaded on the machine
where the service is running.
R O B !
-----Original Message-----
From: Ramana Ulluri [mailto:ramana
LINQUP.CO.UK]
Sent: 23 October 2001 14:04
To: DCOM
DISCUSS.MICROSOFT.COM
Subject: SHGetSpecialFolderLocation is returning a wrong path in a COM
obj when Server is running as SERVICE under NT4, SP6 ...
Hi,
Can any one help me in the following scenario...
I've COM component which try to get user's application data folder using
SHGetSpecialFolderLocation and SHGetPathFromIDList.
The COM Server runs as a Service. Every thing works fine under Win2K.
However under NT4, SP6 the component gets Default User's path instead of
currently logged-on user's.
Here is the main lines of code that works fine under Win2K, but gives wrong
results under NT4 when the COM server is running as a Service:
hr = CoImpersonateClient();
hr = SHGetMalloc(&pMalloc);
hr = SHGetSpecialFolderLocation(NULL, CSIDL_APPDATA, &pidlRoot);
fRet = SHGetPathFromIDList(pidlRoot, (LPSTR)lptszPath);
pMalloc->Free(pidlRoot);
pMalloc->Release();
CoRevertToSelf();
Client side I have taken care to grant RPC_C_IMP_LEVEL_IMPERSONATE level of
trust.
I hope I am clear.
Any suggestions?
Thanks,
Ramana
----------------------------------------------------------------
Users Guide http://discuss.microsoft.com/archives/mailfaq.asp
contains important info. Save time, search the archives at
http://discuss.microsoft.com/archives/index.html .
To unsubscribe, mailto:DCOM-signoff-request
DISCUSS.MICROSOFT.COM
_____________________________________________________________________
This message has been checked for all known viruses by UUNET delivered
through the MessageLabs Virus Control Centre. For further information visit
http://www.uk.uu.net/products/security/virus/
****************************************************************************
This e-mail message and any files transmitted with it are confidential and
for the use of the addressee only. If you have received this communication
in error, please notify us immediately by replying to it, and then delete it
from your computer
****************************************************************************
This message has been checked for all known viruses by UUNET delivered
through the MessageLabs Virus Control Centre.
___________________________________________________________________________
----------------------------------------------------------------
Users Guide http://discuss.microsoft.com/archives/mailfaq.asp
contains important info. Save time, search the archives at
http://discuss.microsoft.com/archives/index.html .
To unsubscribe, mailto:DCOM-signoff-request
DISCUSS.MICROSOFT.COM
----------------------------------------------------------------
Users Guide http://discuss.microsoft.com/archives/mailfaq.asp
contains important info. Save time, search the archives at
http://discuss.microsoft.com/archives/index.html .
To unsubscribe, mailto:DCOM-signoff-request
DISCUSS.MICROSOFT.COM
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]