From e7235fb6a483c1a4f4201b578957e1f62cd6efb7 Mon Sep 17 00:00:00 2001 From: midipix Date: Mon, 19 Mar 2018 02:56:54 +0000 Subject: sid helper interfaces: added ntapi_tt_sid_copy(). --- include/ntapi/nt_object.h | 5 +++++ include/ntapi/ntapi.h | 1 + project/common.mk | 1 + src/internal/ntapi.c | 1 + src/internal/ntapi_fnapi.h | 1 + src/object/ntapi_tt_sid.c | 23 +++++++++++++++++++++++ 6 files changed, 32 insertions(+) create mode 100644 src/object/ntapi_tt_sid.c diff --git a/include/ntapi/nt_object.h b/include/ntapi/nt_object.h index 0618c37..b76b43b 100644 --- a/include/ntapi/nt_object.h +++ b/include/ntapi/nt_object.h @@ -564,4 +564,9 @@ typedef int32_t __stdcall ntapi_tt_create_keyed_object_directory_entry( __in nt_unicode_string * target_name, __in uint32_t key); +typedef void __stdcall ntapi_tt_sid_copy( + __out nt_sid * dst, + __in const nt_sid * src); + + #endif diff --git a/include/ntapi/ntapi.h b/include/ntapi/ntapi.h index d1b50be..4b695d9 100644 --- a/include/ntapi/ntapi.h +++ b/include/ntapi/ntapi.h @@ -372,6 +372,7 @@ typedef struct _ntapi_vtbl { ntapi_tt_create_keyed_object_directory * tt_create_keyed_object_directory; ntapi_tt_open_keyed_object_directory * tt_open_keyed_object_directory; ntapi_tt_create_keyed_object_directory_entry * tt_create_keyed_object_directory_entry; + ntapi_tt_sid_copy * tt_sid_copy; /* nt_crc32.h */ ntapi_tt_buffer_crc32 * tt_buffer_crc32; diff --git a/project/common.mk b/project/common.mk index 405f999..5f9f4fd 100644 --- a/project/common.mk +++ b/project/common.mk @@ -38,6 +38,7 @@ COMMON_SRCS = \ src/msq/ntapi_msq_send.c \ src/msq/ntapi_msq_set.c \ src/object/ntapi_tt_keyed_object_directory.c \ + src/object/ntapi_tt_sid.c \ src/port/ntapi_port_name_helper.c \ src/process/ntapi_tt_create_native_process_v1.c \ src/process/ntapi_tt_create_native_process_v2.c \ diff --git a/src/internal/ntapi.c b/src/internal/ntapi.c index 1b06bcc..2b4a525 100644 --- a/src/internal/ntapi.c +++ b/src/internal/ntapi.c @@ -165,6 +165,7 @@ static int32_t __fastcall __ntapi_init_once(ntapi_vtbl ** pvtbl) __ntapi->tt_create_keyed_object_directory = __ntapi_tt_create_keyed_object_directory; __ntapi->tt_open_keyed_object_directory = __ntapi_tt_open_keyed_object_directory; __ntapi->tt_create_keyed_object_directory_entry = __ntapi_tt_create_keyed_object_directory_entry; + __ntapi->tt_sid_copy = __ntapi_tt_sid_copy; /* nt_crc32.h */ __ntapi->tt_buffer_crc32 = __ntapi_tt_buffer_crc32; diff --git a/src/internal/ntapi_fnapi.h b/src/internal/ntapi_fnapi.h index beb4fbb..901ecd6 100644 --- a/src/internal/ntapi_fnapi.h +++ b/src/internal/ntapi_fnapi.h @@ -28,6 +28,7 @@ ntapi_tt_create_ipc_object_directory_entry __ntapi_tt_create_ipc_object_director ntapi_tt_create_keyed_object_directory __ntapi_tt_create_keyed_object_directory; ntapi_tt_open_keyed_object_directory __ntapi_tt_open_keyed_object_directory; ntapi_tt_create_keyed_object_directory_entry __ntapi_tt_create_keyed_object_directory_entry; +ntapi_tt_sid_copy __ntapi_tt_sid_copy; /* nt_crc32.h */ ntapi_tt_buffer_crc32 __ntapi_tt_buffer_crc32; diff --git a/src/object/ntapi_tt_sid.c b/src/object/ntapi_tt_sid.c new file mode 100644 index 0000000..d93775c --- /dev/null +++ b/src/object/ntapi_tt_sid.c @@ -0,0 +1,23 @@ +/********************************************************/ +/* ntapi: Native API core library */ +/* Copyright (C) 2013--2017 Z. Gilboa */ +/* Released under GPLv2 and GPLv3; see COPYING.NTAPI. */ +/********************************************************/ + +#include +#include +#include "ntapi_impl.h" + +void __stdcall __ntapi_tt_sid_copy( + __out nt_sid * dst, + __in const nt_sid * src) +{ + int i; + + dst->revision = src->revision; + dst->sub_authority_count = src->sub_authority_count; + dst->identifier_authority = src->identifier_authority; + + for (i=0; isub_authority_count; i++) + dst->sub_authority[i] = src->sub_authority[i]; +} -- cgit v1.2.3