author | hgs |
Wed, 20 Oct 2010 13:58:28 +0100 | |
changeset 293 | 0659d0e1a03c |
parent 286 | 48e57fb1237e |
child 299 | b5a01337d018 |
permissions | -rw-r--r-- |
0 | 1 |
// Copyright (c) 2002-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_notif.cpp |
|
15 |
// |
|
16 |
// |
|
17 |
||
18 |
#include "sf_std.h" |
|
19 |
||
20 |
||
21 |
||
22 |
TChangeQue FsNotify::iChangeQues[KMaxNotifyQues]; |
|
23 |
TDiskSpaceQue FsNotify::iDiskSpaceQues[KMaxDiskQues]; |
|
24 |
TDebugQue FsNotify::iDebugQue; |
|
25 |
TDismountNotifyQue FsNotify::iDismountNotifyQue; |
|
26 |
||
27 |
void CNotifyInfo::Initialise(TInfoType aType,TRequestStatus* aStatus,const RMessagePtr2& aMessage,CSessionFs* aSession) |
|
28 |
// |
|
29 |
// |
|
30 |
// |
|
31 |
{ |
|
32 |
iType=aType; |
|
33 |
iStatus=aStatus; |
|
34 |
iMessage=aMessage; |
|
35 |
iSession=aSession; |
|
36 |
}; |
|
37 |
||
38 |
CNotifyInfo::~CNotifyInfo() |
|
39 |
// |
|
40 |
// |
|
41 |
// |
|
42 |
{ |
|
286 | 43 |
// message should have been completed already |
44 |
__ASSERT_DEBUG(iMessage.IsNull(), Fault(ENotifyInfoDestructor)); |
|
45 |
||
46 |
__ASSERT_DEBUG(iLink.iNext,Fault(ENotifyInfoDestructor)); |
|
47 |
iLink.Deque(); |
|
0 | 48 |
} |
49 |
||
50 |
void CNotifyInfo::Complete(TInt aError) |
|
51 |
// |
|
52 |
// |
|
53 |
// |
|
54 |
{ |
|
55 |
__PRINT2(_L("CNotifyInfo::Complete 0x%x error=%d"),this,aError); |
|
286 | 56 |
if (!iMessage.IsNull()) |
0 | 57 |
iMessage.Complete(aError); |
58 |
} |
|
59 |
||
60 |
||
61 |
void CStdChangeInfo::Initialise(TNotifyType aChangeType,TRequestStatus* aStatus,const RMessagePtr2& aMessage,CSessionFs* aSession) |
|
62 |
// |
|
63 |
// |
|
64 |
// |
|
65 |
{ |
|
66 |
iChangeType=aChangeType; |
|
67 |
CNotifyInfo::Initialise(EStdChange,aStatus,aMessage,aSession); |
|
68 |
} |
|
69 |
||
70 |
TUint CStdChangeInfo::RequestNotifyType(CFsRequest* aRequest) |
|
71 |
// |
|
72 |
// return notification type for the request |
|
73 |
// |
|
74 |
{ |
|
75 |
TUint notifyType=aRequest->Operation()->NotifyType(); |
|
76 |
if(aRequest->Operation()->Function()==EFsRename) |
|
77 |
{ |
|
78 |
__ASSERT_DEBUG(notifyType==(ENotifyDir|ENotifyFile|ENotifyEntry),Fault(EStdChangeRequestType)); |
|
79 |
if(aRequest->Src().NamePresent()) |
|
80 |
notifyType=ENotifyFile|ENotifyEntry; |
|
81 |
else |
|
82 |
notifyType=ENotifyDir|ENotifyEntry; |
|
83 |
} |
|
84 |
return(notifyType); |
|
85 |
} |
|
86 |
||
87 |
TBool CStdChangeInfo::IsMatching(CFsRequest* aRequest) |
|
88 |
// |
|
89 |
// return ETrue if operation type of request matches that of change notification |
|
90 |
// |
|
91 |
{ |
|
92 |
if((iChangeType&ENotifyAll) || (iChangeType&aRequest->Operation()->NotifyType())) |
|
93 |
return(ETrue); |
|
94 |
else |
|
95 |
return(EFalse); |
|
96 |
} |
|
97 |
||
98 |
void CExtChangeInfo::Initialise(TNotifyType aChangeType,TRequestStatus* aStatus,const RMessagePtr2& aMessage,CSessionFs* aSession,const TDesC& aName) |
|
99 |
// |
|
100 |
// |
|
101 |
// |
|
102 |
{ |
|
103 |
__ASSERT_DEBUG(aName.Length()<=KMaxFileName-2,Fault(EExtChangeNameLength)); |
|
104 |
iName=aName; |
|
105 |
iChangeType=aChangeType; |
|
106 |
CNotifyInfo::Initialise(EExtChange,aStatus,aMessage,aSession); |
|
107 |
} |
|
108 |
||
109 |
||
110 |
TBool CExtChangeInfo::IsMatching(CFsRequest* aRequest) |
|
111 |
// |
|
112 |
// return ETrue if operation notify type of request matches that of change notification |
|
113 |
// and paths match |
|
114 |
// |
|
115 |
{ |
|
116 |
TInt function=aRequest->Operation()->Function(); |
|
117 |
// if a rename occurred inform any requests if their path has been changed regardless of the notification type |
|
118 |
if(function==EFsRename) |
|
119 |
{ |
|
120 |
TBuf<KMaxFileName> renamePath=aRequest->Src().FullName().Mid(2); |
|
121 |
renamePath+=_L("*"); |
|
122 |
if (iName.MatchF(renamePath)!=KErrNotFound) |
|
123 |
return(ETrue); |
|
124 |
} |
|
125 |
||
126 |
||
127 |
//Special case where the dir the notifier is setup on has just been created |
|
128 |
if(function==EFsMkDir) |
|
129 |
{ |
|
130 |
TInt notDrive; |
|
131 |
RFs::CharToDrive(aRequest->Src().Drive()[0],notDrive); //can not fail as the drive letter has been parsed already |
|
132 |
if(aRequest->Src().Path().MatchF(iName) == 0 && aRequest->DriveNumber() == notDrive) |
|
133 |
return ETrue; |
|
134 |
} |
|
135 |
||
136 |
//Special case where the File the notifier is setup on has just been created by temp as the name is not known unti it has been created |
|
137 |
if(function==EFsRename||function==EFsFileOpen||function==EFsFileCreate||function==EFsFileReplace) |
|
138 |
{ |
|
139 |
TInt notDrive; |
|
140 |
RFs::CharToDrive(aRequest->Src().Drive()[0],notDrive); //can not fail as the drive letter has been parsed already |
|
141 |
if(aRequest->Src().FullName().Mid(2).MatchF(iName) == 0 && aRequest->DriveNumber() == notDrive) |
|
142 |
return ETrue; |
|
143 |
} |
|
144 |
||
145 |
//For the case of a file created using EFsFileTemp we can probably ignore it for special cases as it |
|
146 |
//is created with a random name. Not specifically going to be being looked for |
|
147 |
||
148 |
if((iChangeType&ENotifyAll) || (iChangeType&RequestNotifyType(aRequest))) |
|
149 |
{ |
|
150 |
switch (function) |
|
151 |
{ |
|
152 |
// Notify interested requests if a SetDriveName(), SetVolume() or RawDiskWrite() operation |
|
153 |
// occcurred. By their nature, these operations have no distinct path. All outstanding |
|
154 |
// requests monitoring the relevant TNotifyType are potentially interested in such operations |
|
155 |
case EFsFileWrite: |
|
156 |
case EFsFileWriteDirty: |
|
157 |
case EFsFileSet: |
|
158 |
case EFsFileSetAtt: |
|
159 |
case EFsFileSetModified: |
|
160 |
case EFsFileSetSize: |
|
161 |
{ |
|
162 |
TBuf<KMaxFileName> root=iName; |
|
163 |
root+=_L("*"); |
|
164 |
||
165 |
// NB share may be NULL if file server has initiated a flush of the file cache |
|
166 |
CFileShare* share; |
|
167 |
CFileCB* fileCache; |
|
168 |
GetFileFromScratch(aRequest, share, fileCache); |
|
169 |
if (share && share->File().FileName().MatchF(root) != KErrNotFound) |
|
170 |
return(ETrue); |
|
171 |
||
172 |
} |
|
173 |
break; |
|
174 |
case EFsSetDriveName: |
|
175 |
case EFsSetVolume: |
|
176 |
case EFsRawDiskWrite: |
|
177 |
case EFsLockDrive: |
|
178 |
case EFsUnlockDrive: |
|
179 |
case EFsReserveDriveSpace: |
|
180 |
{ |
|
181 |
return(ETrue); |
|
182 |
} |
|
183 |
||
184 |
default: |
|
185 |
{ |
|
186 |
TBuf<KMaxFileName> root = iName; |
|
187 |
root+=_L("*"); |
|
188 |
||
189 |
if(aRequest->Src().FullName().Mid(2).MatchF(root)!=KErrNotFound) |
|
190 |
return(ETrue); |
|
191 |
else if(function==EFsRename||function==EFsReplace||function==EFsFileRename) |
|
192 |
{ |
|
193 |
// - rename/replace causes the file/path to disappear |
|
194 |
if(aRequest->Dest().FullName().Mid(2).MatchF(root)!=KErrNotFound) |
|
195 |
{ |
|
196 |
return(ETrue); |
|
197 |
} |
|
198 |
||
199 |
// - rename/replace causes the file/path to arrive |
|
200 |
root=aRequest->Dest().FullName().Mid(2); |
|
201 |
root+=_L("*"); |
|
202 |
||
203 |
if (iName.MatchF(root)!=KErrNotFound) |
|
204 |
{ |
|
205 |
return(ETrue); |
|
206 |
} |
|
207 |
} |
|
208 |
} |
|
209 |
} |
|
210 |
} |
|
211 |
return(EFalse); |
|
212 |
} |
|
213 |
||
214 |
||
215 |
void CDiskSpaceInfo::Initialise(TRequestStatus* aStatus,const RMessagePtr2& aMessage,CSessionFs* aSession,TInt64 aThreshold) |
|
216 |
// |
|
217 |
// |
|
218 |
// |
|
219 |
{ |
|
220 |
__ASSERT_DEBUG(aThreshold>0,Fault(EDiskSpaceThreshold)); |
|
221 |
iThreshold=aThreshold; |
|
222 |
CNotifyInfo::Initialise(EDiskSpace,aStatus,aMessage,aSession); |
|
223 |
} |
|
224 |
||
225 |
TBool CDiskSpaceInfo::IsMatching(TInt64& aBefore,TInt64& aAfter) |
|
226 |
// |
|
227 |
// return ETrue if the threshold has been crossed |
|
228 |
// |
|
229 |
{ |
|
230 |
if((aBefore>=iThreshold&&aAfter<iThreshold)||(aBefore<=iThreshold&&aAfter>iThreshold)) |
|
231 |
return(ETrue); |
|
232 |
return(EFalse); |
|
233 |
} |
|
234 |
||
235 |
void CDebugChangeInfo::Initialise(TUint aDebugType,TRequestStatus* aStatus,const RMessagePtr2& aMessage,CSessionFs* aSession) |
|
236 |
// |
|
237 |
// |
|
238 |
// |
|
239 |
{ |
|
240 |
__ASSERT_DEBUG((aDebugType&KDebugNotifyMask)&&!(aDebugType&~KDebugNotifyMask),Fault(EDebugChangeType)); |
|
241 |
iDebugType=aDebugType; |
|
242 |
CNotifyInfo::Initialise(EDebugChange,aStatus,aMessage,aSession); |
|
243 |
} |
|
244 |
||
245 |
TBool CDebugChangeInfo::IsMatching(TUint aFunction) |
|
246 |
// |
|
247 |
// return ETrue if debug notification type matches aFunction |
|
248 |
// |
|
249 |
{ |
|
250 |
if(iDebugType&aFunction) |
|
251 |
return(ETrue); |
|
252 |
return(EFalse); |
|
253 |
} |
|
254 |
||
255 |
||
256 |
CDismountNotifyInfo::~CDismountNotifyInfo() |
|
257 |
{ |
|
258 |
switch(iMode) |
|
259 |
{ |
|
260 |
case EFsDismountNotifyClients: |
|
261 |
break; |
|
262 |
case EFsDismountRegisterClient: |
|
263 |
__ASSERT_ALWAYS(TheDrives[iDriveNumber].DismountUnlock() >= 0, Fault(ENotifyDismountCancel)); |
|
286 | 264 |
__ASSERT_ALWAYS(iMessage.IsNull(), Fault(ENotifyDismountCancel)); |
265 |
TheDrives[iDriveNumber].DismountClientRemoved(); |
|
0 | 266 |
break; |
267 |
default: |
|
268 |
break; |
|
269 |
} |
|
270 |
} |
|
271 |
||
286 | 272 |
void CDismountNotifyInfo::Complete(TInt aError) |
273 |
{ |
|
274 |
__PRINT2(_L("CDismountNotifyInfo::Complete 0x%x error=%d"),this,aError); |
|
275 |
if (!iMessage.IsNull()) |
|
276 |
{ |
|
277 |
iMessage.Complete(aError); |
|
278 |
// inc count of messages completed by EFsDismountNotifyClients & waiting for an EFsAllowDismount request from client |
|
279 |
if (iMode == EFsDismountRegisterClient) |
|
280 |
TheDrives[iDriveNumber].DismountClientAdded(); |
|
281 |
} |
|
282 |
} |
|
283 |
||
284 |
||
0 | 285 |
void CDismountNotifyInfo::Initialise(TNotifyDismountMode aMode, TInt aDriveNumber, TRequestStatus* aStatus,const RMessagePtr2& aMessage,CSessionFs* aSession) |
286 |
{ |
|
287 |
iMode = aMode; |
|
288 |
iDriveNumber=aDriveNumber; |
|
289 |
CNotifyInfo::Initialise(EDismount,aStatus,aMessage,aSession); |
|
290 |
||
291 |
if (iMode == EFsDismountRegisterClient) |
|
292 |
TheDrives[iDriveNumber].DismountLock(); |
|
293 |
} |
|
294 |
||
295 |
TBool CDismountNotifyInfo::IsMatching(TNotifyDismountMode aMode, TInt aDriveNumber, CSessionFs* aSession) |
|
296 |
{ |
|
297 |
if((iDriveNumber == aDriveNumber) && (iMode == aMode) && (aSession == NULL || aSession == Session())) |
|
298 |
return(ETrue); |
|
299 |
return(EFalse); |
|
300 |
} |
|
301 |
||
302 |
TBaseQue::TBaseQue() |
|
303 |
// |
|
304 |
// |
|
305 |
// |
|
306 |
{ |
|
307 |
iHeader.SetOffset(_FOFF(CNotifyInfo,iLink)); |
|
308 |
TInt r=iQLock.CreateLocal(); |
|
309 |
__ASSERT_ALWAYS(r==KErrNone,Fault(EBaseQueConstruction)); |
|
310 |
} |
|
311 |
||
312 |
TBaseQue::~TBaseQue() |
|
313 |
// |
|
314 |
// |
|
315 |
// |
|
316 |
{ |
|
317 |
iQLock.Close(); |
|
318 |
} |
|
319 |
||
320 |
void TBaseQue::DoAddNotify(CNotifyInfo* aInfo) |
|
321 |
// |
|
322 |
// Add notification |
|
323 |
// Que should be locked by calling function |
|
324 |
// |
|
325 |
{ |
|
326 |
iHeader.AddLast(*aInfo); |
|
327 |
} |
|
328 |
||
329 |
TBool TBaseQue::DoCancelSession(CSessionFs* aSession,TInt aCompletionCode, TRequestStatus* aStatus) |
|
330 |
// |
|
331 |
// Cancel notification(s) setup by aSession matching aStatus if set |
|
332 |
// Que should be locked by calling function |
|
333 |
// |
|
334 |
{ |
|
335 |
TDblQueIter<CNotifyInfo> q(iHeader); |
|
336 |
CNotifyInfo* info; |
|
337 |
TBool isFound=EFalse; |
|
338 |
while((info=q++)!=NULL) |
|
339 |
{ |
|
340 |
if(info->Session()==aSession && (!aStatus || aStatus==info->Status())) |
|
341 |
{ |
|
342 |
isFound=ETrue; |
|
343 |
info->Complete(aCompletionCode); |
|
344 |
delete(info); |
|
345 |
if(aStatus) |
|
346 |
break; |
|
347 |
} |
|
348 |
} |
|
349 |
return(isFound); |
|
350 |
} |
|
351 |
||
352 |
void TBaseQue::DoCancelAll(TInt aCompletionCode) |
|
353 |
// |
|
354 |
// Cancel all notifications |
|
355 |
// Que should be locked by calling function |
|
356 |
// |
|
357 |
{ |
|
358 |
TDblQueIter<CNotifyInfo> q(iHeader); |
|
359 |
CNotifyInfo* info; |
|
360 |
while((info=q++)!=NULL) |
|
361 |
{ |
|
362 |
info->Complete(aCompletionCode); |
|
363 |
delete(info); |
|
364 |
} |
|
365 |
__ASSERT_DEBUG(iHeader.IsEmpty(),Fault(EBaseQueCancel)); |
|
366 |
} |
|
367 |
||
368 |
TBool TBaseQue::IsEmpty() |
|
369 |
// |
|
370 |
// Que should be locked by calling function |
|
371 |
// |
|
372 |
{ |
|
373 |
return iHeader.IsEmpty(); |
|
374 |
} |
|
375 |
||
376 |
TBool TChangeQue::IsEmpty() |
|
377 |
// |
|
378 |
// |
|
379 |
// |
|
380 |
{ |
|
381 |
iQLock.Wait(); |
|
382 |
TBool empty = TBaseQue::IsEmpty(); |
|
383 |
iQLock.Signal(); |
|
384 |
return(empty); |
|
385 |
} |
|
386 |
||
387 |
TInt TChangeQue::AddNotify(CNotifyInfo* aInfo) |
|
388 |
// |
|
389 |
// |
|
390 |
// |
|
391 |
{ |
|
392 |
iQLock.Wait(); |
|
393 |
TBaseQue::DoAddNotify(aInfo); |
|
394 |
iQLock.Signal(); |
|
395 |
return(KErrNone); |
|
396 |
} |
|
397 |
||
398 |
TBool TChangeQue::CancelSession(CSessionFs* aSession,TInt aCompletionCode,TRequestStatus* aStatus) |
|
399 |
// |
|
400 |
// |
|
401 |
// |
|
402 |
{ |
|
403 |
iQLock.Wait(); |
|
404 |
TBool isFound=TBaseQue::DoCancelSession(aSession,aCompletionCode,aStatus); |
|
405 |
iQLock.Signal(); |
|
406 |
return(isFound); |
|
407 |
} |
|
408 |
||
409 |
void TChangeQue::CancelAll(TInt aCompletionCode) |
|
410 |
// |
|
411 |
// |
|
412 |
// |
|
413 |
{ |
|
414 |
iQLock.Wait(); |
|
415 |
TBaseQue::DoCancelAll(aCompletionCode); |
|
416 |
iQLock.Signal(); |
|
417 |
} |
|
418 |
||
419 |
void TChangeQue::CheckChange(CFsRequest* aRequest) |
|
420 |
// |
|
421 |
// complete any notification in que that matches aRequest |
|
422 |
// |
|
423 |
{ |
|
424 |
iQLock.Wait(); |
|
425 |
TDblQueIter<CNotifyInfo> q(iHeader); |
|
426 |
CNotifyInfo* info; |
|
427 |
while((info=q++)!=NULL) |
|
428 |
{ |
|
429 |
__ASSERT_DEBUG(info->Type()==CNotifyInfo::EStdChange||info->Type()==CNotifyInfo::EExtChange,Fault(EChangeQueType)); |
|
430 |
TBool isMatching; |
|
431 |
if(info->Type()==CNotifyInfo::EStdChange) |
|
432 |
isMatching=((CStdChangeInfo*)info)->IsMatching(aRequest); |
|
433 |
else |
|
434 |
isMatching=((CExtChangeInfo*)info)->IsMatching(aRequest); |
|
435 |
if(isMatching) |
|
436 |
{ |
|
437 |
__PRINT1(_L("TChangeQue::CheckChange()-Matching info=0x%x"),info); |
|
438 |
info->Complete(KErrNone); |
|
439 |
delete(info); |
|
440 |
} |
|
441 |
} |
|
442 |
iQLock.Signal(); |
|
443 |
} |
|
444 |
||
445 |
TBool TDiskSpaceQue::IsEmpty() |
|
446 |
// |
|
447 |
// |
|
448 |
// |
|
449 |
{ |
|
450 |
iQLock.Wait(); |
|
451 |
TBool empty = TBaseQue::IsEmpty(); |
|
452 |
iQLock.Signal(); |
|
453 |
return(empty); |
|
454 |
} |
|
455 |
||
456 |
TInt TDiskSpaceQue::AddNotify(CNotifyInfo* aInfo) |
|
457 |
// |
|
458 |
// |
|
459 |
// |
|
460 |
{ |
|
461 |
iQLock.Wait(); |
|
462 |
TInt r=KErrNone; |
|
463 |
if(iHeader.IsEmpty()) |
|
464 |
{ |
|
465 |
r=GetFreeDiskSpace(iFreeDiskSpace); |
|
466 |
iReservedDiskSpace = TheDrives[iDriveNumber].ReservedSpace(); |
|
467 |
} |
|
468 |
if(r==KErrNone) |
|
469 |
TBaseQue::DoAddNotify(aInfo); |
|
470 |
iQLock.Signal(); |
|
471 |
return(r); |
|
472 |
} |
|
473 |
||
474 |
TInt TDiskSpaceQue::CancelSession(CSessionFs* aSession,TInt aCompletionCode,TRequestStatus* aStatus) |
|
475 |
// |
|
476 |
// |
|
477 |
// |
|
478 |
{ |
|
479 |
iQLock.Wait(); |
|
480 |
TBaseQue::DoCancelSession(aSession,aCompletionCode,aStatus); |
|
481 |
iQLock.Signal(); |
|
482 |
return(KErrNone); |
|
483 |
} |
|
484 |
||
485 |
void TDiskSpaceQue::CancelAll(TInt aCompletionCode) |
|
486 |
// |
|
487 |
// |
|
488 |
// |
|
489 |
{ |
|
490 |
iQLock.Wait(); |
|
491 |
TBaseQue::DoCancelAll(aCompletionCode); |
|
492 |
iQLock.Signal(); |
|
493 |
} |
|
494 |
||
495 |
||
496 |
void TDiskSpaceQue::CheckDiskSpace() |
|
497 |
// |
|
498 |
// Complete any disk space notification whose threshold has been crossed |
|
499 |
// |
|
500 |
{ |
|
501 |
iQLock.Wait(); |
|
502 |
if(iHeader.IsEmpty()) |
|
503 |
{ |
|
504 |
iQLock.Signal(); |
|
505 |
return; |
|
506 |
} |
|
507 |
TInt64 freeSpace; |
|
508 |
TInt r=GetFreeDiskSpace(freeSpace); |
|
509 |
TInt64 reservedSpace(TheDrives[iDriveNumber].ReservedSpace()); |
|
510 |
if(r==KErrNone) |
|
511 |
{ |
|
512 |
if((freeSpace==iFreeDiskSpace) && (reservedSpace==iReservedDiskSpace)) |
|
513 |
{ |
|
514 |
iQLock.Signal(); |
|
515 |
return; |
|
516 |
} |
|
517 |
TDblQueIter<CNotifyInfo> q(iHeader); |
|
518 |
CNotifyInfo* info; |
|
519 |
while((info=q++)!=NULL) |
|
520 |
{ |
|
521 |
__ASSERT_DEBUG(info->Type()==CNotifyInfo::EDiskSpace,Fault(EDiskSpaceQueType1)); |
|
522 |
||
523 |
TInt64 newSessionFreeSpace(freeSpace); |
|
524 |
TInt64 oldSessionFreeSpace(iFreeDiskSpace); |
|
525 |
if(!info->Session()->ReservedAccess(iDriveNumber)) |
|
526 |
{ |
|
527 |
newSessionFreeSpace -= reservedSpace; |
|
528 |
oldSessionFreeSpace -= iReservedDiskSpace; |
|
529 |
} |
|
530 |
||
531 |
if(((CDiskSpaceInfo*)info)->IsMatching(oldSessionFreeSpace,newSessionFreeSpace)) |
|
532 |
{ |
|
533 |
__PRINT1(_L("TDiskSpaceQue::CheckDiskSpace()-Matching info=0x%x"),info); |
|
534 |
info->Complete(KErrNone); |
|
535 |
delete(info); |
|
536 |
} |
|
537 |
} |
|
538 |
iFreeDiskSpace=freeSpace; |
|
539 |
iReservedDiskSpace=reservedSpace; |
|
540 |
} |
|
541 |
else |
|
542 |
TBaseQue::DoCancelAll(KErrNone); |
|
543 |
iQLock.Signal(); |
|
544 |
} |
|
545 |
||
546 |
void TDiskSpaceQue::CheckDiskSpace(TInt64& aFreeDiskSpace) |
|
547 |
// |
|
548 |
// |
|
549 |
// |
|
550 |
{ |
|
551 |
iQLock.Wait(); |
|
552 |
if(iHeader.IsEmpty()) |
|
553 |
{ |
|
554 |
iQLock.Signal(); |
|
555 |
return; |
|
556 |
} |
|
557 |
||
558 |
TInt64 reservedSpace(TheDrives[iDriveNumber].ReservedSpace()); |
|
559 |
||
560 |
if((aFreeDiskSpace==iFreeDiskSpace) && (reservedSpace==iReservedDiskSpace)) |
|
561 |
{ |
|
562 |
iQLock.Signal(); |
|
563 |
return; |
|
564 |
} |
|
565 |
TDblQueIter<CNotifyInfo> q(iHeader); |
|
566 |
CNotifyInfo* info; |
|
567 |
while((info=q++)!=NULL) |
|
568 |
{ |
|
569 |
__ASSERT_DEBUG(info->Type()==CNotifyInfo::EDiskSpace,Fault(EDiskSpaceQueType2)); |
|
570 |
||
571 |
TInt64 newSessionFreeSpace(aFreeDiskSpace); |
|
572 |
TInt64 oldSessionFreeSpace(iFreeDiskSpace); |
|
573 |
if(!info->Session()->ReservedAccess(iDriveNumber)) |
|
574 |
{ |
|
575 |
newSessionFreeSpace -= reservedSpace; |
|
576 |
oldSessionFreeSpace -= iReservedDiskSpace; |
|
577 |
} |
|
578 |
||
579 |
if(((CDiskSpaceInfo*)info)->IsMatching(oldSessionFreeSpace,newSessionFreeSpace)) |
|
580 |
{ |
|
581 |
__PRINT1(_L("TDiskSpaceQue::CheckDiskSpace()-Matching info=0x%x"),info); |
|
582 |
info->Complete(KErrNone); |
|
583 |
delete(info); |
|
584 |
} |
|
585 |
} |
|
586 |
iFreeDiskSpace=aFreeDiskSpace; |
|
587 |
iReservedDiskSpace=reservedSpace; |
|
588 |
iQLock.Signal(); |
|
589 |
} |
|
590 |
||
591 |
TInt TDiskSpaceQue::GetFreeDiskSpace(TInt64& aFreeDiskSpace) |
|
592 |
// |
|
593 |
// |
|
594 |
// |
|
595 |
{ |
|
596 |
__ASSERT_DEBUG(iDriveNumber>=EDriveA&&iDriveNumber<=EDriveZ,Fault(EDiskSpaceQueDrive)); |
|
597 |
__CHECK_DRIVETHREAD(iDriveNumber); |
|
598 |
TInt r=TheDrives[iDriveNumber].FreeDiskSpace(aFreeDiskSpace); |
|
599 |
return(r); |
|
600 |
} |
|
601 |
||
602 |
TInt TDebugQue::AddNotify(CNotifyInfo* aInfo) |
|
603 |
// |
|
604 |
// |
|
605 |
// |
|
606 |
{ |
|
607 |
iQLock.Wait(); |
|
608 |
TBaseQue::DoAddNotify(aInfo); |
|
609 |
iQLock.Signal(); |
|
610 |
return(KErrNone); |
|
611 |
} |
|
612 |
||
613 |
TInt TDebugQue::CancelSession(CSessionFs* aSession,TInt aCompletionCode,TRequestStatus* aStatus) |
|
614 |
// |
|
615 |
// |
|
616 |
// |
|
617 |
{ |
|
618 |
iQLock.Wait(); |
|
619 |
TBool isFound=TBaseQue::DoCancelSession(aSession,aCompletionCode,aStatus); |
|
620 |
iQLock.Signal(); |
|
621 |
return(isFound); |
|
622 |
} |
|
623 |
||
624 |
void TDebugQue::CancelAll(TInt aCompletionCode) |
|
625 |
// |
|
626 |
// |
|
627 |
// |
|
628 |
{ |
|
629 |
iQLock.Wait(); |
|
630 |
TBaseQue::DoCancelAll(aCompletionCode); |
|
631 |
iQLock.Signal(); |
|
632 |
} |
|
633 |
||
634 |
void TDebugQue::CheckDebug(TUint aDebugChange) |
|
635 |
// |
|
636 |
// Complete any debug notification whose debug type matches aDebugChange |
|
637 |
// |
|
638 |
{ |
|
639 |
iQLock.Wait(); |
|
640 |
TDblQueIter<CNotifyInfo> q(iHeader); |
|
641 |
CNotifyInfo* info; |
|
642 |
while((info=q++)!=NULL) |
|
643 |
{ |
|
644 |
__ASSERT_DEBUG(info->Type()==CNotifyInfo::EDebugChange,Fault(EDebugQueType)); |
|
645 |
if(((CDebugChangeInfo*)info)->IsMatching(aDebugChange)) |
|
646 |
{ |
|
647 |
__PRINT1(_L("TDebugQue::CheckDebug()-Matching info=0x%x"),info); |
|
648 |
info->Complete(KErrNone); |
|
649 |
delete(info); |
|
650 |
} |
|
651 |
} |
|
652 |
iQLock.Signal(); |
|
653 |
} |
|
654 |
||
655 |
TInt TDismountNotifyQue::AddNotify(CNotifyInfo* aInfo) |
|
656 |
// |
|
657 |
// |
|
658 |
// |
|
659 |
{ |
|
660 |
iQLock.Wait(); |
|
661 |
TBaseQue::DoAddNotify(aInfo); |
|
662 |
iQLock.Signal(); |
|
663 |
return(KErrNone); |
|
664 |
} |
|
665 |
||
286 | 666 |
void TDismountNotifyQue::CancelSession(CSessionFs* aSession,TInt aCompletionCode,TRequestStatus* aStatus) |
0 | 667 |
// |
668 |
// |
|
669 |
{ |
|
670 |
iQLock.Wait(); |
|
90
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
671 |
|
286 | 672 |
TDblQueIter<CDismountNotifyInfo> q(iHeader); |
673 |
CDismountNotifyInfo* info; |
|
674 |
while((info=q++)!=NULL) |
|
675 |
{ |
|
676 |
if(info->Session()==aSession && (!aStatus || aStatus==info->Status())) |
|
677 |
{ |
|
678 |
TInt driveNumber = info->DriveNumber(); |
|
679 |
||
680 |
info->Complete(aCompletionCode); |
|
681 |
TInt mode = info->Mode(); |
|
682 |
||
683 |
delete info; |
|
684 |
info = NULL; |
|
90
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
685 |
|
286 | 686 |
// if we're cancelling a dismount request (EFsDismountNotifyClients or EFsDismountForceDismount), |
687 |
// then we need to cancel the deferred dismount and issue a disk change notification as observers |
|
688 |
// may be expecting one... |
|
689 |
if (mode == EFsDismountNotifyClients || mode == EFsDismountForceDismount) |
|
690 |
{ |
|
691 |
TheDrives[driveNumber].SetDismountDeferred(EFalse); |
|
692 |
FsNotify::DiskChange(driveNumber); |
|
693 |
} |
|
694 |
||
695 |
if(aStatus) |
|
696 |
break; |
|
697 |
} |
|
698 |
} |
|
90
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
699 |
|
0 | 700 |
iQLock.Signal(); |
701 |
} |
|
702 |
||
703 |
void TDismountNotifyQue::CancelAll(TInt aCompletionCode) |
|
704 |
// |
|
705 |
// |
|
706 |
// |
|
707 |
{ |
|
708 |
iQLock.Wait(); |
|
709 |
TBaseQue::DoCancelAll(aCompletionCode); |
|
710 |
iQLock.Signal(); |
|
711 |
} |
|
712 |
||
713 |
void TDismountNotifyQue::CheckDismount(TNotifyDismountMode aMode, TInt aDrive, TBool aRemove, TInt aError) |
|
714 |
// |
|
715 |
// Complete any dismount notifications on the specified drive. |
|
716 |
// |
|
717 |
{ |
|
718 |
iQLock.Wait(); |
|
719 |
TDblQueIter<CNotifyInfo> q(iHeader); |
|
720 |
CNotifyInfo* info; |
|
721 |
while((info=q++)!=NULL) |
|
722 |
{ |
|
723 |
__ASSERT_DEBUG(info->Type()==CNotifyInfo::EDismount,Fault(EBadDismountNotifyType)); |
|
724 |
if(((CDismountNotifyInfo*)info)->IsMatching(aMode, aDrive, NULL)) |
|
725 |
{ |
|
726 |
__PRINT1(_L("TDismountNotifyQue::CheckDismount()-Matching info=0x%x"),info); |
|
727 |
info->Complete(aError); |
|
728 |
if(aRemove) |
|
286 | 729 |
delete info; |
0 | 730 |
} |
731 |
} |
|
732 |
||
286 | 733 |
__ASSERT_ALWAYS(!(aRemove && aMode == EFsDismountRegisterClient && TheDrives[aDrive].DismountLocked() > 0), Fault(EDismountLocked)); |
0 | 734 |
|
735 |
iQLock.Signal(); |
|
736 |
} |
|
737 |
||
738 |
TBool TDismountNotifyQue::HandlePendingDismount(CSessionFs* aSession, TInt aDrive) |
|
739 |
// |
|
286 | 740 |
// Determine if the session has any outstanding *completed* dismount notifications on the specified drive |
741 |
// and delete them. Called from TFsAllowDismount::DoRequestL() |
|
0 | 742 |
// |
743 |
{ |
|
744 |
iQLock.Wait(); |
|
286 | 745 |
TDblQueIter<CDismountNotifyInfo> q(iHeader); |
746 |
CDismountNotifyInfo* info; |
|
747 |
||
748 |
TBool entryFound = EFalse; |
|
749 |
||
0 | 750 |
while((info=q++)!=NULL) |
751 |
{ |
|
752 |
__ASSERT_DEBUG(info->Type()==CNotifyInfo::EDismount,Fault(EBadDismountNotifyType)); |
|
753 |
if(((CDismountNotifyInfo*)info)->IsMatching(EFsDismountRegisterClient, aDrive, aSession)) |
|
754 |
{ |
|
286 | 755 |
__PRINT1(_L("TDismountNotifyQue::HandlePendingDismount()-Pending info=0x%x"),info); |
756 |
||
757 |
if (info->Completed()) |
|
758 |
delete info; |
|
759 |
||
760 |
entryFound = ETrue; |
|
0 | 761 |
} |
762 |
} |
|
763 |
iQLock.Signal(); |
|
286 | 764 |
|
765 |
return entryFound; |
|
0 | 766 |
} |
767 |
||
768 |
void FsNotify::Initialise() |
|
769 |
// |
|
770 |
// |
|
771 |
// |
|
772 |
{ |
|
773 |
for(TInt i=0;i<KMaxDiskQues;++i) |
|
774 |
{ |
|
775 |
iDiskSpaceQues[i].SetDriveNumber(i); |
|
776 |
} |
|
777 |
} |
|
778 |
||
779 |
TBool FsNotify::IsChangeQueEmpty(TInt aDrive) |
|
780 |
// |
|
781 |
// |
|
782 |
// |
|
783 |
{ |
|
784 |
if((iChangeQues[ChangeIndex(aDrive)].IsEmpty()) && (iChangeQues[ChangeIndex(KDriveInvalid)].IsEmpty())) |
|
785 |
return ETrue; |
|
786 |
||
787 |
return EFalse; |
|
788 |
} |
|
789 |
||
790 |
TInt FsNotify::AddChange(CNotifyInfo* aInfo,TInt aDrive) |
|
791 |
// |
|
792 |
// |
|
793 |
// |
|
794 |
{ |
|
795 |
__ASSERT_DEBUG(aInfo->Type()==CNotifyInfo::EStdChange||aInfo->Type()==CNotifyInfo::EExtChange,Fault(EBadChangeNotifyType)); |
|
796 |
__PRINT2(_L("FsNotify::AddChange() drive=%d,info=0x%x"),aDrive,aInfo); |
|
797 |
iChangeQues[ChangeIndex(aDrive)].AddNotify(aInfo); |
|
798 |
return(KErrNone); |
|
799 |
} |
|
800 |
||
801 |
TBool FsNotify::IsDiskSpaceQueEmpty(TInt aDrive) |
|
802 |
// |
|
803 |
// |
|
804 |
// |
|
805 |
{ |
|
806 |
if(iDiskSpaceQues[aDrive].IsEmpty()) |
|
807 |
return ETrue; |
|
808 |
||
809 |
return EFalse; |
|
810 |
} |
|
811 |
||
812 |
TInt FsNotify::AddDiskSpace(CNotifyInfo* aInfo,TInt aDrive) |
|
813 |
// |
|
814 |
// |
|
815 |
// |
|
816 |
{ |
|
817 |
__ASSERT_DEBUG(aInfo->Type()==CNotifyInfo::EDiskSpace,Fault(EBadDiskNotifyType)); |
|
818 |
__ASSERT_DEBUG((aDrive>=EDriveA && aDrive<=EDriveZ),Fault(EDiskBadIndex1)); |
|
819 |
__PRINT2(_L("FsNotify::AddDiskSpace() drive=%d,info=0x%x"),aDrive,aInfo); |
|
820 |
return(iDiskSpaceQues[aDrive].AddNotify(aInfo)); |
|
821 |
} |
|
822 |
||
823 |
TInt FsNotify::AddDebug(CNotifyInfo* aDebugInfo) |
|
824 |
// |
|
825 |
// |
|
826 |
// |
|
827 |
{ |
|
828 |
__ASSERT_DEBUG(aDebugInfo->Type()==CNotifyInfo::EDebugChange,Fault(EBadDebugNotifyType)); |
|
829 |
__PRINT1(_L("FsNotify::AddDebug() info=0x%x"),aDebugInfo); |
|
830 |
iDebugQue.AddNotify(aDebugInfo); |
|
831 |
return(KErrNone); |
|
832 |
} |
|
833 |
||
834 |
TInt FsNotify::AddDismountNotify(CNotifyInfo* aDismountNotifyInfo) |
|
835 |
// |
|
836 |
// |
|
837 |
// |
|
838 |
{ |
|
839 |
__ASSERT_DEBUG(aDismountNotifyInfo->Type()==CNotifyInfo::EDismount,Fault(EBadDismountNotifyType)); |
|
840 |
__PRINT1(_L("FsNotify::AddDismountNotify() info=0x%x"),aDismountNotifyInfo); |
|
841 |
iDismountNotifyQue.AddNotify(aDismountNotifyInfo); |
|
842 |
return(KErrNone); |
|
843 |
} |
|
844 |
||
845 |
void FsNotify::HandleChange(CFsRequest* aRequest,TInt aDrive) |
|
846 |
// |
|
847 |
// Check whether any change notifications need to be completed due to aRequest on aDrive |
|
848 |
// |
|
849 |
{ |
|
850 |
__PRINT2(_L("FsNotify::HandleChange() aRequest=0x%x, aDrive=%d"),aRequest,aDrive); |
|
851 |
if(!aRequest->IsChangeNotify()) |
|
852 |
return; |
|
853 |
iChangeQues[ChangeIndex(aDrive)].CheckChange(aRequest); |
|
854 |
iChangeQues[ChangeIndex(KDriveInvalid)].CheckChange(aRequest); |
|
855 |
} |
|
856 |
||
857 |
||
858 |
void FsNotify::HandleDiskSpace(CFsRequest* aRequest,TInt aDrive) |
|
859 |
// |
|
860 |
// Check whether any disk space notifications need to be completed due to aRequest on aDrive |
|
861 |
// |
|
862 |
{ |
|
863 |
__ASSERT_DEBUG((aDrive>=EDriveA && aDrive<=EDriveZ) || aDrive==KDriveInvalid,Fault(EDiskBadIndex2)); |
|
864 |
__PRINT2(_L("FsNotify::HandleDiskSpace() aRequest=0x%x, aDrive=%d"),aRequest,aDrive); |
|
865 |
||
866 |
if(!aRequest->Operation()->IsDiskSpaceNotify()) |
|
867 |
return; |
|
868 |
TInt f = aRequest->Operation()->Function(); |
|
869 |
if ((f == EFsFileWrite || f == EFsFileWriteDirty) && !((CFsClientMessageRequest*)aRequest)->IsFreeChanged()) |
|
870 |
return; |
|
871 |
if (FsThreadManager::IsDriveThread(aDrive,EFalse)) |
|
872 |
iDiskSpaceQues[aDrive].CheckDiskSpace(); |
|
873 |
} |
|
874 |
||
875 |
void FsNotify::HandleDiskSpace(TInt aDrive, TInt64& aFreeSpace) |
|
876 |
// |
|
877 |
// |
|
878 |
// |
|
879 |
{ |
|
880 |
__ASSERT_DEBUG((aDrive>=EDriveA && aDrive<=EDriveZ),Fault(EDiskBadIndex3)); |
|
881 |
__PRINT1(_L("FsNotify::HandleDiskSpace() aDrive=%d"),aDrive); |
|
882 |
iDiskSpaceQues[aDrive].CheckDiskSpace(aFreeSpace); |
|
883 |
} |
|
884 |
||
885 |
void FsNotify::HandleDebug(TUint aFunction) |
|
886 |
// |
|
887 |
// Check whether any debug notifications need to be completed due to aFunction |
|
888 |
// |
|
889 |
{ |
|
890 |
__PRINT1(_L("FsNotify::HandleDebug() aFunction=0x%x"),aFunction); |
|
891 |
if(!(aFunction&KDebugNotifyMask)) |
|
892 |
return; |
|
893 |
iDebugQue.CheckDebug(aFunction); |
|
894 |
} |
|
895 |
||
896 |
void FsNotify::HandleDismount(TNotifyDismountMode aMode, TInt aDrive, TBool aRemove, TInt err) |
|
897 |
// |
|
898 |
// Handle dismount notifications for the given drive |
|
899 |
// |
|
900 |
{ |
|
901 |
__PRINT4(_L("FsNotify::HandleDismount() aMode = %d, aDrive=%d, aRemove=%d, err=%d"),aMode,aDrive,aRemove,err); |
|
902 |
iDismountNotifyQue.CheckDismount(aMode, aDrive, aRemove, err); |
|
903 |
} |
|
904 |
||
905 |
TBool FsNotify::HandlePendingDismount(CSessionFs* aSession, TInt aDrive) |
|
906 |
// |
|
907 |
// Checks if the session has an outstanding notification registered on the drive |
|
908 |
// |
|
909 |
{ |
|
910 |
__PRINT1(_L("FsNotify::HandlePendingDismount() aDrive=%d"),aDrive); |
|
911 |
return iDismountNotifyQue.HandlePendingDismount(aSession, aDrive); |
|
912 |
} |
|
913 |
||
914 |
void FsNotify::DiskChange(TInt aDrive) |
|
915 |
// |
|
916 |
// Complete all notifications in queus due to a disk change |
|
917 |
// |
|
918 |
{ |
|
919 |
__ASSERT_DEBUG((aDrive>=EDriveA && aDrive<=EDriveZ),Fault(EDiskChangeDrive)); |
|
920 |
__PRINT1(_L("FsNotify::DiskChange() aDrive=%d"),aDrive); |
|
921 |
iChangeQues[ChangeIndex(aDrive)].CancelAll(KErrNone); |
|
922 |
iChangeQues[ChangeIndex(KDriveInvalid)].CancelAll(KErrNone); |
|
923 |
iDiskSpaceQues[aDrive].CancelAll(KErrNone); |
|
924 |
iDebugQue.CancelAll(KErrNone); |
|
925 |
||
926 |
// if there are any files containing dirty data, start issuing write-dirty data requests to trigger |
|
927 |
// a critical notifier (CFileCache::HandleWriteDirtyError()) |
|
928 |
// otherwise purge all file caches |
|
929 |
TDrive& drive=TheDrives[aDrive]; |
|
930 |
drive.FlushCachedFileInfo(ETrue); |
|
931 |
} |
|
932 |
||
933 |
||
934 |
void FsNotify::CancelChangeSession(CSessionFs* aSession,TRequestStatus* aStatus) |
|
935 |
// |
|
936 |
// Cancel change notifcation(s) setup by aSession and matching aStatus if not NULL |
|
937 |
// |
|
938 |
{ |
|
939 |
__PRINT2(_L("FsNotify::CancelChangeSession() aSession=0x%x aStatus=0x%x"),aSession,aStatus); |
|
940 |
for(TInt i=0;i<KMaxNotifyQues;++i) |
|
941 |
{ |
|
942 |
TBool isFound=iChangeQues[i].CancelSession(aSession,KErrCancel,aStatus); |
|
943 |
if(aStatus && isFound) |
|
944 |
break; |
|
945 |
} |
|
946 |
} |
|
947 |
||
948 |
void FsNotify::CancelDiskSpaceSession(CSessionFs* aSession,TRequestStatus* aStatus) |
|
949 |
// |
|
950 |
// Cancel disk space notification(s) setup by aSession and matching aStatus if not NULL |
|
951 |
// |
|
952 |
||
953 |
{ |
|
954 |
__PRINT2(_L("FsNotify::CancelDiskSpaceSession() aSession=0x%x aStatus=0x%x"),aSession,aStatus); |
|
955 |
for(TInt i=0;i<KMaxDiskQues;++i) |
|
956 |
{ |
|
957 |
TBool isFound=iDiskSpaceQues[i].CancelSession(aSession,KErrCancel,aStatus); |
|
958 |
if(aStatus && isFound) |
|
959 |
break; |
|
960 |
} |
|
961 |
} |
|
962 |
||
963 |
void FsNotify::CancelDebugSession(CSessionFs* aSession, TRequestStatus* aStatus) |
|
964 |
// |
|
965 |
// Cancel debug notification(s) setup by aSession and matching aStatus if not NULL |
|
966 |
// |
|
967 |
{ |
|
968 |
__PRINT2(_L("FsNotify::CancelDebugSession() aSession=0x%x aStatus=0x%x"),aSession,aStatus); |
|
969 |
iDebugQue.CancelSession(aSession,KErrCancel,aStatus); |
|
970 |
} |
|
971 |
||
286 | 972 |
void FsNotify::CancelDismountNotifySession(CSessionFs* aSession, TRequestStatus* aStatus) |
0 | 973 |
// |
974 |
// Cancel all media removal notification(s) setup by aSession (if aStatus == NULL) |
|
90
947f0dc9f7a8
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
975 |
// else cancels all outstanding notifications(s) for the session |
0 | 976 |
// |
977 |
{ |
|
978 |
__PRINT2(_L("FsNotify::CancelDismountNotifySession() aSession=0x%x aStatus=0x%x"),aSession,aStatus); |
|
286 | 979 |
iDismountNotifyQue.CancelSession(aSession,KErrCancel,aStatus); |
0 | 980 |
} |
981 |
||
982 |
void FsNotify::CancelSession(CSessionFs* aSession) |
|
983 |
// |
|
984 |
// |
|
985 |
// |
|
986 |
{ |
|
987 |
__PRINT(_L("FsNotify::CancelSession")); |
|
988 |
FsNotify::CancelChangeSession(aSession); |
|
989 |
FsNotify::CancelDiskSpaceSession(aSession); |
|
990 |
FsNotify::CancelDebugSession(aSession); |
|
991 |
FsNotify::CancelDismountNotifySession(aSession); |
|
992 |
} |
|
993 |
||
994 |
||
995 |
TInt FsNotify::ChangeIndex(TInt aDrive) |
|
996 |
// |
|
997 |
// |
|
998 |
// |
|
999 |
{ |
|
1000 |
__ASSERT_DEBUG((aDrive>=EDriveA && aDrive<=EDriveZ) || aDrive==KDriveInvalid,Fault(EChangeBadIndex)); |
|
1001 |
if(aDrive==KDriveInvalid) |
|
1002 |
return(0); |
|
1003 |
else |
|
1004 |
return(aDrive+1); |
|
1005 |
} |
|
1006 |