Fixed pointer declarations in add_event_source method.
Added some registry related constants.
Fixed error number handling in add_event_source method.