<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Christoph Lindemann's Weblog</title>
	<atom:link href="http://clindemann.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://clindemann.wordpress.com</link>
	<description>GDI, printers, protocol/file reverse engineering and general hacking around Windows internals</description>
	<lastBuildDate>Tue, 05 Aug 2008 12:17:27 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='clindemann.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Christoph Lindemann's Weblog</title>
		<link>http://clindemann.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://clindemann.wordpress.com/osd.xml" title="Christoph Lindemann&#039;s Weblog" />
	<atom:link rel='hub' href='http://clindemann.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Extended logging of the Windows boot process</title>
		<link>http://clindemann.wordpress.com/2008/08/05/extended-logging-of-the-windows-boot-process/</link>
		<comments>http://clindemann.wordpress.com/2008/08/05/extended-logging-of-the-windows-boot-process/#comments</comments>
		<pubDate>Tue, 05 Aug 2008 12:17:27 +0000</pubDate>
		<dc:creator>clindemann</dc:creator>
				<category><![CDATA[Debug]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[windows; boot; log; UserEnvDebugLevel; ntbtlog.txt; wmi]]></category>

		<guid isPermaLink="false">http://clindemann.wordpress.com/2008/08/05/extended-logging-of-the-windows-boot-process/</guid>
		<description><![CDATA[Extended logging of the Windows boot process, the glory of NT Kernel Tracing<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=clindemann.wordpress.com&amp;blog=4290359&amp;post=17&amp;subd=clindemann&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>At one of our customers the workstations hang at startup when one of our services was installed. And as the <strong>UserEnvDebugLevel</strong> and <strong>ntbtlog.txt</strong> stuff together with enabled tracing in our own service did not give any clues: I was clueless about what was going on.</p>
<p>I was already preparing myself for the coming &quot;trail and error&quot; torture, when it hit me: <strong>NT Kernel Tracing</strong>, this fantastic driver development tool, why not use it to track what is going on during boot.</p>
<p>And it turned out to be fantastically helpful and easy to use. I got all the information I needed process start times, threads, file I/O, registry&#8230;</p>
<p>Check out <a href="http://msdn.microsoft.com/en-us/library/ms797172.aspx"><strong>Boot-Time Global Logger Session</strong></a> in the <strong><a href="http://www.microsoft.com/whdc/devtools/wdk/default.mspx">Windows Driver Kit</a></strong> it saved me lots of work.</p>
<p>Also check out <a href="http://msdn.microsoft.com/en-us/library/aa490396.aspx"><strong>WMI Event Tracing</strong></a> or <a href="http://msdn.microsoft.com/en-us/library/cc305214.aspx">Event Tracing for Windows</a> (Vista) which is the framework.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/clindemann.wordpress.com/17/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/clindemann.wordpress.com/17/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/clindemann.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/clindemann.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/clindemann.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/clindemann.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/clindemann.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/clindemann.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/clindemann.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/clindemann.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/clindemann.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/clindemann.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/clindemann.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/clindemann.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/clindemann.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/clindemann.wordpress.com/17/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=clindemann.wordpress.com&amp;blog=4290359&amp;post=17&amp;subd=clindemann&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://clindemann.wordpress.com/2008/08/05/extended-logging-of-the-windows-boot-process/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/57a1f866a8d83df7996fe916982e5daf?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">clindemann</media:title>
		</media:content>
	</item>
		<item>
		<title>Windows ReadPrinter BIDI communication is possible!</title>
		<link>http://clindemann.wordpress.com/2008/07/22/windows-readprinter-bidi-communication-is-possible/</link>
		<comments>http://clindemann.wordpress.com/2008/07/22/windows-readprinter-bidi-communication-is-possible/#comments</comments>
		<pubDate>Tue, 22 Jul 2008 09:28:03 +0000</pubDate>
		<dc:creator>clindemann</dc:creator>
				<category><![CDATA[GDI]]></category>
		<category><![CDATA[Printing]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[Windows Printing]]></category>
		<category><![CDATA[BIDI]]></category>
		<category><![CDATA[OpenPrinter]]></category>
		<category><![CDATA[Printer]]></category>
		<category><![CDATA[printer driver]]></category>
		<category><![CDATA[ReadPrinter]]></category>

		<guid isPermaLink="false">http://clindemann.wordpress.com/?p=9</guid>
		<description><![CDATA[Just read in a post from Jeffrey Tan that BIDI communication with the printer is actually possible. I always thought that this was impossible, as Windows restrics the read access to any ports to language monitors only. But now it turns out, you can work around this, by creating a dummy job, and then opening [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=clindemann.wordpress.com&amp;blog=4290359&amp;post=9&amp;subd=clindemann&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Just read in a <a href="http://groups.google.dk/group/microsoft.public.win32.programmer.gdi/msg/ad2a736eaa43491b?hl=en">post from Jeffrey Tan</a> that BIDI communication with the printer is actually possible.</p>
<p>I always thought that this was impossible, as Windows restrics the read access to any ports to language monitors only.</p>
<p>But now it turns out, you can work around this, by creating a dummy job, and then opening a handle to that job with OpenPrinter. You ofcourse still need the port monitor to support bidi.</p>
<pre style="padding-left:30px;"><span style="color:#0000ff;">#define </span>BUFSIZE 256
BOOL TestReadPrinterWithJob(LPSTR szPrinterName)
{
HANDLE hPrinter = NULL;
HANDLE hPrinterJob = NULL;
DWORD dwBytesRead;
LPVOID lpBytes = NULL;
DOC_INFO_1 dc;
DWORD jobid;
TCHAR jobStr[100];
<span style="color:#008000;">// Open a handle to the printer.
</span>if (!OpenPrinter(szPrinterName, &amp;hPrinter, NULL))
{
PrintError(GetLastError(), <span style="color:#993300;">"OpenPrinter"</span>);
return FALSE;
}
<span style="color:#008000;">// We can't read from a printer handle, but we can read from
// a printer job handle, So the trick is to create a Job using
// StartDocPrinter, then open a handle to the printer job...
</span>ZeroMemory(&amp;dc, sizeof(DOC_INFO_1));
dc.pDocName=<span style="color:#993300;">"Dummy job"</span>;
jobid = StartDocPrinter(hPrinter,1,(LPSTR)&amp;dc); <span style="color:#008000;">// start a Doc </span>
if (jobid == 0)
{
ClosePrinter(hPrinter);
PrintError(GetLastError(), <span style="color:#993300;">"OpenPrinter"</span>);
return FALSE;
}
<span style="color:#008000;">// Open handle to the printer job...
</span>wsprintf(jobStr, <span style="color:#993300;">"%s,Job %i"</span>, szPrinterName, jobid);
if (!OpenPrinter(jobStr, &amp;hPrinterJob, NULL))
{
ClosePrinter(hPrinter);
PrintError(GetLastError(), <span style="color:#993300;">"OpenPrinter Job"</span>);
return FALSE;
}
<span style="color:#008000;"><span id="more-9"></span>// Allocate a buffer to read printer data into...
</span>lpBytes = (LPVOID)malloc(BUFSIZE);
if (!lpBytes)
{
PrintError(GetLastError(), <span style="color:#993300;">"malloc"</span>);
ClosePrinter(hPrinter);
ClosePrinter(hPrinterJob);
return FALSE;
}
<span style="color:#008000;">// Try ReadPrinter...
</span>SetLastError(0);
if (!ReadPrinter(hPrinterJob, lpBytes, BUFSIZE, &amp;dwBytesRead))
{
PrintError(GetLastError(), <span style="color:#993300;">"ReadPrinter"</span>);
ClosePrinter(hPrinter);
ClosePrinter(hPrinterJob);
if (lpBytes)
free(lpBytes);
return FALSE;
}
else
{
printf(<span style="color:#993300;">"%i bytes successfully read by ReadPrinter (%i attempted)\n"</span>,
dwBytesRead, BUFSIZE);
}
<span style="color:#008000;">// Clean up...
</span>ClosePrinter(hPrinterJob);
EndDocPrinter(hPrinter); <span style="color:#008000;">// end the doc </span>
ClosePrinter(hPrinter);
if (lpBytes)
free(lpBytes);
return TRUE;
}
void PrintError( DWORD dwError, LPCSTR lpString )
{
#define MAX_MSG_BUF_SIZE 512
char *msgBuf;
DWORD cMsgLen;
cMsgLen = FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM |
FORMAT_MESSAGE_ALLOCATE_BUFFER | 40, NULL, dwError,
MAKELANGID(0, SUBLANG_ENGLISH_US), (LPTSTR) &amp;msgBuf, MAX_MSG_BUF_SIZE,
NULL);
printf( <span style="color:#993300;">"%s Error [%d]:: %s\n"</span>, lpString, dwError, msgBuf );
LocalFree( msgBuf );
#undef MAX_MSG_BUF_SIZE
}</pre>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/clindemann.wordpress.com/9/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/clindemann.wordpress.com/9/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/clindemann.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/clindemann.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/clindemann.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/clindemann.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/clindemann.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/clindemann.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/clindemann.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/clindemann.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/clindemann.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/clindemann.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/clindemann.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/clindemann.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/clindemann.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/clindemann.wordpress.com/9/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=clindemann.wordpress.com&amp;blog=4290359&amp;post=9&amp;subd=clindemann&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://clindemann.wordpress.com/2008/07/22/windows-readprinter-bidi-communication-is-possible/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/57a1f866a8d83df7996fe916982e5daf?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">clindemann</media:title>
		</media:content>
	</item>
		<item>
		<title>Vista does cache printer handles from OpenPrinter</title>
		<link>http://clindemann.wordpress.com/2008/07/22/vista-does-cache-printer-handles-from-openprinter/</link>
		<comments>http://clindemann.wordpress.com/2008/07/22/vista-does-cache-printer-handles-from-openprinter/#comments</comments>
		<pubDate>Tue, 22 Jul 2008 09:06:40 +0000</pubDate>
		<dc:creator>clindemann</dc:creator>
				<category><![CDATA[GDI]]></category>
		<category><![CDATA[Printing]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[Windows Printing]]></category>
		<category><![CDATA[BIDI]]></category>
		<category><![CDATA[OpenPrinter]]></category>
		<category><![CDATA[Printer]]></category>
		<category><![CDATA[printer driver]]></category>
		<category><![CDATA[ReadPrinter]]></category>
		<category><![CDATA[Vista]]></category>

		<guid isPermaLink="false">http://clindemann.wordpress.com/?p=7</guid>
		<description><![CDATA[According to a interesting post by Carey Gregory, Windows Vista is caching printer handles that are opened with OpenPrinter even when they are BIDI handles. So if you use OpenPrinter to do stuff like accessing the job or the Xvc interface, you gonna get problems. To fix this, you need to use OpenPrinter2 (on Vista) [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=clindemann.wordpress.com&amp;blog=4290359&amp;post=7&amp;subd=clindemann&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>According to a interesting <a href="http://groups.google.dk/group/microsoft.public.development.device.drivers/msg/2f798cd53fe67f40?hl=en">post by Carey Gregory</a>, <strong>Windows Vista is caching printer handles</strong> that are opened with OpenPrinter <strong>even when they are BIDI handles.</strong></p>
<p>So if you use OpenPrinter to do stuff like accessing the job or the Xvc interface, you gonna get problems. To fix this, you need to use <strong><a href="http://msdn.microsoft.com/en-us/library/ms536096(VS.85).aspx">OpenPrinter2</a></strong> (on Vista) and specify PRINTER_OPTION_NO_CACHE.</p>
<p>Ahrg!</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/clindemann.wordpress.com/7/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/clindemann.wordpress.com/7/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/clindemann.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/clindemann.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/clindemann.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/clindemann.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/clindemann.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/clindemann.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/clindemann.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/clindemann.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/clindemann.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/clindemann.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/clindemann.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/clindemann.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/clindemann.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/clindemann.wordpress.com/7/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=clindemann.wordpress.com&amp;blog=4290359&amp;post=7&amp;subd=clindemann&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://clindemann.wordpress.com/2008/07/22/vista-does-cache-printer-handles-from-openprinter/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/57a1f866a8d83df7996fe916982e5daf?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">clindemann</media:title>
		</media:content>
	</item>
		<item>
		<title>My first post</title>
		<link>http://clindemann.wordpress.com/2008/07/22/my-first-post/</link>
		<comments>http://clindemann.wordpress.com/2008/07/22/my-first-post/#comments</comments>
		<pubDate>Tue, 22 Jul 2008 07:17:43 +0000</pubDate>
		<dc:creator>clindemann</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[personal]]></category>

		<guid isPermaLink="false">http://clindemann.wordpress.com/?p=3</guid>
		<description><![CDATA[I will try this blog&#8217;in, and see how it goes. The net includes lots of other blogs I found very helpfull, so maybe I can share some knowledge too. This is my first blog, so I don&#8217;t know how this will be something i enjoy, or not. But you never know if you don&#8217;t try.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=clindemann.wordpress.com&amp;blog=4290359&amp;post=3&amp;subd=clindemann&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I will try this blog&#8217;in, and see how it goes. The net includes lots of other blogs I found very helpfull, so maybe I can share some knowledge too.</p>
<p>This is my first blog, so I don&#8217;t know how this will be something i enjoy, or not. But you never know if you don&#8217;t try.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/clindemann.wordpress.com/3/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/clindemann.wordpress.com/3/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/clindemann.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/clindemann.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/clindemann.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/clindemann.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/clindemann.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/clindemann.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/clindemann.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/clindemann.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/clindemann.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/clindemann.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/clindemann.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/clindemann.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/clindemann.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/clindemann.wordpress.com/3/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=clindemann.wordpress.com&amp;blog=4290359&amp;post=3&amp;subd=clindemann&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://clindemann.wordpress.com/2008/07/22/my-first-post/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/57a1f866a8d83df7996fe916982e5daf?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">clindemann</media:title>
		</media:content>
	</item>
	</channel>
</rss>
