/*
* UsbDk filter/redirector driver
*
* Copyright (c) 2013  Red Hat, Inc.
*
* Authors:
*  Dmitry Fleytman  <dfleytma@redhat.com>
*
*/

#pragma once

#include "UsbDkData.h"
#include "UsbDkNames.h"

#define USBDK_DEVICE_TYPE 50000

// UsbDk Control Device IOCTLs
#define IOCTL_USBDK_COUNT_DEVICES \
    ULONG(CTL_CODE( USBDK_DEVICE_TYPE, 0x851, METHOD_BUFFERED, FILE_READ_ACCESS ))
#define IOCTL_USBDK_ENUM_DEVICES \
    ULONG(CTL_CODE( USBDK_DEVICE_TYPE, 0x852, METHOD_BUFFERED, FILE_READ_ACCESS ))
#define IOCTL_USBDK_ADD_REDIRECT \
    ULONG(CTL_CODE( USBDK_DEVICE_TYPE, 0x854, METHOD_BUFFERED, FILE_WRITE_ACCESS ))
#define IOCTL_USBDK_REMOVE_REDIRECT \
    ULONG(CTL_CODE( USBDK_DEVICE_TYPE, 0x855, METHOD_BUFFERED, FILE_WRITE_ACCESS ))

/*
* UsbDk filter/redirector driver
*
* Copyright (c) 2013  Red Hat, Inc.
*
* Authors:
*  Dmitry Fleytman  <dfleytma@redhat.com>
*
*/

#pragma once

#include "UsbDkData.h"
#include "UsbDkNames.h"

#define USBDK_DEVICE_TYPE 50000

// UsbDk Control Device IOCTLs
#define IOCTL_USBDK_COUNT_DEVICES \
    ULONG(CTL_CODE( USBDK_DEVICE_TYPE, 0x851, METHOD_BUFFERED, FILE_READ_ACCESS ))
#define IOCTL_USBDK_ENUM_DEVICES \
    ULONG(CTL_CODE( USBDK_DEVICE_TYPE, 0x852, METHOD_BUFFERED, FILE_READ_ACCESS ))
#define IOCTL_USBDK_ADD_REDIRECT \
    ULONG(CTL_CODE( USBDK_DEVICE_TYPE, 0x854, METHOD_BUFFERED, FILE_READ_ACCESS ))
#define IOCTL_USBDK_REMOVE_REDIRECT \
    ULONG(CTL_CODE( USBDK_DEVICE_TYPE, 0x855, METHOD_BUFFERED, FILE_READ_ACCESS ))

--- 
+++ 
@@ -21,6 +21,6 @@
 #define IOCTL_USBDK_ENUM_DEVICES \
     ULONG(CTL_CODE( USBDK_DEVICE_TYPE, 0x852, METHOD_BUFFERED, FILE_READ_ACCESS ))
 #define IOCTL_USBDK_ADD_REDIRECT \
-    ULONG(CTL_CODE( USBDK_DEVICE_TYPE, 0x854, METHOD_BUFFERED, FILE_READ_ACCESS ))
+    ULONG(CTL_CODE( USBDK_DEVICE_TYPE, 0x854, METHOD_BUFFERED, FILE_WRITE_ACCESS ))
 #define IOCTL_USBDK_REMOVE_REDIRECT \
-    ULONG(CTL_CODE( USBDK_DEVICE_TYPE, 0x855, METHOD_BUFFERED, FILE_READ_ACCESS ))
+    ULONG(CTL_CODE( USBDK_DEVICE_TYPE, 0x855, METHOD_BUFFERED, FILE_WRITE_ACCESS ))
UsbDk: Fix control device IOCTLS access type

Signed-off-by: Dmitry Fleytman <f50f56ffad4b379c2a89812e98b14900ef87e9ea@redhat.com>
