| 4514 | } |
| 4515 | |
| 4516 | BOOL |
| 4517 | Ext2VolumeArrivalNotify(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 | |
| 4548 | errorout: |
| 4549 | |
| 4550 | Ext2Close(&hMountMgr); |
| 4551 | return NT_SUCCESS(status); |
| 4552 | } |
| 4553 | |
| 4554 | |
| 4555 | BOOL |
no test coverage detected