# HG changeset patch # User StephaneLenclud # Date 1426427140 -3600 # Node ID fb9ea5ad8c2d2bb94c4653c0216768ef70f3c48c # Parent 831ebeeecfdf84759d6dc56e6f57ef54c1d85b73 Now using SharpLib.Hid and SharpLib.Win32 as namespaces. diff -r 831ebeeecfdf -r fb9ea5ad8c2d HidDevice.cs --- a/HidDevice.cs Sun Mar 15 14:39:21 2015 +0100 +++ b/HidDevice.cs Sun Mar 15 14:45:40 2015 +0100 @@ -24,9 +24,9 @@ using System.Diagnostics; using System.Text; using Microsoft.Win32.SafeHandles; -using Win32; +using SharpLib.Win32; -namespace SharpLibHid +namespace SharpLib.Hid { /// /// Represent a HID device. diff -r 831ebeeecfdf -r fb9ea5ad8c2d HidEvent.cs --- a/HidEvent.cs Sun Mar 15 14:39:21 2015 +0100 +++ b/HidEvent.cs Sun Mar 15 14:45:40 2015 +0100 @@ -24,13 +24,13 @@ using System.Diagnostics; using System.Text; using Microsoft.Win32.SafeHandles; -using Win32; +using SharpLib.Win32; using System.Collections.Generic; using System.Timers; -using SharpLibHid.Usage; +using SharpLib.Hid.Usage; -namespace SharpLibHid +namespace SharpLib.Hid { /// /// We provide utility functions to interpret gamepad dpad state. @@ -433,7 +433,7 @@ /// public DirectionPadState GetDirectionPadState() { - int index=GetValueCapabilitiesIndex((ushort)SharpLibHid.UsagePage.GenericDesktopControls, (ushort)GenericDesktop.HatSwitch); + int index=GetValueCapabilitiesIndex((ushort)Hid.UsagePage.GenericDesktopControls, (ushort)GenericDesktop.HatSwitch); if (index < 0) { //No hat switch found @@ -529,11 +529,11 @@ UsagePage usagePage = (UsagePage)UsagePage; switch (usagePage) { - case SharpLibHid.UsagePage.Consumer: + case Hid.UsagePage.Consumer: usageText += ((ConsumerControl)usage).ToString(); break; - case SharpLibHid.UsagePage.WindowsMediaCenterRemoteControl: + case Hid.UsagePage.WindowsMediaCenterRemoteControl: usageText += ((WindowsMediaCenterRemoteControl)usage).ToString(); break; diff -r 831ebeeecfdf -r fb9ea5ad8c2d HidHandler.cs --- a/HidHandler.cs Sun Mar 15 14:39:21 2015 +0100 +++ b/HidHandler.cs Sun Mar 15 14:45:40 2015 +0100 @@ -24,11 +24,11 @@ using System.Diagnostics; using System.Text; using Microsoft.Win32.SafeHandles; -using Win32; +using SharpLib.Win32; using System.Collections.Generic; -namespace SharpLibHid +namespace SharpLib.Hid { /// /// Our HID handler manages raw input registrations, processes WM_INPUT messages and broadcasts HID events in return. diff -r 831ebeeecfdf -r fb9ea5ad8c2d HidUsageTables.cs --- a/HidUsageTables.cs Sun Mar 15 14:39:21 2015 +0100 +++ b/HidUsageTables.cs Sun Mar 15 14:45:40 2015 +0100 @@ -17,7 +17,7 @@ // along with SharpDisplayManager. If not, see . // -namespace SharpLibHid +namespace SharpLib.Hid { /// /// From USB HID usage tables. diff -r 831ebeeecfdf -r fb9ea5ad8c2d HidUtils.cs --- a/HidUtils.cs Sun Mar 15 14:39:21 2015 +0100 +++ b/HidUtils.cs Sun Mar 15 14:45:40 2015 +0100 @@ -21,7 +21,7 @@ using System.Collections.Generic; using System.Text; -namespace SharpLibHid +namespace SharpLib.Hid { static class Utils { diff -r 831ebeeecfdf -r fb9ea5ad8c2d MainForm.cs --- a/MainForm.cs Sun Mar 15 14:39:21 2015 +0100 +++ b/MainForm.cs Sun Mar 15 14:45:40 2015 +0100 @@ -53,7 +53,7 @@ private TreeView treeViewDevices; private Timer _timer; - public delegate void OnHidEventDelegate(object aSender, SharpLibHid.HidEvent aHidEvent); + public delegate void OnHidEventDelegate(object aSender, SharpLib.Hid.HidEvent aHidEvent); public MainForm() { @@ -101,11 +101,11 @@ _remote.iHidHandler.OnHidEvent += HandleHidEventThreadSafe; // - Win32.RawInput.PopulateDeviceList(treeViewDevices); + SharpLib.Win32.RawInput.PopulateDeviceList(treeViewDevices); } - public void HandleHidEventThreadSafe(object aSender, SharpLibHid.HidEvent aHidEvent) + public void HandleHidEventThreadSafe(object aSender, SharpLib.Hid.HidEvent aHidEvent) { if (aHidEvent.IsStray) { @@ -147,12 +147,12 @@ //labelButtonName.Text = e.Button.ToString(); processed = true; } - else if (e.MceButton != SharpLibHid.Usage.WindowsMediaCenterRemoteControl.Null) + else if (e.MceButton != SharpLib.Hid.Usage.WindowsMediaCenterRemoteControl.Null) { //Display MCE button name //labelButtonName.Text = e.MceButton.ToString(); //Check if this is an HP extension - if (Enum.IsDefined(typeof(SharpLibHid.Usage.HpWindowsMediaCenterRemoteControl), (ushort)e.MceButton)) + if (Enum.IsDefined(typeof(SharpLib.Hid.Usage.HpWindowsMediaCenterRemoteControl), (ushort)e.MceButton)) { //Also display HP button name //labelButtonName.Text += " / HP:" + ((Hid.UsageTables.HpWindowsMediaCenterRemoteControl)e.MceButton).ToString(); @@ -160,7 +160,7 @@ processed = true; } - else if (e.ConsumerControl != SharpLibHid.Usage.ConsumerControl.Null) + else if (e.ConsumerControl != SharpLib.Hid.Usage.ConsumerControl.Null) { //Display consumer control name //labelButtonName.Text = e.ConsumerControl.ToString(); @@ -199,7 +199,7 @@ private void buttonRefresh_Click(object sender, EventArgs e) { treeViewDevices.Nodes.Clear(); - Win32.RawInput.PopulateDeviceList(treeViewDevices); + SharpLib.Win32.RawInput.PopulateDeviceList(treeViewDevices); } } diff -r 831ebeeecfdf -r fb9ea5ad8c2d RawInput.cs --- a/RawInput.cs Sun Mar 15 14:39:21 2015 +0100 +++ b/RawInput.cs Sun Mar 15 14:45:40 2015 +0100 @@ -22,7 +22,7 @@ using System.Diagnostics; using System.Windows.Forms; -namespace Win32 +namespace SharpLib.Win32 { /// /// Provide some utility functions for raw input handling. @@ -196,7 +196,7 @@ //For each our device add a node to our treeview foreach (RAWINPUTDEVICELIST device in ridList) { - SharpLibHid.HidDevice hidDevice=new SharpLibHid.HidDevice(device.hDevice); + SharpLib.Hid.HidDevice hidDevice=new SharpLib.Hid.HidDevice(device.hDevice); TreeNode node = null; if (hidDevice.Product != null && hidDevice.Product.Length > 1) @@ -233,7 +233,7 @@ { foreach (HIDP_VALUE_CAPS caps in hidDevice.InputValueCapabilities) { - string des = SharpLibHid.HidDevice.InputValueCapabilityDescription(caps); + string des = SharpLib.Hid.HidDevice.InputValueCapabilityDescription(caps); if (des != null) { node.Nodes.Add(des); diff -r 831ebeeecfdf -r fb9ea5ad8c2d RemoteControlDevice.cs --- a/RemoteControlDevice.cs Sun Mar 15 14:39:21 2015 +0100 +++ b/RemoteControlDevice.cs Sun Mar 15 14:45:40 2015 +0100 @@ -24,8 +24,8 @@ using System.Text; using Microsoft.Win32.SafeHandles; -using SharpLibHid.Usage; -using Win32; +using SharpLib.Hid.Usage; +using SharpLib.Win32; @@ -185,7 +185,7 @@ /// public delegate bool HidUsageHandler(ushort aUsage); - public SharpLibHid.HidHandler iHidHandler; + public SharpLib.Hid.HidHandler iHidHandler; //------------------------------------------------------------- @@ -201,38 +201,38 @@ RAWINPUTDEVICE[] rid = new RAWINPUTDEVICE[6]; int i = 0; - rid[i].usUsagePage = (ushort)SharpLibHid.UsagePage.WindowsMediaCenterRemoteControl; - rid[i].usUsage = (ushort)SharpLibHid.UsageCollection.WindowsMediaCenter.WindowsMediaCenterRemoteControl; + rid[i].usUsagePage = (ushort)SharpLib.Hid.UsagePage.WindowsMediaCenterRemoteControl; + rid[i].usUsage = (ushort)SharpLib.Hid.UsageCollection.WindowsMediaCenter.WindowsMediaCenterRemoteControl; rid[i].dwFlags = Const.RIDEV_EXINPUTSINK; rid[i].hwndTarget = aHWND; i++; - rid[i].usUsagePage = (ushort)SharpLibHid.UsagePage.Consumer; - rid[i].usUsage = (ushort)SharpLibHid.UsageCollection.Consumer.ConsumerControl; + rid[i].usUsagePage = (ushort)SharpLib.Hid.UsagePage.Consumer; + rid[i].usUsage = (ushort)SharpLib.Hid.UsageCollection.Consumer.ConsumerControl; rid[i].dwFlags = Const.RIDEV_EXINPUTSINK; rid[i].hwndTarget = aHWND; i++; - rid[i].usUsagePage = (ushort)SharpLibHid.UsagePage.Consumer; - rid[i].usUsage = (ushort)SharpLibHid.UsageCollection.Consumer.Selection; + rid[i].usUsagePage = (ushort)SharpLib.Hid.UsagePage.Consumer; + rid[i].usUsage = (ushort)SharpLib.Hid.UsageCollection.Consumer.Selection; rid[i].dwFlags = Const.RIDEV_EXINPUTSINK; rid[i].hwndTarget = aHWND; i++; - rid[i].usUsagePage = (ushort)SharpLibHid.UsagePage.GenericDesktopControls; - rid[i].usUsage = (ushort)SharpLibHid.UsageCollection.GenericDesktop.SystemControl; + rid[i].usUsagePage = (ushort)SharpLib.Hid.UsagePage.GenericDesktopControls; + rid[i].usUsage = (ushort)SharpLib.Hid.UsageCollection.GenericDesktop.SystemControl; rid[i].dwFlags = Const.RIDEV_EXINPUTSINK; rid[i].hwndTarget = aHWND; i++; - rid[i].usUsagePage = (ushort)SharpLibHid.UsagePage.GenericDesktopControls; - rid[i].usUsage = (ushort)SharpLibHid.UsageCollection.GenericDesktop.GamePad; + rid[i].usUsagePage = (ushort)SharpLib.Hid.UsagePage.GenericDesktopControls; + rid[i].usUsage = (ushort)SharpLib.Hid.UsageCollection.GenericDesktop.GamePad; rid[i].dwFlags = Const.RIDEV_EXINPUTSINK; rid[i].hwndTarget = aHWND; i++; - rid[i].usUsagePage = (ushort)SharpLibHid.UsagePage.GenericDesktopControls; - rid[i].usUsage = (ushort)SharpLibHid.UsageCollection.GenericDesktop.Keyboard; + rid[i].usUsagePage = (ushort)SharpLib.Hid.UsagePage.GenericDesktopControls; + rid[i].usUsage = (ushort)SharpLib.Hid.UsageCollection.GenericDesktop.Keyboard; //rid[i].dwFlags = Const.RIDEV_EXINPUTSINK; rid[i].hwndTarget = aHWND; @@ -243,7 +243,7 @@ //rid[i].hwndTarget = aHWND; - iHidHandler = new SharpLibHid.HidHandler(rid); + iHidHandler = new SharpLib.Hid.HidHandler(rid); if (!iHidHandler.IsRegistered) { Debug.WriteLine("Failed to register raw input devices: " + Marshal.GetLastWin32Error().ToString()); @@ -414,17 +414,17 @@ /// /// /// - void HandleHidEvent(object aSender, SharpLibHid.HidEvent aHidEvent) + void HandleHidEvent(object aSender, SharpLib.Hid.HidEvent aHidEvent) { HidUsageHandler usagePageHandler = null; //Check if this an MCE remote HID message - if (aHidEvent.UsagePage == (ushort)SharpLibHid.UsagePage.WindowsMediaCenterRemoteControl && aHidEvent.UsageCollection == (ushort)SharpLibHid.UsageCollection.WindowsMediaCenter.WindowsMediaCenterRemoteControl) + if (aHidEvent.UsagePage == (ushort)SharpLib.Hid.UsagePage.WindowsMediaCenterRemoteControl && aHidEvent.UsageCollection == (ushort)SharpLib.Hid.UsageCollection.WindowsMediaCenter.WindowsMediaCenterRemoteControl) { usagePageHandler = HidMceRemoteHandler; } //Check if this is a consumer control HID message - else if (aHidEvent.UsagePage == (ushort)SharpLibHid.UsagePage.Consumer && aHidEvent.UsageCollection == (ushort)SharpLibHid.UsageCollection.Consumer.ConsumerControl) + else if (aHidEvent.UsagePage == (ushort)SharpLib.Hid.UsagePage.Consumer && aHidEvent.UsageCollection == (ushort)SharpLib.Hid.UsageCollection.Consumer.ConsumerControl) { usagePageHandler = HidConsumerDeviceHandler; } diff -r 831ebeeecfdf -r fb9ea5ad8c2d Win32AppCommand.cs --- a/Win32AppCommand.cs Sun Mar 15 14:39:21 2015 +0100 +++ b/Win32AppCommand.cs Sun Mar 15 14:45:40 2015 +0100 @@ -20,7 +20,7 @@ using System; using System.Runtime.InteropServices; -namespace Win32 +namespace SharpLib.Win32 { static public partial class Const { diff -r 831ebeeecfdf -r fb9ea5ad8c2d Win32CreateFile.cs --- a/Win32CreateFile.cs Sun Mar 15 14:39:21 2015 +0100 +++ b/Win32CreateFile.cs Sun Mar 15 14:45:40 2015 +0100 @@ -21,7 +21,7 @@ using System.Runtime.InteropServices; using Microsoft.Win32.SafeHandles; -namespace Win32 +namespace SharpLib.Win32 { static partial class Function diff -r 831ebeeecfdf -r fb9ea5ad8c2d Win32Hid.cs --- a/Win32Hid.cs Sun Mar 15 14:39:21 2015 +0100 +++ b/Win32Hid.cs Sun Mar 15 14:45:40 2015 +0100 @@ -22,7 +22,7 @@ using Microsoft.Win32.SafeHandles; using System.Text; -namespace Win32 +namespace SharpLib.Win32 { static partial class Function @@ -42,7 +42,7 @@ /// Return Type: NTSTATUS->LONG->int ///PreparsedData: PHIDP_PREPARSED_DATA->_HIDP_PREPARSED_DATA* ///Capabilities: PHIDP_CAPS->_HIDP_CAPS* - [DllImportAttribute("hid.dll", EntryPoint = "HidP_GetCaps", CallingConvention = CallingConvention.StdCall)] + [DllImport("hid.dll", EntryPoint = "HidP_GetCaps", CallingConvention = CallingConvention.StdCall)] public static extern HidStatus HidP_GetCaps(System.IntPtr PreparsedData, ref HIDP_CAPS Capabilities); /// Return Type: NTSTATUS->LONG->int @@ -50,7 +50,7 @@ ///ButtonCaps: PHIDP_BUTTON_CAPS->_HIDP_BUTTON_CAPS* ///ButtonCapsLength: PUSHORT->USHORT* ///PreparsedData: PHIDP_PREPARSED_DATA->_HIDP_PREPARSED_DATA* - [System.Runtime.InteropServices.DllImportAttribute("hid.dll", EntryPoint = "HidP_GetButtonCaps", CallingConvention = System.Runtime.InteropServices.CallingConvention.StdCall)] + [DllImport("hid.dll", EntryPoint = "HidP_GetButtonCaps", CallingConvention = System.Runtime.InteropServices.CallingConvention.StdCall)] public static extern HidStatus HidP_GetButtonCaps(HIDP_REPORT_TYPE ReportType, [Out, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 2)] HIDP_BUTTON_CAPS[] ButtonCaps, ref ushort ButtonCapsLength, System.IntPtr PreparsedData); /// Return Type: NTSTATUS->LONG->int @@ -58,7 +58,7 @@ ///ValueCaps: PHIDP_VALUE_CAPS->_HIDP_VALUE_CAPS* ///ValueCapsLength: PUSHORT->USHORT* ///PreparsedData: PHIDP_PREPARSED_DATA->_HIDP_PREPARSED_DATA* - [System.Runtime.InteropServices.DllImportAttribute("hid.dll", EntryPoint = "HidP_GetValueCaps", CallingConvention = System.Runtime.InteropServices.CallingConvention.StdCall)] + [DllImport("hid.dll", EntryPoint = "HidP_GetValueCaps", CallingConvention = System.Runtime.InteropServices.CallingConvention.StdCall)] public static extern HidStatus HidP_GetValueCaps(HIDP_REPORT_TYPE ReportType, [Out, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 2)] HIDP_VALUE_CAPS[] ValueCaps, ref ushort ValueCapsLength, System.IntPtr PreparsedData); /// Return Type: NTSTATUS->LONG->int @@ -70,7 +70,7 @@ ///PreparsedData: PHIDP_PREPARSED_DATA->_HIDP_PREPARSED_DATA* ///Report: PCHAR->CHAR* ///ReportLength: ULONG->unsigned int - [System.Runtime.InteropServices.DllImportAttribute("hid.dll", EntryPoint = "HidP_GetUsageValue", CallingConvention = System.Runtime.InteropServices.CallingConvention.StdCall)] + [DllImport("hid.dll", EntryPoint = "HidP_GetUsageValue", CallingConvention = System.Runtime.InteropServices.CallingConvention.StdCall)] public static extern HidStatus HidP_GetUsageValue(HIDP_REPORT_TYPE ReportType, ushort UsagePage, ushort LinkCollection, ushort Usage, ref uint UsageValue, System.IntPtr PreparsedData, [MarshalAs(UnmanagedType.LPArray)] byte[] Report, uint ReportLength); @@ -142,7 +142,7 @@ } - [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + [StructLayout(System.Runtime.InteropServices.LayoutKind.Sequential)] public struct HIDP_CAPS { /// USAGE->USHORT->unsigned short @@ -161,7 +161,7 @@ public ushort FeatureReportByteLength; /// USHORT[17] - [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.ByValArray, SizeConst = 17, ArraySubType = System.Runtime.InteropServices.UnmanagedType.U2)] + [MarshalAs(System.Runtime.InteropServices.UnmanagedType.ByValArray, SizeConst = 17, ArraySubType = System.Runtime.InteropServices.UnmanagedType.U2)] public ushort[] Reserved; /// USHORT->unsigned short @@ -198,7 +198,7 @@ /// /// Type created in place of an anonymous struct /// - [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + [StructLayout(System.Runtime.InteropServices.LayoutKind.Sequential)] public struct HIDP_BUTTON_CAPS_RANGE { @@ -230,7 +230,7 @@ /// /// Type created in place of an anonymous struct /// - [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + [StructLayout(System.Runtime.InteropServices.LayoutKind.Sequential)] public struct HIDP_BUTTON_CAPS_NOT_RANGE { @@ -262,7 +262,7 @@ /// /// /// - [StructLayoutAttribute(LayoutKind.Explicit, Pack = 1)] + [StructLayout(LayoutKind.Explicit, Pack = 1)] public struct HIDP_BUTTON_CAPS { /// USAGE->USHORT->unsigned short @@ -275,7 +275,7 @@ /// BOOLEAN->BYTE->unsigned char [FieldOffset(3)] - [MarshalAsAttribute(UnmanagedType.U1)] + [MarshalAs(UnmanagedType.U1)] public bool IsAlias; /// USHORT->unsigned short @@ -296,27 +296,27 @@ /// BOOLEAN->BYTE->unsigned char [FieldOffset(12)] - [MarshalAsAttribute(UnmanagedType.U1)] + [MarshalAs(UnmanagedType.U1)] public bool IsRange; /// BOOLEAN->BYTE->unsigned char [FieldOffset(13)] - [MarshalAsAttribute(UnmanagedType.U1)] + [MarshalAs(UnmanagedType.U1)] public bool IsStringRange; /// BOOLEAN->BYTE->unsigned char [FieldOffset(14)] - [MarshalAsAttribute(UnmanagedType.U1)] + [MarshalAs(UnmanagedType.U1)] public bool IsDesignatorRange; /// BOOLEAN->BYTE->unsigned char [FieldOffset(15)] - [MarshalAsAttribute(UnmanagedType.U1)] + [MarshalAs(UnmanagedType.U1)] public bool IsAbsolute; /// ULONG[10] [FieldOffset(16)] - [MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = 10, ArraySubType = UnmanagedType.U4)] + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 10, ArraySubType = UnmanagedType.U4)] public uint[] Reserved; /// Union Range/NotRange @@ -330,7 +330,7 @@ /// /// Type created in place of an anonymous struct /// - [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + [StructLayout(System.Runtime.InteropServices.LayoutKind.Sequential)] public struct HIDP_VALUE_CAPS_RANGE { @@ -362,7 +362,7 @@ /// /// Type created in place of an anonymous struct /// - [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + [StructLayout(System.Runtime.InteropServices.LayoutKind.Sequential)] public struct HIDP_VALUE_CAPS_NOT_RANGE { @@ -395,7 +395,7 @@ /// /// /// - [StructLayoutAttribute(LayoutKind.Explicit, Pack = 1)] + [StructLayout(LayoutKind.Explicit, Pack = 1)] public struct HIDP_VALUE_CAPS { @@ -409,7 +409,7 @@ /// BOOLEAN->BYTE->unsigned char [FieldOffset(3)] - [MarshalAsAttribute(UnmanagedType.U1)] + [MarshalAs(UnmanagedType.U1)] public bool IsAlias; /// USHORT->unsigned short @@ -430,27 +430,27 @@ /// BOOLEAN->BYTE->unsigned char [FieldOffset(12)] - [MarshalAsAttribute(UnmanagedType.U1)] + [MarshalAs(UnmanagedType.U1)] public bool IsRange; /// BOOLEAN->BYTE->unsigned char [FieldOffset(13)] - [MarshalAsAttribute(UnmanagedType.U1)] + [MarshalAs(UnmanagedType.U1)] public bool IsStringRange; /// BOOLEAN->BYTE->unsigned char [FieldOffset(14)] - [MarshalAsAttribute(UnmanagedType.U1)] + [MarshalAs(UnmanagedType.U1)] public bool IsDesignatorRange; /// BOOLEAN->BYTE->unsigned char [FieldOffset(15)] - [MarshalAsAttribute(UnmanagedType.U1)] + [MarshalAs(UnmanagedType.U1)] public bool IsAbsolute; /// BOOLEAN->BYTE->unsigned char [FieldOffset(16)] - [MarshalAsAttribute(UnmanagedType.U1)] + [MarshalAs(UnmanagedType.U1)] public bool HasNull; /// UCHAR->unsigned char diff -r 831ebeeecfdf -r fb9ea5ad8c2d Win32RawInput.cs --- a/Win32RawInput.cs Sun Mar 15 14:39:21 2015 +0100 +++ b/Win32RawInput.cs Sun Mar 15 14:45:40 2015 +0100 @@ -20,7 +20,7 @@ using System; using System.Runtime.InteropServices; -namespace Win32 +namespace SharpLib.Win32 { static partial class Function @@ -372,7 +372,7 @@ [FieldOffset(0)] public uint cbSize; [FieldOffset(4)] - [MarshalAsAttribute(UnmanagedType.U4)] + [MarshalAs(UnmanagedType.U4)] public RawInputDeviceType dwType; [FieldOffset(8)] public RID_DEVICE_INFO_MOUSE mouse;