On Wed Sep 3 20:18:11 2025 +0000, Ivan Lyugaev wrote:
This block repeats the initialization of the parameters in the InitializeDialog function. I have saved only the necessary operations to generate the parameters. ` /* initialize values */ if (opt.type == TYPE_STRING && opt.constraint_type != CONSTRAINT_NONE) { CHAR buffer[255]; WCHAR *p; for (p = opt.constraint.strings; *p; p += lstrlenW(p) + 1) SendMessageW( control,CB_ADDSTRING,0, (LPARAM)p ); sane_option_get_value( i, buffer ); SendMessageA(control,CB_SELECTSTRING,0,(LPARAM)buffer); } `
TYPE_STRING with CONSTRAINT_NONE is handled in `create_item`. It seems that an editbox is created in this case. I guess it's assumed that there is no default value that we would need to set, and the only way it would change is by user input.
But since it's not handled in InitializeDialog, handling it here wouldn't make it possible to load the setting. I think that's OK for an initial implementation, but we should make sure undefined memory isn't used later, and print some error so it's possible to tell what's wrong.