#ifndef PTYCON_IOCTL_IMPL_H #define PTYCON_IOCTL_IMPL_H #include static int32_t ptyc_grant(nt_pty * hptm) { nt_tty_sigctl_info ctlinfo; nt_iosb iosb; ntapi->tt_aligned_block_memset( &ctlinfo,0,sizeof(ctlinfo)); return ntapi->pty_ioctl( hptm, 0,0,0, &iosb,TTY_TIOCSPTLCK, &ctlinfo,sizeof(ctlinfo), &ctlinfo,sizeof(ctlinfo)); } static int32_t ptyc_set_client_info( nt_pty * hpty, nt_pty_client_info * clinfo) { int32_t status; nt_iosb iosb; nt_large_integer ticks; nt_large_integer freq; nt_pty_client_info ptyinfo; if ((status = ntapi->zw_query_performance_counter( &ticks,&freq))) return status; ptyinfo.any[0] = (ticks.ulow << 19) | (ticks.ulow >> 13); if ((status = ntapi->zw_query_performance_counter( &ticks,&freq))) return status; ptyinfo.any[1] = (ticks.ulow << 15) | (ticks.ulow >> 17); if ((status = ntapi->zw_query_performance_counter( &ticks,&freq))) return status; ptyinfo.any[1] = (ticks.ulow << 11) | (ticks.ulow >> 21); if ((status = ntapi->zw_query_performance_counter( &ticks,&freq))) return status; ptyinfo.any[1] = (ticks.ulow << 17) | (ticks.ulow >> 15); if ((status = ntapi->pty_set( hpty,&iosb, &ptyinfo,sizeof(ptyinfo), NT_PTY_CLIENT_INFORMATION))) return status; clinfo->any[0] = ptyinfo.any[0]; clinfo->any[1] = ptyinfo.any[1]; clinfo->any[2] = ptyinfo.any[2]; clinfo->any[3] = ptyinfo.any[3]; return NT_STATUS_SUCCESS; } #endif