1 /*** Autogenerated by WIDL 4.19 from include/mmdeviceapi.idl - Do not edit ***/ 2 3 #ifdef _WIN32 4 #ifndef __REQUIRED_RPCNDR_H_VERSION__ 5 #define __REQUIRED_RPCNDR_H_VERSION__ 475 6 #endif 7 #include <rpc.h> 8 #include <rpcndr.h> 9 #endif 10 11 #ifndef COM_NO_WINDOWS_H 12 #include <windows.h> 13 #include <ole2.h> 14 #endif 15 16 #ifndef __mmdeviceapi_h__ 17 #define __mmdeviceapi_h__ 18 19 /* Forward declarations */ 20 21 #ifndef __IMMNotificationClient_FWD_DEFINED__ 22 #define __IMMNotificationClient_FWD_DEFINED__ 23 typedef interface IMMNotificationClient IMMNotificationClient; 24 #ifdef __cplusplus 25 interface IMMNotificationClient; 26 #endif /* __cplusplus */ 27 #endif 28 29 #ifndef __IMMDevice_FWD_DEFINED__ 30 #define __IMMDevice_FWD_DEFINED__ 31 typedef interface IMMDevice IMMDevice; 32 #ifdef __cplusplus 33 interface IMMDevice; 34 #endif /* __cplusplus */ 35 #endif 36 37 #ifndef __IMMDeviceCollection_FWD_DEFINED__ 38 #define __IMMDeviceCollection_FWD_DEFINED__ 39 typedef interface IMMDeviceCollection IMMDeviceCollection; 40 #ifdef __cplusplus 41 interface IMMDeviceCollection; 42 #endif /* __cplusplus */ 43 #endif 44 45 #ifndef __IMMEndpoint_FWD_DEFINED__ 46 #define __IMMEndpoint_FWD_DEFINED__ 47 typedef interface IMMEndpoint IMMEndpoint; 48 #ifdef __cplusplus 49 interface IMMEndpoint; 50 #endif /* __cplusplus */ 51 #endif 52 53 #ifndef __IMMDeviceEnumerator_FWD_DEFINED__ 54 #define __IMMDeviceEnumerator_FWD_DEFINED__ 55 typedef interface IMMDeviceEnumerator IMMDeviceEnumerator; 56 #ifdef __cplusplus 57 interface IMMDeviceEnumerator; 58 #endif /* __cplusplus */ 59 #endif 60 61 #ifndef __IMMDeviceActivator_FWD_DEFINED__ 62 #define __IMMDeviceActivator_FWD_DEFINED__ 63 typedef interface IMMDeviceActivator IMMDeviceActivator; 64 #ifdef __cplusplus 65 interface IMMDeviceActivator; 66 #endif /* __cplusplus */ 67 #endif 68 69 #ifndef __MMDeviceEnumerator_FWD_DEFINED__ 70 #define __MMDeviceEnumerator_FWD_DEFINED__ 71 #ifdef __cplusplus 72 typedef class MMDeviceEnumerator MMDeviceEnumerator; 73 #else 74 typedef struct MMDeviceEnumerator MMDeviceEnumerator; 75 #endif /* defined __cplusplus */ 76 #endif /* defined __MMDeviceEnumerator_FWD_DEFINED__ */ 77 78 /* Headers for imported files */ 79 80 #include <unknwn.h> 81 #include <propsys.h> 82 83 #ifdef __cplusplus 84 extern "C" { 85 #endif 86 87 #ifndef E_NOTFOUND 88 #define E_NOTFOUND HRESULT_FROM_WIN32(ERROR_NOT_FOUND) 89 #endif 90 #ifndef E_UNSUPPORTED_TYPE 91 #define E_UNSUPPORTED_TYPE HRESULT_FROM_WIN32(ERROR_UNSUPPORTED_TYPE) 92 #endif 93 #define DEVICE_STATE_ACTIVE 0x1 94 #define DEVICE_STATE_DISABLED 0x2 95 #define DEVICE_STATE_NOTPRESENT 0x4 96 #define DEVICE_STATE_UNPLUGGED 0x8 97 #define DEVICE_STATEMASK_ALL 0xf 98 DEFINE_PROPERTYKEY(PKEY_AudioEndpoint_FormFactor,0x1da5d803,0xd492,0x4edd,0x8c,0x23,0xe0,0xc0,0xff,0xee,0x7f,0x0e,0); 99 DEFINE_PROPERTYKEY(PKEY_AudioEndpoint_ControlPanelPageProvider,0x1da5d803,0xd492,0x4edd,0x8c,0x23,0xe0,0xc0,0xff,0xee,0x7f,0x0e,1); 100 DEFINE_PROPERTYKEY(PKEY_AudioEndpoint_Association,0x1da5d803,0xd492,0x4edd,0x8c,0x23,0xe0,0xc0,0xff,0xee,0x7f,0x0e,2); 101 DEFINE_PROPERTYKEY(PKEY_AudioEndpoint_PhysicalSpeakers,0x1da5d803,0xd492,0x4edd,0x8c,0x23,0xe0,0xc0,0xff,0xee,0x7f,0x0e,3); 102 DEFINE_PROPERTYKEY(PKEY_AudioEndpoint_GUID,0x1da5d803,0xd492,0x4edd,0x8c,0x23,0xe0,0xc0,0xff,0xee,0x7f,0x0e,4); 103 DEFINE_PROPERTYKEY(PKEY_AudioEndpoint_Disable_SysFx,0x1da5d803,0xd492,0x4edd,0x8c,0x23,0xe0,0xc0,0xff,0xee,0x7f,0x0e,5); 104 #define ENDPOINT_SYSFX_ENABLED 0 105 #define ENDPOINT_SYSFX_DISABLED 1 106 DEFINE_PROPERTYKEY(PKEY_AudioEndpoint_FullRangeSpeakers,0x1da5d803,0xd492,0x4edd,0x8c,0x23,0xe0,0xc0,0xff,0xee,0x7f,0x0e,6); 107 DEFINE_PROPERTYKEY(PKEY_AudioEndpoint_Supports_EventDriven_Mode,0x1da5d803,0xd492,0x4edd,0x8c,0x23,0xe0,0xc0,0xff,0xee,0x7f,0x0e,7); 108 DEFINE_PROPERTYKEY(PKEY_AudioEndpoint_JackSubType,0x1da5d803,0xd492,0x4edd,0x8c,0x23,0xe0,0xc0,0xff,0xee,0x7f,0x0e,8); 109 DEFINE_PROPERTYKEY(PKEY_AudioEngine_DeviceFormat,0xf19f064d,0x082c,0x4e27,0xbc,0x73,0x68,0x82,0xa1,0xbb,0x8e,0x4c,0); 110 DEFINE_PROPERTYKEY(PKEY_AudioEngine_OEMFormat,0xe4870e26,0x3cc5,0x4cd2,0xba,0x46,0xca,0x0a,0x9a,0x70,0xed,0x04,3); 111 typedef struct tagDIRECTX_AUDIO_ACTIVATION_PARAMS { 112 DWORD cbDirectXAudioActivationParams; 113 GUID guidAudioSession; 114 DWORD dwAudioStreamFlags; 115 } DIRECTX_AUDIO_ACTIVATION_PARAMS; 116 typedef struct tagDIRECTX_AUDIO_ACTIVATION_PARAMS *PDIRECTX_AUDIO_ACTIVATION_PARAMS; 117 typedef enum _EDataFlow { 118 eRender = 0, 119 eCapture = 1, 120 eAll = 2, 121 EDataFlow_enum_count = 3 122 } EDataFlow; 123 typedef enum _ERole { 124 eConsole = 0, 125 eMultimedia = 1, 126 eCommunications = 2, 127 ERole_enum_count = 3 128 } ERole; 129 typedef enum _EndpointFormFactor { 130 RemoteNetworkDevice = 0, 131 Speakers = 1, 132 LineLevel = 2, 133 Headphones = 3, 134 Microphone = 4, 135 Headset = 5, 136 Handset = 6, 137 UnknownDigitalPassthrough = 7, 138 SPDIF = 8, 139 DigitalAudioDisplayDevice = 9, 140 UnknownFormFactor = 10, 141 EndpointFormFactor_enum_count = 11 142 } EndpointFormFactor; 143 #define HDMI DigitalAudioDisplayDevice 144 /***************************************************************************** 145 * IMMNotificationClient interface 146 */ 147 #ifndef __IMMNotificationClient_INTERFACE_DEFINED__ 148 #define __IMMNotificationClient_INTERFACE_DEFINED__ 149 150 DEFINE_GUID(IID_IMMNotificationClient, 0x7991eec9, 0x7e89, 0x4d85, 0x83,0x90, 0x6c,0x70,0x3c,0xec,0x60,0xc0); 151 #if defined(__cplusplus) && !defined(CINTERFACE) 152 MIDL_INTERFACE("7991eec9-7e89-4d85-8390-6c703cec60c0") 153 IMMNotificationClient : public IUnknown 154 { 155 virtual HRESULT STDMETHODCALLTYPE OnDeviceStateChanged( 156 LPCWSTR pwstrDeviceId, 157 DWORD dwNewState) = 0; 158 159 virtual HRESULT STDMETHODCALLTYPE OnDeviceAdded( 160 LPCWSTR pwstrDeviceId) = 0; 161 162 virtual HRESULT STDMETHODCALLTYPE OnDeviceRemoved( 163 LPCWSTR pwstrDeviceId) = 0; 164 165 virtual HRESULT STDMETHODCALLTYPE OnDefaultDeviceChanged( 166 EDataFlow flow, 167 ERole role, 168 LPCWSTR pwstrDeviceId) = 0; 169 170 virtual HRESULT STDMETHODCALLTYPE OnPropertyValueChanged( 171 LPCWSTR pwstrDeviceId, 172 const PROPERTYKEY key) = 0; 173 174 }; 175 #ifdef __CRT_UUID_DECL 176 __CRT_UUID_DECL(IMMNotificationClient, 0x7991eec9, 0x7e89, 0x4d85, 0x83,0x90, 0x6c,0x70,0x3c,0xec,0x60,0xc0) 177 #endif 178 #else 179 typedef struct IMMNotificationClientVtbl { 180 BEGIN_INTERFACE 181 182 /*** IUnknown methods ***/ 183 HRESULT (STDMETHODCALLTYPE *QueryInterface)( 184 IMMNotificationClient *This, 185 REFIID riid, 186 void **ppvObject); 187 188 ULONG (STDMETHODCALLTYPE *AddRef)( 189 IMMNotificationClient *This); 190 191 ULONG (STDMETHODCALLTYPE *Release)( 192 IMMNotificationClient *This); 193 194 /*** IMMNotificationClient methods ***/ 195 HRESULT (STDMETHODCALLTYPE *OnDeviceStateChanged)( 196 IMMNotificationClient *This, 197 LPCWSTR pwstrDeviceId, 198 DWORD dwNewState); 199 200 HRESULT (STDMETHODCALLTYPE *OnDeviceAdded)( 201 IMMNotificationClient *This, 202 LPCWSTR pwstrDeviceId); 203 204 HRESULT (STDMETHODCALLTYPE *OnDeviceRemoved)( 205 IMMNotificationClient *This, 206 LPCWSTR pwstrDeviceId); 207 208 HRESULT (STDMETHODCALLTYPE *OnDefaultDeviceChanged)( 209 IMMNotificationClient *This, 210 EDataFlow flow, 211 ERole role, 212 LPCWSTR pwstrDeviceId); 213 214 HRESULT (STDMETHODCALLTYPE *OnPropertyValueChanged)( 215 IMMNotificationClient *This, 216 LPCWSTR pwstrDeviceId, 217 const PROPERTYKEY key); 218 219 END_INTERFACE 220 } IMMNotificationClientVtbl; 221 222 interface IMMNotificationClient { 223 CONST_VTBL IMMNotificationClientVtbl* lpVtbl; 224 }; 225 226 #ifdef COBJMACROS 227 #ifndef WIDL_C_INLINE_WRAPPERS 228 /*** IUnknown methods ***/ 229 #define IMMNotificationClient_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject) 230 #define IMMNotificationClient_AddRef(This) (This)->lpVtbl->AddRef(This) 231 #define IMMNotificationClient_Release(This) (This)->lpVtbl->Release(This) 232 /*** IMMNotificationClient methods ***/ 233 #define IMMNotificationClient_OnDeviceStateChanged(This,pwstrDeviceId,dwNewState) (This)->lpVtbl->OnDeviceStateChanged(This,pwstrDeviceId,dwNewState) 234 #define IMMNotificationClient_OnDeviceAdded(This,pwstrDeviceId) (This)->lpVtbl->OnDeviceAdded(This,pwstrDeviceId) 235 #define IMMNotificationClient_OnDeviceRemoved(This,pwstrDeviceId) (This)->lpVtbl->OnDeviceRemoved(This,pwstrDeviceId) 236 #define IMMNotificationClient_OnDefaultDeviceChanged(This,flow,role,pwstrDeviceId) (This)->lpVtbl->OnDefaultDeviceChanged(This,flow,role,pwstrDeviceId) 237 #define IMMNotificationClient_OnPropertyValueChanged(This,pwstrDeviceId,key) (This)->lpVtbl->OnPropertyValueChanged(This,pwstrDeviceId,key) 238 #else 239 /*** IUnknown methods ***/ 240 static FORCEINLINE HRESULT IMMNotificationClient_QueryInterface(IMMNotificationClient* This,REFIID riid,void **ppvObject) { 241 return This->lpVtbl->QueryInterface(This,riid,ppvObject); 242 } 243 static FORCEINLINE ULONG IMMNotificationClient_AddRef(IMMNotificationClient* This) { 244 return This->lpVtbl->AddRef(This); 245 } 246 static FORCEINLINE ULONG IMMNotificationClient_Release(IMMNotificationClient* This) { 247 return This->lpVtbl->Release(This); 248 } 249 /*** IMMNotificationClient methods ***/ 250 static FORCEINLINE HRESULT IMMNotificationClient_OnDeviceStateChanged(IMMNotificationClient* This,LPCWSTR pwstrDeviceId,DWORD dwNewState) { 251 return This->lpVtbl->OnDeviceStateChanged(This,pwstrDeviceId,dwNewState); 252 } 253 static FORCEINLINE HRESULT IMMNotificationClient_OnDeviceAdded(IMMNotificationClient* This,LPCWSTR pwstrDeviceId) { 254 return This->lpVtbl->OnDeviceAdded(This,pwstrDeviceId); 255 } 256 static FORCEINLINE HRESULT IMMNotificationClient_OnDeviceRemoved(IMMNotificationClient* This,LPCWSTR pwstrDeviceId) { 257 return This->lpVtbl->OnDeviceRemoved(This,pwstrDeviceId); 258 } 259 static FORCEINLINE HRESULT IMMNotificationClient_OnDefaultDeviceChanged(IMMNotificationClient* This,EDataFlow flow,ERole role,LPCWSTR pwstrDeviceId) { 260 return This->lpVtbl->OnDefaultDeviceChanged(This,flow,role,pwstrDeviceId); 261 } 262 static FORCEINLINE HRESULT IMMNotificationClient_OnPropertyValueChanged(IMMNotificationClient* This,LPCWSTR pwstrDeviceId,const PROPERTYKEY key) { 263 return This->lpVtbl->OnPropertyValueChanged(This,pwstrDeviceId,key); 264 } 265 #endif 266 #endif 267 268 #endif 269 270 271 #endif /* __IMMNotificationClient_INTERFACE_DEFINED__ */ 272 273 /***************************************************************************** 274 * IMMDevice interface 275 */ 276 #ifndef __IMMDevice_INTERFACE_DEFINED__ 277 #define __IMMDevice_INTERFACE_DEFINED__ 278 279 DEFINE_GUID(IID_IMMDevice, 0xd666063f, 0x1587, 0x4e43, 0x81,0xf1, 0xb9,0x48,0xe8,0x07,0x36,0x3f); 280 #if defined(__cplusplus) && !defined(CINTERFACE) 281 MIDL_INTERFACE("d666063f-1587-4e43-81f1-b948e807363f") 282 IMMDevice : public IUnknown 283 { 284 virtual HRESULT STDMETHODCALLTYPE Activate( 285 REFIID iid, 286 DWORD dwClsCtx, 287 PROPVARIANT *pActivationParams, 288 void **ppv) = 0; 289 290 virtual HRESULT STDMETHODCALLTYPE OpenPropertyStore( 291 DWORD stgmAccess, 292 IPropertyStore **ppProperties) = 0; 293 294 virtual HRESULT STDMETHODCALLTYPE GetId( 295 LPWSTR *ppstrId) = 0; 296 297 virtual HRESULT STDMETHODCALLTYPE GetState( 298 DWORD *pdwState) = 0; 299 300 }; 301 #ifdef __CRT_UUID_DECL 302 __CRT_UUID_DECL(IMMDevice, 0xd666063f, 0x1587, 0x4e43, 0x81,0xf1, 0xb9,0x48,0xe8,0x07,0x36,0x3f) 303 #endif 304 #else 305 typedef struct IMMDeviceVtbl { 306 BEGIN_INTERFACE 307 308 /*** IUnknown methods ***/ 309 HRESULT (STDMETHODCALLTYPE *QueryInterface)( 310 IMMDevice *This, 311 REFIID riid, 312 void **ppvObject); 313 314 ULONG (STDMETHODCALLTYPE *AddRef)( 315 IMMDevice *This); 316 317 ULONG (STDMETHODCALLTYPE *Release)( 318 IMMDevice *This); 319 320 /*** IMMDevice methods ***/ 321 HRESULT (STDMETHODCALLTYPE *Activate)( 322 IMMDevice *This, 323 REFIID iid, 324 DWORD dwClsCtx, 325 PROPVARIANT *pActivationParams, 326 void **ppv); 327 328 HRESULT (STDMETHODCALLTYPE *OpenPropertyStore)( 329 IMMDevice *This, 330 DWORD stgmAccess, 331 IPropertyStore **ppProperties); 332 333 HRESULT (STDMETHODCALLTYPE *GetId)( 334 IMMDevice *This, 335 LPWSTR *ppstrId); 336 337 HRESULT (STDMETHODCALLTYPE *GetState)( 338 IMMDevice *This, 339 DWORD *pdwState); 340 341 END_INTERFACE 342 } IMMDeviceVtbl; 343 344 interface IMMDevice { 345 CONST_VTBL IMMDeviceVtbl* lpVtbl; 346 }; 347 348 #ifdef COBJMACROS 349 #ifndef WIDL_C_INLINE_WRAPPERS 350 /*** IUnknown methods ***/ 351 #define IMMDevice_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject) 352 #define IMMDevice_AddRef(This) (This)->lpVtbl->AddRef(This) 353 #define IMMDevice_Release(This) (This)->lpVtbl->Release(This) 354 /*** IMMDevice methods ***/ 355 #define IMMDevice_Activate(This,iid,dwClsCtx,pActivationParams,ppv) (This)->lpVtbl->Activate(This,iid,dwClsCtx,pActivationParams,ppv) 356 #define IMMDevice_OpenPropertyStore(This,stgmAccess,ppProperties) (This)->lpVtbl->OpenPropertyStore(This,stgmAccess,ppProperties) 357 #define IMMDevice_GetId(This,ppstrId) (This)->lpVtbl->GetId(This,ppstrId) 358 #define IMMDevice_GetState(This,pdwState) (This)->lpVtbl->GetState(This,pdwState) 359 #else 360 /*** IUnknown methods ***/ 361 static FORCEINLINE HRESULT IMMDevice_QueryInterface(IMMDevice* This,REFIID riid,void **ppvObject) { 362 return This->lpVtbl->QueryInterface(This,riid,ppvObject); 363 } 364 static FORCEINLINE ULONG IMMDevice_AddRef(IMMDevice* This) { 365 return This->lpVtbl->AddRef(This); 366 } 367 static FORCEINLINE ULONG IMMDevice_Release(IMMDevice* This) { 368 return This->lpVtbl->Release(This); 369 } 370 /*** IMMDevice methods ***/ 371 static FORCEINLINE HRESULT IMMDevice_Activate(IMMDevice* This,REFIID iid,DWORD dwClsCtx,PROPVARIANT *pActivationParams,void **ppv) { 372 return This->lpVtbl->Activate(This,iid,dwClsCtx,pActivationParams,ppv); 373 } 374 static FORCEINLINE HRESULT IMMDevice_OpenPropertyStore(IMMDevice* This,DWORD stgmAccess,IPropertyStore **ppProperties) { 375 return This->lpVtbl->OpenPropertyStore(This,stgmAccess,ppProperties); 376 } 377 static FORCEINLINE HRESULT IMMDevice_GetId(IMMDevice* This,LPWSTR *ppstrId) { 378 return This->lpVtbl->GetId(This,ppstrId); 379 } 380 static FORCEINLINE HRESULT IMMDevice_GetState(IMMDevice* This,DWORD *pdwState) { 381 return This->lpVtbl->GetState(This,pdwState); 382 } 383 #endif 384 #endif 385 386 #endif 387 388 389 #endif /* __IMMDevice_INTERFACE_DEFINED__ */ 390 391 /***************************************************************************** 392 * IMMDeviceCollection interface 393 */ 394 #ifndef __IMMDeviceCollection_INTERFACE_DEFINED__ 395 #define __IMMDeviceCollection_INTERFACE_DEFINED__ 396 397 DEFINE_GUID(IID_IMMDeviceCollection, 0x0bd7a1be, 0x7a1a, 0x44db, 0x83,0x97, 0xcc,0x53,0x92,0x38,0x7b,0x5e); 398 #if defined(__cplusplus) && !defined(CINTERFACE) 399 MIDL_INTERFACE("0bd7a1be-7a1a-44db-8397-cc5392387b5e") 400 IMMDeviceCollection : public IUnknown 401 { 402 virtual HRESULT STDMETHODCALLTYPE GetCount( 403 UINT *pcDevices) = 0; 404 405 virtual HRESULT STDMETHODCALLTYPE Item( 406 UINT nDevice, 407 IMMDevice **ppdevice) = 0; 408 409 }; 410 #ifdef __CRT_UUID_DECL 411 __CRT_UUID_DECL(IMMDeviceCollection, 0x0bd7a1be, 0x7a1a, 0x44db, 0x83,0x97, 0xcc,0x53,0x92,0x38,0x7b,0x5e) 412 #endif 413 #else 414 typedef struct IMMDeviceCollectionVtbl { 415 BEGIN_INTERFACE 416 417 /*** IUnknown methods ***/ 418 HRESULT (STDMETHODCALLTYPE *QueryInterface)( 419 IMMDeviceCollection *This, 420 REFIID riid, 421 void **ppvObject); 422 423 ULONG (STDMETHODCALLTYPE *AddRef)( 424 IMMDeviceCollection *This); 425 426 ULONG (STDMETHODCALLTYPE *Release)( 427 IMMDeviceCollection *This); 428 429 /*** IMMDeviceCollection methods ***/ 430 HRESULT (STDMETHODCALLTYPE *GetCount)( 431 IMMDeviceCollection *This, 432 UINT *pcDevices); 433 434 HRESULT (STDMETHODCALLTYPE *Item)( 435 IMMDeviceCollection *This, 436 UINT nDevice, 437 IMMDevice **ppdevice); 438 439 END_INTERFACE 440 } IMMDeviceCollectionVtbl; 441 442 interface IMMDeviceCollection { 443 CONST_VTBL IMMDeviceCollectionVtbl* lpVtbl; 444 }; 445 446 #ifdef COBJMACROS 447 #ifndef WIDL_C_INLINE_WRAPPERS 448 /*** IUnknown methods ***/ 449 #define IMMDeviceCollection_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject) 450 #define IMMDeviceCollection_AddRef(This) (This)->lpVtbl->AddRef(This) 451 #define IMMDeviceCollection_Release(This) (This)->lpVtbl->Release(This) 452 /*** IMMDeviceCollection methods ***/ 453 #define IMMDeviceCollection_GetCount(This,pcDevices) (This)->lpVtbl->GetCount(This,pcDevices) 454 #define IMMDeviceCollection_Item(This,nDevice,ppdevice) (This)->lpVtbl->Item(This,nDevice,ppdevice) 455 #else 456 /*** IUnknown methods ***/ 457 static FORCEINLINE HRESULT IMMDeviceCollection_QueryInterface(IMMDeviceCollection* This,REFIID riid,void **ppvObject) { 458 return This->lpVtbl->QueryInterface(This,riid,ppvObject); 459 } 460 static FORCEINLINE ULONG IMMDeviceCollection_AddRef(IMMDeviceCollection* This) { 461 return This->lpVtbl->AddRef(This); 462 } 463 static FORCEINLINE ULONG IMMDeviceCollection_Release(IMMDeviceCollection* This) { 464 return This->lpVtbl->Release(This); 465 } 466 /*** IMMDeviceCollection methods ***/ 467 static FORCEINLINE HRESULT IMMDeviceCollection_GetCount(IMMDeviceCollection* This,UINT *pcDevices) { 468 return This->lpVtbl->GetCount(This,pcDevices); 469 } 470 static FORCEINLINE HRESULT IMMDeviceCollection_Item(IMMDeviceCollection* This,UINT nDevice,IMMDevice **ppdevice) { 471 return This->lpVtbl->Item(This,nDevice,ppdevice); 472 } 473 #endif 474 #endif 475 476 #endif 477 478 479 #endif /* __IMMDeviceCollection_INTERFACE_DEFINED__ */ 480 481 /***************************************************************************** 482 * IMMEndpoint interface 483 */ 484 #ifndef __IMMEndpoint_INTERFACE_DEFINED__ 485 #define __IMMEndpoint_INTERFACE_DEFINED__ 486 487 DEFINE_GUID(IID_IMMEndpoint, 0x1be09788, 0x6894, 0x4089, 0x85,0x86, 0x9a,0x2a,0x6c,0x26,0x5a,0xc5); 488 #if defined(__cplusplus) && !defined(CINTERFACE) 489 MIDL_INTERFACE("1be09788-6894-4089-8586-9a2a6c265ac5") 490 IMMEndpoint : public IUnknown 491 { 492 virtual HRESULT STDMETHODCALLTYPE GetDataFlow( 493 EDataFlow *pDataFlow) = 0; 494 495 }; 496 #ifdef __CRT_UUID_DECL 497 __CRT_UUID_DECL(IMMEndpoint, 0x1be09788, 0x6894, 0x4089, 0x85,0x86, 0x9a,0x2a,0x6c,0x26,0x5a,0xc5) 498 #endif 499 #else 500 typedef struct IMMEndpointVtbl { 501 BEGIN_INTERFACE 502 503 /*** IUnknown methods ***/ 504 HRESULT (STDMETHODCALLTYPE *QueryInterface)( 505 IMMEndpoint *This, 506 REFIID riid, 507 void **ppvObject); 508 509 ULONG (STDMETHODCALLTYPE *AddRef)( 510 IMMEndpoint *This); 511 512 ULONG (STDMETHODCALLTYPE *Release)( 513 IMMEndpoint *This); 514 515 /*** IMMEndpoint methods ***/ 516 HRESULT (STDMETHODCALLTYPE *GetDataFlow)( 517 IMMEndpoint *This, 518 EDataFlow *pDataFlow); 519 520 END_INTERFACE 521 } IMMEndpointVtbl; 522 523 interface IMMEndpoint { 524 CONST_VTBL IMMEndpointVtbl* lpVtbl; 525 }; 526 527 #ifdef COBJMACROS 528 #ifndef WIDL_C_INLINE_WRAPPERS 529 /*** IUnknown methods ***/ 530 #define IMMEndpoint_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject) 531 #define IMMEndpoint_AddRef(This) (This)->lpVtbl->AddRef(This) 532 #define IMMEndpoint_Release(This) (This)->lpVtbl->Release(This) 533 /*** IMMEndpoint methods ***/ 534 #define IMMEndpoint_GetDataFlow(This,pDataFlow) (This)->lpVtbl->GetDataFlow(This,pDataFlow) 535 #else 536 /*** IUnknown methods ***/ 537 static FORCEINLINE HRESULT IMMEndpoint_QueryInterface(IMMEndpoint* This,REFIID riid,void **ppvObject) { 538 return This->lpVtbl->QueryInterface(This,riid,ppvObject); 539 } 540 static FORCEINLINE ULONG IMMEndpoint_AddRef(IMMEndpoint* This) { 541 return This->lpVtbl->AddRef(This); 542 } 543 static FORCEINLINE ULONG IMMEndpoint_Release(IMMEndpoint* This) { 544 return This->lpVtbl->Release(This); 545 } 546 /*** IMMEndpoint methods ***/ 547 static FORCEINLINE HRESULT IMMEndpoint_GetDataFlow(IMMEndpoint* This,EDataFlow *pDataFlow) { 548 return This->lpVtbl->GetDataFlow(This,pDataFlow); 549 } 550 #endif 551 #endif 552 553 #endif 554 555 556 #endif /* __IMMEndpoint_INTERFACE_DEFINED__ */ 557 558 /***************************************************************************** 559 * IMMDeviceEnumerator interface 560 */ 561 #ifndef __IMMDeviceEnumerator_INTERFACE_DEFINED__ 562 #define __IMMDeviceEnumerator_INTERFACE_DEFINED__ 563 564 DEFINE_GUID(IID_IMMDeviceEnumerator, 0xa95664d2, 0x9614, 0x4f35, 0xa7,0x46, 0xde,0x8d,0xb6,0x36,0x17,0xe6); 565 #if defined(__cplusplus) && !defined(CINTERFACE) 566 MIDL_INTERFACE("a95664d2-9614-4f35-a746-de8db63617e6") 567 IMMDeviceEnumerator : public IUnknown 568 { 569 virtual HRESULT STDMETHODCALLTYPE EnumAudioEndpoints( 570 EDataFlow dataFlow, 571 DWORD dwStateMask, 572 IMMDeviceCollection **ppDevices) = 0; 573 574 virtual HRESULT STDMETHODCALLTYPE GetDefaultAudioEndpoint( 575 EDataFlow dataFlow, 576 ERole role, 577 IMMDevice **ppEndpoint) = 0; 578 579 virtual HRESULT STDMETHODCALLTYPE GetDevice( 580 LPCWSTR pwstrId, 581 IMMDevice **ppDevice) = 0; 582 583 virtual HRESULT STDMETHODCALLTYPE RegisterEndpointNotificationCallback( 584 IMMNotificationClient *pClient) = 0; 585 586 virtual HRESULT STDMETHODCALLTYPE UnregisterEndpointNotificationCallback( 587 IMMNotificationClient *pClient) = 0; 588 589 }; 590 #ifdef __CRT_UUID_DECL 591 __CRT_UUID_DECL(IMMDeviceEnumerator, 0xa95664d2, 0x9614, 0x4f35, 0xa7,0x46, 0xde,0x8d,0xb6,0x36,0x17,0xe6) 592 #endif 593 #else 594 typedef struct IMMDeviceEnumeratorVtbl { 595 BEGIN_INTERFACE 596 597 /*** IUnknown methods ***/ 598 HRESULT (STDMETHODCALLTYPE *QueryInterface)( 599 IMMDeviceEnumerator *This, 600 REFIID riid, 601 void **ppvObject); 602 603 ULONG (STDMETHODCALLTYPE *AddRef)( 604 IMMDeviceEnumerator *This); 605 606 ULONG (STDMETHODCALLTYPE *Release)( 607 IMMDeviceEnumerator *This); 608 609 /*** IMMDeviceEnumerator methods ***/ 610 HRESULT (STDMETHODCALLTYPE *EnumAudioEndpoints)( 611 IMMDeviceEnumerator *This, 612 EDataFlow dataFlow, 613 DWORD dwStateMask, 614 IMMDeviceCollection **ppDevices); 615 616 HRESULT (STDMETHODCALLTYPE *GetDefaultAudioEndpoint)( 617 IMMDeviceEnumerator *This, 618 EDataFlow dataFlow, 619 ERole role, 620 IMMDevice **ppEndpoint); 621 622 HRESULT (STDMETHODCALLTYPE *GetDevice)( 623 IMMDeviceEnumerator *This, 624 LPCWSTR pwstrId, 625 IMMDevice **ppDevice); 626 627 HRESULT (STDMETHODCALLTYPE *RegisterEndpointNotificationCallback)( 628 IMMDeviceEnumerator *This, 629 IMMNotificationClient *pClient); 630 631 HRESULT (STDMETHODCALLTYPE *UnregisterEndpointNotificationCallback)( 632 IMMDeviceEnumerator *This, 633 IMMNotificationClient *pClient); 634 635 END_INTERFACE 636 } IMMDeviceEnumeratorVtbl; 637 638 interface IMMDeviceEnumerator { 639 CONST_VTBL IMMDeviceEnumeratorVtbl* lpVtbl; 640 }; 641 642 #ifdef COBJMACROS 643 #ifndef WIDL_C_INLINE_WRAPPERS 644 /*** IUnknown methods ***/ 645 #define IMMDeviceEnumerator_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject) 646 #define IMMDeviceEnumerator_AddRef(This) (This)->lpVtbl->AddRef(This) 647 #define IMMDeviceEnumerator_Release(This) (This)->lpVtbl->Release(This) 648 /*** IMMDeviceEnumerator methods ***/ 649 #define IMMDeviceEnumerator_EnumAudioEndpoints(This,dataFlow,dwStateMask,ppDevices) (This)->lpVtbl->EnumAudioEndpoints(This,dataFlow,dwStateMask,ppDevices) 650 #define IMMDeviceEnumerator_GetDefaultAudioEndpoint(This,dataFlow,role,ppEndpoint) (This)->lpVtbl->GetDefaultAudioEndpoint(This,dataFlow,role,ppEndpoint) 651 #define IMMDeviceEnumerator_GetDevice(This,pwstrId,ppDevice) (This)->lpVtbl->GetDevice(This,pwstrId,ppDevice) 652 #define IMMDeviceEnumerator_RegisterEndpointNotificationCallback(This,pClient) (This)->lpVtbl->RegisterEndpointNotificationCallback(This,pClient) 653 #define IMMDeviceEnumerator_UnregisterEndpointNotificationCallback(This,pClient) (This)->lpVtbl->UnregisterEndpointNotificationCallback(This,pClient) 654 #else 655 /*** IUnknown methods ***/ 656 static FORCEINLINE HRESULT IMMDeviceEnumerator_QueryInterface(IMMDeviceEnumerator* This,REFIID riid,void **ppvObject) { 657 return This->lpVtbl->QueryInterface(This,riid,ppvObject); 658 } 659 static FORCEINLINE ULONG IMMDeviceEnumerator_AddRef(IMMDeviceEnumerator* This) { 660 return This->lpVtbl->AddRef(This); 661 } 662 static FORCEINLINE ULONG IMMDeviceEnumerator_Release(IMMDeviceEnumerator* This) { 663 return This->lpVtbl->Release(This); 664 } 665 /*** IMMDeviceEnumerator methods ***/ 666 static FORCEINLINE HRESULT IMMDeviceEnumerator_EnumAudioEndpoints(IMMDeviceEnumerator* This,EDataFlow dataFlow,DWORD dwStateMask,IMMDeviceCollection **ppDevices) { 667 return This->lpVtbl->EnumAudioEndpoints(This,dataFlow,dwStateMask,ppDevices); 668 } 669 static FORCEINLINE HRESULT IMMDeviceEnumerator_GetDefaultAudioEndpoint(IMMDeviceEnumerator* This,EDataFlow dataFlow,ERole role,IMMDevice **ppEndpoint) { 670 return This->lpVtbl->GetDefaultAudioEndpoint(This,dataFlow,role,ppEndpoint); 671 } 672 static FORCEINLINE HRESULT IMMDeviceEnumerator_GetDevice(IMMDeviceEnumerator* This,LPCWSTR pwstrId,IMMDevice **ppDevice) { 673 return This->lpVtbl->GetDevice(This,pwstrId,ppDevice); 674 } 675 static FORCEINLINE HRESULT IMMDeviceEnumerator_RegisterEndpointNotificationCallback(IMMDeviceEnumerator* This,IMMNotificationClient *pClient) { 676 return This->lpVtbl->RegisterEndpointNotificationCallback(This,pClient); 677 } 678 static FORCEINLINE HRESULT IMMDeviceEnumerator_UnregisterEndpointNotificationCallback(IMMDeviceEnumerator* This,IMMNotificationClient *pClient) { 679 return This->lpVtbl->UnregisterEndpointNotificationCallback(This,pClient); 680 } 681 #endif 682 #endif 683 684 #endif 685 686 687 #endif /* __IMMDeviceEnumerator_INTERFACE_DEFINED__ */ 688 689 /***************************************************************************** 690 * IMMDeviceActivator interface 691 */ 692 #ifndef __IMMDeviceActivator_INTERFACE_DEFINED__ 693 #define __IMMDeviceActivator_INTERFACE_DEFINED__ 694 695 DEFINE_GUID(IID_IMMDeviceActivator, 0x3b0d0ea4, 0xd0a9, 0x4b0e, 0x93,0x5b, 0x09,0x51,0x67,0x46,0xfa,0xc0); 696 #if defined(__cplusplus) && !defined(CINTERFACE) 697 MIDL_INTERFACE("3b0d0ea4-d0a9-4b0e-935b-09516746fac0") 698 IMMDeviceActivator : public IUnknown 699 { 700 virtual HRESULT STDMETHODCALLTYPE Activate( 701 REFIID iid, 702 IMMDevice *pDevice, 703 PROPVARIANT *pActivationParams, 704 void **ppv) = 0; 705 706 }; 707 #ifdef __CRT_UUID_DECL 708 __CRT_UUID_DECL(IMMDeviceActivator, 0x3b0d0ea4, 0xd0a9, 0x4b0e, 0x93,0x5b, 0x09,0x51,0x67,0x46,0xfa,0xc0) 709 #endif 710 #else 711 typedef struct IMMDeviceActivatorVtbl { 712 BEGIN_INTERFACE 713 714 /*** IUnknown methods ***/ 715 HRESULT (STDMETHODCALLTYPE *QueryInterface)( 716 IMMDeviceActivator *This, 717 REFIID riid, 718 void **ppvObject); 719 720 ULONG (STDMETHODCALLTYPE *AddRef)( 721 IMMDeviceActivator *This); 722 723 ULONG (STDMETHODCALLTYPE *Release)( 724 IMMDeviceActivator *This); 725 726 /*** IMMDeviceActivator methods ***/ 727 HRESULT (STDMETHODCALLTYPE *Activate)( 728 IMMDeviceActivator *This, 729 REFIID iid, 730 IMMDevice *pDevice, 731 PROPVARIANT *pActivationParams, 732 void **ppv); 733 734 END_INTERFACE 735 } IMMDeviceActivatorVtbl; 736 737 interface IMMDeviceActivator { 738 CONST_VTBL IMMDeviceActivatorVtbl* lpVtbl; 739 }; 740 741 #ifdef COBJMACROS 742 #ifndef WIDL_C_INLINE_WRAPPERS 743 /*** IUnknown methods ***/ 744 #define IMMDeviceActivator_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject) 745 #define IMMDeviceActivator_AddRef(This) (This)->lpVtbl->AddRef(This) 746 #define IMMDeviceActivator_Release(This) (This)->lpVtbl->Release(This) 747 /*** IMMDeviceActivator methods ***/ 748 #define IMMDeviceActivator_Activate(This,iid,pDevice,pActivationParams,ppv) (This)->lpVtbl->Activate(This,iid,pDevice,pActivationParams,ppv) 749 #else 750 /*** IUnknown methods ***/ 751 static FORCEINLINE HRESULT IMMDeviceActivator_QueryInterface(IMMDeviceActivator* This,REFIID riid,void **ppvObject) { 752 return This->lpVtbl->QueryInterface(This,riid,ppvObject); 753 } 754 static FORCEINLINE ULONG IMMDeviceActivator_AddRef(IMMDeviceActivator* This) { 755 return This->lpVtbl->AddRef(This); 756 } 757 static FORCEINLINE ULONG IMMDeviceActivator_Release(IMMDeviceActivator* This) { 758 return This->lpVtbl->Release(This); 759 } 760 /*** IMMDeviceActivator methods ***/ 761 static FORCEINLINE HRESULT IMMDeviceActivator_Activate(IMMDeviceActivator* This,REFIID iid,IMMDevice *pDevice,PROPVARIANT *pActivationParams,void **ppv) { 762 return This->lpVtbl->Activate(This,iid,pDevice,pActivationParams,ppv); 763 } 764 #endif 765 #endif 766 767 #endif 768 769 770 #endif /* __IMMDeviceActivator_INTERFACE_DEFINED__ */ 771 772 typedef struct _AudioExtensionParams { 773 LPARAM AddPageParam; 774 IMMDevice *pEndPoint; 775 IMMDevice *pPnpInterface; 776 IMMDevice *pPnpDevnode; 777 } AudioExtensionParams; 778 779 DEFINE_GUID(LIBID_MMDeviceAPILib, 0x2fdaafa3, 0x7523, 0x4f66, 0x99,0x57, 0x9d,0x5e,0x7f,0xe6,0x98,0xf6); 780 781 /***************************************************************************** 782 * MMDeviceEnumerator coclass 783 */ 784 785 DEFINE_GUID(CLSID_MMDeviceEnumerator, 0xbcde0395, 0xe52f, 0x467c, 0x8e,0x3d, 0xc4,0x57,0x92,0x91,0x69,0x2e); 786 787 #ifdef __cplusplus 788 class DECLSPEC_UUID("bcde0395-e52f-467c-8e3d-c4579291692e") MMDeviceEnumerator; 789 #ifdef __CRT_UUID_DECL 790 __CRT_UUID_DECL(MMDeviceEnumerator, 0xbcde0395, 0xe52f, 0x467c, 0x8e,0x3d, 0xc4,0x57,0x92,0x91,0x69,0x2e) 791 #endif 792 #endif 793 794 /* Begin additional prototypes for all interfaces */ 795 796 797 /* End additional prototypes */ 798 799 #ifdef __cplusplus 800 } 801 #endif 802 803 #endif /* __mmdeviceapi_h__ */ 804