From 94b7f5208ecea9895114265b525bcb1bffe6b497 Mon Sep 17 00:00:00 2001 From: midipix Date: Sat, 15 Oct 2022 17:18:13 +0000 Subject: __ntapi_tt_port_prefix_from_type(): initial implementation and integration. --- src/port/ntapi_port_name_helper.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'src/port') diff --git a/src/port/ntapi_port_name_helper.c b/src/port/ntapi_port_name_helper.c index e28df8c..fe6a684 100644 --- a/src/port/ntapi_port_name_helper.c +++ b/src/port/ntapi_port_name_helper.c @@ -87,6 +87,29 @@ int32_t __stdcall __ntapi_tt_port_type_from_guid( } +int32_t __stdcall __ntapi_tt_port_prefix_from_type( + __out wchar16_t (*prefix)[6], + __in nt_port_type type, + __in nt_port_subtype subtype) +{ + const wchar16_t * svc_prefix; + + if ((type >= NT_PORT_TYPE_CAP) || (subtype >= NT_PORT_SUBTYPE_CAP)) + return NT_STATUS_INVALID_PARAMETER; + + svc_prefix = __port_service_prefixes[type][subtype]; + + prefix[0][0] = svc_prefix[0]; + prefix[0][1] = svc_prefix[1]; + prefix[0][2] = svc_prefix[2]; + prefix[0][3] = svc_prefix[3]; + prefix[0][4] = svc_prefix[4]; + prefix[0][5] = svc_prefix[5]; + + return NT_STATUS_SUCCESS; +} + + int32_t __stdcall __ntapi_tt_port_generate_keys( __out nt_port_keys * keys) { -- cgit v1.2.3