Click here to Skip to main content
16,006,594 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRegistering an ActiveX !! Pin
Alex H 198320-Jan-03 20:14
Alex H 198320-Jan-03 20:14 
GeneralRe: Registering an ActiveX !! Pin
Daed20-Jan-03 20:57
Daed20-Jan-03 20:57 
Generaleasy question, please help :) Pin
joshfl20-Jan-03 17:57
joshfl20-Jan-03 17:57 
GeneralRe: easy question, please help :) Pin
xxhimanshu20-Jan-03 19:21
xxhimanshu20-Jan-03 19:21 
GeneralRe: easy question, please help :) Pin
Chris Richardson20-Jan-03 20:28
Chris Richardson20-Jan-03 20:28 
GeneralRe: easy question, please help :) Pin
jhwurmbach21-Jan-03 0:16
jhwurmbach21-Jan-03 0:16 
GeneralRe: easy question, please help :) Pin
joshfl21-Jan-03 5:06
joshfl21-Jan-03 5:06 
Generalplz. help rectify LogonUser(...) ImpersonateUser problem Pin
r i s h a b h s20-Jan-03 17:39
r i s h a b h s20-Jan-03 17:39 
dear all,
your urgent attention is required!!!!!!!!!!!!!
I'm in a strange problem with absolutely no clues!

i'm using LogonUser(..) function with flag LOGON32_LOGON_INTERACTIVE to obtain the Administrator user token. The function returns ERROR_SUCCESS(0).

now i use the administrator token returned by the above function in CreateProcessAsUser(..).

the problem is that I get an error message ACCESS_DENIED (error code 5).

I even tried ImpersonateLoggedOnUser(..) (returns ERROR_SUCCESSS ) after LogonUser and then CreateProcess() or CreateProcessAsUser but still no respite from Error 5 (ACCESS_DENIED )

Is there anything else regarding security which needs to be done before calling CreateProcessAsUser(..) and after impersonating a user.

the code for is as follows:_

/*Calling LogonUser*/
BOOL bRes = LogonUser (sUserName.GetBuffer(sUserName.GetLength()) ,
sDomain.GetBuffer(sDomain.GetLength()) ,
sPassword.GetBuffer(sPassword.GetLength()) ,
LOGON32_LOGON_INTERACTIVE,
LOGON32_PROVIDER_DEFAULT,
&(hnd));

/*Now Impersonating the user */
ImpersonateLoggedOnUser(hnd); /*Returns ERROR_SUCCESS */

/*now calling CreateProcessAsUser or CreateProcess depending on success of ImpersonateLoggedOnUser */

BOOL bRes = CreateProcessAsUser(hUserToken,
NULL ,
clp,
NULL, NULL,
TRUE,
NORMAL_PRIORITY_CLASS,
NULL, NULL,
&start,
&process);
/* Returns ACCESS_DENIED */

is there Anything to do with the security descriptors or Am I missing something else crucial?

PLZ. Respond,
regards,


rishabhs
Generalamazing............................... Pin
r i s h a b h s20-Jan-03 23:06
r i s h a b h s20-Jan-03 23:06 
GeneralRe: amazing............................... Pin
xxhimanshu20-Jan-03 23:29
xxhimanshu20-Jan-03 23:29 
GeneralRe: amazing............................... Pin
xxhimanshu20-Jan-03 23:56
xxhimanshu20-Jan-03 23:56 
Generalatlast some inspiration!!!!!!!!!!! Pin
r i s h a b h s21-Jan-03 17:37
r i s h a b h s21-Jan-03 17:37 
GeneralCreating controls during runtime Pin
Baatezu20-Jan-03 14:00
Baatezu20-Jan-03 14:00 
GeneralRe: Creating controls during runtime Pin
xxhimanshu20-Jan-03 19:28
xxhimanshu20-Jan-03 19:28 
GeneralRe: Creating controls during runtime Pin
Baatezu20-Jan-03 19:41
Baatezu20-Jan-03 19:41 
GeneralReturn between CStrings Pin
Sunnygirl20-Jan-03 13:36
Sunnygirl20-Jan-03 13:36 
GeneralRe: Return between CStrings Pin
Tim Smith20-Jan-03 14:01
Tim Smith20-Jan-03 14:01 
GeneralRe: Return between CStrings Pin
Thomas Lau20-Jan-03 14:23
Thomas Lau20-Jan-03 14:23 
GeneralRe: Return between CStrings Pin
Thomas Lau20-Jan-03 14:27
Thomas Lau20-Jan-03 14:27 
GeneralVideo Window Pin
Callisto20-Jan-03 12:27
Callisto20-Jan-03 12:27 
GeneralRe: Video Window Pin
Daniel Strigl20-Jan-03 20:05
Daniel Strigl20-Jan-03 20:05 
GeneralTurning the pc off Pin
Li Mu Bai20-Jan-03 11:37
Li Mu Bai20-Jan-03 11:37 
GeneralRe: Turning the pc off Pin
User 665820-Jan-03 11:44
User 665820-Jan-03 11:44 
GeneralStatus Bar Pin
Paddy20-Jan-03 10:33
Paddy20-Jan-03 10:33 
GeneralRe: Status Bar Pin
georgiek5020-Jan-03 13:44
georgiek5020-Jan-03 13:44 

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.