예제 #1
0
파일: objdir.cpp 프로젝트: killvxk/ring3k
NTSTATUS object_dir_impl_t::open( object_t*& obj, open_info_t& info )
{
	ULONG n = 0;
	UNICODE_STRING& path = info.path;

	trace("path = %pus\n", &path );

	while (n < path.Length/2 && path.Buffer[n] != '\\')
		n++;

	if (n == 0)
		return STATUS_OBJECT_NAME_INVALID;

	UNICODE_STRING segment;
	segment.Buffer = path.Buffer;
	segment.Length = n * 2;
	segment.MaximumLength = 0;

	obj = lookup( segment, info.case_insensitive() );

	if (n == path.Length/2)
		return info.on_open( this, obj, info );

	if (!obj)
		return STATUS_OBJECT_PATH_NOT_FOUND;

	path.Buffer += (n + 1);
	path.Length -= (n + 1) * 2;
	path.MaximumLength -= (n + 1) * 2;

	return obj->open( obj, info );
}
예제 #2
0
NTSTATUS pipe_device_t::open( object_t *&out, open_info_t& info )
{
	if (info.path.Length == 0)
		return object_dir_impl_t::open( out, info );

	// appears to be a flat namespace under the pipe device
	dprintf("pipe = %pus\n", &info.path );
	out = lookup( info.path, info.case_insensitive() );

	// not the NtCreateNamedPipeFile case?
	if (out && dynamic_cast<pipe_factory*>(&info) == NULL)
		return out->open( out, info );

	return info.on_open( this, out, info );
}