Changeset 752 for trunk/server/librpc/ndr/ndr_basic.c
- Timestamp:
- Nov 29, 2012, 2:06:31 PM (13 years ago)
- Location:
- trunk/server
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/server
- Property svn:mergeinfo changed
/vendor/current merged: 746,748
- Property svn:mergeinfo changed
-
trunk/server/librpc/ndr/ndr_basic.c
r745 r752 1214 1214 1215 1215 /* 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 */ 1218 1225 _PUBLIC_ enum ndr_err_code ndr_push_DATA_BLOB(struct ndr_push *ndr, int ndr_flags, DATA_BLOB blob) 1219 1226 { 1220 1227 if (ndr->flags & LIBNDR_FLAG_REMAINING) { 1221 1228 /* 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) { 1226 1231 blob.length = NDR_ALIGN(ndr, 2); 1227 1232 } else if (ndr->flags & LIBNDR_FLAG_ALIGN4) { … … 1240 1245 1241 1246 /* 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 */ 1244 1256 _PUBLIC_ enum ndr_err_code ndr_pull_DATA_BLOB(struct ndr_pull *ndr, int ndr_flags, DATA_BLOB *blob) 1245 1257 { … … 1248 1260 if (ndr->flags & LIBNDR_FLAG_REMAINING) { 1249 1261 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) { 1254 1264 length = NDR_ALIGN(ndr, 2); 1255 1265 } else if (ndr->flags & LIBNDR_FLAG_ALIGN4) {
Note:
See TracChangeset
for help on using the changeset viewer.