How to use registry entry "flags" for builtin driver

Hello, I found that my driver, that wasn’t loading during boot, now is loading after I changed the “flags” value to 0x10 in the registry key related to my driver.

What is the “flags” value meaning? Is there any documentation about?

Thank you.

It’s an optional setting to specifies how Device Manager loads the driver. For the flag values that you can set, see ActivateDeviceEx. Please refer to this article for details

Actually I found that only with Flags=0x10 the driver is being loaded and this value is not documented in ActivateDeviceEx as far as I understand.

Other flags can be added to 0x10 and they seem to act as documented, but basically in my case if I just use the documented flags without adding 0x10 nothing happens.

Hi @brownb ,

Here is the definition of all supported Flags:

//
// Flag values.
//
#define DEVFLAGS_NONE 0x00000000 // No flags defined
#define DEVFLAGS_UNLOAD 0x00000001 // Unload driver after call to entry point returns
#define DEVFLAGS_LOADLIBRARY 0x00000002 // Use LoadLibrary instead of LoadDriver
#define DEVFLAGS_NOLOAD 0x00000004 // Don’t load Dll
#define DEVFLAGS_NAKEDENTRIES 0x00000008 // Entry points don’t have Prefix prepended
#define DEVFLAGS_LOAD_AS_USERPROC 0x00000010 // Driver loaded to user mode processor
#define DEVFLAGS_NOUNLOAD 0x00000020 // Do not unload this driver in DeativateDevice
#define DEVFLAGS_BOOTPHASE_1 0x00001000 // This driver only load at system phase 1
#define DEVFLAGS_IRQ_EXCLUSIVE 0x00000100 // This driver only can be load when it has exclusive access for IRQ.
#define DEVFLAGS_TRUSTEDCALLERONLY 0x00010000 // This driver only can be opened by trusted application.

So 0x10 tells the OS to load the driver as a UserMode Driver… strange that is only works like that… but maybe your driver needs to be loaded as UserMode Driver.