userlibandfileserver/fileserver/sfile/sf_dir.cpp
branchRCL_3
changeset 44 3e88ff8f41d5
parent 43 c1f20ce4abcf
equal deleted inserted replaced
43:c1f20ce4abcf 44:3e88ff8f41d5
    14 // f32\sfile\sf_dir.cpp
    14 // f32\sfile\sf_dir.cpp
    15 // 
    15 // 
    16 //
    16 //
    17 
    17 
    18 #include "sf_std.h"
    18 #include "sf_std.h"
    19 
       
    20 #ifdef OST_TRACE_COMPILER_IN_USE
       
    21 #include "sf_dirTraces.h"
       
    22 #endif
       
    23 
    19 
    24 LOCAL_C CDirCB* GetDirFromHandle(TInt aHandle,CSessionFs* aSession)
    20 LOCAL_C CDirCB* GetDirFromHandle(TInt aHandle,CSessionFs* aSession)
    25 //
    21 //
    26 // Get the dir control block from its handle.
    22 // Get the dir control block from its handle.
    27 //
    23 //
    54 
    50 
    55 	FOREVER
    51 	FOREVER
    56 		{
    52 		{
    57 		TEntry e;
    53 		TEntry e;
    58 
    54 
    59 		OstTrace1(TRACE_FILESYSTEM, FSYS_ECDIRCBREADL2, "fsDirReadPacked this %x", &aDir);
    55 		TRACE1(UTF::EBorder, UTraceModuleFileSys::ECDirCBReadL, EF32TraceUidFileSys, &aDir);
    60 		aDir.ReadL(e);
    56 		aDir.ReadL(e);
    61 		OstTraceExt5(TRACE_FILESYSTEM, FSYS_ECDIRCBREADL2RET, "fsDirReadPacked r %d att %x modified %x:%x  size %d", (TUint) KErrNone, (TUint) e.iAtt, (TUint) I64HIGH(e.iModified.Int64()), (TUint) I64LOW(e.iModified.Int64()), (TUint) e.iSize);
    57 		TRACE5(UTF::EBorder, UTraceModuleFileSys::ECDirCBReadLRet, EF32TraceUidFileSys, 
       
    58 			KErrNone, e.iAtt, I64LOW(e.iModified.Int64()), I64HIGH(e.iModified.Int64()), e.iSize);
    62 		TInt len=EntrySize(e, EFalse);
    59 		TInt len=EntrySize(e, EFalse);
    63 		TInt rLen=EntrySize(e, ETrue);
    60 		TInt rLen=EntrySize(e, ETrue);
    64 		TEntry* pX=PtrAdd(pE,rLen);
    61 		TEntry* pX=PtrAdd(pE,rLen);
    65 		if (pX>pEnd)
    62 		if (pX>pEnd)
    66 			{
    63 			{
    67 
    64 
    68 			OstTrace1(TRACE_FILESYSTEM, FSYS_ECDIRCBSTORELONGENTRYNAMEL, "fsDirReadPacked this %x", &aDir);
    65 			TRACE1(UTF::EBorder, UTraceModuleFileSys::ECDirCBStoreLongEntryNameL, EF32TraceUidFileSys, &aDir);
    69 			aDir.StoreLongEntryNameL(e.iName);
    66 			aDir.StoreLongEntryNameL(e.iName);
    70 			OstTrace1(TRACE_FILESYSTEM, FSYS_ECDIRCBSTORELONGENTRYNAMELRET, "fsDirReadPacked r %d", KErrNone);
    67 			TRACE1(UTF::EBorder, UTraceModuleFileSys::ECDirCBStoreLongEntryNameLRet, EF32TraceUidFileSys, KErrNone);
    71 
    68 
    72 			aDir.SetPending(ETrue);
    69 			aDir.SetPending(ETrue);
    73 			break;
    70 			break;
    74 			}
    71 			}
    75 		aLen+=rLen;
    72 		aLen+=rLen;
   114 	//DirRead does not have a filename / src stored, so if there are plugins installed which
   111 	//DirRead does not have a filename / src stored, so if there are plugins installed which
   115 	//wish to intercept dirread1/packed then store the name in CDirCB::iName now.
   112 	//wish to intercept dirread1/packed then store the name in CDirCB::iName now.
   116 	CFsPlugin* plugin = NULL;
   113 	CFsPlugin* plugin = NULL;
   117 	//Get the next plugin which is mounted on this drive (IsMounted called in NextPlugin)
   114 	//Get the next plugin which is mounted on this drive (IsMounted called in NextPlugin)
   118 	//Do not check whether we're registered for current operation (in case not registered for EFsDirOpen)
   115 	//Do not check whether we're registered for current operation (in case not registered for EFsDirOpen)
   119 	FsPluginManager::ReadLockChain();                                      //!Check operation
   116 	while(FsPluginManager::NextPlugin(plugin,(CFsMessageRequest*)aRequest,(TBool)ETrue,(TBool)EFalse)==KErrNone && plugin)
   120 	while(FsPluginManager::NextPlugin(plugin,(CFsMessageRequest*)aRequest,(TBool)EFalse)==KErrNone && plugin)
       
   121 		{
   117 		{
   122 		if(plugin->IsRegistered(EFsDirReadOne) ||
   118 		if(plugin->IsRegistered(EFsDirReadOne) ||
   123 			plugin->IsRegistered(EFsDirReadPacked) ||
   119 			plugin->IsRegistered(EFsDirReadPacked) ||
   124 			plugin->IsRegistered(EFsDirSubClose))
   120 			plugin->IsRegistered(EFsDirSubClose))
   125 			{
   121 			{
   128 			r = dir->SetName(&name);
   124 			r = dir->SetName(&name);
   129 			CheckForLeaveAfterOpenL(r, aRequest, h);
   125 			CheckForLeaveAfterOpenL(r, aRequest, h);
   130 			break;
   126 			break;
   131 			}
   127 			}
   132 		}
   128 		}
   133 	FsPluginManager::UnlockChain();
       
   134 	
   129 	
   135 	TPtrC8 pH((TUint8*)&h,sizeof(TInt));
   130 	TPtrC8 pH((TUint8*)&h,sizeof(TInt));
   136 	TRAP(r,aRequest->WriteL(KMsgPtr3,pH))
   131 	TRAP(r,aRequest->WriteL(KMsgPtr3,pH))
   137 	CheckForLeaveAfterOpenL(r, aRequest, h);
   132 	CheckForLeaveAfterOpenL(r, aRequest, h);
   138 	aRequest->Session()->IncResourceCount();
   133 	aRequest->Session()->IncResourceCount();
   166 	TInt r=dir->CheckMount();
   161 	TInt r=dir->CheckMount();
   167 	if (r!=KErrNone)
   162 	if (r!=KErrNone)
   168 		return(r);
   163 		return(r);
   169 	TEntry e;
   164 	TEntry e;
   170 
   165 
   171 	OstTrace1(TRACE_FILESYSTEM, FSYS_ECDIRCBREADL1, "this %x", &dir);
   166 	TRACE1(UTF::EBorder, UTraceModuleFileSys::ECDirCBReadL, EF32TraceUidFileSys, &dir);
   172 	TRAP(r,dir->ReadL(e))
   167 	TRAP(r,dir->ReadL(e))
   173 	OstTraceExt5(TRACE_FILESYSTEM, FSYS_ECDIRCBREADL1RET, "r %d att %x modified %x:%x  size %d", (TUint) KErrNone, (TUint) e.iAtt, (TUint) I64HIGH(e.iModified.Int64()), (TUint) I64LOW(e.iModified.Int64()), (TUint) e.iSize);
   168 	TRACE5(UTF::EBorder, UTraceModuleFileSys::ECDirCBReadLRet, EF32TraceUidFileSys, 
   174 		
   169 		KErrNone, e.iAtt, I64LOW(e.iModified.Int64()), I64HIGH(e.iModified.Int64()), e.iSize);
   175 
   170 
   176 
   171 
   177 	if (r==KErrNone)
   172 	if (r==KErrNone)
   178 		{
   173 		{
   179 		TPckgC<TEntry> pE(e);
   174 		TPckgC<TEntry> pE(e);