summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/fs/ntapi_tt_open_physical_parent_directory.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/fs/ntapi_tt_open_physical_parent_directory.c b/src/fs/ntapi_tt_open_physical_parent_directory.c
index 77ae61d..3476113 100644
--- a/src/fs/ntapi_tt_open_physical_parent_directory.c
+++ b/src/fs/ntapi_tt_open_physical_parent_directory.c
@@ -11,7 +11,7 @@
int32_t __stdcall __ntapi_tt_open_physical_parent_directory(
__out void ** hparent,
__in void * hdir,
- __out uintptr_t * buffer,
+ __out void * buffer,
__in uint32_t buffer_size,
__in uint32_t oattr,
__in uint32_t desired_access,
@@ -27,10 +27,20 @@ int32_t __stdcall __ntapi_tt_open_physical_parent_directory(
nt_unicode_string * path;
uint32_t len;
int mup;
+ uintptr_t addr;
+ uintptr_t addr_cap;
(void)reserved;
- path = (nt_unicode_string *)buffer;
+ addr = (uintptr_t)buffer;
+ addr_cap = addr + buffer_size;
+
+ addr += 0xf;
+ addr |= 0xf;
+ addr ^= 0xf;
+
+ path = (nt_unicode_string *)addr;
+ buffer_size = addr_cap - addr;
if ((status = __ntapi->zw_query_object(
hdir,