Esempio n. 1
0
 public static unsafe ErrorCode XInputGetBatteryInformation(int userIndex, BatteryDeviceType devType, out BatteryInformation batteryInformation)
 {
     batteryInformation = new BatteryInformation();
     try { return(GetMethod <XInputGetBatteryInformationDelegate>("XInputGetBatteryInformation")(userIndex, (int)devType, out batteryInformation)); }
     catch (AccessViolationException ex) { throw new Exception(ex.Message); }
     catch (Exception) { throw; }
 }
Esempio n. 2
0
 public int XInputGetBatteryInformation(
     int dwUserIndex,
     BatteryDeviceType devType,
     out BatteryInformation batteryInformationRef)
 {
     return(Native.XInputGetBatteryInformation(dwUserIndex, devType, out batteryInformationRef));
 }
 public int XInputGetBatteryInformation(
     int dwUserIndex,
     BatteryDeviceType devType,
     out BatteryInformation batteryInformationRef)
 {
     throw new NotSupportedException("Method not supported on XInput9.1.0");
 }
Esempio n. 4
0
 public static unsafe int XInputGetBatteryInformation(int dwUserIndex, BatteryDeviceType devType, out BatteryInformation batteryInformationRef)
 {
     batteryInformationRef = new BatteryInformation();
       int batteryInformation;
       fixed (BatteryInformation* batteryInformationPtr = &batteryInformationRef)
     batteryInformation = XInput.XInputGetBatteryInformation_(dwUserIndex, (int) devType, (void*) batteryInformationPtr);
       return batteryInformation;
 }
Esempio n. 5
0
        public static unsafe int XInputGetBatteryInformation(int dwUserIndex, BatteryDeviceType devType, out BatteryInformation batteryInformationRef)
        {
            batteryInformationRef = new BatteryInformation();
            int batteryInformation;

            fixed(BatteryInformation *batteryInformationPtr = &batteryInformationRef)
            batteryInformation = XInput.XInputGetBatteryInformation_(dwUserIndex, (int)devType, (void *)batteryInformationPtr);

            return(batteryInformation);
        }
		uint XInputGetBatteryInformation_Hooked(int dwUserIndex, int devType, out BatteryInformation pBatteryInformation)
		{
			pBatteryInformation = new BatteryInformation();

			var controller = new Controller((UserIndex)dwUserIndex);
			if (controller.IsConnected)
			{
				try
				{
					pBatteryInformation = controller.GetBatteryInformation((BatteryDeviceType) devType);
				}
				catch
				{
					return ERROR_DEVICE_NOT_CONNECTED;
				}
			}
			else
			{
				pBatteryInformation.BatteryLevel = BatteryLevel.Full;
			}
			
			return ERROR_SUCCESS;
		}
Esempio n. 7
0
 public int XInputGetBatteryInformation(int dwUserIndex, BatteryDeviceType devType, out BatteryInformation batteryInformationRef)
 {
     throw new NotSupportedException("Method not supported on XInput9.1.0");
 }
Esempio n. 8
0
 public static extern int XInputGetBatteryInformation(
     int dwUserIndex,
     BatteryDeviceType devType,
     out BatteryInformation batteryInformationRef);
Esempio n. 9
0
 public int XInputGetBatteryInformation(int dwUserIndex, BatteryDeviceType devType, out BatteryInformation batteryInformationRef)
 {
     return XInput.XInputGetBatteryInformation(dwUserIndex, devType, out batteryInformationRef);
 }
Esempio n. 10
0
 public static extern int XInputGetBatteryInformation(int dwUserIndex, BatteryDeviceType devType, out BatteryInformation batteryInformationRef);