Changeset 2a94f3f in nscp


Ignore:
Timestamp:
03/19/05 20:57:49 (8 years ago)
Author:
Michael Medin <michael@…>
Branches:
master, 0.4.0, 0.4.1, 0.4.2, stable
Children:
1eef1ee
Parents:
8223547
Message:
  • Refactored out NSCLient Listener as a separate module
  • Added initial NRPE listener module (not yet implemented only a shell)
  • Changed Module API (Inject function has new syntax)
  • Added some tokenizer function to charEx
  • Added new wrapper function to inject Command
  • Minor changes in relation to refactor work
Files:
16 added
16 edited

Legend:

Unmodified
Added
Removed
  • NSClient++.cpp

    r8223547 r2a94f3f  
    2020 
    2121NSClient mainClient;  // Global core instance. 
    22  
     22bool g_bConsoleLog = false; 
    2323////////////////////////////////////////////////////////////////////////// 
    2424// Startup code 
     
    3838  if ( (argc > 1) && ((*argv[1] == '-') || (*argv[1] == '/')) ) { 
    3939    if ( _stricmp( "install", argv[1]+1 ) == 0 ) { 
     40      g_bConsoleLog = true; 
    4041      try { 
    4142        serviceControll::Install(SZSERVICENAME, SZSERVICEDISPLAYNAME, SZDEPENDENCIES); 
     
    4647      LOG_MESSAGE("Service installed!"); 
    4748    } else if ( _stricmp( "uninstall", argv[1]+1 ) == 0 ) { 
     49      g_bConsoleLog = true; 
    4850      try { 
    4951        serviceControll::Uninstall(SZSERVICENAME); 
     
    5355      } 
    5456    } else if ( _stricmp( "start", argv[1]+1 ) == 0 ) { 
     57      g_bConsoleLog = true; 
    5558      serviceControll::Start(SZSERVICENAME); 
    5659    } else if ( _stricmp( "stop", argv[1]+1 ) == 0 ) { 
     60      g_bConsoleLog = true; 
    5761      serviceControll::Stop(SZSERVICENAME); 
    5862    } else if ( _stricmp( "about", argv[1]+1 ) == 0 ) { 
     63      g_bConsoleLog = true; 
    5964      LOG_MESSAGE(SZAPPNAME " (C) Michael Medin"); 
    6065      LOG_MESSAGE("Version " SZVERSION); 
    6166    } else if ( _stricmp( "version", argv[1]+1 ) == 0 ) { 
     67      g_bConsoleLog = true; 
    6268      LOG_MESSAGE(SZAPPNAME " Version: " SZVERSION); 
    6369    } else if ( _stricmp( "test", argv[1]+1 ) == 0 ) { 
     70      g_bConsoleLog = true; 
    6471      mainClient.InitiateService(); 
    6572      LOG_MESSAGE("Enter command to inject or exit to terminate..."); 
     
    6774      std::cin >> s; 
    6875      while (s != "exit") { 
    69         mainClient.inject(s); 
     76//        mainClient.inject(s); 
    7077        std::cin >> s; 
    7178      } 
    7279      mainClient.TerminateService(); 
    7380      LOG_MESSAGE("DONE!"); 
     81 
    7482      return 0; 
    7583    } else { 
     
    101109    } 
    102110  } 
    103   socketThread.createThread(); 
    104111} 
    105112/** 
     
    108115 */ 
    109116void NSClientT::TerminateService(void) { 
    110   if (!socketThread.exitThread()) 
    111     LOG_ERROR("Could not exit socket listener thread"); 
    112117  try { 
    113118    LOG_DEBUG("Socket closed, unloading plugins..."); 
     
    166171  pluginList::reverse_iterator it; 
    167172  for (it = plugins_.rbegin(); it != plugins_.rend(); ++it) { 
    168 #ifdef _DEBUG 
    169     std::cout << "Unloading plugin: " << (*it)->getName() << "..."; 
    170 #endif 
    171       (*it)->unload(); 
    172 #ifdef _DEBUG 
    173     std::cout << "OK" << std::endl; 
    174 #endif 
     173    LOG_DEBUG_STD("Unloading plugin: " + (*it)->getName() + "..."); 
     174    (*it)->unload(); 
    175175  } 
    176176  { 
     
    220220 * @return The result, empty string if no result 
    221221 */ 
    222 std::string NSClientT::inject(const std::string buffer) { 
    223   std::list<std::string> args = charEx::split(buffer.c_str(), '&'); 
    224   if (args.empty()) 
    225     return ""; 
    226   std::string command = args.front(); args.pop_front(); 
     222int NSClientT::injectRAW(const char* command, const unsigned int argLen, char **argument, char *returnBuffer, unsigned int returnBufferLen) { 
     223  MutexLock lock(pluginMutex); 
     224 
    227225  LOG_MESSAGE_STD("Injecting: " + command); 
    228   std::string ret = execute(NSClientT::getPassword(), command, args); 
    229   LOG_MESSAGE_STD("Injected Result: " + ret); 
    230   return ret; 
    231  
     226 
     227  pluginList::const_iterator plit; 
     228  for (plit = commandHandlers_.begin(); plit != commandHandlers_.end(); ++plit) { 
     229    try { 
     230      int c = (*plit)->handleCommand(command, argLen, argument, returnBuffer, returnBufferLen); 
     231      if (c == NSCAPI::handled) {         // module handled the message "we are done..." 
     232        LOG_DEBUG_STD("Injected Result: " +(std::string) returnBuffer); 
     233        return c; 
     234      } else if (c == NSCAPI::isfalse) {      // Module ignored the message 
     235        LOG_DEBUG("A module ignored this message"); 
     236      } else if (c == NSCAPI::invalidBufferLen) { // Buffer is to small 
     237        LOG_ERROR("Return buffer to small to handle this command."); 
     238        return c; 
     239      } else if (c == NSCAPI::isError) {      // Error 
     240        LOG_ERROR("An error occured while handling this command."); 
     241        return c; 
     242      } else {                  // Something else went wrong... 
     243        LOG_ERROR_STD("Unknown error from handleCommand: " + strEx::itos(c)); 
     244        return c; 
     245      } 
     246    } catch(const NSPluginException& e) { 
     247      LOG_ERROR_STD("Exception raised: " + e.error_ + " in module: " + e.file_); 
     248      return NSCAPI::isError; 
     249    } 
     250  } 
     251  LOG_MESSAGE_STD("No handler for command: " + command); 
     252  return NSCAPI::isfalse; 
    232253} 
    233254/** 
     
    306327    return; 
    307328  } 
     329  if (g_bConsoleLog) { 
     330    std::cout << NSCHelper::translateMessageType(msgType) << " " << file << "(" << line << ") " << message << std::endl; 
     331  } 
    308332  if (msgType == NSCAPI::debug) { 
    309333    typedef enum status {unknown, debug, nodebug }; 
     
    369393  serviceControll::Stop(SZSERVICENAME); 
    370394} 
    371 int NSAPIInject(const char* command, char* buffer, unsigned int bufLen) { 
    372   return NSCHelper::wrapReturnString(buffer, bufLen, mainClient.inject(command)); 
     395int NSAPIInject(const char* command, const unsigned int argLen, char **argument, char *returnBuffer, unsigned int returnBufferLen) { 
     396  return mainClient.injectRAW(command, argLen, argument, returnBuffer, returnBufferLen); 
    373397} 
    374398 
  • NSClient++.h

    r36c340d r2a94f3f  
    55#include <NTService.h> 
    66#include "NSCPlugin.h" 
    7 #include "TCPSocketResponder.h" 
    87#include <Mutex.h> 
    98#include <NSCAPI.h> 
     
    4241  pluginList commandHandlers_; 
    4342  pluginList messageHandlers_; 
    44   TCPSocketResponderThread socketThread; 
    4543  std::string basePath; 
    4644  MutexHandler pluginMutex; 
     
    6159  static std::string getPassword(void); 
    6260  std::string getBasePath(void); 
    63   std::string inject(const std::string buffer); 
     61  int injectRAW(const char* command, const unsigned int argLen, char **argument, char *returnBuffer, unsigned int returnBufferLen); 
     62//  std::string inject(const std::string buffer); 
    6463  std::string execute(std::string password, std::string cmd, std::list<std::string> args); 
    6564  void reportMessage(int msgType, const char* file, const int line, std::string message); 
     
    9190void NSAPIMessage(int msgType, const char* file, const int line, const char* message); 
    9291void NSAPIStopServer(void); 
    93 int NSAPIInject(const char* command, char* buffer, unsigned int bufLen); 
     92int NSAPIInject(const char* command, const unsigned int argLen, char **argument, char *returnBuffer, unsigned int returnBufferLen); 
    9493 
    9594////////////////////////////////////////////////////////////////////////// 
  • NSClient++.sln

    r36c340d r2a94f3f  
    22Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "NSClient++", "NSClient++.vcproj", "{2286162D-7571-4735-BAC8-4A8D33A4F42D}" 
    33  ProjectSection(ProjectDependencies) = postProject 
    4     {BBFF8362-C626-4838-B0A2-F695D638AD24} = {BBFF8362-C626-4838-B0A2-F695D638AD24} 
    5     {2D78C363-02BD-4171-8F91-6B4D669A98BF} = {2D78C363-02BD-4171-8F91-6B4D669A98BF} 
    6     {79F1F571-78A6-4B20-8BD5-0F65CD60012C} = {79F1F571-78A6-4B20-8BD5-0F65CD60012C} 
    7     {E6E588AB-EFEF-481C-9AF7-DCDCB95CFF45} = {E6E588AB-EFEF-481C-9AF7-DCDCB95CFF45} 
    8     {62B685D7-3A2E-4F3E-B2B8-B17F20C0217F} = {62B685D7-3A2E-4F3E-B2B8-B17F20C0217F} 
    94  EndProjectSection 
    105EndProject 
     
    149EndProject 
    1510Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "NSClientCompat", "modules\NSClientCompat\NSClientCompat.vcproj", "{79F1F571-78A6-4B20-8BD5-0F65CD60012C}" 
    16   ProjectSection(ProjectDependencies) = postProject 
    17   EndProjectSection 
    18 EndProject 
    19 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ConsoleLogger", "modules\ConsoleLogger\ConsoleLogger.vcproj", "{2D78C363-02BD-4171-8F91-6B4D669A98BF}" 
    2011  ProjectSection(ProjectDependencies) = postProject 
    2112  EndProjectSection 
     
    3324  EndProjectSection 
    3425EndProject 
     26Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "NRPEListener", "modules\NRPEListener\NRPEListener.vcproj", "{2FF60AF6-09AA-49AB-B414-2E8FD01655C6}" 
     27  ProjectSection(ProjectDependencies) = postProject 
     28  EndProjectSection 
     29EndProject 
     30Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "NSClientListener", "modules\NSClientListener\NSClientListener.vcproj", "{08D6246D-1B4A-47A3-965D-296DCC54A4E8}" 
     31  ProjectSection(ProjectDependencies) = postProject 
     32  EndProjectSection 
     33EndProject 
    3534Global 
    3635  GlobalSection(DPCodeReviewSolutionGUID) = preSolution 
     
    3938  GlobalSection(SolutionConfiguration) = preSolution 
    4039    Debug = Debug 
    41     Debug Dynamic Linkage = Debug Dynamic Linkage 
    4240    Release = Release 
    43     Release Dynamic Linkage = Release Dynamic Linkage 
    44     Release M$ STL = Release M$ STL 
    4541  EndGlobalSection 
    4642  GlobalSection(ProjectConfiguration) = postSolution 
    4743    {2286162D-7571-4735-BAC8-4A8D33A4F42D}.Debug.ActiveCfg = Debug|Win32 
    4844    {2286162D-7571-4735-BAC8-4A8D33A4F42D}.Debug.Build.0 = Debug|Win32 
    49     {2286162D-7571-4735-BAC8-4A8D33A4F42D}.Debug Dynamic Linkage.ActiveCfg = Debug Dynamic Linkage|Win32 
    50     {2286162D-7571-4735-BAC8-4A8D33A4F42D}.Debug Dynamic Linkage.Build.0 = Debug Dynamic Linkage|Win32 
    5145    {2286162D-7571-4735-BAC8-4A8D33A4F42D}.Release.ActiveCfg = Release|Win32 
    5246    {2286162D-7571-4735-BAC8-4A8D33A4F42D}.Release.Build.0 = Release|Win32 
    53     {2286162D-7571-4735-BAC8-4A8D33A4F42D}.Release Dynamic Linkage.ActiveCfg = Dynamic Linkage|Win32 
    54     {2286162D-7571-4735-BAC8-4A8D33A4F42D}.Release Dynamic Linkage.Build.0 = Dynamic Linkage|Win32 
    55     {2286162D-7571-4735-BAC8-4A8D33A4F42D}.Release M$ STL.ActiveCfg = Release M$ STL|Win32 
    56     {2286162D-7571-4735-BAC8-4A8D33A4F42D}.Release M$ STL.Build.0 = Release M$ STL|Win32 
    5747    {BBFF8362-C626-4838-B0A2-F695D638AD24}.Debug.ActiveCfg = Debug|Win32 
    5848    {BBFF8362-C626-4838-B0A2-F695D638AD24}.Debug.Build.0 = Debug|Win32 
    59     {BBFF8362-C626-4838-B0A2-F695D638AD24}.Debug Dynamic Linkage.ActiveCfg = Debug Dynamic Linkage|Win32 
    60     {BBFF8362-C626-4838-B0A2-F695D638AD24}.Debug Dynamic Linkage.Build.0 = Debug Dynamic Linkage|Win32 
    6149    {BBFF8362-C626-4838-B0A2-F695D638AD24}.Release.ActiveCfg = Release|Win32 
    6250    {BBFF8362-C626-4838-B0A2-F695D638AD24}.Release.Build.0 = Release|Win32 
    63     {BBFF8362-C626-4838-B0A2-F695D638AD24}.Release Dynamic Linkage.ActiveCfg = Dynamic Linkage|Win32 
    64     {BBFF8362-C626-4838-B0A2-F695D638AD24}.Release Dynamic Linkage.Build.0 = Dynamic Linkage|Win32 
    65     {BBFF8362-C626-4838-B0A2-F695D638AD24}.Release M$ STL.ActiveCfg = Release|Win32 
    66     {BBFF8362-C626-4838-B0A2-F695D638AD24}.Release M$ STL.Build.0 = Release|Win32 
    6751    {79F1F571-78A6-4B20-8BD5-0F65CD60012C}.Debug.ActiveCfg = Debug|Win32 
    6852    {79F1F571-78A6-4B20-8BD5-0F65CD60012C}.Debug.Build.0 = Debug|Win32 
    69     {79F1F571-78A6-4B20-8BD5-0F65CD60012C}.Debug Dynamic Linkage.ActiveCfg = Debug Dynamic Linkage|Win32 
    70     {79F1F571-78A6-4B20-8BD5-0F65CD60012C}.Debug Dynamic Linkage.Build.0 = Debug Dynamic Linkage|Win32 
    7153    {79F1F571-78A6-4B20-8BD5-0F65CD60012C}.Release.ActiveCfg = Release|Win32 
    7254    {79F1F571-78A6-4B20-8BD5-0F65CD60012C}.Release.Build.0 = Release|Win32 
    73     {79F1F571-78A6-4B20-8BD5-0F65CD60012C}.Release Dynamic Linkage.ActiveCfg = Dynamic Linkage|Win32 
    74     {79F1F571-78A6-4B20-8BD5-0F65CD60012C}.Release Dynamic Linkage.Build.0 = Dynamic Linkage|Win32 
    75     {79F1F571-78A6-4B20-8BD5-0F65CD60012C}.Release M$ STL.ActiveCfg = Release|Win32 
    76     {79F1F571-78A6-4B20-8BD5-0F65CD60012C}.Release M$ STL.Build.0 = Release|Win32 
    77     {2D78C363-02BD-4171-8F91-6B4D669A98BF}.Debug.ActiveCfg = Debug|Win32 
    78     {2D78C363-02BD-4171-8F91-6B4D669A98BF}.Debug.Build.0 = Debug|Win32 
    79     {2D78C363-02BD-4171-8F91-6B4D669A98BF}.Debug Dynamic Linkage.ActiveCfg = Debug Dynamic Linkage|Win32 
    80     {2D78C363-02BD-4171-8F91-6B4D669A98BF}.Debug Dynamic Linkage.Build.0 = Debug Dynamic Linkage|Win32 
    81     {2D78C363-02BD-4171-8F91-6B4D669A98BF}.Release.ActiveCfg = Release|Win32 
    82     {2D78C363-02BD-4171-8F91-6B4D669A98BF}.Release.Build.0 = Release|Win32 
    83     {2D78C363-02BD-4171-8F91-6B4D669A98BF}.Release Dynamic Linkage.ActiveCfg = Dynamic Linkage|Win32 
    84     {2D78C363-02BD-4171-8F91-6B4D669A98BF}.Release Dynamic Linkage.Build.0 = Dynamic Linkage|Win32 
    85     {2D78C363-02BD-4171-8F91-6B4D669A98BF}.Release M$ STL.ActiveCfg = Release|Win32 
    86     {2D78C363-02BD-4171-8F91-6B4D669A98BF}.Release M$ STL.Build.0 = Release|Win32 
    8755    {62B685D7-3A2E-4F3E-B2B8-B17F20C0217F}.Debug.ActiveCfg = Debug|Win32 
    8856    {62B685D7-3A2E-4F3E-B2B8-B17F20C0217F}.Debug.Build.0 = Debug|Win32 
    89     {62B685D7-3A2E-4F3E-B2B8-B17F20C0217F}.Debug Dynamic Linkage.ActiveCfg = Debug Dynamic Linkage|Win32 
    90     {62B685D7-3A2E-4F3E-B2B8-B17F20C0217F}.Debug Dynamic Linkage.Build.0 = Debug Dynamic Linkage|Win32 
    9157    {62B685D7-3A2E-4F3E-B2B8-B17F20C0217F}.Release.ActiveCfg = Release|Win32 
    9258    {62B685D7-3A2E-4F3E-B2B8-B17F20C0217F}.Release.Build.0 = Release|Win32 
    93     {62B685D7-3A2E-4F3E-B2B8-B17F20C0217F}.Release Dynamic Linkage.ActiveCfg = Dynamic Linkage|Win32 
    94     {62B685D7-3A2E-4F3E-B2B8-B17F20C0217F}.Release Dynamic Linkage.Build.0 = Dynamic Linkage|Win32 
    95     {62B685D7-3A2E-4F3E-B2B8-B17F20C0217F}.Release M$ STL.ActiveCfg = Release|Win32 
    96     {62B685D7-3A2E-4F3E-B2B8-B17F20C0217F}.Release M$ STL.Build.0 = Release|Win32 
    9759    {BA246C01-063A-4548-8957-32D5CC76171B}.Debug.ActiveCfg = Debug|Win32 
    9860    {BA246C01-063A-4548-8957-32D5CC76171B}.Debug.Build.0 = Debug|Win32 
    99     {BA246C01-063A-4548-8957-32D5CC76171B}.Debug Dynamic Linkage.ActiveCfg = Debug Dynamic Linkage|Win32 
    100     {BA246C01-063A-4548-8957-32D5CC76171B}.Debug Dynamic Linkage.Build.0 = Debug Dynamic Linkage|Win32 
    10161    {BA246C01-063A-4548-8957-32D5CC76171B}.Release.ActiveCfg = Release|Win32 
    10262    {BA246C01-063A-4548-8957-32D5CC76171B}.Release.Build.0 = Release|Win32 
    103     {BA246C01-063A-4548-8957-32D5CC76171B}.Release Dynamic Linkage.ActiveCfg = Dynamic Linkage|Win32 
    104     {BA246C01-063A-4548-8957-32D5CC76171B}.Release Dynamic Linkage.Build.0 = Dynamic Linkage|Win32 
    105     {BA246C01-063A-4548-8957-32D5CC76171B}.Release M$ STL.ActiveCfg = Release|Win32 
    106     {BA246C01-063A-4548-8957-32D5CC76171B}.Release M$ STL.Build.0 = Release|Win32 
    107     {E6E588AB-EFEF-481C-9AF7-DCDCB95CFF45}.Debug.ActiveCfg = Debug|Win32 
    108     {E6E588AB-EFEF-481C-9AF7-DCDCB95CFF45}.Debug.Build.0 = Debug|Win32 
    109     {E6E588AB-EFEF-481C-9AF7-DCDCB95CFF45}.Debug Dynamic Linkage.ActiveCfg = Debug Dynamic Linkage|Win32 
    110     {E6E588AB-EFEF-481C-9AF7-DCDCB95CFF45}.Debug Dynamic Linkage.Build.0 = Debug Dynamic Linkage|Win32 
    111     {E6E588AB-EFEF-481C-9AF7-DCDCB95CFF45}.Release.ActiveCfg = Release|Win32 
    112     {E6E588AB-EFEF-481C-9AF7-DCDCB95CFF45}.Release.Build.0 = Release|Win32 
    113     {E6E588AB-EFEF-481C-9AF7-DCDCB95CFF45}.Release Dynamic Linkage.ActiveCfg = Dynamic Linkage|Win32 
    114     {E6E588AB-EFEF-481C-9AF7-DCDCB95CFF45}.Release Dynamic Linkage.Build.0 = Dynamic Linkage|Win32 
    115     {E6E588AB-EFEF-481C-9AF7-DCDCB95CFF45}.Release M$ STL.ActiveCfg = Release|Win32 
    116     {E6E588AB-EFEF-481C-9AF7-DCDCB95CFF45}.Release M$ STL.Build.0 = Release|Win32 
     63    {E6E588AB-EFEF-481C-9AF7-DCDCB95CFF45}.Debug.ActiveCfg = Debug Dynamic Linkage|Win32 
     64    {E6E588AB-EFEF-481C-9AF7-DCDCB95CFF45}.Debug.Build.0 = Debug Dynamic Linkage|Win32 
     65    {E6E588AB-EFEF-481C-9AF7-DCDCB95CFF45}.Release.ActiveCfg = Dynamic Linkage|Win32 
     66    {E6E588AB-EFEF-481C-9AF7-DCDCB95CFF45}.Release.Build.0 = Dynamic Linkage|Win32 
     67    {2FF60AF6-09AA-49AB-B414-2E8FD01655C6}.Debug.ActiveCfg = Debug|Win32 
     68    {2FF60AF6-09AA-49AB-B414-2E8FD01655C6}.Debug.Build.0 = Debug|Win32 
     69    {2FF60AF6-09AA-49AB-B414-2E8FD01655C6}.Release.ActiveCfg = Release|Win32 
     70    {2FF60AF6-09AA-49AB-B414-2E8FD01655C6}.Release.Build.0 = Release|Win32 
     71    {08D6246D-1B4A-47A3-965D-296DCC54A4E8}.Debug.ActiveCfg = Debug|Win32 
     72    {08D6246D-1B4A-47A3-965D-296DCC54A4E8}.Debug.Build.0 = Debug|Win32 
     73    {08D6246D-1B4A-47A3-965D-296DCC54A4E8}.Release.ActiveCfg = Release|Win32 
     74    {08D6246D-1B4A-47A3-965D-296DCC54A4E8}.Release.Build.0 = Release|Win32 
    11775  EndGlobalSection 
    11876  GlobalSection(ExtensibilityGlobals) = postSolution 
  • NSClient++.vcproj

    r8223547 r2a94f3f  
    1616    <Configuration 
    1717      Name="Release|Win32" 
    18       OutputDirectory=".\Release" 
    19       IntermediateDirectory=".\Release" 
    20       ConfigurationType="1" 
    21       UseOfMFC="0" 
    22       ATLMinimizesCRunTimeLibraryUsage="FALSE" 
    23       CharacterSet="2"> 
    24       <Tool 
    25         Name="VCCLCompilerTool" 
    26         Optimization="2" 
    27         InlineFunctionExpansion="1" 
    28         AdditionalIncludeDirectories="include" 
    29         PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE" 
    30         StringPooling="TRUE" 
    31         RuntimeLibrary="0" 
    32         EnableFunctionLevelLinking="TRUE" 
    33         UsePrecompiledHeader="3" 
    34         PrecompiledHeaderThrough="stdafx.h" 
    35         PrecompiledHeaderFile=".\Release/IconService.pch" 
    36         AssemblerListingLocation=".\Release/" 
    37         ObjectFile=".\Release/" 
    38         ProgramDataBaseFileName=".\Release/" 
    39         WarningLevel="3" 
    40         SuppressStartupBanner="TRUE"/> 
    41       <Tool 
    42         Name="VCCustomBuildTool"/> 
    43       <Tool 
    44         Name="VCLinkerTool" 
    45         AdditionalDependencies="kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ws2_32.lib" 
    46         OutputFile=".\Release/NSClient++.exe" 
    47         LinkIncremental="1" 
    48         SuppressStartupBanner="TRUE" 
    49         IgnoreAllDefaultLibraries="FALSE" 
    50         IgnoreDefaultLibraryNames="" 
    51         ModuleDefinitionFile="" 
    52         ProgramDatabaseFile=".\Release/IconService.pdb" 
    53         SubSystem="1" 
    54         OptimizeForWindows98="1" 
    55         TargetMachine="1"/> 
    56       <Tool 
    57         Name="VCMIDLTool" 
    58         TypeLibraryName=".\Release/IconService.tlb" 
    59         HeaderFileName=""/> 
    60       <Tool 
    61         Name="VCPostBuildEventTool"/> 
    62       <Tool 
    63         Name="VCPreBuildEventTool"/> 
    64       <Tool 
    65         Name="VCPreLinkEventTool"/> 
    66       <Tool 
    67         Name="VCResourceCompilerTool" 
    68         PreprocessorDefinitions="NDEBUG" 
    69         Culture="1036" 
    70         AdditionalIncludeDirectories="./res/"/> 
    71       <Tool 
    72         Name="VCWebServiceProxyGeneratorTool"/> 
    73       <Tool 
    74         Name="VCXMLDataGeneratorTool"/> 
    75       <Tool 
    76         Name="VCWebDeploymentTool"/> 
    77       <Tool 
    78         Name="VCManagedWrapperGeneratorTool"/> 
    79       <Tool 
    80         Name="VCAuxiliaryManagedWrapperGeneratorTool"/> 
    81     </Configuration> 
    82     <Configuration 
    83       Name="Debug|Win32" 
    84       OutputDirectory=".\Debug" 
    85       IntermediateDirectory=".\Debug" 
    86       ConfigurationType="1" 
    87       UseOfMFC="0" 
    88       ATLMinimizesCRunTimeLibraryUsage="FALSE" 
    89       CharacterSet="2"> 
    90       <Tool 
    91         Name="VCCLCompilerTool" 
    92         Optimization="0" 
    93         AdditionalIncludeDirectories="include" 
    94         PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_STLP_USE_STATIC_LIB;_STLP_USE_MALLOC" 
    95         BasicRuntimeChecks="3" 
    96         RuntimeLibrary="1" 
    97         UsePrecompiledHeader="3" 
    98         PrecompiledHeaderThrough="stdafx.h" 
    99         PrecompiledHeaderFile=".\Debug/IconService.pch" 
    100         AssemblerListingLocation=".\Debug/" 
    101         ObjectFile=".\Debug/" 
    102         ProgramDataBaseFileName=".\Debug/" 
    103         WarningLevel="3" 
    104         SuppressStartupBanner="TRUE" 
    105         DebugInformationFormat="4"/> 
    106       <Tool 
    107         Name="VCCustomBuildTool"/> 
    108       <Tool 
    109         Name="VCLinkerTool" 
    110         AdditionalDependencies="kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ws2_32.lib" 
    111         OutputFile=".\Debug/NSClient++.exe" 
    112         LinkIncremental="1" 
    113         SuppressStartupBanner="TRUE" 
    114         ModuleDefinitionFile="" 
    115         GenerateDebugInformation="TRUE" 
    116         ProgramDatabaseFile=".\Debug/IconService.pdb" 
    117         SubSystem="1" 
    118         TargetMachine="1"/> 
    119       <Tool 
    120         Name="VCMIDLTool" 
    121         TypeLibraryName=".\Debug/IconService.tlb" 
    122         HeaderFileName=""/> 
    123       <Tool 
    124         Name="VCPostBuildEventTool"/> 
    125       <Tool 
    126         Name="VCPreBuildEventTool"/> 
    127       <Tool 
    128         Name="VCPreLinkEventTool"/> 
    129       <Tool 
    130         Name="VCResourceCompilerTool" 
    131         PreprocessorDefinitions="_DEBUG" 
    132         Culture="1036" 
    133         AdditionalIncludeDirectories="./res/"/> 
    134       <Tool 
    135         Name="VCWebServiceProxyGeneratorTool"/> 
    136       <Tool 
    137         Name="VCXMLDataGeneratorTool"/> 
    138       <Tool 
    139         Name="VCWebDeploymentTool"/> 
    140       <Tool 
    141         Name="VCManagedWrapperGeneratorTool"/> 
    142       <Tool 
    143         Name="VCAuxiliaryManagedWrapperGeneratorTool"/> 
    144     </Configuration> 
    145     <Configuration 
    146       Name="Release M$ STL|Win32" 
    14718      OutputDirectory="$(ConfigurationName)" 
    14819      IntermediateDirectory="$(ConfigurationName)" 
     
    17243      <Tool 
    17344        Name="VCLinkerTool" 
    174         AdditionalDependencies="kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ws2_32.lib pdh.lib" 
    175         OutputFile=".\Release/NSClient++.exe" 
    176         LinkIncremental="1" 
    177         SuppressStartupBanner="TRUE" 
    178         IgnoreAllDefaultLibraries="FALSE" 
    179         IgnoreDefaultLibraryNames="" 
    180         ModuleDefinitionFile="" 
    181         ProgramDatabaseFile=".\Release/IconService.pdb" 
    182         SubSystem="1" 
    183         OptimizeForWindows98="1" 
    184         TargetMachine="1"/> 
    185       <Tool 
    186         Name="VCMIDLTool" 
    187         TypeLibraryName=".\Release/IconService.tlb" 
    188         HeaderFileName=""/> 
    189       <Tool 
    190         Name="VCPostBuildEventTool"/> 
    191       <Tool 
    192         Name="VCPreBuildEventTool"/> 
    193       <Tool 
    194         Name="VCPreLinkEventTool"/> 
    195       <Tool 
    196         Name="VCResourceCompilerTool" 
    197         PreprocessorDefinitions="NDEBUG" 
    198         Culture="1036" 
    199         AdditionalIncludeDirectories="./res/"/> 
    200       <Tool 
    201         Name="VCWebServiceProxyGeneratorTool"/> 
    202       <Tool 
    203         Name="VCXMLDataGeneratorTool"/> 
    204       <Tool 
    205         Name="VCWebDeploymentTool"/> 
    206       <Tool 
    207         Name="VCManagedWrapperGeneratorTool"/> 
    208       <Tool 
    209         Name="VCAuxiliaryManagedWrapperGeneratorTool"/> 
    210     </Configuration> 
    211     <Configuration 
    212       Name="Dynamic Linkage|Win32" 
    213       OutputDirectory="$(ConfigurationName)" 
    214       IntermediateDirectory="$(ConfigurationName)" 
    215       ConfigurationType="1" 
    216       UseOfMFC="0" 
    217       ATLMinimizesCRunTimeLibraryUsage="FALSE" 
    218       CharacterSet="2"> 
    219       <Tool 
    220         Name="VCCLCompilerTool" 
    221         Optimization="2" 
    222         InlineFunctionExpansion="1" 
    223         AdditionalIncludeDirectories="include" 
    224         PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE" 
    225         StringPooling="TRUE" 
    226         RuntimeLibrary="2" 
    227         EnableFunctionLevelLinking="TRUE" 
    228         UsePrecompiledHeader="3" 
    229         PrecompiledHeaderThrough="stdafx.h" 
    230         PrecompiledHeaderFile=".\Release/IconService.pch" 
    231         AssemblerListingLocation=".\Release/" 
    232         ObjectFile=".\Release/" 
    233         ProgramDataBaseFileName=".\Release/" 
    234         WarningLevel="3" 
    235         SuppressStartupBanner="TRUE"/> 
    236       <Tool 
    237         Name="VCCustomBuildTool"/> 
    238       <Tool 
    239         Name="VCLinkerTool" 
    24045        AdditionalDependencies="kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ws2_32.lib" 
    24146        OutputFile=".\Release/NSClient++.exe" 
     
    27681    </Configuration> 
    27782    <Configuration 
    278       Name="Debug Dynamic Linkage|Win32" 
     83      Name="Debug|Win32" 
    27984      OutputDirectory="$(ConfigurationName)" 
    28085      IntermediateDirectory="$(ConfigurationName)" 
     
    379184            UsePrecompiledHeader="1"/> 
    380185        </FileConfiguration> 
    381         <FileConfiguration 
    382           Name="Release M$ STL|Win32"> 
    383           <Tool 
    384             Name="VCCLCompilerTool" 
    385             Optimization="2" 
    386             PreprocessorDefinitions="" 
    387             UsePrecompiledHeader="1"/> 
    388         </FileConfiguration> 
    389         <FileConfiguration 
    390           Name="Dynamic Linkage|Win32"> 
    391           <Tool 
    392             Name="VCCLCompilerTool" 
    393             Optimization="2" 
    394             PreprocessorDefinitions="" 
    395             UsePrecompiledHeader="1"/> 
    396         </FileConfiguration> 
    397         <FileConfiguration 
    398           Name="Debug Dynamic Linkage|Win32"> 
    399           <Tool 
    400             Name="VCCLCompilerTool" 
    401             Optimization="0" 
    402             PreprocessorDefinitions="" 
    403             BasicRuntimeChecks="3" 
    404             UsePrecompiledHeader="1"/> 
    405         </FileConfiguration> 
    406       </File> 
    407       <File 
    408         RelativePath=".\TCPSocketResponder.cpp"> 
    409186      </File> 
    410187    </Filter> 
     
    441218      <File 
    442219        RelativePath="StdAfx.h"> 
    443       </File> 
    444       <File 
    445         RelativePath=".\TCPSocketResponder.h"> 
    446220      </File> 
    447221      <File 
     
    477251"/> 
    478252        </FileConfiguration> 
    479         <FileConfiguration 
    480           Name="Dynamic Linkage|Win32"> 
    481           <Tool 
    482             Name="VCCustomBuildTool" 
    483             CommandLine="doxygen.exe $(InputPath) 
    484 " 
    485             Outputs=".\Doc"/> 
    486         </FileConfiguration> 
    487         <FileConfiguration 
    488           Name="Debug Dynamic Linkage|Win32" 
     253      </File> 
     254      <File 
     255        RelativePath=".\Doc\html\index.html"> 
     256      </File> 
     257      <File 
     258        RelativePath=".\NSC.ini"> 
     259        <FileConfiguration 
     260          Name="Release|Win32" 
    489261          ExcludedFromBuild="TRUE"> 
    490           <Tool 
    491             Name="VCCustomBuildTool" 
    492             CommandLine="doxygen.exe $(InputPath) 
    493 "/> 
    494         </FileConfiguration> 
    495       </File> 
    496       <File 
    497         RelativePath=".\Doc\html\index.html"> 
    498       </File> 
    499       <File 
    500         RelativePath=".\NSC.ini"> 
    501         <FileConfiguration 
    502           Name="Release|Win32"> 
    503262          <Tool 
    504263            Name="VCCustomBuildTool" 
     
    509268        </FileConfiguration> 
    510269        <FileConfiguration 
    511           Name="Debug|Win32"> 
    512           <Tool 
    513             Name="VCCustomBuildTool" 
    514             CommandLine="copy $(InputPath) $(OutDir)\$(InputFileName) 
    515 " 
    516             Outputs="$(OutDir)\$(InputFileName)"/> 
    517         </FileConfiguration> 
    518         <FileConfiguration 
    519           Name="Release M$ STL|Win32"> 
    520           <Tool 
    521             Name="VCCustomBuildTool" 
    522             CommandLine="copy $(InputPath) $(OutDir)\$(InputFileName) 
    523 " 
    524             Outputs="$(OutDir)\$(InputFileName)"/> 
    525         </FileConfiguration> 
    526         <FileConfiguration 
    527           Name="Dynamic Linkage|Win32" 
    528           ExcludedFromBuild="TRUE"> 
    529           <Tool 
    530             Name="VCCustomBuildTool" 
    531             CommandLine="copy $(InputPath) $(OutDir)\$(InputFileName) 
    532 " 
    533             AdditionalDependencies="" 
    534             Outputs="$(OutDir)\$(InputFileName)"/> 
    535         </FileConfiguration> 
    536         <FileConfiguration 
    537           Name="Debug Dynamic Linkage|Win32" 
     270          Name="Debug|Win32" 
    538271          ExcludedFromBuild="TRUE"> 
    539272          <Tool 
  • changelog

    r8223547 r2a94f3f  
     12005-03-19 MickeM 
     2 * Refactored out NSCLient Listener as a separate module 
     3 * Added initial NRPE listener module (not yet implemented only a shell) 
     4 * Changed Module API (Inject function has new syntax) 
     5 * Added some tokenizer function to charEx 
     6 * Added new wrapper function to inject Command 
     7 * Minor changes in relation to refactor work 
     8 
    192005-03-01 MickeM 
    210 * Improved thread safety in Core 
     
    12202005-02-17 MickeM 
    1321 * NSClient issues fixed 
    14  * Systray issues fixed 
     22 * System Tray issues fixed 
    1523 
    16242005-02-14 MickeM 
    17  * Initial sourceforge release 
     25 * Initial SourceForge release 
  • config.h

    r8223547 r2a94f3f  
    2121#define RECV_BUFFER_LEN   1024 
    2222 
    23 #define DEFAULT_TCP_PORT 12489 
  • include/NSCAPI.h

    r36c340d r2a94f3f  
    1515  const int istrue = 1;     // Should be interpreted as "true" 
    1616  const int isfalse = 0;      // Should be interpreted as "false" 
     17  const int isError = -1;     // Should be interpreted as "ERROR" 
    1718  const int handled = 2;      // The command was handled by this module 
    18   const int invalidBufferLen = -1;// The return buffer was to small (might wanna call again with a larger one) 
     19  const int invalidBufferLen = -2;// The return buffer was to small (might wanna call again with a larger one) 
    1920 
    2021  // Various message Types 
  • include/NSCHelper.cpp

    r8223547 r2a94f3f  
    4646 */ 
    4747char ** NSCHelper::list2arrayBuffer(const std::list<std::string> lst, unsigned int &argLen) { 
    48   std::string ret; 
    4948  argLen = static_cast<unsigned int>(lst.size()); 
    5049  char **arrayBuffer = new char*[argLen]; 
     
    5857  return arrayBuffer; 
    5958} 
     59/** 
     60 * Creates an empty arrayBuffer (only used to allow consistency) 
     61 * @param &argLen [OUT] The length (items) of the arrayBuffer 
     62 * @return The arrayBuffer 
     63 */ 
     64char ** NSCHelper::createEmptyArrayBuffer(unsigned int &argLen) { 
     65  argLen = 0; 
     66  char **arrayBuffer = new char*[0]; 
     67  return arrayBuffer; 
     68} 
     69/** 
     70 * Joins an arrayBuffer back into a string 
     71 * @param **argument The ArrayBuffer 
     72 * @param argLen The length of the ArrayBuffer 
     73 * @param join The char to use as separators when joining 
     74 * @return The joined arrayBuffer 
     75 */ 
     76std::string NSCHelper::arrayBuffer2string(char **argument, const unsigned int argLen, std::string join) { 
     77  std::string ret; 
     78  for (unsigned int i=0;i<argLen;i++) { 
     79    ret += argument[i]; 
     80    if (i != argLen-1) 
     81      ret += join; 
     82  } 
     83  return ret; 
     84} 
     85/** 
     86 * Split a string into elements as an arrayBuffer 
     87 * @param buffer The CharArray to split along 
     88 * @param splitChar The char to use as splitter 
     89 * @param &argLen [OUT] The length of the Array 
     90 * @return The arrayBuffer 
     91 */ 
     92char ** NSCHelper::split2arrayBuffer(const char* buffer, char splitChar, unsigned int &argLen) { 
     93  assert(buffer); 
     94  argLen = 0; 
     95  const char *p = buffer; 
     96  while (*p) { 
     97    if (*p == splitChar) 
     98      argLen++; 
     99    p++; 
     100  } 
     101  argLen++; 
     102  char **arrayBuffer = new char*[argLen]; 
     103  p = buffer; 
     104  for (unsigned int i=0;i<argLen;i++) { 
     105    char *q = strchr(p, (i<argLen-1)?splitChar:0); 
     106    unsigned int len = q-p; 
     107    arrayBuffer[i] = new char[len+1]; 
     108    strncpy(arrayBuffer[i], p, len); 
     109    arrayBuffer[i][len] = 0; 
     110    p = ++q; 
     111  } 
     112  return arrayBuffer; 
     113} 
     114 
    60115/** 
    61116 * Destroy an arrayBuffer. 
     
    140195 * @param command Command to inject (password should not be included. 
    141196 * @return The result (if any) of the command. 
    142  * @throws NSCMHExcpetion When core pointer set is unavailable or an unknown inject error occures. 
    143  */ 
    144 std::string NSCModuleHelper::InjectCommand(std::string command) { 
     197 * @throws NSCMHExcpetion When core pointer set is unavailable or an unknown inject error occurs. 
     198 */ 
     199int NSCModuleHelper::InjectCommandRAW(const char* command, const unsigned int argLen, char **argument, char *returnBuffer, unsigned int returnBufferLen)  
     200{ 
    145201  if (!fNSAPIInject) 
    146202    throw NSCMHExcpetion("NSCore has not been initiated..."); 
     203  return fNSAPIInject(command, argLen, argument, returnBuffer, returnBufferLen); 
     204} 
     205std::string NSCModuleHelper::InjectCommand(const char* command, const unsigned int argLen, char **argument)  
     206{ 
     207  if (!fNSAPIInject) 
     208    throw NSCMHExcpetion("NSCore has not been initiated..."); 
    147209  char *buffer = new char[BUFF_LEN+1]; 
     210  buffer[0] = 0; 
    148211  std::string ret; 
    149212  int err; 
    150   if ((err = fNSAPIInject(command.c_str(), buffer, BUFF_LEN)) != NSCAPI::success) { 
     213  if ((err = InjectCommandRAW(command, argLen, argument, buffer, BUFF_LEN)) != NSCAPI::handled) { 
    151214    if (err == NSCAPI::invalidBufferLen) 
    152215      NSC_LOG_ERROR("Inject command resulted in an invalid buffer size."); 
     216    else if (err == NSCAPI::isfalse) 
     217      NSC_LOG_MESSAGE("No handler for this message."); 
    153218    else 
    154219      throw NSCMHExcpetion("Unknown inject error."); 
     
    158223  delete [] buffer; 
    159224  return ret; 
     225} 
     226/** 
     227 * A wrapper around the InjetCommand that is simpler to use. 
     228 * Parses a string by splitting and makes the array and also manages return buffers and such. 
     229 * @param command The command to execute 
     230 * @param buffer The buffer to splitwww.ikea.se 
     231 
     232 * @param splitChar The char to use as splitter 
     233 * @return The result of the command 
     234 */ 
     235std::string NSCModuleHelper::InjectSplitAndCommand(const char* command, char* buffer, char splitChar) 
     236{ 
     237  if (!fNSAPIInject) 
     238    throw NSCMHExcpetion("NSCore has not been initiated..."); 
     239  unsigned int argLen = 0; 
     240  char ** aBuffer; 
     241  if (buffer) 
     242    aBuffer= NSCHelper::split2arrayBuffer(buffer, splitChar, argLen); 
     243  else 
     244    aBuffer= NSCHelper::createEmptyArrayBuffer(argLen); 
     245  std::string s = InjectCommand(command, argLen, aBuffer); 
     246  NSCHelper::destroyArrayBuffer(aBuffer, argLen); 
     247  return s; 
    160248} 
    161249/** 
  • include/NSCHelper.h

    r8223547 r2a94f3f  
    44#include <list> 
    55#include <NSCAPI.h> 
     6#include <iostream> 
     7#include <charEx.h> 
    68 
    79namespace NSCHelper 
     
    1113  std::list<std::string> arrayBuffer2list(const unsigned int argLen, char **argument); 
    1214  char ** list2arrayBuffer(const std::list<std::string> lst, unsigned int &argLen); 
     15  char ** split2arrayBuffer(const char* buffer, char splitChar, unsigned int &argLen); 
     16  std::string arrayBuffer2string(char **argument, const unsigned int argLen, std::string join); 
     17  char ** createEmptyArrayBuffer(unsigned int &argLen); 
    1318  void destroyArrayBuffer(char **argument, const unsigned int argLen); 
    1419 
     
    4449      return max (a, b); 
    4550  } 
    46   @bug Use this sceme instead!! 
     51  @bug Use this scheme instead!! 
    4752*/ 
    4853 
     
    8388  typedef void (*lpNSAPIMessage)(int, const char*, const int, const char*); 
    8489  typedef int (*lpNSAPIStopServer)(void); 
    85   typedef int (*lpNSAPIInject)(const char*,char*,unsigned int); 
     90  typedef int (*lpNSAPIInject)(const char*, const unsigned int, char **, char *, unsigned int ); 
    8691  typedef LPVOID (*lpNSAPILoader)(char*); 
    8792 
     
    9297  int getSettingsInt(std::string section, std::string key, int defaultValue); 
    9398  void Message(int msgType, std::string file, int line, std::string message); 
    94   std::string InjectCommand(std::string command); 
     99  int InjectCommandRAW(const char* command, const unsigned int argLen, char **argument, char *returnBuffer, unsigned int returnBufferLen); 
     100  std::string InjectCommand(const char* command, const unsigned int argLen, char **argument); 
     101  std::string InjectSplitAndCommand(const char* command, char* buffer, char splitChar = '&'); 
    95102  void StopService(void); 
    96103  std::string getBasePath(); 
     
    153160#define NSC_WRAPPERS_MAIN_DEF(toObject) \ 
    154161  extern int NSModuleHelperInit(NSCModuleHelper::lpNSAPILoader f) { \ 
    155   return NSCModuleWrapper::wrapModuleHelperInit(f); \ 
     162    return NSCModuleWrapper::wrapModuleHelperInit(f); \ 
    156163  } \ 
    157164  extern int NSLoadModule() { \ 
    158   return NSCModuleWrapper::wrapLoadModule(toObject.loadModule()); \ 
     165    return NSCModuleWrapper::wrapLoadModule(toObject.loadModule()); \ 
    159166  } \ 
    160167  extern int NSGetModuleName(char* buf, int buflen) { \ 
    161   return NSCModuleWrapper::wrapGetModuleName(buf, buflen, toObject.getModuleName()); \ 
     168    return NSCModuleWrapper::wrapGetModuleName(buf, buflen, toObject.getModuleName()); \ 
    162169  } \ 
    163170  extern int NSGetModuleVersion(int *major, int *minor, int *revision) { \ 
    164   return NSCModuleWrapper::wrapGetModuleVersion(major, minor, revision, toObject.getModuleVersion()); \ 
    165   } \ 
    166   extern int NSHasCommandHandler() { \ 
    167   return NSCModuleWrapper::wrapHasCommandHandler(toObject.hasCommandHandler()); \ 
    168   } \ 
    169   extern int NSHasMessageHandler() { \ 
    170   return NSCModuleWrapper::wrapHasMessageHandler(toObject.hasMessageHandler()); \ 
     171    return NSCModuleWrapper::wrapGetModuleVersion(major, minor, revision, toObject.getModuleVersion()); \ 
    171172  } \ 
    172173  extern int NSUnloadModule() { \ 
    173   return NSCModuleWrapper::wrapUnloadModule(toObject.unloadModule()); \ 
     174    return NSCModuleWrapper::wrapUnloadModule(toObject.unloadModule()); \ 
    174175  } 
    175176#define NSC_WRAPPERS_HANDLE_MSG_DEF(toObject) \ 
    176177  extern void NSHandleMessage(int msgType, char* file, int line, char* message) { \ 
    177   toObject.handleMessage(msgType, file, line, message); \ 
     178    toObject.handleMessage(msgType, file, line, message); \ 
     179  } \ 
     180  extern int NSHasMessageHandler() { \ 
     181    return NSCModuleWrapper::wrapHasMessageHandler(toObject.hasMessageHandler()); \ 
    178182  } 
    179183#define NSC_WRAPPERS_IGNORE_MSG_DEF() \ 
    180   extern void NSHandleMessage(int msgType, char* file, int line, char* message) { \ 
    181   } 
     184  extern void NSHandleMessage(int msgType, char* file, int line, char* message) {} \ 
     185  extern int NSHasMessageHandler() { return NSCAPI::isfalse; } 
    182186#define NSC_WRAPPERS_HANDLE_CMD_DEF(toObject) \ 
    183187  extern int NSHandleCommand(const char* command, const unsigned int argLen, char **argument, char *returnBuffer, unsigned int returnBufferLen) { \ 
    184188    return NSCModuleWrapper::wrapHandleCommand(toObject.handleCommand(command, argLen, argument), returnBuffer, returnBufferLen); \ 
     189  } \ 
     190  extern int NSHasCommandHandler() { \ 
     191    return NSCModuleWrapper::wrapHasCommandHandler(toObject.hasCommandHandler()); \ 
    185192  } 
    186193#define NSC_WRAPPERS_IGNORE_CMD_DEF() \ 
    187194  extern int NSHandleCommand(const char* command, const unsigned int argLen, char **argument, char *returnBuffer, unsigned int returnBufferLen) { \ 
    188   return NSCAPI::failed; \ 
    189   } 
    190 #define NSC_LOG_DEBUG(str) \ 
    191   NSCHelper::DebugMessage(__FILE__, __LINE__, str); 
     195    return NSCAPI::failed; \ 
     196  } \ 
     197  extern int NSHasCommandHandler() { return NSCAPI::isfalse; } 
  • include/charEx.h

    ra0528c4 r2a94f3f  
    11#pragma once 
    2  
     2#include <assert.h> 
    33 
    44namespace charEx { 
     
    2222    return ret; 
    2323  } 
     24  typedef std::pair<std::string,char*> token; 
     25  inline token getToken(char *buffer, char split) { 
     26    assert(buffer != NULL); 
     27    char *p = strchr(buffer, split); 
     28    if (!p) { 
     29      return token(buffer, NULL); 
     30    } 
     31    p++; 
     32    return token(std::string(buffer, p-buffer-1), p); 
     33  } 
    2434}; 
  • modules/CheckEventLog/CheckEventLog.vcproj

    r8223547 r2a94f3f  
    1212  <Configurations> 
    1313    <Configuration 
    14       Name="Debug|Win32" 
    15       OutputDirectory="Debug" 
    16       IntermediateDirectory="Debug" 
    17       ConfigurationType="2" 
    18       CharacterSet="2"> 
    19       <Tool 
    20         Name="VCCLCompilerTool" 
    21         Optimization="0" 
    22         AdditionalIncludeDirectories="../include;../../include" 
    23         PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_STLP_USE_STATIC_LIB;_STLP_USE_NEWALLOC,_STLP_DEBUG" 
    24         MinimalRebuild="TRUE" 
    25         BasicRuntimeChecks="3" 
    26         RuntimeLibrary="1" 
    27         UsePrecompiledHeader="3" 
    28         WarningLevel="3" 
    29         Detect64BitPortabilityProblems="TRUE" 
    30         DebugInformationFormat="4"/> 
    31       <Tool 
    32         Name="VCCustomBuildTool"/> 
    33       <Tool 
    34         Name="VCLinkerTool" 
    35         OutputFile="../../Debug/modules/$(ProjectName).dll" 
    36         LinkIncremental="2" 
    37         ModuleDefinitionFile="CheckEventLog.def" 
    38         GenerateDebugInformation="TRUE" 
    39         ProgramDatabaseFile="$(OutDir)/CheckEventLog.pdb" 
    40         SubSystem="2" 
    41         ImportLibrary="$(OutDir)/CheckEventLog.lib" 
    42         TargetMachine="1"/> 
    43       <Tool 
    44         Name="VCMIDLTool"/> 
    45       <Tool 
    46         Name="VCPostBuildEventTool"/> 
    47       <Tool 
    48         Name="VCPreBuildEventTool"/> 
    49       <Tool 
    50         Name="VCPreLinkEventTool"/> 
    51       <Tool 
    52         Name="VCResourceCompilerTool"/> 
    53       <Tool 
    54         Name="VCWebServiceProxyGeneratorTool"/> 
    55       <Tool 
    56         Name="VCXMLDataGeneratorTool"/> 
    57       <Tool 
    58         Name="VCWebDeploymentTool"/> 
    59       <Tool 
    60         Name="VCManagedWrapperGeneratorTool"/> 
    61       <Tool 
    62         Name="VCAuxiliaryManagedWrapperGeneratorTool"/> 
    63     </Configuration> 
    64     <Configuration 
    6514      Name="Release|Win32" 
    66       OutputDirectory="Release" 
    67       IntermediateDirectory="Release" 
    68       ConfigurationType="2" 
    69       CharacterSet="2"> 
    70       <Tool 
    71         Name="VCCLCompilerTool" 
    72         AdditionalIncludeDirectories="../include;../../include" 
    73         PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_STLP_USE_STATIC_LIB;SYSTRAY_EXPORTS" 
    74         RuntimeLibrary="0" 
    75         UsePrecompiledHeader="3" 
    76         WarningLevel="3" 
    77         Detect64BitPortabilityProblems="TRUE" 
    78         DebugInformationFormat="3"/> 
    79       <Tool 
    80         Name="VCCustomBuildTool"/> 
    81       <Tool 
    82         Name="VCLinkerTool" 
    83         OutputFile="../../Release/modules/$(ProjectName).dll" 
    84         LinkIncremental="1" 
    85         ModuleDefinitionFile="CheckEventLog.def" 
    86         GenerateDebugInformation="TRUE" 
    87         SubSystem="2" 
    88         OptimizeReferences="2" 
    89         EnableCOMDATFolding="2" 
    90         ImportLibrary="$(OutDir)/CheckEventLog.lib" 
    91         TargetMachine="1"/> 
    92       <Tool 
    93         Name="VCMIDLTool"/> 
    94       <Tool 
    95         Name="VCPostBuildEventTool"/> 
    96       <Tool 
    97         Name="VCPreBuildEventTool"/> 
    98       <Tool 
    99         Name="VCPreLinkEventTool"/> 
    100       <Tool 
    101         Name="VCResourceCompilerTool"/> 
    102       <Tool 
    103         Name="VCWebServiceProxyGeneratorTool"/> 
    104       <Tool 
    105         Name="VCXMLDataGeneratorTool"/> 
    106       <Tool 
    107         Name="VCWebDeploymentTool"/> 
    108       <Tool 
    109         Name="VCManagedWrapperGeneratorTool"/> 
    110       <Tool 
    111         Name="VCAuxiliaryManagedWrapperGeneratorTool"/> 
    112     </Configuration> 
    113     <Configuration 
    114       Name="Dynamic Linkage|Win32" 
    11515      OutputDirectory="$(ConfigurationName)" 
    11616      IntermediateDirectory="$(ConfigurationName)" 
     
    16262    </Configuration> 
    16363    <Configuration 
    164       Name="Debug Dynamic Linkage|Win32" 
     64      Name="Debug|Win32" 
    16565      OutputDirectory="$(ConfigurationName)" 
    16666      IntermediateDirectory="$(ConfigurationName)" 
     
    230130        RelativePath=".\stdafx.cpp"> 
    231131        <FileConfiguration 
    232           Name="Debug|Win32"> 
    233           <Tool 
    234             Name="VCCLCompilerTool" 
    235             UsePrecompiledHeader="1"/> 
    236         </FileConfiguration> 
    237         <FileConfiguration 
    238132          Name="Release|Win32"> 
    239133          <Tool 
     
    242136        </FileConfiguration> 
    243137        <FileConfiguration 
    244           Name="Dynamic Linkage|Win32"> 
    245           <Tool 
    246             Name="VCCLCompilerTool" 
    247             UsePrecompiledHeader="1"/> 
    248         </FileConfiguration> 
    249         <FileConfiguration 
    250           Name="Debug Dynamic Linkage|Win32"> 
     138          Name="Debug|Win32"> 
    251139          <Tool 
    252140            Name="VCCLCompilerTool" 
  • modules/ConsoleLogger/ConsoleLogger.vcproj

    r36c340d r2a94f3f  
    1212  <Configurations> 
    1313    <Configuration 
    14       Name="Debug|Win32" 
    15       OutputDirectory="Debug" 
    16       IntermediateDirectory="Debug" 
    17       ConfigurationType="2" 
    18       CharacterSet="2"> 
    19       <Tool 
    20         Name="VCCLCompilerTool" 
    21         Optimization="0" 
    22         AdditionalIncludeDirectories="../include;../../include" 
    23         PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_STLP_USE_STATIC_LIB;_STLP_USE_MALLOC" 
    24         MinimalRebuild="TRUE" 
    25         BasicRuntimeChecks="3" 
    26         RuntimeLibrary="1" 
    27         UsePrecompiledHeader="3" 
    28         WarningLevel="3" 
    29         Detect64BitPortabilityProblems="TRUE" 
    30         DebugInformationFormat="4"/> 
    31       <Tool 
    32         Name="VCCustomBuildTool"/> 
    33       <Tool 
    34         Name="VCLinkerTool" 
    35         OutputFile="../../Debug/modules/$(ProjectName).dll" 
    36         LinkIncremental="2" 
    37         ModuleDefinitionFile="ConsoleLogger.def" 
    38         GenerateDebugInformation="TRUE" 
    39         ProgramDatabaseFile="$(OutDir)/ConsoleLogger.pdb" 
    40         SubSystem="2" 
    41         ImportLibrary="$(OutDir)/ConsoleLogger.lib" 
    42         TargetMachine="1"/> 
    43       <Tool 
    44         Name="VCMIDLTool"/> 
    45       <Tool 
    46         Name="VCPostBuildEventTool"/> 
    47       <Tool 
    48         Name="VCPreBuildEventTool"/> 
    49       <Tool 
    50         Name="VCPreLinkEventTool"/> 
    51       <Tool 
    52         Name="VCResourceCompilerTool"/> 
    53       <Tool 
    54         Name="VCWebServiceProxyGeneratorTool"/> 
    55       <Tool 
    56         Name="VCXMLDataGeneratorTool"/> 
    57       <Tool 
    58         Name="VCWebDeploymentTool"/> 
    59       <Tool 
    60         Name="VCManagedWrapperGeneratorTool"/> 
    61       <Tool 
    62         Name="VCAuxiliaryManagedWrapperGeneratorTool"/> 
    63     </Configuration> 
    64     <Configuration 
    6514      Name="Release|Win32" 
    66       OutputDirectory="Release" 
    67       IntermediateDirectory="Release" 
    68       ConfigurationType="2" 
    69       CharacterSet="2"> 
    70       <Tool 
    71         Name="VCCLCompilerTool" 
    72         AdditionalIncludeDirectories="../include;../../include" 
    73         PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_STLP_USE_STATIC_LIB;SYSTRAY_EXPORTS" 
    74         RuntimeLibrary="0" 
    75         UsePrecompiledHeader="3" 
    76         WarningLevel="3" 
    77         Detect64BitPortabilityProblems="TRUE" 
    78         DebugInformationFormat="3"/> 
    79       <Tool 
    80         Name="VCCustomBuildTool"/> 
    81       <Tool 
    82         Name="VCLinkerTool" 
    83         OutputFile="../../Release/modules/$(ProjectName).dll" 
    84         LinkIncremental="1" 
    85         ModuleDefinitionFile="ConsoleLogger.def" 
    86         GenerateDebugInformation="TRUE" 
    87         SubSystem="2" 
    88         OptimizeReferences="2" 
    89         EnableCOMDATFolding="2" 
    90         ImportLibrary="$(OutDir)/ConsoleLogger.lib" 
    91         TargetMachine="1"/> 
    92       <Tool 
    93         Name="VCMIDLTool"/> 
    94       <Tool 
    95         Name="VCPostBuildEventTool"/> 
    96       <Tool 
    97         Name="VCPreBuildEventTool"/> 
    98       <Tool 
    99         Name="VCPreLinkEventTool"/> 
    100       <Tool 
    101         Name="VCResourceCompilerTool"/> 
    102       <Tool 
    103         Name="VCWebServiceProxyGeneratorTool"/> 
    104       <Tool 
    105         Name="VCXMLDataGeneratorTool"/> 
    106       <Tool 
    107         Name="VCWebDeploymentTool"/> 
    108       <Tool 
    109         Name="VCManagedWrapperGeneratorTool"/> 
    110       <Tool 
    111         Name="VCAuxiliaryManagedWrapperGeneratorTool"/> 
    112     </Configuration> 
    113     <Configuration 
    114       Name="Dynamic Linkage|Win32" 
    11515      OutputDirectory="$(ConfigurationName)" 
    11616      IntermediateDirectory="$(ConfigurationName)" 
     
    16161    </Configuration> 
    16262    <Configuration 
    163       Name="Debug Dynamic Linkage|Win32" 
     63      Name="Debug|Win32" 
    16464      OutputDirectory="$(ConfigurationName)" 
    16565      IntermediateDirectory="$(ConfigurationName)" 
     
    228128        RelativePath=".\stdafx.cpp"> 
    229129        <FileConfiguration 
    230           Name="Debug|Win32"> 
    231           <Tool 
    232             Name="VCCLCompilerTool" 
    233             UsePrecompiledHeader="1"/> 
    234         </FileConfiguration> 
    235         <FileConfiguration 
    236130          Name="Release|Win32"> 
    237131          <Tool 
     
    240134        </FileConfiguration> 
    241135        <FileConfiguration 
    242           Name="Dynamic Linkage|Win32"> 
    243           <Tool 
    244             Name="VCCLCompilerTool" 
    245             UsePrecompiledHeader="1"/> 
    246         </FileConfiguration> 
    247         <FileConfiguration 
    248           Name="Debug Dynamic Linkage|Win32"> 
     136          Name="Debug|Win32"> 
    249137          <Tool 
    250138            Name="VCCLCompilerTool" 
  • modules/FileLogger/FileLogger.vcproj

    r36c340d r2a94f3f  
    1212  <Configurations> 
    1313    <Configuration 
    14       Name="Debug|Win32" 
    15       OutputDirectory="Debug" 
    16       IntermediateDirectory="Debug" 
    17       ConfigurationType="2" 
    18       CharacterSet="2"> 
    19       <Tool 
    20         Name="VCCLCompilerTool" 
    21         Optimization="0" 
    22         AdditionalIncludeDirectories="../include;../../include" 
    23         PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_STLP_USE_STATIC_LIB;_STLP_USE_MALLOC" 
    24         MinimalRebuild="TRUE" 
    25         BasicRuntimeChecks="3" 
    26         RuntimeLibrary="1" 
    27         UsePrecompiledHeader="3" 
    28         WarningLevel="3" 
    29         Detect64BitPortabilityProblems="TRUE" 
    30         DebugInformationFormat="4"/> 
    31       <Tool 
    32         Name="VCCustomBuildTool"/> 
    33       <Tool 
    34         Name="VCLinkerTool" 
    35         OutputFile="../../Debug/modules/$(ProjectName).dll" 
    36         LinkIncremental="2" 
    37         ModuleDefinitionFile="FileLogger.def" 
    38         GenerateDebugInformation="TRUE" 
    39         ProgramDatabaseFile="$(OutDir)/FileLogger.pdb" 
    40         SubSystem="2" 
    41         ImportLibrary="$(OutDir)/FileLogger.lib" 
    42         TargetMachine="1"/> 
    43       <Tool 
    44         Name="VCMIDLTool"/> 
    45       <Tool 
    46         Name="VCPostBuildEventTool"/> 
    47       <Tool 
    48         Name="VCPreBuildEventTool"/> 
    49       <Tool 
    50         Name="VCPreLinkEventTool"/> 
    51       <Tool 
    52         Name="VCResourceCompilerTool"/> 
    53       <Tool 
    54         Name="VCWebServiceProxyGeneratorTool"/> 
    55       <Tool 
    56         Name="VCXMLDataGeneratorTool"/> 
    57       <Tool 
    58         Name="VCWebDeploymentTool"/> 
    59       <Tool 
    60         Name="VCManagedWrapperGeneratorTool"/> 
    61       <Tool 
    62         Name="VCAuxiliaryManagedWrapperGeneratorTool"/> 
    63     </Configuration> 
    64     <Configuration 
    6514      Name="Release|Win32" 
    66       OutputDirectory="Release" 
    67       IntermediateDirectory="Release" 
    68       ConfigurationType="2" 
    69       CharacterSet="2"> 
    70       <Tool 
    71         Name="VCCLCompilerTool" 
    72         AdditionalIncludeDirectories="../include;../../include" 
    73         PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_STLP_USE_STATIC_LIB;SYSTRAY_EXPORTS" 
    74         RuntimeLibrary="0" 
    75         UsePrecompiledHeader="3" 
    76         WarningLevel="3" 
    77         Detect64BitPortabilityProblems="TRUE" 
    78         DebugInformationFormat="3"/> 
    79       <Tool 
    80         Name="VCCustomBuildTool"/> 
    81       <Tool 
    82         Name="VCLinkerTool" 
    83         OutputFile="../../Release/modules/$(ProjectName).dll" 
    84         LinkIncremental="1" 
    85         ModuleDefinitionFile="FileLogger.def" 
    86         GenerateDebugInformation="TRUE" 
    87         SubSystem="2" 
    88         OptimizeReferences="2" 
    89         EnableCOMDATFolding="2" 
    90         ImportLibrary="$(OutDir)/FileLogger.lib" 
    91         TargetMachine="1"/> 
    92       <Tool 
    93         Name="VCMIDLTool"/> 
    94       <Tool 
    95         Name="VCPostBuildEventTool"/> 
    96       <Tool 
    97         Name="VCPreBuildEventTool"/> 
    98       <Tool 
    99         Name="VCPreLinkEventTool"/> 
    100       <Tool 
    101         Name="VCResourceCompilerTool"/> 
    102       <Tool 
    103         Name="VCWebServiceProxyGeneratorTool"/> 
    104       <Tool 
    105         Name="VCXMLDataGeneratorTool"/> 
    106       <Tool 
    107         Name="VCWebDeploymentTool"/> 
    108       <Tool 
    109         Name="VCManagedWrapperGeneratorTool"/> 
    110       <Tool 
    111         Name="VCAuxiliaryManagedWrapperGeneratorTool"/> 
    112     </Configuration> 
    113     <Configuration 
    114       Name="Dynamic Linkage|Win32" 
    11515      OutputDirectory="$(ConfigurationName)" 
    11616      IntermediateDirectory="$(ConfigurationName)" 
     
    16161    </Configuration> 
    16262    <Configuration 
    163       Name="Debug Dynamic Linkage|Win32" 
     63      Name="Debug|Win32" 
    16464      OutputDirectory="$(ConfigurationName)" 
    16565      IntermediateDirectory="$(ConfigurationName)" 
     
    228128        RelativePath=".\stdafx.cpp"> 
    229129        <FileConfiguration 
    230           Name="Debug|Win32"> 
    231           <Tool 
    232             Name="VCCLCompilerTool" 
    233             UsePrecompiledHeader="1"/> 
    234         </FileConfiguration> 
    235         <FileConfiguration 
    236130          Name="Release|Win32"> 
    237131          <Tool 
     
    240134        </FileConfiguration> 
    241135        <FileConfiguration 
    242           Name="Dynamic Linkage|Win32"> 
    243           <Tool 
    244             Name="VCCLCompilerTool" 
    245             UsePrecompiledHeader="1"/> 
    246         </FileConfiguration> 
    247         <FileConfiguration 
    248           Name="Debug Dynamic Linkage|Win32"> 
     136          Name="Debug|Win32"> 
    249137          <Tool 
    250138            Name="VCCLCompilerTool" 
     
    264152      </File> 
    265153      <File 
     154        RelativePath="..\..\include\NSCHelper.h"> 
     155      </File> 
     156      <File 
    266157        RelativePath=".\stdafx.h"> 
    267158      </File> 
  • modules/NSClientCompat/NSClientCompat.vcproj

    r36c340d r2a94f3f  
    1212  <Configurations> 
    1313    <Configuration 
    14       Name="Debug|Win32" 
    15       OutputDirectory="Debug" 
    16       IntermediateDirectory="Debug" 
     14      Name="Release|Win32" 
     15      OutputDirectory="$(ConfigurationName)" 
     16      IntermediateDirectory="$(ConfigurationName)" 
    1717      ConfigurationType="2" 
    1818      CharacterSet="2"> 
    1919      <Tool 
    2020        Name="VCCLCompilerTool" 
    21         Optimization="0" 
    2221        AdditionalIncludeDirectories="../include;../../include" 
    23         PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_STLP_USE_STATIC_LIB;_STLP_USE_MALLOC" 
    24         MinimalRebuild="TRUE" 
    25         BasicRuntimeChecks="3" 
    26         RuntimeLibrary="1" 
    27         UsePrecompiledHeader="3" 
    28         WarningLevel="3" 
    29         Detect64BitPortabilityProblems="TRUE" 
    30         DebugInformationFormat="4"/> 
    31       <Tool 
    32         Name="VCCustomBuildTool"/> 
    33       <Tool 
    34         Name="VCLinkerTool" 
    35         AdditionalDependencies="Pdh.lib" 
    36         OutputFile="../../Debug/modules/$(ProjectName).dll" 
    37         LinkIncremental="2" 
    38         ModuleDefinitionFile="NSClientCompat.def" 
    39         GenerateDebugInformation="TRUE" 
    40         ProgramDatabaseFile="$(OutDir)/NSClientCompat.pdb" 
    41         SubSystem="2" 
    42         ImportLibrary="$(OutDir)/NSClientCompat.lib" 
    43         TargetMachine="1"/> 
    44       <Tool 
    45         Name="VCMIDLTool"/> 
    46       <Tool 
    47         Name="VCPostBuildEventTool"/> 
    48       <Tool 
    49         Name="VCPreBuildEventTool"/> 
    50       <Tool 
    51         Name="VCPreLinkEventTool"/> 
    52       <Tool 
    53         Name="VCResourceCompilerTool"/> 
    54       <Tool 
    55         Name="VCWebServiceProxyGeneratorTool"/> 
    56       <Tool 
    57         Name="VCXMLDataGeneratorTool"/> 
    58       <Tool 
    59         Name="VCWebDeploymentTool"/> 
    60       <Tool 
    61         Name="VCManagedWrapperGeneratorTool"/> 
    62       <Tool 
    63         Name="VCAuxiliaryManagedWrapperGeneratorTool"/> 
    64     </Configuration> 
    65     <Configuration 
    66       Name="Release|Win32" 
    67       OutputDirectory="Release" 
    68       IntermediateDirectory="Release" 
    69       ConfigurationType="2" 
    70       CharacterSet="2"> 
    71       <Tool 
    72         Name="VCCLCompilerTool" 
    73         AdditionalIncludeDirectories="../include;../../include" 
    74         PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_STLP_USE_STATIC_LIB;SYSTRAY_EXPORTS" 
    75         RuntimeLibrary="0" 
     22        PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS" 
     23        RuntimeLibrary="2" 
    7624        UsePrecompiledHeader="3" 
    7725        WarningLevel="3" 
     
    11462    </Configuration> 
    11563    <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" 
     64      Name="Debug|Win32" 
    16765      OutputDirectory="$(ConfigurationName)" 
    16866      IntermediateDirectory="$(ConfigurationName)" 
     
    244142        RelativePath=".\stdafx.cpp"> 
    245143        <FileConfiguration 
    246           Name="Debug|Win32"> 
    247           <Tool 
    248             Name="VCCLCompilerTool" 
    249             UsePrecompiledHeader="1"/> 
    250         </FileConfiguration> 
    251         <FileConfiguration 
    252144          Name="Release|Win32"> 
    253145          <Tool 
     
    256148        </FileConfiguration> 
    257149        <FileConfiguration 
    258           Name="Dynamic Linkage|Win32"> 
    259           <Tool 
    260             Name="VCCLCompilerTool" 
    261             UsePrecompiledHeader="1"/> 
    262         </FileConfiguration> 
    263         <FileConfiguration 
    264           Name="Debug Dynamic Linkage|Win32"> 
     150          Name="Debug|Win32"> 
    265151          <Tool 
    266152            Name="VCCLCompilerTool" 
  • modules/SysTray/SysTray.vcproj

    r36c340d r2a94f3f  
    1212  <Configurations> 
    1313    <Configuration 
    14       Name="Debug|Win32" 
    15       OutputDirectory="Debug" 
    16       IntermediateDirectory="Debug" 
    17       ConfigurationType="2" 
    18       CharacterSet="2"> 
    19       <Tool 
    20         Name="VCCLCompilerTool" 
    21         Optimization="0" 
    22         AdditionalIncludeDirectories="../include;../../include" 
    23         PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_STLP_USE_STATIC_LIB;_STLP_USE_MALLOC" 
    24         MinimalRebuild="TRUE" 
    25         BasicRuntimeChecks="3" 
    26         RuntimeLibrary="1" 
    27         UsePrecompiledHeader="3" 
    28         WarningLevel="3" 
    29         Detect64BitPortabilityProblems="TRUE" 
    30         DebugInformationFormat="4"/> 
    31       <Tool 
    32         Name="VCCustomBuildTool"/> 
    33       <Tool 
    34         Name="VCLinkerTool" 
    35         OutputFile="../../Debug/modules/$(ProjectName).dll" 
    36         ModuleDefinitionFile="SysTray.def" 
    37         GenerateDebugInformation="TRUE" 
    38         ImportLibrary="$(OutDir)/SysTray.lib" 
    39         TargetMachine="1"/> 
    40       <Tool 
    41         Name="VCMIDLTool"/> 
    42       <Tool 
    43         Name="VCPostBuildEventTool"/> 
    44       <Tool 
    45         Name="VCPreBuildEventTool"/> 
    46       <Tool 
    47         Name="VCPreLinkEventTool"/> 
    48       <Tool 
    49         Name="VCResourceCompilerTool"/> 
    50       <Tool 
    51         Name="VCWebServiceProxyGeneratorTool"/> 
    52       <Tool 
    53         Name="VCXMLDataGeneratorTool"/> 
    54       <Tool 
    55         Name="VCWebDeploymentTool"/> 
    56       <Tool 
    57         Name="VCManagedWrapperGeneratorTool"/> 
    58       <Tool 
    59         Name="VCAuxiliaryManagedWrapperGeneratorTool"/> 
    60     </Configuration> 
    61     <Configuration 
    6214      Name="Release|Win32" 
    63       OutputDirectory="Release" 
    64       IntermediateDirectory="Release" 
    65       ConfigurationType="2" 
    66       CharacterSet="2"> 
    67       <Tool 
    68         Name="VCCLCompilerTool" 
    69         AdditionalIncludeDirectories="../include;../../include" 
    70         PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_STLP_USE_STATIC_LIB;SYSTRAY_EXPORTS" 
    71         RuntimeLibrary="0" 
    72         UsePrecompiledHeader="3" 
    73         WarningLevel="3" 
    74         Detect64BitPortabilityProblems="TRUE" 
    75         DebugInformationFormat="3"/> 
    76       <Tool 
    77         Name="VCCustomBuildTool"/> 
    78       <Tool 
    79         Name="VCLinkerTool" 
    80         OutputFile="../../Release/modules/$(ProjectName).dll" 
    81         LinkIncremental="1" 
    82         ModuleDefinitionFile="SysTray.def" 
    83         GenerateDebugInformation="TRUE" 
    84         SubSystem="2" 
    85         OptimizeReferences="2" 
    86         EnableCOMDATFolding="2" 
    87         ImportLibrary="$(OutDir)/SysTray.lib" 
    88         TargetMachine="1"/> 
    89       <Tool 
    90         Name="VCMIDLTool"/> 
    91       <Tool 
    92         Name="VCPostBuildEventTool"/> 
    93       <Tool 
    94         Name="VCPreBuildEventTool"/> 
    95       <Tool 
    96         Name="VCPreLinkEventTool"/> 
    97       <Tool 
    98         Name="VCResourceCompilerTool"/> 
    99       <Tool 
    100         Name="VCWebServiceProxyGeneratorTool"/> 
    101       <Tool 
    102         Name="VCXMLDataGeneratorTool"/> 
    103       <Tool 
    104         Name="VCWebDeploymentTool"/> 
    105       <Tool 
    106         Name="VCManagedWrapperGeneratorTool"/> 
    107       <Tool 
    108         Name="VCAuxiliaryManagedWrapperGeneratorTool"/> 
    109     </Configuration> 
    110     <Configuration 
    111       Name="Dynamic Linkage|Win32" 
    11215      OutputDirectory="$(ConfigurationName)" 
    11316      IntermediateDirectory="$(ConfigurationName)" 
     
    15861    </Configuration> 
    15962    <Configuration 
    160       Name="Debug Dynamic Linkage|Win32" 
     63      Name="Debug|Win32" 
    16164      OutputDirectory="$(ConfigurationName)" 
    16265      IntermediateDirectory="$(ConfigurationName)" 
     
    219122        RelativePath=".\stdafx.cpp"> 
    220123        <FileConfiguration 
    221           Name="Debug|Win32"> 
    222           <Tool 
    223             Name="VCCLCompilerTool" 
    224             UsePrecompiledHeader="1"/> 
    225         </FileConfiguration> 
    226         <FileConfiguration 
    227124          Name="Release|Win32"> 
    228125          <Tool 
     
    231128        </FileConfiguration> 
    232129        <FileConfiguration 
    233           Name="Dynamic Linkage|Win32"> 
    234           <Tool 
    235             Name="VCCLCompilerTool" 
    236             UsePrecompiledHeader="1"/> 
    237         </FileConfiguration> 
    238         <FileConfiguration 
    239           Name="Debug Dynamic Linkage|Win32"> 
     130          Name="Debug|Win32"> 
    240131          <Tool 
    241132            Name="VCCLCompilerTool" 
  • modules/SysTray/TrayIcon.cpp

    ra1e1922 r2a94f3f  
    3838INT_PTR CALLBACK TrayIcon::DialogProc(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lParam) 
    3939{ 
    40   DWORD tmp = 0; 
    4140  switch (uMsg)  
    4241  { 
     
    6362          TrayIcon::defaultCommand = NSCModuleHelper::getSettingsString("systray", "defaultCommand", ""); 
    6463        if (DialogBox(NSCModuleWrapper::getModule(),MAKEINTRESOURCE(IDD_INJECTDIALOG),NULL,InjectDialogProc) == IDOK) { 
    65           NSCModuleHelper::InjectCommand(TrayIcon::defaultCommand); 
     64          // @todo NSCModuleHelper::InjectCommand(TrayIcon::defaultCommand); 
    6665        } 
    6766        break; 
    6867      case ID_POPUP_SHOWLOG: 
    69         if ((tmp = (INT)ShellExecute(ghDlgWnd, "open", (NSCModuleHelper::getBasePath() + NSCModuleHelper::getSettingsString("log", "file", "")).c_str(), NULL, NULL, SW_SHOWNORMAL))<=32) { 
    70           NSC_LOG_ERROR("ShellExecute failed : " + strEx::itos((INT)tmp)); 
     68        { 
     69          long long err = reinterpret_cast<long long>(ShellExecute(ghDlgWnd, "open",  
     70            (NSCModuleHelper::getBasePath() + NSCModuleHelper::getSettingsString("log", "file", "")).c_str(),  
     71            NULL, NULL, SW_SHOWNORMAL)); 
     72          if (err <=32) { 
     73              NSC_LOG_ERROR("ShellExecute failed : " + strEx::itos(err)); 
     74            } 
    7175        } 
    7276      } 
Note: See TracChangeset for help on using the changeset viewer.