connectivitylayer/isce/iscapi_dll/src/isaapi.cpp
changeset 5 8ccc39f9d787
parent 0 63b37f68c1ce
child 8 6295dc2169f3
--- a/connectivitylayer/isce/iscapi_dll/src/isaapi.cpp	Mon Nov 09 10:36:19 2009 +0000
+++ b/connectivitylayer/isce/iscapi_dll/src/isaapi.cpp	Thu Jan 14 10:44:58 2010 +0200
@@ -201,20 +201,25 @@
         C_TRACE( ( _T( "RIscApi::Open iChannelNumber %d aChannelNumber %d " ), iChannelNumber, aChannelNumber ) );
         OstTraceExt2( TRACE_NORMAL, DUP1_RISCAPI_OPEN, "RIscApi::Open;iChannelNumber=%hx;aChannelNumber=%hx", iChannelNumber, aChannelNumber );        
         aStatus = KRequestPending;
+        TRequestStatus status = KRequestPending;
         TAny* params[ KThreeParams ];
-        params[ KFirstParam ] = reinterpret_cast< TAny* >( &aStatus );
+        params[ KFirstParam ] = reinterpret_cast< TAny* >( &status );
         params[ KSecondParam ] = reinterpret_cast< TAny* >( &iChannelNumber );
         // If opened with resource (aOpenParams).
         params[ KThirdParam ] = reinterpret_cast< TAny* >( const_cast<TDesC8*>( aOpenParams ) );
         error = DoControl( EIADAsyncOpen, params );
         TRACE_ASSERT_ALWAYS_COND( KErrNone == error );
+        User::WaitForRequest(status);
         // In case of KErrAlreadyExists as a result to open we must close the handle after open.
-        if( KErrAlreadyExists == aStatus.Int() )
+        if( status.Int() == KErrAlreadyExists )
             {
             C_TRACE(  (  _T(  "RIscApi::Open close handle KErrAlreadyExists" ) ) );
             OstTraceExt1( TRACE_NORMAL, RISCAPI_OPEN_ALREADY_EXIST, "RIscApi::Open;aChannelNumber=%hx", aChannelNumber );
             RHandleBase::Close();
             }
+        TRequestStatus* statusPtr=&aStatus;
+
+        User::RequestComplete(statusPtr, status.Int());
         }
     C_TRACE(  (  _T(  "RIscApi::Open <-" ) ) );