It was an alignment problem. Once I put ALIGN 2 on the COORD struct in the MOUSE_EVENT_RECORD struct, it started to work.