HighTechTalks DotNet Forums  

what happens when my program startsup ?

Dotnet Framework (CLR) microsoft.public.dotnet.framework.clr


Discuss what happens when my program startsup ? in the Dotnet Framework (CLR) forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Sreeharsha
 
Posts: n/a

Default what happens when my program startsup ? - 04-24-2004 , 09:46 AM






Hi there
I have a quesion regadring what happens when my "Hello World" program starts up. I have a hard time visualiszing this.

Lets suppose I have a Simple Console based Hello World EXE program. When I run this from command line what are the steps that it goes through to execute the program. I guess CLR has to be started before running this program. Please help me on this basic question
Thank
Sreeharsha.

Reply With Quote
  #2  
Old   
Chris Rolon
 
Posts: n/a

Default Re: what happens when my program startsup ? - 04-25-2004 , 01:03 PM






Here is a simplified version of what happens:

The OS loader checks for managed modules by examining a bit in the common
object file format (COFF) header. The bit being set denotes a managed
module. If the loader detects managed modules, it loads mscoree.dll, and
_CorValidateImage and _CorImageUnloading notify the loader when the managed
module images are loaded and unloaded. _CorValidateImage performs the
following actions:

1.. Ensures that the code is valid managed code.
2.. Changes the entry point in the image to an entry point in the runtime.
3.. The entry point is Jitted and execution in your app begins.
--

Chris Rolon

This posting is provided "AS IS" with no warranties, and confers no rights.

"Sreeharsha" <sreeharsha75 (AT) yahoo (DOT) com> wrote

Quote:
Hi there,
I have a quesion regadring what happens when my "Hello World" program
starts up. I have a hard time visualiszing this.

Lets suppose I have a Simple Console based Hello World EXE program. When I
run this from command line what are the steps that it goes through to
execute the program. I guess CLR has to be started before running this
program. Please help me on this basic question.
Quote:
Thanks
Sreeharsha.



Reply With Quote
  #3  
Old   
Sreeharsha
 
Posts: n/a

Default Re: what happens when my program startsup ? - 04-25-2004 , 08:36 PM



Thanks Chris for your answer. This clarifies my question. I have to go
little in depth to understand this little better.

Thanks
Sreeharsha.


"Chris Rolon" <crolon (AT) hotmail (DOT) com> wrote

Quote:
Here is a simplified version of what happens:

The OS loader checks for managed modules by examining a bit in the common
object file format (COFF) header. The bit being set denotes a managed
module. If the loader detects managed modules, it loads mscoree.dll, and
_CorValidateImage and _CorImageUnloading notify the loader when the
managed
module images are loaded and unloaded. _CorValidateImage performs the
following actions:

1.. Ensures that the code is valid managed code.
2.. Changes the entry point in the image to an entry point in the
runtime.
3.. The entry point is Jitted and execution in your app begins.
--

Chris Rolon

This posting is provided "AS IS" with no warranties, and confers no
rights.

"Sreeharsha" <sreeharsha75 (AT) yahoo (DOT) com> wrote in message
news:3DC4D531-3B97-4649-98E9-69C4F0173894 (AT) microsoft (DOT) com...
Hi there,
I have a quesion regadring what happens when my "Hello World" program
starts up. I have a hard time visualiszing this.

Lets suppose I have a Simple Console based Hello World EXE program. When
I
run this from command line what are the steps that it goes through to
execute the program. I guess CLR has to be started before running this
program. Please help me on this basic question.
Thanks
Sreeharsha.





Reply With Quote
  #4  
Old   
AT
 
Posts: n/a

Default RE: what happens when my program startsup ? - 04-29-2004 , 08:47 PM



When you run your exe in command window, CLR excution engin will started
and your exe file will be loaded. Since you run on your own machine,
normally default security setting for your own machine give you full
rights. So your code can passed the security checking. and excution engin
will run your code.

But if you run a code through internet or intranet, depending what you do
in your code, the code can be rejected by security checking.

Betsy
This posting is provided "AS IS" with no warranties, and confers no rights.



Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.