uint32 NextEntryOffset;
FILE_NOTIFY_ACTION Action;
[value(strlen_m(FileName1)*2)] uint32 FileNameLength;
- [charset(UTF16),flag(STR_NOTERM)] uint16 FileName1[FileNameLength];
+ [charset(UTF16),flag(STR_NOTERM)]
+ uint16 FileName1[strlen_m(FileName1)];
+ DATA_BLOB _pad;
} FILE_NOTIFY_INFORMATION;
}
struct notify_change_event *c;
struct FILE_NOTIFY_INFORMATION m;
DATA_BLOB blob;
+ uint16_t pad = 0;
/* Coalesce any identical records. */
while (i+1 < num_changes &&
m.FileName1 = c->name;
m.FileNameLength = strlen_m(c->name)*2;
m.Action = c->action;
- m.NextEntryOffset = (i == num_changes-1) ? 0 : ndr_size_FILE_NOTIFY_INFORMATION(&m, 0);
+
+ m._pad = data_blob_null;
/*
* Offset to next entry, only if there is one
*/
+ if (i == (num_changes-1)) {
+ m.NextEntryOffset = 0;
+ } else {
+ if ((m.FileNameLength % 4) == 2) {
+ m._pad = data_blob_const(&pad, 2);
+ }
+ m.NextEntryOffset =
+ ndr_size_FILE_NOTIFY_INFORMATION(&m, 0);
+ }
+
ndr_err = ndr_push_struct_blob(&blob, talloc_tos(), &m,
(ndr_push_flags_fn_t)ndr_push_FILE_NOTIFY_INFORMATION);
if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {