CHAPTER 14 BUILDING AND CONFIGURING CLASS LIBRARIES
The Windows File Header
The Windows file header establishes the fact that the assembly can be loaded and manipulated by the
Windows family of operating systems. This header data also identifies the kind of application (consolebased, GUI-based, or *.dll code library) to be hosted by Windows. If you open a .NET assembly using
the dumpbin.exe utility (via a Developer Command Prompt) and specify the /headers flag as so:
dumpbin /headers CarLibrary.dll
you can view an assembly’s Windows header information. Here is the (partial) Windows header
information for the CarLibrary.dll assembly you will build a bit later in this chapter (if you would like to
run dumpbin.exe yourself right now, you can specify the name of any *.dll or *.exe you wrote during
this book in place of CarLibrary.dll):
Dump of file CarLibrary.dll
PE signature found
File Type: DLL
FILE HEADER VALUES
14C machine (x86)
3 number of sections
4B37DCD8 time date stamp Sun Dec 27 16:16:56 2011
0 file pointer to symbol table
0 number of symbols
E0 size of optional header
2102 characteristics
Executable
32 bit word machine
DLL
OPTIONAL HEADER VALUES
10B magic # (PE32)
8.00 linker version
E00 size of code
600 size of initialized data
0 size of uninitialized data
2CDE entry point (00402CDE)
2000 base of code
4000 base of data
400000 image base (00400000 to 00407FFF)
2000 section alignment
200 file alignment
4.00 operating system version
0.00 image version
4.00 subsystem version
0 Win32 version
8000 size of image
200 size of headers
0 checksum
3 subsystem (Windows CUI)
512