libndr: add support for relative_rap_convert.
authorGünther Deschner <gd@samba.org>
Thu, 29 Apr 2010 23:08:07 +0000 (01:08 +0200)
committerGünther Deschner <gd@samba.org>
Thu, 27 May 2010 21:25:15 +0000 (23:25 +0200)
Will not harm anyone, is only used for rare short (2byte) relative pointers, and
relative_rap_convert is always 0 so far (as all init functions using struct
ndr_pull will zero the struct).

Guenther

librpc/ndr/libndr.h
librpc/ndr/ndr_basic.c

index 133a119069cb59eb006e1e09459cbc1fce4404f2..d5091a6619b4d9054bba14804593d01d702dd5d3 100644 (file)
@@ -62,6 +62,7 @@ struct ndr_pull {
 
        uint32_t relative_highest_offset;
        uint32_t relative_base_offset;
+       uint32_t relative_rap_convert;
        struct ndr_token_list *relative_base_list;
 
        struct ndr_token_list *relative_list;
index f7d6ee04498bb8e7f6823c079d1f46a1f0457def..d0d58b088448b6b83a3ae73d0bab55dbb7ce7111 100644 (file)
@@ -185,6 +185,7 @@ _PUBLIC_ enum ndr_err_code ndr_pull_relative_ptr_short(struct ndr_pull *ndr, uin
        if (*v != 0) {
                ndr->ptr_count++;
        }
+       *(v) -= ndr->relative_rap_convert;
        return NDR_ERR_SUCCESS;
 }