Click here to Skip to main content
15,913,115 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionWhat is the default stack size for VC++6 apps on Windows 2k pro? Pin
DengJW17-Apr-03 6:48
DengJW17-Apr-03 6:48 
AnswerRe: What is the default stack size for VC++6 apps on Windows 2k pro? Pin
John M. Drescher17-Apr-03 7:03
John M. Drescher17-Apr-03 7:03 
AnswerRe: What is the default stack size for VC++6 apps on Windows 2k pro? Pin
Joe Woodbury17-Apr-03 12:39
professionalJoe Woodbury17-Apr-03 12:39 
GeneralRe: What is the default stack size for VC++6 apps on Windows 2k pro? Pin
DengJW17-Apr-03 16:24
DengJW17-Apr-03 16:24 
GeneralRe: What is the default stack size for VC++6 apps on Windows 2k pro? Pin
DengJW17-Apr-03 16:28
DengJW17-Apr-03 16:28 
GeneralRe: What is the default stack size for VC++6 apps on Windows 2k pro? Pin
Joe Woodbury17-Apr-03 20:04
professionalJoe Woodbury17-Apr-03 20:04 
AnswerRe: What is the default stack size for VC++6 apps on Windows 2k pro? Pin
DengJW17-Apr-03 16:56
DengJW17-Apr-03 16:56 
GeneralHaving prolems with CreateProcessAsUser Pin
billdwilson317-Apr-03 6:46
billdwilson317-Apr-03 6:46 
CreateProcessAsUser driving me crazy
I need to have my program launch another program (test.exe) as another user (dummyuser). My code works until I get to the point of actually launching the test.exe program. At that point I get a 0x522 error - A required privilege is not held by the client.

If I log in as dummyuser, the I can run the test.exe program without problem. So, I believe the user has the permissions it needs

I've also tried an example from MSDN, and two from bulletin boards. All have the same problem.

My code relies on default values for some of the gory details, like winstation and desktop. The sample code I tried implemented them in detail with the same result. So, I don't think that's the problem.

I can't understand the difference between what my program does and what happens if I login in as dummyuser.

Here's my latest code:



code:--------------------------------------------------------------------------------
HANDLE h;
if( !LogonUser("dummyuser","dummydomain","dummypassword" ,LOGON32_LOGON_INTERACTIVE,LOGON32_PROVIDER_DEFAUL
T, &h))
{

DWORD dwErr = GetLastError();
return FALSE;
}
char * buffer = (char *) malloc(256);
DWORD size = 256;
if (GetUserName(buffer,&size))
{
TRACE0( buffer); /// This shows my original user name
TRACE0("\r\n");
}
if (!ImpersonateLoggedOnUser(h))
{
DWORD dwErr = GetLastError();
return FALSE;
}
size = 256;
if (GetUserName(buffer,&size))
{
TRACE0( buffer); /// This shows current user is dummyuser
TRACE0("\r\n");
}
STARTUPINFO st;
memset(&st,0,sizeof(st);
st.cb = sizeof(st);
//"\\Odyctx00\dDesktop\odyssey17.exe"
PROCESS_INFORMATION pi;
if (!CreateProcessAsUser(h,"C:\\test.exe" ,"",
NULL,NULL,FALSE,0,NULL,NULL,&st, &pi))
{
DWORD dwErr = GetLastError(); /// dwErr = 0x522
return FALSE;
}
--------------------------------------------------------------------------------


Thanks for any help or advice on this one. Its been driving me nuts.
QuestionIs TreeContol Thread Safe? Pin
orcun colak17-Apr-03 6:37
orcun colak17-Apr-03 6:37 
AnswerRe: Is TreeContol Thread Safe? Pin
David Crow17-Apr-03 9:20
David Crow17-Apr-03 9:20 
AnswerRe: Is TreeContol Thread Safe? Pin
Gary R. Wheeler18-Apr-03 3:45
Gary R. Wheeler18-Apr-03 3:45 
QuestionTN062 is Wrong... Right? Pin
Anonymous17-Apr-03 5:46
Anonymous17-Apr-03 5:46 
AnswerRe: TN062 is Wrong... Right? Pin
Bartosz Bien17-Apr-03 11:55
Bartosz Bien17-Apr-03 11:55 
Generalnumber of records in a query using ado Pin
si_6917-Apr-03 4:56
si_6917-Apr-03 4:56 
GeneralRe: number of records in a query using ado Pin
Toni7817-Apr-03 19:21
Toni7817-Apr-03 19:21 
GeneralGrid Control using CListCtrl Question Pin
ttohme17-Apr-03 4:51
ttohme17-Apr-03 4:51 
GeneralRe: Grid Control using CListCtrl Question Pin
João Paulo Figueira17-Apr-03 5:08
professionalJoão Paulo Figueira17-Apr-03 5:08 
GeneralRe: Grid Control using CListCtrl Question Pin
ttohme17-Apr-03 5:26
ttohme17-Apr-03 5:26 
QuestionHow to capture the notification when the explorer.exe is first inited? Pin
zmnie17-Apr-03 4:48
zmnie17-Apr-03 4:48 
AnswerRe: How to capture the notification when the explorer.exe is first inited? Pin
Brian Shifrin17-Apr-03 4:55
Brian Shifrin17-Apr-03 4:55 
AnswerRe: How to capture the notification when the explorer.exe is first inited? Pin
David Crow17-Apr-03 5:06
David Crow17-Apr-03 5:06 
QuestionReference or pointer, which is better in my case? Pin
George217-Apr-03 4:44
George217-Apr-03 4:44 
AnswerRe: Reference or pointer, which is better in my case? Pin
João Paulo Figueira17-Apr-03 5:11
professionalJoão Paulo Figueira17-Apr-03 5:11 
GeneralRe: Reference or pointer, which is better in my case? Pin
Daniel Strigl17-Apr-03 9:51
Daniel Strigl17-Apr-03 9:51 
GeneralRe: Reference or pointer, which is better in my case? Pin
George217-Apr-03 15:20
George217-Apr-03 15:20 

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.