Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

WinLogon, Impersonate and CreateProcess (CreateProcessAsUser)

Posted on 2003-11-08
14
Medium Priority
?
1,678 Views
Last Modified: 2013-12-03
Hi Experts,

This is a question about WinLogon and how to start a new process within the users context.

The dll are registered in the Registry under the following key :
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\Notify\....], Asynchronous=0, Impersonate=1.

I would like to start a program when the user login.
I dont have any problems about receiving the 'Logon' notification and create a new process.
The problem is that the new process is created in the same security context as the dll - which means that the program dont terminates on logout.
I guess that the dll runs in the same context as Services does, not sure.

Impersonate (from microsoft.com) :
>>Indicates whether Winlogon should impersonate the security context  of the logged-on user when it calls the notification package functions. If this value is set to 1, Winlogon uses impersonation. Otherwise, it does not.

If WinLogon impersonate it should be possible to use CreateProcess. But it doesn't seem to work - the process is not created in the users context.

I guess that i just got something wrong here - any ideas ??

Kind Regards
Peter
0
Comment
Question by:PeterLarsen
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 5
14 Comments
 
LVL 86

Expert Comment

by:jkr
ID: 9707762
Check out http://www.microsoft.com/msj/0599/security/security0599.aspx - it comes with sample code on how to do that.
0
 
LVL 2

Author Comment

by:PeterLarsen
ID: 9725929
Hi jkr,

I already have several links about this issue.
What i need help to, is to understand e.g. what the impersonation in WinLogon actually does - or how i load (if necessarily) users environment before calling CreateProcessAsUser.
0
 
LVL 86

Expert Comment

by:jkr
ID: 9726072
>> or how i load (if necessarily) users environment before calling CreateProcessAsUser

The above article describes that :o)
0
NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

 
LVL 2

Author Comment

by:PeterLarsen
ID: 9726403
nah, you are talking about cmdasuser i guess - not usefull here since i'm using Winlogon in this case.
0
 
LVL 86

Expert Comment

by:jkr
ID: 9736849
Yes, but it also illustrates how to initialize the environment.
0
 
LVL 2

Author Comment

by:PeterLarsen
ID: 9741791
I need help to understand this - no more whitepapers please !!
0
 
LVL 86

Expert Comment

by:jkr
ID: 9742153
0
 
LVL 2

Author Comment

by:PeterLarsen
ID: 9742508
But does the samples interact with WinLogon ??
0
 
LVL 86

Expert Comment

by:jkr
ID: 10801425
I'd say the code given in the download link answers the question.
0
 
LVL 2

Author Comment

by:PeterLarsen
ID: 10805624
No it doesn't - i still don't know how Impersonation interact with Winlogon.
0
 
LVL 2

Author Comment

by:PeterLarsen
ID: 10840443
Thank you.
0
 

Accepted Solution

by:
CetusMOD earned 0 total points
ID: 10870064
PAQed, with points refunded (300)

CetusMOD
Community Support Moderator
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article, I will show how to use the Ribbon IDs Tool Window to assign the built-in Office icons to a ribbon button.  This tool will help us to find the OfficeImageId that corresponds to our desired built-in Office icon. The tool is part of…
As more and more people are shifting to the latest .Net frameworks, the windows presentation framework is gaining importance by the day. Many people are now turning to WPF controls to provide a rich user experience. I have been using WPF controls fo…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question