summaryrefslogtreecommitdiffhomepage
path: root/src/guid
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2020-06-06 13:35:45 +0000
committermidipix <writeonce@midipix.org>2020-06-06 23:04:19 +0000
commit5d7f04b12d74098966e9cf47e9ded29ec8b74ceb (patch)
tree52b5b11b72a3e99b200986626271c3ad7d961d6c /src/guid
parenta820b0a304cf5b8c74fb4760249174db2af79bf0 (diff)
downloadntapi-5d7f04b12d74098966e9cf47e9ded29ec8b74ceb.tar.bz2
ntapi-5d7f04b12d74098966e9cf47e9ded29ec8b74ceb.tar.xz
__ntapi_tt_string_to_guid_utf8(): initial implementation and integration.
Diffstat (limited to 'src/guid')
-rw-r--r--src/guid/ntapi_tt_guid.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/guid/ntapi_tt_guid.c b/src/guid/ntapi_tt_guid.c
index 6f520fe..00628c3 100644
--- a/src/guid/ntapi_tt_guid.c
+++ b/src/guid/ntapi_tt_guid.c
@@ -192,3 +192,25 @@ int32_t __fastcall __ntapi_tt_string_to_guid_utf16(
return NT_STATUS_SUCCESS;
}
+
+int32_t __fastcall __ntapi_tt_string_to_guid_utf8(
+ __in const char * guid_str,
+ __out nt_guid * guid)
+{
+ const char * ch;
+ const char * cap;
+ wchar16_t * wch;
+ nt_guid_str_utf16 guid_str_utf16;
+
+ ch = guid_str;
+ cap = &ch[sizeof(guid_str_utf16) / sizeof(wchar16_t)];
+ wch = &guid_str_utf16.lbrace;
+
+ for (; *ch && (ch<cap); )
+ *wch++ = *ch++;
+
+ return (ch < cap)
+ ? NT_STATUS_INVALID_PARAMETER
+ : __ntapi_tt_string_to_guid_utf16(
+ &guid_str_utf16,guid);
+}