Squeak SmalltalkJoker Squeak Smalltalk : Image VM OS Application : prevnext Windows Environment Variable

> "FileDirectory root" does not return C:\WINDOWS as expected for the
> WINDOWS XP user.
----

I know you won't like this answer, but download .NET Framework 1.1 and 
install (probably already have it), and download and install Squeak 
.NET Bridge on SqueakMap, then....

Run the following in a workspace:

DotNet Environment getEnvironmentVariable: #windir
-----

Win32Utils>>apiGetEnvironmentVariable: lpName with: lpBuffer with: nSize
  <apicall: ulong 'GetEnvironmentVariableA' (char* byte* ulong) module: 'kernel32.dll'>
  ^self externalCallFailed

Win32Utils>>getEnvironmentVariable: aString
  "Win32Utils getEnvironmentVariable: 'windir'"
  | buffer size |
  size := self apiGetEnvironmentVariable: aString with: nil with: 0.
  buffer := String new: size.
  self apiGetEnvironmentVariable: aString with: buffer with: size.
  ^buffer allButLast