122 |
128 |
123 //-- 3. find out primary extension name if it is present; we will need to add it againt when mounting the FS |
129 //-- 3. find out primary extension name if it is present; we will need to add it againt when mounting the FS |
124 //-- other extensions (non-primary) are not supported yet |
130 //-- other extensions (non-primary) are not supported yet |
125 nRes = aFs.ExtensionName(primaryExtName, aDrive, 0); |
131 nRes = aFs.ExtensionName(primaryExtName, aDrive, 0); |
126 if(nRes != KErrNone) |
132 if(nRes != KErrNone) |
127 { |
133 { |
128 primaryExtName.SetLength(0); |
134 primaryExtName.SetLength(0); |
129 } |
135 } |
130 |
136 |
131 //-- 3.1 check if the drive has non-primary extensions, fail in this case, because this FS can't be mounted back normally |
137 //-- 3.1 check if the drive has non-primary extensions, fail in this case, because this FS can't be mounted back normally |
132 nRes = aFs.ExtensionName(primaryExtName, aDrive, 1); |
138 nRes = aFs.ExtensionName(primaryExtName, aDrive, 1); |
133 if(nRes == KErrNone) |
139 if(nRes == KErrNone) |
134 { |
140 { |
135 test.Printf(_L("DoDismountOrginalFS Non-primary extensions are not supported!\n")); |
141 test.Printf(_L("DoDismountOrginalFS Non-primary extensions are not supported!\n")); |
|
142 OstTrace0(TRACE_NORMAL, CFILESYSTEMDESCRIPTOR_NEWL_DUP01, "DoDismountOrginalFS Non-primary extensions are not supported!\n"); |
136 return NULL; |
143 return NULL; |
137 } |
144 } |
138 |
145 |
139 test.Printf(_L("DoDismountOrginalFS FS:%S, Prim ext:%S, synch:%d\n"), &fsName, &primaryExtName, bDrvSync); |
146 test.Printf(_L("DoDismountOrginalFS FS:%S, Prim ext:%S, synch:%d\n"), &fsName, &primaryExtName, bDrvSync); |
|
147 OstTraceExt3(TRACE_NORMAL, CFILESYSTEMDESCRIPTOR_NEWL_DUP02, "DoDismountOrginalFS FS:%S, Prim ext:%S, synch:%d\n", fsName, primaryExtName, bDrvSync); |
140 |
148 |
141 //-- create FS descriptor and dismount the FS |
149 //-- create FS descriptor and dismount the FS |
142 CFileSystemDescriptor* pFsDesc = NULL; |
150 CFileSystemDescriptor* pFsDesc = NULL; |
143 |
151 |
144 TRAP(nRes, pFsDesc = CFileSystemDescriptor::NewL(fsName, primaryExtName, bDrvSync)); |
152 TRAP(nRes, pFsDesc = CFileSystemDescriptor::NewL(fsName, primaryExtName, bDrvSync)); |
145 if(nRes != KErrNone) |
153 if(nRes != KErrNone) |
146 return NULL; //-- OOM ? |
154 return NULL; //-- OOM ? |
147 |
155 |
148 nRes = aFs.DismountFileSystem(fsName, aDrive); |
156 nRes = aFs.DismountFileSystem(fsName, aDrive); |
149 if(nRes != KErrNone) |
157 if(nRes != KErrNone) |
150 { |
158 { |
151 delete pFsDesc; |
159 delete pFsDesc; |
152 pFsDesc = NULL; |
160 pFsDesc = NULL; |
153 test.Printf(_L("DoDismountOrginalFS Dismounting Err:%d\n"), nRes); |
161 test.Printf(_L("DoDismountOrginalFS Dismounting Err:%d\n"), nRes); |
154 } |
162 OstTrace1(TRACE_NORMAL, CFILESYSTEMDESCRIPTOR_NEWL_DUP03, "DoDismountOrginalFS Dismounting Err:%d\n", nRes); |
155 |
163 } |
|
164 |
156 return pFsDesc; |
165 return pFsDesc; |
157 } |
166 } |
158 |
167 |
159 //----------------------------------------------------------------------------- |
168 //----------------------------------------------------------------------------- |
160 /** |
169 /** |
164 LOCAL_C TInt DoRestoreFS(RFs& aFs, TInt aDrive, CFileSystemDescriptor* apFsDesc) |
173 LOCAL_C TInt DoRestoreFS(RFs& aFs, TInt aDrive, CFileSystemDescriptor* apFsDesc) |
165 { |
174 { |
166 TInt nRes; |
175 TInt nRes; |
167 |
176 |
168 test.Printf(_L("DoRestoreFS drv:%d\n"), aDrive); |
177 test.Printf(_L("DoRestoreFS drv:%d\n"), aDrive); |
|
178 OstTrace1(TRACE_NORMAL, DORESTOREFS_DORESTOREFS, "DoRestoreFS drv:%d\n", aDrive); |
169 |
179 |
170 //-- 1. check that there is no FS installed |
180 //-- 1. check that there is no FS installed |
171 TBuf<128> fsName; |
181 TBuf<128> fsName; |
172 nRes = aFs.FileSystemName(fsName, aDrive); |
182 nRes = aFs.FileSystemName(fsName, aDrive); |
173 if(nRes == KErrNone) |
183 if(nRes == KErrNone) |
174 {//-- there is a file system already installed |
184 {//-- there is a file system already installed |
175 test.Printf(_L("DoRestoreFS This drive already has FS intalled:%S \n"), &fsName); |
185 test.Printf(_L("DoRestoreFS This drive already has FS intalled:%S \n"), &fsName); |
|
186 OstTraceExt1(TRACE_NORMAL, DORESTOREFS_DORESTOREFS_DUP01, "DoRestoreFS This drive already has FS intalled:%S \n", fsName); |
176 return KErrAlreadyExists; |
187 return KErrAlreadyExists; |
177 } |
188 } |
178 |
189 |
179 TPtrC ptrN (apFsDesc->FsName()); |
190 TPtrC ptrN (apFsDesc->FsName()); |
180 TPtrC ptrExt(apFsDesc->PrimaryExtName()); |
191 TPtrC ptrExt(apFsDesc->PrimaryExtName()); |
181 test.Printf(_L("DoRestoreFS Mounting FS:%S, Prim ext:%S, synch:%d\n"), &ptrN, &ptrExt, apFsDesc->DriveIsSynch()); |
192 test.Printf(_L("DoRestoreFS Mounting FS:%S, Prim ext:%S, synch:%d\n"), &ptrN, &ptrExt, apFsDesc->DriveIsSynch()); |
|
193 OstTraceExt3(TRACE_NORMAL, DORESTOREFS_DORESTOREFS_DUP02, "DoRestoreFS Mounting FS:%S, Prim ext:%S, synch:%d\n", ptrN, ptrExt, apFsDesc->DriveIsSynch()); |
182 |
194 |
183 if(ptrExt.Length() >0) |
195 if(ptrExt.Length() >0) |
184 {//-- there is a primary extension to be mounted |
196 {//-- there is a primary extension to be mounted |
185 nRes = aFs.AddExtension(ptrExt); |
197 nRes = aFs.AddExtension(ptrExt); |
186 if(nRes != KErrNone && nRes != KErrAlreadyExists) |
198 if(nRes != KErrNone && nRes != KErrAlreadyExists) |
208 /** |
221 /** |
209 Dismount the original FS from the drive and mount MsFS instead |
222 Dismount the original FS from the drive and mount MsFS instead |
210 */ |
223 */ |
211 LOCAL_C void MountMsFs(TInt driveNumber) |
224 LOCAL_C void MountMsFs(TInt driveNumber) |
212 { |
225 { |
213 test.Printf(_L("MountMsFs driveNumber=%d\n"), driveNumber); |
226 test.Printf(_L("MountMsFs driveNumber=%d\n"), driveNumber); |
|
227 OstTrace1(TRACE_NORMAL, MOUNTMSFS_MOUNTMSFS, "MountMsFs driveNumber=%d\n", driveNumber); |
214 |
228 |
215 //-- 1. try dismounting the original FS |
229 //-- 1. try dismounting the original FS |
216 CFileSystemDescriptor* fsDesc = DoDismountOrginalFS(fs, driveNumber); |
230 CFileSystemDescriptor* fsDesc = DoDismountOrginalFS(fs, driveNumber); |
217 unmountedFsList[driveNumber] = fsDesc; |
231 unmountedFsList[driveNumber] = fsDesc; |
218 |
232 |
219 if(fsDesc) |
233 if(fsDesc) |
220 { |
234 { |
221 TPtrC ptrN(fsDesc->FsName()); |
235 TPtrC ptrN(fsDesc->FsName()); |
222 test.Printf(_L("drv:%d FS:%S Dismounted OK\n"),driveNumber, &ptrN); |
236 test.Printf(_L("drv:%d FS:%S Dismounted OK\n"),driveNumber, &ptrN); |
|
237 OstTraceExt2(TRACE_NORMAL, MOUNTMSFS_MOUNTMSFS_DUP01, "drv:%d FS:%S Dismounted OK\n",driveNumber, ptrN); |
223 } |
238 } |
224 else |
239 else |
225 { |
240 { |
226 test.Printf(_L("drv:%d Dismount FS Failed!\n"),driveNumber); |
241 test.Printf(_L("drv:%d Dismount FS Failed!\n"),driveNumber); |
|
242 OstTrace1(TRACE_NORMAL, MOUNTMSFS_MOUNTMSFS_DUP02, "drv:%d Dismount FS Failed!\n",driveNumber); |
227 } |
243 } |
228 |
244 |
229 //-- 2. try to mount the "MSFS" |
245 //-- 2. try to mount the "MSFS" |
230 TInt error; |
246 TInt error; |
231 error = fs.MountFileSystem(KMsFs, driveNumber); |
247 error = fs.MountFileSystem(KMsFs, driveNumber); |
232 test.Printf(_L("MSFS Mount: %S (%d)\n"), (error?&KError:&KOk), error); |
248 test.Printf(_L("MSFS Mount: %S (%d)\n"), (error?&KError:&KOk), error); |
|
249 OstTraceExt2(TRACE_NORMAL, MOUNTMSFS_MOUNTMSFS_DUP03, "MSFS Mount: %S (%d)\n", (error?KError():KOk()), error); |
233 if (!error) |
250 if (!error) |
234 msfsMountedList[driveNumber] = ETrue; |
251 msfsMountedList[driveNumber] = ETrue; |
235 |
252 |
236 } |
253 } |
237 |
254 |
238 //----------------------------------------------------------------------------- |
255 //----------------------------------------------------------------------------- |
239 /** |
256 /** |
240 Dismount MsFS and mount the original FS |
257 Dismount MsFS and mount the original FS |
241 */ |
258 */ |
242 LOCAL_C TInt RestoreMount(TInt driveNumber) |
259 LOCAL_C TInt RestoreMount(TInt driveNumber) |
243 { |
260 { |
244 TInt err = KErrNone; |
261 TInt err = KErrNone; |
245 |
262 |
246 //-- 1. try dismounting the "MSFS" |
263 //-- 1. try dismounting the "MSFS" |
247 if (msfsMountedList[driveNumber]) |
264 if (msfsMountedList[driveNumber]) |
248 { |
265 { |
249 err = fs.DismountFileSystem(KMsFs, driveNumber); |
266 err = fs.DismountFileSystem(KMsFs, driveNumber); |
250 test.Printf(_L("MSFS Dismount:%S (%d)\n"), (err?&KError:&KOk), err); |
267 test.Printf(_L("MSFS Dismount:%S (%d)\n"), (err?&KError:&KOk), err); |
|
268 OstTraceExt2(TRACE_NORMAL, RESTOREMOUNT_RESTOREMOUNT, "MSFS Dismount:%S (%d)\n", (err?KError():KOk()), err); |
251 if (err) |
269 if (err) |
252 return err; |
270 return err; |
253 |
271 |
254 msfsMountedList[driveNumber] = EFalse; |
272 msfsMountedList[driveNumber] = EFalse; |
255 } |
273 } |
384 { |
402 { |
385 switch (iUsbDeviceState) |
403 switch (iUsbDeviceState) |
386 { |
404 { |
387 case EUsbcDeviceStateUndefined : // 0 |
405 case EUsbcDeviceStateUndefined : // 0 |
388 test.Printf(_L(">> CUSBWatch:Undefined %S\n"), iWasConfigured ? &KConfigured : &KNotConfigured); |
406 test.Printf(_L(">> CUSBWatch:Undefined %S\n"), iWasConfigured ? &KConfigured : &KNotConfigured); |
|
407 OstTraceExt1(TRACE_NORMAL, CUSBWATCH_RUNL, ">> CUSBWatch:Undefined %S\n", iWasConfigured ? KConfigured() : KNotConfigured()); |
389 break; |
408 break; |
390 |
409 |
391 case EUsbcDeviceStateAttached : // 1 |
410 case EUsbcDeviceStateAttached : // 1 |
392 test.Printf(_L(">> CUSBWatch:Attached %S\n"), iWasConfigured ? &KConfigured : &KNotConfigured); |
411 test.Printf(_L(">> CUSBWatch:Attached %S\n"), iWasConfigured ? &KConfigured : &KNotConfigured); |
|
412 OstTraceExt1(TRACE_NORMAL, CUSBWATCH_RUNL_DUP01, ">> CUSBWatch:Attached %S\n", iWasConfigured ? KConfigured() : KNotConfigured()); |
393 break; |
413 break; |
394 |
414 |
395 case EUsbcDeviceStatePowered : // 2 |
415 case EUsbcDeviceStatePowered : // 2 |
396 test.Printf(_L(">> CUSBWatch:Powered %S\n"), iWasConfigured ? &KConfigured : &KNotConfigured); |
416 test.Printf(_L(">> CUSBWatch:Powered %S\n"), iWasConfigured ? &KConfigured : &KNotConfigured); |
|
417 OstTraceExt1(TRACE_NORMAL, CUSBWATCH_RUNL_DUP02, ">> CUSBWatch:Powered %S\n", iWasConfigured ? KConfigured() : KNotConfigured()); |
397 break; |
418 break; |
398 |
419 |
399 case EUsbcDeviceStateDefault : // 3 |
420 case EUsbcDeviceStateDefault : // 3 |
400 test.Printf(_L(">> CUSBWatch:Default %S\n"), iWasConfigured ? &KConfigured : &KNotConfigured); |
421 test.Printf(_L(">> CUSBWatch:Default %S\n"), iWasConfigured ? &KConfigured : &KNotConfigured); |
|
422 OstTraceExt1(TRACE_NORMAL, CUSBWATCH_RUNL_DUP03, ">> CUSBWatch:Default %S\n", iWasConfigured ? KConfigured() : KNotConfigured()); |
401 break; |
423 break; |
402 |
424 |
403 case EUsbcDeviceStateAddress : // 4 |
425 case EUsbcDeviceStateAddress : // 4 |
404 test.Printf(_L(">> CUSBWatch:Address %S\n"), iWasConfigured ? &KConfigured : &KNotConfigured); |
426 test.Printf(_L(">> CUSBWatch:Address %S\n"), iWasConfigured ? &KConfigured : &KNotConfigured); |
|
427 OstTraceExt1(TRACE_NORMAL, CUSBWATCH_RUNL_DUP04, ">> CUSBWatch:Address %S\n", iWasConfigured ? KConfigured() : KNotConfigured()); |
405 break; |
428 break; |
406 |
429 |
407 case EUsbcDeviceStateConfigured : // 5 |
430 case EUsbcDeviceStateConfigured : // 5 |
408 test.Printf(_L(">> CUSBWatch:Configured %S\n"), iWasConfigured ? &KConfigured : &KNotConfigured); |
431 test.Printf(_L(">> CUSBWatch:Configured %S\n"), iWasConfigured ? &KConfigured : &KNotConfigured); |
|
432 OstTraceExt1(TRACE_NORMAL, CUSBWATCH_RUNL_DUP05, ">> CUSBWatch:Configured %S\n", iWasConfigured ? KConfigured() : KNotConfigured()); |
409 break; |
433 break; |
410 |
434 |
411 case EUsbcDeviceStateSuspended : // 6 |
435 case EUsbcDeviceStateSuspended : // 6 |
412 test.Printf(_L(">> CUSBWatch:Suspended %S\n"), iWasConfigured ? &KConfigured : &KNotConfigured); |
436 test.Printf(_L(">> CUSBWatch:Suspended %S\n"), iWasConfigured ? &KConfigured : &KNotConfigured); |
|
437 OstTraceExt1(TRACE_NORMAL, CUSBWATCH_RUNL_DUP06, ">> CUSBWatch:Suspended %S\n", iWasConfigured ? KConfigured() : KNotConfigured()); |
413 break; |
438 break; |
414 |
439 |
415 default : |
440 default : |
416 test.Printf(_L(">> CUSBWatch:UNKNOWN %S\n"), iWasConfigured ? &KConfigured : &KNotConfigured); |
441 test.Printf(_L(">> CUSBWatch:UNKNOWN %S\n"), iWasConfigured ? &KConfigured : &KNotConfigured); |
|
442 OstTraceExt1(TRACE_NORMAL, CUSBWATCH_RUNL_DUP07, ">> CUSBWatch:UNKNOWN %S\n", iWasConfigured ? KConfigured() : KNotConfigured()); |
417 break; |
443 break; |
418 |
444 |
419 } |
445 } |
420 } |
446 } |
421 iUsb.AlternateDeviceStatusNotify(iStatus, iUsbDeviceState); |
447 iUsb.AlternateDeviceStatusNotify(iStatus, iUsbDeviceState); |
422 SetActive(); |
448 SetActive(); |
423 |
449 |
426 { |
452 { |
427 for(TInt i=0; i<PropertyHandlers::allDrivesStatus.Length()/2; i++) |
453 for(TInt i=0; i<PropertyHandlers::allDrivesStatus.Length()/2; i++) |
428 { |
454 { |
429 if(IsDriveConnected(i)) |
455 if(IsDriveConnected(i)) |
430 { |
456 { |
431 RDebug::Print(_L("CUsbWatch calling RestoreMount")); |
457 OstTrace0(TRACE_NORMAL, CUSBWATCH_RUNL_DUP08, "CUsbWatch calling RestoreMount"); |
432 RestoreMount(PropertyHandlers::allDrivesStatus[2*i]); |
458 RestoreMount(PropertyHandlers::allDrivesStatus[2*i]); |
433 } |
459 } |
434 } |
460 } |
435 |
461 |
436 iWasConfigured = EFalse; |
462 iWasConfigured = EFalse; |
437 } |
463 } |
438 |
464 |
439 // If cable is connected, mount all drives in the auto-mount list. |
465 // If cable is connected, mount all drives in the auto-mount list. |
440 // This is done for performance, since if this is not done here, |
466 // This is done for performance, since if this is not done here, |
441 // mounting will happen later after each drive enters the |
467 // mounting will happen later after each drive enters the |
442 // Connecting state. |
468 // Connecting state. |
443 if(iUsbDeviceState == EUsbcDeviceStateConfigured) |
469 if(iUsbDeviceState == EUsbcDeviceStateConfigured) |
444 { |
470 { |
445 for(TInt i=0; i<PropertyHandlers::allDrivesStatus.Length()/2; i++) |
471 for(TInt i=0; i<PropertyHandlers::allDrivesStatus.Length()/2; i++) |
446 { |
472 { |
447 TInt driveNumber = PropertyHandlers::allDrivesStatus[2*i]; |
473 TInt driveNumber = PropertyHandlers::allDrivesStatus[2*i]; |
448 if(!IsDriveConnected(i) && IsDriveInMountList(DriveNumberToLetter(driveNumber))) |
474 if(!IsDriveConnected(i) && IsDriveInMountList(DriveNumberToLetter(driveNumber))) |
449 { |
475 { |
450 RDebug::Print(_L("CUsbWatch calling MountMsFs")); |
476 OstTrace0(TRACE_NORMAL, CUSBWATCH_RUNL_DUP09, "CUsbWatch calling MountMsFs"); |
451 MountMsFs(driveNumber); |
477 MountMsFs(driveNumber); |
452 } |
478 } |
453 } |
479 } |
454 |
480 |
455 iWasConfigured = ETrue; |
481 iWasConfigured = ETrue; |
484 { |
510 { |
485 for(TInt i = 0; i < allDrivesStatus.Length()/2; i++) |
511 for(TInt i = 0; i < allDrivesStatus.Length()/2; i++) |
486 { |
512 { |
487 if (gVerbose) |
513 if (gVerbose) |
488 { |
514 { |
489 test.Printf(KBytesTransferredFmt, |
515 test.Printf(KBytesTransferredFmt, |
|
516 (char)DriveNumberToLetter(allDrivesStatus[2*i]), iKBytesRead[i], iKBytesWritten[i]); |
|
517 OstTraceExt3(TRACE_NORMAL, PROPERTYHANDLERS_TRANSFERRED, "%c:%d/%d \n", |
490 (char)DriveNumberToLetter(allDrivesStatus[2*i]), iKBytesRead[i], iKBytesWritten[i]); |
518 (char)DriveNumberToLetter(allDrivesStatus[2*i]), iKBytesRead[i], iKBytesWritten[i]); |
491 } |
519 } |
492 } |
520 } |
493 } |
521 } |
494 else |
522 else |
495 { |
523 { |
496 test.Printf(KErrFmt, err); |
524 test.Printf(KErrFmt, err); |
497 } |
525 OstTrace1(TRACE_NORMAL, PROPERTYHANDLERS_TRANSFERRED_DUP01, "Error: %d\r", err); |
498 } |
526 } |
499 |
527 } |
|
528 |
500 void PropertyHandlers::DriveStatus(RProperty& aProperty) |
529 void PropertyHandlers::DriveStatus(RProperty& aProperty) |
501 { |
530 { |
502 if (gVerbose) |
531 if (gVerbose) |
503 { |
532 { |
504 test.Printf(_L(">> PropertyHandlers::DriveStatus")); |
533 test.Printf(_L(">> PropertyHandlers::DriveStatus")); |
|
534 OstTrace0(TRACE_NORMAL, PROPERTYHANDLERS_DRIVESTATUS, ">> PropertyHandlers::DriveStatus"); |
505 } |
535 } |
506 TInt err = aProperty.Get(allDrivesStatus); |
536 TInt err = aProperty.Get(allDrivesStatus); |
507 if(err == KErrNone) |
537 if(err == KErrNone) |
508 { |
538 { |
509 if (gVerbose) |
539 if (gVerbose) |
510 { |
540 { |
511 test.Printf(_L(" Status: ")); |
541 test.Printf(_L(" Status: ")); |
|
542 OstTrace0(TRACE_NORMAL, PROPERTYHANDLERS_DRIVESTATUS_DUP01, " Status: "); |
512 } |
543 } |
513 for(TInt i = 0; i < allDrivesStatus.Length()/2; i++) |
544 for(TInt i = 0; i < allDrivesStatus.Length()/2; i++) |
514 { |
545 { |
515 TInt driveNumber = allDrivesStatus[2*i]; |
546 TInt driveNumber = allDrivesStatus[2*i]; |
516 TInt driveStatus = allDrivesStatus[2*i+1]; |
547 TInt driveStatus = allDrivesStatus[2*i+1]; |
521 switch(driveStatus) |
552 switch(driveStatus) |
522 { |
553 { |
523 case EUsbMsDriveState_Disconnected: |
554 case EUsbMsDriveState_Disconnected: |
524 { |
555 { |
525 test.Printf(_L("%c:%d:Disconnected\n"), (char)driveLetter, driveStatus); |
556 test.Printf(_L("%c:%d:Disconnected\n"), (char)driveLetter, driveStatus); |
|
557 OstTraceExt2(TRACE_NORMAL, PROPERTYHANDLERS_DRIVESTATUS_DUP02, "%c:%d:Disconnected\n", (char)driveLetter, driveStatus); |
526 break; |
558 break; |
527 } |
559 } |
528 case EUsbMsDriveState_Connecting: |
560 case EUsbMsDriveState_Connecting: |
529 { |
561 { |
530 test.Printf(_L("%c:%d:Connecting\n"), (char)driveLetter, driveStatus); |
562 test.Printf(_L("%c:%d:Connecting\n"), (char)driveLetter, driveStatus); |
|
563 OstTraceExt2(TRACE_NORMAL, PROPERTYHANDLERS_DRIVESTATUS_DUP03, "%c:%d:Connecting\n", (char)driveLetter, driveStatus); |
531 break; |
564 break; |
532 } |
565 } |
533 case EUsbMsDriveState_Connected: |
566 case EUsbMsDriveState_Connected: |
534 { |
567 { |
535 test.Printf(_L("%c:%d:Connected\n"), (char)driveLetter, driveStatus); |
568 test.Printf(_L("%c:%d:Connected\n"), (char)driveLetter, driveStatus); |
|
569 OstTraceExt2(TRACE_NORMAL, PROPERTYHANDLERS_DRIVESTATUS_DUP04, "%c:%d:Connected\n", (char)driveLetter, driveStatus); |
536 break; |
570 break; |
537 } |
571 } |
538 case EUsbMsDriveState_Disconnecting: |
572 case EUsbMsDriveState_Disconnecting: |
539 { |
573 { |
540 test.Printf(_L("%c:%d:Disconnecting\n"), (char)driveLetter, driveStatus); |
574 test.Printf(_L("%c:%d:Disconnecting\n"), (char)driveLetter, driveStatus); |
|
575 OstTraceExt2(TRACE_NORMAL, PROPERTYHANDLERS_DRIVESTATUS_DUP05, "%c:%d:Disconnecting\n", (char)driveLetter, driveStatus); |
541 break; |
576 break; |
542 } |
577 } |
543 case EUsbMsDriveState_Active: |
578 case EUsbMsDriveState_Active: |
544 { |
579 { |
545 test.Printf(_L("%c:%d:Active\n"), (char)driveLetter, driveStatus); |
580 test.Printf(_L("%c:%d:Active\n"), (char)driveLetter, driveStatus); |
|
581 OstTraceExt2(TRACE_NORMAL, PROPERTYHANDLERS_DRIVESTATUS_DUP06, "%c:%d:Active\n", (char)driveLetter, driveStatus); |
546 break; |
582 break; |
547 } |
583 } |
548 case EUsbMsDriveState_Locked: |
584 case EUsbMsDriveState_Locked: |
549 { |
585 { |
550 test.Printf(_L("%c:%d:Locked\n"), (char)driveLetter, driveStatus); |
586 test.Printf(_L("%c:%d:Locked\n"), (char)driveLetter, driveStatus); |
|
587 OstTraceExt2(TRACE_NORMAL, PROPERTYHANDLERS_DRIVESTATUS_DUP07, "%c:%d:Locked\n", (char)driveLetter, driveStatus); |
551 break; |
588 break; |
552 } |
589 } |
553 case EUsbMsDriveState_MediaNotPresent: |
590 case EUsbMsDriveState_MediaNotPresent: |
554 { |
591 { |
555 test.Printf(_L("%c:%d:Not Present\n"), (char)driveLetter, driveStatus); |
592 test.Printf(_L("%c:%d:Not Present\n"), (char)driveLetter, driveStatus); |
|
593 OstTraceExt2(TRACE_NORMAL, PROPERTYHANDLERS_DRIVESTATUS_DUP08, "%c:%d:Not Present\n", (char)driveLetter, driveStatus); |
556 break; |
594 break; |
557 } |
595 } |
558 case EUsbMsDriveState_Removed: |
596 case EUsbMsDriveState_Removed: |
559 { |
597 { |
560 test.Printf(_L("%c:%d:Removed\n"), (char)driveLetter, driveStatus); |
598 test.Printf(_L("%c:%d:Removed\n"), (char)driveLetter, driveStatus); |
|
599 OstTraceExt2(TRACE_NORMAL, PROPERTYHANDLERS_DRIVESTATUS_DUP09, "%c:%d:Removed\n", (char)driveLetter, driveStatus); |
561 break; |
600 break; |
562 } |
601 } |
563 case EUsbMsDriveState_Error: |
602 case EUsbMsDriveState_Error: |
564 { |
603 { |
565 test.Printf(_L("%c:%d:Error\n"), (char)driveLetter, driveStatus); |
604 test.Printf(_L("%c:%d:Error\n"), (char)driveLetter, driveStatus); |
|
605 OstTraceExt2(TRACE_NORMAL, PROPERTYHANDLERS_DRIVESTATUS_DUP10, "%c:%d:Error\n", (char)driveLetter, driveStatus); |
566 break; |
606 break; |
567 } |
607 } |
568 default : |
608 default : |
569 { |
609 { |
570 test.Printf(_L("%c:%d:Unknown\n"), (char)driveLetter, driveStatus); |
610 test.Printf(_L("%c:%d:Unknown\n"), (char)driveLetter, driveStatus); |
|
611 OstTraceExt2(TRACE_NORMAL, PROPERTYHANDLERS_DRIVESTATUS_DUP11, "%c:%d:Unknown\n", (char)driveLetter, driveStatus); |
571 break; |
612 break; |
572 } |
613 } |
573 } |
614 } |
574 } |
615 } |
575 |
616 |
576 if (driveStatus == EUsbMsDriveState_Connected) |
617 if (driveStatus == EUsbMsDriveState_Connected) |
577 { |
618 { |
578 gActiveControl->SetMSFinished(EFalse); |
619 gActiveControl->SetMSFinished(EFalse); |
579 } |
620 } |
580 if (driveStatus == EUsbMsDriveState_Disconnected) |
621 if (driveStatus == EUsbMsDriveState_Disconnected) |
581 { |
622 { |
582 gActiveControl->SetMSFinished(ETrue); |
623 gActiveControl->SetMSFinished(ETrue); |
583 } |
624 } |
584 if(IsDriveInMountList(driveLetter)) |
625 if(IsDriveInMountList(driveLetter)) |
585 { |
626 { |
586 if (driveStatus == EUsbMsDriveState_Connecting) |
627 if (driveStatus == EUsbMsDriveState_Connecting) |
587 { |
628 { |