Jump to content

Detecting Windows API Sets on a Device - (Moved)


Recommended Posts

Local $apiSet = InputBox("Enter API Set","Enter name of API set to be queried","ext-ms-win-ntuser-rawinput-l1-1-0")

If $apiSet Then
   Local $aCall = DllCall("api-ms-win-core-apiquery-l2-1-0.dll", "BOOL", "IsApiSetImplemented", "STR", $apiSet)


From here: https://learn.microsoft.com/en-us/windows/win32/apiindex/windows-apisets


All versions of Windows share a common base of OS components that is called the core OS (in some contexts this common base is also called OneCore). In core OS components, Win32 APIs are organized into functional groups called API sets.

The purpose of an API set is to provide an architectural separation from the host DLL in which a given Win32 API is implemented and the functional contract to which the API belongs. The decoupling that API sets provide between implementation and contracts offers many engineering advantages for developers. In particular, using API sets in your code can improve compatibility with Windows devices.

API sets specifically address the following scenarios:

Although the full breadth of the Win32 API is supported on PCs, only a subset of the Win32 API is available on other Windows 10 and/or Windows 11 devices such as HoloLens, Xbox, and other devices. The API set name provides a query mechanism to cleanly detect whether an API is available on any given device.

Some Win32 API implementations exist in DLLs with different names across different Windows devices. Using API set names instead of DLL names when detecting API availability and delay loading APIs provide a correct route to the implementation no matter where the API is actually implemented.


What do you guys think of adding this to autoit's Includes udfs? On one hand, this is only for Win10 and later, but on the other hand it's pretty significant for not taking for granted the assumption that the full set of Windows api features are available on all devices.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...