<?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>JEDI Windows API &#187; user</title>
	<atom:link href="http://blog.delphi-jedi.net/tag/user/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.delphi-jedi.net</link>
	<description>Joint Endeavor of Delphi Innovators of Windows Programming</description>
	<lastBuildDate>Sat, 21 Aug 2010 05:44:40 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=abc</generator>
		<item>
		<title>How to get the user&#8217;s SID.</title>
		<link>http://blog.delphi-jedi.net/2008/03/18/how-to-get-the-users-sid/</link>
		<comments>http://blog.delphi-jedi.net/2008/03/18/how-to-get-the-users-sid/#comments</comments>
		<pubDate>Tue, 18 Mar 2008 09:00:19 +0000</pubDate>
		<dc:creator>Christian Wimmer</dc:creator>
				<category><![CDATA[JEDI Windows Security Code Lib]]></category>
		<category><![CDATA[JWSCL]]></category>
		<category><![CDATA[Sid]]></category>
		<category><![CDATA[user]]></category>

		<guid isPermaLink="false">http://blog.delphi-jedi.net/2008/03/18/how-to-get-the-users-sid/</guid>
		<description><![CDATA[There is not much to write about how you can obtain the user&#8217;s SID. Use these members class TJwSecurityID in unit JwsclSid function JwSecurityCurrentThreadUserSID in unit JwsclKnownSID uses JwsclKnownSid, JwsclSid; var SID : TJwSecurityID; begin &#160; SID := JwSecurityCurrentThreadUserSID; &#160; WriteLn&#40;SID.GetText&#40;true&#41;&#41;; &#160; SID.Free; end; The SID is either obtained from the thread token or &#8211; [...]]]></description>
			<content:encoded><![CDATA[<p>There is not much to write about how you can obtain the user&#8217;s SID.</p>
<p><span id="more-78"></span></p>
<p>Use these members</p>
<ul>
<li>class <a href="http://jwscldoc.delphi-jedi.net/JwsclSid.TJwSecurityId.html">TJwSecurityID</a> in unit <a href="http://jwscldoc.delphi-jedi.net/JwsclSid.TJwSecurityId.html"></a><a href="http://jwscldoc.delphi-jedi.net/JwsclSid.html">JwsclSid</a></li>
<li>function <a href="http://jwscldoc.delphi-jedi.net/JwsclKnownSid.html#JwSecurityCurrentThreadUserSID">JwSecurityCurrentThreadUserSID</a> in unit <a href="http://jwscldoc.delphi-jedi.net/JwsclKnownSid.html#JwSecurityCurrentThreadUserSID"></a><a href="http://jwscldoc.delphi-jedi.net/JwsclKnownSid.html">JwsclKnownSID</a></li>
</ul>
<div class="dean_ch" style="white-space: wrap;"><span class="kw1">uses</span> JwsclKnownSid, JwsclSid;<br />
<span class="kw1">var</span> SID : TJwSecurityID;<br />
<span class="kw1">begin</span><br />
&nbsp; SID := JwSecurityCurrentThreadUserSID;<br />
&nbsp; <span class="kw3">WriteLn</span><span class="br0">&#40;</span>SID.<span class="me1">GetText</span><span class="br0">&#40;</span><span class="kw2">true</span><span class="br0">&#41;</span><span class="br0">&#41;</span>;<br />
&nbsp; SID.<span class="me1">Free</span>;<br />
<span class="kw1">end</span>;</div>
<p>The SID is either obtained from the thread token or &#8211; if it does not exist &#8211; from the process token.</p>
<p><strong>Tell me how you liked this blog entry by adding a comment.</strong></p>
<!-- PHP 5.x -->]]></content:encoded>
			<wfw:commentRss>http://blog.delphi-jedi.net/2008/03/18/how-to-get-the-users-sid/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>You cannot make your application undestroyable.</title>
		<link>http://blog.delphi-jedi.net/2008/03/17/you-cant-make-your-application-undestroyable/</link>
		<comments>http://blog.delphi-jedi.net/2008/03/17/you-cant-make-your-application-undestroyable/#comments</comments>
		<pubDate>Mon, 17 Mar 2008 22:24:57 +0000</pubDate>
		<dc:creator>Christian Wimmer</dc:creator>
				<category><![CDATA[JEDI Windows API Headers]]></category>
		<category><![CDATA[JWA]]></category>
		<category><![CDATA[KillProcess]]></category>
		<category><![CDATA[Laptop]]></category>
		<category><![CDATA[Process]]></category>
		<category><![CDATA[TerminateProcess]]></category>
		<category><![CDATA[user]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://blog.delphi-jedi.net/2008/03/17/you-cant-make-your-application-undestroyable/</guid>
		<description><![CDATA[The people from Microsoft decided that the user has to be in full control over the computer. So there is no assured way to make a program user resistant. She can always use TerminateProcess to forcibly kill the process. uses JwaWindows; function KillProcess&#40;const ProcessID : DWord&#41;: Boolean; var &#160; hProcess: HANDLE; begin &#160; hProcess := [...]]]></description>
			<content:encoded><![CDATA[<p>The people from Microsoft decided that the user has to be in full control over the computer. So there is no assured way to make a program user resistant. She can always use <a href="http://msdn2.microsoft.com/en-us/library/ms686714.aspx" title="Go to MSDN.">TerminateProcess</a> to forcibly kill the process.</p>
<p><span id="more-76"></span></p>
<div class="dean_ch" style="white-space: wrap;"><span class="kw1">uses</span> JwaWindows;</p>
<p><span class="kw1">function</span> KillProcess<span class="br0">&#40;</span><span class="kw1">const</span> ProcessID : <span class="kw4">DWord</span><span class="br0">&#41;</span>: <span class="kw4">Boolean</span>;<br />
<span class="kw1">var</span><br />
&nbsp; hProcess: HANDLE;<br />
<span class="kw1">begin</span><br />
&nbsp; hProcess := OpenProcess<span class="br0">&#40;</span>PROCESS_TERMINATE, &nbsp;<span class="kw2">False</span>, ProcessID<span class="br0">&#41;</span>;<br />
&nbsp; Result := TerminateProcess<span class="br0">&#40;</span>hProcess, <span class="nu0">0</span><span class="br0">&#41;</span>;<br />
<span class="kw1">end</span>;</div>
<p>Because nobody reads the remarks section of <a href="http://msdn2.microsoft.com/en-us/library/ms686714.aspx" title="Go to MSDN.">TerminateProcess</a>, I cite it here.</p>
<blockquote><p>The  <strong>TerminateProcess</strong> function is used to unconditionally cause a process to exit. The state of global data maintained by dynamic-link libraries (DLLs) may be compromised if <strong>TerminateProcess</strong> is used rather than  <a href="http://msdn2.microsoft.com/en-us/library/ms682658%28VS.85%29.aspx" onclick="javascript:Track('ctl00_rs1_mainContentContainer_ctl00|ctl00_rs1_mainContentContainer_ctl06',this);" id="ctl00_rs1_mainContentContainer_ctl06"><strong>ExitProcess</strong></a>.</p>
<p><strong>TerminateProcess</strong> initiates termination and returns immediately. This stops execution of all threads within the process and requests cancellation of all pending I/O. The terminated process cannot exit until all pending I/O has been completed or canceled.</p></blockquote>
<p><strong>And remind this little sentence.</strong></p>
<blockquote><p>A process cannot prevent itself from being terminated.</p></blockquote>
<p>However there are some reasons <u>not to make your application undestroyable</u>.</p>
<ol>
<li>The users don&#8217;t want it.</li>
<li>The work does not pay off. The user is going to close the app anyway.</li>
<li>Some people complain about apps that do not close when Windows is shutting down.</li>
<li>It&#8217;s also said that there were laptops which didn&#8217;t shutdown. The users put them into their bags and didn&#8217;t realize that the machine overheated eventually.</li>
<li>Vista closes your application in the end you have no veto.</li>
</ol>
<p><strong>Tell me how you liked this blog entry by adding a comment.</strong></p>
<!-- PHP 5.x -->]]></content:encoded>
			<wfw:commentRss>http://blog.delphi-jedi.net/2008/03/17/you-cant-make-your-application-undestroyable/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
