<?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>Windows CE Networking Team WebLog : Author: John Spaith</title><link>http://blogs.msdn.com/cenet/archive/tags/Author_3A00_+John+Spaith/default.aspx</link><description>Tags: Author: John Spaith</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Kerberos cannot resolve netapi32.dll in CE5.0 after QFE updates</title><link>http://blogs.msdn.com/cenet/archive/2008/05/16/kerberos-cannot-resolve-netapi32-dll-in-ce5-0-after-qfe-updates.aspx</link><pubDate>Fri, 16 May 2008 19:37:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8513825</guid><dc:creator>cenet</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/cenet/comments/8513825.aspx</comments><wfw:commentRss>http://blogs.msdn.com/cenet/commentrss.aspx?PostID=8513825</wfw:commentRss><description>&lt;P&gt;If you install the recent CE 5.0 QFE's AND try to build Kerberos.dll, you will run into a bug that unfortunately was introduced in this QFE.&amp;nbsp; Check out customer thread alerting us to it &lt;A class="" href="http://groups.google.com/group/microsoft.public.windowsce.embedded/browse_thread/thread/7fcf17ca2210f18b/734ad43a17e0c8d7?lnk=st&amp;amp;q=late+bind+from+kerberos.dll+to+NETAPI32.dll#734ad43a17e0c8d7" mce_href="http://groups.google.com/group/microsoft.public.windowsce.embedded/browse_thread/thread/7fcf17ca2210f18b/734ad43a17e0c8d7?lnk=st&amp;amp;q=late+bind+from+kerberos.dll+to+NETAPI32.dll#734ad43a17e0c8d7"&gt;here&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Short summary is that customer is seeing:&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;"Warning: Unable to do imports from kerberos.dll to NETAPI32.dll - will late bind"&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Root cause:&lt;/STRONG&gt; &lt;/P&gt;
&lt;P&gt;To fix a problem with how Kerberos resolves domain names (basically turning REDMOND domain into a DC controller mydomain-controllername.redmond.microsoft.com), Kerberos was changed to call into the official NetApi32 &lt;A class="" href="http://msdn.microsoft.com/en-us/library/aa450367.aspx" mce_href="http://msdn.microsoft.com/en-us/library/aa450367.aspx"&gt;DsGetDcName&lt;/A&gt;&amp;nbsp;instead of using a private interface.&amp;nbsp; This meant that kerberos has a dependency on Netapi32.dll being in the image which previously it did not.&amp;nbsp; Customers never think about dependency logic (or hardly ever) because Microsoft runs a large suite of tests to make sure that if component A relies on component B being in the image it explicitly sets it (Kerberos needing Netapi32 in this case) and we fix these issues before releasing the product.&lt;/P&gt;
&lt;P&gt;In this case, because it was a QFE we don't usually add dependencies like this, so we didn't catch the dependency prior to QFE release.&lt;/P&gt;
&lt;P&gt;The customer workaround is straightforward.&amp;nbsp; Basically set SYSGEN_NETAPI32=1 (I'm not sure what exactly this translates to in the IDE catalog, probably something like "Domain Discovery").&amp;nbsp; You only need to do this if you include Kerberos component, which most devices do not.&amp;nbsp; As near as I can tell, the only way you get kerberos is of course if you manually include it, or if you bring in the voipPhone local authentication plugin (SYSGEN_VOIPPHONE_LAP).&lt;/P&gt;
&lt;P&gt;We apologize for the inconvenience.&amp;nbsp; We're going to be releasing the same QFE effectively in CE6.0 and we will fixup the dependencies prior to releasing that QFE.&lt;/P&gt;
&lt;P&gt;John&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8513825" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/cenet/archive/tags/Author_3A00_+John+Spaith/default.aspx">Author: John Spaith</category></item><item><title>Old Man Spaith is out of ideas</title><link>http://blogs.msdn.com/cenet/archive/2008/03/09/old-man-spaith-is-out-of-ideas.aspx</link><pubDate>Mon, 10 Mar 2008 01:08:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8119092</guid><dc:creator>cenet</dc:creator><slash:comments>12</slash:comments><comments>http://blogs.msdn.com/cenet/comments/8119092.aspx</comments><wfw:commentRss>http://blogs.msdn.com/cenet/commentrss.aspx?PostID=8119092</wfw:commentRss><description>&lt;P&gt;I just checked out the blog and realized it's been ~1.5 months since the last post, which is lame.&amp;nbsp; I have a dilemna since I've run out of tricks/advice that I think are useful, for now at least.&amp;nbsp; I&amp;nbsp;can either write nothing or do something random, like put up a picture of my dog, Daisy.&amp;nbsp; It never would've occurred to me to do this, even in desperation for posts, on what I think of as a work-blog&amp;nbsp;until I checked out the main feed at blogs.msdn.com.&amp;nbsp; I was amazed at the number of personal, totally random, stuff up there.&lt;/P&gt;
&lt;P&gt;My compromise is that I'll just link to pictures of Daisy rather than wasting bandwidth for people here for work.&amp;nbsp;&amp;nbsp;So check out&amp;nbsp;&lt;A class="" href="http://my.spaith.com/blog/2007/12/18/a-toastmasters-best-friend/" mce_href="http://my.spaith.com/blog/2007/12/18/a-toastmasters-best-friend/"&gt;Daisy Spaith&lt;/A&gt; on my &lt;A class="" href="http://my.spaith.com/" mce_href="http://my.spaith.com"&gt;Toastmasters blog&lt;/A&gt;, &lt;A class=""&gt;www.mySpaith.com&lt;/A&gt;.&amp;nbsp; (I guess given MS investment in Facebook I should've named SpaithBook, but I put it up before that and mySpaith is better anyway.)&lt;/P&gt;
&lt;P&gt;I wish I could say we had made CE networking technologies so easy and awesome for our developers that we could turn the CENet blog into the "dogs of the CE Networking team" site.&amp;nbsp; We know we're not there yet.&amp;nbsp; Please keep the questions coming in the newsgroups and we'll do our best to help.&amp;nbsp; Thanks for your continued support through the years.&amp;nbsp; I'll try to come up with better stuff so we can avoid the self-indulgent posts like this I promise.&lt;/P&gt;
&lt;P&gt;-- Old Man Spaith (just turned 31, it's down hill from here)&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8119092" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/cenet/archive/tags/Author_3A00_+John+Spaith/default.aspx">Author: John Spaith</category></item><item><title>Problems building svsutil.hxx in Windows Mobile SDK</title><link>http://blogs.msdn.com/cenet/archive/2008/01/22/problems-building-svsutil-hxx-in-windows-mobile-sdk.aspx</link><pubDate>Tue, 22 Jan 2008 19:42:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:7199595</guid><dc:creator>cenet</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/cenet/comments/7199595.aspx</comments><wfw:commentRss>http://blogs.msdn.com/cenet/commentrss.aspx?PostID=7199595</wfw:commentRss><description>&lt;P&gt;If you try to build &lt;A class="" href="http://blogs.msdn.com/cenet/archive/2005/06/14/429004.aspx" mce_href="http://blogs.msdn.com/cenet/archive/2005/06/14/429004.aspx"&gt;svsutil.hxx&lt;/A&gt; on certain versions of the Windows Mobile SDK, you may run into build errors.&amp;nbsp; I know it's on WM5 SDK at a minimum, I don't know about WM6 SDK.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The error you'll see will complain about the methods int operator==(int iBit) and int operator==(SVSBitField &amp;amp;bf) in the class SVSBitField in particular.&amp;nbsp; What happened is that the compiler got a bit more picky at some point but the SDK headers weren't updated to reflect this in the given SDK version.&amp;nbsp; We have fixed this in latest &amp;amp; greatest svsutil.hxx.&lt;/P&gt;
&lt;P&gt;If you run into this, what you'll need to do is change the initial&lt;BR&gt;&amp;nbsp;&amp;nbsp;for (int i = 0 ; i &amp;lt; m_iWLength - 1 ; ++i) {&lt;BR&gt;&lt;/P&gt;
&lt;P align=left&gt;So that the 'int i' is outside the for loop, namely:&lt;/P&gt;
&lt;P align=left&gt;&amp;nbsp;&amp;nbsp;int i;&lt;BR&gt;&amp;nbsp;&amp;nbsp;for (i = 0 ; i &amp;lt; m_iWLength - 1 ; ++i) {&lt;BR&gt;&lt;/P&gt;
&lt;P align=left&gt;Our apologies to anyone who hits this.&lt;/P&gt;
&lt;P align=left&gt;John&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=7199595" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/cenet/archive/tags/Author_3A00_+John+Spaith/default.aspx">Author: John Spaith</category></item><item><title>The History of the DCOM Remoting Addon Pack</title><link>http://blogs.msdn.com/cenet/archive/2008/01/08/the-history-of-the-dcom-remoting-addon-pack.aspx</link><pubDate>Wed, 09 Jan 2008 00:54:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:7033124</guid><dc:creator>cenet</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/cenet/comments/7033124.aspx</comments><wfw:commentRss>http://blogs.msdn.com/cenet/commentrss.aspx?PostID=7033124</wfw:commentRss><description>&lt;P&gt;I recently wrote about the recent &lt;A class="" href="http://blogs.msdn.com/cenet/archive/2008/01/04/dcom-remoting-on-windows-ce-6-0.aspx" mce_href="http://blogs.msdn.com/cenet/archive/2008/01/04/dcom-remoting-on-windows-ce-6-0.aspx"&gt;DCOM Remoting Addon pack being available&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;Since I'm running out of things to write about, I'll explain the geeky details of how the DCOM addon pack came to be.&amp;nbsp; This post is for the very bored only or those who are intrigued by the Windows CE Build Process.&amp;nbsp; There are no profound insights on COM or any other subject, for that matter.&lt;/P&gt;
&lt;P&gt;First we had to figure out what to do with DCOM remoting.&amp;nbsp; We had to either re-port Windows Vista COM or else remove DCOM remoting from the product.&amp;nbsp; Even though CE is componentized and we could have warned that this component was insecure &amp;amp; should be avoided almost always, NT4 vintage DCOM was *so* insecure that this wasn't enough.&amp;nbsp; After all, how often do you click through the obnoxious warnings that software pops up?&lt;/P&gt;
&lt;P&gt;This was a no win situation.&amp;nbsp; Even if we wanted to spend the effort to re-port COM, the amount of time needed to do the work and then get it stable (think about how key COM is to the system) didn't allow us to go down this path.&amp;nbsp; At the same time we knew we had some OEMs who desperately needed DCOM remoting.&lt;/P&gt;
&lt;P&gt;So the Group Program Manager, who makes a lot more money than I do for good reason, helped push through the idea of an addon pack.&amp;nbsp; DCOM remoting would be available only in CE6 if you downloaded a separate product.&amp;nbsp; The addon pack made our security people happy.&amp;nbsp; Since you have to go to a website to get the bits, you can't accidentally click on some buttons and end up with it.&amp;nbsp; It also lets us warn you point blank on the download site what you're getting into in a way less likely to be missed than warning popup box #73.&lt;/P&gt;
&lt;P&gt;From the website:&lt;/P&gt;
&lt;P&gt;&amp;lt;&lt;BR&gt;"the component contains known MSRC class critical bulletins. Installing the supplemental pack ... is discouraged, and Microsoft assumes no liability if this pack is deployed."&lt;BR&gt;&amp;gt;&lt;/P&gt;
&lt;P&gt;How does the DCOM addon pack work?&amp;nbsp; Ironically for all the time I spent in meetings discussing various aspects of it from biz/legal/security, the actual dev work was straightforward.&amp;nbsp; On NT4, DCOM has the concept of loadable transport DLL's to actually do the heavy lifting of talking to the transport layer.&amp;nbsp; rpcltscm.dll &amp;amp; rpcltscm.dll.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;The way PB builds MS doesn't ship these DLL's but instead rpcltscm.lib and rpcltscm.lib, and under the covers OEMs are building the DLL themselves.&amp;nbsp; We have config files that allow us to specify which files (in this case in public\dcom\oak\lib\&amp;lt;CPU&amp;gt;\...) are shipped out to customers.&amp;nbsp; So I changed the logic in them so that rpcltscm.lib &amp;amp; rpcltscm.lib were no longer shipped, even though they were still building.&amp;nbsp; I also changed a few configuration files to add some comments should some geek poke around the build and try to add the DLLs manually.&amp;nbsp; Check out public\dcom\oak\lib\(dcom.reg &amp;amp; dcom.bib) if you want to see Spaith's warnings.&lt;/P&gt;
&lt;P&gt;There was the extra step here of making sure that DCOM didn't have any direct calls to Winsock or other networking layer technology to do an end-round the transport DLL layer.&amp;nbsp; It doesn't.&amp;nbsp; I was impressed with the cleanliness of the design.&amp;nbsp; I anticipated whacking out winsock calls thrown all over the place and had given myself a lot more time on the schedule than I actually needed.&amp;nbsp; Of course a lot of other work that I underestimated ended up filling the free time I had!&lt;/P&gt;
&lt;P&gt;So the addon pack is basically just an MSI installer, various EULA's (the most important piece from a biz perspective), and the libraries.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;At the time of shipping this I joked about trying to get a ship-it award, which would be riduculous given that I hardly spent a few weeks on this.&amp;nbsp; (Other ship-its have taken me +1 year of work).&amp;nbsp; The Group PM said in all seriousness he'd try to make it happen, but I think it's best to let it drop.&lt;BR&gt;&lt;/P&gt;
&lt;P&gt;John&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=7033124" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/cenet/archive/tags/Author_3A00_+John+Spaith/default.aspx">Author: John Spaith</category></item><item><title>DCOM Remoting on Windows CE 6.0</title><link>http://blogs.msdn.com/cenet/archive/2008/01/04/dcom-remoting-on-windows-ce-6-0.aspx</link><pubDate>Fri, 04 Jan 2008 23:53:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:6983314</guid><dc:creator>cenet</dc:creator><slash:comments>4</slash:comments><comments>http://blogs.msdn.com/cenet/comments/6983314.aspx</comments><wfw:commentRss>http://blogs.msdn.com/cenet/commentrss.aspx?PostID=6983314</wfw:commentRss><description>&lt;P&gt;As I wrote &lt;A class="" href="http://blogs.msdn.com/cenet/archive/2006/11/29/dcom-demystified-kindof-on-ce-6.aspx" mce_href="http://blogs.msdn.com/cenet/archive/2006/11/29/dcom-demystified-kindof-on-ce-6.aspx"&gt;here&lt;/A&gt;, in Windows CE 6.0 we removed DCOM remoting - that is the ability to create and host COM objects across a network.&amp;nbsp; We did this due to security.&amp;nbsp; Our DCOM is built on NT4 vintage code and there was no way we could patch up our implementation to meet security requirements.&amp;nbsp; The desktop faced a similar problem post-NT4 and also came to the conclusion they couldn't do a patch up, so they had to redo lots of their DCOM.&lt;/P&gt;
&lt;P&gt;Note this is all embedded CE only - Windows Mobile &lt;A class="" href="http://blogs.msdn.com/cenet/archive/2006/10/27/why-doesn-t-windows-mobile-support-out-of-proc-com.aspx" mce_href="http://blogs.msdn.com/cenet/archive/2006/10/27/why-doesn-t-windows-mobile-support-out-of-proc-com.aspx"&gt;doesn't even have cross-proc COM objects&lt;/A&gt;, much less remoting.&lt;/P&gt;
&lt;P&gt;I'm happy to announce that an&amp;nbsp;add on&amp;nbsp;kit to CE6 is available &lt;A class="" href="http://www.microsoft.com/downloads/details.aspx?FamilyID=6dadc411-f20a-4010-b504-b379832c3520&amp;amp;DisplayLang=en" mce_href="http://www.microsoft.com/downloads/details.aspx?FamilyID=6dadc411-f20a-4010-b504-b379832c3520&amp;amp;DisplayLang=en"&gt;here&lt;/A&gt;&amp;nbsp;that will allow OEMs to get DCOM remoting in their image.&lt;/P&gt;
&lt;P&gt;As the docs call out but I will emphasize here, this is ONLY for completely closed networks.&amp;nbsp; I'm thinking of a factory floor as the main example (and they're the main ones who want this).&amp;nbsp; This is not safe for the Internet of course or anywhere that untrusted machines may get on a network due to security worries.&lt;/P&gt;
&lt;P&gt;While we can't make any official statements about future products on the blog, I'll say unofficially that we are most likely not going to be doing another remoting addon pack for Windows CE 7.0.&amp;nbsp; We wanted to provide some sort of stop gag solution as Web Services for Devices for instance (available in CE 6.0 R2) or other technologies become available.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=6983314" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/cenet/archive/tags/Author_3A00_+John+Spaith/default.aspx">Author: John Spaith</category></item><item><title>UTF-8 in ASP pages on Windows CE</title><link>http://blogs.msdn.com/cenet/archive/2007/12/14/utf-8-in-asp-pages-on-windows-ce.aspx</link><pubDate>Fri, 14 Dec 2007 22:53:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:6772123</guid><dc:creator>cenet</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/cenet/comments/6772123.aspx</comments><wfw:commentRss>http://blogs.msdn.com/cenet/commentrss.aspx?PostID=6772123</wfw:commentRss><description>&lt;P&gt;My "stuff to blog about" well has pretty much run dry, as anyone who follows this blog knows.&amp;nbsp; Fortunately there's always a customer running into something that I've never thought about something to inspire me.&amp;nbsp; Bad for the poor customer hitting the issue, but good for the rest of us.&lt;/P&gt;
&lt;P&gt;A customer wasn't able to make ASP pages from CE Web Server work when the pages were UTF-8.&amp;nbsp; The same page had worked fine as ANSI.&amp;nbsp; The error they got was when setting &lt;SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: 'Calibri','sans-serif'; mso-fareast-font-family: Calibri; mso-bidi-font-family: 'Times New Roman'; mso-fareast-theme-font: minor-latin; mso-bidi-theme-font: minor-bidi; mso-ansi-language: EN-US; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin; mso-fareast-language: EN-US; mso-bidi-language: AR-SA"&gt;&amp;lt;% Response.Expires = -1 %&amp;gt; in their page.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoPlainText style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT size=3&gt;&lt;FONT face=Consolas&gt;-----------------START&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoPlainText style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;FONT face=Consolas size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoPlainText style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT size=3&gt;&lt;FONT face=Consolas&gt;The HTTP headers are already written to the client. HTTP header&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoPlainText style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT size=3&gt;&lt;FONT face=Consolas&gt;modifications must be made before writing page content&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoPlainText style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;FONT face=Consolas size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoPlainText style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT size=3&gt;&lt;FONT face=Consolas&gt;ASP scripting compilation error: '80020009'&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoPlainText style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;FONT face=Consolas size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoPlainText style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT size=3&gt;&lt;FONT face=Consolas&gt;Description:&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoPlainText style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;FONT face=Consolas size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoPlainText style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT size=3&gt;&lt;FONT face=Consolas&gt;In file: /Test/default.asp&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoPlainText style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT size=3&gt;&lt;FONT face=Consolas&gt;On line: 1&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoPlainText style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;FONT face=Consolas size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoPlainText style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT size=3&gt;&lt;FONT face=Consolas&gt;-----------------END&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;ASP aficionados, can you guess what was happening?&lt;/P&gt;
&lt;P&gt;--&lt;/P&gt;
&lt;P&gt;What happens is UTF-8 puts special characters in the first bytes of a file indicating to an editor that it is UTF-8.&amp;nbsp; When our ASP interpreter parses out a page, it sees those UTF-8 characters and (unfortunately) doesn't know about UTF-8 and assumes its ASP body that needs to be sent out.&amp;nbsp; Once ASP body has been sent, you're not allowed to send HTTP headers anymore, which is why the Expires=-1 wasn't working.&lt;/P&gt;
&lt;P&gt;I had the customer remove the special bytes and also look into the &lt;SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: 'Calibri','sans-serif'; mso-fareast-font-family: Calibri; mso-bidi-font-family: 'Times New Roman'; mso-fareast-theme-font: minor-latin; mso-bidi-theme-font: minor-bidi; mso-ansi-language: EN-US; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin; mso-fareast-language: EN-US; mso-bidi-language: AR-SA"&gt;Response.Charset() to make sure the browser knew the encoding of the file (always a good idea with non-ANSI anyway).&lt;/SPAN&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=6772123" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/cenet/archive/tags/Author_3A00_+John+Spaith/default.aspx">Author: John Spaith</category></item><item><title>GPSID: Problem &amp; workaround on recent WM6 release</title><link>http://blogs.msdn.com/cenet/archive/2007/12/06/gpsid-problem-workaround-on-recent-wm6-release.aspx</link><pubDate>Thu, 06 Dec 2007 19:14:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:6681436</guid><dc:creator>cenet</dc:creator><slash:comments>9</slash:comments><comments>http://blogs.msdn.com/cenet/comments/6681436.aspx</comments><wfw:commentRss>http://blogs.msdn.com/cenet/commentrss.aspx?PostID=6681436</wfw:commentRss><description>&lt;P&gt;&lt;STRONG&gt;Background&lt;/STRONG&gt;&lt;BR&gt;A number of customers on a recent WM6 versions have run into a problem where GPSGetPosition returns ERROR_INVALID_PARAMETER always, even on apps that worked fine in the past.&amp;nbsp; The newsgroup thread is &lt;A class="" href="http://groups.google.com/group/microsoft.public.pocketpc.developer/browse_thread/thread/bba8645a7d9421a7/7387baa07060b0cb?lnk=st&amp;amp;q=%22WM5+to+WM6+GPSID+Problem+on+HTC+P3300%22#7387baa07060b0cb" mce_href="http://groups.google.com/group/microsoft.public.pocketpc.developer/browse_thread/thread/bba8645a7d9421a7/7387baa07060b0cb?lnk=st&amp;amp;q=%22WM5+to+WM6+GPSID+Problem+on+HTC+P3300%22#7387baa07060b0cb"&gt;here&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;The device I've reproed and tested on was an HTC P3300, but based on newsgroup thread I think other devices may have been affected also.&lt;/P&gt;
&lt;P&gt;I have determined the cause and a workaround for the problem.&amp;nbsp; It'll take a while to get a real fix, but we're working on that too.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Underlying Cause&lt;/STRONG&gt;&lt;BR&gt;In a future Windows Mobile, we're exposing extensions to the GPS_POSITION and GPS_DEVICE structures.&amp;nbsp; GPSID is actually aware of the extended structure already - in WM6 AKU0.4 &amp;amp; above, also known as 18120+ builds.&amp;nbsp; The reason being that GPS chips can do some "magic" with this stuff even before we actually expose the structures to app developers.&amp;nbsp; (It's a very long story, if you're not a GPS OEM you don't care.)&amp;nbsp; Because the structure is larger, it means the sizeof() checks on it have changed but sizeof(GPS_POSITION) that you're passing in has not changed because you're using the same GPS_POSITION as always.&amp;nbsp; The MS GPSID allows the old struct size for legacy.&lt;/P&gt;
&lt;P&gt;What complicates things is that OEMs are allowed to replace GPSID on their device, because they may want to tweak it in order to work with their GPS chips.&amp;nbsp; I don't have the source, but I'm almost positive what's happening is that an OEM GPSID is checking only against the extended GPS_POSITION size and hence is failing when it gets the original GPS_POSITION.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Workaround&lt;/STRONG&gt;&lt;BR&gt;Your application can lie about how big a structure it is passing in to worakround this.&amp;nbsp; So if your application gets ERROR_INVALID_PARAMETER, it can pass in the sizes of the new struct.&amp;nbsp; Here's code below.&amp;nbsp; I tested this with an HTC 3300 and was successfully able to get my lat/long using this.&amp;nbsp; GPSGetDeviceState has similar issue so I'm including code for it, too.&lt;/P&gt;
&lt;P&gt;// Retrieves GPS location data and prints it to the screen.&lt;BR&gt;void GetLocationAndPrint(HANDLE hGPS) {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; BYTE gpsPositionRaw[376];&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; GPS_POSITION *pGpsLocation = (GPS_POSITION*)gpsPositionRaw;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; pGpsLocation-&amp;gt;dwVersion = GPS_VERSION_1;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; pGpsLocation-&amp;gt;dwSize&amp;nbsp;&amp;nbsp;&amp;nbsp; = sizeof(gpsPositionRaw);&lt;BR&gt;&amp;nbsp;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; DWORD dw = GPSGetPosition(hGPS,pGpsLocation,1000,0);&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (dw != ERROR_SUCCESS) {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; wprintf(L"GPSGetPosition() fails, GLE = 0x%08x\r\n",dw);&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DebugBreak();&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; PrintGPSPosition(pGpsLocation);&lt;BR&gt;}&lt;/P&gt;
&lt;P&gt;void GetDeviceStateAndPrint(void) {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; BYTE gpsDeviceRaw[332];&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; GPS_DEVICE *pGpsDevice = (GPS_DEVICE *)gpsDeviceRaw;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; pGpsDevice-&amp;gt;dwVersion = GPS_VERSION_1;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; pGpsDevice-&amp;gt;dwSize = sizeof(gpsDeviceRaw);&lt;BR&gt;&amp;nbsp;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; DWORD dw = GPSGetDeviceState(pGpsDevice);&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (dw != ERROR_SUCCESS) {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; wprintf(L"GPSGetDeviceState() fails, GLE = 0x%08x\r\n",dw);&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DebugBreak();&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; PrintGPSDeviceState(pGpsDevice);&lt;BR&gt;}&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Going Forward&lt;/STRONG&gt;&lt;BR&gt;This is clearly a stop-gag solution.&amp;nbsp; There's no way that we expect our customers to recompile existing apps for a new WM release, especially considering how hard it is to get applications signed/tested/deployed.&amp;nbsp; I have alerted the OEM to the problem and am coordinating with them on rolling out a fix.&amp;nbsp; I'll provide an update when I can.&lt;/P&gt;
&lt;P&gt;Once again I apologize for the pain that this has caused and the delay.&lt;/P&gt;
&lt;P&gt;John&lt;BR&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=6681436" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/cenet/archive/tags/Author_3A00_+John+Spaith/default.aspx">Author: John Spaith</category></item><item><title>How to drop a (Microsoft Generated) debug DLL into a Windows CE device?</title><link>http://blogs.msdn.com/cenet/archive/2007/04/09/how-to-drop-a-debug-dll-into-a-windows-ce-device.aspx</link><pubDate>Tue, 10 Apr 2007 02:21:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:2065424</guid><dc:creator>cenet</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/cenet/comments/2065424.aspx</comments><wfw:commentRss>http://blogs.msdn.com/cenet/commentrss.aspx?PostID=2065424</wfw:commentRss><description>&lt;P&gt;Sometimes on the newsgroups I tell an OEM that's having problems with some component to "Drop DEBUG DLL foo into the release directory and turn on full DEBUGOUT and get me the output."&amp;nbsp; Most Windows CE components have pretty good debug-time logging so a lot of times a customer can see the exact cause of the problem spit out in DEBUGOUT.&lt;/P&gt;
&lt;P&gt;&amp;lt;Note this is for Windows CE Platform Builder (PB) developers only, not Windows Mobile (unless you're an OEM building a Windows Mobile device).&amp;nbsp; Also my article is in particular about components that Microsoft delivers in both DEBUG and retail form, no code that you build yourself.&amp;nbsp; For more info on that, check out the comments from Fernando's feedback below.&amp;gt;&lt;/P&gt;
&lt;P&gt;But how do you get this DEBUG DLL and its output?&amp;nbsp; RETAIL DLLs don't have this, of course.&amp;nbsp; The easiest way is if you can build a fully DEBUG version of the OS and boot it while connected to Platform Builder, then you're pretty much done.&amp;nbsp; Just turn on appropriate debug zones for the component you need.&amp;nbsp; This is recommended since it's one less step.&lt;/P&gt;
&lt;P&gt;However there are scenario where you not have enough RAM/ROM to take a fully DEBUG OS.&amp;nbsp; In this case you want to just drop on the DEBUG dll that you're interested in but have everything else be RETAIL.&amp;nbsp; To do this:&lt;/P&gt;
&lt;P&gt;1) Build the complete platform for both DEBUG and RETAIL OS.&lt;/P&gt;
&lt;P&gt;2) Open RETAIL project in PB, then open a build window. In CE 6.0 this is Tools-&amp;gt;Open Release directory in Build Window, menu and wording may be slightly different in different versions.&lt;/P&gt;
&lt;P&gt;3) This will put you into the release directory for the RETAIL build.&amp;nbsp; The release directory is just the dir where all your intermediate DLLs/PDBs/etc get dumped prior to creating a ROM image.&amp;nbsp; Create a new directory here, ORG, and copy ModuleYouWantDebugOutFor.* to ORG.&lt;/P&gt;
&lt;P&gt;4) If you "cd ..", the DEBUG directory will also be present.&amp;nbsp; (I'm assuming you haven't customized releasedir position in anyway).&amp;nbsp; copy ..\&amp;lt;debugDir&amp;gt;\ModuleYouWantDebugOutFor.* to RETAIL releasedirectory.&lt;/P&gt;
&lt;P&gt;5) Now in PB, run Build-&amp;gt;Make Run-Time Image.&amp;nbsp; (Again, wording may change slightly across releases.)&amp;nbsp; This automatically puts the DLL you want DEBUG into the ROM image.&lt;/P&gt;
&lt;P&gt;6) Before you ship this ROM image to the world you need to remove the DEBUG bits from it.&amp;nbsp; Ideally you have a formal build process of generating DLLs from a "clean" source, not developer's machine, but in case you don't be aware of this issue.&lt;/P&gt;
&lt;P&gt;--&lt;/P&gt;
&lt;P&gt;Note that not all CE Components have DEBUG messages, but most do.&lt;/P&gt;
&lt;P&gt;Happy debugging!&lt;/P&gt;
&lt;P&gt;[Author: John Spaith]&lt;BR&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=2065424" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/cenet/archive/tags/Author_3A00_+John+Spaith/default.aspx">Author: John Spaith</category></item><item><title>time.h for WinCE at OpenNetCF</title><link>http://blogs.msdn.com/cenet/archive/2007/03/22/time-h-for-wince-at-opennetcf.aspx</link><pubDate>Thu, 22 Mar 2007 20:28:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1932021</guid><dc:creator>cenet</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/cenet/comments/1932021.aspx</comments><wfw:commentRss>http://blogs.msdn.com/cenet/commentrss.aspx?PostID=1932021</wfw:commentRss><description>&lt;P&gt;Windows CE does not support the time.h structures, as I blog about &lt;A class="" href="http://blogs.msdn.com/cenet/archive/2006/04/29/time-h-on-windows-ce.aspx" mce_href="http://blogs.msdn.com/cenet/archive/2006/04/29/time-h-on-windows-ce.aspx"&gt;here&lt;/A&gt;.&amp;nbsp; Fortunately Chris Tacke at OpenNETCF has created a free library to do this, which is available &lt;A class="" href="http://www.opennetcf.com/SharedSource/OpenTimeCE/tabid/247/Default.aspx" mce_href="http://www.opennetcf.com/SharedSource/OpenTimeCE/tabid/247/Default.aspx"&gt;here&lt;/A&gt;, in order to make porting easier to CE.&amp;nbsp; (If you're not porting code you should be using the Win32 time functions, which WinCE does support.)&lt;/P&gt;
&lt;P&gt;Whenever I point folks at non-MS software I always have the disclaimer that MS doesn't officially support it, buyer beware, etc etc...&amp;nbsp; I'm embarrassed to have to put that in for this case because I know Chris is a really good guy who's done a lot for the CE development community.&amp;nbsp; Thanks Chris for your work here!&lt;/P&gt;
&lt;P&gt;[Author: John Spaith]&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=1932021" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/cenet/archive/tags/Author_3A00_+John+Spaith/default.aspx">Author: John Spaith</category></item><item><title>MEDC 2007 and Location Talk</title><link>http://blogs.msdn.com/cenet/archive/2007/02/26/medc-2007-and-location-talk.aspx</link><pubDate>Mon, 26 Feb 2007 21:16:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1764573</guid><dc:creator>cenet</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/cenet/comments/1764573.aspx</comments><wfw:commentRss>http://blogs.msdn.com/cenet/commentrss.aspx?PostID=1764573</wfw:commentRss><description>&lt;P&gt;MEDC is the Mobile and Embedded DevCon.&amp;nbsp; The US version will by May 1-3 this year in Las Vegas.&amp;nbsp; I thought about trying to sell it some in this blog, but the &lt;A class="" href="http://medc2007.com/public/home.aspx" mce_href="http://medc2007.com/public/home.aspx"&gt;official site&lt;/A&gt;&amp;nbsp;does a much better job.&amp;nbsp; I went to one of these back in '04 (it had a different name then).&amp;nbsp; I got a lot out of it getting to interact with the folks actually using our software and I hope our customers got a lot out of it too.&lt;/P&gt;
&lt;P&gt;I will be going to this MEDC to give a presentation on getting your location at the platform layer on Windows CE.&amp;nbsp; The sessions are listed&amp;nbsp;&lt;A class="" href="http://medc2007.com/public/sessions.aspx" mce_href="http://medc2007.com/public/sessions.aspx"&gt;here&lt;/A&gt;, mine is called "Beyond Maps with Windows® Embedded CE Platform."&lt;/P&gt;
&lt;P&gt;My talk is pretty simple:&lt;BR&gt;* Problems with apps accessing location in the past, with GPS as the case study.&amp;nbsp; Understanding the history actually is helpful.&lt;BR&gt;* Introduction to GPSID&lt;BR&gt;* Introduction to Location Framework&lt;/P&gt;
&lt;P&gt;It won't be a marketing pitch about how cool location is going to be, but instead a pretty deep technical dive.&amp;nbsp; I'll have demos of actually writing apps to use GPSID and Location Framework during the talk to show how easily it is (hopefully) and prove to the world I haven't forgotten how to program quite yet :).&lt;/P&gt;
&lt;P&gt;In addition to location, I have pretty deep technical knowledge of services and middleware on CE and I'm the dev lead for VOIP (which doesn't mean I have deep technical knowledge of it though :().&amp;nbsp; I'll be hanging around the conference and would love to talk to as many folks face-to-face to answer your questions and understand any problems you have with CE.&amp;nbsp; I don't even know what day I'm speaking so my schedule is up in the air, but I'll announce on the blog once I know as well as times I'll definitely be hanging around the Q&amp;amp;A booths they have setup.&lt;/P&gt;
&lt;P&gt;I've got a chance to work with and learn from a lot of you folks over the blog and newsgroups.&amp;nbsp; I really am looking forward to getting to be under the same roof with you finally!&lt;/P&gt;
&lt;P&gt;[Author: John Spaith]&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=1764573" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/cenet/archive/tags/Author_3A00_+John+Spaith/default.aspx">Author: John Spaith</category></item><item><title>Important WinCE KB article regarding Daylight Savings Time</title><link>http://blogs.msdn.com/cenet/archive/2007/01/12/important-wince-kb-article-regarding-daylight-savings-time.aspx</link><pubDate>Fri, 12 Jan 2007 20:20:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1456642</guid><dc:creator>cenet</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/cenet/comments/1456642.aspx</comments><wfw:commentRss>http://blogs.msdn.com/cenet/commentrss.aspx?PostID=1456642</wfw:commentRss><description>&lt;P&gt;Because I've been leading off a bunch of my more recent posts on obscure subjects with "Well, probably only 5 people care about this..." I'm afraid only 5 people are reading the blog now.&amp;nbsp; I hope not because this post is important.&amp;nbsp; If you're a Platform Builder customer you need to manually change some registry keys in order to get daylight savings dates to occur at the right time in the US as a result of the new change over dates.&amp;nbsp; You also need to have all the QFE's installed, though that hopefully goes without saying anyway.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;There's been a KB article up about this for some time - &lt;A href="http://support.microsoft.com/kb/923027"&gt;http://support.microsoft.com:80/kb/923027&lt;/A&gt;&amp;nbsp;- but I'm not sure if even 5 people read those.&amp;nbsp; In particular check out "Replacement registry key information" for the version of CE OS you're running.&lt;/P&gt;
&lt;P&gt;This is critical if you're relying on the CE daylight savings time auto-rollover feature, since it reads the time to roll over from the registry.&amp;nbsp; Any well behaved application should be reading these dates from the registry also, so anything else that relied on this would be affected by reg changes also.&lt;/P&gt;
&lt;P&gt;MS is looking into rolling the .reg change into a QFE so it's picked up automatically, it wasn't back when the KB article was written because then we were following the old daylight savings dates and would have broken any device's rollover for the Oct 2006 instance.&lt;/P&gt;
&lt;P&gt;[Author: John Spaith]&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=1456642" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/cenet/archive/tags/Author_3A00_+John+Spaith/default.aspx">Author: John Spaith</category></item><item><title>How do I check a username/password validity on a local device on a WinCE device?</title><link>http://blogs.msdn.com/cenet/archive/2007/01/11/how-do-i-check-a-username-password-validity-on-a-local-device-on-a-wince-device.aspx</link><pubDate>Thu, 11 Jan 2007 20:42:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1451442</guid><dc:creator>cenet</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/cenet/comments/1451442.aspx</comments><wfw:commentRss>http://blogs.msdn.com/cenet/commentrss.aspx?PostID=1451442</wfw:commentRss><description>&lt;P&gt;Suppose that you get a username and a password and you want to see whether it is legitimate.&amp;nbsp; The telnet server as an example of this – you give it a username &amp;amp; password that it needs to check before letting you party on CE.&amp;nbsp; It’s possible to do the check by some calls into the SSPI layer, but these are convoluted.&amp;nbsp; WinCE has a helper library, authhlp, in order to do the work for you.&amp;nbsp; Note that authhlp is &lt;STRONG&gt;not officially supported or doc’d in MSDN&lt;/STRONG&gt;.&amp;nbsp; It is used by quite a few of our network services so the code is very well tested, but it’s not something we can officially support.&amp;nbsp; Consider this a blog for the desperate who doesn’t want to mess with SSPI.&lt;/P&gt;
&lt;P&gt;The include header is authhlp.h, and you link to authhlp.lib.&amp;nbsp; For general embedded it lives in &amp;lt;WinceRoot&amp;gt;\public\&amp;lt;YourProject&amp;gt;\cesysgen\sdk\lib\&amp;lt;CPUPATH&amp;gt;\authhlp.lib.&amp;nbsp;&amp;nbsp; It is a static library, so there are no extra SYSGEN’s that you need to be able to use it.&amp;nbsp; Note however that you do need to include the underlying security SYSGENs, in particular SYSGEN_AUTH_NTLM.&lt;/P&gt;
&lt;P&gt;Using it is straightforward.&amp;nbsp; You can see sample code of it in the telnet server in &amp;lt;WinceRoot&amp;gt;\public\servers\sdk\samples\telnetd.&amp;nbsp; You need a one time AuthHelpInitialize(), AuthHelpUnload() at the time your service/app is shutting down.&amp;nbsp; To check username/password, just call AuthHelpValidateUserA/AuthHelpValidateUserW.&amp;nbsp; The code is reasonably self-documenting, including a bunch of information at the top of the file.&amp;nbsp; There is also an optional and primitive “ACL” system that Authhelp can support, where it can check not only for a username/password being legitimate but whether a given user is in the allowed or denied list or even if they’re in the NTLM security group.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;How do you actually tie into getting the username &amp;amp; passwords?&amp;nbsp; To use a domain controller to validate against, set HKEY_LOCAL_MACHINE\Comm\Redir\DefaultDomain to the name of the domain.&amp;nbsp; The domain should be the actual domain name, not a particular domain controller (so WINGROUP not wingroup-dc2.microsoft.com).&amp;nbsp; If this registry key is not set, then the security mechanism will use a local CE database of user names and passwords.&amp;nbsp; This is configured with NTLMSetUserInfo&amp;lt;&lt;A href="http://msdn2.microsoft.com/fr-fr/library/ms926215.aspx"&gt;http://msdn2.microsoft.com/fr-fr/library/ms926215.aspx&lt;/A&gt;&amp;gt; and friends.&lt;/P&gt;
&lt;P&gt;I don't know if this would work at all on Windows Mobile, in particular I don't think we ship the libs &amp;amp; headers in its SDK, and I've only ever tested this with Platform Builder generated images.&amp;nbsp; Even for you PB guys, remember this is technically unsupported (which is why this is in a blog &amp;amp; not MSDN proper :)).&lt;/P&gt;
&lt;P&gt;[Author: John Spaith]&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=1451442" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/cenet/archive/tags/Author_3A00_+John+Spaith/default.aspx">Author: John Spaith</category></item><item><title>Avoid TLS calls in services/device drivers while processing IPC calls on WinCE</title><link>http://blogs.msdn.com/cenet/archive/2007/01/05/avoid-tls-calls-in-services-device-drivers-while-processing-ipc-calls-on-wince.aspx</link><pubDate>Fri, 05 Jan 2007 20:08:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1417194</guid><dc:creator>cenet</dc:creator><slash:comments>5</slash:comments><comments>http://blogs.msdn.com/cenet/comments/1417194.aspx</comments><wfw:commentRss>http://blogs.msdn.com/cenet/commentrss.aspx?PostID=1417194</wfw:commentRss><description>&lt;P&gt;This post is another of the pretty low-level, under the hood about interprocess communication on WinCE.&amp;nbsp; I considered not even posting it, but it meets my geek threshold (5 people in the world will need it sooner or later, but probably not more than 5) so I'm going ahead.&lt;/P&gt;
&lt;P&gt;One of the main functions of Services.exe on Windows CE is that it provides glue to tie services to applications running on the same device.&amp;nbsp; There's a bunch of low-level kernel magic that has to happen to make Interprocess Communication (IPC) work and services.exe hides that from you.&amp;nbsp; An example of this is that an application call to DeviceIoControl() gets turned into the specified service's xxx_IOControl() handler.&lt;/P&gt;
&lt;P&gt;When writing these xxx_ handlers (like xxx_Open, xxx_Init, xxx_IOControl -- see &lt;A class="" href="http://msdn.microsoft.com/library/en-us/wcecomm5/html/wce50grfServicesexeFunctions.asp?frame=true" mce_href="http://msdn.microsoft.com/library/en-us/wcecomm5/html/wce50grfServicesexeFunctions.asp?frame=true"&gt;here&lt;/A&gt;) you must not make any calls that require TLS (thread local storage).&amp;nbsp; The reason is that the kernel does not support TLS when doing interprocess calls.&lt;/P&gt;
&lt;P&gt;The main user of TLS you'll run into is COM.&amp;nbsp; On PSL threads you can call pre-existing COM objects (provided you know they're clear of TLS calls), but you can't call COM API's like CoCreateInstance and friends.&amp;nbsp;&amp;nbsp; Fortunately most services avoid COM in the first place, but should you absolutely need to do COM from within a xxx_IOControl() you'll need to spin up a worker thread to do the work, and block until it's completed.&amp;nbsp; We're aware this is inconvenient and are looking into adding cross-process TLS support in a future version of WinCE (it's not in CE 6.0).&lt;/P&gt;
&lt;P&gt;Also note that a lot of DLLs in their DllMain() tend to do TLS just by virtue of doing TlsAlloc, since if they'll&amp;nbsp; do TLS at any point they'll want the slot reserved.&amp;nbsp; This means that loading or unloading DLLs from within an xxx_* function can cause problems.&amp;nbsp; Services.exe in fact spins up a worker thread to load your service when processing an ActivateService() API call (rather than using the same thread that the ActivateService() came in on) in case your service is using TLS in its DllMain.&amp;nbsp; This worker thread is also used to call your xxx_Init().&amp;nbsp; Similarly, services.exe spins up a worker thread to unload your service and call its xxx_DeInit().&lt;/P&gt;
&lt;P&gt;Everything I say here (save one point) applies to device drivers as well.&amp;nbsp; I just am biased toward services since that's where most of my experience is so that's why I use it as my examples.&amp;nbsp; The only difference is that device.exe doesn't spin up worker threads for DLL Load/unload/xxx_Init/xxx_DeInit, since for whatever reason service DLLs are much more likely to bring in stuff that wants to use TLS than device drivers.&lt;/P&gt;
&lt;P&gt;As far as what happens with TLS messing up, it depends.&amp;nbsp; On a fully DEBUG build you'll get a DEBUGCHK if you try to do TLS across a PSL call.&amp;nbsp; In any event, it's up to the caller to deal with the error gracefully.&amp;nbsp; This is a good reminder always to handle error conditions even on functions that "shouldn't" fail like the TLS fcns.&lt;/P&gt;
&lt;P&gt;[Author: John Spaith]&lt;BR&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=1417194" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/cenet/archive/tags/Author_3A00_+John+Spaith/default.aspx">Author: John Spaith</category></item><item><title>GPSID source code: the ultimate answer</title><link>http://blogs.msdn.com/cenet/archive/2007/01/03/gpsid-source-code-the-ultimate-answer.aspx</link><pubDate>Wed, 03 Jan 2007 19:26:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1405166</guid><dc:creator>cenet</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/cenet/comments/1405166.aspx</comments><wfw:commentRss>http://blogs.msdn.com/cenet/commentrss.aspx?PostID=1405166</wfw:commentRss><description>&lt;P&gt;Recently I've been asked some questions about how GPSID handles certain weird scenarios that fall outside the scope of the docs.&amp;nbsp; I'm happy to answer these of course - it is my job after all :).&amp;nbsp; The really hard questions have come from GPS device driver writers, but this post may help app developers also.&amp;nbsp; Another and often faster you can get the answers about GPSID is to look at the GPSID source code.&amp;nbsp; It's shared in the public tree so Platform Builder customers or OEMs with the src access in WM can look and modify, if needed.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;The root directory is \public\COMMON\oak\drivers\GPSID.&amp;nbsp; Under here is the .\client directory, which is the link-time library for gpsapi.dll.&amp;nbsp; This isn't very interesting (it's just IPC magic between the app calling GPSID and GPSID.dll, either in device.exe or servicesd.exe depending on OS version).&amp;nbsp; You shouldn't ever mess with this code.&lt;/P&gt;
&lt;P&gt;The more interesting piece is in the .\server directory, which compiles gpsid.dll itself.&amp;nbsp; This is the DLL that runs in device.exe/servicesd.exe and does the interaction with the GPS device as well as taking IPC calls from apps.&amp;nbsp; It's only about 6000 lines of code and (I flatter myself :)) it's written well enough that no one has ever had problems following it that I know of.&lt;/P&gt;
&lt;P&gt;For the record, here's a brief overview of the files in this directory and what they do:&lt;/P&gt;
&lt;P&gt;GPSAPI.cpp -&amp;gt; "Receives" the IPC calls to GPSOpenDevice, checks params, and calls into rest of GPSID.&lt;/P&gt;
&lt;P&gt;GPSCore.cpp -&amp;gt; This is the "main" set of routines for GPSID.&amp;nbsp; Most interesting fcn is GPSWorkerThread(), which is spun up to interact with the GPS device.&lt;/P&gt;
&lt;P&gt;GPSDriver.cpp -&amp;gt; Provides abstraction between rest of GPSID and the underlying GPS driver, be it a standard NMEA device, the Poll Driver (CE6.0 and above), or the simple text file reader.&lt;/P&gt;
&lt;P&gt;GPSHandle.cpp -&amp;gt; Manages handles from API/caller process layer&lt;/P&gt;
&lt;P&gt;GPSIntrf.cpp -&amp;gt; xxx_Init/xxx_IOControl etc interface for tying GPSID into device.exe/servicesd.exe&lt;/P&gt;
&lt;P&gt;GPSMultiplexer.cpp -&amp;gt; Implements the logic for the virtual COM port/multiplexer in GPSID.&lt;/P&gt;
&lt;P&gt;GPSParse.cpp -&amp;gt; Parse out the NMEA string and (CE6.0 and above) when using the poll driver, potentially generate a NMEA string.&lt;/P&gt;
&lt;P&gt;GPSString.cpp -&amp;gt; Helper utilities that parse out individual fields in a NMEA string&lt;/P&gt;
&lt;P&gt;It's interesting that the way the alphabetical list ended up working out, you don't actually get to the string parsing until the very bottom of the list.&amp;nbsp; Ah, abstraction!&lt;/P&gt;
&lt;P&gt;The best way to follow the code is to look at what the API's do (GPSOpenDeviceIntrnl &amp;amp; GPSGetLocationIntrnl especially) and to trace through GPSWorkerThread.&lt;/P&gt;
&lt;P&gt;[Author: John Spaith]&lt;BR&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=1405166" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/cenet/archive/tags/Author_3A00_+John+Spaith/default.aspx">Author: John Spaith</category></item><item><title>Hardcore pointer marshalling samples for Windows CE 6</title><link>http://blogs.msdn.com/cenet/archive/2007/01/02/hardcore-pointer-marshalling-samples-for-windows-ce-6.aspx</link><pubDate>Wed, 03 Jan 2007 02:43:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1400979</guid><dc:creator>cenet</dc:creator><slash:comments>6</slash:comments><comments>http://blogs.msdn.com/cenet/comments/1400979.aspx</comments><wfw:commentRss>http://blogs.msdn.com/cenet/commentrss.aspx?PostID=1400979</wfw:commentRss><description>&lt;P&gt;This is one of those blogs where I hesitated to post it because it may be going too hard core into the guts of CE.&amp;nbsp; But from dealing with our customers who use our shared source and some of the really hard core questions I get, I'm hoping there are at least 5 super-geeks who can benefit from this.&lt;/P&gt;
&lt;P&gt;Suppose you're writing a device driver or a service that has to do all sorts of really gross pointer marshalling across process.&amp;nbsp; For instance, consider MSMQ.&amp;nbsp; Apps get at MSMQ by calling API's like MQOpenQueue in msmqrt.dll.&amp;nbsp; This function is called from user space, but just takes the paramaters the user specified, calls DeviceIoControl(hHandleToMSMQ,...), which calls the MSMQ service to do the real heavy lifting.&lt;/P&gt;
&lt;P&gt;In the old kernel with the flat address space this was easy (relatively).&amp;nbsp; In the new VM model it gets trickier.&amp;nbsp; Sue Loh has a good blog about this at &lt;A href="http://blogs.msdn.com/ce_base/archive/2006/11/09/Memory-marshalling-in-Windows-CE.aspx"&gt;http://blogs.msdn.com/ce_base/archive/2006/11/09/Memory-marshalling-in-Windows-CE.aspx&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;Sue Loh has another good blog about the raw pointer marshal API for CE 6 at &lt;A href="http://blogs.msdn.com/ce_base/archive/2006/11/22/marshalling-helper-apis.aspx"&gt;http://blogs.msdn.com/ce_base/archive/2006/11/22/marshalling-helper-apis.aspx&lt;/A&gt;.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;This API was designed so that both kernel level drivers and user mode drivers (e.g. udevice.exe &amp;amp; servicesd.exe) could use the same set of API's.&amp;nbsp; To make marshaling even easier, we have a set of templates in the %_WINCEROOT%\public\common\oak\inc\psl_marshaler.hxx.&amp;nbsp; This header is extensively commented along with samples showing how to make it work.&amp;nbsp; The upshot is that if you have some user-mode API that takes say 5 paramaters (some ptrs that need to be marshalled across process, others regular old DWORDs) then by using the PSL Marshaller templates you can save yourself a lot of the tedium as far as manually packing and unpacking these datatypes during the DeviceIoControl() call.&lt;/P&gt;
&lt;P&gt;Besides the psl_marshaler code itself, some samples may help if you have to do this.&lt;/P&gt;
&lt;P&gt;GPSID:&amp;nbsp; GPS Intermediate Driver.&amp;nbsp; This is the easiest sample (by far) I know of that uses psl_marshaler stuff in actual shipping code.&lt;/P&gt;
&lt;P&gt;%_WINCEROOT%\public\COMMON\oak\drivers\GPSID\client - GPSAPI.dll src, link time library.&amp;nbsp; All it does is just call to the psl_marshall helpers&lt;BR&gt;%_WINCEROOT%\public\COMMON\oak\drivers\GPSID\service - GPSID.dll, actual service that implements guts of this.&lt;/P&gt;
&lt;P&gt;You can look on &lt;A href="http://msdn.microsoft.com/library/en-us/mobilesdk5/html/mob5grfGPSIntermediateDriverFunctions.asp?frame=true"&gt;http://msdn.microsoft.com/library/en-us/mobilesdk5/html/mob5grfGPSIntermediateDriverFunctions.asp?frame=true&lt;/A&gt; to get a sense that there's just not that much going on with this API.&amp;nbsp; Actually that's intentional to keep implementation easier :).&amp;nbsp; The harder ones are code &amp;amp; API definitions we port from desktop Windows.&amp;nbsp; Here they have MIDL to do all the really heavy lifting for them, unlike CE where it's still psuedo-manual.&amp;nbsp; CE actually does have interprocess COM and we could rely on it &amp;amp; MIDL to do our IPC, but it adds 500KB to our ROM, isn't on Windows Mobile devices, and isn't as efficient in terms of CPU/memory as using the raw access routines &amp;amp; templates.&lt;/P&gt;
&lt;P&gt;MSMQ: Microsoft Message Queuing.&amp;nbsp; Note you'll need to be a Platform Builder customer and install the shared source kit in order to get this code.&lt;BR&gt;We're past the point of the mythical 5 people who actually need this much information.&amp;nbsp; I'm hoping you guys can figure out how to do the interprocess calls based on docs, blog entries, and the GPSID sample.&amp;nbsp; Now I'm basically targetting 1 person who actually has to marshall pointers inside structures inside arrays of VARIANTs, and to do it asyncronously at that.&amp;nbsp; My first recommendation is that if you have any control over your API, then try to keep it as simple as possible.&amp;nbsp; No embedded pointers or arrays, no asyncronous writing back of data.&lt;/P&gt;
&lt;P&gt;However, if you're in this situation you're where I was at when getting MSMQ up on the new kernel.&amp;nbsp; In this case I'll point you at the MSMQ code in hopes that it may provide you some inspiration as to what you're trying to do.&lt;/P&gt;
&lt;P&gt;%_WINCEROOT%\private\servers\msmq\sc\ce\client -&amp;gt; msmqrt.dll, runtime library apps link to to call into MSMQ.&lt;BR&gt;%_WINCEROOT%\private\servers\msmq\sc\ce\driver\msmqdev.cxx - MSMQD.dll.&amp;nbsp; Especially MMQ_IOControl().&lt;/P&gt;
&lt;P&gt;[Author: John Spaith]&lt;BR&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=1400979" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/cenet/archive/tags/Author_3A00_+John+Spaith/default.aspx">Author: John Spaith</category></item></channel></rss>