I suggest closing the pool at the very end of the provided sample. The CloseThreadpoolCleanupGroupMembers function waits for all the cleanup group members to terminate before releasing them. If you close the pool beforehand, as described, the callback function may never be invoked.