<?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>Why does DS_SHELLFONT = DS_FIXEDSYS | DS_SETFONT?</title><link>http://blogs.msdn.com/b/oldnewthing/archive/2005/02/07/368423.aspx</link><description>For backwards compatibility with older operating systems.</description><dc:language>en-US</dc:language><generator>Telligent Evolution Platform Developer Build (Build: 5.6.50428.7875)</generator><item><title>The dialog manager, part 2: Creating the frame window</title><link>http://blogs.msdn.com/b/oldnewthing/archive/2005/02/07/368423.aspx#403715</link><pubDate>Wed, 30 Mar 2005 15:57:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:403715</guid><dc:creator>The Old New Thing</dc:creator><description>Walk the template header and do what it says.&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=403715" width="1" height="1"&gt;</description></item><item><title>re: Why does DS_SHELLFONT = DS_FIXEDSYS | DS_SETFONT?</title><link>http://blogs.msdn.com/b/oldnewthing/archive/2005/02/07/368423.aspx#370061</link><pubDate>Wed, 09 Feb 2005 22:09:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:370061</guid><dc:creator>jbn</dc:creator><description>I think gnu emacs does that too, with is why there's a silly limit on the size of editable files having to fit on 26 bits or something (you could find the exact number by looking at the source code).&lt;br&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=370061" width="1" height="1"&gt;</description></item><item><title>re: Why does DS_SHELLFONT = DS_FIXEDSYS | DS_SETFONT?</title><link>http://blogs.msdn.com/b/oldnewthing/archive/2005/02/07/368423.aspx#369356</link><pubDate>Tue, 08 Feb 2005 21:06:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:369356</guid><dc:creator>Steve P</dc:creator><description>Sounds reasonable to me.&lt;br&gt;&lt;br&gt;If you're supposedly supporting an older operating system, then you should be making sure your code actually works on said operating system.&lt;br&gt;&lt;br&gt;The older OS has no idea how important those random bits might be, so all it can (and should) do is throw an error.&lt;br&gt;&lt;br&gt;Think of it like a function that is only available in later versions. Should the older OS simply ignore it because it isn't available? :)&lt;br&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=369356" width="1" height="1"&gt;</description></item><item><title>re: Why does DS_SHELLFONT = DS_FIXEDSYS | DS_SETFONT?</title><link>http://blogs.msdn.com/b/oldnewthing/archive/2005/02/07/368423.aspx#369163</link><pubDate>Tue, 08 Feb 2005 17:00:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:369163</guid><dc:creator>Jonathan</dc:creator><description>&amp;gt;Cooney: I'd probably require that any undefined bits be zero. After seeing Raymond's experience with the sloppy version and seeing the intel manuals that demand a zero in all reserved fields, I can't really see doing it any other way. &lt;br&gt;&lt;br&gt;But then you've lost the ability to cleanly handle future flags.  &lt;br&gt;The reason Kristoffer Henriksson suggested that the OS ignore unknown flags was so that programs written for later OSs (say Win2K) could set those flags without it affecting their ability to run on an older OS (say NT4) which didn't handle the flag.&lt;br&gt;&lt;br&gt;If we follow your suggestion to require unused flags be set to zero, we are back to not being able to pass flags to NT4 that might be valid on Win2k, but not valid on NT4.  I assume that would require the API to return an error if it saw a non-zero value for a flag it didn't support, since if the API didn't enforce the requirement, we are back to the problem Raymond listed with Apps passing random flags because they aren't forced to do otherwise.&lt;br&gt;&lt;br&gt;If the OS threw an error on an unknown flag it would require all apps to choose to: &lt;br&gt;1) never select flags older OSs didn't support, &lt;br&gt;2) select new flags knowing it would prevent the program from running on older OSs, &lt;br&gt;3) add code to detect which OS you were on in order to choose which flags to throw.&lt;br&gt;&lt;br&gt;Handling forward and backward compatibility is just a tricky thing to do...&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=369163" width="1" height="1"&gt;</description></item><item><title>re: Why does DS_SHELLFONT = DS_FIXEDSYS | DS_SETFONT?</title><link>http://blogs.msdn.com/b/oldnewthing/archive/2005/02/07/368423.aspx#369073</link><pubDate>Tue, 08 Feb 2005 14:18:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:369073</guid><dc:creator>Larry Osterman</dc:creator><description>Jonathan: IIRC, the reason the pointer to the malloc was removed was because it wasn't possible to set it.  Originally, there was a CoSetMalloc to go along with CoGetMalloc - the idea was that you could change the allocator used by COM to suit the needs of your application.&lt;br&gt;&lt;br&gt;Unfortunately, there were a bunch of apps/shell extensions that relied on the fact that the shell used LocalAlloc() for it's implementation of IMalloc and they called LocalFree on the memory (instead of calling CoGetMalloc and using that value).&lt;br&gt;&lt;br&gt;And when someone tried to replace the default allocator, blam!&lt;br&gt;&lt;br&gt;So the parameter was pulled to ensure that apps couldn't misbehave in that way.&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=369073" width="1" height="1"&gt;</description></item><item><title>re: Why does DS_SHELLFONT = DS_FIXEDSYS | DS_SETFONT?</title><link>http://blogs.msdn.com/b/oldnewthing/archive/2005/02/07/368423.aspx#368938</link><pubDate>Tue, 08 Feb 2005 09:06:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:368938</guid><dc:creator>Norman Diamond</dc:creator><description>&amp;gt; We learned this lesson the hard way - many&lt;br&gt;&amp;gt; apps passed uninitialzed garbage as flags&lt;br&gt;&amp;gt; and got away with it because the flags were&lt;br&gt;&amp;gt; ignored. Along comes the next version of&lt;br&gt;&amp;gt; Windows that *gives the flag meaning*, and&lt;br&gt;&amp;gt; now the app crashes.&lt;br&gt;&lt;br&gt;That is true.  That also explains why Windows XP checks some supposedly ignored structure members and returns errors if those members are not zero -- later versions of Windows might use them for something.  Now if MSDN would say that those members should be zero instead of saying that those members are ignored, programmers would understand faster why they were getting error returns.&lt;br&gt;&lt;br&gt;Sorry I don't remember which APIs I was getting hit by because it was about two years ago.  Though I have a feeling that it would be productive to search for the word &amp;quot;ignore[d]&amp;quot; in the Windows API section of MSDN.&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=368938" width="1" height="1"&gt;</description></item><item><title>re: Why does DS_SHELLFONT = DS_FIXEDSYS | DS_SETFONT?</title><link>http://blogs.msdn.com/b/oldnewthing/archive/2005/02/07/368423.aspx#368882</link><pubDate>Tue, 08 Feb 2005 05:26:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:368882</guid><dc:creator>Anonymous Coward</dc:creator><description>Apple had some fun when earlier 68k chips ignored upper bits in addresses since they couldn't address that much memory.  Various developers used to use the upper bits as a type field, such as specifying if the remaining bits were a point or an integer.  Then along came a new chip that could address the memory and paid attention to the upper bits and all sorts of programs crashed so they had to introduce various compatibility hacks.  (Somewhere inside Apple is Raymond's counterpart :-)&lt;br&gt;&lt;br&gt;This kind of &amp;quot;trick&amp;quot; is very common for Lisp environments.  Nowadays you can pull the same trick but using the lower bits instead.  For example you know memory allocations are going to be 4 byte aligned so you can use the lower 2 bits to indicate the type of whatever is pointed to.  Remember to set the bits to zero when doing the memory access.&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=368882" width="1" height="1"&gt;</description></item><item><title>Sort Order....</title><link>http://blogs.msdn.com/b/oldnewthing/archive/2005/02/07/368423.aspx#368764</link><pubDate>Mon, 07 Feb 2005 23:39:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:368764</guid><dc:creator>Jim</dc:creator><description>&lt;br&gt;&lt;a target="_new" href="http://support.microsoft.com/default.aspx?scid=kb;en-us;319827"&gt;http://support.microsoft.com/default.aspx?scid=kb;en-us;319827&lt;/a&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=368764" width="1" height="1"&gt;</description></item><item><title>Sort order...</title><link>http://blogs.msdn.com/b/oldnewthing/archive/2005/02/07/368423.aspx#368625</link><pubDate>Mon, 07 Feb 2005 19:36:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:368625</guid><dc:creator>Jonathan Allen</dc:creator><description>0.1-... &lt;br&gt;0.2-... &lt;br&gt;0.15-... &lt;br&gt;&lt;br&gt;Looks fine to me. Of course, I'm used to seeing things like &amp;quot;Section 0, Paragragh 15&amp;quot; or &amp;quot;verion 0, subverion 15&amp;quot; being written as 0.15. I don't I've ever used decimal numbers in a filename.&lt;br&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=368625" width="1" height="1"&gt;</description></item><item><title>re: Why does DS_SHELLFONT = DS_FIXEDSYS | DS_SETFONT?</title><link>http://blogs.msdn.com/b/oldnewthing/archive/2005/02/07/368423.aspx#368612</link><pubDate>Mon, 07 Feb 2005 19:27:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:368612</guid><dc:creator>Cooney</dc:creator><description>&amp;gt; Why wasn't the rule from the beginning that unknown flag bits being set were silently ignored? If you were designing the API from scratch today, would you do it that way -- is it just something that was not thought of at the time -- or is there a reason for making undefined bits being set an error? &lt;br&gt;&lt;br&gt;I'd probably require that any undefined bits be zero. After seeing Raymond's experience with the sloppy version and seeing the intel manuals that demand a zero in all reserved fields, I can't really see doing it any other way.&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=368612" width="1" height="1"&gt;</description></item></channel></rss>