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

C++ GUID_string函数代码示例

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

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



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

示例1: disp_sec_ace_object

/****************************************************************************
 display sec_ace object
 ****************************************************************************/
static void disp_sec_ace_object(struct security_ace_object *object)
{
	if (object->flags & SEC_ACE_OBJECT_TYPE_PRESENT) {
		printf("Object type: SEC_ACE_OBJECT_TYPE_PRESENT\n");
		printf("Object GUID: %s\n", GUID_string(talloc_tos(),
			&object->type.type));
	}
	if (object->flags & SEC_ACE_INHERITED_OBJECT_TYPE_PRESENT) {
		printf("Object type: SEC_ACE_INHERITED_OBJECT_TYPE_PRESENT\n");
		printf("Object GUID: %s\n", GUID_string(talloc_tos(), 
			&object->inherited_type.inherited_type));
	}
}
开发者ID:0x24bin,项目名称:winexe-1,代码行数:16,代码来源:display_sec.c


示例2: talloc_new

/*
  encode an ACE in SDDL format
*/
static char *sddl_encode_ace(TALLOC_CTX *mem_ctx, const struct security_ace *ace,
			     const struct dom_sid *domain_sid)
{
	char *sddl = NULL;
	TALLOC_CTX *tmp_ctx;
	const char *s_type="", *s_flags="", *s_mask="", 
		*s_object="", *s_iobject="", *s_trustee="";

	tmp_ctx = talloc_new(mem_ctx);
	if (tmp_ctx == NULL) {
		DEBUG(0, ("talloc_new failed\n"));
		return NULL;
	}

	s_type = sddl_flags_to_string(tmp_ctx, ace_types, ace->type, True);
	if (s_type == NULL) goto failed;

	s_flags = sddl_flags_to_string(tmp_ctx, ace_flags, ace->flags, True);
	if (s_flags == NULL) goto failed;

	s_mask = sddl_flags_to_string(tmp_ctx, ace_access_mask, ace->access_mask, True);
	if (s_mask == NULL) {
		s_mask = talloc_asprintf(tmp_ctx, "0x%08x", ace->access_mask);
		if (s_mask == NULL) goto failed;
	}

	if (ace->type == SEC_ACE_TYPE_ACCESS_ALLOWED_OBJECT ||
	    ace->type == SEC_ACE_TYPE_ACCESS_DENIED_OBJECT ||
	    ace->type == SEC_ACE_TYPE_SYSTEM_AUDIT_OBJECT ||
	    ace->type == SEC_ACE_TYPE_SYSTEM_AUDIT_OBJECT) {
		if (ace->object.object.flags & SEC_ACE_OBJECT_TYPE_PRESENT) {
			s_object = GUID_string(tmp_ctx, &ace->object.object.type.type);
			if (s_object == NULL) goto failed;
		}

		if (ace->object.object.flags & SEC_ACE_INHERITED_OBJECT_TYPE_PRESENT) {
			s_iobject = GUID_string(tmp_ctx, &ace->object.object.inherited_type.inherited_type);
			if (s_iobject == NULL) goto failed;
		}
	}
	
	s_trustee = sddl_encode_sid(tmp_ctx, &ace->trustee, domain_sid);
	if (s_trustee == NULL) goto failed;

	sddl = talloc_asprintf(mem_ctx, "%s;%s;%s;%s;%s;%s",
			       s_type, s_flags, s_mask, s_object, s_iobject, s_trustee);

failed:
	talloc_free(tmp_ctx);
	return sddl;
}
开发者ID:technosaurus,项目名称:samba4-GPL2,代码行数:54,代码来源:sddl.c


示例3: parse_namedprop_cb

static enum MAPISTATUS
parse_namedprop_cb (uint32_t proptag, struct MAPINAMEID nameid, void *closure)
{
	/* the next property is a named property, but cannot make it proptag, thus left it for later */
	EMapiFXParserClosure *data = closure;
	uint32_t lid = MAPI_E_RESERVED;
	char *guid;

	guid = GUID_string (data->mem_ctx, &(nameid.lpguid));

	if (nameid.ulKind == MNID_ID) {
		if (mapi_nameid_lid_lookup_canonical (nameid.kind.lid, guid, &lid) != MAPI_E_SUCCESS)
			lid = MAPI_E_RESERVED;
	} else if (nameid.ulKind == MNID_STRING) {
		if (mapi_nameid_string_lookup_canonical (nameid.kind.lpwstr.Name, guid, &lid) != MAPI_E_SUCCESS)
			lid = MAPI_E_RESERVED;
	}

	talloc_free (guid);

	if (lid != MAPI_E_RESERVED && (lid & 0xFFFF) == (proptag & 0xFFFF)) {
		data->next_proptag_is_nameid = proptag;
		data->next_nameid_proptag = lid;
	}

	return MAPI_E_SUCCESS;
}
开发者ID:lygstate,项目名称:evolution-mapi,代码行数:27,代码来源:e-mapi-fast-transfer.c


示例4: PyErr_LDB_OR_RAISE

static PyObject *py_samdb_ntds_objectGUID(PyObject *self, PyObject *args)
{
	PyObject *py_ldb, *result;
	struct ldb_context *ldb;
	const struct GUID *guid;
	char *retstr;

	if (!PyArg_ParseTuple(args, "O", &py_ldb)) {
		return NULL;
	}

	PyErr_LDB_OR_RAISE(py_ldb, ldb);

	guid = samdb_ntds_objectGUID(ldb);
	if (guid == NULL) {
		PyErr_SetString(PyExc_RuntimeError, "Failed to find NTDS GUID");
		return NULL;
	}

	retstr = GUID_string(NULL, guid);
	if (retstr == NULL) {
		PyErr_NoMemory();
		return NULL;
	}
	result = PyString_FromString(retstr);
	talloc_free(retstr);
	return result;
}
开发者ID:285858315,项目名称:samba,代码行数:28,代码来源:pydsdb.c


示例5: get_dn_from_invocation_id

/*
  get the DN of the nTDSDSA object from the configuration partition
  whose invocationId is 'invocation_id'
  put the value on 'dn_str'
*/
static WERROR get_dn_from_invocation_id(TALLOC_CTX *mem_ctx,
					struct ldb_context *samdb,
					struct GUID *invocation_id,
					const char **dn_str)
{
	char *invocation_id_str;
	const char *attrs_invocation[] = { NULL };
	struct ldb_message *msg;
	int ret;

	invocation_id_str = GUID_string(mem_ctx, invocation_id);
	W_ERROR_HAVE_NO_MEMORY(invocation_id_str);

	ret = dsdb_search_one(samdb, invocation_id_str, &msg, ldb_get_config_basedn(samdb), LDB_SCOPE_SUBTREE,
			      attrs_invocation, 0, "(&(objectClass=nTDSDSA)(invocationId=%s))", invocation_id_str);
	if (ret != LDB_SUCCESS) {
		DEBUG(0, (__location__ ": Failed search for the object DN under %s whose invocationId is %s",
			  invocation_id_str, ldb_dn_get_linearized(ldb_get_config_basedn(samdb))));
		talloc_free(invocation_id_str);
		return WERR_INTERNAL_ERROR;
	}

	*dn_str = ldb_dn_alloc_linearized(mem_ctx, msg->dn);
	talloc_free(invocation_id_str);
	return WERR_OK;
}
开发者ID:Alexandr-Galko,项目名称:samba,代码行数:31,代码来源:kcc_drs_replica_info.c


示例6: GUID_string

static struct IUnknown *get_com_class_so(TALLOC_CTX *mem_ctx, const struct GUID *clsid)
{
	char *module_name;
	char *clsid_str;
	void *mod;
	get_class_object_function f;

	clsid_str = GUID_string(mem_ctx, clsid);
	module_name = talloc_asprintf(mem_ctx, "%s.so", clsid_str);
	talloc_free(clsid_str);

	mod = dlopen(module_name, 0);

	if (!mod) {
		return NULL;
	}
	
	f = dlsym(mod, "get_class_object");

	if (!f) {
		dlclose(mod);
		return NULL;
	}

	return f(clsid);
}
开发者ID:AIdrifter,项目名称:samba,代码行数:26,代码来源:tables.c


示例7: test_Lookup_simple

static bool test_Lookup_simple(struct torture_context *tctx,
			       struct dcerpc_pipe *p)
{
	NTSTATUS status;
	struct epm_Lookup r;
	struct policy_handle entry_handle;
	uint32_t num_ents = 0;
	struct dcerpc_binding_handle *h = p->binding_handle;

	ZERO_STRUCT(entry_handle);

	torture_comment(tctx, "Testing epm_Lookup\n");

	/* get all elements */
	r.in.inquiry_type = RPC_C_EP_ALL_ELTS;
	r.in.object = NULL;
	r.in.interface_id = NULL;
	r.in.vers_option = RPC_C_VERS_ALL;

	r.in.entry_handle = &entry_handle;
	r.in.max_ents = 10;

	r.out.entry_handle = &entry_handle;
	r.out.num_ents = &num_ents;

	do {
		int i;

		status = dcerpc_epm_Lookup_r(h, tctx, &r);
		if (!NT_STATUS_IS_OK(status) ||
		    r.out.result != EPMAPPER_STATUS_OK) {
			break;
		}

		torture_comment(tctx,
				"epm_Lookup returned %d events, entry_handle: %s\n",
				*r.out.num_ents,
				GUID_string(tctx, &entry_handle.uuid));

		for (i = 0; i < *r.out.num_ents; i++) {
			torture_comment(tctx,
					"\n  Found '%s'\n",
					r.out.entries[i].annotation);

			display_tower(tctx, &r.out.entries[i].tower->tower);
		}
	} while (NT_STATUS_IS_OK(status) &&
		 r.out.result == EPMAPPER_STATUS_OK &&
		 *r.out.num_ents == r.in.max_ents &&
		 !ndr_policy_handle_empty(&entry_handle));

	torture_assert_ntstatus_ok(tctx, status, "epm_Lookup failed");
	torture_assert(tctx, r.out.result == EPMAPPER_STATUS_NO_MORE_ENTRIES, "epm_Lookup failed");

	torture_assert(tctx,
		       ndr_policy_handle_empty(&entry_handle),
		       "epm_Lookup failed - The policy handle should be emtpy.");

	return true;
}
开发者ID:AIdrifter,项目名称:samba,代码行数:60,代码来源:epmapper.c


示例8: GUID_string

_PUBLIC_ char *GUID_string2(TALLOC_CTX *mem_ctx, const struct GUID *guid)
{
	char *ret, *s = GUID_string(mem_ctx, guid);
	ret = talloc_asprintf(mem_ctx, "{%s}", s);
	talloc_free(s);
	return ret;
}
开发者ID:Marvin-Lee,项目名称:libwmiclient,代码行数:7,代码来源:uuid.c


示例9: mprDomainSecrets

static struct MprVar mprDomainSecrets(struct samba3_domainsecrets *ds)
{
	struct MprVar v, e = mprObject("domainsecrets");
	char *tmp;
	DATA_BLOB blob;

	mprSetVar(&e, "name", mprString(ds->name));

	tmp = dom_sid_string(NULL, &ds->sid);
	mprSetVar(&e, "sid", mprString(tmp));
	talloc_free(tmp);

	tmp = GUID_string(NULL, &ds->guid);
	mprSetVar(&e, "guid", mprString(tmp));
	talloc_free(tmp);

	mprSetVar(&e, "plaintext_pw", mprString(ds->plaintext_pw));

	mprSetVar(&e, "last_change_time", mprCreateIntegerVar(ds->last_change_time));
	mprSetVar(&e, "sec_channel_type", mprCreateIntegerVar(ds->sec_channel_type));

	v = mprObject("hash_pw");

	blob.data = ds->hash_pw.hash;
	blob.length = 16;
	mprSetVar(&v, "hash", mprDataBlob(blob));

	mprSetVar(&v, "mod_time", mprCreateIntegerVar(ds->hash_pw.mod_time));

	mprSetVar(&e, "hash_pw", v);

	return e;
}
开发者ID:Marvin-Lee,项目名称:libwmiclient,代码行数:33,代码来源:smbcalls_samba3.c


示例10: display_domain_controller_info_2

static void display_domain_controller_info_2(struct drsuapi_DsGetDCInfo2 *r)
{
	printf("netbios_name:\t%s\n", r->netbios_name);
	printf("dns_name:\t%s\n", r->dns_name);
	printf("site_name:\t%s\n", r->site_name);
	printf("site_dn:\t%s\n", r->site_dn);
	printf("computer_dn:\t%s\n", r->computer_dn);
	printf("server_dn:\t%s\n", r->server_dn);
	printf("ntds_dn:\t%s\n", r->ntds_dn);
	printf("is_pdc:\t\t%s\n", r->is_pdc ? "true" : "false");
	printf("is_enabled:\t%s\n", r->is_enabled ? "true" : "false");
	printf("is_gc:\t\t%s\n", r->is_gc ? "true" : "false");
	printf("site_guid:\t%s\n", GUID_string(talloc_tos(), &r->site_guid));
	printf("computer_guid:\t%s\n", GUID_string(talloc_tos(), &r->computer_guid));
	printf("server_guid:\t%s\n", GUID_string(talloc_tos(), &r->server_guid));
	printf("ntds_guid:\t%s\n", GUID_string(talloc_tos(), &r->ntds_guid));
}
开发者ID:Alexander--,项目名称:samba,代码行数:17,代码来源:cmd_drsuapi.c


示例11: talloc_strdup

/*
  form a binding string from a binding structure
*/
_PUBLIC_ char *dcerpc_binding_string(TALLOC_CTX *mem_ctx, const struct dcerpc_binding *b)
{
	char *s = talloc_strdup(mem_ctx, "");
	int i;
	const char *t_name = NULL;

	if (b->transport != NCA_UNKNOWN) {
		t_name = derpc_transport_string_by_transport(b->transport);
		if (!t_name) {
			return NULL;
		}
	}

	if (!GUID_all_zero(&b->object.uuid)) { 
		s = talloc_asprintf(s, "%[email protected]",
				    GUID_string(mem_ctx, &b->object.uuid));
	}

	if (t_name != NULL) {
		s = talloc_asprintf_append_buffer(s, "%s:", t_name);
		if (s == NULL) {
			return NULL;
		}
	}

	if (b->host) {
		s = talloc_asprintf_append_buffer(s, "%s", b->host);
	}

	if (!b->endpoint && !b->options && !b->flags) {
		return s;
	}

	s = talloc_asprintf_append_buffer(s, "[");

	if (b->endpoint) {
		s = talloc_asprintf_append_buffer(s, "%s", b->endpoint);
	}

	/* this is a *really* inefficent way of dealing with strings,
	   but this is rarely called and the strings are always short,
	   so I don't care */
	for (i=0;b->options && b->options[i];i++) {
		s = talloc_asprintf_append_buffer(s, ",%s", b->options[i]);
		if (!s) return NULL;
	}

	for (i=0;i<ARRAY_SIZE(ncacn_options);i++) {
		if (b->flags & ncacn_options[i].flag) {
			s = talloc_asprintf_append_buffer(s, ",%s", ncacn_options[i].name);
			if (!s) return NULL;
		}
	}

	s = talloc_asprintf_append_buffer(s, "]");

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


示例12: disp_sec_ace_object

/****************************************************************************
 display sec_ace object
 ****************************************************************************/
static void disp_sec_ace_object(struct security_ace_object *object)
{
	char *str;
	if (object->flags & SEC_ACE_OBJECT_TYPE_PRESENT) {
		str = GUID_string(NULL, &object->type.type);
		if (str == NULL) return;
		printf("Object type: SEC_ACE_OBJECT_TYPE_PRESENT\n");
		printf("Object GUID: %s\n", str);
		talloc_free(str);
	}
	if (object->flags & SEC_ACE_INHERITED_OBJECT_TYPE_PRESENT) {
		str = GUID_string(NULL, &object->inherited_type.inherited_type);
		if (str == NULL) return;
		printf("Object type: SEC_ACE_INHERITED_OBJECT_TYPE_PRESENT\n");
		printf("Object GUID: %s\n", str);
		talloc_free(str);
	}
}
开发者ID:Alexander--,项目名称:samba,代码行数:21,代码来源:display_sec.c


示例13: display_query_info_12

static void display_query_info_12(struct lsa_DnsDomainInfo *r)
{
	d_printf("Domain NetBios Name: %s\n", r->name.string);
	d_printf("Domain DNS Name: %s\n", r->dns_domain.string);
	d_printf("Domain Forest Name: %s\n", r->dns_forest.string);
	d_printf("Domain Sid: %s\n", sid_string_tos(r->sid));
	d_printf("Domain GUID: %s\n", GUID_string(talloc_tos(),
						      &r->domain_guid));
}
开发者ID:endisd,项目名称:samba,代码行数:9,代码来源:cmd_lsarpc.c


示例14: drepl_replica_sync

/*
  DsReplicaSync messages from the DRSUAPI server are forwarded here
 */
static NTSTATUS drepl_replica_sync(struct irpc_message *msg, 
				   struct drsuapi_DsReplicaSync *r)
{
	struct dreplsrv_service *service = talloc_get_type(msg->private_data,
							   struct dreplsrv_service);
	struct GUID *guid = &r->in.req.req1.naming_context->guid;

	r->out.result = dreplsrv_schedule_partition_pull_by_guid(service, msg, guid);
	if (W_ERROR_IS_OK(r->out.result)) {
		DEBUG(3,("drepl_replica_sync: forcing sync of partition %s\n",
			 GUID_string(msg, guid)));
		dreplsrv_run_pending_ops(service);
	} else {
		DEBUG(3,("drepl_replica_sync: failed setup of sync of partition %s - %s\n",
			 GUID_string(msg, guid), win_errstr(r->out.result)));
	}
	return NT_STATUS_OK;
}
开发者ID:endisd,项目名称:samba,代码行数:21,代码来源:drepl_service.c


示例15: ads_disp_sec_ace_object

static void ads_disp_sec_ace_object(ADS_STRUCT *ads, 
				    TALLOC_CTX *mem_ctx, 
				    struct security_ace_object *object)
{
	if (object->flags & SEC_ACE_OBJECT_TYPE_PRESENT) {
		printf("Object type: SEC_ACE_OBJECT_TYPE_PRESENT\n");
		printf("Object GUID: %s (%s)\n", GUID_string(mem_ctx, 
			&object->type.type), 
			ads_interprete_guid_from_object(ads, mem_ctx, 
				&object->type.type));
	}
	if (object->flags & SEC_ACE_INHERITED_OBJECT_TYPE_PRESENT) {
		printf("Object type: SEC_ACE_INHERITED_OBJECT_TYPE_PRESENT\n");
		printf("Object GUID: %s (%s)\n", GUID_string(mem_ctx,
			&object->inherited_type.inherited_type),
			ads_interprete_guid_from_object(ads, mem_ctx, 
				&object->inherited_type.inherited_type));
	}
}
开发者ID:Alexander--,项目名称:samba,代码行数:19,代码来源:disp_sec.c


示例16: _drepl_schedule_replication

/**
 * Helper to schedule a replication operation with a source DSA.
 * If 'data' is valid pointer, then a callback
 * for the operation is passed and 'data->msg' is
 * marked as 'deferred' - defer_reply = true
 */
static WERROR _drepl_schedule_replication(struct dreplsrv_service *service,
					  struct dreplsrv_partition_source_dsa *dsa,
					  struct drsuapi_DsReplicaObjectIdentifier *nc,
					  uint32_t rep_options,
					  struct drepl_replica_sync_cb_data *data,
					  TALLOC_CTX *mem_ctx)
{
	WERROR werr;
	dreplsrv_extended_callback_t fn_callback = NULL;

	if (data) {
		fn_callback = _drepl_replica_sync_done_cb;
	}

	/* schedule replication item */
	werr = dreplsrv_schedule_partition_pull_source(service, dsa, rep_options,
	                                               DRSUAPI_EXOP_NONE, 0,
	                                               fn_callback, data);
	if (!W_ERROR_IS_OK(werr)) {
		DEBUG(0,("%s: failed setup of sync of partition (%s, %s, %s) - %s\n",
			 __FUNCTION__,
			 GUID_string(mem_ctx, &nc->guid),
			 nc->dn,
			 dsa->repsFrom1->other_info->dns_name,
			 win_errstr(werr)));
		return werr;
	}
	/* log we've scheduled a replication item */
	DEBUG(3,("%s: forcing sync of partition (%s, %s, %s)\n",
		 __FUNCTION__,
		 GUID_string(mem_ctx, &nc->guid),
		 nc->dn,
		 dsa->repsFrom1->other_info->dns_name));

	/* mark IRPC message as deferred if necessary */
	if (data) {
		data->ops_count++;
		data->msg->defer_reply = true;
	}

	return WERR_OK;
}
开发者ID:DavidMulder,项目名称:samba,代码行数:48,代码来源:drepl_service.c


示例17: nt_printer_guid_store

WERROR nt_printer_guid_store(struct messaging_context *msg_ctx,
			     const char *printer, struct GUID guid)
{
	TALLOC_CTX *tmp_ctx;
	const struct auth_session_info *session_info;
	const char *guid_str;
	DATA_BLOB blob;
	WERROR result;

	tmp_ctx = talloc_new(NULL);
	if (!tmp_ctx) {
		DEBUG(0, ("Out of memory?!\n"));
		return WERR_NOMEM;
	}

	session_info = get_session_info_system();
	if (session_info == NULL) {
		DEBUG(0, ("Could not get system session_info\n"));
		result = WERR_NOMEM;
		goto done;
	}

	guid_str = GUID_string(tmp_ctx, &guid);
	if (!guid_str) {
		DEBUG(0, ("Out of memory?!\n"));
		result = WERR_NOMEM;
		goto done;
	}

	/* We used to store this as a REG_BINARY but that causes
	   Vista to whine */

	if (!push_reg_sz(tmp_ctx, &blob, guid_str)) {
		DEBUG(0, ("Could not marshall string %s for objectGUID\n",
			  guid_str));
		result = WERR_NOMEM;
		goto done;
	}

	result = winreg_set_printer_dataex_internal(tmp_ctx, session_info, msg_ctx,
					   printer,
					   SPOOL_DSSPOOLER_KEY, "objectGUID",
					   REG_SZ, blob.data, blob.length);
	if (!W_ERROR_IS_OK(result)) {
		DEBUG(0, ("Failed to store GUID for printer %s\n", printer));
		goto done;
	}

	result = WERR_OK;
done:
	talloc_free(tmp_ctx);

	return result;
}
开发者ID:DanilKorotenko,项目名称:samba,代码行数:54,代码来源:nt_printing_ads.c


示例18: test_Lookup

static BOOL test_Lookup(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx)
{
	NTSTATUS status;
	struct epm_Lookup r;
	struct GUID uuid;
	struct rpc_if_id_t iface;
	struct policy_handle handle;

	ZERO_STRUCT(handle);

	r.in.inquiry_type = 0;
	r.in.object = &uuid;
	r.in.interface_id = &iface;
	r.in.vers_option = 0;
	r.in.entry_handle = &handle;
	r.out.entry_handle = &handle;
	r.in.max_ents = 10;

	do {
		int i;

		ZERO_STRUCT(uuid);
		ZERO_STRUCT(iface);

		status = dcerpc_epm_Lookup(p, mem_ctx, &r);
		if (!NT_STATUS_IS_OK(status) || r.out.result != 0) {
			break;
		}

		printf("epm_Lookup returned %d events GUID %s\n", 
		       *r.out.num_ents, GUID_string(mem_ctx, &handle.uuid));

		for (i=0;i<*r.out.num_ents;i++) {
			printf("\nFound '%s'\n", r.out.entries[i].annotation);
			display_tower(mem_ctx, &r.out.entries[i].tower->tower);
			if (r.out.entries[i].tower->tower.num_floors == 5) {
				test_Map(p, mem_ctx, r.out.entries[i].tower);
			}
		}
	} while (NT_STATUS_IS_OK(status) && 
		 r.out.result == 0 && 
		 *r.out.num_ents == r.in.max_ents &&
		 !policy_handle_empty(&handle));

	if (!NT_STATUS_IS_OK(status)) {
		printf("Lookup failed - %s\n", nt_errstr(status));
		return False;
	}


	return True;
}
开发者ID:Marvin-Lee,项目名称:libwmiclient,代码行数:52,代码来源:epmapper.c


示例19: test_connect_service

static bool test_connect_service(struct torture_context *tctx,
				 struct libnet_context *ctx,
				 const struct ndr_interface_table *iface,
				 const char *binding_string,
				 const char *hostname,
				 const enum libnet_RpcConnect_level level,
				 bool badcreds, NTSTATUS expected_status)
{
	NTSTATUS status;
	struct libnet_RpcConnect connect_r;
	ZERO_STRUCT(connect_r);

	connect_r.level            = level;
	connect_r.in.binding       = binding_string;
	connect_r.in.name          = hostname;
	connect_r.in.dcerpc_iface  = iface;

	/* if bad credentials are needed, set baduser%badpassword instead
	   of default commandline-passed credentials */
	if (badcreds) {
		cli_credentials_set_username(ctx->cred, "baduser", CRED_SPECIFIED);
		cli_credentials_set_password(ctx->cred, "badpassword", CRED_SPECIFIED);
	}

	status = libnet_RpcConnect(ctx, ctx, &connect_r);

	if (!NT_STATUS_EQUAL(status, expected_status)) {
		torture_comment(tctx, "Connecting to rpc service %s on %s.\n\tFAILED. Expected: %s."
		       "Received: %s\n",
		       connect_r.in.dcerpc_iface->name, connect_r.in.binding, nt_errstr(expected_status),
		       nt_errstr(status));

		return false;
	}

	torture_comment(tctx, "PASSED. Expected: %s, received: %s\n", nt_errstr(expected_status),
	       nt_errstr(status));

	if (connect_r.level == LIBNET_RPC_CONNECT_DC_INFO && NT_STATUS_IS_OK(status)) {
		torture_comment(tctx, "Domain Controller Info:\n");
		torture_comment(tctx, "\tDomain Name:\t %s\n", connect_r.out.domain_name);
		torture_comment(tctx, "\tDomain SID:\t %s\n", dom_sid_string(ctx, connect_r.out.domain_sid));
		torture_comment(tctx, "\tRealm:\t\t %s\n", connect_r.out.realm);
		torture_comment(tctx, "\tGUID:\t\t %s\n", GUID_string(ctx, connect_r.out.guid));

	} else if (!NT_STATUS_IS_OK(status)) {
		torture_comment(tctx, "Error string: %s\n", connect_r.out.error_string);
	}

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


示例20: store_printer_guid

static void store_printer_guid(struct messaging_context *msg_ctx,
			       const char *printer, struct GUID guid)
{
	TALLOC_CTX *tmp_ctx;
	struct auth_serversupplied_info *session_info = NULL;
	const char *guid_str;
	DATA_BLOB blob;
	NTSTATUS status;
	WERROR result;

	tmp_ctx = talloc_new(NULL);
	if (!tmp_ctx) {
		DEBUG(0, ("store_printer_guid: Out of memory?!\n"));
		return;
	}

	status = make_session_info_system(tmp_ctx, &session_info);
	if (!NT_STATUS_IS_OK(status)) {
		DEBUG(0, ("store_printer_guid: "
			  "Could not create system session_info\n"));
		goto done;
	}

	guid_str = GUID_string(tmp_ctx, &guid);
	if (!guid_str) {
		DEBUG(0, ("store_printer_guid: Out of memory?!\n"));
		goto done;
	}

	/* We used to store this as a REG_BINARY but that causes
	   Vista to whine */

	if (!push_reg_sz(tmp_ctx, &blob, guid_str)) {
		DEBUG(0, ("store_printer_guid: "
			  "Could not marshall string %s for objectGUID\n",
			  guid_str));
		goto done;
	}

	result = winreg_set_printer_dataex(tmp_ctx, session_info, msg_ctx,
					   printer,
					   SPOOL_DSSPOOLER_KEY, "objectGUID",
					   REG_SZ, blob.data, blob.length);
	if (!W_ERROR_IS_OK(result)) {
		DEBUG(0, ("store_printer_guid: "
			  "Failed to store GUID for printer %s\n", printer));
	}

done:
	talloc_free(tmp_ctx);
}
开发者ID:Arkhont,项目名称:samba,代码行数:51,代码来源:nt_printing_ads.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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