@@ -18,14 +18,14 @@ use std::time::Duration;
1818
1919use super :: com;
2020use 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 } ;
2222use windows:: core:: GUID ;
2323use windows:: Win32 :: Devices :: Properties ;
2424use windows:: Win32 :: Foundation ;
2525use windows:: Win32 :: Media :: Audio :: IAudioRenderClient ;
2626use windows:: Win32 :: Media :: { Audio , KernelStreaming , Multimedia } ;
2727use windows:: Win32 :: System :: Com ;
28- use windows:: Win32 :: System :: Com :: { StructuredStorage , STGM_READ } ;
28+ use windows:: Win32 :: System :: Com :: { StructuredStorage , STGM_READ , CoTaskMemFree , StringFromIID } ;
2929use windows:: Win32 :: System :: Threading ;
3030use windows:: Win32 :: System :: Variant :: VT_LPWSTR ;
3131
@@ -284,11 +284,11 @@ unsafe fn format_from_waveformatex_ptr(
284284}
285285
286286#[ implement( Audio :: IActivateAudioInterfaceCompletionHandler ) ]
287- struct CompletionHandler ( Sender < WinResult < IUnknown > > ) ;
287+ struct CompletionHandler ( Sender < windows :: core :: Result < IUnknown > > ) ;
288288
289289fn retrieve_result (
290290 operation : & Audio :: IActivateAudioInterfaceAsyncOperation ,
291- ) -> WinResult < IUnknown > {
291+ ) -> windows :: core :: Result < IUnknown > {
292292 let mut result = HRESULT :: default ( ) ;
293293 let mut interface: Option < IUnknown > = None ;
294294 unsafe {
@@ -302,7 +302,7 @@ impl Audio::IActivateAudioInterfaceCompletionHandler_Impl for CompletionHandler
302302 fn ActivateCompleted (
303303 & self ,
304304 operation : Option < & Audio :: IActivateAudioInterfaceAsyncOperation > ,
305- ) -> WinResult < ( ) > {
305+ ) -> windows :: core :: Result < ( ) > {
306306 let result = retrieve_result ( operation. unwrap ( ) ) ;
307307 let _ = self . 0 . send ( result) ;
308308 Ok ( ( ) )
@@ -313,10 +313,10 @@ impl Audio::IActivateAudioInterfaceCompletionHandler_Impl for CompletionHandler
313313unsafe fn ActivateAudioInterfaceSync < P0 , T > (
314314 deviceinterfacepath : P0 ,
315315 activationparams : Option < * const PROPVARIANT > ,
316- ) -> WinResult < T >
316+ ) -> windows :: core :: Result < T >
317317where
318318 P0 : windows:: core:: IntoParam < PCWSTR > ,
319- T : Interface + ComInterface ,
319+ T : Interface ,
320320{
321321 let ( sender, receiver) = std:: sync:: mpsc:: channel ( ) ;
322322 let completion: Audio :: IActivateAudioInterfaceCompletionHandler =
0 commit comments