Your answer would be that the sentence contains a present participial phrase with a direct object.
Explanation:
The sentence above contains a present participial phrase with a direct object. As this is a present participle, it ends in -ing. What is more, the participle phrase includes objects and modifiers that complete the thought. In the sentence above, the present participle <em>wanting</em> takes the NP direct object <em>a cookie.</em> This participle phrase modifies the pronoun <em>he.</em>