views:

140

answers:

2

Decimal: 143196173
Hex: 0x889000D

Results from a call to IAudioSessionControl2->GetProcessId().

GetLastError = 126*
Message = "The specified module could not be found"

I'm not really sure how to interpret this error. Additionally, I can't find a description of the HRESULT anywhere. The documented return codes are S_OK, E_POINTER, AUDCLNT_E_NO_SINGLE_PROCESS, and AUDCLNT_E_DEVICE_INVALIDATED.

Anyone know what this code indicates?

*This is an error marshalled across a managed/unmanaged boundary, obtained by Marshal.GetLastError with a Win32Exception providing the message. It could be bogus, but its what I've got. The HRESULT is pulled out of the unmanaged code directly.


Further investigation, FAILED() doesn't seem to think this is an error. However, the out parameter is cleared (set to 0) which doesn't really make sense. Also, GetErrorInfo returns S_FALSE; so there isn't any additional debug info to go on.

A: 

COM methods can set IErrorInfo on failure. Try to retrieve it - it can contain additional information. In unmanaged code you use GetErrorInfo() for that.

sharptooth
The audio APIs don't use GetErrorInfo unfortunately.
Larry Osterman
+3  A: 

This is AUDCLNT_S_NO_CURRENT_PROCESS - I realized that it somehow missed the Windows 7 SDK headers too late.

The SDK documentation is going to be updated to reflect this.

The result means that the session is a cross process session. The process ID returned is the process ID for the first process which created the session, but if you get this result, you really can't depend on the process ID since the process ID isn't unique.

Larry Osterman
I'm seeing a process id of 0 in conjunction with this error code, which kind of conflicts with the "first process" bit. Regardless, I can just treat this as a "bail" condition with a bit more work.
Kevin Montrose
If you're seeing a process ID of 0, it's probably the windows sounds session (you can use IAudioSessionControl2->IsSystemSoundsSession() to check). The windows sounds session never has a process ID.
Larry Osterman