CIDL::ExecutorDef_ptr
CompositionDef_impl::create_executor
( const char* id,
  const char* name,
  const char* version )
throw(CORBA::SystemException)
{
	DEBUG_OUTLINE ( "CompositionDef_impl::create_executor() called" );

	if ( repository_ -> check_for_id ( id ) )
		throw CORBA::BAD_PARAM ( 2, CORBA::COMPLETED_NO );
	if ( check_for_name ( name ) )
		throw CORBA::BAD_PARAM ( 3, CORBA::COMPLETED_NO );

	ExecutorDef_impl *new_executor =
		new ExecutorDef_impl ( this, repository_ );
	new_executor -> id ( id );
	new_executor -> name ( name );
	new_executor -> version ( version );

	repository_ -> _add_ref();
	this -> _add_ref();

	executor_impl_ = new_executor;

	return new_executor -> _this();
}
Exemplo n.º 2
0
void
get_sid_mask(const char *config, const char *name, UCHAR *sid_mask)
{
	BOOL result = FALSE;
	char *section, *p;
	int line, sid_id;

	memset(sid_mask, 0, MAX_SIDS_COUNT / 8);

	section = (char *)malloc(MAX_SECTION_SIZE);
	if (section == NULL) {
		liberr("malloc");
		return;
	}
	GetPrivateProfileSection("_users_", section, MAX_SECTION_SIZE, config);
	
	// get lines
	sid_id = 0;
	for (p = section, line = 1; *p != '\0'; p += strlen(p) + 1, line++) {
		char *p2;

		if (*p == ';')
			continue;		// comment

		p2 = strchr(p, '=');
		if (p2 == NULL) {
			error("%s:[_users_]:%d: invalid line format (no '=' character)", config, line);
			continue;
		}

		*p2 = '\0';		// temporary kill '='

		if (check_for_name(config, "_users_", p, name))
			sid_mask[sid_id / 8] |= 1 << (sid_id % 8);		// set bit in mask
		
		*p2 = '=';		// recover '=' to make strlen(p) works right

		sid_id++;
	}

	free(section);
}