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

C++ BVAL函数代码示例

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

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



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

示例1: smbd_smb2_request_process_flush

NTSTATUS smbd_smb2_request_process_flush(struct smbd_smb2_request *req)
{
	NTSTATUS status;
	const uint8_t *inbody;
	int i = req->current_idx;
	uint64_t in_file_id_persistent;
	uint64_t in_file_id_volatile;
	struct tevent_req *subreq;

	status = smbd_smb2_request_verify_sizes(req, 0x18);
	if (!NT_STATUS_IS_OK(status)) {
		return smbd_smb2_request_error(req, status);
	}
	inbody = (const uint8_t *)req->in.vector[i+1].iov_base;

	in_file_id_persistent	= BVAL(inbody, 0x08);
	in_file_id_volatile	= BVAL(inbody, 0x10);

	if (req->compat_chain_fsp) {
		/* skip check */
	} else if (in_file_id_persistent != in_file_id_volatile) {
		return smbd_smb2_request_error(req, NT_STATUS_FILE_CLOSED);
	}

	subreq = smbd_smb2_flush_send(req,
				      req->sconn->ev_ctx,
				      req,
				      in_file_id_volatile);
	if (subreq == NULL) {
		return smbd_smb2_request_error(req, NT_STATUS_NO_MEMORY);
	}
	tevent_req_set_callback(subreq, smbd_smb2_request_flush_done, req);

	return smbd_smb2_request_pending_queue(req, subreq, 500);
}
开发者ID:srimalik,项目名称:samba,代码行数:35,代码来源:smb2_flush.c


示例2: __etb_disable

static void __etb_disable(void)
{
	int count;
	uint32_t ffcr;

	ETB_UNLOCK();

	ffcr = etb_readl(etb, ETB_FFCR);
	ffcr |= (BIT(12) | BIT(6));
	etb_writel(etb, ffcr, ETB_FFCR);

	for (count = TIMEOUT_US; BVAL(etb_readl(etb, ETB_FFCR), 6) != 0
				&& count > 0; count--)
		udelay(1);
	WARN(count == 0, "timeout while flushing ETB, ETB_FFCR: %#x\n",
	     etb_readl(etb, ETB_FFCR));

	etb_writel(etb, 0x0, ETB_CTL_REG);

	for (count = TIMEOUT_US; BVAL(etb_readl(etb, ETB_FFSR), 1) != 1
				&& count > 0; count--)
		udelay(1);
	WARN(count == 0, "timeout while disabling ETB, ETB_FFSR: %#x\n",
	     etb_readl(etb, ETB_FFSR));

	ETB_LOCK();
}
开发者ID:Bigtime1267,项目名称:HTC-C525c,代码行数:27,代码来源:qdss-etb.c


示例3: smb_raw_nttrans_create_recv

/*
 Open a file using TRANSACT2_OPEN - async recv
*/
static NTSTATUS smb_raw_nttrans_create_recv(struct smbcli_request *req, 
					    TALLOC_CTX *mem_ctx, 
					    union smb_open *parms)
{
	NTSTATUS status;
	struct smb_nttrans nt;
	uint8_t *params;

	status = smb_raw_nttrans_recv(req, mem_ctx, &nt);
	if (!NT_STATUS_IS_OK(status)) return status;

	if (nt.out.params.length < 69) {
		return NT_STATUS_INVALID_PARAMETER;
	}

	params = nt.out.params.data;

	parms->ntcreatex.out.oplock_level =                 CVAL(params, 0);
	parms->ntcreatex.out.file.fnum =                    SVAL(params, 2);
	parms->ntcreatex.out.create_action =                IVAL(params, 4);
	parms->ntcreatex.out.create_time =   smbcli_pull_nttime(params, 12);
	parms->ntcreatex.out.access_time =   smbcli_pull_nttime(params, 20);
	parms->ntcreatex.out.write_time =    smbcli_pull_nttime(params, 28);
	parms->ntcreatex.out.change_time =   smbcli_pull_nttime(params, 36);
	parms->ntcreatex.out.attrib =                      IVAL(params, 44);
	parms->ntcreatex.out.alloc_size =                  BVAL(params, 48);
	parms->ntcreatex.out.size =                        BVAL(params, 56);
	parms->ntcreatex.out.file_type =                   SVAL(params, 64);
	parms->ntcreatex.out.ipc_state =                   SVAL(params, 66);
	parms->ntcreatex.out.is_directory =                CVAL(params, 68);
	
	return NT_STATUS_OK;
}
开发者ID:AIdrifter,项目名称:samba,代码行数:36,代码来源:rawfile.c


示例4: smb2srv_lock_recv

void smb2srv_lock_recv(struct smb2srv_request *req)
{
	union smb_lock *io;
	int i;

	SMB2SRV_CHECK_BODY_SIZE(req, 0x30, false);
	SMB2SRV_TALLOC_IO_PTR(io, union smb_lock);
	SMB2SRV_SETUP_NTVFS_REQUEST(smb2srv_lock_send, NTVFS_ASYNC_STATE_MAY_ASYNC);

	io->smb2.level			= RAW_LOCK_SMB2;
	io->smb2.in.lock_count		= SVAL(req->in.body, 0x02);
	io->smb2.in.reserved		= IVAL(req->in.body, 0x04);
	io->smb2.in.file.ntvfs		= smb2srv_pull_handle(req, req->in.body, 0x08);
	if (req->in.body_size < 24 + 24*(uint64_t)io->smb2.in.lock_count) {
		DEBUG(0,("%s: lock buffer too small\n", __location__));
		smb2srv_send_error(req,  NT_STATUS_FOOBAR);
		return;
	}
	io->smb2.in.locks = talloc_array(io, struct smb2_lock_element, 
					 io->smb2.in.lock_count);
	if (io->smb2.in.locks == NULL) {
		smb2srv_send_error(req, NT_STATUS_NO_MEMORY);
		return;
	}

	for (i=0;i<io->smb2.in.lock_count;i++) {
		io->smb2.in.locks[i].offset	= BVAL(req->in.body, 24 + i*24);
		io->smb2.in.locks[i].length	= BVAL(req->in.body, 32 + i*24);
		io->smb2.in.locks[i].flags	= IVAL(req->in.body, 40 + i*24);
		io->smb2.in.locks[i].reserved	= IVAL(req->in.body, 44 + i*24);
	}

	SMB2SRV_CHECK_FILE_HANDLE(io->smb2.in.file.ntvfs);
	SMB2SRV_CALL_NTVFS_BACKEND(ntvfs_lock(req->ntvfs, io));
}
开发者ID:AllardJ,项目名称:Tomato,代码行数:35,代码来源:fileio.c


示例5: server_id_get

void server_id_get(struct server_id *id, const uint8_t buf[24])
{
	id->pid       = BVAL(buf, 0);
	id->task_id   = IVAL(buf, 8);
	id->vnn       = IVAL(buf, 12);
	id->unique_id = BVAL(buf, 16);
}
开发者ID:Distrotech,项目名称:samba,代码行数:7,代码来源:server_id.c


示例6: smb2_create_recv

/*
  recv a create reply
*/
NTSTATUS smb2_create_recv(struct smb2_request *req, TALLOC_CTX *mem_ctx, struct smb2_create *io)
{
	NTSTATUS status;

	if (!smb2_request_receive(req) || 
	    !smb2_request_is_ok(req)) {
		return smb2_request_destroy(req);
	}

	SMB2_CHECK_PACKET_RECV(req, 0x58, True);

	io->out.oplock_flags   = SVAL(req->in.body, 0x02);
	io->out.create_action  = IVAL(req->in.body, 0x04);
	io->out.create_time    = smbcli_pull_nttime(req->in.body, 0x08);
	io->out.access_time    = smbcli_pull_nttime(req->in.body, 0x10);
	io->out.write_time     = smbcli_pull_nttime(req->in.body, 0x18);
	io->out.change_time    = smbcli_pull_nttime(req->in.body, 0x20);
	io->out.alloc_size     = BVAL(req->in.body, 0x28);
	io->out.size           = BVAL(req->in.body, 0x30);
	io->out.file_attr      = IVAL(req->in.body, 0x38);
	io->out._pad           = IVAL(req->in.body, 0x3C);
	smb2_pull_handle(req->in.body+0x40, &io->out.file.handle);
	status = smb2_pull_o32s32_blob(&req->in, mem_ctx, req->in.body+0x50, &io->out.blob);
	if (!NT_STATUS_IS_OK(status)) {
		smb2_request_destroy(req);
		return status;
	}

	return smb2_request_destroy(req);
}
开发者ID:technosaurus,项目名称:samba4-GPL2,代码行数:33,代码来源:create.c


示例7: smb2srv_read_recv

void smb2srv_read_recv(struct smb2srv_request *req)
{
	union smb_read *io;

	SMB2SRV_CHECK_BODY_SIZE(req, 0x30, True);
	SMB2SRV_TALLOC_IO_PTR(io, union smb_read);
	SMB2SRV_SETUP_NTVFS_REQUEST(smb2srv_read_send, NTVFS_ASYNC_STATE_MAY_ASYNC);

	io->smb2.level			= RAW_READ_SMB2;
	io->smb2.in._pad		= SVAL(req->in.body, 0x02);
	io->smb2.in.length		= IVAL(req->in.body, 0x04);
	io->smb2.in.offset		= BVAL(req->in.body, 0x08);
	io->smb2.in.file.ntvfs		= smb2srv_pull_handle(req, req->in.body, 0x10);
	io->smb2.in.unknown1		= BVAL(req->in.body, 0x20);
	io->smb2.in.unknown2		= BVAL(req->in.body, 0x28);

	SMB2SRV_CHECK_FILE_HANDLE(io->smb2.in.file.ntvfs);

	/* preallocate the buffer for the backends */
	io->smb2.out.data = data_blob_talloc(io, NULL, io->smb2.in.length);
	if (io->smb2.out.data.length != io->smb2.in.length) {
		SMB2SRV_CHECK(NT_STATUS_NO_MEMORY);
	}

	SMB2SRV_CALL_NTVFS_BACKEND(ntvfs_read(req->ntvfs, io));
}
开发者ID:technosaurus,项目名称:samba4-GPL2,代码行数:26,代码来源:fileio.c


示例8: __etb_disable

static void __etb_disable(void)
{
	int count;
	uint32_t ffcr;

	/* Avoid oopsing in panic() if called before the device is probed. */
	if (!etb.base)
		return;

	ETB_UNLOCK();

	ffcr = etb_readl(etb, ETB_FFCR);
	ffcr |= (BIT(12) | BIT(6));
	etb_writel(etb, ffcr, ETB_FFCR);

	for (count = TIMEOUT_US; BVAL(etb_readl(etb, ETB_FFCR), 6) != 0
				&& count > 0; count--)
		udelay(1);
	WARN(count == 0, "timeout while flushing ETB, ETB_FFCR: %#x\n",
	     etb_readl(etb, ETB_FFCR));

	etb_writel(etb, 0x0, ETB_CTL_REG);

	for (count = TIMEOUT_US; BVAL(etb_readl(etb, ETB_FFSR), 1) != 1
				&& count > 0; count--)
		udelay(1);
	WARN(count == 0, "timeout while disabling ETB, ETB_FFSR: %#x\n",
	     etb_readl(etb, ETB_FFSR));

	ETB_LOCK();
}
开发者ID:KIMMINWOO,项目名称:FusionUlt-AOSP-MR1,代码行数:31,代码来源:qdss-etb.c


示例9: smbd_smb2_request_process_close

NTSTATUS smbd_smb2_request_process_close(struct smbd_smb2_request *req)
{
	const uint8_t *inbody;
	uint16_t in_flags;
	uint64_t in_file_id_persistent;
	uint64_t in_file_id_volatile;
	struct files_struct *in_fsp;
	NTSTATUS status;
	struct tevent_req *subreq;

	status = smbd_smb2_request_verify_sizes(req, 0x18);
	if (!NT_STATUS_IS_OK(status)) {
		return smbd_smb2_request_error(req, status);
	}
	inbody = SMBD_SMB2_IN_BODY_PTR(req);

	in_flags		= SVAL(inbody, 0x02);
	in_file_id_persistent	= BVAL(inbody, 0x08);
	in_file_id_volatile	= BVAL(inbody, 0x10);

	in_fsp = file_fsp_smb2(req, in_file_id_persistent, in_file_id_volatile);
	if (in_fsp == NULL) {
		return smbd_smb2_request_error(req, NT_STATUS_FILE_CLOSED);
	}

	subreq = smbd_smb2_close_send(req, req->sconn->ev_ctx,
				      req, in_fsp, in_flags);
	if (subreq == NULL) {
		return smbd_smb2_request_error(req, NT_STATUS_NO_MEMORY);
	}
	tevent_req_set_callback(subreq, smbd_smb2_request_close_done, req);

	return smbd_smb2_request_pending_queue(req, subreq, 500);
}
开发者ID:DanilKorotenko,项目名称:samba,代码行数:34,代码来源:smb2_close.c


示例10: smbd_smb2_request_process_read

NTSTATUS smbd_smb2_request_process_read(struct smbd_smb2_request *req)
{
	struct smbXsrv_connection *xconn = req->xconn;
	NTSTATUS status;
	const uint8_t *inbody;
	uint32_t in_length;
	uint64_t in_offset;
	uint64_t in_file_id_persistent;
	uint64_t in_file_id_volatile;
	struct files_struct *in_fsp;
	uint32_t in_minimum_count;
	uint32_t in_remaining_bytes;
	struct tevent_req *subreq;

	status = smbd_smb2_request_verify_sizes(req, 0x31);
	if (!NT_STATUS_IS_OK(status)) {
		return smbd_smb2_request_error(req, status);
	}
	inbody = SMBD_SMB2_IN_BODY_PTR(req);

	in_length		= IVAL(inbody, 0x04);
	in_offset		= BVAL(inbody, 0x08);
	in_file_id_persistent	= BVAL(inbody, 0x10);
	in_file_id_volatile	= BVAL(inbody, 0x18);
	in_minimum_count	= IVAL(inbody, 0x20);
	in_remaining_bytes	= IVAL(inbody, 0x28);

	/* check the max read size */
	if (in_length > xconn->smb2.server.max_read) {
		DEBUG(2,("smbd_smb2_request_process_read: "
			 "client ignored max read: %s: 0x%08X: 0x%08X\n",
			__location__, in_length, xconn->smb2.server.max_read));
		return smbd_smb2_request_error(req, NT_STATUS_INVALID_PARAMETER);
	}

	status = smbd_smb2_request_verify_creditcharge(req, in_length);
	if (!NT_STATUS_IS_OK(status)) {
		return smbd_smb2_request_error(req, status);
	}

	in_fsp = file_fsp_smb2(req, in_file_id_persistent, in_file_id_volatile);
	if (in_fsp == NULL) {
		return smbd_smb2_request_error(req, NT_STATUS_FILE_CLOSED);
	}

	subreq = smbd_smb2_read_send(req, req->sconn->ev_ctx,
				     req, in_fsp,
				     in_length,
				     in_offset,
				     in_minimum_count,
				     in_remaining_bytes);
	if (subreq == NULL) {
		return smbd_smb2_request_error(req, NT_STATUS_NO_MEMORY);
	}
	tevent_req_set_callback(subreq, smbd_smb2_request_read_done, req);

	return smbd_smb2_request_pending_queue(req, subreq, 500);
}
开发者ID:dmitry-shavyrin,项目名称:samba4_embedded_build,代码行数:58,代码来源:smb2_read.c


示例11: smbd_smb2_request_process_sesssetup

NTSTATUS smbd_smb2_request_process_sesssetup(struct smbd_smb2_request *smb2req)
{
	const uint8_t *inhdr;
	const uint8_t *inbody;
	uint64_t in_session_id;
	uint8_t in_flags;
	uint8_t in_security_mode;
	uint64_t in_previous_session_id;
	uint16_t in_security_offset;
	uint16_t in_security_length;
	DATA_BLOB in_security_buffer;
	NTSTATUS status;
	struct tevent_req *subreq;

	status = smbd_smb2_request_verify_sizes(smb2req, 0x19);
	if (!NT_STATUS_IS_OK(status)) {
		return smbd_smb2_request_error(smb2req, status);
	}
	inhdr = SMBD_SMB2_IN_HDR_PTR(smb2req);
	inbody = SMBD_SMB2_IN_BODY_PTR(smb2req);

	in_session_id = BVAL(inhdr, SMB2_HDR_SESSION_ID);

	in_flags = CVAL(inbody, 0x02);
	in_security_mode = CVAL(inbody, 0x03);
	/* Capabilities = IVAL(inbody, 0x04) */
	/* Channel = IVAL(inbody, 0x08) */
	in_security_offset = SVAL(inbody, 0x0C);
	in_security_length = SVAL(inbody, 0x0E);
	in_previous_session_id = BVAL(inbody, 0x10);

	if (in_security_offset != (SMB2_HDR_BODY + SMBD_SMB2_IN_BODY_LEN(smb2req))) {
		return smbd_smb2_request_error(smb2req, NT_STATUS_INVALID_PARAMETER);
	}

	if (in_security_length > SMBD_SMB2_IN_DYN_LEN(smb2req)) {
		return smbd_smb2_request_error(smb2req, NT_STATUS_INVALID_PARAMETER);
	}

	in_security_buffer.data = SMBD_SMB2_IN_DYN_PTR(smb2req);
	in_security_buffer.length = in_security_length;

	subreq = smbd_smb2_session_setup_wrap_send(smb2req,
						   smb2req->sconn->ev_ctx,
						   smb2req,
						   in_session_id,
						   in_flags,
						   in_security_mode,
						   in_previous_session_id,
						   in_security_buffer);
	if (subreq == NULL) {
		return smbd_smb2_request_error(smb2req, NT_STATUS_NO_MEMORY);
	}
	tevent_req_set_callback(subreq, smbd_smb2_request_sesssetup_done, smb2req);

	return smbd_smb2_request_pending_queue(smb2req, subreq, 500);
}
开发者ID:zentyal,项目名称:samba,代码行数:57,代码来源:smb2_sesssetup.c


示例12: smbd_smb2_request_process_notify

NTSTATUS smbd_smb2_request_process_notify(struct smbd_smb2_request *req)
{
	struct smbXsrv_connection *xconn = req->xconn;
	NTSTATUS status;
	const uint8_t *inbody;
	uint16_t in_flags;
	uint32_t in_output_buffer_length;
	uint64_t in_file_id_persistent;
	uint64_t in_file_id_volatile;
	struct files_struct *in_fsp;
	uint64_t in_completion_filter;
	struct tevent_req *subreq;

	status = smbd_smb2_request_verify_sizes(req, 0x20);
	if (!NT_STATUS_IS_OK(status)) {
		return smbd_smb2_request_error(req, status);
	}
	inbody = SMBD_SMB2_IN_BODY_PTR(req);

	in_flags		= SVAL(inbody, 0x02);
	in_output_buffer_length	= IVAL(inbody, 0x04);
	in_file_id_persistent	= BVAL(inbody, 0x08);
	in_file_id_volatile	= BVAL(inbody, 0x10);
	in_completion_filter	= IVAL(inbody, 0x18);

	/*
	 * 0x00010000 is what Windows 7 uses,
	 * Windows 2008 uses 0x00080000
	 */
	if (in_output_buffer_length > xconn->smb2.server.max_trans) {
		return smbd_smb2_request_error(req, NT_STATUS_INVALID_PARAMETER);
	}

	status = smbd_smb2_request_verify_creditcharge(req,
						in_output_buffer_length);

	if (!NT_STATUS_IS_OK(status)) {
		return smbd_smb2_request_error(req, status);
	}

	in_fsp = file_fsp_smb2(req, in_file_id_persistent, in_file_id_volatile);
	if (in_fsp == NULL) {
		return smbd_smb2_request_error(req, NT_STATUS_FILE_CLOSED);
	}

	subreq = smbd_smb2_notify_send(req, req->sconn->ev_ctx,
				       req, in_fsp,
				       in_flags,
				       in_output_buffer_length,
				       in_completion_filter);
	if (subreq == NULL) {
		return smbd_smb2_request_error(req, NT_STATUS_NO_MEMORY);
	}
	tevent_req_set_callback(subreq, smbd_smb2_request_notify_done, req);

	return smbd_smb2_request_pending_queue(req, subreq, 500);
}
开发者ID:DanilKorotenko,项目名称:samba,代码行数:57,代码来源:smb2_notify.c


示例13: coresight_get_sysctrl_status

s32 coresight_get_sysctrl_status(void)
{

    u32 clk = 0;
    u32 rst = 0;
    u32 tcmos = 0;

    if(g_modem_sysctrl_cfg.mdm_ctrl_sys_virt_addr == NULL)
    {
        printk("sys ctrl base addr is null\n");
        return BSP_ERROR;
    }
    clk = readl((u32)((u32)g_modem_sysctrl_cfg.mdm_ctrl_sys_virt_addr + g_modem_sysctrl_cfg.clk.offset));

    rst = readl((u32)((u32)g_modem_sysctrl_cfg.mdm_ctrl_sys_virt_addr + g_modem_sysctrl_cfg.rst.offset));

    tcmos = readl((u32)((u32)g_modem_sysctrl_cfg.mdm_ctrl_sys_virt_addr + g_modem_sysctrl_cfg.mtcmos.offset));

    g_modem_sys_val[0] = clk;
    g_modem_sys_val[1] = rst;
    g_modem_sys_val[2] = tcmos;


    if(!BVAL(clk, g_modem_sysctrl_cfg.clk.mcpu_dbg_clk_status))
    {
        cs_error("clk = %x,rst = %x,tcmos = %x\n",clk,rst,tcmos);
        cs_error("modem a9 mcpu_dbg_clk_status is disable,mcpu_dbg_clk_status=0x%x status=0x%x\n",g_modem_sysctrl_cfg.clk.mcpu_dbg_clk_status,clk);
        return BSP_ERROR;
    }
    if(!BVAL(clk, g_modem_sysctrl_cfg.clk.mcpu_pd_clk_status))
    {
        cs_error("clk = %x,rst = %x,tcmos = %x\n",clk,rst,tcmos);
        cs_error("modem a9 mcpu_pd_clk_status is disable,bit=0x%x status=0x%x\n",g_modem_sysctrl_cfg.clk.mcpu_pd_clk_status,clk);
        return BSP_ERROR;
    }
    if(BVAL(rst, g_modem_sysctrl_cfg.rst.mdma9_pd_srst_status))
    {
        cs_error("clk = %x,rst = %x,tcmos = %x\n",clk,rst,tcmos);
        cs_error("modem a9 mdma9_pd_srst_status is disable,bit=0x%x status =0x%x\n",g_modem_sysctrl_cfg.rst.mdma9_pd_srst_status,rst);
        return BSP_ERROR;
    }
    if(BVAL(rst, g_modem_sysctrl_cfg.rst.moda9_cpu_srst_status))
    {
        cs_error("clk = %x,rst = %x,tcmos = %x\n",clk,rst,tcmos);
        cs_error("modem a9 moda9_cpu_srst_status is disable,bit=0x%x status =0x%x\n",g_modem_sysctrl_cfg.rst.moda9_cpu_srst_status,rst);
        return BSP_ERROR;
    }
    if(!BVAL(tcmos, g_modem_sysctrl_cfg.mtcmos.cpu_mtcmos_strl_status))
    {
        cs_error("clk = %x,rst = %x,tcmos = %x\n",clk,rst,tcmos);
        cs_error("modem a9 moda9_cpu_srst_status is disable,bit=0x%x status = 0x%x",g_modem_sysctrl_cfg.mtcmos.cpu_mtcmos_strl_status,tcmos);
        return BSP_ERROR;
    }

    return BSP_OK;
}
开发者ID:XePeleato,项目名称:android_kernel_huawei_venus,代码行数:56,代码来源:coresight-dep.c


示例14: etm_os_lock_init

static void etm_os_lock_init(struct etm_ctx *etmdata)
{
	uint32_t etmoslsr;

	etmoslsr = etm_readl(etmdata, TRCOSLSR);
	if ((BVAL(etmoslsr, 0) == 0)  && BVAL(etmoslsr, 3))
		etmdata->os_lock_present = true;
	else
		etmdata->os_lock_present = false;
}
开发者ID:AudioGod,项目名称:Gods_kernel_yu_msm8916,代码行数:10,代码来源:jtagv8-mm.c


示例15: annotate

void annotate(void)
{
    char buf[64];
    int ypos, xpos;

    glMatrixMode(GL_PROJECTION);
    glLoadIdentity();
    glOrtho((GLdouble) 0, (GLdouble) wscreen,
	    (GLdouble) hscreen, (GLdouble) 0,
	    (GLdouble) -1.0, (GLdouble) 1.0);
    glMatrixMode(GL_MODELVIEW);
    glLoadIdentity();
    glPushMatrix();
    glColor3f(RVAL(0xffffff), GVAL(0xffffff), BVAL(0xffffff));
    if (actval == -1) {
	if (! strnull(getparam("ident")))
            showtext(getparam("ident"), 10, 20);
        sprintf(buf, "%.2f", tnow);
	showtext(buf, wscreen - (8 * strlen(buf) + 10), 20);
    } else {
        ypos = hscreen - 10;
	if (vectoroff != -1) {
	  sprintf(buf, "vector scale: %.2f", vscale);
	  showtext(buf, 10, ypos);
	  ypos -= 20;
	}
	if (scalaroff != -1 || dopcolor) {
	    xpos = 10;
	    sprintf(buf, "mapping: ");
	    showtext(buf, xpos, ypos);
	    xpos += 8 * strlen(buf);
	    sprintf(buf, "%.2f", cmidpt + crange);
	    glColor3f(RVAL(0x0000ff), GVAL(0x0000ff), BVAL(0x0000ff));
	    showtext(buf, xpos, ypos);
	    xpos += 8 * strlen(buf);
	    glColor3f(RVAL(0xffffff), GVAL(0xffffff), BVAL(0xffffff));
	    showtext(" to ", xpos, ypos);
	    xpos += 32;
	    sprintf(buf, "%.2f", cmidpt - crange);
	    glColor3f(RVAL(0xff4f00), GVAL(0xff4f00), BVAL(0xff4f00));
	    showtext(buf, xpos, ypos);
	    xpos += 8 * strlen(buf);
	    ypos -= 20;
	    glColor3f(RVAL(0xffffff), GVAL(0xffffff), BVAL(0xffffff));
	}
	sprintf(buf, "angles: %.2f, %.2f, %.2f", thetax, thetay, thetaz);
	showtext(buf, 10, ypos);
	ypos -= 20;
        sprintf(buf, "view: %.2f, %.2f, %.2f; %.2f",
		xoff, yoff, dview, fview);
	showtext(buf, 10, ypos);
	ypos -= 20;
    }	
    glPopMatrix();
}
开发者ID:joshuabarnes,项目名称:zeno,代码行数:55,代码来源:snapview.c


示例16: cli_get_fs_quota_info

NTSTATUS cli_get_fs_quota_info(struct cli_state *cli, int quota_fnum,
			       SMB_NTQUOTA_STRUCT *pqt)
{
	uint16_t setup[1];
	uint8_t param[2];
	uint8_t *rdata=NULL;
	uint32_t rdata_count=0;
	SMB_NTQUOTA_STRUCT qt;
	NTSTATUS status;

	ZERO_STRUCT(qt);

	if (!cli||!pqt) {
		smb_panic("cli_get_fs_quota_info() called with NULL Pointer!");
	}

	SSVAL(setup + 0, 0, TRANSACT2_QFSINFO);

	SSVAL(param,0,SMB_FS_QUOTA_INFORMATION);

	status = cli_trans(talloc_tos(), cli, SMBtrans2,
			   NULL, -1, /* name, fid */
			   0, 0,     /* function, flags */
			   setup, 1, 0, /* setup */
			   param, 2, 0, /* param */
			   NULL, 0, 560, /* data */
			   NULL,	 /* recv_flags2 */
			   NULL, 0, NULL, /* rsetup */
			   NULL, 0, NULL, /* rparam */
			   &rdata, 48, &rdata_count);

	if (!NT_STATUS_IS_OK(status)) {
		DEBUG(1, ("SMB_FS_QUOTA_INFORMATION failed: %s\n",
			  nt_errstr(status)));
		return status;
	}

	/* unknown_1 24 NULL bytes in pdata*/

	/* the soft quotas 8 bytes (uint64_t)*/
	qt.softlim = BVAL(rdata,24);

	/* the hard quotas 8 bytes (uint64_t)*/
	qt.hardlim = BVAL(rdata,32);

	/* quota_flags 2 bytes **/
	qt.qflags = SVAL(rdata,40);

	qt.qtype = SMB_USER_FS_QUOTA_TYPE;

	*pqt = qt;

	TALLOC_FREE(rdata);
	return status;
}
开发者ID:abartlet,项目名称:samba-old,代码行数:55,代码来源:cliquota.c


示例17: my_bool_listener

void my_bool_listener (PluginParam *param) {
  GtkCheckButton *editable;

  if (sdlGoom->config_win == 0) return;
  editable = GTK_CHECK_BUTTON(param->user_data);

  if (editable) {
    if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(editable)) != BVAL(*param))
      gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(editable),BVAL(*param));
  }
}
开发者ID:2BReality,项目名称:xbmc,代码行数:11,代码来源:gtk-callbacks.c


示例18: parse_user_quota_record

static bool parse_user_quota_record(const uint8_t *rdata,
				    unsigned int rdata_count,
				    unsigned int *offset,
				    SMB_NTQUOTA_STRUCT *pqt)
{
	int sid_len;
	SMB_NTQUOTA_STRUCT qt;

	ZERO_STRUCT(qt);

	if (!rdata||!offset||!pqt) {
		smb_panic("parse_quota_record: called with NULL POINTER!");
	}

	if (rdata_count < 40) {
		return False;
	}

	/* offset to next quota record.
	 * 4 bytes IVAL(rdata,0)
	 * unused here...
	 */
	*offset = IVAL(rdata,0);

	/* sid len */
	sid_len = IVAL(rdata,4);

	if (rdata_count < 40+sid_len) {
		return False;		
	}

	/* unknown 8 bytes in pdata 
	 * maybe its the change time in NTTIME
	 */

	/* the used space 8 bytes (uint64_t)*/
	qt.usedspace = BVAL(rdata,16);

	/* the soft quotas 8 bytes (uint64_t)*/
	qt.softlim = BVAL(rdata,24);

	/* the hard quotas 8 bytes (uint64_t)*/
	qt.hardlim = BVAL(rdata,32);

	if (!sid_parse((const char *)rdata+40,sid_len,&qt.sid)) {
		return false;
	}

	qt.qtype = SMB_USER_QUOTA_TYPE;

	*pqt = qt;

	return True;
}
开发者ID:abartlet,项目名称:samba-old,代码行数:54,代码来源:cliquota.c


示例19: render

void render(void)
{
    int step, oldc, newc;
    bodyptr bp;
    float cval;

    glMatrixMode(GL_PROJECTION);
    glLoadIdentity();
    gluPerspective((GLdouble) fview, (GLdouble) ((double) wscreen) / hscreen,
		   (GLdouble) 0.01 * dview, (GLdouble) 100.0 * dview);
    glGetFloatv(GL_PROJECTION_MATRIX, &projmat[0][0]);
    glMatrixMode(GL_MODELVIEW);
    glLoadIdentity();
    glClear(GL_COLOR_BUFFER_BIT);
    glPushMatrix();
    glTranslatef(xoff, yoff, -dview);
    glRotatef(-thetaz, 0.0, 0.0, 1.0);		/* same map as snaprotate   */
    glRotatef(-thetay, 0.0, 1.0, 0.0);
    glRotatef(-thetax, 1.0, 0.0, 0.0);
    glGetFloatv(GL_MODELVIEW_MATRIX, &viewmat[0][0]);
    glBegin(vectoroff == -1 ? GL_POINTS : GL_LINES);
    step = (actval == -1 ? 1 : rceil((float) nbody / (float) maxfast));
    oldc = -1;
    for (bp = btab; bp < NthBody(btab, nbody); bp = NthBody(bp, step)) {
        if (scalaroff == -1 && ! dopcolor)
            newc = Key(bp);
        else {
	    if (! dopcolor)
	        cval = (SelectReal(bp, scalaroff) - cmidpt) / crange;
	    else
	        cval = (dotvp(Vel(bp), znorm) - cmidpt) / crange;
	    newc = (cval >  1.0 ? 0x0000ff : cval >  0.6 ? 0x006fdf :
		    cval >  0.2 ? 0x00cf7f : cval > -0.2 ? 0x00ff00 :
		    cval > -0.6 ? 0x7fcf00 : cval > -1.0 ? 0xbf8f00 :
		    0xff4f00);
	}
        if (oldc != newc)
	    glColor3f(RVAL(newc), GVAL(newc), BVAL(newc));
	oldc = newc;
        glVertex3f(Pos(bp)[0], Pos(bp)[1], Pos(bp)[2]);
	if (vectoroff != -1)
	    glVertex3f(Pos(bp)[0] + vscale * SelectVect(bp, vectoroff)[0],
		       Pos(bp)[1] + vscale * SelectVect(bp, vectoroff)[1],
		       Pos(bp)[2] + vscale * SelectVect(bp, vectoroff)[2]);
    }
    glEnd();
    if (actval != -1) {
        glColor3f(RVAL(bcolor), GVAL(bcolor), BVAL(bcolor));
	glutWireCube(refscale);
    }
    glPopMatrix();
}
开发者ID:joshuabarnes,项目名称:zeno,代码行数:52,代码来源:snapview.c


示例20: smbd_smb2_request_process_close

NTSTATUS smbd_smb2_request_process_close(struct smbd_smb2_request *req)
{
	const uint8_t *inhdr;
	const uint8_t *inbody;
	int i = req->current_idx;
	uint8_t *outhdr;
	DATA_BLOB outbody;
	size_t expected_body_size = 0x18;
	size_t body_size;
	uint16_t in_flags;
	uint64_t in_file_id_persistent;
	uint64_t in_file_id_volatile;
	NTSTATUS status;

	inhdr = (const uint8_t *)req->in.vector[i+0].iov_base;
	if (req->in.vector[i+1].iov_len != (expected_body_size & 0xFFFFFFFE)) {
		return smbd_smb2_request_error(req, NT_STATUS_INVALID_PARAMETER);
	}

	inbody = (const uint8_t *)req->in.vector[i+1].iov_base;

	body_size = SVAL(inbody, 0x00);
	if (body_size != expected_body_size) {
		return smbd_smb2_request_error(req, NT_STATUS_INVALID_PARAMETER);
	}

	outbody = data_blob_talloc(req->out.vector, NULL, 0x3C);
	if (outbody.data == NULL) {
		return smbd_smb2_request_error(req, NT_STATUS_NO_MEMORY);
	}

	in_flags		= SVAL(inbody, 0x02);
	in_file_id_persistent	= BVAL(inbody, 0x08);
	in_file_id_volatile	= BVAL(inbody, 0x10);

	if (req->compat_chain_fsp) {
		/* skip check */
	} else if (in_file_id_persistent != in_file_id_volatile) {
		return smbd_smb2_request_error(req, NT_STATUS_FILE_CLOSED);
	}

	status = smbd_smb2_close(req,
				in_flags,
				in_file_id_volatile,
				&outbody);
	if (!NT_STATUS_IS_OK(status)) {
		return smbd_smb2_request_error(req, status);
	}

	outhdr = (uint8_t *)req->out.vector[i].iov_base;
	return smbd_smb2_request_done(req, outbody, NULL);
}
开发者ID:Arkhont,项目名称:samba,代码行数:52,代码来源:smb2_close.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ BX_CHECK函数代码示例发布时间:2022-05-30
下一篇:
C++ BV函数代码示例发布时间: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