How to use CM_Reenumerate_DevNode as user ?

Emmanuel 0 Reputation points
2023-02-01T08:39:11.0166667+00:00

Hello everybody,

I begin the migration from Win10 IoT 2016 to 2021 in our custom system.

I need to use CM_Reenumerate_DevNode and CM_Disable_DevNode in a non administrator session.

I can set specific privileges to this user like SeLoadDriverPrivilege

With Win10 IoT 2016 LTSC, with UAC disabled, it works fine.

With Win10 IoT 2019 or 2021 LTSC, it does not work: error code 51 (CR_ACCESS_DENIED). If i launch my program from an cmd in Administrator mode, it works.

What can i do ?

Thanks for your help :-)

Windows for IoT
Windows for IoT
A family of Microsoft operating systems designed for use in Internet of Things (IoT) devices.
381 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Limitless Technology 44,011 Reputation points
    2023-02-02T08:57:38.3433333+00:00

    Hello there,

    From error code and by the behaviour that it works in admin CMD says that this is related to permission issues in your Win10 IoT 2019 or 2021 LTSC environment.

    When you say 'administrative rights,' do you mean an account with admin rights or executed using 'Run As Adminstrator' (UAC)? If the former, you need to do the later.

    CM_Request_Device_EjectW() checks to see whether the caller is an interactive process, and is running on the local console session (not a remote winstation).

    Try setting SE_LOAD_DRIVER privilege.

    Hope this resolves your Query !!

    --If the reply is helpful, please Upvote and Accept it as an answer–

    0 comments No comments