• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ release_object函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中release_object函数的典型用法代码示例。如果您正苦于以下问题:C++ release_object函数的具体用法?C++ release_object怎么用?C++ release_object使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了release_object函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: NtTerminateProcess

NTSTATUS SERVICECALL
NtTerminateProcess(IN HANDLE ProcessHandle,
		IN NTSTATUS ExitStatus)
{
	struct eprocess *process;
	struct ethread *cur_thread;
	NTSTATUS status;

	ktrace("\n");

	if ((status = ref_object_by_handle(ProcessHandle ? ProcessHandle : NtCurrentProcess(),
				PROCESS_TERMINATE, 
				process_object_type, 
				get_pre_mode(), 
				(PVOID *) &process, 
				NULL)))
		return status;

	cur_thread = (struct ethread *) get_current_ethread();

	terminate_process(process->win32process, ExitStatus);
	release_object(process->win32process);

	lock_process(process);

	if (process->exit_time.quad) {
		unlock_process(process);
		deref_object(process);
		return STATUS_PROCESS_IS_TERMINATING;
	}

	query_sys_time(&process->exit_time);
	process->exit_status = (unsigned long)ExitStatus;

	unlock_process(process);
	deref_object(process);

	if (process == get_current_eprocess()) {
		cur_thread->exit_status = ExitStatus;
		do_group_exit((ExitStatus & 0xff) << 8);
	} else {
		struct ethread *first_thread = get_first_thread(process);

		first_thread->exit_status = ExitStatus;
		send_sig_info(SIGKILL, SEND_SIG_FORCED, first_thread->et_task->group_leader);
	}

	return STATUS_SUCCESS;
}
开发者ID:WASSUM,项目名称:longene_travel,代码行数:49,代码来源:kill.c


示例2: link_event

/* link an event at the end of the queue */
static void link_event( struct debug_event *event )
{
    struct debug_ctx *debug_ctx = event->debugger->debug_ctx;

    assert( debug_ctx );
    grab_object( event );
    list_add_tail( &debug_ctx->event_queue, &event->entry );
    if (!event->sender->debug_event)
    {
        /* grab reference since debugger could be killed while trying to wake up */
        grab_object( debug_ctx );
        wake_up( &debug_ctx->obj, 0 );
        release_object( debug_ctx );
    }
}
开发者ID:elppans,项目名称:wine-staging-1.9.15_IndexVertexBlending-1.9.11,代码行数:16,代码来源:debugger.c


示例3: release_object

/* allocate a new handle table */
struct handle_table *alloc_handle_table( struct process *process, int count )
{
    struct handle_table *table;

    if (count < MIN_HANDLE_ENTRIES) count = MIN_HANDLE_ENTRIES;
    if (!(table = alloc_object( &handle_table_ops )))
        return NULL;
    table->process = process;
    table->count   = count;
    table->last    = -1;
    table->free    = 0;
    if ((table->entries = mem_alloc( count * sizeof(*table->entries) ))) return table;
    release_object( table );
    return NULL;
}
开发者ID:edutanaka,项目名称:wine,代码行数:16,代码来源:handle.c


示例4: device_ioctl

static obj_handle_t device_ioctl(struct fd *fd, ioctl_code_t code, const async_data_t *async_data,
						const void *data, data_size_t size)
{
	struct device *device = get_fd_user(fd);
	struct ioctl_call *ioctl;
	obj_handle_t handle;

	if (!device->manager) /* it has been deleted */ {
		set_error(STATUS_FILE_DELETED);
		return 0;
	}

	if (!(ioctl = create_ioctl(device, code, data, size, get_reply_max_size())))
		return 0;

	ioctl->thread   = (struct w32thread *)grab_object(current_thread);
	ioctl->user_arg = async_data->arg;

	if (!(handle = alloc_handle(get_current_w32process(), ioctl, SYNCHRONIZE, 0))) {
		release_object(ioctl);
		return 0;
	}

	if (!(ioctl->async = fd_queue_async(device->fd, async_data, ASYNC_TYPE_WAIT, 0))) {
		close_handle(get_current_eprocess(), handle);
		release_object(ioctl);
		return 0;
	}
	list_add_before(&device->requests, &ioctl->dev_entry);
	list_add_before(&device->manager->requests, &ioctl->mgr_entry);
	if (list_head(&device->manager->requests) == &ioctl->mgr_entry)  /* first one */
		uk_wake_up(&device->manager->obj, 0);
	/* don't release ioctl since it is now queued in the device */
	set_error(STATUS_PENDING);
	return handle;
}
开发者ID:WASSUM,项目名称:longene_travel,代码行数:36,代码来源:device.c


示例5: open_object

/* open a new handle to an existing object */
obj_handle_t open_object( struct process *process, obj_handle_t parent, unsigned int access,
                          const struct object_ops *ops, const struct unicode_str *name,
                          unsigned int attributes )
{
    obj_handle_t handle = 0;
    struct directory *root = NULL;
    struct object *obj;

    if (name->len >= 65534)
    {
        set_error( STATUS_OBJECT_NAME_INVALID );
        return 0;
    }

    if (parent && !(root = get_directory_obj( process, parent, 0 ))) return 0;

    if ((obj = open_object_dir( root, name, attributes, ops )))
    {
        handle = alloc_handle( process, obj, access, attributes );
        release_object( obj );
    }
    if (root) release_object( root );
    return handle;
}
开发者ID:edutanaka,项目名称:wine,代码行数:25,代码来源:handle.c


示例6: file_map_access

/* if the function fails the fd is closed */
static struct file *create_file_for_fd( int fd, unsigned int access, unsigned int sharing )
{
    struct file *file;

    if ((file = alloc_object( &file_ops )))
    {
        file->access     = file_map_access( &file->obj, access );
        file->options    = FILE_SYNCHRONOUS_IO_NONALERT;
        if (!(file->fd = create_anonymous_fd( &file_fd_ops, fd, &file->obj )))
        {
            release_object( file );
            return NULL;
        }
    }
    return file;
}
开发者ID:howard5888,项目名称:wineT,代码行数:17,代码来源:file.c


示例7: dir_gc

static int dir_gc(lua_State *L)
{
  lua_apr_dir *directory = checkdir(L, 1, 0);
  if (object_collectable((lua_apr_refobj*)directory)) {
    if (directory->handle != NULL) {
      apr_dir_close(directory->handle);
      directory->handle = NULL;
    }
    if (directory->memory_pool != NULL) {
      apr_pool_destroy(directory->memory_pool);
      directory->memory_pool = NULL;
    }
  }
  release_object((lua_apr_refobj*)directory);
  return 0;
}
开发者ID:LuaDist,项目名称:lua-apr,代码行数:16,代码来源:io_dir.c


示例8: duplicate_handle

/* duplicate a handle */
obj_handle_t duplicate_handle( struct process *src, obj_handle_t src_handle, struct process *dst,
                               unsigned int access, unsigned int attr, unsigned int options )
{
    obj_handle_t res;
    struct handle_entry *entry;
    unsigned int src_access;
    struct object *obj = get_handle_obj( src, src_handle, 0, NULL );

    if (!obj) return 0;
    if ((entry = get_handle( src, src_handle )))
        src_access = entry->access;
    else  /* pseudo-handle, give it full access */
        src_access = obj->ops->map_access( obj, GENERIC_ALL );
    src_access &= ~RESERVED_ALL;

    if (options & DUP_HANDLE_SAME_ACCESS)
        access = src_access;
    else
        access = obj->ops->map_access( obj, access ) & ~RESERVED_ALL;

    /* asking for the more access rights than src_access? */
    if (access & ~src_access)
    {
        if (options & DUP_HANDLE_MAKE_GLOBAL)
            res = alloc_global_handle( obj, access );
        else
            res = alloc_handle( dst, obj, access, attr );
    }
    else
    {
        if (options & DUP_HANDLE_MAKE_GLOBAL)
            res = alloc_global_handle_no_access_check( obj, access );
        else if ((options & DUP_HANDLE_CLOSE_SOURCE) && src == dst &&
                 entry && !(entry->access & RESERVED_CLOSE_PROTECT))
        {
            if (attr & OBJ_INHERIT) access |= RESERVED_INHERIT;
            entry->access = access;
            res = src_handle;
        }
        else
            res = alloc_handle_entry( dst, obj, access, attr );
    }

    release_object( obj );
    return res;
}
开发者ID:edutanaka,项目名称:wine,代码行数:47,代码来源:handle.c


示例9: debug_exit_thread

/* a thread is exiting */
void debug_exit_thread( struct thread *thread )
{
    if (thread->debug_ctx)  /* this thread is a debugger */
    {
        if (thread->debug_ctx->kill_on_exit)
        {
            /* kill all debugged processes */
            kill_debugged_processes( thread, thread->exit_code );
        }
        else
        {
            detach_debugged_processes( thread );
        }
        release_object( thread->debug_ctx );
        thread->debug_ctx = NULL;
    }
}
开发者ID:howard5888,项目名称:wineT,代码行数:18,代码来源:debugger.c


示例10: device_file_flush

static obj_handle_t device_file_flush( struct fd *fd, const async_data_t *async_data, int blocking )
{
    struct device_file *file = get_fd_user( fd );
    struct irp_call *irp;
    obj_handle_t handle;
    irp_params_t params;

    memset( &params, 0, sizeof(params) );
    params.flush.major = IRP_MJ_FLUSH_BUFFERS;
    params.flush.file  = file->user_ptr;

    irp = create_irp( file, &params, NULL, 0, 0 );
    if (!irp) return 0;

    handle = queue_irp( file, irp, async_data, blocking );
    release_object( irp );
    return handle;
}
开发者ID:grandhuit,项目名称:wine-patched,代码行数:18,代码来源:device.c


示例11: NtTerminateThread

NTSTATUS 
SERVICECALL
NtTerminateThread(IN HANDLE   ThreadHandle,
		IN NTSTATUS ExitStatus)
{
	struct ethread * thread;
	struct w32thread *w32thread;
	NTSTATUS status;

	ktrace("%p\n", ThreadHandle);

	status = ref_object_by_handle(ThreadHandle,
			THREAD_TERMINATE,
			thread_object_type,
			get_pre_mode(),
			(PVOID *)&thread,
			NULL);

	if (!NT_SUCCESS(status))
		return status;

	if (!thread->et_task){
		deref_object(thread);
		return STATUS_THREAD_IS_TERMINATING; 
	}

	w32thread = thread->tcb.win32thread;
	remove_process_thread(w32thread->process, w32thread);
	thread->tcb.win32thread = NULL;
	release_object(w32thread);

	/* FIXME Make sure this is not a system thread */

	if (thread != get_current_ethread()) {
		terminate_thread_by_pointer(thread, ExitStatus); 
		deref_object(thread);
	} else {
		deref_object(thread);
		thread->exit_status = ExitStatus;
		do_exit((ExitStatus & 0xff) << 8); 
	}

	return STATUS_SUCCESS;		
}
开发者ID:WASSUM,项目名称:longene_travel,代码行数:44,代码来源:kill.c


示例12: list_add_before

static struct device *create_device(HANDLE root, const struct unicode_str *name,
							struct device_manager *manager, unsigned int attr)
{
	struct device *device;

	if ((device = create_named_object_dir(root, name, attr, &device_ops))) {
		if (get_error() != STATUS_OBJECT_NAME_EXISTS) {
			/* initialize it if it didn't already exist */
			device->manager = manager;
			list_add_before(&manager->devices, &device->entry);
			INIT_LIST_HEAD(&device->requests);
			if (!(device->fd = alloc_pseudo_fd(&device_fd_ops, &device->obj, 0))) {
				release_object(device);
				device = NULL;
			}
		}
	}
	return device;
}
开发者ID:WASSUM,项目名称:longene_travel,代码行数:19,代码来源:device.c


示例13: handler_poll_event

static void handler_poll_event( struct fd *fd, int event )
{
    struct handler *handler = get_fd_user( fd );

    if (event & (POLLERR | POLLHUP))
    {
        /* this is not supposed to happen */
        fprintf( stderr, "wineserver: Error on signal handler pipe\n" );
        release_object( handler );
    }
    else if (event & POLLIN)
    {
        char dummy;

        handler->pending = 0;
        read( get_unix_fd( handler->fd ), &dummy, 1 );
        handler->callback();
    }
}
开发者ID:AlexSteel,项目名称:wine,代码行数:19,代码来源:signal.c


示例14: cleanup_clipboard_thread

/* Called when thread terminates to allow release of clipboard */
void cleanup_clipboard_thread(struct w32thread *thread)
{
	struct clipboard *clipboard;
	struct winstation *winstation = get_process_winstation(thread->process, WINSTA_ACCESSCLIPBOARD);

	if (!winstation)
		return;

	if ((clipboard = winstation->clipboard)) {
		if (thread == clipboard->open_thread) {
			clipboard->open_win = 0;
			clipboard->open_thread = NULL;
		}
		if (thread == clipboard->owner_thread) {
			clipboard->owner_win = 0;
			clipboard->owner_thread = NULL;
		}
	}
	release_object(winstation);
}
开发者ID:WASSUM,项目名称:longene_travel,代码行数:21,代码来源:clipboard.c


示例15: key_hook

int			key_hook(unsigned int key, t_core *c)
{
	if (key == K_ESC)
	{
		release_object(&c->otest);
		exit(0);
	}
	else if (key == K_A)
		c->anim = !c->anim;
	else if (key == K_T)
		c->tex_enabled = !c->tex_enabled;
	else if (key == K_1 || key == K_N1)
		change_rotation(&c->rotations.x);
	else if (key == K_2 || key == K_N2)
		change_rotation(&c->rotations.y);
	else if (key == K_3 || key == K_N3)
		change_rotation(&c->rotations.z);
	else if (key == K_HOME)
		c->current_texture = (c->current_texture + 1) % c->texture_max;
	return (1);
}
开发者ID:rdavid42,项目名称:Simple-obj-viewer,代码行数:21,代码来源:key_hook.c


示例16: device_file_close_handle

static int device_file_close_handle( struct object *obj, struct process *process, obj_handle_t handle )
{
    struct device_file *file = (struct device_file *)obj;

    if (file->device->manager && obj->handle_count == 1)  /* last handle */
    {
        struct irp_call *irp;
        irp_params_t params;

        memset( &params, 0, sizeof(params) );
        params.close.major = IRP_MJ_CLOSE;
        params.close.file  = file->user_ptr;

        if ((irp = create_irp( file, &params, NULL, 0, 0 )))
        {
            add_irp_to_queue( file, irp, NULL );
            release_object( irp );
        }
    }
    return 1;
}
开发者ID:grandhuit,项目名称:wine-patched,代码行数:21,代码来源:device.c


示例17: device_file_ioctl

static obj_handle_t device_file_ioctl( struct fd *fd, ioctl_code_t code, const async_data_t *async_data,
                                       int blocking )
{
    struct device_file *file = get_fd_user( fd );
    struct irp_call *irp;
    obj_handle_t handle;
    irp_params_t params;

    memset( &params, 0, sizeof(params) );
    params.ioctl.major = IRP_MJ_DEVICE_CONTROL;
    params.ioctl.code  = code;
    params.ioctl.file = file->user_ptr;

    irp = create_irp( file, &params, get_req_data(), get_req_data_size(),
                      get_reply_max_size() );
    if (!irp) return 0;

    handle = queue_irp( file, irp, async_data, blocking );
    release_object( irp );
    return handle;
}
开发者ID:grandhuit,项目名称:wine-patched,代码行数:21,代码来源:device.c


示例18: device_file_write

static obj_handle_t device_file_write( struct fd *fd, const async_data_t *async_data, int blocking,
                                       file_pos_t pos, data_size_t *written )
{
    struct device_file *file = get_fd_user( fd );
    struct irp_call *irp;
    obj_handle_t handle;
    irp_params_t params;

    memset( &params, 0, sizeof(params) );
    params.write.major = IRP_MJ_WRITE;
    params.write.key   = 0;
    params.write.pos   = pos;
    params.write.file  = file->user_ptr;

    irp = create_irp( file, &params, get_req_data(), get_req_data_size(), 0 );
    if (!irp) return 0;

    handle = queue_irp( file, irp, async_data, blocking );
    release_object( irp );
    return handle;
}
开发者ID:grandhuit,项目名称:wine-patched,代码行数:21,代码来源:device.c


示例19: device_file_read

static obj_handle_t device_file_read( struct fd *fd, const async_data_t *async_data, int blocking,
                                      file_pos_t pos )
{
    struct device_file *file = get_fd_user( fd );
    struct irp_call *irp;
    obj_handle_t handle;
    irp_params_t params;

    memset( &params, 0, sizeof(params) );
    params.read.major = IRP_MJ_READ;
    params.read.key   = 0;
    params.read.pos   = pos;
    params.read.file  = file->user_ptr;

    irp = create_irp( file, &params, NULL, 0, get_reply_max_size() );
    if (!irp) return 0;

    handle = queue_irp( file, irp, async_data, blocking );
    release_object( irp );
    return handle;
}
开发者ID:grandhuit,项目名称:wine-patched,代码行数:21,代码来源:device.c


示例20: proc_gc

static int proc_gc(lua_State *L)
{
  lua_apr_proc *process = proc_check(L, 1);
  if (object_collectable((lua_apr_refobj*)process)) {
    lua_settop(L, 1);
    lua_getfenv(L, 1);
    if (lua_type(L, -1) == LUA_TTABLE) {
      close_pipe(L, "in_child");
      close_pipe(L, "in_parent");
      close_pipe(L, "out_child");
      close_pipe(L, "out_parent");
      close_pipe(L, "err_child");
      close_pipe(L, "err_parent");
    }
    if (process->memory_pool != NULL) {
      apr_pool_destroy(process->memory_pool);
      process->memory_pool = NULL;
    }
  }
  release_object((lua_apr_refobj*)process);
  return 0;
}
开发者ID:LuaDist,项目名称:lua-apr,代码行数:22,代码来源:proc.c



注:本文中的release_object函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ release_pages函数代码示例发布时间:2022-05-30
下一篇:
C++ release_mem_region函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap