<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Antimail : .NET</title><link>http://blogs.msdn.com/adioltean/archive/tags/.NET/default.aspx</link><description>Tags: .NET</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>.NET Framework source code - public</title><link>http://blogs.msdn.com/adioltean/archive/2007/10/03/net-framework-source-code-public.aspx</link><pubDate>Wed, 03 Oct 2007 22:12:20 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:5266727</guid><dc:creator>AdiOltean</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/adioltean/comments/5266727.aspx</comments><wfw:commentRss>http://blogs.msdn.com/adioltean/commentrss.aspx?PostID=5266727</wfw:commentRss><description>&lt;p&gt;I sure hope that you will appreciate this - the .NET 3.5 source code will be &lt;a href="http://weblogs.asp.net/scottgu/archive/2007/10/03/releasing-the-source-code-for-the-net-framework-libraries.aspx "&gt;publicly released&lt;/a&gt;. Initially, we will see .NET BCL, ASP.NET, Windows Forms, ADO.NET, XML and WPF. Later, more libraries will be added (WCF - yes!), LINQ and Workflow. &lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=5266727" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/adioltean/archive/tags/Programming/default.aspx">Programming</category><category domain="http://blogs.msdn.com/adioltean/archive/tags/.NET/default.aspx">.NET</category></item><item><title>[RO] Seminar - Storage si programare distribuita</title><link>http://blogs.msdn.com/adioltean/archive/2007/05/03/ro-seminar-storage-si-programare-distribuita.aspx</link><pubDate>Thu, 03 May 2007 20:57:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:2397674</guid><dc:creator>AdiOltean</dc:creator><slash:comments>3</slash:comments><comments>http://blogs.msdn.com/adioltean/comments/2397674.aspx</comments><wfw:commentRss>http://blogs.msdn.com/adioltean/commentrss.aspx?PostID=2397674</wfw:commentRss><description>&lt;P&gt;&lt;A class="" href="http://blogs.msdn.com/florinlazar/" mce_href="http://blogs.msdn.com/florinlazar/"&gt;Florin Lazar&lt;/A&gt;, &lt;A class="" href="http://weblogs.studentclub.ro/members/todi.aspx" mce_href="http://weblogs.studentclub.ro/members/todi.aspx"&gt;Todi Pruteanu&lt;/A&gt; si cu mine am demarat in cursul acestei saptamani un seminar tehnic pe teme de storage in Vista si programare distribuita in WCF.&amp;nbsp;Mai multe detalii aici: &lt;A href="http://reg.studentclub.ro/"&gt;http://reg.studentclub.ro&lt;/A&gt;. &lt;/P&gt;
&lt;P&gt;Pana acum seminariile din Bucuresti si Cluj au avut un raspuns fantastic! Daca aveti opinii, impresii (pozitive sau negative) m-as bucura sa le puneti in sectiunea de comentarii...&lt;/P&gt;
&lt;P&gt;Si nu in ultimul rand, multumiri lui Todi si Microsoft Romania pentru organizarea acestui eveniment.&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=2397674" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/adioltean/archive/tags/Windows+Server/default.aspx">Windows Server</category><category domain="http://blogs.msdn.com/adioltean/archive/tags/Programming/default.aspx">Programming</category><category domain="http://blogs.msdn.com/adioltean/archive/tags/Click+or+miss/default.aspx">Click or miss</category><category domain="http://blogs.msdn.com/adioltean/archive/tags/.NET/default.aspx">.NET</category><category domain="http://blogs.msdn.com/adioltean/archive/tags/Questions/default.aspx">Questions</category><category domain="http://blogs.msdn.com/adioltean/archive/tags/VSS/default.aspx">VSS</category><category domain="http://blogs.msdn.com/adioltean/archive/tags/Vista/default.aspx">Vista</category></item><item><title>WS-Management? Already here in Vista!</title><link>http://blogs.msdn.com/adioltean/archive/2006/08/18/707162.aspx</link><pubDate>Sat, 19 Aug 2006 08:19:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:707162</guid><dc:creator>AdiOltean</dc:creator><slash:comments>6</slash:comments><comments>http://blogs.msdn.com/adioltean/comments/707162.aspx</comments><wfw:commentRss>http://blogs.msdn.com/adioltean/commentrss.aspx?PostID=707162</wfw:commentRss><description>&lt;p&gt;&lt;a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnglobspec/html/wsmgmtspecindex.asp"&gt;WS-Management&lt;/a&gt; is a new web services-based management protocol. It's SOAP-based of course, and it is compatible with the rest of the specifications in the WS-* Web Service stack, like WS-Transfer, WS-Enumeration, WS-Addressing. &lt;/p&gt; &lt;p&gt;WS-Management is enabled in Vista (and Longhorn Server) in several ways. &lt;/p&gt; &lt;ul&gt; &lt;li&gt;On the client side, you have a standard library (called WinRM) which can "consume" other WS-Management enabled interfaces. You could also use Indigo, or other web service frameworks to access the same services as well. Finally, there is a command-line tool also named WINRM which can be used to communicate with WS-Management enabled servers.  &lt;li&gt;On the server side, &lt;strong&gt;any&lt;/strong&gt; WMI class&amp;nbsp;can be made remotely accessible&amp;nbsp;through WS-Management. &lt;/li&gt;&lt;/ul&gt; &lt;p&gt;&lt;strong&gt;&lt;font size="4"&gt;Security&lt;/font&gt; &lt;/strong&gt;&lt;/p&gt; &lt;p&gt;WS-Management is securely enabled on Vista machines. To find out the security configuration of your machine (both for client and server) you can use WS-Management itself like in the command below:&lt;/p&gt; &lt;blockquote dir="ltr" style="margin-right: 0px"&gt; &lt;p&gt;&lt;font face="Courier New" size="2"&gt;C:\&amp;gt;winrm get winrm/config&lt;br&gt;Config&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; MaxEnvelopeSizekb = 150&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; MaxTimeoutms = 60000&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; MaxBatchItems = 20&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; MaxProviderRequests = 25&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Client&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; NetworkDelayms = 5000&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; URLPrefix = wsman&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AllowUnencrypted = false&lt;br&gt;&lt;font color="#ff0000"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Auth&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Basic = false&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Digest = true&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Kerberos = true&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Negotiate = true&lt;/font&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DefaultPorts&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; HTTP = 80&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; HTTPS = 443&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; TrustedHosts&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Service&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; RootSDDL = O:NSG:BAD:P(A;;GA;;;BA)(A;;GR;;;ER)S:P(AU;FA;GA;;;WD)(AU;SA;GWGX;;;WD)&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MaxConcurrentOperations = 100&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; EnumerationTimeoutms = 60000&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MaxConnections = 5&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AllowUnencrypted = false&lt;br&gt;&lt;font color="#ff0000"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Auth&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Basic = false&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Kerberos = true&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Negotiate = true&lt;/font&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DefaultPorts&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; HTTP = 80&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; HTTPS = 443&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; IPv4Filter = *&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; IPv6Filter = *&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Winrs&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AllowRemoteShellAccess = true&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; IdleTimeout = 900000&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MaxConcurrentUsers = 5&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MaxShellRunTime = 28800000&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MaxProcessesPerShell = 5&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MaxMemoryPerShellMB = 80&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MaxShellsPerUser = 2&lt;/font&gt;&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;By default, WS-Management is not enabled for remote access, Windows authentication is used by default on local acceess, and encryption is turned on. &lt;/p&gt; &lt;p&gt;You can enable remote access by typing:&lt;/p&gt; &lt;blockquote dir="ltr" style="margin-right: 0px"&gt; &lt;p&gt;&lt;font face="Courier New" size="2"&gt;C:\&amp;gt;&lt;font color="#ff0000"&gt;winrm quickconfig&lt;/font&gt;&lt;br&gt;WinRM is not set up to allow remote access to this machine for management.&lt;br&gt;The following changes must be made:&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font face="Courier New" size="2"&gt;Set the WinRM service type to delayed auto start.&lt;br&gt;Start the WinRM service.&lt;br&gt;Create a WinRM listener on HTTP://* to accept WS-Man requests to any IP on this machine.&lt;br&gt;Enable the WinRM firewall exception.&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font face="Courier New" size="2"&gt;Make these changes [y/n]? y&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font face="Courier New" size="2"&gt;WinRM has been updated for remote management.&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font face="Courier New" size="2"&gt;WinRM service type changed successfully.&lt;br&gt;WinRM service started.&lt;br&gt;Created a WinRM listener on HTTP://* to accept WS-Man requests to any IP on this machine.&lt;br&gt;WinRM firewall exception enabled.&lt;/font&gt;&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;The output above already illustrates one main advantages of web services - their flexibility with respect to firewall access. Say that you want to enable your current machine to accept incoming WS-Management SOAP requests through the port 80 (as HTTP requests). Then, all you need to do is opening port 80 and that's it! Also, NAT is not a problem, of course. &lt;/p&gt; &lt;p&gt;Try this type of&amp;nbsp;exercise when enabling DCOM through the firewall, and you'll have nightmares. This can get really complicated. Furthermore, DCOM doesn't really work in NAT environments.&lt;/p&gt; &lt;p&gt;&lt;font size="4"&gt;&lt;strong&gt;A simple example&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt; &lt;p&gt;At this point, you have a secure web service enabled on your machine, that you can then use to perform regular management queries, in WMI style. Let's get some information about a Windows service, like the status of the Spooler service. &amp;nbsp;&lt;/p&gt; &lt;p&gt;Note that I am doing a remote query - basically contacting the machine AOLTEAN-D2, through an internal, WS-Management&amp;nbsp;web service interface:&lt;/p&gt; &lt;p&gt;&lt;font face="Courier New" size="2"&gt;C:\&amp;gt;winrm &lt;strong&gt;&lt;font color="#ff0000"&gt;get&lt;/font&gt;&lt;/strong&gt; wmicimv2/&lt;font color="#ff0000"&gt;&lt;strong&gt;Win32_Service?Name=spooler&lt;/strong&gt;&lt;/font&gt; &lt;font color="#0000ff"&gt;-r:&lt;/font&gt;&lt;strong&gt;&lt;font color="#0000ff"&gt;aoltean-d2&lt;br&gt;&lt;/font&gt;&lt;/strong&gt;Win32_Service&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; AcceptPause = false&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; AcceptStop = true&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Caption = Print Spooler&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; CheckPoint = 0&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; CreationClassName = Win32_Service&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Description = Loads files to memory for later printing&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; DesktopInteract = true&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; DisplayName = Print Spooler&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ErrorControl = Normal&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ExitCode = 0&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; InstallDate = null&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Name = spooler&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; PathName = C:\Windows\System32\spoolsv.exe&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ProcessId = 1472&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ServiceSpecificExitCode = 0&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ServiceType = Own Process&lt;br&gt;&lt;font color="#ff0000"&gt;&lt;strong&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Started = true&lt;/strong&gt;&lt;/font&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; StartMode = Auto&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; StartName = LocalSystem&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; State = Running&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Status = OK&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SystemCreationClassName = Win32_ComputerSystem&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SystemName = AOLTEAN-D2&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; TagId = 0&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; WaitHint = 0&lt;/font&gt;&lt;/p&gt; &lt;p&gt;Well, it looks like the spooler service is started. We can&amp;nbsp;perform even more complicated queries, such as this one, to find the list of stopped services which are supposed to be started:&lt;/p&gt; &lt;p&gt;&lt;font face="Courier" size="1"&gt;C:\trace&amp;gt;winrm &lt;strong&gt;&lt;font color="#ff0000"&gt;enumerate&lt;/font&gt;&lt;/strong&gt; wmicimv2/* -filter:"&lt;font color="#ff0000"&gt;&lt;strong&gt;select * from win32_service where StartMode=\"Auto\" and State = \"Stopped\"&lt;/strong&gt;&lt;/font&gt; " -r:aoltean-d2&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font face="Courier" size="1"&gt;XmlFragment&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Win32_Service&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AcceptPause = false&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AcceptStop = false&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Caption = Media Center Service Launcher&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CheckPoint = 0&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CreationClassName = Win32_Service&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Description = Starts Media Center Scheduler and Media Center Receiver services at startup if TV is enabled within Media Center.&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DesktopInteract = false&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DisplayName = Media Center Service Launcher&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ErrorControl = Ignore&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ExitCode = 0&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; InstallDate = null&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Name = ehstart&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PathName = C:\Windows\system32\svchost.exe -k LocalServiceNoNetwork&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ProcessId = 0&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ServiceSpecificExitCode = 0&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ServiceType = Share Process&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Started = false&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; StartMode = Auto&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; StartName = NT AUTHORITY\LocalService&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; State = Stopped&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Status = OK&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SystemCreationClassName = Win32_ComputerSystem&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SystemName = AOLTEAN-D2&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; TagId = 0&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; WaitHint = 0&lt;br&gt;&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font face="Times New Roman" size="3"&gt;So, where&amp;nbsp;does WS-Management comes into play? At its roots, WS-Management is a simple management protocol that allows us to&amp;nbsp;operate with &lt;strong&gt;resources&lt;/strong&gt;. WS-Management defines a few operations on these resources:&lt;/font&gt;&lt;/p&gt; &lt;ol&gt; &lt;li&gt;&lt;font face="Times New Roman" size="3"&gt;&lt;strong&gt;Get resource properties &lt;/strong&gt;- this is used by the "winrm get ..." command above. We can see that we interrogate here a resoure (the "spooler" Windows service) and we obtain various properties like PathName, Started, etc.&lt;/font&gt;  &lt;li&gt;&lt;font face="Times New Roman" size="3"&gt;&lt;strong&gt;Enumerate resources &lt;/strong&gt;- this is a more complex command that allows us to enumerate several resources at once&lt;/font&gt;  &lt;li&gt;&lt;font face="Courier" size="1"&gt;&lt;font face="Times New Roman" size="3"&gt;&lt;strong&gt;Set properties&lt;/strong&gt; on a resource&lt;/font&gt;&lt;/font&gt; &lt;li&gt;&lt;font face="Times New Roman" size="3"&gt;&lt;strong&gt;Create &lt;/strong&gt;or &lt;strong&gt;delete &lt;/strong&gt;resources&lt;/font&gt;  &lt;li&gt;&lt;font face="Courier" size="1"&gt;&lt;font face="Times New Roman" size="3"&gt;&lt;strong&gt;Execute methods &lt;/strong&gt;on a resource, just like WMI methods.&lt;/font&gt;&lt;/font&gt;&lt;/li&gt;&lt;/ol&gt; &lt;p&gt;&lt;font face="Times New Roman" size="3"&gt;In some sense, resources can be viewed as "objects" in OOP point of view, and WS-Management defines a simple protocol to manipulate these "objects".&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font size="4"&gt;&lt;strong&gt;Under the hood&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font face="Times New Roman" size="3"&gt;So where do web services come into play? Can we peek into the actual management protocol? &lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font face="Times New Roman" size="3"&gt;With web services, it is actually easy - all we need to do is to use a network protocol analyzer to sniff the HTTP packets between client and the server. Ultimately, web service interactions are nothing more than exchanging XML packets using HTTP/HTTPS, so analyzing these interactions&amp;nbsp;is no more difficult than analyzing&amp;nbsp;HTTP request/response commands between a browser and a web server. &lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font face="Times New Roman" size="3"&gt;Let's take the GET command above (winrm get wmicimv2/Win32_Service?Name=spooler -r:aoltean-d2). In our case, the client program attempts to get the properties of a given resource&amp;nbsp;of type "wmicimv2/Win32_Service", identified by the selector "Name=spooler". &lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font face="Times New Roman" size="3"&gt;Let's dive in. With the network sniffer we obtain the following SOAP request message:&lt;/font&gt;&lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;&amp;lt;s:Envelope &lt;br&gt;&amp;nbsp;xmlns:s="&lt;a href="http://www.w3.org/2003/05/soap-envelope"&gt;http://www.w3.org/2003/05/soap-envelope&lt;/a&gt;" &lt;br&gt;&amp;nbsp;xmlns:a="&lt;a href="http://schemas.xmlsoap.org/ws/2004/08/addressing"&gt;http://schemas.xmlsoap.org/ws/2004/08/addressing&lt;/a&gt;" &lt;br&gt;&amp;nbsp;xmlns:w="&lt;a href="http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd"&gt;http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd&lt;/a&gt;"&amp;gt;&lt;br&gt;&amp;nbsp; &amp;lt;s:Header&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;a:To&amp;gt;http://aoltean-d2:80/wsman&amp;lt;/a:To&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;w:ResourceURI s:mustUnderstand="true"&amp;gt;http://schemas.microsoft.com/wbem/wsman/1/wmi/root/cimv2/Win32_Service&amp;lt;/w:ResourceURI&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;a:ReplyTo&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;a:Address s:mustUnderstand="true"&amp;gt;http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous&amp;lt;/a:Address&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/a:ReplyTo&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;a:Action s:mustUnderstand="true"&amp;gt;http://schemas.xmlsoap.org/ws/2004/09/transfer/Get&amp;lt;/a:Action&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;w:MaxEnvelopeSize s:mustUnderstand="true"&amp;gt;153600&amp;lt;/w:MaxEnvelopeSize&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;a:MessageID&amp;gt;uuid:2A553640-AA45-4BE1-8CE8-C3F20BD3C74E&amp;lt;/a:MessageID&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;w:Locale xml:lang="en-US" s:mustUnderstand="false" /&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;w:SelectorSet&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;w:Selector Name="Name"&amp;gt;spooler&amp;lt;/w:Selector&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/w:SelectorSet&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;w:OperationTimeout&amp;gt;PT60.000S&amp;lt;/w:OperationTimeout&amp;gt;&lt;br&gt;&amp;nbsp; &amp;lt;/s:Header&amp;gt;&lt;br&gt;&amp;nbsp; &amp;lt;s:Body&amp;gt;&amp;lt;/s:Body&amp;gt;&lt;br&gt;&amp;lt;/s:Envelope&amp;gt;&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;&lt;font face="Times New Roman" size="3"&gt;Correspondingly, the WS-Man response packet looks like this:&lt;/font&gt;&lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;&amp;lt;s:Envelope xml:lang="en-US" xmlns:s="&lt;a href="http://www.w3.org/2003/05/soap-envelope"&gt;http://www.w3.org/2003/05/soap-envelope&lt;/a&gt;" xmlns:a="&lt;a href="http://schemas.xmlsoap.org/ws/2004/08/addressing"&gt;http://schemas.xmlsoap.org/ws/2004/08/addressing&lt;/a&gt;" xmlns:w="&lt;a href="http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd"&gt;http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd&lt;/a&gt;"&amp;gt;&lt;br&gt;&amp;nbsp; &amp;lt;s:Header&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;a:Action&amp;nbsp; &amp;gt;http://schemas.xmlsoap.org/ws/2004/09/transfer/GetResponse&amp;lt;/a:Action&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;a:MessageID&amp;nbsp; &amp;gt;uuid:3E0BE062-2615-497E-BE6A-2FC7D5B7C9C3&amp;lt;/a:MessageID&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;a:To&amp;gt;http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous&amp;lt;/a:To&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;a:RelatesTo&amp;nbsp; &amp;gt;uuid:2A553640-AA45-4BE1-8CE8-C3F20BD3C74E&amp;lt;/a:RelatesTo&amp;gt;&lt;br&gt;&amp;nbsp; &amp;lt;/s:Header&amp;gt;&lt;br&gt;&amp;nbsp; &amp;lt;s:Body&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;p:Win32_Service xmlns:xsi="&lt;a href="http://www.w3.org/2001/XMLSchema-instance"&gt;http://www.w3.org/2001/XMLSchema-instance&lt;/a&gt;" xmlns:p="&lt;a href="http://schemas.microsoft.com/wbem/wsman/1/wmi/root/cimv2/Win32_Service"&gt;http://schemas.microsoft.com/wbem/wsman/1/wmi/root/cimv2/Win32_Service&lt;/a&gt;" xmlns:cim="&lt;a href="http://schemas.dmtf.org/wbem/wsman/1/base"&gt;http://schemas.dmtf.org/wbem/wsman/1/base&lt;/a&gt;" xsi:type="Win32_Service"&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;p:AcceptPause&amp;gt;false&amp;lt;/p:AcceptPause&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;p:AcceptStop&amp;gt;true&amp;lt;/p:AcceptStop&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;p:Caption&amp;gt;Print Spooler&amp;lt;/p:Caption&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;p:CheckPoint&amp;gt;0&amp;lt;/p:CheckPoint&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;p:CreationClassName&amp;gt;Win32_Service&amp;lt;/p:CreationClassName&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;p:Description&amp;gt;Loads files to memory for later printing&amp;lt;/p:Description&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;p:DesktopInteract&amp;gt;true&amp;lt;/p:DesktopInteract&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;p:DisplayName&amp;gt;Print Spooler&amp;lt;/p:DisplayName&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;p:ErrorControl&amp;gt;Normal&amp;lt;/p:ErrorControl&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;p:ExitCode&amp;gt;0&amp;lt;/p:ExitCode&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;p:InstallDate xsi:nil="true"/&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;p:Name&amp;gt;spooler&amp;lt;/p:Name&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;p:PathName&amp;gt;C:\Windows\System32\spoolsv.exe&amp;lt;/p:PathName&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;p:ProcessId&amp;gt;1596&amp;lt;/p:ProcessId&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;p:ServiceSpecificExitCode&amp;gt;0&amp;lt;/p:ServiceSpecificExitCode&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;p:ServiceType&amp;gt;Own Process&amp;lt;/p:ServiceType&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;p:Started&amp;gt;true&amp;lt;/p:Started&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;p:StartMode&amp;gt;Auto&amp;lt;/p:StartMode&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;p:StartName&amp;gt;LocalSystem&amp;lt;/p:StartName&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;p:State&amp;gt;Running&amp;lt;/p:State&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;p:Status&amp;gt;OK&amp;lt;/p:Status&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;p:SystemCreationClassName&amp;gt;Win32_ComputerSystem&amp;lt;/p:SystemCreationClassName&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;p:SystemName&amp;gt;AOLTEAN-D2&amp;lt;/p:SystemName&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;p:TagId&amp;gt;0&amp;lt;/p:TagId&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;p:WaitHint&amp;gt;0&amp;lt;/p:WaitHint&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/p:Win32_Service&amp;gt;&lt;br&gt;&amp;nbsp; &amp;lt;/s:Body&amp;gt;&lt;br&gt;&amp;lt;/s:Envelope&amp;gt;&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;&lt;font face="Times New Roman" size="3"&gt;That's it for now.&amp;nbsp;I hope that&amp;nbsp;in a future post I will cover the actual structure of WS-Management messages. &lt;/font&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=707162" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/adioltean/archive/tags/Windows+Server/default.aspx">Windows Server</category><category domain="http://blogs.msdn.com/adioltean/archive/tags/Programming/default.aspx">Programming</category><category domain="http://blogs.msdn.com/adioltean/archive/tags/.NET/default.aspx">.NET</category><category domain="http://blogs.msdn.com/adioltean/archive/tags/Script+recipes/default.aspx">Script recipes</category><category domain="http://blogs.msdn.com/adioltean/archive/tags/Storage/default.aspx">Storage</category><category domain="http://blogs.msdn.com/adioltean/archive/tags/Vista/default.aspx">Vista</category></item><item><title>How to do atomic writes in a file</title><link>http://blogs.msdn.com/adioltean/archive/2005/12/28/507866.aspx</link><pubDate>Thu, 29 Dec 2005 01:51:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:507866</guid><dc:creator>AdiOltean</dc:creator><slash:comments>5</slash:comments><comments>http://blogs.msdn.com/adioltean/comments/507866.aspx</comments><wfw:commentRss>http://blogs.msdn.com/adioltean/commentrss.aspx?PostID=507866</wfw:commentRss><description>&lt;P&gt;Let's assume that you want is to write some simple code that writes to a text file. A few assumptions:&lt;BR&gt;1) You&amp;nbsp;need avoid corruptions&amp;nbsp;of any&amp;nbsp;kind.&amp;nbsp;&lt;BR&gt;2) Either all of your writes have to make it to the disk, or none of them. &lt;BR&gt;3) The file is updated serially&amp;nbsp;- no concurrent updates from separate processes are allowed. So only one process writes to the file at a time.&lt;BR&gt;4) No, you cannot use cool new techologies like &lt;A href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/transact/fs/portal.asp"&gt;TxF&lt;/A&gt;. &lt;/P&gt;
&lt;P&gt;Remember, all you want is just to write to a text file - no fancy code allowed. &lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;What are the possible problems?&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Many people mistakenly think that writing to a file is an atomic operation. In other words, this sequence of function calls is not going to cause garbage in your file. Wrong. Can you guess why? (don't peek ahead for the response). &lt;/P&gt;
&lt;BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px"&gt;
&lt;P&gt;&lt;FONT face="Courier New" size=2&gt;echo This is a string &amp;gt;&amp;gt; TestFile.txt&lt;/FONT&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P dir=ltr style="MARGIN-RIGHT: 0px"&gt;The problem is that the actual write operation is not atomic. A potential problem is when the machine reboots during actual write. Let's assume that your file write is ultimately causing two disk sectors to be overwritten with data. Let's even assume that each of these sectors is part of a different NTFS clusters, and these two clusters are part of the same TestfFile.txt file. The end of the first sector contains the string "This is" and the beginnning of the second sector "a string". What if&amp;nbsp;one of&amp;nbsp;the corresponding&amp;nbsp;hardware write commands to write these sectors is lost, for example&amp;nbsp;due to a machine reboot? You&amp;nbsp;ended up with only&amp;nbsp;one of these sectors overwritten, but not the other. Corruption!&lt;/P&gt;
&lt;P&gt;Now, when the machine reboots, there will be no recovery at the file contents level. This is by design with NTFS, FAT, and in fact with most file systems, irrespective to the operating systems.&amp;nbsp;The vast majority of&amp;nbsp;file systems do &lt;STRONG&gt;not &lt;/STRONG&gt;support atomicity in data updates. (That said, note that NTFS does have recovery at the metadata level - in other words, updates concerning file system metadata are always atomic. The NTFS metadata will not become corrupted during a sudden reboot) &lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;The black magic of caching&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;So in conclusion you might end up with the first sector written, but not with the second sector. Even if&amp;nbsp;you are aware of this problem you might still mistakenly think that the first sector is always written &lt;STRONG&gt;before &lt;/STRONG&gt;the second one. In other words, assuming that "this is" is always written before "a string" in the code below: &lt;/P&gt;
&lt;BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px"&gt;
&lt;P dir=ltr style="MARGIN-RIGHT: 0px"&gt;&lt;FONT style="BACKGROUND-COLOR: #ffffff" color=#000080&gt;&lt;SPAN style="COLOR: blue"&gt;&lt;FONT face="Courier New" size=2&gt;using&lt;/FONT&gt;&lt;/SPAN&gt;&lt;FONT face="Courier New"&gt;&lt;FONT size=2&gt;&lt;FONT color=#000000&gt; System;&lt;BR&gt;&lt;/FONT&gt;&lt;SPAN style="COLOR: blue"&gt;using&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New"&gt;&lt;FONT size=2&gt;&lt;FONT color=#000000&gt; System.IO;&lt;BR&gt;&lt;BR&gt;&lt;/FONT&gt;&lt;SPAN style="COLOR: blue"&gt;class&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New"&gt;&lt;FONT size=2&gt;&lt;FONT color=#000000&gt; Test &lt;BR&gt;{&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;&lt;SPAN style="COLOR: blue"&gt;public&lt;/SPAN&gt;&lt;FONT color=#000000&gt; &lt;/FONT&gt;&lt;SPAN style="COLOR: blue"&gt;static&lt;/SPAN&gt;&lt;FONT color=#000000&gt; &lt;/FONT&gt;&lt;SPAN style="COLOR: blue"&gt;void&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New"&gt;&lt;FONT size=2&gt;&lt;FONT color=#000000&gt; Main() &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;&lt;SPAN style="COLOR: blue"&gt;using&lt;/SPAN&gt;&lt;FONT color=#000000&gt; (StreamWriter sw = &lt;/FONT&gt;&lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" color=#000000 size=2&gt; StreamWriter("TestFile.txt")) &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/FONT&gt;&lt;FONT face="Courier New" color=#000000 size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sw.Write("This is");&lt;BR&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" color=#000000 size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;FONT face="Courier New" color=#000000 size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sw.Write("a string");&lt;BR&gt;&lt;/FONT&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR&gt;}&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;This assumption is again wrong. You again can have a rare situation where the machine crashes during your update, and "a string" can end up in the file, but "This is" not saved. Why? &lt;/P&gt;
&lt;P&gt;One&amp;nbsp;potential explanation is related with the caching activity. Caching happens at various layers in the storage stack. The .NET Framework performs its own caching in the Write&amp;nbsp;method above. This can interfere with your actual intended order of writes. &lt;/P&gt;
&lt;P&gt;So let's ignore .NET and let's present a&amp;nbsp;second example, this time using pure Win32 APIs: &lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size=2&gt;&amp;nbsp;&amp;nbsp; WCHAR wszString1[] = "This is";&lt;BR&gt;&amp;nbsp;&amp;nbsp; WCHAR wszString2[] = "a string";&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size=2&gt;&amp;nbsp;&amp;nbsp; fSuccess = WriteFile(hTempFile, wszString1, sizeof(WCHAR) * wcslen(wszString1), &amp;amp;dwBytesWritten, NULL); &lt;BR&gt;&amp;nbsp;&amp;nbsp; if (!fSuccess)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ...&lt;BR&gt;&amp;nbsp;&amp;nbsp; fSuccess = WriteFile(hTempFile, wszString2, sizeof(WCHAR) * wcslen(wszString2), &amp;amp;dwBytesWritten, NULL);&lt;/FONT&gt; &lt;/P&gt;
&lt;P&gt;Again, here you can also have caching at the operating system level, in the Cache Manager, where the file contents&amp;nbsp;can be&amp;nbsp;split across several in-memory data blocks. These blocks are not guaranteed to be written in their natural order.&amp;nbsp;For example, the lazy writer thread (a special thread used by Cache Manager that flushes unused pages to disk) can cause an out-of-order flush. There are other considerations that can cause an out-of-order data flush, but in general you need to be aware that any cache layers in your I/O can cause writes to be randomly reordered. &lt;/P&gt;
&lt;P&gt;The same reasoning applies to&amp;nbsp;our third example: &lt;/P&gt;
&lt;BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px"&gt;
&lt;P&gt;&lt;FONT face="Courier New" size=2&gt;echo This is&amp;nbsp; &amp;gt;&amp;gt; TestFile.txt&lt;BR&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;echo a string &amp;gt;&amp;gt; TestFile.txt&lt;/FONT&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Again, you cannot be sure that the file will not end up corrupted - you can have rare scenarios where the resultant file with contain either the word "This" or the word "string" but not both! &lt;/P&gt;
&lt;P&gt;The solution? One idea is to use special write modes like &lt;A href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wcedata5/html/wce50lrfCreateFile.asp"&gt;FILE_FLAG_WRITE_THROUGH&lt;/A&gt;&amp;nbsp;or FILE_FLAG_NO_BUFFERING, although in these cases you lose the obvious benefit of caching. You have to pass these flags to CreateFile(). Another idea is to manually flush the file contents through the FlushFileBuffers API. &lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;So, how to do atomic writes, then? &lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;From the example above, it looks like it is entirely possible that our writes migth complete partially, even if this case is extremely rare. How we can make sure that these writes are remaining atomic? In other words, my write to this file should either result in the entire write being present in the file, or no write should be present at all. Seems like an impossible problem, but that's not the case. &lt;/P&gt;
&lt;P&gt;The solution? Let's remember that metadata changes are atomic. Rename is such a case. So, we can just perform the write to a temporary file, and after we know that the writes are on the disk (completed and flushed) then we can interchange the old file with the new file. Something like the sequence below (I used generic shell commands like copy/ren/del below but in reality you need to call the equivalent Win32 APIs):&lt;/P&gt;
&lt;P&gt;Write process (on Foo.txt): &lt;BR&gt;- Step W1: Acquire "write lock" on the existing file. (this is usually part of your app semantics, so you might not need any Win32 APIs here)&lt;BR&gt;- Step W2: Copy the old file in a new temporary file. (copy Foo.txt Foo.Tmp.txt)&lt;BR&gt;- Step W3: Apply the writes to the new file (Foo.Tmp.txt). &lt;BR&gt;- Step W4: Flush all the writes (for example those being remaining in the cache manager). &lt;BR&gt;- Step W5: Rename the old file in an Alternate form (ren Foo.txt Foo.Alt.txt)&lt;BR&gt;- Step W6: Rename the new file into the old file (ren Foo.Tmp.txt Foo.txt)&lt;BR&gt;- Step W7: Delete the old Alternate file (del Foo.Alt.txt)&lt;BR&gt;- Step W8: Release "write lock" on the existing file. &lt;/P&gt;
&lt;P&gt;This solution has now another drawback - what if the machine reboots, or your application crashes? You end up either with an additional Tmp or Alt file, or with a missing Foo.txt but with one or two temporary files like Foo.Alt.txt or Foo.Tmp.txt). So you need some sort of recovery process that would transparently "revert" the state of this file to the correct point in time. Here is a potential recovery process:&lt;/P&gt;
&lt;P&gt;Recovery from a crash during write (on Foo.txt): &lt;BR&gt;- Step R1: If Foo.txt is missing but we have both Foo.Alt.txt and Foo.Tmp.txt present, then we crashed between Step W5 and Step W6. Retry from Step W6. &lt;BR&gt;- Step R2: If Foo.txt is present but Foo.Tmp.txt is also present, then we crashed before Step W5. Delete the Foo.Tmp.txt file. &lt;BR&gt;- Step R3: If Foo.txt is present but Foo.Alt.txt is also present, then we crashed between Step W6 and Step W7. Delete the Foo.Alt.txt file. &lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;More and more problems...&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;The sequence of operations above looks good, but we are not done yet. Why? Sometimes shell operations like Delete, Rename can fail for various reasons. &lt;/P&gt;
&lt;P&gt;For example, it might just happen that an antivirus or content indexing application randomly scans the whole file system once in a while. So, potentially, the file Foo.Tmp.txt will be opened for a short period which will cause either the step W7 or R1..R3 to fail due to the failed delete. And, not only that, but also Rename can fail if the old file already exists, and someone has an open handle on it. So even the steps W2 or W5 can fail too...&lt;/P&gt;
&lt;P&gt;The fix would be to always use unique temporary file names. In addition, during the recovery process, we will want to clean up all the "garbage" from previous temporary file leftovers. So, instead of files like Foo.Tmp.txt or Foo.Alt.txt, we should use Foo.TmpNNNN.txt and Foo.AltNNNN.txt, together with a smart algorithm to clean up the remaining "garbage" during recovery. Here is the overall algorithm: &lt;/P&gt;
&lt;P&gt;Write process (on Foo.txt): &lt;BR&gt;- Step W1: Acquire "write lock" on the existing file. &lt;BR&gt;- Step W2: Copy the old file in a new unique temporary file. (copy Foo.txt Foo.TmpNNNN.txt)&lt;BR&gt;- Step W3: Apply the writes to the new file (Foo.TmpNNNN.txt). &lt;BR&gt;- Step W4: Flush all the writes (for example those being remaining in the cache manager). &lt;BR&gt;- Step W5: Rename the old file in a new unique Alternate form (ren Foo.txt Foo.AltNNNN.txt)&lt;BR&gt;- Step W6: Rename the new file into the old file (ren Foo.TmpNNNN.txt Foo.txt)&lt;BR&gt;- Step W7: Delete the old Alternate file (del Foo.AltNNNN.txt). If this fails, simply ignore. The file will be deleted later during the next recovery. &lt;BR&gt;- Step W8: Release "write lock" on the existing file. &lt;/P&gt;
&lt;P&gt;Recovery from a crash during write (on Foo.txt): &lt;BR&gt;- Step R1: If Foo.txt is missing but we have both Foo.AltNNNN.txt and Foo.TmpNNNN.txt present, then we crashed between Step W5 and Step W6. Retry from Step W6. &lt;BR&gt;- Step R2: If Foo.txt is present but Foo.TmpNNNN.txt is also present, then we crashed before Step W5. Try to delete all Foo.TmpNNNN.txt files and ignore failures. &lt;BR&gt;- Step R3: If Foo.txt is present but Foo.AltNNNN.txt is also present, then we crashed between Step W6 and Step W7. Try to delete all Foo.AltNNNN.txt files and ignore failures.&lt;/P&gt;
&lt;P&gt;That's it! &lt;BR&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=507866" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/adioltean/archive/tags/Windows+Server/default.aspx">Windows Server</category><category domain="http://blogs.msdn.com/adioltean/archive/tags/Programming/default.aspx">Programming</category><category domain="http://blogs.msdn.com/adioltean/archive/tags/.NET/default.aspx">.NET</category><category domain="http://blogs.msdn.com/adioltean/archive/tags/Script+recipes/default.aspx">Script recipes</category><category domain="http://blogs.msdn.com/adioltean/archive/tags/Windows+XP/default.aspx">Windows XP</category><category domain="http://blogs.msdn.com/adioltean/archive/tags/Storage/default.aspx">Storage</category></item><item><title>Did you know that MySpace.com runs ASP.NET 2.0 on x64?</title><link>http://blogs.msdn.com/adioltean/archive/2005/12/06/500884.aspx</link><pubDate>Wed, 07 Dec 2005 10:21:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:500884</guid><dc:creator>AdiOltean</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/adioltean/comments/500884.aspx</comments><wfw:commentRss>http://blogs.msdn.com/adioltean/commentrss.aspx?PostID=500884</wfw:commentRss><description>&lt;P class=ArticleBody page="1"&gt;I found this &lt;A href="http://www.infoworld.com/article/05/12/06/HNwebplatform_1.html"&gt;quote&lt;/A&gt; interesting: &lt;/P&gt;
&lt;BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px"&gt;
&lt;P class=ArticleBody page="1"&gt;&lt;EM&gt;The Internet Information Services 6.0 Web server featured in the OS has been enhanced with 64-bit support. This provides access to more memory and scalability for applications, Goldfarb said. "In high-performance scenarios, it's very, very important." &lt;/EM&gt;&lt;/P&gt;
&lt;P class=ArticleBody page="1"&gt;&lt;EM&gt;64-bit computing translates to needing fewer servers, requiring less management and lower licensing costs, Goldfarb said. Also included in Internet Information Services is a Web-security configuration wizard for setting security levels in Web applications. &lt;/EM&gt;&lt;/P&gt;
&lt;P class=ArticleBody page="1"&gt;&lt;EM&gt;&lt;FONT color=#ff0000&gt;Support for 64 bits in ASP.Net 2.0, meanwhile, has enabled MySpace.com, which runs a high-volume social networking portal, to consolidate operations from approximately 100 multiprocessor systems to 33 of these systems, said Aber Whitcomb, CTO at MySpace.com.&lt;/FONT&gt; The company has been using ASP.Net 2.0 with an earlier version of Windows. &lt;/EM&gt;&lt;/P&gt;
&lt;P class=ArticleBody page="1"&gt;&lt;EM&gt;"With 64-bit hardware, you can increase your memory footprint from 4GB on a single server to in our case, up to 16GB, but you can go a lot further than that," Whitcomb said. &lt;FONT color=#ff0000&gt;MySpace.com describes itself as the third most trafficked site on the Internet, with 11.5 billion page views in October alone. &lt;/FONT&gt;&lt;/EM&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=500884" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/adioltean/archive/tags/Windows+Server/default.aspx">Windows Server</category><category domain="http://blogs.msdn.com/adioltean/archive/tags/.NET/default.aspx">.NET</category><category domain="http://blogs.msdn.com/adioltean/archive/tags/Questions/default.aspx">Questions</category><category domain="http://blogs.msdn.com/adioltean/archive/tags/Web+Search/default.aspx">Web Search</category></item><item><title>SSE - an RSS extension for two-way synchronization</title><link>http://blogs.msdn.com/adioltean/archive/2005/11/21/495386.aspx</link><pubDate>Mon, 21 Nov 2005 23:25:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:495386</guid><dc:creator>AdiOltean</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/adioltean/comments/495386.aspx</comments><wfw:commentRss>http://blogs.msdn.com/adioltean/commentrss.aspx?PostID=495386</wfw:commentRss><description>&lt;P&gt;Ray Ozzie mentioned an interesting &lt;A href="javascript:OpenSection('permalink','cns!1pyct_cYtbBtOBPDVAumMEdw!175');"&gt;variation&lt;/A&gt; of the RSS protocol. RSS is essentially a one-way synchronization protocol. What it would take to&amp;nbsp;change the&amp;nbsp;RSS standard in a very minimal way, such that it will work for two-way replication. A simple idea, with very deep implications. The new RSS is now called SSE: Simple Sharing Extensions. You need relatively little programming work to implement it. &lt;/P&gt;
&lt;P&gt;In the preliminary discussions, Dave Winer immediately pointed out another interesting extension, for something he wanted for some time: how to cross-update OPML files. &lt;/P&gt;
&lt;P&gt;Here is the &lt;A href="http://msdn.microsoft.com/xml/rss/sse"&gt;SSE draft&lt;/A&gt; and a &lt;A href="http://msdn.microsoft.com/xml/rss/ssefaq"&gt;FAQ&lt;/A&gt;. &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=495386" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/adioltean/archive/tags/Programming/default.aspx">Programming</category><category domain="http://blogs.msdn.com/adioltean/archive/tags/.NET/default.aspx">.NET</category><category domain="http://blogs.msdn.com/adioltean/archive/tags/Web+Search/default.aspx">Web Search</category></item><item><title>Singularity - a new research OS from Microsoft</title><link>http://blogs.msdn.com/adioltean/archive/2005/11/06/489581.aspx</link><pubDate>Sun, 06 Nov 2005 20:40:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:489581</guid><dc:creator>AdiOltean</dc:creator><slash:comments>3</slash:comments><comments>http://blogs.msdn.com/adioltean/comments/489581.aspx</comments><wfw:commentRss>http://blogs.msdn.com/adioltean/commentrss.aspx?PostID=489581</wfw:commentRss><description>&lt;P&gt;Here it is: &lt;A href="http://research.microsoft.com/os/singularity/"&gt;http://research.microsoft.com/os/singularity/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;There are several interesting ideas in this new operating system. It's not just an "OS written in managed code". There are a new set of techniques in modern software development: contracts, verifiability and static analysis. Singularity combines them in an elegant framework, and applies these notions in the operating system development. New areas that benefit from these new techniques are, for example, writing device drivers.&lt;/P&gt;
&lt;P&gt;P.S. There is also a technical report &lt;A href="ftp://ftp.research.microsoft.com/pub/tr/TR-2005-135.pdf"&gt;here&lt;/A&gt; - a must-read for anyone interested in operating system research. &lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=489581" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/adioltean/archive/tags/Windows+Server/default.aspx">Windows Server</category><category domain="http://blogs.msdn.com/adioltean/archive/tags/Programming/default.aspx">Programming</category><category domain="http://blogs.msdn.com/adioltean/archive/tags/.NET/default.aspx">.NET</category><category domain="http://blogs.msdn.com/adioltean/archive/tags/Windows+XP/default.aspx">Windows XP</category></item><item><title>.NET FX 2.0 available for download</title><link>http://blogs.msdn.com/adioltean/archive/2005/10/28/486407.aspx</link><pubDate>Fri, 28 Oct 2005 23:42:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:486407</guid><dc:creator>AdiOltean</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/adioltean/comments/486407.aspx</comments><wfw:commentRss>http://blogs.msdn.com/adioltean/commentrss.aspx?PostID=486407</wfw:commentRss><description>&lt;A href="http://msdn.microsoft.com/netframework/downloads/updates/default.aspx"&gt;http://msdn.microsoft.com/netframework/downloads/updates/default.aspx&lt;/A&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=486407" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/adioltean/archive/tags/Programming/default.aspx">Programming</category><category domain="http://blogs.msdn.com/adioltean/archive/tags/.NET/default.aspx">.NET</category></item><item><title>How big is Hotmail?</title><link>http://blogs.msdn.com/adioltean/archive/2005/09/22/473173.aspx</link><pubDate>Fri, 23 Sep 2005 08:41:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:473173</guid><dc:creator>AdiOltean</dc:creator><slash:comments>6</slash:comments><comments>http://blogs.msdn.com/adioltean/comments/473173.aspx</comments><wfw:commentRss>http://blogs.msdn.com/adioltean/commentrss.aspx?PostID=473173</wfw:commentRss><description>&lt;P&gt;Huge. Here is some data from a&amp;nbsp;PDC Hotmail &lt;A href="http://216.55.183.63/pdc2005/slides/PRSL02_Hsueh.ppt"&gt;presentation&lt;/A&gt;:&lt;/P&gt;
&lt;LI&gt;~200 million active users 
&lt;LI&gt;3.3 billion inbound emails a day 
&lt;UL class=Text&gt;
&lt;LI&gt;1.5 billion blocked at the router 
&lt;LI&gt;1.0 billion deleted as spam (never hits the user's mailbox) 
&lt;LI&gt;0.5 billion sent to the junk folder&lt;/LI&gt;&lt;/UL&gt;
&lt;LI&gt;Over 100 million messages sent a day 
&lt;LI&gt;80 - 100 milllion logins per day 
&lt;LI&gt;5000 peak logins per second 
&lt;P&gt;But the most interesting part in this PPT is the new FrontEnd design. It is based on the Atlas framework. The&amp;nbsp;client code (Javascript&amp;nbsp; - in&amp;nbsp;the&amp;nbsp;browser) is able&amp;nbsp;to call into front-end components (written in C#). The requirements for the&amp;nbsp;protocol are interesting: minimize the data on wire, purely asynchronous processing at the server side. All this combined with an OOP component framework. &lt;/P&gt;&lt;/LI&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=473173" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/adioltean/archive/tags/Programming/default.aspx">Programming</category><category domain="http://blogs.msdn.com/adioltean/archive/tags/.NET/default.aspx">.NET</category><category domain="http://blogs.msdn.com/adioltean/archive/tags/Questions/default.aspx">Questions</category><category domain="http://blogs.msdn.com/adioltean/archive/tags/Web+Search/default.aspx">Web Search</category></item><item><title>LINQ: a post-modern revolution in software development</title><link>http://blogs.msdn.com/adioltean/archive/2005/09/13/465471.aspx</link><pubDate>Wed, 14 Sep 2005 09:09:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:465471</guid><dc:creator>AdiOltean</dc:creator><slash:comments>4</slash:comments><comments>http://blogs.msdn.com/adioltean/comments/465471.aspx</comments><wfw:commentRss>http://blogs.msdn.com/adioltean/commentrss.aspx?PostID=465471</wfw:commentRss><description>&lt;P&gt;Arguably, LINQ (Language Integrated Query) will be the next major revolution in programming languages. LINQ is a language-independent, platform-independent technology&amp;nbsp;that solves an old problem - data&amp;nbsp;queries in your code-&amp;nbsp;in a very elegant way. First, it brings a highly declarative approach in performing queries and data-bindings. Second, it is strongly typed at compile time. Third, it is easily extensible for any type of data stores (databases, XML documents, or anything else). &lt;/P&gt;
&lt;P&gt;I personally view&amp;nbsp;LINQ&amp;nbsp;as the SQL language of the XXI century. I won't be surprised to see the same idea propagated in any modern strongly-typed programming language (for example Java).&lt;/P&gt;
&lt;P&gt;To illustrate its full power, we will present a simple LINQ query, in C# 3.0: &amp;nbsp;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 8pt 0.5in"&gt;&lt;FONT face="Lucida Console" size=2&gt;Northwind db = &lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt; Northwind(&lt;SPAN style="COLOR: maroon"&gt;"c:\\northwind\\northwnd.mdf"&lt;/SPAN&gt;);&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 8pt 0.5in"&gt;&lt;FONT size=2&gt;&lt;FONT face="Lucida Console"&gt;&lt;SPAN style="COLOR: blue"&gt;var&lt;/SPAN&gt; q =&lt;BR&gt;&lt;SPAN style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;from&lt;/SPAN&gt; c &lt;SPAN style="COLOR: blue"&gt;in&lt;/SPAN&gt; db.Customers&lt;BR&gt;&lt;SPAN style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;where&lt;/SPAN&gt; c.City == &lt;SPAN style="COLOR: maroon"&gt;"London"&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;select&lt;/SPAN&gt; c;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 8pt 0.5in"&gt;&lt;FONT size=2&gt;&lt;FONT face="Lucida Console"&gt;&lt;SPAN style="COLOR: blue"&gt;foreach&lt;/SPAN&gt; (&lt;SPAN style="COLOR: blue"&gt;var&lt;/SPAN&gt; cust &lt;SPAN style="COLOR: blue"&gt;in&lt;/SPAN&gt; q)&lt;BR&gt;&lt;SPAN style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;Console.WriteLine(&lt;SPAN style="COLOR: maroon"&gt;"id = {0}, City = {1}"&lt;/SPAN&gt;,cust.CustomerID, cust.City);&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;Everything you see here is strongly typed. All the data bindings (the Customer data structure to the Customer table) are done at compile time. Not only that the generated code is extremely fast, but the language integration is natural. &lt;/P&gt;
&lt;P&gt;Under the cover, there is a lot going on. First of all, the "Customers" property above is inferred at compile time as being the Customers table from the Northwind database. The associated fields (CustomerID, City) are&amp;nbsp;inferred as columns in the Customers database. &lt;/P&gt;
&lt;P&gt;All the type assignments&amp;nbsp;are done at compile time, including the type binding for every field. For example,&amp;nbsp;don't be fooled by the "var q" declaration above. It is not a type-less variable like in JScript. Rather, the "q" variable has a well-defined type: a list/array of structures identifying query records, each of them being a well-defined structure, with strongly-typed fields (whose typeis inferred from the database or XML schema). &lt;/P&gt;
&lt;P&gt;The same technology can be extended efficiently to do&amp;nbsp;declarative data manipulation directly in the query. For example, the following code:&lt;/P&gt;&lt;FONT size=2&gt;&lt;FONT face="Lucida Console"&gt;&lt;SPAN style="COLOR: blue"&gt;
&lt;P class=Code style="MARGIN: 0in 0in 8pt 0.5in"&gt;&lt;SPAN style="COLOR: blue"&gt;var&lt;/SPAN&gt;&lt;FONT color=#000000&gt; q =&lt;BR&gt;&lt;SPAN style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/FONT&gt;&lt;SPAN style="COLOR: blue"&gt;from&lt;/SPAN&gt;&lt;FONT color=#000000&gt; c in db.Customers, o &lt;/FONT&gt;&lt;SPAN style="COLOR: blue"&gt;in&lt;/SPAN&gt;&lt;FONT color=#000000&gt; db.Orders&lt;BR&gt;&lt;SPAN style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/FONT&gt;&lt;SPAN style="COLOR: blue"&gt;where&lt;/SPAN&gt;&lt;FONT color=#000000&gt; c.CustomerId == o.CustomerID &amp;amp;&amp;amp; c.City == &lt;/FONT&gt;&lt;SPAN style="COLOR: maroon"&gt;"London"&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN style="mso-tab-count: 1"&gt;&lt;FONT color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;select&lt;/SPAN&gt;&lt;FONT color=#000000&gt; o; &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;will be used to construct&amp;nbsp;under the covers a true SQL Join statement, binding the Customers and Orders tables. It's that simple!&lt;/P&gt;
&lt;P&gt;I think that programmers that are doing database programming, or XML&amp;nbsp;processing will love it. &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;More links on LINQ&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;- LINQ home &lt;A href="http://msdn.microsoft.com/netframework/future/linq/"&gt;page&lt;/A&gt; on MSDN. This is the most comprehensive page.&lt;BR&gt;- LINQ project &lt;A href="http://download.microsoft.com/download/c/f/b/cfbbc093-f3b3-4fdb-a170-604db2e29e99/linq%20project%20overview.doc"&gt;overview&lt;/A&gt;. &amp;nbsp;&lt;BR&gt;- LINQ &lt;A href="http://msdn.microsoft.com/vcsharp/future/linqsamples/"&gt;samples&lt;/A&gt; in C#.&lt;BR&gt;- LINQ downloadable preview (compiler, samples, and more!) &lt;A href="http://download.microsoft.com/download/4/7/0/4703eba2-78c4-4b09-8912-69f6c38d3a56/LINQ%20Preview.msi"&gt;here&lt;/A&gt;.&lt;BR&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=465471" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/adioltean/archive/tags/Programming/default.aspx">Programming</category><category domain="http://blogs.msdn.com/adioltean/archive/tags/.NET/default.aspx">.NET</category></item><item><title>ECMA standards now aligned with the new Whidbey, C# 2.0</title><link>http://blogs.msdn.com/adioltean/archive/2005/08/03/447340.aspx</link><pubDate>Wed, 03 Aug 2005 22:12:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:447340</guid><dc:creator>AdiOltean</dc:creator><slash:comments>4</slash:comments><comments>http://blogs.msdn.com/adioltean/comments/447340.aspx</comments><wfw:commentRss>http://blogs.msdn.com/adioltean/commentrss.aspx?PostID=447340</wfw:commentRss><description>&lt;P&gt;Few days ago, ECMA &lt;A href="http://biz.yahoo.com/prnews/050727/uktu014.html?.v=20"&gt;approved&lt;/A&gt; the third edition of the C# and CLI standards. This aligns the language and runtime to the latest&amp;nbsp;enhancements in Whidbey, like generics, nullable types, etc.&lt;/P&gt;
&lt;P&gt;The effects of this standard approval are almost immediate - Miguel de Icaza &lt;A href="http://tirania.org/blog/archive/2005/Jul-28-2.html"&gt;mentioned&lt;/A&gt; in his blog that Mono will be soon aligned too.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=447340" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/adioltean/archive/tags/Programming/default.aspx">Programming</category><category domain="http://blogs.msdn.com/adioltean/archive/tags/.NET/default.aspx">.NET</category></item><item><title>Interview with Anders Heljsberg on the next version of C#</title><link>http://blogs.msdn.com/adioltean/archive/2005/07/15/439402.aspx</link><pubDate>Fri, 15 Jul 2005 22:59:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:439402</guid><dc:creator>AdiOltean</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/adioltean/comments/439402.aspx</comments><wfw:commentRss>http://blogs.msdn.com/adioltean/commentrss.aspx?PostID=439402</wfw:commentRss><description>&lt;P&gt;(No, I didn't mean Whidbey.&amp;nbsp;I meant&amp;nbsp;C# 3.0)&lt;/P&gt;
&lt;P&gt;The interview appeared on Microsoft Watch. Here is the &lt;A href="http://www.microsoft-watch.com/article2/0,2180,1837436,00.asp"&gt;link&lt;/A&gt;. &lt;/P&gt;
&lt;P&gt;I like the new approach on dynamic/inferred typing for database queries. The problem is this: whenever you have to mix highly declarative&amp;nbsp;languages like SQL with imperative,&amp;nbsp;strong-typed language environments like C#, then you will always&amp;nbsp;end up with&amp;nbsp;some amount of boiler-plate code. And you don't want too much boiler-plate code... &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;P.S. On the same subject, if you missed that, there is also an older interview on &lt;A href="http://channel9.msdn.com/ShowPost.aspx?PostID=10276"&gt;Channel 9&lt;/A&gt;&amp;nbsp;around C# 3.0.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=439402" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/adioltean/archive/tags/.NET/default.aspx">.NET</category></item><item><title>Managed Speech APIs and other cool utilities... </title><link>http://blogs.msdn.com/adioltean/archive/2005/07/13/438594.aspx</link><pubDate>Thu, 14 Jul 2005 01:33:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:438594</guid><dc:creator>AdiOltean</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/adioltean/comments/438594.aspx</comments><wfw:commentRss>http://blogs.msdn.com/adioltean/commentrss.aspx?PostID=438594</wfw:commentRss><description>&lt;P&gt;New speech-related utilities &lt;A href="http://www.microsoft.com/downloads/details.aspx?FamilyID=52744fb8-9238-4cbd-b615-be2ca781880d&amp;amp;displaylang=en "&gt;here&lt;/A&gt;. A new addition is BuildAppLex:&lt;/P&gt;
&lt;BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px"&gt;
&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;BuildAppLex Speech Utility for Microsoft Speech Technologies&lt;BR&gt;&lt;/STRONG&gt;BuildAppLex.exe is a command-line tool that allows you to create an Application Lexicon, using the Speech API. It takes one required command-line argument: a text file containing a list of words and their corresponding pronunciations.&lt;/EM&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Also, a while back, Robert Brown &lt;A href="https://blogs.msdn.com/robertbrown/archive/2005/05/23/421085.aspx"&gt;mentioned&lt;/A&gt;&amp;nbsp;that a new&amp;nbsp;managed interface for the Speech APIs is now available &lt;A href="http://msdn.microsoft.com/isapi/CTRedir.asp?type=CT&amp;amp;source=MSDN&amp;amp;sPage=WP_DevCenterHeadlines_3BBC0D4A-9028-43B9-93B9-5FDCF3C328D8|DevCenterHeadlines||Download%20the%20Avalon%20and%20Indigo%20Beta1%20Release%20Candidate&amp;amp;tPage=http://www.microsoft.com/downloads/details.aspx?familyid=b789bc8d-4f25-4823-b6aa-c5edf432d0c1&amp;amp;displaylang=en"&gt;here&lt;/A&gt;. In a few lines of C# code, you can do&amp;nbsp;either speech recognition or speech synthesis. (To play with the API, you also need to install a regognition engine - for example the one from the &lt;A href="http://www.microsoft.com/speech/download/sdk51"&gt;latest&lt;/A&gt; SAPI SDK)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=438594" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/adioltean/archive/tags/Windows+Server/default.aspx">Windows Server</category><category domain="http://blogs.msdn.com/adioltean/archive/tags/.NET/default.aspx">.NET</category><category domain="http://blogs.msdn.com/adioltean/archive/tags/Windows+XP/default.aspx">Windows XP</category></item><item><title>Atlas: Seamless AJAX programming</title><link>http://blogs.msdn.com/adioltean/archive/2005/06/28/433512.aspx</link><pubDate>Tue, 28 Jun 2005 23:24:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:433512</guid><dc:creator>AdiOltean</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/adioltean/comments/433512.aspx</comments><wfw:commentRss>http://blogs.msdn.com/adioltean/commentrss.aspx?PostID=433512</wfw:commentRss><description>&lt;P&gt;Scott Guthrie has a great blog &lt;A href="http://weblogs.asp.net/scottgu/archive/2005/06/28/416185.aspx"&gt;entry&lt;/A&gt; on several platform enhancements, code-name Atlas, that will address AJAX-style programming.&amp;nbsp;At the same time, Charles Fitzgerald&amp;nbsp;&lt;A href="http://www.infoworld.com/article/05/06/28/HNatlasframework_1.html"&gt;presented&lt;/A&gt; the Atlas technologies.&lt;/P&gt;
&lt;P&gt;Microsoft will release a technology preview of Atlas at the PDC, which will be held in Los Angeles.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is very nice - it makes complete sense to have AJAX-style development facilities built in the development platform. You should not be required to write and debug complex AJAX code. &lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=433512" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/adioltean/archive/tags/Programming/default.aspx">Programming</category><category domain="http://blogs.msdn.com/adioltean/archive/tags/.NET/default.aspx">.NET</category></item><item><title>Welcome Max</title><link>http://blogs.msdn.com/adioltean/archive/2005/06/14/428812.aspx</link><pubDate>Tue, 14 Jun 2005 10:09:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:428812</guid><dc:creator>AdiOltean</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/adioltean/comments/428812.aspx</comments><wfw:commentRss>http://blogs.msdn.com/adioltean/commentrss.aspx?PostID=428812</wfw:commentRss><description>&lt;P&gt;Max Feingold just &lt;a href="http://blogs.msdn.com/esperpento/archive/2005/06/14/428805.aspx"&gt;started&lt;/A&gt; a blog! &lt;/P&gt;
&lt;P&gt;In the past, I&amp;nbsp;knew him as one of the good COM experts around. Incidentally, one of my previous &lt;a href="http://blogs.msdn.com/418132.aspx"&gt;posts&lt;/A&gt;&amp;nbsp;describes an intricate COM+ setup issue on which Max helped me to see the light... :-)&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=428812" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/adioltean/archive/tags/Click+or+miss/default.aspx">Click or miss</category><category domain="http://blogs.msdn.com/adioltean/archive/tags/.NET/default.aspx">.NET</category></item></channel></rss>