[PATCH v6 05/12] msscript.ocx: Implement IScriptModuleCollection::get_Item.

Gabriel Ivăncescu gabrielopcode at gmail.com
Thu Jun 25 07:16:50 CDT 2020


On 24/06/2020 18:33, Jacek Caban wrote:
> On 24.06.2020 16:16, Gabriel Ivăncescu wrote:
>> +static ScriptModule *find_module(ScriptControl *control, BSTR name)
>> +{
>> +    if (!wcsicmp(name, L"Global"))
>> +        return control->modules[0];
> 
> 
> Does it have to be a special case? You store names for other modules 
> anyway, why not use that for global module as well?
> 
> 
> Thanks,
> 
> Jacek
> 

Well the issue is that NULL is needed for get_script_dispatch and 
parse_script_text, since the global module must pass a NULL name there, 
not "Global" (it would also break existing tests, and the new ones added).

So I decided to special case it in find_module and get_Name instead, 
since checking for NULL is easier than checking if it is "Global" and 
replacing it with NULL in those 2 places.

Do you have a better idea?



More information about the wine-devel mailing list