baseport/syborg/svphostfs/driver/svphostfsdriver.cpp
changeset 15 5fca9e46c6fa
parent 2 d55eb581a87c
equal deleted inserted replaced
14:e6ebb7730c4b 15:5fca9e46c6fa
   414 			}
   414 			}
   415 		}
   415 		}
   416 	
   416 	
   417 	if (KErrNone != err)
   417 	if (KErrNone != err)
   418 		{
   418 		{
   419 		DP("Error %d from DoRequest", err);
   419 
       
   420 		if (err == KErrNotSupported)
       
   421 			{
       
   422 			err = KErrNone; // trap KErrNotSupported
       
   423 			}
       
   424 				
       
   425 		DP("Error %d from DoRequest %d", err, aReqNo);
       
   426 
   420 		}
   427 		}
   421 	
   428 	
   422 	return err;
   429 	return err;
   423 	}
   430 	}
   424 
   431 
   435 
   442 
   436 	/* There should be a good reason to use a control rather than a request. */
   443 	/* There should be a good reason to use a control rather than a request. */
   437 
   444 
   438 	if (KErrNone != err)
   445 	if (KErrNone != err)
   439 		{
   446 		{
       
   447 
       
   448 		if (err == KErrNotSupported)
       
   449 			{
       
   450 			err = KErrNone; // trap KErrNotSupported
       
   451 			}
       
   452 
   440 		DP("** (SVPHOSTFSDRIVER) Error %d from control function", err);
   453 		DP("** (SVPHOSTFSDRIVER) Error %d from control function", err);
   441 		}
   454 		}
   442 	
   455 	
   443 	return err;
   456 	return err;
   444 	}
   457 	}
   499 	SVPWriteReg(device, EArg0, Epoc::LinearToPhysical((TUint32)pathData));
   512 	SVPWriteReg(device, EArg0, Epoc::LinearToPhysical((TUint32)pathData));
   500 	SVPWriteReg(device, EArg1, info.iLength);
   513 	SVPWriteReg(device, EArg1, info.iLength);
   501 	SVPWriteReg(device, EArg2, info.iFlags);
   514 	SVPWriteReg(device, EArg2, info.iFlags);
   502 	SVPInvoke(device, RSVPHostFsDriver::EMkDir);
   515 	SVPInvoke(device, RSVPHostFsDriver::EMkDir);
   503 
   516 
   504 	return SVPReadReg(device, EResult);
   517 
       
   518 	//return SVPReadReg(device, EResult);
       
   519 	
       
   520 	err = SVPReadReg(device, EResult);
       
   521 	
       
   522 	if(err == KErrPathNotFound)
       
   523 		err = KErrNotFound;
       
   524 	
       
   525 	return err;
       
   526 
   505 
   527 
   506 	}
   528 	}
   507 
   529 
   508 TInt DSVPHostFsChannel::RmDir(TSVPHostFsRmDirInfo* aInfo)
   530 TInt DSVPHostFsChannel::RmDir(TSVPHostFsRmDirInfo* aInfo)
   509 	{
   531 	{
   635 	TUint32 device = iDriveMap[info.iDrive];
   657 	TUint32 device = iDriveMap[info.iDrive];
   636 	SVPWriteReg(device, EArg0, Epoc::LinearToPhysical((TUint32)pathData));
   658 	SVPWriteReg(device, EArg0, Epoc::LinearToPhysical((TUint32)pathData));
   637 	SVPWriteReg(device, EArg1, info.iLength);
   659 	SVPWriteReg(device, EArg1, info.iLength);
   638 	SVPInvoke(device, RSVPHostFsDriver::EEntry);
   660 	SVPInvoke(device, RSVPHostFsDriver::EEntry);
   639 
   661 
   640 	RET_IF_ERROR(err, SVPReadReg(device, EResult));
   662 
       
   663 	//RET_IF_ERROR(err, SVPReadReg(device, EResult));
       
   664 	
       
   665 	err = SVPReadReg(device, EResult);
       
   666 	
       
   667 	if(err!=KErrNone)
       
   668 		{
       
   669 		if(err == KErrPathNotFound)
       
   670 			err = KErrNotFound;
       
   671 		
       
   672 		return err;
       
   673 		}
       
   674 
       
   675 	
   641 
   676 
   642 	TUint32 att = SVPReadReg(device, EArg0);
   677 	TUint32 att = SVPReadReg(device, EArg0);
   643 	TUint32 modified = SVPReadReg(device, EArg1);
   678 	TUint32 modified = SVPReadReg(device, EArg1);
   644 	TUint32 filesize = SVPReadReg(device, EArg2);
   679 	TUint32 filesize = SVPReadReg(device, EArg2);
   645 	// TODO: Yuk! Hack alert! Say EWindows for now. But really should probably say EUnknown,
   680 	// TODO: Yuk! Hack alert! Say EWindows for now. But really should probably say EUnknown,
   688 	TUint32 device = iDriveMap[info.iDrive];
   723 	TUint32 device = iDriveMap[info.iDrive];
   689 	SVPWriteReg(device, EArg0, Epoc::LinearToPhysical((TUint32)pathData));
   724 	SVPWriteReg(device, EArg0, Epoc::LinearToPhysical((TUint32)pathData));
   690 	SVPWriteReg(device, EArg1, info.iLength);
   725 	SVPWriteReg(device, EArg1, info.iLength);
   691 	SVPInvoke(device, RSVPHostFsDriver::EDirOpen);
   726 	SVPInvoke(device, RSVPHostFsDriver::EDirOpen);
   692 
   727 
   693 	RET_IF_ERROR(err, SVPReadReg(device, EResult));
   728 
       
   729 	//RET_IF_ERROR(err, SVPReadReg(device, EResult));
       
   730 	
       
   731 	err = SVPReadReg(device, EResult);
       
   732 	
       
   733 	if(err!=KErrNone)
       
   734 		{
       
   735 		
       
   736 		if(err==KErrPathNotFound)
       
   737 			err=KErrNotFound;
       
   738 		
       
   739 		return err;
       
   740 		}
       
   741 
   694 
   742 
   695 	// handle is in arg 0
   743 	// handle is in arg 0
   696 	TUint32 handle = SVPReadReg(device, EArg0);
   744 	TUint32 handle = SVPReadReg(device, EArg0);
   697 	return Kern::ThreadRawWrite(iClientThread, &aInfo->iHandle, (TUint8*)&handle, sizeof(handle));
   745 	return Kern::ThreadRawWrite(iClientThread, &aInfo->iHandle, (TUint8*)&handle, sizeof(handle));
   698 	}
   746 	}
   717 	SVPWriteReg(device, EArg1, info.iLength);
   765 	SVPWriteReg(device, EArg1, info.iLength);
   718 	SVPWriteReg(device, EArg2, info.iMode);
   766 	SVPWriteReg(device, EArg2, info.iMode);
   719 	SVPWriteReg(device, EArg3, info.iOpen);
   767 	SVPWriteReg(device, EArg3, info.iOpen);
   720 	SVPInvoke(device, RSVPHostFsDriver::EFileOpen);
   768 	SVPInvoke(device, RSVPHostFsDriver::EFileOpen);
   721 
   769 
   722 	RET_IF_ERROR(err, SVPReadReg(device, EResult));
   770 
       
   771 	//RET_IF_ERROR(err, SVPReadReg(device, EResult));
       
   772 	
       
   773 	err = SVPReadReg(device, EResult);
       
   774 		
       
   775 	if(err!=KErrNone)
       
   776 		{
       
   777 		if(err == KErrPathNotFound)
       
   778 			err = KErrNotFound;
       
   779 		
       
   780 		return err;
       
   781 		}
       
   782 
       
   783 	
   723 
   784 
   724 	TUint32 handle = SVPReadReg(device, EArg0);
   785 	TUint32 handle = SVPReadReg(device, EArg0);
   725 	TUint32 att = SVPReadReg(device, EArg1);
   786 	TUint32 att = SVPReadReg(device, EArg1);
   726 	TUint32 modified = SVPReadReg(device, EArg2);
   787 	TUint32 modified = SVPReadReg(device, EArg2);
   727 	TUint32 size = SVPReadReg(device, EArg3);
   788 	TUint32 size = SVPReadReg(device, EArg3);
   795 	SVPWriteReg(device, EArg1, info.iPos);	
   856 	SVPWriteReg(device, EArg1, info.iPos);	
   796 	SVPWriteReg(device, EArg2, Epoc::LinearToPhysical((TUint32)buf));
   857 	SVPWriteReg(device, EArg2, Epoc::LinearToPhysical((TUint32)buf));
   797 	SVPWriteReg(device, EArg3, info.iLength);	
   858 	SVPWriteReg(device, EArg3, info.iLength);	
   798 	SVPInvoke(device, RSVPHostFsDriver::EFileWrite);
   859 	SVPInvoke(device, RSVPHostFsDriver::EFileWrite);
   799 
   860 
   800 	RET_IF_ERROR(err, SVPReadReg(device, EResult));
   861 
       
   862 	// RET_IF_ERROR(err, SVPReadReg(device, EResult));
       
   863 	
       
   864 	err = SVPReadReg(device, EResult);
       
   865 	
       
   866 	if(err!=KErrNone)
       
   867 		{
       
   868 		if(err == KErrPathNotFound)
       
   869 			err = KErrNotFound;
       
   870 		
       
   871 		return err;
       
   872 		}
       
   873 
       
   874 	
   801 
   875 
   802 	TUint32 len = SVPReadReg(device, EArg0);
   876 	TUint32 len = SVPReadReg(device, EArg0);
   803 
   877 
   804 	DP("** (SVPHOSTFSDRIVER)  Wrote %d bytes", len);
   878 	DP("** (SVPHOSTFSDRIVER)  Wrote %d bytes", len);
   805 
   879 
   829 
   903 
   830 TInt DSVPHostFsChannel::FileSetEntry(TSVPHostFsSetEntryInfo* aInfo)
   904 TInt DSVPHostFsChannel::FileSetEntry(TSVPHostFsSetEntryInfo* aInfo)
   831 	{
   905 	{
   832         DP("** (SVPHOSTFSDRIVER) DSVPHostFsChannel::FileSetEntry()");
   906         DP("** (SVPHOSTFSDRIVER) DSVPHostFsChannel::FileSetEntry()");
   833 
   907 
   834 	return KErrNotSupported;
   908 
       
   909 	return KErrNone;
       
   910 
   835 	}
   911 	}
   836 
   912 
   837 TInt DSVPHostFsChannel::DirClose(TUint32 aDrive, TUint32 aHandle)
   913 TInt DSVPHostFsChannel::DirClose(TUint32 aDrive, TUint32 aHandle)
   838 	{
   914 	{
   839         DP("** (SVPHOSTFSDRIVER) DSVPHostFsChannel::DirClose()");
   915         DP("** (SVPHOSTFSDRIVER) DSVPHostFsChannel::DirClose()");