devconの中身を見る①(cmdClasses)

もくじ
https://tera1707.com/entry/2022/02/06/144447

やりたいこと

devconで、

devcon classes

とパラメータを渡して実行したときの処理の中身を追いかけたい。

該当コード

ここ。

https://github.com/microsoft/Windows-driver-samples/blob/b968cfbed5566a3a9597f5368334beb3b6dad4d2/setup/devcon/cmds.cpp#L112

やってることの流れ

SetupDiBuildClassInfoListEx

SetupDiBuildClassInfoListEx()で、デバイスのクラスの一覧を取得する。

https://learn.microsoft.com/ja-jp/windows/win32/api/setupapi/nf-setupapi-setupdibuildclassinfolistexa

※今のところ、デバイスの「クラス」は、デバイスの種類、みたいなもんという認識。

SetupDiClassNameFromGuidEx

SetupDiClassNameFromGuidEx()で、上で取ったクラスのGUIDに対応するクラス名を取得する。

https://learn.microsoft.com/en-us/windows/win32/api/setupapi/nf-setupapi-setupdiclassnamefromguidexw

SetupDiGetClassDescriptionEx

SetupDiGetClassDescriptionEx()で、上で取ったクラスのGUIDに対応する説明を取得する。

https://learn.microsoft.com/ja-jp/windows/win32/api/setupapi/nf-setupapi-setupdigetclassdescriptionexw

おわり

これで処理終わり。

備考

"SetupDi" というプレフィックスは、"Setup Device Installation" を意味するらしい。(chatGPTより)