是否可以确定另一个进程的工作目录? [英] Is it possible to determine the working directory of another process?

查看:27
本文介绍了是否可以确定另一个进程的工作目录?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

给定一个处理A"的 HANDLE(或 ProcessID)是否可以在 Win32 上让无关的进程B"确定进程A"的当前工作目录?

Given a HANDLE (or ProcessID) to process 'A' is it possible on Win32 for an unrelated process 'B' to determine the current working directory of process 'A' ?

推荐答案

我认为这可能可以使用与获取 外部进程命令行 并且似乎有一个 _RTL_USER_PROCESS_PARAMETERS->CurrentDirectoryPath 听起来很有希望.

I thought this may be possible using the same technique you can use to get an external processes command line and there does seem to be a _RTL_USER_PROCESS_PARAMETERS->CurrentDirectoryPath which sounds promising.

(该示例并未说明 API 基本上没有记录,并且它们是 不是未来证明,所以 YMMV)

(The example doesn't state that the APIs are largely undocumented and that they are not future proof, so YMMV)

这篇关于是否可以确定另一个进程的工作目录?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆