summaryrefslogtreecommitdiff
path: root/src/mouse.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/mouse.h')
-rw-r--r--src/mouse.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/mouse.h b/src/mouse.h
new file mode 100644
index 0000000..ef41881
--- /dev/null
+++ b/src/mouse.h
@@ -0,0 +1,32 @@
+//|_ _ _. _ ._ |_ _. _ |
+//| | (/_ (_| \/ (/_ | | | | (_| (_ |<
+
+#include <windows.h>
+#include <winternl.h>
+#pragma comment( lib, "ntdll.lib" )
+
+#include "util.h"
+
+struct LOGITECH_MOUSE_IO {
+ char button;
+ char x;
+ char y;
+ char wheel;
+private:
+ char unk;
+};
+
+HANDLE nt_init_device( const char* device_name ) {
+ UNICODE_STRING name;
+ OBJECT_ATTRIBUTES attr;
+
+ RtlInitUnicodeString(&name, u_ansi_to_widebyte( device_name ) );
+ InitializeObjectAttributes( &attr, &name, 0, NULL, NULL );
+
+ NTSTATUS status = NtCreateFile(&g_input, GENERIC_WRITE | SYNCHRONIZE, &attr, &g_io, 0,
+ FILE_ATTRIBUTE_NORMAL, 0, 3, FILE_NON_DIRECTORY_FILE | FILE_SYNCHRONOUS_IO_NONALERT, 0, 0);
+
+ return status;
+}
+
+HANDLE mouse_open( ) \ No newline at end of file