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

<channel>
	<title>RaMMicHaeL&#039;s home page &#187; Programming</title>
	<atom:link href="http://rammichael.com/category/programming/feed" rel="self" type="application/rss+xml" />
	<link>http://rammichael.com</link>
	<description>Just another WordPress site</description>
	<lastBuildDate>Fri, 20 Apr 2012 22:56:30 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>A command-line screenshot maker</title>
		<link>http://rammichael.com/a-command-line-screenshot-maker</link>
		<comments>http://rammichael.com/a-command-line-screenshot-maker#comments</comments>
		<pubDate>Mon, 16 Nov 2009 17:20:44 +0000</pubDate>
		<dc:creator>RaMMicHaeL</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://rammichael.com/?p=92</guid>
		<description><![CDATA[When googling for a command-line screenshot maker, all I found was a bloated 3 MB tool and this nifty piece of code. So I took it and added some command line options I needed: Perhaps it&#8217;s gonna be useful to others, so I&#8217;m releasing it. The code and a compiled binary are attached.]]></description>
			<content:encoded><![CDATA[<p>When googling for a command-line screenshot maker, all I found was a bloated 3 MB tool and <a href="http://blog.mozilla.com/ted/2009/02/05/command-line-screenshot-tool-for-windows/" target="_blank">this</a> nifty piece of code.<br />
So I took it and added some command line options I needed:</p>
<pre class="brush: plain; light: true; title: ; notranslate">-filename &amp;quot;my screeny.png&amp;quot;    file name (default: screenshot.png)
-encoder png                  file encoder: bmp/jpeg/gif/tiff/png (default: png)
-quality 100                  file quality for jpeg (between 0 and 100)
-resize 50                    image size, % of the original size (between 1 and 99)</pre>
<p>Perhaps it&#8217;s gonna be useful to others, so I&#8217;m releasing it.<br />
The code and a compiled binary are attached.</p>
<p><a href="http://rammichael.com/downloads/source.rar" title="source.rar&#10;&#10;Size: 2.97 KB&#10;Downloads: 1429"><img alt="rar" title="rar" class="download-icon" src="http://rammichael.com/wp-content/plugins/download-monitor/img/filetype_icons/document-zipper.png" /> source.rar</a> (2.97 KB)<br />
<p><a href="http://rammichael.com/downloads/binary.rar" title="binary.rar&#10;&#10;Size: 20.24 KB&#10;Downloads: 8675"><img alt="rar" title="rar" class="download-icon" src="http://rammichael.com/wp-content/plugins/download-monitor/img/filetype_icons/document-zipper.png" /> binary.rar</a> (20.24 KB)</p>
</p>
]]></content:encoded>
			<wfw:commentRss>http://rammichael.com/a-command-line-screenshot-maker/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Custom Buffer-Manipulation Routines</title>
		<link>http://rammichael.com/custom-buffer-manipulation-routines</link>
		<comments>http://rammichael.com/custom-buffer-manipulation-routines#comments</comments>
		<pubDate>Mon, 12 Oct 2009 18:37:49 +0000</pubDate>
		<dc:creator>RaMMicHaeL</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://rammichael.com/?p=77</guid>
		<description><![CDATA[Here&#8217;s my rewrite of the Custom Buffer-Manipulation Routines by Piotr Mintus. Optimized for and works on 32-bit and 64-bit environments.]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s my rewrite of the <a href="http://in4k.untergrund.net/various%20web%20articles/Creating_Small_Win32_Executables_-_Fast_Builds.htm#buffer" target="_blank">Custom Buffer-Manipulation Routines</a> by Piotr Mintus.<br />
Optimized for and works on 32-bit and 64-bit environments.</p>
<pre class="brush: cpp; collapse: true; light: false; title: ; toolbar: true; notranslate">//**********************************************************************
// File: buffer.h
//
// Custom Buffer-Manipulation Routines
//
// By RaMMicHaeL, 12.10.2009
//**********************************************************************

#ifndef _BUFFER_H_
#define _BUFFER_H_

#ifdef FillMemory
#undef FillMemory
#endif
#ifdef ZeroMemory
#undef ZeroMemory
#endif
#ifdef CopyMemory
#undef CopyMemory
#endif
#ifdef MoveMemory
#undef MoveMemory
#endif

__forceinline
void FillMemory(PVOID Destination, SIZE_T Length, BYTE Fill)
{
	SIZE_T *sizet_p;
	unsigned char *uchar_p;
	SIZE_T sizet_fill;
	SIZE_T count;

	sizet_p = (SIZE_T *)Destination;

	count = Length/sizeof(SIZE_T);
	if(count)
	{
		sizet_fill = Fill;
		sizet_fill |= sizet_fill &lt;&lt; 8;
		sizet_fill |= sizet_fill &lt;&lt; 16;

#ifdef _WIN64
		sizet_fill |= sizet_fill &lt;&lt; 32;
#endif

		do
			*(sizet_p++) = sizet_fill;
		while(--count);
	}

	uchar_p = (unsigned char *)sizet_p;

	count = Length &amp; (sizeof(SIZE_T)-1);
	if(count)
	{
		do
			*(uchar_p++) = Fill;
		while(--count);
	}
}

#define ZeroMemory(Destination, Length) FillMemory(Destination, Length, 0)

__forceinline
void CopyMemory(PVOID Destination, const VOID *Source, SIZE_T Length)
{
	SIZE_T *sizet_p_dest, *sizet_p_src;
	unsigned char *uchar_p_dest, *uchar_p_src;
	SIZE_T count;

	sizet_p_dest = (SIZE_T *)Destination;
	sizet_p_src = (SIZE_T *)Source;

	count = Length/sizeof(SIZE_T);
	if(count)
	{
		do
			*(sizet_p_dest++) = *(sizet_p_src++);
		while(--count);
	}

	uchar_p_dest = (unsigned char *)sizet_p_dest;
	uchar_p_src = (unsigned char *)sizet_p_src;

	count = Length &amp; (sizeof(SIZE_T)-1);
	if(count)
	{
		do
			*(uchar_p_dest++) = *(uchar_p_src++);
		while(--count);
	}
}

__forceinline
void MoveMemory(PVOID Destination, const VOID *Source, SIZE_T Length)
{
	SIZE_T *sizet_p_dest, *sizet_p_src;
	unsigned char *uchar_p_dest, *uchar_p_src;
	SIZE_T count;

	if(Destination &gt; Source)
	{
		// Copy in reverse

		uchar_p_dest = (unsigned char *)Destination+Length;
		uchar_p_src = (unsigned char *)Source+Length;

		count = Length &amp; (sizeof(SIZE_T)-1);
		if(count)
		{
			do
				*(--uchar_p_dest) = *(--uchar_p_src);
			while(--count);
		}

		sizet_p_dest = (SIZE_T *)uchar_p_dest;
		sizet_p_src = (SIZE_T *)uchar_p_src;

		count = Length/sizeof(SIZE_T);
		if(count)
		{
			do
				*(--sizet_p_dest) = *(--sizet_p_src);
			while(--count);
		}
	}
	else
		CopyMemory(Destination, Source, Length);
}

#endif  // _BUFFER_H_
</pre>
]]></content:encoded>
			<wfw:commentRss>http://rammichael.com/custom-buffer-manipulation-routines/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

