当前位置: 首页>>代码示例>>C++>>正文


C++ GUID_from_string函数代码示例

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


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

示例1: GUID_from_string

static PyObject *py_get_class_object(PyObject *self, PyObject *args)
{
	char *s_clsid, *s_iid;
	struct GUID clsid, iid;
	struct IUnknown *object;
	NTSTATUS status;
	WERROR error;

	if (!PyArg_ParseTuple(args, "ss", &s_clsid, &s_iid))
		return NULL;

	status = GUID_from_string(s_clsid, &clsid);
	if (!NT_STATUS_IS_OK(status)) {
		PyErr_FromNTSTATUS(status);
		return NULL;
	}

	status = GUID_from_string(s_iid, &iid);
	if (!NT_STATUS_IS_OK(status)) {
		PyErr_FromNTSTATUS(status);
		return NULL;
	}

	error = com_get_class_object(py_com_ctx, &clsid, &iid, &object);
	if (!W_ERROR_IS_OK(error)) {
		PyErr_FromWERROR(error);
		return NULL;
	}
	
	/* FIXME: Magic, integrate with stubs generated by pidl. */

	Py_RETURN_NONE;
}
开发者ID:AllardJ,项目名称:Tomato,代码行数:33,代码来源:pycom.c

示例2: test_guid_from_string

static bool test_guid_from_string(struct torture_context *tctx)
{
	struct GUID g1, exp;
	torture_assert_ntstatus_ok(tctx,
				   GUID_from_string("00000001-0002-0003-0405-060708090a0b", &g1),
				   "invalid return code");
	exp.time_low = 1;
	exp.time_mid = 2;
	exp.time_hi_and_version = 3;
	exp.clock_seq[0] = 4;
	exp.clock_seq[1] = 5;
	exp.node[0] = 6;
	exp.node[1] = 7;
	exp.node[2] = 8;
	exp.node[3] = 9;
	exp.node[4] = 10;
	exp.node[5] = 11;
	torture_assert(tctx, GUID_equal(&g1, &exp), "UUID parsed incorrectly");
	torture_assert_ntstatus_ok(tctx,
				   GUID_from_string("{00000001-0002-0003-0405-060708090a0b}", &g1),
				   "invalid return code");
	torture_assert(tctx, GUID_equal(&g1, &exp), "UUID parsed incorrectly");

	return true;
}
开发者ID:sameerhussain,项目名称:samba,代码行数:25,代码来源:ndr.c

示例3: torture_wbem_login_async

static BOOL torture_wbem_login_async(struct torture_context *torture)
{
    BOOL ret = True;
    TALLOC_CTX *mem_ctx = talloc_init("torture_wbem_login_async");
    struct com_context *com_ctx = NULL;
    const char *binding = NULL;
    struct composite_context *c = NULL;
    struct composite_context *new_ctx = NULL;
    struct GUID clsid;
    struct GUID iid;

    /*
     * Initialize our COM and DCOM contexts.
     */
    com_init_ctx(&com_ctx, NULL);
    dcom_client_init(com_ctx, cmdline_credentials);

    /*
     * Pull our needed test arguments from the torture parameters subsystem.
     */
    binding = torture_setting_string(torture, "binding", NULL);

    /*
     * Create a new composite for our call sequence, with the private data being
     * our return flag.
     */
    c = composite_create(mem_ctx, com_ctx->event_ctx);
    c->private_data = &ret;

    /*
     * Create the parameters needed for the activation call: we need the CLSID
     * and IID for the specific interface we're after.
     */
    GUID_from_string(CLSID_WBEMLEVEL1LOGIN, &clsid);
    GUID_from_string(COM_IWBEMLEVEL1LOGIN_UUID, &iid);

    /*
     * Fire off the asynchronous activation request with all the needed
     * input parameters. Then wait for the composite to be done within the
     * context of this function, which allows all the asynchronous magic to
     * still happen.
     */
    new_ctx = dcom_activate_send(c, &clsid, binding, 1, &iid, com_ctx);
    composite_continue(c, new_ctx, torture_wbem_login_async_cont, c);
    composite_wait(new_ctx);
    talloc_free(c);
    talloc_report_full(mem_ctx, stdout);

    return ret;
}
开发者ID:aidenlai,项目名称:ZenPacks.zenoss.PySamba,代码行数:50,代码来源:dcom.c

示例4: cmd_netlogon_dsr_getdcname

static WERROR cmd_netlogon_dsr_getdcname(struct rpc_pipe_client *cli,
					 TALLOC_CTX *mem_ctx, int argc,
					 const char **argv)
{
	WERROR result;
	uint32 flags = DS_RETURN_DNS_NAME;
	const char *server_name = cli->cli->desthost;
	const char *domain_name;
	struct GUID domain_guid = GUID_zero();
	struct GUID site_guid = GUID_zero();
	struct DS_DOMAIN_CONTROLLER_INFO *info = NULL;

	if (argc < 2) {
		fprintf(stderr, "Usage: %s [domainname] [domain_name] [domain_guid] [site_guid] [flags]\n", argv[0]);
		return WERR_OK;
	}

	if (argc >= 2)
		domain_name = argv[1];

	if (argc >= 3) {
		if (!NT_STATUS_IS_OK(GUID_from_string(argv[2], &domain_guid))) {
			return WERR_NOMEM;
		}
	}

	if (argc >= 4) {
		if (!NT_STATUS_IS_OK(GUID_from_string(argv[3], &site_guid))) {
			return WERR_NOMEM;
		}
	}

	if (argc >= 5)
		sscanf(argv[4], "%x", &flags);
	
	result = rpccli_netlogon_dsr_getdcname(cli, mem_ctx, server_name, domain_name, 
					       &domain_guid, &site_guid, flags,
					       &info);

	if (W_ERROR_IS_OK(result)) {
		d_printf("DsGetDcName gave\n");
		display_ds_domain_controller_info(mem_ctx, info);
		return WERR_OK;
	}

	printf("rpccli_netlogon_dsr_getdcname returned %s\n",
	       dos_errstr(result));

	return result;
}
开发者ID:aosm,项目名称:samba,代码行数:50,代码来源:cmd_netlogon.c

示例5: com_simple_init

NTSTATUS com_simple_init(void)
{
	struct GUID clsid;
	struct IUnknown *class_object = talloc(talloc_autofree_context(), struct IUnknown);

	class_object->ctx = NULL;
	class_object->object_data = NULL;
	class_object->vtable = (struct IUnknown_vtable *)&simple_classobject_vtable;

	GUID_from_string(CLSID_SIMPLE, &clsid);
	GUID_from_string(COM_ICLASSFACTORY_UUID, &simple_classobject_vtable.iid);
	GUID_from_string(COM_ISTREAM_UUID, &simple_IStream_vtable.iid);

	return com_register_running_class(&clsid, PROGID_SIMPLE, class_object);
}
开发者ID:AIdrifter,项目名称:samba,代码行数:15,代码来源:simple.c

示例6: torture_wbem_login

/*
 * Test activating the IWbemLevel1Login interface synchronously.
 */
static BOOL torture_wbem_login(struct torture_context *torture)
{
    BOOL ret = True;
    TALLOC_CTX *mem_ctx = talloc_init("torture_wbem_login");
    struct com_context *com_ctx = NULL;
    const char *binding = NULL;
    struct IUnknown **mqi = NULL;
    struct GUID clsid;
    struct GUID iid;
    NTSTATUS status;

    /*
     * Initialize our COM and DCOM contexts.
     */
    com_init_ctx(&com_ctx, NULL);
    dcom_client_init(com_ctx, cmdline_credentials);

    /*
     * Pull our needed test arguments from the torture parameters subsystem.
     */
    binding = torture_setting_string(torture, "binding", NULL);

    /*
     * Create the parameters needed for the activation call: we need the CLSID
     * and IID for the specific interface we're after.
     */
    GUID_from_string(CLSID_WBEMLEVEL1LOGIN, &clsid);
    GUID_from_string(COM_IWBEMLEVEL1LOGIN_UUID, &iid);

    /*
     * Activate the interface using the DCOM synchronous method call.
     */
    status = dcom_activate(com_ctx, mem_ctx, binding, &clsid, &iid, 1, &mqi);
    ret = NT_STATUS_IS_OK(status);
    if (ret)
    {
        /*
         * Clean up by releasing the IUnknown interface on the remote server
         * and also by releasing our allocated interface pointer.
         */
        IUnknown_Release(mqi[0], mem_ctx);
        talloc_free(mqi);
    }

    talloc_report_full(mem_ctx, stdout);

    return ret;
}
开发者ID:aidenlai,项目名称:ZenPacks.zenoss.PySamba,代码行数:51,代码来源:dcom.c

示例7: talloc

static struct bkrp_BackupKey *createRetreiveBackupKeyGUIDStruct(struct torture_context *tctx,
				struct dcerpc_pipe *p, int version, DATA_BLOB *out)
{
	struct dcerpc_binding *binding = p->binding;
	struct bkrp_client_side_wrapped data;
	struct GUID *g = talloc(tctx, struct GUID);
	struct bkrp_BackupKey *r = talloc_zero(tctx, struct bkrp_BackupKey);
	enum ndr_err_code ndr_err;
	DATA_BLOB blob;
	NTSTATUS status;

	if (r == NULL) {
		return NULL;
	}

	binding->flags = binding->flags & (DCERPC_SEAL|DCERPC_AUTH_SPNEGO);
	ZERO_STRUCT(data);
	status = GUID_from_string(BACKUPKEY_RETRIEVE_BACKUP_KEY_GUID, g);
	if (!NT_STATUS_IS_OK(status)) {
		return NULL;
	}

	r->in.guidActionAgent = g;
	data.version = version;
	ndr_err = ndr_push_struct_blob(&blob, tctx, &data,
			(ndr_push_flags_fn_t)ndr_push_bkrp_client_side_wrapped);
	if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
		return NULL;
	}
	r->in.data_in = blob.data;
	r->in.data_in_len = blob.length;
	r->out.data_out = &out->data;
	r->out.data_out_len = talloc(r, uint32_t);
	return r;
}
开发者ID:AIdrifter,项目名称:samba,代码行数:35,代码来源:backupkey.c

示例8: netlogon_samlogon_response_check2

static bool netlogon_samlogon_response_check2(struct torture_context *tctx,
					      struct netlogon_samlogon_response *r)
{
	struct GUID guid;
	torture_assert_ntstatus_ok(tctx, GUID_from_string("138daf55-918c-4170-9d46-d4d50490aa13", &guid), "");

	torture_assert_int_equal(tctx, r->ntver, 5, "ntver");
	torture_assert_int_equal(tctx, r->data.nt5_ex.command, LOGON_SAM_LOGON_RESPONSE_EX, "command");
	torture_assert_int_equal(tctx, r->data.nt5_ex.sbz, 0, "sbz");
	torture_assert_int_equal(tctx, r->data.nt5_ex.server_type, 0x000033fd, "server_type");
	torture_assert_guid_equal(tctx, r->data.nt5_ex.domain_uuid, guid, "domain_uuid");
	torture_assert_str_equal(tctx, r->data.nt5_ex.forest, "bla.base", "forest");
	torture_assert_str_equal(tctx, r->data.nt5_ex.dns_domain, "bla.base", "dns_domain");
	torture_assert_str_equal(tctx, r->data.nt5_ex.pdc_dns_name, "W2K8R2-219.bla.base", "pdc_dns_name");
	torture_assert_str_equal(tctx, r->data.nt5_ex.domain_name, "BLA", "domain_name");
	torture_assert_str_equal(tctx, r->data.nt5_ex.pdc_name, "W2K8R2-219", "pdc_name");
	torture_assert_str_equal(tctx, r->data.nt5_ex.user_name, "w2012r2-l6.base.", "user_name");
	torture_assert_str_equal(tctx, r->data.nt5_ex.server_site, "Default-First-Site-Name", "server_site");
	torture_assert_str_equal(tctx, r->data.nt5_ex.client_site, "Default-First-Site-Name", "client_site");
	torture_assert_int_equal(tctx, r->data.nt5_ex.sockaddr_size, 0, "sockaddr_size");
	/*
	 * sockaddr: struct nbt_sockaddr
	 *             sockaddr_family          : 0x00000000 (0)
	 *             pdc_ip                   : (null)
	 *             remaining                : DATA_BLOB length=0
	 */
	torture_assert_int_equal(tctx, r->data.nt5_ex.nt_version, 5, "nt_version");
	/* next_closest_site NULL */
	torture_assert_int_equal(tctx, r->data.nt5_ex.lmnt_token, 0xffff, "lmnt_token");
	torture_assert_int_equal(tctx, r->data.nt5_ex.lm20_token, 0xffff, "lm20_token");

	return true;
}
开发者ID:DanilKorotenko,项目名称:samba,代码行数:33,代码来源:nbt.c

示例9: gpo_sd_check_agp_object_guid

static bool gpo_sd_check_agp_object_guid(const struct security_ace_object *object)
{
	struct GUID ext_right_apg_guid;
	NTSTATUS status;

	if (!object) {
		return false;
	}

	status = GUID_from_string(ADS_EXTENDED_RIGHT_APPLY_GROUP_POLICY,
				  &ext_right_apg_guid);
	if (!NT_STATUS_IS_OK(status)) {
		return false;
	}

	switch (object->flags) {
		case SEC_ACE_OBJECT_TYPE_PRESENT:
			if (GUID_equal(&object->type.type,
				       &ext_right_apg_guid)) {
				return true;
			}
		case SEC_ACE_INHERITED_OBJECT_TYPE_PRESENT:
			if (GUID_equal(&object->inherited_type.inherited_type,
				       &ext_right_apg_guid)) {
				return true;
			}
		default:
			break;
	}

	return false;
}
开发者ID:Alexandr-Galko,项目名称:samba,代码行数:32,代码来源:gpo_sec.c

示例10: unbecomeDC_drsuapi_bind_send

static void unbecomeDC_drsuapi_bind_send(struct libnet_UnbecomeDC_state *s)
{
	struct composite_context *c = s->creq;
	struct drsuapi_DsBindInfo28 *bind_info28;
	struct tevent_req *subreq;

	GUID_from_string(DRSUAPI_DS_BIND_GUID, &s->drsuapi.bind_guid);

	bind_info28				= &s->drsuapi.local_info28;
	bind_info28->supported_extensions	= 0;
	bind_info28->site_guid			= GUID_zero();
	bind_info28->pid			= 0;
	bind_info28->repl_epoch			= 0;

	s->drsuapi.bind_info_ctr.length		= 28;
	s->drsuapi.bind_info_ctr.info.info28	= *bind_info28;

	s->drsuapi.bind_r.in.bind_guid = &s->drsuapi.bind_guid;
	s->drsuapi.bind_r.in.bind_info = &s->drsuapi.bind_info_ctr;
	s->drsuapi.bind_r.out.bind_handle = &s->drsuapi.bind_handle;

	subreq = dcerpc_drsuapi_DsBind_r_send(s, c->event_ctx,
					      s->drsuapi.drsuapi_handle,
					      &s->drsuapi.bind_r);
	if (composite_nomem(subreq, c)) return;
	tevent_req_set_callback(subreq, unbecomeDC_drsuapi_bind_recv, s);
}
开发者ID:rchicoli,项目名称:samba,代码行数:27,代码来源:libnet_unbecome_dc.c

示例11: netlogon_samlogon_response_check

static bool netlogon_samlogon_response_check(struct torture_context *tctx,
					     struct netlogon_samlogon_response *r)
{
	struct GUID guid;
	torture_assert_ntstatus_ok(tctx, GUID_from_string("cd441303-001c-464c-a621-e9d6b9b12fe9", &guid), "");

	torture_assert_int_equal(tctx, r->ntver, 5, "ntver");
	torture_assert_int_equal(tctx, r->data.nt5_ex.command, LOGON_SAM_LOGON_RESPONSE_EX, "command");
	torture_assert_int_equal(tctx, r->data.nt5_ex.sbz, 0, "sbz");
	torture_assert_int_equal(tctx, r->data.nt5_ex.server_type, 0x000033fd, "server_type");
	torture_assert_guid_equal(tctx, r->data.nt5_ex.domain_uuid, guid, "domain_uuid");
	torture_assert_str_equal(tctx, r->data.nt5_ex.forest, "w2k8dom.ber.redhat.com", "forest");
	torture_assert_str_equal(tctx, r->data.nt5_ex.dns_domain, "w2k8dom.ber.redhat.com", "dns_domain");
	torture_assert_str_equal(tctx, r->data.nt5_ex.pdc_dns_name, "gdw2k8r2.w2k8dom.ber.redhat.com", "pdc_dns_name");
	torture_assert_str_equal(tctx, r->data.nt5_ex.domain_name, "W2K8DOM", "domain_name");
	torture_assert_str_equal(tctx, r->data.nt5_ex.pdc_name, "GDW2K8R2", "pdc_name");
	torture_assert_str_equal(tctx, r->data.nt5_ex.user_name, "", "user_name");
	torture_assert_str_equal(tctx, r->data.nt5_ex.server_site, "Default-First-Site-Name", "server_site");
	torture_assert_str_equal(tctx, r->data.nt5_ex.client_site, "Default-First-Site-Name", "client_site");
	torture_assert_int_equal(tctx, r->data.nt5_ex.sockaddr_size, 0, "sockaddr_size");
	/* sockaddr: struct nbt_sockaddr
	 *             sockaddr_family          : 0x00000000 (0)
	 *             pdc_ip                   : (null)
	 *             remaining                : DATA_BLOB length=0 */
	torture_assert_int_equal(tctx, r->data.nt5_ex.nt_version, 5, "nt_version");
	/* next_closest_site NULL */
	torture_assert_int_equal(tctx, r->data.nt5_ex.lmnt_token, 0xffff, "lmnt_token");
	torture_assert_int_equal(tctx, r->data.nt5_ex.lm20_token, 0xffff, "lm20_token");

	return true;
}
开发者ID:DanilKorotenko,项目名称:samba,代码行数:31,代码来源:nbt.c

示例12: test_RemoteActivation

static bool test_RemoteActivation(struct torture_context *tctx, 
								 struct dcerpc_pipe *p)
{
	struct RemoteActivation r;
	NTSTATUS status;
	struct GUID iids[1];
	uint16_t protseq[3] = { EPM_PROTOCOL_TCP, EPM_PROTOCOL_NCALRPC, EPM_PROTOCOL_UUID };

	ZERO_STRUCT(r.in);
	r.in.this_object.version.MajorVersion = 5;
	r.in.this_object.version.MinorVersion = 1;
	r.in.this_object.cid = GUID_random();
	GUID_from_string(CLSID_IMAGEDOC, &r.in.Clsid);
	r.in.ClientImpLevel = RPC_C_IMP_LEVEL_IDENTIFY;
	r.in.num_protseqs = 3;
	r.in.protseq = protseq;
	r.in.Interfaces = 1;
	GUID_from_string(DCERPC_IUNKNOWN_UUID, &iids[0]);
	r.in.pIIDs = iids;

	status = dcerpc_RemoteActivation(p, tctx, &r);
	torture_assert_ntstatus_ok(tctx, status, "RemoteActivation");

	torture_assert_werr_ok(tctx, r.out.result, "RemoteActivation");

	torture_assert_werr_ok(tctx, *r.out.hr, "RemoteActivation");

	torture_assert_werr_ok(tctx, r.out.results[0], "RemoteActivation");

	GUID_from_string(DCERPC_ICLASSFACTORY_UUID, &iids[0]);
	r.in.Interfaces = 1;
	r.in.Mode = MODE_GET_CLASS_OBJECT;

	status = dcerpc_RemoteActivation(p, tctx, &r);
	torture_assert_ntstatus_ok(tctx, status, 
							   "RemoteActivation(GetClassObject)");

	torture_assert_werr_ok(tctx, r.out.result, 
						   "RemoteActivation(GetClassObject)");

	torture_assert_werr_ok(tctx, *r.out.hr, "RemoteActivation(GetClassObject)");

	torture_assert_werr_ok(tctx, r.out.results[0], 
						   "RemoteActivation(GetClassObject)");

	return true;
}
开发者ID:0x24bin,项目名称:winexe-1,代码行数:47,代码来源:remact.c

示例13: cmd_netlogon_dsr_getdcnameex

static WERROR cmd_netlogon_dsr_getdcnameex(struct rpc_pipe_client *cli,
					   TALLOC_CTX *mem_ctx, int argc,
					   const char **argv)
{
	WERROR result;
	NTSTATUS status;
	uint32_t flags = DS_RETURN_DNS_NAME;
	const char *server_name = cli->desthost;
	const char *domain_name;
	const char *site_name = NULL;
	struct GUID domain_guid = GUID_zero();
	struct netr_DsRGetDCNameInfo *info = NULL;
	struct dcerpc_binding_handle *b = cli->binding_handle;

	if (argc < 2) {
		fprintf(stderr, "Usage: %s [domain_name] [domain_guid] "
				"[site_name] [flags]\n", argv[0]);
		return WERR_OK;
	}

	domain_name = argv[1];

	if (argc >= 3) {
		if (!NT_STATUS_IS_OK(GUID_from_string(argv[2], &domain_guid))) {
			return WERR_NOMEM;
		}
	}

	if (argc >= 4) {
		site_name = argv[3];
	}

	if (argc >= 5) {
		sscanf(argv[4], "%x", &flags);
	}

	debug_dsdcinfo_flags(1,flags);

	status = dcerpc_netr_DsRGetDCNameEx(b, mem_ctx,
					    server_name,
					    domain_name,
					    &domain_guid,
					    site_name,
					    flags,
					    &info,
					    &result);
	if (!NT_STATUS_IS_OK(status)) {
		return ntstatus_to_werror(status);
	}

	if (!W_ERROR_IS_OK(result)) {
		return result;
	}

	d_printf("DsRGetDCNameEx gave %s\n",
		NDR_PRINT_STRUCT_STRING(mem_ctx, netr_DsRGetDCNameInfo, info));

	return result;
}
开发者ID:srimalik,项目名称:samba,代码行数:59,代码来源:cmd_netlogon.c

示例14: test_guid_from_string_null

static bool test_guid_from_string_null(struct torture_context *tctx)
{
	struct GUID guid;
	torture_assert_ntstatus_equal(tctx, NT_STATUS_INVALID_PARAMETER,
				      GUID_from_string(NULL, &guid),
				      "NULL failed");
	return true;
}
开发者ID:sameerhussain,项目名称:samba,代码行数:8,代码来源:ndr.c

示例15: test_guid_from_string_invalid

static bool test_guid_from_string_invalid(struct torture_context *tctx)
{
	struct GUID g1;
	torture_assert_ntstatus_equal(tctx, NT_STATUS_INVALID_PARAMETER,
				      GUID_from_string("bla", &g1),
				      "parameter not invalid");
	return true;
}
开发者ID:sameerhussain,项目名称:samba,代码行数:8,代码来源:ndr.c


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