Mapping network resources from a service
From: Stephane Grobety (Fulgan_at_community.nospam)
Date: 02/08/05
- Next message: Mick: "Re: Changing system resource limits"
- Previous message: eltonh: "How to generate interrupt"
- Next in thread: Chuck Chopp: "Re: Mapping network resources from a service"
- Reply: Chuck Chopp: "Re: Mapping network resources from a service"
- Reply: Stefan Kuhr: "Re: Mapping network resources from a service"
- Reply: Stefan Kuhr: "Re: Mapping network resources from a service"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 08 Feb 2005 09:12:16 -0800
Hello,
I need to do the following: Write a service that will impersonate a
user, map a network ressource to a drive letter, run a process, delete
the mapping and revert to itself.
All these steps I can do wothout problem. But I'm stuck with onother
requirement: the service must run on a terminal server system in
application server mode (actually, a Citrix metaframe server). On that
server, the regular users will also map that drive letter, but to
different ressources (that is how the data is segragated for the users
without having them remember UNC pathes).
All test I've done on my developpement machines seems to lead to the
conclusion that local ressources mapping are global to the system: if I
map a drive from the interractive user, the service fails with a
ERROR_ALREADY_ASSIGNED code. Yet terminal service, in application mode,
has no problem with different users mapping different network resources
to the same local resource.
How can I overcome this difficulty. Have I missed a step in setting up
the user context from my service application ?
What I do is:
Call LogonUser
Call ImpersonateLoggedOnUser
Call WNetAddConnection2
run my process
call WNetCancelConnection2
Call RevertToSelf
Call CloseHandle on the logon handle.
Thanks,
Stephane
- Next message: Mick: "Re: Changing system resource limits"
- Previous message: eltonh: "How to generate interrupt"
- Next in thread: Chuck Chopp: "Re: Mapping network resources from a service"
- Reply: Chuck Chopp: "Re: Mapping network resources from a service"
- Reply: Stefan Kuhr: "Re: Mapping network resources from a service"
- Reply: Stefan Kuhr: "Re: Mapping network resources from a service"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|