Because you're using a sucky Windows. One that is not designed for such fancy things as networking. You'll find that an upgrade to Windows NT3.51 or better (that's NT4, 2000 or XP) will solve your problems.
GetComputerNameEx might work for you. Go here for the MSDN article on it. I don't think that you can get the user name with it, but I know there's a function for that too, though I can't remember what it is.