I797 entitles cap exempt regardless of the status(denied/cancelled/221g)?

Section 214(g)(4) of INA provides that “the period of authorized admission as [an H-1B]



nonimmigrant may not exceed 6 years.” INA section 214(g)(7) provides, in pertinent part, as



follows:



Any alien who has already been counted within the 6 years prior to the approval of a



petition described in subsection (c), toward the numerical limitations of paragraph (1)(A)



[b]shall not again be counted toward those limitations unless the alien would be eligible for [/b]



[b]a full 6 years of authorized admission at the time the petition is filed. Where multiple [/b]



[b]petitions are approved for 1 alien, that alien shall be counted only once. [/b]

If it is denied during a lottery situation, I don’t think it counts towards the cap because then they will give the slot to someone else on the waiting list.

I797 is h1b approval notice which means approved already. I’m refering to the outcome of issuance of the visa stamp.