r9218: make the winreg library code handle arbitrary paths more efficiently