From what I understand in the documentation, it returns null if it fails, but it seems to me there is an exception ready for every fail scenario.
In what standard scenario will this function actually return a null value?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If you look at the code through Reflector, you will see that if the return from the native method
Win32Native.RegCreateKeyEx()returns anything other than an error code of 0 or if the result of the operation isnull, it will then returnnullback to you.A possible failure here is if the incorrect permissions are used, causing an access denied error code to be returned.
The code behind this method is as follows: