summaryrefslogtreecommitdiffhomepage
path: root/src/guid/ntapi_tt_guid.c
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2017-07-30 21:21:21 +0000
committermidipix <writeonce@midipix.org>2017-07-31 08:43:34 -0400
commitce6accbc18a68c77e06f43834069565a746a4e78 (patch)
tree4e064f8e228824033289d041e1adbff527f3ab84 /src/guid/ntapi_tt_guid.c
parent6c28503ec354c5ff192ed1492761a77178bc7bee (diff)
downloadntapi-ce6accbc18a68c77e06f43834069565a746a4e78.tar.bz2
ntapi-ce6accbc18a68c77e06f43834069565a746a4e78.tar.xz
__ntapi_tt_string_to_guid_utf16(): support outer dashes and outer underscores.
Diffstat (limited to 'src/guid/ntapi_tt_guid.c')
-rw-r--r--src/guid/ntapi_tt_guid.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/src/guid/ntapi_tt_guid.c b/src/guid/ntapi_tt_guid.c
index 52eb5af..69a5926 100644
--- a/src/guid/ntapi_tt_guid.c
+++ b/src/guid/ntapi_tt_guid.c
@@ -107,13 +107,25 @@ int32_t __fastcall __ntapi_tt_string_to_guid_utf16(
wchar16_t * wch;
uint16_t key;
- if ((guid_str->lbrace != '{')
- || (guid_str->rbrace != '}')
- || (guid_str->dash1 != '-')
+ /* outer braces / outer underscores / outer dashes */
+ if ((guid_str->lbrace == '{') && (guid_str->rbrace == '}'))
+ (void)0;
+
+ else if ((guid_str->lbrace == '_') && (guid_str->rbrace == '_'))
+ (void)0;
+
+ else if ((guid_str->lbrace == '-') && (guid_str->rbrace == '-'))
+ (void)0;
+
+ else
+ return NT_STATUS_INVALID_PARAMETER;
+
+ /* inner dashes */
+ if ((guid_str->dash1 != '-')
|| (guid_str->dash2 != '-')
|| (guid_str->dash3 != '-')
|| (guid_str->dash4 != '-'))
- return NT_STATUS_INVALID_PARAMETER;
+ return NT_STATUS_INVALID_PARAMETER;
wch = &(guid_str->group5[0]);