Application getting launched in other user accout

Y

yatriksachdeva

Hi,

I have a WinXP system whose registerowner is "testuser". There also
exists a user account with same name, i.e. "testuser".

I logged in as built-in Administrator account and start a service. The
user name shown for this service is "SYSTEM" in TaskManager processes
tab. This service also lanch "notepad.exe" using WinExec API.

My problem is that the logged in Administrator does not see any
notepad.exe application running. When I switch user to "testuser", I
observe noetpad.exe instance running there.

Any ideas what may be causing this behavior?

Thanks in advance for any replies to this post.

Yatrik
 
C

CreateWindow

Hi,

Did you write the service and install it? Leagacy API service or dressed up
in .NET candy? What is it? Svrany?

CreateWindow
 
Y

yatriksachdeva

Hi,

Did you write the service and install it? Leagacy API service or dressed up
in .NET candy? What is it? Svrany?

CreateWindow












- Show quoted text -

Yes, that service was written and installed by me only.

Thanks
Yatrik
 
C

CreateWindow

Hi,

I need some more info. Was it installed with the .NET service installer or
InstallShield or native API?
What is it? I need more information - if I can help you. Was it marked
Interactive? Etc. ??
Is it written in C ?

CreateWindow
 
Y

yatriksachdeva

Hi,

I need some more info. Was it installed with the .NET service installer or
InstallShield or native API?
What is it? I need more information - if I can help you. Was it marked
Interactive? Etc. ??
Is it written in C ?

CreateWindow








- Show quoted text -


Hi,

This service written in C. It can be installed using InstallShield and
native API. It is interactive and can be controlled from Service
controller.
This behavior is only seen on couple of WinXP systems, where as on
other systems it works as desired.

Thanks
Yatrik
 
C

CreateWindow

Hi Yatrik,

Well it gets complex at this point as I don't know what you are trying to
achieve. The Desktop thread switching is tied into what you are noticing. I
recommend you *don't* make the service interactive at all - as this
historically causes problems - especially when the desktop switches to the
screen saver desktop.
A simple way that I use, is to create a GUI process to control your service
via a regular shell exe application. You can then share a simple data file
between your service process and your desktop application to communicate
between them. All you need to ensure is that you control access to the file
using a named Mutex kernel object so that your application and the service
don't write to the file at the same time!

Good luck

CreateWindow
 
Y

yatriksachdeva

Hi Yatrik,

Well it gets complex at this point as I don't know what you are trying to
achieve. The Desktop thread switching is tied into what you are noticing. I
recommend you *don't* make the service interactive at all - as this
historically causes problems - especially when the desktop switches to the
screen saver desktop.
A simple way that I use, is to create a GUI process to control your service
via a regular shell exe application. You can then share a simple data file
between your service process and your desktop application to communicate
between them. All you need to ensure is that you control access to the file
using a named Mutex kernel object so that your application and the service
don't write to the file at the same time!

Good luck

CreateWindow







- Show quoted text -


Hi,

The service launhes a script/.exe whenever a specific event occurs. It
works fine on other platforms.

My problem is that the logged in Administrator does not see any
script/.exe running which gets launched by the service. However, when
I switch to "testuser", I
observe script/.exe instance running there.

My question here is what causing this behavior? Is it due to fast user
switching or some thing because of user accounts? Is the local system
account gets assciated with registered owner of the system?

Thanks
Yatrik
 
C

CreateWindow

Hi Yatrik,

Fast user switching is definitely involved. A bit too complex for this
group. I'm not sure why the registered owner is involved? That registry
setting is not usually involved in what you are doing (I think?).
Only final suggestion I can offer is that when you launch your EXE you
should use CreateProcess. The second last parameter is LPSTARTUPINFO
lpStartupInfo here you specify the "Desktop" - it should be
start.lpDesktop = "WinSta0\\Default";
Where "start" is your LPSTARTUPINFO structure in memory.


Good luck,
CreateWindow
http://justpageprobe.com
The FREE Web page utility you always wanted.
Monitor your enterprise Web Servers.
Keep your router connected.
Email your IP to where you need it.
 
Y

yatriksachdeva

Hi Yatrik,

Fast user switching is definitely involved. A bit too complex for this
group. I'm not sure why the registered owner is involved? That registry
setting is not usually involved in what you are doing (I think?).
Only final suggestion I can offer is that when you launch your EXE you
should use CreateProcess. The second last parameter is LPSTARTUPINFO
lpStartupInfo here you specify the "Desktop" - it should be
start.lpDesktop = "WinSta0\\Default";
Where "start" is your LPSTARTUPINFO structure in memory.

Good luck,
CreateWindowhttp://justpageprobe.com
The FREE Web page utility you always wanted.
Monitor your enterprise Web Servers.
Keep your router connected.
Email your IP to where you need it.









- Show quoted text -


Thanks. I'll try this API and let you know if this resolves the
behavior I am seeing.

Thanks
Yatrik
 
Y

yatriksachdeva

Thanks. I'll try this API and let you know if this resolves the
behavior I am seeing.

ThanksYatrik- Hide quoted text -

- Show quoted text -

Hi,

I tried CreateProcess API but the behavior remains the same. Even now
application gets launced into other user account.

Thanks
Yatrik
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top