diff options
author | midipix <writeonce@midipix.org> | 2019-06-10 11:52:26 +0000 |
---|---|---|
committer | midipix <writeonce@midipix.org> | 2019-06-10 11:52:26 +0000 |
commit | baceb0cc712831f7962521ebe22fa2b714184911 (patch) | |
tree | 4308ff05306245df018f5070d2a4b0267a06b50f /src | |
parent | e40843a6eca9c47b2f0ca008c42782e096722aa9 (diff) | |
download | ntapi-baceb0cc712831f7962521ebe22fa2b714184911.tar.bz2 ntapi-baceb0cc712831f7962521ebe22fa2b714184911.tar.xz |
ntapi_tt_open_physical_parent_directory(): remove buffer alignment requirement.
Diffstat (limited to 'src')
-rw-r--r-- | src/fs/ntapi_tt_open_physical_parent_directory.c | 14 |
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, |