找回密码
 加入
搜索
查看: 4312|回复: 10

[系统综合] 怎么获取系统优先级别高的进程路径

  [复制链接]
发表于 2010-12-23 13:28:27 | 显示全部楼层 |阅读模式
怎么获取系统优先级别高的进程路径,如系统的WINLOGON。EXE CSRSS。EXE这个都是系统级进程。而且基本优级高。我用过很多方法都不能获取它得的路径。
发表于 2010-12-23 16:45:13 | 显示全部楼层
什么叫系统优先级别
 楼主| 发表于 2010-12-24 12:45:23 | 显示全部楼层
什么叫系统优先级别
netegg 发表于 2010-12-23 16:45


从这个图片能看出什么是优先级了吧。

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?加入

×
发表于 2010-12-24 12:55:20 | 显示全部楼层
内存里读不出可以从注册表里读吧
发表于 2010-12-24 13:32:24 | 显示全部楼层
#include<process.au3>

Dim $i_Priority_Level, $i_Notepad_PID, $i_ArrayItem
Dim $a_RunLevels[3] = [0, 2, 4] ;low, normal, high priorities
;Get Priority Level of this instance of AutoIt Scripting Engine
$i_Priority_Level = _ProcessGetPriority (@AutoItPID)
MsgBox(0, "AutoIt Script", "Should be 2: " & $i_Priority_Level)
$i_Notepad_PID = Run(@ComSpec & ' /k notepad.exe', '', @SW_HIDE)
For $i_ArrayItem = 0 To 2
        ProcessSetPriority($i_Notepad_PID, $a_RunLevels[$i_ArrayItem])
        $i_Priority_Level = _ProcessGetPriority ($i_Notepad_PID)
        MsgBox(0, "Notepad Priority", "Should be " & $a_RunLevels[$i_ArrayItem] & ": " & $i_Priority_Level)
Next
ProcessClose('notepad.exe')
ProcessClose('cmd.exe')
发表于 2010-12-24 13:46:01 | 显示全部楼层
MsgBox (0,"",_ProcessGetPath(3120))

Func _ProcessGetPath($PID)
    If IsString($PID) Then $PID = ProcessExists($PID)
    $Path = DllStructCreate('char[1000]')
    $dll = DllOpen('Kernel32.dll')
    $handle1 = DllCall($dll, 'int', 'OpenProcess', 'dword', 0x0400 + 0x0010, 'int', 0, 'dword', $PID)
    $ret = DllCall('Psapi.dll', 'long', 'GetModuleFileNameEx', 'long', $handle1[0], 'int', 0, 'ptr', DllStructGetPtr($Path), 'long', DllStructGetSize($Path))
    $ret = DllCall($dll, 'int', 'CloseHandle', 'hwnd', $handle1[0])
    DllClose($dll)
    Return DllStructGetData($Path, 1)
EndFunc  ;==>_ProcessGetPath

只发现CSRSS。EXE不能读
 楼主| 发表于 2010-12-24 20:22:04 | 显示全部楼层
本帖最后由 gogo023 于 2010-12-24 20:23 编辑
MsgBox (0,"",_ProcessGetPath(3120))

Func _ProcessGetPath($PID)
    If IsString($PID) Then $PID = ...
lainline 发表于 2010-12-24 13:46


每次运行的时候PID都不一样。通过先读PID再获得运行路径是不理想的。
发表于 2010-12-24 20:33:28 | 显示全部楼层
需要提升权限。。。
 楼主| 发表于 2010-12-26 16:12:38 | 显示全部楼层
需要提升权限。。。
sanhen 发表于 2010-12-24 20:33


提升AU3运行时候的权限就能查看到相同权限的路很了吗?
发表于 2010-12-29 17:34:17 | 显示全部楼层
不知道读取到这个路径有什么用?用系统路径就可以得到啊!
 楼主| 发表于 2011-1-4 20:26:10 | 显示全部楼层
测试过还是不能达到效果
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-9-21 14:39 , Processed in 0.100641 second(s), 24 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表