-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi,
+static void add_component(IDirectPlay8AddressImpl *This, struct component *item) +{ + if(!This->comp_count) + This->components = HeapAlloc(GetProcessHeap(), 0, sizeof(struct component *) * This->comp_count+1 ); You can use your heap_alloc() helper here. The same applies to the HeapFree calls added in the patch.
Other than that I think error handling would be a good idea. You can check for NULL (as well as in the place where you allocate storage for the component in AddComponent) and return from AddComponent with E_OUTOFMEMORY. The patch has a few formatting issues. Since it looks like dplay & friends will be mostly your reign I'll leave it up to you on how to handle formatting. Do you want me to continue pointing them out? In that case please send me a mail what your intended formatting is. (Obviously it'd be even better if you described your intended formatting to git in the form of a git pre-commit hook containing some regexes ;-) ). Other than this the patch looks good. The following is unrelated to this patch, I just noticed it (again?) while reading through it: Am 2015-01-23 um 08:10 schrieb Alistair Leslie-Hughes:
+ case DPNA_DATATYPE_STRING: + memcpy(pvBuffer, &entry->data.string, entry->size); + break; Please add a test for a case where AddComponent is called with DPNA_DATATYPE_STRING where (strlen(string) + 1) * sizeof(WCHAR) != dwDataSize. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2
iQIcBAEBAgAGBQJUxS4iAAoJEN0/YqbEcdMwvFkP/RF6kH1o1C4fQgfa/J+4j6zV kwp3M7rqU5VTasKYV+G0pdAQ+wvBzHpMPSqLRD/HfBWGf3dAPCk94C9d659enkJN Qhy7hhO6aazsXKq7iWVAgQrGJy59oBoL14Vg+44hUJIeu7qWv3uuqihVgKUqiG2K Bl235p9cM/WYLGXFEF4d1UFHBKZb0bhRudwuzRbuN8r3RLwpEhrKbbKg8yXOPjLq Vejc4d219iib3ZpbT13pq0j/+a+ox+R62+O9S5wGbu/G8IGxVPTgsY20mpFyPsHX DoedE56wfSSe5Psb78NVmC32bWY8nmUzJA9YBb26a0KPO9QZNVnJkkYkOKIFr6P/ ouVLfWbO4QV2dOPRbYnh+40XCIbPeatGMq9vE7TDZPtxLBkRTEl1GudZ5usFwCK7 XgTPjb+BIu37UCbt0hpWA4IH8UeyYue08DnGCWkMkGS6ClH9KCG2xVqL8F1gr8Bw W5iKcVVHFZzHS6D947nN17Fl6Rg4+oLui0zkgtveU/AY/ew8xptHt4rW6It3QU5t HkNce4St+2w1LErIuYRITrvQV6lrndDDgvvlPcK1P1zt2D1a9gpqnsPgKM/tZLu+ fO8P8Yjl81KZHlAVWMUutiDzlelUOJvaXnVNX5VVkyOajHDI569MKy4qOETSdiim gwulxslghTkPCsAa+LpB =iY0u -----END PGP SIGNATURE-----