What is the meaning of these Windows Environment variables:
Who
HOMEDRIVE/HOMEPATH is where the user's personal files are: downloads, music, documents, etc.
HOMESHARE is used instead of HOMEDRIVE if the home directory uses UNC paths.
USERPROFILE is used to store the user's application and OS configuration files and personalization settings. It includes both local and roaming (Active Directory) folders. It seems like people favor using this more than HOMEPATH nowadays.
It's important to note that although HOMEDRIVE/HOMEPATH is often the same path as USERPROFILE, it's not always the case.
I don't think Samba would modify these. It might make use of them to provide an initial (home) directory. Active Directory may change them though.
References:
[dead link] Environment Variables in Windows NT
Where Should I Store my Data and Configuration Files if I Target Multiple OS Versions?