How common are ACLs > 4096 bytes? Could you try calling RegKeyGetSecurity twice? First with a length of 0. Then RegKeyGetSecurity will set length to the required buffer size which you can allocate dynamically using new.
Whatever Corinna or Christopher want me to do is fine with me. I just copied some code from elsewhere in Cygwin. -- Joe Buehler