本文整理汇总了C++中GUID_string函数的典型用法代码示例。如果您正苦于以下问题:C++ GUID_string函数的具体用法?C++ GUID_string怎么用?C++ GUID_string使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GUID_string函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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));
}
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
示例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;
}
示例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;
}
示例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;
}
示例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));
}
示例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;
}
示例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);
}
}
示例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));
}
示例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;
}
示例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));
}
}