Changeset 36c340d in nscp for modules/NSClientCompat


Ignore:
Timestamp:
02/25/05 21:47:45 (8 years ago)
Author:
Michael Medin <michael@…>
Branches:
master, 0.4.0, 0.4.1, 0.4.2, stable
Children:
8223547
Parents:
a1e1922
Message:

Multiple fixes in various places.

  • Added threadding blocks "core"
  • Added new Module (CheckDisk)
  • Added new option [log] / debug=1 to enable debug logs.
  • Added more error messages
  • other minor tweaks and fixes
Location:
modules/NSClientCompat
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • modules/NSClientCompat/NSClientCompat.cpp

    r3baaa4d r36c340d  
    4747 */ 
    4848bool NSClientCompat::unloadModule() { 
    49   if (!pdhThread.exitThread()) 
     49  if (!pdhThread.exitThread(20000)) 
    5050    NSC_LOG_ERROR("Could not exit the thread, memory leak and potential corruption may be the result..."); 
    5151  return true; 
  • modules/NSClientCompat/NSClientCompat.vcproj

    ra1e1922 r36c340d  
    113113        Name="VCAuxiliaryManagedWrapperGeneratorTool"/> 
    114114    </Configuration> 
     115    <Configuration 
     116      Name="Dynamic Linkage|Win32" 
     117      OutputDirectory="$(ConfigurationName)" 
     118      IntermediateDirectory="$(ConfigurationName)" 
     119      ConfigurationType="2" 
     120      CharacterSet="2"> 
     121      <Tool 
     122        Name="VCCLCompilerTool" 
     123        AdditionalIncludeDirectories="../include;../../include" 
     124        PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS" 
     125        RuntimeLibrary="2" 
     126        UsePrecompiledHeader="3" 
     127        WarningLevel="3" 
     128        Detect64BitPortabilityProblems="TRUE" 
     129        DebugInformationFormat="3"/> 
     130      <Tool 
     131        Name="VCCustomBuildTool"/> 
     132      <Tool 
     133        Name="VCLinkerTool" 
     134        AdditionalDependencies="Pdh.lib" 
     135        OutputFile="../../Release/modules/$(ProjectName).dll" 
     136        LinkIncremental="1" 
     137        ModuleDefinitionFile="NSClientCompat.def" 
     138        GenerateDebugInformation="TRUE" 
     139        SubSystem="2" 
     140        OptimizeReferences="2" 
     141        EnableCOMDATFolding="2" 
     142        ImportLibrary="$(OutDir)/NSClientCompat.lib" 
     143        TargetMachine="1"/> 
     144      <Tool 
     145        Name="VCMIDLTool"/> 
     146      <Tool 
     147        Name="VCPostBuildEventTool"/> 
     148      <Tool 
     149        Name="VCPreBuildEventTool"/> 
     150      <Tool 
     151        Name="VCPreLinkEventTool"/> 
     152      <Tool 
     153        Name="VCResourceCompilerTool"/> 
     154      <Tool 
     155        Name="VCWebServiceProxyGeneratorTool"/> 
     156      <Tool 
     157        Name="VCXMLDataGeneratorTool"/> 
     158      <Tool 
     159        Name="VCWebDeploymentTool"/> 
     160      <Tool 
     161        Name="VCManagedWrapperGeneratorTool"/> 
     162      <Tool 
     163        Name="VCAuxiliaryManagedWrapperGeneratorTool"/> 
     164    </Configuration> 
     165    <Configuration 
     166      Name="Debug Dynamic Linkage|Win32" 
     167      OutputDirectory="$(ConfigurationName)" 
     168      IntermediateDirectory="$(ConfigurationName)" 
     169      ConfigurationType="2" 
     170      CharacterSet="2"> 
     171      <Tool 
     172        Name="VCCLCompilerTool" 
     173        Optimization="0" 
     174        AdditionalIncludeDirectories="../include;../../include" 
     175        PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_STLP_USE_NEWALLOC;_STLP_DEBUG=1" 
     176        MinimalRebuild="TRUE" 
     177        BasicRuntimeChecks="3" 
     178        RuntimeLibrary="3" 
     179        UsePrecompiledHeader="3" 
     180        WarningLevel="3" 
     181        Detect64BitPortabilityProblems="TRUE" 
     182        DebugInformationFormat="4"/> 
     183      <Tool 
     184        Name="VCCustomBuildTool"/> 
     185      <Tool 
     186        Name="VCLinkerTool" 
     187        AdditionalDependencies="Pdh.lib" 
     188        OutputFile="../../Debug/modules/$(ProjectName).dll" 
     189        LinkIncremental="2" 
     190        ModuleDefinitionFile="NSClientCompat.def" 
     191        GenerateDebugInformation="TRUE" 
     192        ProgramDatabaseFile="$(OutDir)/NSClientCompat.pdb" 
     193        SubSystem="2" 
     194        ImportLibrary="$(OutDir)/NSClientCompat.lib" 
     195        TargetMachine="1"/> 
     196      <Tool 
     197        Name="VCMIDLTool"/> 
     198      <Tool 
     199        Name="VCPostBuildEventTool"/> 
     200      <Tool 
     201        Name="VCPreBuildEventTool"/> 
     202      <Tool 
     203        Name="VCPreLinkEventTool"/> 
     204      <Tool 
     205        Name="VCResourceCompilerTool"/> 
     206      <Tool 
     207        Name="VCWebServiceProxyGeneratorTool"/> 
     208      <Tool 
     209        Name="VCXMLDataGeneratorTool"/> 
     210      <Tool 
     211        Name="VCWebDeploymentTool"/> 
     212      <Tool 
     213        Name="VCManagedWrapperGeneratorTool"/> 
     214      <Tool 
     215        Name="VCAuxiliaryManagedWrapperGeneratorTool"/> 
     216    </Configuration> 
    115217  </Configurations> 
    116218  <References> 
     
    153255            UsePrecompiledHeader="1"/> 
    154256        </FileConfiguration> 
     257        <FileConfiguration 
     258          Name="Dynamic Linkage|Win32"> 
     259          <Tool 
     260            Name="VCCLCompilerTool" 
     261            UsePrecompiledHeader="1"/> 
     262        </FileConfiguration> 
     263        <FileConfiguration 
     264          Name="Debug Dynamic Linkage|Win32"> 
     265          <Tool 
     266            Name="VCCLCompilerTool" 
     267            UsePrecompiledHeader="1"/> 
     268        </FileConfiguration> 
    155269      </File> 
    156270    </Filter> 
  • modules/NSClientCompat/PDHCollector.cpp

    ra1e1922 r36c340d  
    8585  pdh.addCounter("\\\\.\\Processor(_total)\\% Processor Time", &cpu); 
    8686 
    87   pdh.open(); 
     87  try { 
     88    pdh.open(); 
     89  } catch (const PDH::PDHException &e) { 
     90    NSC_LOG_ERROR_STD("Failed to open performance counters: " + e.str_); 
     91    return 0; 
     92  } 
    8893 
    8994  startRunning(); 
     
    9398      if (!mutex.hasMutex())  
    9499        NSC_LOG_ERROR("Failed to get Mutex!"); 
    95       else 
    96         pdh.collect(); 
     100      else { 
     101        try { 
     102          pdh.collect(); 
     103        } catch (const PDH::PDHException &e) { 
     104          NSC_LOG_ERROR_STD("Failed to query performance counters: " + e.str_); 
     105        } 
     106      } 
    97107    } 
    98108    Sleep(CHECK_INTERVAL*1000); 
    99109  } 
    100110 
    101   pdh.close(); 
     111  try { 
     112    pdh.close(); 
     113  } catch (const PDH::PDHException &e) { 
     114    NSC_LOG_ERROR_STD("Failed to close performance counters: " + e.str_); 
     115  } 
    102116  NSC_DEBUG_MSG("PDHCollector - shutdown!"); 
    103117  return 0; 
     
    153167/** 
    154168 * 
    155  * Memory commited bytes (your guess is as good as mine to what this is :) 
     169 * Memory committed bytes (your guess is as good as mine to what this is :) 
    156170 * @return Some form of memory check 
    157171 */ 
Note: See TracChangeset for help on using the changeset viewer.