summaryrefslogtreecommitdiffhomepage
path: root/src/internal
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2016-06-24 01:24:48 -0400
committermidipix <writeonce@midipix.org>2016-06-24 03:31:28 -0400
commita3e9aaed1633e5ca5426758719486e001931eddd (patch)
tree95905b48be7b375d94cca16183f1c577f8222b99 /src/internal
parent80cfca4d52e3202074cfa0147118c9bdd371d535 (diff)
downloadntapi-a3e9aaed1633e5ca5426758719486e001931eddd.tar.bz2
ntapi-a3e9aaed1633e5ca5426758719486e001931eddd.tar.xz
internals: added handle to the process's primary token.
Diffstat (limited to 'src/internal')
-rw-r--r--src/internal/ntapi.c7
-rw-r--r--src/internal/ntapi_impl.h1
2 files changed, 8 insertions, 0 deletions
diff --git a/src/internal/ntapi.c b/src/internal/ntapi.c
index 07f0da7..0749a97 100644
--- a/src/internal/ntapi.c
+++ b/src/internal/ntapi.c
@@ -387,6 +387,13 @@ static int32_t __fastcall __ntapi_init_once(ntapi_vtbl ** pvtbl)
(uintptr_t *)&___ntapi,
sizeof(ntapi_vtbl));
+ /* process token */
+ if ((status = __ntapi->zw_open_process_token(
+ NT_CURRENT_PROCESS_HANDLE,
+ NT_TOKEN_ALL_ACCESS,
+ &internals->htoken)))
+ return status;
+
/* done */
*pvtbl = &___ntapi_shadow;
at_locked_inc(&__ntapi_init_idx);
diff --git a/src/internal/ntapi_impl.h b/src/internal/ntapi_impl.h
index c19648e..9376d24 100644
--- a/src/internal/ntapi_impl.h
+++ b/src/internal/ntapi_impl.h
@@ -72,6 +72,7 @@ typedef struct ___ntapi_img_sec_bss {
typedef struct __attr_ptr_size_aligned__ _ntapi_internals {
nt_runtime_data * rtdata;
nt_port_name * subsystem;
+ void * htoken;
void * hport_tty_session;
void * hport_tty_daemon;
void * hport_tty_debug;