summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/pty/ntapi_pty_fd.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/pty/ntapi_pty_fd.c b/src/pty/ntapi_pty_fd.c
index ea62874..8e6110d 100644
--- a/src/pty/ntapi_pty_fd.c
+++ b/src/pty/ntapi_pty_fd.c
@@ -177,23 +177,28 @@ int32_t __stdcall __ntapi_pty_open(
uint32_t open_options)
{
int32_t status;
- uint32_t hash;
nt_guid guid;
nt_uuid_str_utf16 * guid_str;
nt_pty * ctx;
+ wchar16_t * wch;
+ /* validate */
if (!obj_attr || !obj_attr->obj_name || !obj_attr->obj_name->buffer)
return NT_STATUS_INVALID_PARAMETER;
if (obj_attr->obj_name->strlen != __DEVICE_PATH_PREFIX_LEN + sizeof(nt_guid_str_utf16))
return NT_STATUS_OBJECT_PATH_INVALID;
- hash = __ntapi->tt_buffer_crc32(
- 0,
- obj_attr->obj_name->buffer,
- __DEVICE_PATH_PREFIX_LEN);
+ wch = obj_attr->obj_name->buffer;
- if (hash != __DEVICE_PATH_PREFIX_HASH)
+ if ((wch[0] != '\\')
+ || (wch[1] != 'D')
+ || (wch[2] != 'e')
+ || (wch[3] != 'v')
+ || (wch[4] != 'i')
+ || (wch[5] != 'c')
+ || (wch[6] != 'e')
+ || (wch[7] != '\\'))
return NT_STATUS_OBJECT_PATH_INVALID;
guid_str = (nt_uuid_str_utf16 *)