Commit 88e48ac97a8752c47f697d2f8d6fe420e8dda077

Authored by perry.werneck@gmail.com
1 parent 1fdad013

Correcoes na interface HLLAPI

@@ -5,7 +5,7 @@ msgid "" @@ -5,7 +5,7 @@ msgid ""
5 msgstr "" 5 msgstr ""
6 "Project-Id-Version: pw3270 5.0\n" 6 "Project-Id-Version: pw3270 5.0\n"
7 "Report-Msgid-Bugs-To: \n" 7 "Report-Msgid-Bugs-To: \n"
8 -"POT-Creation-Date: 2012-09-19 09:13-0300\n" 8 +"POT-Creation-Date: 2012-09-20 09:55-0300\n"
9 "PO-Revision-Date: 2012-09-14 14:32-0300\n" 9 "PO-Revision-Date: 2012-09-14 14:32-0300\n"
10 "Last-Translator: Perry Werneck <perry.werneck@gmail.com>\n" 10 "Last-Translator: Perry Werneck <perry.werneck@gmail.com>\n"
11 "Language-Team: Português <perry.werneck@gmail.com>\n" 11 "Language-Team: Português <perry.werneck@gmail.com>\n"
@@ -128,7 +128,7 @@ msgstr &quot;Não foi possível conectar a %s:%d&quot; @@ -128,7 +128,7 @@ msgstr &quot;Não foi possível conectar a %s:%d&quot;
128 msgid "Can't connect to host" 128 msgid "Can't connect to host"
129 msgstr "Não foi possível conectar ao servidor" 129 msgstr "Não foi possível conectar ao servidor"
130 130
131 -#: selection.c:603 131 +#: selection.c:601
132 msgid "Can't cut rectangular regions" 132 msgid "Can't cut rectangular regions"
133 msgstr "Recortar não permitido em seleção retangular" 133 msgstr "Recortar não permitido em seleção retangular"
134 134
@@ -417,7 +417,7 @@ msgstr &quot;Invalid CGCSGID &#39;%s&#39;, ignoring&quot; @@ -417,7 +417,7 @@ msgstr &quot;Invalid CGCSGID &#39;%s&#39;, ignoring&quot;
417 msgid "Invalid charset entry '%s' (#%d)" 417 msgid "Invalid charset entry '%s' (#%d)"
418 msgstr "Invalid charset entry '%s' (#%d)" 418 msgstr "Invalid charset entry '%s' (#%d)"
419 419
420 -#: selection.c:603 420 +#: selection.c:601
421 msgid "Invalid cut action" 421 msgid "Invalid cut action"
422 msgstr "Ação recortar inválida" 422 msgstr "Ação recortar inválida"
423 423
@@ -474,7 +474,7 @@ msgstr &quot;Erro ao iniciar a rede&quot; @@ -474,7 +474,7 @@ msgstr &quot;Erro ao iniciar a rede&quot;
474 msgid "Next field" 474 msgid "Next field"
475 msgstr "Próximo campo" 475 msgstr "Próximo campo"
476 476
477 -#: selection.c:603 477 +#: selection.c:601
478 msgid "Not available" 478 msgid "Not available"
479 msgstr "Não disponível" 479 msgstr "Não disponível"
480 480
src/plugins/remotectl/hllapi.c
@@ -58,7 +58,7 @@ @@ -58,7 +58,7 @@
58 snprintf(PipeName,4095,"\\\\.\\pipe\\%s",name); 58 snprintf(PipeName,4095,"\\\\.\\pipe\\%s",name);
59 59
60 if(!WaitNamedPipe(PipeName,NMPWAIT_USE_DEFAULT_WAIT)) 60 if(!WaitNamedPipe(PipeName,NMPWAIT_USE_DEFAULT_WAIT))
61 - return ETIMEDOUT; 61 + return ENOENT;
62 62
63 hPipe = CreateFile(PipeName,GENERIC_WRITE|GENERIC_READ,0,NULL,OPEN_EXISTING,0,NULL); 63 hPipe = CreateFile(PipeName,GENERIC_WRITE|GENERIC_READ,0,NULL,OPEN_EXISTING,0,NULL);
64 64
@@ -90,8 +90,7 @@ @@ -90,8 +90,7 @@
90 90
91 if(hPipe == INVALID_HANDLE_VALUE) 91 if(hPipe == INVALID_HANDLE_VALUE)
92 { 92 {
93 - trace("Invalid pipe handle %ld",(unsigned long) hPipe);  
94 - result = EPERM; 93 + *rc = result = EPERM;
95 } 94 }
96 else 95 else
97 { 96 {
@@ -116,7 +115,7 @@ @@ -116,7 +115,7 @@
116 memset(buffer,0,HLLAPI_MAXLENGTH); 115 memset(buffer,0,HLLAPI_MAXLENGTH);
117 if(!TransactNamedPipe(hPipe,(LPVOID) data,cbSize,buffer,HLLAPI_MAXLENGTH,&cbSize,NULL)) 116 if(!TransactNamedPipe(hPipe,(LPVOID) data,cbSize,buffer,HLLAPI_MAXLENGTH,&cbSize,NULL))
118 { 117 {
119 - result = GetLastError(); 118 + *rc = result = GetLastError();
120 } 119 }
121 else 120 else
122 { 121 {
@@ -124,8 +123,6 @@ @@ -124,8 +123,6 @@
124 123
125 *rc = buffer->rc; 124 *rc = buffer->rc;
126 125
127 - trace("%s: Query rc=%d",__FUNCTION__,(int) buffer->rc);  
128 -  
129 if(string && sz > 0) 126 if(string && sz > 0)
130 memcpy(string,buffer->string,sz); 127 memcpy(string,buffer->string,sz);
131 128
@@ -155,7 +152,7 @@ @@ -155,7 +152,7 @@
155 char * arg; 152 char * arg;
156 153
157 if(!length || *length > HLLAPI_MAXLENGTH) 154 if(!length || *length > HLLAPI_MAXLENGTH)
158 - return EINVAL; 155 + return *rc = EINVAL;
159 156
160 if(length > 0) 157 if(length > 0)
161 { 158 {
@@ -169,16 +166,10 @@ @@ -169,16 +166,10 @@
169 *arg = 0; 166 *arg = 0;
170 } 167 }
171 168
172 -/*  
173 -#ifdef DEBUG  
174 - freopen("hllapi.log","a",stderr);  
175 -#endif // DEBUG  
176 -*/  
177 -  
178 switch(*func) 169 switch(*func)
179 { 170 {
180 case HLLAPI_CMD_CONNECTPS: 171 case HLLAPI_CMD_CONNECTPS:
181 - result = cmd_connect_ps(arg); 172 + *rc = result = cmd_connect_ps(arg);
182 if(!result) 173 if(!result)
183 { 174 {
184 result = run_query(*func, arg, str, *length, rc); 175 result = run_query(*func, arg, str, *length, rc);
@@ -189,13 +180,17 @@ @@ -189,13 +180,17 @@
189 hPipe = INVALID_HANDLE_VALUE; 180 hPipe = INVALID_HANDLE_VALUE;
190 } 181 }
191 } 182 }
  183 + else
  184 + {
  185 + *rc = result;
  186 + }
192 break; 187 break;
193 188
194 case HLLAPI_CMD_DISCONNECTPS: 189 case HLLAPI_CMD_DISCONNECTPS:
195 #ifdef WIN32 190 #ifdef WIN32
196 if(hPipe == INVALID_HANDLE_VALUE) 191 if(hPipe == INVALID_HANDLE_VALUE)
197 { 192 {
198 - result = EINVAL; 193 + *rc = result = EINVAL;
199 } 194 }
200 else 195 else
201 { 196 {
src/plugins/remotectl/testprogram.c
@@ -64,7 +64,7 @@ @@ -64,7 +64,7 @@
64 len = BUFFER_LENGTH; 64 len = BUFFER_LENGTH;
65 strcpy(buffer,cmd[f].arg); 65 strcpy(buffer,cmd[f].arg);
66 result = hllapi(&cmd[f].fn,buffer,&len,&rc); 66 result = hllapi(&cmd[f].fn,buffer,&len,&rc);
67 - printf("%s exits with %d\n[%s]\n",cmd[f].name,result,buffer); 67 + printf("%s exits with result=%d rc=%d\n[%s]\n",cmd[f].name,result,rc,buffer);
68 68
69 } 69 }
70 70
@@ -72,8 +72,7 @@ @@ -72,8 +72,7 @@
72 rc = 1; 72 rc = 1;
73 fn = HLLAPI_CMD_COPYPSTOSTR; 73 fn = HLLAPI_CMD_COPYPSTOSTR;
74 result = hllapi(&fn,buffer,&len,&rc); 74 result = hllapi(&fn,buffer,&len,&rc);
75 - printf("%s exits with %d\n%s\n","HLLAPI_CMD_COPYPSTOSTR",result,buffer);  
76 - 75 + printf("%s exits with result=%d rc=%d\n%s\n","HLLAPI_CMD_COPYPSTOSTR",result,rc,buffer);
77 76
78 // Disconnect 77 // Disconnect
79 len = BUFFER_LENGTH; 78 len = BUFFER_LENGTH;