summaryrefslogtreecommitdiffhomepage
path: root/src/section
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2015-07-27 04:01:18 -0400
committermidipix <writeonce@midipix.org>2015-07-27 04:01:18 -0400
commitdd89bb8ad4fe184a34b5dbdda237e640fc82121b (patch)
tree5e80d2da35f5892f92be29f57982b2708e6bd99b /src/section
parentdcdadc2702712fa750ed255ed1dfa354522797a0 (diff)
downloadntapi-dd89bb8ad4fe184a34b5dbdda237e640fc82121b.tar.bz2
ntapi-dd89bb8ad4fe184a34b5dbdda237e640fc82121b.tar.xz
entered advanced internal development stage.
Diffstat (limited to 'src/section')
-rw-r--r--src/section/ntapi_tt_get_section_name.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/section/ntapi_tt_get_section_name.c b/src/section/ntapi_tt_get_section_name.c
new file mode 100644
index 0000000..744bfe7
--- /dev/null
+++ b/src/section/ntapi_tt_get_section_name.c
@@ -0,0 +1,32 @@
+/********************************************************/
+/* ntapi: Native API core library */
+/* Copyright (C) 2013,2014,2015 Z. Gilboa */
+/* Released under GPLv2 and GPLv3; see COPYING.NTAPI. */
+/********************************************************/
+
+#include <psxtypes/psxtypes.h>
+#include <ntapi/nt_memory.h>
+#include <ntapi/nt_section.h>
+#include <ntapi/ntapi.h>
+#include "ntapi_impl.h"
+
+int32_t __stdcall __ntapi_tt_get_section_name(
+ __in void * addr,
+ __out nt_mem_sec_name * buffer,
+ __in uint32_t buffer_size)
+{
+ size_t len;
+
+ /* init buffer */
+ buffer->section_name.strlen = 0;
+ buffer->section_name.maxlen = (uint16_t)(buffer_size - sizeof(nt_unicode_string));
+ buffer->section_name.buffer = buffer->section_name_buffer;
+
+ return __ntapi->zw_query_virtual_memory(
+ NT_CURRENT_PROCESS_HANDLE,
+ addr,
+ NT_MEMORY_SECTION_NAME,
+ buffer,
+ buffer_size,
+ &len);
+}