summaryrefslogtreecommitdiff
path: root/audio/sysvad/EndpointsCommon
diff options
context:
space:
mode:
authorKarl Froelich <[email protected]>2017-03-02 10:57:21 -0800
committerGitHub <[email protected]>2017-03-02 10:57:21 -0800
commit48aa498e457916c6dabdf1ce21668b6beea3c934 (patch)
tree1949d90ccb5e33673bea1a5936e266a85776c8dc /audio/sysvad/EndpointsCommon
parentc824f13901087ce6fcdc2a0c777a9d1e0fc04055 (diff)
parent902b548c15ab0d7bea57fdbf88286d2fe1af7364 (diff)
Merge pull request #114 from girishpattabiraman/master
Resolve SAL warnings and suppress 4595
Diffstat (limited to 'audio/sysvad/EndpointsCommon')
-rw-r--r--audio/sysvad/EndpointsCommon/EndpointsCommon.vcxproj4
-rw-r--r--audio/sysvad/EndpointsCommon/MiniportStreamAudioEngineNode.cpp8
-rw-r--r--audio/sysvad/EndpointsCommon/micarraytopo.cpp21
-rw-r--r--audio/sysvad/EndpointsCommon/minwavert.cpp16
-rw-r--r--audio/sysvad/EndpointsCommon/minwavert.h6
-rw-r--r--audio/sysvad/EndpointsCommon/minwavertstream.cpp9
-rw-r--r--audio/sysvad/EndpointsCommon/minwavertstream.h6
7 files changed, 48 insertions, 22 deletions
diff --git a/audio/sysvad/EndpointsCommon/EndpointsCommon.vcxproj b/audio/sysvad/EndpointsCommon/EndpointsCommon.vcxproj
index 725d3237..1956d106 100644
--- a/audio/sysvad/EndpointsCommon/EndpointsCommon.vcxproj
+++ b/audio/sysvad/EndpointsCommon/EndpointsCommon.vcxproj
@@ -98,6 +98,7 @@
<PreprocessorDefinitions>%(PreprocessorDefinitions);_USE_WAVERT_;SYSVAD_BTH_BYPASS</PreprocessorDefinitions>
<ExceptionHandling>
</ExceptionHandling>
+ <DisableSpecificWarnings>4595;%(DisableSpecificWarnings)</DisableSpecificWarnings>
</ClCompile>
<Midl>
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);$(DDK_INC_PATH);..</AdditionalIncludeDirectories>
@@ -114,6 +115,7 @@
<PreprocessorDefinitions>%(PreprocessorDefinitions);_USE_WAVERT_;SYSVAD_BTH_BYPASS</PreprocessorDefinitions>
<ExceptionHandling>
</ExceptionHandling>
+ <DisableSpecificWarnings>4595;%(DisableSpecificWarnings)</DisableSpecificWarnings>
</ClCompile>
<Midl>
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);$(DDK_INC_PATH);..</AdditionalIncludeDirectories>
@@ -130,6 +132,7 @@
<PreprocessorDefinitions>%(PreprocessorDefinitions);_USE_WAVERT_;SYSVAD_BTH_BYPASS</PreprocessorDefinitions>
<ExceptionHandling>
</ExceptionHandling>
+ <DisableSpecificWarnings>4595;%(DisableSpecificWarnings)</DisableSpecificWarnings>
</ClCompile>
<Midl>
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);$(DDK_INC_PATH);..</AdditionalIncludeDirectories>
@@ -146,6 +149,7 @@
<PreprocessorDefinitions>%(PreprocessorDefinitions);_USE_WAVERT_;SYSVAD_BTH_BYPASS</PreprocessorDefinitions>
<ExceptionHandling>
</ExceptionHandling>
+ <DisableSpecificWarnings>4595;%(DisableSpecificWarnings)</DisableSpecificWarnings>
</ClCompile>
<Midl>
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);$(DDK_INC_PATH);..</AdditionalIncludeDirectories>
diff --git a/audio/sysvad/EndpointsCommon/MiniportStreamAudioEngineNode.cpp b/audio/sysvad/EndpointsCommon/MiniportStreamAudioEngineNode.cpp
index deba14f2..a210f77b 100644
--- a/audio/sysvad/EndpointsCommon/MiniportStreamAudioEngineNode.cpp
+++ b/audio/sysvad/EndpointsCommon/MiniportStreamAudioEngineNode.cpp
@@ -855,9 +855,12 @@ NTSTATUS CMiniportWaveRTStream::SetCurrentWritePositionInternal(_In_ ULONG _ulC
//linear and presentation positions
#pragma code_seg()
-NTSTATUS CMiniportWaveRTStream::GetPositions(_Out_ ULONGLONG *_pullLinearBufferPosition, _Out_ ULONGLONG *_pullPresentationPosition, LARGE_INTEGER *_pliQPCTime)
+NTSTATUS CMiniportWaveRTStream::GetPositions(
+ _Out_opt_ ULONGLONG * _pullLinearBufferPosition,
+ _Out_opt_ ULONGLONG * _pullPresentationPosition,
+ _Out_opt_ LARGE_INTEGER * _pliQPCTime
+ )
{
- ASSERT (_pullLinearBufferPosition);
DPF_ENTER(("[CMiniportWaveRTStream::GetPositions]"));
NTSTATUS ntStatus;
@@ -993,4 +996,3 @@ NTSTATUS CMiniportWaveRTStream::SetStreamCurrentWritePositionForLastBuffer(_In_
return ntStatus;
}
-
diff --git a/audio/sysvad/EndpointsCommon/micarraytopo.cpp b/audio/sysvad/EndpointsCommon/micarraytopo.cpp
index 3316ee84..a8125a08 100644
--- a/audio/sysvad/EndpointsCommon/micarraytopo.cpp
+++ b/audio/sysvad/EndpointsCommon/micarraytopo.cpp
@@ -535,6 +535,8 @@ NT status code.
NTSTATUS ntStatus = STATUS_INVALID_DEVICE_REQUEST;
ULONG nPinId = (ULONG)-1;
+ KFLOATING_SAVE saveData;
+ NTSTATUS fstatus;
if (PropertyRequest->InstanceSize >= sizeof(ULONG))
{
@@ -569,16 +571,27 @@ NT status code.
if (PropertyRequest->PropertyItem->Id == KSPROPERTY_AUDIO_MIC_SENSITIVITY)
{
LONG* micSensitivity = (LONG*)PropertyRequest->Value;
- // Return microphone sensitivity information.
- *micSensitivity = FloatToFixedPoint16_16(MICARRAY_SENSITIVITY); // convert float dBFS to fixed point arithmetic
+
+ fstatus = KeSaveFloatingPointState(&saveData);
+ if (NT_SUCCESS(fstatus))
+ {
+ // Return microphone sensitivity information.
+ *micSensitivity = FloatToFixedPoint16_16(MICARRAY_SENSITIVITY); // convert float dBFS to fixed point arithmetic
+ KeRestoreFloatingPointState(&saveData);
+ }
PropertyRequest->ValueSize = sizeof(LONG);
ntStatus = STATUS_SUCCESS;
}
else if (PropertyRequest->PropertyItem->Id == KSPROPERTY_AUDIO_MIC_SNR)
{
LONG* micSNR = (LONG*)PropertyRequest->Value;
- // Return microphone SNR information.
- *micSNR = FloatToFixedPoint16_16(MICARRAY_SNR); // convert float dB to fixed point arithmetic
+ fstatus = KeSaveFloatingPointState(&saveData);
+ if (NT_SUCCESS(fstatus))
+ {
+ // Return microphone SNR information.
+ *micSNR = FloatToFixedPoint16_16(MICARRAY_SNR); // convert float dB to fixed point arithmetic
+ KeRestoreFloatingPointState(&saveData);
+ }
ntStatus = STATUS_SUCCESS;
}
}
diff --git a/audio/sysvad/EndpointsCommon/minwavert.cpp b/audio/sysvad/EndpointsCommon/minwavert.cpp
index 7d021767..53fcfac2 100644
--- a/audio/sysvad/EndpointsCommon/minwavert.cpp
+++ b/audio/sysvad/EndpointsCommon/minwavert.cpp
@@ -2081,6 +2081,7 @@ CKeywordDetector::CKeywordDetector()
}
#pragma code_seg("PAGE")
+_IRQL_requires_max_(PASSIVE_LEVEL)
VOID CKeywordDetector::ResetDetector()
{
PAGED_CODE();
@@ -2089,7 +2090,8 @@ VOID CKeywordDetector::ResetDetector()
}
#pragma code_seg("PAGE")
-VOID CKeywordDetector::DownloadDetectorData(LONGLONG Data)
+_IRQL_requires_max_(PASSIVE_LEVEL)
+VOID CKeywordDetector::DownloadDetectorData(_In_ LONGLONG Data)
{
PAGED_CODE();
@@ -2097,6 +2099,7 @@ VOID CKeywordDetector::DownloadDetectorData(LONGLONG Data)
}
#pragma code_seg("PAGE")
+_IRQL_requires_max_(PASSIVE_LEVEL)
LONGLONG CKeywordDetector::GetDetectorData()
{
PAGED_CODE();
@@ -2105,6 +2108,7 @@ LONGLONG CKeywordDetector::GetDetectorData()
}
#pragma code_seg("PAGE")
+_IRQL_requires_max_(PASSIVE_LEVEL)
VOID CKeywordDetector::ResetFifo()
{
PAGED_CODE();
@@ -2122,7 +2126,8 @@ VOID CKeywordDetector::ResetFifo()
}
#pragma code_seg("PAGE")
-NTSTATUS CKeywordDetector::SetArmed(BOOL Arm)
+_IRQL_requires_max_(PASSIVE_LEVEL)
+NTSTATUS CKeywordDetector::SetArmed(_In_ BOOL Arm)
{
PAGED_CODE();
@@ -2138,6 +2143,7 @@ NTSTATUS CKeywordDetector::SetArmed(BOOL Arm)
}
#pragma code_seg("PAGE")
+_IRQL_requires_max_(PASSIVE_LEVEL)
BOOL CKeywordDetector::GetArmed()
{
PAGED_CODE();
@@ -2146,6 +2152,7 @@ BOOL CKeywordDetector::GetArmed()
}
#pragma code_seg("PAGE")
+_IRQL_requires_max_(PASSIVE_LEVEL)
VOID CKeywordDetector::Run()
{
PAGED_CODE();
@@ -2157,6 +2164,7 @@ VOID CKeywordDetector::Run()
}
#pragma code_seg("PAGE")
+_IRQL_requires_max_(PASSIVE_LEVEL)
VOID CKeywordDetector::Stop()
{
PAGED_CODE();
@@ -2165,6 +2173,7 @@ VOID CKeywordDetector::Stop()
}
#pragma code_seg("PAGE")
+_IRQL_requires_max_(PASSIVE_LEVEL)
VOID CKeywordDetector::StartBufferingStream()
{
LARGE_INTEGER qpc;
@@ -2182,7 +2191,8 @@ VOID CKeywordDetector::StartBufferingStream()
}
#pragma code_seg()
-VOID CKeywordDetector::DpcRoutine(LONGLONG PerformanceCounter, LONGLONG PerformanceFrequency)
+_IRQL_requires_min_(DISPATCH_LEVEL)
+VOID CKeywordDetector::DpcRoutine(_In_ LONGLONG PerformanceCounter, _In_ LONGLONG PerformanceFrequency)
{
LONGLONG currentPacket;
LONGLONG packetsToQueue;
diff --git a/audio/sysvad/EndpointsCommon/minwavert.h b/audio/sysvad/EndpointsCommon/minwavert.h
index aea83095..4660cfa1 100644
--- a/audio/sysvad/EndpointsCommon/minwavert.h
+++ b/audio/sysvad/EndpointsCommon/minwavert.h
@@ -58,7 +58,7 @@ public:
VOID Stop();
_IRQL_requires_min_(DISPATCH_LEVEL)
- VOID DpcRoutine(_In_ LONGLONG PeformanceCounter, _In_ LONGLONG PerformanceFrequency);
+ VOID DpcRoutine(_In_ LONGLONG PerformanceCounter, _In_ LONGLONG PerformanceFrequency);
_IRQL_requires_max_(PASSIVE_LEVEL)
NTSTATUS GetReadPacket(_In_ ULONG PacketsPerWaveRtBuffer, _In_ ULONG WaveRtBufferSize, _Out_writes_(WaveRtBufferSize) BYTE *WaveRtBuffer, _Out_ ULONG *PacketNumber, _Out_ ULONGLONG *PerformanceCount, _Out_ BOOL *MoreData);
@@ -297,9 +297,9 @@ public:
);
public:
- VOID DpcRoutine(LONGLONG PeformanceCounter, LONGLONG PerformanceFrequency)
+ VOID DpcRoutine(LONGLONG PerformanceCounter, LONGLONG PerformanceFrequency)
{
- m_KeywordDetector.DpcRoutine(PeformanceCounter, PerformanceFrequency);
+ m_KeywordDetector.DpcRoutine(PerformanceCounter, PerformanceFrequency);
}
NTSTATUS PropertyHandlerEffectListRequest
diff --git a/audio/sysvad/EndpointsCommon/minwavertstream.cpp b/audio/sysvad/EndpointsCommon/minwavertstream.cpp
index 86d373da..58382639 100644
--- a/audio/sysvad/EndpointsCommon/minwavertstream.cpp
+++ b/audio/sysvad/EndpointsCommon/minwavertstream.cpp
@@ -784,7 +784,6 @@ Done:
//
// ISSUE-2014/10/4 Will this work correctly across pause/play?
#pragma code_seg()
-_IRQL_requires_max_(PASSIVE_LEVEL)
NTSTATUS CMiniportWaveRTStream::GetReadPacket
(
_Out_ ULONG *PacketNumber,
@@ -896,7 +895,6 @@ NTSTATUS CMiniportWaveRTStream::GetReadPacket
}
#pragma code_seg()
-_IRQL_requires_max_(PASSIVE_LEVEL)
NTSTATUS CMiniportWaveRTStream::SetWritePacket
(
_In_ ULONG PacketNumber,
@@ -989,7 +987,6 @@ NTSTATUS CMiniportWaveRTStream::SetWritePacket
//=============================================================================
#pragma code_seg()
-_IRQL_requires_max_(PASSIVE_LEVEL)
NTSTATUS CMiniportWaveRTStream::GetOutputStreamPresentationPosition
(
_Out_ KSAUDIO_PRESENTATION_POSITION *pPresentationPosition
@@ -1008,7 +1005,6 @@ NTSTATUS CMiniportWaveRTStream::GetOutputStreamPresentationPosition
//=============================================================================
#pragma code_seg()
-_IRQL_requires_max_(PASSIVE_LEVEL)
NTSTATUS CMiniportWaveRTStream::GetPacketCount
(
_Out_ ULONG *pPacketCount
@@ -1529,8 +1525,6 @@ TimerNotifyRT
_IRQL_limited_to_(DISPATCH_LEVEL);
- qpc = KeQueryPerformanceCounter(&qpcFrequency);
-
CMiniportWaveRTStream* _this = (CMiniportWaveRTStream*)DeferredContext;
if (NULL == _this)
@@ -1540,6 +1534,9 @@ TimerNotifyRT
KIRQL oldIrql;
KeAcquireSpinLock(&_this->m_PositionSpinLock, &oldIrql);
+
+ qpc = KeQueryPerformanceCounter(&qpcFrequency);
+
// Convert ticks to 100ns units.
LONGLONG hnsCurrentTime = KSCONVERT_PERFORMANCE_TIME(_this->m_ullPerformanceCounterFrequency.QuadPart, qpc);
diff --git a/audio/sysvad/EndpointsCommon/minwavertstream.h b/audio/sysvad/EndpointsCommon/minwavertstream.h
index c429956d..405ae35e 100644
--- a/audio/sysvad/EndpointsCommon/minwavertstream.h
+++ b/audio/sysvad/EndpointsCommon/minwavertstream.h
@@ -253,9 +253,9 @@ private:
NTSTATUS GetPositions
(
- _Out_ ULONGLONG *pullLinearBufferPosition,
- _Out_ ULONGLONG *pullPresentationPosition,
- _Out_ LARGE_INTEGER *_pliQPCTime
+ _Out_opt_ ULONGLONG * _pullLinearBufferPosition,
+ _Out_opt_ ULONGLONG * _pullPresentationPosition,
+ _Out_opt_ LARGE_INTEGER * _pliQPCTime
);
#ifdef SYSVAD_BTH_BYPASS