equal
deleted
inserted
replaced
151 if (!pF || pF->MountedPlugins()==0) |
151 if (!pF || pF->MountedPlugins()==0) |
152 return(KErrNotFound); |
152 return(KErrNotFound); |
153 if(pF->IsDriveSupported(drive) == EFalse) |
153 if(pF->IsDriveSupported(drive) == EFalse) |
154 return KErrNotSupported; |
154 return KErrNotSupported; |
155 |
155 |
156 FsPluginManager::LockChain(); |
156 FsPluginManager::ReadLockChain(); |
157 err = FsPluginManager::IsInChain(pF->UniquePosition(),aRequest->Message().Int2(),aRequest->Message().Int1(), pF); |
157 err = FsPluginManager::IsInChain(pF->UniquePosition(),aRequest->Message().Int2(),aRequest->Message().Int1(), pF); |
158 |
158 |
159 // plugin might have been mounted in different pos and drive. Find the right one |
159 // plugin might have been mounted in different pos and drive. Find the right one |
160 if(err >= 0) |
160 if(err >= 0) |
161 { |
161 { |
207 if(pF == NULL) |
207 if(pF == NULL) |
208 return KErrNone; // The plugin has already been dismounted |
208 return KErrNone; // The plugin has already been dismounted |
209 |
209 |
210 TInt drive = aRequest->Message().Int1(); |
210 TInt drive = aRequest->Message().Int1(); |
211 |
211 |
212 FsPluginManager::LockChain(); |
212 FsPluginManager::WriteLockChain(); |
213 |
213 |
214 TInt err = FsPluginManager::IsInChain(pF->UniquePosition(),aRequest->Message().Int2(),drive, pF); |
214 TInt err = FsPluginManager::IsInChain(pF->UniquePosition(),aRequest->Message().Int2(),drive, pF); |
215 if(err >= 0) |
215 if(err >= 0) |
216 { |
216 { |
217 TInt pos = err; |
217 TInt pos = err; |
218 CFsPlugin* plugin = NULL; |
218 CFsPlugin* plugin = NULL; |
219 err = FsPluginManager::Plugin(plugin, pos); |
219 err = FsPluginManager::Plugin(plugin, pos); |
220 if(err == KErrNone) |
220 if(err == KErrNone) |
221 { |
221 { |
222 if(aRequest->iCurrentPlugin == plugin) |
222 FsPluginManager::DismountPlugin(*pF,pos); |
223 { |
223 aRequest->SetScratchValue(0); |
224 FsPluginManager::DismountPlugin(*pF,pos); |
|
225 aRequest->SetScratchValue(0); |
|
226 } |
|
227 } |
224 } |
228 } |
225 } |
229 FsPluginManager::UnlockChain(); |
226 FsPluginManager::UnlockChain(); |
230 return err; |
227 return err; |
231 } |
228 } |
248 Return the name of a plugin for a given drive and plugin chain position |
245 Return the name of a plugin for a given drive and plugin chain position |
249 */ |
246 */ |
250 TInt TFsPluginName::DoRequestL(CFsRequest* aRequest) |
247 TInt TFsPluginName::DoRequestL(CFsRequest* aRequest) |
251 { |
248 { |
252 CFsPlugin* plugin=NULL; |
249 CFsPlugin* plugin=NULL; |
253 FsPluginManager::LockChain(); |
250 FsPluginManager::ReadLockChain(); |
254 TInt err = FsPluginManager::Plugin(plugin, aRequest->Message().Int2()); |
251 TInt err = FsPluginManager::Plugin(plugin, aRequest->Message().Int2()); |
255 if(err != KErrNone) //should be ok but just in case |
252 if(err != KErrNone) //should be ok but just in case |
256 { |
253 { |
257 FsPluginManager::UnlockChain(); |
254 FsPluginManager::UnlockChain(); |
258 return err; |
255 return err; |