Touch the exe, after you added a manifest for it, in Vista
You are an enthusiastic and responsible developer. You love programming, and you love programming the right way.
So you get the latest and greatest Windows Vista. You try your hard-worked amazing.exe application in Vista. Did not work. Apparently, amazing.exe needs admin privilege to do wonderful things. But in Vista, the user by default does not have admin privilege.
You did your research. You understand that you need to add a manifest to your application, and declare that the application requires administrator in the manifest. So you added amazing.exe.manifest, and put it next to amazing.exe.
Did not work. Amazing.exe did not get admin privilege.
You double checked the syntax of the manifest. Yes, it is right. You compared it to another working example. Yes, they are the same. You run amazing.exe again. Still did not work.
You are angry. What is going on, Microsoft?
The truth is, in Windows Vista, in order to improve CreateProcess performance, we cache the fact that an exe has manifest or not. The key to this cache, are the full path of the exe, and the last modified time of the exe file.
After you execute the exe without manifest, when you add a manifest to the exe, in order for the OS to see the manifest, you need to change the last modified time of the exe (or simply say, touch the exe), to invalidate the cache entry for the exe.
The cache only exists in memory, and is never flushed to disk. On reboot the cache starts clean.
At the time we did the work, our measurement shows that the cache improved CreateProcess performance by 10-15% in warm case, when the application does not have manifest.
So remember, touch the exe, after you added a manifest for it, in Vista.