agent added to VS2005; 64bit compilation fixes
authorVictor Kirhenshtein <victor@netxms.org>
Sun, 28 Dec 2008 20:38:10 +0000 (20:38 +0000)
committerVictor Kirhenshtein <victor@netxms.org>
Sun, 28 Dec 2008 20:38:10 +0000 (20:38 +0000)
.gitattributes
include/nms_common.h
netxms.sln
src/agent/core/netinfo.cpp
src/agent/core/nxagentd.vcproj [new file with mode: 0644]
src/agent/core/subagent.cpp
src/agent/core/win32.cpp
src/libnetxms/message.cpp
tools/mc.rule [new file with mode: 0644]

index 8978277..ff7c992 100644 (file)
@@ -48,6 +48,7 @@ netware/bin/.keep -text
 src/PPC_libs.vcw eol=crlf
 src/agent/core/nxagentd.dsp eol=crlf
 src/agent/core/nxagentd.dsw eol=crlf
+src/agent/core/nxagentd.vcproj -text
 src/agent/subagents/ecs/ecs.dsp eol=crlf
 src/agent/subagents/ecs/ecs.dsw eol=crlf
 src/agent/subagents/logscan/logscan.dsp eol=crlf
@@ -490,6 +491,7 @@ src/webui/src/org/netxms/webui.gwt.xml -text
 src/webui/tomcat/conf/web.xml -text
 src/webui/tomcat/webapps/ROOT/WEB-INF/web.xml -text
 src/webui/webui.launch -text
+tools/mc.rule -text
 tools/patch_config.status.pl -text
 www/data/documentation/body.shtml -text
 www/data/documentation/confexample/image001.png -text
index df3f97e..e1976c8 100644 (file)
 #include <netxms-version.h>
 
 
+//
+// Define __64BIT__ if compiling for 64bit platform with Visual C++
+//
+
+#if defined(_M_X64) || defined(_M_IA64)
+#ifndef __64BIT__
+#define __64BIT__
+#endif
+#endif
+
+
 //
 // Wrappers for 64-bit constants
 //
 //
 
 #define MAX_SECRET_LENGTH        64
-#ifdef __64BIT__
-#define INVALID_POINTER_VALUE    ((void *)_ULL(0xFFFFFFFFFFFFFFFF))
-#else
-#define INVALID_POINTER_VALUE    ((void *)0xFFFFFFFF)
-#endif
 #define MAX_DB_STRING            256
 #define MAX_PARAM_NAME           256
 #define GROUP_FLAG               ((DWORD)0x80000000)
@@ -438,6 +444,17 @@ typedef struct hostent HOSTENT;
 #endif   /* _WIN32 */
 
 
+//
+// Value used to indicate invalid pointer where NULL is not appropriate
+//
+
+#ifdef __64BIT__
+#define INVALID_POINTER_VALUE    ((void *)_ULL(0xFFFFFFFFFFFFFFFF))
+#else
+#define INVALID_POINTER_VALUE    ((void *)0xFFFFFFFF)
+#endif
+
+
 //
 // Casting between pointer and 32-bit integer
 //
index 3580ee6..81480ff 100644 (file)
@@ -17,7 +17,12 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libexpatw", "src\libexpat\l
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libnxlp", "src\libnxlp\libnxlp.vcproj", "{64EFC0C2-C67B-41F6-851D-F11DAB27A60B}"
        ProjectSection(ProjectDependencies) = postProject
+               {B1745870-F3ED-4ACB-B813-0C4F47EF0793} = {B1745870-F3ED-4ACB-B813-0C4F47EF0793}
                {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
                {B1745870-F3ED-4ACB-B813-0C4F47EF0793} = {B1745870-F3ED-4ACB-B813-0C4F47EF0793}
        EndProjectSection
 EndProject
@@ -66,6 +71,13 @@ Global
                {64EFC0C2-C67B-41F6-851D-F11DAB27A60B}.Release|Win32.ActiveCfg = Release|Win32
                {64EFC0C2-C67B-41F6-851D-F11DAB27A60B}.Release|Win32.Build.0 = Release|Win32
                {64EFC0C2-C67B-41F6-851D-F11DAB27A60B}.Release|x64.ActiveCfg = Release|Win32
+               {57598B02-3295-4FE8-9322-94CE871CC84D}.Debug|Win32.ActiveCfg = Debug|Win32
+               {57598B02-3295-4FE8-9322-94CE871CC84D}.Debug|Win32.Build.0 = Debug|Win32
+               {57598B02-3295-4FE8-9322-94CE871CC84D}.Debug|x64.ActiveCfg = Debug|x64
+               {57598B02-3295-4FE8-9322-94CE871CC84D}.Debug|x64.Build.0 = Debug|x64
+               {57598B02-3295-4FE8-9322-94CE871CC84D}.Release|Win32.ActiveCfg = Release|Win32
+               {57598B02-3295-4FE8-9322-94CE871CC84D}.Release|Win32.Build.0 = Release|Win32
+               {57598B02-3295-4FE8-9322-94CE871CC84D}.Release|x64.ActiveCfg = Release|Win32
        EndGlobalSection
        GlobalSection(SolutionProperties) = preSolution
                HideSolutionNode = FALSE
index d1305a6..7595eb1 100644 (file)
@@ -202,7 +202,7 @@ LONG H_NetIPStats(const char *cmd, const char *arg, char *value)
 
    if (GetIpStatistics(&ips) == NO_ERROR)
    {
-      switch((int)arg)
+      switch(CAST_FROM_POINTER(arg, int))
       {
          case NET_IP_FORWARDING:
             ret_int(value, ips.dwForwarding);
@@ -308,7 +308,7 @@ LONG H_NetInterfaceStats(const char *cmd, const char *arg, char *value)
          info.dwIndex = dwIndex;
          if (GetIfEntry(&info) == NO_ERROR)
          {
-            switch((int)arg)
+            switch(CAST_FROM_POINTER(arg, int))
             {
                case NET_IF_BYTES_IN:
                   ret_uint(value, info.dwInOctets);
diff --git a/src/agent/core/nxagentd.vcproj b/src/agent/core/nxagentd.vcproj
new file mode 100644 (file)
index 0000000..39e69e0
--- /dev/null
@@ -0,0 +1,512 @@
+<?xml version="1.0" encoding="windows-1251"?>\r
+<VisualStudioProject\r
+       ProjectType="Visual C++"\r
+       Version="8.00"\r
+       Name="nxagentd"\r
+       ProjectGUID="{57598B02-3295-4FE8-9322-94CE871CC84D}"\r
+       RootNamespace="nxagentd"\r
+       Keyword="Win32Proj"\r
+       >\r
+       <Platforms>\r
+               <Platform\r
+                       Name="Win32"\r
+               />\r
+               <Platform\r
+                       Name="x64"\r
+               />\r
+       </Platforms>\r
+       <ToolFiles>\r
+               <ToolFile\r
+                       RelativePath="..\..\..\tools\mc.rule"\r
+               />\r
+       </ToolFiles>\r
+       <Configurations>\r
+               <Configuration\r
+                       Name="Debug|Win32"\r
+                       OutputDirectory="$(SolutionDir)$(ConfigurationName)"\r
+                       IntermediateDirectory="$(ConfigurationName)"\r
+                       ConfigurationType="1"\r
+                       CharacterSet="2"\r
+                       >\r
+                       <Tool\r
+                               Name="VCPreBuildEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCustomBuildTool"\r
+                       />\r
+                       <Tool\r
+                               Name="Message compiler"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXMLDataGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCWebServiceProxyGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCMIDLTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCLCompilerTool"\r
+                               Optimization="0"\r
+                               AdditionalIncludeDirectories="..\..\..\include"\r
+                               PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"\r
+                               MinimalRebuild="true"\r
+                               BasicRuntimeChecks="3"\r
+                               RuntimeLibrary="3"\r
+                               UsePrecompiledHeader="0"\r
+                               WarningLevel="3"\r
+                               Detect64BitPortabilityProblems="false"\r
+                               DebugInformationFormat="4"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManagedResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPreLinkEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCLinkerTool"\r
+                               AdditionalDependencies="ws2_32.lib iphlpapi.lib"\r
+                               LinkIncremental="2"\r
+                               GenerateDebugInformation="true"\r
+                               SubSystem="1"\r
+                               TargetMachine="1"\r
+                       />\r
+                       <Tool\r
+                               Name="VCALinkTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManifestTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXDCMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCBscMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCFxCopTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCAppVerifierTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCWebDeploymentTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPostBuildEventTool"\r
+                       />\r
+               </Configuration>\r
+               <Configuration\r
+                       Name="Release|Win32"\r
+                       OutputDirectory="$(SolutionDir)$(ConfigurationName)"\r
+                       IntermediateDirectory="$(ConfigurationName)"\r
+                       ConfigurationType="1"\r
+                       CharacterSet="2"\r
+                       WholeProgramOptimization="1"\r
+                       >\r
+                       <Tool\r
+                               Name="VCPreBuildEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCustomBuildTool"\r
+                       />\r
+                       <Tool\r
+                               Name="Message compiler"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXMLDataGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCWebServiceProxyGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCMIDLTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCLCompilerTool"\r
+                               AdditionalIncludeDirectories="..\..\..\include"\r
+                               PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"\r
+                               RuntimeLibrary="2"\r
+                               UsePrecompiledHeader="0"\r
+                               WarningLevel="3"\r
+                               Detect64BitPortabilityProblems="false"\r
+                               DebugInformationFormat="3"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManagedResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPreLinkEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCLinkerTool"\r
+                               AdditionalDependencies="ws2_32.lib iphlpapi.lib"\r
+                               LinkIncremental="1"\r
+                               GenerateDebugInformation="true"\r
+                               SubSystem="1"\r
+                               OptimizeReferences="2"\r
+                               EnableCOMDATFolding="2"\r
+                               TargetMachine="1"\r
+                       />\r
+                       <Tool\r
+                               Name="VCALinkTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManifestTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXDCMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCBscMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCFxCopTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCAppVerifierTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCWebDeploymentTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPostBuildEventTool"\r
+                       />\r
+               </Configuration>\r
+               <Configuration\r
+                       Name="Debug|x64"\r
+                       OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"\r
+                       IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"\r
+                       ConfigurationType="1"\r
+                       CharacterSet="2"\r
+                       >\r
+                       <Tool\r
+                               Name="VCPreBuildEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCustomBuildTool"\r
+                       />\r
+                       <Tool\r
+                               Name="Message compiler"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXMLDataGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCWebServiceProxyGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCMIDLTool"\r
+                               TargetEnvironment="3"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCLCompilerTool"\r
+                               Optimization="0"\r
+                               AdditionalIncludeDirectories="..\..\..\include"\r
+                               PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"\r
+                               MinimalRebuild="true"\r
+                               BasicRuntimeChecks="3"\r
+                               RuntimeLibrary="3"\r
+                               UsePrecompiledHeader="0"\r
+                               WarningLevel="3"\r
+                               Detect64BitPortabilityProblems="true"\r
+                               DebugInformationFormat="3"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManagedResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPreLinkEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCLinkerTool"\r
+                               AdditionalDependencies="ws2_32.lib iphlpapi.lib"\r
+                               LinkIncremental="2"\r
+                               GenerateDebugInformation="true"\r
+                               SubSystem="1"\r
+                               TargetMachine="17"\r
+                       />\r
+                       <Tool\r
+                               Name="VCALinkTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManifestTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXDCMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCBscMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCFxCopTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCAppVerifierTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCWebDeploymentTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPostBuildEventTool"\r
+                       />\r
+               </Configuration>\r
+               <Configuration\r
+                       Name="Release|x64"\r
+                       OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"\r
+                       IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"\r
+                       ConfigurationType="1"\r
+                       CharacterSet="2"\r
+                       WholeProgramOptimization="1"\r
+                       >\r
+                       <Tool\r
+                               Name="VCPreBuildEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCustomBuildTool"\r
+                       />\r
+                       <Tool\r
+                               Name="Message compiler"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXMLDataGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCWebServiceProxyGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCMIDLTool"\r
+                               TargetEnvironment="3"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCLCompilerTool"\r
+                               AdditionalIncludeDirectories="..\..\..\include"\r
+                               PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"\r
+                               RuntimeLibrary="2"\r
+                               UsePrecompiledHeader="0"\r
+                               WarningLevel="3"\r
+                               Detect64BitPortabilityProblems="true"\r
+                               DebugInformationFormat="3"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManagedResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPreLinkEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCLinkerTool"\r
+                               AdditionalDependencies="ws2_32.lib iphlpapi.lib"\r
+                               LinkIncremental="1"\r
+                               GenerateDebugInformation="true"\r
+                               SubSystem="1"\r
+                               OptimizeReferences="2"\r
+                               EnableCOMDATFolding="2"\r
+                               TargetMachine="17"\r
+                       />\r
+                       <Tool\r
+                               Name="VCALinkTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManifestTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXDCMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCBscMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCFxCopTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCAppVerifierTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCWebDeploymentTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPostBuildEventTool"\r
+                       />\r
+               </Configuration>\r
+       </Configurations>\r
+       <References>\r
+       </References>\r
+       <Files>\r
+               <Filter\r
+                       Name="Source Files"\r
+                       Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"\r
+                       UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"\r
+                       >\r
+                       <File\r
+                               RelativePath=".\actions.cpp"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\comm.cpp"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\config.cpp"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\exec.cpp"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\getparam.cpp"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\hddinfo.cpp"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\netinfo.cpp"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\nxagentd.cpp"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\register.cpp"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\service.cpp"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\session.cpp"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\snmpproxy.cpp"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\subagent.cpp"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\sysinfo.cpp"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\tools.cpp"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\trap.cpp"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\upgrade.cpp"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\win32.cpp"\r
+                               >\r
+                       </File>\r
+               </Filter>\r
+               <Filter\r
+                       Name="Header Files"\r
+                       Filter="h;hpp;hxx;hm;inl;inc;xsd"\r
+                       UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"\r
+                       >\r
+                       <File\r
+                               RelativePath=".\messages.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\..\..\include\netxms-version.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\..\..\include\netxms_getopt.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\..\..\include\nms_agent.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\..\..\include\nms_common.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\..\..\include\nms_cscp.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\..\..\include\nms_threads.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\..\..\include\nms_util.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\nxagentd.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\..\..\include\nxcpapi.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\..\..\include\nxlog.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\..\..\include\nxqueue.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\resource.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\..\..\include\rwlock.h"\r
+                               >\r
+                       </File>\r
+               </Filter>\r
+               <Filter\r
+                       Name="Resource Files"\r
+                       Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"\r
+                       UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"\r
+                       >\r
+                       <File\r
+                               RelativePath=".\nxagentd.rc"\r
+                               >\r
+                       </File>\r
+               </Filter>\r
+               <Filter\r
+                       Name="Message Files"\r
+                       Filter="*.mc"\r
+                       >\r
+                       <File\r
+                               RelativePath=".\messages.mc"\r
+                               >\r
+                       </File>\r
+               </Filter>\r
+       </Files>\r
+       <Globals>\r
+       </Globals>\r
+</VisualStudioProject>\r
index abfa875..fd7cd50 100644 (file)
@@ -239,9 +239,15 @@ LONG H_SubAgentList(const char *cmd, const char *arg, NETXMS_VALUES_LIST *value)
 
    for(i = 0; i < m_dwNumSubAgents; i++)
    {
+#ifdef __64BIT__
+      _sntprintf(szBuffer, MAX_PATH + 32, _T("%s %s 0x") UINT64X_FMT(_T("016")) _T(" %s"), 
+                 m_pSubAgentList[i].pInfo->szName, m_pSubAgentList[i].pInfo->szVersion,
+                 m_pSubAgentList[i].hModule, m_pSubAgentList[i].szName);
+#else
       _sntprintf(szBuffer, MAX_PATH + 32, _T("%s %s 0x%08X %s"), 
                  m_pSubAgentList[i].pInfo->szName, m_pSubAgentList[i].pInfo->szVersion,
                  m_pSubAgentList[i].hModule, m_pSubAgentList[i].szName);
+#endif
       NxAddResultString(value, szBuffer);
    }
    return SYSINFO_RC_SUCCESS;
index 662add3..a330b7e 100644 (file)
@@ -38,7 +38,7 @@ LONG H_MemoryInfo(const char *cmd, const char *arg, char *value)
       if (!imp_GlobalMemoryStatusEx(&mse))
          return SYSINFO_RC_ERROR;
 
-      switch((int)arg)
+      switch(CAST_FROM_POINTER(arg, int))
       {
          case MEMINFO_PHYSICAL_FREE:
             ret_uint64(value, mse.ullAvailPhys);
@@ -79,7 +79,7 @@ LONG H_MemoryInfo(const char *cmd, const char *arg, char *value)
       MEMORYSTATUS ms;
 
       GlobalMemoryStatus(&ms);
-      switch((int)arg)
+      switch(CAST_FROM_POINTER(arg, int))
       {
          case MEMINFO_PHYSICAL_FREE:
             ret_uint64(value, ms.dwAvailPhys);
@@ -150,7 +150,7 @@ LONG H_DiskInfo(const char *pszCmd, const char *pArg, char *pValue)
       return SYSINFO_RC_UNSUPPORTED;
    if (GetDiskFreeSpaceEx(szPath, &availBytes, &totalBytes, &freeBytes))
    {
-      switch((int)pArg)
+      switch(CAST_FROM_POINTER(pArg, int))
       {
          case DISKINFO_FREE_BYTES:
             ret_uint64(pValue, freeBytes.QuadPart);
index 51ab0e0..9f4e97a 100644 (file)
@@ -910,7 +910,7 @@ char *CSCPMessage::CreateXML(void)
                                {
 #ifdef UNICODE
                                        tempStr = (WCHAR *)malloc((blen + 1) * sizeof(WCHAR));
-                                       MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, bdata, blen, tempStr, blen);
+                                       MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, bdata, (int)blen, tempStr, (int)blen);
                                        tempStr[blen] = 0;
                                        xml.AddDynamicString(tempStr);
 #else
diff --git a/tools/mc.rule b/tools/mc.rule
new file mode 100644 (file)
index 0000000..5ce2655
--- /dev/null
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="utf-8"?>\r
+<VisualStudioToolFile\r
+       Name="Message Compiler Rules"\r
+       Version="8.00"\r
+       >\r
+       <Rules>\r
+               <CustomBuildRule\r
+                       Name="Message compiler"\r
+                       DisplayName="Message compiler"\r
+                       CommandLine="mc -s -U -h $(ProjectDir) -r $(ProjectDir) $(InputFileName)&#x0D;&#x0A;del $(ProjectDir)messages.rc&#x0D;&#x0A;"\r
+                       Outputs="$(InputName).h MSG00001.bin"\r
+                       FileExtensions="*.mc"\r
+                       ExecutionDescription="Running message compiler"\r
+                       >\r
+                       <Properties>\r
+                       </Properties>\r
+               </CustomBuildRule>\r
+       </Rules>\r
+</VisualStudioToolFile>\r