summaryrefslogtreecommitdiffhomepage
path: root/src/internal/ntapi.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/internal/ntapi.c')
-rw-r--r--src/internal/ntapi.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/internal/ntapi.c b/src/internal/ntapi.c
index 2b4a525..88f3f14 100644
--- a/src/internal/ntapi.c
+++ b/src/internal/ntapi.c
@@ -93,6 +93,7 @@ static int32_t __fastcall __ntapi_init_once(ntapi_vtbl ** pvtbl)
int32_t status;
void * hntdll;
size_t block_size;
+ size_t buf[64];
nt_oa oa;
nt_cid cid;
ntapi_zw_allocate_virtual_memory * pfn_zw_allocate_virtual_memory;
@@ -477,6 +478,20 @@ static int32_t __fastcall __ntapi_init_once(ntapi_vtbl ** pvtbl)
internals->htoken,
NT_SE_CREATE_SYMBOLIC_LINK_PRIVILEGE);
+ /* sid */
+ if ((status = __ntapi->zw_query_information_token(
+ internals->htoken,
+ NT_TOKEN_USER,
+ buf,sizeof(buf),
+ &block_size)))
+ return status;
+
+ internals->sid = (nt_sid *)&internals->sid_buffer;
+
+ __ntapi->tt_sid_copy(
+ internals->sid,
+ ((nt_sid_and_attributes *)buf)->sid);
+
/* done */
*pvtbl = &___ntapi_shadow;
at_locked_inc(&__ntapi_init_idx);