winhandl.c (putty-0.75) | : | winhandl.c (putty-0.76) | ||
---|---|---|---|---|
skipping to change at line 454 | skipping to change at line 454 | |||
h->u.i.defunct = false; | h->u.i.defunct = false; | |||
h->u.i.moribund = false; | h->u.i.moribund = false; | |||
h->u.i.done = false; | h->u.i.done = false; | |||
h->u.i.privdata = privdata; | h->u.i.privdata = privdata; | |||
h->u.i.flags = flags; | h->u.i.flags = flags; | |||
if (!handles_by_evtomain) | if (!handles_by_evtomain) | |||
handles_by_evtomain = newtree234(handle_cmp_evtomain); | handles_by_evtomain = newtree234(handle_cmp_evtomain); | |||
add234(handles_by_evtomain, h); | add234(handles_by_evtomain, h); | |||
CreateThread(NULL, 0, handle_input_threadfunc, | HANDLE hThread = CreateThread(NULL, 0, handle_input_threadfunc, | |||
&h->u.i, 0, &in_threadid); | &h->u.i, 0, &in_threadid); | |||
if (hThread) | ||||
CloseHandle(hThread); /* we don't need the thread handle */ | ||||
h->u.i.busy = true; | h->u.i.busy = true; | |||
return h; | return h; | |||
} | } | |||
struct handle *handle_output_new(HANDLE handle, handle_outputfn_t sentdata, | struct handle *handle_output_new(HANDLE handle, handle_outputfn_t sentdata, | |||
void *privdata, int flags) | void *privdata, int flags) | |||
{ | { | |||
struct handle *h = snew(struct handle); | struct handle *h = snew(struct handle); | |||
DWORD out_threadid; /* required for Win9x */ | DWORD out_threadid; /* required for Win9x */ | |||
skipping to change at line 485 | skipping to change at line 487 | |||
h->u.o.privdata = privdata; | h->u.o.privdata = privdata; | |||
bufchain_init(&h->u.o.queued_data); | bufchain_init(&h->u.o.queued_data); | |||
h->u.o.outgoingeof = EOF_NO; | h->u.o.outgoingeof = EOF_NO; | |||
h->u.o.sentdata = sentdata; | h->u.o.sentdata = sentdata; | |||
h->u.o.flags = flags; | h->u.o.flags = flags; | |||
if (!handles_by_evtomain) | if (!handles_by_evtomain) | |||
handles_by_evtomain = newtree234(handle_cmp_evtomain); | handles_by_evtomain = newtree234(handle_cmp_evtomain); | |||
add234(handles_by_evtomain, h); | add234(handles_by_evtomain, h); | |||
CreateThread(NULL, 0, handle_output_threadfunc, | HANDLE hThread = CreateThread(NULL, 0, handle_output_threadfunc, | |||
&h->u.o, 0, &out_threadid); | &h->u.o, 0, &out_threadid); | |||
if (hThread) | ||||
CloseHandle(hThread); /* we don't need the thread handle */ | ||||
return h; | return h; | |||
} | } | |||
struct handle *handle_add_foreign_event(HANDLE event, | struct handle *handle_add_foreign_event(HANDLE event, | |||
void (*callback)(void *), void *ctx) | void (*callback)(void *), void *ctx) | |||
{ | { | |||
struct handle *h = snew(struct handle); | struct handle *h = snew(struct handle); | |||
h->type = HT_FOREIGN; | h->type = HT_FOREIGN; | |||
End of changes. 2 change blocks. | ||||
4 lines changed or deleted | 8 lines changed or added |