Hi Jinoh,
On 1/4/22 11:07, Jinoh Kang wrote:
- memset(&iosb, 0, sizeof(iosb));
- iosb.Status = STATUS_PENDING;
- status = pNtFsControlFile(handle, event, NULL, NULL, &iosb, FSCTL_PIPE_WAIT,
pipe_wait, pipe_wait_size, NULL, 0);
- if (status == STATUS_PENDING && iosb.Status == STATUS_PENDING)
- {
WaitForSingleObject(event, INFINITE);
- }
- if (SUCCEEDED(status) && iosb.Status != STATUS_PENDING)
- {
status = iosb.Status;
- }
SUCCEEDED() macro is meant for HRESULT. It's not really needed here, I think that those two branches can be simplified to:
if (status == STATUS_SUCCESS)
{
WaitForSingleObject(event, INFINITE); status = iosb.Status;
}
Thanks,
Jacek