Ejemplo n.º 1
0
        public IList <DIDEVICEINSTANCE> EnumDevices(DI8DEVCLASS deviceClass, DIEDFL deviceEnumFlags)
        {
            var callback = new EnumDevicesCallback();

            this.EnumDevices((int)deviceClass, callback.NativePointer, IntPtr.Zero, deviceEnumFlags).CheckError();
            return(callback.DeviceInstances);
        }
Ejemplo n.º 2
0
        public IList <DIDEVICEINSTANCE> EnumDevices(DI8DEVTYPE deviceType, DIEDFL deviceEnumFlags)
        {
            var callback = new EnumDevicesCallback();

            this.EnumDevices((int)deviceType, callback.NativePointer, IntPtr.Zero, deviceEnumFlags);
            return(callback.DeviceInstances);
        }
 public List<DIDEVICEINSTANCEW> EnumDevices(DI8DEVTYPE deviceType, DIEDFL flags)
 {
     List<DIDEVICEINSTANCEW> result = new List<DIDEVICEINSTANCEW>();
     //
     LPDIENUMDEVICESCALLBACK callback = new LPDIENUMDEVICESCALLBACK(DirectInput.EnumDevicesCallback);
     GCHandle hCallback = GCHandle.Alloc(callback);
     GCHandle hResult   = GCHandle.Alloc(result);
     try {
         IntPtr pfn = Marshal.GetFunctionPointerForDelegate(callback);
         this.pDirectInput8.EnumDevices(deviceType, pfn, GCHandle.ToIntPtr(hResult), flags);
         }
     finally
         {
         hCallback.Free();
         hResult.Free();
         }
     //
     return result;
 }
Ejemplo n.º 4
0
 /// <unmanaged>HRESULT IDirectInput8W::EnumDevices([In] unsigned int arg0,[In] __function__stdcall* arg1,[In] void* arg2,[In] DIEDFL arg3)</unmanaged>
 internal unsafe HRESULT EnumDevices(int arg0, FunctionCallback arg1, IntPtr arg2, DIEDFL arg3)
 {
     //calli(System.Int32(System.Void*,System.Int32,System.Void*,System.Void*,System.Int32), this._nativePointer, arg0, arg1, (void*)arg2, arg3, *(*(IntPtr*)this._nativePointer + (IntPtr)4 * (IntPtr)sizeof(void*))).CheckError();
     return((HRESULT)NativeHelper.CalliInt32(4, _nativePointer, arg0, (void *)arg1, (void *)arg2, (int)arg3));
 }