super红客

重启windows 2000/nt系统
上一章 首页 目录 书架 下一章
备用网站最新地址(记得收藏)
    重新启动windows 2000/nt系统

    rebootindows 2000 pbsp;many examples shellthe kernel and just kill the pbsp;this doesproperly and takes into aser privilages.

    'api calls used for rebootpc

    private st token_adjust_privileges = &h20

    private st token_query = &h8

    private st se_privilege_enabled = &h2

    private st ewx_shutdownlong = 1

    private st ewx_forg = 4

    private st ewx_reboot = 2

    private type luid

    usedpartlong

    ignoredfornowhigh32bitpartlong

    end type

    private type token_privileges

    privilegetlong

    theluidluid

    attributeslong

    end type

    private declare fun exitwindowsex lib "user32" (byval dwoptionslong, byval dwreservedlong)long

    private declare fun getcurrentprocess lib "kernel32" long

    private declare fun openprocesstoken lib "advapi32" (byval processhandlelong, byval desiredaccesslong, tokenhandlelong)long

    private declare fun lookupprivilegevalue lib "advapi32" alias "lookupprivilegevaluea" (byval lpsystemring, byval lpring, lpluidluid)long

    private declare fun adjusttokenprivileges lib "advapi32" (byval tokenhandlelong, byval disableallprivilegeslong, atetoken_privileges, byval bufferlengthlong, previousstatetoken_privileges, returhlong)long

    sub rebootpc

    lobsp;error goto rebootpc_errorhandler

    st e = "rebootpc"

    dim hprocesshandlelong

    dim htokenhandlelong

    dim tmpluidluid

    dim tkpoken_privileges

    dim tkpprevioustoken_privileges

    dim lbufferneededlong

    hprocesshandle = getcurrentprocess

    call openprocesstoken(hprocesshandle, token_adjust_privilegestoken_query, htokenhandle)

    ' get the luid for the shutdown privilege

    call lookupprivilegevalue("", "seshutdownprivilege", tmpluid)

    = 1 ' one privilegese = tmplui = se_privilege_enabled

    ' enable the shutdown privilegethe access tokenthi = 0

    call adjusttokenprivileges(htokenhandle, false, tkpnew, len(tkpprevious), tkpprevious, lbufferneeded)

    ' forceboot (no options**e filesbsp;out)

    call exitwindowsex(ewx_forceewx_reboot, &hffff)

    exit sub

    rebootpc_errorhandler:

    call raiseerror(e, e, err.number, err.description)

    end sub</p>
上一章 首页 目录 加书签 下一章

阅读页设置
背景颜色

默认

淡灰

深绿

橙黄

夜间

字体大小

章节为网友上传,如有侵权请联系我们删除。