usbmgmt/usbmgr/host/functiondrivers/ms/msmm/server/src/eventhandler.cpp
changeset 59 bbdce6bffaad
parent 49 93c0009bd947
child 63 705964cc7132
equal deleted inserted replaced
58:84c26be382f0 59:bbdce6bffaad
   146     TRetrieveDriveLetter* command(NULL);
   146     TRetrieveDriveLetter* command(NULL);
   147     THostMsSubCommandParam parameter(iServer, *this, *this, iIncomingEvent);
   147     THostMsSubCommandParam parameter(iServer, *this, *this, iIncomingEvent);
   148     for (TInt index = 0; index < aLogicalUnitCount; index++)
   148     for (TInt index = 0; index < aLogicalUnitCount; index++)
   149         {
   149         {
   150         command = new (ELeave) TRetrieveDriveLetter(parameter, index);
   150         command = new (ELeave) TRetrieveDriveLetter(parameter, index);
   151         iSubCommandQueue.PushL(command);
   151 
       
   152 		CleanupStack::PushL(command);        
       
   153 		iSubCommandQueue.PushL(command);
       
   154 		CleanupStack::Pop(command);
       
   155 
   152         }
   156         }
   153     OstTraceFunctionExit0( CDEVICEEVENTHANDLER_CREATESUBCMDFORRETRIEVEDRIVELETTERL_EXIT );
   157     OstTraceFunctionExit0( CDEVICEEVENTHANDLER_CREATESUBCMDFORRETRIEVEDRIVELETTERL_EXIT );
   154     }
   158     }
   155 
   159 
   156 void CDeviceEventHandler::CreateSubCmdForMountingLogicalUnitL(TText aDrive, 
   160 void CDeviceEventHandler::CreateSubCmdForMountingLogicalUnitL(TText aDrive, 
   159     OstTraceFunctionEntry0( CDEVICEEVENTHANDLER_CREATESUBCMDFORMOUNTINGLOGICALUNITL_ENTRY );
   163     OstTraceFunctionEntry0( CDEVICEEVENTHANDLER_CREATESUBCMDFORMOUNTINGLOGICALUNITL_ENTRY );
   160     
   164     
   161     THostMsSubCommandParam parameter(iServer, *this, *this, iIncomingEvent);
   165     THostMsSubCommandParam parameter(iServer, *this, *this, iIncomingEvent);
   162     TMountLogicalUnit* command = new (ELeave) TMountLogicalUnit(
   166     TMountLogicalUnit* command = new (ELeave) TMountLogicalUnit(
   163             parameter, aDrive, aLuNumber);
   167             parameter, aDrive, aLuNumber);
       
   168 	
       
   169 	CleanupStack::PushL(command);
   164     iSubCommandQueue.InsertAfterHeadL(command);
   170     iSubCommandQueue.InsertAfterHeadL(command);
       
   171 	CleanupStack::Pop(command);
       
   172 
   165     OstTraceFunctionExit0( CDEVICEEVENTHANDLER_CREATESUBCMDFORMOUNTINGLOGICALUNITL_EXIT );
   173     OstTraceFunctionExit0( CDEVICEEVENTHANDLER_CREATESUBCMDFORMOUNTINGLOGICALUNITL_EXIT );
   166     }
   174     }
   167 
   175 
   168 void CDeviceEventHandler::CreateSubCmdForSaveLatestMountInfoL(TText aDrive, 
   176 void CDeviceEventHandler::CreateSubCmdForSaveLatestMountInfoL(TText aDrive, 
   169         TInt aLuNumber)
   177         TInt aLuNumber)
   171     OstTraceFunctionEntry0( CDEVICEEVENTHANDLER_CREATESUBCMDFORSAVELATESTMOUNTINFOL_ENTRY );
   179     OstTraceFunctionEntry0( CDEVICEEVENTHANDLER_CREATESUBCMDFORSAVELATESTMOUNTINFOL_ENTRY );
   172     
   180     
   173     THostMsSubCommandParam parameter(iServer, *this, *this, iIncomingEvent);
   181     THostMsSubCommandParam parameter(iServer, *this, *this, iIncomingEvent);
   174     TSaveLatestMountInfo* command = 
   182     TSaveLatestMountInfo* command = 
   175         new (ELeave) TSaveLatestMountInfo(parameter, aDrive, aLuNumber);
   183         new (ELeave) TSaveLatestMountInfo(parameter, aDrive, aLuNumber);
       
   184 	
       
   185 	CleanupStack::PushL(command);
   176     iSubCommandQueue.InsertAfterHeadL(command);
   186     iSubCommandQueue.InsertAfterHeadL(command);
       
   187 	CleanupStack::Pop(command);
       
   188 
   177     OstTraceFunctionExit0( CDEVICEEVENTHANDLER_CREATESUBCMDFORSAVELATESTMOUNTINFOL_EXIT );
   189     OstTraceFunctionExit0( CDEVICEEVENTHANDLER_CREATESUBCMDFORSAVELATESTMOUNTINFOL_EXIT );
   178     }
   190     }
   179 
   191 
   180 void CDeviceEventHandler::Start()
   192 void CDeviceEventHandler::Start()
   181     {
   193     {
   360     {
   372     {
   361     OstTraceFunctionEntry0( CDEVICEEVENTHANDLER_CREATESUBCMDFORADDINGUSBMSFUNCTIONL_ENTRY );
   373     OstTraceFunctionEntry0( CDEVICEEVENTHANDLER_CREATESUBCMDFORADDINGUSBMSFUNCTIONL_ENTRY );
   362     
   374     
   363     THostMsSubCommandParam parameter(iServer, *this, *this, iIncomingEvent);
   375     THostMsSubCommandParam parameter(iServer, *this, *this, iIncomingEvent);
   364     TRegisterInterface* command = new (ELeave) TRegisterInterface(parameter);
   376     TRegisterInterface* command = new (ELeave) TRegisterInterface(parameter);
       
   377 
       
   378 	CleanupStack::PushL(command);
   365     iSubCommandQueue.PushL(command);
   379     iSubCommandQueue.PushL(command);
       
   380 	CleanupStack::Pop(command);
       
   381 
   366     OstTraceFunctionExit0( CDEVICEEVENTHANDLER_CREATESUBCMDFORADDINGUSBMSFUNCTIONL_EXIT );
   382     OstTraceFunctionExit0( CDEVICEEVENTHANDLER_CREATESUBCMDFORADDINGUSBMSFUNCTIONL_EXIT );
   367     }
   383     }
   368 
   384 
   369 void CDeviceEventHandler::CreateSubCmdForRemovingUsbMsDeviceL()
   385 void CDeviceEventHandler::CreateSubCmdForRemovingUsbMsDeviceL()
   370     {
   386     {
   378         }
   394         }
   379 
   395 
   380     THostMsSubCommandParam parameter(iServer, *this, *this, iIncomingEvent);
   396     THostMsSubCommandParam parameter(iServer, *this, *this, iIncomingEvent);
   381     TRemoveUsbMsDevice* removeMsDevice = new (ELeave) TRemoveUsbMsDevice(
   397     TRemoveUsbMsDevice* removeMsDevice = new (ELeave) TRemoveUsbMsDevice(
   382             parameter);
   398             parameter);
       
   399 	
       
   400 	CleanupStack::PushL(removeMsDevice);
   383     iSubCommandQueue.PushL(removeMsDevice);
   401     iSubCommandQueue.PushL(removeMsDevice);
       
   402 	CleanupStack::Pop(removeMsDevice);
   384     
   403     
   385     OstTraceFunctionExit0( CDEVICEEVENTHANDLER_CREATESUBCMDFORREMOVINGUSBMSDEVICEL_EXIT );
   404     OstTraceFunctionExit0( CDEVICEEVENTHANDLER_CREATESUBCMDFORREMOVINGUSBMSDEVICEL_EXIT );
   386     }
   405     }
   387 
   406 
   388 void CDeviceEventHandler::ResetHandler()
   407 void CDeviceEventHandler::ResetHandler()