vendredi 8 mai 2015

Distinction between a program and library

Typically the CLR deals with two kinds of binary:

A program has a file name ending in .exe, is marked as a program in the PE header, and has an entry point.

A library has a file name ending in .dll, is marked as a library in the PE header, has no entry point, and has metadata describing the callable functions it contains.

What parts of this distinction are actually enforced?

For example, I think the extension in the filename doesn't actually matter for anything except the command search path; once the file is being read, the filename is ignored and only the PE header counts. Is this correct?

Can you take a program and treat it as a library, referring to it from another program and calling some of its functions without using its entry point?

Can a library have an entry point? If so, can it be run like a program?

Aucun commentaire:

Enregistrer un commentaire