summaryrefslogtreecommitdiffhomepage
path: root/src/port
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2016-08-21 14:17:08 -0400
committermidipix <writeonce@midipix.org>2016-08-22 08:59:57 -0400
commitcb3f2e4c5e529e3f0fcacb542d3f17fd2830903e (patch)
tree9a2970eedf862651ffb22f116707b22d6bd83519 /src/port
parent95cd480a8ab49f82a28c4675ed90bcb5d6521be8 (diff)
downloadntapi-cb3f2e4c5e529e3f0fcacb542d3f17fd2830903e.tar.bz2
ntapi-cb3f2e4c5e529e3f0fcacb542d3f17fd2830903e.tar.xz
__ntapi_tt_port_type_from_guid(): reimplement using __ntapi_tt_guid_compare().
Diffstat (limited to 'src/port')
-rw-r--r--src/port/ntapi_port_name_helper.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/src/port/ntapi_port_name_helper.c b/src/port/ntapi_port_name_helper.c
index bd55f5b..369cbd4 100644
--- a/src/port/ntapi_port_name_helper.c
+++ b/src/port/ntapi_port_name_helper.c
@@ -57,18 +57,12 @@ int32_t __stdcall __ntapi_tt_port_type_from_guid(
{
int itype;
int isubtype;
- const nt_guid * src_guid;
- uint32_t guid_hash;
- uint32_t src_hash;
-
- guid_hash = __ntapi->tt_buffer_crc32(0,guid,sizeof(nt_guid));
for (itype=0; itype<NT_PORT_TYPE_CAP; itype++) {
for (isubtype=0; isubtype<NT_PORT_SUBTYPE_CAP; isubtype++) {
- src_guid = &(__port_guids[itype][isubtype]);
- src_hash = __ntapi->tt_buffer_crc32(0,src_guid,sizeof(nt_guid));
-
- if (guid_hash == src_hash) {
+ if (!(__ntapi_tt_guid_compare(
+ &__port_guids[itype][isubtype],
+ guid))) {
*type = (nt_port_type)itype;
*subtype = (nt_port_subtype)isubtype;
@@ -77,8 +71,7 @@ int32_t __stdcall __ntapi_tt_port_type_from_guid(
}
}
- return NT_STATUS_INVALID_PARAMETER;
-
+ return NT_STATUS_NOT_FOUND;
}