@@ -18,14 +18,14 @@ use std::time::Duration;
18
18
19
19
use super :: com;
20
20
use super :: { windows_err_to_cpal_err, windows_err_to_cpal_err_message} ;
21
- use windows:: core:: Interface ;
21
+ use windows:: core:: { HRESULT , implement , Interface , IUnknown , PCWSTR , PROPVARIANT } ;
22
22
use windows:: core:: GUID ;
23
23
use windows:: Win32 :: Devices :: Properties ;
24
24
use windows:: Win32 :: Foundation ;
25
25
use windows:: Win32 :: Media :: Audio :: IAudioRenderClient ;
26
26
use windows:: Win32 :: Media :: { Audio , KernelStreaming , Multimedia } ;
27
27
use windows:: Win32 :: System :: Com ;
28
- use windows:: Win32 :: System :: Com :: { StructuredStorage , STGM_READ } ;
28
+ use windows:: Win32 :: System :: Com :: { StructuredStorage , STGM_READ , CoTaskMemFree , StringFromIID } ;
29
29
use windows:: Win32 :: System :: Threading ;
30
30
use windows:: Win32 :: System :: Variant :: VT_LPWSTR ;
31
31
@@ -284,11 +284,11 @@ unsafe fn format_from_waveformatex_ptr(
284
284
}
285
285
286
286
#[ implement( Audio :: IActivateAudioInterfaceCompletionHandler ) ]
287
- struct CompletionHandler ( Sender < WinResult < IUnknown > > ) ;
287
+ struct CompletionHandler ( Sender < windows :: core :: Result < IUnknown > > ) ;
288
288
289
289
fn retrieve_result (
290
290
operation : & Audio :: IActivateAudioInterfaceAsyncOperation ,
291
- ) -> WinResult < IUnknown > {
291
+ ) -> windows :: core :: Result < IUnknown > {
292
292
let mut result = HRESULT :: default ( ) ;
293
293
let mut interface: Option < IUnknown > = None ;
294
294
unsafe {
@@ -302,7 +302,7 @@ impl Audio::IActivateAudioInterfaceCompletionHandler_Impl for CompletionHandler
302
302
fn ActivateCompleted (
303
303
& self ,
304
304
operation : Option < & Audio :: IActivateAudioInterfaceAsyncOperation > ,
305
- ) -> WinResult < ( ) > {
305
+ ) -> windows :: core :: Result < ( ) > {
306
306
let result = retrieve_result ( operation. unwrap ( ) ) ;
307
307
let _ = self . 0 . send ( result) ;
308
308
Ok ( ( ) )
@@ -313,10 +313,10 @@ impl Audio::IActivateAudioInterfaceCompletionHandler_Impl for CompletionHandler
313
313
unsafe fn ActivateAudioInterfaceSync < P0 , T > (
314
314
deviceinterfacepath : P0 ,
315
315
activationparams : Option < * const PROPVARIANT > ,
316
- ) -> WinResult < T >
316
+ ) -> windows :: core :: Result < T >
317
317
where
318
318
P0 : windows:: core:: IntoParam < PCWSTR > ,
319
- T : Interface + ComInterface ,
319
+ T : Interface ,
320
320
{
321
321
let ( sender, receiver) = std:: sync:: mpsc:: channel ( ) ;
322
322
let completion: Audio :: IActivateAudioInterfaceCompletionHandler =
0 commit comments