Click here to Skip to main content
15,891,976 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Two Dialogs in Application class Pin
KingsGambit28-Dec-09 23:28
KingsGambit28-Dec-09 23:28 
GeneralRe: Two Dialogs in Application class Pin
Anu_Bala28-Dec-09 23:59
Anu_Bala28-Dec-09 23:59 
AnswerRe: Two Dialogs in Application class Pin
Nelek28-Dec-09 23:55
protectorNelek28-Dec-09 23:55 
Questionunistd.h Pin
mortaza mardani28-Dec-09 21:50
mortaza mardani28-Dec-09 21:50 
AnswerRe: unistd.h Pin
Rajesh R Subramanian28-Dec-09 22:09
professionalRajesh R Subramanian28-Dec-09 22:09 
QuestionRe: unistd.h [modified] Pin
CPallini28-Dec-09 22:16
mveCPallini28-Dec-09 22:16 
AnswerRe: unistd.h Pin
mortaza mardani31-Dec-09 9:27
mortaza mardani31-Dec-09 9:27 
QuestionCreateProcessAsUser Pin
sashoalm28-Dec-09 21:39
sashoalm28-Dec-09 21:39 
How do I get the hToken needed for CreateProcessAsUser? I have a DLL that is loaded runs from the context of user1 and then from user2. From user2, I want to create a process as user1.

From MSDN:
BOOL WINAPI CreateProcessAsUser(
  __in_opt     HANDLE hToken,
  __in_opt     LPCTSTR lpApplicationName,
  __inout_opt  LPTSTR lpCommandLine,
  __in_opt     LPSECURITY_ATTRIBUTES lpProcessAttributes,
  __in_opt     LPSECURITY_ATTRIBUTES lpThreadAttributes,
  __in         BOOL bInheritHandles,
  __in         DWORD dwCreationFlags,
  __in_opt     LPVOID lpEnvironment,
  __in_opt     LPCTSTR lpCurrentDirectory,
  __in         LPSTARTUPINFO lpStartupInfo,
  __out        LPPROCESS_INFORMATION lpProcessInformation
);


What I want to do is something like this:

1. user1 process loads my DLL
2. my DLL gets the current process hToken (???this is the part i don't get???)
3. my DLL stores that in a txt file.
4. user1 process closes

5. user2 process starts and loads my DLL
6. my DLL reads all the needed data from txt file
7. my DLL starts a process as user1.


user2 process is always guaranteed to run only *after* user1 process. They don't run simultaneously.

There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition.
Blaise Pascal

AnswerRe: CreateProcessAsUser Pin
KingsGambit28-Dec-09 22:06
KingsGambit28-Dec-09 22:06 
GeneralRe: CreateProcessAsUser Pin
sashoalm28-Dec-09 22:20
sashoalm28-Dec-09 22:20 
GeneralRe: CreateProcessAsUser Pin
KingsGambit28-Dec-09 22:25
KingsGambit28-Dec-09 22:25 
GeneralRe: CreateProcessAsUser Pin
sashoalm28-Dec-09 22:36
sashoalm28-Dec-09 22:36 
GeneralRe: CreateProcessAsUser Pin
KingsGambit28-Dec-09 22:37
KingsGambit28-Dec-09 22:37 
QuestionUtf - 8 Querys from unicode application Pin
krishnan.s28-Dec-09 21:23
krishnan.s28-Dec-09 21:23 
QuestionSetting the borders for the tables in word Pin
Chandrasekharan P28-Dec-09 19:45
Chandrasekharan P28-Dec-09 19:45 
AnswerRe: Setting the borders for the tables in word Pin
Madhu Nair28-Dec-09 22:20
Madhu Nair28-Dec-09 22:20 
Questionupload file through FTP Pin
raj157628-Dec-09 19:01
raj157628-Dec-09 19:01 
AnswerRe: upload file through FTP Pin
Madhu Nair28-Dec-09 23:03
Madhu Nair28-Dec-09 23:03 
GeneralRe: upload file through FTP Pin
raj157628-Dec-09 23:40
raj157628-Dec-09 23:40 
GeneralRe: upload file through FTP Pin
Madhu Nair29-Dec-09 0:29
Madhu Nair29-Dec-09 0:29 
GeneralRe: upload file through FTP Pin
raj157629-Dec-09 2:04
raj157629-Dec-09 2:04 
QuestionCalling dll Pin
Le@rner28-Dec-09 18:22
Le@rner28-Dec-09 18:22 
AnswerRe: Calling dll Pin
Madhu Nair28-Dec-09 18:32
Madhu Nair28-Dec-09 18:32 
AnswerRe: Calling dll Pin
Abhi Lahare28-Dec-09 19:11
Abhi Lahare28-Dec-09 19:11 
AnswerRe: Calling dll [modified] Pin
EverettJF28-Dec-09 20:38
EverettJF28-Dec-09 20:38 

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.