LanmanServer error 2017 when accessing shared folder

Recently I again had a problem accessing a folder shared by a Windows 7 machine from Windows XP, causing "System error 58 has occurred." on the client and event #2017, "The server was unable to allocate from the system nonpaged pool because the server reached the configured limit for nonpaged pool allocations." on the server.

I found the frequent advice to set HKLM\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters\Size to 3, but since I had the luxury of not having any other connected clients, I just restarted the LanmanServer which is provided by the imaginatively-named "Server" service.