IIS 7 Hello World Module Walkthrough

The other day I found out that the Vista SDK includes a compiler. I was very excited to find this out, cause now creating a "Hello World" IIS 7 C++ module only requires one huge install (and two little ones).

Build:

  1. Install the Vista SDK
  2. Unzip attached helloworld.zip to \temp\hello
  3. cd "\Program Files\Microsoft SDKs\Windows\v6.0\Bin"
  4. setenv.cmd /debug /x86 /vista
  5. cd \temp\hello
  6. build.bat

Deploy:

  1. cd %windir%\system32\inetsrv
  2. appcmd add backup hellobackup
  3. appcmd install module /name:Helloworld /image:\temp\hello\hello_world.dll
  4. appcmd set config -section:handlers "-+[name='HelloHandler',path='*.hello',verb='*',modules='Helloworld']"

Test:

  1. Install wfetch
  2. Set the path field to: /a.hello
  3. Expected: Hello World

Debug:

  1. Install the debugger to c:\debuggers (checkout c:\debuggers\debugger.chm index tab for more details on the commands below)
  2. cmd: net stop was /y
  3. cmd: cd %windir%\system32\inetsrv
  4. cmd: c:\debuggers\windbg -2 -g -G w3wp.exe /debug
  5. debugger: Ctrl-Break
  6. debugger: .sympath SRV*c:\localsymbols*http://msdl.microsoft.com/download/symbols
  7. debugger: bm hello_world!*execute*
  8. debugger: g
  9. wfetch: F5
May the force be with you :-).

No Comments