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]);