Click here to Skip to main content
16,013,581 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: MFC questions Pin
Ravi Bhavnani19-Jan-04 12:57
professionalRavi Bhavnani19-Jan-04 12:57 
GeneralRe: MFC questions Pin
Binayak19-Jan-04 13:11
Binayak19-Jan-04 13:11 
GeneralRe: MFC questions Pin
Ravi Bhavnani19-Jan-04 13:25
professionalRavi Bhavnani19-Jan-04 13:25 
GeneralRe: MFC questions Pin
Roger Allen19-Jan-04 23:35
Roger Allen19-Jan-04 23:35 
GeneralRe: MFC questions Pin
Binayak20-Jan-04 10:00
Binayak20-Jan-04 10:00 
GeneralRe: MFC questions Pin
Binayak20-Jan-04 10:33
Binayak20-Jan-04 10:33 
GeneralQuestion about DRIVE_LAYOUT_INFORMATION Pin
Cyrus Dang19-Jan-04 11:58
Cyrus Dang19-Jan-04 11:58 
GeneralLogging in as another user from a service Pin
Navin19-Jan-04 10:53
Navin19-Jan-04 10:53 
I have a program that runs as a service. It needs to run a program under another user's account. The service will have access to a username/password. The service, of course, is running under the System account.

I have investigated CreateProcessAsUser, but for the life of me I cannot get it to work as expected! I can use LogonUser to get a token, and then pass it to CreateProcessAsUser, which dutifully runs the program and returns no errors, but from all observations, the program does not seem to run under the right account.

Any ideas? I'd post code, but it is pretty bulky. I got it from an article here on CP about a Telnet server. OR just to test, is there a relatively easy way I could, say, print the name of the user I'm running the code as, or some other sure-fire test?

This service may be running with or without the given user logged on, so I'm not sure if that makes a difference.

Thanks.



"I'd be up a piece if I hadn't swallowed my bishop." Mr. Ed, playing chess

GeneralRe: Logging in as another user from a service Pin
Garth J Lancaster19-Jan-04 11:09
professionalGarth J Lancaster19-Jan-04 11:09 
GeneralRe: Logging in as another user from a service Pin
Navin19-Jan-04 11:14
Navin19-Jan-04 11:14 
GeneralRe: Logging in as another user from a service Pin
Garth J Lancaster19-Jan-04 11:21
professionalGarth J Lancaster19-Jan-04 11:21 
GeneralRe: Logging in as another user from a service Pin
Garth J Lancaster19-Jan-04 11:28
professionalGarth J Lancaster19-Jan-04 11:28 
GeneralRe: Logging in as another user from a service Pin
Navin19-Jan-04 11:34
Navin19-Jan-04 11:34 
GeneralPerformance issues Pin
lpRomang19-Jan-04 10:52
lpRomang19-Jan-04 10:52 
GeneralRe: Performance issues Pin
фил21-Jan-04 4:33
фил21-Jan-04 4:33 
GeneralStubborn mnemonics Pin
satcat19-Jan-04 9:48
satcat19-Jan-04 9:48 
GeneralRe: Stubborn mnemonics Pin
Michael Dunn19-Jan-04 10:28
sitebuilderMichael Dunn19-Jan-04 10:28 
GeneralRe: Stubborn mnemonics Pin
satcat19-Jan-04 14:11
satcat19-Jan-04 14:11 
GeneralMDI WS_SYSMENU question... Pin
RobJones19-Jan-04 9:26
RobJones19-Jan-04 9:26 
GeneralRe: MDI WS_SYSMENU question... Pin
Ivor S. Sargoytchev19-Jan-04 11:44
Ivor S. Sargoytchev19-Jan-04 11:44 
GeneralRe: MDI WS_SYSMENU question... Pin
RobJones19-Jan-04 14:12
RobJones19-Jan-04 14:12 
GeneralWriting in a multiline Edit Box Pin
satcat19-Jan-04 9:22
satcat19-Jan-04 9:22 
GeneralRe: Writing in a multiline Edit Box Pin
David Crow19-Jan-04 10:50
David Crow19-Jan-04 10:50 
GeneralRe: Writing in a multiline Edit Box Pin
satcat19-Jan-04 14:16
satcat19-Jan-04 14:16 
GeneralRe: Writing in a multiline Edit Box Pin
David Crow20-Jan-04 2:40
David Crow20-Jan-04 2:40 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.