summaryrefslogtreecommitdiffhomepage
path: root/src/object/ntapi_tt_keyed_object_directory.c
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2018-05-02 22:28:04 +0000
committermidipix <writeonce@midipix.org>2018-05-07 01:24:16 -0400
commit6729c897b1b601679f019acfc3765b6a05ccacfd (patch)
treeddc716acb1d84873f2a3ec868f13db036b160557 /src/object/ntapi_tt_keyed_object_directory.c
parent32ec331902bc3f278c10257a129f2620ae7d30b0 (diff)
downloadntapi-6729c897b1b601679f019acfc3765b6a05ccacfd.tar.bz2
ntapi-6729c897b1b601679f019acfc3765b6a05ccacfd.tar.xz
object directory interfaces: integrated device- and node-related interfaces.
Diffstat (limited to 'src/object/ntapi_tt_keyed_object_directory.c')
-rw-r--r--src/object/ntapi_tt_keyed_object_directory.c60
1 files changed, 60 insertions, 0 deletions
diff --git a/src/object/ntapi_tt_keyed_object_directory.c b/src/object/ntapi_tt_keyed_object_directory.c
index b79f3b6..77a6aff 100644
--- a/src/object/ntapi_tt_keyed_object_directory.c
+++ b/src/object/ntapi_tt_keyed_object_directory.c
@@ -278,6 +278,66 @@ int32_t __stdcall __ntapi_tt_create_ipc_object_directory_entry(
hdir,htarget,target_name,key);
}
+int32_t __stdcall __ntapi_tt_open_dev_object_directory(
+ __out void ** hdir,
+ __in uint32_t desired_access,
+ __in const wchar16_t prefix[6],
+ __in const nt_guid * ipc_guid)
+{
+ return __tt_create_ipc_object_directory(
+ hdir,desired_access,
+ prefix,ipc_guid);
+}
+
+int32_t __stdcall __ntapi_tt_create_dev_object_directory_entry(
+ __out void ** hentry,
+ __in uint32_t desired_access,
+ __in void * hdir,
+ __in void * htarget,
+ __in nt_unicode_string * target_name,
+ __in const nt_guid * dev_guid)
+{
+ int32_t status;
+ nt_oa oa;
+ nt_unicode_string name;
+ nt_sd_common_buffer sd;
+ nt_guid_str_utf16 guidstr;
+ uintptr_t buffer[2048/sizeof(uintptr_t)];
+ nt_sqos sqos = {
+ sizeof(sqos),
+ NT_SECURITY_IMPERSONATION,
+ NT_SECURITY_TRACKING_DYNAMIC,
+ 1};
+
+ if (!target_name) {
+ if ((status = __ntapi->zw_query_object(
+ htarget,
+ NT_OBJECT_NAME_INFORMATION,
+ buffer,sizeof(buffer),0)))
+ return status;
+ target_name = (nt_unicode_string *)buffer;
+ }
+
+ __ipc_sd_init(&sd,0);
+ __ntapi->tt_guid_to_string_utf16(dev_guid,&guidstr);
+
+ name.strlen = sizeof(guidstr);
+ name.maxlen = 0;
+ name.buffer = &guidstr.lbrace;
+
+ oa.len = sizeof(oa);
+ oa.root_dir = hdir;
+ oa.obj_name = &name;
+ oa.obj_attr = 0;
+ oa.sec_desc = &sd.sd;
+ oa.sec_qos = &sqos;
+
+ return __ntapi->zw_create_symbolic_link_object(
+ hentry,
+ desired_access,
+ &oa,target_name);
+}
+
int32_t __stdcall __ntapi_tt_create_keyed_object_directory(
__out void ** hdir,
__in uint32_t desired_access,