Article View: borland.public.cppbuilder.nativeapi
Article #12780Re: CreateProcessAsUser returns false with Err Code = 1314
From: Jonathan Arnold
Date: Mon, 17 Nov 2003 19:01
Date: Mon, 17 Nov 2003 19:01
30 lines
2130 bytes
2130 bytes
Sergey Muschin wrote:
> very simple code :
>
> #define KIOSK_APP "C:\\KIOSK\\Bin\\Kiosk.exe"
> #define KIOSK_DIR "C:\\KIOSK\\Bin\\"
You can make life easier for yourself by not using backslashes. This
will work in your case (and 95% of the cases out there), and you don't
have to worry about a typo and forgetting to double up:
#define KIOSK_APP "C:/KIOSK/Bin/Kiosk.exe"
> void __fastcall TForm1::btnStartProcessAsKioskClick(TObject *Sender) {
>
> bool bRet = false;
> HANDLE htok = 0;
> STARTUPINFO si = { sizeof si, 0, "" };
An easier way to initialize this is:
STARTUPINFO si={sizeof(STARTUP_INFO)};
in fact, I'd be surprised if your code actually works, which has me worried
about typos in the rest of it. You'd be better off with a copy-and-paste.
--
Jonathan Arnold C/C++/CBuilder Keen Advice:
http://www.keen.com/categories/categorylist_expand.asp?sid=5156620
Comprehensive C++Builder link site:
http://www.buddydog.org/C++Builder/c++builder.html
Technical Details
Message-ID:
<3fb91b18$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<3fb90fa7$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10cc67,bd433a7717918789 X-Google-Attributes: gid10cc67,public X-Google-ArrivalTime: 2003-11-17 11:10:04 PST Date: Mon, 17 Nov 2003 14:01:45 -0500 From: Jonathan Arnold <jdarnold@buddydog.org> User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.6a) Gecko/20031030 MultiZilla/1.5.0.3l X-Accept-Language: en-us, en, ja MIME-Version: 1.0 Newsgroups: borland.public.cppbuilder.nativeapi Subject: Re: CreateProcessAsUser returns false with Err Code = 1314 References: <3fb90fa7$1@newsgroups.borland.com> In-Reply-To: <3fb90fa7$1@newsgroups.borland.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 66.92.76.225 Message-ID: <3fb91b18$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1069095704 66.92.76.225 (17 Nov 2003 11:01:44 -0700) Lines: 30 Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail