|
FreeRDP
|
NDR encoder and decoder ([C706] chapter 14, [MS-RPCE] 2.2.5 and 2.2.6) More...
#include <winpr/stream.h>
Go to the source code of this file.
Data Structures | |
| struct | WinPrNdrMessageDescr |
| message descriptor More... | |
| struct | WinPrNdrFieldStruct |
| descriptor of a field in a structure More... | |
| struct | WinPrNdrStructDescr |
| structure descriptor More... | |
| struct | WinPrNdrUnionArm |
| an arm of a non-encapsulated union More... | |
| struct | WinPrNdrUnionDescr |
| a non-encapsulated union ([switch_type()]) More... | |
| struct | WinPrNdrDeferredEntry |
| a deferred pointer, a referent to read after the current construct More... | |
| struct | WinPrNdrVaryingArrayHints |
| hints for a conformant varying array More... | |
| struct | WinPrNdrArrayHints |
| hints for a conformant array More... | |
Macros | |
| #define | WINPR_NDR_PTR_NULL (0UL) |
| the referent id of a null pointer | |
| #define | WINPR_NDR_SIMPLE_TYPE_DECL(PREFIX, LOWER, UPPER) |
| declares the functions and the message descriptor of a simple type | |
| #define | WINPR_NDR_ARRAY_OF_TYPE_DECL(PREFIX, TYPE, UPPERTYPE) |
| declares the functions and the message descriptors of the arrays of a simple type | |
| #define | WINPR_NDR_STRUCT_MESSAGE_DEFINE(PREFIX, CTYPE) |
| defines a static message type for a structure | |
| #define | WINPR_NDR_ARRAY_MESSAGE_DEFINE(PREFIX, ITEMPREFIX, CTYPE) |
| defines a static message type for a conformant array of ITEMPREFIX##_descr_s items | |
| #define | WINPR_NDR_UNION_MESSAGE_DEFINE(PREFIX, CTYPE) |
| defines a static message type for a non-encapsulated union | |
Typedefs | |
| typedef UINT32 | winpr_ndr_refid |
| a referent id, the wire value of a pointer (WINPR_NDR_PTR_NULL for a null pointer) | |
| typedef BOOL(* | WINPR_NDR_READER_FN) (WinPrNdrDecoder *context, wStream *s, const void *hints, void *target) |
| reads a message | |
| typedef BOOL(* | WINPR_NDR_WRITER_FN) (WinPrNdrEncoder *context, wStream *s, const void *hints, const void *obj) |
| writes a message | |
| typedef void(* | WINPR_NDR_DESTROY_FN) (const void *hints, void *obj) |
| releases the content of a message, not the message storage itself | |
| typedef void(* | WINPR_NDR_DUMP_FN) (wLog *logger, UINT32 lvl, size_t indentLevel, const void *obj) |
| dumps a message in the logs | |
| typedef const WinPrNdrMessageDescr * | WinPrNdrMessageType |
| a message type, a pointer on its descriptor | |
Enumerations | |
| enum | WinPrNdrTypeArity { WINPR_NDR_ARITY_SIMPLE , WINPR_NDR_ARITY_ARRAYOF , WINPR_NDR_ARITY_VARYING_ARRAYOF , WINPR_NDR_ARITY_SELF_ALLOCATED } |
| arity of a message More... | |
| enum | WinPrNdrPointerType { WINPR_NDR_NOT_POINTER , WINPR_NDR_POINTER_NON_NULL , WINPR_NDR_POINTER , WINPR_NDR_FIXED_ARRAY , WINPR_NDR_POINTER_FULL } |
| pointer or not and if null is accepted More... | |
Functions | |
| WINPR_API void | winpr_ndr_encoder_free (WinPrNdrEncoder *context) |
| frees an encoder | |
| static INLINE void | winpr_ndr_encoder_destroy (WinPrNdrEncoder **pcontext) |
| frees an encoder and resets the pointer | |
| WINPR_API WinPrNdrEncoder * | winpr_ndr_encoder_new (BOOL bigEndianDrep, BYTE version) |
| creates an encoder | |
| WINPR_API WinPrNdrEncoder * | winpr_ndr_encoder_from_decoder (const WinPrNdrDecoder *src) |
| creates an encoder with the same endianness and version as a decoder, to answer the message it decoded | |
| WINPR_ATTR_NODISCARD WINPR_API BOOL | winpr_ndr_encoder_write_header (WinPrNdrEncoder *context, wStream *s) |
| writes the common type header ([MS-RPCE] 2.2.6.1): version, endianness, header length and filler | |
| WINPR_NDR_SIMPLE_TYPE_DECL (winpr_ndr, uint8, UINT8) | |
| WINPR_NDR_SIMPLE_TYPE_DECL (winpr_ndr, int8, INT8) | |
| WINPR_NDR_SIMPLE_TYPE_DECL (winpr_ndr, uint16, UINT16) | |
| WINPR_NDR_SIMPLE_TYPE_DECL (winpr_ndr, int16, INT16) | |
| WINPR_NDR_SIMPLE_TYPE_DECL (winpr_ndr, int32, INT32) | |
| WINPR_NDR_SIMPLE_TYPE_DECL (winpr_ndr, uint32, UINT32) | |
| WINPR_NDR_SIMPLE_TYPE_DECL (winpr_ndr, int64, INT64) | |
| WINPR_NDR_SIMPLE_TYPE_DECL (winpr_ndr, uint64, UINT64) | |
| WINPR_NDR_ARRAY_OF_TYPE_DECL (winpr_ndr, uint8, BYTE) | |
| WINPR_NDR_ARRAY_OF_TYPE_DECL (winpr_ndr, uint16, UINT16) | |
| WINPR_API void | winpr_ndr_encoder_bytes_written (WinPrNdrEncoder *context, size_t len) |
| accounts for bytes written directly in the stream, for the alignments | |
| WINPR_ATTR_NODISCARD WINPR_API BOOL | winpr_ndr_encoder_write_align (WinPrNdrEncoder *context, wStream *s, size_t sz) |
| writes zero padding to align the current object offset | |
| WINPR_ATTR_NODISCARD WINPR_API BOOL | winpr_ndr_encoder_write_data (WinPrNdrEncoder *context, wStream *s, const void *data, size_t sz) |
| writes raw bytes, without alignment | |
| WINPR_ATTR_NODISCARD WINPR_API BOOL | winpr_ndr_encoder_start_object (WinPrNdrEncoder *context, wStream *s) |
| starts a serialized object ([MS-RPCE] 2.2.6 type serialization version 1) | |
| WINPR_ATTR_NODISCARD WINPR_API BOOL | winpr_ndr_encoder_end_object (WinPrNdrEncoder *context, wStream *s) |
| ends the serialized object started with winpr_ndr_encoder_start_object() | |
| WINPR_ATTR_NODISCARD WINPR_API BOOL | winpr_ndr_encoder_write_toplevel_refid (WinPrNdrEncoder *context, wStream *s) |
| writes a new referent id for a non-null top-level pointer | |
| WINPR_ATTR_NODISCARD WINPR_API BOOL | winpr_ndr_encoder_write_uconformant_varying_array (WinPrNdrEncoder *context, wStream *s, const WinPrNdrVaryingArrayHints *hints, WinPrNdrMessageType itemType, const void *src) |
| writes a conformant varying array: its maximum count, offset 0, actual count and the items | |
| WINPR_ATTR_NODISCARD WINPR_API BOOL | winpr_ndr_encoder_write_uconformant_array (WinPrNdrEncoder *context, wStream *s, UINT32 len, WinPrNdrMessageType itemType, const BYTE *ptr) |
| writes a conformant array: its count and the items | |
| WINPR_ATTR_NODISCARD WINPR_API BOOL | winpr_ndr_encoder_write_fromDescr (WinPrNdrEncoder *context, wStream *s, const WinPrNdrStructDescr *descr, const void *src) |
| writes a structure from its descriptor | |
| WINPR_ATTR_NODISCARD WINPR_API BOOL | winpr_ndr_encoder_write_union (WinPrNdrEncoder *context, wStream *s, const WinPrNdrUnionDescr *descr, UINT32 switchValue, const void *src) |
| writes the discriminant and the arm of a union | |
| WINPR_ATTR_NODISCARD WINPR_API winpr_ndr_refid | winpr_ndr_pointer_refid (const void *ptr) |
| a referent id built from the value of a pointer | |
| WINPR_ATTR_NODISCARD WINPR_API BOOL | winpr_ndr_encoder_allocatePtr (WinPrNdrEncoder *context, const void *ptr, winpr_ndr_refid *prefId, BOOL *pnewPtr) |
| allocates the referent id of an embedded pointer | |
| WINPR_ATTR_NODISCARD WINPR_API BOOL | winpr_ndr_encoder_treat_deferreds (WinPrNdrEncoder *context, wStream *s) |
| writes the pending deferred referents | |
| WINPR_API void | winpr_ndr_decoder_free (WinPrNdrDecoder *context) |
| frees a decoder | |
| static INLINE void | winpr_ndr_decoder_destroy (WinPrNdrDecoder **pcontext) |
| frees a decoder and resets the pointer | |
| WINPR_API WinPrNdrDecoder * | winpr_ndr_decoder_new (BOOL bigEndianDrep, BYTE version) |
| creates a decoder | |
| WINPR_API WinPrNdrDecoder * | winpr_ndr_decoder_new_fromStream (wStream *s) |
| reads the common type header ([MS-RPCE] 2.2.6.1) and creates a decoder for its version and endianness | |
| WINPR_API void | winpr_ndr_decoder_bytes_read (WinPrNdrDecoder *context, size_t len) |
| accounts for bytes read directly from the stream, for the alignments | |
| WINPR_ATTR_NODISCARD WINPR_API BOOL | winpr_ndr_decoder_read_object (WinPrNdrDecoder *context, wStream *s, wStream *object) |
| reads the private header of a serialized object ([MS-RPCE] 2.2.6 type serialization version 1) | |
| WINPR_ATTR_NODISCARD WINPR_API BOOL | winpr_ndr_decoder_push_deferreds (WinPrNdrDecoder *context, WinPrNdrDeferredEntry *deferreds, size_t ndeferred) |
| adds deferred pointers, read by the next winpr_ndr_decoder_treat_deferreds() | |
| WINPR_ATTR_NODISCARD WINPR_API BOOL | winpr_ndr_decoder_treat_deferreds (WinPrNdrDecoder *context, wStream *s) |
| reads the pending deferred referents | |
| WINPR_ATTR_NODISCARD WINPR_API BOOL | winpr_ndr_decoder_read_refpointer (WinPrNdrDecoder *context, wStream *s, UINT32 *refId) |
| reads a referent id | |
| WINPR_ATTR_NODISCARD WINPR_API BOOL | winpr_ndr_decoder_read_pointer_ex (WinPrNdrDecoder *context, wStream *s, const char *name, WinPrNdrMessageType descr, void *hints, void **target) |
| reads a full pointer ([ptr]) | |
| WINPR_API void | winpr_ndr_pointer_release (void *ptr) |
| releases a referent | |
| WINPR_API void * | winpr_ndr_pointer_new (WinPrNdrMessageType descr, const void *hints, size_t size) |
| allocates a referent | |
| WINPR_API void * | winpr_ndr_pointer_ref (void *ptr) |
| takes a reference on a referent | |
| WINPR_ATTR_NODISCARD WINPR_API size_t | winpr_ndr_pointer_size (const void *ptr) |
| the size of a referent, as allocated by winpr_ndr_pointer_new() | |
| WINPR_ATTR_NODISCARD WINPR_API BOOL | winpr_ndr_decoder_skip_bytes (WinPrNdrDecoder *context, wStream *s, size_t nbytes) |
| skips bytes | |
| WINPR_ATTR_NODISCARD WINPR_API BOOL | winpr_ndr_decoder_read_align (WinPrNdrDecoder *context, wStream *s, size_t sz) |
| skips the padding to align the current object offset | |
| WINPR_ATTR_NODISCARD WINPR_API BOOL | winpr_ndr_decoder_read_wchar (WinPrNdrDecoder *context, wStream *s, WCHAR *ptr) |
| reads a WCHAR, aligned on 2 bytes | |
| WINPR_ATTR_NODISCARD WINPR_API BOOL | winpr_ndr_encoder_write_wchar (WinPrNdrEncoder *context, wStream *s, const WCHAR *ptr) |
| writes a WCHAR stored in UTF-16LE, aligned on 2 bytes | |
| WINPR_ATTR_NODISCARD WINPR_API WinPrNdrMessageType | winpr_ndr_wchar_descr (void) |
| the message type of winpr_ndr_wchar_descr_s | |
| WINPR_NDR_ARRAY_OF_TYPE_DECL (winpr_ndr, wchar, WCHAR) | |
| the arrays of WCHAR, stored in UTF-16LE in memory: use them for strings instead of the uint16 arrays, which store the items in host byte order | |
| WINPR_ATTR_NODISCARD WINPR_API BOOL | winpr_ndr_decoder_read_pointedMessageEx (WinPrNdrDecoder *context, wStream *s, winpr_ndr_refid ptrId, WinPrNdrMessageType descr, void *hints, void **target) |
| reads the referent of a unique pointer | |
| WINPR_ATTR_NODISCARD WINPR_API BOOL | winpr_ndr_decoder_read_fromDescr (WinPrNdrDecoder *context, wStream *s, const WinPrNdrStructDescr *descr, void *target) |
| reads a structure from its descriptor | |
| WINPR_ATTR_NODISCARD WINPR_API BOOL | winpr_ndr_decoder_read_union (WinPrNdrDecoder *context, wStream *s, const WinPrNdrUnionDescr *descr, UINT32 switchValue, void *target) |
| reads a union, its discriminant must be switchValue | |
| WINPR_ATTR_NODISCARD WINPR_API BOOL | winpr_ndr_decoder_read_uconformant_array (WinPrNdrDecoder *context, wStream *s, const WinPrNdrArrayHints *hints, WinPrNdrMessageType itemType, void *vtarget) |
| reads a conformant array: its count and the items | |
| WINPR_ATTR_NODISCARD WINPR_API BOOL | winpr_ndr_decoder_read_uconformant_varying_array (WinPrNdrDecoder *context, wStream *s, const WinPrNdrVaryingArrayHints *hints, WinPrNdrMessageType itemType, void *ptarget) |
| reads a conformant varying array: its maximum count, offset, actual count and the items | |
| WINPR_ATTR_NODISCARD WINPR_API WinPrNdrMessageType | winpr_ndr_string_conformant_descr (void) |
| the message type of winpr_ndr_string_conformant_descr_s | |
| WINPR_ATTR_NODISCARD WINPR_API WinPrNdrMessageType | winpr_ndr_string_varying_descr (void) |
| the message type of winpr_ndr_string_varying_descr_s | |
| WINPR_ATTR_NODISCARD WINPR_API WinPrNdrMessageType | winpr_ndr_wstring_varying_descr (void) |
| the message type of winpr_ndr_wstring_varying_descr_s | |
| WINPR_API void | winpr_ndr_struct_dump_fromDescr (wLog *logger, UINT32 lvl, size_t identLevel, const WinPrNdrStructDescr *descr, const void *obj) |
| dumps a structure in the logs from its descriptor | |
| WINPR_API void | winpr_ndr_struct_destroy (const WinPrNdrStructDescr *descr, void *pptr) |
| releases the content of a structure from its descriptor | |
| WINPR_ATTR_NODISCARD WINPR_API UINT32 | winpr_ndr_union_switch_value (const WinPrNdrUnionDescr *descr, const void *switchField) |
| the value of the [switch_is()] field of a union | |
| WINPR_API void | winpr_ndr_union_destroy (const WinPrNdrUnionDescr *descr, UINT32 switchValue, void *obj) |
| releases the content of the arm switchValue of a union | |
Variables | |
| WINPR_API const WinPrNdrMessageDescr | winpr_ndr_wchar_descr_s |
| a WCHAR, stored in UTF-16LE in memory | |
| WINPR_API const WinPrNdrMessageDescr | winpr_ndr_string_conformant_descr_s |
| conformant string of char, read in a char* allocated with winpr_ndr_pointer_new() | |
| WINPR_API const WinPrNdrMessageDescr | winpr_ndr_string_varying_descr_s |
| [string] char*: a conformant varying string of char, read in a char* allocated with winpr_ndr_pointer_new() | |
| WINPR_API const WinPrNdrMessageDescr | winpr_ndr_wstring_varying_descr_s |
| [string] wchar_t*: a conformant varying string of WCHAR, read in a WCHAR* allocated with winpr_ndr_pointer_new() | |
NDR encoder and decoder ([C706] chapter 14, [MS-RPCE] 2.2.5 and 2.2.6)
WinPR: Windows Portable Runtime NDR (Network Data Representation) encoding and decoding
Copyright 2024 David Fort conta.nosp@m.ct@h.nosp@m.arden.nosp@m.ing-.nosp@m.consu.nosp@m.ltin.nosp@m.g.com
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Messages are described with descriptors (WinPrNdrMessageDescr, WinPrNdrStructDescr, WinPrNdrUnionDescr), and read, written, dumped and destroyed from these descriptors.
The encoder (WinPrNdrEncoder) and the decoder (WinPrNdrDecoder) keep the alignment offset of the current object and the pending deferred pointers: the referents of the embedded pointers are written after the construct that contains them, so writing or reading a message is followed by a call to winpr_ndr_encoder_treat_deferreds() or winpr_ndr_decoder_treat_deferreds().
All the pointers returned by the decoder are reference counted referents allocated with winpr_ndr_pointer_new(), they must not be passed to free() but released with winpr_ndr_pointer_release() (winpr_ndr_struct_destroy() releases the pointers of a structure).
Definition in file ndr.h.
| struct WinPrNdrMessageDescr |

| Data Fields | ||
|---|---|---|
| WinPrNdrTypeArity | arity | |
| WINPR_NDR_DESTROY_FN | destroyFn |
releases its content, can be nullptr |
| WINPR_NDR_DUMP_FN | dumpFn |
dumps it in the logs, can be nullptr |
| size_t | itemSize |
size of the C type (of an item for an array) |
| WINPR_NDR_READER_FN | readFn |
reads the message |
| WINPR_NDR_WRITER_FN | writeFn |
writes the message |
| struct WinPrNdrFieldStruct |

| Data Fields | ||
|---|---|---|
| size_t | fixedArraySize |
size in bytes of the inline storage of an array |
| SSIZE_T | hintsField |
index of the field holding the hints of this field (the size of an array...), -1 if none |
| const char * | name |
name of the field, for the logs |
| WinPrNdrPointerType | pointerType |
how the field is stored |
| UINT32 | rangeMax |
for an integer field: [range(0, rangeMax)], not checked if 0 |
| size_t | structOffset |
offset of the field in the structure |
| WinPrNdrMessageType | typeDescr |
type of the field (of its referent for a pointer) |
| struct WinPrNdrStructDescr |

| Data Fields | ||
|---|---|---|
| size_t | alignment |
alignment of the structure (its largest member), 0 if unspecified |
| const WinPrNdrFieldStruct * | fields |
the fields, in their wire order |
| const char * | name |
name of the structure, for the logs |
| size_t | nfields |
number of fields |
| struct WinPrNdrUnionArm |

| Data Fields | ||
|---|---|---|
| UINT32 | discriminant |
the [case()] value of the arm |
| WinPrNdrFieldStruct | field |
the arm, its structOffset is relative to the union and it has no hints. An arm without typeDescr has no body |
| struct WinPrNdrUnionDescr |
a non-encapsulated union ([switch_type()])
On the wire the union is its discriminant followed by the selected arm, aligned on its own type.

| Data Fields | ||
|---|---|---|
| const WinPrNdrUnionArm * | arms |
the arms |
| const WinPrNdrUnionArm * | defaultArm |
the [default] arm, its discriminant is ignored. Without it an unknown discriminant is an error |
| const char * | name |
name of the union, for the logs |
| size_t | narms |
number of arms |
| size_t | switchSize |
size of the discriminant and of the [switch_is()] field: 2 for a short or an enum, 4 for a long (the default when 0) |
| struct WinPrNdrDeferredEntry |
a deferred pointer, a referent to read after the current construct

| Data Fields | ||
|---|---|---|
| BOOL | allocate |
the referent is allocated with winpr_ndr_pointer_new() (or by the reader of a self allocated type) |
| void * | hints |
hints of the referent, valid until the deferred is treated |
| WinPrNdrMessageType | msg |
the type of the referent |
| const char * | name |
name of the pointer, for the logs |
| winpr_ndr_refid | ptrId |
the referent id read for the pointer |
| void * | target |
if allocate is set, the pointer field that receives the referent, otherwise the storage the referent is read into |
| struct WinPrNdrVaryingArrayHints |
| struct WinPrNdrArrayHints |
| #define WINPR_NDR_ARRAY_MESSAGE_DEFINE | ( | PREFIX, | |
| ITEMPREFIX, | |||
| CTYPE | |||
| ) |
defines a static message type for a conformant array of ITEMPREFIX##_descr_s items
Defines PREFIX##_descr_s, the hints of the array field are a WinPrNdrArrayHints.
Definition at line 151 of file ndr.h.
| #define WINPR_NDR_ARRAY_OF_TYPE_DECL | ( | PREFIX, | |
| TYPE, | |||
| UPPERTYPE | |||
| ) |
declares the functions and the message descriptors of the arrays of a simple type
For the items of type TYPE (stored in a UPPERTYPE) this declares:
| #define WINPR_NDR_PTR_NULL (0UL) |
| #define WINPR_NDR_SIMPLE_TYPE_DECL | ( | PREFIX, | |
| LOWER, | |||
| UPPER | |||
| ) |
declares the functions and the message descriptor of a simple type
For a type named LOWER (stored in a UPPER) this declares:
| #define WINPR_NDR_STRUCT_MESSAGE_DEFINE | ( | PREFIX, | |
| CTYPE | |||
| ) |
defines a static message type for a structure
Defines PREFIX##_descr_s for the CTYPE structure described by the WinPrNdrStructDescr PREFIX##_struct.
Definition at line 120 of file ndr.h.
| #define WINPR_NDR_UNION_MESSAGE_DEFINE | ( | PREFIX, | |
| CTYPE | |||
| ) |
defines a static message type for a non-encapsulated union
Defines PREFIX##_descr_s for the CTYPE union described by the WinPrNdrUnionDescr PREFIX##_union. The hints of the union field are the field of its [switch_is()], a UINT16 or a UINT32 depending on the switchSize of the union.
Definition at line 186 of file ndr.h.
| typedef void(* WINPR_NDR_DESTROY_FN) (const void *hints, void *obj) |
| typedef void(* WINPR_NDR_DUMP_FN) (wLog *logger, UINT32 lvl, size_t indentLevel, const void *obj) |
| typedef BOOL(* WINPR_NDR_READER_FN) (WinPrNdrDecoder *context, wStream *s, const void *hints, void *target) |
| typedef UINT32 winpr_ndr_refid |
| typedef BOOL(* WINPR_NDR_WRITER_FN) (WinPrNdrEncoder *context, wStream *s, const void *hints, const void *obj) |
| typedef const WinPrNdrMessageDescr* WinPrNdrMessageType |
| enum WinPrNdrPointerType |
pointer or not and if null is accepted
| enum WinPrNdrTypeArity |
arity of a message
| Enumerator | |
|---|---|
| WINPR_NDR_ARITY_SIMPLE | a single item |
| WINPR_NDR_ARITY_ARRAYOF | a conformant array, the hints are a WinPrNdrArrayHints |
| WINPR_NDR_ARITY_VARYING_ARRAYOF | a conformant varying array, the hints are a WinPrNdrVaryingArrayHints |
| WINPR_NDR_ARITY_SELF_ALLOCATED | the reader allocates the referent (strings...) with winpr_ndr_pointer_new(): the target is the pointer field, itemSize is the size of an element |
Definition at line 278 of file ndr.h.
| WINPR_NDR_ARRAY_OF_TYPE_DECL | ( | winpr_ndr | , |
| wchar | , | ||
| WCHAR | |||
| ) |
the arrays of WCHAR, stored in UTF-16LE in memory: use them for strings instead of the uint16 arrays, which store the items in host byte order
| WINPR_API void winpr_ndr_decoder_bytes_read | ( | WinPrNdrDecoder * | context, |
| size_t | len | ||
| ) |
accounts for bytes read directly from the stream, for the alignments
| context | the decoder |
| len | the number of bytes read |
Definition at line 1158 of file ndr.c.
References winpr_ndr_decoder_bytes_read().
Referenced by winpr_ndr_decoder_bytes_read().


|
static |
frees a decoder and resets the pointer
| pcontext | a pointer on the decoder to free, must not be nullptr |
Definition at line 657 of file ndr.h.
References winpr_ndr_decoder_free().

| WINPR_API void winpr_ndr_decoder_free | ( | WinPrNdrDecoder * | context | ) |
frees a decoder
The referents it decoded belong to their pointers and are not released.
| context | the decoder to free, can be nullptr |
Definition at line 1148 of file ndr.c.
References winpr_ndr_decoder_free().
Referenced by winpr_ndr_decoder_destroy(), winpr_ndr_decoder_free(), and winpr_ndr_decoder_new().


| WINPR_API WinPrNdrDecoder * winpr_ndr_decoder_new | ( | BOOL | bigEndianDrep, |
| BYTE | version | ||
| ) |
creates a decoder
| bigEndianDrep | TRUE to decode big endian data, FALSE for little endian |
| version | the type serialization version |
Definition at line 1106 of file ndr.c.
References winpr_ndr_decoder_free(), and winpr_ndr_decoder_new().
Referenced by winpr_ndr_decoder_new(), and winpr_ndr_decoder_new_fromStream().


| WINPR_API WinPrNdrDecoder * winpr_ndr_decoder_new_fromStream | ( | wStream * | s | ) |
reads the common type header ([MS-RPCE] 2.2.6.1) and creates a decoder for its version and endianness
Only the version 1 is supported.
| s | the stream to read from, positioned after the header on success |
Definition at line 1124 of file ndr.c.
References winpr_ndr_decoder_new(), and winpr_ndr_decoder_new_fromStream().
Referenced by winpr_ndr_decoder_new_fromStream().


| WINPR_ATTR_NODISCARD WINPR_API BOOL winpr_ndr_decoder_push_deferreds | ( | WinPrNdrDecoder * | context, |
| WinPrNdrDeferredEntry * | deferreds, | ||
| size_t | ndeferred | ||
| ) |
adds deferred pointers, read by the next winpr_ndr_decoder_treat_deferreds()
This is used by custom readers that read the referent ids of their pointers themselves. The entries are copied, the hints they reference must stay valid until they are treated.
| context | the decoder |
| deferreds | the deferred pointers, in their wire order |
| ndeferred | the number of entries |
Definition at line 1803 of file ndr.c.
References winpr_ndr_decoder_push_deferreds().
Referenced by winpr_ndr_decoder_push_deferreds().


| WINPR_ATTR_NODISCARD WINPR_API BOOL winpr_ndr_decoder_read_align | ( | WinPrNdrDecoder * | context, |
| wStream * | s, | ||
| size_t | sz | ||
| ) |
skips the padding to align the current object offset
| context | the decoder |
| s | the stream to read from |
| sz | the alignment, must not be 0 |
Definition at line 1176 of file ndr.c.
References winpr_ndr_decoder_read_align().
Referenced by winpr_ndr_decoder_read_align(), and winpr_ndr_decoder_read_fromDescr().


| WINPR_ATTR_NODISCARD WINPR_API BOOL winpr_ndr_decoder_read_fromDescr | ( | WinPrNdrDecoder * | context, |
| wStream * | s, | ||
| const WinPrNdrStructDescr * | descr, | ||
| void * | target | ||
| ) |
reads a structure from its descriptor
The structure is aligned on descr->alignment, the referents of its pointers are deferred. On failure the structure may be partially filled, it is released with winpr_ndr_struct_destroy().
| context | the decoder |
| s | the stream to read from |
| descr | the descriptor of the structure |
| target | the structure, zeroed by the caller |
Definition at line 1695 of file ndr.c.
References WinPrNdrStructDescr::alignment, WinPrNdrStructDescr::fields, WinPrNdrStructDescr::nfields, winpr_ndr_decoder_read_align(), and winpr_ndr_decoder_read_fromDescr().
Referenced by winpr_ndr_decoder_read_fromDescr().


| WINPR_ATTR_NODISCARD WINPR_API BOOL winpr_ndr_decoder_read_object | ( | WinPrNdrDecoder * | context, |
| wStream * | s, | ||
| wStream * | object | ||
| ) |
reads the private header of a serialized object ([MS-RPCE] 2.2.6 type serialization version 1)
The alignments are then relative to the start of the object data.
| context | the decoder |
| s | the stream to read from, positioned after the object on success |
| object | receives a static stream on the object data, to decode with this context. It points in the buffer of s. |
Definition at line 1199 of file ndr.c.
References winpr_ndr_decoder_read_object().
Referenced by winpr_ndr_decoder_read_object().


| WINPR_ATTR_NODISCARD WINPR_API BOOL winpr_ndr_decoder_read_pointedMessageEx | ( | WinPrNdrDecoder * | context, |
| wStream * | s, | ||
| winpr_ndr_refid | ptrId, | ||
| WinPrNdrMessageType | descr, | ||
| void * | hints, | ||
| void ** | target | ||
| ) |
reads the referent of a unique pointer
The referent is allocated with winpr_ndr_pointer_new() (or by the reader of a self allocated type) and read. A referent id already used by another pointer is rejected.
| context | the decoder |
| s | the stream to read from |
| ptrId | the referent id of the pointer, nothing is read for WINPR_NDR_PTR_NULL |
| descr | the type of the referent |
| hints | the hints of the referent, can be nullptr for a simple type |
| target | receives the referent, nullptr for a null pointer |
Definition at line 1741 of file ndr.c.
References WinPrNdrMessageDescr::readFn, WINPR_NDR_ARITY_ARRAYOF, WINPR_NDR_ARITY_SELF_ALLOCATED, winpr_ndr_decoder_read_pointedMessageEx(), winpr_ndr_pointer_new(), and winpr_ndr_pointer_release().
Referenced by winpr_ndr_decoder_read_pointedMessageEx(), and winpr_ndr_decoder_treat_deferreds().


| WINPR_ATTR_NODISCARD WINPR_API BOOL winpr_ndr_decoder_read_pointer_ex | ( | WinPrNdrDecoder * | context, |
| wStream * | s, | ||
| const char * | name, | ||
| WinPrNdrMessageType | descr, | ||
| void * | hints, | ||
| void ** | target | ||
| ) |
reads a full pointer ([ptr])
The first pointer with a referent id allocates a reference counted block for a referent of type descr, the referent is read with the deferred pointers. The next pointers with the same referent id get a new reference on that block, they must have the same type and the same size. Types allocating their referent (WINPR_NDR_ARITY_SELF_ALLOCATED) can't be used.
| context | the decoder |
| s | the stream to read from |
| name | the name of the pointer, for the logs |
| descr | the type of the referent |
| hints | the hints of the referent, they must be valid until the deferred pointers are treated |
| target | receives the referent with a reference, nullptr for a null pointer |
Definition at line 1596 of file ndr.c.
References winpr_ndr_decoder_read_pointer_ex().
Referenced by winpr_ndr_decoder_read_pointer_ex().


| WINPR_ATTR_NODISCARD WINPR_API BOOL winpr_ndr_decoder_read_refpointer | ( | WinPrNdrDecoder * | context, |
| wStream * | s, | ||
| UINT32 * | refId | ||
| ) |
reads a referent id
| context | the decoder |
| s | the stream to read from |
| refId | receives the referent id, WINPR_NDR_PTR_NULL for a null pointer |
Definition at line 1194 of file ndr.c.
References winpr_ndr_decoder_read_refpointer().
Referenced by winpr_ndr_decoder_read_refpointer().


| WINPR_ATTR_NODISCARD WINPR_API BOOL winpr_ndr_decoder_read_uconformant_array | ( | WinPrNdrDecoder * | context, |
| wStream * | s, | ||
| const WinPrNdrArrayHints * | hints, | ||
| WinPrNdrMessageType | itemType, | ||
| void * | vtarget | ||
| ) |
reads a conformant array: its count and the items
For simple items the count must be hints->count, otherwise the items must fit in hints->count bytes. The referents of the pointers in the items are deferred after the array.
| context | the decoder |
| s | the stream to read from |
| hints | the expected size of the array, must not be nullptr |
| itemType | the type of the items |
| vtarget | receives the items |
Definition at line 1361 of file ndr.c.
References WinPrNdrArrayHints::count, WinPrNdrMessageDescr::itemSize, and winpr_ndr_decoder_read_uconformant_array().
Referenced by winpr_ndr_decoder_read_uconformant_array().


| WINPR_ATTR_NODISCARD WINPR_API BOOL winpr_ndr_decoder_read_uconformant_varying_array | ( | WinPrNdrDecoder * | context, |
| wStream * | s, | ||
| const WinPrNdrVaryingArrayHints * | hints, | ||
| WinPrNdrMessageType | itemType, | ||
| void * | ptarget | ||
| ) |
reads a conformant varying array: its maximum count, offset, actual count and the items
The actual and maximum counts of items must fit in hints->length and hints->maxLength bytes. The referents of the pointers in the items are deferred after the array.
| context | the decoder |
| s | the stream to read from |
| hints | the bounds of the array, must not be nullptr |
| itemType | the type of the items |
| ptarget | receives the items |
Definition at line 1341 of file ndr.c.
References winpr_ndr_decoder_read_uconformant_varying_array().
Referenced by winpr_ndr_decoder_read_uconformant_varying_array().


| WINPR_ATTR_NODISCARD WINPR_API BOOL winpr_ndr_decoder_read_union | ( | WinPrNdrDecoder * | context, |
| wStream * | s, | ||
| const WinPrNdrUnionDescr * | descr, | ||
| UINT32 | switchValue, | ||
| void * | target | ||
| ) |
reads a union, its discriminant must be switchValue
| context | the decoder |
| s | the stream to read from |
| descr | the descriptor of the union |
| switchValue | the value of the [switch_is()] field of the union |
| target | the union |
Definition at line 1922 of file ndr.c.
References WinPrNdrUnionArm::field, WinPrNdrUnionDescr::name, WinPrNdrFieldStruct::typeDescr, and winpr_ndr_decoder_read_union().
Referenced by winpr_ndr_decoder_read_union().


| WINPR_ATTR_NODISCARD WINPR_API BOOL winpr_ndr_decoder_read_wchar | ( | WinPrNdrDecoder * | context, |
| wStream * | s, | ||
| WCHAR * | ptr | ||
| ) |
reads a WCHAR, aligned on 2 bytes
The character is stored in UTF-16LE like all the WinPR WCHAR strings, whatever the byte order of the host.
| context | the decoder |
| s | the stream to read from |
| ptr | receives the character |
Definition at line 631 of file ndr.c.
References winpr_ndr_decoder_read_wchar().
Referenced by winpr_ndr_decoder_read_wchar().


| WINPR_ATTR_NODISCARD WINPR_API BOOL winpr_ndr_decoder_skip_bytes | ( | WinPrNdrDecoder * | context, |
| wStream * | s, | ||
| size_t | nbytes | ||
| ) |
skips bytes
| context | the decoder |
| s | the stream to read from |
| nbytes | the number of bytes to skip |
Definition at line 1164 of file ndr.c.
References winpr_ndr_decoder_skip_bytes().
Referenced by winpr_ndr_decoder_skip_bytes().


| WINPR_ATTR_NODISCARD WINPR_API BOOL winpr_ndr_decoder_treat_deferreds | ( | WinPrNdrDecoder * | context, |
| wStream * | s | ||
| ) |
reads the pending deferred referents
| context | the decoder |
| s | the stream to read from |
Definition at line 1714 of file ndr.c.
References WinPrNdrDeferredEntry::allocate, WinPrNdrDeferredEntry::hints, WinPrNdrDeferredEntry::msg, WinPrNdrDeferredEntry::name, WinPrNdrDeferredEntry::ptrId, WinPrNdrMessageDescr::readFn, WinPrNdrDeferredEntry::target, winpr_ndr_decoder_read_pointedMessageEx(), and winpr_ndr_decoder_treat_deferreds().
Referenced by winpr_ndr_decoder_treat_deferreds().


| WINPR_ATTR_NODISCARD WINPR_API BOOL winpr_ndr_encoder_allocatePtr | ( | WinPrNdrEncoder * | context, |
| const void * | ptr, | ||
| winpr_ndr_refid * | prefId, | ||
| BOOL * | pnewPtr | ||
| ) |
allocates the referent id of an embedded pointer
The pointers are written as unique pointers: each non-null pointer gets its own referent id, and *pnewPtr is always set to TRUE.
| context | the encoder |
| ptr | the pointer |
| prefId | receives the referent id |
| pnewPtr | receives TRUE if the referent is to be written |
Definition at line 1056 of file ndr.c.
References winpr_ndr_encoder_allocatePtr().
Referenced by winpr_ndr_encoder_allocatePtr().


| WINPR_API void winpr_ndr_encoder_bytes_written | ( | WinPrNdrEncoder * | context, |
| size_t | len | ||
| ) |
accounts for bytes written directly in the stream, for the alignments
| context | the encoder |
| len | the number of bytes written |
Definition at line 218 of file ndr.c.
References winpr_ndr_encoder_bytes_written().
Referenced by winpr_ndr_encoder_bytes_written(), and winpr_ndr_encoder_write_data().


|
static |
frees an encoder and resets the pointer
| pcontext | a pointer on the encoder to free, must not be nullptr |
Definition at line 405 of file ndr.h.
References winpr_ndr_encoder_free().

| WINPR_ATTR_NODISCARD WINPR_API BOOL winpr_ndr_encoder_end_object | ( | WinPrNdrEncoder * | context, |
| wStream * | s | ||
| ) |
ends the serialized object started with winpr_ndr_encoder_start_object()
Pads the object data to a multiple of 8 bytes and fills the private header.
| context | the encoder |
| s | the stream given to winpr_ndr_encoder_start_object() |
Definition at line 282 of file ndr.c.
References winpr_ndr_encoder_end_object().
Referenced by winpr_ndr_encoder_end_object().


| WINPR_API void winpr_ndr_encoder_free | ( | WinPrNdrEncoder * | context | ) |
frees an encoder
| context | the encoder to free, can be nullptr |
Definition at line 213 of file ndr.c.
References winpr_ndr_encoder_free().
Referenced by winpr_ndr_encoder_destroy(), and winpr_ndr_encoder_free().


| WINPR_API WinPrNdrEncoder * winpr_ndr_encoder_from_decoder | ( | const WinPrNdrDecoder * | src | ) |
creates an encoder with the same endianness and version as a decoder, to answer the message it decoded
| src | the decoder |
Definition at line 206 of file ndr.c.
References winpr_ndr_encoder_from_decoder(), and winpr_ndr_encoder_new().
Referenced by winpr_ndr_encoder_from_decoder().


| WINPR_API WinPrNdrEncoder * winpr_ndr_encoder_new | ( | BOOL | bigEndianDrep, |
| BYTE | version | ||
| ) |
creates an encoder
| bigEndianDrep | TRUE to encode in big endian, FALSE for little endian |
| version | the type serialization version written by winpr_ndr_encoder_write_header() |
Definition at line 194 of file ndr.c.
References winpr_ndr_encoder_new().
Referenced by winpr_ndr_encoder_from_decoder(), and winpr_ndr_encoder_new().


| WINPR_ATTR_NODISCARD WINPR_API BOOL winpr_ndr_encoder_start_object | ( | WinPrNdrEncoder * | context, |
| wStream * | s | ||
| ) |
starts a serialized object ([MS-RPCE] 2.2.6 type serialization version 1)
Writes a placeholder for the private header, the object data is to be written after. Only one object can be serialized at a time.
| context | the encoder |
| s | the stream to write to |
Definition at line 259 of file ndr.c.
References winpr_ndr_encoder_start_object().
Referenced by winpr_ndr_encoder_start_object().


| WINPR_ATTR_NODISCARD WINPR_API BOOL winpr_ndr_encoder_treat_deferreds | ( | WinPrNdrEncoder * | context, |
| wStream * | s | ||
| ) |
writes the pending deferred referents
| context | the encoder |
| s | the stream to write to |
Definition at line 1075 of file ndr.c.
References WinPrNdrDeferredEntry::hints, WinPrNdrDeferredEntry::msg, WinPrNdrDeferredEntry::name, WinPrNdrDeferredEntry::target, winpr_ndr_encoder_treat_deferreds(), and WinPrNdrMessageDescr::writeFn.
Referenced by winpr_ndr_encoder_treat_deferreds().


| WINPR_ATTR_NODISCARD WINPR_API BOOL winpr_ndr_encoder_write_align | ( | WinPrNdrEncoder * | context, |
| wStream * | s, | ||
| size_t | sz | ||
| ) |
writes zero padding to align the current object offset
| context | the encoder |
| s | the stream to write to |
| sz | the alignment, must not be 0 |
Definition at line 240 of file ndr.c.
References winpr_ndr_encoder_write_align().
Referenced by winpr_ndr_encoder_write_align(), and winpr_ndr_encoder_write_fromDescr().


| WINPR_ATTR_NODISCARD WINPR_API BOOL winpr_ndr_encoder_write_data | ( | WinPrNdrEncoder * | context, |
| wStream * | s, | ||
| const void * | data, | ||
| size_t | sz | ||
| ) |
writes raw bytes, without alignment
| context | the encoder |
| s | the stream to write to |
| data | the bytes to write |
| sz | the number of bytes |
Definition at line 1094 of file ndr.c.
References winpr_ndr_encoder_bytes_written(), and winpr_ndr_encoder_write_data().
Referenced by winpr_ndr_encoder_write_data().


| WINPR_ATTR_NODISCARD WINPR_API BOOL winpr_ndr_encoder_write_fromDescr | ( | WinPrNdrEncoder * | context, |
| wStream * | s, | ||
| const WinPrNdrStructDescr * | descr, | ||
| const void * | src | ||
| ) |
writes a structure from its descriptor
The structure is aligned on descr->alignment, the referents of its pointers are deferred.
| context | the encoder |
| s | the stream to write to |
| descr | the descriptor of the structure |
| src | the structure |
Definition at line 1032 of file ndr.c.
References WinPrNdrStructDescr::alignment, WinPrNdrStructDescr::fields, WinPrNdrStructDescr::nfields, winpr_ndr_encoder_write_align(), and winpr_ndr_encoder_write_fromDescr().
Referenced by winpr_ndr_encoder_write_fromDescr().


| WINPR_ATTR_NODISCARD WINPR_API BOOL winpr_ndr_encoder_write_header | ( | WinPrNdrEncoder * | context, |
| wStream * | s | ||
| ) |
writes the common type header ([MS-RPCE] 2.2.6.1): version, endianness, header length and filler
| context | the encoder |
| s | the stream to write to |
Definition at line 224 of file ndr.c.
References winpr_ndr_encoder_write_header().
Referenced by winpr_ndr_encoder_write_header().


| WINPR_ATTR_NODISCARD WINPR_API BOOL winpr_ndr_encoder_write_toplevel_refid | ( | WinPrNdrEncoder * | context, |
| wStream * | s | ||
| ) |
writes a new referent id for a non-null top-level pointer
| context | the encoder |
| s | the stream to write to |
Definition at line 317 of file ndr.c.
References winpr_ndr_encoder_write_toplevel_refid().
Referenced by winpr_ndr_encoder_write_toplevel_refid().


| WINPR_ATTR_NODISCARD WINPR_API BOOL winpr_ndr_encoder_write_uconformant_array | ( | WinPrNdrEncoder * | context, |
| wStream * | s, | ||
| UINT32 | len, | ||
| WinPrNdrMessageType | itemType, | ||
| const BYTE * | ptr | ||
| ) |
writes a conformant array: its count and the items
The referents of the pointers in the items are deferred after the array.
| context | the encoder |
| s | the stream to write to |
| len | the number of items |
| itemType | the type of the items |
| ptr | the items |
Definition at line 935 of file ndr.c.
References winpr_ndr_encoder_write_uconformant_array().
Referenced by winpr_ndr_encoder_write_uconformant_array().


| WINPR_ATTR_NODISCARD WINPR_API BOOL winpr_ndr_encoder_write_uconformant_varying_array | ( | WinPrNdrEncoder * | context, |
| wStream * | s, | ||
| const WinPrNdrVaryingArrayHints * | hints, | ||
| WinPrNdrMessageType | itemType, | ||
| const void * | src | ||
| ) |
writes a conformant varying array: its maximum count, offset 0, actual count and the items
The referents of the pointers in the items are deferred after the array.
| context | the encoder |
| s | the stream to write to |
| hints | the counts of the array |
| itemType | the type of the items |
| src | the items, hints->length of them are written |
Definition at line 916 of file ndr.c.
References WinPrNdrVaryingArrayHints::length, WinPrNdrVaryingArrayHints::maxLength, and winpr_ndr_encoder_write_uconformant_varying_array().
Referenced by winpr_ndr_encoder_write_uconformant_varying_array().


| WINPR_ATTR_NODISCARD WINPR_API BOOL winpr_ndr_encoder_write_union | ( | WinPrNdrEncoder * | context, |
| wStream * | s, | ||
| const WinPrNdrUnionDescr * | descr, | ||
| UINT32 | switchValue, | ||
| const void * | src | ||
| ) |
writes the discriminant and the arm of a union
| context | the encoder |
| s | the stream to write to |
| descr | the descriptor of the union |
| switchValue | the discriminant, the value of the [switch_is()] field |
| src | the union |
Definition at line 1903 of file ndr.c.
References WinPrNdrUnionArm::field, WinPrNdrFieldStruct::typeDescr, and winpr_ndr_encoder_write_union().
Referenced by winpr_ndr_encoder_write_union().


| WINPR_ATTR_NODISCARD WINPR_API BOOL winpr_ndr_encoder_write_wchar | ( | WinPrNdrEncoder * | context, |
| wStream * | s, | ||
| const WCHAR * | ptr | ||
| ) |
writes a WCHAR stored in UTF-16LE, aligned on 2 bytes
| context | the encoder |
| s | the stream to write to |
| ptr | the character |
Definition at line 643 of file ndr.c.
References winpr_ndr_encoder_write_wchar().
Referenced by winpr_ndr_encoder_write_wchar().


| WINPR_API void * winpr_ndr_pointer_new | ( | WinPrNdrMessageType | descr, |
| const void * | hints, | ||
| size_t | size | ||
| ) |
allocates a referent
All the pointers returned by the decoder are reference counted referents, released with winpr_ndr_pointer_release() (winpr_ndr_struct_destroy() releases the pointers of a structure). Self allocated types allocate their referent with this function, and so must the pointers of a structure built to be encoded and destroyed with winpr_ndr_struct_destroy().
| descr | the type of the referent, its destroy function is called when the referent is released, can be nullptr |
| hints | the hints of the referent for the destroy function, copied, can be nullptr |
| size | the size of the referent, it is zeroed |
Definition at line 1454 of file ndr.c.
References winpr_ndr_pointer_new().
Referenced by winpr_ndr_decoder_read_pointedMessageEx(), and winpr_ndr_pointer_new().


| WINPR_API void * winpr_ndr_pointer_ref | ( | void * | ptr | ) |
takes a reference on a referent
| ptr | the referent, can be nullptr |
Definition at line 1473 of file ndr.c.
References winpr_ndr_pointer_ref().
Referenced by winpr_ndr_pointer_ref().


| WINPR_ATTR_NODISCARD WINPR_API winpr_ndr_refid winpr_ndr_pointer_refid | ( | const void * | ptr | ) |
a referent id built from the value of a pointer
| ptr | the pointer |
Definition at line 1051 of file ndr.c.
References winpr_ndr_pointer_refid().
Referenced by winpr_ndr_pointer_refid().


| WINPR_API void winpr_ndr_pointer_release | ( | void * | ptr | ) |
releases a referent
When the last reference is released the referent is destroyed with the destroy function of its type, and freed.
| ptr | the referent, can be nullptr |
Definition at line 1483 of file ndr.c.
References winpr_ndr_pointer_release().
Referenced by winpr_ndr_decoder_read_pointedMessageEx(), winpr_ndr_pointer_release(), and winpr_ndr_struct_destroy().


| WINPR_ATTR_NODISCARD WINPR_API size_t winpr_ndr_pointer_size | ( | const void * | ptr | ) |
the size of a referent, as allocated by winpr_ndr_pointer_new()
| ptr | the referent, can be nullptr |
Definition at line 1465 of file ndr.c.
References winpr_ndr_pointer_size().
Referenced by winpr_ndr_pointer_size().


| WINPR_ATTR_NODISCARD WINPR_API WinPrNdrMessageType winpr_ndr_string_conformant_descr | ( | void | ) |
the message type of winpr_ndr_string_conformant_descr_s
Definition at line 735 of file ndr.c.
References winpr_ndr_string_conformant_descr(), and winpr_ndr_string_conformant_descr_s.
Referenced by winpr_ndr_string_conformant_descr().


| WINPR_ATTR_NODISCARD WINPR_API WinPrNdrMessageType winpr_ndr_string_varying_descr | ( | void | ) |
the message type of winpr_ndr_string_varying_descr_s
Definition at line 831 of file ndr.c.
References winpr_ndr_string_varying_descr(), and winpr_ndr_string_varying_descr_s.
Referenced by winpr_ndr_string_varying_descr().


| WINPR_API void winpr_ndr_struct_destroy | ( | const WinPrNdrStructDescr * | descr, |
| void * | pptr | ||
| ) |
releases the content of a structure from its descriptor
The pointer fields are released with winpr_ndr_pointer_release() and reset, the inline fields are destroyed with the destroy function of their type. The storage of the structure itself is not freed.
| descr | the descriptor of the structure |
| pptr | the structure |
Definition at line 2005 of file ndr.c.
References WinPrNdrMessageDescr::destroyFn, WinPrNdrStructDescr::fields, WinPrNdrFieldStruct::hintsField, WinPrNdrStructDescr::nfields, WinPrNdrFieldStruct::pointerType, WinPrNdrFieldStruct::structOffset, WinPrNdrFieldStruct::typeDescr, WINPR_NDR_POINTER, WINPR_NDR_POINTER_FULL, WINPR_NDR_POINTER_NON_NULL, winpr_ndr_pointer_release(), and winpr_ndr_struct_destroy().
Referenced by winpr_ndr_struct_destroy(), and winpr_ndr_union_destroy().


| WINPR_API void winpr_ndr_struct_dump_fromDescr | ( | wLog * | logger, |
| UINT32 | lvl, | ||
| size_t | identLevel, | ||
| const WinPrNdrStructDescr * | descr, | ||
| const void * | obj | ||
| ) |
dumps a structure in the logs from its descriptor
| logger | the logger to use |
| lvl | the log level |
| identLevel | the number of tabs to prepend to each line |
| descr | the descriptor of the structure |
| obj | the structure |
Definition at line 1967 of file ndr.c.
References WinPrNdrMessageDescr::dumpFn, WinPrNdrStructDescr::fields, WinPrNdrFieldStruct::name, WinPrNdrStructDescr::name, WinPrNdrStructDescr::nfields, WinPrNdrFieldStruct::pointerType, WinPrNdrFieldStruct::structOffset, WinPrNdrFieldStruct::typeDescr, WINPR_NDR_FIXED_ARRAY, WINPR_NDR_NOT_POINTER, WINPR_NDR_POINTER, WINPR_NDR_POINTER_FULL, WINPR_NDR_POINTER_NON_NULL, and winpr_ndr_struct_dump_fromDescr().
Referenced by winpr_ndr_struct_dump_fromDescr().


| WINPR_API void winpr_ndr_union_destroy | ( | const WinPrNdrUnionDescr * | descr, |
| UINT32 | switchValue, | ||
| void * | obj | ||
| ) |
releases the content of the arm switchValue of a union
| descr | the descriptor of the union |
| switchValue | the discriminant of the arm |
| obj | the union |
Definition at line 1952 of file ndr.c.
References WinPrNdrUnionArm::field, WinPrNdrUnionDescr::name, WinPrNdrFieldStruct::typeDescr, winpr_ndr_struct_destroy(), and winpr_ndr_union_destroy().
Referenced by winpr_ndr_union_destroy().


| WINPR_ATTR_NODISCARD WINPR_API UINT32 winpr_ndr_union_switch_value | ( | const WinPrNdrUnionDescr * | descr, |
| const void * | switchField | ||
| ) |
the value of the [switch_is()] field of a union
| descr | the descriptor of the union, its switchSize gives the size of the field |
| switchField | the [switch_is()] field, a UINT16 or a UINT32 |
Definition at line 1830 of file ndr.c.
References winpr_ndr_union_switch_value().
Referenced by winpr_ndr_union_switch_value().


| WINPR_ATTR_NODISCARD WINPR_API WinPrNdrMessageType winpr_ndr_wchar_descr | ( | void | ) |
the message type of winpr_ndr_wchar_descr_s
Definition at line 668 of file ndr.c.
References winpr_ndr_wchar_descr(), and winpr_ndr_wchar_descr_s.
Referenced by winpr_ndr_wchar_descr().


| WINPR_ATTR_NODISCARD WINPR_API WinPrNdrMessageType winpr_ndr_wstring_varying_descr | ( | void | ) |
the message type of winpr_ndr_wstring_varying_descr_s
Definition at line 898 of file ndr.c.
References winpr_ndr_wstring_varying_descr(), and winpr_ndr_wstring_varying_descr_s.
Referenced by winpr_ndr_wstring_varying_descr().


|
extern |
conformant string of char, read in a char* allocated with winpr_ndr_pointer_new()
Definition at line 726 of file ndr.c.
Referenced by winpr_ndr_string_conformant_descr().
|
extern |
[string] char*: a conformant varying string of char, read in a char* allocated with winpr_ndr_pointer_new()
Definition at line 822 of file ndr.c.
Referenced by winpr_ndr_string_varying_descr().
|
extern |
a WCHAR, stored in UTF-16LE in memory
Definition at line 663 of file ndr.c.
Referenced by winpr_ndr_wchar_descr().
|
extern |
[string] wchar_t*: a conformant varying string of WCHAR, read in a WCHAR* allocated with winpr_ndr_pointer_new()
Definition at line 893 of file ndr.c.
Referenced by winpr_ndr_wstring_varying_descr().