Subject: RE: Reading files from an extension
Well, I can’t get you the NSD (various reasons, don’t ask). But I can give you code snippets. I’ve stripped variable declaration, initialization, and error handling for brevity’s sake.
here’s the config loop code snippet:
do
{
memset(g_configFilePath, 0, sizeof(g_configFilePath));
if ( OSGetEnvironmentString(g_configFileVariable, strPath, MAX_PATH-1) != FALSE )
{
strncpy(g_configFilePath, strPath, strlen(strPath));
}
else
{
strncpy(g_configFilePath, g_defaultConfigFile, strlen(g_defaultConfigFile));
}
configLoaded = loadConfigFile(g_configFilePath, &g_configuration);
/* DEBUG PRINTF #1 HERE */
if ( !configLoaded )
{
_sleep(g_initialConfigWait);
}
}while (!configLoaded);
/* DEBUG PRINTF #2 HERE; never reached */
And here’s loadConfigFile(filePath,config):
======================
if ( (configFile = fopen(filePath, “r”)) != NULL )
{
if ( scanForConfigSection(configFile, SECTION_HEADER) )
{
tempConfig = (ConfigVariables_t *)calloc(1, sizeof(ConfigVariables_t));
while ( !feof(configFile) )
{
fgets(line, LINE_LEN, configFile);
whichKey = matchKeys(line, g_listOfConfigKeys);
switch (whichKey):
{
/* Key handling stuff, assigning values of members of tempConfig. Some involve callocs. If we find at least one of every key, we're good to continue */
}
}
}
if ( success )
{
if ( config != NULL )
{
destroyConfigVariables(config);
}
config = tempConfig;
} else {
destroyConfigVariables(tempConfig);
}
}
=============================
As for remote debugging, I don’t think that’s doable - the test machines are on a separate, air-gapped, network from any machine with a dev environment.