} netr_WorkstationInfo;
typedef struct {
- /* these first 3 values come from the fact windows
- actually encodes this structure as a UNICODE_STRING
- - see MS-NRPC section 2.2.1.3.9 */
- [value(8)] uint32 length;
- [value(0)] uint32 dummy;
- [value(8)] uint32 size;
netr_TrustFlags flags;
uint32 parent_index;
lsa_TrustType trust_type;
lsa_TrustAttributes trust_attributes;
+ } netr_trust_extension_info;
+
+ typedef struct {
+ /* these first 3 values come from the fact windows
+ actually encodes this structure as a UNICODE_STRING
+ - see MS-NRPC section 2.2.1.3.9 */
+ [value(8)] uint3264 length;
+ [value(0)] uint3264 dummy;
+ [value(8)] uint3264 size;
+ [subcontext(0),subcontext_size(size*2)]
+ netr_trust_extension_info info;
} netr_trust_extension;
typedef struct {
- uint16 length; /* value is 16 when info != NULL, otherwise 0 */
- [value(length)] uint16 size; /* value is 16 when info != NULL, otherwise 0 */
+ /* value is 16 when info != NULL, otherwise 0 */
+ [value(info == NULL ? 0 : 16)] uint16 length;
+ [value(info == NULL ? 0 : 16)] uint16 size;
netr_trust_extension *info;
} netr_trust_extension_container;
ZERO_STRUCTP(info);
if (is_trust_list) {
- struct netr_trust_extension *tei = NULL;
+ struct netr_trust_extension *te = NULL;
+ struct netr_trust_extension_info *tei = NULL;
/* w2k8 only fills this on trusted domains */
- tei = talloc_zero(mem_ctx, struct netr_trust_extension);
- if (tei == NULL) {
+ te = talloc_zero(mem_ctx, struct netr_trust_extension);
+ if (te == NULL) {
return NT_STATUS_NO_MEMORY;
}
+ tei = &te->info;
tei->flags |= NETR_TRUST_FLAG_PRIMARY;
/*
*/
tei->trust_attributes = 0;
- info->trust_extension.info = tei;
- info->trust_extension.length = 16;
+ info->trust_extension.info = te;
}
if (is_trust_list) {
const struct lsa_TrustDomainInfoInfoEx *tdo,
struct netr_OneDomainInfo *info)
{
- struct netr_trust_extension *tei = NULL;
+ struct netr_trust_extension *te = NULL;
+ struct netr_trust_extension_info *tei = NULL;
ZERO_STRUCTP(info);
/* w2k8 only fills this on trusted domains */
- tei = talloc_zero(mem_ctx, struct netr_trust_extension);
- if (tei == NULL) {
+ te = talloc_zero(mem_ctx, struct netr_trust_extension);
+ if (te == NULL) {
return NT_STATUS_NO_MEMORY;
}
+ tei = &te->info;
if (tdo->trust_direction & LSA_TRUST_DIRECTION_INBOUND) {
tei->flags |= NETR_TRUST_FLAG_INBOUND;
tei->trust_type = tdo->trust_type;
tei->trust_attributes = tdo->trust_attributes;
- info->trust_extension.info = tei;
- info->trust_extension.length = 16;
+ info->trust_extension.info = te;
info->domainname.string = tdo->netbios_name.string;
if (tdo->trust_type != LSA_TRUST_TYPE_DOWNLEVEL) {
struct dcerpc_binding_handle *b = NULL;
struct netr_OneDomainInfo *odi1 = NULL;
struct netr_OneDomainInfo *odi2 = NULL;
- struct netr_trust_extension *tex2 = NULL;
+ struct netr_trust_extension_info *tex2 = NULL;
torture_comment(tctx, "Testing netr_LogonGetDomainInfo\n");
for (i=0; i < info.domain_info->trusted_domain_count; i++) {
struct netr_OneDomainInfo *odiT =
&info.domain_info->trusted_domains[i];
- struct netr_trust_extension *texT = NULL;
+ struct netr_trust_extension_info *texT = NULL;
torture_assert_int_equal(tctx, odiT->trust_extension.length, 16,
"trust_list should have extension");
torture_assert(tctx, odiT->trust_extension.info != NULL,
"trust_list should have extension");
- texT = odiT->trust_extension.info;
+ texT = &odiT->trust_extension.info->info;
if (GUID_equal(&odiT->domain_guid, &odi1->domain_guid)) {
odi2 = odiT;
"trust_list should have extension");
torture_assert(tctx, odi2->trust_extension.info != NULL,
"trust_list should have extension");
- tex2 = odi2->trust_extension.info;
+ tex2 = &odi2->trust_extension.info->info;
torture_assert_int_equal(tctx,
tex2->flags & NETR_TRUST_FLAG_PRIMARY,
NETR_TRUST_FLAG_PRIMARY,