Re: [ros-dev] [ros-diffs] [hbelusca] 75133: [NTOS]: Revert the pool tag change from r75128, and explain in comment why we cannot actually use it.

2017-06-19 Thread Javier Agustìn Fernàndez Arroyo
imho the more documented the code is, the easier to read and understand

El 19/06/2017 19:48, "Thomas Faber"  escribió:

> On 2017-06-19 18:29, hbelu...@svn.reactos.org wrote:
>
>> +/*
>> + * Free it from the pool.
>> + *
>> + * We cannot use here ExFreePoolWithTag(..., OB_NAME_TAG); ,
>> because
>> + * the object name may have been massaged during operation by
>> different
>> + * object parse routines. If the latter ones have to resolve a
>> symbolic
>> + * link (e.g. as is done by CmpParseKey() and
>> CmpGetSymbolicLink()),
>> + * the original object name is freed and re-allocated from the
>> pool,
>> + * possibly with a different pool tag. At the end of the day,
>> the new
>> + * object name can be reallocated and completely different, but
>> we
>> + * should still be able to free it!
>> + */
>> +ExFreePool(Buffer);
>>
>
> I feel like
>
> ExFreePoolWithTag(Buffer, 0)
>
> conveys that same message without needing a huge comment?
>
> ___
> Ros-dev mailing list
> Ros-dev@reactos.org
> http://www.reactos.org/mailman/listinfo/ros-dev
___
Ros-dev mailing list
Ros-dev@reactos.org
http://www.reactos.org/mailman/listinfo/ros-dev

Re: [ros-dev] [ros-diffs] [hbelusca] 75133: [NTOS]: Revert the pool tag change from r75128, and explain in comment why we cannot actually use it.

2017-06-19 Thread Thomas Faber

On 2017-06-19 18:29, hbelu...@svn.reactos.org wrote:

+/*
+ * Free it from the pool.
+ *
+ * We cannot use here ExFreePoolWithTag(..., OB_NAME_TAG); , because
+ * the object name may have been massaged during operation by different
+ * object parse routines. If the latter ones have to resolve a symbolic
+ * link (e.g. as is done by CmpParseKey() and CmpGetSymbolicLink()),
+ * the original object name is freed and re-allocated from the pool,
+ * possibly with a different pool tag. At the end of the day, the new
+ * object name can be reallocated and completely different, but we
+ * should still be able to free it!
+ */
+ExFreePool(Buffer);


I feel like

ExFreePoolWithTag(Buffer, 0)

conveys that same message without needing a huge comment?

___
Ros-dev mailing list
Ros-dev@reactos.org
http://www.reactos.org/mailman/listinfo/ros-dev