MTP devices are not block devices. MTP is a file transfer protocol like FTP.
This is just remounting with RAW FSD, so if a minifilter doesn’t allow access the operation will fail. When a volume is opened for anything beside read attributes(IIRC) the RAW FSD is mounted.
Below are call stacks for a format operation. A FilterManager’s object attached to a RAW FSD object is clearly visible.
The RAW FSD mounting
00 nt!RawDispatch
01 nt!IopDeleteFile
02 nt!ObpRemoveObjectRoutine
03 nt!ObfDereferenceObjectWithTag
04 nt!ObfDereferenceObject
05 nt!RawMountVolume
06 nt!RawFileSystemControl
07 nt!RawDispatch
08 nt!IofCallDriver
09 fltmgr!FltpFsControlMountVolume
0a fltmgr!FltpFsControl
0b nt!IofCallDriver
0c nt!IopMountVolume
0d nt!IopCheckVpbMounted
0e nt!IopParseDevice
0f nt!ObpLookupObjectName
10 nt!ObOpenObjectByName
11 nt!IopCreateFile
12 nt!NtOpenFile
13 nt!KiFastCallEntry
14 ntdll!KiFastSystemCallRet
15 ntdll!NtOpenFile
WARNING: Stack unwind information not available. Following frames may be wrong.
16 ifsutil
17 ifsutil
18 ifsutil
19 FMIFS!ConvertSectorSizeIfNeeded
1a FMIFS!FormatEx2
1b SHELL32!CFormatEngine::ExecuteFormat
1c SHELL32!FormatThreadProc
1d kernel32!BaseThreadInitThunk
1e ntdll!__RtlUserThreadStart
1f ntdll!_RtlUserThreadStart
The RAW file object opening to perform IO
00 nt!RawDispatch
01 fltmgr!FltpLegacyProcessingAfterPreCallbacksCompleted
02 fltmgr!FltpCreate
03 nt!IofCallDriver
04 nt!IopParseDevice
05 nt!ObpLookupObjectName
06 nt!ObOpenObjectByName
07 nt!IopCreateFile
08 nt!NtOpenFile
09 nt!KiFastCallEntry
0a ntdll!KiFastSystemCallRet
0b ntdll!NtOpenFile
WARNING: Stack unwind information not available. Following frames may be wrong.
0c ifsutil
0d ifsutil
0e ifsutil
0f FMIFS!ConvertSectorSizeIfNeeded
10 FMIFS!FormatEx2
11 SHELL32!CFormatEngine::ExecuteFormat
12 SHELL32!FormatThreadProc
13 kernel32!BaseThreadInitThunk
14 ntdll!__RtlUserThreadStart
15 ntdll!_RtlUserThreadStart
The RAW file object IO to format the volume
00 nt!RawDispatch
01 fltmgr!FltpLegacyProcessingAfterPreCallbacksCompleted
02 fltmgr!FltpDispatch
03 nt!IofCallDriver
04 nt!IopSynchronousServiceTail
05 nt!NtWriteFile
06 nt!KiFastCallEntry
07 ntdll!KiFastSystemCallRet
08 ntdll!NtWriteFile
WARNING: Stack unwind information not available. Following frames may be wrong.
09 ifsutil
0a ifsutil
0b ifsutil
0c UNTFS!NTFS_VOL::Initialize
0d UNTFS!FormatEx
0e FMIFS!FormatEx2
0f SHELL32!CFormatEngine::ExecuteFormat
10 SHELL32!FormatThreadProc
11 kernel32!BaseThreadInitThunk
12 ntdll!__RtlUserThreadStart
13 ntdll!_RtlUserThreadStart
0: kd> !devstack 0x870c6b40
!DevObj !DrvObj !DevExt ObjectName
870c6020 \Driver\volsnap 870c60d8
870d4c80 \Driver\fvevol 870d4d38
870c6b40 \Driver\volmgr 870c6bf8 HarddiskVolume3
!DevNode 870c1c98 :
DeviceInst is “STORAGE\Volume_??_USBSTOR#Disk&Ven_SanDisk&Prod_Cruzer_Facet&Rev_1.27#4C530007661201117570&0#{53f56307-b6bf-11d0-94f2-00a0c91efb8b}”
ServiceName is “volsnap”
kd> !devobj 870c6b40
Device object (870c6b40) is for:
HarddiskVolume3 \Driver\volmgr DriverObject 862cf490
Current Irp 00000000 RefCount 1 Type 00000007 Flags 00003050
Vpb 879ff308 Dacl 903c7c9c DevExt 870c6bf8 DevObjExt 870c6ce0 Dope 870afc48 DevNode 870c1c98
ExtensionFlags (0000000000)
Characteristics (0x00000001) FILE_REMOVABLE_MEDIA
AttachedDevice (Upper) 870d4c80 \Driver\fvevol
Device queue is not busy.
1: kd> !vpb 879ff308
Vpb at 0x879ff308
Flags: 0x21 mounted
DeviceObject: 0x863c3e30
RealDevice: 0x870c6b40
RefCount: 1
Volume Label:
1: kd> !devstack 0x863c3e30
!DevObj !DrvObj !DevExt ObjectName
864981d0 \FileSystem\FltMgr 86498288
863c3e30 \FileSystem\RAW 863c3ee8