Does anyone know how the @CSD gets its information?

Normally you can query the Registry here and get the information.
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion

CSDVersion

I used to modify this entry so that I could test code before there was an @CSD macro. Now, using the macro if I modify the registry entry, it still knows that it is SP1 even though I have changed the value to something else.