If you get user32.dll failure when starting a service or out of memory errors when you have available memory, try this:
Scan for SharedSection=xxxx, yyyy where xxxx defines the maximum size of the system-wide heap (in kilobytes) and yyyy defines the size of the per desktop heap. Add ",zzzz" immediately after yyyy where zzzz is the size of the hidden desktop heap created by non-interactive processes. Setting this to 512 will often solve your problem. When you're done, this string will look like SharedSection=xxxx, yyyy, zzz.
If you still get out of memory errors, increase yyyy by 256 until the application runs.
You might also delete RegistrySizeLimit from HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control and setting PagePoolSize to 0 at
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Memory Management.
You will need to reboot.