diff options
| author | Wei Mao <[email protected]> | 2017-06-22 14:00:22 -0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2017-06-22 14:00:22 -0700 |
| commit | 9c98650f5987e83f250c1e643bbc8c10e5c6d541 (patch) | |
| tree | 5bba55a3275f5f2f6b35d1c3ba3afe87f643d9c5 | |
| parent | 6a7b5d032d331efe11d1c8f33f399296e529d9b7 (diff) | |
| parent | e98f4cac93ec65a484be77d8a795538b02dab72e (diff) | |
Merge pull request #145 from girishpattabiraman/master
Componentized INFs and changes to make components universal
37 files changed, 66 insertions, 4661 deletions
diff --git a/audio/sysvad/KeywordDetectorAdapter/KeywordDetectorContosoAdapter.vcxproj b/audio/sysvad/KeywordDetectorAdapter/KeywordDetectorContosoAdapter.vcxproj index fc459cfa..54913231 100644 --- a/audio/sysvad/KeywordDetectorAdapter/KeywordDetectorContosoAdapter.vcxproj +++ b/audio/sysvad/KeywordDetectorAdapter/KeywordDetectorContosoAdapter.vcxproj @@ -31,7 +31,7 @@ <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> <TargetVersion>Windows10</TargetVersion> <UseDebugLibraries>False</UseDebugLibraries> - <DriverTargetPlatform>Desktop</DriverTargetPlatform> + <DriverTargetPlatform>Universal</DriverTargetPlatform> <DriverType /> <PlatformToolset>WindowsApplicationForDrivers10.0</PlatformToolset> <ConfigurationType>DynamicLibrary</ConfigurationType> @@ -39,7 +39,7 @@ <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> <TargetVersion>Windows10</TargetVersion> <UseDebugLibraries>True</UseDebugLibraries> - <DriverTargetPlatform>Desktop</DriverTargetPlatform> + <DriverTargetPlatform>Universal</DriverTargetPlatform> <DriverType /> <PlatformToolset>WindowsApplicationForDrivers10.0</PlatformToolset> <ConfigurationType>DynamicLibrary</ConfigurationType> @@ -47,7 +47,7 @@ <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> <TargetVersion>Windows10</TargetVersion> <UseDebugLibraries>False</UseDebugLibraries> - <DriverTargetPlatform>Desktop</DriverTargetPlatform> + <DriverTargetPlatform>Universal</DriverTargetPlatform> <DriverType /> <PlatformToolset>WindowsApplicationForDrivers10.0</PlatformToolset> <ConfigurationType>DynamicLibrary</ConfigurationType> @@ -55,7 +55,7 @@ <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> <TargetVersion>Windows10</TargetVersion> <UseDebugLibraries>True</UseDebugLibraries> - <DriverTargetPlatform>Desktop</DriverTargetPlatform> + <DriverTargetPlatform>Universal</DriverTargetPlatform> <DriverType /> <PlatformToolset>WindowsApplicationForDrivers10.0</PlatformToolset> <ConfigurationType>DynamicLibrary</ConfigurationType> diff --git a/audio/sysvad/Package/package.VcxProj b/audio/sysvad/Package/package.VcxProj index 0ea6ab39..cd7c9ddc 100644 --- a/audio/sysvad/Package/package.VcxProj +++ b/audio/sysvad/Package/package.VcxProj @@ -31,9 +31,6 @@ <ProjectReference Include="..\SwapAPO\DelayAPO\DelayAPO.vcxproj"> <Project>{8851AB85-70B3-4798-A149-BA366DF9EC25}</Project> </ProjectReference> - <ProjectReference Include="..\SwapAPO\PropPageExtensions\PropPageExt.vcxproj"> - <Project>{D253C552-154D-49E1-820A-B2CD9D9FF13E}</Project> - </ProjectReference> <ProjectReference Include="..\TabletAudioSample\TabletAudioSample.vcxproj"> <Project>{E4DF0EEE-D35B-47F2-A9B1-41EA97C465FF}</Project> </ProjectReference> diff --git a/audio/sysvad/README.md b/audio/sysvad/README.md index a7bce35e..9dfc0193 100644 --- a/audio/sysvad/README.md +++ b/audio/sysvad/README.md @@ -28,7 +28,7 @@ Perform the following steps to build this sample driver. In Microsoft Visual Studio, Click **File** \> **Open** \> **Project/Solution...** and navigate to the folder that contains the sample files (for example, *C:\Windows-driver-samples\audio\sysvad*). Double-click the *sysvad* solution file. -In Visual Studio locate the Solution Explorer. (If this is not already open, choose **Solution Explorer** from the **View** menu.) In Solution Explorer, you can see one solution that has four projects. Note that the project titled SwapAPO is actually a folder that contains two projects - APO and PropPageExtensions. +In Visual Studio locate the Solution Explorer. (If this is not already open, choose **Solution Explorer** from the **View** menu.) In Solution Explorer, you can see one solution that has four projects. **2. Set the sample's configuration and platform** @@ -48,14 +48,12 @@ The package should contain these files: File | Description -----|------------ -TabletAudioSample.sys OR PhoneAudioSample| The driver file. +TabletAudioSample.sys OR PhoneAudioSample.sys| The driver file. SwapAPO.dll | A sample APO. DelayAPO.dll | A sample APO. -PropPageExt.dll | A sample driver extension for a property page. sysvad.cat | A signed catalog file, which serves as the signature for the entire package. TabletAudioSample.inf | An information (INF) file that contains information needed to install the driver. -PhoneAudioSample.inf | An information (INF) file that contains information needed to install the driver. -WdfCoinstaller01011.dll | The coinstaller for version 1.xx of KMDF. +PhoneAudioSample.inf | An information (INF) file that contains information needed to install the driver. Run the sample -------------- diff --git a/audio/sysvad/SwapAPO/APO/SwapAPO.vcxproj b/audio/sysvad/SwapAPO/APO/SwapAPO.vcxproj index 87400997..563f6375 100644 --- a/audio/sysvad/SwapAPO/APO/SwapAPO.vcxproj +++ b/audio/sysvad/SwapAPO/APO/SwapAPO.vcxproj @@ -31,7 +31,7 @@ <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> <TargetVersion>Windows10</TargetVersion> <UseDebugLibraries>False</UseDebugLibraries> - <DriverTargetPlatform>Desktop</DriverTargetPlatform> + <DriverTargetPlatform>Universal</DriverTargetPlatform> <EmbedManifest>false</EmbedManifest> <DriverType /> <PlatformToolset>WindowsApplicationForDrivers10.0</PlatformToolset> @@ -40,7 +40,7 @@ <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> <TargetVersion>Windows10</TargetVersion> <UseDebugLibraries>True</UseDebugLibraries> - <DriverTargetPlatform>Desktop</DriverTargetPlatform> + <DriverTargetPlatform>Universal</DriverTargetPlatform> <EmbedManifest>false</EmbedManifest> <DriverType /> <PlatformToolset>WindowsApplicationForDrivers10.0</PlatformToolset> @@ -49,7 +49,7 @@ <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> <TargetVersion>Windows10</TargetVersion> <UseDebugLibraries>False</UseDebugLibraries> - <DriverTargetPlatform>Desktop</DriverTargetPlatform> + <DriverTargetPlatform>Universal</DriverTargetPlatform> <EmbedManifest>false</EmbedManifest> <DriverType /> <PlatformToolset>WindowsApplicationForDrivers10.0</PlatformToolset> @@ -58,7 +58,7 @@ <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> <TargetVersion>Windows10</TargetVersion> <UseDebugLibraries>True</UseDebugLibraries> - <DriverTargetPlatform>Desktop</DriverTargetPlatform> + <DriverTargetPlatform>Universal</DriverTargetPlatform> <EmbedManifest>false</EmbedManifest> <DriverType /> <PlatformToolset>WindowsApplicationForDrivers10.0</PlatformToolset> diff --git a/audio/sysvad/SwapAPO/APO/SwapAPO.vcxproj.Filters b/audio/sysvad/SwapAPO/APO/SwapAPO.vcxproj.Filters index 7cb395b8..631acbca 100644 --- a/audio/sysvad/SwapAPO/APO/SwapAPO.vcxproj.Filters +++ b/audio/sysvad/SwapAPO/APO/SwapAPO.vcxproj.Filters @@ -33,13 +33,28 @@ <Midl Include="SwapAPOInterface.idl"> <Filter>Source Files</Filter> </Midl> - <None Include="SwapAPODll.def"> - <Filter>Source Files</Filter> - </None> </ItemGroup> <ItemGroup> <ResourceCompile Include="SwapAPODll.rc"> <Filter>Resource Files</Filter> </ResourceCompile> </ItemGroup> + <ItemGroup> + <ClInclude Include="Resource.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="SwapAPO.h" /> + <ClInclude Include="Resource.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="SwapAPO.h" /> + </ItemGroup> + <ItemGroup> + <None Include="*.ico;*.cur;*.bmp;*.dlg;*.rct;*.gif;*.jpg;*.jpeg;*.wav;*.jpe;*.tiff;*.tif;*.png;*.rc2"> + <Filter>Resource Files</Filter> + </None> + <None Include="*.def;*.bat;*.hpj;*.asmx"> + <Filter>Source Files</Filter> + </None> + </ItemGroup> </Project>
\ No newline at end of file diff --git a/audio/sysvad/SwapAPO/DelayAPO/DelayAPO.vcxproj b/audio/sysvad/SwapAPO/DelayAPO/DelayAPO.vcxproj index 229ce262..68fd57b6 100644 --- a/audio/sysvad/SwapAPO/DelayAPO/DelayAPO.vcxproj +++ b/audio/sysvad/SwapAPO/DelayAPO/DelayAPO.vcxproj @@ -31,7 +31,7 @@ <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> <TargetVersion>Windows10</TargetVersion> <UseDebugLibraries>False</UseDebugLibraries> - <DriverTargetPlatform>Desktop</DriverTargetPlatform> + <DriverTargetPlatform>Universal</DriverTargetPlatform> <EmbedManifest>false</EmbedManifest> <DriverType /> <PlatformToolset>WindowsApplicationForDrivers10.0</PlatformToolset> @@ -40,7 +40,7 @@ <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> <TargetVersion>Windows10</TargetVersion> <UseDebugLibraries>True</UseDebugLibraries> - <DriverTargetPlatform>Desktop</DriverTargetPlatform> + <DriverTargetPlatform>Universal</DriverTargetPlatform> <EmbedManifest>false</EmbedManifest> <DriverType /> <PlatformToolset>WindowsApplicationForDrivers10.0</PlatformToolset> @@ -49,7 +49,7 @@ <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> <TargetVersion>Windows10</TargetVersion> <UseDebugLibraries>False</UseDebugLibraries> - <DriverTargetPlatform>Desktop</DriverTargetPlatform> + <DriverTargetPlatform>Universal</DriverTargetPlatform> <EmbedManifest>false</EmbedManifest> <DriverType /> <PlatformToolset>WindowsApplicationForDrivers10.0</PlatformToolset> @@ -58,7 +58,7 @@ <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> <TargetVersion>Windows10</TargetVersion> <UseDebugLibraries>True</UseDebugLibraries> - <DriverTargetPlatform>Desktop</DriverTargetPlatform> + <DriverTargetPlatform>Universal</DriverTargetPlatform> <EmbedManifest>false</EmbedManifest> <DriverType /> <PlatformToolset>WindowsApplicationForDrivers10.0</PlatformToolset> diff --git a/audio/sysvad/SwapAPO/PropPageExtensions/PropPageExt.vcxproj.Filters b/audio/sysvad/SwapAPO/DelayAPO/DelayAPO.vcxproj.Filters index 98832fba..a1e7102a 100644 --- a/audio/sysvad/SwapAPO/PropPageExtensions/PropPageExt.vcxproj.Filters +++ b/audio/sysvad/SwapAPO/DelayAPO/DelayAPO.vcxproj.Filters @@ -3,49 +3,58 @@ <ItemGroup> <Filter Include="Source Files"> <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx;*</Extensions> - <UniqueIdentifier>{413921B3-AEE4-4E51-B616-E356BEC9E42E}</UniqueIdentifier> + <UniqueIdentifier>{5f4ff11d-7a0b-4f75-9d79-744ae028cc53}</UniqueIdentifier> </Filter> <Filter Include="Header Files"> <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions> - <UniqueIdentifier>{0B044B82-EDD8-49A9-ACEE-2E7C98CCA3DC}</UniqueIdentifier> + <UniqueIdentifier>{bd103b81-05b2-440e-84e7-0723d7fe4109}</UniqueIdentifier> </Filter> <Filter Include="Resource Files"> <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms;man;xml</Extensions> - <UniqueIdentifier>{1E3956FB-B7AD-48BF-AD18-28527349BEED}</UniqueIdentifier> + <UniqueIdentifier>{a57b6b78-38ae-4348-ade3-0200e81a3dd7}</UniqueIdentifier> </Filter> </ItemGroup> <ItemGroup> - <ClCompile Include="AdvEndpointPropPage.cpp"> + <ClCompile Include="Delay.cpp"> <Filter>Source Files</Filter> </ClCompile> - <ClCompile Include="CplExt.cpp"> + <ClCompile Include="DelayAPODll.cpp"> <Filter>Source Files</Filter> </ClCompile> - <ClCompile Include="Parts.cpp"> + <ClCompile Include="DelayAPOMFX.cpp"> <Filter>Source Files</Filter> </ClCompile> - <ClCompile Include="stdafxsrc.cpp"> + <ClCompile Include="DelayAPOSFX.cpp"> <Filter>Source Files</Filter> </ClCompile> - <ClCompile Include="SwapPropPage.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="TopologyExaminers.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="UIWidgets.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <Midl Include="CplExt.idl"> + <Midl Include="DelayAPODll.idl"> <Filter>Source Files</Filter> </Midl> - <None Include="PropPageExt.def"> + <Midl Include="DelayAPOInterface.idl"> <Filter>Source Files</Filter> - </None> + </Midl> </ItemGroup> <ItemGroup> - <ResourceCompile Include="CplExt.rc"> + <ResourceCompile Include="DelayAPODll.rc"> <Filter>Resource Files</Filter> </ResourceCompile> </ItemGroup> + <ItemGroup> + <ClInclude Include="Resource.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="DelayAPO.h" /> + <ClInclude Include="Resource.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="DelayAPO.h" /> + </ItemGroup> + <ItemGroup> + <None Include="*.ico;*.cur;*.bmp;*.dlg;*.rct;*.gif;*.jpg;*.jpeg;*.wav;*.jpe;*.tiff;*.tif;*.png;*.rc2"> + <Filter>Resource Files</Filter> + </None> + <None Include="*.def;*.bat;*.hpj;*.asmx"> + <Filter>Source Files</Filter> + </None> + </ItemGroup> </Project>
\ No newline at end of file diff --git a/audio/sysvad/SwapAPO/PropPageExtensions/AdvEndpointPropPage.cpp b/audio/sysvad/SwapAPO/PropPageExtensions/AdvEndpointPropPage.cpp deleted file mode 100644 index 73c243b4..00000000 --- a/audio/sysvad/SwapAPO/PropPageExtensions/AdvEndpointPropPage.cpp +++ /dev/null @@ -1,1087 +0,0 @@ -//**@@@*@@@**************************************************** -// -// Microsoft Windows -// Copyright (C) Microsoft Corporation. All rights reserved. -// -//**@@@*@@@**************************************************** - -// -// FileName: AdvEndpointPropPage.cpp -// -// Abstract: Implementation of CAdvEndpointPropPage -// -// ---------------------------------------------------------------------------- - - -#include "stdafx.h" -#include <mmdeviceapi.h> -#include <DeviceTopology.h> -#include "UIWidgets.h" -#include "Parts.h" -#include "TopologyExaminers.h" -#include "AdvEndpointPropPage.h" -#include <functiondiscoverykeys.h> - -_Analysis_mode_(_Analysis_code_type_user_driver_) - -#define MAX_SEARCH_DEPTH 5 // when searching for a host pin or interface - -static IID s_rgAdvCtrlInterfaces[] = -{ - __uuidof(IAudioLoudness), - __uuidof(IAudioAutoGainControl), - __uuidof(IDeviceSpecificProperty) -}; - - -// ---------------------------------------------------------------------------- -// Function: -// CAdvEndpointPropPage::CAdvEndpointPropPage -// -// Description: -// CAdvEndpointPropPage constructor -// ---------------------------------------------------------------------------- -CAdvEndpointPropPage::CAdvEndpointPropPage() -: m_pAudioExtParams(NULL) -{ -} - - -// ---------------------------------------------------------------------------- -// Function: -// CAdvEndpointPropPage::~CAdvEndpointPropPage -// -// Description: -// CAdvEndpointPropPage destructor -// ---------------------------------------------------------------------------- -CAdvEndpointPropPage::~CAdvEndpointPropPage() -{ - CUIWidget* pWidget; - - while (m_lstWidgets.RemoveHead(&pWidget)) - { - SAFE_DELETE(pWidget); - } - - SAFE_RELEASE(m_pAudioExtParams->pEndpoint); - SAFE_RELEASE(m_pAudioExtParams->pPnpInterface); - SAFE_RELEASE(m_pAudioExtParams->pPnpDevnode); - - SAFE_DELETE(m_pAudioExtParams); -} - - -// ---------------------------------------------------------------------------- -// Function: -// CAdvEndpointPropPage::MakeNewWidget -// -// Description: -// Adds a widget to the list -// -// Parameters: -// pPart - [in] Part interface -// iid - [in] Advanced control IID which controls the kind of widget -// that gets created -// nCtrlId - [in] ID of the control -// -// Return: -// S_OK if successful -// ---------------------------------------------------------------------------- -HRESULT CAdvEndpointPropPage::MakeNewWidget -( - IPart* pPart, - REFIID iid, - UINT nCtrlId -) -{ - UNREFERENCED_PARAMETER(nCtrlId); - - HRESULT hr = S_OK; - LISTPOS posChk; - CUIWidget* pNewWidget = NULL; - - if ((iid == __uuidof(IAudioLoudness)) || - (iid == __uuidof(IAudioAutoGainControl))) - { - pNewWidget = new CBooleanWidget(pPart, iid); - IF_TRUE_ACTION_JUMP((pNewWidget == NULL), hr = E_OUTOFMEMORY, Exit); - } - else if (iid == __uuidof(IDeviceSpecificProperty)) - { - CComPtr<IDeviceSpecificProperty> spDevSpec; - VARTYPE vt; - - hr = pPart->Activate(CLSCTX_INPROC_SERVER, __uuidof(IDeviceSpecificProperty), (void**)&spDevSpec); - IF_FAILED_JUMP(hr, Exit); - - hr = spDevSpec->GetType(&vt); - IF_FAILED_JUMP(hr, Exit); - - if (vt == VT_BOOL) - { - pNewWidget = new CBooleanWidget(pPart, iid); - IF_TRUE_ACTION_JUMP((pNewWidget == NULL), hr = E_OUTOFMEMORY, Exit); - } - else if (vt == VT_I4) - { - pNewWidget = new CLongWidget<LONG>(pPart); - IF_TRUE_ACTION_JUMP((pNewWidget == NULL), hr = E_OUTOFMEMORY, Exit); - } - else if (vt == VT_UI4) - { - pNewWidget = new CLongWidget<ULONG>(pPart); - IF_TRUE_ACTION_JUMP((pNewWidget == NULL), hr = E_OUTOFMEMORY, Exit); - } - else - { - hr = HRESULT_FROM_WIN32(ERROR_NOT_SUPPORTED); - goto Exit; - } - } - - ATLASSERT(pNewWidget); - - posChk = m_lstWidgets.AddTail(pNewWidget); - if (posChk == NULL) - { - hr = E_OUTOFMEMORY; - SAFE_DELETE(pNewWidget); - } - -Exit: - return hr; -} - - -// ---------------------------------------------------------------------------- -// Function: -// CAdvEndpointPropPage::GetDeviceFriendlyName -// -// Description: -// Retrieves the endpoint's friendly name -// -// Parameters: -// ppNameOut - [out] The friendly name of the endpoint -// -// Return values: -// S_OK if successful -// ---------------------------------------------------------------------------- -HRESULT CAdvEndpointPropPage::GetDeviceFriendlyName -( - _Outptr_result_maybenull_ LPWSTR* ppNameOut -) -{ - HRESULT hr = S_OK; - CComPtr<IPropertyStore> spProperties; - PROPVARIANT var; - - IF_TRUE_ACTION_JUMP((m_pAudioExtParams == NULL), hr = E_POINTER, Exit); - IF_TRUE_ACTION_JUMP((ppNameOut == NULL), hr = E_POINTER, Exit); - - *ppNameOut = NULL; - - PropVariantInit(&var); - - if (m_pAudioExtParams->pEndpoint != NULL) - { - // Open the PropertyStore for read access - hr = m_pAudioExtParams->pEndpoint->OpenPropertyStore(STGM_READ, &spProperties); - IF_FAILED_JUMP(hr, Exit); - - // Retrieve the friendly name of the endpoint - hr = spProperties->GetValue(PKEY_Device_FriendlyName, &var); - if (SUCCEEDED(hr) && (var.vt == VT_LPWSTR)) - { - *ppNameOut = var.pwszVal; - } - else - { - PropVariantClear(&var); - } - } - -Exit: - return(hr); -} - - -// ---------------------------------------------------------------------------- -// Function: -// CAdvEndpointPropPage::OnInitDialog -// -// Description: -// Dialog initialization routine -// -// Parameters: -// hwndDlg - [in] Handle to dialog box -// wParam - [in] Handle to control to receive the default keyboard focus -// lParam - [in] Specifies additional message-specific information -// -// Return values: -// TRUE to direct the system to set the keyboard focus to the control -// specified by wParam. Otherwise, it should return FALSE to prevent the -// system from setting the default keyboard focus. -// ---------------------------------------------------------------------------- -BOOL CAdvEndpointPropPage::OnInitDialog -( - HWND hwndDlg, - WPARAM wParam, - LPARAM lParam -) -{ - UNREFERENCED_PARAMETER(wParam); - UNREFERENCED_PARAMETER(lParam); - - LPWSTR pwstrEndpointName = NULL; - - LISTPOS pos; - CUIWidget* pWidget; - SRECT rcWidget(34, 144, 0, 0); - RECT rcDlg; - HRESULT hr = S_OK; - UINT id = 1800; - - // Retrieve the endpoint's friendly name - hr = GetDeviceFriendlyName(&pwstrEndpointName); - IF_FAILED_JUMP(hr, Exit); - - // Update the property page with retrieved information - SetWindowText(GetDlgItem(hwndDlg, IDC_EPP_ENDPOINT_NAME), pwstrEndpointName); - - // Initialize and create widgets - hr = InitializeWidgets(); - if (hr == E_NOTFOUND) - { - // If no widgets were found, show a message to depict that - SetWindowText(GetDlgItem(hwndDlg, IDC_NO_ADV_CONTROLS_FOUND), - L"No advanced controls found."); - } - else - { - // Create widget windows - ::GetClientRect(hwndDlg, &rcDlg); - rcWidget.w = rcDlg.right - rcDlg.left - 28; - rcWidget.h = 14; - - pos = m_lstWidgets.GetHeadPosition(); - while (pos) - { - pWidget = NULL; - m_lstWidgets.GetNext(pos, &pWidget); - - hr = pWidget->Create(hwndDlg, rcWidget, id); - if (SUCCEEDED(hr)) - { - id++; - - // offset to next widget - rcWidget.y = rcWidget.y + rcWidget.h + 12; - } - } - } - -Exit: - SAFE_COTASKMEMFREE(pwstrEndpointName); - return(FALSE); -} - - -// ---------------------------------------------------------------------------- -// Function: -// CAdvEndpointPropPage::OnApply -// -// Description: -// Handle the pressing of the apply button -// -// Parameters: -// hwndDlg - [in] Handle to the dialog box -// wParam - [in] Handle to the control to receive the default keyboard focus -// lParam - [in] Specifies additional message-specific information -// -// Return values: -// TRUE to set keyboard focus on control -// ---------------------------------------------------------------------------- -BOOL CAdvEndpointPropPage::OnApply -( - HWND hwndDlg, - WPARAM wParam, - LPARAM lParam -) -{ - UNREFERENCED_PARAMETER(wParam); - UNREFERENCED_PARAMETER(lParam); - - CUIWidget* pWidget; - LISTPOS pos; - - pos = m_lstWidgets.GetHeadPosition(); - - while (pos) - { - pWidget = NULL; - m_lstWidgets.GetNext(pos, &pWidget); - pWidget->CommitValue(); - } - - SetWindowLongPtr(hwndDlg, DWLP_MSGRESULT, PSNRET_NOERROR); - - return(TRUE); -} - - -// ---------------------------------------------------------------------------- -// Function: -// CAdvEndpointPropPage::OnCheckBoxClicked -// -// Description: -// Handle the clicking of the check boxes -// -// Parameters: -// hwndDlg - [in] Handle to the dialog box -// wParam - [in] Handle to the control to receive the default keyboard focus -// lParam - [in] Specifies additional message-specific information -// -// Return values: -// FALSE to not set default keyboard focus -// ---------------------------------------------------------------------------- -BOOL CAdvEndpointPropPage::OnCheckBoxClicked -( - HWND hwndDlg, - WPARAM wParam, - LPARAM lParam -) -{ - UNREFERENCED_PARAMETER(lParam); - - CUIWidget* pWidget; - LISTPOS pos; - - pos = m_lstWidgets.GetHeadPosition(); - - while (pos) - { - pWidget = NULL; - m_lstWidgets.GetNext(pos, &pWidget); - - if (pWidget->OwnsCtrlId(LOWORD(wParam))) - { - pWidget->OnClick(); - } - } - - // Enable the Apply button upon user changing the control - SendMessage(GetParent(hwndDlg), PSM_CHANGED, (WPARAM)hwndDlg, 0); - - return(FALSE); -} - - -// ---------------------------------------------------------------------------- -// Function: -// CAdvEndpointPropPage::DialogProcPage1 -// -// Description: -// Callback for property page -// -// Parameters: -// hwndDlg - [in] Handle to the dialog box -// uMsg - [in] Specifies the message -// wParam - [in] Specifies additional message-specific information -// lParam - [in] Specifies additional message-specific information -// -// Return values: -// TRUE if it processed the message, FALSE if not -// ---------------------------------------------------------------------------- -INT_PTR CALLBACK CAdvEndpointPropPage::DialogProcPage1 -( - HWND hwndDlg, - UINT uMsg, - WPARAM wParam, - LPARAM lParam -) -{ - CAdvEndpointPropPage* pthis = (CAdvEndpointPropPage*)(LONG_PTR)GetWindowLongPtr( - hwndDlg, GWLP_USERDATA); - BOOL fRet = FALSE; - - switch (uMsg) - { - case WM_INITDIALOG: - { - // Extract the context data from PROPSHEETPAGE::lParam - PROPSHEETPAGE* pSheetDesc = (PROPSHEETPAGE*)lParam; - - // Create the property page factory class -#pragma warning(push) -#pragma warning(disable: 28197) - pthis = new CComObject<CAdvEndpointPropPage>(); -#pragma warning(pop) - if (pthis == NULL) - { - return(FALSE); - } - - // Save this object in lParam - SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)pthis); - - // Keep audio extension parameters passed by the control panel - pthis->m_pAudioExtParams = (AudioExtensionParams*)pSheetDesc->lParam; - - fRet = pthis->OnInitDialog(hwndDlg, wParam, lParam); - break; - } - - case WM_NOTIFY: - { - switch (((NMHDR FAR*)lParam)->code) - { - case PSN_APPLY: - if (pthis) - { - // Apply button pressed - fRet = pthis->OnApply(hwndDlg, wParam, lParam); - } - break; - } - break; - } - - case WM_COMMAND: - { - if (pthis) - { - // Check box clicked - fRet = pthis->OnCheckBoxClicked(hwndDlg, wParam, lParam); - } - break; - } - - case WM_DESTROY: - { - SAFE_DELETE(pthis); - SetWindowLongPtr(hwndDlg, GWLP_USERDATA, NULL); - fRet = TRUE; - break; - } - } - - return(fRet); -} - - -// ---------------------------------------------------------------------------- -// Function: -// CAdvEndpointPropPage::PropSheetPageProc -// -// Description: -// Callback that gets invoked right after page creation or right before -// before page destruction -// -// Parameters: -// hwnd - Reserved; must be NULL -// uMsg - [in] Action flag. PSPCB_ADDREF, PSPCB_CREATE, or PSPCB_RELEASE -// ppsp - [in, out] Pointer to a PROPSHEETPAGE structure that defines -// the page being created or destroyed. -// -// Return values: -// Depends on the value of the uMsg parameter -// ---------------------------------------------------------------------------- -UINT CALLBACK CAdvEndpointPropPage::PropSheetPageProc -( - HWND hwnd, - UINT uMsg, - LPPROPSHEETPAGE ppsp -) -{ - UNREFERENCED_PARAMETER(hwnd); - UNREFERENCED_PARAMETER(uMsg); - UNREFERENCED_PARAMETER(ppsp); - - // if (uMsg == PSPCB_CREATE) ... - return(1); -} - - -// ---------------------------------------------------------------------------- -// Function: -// CAdvEndpointPropPage::Initialize -// -// Description: -// Implementation of IShellExtInit::Initialize. Initializes a property -// sheet extension, shortcut menu extension, or drag-and-drop handler. -// -// Parameters: -// pidlFolder - [in] Address of an ITEMIDLIST structure that uniquely -// identifies a folder. For property sheet extensions, -// this parameter is NULL. -// pdtobj - [out] Address of an IDataObject interface object that can be -// used to retrieve the objects being acted upon. -// hkeyProgID - [in] Registry key for the file object or folder type. -// -// Return values: -// Returns NOERROR if successful, or an OLE-defined error value otherwise -// ---------------------------------------------------------------------------- -_Use_decl_annotations_ -HRESULT CAdvEndpointPropPage::Initialize -( - LPCITEMIDLIST pidlFolder, - IDataObject* pdtobj, - HKEY hkeyProgID -) -{ - UNREFERENCED_PARAMETER(pidlFolder); - UNREFERENCED_PARAMETER(pdtobj); - UNREFERENCED_PARAMETER(hkeyProgID); - - return(S_OK); -} - - -// ---------------------------------------------------------------------------- -// Function: -// CAdvEndpointPropPage::FindHostConnector -// -// Description: -// This method initiates a search for a software connector that supports -// the supplied format. If one is found, it returns a path to that -// connector. -// -// Parameters: -// pKsFormat - [in] Requested format -// cbFormat - [in] Size of format buffer in BYTEs -// bRejectMixedPaths - [in] If TRUE, stop looking if you find a mix unit -// ppPath - [out] The path to the Host pin -// -// Remarks: -// To get the host connector, just take the zeroth element in the -// resulting path -// -// Return: -// S_OK on success, E_NOTFOUND if not. Other error code indicates -// something unexpected. -// ---------------------------------------------------------------------------- -HRESULT CAdvEndpointPropPage::FindHostConnector -( - PKSDATAFORMAT pKsFormat, - ULONG cbFormat, - BOOL bRejectMixedPaths, - IPartsList** ppPath -) -{ - HRESULT hr; - CPartsList* pPathOut = NULL; - CComPtr<IDeviceTopology> spTopology; - UINT cConnectors; - CComPtr<IConnector> spEndpointConnector; - CComPtr<IConnector> spConStart; - CComQIPtr<IPart> spPartStart; - DataFlow flow; - UINT cDepth = 0; - CFormatExaminer* pExaminer = NULL; - - IF_TRUE_ACTION_JUMP((ppPath == NULL), hr = E_POINTER, Exit); - *ppPath = NULL; - - ATLASSERT(m_pAudioExtParams->pEndpoint != NULL); - - // Get IDeviceTopology interface for the Endpoint - hr = m_pAudioExtParams->pEndpoint->Activate(__uuidof(IDeviceTopology), CLSCTX_ALL, NULL, (void**)&spTopology); - IF_FAILED_JUMP(hr, Exit); - - // Get the connector to start searching from. By definition, an endpoint device can only have 1 connector. - hr = spTopology->GetConnectorCount(&cConnectors); - IF_FAILED_JUMP(hr, Exit); - - ATLASSERT(cConnectors == 1); - IF_TRUE_ACTION_JUMP((cConnectors != 1), hr = E_FAIL, Exit); - - // Since an endpoint device can only have 1 connector, get the connector at index 0 - hr = spTopology->GetConnector(0, &spEndpointConnector); - IF_FAILED_JUMP(hr, Exit); - - hr = spEndpointConnector->GetConnectedTo(&spConStart); - IF_FAILED_JUMP(hr, Exit); - - // get the dataflow (required by Search method) - hr = spConStart->GetDataFlow(&flow); - IF_FAILED_JUMP(hr, Exit); - - // QI for IPart (required by Search method) - spPartStart = spConStart; - - // Create an examiner that looks for a pin with the specified format - pExaminer = new CFormatExaminer(pKsFormat, cbFormat); - IF_TRUE_ACTION_JUMP((pExaminer == NULL), hr = E_OUTOFMEMORY, Exit); - - // Create a new parts list -#pragma warning(push) -#pragma warning(disable: 28197) - pPathOut = new CPartsList(); -#pragma warning(pop) - IF_TRUE_ACTION_JUMP((pPathOut == NULL), hr = E_OUTOFMEMORY, Exit); - - // Start looking - hr = Search(spPartStart, flow, pExaminer, pPathOut, cDepth, bRejectMixedPaths); - if (bRejectMixedPaths && (hr == E_NOTFOUND)) - { - // Don't actually reject mixed paths, just avoid them - hr = Search(spPartStart, flow, pExaminer, pPathOut, cDepth, FALSE); - } - IF_FAILED_JUMP(hr, Exit); - - hr = pPathOut->QueryInterface(__uuidof(IPartsList), (void**)ppPath); - -Exit: - SAFE_RELEASE(pPathOut); - - SAFE_DELETE(pExaminer); - - return hr; -} - - -// ---------------------------------------------------------------------------- -// Function: -// CAdvEndpointPropPage::Search -// -// Description: -// Searches the device topology for parts that satisfy the supplied -// examiner. -// -// Parameters: -// pPartStart - [in] The IPart to start looking at -// flowStart - [in] The flow of the starting part. This never changes -// so it is passed as an argument. -// pExaminer - [in] The examiner that tests each IPart against some criteria -// pPathAggregate - [out] The cumulative path that has been searched -// cDepth - [in] Stop looking if we reach this recursion depth -// bRejectMixedPaths - [in] If TRUE, then stop looking if we encounter a -// MIX unit -// -// Remarks: -// The search may span several FunctionInstances connected by DeviceModel -// IConnections. The algorithm works as follows: -// -// 1) Each connector in the model is tested against the following -// (in order): -// a) Is the flow opposite that of the starting part? -// If no then goto next connector. -// b) Does there exist a path from the starting part to this -// connector? If no then goto next connector. -// c) Is the supplied examiner satisfied by the path? -// If yes, then return. -// d) Is this connector connected to another connector? -// If yes, then add the connector to a list of "deferred -// connectors" to be checked if no other connectors in this model -// satisfy (c) -// -// 2) If the function still hasn't returned, then for each connector in -// the list generated in step 1d: -// a) Get the connector that it is connected to -// b) Recurse into this function with "that" connector as the starting -// part -// -// The point of the list of "deferred connectors" is to minimize the -// length of the paths that we find. e.g. if two viable paths exist, one -// (A) which spans 3 models, and another (B) which spans only 2, then B -// will be found first, regardless of the ordering of connections in the -// models involved. -// -// Note that when a path is found, all of the parts involved in that path -// are aggregated into pPathAggregate IN REVERSE ORDER. In general, all -// the parts in pPathAggregate will not belong to a single model, so when -// using pPathAggregate, you must use IPart::GetTopologyObject to get the -// model and/or FunctionInstance of the part (i.e. don't cache the value -// of either). -// -// Return: -// S_OK if successful -// ---------------------------------------------------------------------------- -HRESULT CAdvEndpointPropPage::Search -( - IPart* pPartStart, - DataFlow flowStart, - IExaminer* pExaminer, - CPartsList* pPathAggregate, - UINT cDepth, - BOOL bRejectMixedPaths -) -{ - HRESULT hr = S_OK; - TList<IConnector> lstDeferredConnectors; - BOOL bHaveViableConnector = FALSE; - - { - CComPtr<IDeviceTopology> spTopology; - UINT cConnectors; - - // Bail if we are recursing too deep - IF_TRUE_ACTION_JUMP((cDepth == MAX_SEARCH_DEPTH), hr = E_NOTFOUND, Exit); - - // Get DeviceModel and DeviceModelUtil interfaces associated with pPartStart. - // We can't just pass these as params, because each time this function is called - // recursively, we are talking about a part (pPartStart) on a different device. - hr = pPartStart->GetTopologyObject(&spTopology); - IF_FAILED_JUMP(hr, Exit); - - // - // [Step 1] Examine each connector. - // - hr = spTopology->GetConnectorCount(&cConnectors); - IF_FAILED_JUMP(hr, Exit); - - for (UINT c = 0; (c < cConnectors) && !bHaveViableConnector; c++) - { - CComPtr<IConnector> spConTest; - DataFlow flowTest; - CComPtr<IPartsList> spPath; - CComPtr<IPart> spPartTest; - BOOL bConnectorIsConnected; - - hr = spTopology->GetConnector(c, &spConTest); - IF_FAILED_JUMP(hr, Exit); - - hr = spConTest->GetDataFlow(&flowTest); - IF_FAILED_JUMP(hr, Exit); - - // [1a] We only care about connectors whose dataflow is opposite that of pConStart - // (i.e. on the other side of the topology) - if (flowTest == flowStart) - continue; - - // QI for IPart - spPartTest = spConTest; - - ATLASSERT(spPartTest); - IF_TRUE_ACTION_JUMP((spPartTest == NULL), hr = E_NOINTERFACE, Exit); - - // [1b] See if there exists a path from one to the other - hr = spTopology->GetSignalPath(pPartStart, spPartTest, bRejectMixedPaths, &spPath); - - // If no path exists from here to there, then try the next connector - if (hr != S_OK) - continue; - - // [1c] Let pExaminer take a look at this path, but don't worry if it fails - pExaminer->Examine(spPath); - - // See if pExaminer has found what it was looking for yet - if (pExaminer->IsSatisfied()) - { - bHaveViableConnector = TRUE; - - // add all of the parts in spPath to pPathAggregate - hr = pPathAggregate->AddParts(spPath); - break; - } - - // [1d] See if the connector is connected. If so, add to the list of deferred - // connectors - hr = spConTest->IsConnected(&bConnectorIsConnected); - - if (SUCCEEDED(hr) && bConnectorIsConnected) - { - LISTPOS posChk; - IConnector* pConDeferred; - - // Get another interface pointer that is NOT a CComPtr, so it doesn't - // get released until we want (note that .Detach means that when spConTest - // goes out of scope it won't release the interface) - pConDeferred = spConTest.Detach(); - - // Add to list of connectors to look more closely at - posChk = lstDeferredConnectors.AddTail(pConDeferred); - - if (posChk == NULL) - { - hr = E_OUTOFMEMORY; - pConDeferred->Release(); - goto Exit; - } - } - } - - if (!bHaveViableConnector) - { - // - // [Step 2] Jump to connected devices and test them. - // - - LISTPOS pos = lstDeferredConnectors.GetHeadPosition(); - - while (pos != NULL) - { - CComPtr<IConnector> spConConnectedTo; - IConnector* pConDeferred = NULL; // this will be cleaned up at the end of the function - CComPtr<IPart> spPartConnectedTo; - CComPtr<IPartsList> spPath; - CComQIPtr<IPart> spPartDeferred; - - // Get the deferred connector. RefCount should be 1 - lstDeferredConnectors.GetNext(pos, &pConDeferred); - - // Get the part (a connector) that this connector is connected to - hr = pConDeferred->GetConnectedTo(&spConConnectedTo); - IF_FAILED_JUMP(hr, Exit); - - // Search that device model as well. Note that we can just reuse the dataflow here - spPartConnectedTo = spConConnectedTo; - ATLASSERT(spPartConnectedTo != NULL); - IF_TRUE_ACTION_JUMP((spPartConnectedTo == NULL), hr = E_NOINTERFACE, Exit); - - // Recursion - hr = Search(spPartConnectedTo, flowStart, pExaminer, pPathAggregate, cDepth + 1, bRejectMixedPaths); - if (FAILED(hr)) - continue; - - // We found what we were looking for! - bHaveViableConnector = TRUE; - - // We need to figure out how we got here again and add that path to pPath - spPartDeferred = pConDeferred; - ATLASSERT(spPartDeferred != NULL); - - // Note: If we fail past here, pPathAggregate will contain some parts. These will - // be cleaned up by CPartsList destructor - IF_TRUE_ACTION_JUMP((spPartDeferred == NULL), hr = E_NOINTERFACE, Exit); - - hr = spTopology->GetSignalPath(pPartStart, spPartDeferred, bRejectMixedPaths, &spPath); - IF_FAILED_JUMP(hr, Exit); - - // Add all of the parts in spPath to pPathAggregate - hr = pPathAggregate->AddParts(spPath); - IF_FAILED_JUMP(hr, Exit); - - break; - } - } - } - -Exit: - // Cleanup - IConnector* pConDelete; - while (lstDeferredConnectors.RemoveHead(&pConDelete)) - { - SAFE_RELEASE(pConDelete); - } - - // Adjust result. If there were no errors, but we didn't find what - // we were searching for, then return "not found" - if (SUCCEEDED(hr) && (!bHaveViableConnector)) - { - hr = E_NOTFOUND; - } - - return hr; -} - - -// ---------------------------------------------------------------------------- -// Function: -// CAdvEndpointPropPage::InitializeWidgets -// -// Description: -// Looks for parts in the path that support any of these control -// interfaces: -// -- IAudioLoudness -// -- IAudioAutoGainControl -// -- IDeviceSpecificProperty -// -// Return: -// S_OK if at least one control found -// E_NOTFOUND if no controls found -// other if unexpected error -// -// --------------------------------------------------------------------------- -HRESULT CAdvEndpointPropPage::InitializeWidgets() -{ - HRESULT hr = S_OK; - HRESULT hrWarn = S_OK; - CComPtr<IPartsList> spPath; - UINT cParts; - BOOL bFoundSomething = FALSE; - UINT nCtrlId = 900; - - // Note: Can use the endpoint format instead of this ... - KSDATAFORMAT format; - ZeroMemory(&format, sizeof(format)); - - format.FormatSize = sizeof(KSDATAFORMAT); - format.MajorFormat = KSDATAFORMAT_TYPE_AUDIO; - format.SubFormat = KSDATAFORMAT_SUBTYPE_PCM; - format.Specifier = KSDATAFORMAT_SPECIFIER_WAVEFORMATEX; - - // See if we can find a path to any old PCM host pin by only passing sizeof(KSDATAFORMAT) - hr = FindHostConnector(&format, sizeof(KSDATAFORMAT), FALSE, &spPath); - IF_FAILED_JUMP(hr, Exit); - - // - hr = spPath->GetCount(&cParts); - IF_FAILED_JUMP(hr, Exit); - - // Look for parts that support any of the interfaces in s_rgAdvCtrlInterfaces - for (UINT i = 0; i < cParts; i++) - { - UINT cInterfaces; - CComPtr<IPart> spPart; - - hr = spPath->GetPart(i, &spPart); - IF_FAILED_JUMP(hr, Exit); - - hr = spPart->GetControlInterfaceCount(&cInterfaces); - IF_FAILED_JUMP(hr, Exit); - - for (UINT j = 0; j < cInterfaces; j++) - { - CComPtr<IControlInterface> spInterfaceDesc; - GUID iid; - - hr = spPart->GetControlInterface(j, &spInterfaceDesc); - IF_FAILED_JUMP(hr, Exit); - - hr = spInterfaceDesc->GetIID(&iid); - IF_FAILED_JUMP(hr, Exit); - - for (int k = 0; k < ARRAYSIZE(s_rgAdvCtrlInterfaces); k++) - { - if (iid == s_rgAdvCtrlInterfaces[k]) - { - bFoundSomething = TRUE; - - hrWarn = MakeNewWidget(spPart, iid, nCtrlId++); - } - } - } - } - - if (!bFoundSomething) - { - hr = E_NOTFOUND; - } - -Exit: - return(hr); -} - - -// ---------------------------------------------------------------------------- -// Function: -// CAdvEndpointPropPage::AddPages -// -// Description: -// Implementation of IShellPropSheetExt::AddPages. Adds one or more pages -// to a property sheet that the Shell displays for a file object. -// -// Parameters: -// lpfnAddPage - [in] Address of a function that the property sheet -// handler calls to add a page to the property sheet. The -// function takes a property sheet handle returned by the -// CreatePropertySheetPage function and the lParam parameter -// passed to the AddPages method. -// lParam - [in] Parameter to pass to the function specified by the -// lpfnAddPage method. -// -// Return values: -// Returns S_OK if successful. If the method fails, an OLE-defined error -// code is returned -// ---------------------------------------------------------------------------- -_Use_decl_annotations_ -HRESULT STDMETHODCALLTYPE CAdvEndpointPropPage::AddPages -( - LPFNADDPROPSHEETPAGE lpfnAddPage, // See PrSht.h - LPARAM lParam // Used by caller, don't modify -) -{ - HRESULT hr = S_OK; - PROPSHEETPAGE psp; - HPROPSHEETPAGE hPage1 = NULL; - AudioExtensionParams* pAudioParams = (AudioExtensionParams*)lParam; -#pragma warning(push) -#pragma warning(disable: 28197) - AudioExtensionParams* pAudioParamsCopy = new AudioExtensionParams; -#pragma warning(pop) - - if (pAudioParamsCopy == NULL) - { - return E_OUTOFMEMORY; - } - - // Make a copy of the params - CopyMemory(pAudioParamsCopy, pAudioParams, sizeof(AudioExtensionParams)); - SAFE_ADDREF(pAudioParams->pEndpoint); - SAFE_ADDREF(pAudioParams->pPnpInterface); - SAFE_ADDREF(pAudioParams->pPnpDevnode); - - // Initialize property page params and create page - psp.dwSize = sizeof(psp); - psp.dwFlags = PSP_USEREFPARENT | PSP_USECALLBACK; - psp.hInstance = _AtlBaseModule.GetModuleInstance(); - psp.hIcon = 0; - psp.pcRefParent = (UINT*)&m_dwRef; - psp.lParam = (LPARAM)pAudioParamsCopy; - psp.pszTemplate = MAKEINTRESOURCE(IDD_ADV_ENDPOINT_PROP_PAGE); - psp.pfnDlgProc = (DLGPROC)DialogProcPage1; - psp.pfnCallback = PropSheetPageProc; - - // Create the property sheet page and add the page - hPage1 = CreatePropertySheetPage(&psp); - if (hPage1) - { - if (!lpfnAddPage(hPage1, pAudioParams->AddPageParam)) - { - hr = E_FAIL; - delete pAudioParamsCopy; - DestroyPropertySheetPage(hPage1); - } - else - { - // Add ref for page - this->AddRef(); - } - } - else - { - delete pAudioParamsCopy; - hr = E_OUTOFMEMORY; - } - - return(hr); -} - - -// ---------------------------------------------------------------------------- -// Function: -// CAdvEndpointPropPage::ReplacePage -// -// Description: -// Implementation of IShellPropSheetExt::ReplacePage. Replaces a page in -// a property sheet for a Control Panel object. -// -// Parameters: -// uPageID - [in] Identifier of the page to replace -// lpfnReplacePage - [in] Address of a function that the property sheet -// handler calls to replace a page to the property -// sheet. The function takes a property sheet handle -// returned by the CreatePropertySheetPage function and -// the lParam parameter passed to the ReplacePage -// method. -// lParam - [in] Parameter to pass to the function specified by the -// lpfnReplacePage parameter. -// -// Return values: -// Returns NOERROR if successful, or an OLE-defined error value otherwise -// ---------------------------------------------------------------------------- -_Use_decl_annotations_ -HRESULT STDMETHODCALLTYPE CAdvEndpointPropPage::ReplacePage -( - UINT uPageID, - LPFNSVADDPROPSHEETPAGE lpfnReplaceWith, - LPARAM lParam -) -{ - UNREFERENCED_PARAMETER(uPageID); - UNREFERENCED_PARAMETER(lpfnReplaceWith); - UNREFERENCED_PARAMETER(lParam); - - return(S_FALSE); -} diff --git a/audio/sysvad/SwapAPO/PropPageExtensions/AdvEndpointPropPage.h b/audio/sysvad/SwapAPO/PropPageExtensions/AdvEndpointPropPage.h deleted file mode 100644 index 0d02ef97..00000000 --- a/audio/sysvad/SwapAPO/PropPageExtensions/AdvEndpointPropPage.h +++ /dev/null @@ -1,74 +0,0 @@ -//**@@@*@@@**************************************************** -// -// Microsoft Windows -// Copyright (C) Microsoft Corporation. All rights reserved. -// -//**@@@*@@@**************************************************** - -// -// FileName: AdvEndpointPropPage.h -// -// Abstract: Declaration of the CAdvEndpointPropPage class -// -// ---------------------------------------------------------------------------- - - -#pragma once - - -class ATL_NO_VTABLE CAdvEndpointPropPage : - public CComObjectRootEx<CComSingleThreadModel>, - public CComCoClass<CAdvEndpointPropPage, &CLSID_AdvEndpointPropPage>, - public IDispatchImpl<IAdvEndpointPropPage, &__uuidof(IAdvEndpointPropPage), &LIBID_CplExtLib, /*wMajor =*/ 1, /*wMinor =*/ 0>, - public IShellExtInit, - public IShellPropSheetExt -{ -public: - CAdvEndpointPropPage(); - ~CAdvEndpointPropPage(); - - DECLARE_REGISTRY_RESOURCEID(IDR_ADV_ENDPOINT_PROP_PAGE) - - BEGIN_COM_MAP(CAdvEndpointPropPage) - COM_INTERFACE_ENTRY(IAdvEndpointPropPage) - COM_INTERFACE_ENTRY(IDispatch) - COM_INTERFACE_ENTRY(IShellExtInit) - COM_INTERFACE_ENTRY(IShellPropSheetExt) - END_COM_MAP() - - DECLARE_PROTECT_FINAL_CONSTRUCT() - - HRESULT FinalConstruct() - { - return S_OK; - } - - void FinalRelease() - { - } - - static INT_PTR CALLBACK DialogProcPage1(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); - static UINT CALLBACK PropSheetPageProc(HWND hwnd, UINT uMsg, LPPROPSHEETPAGE ppsp); - - // IShellExtInit - STDMETHOD(Initialize)(_In_opt_ LPCITEMIDLIST pidlFolder, _In_opt_ IDataObject* pdtobj, _In_opt_ HKEY hkeyProgID); - - // IShellPropSheetExt - STDMETHOD(AddPages)(_In_ LPFNADDPROPSHEETPAGE lpfnAddPage, _In_ LPARAM lParam); - STDMETHOD(ReplacePage)(_In_ UINT uPageID, _In_ LPFNSVADDPROPSHEETPAGE lpfnReplaceWith, _In_ LPARAM lParam); - -private: - AudioExtensionParams* m_pAudioExtParams; - TList<CUIWidget> m_lstWidgets; - - HRESULT FindHostConnector(PKSDATAFORMAT pKsFormat, ULONG cbFormat, BOOL bRejectMixedPaths, IPartsList** ppPath); - HRESULT Search(IPart* pStart, DataFlow flowStart, IExaminer* pExaminer, CPartsList* pPath, UINT cDepth, BOOL bRejectMixedPaths); - HRESULT InitializeWidgets(); - HRESULT GetDeviceFriendlyName(_Outptr_result_maybenull_ LPWSTR* ppNameOut); - HRESULT MakeNewWidget(IPart* pPart, REFIID iid, UINT nCtrlId); - BOOL OnInitDialog (HWND hwndDlg, WPARAM wParam, LPARAM lParam); - BOOL OnApply(HWND hwndDlg, WPARAM wParam, LPARAM lParam); - BOOL OnCheckBoxClicked(HWND hwndDlg, WPARAM wParam, LPARAM lParam); -}; - -OBJECT_ENTRY_AUTO(__uuidof(AdvEndpointPropPage), CAdvEndpointPropPage) diff --git a/audio/sysvad/SwapAPO/PropPageExtensions/AdvEndpointPropPage.rgs b/audio/sysvad/SwapAPO/PropPageExtensions/AdvEndpointPropPage.rgs deleted file mode 100644 index eecbc126..00000000 --- a/audio/sysvad/SwapAPO/PropPageExtensions/AdvEndpointPropPage.rgs +++ /dev/null @@ -1,27 +0,0 @@ -HKCR -{ - CplExt.AdvEndpointPropPage.1 = s 'AdvEndpointPropPage Class' - { - CLSID = s '{6C57B2A2-91F5-4b90-93D5-FAB82485ECA6}' - } - CplExt.AdvEndpointPropPage = s 'AdvEndpointPropPage Class' - { - CLSID = s '{6C57B2A2-91F5-4b90-93D5-FAB82485ECA6}' - CurVer = s 'CplExt.AdvEndpointPropPage.1' - } - NoRemove CLSID - { - ForceRemove {6C57B2A2-91F5-4b90-93D5-FAB82485ECA6} = s 'AdvEndpointPropPage Class' - { - ProgID = s 'CplExt.AdvEndpointPropPage.1' - VersionIndependentProgID = s 'CplExt.AdvEndpointPropPage' - ForceRemove 'Programmable' - InprocServer32 = s '%MODULE%' - { - val ThreadingModel = s 'Apartment' - } - val AppID = s '%APPID%' - 'TypeLib' = s '{59390583-ED40-46D9-9B16-7800B9CC5CC2}' - } - } -} diff --git a/audio/sysvad/SwapAPO/PropPageExtensions/CplExt.cpp b/audio/sysvad/SwapAPO/PropPageExtensions/CplExt.cpp deleted file mode 100644 index b64d51a2..00000000 --- a/audio/sysvad/SwapAPO/PropPageExtensions/CplExt.cpp +++ /dev/null @@ -1,73 +0,0 @@ -//**@@@*@@@**************************************************** -// -// Microsoft Windows -// Copyright (C) Microsoft Corporation. All rights reserved. -// -//**@@@*@@@**************************************************** - -// -// FileName: CplExt.cpp -// -// Abstract: Implementation of DLL Exports -// -// ---------------------------------------------------------------------------- - - -#include "stdafx.h" - -_Analysis_mode_(_Analysis_code_type_user_driver_) - -HINSTANCE g_hInstance = NULL; - - -class CCplExtModule : public CAtlDllModuleT< CCplExtModule > -{ -public : - DECLARE_LIBID(LIBID_CplExtLib) - DECLARE_REGISTRY_APPID_RESOURCEID(IDR_CPL_EXT, "{A7D2EC8B-B70F-434C-A0CE-0DF324805F7D}") -}; - -CCplExtModule _AtlModule; - - -// DLL Entry Point -extern "C" BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved) -{ - g_hInstance = hInstance; - return _AtlModule.DllMain(dwReason, lpReserved); -} - - -// Used to determine whether the DLL can be unloaded by OLE -__control_entrypoint(DllExport) -STDAPI DllCanUnloadNow(void) -{ - return _AtlModule.DllCanUnloadNow(); -} - - -// Returns a class factory to create an object of the requested type -_Check_return_ -STDAPI DllGetClassObject(_In_ REFCLSID rclsid, _In_ REFIID riid, _Outptr_ LPVOID FAR* ppv) -{ - return _AtlModule.DllGetClassObject(rclsid, riid, ppv); -} - - -// DllRegisterServer - Adds entries to the system registry -__control_entrypoint(DllExport) -STDAPI DllRegisterServer(void) -{ - // registers object, typelib and all interfaces in typelib - HRESULT hr = _AtlModule.DllRegisterServer(); - return hr; -} - - -// DllUnregisterServer - Removes entries from the system registry -__control_entrypoint(DllExport) -STDAPI DllUnregisterServer(void) -{ - HRESULT hr = _AtlModule.DllUnregisterServer(); - return hr; -} diff --git a/audio/sysvad/SwapAPO/PropPageExtensions/CplExt.idl b/audio/sysvad/SwapAPO/PropPageExtensions/CplExt.idl deleted file mode 100644 index 3254cbd8..00000000 --- a/audio/sysvad/SwapAPO/PropPageExtensions/CplExt.idl +++ /dev/null @@ -1,73 +0,0 @@ -//**@@@*@@@**************************************************** -// -// Microsoft Windows -// Copyright (C) Microsoft Corporation. All rights reserved. -// -//**@@@*@@@**************************************************** - -// -// FileName: CplExt.idl -// -// Abstract: IDL source for CplExt. This file will be processed by the -// MIDL tool to produce the type library (CplExt.tlb) and -// marshalling code. -// -// ---------------------------------------------------------------------------- - - -import "oaidl.idl"; -import "ocidl.idl"; - -[ - object, - uuid(E6DB299B-B925-415A-879B-4A76D072F39A), - dual, - nonextensible, - helpstring("ISwapPropPage Interface"), - pointer_default(unique) -] -interface ISwapPropPage : IDispatch{ -}; - - -[ - object, - uuid(D379F7FB-66E0-427f-890D-1F479AD73B4B), - dual, - nonextensible, - helpstring("IAdvEndpointPropPage Interface"), - pointer_default(unique) -] -interface IAdvEndpointPropPage : IDispatch{ -}; - - -[ - uuid(59390583-ED40-46D9-9B16-7800B9CC5CC2), - version(1.0), - helpstring("CplExt 1.0 Type Library") -] -library CplExtLib -{ - importlib("stdole2.tlb"); - - // For Swap Property Page - [ - uuid(19166F23-5F08-47F9-BB57-9F57A977D88E), - helpstring("SwapPropPage Class") - ] - coclass SwapPropPage - { - [default] interface ISwapPropPage; - }; - - // For Advanced Endpoint Property Page - [ - uuid(6C57B2A2-91F5-4b90-93D5-FAB82485ECA6), - helpstring("AdvEndpointPropPage Class") - ] - coclass AdvEndpointPropPage - { - [default] interface IAdvEndpointPropPage; - }; -}; diff --git a/audio/sysvad/SwapAPO/PropPageExtensions/CplExt.rc b/audio/sysvad/SwapAPO/PropPageExtensions/CplExt.rc deleted file mode 100644 index 415ed22e..00000000 --- a/audio/sysvad/SwapAPO/PropPageExtensions/CplExt.rc +++ /dev/null @@ -1,208 +0,0 @@ -// Microsoft Visual C++ generated resource script. -// -#include "resource.h" - -#define APSTUDIO_READONLY_SYMBOLS -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 2 resource. -// -#include "winres.h" - -///////////////////////////////////////////////////////////////////////////// -#undef APSTUDIO_READONLY_SYMBOLS - -///////////////////////////////////////////////////////////////////////////// -// English (U.S.) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) -#ifdef _WIN32 -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US -#pragma code_page(1252) -#endif //_WIN32 - -#ifdef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// TEXTINCLUDE -// - -1 TEXTINCLUDE -BEGIN - "resource.h\0" -END - -2 TEXTINCLUDE -BEGIN - "#include ""winres.h""\r\n" - "\0" -END - -3 TEXTINCLUDE -BEGIN - "1 TYPELIB ""cplext.tlb""\r\n" - "\0" -END - -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// -// Version -// - -VS_VERSION_INFO VERSIONINFO - FILEVERSION 1,0,0,1 - PRODUCTVERSION 1,0,0,1 - FILEFLAGSMASK 0x3fL -#ifdef _DEBUG - FILEFLAGS 0x1L -#else - FILEFLAGS 0x0L -#endif - FILEOS 0x4L - FILETYPE 0x2L - FILESUBTYPE 0x0L -BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "040904e4" - BEGIN - VALUE "CompanyName", "TODO: <Company name>" - VALUE "FileDescription", "TODO: <File description>" - VALUE "FileVersion", "1.0.0.1" - VALUE "InternalName", "CplExt.dll" - VALUE "LegalCopyright", "TODO: (c) <Company name>. All rights reserved." - VALUE "OriginalFilename", "CplExt.dll" - VALUE "ProductName", "TODO: <Product name>" - VALUE "ProductVersion", "1.0.0.1" - END - END - BLOCK "VarFileInfo" - BEGIN - VALUE "Translation", 0x409, 1252 - END -END - - -///////////////////////////////////////////////////////////////////////////// -// -// REGISTRY -// - -IDR_CPL_EXT REGISTRY "CplExt.rgs" -IDR_SWAP_PROP_PAGE REGISTRY "SwapPropPage.rgs" -IDR_ADV_ENDPOINT_PROP_PAGE REGISTRY "AdvEndpointPropPage.rgs" - -///////////////////////////////////////////////////////////////////////////// -// -// Dialog -// - -IDD_SWAP_PROP_PAGE DIALOGEX 0, 0, 284, 246 -STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_CHILD | WS_VISIBLE | - WS_CAPTION | WS_SYSMENU -CAPTION "System Effects - Sample" -FONT 8, "MS Shell Dlg", 400, 0, 0x1 -BEGIN - LTEXT "",IDC_SPP_ENDPOINT_NAME,19,34,211,8 - CONTROL "&Disable System Effects",IDC_DISABLE_SYSFX,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,22,92,89,8 - CONTROL "Enable Channel Swap &SFX",IDC_ENABLE_SWAP_SFX,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,22,112,98,8 - CONTROL "Enable Channel Swap &MFX",IDC_ENABLE_SWAP_MFX,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,22,132,99,8 - CONTROL "Enable D&elay SFX",IDC_ENABLE_DELAY_SFX,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,22,152,98,8 - CONTROL "Enable Del&ay MFX",IDC_ENABLE_DELAY_MFX,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,22,172,99,8 - GROUPBOX "Endpoint Name",IDC_STATIC,7,18,270,37 - GROUPBOX "System Effects Configuration",IDC_STATIC,7,71,270,132 -END - -IDD_ADV_ENDPOINT_PROP_PAGE DIALOGEX 0, 0, 284, 244 -STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_CHILD | WS_CAPTION | - WS_SYSMENU -CAPTION "Custom - Sample" -FONT 8, "MS Shell Dlg", 400, 0, 0x1 -BEGIN - LTEXT "",IDC_EPP_ENDPOINT_NAME,19,34,211,8 - LTEXT "",IDC_NO_ADV_CONTROLS_FOUND,20,90,232,9 - GROUPBOX "Endpoint Name",IDC_STATIC,7,18,270,37 - GROUPBOX "Advanced Controls",IDC_STATIC,7,71,270,154 -END - -IDD_WIDGET_GEN_LONG DIALOGEX 0, 0, 200, 12 -STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_VISIBLE -EXSTYLE WS_EX_STATICEDGE -FONT 8, "MS Shell Dlg", 400, 0, 0x1 -BEGIN - RTEXT "L",IDC_GEN_LABEL,0,2,94,8 - CONTROL "",IDC_GEN_SLIDER,"msctls_trackbar32",TBS_BOTH | - TBS_NOTICKS | WS_TABSTOP | 0x400,96,0,76,13 - RTEXT "-6 dB",IDC_GEN_VALUE,174,1,24,10,0,WS_EX_STATICEDGE -END - - -///////////////////////////////////////////////////////////////////////////// -// -// DESIGNINFO -// - -#ifdef APSTUDIO_INVOKED -GUIDELINES DESIGNINFO -BEGIN - IDD_SWAP_PROP_PAGE, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 277 - TOPMARGIN, 7 - BOTTOMMARGIN, 239 - END - - IDD_ADV_ENDPOINT_PROP_PAGE, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 277 - TOPMARGIN, 7 - BOTTOMMARGIN, 237 - END -END -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// -// Icon -// - -// Icon with lowest ID value placed first to ensure application icon -// remains consistent on all systems. -IDI_AUDIO_ICON ICON "music.ico" - -///////////////////////////////////////////////////////////////////////////// -// -// String Table -// - -STRINGTABLE -BEGIN - IDS_PROJ_NAME "CplExt" -END - -#endif // English (U.S.) resources -///////////////////////////////////////////////////////////////////////////// - - - -#ifndef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 3 resource. -// -1 TYPELIB "cplext.tlb" - -///////////////////////////////////////////////////////////////////////////// -#endif // not APSTUDIO_INVOKED - diff --git a/audio/sysvad/SwapAPO/PropPageExtensions/CplExt.rgs b/audio/sysvad/SwapAPO/PropPageExtensions/CplExt.rgs deleted file mode 100644 index 1c97b062..00000000 --- a/audio/sysvad/SwapAPO/PropPageExtensions/CplExt.rgs +++ /dev/null @@ -1,11 +0,0 @@ -HKCR -{ - NoRemove AppID - { - '%APPID%' = s 'CplExt' - 'CplExt.DLL' - { - val AppID = s '%APPID%' - } - } -} diff --git a/audio/sysvad/SwapAPO/PropPageExtensions/Parts.cpp b/audio/sysvad/SwapAPO/PropPageExtensions/Parts.cpp deleted file mode 100644 index 41130ead..00000000 --- a/audio/sysvad/SwapAPO/PropPageExtensions/Parts.cpp +++ /dev/null @@ -1,298 +0,0 @@ -//**@@@*@@@**************************************************** -// -// Microsoft Windows DevTopo.dll -// Copyright (C) Microsoft Corporation. All rights reserved. -// -//**@@@*@@@**************************************************** - -// -// FileName: Parts.cpp -// -// Abstract: Implementation of CPart and derived classes. -// -// -------------------------------------------------------------------------------- - -#include "stdafx.h" -#include <DeviceTopology.h> -#include "Parts.h" - -_Analysis_mode_(_Analysis_code_type_user_driver_) - -// ---------------------------------------------------------------------- -// Function: -// CPartsList::CPartsList -// -// Description: -// CPartsList constructor -// ---------------------------------------------------------------------- -CPartsList::CPartsList() : - m_refCount(1) -{ -} - - -// ---------------------------------------------------------------------- -// Function: -// CPartsList::~CPartsList -// -// Description: -// CPartsList destructor -// ---------------------------------------------------------------------- -CPartsList::~CPartsList() -{ - ATLASSERT(m_refCount == 0); - - IPart* pIPart; - while (m_lstParts.RemoveHead(&pIPart)) - { - SAFE_RELEASE(pIPart); - } -} - - -// ---------------------------------------------------------------------- -// Function: -// CPartsList::QueryInterface -// -// Description: -// Implementation of IUnknown::QueryInterface -// -// Parameters: -// riid - [in] Identifier of the interface being queried -// ppvObj - [in] Pointer to a buffer that receives a pointer to the -// object whose interface is queried -// -// Return: -// S_OK if successful -// ---------------------------------------------------------------------- -STDMETHODIMP CPartsList::QueryInterface -( - const IID& iid, - void** ppUnk -) -{ - if (!ppUnk) - return E_POINTER; - - HRESULT hr = E_NOINTERFACE; - *ppUnk = NULL; - - if (iid == __uuidof(IPartsList)) - { - *ppUnk = (IPartsList*)this; - hr = S_OK; - AddRef(); - } - else - if (iid == __uuidof(IUnknown)) - { - *ppUnk = (IUnknown*)this; - hr = S_OK; - AddRef(); - } - - return hr; -} - - -// ---------------------------------------------------------------------- -// Function: -// CPartsList::AddRef -// -// Description: -// Implementation of IUnknown::AddRef -// -// Return: -// New refcount -// ---------------------------------------------------------------------- -ULONG STDMETHODCALLTYPE CPartsList::AddRef(void) -{ - return InterlockedIncrement(&m_refCount); -} - - -// ---------------------------------------------------------------------- -// Function: -// CPartsList::Release -// -// Description: -// Implementation of IUnknown::Release -// -// Return: -// New refcount -// ---------------------------------------------------------------------- -ULONG STDMETHODCALLTYPE CPartsList::Release(void) -{ - ATLASSERT(m_refCount > 0); - LONG lRef = InterlockedDecrement(&m_refCount); - ATLASSERT(lRef >= 0); - - if (lRef == 0) - { - delete this; - } - return lRef; -} - - -// ---------------------------------------------------------------------- -// Function: -// CPartsList::AddPart -// -// Description: -// Adds an item to the list of IPart interfaces -// -// Parameters: -// pIPart - [in] Part to add to the list -// -// Return: -// S_OK if successful -// ---------------------------------------------------------------------- -STDMETHODIMP CPartsList::AddPart -( - IPart* pIPart -) -{ - if (pIPart == NULL) - return E_POINTER; - - // Protect m_lstParts access - m_CritSection.Enter(); - - pIPart->AddRef(); - m_lstParts.AddTail(pIPart); - - m_CritSection.Leave(); - - return S_OK; -} - - -// ---------------------------------------------------------------------- -// Function: -// CPartsList::AddPart -// -// Description: -// Adds the PartsList Parts to the list of IPart interfaces -// -// Parameters: -// pIParts - [in] List of Parts to be added to the list -// -// Return: -// S_OK if successful -// ---------------------------------------------------------------------- -STDMETHODIMP CPartsList::AddParts -( - IPartsList* pIParts -) -{ - ATLASSERT(pIParts != NULL); - - HRESULT hr = S_OK; - UINT i, cParts = 0; - - // Protect m_lstParts - m_CritSection.Enter(); - - // Loop through specified parts list - hr = pIParts->GetCount(&cParts); - IF_FAILED_JUMP(hr, Exit); - - for (i = 0; (i < cParts) && (hr == S_OK); i++) - { - IPart* pIPart; - - // ... and copy reference to each part - hr = pIParts->GetPart(i, &pIPart); - IF_FAILED_JUMP(hr, Exit); - - // ... to this list - m_lstParts.AddTail(pIPart); - } - -Exit: - m_CritSection.Leave(); - - return hr; -} - - -// ---------------------------------------------------------------------- -// Function: -// CPartsList::GetCount -// -// Description: -// Returns the count of items in the list of IParts -// -// Parameters: -// pCount - [out] the count of parts in this list -// -// Return: -// S_OK if successful -// -// ---------------------------------------------------------------------- -_Use_decl_annotations_ -STDMETHODIMP CPartsList::GetCount -( - UINT* pCount -) -{ - if (pCount == NULL) - return E_POINTER; - - // Protect m_lstParts access - m_CritSection.Enter(); - - *pCount = m_lstParts.GetCount(); - - m_CritSection.Leave(); - - return S_OK; -} - - -// ---------------------------------------------------------------------- -// Function: -// CPartsList::GetPart -// -// Description: -// Returns the nIndex-th item in the list of IParts -// -// Parameters: -// nIndex - [in] index of the part to access -// uMsg - [out] the part at the specified index -// -// Return: -// S_OK if successful -// -// ---------------------------------------------------------------------- -_Use_decl_annotations_ -STDMETHODIMP CPartsList::GetPart -( - UINT nIndex, - IPart** ppPart -) -{ - HRESULT hr; - IPart* pIPart = NULL; - - // Protect m_lstParts access - m_CritSection.Enter(); - - IF_TRUE_ACTION_JUMP((ppPart == NULL), hr = E_POINTER, Exit); - - *ppPart = NULL; - - IF_TRUE_ACTION_JUMP((nIndex >= m_lstParts.GetCount()), hr = E_INVALIDARG, Exit); - - IF_TRUE_ACTION_JUMP((!m_lstParts.GetAt(nIndex, &pIPart)), hr = E_NOTFOUND, Exit); - - // Take care of AddRef and ensure correct interface in one shot - hr = pIPart->QueryInterface(__uuidof(IPart), reinterpret_cast<void**>(ppPart)); - IF_FAILED_JUMP(hr, Exit); - -Exit: - m_CritSection.Leave(); - - return hr; -} diff --git a/audio/sysvad/SwapAPO/PropPageExtensions/Parts.h b/audio/sysvad/SwapAPO/PropPageExtensions/Parts.h deleted file mode 100644 index 1cad63f5..00000000 --- a/audio/sysvad/SwapAPO/PropPageExtensions/Parts.h +++ /dev/null @@ -1,49 +0,0 @@ -//**@@@*@@@**************************************************** -// -// Microsoft Windows DevTopo.dll -// Copyright (C) Microsoft Corporation. All rights reserved. -// -//**@@@*@@@**************************************************** - -// -// FileName: Parts.h -// -// Abstract: CPartsList is a list container of parts -// -// -------------------------------------------------------------------------------- - -#pragma once - - -class CPartsList : public IPartsList -{ -private: - - // This is a REAL refcount. When it goes to zero, the object is destroyed. - LONG m_refCount; - TList<IPart> m_lstParts; - - CCriticalSection m_CritSection; - -protected: - ~CPartsList(); // Refcounted objects should have a private destructor. - -public: - CPartsList(); - - STDMETHOD(AddPart)(IPart* pIPart); - STDMETHOD(AddParts)(IPartsList* pIParts); - -public: - - // IPartsList - STDMETHOD(GetCount)(_Out_ UINT* pCount); - STDMETHOD(GetPart)(_In_ UINT nIndex, _Out_ IPart** ppPart); - - // IUnknown - HRESULT STDMETHODCALLTYPE QueryInterface(const IID& iid, void** ppUnk); - ULONG STDMETHODCALLTYPE AddRef(void); - ULONG STDMETHODCALLTYPE Release(void); - - friend class CDeviceTopology; -}; diff --git a/audio/sysvad/SwapAPO/PropPageExtensions/PropPageExt.def b/audio/sysvad/SwapAPO/PropPageExtensions/PropPageExt.def deleted file mode 100644 index aa2797ce..00000000 --- a/audio/sysvad/SwapAPO/PropPageExtensions/PropPageExt.def +++ /dev/null @@ -1,9 +0,0 @@ -; PropPageExt.def : Declares the module parameters. - -LIBRARY "PropPageExt.DLL" - -EXPORTS - DllCanUnloadNow PRIVATE - DllGetClassObject PRIVATE - DllRegisterServer PRIVATE - DllUnregisterServer PRIVATE diff --git a/audio/sysvad/SwapAPO/PropPageExtensions/PropPageExt.vcxproj b/audio/sysvad/SwapAPO/PropPageExtensions/PropPageExt.vcxproj deleted file mode 100644 index 836e70cd..00000000 --- a/audio/sysvad/SwapAPO/PropPageExtensions/PropPageExt.vcxproj +++ /dev/null @@ -1,275 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> - <ItemGroup Label="ProjectConfigurations"> - <ProjectConfiguration Include="Debug|Win32"> - <Configuration>Debug</Configuration> - <Platform>Win32</Platform> - </ProjectConfiguration> - <ProjectConfiguration Include="Release|Win32"> - <Configuration>Release</Configuration> - <Platform>Win32</Platform> - </ProjectConfiguration> - <ProjectConfiguration Include="Debug|x64"> - <Configuration>Debug</Configuration> - <Platform>x64</Platform> - </ProjectConfiguration> - <ProjectConfiguration Include="Release|x64"> - <Configuration>Release</Configuration> - <Platform>x64</Platform> - </ProjectConfiguration> - </ItemGroup> - <PropertyGroup Label="Globals"> - <ProjectGuid>{D253C552-154D-49E1-820A-B2CD9D9FF13E}</ProjectGuid> - <RootNamespace>$(MSBuildProjectName)</RootNamespace> - <SupportsPackaging>false</SupportsPackaging> - <RequiresPackageProject>true</RequiresPackageProject> - <Configuration Condition="'$(Configuration)' == ''">Debug</Configuration> - <Platform Condition="'$(Platform)' == ''">Win32</Platform> - <SampleGuid>{025DDC98-E8D3-43AF-862D-3FDA9A8432E9}</SampleGuid> - </PropertyGroup> - <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> - <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> - <TargetVersion>Windows10</TargetVersion> - <UseDebugLibraries>False</UseDebugLibraries> - <DriverTargetPlatform>Desktop</DriverTargetPlatform> - <DriverType /> - <PlatformToolset>WindowsApplicationForDrivers10.0</PlatformToolset> - <ConfigurationType>DynamicLibrary</ConfigurationType> - </PropertyGroup> - <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> - <TargetVersion>Windows10</TargetVersion> - <UseDebugLibraries>True</UseDebugLibraries> - <DriverTargetPlatform>Desktop</DriverTargetPlatform> - <DriverType /> - <PlatformToolset>WindowsApplicationForDrivers10.0</PlatformToolset> - <ConfigurationType>DynamicLibrary</ConfigurationType> - </PropertyGroup> - <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> - <TargetVersion>Windows10</TargetVersion> - <UseDebugLibraries>False</UseDebugLibraries> - <DriverTargetPlatform>Desktop</DriverTargetPlatform> - <DriverType /> - <PlatformToolset>WindowsApplicationForDrivers10.0</PlatformToolset> - <ConfigurationType>DynamicLibrary</ConfigurationType> - </PropertyGroup> - <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> - <TargetVersion>Windows10</TargetVersion> - <UseDebugLibraries>True</UseDebugLibraries> - <DriverTargetPlatform>Desktop</DriverTargetPlatform> - <DriverType /> - <PlatformToolset>WindowsApplicationForDrivers10.0</PlatformToolset> - <ConfigurationType>DynamicLibrary</ConfigurationType> - </PropertyGroup> - <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> - <PropertyGroup> - <OutDir>$(IntDir)</OutDir> - </PropertyGroup> - <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" /> - </ImportGroup> - <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" /> - </ImportGroup> - <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" /> - </ImportGroup> - <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" /> - </ImportGroup> - <ItemGroup Label="WrappedTaskItems" /> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> - <TargetName>PropPageExt</TargetName> - <UseOfAtl>Dynamic</UseOfAtl> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> - <TargetName>PropPageExt</TargetName> - <UseOfAtl>Dynamic</UseOfAtl> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> - <TargetName>PropPageExt</TargetName> - <UseOfAtl>Dynamic</UseOfAtl> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> - <TargetName>PropPageExt</TargetName> - <UseOfAtl>Dynamic</UseOfAtl> - </PropertyGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> - <ClCompile> - <ExceptionHandling>Sync</ExceptionHandling> - </ClCompile> - <Link> - <EntryPointSymbol Condition="'$(Platform)'=='win32'">_DllMainCRTStartup@12</EntryPointSymbol> - <EntryPointSymbol Condition="'$(Platform)'!='win32'">_DllMainCRTStartup</EntryPointSymbol> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> - <ClCompile> - <ExceptionHandling>Sync</ExceptionHandling> - </ClCompile> - <Link> - <EntryPointSymbol Condition="'$(Platform)'=='win32'">_DllMainCRTStartup@12</EntryPointSymbol> - <EntryPointSymbol Condition="'$(Platform)'!='win32'">_DllMainCRTStartup</EntryPointSymbol> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> - <ClCompile> - <ExceptionHandling>Sync</ExceptionHandling> - </ClCompile> - <Link> - <EntryPointSymbol Condition="'$(Platform)'=='win32'">_DllMainCRTStartup@12</EntryPointSymbol> - <EntryPointSymbol Condition="'$(Platform)'!='win32'">_DllMainCRTStartup</EntryPointSymbol> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> - <ClCompile> - <ExceptionHandling>Sync</ExceptionHandling> - </ClCompile> - <Link> - <EntryPointSymbol Condition="'$(Platform)'=='win32'">_DllMainCRTStartup@12</EntryPointSymbol> - <EntryPointSymbol Condition="'$(Platform)'!='win32'">_DllMainCRTStartup</EntryPointSymbol> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> - <ClCompile> - <TreatWarningAsError>true</TreatWarningAsError> - <WarningLevel>Level4</WarningLevel> - <AdditionalOptions>%(AdditionalOptions) /wd4127</AdditionalOptions> - <PreprocessorDefinitions>%(PreprocessorDefinitions);UNICODE;_UNICODE</PreprocessorDefinitions> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\Inc;$(DDK_INC_PATH)</AdditionalIncludeDirectories> - </ClCompile> - <Midl> - <PreprocessorDefinitions>%(PreprocessorDefinitions);UNICODE;_UNICODE</PreprocessorDefinitions> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\Inc;$(DDK_INC_PATH)</AdditionalIncludeDirectories> - </Midl> - <ResourceCompile> - <PreprocessorDefinitions>%(PreprocessorDefinitions);UNICODE;_UNICODE</PreprocessorDefinitions> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\Inc;$(DDK_INC_PATH)</AdditionalIncludeDirectories> - </ResourceCompile> - <Link> - <AdditionalDependencies>%(AdditionalDependencies);advapi32.lib;kernel32.lib;user32.lib;ole32.lib;oleaut32.lib;uuid.lib;shlwapi.lib;comctl32.lib;rpcrt4.lib</AdditionalDependencies> - <ModuleDefinitionFile>PropPageExt.def</ModuleDefinitionFile> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> - <ClCompile> - <TreatWarningAsError>true</TreatWarningAsError> - <WarningLevel>Level4</WarningLevel> - <AdditionalOptions>%(AdditionalOptions) /wd4127</AdditionalOptions> - <PreprocessorDefinitions>%(PreprocessorDefinitions);UNICODE;_UNICODE</PreprocessorDefinitions> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\Inc;$(DDK_INC_PATH)</AdditionalIncludeDirectories> - </ClCompile> - <Midl> - <PreprocessorDefinitions>%(PreprocessorDefinitions);UNICODE;_UNICODE</PreprocessorDefinitions> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\Inc;$(DDK_INC_PATH)</AdditionalIncludeDirectories> - </Midl> - <ResourceCompile> - <PreprocessorDefinitions>%(PreprocessorDefinitions);UNICODE;_UNICODE</PreprocessorDefinitions> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\Inc;$(DDK_INC_PATH)</AdditionalIncludeDirectories> - </ResourceCompile> - <Link> - <AdditionalDependencies>%(AdditionalDependencies);advapi32.lib;kernel32.lib;user32.lib;ole32.lib;oleaut32.lib;uuid.lib;shlwapi.lib;comctl32.lib;rpcrt4.lib</AdditionalDependencies> - <ModuleDefinitionFile>PropPageExt.def</ModuleDefinitionFile> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> - <ClCompile> - <TreatWarningAsError>true</TreatWarningAsError> - <WarningLevel>Level4</WarningLevel> - <AdditionalOptions>%(AdditionalOptions) /wd4127</AdditionalOptions> - <PreprocessorDefinitions>%(PreprocessorDefinitions);UNICODE;_UNICODE</PreprocessorDefinitions> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\Inc;$(DDK_INC_PATH)</AdditionalIncludeDirectories> - </ClCompile> - <Midl> - <PreprocessorDefinitions>%(PreprocessorDefinitions);UNICODE;_UNICODE</PreprocessorDefinitions> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\Inc;$(DDK_INC_PATH)</AdditionalIncludeDirectories> - </Midl> - <ResourceCompile> - <PreprocessorDefinitions>%(PreprocessorDefinitions);UNICODE;_UNICODE</PreprocessorDefinitions> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\Inc;$(DDK_INC_PATH)</AdditionalIncludeDirectories> - </ResourceCompile> - <Link> - <AdditionalDependencies>%(AdditionalDependencies);advapi32.lib;kernel32.lib;user32.lib;ole32.lib;oleaut32.lib;uuid.lib;shlwapi.lib;comctl32.lib;rpcrt4.lib</AdditionalDependencies> - <ModuleDefinitionFile>PropPageExt.def</ModuleDefinitionFile> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> - <ClCompile> - <TreatWarningAsError>true</TreatWarningAsError> - <WarningLevel>Level4</WarningLevel> - <AdditionalOptions>%(AdditionalOptions) /wd4127</AdditionalOptions> - <PreprocessorDefinitions>%(PreprocessorDefinitions);UNICODE;_UNICODE</PreprocessorDefinitions> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\Inc;$(DDK_INC_PATH)</AdditionalIncludeDirectories> - </ClCompile> - <Midl> - <PreprocessorDefinitions>%(PreprocessorDefinitions);UNICODE;_UNICODE</PreprocessorDefinitions> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\Inc;$(DDK_INC_PATH)</AdditionalIncludeDirectories> - </Midl> - <ResourceCompile> - <PreprocessorDefinitions>%(PreprocessorDefinitions);UNICODE;_UNICODE</PreprocessorDefinitions> - <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\Inc;$(DDK_INC_PATH)</AdditionalIncludeDirectories> - </ResourceCompile> - <Link> - <AdditionalDependencies>%(AdditionalDependencies);advapi32.lib;kernel32.lib;user32.lib;ole32.lib;oleaut32.lib;uuid.lib;shlwapi.lib;comctl32.lib;rpcrt4.lib</AdditionalDependencies> - <ModuleDefinitionFile>PropPageExt.def</ModuleDefinitionFile> - </Link> - </ItemDefinitionGroup> - <ItemGroup> - <ClCompile Include="AdvEndpointPropPage.cpp"> - <AdditionalIncludeDirectories>;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <PreCompiledHeaderFile>stdafx.h</PreCompiledHeaderFile> - <PreCompiledHeader>Use</PreCompiledHeader> - <PreCompiledHeaderOutputFile>$(IntDir)\stdafx.pch</PreCompiledHeaderOutputFile> - </ClCompile> - <ClCompile Include="CplExt.cpp"> - <AdditionalIncludeDirectories>;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <PreCompiledHeaderFile>stdafx.h</PreCompiledHeaderFile> - <PreCompiledHeader>Use</PreCompiledHeader> - <PreCompiledHeaderOutputFile>$(IntDir)\stdafx.pch</PreCompiledHeaderOutputFile> - </ClCompile> - <ClCompile Include="Parts.cpp"> - <AdditionalIncludeDirectories>;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <PreCompiledHeaderFile>stdafx.h</PreCompiledHeaderFile> - <PreCompiledHeader>Use</PreCompiledHeader> - <PreCompiledHeaderOutputFile>$(IntDir)\stdafx.pch</PreCompiledHeaderOutputFile> - </ClCompile> - <ClCompile Include="stdafx.cpp"> - <AdditionalIncludeDirectories>;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <PreCompiledHeaderFile>stdafx.h</PreCompiledHeaderFile> - <PreCompiledHeader>Create</PreCompiledHeader> - <PreCompiledHeaderOutputFile>$(IntDir)\stdafx.pch</PreCompiledHeaderOutputFile> - </ClCompile> - <ClCompile Include="SwapPropPage.cpp"> - <AdditionalIncludeDirectories>;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <PreCompiledHeaderFile>stdafx.h</PreCompiledHeaderFile> - <PreCompiledHeader>Use</PreCompiledHeader> - <PreCompiledHeaderOutputFile>$(IntDir)\stdafx.pch</PreCompiledHeaderOutputFile> - </ClCompile> - <ClCompile Include="TopologyExaminers.cpp"> - <AdditionalIncludeDirectories>;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <PreCompiledHeaderFile>stdafx.h</PreCompiledHeaderFile> - <PreCompiledHeader>Use</PreCompiledHeader> - <PreCompiledHeaderOutputFile>$(IntDir)\stdafx.pch</PreCompiledHeaderOutputFile> - </ClCompile> - <ClCompile Include="UIWidgets.cpp"> - <AdditionalIncludeDirectories>;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <PreCompiledHeaderFile>stdafx.h</PreCompiledHeaderFile> - <PreCompiledHeader>Use</PreCompiledHeader> - <PreCompiledHeaderOutputFile>$(IntDir)\stdafx.pch</PreCompiledHeaderOutputFile> - </ClCompile> - <Midl Include="CplExt.idl" /> - <ResourceCompile Include="CplExt.rc" /> - </ItemGroup> - <ItemGroup> - <Inf Exclude="@(Inf)" Include="*.inf" /> - <FilesToPackage Include="$(TargetPath)" Condition="'$(ConfigurationType)'=='Driver' or '$(ConfigurationType)'=='DynamicLibrary'" /> - </ItemGroup> - <ItemGroup> - <None Exclude="@(None)" Include="*.txt;*.htm;*.html" /> - <None Exclude="@(None)" Include="*.ico;*.cur;*.bmp;*.dlg;*.rct;*.gif;*.jpg;*.jpeg;*.wav;*.jpe;*.tiff;*.tif;*.png;*.rc2" /> - <None Exclude="@(None)" Include="*.def;*.bat;*.hpj;*.asmx" /> - </ItemGroup> - <ItemGroup> - <ClInclude Exclude="@(ClInclude)" Include="*.h;*.hpp;*.hxx;*.hm;*.inl;*.xsd" /> - </ItemGroup> - <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> -</Project>
\ No newline at end of file diff --git a/audio/sysvad/SwapAPO/PropPageExtensions/SwapPropPage.cpp b/audio/sysvad/SwapAPO/PropPageExtensions/SwapPropPage.cpp deleted file mode 100644 index cdc2b0e2..00000000 --- a/audio/sysvad/SwapAPO/PropPageExtensions/SwapPropPage.cpp +++ /dev/null @@ -1,1154 +0,0 @@ -//**@@@*@@@**************************************************** -// -// Microsoft Windows -// Copyright (C) Microsoft Corporation. All rights reserved. -// -//**@@@*@@@**************************************************** - -// -// FileName: SwapPropPage.cpp -// -// Abstract: Implementation of the CSwapPropPage class -// -// ---------------------------------------------------------------------------- - - -#include "stdafx.h" -#include <initguid.h> // DEFINE_GUID -#include <mmdeviceapi.h> -#include <audioenginebaseapo.h> -#include <audioendpoints.h> -#include "SwapPropPage.h" -#include <functiondiscoverykeys.h> -#include <CustomPropKeys.h> -#include "cplext_i.c" - -_Analysis_mode_(_Analysis_code_type_user_driver_) - -// ---------------------------------------------------------------------------- -// Function: -// CSwapPropPage::CSwapPropPage -// -// Description: -// CSwapPropPage constructor -// ---------------------------------------------------------------------------- -CSwapPropPage::CSwapPropPage() -: m_pAudioFXExtParams(NULL) -, m_fDisableSysFX(FALSE) -, m_fEnableSwapSFX(FALSE) -, m_fEnableSwapMFX(FALSE) -, m_fEnableDelaySFX(FALSE) -, m_fEnableDelayMFX(FALSE) -, m_fReset(FALSE) -{ -} - - -// ---------------------------------------------------------------------------- -// Function: -// CSwapPropPage::~CSwapPropPage -// -// Description: -// CSwapPropPage destructor -// ---------------------------------------------------------------------------- -CSwapPropPage::~CSwapPropPage() -{ - SAFE_RELEASE(m_pAudioFXExtParams->pFxProperties); - SAFE_DELETE(m_pAudioFXExtParams); -} - - -// ---------------------------------------------------------------------------- -// Function: -// CSwapPropPage::GetDeviceFriendlyName -// -// Description: -// Retrieves the endpoint's friendly name -// -// Parameters: -// ppNameOut - [out] The friendly name of the endpoint -// -// Return values: -// S_OK if successful -// ---------------------------------------------------------------------------- -HRESULT CSwapPropPage::GetDeviceFriendlyName -( - _Outptr_result_maybenull_ LPWSTR* ppNameOut -) -{ - CComPtr<IMMDeviceEnumerator> spEnumerator; - CComPtr<IPropertyStore> spProperties; - CComPtr<IMMDevice> spMMDevice; - HRESULT hr = S_OK; - PROPVARIANT var; - - IF_TRUE_ACTION_JUMP((ppNameOut == NULL), hr = E_POINTER, Exit); - - *ppNameOut = NULL; - - // Create device enumerator and get IMMDevice from the device ID - hr = spEnumerator.CoCreateInstance(__uuidof(MMDeviceEnumerator)); - IF_FAILED_JUMP(hr, Exit); - - hr = spEnumerator->GetDevice(m_pAudioFXExtParams->pwstrEndpointID, &spMMDevice); - IF_FAILED_JUMP(hr, Exit); - - // Open the PropertyStore for read access - hr = spMMDevice->OpenPropertyStore(STGM_READ, &spProperties); - IF_FAILED_JUMP(hr, Exit); - - PropVariantInit(&var); - - // Retrieve the friendly name of the endpoint - hr = spProperties->GetValue(PKEY_Device_FriendlyName, &var); - if (SUCCEEDED(hr) && (var.vt == VT_LPWSTR)) - { - *ppNameOut = var.pwszVal; - } - else - { - PropVariantClear(&var); - } - -Exit: - return(hr); -} - - -// ---------------------------------------------------------------------------- -// Function: -// CSwapPropPage::RetrieveSysFXState -// -// Description: -// Get the current state (enabled or disabled) of system effects -// -// Return values: -// S_OK if successful -// ---------------------------------------------------------------------------- -HRESULT CSwapPropPage::RetrieveSysFXState(BOOL *pfDisabled) -{ - HRESULT hr = E_POINTER; - - if ((m_pAudioFXExtParams != NULL) && (m_pAudioFXExtParams->pFxProperties != NULL)) - { - PROPVARIANT var; - PropVariantInit(&var); - - // Get the state of whether system effects are enabled or not - hr = m_pAudioFXExtParams->pFxProperties->GetValue(PKEY_AudioEndpoint_Disable_SysFx, &var); - if (SUCCEEDED(hr) && (var.vt == VT_UI4)) - { - *pfDisabled = (var.ulVal != 0L); - } - - PropVariantClear(&var); - } - - return(hr); -} - - -// ---------------------------------------------------------------------------- -// Function: -// CSwapPropPage::SetSysFXState -// -// Description: -// Enable or disable system effects -// -// Return values: -// S_OK if successful -// ---------------------------------------------------------------------------- -HRESULT CSwapPropPage::SetSysFXState() -{ - BOOL fCurrentState = 0; - HRESULT hr = RetrieveSysFXState(&fCurrentState); - IF_FAILED_JUMP(hr, Exit); - - if (fCurrentState != m_fDisableSysFX) - { - PROPVARIANT var; - var.vt = VT_UI4; - var.ulVal = (m_fDisableSysFX ? 1L : 0L); - - // Enable or disable SysFX - hr = m_pAudioFXExtParams->pFxProperties->SetValue(PKEY_AudioEndpoint_Disable_SysFx, var); - } - -Exit: - return(hr); -} - - -// ---------------------------------------------------------------------------- -// Function: -// CSwapPropPage::RetrieveSwapSFXState -// -// Description: -// Get the current state (enabled or disabled) of channel swap SFX -// -// Return values: -// S_OK if successful -// ---------------------------------------------------------------------------- -HRESULT CSwapPropPage::RetrieveSwapSFXState(BOOL *pfEnabled) -{ - HRESULT hr = E_POINTER; - - if ((m_pAudioFXExtParams != NULL) && (m_pAudioFXExtParams->pFxProperties != NULL)) - { - PROPVARIANT var; - PropVariantInit(&var); - - // Get the state of whether channel swap SFX is enabled or not - hr = m_pAudioFXExtParams->pFxProperties->GetValue(PKEY_Endpoint_Enable_Channel_Swap_SFX, &var); - if (SUCCEEDED(hr) && (var.vt == VT_UI4)) - { - *pfEnabled = (var.ulVal != 0L); - } - - PropVariantClear(&var); - } - - return(hr); -} - - -// ---------------------------------------------------------------------------- -// Function: -// CSwapPropPage::SetSwapSFXState -// -// Description: -// Enable or disable channel swap SFX -// -// Return values: -// S_OK if successful -// ---------------------------------------------------------------------------- -HRESULT CSwapPropPage::SetSwapSFXState() -{ - BOOL fCurrentState = 0; - HRESULT hr = RetrieveSwapSFXState(&fCurrentState); - IF_FAILED_JUMP(hr, Exit); - - if (fCurrentState != m_fEnableSwapSFX) - { - PROPVARIANT var; - var.vt = VT_UI4; - var.ulVal = (m_fEnableSwapSFX ? 1L : 0L); - - // Enable or disable channel swap SFX - hr = m_pAudioFXExtParams->pFxProperties->SetValue(PKEY_Endpoint_Enable_Channel_Swap_SFX, var); - - // Enabling or disabling the swap effect can be done with the engine running - // It does not invalidate anything which should be locked by IAudioProcessingObjectConfiguration::LockForProcess - // In particular, it does not impact IAudioProcessingObject::GetLatency - // So we do not need to call IAudioEndpointFormatControl::ResetToDefault here - } - -Exit: - return(hr); -} - - -// ---------------------------------------------------------------------------- -// Function: -// CSwapPropPage::RetrieveSwapMFXState -// -// Description: -// Get the current state (enabled or disabled) of channel swap MFX -// -// Return values: -// S_OK if successful -// ---------------------------------------------------------------------------- -HRESULT CSwapPropPage::RetrieveSwapMFXState(BOOL *pfEnabled) -{ - HRESULT hr = E_POINTER; - - if ((m_pAudioFXExtParams != NULL) && (m_pAudioFXExtParams->pFxProperties != NULL)) - { - PROPVARIANT var; - PropVariantInit(&var); - - // Get the state of whether channel swap MFX is enabled or not - hr = m_pAudioFXExtParams->pFxProperties->GetValue(PKEY_Endpoint_Enable_Channel_Swap_MFX, &var); - if (SUCCEEDED(hr) && (var.vt == VT_UI4)) - { - *pfEnabled = (var.ulVal != 0L); - } - - PropVariantClear(&var); - } - - return(hr); -} - - -// ---------------------------------------------------------------------------- -// Function: -// CSwapPropPage::SetSwapMFXState -// -// Description: -// Enable or disable channel swap MFX -// -// Return values: -// S_OK if successful -// ---------------------------------------------------------------------------- -HRESULT CSwapPropPage::SetSwapMFXState() -{ - BOOL fCurrentState = 0; - HRESULT hr = RetrieveSwapMFXState(&fCurrentState); - IF_FAILED_JUMP(hr, Exit); - - if (fCurrentState != m_fEnableSwapMFX) - { - PROPVARIANT var; - var.vt = VT_UI4; - var.ulVal = (m_fEnableSwapMFX ? 1L : 0L); - - // Enable or disable channel swap MFX - hr = m_pAudioFXExtParams->pFxProperties->SetValue(PKEY_Endpoint_Enable_Channel_Swap_MFX, var); - - // Enabling or disabling the swap effect can be done with the engine running - // It does not invalidate anything which should be locked by IAudioProcessingObjectConfiguration::LockForProcess - // In particular, it does not impact IAudioProcessingObject::GetLatency - // So we do not need to call IAudioEndpointFormatControl::ResetToDefault here - } - -Exit: - return(hr); -} - - -// ---------------------------------------------------------------------------- -// Function: -// CSwapPropPage::RetrieveDelaySFXState -// -// Description: -// Get the current state (enabled or disabled) of delay SFX -// -// Return values: -// S_OK if successful -// ---------------------------------------------------------------------------- -HRESULT CSwapPropPage::RetrieveDelaySFXState(BOOL *pfEnabled) -{ - HRESULT hr = E_POINTER; - - if ((m_pAudioFXExtParams != NULL) && (m_pAudioFXExtParams->pFxProperties != NULL)) - { - PROPVARIANT var; - PropVariantInit(&var); - - // Get the state of whether channel swap SFX is enabled or not - hr = m_pAudioFXExtParams->pFxProperties->GetValue(PKEY_Endpoint_Enable_Delay_SFX, &var); - if (SUCCEEDED(hr) && (var.vt == VT_UI4)) - { - *pfEnabled = (var.ulVal != 0L); - } - - PropVariantClear(&var); - } - - return(hr); -} - - -// ---------------------------------------------------------------------------- -// Function: -// CSwapPropPage::SetSwapSFXState -// -// Description: -// Enable or disable channel swap SFX -// -// Return values: -// S_OK if successful -// ---------------------------------------------------------------------------- -HRESULT CSwapPropPage::SetDelaySFXState() -{ - BOOL fCurrentState = 0; - HRESULT hr = RetrieveDelaySFXState(&fCurrentState); - IF_FAILED_JUMP(hr, Exit); - - if (fCurrentState != m_fEnableDelaySFX) - { - PROPVARIANT var; - var.vt = VT_UI4; - var.ulVal = (m_fEnableDelaySFX ? 1L : 0L); - - // Enable or disable delay SFX - hr = m_pAudioFXExtParams->pFxProperties->SetValue(PKEY_Endpoint_Enable_Delay_SFX, var); - IF_FAILED_JUMP(hr, Exit); - - // Enabling or disabling delay changes the value that should be returned by IAudioProcessingObject::GetLatency - // This is one of the things that is locked by IAudioProcessingObjectConfiguration::LockForProcess - // So we need to call IAudioEndpointFormatControl::ResetToDefault - // This will prompt AudioDG to tear down the graph and build it up again - m_fReset = TRUE; - } - -Exit: - return(hr); -} - - -// ---------------------------------------------------------------------------- -// Function: -// CSwapPropPage::RetrieveDelayMFXState -// -// Description: -// Get the current state (enabled or disabled) of delay MFX -// -// Return values: -// S_OK if successful -// ---------------------------------------------------------------------------- -HRESULT CSwapPropPage::RetrieveDelayMFXState(BOOL *pfEnabled) -{ - HRESULT hr = E_POINTER; - - if ((m_pAudioFXExtParams != NULL) && (m_pAudioFXExtParams->pFxProperties != NULL)) - { - PROPVARIANT var; - PropVariantInit(&var); - - // Get the state of whether channel swap MFX is enabled or not - hr = m_pAudioFXExtParams->pFxProperties->GetValue(PKEY_Endpoint_Enable_Delay_MFX, &var); - if (SUCCEEDED(hr) && (var.vt == VT_UI4)) - { - *pfEnabled = (var.ulVal != 0L); - } - - PropVariantClear(&var); - } - - return(hr); -} - - -// ---------------------------------------------------------------------------- -// Function: -// CSwapPropPage::SetDelayMFXState -// -// Description: -// Enable or disable delay MFX -// -// Return values: -// S_OK if successful -// ---------------------------------------------------------------------------- -HRESULT CSwapPropPage::SetDelayMFXState() -{ - BOOL fCurrentState = 0; - HRESULT hr = RetrieveDelayMFXState(&fCurrentState); - IF_FAILED_JUMP(hr, Exit); - - if (fCurrentState != m_fEnableDelayMFX) - { - PROPVARIANT var; - var.vt = VT_UI4; - var.ulVal = (m_fEnableDelayMFX ? 1L : 0L); - - // Enable or disable delay MFX - hr = m_pAudioFXExtParams->pFxProperties->SetValue(PKEY_Endpoint_Enable_Delay_MFX, var); - IF_FAILED_JUMP(hr, Exit); - - // Enabling or disabling delay changes the value that should be returned by IAudioProcessingObject::GetLatency - // This is one of the things that is locked by IAudioProcessingObjectConfiguration::LockForProcess - // So we need to call IAudioEndpointFormatControl::ResetToDefault - // This will prompt AudioDG to tear down the graph and build it up again - m_fReset = TRUE; - } - -Exit: - return(hr); -} - - -// ---------------------------------------------------------------------------- -// Function: -// CSwapPropPage::OnInitDialog -// -// Description: -// Dialog initialization routine -// -// Parameters: -// hwndDlg - [in] Handle to dialog box -// wParam - [in] Handle to control to receive the default keyboard focus -// lParam - [in] Specifies additional message-specific information -// -// Return values: -// TRUE to direct the system to set the keyboard focus to the control -// specified by wParam. Otherwise, it should return FALSE to prevent the -// system from setting the default keyboard focus. -// ---------------------------------------------------------------------------- -BOOL CSwapPropPage::OnInitDialog -( - HWND hwndDlg, - WPARAM wParam, - LPARAM lParam -) -{ - UNREFERENCED_PARAMETER(wParam); - UNREFERENCED_PARAMETER(lParam); - - HRESULT hr = S_OK; - LPWSTR pwstrEndpointName = NULL; - - // Retrieve the endpoint's friendly name, system effects, and swap SFX and MFX states - hr = GetDeviceFriendlyName(&pwstrEndpointName); - IF_FAILED_JUMP(hr, Exit); - - hr = RetrieveSysFXState(&m_fDisableSysFX); - IF_FAILED_JUMP(hr, Exit); - - hr = RetrieveSwapSFXState(&m_fEnableSwapSFX); - IF_FAILED_JUMP(hr, Exit); - - hr = RetrieveSwapMFXState(&m_fEnableSwapMFX); - IF_FAILED_JUMP(hr, Exit); - - hr = RetrieveDelaySFXState(&m_fEnableDelaySFX); - IF_FAILED_JUMP(hr, Exit); - - hr = RetrieveDelayMFXState(&m_fEnableDelayMFX); - IF_FAILED_JUMP(hr, Exit); - - // Update the property page with retrieved information - SetWindowText(GetDlgItem(hwndDlg, IDC_SPP_ENDPOINT_NAME), pwstrEndpointName); - - // Based on the retrieved states, toggle the checkboxes to reflect them - if (m_fDisableSysFX) - { - CheckDlgButton(hwndDlg, IDC_DISABLE_SYSFX, BST_CHECKED); - - // Disable APO toggling controls on the page - EnableWindow(GetDlgItem(hwndDlg, IDC_ENABLE_SWAP_SFX), FALSE); - EnableWindow(GetDlgItem(hwndDlg, IDC_ENABLE_SWAP_MFX), FALSE); - EnableWindow(GetDlgItem(hwndDlg, IDC_ENABLE_DELAY_SFX), FALSE); - EnableWindow(GetDlgItem(hwndDlg, IDC_ENABLE_DELAY_MFX), FALSE); - } - else - { - CheckDlgButton(hwndDlg, IDC_DISABLE_SYSFX, BST_UNCHECKED); - - // Enable APO toggling controls on the page - EnableWindow(GetDlgItem(hwndDlg, IDC_ENABLE_SWAP_SFX), TRUE); - EnableWindow(GetDlgItem(hwndDlg, IDC_ENABLE_SWAP_MFX), TRUE); - EnableWindow(GetDlgItem(hwndDlg, IDC_ENABLE_DELAY_SFX), TRUE); - EnableWindow(GetDlgItem(hwndDlg, IDC_ENABLE_DELAY_MFX), TRUE); - } - - if (m_fEnableSwapSFX) - { - CheckDlgButton(hwndDlg, IDC_ENABLE_SWAP_SFX, BST_CHECKED); - } - else - { - CheckDlgButton(hwndDlg, IDC_ENABLE_SWAP_SFX, BST_UNCHECKED); - } - - if (m_fEnableSwapMFX) - { - CheckDlgButton(hwndDlg, IDC_ENABLE_SWAP_MFX, BST_CHECKED); - } - else - { - CheckDlgButton(hwndDlg, IDC_ENABLE_SWAP_MFX, BST_UNCHECKED); - } - - if (m_fEnableDelaySFX) - { - CheckDlgButton(hwndDlg, IDC_ENABLE_DELAY_SFX, BST_CHECKED); - } - else - { - CheckDlgButton(hwndDlg, IDC_ENABLE_DELAY_SFX, BST_UNCHECKED); - } - - if (m_fEnableDelayMFX) - { - CheckDlgButton(hwndDlg, IDC_ENABLE_DELAY_MFX, BST_CHECKED); - } - else - { - CheckDlgButton(hwndDlg, IDC_ENABLE_DELAY_MFX, BST_UNCHECKED); - } - -Exit: - SAFE_COTASKMEMFREE(pwstrEndpointName); - return(FALSE); -} - - -// ---------------------------------------------------------------------------- -// Function: -// CSwapPropPage::OnApply -// -// Description: -// Handle the pressing of the apply button -// -// Parameters: -// hwndDlg - [in] Handle to the dialog box -// -// Return values: -// TRUE to set keyboard focus on control -// ---------------------------------------------------------------------------- -BOOL CSwapPropPage::OnApply -( - HWND hwndDlg -) -{ - HRESULT hr = S_OK; - - // Commit the settings - hr = SetSysFXState(); - IF_FAILED_JUMP(hr, Exit); - - hr = SetSwapSFXState(); - IF_FAILED_JUMP(hr, Exit); - - hr = SetSwapMFXState(); - IF_FAILED_JUMP(hr, Exit); - - hr = SetDelaySFXState(); - IF_FAILED_JUMP(hr, Exit); - - hr = SetDelayMFXState(); - IF_FAILED_JUMP(hr, Exit); - - if (NULL != m_pAudioFXExtParams && NULL != m_pAudioFXExtParams->pFxProperties) - { - hr = m_pAudioFXExtParams->pFxProperties->Commit(); - IF_FAILED_JUMP(hr, Exit); - - if (m_fReset) - { - // something changed that forces us to reset the format support - CComPtr<IMMDeviceEnumerator> spEnumerator; - CComPtr<IMMDevice> spMMDevice; - - // Create device enumerator and get IMMDevice from the device ID - hr = spEnumerator.CoCreateInstance(__uuidof(MMDeviceEnumerator)); - IF_FAILED_JUMP(hr, Exit); - - hr = spEnumerator->GetDevice(m_pAudioFXExtParams->pwstrEndpointID, &spMMDevice); - IF_FAILED_JUMP(hr, Exit); - - CComPtr<IAudioEndpointFormatControl> spEndpointFormat; - hr = spMMDevice->Activate(__uuidof(IAudioEndpointFormatControl), CLSCTX_ALL, NULL, (void **)&spEndpointFormat); - IF_FAILED_JUMP(hr, Exit); - - spEndpointFormat->ResetToDefault(ENDPOINT_FORMAT_RESET_MIX_ONLY); - m_fReset = FALSE; - } - } - -Exit: - if (SUCCEEDED(hr)) - { - SetWindowLongPtr(hwndDlg, DWLP_MSGRESULT, PSNRET_NOERROR); - } - else - { - SetWindowLongPtr(hwndDlg, DWLP_MSGRESULT, PSNRET_INVALID); - } - - return(TRUE); -} - - -// ---------------------------------------------------------------------------- -// Function: -// CSwapPropPage::OnCheckBoxClickedDisableSysFX -// -// Description: -// Handle the clicking of the Disable System Effects check box -// -// Parameters: -// hwndDlg - [in] Handle to the dialog box -// -// Return values: -// FALSE to not set default keyboard focus -// ---------------------------------------------------------------------------- -BOOL CSwapPropPage::OnCheckBoxClickedDisableSysFX -( - HWND hwndDlg -) -{ - // Check the state of the check box and update associated data member - if (BST_CHECKED == IsDlgButtonChecked(hwndDlg, IDC_DISABLE_SYSFX)) - { - m_fDisableSysFX = TRUE; - - // Disable APO toggling controls on the page - EnableWindow(GetDlgItem(hwndDlg, IDC_ENABLE_SWAP_SFX), FALSE); - EnableWindow(GetDlgItem(hwndDlg, IDC_ENABLE_SWAP_MFX), FALSE); - EnableWindow(GetDlgItem(hwndDlg, IDC_ENABLE_DELAY_SFX), FALSE); - EnableWindow(GetDlgItem(hwndDlg, IDC_ENABLE_DELAY_MFX), FALSE); - } - else - { - m_fDisableSysFX = FALSE; - - // Enable APO toggling controls on the page - EnableWindow(GetDlgItem(hwndDlg, IDC_ENABLE_SWAP_SFX), TRUE); - EnableWindow(GetDlgItem(hwndDlg, IDC_ENABLE_SWAP_MFX), TRUE); - EnableWindow(GetDlgItem(hwndDlg, IDC_ENABLE_DELAY_SFX), TRUE); - EnableWindow(GetDlgItem(hwndDlg, IDC_ENABLE_DELAY_MFX), TRUE); - } - - // If the user changes the check box, enable the Apply button - SendMessage(GetParent(hwndDlg), PSM_CHANGED, (WPARAM)hwndDlg, 0); - - return(FALSE); -} - - -// ---------------------------------------------------------------------------- -// Function: -// CSwapPropPage::OnCheckBoxClickedEnableSwapSFX -// -// Description: -// Handle the clicking of the Enable Channel Swap SFX check box -// -// Parameters: -// hwndDlg - [in] Handle to the dialog box -// -// Return values: -// FALSE to not set default keyboard focus -// ---------------------------------------------------------------------------- -BOOL CSwapPropPage::OnCheckBoxClickedEnableSwapSFX -( - HWND hwndDlg -) -{ - // Check the state of the check box and update associated data member - if (BST_CHECKED == IsDlgButtonChecked(hwndDlg, IDC_ENABLE_SWAP_SFX)) - { - m_fEnableSwapSFX = TRUE; - } - else - { - m_fEnableSwapSFX = FALSE; - } - - // If the user changes the check box, enable the Apply button - SendMessage(GetParent(hwndDlg), PSM_CHANGED, (WPARAM)hwndDlg, 0); - - return(FALSE); -} - - -// ---------------------------------------------------------------------------- -// Function: -// CSwapPropPage::OnCheckBoxClickedEnableSwapMFX -// -// Description: -// Handle the clicking of the Enable Channel Swap MFX check box -// -// Parameters: -// hwndDlg - [in] Handle to the dialog box -// -// Return values: -// FALSE to not set default keyboard focus -// ---------------------------------------------------------------------------- -BOOL CSwapPropPage::OnCheckBoxClickedEnableSwapMFX -( - HWND hwndDlg -) -{ - // Check the state of the check box and update associated data member - if (BST_CHECKED == IsDlgButtonChecked(hwndDlg, IDC_ENABLE_SWAP_MFX)) - { - m_fEnableSwapMFX = TRUE; - } - else - { - m_fEnableSwapMFX = FALSE; - } - - // If the user changes the check box, enable the Apply button - SendMessage(GetParent(hwndDlg), PSM_CHANGED, (WPARAM)hwndDlg, 0); - - return(FALSE); -} - - -// ---------------------------------------------------------------------------- -// Function: -// CSwapPropPage::OnCheckBoxClickedEnableDelaySFX -// -// Description: -// Handle the clicking of the Enable Delay SFX check box -// -// Parameters: -// hwndDlg - [in] Handle to the dialog box -// -// Return values: -// FALSE to not set default keyboard focus -// ---------------------------------------------------------------------------- -BOOL CSwapPropPage::OnCheckBoxClickedEnableDelaySFX -( - HWND hwndDlg -) -{ - // Check the state of the check box and update associated data member - if (BST_CHECKED == IsDlgButtonChecked(hwndDlg, IDC_ENABLE_DELAY_SFX)) - { - m_fEnableDelaySFX = TRUE; - } - else - { - m_fEnableDelaySFX = FALSE; - } - - // If the user changes the check box, enable the Apply button - SendMessage(GetParent(hwndDlg), PSM_CHANGED, (WPARAM)hwndDlg, 0); - - return(FALSE); -} - - -// ---------------------------------------------------------------------------- -// Function: -// CSwapPropPage::OnCheckBoxClickedEnableDelayMFX -// -// Description: -// Handle the clicking of the Enable Delay MFX check box -// -// Parameters: -// hwndDlg - [in] Handle to the dialog box -// -// Return values: -// FALSE to not set default keyboard focus -// ---------------------------------------------------------------------------- -BOOL CSwapPropPage::OnCheckBoxClickedEnableDelayMFX -( - HWND hwndDlg -) -{ - // Check the state of the check box and update associated data member - if (BST_CHECKED == IsDlgButtonChecked(hwndDlg, IDC_ENABLE_DELAY_MFX)) - { - m_fEnableDelayMFX = TRUE; - } - else - { - m_fEnableDelayMFX = FALSE; - } - - // If the user changes the check box, enable the Apply button - SendMessage(GetParent(hwndDlg), PSM_CHANGED, (WPARAM)hwndDlg, 0); - - return(FALSE); -} - - -// ---------------------------------------------------------------------------- -// Function: -// CSwapPropPage::DialogProcPage1 -// -// Description: -// Callback for property page -// -// Parameters: -// hwndDlg - [in] Handle to the dialog box -// uMsg - [in] Specifies the message -// wParam - [in] Specifies additional message-specific information -// lParam - [in] Specifies additional message-specific information -// -// Return values: -// TRUE if it processed the message, FALSE if not -// ---------------------------------------------------------------------------- -INT_PTR CALLBACK CSwapPropPage::DialogProcPage1 -( - HWND hwndDlg, - UINT uMsg, - WPARAM wParam, - LPARAM lParam -) -{ - CSwapPropPage* pthis = (CSwapPropPage*)(LONG_PTR)GetWindowLongPtr( - hwndDlg, GWLP_USERDATA); - BOOL fRet = FALSE; - - switch (uMsg) - { - case WM_INITDIALOG: - { - // Extract the context data from PROPSHEETPAGE::lParam - PROPSHEETPAGE* pSheetDesc = (PROPSHEETPAGE*)lParam; - - // Create the property page factory class -#pragma warning(push) -#pragma warning(disable: 28197) - pthis = new CComObject<CSwapPropPage>(); -#pragma warning(pop) - if (pthis == NULL) - { - return(FALSE); - } - - // Save this object in lParam - SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)pthis); - - // Keep audio FX extension parameters passed by the control panel - pthis->m_pAudioFXExtParams = (AudioFXExtensionParams*)pSheetDesc->lParam; - - fRet = pthis->OnInitDialog(hwndDlg, wParam, lParam); - break; - } - - case WM_NOTIFY: - { - switch (((NMHDR FAR*)lParam)->code) - { - case PSN_APPLY: - if (pthis) - { - // Apply button pressed - fRet = pthis->OnApply(hwndDlg); - } - break; - } - break; - } - - case WM_COMMAND: - { - switch (LOWORD(wParam)) - { - // Handle the clicking of the check boxes - case IDC_DISABLE_SYSFX: - if (pthis) - { - fRet = pthis->OnCheckBoxClickedDisableSysFX(hwndDlg); - } - break; - - case IDC_ENABLE_SWAP_SFX: - if (pthis) - { - fRet = pthis->OnCheckBoxClickedEnableSwapSFX(hwndDlg); - } - break; - - case IDC_ENABLE_SWAP_MFX: - if (pthis) - { - fRet = pthis->OnCheckBoxClickedEnableSwapMFX(hwndDlg); - } - break; - - case IDC_ENABLE_DELAY_SFX: - if (pthis) - { - fRet = pthis->OnCheckBoxClickedEnableDelaySFX(hwndDlg); - } - break; - - case IDC_ENABLE_DELAY_MFX: - if (pthis) - { - fRet = pthis->OnCheckBoxClickedEnableDelayMFX(hwndDlg); - } - break; - } - break; - } - - case WM_DESTROY: - { - SAFE_DELETE(pthis); - SetWindowLongPtr(hwndDlg, GWLP_USERDATA, NULL); - fRet = TRUE; - break; - } - } - - return(fRet); -} - - -// ---------------------------------------------------------------------------- -// Function: -// CSwapPropPage::PropSheetPageProc -// -// Description: -// Callback that gets invoked right after page creation or right before -// before page destruction -// -// Parameters: -// hwnd - Reserved; must be NULL -// uMsg - [in] Action flag. PSPCB_ADDREF, PSPCB_CREATE, or PSPCB_RELEASE -// ppsp - [in, out] Pointer to a PROPSHEETPAGE structure that defines -// the page being created or destroyed. -// -// Return values: -// Depends on the value of the uMsg parameter -// ---------------------------------------------------------------------------- -UINT CALLBACK CSwapPropPage::PropSheetPageProc -( - HWND hwnd, - UINT uMsg, - LPPROPSHEETPAGE ppsp -) -{ - UNREFERENCED_PARAMETER(hwnd); - UNREFERENCED_PARAMETER(uMsg); - UNREFERENCED_PARAMETER(ppsp); - - // if (uMsg == PSPCB_CREATE) ... - return(1); -} - - -// ---------------------------------------------------------------------------- -// Function: -// CSwapPropPage::Initialize -// -// Description: -// Implementation of IShellExtInit::Initialize. Initializes a property -// sheet extension, shortcut menu extension, or drag-and-drop handler. -// -// Parameters: -// pidlFolder - [in] Address of an ITEMIDLIST structure that uniquely -// identifies a folder. For property sheet extensions, -// this parameter is NULL. -// pdtobj - [out] Address of an IDataObject interface object that can be -// used to retrieve the objects being acted upon. -// hkeyProgID - [in] Registry key for the file object or folder type. -// -// Return values: -// Returns NOERROR if successful, or an OLE-defined error value otherwise -// ---------------------------------------------------------------------------- -_Use_decl_annotations_ -HRESULT CSwapPropPage::Initialize -( - LPCITEMIDLIST pidlFolder, - IDataObject* pdtobj, - HKEY hkeyProgID -) -{ - UNREFERENCED_PARAMETER(pidlFolder); - UNREFERENCED_PARAMETER(pdtobj); - UNREFERENCED_PARAMETER(hkeyProgID); - - return(S_OK); -} - - -// ---------------------------------------------------------------------------- -// Function: -// CSwapPropPage::AddPages -// -// Description: -// Implementation of IShellPropSheetExt::AddPages. Adds one or more pages -// to a property sheet that the Shell displays for a file object. -// -// Parameters: -// lpfnAddPage - [in] Address of a function that the property sheet -// handler calls to add a page to the property sheet. The -// function takes a property sheet handle returned by the -// CreatePropertySheetPage function and the lParam parameter -// passed to the AddPages method. -// lParam - [in] Parameter to pass to the function specified by the -// lpfnAddPage method. -// -// Return values: -// Returns S_OK if successful. If the method fails, an OLE-defined error -// code is returned -// ---------------------------------------------------------------------------- -_Use_decl_annotations_ -HRESULT STDMETHODCALLTYPE CSwapPropPage::AddPages -( - LPFNADDPROPSHEETPAGE lpfnAddPage, // See PrSht.h - LPARAM lParam // Used by caller, don't modify -) -{ - HRESULT hr = S_OK; - PROPSHEETPAGE psp; - HPROPSHEETPAGE hPage1 = NULL; - AudioFXExtensionParams* pAudioFXParams = (AudioFXExtensionParams*)lParam; -#pragma warning(push) -#pragma warning(disable: 28197) - AudioFXExtensionParams* pAudioFXParamsCopy = new AudioFXExtensionParams; -#pragma warning(pop) - - if (pAudioFXParamsCopy == NULL) - { - return E_OUTOFMEMORY; - } - - // Make a copy of the params - CopyMemory(pAudioFXParamsCopy, pAudioFXParams, sizeof(AudioFXExtensionParams)); - SAFE_ADDREF(pAudioFXParamsCopy->pFxProperties); - - // Initialize property page params and create page - psp.dwSize = sizeof(psp); - psp.dwFlags = PSP_USEREFPARENT | PSP_USECALLBACK; - psp.hInstance = _AtlBaseModule.GetModuleInstance(); - psp.hIcon = 0; - psp.pcRefParent = (UINT*)&m_dwRef; - psp.lParam = (LPARAM)pAudioFXParamsCopy; - psp.pszTemplate = MAKEINTRESOURCE(IDD_SWAP_PROP_PAGE); - psp.pfnDlgProc = (DLGPROC)DialogProcPage1; - psp.pfnCallback = PropSheetPageProc; - - // Create the property sheet page and add the page - hPage1 = CreatePropertySheetPage(&psp); - if (hPage1) - { - if (!lpfnAddPage(hPage1, pAudioFXParams->AddPageParam)) - { - hr = E_FAIL; - delete pAudioFXParamsCopy; - DestroyPropertySheetPage(hPage1); - } - else - { - // Add ref for page - this->AddRef(); - } - } - else - { - delete pAudioFXParamsCopy; - hr = E_OUTOFMEMORY; - } - - return(hr); -} - - -// ---------------------------------------------------------------------------- -// Function: -// CSwapPropPage::ReplacePage -// -// Description: -// Implementation of IShellPropSheetExt::ReplacePage. Replaces a page in -// a property sheet for a Control Panel object. -// -// Parameters: -// uPageID - [in] Identifier of the page to replace -// lpfnReplacePage - [in] Address of a function that the property sheet -// handler calls to replace a page to the property -// sheet. The function takes a property sheet handle -// returned by the CreatePropertySheetPage function and -// the lParam parameter passed to the ReplacePage -// method. -// lParam - [in] Parameter to pass to the function specified by the -// lpfnReplacePage parameter. -// -// Return values: -// Returns NOERROR if successful, or an OLE-defined error value otherwise -// ---------------------------------------------------------------------------- -_Use_decl_annotations_ -HRESULT STDMETHODCALLTYPE CSwapPropPage::ReplacePage -( - UINT uPageID, - LPFNSVADDPROPSHEETPAGE lpfnReplaceWith, - LPARAM lParam -) -{ - UNREFERENCED_PARAMETER(uPageID); - UNREFERENCED_PARAMETER(lpfnReplaceWith); - UNREFERENCED_PARAMETER(lParam); - - return(S_FALSE); -} diff --git a/audio/sysvad/SwapAPO/PropPageExtensions/SwapPropPage.h b/audio/sysvad/SwapAPO/PropPageExtensions/SwapPropPage.h deleted file mode 100644 index 295e29bc..00000000 --- a/audio/sysvad/SwapAPO/PropPageExtensions/SwapPropPage.h +++ /dev/null @@ -1,92 +0,0 @@ -//**@@@*@@@**************************************************** -// -// Microsoft Windows -// Copyright (C) Microsoft Corporation. All rights reserved. -// -//**@@@*@@@**************************************************** - -// -// FileName: SwapPropPage.h -// -// Abstract: Declaration of the CSwapPropPage class -// -// ---------------------------------------------------------------------------- - - -#pragma once - -// ---------------------------------------------------------------------- -// CSwapPropPage class -// -class ATL_NO_VTABLE CSwapPropPage : - public CComObjectRootEx<CComSingleThreadModel>, - public CComCoClass<CSwapPropPage, &CLSID_SwapPropPage>, - public IDispatchImpl<ISwapPropPage, &__uuidof(ISwapPropPage), &LIBID_CplExtLib, /*wMajor =*/ 1, /*wMinor =*/ 0>, - public IShellExtInit, - public IShellPropSheetExt -{ -public: - CSwapPropPage(); - ~CSwapPropPage(); - - DECLARE_REGISTRY_RESOURCEID(IDR_SWAP_PROP_PAGE) - - BEGIN_COM_MAP(CSwapPropPage) - COM_INTERFACE_ENTRY(ISwapPropPage) - COM_INTERFACE_ENTRY(IDispatch) - COM_INTERFACE_ENTRY(IShellExtInit) - COM_INTERFACE_ENTRY(IShellPropSheetExt) - END_COM_MAP() - - DECLARE_PROTECT_FINAL_CONSTRUCT() - - HRESULT FinalConstruct() - { - return S_OK; - } - - void FinalRelease() - { - } - - static INT_PTR CALLBACK DialogProcPage1(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); - static UINT CALLBACK PropSheetPageProc(HWND hwnd, UINT uMsg, LPPROPSHEETPAGE ppsp); - - // IShellExtInit - STDMETHOD(Initialize)(_In_opt_ LPCITEMIDLIST pidlFolder, _In_opt_ IDataObject* pdtobj, _In_opt_ HKEY hkeyProgID); - - // IShellPropSheetExt - STDMETHOD(AddPages)(_In_ LPFNADDPROPSHEETPAGE lpfnAddPage, _In_ LPARAM lParam); - STDMETHOD(ReplacePage)(_In_ UINT uPageID, _In_ LPFNSVADDPROPSHEETPAGE lpfnReplaceWith, _In_ LPARAM lParam); - -private: - AudioFXExtensionParams* m_pAudioFXExtParams; - BOOL m_fDisableSysFX; - BOOL m_fEnableSwapSFX; - BOOL m_fEnableSwapMFX; - BOOL m_fEnableDelaySFX; - BOOL m_fEnableDelayMFX; - BOOL m_fReset; - - HRESULT GetDeviceFriendlyName(_Outptr_result_maybenull_ LPWSTR* ppNameOut); - HRESULT RetrieveSysFXState(BOOL *pfDisabled); - HRESULT SetSysFXState(); - HRESULT RetrieveSwapSFXState(BOOL *pfEnabled); - HRESULT SetSwapSFXState(); - HRESULT RetrieveSwapMFXState(BOOL *pfEnabled); - HRESULT SetSwapMFXState(); - HRESULT RetrieveDelaySFXState(BOOL *pfEnabled); - HRESULT SetDelaySFXState(); - HRESULT RetrieveDelayMFXState(BOOL *pfEnabled); - HRESULT SetDelayMFXState(); - - BOOL OnInitDialog(HWND hwndDlg, WPARAM wParam, LPARAM lParam); - BOOL OnApply(HWND hwndDlg); - BOOL OnCheckBoxClickedDisableSysFX(HWND hwndDlg); - BOOL OnCheckBoxClickedEnableSwapSFX(HWND hwndDlg); - BOOL OnCheckBoxClickedEnableSwapMFX(HWND hwndDlg); - BOOL OnCheckBoxClickedEnableDelaySFX(HWND hwndDlg); - BOOL OnCheckBoxClickedEnableDelayMFX(HWND hwndDlg); -}; - -OBJECT_ENTRY_AUTO(__uuidof(SwapPropPage), CSwapPropPage) diff --git a/audio/sysvad/SwapAPO/PropPageExtensions/SwapPropPage.rgs b/audio/sysvad/SwapAPO/PropPageExtensions/SwapPropPage.rgs deleted file mode 100644 index 6ede57a1..00000000 --- a/audio/sysvad/SwapAPO/PropPageExtensions/SwapPropPage.rgs +++ /dev/null @@ -1,27 +0,0 @@ -HKCR -{ - CplExt.SwapPropPage.1 = s 'SwapPropPage Class' - { - CLSID = s '{19166F23-5F08-47F9-BB57-9F57A977D88E}' - } - CplExt.SwapPropPage = s 'SwapPropPage Class' - { - CLSID = s '{19166F23-5F08-47F9-BB57-9F57A977D88E}' - CurVer = s 'CplExt.SwapPropPage.1' - } - NoRemove CLSID - { - ForceRemove {19166F23-5F08-47F9-BB57-9F57A977D88E} = s 'SwapPropPage Class' - { - ProgID = s 'CplExt.SwapPropPage.1' - VersionIndependentProgID = s 'CplExt.SwapPropPage' - ForceRemove 'Programmable' - InprocServer32 = s '%MODULE%' - { - val ThreadingModel = s 'Apartment' - } - val AppID = s '%APPID%' - 'TypeLib' = s '{59390583-ED40-46D9-9B16-7800B9CC5CC2}' - } - } -} diff --git a/audio/sysvad/SwapAPO/PropPageExtensions/TopologyExaminers.cpp b/audio/sysvad/SwapAPO/PropPageExtensions/TopologyExaminers.cpp deleted file mode 100644 index b224f4c1..00000000 --- a/audio/sysvad/SwapAPO/PropPageExtensions/TopologyExaminers.cpp +++ /dev/null @@ -1,162 +0,0 @@ -//**@@@*@@@**************************************************** -// -// Microsoft Windows -// Copyright (C) Microsoft Corporation. All rights reserved. -// -//**@@@*@@@**************************************************** - -// -// FileName: TopologyExaminers.cpp -// -// Description: -// -// -------------------------------------------------------------------------------- - - -#include "stdafx.h" -#include "DeviceTopology.h" -#include "TopologyExaminers.h" - -_Analysis_mode_(_Analysis_code_type_user_driver_) - -// ---------------------------------------------------------------------------- -// Function: -// CFormatExaminer::CFormatExaminer -// -// Description: -// CFormatExaminer constructor -// ---------------------------------------------------------------------------- -CFormatExaminer::CFormatExaminer -( - PKSDATAFORMAT pKsFormat, - ULONG cbFormat -) -: m_bSatisfied(FALSE), - m_pFormatReq(NULL) -{ - ATLASSERT(pKsFormat); - ATLASSERT(cbFormat >= sizeof(KSDATAFORMAT)); - - // If any of this fails, then Examine will fail - if (cbFormat >= sizeof(KSDATAFORMAT)) - { - m_pFormatReq = (PKSDATAFORMAT)(new BYTE[cbFormat]); - CopyMemory(m_pFormatReq, pKsFormat, cbFormat); - if (cbFormat < m_pFormatReq->FormatSize) - m_pFormatReq->FormatSize = cbFormat; - } -} - - -// ---------------------------------------------------------------------------- -// Function: -// CFormatExaminer::~CFormatExaminer -// -// Description: -// CFormatExaminer destructor -// ---------------------------------------------------------------------------- -CFormatExaminer::~CFormatExaminer() -{ - SAFE_DELETE_ARRAY(m_pFormatReq); -} - - -// ---------------------------------------------------------------------- -// Function: -// CFormatExaminer::Examine -// -// Description: -// Implementation of IExaminer::Examine. This method checks the supplied -// path an IConnector that support the KS streaming format (KSDATAFORMAT) -// that this examiner was set up to look for. -// -// Parameters: -// pPath - [in] List of parts to examine -// -// Remarks: -// This examiner only cares about the first part in the list, which is -// always a connector or an endpoint. Therefore it only needs to make -// sure that there is a zeroth element in the list and examine that. -// -// Return values: -// S_OK if successful -// ---------------------------------------------------------------------- -HRESULT CFormatExaminer::Examine -( - IPartsList* pPath -) -{ - ATLASSERT(pPath != NULL); - - HRESULT hr = S_OK; - UINT cParts; - CComPtr<IPart> spPart; - - // Make sure there is at least 1 part - hr = pPath->GetCount(&cParts); - IF_FAILED_JUMP(hr, Exit); - - IF_TRUE_ACTION_JUMP((cParts == 0), hr = E_NOTFOUND, Exit); - - // This examiner only cares about Connectors so don't bother walking the - // path, just look at the last in the list, which should be a connector. - hr = pPath->GetPart(0, &spPart); - IF_FAILED_JUMP(hr, Exit); - - hr = ExaminePart(spPart); - -Exit: - return hr; -} - - -// ---------------------------------------------------------------------- -// Function: -// CFormatExaminer::ExaminePart -// -// Description: -// Tests a single IPart against the examination criteria, namely be a -// connector that supports whatever KS Streaming format (KSDATAFORMAT) -// this examiner was set up to look for -// -// Parameters: -// pIPart - [in] Part to examine -// -// Remarks: -// 1) Make sure the connector is of type Software_IO -// 2) Activate IKsFormatSupport on the connector -// 3) Call IKsFormatSupport::IsFormatSupported(m_pFormatReq). -// -// ---------------------------------------------------------------------- -HRESULT CFormatExaminer::ExaminePart -( - IPart* pIPart -) -{ - ATLASSERT(pIPart); - - HRESULT hr = S_OK; - - // 1) Check category and make sure it is a software_IO pin - ConnectorType conType; - CComPtr<IConnector> spConnector; - CComPtr<IKsFormatSupport> spFormatSupport; - - hr = pIPart->QueryInterface(__uuidof(IConnector), (void**)&spConnector); - IF_FAILED_JUMP(hr, Exit); - - hr = spConnector->GetType(&conType); - IF_FAILED_JUMP(hr, Exit); - - IF_TRUE_ACTION_JUMP((conType != Software_IO), hr = E_NOTFOUND, Exit); - - // 2) Activate IKsFormatSupport interface - hr = pIPart->Activate(CLSCTX_INPROC_SERVER, __uuidof(IKsFormatSupport), (void**)&spFormatSupport); - IF_FAILED_JUMP(hr, Exit); - - // 3) Ask the interface if this format is supported - hr = spFormatSupport->IsFormatSupported(m_pFormatReq, m_pFormatReq->FormatSize, &m_bSatisfied); - -Exit: - return hr; -} diff --git a/audio/sysvad/SwapAPO/PropPageExtensions/TopologyExaminers.h b/audio/sysvad/SwapAPO/PropPageExtensions/TopologyExaminers.h deleted file mode 100644 index eafd52f0..00000000 --- a/audio/sysvad/SwapAPO/PropPageExtensions/TopologyExaminers.h +++ /dev/null @@ -1,50 +0,0 @@ -//**@@@*@@@**************************************************** -// -// Microsoft Windows -// Copyright (C) Microsoft Corporation. All rights reserved. -// -//**@@@*@@@**************************************************** - -// -// FileName: TopologyExaminers.h -// -// Abstract: An interface and supporting class(es) for examining device -// model IParts -// -// ---------------------------------------------------------------------------- - -#pragma once - - -// ---------------------------------------------------------------------- -// interface IExaminer -// An interface for examining devicemodel IParts -// ---------------------------------------------------------------------- -interface IExaminer -{ -public: - virtual HRESULT Examine(IPartsList* pPath) = 0; - virtual BOOL IsSatisfied() = 0; -}; - - -// -------------------------------------------------------------------------------- -// class CFormatExaminer -// A class that examines IConnectors looking for a soft connector that supports -// a given KS streaming format (KSDATAFORMAT). -// ---------------------------------------------------------------------- -class CFormatExaminer : public IExaminer -{ -private: - PKSDATAFORMAT m_pFormatReq; - BOOL m_bSatisfied; - - HRESULT ExaminePart(IPart* pIPart); - -public: - CFormatExaminer(PKSDATAFORMAT pKsFormat, ULONG cbFormat); - ~CFormatExaminer(); - - HRESULT Examine(IPartsList* pPath); - BOOL IsSatisfied() { return m_bSatisfied; } -}; diff --git a/audio/sysvad/SwapAPO/PropPageExtensions/UIWidgets.cpp b/audio/sysvad/SwapAPO/PropPageExtensions/UIWidgets.cpp deleted file mode 100644 index 9dc272af..00000000 --- a/audio/sysvad/SwapAPO/PropPageExtensions/UIWidgets.cpp +++ /dev/null @@ -1,321 +0,0 @@ -//**@@@*@@@**************************************************** -// -// Microsoft Windows -// Copyright (C) Microsoft Corporation. All rights reserved. -// -//**@@@*@@@**************************************************** - -// -// FileName: UIWidgets.cpp -// -// Abstract: Implementation of CUIWidget and derived classes -// -// ---------------------------------------------------------------------------- - - -#include "stdafx.h" -#include <DeviceTopology.h> -#include "UIWidgets.h" - -_Analysis_mode_(_Analysis_code_type_user_driver_) - -// ---------------------------------------------------------------------- -// CUIWidget base class - - -// ---------------------------------------------------------------------------- -// Function: -// CUIWidget::CUIWidget -// -// Description: -// CUIWidget constructor -// ---------------------------------------------------------------------------- -CUIWidget::CUIWidget -( - IPart* pPart, - REFIID iid -) -: m_hwndParentDlg(NULL), - m_iid(iid), - m_wstrLabel(NULL), - m_bRegisteredForCallbacks(NULL) -{ - // This is done here rather than in the initializer list to avoid a prefix error - if (pPart != NULL) - { - m_spPart = pPart; - } - - m_dwProcessId = GetCurrentProcessId(); -} - - -// ---------------------------------------------------------------------------- -// Function: -// CUIWidget::~CUIWidget -// -// Description: -// CUIWidget destructor -// ---------------------------------------------------------------------------- -CUIWidget::~CUIWidget() -{ - SAFE_COTASKMEMFREE(m_wstrLabel); - - if (m_bRegisteredForCallbacks) - { - m_spPart->UnregisterControlChangeCallback(this); - } -} - - -// ---------------------------------------------------------------------------- -// Function: -// CUIWidget::Create -// -// Description: -// -- Activates the control interface on the specified part -// -- Registers for control change callbacks -// -// Parameters: -// hwndDlg - [in] Parent dialog of the widget -// rc - [in] Not used -// ctrlIdBase - [in] Not used -// -// Return values: -// S_OK if successful -// ---------------------------------------------------------------------------- -HRESULT CUIWidget::Create -( - HWND hwndDlg, - SRECT& /*rc*/, - UINT& /*ctrlIdBase*/ -) -{ - HRESULT hr; - - m_hwndParentDlg = hwndDlg; - - RPC_STATUS rpcs = UuidCreate(&m_guidEventContext); - if (rpcs != RPC_S_OK) - { - hr = HRESULT_FROM_WIN32(rpcs); - goto Exit; - } - - hr = m_spPart->Activate(CLSCTX_INPROC_SERVER, m_iid, (void**)&m_spControl); - IF_FAILED_JUMP(hr, Exit); - - hr = m_spPart->RegisterControlChangeCallback(m_iid, this); - IF_FAILED_JUMP(hr, Exit); - - m_bRegisteredForCallbacks = TRUE; - - hr = m_spPart->GetName(&m_wstrLabel); - -Exit: - return hr; -}; - - -// ---------------------------------------------------------------------- -// Function: -// CUIWidget::OnNotify -// -// Description: -// Implementation of IControlChangeNotify::OnNotify -// Called when someone calls a "Set" method on a control interface. -// -// Parameters: -// dwProcessId - [in] Process ID -// pguidEventContext - Event context guid -// -// Return: -// S_OK always -// ---------------------------------------------------------------------- -_Use_decl_annotations_ -HRESULT CUIWidget::OnNotify -( - DWORD dwProcessId, - LPCGUID pguidEventContext -) -{ - UNREFERENCED_PARAMETER(dwProcessId); - - if ((pguidEventContext == NULL) || - (*pguidEventContext != m_guidEventContext)) - { - // Delegate to derived class - HandleControlChangeNotification(); - } - - return S_OK; -} - - -// ---------------------------------------------------------------------- -// ---------------------------------------------------------------------- -// CBooleanWidget - - -// ---------------------------------------------------------------------------- -// Function: -// CBooleanWidget::CBooleanWidget -// -// Description: -// CBooleanWidget constructor -// ---------------------------------------------------------------------------- -CBooleanWidget::CBooleanWidget -( - IPart* pPart, - REFIID iid -) -: CUIWidget(pPart, iid), - m_hwndCheckbox(NULL), - m_bCurrentValue(FALSE) -{ -} - - -// ---------------------------------------------------------------------------- -// Function: -// CBooleanWidget::Create -// -// Description: -// Creates the widget which is a dialog -// -// Parameters: -// hwndDlg - [in] Parent dialog of the widget -// rc - [in] Position of the widget -// nCtrlId - [in] Child-window identifier -// -// Return values: -// S_OK if successful -// ---------------------------------------------------------------------------- -HRESULT CBooleanWidget::Create -( - HWND hwndDlg, - SRECT& rc, - UINT& nCtrlId -) -{ - HRESULT hr; - HFONT hFont; - DWORD dwStyle = WS_CHILD | WS_VISIBLE | WS_TABSTOP | BS_AUTOCHECKBOX; - - // Activate the control interface and register for callbacks - hr = CUIWidget::Create(hwndDlg, rc, nCtrlId); - IF_FAILED_JUMP(hr, Exit); - - // Create a check box - rc.w = 300; - rc.h = 20; - m_hwndCheckbox = CreateWindowEx( - 0, //WS_EX_STATICEDGE, - WC_BUTTON, - m_wstrLabel, - dwStyle, - rc.x, rc.y, // put at (x,y) - rc.w, rc.h, - m_hwndParentDlg, - (HMENU)(UINT_PTR)nCtrlId, - NULL, - 0); - IF_TRUE_ACTION_JUMP((m_hwndCheckbox == NULL), hr = HRESULT_FROM_WIN32(GetLastError()), Exit); - - // Make the new control use the same font as the dialog - hFont = Window_GetFont(hwndDlg); - Window_SetFont(m_hwndCheckbox, hFont); - - // Get the current value - hr = HandleControlChangeNotification(); - IF_FAILED_JUMP(hr, Exit); - -Exit: - return hr; -} - - -// ---------------------------------------------------------------------- -// Function: -// CBooleanWidget::HandleControlChangeNotification() -// -// Description: -// Handles widget change notifications -// -// Return: -// S_OK if successful -// ---------------------------------------------------------------------- -HRESULT CBooleanWidget::HandleControlChangeNotification() -{ - HRESULT hr = S_OK; - - ATLASSERT(m_spControl); - ATLASSERT(m_hwndCheckbox); - - // Set value on DeviceTopology control interface - if (m_iid == __uuidof(IAudioLoudness)) - { - CComQIPtr<IAudioLoudness> spLoudness = m_spControl; - hr = spLoudness->GetEnabled(&m_bCurrentValue); - } - else if (m_iid == __uuidof(IAudioAutoGainControl)) - { - CComQIPtr<IAudioAutoGainControl> spAGC = m_spControl; - hr = spAGC->GetEnabled(&m_bCurrentValue); - } - else if (m_iid == __uuidof(IDeviceSpecificProperty)) - { - CComQIPtr<IDeviceSpecificProperty> spBoolCtrl = m_spControl; - DWORD cbValue = sizeof(m_bCurrentValue); - - hr = spBoolCtrl->GetValue(&m_bCurrentValue, &cbValue); - } - - // Set the check box to reflect the current value - SendMessage(m_hwndCheckbox, BM_SETCHECK, (WPARAM)(int)(m_bCurrentValue), 0L); - - return hr; -} - - -// ---------------------------------------------------------------------------- -// Function: -// CBooleanWidget::CommitValue -// -// Description: -// Commit the value set on the control -// -// Return values: -// S_OK if successful -// ---------------------------------------------------------------------------- -HRESULT CBooleanWidget::CommitValue() -{ - HRESULT hr = S_OK; - - ATLASSERT(m_spControl); - ATLASSERT(m_hwndCheckbox); - - // Get current value from check box - m_bCurrentValue = ((int)(DWORD)SendMessage(m_hwndCheckbox, BM_GETCHECK, 0L, 0L)); - - // Set value on DeviceTopology control interface - if (m_iid == __uuidof(IAudioLoudness)) - { - CComQIPtr<IAudioLoudness> spLoudness = m_spControl; - hr = spLoudness->SetEnabled(m_bCurrentValue, GetEventContext()); - } - else if (m_iid == __uuidof(IAudioAutoGainControl)) - { - CComQIPtr<IAudioAutoGainControl> spAGC = m_spControl; - hr = spAGC->SetEnabled(m_bCurrentValue, GetEventContext()); - } - else if (m_iid == __uuidof(IDeviceSpecificProperty)) - { - CComQIPtr<IDeviceSpecificProperty> spBoolCtrl = m_spControl; - - hr = spBoolCtrl->SetValue(&m_bCurrentValue, sizeof(m_bCurrentValue), - GetEventContext()); - } - - return hr; -}; diff --git a/audio/sysvad/SwapAPO/PropPageExtensions/UIWidgets.h b/audio/sysvad/SwapAPO/PropPageExtensions/UIWidgets.h deleted file mode 100644 index 1f807bd4..00000000 --- a/audio/sysvad/SwapAPO/PropPageExtensions/UIWidgets.h +++ /dev/null @@ -1,405 +0,0 @@ -//**@@@*@@@**************************************************** -// -// Microsoft Windows -// Copyright (C) Microsoft Corporation. All rights reserved. -// -//**@@@*@@@**************************************************** - -// -// FileName: UIWidgets.h -// -// Abstract: Declaration of CUIWidget and derived classes -// -// ---------------------------------------------------------------------------- - - -#pragma once - - -// ---------------------------------------------------------------------------- -// Class: -// CUIWidget -// -// Description: -// Base class for different types of widgets -// -// ---------------------------------------------------------------------------- -class CUIWidget : public IControlChangeNotify -{ -protected: - HWND m_hwndParentDlg; - IID m_iid; - CComPtr<IPart> m_spPart; - CComPtr<IUnknown> m_spControl; - DWORD m_dwProcessId; - LPWSTR m_wstrLabel; - BOOL m_bRegisteredForCallbacks; - GUID m_guidEventContext; - -public: - CUIWidget(IPart* pPart, REFIID iid); - virtual ~CUIWidget(); - - virtual HRESULT Create(HWND hwndDlg, SRECT& rc, UINT& nCtrlIdBase); - virtual HRESULT HandleControlChangeNotification() = 0; - virtual BOOL OwnsCtrlId(int ctrlId) - { - UNREFERENCED_PARAMETER(ctrlId); - return FALSE; - } - virtual HRESULT OnClick() { return S_OK; } - virtual HRESULT OnHScroll() { return S_OK; } - virtual LPCGUID GetEventContext() { return &m_guidEventContext; } - virtual HRESULT CommitValue() { return S_OK; } - - // IControlChangeNotify - STDMETHOD(OnNotify)(_In_ DWORD dwProcessId, _In_opt_ LPCGUID pguidEventContext); - - // IUnknown (since we implement IControlChangeNotify) - HRESULT STDMETHODCALLTYPE QueryInterface(const IID& iid, void** ppUnk) - { - UNREFERENCED_PARAMETER(iid); - - *ppUnk = NULL; - return E_NOTIMPL; - } - ULONG STDMETHODCALLTYPE AddRef(void) - { return 0; } - ULONG STDMETHODCALLTYPE Release(void) - { return 0; } -}; - - -// ---------------------------------------------------------------------------- -// Class: -// CBooleanWidget -// -// Description: -// Handles IAudioLoudness, IAudioAutoGainControl and -// IGenericBooleanProperty -// -// ---------------------------------------------------------------------------- -class CBooleanWidget : public CUIWidget -{ -protected: - BOOL m_bCurrentValue; - HWND m_hwndCheckbox; - -public: - CBooleanWidget(IPart* pPart, REFIID iid); - - HRESULT Create(HWND hwndDlg, SRECT& rc, UINT& nCtrlIdBase); // virtual - - virtual HRESULT HandleControlChangeNotification(); - virtual BOOL OwnsCtrlId(int ctrlId) - { return (ctrlId == GetDlgCtrlID(m_hwndCheckbox)); } - HRESULT CommitValue(); -}; - - -// ---------------------------------------------------------------------------- -// TODO: Underlying plumbing for the LONG and ULOG types aren't implemented -// yet in audiocore. Once that's implemented and verified working, need to -// remove #if TEST stuff -// ---------------------------------------------------------------------------- - -// ---------------------------------------------------------------------------- -// Class: -// CLongWidget -// -// Description: -// Handles IDeviceSpecificProperty -// ---------------------------------------------------------------------------- -template <class _TYPE_> -class CLongWidget : public CUIWidget -{ -public: - CLongWidget(IPart* pPart); - ~CLongWidget(); - virtual HRESULT Create(HWND hwndDlg, SRECT& rc, UINT& ctrlIdBase); - virtual HRESULT HandleControlChangeNotification(); - virtual HRESULT CommitValue(); - -private: - HWND m_hwnd; - HWND m_hwndLabel; - HWND m_hwndTrackbar; - HWND m_hwndValue; - _TYPE_ m_Value; - _TYPE_ m_Min; - _TYPE_ m_Max; - LONG m_Stepping; - CComQIPtr<IDeviceSpecificProperty> m_spDevSpecControl; - - static INT_PTR CALLBACK DlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam); - void UpdateValueText(); -}; - - -// ---------------------------------------------------------------------------- -// ---------------------------------------------------------------------------- -// Implementation of CLongWidget - - -// ---------------------------------------------------------------------------- -// Function: -// CLongWidget<_TYPE_>::CLongWidget -// -// Description: -// CLongWidget<_TYPE_> constructor -// ---------------------------------------------------------------------------- -template <class _TYPE_> -CLongWidget<_TYPE_>::CLongWidget(IPart* pPart) -: CUIWidget(pPart, __uuidof(IDeviceSpecificProperty)), - m_hwndTrackbar(NULL), - m_hwndLabel(NULL), - m_Value(0), - m_Min(0), - m_Max(0), - m_Stepping(1) -{ -} - - -// ---------------------------------------------------------------------------- -// Function: -// CLongWidget<_TYPE_>::CLongWidget -// -// Description: -// CLongWidget<_TYPE_> destructor -// ---------------------------------------------------------------------------- -template <class _TYPE_> -CLongWidget<_TYPE_>::~CLongWidget() -{ - DestroyWindow(m_hwnd); -} - - -// ---------------------------------------------------------------------------- -// Function: -// CLongWidget<_TYPE_>::Create -// -// Description: -// Creates the widget which is a dialog -// -// Parameters: -// hwndDlg - [in] Parent dialog of the widget -// rc - [in] Position of the widget -// ctrlIdBase - [in] Not used -// -// Return values: -// S_OK if successful -// ---------------------------------------------------------------------------- -template <class _TYPE_> -HRESULT CLongWidget<_TYPE_>::Create -( - HWND hwndDlg, - SRECT& rc, - UINT& ctrlIdBase -) -{ - HRESULT hr = S_OK; - HFONT hFont; - RECT rcClient; - LONG lMin, lMax; - - // Activate the control interface and register for callbacks - hr = CUIWidget::Create(hwndDlg, rc, ctrlIdBase); - IF_FAILED_JUMP(hr, Exit); - - // QI for specific interface - m_spDevSpecControl = m_spControl; - - // Create dialog - m_hwnd = CreateDialogParam( g_hInstance, - MAKEINTRESOURCE(IDD_WIDGET_GEN_LONG), - hwndDlg, - CLongWidget<_TYPE_>::DlgProc, - (LPARAM)this); - - IF_TRUE_ACTION_JUMP((m_hwnd == NULL), hr = HRESULT_FROM_WIN32(GetLastError()), Exit); - - SetWindowPos(m_hwnd, NULL, rc.x, rc.y, 0, 0, SWP_NOZORDER | SWP_NOSIZE); - GetClientRect(m_hwnd, &rcClient); - rc.w = rcClient.right - rcClient.left; - rc.h = rcClient.bottom - rcClient.top; - - // Make the new controls use the same font as the dialog - hFont = Window_GetFont(hwndDlg); - - m_hwndLabel = GetDlgItem(m_hwnd, IDC_GEN_LABEL); - m_hwndTrackbar = GetDlgItem(m_hwnd, IDC_GEN_SLIDER); - m_hwndValue = GetDlgItem(m_hwnd, IDC_GEN_VALUE); - - Window_SetFont(m_hwndValue, hFont); - Window_SetFont(m_hwndLabel, hFont); - SetWindowText(m_hwndLabel, m_wstrLabel); - - // Set value text - hr = m_spDevSpecControl->Get4BRange(&lMin, &lMax, &m_Stepping); - IF_FAILED_JUMP(hr, Exit); - - m_Min = (_TYPE_)lMin; - m_Max = (_TYPE_)lMax; - - // Set trackbar range and ticks - TrackBar_SetRange(m_hwndTrackbar, 0, 100); - TrackBar_SetTickFrequency(m_hwndTrackbar, 20); // 5 ticks - - // Set trackbar position - HandleControlChangeNotification(); - - // Update the numeric representation of the trackbar - UpdateValueText(); - -Exit: - return(hr); -} - - -// ---------------------------------------------------------------------------- -// Function: -// CLongWidget<_TYPE_>::HandleControlChangeNotification -// -// Description: -// Handles widget change notifications -// -// Return values: -// S_OK if successful -// ---------------------------------------------------------------------------- -template <class _TYPE_> -HRESULT CLongWidget<_TYPE_>::HandleControlChangeNotification() -{ - ATLASSERT(m_spDevSpecControl); - ATLASSERT(m_hwndTrackbar); - - HRESULT hr = S_OK; - DWORD cbValue = sizeof(m_Value); - - // Get current value - hr = m_spDevSpecControl->GetValue(&m_Value, &cbValue); - - if (SUCCEEDED(hr)) - { - float fPos = (float)(m_Value - m_Min) / (float)(m_Max - m_Min); - - // Update trackbar position - TrackBar_SetPos(m_hwndTrackbar, (int)(fPos * 100.f)); - } - - return(hr); -} - - -// ---------------------------------------------------------------------------- -// Function: -// CLongWidget<_TYPE_>::CommitValue -// -// Description: -// Commit the value set on the control -// -// Return values: -// S_OK if successful -// ---------------------------------------------------------------------------- -template <class _TYPE_> -HRESULT CLongWidget<_TYPE_>::CommitValue() -{ - ATLASSERT(m_spDevSpecControl); - ATLASSERT(m_hwndTrackbar); - - HRESULT hr = S_OK; - float fPos; - DWORD cbValue = sizeof(m_Value); - - // Calculate new value from trackbar position - fPos = (float)TrackBar_GetPos(m_hwndTrackbar) / 100.f; - m_Value = (_TYPE_)((float)(m_Max - m_Min) * fPos) + m_Min; - - // Commit current setting of trackbar - hr = m_spDevSpecControl->SetValue(&m_Value, cbValue, GetEventContext()); - - return(hr); -}; - - -// ---------------------------------------------------------------------------- -// Function: -// CLongWidget<_TYPE_>::DlgProc -// -// Description: -// Callback for widget dialog -// -// Parameters: -// hwndDlg - [in] Handle to the widget dialog -// uMsg - [in] Specifies the message -// wParam - [in] Specifies additional message-specific information -// lParam - [in] Specifies additional message-specific information -// -// Return values: -// TRUE if it processed the message, FALSE if not -// ---------------------------------------------------------------------------- -template <class _TYPE_> -INT_PTR CALLBACK CLongWidget<_TYPE_>::DlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) -{ - UNREFERENCED_PARAMETER(wParam); - - CLongWidget<_TYPE_>* pthis = (CLongWidget<_TYPE_>*) - (LONG_PTR)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); - - BOOL fRet = FALSE; - - switch (msg) - { - case WM_INITDIALOG: - { - SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)lParam); - fRet = FALSE; // don't set focus - break; - } - - case WM_DESTROY: - { - // Don't delete. The Widget destructor is what posts the WM_DESTROY - SetWindowLongPtr(hwndDlg, GWLP_USERDATA, NULL); - fRet = TRUE; - break; - } - - case WM_HSCROLL: - - if (pthis) - { - pthis->m_Value = TrackBar_GetPos(pthis->m_hwndTrackbar); - pthis->UpdateValueText(); - - // Enable the Apply button upon user changing the control - SendMessage(GetParent(GetParent(hwndDlg)), PSM_CHANGED, (WPARAM)(GetParent(hwndDlg)), 0); - } - fRet = TRUE; - break; - } - - return(fRet); -} - - -// ---------------------------------------------------------------------------- -// Function: -// CLongWidget<_TYPE_>::UpdateValueText -// -// Description: -// Updates the numeric representation of the trackbar -// -// Return values: -// S_OK if successful -// ---------------------------------------------------------------------------- -template <class _TYPE_> -void CLongWidget<_TYPE_>::UpdateValueText() -{ - WCHAR wsz[12]; - - StringCbPrintfW(wsz, sizeof(wsz), L"0x%08x", m_Value); - - // Set new text - SetWindowText(m_hwndValue, wsz); -} diff --git a/audio/sysvad/SwapAPO/PropPageExtensions/makefile b/audio/sysvad/SwapAPO/PropPageExtensions/makefile deleted file mode 100644 index c7837f4f..00000000 --- a/audio/sysvad/SwapAPO/PropPageExtensions/makefile +++ /dev/null @@ -1,36 +0,0 @@ -############################################################################# -# -# Copyright (c) Microsoft Corporation. -# All Rights Reserved. -# -# Makefile for wdm\audio\sysfx\apo -# -############################################################################# - -## NT BUILD ENVIROMENT - -# -# DO NOT EDIT THIS FILE!!! Edit .\sources. if you want to add a new source -# file to this component. This file merely indirects to the real make file -# that is shared by all the components of NT. -# -!if defined(IA64) -!message This sample is not to be built for IA64 targets -!else - -!IF DEFINED(_NT_TARGET_VERSION) -#! IF $(_NT_TARGET_VERSION)>=0x501 -! IF $(_NT_TARGET_VERSION)>=0x600 -! INCLUDE $(NTMAKEENV)\makefile.def -! ELSE -# Only warn once per directory -! INCLUDE $(NTMAKEENV)\makefile.plt -! IF "$(BUILD_PASS)"=="PASS1" -! message BUILDMSG: Warning : Building the sample "$(MAKEDIR)" for downlevel build environments is temporarily disabled in WDK for Beta2. -! ENDIF -! ENDIF -!ELSE -! INCLUDE $(NTMAKEENV)\makefile.def -!ENDIF - -!endif
\ No newline at end of file diff --git a/audio/sysvad/SwapAPO/PropPageExtensions/music.ico b/audio/sysvad/SwapAPO/PropPageExtensions/music.ico Binary files differdeleted file mode 100644 index 3207a9dc..00000000 --- a/audio/sysvad/SwapAPO/PropPageExtensions/music.ico +++ /dev/null diff --git a/audio/sysvad/SwapAPO/PropPageExtensions/resource.h b/audio/sysvad/SwapAPO/PropPageExtensions/resource.h deleted file mode 100644 index a8d36a5a..00000000 --- a/audio/sysvad/SwapAPO/PropPageExtensions/resource.h +++ /dev/null @@ -1,34 +0,0 @@ -//{{NO_DEPENDENCIES}} -// Microsoft Visual C++ generated include file. -// Used by CplExt.rc -// -#define IDC_DISABLE_SYSFX 5000 // The "Disable System Effects" UI control must have ID 5000 -#define IDS_PROJ_NAME 100 -#define IDR_CPL_EXT 101 -#define IDR_SWAP_PROP_PAGE 102 -#define IDR_ADV_ENDPOINT_PROP_PAGE 103 -#define IDI_AUDIO_ICON 200 -#define IDD_SWAP_PROP_PAGE 201 -#define IDC_ENABLE_SWAP_SFX 203 -#define IDC_ENABLE_SWAP_MFX 204 -#define IDC_SPP_ENDPOINT_NAME 205 -#define IDD_ADV_ENDPOINT_PROP_PAGE 210 -#define IDC_NO_ADV_CONTROLS_FOUND 211 -#define IDC_EPP_ENDPOINT_NAME 212 -#define IDD_WIDGET_GEN_LONG 213 -#define IDC_GEN_LABEL 214 -#define IDC_GEN_SLIDER 215 -#define IDC_GEN_VALUE 216 -#define IDC_ENABLE_DELAY_SFX 217 -#define IDC_ENABLE_DELAY_MFX 218 - -// Next default values for new objects -// -#ifdef APSTUDIO_INVOKED -#ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NEXT_RESOURCE_VALUE 230 -#define _APS_NEXT_COMMAND_VALUE 32768 -#define _APS_NEXT_CONTROL_VALUE 225 -#define _APS_NEXT_SYMED_VALUE 104 -#endif -#endif diff --git a/audio/sysvad/SwapAPO/PropPageExtensions/sources b/audio/sysvad/SwapAPO/PropPageExtensions/sources deleted file mode 100644 index 898884b6..00000000 --- a/audio/sysvad/SwapAPO/PropPageExtensions/sources +++ /dev/null @@ -1,60 +0,0 @@ -TARGETNAME=PropPageExt -TARGETTYPE=DYNLINK - -USE_ATL=1 - -USE_NATIVE_EH=1 - - -DLLENTRY=_DllMainCRTStartup -PRECOMPILED_CXX=1 -PRECOMPILED_INCLUDE=stdafx.h -PRECOMPILED_PCH=stdafx.pch - -MSC_WARNING_LEVEL=-W4 \ - -WX - -# -# stdafx.h defines _ATL_ALL_WARNINGS -# Disabling 4127 is necessary to allow this driver to build in the WDK environment. -# -USER_C_FLAGS=/wd4127 - -C_DEFINES=-DUNICODE \ - -D_UNICODE - -# -# Indicate to the WDK that this sample only supports Win10[+] -# -MINIMUM_NT_TARGET_VERSION=$(_NT_TARGET_VERSION_WINTHRESHOLD) - -# Indicate that this DLL must be included in the driver package -DDK_NO_PACKAGE_PROJECT=0 -DDK_INCLUDE_PACKAGE_PROJECT=1 - -INCLUDES=$(INCLUDES); \ - ..\Inc; \ - $(DDK_INC_PATH); -SOURCES=CplExt.idl \ - CplExt.rc \ - CplExt.cpp \ - SwapPropPage.cpp \ - AdvEndpointPropPage.cpp \ - UIWidgets.cpp \ - TopologyExaminers.cpp \ - Parts.cpp \ - - -TARGETLIBS= \ - \ - $(SDK_LIB_PATH)\onecore_downlevel.lib \ - $(ONECORE_PRIV_SDK_LIB_PATH)\OneCore_Forwarder_user32.lib \ - $(SDK_LIB_PATH)\onecore_downlevel.lib \ - $(SDK_LIB_PATH)\oleaut32.lib \ - $(INTERNAL_SDK_LIB_PATH)\onecoreuapuuid.lib \ - $(SDK_LIB_PATH)\shlwapi.lib \ - $(SDK_LIB_PATH)\comctl32.lib \ - $(SDK_LIB_PATH)\rpcrt4.lib \ - - - diff --git a/audio/sysvad/SwapAPO/PropPageExtensions/stdafx.cpp b/audio/sysvad/SwapAPO/PropPageExtensions/stdafx.cpp deleted file mode 100644 index 26e28d90..00000000 --- a/audio/sysvad/SwapAPO/PropPageExtensions/stdafx.cpp +++ /dev/null @@ -1,18 +0,0 @@ -//**@@@*@@@**************************************************** -// -// Microsoft Windows -// Copyright (C) Microsoft Corporation. All rights reserved. -// -//**@@@*@@@**************************************************** - -// -// FileName: stdafx.cpp -// -// Abstract: Source file that includes just the standard includes -// -// ---------------------------------------------------------------------------- - - -#include "stdafx.h" - -_Analysis_mode_(_Analysis_code_type_user_driver_) diff --git a/audio/sysvad/SwapAPO/PropPageExtensions/stdafx.h b/audio/sysvad/SwapAPO/PropPageExtensions/stdafx.h deleted file mode 100644 index a116cf07..00000000 --- a/audio/sysvad/SwapAPO/PropPageExtensions/stdafx.h +++ /dev/null @@ -1,67 +0,0 @@ -//**@@@*@@@**************************************************** -// -// Microsoft Windows -// Copyright (C) Microsoft Corporation. All rights reserved. -// -//**@@@*@@@**************************************************** - -// -// FileName: stdafx.h -// -// Abstract: Include file for standard system include files, or project -// specific include files that are used frequently, but are -// changed infrequently -// -// ---------------------------------------------------------------------------- - - -#pragma once - -#ifndef STRICT -#define STRICT -#endif - -//// Modify the following defines if you have to target a platform prior to the ones specified below. -//// Refer to MSDN for the latest info on corresponding values for different platforms. -//#ifndef WINVER // Allow use of features specific to Windows 95 and Windows NT 4 or later. -//#define WINVER 0x0400 // Change this to the appropriate value to target Windows 98 and Windows 2000 or later. -//#endif -// -//#ifndef _WIN32_WINNT // Allow use of features specific to Windows NT 4 or later. -//#define _WIN32_WINNT 0x0400 // Change this to the appropriate value to target Windows 2000 or later. -//#endif -// -//#ifndef _WIN32_WINDOWS // Allow use of features specific to Windows 98 or later. -//#define _WIN32_WINDOWS 0x0410 // Change this to the appropriate value to target Windows Me or later. -//#endif -// -//#ifndef _WIN32_IE // Allow use of features specific to IE 4.0 or later. -//#define _WIN32_IE 0x0400 // Change this to the appropriate value to target IE 5.0 or later. -//#endif - -#define _ATL_APARTMENT_THREADED -#define _ATL_NO_AUTOMATIC_NAMESPACE - -#define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS // some CString constructors will be explicit - -// Turns off ATL's hiding of some common and often safely ignored warning messages -#define _ATL_ALL_WARNINGS - -#define _ATL_NO_HOSTING - -#include "resource.h" -#include <atlbase.h> -#include <atlcom.h> -#include <atlsync.h> -#include <atlwin.h> // atl windows -using namespace ATL; - -#include <strsafe.h> -#include <commonmacros.h> -#include <tlist.h> -#include <shlobj.h> -#include "CplExt.h" - -extern HINSTANCE g_hInstance; - -_Analysis_mode_(_Analysis_code_type_user_driver_) diff --git a/audio/sysvad/TabletAudioSample/ComponentizedApoSample.inf b/audio/sysvad/TabletAudioSample/ComponentizedApoSample.inf Binary files differnew file mode 100644 index 00000000..a60abe3f --- /dev/null +++ b/audio/sysvad/TabletAudioSample/ComponentizedApoSample.inf diff --git a/audio/sysvad/TabletAudioSample/ComponentizedAudioSample.inf b/audio/sysvad/TabletAudioSample/ComponentizedAudioSample.inf Binary files differnew file mode 100644 index 00000000..6e380029 --- /dev/null +++ b/audio/sysvad/TabletAudioSample/ComponentizedAudioSample.inf diff --git a/audio/sysvad/TabletAudioSample/ComponentizedAudioSampleExtension.inf b/audio/sysvad/TabletAudioSample/ComponentizedAudioSampleExtension.inf Binary files differnew file mode 100644 index 00000000..d91e44ba --- /dev/null +++ b/audio/sysvad/TabletAudioSample/ComponentizedAudioSampleExtension.inf diff --git a/audio/sysvad/TabletAudioSample/TabletAudioSample.vcxproj b/audio/sysvad/TabletAudioSample/TabletAudioSample.vcxproj index 272a3b97..8efc42cf 100644 --- a/audio/sysvad/TabletAudioSample/TabletAudioSample.vcxproj +++ b/audio/sysvad/TabletAudioSample/TabletAudioSample.vcxproj @@ -32,7 +32,7 @@ <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> <TargetVersion>Windows10</TargetVersion> <UseDebugLibraries>False</UseDebugLibraries> - <DriverTargetPlatform>Desktop</DriverTargetPlatform> + <DriverTargetPlatform>Universal</DriverTargetPlatform> <DriverType>KMDF</DriverType> <PlatformToolset>WindowsKernelModeDriver10.0</PlatformToolset> <ConfigurationType>Driver</ConfigurationType> @@ -40,7 +40,7 @@ <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> <TargetVersion>Windows10</TargetVersion> <UseDebugLibraries>True</UseDebugLibraries> - <DriverTargetPlatform>Desktop</DriverTargetPlatform> + <DriverTargetPlatform>Universal</DriverTargetPlatform> <DriverType>KMDF</DriverType> <PlatformToolset>WindowsKernelModeDriver10.0</PlatformToolset> <ConfigurationType>Driver</ConfigurationType> @@ -48,7 +48,7 @@ <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> <TargetVersion>Windows10</TargetVersion> <UseDebugLibraries>False</UseDebugLibraries> - <DriverTargetPlatform>Desktop</DriverTargetPlatform> + <DriverTargetPlatform>Universal</DriverTargetPlatform> <DriverType>KMDF</DriverType> <PlatformToolset>WindowsKernelModeDriver10.0</PlatformToolset> <ConfigurationType>Driver</ConfigurationType> @@ -56,7 +56,7 @@ <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> <TargetVersion>Windows10</TargetVersion> <UseDebugLibraries>True</UseDebugLibraries> - <DriverTargetPlatform>Desktop</DriverTargetPlatform> + <DriverTargetPlatform>Universal</DriverTargetPlatform> <DriverType>KMDF</DriverType> <PlatformToolset>WindowsKernelModeDriver10.0</PlatformToolset> <ConfigurationType>Driver</ConfigurationType> diff --git a/audio/sysvad/TabletAudioSample/tabletaudiosample.inf b/audio/sysvad/TabletAudioSample/tabletaudiosample.inf Binary files differindex c9f533af..8a0eb788 100644 --- a/audio/sysvad/TabletAudioSample/tabletaudiosample.inf +++ b/audio/sysvad/TabletAudioSample/tabletaudiosample.inf diff --git a/audio/sysvad/sysvad.sln b/audio/sysvad/sysvad.sln index d504350b..c56cef29 100644 --- a/audio/sysvad/sysvad.sln +++ b/audio/sysvad/sysvad.sln @@ -7,8 +7,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Package", "Package", "{FA56 EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "KeywordDetectorAdapter", "KeywordDetectorAdapter", "{DBD14E7B-7F95-4743-86E3-4E16FA43F990}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "PropPageExtensions", "PropPageExtensions", "{50D3DF82-019A-4434-B17F-72BBC291415F}" -EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SwapAPO", "SwapAPO", "{684FF1CF-64CC-430E-81F7-9D603EF56D59}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "APO", "APO", "{367FF255-7280-48C4-90AC-767124A8D5F7}" @@ -23,8 +21,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "package", "package\package. EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "KeywordDetectorContosoAdapter", "KeywordDetectorAdapter\KeywordDetectorContosoAdapter.vcxproj", "{E0F02048-78A4-4FE8-B863-66E6CB6A2C37}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PropPageExt", "SwapAPO\PropPageExtensions\PropPageExt.vcxproj", "{D253C552-154D-49E1-820A-B2CD9D9FF13E}" -EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SwapAPO", "SwapAPO\APO\SwapAPO.vcxproj", "{691F1D0F-CA50-46CD-8BBA-A59E9E8EB601}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DelayAPO", "SwapAPO\DelayAPO\DelayAPO.vcxproj", "{8851AB85-70B3-4798-A149-BA366DF9EC25}" |
