Example #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; }
 }
Example #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");
 }
Example #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;
 }
Example #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;
		}
Example #7
0
 public int XInputGetBatteryInformation(int dwUserIndex, BatteryDeviceType devType, out BatteryInformation batteryInformationRef)
 {
     throw new NotSupportedException("Method not supported on XInput9.1.0");
 }
Example #8
0
 public static extern int XInputGetBatteryInformation(
     int dwUserIndex,
     BatteryDeviceType devType,
     out BatteryInformation batteryInformationRef);
Example #9
0
 public int XInputGetBatteryInformation(int dwUserIndex, BatteryDeviceType devType, out BatteryInformation batteryInformationRef)
 {
     return XInput.XInputGetBatteryInformation(dwUserIndex, devType, out batteryInformationRef);
 }
Example #10
0
 public static extern int XInputGetBatteryInformation(int dwUserIndex, BatteryDeviceType devType, out BatteryInformation batteryInformationRef);