From a98e15935b748262cdaf4c74c63d52737eb57e76 Mon Sep 17 00:00:00 2001 From: perry.werneck@gmail.com Date: Fri, 11 May 2012 22:30:25 +0000 Subject: [PATCH] Muitas atualizacoes enfileiradas derrubam o windows 7 com falha dentro da ntdll.dll --- XtGlue.c | 6 ------ ctlr.c | 7 ++++--- ft.c | 8 -------- glue.c | 12 +++++++----- host.c | 23 ++++++++++++++++------- kybd.c | 9 +-------- screen.c | 7 ++++--- selection.c | 2 -- toggles.c | 3 ++- 9 files changed, 34 insertions(+), 43 deletions(-) diff --git a/XtGlue.c b/XtGlue.c index 6e941ba..0dcf729 100644 --- a/XtGlue.c +++ b/XtGlue.c @@ -502,9 +502,7 @@ static int DefaultProcessEvents(int block) FD_ISSET(ip->source, &rfds)) { #endif - Trace("%s",__FUNCTION__); (*ip->proc)(ip->session); - Trace("%s",__FUNCTION__); processed_any = True; if (inputs_changed) goto retry; @@ -513,9 +511,7 @@ static int DefaultProcessEvents(int block) #if !defined(_WIN32) if (((unsigned long)ip->condition & InputWriteMask) && FD_ISSET(ip->source, &wfds)) { - Trace("%s",__FUNCTION__); (*ip->proc)(ip->session); - Trace("%s",__FUNCTION__); processed_any = True; if (inputs_changed) goto retry; @@ -547,9 +543,7 @@ static int DefaultProcessEvents(int block) #endif timeouts = t->next; t->in_play = True; - Trace("%s",__FUNCTION__); (*t->proc)(t->session); - Trace("%s",__FUNCTION__); processed_any = True; Free(t); } else diff --git a/ctlr.c b/ctlr.c index 180b031..ddf07c4 100644 --- a/ctlr.c +++ b/ctlr.c @@ -458,7 +458,6 @@ void ctlr_erase(H3270 *session, int alt) CHECK_SESSION_HANDLE(session); kybd_inhibit(False); - ctlr_clear(session,True); screen_erase(session); @@ -486,6 +485,7 @@ void ctlr_erase(H3270 *session, int alt) } session->screen_alt = alt; + } @@ -2329,6 +2329,8 @@ ctlr_clear(H3270 *session, Boolean can_snap) #endif /*]*/ /* Clear the screen. */ + trace("%p",session->ea_buf); + (void) memset((char *)session->ea_buf, 0, session->rows*session->cols*sizeof(struct ea)); cursor_move(&h3270,0); session->buffer_addr = 0; @@ -2341,8 +2343,7 @@ ctlr_clear(H3270 *session, Boolean can_snap) sscp_start = 0; // ALL_CHANGED; - screen_erase(session); - + session->erase(session); } /* diff --git a/ft.c b/ft.c index 9c16509..af21147 100644 --- a/ft.c +++ b/ft.c @@ -377,8 +377,6 @@ void ft_complete(H3270FT *session, const char *errmsg) ((double)(t1.tv_sec - starting_time.tv_sec) + (double)(t1.tv_usec - starting_time.tv_usec) / 1.0e6); - trace("%s",__FUNCTION__); - // Close the local file. if(session->ft_local_file) { @@ -420,8 +418,6 @@ void ft_update_length(H3270FT *session) (double)(t1.tv_usec - starting_time.tv_usec) / 1.0e6); } - Trace("%s",__FUNCTION__); - session->update(session,ft_length,kbytes_sec); } @@ -429,8 +425,6 @@ void ft_update_length(H3270FT *session) // Process a transfer acknowledgement. void ft_running(H3270FT *h, Boolean is_cut) { - trace("%s",__FUNCTION__); - CHECK_FT_HANDLE(h); ft_is_cut = is_cut; @@ -450,8 +444,6 @@ void ft_running(H3270FT *h, Boolean is_cut) // Process a protocol-generated abort. void ft_aborting(H3270FT *h) { -// Trace("%s",__FUNCTION__); - CHECK_FT_HANDLE(h); if (h->state == FT_RUNNING || h->state == FT_ABORT_WAIT) diff --git a/glue.c b/glue.c index dd03147..0d31897 100644 --- a/glue.c +++ b/glue.c @@ -244,9 +244,11 @@ static void initialize(void) #endif */ -#if defined(C3270) && defined(_WIN32) /*[*/ +/* +#if defined(C3270) && defined(_WIN32) appres.highlight_underline = True; -#endif /*]*/ +#endif +*/ /* #if defined(C3270) && !defined(_WIN32) && !defined(LIB3270) @@ -407,9 +409,9 @@ static struct { #if defined(X3270_SCRIPT) /*[*/ { ResPluginCommand, offset(plugin_command), XRM_STRING }, #endif /*]*/ -#if defined(C3270) && defined(_WIN32) /*[*/ - { ResHighlightUnderline, offset(highlight_underline), XRM_BOOLEAN }, -#endif /*]*/ +//#if defined(C3270) && defined(_WIN32) +// { ResHighlightUnderline, offset(highlight_underline), XRM_BOOLEAN }, +//#endif #if defined(C3270) && defined(X3270_SCRIPT) /*[*/ { ResIdleCommand,offset(idle_command), XRM_STRING }, { ResIdleCommandEnabled,offset(idle_command_enabled), XRM_BOOLEAN }, diff --git a/host.c b/host.c index d989bf3..eea57ea 100644 --- a/host.c +++ b/host.c @@ -738,23 +738,28 @@ void host_disconnected(H3270 *session) } /* Register a function interested in a state change. */ -LIB3270_EXPORT void lib3270_register_schange(H3270 *h,LIB3270_STATE_CHANGE tx, void (*func)(H3270 *, int, void *),void *data) +LIB3270_EXPORT void lib3270_register_schange(H3270 *h, LIB3270_STATE_CHANGE tx, void (*func)(H3270 *, int, void *),void *data) { struct lib3270_state_callback *st; CHECK_SESSION_HANDLE(h); - st = (struct lib3270_state_callback *)Malloc(sizeof(*st)); - + st = (struct lib3270_state_callback *) lib3270_malloc(sizeof(struct lib3270_state_callback)); st->func = func; - st->next = (struct lib3270_state_callback *)NULL; - if (h->st_last[tx] != (struct lib3270_state_callback *)NULL) + if (h->st_last[tx]) h->st_last[tx]->next = st; else h->st_callbacks[tx] = st; + h->st_last[tx] = st; + #warning AQUI + if(tx == LIB3270_STATE_CONNECT) + { + trace("%s st=%p func=%p",__FUNCTION__,st,func); + } + } /* Signal a state change. */ @@ -782,18 +787,22 @@ void lib3270_st_changed(H3270 *h, LIB3270_STATE tx, int mode) CHECK_SESSION_HANDLE(h); - trace("%s is %d",state_name[tx],mode); + trace("%s is %d on session %p",state_name[tx],mode,h); - for (st = h->st_callbacks[tx];st != (struct lib3270_state_callback *)NULL;st = st->next) + for (st = h->st_callbacks[tx];st;st = st->next) { + trace("st=%p func=%p",st,st->func); st->func(h,mode,st->data); } + + trace("%s ends",__FUNCTION__); } LIB3270_EXPORT const char * lib3270_set_host(H3270 *h, const char *n) { CHECK_SESSION_HANDLE(h); + #warning AQUI Trace("%s: %p",__FUNCTION__,n); if(n && n != h->full_current_host) diff --git a/kybd.c b/kybd.c index 0d14111..6d3c31c 100644 --- a/kybd.c +++ b/kybd.c @@ -411,6 +411,7 @@ static void kybd_connect(H3270 *session, int connected, void *dunno) { if (kybdlock & KL_DEFERRED_UNLOCK) RemoveTimeOut(unlock_id); + kybdlock_clr(-1, "kybd_connect"); if (connected) { @@ -580,12 +581,9 @@ LIB3270_FKEY_ACTION( pakey ) LIB3270_ACTION(break) { - if (!IN_3270) return 0; - Trace("%s",__FUNCTION__); - net_break(); return 0; @@ -599,8 +597,6 @@ LIB3270_ACTION(attn) if (!IN_3270) return 0; - Trace("%s",__FUNCTION__); - net_interrupt(); return 0; @@ -1466,8 +1462,6 @@ do_reset(Boolean explicit) * a half-composed key, simply flush it. */ - Trace("%s",__FUNCTION__); - if (explicit #if defined(X3270_FT) /*[*/ || lib3270_get_ft_state(&h3270) != LIB3270_FT_STATE_NONE @@ -2316,7 +2310,6 @@ LIB3270_KEY_ACTION( enter ) LIB3270_ACTION( sysreq ) { - Trace("%s",__FUNCTION__); // reset_idle_timer(); if (IN_ANSI) return 0; diff --git a/screen.c b/screen.c index ccc8772..34344d6 100644 --- a/screen.c +++ b/screen.c @@ -104,7 +104,9 @@ static void addch(H3270 *session, int baddr, unsigned char c, unsigned short att /* Converted char has changed, update it */ session->text[baddr].chr = c; session->text[baddr].attr = attr; + session->update(session,baddr,c,attr,baddr == session->cursor_addr); + } LIB3270_EXPORT int lib3270_get_element(H3270 *h, int baddr, unsigned char *c, unsigned short *attr) @@ -338,14 +340,12 @@ static void screen_update(H3270 *session, int bstart, int bend) } else { - if (lib3270_get_toggle(session,MONOCASE)) + if(lib3270_get_toggle(session,MONOCASE)) addch(session,baddr,asc2uc[ebc2asc[session->ea_buf[baddr].cc]],attr,&first,&last); else addch(session,baddr,ebc2asc[session->ea_buf[baddr].cc],attr,&first,&last); } } - - } if(first >= 0) @@ -365,6 +365,7 @@ static void screen_update(H3270 *session, int bstart, int bend) void screen_disp(H3270 *session) { + CHECK_SESSION_HANDLE(session); screen_update(session,0,session->rows*session->cols); } diff --git a/selection.c b/selection.c index a331433..03ac089 100644 --- a/selection.c +++ b/selection.c @@ -598,8 +598,6 @@ LIB3270_EXPORT int lib3270_drag_selection(H3270 *h, unsigned char flag, int orig else if((flag&0x8F) == SELECTION_ACTIVE) return lib3270_move_selected_area(h,origin,baddr); -// trace("%s",__FUNCTION__); - row = baddr/h->cols; col = baddr%h->cols; diff --git a/toggles.c b/toggles.c index 7c8056b..0d9521b 100644 --- a/toggles.c +++ b/toggles.c @@ -84,7 +84,8 @@ LIB3270_EXPORT unsigned char lib3270_get_toggle(H3270 *session, LIB3270_TOGGLE i if(ix < 0 || ix >= N_TOGGLES) return 0; - return (unsigned char) session->toggle[ix].value != 0; + + return session->toggle[ix].value != 0; } /* -- libgit2 0.21.2