Esempio n. 1
0
File: hal.c Progetto: callcc/tekui
EXPORT TBOOL
hal_scanmodules(struct THALBase *hal, TSTRPTR path, struct THook *hook)
{
	TSTRPTR p;
	struct HALSpecific *hws = hal->hmb_Specific;
	TBOOL success = TFALSE;

	p = getmodpath(hws->hsp_ProgDir, "mod\\*.dll");
	if (p)
	{
		TDBPRINTF(TDB_TRACE,("scanning %s\n", p));
		success = scanpathtolist(hook, p, path);
		free(p);
	}

	if (success)
	{
		p = getmodpath(hws->hsp_ModDir, "*.dll");
		if (p)
		{
			TDBPRINTF(TDB_TRACE,("scanning %s\n", p));
			success = scanpathtolist(hook, p, path);
			free(p);
		}
	}
	return success;
}
Esempio n. 2
0
File: ndis.c Progetto: HarryR/sanos
static struct section *get_config_section(struct ndis_adapter *adapter) {
  char buf[MAXPATH];
  char *cfgname;
  char *p;
  char *lastdot;
  struct section *sect;

  if (getmodpath(adapter->driver->hmod, buf, sizeof buf) < 0) return NULL;
  cfgname = buf;
  lastdot = NULL;
  
  p = buf;
  while (*p) {
    if (*p == PS1 || *p == PS2) cfgname = p + 1;
    if (*p == '.') lastdot = p;
    p++;
  }
  if (lastdot > cfgname) *lastdot = 0;
  
  p = cfgname + strlen(cfgname);
  *p++ = '-';
  *p++ = '0' + adapter->adapterno;
  *p = 0;

  sect = krnlcfg;
  while (sect) {
    if (stricmp(sect->name, cfgname) == 0) return sect;
    sect = sect->next;
  }

  return NULL;
}