Share via

Sending a power off packet to an Xbox Series Controller

magrega 56 Reputation points
2026-04-10T10:12:44.4266667+00:00

Hi! I am makeing a C# pet project with which I want to power off my xbox controller on a certain trigger.

I've discovered that I can use WriteFile to send data to  \.\XboxGIP handle from C# code.

I've managed to send a Led command as per doc but I still don't understand why a power off packet doesn't come through.

I am sending these bytes to the handle to dim the LED backlight:

Opening \\.\XboxGIP for manual frame...
Manual Write frame (23B): 
7E-ED-82-C6-8B-DA-00-00-0A-20-00-00-03-00-00-00-00-00-00-00-00-01-05   
WriteFile OK (23B written) 

As you can see, I prefix the command with my controller ID otherwise I get Not_Connected error. I send the power off packet the same way as per docs:
7E-ED-82-C6-8B-DA-00-00-05-20-00-00-01-00-00-00-00-00-00-00-04-00-00

I tried moving the 04 byte around but it made no difference. Could you at least confirm that it is possible to do with the  \.\XboxGIP handle to power off a controller?

Opening \\.\XboxGIP for manual frame...
  Manual Write frame (23B): 7E-ED-82-C6-8B-DA-00-00-05-20-00-00-01-00-00-00-00-00-00-00-01-00-00
  WriteFile FAILED (error 87)
Failed to send manual frame to \\.\XboxGIP.

Is it supported? How can I do this any other way?

I managed to send 05 20 01 01 04 over a usb cable and the controller turned off so I assume that xboxgip.sys does allow that. Am I just not sending the correct message?

Developer technologies | C#
Developer technologies | C#

An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.

0 comments No comments

2 answers

Sort by: Most helpful
  1. Jack Dang (WICLOUD CORPORATION) 16,515 Reputation points Microsoft External Staff Moderator
    2026-04-10T10:47:39.79+00:00

    Hi @magrega ,

    Thanks for reaching out.

    The issue looks to be the packet format you are sending to \\.\XboxGIP.

    According to the GIP USB Set Device State documentation, the command format is:

    05 20 <sequence> 01 04
    

    The 04 value for Off is correct, but the buffer you posted does not match this command format. It is padded to 23 bytes, and it uses 00 as the sequence id, which is reserved. That is the most likely reason for ERROR_INVALID_PARAMETER (87).

    So the direct answer is:

    1. Yes, 04 is the correct device state value for Off.
    2. No, the 23-byte buffer you posted does not match the documented command.
    3. If you want to test the raw command, use a non-zero sequence value, for example 05 20 01 01 04.

    There is also an important limitation here: there is no documented public API that guarantees powering off the controller through \\.\XboxGIP.

    The closest official API reference is IGameInputDevice::PowerOff(), which states that the method was never implemented, was removed in GameInput v1, and has no equivalent in the current API surface.

    So even if the controller supports the Off command at the protocol level, there is no supported Windows API that guarantees user-mode writes to \\.\XboxGIP will work for this scenario.

    Hope this helps! If my answer was useful to you, I would greatly appreciate it if you could follow the instructions here so others with the same problem can benefit as well.


  2. Q&A Assist
    2026-04-10T10:12:59.7433333+00:00
    AI generated content. This question contains an answer created with AI from Q&A Assist. Learn more

    Powering off an Xbox Series controller from an app is not supported through any documented or supported API in the Microsoft gaming stack.

    Specifically:

    • The legacy GameInput IGameInputDevice::PowerOff method was never implemented (always returned E_NOTIMPL) and was removed in GameInput v1. The documentation explicitly states that no replacement exists in the current API surface, so there is no supported way to programmatically power off a controller via GameInput.
    • The behavior observed by reverse‑engineering packets to \\.XboxGIP or over USB is not documented or guaranteed, and there is no official contract that such packets must be accepted or continue to work. That path is not a supported mechanism for powering off the controller.

    So, while it may be possible to discover packets that appear to turn off the controller in some configurations, doing so relies on undocumented behavior and is outside the supported API surface. From the platform perspective, sending a “power off” command to an Xbox Series controller from an app is not supported.


    References:

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.