-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Am 2015-04-22 um 05:30 schrieb Alistair Leslie-Hughes:
- if(*pdwBufferSize < entry->size || *pdwNameLen < namesize)
- {
*pdwNameLen = namesize + 1;
*pdwBufferSize = entry->size;
return DPNERR_BUFFERTOOSMALL;
- }
- if((*pdwNameLen && !pwszName) || (*pdwBufferSize && !pvBuffer))
return E_POINTER;
This check suggests that a NULL pwszName is ok if *pdwNameLen is 0. However, the above check fails in this situation. Depending on how you want this to behave there's either an error in your logic or you have some redundant checks in there.
Are you sure *pdwDataType is not set in the BUFFERTOOSMALL case? I mentioned pdwDataType in the last feedback already, please take a bit more care and check if some things I point out apply in a similar way to other places, and re-read the feedback you get after you think you have implemented all the changes to see if there's anything you missed.
case DPNA_DATATYPE_DWORD:
*(DWORD*)pvBuffer = entry->data.value ;
The extra space in front of the semicolon looks weird.
hr = IDirectPlay8Address_GetComponentByIndex(localaddr, 100, NULL, NULL, NULL, &bufflen, &type);
todo_wine ok(hr == E_POINTER, "got 0x%08x\n", hr);
ok(hr == DPNERR_INVALIDPOINTER, "got 0x%08x\n", hr);
In the code you return E_POINTER. DPNERR_INVALIDPOINTER is defined as E_POINTER, but please try to be consistent.
hr = IDirectPlay8Address_GetComponentByIndex(localaddr, i, NULL, &namelen, NULL, &bufflen, &type);
todo_wine ok(hr == DPNERR_BUFFERTOOSMALL, "got 0x%08x\n", hr);
ok(hr == DPNERR_BUFFERTOOSMALL, "got 0x%08x\n", hr);
ok(namelen > 0, "namelen length is 0\n");
ok(bufflen > 0, "bufflen length is 0\n");
Please check the exact length, not just > 0. Please also check the name string, and the string and lengths in the success case (e.g. if you pass a length > than the necessary size does dpnet change the size?). Also, as pointed out above