298 |
305 |
299 NKern::ThreadEnterCS(); |
306 NKern::ThreadEnterCS(); |
300 |
307 |
301 // First, locate the specific DObject in question. Cast the handle, but don't use the object... |
308 // First, locate the specific DObject in question. Cast the handle, but don't use the object... |
302 DObject* handleAsObject = (DObject*) params.iHandle; |
309 DObject* handleAsObject = (DObject*) params.iHandle; |
303 handleAsObject = CheckedOpen(params.iType, handleAsObject); |
310 handleAsObject = CheckIfObjectIsInContainer( params.iType, handleAsObject ); |
304 if ( handleAsObject != NULL ) |
311 if ( handleAsObject != NULL ) |
305 { |
312 { |
306 // We found the right object. First get generic info. |
313 // We found the right object. First get generic info. |
307 handleAsObject->FullName( params.iName ); |
314 handleAsObject->FullName( params.iName ); |
308 handleAsObject->Name( params.iNameDetail ); |
315 handleAsObject->Name( params.iNameDetail ); |
309 |
316 |
310 // Using threadAddaption to fetch generic info. |
317 NKern::LockSystem(); |
311 // Implementations of following get functions are actually in DMemSpyDriverOSAdaptionDObject |
318 r = handleAsObject->Open(); |
312 // so it does not matter what adaption to use for generic info. |
319 NKern::UnlockSystem(); |
313 DMemSpyDriverOSAdaptionDThread& threadAddaption = OSAdaption().DThread(); |
320 // |
314 params.iAccessCount = threadAddaption.GetAccessCount( *handleAsObject ); |
321 if ( r == KErrNone ) |
315 params.iUniqueID = threadAddaption.GetUniqueID( *handleAsObject ); |
322 { |
316 params.iProtection = threadAddaption.GetProtection( *handleAsObject ); |
323 // Using threadAddaption to fetch generic info. |
317 params.iAddressOfKernelOwner = threadAddaption.GetAddressOfKernelOwner( *handleAsObject ); |
324 // Implementations of following get functions are actually in DMemSpyDriverOSAdaptionDObject |
|
325 // so it does not matter what adaption to use for generic info. |
|
326 DMemSpyDriverOSAdaptionDThread& threadAddaption = OSAdaption().DThread(); |
|
327 params.iAccessCount = threadAddaption.GetAccessCount( *handleAsObject ); |
|
328 params.iUniqueID = threadAddaption.GetUniqueID( *handleAsObject ); |
|
329 params.iProtection = threadAddaption.GetProtection( *handleAsObject ); |
|
330 params.iAddressOfKernelOwner = threadAddaption.GetAddressOfKernelOwner( *handleAsObject ); |
|
331 // |
|
332 handleAsObject->Close( NULL ); |
|
333 } |
318 |
334 |
319 // Get type-specific info. |
335 // Get type-specific info. |
320 if ( params.iType == EMemSpyDriverContainerTypeThread ) |
336 if ( params.iType == EMemSpyDriverContainerTypeThread ) |
321 { |
337 { |
322 TRACE( Kern::Printf("DMemSpyDriverLogChanContainers::GetGenericHandleInfo() - EMemSpyDriverContainerTypeThread" )); |
338 TRACE( Kern::Printf("DMemSpyDriverLogChanContainers::GetGenericHandleInfo() - EMemSpyDriverContainerTypeThread" )); |
323 |
339 |
324 DThread* object = (DThread*) handleAsObject; |
340 DThread* object = (DThread*) handleAsObject; |
325 DMemSpyDriverOSAdaptionDThread& threadAdaption = OSAdaption().DThread(); |
341 NKern::LockSystem(); |
326 // |
342 r = object->Open(); |
327 params.iId = threadAdaption.GetId( *object ); |
343 NKern::UnlockSystem(); |
328 params.iPriority = threadAdaption.GetPriority( *object ); |
344 // |
329 params.iAddressOfOwningProcess = threadAdaption.GetAddressOfOwningProcess( *object ); |
345 if ( r == KErrNone ) |
330 threadAdaption.GetNameOfOwningProcess( *object, params.iNameOfOwner ); |
346 { |
|
347 DMemSpyDriverOSAdaptionDThread& threadAdaption = OSAdaption().DThread(); |
|
348 // |
|
349 params.iId = threadAdaption.GetId( *object ); |
|
350 params.iPriority = threadAdaption.GetPriority( *object ); |
|
351 params.iAddressOfOwningProcess = threadAdaption.GetAddressOfOwningProcess( *object ); |
|
352 threadAdaption.GetNameOfOwningProcess( *object, params.iNameOfOwner ); |
|
353 // |
|
354 object->Close( NULL ); |
|
355 } |
331 } |
356 } |
332 else if ( params.iType == EMemSpyDriverContainerTypeProcess ) |
357 else if ( params.iType == EMemSpyDriverContainerTypeProcess ) |
333 { |
358 { |
334 TRACE( Kern::Printf("DMemSpyDriverLogChanContainers::GetGenericHandleInfo() - EMemSpyDriverContainerTypeProcess" )); |
359 TRACE( Kern::Printf("DMemSpyDriverLogChanContainers::GetGenericHandleInfo() - EMemSpyDriverContainerTypeProcess" )); |
335 |
360 |
336 DProcess* object = (DProcess*) handleAsObject; |
361 DProcess* object = (DProcess*) handleAsObject; |
337 DMemSpyDriverOSAdaptionDProcess& processAdaption = OSAdaption().DProcess(); |
362 NKern::LockSystem(); |
338 // |
363 r = object->Open(); |
339 params.iId = processAdaption.GetId( *object ); |
364 NKern::UnlockSystem(); |
340 // |
365 // |
341 params.iPriority = processAdaption.GetPriority( *object ); |
366 if ( r == KErrNone ) |
342 params.iAddressOfOwningProcess = processAdaption.GetAddressOfOwningProcess( *object ); |
367 { |
343 params.iCreatorId = processAdaption.GetCreatorId( *object ); |
368 DMemSpyDriverOSAdaptionDProcess& processAdaption = OSAdaption().DProcess(); |
344 params.iSecurityZone = processAdaption.GetSecurityZone( *object ); |
369 // |
345 params.iAttributes = processAdaption.GetAttributes( *object ); |
370 params.iId = processAdaption.GetId( *object ); |
346 params.iAddressOfDataBssStackChunk = processAdaption.GetAddressOfDataBssStackChunk( *object ); |
371 // |
|
372 params.iPriority = processAdaption.GetPriority( *object ); |
|
373 params.iAddressOfOwningProcess = processAdaption.GetAddressOfOwningProcess( *object ); |
|
374 params.iCreatorId = processAdaption.GetCreatorId( *object ); |
|
375 params.iSecurityZone = processAdaption.GetSecurityZone( *object ); |
|
376 params.iAttributes = processAdaption.GetAttributes( *object ); |
|
377 params.iAddressOfDataBssStackChunk = processAdaption.GetAddressOfDataBssStackChunk( *object ); |
|
378 // |
|
379 object->Close( NULL ); |
|
380 } |
347 } |
381 } |
348 else if ( params.iType == EMemSpyDriverContainerTypeChunk ) |
382 else if ( params.iType == EMemSpyDriverContainerTypeChunk ) |
349 { |
383 { |
350 TRACE( Kern::Printf("DMemSpyDriverLogChanContainers::GetGenericHandleInfo() - EMemSpyDriverContainerTypeChunk" )); |
384 TRACE( Kern::Printf("DMemSpyDriverLogChanContainers::GetGenericHandleInfo() - EMemSpyDriverContainerTypeChunk" )); |
351 |
385 |
352 DChunk* object = (DChunk*) handleAsObject; |
386 DChunk* object = (DChunk*) handleAsObject; |
353 DMemSpyDriverOSAdaptionDChunk& ca = OSAdaption().DChunk(); |
387 NKern::LockSystem(); |
354 // |
388 r = object->Open(); |
355 params.iSize = ca.GetSize( *object ); |
389 NKern::UnlockSystem(); |
356 params.iId = ca.GetOwningProcessId( *object ); |
390 // |
357 params.iAddressOfOwningProcess = ca.GetAddressOfOwningProcess( *object ); |
391 if ( r == KErrNone ) |
358 params.iMaxSize = ca.GetMaxSize( *object ); |
392 { |
359 params.iBottom = ca.GetBottom( *object ); |
393 DMemSpyDriverOSAdaptionDChunk& ca = OSAdaption().DChunk(); |
360 params.iTop = ca.GetTop( *object ); |
394 // |
361 params.iAttributes = ca.GetAttributes( *object ); |
395 params.iSize = ca.GetSize( *object ); |
362 params.iStartPos = ca.GetStartPos( *object ); |
396 params.iId = ca.GetOwningProcessId( *object ); |
363 params.iControllingOwner = ca.GetControllingOwnerId( *object ); |
397 params.iAddressOfOwningProcess = ca.GetAddressOfOwningProcess( *object ); |
364 params.iRestrictions = ca.GetRestrictions( *object ); |
398 params.iMaxSize = ca.GetMaxSize( *object ); |
365 params.iMapAttr = ca.GetMapAttr( *object ); |
399 params.iBottom = ca.GetBottom( *object ); |
366 params.iChunkType = ca.GetType( *object ); |
400 params.iTop = ca.GetTop( *object ); |
367 ca.GetNameOfOwningProcess( *object, params.iNameOfOwner ); |
401 params.iAttributes = ca.GetAttributes( *object ); |
|
402 params.iStartPos = ca.GetStartPos( *object ); |
|
403 params.iControllingOwner = ca.GetControllingOwnerId( *object ); |
|
404 params.iRestrictions = ca.GetRestrictions( *object ); |
|
405 params.iMapAttr = ca.GetMapAttr( *object ); |
|
406 params.iChunkType = ca.GetType( *object ); |
|
407 ca.GetNameOfOwningProcess( *object, params.iNameOfOwner ); |
|
408 // |
|
409 object->Close( NULL ); |
|
410 } |
368 } |
411 } |
369 else if ( params.iType == EMemSpyDriverContainerTypeLibrary ) |
412 else if ( params.iType == EMemSpyDriverContainerTypeLibrary ) |
370 { |
413 { |
371 TRACE( Kern::Printf("DMemSpyDriverLogChanContainers::GetGenericHandleInfo() - EMemSpyDriverContainerTypeLibrary" )); |
414 TRACE( Kern::Printf("DMemSpyDriverLogChanContainers::GetGenericHandleInfo() - EMemSpyDriverContainerTypeLibrary" )); |
372 |
415 |
373 Kern::AccessCode(); |
416 Kern::AccessCode(); |
374 // |
417 // |
375 DLibrary* object = (DLibrary*) handleAsObject; |
418 DLibrary* object = (DLibrary*) handleAsObject; |
376 DMemSpyDriverOSAdaptionDCodeSeg& csa = OSAdaption().DCodeSeg(); |
419 NKern::LockSystem(); |
377 DCodeSeg* codeSeg = csa.GetCodeSeg( *object ); |
420 r = object->Open(); |
378 params.iAddressOfCodeSeg = (TUint8*)codeSeg; |
421 NKern::UnlockSystem(); |
379 params.iMapCount = csa.GetMapCount( *object ); |
422 // |
380 params.iState = csa.GetState( *object ); |
423 if ( r == KErrNone ) |
381 // |
424 { |
382 if ( codeSeg ) |
425 DMemSpyDriverOSAdaptionDCodeSeg& csa = OSAdaption().DCodeSeg(); |
383 { |
426 DCodeSeg* codeSeg = csa.GetCodeSeg( *object ); |
384 params.iSize = csa.GetSize( *codeSeg ); |
427 params.iAddressOfCodeSeg = (TUint8*)codeSeg; |
385 } |
428 params.iMapCount = csa.GetMapCount( *object ); |
386 else |
429 params.iState = csa.GetState( *object ); |
387 { |
430 // |
388 r = KErrNotFound; |
431 if ( codeSeg ) |
|
432 { |
|
433 params.iSize = csa.GetSize( *codeSeg ); |
|
434 } |
|
435 else |
|
436 { |
|
437 r = KErrNotFound; |
|
438 } |
|
439 // |
|
440 object->Close( NULL ); |
389 } |
441 } |
390 // |
442 // |
391 Kern::EndAccessCode(); |
443 Kern::EndAccessCode(); |
392 } |
444 } |
393 else if ( params.iType == EMemSpyDriverContainerTypeSemaphore ) |
445 else if ( params.iType == EMemSpyDriverContainerTypeSemaphore ) |
394 { |
446 { |
395 TRACE( Kern::Printf("DMemSpyDriverLogChanContainers::GetGenericHandleInfo() - EMemSpyDriverContainerTypeSemaphore" )); |
447 TRACE( Kern::Printf("DMemSpyDriverLogChanContainers::GetGenericHandleInfo() - EMemSpyDriverContainerTypeSemaphore" )); |
396 |
448 |
397 DSemaphore* object = (DSemaphore*) handleAsObject; |
449 DSemaphore* object = (DSemaphore*) handleAsObject; |
398 DMemSpyDriverOSAdaptionDSemaphore& sa = OSAdaption().DSemaphore(); |
450 NKern::LockSystem(); |
399 params.iCount = sa.GetCount( *object ); |
451 r = object->Open(); |
400 params.iResetting = sa.GetResetting( *object ); |
452 NKern::UnlockSystem(); |
|
453 // |
|
454 if ( r == KErrNone ) |
|
455 { |
|
456 DMemSpyDriverOSAdaptionDSemaphore& sa = OSAdaption().DSemaphore(); |
|
457 params.iCount = sa.GetCount( *object ); |
|
458 params.iResetting = sa.GetResetting( *object ); |
|
459 // |
|
460 object->Close( NULL ); |
|
461 } |
401 } |
462 } |
402 else if ( params.iType == EMemSpyDriverContainerTypeMutex ) |
463 else if ( params.iType == EMemSpyDriverContainerTypeMutex ) |
403 { |
464 { |
404 TRACE( Kern::Printf("DMemSpyDriverLogChanContainers::GetGenericHandleInfo() - EMemSpyDriverContainerTypeMutex" )); |
465 TRACE( Kern::Printf("DMemSpyDriverLogChanContainers::GetGenericHandleInfo() - EMemSpyDriverContainerTypeMutex" )); |
405 |
466 |
406 DMutex* object = (DMutex*) handleAsObject; |
467 DMutex* object = (DMutex*) handleAsObject; |
407 DMemSpyDriverOSAdaptionDMutex& ma = OSAdaption().DMutex(); |
468 NKern::LockSystem(); |
408 // |
469 r = object->Open(); |
409 params.iCount = ma.GetHoldCount( *object ); |
470 NKern::UnlockSystem(); |
410 params.iWaitCount = ma.GetWaitCount( *object ); |
471 // |
411 params.iResetting = ma.GetResetting( *object ); |
472 if ( r == KErrNone ) |
412 params.iOrder = ma.GetOrder( *object ); |
473 { |
|
474 DMemSpyDriverOSAdaptionDMutex& ma = OSAdaption().DMutex(); |
|
475 // |
|
476 params.iCount = ma.GetHoldCount( *object ); |
|
477 params.iWaitCount = ma.GetWaitCount( *object ); |
|
478 params.iResetting = ma.GetResetting( *object ); |
|
479 params.iOrder = ma.GetOrder( *object ); |
|
480 // |
|
481 object->Close( NULL ); |
|
482 } |
413 } |
483 } |
414 else if ( params.iType == EMemSpyDriverContainerTypeTimer ) |
484 else if ( params.iType == EMemSpyDriverContainerTypeTimer ) |
415 { |
485 { |
416 TRACE( Kern::Printf("DMemSpyDriverLogChanContainers::GetGenericHandleInfo() - EMemSpyDriverContainerTypeTimer" )); |
486 TRACE( Kern::Printf("DMemSpyDriverLogChanContainers::GetGenericHandleInfo() - EMemSpyDriverContainerTypeTimer" )); |
417 |
487 |
418 // Get timer properties |
488 // Get timer properties |
419 DTimer* object = (DTimer*) handleAsObject; |
489 DTimer* object = (DTimer*) handleAsObject; |
420 DMemSpyDriverOSAdaptionDTimer& ta = OSAdaption().DTimer(); |
490 NKern::LockSystem(); |
421 // |
491 r = object->Open(); |
422 params.iTimerType = MapToMemSpyTimerType( ta.GetType( *object ) ); |
492 NKern::UnlockSystem(); |
423 params.iTimerState = MapToMemSpyTimerState( ta.GetState( *object ) ); |
493 // |
|
494 if ( r == KErrNone ) |
|
495 { |
|
496 DMemSpyDriverOSAdaptionDTimer& ta = OSAdaption().DTimer(); |
|
497 // |
|
498 params.iTimerType = MapToMemSpyTimerType( ta.GetType( *object ) ); |
|
499 params.iTimerState = MapToMemSpyTimerState( ta.GetState( *object ) ); |
|
500 // |
|
501 object->Close( NULL ); |
|
502 } |
424 } |
503 } |
425 else if ( params.iType == EMemSpyDriverContainerTypeServer ) |
504 else if ( params.iType == EMemSpyDriverContainerTypeServer ) |
426 { |
505 { |
427 TRACE( Kern::Printf("DMemSpyDriverLogChanContainers::GetGenericHandleInfo() - EMemSpyDriverContainerTypeServer" )); |
506 TRACE( Kern::Printf("DMemSpyDriverLogChanContainers::GetGenericHandleInfo() - EMemSpyDriverContainerTypeServer" )); |
428 |
507 |
429 DServer* object = (DServer*) handleAsObject; |
508 DServer* object = (DServer*) handleAsObject; |
430 DMemSpyDriverOSAdaptionDServer& sa = OSAdaption().DServer(); |
509 NKern::LockSystem(); |
431 // |
510 r = object->Open(); |
432 params.iCount = sa.GetSessionCount( *object ); |
511 NKern::UnlockSystem(); |
433 params.iId = sa.GetOwningThreadId( *object ); |
512 // |
434 params.iSessionType = sa.GetSessionType( *object ); |
513 if ( r == KErrNone ) |
435 params.iAddressOfOwningThread = sa.GetAddressOfOwningThread( *object ); |
514 { |
436 sa.GetNameOfOwningThread( *object, params.iNameOfOwner ); |
515 DMemSpyDriverOSAdaptionDServer& sa = OSAdaption().DServer(); |
|
516 // |
|
517 params.iCount = sa.GetSessionCount( *object ); |
|
518 params.iId = sa.GetOwningThreadId( *object ); |
|
519 params.iSessionType = sa.GetSessionType( *object ); |
|
520 params.iAddressOfOwningThread = sa.GetAddressOfOwningThread( *object ); |
|
521 sa.GetNameOfOwningThread( *object, params.iNameOfOwner ); |
|
522 // |
|
523 object->Close( NULL ); |
|
524 } |
437 } |
525 } |
438 else if ( params.iType == EMemSpyDriverContainerTypeSession ) |
526 else if ( params.iType == EMemSpyDriverContainerTypeSession ) |
439 { |
527 { |
440 TRACE( Kern::Printf("DMemSpyDriverLogChanContainers::GetGenericHandleInfo() - EMemSpyDriverContainerTypeSession" )); |
528 TRACE( Kern::Printf("DMemSpyDriverLogChanContainers::GetGenericHandleInfo() - EMemSpyDriverContainerTypeSession" )); |
441 |
529 |
442 DSession* object = (DSession*) handleAsObject; |
530 DSession* object = (DSession*) handleAsObject; |
443 DMemSpyDriverOSAdaptionDServer& serverAdaption = OSAdaption().DServer(); |
531 NKern::LockSystem(); |
444 DMemSpyDriverOSAdaptionDSession& sessionAdaption = OSAdaption().DSession(); |
532 r = object->Open(); |
445 |
533 NKern::UnlockSystem(); |
446 params.iName.Zero(); |
534 // |
447 |
535 TRACE( Kern::Printf("DMemSpyDriverLogChanContainers::GetGenericHandleInfo() - open error: %d", r )); |
448 TRACE( Kern::Printf("DMemSpyDriverLogChanContainers::GetGenericHandleInfo() - getting session type..." )); |
536 if ( r == KErrNone ) |
449 params.iSessionType = sessionAdaption.GetSessionType( *object ); |
537 { |
450 params.iAddressOfServer = sessionAdaption.GetAddressOfServer( *object ); |
538 DMemSpyDriverOSAdaptionDServer& serverAdaption = OSAdaption().DServer(); |
451 params.iTotalAccessCount = sessionAdaption.GetTotalAccessCount( *object ); |
539 DMemSpyDriverOSAdaptionDSession& sessionAdaption = OSAdaption().DSession(); |
452 params.iSvrSessionType = sessionAdaption.GetSessionType( *object ); |
540 |
453 params.iMsgCount = sessionAdaption.GetMsgCount( *object ); |
541 params.iName.Zero(); |
454 params.iMsgLimit = sessionAdaption.GetMsgLimit( *object ); |
542 |
455 |
543 TRACE( Kern::Printf("DMemSpyDriverLogChanContainers::GetGenericHandleInfo() - getting session type..." )); |
456 // Its more useful in this instance, if the name object |
544 params.iSessionType = sessionAdaption.GetSessionType( *object ); |
457 // points to the server which the session is connected to |
545 params.iAddressOfServer = sessionAdaption.GetAddressOfServer( *object ); |
458 // (rather than displaying a process-local name). |
546 params.iTotalAccessCount = sessionAdaption.GetTotalAccessCount( *object ); |
459 DServer* server = (DServer*)CheckedOpen(EMemSpyDriverContainerTypeServer, sessionAdaption.GetServer( *object )); |
547 params.iSvrSessionType = sessionAdaption.GetSessionType( *object ); |
460 TRACE( Kern::Printf("DMemSpyDriverLogChanContainers::GetGenericHandleInfo() - getting full name, server: 0x%08x", server )); |
548 params.iMsgCount = sessionAdaption.GetMsgCount( *object ); |
461 // |
549 params.iMsgLimit = sessionAdaption.GetMsgLimit( *object ); |
462 if ( server ) |
550 |
463 { |
551 // Its more useful in this instance, if the name object |
464 server->FullName( params.iName ); |
552 // points to the server which the session is connected to |
465 |
553 // (rather than displaying a process-local name). |
466 // Continue as normal for other items |
554 DServer* server = sessionAdaption.GetServer( *object ); |
467 TRACE( Kern::Printf("DMemSpyDriverLogChanContainers::GetGenericHandleInfo() - server: 0x%08x, server->iOwningThread: 0x%08x", server, server->iOwningThread )); |
555 TRACE( Kern::Printf("DMemSpyDriverLogChanContainers::GetGenericHandleInfo() - getting full name, server: 0x%08x", server )); |
468 DThread* owningThread = serverAdaption.GetOwningThread( *server ); |
556 // |
469 if ( owningThread ) |
557 if ( server ) |
470 { |
558 { |
471 TRACE( Kern::Printf("DMemSpyDriverLogChanContainers::GetGenericHandleInfo() - getting server thread id..." )); |
559 NKern::LockSystem(); |
472 params.iId = serverAdaption.GetOwningThreadId( *server ); |
560 r = server->Open(); |
|
561 NKern::UnlockSystem(); |
|
562 |
|
563 if ( r == KErrNone ) |
|
564 { |
|
565 server->FullName( params.iName ); |
|
566 |
|
567 // Continue as normal for other items |
|
568 TRACE( Kern::Printf("DMemSpyDriverLogChanContainers::GetGenericHandleInfo() - server: 0x%08x, server->iOwningThread: 0x%08x", server, server->iOwningThread )); |
|
569 DThread* owningThread = serverAdaption.GetOwningThread( *server ); |
|
570 if ( owningThread ) |
|
571 { |
|
572 TRACE( Kern::Printf("DMemSpyDriverLogChanContainers::GetGenericHandleInfo() - getting server thread id..." )); |
|
573 params.iId = serverAdaption.GetOwningThreadId( *server ); |
|
574 } |
|
575 |
|
576 server->Close( NULL ); |
|
577 } |
473 } |
578 } |
474 |
579 |
475 server->Close(NULL); |
580 TRACE( Kern::Printf("DMemSpyDriverLogChanContainers::GetGenericHandleInfo() - closing session object..." )); |
|
581 object->Close( NULL ); |
476 } |
582 } |
477 } |
583 } |
478 else if ( params.iType == EMemSpyDriverContainerTypeLogicalDevice ) |
584 else if ( params.iType == EMemSpyDriverContainerTypeLogicalDevice ) |
479 { |
585 { |
480 TRACE( Kern::Printf("DMemSpyDriverLogChanContainers::GetGenericHandleInfo() - EMemSpyDriverContainerTypeLogicalDevice" )); |
586 TRACE( Kern::Printf("DMemSpyDriverLogChanContainers::GetGenericHandleInfo() - EMemSpyDriverContainerTypeLogicalDevice" )); |
481 |
587 |
482 DLogicalDevice* object = (DLogicalDevice*) handleAsObject; |
588 DLogicalDevice* object = (DLogicalDevice*) handleAsObject; |
483 DMemSpyDriverOSAdaptionDLogicalDevice& lda = OSAdaption().DLogicalDevice(); |
589 NKern::LockSystem(); |
484 params.iOpenChannels = lda.GetOpenChannels( *object ); |
590 r = object->Open(); |
485 params.iVersion = lda.GetVersion( *object ); |
591 NKern::UnlockSystem(); |
486 params.iParseMask = lda.GetParseMask( *object ); |
592 // |
487 params.iUnitsMask = lda.GetUnitsMask( *object ); |
593 if ( r == KErrNone ) |
|
594 { |
|
595 DMemSpyDriverOSAdaptionDLogicalDevice& lda = OSAdaption().DLogicalDevice(); |
|
596 params.iOpenChannels = lda.GetOpenChannels( *object ); |
|
597 params.iVersion = lda.GetVersion( *object ); |
|
598 params.iParseMask = lda.GetParseMask( *object ); |
|
599 params.iUnitsMask = lda.GetUnitsMask( *object ); |
|
600 // |
|
601 object->Close( NULL ); |
|
602 } |
488 } |
603 } |
489 else if ( params.iType == EMemSpyDriverContainerTypePhysicalDevice ) |
604 else if ( params.iType == EMemSpyDriverContainerTypePhysicalDevice ) |
490 { |
605 { |
491 TRACE( Kern::Printf("DMemSpyDriverLogChanContainers::GetGenericHandleInfo() - EMemSpyDriverContainerTypePhysicalDevice" )); |
606 TRACE( Kern::Printf("DMemSpyDriverLogChanContainers::GetGenericHandleInfo() - EMemSpyDriverContainerTypePhysicalDevice" )); |
492 |
607 |
493 DPhysicalDevice* object = (DPhysicalDevice*) handleAsObject; |
608 DPhysicalDevice* object = (DPhysicalDevice*) handleAsObject; |
494 DMemSpyDriverOSAdaptionDPhysicalDevice& pda = OSAdaption().DPhysicalDevice(); |
609 NKern::LockSystem(); |
495 params.iVersion = pda.GetVersion( *object ); |
610 r = object->Open(); |
496 params.iUnitsMask = pda.GetUnitsMask( *object ); |
611 NKern::UnlockSystem(); |
497 params.iAddressOfCodeSeg = pda.GetAddressOfCodeSeg( *object ); |
612 // |
|
613 if ( r == KErrNone ) |
|
614 { |
|
615 DMemSpyDriverOSAdaptionDPhysicalDevice& pda = OSAdaption().DPhysicalDevice(); |
|
616 params.iVersion = pda.GetVersion( *object ); |
|
617 params.iUnitsMask = pda.GetUnitsMask( *object ); |
|
618 params.iAddressOfCodeSeg = pda.GetAddressOfCodeSeg( *object ); |
|
619 // |
|
620 object->Close( NULL ); |
|
621 } |
498 } |
622 } |
499 else if ( params.iType == EMemSpyDriverContainerTypeLogicalChannel ) |
623 else if ( params.iType == EMemSpyDriverContainerTypeLogicalChannel ) |
500 { |
624 { |
501 TRACE( Kern::Printf("DMemSpyDriverLogChanContainers::GetGenericHandleInfo() - EMemSpyDriverContainerTypeLogicalChannel" )); |
625 TRACE( Kern::Printf("DMemSpyDriverLogChanContainers::GetGenericHandleInfo() - EMemSpyDriverContainerTypeLogicalChannel" )); |
502 } |
626 } |
503 else if ( params.iType == EMemSpyDriverContainerTypeChangeNotifier ) |
627 else if ( params.iType == EMemSpyDriverContainerTypeChangeNotifier ) |
504 { |
628 { |
505 TRACE( Kern::Printf("DMemSpyDriverLogChanContainers::GetGenericHandleInfo() - EMemSpyDriverContainerTypeChangeNotifier" )); |
629 TRACE( Kern::Printf("DMemSpyDriverLogChanContainers::GetGenericHandleInfo() - EMemSpyDriverContainerTypeChangeNotifier" )); |
506 |
630 |
507 DChangeNotifier* object = (DChangeNotifier*) handleAsObject; |
631 DChangeNotifier* object = (DChangeNotifier*) handleAsObject; |
508 DMemSpyDriverOSAdaptionDChangeNotifier& cna = OSAdaption().DChangeNotifier(); |
632 NKern::LockSystem(); |
509 params.iChanges = cna.GetChanges( *object ); |
633 r = object->Open(); |
510 params.iAddressOfOwningThread = cna.GetAddressOfOwningThread( *object ); |
634 NKern::UnlockSystem(); |
511 cna.GetNameOfOwningThread( *object, params.iNameOfOwner ); |
635 // |
|
636 if ( r == KErrNone ) |
|
637 { |
|
638 DMemSpyDriverOSAdaptionDChangeNotifier& cna = OSAdaption().DChangeNotifier(); |
|
639 params.iChanges = cna.GetChanges( *object ); |
|
640 params.iAddressOfOwningThread = cna.GetAddressOfOwningThread( *object ); |
|
641 cna.GetNameOfOwningThread( *object, params.iNameOfOwner ); |
|
642 // |
|
643 object->Close( NULL ); |
|
644 } |
512 } |
645 } |
513 else if ( params.iType == EMemSpyDriverContainerTypeUndertaker ) |
646 else if ( params.iType == EMemSpyDriverContainerTypeUndertaker ) |
514 { |
647 { |
515 TRACE( Kern::Printf("DMemSpyDriverLogChanContainers::GetGenericHandleInfo() - EMemSpyDriverContainerTypeUndertaker" )); |
648 TRACE( Kern::Printf("DMemSpyDriverLogChanContainers::GetGenericHandleInfo() - EMemSpyDriverContainerTypeUndertaker" )); |
516 |
649 |
517 DUndertaker* object = (DUndertaker*) handleAsObject; |
650 DUndertaker* object = (DUndertaker*) handleAsObject; |
518 DMemSpyDriverOSAdaptionDUndertaker& uta = OSAdaption().DUndertaker(); |
651 NKern::LockSystem(); |
519 params.iAddressOfOwningThread = uta.GetAddressOfOwningThread( *object ); |
652 r = object->Open(); |
520 uta.GetNameOfOwningThread( *object, params.iNameOfOwner ); |
653 NKern::UnlockSystem(); |
|
654 // |
|
655 if ( r == KErrNone ) |
|
656 { |
|
657 DMemSpyDriverOSAdaptionDUndertaker& uta = OSAdaption().DUndertaker(); |
|
658 params.iAddressOfOwningThread = uta.GetAddressOfOwningThread( *object ); |
|
659 uta.GetNameOfOwningThread( *object, params.iNameOfOwner ); |
|
660 // |
|
661 object->Close( NULL ); |
|
662 } |
521 } |
663 } |
522 else if ( params.iType == EMemSpyDriverContainerTypeMsgQueue ) |
664 else if ( params.iType == EMemSpyDriverContainerTypeMsgQueue ) |
523 { |
665 { |
524 TRACE( Kern::Printf("DMemSpyDriverLogChanContainers::GetGenericHandleInfo() - EMemSpyDriverContainerTypeMsgQueue" )); |
666 TRACE( Kern::Printf("DMemSpyDriverLogChanContainers::GetGenericHandleInfo() - EMemSpyDriverContainerTypeMsgQueue" )); |
525 } |
667 } |