Return value ERROR_NO_MORE_ITEMS should not raise an exception in TRegistry.GetKeyNames/TRegistry.GetValueNames
Original Reporter info from Mantis: datiscum @datiscum
-
Reporter name: Michel
Original Reporter info from Mantis: datiscum @datiscum
- Reporter name: Michel
Description:
The rewritten code now generates exceptions, but for the return value "ERROR_NO_MORE_ITEMS" it should not do so.
Please refer to the documentation from Microsoft.
https://docs.microsoft.com/en-us/windows/win32/api/winreg/nf-winreg-regenumvaluew
Return value
If the function succeeds, the return value is ERROR_SUCCESS.
If the function fails, the return value is a system error code. If there are no more values available, the function returns ERROR_NO_MORE_ITEMS.
If the lpData buffer is too small to receive the value, the function returns ERROR_MORE_DATA.
Additional information:
Since "ERROR_NO_MORE_ITEMS" is no error, the procedure should simply be left directly.
if lResult<>ERROR_NO_MORE_ITEMS then
exit
else if lResult<>ERROR_SUCCESS then
raise ERegistryException.Create(SysErrorMessage(lResult));
Mantis conversion info:
- Mantis ID: 36809
- Build: 3.2
- Fixed in version: 3.3.1
- Fixed in revision: 44429 (#20749e1e)
- Target version: 3.2.0