Re: dpnet: Implement IDirectPlay8Address GetComponentByIndex (try 10)
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi, I'm sorry for the late review. I completely forgot about this patch (also in the private mail you sent me). It looks good to me, except one issue noted below that I missed earlier. Am 2015-05-23 um 13:22 schrieb Alistair Leslie-Hughes:
index 7e10136..bad84ef 100644 --- a/dlls/dpnet/address.c +++ b/dlls/dpnet/address.c @@ -405,9 +405,58 @@ static HRESULT WINAPI IDirectPlay8AddressImpl_GetComponentByIndex(IDirectPlay8Ad const DWORD dwComponentID, WCHAR *pwszName, DWORD *pdwNameLen, void *pvBuffer, DWORD *pdwBufferSize, DWORD *pdwDataType) { - IDirectPlay8AddressImpl *This = impl_from_IDirectPlay8Address(iface); - TRACE("(%p): stub\n", This); - return DPN_OK; + IDirectPlay8AddressImpl *This = impl_from_IDirectPlay8Address(iface); + struct component *entry; + int namesize; + + TRACE("(%p)->(%p %p %p %p)\n", This, pwszName, pvBuffer, pdwBufferSize, pdwDataType); You're not tracing dwComponentID and pdwNameLen here. In particular dwComponentID seems important, as it is the thing that the method call retrieves.
+ if(!pdwNameLen || !pdwBufferSize || !pdwDataType) + return DPNERR_INVALIDPOINTER; + + if(dwComponentID > This->comp_count) + return DPNERR_DOESNOTEXIST; As I've noted in other patches it would be a good idea to write a WARN in error cases, especially in a COM method where +relay can't be used to check return values. You can also print the available and required size in case of DPNERR_BUFFERTOSMALL. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2
iQIcBAEBAgAGBQJVZvMGAAoJEN0/YqbEcdMww2sP+gJRvmzLAZ4oXx3FJFSPIvpn JsbdhoKeZkmdsTCPQjvfPVAUKj1qSQcm1w9rRFBthZhkVWNgXGDTbsbTmtVRiATz qqoX+MjKKQeguWmgnEiQY0k/NW15kAvUkP/vT1qQfKOyqadXJs1a6gli0zfqHSqO uviq2P5mQ82vvIYbv5rS8tAGBTh/FHd1802tSPcMGXQqrqqjW3UH/rV4DymP33FF IsSpPBt2niCz7jSt6QGg/8R9Q2xK8D2sOOe1CcLvtRzrh7Ws+j0p1B8Y73aX8047 s7Pp/oUgfmcEUGheeD+c1YlAQOW6Xp9urjiCc9Pqp+sJBv9fJ5p40r9A6wXrP/Jb Zkei91cF+XcwuhZysQX/qJCwff2VyqG55cDdS1R7DTva/DSamhFB6jYrRAjotgrT g4ulnkbVR4khDzJRVk4K9rxJ2OPwoUkPVpspjrKzuT7oEm2U31PVHPUQa8qeIWzr b1vLyDnG/Zz+B27yHc9sLfwZm5olWz2XTDht7kZKGMU2FRy1Q2wK0wZ6Q6ekB/f5 jnnQep7DmgsMe4EN175k5L5e3yW/SISk0U2O/VtukKMbZQ/hoIhHw8ieiaAo16MM S6nvCRbHxRCe9vB/0zKt5+5SAzWrTTsdw03qdeFg82PSGi6I/F7RrrQnY76GtYKB gtjHMs5QPp0FZRriR0T0 =MUbC -----END PGP SIGNATURE-----
participants (1)
-
Stefan Dösinger