關機 win2k或以上

2021-04-08 18:32:25 字數 911 閱讀 8968

handle htoken;

token_privileges tkp;

// get a token for this process.

if (!openprocesstoken(getcurrentprocess(),

token_adjust_privileges | token_query, &htoken))

return( false );

// get the luid for the shutdown privilege.

lookupprivilegevalue(null, se_shutdown_name,

&tkp.privileges[0].luid);

tkp.privilegecount = 1;  // one privilege to set   

tkp.privileges[0].attributes = se_privilege_enabled;

// get the shutdown privilege for this process.

adjusttokenprivileges(htoken, false, &tkp, 0,

(ptoken_privileges)null, 0);

if (getlasterror() != error_success)

return false;

if (!exitwindow***(ewx_shutdown | ewx_force,

shtdn_reason_major_operatingsystem |

shtdn_reason_minor_upgrade |

shtdn_reason_flag_planned))

return false;

return true;

Win2K服務詳解

svchost.exe 檔案對那些從動態連結庫中執行的服務來說是一個普通的主機程序名 最基本的系統程序 也就是說,這些程序是系統執行的基本條件,有了這些程序,系統就能正常執行 ss.exe session manager csrss.exe 子系統伺服器程序 winlogon.exe 管理使用者登入...

Win2k下isapi dll除錯設定

1.控制面板 管理工具 internet services manager 要設定的 屬性 主目錄 設定最下面的 應用程式保護 為 低 iis 程序 將存放dll的虛擬目錄同樣設定 2.控制面板 管理工具 服務 將http ftp smtp服務設定為手工開啟 3.控制面板 管理工具 本地安全設定 本...

Win2K下的Api函式的攔截

簡介 api攔截並不是一個新的技術,很多商業軟體都採用這種技術。對windows的api函式的攔截,不外乎兩種方法,第一種是mr.jeffrey richter 的修改exe檔案的模組輸入節,種方法,很安全,但很複雜,而且有些exe檔案,沒有dll的輸入符號的列表,有可能出現攔截不到的情況。第二種方...

Win2K下的Api函式的攔截

api攔截並不是一個新的技術,很多商業軟體都採用這種技術。對windows的api函式的攔截,不外乎兩種方法,第一種是mr.jeffrey richter 的修改exe檔案的模組輸入節,種方法,很安全,但很複雜,而且有些exe檔案,沒有dll的輸入符號的列表,有可能出現攔截不到的情況。第二種方法就是...

Win2K下的Api函式的攔截

api攔截並不是一個新的技術,很多商業軟體都採用這種技術。對windows的api函式的攔截,不外乎兩種方法,第一種是mr.jeffrey richter 的修改exe檔案的模組輸入節,種方法,很安全,但很複雜,而且有些exe檔案,沒有dll的輸入符號的列表,有可能出現攔截不到的情況。第二種方法就是...