﻿<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Timothy&#039;s Space &#187; adjust</title>
	<atom:link href="http://www.xiaozhou.net/tag/adjust/feed" rel="self" type="application/rss+xml" />
	<link>http://www.xiaozhou.net</link>
	<description>君看一叶舟，出没风波里</description>
	<lastBuildDate>Tue, 07 Feb 2012 04:28:04 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>BLOG界面调整</title>
		<link>http://www.xiaozhou.net/aboutsite/sitelog/blog-interface-adjustments-2009-09-26.htm</link>
		<comments>http://www.xiaozhou.net/aboutsite/sitelog/blog-interface-adjustments-2009-09-26.htm#comments</comments>
		<pubDate>Sat, 26 Sep 2009 08:09:13 +0000</pubDate>
		<dc:creator>Timothy</dc:creator>
				<category><![CDATA[站点日志]]></category>
		<category><![CDATA[adjust]]></category>
		<category><![CDATA[blog]]></category>
		<category><![CDATA[UI]]></category>
		<category><![CDATA[界面]]></category>
		<category><![CDATA[调整]]></category>

		<guid isPermaLink="false">http://localhost/wordpress/?p=244</guid>
		<description><![CDATA[这两天改了一下BLOG的CSS，主要调整了一下文章的标题文字的样式和文章内容文字的大小，在此推荐浏览本BLOG的同学安装微软雅黑字体。另外，在修改数据库的时候，忘了备份，导致最近一篇文章的评论丢失，囧&#8230;&#8230;下次一定吸取教训。 声明: 此Blog中的文章和随笔仅代表作者在某一特定时间内的观点和结论，对其完全的正确不做任何担保或假设 本站文章均采用 知识共享署名-相同方式共享3.0 协议进行授权，除非注明，本站文章均为原创，转载请注明转自 Timothy&#039;s Space 并应以链接形式标明本文地址!]]></description>
			<content:encoded><![CDATA[<p>这两天改了一下BLOG的CSS，主要调整了一下文章的标题文字的样式和文章内容文字的大小，<span style="color: rgb(255, 0, 0); ">在此推荐浏览本BLOG的同学安装微软雅黑字体</span>。另外，在修改数据库的时候，忘了备份，导致最近一篇文章的评论丢失，囧&hellip;&hellip;下次一定吸取教训。</p>
<p class="announce"><span style="font-weight:bold;text-shadow:0 1px 0 #ddd;">声明:</span> 此Blog中的文章和随笔仅代表作者在某一特定时间内的观点和结论，对其完全的正确不做任何担保或假设 <br /> 本站文章均采用 <a rel="nofollow" href="http://creativecommons.org/licenses/by-nc-sa/3.0/" title="署名-非商业性使用-相同方式共享">知识共享署名-相同方式共享3.0</a> 协议进行授权，除非注明，本站文章均为原创，转载请注明转自  <a href="http://www.xiaozhou.net">Timothy&#039;s Space</a> 并应以链接形式标明本文地址!</p>]]></content:encoded>
			<wfw:commentRss>http://www.xiaozhou.net/aboutsite/sitelog/blog-interface-adjustments-2009-09-26.htm/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>调整当前进程权限并关机</title>
		<link>http://www.xiaozhou.net/vcdevelopment/to-adjust-the-current-process-permissions-and-shutdown-2004-10-21.htm</link>
		<comments>http://www.xiaozhou.net/vcdevelopment/to-adjust-the-current-process-permissions-and-shutdown-2004-10-21.htm#comments</comments>
		<pubDate>Thu, 21 Oct 2004 14:11:51 +0000</pubDate>
		<dc:creator>Timothy</dc:creator>
				<category><![CDATA[VC开发]]></category>
		<category><![CDATA[adjust]]></category>
		<category><![CDATA[permission]]></category>
		<category><![CDATA[Process]]></category>
		<category><![CDATA[Shutdown]]></category>
		<category><![CDATA[关机]]></category>
		<category><![CDATA[权限]]></category>
		<category><![CDATA[调整]]></category>
		<category><![CDATA[进程]]></category>

		<guid isPermaLink="false">http://localhost/wordpress/?p=33</guid>
		<description><![CDATA[核心代码片断： if (!OpenProcessToken(GetCurrentProcess(),TOKEN_ADJUST_PRIVILEGES &#124; TOKEN_QUERY, &#038;hToken)) { MessageBox(&#8220;OpenProcessToken failed!&#8221;); } LookupPrivilegeValue(NULL, SE_SHUTDOWN_NAME,&#038;tkp.Privileges[0].Luid); //获得本地机唯一的标识 tkp.PrivilegeCount = 1; tkp.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED; AdjustTokenPrivileges(hToken, FALSE, &#038;tkp, 0,(PTOKEN_PRIVILEGES) NULL, 0); //调整获得的权限 if (GetLastError() != ERROR_SUCCESS) { MessageBox(&#8220;切换系统级权限失败!&#8221;); } fResult =InitiateSystemShutdown( NULL, // 要关的计算机用户名 &#8220;关机时间已到，WINDOWS将在上面的时间内关机，请做好保存工作!&#8221;, // 显示的消息 10, // 关机所需的时间 TRUE, // ask user to close apps FALSE); //设为TRUE为重起，设为FALSE为关机 if(!fResult) { [...]]]></description>
			<content:encoded><![CDATA[<p>核心代码片断：</p>
<p>if (!OpenProcessToken(GetCurrentProcess(),TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, &#038;hToken))<br />
		{<br />
		    MessageBox(&#8220;OpenProcessToken failed!&#8221;);<br />
		}</p>
<p>	    LookupPrivilegeValue(NULL, SE_SHUTDOWN_NAME,&#038;tkp.Privileges[0].Luid); //获得本地机唯一的标识<br />
	    tkp.PrivilegeCount = 1;<br />
	    tkp.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED;<br />
        AdjustTokenPrivileges(hToken, FALSE, &#038;tkp, 0,(PTOKEN_PRIVILEGES) NULL, 0); //调整获得的权限</p>
<p>	    if (GetLastError() != ERROR_SUCCESS)<br />
		{<br />
            MessageBox(&#8220;切换系统级权限失败!&#8221;);<br />
		}</p>
<p>	    fResult =InitiateSystemShutdown(<br />
             NULL,                                  // 要关的计算机用户名<br />
             &#8220;关机时间已到，WINDOWS将在上面的时间内关机，请做好保存工作!&#8221;,  // 显示的消息<br />
             10,                                    // 关机所需的时间<br />
             TRUE,                                 // ask user to close apps<br />
             FALSE);                               //设为TRUE为重起，设为FALSE为关机<br />
	    if(!fResult)<br />
		{<br />
             MessageBox(&#8220;初始化系统关机失败！&#8221;);<br />
		}</p>
<p>	    tkp.Privileges[0].Attributes = 0;<br />
        AdjustTokenPrivileges(hToken, FALSE, &#038;tkp, 0,(PTOKEN_PRIVILEGES) NULL, 0);</p>
<p>	    if (GetLastError() != ERROR_SUCCESS)<br />
		{<br />
             MessageBox(&#8220;AdjustTokenPrivileges disable failed.&#8221;);<br />
		}</p>
<p>	    ExitWindowsEx(EWX_SHUTDOWN,0);</p>
<p class="announce"><span style="font-weight:bold;text-shadow:0 1px 0 #ddd;">声明:</span> 此Blog中的文章和随笔仅代表作者在某一特定时间内的观点和结论，对其完全的正确不做任何担保或假设 <br /> 本站文章均采用 <a rel="nofollow" href="http://creativecommons.org/licenses/by-nc-sa/3.0/" title="署名-非商业性使用-相同方式共享">知识共享署名-相同方式共享3.0</a> 协议进行授权，除非注明，本站文章均为原创，转载请注明转自  <a href="http://www.xiaozhou.net">Timothy&#039;s Space</a> 并应以链接形式标明本文地址!</p>]]></content:encoded>
			<wfw:commentRss>http://www.xiaozhou.net/vcdevelopment/to-adjust-the-current-process-permissions-and-shutdown-2004-10-21.htm/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>调整本进程权限核心代码</title>
		<link>http://www.xiaozhou.net/vcdevelopment/adjust-the-process-the-core-code-access-2004-10-10.htm</link>
		<comments>http://www.xiaozhou.net/vcdevelopment/adjust-the-process-the-core-code-access-2004-10-10.htm#comments</comments>
		<pubDate>Sun, 10 Oct 2004 14:42:49 +0000</pubDate>
		<dc:creator>Timothy</dc:creator>
				<category><![CDATA[VC开发]]></category>
		<category><![CDATA[access]]></category>
		<category><![CDATA[adjust]]></category>
		<category><![CDATA[Process]]></category>
		<category><![CDATA[权限]]></category>
		<category><![CDATA[核心代码]]></category>
		<category><![CDATA[调整]]></category>
		<category><![CDATA[进程]]></category>

		<guid isPermaLink="false">http://localhost/wordpress/?p=28</guid>
		<description><![CDATA[void EnablePrivilege() { HANDLE hProcess; HANDLE hCurrentProcess; HANDLE hProcessToken; TOKEN_PRIVILEGES tp; LUID luid; hCurrentProcess=GetCurrentProcess(); OpenProcessToken(hCurrentProcess,TOKEN_ALL_ACCESS,&#038;hProcessToken); LookupPrivilegeValue(NULL,&#8221;SeDebugPrivilege&#8221;,&#038;luid); tp.PrivilegeCount=1; tp.Privileges[0].Luid=luid; tp.Privileges[0].Attributes=SE_PRIVILEGE_ENABLED; AdjustTokenPrivileges( hProcessToken, FALSE, &#038;tp, sizeof(TOKEN_PRIVILEGES), (PTOKEN_PRIVILEGES)NULL, (PDWORD)NULL); } 声明: 此Blog中的文章和随笔仅代表作者在某一特定时间内的观点和结论，对其完全的正确不做任何担保或假设 本站文章均采用 知识共享署名-相同方式共享3.0 协议进行授权，除非注明，本站文章均为原创，转载请注明转自 Timothy&#039;s Space 并应以链接形式标明本文地址!]]></description>
			<content:encoded><![CDATA[<p>void EnablePrivilege()<br />
{<br />
	HANDLE hProcess;<br />
	HANDLE hCurrentProcess;<br />
	HANDLE hProcessToken;<br />
	TOKEN_PRIVILEGES tp;<br />
	LUID luid;<br />
	hCurrentProcess=GetCurrentProcess();<br />
	OpenProcessToken(hCurrentProcess,TOKEN_ALL_ACCESS,&#038;hProcessToken);<br />
	LookupPrivilegeValue(NULL,&#8221;SeDebugPrivilege&#8221;,&#038;luid);<br />
	tp.PrivilegeCount=1;<br />
	tp.Privileges[0].Luid=luid;<br />
	tp.Privileges[0].Attributes=SE_PRIVILEGE_ENABLED;<br />
	AdjustTokenPrivileges(<br />
		hProcessToken,<br />
		FALSE,<br />
		&#038;tp,<br />
		sizeof(TOKEN_PRIVILEGES),<br />
		(PTOKEN_PRIVILEGES)NULL,<br />
		(PDWORD)NULL);<br />
}</p>
<p class="announce"><span style="font-weight:bold;text-shadow:0 1px 0 #ddd;">声明:</span> 此Blog中的文章和随笔仅代表作者在某一特定时间内的观点和结论，对其完全的正确不做任何担保或假设 <br /> 本站文章均采用 <a rel="nofollow" href="http://creativecommons.org/licenses/by-nc-sa/3.0/" title="署名-非商业性使用-相同方式共享">知识共享署名-相同方式共享3.0</a> 协议进行授权，除非注明，本站文章均为原创，转载请注明转自  <a href="http://www.xiaozhou.net">Timothy&#039;s Space</a> 并应以链接形式标明本文地址!</p>]]></content:encoded>
			<wfw:commentRss>http://www.xiaozhou.net/vcdevelopment/adjust-the-process-the-core-code-access-2004-10-10.htm/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

