baseport/syborg/svphostfs/fs/rsvphostfsdriver.cpp
changeset 15 5fca9e46c6fa
parent 2 d55eb581a87c
equal deleted inserted replaced
14:e6ebb7730c4b 15:5fca9e46c6fa
     8 *
     8 *
     9 * Initial Contributors:
     9 * Initial Contributors:
    10 * Nokia Corporation - initial contribution.
    10 * Nokia Corporation - initial contribution.
    11 *
    11 *
    12 * Contributors:
    12 * Contributors:
       
    13 * Sosco - bug fixes
    13 *
    14 *
    14 * Description:
    15 * Description:
    15 *
    16 *
    16 */
    17 */
    17 
    18 
    90 	}
    91 	}
    91 
    92 
    92 TInt RSVPHostFsDriver::FileClose(TUint32 aDrive, TUint32 aHandle)
    93 TInt RSVPHostFsDriver::FileClose(TUint32 aDrive, TUint32 aHandle)
    93 	{
    94 	{
    94 	DP(_L("** (rsvphostfsdriver.cpp) RSVPHostFsDriver::FileClose()"));
    95 	DP(_L("** (rsvphostfsdriver.cpp) RSVPHostFsDriver::FileClose()"));
       
    96 
       
    97 	// If attempt is made to access a file which does
       
    98 	// not exist, it will not give a handle to close afterwards.
       
    99 	// Attempting to call FileClose on this with an invalid handle
       
   100 	// results in the error code KErrBadHandle (-8) being returned.
       
   101 	// Some UI's cannot cope properly with this error code, resulting
       
   102 	// in various servers repeatedly closing and reopening. To prevent
       
   103 	// this,we trap it here and return KErrNone as though the call
       
   104 	// completed properly without error.
       
   105 	if (aHandle == 0)  
       
   106 	  return KErrNone; // Bad handle, so exit immediately with KErrNone
       
   107 	else
       
   108 
    95 	return DoSVPRequest(EFileClose, (TAny *)aDrive, (TAny *)aHandle);
   109 	return DoSVPRequest(EFileClose, (TAny *)aDrive, (TAny *)aHandle);
    96 	}
   110 	}
    97 
   111 
    98 TInt RSVPHostFsDriver::FileRead(TSVPHostFsFileReadInfo& aInfo)
   112 TInt RSVPHostFsDriver::FileRead(TSVPHostFsFileReadInfo& aInfo)
    99 	{
   113 	{
   138 	}
   152 	}
   139 
   153 
   140 TInt RSVPHostFsDriver::DirClose(TUint32 aDrive, TUint32 aHandle)
   154 TInt RSVPHostFsDriver::DirClose(TUint32 aDrive, TUint32 aHandle)
   141 	{
   155 	{
   142 	DP(_L("** (rsvphostfsdriver.cpp) RSVPHostFsDriver::DirClose()"));
   156 	DP(_L("** (rsvphostfsdriver.cpp) RSVPHostFsDriver::DirClose()"));
       
   157 
       
   158 
       
   159 	// If attempt is made to read a directory which does
       
   160 	// not exist, it will not give a handle to close afterwards.
       
   161 	// Attempting to call DirClose on this with an invalid handle
       
   162 	// results in the error code KErrBadHandle (-8) being returned.
       
   163 	// Some UI's cannot cope properly with this error code, resulting
       
   164 	// in various servers repeatedly closing and reopening. To prevent
       
   165 	// this,we trap it here and return KErrNone as though the call
       
   166 	// completed properly without error.
       
   167 	if (aHandle == 0)  
       
   168 	  return KErrNone; // Bad handle, so exit immediately with KErrNone
       
   169 	else
       
   170 
   143 	return DoSVPRequest(EDirClose, (TAny *)aDrive, (TAny *)aHandle);
   171 	return DoSVPRequest(EDirClose, (TAny *)aDrive, (TAny *)aHandle);
   144 	}
   172 	}
   145 
   173 
   146 TInt RSVPHostFsDriver::DirRead(TSVPHostFsDirReadInfo& aInfo)
   174 TInt RSVPHostFsDriver::DirRead(TSVPHostFsDirReadInfo& aInfo)
   147 	{
   175 	{