[PATCH v4 0/1] MR59: Draft: hnetcfg/tests: Add firewall tests

Fabian Maurer (@DarkShadow44) wine at gitlab.winehq.org
Wed May 11 17:46:41 CDT 2022


Fabian Maurer (@DarkShadow44) commented about dlls/hnetcfg/tests/policy.c:
> +        lstrcatW(buffer, L",");
> +        lstrcatW(buffer, append);
> +        if (*entry + entry_len + 1 == rule_buffer + *next_buffer_pos) /* Already at end of buffer */
> +        {
> +            /* Just extend */
> +            memcpy((WCHAR*)*entry, buffer, len * sizeof(WCHAR));
> +            *next_buffer_pos += lstrlenW(append) + 1;
> +        }
> +        else
> +        {
> +            memcpy(rule_buffer + *next_buffer_pos, buffer, len * sizeof(WCHAR));
> +            *entry = rule_buffer + *next_buffer_pos;
> +            *next_buffer_pos += len;
> +        }
> +    }
> +}
Can you give feedback on this part please? I designed the rule struct such that it doesn't need to be freed, but then noticed that Windows tends to separate port entries into different strings... Currently I'm adding them into the buffer, though I'm not sure if that is the best approach here...

-- 
https://gitlab.winehq.org/wine/wine/-/merge_requests/59#note_794



More information about the wine-devel mailing list