We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
in init function,
// L"\\Device\\echo", GENERIC_READ | GENERIC_WRITE auto retrieve_device_handle(std::wstring device_name, ACCESS_MASK access_mask) -> PHANDLE { NTSTATUS status; HANDLE device_handle; OBJECT_ATTRIBUTES obj_attr; UNICODE_STRING uni_device_name; IO_STATUS_BLOCK io_status_block; RtlInitUnicodeString(&uni_device_name, device_name); InitializeObjectAttributes(&obj_attr, &uni_device_name, OBJ_CASE_INSENSITIVE | OBJ_KERNEL_HANDLE, NULL, NULL); ACCESS_MASK access_mask = ; ULONG share_access = 0; ULONG open_options = 0; status = NtOpenFile(&device_handle, access_mask, &obj_attr, &io_status_block, share_access, open_options); if (!NT_SUCCESS(status)) { std::cerr << "Failed to open handle. Status code: " << std::hex << status << std::endl; return nullptr; } // This handle has to be closed with CloseHandle(device_handle); return device_handle; }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
in init function,
The text was updated successfully, but these errors were encountered: