Details
-
Bug
-
Resolution: Fixed
-
Major
Description
After going into CORE-11399, I tried to launch the ReactOS mspaint and I got many errors. This happens because all settings in:
HKCU\Software\Microsoft\Windows\CurrentVersion\Applets\Paint\View
have been set to zero (CW_USEDEFAULT to be more precise) by Microsoft paint. So, the CreateDIBSection() with size of zero in DIB.CPP returns NULL and all calls to GetObject() on NULL objects return values without sense.
In my opinion, the fixes to be done are:
1) test into RegistrySettings::Load() if a value read form the registry is CW_USEDEFAULT and in this case restore the previous value.
2) test the return value of CreateDIBWithProperties(): if it returns NULL, then try to force defaults by calling RegistrySettings::LoadPresets() and then calling CreateDIBWithProperties() again. If it still fails, print the error and exits.