Hi All,
I am using Naudio to access audio device properties and receive device connected or removed notification.
i am using MMDeviceEnumerator's RegisterEndpointNotificationCallback(IMMNotificationClient) register for notifications.
The code compiles and runs but when is connect a jack device i recieve. the following errors.
System.AccessViolationException was unhandledHResult=-2147467261
Message=Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
Source=mscorlib
StackTrace:
at System.Runtime.InteropServices.Marshal.AddRef(IntPtr pUnk)
at System.Management.SinkForEventQuery.Indicate(IntPtr pWbemClassObject)
InnerException: FatalExecutionEngineError was detected
Message: The runtime has encountered a fatal error. The address of the error was at 0x6aab9017, on thread 0x1f10. The error code is 0xc0000005. This error may be a bug in the CLR or in the unsafe or non-verifiable portions of user code. Common sources of this bug include user marshaling errors for COM-interop or PInvoke, which may corrupt the stack.
Ours is a Winforms application. Please help .