GetProcessImageFileName返回的路径不对?
求助GetProcessImageFileName返回的路径不对??如下所示调用:C/C++ codechar cFull[1024] {0}int iLen
求助GetProcessImageFileName返回的路径不对??
如下所示调用:
C/C++ codechar cFull[1024] = {0};int iLen = GetProcessImageFileName(hProcess,cFull,1024);
程序的实际路径是"D:\Program\测试程序\Project1.exe",在Win7下使用可正常获取到路径,但是在Xp下面获取到的路径却不对,中间还有终止符0x0的
返回的是以下字符串(已经转成16进制):
C/C++ code5C004400650076006900630065005C0048006100720064006400690073006B0056006F006C0075006D00650031005C0050
看样子是UniCode字符串?但是强制转换过来还是不对,求解
[解决办法]这个字符串转换过来后应该是\Device\HarddiskVolume1\P
[解决办法]这个函数在Windows XP和2003中需要注意:
Windows Server 2003 and Windows XP:
The handle must have the PROCESS_QUERY_INFORMATION access right.