Vista compatibility - fuss over nothing?

Miscellaneous Forums/General Discussion/Vista compatibility - fuss over nothing?

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

I just checked out the environment variable thing in Vista. It returns a completely different path!

Strict

Extern "Win32"
	Function GetEnvironmentVariable(lpName$z, lpBuffer:Byte Ptr, nSize) = "GetEnvironmentVariableA@12"
End Extern

Print GetEnv("ALLUSERSPROFILE")

End

Function GetEnv$(envVar$)
		Local buff@[64]
		
		Local rtn = GetEnvironmentVariable(envVar$, buff@, buff.length)
		If rtn > buff.length
			buff@ = buff@[..rtn]
			rtn = GetEnvironmentVariable(envVar$, buff@, buff.length)
		EndIf
		
		Return string.FromBytes(buff@, rtn)
End Function


Result: "C:\ProgramData"

in Windows XP, the same code results in "C:\Documents and Settings\All Users", which as I said further up, is not a good place to be storing stuff.