Question: Hi recently I was programming a synchronization part which strictly requires waiting for vertical retrace. 
So I used a Privileged instruction to do this: \_inp(0x3DA) & 0x08. 
However, this instruction is privileged, and requires an installation of port95NT.exe to work properly on my old XP computer. When now it comes to Win7, run time warning occur to prevent me from execution, and neither can I install port95NT.exe on a 64 bit system.
So anyone has other idea to detect the start of a new frame in vertical retrace on 64 bit Win7?

Answer: 
Microsoft designed APIs like DirectX so that developers didn't have to mess with hardware-level operations like this. Modern Windows versions may no longer have any way to access that hardware port directly.

You can try [`WaitForVerticalBlank()`](http://msdn.microsoft.com/en-us/library/aa911354.aspx) from the DirectDraw API, if you have that toolkit available. If you're using Direct3D, you can try [`D3DPRESENT_INTERVAL_ONE`](http://technet.microsoft.com/en-us/library/bb172585%28v=VS.85%29.aspx) with `Present()` to force updates to wait until just after the vertical sync.
First of all, modern flatpanels DO work that way. Each pixel must be refreshed at regular intervals. There is a row/column strobe and a vertical refresh rate. Although there is no actually "blanking" as there was with CRTS, there is a vertical retrace where row/column values are returned to origin. For double (or triple) buffering systems, buffers must be swapped during this interval to avoid tearing of the frame. In addition, all professional video application must be frame synchronized to provide smooth frame switching, or for "gunlock" with cameras and other studio gear.