Help needed with a function problem I really cant solve. Why is it that RegOpenKey() returns error success even though it fails. First it fails to return a handle with a valid Registry key/address filling the key paramater with nothing 0 but returns 0 aswell indicating an error_success right? because when I format the error it says "The operation succeeded". Whats really odd is that I tried the same thing and no matter what the functions always returns error_success even when there is an invalid KEY or details supplied to it. If I am not mistaken the getLastError discards the error it pulls out, I dont know perhaps it does. But anyway I always keep getting 0 even the function has clearly failed(from teh function and the Error Message queue. Even though I call RegReadkey afterwards with an invalid handle it succeeds and does not supply the size nor read the value into a buffer. I am confused does anyone know why all these functions are failing and succeeding(according to Format Message). infact in the if statement for regopenkey, it would return error success yet was != to it in the condition I finally had to use a variable in the condition and have it compared to not equal to 0 to get it to work. Is this a problem with Registry virtualization ? I am opening HKEY_LOCAL_MACHINE and a key in the SYSTEM part of it. the code come compiles fine but this happens does this just happen when you compile a program from Visual Studio, is it due to come CLR related thing?
Note I tried to call RegOpenKeyEx same problem any ideas of what might be going on?