PC Review


Reply
Thread Tools Rate Thread

"Application failed to intialize" with CreateProcessWithLogon

 
 
=?Utf-8?B?U3RldmU0RA==?=
Guest
Posts: n/a
 
      11th Apr 2006
With an ASP.NET application, I try to run an external program (like EXE, BAT)
with a logon of an another user. I use CreateProcessWithLogonW from API
"advapi32.dll" . When my ASP.NET application launches my EXE program via
CreateProcessWithLogonW, the process starts but an error appears "Application
failed to initialze" : why ?

 
Reply With Quote
 
 
 
 
Mattias Sjögren
Guest
Posts: n/a
 
      11th Apr 2006

>When my ASP.NET application launches my EXE program via
>CreateProcessWithLogonW, the process starts but an error appears "Application
>failed to initialze" : why ?


Alsmost impossible to say without knowing more about the applications,
seeing your calling code etc.


Mattias

--
Mattias Sjögren [C# MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
 
Reply With Quote
 
Willy Denoyette [MVP]
Guest
Posts: n/a
 
      11th Apr 2006

"Steve4D" <(E-Mail Removed)> wrote in message
news2D0BE32-90CE-4B0D-A1A8-(E-Mail Removed)...
| With an ASP.NET application, I try to run an external program (like EXE,
BAT)
| with a logon of an another user. I use CreateProcessWithLogonW from API
| "advapi32.dll" . When my ASP.NET application launches my EXE program via
| CreateProcessWithLogonW, the process starts but an error appears
"Application
| failed to initialze" : why ?
|

A few question, what are you trying to achieve by this? If you are trying to
launch an interactive process using this API, you better stop here as it
won't work anyway.

If you are just trying to launch a background process using alternate
credentials;
What is the identity of the ASP.NET process?
Note that you can't use localsystem (SYSTEM) to call
CreateProcessWithLogonW.
What's the value of startInfo.lpDesktop?
What is the value of the dwLogonFlags argument?

Willy.


 
Reply With Quote
 
=?Utf-8?B?U3RldmU0RA==?=
Guest
Posts: n/a
 
      12th Apr 2006
I use IIS 6 under Windows2003 Server.
The Framework.Net version is 1.1.4322 .
My server is in the domain Domain_1.
I try to launch a background process using alternate credentials with the
login Domain_1\ProcessUser. The process is a simple c# program.
The identity of the ASP.Net process is defined with the login
Domain_1\ASPUser.
The value of StartUpInfo.lpDesktop is NULL.
The value of dwLogonFlags is LOGON_NETCREDENTIALS_ONLY .

Steve.


"Willy Denoyette [MVP]" a écrit :

>
> "Steve4D" <(E-Mail Removed)> wrote in message
> news2D0BE32-90CE-4B0D-A1A8-(E-Mail Removed)...
> | With an ASP.NET application, I try to run an external program (like EXE,
> BAT)
> | with a logon of an another user. I use CreateProcessWithLogonW from API
> | "advapi32.dll" . When my ASP.NET application launches my EXE program via
> | CreateProcessWithLogonW, the process starts but an error appears
> "Application
> | failed to initialze" : why ?
> |
>
> A few question, what are you trying to achieve by this? If you are trying to
> launch an interactive process using this API, you better stop here as it
> won't work anyway.
>
> If you are just trying to launch a background process using alternate
> credentials;
> What is the identity of the ASP.NET process?
> Note that you can't use localsystem (SYSTEM) to call
> CreateProcessWithLogonW.
> What's the value of startInfo.lpDesktop?
> What is the value of the dwLogonFlags argument?
>
> Willy.
>
>
>

 
Reply With Quote
 
Willy Denoyette [MVP]
Guest
Posts: n/a
 
      12th Apr 2006
Ok, but what kind of application is this (the simple C#), don't forget that
the error comes from this application that fails to initialize.
What happens if you run this from a console application?

Willy.

"Steve4D" <(E-Mail Removed)> wrote in message
news9180B23-FE7A-4490-9F30-(E-Mail Removed)...
|I use IIS 6 under Windows2003 Server.
| The Framework.Net version is 1.1.4322 .
| My server is in the domain Domain_1.
| I try to launch a background process using alternate credentials with the
| login Domain_1\ProcessUser. The process is a simple c# program.
| The identity of the ASP.Net process is defined with the login
| Domain_1\ASPUser.
| The value of StartUpInfo.lpDesktop is NULL.
| The value of dwLogonFlags is LOGON_NETCREDENTIALS_ONLY .
|
| Steve.
|
|
| "Willy Denoyette [MVP]" a écrit :
|
| >
| > "Steve4D" <(E-Mail Removed)> wrote in message
| > news2D0BE32-90CE-4B0D-A1A8-(E-Mail Removed)...
| > | With an ASP.NET application, I try to run an external program (like
EXE,
| > BAT)
| > | with a logon of an another user. I use CreateProcessWithLogonW from
API
| > | "advapi32.dll" . When my ASP.NET application launches my EXE program
via
| > | CreateProcessWithLogonW, the process starts but an error appears
| > "Application
| > | failed to initialze" : why ?
| > |
| >
| > A few question, what are you trying to achieve by this? If you are
trying to
| > launch an interactive process using this API, you better stop here as it
| > won't work anyway.
| >
| > If you are just trying to launch a background process using alternate
| > credentials;
| > What is the identity of the ASP.NET process?
| > Note that you can't use localsystem (SYSTEM) to call
| > CreateProcessWithLogonW.
| > What's the value of startInfo.lpDesktop?
| > What is the value of the dwLogonFlags argument?
| >
| > Willy.
| >
| >
| >


 
Reply With Quote
 
=?Utf-8?B?U3RldmU0RA==?=
Guest
Posts: n/a
 
      13th Apr 2006
When I run this from a console application: there is no error.
We develop on WindowsXP SP2: there is no error with our Web developement
configuration.
On our server W2003, the ASP.Net application creates the process with the
simple c# program and there the error appears. In the Windows tasks list, we
can see the new process.
We made the test with C# program with no code inside: we have the same error
on server W2003.

"Willy Denoyette [MVP]" a écrit :

> Ok, but what kind of application is this (the simple C#), don't forget that
> the error comes from this application that fails to initialize.
> What happens if you run this from a console application?
>
> Willy.
>
> "Steve4D" <(E-Mail Removed)> wrote in message
> news9180B23-FE7A-4490-9F30-(E-Mail Removed)...
> |I use IIS 6 under Windows2003 Server.
> | The Framework.Net version is 1.1.4322 .
> | My server is in the domain Domain_1.
> | I try to launch a background process using alternate credentials with the
> | login Domain_1\ProcessUser. The process is a simple c# program.
> | The identity of the ASP.Net process is defined with the login
> | Domain_1\ASPUser.
> | The value of StartUpInfo.lpDesktop is NULL.
> | The value of dwLogonFlags is LOGON_NETCREDENTIALS_ONLY .
> |
> | Steve.
> |
> |
> | "Willy Denoyette [MVP]" a écrit :
> |
> | >
> | > "Steve4D" <(E-Mail Removed)> wrote in message
> | > news2D0BE32-90CE-4B0D-A1A8-(E-Mail Removed)...
> | > | With an ASP.NET application, I try to run an external program (like
> EXE,
> | > BAT)
> | > | with a logon of an another user. I use CreateProcessWithLogonW from
> API
> | > | "advapi32.dll" . When my ASP.NET application launches my EXE program
> via
> | > | CreateProcessWithLogonW, the process starts but an error appears
> | > "Application
> | > | failed to initialze" : why ?
> | > |
> | >
> | > A few question, what are you trying to achieve by this? If you are
> trying to
> | > launch an interactive process using this API, you better stop here as it
> | > won't work anyway.
> | >
> | > If you are just trying to launch a background process using alternate
> | > credentials;
> | > What is the identity of the ASP.NET process?
> | > Note that you can't use localsystem (SYSTEM) to call
> | > CreateProcessWithLogonW.
> | > What's the value of startInfo.lpDesktop?
> | > What is the value of the dwLogonFlags argument?
> | >
> | > Willy.
> | >
> | >
> | >
>
>
>

 
Reply With Quote
 
Willy Denoyette [MVP]
Guest
Posts: n/a
 
      13th Apr 2006
Can you try to Logon as Domain_1\ASPUser on W2K3 (this is the account your
asp.net worker process runs as), and run the console program like as you did
on XP.
You also need to check the return code of CreateProcessWithLogonW, make sure
SetLastError is true like...

[DllImport("advapi32.dll", CharSet=CharSet.Auto, SetLastError=true)]
internal static extern bool CreateProcessWithLogonW(
....

When it fails, do you get a dialog box with a message "...Failed to
Initilaize Error 0xc0000142"?

Willy.

"Steve4D" <(E-Mail Removed)> wrote in message
news:4EF85D8F-3E91-425F-BF82-(E-Mail Removed)...
| When I run this from a console application: there is no error.
| We develop on WindowsXP SP2: there is no error with our Web developement
| configuration.
| On our server W2003, the ASP.Net application creates the process with the
| simple c# program and there the error appears. In the Windows tasks list,
we
| can see the new process.
| We made the test with C# program with no code inside: we have the same
error
| on server W2003.
|
| "Willy Denoyette [MVP]" a écrit :
|
| > Ok, but what kind of application is this (the simple C#), don't forget
that
| > the error comes from this application that fails to initialize.
| > What happens if you run this from a console application?
| >
| > Willy.
| >
| > "Steve4D" <(E-Mail Removed)> wrote in message
| > news9180B23-FE7A-4490-9F30-(E-Mail Removed)...
| > |I use IIS 6 under Windows2003 Server.
| > | The Framework.Net version is 1.1.4322 .
| > | My server is in the domain Domain_1.
| > | I try to launch a background process using alternate credentials with
the
| > | login Domain_1\ProcessUser. The process is a simple c# program.
| > | The identity of the ASP.Net process is defined with the login
| > | Domain_1\ASPUser.
| > | The value of StartUpInfo.lpDesktop is NULL.
| > | The value of dwLogonFlags is LOGON_NETCREDENTIALS_ONLY .
| > |
| > | Steve.
| > |
| > |
| > | "Willy Denoyette [MVP]" a Ãf©crit :
| > |
| > | >
| > | > "Steve4D" <(E-Mail Removed)> wrote in message
| > | > news2D0BE32-90CE-4B0D-A1A8-(E-Mail Removed)...
| > | > | With an ASP.NET application, I try to run an external program
(like
| > EXE,
| > | > BAT)
| > | > | with a logon of an another user. I use CreateProcessWithLogonW
from
| > API
| > | > | "advapi32.dll" . When my ASP.NET application launches my EXE
program
| > via
| > | > | CreateProcessWithLogonW, the process starts but an error appears
| > | > "Application
| > | > | failed to initialze" : why ?
| > | > |
| > | >
| > | > A few question, what are you trying to achieve by this? If you are
| > trying to
| > | > launch an interactive process using this API, you better stop here
as it
| > | > won't work anyway.
| > | >
| > | > If you are just trying to launch a background process using
alternate
| > | > credentials;
| > | > What is the identity of the ASP.NET process?
| > | > Note that you can't use localsystem (SYSTEM) to call
| > | > CreateProcessWithLogonW.
| > | > What's the value of startInfo.lpDesktop?
| > | > What is the value of the dwLogonFlags argument?
| > | >
| > | > Willy.
| > | >
| > | >
| > | >
| >
| >
| >


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: "The application failed to initialize properly (0xc0000006). Click on OK to terminate the application" II Gerry Windows XP Help 0 3rd Jun 2009 03:52 PM
The application failed to intialize properly (0xc0000005) thorq2 Windows XP Embedded 3 25th Feb 2008 04:22 PM
How to return a proper "Successful" or "Failed" notice to SQL Server Jobs from a VB.NET application BostonNole Microsoft VB .NET 1 6th Nov 2006 05:29 PM
Beta 2 compiled executable throwing "The application failed to initialize properly (0xc0150002). Click OK to terminate this application." Gustavo L. Fabro Microsoft VC .NET 3 20th May 2005 06:59 PM
Application Error "cannot get stats" and "Main Window Initialization Failed" Cheri Johnson Windows XP Basics 1 11th Nov 2003 02:28 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:31 PM.