Advertisement
Guest User

Untitled

a guest
Sep 18th, 2015
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.90 KB | None | 0 0
  1. commit 02fbf482264b98710f4e2c20fc00d2fa80493dea
  2. Author: Lucio Andrés Illanes Albornoz (arab, vxp) <l.illanes@gmx.de>
  3. Date: Fri Sep 11 23:33:15 2015 +0200
  4.  
  5. Add support for UNC paths to __ntapi_tt_statfs(). At present, neither the
  6. drive letter nor the volume GUID fields are filled in for UNC paths; the
  7. former can still be taken care of.
  8.  
  9. diff --git a/include/ntapi/nt_mount.h b/include/ntapi/nt_mount.h
  10. index 8a7258a..cf2deac 100644
  11. --- a/include/ntapi/nt_mount.h
  12. +++ b/include/ntapi/nt_mount.h
  13. @@ -10,6 +10,10 @@
  14. #define __DEVICE_PATH_PREFIX_LEN (8 * sizeof(wchar16_t))
  15. #define __DEVICE_PATH_PREFIX_HASH (0xDA6FA40B)
  16.  
  17. +/* {'\\','D','e','v','i','c','e','\\',M','u','p','\\'} */
  18. +#define __DEVICE_MUP_PATH_PREFIX_LEN (12 * sizeof(wchar16_t))
  19. +#define __DEVICE_MUP_PATH_PREFIX_HASH (0x0CEBB5F6)
  20. +
  21. /* {'\\','?','?','\\','V','o','l','u','m','e','{'} */
  22. #define __VOLUME_PATH_PREFIX_LEN (11 * sizeof(wchar16_t))
  23. #define __VOLUME_PATH_PREFIX_HASH (0xFEBA8529)
  24. diff --git a/src/fs/ntapi_tt_statfs.c b/src/fs/ntapi_tt_statfs.c
  25. index 114cc8e..8bc43e2 100644
  26. --- a/src/fs/ntapi_tt_statfs.c
  27. +++ b/src/fs/ntapi_tt_statfs.c
  28. @@ -23,7 +23,7 @@ int32_t __stdcall __ntapi_tt_statfs(
  29. nt_oa oa;
  30. nt_iosb iosb;
  31. nt_unicode_string * sdev;
  32. - uint32_t hash;
  33. + uint32_t hash,hash_mup;
  34. wchar16_t * wch;
  35. wchar16_t * wch_mark;
  36. uint32_t offset;
  37. @@ -156,6 +156,14 @@ int32_t __stdcall __ntapi_tt_statfs(
  38. if (hash != __DEVICE_PATH_PREFIX_HASH)
  39. return NT_STATUS_INVALID_HANDLE;
  40.  
  41. + hash_mup = __ntapi->tt_buffer_crc32(
  42. + 0,
  43. + sdev->buffer,
  44. + __DEVICE_MUP_PATH_PREFIX_LEN);
  45. +
  46. + if (hash_mup == __DEVICE_MUP_PATH_PREFIX_HASH)
  47. + sdev->buffer[__DEVICE_MUP_PATH_PREFIX_LEN - 1] = 0;
  48. +
  49. wch_mark = sdev->buffer + __DEVICE_PATH_PREFIX_LEN/sizeof(wchar16_t);
  50. wch = wch_mark;
  51. while (*wch != '\\') wch++;
  52. @@ -190,6 +198,9 @@ int32_t __stdcall __ntapi_tt_statfs(
  53. statfs->nt_control_flags = 0;
  54. statfs->nt_padding = 0;
  55.  
  56. + if (hash_mup == __DEVICE_MUP_PATH_PREFIX_HASH)
  57. + return NT_STATUS_SUCCESS;
  58. +
  59. if (!(flags & NT_STATFS_VOLUME_GUID)) {
  60. statfs->nt_drive_letter = 0;
  61. pguid = (uint64_t *)&(statfs->nt_volume_guid);
  62.  
  63. commit 76490da01288d1dbd27429b9a0b3eb7770a3850f
  64. Author: Lucio Andrés Illanes Albornoz (arab, vxp) <l.illanes@gmx.de>
  65. Date: Sun Sep 6 22:07:23 2015 +0200
  66.  
  67. Stacks need to be quadworded aligned in 64-bit mode according to the
  68. amd64 calling convention. This fixes NT_STATUS_DATATYPE_MISALIGNMENT
  69. return codes from __ntapi_tt_create_thread ().
  70.  
  71. diff --git a/src/thread/ntapi_tt_create_thread.c b/src/thread/ntapi_tt_create_thread.c
  72. index 4fbe68f..65cf252 100644
  73. --- a/src/thread/ntapi_tt_create_thread.c
  74. +++ b/src/thread/ntapi_tt_create_thread.c
  75. @@ -48,7 +48,7 @@ int32_t __stdcall __ntapi_tt_create_thread(
  76. void * stack_system_limit;
  77. uint32_t protect_type_old;
  78.  
  79. - nt_user_stack stack;
  80. + nt_user_stack __attr_aligned__(16) stack;
  81. nt_thread_context context;
  82. uintptr_t fsuspended;
  83. uintptr_t * parg;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement