2

タイトルの言い回しが悪くて申し訳ありませんが、ここでもう少し文脈を説明します。

最近、Windows 8 ラップトップを購入しましたが、Norton がプリインストールされ、SYSTEM レベルの権限で実行されていることに気付きました。したがって、サードパーティのアプリケーションを SYSTEM 権限で実行するには、何らかの方法が必要であることに気づきました。

しかし、Google でよく調べた結果、Norton がこれを可能にしたのが API 呼び出しなのか、レジストリ設定なのか、それとも別の何かなのかがわかりませんでした。そのため、SO コミュニティに問い合わせることにしました。SYSTEM 権限で実行するアプリケーションを作成するにはどうすればよいですか?

4

2 に答える 2

0

It's a bad idea to run a GUI application as local system. The best approach is to have both a GUI application (running as the logged-on user) and a service (running as SYSTEM) and have them communicate as needed using any suitable IPC method. This is probably what Norton is actually doing.

However, it is possible to get a system service to launch an application as SYSTEM in the user's session. To do this, duplicate the processes security token with DuplicateTokenEx and then use SetTokenInformation with the TokenSessionId option. This will give you a token in SYSTEM context but in the user's session which you can use to launch an executable. (There may be additional issues; for example, you might also need to change the permissions on the workstation and desktop.)

于 2013-10-06T21:06:14.707 に答える