Before making any other calls to PortAudio, you 'must' call Pa_Initialize(). This will trigger a scan of available devices which can be queried later. Like most PA functions, it will return a result of type paError. If the result is not paNoError, then an error has occurred.
You can get a text message that explains the error message by passing it to Pa_GetErrorText( err ). For Example:
It is also important, when you are done with PortAudio, to Terminate it: