Generated from Manticore v1.1.6 • 388 packages. View on pkg.go.dev

msnspi

import "github.com/TheManticoreProject/Manticore/windows/protocols/ms-nspi"

Index

Constants

Restriction type tags ([MS-NSPI] 2.2.5.3 — the rt / RestrictionUnion_r discriminant).

const (
    RestrictionTypeAnd          ndr.DWORD = 0x00000000
    RestrictionTypeOr           ndr.DWORD = 0x00000001
    RestrictionTypeNot          ndr.DWORD = 0x00000002
    RestrictionTypeContent      ndr.DWORD = 0x00000003
    RestrictionTypeProperty     ndr.DWORD = 0x00000004
    RestrictionTypeCompareProps ndr.DWORD = 0x00000005
    RestrictionTypeBitMask      ndr.DWORD = 0x00000006
    RestrictionTypeSize         ndr.DWORD = 0x00000007
    RestrictionTypeExist        ndr.DWORD = 0x00000008
    RestrictionTypeSubObject    ndr.DWORD = 0x00000009
)

type AndRestriction\_r

AndRestriction_r ([MS-NSPI]). Generated by tools/idlgen; verify pointer/array tags.

type AndRestriction_r struct {
    CRes  ndr.DWORD
    LpRes []Restriction_r `ndr:"unique,size_is=CRes"`
}

type BinaryArray\_r

BinaryArray_r ([MS-NSPI]). Generated by tools/idlgen; verify pointer/array tags.

type BinaryArray_r struct {
    CValues ndr.DWORD
    Lpbin   []Binary_r `ndr:"unique,size_is=CValues"`
}

type Binary\_r

Binary_r ([MS-NSPI]). Generated by tools/idlgen; verify pointer/array tags.

type Binary_r struct {
    Cb  ndr.DWORD
    Lpb []uint8 `ndr:"unique,size_is=Cb"`
}

type BitMaskRestriction\_r

BitMaskRestriction_r ([MS-NSPI]). Generated by tools/idlgen; verify pointer/array tags.

type BitMaskRestriction_r struct {
    RelBMR    ndr.DWORD
    UlPropTag ndr.DWORD
    UlMask    ndr.DWORD
}

type ComparePropsRestriction\_r

ComparePropsRestriction_r ([MS-NSPI]). Generated by tools/idlgen; verify pointer/array tags.

type ComparePropsRestriction_r struct {
    Relop      ndr.DWORD
    UlPropTag1 ndr.DWORD
    UlPropTag2 ndr.DWORD
}

type ContentRestriction\_r

ContentRestriction_r ([MS-NSPI]). Generated by tools/idlgen; verify pointer/array tags.

type ContentRestriction_r struct {
    UlFuzzyLevel ndr.DWORD
    UlPropTag    ndr.DWORD
    LpProp       *PropertyValue_r `ndr:"unique"`
}

type DateTimeArray\_r

DateTimeArray_r ([MS-NSPI]). Generated by tools/idlgen; verify pointer/array tags.

type DateTimeArray_r struct {
    CValues ndr.DWORD
    Lpft    []FILETIME `ndr:"unique,size_is=CValues"`
}

type ExistRestriction\_r

ExistRestriction_r ([MS-NSPI]). Generated by tools/idlgen; verify pointer/array tags.

type ExistRestriction_r struct {
    UlReserved1 ndr.DWORD
    UlPropTag   ndr.DWORD
    UlReserved2 ndr.DWORD
}

type FILETIME

FILETIME is the [MS-DTYP] FILETIME (2.3.3): a 64-bit count of 100-nanosecond intervals since January 1, 1601 (UTC), split into two 32-bit words. The NSPI IDL imports it from ms-msdtyp.idl rather than defining it, so it is aliased to msdtyp.FILETIME.

type FILETIME = msdtyp.FILETIME

type FlatUIDArray\_r

FlatUIDArray_r ([MS-NSPI] 2.2.3.7) holds multiple GUIDs. The IDL field is [size_is(cValues)] FlatUID_r** lpguid — a unique pointer to a conformant array of unique pointers to FlatUID_r.

type FlatUIDArray_r struct {
    CValues ndr.DWORD
    Lpguid  []*FlatUID_r `ndr:"unique,size_is=CValues,elem=unique"`
}

type FlatUID\_r

FlatUID_r ([MS-NSPI]). Generated by tools/idlgen; verify pointer/array tags.

type FlatUID_r struct {
    Ab [16]uint8
}

type LongArray\_r

LongArray_r ([MS-NSPI]). Generated by tools/idlgen; verify pointer/array tags.

type LongArray_r struct {
    CValues ndr.DWORD
    Lpl     []int32 `ndr:"unique,size_is=CValues"`
}

type NSPI\_HANDLE

NSPI_HANDLE is an RPC context handle: 20 bytes ([MS-RPCE] 2.3.2.2, [MS-NSPI]).

type NSPI_HANDLE [20]byte

type NotRestriction\_r

NotRestriction_r ([MS-NSPI]). Generated by tools/idlgen; verify pointer/array tags.

type NotRestriction_r struct {
    LpRes *Restriction_r `ndr:"unique"`
}

type OrRestriction\_r

OrRestriction_r is an alias for AndRestriction_r (same IDL typedef).

type OrRestriction_r = AndRestriction_r

type PROP\_VAL\_UNION

PROP_VAL_UNION ([MS-NSPI] 2.2.3.1) is the value component of a PropertyValue_r. It is a non-encapsulated union whose discriminant is the low 16 bits of the containing PropertyValue_r’s ulPropTag (the property type). [C706] section 14.3.8 transmits the discriminant inline ahead of the selected arm, so Tag MUST be set to the property type (ulPropTag & 0x0000FFFF) before marshalling.

type PROP_VAL_UNION struct {
    Tag    int32           `ndr:"switch"`
    I      int16           `ndr:"case=2"`         // PtypInteger16
    L      int32           `ndr:"case=3"`         // PtypInteger32
    B      uint16          `ndr:"case=11"`        // PtypBoolean (2-octet)
    LpszA  *ndr.STR        `ndr:"case=30,unique"` // PtypString8
    Bin    Binary_r        `ndr:"case=258"`       // PtypBinary
    LpszW  *ndr.WSTR       `ndr:"case=31,unique"` // PtypString
    Lpguid *FlatUID_r      `ndr:"case=72,unique"` // PtypGuid
    Ft     FILETIME        `ndr:"case=64"`        // PtypTime
    Err    int32           `ndr:"case=10"`        // PtypErrorCode
    MVi    ShortArray_r    `ndr:"case=4098"`      // PtypMultipleInteger16
    MVl    LongArray_r     `ndr:"case=4099"`      // PtypMultipleInteger32
    MVszA  StringArray_r   `ndr:"case=4126"`      // PtypMultipleString8
    MVbin  BinaryArray_r   `ndr:"case=4354"`      // PtypMultipleBinary
    MVguid FlatUIDArray_r  `ndr:"case=4168"`      // PtypMultipleGuid
    MVszW  WStringArray_r  `ndr:"case=4127"`      // PtypMultipleString
    MVft   DateTimeArray_r `ndr:"case=4160"`      // PtypMultipleTime
    // The IDL declares lReserved for two discriminants: [case(0x00000001, 0x0000000D)] long
    // lReserved. The codec matches a single case value per field, so each label gets its own
    // arm (both a plain reserved long); the value is identical whichever discriminant selects.
    LReserved   int32 `ndr:"case=1"`  // PtypNull
    LReserved0D int32 `ndr:"case=13"` // 0x0000000D (PtypObject placeholder), same reserved long
}

type PropertyNameSet\_r

PropertyNameSet_r ([MS-NSPI] 2.2.6) is a counted set of property names. ANames is an embedded conformant array (maximum_count hoisted to the front of the structure), not a pointer, so it is tagged conformant rather than unique.

type PropertyNameSet_r struct {
    CNames ndr.DWORD
    ANames []PropertyName_r `ndr:"conformant,size_is=CNames"`
}

type PropertyName\_r

PropertyName_r ([MS-NSPI]). Generated by tools/idlgen; verify pointer/array tags.

type PropertyName_r struct {
    Lpguid     *FlatUID_r `ndr:"unique"`
    UlReserved ndr.DWORD
    LID        int32
}

type PropertyRestriction\_r

PropertyRestriction_r ([MS-NSPI]). Generated by tools/idlgen; verify pointer/array tags.

type PropertyRestriction_r struct {
    Relop     ndr.DWORD
    UlPropTag ndr.DWORD
    LpProp    *PropertyValue_r `ndr:"unique"`
}

type PropertyRowSet\_r

PropertyRowSet_r ([MS-NSPI] 2.2.4) is a counted set of address book rows. ARow is an embedded conformant array (its maximum_count is hoisted to the front of the structure), not a pointer, so it is tagged conformant rather than unique.

type PropertyRowSet_r struct {
    CRows ndr.DWORD
    ARow  []PropertyRow_r `ndr:"conformant,size_is=CRows"`
}

type PropertyRow\_r

PropertyRow_r ([MS-NSPI] 2.2.4). Generated by tools/idlgen; verify pointer/array tags.

type PropertyRow_r struct {
    Reserved ndr.DWORD
    CValues  ndr.DWORD
    LpProps  []PropertyValue_r `ndr:"unique,size_is=CValues"`
}

func (*PropertyRow_r) SetDiscriminants

func (p *PropertyRow_r) SetDiscriminants()

SetDiscriminants derives the PROP_VAL_UNION discriminant of every value in the row from its ulPropTag, so a caller-built row marshals wire-correctly.

type PropertyTagArray\_r

PropertyTagArray_r ([MS-NSPI] 2.2.8) is a counted array of property tags.

AulPropTag is an embedded conformant-varying array. The IDL declares it [size_is(cValues + 1), length_is(cValues)] DWORD aulPropTag[]: the maximum_count (allocation bound) is one greater than the actual_count of transmitted elements, so the spec reserves a terminal slot that is never placed on the wire.

KNOWN LIMITATION: the ndr codec cannot express size_is(field+1). The declarative tag grammar supports only a sibling field, a “field/N” divisor, or a literal, and for an embedded conformant array the hoisted maximum_count is derived from the slice length. The ndr.Marshaler escape hatch cannot be used either: this type is referenced through unique pointers throughout the interface, and a pointer whose pointee implements Marshaler short-circuits the codec’s referent-id handling (bypassing the referent id and faulting on NULL). As a result the marshalled maximum_count equals the actual_count (== len(AulPropTag)) rather than actual_count + 1. The transmitted element count is correct and the actual_count <= maximum_count invariant holds, so receivers that size their allocation from maximum_count and read actual_count elements interoperate; a server that strictly re-derives maximum_count as size_is(cValues+1) would observe the off-by-one. A faithful fix requires a codec feature (a size_is addend) and is tracked as future work.

type PropertyTagArray_r struct {
    CValues    ndr.DWORD
    AulPropTag []ndr.DWORD `ndr:"conformant,varying,size_is=CValues,length_is=CValues"`
}

type PropertyValue\_r

PropertyValue_r ([MS-NSPI] 2.2.5.1). Value is a non-encapsulated PROP_VAL_UNION whose discriminant is (ulPropTag & 0x0000FFFF); that discriminant is transmitted inline, so it must be set before marshalling (see SetDiscriminant).

type PropertyValue_r struct {
    UlPropTag  ndr.DWORD
    UlReserved ndr.DWORD
    Value      PROP_VAL_UNION
}

func (*PropertyValue_r) SetDiscriminant

func (p *PropertyValue_r) SetDiscriminant()

SetDiscriminant derives Value.Tag from UlPropTag (the low 16 bits, the property type), so a caller that populated only UlPropTag and the selected arm produces a wire-correct value.

type RestrictionUnion\_r

RestrictionUnion_r is a discriminated union ([MS-NSPI]); the discriminant precedes the selected arm ([C706] 14.3.8). Generated by tools/idlgen — verify case values.

type RestrictionUnion_r struct {
    Tag               int32                     `ndr:"switch"`
    ResAnd            AndRestriction_r          `ndr:"case=0"`
    ResOr             OrRestriction_r           `ndr:"case=1"`
    ResNot            NotRestriction_r          `ndr:"case=2"`
    ResContent        ContentRestriction_r      `ndr:"case=3"`
    ResProperty       PropertyRestriction_r     `ndr:"case=4"`
    ResCompareProps   ComparePropsRestriction_r `ndr:"case=5"`
    ResBitMask        BitMaskRestriction_r      `ndr:"case=6"`
    ResSize           SizeRestriction_r         `ndr:"case=7"`
    ResExist          ExistRestriction_r        `ndr:"case=8"`
    ResSubRestriction SubRestriction_r          `ndr:"case=9"`
}

type Restriction\_r

Restriction_r ([MS-NSPI] 2.2.5.3). Res is a non-encapsulated RestrictionUnion_r whose discriminant is rt; the discriminant is transmitted inline, so it must be set before marshalling (see SetDiscriminants).

type Restriction_r struct {
    Rt  ndr.DWORD
    Res RestrictionUnion_r
}

func (*Restriction_r) SetDiscriminants

func (r *Restriction_r) SetDiscriminants()

SetDiscriminants derives Res.Tag from Rt and recurses into every sub-restriction and embedded PropertyValue_r, so a caller that populated only the selected arm and its rt produces a wire-correct (fully discriminated) restriction tree. It operates in place; the values written are the discriminants already implied by rt/ulPropTag.

type STAT

STAT ([MS-NSPI]). Generated by tools/idlgen; verify pointer/array tags.

type STAT struct {
    SortType       ndr.DWORD
    ContainerID    ndr.DWORD
    CurrentRec     ndr.DWORD
    Delta          int32
    NumPos         ndr.DWORD
    TotalRecs      ndr.DWORD
    CodePage       ndr.DWORD
    TemplateLocale ndr.DWORD
    SortLocale     ndr.DWORD
}

type ShortArray\_r

ShortArray_r ([MS-NSPI] 2.2.3.3) holds multiple 16-bit integers. The IDL field is [size_is(cValues)] short int* lpi — a unique pointer to a conformant array of int16.

type ShortArray_r struct {
    CValues ndr.DWORD
    Lpi     []int16 `ndr:"unique,size_is=CValues"`
}

type SizeRestriction\_r

SizeRestriction_r ([MS-NSPI]). Generated by tools/idlgen; verify pointer/array tags.

type SizeRestriction_r struct {
    Relop     ndr.DWORD
    UlPropTag ndr.DWORD
    Cb        ndr.DWORD
}

type StringArray\_r

StringArray_r ([MS-NSPI] 2.2.3.9) holds multiple 8-bit character strings. The IDL field is [size_is(cValues)] [string] char** lppszA — a unique pointer to a conformant array of unique pointers to ASCII strings.

type StringArray_r struct {
    CValues ndr.DWORD
    LppszA  []*ndr.STR `ndr:"unique,size_is=CValues,elem=unique"`
}

type StringsArray\_r

StringsArray_r ([MS-NSPI] 2.2.5) is a counted array of 8-bit character strings. Strings is an embedded conformant array (maximum_count hoisted to the front of the structure) whose elements are [string] char* pointers; each element is a unique pointer to an ASCII string.

type StringsArray_r struct {
    Count   ndr.DWORD
    Strings []*ndr.STR `ndr:"conformant,size_is=Count,elem=unique"`
}

type SubRestriction\_r

SubRestriction_r ([MS-NSPI]). Generated by tools/idlgen; verify pointer/array tags.

type SubRestriction_r struct {
    UlSubObject ndr.DWORD
    LpRes       *Restriction_r `ndr:"unique"`
}

type WStringArray\_r

WStringArray_r ([MS-NSPI] 2.2.3.11) holds multiple Unicode strings. The IDL field is [size_is(cValues)] [string] wchar_t** lppszW — a unique pointer to a conformant array of unique pointers to Unicode strings.

type WStringArray_r struct {
    CValues ndr.DWORD
    LppszW  []*ndr.WSTR `ndr:"unique,size_is=CValues,elem=unique"`
}

type WStringsArray\_r

WStringsArray_r ([MS-NSPI] 2.2.7) is a counted array of Unicode strings. Strings is an embedded conformant array (maximum_count hoisted to the front of the structure) whose elements are [string] wchar_t* pointers; each element is a unique pointer to a Unicode string.

type WStringsArray_r struct {
    Count   ndr.DWORD
    Strings []*ndr.WSTR `ndr:"conformant,size_is=Count,elem=unique"`
}