hook CreateFile for logging