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...