more server tools converted to unicode
authorVictor Kirhenshtein <victor@netxms.org>
Thu, 16 Dec 2010 20:47:12 +0000 (20:47 +0000)
committerVictor Kirhenshtein <victor@netxms.org>
Thu, 16 Dec 2010 20:47:12 +0000 (20:47 +0000)
13 files changed:
netxms.sln
src/server/netxmsd/netxmsd.cpp
src/server/tools/nxaction/nxaction.cpp
src/server/tools/nxaction/nxaction.vcproj
src/server/tools/nxap/nxap.cpp
src/server/tools/nxap/nxap.vcproj
src/server/tools/nxconfig/ConfigWizard.cpp
src/server/tools/nxconfig/ExecBatch.cpp
src/server/tools/nxconfig/WinSrvPage.cpp
src/server/tools/nxconfig/WizardWorker.cpp
src/server/tools/nxconfig/nxconfig.cpp
src/server/tools/nxconfig/nxconfig.h
src/server/tools/nxconfig/nxconfig.vcproj

index 7ded79d..fe9462f 100644 (file)
@@ -5,27 +5,27 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libexpat", "src\libexpat\li
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libnetxms", "src\libnetxms\libnetxms.vcproj", "{B1745870-F3ED-4ACB-B813-0C4F47EF0793}"
        ProjectSection(ProjectDependencies) = postProject
-               {6A88EF62-C4F2-4295-A833-549DAE4DF5ED} = {6A88EF62-C4F2-4295-A833-549DAE4DF5ED}
                {406AE5C7-343D-4C88-B8F3-84E46255B830} = {406AE5C7-343D-4C88-B8F3-84E46255B830}
+               {6A88EF62-C4F2-4295-A833-549DAE4DF5ED} = {6A88EF62-C4F2-4295-A833-549DAE4DF5ED}
        EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libnetxmsw", "src\libnetxms\libnetxmsw.vcproj", "{AEB182ED-7F5C-4F5A-BCE1-9A38E98579BA}"
        ProjectSection(ProjectDependencies) = postProject
-               {406AE5C7-343D-4C88-B8F3-84E46255B830} = {406AE5C7-343D-4C88-B8F3-84E46255B830}
                {6A88EF62-C4F2-4295-A833-549DAE4DF5ED} = {6A88EF62-C4F2-4295-A833-549DAE4DF5ED}
+               {406AE5C7-343D-4C88-B8F3-84E46255B830} = {406AE5C7-343D-4C88-B8F3-84E46255B830}
        EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libnxlp", "src\libnxlp\libnxlp.vcproj", "{64EFC0C2-C67B-41F6-851D-F11DAB27A60B}"
        ProjectSection(ProjectDependencies) = postProject
-               {6A88EF62-C4F2-4295-A833-549DAE4DF5ED} = {6A88EF62-C4F2-4295-A833-549DAE4DF5ED}
-               {406AE5C7-343D-4C88-B8F3-84E46255B830} = {406AE5C7-343D-4C88-B8F3-84E46255B830}
                {B1745870-F3ED-4ACB-B813-0C4F47EF0793} = {B1745870-F3ED-4ACB-B813-0C4F47EF0793}
+               {406AE5C7-343D-4C88-B8F3-84E46255B830} = {406AE5C7-343D-4C88-B8F3-84E46255B830}
+               {6A88EF62-C4F2-4295-A833-549DAE4DF5ED} = {6A88EF62-C4F2-4295-A833-549DAE4DF5ED}
        EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "nxagentd", "src\agent\core\nxagentd.vcproj", "{57598B02-3295-4FE8-9322-94CE871CC84D}"
        ProjectSection(ProjectDependencies) = postProject
-               {F3E29541-3A0E-45EC-8BEC-E193F2401622} = {F3E29541-3A0E-45EC-8BEC-E193F2401622}
                {B1745870-F3ED-4ACB-B813-0C4F47EF0793} = {B1745870-F3ED-4ACB-B813-0C4F47EF0793}
+               {F3E29541-3A0E-45EC-8BEC-E193F2401622} = {F3E29541-3A0E-45EC-8BEC-E193F2401622}
        EndProjectSection
 EndProject
 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "subagents", "subagents", "{451F583D-C2DB-4414-870C-7FA0189BE7DD}"
@@ -65,8 +65,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sms", "src\agent\subagents\
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "portcheck", "src\agent\subagents\portcheck\portcheck.vcproj", "{F66A27F0-2943-4A16-ACC7-B450314B5163}"
        ProjectSection(ProjectDependencies) = postProject
-               {B1745870-F3ED-4ACB-B813-0C4F47EF0793} = {B1745870-F3ED-4ACB-B813-0C4F47EF0793}
                {406AE5C7-343D-4C88-B8F3-84E46255B830} = {406AE5C7-343D-4C88-B8F3-84E46255B830}
+               {B1745870-F3ED-4ACB-B813-0C4F47EF0793} = {B1745870-F3ED-4ACB-B813-0C4F47EF0793}
        EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ping", "src\agent\subagents\ping\ping.vcproj", "{C5CCF5DE-152E-40F3-AC6C-C5E54BB7C45F}"
@@ -81,8 +81,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "odbcquery", "src\agent\suba
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "logwatch", "src\agent\subagents\logwatch\logwatch.vcproj", "{F8A8749E-E539-4A3B-A21C-2C5C86AE33EA}"
        ProjectSection(ProjectDependencies) = postProject
-               {64EFC0C2-C67B-41F6-851D-F11DAB27A60B} = {64EFC0C2-C67B-41F6-851D-F11DAB27A60B}
                {B1745870-F3ED-4ACB-B813-0C4F47EF0793} = {B1745870-F3ED-4ACB-B813-0C4F47EF0793}
+               {64EFC0C2-C67B-41F6-851D-F11DAB27A60B} = {64EFC0C2-C67B-41F6-851D-F11DAB27A60B}
        EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ecs", "src\agent\subagents\ecs\ecs.vcproj", "{BBE9028E-725C-45C6-97C9-BFC443F19DB6}"
@@ -104,124 +104,124 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libnxmapw", "src\libnxmap\l
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libnxcl", "src\libnxcl\libnxcl.vcproj", "{3CB9B8C6-E6BF-4002-A61A-7A21FEADB531}"
        ProjectSection(ProjectDependencies) = postProject
-               {B1745870-F3ED-4ACB-B813-0C4F47EF0793} = {B1745870-F3ED-4ACB-B813-0C4F47EF0793}
                {AB386821-B630-49F5-95C3-677B9DCE1270} = {AB386821-B630-49F5-95C3-677B9DCE1270}
+               {B1745870-F3ED-4ACB-B813-0C4F47EF0793} = {B1745870-F3ED-4ACB-B813-0C4F47EF0793}
        EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libnxclw", "src\libnxcl\libnxclw.vcproj", "{3CB9B8C6-E6BF-4002-A61A-7A21FEADB532}"
        ProjectSection(ProjectDependencies) = postProject
-               {0A5E80F3-485D-40C8-BE1E-9D7EE744DB8B} = {0A5E80F3-485D-40C8-BE1E-9D7EE744DB8B}
                {AEB182ED-7F5C-4F5A-BCE1-9A38E98579BA} = {AEB182ED-7F5C-4F5A-BCE1-9A38E98579BA}
+               {0A5E80F3-485D-40C8-BE1E-9D7EE744DB8B} = {0A5E80F3-485D-40C8-BE1E-9D7EE744DB8B}
        EndProjectSection
 EndProject
 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tools", "tools", "{39BF23C9-D903-4C20-8E88-19533A745625}"
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "nxalarm", "src\client\nxalarm\nxalarm.vcproj", "{F9FFAAE9-D669-451E-B9EF-18BC8AD37FAB}"
        ProjectSection(ProjectDependencies) = postProject
-               {3CB9B8C6-E6BF-4002-A61A-7A21FEADB531} = {3CB9B8C6-E6BF-4002-A61A-7A21FEADB531}
                {B1745870-F3ED-4ACB-B813-0C4F47EF0793} = {B1745870-F3ED-4ACB-B813-0C4F47EF0793}
+               {3CB9B8C6-E6BF-4002-A61A-7A21FEADB531} = {3CB9B8C6-E6BF-4002-A61A-7A21FEADB531}
        EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "nxevent", "src\client\nxevent\nxevent.vcproj", "{C7A460E8-12A8-4FC7-9F59-C9C5CE17ED20}"
        ProjectSection(ProjectDependencies) = postProject
-               {3CB9B8C6-E6BF-4002-A61A-7A21FEADB531} = {3CB9B8C6-E6BF-4002-A61A-7A21FEADB531}
                {B1745870-F3ED-4ACB-B813-0C4F47EF0793} = {B1745870-F3ED-4ACB-B813-0C4F47EF0793}
+               {3CB9B8C6-E6BF-4002-A61A-7A21FEADB531} = {3CB9B8C6-E6BF-4002-A61A-7A21FEADB531}
        EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "nxpush", "src\client\nxpush\nxpush.vcproj", "{B8671BF7-94E1-4615-A8C2-F5C78DB8C515}"
        ProjectSection(ProjectDependencies) = postProject
-               {3CB9B8C6-E6BF-4002-A61A-7A21FEADB531} = {3CB9B8C6-E6BF-4002-A61A-7A21FEADB531}
                {B1745870-F3ED-4ACB-B813-0C4F47EF0793} = {B1745870-F3ED-4ACB-B813-0C4F47EF0793}
+               {3CB9B8C6-E6BF-4002-A61A-7A21FEADB531} = {3CB9B8C6-E6BF-4002-A61A-7A21FEADB531}
        EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "nxsms", "src\client\nxsms\nxsms.vcproj", "{B0A70A32-A8F0-4071-8044-FDA3C834A5C5}"
        ProjectSection(ProjectDependencies) = postProject
-               {3CB9B8C6-E6BF-4002-A61A-7A21FEADB531} = {3CB9B8C6-E6BF-4002-A61A-7A21FEADB531}
                {B1745870-F3ED-4ACB-B813-0C4F47EF0793} = {B1745870-F3ED-4ACB-B813-0C4F47EF0793}
+               {3CB9B8C6-E6BF-4002-A61A-7A21FEADB531} = {3CB9B8C6-E6BF-4002-A61A-7A21FEADB531}
        EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libnxsnmp", "src\snmp\libnxsnmp\libnxsnmp.vcproj", "{7DC90EE4-E31C-4F12-8F1E-81F10E9099FB}"
        ProjectSection(ProjectDependencies) = postProject
-               {E7410EB4-3355-4C83-8E05-D2877581CDA1} = {E7410EB4-3355-4C83-8E05-D2877581CDA1}
                {B1745870-F3ED-4ACB-B813-0C4F47EF0793} = {B1745870-F3ED-4ACB-B813-0C4F47EF0793}
+               {E7410EB4-3355-4C83-8E05-D2877581CDA1} = {E7410EB4-3355-4C83-8E05-D2877581CDA1}
        EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "nxzlib", "src\zlib\nxzlib.vcproj", "{E7410EB4-3355-4C83-8E05-D2877581CDA1}"
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "nxsnmpget", "src\snmp\nxsnmpget\nxsnmpget.vcproj", "{0A4CE471-020A-42C6-91C0-DFEFA7E815E0}"
        ProjectSection(ProjectDependencies) = postProject
-               {7DC90EE4-E31C-4F12-8F1E-81F10E9099FB} = {7DC90EE4-E31C-4F12-8F1E-81F10E9099FB}
                {B1745870-F3ED-4ACB-B813-0C4F47EF0793} = {B1745870-F3ED-4ACB-B813-0C4F47EF0793}
+               {7DC90EE4-E31C-4F12-8F1E-81F10E9099FB} = {7DC90EE4-E31C-4F12-8F1E-81F10E9099FB}
        EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libnxsnmpw", "src\snmp\libnxsnmp\libnxsnmpw.vcproj", "{7DC90EE4-E31C-4F12-8F1E-81F10E9099FC}"
        ProjectSection(ProjectDependencies) = postProject
-               {AEB182ED-7F5C-4F5A-BCE1-9A38E98579BA} = {AEB182ED-7F5C-4F5A-BCE1-9A38E98579BA}
                {E7410EB4-3355-4C83-8E05-D2877581CDA1} = {E7410EB4-3355-4C83-8E05-D2877581CDA1}
+               {AEB182ED-7F5C-4F5A-BCE1-9A38E98579BA} = {AEB182ED-7F5C-4F5A-BCE1-9A38E98579BA}
        EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "nxsnmpset", "src\snmp\nxsnmpset\nxsnmpset.vcproj", "{9EA98E79-EB7D-4F6C-8105-AC7B231ABB10}"
        ProjectSection(ProjectDependencies) = postProject
-               {7DC90EE4-E31C-4F12-8F1E-81F10E9099FB} = {7DC90EE4-E31C-4F12-8F1E-81F10E9099FB}
                {B1745870-F3ED-4ACB-B813-0C4F47EF0793} = {B1745870-F3ED-4ACB-B813-0C4F47EF0793}
+               {7DC90EE4-E31C-4F12-8F1E-81F10E9099FB} = {7DC90EE4-E31C-4F12-8F1E-81F10E9099FB}
        EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "nxsnmpwalk", "src\snmp\nxsnmpwalk\nxsnmpwalk.vcproj", "{5FA3AADC-3AD7-4B17-A581-D5E02DE17727}"
        ProjectSection(ProjectDependencies) = postProject
-               {7DC90EE4-E31C-4F12-8F1E-81F10E9099FB} = {7DC90EE4-E31C-4F12-8F1E-81F10E9099FB}
                {B1745870-F3ED-4ACB-B813-0C4F47EF0793} = {B1745870-F3ED-4ACB-B813-0C4F47EF0793}
+               {7DC90EE4-E31C-4F12-8F1E-81F10E9099FB} = {7DC90EE4-E31C-4F12-8F1E-81F10E9099FB}
        EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "nxmibc", "src\snmp\nxmibc\nxmibc.vcproj", "{9F722C62-78FD-4D8C-A7C7-2815B09F1943}"
        ProjectSection(ProjectDependencies) = postProject
-               {7DC90EE4-E31C-4F12-8F1E-81F10E9099FB} = {7DC90EE4-E31C-4F12-8F1E-81F10E9099FB}
                {B1745870-F3ED-4ACB-B813-0C4F47EF0793} = {B1745870-F3ED-4ACB-B813-0C4F47EF0793}
+               {7DC90EE4-E31C-4F12-8F1E-81F10E9099FB} = {7DC90EE4-E31C-4F12-8F1E-81F10E9099FB}
        EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libnxsrv", "src\server\libnxsrv\libnxsrv.vcproj", "{CB89D905-C8BE-4027-B2D8-F96C245E9160}"
        ProjectSection(ProjectDependencies) = postProject
-               {AEB182ED-7F5C-4F5A-BCE1-9A38E98579BA} = {AEB182ED-7F5C-4F5A-BCE1-9A38E98579BA}
                {7DC90EE4-E31C-4F12-8F1E-81F10E9099FC} = {7DC90EE4-E31C-4F12-8F1E-81F10E9099FC}
+               {AEB182ED-7F5C-4F5A-BCE1-9A38E98579BA} = {AEB182ED-7F5C-4F5A-BCE1-9A38E98579BA}
        EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "nxcore", "src\server\core\nxcore.vcproj", "{3B172035-5EEC-45A3-8471-2C390B7ED683}"
        ProjectSection(ProjectDependencies) = postProject
-               {B2988503-1921-4B9F-BBC1-5E5CF62F335E} = {B2988503-1921-4B9F-BBC1-5E5CF62F335E}
-               {406AE5C7-343D-4C88-B8F3-84E46255B830} = {406AE5C7-343D-4C88-B8F3-84E46255B830}
-               {7DC90EE4-E31C-4F12-8F1E-81F10E9099FC} = {7DC90EE4-E31C-4F12-8F1E-81F10E9099FC}
-               {0A5E80F3-485D-40C8-BE1E-9D7EE744DB8B} = {0A5E80F3-485D-40C8-BE1E-9D7EE744DB8B}
-               {96EF0643-89FD-47CD-B82E-9F7D1DAF35EC} = {96EF0643-89FD-47CD-B82E-9F7D1DAF35EC}
-               {AEB182ED-7F5C-4F5A-BCE1-9A38E98579BA} = {AEB182ED-7F5C-4F5A-BCE1-9A38E98579BA}
-               {64EFC0C2-C67B-41F6-851D-F11DAB27A60B} = {64EFC0C2-C67B-41F6-851D-F11DAB27A60B}
                {CB89D905-C8BE-4027-B2D8-F96C245E9160} = {CB89D905-C8BE-4027-B2D8-F96C245E9160}
+               {64EFC0C2-C67B-41F6-851D-F11DAB27A60B} = {64EFC0C2-C67B-41F6-851D-F11DAB27A60B}
+               {AEB182ED-7F5C-4F5A-BCE1-9A38E98579BA} = {AEB182ED-7F5C-4F5A-BCE1-9A38E98579BA}
+               {96EF0643-89FD-47CD-B82E-9F7D1DAF35EC} = {96EF0643-89FD-47CD-B82E-9F7D1DAF35EC}
+               {0A5E80F3-485D-40C8-BE1E-9D7EE744DB8B} = {0A5E80F3-485D-40C8-BE1E-9D7EE744DB8B}
+               {7DC90EE4-E31C-4F12-8F1E-81F10E9099FC} = {7DC90EE4-E31C-4F12-8F1E-81F10E9099FC}
+               {406AE5C7-343D-4C88-B8F3-84E46255B830} = {406AE5C7-343D-4C88-B8F3-84E46255B830}
+               {B2988503-1921-4B9F-BBC1-5E5CF62F335E} = {B2988503-1921-4B9F-BBC1-5E5CF62F335E}
        EndProjectSection
 EndProject
 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "nxsl", "nxsl", "{CE0DA89E-CF0C-452C-9C33-75A143355BDC}"
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libnxsl", "src\libnxsl\libnxsl.vcproj", "{B2988503-1921-4B9F-BBC1-5E5CF62F335E}"
        ProjectSection(ProjectDependencies) = postProject
-               {406AE5C7-343D-4C88-B8F3-84E46255B830} = {406AE5C7-343D-4C88-B8F3-84E46255B830}
                {AEB182ED-7F5C-4F5A-BCE1-9A38E98579BA} = {AEB182ED-7F5C-4F5A-BCE1-9A38E98579BA}
+               {406AE5C7-343D-4C88-B8F3-84E46255B830} = {406AE5C7-343D-4C88-B8F3-84E46255B830}
        EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "nxscript", "src\nxscript\nxscript.vcproj", "{BA263F92-D5A9-4F26-9606-5A1C1495FEA5}"
        ProjectSection(ProjectDependencies) = postProject
-               {B2988503-1921-4B9F-BBC1-5E5CF62F335E} = {B2988503-1921-4B9F-BBC1-5E5CF62F335E}
                {AEB182ED-7F5C-4F5A-BCE1-9A38E98579BA} = {AEB182ED-7F5C-4F5A-BCE1-9A38E98579BA}
+               {B2988503-1921-4B9F-BBC1-5E5CF62F335E} = {B2988503-1921-4B9F-BBC1-5E5CF62F335E}
        EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "netxmsd", "src\server\netxmsd\netxmsd.vcproj", "{E417A0C4-41F1-4F87-8C33-8526ECB1F8AF}"
        ProjectSection(ProjectDependencies) = postProject
-               {3B172035-5EEC-45A3-8471-2C390B7ED683} = {3B172035-5EEC-45A3-8471-2C390B7ED683}
-               {CB89D905-C8BE-4027-B2D8-F96C245E9160} = {CB89D905-C8BE-4027-B2D8-F96C245E9160}
                {AEB182ED-7F5C-4F5A-BCE1-9A38E98579BA} = {AEB182ED-7F5C-4F5A-BCE1-9A38E98579BA}
+               {CB89D905-C8BE-4027-B2D8-F96C245E9160} = {CB89D905-C8BE-4027-B2D8-F96C245E9160}
+               {3B172035-5EEC-45A3-8471-2C390B7ED683} = {3B172035-5EEC-45A3-8471-2C390B7ED683}
        EndProjectSection
 EndProject
 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tools", "tools", "{64482674-7B36-4A14-A612-247333174315}"
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "nxaction", "src\server\tools\nxaction\nxaction.vcproj", "{BF5CE6BA-C84A-4448-B1B7-1B355AC77D12}"
        ProjectSection(ProjectDependencies) = postProject
-               {B1745870-F3ED-4ACB-B813-0C4F47EF0793} = {B1745870-F3ED-4ACB-B813-0C4F47EF0793}
+               {AEB182ED-7F5C-4F5A-BCE1-9A38E98579BA} = {AEB182ED-7F5C-4F5A-BCE1-9A38E98579BA}
                {CB89D905-C8BE-4027-B2D8-F96C245E9160} = {CB89D905-C8BE-4027-B2D8-F96C245E9160}
        EndProjectSection
 EndProject
@@ -232,31 +232,31 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "nxadm", "src\server\tools\n
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "nxget", "src\server\tools\nxget\nxget.vcproj", "{1AC3C8D1-E309-4327-9E17-0E4CE0FC68CF}"
        ProjectSection(ProjectDependencies) = postProject
-               {AEB182ED-7F5C-4F5A-BCE1-9A38E98579BA} = {AEB182ED-7F5C-4F5A-BCE1-9A38E98579BA}
                {CB89D905-C8BE-4027-B2D8-F96C245E9160} = {CB89D905-C8BE-4027-B2D8-F96C245E9160}
+               {AEB182ED-7F5C-4F5A-BCE1-9A38E98579BA} = {AEB182ED-7F5C-4F5A-BCE1-9A38E98579BA}
        EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "nxupload", "src\server\tools\nxupload\nxupload.vcproj", "{DA863269-ED58-4910-AA6A-2572A3EE745D}"
        ProjectSection(ProjectDependencies) = postProject
-               {B1745870-F3ED-4ACB-B813-0C4F47EF0793} = {B1745870-F3ED-4ACB-B813-0C4F47EF0793}
                {CB89D905-C8BE-4027-B2D8-F96C245E9160} = {CB89D905-C8BE-4027-B2D8-F96C245E9160}
+               {B1745870-F3ED-4ACB-B813-0C4F47EF0793} = {B1745870-F3ED-4ACB-B813-0C4F47EF0793}
        EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "nxdbmgr", "src\server\tools\nxdbmgr\nxdbmgr.vcproj", "{4940613E-A11C-4259-95C8-8D23217EE60E}"
        ProjectSection(ProjectDependencies) = postProject
-               {CB89D905-C8BE-4027-B2D8-F96C245E9160} = {CB89D905-C8BE-4027-B2D8-F96C245E9160}
-               {87CAA25D-991E-45E1-BB69-337D45121F19} = {87CAA25D-991E-45E1-BB69-337D45121F19}
-               {AEB182ED-7F5C-4F5A-BCE1-9A38E98579BA} = {AEB182ED-7F5C-4F5A-BCE1-9A38E98579BA}
                {96EF0643-89FD-47CD-B82E-9F7D1DAF35EC} = {96EF0643-89FD-47CD-B82E-9F7D1DAF35EC}
+               {AEB182ED-7F5C-4F5A-BCE1-9A38E98579BA} = {AEB182ED-7F5C-4F5A-BCE1-9A38E98579BA}
+               {87CAA25D-991E-45E1-BB69-337D45121F19} = {87CAA25D-991E-45E1-BB69-337D45121F19}
+               {CB89D905-C8BE-4027-B2D8-F96C245E9160} = {CB89D905-C8BE-4027-B2D8-F96C245E9160}
        EndProjectSection
 EndProject
 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "webui", "webui", "{7C6B32C4-53F9-4378-903E-1DA05748376B}"
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "nxhttpd", "src\webui\nxhttpd\nxhttpd.vcproj", "{AC0CB89C-E27A-43FA-A049-1FF4B2FE2121}"
        ProjectSection(ProjectDependencies) = postProject
-               {F5287CFB-0894-4169-B5B5-1AEE4F2FF585} = {F5287CFB-0894-4169-B5B5-1AEE4F2FF585}
-               {3CB9B8C6-E6BF-4002-A61A-7A21FEADB531} = {3CB9B8C6-E6BF-4002-A61A-7A21FEADB531}
                {B1745870-F3ED-4ACB-B813-0C4F47EF0793} = {B1745870-F3ED-4ACB-B813-0C4F47EF0793}
+               {3CB9B8C6-E6BF-4002-A61A-7A21FEADB531} = {3CB9B8C6-E6BF-4002-A61A-7A21FEADB531}
+               {F5287CFB-0894-4169-B5B5-1AEE4F2FF585} = {F5287CFB-0894-4169-B5B5-1AEE4F2FF585}
        EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libpng", "src\webui\libgd\libpng\libpng.vcproj", "{E9F4A68D-4BF2-45AD-BDD6-210AFF857661}"
@@ -272,67 +272,67 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "smsdrv", "smsdrv", "{5818CC
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "generic", "src\server\smsdrv\generic\generic.vcproj", "{41A5009F-4467-4D89-A171-5A919FEFE16E}"
        ProjectSection(ProjectDependencies) = postProject
-               {AEB182ED-7F5C-4F5A-BCE1-9A38E98579BA} = {AEB182ED-7F5C-4F5A-BCE1-9A38E98579BA}
                {CB89D905-C8BE-4027-B2D8-F96C245E9160} = {CB89D905-C8BE-4027-B2D8-F96C245E9160}
+               {AEB182ED-7F5C-4F5A-BCE1-9A38E98579BA} = {AEB182ED-7F5C-4F5A-BCE1-9A38E98579BA}
        EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "nxagent", "src\server\smsdrv\nxagent\nxagent.vcproj", "{C317231C-B984-4423-ACF2-C19DE8B6AA3F}"
        ProjectSection(ProjectDependencies) = postProject
-               {CB89D905-C8BE-4027-B2D8-F96C245E9160} = {CB89D905-C8BE-4027-B2D8-F96C245E9160}
                {AEB182ED-7F5C-4F5A-BCE1-9A38E98579BA} = {AEB182ED-7F5C-4F5A-BCE1-9A38E98579BA}
+               {CB89D905-C8BE-4027-B2D8-F96C245E9160} = {CB89D905-C8BE-4027-B2D8-F96C245E9160}
        EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libgd", "src\webui\libgd\gd\libgd.vcproj", "{F5287CFB-0894-4169-B5B5-1AEE4F2FF585}"
        ProjectSection(ProjectDependencies) = postProject
-               {0D98A1CD-48E0-4F11-9151-B53497E1F7DA} = {0D98A1CD-48E0-4F11-9151-B53497E1F7DA}
-               {E7410EB4-3355-4C83-8E05-D2877581CDA1} = {E7410EB4-3355-4C83-8E05-D2877581CDA1}
-               {E9F4A68D-4BF2-45AD-BDD6-210AFF857661} = {E9F4A68D-4BF2-45AD-BDD6-210AFF857661}
                {55B7161B-683F-4E7A-96F6-277A1681D6C5} = {55B7161B-683F-4E7A-96F6-277A1681D6C5}
+               {E9F4A68D-4BF2-45AD-BDD6-210AFF857661} = {E9F4A68D-4BF2-45AD-BDD6-210AFF857661}
+               {E7410EB4-3355-4C83-8E05-D2877581CDA1} = {E7410EB4-3355-4C83-8E05-D2877581CDA1}
+               {0D98A1CD-48E0-4F11-9151-B53497E1F7DA} = {0D98A1CD-48E0-4F11-9151-B53497E1F7DA}
        EndProjectSection
 EndProject
 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "windows", "windows", "{69EC5B74-D466-422E-B8D1-1386B0421D54}"
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "nxlexer", "src\client\nxlexer\nxlexer.vcproj", "{F0FAC738-1BC6-46A5-A54A-8D7F2219302D}"
        ProjectSection(ProjectDependencies) = postProject
-               {8E5A517B-93AB-4EA8-BB53-AE6346756343} = {8E5A517B-93AB-4EA8-BB53-AE6346756343}
                {B1745870-F3ED-4ACB-B813-0C4F47EF0793} = {B1745870-F3ED-4ACB-B813-0C4F47EF0793}
+               {8E5A517B-93AB-4EA8-BB53-AE6346756343} = {8E5A517B-93AB-4EA8-BB53-AE6346756343}
        EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "scilexer", "src\client\scilexer\scilexer.vcproj", "{8E5A517B-93AB-4EA8-BB53-AE6346756343}"
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "nxuilib", "src\client\windows\nxuilib\nxuilib.vcproj", "{BECC966D-AFC8-48F6-97B1-2FE92062D7B4}"
        ProjectSection(ProjectDependencies) = postProject
-               {AEB182ED-7F5C-4F5A-BCE1-9A38E98579BA} = {AEB182ED-7F5C-4F5A-BCE1-9A38E98579BA}
                {3CB9B8C6-E6BF-4002-A61A-7A21FEADB532} = {3CB9B8C6-E6BF-4002-A61A-7A21FEADB532}
+               {AEB182ED-7F5C-4F5A-BCE1-9A38E98579BA} = {AEB182ED-7F5C-4F5A-BCE1-9A38E98579BA}
        EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "nxav", "src\client\windows\nxav\nxav.vcproj", "{23F22F68-D562-4E80-8267-9F1DD9398357}"
        ProjectSection(ProjectDependencies) = postProject
-               {AEB182ED-7F5C-4F5A-BCE1-9A38E98579BA} = {AEB182ED-7F5C-4F5A-BCE1-9A38E98579BA}
-               {3CB9B8C6-E6BF-4002-A61A-7A21FEADB532} = {3CB9B8C6-E6BF-4002-A61A-7A21FEADB532}
                {BECC966D-AFC8-48F6-97B1-2FE92062D7B4} = {BECC966D-AFC8-48F6-97B1-2FE92062D7B4}
+               {3CB9B8C6-E6BF-4002-A61A-7A21FEADB532} = {3CB9B8C6-E6BF-4002-A61A-7A21FEADB532}
+               {AEB182ED-7F5C-4F5A-BCE1-9A38E98579BA} = {AEB182ED-7F5C-4F5A-BCE1-9A38E98579BA}
        EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "nxnotify", "src\client\windows\nxnotify\nxnotify.vcproj", "{169A4446-A035-4CF7-8377-3C517ADF0C50}"
        ProjectSection(ProjectDependencies) = postProject
-               {AEB182ED-7F5C-4F5A-BCE1-9A38E98579BA} = {AEB182ED-7F5C-4F5A-BCE1-9A38E98579BA}
-               {3CB9B8C6-E6BF-4002-A61A-7A21FEADB532} = {3CB9B8C6-E6BF-4002-A61A-7A21FEADB532}
                {BECC966D-AFC8-48F6-97B1-2FE92062D7B4} = {BECC966D-AFC8-48F6-97B1-2FE92062D7B4}
+               {3CB9B8C6-E6BF-4002-A61A-7A21FEADB532} = {3CB9B8C6-E6BF-4002-A61A-7A21FEADB532}
+               {AEB182ED-7F5C-4F5A-BCE1-9A38E98579BA} = {AEB182ED-7F5C-4F5A-BCE1-9A38E98579BA}
        EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "nxcon", "src\client\windows\nxcon\nxcon.vcproj", "{956DD617-0939-4B25-B8D0-E10AA645064E}"
        ProjectSection(ProjectDependencies) = postProject
-               {0A5E80F3-485D-40C8-BE1E-9D7EE744DB8B} = {0A5E80F3-485D-40C8-BE1E-9D7EE744DB8B}
-               {AEB182ED-7F5C-4F5A-BCE1-9A38E98579BA} = {AEB182ED-7F5C-4F5A-BCE1-9A38E98579BA}
-               {7DC90EE4-E31C-4F12-8F1E-81F10E9099FC} = {7DC90EE4-E31C-4F12-8F1E-81F10E9099FC}
-               {3CB9B8C6-E6BF-4002-A61A-7A21FEADB532} = {3CB9B8C6-E6BF-4002-A61A-7A21FEADB532}
                {BECC966D-AFC8-48F6-97B1-2FE92062D7B4} = {BECC966D-AFC8-48F6-97B1-2FE92062D7B4}
+               {3CB9B8C6-E6BF-4002-A61A-7A21FEADB532} = {3CB9B8C6-E6BF-4002-A61A-7A21FEADB532}
+               {7DC90EE4-E31C-4F12-8F1E-81F10E9099FC} = {7DC90EE4-E31C-4F12-8F1E-81F10E9099FC}
+               {AEB182ED-7F5C-4F5A-BCE1-9A38E98579BA} = {AEB182ED-7F5C-4F5A-BCE1-9A38E98579BA}
+               {0A5E80F3-485D-40C8-BE1E-9D7EE744DB8B} = {0A5E80F3-485D-40C8-BE1E-9D7EE744DB8B}
        EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "nxlptest", "src\nxlptest\nxlptest.vcproj", "{1EA79FC6-F395-43DF-9E3C-2030CA05ED1D}"
        ProjectSection(ProjectDependencies) = postProject
-               {B1745870-F3ED-4ACB-B813-0C4F47EF0793} = {B1745870-F3ED-4ACB-B813-0C4F47EF0793}
                {64EFC0C2-C67B-41F6-851D-F11DAB27A60B} = {64EFC0C2-C67B-41F6-851D-F11DAB27A60B}
+               {B1745870-F3ED-4ACB-B813-0C4F47EF0793} = {B1745870-F3ED-4ACB-B813-0C4F47EF0793}
        EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "nxsqlite", "src\sqlite\nxsqlite.vcproj", "{87CAA25D-991E-45E1-BB69-337D45121F19}"
@@ -383,14 +383,14 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pgsql", "src\db\dbdrv\pgsql
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sqlite", "src\db\dbdrv\sqlite\sqlite.vcproj", "{AA18FD4D-7B01-4932-BA04-B0F54F001F66}"
        ProjectSection(ProjectDependencies) = postProject
-               {B1745870-F3ED-4ACB-B813-0C4F47EF0793} = {B1745870-F3ED-4ACB-B813-0C4F47EF0793}
                {87CAA25D-991E-45E1-BB69-337D45121F19} = {87CAA25D-991E-45E1-BB69-337D45121F19}
+               {B1745870-F3ED-4ACB-B813-0C4F47EF0793} = {B1745870-F3ED-4ACB-B813-0C4F47EF0793}
        EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "nxconfig", "src\server\tools\nxconfig\nxconfig.vcproj", "{A76CCCF5-D70B-4307-B84C-219289CEAA6D}"
        ProjectSection(ProjectDependencies) = postProject
-               {B1745870-F3ED-4ACB-B813-0C4F47EF0793} = {B1745870-F3ED-4ACB-B813-0C4F47EF0793}
-               {F3E29541-3A0E-45EC-8BEC-E193F2401622} = {F3E29541-3A0E-45EC-8BEC-E193F2401622}
+               {96EF0643-89FD-47CD-B82E-9F7D1DAF35EC} = {96EF0643-89FD-47CD-B82E-9F7D1DAF35EC}
+               {AEB182ED-7F5C-4F5A-BCE1-9A38E98579BA} = {AEB182ED-7F5C-4F5A-BCE1-9A38E98579BA}
        EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "nxcptest", "src\tools\nxcptest\nxcptest.vcproj", "{418E47B0-3E78-4820-A101-CA9C4439F9AB}"
@@ -407,9 +407,9 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libipfix", "src\flow_analyz
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "nxflowd", "src\flow_analyzer\nxflowd\nxflowd.vcproj", "{D7F709ED-7483-49F0-8B17-ABB705606FEA}"
        ProjectSection(ProjectDependencies) = postProject
-               {2DEF303B-5FEF-4F5E-87C4-FB7895058F59} = {2DEF303B-5FEF-4F5E-87C4-FB7895058F59}
-               {F3E29541-3A0E-45EC-8BEC-E193F2401622} = {F3E29541-3A0E-45EC-8BEC-E193F2401622}
                {B1745870-F3ED-4ACB-B813-0C4F47EF0793} = {B1745870-F3ED-4ACB-B813-0C4F47EF0793}
+               {F3E29541-3A0E-45EC-8BEC-E193F2401622} = {F3E29541-3A0E-45EC-8BEC-E193F2401622}
+               {2DEF303B-5FEF-4F5E-87C4-FB7895058F59} = {2DEF303B-5FEF-4F5E-87C4-FB7895058F59}
        EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "db2", "src\db\dbdrv\db2\db2.vcproj", "{297D9A45-B928-4470-91B5-0E07A20C2405}"
@@ -420,7 +420,7 @@ EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "nxap", "src\server\tools\nxap\nxap.vcproj", "{36749C31-C8C6-4DD2-A11C-E41ED86927C7}"
        ProjectSection(ProjectDependencies) = postProject
                {CB89D905-C8BE-4027-B2D8-F96C245E9160} = {CB89D905-C8BE-4027-B2D8-F96C245E9160}
-               {B1745870-F3ED-4ACB-B813-0C4F47EF0793} = {B1745870-F3ED-4ACB-B813-0C4F47EF0793}
+               {AEB182ED-7F5C-4F5A-BCE1-9A38E98579BA} = {AEB182ED-7F5C-4F5A-BCE1-9A38E98579BA}
        EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libtre", "src\libtre\libtre.vcproj", "{406AE5C7-343D-4C88-B8F3-84E46255B830}"
index 5772aeb..d5532a0 100644 (file)
@@ -333,7 +333,7 @@ int main(int argc, char *argv[])
       RegCloseKey(hKey);
    }
 #else
-   pszEnv = getenv(_T("NETXMSD_CONFIG"));
+   pszEnv = _tgetenv(_T("NETXMSD_CONFIG"));
    if (pszEnv != NULL)
       nx_strncpy(g_szConfigFile, pszEnv, MAX_PATH);
 #endif
index 6a47b48..0ab3ab6 100644 (file)
@@ -49,8 +49,8 @@ int main(int argc, char *argv[])
 #endif
    WORD wPort = AGENT_LISTEN_PORT;
    DWORD dwAddr, dwTimeout = 5000, dwConnTimeout = 30000, dwError;
-   char szSecret[MAX_SECRET_LENGTH] = "";
-   char szKeyFile[MAX_PATH] = DEFAULT_DATA_DIR DFILE_KEYS;
+   TCHAR szSecret[MAX_SECRET_LENGTH] = _T("");
+   TCHAR szKeyFile[MAX_PATH] = DEFAULT_DATA_DIR DFILE_KEYS;
    RSA *pServerKey = NULL;
 
    InitThreadLibrary();
@@ -62,30 +62,30 @@ int main(int argc, char *argv[])
       switch(ch)
       {
          case 'h':   // Display help and exit
-            printf("Usage: nxaction [<options>] <host> <action> [<action args>]\n"
-                   "Valid options are:\n"
-                   "   -a <auth>    : Authentication method. Valid methods are \"none\",\n"
-                   "                  \"plain\", \"md5\" and \"sha1\". Default is \"none\".\n"
+            _tprintf(_T("Usage: nxaction [<options>] <host> <action> [<action args>]\n")
+                     _T("Valid options are:\n")
+                     _T("   -a <auth>    : Authentication method. Valid methods are \"none\",\n")
+                     _T("                  \"plain\", \"md5\" and \"sha1\". Default is \"none\".\n")
 #ifdef _WITH_ENCRYPTION
-                   "   -e <policy>  : Set encryption policy. Possible values are:\n"
-                   "                    0 = Encryption disabled;\n"
-                   "                    1 = Encrypt connection only if agent requires encryption;\n"
-                   "                    2 = Encrypt connection if agent supports encryption;\n"
-                   "                    3 = Force encrypted connection;\n"
-                   "                  Default value is 1.\n"
+                     _T("   -e <policy>  : Set encryption policy. Possible values are:\n")
+                     _T("                    0 = Encryption disabled;\n")
+                     _T("                    1 = Encrypt connection only if agent requires encryption;\n")
+                     _T("                    2 = Encrypt connection if agent supports encryption;\n")
+                     _T("                    3 = Force encrypted connection;\n")
+                     _T("                  Default value is 1.\n")
 #endif
-                   "   -h           : Display help and exit.\n"
+                     _T("   -h           : Display help and exit.\n")
 #ifdef _WITH_ENCRYPTION
-                   "   -K <file>    : Specify server's key file\n"
-                   "                  (default is " DEFAULT_DATA_DIR DFILE_KEYS ").\n"
+                     _T("   -K <file>    : Specify server's key file\n")
+                     _T("                  (default is ") DEFAULT_DATA_DIR DFILE_KEYS _T(").\n")
 #endif
-                   "   -p <port>    : Specify agent's port number. Default is %d.\n"
-                   "   -q           : Quiet mode.\n"
-                   "   -s <secret>  : Specify shared secret for authentication.\n"
-                   "   -v           : Display version and exit.\n"
-                   "   -w <seconds> : Set command timeout (default is 5 seconds)\n"
-                   "   -W <seconds> : Set connection timeout (default is 30 seconds)\n"
-                   "\n", wPort);
+                     _T("   -p <port>    : Specify agent's port number. Default is %d.\n")
+                     _T("   -q           : Quiet mode.\n")
+                     _T("   -s <secret>  : Specify shared secret for authentication.\n")
+                     _T("   -v           : Display version and exit.\n")
+                     _T("   -w <seconds> : Set command timeout (default is 5 seconds)\n")
+                     _T("   -W <seconds> : Set connection timeout (default is 30 seconds)\n")
+                     _T("\n"), wPort);
             bStart = FALSE;
             break;
          case 'a':   // Auth method
@@ -99,7 +99,7 @@ int main(int argc, char *argv[])
                iAuthMethod = AUTH_SHA1_HASH;
             else
             {
-               printf("Invalid authentication method \"%s\"\n", optarg);
+               _tprintf(_T("Invalid authentication method \"%hs\"\n"), optarg);
                bStart = FALSE;
             }
             break;
@@ -107,7 +107,7 @@ int main(int argc, char *argv[])
             i = strtol(optarg, &eptr, 0);
             if ((*eptr != 0) || (i < 0) || (i > 65535))
             {
-               printf("Invalid port number \"%s\"\n", optarg);
+               _tprintf(_T("Invalid port number \"%hs\"\n"), optarg);
                bStart = FALSE;
             }
             else
@@ -119,17 +119,22 @@ int main(int argc, char *argv[])
             bVerbose = FALSE;
             break;
          case 's':   // Shared secret
-            nx_strncpy(szSecret, optarg, MAX_SECRET_LENGTH - 1);
+#ifdef UNICODE
+                               MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, optarg, -1, szSecret, MAX_SECRET_LENGTH);
+                               szSecret[MAX_SECRET_LENGTH - 1] = 0;
+#else
+            nx_strncpy(szSecret, optarg, MAX_SECRET_LENGTH);
+#endif
             break;
          case 'v':   // Print version and exit
-            printf("NetXMS ACTION command-line utility Version " NETXMS_VERSION_STRING "\n");
+            _tprintf(_T("NetXMS ACTION command-line utility Version ") NETXMS_VERSION_STRING _T("\n"));
             bStart = FALSE;
             break;
          case 'w':   // Command timeout
             i = strtol(optarg, &eptr, 0);
             if ((*eptr != 0) || (i < 1) || (i > 120))
             {
-               printf("Invalid timeout \"%s\"\n", optarg);
+               _tprintf(_T("Invalid timeout \"%hs\"\n"), optarg);
                bStart = FALSE;
             }
             else
@@ -141,7 +146,7 @@ int main(int argc, char *argv[])
             i = strtol(optarg, &eptr, 0);
             if ((*eptr != 0) || (i < 1) || (i > 120))
             {
-               printf("Invalid timeout \"%s\"\n", optarg);
+               _tprintf(_T("Invalid timeout \"%hs\"\n"), optarg);
                bStart = FALSE;
             }
             else
@@ -155,17 +160,22 @@ int main(int argc, char *argv[])
             if ((iEncryptionPolicy < 0) ||
                 (iEncryptionPolicy > 3))
             {
-               printf("Invalid encryption policy %d\n", iEncryptionPolicy);
+               _tprintf(_T("Invalid encryption policy %d\n"), iEncryptionPolicy);
                bStart = FALSE;
             }
             break;
          case 'K':
+#ifdef UNICODE
+                               MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, optarg, -1, szKeyFile, MAX_PATH);
+                               szKeyFile[MAX_PATH - 1] = 0;
+#else
             nx_strncpy(szKeyFile, optarg, MAX_PATH);
+#endif
             break;
 #else
          case 'e':
          case 'K':
-            printf("ERROR: This tool was compiled without encryption support\n");
+            _tprintf(_T("ERROR: This tool was compiled without encryption support\n"));
             bStart = FALSE;
             break;
 #endif
@@ -182,12 +192,12 @@ int main(int argc, char *argv[])
    {
       if (argc - optind < 2)
       {
-         printf("Required argument(s) missing.\nUse nxaction -h to get complete command line syntax.\n");
+         _tprintf(_T("Required argument(s) missing.\nUse nxaction -h to get complete command line syntax.\n"));
          bStart = FALSE;
       }
       else if ((iAuthMethod != AUTH_NONE) && (szSecret[0] == 0))
       {
-         printf("Shared secret not specified or empty\n");
+         _tprintf(_T("Shared secret not specified or empty\n"));
          bStart = FALSE;
       }
 
@@ -200,14 +210,14 @@ int main(int argc, char *argv[])
             pServerKey = LoadRSAKeys(szKeyFile);
             if (pServerKey == NULL)
             {
-               printf("Error loading RSA keys from \"%s\"\n", szKeyFile);
+               _tprintf(_T("Error loading RSA keys from \"%s\"\n"), szKeyFile);
                if (iEncryptionPolicy == ENCRYPTION_REQUIRED)
                   bStart = FALSE;
             }
          }
          else
          {
-            printf("Error initializing cryptografy module\n");
+            _tprintf(_T("Error initializing cryptografy module\n"));
             if (iEncryptionPolicy == ENCRYPTION_REQUIRED)
                bStart = FALSE;
          }
@@ -222,7 +232,7 @@ int main(int argc, char *argv[])
          // Initialize WinSock
 #ifdef _WIN32
          WSADATA wsaData;
-         WSAStartup(2, &wsaData);
+         WSAStartup(MAKEWORD(2, 2), &wsaData);
 #endif
 
          // Resolve hostname
@@ -237,7 +247,7 @@ int main(int argc, char *argv[])
          }
          if ((dwAddr == 0) || (dwAddr == INADDR_NONE))
          {
-            fprintf(stderr, "Invalid host name or address specified\n");
+            _tprintf(_T("Invalid host name or address specified\n"));
          }
          else
          {
@@ -250,20 +260,35 @@ int main(int argc, char *argv[])
             {
                DWORD dwError;
 
+#ifdef UNICODE
+                                       WCHAR action[256], *args[256];
+                                       int i, k;
+
+                                       MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, argv[optind + 1], -1, action, 256);
+                                       action[255] = 0;
+                                       
+                                       int count = min(argc - optind - 2, 256);
+                                       for(i = 0, k = optind + 2; i < count; i++, k++)
+                                               args[i] = WideStringFromMBString(argv[k]);
+               dwError = conn.ExecAction(action, count, args);
+                                       for(i = 0; i < count; i++)
+                                               free(args[i]);
+#else
                dwError = conn.ExecAction(argv[optind + 1], argc - optind - 2, &argv[optind + 2]);
+#endif
                if (bVerbose)
                {
                   if (dwError == ERR_SUCCESS)
-                     printf("Action executed successfully\n");
+                     _tprintf(_T("Action executed successfully\n"));
                   else
-                     printf("%d: %s\n", dwError, AgentErrorCodeToText(dwError));
+                     _tprintf(_T("%d: %s\n"), dwError, AgentErrorCodeToText(dwError));
                }
                iExitCode = (dwError == ERR_SUCCESS) ? 0 : 1;
                conn.disconnect();
             }
             else
             {
-               printf("%d: %s\n", dwError, AgentErrorCodeToText(dwError));
+               _tprintf(_T("%d: %s\n"), dwError, AgentErrorCodeToText(dwError));
                iExitCode = 2;
             }
          }
index 96bef35..6e63c01 100644 (file)
@@ -23,7 +23,7 @@
                        OutputDirectory="$(SolutionDir)$(ConfigurationName)"\r
                        IntermediateDirectory="$(ConfigurationName)"\r
                        ConfigurationType="1"\r
-                       CharacterSet="2"\r
+                       CharacterSet="1"\r
                        >\r
                        <Tool\r
                                Name="VCPreBuildEventTool"\r
                        />\r
                </Configuration>\r
                <Configuration\r
-                       Name="Release|Win32"\r
-                       OutputDirectory="$(SolutionDir)$(ConfigurationName)"\r
-                       IntermediateDirectory="$(ConfigurationName)"\r
+                       Name="Debug|x64"\r
+                       OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"\r
+                       IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"\r
                        ConfigurationType="1"\r
-                       CharacterSet="2"\r
-                       WholeProgramOptimization="1"\r
+                       CharacterSet="1"\r
                        >\r
                        <Tool\r
                                Name="VCPreBuildEventTool"\r
                        />\r
                        <Tool\r
                                Name="VCMIDLTool"\r
+                               TargetEnvironment="3"\r
                        />\r
                        <Tool\r
                                Name="VCCLCompilerTool"\r
+                               Optimization="0"\r
                                AdditionalIncludeDirectories="..\..\..\..\include;..\..\include"\r
-                               PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"\r
-                               RuntimeLibrary="2"\r
+                               PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"\r
+                               MinimalRebuild="true"\r
+                               BasicRuntimeChecks="3"\r
+                               RuntimeLibrary="3"\r
                                UsePrecompiledHeader="0"\r
                                WarningLevel="3"\r
                                Detect64BitPortabilityProblems="false"\r
                        <Tool\r
                                Name="VCLinkerTool"\r
                                AdditionalDependencies="ws2_32.lib"\r
-                               LinkIncremental="1"\r
+                               LinkIncremental="2"\r
                                GenerateDebugInformation="true"\r
                                SubSystem="1"\r
-                               OptimizeReferences="2"\r
-                               EnableCOMDATFolding="2"\r
-                               TargetMachine="1"\r
+                               TargetMachine="17"\r
                        />\r
                        <Tool\r
                                Name="VCALinkTool"\r
                        />\r
                </Configuration>\r
                <Configuration\r
-                       Name="Debug|x64"\r
-                       OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"\r
-                       IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"\r
+                       Name="Release|Win32"\r
+                       OutputDirectory="$(SolutionDir)$(ConfigurationName)"\r
+                       IntermediateDirectory="$(ConfigurationName)"\r
                        ConfigurationType="1"\r
-                       CharacterSet="2"\r
+                       CharacterSet="1"\r
+                       WholeProgramOptimization="1"\r
                        >\r
                        <Tool\r
                                Name="VCPreBuildEventTool"\r
                        />\r
                        <Tool\r
                                Name="VCMIDLTool"\r
-                               TargetEnvironment="3"\r
                        />\r
                        <Tool\r
                                Name="VCCLCompilerTool"\r
-                               Optimization="0"\r
                                AdditionalIncludeDirectories="..\..\..\..\include;..\..\include"\r
-                               PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"\r
-                               MinimalRebuild="true"\r
-                               BasicRuntimeChecks="3"\r
-                               RuntimeLibrary="3"\r
+                               PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"\r
+                               RuntimeLibrary="2"\r
                                UsePrecompiledHeader="0"\r
                                WarningLevel="3"\r
                                Detect64BitPortabilityProblems="false"\r
                        <Tool\r
                                Name="VCLinkerTool"\r
                                AdditionalDependencies="ws2_32.lib"\r
-                               LinkIncremental="2"\r
+                               LinkIncremental="1"\r
                                GenerateDebugInformation="true"\r
                                SubSystem="1"\r
-                               TargetMachine="17"\r
+                               OptimizeReferences="2"\r
+                               EnableCOMDATFolding="2"\r
+                               TargetMachine="1"\r
                        />\r
                        <Tool\r
                                Name="VCALinkTool"\r
                        OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"\r
                        IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"\r
                        ConfigurationType="1"\r
-                       CharacterSet="2"\r
+                       CharacterSet="1"\r
                        WholeProgramOptimization="1"\r
                        >\r
                        <Tool\r
index 94c2f94..304f3b9 100644 (file)
@@ -41,21 +41,21 @@ static int GetPolicyInventory(AgentConnection &conn)
        DWORD rcc = conn.getPolicyInventory(&ap);\r
        if (rcc == ERR_SUCCESS)\r
        {\r
-               char buffer[64];\r
+               TCHAR buffer[64];\r
                uuid_t guid;\r
 \r
-               printf("GUID                                 Type Server\n"\r
-                      "----------------------------------------------------------\n");\r
+               _tprintf(_T("GUID                                 Type Server\n")\r
+                        _T("----------------------------------------------------------\n"));\r
                for(int i = 0; i < ap->getSize(); i++)\r
                {\r
                        ap->getGuid(i, guid);\r
-                       printf("%-16s %-4d %s\n", uuid_to_string(guid, buffer), ap->getType(i), ap->getServer(i));\r
+                       _tprintf(_T("%-16s %-4d %s\n"), uuid_to_string(guid, buffer), ap->getType(i), ap->getServer(i));\r
                }\r
                delete ap;\r
        }\r
        else\r
        {\r
-      printf("%d: %s\n", rcc, AgentErrorCodeToText(rcc));\r
+      _tprintf(_T("%d: %s\n"), rcc, AgentErrorCodeToText(rcc));\r
        }\r
        return (rcc == ERR_SUCCESS) ? 0 : 1;\r
 }\r
@@ -70,11 +70,11 @@ static int UninstallPolicy(AgentConnection &conn, uuid_t guid)
        DWORD rcc = conn.uninstallPolicy(guid);\r
        if (rcc == ERR_SUCCESS)\r
        {\r
-               printf("Policy successfully uninstalled from agent\n");\r
+               _tprintf(_T("Policy successfully uninstalled from agent\n"));\r
        }\r
        else\r
        {\r
-      printf("%d: %s\n", rcc, AgentErrorCodeToText(rcc));\r
+      _tprintf(_T("%d: %s\n"), rcc, AgentErrorCodeToText(rcc));\r
        }\r
        return (rcc == ERR_SUCCESS) ? 0 : 1;\r
 }\r
@@ -97,8 +97,8 @@ int main(int argc, char *argv[])
 #endif\r
    WORD wPort = AGENT_LISTEN_PORT;\r
    DWORD dwAddr, dwTimeout = 5000, dwConnTimeout = 30000, dwError;\r
-   char szSecret[MAX_SECRET_LENGTH] = "";\r
-   char szKeyFile[MAX_PATH] = DEFAULT_DATA_DIR DFILE_KEYS;\r
+   TCHAR szSecret[MAX_SECRET_LENGTH] = _T("");\r
+   TCHAR szKeyFile[MAX_PATH] = DEFAULT_DATA_DIR DFILE_KEYS;\r
    RSA *pServerKey = NULL;\r
        uuid_t guid;\r
 \r
@@ -111,31 +111,31 @@ int main(int argc, char *argv[])
       switch(ch)\r
       {\r
          case 'h':   // Display help and exit\r
-            printf("Usage: nxap [<options>] -l <host>\n"\r
-                                      "   or: nxap [<options>] -u <guid> <host>\n"\r
-                   "Valid options are:\n"\r
-                   "   -a <auth>    : Authentication method. Valid methods are \"none\",\n"\r
-                   "                  \"plain\", \"md5\" and \"sha1\". Default is \"none\".\n"\r
+            _tprintf(_T("Usage: nxap [<options>] -l <host>\n")\r
+                                        _T("   or: nxap [<options>] -u <guid> <host>\n")\r
+                     _T("Valid options are:\n")\r
+                     _T("   -a <auth>    : Authentication method. Valid methods are \"none\",\n")\r
+                     _T("                  \"plain\", \"md5\" and \"sha1\". Default is \"none\".\n")\r
 #ifdef _WITH_ENCRYPTION\r
-                   "   -e <policy>  : Set encryption policy. Possible values are:\n"\r
-                   "                    0 = Encryption disabled;\n"\r
-                   "                    1 = Encrypt connection only if agent requires encryption;\n"\r
-                   "                    2 = Encrypt connection if agent supports encryption;\n"\r
-                   "                    3 = Force encrypted connection;\n"\r
-                   "                  Default value is 1.\n"\r
+                     _T("   -e <policy>  : Set encryption policy. Possible values are:\n")\r
+                     _T("                    0 = Encryption disabled;\n")\r
+                     _T("                    1 = Encrypt connection only if agent requires encryption;\n")\r
+                     _T("                    2 = Encrypt connection if agent supports encryption;\n")\r
+                     _T("                    3 = Force encrypted connection;\n")\r
+                     _T("                  Default value is 1.\n")\r
 #endif\r
-                   "   -h           : Display help and exit.\n"\r
+                     _T("   -h           : Display help and exit.\n")\r
 #ifdef _WITH_ENCRYPTION\r
-                   "   -K <file>    : Specify server's key file\n"\r
-                   "                  (default is " DEFAULT_DATA_DIR DFILE_KEYS ").\n"\r
+                     _T("   -K <file>    : Specify server's key file\n")\r
+                     _T("                  (default is ") DEFAULT_DATA_DIR DFILE_KEYS _T(").\n")\r
 #endif\r
-                   "   -p <port>    : Specify agent's port number. Default is %d.\n"\r
-                   "   -q           : Quiet mode.\n"\r
-                   "   -s <secret>  : Specify shared secret for authentication.\n"\r
-                   "   -v           : Display version and exit.\n"\r
-                   "   -w <seconds> : Set command timeout (default is 5 seconds)\n"\r
-                   "   -W <seconds> : Set connection timeout (default is 30 seconds)\n"\r
-                   "\n", wPort);\r
+                     _T("   -p <port>    : Specify agent's port number. Default is %d.\n")\r
+                     _T("   -q           : Quiet mode.\n")\r
+                     _T("   -s <secret>  : Specify shared secret for authentication.\n")\r
+                     _T("   -v           : Display version and exit.\n")\r
+                     _T("   -w <seconds> : Set command timeout (default is 5 seconds)\n")\r
+                     _T("   -W <seconds> : Set connection timeout (default is 30 seconds)\n")\r
+                     _T("\n"), wPort);\r
                                bStart = FALSE;\r
             break;\r
          case 'a':   // Auth method\r
@@ -149,7 +149,7 @@ int main(int argc, char *argv[])
                iAuthMethod = AUTH_SHA1_HASH;\r
             else\r
             {\r
-               printf("Invalid authentication method \"%s\"\n", optarg);\r
+               _tprintf(_T("Invalid authentication method \"%hs\"\n"), optarg);\r
                bStart = FALSE;\r
             }\r
             break;\r
@@ -157,7 +157,7 @@ int main(int argc, char *argv[])
             i = strtol(optarg, &eptr, 0);\r
             if ((*eptr != 0) || (i < 0) || (i > 65535))\r
             {\r
-               printf("Invalid port number \"%s\"\n", optarg);\r
+               _tprintf(_T("Invalid port number \"%hs\"\n"), optarg);\r
                bStart = FALSE;\r
             }\r
             else\r
@@ -169,17 +169,22 @@ int main(int argc, char *argv[])
             bVerbose = FALSE;\r
             break;\r
          case 's':   // Shared secret\r
-            nx_strncpy(szSecret, optarg, MAX_SECRET_LENGTH - 1);\r
+#ifdef UNICODE\r
+                               MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, optarg, -1, szSecret, MAX_SECRET_LENGTH);\r
+                               szSecret[MAX_SECRET_LENGTH - 1] = 0;\r
+#else\r
+            nx_strncpy(szSecret, optarg, MAX_SECRET_LENGTH);\r
+#endif\r
             break;\r
          case 'v':   // Print version and exit\r
-            printf("NetXMS Agent Policy Management Tool Version " NETXMS_VERSION_STRING "\n");\r
+            _tprintf(_T("NetXMS Agent Policy Management Tool Version ") NETXMS_VERSION_STRING _T("\n"));\r
             bStart = FALSE;\r
             break;\r
          case 'w':   // Command timeout\r
             i = strtol(optarg, &eptr, 0);\r
             if ((*eptr != 0) || (i < 1) || (i > 120))\r
             {\r
-               printf("Invalid timeout \"%s\"\n", optarg);\r
+               _tprintf(_T("Invalid timeout \"%hs\"\n"), optarg);\r
                bStart = FALSE;\r
             }\r
             else\r
@@ -191,7 +196,7 @@ int main(int argc, char *argv[])
             i = strtol(optarg, &eptr, 0);\r
             if ((*eptr != 0) || (i < 1) || (i > 120))\r
             {\r
-               printf("Invalid timeout \"%s\"\n", optarg);\r
+               _tprintf(_T("Invalid timeout \"%hs\"\n"), optarg);\r
                bStart = FALSE;\r
             }\r
             else\r
@@ -205,17 +210,22 @@ int main(int argc, char *argv[])
             if ((iEncryptionPolicy < 0) ||\r
                 (iEncryptionPolicy > 3))\r
             {\r
-               printf("Invalid encryption policy %d\n", iEncryptionPolicy);\r
+               _tprintf(_T("Invalid encryption policy %d\n"), iEncryptionPolicy);\r
                bStart = FALSE;\r
             }\r
             break;\r
          case 'K':\r
+#ifdef UNICODE\r
+                               MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, optarg, -1, szKeyFile, MAX_PATH);\r
+                               szKeyFile[MAX_PATH - 1] = 0;\r
+#else\r
             nx_strncpy(szKeyFile, optarg, MAX_PATH);\r
+#endif\r
             break;\r
 #else\r
          case 'e':\r
          case 'K':\r
-            printf("ERROR: This tool was compiled without encryption support\n");\r
+            _tprintf(_T("ERROR: This tool was compiled without encryption support\n"));\r
             bStart = FALSE;\r
             break;\r
 #endif\r
@@ -224,7 +234,14 @@ int main(int argc, char *argv[])
                                break;\r
                        case 'u':       // Uninstall policy from agent\r
                                action = 1;\r
+#ifdef UNICODE\r
+                               WCHAR wguid[256];\r
+                               MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, optarg, -1, wguid, 256);\r
+                               wguid[255] = 0;\r
+                               uuid_parse(wguid, guid);\r
+#else\r
                                uuid_parse(optarg, guid);\r
+#endif\r
                                break;\r
          case '?':\r
             bStart = FALSE;\r
@@ -237,7 +254,7 @@ int main(int argc, char *argv[])
    // Check parameter correctness\r
        if (action == -1)\r
        {\r
-               printf("ERROR: You must specify either -l or -u option\n");\r
+               _tprintf(_T("ERROR: You must specify either -l or -u option\n"));\r
                bStart = FALSE;\r
        }\r
 \r
@@ -245,12 +262,12 @@ int main(int argc, char *argv[])
    {\r
       if (argc - optind < 1)\r
       {\r
-         printf("Required argument(s) missing.\nUse nxap -h to get complete command line syntax.\n");\r
+         _tprintf(_T("Required argument(s) missing.\nUse nxap -h to get complete command line syntax.\n"));\r
          bStart = FALSE;\r
       }\r
       else if ((iAuthMethod != AUTH_NONE) && (szSecret[0] == 0))\r
       {\r
-         printf("Shared secret not specified or empty\n");\r
+         _tprintf(_T("Shared secret not specified or empty\n"));\r
          bStart = FALSE;\r
       }\r
 \r
@@ -263,14 +280,14 @@ int main(int argc, char *argv[])
             pServerKey = LoadRSAKeys(szKeyFile);\r
             if (pServerKey == NULL)\r
             {\r
-               printf("Error loading RSA keys from \"%s\"\n", szKeyFile);\r
+               _tprintf(_T("Error loading RSA keys from \"%s\"\n"), szKeyFile);\r
                if (iEncryptionPolicy == ENCRYPTION_REQUIRED)\r
                   bStart = FALSE;\r
             }\r
          }\r
          else\r
          {\r
-            printf("Error initializing cryptografy module\n");\r
+            _tprintf(_T("Error initializing cryptografy module\n"));\r
             if (iEncryptionPolicy == ENCRYPTION_REQUIRED)\r
                bStart = FALSE;\r
          }\r
@@ -300,7 +317,7 @@ int main(int argc, char *argv[])
          }\r
          if ((dwAddr == 0) || (dwAddr == INADDR_NONE))\r
          {\r
-            fprintf(stderr, "Invalid host name or address specified\n");\r
+            _tprintf(_T("Invalid host name or address specified\n"));\r
          }\r
          else\r
          {\r
@@ -323,7 +340,7 @@ int main(int argc, char *argv[])
             }\r
             else\r
             {\r
-               printf("%d: %s\n", dwError, AgentErrorCodeToText(dwError));\r
+               _tprintf(_T("%d: %s\n"), dwError, AgentErrorCodeToText(dwError));\r
                iExitCode = 2;\r
             }\r
          }\r
index 3c81146..21196e4 100644 (file)
@@ -20,7 +20,7 @@
                        OutputDirectory="$(SolutionDir)$(ConfigurationName)"\r
                        IntermediateDirectory="$(ConfigurationName)"\r
                        ConfigurationType="1"\r
-                       CharacterSet="2"\r
+                       CharacterSet="1"\r
                        >\r
                        <Tool\r
                                Name="VCPreBuildEventTool"\r
@@ -97,7 +97,7 @@
                        OutputDirectory="$(SolutionDir)$(ConfigurationName)"\r
                        IntermediateDirectory="$(ConfigurationName)"\r
                        ConfigurationType="1"\r
-                       CharacterSet="2"\r
+                       CharacterSet="1"\r
                        WholeProgramOptimization="1"\r
                        >\r
                        <Tool\r
index 7c98d22..a9634e5 100644 (file)
@@ -102,15 +102,15 @@ void CConfigWizard::DefaultConfig()
    {
       static NX_CFG_TEMPLATE cfgTemplate[] =
       {
-         { "DBDriver", CT_STRING, 0, 0, MAX_PATH, 0, NULL },
-         { "DBDrvParams", CT_STRING, 0, 0, MAX_PATH, 0, NULL },
-         { "DBLogin", CT_STRING, 0, 0, MAX_DB_LOGIN, 0, NULL },
-         { "DBName", CT_STRING, 0, 0, MAX_DB_NAME, 0, NULL },
-         { "DBPassword", CT_STRING, 0, 0, MAX_DB_PASSWORD, 0, NULL },
-         { "DBServer", CT_STRING, 0, 0, MAX_PATH, 0, NULL },
-         { "LogFailedSQLQueries", CT_BOOLEAN, 0, 0, 1, 0, NULL },
-         { "LogFile", CT_STRING, 0, 0, MAX_PATH, 0, NULL },
-         { "", CT_END_OF_LIST, 0, 0, 0, 0, NULL }
+         { _T("DBDriver"), CT_STRING, 0, 0, MAX_PATH, 0, NULL },
+         { _T("DBDrvParams"), CT_STRING, 0, 0, MAX_PATH, 0, NULL },
+         { _T("DBLogin"), CT_STRING, 0, 0, MAX_DB_LOGIN, 0, NULL },
+         { _T("DBName"), CT_STRING, 0, 0, MAX_DB_NAME, 0, NULL },
+         { _T("DBPassword"), CT_STRING, 0, 0, MAX_DB_PASSWORD, 0, NULL },
+         { _T("DBServer"), CT_STRING, 0, 0, MAX_PATH, 0, NULL },
+         { _T("LogFailedSQLQueries"), CT_BOOLEAN, 0, 0, 1, 0, NULL },
+         { _T("LogFile"), CT_STRING, 0, 0, MAX_PATH, 0, NULL },
+         { _T(""), CT_END_OF_LIST, 0, 0, 0, 0, NULL }
       };
       DWORD dwFlags;
 
index 1a0155d..56d7763 100644 (file)
@@ -90,11 +90,16 @@ BOOL ExecSQLBatch(DB_HANDLE hConn, TCHAR *pszFile)
          pNext = FindEndOfQuery(pQuery, pBatch + dwSize);
          if (!IsEmptyQuery((char *)pQuery))
          {
+#ifdef UNICODE
+                               WCHAR *wquery = WideStringFromMBString((char *)pQuery);
+            bResult = DBQuery(hConn, wquery);
+                               free(wquery);
+#else
             bResult = DBQuery(hConn, (char *)pQuery);
+#endif
             if (!bResult)
             {
-               _sntprintf(g_szWizardErrorText, MAX_ERROR_TEXT,
-                          _T("SQL query failed:\n%s"), pQuery);
+               _sntprintf(g_szWizardErrorText, MAX_ERROR_TEXT, _T("SQL query failed:\n%hs"), pQuery);
                break;
             }
          }
@@ -103,8 +108,7 @@ BOOL ExecSQLBatch(DB_HANDLE hConn, TCHAR *pszFile)
    }
    else
    {
-      _sntprintf(g_szWizardErrorText, MAX_ERROR_TEXT,
-                 _T("Cannot load SQL command file %s"), pszFile);
+      _sntprintf(g_szWizardErrorText, MAX_ERROR_TEXT, _T("Cannot load SQL command file %s"), pszFile);
    }
 
    return bResult;
index 7d71726..dc20455 100644 (file)
@@ -62,7 +62,7 @@ BOOL CWinSrvPage::OnInitDialog()
    EnableDlgItem(this, IDC_EDIT_PASSWD1, FALSE);
    EnableDlgItem(this, IDC_EDIT_PASSWD2, FALSE);
        
-   if (strcmp(pc->m_szDBLogin, _T("*")) ||
+   if (_tcscmp(pc->m_szDBLogin, _T("*")) ||
        (pc->m_iDBEngine != DB_ENGINE_MSSQL))
    {
       ::ShowWindow(::GetDlgItem(m_hWnd, IDC_ICON_WARNING), SW_HIDE);
@@ -93,7 +93,7 @@ LRESULT CWinSrvPage::OnWizardNext()
       GetDlgItemText(IDC_EDIT_LOGIN, pc->m_szServiceLogin, MAX_DB_STRING);
       GetDlgItemText(IDC_EDIT_PASSWD1, szPasswd1, MAX_DB_STRING);
       GetDlgItemText(IDC_EDIT_PASSWD2, szPasswd2, MAX_DB_STRING);
-      if (!strcmp(szPasswd1, szPasswd2))
+      if (!_tcscmp(szPasswd1, szPasswd2))
       {
          _tcscpy(pc->m_szServicePassword, szPasswd1);
       }
@@ -121,7 +121,7 @@ void CWinSrvPage::OnRadioSystem()
    EnableDlgItem(this, IDC_EDIT_PASSWD1, FALSE);
    EnableDlgItem(this, IDC_EDIT_PASSWD2, FALSE);
 
-   if ((!strcmp(pc->m_szDBLogin, _T("*"))) &&
+   if ((!_tcscmp(pc->m_szDBLogin, _T("*"))) &&
        (pc->m_iDBEngine == DB_ENGINE_MSSQL))
    {
       ::ShowWindow(::GetDlgItem(m_hWnd, IDC_ICON_WARNING), SW_SHOW);
@@ -149,7 +149,7 @@ BOOL CWinSrvPage::OnSetActive()
    WIZARD_CFG_INFO *pc = &((CConfigWizard *)GetParent())->m_cfg;
    BOOL bShow;
 
-   bShow = ((!strcmp(pc->m_szDBLogin, _T("*"))) && (pc->m_iDBEngine == DB_ENGINE_MSSQL));
+   bShow = ((!_tcscmp(pc->m_szDBLogin, _T("*"))) && (pc->m_iDBEngine == DB_ENGINE_MSSQL));
    ::ShowWindow(::GetDlgItem(m_hWnd, IDC_ICON_WARNING), bShow ? SW_SHOW : SW_HIDE);
    ::ShowWindow(::GetDlgItem(m_hWnd, IDC_STATIC_WARNING), bShow ? SW_SHOW : SW_HIDE);
        
index 9b462e4..f09c6b2 100644 (file)
@@ -52,7 +52,7 @@ static BOOL InstallEventSource(TCHAR *pszPath)
    DWORD dwTypes = EVENTLOG_ERROR_TYPE | EVENTLOG_WARNING_TYPE | EVENTLOG_INFORMATION_TYPE;
 
    if (ERROR_SUCCESS != RegCreateKeyEx(HKEY_LOCAL_MACHINE,
-         "System\\CurrentControlSet\\Services\\EventLog\\System\\" CORE_EVENT_SOURCE,
+         _T("System\\CurrentControlSet\\Services\\EventLog\\System\\") CORE_EVENT_SOURCE,
          0, NULL, REG_OPTION_NON_VOLATILE, KEY_SET_VALUE, NULL, &hKey, NULL))
    {
       _sntprintf(g_szWizardErrorText, MAX_ERROR_TEXT, 
@@ -199,7 +199,7 @@ static BOOL WriteConfigInt(DB_HANDLE hConn, TCHAR *pszVar, int iValue,
 {
    TCHAR szBuffer[64];
 
-   _stprintf(szBuffer, _T("%d"), iValue);
+   _sntprintf(szBuffer, 64, _T("%d"), iValue);
    return WriteConfigStr(hConn, pszVar, szBuffer, bIsVisible, bNeedRestart);
 }
 
@@ -213,7 +213,7 @@ static BOOL WriteConfigULong(DB_HANDLE hConn, TCHAR *pszVar, DWORD dwValue,
 {
    TCHAR szBuffer[64];
 
-   _stprintf(szBuffer, _T("%u"), dwValue);
+   _sntprintf(szBuffer, 64, _T("%u"), dwValue);
    return WriteConfigStr(hConn, pszVar, szBuffer, bIsVisible, bNeedRestart);
 }
 
@@ -234,29 +234,29 @@ static BOOL CreateConfigFile(WIZARD_CFG_INFO *pc)
    if (pf != NULL)
    {
       t= time(NULL);
-      fprintf(pf, _T("#\n# NetXMS Server configuration file\n")
+      _ftprintf(pf, _T("#\n# NetXMS Server configuration file\n")
                   _T("# Created by NetXMS Server configuration wizard at %s#\n\n"),
               _tctime(&t));
-      fprintf(pf, _T("LogFile = %s\n"), pc->m_bLogToSyslog ? _T("{syslog}") : pc->m_szLogFile);
-      fprintf(pf, _T("DBDriver = %s\n"), pc->m_szDBDriver);
+      _ftprintf(pf, _T("LogFile = %s\n"), pc->m_bLogToSyslog ? _T("{syslog}") : pc->m_szLogFile);
+      _ftprintf(pf, _T("DBDriver = %s\n"), pc->m_szDBDriver);
       if (pc->m_szDBDrvParams[0] != 0)
-         fprintf(pf, _T("DBDrvParams = %s\n"), pc->m_szDBDrvParams);
+         _ftprintf(pf, _T("DBDrvParams = %s\n"), pc->m_szDBDrvParams);
       if (!_tcsicmp(pc->m_szDBDriver, _T("sqlite.ddr")))
       {
-         fprintf(pf, _T("DBName = %s\\database\\%s\n"), pc->m_szInstallDir, pc->m_szDBName);
+         _ftprintf(pf, _T("DBName = %s\\database\\%s\n"), pc->m_szInstallDir, pc->m_szDBName);
       }
       else
       {
          if (pc->m_szDBServer[0] != 0)
-            fprintf(pf, _T("DBServer = %s\n"), pc->m_szDBServer);
+            _ftprintf(pf, _T("DBServer = %s\n"), pc->m_szDBServer);
          if ((pc->m_szDBName[0] != 0) && (_tcsicmp(pc->m_szDBDriver, _T("odbc.ddr"))))
-            fprintf(pf, _T("DBName = %s\n"), pc->m_szDBName);
+            _ftprintf(pf, _T("DBName = %s\n"), pc->m_szDBName);
          if (pc->m_szDBLogin[0] != 0)
-            fprintf(pf, _T("DBLogin = %s\n"), pc->m_szDBLogin);
+            _ftprintf(pf, _T("DBLogin = %s\n"), pc->m_szDBLogin);
          if (pc->m_szDBPassword[0] != 0)
-            fprintf(pf, _T("DBPassword = %s\n"), pc->m_szDBPassword);
+            _ftprintf(pf, _T("DBPassword = %s\n"), pc->m_szDBPassword);
       }
-      fprintf(pf, _T("LogFailedSQLQueries = %s\n"), pc->m_bLogFailedSQLQueries ? _T("yes") : _T("no"));
+      _ftprintf(pf, _T("LogFailedSQLQueries = %s\n"), pc->m_bLogFailedSQLQueries ? _T("yes") : _T("no"));
       fclose(pf);
       bResult = TRUE;
    }
@@ -279,16 +279,16 @@ static BOOL CreateDBMySQL(WIZARD_CFG_INFO *pc, DB_HANDLE hConn)
    TCHAR szQuery[256];
    BOOL bResult;
 
-   _stprintf(szQuery, _T("CREATE DATABASE %s"), pc->m_szDBName);
+   _sntprintf(szQuery, 256, _T("CREATE DATABASE %s"), pc->m_szDBName);
    bResult = DBQueryEx(hConn, szQuery);
 
    if (bResult)
    {
-      _stprintf(szQuery, _T("GRANT ALL ON %s.* TO %s IDENTIFIED BY '%s'"),
+      _sntprintf(szQuery, 256, _T("GRANT ALL ON %s.* TO %s IDENTIFIED BY '%s'"),
                 pc->m_szDBName, pc->m_szDBLogin, pc->m_szDBPassword);
       bResult = DBQueryEx(hConn, szQuery);
 
-      _stprintf(szQuery, _T("GRANT ALL ON %s.* TO %s@localhost IDENTIFIED BY '%s'"),
+      _sntprintf(szQuery, 256, _T("GRANT ALL ON %s.* TO %s@localhost IDENTIFIED BY '%s'"),
                 pc->m_szDBName, pc->m_szDBLogin, pc->m_szDBPassword);
       bResult = DBQueryEx(hConn, szQuery);
    }
@@ -308,19 +308,19 @@ static BOOL CreateDBPostgreSQL(WIZARD_CFG_INFO *pc, DB_HANDLE hConn)
    TCHAR szQuery[256];
    BOOL bResult;
 
-   _stprintf(szQuery, _T("CREATE DATABASE %s"), pc->m_szDBName);
+   _sntprintf(szQuery, 256, _T("CREATE DATABASE %s"), pc->m_szDBName);
    bResult = DBQueryEx(hConn, szQuery);
 
    if (bResult)
    {
-      _stprintf(szQuery, _T("CREATE USER %s WITH PASSWORD '%s'"),
+      _sntprintf(szQuery, 256, _T("CREATE USER %s WITH PASSWORD '%s'"),
                 pc->m_szDBLogin, pc->m_szDBPassword);
       bResult = DBQueryEx(hConn, szQuery);
    }
 
    if (bResult)
    {
-      _stprintf(szQuery, _T("GRANT ALL PRIVILEGES ON DATABASE %s TO %s"),
+      _sntprintf(szQuery, 256, _T("GRANT ALL PRIVILEGES ON DATABASE %s TO %s"),
                 pc->m_szDBName, pc->m_szDBLogin);
       bResult = DBQueryEx(hConn, szQuery);
    }
@@ -341,19 +341,19 @@ static BOOL CreateDBMSSQL(WIZARD_CFG_INFO *pc, DB_HANDLE hConn)
    bResult = DBQueryEx(hConn, _T("USE master"));
    if (bResult)
    {
-      _stprintf(szQuery, _T("CREATE DATABASE %s"), pc->m_szDBName);
+      _sntprintf(szQuery, 512, _T("CREATE DATABASE %s"), pc->m_szDBName);
       bResult = DBQueryEx(hConn, szQuery);
    }
 
    if (bResult)
    {
-      _stprintf(szQuery, _T("USE %s"), pc->m_szDBName);
+      _sntprintf(szQuery, 512, _T("USE %s"), pc->m_szDBName);
       bResult = DBQueryEx(hConn, szQuery);
    }
 
    if (bResult)
    {
-      if (!strcmp(pc->m_szDBLogin, _T("*")))
+      if (!_tcscmp(pc->m_szDBLogin, _T("*")))
       {
          // Use Windows authentication
          pszLogin = pc->m_szServiceLogin;
@@ -375,7 +375,7 @@ static BOOL CreateDBMSSQL(WIZARD_CFG_INFO *pc, DB_HANDLE hConn)
 
    if (bResult)
    {
-      _stprintf(szQuery, _T("GRANT ALL TO %s"), pszLogin);
+      _sntprintf(szQuery, 512, _T("GRANT ALL TO %s"), pszLogin);
       bResult = DBQueryEx(hConn, szQuery);
    }
 
@@ -393,7 +393,7 @@ static BOOL CreateSQLiteDB(WIZARD_CFG_INFO *pc)
    DB_HANDLE hConn;
    BOOL bResult = FALSE;
 
-   _stprintf(szBaseDir, _T("%s\\database"), pc->m_szInstallDir);
+   _sntprintf(szBaseDir, MAX_PATH, _T("%s\\database"), pc->m_szInstallDir);
    SetCurrentDirectory(szBaseDir);
    DeleteFile(pc->m_szDBName);
        hConn = DBConnect(pc->m_dbDriver, NULL, pc->m_szDBName, NULL, NULL);
index 26cd80c..eba158e 100644 (file)
@@ -61,7 +61,8 @@ BOOL CNxconfigApp::InitInstance()
 {
    HKEY hKey;
    DWORD dwSize, dwData = 0;
-   TCHAR *pszArg, szCmd[1024];
+   const TCHAR *pszArg;
+       TCHAR szCmd[1024];
 
        if (!AfxSocketInit())
        {
@@ -222,11 +223,17 @@ void CNxconfigApp::CreateAgentConfig()
             // Read all IP addresses for adapter
             for(pAddr = &pInfo->IpAddressList; pAddr != NULL; pAddr = pAddr->Next)
             {
-               if (_tcscmp(pAddr->IpAddress.String, _T("0.0.0.0")))
+               if (strcmp(pAddr->IpAddress.String, "0.0.0.0"))
                {
                   if (szAddrList[0] != 0)
                      _tcscat(szAddrList, _T(", "));
-                  _tcscat(szAddrList, pAddr->IpAddress.String);
+#ifdef UNICODE
+                                               WCHAR ipaddr[32];
+                                               MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, pAddr->IpAddress.String, -1, ipaddr, 32);
+                  wcscat(szAddrList, ipaddr);
+#else
+                  strcat(szAddrList, pAddr->IpAddress.String);
+#endif
                }
             }
          }
@@ -255,7 +262,7 @@ void CNxconfigApp::CreateAgentConfig()
 // Create configuration file for nxhttpd
 //
 
-void CNxconfigApp::CreateWebConfig(TCHAR *pszServer)
+void CNxconfigApp::CreateWebConfig(const TCHAR *pszServer)
 {
    FILE *fp;
    time_t currTime;
index 77d9c4a..2f40671 100644 (file)
@@ -116,7 +116,7 @@ public:
        //}}AFX_MSG
        DECLARE_MESSAGE_MAP()
 protected:
-       void CreateWebConfig(TCHAR *pszServer);
+       void CreateWebConfig(const TCHAR *pszServer);
        TCHAR m_szInstallDir[MAX_PATH];
        void CreateAgentConfig(void);
 };
index 998b28f..6ee4ac4 100644 (file)
@@ -23,7 +23,7 @@
                        OutputDirectory="$(SolutionDir)$(ConfigurationName)"\r
                        IntermediateDirectory="$(ConfigurationName)"\r
                        ConfigurationType="1"\r
-                       CharacterSet="2"\r
+                       CharacterSet="1"\r
                        >\r
                        <Tool\r
                                Name="VCPreBuildEventTool"\r
@@ -68,6 +68,7 @@
                                LinkIncremental="2"\r
                                GenerateDebugInformation="true"\r
                                SubSystem="2"\r
+                               EntryPointSymbol="wWinMainCRTStartup"\r
                                TargetMachine="1"\r
                        />\r
                        <Tool\r
                        />\r
                </Configuration>\r
                <Configuration\r
-                       Name="Release|Win32"\r
-                       OutputDirectory="$(SolutionDir)$(ConfigurationName)"\r
-                       IntermediateDirectory="$(ConfigurationName)"\r
+                       Name="Debug|x64"\r
+                       OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"\r
+                       IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"\r
                        ConfigurationType="1"\r
-                       CharacterSet="2"\r
-                       WholeProgramOptimization="1"\r
+                       CharacterSet="1"\r
                        >\r
                        <Tool\r
                                Name="VCPreBuildEventTool"\r
                        />\r
                        <Tool\r
                                Name="VCMIDLTool"\r
+                               TargetEnvironment="3"\r
                        />\r
                        <Tool\r
                                Name="VCCLCompilerTool"\r
+                               Optimization="0"\r
                                AdditionalIncludeDirectories="..\..\..\..\include;..\..\include"\r
                                PreprocessorDefinitions="_AFXDLL;_CRT_SECURE_NO_WARNINGS"\r
-                               RuntimeLibrary="2"\r
+                               MinimalRebuild="true"\r
+                               BasicRuntimeChecks="3"\r
+                               RuntimeLibrary="3"\r
                                UsePrecompiledHeader="2"\r
                                WarningLevel="3"\r
                                Detect64BitPortabilityProblems="false"\r
                        <Tool\r
                                Name="VCLinkerTool"\r
                                AdditionalDependencies="iphlpapi.lib"\r
-                               LinkIncremental="1"\r
+                               LinkIncremental="2"\r
                                GenerateDebugInformation="true"\r
                                SubSystem="2"\r
-                               OptimizeReferences="2"\r
-                               EnableCOMDATFolding="2"\r
-                               TargetMachine="1"\r
+                               EntryPointSymbol="wWinMainCRTStartup"\r
+                               TargetMachine="17"\r
                        />\r
                        <Tool\r
                                Name="VCALinkTool"\r
                        />\r
                </Configuration>\r
                <Configuration\r
-                       Name="Debug|x64"\r
-                       OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"\r
-                       IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"\r
+                       Name="Release|Win32"\r
+                       OutputDirectory="$(SolutionDir)$(ConfigurationName)"\r
+                       IntermediateDirectory="$(ConfigurationName)"\r
                        ConfigurationType="1"\r
-                       CharacterSet="2"\r
+                       CharacterSet="1"\r
+                       WholeProgramOptimization="1"\r
                        >\r
                        <Tool\r
                                Name="VCPreBuildEventTool"\r
                        />\r
                        <Tool\r
                                Name="VCMIDLTool"\r
-                               TargetEnvironment="3"\r
                        />\r
                        <Tool\r
                                Name="VCCLCompilerTool"\r
-                               Optimization="0"\r
                                AdditionalIncludeDirectories="..\..\..\..\include;..\..\include"\r
                                PreprocessorDefinitions="_AFXDLL;_CRT_SECURE_NO_WARNINGS"\r
-                               MinimalRebuild="true"\r
-                               BasicRuntimeChecks="3"\r
-                               RuntimeLibrary="3"\r
+                               RuntimeLibrary="2"\r
                                UsePrecompiledHeader="2"\r
                                WarningLevel="3"\r
                                Detect64BitPortabilityProblems="false"\r
                        <Tool\r
                                Name="VCLinkerTool"\r
                                AdditionalDependencies="iphlpapi.lib"\r
-                               LinkIncremental="2"\r
+                               LinkIncremental="1"\r
                                GenerateDebugInformation="true"\r
                                SubSystem="2"\r
-                               TargetMachine="17"\r
+                               OptimizeReferences="2"\r
+                               EnableCOMDATFolding="2"\r
+                               EntryPointSymbol="wWinMainCRTStartup"\r
+                               TargetMachine="1"\r
                        />\r
                        <Tool\r
                                Name="VCALinkTool"\r
                        OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"\r
                        IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"\r
                        ConfigurationType="1"\r
-                       CharacterSet="2"\r
+                       CharacterSet="1"\r
                        WholeProgramOptimization="1"\r
                        >\r
                        <Tool\r
                                SubSystem="2"\r
                                OptimizeReferences="2"\r
                                EnableCOMDATFolding="2"\r
+                               EntryPointSymbol="wWinMainCRTStartup"\r
                                TargetMachine="17"\r
                        />\r
                        <Tool\r
                                        />\r
                                </FileConfiguration>\r
                                <FileConfiguration\r
-                                       Name="Release|Win32"\r
+                                       Name="Debug|x64"\r
                                        >\r
                                        <Tool\r
                                                Name="VCCLCompilerTool"\r
                                        />\r
                                </FileConfiguration>\r
                                <FileConfiguration\r
-                                       Name="Debug|x64"\r
+                                       Name="Release|Win32"\r
                                        >\r
                                        <Tool\r
                                                Name="VCCLCompilerTool"\r