Ignore:
Timestamp:
Nov 29, 2012, 2:06:31 PM (13 years ago)
Author:
Silvan Scherrer
Message:

Samba Server: updated trunk to 3.6.9 2nd part

Location:
trunk/server
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/server

  • trunk/server/librpc/ndr/ndr_basic.c

    r745 r752  
    12141214
    12151215/*
    1216   push a DATA_BLOB onto the wire.
    1217 */
     1216 * Push a DATA_BLOB onto the wire.
     1217 * 1) When called with LIBNDR_FLAG_ALIGN* alignment flags set, push padding
     1218 *    bytes _only_. The length is determined by the alignment required and the
     1219 *    current ndr offset.
     1220 * 2) When called with the LIBNDR_FLAG_REMAINING flag, push the byte array to
     1221 *    the ndr buffer.
     1222 * 3) Otherwise, push a uint32 length _and_ a corresponding byte array to the
     1223 *    ndr buffer.
     1224 */
    12181225_PUBLIC_ enum ndr_err_code ndr_push_DATA_BLOB(struct ndr_push *ndr, int ndr_flags, DATA_BLOB blob)
    12191226{
    12201227        if (ndr->flags & LIBNDR_FLAG_REMAINING) {
    12211228                /* nothing to do */
    1222         } else if (ndr->flags & LIBNDR_ALIGN_FLAGS) {
    1223                 if (ndr->flags & LIBNDR_FLAG_NOALIGN) {
    1224                         blob.length = 0;
    1225                 } else if (ndr->flags & LIBNDR_FLAG_ALIGN2) {
     1229        } else if (ndr->flags & (LIBNDR_ALIGN_FLAGS & ~LIBNDR_FLAG_NOALIGN)) {
     1230                if (ndr->flags & LIBNDR_FLAG_ALIGN2) {
    12261231                        blob.length = NDR_ALIGN(ndr, 2);
    12271232                } else if (ndr->flags & LIBNDR_FLAG_ALIGN4) {
     
    12401245
    12411246/*
    1242   pull a DATA_BLOB from the wire.
    1243 */
     1247 * Pull a DATA_BLOB from the wire.
     1248 * 1) when called with LIBNDR_FLAG_ALIGN* alignment flags set, pull padding
     1249 *    bytes _only_. The length is determined by the alignment required and the
     1250 *    current ndr offset.
     1251 * 2) When called with the LIBNDR_FLAG_REMAINING flag, pull all remaining bytes
     1252 *    from the ndr buffer.
     1253 * 3) Otherwise, pull a uint32 length _and_ a corresponding byte array from the
     1254 *    ndr buffer.
     1255 */
    12441256_PUBLIC_ enum ndr_err_code ndr_pull_DATA_BLOB(struct ndr_pull *ndr, int ndr_flags, DATA_BLOB *blob)
    12451257{
     
    12481260        if (ndr->flags & LIBNDR_FLAG_REMAINING) {
    12491261                length = ndr->data_size - ndr->offset;
    1250         } else if (ndr->flags & LIBNDR_ALIGN_FLAGS) {
    1251                 if (ndr->flags & LIBNDR_FLAG_NOALIGN) {
    1252                         length = 0;
    1253                 } else if (ndr->flags & LIBNDR_FLAG_ALIGN2) {
     1262        } else if (ndr->flags & (LIBNDR_ALIGN_FLAGS & ~LIBNDR_FLAG_NOALIGN)) {
     1263                if (ndr->flags & LIBNDR_FLAG_ALIGN2) {
    12541264                        length = NDR_ALIGN(ndr, 2);
    12551265                } else if (ndr->flags & LIBNDR_FLAG_ALIGN4) {
Note: See TracChangeset for help on using the changeset viewer.