<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress.com" -->
<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/"
	>

<channel>
	<title>win32 &amp;laquo; WordPress.com Tag Feed</title>
	<link>http://en.wordpress.com/tag/win32/</link>
	<description>Feed of posts on WordPress.com tagged "win32"</description>
	<pubDate>Tue, 24 Nov 2009 17:25:49 +0000</pubDate>

	<generator>http://en.wordpress.com/tags/</generator>
	<language>en</language>

<item>
<title><![CDATA[Twickret now officially launched on Windows]]></title>
<link>http://twickret.wordpress.com/2009/11/22/twickret-now-officially-launched-on-windows/</link>
<pubDate>Sun, 22 Nov 2009 00:33:44 +0000</pubDate>
<dc:creator>ltbrenton</dc:creator>
<guid>http://twickret.wordpress.com/2009/11/22/twickret-now-officially-launched-on-windows/</guid>
<description><![CDATA[Well it was on the site before, but the time has come for me to make an official announcement: Twick]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Well it was on the site before, but the time has come for me to make an official announcement: Twickret is officially RELEASED on Windows operating systems from XP to Windows 7 as of this morning.</p>
<p>Check it out on the <a href="http://twickret.wordpress.com/download">Download</a> page.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Coming soon on iPhone]]></title>
<link>http://twickret.wordpress.com/2009/11/20/coming-soon-on-iphone/</link>
<pubDate>Fri, 20 Nov 2009 19:40:36 +0000</pubDate>
<dc:creator>ltbrenton</dc:creator>
<guid>http://twickret.wordpress.com/2009/11/20/coming-soon-on-iphone/</guid>
<description><![CDATA[Latest news: A twickret version for iPhone is currently pending approval from Apple, watch this spac]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Latest news: A twickret version for iPhone is currently pending approval from Apple, watch this space for more info, I&#8217;m expecting it to be available on the App Store shortly.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Conectando TADOConnection (Delphi) com MS-Access 2007]]></title>
<link>http://andylopes.wordpress.com/2009/11/19/conectando-tadoconnection-delphi-com-ms-access-2007/</link>
<pubDate>Thu, 19 Nov 2009 10:33:02 +0000</pubDate>
<dc:creator>Anderson Lopes</dc:creator>
<guid>http://andylopes.wordpress.com/2009/11/19/conectando-tadoconnection-delphi-com-ms-access-2007/</guid>
<description><![CDATA[Buenas! Mas uma dica, que surgiu da necessidade de um professor da faculdade; como conectar o TADOCo]]></description>
<content:encoded><![CDATA[Buenas! Mas uma dica, que surgiu da necessidade de um professor da faculdade; como conectar o TADOCo]]></content:encoded>
</item>
<item>
<title><![CDATA[What is twickret?]]></title>
<link>http://twickret.wordpress.com/2009/11/17/what-is-twickret/</link>
<pubDate>Tue, 17 Nov 2009 13:18:34 +0000</pubDate>
<dc:creator>ltbrenton</dc:creator>
<guid>http://twickret.wordpress.com/2009/11/17/what-is-twickret/</guid>
<description><![CDATA[&nbsp; Listen do you want to know a Twickret? Promise not to tell? Twitter something secret to speci]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>&#160;</p>
<p>Listen do you want to know a Twickret? Promise not to tell?<br />
Twitter something secret to specific friends and have everyone else guessing what you said!  They&#8217;ll never know unless you tell them &#8211; with Twickret &#8211; a secret messaging system that turns your Tweets into uncrackable* spy code.  What couldn&#8217;t you get away with?  It&#8217;s up to you, but use the power of Twickret wisely &#8211; or just for laughs &#8211; whatever works for you.  This is a fun application for entertainment purposes only &#8211; 007 please use your usual methods &#8211; not recommended for state secrets.<br />
 </p>
<p>Key features:</p>
<p>- Strong, custom designed text cipher secures your updates so only those you choose can read them</p>
<p>- Intuitive easy to use interface</p>
<p>- Encode, update and receive tweets from one place &#8211; no need to use the browser</p>
<p>- Only those who know the codeword will be able to decode</p>
<p>&#160;</p>
<p>&#160;</p>
<div id="attachment_16" class="wp-caption alignnone" style="width: 327px"><a href="http://twickret.wordpress.com/files/2009/11/twickret-main.jpg"><img class="size-full wp-image-16" title="twickret main" src="http://twickret.wordpress.com/files/2009/11/twickret-main.jpg" alt="" width="317" height="492" /></a><p class="wp-caption-text">Twickret main screen on Windows</p></div>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<div id="attachment_17" class="wp-caption alignnone" style="width: 411px"><a href="http://twickret.wordpress.com/files/2009/11/twickret-timeline.jpg"><img class="size-full wp-image-17" title="twickret timeline" src="http://twickret.wordpress.com/files/2009/11/twickret-timeline.jpg" alt="" width="401" height="567" /></a><p class="wp-caption-text">Twickret timeline view on Windows</p></div>
<p>&#160;</p>
<p>&#160;</p>
<p><span style="color:#0000ee;text-decoration:underline;"><br />
</span></p>
<p>* Resultant data is not 100% secure &#8211; those with the right resources and a lot of time will be able to crack it. Please be responsible.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[How to install Eclipse and PyDev in your Windows XP]]></title>
<link>http://victorwestmann.wordpress.com/2009/10/27/how-to-install-eclipse-and-pydev-in-your-windows/</link>
<pubDate>Tue, 27 Oct 2009 03:15:00 +0000</pubDate>
<dc:creator>Victorino</dc:creator>
<guid>http://victorwestmann.wordpress.com/2009/10/27/how-to-install-eclipse-and-pydev-in-your-windows/</guid>
<description><![CDATA[This post was written in(dd-mm-yyyy hh:mm) 27/10/2009 00:39 PM (-3 GMT) I’ll try to put here a step-]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>This post was written in(dd-mm-yyyy hh:mm) 27/10/2009 00:39 PM (-3 GMT)</p>
<p>I’ll try to put here a step-by-step of what you should do on your Windows XP machine  in order to install Eclipse to use it as a Python IDE.</p>
<h2 style="text-align:left;"><span style="color:#333333;">DOWNLOADING</span></h2>
<p>You&#8217;ll need the following &#8211; software to be downloaded and installed &#8211; in the exact order that follows beneath:</p>
<p><strong> </strong></p>
<p><strong> </strong></p>
<p><strong> </strong></p>
<p><strong></p>
<ol>
<li><span style="font-weight:normal;"><strong>Administrator privileges</strong> in your Windows machine.</span></li>
<li><span style="font-weight:normal;"><strong><a href="http://www.python.org/">Python</a></strong><strong> </strong>(Version <a href="http://python.org/download/releases/2.6.4/"><strong>2.6.4</strong></a> (or <strong><a href="http://python.org/download/releases/3.1.1/">3.1.1</a><span style="font-weight:normal;">)</span></strong>. Size ~13Mb. <em>Depends of which version you want/need</em>)</span></li>
<li><span style="font-weight:normal;"><strong><a href="http://www.eclipse.org/downloads/download.php?file=/technology/epp/downloads/release/europa/winter/eclipse-java-europa-winter-win32.zip">Eclipse Europa</a> </strong>(Version 3.3.2 (released in 2007). Size of 79,3 Mb.)</span></li>
<li><span style="font-weight:normal;"><strong><a href="http://pydev.org/download.html">PyDev</a> </strong>(Version 1.5.0. Size ~5 Mb. <em>Will be installed through Eclipse</em>).</span></li>
</ol>
<p></strong></p>
<p>&#160;</p>
<p>After you&#8217;re logged into your machine as an administrator you should download the softwares from 2-3.</p>
<p>Eclipse:</p>
<ol>
<li>Extract and run Eclipse.</li>
<li>Go to the menu <strong>&#8220;Help&#8221; </strong>&#62;<strong> &#8220;Find and Update&#8221; </strong>&#62;<strong> &#8220;Find and Install&#8230;&#8221;</strong>.</li>
<li>Select the option<strong> &#8220;Search for new features to install&#8221; </strong>and click<strong> &#8220;Next&#8221;</strong>.</li>
<li>Click the button<strong> &#8220;New Remote Site&#8221; </strong>and fill the<strong> &#8220;Name:&#8221; </strong>field with the name <strong>PyDev </strong>and the <strong>&#8220;URL:&#8221; </strong>field with the following URL: <strong><a href="http://pydev.org/updates">http://pydev.org/updates</a></strong></li>
<li>Click<strong> &#8220;Finish&#8221;.</strong></li>
<li>Select the entire PyDev package or the packages you want <strong>&#8220;</strong><strong>PyDev&#8221;</strong> and/or <strong>&#8220;</strong><strong>PyDev Mylnyn Integration (optional)&#8221;.</strong></li>
<li>Click<strong> &#8220;Next&#8221;.</strong></li>
<li><strong>&#8220;I accept the terms in the license agreements&#8221;.</strong></li>
<li>Click<strong> &#8220;Next&#8221; </strong>and<strong> &#8220;Finish&#8221;.</strong></li>
<li>After a while click<strong> &#8220;Install all&#8221;.</strong></li>
<li>Eclipse will ask you if it&#8217;s ok to restart click <strong>&#8220;Yes&#8221;.</strong></li>
</ol>
<p>PyDev 1.5.0 will take ~21,96 Mb.</p>
<h2 style="text-align:left;"><span style="color:#333333;">CONFIGURING THE INTERPRETER</span></h2>
<p>Now you should do the following inside Eclipse:</p>
<ol>
<li>Click in <strong>&#8220;Window&#8221; &#62; &#8220;Preferences&#8230;&#8221; &#62; &#8220;PyDev&#8221;.</strong></li>
<li>Click in the option<strong> &#8220;Interpreter - Python&#8221; </strong>and click in the upper right button named <strong>&#8220;New&#8221;.</strong></li>
<li>Click in the <strong>&#8220;Browse&#8221; </strong>button to search for your <strong>&#8220;python.exe&#8221;</strong> file and after that click <strong>&#8220;Ok&#8221; </strong>three times.</li>
</ol>
<p>Done! If you did everything correctly you&#8217;ll have by now Python and Eclipse working together. For further information check the <strong><a href="http://pydev.org/manual_101_root.html">PyDev Documentation site</a></strong>. Enjoy! <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Preventing Windows Screen-Saver Activation]]></title>
<link>http://jimlawless.wordpress.com/2009/10/19/preventing-windows-screen-saver-activation/</link>
<pubDate>Tue, 20 Oct 2009 00:54:54 +0000</pubDate>
<dc:creator>Jim Lawless</dc:creator>
<guid>http://jimlawless.wordpress.com/2009/10/19/preventing-windows-screen-saver-activation/</guid>
<description><![CDATA[Some time ago, I wanted to see if the simulated mouse moves generated via calls to the WIN32 API mou]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Some time ago, I wanted to see if the simulated mouse moves generated via calls to the WIN32 API <strong>mouse_event</strong> function would prevent the screen-saver from triggering.</p>
<p>In the current version of XP ( and some older versions of Windows ) these events do indeed keep the screen-saver from activating.</p>
<p>Please refer to the source below.</p>
<p><strong>busy_mouse.c</strong></p>
<pre class="brush: cpp;">
// Generate mouse events to prevent the screen-saver from
// activating.
//
// License: MIT / X11
// Copyright (c) 2009 by James K. Lawless
// jimbo@radiks.net http://www.radiks.net/~jimbo
// http://www.mailsend-online.com
//
// Permission is hereby granted, free of charge, to any person
// obtaining a copy of this software and associated documentation
// files (the &#34;Software&#34;), to deal in the Software without
// restriction, including without limitation the rights to use,
// copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following
// conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED &#34;AS IS&#34;, WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
// OTHER DEALINGS IN THE SOFTWARE.

// check the state of the Scroll Lock or Caps Lock keys.  Return a
// 1 if the requested key is active/on.

#include &#60;windows.h&#62;
#include &#60;stdio.h&#62;
#include &#60;string.h&#62;

#pragma comment(lib,&#34;user32.lib&#34;)

void process_messages(void);

int main(int argc,char **argv) {
   int i;
   printf(&#34;Busy Mouse v1.0 by Jim Lawless\n&#34;);
   printf(&#34;If CAPS LOCK is on, the mouse cursor will move around to prevent any screen-savers from activating.\n&#34;);
   for(;;) {
      while(GetKeyState(VK_CAPITAL)&#38;1) {
         for(i=0;i&#60;50;i+=2) {
            mouse_event( MOUSEEVENTF_MOVE,2,0,0,0 );
            process_messages();
         }
         Sleep(200);

         for(i=0;i&#60;50;i+=2) {
            mouse_event( MOUSEEVENTF_MOVE,0,2,0,0 );
            process_messages();
         }
         Sleep(200);

         for(i=0;i&#60;50;i+=2) {
            mouse_event( MOUSEEVENTF_MOVE,-2,0,0,0 );
            process_messages();
         }
         Sleep(200);

         for(i=0;i&#60;50;i+=2) {
            mouse_event( MOUSEEVENTF_MOVE,0,-2,0,0 );
            process_messages();
         }
         Sleep(200);
      }
   }
   processMessages();
}

void process_messages(void) {
	MSG m;
	while( PeekMessage(&#38;m,0,0,0,PM_REMOVE)) {
   	TranslateMessage(&#38;m);
		DispatchMessage(&#38;m);
	}
}
</pre>
<p>When you run <strong>busy_mouse.exe</strong> the program will loop indefinitely.  The program checks the CAPS LOCK state.  If CAPS LOCK is enabled, it will then move the mouse in a rectangular pattern via mouse_event().</p>
<p>When CAPS LOCK is off, the simulated mouse events halt.</p>
<p>I&#8217;ve used this to keep the screen visible so that I can watch for emails or processes that run long while I&#8217;m away from the mouse and keyboard.</p>
<p>The source and executable file for busy_mouse can be downloaded in a single archive at:<br />
<a href="http://www.mailsend-online.com/wp/busy_mouse.zip">http://www.mailsend-online.com/wp/busy_mouse.zip</a></p>
<p><a href="http://del.icio.us/post?url=http://jimlawless.wordpress.com/2009/10/19/preventing-windows-screen-saver-activation/&#38;title=Preventing+Windows+Screen-Saver+Activation" target="_blank"><img title="del_icio_us" src="http://www.mailsend-online.com/wp/del_icio_us.png" alt="del_icio_us" /></a> <a href="http://del.icio.us/post?url=http://jimlawless.wordpress.com/2009/10/19/preventing-windows-screen-saver-activation/&#38;title=Preventing+Windows+Screen-Saver+Activation" target="_blank">Save to del.icio.us</a><br /><a href="http://digg.com/submit?phase=2&#38;url=http://jimlawless.wordpress.com/2009/10/19/preventing-windows-screen-saver-activation/&#38;title=Preventing+Windows+Screen-Saver+Activation" target="_blank"><img title="digg" src="http://www.mailsend-online.com/wp/digg.png" alt="digg" /></a> <a href="http://digg.com/submit?phase=2&#38;url=http://jimlawless.wordpress.com/2009/10/19/preventing-windows-screen-saver-activation/&#38;title=Preventing+Windows+Screen-Saver+Activation" target="_blank">Digg it</a><br /><a href="http://reddit.com/submit?url=http://jimlawless.wordpress.com/2009/10/19/preventing-windows-screen-saver-activation/&#38;title=Preventing+Windows+Screen-Saver+Activation" target="_blank"><img title="reddit" src="http://www.mailsend-online.com/wp/reddit.png" alt="reddit" /></a> <a href="http://reddit.com/submit?url=http://jimlawless.wordpress.com/2009/10/19/preventing-windows-screen-saver-activation/&#38;title=Preventing+Windows+Screen-Saver+Activation" target="_blank">Save to Reddit</a><br /><a href="http://www.facebook.com/share.php?u=http://jimlawless.wordpress.com/2009/10/19/preventing-windows-screen-saver-activation/" target="_blank"><img title="facebook" src="http://www.mailsend-online.com/wp/facebook.png" alt="facebook" /></a> <a href="http://www.facebook.com/share.php?u=http://jimlawless.wordpress.com/2009/10/19/preventing-windows-screen-saver-activation/" target="_blank">Share on Facebook</a><br /><a href="http://twitter.com/home?status=Check+out+http://jimlawless.wordpress.com/2009/10/19/preventing-windows-screen-saver-activation/"><img title="twitter" src="http://www.mailsend-online.com/wp/twitter.gif" alt="twitter" /></a> <a href="http://twitter.com/home?status=Check+out+http://jimlawless.wordpress.com/2009/10/19/preventing-windows-screen-saver-activation/" target="_blank">Share on Twitter</a><br /><a href="http://www.addthis.com/bookmark.php?pub=dvd&#38;url=http://jimlawless.wordpress.com/2009/10/19/preventing-windows-screen-saver-activation/;title=Preventing+Windows+Screen-Saver+Activation" target="_blank"><img title="aolfav" src="http://www.mailsend-online.com/wp/aolfav.gif" alt="aolfav" /></a> <a href="http://www.addthis.com/bookmark.php?pub=dvd&#38;url=http://jimlawless.wordpress.com/2009/10/19/preventing-windows-screen-saver-activation/;title=Preventing+Windows+Screen-Saver+Activation" target="_blank">More bookmarks</a>
<p><img src="http://www.mailsend-online.com/cgi-bin/wphit.pl" /><br />
<em>Unless otherwise noted, all code and text entries are Copyright © 2009 by James K. Lawless</em></p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[La ranita feliz]]></title>
<link>http://juanpalomez.wordpress.com/2009/10/18/la-ranita-feliz/</link>
<pubDate>Sun, 18 Oct 2009 14:00:44 +0000</pubDate>
<dc:creator>thisisoneball</dc:creator>
<guid>http://juanpalomez.wordpress.com/2009/10/18/la-ranita-feliz/</guid>
<description><![CDATA[Este es un programa que resuelve una de las pruebas del juego del MAME Puzzle &amp; Action: Tant-R, ]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Este es un programa que resuelve una de las pruebas del juego del MAME <a href="http://www.rom-world.com/file.php?id=31408">Puzzle &#38; Action: Tant-R</a>, en concreto la de la rana que tiene que ir pisando todas las casillas del tablero sin dejar ninguna sin pisar. Estas son algunas de las pantallas que te pueden salir:</a></p>
<p><img class="alignnone size-full wp-image-93" title="tant0000" src="http://juanpalomez.wordpress.com/files/2009/10/tant0000.png" alt="tant0000" width="320" height="224" /> <img class="alignnone size-full wp-image-92" title="tantr" src="http://juanpalomez.wordpress.com/files/2009/10/tantr.png" alt="tantr" width="320" height="224" /> <img class="alignnone size-full wp-image-91" title="tant0001" src="http://juanpalomez.wordpress.com/files/2009/10/tant0001.png" alt="tant0001" width="320" height="224" /></p>
<p>El programa muestra un tablero como el del juego pero vacío. Si pinchas en una casilla sitúas la rana, y las siguientes que pinches serán las piedras. Cuando hayas terminado de poner piedras pulsas Solución. Si hay más de una solución te seguirán saliendo cada vez que pulses el botón hasta que ya no queden más:</p>
<p><img class="alignnone size-full wp-image-96" title="captura" src="http://juanpalomez.wordpress.com/files/2009/10/captura.png" alt="captura" width="150" height="240" /></p>
<p>Pincha <a href="http://rapidshare.com/files/294636860/ranita.zip.html">aqui</a> para bajar el ejecutable y el código</p>
<p>Puedes usar los casos que salen en el juego, como en las tres capturas de arriba, o probar otros.</p>
<p>Si vas a probar los tuyos propios muchas veces pasará que no haya ninguna solución, o que haya tantas que se te quede el programa prácticamente colgado pensando. Poniendo 5 o 6 piedras normalmente saca las soluciones rápido.</p>
<p>Realmente son dos programas separados:</p>
<li> Un programa en Lisp que es el que calcula las soluciones (rana.lsp). Recibe por la entrada estándar las posiciones de las piedras y de la rana: cada par de números son la coordenada X y la Y de una piedra, empezando de 0,0 que es la esquina superior izquierda. Luego una linea que ponga FIN, y luego las coordenadas de la rana.
<p>Al ejecutarlo imprime las soluciones con un dibujo en ascii, donde &#60; &#62; ^ v  significa  izquierda, derecha, arriba, abajo.</p>
<p>Se puede ver todo esto en los ficheros entrada.txt, salida.txt y ejecutar.bat</li>
<li> Un frontend para el programa anterior, hecho en C + API de Windows<br />
Puedes usar ranita.exe para ejecutarlo o puedes abrir los ficheros de Visual Studio para editarlo. en ambos casos hace falta el clisp, que he incluido en una carpeta en el ZIP.</p>
<p>Genera el fichero entrada.txt a partir de lo que dibuje el usuario, llama al programa Lisp para que calcule las soluciones, lee el fichero salida.txt y lo dibuja en la ventana.</li>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Formatos Proprietários]]></title>
<link>http://relogiovelho.wordpress.com/2009/10/18/formatos-proprietarios/</link>
<pubDate>Sun, 18 Oct 2009 12:07:56 +0000</pubDate>
<dc:creator>relogiovelho</dc:creator>
<guid>http://relogiovelho.wordpress.com/2009/10/18/formatos-proprietarios/</guid>
<description><![CDATA[Algumas explicações sobre formatos proprietários podem ser encontrados no Wiki do Ubuntu Br, na inst]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Algumas explicações sobre formatos proprietários podem ser encontrados no <a href="http://wiki.ubuntu-br.org/FormatosProprietarios" target="_blank">Wiki do Ubuntu Br</a>, na instalação dos codecs do windows (w32codecs) precisa da instalação do libstdc++.so.5 que está no pacote libstdc++5, é só digitar no synaptic que ele aparece,  no Ubuntu 9.04 ele está nos repositórios, já no Ubuntu 9.10 só tem o pacote libstdc++6 que não funciona, mas tem o pacote libstdc++5 pra baixar da versão anterior, o <a href="http://packages.ubuntu.com/jaunty/i386/libstdc++5/download" target="_blank">Ubuntu 9.04 jaunty.</a></p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Garbage Collection]]></title>
<link>http://enggtech.wordpress.com/2009/10/12/garbage-collection/</link>
<pubDate>Mon, 12 Oct 2009 06:50:14 +0000</pubDate>
<dc:creator>Visitor Blogs</dc:creator>
<guid>http://enggtech.wordpress.com/2009/10/12/garbage-collection/</guid>
<description><![CDATA[In the .NET Framework version 1.0, the common language runtime (CLR) has a separate memory manager f]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>In the .NET Framework version 1.0, the common language runtime (CLR) has a separate memory manager for the large object heap. Under some circumstances this memory manager does not return unused memory to the operating system, and in a few cases it does not make the memory available for garbage collection. This results in failure to allocate memory due to virtual address space fragmentation. In the .NET Framework versions 1.1 and 2.0, the large object heap is composed of contiguous areas of memory called heap segments, properly aligned to minimize virtual memory fragmentation. During garbage collection, the space reclaimed from large objects is consolidated and placed in a free list. Heap segments containing only free list items are freed and the memory is returned to the operating system. These changes to the large object heap have effectively eliminated memory allocation failures caused by this form of virtual address space fragmentation.</p>
<p>via <a href="http://msdn.microsoft.com/en-us/library/0xy59wtx.aspx">Garbage Collection</a>.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Simplifing the use of MessageBox for debugging]]></title>
<link>http://codingmisadventures.wordpress.com/2009/10/07/simplifing-the-use-of-messagebox-for-debugging/</link>
<pubDate>Thu, 08 Oct 2009 05:59:31 +0000</pubDate>
<dc:creator>PJ</dc:creator>
<guid>http://codingmisadventures.wordpress.com/2009/10/07/simplifing-the-use-of-messagebox-for-debugging/</guid>
<description><![CDATA[So here I was debugging my super awesome stop watch, and I was debugging it using the win32 MessageB]]></description>
<content:encoded><![CDATA[So here I was debugging my super awesome stop watch, and I was debugging it using the win32 MessageB]]></content:encoded>
</item>
<item>
<title><![CDATA[How to create a compress folder in Windows using Win32 API]]></title>
<link>http://ixmx.wordpress.com/2009/09/16/how-to-create-a-compress-folder-in-windows-using-win32-api/</link>
<pubDate>Wed, 16 Sep 2009 20:42:14 +0000</pubDate>
<dc:creator>ixmx</dc:creator>
<guid>http://ixmx.wordpress.com/2009/09/16/how-to-create-a-compress-folder-in-windows-using-win32-api/</guid>
<description><![CDATA[void create_zipped_folder(string &amp; folder_name) { if(CreateDirectory(folder_name.c_str(),NULL)) ]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><pre class="cpp-qt" style="font-family:monospace;"><span style="color:#0057AE;">void</span> create_zipped_folder<span style="color:#006E28;">(</span>string <span style="color:#006E28;">&#38;</span> folder_name<span style="color:#006E28;">)</span>
<span style="color:#006E28;">{</span>
   <span style="color:#dddddd;font-weight:bold;">if</span><span style="color:#006E28;">(</span>CreateDirectory<span style="color:#006E28;">(</span>folder_name.<span style="color:#2B74C7;">c_str</span><span style="color:#006E28;">(</span><span style="color:#006E28;">)</span><span style="color:#006E28;">,</span><span style="color:#0057AE;">NULL</span><span style="color:#006E28;">)</span><span style="color:#006E28;">)</span>
   <span style="color:#006E28;">{</span>
      HANDLE hFile <span style="color:#006E28;">=</span> CreateFile<span style="color:#006E28;">(</span>folder_name.<span style="color:#2B74C7;">c_str</span><span style="color:#006E28;">(</span><span style="color:#006E28;">)</span><span style="color:#006E28;">,</span>
                        GENERIC_READ <span style="color:#006E28;">&#124;</span> GENERIC_WRITE<span style="color:#006E28;">,</span>
                        <span style="color:#0057AE;">NULL</span><span style="color:#006E28;">,</span>
                        <span style="color:#0057AE;">NULL</span><span style="color:#006E28;">,</span>
                        OPEN_EXISTING<span style="color:#006E28;">,</span>
                        FILE_FLAG_BACKUP_SEMANTICS<span style="color:#006E28;">,</span>
                        <span style="color:#0057AE;">NULL</span><span style="color:#006E28;">)</span><span style="color:#006E28;">;</span>

      DWORD dummy<span style="color:#006E28;">;</span>
      USHORT format <span style="color:#006E28;">=</span> COMPRESSION_FORMAT_DEFAULT<span style="color:#006E28;">;</span>
      <span style="color:#dddddd;font-weight:bold;">if</span><span style="color:#006E28;">(</span><span style="color:#006E28;">!</span>DeviceIoControl<span style="color:#006E28;">(</span>hFile<span style="color:#006E28;">,</span> FSCTL_SET_COMPRESSION<span style="color:#006E28;">,</span> <span style="color:#006E28;">&#38;</span>format<span style="color:#006E28;">,</span> <span style="color:#2B74C7;">sizeof</span><span style="color:#006E28;">(</span>USHORT<span style="color:#006E28;">)</span><span style="color:#006E28;">,</span> <span style="color:#0057AE;">NULL</span><span style="color:#006E28;">,</span> 0<span style="color:#006E28;">,</span> <span style="color:#006E28;">&#38;</span>dummy<span style="color:#006E28;">,</span> <span style="color:#0057AE;">NULL</span><span style="color:#006E28;">)</span><span style="color:#006E28;">)</span>
      <span style="color:#006E28;">{</span>
         ErrorExit<span style="color:#006E28;">(</span>TEXT<span style="color:#006E28;">(</span><span style="color:#BF0303;">"DeviceIoControl Failed"</span><span style="color:#006E28;">)</span><span style="color:#006E28;">)</span><span style="color:#006E28;">;</span>
      <span style="color:#006E28;">}</span>

      CloseHandle<span style="color:#006E28;">(</span>hFile<span style="color:#006E28;">)</span><span style="color:#006E28;">;</span>
   <span style="color:#006E28;">}</span>
<span style="color:#006E28;">}</span></pre>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Multi-platform logging in Python]]></title>
<link>http://ython.wordpress.com/2009/09/07/multi-platform-logging-in-python/</link>
<pubDate>Mon, 07 Sep 2009 10:35:08 +0000</pubDate>
<dc:creator>Michał</dc:creator>
<guid>http://ython.wordpress.com/2009/09/07/multi-platform-logging-in-python/</guid>
<description><![CDATA[Python has it&#8217;s own logging. Twisted has it&#8217;s own logging. Unfortunatley, none of them h]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Python has it&#8217;s own logging. Twisted has it&#8217;s own logging. Unfortunatley, none of them have a convinient way to log to underlying operating system&#8217;s facilities (which is, syslog or Windows Event Log in my case). So, I had to wrote one myself. Here you go &#8211; this is MultiLog:</p>
<pre>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">class MultiLog(object):</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">"""</div>

class MultiLog(object):
    """
    Multiplatform logging component.
    (C) 2009 FHU KAGAMI &#60;info@fhu-kagami.pl&#62;

    Distributed under the terms of MIT License
    """
    def __init__(self, appname, interactive = None):
        self.hostname = socket.gethostname()
        self.appname = appname
        self.interactive = interactive
        if self.interactive is None:
            self.interactive = '--interactive' in sys.argv
        self.pid = os.getpid()

        fun = '_init_log_' + sys.platform
        getattr(self, fun)()

    def log(self, msg):
        if type(msg)==unicode:
            msg = msg.encode('utf8')
        fun = '_log_' + sys.platform
        return getattr(self, fun)(msg)

    __call__ = log

    def _log_interactive(self, msg):
        if self.interactive:
            msg = time.ctime() + ": " + self.hostname + " " + self.appname + "[" + str(self.pid) + "]: " + msg
            sys.stderr.write(msg)
            sys.stderr.write('\n')
            sys.stderr.flush()

    def _init_log_unix(self):
        from syslog import openlog
        openlog(self.appname + "[" + str(self.pid) + "]")

    def _log_unix(self, msg):
        from syslog import syslog
        syslog(msg)
        self._log_interactive(msg)

    _init_log_linux2 = _init_log_unix
    _log_linux2 = _log_unix

    def _init_log_win32(self):
        import win32evtlog
        import win32con
        self._win32_type = win32con.EVENTLOG_INFORMATION_TYPE
        self._win32_log = win32evtlog.OpenEventLog(None, self.appname)

    def _log_win32(self, msg):
        import win32evtlog
        win32evtlog.ReportEvent(self._win32_log, self._win32_type, 0, 0, None,
            (msg, 'PID: %s' % self.pid), None)
        self._log_interactive(msg)

if __name__ == "__main__":
    log = MultiLog('my application')
    log('this is a test')</pre>
<p>On Ubuntu, look for /var/log/user.log. On Windows, run mmc.exe and open eventwvr &#8211; look for Application Logs.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[cfix 1.5 released; adds support for EXE-embedded tests and kernel mode multi-threading]]></title>
<link>http://jpassing.wordpress.com/2009/09/05/cfix-1-5-released-adds-support-for-exe-embedded-tests-and-kernel-mode-multi-threading/</link>
<pubDate>Sat, 05 Sep 2009 10:11:30 +0000</pubDate>
<dc:creator>jpassing</dc:creator>
<guid>http://jpassing.wordpress.com/2009/09/05/cfix-1-5-released-adds-support-for-exe-embedded-tests-and-kernel-mode-multi-threading/</guid>
<description><![CDATA[A new version of the cfix unit testing framework is now ready for download. Unlike the previous rele]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>A new version of the <a href='http://www.cfix-testing.org/'>cfix unit testing framework</a> is now ready for download.</p>
<p>Unlike the previous release, which was mainly a maintenance release, cfix 1.5 adds major new features: kernel mode multithreading and EXE-based unit tests.</p>
<h3>EXE based unit tests</h3>
<p>As I <a href='/2009/08/06/cfix-studio-beta-2-to-add-support-for-exe-based-unit-tests/'>discussed in a previous post in the context of Visual Assert/cfix studio</a>, cfix&#8217; restriction to DLL based unit tests has turned out to be quite a limitation for certain kinds of projects. </p>
<p>In cfix 1.5, this restriction has been removed: cfix now supports both, unit tests compiled and linked into DLL modules and unit tests embedded into EXE modules. </p>
<p>Now, when I say <i>embeded into an EXE module</i>, I do not mean that you may merely leave out the /LD compiler switch  &#8212; it means that you may compile and link unit tests <i>into the actual</i> application EXE module <i>without</i> impacting this application&#8217;s behavior or having to change the application&#8217;s main() routine: When you run the application direcly or through the debugger, it will behave as normal (e.g. launch GUI). Once you launch it via <code>cfix32 -exe <i>app.exe</i></code> (or <code>cfix64 -exe <i>app.exe</i></code>, respectively), however, the application&#8217;s main() routine will not execute and instead, your embedded unit tests will run.</p>
<p>This may seem awkward at first &#8212; but it offers a tremendous advantage: <i>All</i> of the application&#8217;s code now immediately becomes testable (i.e. accessible by unit test code) without having to do complex reorganization of your build process or source tree layout (although it is still a very good idea to enhance the build process s.t. the unit tests are stripped in the RTM builds and to make cfix.dll <a href='http://msdn.microsoft.com/en-us/library/yx9zd12s(VS.80).aspx'>a delayload DLL</a>). For many projects, relying on this feature will therefore make adopting cfix and maybe even unit testing in general <i>much</i> easier.</p>
<p>In almost all regards, EXE-embedded unit tests behave the same as their DLL counterparts. They are, however, slightly less handy when it comes to debugging (unless you use <a href='http://www.visualassert.com/'>Visual Assert</a>, which will shield you from this). For this reason, and their greater flexibility in general, it should be noted though that DLL-based unit tests will remain the preferred choice.</p>
<h3>Kernel mode multithreading</h3>
<p>Since its first release, cfix has featured support for multi-threaded test cases. Multi-threaded test cases are tests which spawn child threads and &#8212; and this is the important point &#8212; both, the &#8220;main&#8221; thread and the child threads may trigger assertions (i.e. use CFIX_ASSERT and friends). Regardless of the thread an assertion occurs on, it will be recognized by the framework and will lead to the test case being marked as having failed. In case this sounds trivial to you, be informed that not even JUnit properly supports this <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>And while this feature has been supported for user mode tests ever since, the infrastructure for kernel mode unit tests, which was added in version 1.1, has lacked support for this feature: There was no kernel mode counterpart of <a href='http://www.cfix-testing.org/unit-testing-framework/windows/doc/CfixCreateThread.html'>CfixCreateThread</a> and thus, only single-threaded kernel mode tests were supported.</p>
<p>cfix 1.5 now finally introduces <a href='http://www.cfix-testing.org/unit-testing-framework/windows/doc/CfixCreateSystemThread.html'>CfixCreateSystemThread</a>: CfixCreateSystemThread is basically a wrapper for PsCreateSystemThread with the added functionality of registering the child thread with cfix. Thus, all threads spawned using CfixCreateSystemThread (rather than using PsCreateSystemThread directly) are allowed to make use of assertions.</p>
<p><i>Kudos to Matt Oh for beta-testing this feature.</i></p>
<h3>Minor enhacements</h3>
<p>Another enhancement related to multi threaded tests is <i>Auto-joining of child threads</i>: After a test routine completes, the framework will now automatically check whether any child threads were created. If this is the case and any of these threads are still running, they will be waited on &#8212; not before all threads have terminated will the test run resume. This feature both makes writing multi-threaded tests more convenient (you do not have to wait by yourself) and safer (No more runaway child threads).</p>
<p>Finally, another feature worth noting is that by specifying the <code>-td</code> command line switch, cfix can be directed to <i>not</i> capture a stack backtrace when an assertion fails. Although stack backtraces are usually very helpful, the symbol loading can make their creation quite expensive. Using this switch can therefore speed up the usage of cfix.</p>
<h3>Download/Upgrade Now</h3>
<p>You see, there are many good reasons to upgrade your cfix installation or &#8212; in case you are not using cfix yet &#8212; to give cfix a try. </p>
<p>Better yet, check out the <a href='http://www.visualassert.com'>Visual Assert</a> AddIn for Visual C++ &#8212; it is based on the new cfix 1.5 release and seamlessly integrates with Visual Studio.</p>
<p><b><a href='https://sourceforge.net/projects/cfix/files/cfix/cfix%201.5.0/cfix_1.5.0.3535.msi/download'>Download cfix 1.5.0 Installer</a></b><br />
<b><a href='https://sourceforge.net/projects/cfix/files/cfix/cfix%201.5.0/cfix-src-1.5.0.3535.zip/download'>Download cfix 1.5.0 source code</a></b></p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Using diStorm with Python 2.6 and Python 3.x, revisited]]></title>
<link>http://breakingcode.wordpress.com/2009/08/31/using-distorm-with-python-2-6-and-python-3-x-revisited/</link>
<pubDate>Mon, 31 Aug 2009 22:01:54 +0000</pubDate>
<dc:creator>Mario Vilas</dc:creator>
<guid>http://breakingcode.wordpress.com/2009/08/31/using-distorm-with-python-2-6-and-python-3-x-revisited/</guid>
<description><![CDATA[In a previous post, we&#8217;ve seen how to wrap the diStorm disassembler library in Python, using c]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>In a <a href="http://breakingcode.wordpress.com/2009/05/27/using-distorm-with-python-2-6-and-python-3-x/">previous post</a>, we&#8217;ve seen how to wrap the <strong>diStorm disassembler</strong> library in <strong>Python</strong>, using <strong>ctypes</strong>. This still left us with the task of building the dynamic link library for our platform and installing it manually, which is not as easy as it may seem &#8211; among other small problems you may find, the new versions of Visual Studio try to force the use of the latest C++ runtime redistributables, which may not be present in most Windows installations.</p>
<p>Today, I&#8217;m introducing a <strong>new ctypes wrapper for diStorm</strong>, this time with all binaries prebuilt and packaged together. The installer script automatically detects the target platform and installs the right binary. It comes with the following <strong>prebuilt binaries</strong>:</p>
<ul>
<li>Windows on x86 and AMD64 processors</li>
<li>Linux on x86 and AMD64 processors (built using Ubuntu, but should work in other distros)</li>
<li>Mac OS X on x86 and PowerPC processors (untested, I don&#8217;t have a Mac to play with yet)</li>
</ul>
<p>Since the installer code is pretty much generic, it should be easy to add new platforms by simply creating the corresponding subdirectory and placing the python code and prebuilt binary in it. Contributions are welcome! <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<h2>Download</h2>
<h4>Python 2.x</h4>
<ul>
<li>Source code (all platforms): <a href="http://sourceforge.net/projects/winappdbg/files/diStorm/diStorm%201.7.30%20for%20Python%202/distorm-1.7.30.zip/download">distorm-1.7.30.zip</a></li>
<li>Source code (all platforms): <a href="http://sourceforge.net/projects/winappdbg/files/diStorm/diStorm%201.7.30%20for%20Python%202/distorm-1.7.30.tar.gz/download">distorm-1.7.30.tar.gz</a></li>
<li>Windows 32 bits installer: <a href="http://sourceforge.net/projects/winappdbg/files/diStorm/diStorm%201.7.30%20for%20Python%202/distorm-1.7.30.win32.exe/download">distorm-1.7.30.win32.exe</a></li>
<li>Windows 32 bits MSI installer: <a href="http://sourceforge.net/projects/winappdbg/files/diStorm/diStorm%201.7.30%20for%20Python%202/distorm-1.7.30.win32.msi/download">distorm-1.7.30.win32.msi</a></li>
<li>Windows 64 bits installer: <a href="http://sourceforge.net/projects/winappdbg/files/diStorm/diStorm%201.7.30%20for%20Python%202/distorm-1.7.30.win-amd64.exe/download">distorm-1.7.30.win-amd64.exe</a></li>
<li>Windows 64 bits MSI installer: <a href="http://sourceforge.net/projects/winappdbg/files/diStorm/diStorm%201.7.30%20for%20Python%202/distorm-1.7.30.win-amd64.msi/download">distorm-1.7.30.win-amd64.msi</a></li>
</ul>
<h4>Python 3.x</h4>
<ul>
<li>Source code (all platforms): <a href="http://sourceforge.net/projects/winappdbg/files/diStorm/diStorm%201.7.30%20for%20Python%203/distorm-1.7.30.zip/download">distorm-1.7.30.zip</a></li>
<li>Source code (all platforms): <a href="http://sourceforge.net/projects/winappdbg/files/diStorm/diStorm%201.7.30%20for%20Python%203/distorm-1.7.30.tar.gz/download">distorm-1.7.30.tar.gz</a></li>
<li>Windows 32 bits installer: <a href="http://sourceforge.net/projects/winappdbg/files/diStorm/diStorm%201.7.30%20for%20Python%203/distorm-1.7.30.win32.exe/download">distorm-1.7.30.win32.exe</a></li>
<li>Windows 32 bits MSI installer: <a href="http://sourceforge.net/projects/winappdbg/files/diStorm/diStorm%201.7.30%20for%20Python%203/distorm-1.7.30.win32.msi/download">distorm-1.7.30.win32.msi</a></li>
<li>Windows 64 bits installer: <a href="http://sourceforge.net/projects/winappdbg/files/diStorm/diStorm%201.7.30%20for%20Python%203/distorm-1.7.30.win-amd64.exe/download">distorm-1.7.30.win-amd64.exe</a></li>
<li>Windows 64 bits MSI installer: <a href="http://sourceforge.net/projects/winappdbg/files/diStorm/diStorm%201.7.30%20for%20Python%203/distorm-1.7.30.win-amd64.msi/download">distorm-1.7.30.win-amd64.msi</a></li>
</ul>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Wine 1.1.28 finally supports installing SecuROM-infected games without crashing]]></title>
<link>http://izanbardprince.wordpress.com/2009/08/28/wine-1-1-28-finally-supports-installing-securom-infected-games-without-crashing/</link>
<pubDate>Fri, 28 Aug 2009 23:20:03 +0000</pubDate>
<dc:creator>Ryan</dc:creator>
<guid>http://izanbardprince.wordpress.com/2009/08/28/wine-1-1-28-finally-supports-installing-securom-infected-games-without-crashing/</guid>
<description><![CDATA[Thanks go to Alexandre Julliard at Crossover/WineHQ for this patch I believe. I&#8217;ve been frustr]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p><img class="alignnone size-medium wp-image-1606" title="Wine" src="http://izanbardprince.wordpress.com/files/2009/08/winehq_logo_glass.png?w=191" alt="Wine" width="115" height="180" /></p>
<p><strong>Thanks go to Alexandre Julliard at Crossover/WineHQ for this patch I believe.</strong></p>
<p>I&#8217;ve been frustrated for a while now because of Sony&#8217;s SecuROM. For those that don&#8217;t know, it&#8217;s another kind of DRM malware, not as bad as Starforce, but that&#8217;s certainly not because they haven&#8217;t been trying.</p>
<p>Some games that are infected with SecuROM and other copy restriction malware install OK but crash Wine when you load the game, even though you have a perfectly legal copy, even if you put the original disc in the drive as it asks. It will keep saying &#8220;Please insert the original disc&#8221;, if it even starts without crashing Wine. Some older versions will see Wine and assume it&#8217;s a debugger or an attempt to bypass the copy restrictions, like YASU (integrated with Daemon Tools on Windows) uses to fool SecuROM infected games into mounting in the virtual disc drive it creates. (Side note: I think having to insert the disc is enough of an annoyance that these cracks actually abound on Windows when the user has actually bought the game)</p>
<p>Up til about last year, you could usually get the game installed and then go find a no-disc fixed EXE somewhere that would get the game you paid for and legally have the right to use, to work. I don&#8217;t even know how many laws that violates, and I don&#8217;t really care. I&#8217;ve never much appreciated Big Media pushing me around like some kind of software pirate just because I want to play the game I purchased on a non-Windows system.</p>
<p>Anyway, back to the issue, you could install but not play (unless you cracked the game&#8217;s EXE), but at least it installed. Then some greedy corporate fuck got the idea<strong> &#8220;What if we put SecuROM into the installer?&#8221;</strong>, so now you can&#8217;t even get it installed to later apply the fixed EXE.</p>
<p>The irony of it all is that you can still install the game then apply the no-disc EXE perfectly fine on Windows. This got me wondering if perhaps someone is merely doing this to crash Wine since<strong> it would have no affect at all</strong> on &#8220;software pirates&#8221;  on Windows (no copy restriction ever does hold them back for more than a few days, if that).</p>
<p>I say this because <a href="http://www.bethsoft.com/">Bethesda Softworks</a> certainly seems to be hostile to free software, they have a few decent games, but their engines always use like every feature of DirectX, their in-game music files are all MP3s (even Microsoft has been known to use the patent and royalty-free<a href="http://en.wikipedia.org/wiki/Vorbis"> Ogg Vorbis</a> in its in-game music!), and they&#8217;re getting to where they infect every title with some kind of customer-unfriendly DRM.</p>
<p>The original release of Oblivion didn&#8217;t even have copy protection at all though, mind you,  it would install and run just dandy, or at least as well as old pre-1.0 Wine could run it. Wine&#8217;s Direct3d 9 implementation has gotten much better lately and game texture details and performance rival the real DirectX 9 on Microsoft Windows in many cases.</p>
<p>So the only thing that was holding you back from playing the Game of the Year Edition (Knights of the Nine and Shivering Isles expansion packs included) that&#8217;s currently at every Walmart for $20 was the SecuROM infection that was introduced (actually this was in the installer for the standalone expansion disc pack earlier on).</p>
<p>I&#8217;m now happy to report that Oblivion GOTY Edition is working on Wine with no cracks and no Microsoft DirectX files. The installer takes a while to load, so be patient, and the second disc&#8217;s installer will throw an error that you can just click to get rid of and ignore.</p>
<p>I ran the game on High at 1680 x 1050 with show frames per second (HDR off, this still hurts performance more on Wine than Windows).</p>
<p>It&#8217;s not really a benchmark as much as a ballpark guess, but Wine performance seems about 5-10% slower than XP and about equal to Vista. This is pretty awesome considering just how visually heavy Oblivion is, that Wine is a compatibility layer on a totally foreign OS, and that Windows is poorly documented and has surely caused a lot of blood, sweat, and tears for the Wine folks.</p>
<p><strong>Another thing that disturbs me:</strong></p>
<p><strong></strong>ZeniMax, who owns Bethesda, also bought id Software, which in the past has always supported Linux with native versions of their games and didn&#8217;t use malicious or overly-invasive copy restrictions such as SecuROM. I have to wonder, with their new owners, if that Linux support will fade and if the damned filthy Sony DRM will encapsulate DOOM 4 and other future id Software titles. I would certainly hope that John Carmack would not let himself be pushed around in such a manner.</p>
<p><strong>So you may want to pop the cork on the champagne and cancel your Cedega subscriptions:</strong></p>
<p><strong></strong>About the only reason to keep Cedega around was because they licensed the copy protection compatibility modules and so problems like this didn&#8217;t affect them. Once you get past that, Cedega often does not run as well as Wine and while Wine is free, Cedega still costs something like $55 a year I believe.</p>
<p>Wine still does not run *every* Windows program out there. Some (like Winamp and its plugins) are so heavily dependent on the Win32 API that they&#8217;ll probably never work right, but seriously malfunctioning  programs on Wine are becoming more of the exception than the rule these days, and I think Wine 1.2 is shaping up to be a fair replacement option for XP holdouts and maybe even a few overburdoned Vista systems.</p>
<p>If anyone is interested, I think this patch is what finally turned the tide on SecuROM-the-Wine-killer:</p>
<p>&#8220;ntdll: Add a ret to DEFINE_REGS_ENTRYPOINT to make copy protections happy.&#8221; <a href="http://www.winehq.org/announce/1.1.28">-source Wine 1.1.28 changelog</a></p>
<p><a href="http://www.winehq.org/download/">Get Wine for your distribution here. </a></p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Writing Data-Driven Custom Actions]]></title>
<link>http://jpassing.wordpress.com/2009/08/26/writing-data-driven-custom-actions/</link>
<pubDate>Wed, 26 Aug 2009 17:36:57 +0000</pubDate>
<dc:creator>jpassing</dc:creator>
<guid>http://jpassing.wordpress.com/2009/08/26/writing-data-driven-custom-actions/</guid>
<description><![CDATA[Whenever Windows Installer&#8217;s built-in actions do not suffice to perform a specific task, a Cus]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Whenever Windows Installer&#8217;s built-in actions do not suffice to perform a specific task, a Custom Action needs to be written. Needless to say, Custom Actions, can be a bit tricky &#8212; not only can they be laborious to write and cumbersome to debug, they also run the risk of interfering with Windows Installer&#8217;s declarative, transactional way of performing installs.</p>
<p>It is not really surprising that Windows Installer therefore more or less discourages the use of Custom Actions unless it is absolutely necessary. Moreover, as a result of its declarative nature, it is understadable that Windows Installer prefers Custom Actions to be <a href='http://robmensching.com/blog/posts/2007/9/13/Zataoca-Custom-actions-should-be-data-driven'>data-driven</a>.</p>
<p>What this means in practice is that a Custom Action should not perform a hard-coded task &#8212; rather, it should query one or more (custom) tables containing the necessary information (in a declarative manner) about what is to be performed and should act accordingly.</p>
<p>Using WiX, creating custom tables turns out to be pretty easy. Let&#8217;s assume we create a Custom Action that, based on some condition, does something with a specific file. An appropriate table could look like this:</p>
<blockquote><pre>

&#60;CustomTable Id="MyCustomTable"&#62;
  &#60;Column Id="Id" Type="string" PrimaryKey="yes"/&#62;
  &#60;Column Id="Path" Type="string"/&#62;
  &#60;Column Id="Condition" Type="string"/&#62;

  &#60;Row&#62;
    &#60;Data Column="Id"&#62;Foo&#60;/Data&#62;
    &#60;Data Column="Path"&#62;[INSTALLLOCATION]foo.txt&#60;/Data&#62;
    &#60;Data Column="Condition"&#62;&#60;![CDATA[ &#38;FeatureFoo=3 ]]&#62;&#60;/Data&#62;
  &#60;/Row&#62;
  &#60;Row&#62;
    &#60;Data Column="Id"&#62;Bar&#60;/Data&#62;
    &#60;Data Column="Path"&#62;[INSTALLLOCATION]bar.txt&#60;/Data&#62;
    &#60;Data Column="Condition"&#62;&#60;![CDATA[ &#38;FeatureBar=3 ]]&#62;&#60;/Data&#62;
  &#60;/Row&#62;
&#60;/CustomTable&#62;
</pre>
</blockquote>
<p>To query this table, we have to open a view and fetch the records one by one:</p>
<blockquote><pre>
PMSIHANDLE Database = MsiGetActiveDatabase( InstallHandle );
ASSERT( Database != NULL );

PMSIHANDLE View;
UINT Result = MsiDatabaseOpenView(
  Database,
  L"SELECT `Condition`, `Path`, FROM `MyCustomTable`",
  &#38;View );
if ( ERROR_SUCCESS != Result )
{
  ...
}

Result = MsiViewExecute( View, NULL );
if ( ERROR_SUCCESS != Result )
{
  ...
}

for ( ;; )
{
  PMSIHANDLE Record;
  Result = MsiViewFetch( View, &#38;Record );
  if ( Result == ERROR_NO_MORE_ITEMS  )
  {
    break;
  }
  else if ( ERROR_SUCCESS != Result )
  {
    ...
  }

  //
  // Read condition.
  //
  // N.B. Do not format -- this is done by
  // MsiEvaluateCondition itself.
  //

  WCHAR Condition[ 256 ];
  DWORD Length = _countof( Condition );
  Result = MsiRecordGetString(
    Record,
    1,
    Condition,
    &#38;Length );
  if ( ERROR_SUCCESS != Result )
  {
    ...
  }

  if ( MSICONDITION_TRUE != MsiEvaluateCondition(
    InstallHandle,
    Condition ) )
  {
    //
    // This record can be skipped.
    //
    continue;
  }

  //
  // Read remaing fields.
  //

  WCHAR Path[ MAX_PATH ];
  Length = _countof( VszPath );
  Result = GetFormattedRecord(
    InstallHandle,
    Record,
    2,
    Path,
    &#38;Length );
  if ( ERROR_SUCCESS != Result )
  {
    ...
  }

  ...
}
</pre>
</blockquote>
<p>With <code>GetFormattedRecord</code> being the following utility routine:</p>
<blockquote><pre>

static UINT GetFormattedRecord(
  __in MSIHANDLE InstallHandle,
  __in MSIHANDLE Record,
  __in UINT Field,
  __out PWSTR Value,
  __inout PDWORD Length
  )
{
  DWORD RecLength = *Length;
  UINT Result = MsiRecordGetString(
    Record,
    Field,
    Value,
    &#38;RecLength );
  if ( ERROR_SUCCESS != Result )
  {
    *Length = RecLength;
    return Result;
  }

  PMSIHANDLE FormattingRecord = MsiCreateRecord( 1 );

  Result = MsiRecordSetString( FormattingRecord, 0, Value );
  if ( ERROR_SUCCESS != Result )
  {
    return Result;
  }

  return MsiFormatRecord(
    InstallHandle,
    FormattingRecord,
    Value,
    Length );
}
</pre>
</blockquote>
<p>Some things are worth noting:</p>
<ul>
<li>I use PMSIHANDLE, which, as you probably already know, is not a typedef for MSIHANDLE* but rather a smart-pointer like class that automatically closes the handle when it goes out of scope.</li>
<li>The use of backticks in the query.</li>
<li>It must have been a Visual Basic programmer implementing <code>MsiRecordGetString</code>: Field Indexes start with 1, not 0. To make matters worse, reading from index 0 does not fail but returns arbitrary data. Finally, to confuse people further, indexes are 0-based for <code>MsiRecordSetString</code>.</li>
<li>If the field contains formatted data, you have to <code>MsiFormatRecord</code> it yourself. For conditions, however, <code>MsiEvaluateCondition</code> handles that for you.</li>
</ul>
<p>So far, so good. There is, however, one thing to notice: To access the installer database, the custom action <a href='http://msdn.microsoft.com/en-us/library/aa367457(VS.85).aspx'>must be a <i>nondeferred</i> action</a>:</p>
<blockquote><p>
You cannot access the current installer session or all property data from a deferred execution custom action
</p></blockquote>
<p>The problem with nondeferred actions, however, is that they execute in user context &#8212; in contrast to deferred actions, which execute in system context. On pre-Vista platforms, a per-machine installer package can be expected to always be launched by an administrator (otherwise it will fail anyway) &#8212; in this case, the differences between user and system context may not be important &#8212; both, for example, have r/w access to files in %ProgramFiles%. On Vista and later OS, however, it is common to have a regular user launch an installation which causes an elevation prompt once it reaches the main install phase. In this case, the user context is significantly less privileged than system context.</p>
<p>For a hypothetical custom action that is intended to edit a file installed to %ProgramFiles%, this means that (disregarding rollback considerations and assuming proper scheduling) performing this action from within the nondeferred custom action will work fine on pre-Vista OS. When run on Vista, though, it is likely to fail due to lack of write access to %ProgramFiles%. In practice, this means that all system-changing tasks usually have to be performed by a deferred action.</p>
<p>To sum up: To be data-driven, you have to use nondeferred actions. To be able to perform any serious, system state-changing tasks, however, you have to use deferred actions. </p>
<p>Great.</p>
<p>As it turns out, however, there is a way to escape this catch-22, and it is carefully buried in the Windows Installer documentation:</p>
<blockquote><p>
[...] Actions that update the system, such as the InstallFiles and WriteRegistryValues actions, cannot be run by calling MsiDoAction. The exception to this rule is if MsiDoAction is called from a custom action that is scheduled in the InstallExecuteSequence table between the InstallInitialize and InstallFinalize actions. [...]
</p></blockquote>
<p>[From the <i>Remarks</i> section of <a href='http://msdn.microsoft.com/en-us/library/aa370090(VS.85).aspx'>MsiDoAction</a>]</p>
<p>In fact, the way I came across this solution was by looking at the source code of the WiX <code>XmlFile</code> action, which I knew manages to both be data-driven (uses a custom table) and alter system state (edits XML files). The way it does this, and the point where the above remark comes into play, is as follows: In the nondeferred action, you do not perform any actions changing system state. Rather, you collect the information from the installer tables and stuff it (yuck) into the <code>CustomActionData</code> property. Then, leveraging <code>MsiDoAction</code> and passing said <code>CustomActionData</code>, you schedule another custom action &#8212; this time a deferred one &#8212; which parses the <code>CustomActioData</code> (yuck) and, based on this data, finally performs the actual modifications &#8212; in system context.</p>
<p>It really could not be easier and more intuitive, right?</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Novo vírus: alerta para desenvolvedores!]]></title>
<link>http://caiobarbosa.wordpress.com/2009/08/19/novo-virus-alerta-para-desenvolvedores/</link>
<pubDate>Wed, 19 Aug 2009 16:50:57 +0000</pubDate>
<dc:creator>caiobarbosa</dc:creator>
<guid>http://caiobarbosa.wordpress.com/2009/08/19/novo-virus-alerta-para-desenvolvedores/</guid>
<description><![CDATA[Olá desenvolvedores, O novo vírus afeta programas escritos em Delphi. Descritivo: Os desenvolvedores]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p style="text-align:justify;">Olá desenvolvedores,</p>
<p style="text-align:justify;">O novo vírus afeta <strong>programas escritos em Delphi</strong>.</p>
<p style="text-align:justify;"><strong>Descritivo:</strong></p>
<p style="text-align:justify;">Os desenvolvedores com as máquinas infectadas vão passar a infecção para todos os programas que estiverem criando. A Sonicwall e outras empresas de softwares antivírus já atualizaram seus programas para possibilitar a detecção e bloqueio do Win32.Induc.</p>
<p style="text-align:justify;">
<p style="text-align:justify;">Fonte: Baboo.</p>
<p style="text-align:justify;">
<p style="text-align:justify;">, abraço.</p>
<p style="text-align:justify;">
<p style="text-align:justify;"><strong>Caio Barbosa<br />
Desenvolvedor Web </strong></p>
</div>]]></content:encoded>
</item>

</channel>
</rss>
