Skip to content

Commit

Permalink
Merge pull request microsoft#1220 from judzmura/simpleAudioUpdates
Browse files Browse the repository at this point in the history
Small fixes to sample.
  • Loading branch information
NeoAdonis authored Sep 19, 2024
2 parents 66f7736 + 82646a9 commit d65f6bb
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 107 deletions.
2 changes: 1 addition & 1 deletion audio/simpleaudiosample/Source/Filters/speakertoptable.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ static
KSJACK_DESCRIPTION SpeakerJackDescBridge =
{
KSAUDIO_SPEAKER_STEREO,
0xB3C98C, // Color spec for green
JACKDESC_RGB(0xB3,0xC9,0x8C), // Color spec for green
eConnTypeUnknown,
eGeoLocFront,
eGenLocPrimaryBox,
Expand Down
6 changes: 4 additions & 2 deletions audio/simpleaudiosample/Source/Main/common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2511,7 +2511,7 @@ Return Value:

// Allocate the key value name string
pwstrKeyValueName = (PWSTR)ExAllocatePool2(POOL_FLAG_NON_PAGED, kvFullInfo->NameLength + sizeof(WCHAR)*2, MINADAPTER_POOLTAG);
IF_TRUE_ACTION_JUMP(kvFullInfo == NULL, ntStatus = STATUS_INSUFFICIENT_RESOURCES, loop_exit);
IF_TRUE_ACTION_JUMP(pwstrKeyValueName == NULL, ntStatus = STATUS_INSUFFICIENT_RESOURCES, loop_exit);

// Copy the key value name from the full information struct
RtlStringCbCopyNW(pwstrKeyValueName, kvFullInfo->NameLength + sizeof(WCHAR)*2, kvFullInfo->Name, kvFullInfo->NameLength);
Expand All @@ -2531,6 +2531,7 @@ Return Value:
if (pwstrKeyValueName)
{
ExFreePoolWithTag(pwstrKeyValueName, MINADAPTER_POOLTAG);
pwstrKeyValueName = NULL;
}

// Bail if anything failed
Expand Down Expand Up @@ -2618,7 +2619,7 @@ Return Value:

// Allocate the key name string
pwstrKeyName = (PWSTR)ExAllocatePool2(POOL_FLAG_NON_PAGED, kBasicInfo->NameLength + sizeof(WCHAR), MINADAPTER_POOLTAG);
IF_TRUE_ACTION_JUMP(kBasicInfo == NULL, ntStatus = STATUS_INSUFFICIENT_RESOURCES, loop_exit);
IF_TRUE_ACTION_JUMP(pwstrKeyName == NULL, ntStatus = STATUS_INSUFFICIENT_RESOURCES, loop_exit);

// Copy the key name from the basic information struct
RtlStringCbCopyNW(pwstrKeyName, kBasicInfo->NameLength + sizeof(WCHAR), kBasicInfo->Name, kBasicInfo->NameLength);
Expand Down Expand Up @@ -2652,6 +2653,7 @@ Return Value:
if (pwstrKeyName)
{
ExFreePoolWithTag(pwstrKeyName, MINADAPTER_POOLTAG);
pwstrKeyName = NULL;
}

// Close the current source key
Expand Down
52 changes: 0 additions & 52 deletions audio/simpleaudiosample/Source/Main/minwavert.h
Original file line number Diff line number Diff line change
Expand Up @@ -204,58 +204,6 @@ class CMiniportWaveRT :
};
#pragma code_seg()

//---------------------------------------------------------------------------------------------------------
// volume
//---------------------------------------------------------------------------------------------------------
NTSTATUS GetVolumeChannelCount
(
_Out_ UINT32* pulChannelCount
);

NTSTATUS GetVolumeSteppings
(
_Out_writes_bytes_(_ui32DataSize) PKSPROPERTY_STEPPING_LONG _pKsPropStepLong,
_In_ UINT32 _ui32DataSize
);

NTSTATUS GetChannelVolume
(
_In_ UINT32 _uiChannel,
_Out_ LONG* _pVolume
);

NTSTATUS SetChannelVolume
(
_In_ UINT32 _uiChannel,
_In_ LONG _Volume
);

//-----------------------------------------------------------------------------
// mute
//-----------------------------------------------------------------------------
NTSTATUS GetMuteChannelCount
(
_Out_ UINT32* pulChannelCount
);

NTSTATUS GetMuteSteppings
(
_Out_writes_bytes_(_ui32DataSize) PKSPROPERTY_STEPPING_LONG _pKsPropStepLong,
_In_ UINT32 _ui32DataSize
);

NTSTATUS GetChannelMute
(
_In_ UINT32 _uiChannel,
_Out_ BOOL* _pbMute
);

NTSTATUS SetChannelMute
(
_In_ UINT32 _uiChannel,
_In_ BOOL _bMute
);

private:
_IRQL_raises_(DISPATCH_LEVEL)
_Acquires_lock_(m_DeviceFormatsAndModesLock)
Expand Down
52 changes: 0 additions & 52 deletions audio/simpleaudiosample/Source/Main/minwavertstream.h
Original file line number Diff line number Diff line change
Expand Up @@ -131,63 +131,11 @@ class CMiniportWaveRTStream :

public:

NTSTATUS GetVolumeChannelCount
(
_Out_ UINT32* puiChannelCount
);

NTSTATUS GetVolumeSteppings
(
_Out_writes_bytes_(_ui32DataSize) PKSPROPERTY_STEPPING_LONG _pKsPropStepLong,
_In_ UINT32 _ui32DataSize
);

NTSTATUS GetChannelVolume
(
_In_ UINT32 _uiChannel,
_Out_ LONG* _pVolume
);

NTSTATUS SetChannelVolume
(
_In_ UINT32 _uiChannel,
_In_ LONG _Volume
);

NTSTATUS GetMuteChannelCount
(
_Out_ UINT32* puiChannelCount
);

NTSTATUS GetMuteSteppings
(
_Out_writes_bytes_(_ui32DataSize) PKSPROPERTY_STEPPING_LONG _pKsPropStepLong,
_In_ UINT32 _ui32DataSize
);

NTSTATUS GetChannelMute
(
_In_ UINT32 _uiChannel,
_Out_ BOOL* _pbMute
);

NTSTATUS SetChannelMute
(
_In_ UINT32 _uiChannel,
_In_ BOOL _bMute
);

//presentation
NTSTATUS GetPresentationPosition
(
_Out_ KSAUDIO_PRESENTATION_POSITION *_pPresentationPosition
);

NTSTATUS SetCurrentWritePosition
(
_In_ ULONG ulCurrentWritePosition
);


ULONG GetCurrentWaveRTWritePosition()
{
Expand Down

0 comments on commit d65f6bb

Please sign in to comment.