HANDLE WaitableIoEventHandle;
static HANDLE hndIOCPLPort;
static HANDLE hMainThread;
+static BOOL DoPPShack;
DWORD ActiveWaitHandles;
HANDLE WaitHandles[16];
init_io_completion_port(void)
{
OSVERSIONINFO vi;
+ const char * envp;
# ifdef DEBUG
atexit(&free_io_completion_port_mem);
# endif
+ /* TODO: this should not be done via environment;
+ * It would be much better to have this as proper config option.
+ * (The same is true for the PPS API DLL list...)
+ */
+ if (NULL != (envp = getenv("PPSAPI_HACK")))
+ /* check for [Tt]{rue}, [Yy]{es}, or '1' as first char*/
+ DoPPShack = !!strchr("yYtT1", (u_char)*envp);
+ else if (NULL != (envp = getenv("PPSAPI_DLLS")))
+ /* any non-empty list disables PPS hack */
+ DoPPShack = !*envp;
+ else
+ /* otherwise use the PPS hack */
+ DoPPShack = TRUE;
+
memset(&vi, 0, sizeof(vi));
vi.dwOSVersionInfoSize = sizeof(vi);
BOOL rc;
- memset(&lpo->aux, 0, sizeof(lpo->aux));
lpo->onIoDone = OnSerialWaitComplete;
lpo->recv_buf = buff;
lpo->flRawMem = 0;
/* start next IO and leave if we hit an error */
if (lpo->errCode != ERROR_SUCCESS) {
+ memset(&lpo->aux, 0, sizeof(lpo->aux));
IoCtxStartLocked(lpo, QueueSerialWait, lpo->recv_buf);
return;
}
*
* backward compat: 'usermode-pps-hack'
*/
- if (MS_RLSD_ON & modem_status) {
+ if ((MS_RLSD_ON & modem_status) && DoPPShack) {
lpo->aux.DCDSTime = lpo->aux.RecvTime;
lpo->aux.flTsDCDS = 1;
DPRINTF(2, ("upps-hack: fd %d DCD PPS Rise at %s\n",
wait_again:
/* make sure the read is issued again */
+ memset(&lpo->aux, 0, sizeof(lpo->aux));
IoCtxStartLocked(lpo, QueueSerialWait, lpo->recv_buf);
}
goto fail;
}
lpo->io.hnd = h;
+ memset(&lpo->aux, 0, sizeof(lpo->aux));
return QueueSerialWait(lpo, get_free_recv_buffer_alloc());
fail: