Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
私は奇妙な問題に遭遇します:
「システム」プロセスのスレッドで を呼び出しPsGetCurrentProcessId()ましたが、null 値が返されました。
PsGetCurrentProcessId()
さらに、スレッドの _CLIENT_ID を確認したところ、UniqueProcess と UniqueThread の両方が null であることがわかりました。
また、現在のプロセス、つまり「システム」プロセスを確認したところ、UniqueProcessId が正常な 4 であることがわかりました。
なんで?
システム プロセス ID は非常に優れた「ハック」であるため、複数のツール (ProcExp、windbg など) は、カーネルのみのスレッドやアイドル関数ディスパッチャの特別なケースを必要としません。
カーネルのみのスレッドの場合、関連するプロセスはありません (自分自身を攻撃しない限り)。