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

C++ GUID_from_string函数代码示例

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

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



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


示例16: cmd_drsuapi_cracknames

static WERROR cmd_drsuapi_cracknames(struct rpc_pipe_client *cli,
				     TALLOC_CTX *mem_ctx, int argc,
				     const char **argv)
{
	NTSTATUS status;
	WERROR werr;
	int i;

	struct GUID bind_guid;
	struct policy_handle bind_handle;

	union drsuapi_DsNameCtr ctr;

	if (argc < 2) {
		printf("usage: %s name\n", argv[0]);
		return WERR_OK;
	}

	GUID_from_string(DRSUAPI_DS_BIND_GUID, &bind_guid);

	status = rpccli_drsuapi_DsBind(cli, mem_ctx,
				       &bind_guid,
				       NULL,
				       &bind_handle,
				       &werr);

	if (!NT_STATUS_IS_OK(status)) {
		return ntstatus_to_werror(status);
	}

	werr = cracknames(cli, mem_ctx,
			  &bind_handle,
			  DRSUAPI_DS_NAME_FORMAT_UNKNOWN,
			  DRSUAPI_DS_NAME_FORMAT_FQDN_1779,
			  1,
			  argv+1,
			  &ctr);

	if (!W_ERROR_IS_OK(werr)) {
		goto out;
	}

	for (i=0; i < ctr.ctr1->count; i++) {
		printf("status: %d\n",
			ctr.ctr1->array[i].status);
		printf("dns_domain_name: %s\n",
			ctr.ctr1->array[i].dns_domain_name);
		printf("result_name: %s\n",
			ctr.ctr1->array[i].result_name);
	}

 out:
	if (is_valid_policy_hnd(&bind_handle)) {
		rpccli_drsuapi_DsUnbind(cli, mem_ctx, &bind_handle, &werr);
	}

	return werr;
}
开发者ID:endisd,项目名称:samba,代码行数:58,代码来源:cmd_drsuapi.c


示例17: register_gp_extension

NTSTATUS register_gp_extension(TALLOC_CTX *gpext_ctx,
			       int version,
			       const char *name,
			       const char *guid,
			       struct gp_extension_methods *methods)
{
	struct gp_extension_methods *test;
	struct gp_extension *entry;
	NTSTATUS status;

	if (!gpext_ctx) {
		return NT_STATUS_INTERNAL_DB_ERROR;
	}

	if ((version != SMB_GPEXT_INTERFACE_VERSION)) {
		DEBUG(0,("Failed to register gp extension.\n"
		         "The module was compiled against "
			 "SMB_GPEXT_INTERFACE_VERSION %d,\n"
		         "current SMB_GPEXT_INTERFACE_VERSION is %d.\n"
		         "Please recompile against the current "
			 "version of samba!\n",
			 version, SMB_GPEXT_INTERFACE_VERSION));
		return NT_STATUS_OBJECT_TYPE_MISMATCH;
	}

	if (!guid || !name || !name[0] || !methods) {
		DEBUG(0,("Called with NULL pointer or empty name!\n"));
		return NT_STATUS_INVALID_PARAMETER;
	}

	test = get_methods_by_name(extensions, name);
	if (test) {
		DEBUG(0,("GP extension module %s already registered!\n",
			name));
		return NT_STATUS_OBJECT_NAME_COLLISION;
	}

	entry = talloc_zero(gpext_ctx, struct gp_extension);
	NT_STATUS_HAVE_NO_MEMORY(entry);

	entry->name = talloc_strdup(gpext_ctx, name);
	NT_STATUS_HAVE_NO_MEMORY(entry->name);

	entry->guid = talloc_zero(gpext_ctx, struct GUID);
	NT_STATUS_HAVE_NO_MEMORY(entry->guid);
	status = GUID_from_string(guid, entry->guid);
	NT_STATUS_NOT_OK_RETURN(status);

	entry->methods = methods;
	DLIST_ADD(extensions, entry);

	DEBUG(2,("Successfully added GP extension '%s' %s\n",
		name, GUID_string2(gpext_ctx, entry->guid)));

	return NT_STATUS_OK;
}
开发者ID:rchicoli,项目名称:samba,代码行数:56,代码来源:gpext.c


示例18: witness_AsyncNotify_check_IN

static bool witness_AsyncNotify_check_IN(struct torture_context *tctx,
					 struct witness_AsyncNotify *r)
{
	struct GUID guid;

	torture_assert_int_equal(tctx, r->in.context_handle.handle_type, 0, "r->in.context_handle.handle_type");
	torture_assert_ntstatus_ok(tctx, GUID_from_string("1fb9f2ee-2a4d-4bf8-af8b-cb9d4529a9ab", &guid), "");
	torture_assert_mem_equal(tctx, &r->in.context_handle.uuid, &guid, sizeof(guid), "r->in.context_handle.uuid");

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


示例19: witness_UnRegister_check_IN

static bool witness_UnRegister_check_IN(struct torture_context *tctx,
					struct witness_UnRegister *r)
{
	struct GUID guid;

	torture_assert_int_equal(tctx, r->in.context_handle.handle_type, 0, "r->in.context_handle.handle_type");
	torture_assert_ntstatus_ok(tctx, GUID_from_string("3ab88633-1e57-4c1a-856c-d1bc4b15bbb1", &guid), "");
	torture_assert_mem_equal(tctx, &r->in.context_handle.uuid, &guid, sizeof(guid), "r->in.context_handle.uuid");

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


示例20: test_handles_drsuapi

static bool test_handles_drsuapi(struct torture_context *torture)
{
	NTSTATUS status;
	struct dcerpc_pipe *p1, *p2;
	struct policy_handle handle;
	struct policy_handle handle2;
	struct GUID bind_guid;
	struct drsuapi_DsBind r;
	struct drsuapi_DsUnbind c;
	TALLOC_CTX *mem_ctx = talloc_new(torture);

	torture_comment(torture, "RPC-HANDLE-DRSUAPI\n");

	status = torture_rpc_connection(mem_ctx, &p1, &dcerpc_table_drsuapi);
	torture_assert_ntstatus_ok(torture, status, "opening drsuapi pipe1");

	status = torture_rpc_connection(mem_ctx, &p2, &dcerpc_table_drsuapi);
	torture_assert_ntstatus_ok(torture, status, "opening drsuapi pipe1");

	GUID_from_string(DRSUAPI_DS_BIND_GUID, &bind_guid);

	r.in.bind_guid = &bind_guid;
	r.in.bind_info = NULL;
	r.out.bind_handle = &handle;

	status = dcerpc_drsuapi_DsBind(p1, mem_ctx, &r);
	if (!NT_STATUS_IS_OK(status)) {
		torture_comment(torture, "drsuapi_DsBind not supported - skipping\n");
		talloc_free(mem_ctx);
		return true;
	}

	c.in.bind_handle = &handle;
	c.out.bind_handle = &handle2;

	status = dcerpc_drsuapi_DsUnbind(p2, mem_ctx, &c);
	torture_assert_ntstatus_equal(torture, status, NT_STATUS_NET_WRITE_FAULT, 
				      "closing policy handle on p2");
	torture_assert_int_equal(torture, p2->last_fault_code, DCERPC_FAULT_CONTEXT_MISMATCH, 
				      "closing policy handle on p2");

	status = dcerpc_drsuapi_DsUnbind(p1, mem_ctx, &c);
	torture_assert_ntstatus_ok(torture, status, "closing policy handle on p1");

	status = dcerpc_drsuapi_DsUnbind(p1, mem_ctx, &c);
	torture_assert_ntstatus_equal(torture, status, NT_STATUS_NET_WRITE_FAULT, 
				      "closing policy handle on p1 again");
	torture_assert_int_equal(torture, p1->last_fault_code, DCERPC_FAULT_CONTEXT_MISMATCH, 
				      "closing policy handle on p1 again");
	
	talloc_free(mem_ctx);

	return true;
}
开发者ID:technosaurus,项目名称:samba4-GPL2,代码行数:54,代码来源:handles.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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