   UAC 7/Vista
  So, anyone know what UAC is doing that causes the device to be lost when you've got a D3D window visible?  I know it's just another case of handling a lost device; I'm just curious to know what/why/how it needs to nuke the display adaptor (D3D 9 of course).
  It's a secure desktop switch, which does exactly the same things as log-off or switch user. The dialog exists in a separate secure desktop to prevent clickjacking attacks.   ;  I remember seeing a spec which states that the contents of the GPU memory must be set to 0 upon switching to a secure desktop (such as the UAC prompt). This is due to the fact that sensitive information could be visible on unerased textures; among other possible attacks, a hacker could exploit that information if he/she would be able to hook to the switch procedure (a different but potentially related attack).   ;  Interesting.  So the memory containing the front buffer presumably has some special lock around it and everything else gets zapped.   ;  I believe that the system pages the previous display buffer to system memory, then empties the GPU memory and finally allocates the GPU resources needed to display the secure desktop. Remember that in Vista and 7, the video memory is virtualized anyway.   