示例#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; }
 }
示例#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");
 }
示例#4
0
文件: XInput.cs 项目: tanis2000/FEZ
 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;
 }
示例#5
0
文件: XInput.cs 项目: conankzhang/fez
        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;
		}
示例#7
0
 public int XInputGetBatteryInformation(int dwUserIndex, BatteryDeviceType devType, out BatteryInformation batteryInformationRef)
 {
     throw new NotSupportedException("Method not supported on XInput9.1.0");
 }
示例#8
0
 public static extern int XInputGetBatteryInformation(
     int dwUserIndex,
     BatteryDeviceType devType,
     out BatteryInformation batteryInformationRef);
示例#9
0
 public int XInputGetBatteryInformation(int dwUserIndex, BatteryDeviceType devType, out BatteryInformation batteryInformationRef)
 {
     return XInput.XInputGetBatteryInformation(dwUserIndex, devType, out batteryInformationRef);
 }
示例#10
0
 public static extern int XInputGetBatteryInformation(int dwUserIndex, BatteryDeviceType devType, out BatteryInformation batteryInformationRef);