userlibandfileserver/fileserver/sfsrv/cl_debug.cpp
changeset 0 a41df078684a
equal deleted inserted replaced
-1:000000000000 0:a41df078684a
       
     1 // Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of the License "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 // f32\sfsrv\cl_debug.cpp
       
    15 // 
       
    16 //
       
    17 
       
    18 #include "cl_std.h"
       
    19 #include <f32dbg.h>
       
    20 
       
    21 
       
    22 EXPORT_C TInt RFs::LoaderHeapFunction(TInt, TAny *, TAny *)
       
    23 /**
       
    24 This member function is not implemented in this version of Symbian OS. It always returns KErrNotSupported.
       
    25 
       
    26 @param aFunction
       
    27 @param *aArg1
       
    28 @param *aArg2
       
    29 
       
    30 @return KErrNotSupported is returned always.
       
    31 
       
    32 */
       
    33 	{
       
    34 	return KErrNotSupported;
       
    35 	}
       
    36 
       
    37 
       
    38 #if defined(_DEBUG) || defined(_DEBUG_RELEASE)
       
    39 EXPORT_C TInt RFs::SetErrorCondition(TInt anError,TInt aCount)
       
    40 /**
       
    41 
       
    42 Sets the failure condition.
       
    43 
       
    44 This function can only be used in debug builds or if _DEBUG or _DEBUG_RELEASE is defined. In release build, this method is not implemented and it always returns KErrNotSupported.
       
    45 
       
    46 @param anError An error condition to be simulated
       
    47 @param aCount  An error condition is set after aCount instances of occurence.
       
    48 
       
    49 @return On completion, KErrNone if successful, otherwise one of the system wide error codes in debug builds.
       
    50         KErrNotSupported in release build.
       
    51 
       
    52 */
       
    53 	{
       
    54 	return(SendReceive(EFsDebugFunction,TIpcArgs(EFsSetErrorCondition,anError,aCount)));
       
    55 	}
       
    56 
       
    57 EXPORT_C TInt RFs::SetDebugRegister(TInt aVal)
       
    58 /**
       
    59 
       
    60 Sets the debug register to the given value.
       
    61 
       
    62 This function can only be used in debug builds or if _DEBUG or _DEBUG_RELEASE is defined. In release build, this method is not implemented and it always returns KErrNotSupported.
       
    63 
       
    64 @param aVal Value to be set
       
    65 
       
    66 @return On completion, KErrNone if successful, otherwise one of the system wide error codes in debug builds.
       
    67         KErrNotSupported in release build.
       
    68 
       
    69 */
       
    70 	{
       
    71 	return(SendReceive(EFsDebugFunction,TIpcArgs(EFsSetDebugRegister,aVal)));
       
    72 	}
       
    73 
       
    74 EXPORT_C TInt RFs::SetAllocFailure(TInt aAllocNum)
       
    75 /**
       
    76 
       
    77 Fails an allocation after aAllocNum successes.
       
    78 
       
    79 This function can only be used in debug builds or if _DEBUG or _DEBUG_RELEASE is defined. In release build, this method is not implemented and it always returns KErrNotSupported.
       
    80 
       
    81 @param aAllocNum Count after which allocation failure is expected.
       
    82 
       
    83 @return On completion, KErrNone if successful, otherwise one of the system wide error codes in debug builds.
       
    84         KErrNotSupported in release build.
       
    85 
       
    86 */
       
    87 	{
       
    88 	return(SendReceive(EFsDebugFunction,TIpcArgs(EFsSetAllocFailure,aAllocNum)));
       
    89 	}
       
    90 
       
    91 EXPORT_C void RFs::DebugNotify(TInt aDrive,TUint aNotifyType,TRequestStatus& aStat)
       
    92 /**
       
    93 
       
    94 Request notification of a file server event - file system specific.
       
    95 
       
    96 This function can only be used in debug builds or if _DEBUG or _DEBUG_RELEASE is defined. In release build, this method is not implemented and it always returns KErrNotSupported.
       
    97 
       
    98 @param aDrive      A drive on which the file server event notification is requested; this can be one of the values defined by TDriveNumber.
       
    99 @param aNotifyType A number identifying the event that should cause notification;
       
   100 @param aStat       The request status used to contain completion information for the function. On completion, contains a system-wide error code.
       
   101 
       
   102 @see RFs::TDriveNumber()
       
   103 @see TRequestStatus
       
   104 
       
   105 */
       
   106 	{
       
   107 	aStat=KRequestPending;
       
   108 	RSessionBase::SendReceive(EFsDebugFunction, TIpcArgs(EFsDebugNotify,aDrive,aNotifyType,&aStat), aStat);
       
   109 //	if (r!=KErrNone)
       
   110 //		{
       
   111 //		TRequestStatus* pStat=&aStat;
       
   112 //		User::RequestComplete(pStat,r);
       
   113 //		}
       
   114 	}
       
   115 
       
   116 
       
   117 #else
       
   118 EXPORT_C TInt RFs::SetErrorCondition(TInt,TInt)
       
   119 /**
       
   120 
       
   121 Sets the failure condition.
       
   122 
       
   123 This function can only be used in debug builds or if _DEBUG or _DEBUG_RELEASE is defined. In release build, this method is not implemented and it always returns KErrNotSupported.
       
   124 
       
   125 @param anError An error condition to be simulated
       
   126 @param aCount  An error condition is set after aCount instances of occurence.
       
   127 
       
   128 @return On completion, KErrNone if successful, otherwise one of the system wide error codes in debug builds.
       
   129         KErrNotSupported in release build.
       
   130 
       
   131 */
       
   132 	{
       
   133 	return KErrNotSupported;
       
   134 	}
       
   135 
       
   136 EXPORT_C TInt RFs::SetDebugRegister(TInt)
       
   137 /**
       
   138 
       
   139 Sets the debug register to the given value.
       
   140 
       
   141 This function can only be used in debug builds or if _DEBUG or _DEBUG_RELEASE is defined. In release build, this method is not implemented and it always returns KErrNotSupported.
       
   142 
       
   143 @param aVal Value to be set
       
   144 
       
   145 @return On completion, KErrNone if successful, otherwise one of the system wide error codes in debug builds.
       
   146         KErrNotSupported in release build.
       
   147 
       
   148 */
       
   149 	{
       
   150 	return KErrNotSupported;
       
   151 	}
       
   152 
       
   153 EXPORT_C TInt RFs::SetAllocFailure(TInt)
       
   154 /**
       
   155 
       
   156 Fails an allocation after aAllocNum successes.
       
   157 
       
   158 This function can only be used in debug builds or if _DEBUG or _DEBUG_RELEASE is defined. In release build, this method is not implemented and it always returns KErrNotSupported.
       
   159 
       
   160 @param aAllocNum Count after which allocation failure is expected.
       
   161 
       
   162 @return On completion, KErrNone if successful, otherwise one of the system wide error codes in debug builds.
       
   163         KErrNotSupported in release build.
       
   164 
       
   165 */
       
   166 	{
       
   167 	return KErrNotSupported;
       
   168 	}
       
   169 
       
   170 EXPORT_C void RFs::DebugNotify(TInt,TUint,TRequestStatus& aStat)
       
   171 /**
       
   172 
       
   173 Request notification of a file server event - file system specific.
       
   174 
       
   175 This function can only be used in debug builds or if _DEBUG or _DEBUG_RELEASE is defined. In release build, this method is not implemented and it always returns KErrNotSupported.
       
   176 
       
   177 @param aDrive           A drive on which the file server event notification is requested; this can be one of the values defined by TDriveNumber.
       
   178 @param aNotifyType     A number identifying the event that should cause notification;
       
   179 @param aStat The request status used to contain completion information for the function. On completion, contains a system-wide error code.
       
   180 
       
   181 @see RFs::TDriveNumber()
       
   182 @see TRequestStatus
       
   183 
       
   184 */
       
   185 	{
       
   186 	TRequestStatus* pStat=&aStat;
       
   187 	User::RequestComplete(pStat,KErrNotSupported);
       
   188 	}
       
   189 #endif
       
   190 
       
   191 
       
   192 #if defined(_USE_CONTROLIO) || defined(_DEBUG) || defined(_DEBUG_RELEASE)
       
   193 
       
   194 EXPORT_C TInt RFs::ControlIo(TInt aDrive,TInt aCommand)
       
   195 /**
       
   196 
       
   197 General purpose test interface - file system specific.
       
   198 
       
   199 This function can only be used in debug builds or if _USE_CONTROLIO, _DEBUG or _DEBUG_RELEASE is defined. In release build, this method is not implemented and it always returns KErrNotSupported.
       
   200 
       
   201 There are drive specific and non-drive specific commands. Following are non-drive specific commands
       
   202 
       
   203 @param aDrive    A drive on which aCommand is to be executed; this can be one of the values defined by TDriveNumber.
       
   204 @param aCommand  A command to be executed, specific to the file system implementation.
       
   205 
       
   206 @return On completion, KErrNone if successful, otherwise one of the system wide error codes in debug builds.
       
   207         KErrNotSupported in release build.
       
   208 
       
   209 @see RFs::TDriveNumber()
       
   210 
       
   211 */
       
   212 	{
       
   213 	return(SendReceive(EFsControlIo,TIpcArgs(aDrive,aCommand)));
       
   214 	}
       
   215 
       
   216 EXPORT_C TInt RFs::ControlIo(TInt aDrive,TInt aCommand,TDes8& aParam1)
       
   217 /**
       
   218 
       
   219 General purpose test interface - file system specific.
       
   220 
       
   221 This function can only be used in debug builds or if _USE_CONTROLIO, _DEBUG or _DEBUG_RELEASE is defined. In release build, this method is not implemented and it always returns KErrNotSupported.
       
   222 
       
   223 @param aDrive    A drive on which aCommand is to be executed; this can be one of the values defined by TDriveNumber.
       
   224 @param aCommand  A command to be executed, specific to the file system implementation.
       
   225 @param aParam1 Placeholder for a parameter, specific to the file system implementation.
       
   226 
       
   227 @return TInt On completion, KErrNone if successful, otherwise one of the system wide error codes in debug builds.
       
   228              KErrNotSupported in release build.
       
   229 
       
   230 @see RFs::TDriveNumber()
       
   231 
       
   232 */
       
   233 	{
       
   234 	return(SendReceive(EFsControlIo,TIpcArgs(aDrive,aCommand,&aParam1)));
       
   235 	}
       
   236 
       
   237 EXPORT_C TInt RFs::ControlIo(TInt aDrive,TInt aCommand,TDes8& aParam1,TDes8& aParam2)
       
   238 /**
       
   239 
       
   240 General purpose test interface - file system specific.
       
   241 
       
   242 This function can only be used in debug builds or if _USE_CONTROLIO, _DEBUG or _DEBUG_RELEASE is defined. In release build, this method is not implemented and it always returns KErrNotSupported.
       
   243 
       
   244 @param aDrive    A drive on which aCommand is to be executed; this can be one of the values defined by TDriveNumber.
       
   245 @param aCommand  A command to be executed, specific to the file system implementation.
       
   246 @param aParam1 Placeholder for a parameter, specific to the file system implementation.
       
   247 @param aParam2 Placeholder for a parameter, specific to the file system implementation.
       
   248 
       
   249 @return On completion, KErrNone if successful, otherwise one of the system wide error codes in debug builds.
       
   250         KErrNotSupported in release build.
       
   251 
       
   252 @see RFs::TDriveNumber()
       
   253 
       
   254 */
       
   255 	{
       
   256 	return(SendReceive(EFsControlIo,TIpcArgs(aDrive,aCommand,&aParam1,&aParam2)));
       
   257 	}
       
   258 
       
   259 EXPORT_C TInt RFs::ControlIo(TInt aDrive,TInt aCommand,TAny* aParam1,TAny* aParam2)
       
   260 /**
       
   261 
       
   262 General purpose test interface - file system specific.
       
   263 
       
   264 This function can only be used in debug builds or if _USE_CONTROLIO, _DEBUG or _DEBUG_RELEASE is defined. In release build, this method is not implemented and it always returns KErrNotSupported.
       
   265 
       
   266 @param aDrive   A drive on which aCommand is to be executed; this can be one of the values defined by TDriveNumber.
       
   267 @param aCommand A command to be executed, specific to the file system implementation.
       
   268 @param aParam1 Placeholder for a parameter, specific to the file system implementation.
       
   269 @param aParam2 Placeholder for a parameter, specific to the file system implementation.
       
   270 
       
   271 @return On completion, KErrNone if successful, otherwise one of the system wide error codes in debug builds.
       
   272         KErrNotSupported in release build.
       
   273 
       
   274 @see RFs::TDriveNumber()
       
   275 
       
   276 */
       
   277 	{
       
   278 	return(SendReceive(EFsControlIo,TIpcArgs(aDrive,aCommand,aParam1,aParam2)));
       
   279 	}
       
   280 
       
   281 #else
       
   282 EXPORT_C TInt RFs::ControlIo(TInt,TInt)
       
   283 /**
       
   284 
       
   285 General purpose test interface - file system specific.
       
   286 
       
   287 This function can only be used in debug builds or if _USE_CONTROLIO, _DEBUG or _DEBUG_RELEASE is defined. In release build, this method is not implemented and it always returns KErrNotSupported.
       
   288 
       
   289 There are drive specific and non-drive specific commands. Following are non-drive specific commands
       
   290 
       
   291 @param aDrive    A drive on which aCommand is to be executed; this can be one of the values defined by TDriveNumber.
       
   292 @param aCommand  A command to be executed, specific to the file system implementation.
       
   293 
       
   294 @return On completion, KErrNone if successful, otherwise one of the system wide error codes in debug builds.
       
   295         KErrNotSupported in release build.
       
   296 
       
   297 @see RFs::TDriveNumber()
       
   298 
       
   299 */
       
   300 	{
       
   301 	return KErrNotSupported;
       
   302 	}
       
   303 
       
   304 EXPORT_C TInt RFs::ControlIo(TInt,TInt,TDes8&)
       
   305 /**
       
   306 
       
   307 General purpose test interface - file system specific.
       
   308 
       
   309 This function can only be used in debug builds or if _USE_CONTROLIO, _DEBUG or _DEBUG_RELEASE is defined. In release build, this method is not implemented and it always returns KErrNotSupported.
       
   310 
       
   311 @param aDrive    A drive on which aCommand is to be executed; this can be one of the values defined by TDriveNumber.
       
   312 @param aCommand  A command to be executed, specific to the file system implementation.
       
   313 @param aParam1 Placeholder for a parameter, specific to the file system implementation.
       
   314 
       
   315 @return On completion, KErrNone if successful, otherwise one of the system wide error codes in debug builds.
       
   316         KErrNotSupported in release build.
       
   317 
       
   318 @see RFs::TDriveNumber()
       
   319 
       
   320 */
       
   321 	{
       
   322 	return KErrNotSupported;
       
   323 	}
       
   324 
       
   325 EXPORT_C TInt RFs::ControlIo(TInt,TInt,TDes8&,TDes8&)
       
   326 /**
       
   327 
       
   328 General purpose test interface - file system specific.
       
   329 
       
   330 This function can only be used in debug builds or if _USE_CONTROLIO, _DEBUG or _DEBUG_RELEASE is defined. In release build, this method is not implemented and it always returns KErrNotSupported.
       
   331 
       
   332 @param aDrive    A drive on which aCommand is to be executed; this can be one of the values defined by TDriveNumber.
       
   333 @param aCommand  A command to be executed, specific to the file system implementation.
       
   334 @param aParam1 Placeholder for a parameter, specific to the file system implementation.
       
   335 @param aParam2 Placeholder for a parameter, specific to the file system implementation.
       
   336 
       
   337 @return On completion, KErrNone if successful, otherwise one of the system wide error codes in debug builds.
       
   338         KErrNotSupported in release build.
       
   339 
       
   340 @see RFs::TDriveNumber()
       
   341 
       
   342 */
       
   343 	{
       
   344 	return KErrNotSupported;
       
   345 	}
       
   346 
       
   347 EXPORT_C TInt RFs::ControlIo(TInt,TInt,TAny*,TAny*)
       
   348 /**
       
   349 
       
   350 General purpose test interface - file system specific.
       
   351 
       
   352 This function can only be used in debug builds or if _USE_CONTROLIO, _DEBUG or _DEBUG_RELEASE is defined. In release build, this method is not implemented and it always returns KErrNotSupported.
       
   353 
       
   354 @param aDrive   A drive on which aCommand is to be executed; this can be one of the values defined by TDriveNumber.
       
   355 @param aCommand A command to be executed, specific to the file system implementation.
       
   356 @param aParam1 Placeholder for a parameter, specific to the file system implementation.
       
   357 @param aParam2 Placeholder for a parameter, specific to the file system implementation.
       
   358 
       
   359 @return On completion, KErrNone if successful, otherwise one of the system wide error codes in debug builds.
       
   360         KErrNotSupported in release build.
       
   361 
       
   362 @see RFs::TDriveNumber()
       
   363 
       
   364 */
       
   365 	{
       
   366 	return KErrNotSupported;
       
   367 	}
       
   368 #endif