MCPcopy Create free account
hub / github.com/bobranten/Ext4Fsd / Ext2VolumeArrivalNotify

Function Ext2VolumeArrivalNotify

Ext2Mgr/enumDisk.cpp:4516–4552  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4514}
4515
4516BOOL
4517Ext2VolumeArrivalNotify(PCHAR VolumePath)
4518{
4519 HANDLE hMountMgr = NULL;
4520
4521 NT::IO_STATUS_BLOCK iosb;
4522 NT::NTSTATUS status;
4523 DWORD rc = 0;
4524
4525 WCHAR volPath[MAX_PATH + 2];
4526 PMOUNTMGR_TARGET_NAME target;
4527
4528 target = (PMOUNTMGR_TARGET_NAME) volPath;
4529 Ext2AnsiToUnicode(VolumePath, &target->DeviceName[0], MAX_PATH);
4530 target->DeviceNameLength = (USHORT)wcslen(target->DeviceName) * 2;
4531
4532 status = Ext2Open("\\Device\\MountPointManager", &hMountMgr, EXT2_DESIRED_ACCESS);
4533 if (!NT_SUCCESS(status)) {
4534 goto errorout;
4535 }
4536
4537 status = NT::ZwDeviceIoControlFile(
4538 hMountMgr, NULL, NULL, NULL, &iosb,
4539 IOCTL_MOUNTMGR_VOLUME_ARRIVAL_NOTIFICATION,
4540 (PVOID)target, sizeof(USHORT) +
4541 target->DeviceNameLength, NULL, 0
4542 );
4543
4544 if (!NT_SUCCESS(status)) {
4545 goto errorout;
4546 }
4547
4548errorout:
4549
4550 Ext2Close(&hMountMgr);
4551 return NT_SUCCESS(status);
4552}
4553
4554
4555BOOL

Callers 2

Ext2RefreshVolumePointFunction · 0.85
Ext2NotifyVolumePointFunction · 0.85

Calls 3

Ext2AnsiToUnicodeFunction · 0.85
Ext2OpenFunction · 0.85
Ext2CloseFunction · 0.70

Tested by

no test coverage detected