Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- commit 02fbf482264b98710f4e2c20fc00d2fa80493dea
- Author: Lucio Andrés Illanes Albornoz (arab, vxp) <l.illanes@gmx.de>
- Date: Fri Sep 11 23:33:15 2015 +0200
- Add support for UNC paths to __ntapi_tt_statfs(). At present, neither the
- drive letter nor the volume GUID fields are filled in for UNC paths; the
- former can still be taken care of.
- diff --git a/include/ntapi/nt_mount.h b/include/ntapi/nt_mount.h
- index 8a7258a..cf2deac 100644
- --- a/include/ntapi/nt_mount.h
- +++ b/include/ntapi/nt_mount.h
- @@ -10,6 +10,10 @@
- #define __DEVICE_PATH_PREFIX_LEN (8 * sizeof(wchar16_t))
- #define __DEVICE_PATH_PREFIX_HASH (0xDA6FA40B)
- +/* {'\\','D','e','v','i','c','e','\\',M','u','p','\\'} */
- +#define __DEVICE_MUP_PATH_PREFIX_LEN (12 * sizeof(wchar16_t))
- +#define __DEVICE_MUP_PATH_PREFIX_HASH (0x0CEBB5F6)
- +
- /* {'\\','?','?','\\','V','o','l','u','m','e','{'} */
- #define __VOLUME_PATH_PREFIX_LEN (11 * sizeof(wchar16_t))
- #define __VOLUME_PATH_PREFIX_HASH (0xFEBA8529)
- diff --git a/src/fs/ntapi_tt_statfs.c b/src/fs/ntapi_tt_statfs.c
- index 114cc8e..8bc43e2 100644
- --- a/src/fs/ntapi_tt_statfs.c
- +++ b/src/fs/ntapi_tt_statfs.c
- @@ -23,7 +23,7 @@ int32_t __stdcall __ntapi_tt_statfs(
- nt_oa oa;
- nt_iosb iosb;
- nt_unicode_string * sdev;
- - uint32_t hash;
- + uint32_t hash,hash_mup;
- wchar16_t * wch;
- wchar16_t * wch_mark;
- uint32_t offset;
- @@ -156,6 +156,14 @@ int32_t __stdcall __ntapi_tt_statfs(
- if (hash != __DEVICE_PATH_PREFIX_HASH)
- return NT_STATUS_INVALID_HANDLE;
- + hash_mup = __ntapi->tt_buffer_crc32(
- + 0,
- + sdev->buffer,
- + __DEVICE_MUP_PATH_PREFIX_LEN);
- +
- + if (hash_mup == __DEVICE_MUP_PATH_PREFIX_HASH)
- + sdev->buffer[__DEVICE_MUP_PATH_PREFIX_LEN - 1] = 0;
- +
- wch_mark = sdev->buffer + __DEVICE_PATH_PREFIX_LEN/sizeof(wchar16_t);
- wch = wch_mark;
- while (*wch != '\\') wch++;
- @@ -190,6 +198,9 @@ int32_t __stdcall __ntapi_tt_statfs(
- statfs->nt_control_flags = 0;
- statfs->nt_padding = 0;
- + if (hash_mup == __DEVICE_MUP_PATH_PREFIX_HASH)
- + return NT_STATUS_SUCCESS;
- +
- if (!(flags & NT_STATFS_VOLUME_GUID)) {
- statfs->nt_drive_letter = 0;
- pguid = (uint64_t *)&(statfs->nt_volume_guid);
- commit 76490da01288d1dbd27429b9a0b3eb7770a3850f
- Author: Lucio Andrés Illanes Albornoz (arab, vxp) <l.illanes@gmx.de>
- Date: Sun Sep 6 22:07:23 2015 +0200
- Stacks need to be quadworded aligned in 64-bit mode according to the
- amd64 calling convention. This fixes NT_STATUS_DATATYPE_MISALIGNMENT
- return codes from __ntapi_tt_create_thread ().
- diff --git a/src/thread/ntapi_tt_create_thread.c b/src/thread/ntapi_tt_create_thread.c
- index 4fbe68f..65cf252 100644
- --- a/src/thread/ntapi_tt_create_thread.c
- +++ b/src/thread/ntapi_tt_create_thread.c
- @@ -48,7 +48,7 @@ int32_t __stdcall __ntapi_tt_create_thread(
- void * stack_system_limit;
- uint32_t protect_type_old;
- - nt_user_stack stack;
- + nt_user_stack __attr_aligned__(16) stack;
- nt_thread_context context;
- uintptr_t fsuspended;
- uintptr_t * parg;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement