author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Tue, 31 Aug 2010 16:34:26 +0300 | |
branch | RCL_3 |
changeset 43 | c1f20ce4abcf |
parent 0 | a41df078684a |
child 44 | 3e88ff8f41d5 |
permissions | -rw-r--r-- |
0 | 1 |
// Copyright (c) 1995-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\sfile\sf_fmt.cpp |
|
15 |
// |
|
16 |
// |
|
17 |
||
18 |
#include "sf_std.h" |
|
19 |
||
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
20 |
#ifdef OST_TRACE_COMPILER_IN_USE |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
21 |
#include "sf_fmtTraces.h" |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
22 |
#endif |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
23 |
|
0 | 24 |
LOCAL_C CFormatCB* GetFormatFromHandle(TInt aHandle,CSessionFs* aSession) |
25 |
// |
|
26 |
// Get the format control block from aHandle |
|
27 |
// |
|
28 |
{ |
|
29 |
return((CFormatCB*)(SessionObjectFromHandle(aHandle,Formats->UniqueID(),aSession))); |
|
30 |
} |
|
31 |
||
32 |
||
33 |
||
34 |
/** |
|
35 |
Default constructor. |
|
36 |
*/ |
|
37 |
EXPORT_C CFormatCB::CFormatCB() |
|
38 |
{ |
|
39 |
} |
|
40 |
||
41 |
||
42 |
||
43 |
||
44 |
/** |
|
45 |
Destructor. |
|
46 |
Frees resources before destruction of the object. |
|
47 |
*/ |
|
48 |
EXPORT_C CFormatCB::~CFormatCB() |
|
49 |
{ |
|
50 |
||
51 |
if (iMount) |
|
52 |
{ |
|
53 |
RemoveDiskAccess(*iMount); |
|
54 |
iMount->Drive().SetChanged(ETrue); |
|
55 |
iMount->Close(); |
|
56 |
} |
|
57 |
} |
|
58 |
||
59 |
||
60 |
||
61 |
||
62 |
/** |
|
63 |
Checks that the disk media is still mounted. |
|
64 |
@return KErrNone if the media is still mounted; KErrDisMounted otherwise. |
|
65 |
*/ |
|
66 |
EXPORT_C TInt CFormatCB::CheckMount() |
|
67 |
{ |
|
68 |
||
69 |
TDrive& d=Drive(); |
|
70 |
TInt r=d.CheckMount(); |
|
71 |
if (r!=KErrNone) |
|
72 |
return(r); |
|
73 |
if (&Mount()!=&d.CurrentMount()) |
|
74 |
return(KErrDisMounted); |
|
75 |
return(KErrNone); |
|
76 |
} |
|
77 |
||
78 |
void CFormatCB::InitL(TDrive* aDrive,TFormatMode aMode) |
|
79 |
{ |
|
80 |
DoInitL(aDrive->DriveNumber()); |
|
81 |
iDrive=aDrive; |
|
82 |
iMount=&iDrive->CurrentMount(); |
|
83 |
iMode=aMode; |
|
84 |
User::LeaveIfError(iMount->Open()); |
|
85 |
} |
|
86 |
||
87 |
||
88 |
EXPORT_C TInt CFormatCB::GetInterface(TInt /*aInterfaceId*/,TAny*& /*aInterface*/,TAny* /*aInput*/) |
|
89 |
{ |
|
90 |
return(KErrNotSupported); |
|
91 |
} |
|
92 |
||
93 |
||
94 |
//---------------------------------------------------------------------------- |
|
95 |
/** |
|
96 |
set volume formatting parameters, which are provided in TLDFormatInfo structure |
|
97 |
@param apLDFormatInfo pointer to the parameters structure. If NULL, iSpecialInfo will be initialised |
|
98 |
*/ |
|
99 |
void CFormatCB::SetFormatParameters(const TLDFormatInfo* apLDFormatInfo) |
|
100 |
{ |
|
101 |
TLDFormatInfo& fmtInfo = iSpecialInfo(); |
|
102 |
||
103 |
if(!apLDFormatInfo) |
|
104 |
{//-- special meaning; invalidate iSpecialInfo by setting its package size as 0 |
|
105 |
iSpecialInfo.SetLength(0); |
|
106 |
} |
|
107 |
else |
|
108 |
{ |
|
109 |
Mem::Copy(&fmtInfo, apLDFormatInfo, sizeof(TLDFormatInfo)); |
|
110 |
} |
|
111 |
} |
|
112 |
||
113 |
//---------------------------------------------------------------------------- |
|
114 |
/** set volume formatting parameters, which are provided in TVolFormatParam structure */ |
|
115 |
TInt CFormatCB::SetFormatParameters(const TVolFormatParam* apVolFormatParam) |
|
116 |
{ |
|
117 |
ASSERT(apVolFormatParam); |
|
118 |
TAny* dummy; |
|
119 |
//-- push parameters to the particular implementation of the CFormatCB. Default behaviour: KErrNotSupported |
|
120 |
return GetInterface(ESetFmtParameters, dummy, (TAny*)apVolFormatParam); |
|
121 |
} |
|
122 |
||
123 |
//---------------------------------------------------------------------------- |
|
124 |
#ifdef _DEBUG |
|
125 |
#define DUMP_OPENED_OBJECTS |
|
126 |
#endif |
|
127 |
||
128 |
/** |
|
129 |
Debug helper method. Dumps names of opened files and directories on this drive |
|
130 |
define DUMP_OPENED_OBJECTS to have it called |
|
131 |
*/ |
|
132 |
#ifdef DUMP_OPENED_OBJECTS |
|
133 |
static void DumpOpenedObjects(TDrive& aDrive) |
|
134 |
{ |
|
135 |
{//-- 1. files |
|
136 |
const TInt nFiles = Files->Count(); |
|
137 |
for(TInt i=0; i<nFiles; ++i) |
|
138 |
{ |
|
139 |
CFileCB* pFile=(CFileCB*)(*Files)[i]; |
|
140 |
if(pFile->Drive().DriveNumber() == aDrive.DriveNumber()) |
|
141 |
{ |
|
142 |
__PRINT1(_L("FsFormatOpen() opened file:'%S'"), &pFile->FileName()); |
|
143 |
} |
|
144 |
} |
|
145 |
||
146 |
} |
|
147 |
||
148 |
{//-- 2. directories; CDirCB doesn't have associated name. |
|
149 |
const TInt nDirs = Dirs->Count(); |
|
150 |
TInt cntDirs = 0; |
|
151 |
for(TInt i=0; i<nDirs; ++i) |
|
152 |
{ |
|
153 |
CDirCB* pDir = (CDirCB*)(*Dirs)[i]; |
|
154 |
if(pDir->Drive().DriveNumber() == aDrive.DriveNumber()) |
|
155 |
{ |
|
156 |
++cntDirs; |
|
157 |
} |
|
158 |
} |
|
159 |
||
160 |
if(cntDirs) |
|
161 |
{ |
|
162 |
__PRINT1(_L("FsFormatOpen() opened directories:%d"), cntDirs); |
|
163 |
} |
|
164 |
||
165 |
} |
|
166 |
||
167 |
} |
|
168 |
#endif //DUMP_OPENED_OBJECTS |
|
169 |
||
170 |
//---------------------------------------------------------------------------- |
|
171 |
/** |
|
172 |
Open a drive for formatting. |
|
173 |
*/ |
|
174 |
TInt FsFormatOpen(CFsRequest* aRequest) |
|
175 |
{ |
|
176 |
TDrive& drive = *aRequest->Drive(); |
|
177 |
||
178 |
__PRINT1(_L("FsFormatOpen() drv:%d"), drive.DriveNumber()); |
|
179 |
||
180 |
TInt nMountRes = drive.CheckMount(); |
|
181 |
//-- KErrNotReady means that there is no file system mounted on this drive |
|
182 |
//-- KErrInUse means that there are some "disk access" objects, like RFormat or RRawDisk opened on the mount. |
|
183 |
if(nMountRes == KErrNotReady || nMountRes == KErrInUse) |
|
184 |
{ |
|
185 |
__PRINT1(_L("FsFormatOpen() ChkMount:%d"), nMountRes); |
|
186 |
return nMountRes; |
|
187 |
} |
|
188 |
||
189 |
const TFormatMode fmtMode = (TFormatMode)aRequest->Message().Int1(); |
|
190 |
TName buf; |
|
191 |
TUint32 currFsNameHash = 0; //-- current file system name hash, 0 means "not set"; used during forced FS dismounting |
|
192 |
||
193 |
if((nMountRes == KErrNone) && drive.CurrentMount().LockStatus() < 0) |
|
194 |
{//-- the mount is locked, it has normal objects (files, directories) opened on it. |
|
195 |
||
196 |
//-- if someone is interested in the list of opened files and number of opened directories, compile this code in. |
|
197 |
#ifdef DUMP_OPENED_OBJECTS |
|
198 |
DumpOpenedObjects(drive); |
|
199 |
#endif //DUMP_OPENED_OBJECTS |
|
200 |
||
201 |
||
202 |
if(!(fmtMode & EForceFormat)) |
|
203 |
{ |
|
204 |
__PRINT(_L("FsFormatOpen() The mount is in use")); |
|
205 |
return KErrInUse; |
|
206 |
} |
|
207 |
||
208 |
//-- there is a special flag that tells to force media dismounting even if it has files or dirs opened. |
|
209 |
__PRINT(_L("FsFormatOpen() The mount is in use, forcing dismounting!")); |
|
210 |
||
211 |
//-- record currently mounted FS name hash, it may be used after forced dismounting |
|
212 |
drive.CurrentMount().FileSystemName(buf); //-- the iCurrentMount is alive |
|
213 |
currFsNameHash = TVolFormatParam::CalcFSNameHash(buf); |
|
214 |
||
215 |
//-- kill the current mount |
|
216 |
FsThreadManager::LockDrive(drive.DriveNumber()); |
|
217 |
TInt nRes = drive.ForceUnmountFileSystemForFormatting(); |
|
218 |
FsThreadManager::UnlockDrive(drive.DriveNumber()); |
|
219 |
||
220 |
||
221 |
switch(nRes) |
|
222 |
{ |
|
223 |
case KErrInUse: |
|
224 |
__PRINT(_L("FsFormatOpen() The mount has clamps! Can't force dismount")); |
|
225 |
return KErrInUse; //-- there are clamps on this drive - can't dismount |
|
226 |
||
227 |
case KErrNone: |
|
228 |
break; |
|
229 |
||
230 |
default: |
|
231 |
ASSERT(0); //-- unexpected error code |
|
232 |
return nRes; |
|
233 |
||
234 |
}; |
|
235 |
||
236 |
if(fmtMode & EQuickFormat) |
|
237 |
{//-- quick format may require the normally mounted FS, make the best effrot to mount it |
|
238 |
nMountRes = drive.CheckMount(); |
|
239 |
} |
|
240 |
else |
|
241 |
{//-- this will make the FS mounted by force; for full format it will be quicker |
|
242 |
nMountRes = KErrCorrupt; |
|
243 |
} |
|
244 |
||
245 |
} |
|
246 |
||
247 |
//-- if True, we will need mount (probably specific) file system by force because normal mounting has failed |
|
248 |
TBool bNeedForceMount = (nMountRes != KErrNone); |
|
249 |
||
250 |
//-- find out if we have optional data structure that describes format parameter |
|
251 |
TUint32 newFsNameHash = 0; //-- file system name hash, may be used for selecting which file system to put onto the volume. 0 means "not specified" |
|
252 |
||
253 |
const TLDFormatInfo* pLDFormatInfo = NULL; |
|
254 |
const TVolFormatParam* pVolFormatParam = NULL; |
|
255 |
||
256 |
__ASSERT_COMPILE(sizeof(TVolFormatParam) >= sizeof(TLDFormatInfo)); |
|
257 |
TBuf8<sizeof(TVolFormatParam)> paramBuf; |
|
258 |
||
259 |
||
260 |
if(fmtMode & ESpecialFormat) |
|
261 |
{ |
|
262 |
//-- the user has provided format parameters structure. |
|
263 |
//-- IPC argument #2 contains a structure: <TUint32>[optional package descriptor] |
|
264 |
//-- where 1st mandatory TUint32 is a pointer to format counter and the optional additional package is a data structure passed to the filesystem by the client of RFormat |
|
265 |
const TInt desLen = aRequest->GetDesLength(KMsgPtr2); |
|
266 |
ASSERT((TUint32)desLen >= sizeof(TUint32)); |
|
267 |
||
268 |
const TInt dataPckgLen = desLen - sizeof(TUint32); |
|
269 |
||
270 |
if((TUint32)dataPckgLen > sizeof(TUint32)) |
|
271 |
{ |
|
272 |
aRequest->ReadL(KMsgPtr2, paramBuf); |
|
273 |
} |
|
274 |
||
275 |
if(dataPckgLen == sizeof(TLDFormatInfo)) |
|
276 |
{//-- the user has provided formatting parameters via TLDFormatInfo structure. |
|
277 |
pLDFormatInfo = (const TLDFormatInfo*)(paramBuf.Ptr() + sizeof(TUint32)); |
|
278 |
} |
|
279 |
else if(dataPckgLen == sizeof(TVolFormatParam)) |
|
280 |
{//-- it's likely to be TVolFormatParam, need to check UId to be sure. |
|
281 |
pVolFormatParam = (const TVolFormatParam*)(const TVolFormatParam*)(paramBuf.Ptr() + sizeof(TUint32)); |
|
282 |
||
283 |
if(pVolFormatParam->iUId == TVolFormatParam::KUId) //-- check the class UID |
|
284 |
{//-- this is the real TVolFormatParam object passed |
|
285 |
newFsNameHash = pVolFormatParam->FSNameHash(); |
|
286 |
} |
|
287 |
} |
|
288 |
else if(dataPckgLen >0) |
|
289 |
{//-- parameters data structure has strange length |
|
290 |
return KErrArgument; |
|
291 |
} |
|
292 |
||
293 |
} |
|
294 |
||
295 |
//------------------- |
|
296 |
if(!newFsNameHash && currFsNameHash) |
|
297 |
{//-- new file system name isn't specified (default formatting), but the volume had been forcedly dismounted. |
|
298 |
//-- restore the original file system |
|
299 |
newFsNameHash = currFsNameHash; |
|
300 |
} |
|
301 |
||
302 |
if(newFsNameHash) |
|
303 |
{//-- check if the specified FS is already mounted on the volume |
|
304 |
if(!bNeedForceMount) |
|
305 |
{ |
|
306 |
drive.CurrentMount().FileSystemName(buf); //-- the iCurrentMount is alive |
|
307 |
} |
|
308 |
else |
|
309 |
{ //-- the iCurrentMount can be NULL, use the iFsys - the real file system associated with this drive |
|
310 |
buf = drive.GetFSys()->Name(); |
|
311 |
} |
|
312 |
||
313 |
const TUint32 currFSNameHash = TVolFormatParam::CalcFSNameHash(buf); |
|
314 |
if(currFSNameHash == newFsNameHash) |
|
315 |
{//-- no need to do anything, the required FS is already mounted |
|
316 |
newFsNameHash = 0; |
|
317 |
} |
|
318 |
} |
|
319 |
||
320 |
if(newFsNameHash) |
|
321 |
{ |
|
322 |
//-- the user has specified some filesystem to be mounted on the volume. Check if this FS is supported at all. |
|
323 |
//-- if it is supported, but some other FS is currently mounted, it will be dismounted and the new one will be forced. |
|
324 |
TInt nRes; |
|
325 |
||
326 |
for(TInt cntFS=0; ;++cntFS) |
|
327 |
{ |
|
328 |
nRes = drive.FSys().GetSupportedFileSystemName(cntFS, buf); //-- enumerate possible child file systems |
|
329 |
||
330 |
if(nRes != KErrNone) |
|
331 |
return KErrNotSupported; //-- the filesystem with the given name (fsNameHash) is not supported. |
|
332 |
||
333 |
if(newFsNameHash == TVolFormatParam::CalcFSNameHash(buf)) |
|
334 |
{//-- the filesystem with the given name (fsNameHash) is supported, but some other filesystem can be already mounted |
|
335 |
drive.Dismount(); |
|
336 |
bNeedForceMount = ETrue; //-- this will force the desired FS to be mounted |
|
337 |
break; |
|
338 |
} |
|
339 |
} |
|
340 |
||
341 |
}//if(fsNameHash) |
|
342 |
||
343 |
||
344 |
//-- try force mounting the desired file system if it is required |
|
345 |
if(bNeedForceMount) |
|
346 |
{ |
|
347 |
const TInt KMaxRetries = 3; |
|
348 |
for(TInt cnt=0; ; ++cnt) |
|
349 |
{ |
|
350 |
drive.MountFileSystem(ETrue, newFsNameHash); |
|
351 |
||
352 |
nMountRes = drive.GetReason(); |
|
353 |
if(nMountRes == KErrNone || nMountRes == KErrLocked) |
|
354 |
break; |
|
355 |
||
356 |
drive.Dismount(); //-- will reset mount retries counter |
|
357 |
||
358 |
if(cnt >= KMaxRetries) |
|
359 |
{ |
|
360 |
__PRINT1(_L("FsFormatOpen() can't mount FS! res:%d"), nMountRes); |
|
361 |
return nMountRes; |
|
362 |
} |
|
363 |
} |
|
364 |
} |
|
365 |
||
366 |
ASSERT(nMountRes == KErrNone || nMountRes == KErrLocked); |
|
367 |
||
368 |
__ASSERT_DEBUG(drive.CurrentMount().LockStatus()==0, Fault(ESvrFormatOpenFailed)); |
|
369 |
||
370 |
||
371 |
TDriveInfo dInfo; |
|
372 |
drive.DriveInfo(dInfo); |
|
373 |
const TInt mediaAtt = dInfo.iMediaAtt; |
|
374 |
||
375 |
#if defined(_LOCKABLE_MEDIA) |
|
376 |
if (!(fmtMode & EForceErase) && (mediaAtt & KMediaAttLocked)) |
|
377 |
{ |
|
378 |
// if attempting to format a locked drive, dismount otherwise subsequent |
|
379 |
// requests will operate on a mount that has been forcibly mounted (a few lines above) |
|
380 |
CMountCB* pM = &drive.CurrentMount(); |
|
381 |
||
382 |
if(pM) |
|
383 |
pM->Close(); |
|
384 |
||
385 |
drive.MountFileSystem(EFalse); // clear iCurrentMount |
|
386 |
return KErrLocked; |
|
387 |
} |
|
388 |
#endif |
|
389 |
||
390 |
if (!(mediaAtt & KMediaAttFormattable) || (mediaAtt & KMediaAttWriteProtected)) |
|
391 |
{ |
|
392 |
CMountCB* pM = &drive.CurrentMount(); |
|
393 |
||
394 |
if(pM) |
|
395 |
pM->Close(); |
|
396 |
||
397 |
drive.MountFileSystem(EFalse); |
|
398 |
return KErrAccessDenied; |
|
399 |
} |
|
400 |
||
401 |
//-- instantinate and open CFormatCB object for this drive |
|
402 |
CFormatCB* formatCB=NULL; |
|
403 |
TInt fmtHandle; |
|
404 |
||
405 |
TRAPD(ret, formatCB = drive.FormatOpenL(aRequest, fmtHandle, fmtMode, pLDFormatInfo, pVolFormatParam )); |
|
406 |
||
407 |
if (ret!=KErrNone) |
|
408 |
{ |
|
409 |
if(formatCB) |
|
410 |
formatCB->Close(); |
|
411 |
||
412 |
return ret; |
|
413 |
} |
|
414 |
||
415 |
TPtrC8 pH((TUint8*)&fmtHandle,sizeof(TInt)); |
|
416 |
aRequest->WriteL(KMsgPtr3,pH); |
|
417 |
TInt count=100; |
|
418 |
||
419 |
TPtrC8 pCount((TUint8*)&count,sizeof(TInt)); |
|
420 |
aRequest->WriteL(KMsgPtr2,pCount); |
|
421 |
aRequest->Session()->IncResourceCount(); |
|
422 |
||
423 |
return KErrNone; |
|
424 |
} |
|
425 |
||
426 |
TInt TFsFormatOpen::DoRequestL(CFsRequest* aRequest) |
|
427 |
// |
|
428 |
// Open a drive for formatting. |
|
429 |
// |
|
430 |
{ |
|
431 |
// Can not format if any files are clamped |
|
432 |
TInt r=FsFormatOpen(aRequest); |
|
433 |
return r; |
|
434 |
} |
|
435 |
||
436 |
TInt TFsFormatOpen::Initialise(CFsRequest* aRequest) |
|
437 |
// |
|
438 |
// |
|
439 |
// |
|
440 |
{ |
|
441 |
TInt r; |
|
442 |
if (!KCapFsFormatOpen.CheckPolicy(aRequest->Message(), __PLATSEC_DIAGNOSTIC_STRING("Format Open"))) |
|
443 |
return KErrPermissionDenied; |
|
444 |
r=ParseNoWildSubstPtr0(aRequest,aRequest->Src()); |
|
445 |
if (r!=KErrNone) |
|
446 |
return(r); |
|
447 |
if (aRequest->Src().NameOrExtPresent()) |
|
448 |
return(KErrBadName); |
|
449 |
if (aRequest->SubstedDrive()) |
|
450 |
return(KErrAccessDenied); |
|
451 |
return(r); |
|
452 |
} |
|
453 |
||
454 |
||
455 |
TInt TFsFormatNext::DoRequestL(CFsRequest* aRequest) |
|
456 |
// |
|
457 |
// Format the next part of the media. |
|
458 |
// |
|
459 |
{ |
|
460 |
||
461 |
__PRINT1(_L("TFsFormatNext::DoRequestL() drv:%d"), aRequest->DriveNumber()); |
|
462 |
CFormatCB* format=(CFormatCB*)aRequest->ScratchValue(); |
|
463 |
TInt r=format->CheckMount(); |
|
464 |
if (r!=KErrNone && r!=KErrInUse) |
|
465 |
{ |
|
466 |
__PRINT1(_L("TFsFormatNext::DoRequestL() err:%d"), r); |
|
467 |
return r; |
|
468 |
} |
|
469 |
||
470 |
TPtr8 pStep((TUint8*)&format->CurrentStep(),sizeof(TInt)); |
|
471 |
aRequest->ReadL(KMsgPtr0,pStep); |
|
472 |
||
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
473 |
OstTrace1(TRACE_FILESYSTEM, FSYS_ECFORMATCBDOFORMATSTEPL, "this %x", format); |
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
474 |
|
0 | 475 |
TRAP(r,format->DoFormatStepL()); |
43
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
476 |
|
c1f20ce4abcf
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
477 |
OstTraceExt2(TRACE_FILESYSTEM, FSYS_ECFORMATCBDOFORMATSTEPLRET, "r %d iCurrentStep %d", r, (TUint) format->CurrentStep()); |
0 | 478 |
|
479 |
if (r==KErrNone) |
|
480 |
aRequest->WriteL(KMsgPtr0,pStep); |
|
481 |
if (r==KErrNone && format->CurrentStep()==0) |
|
482 |
{ |
|
483 |
FsNotify::DiskChange(aRequest->DriveNumber()); |
|
484 |
} |
|
485 |
return(r); |
|
486 |
} |
|
487 |
||
488 |
TInt TFsFormatNext::Initialise(CFsRequest* aRequest) |
|
489 |
// |
|
490 |
// |
|
491 |
// |
|
492 |
{ |
|
493 |
if (!KCapFsFormatNext.CheckPolicy(aRequest->Message(), __PLATSEC_DIAGNOSTIC_STRING("Format Next"))) |
|
494 |
return KErrPermissionDenied; |
|
495 |
CFormatCB* format; |
|
496 |
format=GetFormatFromHandle(aRequest->Message().Int3(), aRequest->Session()); |
|
497 |
if(!format) |
|
498 |
return(KErrBadHandle); |
|
499 |
aRequest->SetDrive(&format->Drive()); |
|
500 |
aRequest->SetScratchValue((TUint)format); |
|
501 |
return KErrNone; |
|
502 |
} |