| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| int32_t __cdecl __ntapi_sc_wait( |
| nt_socket * hssocket, |
| nt_iosb volatile * iosb, |
| nt_timeout * timeout) |
| { |
| nt_iosb cancel; |
| |
| timeout = (timeout && timeout->quad) |
| ? timeout |
| : 0; |
| |
| if (hssocket->hevent && (hssocket->iostatus == NT_STATUS_PENDING)) { |
| hssocket->waitstatus = __ntapi->zw_wait_for_single_object( |
| hssocket->hevent, |
| !!(hssocket->ntflags & NT_FILE_SYNCHRONOUS_IO_ALERT), |
| timeout); |
| |
| switch (hssocket->waitstatus) { |
| case NT_STATUS_SUCCESS: |
| hssocket->iostatus = iosb->status; |
| break; |
| |
| case NT_STATUS_ALERTED: |
| hssocket->iostatus = NT_STATUS_ALERTED; |
| __ntapi->zw_cancel_io_file( |
| hssocket->hsocket, |
| &cancel); |
| break; |
| } |
| } |
| |
| return hssocket->iostatus; |
| } |