Handleの一覧を取得する
昨日Process Hackerをダウンロードして動かしてみたので今日はソースを眺めてみた。(※ライセンスはGPL)
基本的にはC#で書かれている。(Cのドライバとフック用DLLもある)
Handleの一覧をどうやって取ってるか気になっていたので見てみるとNtQuerySystemInformationというAPIを呼び出すだけで取得できるみたい。
MSDNの説明には
Remarks
The NtQuerySystemInformation function and the structures that it returns are internal to the operating system and subject to change from one release of Windows to another. To maintain the compatibility of your application, it is better to use the alternate functions previously mentioned instead.
とあるので推奨されない関数みたい。
他にも気になるところがあるので暇を見つけてソースを見ていこう。