Logging in on Samba server fails in Windows 7

Adding the following registry settings in Windows 7 solved this problem for me:

    HKLM\System\CCS\Services\LanmanWorkstation\Parameters
        DWORD  DomainCompatibilityMode = 1
        DWORD  DNSNameResolutionRequired = 0

I found this solution at http://wiki.samba.org/index.php/Windows7.