search for: htole16

Displaying 20 results from an estimated 30 matches for "htole16".

2013 Nov 25
3
Re: [PATCH 3/3] lib: Add support for creating nodes (keys) and values with UTF-16LE-encoded names
...seg_len, nk_id); > if (nkoffset == 0) > return 0; > @@ -619,14 +627,18 @@ hivex_node_add_child (hive_h *h, hive_node_h parent, const char *name) > > struct ntreg_nk_record *nk = > (struct ntreg_nk_record *) ((char *) h->addr + nkoffset); > - nk->flags = htole16 (0x0020); /* key is ASCII. */ > + if (use_utf16) > + nk->flags = htole16 (0x0000); > + else > + nk->flags = htole16 (0x0020); > nk->parent = htole32 (parent - 0x1000); > nk->subkey_lf = htole32 (0xffffffff); > nk->subkey_lf_volatile = htole32 (0x...
2013 Nov 25
1
[PATCH 3/3, take 2] lib: Add support for creating nodes (keys) and values with UTF-16LE-encoded names
...de_h nkoffset = allocate_block (h, seg_len, nk_id); if (nkoffset == 0) return 0; @@ -619,14 +627,18 @@ hivex_node_add_child (hive_h *h, hive_node_h parent, const char *name) struct ntreg_nk_record *nk = (struct ntreg_nk_record *) ((char *) h->addr + nkoffset); - nk->flags = htole16 (0x0020); /* key is ASCII. */ + if (use_utf16) + nk->flags = htole16 (0x0000); + else + nk->flags = htole16 (0x0020); nk->parent = htole32 (parent - 0x1000); nk->subkey_lf = htole32 (0xffffffff); nk->subkey_lf_volatile = htole32 (0xffffffff); nk->vallist = htol...
2013 Nov 24
4
[PATCH 1/3] lib: Further generalize iconv wrapper function.
--- lib/hivex-internal.h | 8 +++++--- lib/utf16.c | 11 +++++++---- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/lib/hivex-internal.h b/lib/hivex-internal.h index 4135f58..64fd49a 100644 --- a/lib/hivex-internal.h +++ b/lib/hivex-internal.h @@ -268,11 +268,13 @@ extern size_t * _hivex_return_offset_list (offset_list *list); extern void _hivex_print_offset_list
2013 Nov 24
0
[PATCH 3/3] lib: Add support for creating nodes (keys) and values with UTF-16LE-encoded names
...de_h nkoffset = allocate_block (h, seg_len, nk_id); if (nkoffset == 0) return 0; @@ -619,14 +627,18 @@ hivex_node_add_child (hive_h *h, hive_node_h parent, const char *name) struct ntreg_nk_record *nk = (struct ntreg_nk_record *) ((char *) h->addr + nkoffset); - nk->flags = htole16 (0x0020); /* key is ASCII. */ + if (use_utf16) + nk->flags = htole16 (0x0000); + else + nk->flags = htole16 (0x0020); nk->parent = htole32 (parent - 0x1000); nk->subkey_lf = htole32 (0xffffffff); nk->subkey_lf_volatile = htole32 (0xffffffff); nk->vallist = htol...
2013 Nov 25
0
Re: [PATCH 3/3] lib: Add support for creating nodes (keys) and values with UTF-16LE-encoded names
* Richard W.M. Jones: >> - nk->name_len = htole16 (strlen (name)); >> - strcpy (nk->name, name); >> + nk->name_len = htole16 (recoded_name_len); >> + memcpy (nk->name, recoded_name, recoded_name_len); >> + free(recoded_name); > > Please put spaces after function names! It improves readability: Sorry, I&...
2018 Oct 28
0
[PATCH nbdkit 4/4] Add floppy plugin.
...ring to copy. + */ + r = lfn->lfn_size - byte_offset; + if (r > 26) + memcpy (s, &lfn->lfn[byte_offset], 26); + else { + memcpy (s, &lfn->lfn[byte_offset], r); + /* Pad remaining filename with 0. */ + for (j = r/2; j < 13; ++j) + s[j] = htole16 (0); + } + + memset (&lfn_entry, 0, sizeof lfn_entry); + lfn_entry.seq = seq; + if (last_seq) { + lfn_entry.seq |= 0x40; + last_seq = 0; + } + lfn_entry.attributes = 0xf; + lfn_entry.checksum = checksum; + + /* Copy the name portion to the fields in the LFN ent...
2016 Feb 05
3
[PATCH] inspect: get windows drive letters for GPT disks.
...s */ + memcpy (&data1, guid_bytes, sizeof (data1)); + memcpy (&data2, guid_bytes + 4, sizeof (data2)); + memcpy (&data3, guid_bytes + 6, sizeof (data3)); + memcpy (&data4, guid_bytes + 8, sizeof (data4)); + + /* ensure proper endianness */ + data1 = htole32 (data1); + data2 = htole16 (data2); + data3 = htole16 (data3); + data4 = htobe64 (data4); + + snprintf (guid, len, + "%08" PRIX32 "-%04" PRIX16 "-%04" PRIX16 "-%04" PRIX64 "-%06" PRIX64, + data1, data2, data3, (data4 >> 48), (data4 << 16));...
2018 Oct 28
6
[PATCH nbdkit 0/4] Add floppy plugin.
Add nbdkit-floppy-plugin, “inspired” by qemu's VVFAT driver, but without the ability to handle writes. The implementation is pretty complete, supporting FAT32, LFNs, volume labels, timestamps, etc, and it passes both ‘make check’ and ‘make check-valgrind’. Usage is simple; to serve the current directory: $ nbdkit floppy . Then using guestfish (or any NBD client): $ guestfish --ro
2016 Feb 05
0
Re: [PATCH] inspect: get windows drive letters for GPT disks.
...+ 4, sizeof (data2)); > + memcpy (&data3, guid_bytes + 6, sizeof (data3)); > + memcpy (&data4, guid_bytes + 8, sizeof (data4)); > + > + /* ensure proper endianness */ > + data1 = htole32 (data1); Did you mean to use htole32? Surely it should be le32toh? > + data2 = htole16 (data2); > + data3 = htole16 (data3); > + data4 = htobe64 (data4); And is this really big endian? Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com libguestfs lets you edit virtu...
2016 Feb 05
1
Re: [PATCH] inspect: get windows drive letters for GPT disks.
...data3)); > > +  memcpy (&data4, guid_bytes + 8, sizeof (data4)); > > + > > +  /* ensure proper endianness */ > > +  data1 = htole32 (data1); > > Did you mean to use htole32?  Surely it should be le32toh? yep it seems I got it backwards. > > > +  data2 = htole16 (data2); > > +  data3  = htole16 (data3); > > +  data4 = htobe64 (data4); > > And is this really big endian? yes it is: https://en.wikipedia.org/wiki/Globally_unique_identifier#Binary_encodin g though it should have been be64toh. Please note that data1-3 are documented as nativ...
2010 Feb 05
13
[PATCH 01/14] hivexsh: Document some peculiarities of the "cd" command.
--- hivex/hivexsh.pod | 9 ++++++++- 1 files changed, 8 insertions(+), 1 deletions(-) diff --git a/hivex/hivexsh.pod b/hivex/hivexsh.pod index 277e3ae..9336798 100644 --- a/hivex/hivexsh.pod +++ b/hivex/hivexsh.pod @@ -100,7 +100,14 @@ or even: Path elements (node names) are matched case insensitively, and characters like space, C<*>, and C<?> have I<no> special
2019 Jul 03
6
[PATCH libnbd 0/2] Two patches to make libnbd work on FreeBSD.
Two simple patches which make libnbd compile on FreeBSD. Are we OK to copy common/include/byte-swapping.h from nbdkit? There is no license issue that I know of. Should we put it in lib/ or create a common/ directory? The header file is actually also needed by the tests (follow up patch for that) so putting it in common/ might make more sense. Some notes if you want to compile on FreeBSD: -
2013 Aug 08
1
[PATCH v2 7/7] Sample Implementation of Intel MIC User Space Daemon.
...cons_dev_page = { > + .dd = { > + .type = VIRTIO_ID_CONSOLE, > + .num_vq = ARRAY_SIZE(virtcons_dev_page.vqconfig), > + .feature_len = sizeof(virtcons_dev_page.host_features), > + .config_len = sizeof(virtcons_dev_page.cons_config), > + }, > + .vqconfig[0] = { > + .num = htole16(MIC_VRING_ENTRIES), > + }, > + .vqconfig[1] = { > + .num = htole16(MIC_VRING_ENTRIES), > + }, > +}; > + > +static struct { > + struct mic_device_desc dd; > + struct mic_vqconfig vqconfig[2]; > + __u32 host_features, guest_acknowledgements; > + struct virtio_net_con...
2013 Aug 08
1
[PATCH v2 7/7] Sample Implementation of Intel MIC User Space Daemon.
...cons_dev_page = { > + .dd = { > + .type = VIRTIO_ID_CONSOLE, > + .num_vq = ARRAY_SIZE(virtcons_dev_page.vqconfig), > + .feature_len = sizeof(virtcons_dev_page.host_features), > + .config_len = sizeof(virtcons_dev_page.cons_config), > + }, > + .vqconfig[0] = { > + .num = htole16(MIC_VRING_ENTRIES), > + }, > + .vqconfig[1] = { > + .num = htole16(MIC_VRING_ENTRIES), > + }, > +}; > + > +static struct { > + struct mic_device_desc dd; > + struct mic_vqconfig vqconfig[2]; > + __u32 host_features, guest_acknowledgements; > + struct virtio_net_con...
2013 Aug 08
0
[PATCH v2 7/7] Sample Implementation of Intel MIC User Space Daemon.
...rtio_console_config cons_config; +} virtcons_dev_page = { + .dd = { + .type = VIRTIO_ID_CONSOLE, + .num_vq = ARRAY_SIZE(virtcons_dev_page.vqconfig), + .feature_len = sizeof(virtcons_dev_page.host_features), + .config_len = sizeof(virtcons_dev_page.cons_config), + }, + .vqconfig[0] = { + .num = htole16(MIC_VRING_ENTRIES), + }, + .vqconfig[1] = { + .num = htole16(MIC_VRING_ENTRIES), + }, +}; + +static struct { + struct mic_device_desc dd; + struct mic_vqconfig vqconfig[2]; + __u32 host_features, guest_acknowledgements; + struct virtio_net_config net_config; +} virtnet_dev_page = { + .dd = { + .t...
2018 Aug 12
13
[PATCH nbdkit 00/10] FreeBSD support.
With these patches, a majority of tests pass. The notable things which are still broken: - Because FreeBSD links /home -> /usr/home, $(pwd) gives a different result from realpath(2). Therefore some tests which implicitly rely on (eg) a plugin which calls nbdkit_realpath internally and then checking that path against $(pwd) fail. - Shebangs (#!) don't seem to work the same way
2013 Jul 25
19
[PATCH hivex 00/19] Fix read/write handling of li-records.
This is, hopefully, a full fix for handling of li-records. See: https://bugzilla.redhat.com/show_bug.cgi?id=717583 https://bugzilla.redhat.com/show_bug.cgi?id=987463 Rich.
2018 Jan 02
0
Wine release 2.0.4
...interpreted as an escape code (0x1b). Fabian Maurer (5): shell32: Draw text on message boxes without background. gdiplus: Avoid division by zero in SOFTWARE_GdipDrawThinPath. wineboot: In ProcessRunKeys use correct parentheses in condition. ole32: Don't redefine htole32/htole16. winecfg: Remove processorArchitecture from manifest. Gijs Vermeulen (1): msvcrt: Add _vfprintf_l. Henri Verbeet (1): wordpad: Fall back to the default position if the saved position is off-screen. Hugh Bellamy (1): gdiplus: Define GpHatchStyle. Huw D. M. Davies (6):...
2017 Oct 13
0
Wine release 2.19
...ineandroid.drv: In AudioClient_IsFormatSupported remove unneeded statement (cppcheck). crypt32: In CRYPT_CollectionAdvanceEnum remove unneeded statement (cppcheck). riched20: In ME_ProtectPartialTableDeletion properly set out parameter (cppcheck). ole32: Don't redefine htole32/htole16. Gijs Vermeulen (2): msvcrt: Introduce vfprint & vfwprintf helper functions. msvcrt: Add vf[w]printf_s_l. Hans Leidekker (10): webservices: Simplify get_field_size. webservices: Set event handles to NULL on error. webservices: Fix return value in read_type_text....
2011 Apr 13
1
[PATCH hivex] maint: split long lines
...e_add_child: allocated new nk-record for child at 0x%zx\n", node); + fprintf (stderr, "hivex_node_add_child: allocated new nk-record" + " for child at 0x%zx\n", node); struct ntreg_nk_record *nk = (struct ntreg_nk_record *) (h->addr + node); nk->flags = htole16 (0x0020); /* key is ASCII. */ @@ -2216,7 +2255,8 @@ hivex_node_add_child (hive_h *h, hive_node_h parent, const char *name) if (!IS_VALID_BLOCK (h, parent_sk_offset) || !BLOCK_ID_EQ (h, parent_sk_offset, "sk")) { if (h->msglvl >= 2) - fprintf (stderr, "hivex_...