Advertisement
Combreal

PolicyConfig.h

Mar 8th, 2023
726
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 5.44 KB | Source Code | 0 0
  1. /* The MIT License (MIT)
  2.  
  3. Copyright (c) 2015 DefSound
  4.  
  5. Permission is hereby granted, free of charge, to any person obtaining a copy
  6. of this software and associated documentation files (the "Software"), to deal
  7. in the Software without restriction, including without limitation the rights
  8. to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  9. copies of the Software, and to permit persons to whom the Software is
  10. furnished to do so, subject to the following conditions:
  11.  
  12. The above copyright notice and this permission notice shall be included in
  13. all copies or substantial portions of the Software.
  14.  
  15. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  16. IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  17. FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  18. AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  19. LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  20. OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  21. THE SOFTWARE.
  22. */
  23. // ----------------------------------------------------------------------------
  24. // PolicyConfig.h
  25. // Undocumented COM-interface IPolicyConfig.
  26. // Use for set default audio render endpoint
  27. // @author EreTIk
  28. // ----------------------------------------------------------------------------
  29.  
  30.  
  31. #pragma once
  32. #include "mmreg.h"
  33.  
  34. interface DECLSPEC_UUID("f8679f50-850a-41cf-9c72-430f290290c8") IPolicyConfig;
  35. class DECLSPEC_UUID("870af99c-171d-4f9e-af0d-e63df40c2bc9") CPolicyConfigClient;
  36. // ----------------------------------------------------------------------------
  37. // class CPolicyConfigClient
  38. // {870af99c-171d-4f9e-af0d-e63df40c2bc9}
  39. //  
  40. // interface IPolicyConfig
  41. // {f8679f50-850a-41cf-9c72-430f290290c8}
  42. //
  43. // Query interface:
  44. // CComPtr<IPolicyConfig> PolicyConfig;
  45. // PolicyConfig.CoCreateInstance(__uuidof(CPolicyConfigClient));
  46. //
  47. // @compatible: Windows 7 and Later
  48. // ----------------------------------------------------------------------------
  49. interface IPolicyConfig : public IUnknown
  50. {
  51. public:
  52.  
  53.     virtual HRESULT GetMixFormat(
  54.         PCWSTR,
  55.         WAVEFORMATEX **
  56.     );
  57.  
  58.     virtual HRESULT STDMETHODCALLTYPE GetDeviceFormat(
  59.         PCWSTR,
  60.         INT,
  61.         WAVEFORMATEX **
  62.     );
  63.  
  64.     virtual HRESULT STDMETHODCALLTYPE ResetDeviceFormat(
  65.         PCWSTR
  66.     );
  67.  
  68.     virtual HRESULT STDMETHODCALLTYPE SetDeviceFormat(
  69.         PCWSTR,
  70.         WAVEFORMATEX *,
  71.         WAVEFORMATEX *
  72.     );
  73.  
  74.     virtual HRESULT STDMETHODCALLTYPE GetProcessingPeriod(
  75.         PCWSTR,
  76.         INT,
  77.         PINT64,
  78.         PINT64
  79.     );
  80.  
  81.     virtual HRESULT STDMETHODCALLTYPE SetProcessingPeriod(
  82.         PCWSTR,
  83.         PINT64
  84.     );
  85.  
  86.     virtual HRESULT STDMETHODCALLTYPE GetShareMode(
  87.         PCWSTR,
  88.         struct DeviceShareMode *
  89.     );
  90.  
  91.     virtual HRESULT STDMETHODCALLTYPE SetShareMode(
  92.         PCWSTR,
  93.         struct DeviceShareMode *
  94.     );
  95.  
  96.     virtual HRESULT STDMETHODCALLTYPE GetPropertyValue(
  97.         PCWSTR,
  98.         const PROPERTYKEY &,
  99.         PROPVARIANT *
  100.     );
  101.  
  102.     virtual HRESULT STDMETHODCALLTYPE SetPropertyValue(
  103.         PCWSTR,
  104.         const PROPERTYKEY &,
  105.         PROPVARIANT *
  106.     );
  107.  
  108.     virtual HRESULT STDMETHODCALLTYPE SetDefaultEndpoint(
  109.         __in PCWSTR wszDeviceId,
  110.         __in ERole eRole
  111.     );
  112.  
  113.     virtual HRESULT STDMETHODCALLTYPE SetEndpointVisibility(
  114.         PCWSTR,
  115.         INT
  116.     );
  117. };
  118.  
  119. interface DECLSPEC_UUID("568b9108-44bf-40b4-9006-86afe5b5a620") IPolicyConfigVista;
  120. class DECLSPEC_UUID("294935CE-F637-4E7C-A41B-AB255460B862") CPolicyConfigVistaClient;
  121. // ----------------------------------------------------------------------------
  122. // class CPolicyConfigVistaClient
  123. // {294935CE-F637-4E7C-A41B-AB255460B862}
  124. //  
  125. // interface IPolicyConfigVista
  126. // {568b9108-44bf-40b4-9006-86afe5b5a620}
  127. //
  128. // Query interface:
  129. // CComPtr<IPolicyConfigVista> PolicyConfig;
  130. // PolicyConfig.CoCreateInstance(__uuidof(CPolicyConfigVistaClient));
  131. //
  132. // @compatible: Windows Vista and Later
  133. // ----------------------------------------------------------------------------
  134. interface IPolicyConfigVista : public IUnknown
  135. {
  136. public:
  137.  
  138.     virtual HRESULT GetMixFormat(
  139.         PCWSTR,
  140.         WAVEFORMATEX **
  141.     );  // not available on Windows 7, use method from IPolicyConfig
  142.  
  143.     virtual HRESULT STDMETHODCALLTYPE GetDeviceFormat(
  144.         PCWSTR,
  145.         INT,
  146.         WAVEFORMATEX **
  147.     );
  148.  
  149.     virtual HRESULT STDMETHODCALLTYPE SetDeviceFormat(
  150.         PCWSTR,
  151.         WAVEFORMATEX *,
  152.         WAVEFORMATEX *
  153.     );
  154.  
  155.     virtual HRESULT STDMETHODCALLTYPE GetProcessingPeriod(
  156.         PCWSTR,
  157.         INT,
  158.         PINT64,
  159.         PINT64
  160.     );  // not available on Windows 7, use method from IPolicyConfig
  161.  
  162.     virtual HRESULT STDMETHODCALLTYPE SetProcessingPeriod(
  163.         PCWSTR,
  164.         PINT64
  165.     );  // not available on Windows 7, use method from IPolicyConfig
  166.  
  167.     virtual HRESULT STDMETHODCALLTYPE GetShareMode(
  168.         PCWSTR,
  169.         struct DeviceShareMode *
  170.     );  // not available on Windows 7, use method from IPolicyConfig
  171.  
  172.     virtual HRESULT STDMETHODCALLTYPE SetShareMode(
  173.         PCWSTR,
  174.         struct DeviceShareMode *
  175.     );  // not available on Windows 7, use method from IPolicyConfig
  176.  
  177.     virtual HRESULT STDMETHODCALLTYPE GetPropertyValue(
  178.         PCWSTR,
  179.         const PROPERTYKEY &,
  180.         PROPVARIANT *
  181.     );
  182.  
  183.     virtual HRESULT STDMETHODCALLTYPE SetPropertyValue(
  184.         PCWSTR,
  185.         const PROPERTYKEY &,
  186.         PROPVARIANT *
  187.     );
  188.  
  189.     virtual HRESULT STDMETHODCALLTYPE SetDefaultEndpoint(
  190.         __in PCWSTR wszDeviceId,
  191.         __in ERole eRole
  192.     );
  193.  
  194.     virtual HRESULT STDMETHODCALLTYPE SetEndpointVisibility(
  195.         PCWSTR,
  196.         INT
  197.     );  // not available on Windows 7, use method from IPolicyConfig
  198. };
  199.  
  200. // ----------------------------------------------------------------------------
  201.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement