{"action":"created","issue":{"url":"https://api.github.com/repos/oblitum/Interception/issues/34","repository_url":"https://api.github.com/repos/oblitum/Interception","labels_url":"https://api.github.com/repos/oblitum/Interception/issues/34/labels{/name}","comments_url":"https://api.github.com/repos/oblitum/Interception/issues/34/comments","events_url":"https://api.github.com/repos/oblitum/Interception/issues/34/events","html_url":"https://github.com/oblitum/Interception/issues/34","id":182164597,"number":34,"title":"interception_create_context detects no devices","user":{"login":"LostPolygon","id":928550,"avatar_url":"https://avatars.githubusercontent.com/u/928550?v=3","gravatar_id":"","url":"https://api.github.com/users/LostPolygon","html_url":"https://github.com/LostPolygon","followers_url":"https://api.github.com/users/LostPolygon/followers","following_url":"https://api.github.com/users/LostPolygon/following{/other_user}","gists_url":"https://api.github.com/users/LostPolygon/gists{/gist_id}","starred_url":"https://api.github.com/users/LostPolygon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LostPolygon/subscriptions","organizations_url":"https://api.github.com/users/LostPolygon/orgs","repos_url":"https://api.github.com/users/LostPolygon/repos","events_url":"https://api.github.com/users/LostPolygon/events{/privacy}","received_events_url":"https://api.github.com/users/LostPolygon/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":15,"created_at":"2016-10-11T03:24:00Z","updated_at":"2016-10-11T06:37:28Z","closed_at":"2016-10-11T06:26:24Z","body":"```interception_create_context``` behaves incorrectly for some reason. To be exact, line 59\r\n```\r\ndevice_array[i].handle = CreateFile(device_name, GENERIC_READ, 0, NULL, OPEN_EXISTING, 0, NULL);\r\n```\r\nalways returns ```INVALID_HANDLE_VALUE```, so no devices are detected.\r\nI've installed the Interception driver. Windows 10 x64. \r\nAlso tried on Windows 8 x64 virtual machine, no luck as well.\r\n\r\nAm I missing something obvious?"},"comment":{"url":"https://api.github.com/repos/oblitum/Interception/issues/comments/252826132","html_url":"https://github.com/oblitum/Interception/issues/34#issuecomment-252826132","issue_url":"https://api.github.com/repos/oblitum/Interception/issues/34","id":252826132,"user":{"login":"LostPolygon","id":928550,"avatar_url":"https://avatars.githubusercontent.com/u/928550?v=3","gravatar_id":"","url":"https://api.github.com/users/LostPolygon","html_url":"https://github.com/LostPolygon","followers_url":"https://api.github.com/users/LostPolygon/followers","following_url":"https://api.github.com/users/LostPolygon/following{/other_user}","gists_url":"https://api.github.com/users/LostPolygon/gists{/gist_id}","starred_url":"https://api.github.com/users/LostPolygon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LostPolygon/subscriptions","organizations_url":"https://api.github.com/users/LostPolygon/orgs","repos_url":"https://api.github.com/users/LostPolygon/repos","events_url":"https://api.github.com/users/LostPolygon/events{/privacy}","received_events_url":"https://api.github.com/users/LostPolygon/received_events","type":"User","site_admin":false},"created_at":"2016-10-11T06:37:28Z","updated_at":"2016-10-11T06:37:28Z","body":"Yeap, that was it. I think this is an error in the library, though.\r\n```\r\nchar device_name[] = \"\\\\\\\\.\\\\interception00\";\r\n...\r\ndevice_array[i].handle = CreateFile(device_name, GENERIC_READ, 0, NULL, OPEN_EXISTING, 0, NULL);\r\n```\r\n`device_name` is `char[]`, and `char` is _always_ 1 byte, but `CreateFile` is a macro that is substituted by `CreateFileW` or `CreateFileA` depending on configuration. In this case, this resulted into trying to put a 1-byte string into `CreateFileW`. The easy fix is to just replace `CreateFile` with `CreateFileA`."}}
{"actor":{"display_login":"LostPolygon"}}