Click to See Complete Forum and Search --> : CreateProcessWithLogonW


mahanare
April 24th, 2003, 03:41 AM
hi, As I failed miserably in working with CreateProcessAsUser(),
now i am trying with CreateProcessWithLogonW() function.
i included required lib and .h files according to MSDN

Client: Included in Windows XP, Windows 2000 Professional.
Server: Included in Windows .NET Server 2003, Windows 2000 Server.
Unicode: Implemented only as Unicode.
Header: Declared in Winbase.h; include Windows.h.
Library: Use Advapi32.lib.


like, in setting->link i added Advapi32.lib
and Included winbase.h windows.h in StdAfx.h
my application is a console application with MFC support(with tmain())

But still I am getting error "CreateProcessWithLogonW undeclared identifier"

anyhelp...
Thanks in advance

cheers
mahanare

the_ENIGMA
April 29th, 2003, 08:07 AM
hi mahanare,

whatz going wrong with "CreateProcessAsUser" ??
i guess it should work without cribbing.. it works for me.

regarding "CreateProcessAsUserW",
it is a unicode routine.
compile your application as a UNICODE application
only then will the compiler find the declaration of
this routine...

itz there in "winbase.h", have UNICODE as
pre-processor directive and it will surely compile without any error.

mahanare
April 30th, 2003, 01:40 AM
Hi Enigma.
Actually I spent lot of time in working with CreateProcessAsUser().
you can see my code as a zip in the following thread.
what i was getting is 1314 error, even when i give admin login and password, so i tried what ever I learned through MSDN or google and other resouces.
If you can help me see the code and tell me where the is the wrong. I am really feeling pity on myself for not able to do the work assigned to me.

http://www.codeguru.com/forum/showthread.php?s=&threadid=238695

or if you have some other way of working iwth createProcessAsuser() then please tell me how to do that. even you have some sample piece of code which is working you can give to me as you did for "core.zip"

Hope i get some reply

cheers
mahanare

the_ENIGMA
May 2nd, 2003, 05:39 AM
this code runs as it is on my NT machine..
from your account use a different username/password
in this program, and audit the logon-logoff
and audit notepad.exe access event
on your your machine...

run this program, and see the event viewer.
it will record notepad.exe access done by
the different user other than the one you
are logged on as.

~enjoy

mahanare
May 2nd, 2003, 06:46 AM
o.k thank you, I will check it out.
But i am afraid whether there is any change in windows xp.
because i need to make it work in xp only.
I think this is 2 or 3rd time you r help me, thanks for the same.

cheers
mahanare