}\r
}\r
\r
+static void WvVersionQuery(WDFREQUEST Request)\r
+{\r
+ size_t len = 0;\r
+ UINT64 *version;\r
+ NTSTATUS status;\r
+\r
+ status = WdfRequestRetrieveOutputBuffer(Request, sizeof(UINT64), &version, &len);\r
+ if (NT_SUCCESS(status)) {\r
+ *version = WV_KERNEL_VERSION;\r
+ }\r
+ \r
+ WdfRequestCompleteWithInformation(Request, status, len);\r
+}\r
+\r
static void WvGuidQuery(WDFREQUEST Request)\r
{\r
WV_IO_GUID_LIST *list;\r
\r
// TODO: verify this compiles as a jump table, or use function pointers\r
switch (IoControlCode) {\r
+ case WV_IO_FUNCTION_VERSION_QUERY:\r
+ WvVersionQuery(Request);\r
+ break;\r
case WV_IOCTL_GUID_QUERY:\r
WvGuidQuery(Request);\r
break;\r
typedef UINT32 NET32;\r
typedef UINT64 NET64;\r
\r
+#define WV_KERNEL_VERSION 1\r
+\r
#define WV_IOCTL(f) CTL_CODE(FILE_DEVICE_INFINIBAND, f, METHOD_BUFFERED,\\r
FILE_READ_DATA | FILE_WRITE_DATA)\r
\r
#define WV_IO_FUNCTION_BASE 0x800\r
\r
enum {\r
- WV_IO_FUNCTION_MIN,\r
+ WV_IO_FUNCTION_VERSION_QUERY,\r
WV_IO_FUNCTION_GUID_QUERY,\r
WV_IO_FUNCTION_LIBRARY_QUERY,\r
WV_IO_FUNCTION_DEVICE_OPEN,\r
WV_IO_FUNCTION_PD_CANCEL\r
};\r
\r
+// none / UINT64 Version\r
+#define WV_IOCTL_VERSION_QUERY WV_IOCTL(WV_IO_FUNCTION_BASE + \\r
+ WV_IO_FUNCTION_VERSION_QUERY)\r
+\r
// none / WV_IO_GUID_LIST\r
#define WV_IOCTL_GUID_QUERY WV_IOCTL(WV_IO_FUNCTION_BASE + \\r
WV_IO_FUNCTION_GUID_QUERY)\r