weaponx

Device Management API

73 posts in this topic

#1 ·  Posted (edited)

The purpose of this UDF is native device management via the Windows Setup API. When complete it will provide most of the functionality of Devcon and Device Manager. With enough interest I hope to have a final version submitted into the standard UDF's.

Posted Image

DeviceAPI_Example.au3

Updated 2/2/2010

DeviceAPI_GUI Example.au3

Updated 2/2/2010

DeviceAPI.au3 - Alpha v6

Updated 2/2/2010

Current functions:

_DeviceAPI_ClassArray

_DeviceAPI_Close

_DeviceAPI_CreateClassImageList

_DeviceAPI_CreateClassImageListStruct

_DeviceAPI_CreateDeviceDataStruct

_DeviceAPI_DestroyClassImageList

_DeviceAPI_DestroyDeviceInfoList

_DeviceAPI_DeviceArray

_DeviceAPI_EnumDeviceInfo

_DeviceAPI_GetClassCount

_DeviceAPI_GetClassDescription

_DeviceAPI_GetClassDevices

_DeviceAPI_GetClassImageIndex

_DeviceAPI_GetClassImageList

_DeviceAPI_GetClassNameFromGUID

_DeviceAPI_GetDeviceId

_DeviceAPI_GetDeviceRegistryProperty

_DeviceAPI_Open

Reference links:

http://www.codeproject.com/KB/system/SimpleSetup.aspx

http://msdn.microsoft.com/en-us/library/ms792954.aspx

http://support.microsoft.com/kb/311272

http://msdn.microsoft.com/en-us/library/cc462983.aspx

http://msdn.microsoft.com/en-us/library/ms792832.aspx

Edited by weaponx

Share this post


Link to post
Share on other sites



freaking awesome :P

thank you


[font="Impact"]Never fear, I is here.[/font]

Share this post


Link to post
Share on other sites

this is great thanks

Share this post


Link to post
Share on other sites

I have one error :S

Error 87: The parameter is incorrect

Wat Happend??? :P

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

I have one error :S

Error 87: The parameter is incorrect

Wat Happend??? :P

There isn't very detailed error checking yet because i wrote the whole thing today. I will post an update soon that will pinpoint the source of the error.

Edited by weaponx

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

Works beautifully. Excellent stuff.

The people on this forum (and AI) never cease to amaze me.

Edited by dalisuit

Share this post


Link to post
Share on other sites

Amazing. I used WMI or Devcon in my device project but this would be far better :P


My little company: Evotec (PL version: Evotec)

Share this post


Link to post
Share on other sites

weaponx

Super! :P Thank you for sharing!

Share this post


Link to post
Share on other sites

I appreciate the feedback. I am worried the code in the example may be too complex for some people. There are a lot of pointers to dllstruct's that can't be made inside functions so they have to be declared by the user.

I will try to work in some functions that will allow people to do shortcut tasks, like retrieving an array of all guid's or device names.

Any suggestions are welcome.

Share this post


Link to post
Share on other sites

#11 ·  Posted (edited)

Update:

-Separated example into Simple and Advanced versions, which both produce the same result

-Updated UDF to Alpha v4, all function documentation complete + all error checking in place

Be sure to refresh your browser to get the latest scripts, they like to get stuck in the cache.

Edited by weaponx

Share this post


Link to post
Share on other sites

#13 ·  Posted (edited)

Amazing work once again, weaponx! :P

Posted Image <- A whole pile o' cookies for this one!

Edited by c0deWorm

My UDFs: ExitCodes

Share this post


Link to post
Share on other sites

#14 ·  Posted (edited)

I wasn't sure what to get everyone, so I just updated my Device Management API instead.

Merry X-Mas

Posted Image

(Updated to Alpha v5)

Edited by weaponx

Share this post


Link to post
Share on other sites

I wasn't sure what to get everyone, so I just updated my Device Management API instead.

Merry X-Mas.

Thanks very much ;-) It's great work! Hopefully some day i get time to update my Device Installer with your api instead of WMI ;-)

My little company: Evotec (PL version: Evotec)

Share this post


Link to post
Share on other sites

Looks great!!!


Yes i rush things! (I sorta do small bursts inbetween doing nothing.) Things I have rushed and reRushed:* ProDLLer - Process manager - Unload viri modules (dll) and moore...* _WinAPI_ProcessListOWNER_WTS() - Get Processes owner list...* _WinAPI_GetCommandLineFromPID() - Get commandline of target process...* _WinAPI_ThreadsnProcesses() Much info if expanded - optional Indented "Parent/Child"-style Processlist. Moore to come... eventually...

Share this post


Link to post
Share on other sites

Hello weaponx,

I want to know that if i want Device Instance Id for any specfied Disk Drive then how can i mange your UDF to fullfill my requirement?

e.g:

I install my app in Drive C:\ of SAMSUNG SP0802N & i want the ID for that Disk, and there are 2 Disk Drives in the System, how can i manage to get the accurate Disk and its Instance Id

In your Example it will return the list of all Installed Hardwares.


73 108 111 118 101 65 117 116 111 105 116

Share this post


Link to post
Share on other sites

help! I couldn't use with the error like:

DeviceAPI_GUI_Example.au3(97,25) : ERROR: $TVN_SELCHANGED: undeclared global variable.

Case $TVN_SELCHANGED,

~~~~~~~~~~~~~~~~~~~~^

Share this post


Link to post
Share on other sites

hi,

replace with

Case $tvn_selchangeda, $tvn_selchangedw and work

Share this post


Link to post
Share on other sites

Sorry for the necropost, but this looks too awesome to not use! When I check DeviceAPI I get

DeviceAPI.au3(684,73) : ERROR: _WinAPI_Check(): undefined function

Did something change in Alpha 5 that nobody mentioned until now?? Commenting out the 2 lines with that function call did allow it to work, but the error checking might be a nice thing to have...

Thanks

Ian


My projects:

  • IP Scanner - Multi-threaded ping tool to scan your available networks for used and available IP addresses, shows ping times, resolves IPs in to host names, and allows individual IPs to be pinged.
  • INFSniff - Great technicians tool - a tool which scans DriverPacks archives for INF files and parses out the HWIDs to a database file, and rapidly scans the local machine's HWIDs, searches the database for matches, and installs them.
  • PPK3 (Persistent Process Killer V3) - Another for the techs - suppress running processes that you need to keep away, helpful when fighting spyware/viruses.
  • Sync Tool - Folder sync tool with lots of real time information and several checking methods.
  • USMT Front End - Front End for Microsoft's User State Migration Tool, including all files needed for USMT 3.01 and 4.01, 32 bit and 64 bit versions.
  • Audit Tool - Computer audit tool to gather vital hardware, Windows, and Office information for IT managers and field techs. Capabilities include creating a customized site agent.
  • CSV Viewer - Displays CSV files with automatic column sizing and font selection. Lines can also be copied to the clipboard for data extraction.
  • MyDirStat - Lists number and size of files on a drive or specified path, allows for deletion within the app.
  • 2048 Game - My version of 2048, fun tile game.
  • Juice Lab - Ecigarette liquid making calculator.
  • Data Protector - Secure notes to save sensitive information.
  • VHD Footer - Add a footer to a forensic hard drive image to allow it to be mounted or used as a virtual machine hard drive.
  • Find in File - Searches files containing a specified phrase.

Share this post


Link to post
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