I found strace and ltrace were good tools on Linux to diagnose many problems.
On Windows, similar tools actually exist. The equivalent to strace, perhaps is, Process Monitor and that to ltrace, Logger and LogViewer.
In addition, Windows' event instrumentation is useful.
A good article is http://jbremer.org/intercepting-system-calls-on-x86_64-windows/ . The post is based on the discussion at http://stackoverflow.com/questions/3847745/systrace-for-windows.