Commit 619432b80d677c740829f3a4c00682cf312d78af

Authored by anderson.peterle@previdencia.gov.br
1 parent 349b6dc1
Exists in master

Pequenas correcoes

git-svn-id: http://svn.softwarepublico.gov.br/svn/cacic/cacic/trunk/agente-windows@919 fecfc0c7-e812-0410-ae72-849f08638ee7
Showing 38 changed files with 809 additions and 615 deletions   Show diff stats
srcacic/WinVNC/MS-Logon/MSLogonACL/vncExportACL.cpp
@@ -35,7 +35,7 @@ bool vncExportACL::GetACL(PACL *pACL){ @@ -35,7 +35,7 @@ bool vncExportACL::GetACL(PACL *pACL){
35 if (ERROR_SUCCESS != RegOpenKeyEx( HKEY_LOCAL_MACHINE, 35 if (ERROR_SUCCESS != RegOpenKeyEx( HKEY_LOCAL_MACHINE,
36 _T("Software\\ORL\\WinVNC3"), 36 _T("Software\\ORL\\WinVNC3"),
37 0, KEY_QUERY_VALUE, &hk )){ 37 0, KEY_QUERY_VALUE, &hk )){
38 - _ftprintf(stderr, _T("== Error %d: RegOpenKeyEx\n"), GetLastError()); 38 + _ftprintf(stderr, _T("== Error %d: RegOpenKeyEx"), GetLastError());
39 __leave; 39 __leave;
40 } 40 }
41 // Read the ACL value from the VNC registry key 41 // Read the ACL value from the VNC registry key
srcacic/WinVNC/WinVNC/CACIC_Auth.cpp
@@ -25,7 +25,7 @@ const UINT CACIC_Auth::TEMPO_IDLE = 15; @@ -25,7 +25,7 @@ const UINT CACIC_Auth::TEMPO_IDLE = 15;
25 25
26 bool CACIC_Auth::autentica() 26 bool CACIC_Auth::autentica()
27 { 27 {
28 - vnclog.Print(LL_SRLOG, VNCLOG("Autenticando o usuário no gerente web.\n")); 28 + vnclog.Print(LL_SRLOG, VNCLOG("Autenticando o usuário no gerente web."));
29 29
30 string post = getPostComum(); 30 string post = getPostComum();
31 31
@@ -40,16 +40,17 @@ bool CACIC_Auth::autentica() @@ -40,16 +40,17 @@ bool CACIC_Auth::autentica()
40 40
41 if (!autenticaUsuario(listaDominios)) return false; 41 if (!autenticaUsuario(listaDominios)) return false;
42 42
43 - vnclog.Print(LL_SRLOG, VNCLOG("Autenticação OK!\n")); 43 + vnclog.Print(LL_SRLOG, VNCLOG("Autenticação OK!"));
44 44
45 return true; 45 return true;
46 } 46 }
47 47
48 bool CACIC_Auth::autenticaUsuario(vector<Dominio> &listaDominios) 48 bool CACIC_Auth::autenticaUsuario(vector<Dominio> &listaDominios)
49 { 49 {
50 - string post; 50 + string post ;
51 char resposta[TAMANHO_RESPOSTA]; 51 char resposta[TAMANHO_RESPOSTA];
52 52
  53 +
53 vncPassDlg passDlg(listaDominios); 54 vncPassDlg passDlg(listaDominios);
54 55
55 if (listaDominios.at(0).id.compare("0") == 0) { 56 if (listaDominios.at(0).id.compare("0") == 0) {
@@ -59,8 +60,7 @@ bool CACIC_Auth::autenticaUsuario(vector&lt;Dominio&gt; &amp;listaDominios) @@ -59,8 +60,7 @@ bool CACIC_Auth::autenticaUsuario(vector&lt;Dominio&gt; &amp;listaDominios)
59 } 60 }
60 61
61 // apresenta o dialogo de autenticação 62 // apresenta o dialogo de autenticação
62 - do  
63 - { 63 + do{
64 if (!passDlg.DoDialog()) return false; 64 if (!passDlg.DoDialog()) return false;
65 65
66 post.clear(); 66 post.clear();
@@ -73,33 +73,47 @@ bool CACIC_Auth::autenticaUsuario(vector&lt;Dominio&gt; &amp;listaDominios) @@ -73,33 +73,47 @@ bool CACIC_Auth::autenticaUsuario(vector&lt;Dominio&gt; &amp;listaDominios)
73 post += "&id_servidor_autenticacao="; 73 post += "&id_servidor_autenticacao=";
74 post += CACIC_Crypt::codifica(passDlg.m_dominio); 74 post += CACIC_Crypt::codifica(passDlg.m_dominio);
75 75
  76 +
76 vnclog.Print(LL_SRLOG, post.data()); 77 vnclog.Print(LL_SRLOG, post.data());
77 78
78 string session_script = m_scriptsPath; 79 string session_script = m_scriptsPath;
79 session_script.append(SET_SESSION_SCRIPT); 80 session_script.append(SET_SESSION_SCRIPT);
80 - 81 +
81 CACIC_Con::sendHtppPost(m_servidorWeb, session_script, post, resposta, TAMANHO_RESPOSTA); 82 CACIC_Con::sendHtppPost(m_servidorWeb, session_script, post, resposta, TAMANHO_RESPOSTA);
82 83
83 - if(verificaAuthDominio(resposta)) { 84 +
  85 + if(verificaAuthDominio(resposta)) {
84 passDlg.m_authStat = vncPassDlg::AUTENTICADO; 86 passDlg.m_authStat = vncPassDlg::AUTENTICADO;
85 } else { 87 } else {
86 passDlg.m_authStat = vncPassDlg::FALHA_AUTENTICACAO; 88 passDlg.m_authStat = vncPassDlg::FALHA_AUTENTICACAO;
87 } 89 }
88 } 90 }
89 while (passDlg.m_authStat != vncPassDlg::AUTENTICADO); 91 while (passDlg.m_authStat != vncPassDlg::AUTENTICADO);
90 - 92 +
  93 +
91 if (passDlg.m_authStat != vncPassDlg::SEM_AUTENTICACAO) 94 if (passDlg.m_authStat != vncPassDlg::SEM_AUTENTICACAO)
92 { 95 {
93 string msginfo = "Usuário Autenticado: "; 96 string msginfo = "Usuário Autenticado: ";
94 msginfo += m_usuario; 97 msginfo += m_usuario;
95 passDlg.m_authStat = vncPassDlg::AUTENTICADO; 98 passDlg.m_authStat = vncPassDlg::AUTENTICADO;
96 passDlg.m_msgInfo = msginfo; 99 passDlg.m_msgInfo = msginfo;
97 - if (!passDlg.DoDialog()) return false;  
98 - }  
99 100
  101 +
  102 + if (listaDominios.at(0).id.compare("0") == 0) {
  103 + //Usuario sem autenticação
  104 + //Não necessita da atualização da "Janela"
  105 + return true;
  106 + } else {
  107 + //Usuario autenticado.
  108 + //Ocorre atualização da "Janela" de autenticação.
  109 + if (!passDlg.DoDialog()) return false;
  110 + }
  111 + }
  112 +
100 return true; 113 return true;
101 } 114 }
102 115
  116 +
103 bool CACIC_Auth::validaTecnico(char nm_usuario_cli[], char te_senha_cli[], char te_node_address_cli[], 117 bool CACIC_Auth::validaTecnico(char nm_usuario_cli[], char te_senha_cli[], char te_node_address_cli[],
104 char te_documento_referencial[], char te_motivo_conexao[], char te_so_cli[], 118 char te_documento_referencial[], char te_motivo_conexao[], char te_so_cli[],
105 const short vncCID, const char peerName[]) 119 const short vncCID, const char peerName[])
@@ -121,20 +135,48 @@ bool CACIC_Auth::validaTecnico(char nm_usuario_cli[], char te_senha_cli[], char @@ -121,20 +135,48 @@ bool CACIC_Auth::validaTecnico(char nm_usuario_cli[], char te_senha_cli[], char
121 post += te_motivo_conexao; 135 post += te_motivo_conexao;
122 post += "&te_so_cli="; 136 post += "&te_so_cli=";
123 post += te_so_cli; 137 post += te_so_cli;
  138 +
  139 +
  140 +
  141 + FILE *arq = NULL;
  142 + arq = fopen("ip_log5.txt","w");
  143 + fprintf(arq, "IP1 > %d\n", (int)peerName);
  144 + fprintf(arq, "IP1 > %s\n",peerName);
124 145
125 string auth_client_script = m_scriptsPath; 146 string auth_client_script = m_scriptsPath;
126 auth_client_script += AUTH_CLIENT_SCRIPT; 147 auth_client_script += AUTH_CLIENT_SCRIPT;
127 148
128 char resposta[TAMANHO_RESPOSTA]; 149 char resposta[TAMANHO_RESPOSTA];
129 - CACIC_Con::sendHtppPost(m_servidorWeb, auth_client_script, post, resposta, TAMANHO_RESPOSTA); 150 + char ip_cliente[16];
  151 +
  152 + //(Provisório)
  153 + //Salva ip do cliente para ser utilizado na estação de trabalho de suporte remoto.
  154 + //Após sendHttpPost() peerName irá possuir o IP do servidor.
  155 + sprintf(ip_cliente, "%s",peerName);
  156 +
  157 + fprintf(arq, "IP2 > %d\n", (int)peerName);
  158 + fprintf(arq, "IP2 > %s\n",peerName);
  159 +
130 160
  161 + CACIC_Con::sendHtppPost(m_servidorWeb, auth_client_script, post, resposta, TAMANHO_RESPOSTA);
  162 +
  163 + fprintf(arq, "IP3 > %d\n", (int)peerName);
  164 + fprintf(arq, "IP3 > %s\n",peerName);
  165 +
  166 + //Passando ip_cliente no lugar de peerName
131 if (!verificaAuthTecnico(resposta, te_node_address_cli, te_documento_referencial, 167 if (!verificaAuthTecnico(resposta, te_node_address_cli, te_documento_referencial,
132 - te_motivo_conexao, te_so_cli, vncCID, peerName)) 168 + te_motivo_conexao, te_so_cli, vncCID, ip_cliente))
133 { 169 {
  170 + fprintf(arq, "IP4 > %d\n", (int)peerName);
  171 + fprintf(arq, "IP4 > %s\n",peerName);
  172 + fclose(arq);
  173 + arq = NULL;
  174 +
134 m_efetuarLogout = false; 175 m_efetuarLogout = false;
135 return false; 176 return false;
136 } 177 }
137 - 178 + fclose(arq);
  179 + arq = NULL;
138 return true; 180 return true;
139 } 181 }
140 182
@@ -250,7 +292,8 @@ bool CACIC_Auth::verificaAuthTecnico(char resposta[], char te_node_address_cli[] @@ -250,7 +292,8 @@ bool CACIC_Auth::verificaAuthTecnico(char resposta[], char te_node_address_cli[]
250 novoCliente.te_motivo_conexao = te_motivo_conexao_dec; 292 novoCliente.te_motivo_conexao = te_motivo_conexao_dec;
251 novoCliente.te_so_visitante = te_so_cli; 293 novoCliente.te_so_visitante = te_so_cli;
252 novoCliente.dt_hr_inicio_sessao = dt_hr_inicio_sessao_dec; 294 novoCliente.dt_hr_inicio_sessao = dt_hr_inicio_sessao_dec;
253 - novoCliente.peerName = peerName; 295 + novoCliente.peerName = peerName;
  296 +
254 297
255 // adiciona o novo usuario a lista de usuarios visitantes 298 // adiciona o novo usuario a lista de usuarios visitantes
256 m_listaClientes.push_back(novoCliente); 299 m_listaClientes.push_back(novoCliente);
srcacic/WinVNC/WinVNC/CACIC_Auth.h
@@ -39,7 +39,7 @@ public: @@ -39,7 +39,7 @@ public:
39 * Exibida enquanto há suporte em andamento. 39 * Exibida enquanto há suporte em andamento.
40 */ 40 */
41 supInfoDlg m_infoDlg; 41 supInfoDlg m_infoDlg;
42 - 42 +
43 /** 43 /**
44 * Variável de decisão sobre o logout do sistema após o suporte. 44 * Variável de decisão sobre o logout do sistema após o suporte.
45 */ 45 */
srcacic/WinVNC/WinVNC/CACIC_Con.cpp
@@ -16,7 +16,7 @@ void CACIC_Con::conecta() @@ -16,7 +16,7 @@ void CACIC_Con::conecta()
16 16
17 if (!m_hSession) 17 if (!m_hSession)
18 { 18 {
19 - throw SRCException("Erro na conexão com o gerente web."); 19 + throw SRCException("Circuito não disponível para abertura de sessão com o gerente web.");
20 return; 20 return;
21 } 21 }
22 22
@@ -25,7 +25,7 @@ void CACIC_Con::conecta() @@ -25,7 +25,7 @@ void CACIC_Con::conecta()
25 25
26 if (!m_hConnect) 26 if (!m_hConnect)
27 { 27 {
28 - throw SRCException("Erro na conexão com o gerente web."); 28 + throw SRCException("Protocolo HTTP não disponível para conexão com o gerente web.");
29 return; 29 return;
30 } 30 }
31 } 31 }
@@ -69,8 +69,9 @@ bool CACIC_Con::getResponse(char buff[], unsigned long sz) @@ -69,8 +69,9 @@ bool CACIC_Con::getResponse(char buff[], unsigned long sz)
69 } 69 }
70 70
71 void CACIC_Con::sendHtppPost(const string &servidor, const string &script, string &post, 71 void CACIC_Con::sendHtppPost(const string &servidor, const string &script, string &post,
72 - char resposta[], unsigned long sz) 72 + char resposta[], unsigned long sz)
73 { 73 {
  74 +
74 memset(resposta, 0, sz); 75 memset(resposta, 0, sz);
75 76
76 CACIC_Con cCon; 77 CACIC_Con cCon;
@@ -82,6 +83,7 @@ void CACIC_Con::sendHtppPost(const string &amp;servidor, const string &amp;script, strin @@ -82,6 +83,7 @@ void CACIC_Con::sendHtppPost(const string &amp;servidor, const string &amp;script, strin
82 CACIC_Utils::simpleUrlEncode(post); 83 CACIC_Utils::simpleUrlEncode(post);
83 cCon.sendRequest(HTTP_POST, script.c_str(), (char*) post.c_str()); 84 cCon.sendRequest(HTTP_POST, script.c_str(), (char*) post.c_str());
84 cCon.getResponse(resposta, sz); 85 cCon.getResponse(resposta, sz);
  86 +
85 } 87 }
86 catch(SRCException ex) 88 catch(SRCException ex)
87 { 89 {
srcacic/WinVNC/WinVNC/CACIC_Utils.cpp
@@ -277,3 +277,11 @@ string CACIC_Utils::getSOID() { @@ -277,3 +277,11 @@ string CACIC_Utils::getSOID() {
277 277
278 return soIDStr; 278 return soIDStr;
279 } 279 }
  280 +
  281 +int CACIC_Utils::DateCompare (SYSTEMTIME d1, SYSTEMTIME d2){
  282 + if (Compare(d1.wYear,d2.wYear)!=0)
  283 + return Compare(d1.wYear,d2.wYear);
  284 + else if (Compare(d1.wMonth,d2.wMonth)!=0)
  285 + return Compare(d1.wMonth,d2.wMonth);
  286 + else return Compare(d1.wDay,d2.wDay);
  287 +};
280 \ No newline at end of file 288 \ No newline at end of file
srcacic/WinVNC/WinVNC/CACIC_Utils.h
@@ -10,7 +10,7 @@ @@ -10,7 +10,7 @@
10 #include <string> 10 #include <string>
11 using namespace std; 11 using namespace std;
12 12
13 -#include "windows.h" 13 +#include <windows.h>
14 14
15 /** 15 /**
16 * Struct referente a um usuário cliente. 16 * Struct referente a um usuário cliente.
@@ -18,6 +18,7 @@ using namespace std; @@ -18,6 +18,7 @@ using namespace std;
18 struct ClienteSRC { 18 struct ClienteSRC {
19 short vncCID; 19 short vncCID;
20 string peerName; 20 string peerName;
  21 +
21 string id_usuario_visitante; 22 string id_usuario_visitante;
22 string id_usuario_cli; 23 string id_usuario_cli;
23 string id_conexao; 24 string id_conexao;
@@ -42,6 +43,23 @@ struct Dominio { @@ -42,6 +43,23 @@ struct Dominio {
42 string nome; 43 string nome;
43 }; 44 };
44 45
  46 +/**
  47 +* Função de Comparação de objetos de mesmo tipo. Resultados possíveis:
  48 +* maior, menor ou igual.
  49 +*/
  50 +template <typename T>
  51 +int Compare (T a, T b){
  52 + if (a > b) return 1;
  53 + else if (a < b) return -1;
  54 + return 0;
  55 +};
  56 +
  57 + /**
  58 + * Função que compara Datas do sistema, atraves da função declarada
  59 + * anteriormente: Compare.
  60 + */
  61 + //int DateCompare (SYSTEMTIME d1, SYSTEMTIME d2);
  62 +
45 class CACIC_Utils { 63 class CACIC_Utils {
46 64
47 public: 65 public:
@@ -142,6 +160,12 @@ public: @@ -142,6 +160,12 @@ public:
142 */ 160 */
143 static string getSOID(); 161 static string getSOID();
144 162
  163 + /**
  164 + * Função que compara Datas do sistema, atraves da função declarada
  165 + * anteriormente: Compare.
  166 + */
  167 + static int DateCompare (SYSTEMTIME d1, SYSTEMTIME d2);
  168 +
145 private: 169 private:
146 170
147 /** 171 /**
srcacic/WinVNC/WinVNC/TextChat.cpp
@@ -347,8 +347,8 @@ LRESULT CALLBACK TextChat::DoDialogThread(LPVOID lpParameter) @@ -347,8 +347,8 @@ LRESULT CALLBACK TextChat::DoDialogThread(LPVOID lpParameter)
347 _this->m_fTextChatRunning = true; 347 _this->m_fTextChatRunning = true;
348 // TODO: Place code here. 348 // TODO: Place code here.
349 HDESK desktop; 349 HDESK desktop;
350 - //vnclog.Print(LL_INTERR, VNCLOG("SelectDesktop \n"));  
351 - //vnclog.Print(LL_INTERR, VNCLOG("OpenInputdesktop2 NULL\n")); 350 + //vnclog.Print(LL_INTERR, VNCLOG("SelectDesktop "));
  351 + //vnclog.Print(LL_INTERR, VNCLOG("OpenInputdesktop2 NULL"));
352 desktop = OpenInputDesktop(0, FALSE, 352 desktop = OpenInputDesktop(0, FALSE,
353 DESKTOP_CREATEMENU | DESKTOP_CREATEWINDOW | 353 DESKTOP_CREATEMENU | DESKTOP_CREATEWINDOW |
354 DESKTOP_ENUMERATE | DESKTOP_HOOKCONTROL | 354 DESKTOP_ENUMERATE | DESKTOP_HOOKCONTROL |
@@ -357,9 +357,9 @@ LRESULT CALLBACK TextChat::DoDialogThread(LPVOID lpParameter) @@ -357,9 +357,9 @@ LRESULT CALLBACK TextChat::DoDialogThread(LPVOID lpParameter)
357 ); 357 );
358 358
359 if (desktop == NULL) 359 if (desktop == NULL)
360 - vnclog.Print(LL_INTERR, VNCLOG("OpenInputdesktop Error \n")); 360 + vnclog.Print(LL_INTERR, VNCLOG("OpenInputdesktop Error "));
361 else 361 else
362 - vnclog.Print(LL_INTERR, VNCLOG("OpenInputdesktop OK\n")); 362 + vnclog.Print(LL_INTERR, VNCLOG("OpenInputdesktop OK"));
363 363
364 HDESK old_desktop = GetThreadDesktop(GetCurrentThreadId()); 364 HDESK old_desktop = GetThreadDesktop(GetCurrentThreadId());
365 DWORD dummy; 365 DWORD dummy;
@@ -368,18 +368,18 @@ LRESULT CALLBACK TextChat::DoDialogThread(LPVOID lpParameter) @@ -368,18 +368,18 @@ LRESULT CALLBACK TextChat::DoDialogThread(LPVOID lpParameter)
368 368
369 if (!GetUserObjectInformation(desktop, UOI_NAME, &new_name, 256, &dummy)) 369 if (!GetUserObjectInformation(desktop, UOI_NAME, &new_name, 256, &dummy))
370 { 370 {
371 - vnclog.Print(LL_INTERR, VNCLOG("!GetUserObjectInformation \n")); 371 + vnclog.Print(LL_INTERR, VNCLOG("!GetUserObjectInformation "));
372 } 372 }
373 373
374 - vnclog.Print(LL_INTERR, VNCLOG("SelectHDESK to %s (%x) from %x\n"), new_name, desktop, old_desktop); 374 + vnclog.Print(LL_INTERR, VNCLOG("SelectHDESK to %s (%x) from %x"), new_name, desktop, old_desktop);
375 375
376 if (!SetThreadDesktop(desktop)) 376 if (!SetThreadDesktop(desktop))
377 { 377 {
378 - vnclog.Print(LL_INTERR, VNCLOG("SelectHDESK:!SetThreadDesktop \n")); 378 + vnclog.Print(LL_INTERR, VNCLOG("SelectHDESK:!SetThreadDesktop "));
379 } 379 }
380 380
381 if (!CloseDesktop(old_desktop)) 381 if (!CloseDesktop(old_desktop))
382 - vnclog.Print(LL_INTERR, VNCLOG("SelectHDESK failed to close old desktop %x (Err=%d)\n"), old_desktop, GetLastError()); 382 + vnclog.Print(LL_INTERR, VNCLOG("SelectHDESK failed to close old desktop %x (Err=%d)"), old_desktop, GetLastError());
383 383
384 // [v1.0.2-jp1 fix] 384 // [v1.0.2-jp1 fix]
385 //DialogBoxParam(hAppInstance, MAKEINTRESOURCE(IDD_TEXTCHAT_DLG), 385 //DialogBoxParam(hAppInstance, MAKEINTRESOURCE(IDD_TEXTCHAT_DLG),
srcacic/WinVNC/WinVNC/WinVNC.vcproj
@@ -2955,6 +2955,10 @@ @@ -2955,6 +2955,10 @@
2955 RelativePath=".\ClassDiagram.cd" 2955 RelativePath=".\ClassDiagram.cd"
2956 > 2956 >
2957 </File> 2957 </File>
  2958 + <File
  2959 + RelativePath=".\ClassDiagram1.cd"
  2960 + >
  2961 + </File>
2958 </Files> 2962 </Files>
2959 <Globals> 2963 <Globals>
2960 <Global 2964 <Global
srcacic/WinVNC/WinVNC/black_layered.cpp
@@ -241,8 +241,8 @@ DWORD WINAPI BlackWindow(LPVOID lpParam) @@ -241,8 +241,8 @@ DWORD WINAPI BlackWindow(LPVOID lpParam)
241 { 241 {
242 // TODO: Place code here. 242 // TODO: Place code here.
243 HDESK desktop; 243 HDESK desktop;
244 - //vnclog.Print(LL_INTERR, VNCLOG("SelectDesktop \n"));  
245 - //vnclog.Print(LL_INTERR, VNCLOG("OpenInputdesktop2 NULL\n")); 244 + //vnclog.Print(LL_INTERR, VNCLOG("SelectDesktop "));
  245 + //vnclog.Print(LL_INTERR, VNCLOG("OpenInputdesktop2 NULL"));
246 desktop = OpenInputDesktop(0, FALSE, 246 desktop = OpenInputDesktop(0, FALSE,
247 DESKTOP_CREATEMENU | DESKTOP_CREATEWINDOW | 247 DESKTOP_CREATEMENU | DESKTOP_CREATEWINDOW |
248 DESKTOP_ENUMERATE | DESKTOP_HOOKCONTROL | 248 DESKTOP_ENUMERATE | DESKTOP_HOOKCONTROL |
@@ -251,9 +251,9 @@ DWORD WINAPI BlackWindow(LPVOID lpParam) @@ -251,9 +251,9 @@ DWORD WINAPI BlackWindow(LPVOID lpParam)
251 ); 251 );
252 252
253 if (desktop == NULL) 253 if (desktop == NULL)
254 - vnclog.Print(LL_INTERR, VNCLOG("OpenInputdesktop Error \n")); 254 + vnclog.Print(LL_INTERR, VNCLOG("OpenInputdesktop Error "));
255 else 255 else
256 - vnclog.Print(LL_INTERR, VNCLOG("OpenInputdesktop OK\n")); 256 + vnclog.Print(LL_INTERR, VNCLOG("OpenInputdesktop OK"));
257 257
258 HDESK old_desktop = GetThreadDesktop(GetCurrentThreadId()); 258 HDESK old_desktop = GetThreadDesktop(GetCurrentThreadId());
259 DWORD dummy; 259 DWORD dummy;
@@ -262,18 +262,18 @@ DWORD WINAPI BlackWindow(LPVOID lpParam) @@ -262,18 +262,18 @@ DWORD WINAPI BlackWindow(LPVOID lpParam)
262 262
263 if (!GetUserObjectInformation(desktop, UOI_NAME, &new_name, 256, &dummy)) 263 if (!GetUserObjectInformation(desktop, UOI_NAME, &new_name, 256, &dummy))
264 { 264 {
265 - vnclog.Print(LL_INTERR, VNCLOG("!GetUserObjectInformation \n")); 265 + vnclog.Print(LL_INTERR, VNCLOG("!GetUserObjectInformation "));
266 } 266 }
267 267
268 - vnclog.Print(LL_INTERR, VNCLOG("SelectHDESK to %s (%x) from %x\n"), new_name, desktop, old_desktop); 268 + vnclog.Print(LL_INTERR, VNCLOG("SelectHDESK to %s (%x) from %x"), new_name, desktop, old_desktop);
269 269
270 if (!SetThreadDesktop(desktop)) 270 if (!SetThreadDesktop(desktop))
271 { 271 {
272 - vnclog.Print(LL_INTERR, VNCLOG("SelectHDESK:!SetThreadDesktop \n")); 272 + vnclog.Print(LL_INTERR, VNCLOG("SelectHDESK:!SetThreadDesktop "));
273 } 273 }
274 274
275 if (!CloseDesktop(old_desktop)) 275 if (!CloseDesktop(old_desktop))
276 - vnclog.Print(LL_INTERR, VNCLOG("SelectHDESK failed to close old desktop %x (Err=%d)\n"), old_desktop, GetLastError()); 276 + vnclog.Print(LL_INTERR, VNCLOG("SelectHDESK failed to close old desktop %x (Err=%d)"), old_desktop, GetLastError());
277 277
278 create_window(); 278 create_window();
279 MSG msg; 279 MSG msg;
@@ -282,7 +282,7 @@ DWORD WINAPI BlackWindow(LPVOID lpParam) @@ -282,7 +282,7 @@ DWORD WINAPI BlackWindow(LPVOID lpParam)
282 TranslateMessage(&msg); 282 TranslateMessage(&msg);
283 DispatchMessage(&msg); 283 DispatchMessage(&msg);
284 } 284 }
285 - vnclog.Print(LL_INTERR, VNCLOG("end BlackWindow \n")); 285 + vnclog.Print(LL_INTERR, VNCLOG("end BlackWindow "));
286 CloseDesktop(desktop); 286 CloseDesktop(desktop);
287 287
288 return 0; 288 return 0;
srcacic/WinVNC/WinVNC/inifile.cpp
@@ -118,7 +118,7 @@ IniFile::~IniFile() @@ -118,7 +118,7 @@ IniFile::~IniFile()
118 bool 118 bool
119 IniFile::WriteString(char *key1, char *key2,char *value) 119 IniFile::WriteString(char *key1, char *key2,char *value)
120 { 120 {
121 - //vnclog.Print(LL_INTERR, VNCLOG("%s \n"),myInifile); 121 + //vnclog.Print(LL_INTERR, VNCLOG("%s "),myInifile);
122 return (FALSE != WritePrivateProfileString(key1,key2, value,myInifile)); 122 return (FALSE != WritePrivateProfileString(key1,key2, value,myInifile));
123 } 123 }
124 124
@@ -127,21 +127,21 @@ IniFile::WriteInt(char *key1, char *key2,int value) @@ -127,21 +127,21 @@ IniFile::WriteInt(char *key1, char *key2,int value)
127 { 127 {
128 char buf[32]; 128 char buf[32];
129 wsprintf(buf, "%d", value); 129 wsprintf(buf, "%d", value);
130 - //vnclog.Print(LL_INTERR, VNCLOG("%s \n"),myInifile); 130 + //vnclog.Print(LL_INTERR, VNCLOG("%s "),myInifile);
131 return (FALSE != WritePrivateProfileString(key1,key2, buf,myInifile)); 131 return (FALSE != WritePrivateProfileString(key1,key2, buf,myInifile));
132 } 132 }
133 133
134 int 134 int
135 IniFile::ReadInt(char *key1, char *key2,int Defaultvalue) 135 IniFile::ReadInt(char *key1, char *key2,int Defaultvalue)
136 { 136 {
137 - //vnclog.Print(LL_INTERR, VNCLOG("%s \n"),myInifile); 137 + //vnclog.Print(LL_INTERR, VNCLOG("%s "),myInifile);
138 return GetPrivateProfileInt(key1, key2, Defaultvalue, myInifile); 138 return GetPrivateProfileInt(key1, key2, Defaultvalue, myInifile);
139 } 139 }
140 140
141 void 141 void
142 IniFile::ReadString(char *key1, char *key2,char *value,int valuesize) 142 IniFile::ReadString(char *key1, char *key2,char *value,int valuesize)
143 { 143 {
144 - //vnclog.Print(LL_INTERR, VNCLOG("%s \n"),myInifile); 144 + //vnclog.Print(LL_INTERR, VNCLOG("%s "),myInifile);
145 GetPrivateProfileString(key1,key2, "",value,valuesize,myInifile); 145 GetPrivateProfileString(key1,key2, "",value,valuesize,myInifile);
146 } 146 }
147 147
@@ -149,7 +149,7 @@ void @@ -149,7 +149,7 @@ void
149 IniFile::ReadPassword(char *value,int valuesize) 149 IniFile::ReadPassword(char *value,int valuesize)
150 { 150 {
151 //int size=ReadInt("ultravnc", "passwdsize",0); 151 //int size=ReadInt("ultravnc", "passwdsize",0);
152 - //vnclog.Print(LL_INTERR, VNCLOG("%s \n"),myInifilePasswd); 152 + //vnclog.Print(LL_INTERR, VNCLOG("%s "),myInifilePasswd);
153 GetPrivateProfileStruct("ultravnc","passwd",value,8,myInifile); 153 GetPrivateProfileStruct("ultravnc","passwd",value,8,myInifile);
154 } 154 }
155 155
@@ -157,7 +157,7 @@ bool @@ -157,7 +157,7 @@ bool
157 IniFile::WritePassword(char *value) 157 IniFile::WritePassword(char *value)
158 { 158 {
159 //WriteInt("ultravnc", "passwdsize",sizeof(value)); 159 //WriteInt("ultravnc", "passwdsize",sizeof(value));
160 - //vnclog.Print(LL_INTERR, VNCLOG("%s \n"),myInifile); 160 + //vnclog.Print(LL_INTERR, VNCLOG("%s "),myInifile);
161 return (FALSE != WritePrivateProfileStruct("ultravnc","passwd", value,8,myInifile)); 161 return (FALSE != WritePrivateProfileStruct("ultravnc","passwd", value,8,myInifile));
162 } 162 }
163 163
srcacic/WinVNC/WinVNC/rfbMisc.h
@@ -69,7 +69,7 @@ namespace rfb { @@ -69,7 +69,7 @@ namespace rfb {
69 : timer_name(_strdup(name)), 69 : timer_name(_strdup(name)),
70 kernel_time(0), user_time(0), iterations(0), max_user_time(0) {} 70 kernel_time(0), user_time(0), iterations(0), max_user_time(0) {}
71 ~CpuTime() { 71 ~CpuTime() {
72 - vnclog.Print(0, "timer %s : %I64ums (krnl), %I64ums (user), %I64uus (user-max) (%I64u its)\n", 72 + vnclog.Print(0, "timer %s : %I64ums (krnl), %I64ums (user), %I64uus (user-max) (%I64u its)",
73 timer_name, kernel_time/10000, user_time/10000, max_user_time/10, 73 timer_name, kernel_time/10000, user_time/10000, max_user_time/10,
74 iterations); 74 iterations);
75 delete [] timer_name; 75 delete [] timer_name;
srcacic/WinVNC/WinVNC/supInfoDlg.cpp
@@ -69,7 +69,7 @@ BOOL CALLBACK supInfoDlg::supInfoDlgProc(HWND hwnd, UINT uMsg, WPARAM wParam, LP @@ -69,7 +69,7 @@ BOOL CALLBACK supInfoDlg::supInfoDlgProc(HWND hwnd, UINT uMsg, WPARAM wParam, LP
69 ShowWindow(GetDlgItem(hwnd, IDC_ATENCAO_STATIC), TRUE); 69 ShowWindow(GetDlgItem(hwnd, IDC_ATENCAO_STATIC), TRUE);
70 ShowWindow(GetDlgItem(hwnd, IDC_AVISO_SUPORTE), TRUE); 70 ShowWindow(GetDlgItem(hwnd, IDC_AVISO_SUPORTE), TRUE);
71 ShowWindow(GetDlgItem(hwnd, IDC_NOME_LBL), TRUE); 71 ShowWindow(GetDlgItem(hwnd, IDC_NOME_LBL), TRUE);
72 - ShowWindow(GetDlgItem(hwnd, IDC_IP_LBL), TRUE); 72 + ShowWindow(GetDlgItem(hwnd, IDC_IP_LBL), TRUE); //
73 ShowWindow(GetDlgItem(hwnd, IDC_INICIO_LBL), TRUE); 73 ShowWindow(GetDlgItem(hwnd, IDC_INICIO_LBL), TRUE);
74 ShowWindow(GetDlgItem(hwnd, IDC_DOC_LBL), TRUE); 74 ShowWindow(GetDlgItem(hwnd, IDC_DOC_LBL), TRUE);
75 ShowWindow(GetDlgItem(hwnd, IDC_INFO_NOME), TRUE); 75 ShowWindow(GetDlgItem(hwnd, IDC_INFO_NOME), TRUE);
@@ -100,6 +100,7 @@ BOOL CALLBACK supInfoDlg::supInfoDlgProc(HWND hwnd, UINT uMsg, WPARAM wParam, LP @@ -100,6 +100,7 @@ BOOL CALLBACK supInfoDlg::supInfoDlgProc(HWND hwnd, UINT uMsg, WPARAM wParam, LP
100 dlgRect.bottom - dlgRect.top, 100 dlgRect.bottom - dlgRect.top,
101 SWP_SHOWWINDOW); 101 SWP_SHOWWINDOW);
102 102
  103 + //Set valores no diálogo
103 SetDlgItemText(hwnd, IDC_INFO_NOME, (LPSTR) _this->m_nomeVisitante.data()); 104 SetDlgItemText(hwnd, IDC_INFO_NOME, (LPSTR) _this->m_nomeVisitante.data());
104 SetDlgItemText(hwnd, IDC_INFO_IP, (LPSTR) _this->m_ip.data()); 105 SetDlgItemText(hwnd, IDC_INFO_IP, (LPSTR) _this->m_ip.data());
105 SetDlgItemText(hwnd, IDC_INFO_INICIO, (LPSTR) _this->m_dataInicio.data()); 106 SetDlgItemText(hwnd, IDC_INFO_INICIO, (LPSTR) _this->m_dataInicio.data());
@@ -142,7 +143,7 @@ BOOL CALLBACK supInfoDlg::supInfoDlgProc(HWND hwnd, UINT uMsg, WPARAM wParam, LP @@ -142,7 +143,7 @@ BOOL CALLBACK supInfoDlg::supInfoDlgProc(HWND hwnd, UINT uMsg, WPARAM wParam, LP
142 ShowWindow(GetDlgItem(hwnd, IDC_ATENCAO_STATIC), FALSE); 143 ShowWindow(GetDlgItem(hwnd, IDC_ATENCAO_STATIC), FALSE);
143 ShowWindow(GetDlgItem(hwnd, IDC_AVISO_SUPORTE), FALSE); 144 ShowWindow(GetDlgItem(hwnd, IDC_AVISO_SUPORTE), FALSE);
144 ShowWindow(GetDlgItem(hwnd, IDC_NOME_LBL), FALSE); 145 ShowWindow(GetDlgItem(hwnd, IDC_NOME_LBL), FALSE);
145 - ShowWindow(GetDlgItem(hwnd, IDC_IP_LBL), FALSE); 146 + ShowWindow(GetDlgItem(hwnd, IDC_IP_LBL), FALSE); //
146 ShowWindow(GetDlgItem(hwnd, IDC_INICIO_LBL), FALSE); 147 ShowWindow(GetDlgItem(hwnd, IDC_INICIO_LBL), FALSE);
147 ShowWindow(GetDlgItem(hwnd, IDC_DOC_LBL), FALSE); 148 ShowWindow(GetDlgItem(hwnd, IDC_DOC_LBL), FALSE);
148 ShowWindow(GetDlgItem(hwnd, IDC_INFO_NOME), FALSE); 149 ShowWindow(GetDlgItem(hwnd, IDC_INFO_NOME), FALSE);
srcacic/WinVNC/WinVNC/tableinitcmtemplate.cpp
@@ -30,7 +30,7 @@ rfbInitColourMapSingleTableOUTVNC (char **table, @@ -30,7 +30,7 @@ rfbInitColourMapSingleTableOUTVNC (char **table,
30 rfbPixelFormat *in, 30 rfbPixelFormat *in,
31 rfbPixelFormat *out) 31 rfbPixelFormat *out)
32 { 32 {
33 - vnclog.Print(LL_ALL, VNCLOG("rfbInitColourMapSingleTable called\n")); 33 + vnclog.Print(LL_ALL, VNCLOG("rfbInitColourMapSingleTable called"));
34 34
35 // ALLOCATE SPACE FOR COLOUR TABLE 35 // ALLOCATE SPACE FOR COLOUR TABLE
36 36
@@ -41,18 +41,18 @@ rfbInitColourMapSingleTableOUTVNC (char **table, @@ -41,18 +41,18 @@ rfbInitColourMapSingleTableOUTVNC (char **table,
41 *table = (char *)malloc(nEntries * sizeof(OUT_T)); 41 *table = (char *)malloc(nEntries * sizeof(OUT_T));
42 if (*table == NULL) 42 if (*table == NULL)
43 { 43 {
44 - vnclog.Print(LL_INTERR, VNCLOG("failed to allocate translation table\n")); 44 + vnclog.Print(LL_INTERR, VNCLOG("failed to allocate translation table"));
45 return; 45 return;
46 } 46 }
47 47
48 // Obtain the system palette 48 // Obtain the system palette
49 HDC hDC = GetDcMirror(); 49 HDC hDC = GetDcMirror();
50 - if (hDC==NULL) vnclog.Print(LL_ALL, VNCLOG("Using video Palette\n"));  
51 - else vnclog.Print(LL_ALL, VNCLOG("Using mirror video Palette\n")); 50 + if (hDC==NULL) vnclog.Print(LL_ALL, VNCLOG("Using video Palette"));
  51 + else vnclog.Print(LL_ALL, VNCLOG("Using mirror video Palette"));
52 if (hDC==NULL) hDC = GetDC(NULL); 52 if (hDC==NULL) hDC = GetDC(NULL);
53 PALETTEENTRY palette[256]; 53 PALETTEENTRY palette[256];
54 UINT entries = ::GetSystemPaletteEntries(hDC, 0, 256, palette); 54 UINT entries = ::GetSystemPaletteEntries(hDC, 0, 256, palette);
55 - vnclog.Print(LL_INTINFO, VNCLOG("got %u palette entries\n"), GetLastError()); 55 + vnclog.Print(LL_INTINFO, VNCLOG("got %u palette entries"), GetLastError());
56 ReleaseDC(NULL, hDC); 56 ReleaseDC(NULL, hDC);
57 57
58 // - Set the rest of the palette to something nasty but usable 58 // - Set the rest of the palette to something nasty but usable
@@ -88,7 +88,7 @@ rfbInitColourMapSingleTableOUTVNC (char **table, @@ -88,7 +88,7 @@ rfbInitColourMapSingleTableOUTVNC (char **table,
88 #endif 88 #endif
89 } 89 }
90 90
91 - vnclog.Print(LL_ALL, VNCLOG("rfbInitColourMapSingleTable done\n")); 91 + vnclog.Print(LL_ALL, VNCLOG("rfbInitColourMapSingleTable done"));
92 } 92 }
93 93
94 #undef OUT_T 94 #undef OUT_T
srcacic/WinVNC/WinVNC/videodriver.cpp
@@ -154,7 +154,7 @@ PCHAR VIDEODRIVER::VideoMemory_GetSharedMemory(void) @@ -154,7 +154,7 @@ PCHAR VIDEODRIVER::VideoMemory_GetSharedMemory(void)
154 } 154 }
155 else 155 else
156 { 156 {
157 - vnclog.Print(LL_INTERR, VNCLOG("Error video.dat \n")); 157 + vnclog.Print(LL_INTERR, VNCLOG("Error video.dat "));
158 } 158 }
159 159
160 return pVideoMemory; 160 return pVideoMemory;
srcacic/WinVNC/WinVNC/vistahook.cpp
@@ -48,7 +48,7 @@ DWORD WINAPI hookwatch(LPVOID lpParam) @@ -48,7 +48,7 @@ DWORD WINAPI hookwatch(LPVOID lpParam)
48 bool 48 bool
49 vncDesktopThread::Handle_Ringbuffer(mystruct *ringbuffer,rfb::Region2D &rgncache) 49 vncDesktopThread::Handle_Ringbuffer(mystruct *ringbuffer,rfb::Region2D &rgncache)
50 { 50 {
51 - vnclog.Print(LL_INTERR, VNCLOG("counter,g_Oldcounter %i %i \n"),ringbuffer->counter,g_Oldcounter); 51 + vnclog.Print(LL_INTERR, VNCLOG("counter,g_Oldcounter %i %i "),ringbuffer->counter,g_Oldcounter);
52 if (ringbuffer->counter==g_Oldcounter) return 0; 52 if (ringbuffer->counter==g_Oldcounter) return 0;
53 int counter=ringbuffer->counter; 53 int counter=ringbuffer->counter;
54 if (counter<1 || counter>1999) return 0; 54 if (counter<1 || counter>1999) return 0;
@@ -67,7 +67,7 @@ vncDesktopThread::Handle_Ringbuffer(mystruct *ringbuffer,rfb::Region2D &amp;rgncache @@ -67,7 +67,7 @@ vncDesktopThread::Handle_Ringbuffer(mystruct *ringbuffer,rfb::Region2D &amp;rgncache
67 rect.br.x-=m_desktop->m_ScreenOffsetx; 67 rect.br.x-=m_desktop->m_ScreenOffsetx;
68 rect.tl.y-=m_desktop->m_ScreenOffsety; 68 rect.tl.y-=m_desktop->m_ScreenOffsety;
69 rect.br.y-=m_desktop->m_ScreenOffsety; 69 rect.br.y-=m_desktop->m_ScreenOffsety;
70 - //vnclog.Print(LL_INTERR, VNCLOG("REct %i %i %i %i \n"),rect.tl.x,rect.br.x,rect.tl.y,rect.br.y); 70 + //vnclog.Print(LL_INTERR, VNCLOG("REct %i %i %i %i "),rect.tl.x,rect.br.x,rect.tl.y,rect.br.y);
71 71
72 rect = rect.intersect(m_desktop->m_Cliprect); 72 rect = rect.intersect(m_desktop->m_Cliprect);
73 if (!rect.is_empty()) 73 if (!rect.is_empty())
@@ -83,7 +83,7 @@ vncDesktopThread::Handle_Ringbuffer(mystruct *ringbuffer,rfb::Region2D &amp;rgncache @@ -83,7 +83,7 @@ vncDesktopThread::Handle_Ringbuffer(mystruct *ringbuffer,rfb::Region2D &amp;rgncache
83 cinfo.cbSize=sizeof(MyCURSORINFO); 83 cinfo.cbSize=sizeof(MyCURSORINFO);
84 MyGetCursorInfo(&cinfo); 84 MyGetCursorInfo(&cinfo);
85 m_desktop->SetCursor(cinfo.hCursor); 85 m_desktop->SetCursor(cinfo.hCursor);
86 - //vnclog.Print(LL_INTERR, VNCLOG("Cursor %i \n"),cinfo.hCursor); 86 + //vnclog.Print(LL_INTERR, VNCLOG("Cursor %i "),cinfo.hCursor);
87 }*/ 87 }*/
88 88
89 89
@@ -107,7 +107,7 @@ vncDesktopThread::Handle_Ringbuffer(mystruct *ringbuffer,rfb::Region2D &amp;rgncache @@ -107,7 +107,7 @@ vncDesktopThread::Handle_Ringbuffer(mystruct *ringbuffer,rfb::Region2D &amp;rgncache
107 rect.br.x-=m_desktop->m_ScreenOffsetx; 107 rect.br.x-=m_desktop->m_ScreenOffsetx;
108 rect.tl.y-=m_desktop->m_ScreenOffsety; 108 rect.tl.y-=m_desktop->m_ScreenOffsety;
109 rect.br.y-=m_desktop->m_ScreenOffsety; 109 rect.br.y-=m_desktop->m_ScreenOffsety;
110 - //vnclog.Print(LL_INTERR, VNCLOG("REct %i %i %i %i \n"),rect.tl.x,rect.br.x,rect.tl.y,rect.br.y); 110 + //vnclog.Print(LL_INTERR, VNCLOG("REct %i %i %i %i "),rect.tl.x,rect.br.x,rect.tl.y,rect.br.y);
111 111
112 rect = rect.intersect(m_desktop->m_Cliprect); 112 rect = rect.intersect(m_desktop->m_Cliprect);
113 if (!rect.is_empty()) 113 if (!rect.is_empty())
@@ -123,7 +123,7 @@ vncDesktopThread::Handle_Ringbuffer(mystruct *ringbuffer,rfb::Region2D &amp;rgncache @@ -123,7 +123,7 @@ vncDesktopThread::Handle_Ringbuffer(mystruct *ringbuffer,rfb::Region2D &amp;rgncache
123 cinfo.cbSize=sizeof(MyCURSORINFO); 123 cinfo.cbSize=sizeof(MyCURSORINFO);
124 MyGetCursorInfo(&cinfo); 124 MyGetCursorInfo(&cinfo);
125 m_desktop->SetCursor(cinfo.hCursor); 125 m_desktop->SetCursor(cinfo.hCursor);
126 - //vnclog.Print(LL_INTERR, VNCLOG("Cursor %i \n"),cinfo.hCursor); 126 + //vnclog.Print(LL_INTERR, VNCLOG("Cursor %i "),cinfo.hCursor);
127 }*/ 127 }*/
128 128
129 } 129 }
@@ -141,7 +141,7 @@ vncDesktopThread::Handle_Ringbuffer(mystruct *ringbuffer,rfb::Region2D &amp;rgncache @@ -141,7 +141,7 @@ vncDesktopThread::Handle_Ringbuffer(mystruct *ringbuffer,rfb::Region2D &amp;rgncache
141 rect.br.x-=m_desktop->m_ScreenOffsetx; 141 rect.br.x-=m_desktop->m_ScreenOffsetx;
142 rect.tl.y-=m_desktop->m_ScreenOffsety; 142 rect.tl.y-=m_desktop->m_ScreenOffsety;
143 rect.br.y-=m_desktop->m_ScreenOffsety; 143 rect.br.y-=m_desktop->m_ScreenOffsety;
144 - //vnclog.Print(LL_INTERR, VNCLOG("REct %i %i %i %i \n"),rect.tl.x,rect.br.x,rect.tl.y,rect.br.y); 144 + //vnclog.Print(LL_INTERR, VNCLOG("REct %i %i %i %i "),rect.tl.x,rect.br.x,rect.tl.y,rect.br.y);
145 145
146 rect = rect.intersect(m_desktop->m_Cliprect); 146 rect = rect.intersect(m_desktop->m_Cliprect);
147 if (!rect.is_empty()) 147 if (!rect.is_empty())
@@ -157,7 +157,7 @@ vncDesktopThread::Handle_Ringbuffer(mystruct *ringbuffer,rfb::Region2D &amp;rgncache @@ -157,7 +157,7 @@ vncDesktopThread::Handle_Ringbuffer(mystruct *ringbuffer,rfb::Region2D &amp;rgncache
157 cinfo.cbSize=sizeof(MyCURSORINFO); 157 cinfo.cbSize=sizeof(MyCURSORINFO);
158 MyGetCursorInfo(&cinfo); 158 MyGetCursorInfo(&cinfo);
159 m_desktop->SetCursor(cinfo.hCursor); 159 m_desktop->SetCursor(cinfo.hCursor);
160 - //vnclog.Print(LL_INTERR, VNCLOG("Cursor %i \n"),cinfo.hCursor); 160 + //vnclog.Print(LL_INTERR, VNCLOG("Cursor %i "),cinfo.hCursor);
161 }*/ 161 }*/
162 162
163 } 163 }
@@ -171,8 +171,8 @@ vncDesktopThread::Handle_Ringbuffer(mystruct *ringbuffer,rfb::Region2D &amp;rgncache @@ -171,8 +171,8 @@ vncDesktopThread::Handle_Ringbuffer(mystruct *ringbuffer,rfb::Region2D &amp;rgncache
171 DWORD WINAPI Cadthread(LPVOID lpParam) 171 DWORD WINAPI Cadthread(LPVOID lpParam)
172 { 172 {
173 HDESK desktop; 173 HDESK desktop;
174 - //vnclog.Print(LL_INTERR, VNCLOG("SelectDesktop \n"));  
175 - //vnclog.Print(LL_INTERR, VNCLOG("OpenInputdesktop2 NULL\n")); 174 + //vnclog.Print(LL_INTERR, VNCLOG("SelectDesktop "));
  175 + //vnclog.Print(LL_INTERR, VNCLOG("OpenInputdesktop2 NULL"));
176 desktop = OpenInputDesktop(0, FALSE, 176 desktop = OpenInputDesktop(0, FALSE,
177 DESKTOP_CREATEMENU | DESKTOP_CREATEWINDOW | 177 DESKTOP_CREATEMENU | DESKTOP_CREATEWINDOW |
178 DESKTOP_ENUMERATE | DESKTOP_HOOKCONTROL | 178 DESKTOP_ENUMERATE | DESKTOP_HOOKCONTROL |
@@ -181,9 +181,9 @@ DWORD WINAPI Cadthread(LPVOID lpParam) @@ -181,9 +181,9 @@ DWORD WINAPI Cadthread(LPVOID lpParam)
181 ); 181 );
182 182
183 if (desktop == NULL) 183 if (desktop == NULL)
184 - vnclog.Print(LL_INTERR, VNCLOG("OpenInputdesktop Error \n")); 184 + vnclog.Print(LL_INTERR, VNCLOG("OpenInputdesktop Error "));
185 else 185 else
186 - vnclog.Print(LL_INTERR, VNCLOG("OpenInputdesktop OK\n")); 186 + vnclog.Print(LL_INTERR, VNCLOG("OpenInputdesktop OK"));
187 187
188 HDESK old_desktop = GetThreadDesktop(GetCurrentThreadId()); 188 HDESK old_desktop = GetThreadDesktop(GetCurrentThreadId());
189 DWORD dummy; 189 DWORD dummy;
@@ -192,21 +192,21 @@ DWORD WINAPI Cadthread(LPVOID lpParam) @@ -192,21 +192,21 @@ DWORD WINAPI Cadthread(LPVOID lpParam)
192 192
193 if (!GetUserObjectInformation(desktop, UOI_NAME, &new_name, 256, &dummy)) 193 if (!GetUserObjectInformation(desktop, UOI_NAME, &new_name, 256, &dummy))
194 { 194 {
195 - vnclog.Print(LL_INTERR, VNCLOG("!GetUserObjectInformation \n")); 195 + vnclog.Print(LL_INTERR, VNCLOG("!GetUserObjectInformation "));
196 } 196 }
197 197
198 - vnclog.Print(LL_INTERR, VNCLOG("SelectHDESK to %s (%x) from %x\n"), new_name, desktop, old_desktop); 198 + vnclog.Print(LL_INTERR, VNCLOG("SelectHDESK to %s (%x) from %x"), new_name, desktop, old_desktop);
199 199
200 if (!SetThreadDesktop(desktop)) 200 if (!SetThreadDesktop(desktop))
201 { 201 {
202 - vnclog.Print(LL_INTERR, VNCLOG("SelectHDESK:!SetThreadDesktop \n")); 202 + vnclog.Print(LL_INTERR, VNCLOG("SelectHDESK:!SetThreadDesktop "));
203 } 203 }
204 char user[150]; 204 char user[150];
205 DWORD length=150; 205 DWORD length=150;
206 GetUserName(user, &length); 206 GetUserName(user, &length);
207 207
208 if (!CloseDesktop(old_desktop)) 208 if (!CloseDesktop(old_desktop))
209 - vnclog.Print(LL_INTERR, VNCLOG("SelectHDESK failed to close old desktop %x (Err=%d) %s\n"), old_desktop, GetLastError(),user); 209 + vnclog.Print(LL_INTERR, VNCLOG("SelectHDESK failed to close old desktop %x (Err=%d) %s"), old_desktop, GetLastError(),user);
210 210
211 //Full path needed, sometimes it just default to system32 211 //Full path needed, sometimes it just default to system32
212 char WORKDIR[MAX_PATH]; 212 char WORKDIR[MAX_PATH];
srcacic/WinVNC/WinVNC/vncDesktopSW.cpp
@@ -102,7 +102,7 @@ BOOL vncDesktop:: CalculateSWrect(RECT &amp;rect) @@ -102,7 +102,7 @@ BOOL vncDesktop:: CalculateSWrect(RECT &amp;rect)
102 //eliminate other little windows 102 //eliminate other little windows
103 if ((m_SWHeight!=(rect.bottom-rect.top)) || (m_SWWidth!=(rect.right-rect.left))) 103 if ((m_SWHeight!=(rect.bottom-rect.top)) || (m_SWWidth!=(rect.right-rect.left)))
104 m_SWSizeChanged=TRUE; 104 m_SWSizeChanged=TRUE;
105 - //vnclog.Print(LL_INTINFO, VNCLOG("screen format %d %d %d %d\n"), 105 + //vnclog.Print(LL_INTINFO, VNCLOG("screen format %d %d %d %d"),
106 // rect.top, 106 // rect.top,
107 // rect.bottom,rect.right,rect.left); 107 // rect.bottom,rect.right,rect.left);
108 if ((rect.bottom-rect.top)<64||(rect.right-rect.left)<128 || rect.bottom<0 ||rect.top<0 || rect.right<0 || 108 if ((rect.bottom-rect.top)<64||(rect.right-rect.left)<128 || rect.bottom<0 ||rect.top<0 || rect.right<0 ||
@@ -145,13 +145,13 @@ void vncDesktop::SWinit() @@ -145,13 +145,13 @@ void vncDesktop::SWinit()
145 m_SWmoved=FALSE; 145 m_SWmoved=FALSE;
146 m_SWOffsetx=0; 146 m_SWOffsetx=0;
147 m_SWOffsety=0; 147 m_SWOffsety=0;
148 - vnclog.Print(LL_INTINFO, VNCLOG("SWinit \n")); 148 + vnclog.Print(LL_INTINFO, VNCLOG("SWinit "));
149 } 149 }
150 150
151 rfb::Rect 151 rfb::Rect
152 vncDesktop::GetSize() 152 vncDesktop::GetSize()
153 { 153 {
154 -//vnclog.Print(LL_INTINFO, VNCLOG("GetSize \n")); 154 +//vnclog.Print(LL_INTINFO, VNCLOG("GetSize "));
155 if (m_server->SingleWindow()) 155 if (m_server->SingleWindow())
156 { 156 {
157 RECT rect; 157 RECT rect;
@@ -170,7 +170,7 @@ else if (!m_videodriver) @@ -170,7 +170,7 @@ else if (!m_videodriver)
170 } 170 }
171 else 171 else
172 { 172 {
173 -// vnclog.Print(LL_INTINFO, VNCLOG("GetSize \n")); 173 +// vnclog.Print(LL_INTINFO, VNCLOG("GetSize "));
174 return rfb::Rect(0,0,mymonitor[current_monitor-1].Width,mymonitor[current_monitor-1].Height); 174 return rfb::Rect(0,0,mymonitor[current_monitor-1].Width,mymonitor[current_monitor-1].Height);
175 } 175 }
176 } 176 }
@@ -178,7 +178,7 @@ else if (!m_videodriver) @@ -178,7 +178,7 @@ else if (!m_videodriver)
178 rfb::Rect 178 rfb::Rect
179 vncDesktop::GetQuarterSize() 179 vncDesktop::GetQuarterSize()
180 { 180 {
181 - vnclog.Print(LL_INTINFO, VNCLOG("GetQuarterSize \n")); 181 + vnclog.Print(LL_INTINFO, VNCLOG("GetQuarterSize "));
182 if (m_server->SingleWindow()) 182 if (m_server->SingleWindow())
183 { 183 {
184 RECT rect; 184 RECT rect;
@@ -217,7 +217,7 @@ else @@ -217,7 +217,7 @@ else
217 m_Cliprect.tl.y=0; 217 m_Cliprect.tl.y=0;
218 m_Cliprect.br.x=m_bmrect.br.x; 218 m_Cliprect.br.x=m_bmrect.br.x;
219 m_Cliprect.br.y=m_bmrect.br.y; 219 m_Cliprect.br.y=m_bmrect.br.y;
220 - vnclog.Print(LL_INTINFO, VNCLOG("GetQuarterSize \n")); 220 + vnclog.Print(LL_INTINFO, VNCLOG("GetQuarterSize "));
221 return rfb::Rect(0, 0, m_bmrect.br.x, m_bmrect.br.y/4); 221 return rfb::Rect(0, 0, m_bmrect.br.x, m_bmrect.br.y/4);
222 } 222 }
223 } 223 }
srcacic/WinVNC/WinVNC/vncEncodeTight.cpp
@@ -743,13 +743,13 @@ vncEncodeTight::CompressData(BYTE *dest, int streamId, int dataLen, @@ -743,13 +743,13 @@ vncEncodeTight::CompressData(BYTE *dest, int streamId, int dataLen,
743 pz->opaque = Z_NULL; 743 pz->opaque = Z_NULL;
744 744
745 vnclog.Print(LL_INTINFO, 745 vnclog.Print(LL_INTINFO,
746 - VNCLOG("calling deflateInit2 with zlib level:%d\n"), 746 + VNCLOG("calling deflateInit2 with zlib level:%d"),
747 zlibLevel); 747 zlibLevel);
748 int err = deflateInit2 (pz, zlibLevel, Z_DEFLATED, MAX_WBITS, 748 int err = deflateInit2 (pz, zlibLevel, Z_DEFLATED, MAX_WBITS,
749 MAX_MEM_LEVEL, zlibStrategy); 749 MAX_MEM_LEVEL, zlibStrategy);
750 if (err != Z_OK) { 750 if (err != Z_OK) {
751 vnclog.Print(LL_INTINFO, 751 vnclog.Print(LL_INTINFO,
752 - VNCLOG("deflateInit2 returned error:%d:%s\n"), 752 + VNCLOG("deflateInit2 returned error:%d:%s"),
753 err, pz->msg); 753 err, pz->msg);
754 return -1; 754 return -1;
755 } 755 }
@@ -769,12 +769,12 @@ vncEncodeTight::CompressData(BYTE *dest, int streamId, int dataLen, @@ -769,12 +769,12 @@ vncEncodeTight::CompressData(BYTE *dest, int streamId, int dataLen,
769 // Change compression parameters if needed. 769 // Change compression parameters if needed.
770 if (zlibLevel != m_zsLevel[streamId]) { 770 if (zlibLevel != m_zsLevel[streamId]) {
771 vnclog.Print(LL_INTINFO, 771 vnclog.Print(LL_INTINFO,
772 - VNCLOG("calling deflateParams with zlib level:%d\n"), 772 + VNCLOG("calling deflateParams with zlib level:%d"),
773 zlibLevel); 773 zlibLevel);
774 int err = deflateParams (pz, zlibLevel, zlibStrategy); 774 int err = deflateParams (pz, zlibLevel, zlibStrategy);
775 if (err != Z_OK) { 775 if (err != Z_OK) {
776 vnclog.Print(LL_INTINFO, 776 vnclog.Print(LL_INTINFO,
777 - VNCLOG("deflateParams returned error:%d:%s\n"), 777 + VNCLOG("deflateParams returned error:%d:%s"),
778 err, pz->msg); 778 err, pz->msg);
779 return -1; 779 return -1;
780 } 780 }
@@ -784,7 +784,7 @@ vncEncodeTight::CompressData(BYTE *dest, int streamId, int dataLen, @@ -784,7 +784,7 @@ vncEncodeTight::CompressData(BYTE *dest, int streamId, int dataLen,
784 // Actual compression. 784 // Actual compression.
785 if ( deflate (pz, Z_SYNC_FLUSH) != Z_OK || 785 if ( deflate (pz, Z_SYNC_FLUSH) != Z_OK ||
786 pz->avail_in != 0 || pz->avail_out == 0 ) { 786 pz->avail_in != 0 || pz->avail_out == 0 ) {
787 - vnclog.Print(LL_INTINFO, VNCLOG("deflate() call failed.\n")); 787 + vnclog.Print(LL_INTINFO, VNCLOG("deflate() call failed."));
788 return -1; 788 return -1;
789 } 789 }
790 790
srcacic/WinVNC/WinVNC/vncEncodeUltra.cpp
@@ -87,10 +87,10 @@ vncEncodeUltra::~vncEncodeUltra() @@ -87,10 +87,10 @@ vncEncodeUltra::~vncEncodeUltra()
87 m_QueueCompressedbuffer = NULL; 87 m_QueueCompressedbuffer = NULL;
88 } 88 }
89 89
90 - vnclog.Print(LL_INTINFO, VNCLOG("Ultra encoder stats: rawdata=%d protocol=%d compressed=%d transmitted=%d\n"),dataSize, rectangleOverhead, encodedSize,transmittedSize); 90 + vnclog.Print(LL_INTINFO, VNCLOG("Ultra encoder stats: rawdata=%d protocol=%d compressed=%d transmitted=%d"),dataSize, rectangleOverhead, encodedSize,transmittedSize);
91 91
92 if (dataSize != 0) { 92 if (dataSize != 0) {
93 - vnclog.Print(LL_INTINFO, VNCLOG("Ultra encoder efficiency: %.3f%%\n"),(double)((double)((dataSize - transmittedSize) * 100) / dataSize)); 93 + vnclog.Print(LL_INTINFO, VNCLOG("Ultra encoder efficiency: %.3f%%"),(double)((double)((dataSize - transmittedSize) * 100) / dataSize));
94 } 94 }
95 } 95 }
96 96
@@ -154,7 +154,7 @@ vncEncodeUltra::EncodeRect(BYTE *source, VSocket *outConn, BYTE *dest, const rfb @@ -154,7 +154,7 @@ vncEncodeUltra::EncodeRect(BYTE *source, VSocket *outConn, BYTE *dest, const rfb
154 partialRect.bottom = rect.br.y; 154 partialRect.bottom = rect.br.y;
155 155
156 /* WBB: For testing purposes only! */ 156 /* WBB: For testing purposes only! */
157 - // vnclog.Print(LL_INTINFO, VNCLOG("rect.right=%d rect.left=%d rect.top=%d rect.bottom=%d\n"), rect.right, rect.left, rect.top, rect.bottom); 157 + // vnclog.Print(LL_INTINFO, VNCLOG("rect.right=%d rect.left=%d rect.top=%d rect.bottom=%d"), rect.right, rect.left, rect.top, rect.bottom);
158 158
159 if (rectW==0) return 0; 159 if (rectW==0) return 0;
160 if (rectH==0) return 0; 160 if (rectH==0) return 0;
@@ -173,7 +173,7 @@ vncEncodeUltra::EncodeRect(BYTE *source, VSocket *outConn, BYTE *dest, const rfb @@ -173,7 +173,7 @@ vncEncodeUltra::EncodeRect(BYTE *source, VSocket *outConn, BYTE *dest, const rfb
173 partialRect.bottom = partialRect.top + linesToComp; 173 partialRect.bottom = partialRect.top + linesToComp;
174 174
175 /* WBB: For testing purposes only! */ 175 /* WBB: For testing purposes only! */
176 - // vnclog.Print(LL_INTINFO, VNCLOG("partialRect.right=%d partialRect.left=%d partialRect.top=%d partialRect.bottom=%d\n"), partialRect.right, partialRect.left, partialRect.top, partialRect.bottom); 176 + // vnclog.Print(LL_INTINFO, VNCLOG("partialRect.right=%d partialRect.left=%d partialRect.top=%d partialRect.bottom=%d"), partialRect.right, partialRect.left, partialRect.top, partialRect.bottom);
177 177
178 partialSize = EncodeOneRect( source,dest, partialRect,outConn ); 178 partialSize = EncodeOneRect( source,dest, partialRect,outConn );
179 totalSize += partialSize; 179 totalSize += partialSize;
@@ -332,7 +332,7 @@ vncEncodeUltra::AddToQueu2(BYTE *source,int sizerect,VSocket *outConn,int update @@ -332,7 +332,7 @@ vncEncodeUltra::AddToQueu2(BYTE *source,int sizerect,VSocket *outConn,int update
332 // Format the UltraHeader 332 // Format the UltraHeader
333 CacheZipHeader->nBytes = Swap32IfLE(out_len); 333 CacheZipHeader->nBytes = Swap32IfLE(out_len);
334 334
335 - vnclog.Print(LL_INTINFO, VNCLOG("********QUEUEQUEUE********** %d %d %d\r\n"),out_len,rawDataSize,1); 335 + vnclog.Print(LL_INTINFO, VNCLOG("********QUEUEQUEUE********** %d %d %d"),out_len,rawDataSize,1);
336 outConn->SendExactQueue((char *)m_QueueCompressedbuffer, out_len+sz_rfbFramebufferUpdateRectHeader+sz_rfbZlibHeader); 336 outConn->SendExactQueue((char *)m_QueueCompressedbuffer, out_len+sz_rfbFramebufferUpdateRectHeader+sz_rfbZlibHeader);
337 // Update statistics 337 // Update statistics
338 encodedSize += sz_rfbZlibHeader + out_len; 338 encodedSize += sz_rfbZlibHeader + out_len;
@@ -389,7 +389,7 @@ vncEncodeUltra::SendUltrarects(VSocket *outConn) @@ -389,7 +389,7 @@ vncEncodeUltra::SendUltrarects(VSocket *outConn)
389 rfbZlibHeader CacheZipHeader; 389 rfbZlibHeader CacheZipHeader;
390 CacheZipHeader.nBytes = Swap32IfLE(out_len); 390 CacheZipHeader.nBytes = Swap32IfLE(out_len);
391 391
392 - vnclog.Print(LL_INTINFO, VNCLOG("********QUEUEQUEUE********** %d %d %d\r\n"),out_len,rawDataSize,NRects); 392 + vnclog.Print(LL_INTINFO, VNCLOG("********QUEUEQUEUE********** %d %d %d"),out_len,rawDataSize,NRects);
393 outConn->SendExactQueue((char *)&CacheRectsHeader, sizeof(CacheRectsHeader)); 393 outConn->SendExactQueue((char *)&CacheRectsHeader, sizeof(CacheRectsHeader));
394 outConn->SendExactQueue((char *)&CacheZipHeader, sizeof(CacheZipHeader)); 394 outConn->SendExactQueue((char *)&CacheZipHeader, sizeof(CacheZipHeader));
395 outConn->SendExactQueue((char *)m_QueueCompressedbuffer, out_len); 395 outConn->SendExactQueue((char *)m_QueueCompressedbuffer, out_len);
srcacic/WinVNC/WinVNC/vncEncodeZlib.cpp
@@ -102,10 +102,10 @@ vncEncodeZlib::~vncEncodeZlib() @@ -102,10 +102,10 @@ vncEncodeZlib::~vncEncodeZlib()
102 } 102 }
103 compStreamInited = false; 103 compStreamInited = false;
104 104
105 - vnclog.Print(LL_INTINFO, VNCLOG("Zlib Xor encoder stats: rawdata=%d protocol=%d compressed=%d transmitted=%d\n"),dataSize, rectangleOverhead, encodedSize,transmittedSize); 105 + vnclog.Print(LL_INTINFO, VNCLOG("Zlib Xor encoder stats: rawdata=%d protocol=%d compressed=%d transmitted=%d"),dataSize, rectangleOverhead, encodedSize,transmittedSize);
106 106
107 if (dataSize != 0) { 107 if (dataSize != 0) {
108 - vnclog.Print(LL_INTINFO, VNCLOG("Zlib Xor encoder efficiency: %.3f%%\n"),(double)((double)((dataSize - transmittedSize) * 100) / dataSize)); 108 + vnclog.Print(LL_INTINFO, VNCLOG("Zlib Xor encoder efficiency: %.3f%%"),(double)((double)((dataSize - transmittedSize) * 100) / dataSize));
109 } 109 }
110 } 110 }
111 111
@@ -182,7 +182,7 @@ vncEncodeZlib::EncodeRect(BYTE *source,BYTE *source2, VSocket *outConn, BYTE *de @@ -182,7 +182,7 @@ vncEncodeZlib::EncodeRect(BYTE *source,BYTE *source2, VSocket *outConn, BYTE *de
182 partialRect.bottom = rect.br.y; 182 partialRect.bottom = rect.br.y;
183 183
184 /* WBB: For testing purposes only! */ 184 /* WBB: For testing purposes only! */
185 - // vnclog.Print(LL_INTINFO, VNCLOG("rect.right=%d rect.left=%d rect.top=%d rect.bottom=%d\n"), rect.right, rect.left, rect.top, rect.bottom); 185 + // vnclog.Print(LL_INTINFO, VNCLOG("rect.right=%d rect.left=%d rect.top=%d rect.bottom=%d"), rect.right, rect.left, rect.top, rect.bottom);
186 186
187 maxLines = ( ZLIB_MAX_SIZE(rectW) / rectW ); 187 maxLines = ( ZLIB_MAX_SIZE(rectW) / rectW );
188 linesRemaining = rectH; 188 linesRemaining = rectH;
@@ -199,7 +199,7 @@ vncEncodeZlib::EncodeRect(BYTE *source,BYTE *source2, VSocket *outConn, BYTE *de @@ -199,7 +199,7 @@ vncEncodeZlib::EncodeRect(BYTE *source,BYTE *source2, VSocket *outConn, BYTE *de
199 partialRect.bottom = partialRect.top + linesToComp; 199 partialRect.bottom = partialRect.top + linesToComp;
200 200
201 /* WBB: For testing purposes only! */ 201 /* WBB: For testing purposes only! */
202 - // vnclog.Print(LL_INTINFO, VNCLOG("partialRect.right=%d partialRect.left=%d partialRect.top=%d partialRect.bottom=%d\n"), partialRect.right, partialRect.left, partialRect.top, partialRect.bottom); 202 + // vnclog.Print(LL_INTINFO, VNCLOG("partialRect.right=%d partialRect.left=%d partialRect.top=%d partialRect.bottom=%d"), partialRect.right, partialRect.left, partialRect.top, partialRect.bottom);
203 203
204 partialSize = EncodeOneRect( source,source2, dest, partialRect,outConn ); 204 partialSize = EncodeOneRect( source,source2, dest, partialRect,outConn );
205 totalSize += partialSize; 205 totalSize += partialSize;
@@ -302,7 +302,7 @@ vncEncodeZlib::EncodeOneRect(BYTE *source,BYTE *source2, BYTE *dest, const RECT @@ -302,7 +302,7 @@ vncEncodeZlib::EncodeOneRect(BYTE *source,BYTE *source2, BYTE *dest, const RECT
302 { 302 {
303 surh->encoding = Swap32IfLE(rfbEncodingSolidColor); 303 surh->encoding = Swap32IfLE(rfbEncodingSolidColor);
304 memcpy(dest+sz_rfbFramebufferUpdateRectHeader,m_buffer,compStream.avail_in); 304 memcpy(dest+sz_rfbFramebufferUpdateRectHeader,m_buffer,compStream.avail_in);
305 - //vnclog.Print(LL_INTINFO, VNCLOG("Solid \n")); 305 + //vnclog.Print(LL_INTINFO, VNCLOG("Solid "));
306 if (m_queueEnable) 306 if (m_queueEnable)
307 { 307 {
308 AddToQueu(dest,sz_rfbFramebufferUpdateRectHeader +newsize,outConn,0); 308 AddToQueu(dest,sz_rfbFramebufferUpdateRectHeader +newsize,outConn,0);
@@ -314,7 +314,7 @@ vncEncodeZlib::EncodeOneRect(BYTE *source,BYTE *source2, BYTE *dest, const RECT @@ -314,7 +314,7 @@ vncEncodeZlib::EncodeOneRect(BYTE *source,BYTE *source2, BYTE *dest, const RECT
314 { 314 {
315 compStream.avail_in = newsize; 315 compStream.avail_in = newsize;
316 surh->encoding = Swap32IfLE(rfbEncodingXORMonoColor_Zlib); 316 surh->encoding = Swap32IfLE(rfbEncodingXORMonoColor_Zlib);
317 - //vnclog.Print(LL_INTINFO, VNCLOG("Mono \n")); 317 + //vnclog.Print(LL_INTINFO, VNCLOG("Mono "));
318 if (m_queueEnable) 318 if (m_queueEnable)
319 { 319 {
320 memcpy(dest+sz_rfbFramebufferUpdateRectHeader,m_buffer,newsize); 320 memcpy(dest+sz_rfbFramebufferUpdateRectHeader,m_buffer,newsize);
@@ -328,7 +328,7 @@ vncEncodeZlib::EncodeOneRect(BYTE *source,BYTE *source2, BYTE *dest, const RECT @@ -328,7 +328,7 @@ vncEncodeZlib::EncodeOneRect(BYTE *source,BYTE *source2, BYTE *dest, const RECT
328 { 328 {
329 compStream.avail_in = newsize; 329 compStream.avail_in = newsize;
330 surh->encoding = Swap32IfLE(rfbEncodingXORMultiColor_Zlib); 330 surh->encoding = Swap32IfLE(rfbEncodingXORMultiColor_Zlib);
331 - ///vnclog.Print(LL_INTINFO, VNCLOG("MultiColor \n")); 331 + ///vnclog.Print(LL_INTINFO, VNCLOG("MultiColor "));
332 break; 332 break;
333 } 333 }
334 334
@@ -342,7 +342,7 @@ vncEncodeZlib::EncodeOneRect(BYTE *source,BYTE *source2, BYTE *dest, const RECT @@ -342,7 +342,7 @@ vncEncodeZlib::EncodeOneRect(BYTE *source,BYTE *source2, BYTE *dest, const RECT
342 AddToQueu(dest,sz_rfbFramebufferUpdateRectHeader +newsize,outConn,1); 342 AddToQueu(dest,sz_rfbFramebufferUpdateRectHeader +newsize,outConn,1);
343 return 0; 343 return 0;
344 } 344 }
345 - ///vnclog.Print(LL_INTINFO, VNCLOG("XOR \n")); 345 + ///vnclog.Print(LL_INTINFO, VNCLOG("XOR "));
346 break; 346 break;
347 } 347 }
348 348
@@ -357,7 +357,7 @@ vncEncodeZlib::EncodeOneRect(BYTE *source,BYTE *source2, BYTE *dest, const RECT @@ -357,7 +357,7 @@ vncEncodeZlib::EncodeOneRect(BYTE *source,BYTE *source2, BYTE *dest, const RECT
357 } 357 }
358 358
359 surh->encoding = Swap32IfLE(rfbEncodingZlib); 359 surh->encoding = Swap32IfLE(rfbEncodingZlib);
360 - ///vnclog.Print(LL_INTINFO, VNCLOG("Pure \n")); 360 + ///vnclog.Print(LL_INTINFO, VNCLOG("Pure "));
361 break; 361 break;
362 } 362 }
363 } 363 }
@@ -377,7 +377,7 @@ vncEncodeZlib::EncodeOneRect(BYTE *source,BYTE *source2, BYTE *dest, const RECT @@ -377,7 +377,7 @@ vncEncodeZlib::EncodeOneRect(BYTE *source,BYTE *source2, BYTE *dest, const RECT
377 compStream.zfree = Z_NULL; 377 compStream.zfree = Z_NULL;
378 compStream.opaque = Z_NULL; 378 compStream.opaque = Z_NULL;
379 379
380 - //vnclog.Print(LL_INTINFO, VNCLOG("calling deflateInit2 with zlib level:%d\n"), m_compresslevel); 380 + //vnclog.Print(LL_INTINFO, VNCLOG("calling deflateInit2 with zlib level:%d"), m_compresslevel);
381 381
382 deflateResult = deflateInit2( &compStream, 382 deflateResult = deflateInit2( &compStream,
383 m_compresslevel, 383 m_compresslevel,
@@ -387,7 +387,7 @@ vncEncodeZlib::EncodeOneRect(BYTE *source,BYTE *source2, BYTE *dest, const RECT @@ -387,7 +387,7 @@ vncEncodeZlib::EncodeOneRect(BYTE *source,BYTE *source2, BYTE *dest, const RECT
387 Z_DEFAULT_STRATEGY ); 387 Z_DEFAULT_STRATEGY );
388 if ( deflateResult != Z_OK ) 388 if ( deflateResult != Z_OK )
389 { 389 {
390 - vnclog.Print(LL_INTINFO, VNCLOG("deflateInit2 returned error:%d:%s\n"), deflateResult, compStream.msg); 390 + vnclog.Print(LL_INTINFO, VNCLOG("deflateInit2 returned error:%d:%s"), deflateResult, compStream.msg);
391 return vncEncoder::EncodeRect(source, dest, rect); 391 return vncEncoder::EncodeRect(source, dest, rect);
392 } 392 }
393 compStreamInited = true; 393 compStreamInited = true;
@@ -401,7 +401,7 @@ vncEncodeZlib::EncodeOneRect(BYTE *source,BYTE *source2, BYTE *dest, const RECT @@ -401,7 +401,7 @@ vncEncodeZlib::EncodeOneRect(BYTE *source,BYTE *source2, BYTE *dest, const RECT
401 401
402 if ( deflateResult != Z_OK ) 402 if ( deflateResult != Z_OK )
403 { 403 {
404 - vnclog.Print(LL_INTINFO, VNCLOG("deflate returned error:%d:%s\n"), deflateResult, compStream.msg); 404 + vnclog.Print(LL_INTINFO, VNCLOG("deflate returned error:%d:%s"), deflateResult, compStream.msg);
405 return vncEncoder::EncodeRect(source, dest, rect); 405 return vncEncoder::EncodeRect(source, dest, rect);
406 } 406 }
407 407
@@ -665,7 +665,7 @@ vncEncodeZlib::SendZlibrects(VSocket *outConn) @@ -665,7 +665,7 @@ vncEncodeZlib::SendZlibrects(VSocket *outConn)
665 rfbZlibHeader CacheZipHeader; 665 rfbZlibHeader CacheZipHeader;
666 CacheZipHeader.nBytes = Swap32IfLE(maxCompSize); 666 CacheZipHeader.nBytes = Swap32IfLE(maxCompSize);
667 667
668 - vnclog.Print(LL_INTINFO, VNCLOG("********QUEUEQUEUE********** %d %d %d\r\n"),maxCompSize,rawDataSize,NRects); 668 + vnclog.Print(LL_INTINFO, VNCLOG("********QUEUEQUEUE********** %d %d %d"),maxCompSize,rawDataSize,NRects);
669 outConn->SendExactQueue((char *)&CacheRectsHeader, sizeof(CacheRectsHeader)); 669 outConn->SendExactQueue((char *)&CacheRectsHeader, sizeof(CacheRectsHeader));
670 outConn->SendExactQueue((char *)&CacheZipHeader, sizeof(CacheZipHeader)); 670 outConn->SendExactQueue((char *)&CacheZipHeader, sizeof(CacheZipHeader));
671 outConn->SendExactQueue((char *)m_QueueCompressedbuffer, maxCompSize); 671 outConn->SendExactQueue((char *)m_QueueCompressedbuffer, maxCompSize);
srcacic/WinVNC/WinVNC/vncEncodeZlibHex.cpp
@@ -201,10 +201,10 @@ vncEncodeZlibHex::zlibCompress(BYTE *from_buf, BYTE *to_buf, UINT length, struct @@ -201,10 +201,10 @@ vncEncodeZlibHex::zlibCompress(BYTE *from_buf, BYTE *to_buf, UINT length, struct
201 if (lzo_init() == LZO_E_OK) lzo=true; 201 if (lzo_init() == LZO_E_OK) lzo=true;
202 } 202 }
203 if (lzo1x_1_compress(from_buf,length,to_buf,&out_len,wrkmem)!=LZO_E_OK) 203 if (lzo1x_1_compress(from_buf,length,to_buf,&out_len,wrkmem)!=LZO_E_OK)
204 - vnclog.Print(LL_INTINFO, VNCLOG("Error compressing \n")); 204 + vnclog.Print(LL_INTINFO, VNCLOG("Error compressing "));
205 return out_len;*/ 205 return out_len;*/
206 206
207 - //vnclog.Print(LL_INTINFO, VNCLOG("ZlibHex length %d %d \n"), length,out_len); 207 + //vnclog.Print(LL_INTINFO, VNCLOG("ZlibHex length %d %d "), length,out_len);
208 208
209 209
210 // If necessary, the first time, initialize the compressor state. 210 // If necessary, the first time, initialize the compressor state.
@@ -217,7 +217,7 @@ vncEncodeZlibHex::zlibCompress(BYTE *from_buf, BYTE *to_buf, UINT length, struct @@ -217,7 +217,7 @@ vncEncodeZlibHex::zlibCompress(BYTE *from_buf, BYTE *to_buf, UINT length, struct
217 compressor->zfree = Z_NULL; 217 compressor->zfree = Z_NULL;
218 compressor->opaque = Z_NULL; 218 compressor->opaque = Z_NULL;
219 219
220 - vnclog.Print(LL_INTINFO, VNCLOG("calling deflateInit2 with zlib level:%d\n"), m_compresslevel); 220 + vnclog.Print(LL_INTINFO, VNCLOG("calling deflateInit2 with zlib level:%d"), m_compresslevel);
221 221
222 deflateResult = deflateInit2( compressor, 222 deflateResult = deflateInit2( compressor,
223 m_compresslevel, 223 m_compresslevel,
@@ -227,7 +227,7 @@ vncEncodeZlibHex::zlibCompress(BYTE *from_buf, BYTE *to_buf, UINT length, struct @@ -227,7 +227,7 @@ vncEncodeZlibHex::zlibCompress(BYTE *from_buf, BYTE *to_buf, UINT length, struct
227 Z_DEFAULT_STRATEGY ); 227 Z_DEFAULT_STRATEGY );
228 if ( deflateResult != Z_OK ) 228 if ( deflateResult != Z_OK )
229 { 229 {
230 - vnclog.Print(LL_INTINFO, VNCLOG("deflateInit2 returned error:%d:%s\n"), deflateResult, compressor->msg); 230 + vnclog.Print(LL_INTINFO, VNCLOG("deflateInit2 returned error:%d:%s"), deflateResult, compressor->msg);
231 return -1; 231 return -1;
232 } 232 }
233 233
@@ -241,13 +241,13 @@ vncEncodeZlibHex::zlibCompress(BYTE *from_buf, BYTE *to_buf, UINT length, struct @@ -241,13 +241,13 @@ vncEncodeZlibHex::zlibCompress(BYTE *from_buf, BYTE *to_buf, UINT length, struct
241 241
242 if ( deflateResult != Z_OK ) 242 if ( deflateResult != Z_OK )
243 { 243 {
244 - vnclog.Print(LL_INTINFO, VNCLOG("deflate returned error:%d:%s\n"), deflateResult, compressor->msg); 244 + vnclog.Print(LL_INTINFO, VNCLOG("deflate returned error:%d:%s"), deflateResult, compressor->msg);
245 return -1; 245 return -1;
246 } 246 }
247 -// vnclog.Print(LL_INTINFO, VNCLOG("ZlibHex length %d %d %d \n"), length,compressor->total_out - previousTotalOut,out_len);  
248 -// if (length/2>out_len) vnclog.Print(LL_INTINFO, VNCLOG("ZlibHex length %d #####50######### \n"), length);  
249 -// if (length/3*2>out_len) vnclog.Print(LL_INTINFO, VNCLOG("ZlibHex length %d #####33######### \n"), length);  
250 -// if (length/4*3>out_len) vnclog.Print(LL_INTINFO, VNCLOG("ZlibHex length %d #####25######### \n"), length); 247 +// vnclog.Print(LL_INTINFO, VNCLOG("ZlibHex length %d %d %d "), length,compressor->total_out - previousTotalOut,out_len);
  248 +// if (length/2>out_len) vnclog.Print(LL_INTINFO, VNCLOG("ZlibHex length %d #####50######### "), length);
  249 +// if (length/3*2>out_len) vnclog.Print(LL_INTINFO, VNCLOG("ZlibHex length %d #####33######### "), length);
  250 +// if (length/4*3>out_len) vnclog.Print(LL_INTINFO, VNCLOG("ZlibHex length %d #####25######### "), length);
251 251
252 return compressor->total_out - previousTotalOut; 252 return compressor->total_out - previousTotalOut;
253 } 253 }
@@ -622,7 +622,7 @@ vncEncodeZlibHex::AddToQueu(BYTE *source,int sizerect,VSocket *outConn) @@ -622,7 +622,7 @@ vncEncodeZlibHex::AddToQueu(BYTE *source,int sizerect,VSocket *outConn)
622 outConn->SendExactQueue( (char *)source,sizerect); 622 outConn->SendExactQueue( (char *)source,sizerect);
623 return; 623 return;
624 } 624 }
625 -// vnclog.Print(LL_INTINFO, VNCLOG("Add %i %i \n"),sizerect,m_Queuelen); 625 +// vnclog.Print(LL_INTINFO, VNCLOG("Add %i %i "),sizerect,m_Queuelen);
626 memcpy(m_Queuebuffer+m_Queuelen,source,sizerect); 626 memcpy(m_Queuebuffer+m_Queuelen,source,sizerect);
627 m_Queuelen+=sizerect; 627 m_Queuelen+=sizerect;
628 } 628 }
srcacic/WinVNC/WinVNC/vncbuffer.cpp
@@ -182,7 +182,7 @@ vncBuffer::CheckBuffer() @@ -182,7 +182,7 @@ vncBuffer::CheckBuffer()
182 // Check that the local format buffers are sufficient 182 // Check that the local format buffers are sufficient
183 if ((m_backbuffsize != m_desktop->ScreenBuffSize()) || !m_freemainbuff) 183 if ((m_backbuffsize != m_desktop->ScreenBuffSize()) || !m_freemainbuff)
184 { 184 {
185 - vnclog.Print(LL_INTINFO, VNCLOG("request local buffer[%d]\n"), m_desktop->ScreenBuffSize()); 185 + vnclog.Print(LL_INTINFO, VNCLOG("request local buffer[%d]"), m_desktop->ScreenBuffSize());
186 if (m_freemainbuff) { 186 if (m_freemainbuff) {
187 // Slow blits were enabled - free the slow blit buffer 187 // Slow blits were enabled - free the slow blit buffer
188 // Modif rdv@2002 - v1.1.x - Videodriver 188 // Modif rdv@2002 - v1.1.x - Videodriver
@@ -223,13 +223,13 @@ vncBuffer::CheckBuffer() @@ -223,13 +223,13 @@ vncBuffer::CheckBuffer()
223 if (m_mainbuff) { 223 if (m_mainbuff) {
224 // Prevent us from freeing the DIBsection buffer 224 // Prevent us from freeing the DIBsection buffer
225 m_freemainbuff = FALSE; 225 m_freemainbuff = FALSE;
226 - vnclog.Print(LL_INTINFO, VNCLOG("fast blits detected - using DIBsection buffer\n")); 226 + vnclog.Print(LL_INTINFO, VNCLOG("fast blits detected - using DIBsection buffer"));
227 } else { 227 } else {
228 // Create our own buffer to copy blits through 228 // Create our own buffer to copy blits through
229 m_freemainbuff = TRUE; 229 m_freemainbuff = TRUE;
230 if ((m_mainbuff = new BYTE [m_desktop->ScreenBuffSize()]) == NULL) 230 if ((m_mainbuff = new BYTE [m_desktop->ScreenBuffSize()]) == NULL)
231 { 231 {
232 - vnclog.Print(LL_INTERR, VNCLOG("unable to allocate main buffer[%d]\n"), m_desktop->ScreenBuffSize()); 232 + vnclog.Print(LL_INTERR, VNCLOG("unable to allocate main buffer[%d]"), m_desktop->ScreenBuffSize());
233 return FALSE; 233 return FALSE;
234 } 234 }
235 memset(m_mainbuff, 0, m_desktop->ScreenBuffSize()); 235 memset(m_mainbuff, 0, m_desktop->ScreenBuffSize());
@@ -238,7 +238,7 @@ vncBuffer::CheckBuffer() @@ -238,7 +238,7 @@ vncBuffer::CheckBuffer()
238 // Always create a back buffer 238 // Always create a back buffer
239 if ((m_backbuff = new BYTE [m_desktop->ScreenBuffSize()]) == NULL) 239 if ((m_backbuff = new BYTE [m_desktop->ScreenBuffSize()]) == NULL)
240 { 240 {
241 - vnclog.Print(LL_INTERR, VNCLOG("unable to allocate back buffer[%d]\n"), m_desktop->ScreenBuffSize()); 241 + vnclog.Print(LL_INTERR, VNCLOG("unable to allocate back buffer[%d]"), m_desktop->ScreenBuffSize());
242 return FALSE; 242 return FALSE;
243 } 243 }
244 244
@@ -246,7 +246,7 @@ vncBuffer::CheckBuffer() @@ -246,7 +246,7 @@ vncBuffer::CheckBuffer()
246 { 246 {
247 if ((m_cachebuff = new BYTE [m_desktop->ScreenBuffSize()]) == NULL) 247 if ((m_cachebuff = new BYTE [m_desktop->ScreenBuffSize()]) == NULL)
248 { 248 {
249 - vnclog.Print(LL_INTERR, VNCLOG("unable to allocate cache buffer[%d]\n"), m_desktop->ScreenBuffSize()); 249 + vnclog.Print(LL_INTERR, VNCLOG("unable to allocate cache buffer[%d]"), m_desktop->ScreenBuffSize());
250 return FALSE; 250 return FALSE;
251 } 251 }
252 ClearCache(); 252 ClearCache();
@@ -261,7 +261,7 @@ vncBuffer::CheckBuffer() @@ -261,7 +261,7 @@ vncBuffer::CheckBuffer()
261 // Modif sf@2002 - Scaling 261 // Modif sf@2002 - Scaling
262 if ((m_ScaledBuff = new BYTE [m_desktop->ScreenBuffSize()]) == NULL) 262 if ((m_ScaledBuff = new BYTE [m_desktop->ScreenBuffSize()]) == NULL)
263 { 263 {
264 - vnclog.Print(LL_INTERR, VNCLOG("unable to allocate scaled buffer[%d]\n"), m_desktop->ScreenBuffSize()); 264 + vnclog.Print(LL_INTERR, VNCLOG("unable to allocate scaled buffer[%d]"), m_desktop->ScreenBuffSize());
265 return FALSE; 265 return FALSE;
266 } 266 }
267 m_ScaledSize = m_desktop->ScreenBuffSize(); 267 m_ScaledSize = m_desktop->ScreenBuffSize();
@@ -277,7 +277,7 @@ vncBuffer::CheckBuffer() @@ -277,7 +277,7 @@ vncBuffer::CheckBuffer()
277 277
278 } 278 }
279 279
280 - vnclog.Print(LL_INTINFO, VNCLOG("local buffer=%d\n"), m_backbuffsize); 280 + vnclog.Print(LL_INTINFO, VNCLOG("local buffer=%d"), m_backbuffsize);
281 281
282 return TRUE; 282 return TRUE;
283 } 283 }
@@ -1053,7 +1053,7 @@ vncBuffer::EnableCache(BOOL enable) @@ -1053,7 +1053,7 @@ vncBuffer::EnableCache(BOOL enable)
1053 } 1053 }
1054 if ((m_cachebuff = new BYTE [m_desktop->ScreenBuffSize()]) == NULL) 1054 if ((m_cachebuff = new BYTE [m_desktop->ScreenBuffSize()]) == NULL)
1055 { 1055 {
1056 - vnclog.Print(LL_INTERR, VNCLOG("unable to allocate cache buffer[%d]\n"), m_desktop->ScreenBuffSize()); 1056 + vnclog.Print(LL_INTERR, VNCLOG("unable to allocate cache buffer[%d]"), m_desktop->ScreenBuffSize());
1057 return; 1057 return;
1058 } 1058 }
1059 ClearCache(); 1059 ClearCache();
srcacic/WinVNC/WinVNC/vncclient.cpp
@@ -163,7 +163,7 @@ public: @@ -163,7 +163,7 @@ public:
163 163
164 if(WAIT_OBJECT_0 != WaitForSingleObject(*phMutex, INFINITE)) 164 if(WAIT_OBJECT_0 != WaitForSingleObject(*phMutex, INFINITE))
165 { 165 {
166 - vnclog.Print(LL_INTERR, VNCLOG("Could not get access to the mutex\n")); 166 + vnclog.Print(LL_INTERR, VNCLOG("Could not get access to the mutex"));
167 } 167 }
168 } 168 }
169 ~MutexAutoLock() 169 ~MutexAutoLock()
@@ -178,7 +178,7 @@ public: @@ -178,7 +178,7 @@ public:
178 BOOL 178 BOOL
179 vncClientUpdateThread::Init(vncClient *client) 179 vncClientUpdateThread::Init(vncClient *client)
180 { 180 {
181 - vnclog.Print(LL_INTINFO, VNCLOG("init update thread\n")); 181 + vnclog.Print(LL_INTINFO, VNCLOG("init update thread"));
182 182
183 m_client = client; 183 m_client = client;
184 omni_mutex_lock l(m_client->GetUpdateLock()); 184 omni_mutex_lock l(m_client->GetUpdateLock());
@@ -197,7 +197,7 @@ vncClientUpdateThread::~vncClientUpdateThread() @@ -197,7 +197,7 @@ vncClientUpdateThread::~vncClientUpdateThread()
197 { 197 {
198 if (m_signal) delete m_signal; 198 if (m_signal) delete m_signal;
199 if (m_sync_sig) delete m_sync_sig; 199 if (m_sync_sig) delete m_sync_sig;
200 - vnclog.Print(LL_INTINFO, VNCLOG("update thread gone\n")); 200 + vnclog.Print(LL_INTINFO, VNCLOG("update thread gone"));
201 m_client->m_updatethread=NULL; 201 m_client->m_updatethread=NULL;
202 } 202 }
203 203
@@ -214,7 +214,7 @@ vncClientUpdateThread::Trigger() @@ -214,7 +214,7 @@ vncClientUpdateThread::Trigger()
214 void 214 void
215 vncClientUpdateThread::Kill() 215 vncClientUpdateThread::Kill()
216 { 216 {
217 - vnclog.Print(LL_INTINFO, VNCLOG("kill update thread\n")); 217 + vnclog.Print(LL_INTINFO, VNCLOG("kill update thread"));
218 218
219 omni_mutex_lock l(m_client->GetUpdateLock()); 219 omni_mutex_lock l(m_client->GetUpdateLock());
220 m_active=FALSE; 220 m_active=FALSE;
@@ -250,9 +250,9 @@ vncClientUpdateThread::EnableUpdates(BOOL enable) @@ -250,9 +250,9 @@ vncClientUpdateThread::EnableUpdates(BOOL enable)
250 { 250 {
251 // ALWAYS call this with the UpdateLock held! 251 // ALWAYS call this with the UpdateLock held!
252 if (enable) { 252 if (enable) {
253 - vnclog.Print(LL_INTINFO, VNCLOG("enable update thread\n")); 253 + vnclog.Print(LL_INTINFO, VNCLOG("enable update thread"));
254 } else { 254 } else {
255 - vnclog.Print(LL_INTINFO, VNCLOG("disable update thread\n")); 255 + vnclog.Print(LL_INTINFO, VNCLOG("disable update thread"));
256 } 256 }
257 257
258 m_enable = enable; 258 m_enable = enable;
@@ -263,9 +263,9 @@ vncClientUpdateThread::EnableUpdates(BOOL enable) @@ -263,9 +263,9 @@ vncClientUpdateThread::EnableUpdates(BOOL enable)
263 /*if (m_sync_sig->timedwait(now_sec+1,0)==0) 263 /*if (m_sync_sig->timedwait(now_sec+1,0)==0)
264 { 264 {
265 // m_signal->signal(); 265 // m_signal->signal();
266 - vnclog.Print(LL_INTINFO, VNCLOG("thread timeout\n")); 266 + vnclog.Print(LL_INTINFO, VNCLOG("thread timeout"));
267 } */ 267 } */
268 - vnclog.Print(LL_INTINFO, VNCLOG("enable/disable synced\n")); 268 + vnclog.Print(LL_INTINFO, VNCLOG("enable/disable synced"));
269 } 269 }
270 270
271 void* 271 void*
@@ -279,7 +279,7 @@ vncClientUpdateThread::run_undetached(void *arg) @@ -279,7 +279,7 @@ vncClientUpdateThread::run_undetached(void *arg)
279 279
280 updates_sent=0; 280 updates_sent=0;
281 281
282 - vnclog.Print(LL_INTINFO, VNCLOG("starting update thread\n")); 282 + vnclog.Print(LL_INTINFO, VNCLOG("starting update thread"));
283 283
284 // Set client update threads to high priority 284 // Set client update threads to high priority
285 // *** set_priority(omni_thread::PRIORITY_HIGH); 285 // *** set_priority(omni_thread::PRIORITY_HIGH);
@@ -476,9 +476,9 @@ vncClientUpdateThread::run_undetached(void *arg) @@ -476,9 +476,9 @@ vncClientUpdateThread::run_undetached(void *arg)
476 yield(); 476 yield();
477 } 477 }
478 478
479 - vnclog.Print(LL_INTINFO, VNCLOG("stopping update thread\n")); 479 + vnclog.Print(LL_INTINFO, VNCLOG("stopping update thread"));
480 480
481 - vnclog.Print(LL_INTERR, "client sent %lu updates\n", updates_sent); 481 + vnclog.Print(LL_INTERR, "client sent %lu updates", updates_sent);
482 return 0; 482 return 0;
483 } 483 }
484 484
@@ -611,7 +611,7 @@ vncClientThread::InitAuthenticate() @@ -611,7 +611,7 @@ vncClientThread::InitAuthenticate()
611 611
612 // Alterando o timeout para que o cliente tenha tempo de enviar as informações do técnico. 612 // Alterando o timeout para que o cliente tenha tempo de enviar as informações do técnico.
613 if (!m_socket->SetTimeout(60000)) 613 if (!m_socket->SetTimeout(60000))
614 - vnclog.Print(LL_INTERR, VNCLOG("failed to set socket timeout(%d)\n"), GetLastError()); 614 + vnclog.Print(LL_INTERR, VNCLOG("failed to set socket timeout(%d)"), GetLastError());
615 615
616 // Lê o username 616 // Lê o username
617 if (!m_socket->ReadExact(nm_usuario_cli, sizeof(nm_usuario_cli))) 617 if (!m_socket->ReadExact(nm_usuario_cli, sizeof(nm_usuario_cli)))
@@ -636,10 +636,13 @@ vncClientThread::InitAuthenticate() @@ -636,10 +636,13 @@ vncClientThread::InitAuthenticate()
636 636
637 // Voltando o timeout ao normal. 637 // Voltando o timeout ao normal.
638 if (!m_socket->SetTimeout(30000)) 638 if (!m_socket->SetTimeout(30000))
639 - vnclog.Print(LL_INTERR, VNCLOG("failed to set socket timeout(%d)\n"), GetLastError()); 639 + vnclog.Print(LL_INTERR, VNCLOG("failed to set socket timeout(%d)"), GetLastError());
640 640
641 BOOL auth_ok = TRUE; 641 BOOL auth_ok = TRUE;
642 642
  643 +
  644 + char *name = m_socket->GetPeerName();
  645 +
643 // verifica o técnico que está querendo logar e o adiciona na lista. 646 // verifica o técnico que está querendo logar e o adiciona na lista.
644 if (!CACIC_Auth::getInstance()->validaTecnico(nm_usuario_cli, te_senha_cli, 647 if (!CACIC_Auth::getInstance()->validaTecnico(nm_usuario_cli, te_senha_cli,
645 te_node_address_cli, te_documento_referencial, 648 te_node_address_cli, te_documento_referencial,
@@ -658,6 +661,10 @@ vncClientThread::InitAuthenticate() @@ -658,6 +661,10 @@ vncClientThread::InitAuthenticate()
658 if (m_auth) { 661 if (m_auth) {
659 verified = vncServer::aqrAccept; 662 verified = vncServer::aqrAccept;
660 } else { 663 } else {
  664 + char *name;
  665 +
  666 + name = m_socket->GetPeerName();
  667 +
661 verified = m_server->VerifyHost(m_socket->GetPeerName()); 668 verified = m_server->VerifyHost(m_socket->GetPeerName());
662 } 669 }
663 670
@@ -734,7 +741,7 @@ vncClientThread::InitAuthenticate() @@ -734,7 +741,7 @@ vncClientThread::InitAuthenticate()
734 741
735 if (!ok) 742 if (!ok)
736 { 743 {
737 - vnclog.Print(LL_CONNERR, VNCLOG("loopback connection attempted - client rejected\n")); 744 + vnclog.Print(LL_CONNERR, VNCLOG("loopback connection attempted - client rejected"));
738 745
739 // Send an error message to the client 746 // Send an error message to the client
740 CARD32 auth_val = Swap32IfLE(rfbConnFailed); 747 CARD32 auth_val = Swap32IfLE(rfbConnFailed);
@@ -769,7 +776,7 @@ vncClientThread::InitAuthenticate() @@ -769,7 +776,7 @@ vncClientThread::InitAuthenticate()
769 776
770 if (!ok) 777 if (!ok)
771 { 778 {
772 - vnclog.Print(LL_CONNERR, VNCLOG("loopback connection attempted - client accepted\n")); 779 + vnclog.Print(LL_CONNERR, VNCLOG("loopback connection attempted - client accepted"));
773 m_client->m_IsLoopback=true; 780 m_client->m_IsLoopback=true;
774 } 781 }
775 } 782 }
@@ -787,7 +794,7 @@ vncClientThread::InitAuthenticate() @@ -787,7 +794,7 @@ vncClientThread::InitAuthenticate()
787 CARD32 authmsg; 794 CARD32 authmsg;
788 if (!auth_ok) 795 if (!auth_ok)
789 { 796 {
790 - vnclog.Print(LL_CONNERR, VNCLOG("authentication failed\n")); 797 + vnclog.Print(LL_CONNERR, VNCLOG("authentication failed"));
791 ////////////////// 798 //////////////////
792 // LOG it also in the event 799 // LOG it also in the event
793 ////////////////// 800 //////////////////
@@ -856,7 +863,7 @@ vncClientThread::InitAuthenticate() @@ -856,7 +863,7 @@ vncClientThread::InitAuthenticate()
856 // Existing 863 // Existing
857 if (m_server->AuthClientCount() > 0) 864 if (m_server->AuthClientCount() > 0)
858 { 865 {
859 - vnclog.Print(LL_CLIENTS, VNCLOG("connections already exist - client rejected\n")); 866 + vnclog.Print(LL_CLIENTS, VNCLOG("connections already exist - client rejected"));
860 return FALSE; 867 return FALSE;
861 } 868 }
862 } 869 }
@@ -866,14 +873,14 @@ vncClientThread::InitAuthenticate() @@ -866,14 +873,14 @@ vncClientThread::InitAuthenticate()
866 if (m_server->ConnectPriority() < 1) 873 if (m_server->ConnectPriority() < 1)
867 { 874 {
868 // Incoming 875 // Incoming
869 - vnclog.Print(LL_INTINFO, VNCLOG("non-shared connection - disconnecting old clients\n")); 876 + vnclog.Print(LL_INTINFO, VNCLOG("non-shared connection - disconnecting old clients"));
870 m_server->KillAuthClients(); 877 m_server->KillAuthClients();
871 } else if (m_server->ConnectPriority() > 1) 878 } else if (m_server->ConnectPriority() > 1)
872 { 879 {
873 // Existing 880 // Existing
874 if (m_server->AuthClientCount() > 0) 881 if (m_server->AuthClientCount() > 0)
875 { 882 {
876 - vnclog.Print(LL_CLIENTS, VNCLOG("connections already exist - client rejected\n")); 883 + vnclog.Print(LL_CLIENTS, VNCLOG("connections already exist - client rejected"));
877 return FALSE; 884 return FALSE;
878 } 885 }
879 } 886 }
@@ -912,12 +919,12 @@ vncClientThread::AuthMsLogon() { @@ -912,12 +919,12 @@ vncClientThread::AuthMsLogon() {
912 if (!m_socket->ReadExact(passwd, sizeof(passwd))) return FALSE; 919 if (!m_socket->ReadExact(passwd, sizeof(passwd))) return FALSE;
913 920
914 int64ToBytes(dh.createEncryptionKey(bytesToInt64(resp)), (char*) key); 921 int64ToBytes(dh.createEncryptionKey(bytesToInt64(resp)), (char*) key);
915 - vnclog.Print(0, "After DH: g=%I64u, m=%I64u, i=%I64u, key=%I64u\n", bytesToInt64(gen), bytesToInt64(mod), bytesToInt64(pub), bytesToInt64((char*) key)); 922 + vnclog.Print(0, "After DH: g=%I64u, m=%I64u, i=%I64u, key=%I64u", bytesToInt64(gen), bytesToInt64(mod), bytesToInt64(pub), bytesToInt64((char*) key));
916 vncDecryptBytes((unsigned char*) user, sizeof(user), key); user[255] = '\0'; 923 vncDecryptBytes((unsigned char*) user, sizeof(user), key); user[255] = '\0';
917 vncDecryptBytes((unsigned char*) passwd, sizeof(passwd), key); passwd[63] = '\0'; 924 vncDecryptBytes((unsigned char*) passwd, sizeof(passwd), key); passwd[63] = '\0';
918 925
919 int result = CheckUserGroupPasswordUni(user, passwd, m_client->GetClientName()); 926 int result = CheckUserGroupPasswordUni(user, passwd, m_client->GetClientName());
920 - vnclog.Print(LL_INTINFO, "CheckUserGroupPasswordUni result=%i\n", result); 927 + vnclog.Print(LL_INTINFO, "CheckUserGroupPasswordUni result=%i", result);
921 if (result == 2) { 928 if (result == 2) {
922 m_client->EnableKeyboard(false); 929 m_client->EnableKeyboard(false);
923 m_client->EnablePointer(false); 930 m_client->EnablePointer(false);
@@ -928,7 +935,7 @@ vncClientThread::AuthMsLogon() { @@ -928,7 +935,7 @@ vncClientThread::AuthMsLogon() {
928 return FALSE; 935 return FALSE;
929 936
930 if (!result) { 937 if (!result) {
931 - vnclog.Print(LL_CONNERR, VNCLOG("authentication failed\n")); 938 + vnclog.Print(LL_CONNERR, VNCLOG("authentication failed"));
932 return FALSE; 939 return FALSE;
933 } 940 }
934 return TRUE; 941 return TRUE;
@@ -1002,7 +1009,7 @@ vncClientThread::run(void *arg) @@ -1002,7 +1009,7 @@ vncClientThread::run(void *arg)
1002 // IMPORTANT : ALWAYS call RemoveClient on the server before quitting 1009 // IMPORTANT : ALWAYS call RemoveClient on the server before quitting
1003 // this thread. 1010 // this thread.
1004 1011
1005 - vnclog.Print(LL_CLIENTS, VNCLOG("client connected : %s (%hd)\n"), 1012 + vnclog.Print(LL_CLIENTS, VNCLOG("client connected : %s (%hd)"),
1006 m_client->GetClientName(), 1013 m_client->GetClientName(),
1007 m_client->GetClientId()); 1014 m_client->GetClientId());
1008 // Save the handle to the thread's original desktop 1015 // Save the handle to the thread's original desktop
@@ -1010,17 +1017,17 @@ vncClientThread::run(void *arg) @@ -1010,17 +1017,17 @@ vncClientThread::run(void *arg)
1010 1017
1011 // To avoid people connecting and then halting the connection, set a timeout 1018 // To avoid people connecting and then halting the connection, set a timeout
1012 if (!m_socket->SetTimeout(30000)) 1019 if (!m_socket->SetTimeout(30000))
1013 - vnclog.Print(LL_INTERR, VNCLOG("failed to set socket timeout(%d)\n"), GetLastError()); 1020 + vnclog.Print(LL_INTERR, VNCLOG("failed to set socket timeout(%d)"), GetLastError());
1014 1021
1015 // sf@2002 - DSM Plugin - Tell the client's socket where to find the DSMPlugin 1022 // sf@2002 - DSM Plugin - Tell the client's socket where to find the DSMPlugin
1016 if (m_server->GetDSMPluginPointer() != NULL) 1023 if (m_server->GetDSMPluginPointer() != NULL)
1017 { 1024 {
1018 m_socket->SetDSMPluginPointer(m_server->GetDSMPluginPointer()); 1025 m_socket->SetDSMPluginPointer(m_server->GetDSMPluginPointer());
1019 - vnclog.Print(LL_INTINFO, VNCLOG("DSMPlugin Pointer to socket OK\n")); 1026 + vnclog.Print(LL_INTINFO, VNCLOG("DSMPlugin Pointer to socket OK"));
1020 } 1027 }
1021 else 1028 else
1022 { 1029 {
1023 - vnclog.Print(LL_INTINFO, VNCLOG("Invalid DSMPlugin Pointer\n")); 1030 + vnclog.Print(LL_INTINFO, VNCLOG("Invalid DSMPlugin Pointer"));
1024 return; 1031 return;
1025 } 1032 }
1026 1033
@@ -1042,7 +1049,7 @@ vncClientThread::run(void *arg) @@ -1042,7 +1049,7 @@ vncClientThread::run(void *arg)
1042 // This is a dirty workaround. We ignore all Multi Viewer connection settings... 1049 // This is a dirty workaround. We ignore all Multi Viewer connection settings...
1043 if (m_server->AuthClientCount() > 0) 1050 if (m_server->AuthClientCount() > 0)
1044 { 1051 {
1045 - vnclog.Print(LL_CLIENTS, VNCLOG("A connection using DSM already exist - client rejected to avoid crash \n")); 1052 + vnclog.Print(LL_CLIENTS, VNCLOG("A connection using DSM already exist - client rejected to avoid crash "));
1046 return; 1053 return;
1047 } 1054 }
1048 1055
@@ -1066,7 +1073,7 @@ vncClientThread::run(void *arg) @@ -1066,7 +1073,7 @@ vncClientThread::run(void *arg)
1066 1073
1067 return; 1074 return;
1068 } 1075 }
1069 - vnclog.Print(LL_INTINFO, VNCLOG("negotiated version\n")); 1076 + vnclog.Print(LL_INTINFO, VNCLOG("negotiated version"));
1070 1077
1071 // AUTHENTICATE LINK 1078 // AUTHENTICATE LINK
1072 if (!InitAuthenticate()) 1079 if (!InitAuthenticate())
@@ -1079,7 +1086,7 @@ vncClientThread::run(void *arg) @@ -1079,7 +1086,7 @@ vncClientThread::run(void *arg)
1079 // Authenticated OK - remove from blacklist and remove timeout 1086 // Authenticated OK - remove from blacklist and remove timeout
1080 m_server->RemAuthHostsBlacklist(m_client->GetClientName()); 1087 m_server->RemAuthHostsBlacklist(m_client->GetClientName());
1081 m_socket->SetTimeout(m_server->AutoIdleDisconnectTimeout()*1000); 1088 m_socket->SetTimeout(m_server->AutoIdleDisconnectTimeout()*1000);
1082 - vnclog.Print(LL_INTINFO, VNCLOG("authenticated connection\n")); 1089 + vnclog.Print(LL_INTINFO, VNCLOG("authenticated connection"));
1083 1090
1084 // Set Client Connect time 1091 // Set Client Connect time
1085 m_client->SetConnectTime(timeGetTime()); 1092 m_client->SetConnectTime(timeGetTime());
@@ -1158,7 +1165,7 @@ vncClientThread::run(void *arg) @@ -1158,7 +1165,7 @@ vncClientThread::run(void *arg)
1158 m_server->RemoveClient(m_client->GetClientId()); 1165 m_server->RemoveClient(m_client->GetClientId());
1159 return; 1166 return;
1160 } 1167 }
1161 - vnclog.Print(LL_INTINFO, VNCLOG("sent pixel format to client\n")); 1168 + vnclog.Print(LL_INTINFO, VNCLOG("sent pixel format to client"));
1162 1169
1163 // UNLOCK INITIAL SETUP 1170 // UNLOCK INITIAL SETUP
1164 // Initial negotiation is complete, so set the protocol ready flag 1171 // Initial negotiation is complete, so set the protocol ready flag
@@ -1185,7 +1192,7 @@ vncClientThread::run(void *arg) @@ -1185,7 +1192,7 @@ vncClientThread::run(void *arg)
1185 // TODO CACIC tirando o timeout do socket. Quando o chat está aberto sem mensagens, 1192 // TODO CACIC tirando o timeout do socket. Quando o chat está aberto sem mensagens,
1186 // não há fluxo no socket, fazendo com que ele de timeout, 1193 // não há fluxo no socket, fazendo com que ele de timeout,
1187 if (!m_socket->SetTimeout(0)) 1194 if (!m_socket->SetTimeout(0))
1188 - vnclog.Print(LL_INTERR, VNCLOG("failed to set socket timeout(%d)\n"), GetLastError()); 1195 + vnclog.Print(LL_INTERR, VNCLOG("failed to set socket timeout(%d)"), GetLastError());
1189 while (connected) 1196 while (connected)
1190 { 1197 {
1191 rfbClientToServerMsg msg; 1198 rfbClientToServerMsg msg;
@@ -1264,7 +1271,7 @@ vncClientThread::run(void *arg) @@ -1264,7 +1271,7 @@ vncClientThread::run(void *arg)
1264 // Tell the buffer object of the change 1271 // Tell the buffer object of the change
1265 if (!m_client->m_encodemgr.SetClientFormat(msg.spf.format)) 1272 if (!m_client->m_encodemgr.SetClientFormat(msg.spf.format))
1266 { 1273 {
1267 - vnclog.Print(LL_CONNERR, VNCLOG("remote pixel format invalid\n")); 1274 + vnclog.Print(LL_CONNERR, VNCLOG("remote pixel format invalid"));
1268 1275
1269 connected = FALSE; 1276 connected = FALSE;
1270 } 1277 }
@@ -1345,7 +1352,7 @@ vncClientThread::run(void *arg) @@ -1345,7 +1352,7 @@ vncClientThread::run(void *arg)
1345 if (Swap32IfLE(encoding) == rfbEncodingCacheEnable) 1352 if (Swap32IfLE(encoding) == rfbEncodingCacheEnable)
1346 { 1353 {
1347 m_client->m_encodemgr.EnableCache(TRUE); 1354 m_client->m_encodemgr.EnableCache(TRUE);
1348 - vnclog.Print(LL_INTINFO, VNCLOG("Cache protocol extension enabled\n")); 1355 + vnclog.Print(LL_INTINFO, VNCLOG("Cache protocol extension enabled"));
1349 continue; 1356 continue;
1350 } 1357 }
1351 1358
@@ -1353,7 +1360,7 @@ vncClientThread::run(void *arg) @@ -1353,7 +1360,7 @@ vncClientThread::run(void *arg)
1353 // XOR zlib 1360 // XOR zlib
1354 if (Swap32IfLE(encoding) == rfbEncodingXOREnable) { 1361 if (Swap32IfLE(encoding) == rfbEncodingXOREnable) {
1355 m_client->m_encodemgr.AvailableXOR(TRUE); 1362 m_client->m_encodemgr.AvailableXOR(TRUE);
1356 - vnclog.Print(LL_INTINFO, VNCLOG("XOR protocol extension enabled\n")); 1363 + vnclog.Print(LL_INTINFO, VNCLOG("XOR protocol extension enabled"));
1357 continue; 1364 continue;
1358 } 1365 }
1359 1366
@@ -1365,7 +1372,7 @@ vncClientThread::run(void *arg) @@ -1365,7 +1372,7 @@ vncClientThread::run(void *arg)
1365 // Client specified encoding-specific compression level 1372 // Client specified encoding-specific compression level
1366 int level = (int)(Swap32IfLE(encoding) - rfbEncodingCompressLevel0); 1373 int level = (int)(Swap32IfLE(encoding) - rfbEncodingCompressLevel0);
1367 m_client->m_encodemgr.SetCompressLevel(level); 1374 m_client->m_encodemgr.SetCompressLevel(level);
1368 - vnclog.Print(LL_INTINFO, VNCLOG("compression level requested: %d\n"), level); 1375 + vnclog.Print(LL_INTINFO, VNCLOG("compression level requested: %d"), level);
1369 continue; 1376 continue;
1370 } 1377 }
1371 1378
@@ -1376,14 +1383,14 @@ vncClientThread::run(void *arg) @@ -1376,14 +1383,14 @@ vncClientThread::run(void *arg)
1376 // Client specified image quality level used for JPEG compression 1383 // Client specified image quality level used for JPEG compression
1377 int level = (int)(Swap32IfLE(encoding) - rfbEncodingQualityLevel0); 1384 int level = (int)(Swap32IfLE(encoding) - rfbEncodingQualityLevel0);
1378 m_client->m_encodemgr.SetQualityLevel(level); 1385 m_client->m_encodemgr.SetQualityLevel(level);
1379 - vnclog.Print(LL_INTINFO, VNCLOG("image quality level requested: %d\n"), level); 1386 + vnclog.Print(LL_INTINFO, VNCLOG("image quality level requested: %d"), level);
1380 continue; 1387 continue;
1381 } 1388 }
1382 1389
1383 // Is this a LastRect encoding request? 1390 // Is this a LastRect encoding request?
1384 if (Swap32IfLE(encoding) == rfbEncodingLastRect) { 1391 if (Swap32IfLE(encoding) == rfbEncodingLastRect) {
1385 m_client->m_encodemgr.EnableLastRect(TRUE); // We forbid Last Rect for now 1392 m_client->m_encodemgr.EnableLastRect(TRUE); // We forbid Last Rect for now
1386 - vnclog.Print(LL_INTINFO, VNCLOG("LastRect protocol extension enabled\n")); 1393 + vnclog.Print(LL_INTINFO, VNCLOG("LastRect protocol extension enabled"));
1387 continue; 1394 continue;
1388 } 1395 }
1389 1396
@@ -1391,7 +1398,7 @@ vncClientThread::run(void *arg) @@ -1391,7 +1398,7 @@ vncClientThread::run(void *arg)
1391 if (Swap32IfLE(encoding) == rfbEncodingXCursor) { 1398 if (Swap32IfLE(encoding) == rfbEncodingXCursor) {
1392 m_client->m_encodemgr.EnableXCursor(TRUE); 1399 m_client->m_encodemgr.EnableXCursor(TRUE);
1393 m_server->EnableXRichCursor(TRUE); 1400 m_server->EnableXRichCursor(TRUE);
1394 - vnclog.Print(LL_INTINFO, VNCLOG("X-style cursor shape updates enabled\n")); 1401 + vnclog.Print(LL_INTINFO, VNCLOG("X-style cursor shape updates enabled"));
1395 continue; 1402 continue;
1396 } 1403 }
1397 1404
@@ -1399,34 +1406,34 @@ vncClientThread::run(void *arg) @@ -1399,34 +1406,34 @@ vncClientThread::run(void *arg)
1399 if (Swap32IfLE(encoding) == rfbEncodingRichCursor) { 1406 if (Swap32IfLE(encoding) == rfbEncodingRichCursor) {
1400 m_client->m_encodemgr.EnableRichCursor(TRUE); 1407 m_client->m_encodemgr.EnableRichCursor(TRUE);
1401 m_server->EnableXRichCursor(TRUE); 1408 m_server->EnableXRichCursor(TRUE);
1402 - vnclog.Print(LL_INTINFO, VNCLOG("Full-color cursor shape updates enabled\n")); 1409 + vnclog.Print(LL_INTINFO, VNCLOG("Full-color cursor shape updates enabled"));
1403 continue; 1410 continue;
1404 } 1411 }
1405 1412
1406 // Is this a PointerPos encoding request? nyama/marscha - PointerPos 1413 // Is this a PointerPos encoding request? nyama/marscha - PointerPos
1407 if (Swap32IfLE(encoding) == rfbEncodingPointerPos) { 1414 if (Swap32IfLE(encoding) == rfbEncodingPointerPos) {
1408 m_client->m_use_PointerPos = TRUE; 1415 m_client->m_use_PointerPos = TRUE;
1409 - vnclog.Print(LL_INTINFO, VNCLOG("PointerPos protocol extension enabled\n")); 1416 + vnclog.Print(LL_INTINFO, VNCLOG("PointerPos protocol extension enabled"));
1410 continue; 1417 continue;
1411 } 1418 }
1412 // 21 March 2008 jdp - client wants server state updates 1419 // 21 March 2008 jdp - client wants server state updates
1413 if (Swap32IfLE(encoding) == rfbEncodingServerState) { 1420 if (Swap32IfLE(encoding) == rfbEncodingServerState) {
1414 m_client->m_wants_ServerStateUpdates = true; 1421 m_client->m_wants_ServerStateUpdates = true;
1415 m_server->EnableServerStateUpdates(true); 1422 m_server->EnableServerStateUpdates(true);
1416 - vnclog.Print(LL_INTINFO, VNCLOG("ServerState protocol extension enabled\n")); 1423 + vnclog.Print(LL_INTINFO, VNCLOG("ServerState protocol extension enabled"));
1417 continue; 1424 continue;
1418 } 1425 }
1419 1426
1420 // RDV - We try to detect which type of viewer tries to connect 1427 // RDV - We try to detect which type of viewer tries to connect
1421 if (Swap32IfLE(encoding) == rfbEncodingZRLE) { 1428 if (Swap32IfLE(encoding) == rfbEncodingZRLE) {
1422 m_client->m_encodemgr.AvailableZRLE(TRUE); 1429 m_client->m_encodemgr.AvailableZRLE(TRUE);
1423 - vnclog.Print(LL_INTINFO, VNCLOG("ZRLE found \n")); 1430 + vnclog.Print(LL_INTINFO, VNCLOG("ZRLE found "));
1424 // continue; 1431 // continue;
1425 } 1432 }
1426 1433
1427 if (Swap32IfLE(encoding) == rfbEncodingTight) { 1434 if (Swap32IfLE(encoding) == rfbEncodingTight) {
1428 m_client->m_encodemgr.AvailableTight(TRUE); 1435 m_client->m_encodemgr.AvailableTight(TRUE);
1429 - vnclog.Print(LL_INTINFO, VNCLOG("Tight found\n")); 1436 + vnclog.Print(LL_INTINFO, VNCLOG("Tight found"));
1430 // continue; 1437 // continue;
1431 } 1438 }
1432 1439
@@ -1443,11 +1450,11 @@ vncClientThread::run(void *arg) @@ -1443,11 +1450,11 @@ vncClientThread::run(void *arg)
1443 // If no encoding worked then default to RAW! 1450 // If no encoding worked then default to RAW!
1444 if (!encoding_set) 1451 if (!encoding_set)
1445 { 1452 {
1446 - vnclog.Print(LL_INTINFO, VNCLOG("defaulting to raw encoder\n")); 1453 + vnclog.Print(LL_INTINFO, VNCLOG("defaulting to raw encoder"));
1447 omni_mutex_lock l(m_client->GetUpdateLock()); 1454 omni_mutex_lock l(m_client->GetUpdateLock());
1448 if (!m_client->m_encodemgr.SetEncoding(Swap32IfLE(rfbEncodingRaw),FALSE)) 1455 if (!m_client->m_encodemgr.SetEncoding(Swap32IfLE(rfbEncodingRaw),FALSE))
1449 { 1456 {
1450 - vnclog.Print(LL_INTERR, VNCLOG("failed to select raw encoder!\n")); 1457 + vnclog.Print(LL_INTERR, VNCLOG("failed to select raw encoder!"));
1451 1458
1452 connected = FALSE; 1459 connected = FALSE;
1453 } 1460 }
@@ -1481,7 +1488,7 @@ vncClientThread::run(void *arg) @@ -1481,7 +1488,7 @@ vncClientThread::run(void *arg)
1481 int sendtime=m_client->Sendtimer.read()*1000; 1488 int sendtime=m_client->Sendtimer.read()*1000;
1482 if (m_client->Totalsend>1500 && sendtime!=0) 1489 if (m_client->Totalsend>1500 && sendtime!=0)
1483 { 1490 {
1484 - //vnclog.Print(LL_SOCKERR, VNCLOG("Send Size %i %i %i %i\n"),m_socket->Totalsend,sendtime,m_socket->Totalsend/sendtime,m_client->m_encodemgr.m_encoding); 1491 + //vnclog.Print(LL_SOCKERR, VNCLOG("Send Size %i %i %i %i"),m_socket->Totalsend,sendtime,m_socket->Totalsend/sendtime,m_client->m_encodemgr.m_encoding);
1485 m_client->timearray[m_client->m_encodemgr.m_encoding][m_client->roundrobin_counter]=sendtime; 1492 m_client->timearray[m_client->m_encodemgr.m_encoding][m_client->roundrobin_counter]=sendtime;
1486 m_client->sizearray[m_client->m_encodemgr.m_encoding][m_client->roundrobin_counter]=m_client->Totalsend; 1493 m_client->sizearray[m_client->m_encodemgr.m_encoding][m_client->roundrobin_counter]=m_client->Totalsend;
1487 m_client->Sendtimer.reset(); 1494 m_client->Sendtimer.reset();
@@ -1495,7 +1502,7 @@ vncClientThread::run(void *arg) @@ -1495,7 +1502,7 @@ vncClientThread::run(void *arg)
1495 tottime+=m_client->timearray[j][i]; 1502 tottime+=m_client->timearray[j][i];
1496 } 1503 }
1497 if (tottime!=0 && totsize>1500) 1504 if (tottime!=0 && totsize>1500)
1498 - vnclog.Print(LL_SOCKERR, VNCLOG("Send Size %i %i %i %i\n"),totsize,tottime,totsize/tottime,j); 1505 + vnclog.Print(LL_SOCKERR, VNCLOG("Send Size %i %i %i %i"),totsize,tottime,totsize/tottime,j);
1499 } 1506 }
1500 m_client->roundrobin_counter++; 1507 m_client->roundrobin_counter++;
1501 if (m_client->roundrobin_counter>30) m_client->roundrobin_counter=0; 1508 if (m_client->roundrobin_counter>30) m_client->roundrobin_counter=0;
@@ -1519,11 +1526,11 @@ vncClientThread::run(void *arg) @@ -1519,11 +1526,11 @@ vncClientThread::run(void *arg)
1519 // update.br.x = 2880; 1526 // update.br.x = 2880;
1520 // update.br.y = 1200; 1527 // update.br.y = 1200;
1521 rfb::Region2D update_rgn = update; 1528 rfb::Region2D update_rgn = update;
1522 -// vnclog.Print(LL_SOCKERR, VNCLOG("Update asked for region %i %i %i %i %i\n"),update.tl.x,update.tl.y,update.br.x,update.br.y,m_client->m_SWOffsetx); 1529 +// vnclog.Print(LL_SOCKERR, VNCLOG("Update asked for region %i %i %i %i %i"),update.tl.x,update.tl.y,update.br.x,update.br.y,m_client->m_SWOffsetx);
1523 1530
1524 // RealVNC 336 1531 // RealVNC 336
1525 if (update_rgn.is_empty()) { 1532 if (update_rgn.is_empty()) {
1526 - vnclog.Print(LL_INTERR, VNCLOG("FATAL! client update region is empty!\n")); 1533 + vnclog.Print(LL_INTERR, VNCLOG("FATAL! client update region is empty!"));
1527 connected = FALSE; 1534 connected = FALSE;
1528 break; 1535 break;
1529 } 1536 }
@@ -1660,14 +1667,14 @@ vncClientThread::run(void *arg) @@ -1660,14 +1667,14 @@ vncClientThread::run(void *arg)
1660 // offset for multi display 1667 // offset for multi display
1661 int screenX, screenY, screenDepth; 1668 int screenX, screenY, screenDepth;
1662 m_server->GetScreenInfo(screenX, screenY, screenDepth); 1669 m_server->GetScreenInfo(screenX, screenY, screenDepth);
1663 -// vnclog.Print(LL_INTINFO, VNCLOG("########mouse :%i %i %i %i \n"),screenX, screenY,m_client->m_ScreenOffsetx,m_client->m_ScreenOffsety ); 1670 +// vnclog.Print(LL_INTINFO, VNCLOG("########mouse :%i %i %i %i "),screenX, screenY,m_client->m_ScreenOffsetx,m_client->m_ScreenOffsety );
1664 if (m_client->m_display_type==1) 1671 if (m_client->m_display_type==1)
1665 {//primary display always have (0,0) as corner 1672 {//primary display always have (0,0) as corner
1666 unsigned long x = (msg.pe.x * 65535) / (screenX-1); 1673 unsigned long x = (msg.pe.x * 65535) / (screenX-1);
1667 unsigned long y = (msg.pe.y * 65535) / (screenY-1); 1674 unsigned long y = (msg.pe.y * 65535) / (screenY-1);
1668 // Do the pointer event 1675 // Do the pointer event
1669 ::mouse_event(flags, (DWORD) x, (DWORD) y, wheel_movement, 0); 1676 ::mouse_event(flags, (DWORD) x, (DWORD) y, wheel_movement, 0);
1670 -// vnclog.Print(LL_INTINFO, VNCLOG("########mouse_event :%i %i \n"),x,y); 1677 +// vnclog.Print(LL_INTINFO, VNCLOG("########mouse_event :%i %i "),x,y);
1671 } 1678 }
1672 else 1679 else
1673 {//second or spanned 1680 {//second or spanned
@@ -1803,7 +1810,7 @@ vncClientThread::run(void *arg) @@ -1803,7 +1810,7 @@ vncClientThread::run(void *arg)
1803 //if (msg.sim.status==1) m_client->m_encodemgr.m_buffer->m_desktop->SetDisableInput(true); 1810 //if (msg.sim.status==1) m_client->m_encodemgr.m_buffer->m_desktop->SetDisableInput(true);
1804 //if (msg.sim.status==0) m_client->m_encodemgr.m_buffer->m_desktop->SetDisableInput(false); 1811 //if (msg.sim.status==0) m_client->m_encodemgr.m_buffer->m_desktop->SetDisableInput(false);
1805 // added jeff 1812 // added jeff
1806 - vnclog.Print(LL_INTINFO, VNCLOG("rfbSetServerInput: inputs %s\n"), (msg.sim.status==1) ? "disabled" : "enabled"); 1813 + vnclog.Print(LL_INTINFO, VNCLOG("rfbSetServerInput: inputs %s"), (msg.sim.status==1) ? "disabled" : "enabled");
1807 1814
1808 // only allow change if this is the client that originally changed the input state 1815 // only allow change if this is the client that originally changed the input state
1809 if (m_server->GetDesktopPointer()->GetBlockInputState() && !m_client->m_bClientHasBlockedInput) 1816 if (m_server->GetDesktopPointer()->GetBlockInputState() && !m_client->m_bClientHasBlockedInput)
@@ -1843,7 +1850,7 @@ vncClientThread::run(void *arg) @@ -1843,7 +1850,7 @@ vncClientThread::run(void *arg)
1843 m_client->m_pTextChat->ProcessTextChatMsg(nTO); 1850 m_client->m_pTextChat->ProcessTextChatMsg(nTO);
1844 break; 1851 break;
1845 1852
1846 - 1853 + /** Trecho referente a parte de Transferencia de Arquivo!*/
1847 // Modif sf@2002 - FileTransfer 1854 // Modif sf@2002 - FileTransfer
1848 // File Transfer Message 1855 // File Transfer Message
1849 case rfbFileTransfer: 1856 case rfbFileTransfer:
@@ -1863,7 +1870,8 @@ vncClientThread::run(void *arg) @@ -1863,7 +1870,8 @@ vncClientThread::run(void *arg)
1863 { 1870 {
1864 switch (msg.ft.contentType) 1871 switch (msg.ft.contentType)
1865 { 1872 {
1866 - // A new file is received from the client 1873 + /** UPLOAD: O Cliente faz UPLOAD de um arquivo para o Servidor.*/
  1874 + // A new file is received from the client
1867 // case rfbFileHeader: 1875 // case rfbFileHeader:
1868 case rfbFileTransferOffer: 1876 case rfbFileTransferOffer:
1869 { 1877 {
@@ -1877,7 +1885,7 @@ vncClientThread::run(void *arg) @@ -1877,7 +1885,7 @@ vncClientThread::run(void *arg)
1877 if (!m_socket->ReadExact(m_client->m_szFullDestName, length)) 1885 if (!m_socket->ReadExact(m_client->m_szFullDestName, length))
1878 { 1886 {
1879 //MessageBox(NULL, "1. Abort !", "Ultra WinVNC", MB_OK); 1887 //MessageBox(NULL, "1. Abort !", "Ultra WinVNC", MB_OK);
1880 - // vnclog.Print(LL_INTINFO, VNCLOG("*** FileTransfer: Failed to receive FileName from Viewer. Abort !\n")); 1888 + // vnclog.Print(LL_INTINFO, VNCLOG("*** FileTransfer: Failed to receive FileName from Viewer. Abort !"));
1881 break; 1889 break;
1882 } 1890 }
1883 1891
@@ -1888,7 +1896,7 @@ vncClientThread::run(void *arg) @@ -1888,7 +1896,7 @@ vncClientThread::run(void *arg)
1888 if (!m_socket->ReadExact((char*)&sizeHtmp, sizeof(CARD32))) 1896 if (!m_socket->ReadExact((char*)&sizeHtmp, sizeof(CARD32)))
1889 { 1897 {
1890 //MessageBox(NULL, "2. Abort !", "Ultra WinVNC", MB_OK); 1898 //MessageBox(NULL, "2. Abort !", "Ultra WinVNC", MB_OK);
1891 - //vnclog.Print(LL_INTINFO, VNCLOG("*** FileTransfer: Failed to receive SizeH from Viewer. Abort !\n")); 1899 + //vnclog.Print(LL_INTINFO, VNCLOG("*** FileTransfer: Failed to receive SizeH from Viewer. Abort !"));
1892 break; 1900 break;
1893 } 1901 }
1894 sizeH = Swap32IfLE(sizeHtmp); 1902 sizeH = Swap32IfLE(sizeHtmp);
@@ -2014,7 +2022,7 @@ vncClientThread::run(void *arg) @@ -2014,7 +2022,7 @@ vncClientThread::run(void *arg)
2014 delete m_client->m_pBuff; 2022 delete m_client->m_pBuff;
2015 2023
2016 //MessageBox(NULL, "3. Abort !", "Ultra WinVNC", MB_OK); 2024 //MessageBox(NULL, "3. Abort !", "Ultra WinVNC", MB_OK);
2017 - //vnclog.Print(LL_INTINFO, VNCLOG("*** FileTransfer: Wrong Dest File size. Abort !\n")); 2025 + //vnclog.Print(LL_INTINFO, VNCLOG("*** FileTransfer: Wrong Dest File size. Abort !"));
2018 break; 2026 break;
2019 } 2027 }
2020 2028
@@ -2030,7 +2038,7 @@ vncClientThread::run(void *arg) @@ -2030,7 +2038,7 @@ vncClientThread::run(void *arg)
2030 2038
2031 } 2039 }
2032 break; 2040 break;
2033 - 2041 + /** DOWNLOAD: O Cliente Solicita o Download de um arquivo no Server.*/
2034 // The client requests a File 2042 // The client requests a File
2035 case rfbFileTransferRequest: 2043 case rfbFileTransferRequest:
2036 { 2044 {
@@ -2044,7 +2052,7 @@ vncClientThread::run(void *arg) @@ -2044,7 +2052,7 @@ vncClientThread::run(void *arg)
2044 if (!m_socket->ReadExact(m_client->m_szSrcFileName, length)) 2052 if (!m_socket->ReadExact(m_client->m_szSrcFileName, length))
2045 { 2053 {
2046 //MessageBox(NULL, "4. Abort !", "Ultra WinVNC", MB_OK); 2054 //MessageBox(NULL, "4. Abort !", "Ultra WinVNC", MB_OK);
2047 - //vnclog.Print(LL_INTINFO, VNCLOG("*** FileTransfer: Cannot read requested filename. Abort !\n")); 2055 + //vnclog.Print(LL_INTINFO, VNCLOG("*** FileTransfer: Cannot read requested filename. Abort !"));
2048 break; 2056 break;
2049 } 2057 }
2050 2058
@@ -2055,7 +2063,7 @@ vncClientThread::run(void *arg) @@ -2055,7 +2063,7 @@ vncClientThread::run(void *arg)
2055 if (nDirZipRet == -1) 2063 if (nDirZipRet == -1)
2056 { 2064 {
2057 //MessageBox(NULL, "5. Abort !", "Ultra WinVNC", MB_OK); 2065 //MessageBox(NULL, "5. Abort !", "Ultra WinVNC", MB_OK);
2058 - //vnclog.Print(LL_INTINFO, VNCLOG("*** FileTransfer: Failed to zip requested dir. Abort !\n")); 2066 + //vnclog.Print(LL_INTINFO, VNCLOG("*** FileTransfer: Failed to zip requested dir. Abort !"));
2059 2067
2060 // [v1.0.2-jp1 fix] Empty directory receive problem 2068 // [v1.0.2-jp1 fix] Empty directory receive problem
2061 rfbFileTransferMsg ft; 2069 rfbFileTransferMsg ft;
@@ -2134,6 +2142,14 @@ vncClientThread::run(void *arg) @@ -2134,6 +2142,14 @@ vncClientThread::run(void *arg)
2134 FileTime.wHour, 2142 FileTime.wHour,
2135 FileTime.wMinute 2143 FileTime.wMinute
2136 ); 2144 );
  2145 +
  2146 + /** ATENCAO!!! Aqui faz um append que pode não ser muito legal. Ele
  2147 + * incrementa virgula, data e hora ao nome do arquivo para
  2148 + * posteriormente imprimir como sendo uma string de um log qualquer.
  2149 + * A integridade do nome do arquivo eh alterada. Deve-se entaum, obter
  2150 + * o nome do arquivo transferido de outra forma. Verificar outros
  2151 + * campos disponíveis.
  2152 + **/
2137 strcat(m_client->m_szSrcFileName, ","); 2153 strcat(m_client->m_szSrcFileName, ",");
2138 strcat(m_client->m_szSrcFileName, szSrcFileTime); 2154 strcat(m_client->m_szSrcFileName, szSrcFileTime);
2139 } 2155 }
@@ -2149,6 +2165,10 @@ vncClientThread::run(void *arg) @@ -2149,6 +2165,10 @@ vncClientThread::run(void *arg)
2149 m_client->m_nCSOffset = 0; 2165 m_client->m_nCSOffset = 0;
2150 m_client->m_nCSBufferSize = 0; 2166 m_client->m_nCSBufferSize = 0;
2151 2167
  2168 + /** Próximo passo na transferencia do arquivo: Pegar o Header do arquivo.
  2169 + * mens_transf.type = rfbFileTransfer (valor constante pra qqer transferencia).
  2170 + * mens_transf.contentType = rfbFileHeader (pegar o header do file no proximo ciclo).
  2171 + */
2152 // Send the FileTransferMsg with rfbFileHeader 2172 // Send the FileTransferMsg with rfbFileHeader
2153 rfbFileTransferMsg ft; 2173 rfbFileTransferMsg ft;
2154 2174
@@ -2167,7 +2187,7 @@ vncClientThread::run(void *arg) @@ -2167,7 +2187,7 @@ vncClientThread::run(void *arg)
2167 if (n2SrcSize.LowPart == 0xFFFFFFFF && n2SrcSize.HighPart == 0xFFFFFFFF) 2187 if (n2SrcSize.LowPart == 0xFFFFFFFF && n2SrcSize.HighPart == 0xFFFFFFFF)
2168 { 2188 {
2169 //MessageBox(NULL, "6. Abort !", "Ultra WinVNC", MB_OK); 2189 //MessageBox(NULL, "6. Abort !", "Ultra WinVNC", MB_OK);
2170 - //vnclog.Print(LL_INTINFO, VNCLOG("*** FileTransfer: Wrong Src File size. Abort !\n")); 2190 + //vnclog.Print(LL_INTINFO, VNCLOG("*** FileTransfer: Wrong Src File size. Abort !"));
2171 break; // If error, we don't send anything else 2191 break; // If error, we don't send anything else
2172 } 2192 }
2173 } 2193 }
@@ -2187,7 +2207,7 @@ vncClientThread::run(void *arg) @@ -2187,7 +2207,7 @@ vncClientThread::run(void *arg)
2187 { 2207 {
2188 CloseHandle(m_client->m_hSrcFile); 2208 CloseHandle(m_client->m_hSrcFile);
2189 // MessageBox(NULL, "7. Abort !", "Ultra WinVNC", MB_OK); 2209 // MessageBox(NULL, "7. Abort !", "Ultra WinVNC", MB_OK);
2190 - //vnclog.Print(LL_INTINFO, VNCLOG("*** FileTransfer: File not created on client side. Abort !\n")); 2210 + //vnclog.Print(LL_INTINFO, VNCLOG("*** FileTransfer: File not created on client side. Abort !"));
2191 break; 2211 break;
2192 } 2212 }
2193 2213
@@ -2197,7 +2217,7 @@ vncClientThread::run(void *arg) @@ -2197,7 +2217,7 @@ vncClientThread::run(void *arg)
2197 { 2217 {
2198 CloseHandle(m_client->m_hSrcFile); 2218 CloseHandle(m_client->m_hSrcFile);
2199 //MessageBox(NULL, "8. Abort !", "Ultra WinVNC", MB_OK); 2219 //MessageBox(NULL, "8. Abort !", "Ultra WinVNC", MB_OK);
2200 - //vnclog.Print(LL_INTINFO, VNCLOG("*** FileTransfer: rfbFileHeader - Unable to allocate buffer. Abort !\n")); 2220 + //vnclog.Print(LL_INTINFO, VNCLOG("*** FileTransfer: rfbFileHeader - Unable to allocate buffer. Abort !"));
2201 break; 2221 break;
2202 } 2222 }
2203 2223
@@ -2210,7 +2230,7 @@ vncClientThread::run(void *arg) @@ -2210,7 +2230,7 @@ vncClientThread::run(void *arg)
2210 if (m_client->m_pBuff != NULL) 2230 if (m_client->m_pBuff != NULL)
2211 delete m_client->m_pBuff; 2231 delete m_client->m_pBuff;
2212 //MessageBox(NULL, "9. Abort !", "Ultra WinVNC", MB_OK); 2232 //MessageBox(NULL, "9. Abort !", "Ultra WinVNC", MB_OK);
2213 - //vnclog.Print(LL_INTINFO, VNCLOG("*** FileTransfer: rfbFileHeader - Unable to allocate comp. buffer. Abort !\n")); 2233 + //vnclog.Print(LL_INTINFO, VNCLOG("*** FileTransfer: rfbFileHeader - Unable to allocate comp. buffer. Abort !"));
2214 break; 2234 break;
2215 } 2235 }
2216 2236
@@ -2241,7 +2261,7 @@ vncClientThread::run(void *arg) @@ -2241,7 +2261,7 @@ vncClientThread::run(void *arg)
2241 m_client->FinishFileReception(); 2261 m_client->FinishFileReception();
2242 } 2262 }
2243 break; 2263 break;
2244 - 2264 + /** ABORT: Trecho referente ao trato com o comando Abort.*/
2245 // We use this message for FileTransfer rights (<=RC18 versions) 2265 // We use this message for FileTransfer rights (<=RC18 versions)
2246 // The client asks for FileTransfer permission 2266 // The client asks for FileTransfer permission
2247 case rfbAbortFileTransfer: 2267 case rfbAbortFileTransfer:
@@ -2607,7 +2627,7 @@ vncClientThread::run(void *arg) @@ -2607,7 +2627,7 @@ vncClientThread::run(void *arg)
2607 m_client->m_fFileDownloadError = true; 2627 m_client->m_fFileDownloadError = true;
2608 FlushFileBuffers(m_client->m_hDestFile); 2628 FlushFileBuffers(m_client->m_hDestFile);
2609 } 2629 }
2610 - //vnclog.Print(LL_INTINFO, VNCLOG("*** FileTransfer: message content reading error\n")); 2630 + //vnclog.Print(LL_INTINFO, VNCLOG("*** FileTransfer: message content reading error"));
2611 } 2631 }
2612 /* 2632 /*
2613 // sf@2005 - Cancel FT User impersonation if possible 2633 // sf@2005 - Cancel FT User impersonation if possible
@@ -2661,7 +2681,7 @@ vncClientThread::run(void *arg) @@ -2661,7 +2681,7 @@ vncClientThread::run(void *arg)
2661 } 2681 }
2662 else 2682 else
2663 { 2683 {
2664 - vnclog.Print(LL_INTERR, VNCLOG("[rfbKeyFrameRequest] Unable to Reset ZRLE Encoding\n")); 2684 + vnclog.Print(LL_INTERR, VNCLOG("[rfbKeyFrameRequest] Unable to Reset ZRLE Encoding"));
2665 } 2685 }
2666 } 2686 }
2667 break; 2687 break;
@@ -2681,7 +2701,7 @@ vncClientThread::run(void *arg) @@ -2681,7 +2701,7 @@ vncClientThread::run(void *arg)
2681 } 2701 }
2682 // TODO CACIC voltando o timeout ao normal 2702 // TODO CACIC voltando o timeout ao normal
2683 if (!m_socket->SetTimeout(30000)) 2703 if (!m_socket->SetTimeout(30000))
2684 - vnclog.Print(LL_INTERR, VNCLOG("failed to set socket timeout(%d)\n"), GetLastError()); 2704 + vnclog.Print(LL_INTERR, VNCLOG("failed to set socket timeout(%d)"), GetLastError());
2685 2705
2686 // Move into the thread's original desktop 2706 // Move into the thread's original desktop
2687 // TAG 14 2707 // TAG 14
@@ -2694,7 +2714,7 @@ vncClientThread::run(void *arg) @@ -2694,7 +2714,7 @@ vncClientThread::run(void *arg)
2694 2714
2695 // Quit this thread. This will automatically delete the thread and the 2715 // Quit this thread. This will automatically delete the thread and the
2696 // associated client. 2716 // associated client.
2697 - vnclog.Print(LL_CLIENTS, VNCLOG("client disconnected : %s (%hd)\n"), 2717 + vnclog.Print(LL_CLIENTS, VNCLOG("client disconnected : %s (%hd)"),
2698 m_client->GetClientName(), 2718 m_client->GetClientName(),
2699 m_client->GetClientId()); 2719 m_client->GetClientId());
2700 ////////////////// 2720 //////////////////
@@ -2746,7 +2766,7 @@ vncClientThread::run(void *arg) @@ -2746,7 +2766,7 @@ vncClientThread::run(void *arg)
2746 2766
2747 vncClient::vncClient() 2767 vncClient::vncClient()
2748 { 2768 {
2749 - vnclog.Print(LL_INTINFO, VNCLOG("vncClient() executing...\n")); 2769 + vnclog.Print(LL_INTINFO, VNCLOG("vncClient() executing..."));
2750 2770
2751 m_socket = NULL; 2771 m_socket = NULL;
2752 m_client_name = 0; 2772 m_client_name = 0;
@@ -2775,7 +2795,7 @@ vncClient::vncClient() @@ -2775,7 +2795,7 @@ vncClient::vncClient()
2775 //SINGLE WINDOW 2795 //SINGLE WINDOW
2776 m_use_NewSWSize = FALSE; 2796 m_use_NewSWSize = FALSE;
2777 m_SWOffsetx=0; 2797 m_SWOffsetx=0;
2778 - vnclog.Print(LL_INTINFO, VNCLOG("TEST 4\n")); 2798 + vnclog.Print(LL_INTINFO, VNCLOG("TEST 4"));
2779 m_SWOffsety=0; 2799 m_SWOffsety=0;
2780 m_ScreenOffsetx=0; 2800 m_ScreenOffsetx=0;
2781 m_ScreenOffsety=0; 2801 m_ScreenOffsety=0;
@@ -2860,7 +2880,7 @@ vncClient::vncClient() @@ -2860,7 +2880,7 @@ vncClient::vncClient()
2860 2880
2861 vncClient::~vncClient() 2881 vncClient::~vncClient()
2862 { 2882 {
2863 - vnclog.Print(LL_INTINFO, VNCLOG("~vncClient() executing...\n")); 2883 + vnclog.Print(LL_INTINFO, VNCLOG("~vncClient() executing..."));
2864 2884
2865 // Modif sf@2002 - Text Chat 2885 // Modif sf@2002 - Text Chat
2866 if (m_pTextChat) 2886 if (m_pTextChat)
@@ -2881,7 +2901,7 @@ vncClient::~vncClient() @@ -2881,7 +2901,7 @@ vncClient::~vncClient()
2881 // If we have a socket then kill it 2901 // If we have a socket then kill it
2882 if (m_socket != NULL) 2902 if (m_socket != NULL)
2883 { 2903 {
2884 - vnclog.Print(LL_INTINFO, VNCLOG("deleting socket\n")); 2904 + vnclog.Print(LL_INTINFO, VNCLOG("deleting socket"));
2885 2905
2886 delete m_socket; 2906 delete m_socket;
2887 m_socket = NULL; 2907 m_socket = NULL;
@@ -2905,7 +2925,7 @@ vncClient::~vncClient() @@ -2905,7 +2925,7 @@ vncClient::~vncClient()
2905 #endif 2925 #endif
2906 2926
2907 //thos give sometimes errors, hlogfile is already removed at this point 2927 //thos give sometimes errors, hlogfile is already removed at this point
2908 - //vnclog.Print(LL_INTINFO, VNCLOG("cached %d \n"),totalraw); 2928 + //vnclog.Print(LL_INTINFO, VNCLOG("cached %d "),totalraw);
2909 } 2929 }
2910 2930
2911 // Init 2931 // Init
@@ -2924,8 +2944,9 @@ vncClient::Init(vncServer *server, @@ -2924,8 +2944,9 @@ vncClient::Init(vncServer *server,
2924 2944
2925 // Save the name of the connecting client 2945 // Save the name of the connecting client
2926 char *name = m_socket->GetPeerName(); 2946 char *name = m_socket->GetPeerName();
2927 - if (name != 0) 2947 + if (name != 0){
2928 m_client_name = _strdup(name); 2948 m_client_name = _strdup(name);
  2949 + }
2929 else 2950 else
2930 m_client_name = _strdup("<unknown>"); 2951 m_client_name = _strdup("<unknown>");
2931 2952
@@ -2993,7 +3014,7 @@ vncClient::UpdateMouse() @@ -2993,7 +3014,7 @@ vncClient::UpdateMouse()
2993 if (m_use_PointerPos && !m_cursor_pos_changed) { 3014 if (m_use_PointerPos && !m_cursor_pos_changed) {
2994 POINT cursorPos; 3015 POINT cursorPos;
2995 GetCursorPos(&cursorPos); 3016 GetCursorPos(&cursorPos);
2996 - //vnclog.Print(LL_INTINFO, VNCLOG("UpdateMouse m_cursor_pos(%d, %d), new(%d, %d)\n"), 3017 + //vnclog.Print(LL_INTINFO, VNCLOG("UpdateMouse m_cursor_pos(%d, %d), new(%d, %d)"),
2997 // m_cursor_pos.x, m_cursor_pos.y, cursorPos.x, cursorPos.y); 3018 // m_cursor_pos.x, m_cursor_pos.y, cursorPos.x, cursorPos.y);
2998 if (cursorPos.x != m_cursor_pos.x || cursorPos.y != m_cursor_pos.y) { 3019 if (cursorPos.x != m_cursor_pos.x || cursorPos.y != m_cursor_pos.y) {
2999 // This movement isn't by this client, but generated locally or by other client. 3020 // This movement isn't by this client, but generated locally or by other client.
@@ -3037,7 +3058,7 @@ void @@ -3037,7 +3058,7 @@ void
3037 vncClient::UpdateLocalFormat() 3058 vncClient::UpdateLocalFormat()
3038 { 3059 {
3039 DisableProtocol(); 3060 DisableProtocol();
3040 - vnclog.Print(LL_INTERR, VNCLOG("updating local pixel format\n")); 3061 + vnclog.Print(LL_INTERR, VNCLOG("updating local pixel format"));
3041 m_encodemgr.SetServerFormat(); 3062 m_encodemgr.SetServerFormat();
3042 EnableProtocol(); 3063 EnableProtocol();
3043 } 3064 }
@@ -3048,7 +3069,7 @@ vncClient::SetNewSWSize(long w,long h,BOOL Desktop) @@ -3048,7 +3069,7 @@ vncClient::SetNewSWSize(long w,long h,BOOL Desktop)
3048 if (!m_use_NewSWSize) return FALSE; 3069 if (!m_use_NewSWSize) return FALSE;
3049 DisableProtocol(); 3070 DisableProtocol();
3050 3071
3051 - vnclog.Print(LL_INTERR, VNCLOG("updating local pixel format and buffer size\n")); 3072 + vnclog.Print(LL_INTERR, VNCLOG("updating local pixel format and buffer size"));
3052 m_encodemgr.SetServerFormat(); 3073 m_encodemgr.SetServerFormat();
3053 m_palettechanged = TRUE; 3074 m_palettechanged = TRUE;
3054 // no lock needed Called from desktopthread 3075 // no lock needed Called from desktopthread
@@ -3088,7 +3109,7 @@ vncClient::EnableProtocol() @@ -3088,7 +3109,7 @@ vncClient::EnableProtocol()
3088 { 3109 {
3089 { omni_mutex_lock l(GetUpdateLock()); 3110 { omni_mutex_lock l(GetUpdateLock());
3090 if (m_disable_protocol == 0) { 3111 if (m_disable_protocol == 0) {
3091 - vnclog.Print(LL_INTERR, VNCLOG("protocol enabled too many times!\n")); 3112 + vnclog.Print(LL_INTERR, VNCLOG("protocol enabled too many times!"));
3092 m_socket->Close(); 3113 m_socket->Close();
3093 return; 3114 return;
3094 } 3115 }
@@ -3108,7 +3129,7 @@ vncClient::SendRFBMsg(CARD8 type, BYTE *buffer, int buflen) @@ -3108,7 +3129,7 @@ vncClient::SendRFBMsg(CARD8 type, BYTE *buffer, int buflen)
3108 // Send the message 3129 // Send the message
3109 if (!m_socket->SendExact((char *) buffer, buflen, type)) 3130 if (!m_socket->SendExact((char *) buffer, buflen, type))
3110 { 3131 {
3111 - vnclog.Print(LL_CONNERR, VNCLOG("failed to send RFB message to client\n")); 3132 + vnclog.Print(LL_CONNERR, VNCLOG("failed to send RFB message to client"));
3112 3133
3113 Kill(); 3134 Kill();
3114 return FALSE; 3135 return FALSE;
@@ -3165,7 +3186,7 @@ vncClient::SendUpdate(rfb::SimpleUpdateTracker &amp;update) @@ -3165,7 +3186,7 @@ vncClient::SendUpdate(rfb::SimpleUpdateTracker &amp;update)
3165 else 3186 else
3166 { 3187 {
3167 updates += update_info.cached.size(); 3188 updates += update_info.cached.size();
3168 - //vnclog.Print(LL_INTERR, "cached %d\n", updates); 3189 + //vnclog.Print(LL_INTERR, "cached %d", updates);
3169 } 3190 }
3170 } 3191 }
3171 3192
@@ -3183,7 +3204,7 @@ vncClient::SendUpdate(rfb::SimpleUpdateTracker &amp;update) @@ -3183,7 +3204,7 @@ vncClient::SendUpdate(rfb::SimpleUpdateTracker &amp;update)
3183 break; 3204 break;
3184 } 3205 }
3185 updates += numsubrects; 3206 updates += numsubrects;
3186 - //vnclog.Print(LL_INTERR, "changed %d\n", updates); 3207 + //vnclog.Print(LL_INTERR, "changed %d", updates);
3187 } 3208 }
3188 } 3209 }
3189 3210
@@ -3202,7 +3223,7 @@ vncClient::SendUpdate(rfb::SimpleUpdateTracker &amp;update) @@ -3202,7 +3223,7 @@ vncClient::SendUpdate(rfb::SimpleUpdateTracker &amp;update)
3202 break; 3223 break;
3203 } 3224 }
3204 updates += numsubrects; 3225 updates += numsubrects;
3205 - //vnclog.Print(LL_INTERR, "cached2 %d\n", updates); 3226 + //vnclog.Print(LL_INTERR, "cached2 %d", updates);
3206 } 3227 }
3207 } 3228 }
3208 3229
@@ -3281,7 +3302,7 @@ vncClient::SendUpdate(rfb::SimpleUpdateTracker &amp;update) @@ -3281,7 +3302,7 @@ vncClient::SendUpdate(rfb::SimpleUpdateTracker &amp;update)
3281 return FALSE; 3302 return FALSE;
3282 } 3303 }
3283 m_socket->ClearQueue(); 3304 m_socket->ClearQueue();
3284 - // vnclog.Print(LL_INTINFO, VNCLOG("Update cycle\n")); 3305 + // vnclog.Print(LL_INTINFO, VNCLOG("Update cycle"));
3285 return TRUE; 3306 return TRUE;
3286 } 3307 }
3287 3308
@@ -3501,7 +3522,7 @@ vncClient::SendCacheRectangles(const rfb::RectVector &amp;rects) @@ -3501,7 +3522,7 @@ vncClient::SendCacheRectangles(const rfb::RectVector &amp;rects)
3501 rfb::RectVector::const_iterator i; 3522 rfb::RectVector::const_iterator i;
3502 3523
3503 if (rects.size() == 0) return TRUE; 3524 if (rects.size() == 0) return TRUE;
3504 - vnclog.Print(LL_INTINFO, VNCLOG("******** Sending %d Cache Rects \r\n"), rects.size()); 3525 + vnclog.Print(LL_INTINFO, VNCLOG("******** Sending %d Cache Rects "), rects.size());
3505 3526
3506 // Work through the list of rectangles, sending each one 3527 // Work through the list of rectangles, sending each one
3507 for (i= rects.begin();i != rects.end();i++) 3528 for (i= rects.begin();i != rects.end();i++)
@@ -3658,7 +3679,7 @@ BOOL vncClient::SendCacheZip(const rfb::RectVector &amp;rects) @@ -3658,7 +3679,7 @@ BOOL vncClient::SendCacheZip(const rfb::RectVector &amp;rects)
3658 return false; 3679 return false;
3659 } 3680 }
3660 3681
3661 - vnclog.Print(LL_INTINFO, VNCLOG("*** Sending CacheZip Rects=%d Size=%d (%d)\r\n"), nNbCacheRects, maxCompSize, nNbCacheRects * 14); 3682 + vnclog.Print(LL_INTINFO, VNCLOG("*** Sending CacheZip Rects=%d Size=%d (%d)"), nNbCacheRects, maxCompSize, nNbCacheRects * 14);
3662 3683
3663 // Send the Update Rect header 3684 // Send the Update Rect header
3664 rfbFramebufferUpdateRectHeader CacheRectsHeader; 3685 rfbFramebufferUpdateRectHeader CacheRectsHeader;
@@ -3854,7 +3875,9 @@ void vncClient::ReceiveFileChunk(int nLen, int nSize) @@ -3854,7 +3875,9 @@ void vncClient::ReceiveFileChunk(int nLen, int nSize)
3854 return; 3875 return;
3855 } 3876 }
3856 3877
3857 - 3878 +/** Funcao que desativa o status de downloading, seta os tempos do arquivo
  3879 + atraves do handle e esvazia o buffer.
  3880 +*/
3858 void vncClient::FinishFileReception() 3881 void vncClient::FinishFileReception()
3859 { 3882 {
3860 if (!m_fFileDownloadRunning) 3883 if (!m_fFileDownloadRunning)
@@ -3928,6 +3951,14 @@ void vncClient::FinishFileReception() @@ -3928,6 +3951,14 @@ void vncClient::FinishFileReception()
3928 if (m_pBuff != NULL) 3951 if (m_pBuff != NULL)
3929 delete [] m_pBuff; 3952 delete [] m_pBuff;
3930 3953
  3954 + time_t now = time(0);
  3955 + struct tm ts;
  3956 + char data_tf[20];
  3957 + ts = *localtime(&now);
  3958 + strftime(data_tf, sizeof(data_tf), "%d/%m/%Y %H:%M:%S", &ts);
  3959 +
  3960 + vnclog.Print(LL_INTINFO,VNCLOG(">>>>>UPLOAD: %s - %s - %s - %s"),
  3961 + data_tf, m_szFullDestName, m_szFileTime, m_szSrcFileName);
3931 return; 3962 return;
3932 3963
3933 } 3964 }
@@ -3979,6 +4010,10 @@ void vncClient::SendFileChunk() @@ -3979,6 +4010,10 @@ void vncClient::SendFileChunk()
3979 4010
3980 if (fAlreadyThere) 4011 if (fAlreadyThere)
3981 { 4012 {
  4013 + /** Aqui seta um terceiro passo na sequencia de transferencia. Logo apos iniciada (UPLOAD ou DOWNLOAD),
  4014 + * foi setada a transferencia de header, e agora como terceiro passo, a transferencia de packet VAZIO.
  4015 + * Isso porque o arquivo ja foi constatado estar no destino.
  4016 + */
3982 // Send the FileTransferMsg with empty rfbFilePacket 4017 // Send the FileTransferMsg with empty rfbFilePacket
3983 rfbFileTransferMsg ft; 4018 rfbFileTransferMsg ft;
3984 ft.type = rfbFileTransfer; 4019 ft.type = rfbFileTransfer;
@@ -4003,7 +4038,7 @@ void vncClient::SendFileChunk() @@ -4003,7 +4038,7 @@ void vncClient::SendFileChunk()
4003 4038
4004 if (nRetC != 0) 4039 if (nRetC != 0)
4005 { 4040 {
4006 - vnclog.Print(LL_INTINFO, VNCLOG("Compress returned error in File Send :%d\n"), nRetC); 4041 + vnclog.Print(LL_INTINFO, VNCLOG("Compress returned error in File Send :%d"), nRetC);
4007 // Todo: send data uncompressed instead 4042 // Todo: send data uncompressed instead
4008 m_fFileUploadError = true; 4043 m_fFileUploadError = true;
4009 FinishFileSending(); 4044 FinishFileSending();
@@ -4016,7 +4051,9 @@ void vncClient::SendFileChunk() @@ -4016,7 +4051,9 @@ void vncClient::SendFileChunk()
4016 if (nMaxCompSize > m_dwNbBytesRead) 4051 if (nMaxCompSize > m_dwNbBytesRead)
4017 fCompressed = false; 4052 fCompressed = false;
4018 // m_fCompressionEnabled = false; 4053 // m_fCompressionEnabled = false;
4019 - 4054 + /** Nesse momento, como no case anterior, ele seta o terceiro passo na transferencia, a transferencia de Packet.
  4055 + * Em diferenca, no passo anterior, o arquivo foi comprimido, e agora segue em sequencia a transferencia de Packet.
  4056 + */
4020 rfbFileTransferMsg ft; 4057 rfbFileTransferMsg ft;
4021 4058
4022 ft.type = rfbFileTransfer; 4059 ft.type = rfbFileTransfer;
@@ -4110,7 +4147,7 @@ bool vncClient::GetSpecialFolderPath(int nId, char* szPath) @@ -4110,7 +4147,7 @@ bool vncClient::GetSpecialFolderPath(int nId, char* szPath)
4110 // 4147 //
4111 int vncClient::ZipPossibleDirectory(LPSTR szSrcFileName) 4148 int vncClient::ZipPossibleDirectory(LPSTR szSrcFileName)
4112 { 4149 {
4113 -// vnclog.Print(0, _T("ZipPossibleDirectory\n")); 4150 +// vnclog.Print(0, _T("ZipPossibleDirectory"));
4114 char* p1 = strrchr(szSrcFileName, '\\') + 1; 4151 char* p1 = strrchr(szSrcFileName, '\\') + 1;
4115 char* p2 = strrchr(szSrcFileName, rfbDirSuffix[0]); 4152 char* p2 = strrchr(szSrcFileName, rfbDirSuffix[0]);
4116 if ( 4153 if (
@@ -4196,7 +4233,7 @@ int vncClient::CheckAndZipDirectoryForChecksuming(LPSTR szSrcFileName) @@ -4196,7 +4233,7 @@ int vncClient::CheckAndZipDirectoryForChecksuming(LPSTR szSrcFileName)
4196 // 4233 //
4197 int vncClient::UnzipPossibleDirectory(LPSTR szFileName) 4234 int vncClient::UnzipPossibleDirectory(LPSTR szFileName)
4198 { 4235 {
4199 -// vnclog.Print(0, _T("UnzipPossibleDirectory\n")); 4236 +// vnclog.Print(0, _T("UnzipPossibleDirectory"));
4200 if (!m_fFileDownloadError 4237 if (!m_fFileDownloadError
4201 && 4238 &&
4202 !strncmp(strrchr(szFileName, '\\') + 1, rfbZipDirectoryPrefix, strlen(rfbZipDirectoryPrefix)) 4239 !strncmp(strrchr(szFileName, '\\') + 1, rfbZipDirectoryPrefix, strlen(rfbZipDirectoryPrefix))
@@ -4253,26 +4290,26 @@ bool vncClient::MyGetFileSize(char* szFilePath, ULARGE_INTEGER *n2FileSize) @@ -4253,26 +4290,26 @@ bool vncClient::MyGetFileSize(char* szFilePath, ULARGE_INTEGER *n2FileSize)
4253 4290
4254 bool vncClient::DoFTUserImpersonation() 4291 bool vncClient::DoFTUserImpersonation()
4255 { 4292 {
4256 - vnclog.Print(LL_INTERR, VNCLOG("%%%%%%%%%%%%% vncClient::DoFTUserImpersonation - Call\n")); 4293 + vnclog.Print(LL_INTERR, VNCLOG("%%%%%%%%%%%%% vncClient::DoFTUserImpersonation - Call"));
4257 omni_mutex_lock l(GetUpdateLock()); 4294 omni_mutex_lock l(GetUpdateLock());
4258 4295
4259 if (m_fFileDownloadRunning) return true; 4296 if (m_fFileDownloadRunning) return true;
4260 if (m_fFileUploadRunning) return true; 4297 if (m_fFileUploadRunning) return true;
4261 if (m_fFTUserImpersonatedOk) return true; 4298 if (m_fFTUserImpersonatedOk) return true;
4262 4299
4263 - vnclog.Print(LL_INTERR, VNCLOG("%%%%%%%%%%%%% vncClient::DoFTUserImpersonation - 1\n")); 4300 + vnclog.Print(LL_INTERR, VNCLOG("%%%%%%%%%%%%% vncClient::DoFTUserImpersonation - 1"));
4264 bool fUserOk = true; 4301 bool fUserOk = true;
4265 4302
4266 if (vncService::IsWSLocked()) 4303 if (vncService::IsWSLocked())
4267 { 4304 {
4268 m_fFTUserImpersonatedOk = false; 4305 m_fFTUserImpersonatedOk = false;
4269 - vnclog.Print(LL_INTERR, VNCLOG("%%%%%%%%%%%%% vncClient::DoFTUserImpersonation - WSLocked\n")); 4306 + vnclog.Print(LL_INTERR, VNCLOG("%%%%%%%%%%%%% vncClient::DoFTUserImpersonation - WSLocked"));
4270 return false; 4307 return false;
4271 } 4308 }
4272 4309
4273 char username[UNLEN+1]; 4310 char username[UNLEN+1];
4274 vncService::CurrentUser((char *)&username, sizeof(username)); 4311 vncService::CurrentUser((char *)&username, sizeof(username));
4275 - vnclog.Print(LL_INTERR, VNCLOG("%%%%%%%%%%%%% vncClient::DoFTUserImpersonation - currentUser = %s\n"), username); 4312 + vnclog.Print(LL_INTERR, VNCLOG("%%%%%%%%%%%%% vncClient::DoFTUserImpersonation - currentUser = %s"), username);
4276 if (strcmp(username, "") != 0) 4313 if (strcmp(username, "") != 0)
4277 { 4314 {
4278 // sf@2007 - New method to achieve FTUserImpersonation - Still needs to be further tested... 4315 // sf@2007 - New method to achieve FTUserImpersonation - Still needs to be further tested...
@@ -4287,14 +4324,14 @@ bool vncClient::DoFTUserImpersonation() @@ -4287,14 +4324,14 @@ bool vncClient::DoFTUserImpersonation()
4287 ) 4324 )
4288 ) 4325 )
4289 { 4326 {
4290 - vnclog.Print(LL_INTERR, VNCLOG("%%%%%%%%%%%%% vncClient::DoFTUserImpersonation - OpenProcessToken Error\n")); 4327 + vnclog.Print(LL_INTERR, VNCLOG("%%%%%%%%%%%%% vncClient::DoFTUserImpersonation - OpenProcessToken Error"));
4291 fUserOk = false; 4328 fUserOk = false;
4292 } 4329 }
4293 else 4330 else
4294 { 4331 {
4295 if (!ImpersonateLoggedOnUser(hPToken)) 4332 if (!ImpersonateLoggedOnUser(hPToken))
4296 { 4333 {
4297 - vnclog.Print(LL_INTERR, VNCLOG("%%%%%%%%%%%%% vncClient::DoFTUserImpersonation - ImpersonateLoggedOnUser Failed\n")); 4334 + vnclog.Print(LL_INTERR, VNCLOG("%%%%%%%%%%%%% vncClient::DoFTUserImpersonation - ImpersonateLoggedOnUser Failed"));
4298 fUserOk = false; 4335 fUserOk = false;
4299 } 4336 }
4300 } 4337 }
@@ -4307,27 +4344,27 @@ bool vncClient::DoFTUserImpersonation() @@ -4307,27 +4344,27 @@ bool vncClient::DoFTUserImpersonation()
4307 // Modif Byteboon (Jeremy C.) - Impersonnation 4344 // Modif Byteboon (Jeremy C.) - Impersonnation
4308 if (m_server->m_impersonationtoken) 4345 if (m_server->m_impersonationtoken)
4309 { 4346 {
4310 - vnclog.Print(LL_INTERR, VNCLOG("%%%%%%%%%%%%% vncClient::DoFTUserImpersonation - Impersonationtoken exists\n")); 4347 + vnclog.Print(LL_INTERR, VNCLOG("%%%%%%%%%%%%% vncClient::DoFTUserImpersonation - Impersonationtoken exists"));
4311 HANDLE newToken; 4348 HANDLE newToken;
4312 if (DuplicateToken(m_server->m_impersonationtoken, SecurityImpersonation, &newToken)) 4349 if (DuplicateToken(m_server->m_impersonationtoken, SecurityImpersonation, &newToken))
4313 { 4350 {
4314 - vnclog.Print(LL_INTERR, VNCLOG("%%%%%%%%%%%%% vncClient::DoFTUserImpersonation - DuplicateToken ok\n")); 4351 + vnclog.Print(LL_INTERR, VNCLOG("%%%%%%%%%%%%% vncClient::DoFTUserImpersonation - DuplicateToken ok"));
4315 if(!ImpersonateLoggedOnUser(newToken)) 4352 if(!ImpersonateLoggedOnUser(newToken))
4316 { 4353 {
4317 - vnclog.Print(LL_INTERR, VNCLOG("%%%%%%%%%%%%% vncClient::DoFTUserImpersonation - failed to impersonate [%d]\n"),GetLastError()); 4354 + vnclog.Print(LL_INTERR, VNCLOG("%%%%%%%%%%%%% vncClient::DoFTUserImpersonation - failed to impersonate [%d]"),GetLastError());
4318 fUserOk = false; 4355 fUserOk = false;
4319 } 4356 }
4320 CloseHandle(newToken); 4357 CloseHandle(newToken);
4321 } 4358 }
4322 else 4359 else
4323 { 4360 {
4324 - vnclog.Print(LL_INTERR, VNCLOG("%%%%%%%%%%%%% vncClient::DoFTUserImpersonation - DuplicateToken FAILEDk\n")); 4361 + vnclog.Print(LL_INTERR, VNCLOG("%%%%%%%%%%%%% vncClient::DoFTUserImpersonation - DuplicateToken FAILEDk"));
4325 fUserOk = false; 4362 fUserOk = false;
4326 } 4363 }
4327 } 4364 }
4328 else 4365 else
4329 { 4366 {
4330 - vnclog.Print(LL_INTERR, VNCLOG("%%%%%%%%%%%%% vncClient::DoFTUserImpersonation - No impersonationtoken\n")); 4367 + vnclog.Print(LL_INTERR, VNCLOG("%%%%%%%%%%%%% vncClient::DoFTUserImpersonation - No impersonationtoken"));
4331 fUserOk = false; 4368 fUserOk = false;
4332 } 4369 }
4333 */ 4370 */
@@ -4352,17 +4389,17 @@ bool vncClient::DoFTUserImpersonation() @@ -4352,17 +4389,17 @@ bool vncClient::DoFTUserImpersonation()
4352 4389
4353 void vncClient::UndoFTUserImpersonation() 4390 void vncClient::UndoFTUserImpersonation()
4354 { 4391 {
4355 - //vnclog.Print(LL_INTERR, VNCLOG("%%%%%%%%%%%%% vncClient::UNDoFTUserImpersonation - Call\n")); 4392 + //vnclog.Print(LL_INTERR, VNCLOG("%%%%%%%%%%%%% vncClient::UNDoFTUserImpersonation - Call"));
4356 omni_mutex_lock l(GetUpdateLock()); 4393 omni_mutex_lock l(GetUpdateLock());
4357 4394
4358 if (!m_fFTUserImpersonatedOk) return; 4395 if (!m_fFTUserImpersonatedOk) return;
4359 if (m_fFileDownloadRunning) return; 4396 if (m_fFileDownloadRunning) return;
4360 if (m_fFileUploadRunning) return; 4397 if (m_fFileUploadRunning) return;
4361 4398
4362 - vnclog.Print(LL_INTERR, VNCLOG("%%%%%%%%%%%%% vncClient::UNDoFTUserImpersonation - 1\n")); 4399 + vnclog.Print(LL_INTERR, VNCLOG("%%%%%%%%%%%%% vncClient::UNDoFTUserImpersonation - 1"));
4363 DWORD lTime = timeGetTime(); 4400 DWORD lTime = timeGetTime();
4364 if (lTime - m_lLastFTUserImpersonationTime < 10000) return; 4401 if (lTime - m_lLastFTUserImpersonationTime < 10000) return;
4365 - vnclog.Print(LL_INTERR, VNCLOG("%%%%%%%%%%%%% vncClient::UNDoFTUserImpersonation - Impersonationtoken exists\n")); 4402 + vnclog.Print(LL_INTERR, VNCLOG("%%%%%%%%%%%%% vncClient::UNDoFTUserImpersonation - Impersonationtoken exists"));
4366 RevertToSelf(); 4403 RevertToSelf();
4367 m_fFTUserImpersonatedOk = false; 4404 m_fFTUserImpersonatedOk = false;
4368 } 4405 }
srcacic/WinVNC/WinVNC/vncdesktop.cpp
@@ -148,13 +148,13 @@ vncDesktop::FastDetectChanges(rfb::Region2D &amp;rgn, rfb::Rect &amp;rect, int nZone, bo @@ -148,13 +148,13 @@ vncDesktop::FastDetectChanges(rfb::Region2D &amp;rgn, rfb::Rect &amp;rect, int nZone, bo
148 if (pList != NULL) 148 if (pList != NULL)
149 { 149 {
150 m_lGridsList.push_back(pList); 150 m_lGridsList.push_back(pList);
151 - vnclog.Print(LL_INTINFO, VNCLOG("### PixelsGrid %d created !\n"), i); 151 + vnclog.Print(LL_INTINFO, VNCLOG("### PixelsGrid %d created !"), i);
152 } 152 }
153 } 153 }
154 } 154 }
155 155
156 // We test one zone at a time 156 // We test one zone at a time
157 - // vnclog.Print(LL_INTINFO, VNCLOG("### Polling Grid %d - SubGrid %d\n"), nZone, m_nGridCycle); 157 + // vnclog.Print(LL_INTINFO, VNCLOG("### Polling Grid %d - SubGrid %d"), nZone, m_nGridCycle);
158 GridsList::iterator iGrid; 158 GridsList::iterator iGrid;
159 int nIndex = 0; 159 int nIndex = 0;
160 int nGridPos = (nZone * PIXEL_BLOCK_SIZE / GRID_OFFSET) + m_nGridCycle; 160 int nGridPos = (nZone * PIXEL_BLOCK_SIZE / GRID_OFFSET) + m_nGridCycle;
@@ -171,13 +171,13 @@ vncDesktop::FastDetectChanges(rfb::Region2D &amp;rgn, rfb::Rect &amp;rect, int nZone, bo @@ -171,13 +171,13 @@ vncDesktop::FastDetectChanges(rfb::Region2D &amp;rgn, rfb::Rect &amp;rect, int nZone, bo
171 171
172 if (nZone == 0 || nZone == 4) 172 if (nZone == 0 || nZone == 4)
173 { 173 {
174 - // vnclog.Print(LL_INTINFO, VNCLOG("### IncCycle Please !\n")); 174 + // vnclog.Print(LL_INTINFO, VNCLOG("### IncCycle Please !"));
175 fIncCycle = true; 175 fIncCycle = true;
176 } 176 }
177 177
178 if (pThePixelGrid->empty()) 178 if (pThePixelGrid->empty())
179 { 179 {
180 - // vnclog.Print(LL_INTINFO, VNCLOG("### PixelsGrid Init\n")); 180 + // vnclog.Print(LL_INTINFO, VNCLOG("### PixelsGrid Init"));
181 fInitGrid = true; 181 fInitGrid = true;
182 } 182 }
183 183
@@ -199,7 +199,7 @@ vncDesktop::FastDetectChanges(rfb::Region2D &amp;rgn, rfb::Rect &amp;rect, int nZone, bo @@ -199,7 +199,7 @@ vncDesktop::FastDetectChanges(rfb::Region2D &amp;rgn, rfb::Rect &amp;rect, int nZone, bo
199 if (OSversion()==2) PixelColor= CapturePixel( xo, yo); 199 if (OSversion()==2) PixelColor= CapturePixel( xo, yo);
200 else PixelColor= GetPixel(m_hrootdc, xo, yo); 200 else PixelColor= GetPixel(m_hrootdc, xo, yo);
201 pThePixelGrid->push_back(PixelColor); 201 pThePixelGrid->push_back(PixelColor);
202 - // vnclog.Print(LL_INTINFO, VNCLOG("### PixelsGrid Init : Pixel xo=%d - yo=%d - C=%ld\n"), xo, yo, (long)PixelColor); 202 + // vnclog.Print(LL_INTINFO, VNCLOG("### PixelsGrid Init : Pixel xo=%d - yo=%d - C=%ld"), xo, yo, (long)PixelColor);
203 continue; 203 continue;
204 } 204 }
205 205
@@ -207,7 +207,7 @@ vncDesktop::FastDetectChanges(rfb::Region2D &amp;rgn, rfb::Rect &amp;rect, int nZone, bo @@ -207,7 +207,7 @@ vncDesktop::FastDetectChanges(rfb::Region2D &amp;rgn, rfb::Rect &amp;rect, int nZone, bo
207 COLORREF PixelColor=0; 207 COLORREF PixelColor=0;
208 if (OSversion()==2 ) PixelColor = CapturePixel( xo, yo); 208 if (OSversion()==2 ) PixelColor = CapturePixel( xo, yo);
209 else PixelColor = GetPixel(m_hrootdc, xo, yo); 209 else PixelColor = GetPixel(m_hrootdc, xo, yo);
210 -// vnclog.Print(LL_INTINFO, VNCLOG("### GetPixel %i\n"),OSversion()); 210 +// vnclog.Print(LL_INTINFO, VNCLOG("### GetPixel %i"),OSversion());
211 // If the pixel has changed 211 // If the pixel has changed
212 if (*iPixelColor != PixelColor ) 212 if (*iPixelColor != PixelColor )
213 { 213 {
@@ -253,7 +253,7 @@ vncDesktop::FastDetectChanges(rfb::Region2D &amp;rgn, rfb::Rect &amp;rect, int nZone, bo @@ -253,7 +253,7 @@ vncDesktop::FastDetectChanges(rfb::Region2D &amp;rgn, rfb::Rect &amp;rect, int nZone, bo
253 } 253 }
254 // char szName[64]; 254 // char szName[64];
255 // GetWindowText(hwnd, szName, 64); 255 // GetWindowText(hwnd, szName, 64);
256 - // vnclog.Print(LL_INTINFO, VNCLOG("### Changed Window : %s (at x=%d - y=%d)\n"), szName, x, y); 256 + // vnclog.Print(LL_INTINFO, VNCLOG("### Changed Window : %s (at x=%d - y=%d)"), szName, x, y);
257 // return; 257 // return;
258 } 258 }
259 } 259 }
@@ -380,7 +380,7 @@ vncDesktop::vncDesktop() @@ -380,7 +380,7 @@ vncDesktop::vncDesktop()
380 380
381 vncDesktop::~vncDesktop() 381 vncDesktop::~vncDesktop()
382 { 382 {
383 - vnclog.Print(LL_INTINFO, VNCLOG("killing screen server\n")); 383 + vnclog.Print(LL_INTINFO, VNCLOG("killing screen server"));
384 384
385 // If we created a thread then here we delete it 385 // If we created a thread then here we delete it
386 // The thread itself does most of the cleanup 386 // The thread itself does most of the cleanup
@@ -472,12 +472,12 @@ vncDesktop::Startup() @@ -472,12 +472,12 @@ vncDesktop::Startup()
472 472
473 if (!InitDesktop()) 473 if (!InitDesktop())
474 { 474 {
475 - vnclog.Print(LL_INTINFO, VNCLOG("InitDesktop Failed\n")); 475 + vnclog.Print(LL_INTINFO, VNCLOG("InitDesktop Failed"));
476 return FALSE; 476 return FALSE;
477 } 477 }
478 478
479 // Modif rdv@2002 - v1.1.x - videodriver 479 // Modif rdv@2002 - v1.1.x - videodriver
480 - vnclog.Print(LL_INTINFO, VNCLOG("InitVideo driver Called\n")); 480 + vnclog.Print(LL_INTINFO, VNCLOG("InitVideo driver Called"));
481 if (FALSE != DriverWantedSet) 481 if (FALSE != DriverWantedSet)
482 { 482 {
483 m_server->Driver(DriverWanted); 483 m_server->Driver(DriverWanted);
@@ -486,29 +486,29 @@ vncDesktop::Startup() @@ -486,29 +486,29 @@ vncDesktop::Startup()
486 } 486 }
487 if (m_server->Driver()) 487 if (m_server->Driver())
488 { 488 {
489 - vnclog.Print(LL_INTINFO, VNCLOG("Driver option enabled \n")); 489 + vnclog.Print(LL_INTINFO, VNCLOG("Driver option enabled "));
490 if(OSversion()==1 || OSversion()==2 ) 490 if(OSversion()==1 || OSversion()==2 )
491 { 491 {
492 InitVideoDriver(); 492 InitVideoDriver();
493 } 493 }
494 } 494 }
495 - vnclog.Print(LL_INTINFO, VNCLOG("Driver option disabled \n")); 495 + vnclog.Print(LL_INTINFO, VNCLOG("Driver option disabled "));
496 if (m_Origpolling) m_server->PollFullScreen(m_Origpolling); 496 if (m_Origpolling) m_server->PollFullScreen(m_Origpolling);
497 m_OrigpollingSet=false; 497 m_OrigpollingSet=false;
498 498
499 if (VideoBuffer()) 499 if (VideoBuffer())
500 { 500 {
501 - vnclog.Print(LL_INTINFO, VNCLOG("Break log\n")); 501 + vnclog.Print(LL_INTINFO, VNCLOG("Break log"));
502 } 502 }
503 if (!InitBitmap()) 503 if (!InitBitmap())
504 { 504 {
505 - vnclog.Print(LL_INTINFO, VNCLOG("InitBitmap Failed\n")); 505 + vnclog.Print(LL_INTINFO, VNCLOG("InitBitmap Failed"));
506 return FALSE; 506 return FALSE;
507 } 507 }
508 508
509 if (!ThunkBitmapInfo()) 509 if (!ThunkBitmapInfo())
510 { 510 {
511 - vnclog.Print(LL_INTINFO, VNCLOG("ThunkBitmapInfo Failed\n")); 511 + vnclog.Print(LL_INTINFO, VNCLOG("ThunkBitmapInfo Failed"));
512 return FALSE; 512 return FALSE;
513 } 513 }
514 514
@@ -517,25 +517,25 @@ vncDesktop::Startup() @@ -517,25 +517,25 @@ vncDesktop::Startup()
517 517
518 if (!SetPixFormat()) 518 if (!SetPixFormat())
519 { 519 {
520 - vnclog.Print(LL_INTINFO, VNCLOG("SetPixFormat Failed\n")); 520 + vnclog.Print(LL_INTINFO, VNCLOG("SetPixFormat Failed"));
521 return FALSE; 521 return FALSE;
522 } 522 }
523 523
524 if (!SetPixShifts()) 524 if (!SetPixShifts())
525 { 525 {
526 - vnclog.Print(LL_INTINFO, VNCLOG("SetPixShift Failed\n")); 526 + vnclog.Print(LL_INTINFO, VNCLOG("SetPixShift Failed"));
527 return FALSE; 527 return FALSE;
528 } 528 }
529 529
530 if (!SetPalette()) 530 if (!SetPalette())
531 { 531 {
532 - vnclog.Print(LL_INTINFO, VNCLOG("SetPalette Failed\n")); 532 + vnclog.Print(LL_INTINFO, VNCLOG("SetPalette Failed"));
533 return FALSE; 533 return FALSE;
534 } 534 }
535 535
536 if (!InitWindow()) 536 if (!InitWindow())
537 { 537 {
538 - vnclog.Print(LL_INTINFO, VNCLOG("InitWindow failed\n")); 538 + vnclog.Print(LL_INTINFO, VNCLOG("InitWindow failed"));
539 return FALSE; 539 return FALSE;
540 } 540 }
541 541
@@ -543,7 +543,7 @@ vncDesktop::Startup() @@ -543,7 +543,7 @@ vncDesktop::Startup()
543 { 543 {
544 if (VideoBuffer()) 544 if (VideoBuffer())
545 { 545 {
546 - vnclog.Print(LL_INTINFO, VNCLOG("Removing real Dib buffer and replace by driver communication buffer\n")); 546 + vnclog.Print(LL_INTINFO, VNCLOG("Removing real Dib buffer and replace by driver communication buffer"));
547 if (m_membitmap != NULL) 547 if (m_membitmap != NULL)
548 { 548 {
549 DeleteObject(m_membitmap); 549 DeleteObject(m_membitmap);
@@ -597,7 +597,7 @@ vncDesktop::Shutdown() @@ -597,7 +597,7 @@ vncDesktop::Shutdown()
597 if (m_hrootdc != NULL) 597 if (m_hrootdc != NULL)
598 { 598 {
599 if (!DeleteDC(m_hrootdc)) 599 if (!DeleteDC(m_hrootdc))
600 - vnclog.Print(LL_INTERR, VNCLOG("failed to DeleteDC hrootdc\n")); 600 + vnclog.Print(LL_INTERR, VNCLOG("failed to DeleteDC hrootdc"));
601 m_hrootdc = NULL; 601 m_hrootdc = NULL;
602 } 602 }
603 if (m_hmemdc != NULL) 603 if (m_hmemdc != NULL)
@@ -605,7 +605,7 @@ vncDesktop::Shutdown() @@ -605,7 +605,7 @@ vncDesktop::Shutdown()
605 // Release our device context 605 // Release our device context
606 if (!DeleteDC(m_hmemdc)) 606 if (!DeleteDC(m_hmemdc))
607 { 607 {
608 - vnclog.Print(LL_INTERR, VNCLOG("failed to DeleteDC hmemdc\n")); 608 + vnclog.Print(LL_INTERR, VNCLOG("failed to DeleteDC hmemdc"));
609 } 609 }
610 m_hmemdc = NULL; 610 m_hmemdc = NULL;
611 } 611 }
@@ -614,7 +614,7 @@ vncDesktop::Shutdown() @@ -614,7 +614,7 @@ vncDesktop::Shutdown()
614 // Release the custom bitmap, if any 614 // Release the custom bitmap, if any
615 if (!DeleteObject(m_membitmap)) 615 if (!DeleteObject(m_membitmap))
616 { 616 {
617 - vnclog.Print(LL_INTERR, VNCLOG("failed to DeleteObject\n")); 617 + vnclog.Print(LL_INTERR, VNCLOG("failed to DeleteObject"));
618 } 618 }
619 m_membitmap = NULL; 619 m_membitmap = NULL;
620 } 620 }
@@ -659,7 +659,7 @@ vncDesktop::KillScreenSaver() @@ -659,7 +659,7 @@ vncDesktop::KillScreenSaver()
659 if (!GetVersionEx(&osversioninfo)) 659 if (!GetVersionEx(&osversioninfo))
660 return; 660 return;
661 661
662 - vnclog.Print(LL_INTINFO, VNCLOG("KillScreenSaver...\n")); 662 + vnclog.Print(LL_INTINFO, VNCLOG("KillScreenSaver..."));
663 663
664 // How to kill the screen saver depends on the OS 664 // How to kill the screen saver depends on the OS
665 switch (osversioninfo.dwPlatformId) 665 switch (osversioninfo.dwPlatformId)
@@ -687,7 +687,7 @@ vncDesktop::KillScreenSaver() @@ -687,7 +687,7 @@ vncDesktop::KillScreenSaver()
687 ); 687 );
688 if (hDesk != NULL) 688 if (hDesk != NULL)
689 { 689 {
690 - vnclog.Print(LL_INTINFO, VNCLOG("Killing ScreenSaver\n")); 690 + vnclog.Print(LL_INTINFO, VNCLOG("Killing ScreenSaver"));
691 691
692 // Close all windows on the screen saver desktop 692 // Close all windows on the screen saver desktop
693 EnumDesktopWindows(hDesk, (WNDENUMPROC) &KillScreenSaverFunc, 0); 693 EnumDesktopWindows(hDesk, (WNDENUMPROC) &KillScreenSaverFunc, 0);
@@ -794,7 +794,7 @@ vncDesktop::InitBitmap() @@ -794,7 +794,7 @@ vncDesktop::InitBitmap()
794 } 794 }
795 795
796 if (m_hrootdc == NULL) { 796 if (m_hrootdc == NULL) {
797 - vnclog.Print(LL_INTERR, VNCLOG("No driver used \n")); 797 + vnclog.Print(LL_INTERR, VNCLOG("No driver used "));
798 //Multi-Monitor changes 798 //Multi-Monitor changes
799 Checkmonitors(); 799 Checkmonitors();
800 asked_display=m_buffer.GetDisplay(); 800 asked_display=m_buffer.GetDisplay();
@@ -822,19 +822,19 @@ vncDesktop::InitBitmap() @@ -822,19 +822,19 @@ vncDesktop::InitBitmap()
822 m_ScreenOffsety=mymonitor[2].offsety;; 822 m_ScreenOffsety=mymonitor[2].offsety;;
823 } 823 }
824 if (m_hrootdc == NULL) { 824 if (m_hrootdc == NULL) {
825 - vnclog.Print(LL_INTERR, VNCLOG("Failed m_rootdc \n")); 825 + vnclog.Print(LL_INTERR, VNCLOG("Failed m_rootdc "));
826 return FALSE; 826 return FALSE;
827 } 827 }
828 828
829 } 829 }
830 if (current_monitor==3 && !VideoBuffer()) m_bmrect = rfb::Rect(0, 0,mymonitor[2].Width,mymonitor[2].Height); 830 if (current_monitor==3 && !VideoBuffer()) m_bmrect = rfb::Rect(0, 0,mymonitor[2].Width,mymonitor[2].Height);
831 else m_bmrect = rfb::Rect(0, 0,GetDeviceCaps(m_hrootdc, HORZRES),GetDeviceCaps(m_hrootdc, VERTRES)); 831 else m_bmrect = rfb::Rect(0, 0,GetDeviceCaps(m_hrootdc, HORZRES),GetDeviceCaps(m_hrootdc, VERTRES));
832 - vnclog.Print(LL_INTINFO, VNCLOG("bitmap dimensions are %d x %d\n"), m_bmrect.br.x, m_bmrect.br.y); 832 + vnclog.Print(LL_INTINFO, VNCLOG("bitmap dimensions are %d x %d"), m_bmrect.br.x, m_bmrect.br.y);
833 833
834 // Create a compatible memory DC 834 // Create a compatible memory DC
835 m_hmemdc = CreateCompatibleDC(m_hrootdc); 835 m_hmemdc = CreateCompatibleDC(m_hrootdc);
836 if (m_hmemdc == NULL) { 836 if (m_hmemdc == NULL) {
837 - vnclog.Print(LL_INTERR, VNCLOG("failed to create compatibleDC(%d)\n"), GetLastError()); 837 + vnclog.Print(LL_INTERR, VNCLOG("failed to create compatibleDC(%d)"), GetLastError());
838 return FALSE; 838 return FALSE;
839 } 839 }
840 840
@@ -865,10 +865,10 @@ vncDesktop::InitBitmap() @@ -865,10 +865,10 @@ vncDesktop::InitBitmap()
865 // Create the bitmap to be compatible with the ROOT DC!!! 865 // Create the bitmap to be compatible with the ROOT DC!!!
866 m_membitmap = CreateCompatibleBitmap(m_hrootdc, m_bmrect.br.x, m_bmrect.br.y); 866 m_membitmap = CreateCompatibleBitmap(m_hrootdc, m_bmrect.br.x, m_bmrect.br.y);
867 if (m_membitmap == NULL) { 867 if (m_membitmap == NULL) {
868 - vnclog.Print(LL_INTERR, VNCLOG("failed to create memory bitmap(%d)\n"), GetLastError()); 868 + vnclog.Print(LL_INTERR, VNCLOG("failed to create memory bitmap(%d)"), GetLastError());
869 return FALSE; 869 return FALSE;
870 } 870 }
871 - vnclog.Print(LL_INTINFO, VNCLOG("created memory bitmap\n")); 871 + vnclog.Print(LL_INTINFO, VNCLOG("created memory bitmap"));
872 872
873 // Get the bitmap's format and colour details 873 // Get the bitmap's format and colour details
874 int result; 874 int result;
@@ -877,15 +877,15 @@ vncDesktop::InitBitmap() @@ -877,15 +877,15 @@ vncDesktop::InitBitmap()
877 m_bminfo.bmi.bmiHeader.biBitCount = 0; 877 m_bminfo.bmi.bmiHeader.biBitCount = 0;
878 result = ::GetDIBits(m_hmemdc, m_membitmap, 0, 1, NULL, &m_bminfo.bmi, DIB_RGB_COLORS); 878 result = ::GetDIBits(m_hmemdc, m_membitmap, 0, 1, NULL, &m_bminfo.bmi, DIB_RGB_COLORS);
879 if (result == 0) { 879 if (result == 0) {
880 - vnclog.Print(LL_INTERR, VNCLOG("unable to get display format\n")); 880 + vnclog.Print(LL_INTERR, VNCLOG("unable to get display format"));
881 return FALSE; 881 return FALSE;
882 } 882 }
883 result = ::GetDIBits(m_hmemdc, m_membitmap, 0, 1, NULL, &m_bminfo.bmi, DIB_RGB_COLORS); 883 result = ::GetDIBits(m_hmemdc, m_membitmap, 0, 1, NULL, &m_bminfo.bmi, DIB_RGB_COLORS);
884 if (result == 0) { 884 if (result == 0) {
885 - vnclog.Print(LL_INTERR, VNCLOG("unable to get display colour info\n")); 885 + vnclog.Print(LL_INTERR, VNCLOG("unable to get display colour info"));
886 return FALSE; 886 return FALSE;
887 } 887 }
888 - vnclog.Print(LL_INTINFO, VNCLOG("got bitmap format\n")); 888 + vnclog.Print(LL_INTINFO, VNCLOG("got bitmap format"));
889 889
890 // Henceforth we want to use a top-down scanning representation 890 // Henceforth we want to use a top-down scanning representation
891 m_bminfo.bmi.bmiHeader.biHeight = - abs(m_bminfo.bmi.bmiHeader.biHeight); 891 m_bminfo.bmi.bmiHeader.biHeight = - abs(m_bminfo.bmi.bmiHeader.biHeight);
@@ -913,7 +913,7 @@ vncDesktop::ThunkBitmapInfo() @@ -913,7 +913,7 @@ vncDesktop::ThunkBitmapInfo()
913 { 913 {
914 case 1: 914 case 1:
915 case 4: 915 case 4:
916 - vnclog.Print(LL_INTINFO, VNCLOG("DBG:used/bits/planes/comp/size = %d/%d/%d/%d/%d\n"), 916 + vnclog.Print(LL_INTINFO, VNCLOG("DBG:used/bits/planes/comp/size = %d/%d/%d/%d/%d"),
917 (int)m_bminfo.bmi.bmiHeader.biClrUsed, 917 (int)m_bminfo.bmi.bmiHeader.biClrUsed,
918 (int)m_bminfo.bmi.bmiHeader.biBitCount, 918 (int)m_bminfo.bmi.bmiHeader.biBitCount,
919 (int)m_bminfo.bmi.bmiHeader.biPlanes, 919 (int)m_bminfo.bmi.bmiHeader.biPlanes,
@@ -958,9 +958,9 @@ vncDesktop::SetPixFormat() @@ -958,9 +958,9 @@ vncDesktop::SetPixFormat()
958 // If we are using a memory bitmap then check how many planes it uses 958 // If we are using a memory bitmap then check how many planes it uses
959 // The VNC code can only handle formats with a single plane (CHUNKY pixels) 959 // The VNC code can only handle formats with a single plane (CHUNKY pixels)
960 if (!m_DIBbits) { 960 if (!m_DIBbits) {
961 - vnclog.Print(LL_INTINFO, VNCLOG("DBG:display context has %d planes!\n"), 961 + vnclog.Print(LL_INTINFO, VNCLOG("DBG:display context has %d planes!"),
962 GetDeviceCaps(m_hrootdc, PLANES)); 962 GetDeviceCaps(m_hrootdc, PLANES));
963 - vnclog.Print(LL_INTINFO, VNCLOG("DBG:memory context has %d planes!\n"), 963 + vnclog.Print(LL_INTINFO, VNCLOG("DBG:memory context has %d planes!"),
964 GetDeviceCaps(m_hmemdc, PLANES)); 964 GetDeviceCaps(m_hmemdc, PLANES));
965 if (GetDeviceCaps(m_hmemdc, PLANES) != 1) 965 if (GetDeviceCaps(m_hmemdc, PLANES) != 1)
966 { 966 {
@@ -1039,7 +1039,7 @@ vncDesktop::SetPixShifts() @@ -1039,7 +1039,7 @@ vncDesktop::SetPixShifts()
1039 // Other pixel formats are only valid if they're palette-based 1039 // Other pixel formats are only valid if they're palette-based
1040 if (m_bminfo.truecolour) 1040 if (m_bminfo.truecolour)
1041 { 1041 {
1042 - vnclog.Print(LL_INTERR, "unsupported truecolour pixel format for setpixshifts\n"); 1042 + vnclog.Print(LL_INTERR, "unsupported truecolour pixel format for setpixshifts");
1043 return FALSE; 1043 return FALSE;
1044 } 1044 }
1045 return TRUE; 1045 return TRUE;
@@ -1069,7 +1069,7 @@ vncDesktop::SetPalette() @@ -1069,7 +1069,7 @@ vncDesktop::SetPalette()
1069 1069
1070 palette = (LOGPALETTE *) new char[size]; 1070 palette = (LOGPALETTE *) new char[size];
1071 if (palette == NULL) { 1071 if (palette == NULL) {
1072 - vnclog.Print(LL_INTERR, VNCLOG("unable to allocate logical palette\n")); 1072 + vnclog.Print(LL_INTERR, VNCLOG("unable to allocate logical palette"));
1073 return FALSE; 1073 return FALSE;
1074 } 1074 }
1075 1075
@@ -1081,7 +1081,7 @@ vncDesktop::SetPalette() @@ -1081,7 +1081,7 @@ vncDesktop::SetPalette()
1081 if (GetSystemPaletteEntries(m_hrootdc, 1081 if (GetSystemPaletteEntries(m_hrootdc,
1082 0, 256, palette->palPalEntry) == 0) 1082 0, 256, palette->palPalEntry) == 0)
1083 { 1083 {
1084 - vnclog.Print(LL_INTERR, VNCLOG("unable to get system palette entries\n")); 1084 + vnclog.Print(LL_INTERR, VNCLOG("unable to get system palette entries"));
1085 delete [] palette; 1085 delete [] palette;
1086 return FALSE; 1086 return FALSE;
1087 } 1087 }
@@ -1090,7 +1090,7 @@ vncDesktop::SetPalette() @@ -1090,7 +1090,7 @@ vncDesktop::SetPalette()
1090 HPALETTE pal = CreatePalette(palette); 1090 HPALETTE pal = CreatePalette(palette);
1091 if (pal == NULL) 1091 if (pal == NULL)
1092 { 1092 {
1093 - vnclog.Print(LL_INTERR, VNCLOG("unable to create HPALETTE\n")); 1093 + vnclog.Print(LL_INTERR, VNCLOG("unable to create HPALETTE"));
1094 delete [] palette; 1094 delete [] palette;
1095 return FALSE; 1095 return FALSE;
1096 } 1096 }
@@ -1099,7 +1099,7 @@ vncDesktop::SetPalette() @@ -1099,7 +1099,7 @@ vncDesktop::SetPalette()
1099 HPALETTE oldpalette = SelectPalette(m_hmemdc, pal, FALSE); 1099 HPALETTE oldpalette = SelectPalette(m_hmemdc, pal, FALSE);
1100 if (oldpalette == NULL) 1100 if (oldpalette == NULL)
1101 { 1101 {
1102 - vnclog.Print(LL_INTERR, VNCLOG("unable to select() HPALETTE\n")); 1102 + vnclog.Print(LL_INTERR, VNCLOG("unable to select() HPALETTE"));
1103 delete [] palette; 1103 delete [] palette;
1104 DeleteObject(pal); 1104 DeleteObject(pal);
1105 return FALSE; 1105 return FALSE;
@@ -1107,13 +1107,13 @@ vncDesktop::SetPalette() @@ -1107,13 +1107,13 @@ vncDesktop::SetPalette()
1107 1107
1108 // Worked, so realise the palette 1108 // Worked, so realise the palette
1109 if (RealizePalette(m_hmemdc) == GDI_ERROR) 1109 if (RealizePalette(m_hmemdc) == GDI_ERROR)
1110 - vnclog.Print(LL_INTWARN, VNCLOG("warning - failed to RealizePalette\n")); 1110 + vnclog.Print(LL_INTWARN, VNCLOG("warning - failed to RealizePalette"));
1111 1111
1112 // It worked! 1112 // It worked!
1113 delete [] palette; 1113 delete [] palette;
1114 DeleteObject(oldpalette); 1114 DeleteObject(oldpalette);
1115 1115
1116 - vnclog.Print(LL_INTINFO, VNCLOG("initialised palette OK\n")); 1116 + vnclog.Print(LL_INTINFO, VNCLOG("initialised palette OK"));
1117 return TRUE; 1117 return TRUE;
1118 } 1118 }
1119 else 1119 else
@@ -1167,7 +1167,7 @@ vncDesktop::SetPalette() @@ -1167,7 +1167,7 @@ vncDesktop::SetPalette()
1167 } 1167 }
1168 1168
1169 // Not a palette based local screen - forget it! 1169 // Not a palette based local screen - forget it!
1170 - vnclog.Print(LL_INTERR, VNCLOG("no palette data for truecolour display\n")); 1170 + vnclog.Print(LL_INTERR, VNCLOG("no palette data for truecolour display"));
1171 return TRUE; 1171 return TRUE;
1172 } 1172 }
1173 //////////////////////////////////////////////////////////////////////////////// 1173 ////////////////////////////////////////////////////////////////////////////////
@@ -1282,7 +1282,7 @@ vncDesktop::InitWindow() @@ -1282,7 +1282,7 @@ vncDesktop::InitWindow()
1282 // Register it 1282 // Register it
1283 m_wndClass = RegisterClassEx(&wndclass); 1283 m_wndClass = RegisterClassEx(&wndclass);
1284 if (!m_wndClass) { 1284 if (!m_wndClass) {
1285 - vnclog.Print(LL_INTERR, VNCLOG("failed to register window class\n")); 1285 + vnclog.Print(LL_INTERR, VNCLOG("failed to register window class"));
1286 return FALSE; 1286 return FALSE;
1287 } 1287 }
1288 } 1288 }
@@ -1300,7 +1300,7 @@ vncDesktop::InitWindow() @@ -1300,7 +1300,7 @@ vncDesktop::InitWindow()
1300 NULL); 1300 NULL);
1301 1301
1302 if (m_hwnd == NULL) { 1302 if (m_hwnd == NULL) {
1303 - vnclog.Print(LL_INTERR, VNCLOG("failed to create hook window\n")); 1303 + vnclog.Print(LL_INTERR, VNCLOG("failed to create hook window"));
1304 return FALSE; 1304 return FALSE;
1305 } 1305 }
1306 1306
@@ -1331,13 +1331,13 @@ vncDesktop::InitWindow() @@ -1331,13 +1331,13 @@ vncDesktop::InitWindow()
1331 void 1331 void
1332 vncDesktop::EnableOptimisedBlits() 1332 vncDesktop::EnableOptimisedBlits()
1333 { 1333 {
1334 - vnclog.Print(LL_INTINFO, VNCLOG("attempting to enable DIBsection blits\n")); 1334 + vnclog.Print(LL_INTINFO, VNCLOG("attempting to enable DIBsection blits"));
1335 1335
1336 // Create a new DIB section 1336 // Create a new DIB section
1337 //HBITMAP tempbitmap=NULL; 1337 //HBITMAP tempbitmap=NULL;
1338 HBITMAP tempbitmap = CreateDIBSection(m_hmemdc, &m_bminfo.bmi, DIB_RGB_COLORS, &m_DIBbits, NULL, 0); 1338 HBITMAP tempbitmap = CreateDIBSection(m_hmemdc, &m_bminfo.bmi, DIB_RGB_COLORS, &m_DIBbits, NULL, 0);
1339 if (tempbitmap == NULL) { 1339 if (tempbitmap == NULL) {
1340 - vnclog.Print(LL_INTINFO, VNCLOG("failed to build DIB section - reverting to slow blits\n")); 1340 + vnclog.Print(LL_INTINFO, VNCLOG("failed to build DIB section - reverting to slow blits"));
1341 m_DIBbits = NULL; 1341 m_DIBbits = NULL;
1342 return; 1342 return;
1343 } 1343 }
@@ -1350,13 +1350,13 @@ vncDesktop::EnableOptimisedBlits() @@ -1350,13 +1350,13 @@ vncDesktop::EnableOptimisedBlits()
1350 1350
1351 // Replace old membitmap with DIB section 1351 // Replace old membitmap with DIB section
1352 m_membitmap = tempbitmap; 1352 m_membitmap = tempbitmap;
1353 - vnclog.Print(LL_INTINFO, VNCLOG("enabled fast DIBsection blits OK\n")); 1353 + vnclog.Print(LL_INTINFO, VNCLOG("enabled fast DIBsection blits OK"));
1354 } 1354 }
1355 1355
1356 BOOL 1356 BOOL
1357 vncDesktop::Init(vncServer *server) 1357 vncDesktop::Init(vncServer *server)
1358 { 1358 {
1359 - vnclog.Print(LL_INTINFO, VNCLOG("initialising desktop handler\n")); 1359 + vnclog.Print(LL_INTINFO, VNCLOG("initialising desktop handler"));
1360 1360
1361 // Save the server pointer 1361 // Save the server pointer
1362 m_server = server; 1362 m_server = server;
@@ -1374,7 +1374,7 @@ vncDesktop::Init(vncServer *server) @@ -1374,7 +1374,7 @@ vncDesktop::Init(vncServer *server)
1374 // Spawn a thread to handle that window's message queue 1374 // Spawn a thread to handle that window's message queue
1375 vncDesktopThread *thread = new vncDesktopThread; 1375 vncDesktopThread *thread = new vncDesktopThread;
1376 if (thread == NULL) { 1376 if (thread == NULL) {
1377 - vnclog.Print(LL_INTERR, VNCLOG("failed to start hook thread\n")); 1377 + vnclog.Print(LL_INTERR, VNCLOG("failed to start hook thread"));
1378 return FALSE; 1378 return FALSE;
1379 } 1379 }
1380 m_thread = thread; 1380 m_thread = thread;
@@ -1444,7 +1444,7 @@ vncDesktop::CaptureMouse(BYTE *scrBuff, UINT scrBuffSize) @@ -1444,7 +1444,7 @@ vncDesktop::CaptureMouse(BYTE *scrBuff, UINT scrBuffSize)
1444 // Get the cursor position 1444 // Get the cursor position
1445 if (!GetCursorPos(&CursorPos)) 1445 if (!GetCursorPos(&CursorPos))
1446 return; 1446 return;
1447 - //vnclog.Print(LL_INTINFO, VNCLOG("CursorPos %i %i\n"),CursorPos.x, CursorPos.y); 1447 + //vnclog.Print(LL_INTINFO, VNCLOG("CursorPos %i %i"),CursorPos.x, CursorPos.y);
1448 // Translate position for hotspot 1448 // Translate position for hotspot
1449 if (GetIconInfo(m_hcursor, &IconInfo)) 1449 if (GetIconInfo(m_hcursor, &IconInfo))
1450 { 1450 {
@@ -1642,7 +1642,7 @@ vncDesktop::CopyToBuffer(const rfb::Rect &amp;rect, BYTE *destbuff, UINT destbuffsiz @@ -1642,7 +1642,7 @@ vncDesktop::CopyToBuffer(const rfb::Rect &amp;rect, BYTE *destbuff, UINT destbuffsiz
1642 &m_bminfo.bmi, DIB_RGB_COLORS) == 0) 1642 &m_bminfo.bmi, DIB_RGB_COLORS) == 0)
1643 { 1643 {
1644 #ifdef _MSC_VER 1644 #ifdef _MSC_VER
1645 - _RPT1(_CRT_WARN, "vncDesktop : [1] GetDIBits failed! %d\n", GetLastError()); 1645 + _RPT1(_CRT_WARN, "vncDesktop : [1] GetDIBits failed! %d", GetLastError());
1646 _RPT3(_CRT_WARN, "vncDesktop : thread = %d, DC = %d, bitmap = %d\n", omni_thread::self(), m_hmemdc, m_membitmap); 1646 _RPT3(_CRT_WARN, "vncDesktop : thread = %d, DC = %d, bitmap = %d\n", omni_thread::self(), m_hmemdc, m_membitmap);
1647 _RPT2(_CRT_WARN, "vncDesktop : y = %d, height = %d\n", y_inv, (rect.br.y-rect.tl.y)); 1647 _RPT2(_CRT_WARN, "vncDesktop : y = %d, height = %d\n", y_inv, (rect.br.y-rect.tl.y));
1648 #endif 1648 #endif
@@ -1758,9 +1758,9 @@ DesktopWndProc(HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM lParam) @@ -1758,9 +1758,9 @@ DesktopWndProc(HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM lParam)
1758 switch (wParam) 1758 switch (wParam)
1759 { 1759 {
1760 case SC_MONITORPOWER: 1760 case SC_MONITORPOWER:
1761 - vnclog.Print(LL_INTINFO, VNCLOG("Monitor22 %i\n"),lParam); 1761 + vnclog.Print(LL_INTINFO, VNCLOG("Monitor22 %i"),lParam);
1762 } 1762 }
1763 - vnclog.Print(LL_INTINFO, VNCLOG("Monitor3 %i %i\n"),wParam,lParam); 1763 + vnclog.Print(LL_INTINFO, VNCLOG("Monitor3 %i %i"),wParam,lParam);
1764 return DefWindowProc(hwnd, iMsg, wParam, lParam); 1764 return DefWindowProc(hwnd, iMsg, wParam, lParam);
1765 case WM_POWER: 1765 case WM_POWER:
1766 case WM_POWERBROADCAST: 1766 case WM_POWERBROADCAST:
@@ -1768,9 +1768,9 @@ DesktopWndProc(HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM lParam) @@ -1768,9 +1768,9 @@ DesktopWndProc(HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM lParam)
1768 switch (wParam) 1768 switch (wParam)
1769 { 1769 {
1770 case SC_MONITORPOWER: 1770 case SC_MONITORPOWER:
1771 - vnclog.Print(LL_INTINFO, VNCLOG("Monitor222 %i\n"),lParam); 1771 + vnclog.Print(LL_INTINFO, VNCLOG("Monitor222 %i"),lParam);
1772 } 1772 }
1773 - vnclog.Print(LL_INTINFO, VNCLOG("Power3 %i %i\n"),wParam,lParam); 1773 + vnclog.Print(LL_INTINFO, VNCLOG("Power3 %i %i"),wParam,lParam);
1774 return DefWindowProc(hwnd, iMsg, wParam, lParam); 1774 return DefWindowProc(hwnd, iMsg, wParam, lParam);
1775 1775
1776 case WM_COPYDATA: 1776 case WM_COPYDATA:
@@ -1795,7 +1795,7 @@ DesktopWndProc(HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM lParam) @@ -1795,7 +1795,7 @@ DesktopWndProc(HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM lParam)
1795 } 1795 }
1796 1796
1797 } 1797 }
1798 - //vnclog.Print(LL_INTINFO, VNCLOG("copydata\n")); 1798 + //vnclog.Print(LL_INTINFO, VNCLOG("copydata"));
1799 return 0; 1799 return 0;
1800 1800
1801 // GENERAL 1801 // GENERAL
@@ -1804,7 +1804,7 @@ DesktopWndProc(HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM lParam) @@ -1804,7 +1804,7 @@ DesktopWndProc(HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM lParam)
1804 // The display resolution is changing 1804 // The display resolution is changing
1805 // We must kick off any clients since their screen size will be wrong 1805 // We must kick off any clients since their screen size will be wrong
1806 // WE change the clients screensize, if they support it. 1806 // WE change the clients screensize, if they support it.
1807 - vnclog.Print(LL_INTERR, VNCLOG("WM_DISPLAYCHANGE\n")); 1807 + vnclog.Print(LL_INTERR, VNCLOG("WM_DISPLAYCHANGE"));
1808 // We First check if the Resolution changed is caused by a temp resolution switch 1808 // We First check if the Resolution changed is caused by a temp resolution switch
1809 // For a temp resolution we don't use the driver, to fix the mirror driver 1809 // For a temp resolution we don't use the driver, to fix the mirror driver
1810 // to the new change, a resolution switch is needed, preventing screensaver locking. 1810 // to the new change, a resolution switch is needed, preventing screensaver locking.
@@ -1816,20 +1816,20 @@ DesktopWndProc(HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM lParam) @@ -1816,20 +1816,20 @@ DesktopWndProc(HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM lParam)
1816 _this->m_displaychanged = TRUE; 1816 _this->m_displaychanged = TRUE;
1817 _this->m_hookdriver=true; 1817 _this->m_hookdriver=true;
1818 _this->m_videodriver->blocked=true; 1818 _this->m_videodriver->blocked=true;
1819 - vnclog.Print(LL_INTERR, VNCLOG("Resolution switch detected, driver active\n")); 1819 + vnclog.Print(LL_INTERR, VNCLOG("Resolution switch detected, driver active"));
1820 } 1820 }
1821 else 1821 else
1822 { 1822 {
1823 //Remove display change, cause by driver activation 1823 //Remove display change, cause by driver activation
1824 _this->m_videodriver->blocked=false; 1824 _this->m_videodriver->blocked=false;
1825 - vnclog.Print(LL_INTERR, VNCLOG("Resolution switch by driver activation removed\n")); 1825 + vnclog.Print(LL_INTERR, VNCLOG("Resolution switch by driver activation removed"));
1826 } 1826 }
1827 } 1827 }
1828 else 1828 else
1829 { 1829 {
1830 _this->m_displaychanged = TRUE; 1830 _this->m_displaychanged = TRUE;
1831 _this->m_hookdriver=true; 1831 _this->m_hookdriver=true;
1832 - vnclog.Print(LL_INTERR, VNCLOG("Resolution switch detected, driver NOT active\n")); 1832 + vnclog.Print(LL_INTERR, VNCLOG("Resolution switch detected, driver NOT active"));
1833 1833
1834 } 1834 }
1835 return 0; 1835 return 0;
@@ -1947,7 +1947,7 @@ void vncDesktop::SetBlankMonitor(bool enabled) @@ -1947,7 +1947,7 @@ void vncDesktop::SetBlankMonitor(bool enabled)
1947 if (!pSetLayeredWindowAttributes) m_server->BlackAlphaBlending(false); 1947 if (!pSetLayeredWindowAttributes) m_server->BlackAlphaBlending(false);
1948 //if (VideoBuffer()) m_server->BlackAlphaBlending(false); 1948 //if (VideoBuffer()) m_server->BlackAlphaBlending(false);
1949 1949
1950 - vnclog.Print(LL_INTINFO, VNCLOG("SetBlankMonitor: monitor %s, using alpha %s\n"), 1950 + vnclog.Print(LL_INTINFO, VNCLOG("SetBlankMonitor: monitor %s, using alpha %s"),
1951 enabled ? "off" : "on", 1951 enabled ? "off" : "on",
1952 m_server->BlackAlphaBlending() ? "true" : "false"); 1952 m_server->BlackAlphaBlending() ? "true" : "false");
1953 1953
@@ -2003,7 +2003,7 @@ void @@ -2003,7 +2003,7 @@ void
2003 vncDesktop::SetDisableInput(bool enabled) 2003 vncDesktop::SetDisableInput(bool enabled)
2004 { 2004 {
2005 CARD32 state = enabled ? rfbServerState_Disabled : rfbServerState_Enabled; 2005 CARD32 state = enabled ? rfbServerState_Disabled : rfbServerState_Enabled;
2006 - vnclog.Print(LL_INTINFO, VNCLOG("SetDisableInput: inputs %s\n"), enabled ? "disbled" : "enabled"); 2006 + vnclog.Print(LL_INTINFO, VNCLOG("SetDisableInput: inputs %s"), enabled ? "disbled" : "enabled");
2007 2007
2008 //BlockInput block everything on non w2k and XP 2008 //BlockInput block everything on non w2k and XP
2009 //if hookdll is used, he take care of input blocking 2009 //if hookdll is used, he take care of input blocking
@@ -2015,7 +2015,7 @@ vncDesktop::SetDisableInput(bool enabled) @@ -2015,7 +2015,7 @@ vncDesktop::SetDisableInput(bool enabled)
2015 { 2015 {
2016 blocked = (*pbi)(enabled); 2016 blocked = (*pbi)(enabled);
2017 if (!blocked) 2017 if (!blocked)
2018 - vnclog.Print(LL_INTINFO, VNCLOG("BlockInput failed: Last error %08X\n"), ::GetLastError()); 2018 + vnclog.Print(LL_INTINFO, VNCLOG("BlockInput failed: Last error %08X"), ::GetLastError());
2019 if(!enabled) Sleep(1000); 2019 if(!enabled) Sleep(1000);
2020 blocked = (*pbi)(enabled); 2020 blocked = (*pbi)(enabled);
2021 } 2021 }
@@ -2036,7 +2036,7 @@ void vncDesktop::SetSW(int x,int y) @@ -2036,7 +2036,7 @@ void vncDesktop::SetSW(int x,int y)
2036 POINT point; 2036 POINT point;
2037 point.x=x; 2037 point.x=x;
2038 point.y=y; 2038 point.y=y;
2039 - vnclog.Print(LL_INTERR, VNCLOG("SETW %i %i\n"),x,y); 2039 + vnclog.Print(LL_INTERR, VNCLOG("SETW %i %i"),x,y);
2040 if (x <= 5 && y<=5 && x>-5 && y>-5) 2040 if (x <= 5 && y<=5 && x>-5 && y>-5)
2041 { 2041 {
2042 switch(asked_display) 2042 switch(asked_display)
@@ -2147,7 +2147,7 @@ BOOL vncDesktop::InitVideoDriver() @@ -2147,7 +2147,7 @@ BOOL vncDesktop::InitVideoDriver()
2147 omni_mutex_lock l(m_videodriver_lock); 2147 omni_mutex_lock l(m_videodriver_lock);
2148 2148
2149 if(!(OSversion()==1 || OSversion()==2)) return true; //we need w2k or xp 2149 if(!(OSversion()==1 || OSversion()==2)) return true; //we need w2k or xp
2150 - vnclog.Print(LL_INTERR, VNCLOG("Driver option is enabled\n")); 2150 + vnclog.Print(LL_INTERR, VNCLOG("Driver option is enabled"));
2151 // If m_videodriver exist, the driver was activated. 2151 // If m_videodriver exist, the driver was activated.
2152 // This does not mean he is still active 2152 // This does not mean he is still active
2153 // Screen switching disable the driver at kernel level 2153 // Screen switching disable the driver at kernel level
@@ -2159,7 +2159,7 @@ BOOL vncDesktop::InitVideoDriver() @@ -2159,7 +2159,7 @@ BOOL vncDesktop::InitVideoDriver()
2159 if (m_videodriver!=NULL) 2159 if (m_videodriver!=NULL)
2160 { 2160 {
2161 2161
2162 - vnclog.Print(LL_INTERR, VNCLOG("Closing pending driver driver version\n")); 2162 + vnclog.Print(LL_INTERR, VNCLOG("Closing pending driver driver version"));
2163 if (m_videodriver!=NULL) delete m_videodriver; 2163 if (m_videodriver!=NULL) delete m_videodriver;
2164 2164
2165 } 2165 }
@@ -2180,14 +2180,14 @@ BOOL vncDesktop::InitVideoDriver() @@ -2180,14 +2180,14 @@ BOOL vncDesktop::InitVideoDriver()
2180 m_ScreenOffsety=mymonitor[2].offsety; 2180 m_ScreenOffsety=mymonitor[2].offsety;
2181 m_videodriver->VIDEODRIVER_start(mymonitor[2].offsetx,mymonitor[2].offsety,mymonitor[2].Width,mymonitor[2].Height); 2181 m_videodriver->VIDEODRIVER_start(mymonitor[2].offsetx,mymonitor[2].offsety,mymonitor[2].Width,mymonitor[2].Height);
2182 } 2182 }
2183 - vnclog.Print(LL_INTERR, VNCLOG("Start Mirror driver\n")); 2183 + vnclog.Print(LL_INTERR, VNCLOG("Start Mirror driver"));
2184 m_hookdriver=true; 2184 m_hookdriver=true;
2185 m_hookdll=false; 2185 m_hookdll=false;
2186 // check if driver has mapped the shared memory 2186 // check if driver has mapped the shared memory
2187 if (!m_videodriver->mypVideoMemory) 2187 if (!m_videodriver->mypVideoMemory)
2188 { 2188 {
2189 - vnclog.Print(LL_INTERR, VNCLOG("Start Mirror driver Failed\n"));  
2190 - vnclog.Print(LL_INTERR, VNCLOG("Using non driver mode\n")); 2189 + vnclog.Print(LL_INTERR, VNCLOG("Start Mirror driver Failed"));
  2190 + vnclog.Print(LL_INTERR, VNCLOG("Using non driver mode"));
2191 if (m_videodriver!=NULL) delete m_videodriver; 2191 if (m_videodriver!=NULL) delete m_videodriver;
2192 m_videodriver=NULL; 2192 m_videodriver=NULL;
2193 // If driver selected and fialed to start default to hookdll 2193 // If driver selected and fialed to start default to hookdll
@@ -2206,10 +2206,10 @@ BOOL vncDesktop::InitVideoDriver() @@ -2206,10 +2206,10 @@ BOOL vncDesktop::InitVideoDriver()
2206 2206
2207 if (m_videodriver->mypVideoMemory) 2207 if (m_videodriver->mypVideoMemory)
2208 { 2208 {
2209 - vnclog.Print(LL_INTERR, VNCLOG("Driver Used\n")); 2209 + vnclog.Print(LL_INTERR, VNCLOG("Driver Used"));
2210 if (!m_videodriver->mypVideoMemory) 2210 if (!m_videodriver->mypVideoMemory)
2211 { 2211 {
2212 - vnclog.Print(LL_INTERR, VNCLOG("Unable to map memory\n")); 2212 + vnclog.Print(LL_INTERR, VNCLOG("Unable to map memory"));
2213 delete m_videodriver; 2213 delete m_videodriver;
2214 m_videodriver=NULL; 2214 m_videodriver=NULL;
2215 // If driver selected and fialed to start default to hookdll 2215 // If driver selected and fialed to start default to hookdll
@@ -2218,7 +2218,7 @@ BOOL vncDesktop::InitVideoDriver() @@ -2218,7 +2218,7 @@ BOOL vncDesktop::InitVideoDriver()
2218 m_hookdll=true; 2218 m_hookdll=true;
2219 return false; 2219 return false;
2220 } 2220 }
2221 - vnclog.Print(LL_INTERR, VNCLOG("Shared memory mapped\n")); 2221 + vnclog.Print(LL_INTERR, VNCLOG("Shared memory mapped"));
2222 InvalidateRect(NULL,NULL,TRUE); 2222 InvalidateRect(NULL,NULL,TRUE);
2223 2223
2224 return true; 2224 return true;
@@ -2258,7 +2258,7 @@ void vncDesktop::SethookMechanism(BOOL hookall,BOOL hookdriver) @@ -2258,7 +2258,7 @@ void vncDesktop::SethookMechanism(BOOL hookall,BOOL hookdriver)
2258 } 2258 }
2259 2259
2260 // 9,x case 2260 // 9,x case
2261 - vnclog.Print(LL_INTERR, VNCLOG("SethookMechanism called\r\n")); 2261 + vnclog.Print(LL_INTERR, VNCLOG("SethookMechanism calledCR\LF"));
2262 if(OSversion()==4 || OSversion()==5) 2262 if(OSversion()==4 || OSversion()==5)
2263 { 2263 {
2264 m_hookdriver=false;//(user driver updates) 2264 m_hookdriver=false;//(user driver updates)
@@ -2290,14 +2290,14 @@ void vncDesktop::SethookMechanism(BOOL hookall,BOOL hookdriver) @@ -2290,14 +2290,14 @@ void vncDesktop::SethookMechanism(BOOL hookall,BOOL hookdriver)
2290 else Hookdll_Changed=false; 2290 else Hookdll_Changed=false;
2291 if (OSversion()==2) Hookdll_Changed=true; 2291 if (OSversion()==2) Hookdll_Changed=true;
2292 2292
2293 - vnclog.Print(LL_INTERR, VNCLOG("Sethook_restart_wanted hook=%d driver=%d \r\n"),m_hookdll,m_hookdriver); 2293 + vnclog.Print(LL_INTERR, VNCLOG("Sethook_restart_wanted hook=%d driver=%d "),m_hookdll,m_hookdriver);
2294 if (Hookdll_Changed) 2294 if (Hookdll_Changed)
2295 - vnclog.Print(LL_INTERR, VNCLOG("Hookdll status changed \r\n")); 2295 + vnclog.Print(LL_INTERR, VNCLOG("Hookdll status changed"));
2296 2296
2297 if ((m_hookdriver && !VideoBuffer()) || (!m_hookdriver && VideoBuffer())) 2297 if ((m_hookdriver && !VideoBuffer()) || (!m_hookdriver && VideoBuffer()))
2298 { 2298 {
2299 m_hookswitch=true; 2299 m_hookswitch=true;
2300 - vnclog.Print(LL_INTERR, VNCLOG("Driver Status changed\r\n")); 2300 + vnclog.Print(LL_INTERR, VNCLOG("Driver Status changed"));
2301 } 2301 }
2302 } 2302 }
2303 else //NT4 2303 else //NT4
@@ -2335,12 +2335,12 @@ void vncDesktop::StartStopddihook(BOOL enabled) @@ -2335,12 +2335,12 @@ void vncDesktop::StartStopddihook(BOOL enabled)
2335 // Start the child process. 2335 // Start the child process.
2336 if( !CreateProcess( NULL,szCurrentDir, NULL,NULL,FALSE,NULL,NULL,NULL,&ssi,&ppi ) ) 2336 if( !CreateProcess( NULL,szCurrentDir, NULL,NULL,FALSE,NULL,NULL,NULL,&ssi,&ppi ) )
2337 { 2337 {
2338 - vnclog.Print(LL_INTERR, VNCLOG("set ddihooks Failed\n")); 2338 + vnclog.Print(LL_INTERR, VNCLOG("set ddihooks Failed"));
2339 ddihook=false; 2339 ddihook=false;
2340 } 2340 }
2341 else 2341 else
2342 { 2342 {
2343 - vnclog.Print(LL_INTERR, VNCLOG("set ddihooks OK\n")); 2343 + vnclog.Print(LL_INTERR, VNCLOG("set ddihooks OK"));
2344 ddihook=true; 2344 ddihook=true;
2345 WaitForInputIdle(ppi.hProcess, 10000); 2345 WaitForInputIdle(ppi.hProcess, 10000);
2346 m_hddihook=ppi.hProcess; 2346 m_hddihook=ppi.hProcess;
@@ -2365,7 +2365,7 @@ void vncDesktop::StartStophookdll(BOOL enabled) @@ -2365,7 +2365,7 @@ void vncDesktop::StartStophookdll(BOOL enabled)
2365 if (SetHook) 2365 if (SetHook)
2366 { 2366 {
2367 SetHook(m_hwnd); 2367 SetHook(m_hwnd);
2368 - vnclog.Print(LL_INTERR, VNCLOG("set SC hooks OK\n")); 2368 + vnclog.Print(LL_INTERR, VNCLOG("set SC hooks OK"));
2369 m_hookinited = TRUE; 2369 m_hookinited = TRUE;
2370 } 2370 }
2371 else if (SetHooks) 2371 else if (SetHooks)
@@ -2377,14 +2377,14 @@ void vncDesktop::StartStophookdll(BOOL enabled) @@ -2377,14 +2377,14 @@ void vncDesktop::StartStophookdll(BOOL enabled)
2377 RFB_MOUSE_UPDATE, ddihook 2377 RFB_MOUSE_UPDATE, ddihook
2378 )) 2378 ))
2379 { 2379 {
2380 - vnclog.Print(LL_INTERR, VNCLOG("failed to set system hooks\n")); 2380 + vnclog.Print(LL_INTERR, VNCLOG("failed to set system hooks"));
2381 // Switch on full screen polling, so they can see something, at least... 2381 // Switch on full screen polling, so they can see something, at least...
2382 m_server->PollFullScreen(TRUE); 2382 m_server->PollFullScreen(TRUE);
2383 m_hookinited = FALSE; 2383 m_hookinited = FALSE;
2384 } 2384 }
2385 else 2385 else
2386 { 2386 {
2387 - vnclog.Print(LL_INTERR, VNCLOG("set hooks OK\n")); 2387 + vnclog.Print(LL_INTERR, VNCLOG("set hooks OK"));
2388 m_hookinited = TRUE; 2388 m_hookinited = TRUE;
2389 // Start up the keyboard and mouse filters 2389 // Start up the keyboard and mouse filters
2390 if (SetKeyboardFilterHook) SetKeyboardFilterHook(m_server->LocalInputsDisabled()); 2390 if (SetKeyboardFilterHook) SetKeyboardFilterHook(m_server->LocalInputsDisabled());
@@ -2402,8 +2402,8 @@ void vncDesktop::StartStophookdll(BOOL enabled) @@ -2402,8 +2402,8 @@ void vncDesktop::StartStophookdll(BOOL enabled)
2402 else if (UnSetHooks) 2402 else if (UnSetHooks)
2403 { 2403 {
2404 if(!UnSetHooks(GetCurrentThreadId()) ) 2404 if(!UnSetHooks(GetCurrentThreadId()) )
2405 - vnclog.Print(LL_INTERR, VNCLOG("Unsethooks Failed\n"));  
2406 - else vnclog.Print(LL_INTERR, VNCLOG("Unsethooks OK\n")); 2405 + vnclog.Print(LL_INTERR, VNCLOG("Unsethooks Failed"));
  2406 + else vnclog.Print(LL_INTERR, VNCLOG("Unsethooks OK"));
2407 } 2407 }
2408 2408
2409 } 2409 }
srcacic/WinVNC/WinVNC/vncdesktopthread.cpp
@@ -40,11 +40,11 @@ vncDesktopThread::copy_bitmaps_to_buffer(ULONG i,rfb::Region2D &amp;rgncache,rfb::Up @@ -40,11 +40,11 @@ vncDesktopThread::copy_bitmaps_to_buffer(ULONG i,rfb::Region2D &amp;rgncache,rfb::Up
40 int w = m_desktop->pchanges_buf->pointrect[i].rect.right-m_desktop->pchanges_buf->pointrect[i].rect.left; 40 int w = m_desktop->pchanges_buf->pointrect[i].rect.right-m_desktop->pchanges_buf->pointrect[i].rect.left;
41 int y = m_desktop->pchanges_buf->pointrect[i].rect.top; 41 int y = m_desktop->pchanges_buf->pointrect[i].rect.top;
42 int h = m_desktop->pchanges_buf->pointrect[i].rect.bottom-m_desktop->pchanges_buf->pointrect[i].rect.top; 42 int h = m_desktop->pchanges_buf->pointrect[i].rect.bottom-m_desktop->pchanges_buf->pointrect[i].rect.top;
43 - //vnclog.Print(LL_INTINFO, VNCLOG("Driver ************* %i %i %i %i \n"),x,y,w,h); 43 + //vnclog.Print(LL_INTINFO, VNCLOG("Driver ************* %i %i %i %i "),x,y,w,h);
44 44
45 if (!ClipRect(&x, &y, &w, &h, m_desktop->m_bmrect.tl.x, m_desktop->m_bmrect.tl.y, 45 if (!ClipRect(&x, &y, &w, &h, m_desktop->m_bmrect.tl.x, m_desktop->m_bmrect.tl.y,
46 m_desktop->m_bmrect.br.x-m_desktop->m_bmrect.tl.x, m_desktop->m_bmrect.br.y-m_desktop->m_bmrect.tl.y)) return; 46 m_desktop->m_bmrect.br.x-m_desktop->m_bmrect.tl.x, m_desktop->m_bmrect.br.y-m_desktop->m_bmrect.tl.y)) return;
47 - //vnclog.Print(LL_INTINFO, VNCLOG("Driver ************* %i %i %i %i \n"),x,y,w,h); 47 + //vnclog.Print(LL_INTINFO, VNCLOG("Driver ************* %i %i %i %i "),x,y,w,h);
48 rect.tl.x = x; 48 rect.tl.x = x;
49 rect.br.x = x+w; 49 rect.br.x = x+w;
50 rect.tl.y = y; 50 rect.tl.y = y;
@@ -89,7 +89,7 @@ vncDesktopThread::copy_bitmaps_to_buffer(ULONG i,rfb::Region2D &amp;rgncache,rfb::Up @@ -89,7 +89,7 @@ vncDesktopThread::copy_bitmaps_to_buffer(ULONG i,rfb::Region2D &amp;rgncache,rfb::Up
89 rfb::Point delta = rfb::Point(-dx,-dy); 89 rfb::Point delta = rfb::Point(-dx,-dy);
90 rgncache=rgncache.union_(rect); 90 rgncache=rgncache.union_(rect);
91 tracker.add_copied(rect, delta); 91 tracker.add_copied(rect, delta);
92 - // vnclog.Print(LL_INTINFO, VNCLOG("Copyrect \n")); 92 + // vnclog.Print(LL_INTINFO, VNCLOG("Copyrect "));
93 } 93 }
94 else 94 else
95 { 95 {
@@ -123,7 +123,7 @@ vncDesktopThread::handle_driver_changes(rfb::Region2D &amp;rgncache,rfb::UpdateTrack @@ -123,7 +123,7 @@ vncDesktopThread::handle_driver_changes(rfb::Region2D &amp;rgncache,rfb::UpdateTrack
123 int oldaantal=m_desktop->m_videodriver->oldaantal; 123 int oldaantal=m_desktop->m_videodriver->oldaantal;
124 int counter=m_desktop->pchanges_buf->counter; 124 int counter=m_desktop->pchanges_buf->counter;
125 // int nr_updates=m_desktop->pchanges_buf->pointrect[0].type; 125 // int nr_updates=m_desktop->pchanges_buf->pointrect[0].type;
126 -// vnclog.Print(LL_INTERR, VNCLOG("updates, rects %i\n"),oldaantal-counter); 126 +// vnclog.Print(LL_INTERR, VNCLOG("updates, rects %i"),oldaantal-counter);
127 if (oldaantal==counter) return FALSE; 127 if (oldaantal==counter) return FALSE;
128 if (counter<1 || counter >1999) return FALSE; 128 if (counter<1 || counter >1999) return FALSE;
129 // m_desktop->pchanges_buf->pointrect[0].type=0; 129 // m_desktop->pchanges_buf->pointrect[0].type=0;
@@ -172,7 +172,7 @@ vncDesktopThread::handle_driver_changes(rfb::Region2D &amp;rgncache,rfb::UpdateTrack @@ -172,7 +172,7 @@ vncDesktopThread::handle_driver_changes(rfb::Region2D &amp;rgncache,rfb::UpdateTrack
172 copy_bitmaps_to_buffer(i,rgncache,tracker); 172 copy_bitmaps_to_buffer(i,rgncache,tracker);
173 } 173 }
174 } 174 }
175 -// vnclog.Print(LL_INTINFO, VNCLOG("Nr rects %i \n"),rgncache.Numrects()); 175 +// vnclog.Print(LL_INTINFO, VNCLOG("Nr rects %i "),rgncache.Numrects());
176 m_desktop->m_videodriver->oldaantal=counter; 176 m_desktop->m_videodriver->oldaantal=counter;
177 // A lot updates left after combining 177 // A lot updates left after combining
178 // This generates an overflow 178 // This generates an overflow
@@ -349,10 +349,10 @@ vncDesktopThread::run_undetached(void *arg) @@ -349,10 +349,10 @@ vncDesktopThread::run_undetached(void *arg)
349 // INIT 349 // INIT
350 //******************************************************* 350 //*******************************************************
351 // SessionFix(); 351 // SessionFix();
352 - vnclog.Print(LL_INTERR, VNCLOG("Hook changed 1\n")); 352 + vnclog.Print(LL_INTERR, VNCLOG("Hook changed 1"));
353 // Save the thread's "home" desktop, under NT (no effect under 9x) 353 // Save the thread's "home" desktop, under NT (no effect under 9x)
354 HDESK home_desktop = GetThreadDesktop(GetCurrentThreadId()); 354 HDESK home_desktop = GetThreadDesktop(GetCurrentThreadId());
355 - vnclog.Print(LL_INTERR, VNCLOG("Hook changed 2\n")); 355 + vnclog.Print(LL_INTERR, VNCLOG("Hook changed 2"));
356 // Attempt to initialise and return success or failure 356 // Attempt to initialise and return success or failure
357 m_desktop->KillScreenSaver(); 357 m_desktop->KillScreenSaver();
358 { 358 {
@@ -438,7 +438,7 @@ vncDesktopThread::run_undetached(void *arg) @@ -438,7 +438,7 @@ vncDesktopThread::run_undetached(void *arg)
438 { 438 {
439 if (!PeekMessage(&msg, NULL, NULL, NULL, PM_REMOVE)) 439 if (!PeekMessage(&msg, NULL, NULL, NULL, PM_REMOVE))
440 { 440 {
441 -// vnclog.Print(LL_INTERR, VNCLOG("!PeekMessage \n")); 441 +// vnclog.Print(LL_INTERR, VNCLOG("!PeekMessage "));
442 // MAX 30fps 442 // MAX 30fps
443 newtick = timeGetTime(); // Better resolution than GetTickCount ;) 443 newtick = timeGetTime(); // Better resolution than GetTickCount ;)
444 if ((newtick-oldtick)<33) 444 if ((newtick-oldtick)<33)
@@ -458,7 +458,7 @@ vncDesktopThread::run_undetached(void *arg) @@ -458,7 +458,7 @@ vncDesktopThread::run_undetached(void *arg)
458 //******************************************************* 458 //*******************************************************
459 if (m_desktop->Hookdll_Changed && !m_desktop->m_hookswitch) 459 if (m_desktop->Hookdll_Changed && !m_desktop->m_hookswitch)
460 { 460 {
461 - vnclog.Print(LL_INTERR, VNCLOG("Hook changed \n")); 461 + vnclog.Print(LL_INTERR, VNCLOG("Hook changed "));
462 m_desktop->StartStophookdll(m_desktop->On_Off_hookdll); 462 m_desktop->StartStophookdll(m_desktop->On_Off_hookdll);
463 if (m_desktop->On_Off_hookdll) 463 if (m_desktop->On_Off_hookdll)
464 m_desktop->m_hOldcursor = NULL; // Force mouse cursor grabbing if hookdll On 464 m_desktop->m_hOldcursor = NULL; // Force mouse cursor grabbing if hookdll On
@@ -481,15 +481,15 @@ vncDesktopThread::run_undetached(void *arg) @@ -481,15 +481,15 @@ vncDesktopThread::run_undetached(void *arg)
481 if (!m_server->All_clients_initialalized()) 481 if (!m_server->All_clients_initialalized())
482 { 482 {
483 Sleep(30); 483 Sleep(30);
484 - vnclog.Print(LL_INTERR, VNCLOG("Wait for viewer init \n")); 484 + vnclog.Print(LL_INTERR, VNCLOG("Wait for viewer init "));
485 } 485 }
486 486
487 //logging 487 //logging
488 - if (m_desktop->m_displaychanged) vnclog.Print(LL_INTERR, VNCLOG("++++Screensize changed \n"));  
489 - if (m_desktop->m_SWtoDesktop) vnclog.Print(LL_INTERR, VNCLOG("m_SWtoDesktop \n"));  
490 - if (m_desktop->m_hookswitch) vnclog.Print(LL_INTERR, VNCLOG("m_hookswitch \n"));  
491 - if (m_desktop->asked_display!=m_desktop->m_buffer.GetDisplay()) vnclog.Print(LL_INTERR, VNCLOG("desktop switch %i %i \n"),m_desktop->asked_display,m_desktop->m_buffer.GetDisplay());  
492 - if (!vncService::InputDesktopSelected()) vnclog.Print(LL_INTERR, VNCLOG("++++InputDesktopSelected \n")); 488 + if (m_desktop->m_displaychanged) vnclog.Print(LL_INTERR, VNCLOG("++++Screensize changed "));
  489 + if (m_desktop->m_SWtoDesktop) vnclog.Print(LL_INTERR, VNCLOG("m_SWtoDesktop "));
  490 + if (m_desktop->m_hookswitch) vnclog.Print(LL_INTERR, VNCLOG("m_hookswitch "));
  491 + if (m_desktop->asked_display!=m_desktop->m_buffer.GetDisplay()) vnclog.Print(LL_INTERR, VNCLOG("desktop switch %i %i "),m_desktop->asked_display,m_desktop->m_buffer.GetDisplay());
  492 + if (!vncService::InputDesktopSelected()) vnclog.Print(LL_INTERR, VNCLOG("++++InputDesktopSelected "));
493 493
494 494
495 BOOL screensize_changed=false; 495 BOOL screensize_changed=false;
@@ -526,7 +526,7 @@ vncDesktopThread::run_undetached(void *arg) @@ -526,7 +526,7 @@ vncDesktopThread::run_undetached(void *arg)
526 m_desktop->current_monitor=1; 526 m_desktop->current_monitor=1;
527 if (m_desktop->asked_display==2 && m_desktop->nr_monitors>1) m_desktop->current_monitor=2; 527 if (m_desktop->asked_display==2 && m_desktop->nr_monitors>1) m_desktop->current_monitor=2;
528 if (m_desktop->asked_display==3 && m_desktop->nr_monitors>1) m_desktop->current_monitor=3; 528 if (m_desktop->asked_display==3 && m_desktop->nr_monitors>1) m_desktop->current_monitor=3;
529 - vnclog.Print(LL_INTERR, VNCLOG("OLd Current mon %i %i \n"),old_monitor,m_desktop->current_monitor); 529 + vnclog.Print(LL_INTERR, VNCLOG("OLd Current mon %i %i "),old_monitor,m_desktop->current_monitor);
530 if ( old_monitor!=m_desktop->current_monitor) monitor_changed=true; 530 if ( old_monitor!=m_desktop->current_monitor) monitor_changed=true;
531 } 531 }
532 532
@@ -542,7 +542,7 @@ vncDesktopThread::run_undetached(void *arg) @@ -542,7 +542,7 @@ vncDesktopThread::run_undetached(void *arg)
542 monitor_changed=false; 542 monitor_changed=false;
543 if (!m_desktop->Shutdown()) 543 if (!m_desktop->Shutdown())
544 { 544 {
545 - vnclog.Print(LL_INTERR, VNCLOG("Shutdown KillAuthClients\n")); 545 + vnclog.Print(LL_INTERR, VNCLOG("Shutdown KillAuthClients"));
546 m_server->KillAuthClients(); 546 m_server->KillAuthClients();
547 break; 547 break;
548 } 548 }
@@ -550,7 +550,7 @@ vncDesktopThread::run_undetached(void *arg) @@ -550,7 +550,7 @@ vncDesktopThread::run_undetached(void *arg)
550 vnclog.Print(LL_INTERR, VNCLOG("m_desktop->Startup")); 550 vnclog.Print(LL_INTERR, VNCLOG("m_desktop->Startup"));
551 if (!m_desktop->Startup()) 551 if (!m_desktop->Startup())
552 { 552 {
553 - vnclog.Print(LL_INTERR, VNCLOG("Startup KillAuthClients\n")); 553 + vnclog.Print(LL_INTERR, VNCLOG("Startup KillAuthClients"));
554 m_server->KillAuthClients(); 554 m_server->KillAuthClients();
555 break; 555 break;
556 } 556 }
@@ -577,7 +577,7 @@ vncDesktopThread::run_undetached(void *arg) @@ -577,7 +577,7 @@ vncDesktopThread::run_undetached(void *arg)
577 // then the users checks "Video Driver" 577 // then the users checks "Video Driver"
578 if (fHookDriverWanted && m_desktop->m_videodriver == NULL) 578 if (fHookDriverWanted && m_desktop->m_videodriver == NULL)
579 { 579 {
580 - vnclog.Print(LL_INTERR, VNCLOG("m_videodriver == NULL \n")); 580 + vnclog.Print(LL_INTERR, VNCLOG("m_videodriver == NULL "));
581 m_desktop->SethookMechanism(true, false); // InitHookSettings() would work as well; 581 m_desktop->SethookMechanism(true, false); // InitHookSettings() would work as well;
582 } 582 }
583 stop_hookwatch=true; 583 stop_hookwatch=true;
@@ -599,7 +599,7 @@ vncDesktopThread::run_undetached(void *arg) @@ -599,7 +599,7 @@ vncDesktopThread::run_undetached(void *arg)
599 m_desktop->m_SWtoDesktop==TRUE )) 599 m_desktop->m_SWtoDesktop==TRUE ))
600 { 600 {
601 screensize_changed=true; 601 screensize_changed=true;
602 - vnclog.Print(LL_INTINFO, VNCLOG("SCR: new screen format %dx%dx%d\n"), 602 + vnclog.Print(LL_INTINFO, VNCLOG("SCR: new screen format %dx%dx%d"),
603 m_desktop->m_scrinfo.framebufferWidth, 603 m_desktop->m_scrinfo.framebufferWidth,
604 m_desktop->m_scrinfo.framebufferHeight, 604 m_desktop->m_scrinfo.framebufferHeight,
605 m_desktop->m_scrinfo.format.bitsPerPixel); 605 m_desktop->m_scrinfo.format.bitsPerPixel);
@@ -615,7 +615,7 @@ vncDesktopThread::run_undetached(void *arg) @@ -615,7 +615,7 @@ vncDesktopThread::run_undetached(void *arg)
615 615
616 if (screensize_changed) 616 if (screensize_changed)
617 { 617 {
618 - vnclog.Print(LL_INTERR, VNCLOG("Size changed\n")); 618 + vnclog.Print(LL_INTERR, VNCLOG("Size changed"));
619 POINT CursorPos; 619 POINT CursorPos;
620 m_desktop->SWinit(); 620 m_desktop->SWinit();
621 m_desktop->GetQuarterSize(); 621 m_desktop->GetQuarterSize();
@@ -649,7 +649,7 @@ vncDesktopThread::run_undetached(void *arg) @@ -649,7 +649,7 @@ vncDesktopThread::run_undetached(void *arg)
649 m_desktop->mymonitor[m_desktop->current_monitor-1].Height-m_desktop->mymonitor[2].offsety; 649 m_desktop->mymonitor[m_desktop->current_monitor-1].Height-m_desktop->mymonitor[2].offsety;
650 650
651 651
652 - vnclog.Print(LL_INTERR, VNCLOG("***********###############************ %i %i %i %i %i %i\n"),m_desktop->m_SWOffsetx,m_desktop->m_SWOffsety 652 + vnclog.Print(LL_INTERR, VNCLOG("***********###############************ %i %i %i %i %i %i"),m_desktop->m_SWOffsetx,m_desktop->m_SWOffsety
653 ,m_desktop->m_Cliprect.tl.x,m_desktop->m_Cliprect.tl.y,m_desktop->m_Cliprect.br.x,m_desktop->m_Cliprect.br.y); 653 ,m_desktop->m_Cliprect.tl.x,m_desktop->m_Cliprect.tl.y,m_desktop->m_Cliprect.br.x,m_desktop->m_Cliprect.br.y);
654 654
655 655
@@ -671,7 +671,7 @@ vncDesktopThread::run_undetached(void *arg) @@ -671,7 +671,7 @@ vncDesktopThread::run_undetached(void *arg)
671 //******************************************************* 671 //*******************************************************
672 if (memcmp(&m_desktop->m_scrinfo.format, &oldscrinfo.format, sizeof(rfbPixelFormat)) != 0) 672 if (memcmp(&m_desktop->m_scrinfo.format, &oldscrinfo.format, sizeof(rfbPixelFormat)) != 0)
673 { 673 {
674 - vnclog.Print(LL_INTERR, VNCLOG("Format changed\n")); 674 + vnclog.Print(LL_INTERR, VNCLOG("Format changed"));
675 m_server->UpdatePalette(); 675 m_server->UpdatePalette();
676 m_server->UpdateLocalFormat(); 676 m_server->UpdateLocalFormat();
677 } 677 }
@@ -712,7 +712,7 @@ vncDesktopThread::run_undetached(void *arg) @@ -712,7 +712,7 @@ vncDesktopThread::run_undetached(void *arg)
712 m_desktop->m_SWSizeChanged=FALSE; 712 m_desktop->m_SWSizeChanged=FALSE;
713 m_desktop->GetQuarterSize(); 713 m_desktop->GetQuarterSize();
714 rgncache = rgncache.union_(rfb::Region2D(m_desktop->m_Cliprect)); 714 rgncache = rgncache.union_(rfb::Region2D(m_desktop->m_Cliprect));
715 -// vnclog.Print(LL_INTINFO, VNCLOG("4 %i %i %i %i \n"),m_desktop->m_Cliprect.br.x,m_desktop->m_Cliprect.br.y,m_desktop->m_Cliprect.tl.x,m_desktop->m_Cliprect.tl.y); 715 +// vnclog.Print(LL_INTINFO, VNCLOG("4 %i %i %i %i "),m_desktop->m_Cliprect.br.x,m_desktop->m_Cliprect.br.y,m_desktop->m_Cliprect.tl.x,m_desktop->m_Cliprect.tl.y);
716 updates.set_clip_region(m_desktop->m_Cliprect); 716 updates.set_clip_region(m_desktop->m_Cliprect);
717 m_server->SetSWOffset(m_desktop->m_SWOffsetx,m_desktop->m_SWOffsety); 717 m_server->SetSWOffset(m_desktop->m_SWOffsetx,m_desktop->m_SWOffsety);
718 m_desktop->m_buffer.ClearCache(); 718 m_desktop->m_buffer.ClearCache();
@@ -725,7 +725,7 @@ vncDesktopThread::run_undetached(void *arg) @@ -725,7 +725,7 @@ vncDesktopThread::run_undetached(void *arg)
725 updates.set_clip_region(m_desktop->m_Cliprect); 725 updates.set_clip_region(m_desktop->m_Cliprect);
726 m_server->SetSWOffset(m_desktop->m_SWOffsetx,m_desktop->m_SWOffsety); 726 m_server->SetSWOffset(m_desktop->m_SWOffsetx,m_desktop->m_SWOffsety);
727 rgncache = rgncache.union_(rfb::Region2D(m_desktop->m_Cliprect)); 727 rgncache = rgncache.union_(rfb::Region2D(m_desktop->m_Cliprect));
728 -// vnclog.Print(LL_INTINFO, VNCLOG("5 %i %i %i %i \n"),m_desktop->m_Cliprect.br.x,m_desktop->m_Cliprect.br.y,m_desktop->m_Cliprect.tl.x,m_desktop->m_Cliprect.tl.y); 728 +// vnclog.Print(LL_INTINFO, VNCLOG("5 %i %i %i %i "),m_desktop->m_Cliprect.br.x,m_desktop->m_Cliprect.br.y,m_desktop->m_Cliprect.tl.x,m_desktop->m_Cliprect.tl.y);
729 m_desktop->m_buffer.ClearCache(); 729 m_desktop->m_buffer.ClearCache();
730 m_desktop->m_buffer.BlackBack(); 730 m_desktop->m_buffer.BlackBack();
731 } 731 }
@@ -744,10 +744,10 @@ vncDesktopThread::run_undetached(void *arg) @@ -744,10 +744,10 @@ vncDesktopThread::run_undetached(void *arg)
744 // 744 //
745 // CALCULATE CHANGES 745 // CALCULATE CHANGES
746 m_desktop->m_UltraEncoder_used=m_desktop->m_server->IsThereAUltraEncodingClient(); 746 m_desktop->m_UltraEncoder_used=m_desktop->m_server->IsThereAUltraEncodingClient();
747 -// vnclog.Print(LL_INTERR, VNCLOG("UpdateWanted B\n")); 747 +// vnclog.Print(LL_INTERR, VNCLOG("UpdateWanted B"));
748 if (m_desktop->m_server->UpdateWanted()) 748 if (m_desktop->m_server->UpdateWanted())
749 { 749 {
750 -// vnclog.Print(LL_INTERR, VNCLOG("UpdateWanted N\n")); 750 +// vnclog.Print(LL_INTERR, VNCLOG("UpdateWanted N"));
751 //TEST4 751 //TEST4
752 // Re-render the mouse's old location if it's moved 752 // Re-render the mouse's old location if it's moved
753 BOOL cursormoved = FALSE; 753 BOOL cursormoved = FALSE;
@@ -756,7 +756,7 @@ vncDesktopThread::run_undetached(void *arg) @@ -756,7 +756,7 @@ vncDesktopThread::run_undetached(void *arg)
756 ((cursorpos.x != oldcursorpos.x) || 756 ((cursorpos.x != oldcursorpos.x) ||
757 (cursorpos.y != oldcursorpos.y))) 757 (cursorpos.y != oldcursorpos.y)))
758 { 758 {
759 -// vnclog.Print(LL_INTERR, VNCLOG("UpdateWanted M %i %i %i %i\n"),cursorpos.x, oldcursorpos.x,cursorpos.y,oldcursorpos.y); 759 +// vnclog.Print(LL_INTERR, VNCLOG("UpdateWanted M %i %i %i %i"),cursorpos.x, oldcursorpos.x,cursorpos.y,oldcursorpos.y);
760 cursormoved = TRUE; 760 cursormoved = TRUE;
761 oldcursorpos = rfb::Point(cursorpos); 761 oldcursorpos = rfb::Point(cursorpos);
762 // nyama/marscha - PointerPos. Inform clients about mouse move. 762 // nyama/marscha - PointerPos. Inform clients about mouse move.
@@ -898,8 +898,8 @@ vncDesktopThread::run_undetached(void *arg) @@ -898,8 +898,8 @@ vncDesktopThread::run_undetached(void *arg)
898 rect.tl.y = y; 898 rect.tl.y = y;
899 rect.br.y = y+h; 899 rect.br.y = y+h;
900 rgncache = rgncache.union_(rect); 900 rgncache = rgncache.union_(rect);
901 -// vnclog.Print(LL_INTINFO, VNCLOG("6 %i %i %i %i \n"),m_desktop->m_cursorpos.br.x,m_desktop->m_cursorpos.br.y,m_desktop->m_cursorpos.tl.x,m_desktop->m_cursorpos.tl.y);  
902 -// vnclog.Print(LL_INTINFO, VNCLOG("6 %i %i %i %i \n"),rect.br.x,rect.br.y,rect.tl.x,rect.tl.y); 901 +// vnclog.Print(LL_INTINFO, VNCLOG("6 %i %i %i %i "),m_desktop->m_cursorpos.br.x,m_desktop->m_cursorpos.br.y,m_desktop->m_cursorpos.tl.x,m_desktop->m_cursorpos.tl.y);
  902 +// vnclog.Print(LL_INTINFO, VNCLOG("6 %i %i %i %i "),rect.br.x,rect.br.y,rect.tl.x,rect.tl.y);
903 } 903 }
904 } 904 }
905 905
@@ -968,8 +968,8 @@ vncDesktopThread::run_undetached(void *arg) @@ -968,8 +968,8 @@ vncDesktopThread::run_undetached(void *arg)
968 rect.tl.y = y; 968 rect.tl.y = y;
969 rect.br.y = y+h; 969 rect.br.y = y+h;
970 rgncache = rgncache.union_(rect); 970 rgncache = rgncache.union_(rect);
971 -// vnclog.Print(LL_INTINFO, VNCLOG("7 %i %i %i %i \n"),m_desktop->m_cursorpos.br.x,m_desktop->m_cursorpos.br.y,m_desktop->m_cursorpos.tl.x,m_desktop->m_cursorpos.tl.y);  
972 -// vnclog.Print(LL_INTINFO, VNCLOG("6 %i %i %i %i \n"),rect.br.x,rect.br.y,rect.tl.x,rect.tl.y); 971 +// vnclog.Print(LL_INTINFO, VNCLOG("7 %i %i %i %i "),m_desktop->m_cursorpos.br.x,m_desktop->m_cursorpos.br.y,m_desktop->m_cursorpos.tl.x,m_desktop->m_cursorpos.tl.y);
  972 +// vnclog.Print(LL_INTINFO, VNCLOG("6 %i %i %i %i "),rect.br.x,rect.br.y,rect.tl.x,rect.tl.y);
973 } 973 }
974 m_server->UpdateCursorShape(); 974 m_server->UpdateCursorShape();
975 } 975 }
@@ -1000,8 +1000,8 @@ vncDesktopThread::run_undetached(void *arg) @@ -1000,8 +1000,8 @@ vncDesktopThread::run_undetached(void *arg)
1000 rect.tl.y = y; 1000 rect.tl.y = y;
1001 rect.br.y = y+h; 1001 rect.br.y = y+h;
1002 rgncache = rgncache.union_(rect); 1002 rgncache = rgncache.union_(rect);
1003 - vnclog.Print(LL_INTINFO, VNCLOG("8 %i %i %i %i \n"),m_desktop->m_cursorpos.br.x,m_desktop->m_cursorpos.br.y,m_desktop->m_cursorpos.tl.x,m_desktop->m_cursorpos.tl.y);  
1004 - vnclog.Print(LL_INTINFO, VNCLOG("8 %i %i %i %i \n"),rect.br.x,rect.br.y,rect.tl.x,rect.tl.y); 1003 + vnclog.Print(LL_INTINFO, VNCLOG("8 %i %i %i %i "),m_desktop->m_cursorpos.br.x,m_desktop->m_cursorpos.br.y,m_desktop->m_cursorpos.tl.x,m_desktop->m_cursorpos.tl.y);
  1004 + vnclog.Print(LL_INTINFO, VNCLOG("8 %i %i %i %i "),rect.br.x,rect.br.y,rect.tl.x,rect.tl.y);
1005 } 1005 }
1006 } 1006 }
1007 1007
@@ -1072,13 +1072,13 @@ vncDesktopThread::run_undetached(void *arg) @@ -1072,13 +1072,13 @@ vncDesktopThread::run_undetached(void *arg)
1072 { 1072 {
1073 if (!WaitMessage()) 1073 if (!WaitMessage())
1074 { 1074 {
1075 - //vnclog.Print(LL_INTERR, VNCLOG("WaitMessage() failed\n")); 1075 + //vnclog.Print(LL_INTERR, VNCLOG("WaitMessage() failed"));
1076 break; 1076 break;
1077 } 1077 }
1078 - //vnclog.Print(LL_INTERR, VNCLOG("WaitMessage()\n")); 1078 + //vnclog.Print(LL_INTERR, VNCLOG("WaitMessage()"));
1079 old_updates_sent=updates_sent; 1079 old_updates_sent=updates_sent;
1080 } 1080 }
1081 - //else vnclog.Print(LL_INTERR, VNCLOG("WaitMessage() skip\n")); 1081 + //else vnclog.Print(LL_INTERR, VNCLOG("WaitMessage() skip"));
1082 }//peek message 1082 }//peek message
1083 1083
1084 1084
@@ -1096,7 +1096,7 @@ vncDesktopThread::run_undetached(void *arg) @@ -1096,7 +1096,7 @@ vncDesktopThread::run_undetached(void *arg)
1096 rect.br.x-=m_desktop->m_ScreenOffsetx; 1096 rect.br.x-=m_desktop->m_ScreenOffsetx;
1097 rect.tl.y-=m_desktop->m_ScreenOffsety; 1097 rect.tl.y-=m_desktop->m_ScreenOffsety;
1098 rect.br.y-=m_desktop->m_ScreenOffsety; 1098 rect.br.y-=m_desktop->m_ScreenOffsety;
1099 -// vnclog.Print(LL_INTERR, VNCLOG("REct %i %i %i %i \n"),rect.tl.x,rect.br.x,rect.tl.y,rect.br.y); 1099 +// vnclog.Print(LL_INTERR, VNCLOG("REct %i %i %i %i "),rect.tl.x,rect.br.x,rect.tl.y,rect.br.y);
1100 1100
1101 rect = rect.intersect(m_desktop->m_Cliprect); 1101 rect = rect.intersect(m_desktop->m_Cliprect);
1102 if (!rect.is_empty()) 1102 if (!rect.is_empty())
@@ -1139,7 +1139,7 @@ vncDesktopThread::run_undetached(void *arg) @@ -1139,7 +1139,7 @@ vncDesktopThread::run_undetached(void *arg)
1139 DispatchMessage(&msg); 1139 DispatchMessage(&msg);
1140 idle_skip = TRUE; 1140 idle_skip = TRUE;
1141 } 1141 }
1142 - // vnclog.Print(LL_INTERR, VNCLOG("Message %i\n"),msg.message); 1142 + // vnclog.Print(LL_INTERR, VNCLOG("Message %i"),msg.message);
1143 }//while 1143 }//while
1144 1144
1145 stop_hookwatch=true; 1145 stop_hookwatch=true;
@@ -1150,7 +1150,7 @@ vncDesktopThread::run_undetached(void *arg) @@ -1150,7 +1150,7 @@ vncDesktopThread::run_undetached(void *arg)
1150 } 1150 }
1151 1151
1152 m_desktop->SetClipboardActive(FALSE); 1152 m_desktop->SetClipboardActive(FALSE);
1153 - vnclog.Print(LL_INTINFO, VNCLOG("quitting desktop server thread\n")); 1153 + vnclog.Print(LL_INTINFO, VNCLOG("quitting desktop server thread"));
1154 1154
1155 // Clear all the hooks and close windows, etc. 1155 // Clear all the hooks and close windows, etc.
1156 m_desktop->SetBlankMonitor(false); 1156 m_desktop->SetBlankMonitor(false);
srcacic/WinVNC/WinVNC/vncencodemgr.h
@@ -289,7 +289,7 @@ vncEncodeMgr::GetPalette(RGBQUAD *quadlist, UINT ncolours) @@ -289,7 +289,7 @@ vncEncodeMgr::GetPalette(RGBQUAD *quadlist, UINT ncolours)
289 // in which case the encoder will be storing RGBQUAD data 289 // in which case the encoder will be storing RGBQUAD data
290 if (m_encoder == NULL) 290 if (m_encoder == NULL)
291 { 291 {
292 - vnclog.Print(LL_INTWARN, VNCLOG("GetPalette called but no encoder set\n")); 292 + vnclog.Print(LL_INTWARN, VNCLOG("GetPalette called but no encoder set"));
293 return FALSE; 293 return FALSE;
294 } 294 }
295 295
@@ -319,7 +319,7 @@ vncEncodeMgr::CheckBuffer() @@ -319,7 +319,7 @@ vncEncodeMgr::CheckBuffer()
319 m_scrinfo.framebufferHeight); 319 m_scrinfo.framebufferHeight);
320 if (m_clientbuffsize != clientbuffsize) 320 if (m_clientbuffsize != clientbuffsize)
321 { 321 {
322 - vnclog.Print(LL_INTINFO, VNCLOG("request client buffer[%u]\n"), clientbuffsize); 322 + vnclog.Print(LL_INTINFO, VNCLOG("request client buffer[%u]"), clientbuffsize);
323 if (m_clientbuff != NULL) 323 if (m_clientbuff != NULL)
324 { 324 {
325 delete [] m_clientbuff; 325 delete [] m_clientbuff;
@@ -330,7 +330,7 @@ vncEncodeMgr::CheckBuffer() @@ -330,7 +330,7 @@ vncEncodeMgr::CheckBuffer()
330 m_clientbuff = new BYTE [clientbuffsize]; 330 m_clientbuff = new BYTE [clientbuffsize];
331 if (m_clientbuff == NULL) 331 if (m_clientbuff == NULL)
332 { 332 {
333 - vnclog.Print(LL_INTERR, VNCLOG("unable to allocate client buffer[%u]\n"), clientbuffsize); 333 + vnclog.Print(LL_INTERR, VNCLOG("unable to allocate client buffer[%u]"), clientbuffsize);
334 return FALSE; 334 return FALSE;
335 } 335 }
336 memset(m_clientbuff, 0, clientbuffsize); 336 memset(m_clientbuff, 0, clientbuffsize);
@@ -341,7 +341,7 @@ vncEncodeMgr::CheckBuffer() @@ -341,7 +341,7 @@ vncEncodeMgr::CheckBuffer()
341 const UINT backbuffsize = m_buffer->m_backbuffsize; 341 const UINT backbuffsize = m_buffer->m_backbuffsize;
342 if (m_clientbackbuffsize != backbuffsize) 342 if (m_clientbackbuffsize != backbuffsize)
343 { 343 {
344 - vnclog.Print(LL_INTINFO, VNCLOG("request client back buffer[%u]\n"), backbuffsize); 344 + vnclog.Print(LL_INTINFO, VNCLOG("request client back buffer[%u]"), backbuffsize);
345 if (m_clientbackbuff) { 345 if (m_clientbackbuff) {
346 delete [] m_clientbackbuff; 346 delete [] m_clientbackbuff;
347 m_clientbackbuff = 0; 347 m_clientbackbuff = 0;
@@ -350,14 +350,14 @@ vncEncodeMgr::CheckBuffer() @@ -350,14 +350,14 @@ vncEncodeMgr::CheckBuffer()
350 350
351 m_clientbackbuff = new BYTE[backbuffsize]; 351 m_clientbackbuff = new BYTE[backbuffsize];
352 if (!m_clientbackbuff) { 352 if (!m_clientbackbuff) {
353 - vnclog.Print(LL_INTERR, VNCLOG("unable to allocate client back buffer[%u]\n"), backbuffsize); 353 + vnclog.Print(LL_INTERR, VNCLOG("unable to allocate client back buffer[%u]"), backbuffsize);
354 return FALSE; 354 return FALSE;
355 } 355 }
356 memset(m_clientbackbuff, 0, backbuffsize); 356 memset(m_clientbackbuff, 0, backbuffsize);
357 m_clientbackbuffsize = backbuffsize; 357 m_clientbackbuffsize = backbuffsize;
358 } 358 }
359 359
360 - vnclog.Print(LL_INTINFO, VNCLOG("remote buffer=%u\n"), m_clientbuffsize);*/ 360 + vnclog.Print(LL_INTINFO, VNCLOG("remote buffer=%u"), m_clientbuffsize);*/
361 361
362 return TRUE; 362 return TRUE;
363 } 363 }
@@ -410,7 +410,7 @@ vncEncodeMgr::SetEncoding(CARD32 encoding,BOOL reinitialize) @@ -410,7 +410,7 @@ vncEncodeMgr::SetEncoding(CARD32 encoding,BOOL reinitialize)
410 410
411 case rfbEncodingRaw: 411 case rfbEncodingRaw:
412 412
413 - vnclog.Print(LL_INTINFO, VNCLOG("raw encoder requested\n")); 413 + vnclog.Print(LL_INTINFO, VNCLOG("raw encoder requested"));
414 414
415 // Create a RAW encoder 415 // Create a RAW encoder
416 m_encoder = new vncEncoder; 416 m_encoder = new vncEncoder;
@@ -420,7 +420,7 @@ vncEncodeMgr::SetEncoding(CARD32 encoding,BOOL reinitialize) @@ -420,7 +420,7 @@ vncEncodeMgr::SetEncoding(CARD32 encoding,BOOL reinitialize)
420 420
421 case rfbEncodingRRE: 421 case rfbEncodingRRE:
422 422
423 - vnclog.Print(LL_INTINFO, VNCLOG("RRE encoder requested\n")); 423 + vnclog.Print(LL_INTINFO, VNCLOG("RRE encoder requested"));
424 424
425 // Create a RRE encoder 425 // Create a RRE encoder
426 m_encoder = new vncEncodeRRE; 426 m_encoder = new vncEncodeRRE;
@@ -430,7 +430,7 @@ vncEncodeMgr::SetEncoding(CARD32 encoding,BOOL reinitialize) @@ -430,7 +430,7 @@ vncEncodeMgr::SetEncoding(CARD32 encoding,BOOL reinitialize)
430 430
431 case rfbEncodingCoRRE: 431 case rfbEncodingCoRRE:
432 432
433 - vnclog.Print(LL_INTINFO, VNCLOG("CoRRE encoder requested\n")); 433 + vnclog.Print(LL_INTINFO, VNCLOG("CoRRE encoder requested"));
434 434
435 // Create a CoRRE encoder 435 // Create a CoRRE encoder
436 m_encoder = new vncEncodeCoRRE; 436 m_encoder = new vncEncodeCoRRE;
@@ -440,7 +440,7 @@ vncEncodeMgr::SetEncoding(CARD32 encoding,BOOL reinitialize) @@ -440,7 +440,7 @@ vncEncodeMgr::SetEncoding(CARD32 encoding,BOOL reinitialize)
440 440
441 case rfbEncodingHextile: 441 case rfbEncodingHextile:
442 442
443 - vnclog.Print(LL_INTINFO, VNCLOG("Hextile encoder requested\n")); 443 + vnclog.Print(LL_INTINFO, VNCLOG("Hextile encoder requested"));
444 444
445 // Create a CoRRE encoder 445 // Create a CoRRE encoder
446 m_encoder = new vncEncodeHexT; 446 m_encoder = new vncEncodeHexT;
@@ -450,7 +450,7 @@ vncEncodeMgr::SetEncoding(CARD32 encoding,BOOL reinitialize) @@ -450,7 +450,7 @@ vncEncodeMgr::SetEncoding(CARD32 encoding,BOOL reinitialize)
450 450
451 case rfbEncodingUltra: 451 case rfbEncodingUltra:
452 452
453 - vnclog.Print(LL_INTINFO, VNCLOG("Ultra encoder requested\n")); 453 + vnclog.Print(LL_INTINFO, VNCLOG("Ultra encoder requested"));
454 454
455 // Create a Zlib encoder, if needed. 455 // Create a Zlib encoder, if needed.
456 // If a Zlib encoder was used previously, then reuse it here 456 // If a Zlib encoder was used previously, then reuse it here
@@ -476,7 +476,7 @@ vncEncodeMgr::SetEncoding(CARD32 encoding,BOOL reinitialize) @@ -476,7 +476,7 @@ vncEncodeMgr::SetEncoding(CARD32 encoding,BOOL reinitialize)
476 break; 476 break;
477 477
478 case rfbEncodingZRLE: 478 case rfbEncodingZRLE:
479 - vnclog.Print(LL_INTINFO, VNCLOG("ZRLE encoder requested\n")); 479 + vnclog.Print(LL_INTINFO, VNCLOG("ZRLE encoder requested"));
480 if (!zrleEncoder) 480 if (!zrleEncoder)
481 zrleEncoder = new vncEncodeZRLE; 481 zrleEncoder = new vncEncodeZRLE;
482 m_encoder = zrleEncoder; 482 m_encoder = zrleEncoder;
@@ -484,7 +484,7 @@ vncEncodeMgr::SetEncoding(CARD32 encoding,BOOL reinitialize) @@ -484,7 +484,7 @@ vncEncodeMgr::SetEncoding(CARD32 encoding,BOOL reinitialize)
484 break; 484 break;
485 485
486 case rfbEncodingZYWRLE: 486 case rfbEncodingZYWRLE:
487 - vnclog.Print(LL_INTINFO, VNCLOG("ZYWRLE encoder requested\n")); 487 + vnclog.Print(LL_INTINFO, VNCLOG("ZYWRLE encoder requested"));
488 if (!zrleEncoder) 488 if (!zrleEncoder)
489 zrleEncoder = new vncEncodeZRLE; 489 zrleEncoder = new vncEncodeZRLE;
490 m_encoder = zrleEncoder; 490 m_encoder = zrleEncoder;
@@ -493,7 +493,7 @@ vncEncodeMgr::SetEncoding(CARD32 encoding,BOOL reinitialize) @@ -493,7 +493,7 @@ vncEncodeMgr::SetEncoding(CARD32 encoding,BOOL reinitialize)
493 493
494 case rfbEncodingZlib: 494 case rfbEncodingZlib:
495 495
496 - vnclog.Print(LL_INTINFO, VNCLOG("Zlib encoder requested\n")); 496 + vnclog.Print(LL_INTINFO, VNCLOG("Zlib encoder requested"));
497 497
498 // Create a Zlib encoder, if needed. 498 // Create a Zlib encoder, if needed.
499 // If a Zlib encoder was used previously, then reuse it here 499 // If a Zlib encoder was used previously, then reuse it here
@@ -513,7 +513,7 @@ vncEncodeMgr::SetEncoding(CARD32 encoding,BOOL reinitialize) @@ -513,7 +513,7 @@ vncEncodeMgr::SetEncoding(CARD32 encoding,BOOL reinitialize)
513 513
514 514
515 case rfbEncodingZlibHex: 515 case rfbEncodingZlibHex:
516 - vnclog.Print(LL_INTINFO, VNCLOG("ZlibHex encoder requested\n")); 516 + vnclog.Print(LL_INTINFO, VNCLOG("ZlibHex encoder requested"));
517 517
518 // Create a ZlibHex encoder, if needed. 518 // Create a ZlibHex encoder, if needed.
519 // If a Zlibhex encoder was used previously, then reuse it here 519 // If a Zlibhex encoder was used previously, then reuse it here
@@ -533,7 +533,7 @@ vncEncodeMgr::SetEncoding(CARD32 encoding,BOOL reinitialize) @@ -533,7 +533,7 @@ vncEncodeMgr::SetEncoding(CARD32 encoding,BOOL reinitialize)
533 533
534 534
535 case rfbEncodingTight: 535 case rfbEncodingTight:
536 - vnclog.Print(LL_INTINFO, VNCLOG("Tight encoder requested\n")); 536 + vnclog.Print(LL_INTINFO, VNCLOG("Tight encoder requested"));
537 537
538 // Create a Tight encoder, if needed. 538 // Create a Tight encoder, if needed.
539 // If a Tight encoder was used previously, then reuse it here 539 // If a Tight encoder was used previously, then reuse it here
@@ -553,7 +553,7 @@ vncEncodeMgr::SetEncoding(CARD32 encoding,BOOL reinitialize) @@ -553,7 +553,7 @@ vncEncodeMgr::SetEncoding(CARD32 encoding,BOOL reinitialize)
553 553
554 default: 554 default:
555 // An unknown encoding was specified 555 // An unknown encoding was specified
556 - vnclog.Print(LL_INTERR, VNCLOG("unknown encoder requested\n")); 556 + vnclog.Print(LL_INTERR, VNCLOG("unknown encoder requested"));
557 557
558 return FALSE; 558 return FALSE;
559 } 559 }
@@ -567,7 +567,7 @@ vncEncodeMgr::SetEncoding(CARD32 encoding,BOOL reinitialize) @@ -567,7 +567,7 @@ vncEncodeMgr::SetEncoding(CARD32 encoding,BOOL reinitialize)
567 if (m_clientfmtset) 567 if (m_clientfmtset)
568 if (!m_encoder->SetRemoteFormat(m_clientformat)) 568 if (!m_encoder->SetRemoteFormat(m_clientformat))
569 { 569 {
570 - vnclog.Print(LL_INTERR, VNCLOG("client pixel format is not supported\n")); 570 + vnclog.Print(LL_INTERR, VNCLOG("client pixel format is not supported"));
571 571
572 return FALSE; 572 return FALSE;
573 } 573 }
@@ -634,7 +634,7 @@ vncEncodeMgr::SetServerFormat() @@ -634,7 +634,7 @@ vncEncodeMgr::SetServerFormat()
634 inline BOOL 634 inline BOOL
635 vncEncodeMgr::SetClientFormat(rfbPixelFormat &format) 635 vncEncodeMgr::SetClientFormat(rfbPixelFormat &format)
636 { 636 {
637 - vnclog.Print(LL_INTINFO, VNCLOG("SetClientFormat called\n")); 637 + vnclog.Print(LL_INTINFO, VNCLOG("SetClientFormat called"));
638 638
639 // Save the desired format 639 // Save the desired format
640 m_clientfmtset = TRUE; 640 m_clientfmtset = TRUE;
@@ -658,7 +658,7 @@ vncEncodeMgr::EncodeRect(const rfb::Rect &amp;rect,VSocket *outconn) @@ -658,7 +658,7 @@ vncEncodeMgr::EncodeRect(const rfb::Rect &amp;rect,VSocket *outconn)
658 // Call the encoder to encode the rectangle into the client buffer... 658 // Call the encoder to encode the rectangle into the client buffer...
659 /*if (!m_clientbackbuffif){*/ 659 /*if (!m_clientbackbuffif){*/
660 if (!m_buffer->m_backbuff){ 660 if (!m_buffer->m_backbuff){
661 - vnclog.Print(LL_INTERR, "no client back-buffer available in EncodeRect\n"); 661 + vnclog.Print(LL_INTERR, "no client back-buffer available in EncodeRect");
662 return 0; 662 return 0;
663 } 663 }
664 if (zlib_encoder_in_use) 664 if (zlib_encoder_in_use)
@@ -839,7 +839,7 @@ vncEncodeMgr::ResetZRLEEncoding(void) @@ -839,7 +839,7 @@ vncEncodeMgr::ResetZRLEEncoding(void)
839 { 839 {
840 if (!m_encoder->SetRemoteFormat(m_clientformat)) 840 if (!m_encoder->SetRemoteFormat(m_clientformat))
841 { 841 {
842 - vnclog.Print(LL_INTERR, VNCLOG("client pixel format is not supported\n")); 842 + vnclog.Print(LL_INTERR, VNCLOG("client pixel format is not supported"));
843 843
844 return FALSE; 844 return FALSE;
845 } 845 }
srcacic/WinVNC/WinVNC/vncencoder.cpp
@@ -184,7 +184,7 @@ vncEncoder::EncodeRect(BYTE *source, VSocket *outConn, BYTE *dest, const RECT &amp;r @@ -184,7 +184,7 @@ vncEncoder::EncodeRect(BYTE *source, VSocket *outConn, BYTE *dest, const RECT &amp;r
184 BOOL 184 BOOL
185 vncEncoder::GetRemotePalette(RGBQUAD *quadlist, UINT ncolours) 185 vncEncoder::GetRemotePalette(RGBQUAD *quadlist, UINT ncolours)
186 { 186 {
187 - vnclog.Print(LL_INTINFO, VNCLOG("remote palette data requested\n")); 187 + vnclog.Print(LL_INTINFO, VNCLOG("remote palette data requested"));
188 188
189 // If the local server is palette-based then call SetTranslateFunction 189 // If the local server is palette-based then call SetTranslateFunction
190 // to update the palette-to-truecolour mapping: 190 // to update the palette-to-truecolour mapping:
@@ -202,7 +202,7 @@ vncEncoder::GetRemotePalette(RGBQUAD *quadlist, UINT ncolours) @@ -202,7 +202,7 @@ vncEncoder::GetRemotePalette(RGBQUAD *quadlist, UINT ncolours)
202 if (m_localformat.trueColour) 202 if (m_localformat.trueColour)
203 { 203 {
204 // Fake BGR233... 204 // Fake BGR233...
205 - vnclog.Print(LL_INTINFO, VNCLOG("generating BGR233 palette data\n")); 205 + vnclog.Print(LL_INTINFO, VNCLOG("generating BGR233 palette data"));
206 206
207 int ncolours = 1 << m_transformat.bitsPerPixel; 207 int ncolours = 1 << m_transformat.bitsPerPixel;
208 if (m_localpalette != NULL) 208 if (m_localpalette != NULL)
@@ -224,7 +224,7 @@ vncEncoder::GetRemotePalette(RGBQUAD *quadlist, UINT ncolours) @@ -224,7 +224,7 @@ vncEncoder::GetRemotePalette(RGBQUAD *quadlist, UINT ncolours)
224 else 224 else
225 { 225 {
226 // Set up RGBQUAD rfbPixelFormat info 226 // Set up RGBQUAD rfbPixelFormat info
227 - vnclog.Print(LL_INTINFO, VNCLOG("generating 8-bit palette data\n")); 227 + vnclog.Print(LL_INTINFO, VNCLOG("generating 8-bit palette data"));
228 228
229 rfbPixelFormat remote; 229 rfbPixelFormat remote;
230 remote.trueColour = TRUE; 230 remote.trueColour = TRUE;
@@ -245,7 +245,7 @@ vncEncoder::GetRemotePalette(RGBQUAD *quadlist, UINT ncolours) @@ -245,7 +245,7 @@ vncEncoder::GetRemotePalette(RGBQUAD *quadlist, UINT ncolours)
245 // Did we create some palette info? 245 // Did we create some palette info?
246 if (m_localpalette == NULL) 246 if (m_localpalette == NULL)
247 { 247 {
248 - vnclog.Print(LL_INTERR, VNCLOG("failed to obtain colour map data!\n")); 248 + vnclog.Print(LL_INTERR, VNCLOG("failed to obtain colour map data!"));
249 return FALSE; 249 return FALSE;
250 } 250 }
251 251
@@ -258,7 +258,7 @@ vncEncoder::GetRemotePalette(RGBQUAD *quadlist, UINT ncolours) @@ -258,7 +258,7 @@ vncEncoder::GetRemotePalette(RGBQUAD *quadlist, UINT ncolours)
258 BOOL 258 BOOL
259 vncEncoder::SetTranslateFunction() 259 vncEncoder::SetTranslateFunction()
260 { 260 {
261 - vnclog.Print(LL_INTINFO, VNCLOG("settranslatefunction called\n")); 261 + vnclog.Print(LL_INTINFO, VNCLOG("settranslatefunction called"));
262 262
263 // By default, the actual format translated to matches the client format 263 // By default, the actual format translated to matches the client format
264 m_transformat = m_remoteformat; 264 m_transformat = m_remoteformat;
@@ -270,7 +270,7 @@ vncEncoder::SetTranslateFunction() @@ -270,7 +270,7 @@ vncEncoder::SetTranslateFunction()
270 (m_transformat.bitsPerPixel != 32)) 270 (m_transformat.bitsPerPixel != 32))
271 { 271 {
272 vnclog.Print(LL_CONNERR, 272 vnclog.Print(LL_CONNERR,
273 - VNCLOG("only 8, 16 or 32 bits supported remotely - %d requested\n"), 273 + VNCLOG("only 8, 16 or 32 bits supported remotely - %d requested"),
274 m_transformat.bitsPerPixel 274 m_transformat.bitsPerPixel
275 ); 275 );
276 276
@@ -282,7 +282,7 @@ vncEncoder::SetTranslateFunction() @@ -282,7 +282,7 @@ vncEncoder::SetTranslateFunction()
282 (m_localformat.bitsPerPixel != 32)) 282 (m_localformat.bitsPerPixel != 32))
283 { 283 {
284 vnclog.Print(LL_CONNERR, 284 vnclog.Print(LL_CONNERR,
285 - VNCLOG("only 8, 16 or 32 bits supported locally - %d in use\n"), 285 + VNCLOG("only 8, 16 or 32 bits supported locally - %d in use"),
286 m_localformat.bitsPerPixel 286 m_localformat.bitsPerPixel
287 ); 287 );
288 288
@@ -291,12 +291,12 @@ vncEncoder::SetTranslateFunction() @@ -291,12 +291,12 @@ vncEncoder::SetTranslateFunction()
291 291
292 if (!m_transformat.trueColour && (m_transformat.bitsPerPixel != 8)) 292 if (!m_transformat.trueColour && (m_transformat.bitsPerPixel != 8))
293 { 293 {
294 - vnclog.Print(LL_CONNERR, VNCLOG("only 8-bit palette format supported remotely\n")); 294 + vnclog.Print(LL_CONNERR, VNCLOG("only 8-bit palette format supported remotely"));
295 return FALSE; 295 return FALSE;
296 } 296 }
297 if (!m_localformat.trueColour && (m_localformat.bitsPerPixel != 8)) 297 if (!m_localformat.trueColour && (m_localformat.bitsPerPixel != 8))
298 { 298 {
299 - vnclog.Print(LL_CONNERR, VNCLOG("only 8-bit palette format supported locally\n")); 299 + vnclog.Print(LL_CONNERR, VNCLOG("only 8-bit palette format supported locally"));
300 return FALSE; 300 return FALSE;
301 } 301 }
302 302
@@ -310,7 +310,7 @@ vncEncoder::SetTranslateFunction() @@ -310,7 +310,7 @@ vncEncoder::SetTranslateFunction()
310 (m_localformat.bitsPerPixel == m_transformat.bitsPerPixel)) 310 (m_localformat.bitsPerPixel == m_transformat.bitsPerPixel))
311 { 311 {
312 // Yes, so don't do any encoding 312 // Yes, so don't do any encoding
313 - vnclog.Print(LL_INTINFO, VNCLOG("no encoding required - both 8-bit palettized\n")); 313 + vnclog.Print(LL_INTINFO, VNCLOG("no encoding required - both 8-bit palettized"));
314 314
315 m_transfunc = rfbTranslateNone; 315 m_transfunc = rfbTranslateNone;
316 316
@@ -321,7 +321,7 @@ vncEncoder::SetTranslateFunction() @@ -321,7 +321,7 @@ vncEncoder::SetTranslateFunction()
321 else if (m_localformat.trueColour) 321 else if (m_localformat.trueColour)
322 { 322 {
323 // Local side is truecolour, remote is palettized 323 // Local side is truecolour, remote is palettized
324 - vnclog.Print(LL_INTINFO, VNCLOG("local truecolour, remote palettized. using BGR233 palette\n")); 324 + vnclog.Print(LL_INTINFO, VNCLOG("local truecolour, remote palettized. using BGR233 palette"));
325 325
326 // Fill out the translation table as if writing to BGR233 326 // Fill out the translation table as if writing to BGR233
327 m_transformat = BGR233Format; 327 m_transformat = BGR233Format;
@@ -331,7 +331,7 @@ vncEncoder::SetTranslateFunction() @@ -331,7 +331,7 @@ vncEncoder::SetTranslateFunction()
331 else 331 else
332 { 332 {
333 // No, so not supported yet... 333 // No, so not supported yet...
334 - vnclog.Print(LL_CONNERR, VNCLOG("unknown local pixel format in use!\n")); 334 + vnclog.Print(LL_CONNERR, VNCLOG("unknown local pixel format in use!"));
335 return FALSE; 335 return FALSE;
336 } 336 }
337 } 337 }
@@ -344,7 +344,7 @@ vncEncoder::SetTranslateFunction() @@ -344,7 +344,7 @@ vncEncoder::SetTranslateFunction()
344 // 8-bit palette to truecolour... 344 // 8-bit palette to truecolour...
345 345
346 // Yes, so pick the right translation function! 346 // Yes, so pick the right translation function!
347 - vnclog.Print(LL_INTINFO, VNCLOG("using 8-bit colourmap to truecolour translation\n")); 347 + vnclog.Print(LL_INTINFO, VNCLOG("using 8-bit colourmap to truecolour translation"));
348 348
349 m_transfunc = rfbTranslateWithSingleTableFns 349 m_transfunc = rfbTranslateWithSingleTableFns
350 [m_localformat.bitsPerPixel / 16] 350 [m_localformat.bitsPerPixel / 16]
@@ -361,7 +361,7 @@ vncEncoder::SetTranslateFunction() @@ -361,7 +361,7 @@ vncEncoder::SetTranslateFunction()
361 if (PF_EQ(m_transformat,m_localformat)) 361 if (PF_EQ(m_transformat,m_localformat))
362 { 362 {
363 // Yes, so use the null translation function 363 // Yes, so use the null translation function
364 - vnclog.Print(LL_INTINFO, VNCLOG("no translation required\n")); 364 + vnclog.Print(LL_INTINFO, VNCLOG("no translation required"));
365 365
366 m_transfunc = rfbTranslateNone; 366 m_transfunc = rfbTranslateNone;
367 367
@@ -372,7 +372,7 @@ vncEncoder::SetTranslateFunction() @@ -372,7 +372,7 @@ vncEncoder::SetTranslateFunction()
372 if (m_localformat.bitsPerPixel == 16) 372 if (m_localformat.bitsPerPixel == 16)
373 { 373 {
374 // Yes, so use a single lookup-table 374 // Yes, so use a single lookup-table
375 - vnclog.Print(LL_INTINFO, VNCLOG("single LUT used\n")); 375 + vnclog.Print(LL_INTINFO, VNCLOG("single LUT used"));
376 376
377 m_transfunc = rfbTranslateWithSingleTableFns 377 m_transfunc = rfbTranslateWithSingleTableFns
378 [m_localformat.bitsPerPixel / 16] 378 [m_localformat.bitsPerPixel / 16]
@@ -384,7 +384,7 @@ vncEncoder::SetTranslateFunction() @@ -384,7 +384,7 @@ vncEncoder::SetTranslateFunction()
384 else 384 else
385 { 385 {
386 // No, so use three tables - one for each of R, G, B. 386 // No, so use three tables - one for each of R, G, B.
387 - vnclog.Print(LL_INTINFO, VNCLOG("triple LUT used\n")); 387 + vnclog.Print(LL_INTINFO, VNCLOG("triple LUT used"));
388 388
389 m_transfunc = rfbTranslateWithRGBTablesFns 389 m_transfunc = rfbTranslateWithRGBTablesFns
390 [m_localformat.bitsPerPixel / 16] 390 [m_localformat.bitsPerPixel / 16]
srcacic/WinVNC/WinVNC/vncencoderCursor.cpp
@@ -41,14 +41,14 @@ vncEncoder::SendCursorShape(VSocket *outConn, vncDesktop *desktop) @@ -41,14 +41,14 @@ vncEncoder::SendCursorShape(VSocket *outConn, vncDesktop *desktop)
41 // Check mouse cursor handle 41 // Check mouse cursor handle
42 HCURSOR hcursor = desktop->GetCursor(); 42 HCURSOR hcursor = desktop->GetCursor();
43 if (hcursor == NULL) { 43 if (hcursor == NULL) {
44 - vnclog.Print(LL_INTINFO, VNCLOG("cursor handle is NULL.\n")); 44 + vnclog.Print(LL_INTINFO, VNCLOG("cursor handle is NULL."));
45 return FALSE; 45 return FALSE;
46 } 46 }
47 47
48 // Get cursor info 48 // Get cursor info
49 ICONINFO IconInfo; 49 ICONINFO IconInfo;
50 if (!GetIconInfo(hcursor, &IconInfo)) { 50 if (!GetIconInfo(hcursor, &IconInfo)) {
51 - vnclog.Print(LL_INTINFO, VNCLOG("GetIconInfo() failed.\n")); 51 + vnclog.Print(LL_INTINFO, VNCLOG("GetIconInfo() failed."));
52 return FALSE; 52 return FALSE;
53 } 53 }
54 BOOL isColorCursor = FALSE; 54 BOOL isColorCursor = FALSE;
@@ -57,19 +57,19 @@ vncEncoder::SendCursorShape(VSocket *outConn, vncDesktop *desktop) @@ -57,19 +57,19 @@ vncEncoder::SendCursorShape(VSocket *outConn, vncDesktop *desktop)
57 DeleteObject(IconInfo.hbmColor); 57 DeleteObject(IconInfo.hbmColor);
58 } 58 }
59 if (IconInfo.hbmMask == NULL) { 59 if (IconInfo.hbmMask == NULL) {
60 - vnclog.Print(LL_INTINFO, VNCLOG("cursor bitmap handle is NULL.\n")); 60 + vnclog.Print(LL_INTINFO, VNCLOG("cursor bitmap handle is NULL."));
61 return FALSE; 61 return FALSE;
62 } 62 }
63 63
64 // Check bitmap info for the cursor 64 // Check bitmap info for the cursor
65 BITMAP bmMask; 65 BITMAP bmMask;
66 if (!GetObject(IconInfo.hbmMask, sizeof(BITMAP), (LPVOID)&bmMask)) { 66 if (!GetObject(IconInfo.hbmMask, sizeof(BITMAP), (LPVOID)&bmMask)) {
67 - vnclog.Print(LL_INTINFO, VNCLOG("GetObject() for bitmap failed.\n")); 67 + vnclog.Print(LL_INTINFO, VNCLOG("GetObject() for bitmap failed."));
68 DeleteObject(IconInfo.hbmMask); 68 DeleteObject(IconInfo.hbmMask);
69 return FALSE; 69 return FALSE;
70 } 70 }
71 if (bmMask.bmPlanes != 1 || bmMask.bmBitsPixel != 1) { 71 if (bmMask.bmPlanes != 1 || bmMask.bmBitsPixel != 1) {
72 - vnclog.Print(LL_INTINFO, VNCLOG("incorrect data in cursor bitmap.\n")); 72 + vnclog.Print(LL_INTINFO, VNCLOG("incorrect data in cursor bitmap."));
73 DeleteObject(IconInfo.hbmMask); 73 DeleteObject(IconInfo.hbmMask);
74 return FALSE; 74 return FALSE;
75 } 75 }
@@ -85,7 +85,7 @@ vncEncoder::SendCursorShape(VSocket *outConn, vncDesktop *desktop) @@ -85,7 +85,7 @@ vncEncoder::SendCursorShape(VSocket *outConn, vncDesktop *desktop)
85 DeleteObject(IconInfo.hbmMask); 85 DeleteObject(IconInfo.hbmMask);
86 86
87 if (!success) { 87 if (!success) {
88 - vnclog.Print(LL_INTINFO, VNCLOG("GetBitmapBits() failed.\n")); 88 + vnclog.Print(LL_INTINFO, VNCLOG("GetBitmapBits() failed."));
89 delete[] mbits; 89 delete[] mbits;
90 return FALSE; 90 return FALSE;
91 } 91 }
@@ -109,7 +109,7 @@ vncEncoder::SendCursorShape(VSocket *outConn, vncDesktop *desktop) @@ -109,7 +109,7 @@ vncEncoder::SendCursorShape(VSocket *outConn, vncDesktop *desktop)
109 return FALSE; 109 return FALSE;
110 } 110 }
111 if (!desktop->GetRichCursorData(cbits, hcursor, width, height)) { 111 if (!desktop->GetRichCursorData(cbits, hcursor, width, height)) {
112 - vnclog.Print(LL_INTINFO, VNCLOG("vncDesktop::GetRichCursorData() failed.\n")); 112 + vnclog.Print(LL_INTINFO, VNCLOG("vncDesktop::GetRichCursorData() failed."));
113 delete[] mbits; 113 delete[] mbits;
114 delete[] cbits; 114 delete[] cbits;
115 return FALSE; 115 return FALSE;
srcacic/WinVNC/WinVNC/vnckeymap.cpp
@@ -364,24 +364,24 @@ public: @@ -364,24 +364,24 @@ public:
364 void press() { 364 void press() {
365 if (!(GetAsyncKeyState(vkCode) & 0x8000)) { 365 if (!(GetAsyncKeyState(vkCode) & 0x8000)) {
366 doKeyboardEvent(vkCode, flags); 366 doKeyboardEvent(vkCode, flags);
367 - vnclog.Print(LL_INTINFO, "fake %d down\n", vkCode); 367 + vnclog.Print(LL_INTINFO, "fake %d down", vkCode);
368 pressed = true; 368 pressed = true;
369 } 369 }
370 } 370 }
371 void release() { 371 void release() {
372 if (GetAsyncKeyState(vkCode) & 0x8000) { 372 if (GetAsyncKeyState(vkCode) & 0x8000) {
373 doKeyboardEvent(vkCode, flags | KEYEVENTF_KEYUP); 373 doKeyboardEvent(vkCode, flags | KEYEVENTF_KEYUP);
374 - vnclog.Print(LL_INTINFO, "fake %d up\n", vkCode); 374 + vnclog.Print(LL_INTINFO, "fake %d up", vkCode);
375 released = true; 375 released = true;
376 } 376 }
377 } 377 }
378 ~KeyStateModifier() { 378 ~KeyStateModifier() {
379 if (pressed) { 379 if (pressed) {
380 doKeyboardEvent(vkCode, flags | KEYEVENTF_KEYUP); 380 doKeyboardEvent(vkCode, flags | KEYEVENTF_KEYUP);
381 - vnclog.Print(LL_INTINFO, "fake %d up\n", vkCode); 381 + vnclog.Print(LL_INTINFO, "fake %d up", vkCode);
382 } else if (released) { 382 } else if (released) {
383 doKeyboardEvent(vkCode, flags); 383 doKeyboardEvent(vkCode, flags);
384 - vnclog.Print(LL_INTINFO, "fake %d down\n", vkCode); 384 + vnclog.Print(LL_INTINFO, "fake %d down", vkCode);
385 } 385 }
386 } 386 }
387 int vkCode; 387 int vkCode;
@@ -455,11 +455,11 @@ public: @@ -455,11 +455,11 @@ public:
455 455
456 void keyEvent(rdr::U32 keysym, bool down, bool jap) 456 void keyEvent(rdr::U32 keysym, bool down, bool jap)
457 { 457 {
458 - vnclog.Print(LL_INTWARN, " keysym 0x%x",keysym); 458 + vnclog.Print(LL_INTWARN, "keysym 0x%x",keysym);
459 if (keysym>=XK_dead_grave && keysym <=XK_dead_belowdot)// && down) 459 if (keysym>=XK_dead_grave && keysym <=XK_dead_belowdot)// && down)
460 { 460 {
461 keysymDead=keysym; 461 keysymDead=keysym;
462 - vnclog.Print(LL_INTWARN, " ************** DEAD KEY"); 462 + vnclog.Print(LL_INTWARN, "************** DEAD KEY");
463 //we have a dead key 463 //we have a dead key
464 //Record dead key 464 //Record dead key
465 return; 465 return;
@@ -470,7 +470,7 @@ public: @@ -470,7 +470,7 @@ public:
470 { 470 {
471 if (keysymDead!=0 && down) 471 if (keysymDead!=0 && down)
472 { 472 {
473 - vnclog.Print(LL_INTWARN, " Compose dead 0x%x 0x%x",keysymDead,keysym); 473 + vnclog.Print(LL_INTWARN, "Compose dead 0x%x 0x%x",keysymDead,keysym);
474 switch (keysymDead) 474 switch (keysymDead)
475 { 475 {
476 case XK_dead_grave: 476 case XK_dead_grave:
@@ -552,7 +552,7 @@ public: @@ -552,7 +552,7 @@ public:
552 } 552 }
553 } 553 }
554 keysymDead=0; 554 keysymDead=0;
555 - vnclog.Print(LL_INTWARN, " Composed 0x%x",keysym); 555 + vnclog.Print(LL_INTWARN, "Composed 0x%x",keysym);
556 556
557 } 557 }
558 // ordinary Latin-1 character 558 // ordinary Latin-1 character
@@ -572,7 +572,7 @@ public: @@ -572,7 +572,7 @@ public:
572 } 572 }
573 } 573 }
574 574
575 - vnclog.Print(LL_INTWARN, " SHORT s %i",s); 575 + vnclog.Print(LL_INTWARN, "SHORT s %i",s);
576 576
577 if (s == -1) 577 if (s == -1)
578 { 578 {
@@ -581,7 +581,7 @@ public: @@ -581,7 +581,7 @@ public:
581 vnclog.Print(LL_INTWARN, "down"); 581 vnclog.Print(LL_INTWARN, "down");
582 // not a single keypress - try synthesizing dead chars. 582 // not a single keypress - try synthesizing dead chars.
583 { 583 {
584 - vnclog.Print(LL_INTWARN, " Found key"); 584 + vnclog.Print(LL_INTWARN, "Found key");
585 //Lookup ascii representation 585 //Lookup ascii representation
586 int ascii=0; 586 int ascii=0;
587 for (ascii=0;ascii<256;ascii++) 587 for (ascii=0;ascii<256;ascii++)
@@ -614,7 +614,7 @@ public: @@ -614,7 +614,7 @@ public:
614 } 614 }
615 615
616 /*if (s == -1) { 616 /*if (s == -1) {
617 - vnclog.Print(LL_INTWARN, "ignoring unrecognised Latin-1 keysym %d\n", 617 + vnclog.Print(LL_INTWARN, "ignoring unrecognised Latin-1 keysym %d",
618 keysym); 618 keysym);
619 keybd_event( VK_MENU, MapVirtualKey(VK_MENU, 0),0, 0); 619 keybd_event( VK_MENU, MapVirtualKey(VK_MENU, 0),0, 0);
620 keybd_event( VK_MENU, MapVirtualKey(VK_MENU, 0),KEYEVENTF_KEYUP, 0); 620 keybd_event( VK_MENU, MapVirtualKey(VK_MENU, 0),KEYEVENTF_KEYUP, 0);
@@ -657,7 +657,7 @@ public: @@ -657,7 +657,7 @@ public:
657 } 657 }
658 } 658 }
659 vnclog.Print(LL_INTINFO, 659 vnclog.Print(LL_INTINFO,
660 - "latin-1 key: keysym %d(0x%x) vkCode 0x%x down %d capslockOn %d\n", 660 + "latin-1 key: keysym %d(0x%x) vkCode 0x%x down %d capslockOn %d",
661 keysym, keysym, vkCode, down, capslockOn); 661 keysym, keysym, vkCode, down, capslockOn);
662 662
663 doKeyboardEvent(vkCode, down ? 0 : KEYEVENTF_KEYUP); 663 doKeyboardEvent(vkCode, down ? 0 : KEYEVENTF_KEYUP);
@@ -667,7 +667,7 @@ public: @@ -667,7 +667,7 @@ public:
667 // see if it's a recognised keyboard key, otherwise ignore it 667 // see if it's a recognised keyboard key, otherwise ignore it
668 668
669 if (vkMap.find(keysym) == vkMap.end()) { 669 if (vkMap.find(keysym) == vkMap.end()) {
670 - vnclog.Print(LL_INTWARN, "ignoring unknown keysym %d\n",keysym); 670 + vnclog.Print(LL_INTWARN, "ignoring unknown keysym %d",keysym);
671 return; 671 return;
672 } 672 }
673 BYTE vkCode = vkMap[keysym]; 673 BYTE vkCode = vkMap[keysym];
@@ -676,7 +676,7 @@ public: @@ -676,7 +676,7 @@ public:
676 if (!down) flags |= KEYEVENTF_KEYUP; 676 if (!down) flags |= KEYEVENTF_KEYUP;
677 677
678 // vnclog.Print(LL_INTINFO, 678 // vnclog.Print(LL_INTINFO,
679 - // "keyboard key: keysym %d(0x%x) vkCode 0x%x ext %d down %d\n", 679 + // "keyboard key: keysym %d(0x%x) vkCode 0x%x ext %d down %d",
680 // keysym, keysym, vkCode, extendedMap[keysym], down); 680 // keysym, keysym, vkCode, extendedMap[keysym], down);
681 681
682 if (down && (vkCode == VK_DELETE) && 682 if (down && (vkCode == VK_DELETE) &&
@@ -685,12 +685,12 @@ public: @@ -685,12 +685,12 @@ public:
685 vncService::IsWinNT()) 685 vncService::IsWinNT())
686 { 686 {
687 vnclog.Print(LL_INTINFO, 687 vnclog.Print(LL_INTINFO,
688 - "CAD\n"); 688 + "CAD");
689 // If running under Vista and started from Session0 in Application mode 689 // If running under Vista and started from Session0 in Application mode
690 if (vncService::VersionMajor()>=6 && vncService::RunningFromExternalService() ) 690 if (vncService::VersionMajor()>=6 && vncService::RunningFromExternalService() )
691 { 691 {
692 vnclog.Print(LL_INTINFO, 692 vnclog.Print(LL_INTINFO,
693 - "Vista and runnning as system -> CAD\n"); 693 + "Vista and runnning as system -> CAD");
694 694
695 // Try to run the special Vista cad.exe file... 695 // Try to run the special Vista cad.exe file...
696 HANDLE ThreadHandle2; 696 HANDLE ThreadHandle2;
@@ -701,13 +701,13 @@ public: @@ -701,13 +701,13 @@ public:
701 else if (vncService::VersionMajor()>=6) 701 else if (vncService::VersionMajor()>=6)
702 { 702 {
703 vnclog.Print(LL_INTINFO, 703 vnclog.Print(LL_INTINFO,
704 - "Vista and runnning as user -> Taskmgr\n"); 704 + "Vista and runnning as user -> Taskmgr");
705 WinExec("taskmgr.exe", SW_SHOWNORMAL); 705 WinExec("taskmgr.exe", SW_SHOWNORMAL);
706 } 706 }
707 else 707 else
708 { 708 {
709 vnclog.Print(LL_INTINFO, 709 vnclog.Print(LL_INTINFO,
710 - "Not Vista, use old method\n"); 710 + "Not Vista, use old method");
711 vncService::SimulateCtrlAltDel(); 711 vncService::SimulateCtrlAltDel();
712 } 712 }
713 return; 713 return;
@@ -747,7 +747,7 @@ SetShiftState(BYTE key, BOOL down) @@ -747,7 +747,7 @@ SetShiftState(BYTE key, BOOL down)
747 return; 747 return;
748 748
749 vnclog.Print(LL_INTINFO, 749 vnclog.Print(LL_INTINFO,
750 - VNCLOG("setshiftstate %d - (%s->%s)\n"), 750 + VNCLOG("setshiftstate %d - (%s->%s)"),
751 key, keystate ? "down" : "up", 751 key, keystate ? "down" : "up",
752 down ? "down" : "up"); 752 down ? "down" : "up");
753 753
@@ -756,7 +756,7 @@ SetShiftState(BYTE key, BOOL down) @@ -756,7 +756,7 @@ SetShiftState(BYTE key, BOOL down)
756 keystate = (GetAsyncKeyState(key) & 0x8000) != 0; 756 keystate = (GetAsyncKeyState(key) & 0x8000) != 0;
757 757
758 vnclog.Print(LL_INTINFO, 758 vnclog.Print(LL_INTINFO,
759 - VNCLOG("new state %d (%s)\n"), 759 + VNCLOG("new state %d (%s)"),
760 key, keystate ? "down" : "up"); 760 key, keystate ? "down" : "up");
761 } 761 }
762 762
srcacic/WinVNC/WinVNC/vnclog.cpp
@@ -30,6 +30,8 @@ @@ -30,6 +30,8 @@
30 #include "CACIC_Con.h" 30 #include "CACIC_Con.h"
31 #include "CACIC_Auth.h" 31 #include "CACIC_Auth.h"
32 32
  33 +using namespace std;
  34 +
33 ////////////////////////////////////////////////////////////////////// 35 //////////////////////////////////////////////////////////////////////
34 // Construction/Destruction 36 // Construction/Destruction
35 ////////////////////////////////////////////////////////////////////// 37 //////////////////////////////////////////////////////////////////////
@@ -43,6 +45,10 @@ const int VNCLog::ToScript = 8; @@ -43,6 +45,10 @@ const int VNCLog::ToScript = 8;
43 45
44 static const int LINE_BUFFER_SIZE = 1024; 46 static const int LINE_BUFFER_SIZE = 1024;
45 47
  48 +
  49 +
  50 +//static const string srVersion = "2.6.0.0";
  51 +
46 VNCLog::VNCLog() 52 VNCLog::VNCLog()
47 : m_tofile(false) 53 : m_tofile(false)
48 , m_todebug(false) 54 , m_todebug(false)
@@ -128,7 +134,7 @@ void VNCLog::OpenFile() @@ -128,7 +134,7 @@ void VNCLog::OpenFile()
128 { 134 {
129 m_todebug = true; 135 m_todebug = true;
130 m_tofile = false; 136 m_tofile = false;
131 - Print(0, "Error opening log file\n"); 137 + Print(0, "Error opening log file");
132 return; 138 return;
133 } 139 }
134 140
@@ -161,7 +167,7 @@ void VNCLog::OpenFile() @@ -161,7 +167,7 @@ void VNCLog::OpenFile()
161 // We should throw an exception here 167 // We should throw an exception here
162 m_todebug = true; 168 m_todebug = true;
163 m_tofile = false; 169 m_tofile = false;
164 - Print(0, "Error opening log file %s\n", m_filename); 170 + Print(0, "Error opening log file %s", m_filename);
165 } 171 }
166 if (m_append) { 172 if (m_append) {
167 SetFilePointer( hlogfile, 0, NULL, FILE_END ); 173 SetFilePointer( hlogfile, 0, NULL, FILE_END );
@@ -199,12 +205,21 @@ inline void VNCLog::ReallyPrintLine(const char* line) @@ -199,12 +205,21 @@ inline void VNCLog::ReallyPrintLine(const char* line)
199 strLine.append(data_buf); 205 strLine.append(data_buf);
200 strLine.append(" : "); 206 strLine.append(" : ");
201 strLine.append("[Suporte Remoto]"); 207 strLine.append("[Suporte Remoto]");
  208 +
202 //if (/*Verificar modo DEBUG!*/){ 209 //if (/*Verificar modo DEBUG!*/){
203 // strLine.append(" ("); 210 // strLine.append(" (");
204 // strLine.append(/*Funcao de retorno da Versao: v.2.6.0.0*/); 211 // strLine.append(/*Funcao de retorno da Versao: v.2.6.0.0*/);
205 // strLine.append(")"); 212 // strLine.append(")");
206 // strLine.append(" DEBUG -"); 213 // strLine.append(" DEBUG -");
207 //} 214 //}
  215 +
  216 + if (IsDebugModeON()) {
  217 + strLine.append(" (v.");
  218 + strLine.append(SRVersion());
  219 + strLine.append(")");
  220 + strLine.append(" DEBUG -");
  221 + }
  222 +
208 strLine.append(" "); 223 strLine.append(" ");
209 strLine.append(line); 224 strLine.append(line);
210 DWORD byteswritten; 225 DWORD byteswritten;
@@ -229,11 +244,14 @@ void VNCLog::ReallyPrint(const char* format, va_list ap) @@ -229,11 +244,14 @@ void VNCLog::ReallyPrint(const char* format, va_list ap)
229 if (dwErrorCode != 0) { 244 if (dwErrorCode != 0) {
230 FormatMessage( 245 FormatMessage(
231 FORMAT_MESSAGE_FROM_SYSTEM, NULL, dwErrorCode, 246 FORMAT_MESSAGE_FROM_SYSTEM, NULL, dwErrorCode,
  247 + //FORMAT_MESSAGE_IGNORE_INSERTS, NULL, dwErrorCode,
  248 + //FORMAT_MESSAGE_MAX_WIDTH_MASK, NULL, dwErrorCode,
232 MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),(char *)&szErrorMsg, 249 MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),(char *)&szErrorMsg,
233 LINE_BUFFER_SIZE, NULL); 250 LINE_BUFFER_SIZE, NULL);
234 - strcat(line," --"); 251 + strcat(line," -- ");
235 strcat(line,szErrorMsg); 252 strcat(line,szErrorMsg);
236 } 253 }
  254 + else strcat(line,"\r\n");
237 ReallyPrintLine(line); 255 ReallyPrintLine(line);
238 } 256 }
239 257
@@ -251,6 +269,58 @@ VNCLog::~VNCLog() @@ -251,6 +269,58 @@ VNCLog::~VNCLog()
251 } 269 }
252 } 270 }
253 271
  272 +bool VNCLog::IsDebugModeON(){
  273 +// LPCTSTR diretorio_debugs;
  274 +
  275 +/** Trecho especifico para teste com o Path fixo do Cacic.
  276 + string caminho = "C:\\Cacic\\Temp\\debugs";
  277 + diretorio_debugs = caminho.c_str();
  278 +*/
  279 +
  280 +// LPTSTR diretorio_corrente;
  281 +// string diretorio;
  282 +// string diretorio = "Temp\\debugs";
  283 +// SetCurrentDirectory("..");
  284 +// GetCurrentDirectory(MAX_PATH,diretorio_corrente);
  285 +// diretorio.append(diretorio_corrente);
  286 +// diretorio.replace(diretorio.begin(),diretorio.end(),'\',"\\");
  287 +// diretorio.append ("Temp\\debugs");
  288 +/*
  289 + diretorio_corrente = (LPTSTR)diretorio.c_str();
  290 + MessageBox (NULL,diretorio_corrente,"Warning! Nussa!!! o.O", MB_OKCANCEL| MB_ICONASTERISK);
  291 +*/
  292 +// diretorio_debugs = diretorio.c_str();
  293 +
  294 + HANDLE hDir = CreateFile("Temp\\debugs",
  295 + GENERIC_ALL,
  296 + FILE_SHARE_READ,
  297 + NULL,
  298 + OPEN_EXISTING,
  299 + FILE_ATTRIBUTE_NORMAL | FILE_FLAG_BACKUP_SEMANTICS,
  300 + NULL);
  301 + if (hDir == INVALID_HANDLE_VALUE){
  302 + CloseHandle(hDir);
  303 + return false;
  304 + }
  305 +
  306 + FILETIME dirCreationTime;
  307 + SYSTEMTIME dirCreationTimeSystem, currentSystemTime;
  308 +
  309 + if (GetFileTime(hDir, &dirCreationTime, NULL, NULL)) {
  310 + FileTimeToSystemTime (&dirCreationTime,&dirCreationTimeSystem);
  311 + GetSystemTime(&currentSystemTime);
  312 + CloseHandle(hDir);
  313 + if (CACIC_Utils::DateCompare (currentSystemTime,dirCreationTimeSystem) == 0){
  314 + return true;
  315 + }
  316 + else {
  317 + return false;
  318 + }
  319 + }
  320 + CloseHandle(hDir);
  321 + return false;
  322 +}
  323 +
254 void VNCLog::GetLastErrorMsg(LPSTR szErrorMsg) const { 324 void VNCLog::GetLastErrorMsg(LPSTR szErrorMsg) const {
255 325
256 DWORD dwErrorCode = GetLastError(); 326 DWORD dwErrorCode = GetLastError();
srcacic/WinVNC/WinVNC/vnclog.h
@@ -32,7 +32,7 @@ @@ -32,7 +32,7 @@
32 // Log log; 32 // Log log;
33 // log.SetFile( _T("myapp.log") ); 33 // log.SetFile( _T("myapp.log") );
34 // ... 34 // ...
35 -// log.Print(2, _T("x = %d\n"), x); 35 +// log.Print(2, _T("x = %d"), x);
36 // 36 //
37 37
38 #ifndef VNCLOGGING 38 #ifndef VNCLOGGING
@@ -42,8 +42,12 @@ @@ -42,8 +42,12 @@
42 #include <stdio.h> 42 #include <stdio.h>
43 #include <time.h> 43 #include <time.h>
44 44
  45 +#include "CACIC_Utils.h"
  46 +
45 #define SCRIPT "srcacic_set_session.php" 47 #define SCRIPT "srcacic_set_session.php"
46 48
  49 +#define SRVERSION "2.6.0.0"
  50 +
47 class VNCLog 51 class VNCLog
48 { 52 {
49 public: 53 public:
@@ -84,12 +88,11 @@ public: @@ -84,12 +88,11 @@ public:
84 // the log mode includes ToFile 88 // the log mode includes ToFile
85 void SetFile(const char* filename, bool append = false); 89 void SetFile(const char* filename, bool append = false);
86 90
87 - /**  
88 - * Verifica a existencia do diretorio debugs.  
89 - */  
90 - 91 + /** Verifica a existencia do diretorio debugs em "..\Temp\debugs.*/
  92 + bool IsDebugModeON();
91 93
92 virtual ~VNCLog(); 94 virtual ~VNCLog();
  95 + string SRVersion(){return SRVERSION;};
93 96
94 private: 97 private:
95 void ReallyPrintLine(const char* line); 98 void ReallyPrintLine(const char* line);
srcacic/WinVNC/WinVNC/vncmenu.cpp
@@ -172,7 +172,7 @@ vncMenu::vncMenu(vncServer *server) @@ -172,7 +172,7 @@ vncMenu::vncMenu(vncServer *server)
172 172
173 //if (strcmp(m_username, "") == 0) 173 //if (strcmp(m_username, "") == 0)
174 // strcpy((char *)&m_username, "SYSTEM"); 174 // strcpy((char *)&m_username, "SYSTEM");
175 - //vnclog.Print(LL_INTERR, VNCLOG("########### vncMenu::vncMenu - UserName = %s\n"), m_username); 175 + //vnclog.Print(LL_INTERR, VNCLOG("########### vncMenu::vncMenu - UserName = %s"), m_username);
176 176
177 // Create a dummy window to handle tray icon messages 177 // Create a dummy window to handle tray icon messages
178 WNDCLASSEX wndclass; 178 WNDCLASSEX wndclass;
@@ -383,26 +383,26 @@ vncMenu::~vncMenu() @@ -383,26 +383,26 @@ vncMenu::~vncMenu()
383 void 383 void
384 vncMenu::AddTrayIcon() 384 vncMenu::AddTrayIcon()
385 { 385 {
386 - //vnclog.Print(LL_INTERR, VNCLOG("########### vncMenu::AddTrayIcon \n"));  
387 - vnclog.Print(LL_INTERR, VNCLOG("########### vncMenu::AddTrayIcon - UserName = %s\n"), m_username); 386 + //vnclog.Print(LL_INTERR, VNCLOG("########### vncMenu::AddTrayIcon "));
  387 + vnclog.Print(LL_INTERR, VNCLOG("########### vncMenu::AddTrayIcon - UserName = %s"), m_username);
388 388
389 // If the user name is non-null then we have a user! 389 // If the user name is non-null then we have a user!
390 if (strcmp(m_username, "") != 0 && strcmp(m_username, "SYSTEM") != 0) 390 if (strcmp(m_username, "") != 0 && strcmp(m_username, "SYSTEM") != 0)
391 { 391 {
392 - //vnclog.Print(LL_INTERR, VNCLOG("########### vncMenu::AddTrayIcon - User exists\n")); 392 + //vnclog.Print(LL_INTERR, VNCLOG("########### vncMenu::AddTrayIcon - User exists"));
393 // Make sure the server has not been configured to 393 // Make sure the server has not been configured to
394 // suppress the tray icon. 394 // suppress the tray icon.
395 HWND tray = FindWindow(("Shell_TrayWnd"), 0); 395 HWND tray = FindWindow(("Shell_TrayWnd"), 0);
396 if (!tray) 396 if (!tray)
397 { 397 {
398 - vnclog.Print(LL_INTERR, VNCLOG("########### vncMenu::AddTrayIcon - User exists, traywnd is not found reset when counter reach %i=20\n"),IconFaultCounter); 398 + vnclog.Print(LL_INTERR, VNCLOG("########### vncMenu::AddTrayIcon - User exists, traywnd is not found reset when counter reach %i=20"),IconFaultCounter);
399 IconFaultCounter++; 399 IconFaultCounter++;
400 return; 400 return;
401 } 401 }
402 402
403 if ( ! m_server->GetDisableTrayIcon()) 403 if ( ! m_server->GetDisableTrayIcon())
404 { 404 {
405 -// vnclog.Print(LL_INTERR, VNCLOG("########### vncMenu::AddTrayIcon - ADD Tray Icon call\n")); 405 +// vnclog.Print(LL_INTERR, VNCLOG("########### vncMenu::AddTrayIcon - ADD Tray Icon call"));
406 SendTrayMsg(NIM_ADD, FALSE); 406 SendTrayMsg(NIM_ADD, FALSE);
407 } 407 }
408 if (m_server->AuthClientCount() != 0) { //PGM @ Advantig 408 if (m_server->AuthClientCount() != 0) { //PGM @ Advantig
@@ -417,14 +417,14 @@ vncMenu::AddTrayIcon() @@ -417,14 +417,14 @@ vncMenu::AddTrayIcon()
417 void 417 void
418 vncMenu::DelTrayIcon() 418 vncMenu::DelTrayIcon()
419 { 419 {
420 - //vnclog.Print(LL_INTERR, VNCLOG("########### vncMenu::DelTrayIcon - DEL Tray Icon call\n")); 420 + //vnclog.Print(LL_INTERR, VNCLOG("########### vncMenu::DelTrayIcon - DEL Tray Icon call"));
421 SendTrayMsg(NIM_DELETE, FALSE); 421 SendTrayMsg(NIM_DELETE, FALSE);
422 } 422 }
423 423
424 void 424 void
425 vncMenu::FlashTrayIcon(BOOL flash) 425 vncMenu::FlashTrayIcon(BOOL flash)
426 { 426 {
427 - //vnclog.Print(LL_INTERR, VNCLOG("########### vncMenu::FlashTrayIcon - FLASH Tray Icon call\n")); 427 + //vnclog.Print(LL_INTERR, VNCLOG("########### vncMenu::FlashTrayIcon - FLASH Tray Icon call"));
428 SendTrayMsg(NIM_MODIFY, flash); 428 SendTrayMsg(NIM_MODIFY, flash);
429 } 429 }
430 430
@@ -468,7 +468,7 @@ vncMenu::SendTrayMsg(DWORD msg, BOOL flash) @@ -468,7 +468,7 @@ vncMenu::SendTrayMsg(DWORD msg, BOOL flash)
468 m_nid.hIcon = flash ? m_flash_icon : m_winvnc_icon; 468 m_nid.hIcon = flash ? m_flash_icon : m_winvnc_icon;
469 m_nid.uFlags = NIF_ICON | NIF_MESSAGE; 469 m_nid.uFlags = NIF_ICON | NIF_MESSAGE;
470 m_nid.uCallbackMessage = WM_TRAYNOTIFY; 470 m_nid.uCallbackMessage = WM_TRAYNOTIFY;
471 - //vnclog.Print(LL_INTINFO, VNCLOG("SendTRaymesg\n")); 471 + //vnclog.Print(LL_INTINFO, VNCLOG("SendTRaymesg"));
472 472
473 // Use resource string as tip if there is one 473 // Use resource string as tip if there is one
474 // [v1.0.2-jp1 fix] 474 // [v1.0.2-jp1 fix]
@@ -496,7 +496,7 @@ vncMenu::SendTrayMsg(DWORD msg, BOOL flash) @@ -496,7 +496,7 @@ vncMenu::SendTrayMsg(DWORD msg, BOOL flash)
496 } 496 }
497 } 497 }
498 498
499 -// vnclog.Print(LL_INTERR, VNCLOG("########### vncMenu::SendTrayMsg - Shell_NotifyIcon call\n")); 499 +// vnclog.Print(LL_INTERR, VNCLOG("########### vncMenu::SendTrayMsg - Shell_NotifyIcon call"));
500 // Send the message 500 // Send the message
501 if ((msg == NIM_MODIFY) && (IsIconSet == FALSE)) return; //no icon to modify 501 if ((msg == NIM_MODIFY) && (IsIconSet == FALSE)) return; //no icon to modify
502 if ((msg ==NIM_ADD) && (IsIconSet != FALSE)) return; //no icon to set 502 if ((msg ==NIM_ADD) && (IsIconSet != FALSE)) return; //no icon to set
@@ -507,9 +507,9 @@ vncMenu::SendTrayMsg(DWORD msg, BOOL flash) @@ -507,9 +507,9 @@ vncMenu::SendTrayMsg(DWORD msg, BOOL flash)
507 } 507 }
508 if (Shell_NotifyIcon(msg, &m_nid)) 508 if (Shell_NotifyIcon(msg, &m_nid))
509 { 509 {
510 -// vnclog.Print(LL_INTERR, VNCLOG("########### vncMenu::SendTrayMsg - Shell_NotifyIcon call SUCCESS\n")); 510 +// vnclog.Print(LL_INTERR, VNCLOG("########### vncMenu::SendTrayMsg - Shell_NotifyIcon call SUCCESS"));
511 // Set the enabled/disabled state of the menu items 511 // Set the enabled/disabled state of the menu items
512 - // vnclog.Print(LL_INTINFO, VNCLOG("tray icon added ok\n")); 512 + // vnclog.Print(LL_INTINFO, VNCLOG("tray icon added ok"));
513 //EnableMenuItem(m_hmenu, ID_CLOSE, MF_DISABLED); 513 //EnableMenuItem(m_hmenu, ID_CLOSE, MF_DISABLED);
514 //EnableMenuItem(m_hmenu, ID_KILLCLIENTS, MF_ENABLED); 514 //EnableMenuItem(m_hmenu, ID_KILLCLIENTS, MF_ENABLED);
515 //EnableMenuItem(m_hmenu, ID_OUTGOING_CONN, MF_ENABLED); 515 //EnableMenuItem(m_hmenu, ID_OUTGOING_CONN, MF_ENABLED);
@@ -518,23 +518,23 @@ vncMenu::SendTrayMsg(DWORD msg, BOOL flash) @@ -518,23 +518,23 @@ vncMenu::SendTrayMsg(DWORD msg, BOOL flash)
518 { 518 {
519 IsIconSet=true; 519 IsIconSet=true;
520 IconFaultCounter=0; 520 IconFaultCounter=0;
521 - vnclog.Print(LL_INTINFO, VNCLOG("IsIconSet \n")); 521 + vnclog.Print(LL_INTINFO, VNCLOG("IsIconSet "));
522 } 522 }
523 523
524 } else { 524 } else {
525 525
526 -// vnclog.Print(LL_INTERR, VNCLOG("########### vncMenu::SendTrayMsg - Shell_NotifyIcon call FAILED ( %u ) \n"), 0); 526 +// vnclog.Print(LL_INTERR, VNCLOG("########### vncMenu::SendTrayMsg - Shell_NotifyIcon call FAILED ( %u ) "), 0);
527 if (!vncService::RunningAsService()) 527 if (!vncService::RunningAsService())
528 { 528 {
529 -// //vnclog.Print(LL_INTERR, VNCLOG("########### vncMenu::SendTrayMsg - Shell_NotifyIcon call FAILED NOT runasservice\n")); 529 +// //vnclog.Print(LL_INTERR, VNCLOG("########### vncMenu::SendTrayMsg - Shell_NotifyIcon call FAILED NOT runasservice"));
530 if (msg == NIM_ADD) 530 if (msg == NIM_ADD)
531 { 531 {
532 // The tray icon couldn't be created, so use the Properties dialog 532 // The tray icon couldn't be created, so use the Properties dialog
533 // as the main program window 533 // as the main program window
534 if (!m_server->RunningFromExternalService()) // sf@2007 - Do not display Properties pages when running in Application0 mode 534 if (!m_server->RunningFromExternalService()) // sf@2007 - Do not display Properties pages when running in Application0 mode
535 { 535 {
536 -// vnclog.Print(LL_INTERR, VNCLOG("########### vncMenu::SendTrayMsg - Shell_NotifyIcon call FAILED NOT runfromexternalservice\n"));  
537 - //vnclog.Print(LL_INTINFO, VNCLOG("opening dialog box\n")); 536 +// vnclog.Print(LL_INTERR, VNCLOG("########### vncMenu::SendTrayMsg - Shell_NotifyIcon call FAILED NOT runfromexternalservice"));
  537 + //vnclog.Print(LL_INTINFO, VNCLOG("opening dialog box"));
538 PostQuitMessage(0); 538 PostQuitMessage(0);
539 } 539 }
540 } 540 }
@@ -545,7 +545,7 @@ vncMenu::SendTrayMsg(DWORD msg, BOOL flash) @@ -545,7 +545,7 @@ vncMenu::SendTrayMsg(DWORD msg, BOOL flash)
545 { 545 {
546 IsIconSet=false; 546 IsIconSet=false;
547 IconFaultCounter++; 547 IconFaultCounter++;
548 - vnclog.Print(LL_INTINFO, VNCLOG("Failed IsIconSet \n")); 548 + vnclog.Print(LL_INTINFO, VNCLOG("Failed IsIconSet "));
549 } 549 }
550 } 550 }
551 } 551 }
@@ -555,7 +555,7 @@ vncMenu::SendTrayMsg(DWORD msg, BOOL flash) @@ -555,7 +555,7 @@ vncMenu::SendTrayMsg(DWORD msg, BOOL flash)
555 // sf@2007 555 // sf@2007
556 void vncMenu::Shutdown() 556 void vncMenu::Shutdown()
557 { 557 {
558 - vnclog.Print(LL_INTERR, VNCLOG("vncMenu::Shutdown: Close menu - Disconnect all - Shutdown server\n")); 558 + vnclog.Print(LL_INTERR, VNCLOG("vncMenu::Shutdown: Close menu - Disconnect all - Shutdown server"));
559 // m_server->AutoRestartFlag(TRUE); 559 // m_server->AutoRestartFlag(TRUE);
560 // m_server->KillAuthClients(); 560 // m_server->KillAuthClients();
561 // m_server->KillSockConnect(); 561 // m_server->KillSockConnect();
@@ -577,7 +577,7 @@ LRESULT CALLBACK vncMenu::WndProc(HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM lP @@ -577,7 +577,7 @@ LRESULT CALLBACK vncMenu::WndProc(HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM lP
577 vncMenu *_this = (vncMenu *) GetWindowLongPtr(hwnd, GWLP_USERDATA); 577 vncMenu *_this = (vncMenu *) GetWindowLongPtr(hwnd, GWLP_USERDATA);
578 #endif 578 #endif
579 // Beep(100,10); 579 // Beep(100,10);
580 - // vnclog.Print(LL_INTINFO, VNCLOG("iMsg 0x%x \n"),iMsg); 580 + // vnclog.Print(LL_INTINFO, VNCLOG("iMsg 0x%x "),iMsg);
581 581
582 switch (iMsg) 582 switch (iMsg)
583 { 583 {
@@ -589,7 +589,7 @@ LRESULT CALLBACK vncMenu::WndProc(HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM lP @@ -589,7 +589,7 @@ LRESULT CALLBACK vncMenu::WndProc(HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM lP
589 589
590 if ( ! _this->m_server->GetDisableTrayIcon()) 590 if ( ! _this->m_server->GetDisableTrayIcon())
591 { 591 {
592 - //vnclog.Print(LL_INTERR, VNCLOG("########### vncMenu::TIMER TrayIcon 5s hack\n")); 592 + //vnclog.Print(LL_INTERR, VNCLOG("########### vncMenu::TIMER TrayIcon 5s hack"));
593 593
594 if (_this->m_server->RunningFromExternalService()) 594 if (_this->m_server->RunningFromExternalService())
595 { 595 {
@@ -597,20 +597,20 @@ if ( ! _this-&gt;m_server-&gt;GetDisableTrayIcon()) @@ -597,20 +597,20 @@ if ( ! _this-&gt;m_server-&gt;GetDisableTrayIcon())
597 if (vncService::CurrentUser((char *) &newuser, sizeof(newuser))) 597 if (vncService::CurrentUser((char *) &newuser, sizeof(newuser)))
598 { 598 {
599 // vnclog.Print(LL_INTINFO, 599 // vnclog.Print(LL_INTINFO,
600 -// VNCLOG("############### Usernames change: old=\"%s\", new=\"%s\"\n"), 600 +// VNCLOG("############### Usernames change: old=\"%s\", new=\"%s\""),
601 // _this->m_username, newuser); 601 // _this->m_username, newuser);
602 602
603 // Check whether the user name has changed! 603 // Check whether the user name has changed!
604 if (strcmp(newuser, _this->m_username) != 0 || _this->IconFaultCounter>20) 604 if (strcmp(newuser, _this->m_username) != 0 || _this->IconFaultCounter>20)
605 { 605 {
606 vnclog.Print(LL_INTINFO, 606 vnclog.Print(LL_INTINFO,
607 - VNCLOG("user name has changed\n")); 607 + VNCLOG("user name has changed"));
608 608
609 // User has changed! 609 // User has changed!
610 strcpy(_this->m_username, newuser); 610 strcpy(_this->m_username, newuser);
611 611
612 vnclog.Print(LL_INTINFO, 612 vnclog.Print(LL_INTINFO,
613 - VNCLOG("############## Kill vncMenu thread\n")); 613 + VNCLOG("############## Kill vncMenu thread"));
614 614
615 // Order impersonation thread killing 615 // Order impersonation thread killing
616 PostQuitMessage(0); 616 PostQuitMessage(0);
@@ -621,7 +621,7 @@ if ( ! _this-&gt;m_server-&gt;GetDisableTrayIcon()) @@ -621,7 +621,7 @@ if ( ! _this-&gt;m_server-&gt;GetDisableTrayIcon())
621 // *** HACK for running servicified 621 // *** HACK for running servicified
622 if (vncService::RunningAsService()) 622 if (vncService::RunningAsService())
623 { 623 {
624 - //vnclog.Print(LL_INTERR, VNCLOG("########### vncMenu::TIMER TrayIcon 5s hack call - Runningasservice\n")); 624 + //vnclog.Print(LL_INTERR, VNCLOG("########### vncMenu::TIMER TrayIcon 5s hack call - Runningasservice"));
625 // Attempt to add the icon if it's not already there 625 // Attempt to add the icon if it's not already there
626 _this->AddTrayIcon(); 626 _this->AddTrayIcon();
627 // Trigger a check of the current user 627 // Trigger a check of the current user
@@ -683,7 +683,7 @@ if ( ! _this-&gt;m_server-&gt;GetDisableTrayIcon()) @@ -683,7 +683,7 @@ if ( ! _this-&gt;m_server-&gt;GetDisableTrayIcon())
683 683
684 case ID_KILLCLIENTS: 684 case ID_KILLCLIENTS:
685 // Disconnect all currently connected clients 685 // Disconnect all currently connected clients
686 - vnclog.Print(LL_INTINFO, VNCLOG("KillAuthClients() ID_KILLCLIENTS \n")); 686 + vnclog.Print(LL_INTINFO, VNCLOG("KillAuthClients() ID_KILLCLIENTS "));
687 _this->m_server->KillAuthClients(); 687 _this->m_server->KillAuthClients();
688 break; 688 break;
689 689
@@ -699,7 +699,7 @@ if ( ! _this-&gt;m_server-&gt;GetDisableTrayIcon()) @@ -699,7 +699,7 @@ if ( ! _this-&gt;m_server-&gt;GetDisableTrayIcon())
699 699
700 case ID_CLOSE: 700 case ID_CLOSE:
701 // User selected Close from the tray menu 701 // User selected Close from the tray menu
702 - vnclog.Print(LL_INTINFO, VNCLOG("KillAuthClients() ID_CLOSE \n")); 702 + vnclog.Print(LL_INTINFO, VNCLOG("KillAuthClients() ID_CLOSE "));
703 _this->m_server->KillAuthClients(); 703 _this->m_server->KillAuthClients();
704 fShutdownOrdered=TRUE; 704 fShutdownOrdered=TRUE;
705 PostMessage(hwnd, WM_CLOSE, 0, 0); 705 PostMessage(hwnd, WM_CLOSE, 0, 0);
@@ -718,7 +718,7 @@ if ( ! _this-&gt;m_server-&gt;GetDisableTrayIcon()) @@ -718,7 +718,7 @@ if ( ! _this-&gt;m_server-&gt;GetDisableTrayIcon())
718 { 718 {
719 if (submenu == NULL) 719 if (submenu == NULL)
720 { 720 {
721 - vnclog.Print(LL_INTERR, VNCLOG("no submenu available\n")); 721 + vnclog.Print(LL_INTERR, VNCLOG("no submenu available"));
722 return 0; 722 return 0;
723 } 723 }
724 724
@@ -763,18 +763,18 @@ if ( ! _this-&gt;m_server-&gt;GetDisableTrayIcon()) @@ -763,18 +763,18 @@ if ( ! _this-&gt;m_server-&gt;GetDisableTrayIcon())
763 if (_this->m_server->RemoveAeroEnabled()) 763 if (_this->m_server->RemoveAeroEnabled())
764 ResetAero(); 764 ResetAero();
765 765
766 - vnclog.Print(LL_INTERR, VNCLOG("vncMenu WM_CLOSE call - All cleanup done\n")); 766 + vnclog.Print(LL_INTERR, VNCLOG("vncMenu WM_CLOSE call - All cleanup done"));
767 DestroyWindow(hwnd); 767 DestroyWindow(hwnd);
768 break; 768 break;
769 769
770 case WM_DESTROY: 770 case WM_DESTROY:
771 // The user wants WinVNC to quit cleanly... 771 // The user wants WinVNC to quit cleanly...
772 - vnclog.Print(LL_INTINFO, VNCLOG("quitting from WM_DESTROY\n")); 772 + vnclog.Print(LL_INTINFO, VNCLOG("quitting from WM_DESTROY"));
773 PostQuitMessage(0); 773 PostQuitMessage(0);
774 return 0; 774 return 0;
775 775
776 case WM_QUERYENDSESSION: 776 case WM_QUERYENDSESSION:
777 - vnclog.Print(LL_INTERR, VNCLOG("WM_QUERYENDSESSION\n")); 777 + vnclog.Print(LL_INTERR, VNCLOG("WM_QUERYENDSESSION"));
778 //_this->m_server->KillAuthClients(); 778 //_this->m_server->KillAuthClients();
779 //_this->m_server->KillSockConnect(); 779 //_this->m_server->KillSockConnect();
780 //_this->m_server->ShutdownServer(); 780 //_this->m_server->ShutdownServer();
@@ -790,7 +790,7 @@ if ( ! _this-&gt;m_server-&gt;GetDisableTrayIcon()) @@ -790,7 +790,7 @@ if ( ! _this-&gt;m_server-&gt;GetDisableTrayIcon())
790 break; 790 break;
791 791
792 case WM_ENDSESSION: 792 case WM_ENDSESSION:
793 - vnclog.Print(LL_INTERR, VNCLOG("WM_ENDSESSION\n")); 793 + vnclog.Print(LL_INTERR, VNCLOG("WM_ENDSESSION"));
794 break; 794 break;
795 795
796 case WM_USERCHANGED: 796 case WM_USERCHANGED:
@@ -801,14 +801,14 @@ if ( ! _this-&gt;m_server-&gt;GetDisableTrayIcon()) @@ -801,14 +801,14 @@ if ( ! _this-&gt;m_server-&gt;GetDisableTrayIcon())
801 if (vncService::CurrentUser((char *) &newuser, sizeof(newuser))) 801 if (vncService::CurrentUser((char *) &newuser, sizeof(newuser)))
802 { 802 {
803 vnclog.Print(LL_INTINFO, 803 vnclog.Print(LL_INTINFO,
804 - VNCLOG("############### Usernames change: old=\"%s\", new=\"%s\"\n"), 804 + VNCLOG("############### Usernames change: old=\"%s\", new=\"%s\""),
805 _this->m_username, newuser); 805 _this->m_username, newuser);
806 806
807 // Check whether the user name has changed! 807 // Check whether the user name has changed!
808 if (strcmp(newuser, _this->m_username) != 0) 808 if (strcmp(newuser, _this->m_username) != 0)
809 { 809 {
810 vnclog.Print(LL_INTINFO, 810 vnclog.Print(LL_INTINFO,
811 - VNCLOG("user name has changed\n")); 811 + VNCLOG("user name has changed"));
812 812
813 // User has changed! 813 // User has changed!
814 strcpy(_this->m_username, newuser); 814 strcpy(_this->m_username, newuser);
srcacic/WinVNC/WinVNC/vncpasswd.h
@@ -53,7 +53,7 @@ public: @@ -53,7 +53,7 @@ public:
53 public: 53 public:
54 inline ToText(const char encrypted[MAXPWLEN]) 54 inline ToText(const char encrypted[MAXPWLEN])
55 { 55 {
56 - vnclog.Print(LL_INTINFO, VNCLOG("PASSWD : ToText called\n")); 56 + vnclog.Print(LL_INTINFO, VNCLOG("PASSWD : ToText called"));
57 plaintext = vncDecryptPasswd((char *)encrypted); 57 plaintext = vncDecryptPasswd((char *)encrypted);
58 } 58 }
59 inline ~ToText() 59 inline ~ToText()
@@ -74,7 +74,7 @@ public: @@ -74,7 +74,7 @@ public:
74 public: 74 public:
75 inline FromText(char *unencrypted) 75 inline FromText(char *unencrypted)
76 { 76 {
77 - vnclog.Print(LL_INTINFO, VNCLOG("PASSWD : FromText called\n")); 77 + vnclog.Print(LL_INTINFO, VNCLOG("PASSWD : FromText called"));
78 vncEncryptPasswd(unencrypted, encrypted); 78 vncEncryptPasswd(unencrypted, encrypted);
79 // ZeroMemory(unencrypted, strlen(unencrypted)); 79 // ZeroMemory(unencrypted, strlen(unencrypted));
80 } 80 }
@@ -91,7 +91,7 @@ public: @@ -91,7 +91,7 @@ public:
91 public: 91 public:
92 inline FromClear() 92 inline FromClear()
93 { 93 {
94 - vnclog.Print(LL_INTINFO, VNCLOG("PASSWD : FromClear called\n")); 94 + vnclog.Print(LL_INTINFO, VNCLOG("PASSWD : FromClear called"));
95 vncEncryptPasswd("", encrypted); 95 vncEncryptPasswd("", encrypted);
96 } 96 }
97 inline ~FromClear() 97 inline ~FromClear()
srcacic/WinVNC/WinVNC/vncserver.cpp
@@ -229,7 +229,7 @@ vncServer::vncServer() @@ -229,7 +229,7 @@ vncServer::vncServer()
229 229
230 vncServer::~vncServer() 230 vncServer::~vncServer()
231 { 231 {
232 - //vnclog.Print(LL_STATE, VNCLOG("shutting down server object1\n")); 232 + //vnclog.Print(LL_STATE, VNCLOG("shutting down server object1"));
233 233
234 // We don't want to retry when we are shutting down... 234 // We don't want to retry when we are shutting down...
235 m_fAutoReconnect = FALSE; 235 m_fAutoReconnect = FALSE;
@@ -272,7 +272,7 @@ vncServer::~vncServer() @@ -272,7 +272,7 @@ vncServer::~vncServer()
272 while (g_Desktop_running) 272 while (g_Desktop_running)
273 { 273 {
274 Sleep(100); 274 Sleep(100);
275 - vnclog.Print(LL_STATE, VNCLOG("Waiting for desktop to shutdown\n")); 275 + vnclog.Print(LL_STATE, VNCLOG("Waiting for desktop to shutdown"));
276 } 276 }
277 277
278 // Don't free the authhosts string until no more connections are possible 278 // Don't free the authhosts string until no more connections are possible
@@ -299,7 +299,7 @@ vncServer::~vncServer() @@ -299,7 +299,7 @@ vncServer::~vncServer()
299 { 299 {
300 delete(m_pDSMPlugin); 300 delete(m_pDSMPlugin);
301 m_pDSMPlugin=NULL; 301 m_pDSMPlugin=NULL;
302 - vnclog.Print(LL_SOCKINFO, VNCLOG("~server m_pDSMPlugin = NULL \n")); 302 + vnclog.Print(LL_SOCKINFO, VNCLOG("~server m_pDSMPlugin = NULL "));
303 } 303 }
304 304
305 // Free the host blacklist 305 // Free the host blacklist
@@ -314,14 +314,14 @@ vncServer::~vncServer() @@ -314,14 +314,14 @@ vncServer::~vncServer()
314 // bad hack 314 // bad hack
315 //Sleep(500); 315 //Sleep(500);
316 //sometimes crash, vnclog seems already removed 316 //sometimes crash, vnclog seems already removed
317 - // vnclog.Print(LL_STATE, VNCLOG("shutting down server object(4)\n")); 317 + // vnclog.Print(LL_STATE, VNCLOG("shutting down server object(4)"));
318 g_Server_running=false; 318 g_Server_running=false;
319 } 319 }
320 320
321 void 321 void
322 vncServer::ShutdownServer() 322 vncServer::ShutdownServer()
323 { 323 {
324 - vnclog.Print(LL_STATE, VNCLOG("shutting down server object2\n")); 324 + vnclog.Print(LL_STATE, VNCLOG("shutting down server object2"));
325 325
326 // We don't want to retry when we are shutting down... 326 // We don't want to retry when we are shutting down...
327 m_fAutoReconnect = FALSE; 327 m_fAutoReconnect = FALSE;
@@ -364,7 +364,7 @@ vncServer::ShutdownServer() @@ -364,7 +364,7 @@ vncServer::ShutdownServer()
364 while (g_Desktop_running) 364 while (g_Desktop_running)
365 { 365 {
366 Sleep(100); 366 Sleep(100);
367 - vnclog.Print(LL_STATE, VNCLOG("Waiting for desktop to shutdown\n")); 367 + vnclog.Print(LL_STATE, VNCLOG("Waiting for desktop to shutdown"));
368 } 368 }
369 369
370 // Don't free the authhosts string until no more connections are possible 370 // Don't free the authhosts string until no more connections are possible
@@ -391,7 +391,7 @@ vncServer::ShutdownServer() @@ -391,7 +391,7 @@ vncServer::ShutdownServer()
391 { 391 {
392 delete(m_pDSMPlugin); 392 delete(m_pDSMPlugin);
393 m_pDSMPlugin=NULL; 393 m_pDSMPlugin=NULL;
394 - vnclog.Print(LL_SOCKINFO, VNCLOG("ShutdownServer m_pDSMPlugin = NULL \n")); 394 + vnclog.Print(LL_SOCKINFO, VNCLOG("ShutdownServer m_pDSMPlugin = NULL "));
395 } 395 }
396 396
397 // Free the host blacklist 397 // Free the host blacklist
@@ -406,7 +406,7 @@ vncServer::ShutdownServer() @@ -406,7 +406,7 @@ vncServer::ShutdownServer()
406 // bad hack 406 // bad hack
407 //Sleep(500); 407 //Sleep(500);
408 //sometimes crash, vnclog seems already removed 408 //sometimes crash, vnclog seems already removed
409 -// vnclog.Print(LL_STATE, VNCLOG("shutting down server object(4)\n")); 409 +// vnclog.Print(LL_STATE, VNCLOG("shutting down server object(4)"));
410 g_Server_running=false; 410 g_Server_running=false;
411 } 411 }
412 412
@@ -428,7 +428,7 @@ vncClientId vncServer::AddClient(VSocket *socket, @@ -428,7 +428,7 @@ vncClientId vncServer::AddClient(VSocket *socket,
428 /*BOOL keysenabled, BOOL ptrenabled,*/ 428 /*BOOL keysenabled, BOOL ptrenabled,*/
429 rfbProtocolVersionMsg *protocolMsg) 429 rfbProtocolVersionMsg *protocolMsg)
430 { 430 {
431 - vnclog.Print(LL_STATE, VNCLOG("AddClient() started\n")); 431 + vnclog.Print(LL_STATE, VNCLOG("AddClient() started"));
432 432
433 vncClient *client; 433 vncClient *client;
434 434
@@ -469,7 +469,7 @@ vncClientId vncServer::AddClient(VSocket *socket, @@ -469,7 +469,7 @@ vncClientId vncServer::AddClient(VSocket *socket,
469 if (!client->Init(this, socket, auth, shared, clientid)) 469 if (!client->Init(this, socket, auth, shared, clientid))
470 { 470 {
471 // The client will delete the socket for us... 471 // The client will delete the socket for us...
472 - vnclog.Print(LL_CONNERR, VNCLOG("failed to initialise client object\n")); 472 + vnclog.Print(LL_CONNERR, VNCLOG("failed to initialise client object"));
473 delete client; 473 delete client;
474 return -1; 474 return -1;
475 } 475 }
@@ -482,7 +482,7 @@ vncClientId vncServer::AddClient(VSocket *socket, @@ -482,7 +482,7 @@ vncClientId vncServer::AddClient(VSocket *socket,
482 // Notify anyone interested about this event 482 // Notify anyone interested about this event
483 DoNotify(WM_SRV_CLIENT_CONNECT, 0, 0); 483 DoNotify(WM_SRV_CLIENT_CONNECT, 0, 0);
484 484
485 - vnclog.Print(LL_INTINFO, VNCLOG("AddClient() done\n")); 485 + vnclog.Print(LL_INTINFO, VNCLOG("AddClient() done"));
486 486
487 return clientid; 487 return clientid;
488 } 488 }
@@ -492,9 +492,9 @@ vncServer::Authenticated(vncClientId clientid) @@ -492,9 +492,9 @@ vncServer::Authenticated(vncClientId clientid)
492 { 492 {
493 vncClientList::iterator i; 493 vncClientList::iterator i;
494 BOOL authok = TRUE; 494 BOOL authok = TRUE;
495 -// vnclog.Print(LL_INTINFO, VNCLOG("Lock2\n")); 495 +// vnclog.Print(LL_INTINFO, VNCLOG("Lock2"));
496 omni_mutex_lock l1(m_desktopLock); 496 omni_mutex_lock l1(m_desktopLock);
497 -// vnclog.Print(LL_INTINFO, VNCLOG("Lock3\n")); 497 +// vnclog.Print(LL_INTINFO, VNCLOG("Lock3"));
498 omni_mutex_lock l2(m_clientsLock); 498 omni_mutex_lock l2(m_clientsLock);
499 499
500 // Search the unauthenticated client list 500 // Search the unauthenticated client list
@@ -521,7 +521,7 @@ vncServer::Authenticated(vncClientId clientid) @@ -521,7 +521,7 @@ vncServer::Authenticated(vncClientId clientid)
521 } 521 }
522 if (!m_desktop->Init(this)) 522 if (!m_desktop->Init(this))
523 { 523 {
524 - vnclog.Print(LL_INTINFO, VNCLOG("Desktop init failed, unlock in application mode ? \n")); 524 + vnclog.Print(LL_INTINFO, VNCLOG("Desktop init failed, unlock in application mode ? "));
525 client->Kill(); 525 client->Kill();
526 authok = FALSE; 526 authok = FALSE;
527 delete m_desktop; 527 delete m_desktop;
@@ -544,7 +544,7 @@ vncServer::Authenticated(vncClientId clientid) @@ -544,7 +544,7 @@ vncServer::Authenticated(vncClientId clientid)
544 // Notify anyone interested of this event 544 // Notify anyone interested of this event
545 DoNotify(WM_SRV_CLIENT_AUTHENTICATED, 0, 0); 545 DoNotify(WM_SRV_CLIENT_AUTHENTICATED, 0, 0);
546 546
547 - vnclog.Print(LL_INTINFO, VNCLOG("Authenticated() done\n")); 547 + vnclog.Print(LL_INTINFO, VNCLOG("Authenticated() done"));
548 548
549 return authok; 549 return authok;
550 } 550 }
@@ -563,7 +563,7 @@ vncServer::KillClient(vncClientId clientid) @@ -563,7 +563,7 @@ vncServer::KillClient(vncClientId clientid)
563 // Is this the right client? 563 // Is this the right client?
564 if ((*i) == clientid) 564 if ((*i) == clientid)
565 { 565 {
566 - vnclog.Print(LL_INTINFO, VNCLOG("killing unauth client\n")); 566 + vnclog.Print(LL_INTINFO, VNCLOG("killing unauth client"));
567 567
568 // Ask the client to die 568 // Ask the client to die
569 vncClient *client = GetClient(clientid); 569 vncClient *client = GetClient(clientid);
@@ -580,7 +580,7 @@ vncServer::KillClient(vncClientId clientid) @@ -580,7 +580,7 @@ vncServer::KillClient(vncClientId clientid)
580 // Is this the right client? 580 // Is this the right client?
581 if ((*i) == clientid) 581 if ((*i) == clientid)
582 { 582 {
583 - vnclog.Print(LL_INTINFO, VNCLOG("killing auth client\n")); 583 + vnclog.Print(LL_INTINFO, VNCLOG("killing auth client"));
584 584
585 // Yes, so kill it 585 // Yes, so kill it
586 vncClient *client = GetClient(clientid); 586 vncClient *client = GetClient(clientid);
@@ -592,7 +592,7 @@ vncServer::KillClient(vncClientId clientid) @@ -592,7 +592,7 @@ vncServer::KillClient(vncClientId clientid)
592 } 592 }
593 } 593 }
594 594
595 - vnclog.Print(LL_INTINFO, VNCLOG("KillClient() done\n")); 595 + vnclog.Print(LL_INTINFO, VNCLOG("KillClient() done"));
596 } 596 }
597 597
598 // 598 //
@@ -609,11 +609,11 @@ void vncServer::KillClient(LPSTR szClientName) @@ -609,11 +609,11 @@ void vncServer::KillClient(LPSTR szClientName)
609 pClient = GetClient(*i); 609 pClient = GetClient(*i);
610 if (!_stricmp(pClient->GetClientName(), szClientName)) 610 if (!_stricmp(pClient->GetClientName(), szClientName))
611 { 611 {
612 - vnclog.Print(LL_INTINFO, VNCLOG("Killing client named: %s\n"), szClientName); 612 + vnclog.Print(LL_INTINFO, VNCLOG("Killing client named: %s"), szClientName);
613 pClient->Kill(); 613 pClient->Kill();
614 } 614 }
615 } 615 }
616 - vnclog.Print(LL_INTINFO, VNCLOG("KillClient() from name done\n")); 616 + vnclog.Print(LL_INTINFO, VNCLOG("KillClient() from name done"));
617 } 617 }
618 618
619 619
@@ -633,7 +633,7 @@ void vncServer::TextChatClient(LPSTR szClientName) @@ -633,7 +633,7 @@ void vncServer::TextChatClient(LPSTR szClientName)
633 { 633 {
634 if (!pClient->IsUltraViewer()) 634 if (!pClient->IsUltraViewer())
635 { 635 {
636 - vnclog.Print(LL_INTINFO, VNCLOG("Client %s is not Ultra. Doesn't know TextChat\n"), szClientName); 636 + vnclog.Print(LL_INTINFO, VNCLOG("Client %s is not Ultra. Doesn't know TextChat"), szClientName);
637 vncTimedMsgBox::Do( 637 vncTimedMsgBox::Do(
638 sz_ID_ULTRAVNC_TEXTCHAT, 638 sz_ID_ULTRAVNC_TEXTCHAT,
639 sz_ID_ULTRAVNC_WARNING, 639 sz_ID_ULTRAVNC_WARNING,
@@ -641,12 +641,12 @@ void vncServer::TextChatClient(LPSTR szClientName) @@ -641,12 +641,12 @@ void vncServer::TextChatClient(LPSTR szClientName)
641 ); 641 );
642 break; 642 break;
643 } 643 }
644 - vnclog.Print(LL_INTINFO, VNCLOG("TextChat with client named: %s\n"), szClientName); 644 + vnclog.Print(LL_INTINFO, VNCLOG("TextChat with client named: %s"), szClientName);
645 pClient->GetTextChatPointer()->OrderTextChat(); 645 pClient->GetTextChatPointer()->OrderTextChat();
646 break; 646 break;
647 } 647 }
648 } 648 }
649 - vnclog.Print(LL_INTINFO, VNCLOG("KillClient() from name done\n")); 649 + vnclog.Print(LL_INTINFO, VNCLOG("KillClient() from name done"));
650 } 650 }
651 651
652 652
@@ -659,13 +659,13 @@ vncServer::KillAuthClients() @@ -659,13 +659,13 @@ vncServer::KillAuthClients()
659 // Tell all the authorised clients to die! 659 // Tell all the authorised clients to die!
660 for (i = m_authClients.begin(); i != m_authClients.end(); i++) 660 for (i = m_authClients.begin(); i != m_authClients.end(); i++)
661 { 661 {
662 - vnclog.Print(LL_INTINFO, VNCLOG("killing auth client\n")); 662 + vnclog.Print(LL_INTINFO, VNCLOG("killing auth client"));
663 663
664 // Kill the client 664 // Kill the client
665 GetClient(*i)->Kill(); 665 GetClient(*i)->Kill();
666 } 666 }
667 667
668 - vnclog.Print(LL_INTINFO, VNCLOG("KillAuthClients() done\n")); 668 + vnclog.Print(LL_INTINFO, VNCLOG("KillAuthClients() done"));
669 } 669 }
670 670
671 // 671 //
@@ -753,13 +753,13 @@ vncServer::KillUnauthClients() @@ -753,13 +753,13 @@ vncServer::KillUnauthClients()
753 // Tell all the authorised clients to die! 753 // Tell all the authorised clients to die!
754 for (i = m_unauthClients.begin(); i != m_unauthClients.end(); i++) 754 for (i = m_unauthClients.begin(); i != m_unauthClients.end(); i++)
755 { 755 {
756 - vnclog.Print(LL_INTINFO, VNCLOG("killing unauth client\n")); 756 + vnclog.Print(LL_INTINFO, VNCLOG("killing unauth client"));
757 757
758 // Kill the client 758 // Kill the client
759 GetClient(*i)->Kill(); 759 GetClient(*i)->Kill();
760 } 760 }
761 761
762 - vnclog.Print(LL_INTINFO, VNCLOG("KillUnauthClients() done\n")); 762 + vnclog.Print(LL_INTINFO, VNCLOG("KillUnauthClients() done"));
763 } 763 }
764 764
765 765
@@ -914,9 +914,9 @@ vncServer::RemoveClient(vncClientId clientid) @@ -914,9 +914,9 @@ vncServer::RemoveClient(vncClientId clientid)
914 { 914 {
915 vncClientList::iterator i; 915 vncClientList::iterator i;
916 BOOL done = FALSE; 916 BOOL done = FALSE;
917 -// vnclog.Print(LL_INTINFO, VNCLOG("Lock1\n")); 917 +// vnclog.Print(LL_INTINFO, VNCLOG("Lock1"));
918 omni_mutex_lock l1(m_desktopLock); 918 omni_mutex_lock l1(m_desktopLock);
919 -// vnclog.Print(LL_INTINFO, VNCLOG("Lock3\n")); 919 +// vnclog.Print(LL_INTINFO, VNCLOG("Lock3"));
920 { omni_mutex_lock l2(m_clientsLock); 920 { omni_mutex_lock l2(m_clientsLock);
921 921
922 // Find the client in one of the two lists 922 // Find the client in one of the two lists
@@ -925,7 +925,7 @@ vncServer::RemoveClient(vncClientId clientid) @@ -925,7 +925,7 @@ vncServer::RemoveClient(vncClientId clientid)
925 // Is this the right client? 925 // Is this the right client?
926 if ((*i) == clientid) 926 if ((*i) == clientid)
927 { 927 {
928 - vnclog.Print(LL_INTINFO, VNCLOG("removing unauthorised client\n")); 928 + vnclog.Print(LL_INTINFO, VNCLOG("removing unauthorised client"));
929 929
930 // Yes, so remove the client and kill it 930 // Yes, so remove the client and kill it
931 m_unauthClients.erase(i); 931 m_unauthClients.erase(i);
@@ -941,7 +941,7 @@ vncServer::RemoveClient(vncClientId clientid) @@ -941,7 +941,7 @@ vncServer::RemoveClient(vncClientId clientid)
941 // Is this the right client? 941 // Is this the right client?
942 if ((*i) == clientid) 942 if ((*i) == clientid)
943 { 943 {
944 - vnclog.Print(LL_INTINFO, VNCLOG("removing authorised client\n")); 944 + vnclog.Print(LL_INTINFO, VNCLOG("removing authorised client"));
945 945
946 // Yes, so remove the client and kill it 946 // Yes, so remove the client and kill it
947 m_authClients.erase(i); 947 m_authClients.erase(i);
@@ -961,7 +961,7 @@ vncServer::RemoveClient(vncClientId clientid) @@ -961,7 +961,7 @@ vncServer::RemoveClient(vncClientId clientid)
961 // Are there any authorised clients connected? 961 // Are there any authorised clients connected?
962 if (m_authClients.empty() && (m_desktop != NULL)) 962 if (m_authClients.empty() && (m_desktop != NULL))
963 { 963 {
964 - vnclog.Print(LL_STATE, VNCLOG("deleting desktop server\n")); 964 + vnclog.Print(LL_STATE, VNCLOG("deleting desktop server"));
965 965
966 // sf@2007 - Do not lock/logoff even if required when WinVNC autorestarts (on desktop change (XP FUS / Vista)) 966 // sf@2007 - Do not lock/logoff even if required when WinVNC autorestarts (on desktop change (XP FUS / Vista))
967 if (!AutoRestartFlag()) 967 if (!AutoRestartFlag())
@@ -981,7 +981,7 @@ vncServer::RemoveClient(vncClientId clientid) @@ -981,7 +981,7 @@ vncServer::RemoveClient(vncClientId clientid)
981 { 981 {
982 // Yes - force a user logoff on disconnect! 982 // Yes - force a user logoff on disconnect!
983 if (!ExitWindowsEx(EWX_LOGOFF, 0)) 983 if (!ExitWindowsEx(EWX_LOGOFF, 0))
984 - vnclog.Print(LL_CONNERR, VNCLOG("client disconnect - failed to logoff user!\n")); 984 + vnclog.Print(LL_CONNERR, VNCLOG("client disconnect - failed to logoff user!"));
985 } 985 }
986 } 986 }
987 } 987 }
@@ -989,12 +989,12 @@ vncServer::RemoveClient(vncClientId clientid) @@ -989,12 +989,12 @@ vncServer::RemoveClient(vncClientId clientid)
989 // Delete the screen server 989 // Delete the screen server
990 delete m_desktop; 990 delete m_desktop;
991 m_desktop = NULL; 991 m_desktop = NULL;
992 - vnclog.Print(LL_STATE, VNCLOG("desktop deleted\n")); 992 + vnclog.Print(LL_STATE, VNCLOG("desktop deleted"));
993 } 993 }
994 994
995 // Notify anyone interested of the change 995 // Notify anyone interested of the change
996 DoNotify(WM_SRV_CLIENT_DISCONNECT, 0, 0); 996 DoNotify(WM_SRV_CLIENT_DISCONNECT, 0, 0);
997 - vnclog.Print(LL_INTINFO, VNCLOG("RemoveClient() done\n")); 997 + vnclog.Print(LL_INTINFO, VNCLOG("RemoveClient() done"));
998 } 998 }
999 999
1000 // NOTIFICATION HANDLING! 1000 // NOTIFICATION HANDLING!
@@ -1123,7 +1123,7 @@ vncServer::UpdateLocalFormat() @@ -1123,7 +1123,7 @@ vncServer::UpdateLocalFormat()
1123 void 1123 void
1124 vncServer::UpdateLocalClipText(LPSTR text) 1124 vncServer::UpdateLocalClipText(LPSTR text)
1125 { 1125 {
1126 -// vnclog.Print(LL_INTINFO, VNCLOG("Lock5\n")); 1126 +// vnclog.Print(LL_INTINFO, VNCLOG("Lock5"));
1127 omni_mutex_lock l(m_desktopLock); 1127 omni_mutex_lock l(m_desktopLock);
1128 1128
1129 if (m_desktop != NULL) 1129 if (m_desktop != NULL)
@@ -1219,7 +1219,7 @@ BOOL @@ -1219,7 +1219,7 @@ BOOL
1219 vncServer::SockConnect(BOOL On) 1219 vncServer::SockConnect(BOOL On)
1220 { 1220 {
1221 // Are we being asked to switch socket connects on or off? 1221 // Are we being asked to switch socket connects on or off?
1222 - vnclog.Print(20, VNCLOG("SockConnect %d\n"), On); 1222 + vnclog.Print(20, VNCLOG("SockConnect %d"), On);
1223 if (On) 1223 if (On)
1224 { 1224 {
1225 // Is there a listening socket? 1225 // Is there a listening socket?
@@ -1239,7 +1239,7 @@ vncServer::SockConnect(BOOL On) @@ -1239,7 +1239,7 @@ vncServer::SockConnect(BOOL On)
1239 { 1239 {
1240 m_port = DISPLAY_TO_PORT(i); 1240 m_port = DISPLAY_TO_PORT(i);
1241 1241
1242 - vnclog.Print(LL_CLIENTS, VNCLOG("Tentando usar a porta %d...\n"), m_port); 1242 + vnclog.Print(LL_CLIENTS, VNCLOG("Tentando usar a porta %d..."), m_port);
1243 1243
1244 // Attempt to connect to the port 1244 // Attempt to connect to the port
1245 VSocket tempsock; 1245 VSocket tempsock;
@@ -1278,13 +1278,13 @@ vncServer::SockConnect(BOOL On) @@ -1278,13 +1278,13 @@ vncServer::SockConnect(BOOL On)
1278 1278
1279 // Now let's start the HTTP connection stuff 1279 // Now let's start the HTTP connection stuff
1280 EnableXDMCPConnect(m_enableXdmcpConn); 1280 EnableXDMCPConnect(m_enableXdmcpConn);
1281 - vnclog.Print(20, VNCLOG("SockConnect Done %d\n"), On); 1281 + vnclog.Print(20, VNCLOG("SockConnect Done %d"), On);
1282 } 1282 }
1283 } 1283 }
1284 else 1284 else
1285 { 1285 {
1286 // *** JNW - Trying to fix up a lock-up when the listening socket closes 1286 // *** JNW - Trying to fix up a lock-up when the listening socket closes
1287 - vnclog.Print(LL_INTINFO, VNCLOG("KillAuthClients() fix up a lock-up \n")); 1287 + vnclog.Print(LL_INTINFO, VNCLOG("KillAuthClients() fix up a lock-up "));
1288 KillAuthClients(); 1288 KillAuthClients();
1289 KillUnauthClients(); 1289 KillUnauthClients();
1290 WaitUntilAuthEmpty(); 1290 WaitUntilAuthEmpty();
@@ -1387,10 +1387,10 @@ void @@ -1387,10 +1387,10 @@ void
1387 vncServer::GetScreenInfo(int &width, int &height, int &depth) 1387 vncServer::GetScreenInfo(int &width, int &height, int &depth)
1388 { 1388 {
1389 rfbServerInitMsg scrinfo; 1389 rfbServerInitMsg scrinfo;
1390 -// vnclog.Print(LL_INTINFO, VNCLOG("Lock6\n")); 1390 +// vnclog.Print(LL_INTINFO, VNCLOG("Lock6"));
1391 omni_mutex_lock l(m_desktopLock); 1391 omni_mutex_lock l(m_desktopLock);
1392 1392
1393 - //vnclog.Print(LL_INTINFO, VNCLOG("GetScreenInfo called\n")); 1393 + //vnclog.Print(LL_INTINFO, VNCLOG("GetScreenInfo called"));
1394 1394
1395 // Is a desktop object currently active? 1395 // Is a desktop object currently active?
1396 // No, so create a dummy desktop and interrogate it 1396 // No, so create a dummy desktop and interrogate it
@@ -1399,7 +1399,7 @@ vncServer::GetScreenInfo(int &amp;width, int &amp;height, int &amp;depth) @@ -1399,7 +1399,7 @@ vncServer::GetScreenInfo(int &amp;width, int &amp;height, int &amp;depth)
1399 HDC hrootdc; 1399 HDC hrootdc;
1400 hrootdc = GetDC(NULL); 1400 hrootdc = GetDC(NULL);
1401 if (hrootdc == NULL) { 1401 if (hrootdc == NULL) {
1402 - vnclog.Print(LL_INTERR, VNCLOG("Failed rootdc \n")); 1402 + vnclog.Print(LL_INTERR, VNCLOG("Failed rootdc "));
1403 scrinfo.framebufferWidth = 0; 1403 scrinfo.framebufferWidth = 0;
1404 scrinfo.framebufferHeight = 0; 1404 scrinfo.framebufferHeight = 0;
1405 scrinfo.format.bitsPerPixel = 0; 1405 scrinfo.format.bitsPerPixel = 0;
@@ -1493,12 +1493,12 @@ vncServer::SetAuthHosts(const char*hostlist) { @@ -1493,12 +1493,12 @@ vncServer::SetAuthHosts(const char*hostlist) {
1493 omni_mutex_lock l(m_clientsLock); 1493 omni_mutex_lock l(m_clientsLock);
1494 1494
1495 if (hostlist == 0) { 1495 if (hostlist == 0) {
1496 - vnclog.Print(LL_INTINFO, VNCLOG("authhosts cleared\n")); 1496 + vnclog.Print(LL_INTINFO, VNCLOG("authhosts cleared"));
1497 m_auth_hosts = 0; 1497 m_auth_hosts = 0;
1498 return; 1498 return;
1499 } 1499 }
1500 1500
1501 - vnclog.Print(LL_INTINFO, VNCLOG("authhosts set to \"%s\"\n"), hostlist); 1501 + vnclog.Print(LL_INTINFO, VNCLOG("authhosts set to \"%s\""), hostlist);
1502 if (m_auth_hosts != 0) 1502 if (m_auth_hosts != 0)
1503 free(m_auth_hosts); 1503 free(m_auth_hosts);
1504 1504
@@ -1586,7 +1586,7 @@ vncServer::VerifyHost(const char *hostname) { @@ -1586,7 +1586,7 @@ vncServer::VerifyHost(const char *hostname) {
1586 1586
1587 // Has a hostname been specified? 1587 // Has a hostname been specified?
1588 if (hostname == 0) { 1588 if (hostname == 0) {
1589 - vnclog.Print(LL_INTWARN, VNCLOG("verify failed - null hostname\n")); 1589 + vnclog.Print(LL_INTWARN, VNCLOG("verify failed - null hostname"));
1590 return vncServer::aqrReject; 1590 return vncServer::aqrReject;
1591 } 1591 }
1592 1592
@@ -1623,7 +1623,7 @@ vncServer::VerifyHost(const char *hostname) { @@ -1623,7 +1623,7 @@ vncServer::VerifyHost(const char *hostname) {
1623 patternStart = authHostsPos+1; 1623 patternStart = authHostsPos+1;
1624 machineMode = vh_ExpectPattern; 1624 machineMode = vh_ExpectPattern;
1625 } else if (m_auth_hosts[authHostsPos] != '\0') { 1625 } else if (m_auth_hosts[authHostsPos] != '\0') {
1626 - vnclog.Print(LL_INTWARN, VNCLOG("verify host - malformed AuthHosts string\n")); 1626 + vnclog.Print(LL_INTWARN, VNCLOG("verify host - malformed AuthHosts string"));
1627 machineMode = vh_ExpectDelimiter; 1627 machineMode = vh_ExpectDelimiter;
1628 } 1628 }
1629 break; 1629 break;
@@ -1636,7 +1636,7 @@ vncServer::VerifyHost(const char *hostname) { @@ -1636,7 +1636,7 @@ vncServer::VerifyHost(const char *hostname) {
1636 (m_auth_hosts[authHostsPos] == '\0')) { 1636 (m_auth_hosts[authHostsPos] == '\0')) {
1637 if (machineMode == vh_ExpectPattern) { 1637 if (machineMode == vh_ExpectPattern) {
1638 if (patternStart == 0) { 1638 if (patternStart == 0) {
1639 - vnclog.Print(LL_INTWARN, VNCLOG("verify host - pattern processing failed!\n")); 1639 + vnclog.Print(LL_INTWARN, VNCLOG("verify host - pattern processing failed!"));
1640 } else { 1640 } else {
1641 // Process the match 1641 // Process the match
1642 if (MatchStringToTemplate(hostname, hostNameLen, 1642 if (MatchStringToTemplate(hostname, hostNameLen,
@@ -1775,7 +1775,7 @@ vncServer::SetNewSWSize(long w,long h,BOOL desktop) @@ -1775,7 +1775,7 @@ vncServer::SetNewSWSize(long w,long h,BOOL desktop)
1775 { 1775 {
1776 // Post the update 1776 // Post the update
1777 if (!GetClient(*i)->SetNewSWSize(w,h,desktop)) { 1777 if (!GetClient(*i)->SetNewSWSize(w,h,desktop)) {
1778 - vnclog.Print(LL_INTINFO, VNCLOG("Unable to set new desktop size\n")); 1778 + vnclog.Print(LL_INTINFO, VNCLOG("Unable to set new desktop size"));
1779 KillClient(*i); 1779 KillClient(*i);
1780 } 1780 }
1781 } 1781 }
@@ -1895,19 +1895,19 @@ void vncServer::SetDSMPluginName(char* szDSMPlugin) @@ -1895,19 +1895,19 @@ void vncServer::SetDSMPluginName(char* szDSMPlugin)
1895 // 1895 //
1896 BOOL vncServer::SetDSMPlugin(BOOL bForceReload) 1896 BOOL vncServer::SetDSMPlugin(BOOL bForceReload)
1897 { 1897 {
1898 - vnclog.Print(LL_INTINFO, VNCLOG("$$$$$$$$$$ SetDSMPlugin - Entry \n")); 1898 + vnclog.Print(LL_INTINFO, VNCLOG("$$$$$$$$$$ SetDSMPlugin - Entry "));
1899 if (AuthClientCount() > 0) return FALSE; 1899 if (AuthClientCount() > 0) return FALSE;
1900 1900
1901 if (!IsDSMPluginEnabled()) return FALSE; 1901 if (!IsDSMPluginEnabled()) return FALSE;
1902 1902
1903 - vnclog.Print(LL_INTINFO, VNCLOG("$$$$$$$$$$ SetDSMPlugin - Enabled \n")); 1903 + vnclog.Print(LL_INTINFO, VNCLOG("$$$$$$$$$$ SetDSMPlugin - Enabled "));
1904 1904
1905 // If the plugin is loaded, unload it first 1905 // If the plugin is loaded, unload it first
1906 // sf@2003 - it has been possibly pre-configured by 1906 // sf@2003 - it has been possibly pre-configured by
1907 // clicking on the plugin config button 1907 // clicking on the plugin config button
1908 if (m_pDSMPlugin->IsLoaded()) 1908 if (m_pDSMPlugin->IsLoaded())
1909 { 1909 {
1910 - vnclog.Print(LL_INTINFO, VNCLOG("$$$$$$$$$$ SetDSMPlugin - Is Loaded \n")); 1910 + vnclog.Print(LL_INTINFO, VNCLOG("$$$$$$$$$$ SetDSMPlugin - Is Loaded "));
1911 1911
1912 // sf@2003 - We check if the loaded plugin is the same than 1912 // sf@2003 - We check if the loaded plugin is the same than
1913 // the currently selected one or not 1913 // the currently selected one or not
@@ -1915,8 +1915,8 @@ BOOL vncServer::SetDSMPlugin(BOOL bForceReload) @@ -1915,8 +1915,8 @@ BOOL vncServer::SetDSMPlugin(BOOL bForceReload)
1915 if (_stricmp(m_pDSMPlugin->GetPluginFileName(), GetDSMPluginName()) || bForceReload) 1915 if (_stricmp(m_pDSMPlugin->GetPluginFileName(), GetDSMPluginName()) || bForceReload)
1916 { 1916 {
1917 if (bForceReload) 1917 if (bForceReload)
1918 - vnclog.Print(LL_INTINFO, VNCLOG("$$$$$$$$$$ SetDSMPlugin - FORCE RELOADING OF THE PLUGIN \n"));  
1919 - vnclog.Print(LL_INTINFO, VNCLOG("$$$$$$$$$$ SetDSMPlugin - New one - Unload the current \n")); 1918 + vnclog.Print(LL_INTINFO, VNCLOG("$$$$$$$$$$ SetDSMPlugin - FORCE RELOADING OF THE PLUGIN "));
  1919 + vnclog.Print(LL_INTINFO, VNCLOG("$$$$$$$$$$ SetDSMPlugin - New one - Unload the current "));
1920 m_pDSMPlugin->SetEnabled(false); 1920 m_pDSMPlugin->SetEnabled(false);
1921 m_pDSMPlugin->UnloadPlugin(); 1921 m_pDSMPlugin->UnloadPlugin();
1922 } 1922 }
@@ -1924,20 +1924,20 @@ BOOL vncServer::SetDSMPlugin(BOOL bForceReload) @@ -1924,20 +1924,20 @@ BOOL vncServer::SetDSMPlugin(BOOL bForceReload)
1924 1924
1925 if (!m_pDSMPlugin->IsLoaded()) 1925 if (!m_pDSMPlugin->IsLoaded())
1926 { 1926 {
1927 - vnclog.Print(LL_INTINFO, VNCLOG("$$$$$$$$$$ SetDSMPlugin - Plugin NOT loaded - Try to load it \n")); 1927 + vnclog.Print(LL_INTINFO, VNCLOG("$$$$$$$$$$ SetDSMPlugin - Plugin NOT loaded - Try to load it "));
1928 if (!m_pDSMPlugin->LoadPlugin(GetDSMPluginName(), false)) 1928 if (!m_pDSMPlugin->LoadPlugin(GetDSMPluginName(), false))
1929 { 1929 {
1930 - vnclog.Print(LL_INTINFO, VNCLOG("$$$$$$$$$$ DSMPlugin cannot be loaded\n")); 1930 + vnclog.Print(LL_INTINFO, VNCLOG("$$$$$$$$$$ DSMPlugin cannot be loaded"));
1931 return FALSE; 1931 return FALSE;
1932 } 1932 }
1933 } 1933 }
1934 1934
1935 - vnclog.Print(LL_INTINFO, VNCLOG("$$$$$$$$$$ SetDSMPlugin - Plugin successfully loaded \n")); 1935 + vnclog.Print(LL_INTINFO, VNCLOG("$$$$$$$$$$ SetDSMPlugin - Plugin successfully loaded "));
1936 1936
1937 // Now that it is loaded, init it 1937 // Now that it is loaded, init it
1938 if (m_pDSMPlugin->InitPlugin()) 1938 if (m_pDSMPlugin->InitPlugin())
1939 { 1939 {
1940 - vnclog.Print(LL_INTINFO, VNCLOG("$$$$$$$$$$ SetDSMPlugin - Init plugin call \n")); 1940 + vnclog.Print(LL_INTINFO, VNCLOG("$$$$$$$$$$ SetDSMPlugin - Init plugin call "));
1941 char szParams[MAXPWLEN + 64]; 1941 char szParams[MAXPWLEN + 64];
1942 char password[MAXPWLEN]; 1942 char password[MAXPWLEN];
1943 GetPassword(password); 1943 GetPassword(password);
@@ -1954,25 +1954,25 @@ BOOL vncServer::SetDSMPlugin(BOOL bForceReload) @@ -1954,25 +1954,25 @@ BOOL vncServer::SetDSMPlugin(BOOL bForceReload)
1954 1954
1955 //::MessageBox(NULL, szParams, "SetDSMPlugin info", MB_OK); 1955 //::MessageBox(NULL, szParams, "SetDSMPlugin info", MB_OK);
1956 1956
1957 - vnclog.Print(LL_INTINFO, VNCLOG("$$$$$$$$$$ SetDSMPlugin - SetPluginParams call \n")); 1957 + vnclog.Print(LL_INTINFO, VNCLOG("$$$$$$$$$$ SetDSMPlugin - SetPluginParams call "));
1958 1958
1959 1959
1960 if (m_pDSMPlugin->SetPluginParams(NULL, szParams/*vncDecryptPasswd((char *)password)*/)) 1960 if (m_pDSMPlugin->SetPluginParams(NULL, szParams/*vncDecryptPasswd((char *)password)*/))
1961 { 1961 {
1962 m_pDSMPlugin->SetEnabled(true); // The plugin is ready to be used 1962 m_pDSMPlugin->SetEnabled(true); // The plugin is ready to be used
1963 - vnclog.Print(LL_INTINFO, VNCLOG("DSMPlugin Params OK\n")); 1963 + vnclog.Print(LL_INTINFO, VNCLOG("DSMPlugin Params OK"));
1964 return TRUE; 1964 return TRUE;
1965 } 1965 }
1966 else 1966 else
1967 { 1967 {
1968 m_pDSMPlugin->SetEnabled(false); 1968 m_pDSMPlugin->SetEnabled(false);
1969 - vnclog.Print(LL_INTINFO, VNCLOG("Unable to set DSMPlugin Params\n")); 1969 + vnclog.Print(LL_INTINFO, VNCLOG("Unable to set DSMPlugin Params"));
1970 } 1970 }
1971 } 1971 }
1972 else 1972 else
1973 { 1973 {
1974 m_pDSMPlugin->SetEnabled(false); 1974 m_pDSMPlugin->SetEnabled(false);
1975 - vnclog.Print(LL_INTINFO, VNCLOG("Unable to init DSMPlugin\n")); 1975 + vnclog.Print(LL_INTINFO, VNCLOG("Unable to init DSMPlugin"));
1976 } 1976 }
1977 1977
1978 /* 1978 /*
@@ -2095,7 +2095,7 @@ void vncServer::AutoConnectRetry( ) @@ -2095,7 +2095,7 @@ void vncServer::AutoConnectRetry( )
2095 { 2095 {
2096 if ( m_fAutoReconnect ) 2096 if ( m_fAutoReconnect )
2097 { 2097 {
2098 - vnclog.Print(LL_INTINFO, VNCLOG("AutoConnectRetry(): started\n")); 2098 + vnclog.Print(LL_INTINFO, VNCLOG("AutoConnectRetry(): started"));
2099 m_retry_timeout = SetTimer( NULL, 0, (1000*30), (TIMERPROC)_timerRetryHandler ); 2099 m_retry_timeout = SetTimer( NULL, 0, (1000*30), (TIMERPROC)_timerRetryHandler );
2100 } 2100 }
2101 } 2101 }
@@ -2106,7 +2106,7 @@ void CALLBACK vncServer::_timerRetryHandler( HWND /*hWnd*/, UINT /*uMsg*/, UINT_ @@ -2106,7 +2106,7 @@ void CALLBACK vncServer::_timerRetryHandler( HWND /*hWnd*/, UINT /*uMsg*/, UINT_
2106 } 2106 }
2107 void vncServer::_actualTimerRetryHandler() 2107 void vncServer::_actualTimerRetryHandler()
2108 { 2108 {
2109 - vnclog.Print(LL_INTINFO, VNCLOG("Attempting AutoReconnect....\n")); 2109 + vnclog.Print(LL_INTINFO, VNCLOG("Attempting AutoReconnect...."));
2110 2110
2111 KillTimer( NULL, m_retry_timeout ); 2111 KillTimer( NULL, m_retry_timeout );
2112 m_retry_timeout = 0; 2112 m_retry_timeout = 0;
srcacic/WinVNC/WinVNC/vncservice.cpp
@@ -209,7 +209,7 @@ GetCurrentUser(char *buffer, UINT size) // RealVNC 336 change @@ -209,7 +209,7 @@ GetCurrentUser(char *buffer, UINT size) // RealVNC 336 change
209 { 209 {
210 if (vncService::RunningFromExternalService()) 210 if (vncService::RunningFromExternalService())
211 { 211 {
212 -// vnclog.Print(LL_INTERR, VNCLOG("@@@@@@@@@@@@@ GetCurrentUser - Forcing g_impersonating_user \n")); 212 +// vnclog.Print(LL_INTERR, VNCLOG("@@@@@@@@@@@@@ GetCurrentUser - Forcing g_impersonating_user "));
213 g_impersonating_user = TRUE; 213 g_impersonating_user = TRUE;
214 } 214 }
215 215
@@ -224,7 +224,7 @@ GetCurrentUser(char *buffer, UINT size) // RealVNC 336 change @@ -224,7 +224,7 @@ GetCurrentUser(char *buffer, UINT size) // RealVNC 336 change
224 HWINSTA station = GetProcessWindowStation(); 224 HWINSTA station = GetProcessWindowStation();
225 if (station == NULL) 225 if (station == NULL)
226 { 226 {
227 - vnclog.Print(LL_INTERR, VNCLOG("@@@@@@@@@@@@@ GetCurrentUser - ERROR : No window station \n")); 227 + vnclog.Print(LL_INTERR, VNCLOG("@@@@@@@@@@@@@ GetCurrentUser - ERROR : No window station "));
228 return FALSE; 228 return FALSE;
229 } 229 }
230 230
@@ -245,12 +245,12 @@ GetCurrentUser(char *buffer, UINT size) // RealVNC 336 change @@ -245,12 +245,12 @@ GetCurrentUser(char *buffer, UINT size) // RealVNC 336 change
245 // Return "" as the name... 245 // Return "" as the name...
246 if (strlen("") >= size) 246 if (strlen("") >= size)
247 { 247 {
248 - vnclog.Print(LL_INTERR, VNCLOG("@@@@@@@@@@@@@ GetCurrentUser - Error: Bad buffer size \n")); 248 + vnclog.Print(LL_INTERR, VNCLOG("@@@@@@@@@@@@@ GetCurrentUser - Error: Bad buffer size "));
249 return FALSE; 249 return FALSE;
250 } 250 }
251 strcpy(buffer, ""); 251 strcpy(buffer, "");
252 252
253 - vnclog.Print(LL_INTERR, VNCLOG("@@@@@@@@@@@@@ GetCurrentUser - Error: Usersize 0\n")); 253 + vnclog.Print(LL_INTERR, VNCLOG("@@@@@@@@@@@@@ GetCurrentUser - Error: Usersize 0"));
254 return TRUE; 254 return TRUE;
255 } 255 }
256 256
@@ -258,7 +258,7 @@ GetCurrentUser(char *buffer, UINT size) // RealVNC 336 change @@ -258,7 +258,7 @@ GetCurrentUser(char *buffer, UINT size) // RealVNC 336 change
258 // them then we can't continue! 258 // them then we can't continue!
259 if (!g_impersonating_user) 259 if (!g_impersonating_user)
260 { 260 {
261 - vnclog.Print(LL_INTERR, VNCLOG("@@@@@@@@@@@@@ GetCurrentUser - Error: NOT impersonating user \n")); 261 + vnclog.Print(LL_INTERR, VNCLOG("@@@@@@@@@@@@@ GetCurrentUser - Error: NOT impersonating user "));
262 // Return "" as the name... 262 // Return "" as the name...
263 if (strlen("") >= size) 263 if (strlen("") >= size)
264 return FALSE; 264 return FALSE;
@@ -280,7 +280,7 @@ GetCurrentUser(char *buffer, UINT size) // RealVNC 336 change @@ -280,7 +280,7 @@ GetCurrentUser(char *buffer, UINT size) // RealVNC 336 change
280 // Just call GetCurrentUser 280 // Just call GetCurrentUser
281 DWORD length = size; 281 DWORD length = size;
282 282
283 -// vnclog.Print(LL_INTERR, VNCLOG("@@@@@@@@@@@@@ GetCurrentUser - GetUserName call \n")); 283 +// vnclog.Print(LL_INTERR, VNCLOG("@@@@@@@@@@@@@ GetCurrentUser - GetUserName call "));
284 if ( GetConsoleUser(buffer, size) == 0) 284 if ( GetConsoleUser(buffer, size) == 0)
285 { 285 {
286 if (GetUserName(buffer, &length) == 0) 286 if (GetUserName(buffer, &length) == 0)
@@ -289,7 +289,7 @@ GetCurrentUser(char *buffer, UINT size) // RealVNC 336 change @@ -289,7 +289,7 @@ GetCurrentUser(char *buffer, UINT size) // RealVNC 336 change
289 289
290 if (error == ERROR_NOT_LOGGED_ON) 290 if (error == ERROR_NOT_LOGGED_ON)
291 { 291 {
292 - vnclog.Print(LL_INTERR, VNCLOG("@@@@@@@@@@@@@ GetCurrentUser - Error: No user logged on \n")); 292 + vnclog.Print(LL_INTERR, VNCLOG("@@@@@@@@@@@@@ GetCurrentUser - Error: No user logged on "));
293 // No user logged on 293 // No user logged on
294 if (strlen("") >= size) 294 if (strlen("") >= size)
295 return FALSE; 295 return FALSE;
@@ -299,18 +299,18 @@ GetCurrentUser(char *buffer, UINT size) // RealVNC 336 change @@ -299,18 +299,18 @@ GetCurrentUser(char *buffer, UINT size) // RealVNC 336 change
299 else 299 else
300 { 300 {
301 // Genuine error... 301 // Genuine error...
302 - vnclog.Print(LL_INTERR, VNCLOG("getusername error %d\n"), GetLastError()); 302 + vnclog.Print(LL_INTERR, VNCLOG("getusername error %d"), GetLastError());
303 return FALSE; 303 return FALSE;
304 } 304 }
305 } 305 }
306 } 306 }
307 } 307 }
308 - vnclog.Print(LL_INTERR, VNCLOG("@@@@@@@@@@@@@ GetCurrentUser - UserNAme found: %s \n"), buffer); 308 + vnclog.Print(LL_INTERR, VNCLOG("@@@@@@@@@@@@@ GetCurrentUser - UserNAme found: %s "), buffer);
309 return TRUE; 309 return TRUE;
310 }; 310 };
311 311
312 // OS was not recognised! 312 // OS was not recognised!
313 - vnclog.Print(LL_INTERR, VNCLOG("@@@@@@@@@@@@@ GetCurrentUser - Error: Unknown OS \n")); 313 + vnclog.Print(LL_INTERR, VNCLOG("@@@@@@@@@@@@@ GetCurrentUser - Error: Unknown OS "));
314 return FALSE; 314 return FALSE;
315 } 315 }
316 316
@@ -428,21 +428,21 @@ vncService::SelectHDESK(HDESK new_desktop) @@ -428,21 +428,21 @@ vncService::SelectHDESK(HDESK new_desktop)
428 char new_name[256]; 428 char new_name[256];
429 429
430 if (!GetUserObjectInformation(new_desktop, UOI_NAME, &new_name, 256, &dummy)) { 430 if (!GetUserObjectInformation(new_desktop, UOI_NAME, &new_name, 256, &dummy)) {
431 - vnclog.Print(LL_INTERR, VNCLOG("!GetUserObjectInformation \n")); 431 + vnclog.Print(LL_INTERR, VNCLOG("!GetUserObjectInformation "));
432 return FALSE; 432 return FALSE;
433 } 433 }
434 434
435 - vnclog.Print(LL_INTERR, VNCLOG("SelectHDESK to %s (%x) from %x\n"), new_name, new_desktop, old_desktop); 435 + vnclog.Print(LL_INTERR, VNCLOG("SelectHDESK to %s (%x) from %x"), new_name, new_desktop, old_desktop);
436 436
437 // Switch the desktop 437 // Switch the desktop
438 if(!SetThreadDesktop(new_desktop)) { 438 if(!SetThreadDesktop(new_desktop)) {
439 - vnclog.Print(LL_INTERR, VNCLOG("SelectHDESK:!SetThreadDesktop \n")); 439 + vnclog.Print(LL_INTERR, VNCLOG("SelectHDESK:!SetThreadDesktop "));
440 return FALSE; 440 return FALSE;
441 } 441 }
442 442
443 // Switched successfully - destroy the old desktop 443 // Switched successfully - destroy the old desktop
444 if (!CloseDesktop(old_desktop)) 444 if (!CloseDesktop(old_desktop))
445 - vnclog.Print(LL_INTERR, VNCLOG("SelectHDESK failed to close old desktop %x (Err=%d)\n"), old_desktop, GetLastError()); 445 + vnclog.Print(LL_INTERR, VNCLOG("SelectHDESK failed to close old desktop %x (Err=%d)"), old_desktop, GetLastError());
446 446
447 return TRUE; 447 return TRUE;
448 } 448 }
@@ -462,10 +462,10 @@ vncService::SelectDesktop(char *name) @@ -462,10 +462,10 @@ vncService::SelectDesktop(char *name)
462 if (IsWinNT()) 462 if (IsWinNT())
463 { 463 {
464 HDESK desktop; 464 HDESK desktop;
465 - vnclog.Print(LL_INTERR, VNCLOG("SelectDesktop \n")); 465 + vnclog.Print(LL_INTERR, VNCLOG("SelectDesktop "));
466 if (name != NULL) 466 if (name != NULL)
467 { 467 {
468 - vnclog.Print(LL_INTERR, VNCLOG("OpenInputdesktop2 named\n")); 468 + vnclog.Print(LL_INTERR, VNCLOG("OpenInputdesktop2 named"));
469 // Attempt to open the named desktop 469 // Attempt to open the named desktop
470 desktop = OpenDesktop(name, 0, FALSE, 470 desktop = OpenDesktop(name, 0, FALSE,
471 DESKTOP_CREATEMENU | DESKTOP_CREATEWINDOW | 471 DESKTOP_CREATEMENU | DESKTOP_CREATEWINDOW |
@@ -475,7 +475,7 @@ vncService::SelectDesktop(char *name) @@ -475,7 +475,7 @@ vncService::SelectDesktop(char *name)
475 } 475 }
476 else 476 else
477 { 477 {
478 - vnclog.Print(LL_INTERR, VNCLOG("OpenInputdesktop2 NULL\n")); 478 + vnclog.Print(LL_INTERR, VNCLOG("OpenInputdesktop2 NULL"));
479 // No, so open the input desktop 479 // No, so open the input desktop
480 desktop = OpenInputDesktop(0, FALSE, 480 desktop = OpenInputDesktop(0, FALSE,
481 DESKTOP_CREATEMENU | DESKTOP_CREATEWINDOW | 481 DESKTOP_CREATEMENU | DESKTOP_CREATEWINDOW |
@@ -486,16 +486,16 @@ vncService::SelectDesktop(char *name) @@ -486,16 +486,16 @@ vncService::SelectDesktop(char *name)
486 486
487 // Did we succeed? 487 // Did we succeed?
488 if (desktop == NULL) { 488 if (desktop == NULL) {
489 - vnclog.Print(LL_INTERR, VNCLOG("OpenInputdesktop2 \n")); 489 + vnclog.Print(LL_INTERR, VNCLOG("OpenInputdesktop2 "));
490 return FALSE; 490 return FALSE;
491 } 491 }
492 - else vnclog.Print(LL_INTERR, VNCLOG("OpenInputdesktop2 OK\n")); 492 + else vnclog.Print(LL_INTERR, VNCLOG("OpenInputdesktop2 OK"));
493 493
494 // Switch to the new desktop 494 // Switch to the new desktop
495 if (!SelectHDESK(desktop)) { 495 if (!SelectHDESK(desktop)) {
496 // Failed to enter the new desktop, so free it! 496 // Failed to enter the new desktop, so free it!
497 if (!CloseDesktop(desktop)) 497 if (!CloseDesktop(desktop))
498 - vnclog.Print(LL_INTERR, VNCLOG("SelectDesktop failed to close desktop\n")); 498 + vnclog.Print(LL_INTERR, VNCLOG("SelectDesktop failed to close desktop"));
499 return FALSE; 499 return FALSE;
500 } 500 }
501 501
@@ -541,7 +541,7 @@ BOOL CALLBACK WinStationEnumProc(LPTSTR name, LPARAM param) { @@ -541,7 +541,7 @@ BOOL CALLBACK WinStationEnumProc(LPTSTR name, LPARAM param) {
541 BOOL 541 BOOL
542 vncService::InputDesktopSelected() 542 vncService::InputDesktopSelected()
543 { 543 {
544 -// vnclog.Print(LL_INTERR, VNCLOG("InputDesktopSelected()\n")); 544 +// vnclog.Print(LL_INTERR, VNCLOG("InputDesktopSelected()"));
545 // Are we running on NT? 545 // Are we running on NT?
546 if (IsWinNT()) 546 if (IsWinNT())
547 { 547 {
@@ -560,9 +560,9 @@ vncService::InputDesktopSelected() @@ -560,9 +560,9 @@ vncService::InputDesktopSelected()
560 { 560 {
561 DWORD lasterror; 561 DWORD lasterror;
562 lasterror=GetLastError(); 562 lasterror=GetLastError();
563 - vnclog.Print(LL_INTERR, VNCLOG("OpenInputDesktop I\n")); 563 + vnclog.Print(LL_INTERR, VNCLOG("OpenInputDesktop I"));
564 if (lasterror==170) return TRUE; 564 if (lasterror==170) return TRUE;
565 - vnclog.Print(LL_INTERR, VNCLOG("OpenInputDesktop II\n")); 565 + vnclog.Print(LL_INTERR, VNCLOG("OpenInputDesktop II"));
566 return FALSE; 566 return FALSE;
567 } 567 }
568 568
@@ -572,25 +572,25 @@ vncService::InputDesktopSelected() @@ -572,25 +572,25 @@ vncService::InputDesktopSelected()
572 572
573 if (!GetUserObjectInformation(threaddesktop, UOI_NAME, &threadname, 256, &dummy)) { 573 if (!GetUserObjectInformation(threaddesktop, UOI_NAME, &threadname, 256, &dummy)) {
574 if (!CloseDesktop(inputdesktop)) 574 if (!CloseDesktop(inputdesktop))
575 - vnclog.Print(LL_INTERR, VNCLOG("failed to close input desktop\n"));  
576 - vnclog.Print(LL_INTERR, VNCLOG("!GetUserObjectInformation(threaddesktop\n")); 575 + vnclog.Print(LL_INTERR, VNCLOG("failed to close input desktop"));
  576 + vnclog.Print(LL_INTERR, VNCLOG("!GetUserObjectInformation(threaddesktop)"));
577 return FALSE; 577 return FALSE;
578 } 578 }
579 _ASSERT(dummy <= 256); 579 _ASSERT(dummy <= 256);
580 if (!GetUserObjectInformation(inputdesktop, UOI_NAME, &inputname, 256, &dummy)) { 580 if (!GetUserObjectInformation(inputdesktop, UOI_NAME, &inputname, 256, &dummy)) {
581 if (!CloseDesktop(inputdesktop)) 581 if (!CloseDesktop(inputdesktop))
582 - vnclog.Print(LL_INTERR, VNCLOG("failed to close input desktop\n"));  
583 - vnclog.Print(LL_INTERR, VNCLOG("!GetUserObjectInformation(inputdesktop\n")); 582 + vnclog.Print(LL_INTERR, VNCLOG("failed to close input desktop"));
  583 + vnclog.Print(LL_INTERR, VNCLOG("!GetUserObjectInformation(inputdesktop)"));
584 return FALSE; 584 return FALSE;
585 } 585 }
586 _ASSERT(dummy <= 256); 586 _ASSERT(dummy <= 256);
587 587
588 if (!CloseDesktop(inputdesktop)) 588 if (!CloseDesktop(inputdesktop))
589 - vnclog.Print(LL_INTERR, VNCLOG("failed to close input desktop\n")); 589 + vnclog.Print(LL_INTERR, VNCLOG("failed to close input desktop"));
590 590
591 if (strcmp(threadname, inputname) != 0) 591 if (strcmp(threadname, inputname) != 0)
592 { 592 {
593 - vnclog.Print(LL_INTERR, VNCLOG("threadname, inputname differ\n")); 593 + vnclog.Print(LL_INTERR, VNCLOG("threadname, inputname differ"));
594 return FALSE; 594 return FALSE;
595 } 595 }
596 } 596 }
@@ -609,7 +609,7 @@ SimulateCtrlAltDelThreadFn(void *context) @@ -609,7 +609,7 @@ SimulateCtrlAltDelThreadFn(void *context)
609 // Switch into the Winlogon desktop 609 // Switch into the Winlogon desktop
610 if (!vncService::SelectDesktop("Winlogon")) 610 if (!vncService::SelectDesktop("Winlogon"))
611 { 611 {
612 - vnclog.Print(LL_INTERR, VNCLOG("failed to select logon desktop\n")); 612 + vnclog.Print(LL_INTERR, VNCLOG("failed to select logon desktop"));
613 vncTimedMsgBox::Do( 613 vncTimedMsgBox::Do(
614 sz_ID_CADERROR, 614 sz_ID_CADERROR,
615 sz_ID_ULTRAVNC_WARNING, 615 sz_ID_ULTRAVNC_WARNING,
@@ -621,7 +621,7 @@ SimulateCtrlAltDelThreadFn(void *context) @@ -621,7 +621,7 @@ SimulateCtrlAltDelThreadFn(void *context)
621 // 9 April 2008 jdp 621 // 9 April 2008 jdp
622 // turn off capslock if on 622 // turn off capslock if on
623 ClearKeyState(VK_CAPITAL); 623 ClearKeyState(VK_CAPITAL);
624 - vnclog.Print(LL_ALL, VNCLOG("generating ctrl-alt-del\n")); 624 + vnclog.Print(LL_ALL, VNCLOG("generating ctrl-alt-del"));
625 625
626 // Fake a hotkey event to any windows we find there.... :( 626 // Fake a hotkey event to any windows we find there.... :(
627 // Winlogon uses hotkeys to trap Ctrl-Alt-Del... 627 // Winlogon uses hotkeys to trap Ctrl-Alt-Del...
@@ -638,12 +638,12 @@ SimulateCtrlAltDelThreadFn(void *context) @@ -638,12 +638,12 @@ SimulateCtrlAltDelThreadFn(void *context)
638 BOOL 638 BOOL
639 vncService::SimulateCtrlAltDel() 639 vncService::SimulateCtrlAltDel()
640 { 640 {
641 - vnclog.Print(LL_ALL, VNCLOG("preparing to generate ctrl-alt-del\n")); 641 + vnclog.Print(LL_ALL, VNCLOG("preparing to generate ctrl-alt-del"));
642 642
643 // Are we running on NT? 643 // Are we running on NT?
644 if (IsWinNT()) 644 if (IsWinNT())
645 { 645 {
646 - vnclog.Print(LL_ALL, VNCLOG("spawn ctrl-alt-del thread...\n")); 646 + vnclog.Print(LL_ALL, VNCLOG("spawn ctrl-alt-del thread..."));
647 647
648 // *** This is an unpleasant hack. Oh dear. 648 // *** This is an unpleasant hack. Oh dear.
649 649
@@ -670,16 +670,16 @@ BOOL @@ -670,16 +670,16 @@ BOOL
670 vncService::LockWorkstation() 670 vncService::LockWorkstation()
671 { 671 {
672 if (!IsWinNT()) { 672 if (!IsWinNT()) {
673 - vnclog.Print(LL_INTERR, VNCLOG("unable to lock workstation - not NT\n")); 673 + vnclog.Print(LL_INTERR, VNCLOG("unable to lock workstation - not NT"));
674 return FALSE; 674 return FALSE;
675 } 675 }
676 676
677 - vnclog.Print(LL_ALL, VNCLOG("locking workstation\n")); 677 + vnclog.Print(LL_ALL, VNCLOG("locking workstation"));
678 678
679 // Load the user32 library 679 // Load the user32 library
680 HMODULE user32 = LoadLibrary("user32.dll"); 680 HMODULE user32 = LoadLibrary("user32.dll");
681 if (!user32) { 681 if (!user32) {
682 - vnclog.Print(LL_INTERR, VNCLOG("unable to load User32 DLL (%u)\n"), GetLastError()); 682 + vnclog.Print(LL_INTERR, VNCLOG("unable to load User32 DLL (%u)"), GetLastError());
683 return FALSE; 683 return FALSE;
684 } 684 }
685 685
@@ -687,7 +687,7 @@ vncService::LockWorkstation() @@ -687,7 +687,7 @@ vncService::LockWorkstation()
687 typedef BOOL (*LWProc) (); 687 typedef BOOL (*LWProc) ();
688 LWProc lockworkstation = (LWProc)GetProcAddress(user32, "LockWorkStation"); 688 LWProc lockworkstation = (LWProc)GetProcAddress(user32, "LockWorkStation");
689 if (!lockworkstation) { 689 if (!lockworkstation) {
690 - vnclog.Print(LL_INTERR, VNCLOG("unable to locate LockWorkStation - requires Windows 2000 or above (%u)\n"), GetLastError()); 690 + vnclog.Print(LL_INTERR, VNCLOG("unable to locate LockWorkStation - requires Windows 2000 or above (%u)"), GetLastError());
691 FreeLibrary(user32); 691 FreeLibrary(user32);
692 return FALSE; 692 return FALSE;
693 } 693 }
@@ -696,7 +696,7 @@ vncService::LockWorkstation() @@ -696,7 +696,7 @@ vncService::LockWorkstation()
696 BOOL result = (lockworkstation)(); 696 BOOL result = (lockworkstation)();
697 697
698 if (!result) { 698 if (!result) {
699 - vnclog.Print(LL_INTERR, VNCLOG("call to LockWorkstation failed\n")); 699 + vnclog.Print(LL_INTERR, VNCLOG("call to LockWorkstation failed"));
700 FreeLibrary(user32); 700 FreeLibrary(user32);
701 return FALSE; 701 return FALSE;
702 } 702 }
srcacic/WinVNC/WinVNC/vncsockconnect.cpp
@@ -73,7 +73,7 @@ BOOL vncSockConnectThread::Init(VSocket *socket, vncServer *server) @@ -73,7 +73,7 @@ BOOL vncSockConnectThread::Init(VSocket *socket, vncServer *server)
73 // Code to be executed by the thread 73 // Code to be executed by the thread
74 void *vncSockConnectThread::run_undetached(void * arg) 74 void *vncSockConnectThread::run_undetached(void * arg)
75 { 75 {
76 - vnclog.Print(LL_STATE, VNCLOG("Thread de conexão iniciada.\n")); 76 + vnclog.Print(LL_STATE, VNCLOG("Thread de conexão iniciada."));
77 77
78 // Go into a loop, listening for connections on the given socket 78 // Go into a loop, listening for connections on the given socket
79 while (!m_shutdown) 79 while (!m_shutdown)
@@ -84,7 +84,7 @@ void *vncSockConnectThread::run_undetached(void * arg) @@ -84,7 +84,7 @@ void *vncSockConnectThread::run_undetached(void * arg)
84 break; 84 break;
85 else 85 else
86 { 86 {
87 - vnclog.Print(LL_CLIENTS, VNCLOG("accepted connection from %s\n"), new_socket->GetPeerName()); 87 + vnclog.Print(LL_CLIENTS, VNCLOG("accepted connection from %s"), new_socket->GetPeerName());
88 m_server->AddClient(new_socket, FALSE, FALSE,NULL); 88 m_server->AddClient(new_socket, FALSE, FALSE,NULL);
89 } 89 }
90 90
@@ -135,7 +135,7 @@ void *vncSockConnectThread::run_undetached(void * arg) @@ -135,7 +135,7 @@ void *vncSockConnectThread::run_undetached(void * arg)
135 //We need at least a RFB start in the message 135 //We need at least a RFB start in the message
136 if (strncmp(protocol_ver,"RFB",3)==NULL) 136 if (strncmp(protocol_ver,"RFB",3)==NULL)
137 { 137 {
138 - vnclog.Print(LL_CLIENTS, VNCLOG("accepted connection from %s\n"), new_socket->GetPeerName()); 138 + vnclog.Print(LL_CLIENTS, VNCLOG("accepted connection from %s"), new_socket->GetPeerName());
139 // Successful accept - start the client unauthenticated 139 // Successful accept - start the client unauthenticated
140 m_server->AddClient(new_socket, FALSE, FALSE,&protocol_ver); 140 m_server->AddClient(new_socket, FALSE, FALSE,&protocol_ver);
141 } 141 }
@@ -153,7 +153,7 @@ void *vncSockConnectThread::run_undetached(void * arg) @@ -153,7 +153,7 @@ void *vncSockConnectThread::run_undetached(void * arg)
153 //if (new_socket != null) 153 //if (new_socket != null)
154 // delete new_socket; 154 // delete new_socket;
155 155
156 - vnclog.Print(LL_STATE, VNCLOG("Terminando a thread de socket...\n")); 156 + vnclog.Print(LL_STATE, VNCLOG("Terminando a thread de socket..."));
157 157
158 return NULL; 158 return NULL;
159 } 159 }
srcacic/WinVNC/WinVNC/vsocket.cpp
@@ -125,7 +125,7 @@ VSocket::VSocket() @@ -125,7 +125,7 @@ VSocket::VSocket()
125 { 125 {
126 // Clear out the internal socket fields 126 // Clear out the internal socket fields
127 sock = -1; 127 sock = -1;
128 - vnclog.Print(LL_SOCKINFO, VNCLOG("VSocket() m_pDSMPlugin = NULL \n")); 128 + vnclog.Print(LL_SOCKINFO, VNCLOG("VSocket() m_pDSMPlugin = NULL "));
129 m_pDSMPlugin = NULL; 129 m_pDSMPlugin = NULL;
130 m_fUsePlugin = false; 130 m_fUsePlugin = false;
131 131
@@ -196,7 +196,7 @@ VSocket::Close() @@ -196,7 +196,7 @@ VSocket::Close()
196 { 196 {
197 if (sock >= 0) 197 if (sock >= 0)
198 { 198 {
199 - vnclog.Print(LL_SOCKINFO, VNCLOG("closing socket\n")); 199 + vnclog.Print(LL_SOCKINFO, VNCLOG("closing socket"));
200 200
201 shutdown(sock, SD_BOTH); 201 shutdown(sock, SD_BOTH);
202 #ifdef __WIN32__ 202 #ifdef __WIN32__
@@ -216,7 +216,7 @@ VSocket::Shutdown() @@ -216,7 +216,7 @@ VSocket::Shutdown()
216 { 216 {
217 if (sock >= 0) 217 if (sock >= 0)
218 { 218 {
219 - vnclog.Print(LL_SOCKINFO, VNCLOG("shutdown socket\n")); 219 + vnclog.Print(LL_SOCKINFO, VNCLOG("shutdown socket"));
220 220
221 shutdown(sock, SD_BOTH); 221 shutdown(sock, SD_BOTH);
222 // sock = -1; 222 // sock = -1;
@@ -376,8 +376,9 @@ VSocket::GetPeerName() @@ -376,8 +376,9 @@ VSocket::GetPeerName()
376 name = inet_ntoa(address); 376 name = inet_ntoa(address);
377 if (name == NULL) 377 if (name == NULL)
378 return "<unavailable>"; 378 return "<unavailable>";
379 - else 379 + else{
380 return name; 380 return name;
  381 + }
381 } 382 }
382 383
383 //////////////////////////// 384 ////////////////////////////
@@ -463,14 +464,14 @@ VSocket::Send(const char *buff, const VCard bufflen) @@ -463,14 +464,14 @@ VSocket::Send(const char *buff, const VCard bufflen)
463 { 464 {
464 memcpy(queuebuffer+queuebuffersize,buff2,8192-queuebuffersize); 465 memcpy(queuebuffer+queuebuffersize,buff2,8192-queuebuffersize);
465 send(sock,queuebuffer,8192,0); 466 send(sock,queuebuffer,8192,0);
466 -// vnclog.Print(LL_SOCKERR, VNCLOG("SEND %i\n") ,8192); 467 +// vnclog.Print(LL_SOCKERR, VNCLOG("SEND %i") ,8192);
467 buff2+=(8192-queuebuffersize); 468 buff2+=(8192-queuebuffersize);
468 bufflen2-=(8192-queuebuffersize); 469 bufflen2-=(8192-queuebuffersize);
469 queuebuffersize=0; 470 queuebuffersize=0;
470 while (bufflen2 > 8192) 471 while (bufflen2 > 8192)
471 { 472 {
472 if (!send(sock,buff2,8192,0)) return false; 473 if (!send(sock,buff2,8192,0)) return false;
473 -// vnclog.Print(LL_SOCKERR, VNCLOG("SEND 1 %i\n") ,8192); 474 +// vnclog.Print(LL_SOCKERR, VNCLOG("SEND 1 %i") ,8192);
474 buff2+=8192; 475 buff2+=8192;
475 bufflen2-=8192; 476 bufflen2-=8192;
476 } 477 }
@@ -478,7 +479,7 @@ VSocket::Send(const char *buff, const VCard bufflen) @@ -478,7 +479,7 @@ VSocket::Send(const char *buff, const VCard bufflen)
478 memcpy(queuebuffer+queuebuffersize,buff2,bufflen2); 479 memcpy(queuebuffer+queuebuffersize,buff2,bufflen2);
479 queuebuffersize+=bufflen2; 480 queuebuffersize+=bufflen2;
480 if (!send(sock,queuebuffer,queuebuffersize,0)) return false; 481 if (!send(sock,queuebuffer,queuebuffersize,0)) return false;
481 -// vnclog.Print(LL_SOCKERR, VNCLOG("SEND 2 %i\n") ,queuebuffersize); 482 +// vnclog.Print(LL_SOCKERR, VNCLOG("SEND 2 %i") ,queuebuffersize);
482 queuebuffersize=0; 483 queuebuffersize=0;
483 return bufflen; 484 return bufflen;
484 } 485 }
@@ -495,14 +496,14 @@ VSocket::SendQueued(const char *buff, const VCard bufflen) @@ -495,14 +496,14 @@ VSocket::SendQueued(const char *buff, const VCard bufflen)
495 { 496 {
496 memcpy(queuebuffer+queuebuffersize,buff2,8192-queuebuffersize); 497 memcpy(queuebuffer+queuebuffersize,buff2,8192-queuebuffersize);
497 send(sock,queuebuffer,8192,0); 498 send(sock,queuebuffer,8192,0);
498 - // vnclog.Print(LL_SOCKERR, VNCLOG("SEND Q %i\n") ,8192); 499 + // vnclog.Print(LL_SOCKERR, VNCLOG("SEND Q %i") ,8192);
499 buff2+=(8192-queuebuffersize); 500 buff2+=(8192-queuebuffersize);
500 bufflen2-=(8192-queuebuffersize); 501 bufflen2-=(8192-queuebuffersize);
501 queuebuffersize=0; 502 queuebuffersize=0;
502 while (bufflen2 > 8192) 503 while (bufflen2 > 8192)
503 { 504 {
504 if (!send(sock,buff2,8192,0)) return false; 505 if (!send(sock,buff2,8192,0)) return false;
505 - // vnclog.Print(LL_SOCKERR, VNCLOG("SEND Q %i\n") ,8192); 506 + // vnclog.Print(LL_SOCKERR, VNCLOG("SEND Q %i") ,8192);
506 buff2+=8192; 507 buff2+=8192;
507 bufflen2-=8192; 508 bufflen2-=8192;
508 } 509 }
@@ -517,7 +518,7 @@ VSocket::SendQueued(const char *buff, const VCard bufflen) @@ -517,7 +518,7 @@ VSocket::SendQueued(const char *buff, const VCard bufflen)
517 VBool 518 VBool
518 VSocket::SendExact(const char *buff, const VCard bufflen, unsigned char msgType) 519 VSocket::SendExact(const char *buff, const VCard bufflen, unsigned char msgType)
519 { 520 {
520 - //vnclog.Print(LL_SOCKERR, VNCLOG("SendExactMsg %i\n") ,bufflen); 521 + //vnclog.Print(LL_SOCKERR, VNCLOG("SendExactMsg %i") ,bufflen);
521 if (m_fUsePlugin && m_pDSMPlugin->IsEnabled()) 522 if (m_fUsePlugin && m_pDSMPlugin->IsEnabled())
522 { 523 {
523 // Send the transformed message type first 524 // Send the transformed message type first
@@ -536,7 +537,7 @@ VSocket::SendExact(const char *buff, const VCard bufflen, unsigned char msgType) @@ -536,7 +537,7 @@ VSocket::SendExact(const char *buff, const VCard bufflen, unsigned char msgType)
536 VBool 537 VBool
537 VSocket::SendExact(const char *buff, const VCard bufflen) 538 VSocket::SendExact(const char *buff, const VCard bufflen)
538 { 539 {
539 -// vnclog.Print(LL_SOCKERR, VNCLOG("SendExact %i\n") ,bufflen); 540 +// vnclog.Print(LL_SOCKERR, VNCLOG("SendExact %i") ,bufflen);
540 // sf@2002 - DSMPlugin 541 // sf@2002 - DSMPlugin
541 VCard nBufflen = bufflen; 542 VCard nBufflen = bufflen;
542 char* pBuffer = NULL; 543 char* pBuffer = NULL;
@@ -573,8 +574,8 @@ VSocket::SendExact(const char *buff, const VCard bufflen) @@ -573,8 +574,8 @@ VSocket::SendExact(const char *buff, const VCard bufflen)
573 VBool 574 VBool
574 VSocket::SendExactQueue(const char *buff, const VCard bufflen) 575 VSocket::SendExactQueue(const char *buff, const VCard bufflen)
575 { 576 {
576 -// vnclog.Print(LL_SOCKERR, VNCLOG("SendExactQueue %i %i\n") ,bufflen,queuebuffersize);  
577 -// vnclog.Print(LL_SOCKERR, VNCLOG("socket size %i\n") ,bufflen); 577 +// vnclog.Print(LL_SOCKERR, VNCLOG("SendExactQueue %i %i") ,bufflen,queuebuffersize);
  578 +// vnclog.Print(LL_SOCKERR, VNCLOG("socket size %i") ,bufflen);
578 // sf@2002 - DSMPlugin 579 // sf@2002 - DSMPlugin
579 VCard nBufflen = bufflen; 580 VCard nBufflen = bufflen;
580 char* pBuffer = NULL; 581 char* pBuffer = NULL;
@@ -646,7 +647,7 @@ VSocket::ReadExact(char *buff, const VCard bufflen) @@ -646,7 +647,7 @@ VSocket::ReadExact(char *buff, const VCard bufflen)
646 { 647 {
647 // m_pDSMPlugin->RestoreBufferUnlock(); 648 // m_pDSMPlugin->RestoreBufferUnlock();
648 // throw WarningException("WriteExact: DSMPlugin-RestoreBuffer Alloc Error."); 649 // throw WarningException("WriteExact: DSMPlugin-RestoreBuffer Alloc Error.");
649 - vnclog.Print(LL_SOCKERR, VNCLOG("WriteExact: DSMPlugin-RestoreBuffer Alloc Error\n")); 650 + vnclog.Print(LL_SOCKERR, VNCLOG("WriteExact: DSMPlugin-RestoreBuffer Alloc Error"));
650 return VFalse; 651 return VFalse;
651 } 652 }
652 653
@@ -663,13 +664,13 @@ VSocket::ReadExact(char *buff, const VCard bufflen) @@ -663,13 +664,13 @@ VSocket::ReadExact(char *buff, const VCard bufflen)
663 nTransDataLen -= n; 664 nTransDataLen -= n;
664 } else if (n == 0) { 665 } else if (n == 0) {
665 //m_pDSMPlugin->RestoreBufferUnlock(); 666 //m_pDSMPlugin->RestoreBufferUnlock();
666 - vnclog.Print(LL_SOCKERR, VNCLOG("zero bytes read1\n")); 667 + vnclog.Print(LL_SOCKERR, VNCLOG("zero bytes read1"));
667 return VFalse; 668 return VFalse;
668 } else { 669 } else {
669 if (WSAGetLastError() != WSAEWOULDBLOCK) 670 if (WSAGetLastError() != WSAEWOULDBLOCK)
670 { 671 {
671 //m_pDSMPlugin->RestoreBufferUnlock(); 672 //m_pDSMPlugin->RestoreBufferUnlock();
672 - vnclog.Print(LL_SOCKERR, VNCLOG("socket error 1: %d\n"), WSAGetLastError()); 673 + vnclog.Print(LL_SOCKERR, VNCLOG("socket error 1: %d"), WSAGetLastError());
673 return VFalse; 674 return VFalse;
674 } 675 }
675 } 676 }
@@ -699,14 +700,14 @@ VSocket::ReadExact(char *buff, const VCard bufflen) @@ -699,14 +700,14 @@ VSocket::ReadExact(char *buff, const VCard bufflen)
699 buff += n; 700 buff += n;
700 currlen -= n; 701 currlen -= n;
701 } else if (n == 0) { 702 } else if (n == 0) {
702 - vnclog.Print(LL_SOCKERR, VNCLOG("zero bytes read2\n")); 703 + vnclog.Print(LL_SOCKERR, VNCLOG("zero bytes read2"));
703 704
704 return VFalse; 705 return VFalse;
705 } else { 706 } else {
706 if (WSAGetLastError() != WSAEWOULDBLOCK) 707 if (WSAGetLastError() != WSAEWOULDBLOCK)
707 { 708 {
708 //int aa=WSAGetLastError(); 709 //int aa=WSAGetLastError();
709 - //vnclog.Print(LL_SOCKERR, VNCLOG("socket error 2: %d\n"), aa); 710 + //vnclog.Print(LL_SOCKERR, VNCLOG("socket error 2: %d"), aa);
710 return VFalse; 711 return VFalse;
711 } 712 }
712 } 713 }
@@ -777,13 +778,13 @@ VSocket::ReadExactHTTP(char *buff, const VCard bufflen) @@ -777,13 +778,13 @@ VSocket::ReadExactHTTP(char *buff, const VCard bufflen)
777 buff += n; 778 buff += n;
778 currlen -= n; 779 currlen -= n;
779 } else if (n == 0) { 780 } else if (n == 0) {
780 - vnclog.Print(LL_SOCKERR, VNCLOG("zero bytes read3\n")); 781 + vnclog.Print(LL_SOCKERR, VNCLOG("zero bytes read3"));
781 782
782 return VFalse; 783 return VFalse;
783 } else { 784 } else {
784 if (WSAGetLastError() != WSAEWOULDBLOCK) 785 if (WSAGetLastError() != WSAEWOULDBLOCK)
785 { 786 {
786 - vnclog.Print(LL_SOCKERR, VNCLOG("HTTP socket error: %d\n"), WSAGetLastError()); 787 + vnclog.Print(LL_SOCKERR, VNCLOG("HTTP socket error: %d"), WSAGetLastError());
787 return VFalse; 788 return VFalse;
788 } 789 }
789 } 790 }
srcacic/WinVNC/WinVNC/winvnc.cpp
@@ -103,6 +103,7 @@ void Set_uninstall_service_as_admin(); @@ -103,6 +103,7 @@ void Set_uninstall_service_as_admin();
103 void Set_install_service_as_admin(); 103 void Set_install_service_as_admin();
104 void winvncSecurityEditorHelper_as_admin(); 104 void winvncSecurityEditorHelper_as_admin();
105 105
  106 +
106 // [v1.0.2-jp1 fix] Load resouce from dll 107 // [v1.0.2-jp1 fix] Load resouce from dll
107 HINSTANCE hInstResDLL; 108 HINSTANCE hInstResDLL;
108 109
@@ -229,7 +230,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR szCmdLine, @@ -229,7 +230,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR szCmdLine,
229 230
230 if (strncmp(&szCmdLine[0], winvncKill, strlen(winvncKill)) == 0) 231 if (strncmp(&szCmdLine[0], winvncKill, strlen(winvncKill)) == 0)
231 { 232 {
232 - vnclog.Print(LL_SRLOG, VNCLOG("---> Comando -kill recebido.\n")); 233 + vnclog.Print(LL_SRLOG, VNCLOG("---> Comando -kill recebido."));
233 234
234 argfound = TRUE; 235 argfound = TRUE;
235 236
@@ -250,7 +251,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR szCmdLine, @@ -250,7 +251,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR szCmdLine,
250 251
251 if (strncmp(&szCmdLine[0], winvncStart, strlen(winvncStart)) == 0) 252 if (strncmp(&szCmdLine[0], winvncStart, strlen(winvncStart)) == 0)
252 { 253 {
253 - vnclog.Print(LL_SRLOG, VNCLOG("---> Comando -start recebido.\n")); 254 + vnclog.Print(LL_SRLOG, VNCLOG("---> Comando -start recebido."));
254 argfound = TRUE; 255 argfound = TRUE;
255 256
256 char* cmdln[8]; 257 char* cmdln[8];
@@ -263,7 +264,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR szCmdLine, @@ -263,7 +264,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR szCmdLine,
263 264
264 if (i < 7) { 265 if (i < 7) {
265 MessageBox(NULL, "Número de parâmetros menor do que o esperado!", "ERRO!", MB_OK | MB_ICONERROR); 266 MessageBox(NULL, "Número de parâmetros menor do que o esperado!", "ERRO!", MB_OK | MB_ICONERROR);
266 - vnclog.Print(LL_SRLOG, VNCLOG("Número de parâmetros menor do que o esperado!\n")); 267 + vnclog.Print(LL_SRLOG, VNCLOG("Número de parâmetros menor do que o esperado!"));
267 return 0; 268 return 0;
268 } 269 }
269 270
@@ -274,7 +275,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR szCmdLine, @@ -274,7 +275,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR szCmdLine,
274 string filePath = string(cmdln[5]); 275 string filePath = string(cmdln[5]);
275 filePath += CACIC_Auth::AGUARDE_FILENAME; 276 filePath += CACIC_Auth::AGUARDE_FILENAME;
276 pFile = fopen(filePath.data(), "w+"); 277 pFile = fopen(filePath.data(), "w+");
277 - vnclog.Print(LL_SRLOG, VNCLOG("Criando arquivo temporário: aguarde_SRCACIC.txt!\n")); 278 + vnclog.Print(LL_SRLOG, VNCLOG("Criando arquivo temporário: aguarde_SRCACIC.txt!"));
278 279
279 // decodifica o host e o script do gerente web 280 // decodifica o host e o script do gerente web
280 string te_end_serv_dec; 281 string te_end_serv_dec;
@@ -308,7 +309,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR szCmdLine, @@ -308,7 +309,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR szCmdLine,
308 if (!argfound) { 309 if (!argfound) {
309 // If no arguments were given then do not run 310 // If no arguments were given then do not run
310 MessageBox(NULL, "Execução incorreta!", "ERRO!", MB_OK | MB_ICONERROR); 311 MessageBox(NULL, "Execução incorreta!", "ERRO!", MB_OK | MB_ICONERROR);
311 - vnclog.Print(LL_SRLOG, VNCLOG("Tentativa incorreta de execução!\n")); 312 + vnclog.Print(LL_SRLOG, VNCLOG("Tentativa incorreta de execução!"));
312 return 0; 313 return 0;
313 } 314 }
314 315
@@ -350,11 +351,11 @@ bool ImpersonateCurrentUser_() @@ -350,11 +351,11 @@ bool ImpersonateCurrentUser_()
350 Token_=NULL; 351 Token_=NULL;
351 if (GetCurrentUserToken_()==0) 352 if (GetCurrentUserToken_()==0)
352 { 353 {
353 - vnclog.Print(LL_INTERR, VNCLOG("!GetCurrentUserToken_ \n")); 354 + vnclog.Print(LL_INTERR, VNCLOG("!GetCurrentUserToken_ "));
354 return false; 355 return false;
355 } 356 }
356 bool test=(FALSE != ImpersonateLoggedOnUser(Token_)); 357 bool test=(FALSE != ImpersonateLoggedOnUser(Token_));
357 - if (test==1) vnclog.Print(LL_INTERR, VNCLOG("ImpersonateLoggedOnUser OK \n")); 358 + if (test==1) vnclog.Print(LL_INTERR, VNCLOG("ImpersonateLoggedOnUser OK "));
358 if (process_) CloseHandle(process_); 359 if (process_) CloseHandle(process_);
359 if (Token_) CloseHandle(Token_); 360 if (Token_) CloseHandle(Token_);
360 return test; 361 return test;
@@ -366,8 +367,8 @@ DWORD WINAPI imp_desktop_thread(LPVOID lpParam) @@ -366,8 +367,8 @@ DWORD WINAPI imp_desktop_thread(LPVOID lpParam)
366 vncServer *server = (vncServer *)lpParam; 367 vncServer *server = (vncServer *)lpParam;
367 368
368 HDESK desktop; 369 HDESK desktop;
369 - //vnclog.Print(LL_INTERR, VNCLOG("SelectDesktop \n"));  
370 - //vnclog.Print(LL_INTERR, VNCLOG("OpenInputdesktop2 NULL\n")); 370 + //vnclog.Print(LL_INTERR, VNCLOG("SelectDesktop "));
  371 + //vnclog.Print(LL_INTERR, VNCLOG("OpenInputdesktop2 NULL"));
371 desktop = OpenInputDesktop(0, FALSE, 372 desktop = OpenInputDesktop(0, FALSE,
372 DESKTOP_CREATEMENU | DESKTOP_CREATEWINDOW | 373 DESKTOP_CREATEMENU | DESKTOP_CREATEWINDOW |
373 DESKTOP_ENUMERATE | DESKTOP_HOOKCONTROL | 374 DESKTOP_ENUMERATE | DESKTOP_HOOKCONTROL |
@@ -376,9 +377,9 @@ DWORD WINAPI imp_desktop_thread(LPVOID lpParam) @@ -376,9 +377,9 @@ DWORD WINAPI imp_desktop_thread(LPVOID lpParam)
376 ); 377 );
377 378
378 if (desktop == NULL) 379 if (desktop == NULL)
379 - vnclog.Print(LL_INTERR, VNCLOG("OpenInputdesktop Error \n")); 380 + vnclog.Print(LL_INTERR, VNCLOG("OpenInputdesktop Error "));
380 else 381 else
381 - vnclog.Print(LL_INTERR, VNCLOG("OpenInputdesktop OK\n")); 382 + vnclog.Print(LL_INTERR, VNCLOG("OpenInputdesktop OK"));
382 383
383 HDESK old_desktop = GetThreadDesktop(GetCurrentThreadId()); 384 HDESK old_desktop = GetThreadDesktop(GetCurrentThreadId());
384 DWORD dummy; 385 DWORD dummy;
@@ -387,18 +388,18 @@ DWORD WINAPI imp_desktop_thread(LPVOID lpParam) @@ -387,18 +388,18 @@ DWORD WINAPI imp_desktop_thread(LPVOID lpParam)
387 388
388 if (!GetUserObjectInformation(desktop, UOI_NAME, &new_name, 256, &dummy)) 389 if (!GetUserObjectInformation(desktop, UOI_NAME, &new_name, 256, &dummy))
389 { 390 {
390 - vnclog.Print(LL_INTERR, VNCLOG("!GetUserObjectInformation \n")); 391 + vnclog.Print(LL_INTERR, VNCLOG("!GetUserObjectInformation "));
391 } 392 }
392 393
393 - vnclog.Print(LL_INTERR, VNCLOG("SelectHDESK to %s (%x) from %x\n"), new_name, desktop, old_desktop); 394 + vnclog.Print(LL_INTERR, VNCLOG("SelectHDESK to %s (%x) from %x"), new_name, desktop, old_desktop);
394 395
395 if (!SetThreadDesktop(desktop)) 396 if (!SetThreadDesktop(desktop))
396 { 397 {
397 - vnclog.Print(LL_INTERR, VNCLOG("SelectHDESK:!SetThreadDesktop \n")); 398 + vnclog.Print(LL_INTERR, VNCLOG("SelectHDESK:!SetThreadDesktop "));
398 } 399 }
399 400
400 if (!CloseDesktop(old_desktop)) 401 if (!CloseDesktop(old_desktop))
401 - vnclog.Print(LL_INTERR, VNCLOG("SelectHDESK failed to close old desktop %x (Err=%d)\n"), old_desktop, GetLastError()); 402 + vnclog.Print(LL_INTERR, VNCLOG("SelectHDESK failed to close old desktop %x (Err=%d)"), old_desktop, GetLastError());
402 403
403 // ImpersonateCurrentUser_(); 404 // ImpersonateCurrentUser_();
404 405
@@ -421,19 +422,19 @@ DWORD WINAPI imp_desktop_thread(LPVOID lpParam) @@ -421,19 +422,19 @@ DWORD WINAPI imp_desktop_thread(LPVOID lpParam)
421 } 422 }
422 else 423 else
423 { 424 {
424 - vnclog.Print(LL_INTERR, VNCLOG("getusername error %d\n"), GetLastError()); 425 + vnclog.Print(LL_INTERR, VNCLOG("getusername error %d"), GetLastError());
425 return FALSE; 426 return FALSE;
426 } 427 }
427 } 428 }
428 } 429 }
429 } 430 }
430 - vnclog.Print(LL_INTERR, VNCLOG("Username %s \n"),m_username); 431 + vnclog.Print(LL_INTERR, VNCLOG("Username %s "),m_username);
431 432
432 // Create tray icon and menu 433 // Create tray icon and menu
433 vncMenu *menu = new vncMenu(server); 434 vncMenu *menu = new vncMenu(server);
434 if (menu == NULL) 435 if (menu == NULL)
435 { 436 {
436 - vnclog.Print(LL_INTERR, VNCLOG("failed to create tray menu\n")); 437 + vnclog.Print(LL_INTERR, VNCLOG("failed to create tray menu"));
437 PostQuitMessage(0); 438 PostQuitMessage(0);
438 } 439 }
439 440
@@ -458,7 +459,7 @@ DWORD WINAPI imp_desktop_thread(LPVOID lpParam) @@ -458,7 +459,7 @@ DWORD WINAPI imp_desktop_thread(LPVOID lpParam)
458 if (menu != NULL) 459 if (menu != NULL)
459 delete menu; 460 delete menu;
460 461
461 - //vnclog.Print(LL_INTERR, VNCLOG("GetMessage stop \n")); 462 + //vnclog.Print(LL_INTERR, VNCLOG("GetMessage stop "));
462 CloseDesktop(desktop); 463 CloseDesktop(desktop);
463 // RevertToSelf(); 464 // RevertToSelf();
464 return 0; 465 return 0;
@@ -472,13 +473,13 @@ void CALLBACK fpTimer(UINT uID, UINT uMsg, DWORD dwUser, DWORD dw1, DWORD dw2) @@ -472,13 +473,13 @@ void CALLBACK fpTimer(UINT uID, UINT uMsg, DWORD dwUser, DWORD dw1, DWORD dw2)
472 { 473 {
473 if (hShutdownEvent) 474 if (hShutdownEvent)
474 { 475 {
475 - // vnclog.Print(LL_INTERR, VNCLOG("****************** SDTimer tic\n")); 476 + // vnclog.Print(LL_INTERR, VNCLOG("****************** SDTimer tic"));
476 DWORD result=WaitForSingleObject(hShutdownEvent, 0); 477 DWORD result=WaitForSingleObject(hShutdownEvent, 0);
477 if (WAIT_OBJECT_0==result) 478 if (WAIT_OBJECT_0==result)
478 { 479 {
479 ResetEvent(hShutdownEvent); 480 ResetEvent(hShutdownEvent);
480 fShutdownOrdered = true; 481 fShutdownOrdered = true;
481 - vnclog.Print(LL_INTERR, VNCLOG("****************** WaitForSingleObject - Shutdown server\n")); 482 + vnclog.Print(LL_INTERR, VNCLOG("****************** WaitForSingleObject - Shutdown server"));
482 } 483 }
483 } 484 }
484 } 485 }
@@ -486,14 +487,14 @@ void CALLBACK fpTimer(UINT uID, UINT uMsg, DWORD dwUser, DWORD dw1, DWORD dw2) @@ -486,14 +487,14 @@ void CALLBACK fpTimer(UINT uID, UINT uMsg, DWORD dwUser, DWORD dw1, DWORD dw2)
486 void InitSDTimer() 487 void InitSDTimer()
487 { 488 {
488 if (mmRes != -1) return; 489 if (mmRes != -1) return;
489 - vnclog.Print(LL_INTERR, VNCLOG("****************** Init SDTimer\n")); 490 + vnclog.Print(LL_INTERR, VNCLOG("****************** Init SDTimer"));
490 mmRes = timeSetEvent( 2000, 0, (LPTIMECALLBACK)fpTimer, NULL, TIME_PERIODIC ); 491 mmRes = timeSetEvent( 2000, 0, (LPTIMECALLBACK)fpTimer, NULL, TIME_PERIODIC );
491 } 492 }
492 493
493 494
494 void KillSDTimer() 495 void KillSDTimer()
495 { 496 {
496 - vnclog.Print(LL_INTERR, VNCLOG("****************** Kill SDTimer\n")); 497 + vnclog.Print(LL_INTERR, VNCLOG("****************** Kill SDTimer"));
497 timeKillEvent(mmRes); 498 timeKillEvent(mmRes);
498 mmRes = -1; 499 mmRes = -1;
499 } 500 }
@@ -507,7 +508,7 @@ void KillSDTimer() @@ -507,7 +508,7 @@ void KillSDTimer()
507 int WinVNCAppMain() 508 int WinVNCAppMain()
508 { 509 {
509 SetOSVersion(); 510 SetOSVersion();
510 - vnclog.Print(LL_INTINFO, VNCLOG("***** DBG - WinVNCAPPMain\n")); 511 + vnclog.Print(LL_INTINFO, VNCLOG("***** DBG - WinVNCAPPMain"));
511 #ifdef CRASH_ENABLED 512 #ifdef CRASH_ENABLED
512 LPVOID lpvState = Install(NULL, "rudi.de.vos@skynet.be", "UltraVnc"); 513 LPVOID lpvState = Install(NULL, "rudi.de.vos@skynet.be", "UltraVnc");
513 #endif 514 #endif
@@ -523,7 +524,7 @@ int WinVNCAppMain() @@ -523,7 +524,7 @@ int WinVNCAppMain()
523 return 0; 524 return 0;
524 } 525 }
525 526
526 - //vnclog.Print(LL_INTINFO, VNCLOG("***** DBG - Previous instance checked - Trying to create server\n")); 527 + //vnclog.Print(LL_INTINFO, VNCLOG("***** DBG - Previous instance checked - Trying to create server"));
527 // CREATE SERVER 528 // CREATE SERVER
528 vncServer server; 529 vncServer server;
529 530
@@ -532,7 +533,7 @@ int WinVNCAppMain() @@ -532,7 +533,7 @@ int WinVNCAppMain()
532 server.SetPort(CACIC_Auth::getInstance()->getPorta()); 533 server.SetPort(CACIC_Auth::getInstance()->getPorta());
533 server.SetAutoIdleDisconnectTimeout(CACIC_Auth::getInstance()->getTimeout()); 534 server.SetAutoIdleDisconnectTimeout(CACIC_Auth::getInstance()->getTimeout());
534 server.SockConnect(TRUE); 535 server.SockConnect(TRUE);
535 - vnclog.Print(LL_STATE, VNCLOG("Servidor inicializado com sucesso!\n")); 536 + vnclog.Print(LL_STATE, VNCLOG("Servidor inicializado com sucesso!"));
536 //uninstall driver before cont 537 //uninstall driver before cont
537 538
538 // sf@2007 - Set Application0 special mode 539 // sf@2007 - Set Application0 special mode
@@ -542,14 +543,14 @@ int WinVNCAppMain() @@ -542,14 +543,14 @@ int WinVNCAppMain()
542 // Subscribe to shutdown event 543 // Subscribe to shutdown event
543 hShutdownEvent = OpenEvent(EVENT_ALL_ACCESS, FALSE, "Global\\SessionEventUltra"); 544 hShutdownEvent = OpenEvent(EVENT_ALL_ACCESS, FALSE, "Global\\SessionEventUltra");
544 if (hShutdownEvent) ResetEvent(hShutdownEvent); 545 if (hShutdownEvent) ResetEvent(hShutdownEvent);
545 - vnclog.Print(LL_STATE, VNCLOG("SDEvent criado.\n")); 546 + vnclog.Print(LL_STATE, VNCLOG("SDEvent criado."));
546 // Create the timer that looks periodicaly for shutdown event 547 // Create the timer that looks periodicaly for shutdown event
547 mmRes = -1; 548 mmRes = -1;
548 InitSDTimer(); 549 InitSDTimer();
549 550
550 while (!fShutdownOrdered) 551 while (!fShutdownOrdered)
551 { 552 {
552 - //vnclog.Print(LL_STATE, VNCLOG("################## Creating Imp Thread : %d \n"), nn); 553 + //vnclog.Print(LL_STATE, VNCLOG("################## Creating Imp Thread : %d "), nn);
553 554
554 HANDLE threadHandle; 555 HANDLE threadHandle;
555 DWORD dwTId; 556 DWORD dwTId;
@@ -557,14 +558,14 @@ int WinVNCAppMain() @@ -557,14 +558,14 @@ int WinVNCAppMain()
557 558
558 WaitForSingleObject( threadHandle, INFINITE ); 559 WaitForSingleObject( threadHandle, INFINITE );
559 CloseHandle(threadHandle); 560 CloseHandle(threadHandle);
560 - vnclog.Print(LL_STATE, VNCLOG("Fechando a imp thread...\n")); 561 + vnclog.Print(LL_STATE, VNCLOG("Fechando a imp thread..."));
561 } 562 }
562 563
563 if (instancehan!=NULL) 564 if (instancehan!=NULL)
564 delete instancehan; 565 delete instancehan;
565 566
566 if (hShutdownEvent)CloseHandle(hShutdownEvent); 567 if (hShutdownEvent)CloseHandle(hShutdownEvent);
567 - vnclog.Print(LL_STATE, VNCLOG("Finalizando o servidor...\n")); 568 + vnclog.Print(LL_STATE, VNCLOG("Finalizando o servidor..."));
568 return 1; 569 return 1;
569 }; 570 };
570 571
srcacic/WinVNC/WinVNC/winvnc.rc
@@ -118,7 +118,7 @@ BEGIN @@ -118,7 +118,7 @@ BEGIN
118 CTEXT "ESTAÇÃO DE TRABALHO EM SUPORTE REMOTO",IDC_AVISO_SUPORTE,54,12,205,11 118 CTEXT "ESTAÇÃO DE TRABALHO EM SUPORTE REMOTO",IDC_AVISO_SUPORTE,54,12,205,11
119 CTEXT "ATENÇÃO",IDC_ATENCAO_STATIC,54,2,205,10 119 CTEXT "ATENÇÃO",IDC_ATENCAO_STATIC,54,2,205,10
120 LTEXT "Nome:",IDC_NOME_LBL,54,22,24,8 120 LTEXT "Nome:",IDC_NOME_LBL,54,22,24,8
121 - LTEXT "IP:",IDC_IP_LBL,54,32,10,8 121 + LTEXT "IP:",IDC_IP_LBL,54,32,10,8 //IDC_IP_LBL
122 LTEXT "Início:",IDC_INICIO_LBL,54,42,20,8 122 LTEXT "Início:",IDC_INICIO_LBL,54,42,20,8
123 LTEXT "",IDC_INFO_NOME,78,23,181,8,0,WS_EX_TRANSPARENT 123 LTEXT "",IDC_INFO_NOME,78,23,181,8,0,WS_EX_TRANSPARENT
124 LTEXT "",IDC_INFO_IP,78,32,181,8,0,WS_EX_TRANSPARENT 124 LTEXT "",IDC_INFO_IP,78,32,181,8,0,WS_EX_TRANSPARENT
@@ -223,7 +223,7 @@ END @@ -223,7 +223,7 @@ END
223 // 223 //
224 224
225 VS_VERSION_INFO VERSIONINFO 225 VS_VERSION_INFO VERSIONINFO
226 - FILEVERSION 2,5,9,0 226 + FILEVERSION 2,6,0,0
227 PRODUCTVERSION 2,6,0,0 227 PRODUCTVERSION 2,6,0,0
228 FILEFLAGSMASK 0x37L 228 FILEFLAGSMASK 0x37L
229 #ifdef _DEBUG 229 #ifdef _DEBUG
@@ -242,7 +242,7 @@ BEGIN @@ -242,7 +242,7 @@ BEGIN
242 VALUE "Comments", "Licença: GNU/LGPL" 242 VALUE "Comments", "Licença: GNU/LGPL"
243 VALUE "CompanyName", "Dataprev-Emp. de TI da Prev Social - UDSL/SSLC" 243 VALUE "CompanyName", "Dataprev-Emp. de TI da Prev Social - UDSL/SSLC"
244 VALUE "FileDescription", "Sistema CACIC - Módulo Suporte Remoto Seguro" 244 VALUE "FileDescription", "Sistema CACIC - Módulo Suporte Remoto Seguro"
245 - VALUE "FileVersion", "2.5.9.0" 245 + VALUE "FileVersion", "2.6.0.0"
246 VALUE "InternalName", "srCACICsrv" 246 VALUE "InternalName", "srCACICsrv"
247 VALUE "LegalCopyright", "Copyright © 2008 DATAPREV" 247 VALUE "LegalCopyright", "Copyright © 2008 DATAPREV"
248 VALUE "ProductName", "srCACIC" 248 VALUE "ProductName", "srCACIC"