Share via

Windows 10 NVMe Set Feature HCTM returns ERROR_INVALID_FUNCTION

Florian Leskovsek 20 Reputation points
2026-02-27T08:48:53.7766667+00:00

As per Microsoft documentation, the NVMe Set Feature HCTM command is supported in Windows 10, beginning with 19H1 as stated here https://learn.microsoft.com/en-us/windows/win32/fileio/working-with-nvme-devices#protocol-specific-set

However, when I try to execute it on a Windows 10 Pro 22H2, the DeviceIoControl call with IOCTL_STORAGE_SET_PROPERTY fails. GetLastError returns 0x1 (ERROR_INVALID_FUNCTION).

I have also tried different features, all with the same error, so it must be an issue with the IOCTL IOCTL_STORAGE_SET_PROPERTY itself.

On Windows 11 it works fine.

So, what is going on? Is the documentation wrong or did some StorNVMe driver update break it?

Windows development | Windows API - Win32
0 comments No comments
{count} votes

Answer accepted by question author
  1. Jack Dang (WICLOUD CORPORATION) 15,205 Reputation points Microsoft External Staff Moderator
    2026-02-27T10:19:32.3266667+00:00

    Hi @Florian Leskovsek ,

    Thanks for reaching out.

    The HCTM (Host Controlled Thermal Management) command you’re trying to use is supported in Windows, but in practice, it depends on the StorNVMe driver that comes with your OS. On Windows 11, the driver has been updated to fully understand the HCTM command, which is why your DeviceIoControl call succeeds there.

    On Windows 10 Pro 22H2, even though the documentation says HCTM is supported, the default driver may not implement that command yet. That’s why you’re seeing ERROR_INVALID_FUNCTION, the OS is essentially telling your NVMe drive, “I don’t know how to do that yet.”

    A few things you can try:

    1. Check for Windows updates - there may be a driver update for StorNVMe that adds HCTM support.
    2. Check your NVMe driver version - if your manufacturer provides a newer driver for Windows 10, installing that may resolve the issue.
    3. If immediate support for HCTM is critical, Windows 11 has built-in support and works out of the box.

    Hope this helps! If my answer was helpful - kindly follow the instructions here so others with the same problem can benefit as well.


0 additional answers

Sort by: Most helpful

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.