CID 1401255 Right now the RegQueryValue call is not receiving the size of the buffer at all. Initialize "len" accordingly.