Although what you posted looks good, Keithuk, I get the following error when I try to run it:

The exception Privileged instruction.

(0xc0000096) occurred in the application at location 0x00199aca

OS: 2000