- static const WCHAR empty = 0;
You could make this on the global scope, call it empty_wchar (or empty_string or something similar) and use it to replace the RegDeleteKeyA with RegDeleteKeyW. That's only a minor style suggestion though, not a requriement.
Or perhaps I could just replace it entirely with `(WCHAR *) "\0"` but it feels a bit hacky. Would that be allowed?
if (0)
return ERROR_ARITHMETIC_OVERFLOW;
...
case ERROR_NOT_NUMBER:
reg_message(STRING_NOT_INT_OR_NEG);
return;
case ERROR_ARITHMETIC_OVERFLOW:
reg_message(STRING_ERANGE);
return;
I don't like the dead code. It also seems that native prints the same error message in both cases, so you don't need to separate between underflows, overflows and strings that are not numbers.
Is the error message generic enough that I could just return ERROR_INVALID_DATA and let the default case handle it? (That error message is "The data is invalid." by the way)