<?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>Infinity Logic</title>
	<atom:link href="http://infinitylogic.net/feed/" rel="self" type="application/rss+xml" />
	<link>http://infinitylogic.net</link>
	<description></description>
	<lastBuildDate>Mon, 09 Jan 2012 02:22:32 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>C++ Snippet: Detect Windows Version</title>
		<link>http://infinitylogic.net/c-snippet-detect-windows-version/</link>
		<comments>http://infinitylogic.net/c-snippet-detect-windows-version/#comments</comments>
		<pubDate>Sun, 08 Jan 2012 16:43:20 +0000</pubDate>
		<dc:creator>Brock Cooper</dc:creator>
				<category><![CDATA[C++]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Snippet]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://infinitylogic.net/?p=89</guid>
		<description><![CDATA[This nicely put together C++ header file that will allow you to detect which version of windows your program is currently running on.]]></description>
			<content:encoded><![CDATA[<h1><a href="http://infinitylogic.net/wp-content/uploads/2012/01/1326040852_Windows.png"><img class="alignleft size-full wp-image-94" title="Windows Logo" src="http://infinitylogic.net/wp-content/uploads/2012/01/1326040852_Windows.png" alt="" width="128" height="128" /></a>Summary</h1>
<p>This nicely put together C++ header file that will allow you to detect which version of windows your program is currently running on. Currently it supports these versions of Windows:</p>
<p>&nbsp;</p>
<ul>
<li>Windows 7</li>
<li>Windows Vista</li>
<li>Windows XP</li>
<li>Windows 2000</li>
<li>Windows Server</li>
</ul>
<p>I hope to add more support and more functions at a later date <img src='http://infinitylogic.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<h1>How It Works</h1>
<p>Most of the details needed for us to detect the Windows version are in the Windows structure &#8220;<strong>OSVERSIONINFOEX</strong>,&#8221; which can be populated with data by calling the &#8220;<strong>GetVersionEx()</strong>&#8221; function found in &#8220;<strong>Windows.h</strong>.&#8221; However its not as easy as it seams, there is much more work put into detecting the version information, such as:</p>
<ul>
<li>Service Pack Version</li>
<li>OS Edition( Ultimate, Pro, etc. )</li>
<li>OS Architecture ( x64, x86 )</li>
<li>Build Number</li>
</ul>
<h1>How To Use It</h1>
<p>Using this code is extremely easy, just include the &#8220;os_detection.h&#8221; header file into your C++ project and don&#8217;t forget to put &#8220;<strong>#include &#8220;os_detection.h&#8221;</strong>&#8221; in your main.cpp file <img src='http://infinitylogic.net/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> </p>
<h1>Code: os_detection.h</h1>
<div class="codecolorer-container cpp dawn" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br />29<br />30<br />31<br />32<br />33<br />34<br />35<br />36<br />37<br />38<br />39<br />40<br />41<br />42<br />43<br />44<br />45<br />46<br />47<br />48<br />49<br />50<br />51<br />52<br />53<br />54<br />55<br />56<br />57<br />58<br />59<br />60<br />61<br />62<br />63<br />64<br />65<br />66<br />67<br />68<br />69<br />70<br />71<br />72<br />73<br />74<br />75<br />76<br />77<br />78<br />79<br />80<br />81<br />82<br />83<br />84<br />85<br />86<br />87<br />88<br />89<br />90<br />91<br />92<br />93<br />94<br />95<br />96<br />97<br />98<br />99<br />100<br />101<br />102<br />103<br />104<br />105<br />106<br />107<br />108<br />109<br />110<br />111<br />112<br />113<br />114<br />115<br />116<br />117<br />118<br />119<br />120<br />121<br />122<br />123<br />124<br />125<br />126<br />127<br />128<br />129<br />130<br />131<br />132<br />133<br />134<br />135<br />136<br />137<br />138<br />139<br />140<br />141<br />142<br />143<br />144<br />145<br />146<br />147<br />148<br />149<br />150<br />151<br />152<br />153<br />154<br />155<br />156<br />157<br />158<br />159<br />160<br />161<br />162<br />163<br />164<br />165<br />166<br />167<br />168<br />169<br />170<br />171<br />172<br />173<br />174<br />175<br />176<br />177<br />178<br />179<br />180<br />181<br />182<br />183<br />184<br />185<br />186<br />187<br />188<br />189<br />190<br />191<br />192<br />193<br />194<br />195<br />196<br />197<br />198<br />199<br />200<br />201<br />202<br />203<br />204<br />205<br />206<br />207<br />208<br />209<br />210<br />211<br />212<br />213<br />214<br />215<br />216<br />217<br />218<br />219<br />220<br />221<br />222<br />223<br />224<br />225<br />226<br />227<br />228<br />229<br />230<br />231<br />232<br />233<br />234<br />235<br />236<br />237<br />238<br />239<br />240<br />241<br />242<br />243<br />244<br />245<br />246<br />247<br />248<br />249<br />250<br />251<br />252<br />253<br />254<br />255<br />256<br />257<br />258<br />259<br />260<br />261<br />262<br />263<br />264<br />265<br />266<br />267<br />268<br />269<br />270<br />271<br />272<br />273<br />274<br />275<br />276<br />277<br />278<br />279<br />280<br />281<br />282<br />283<br />284<br />285<br />286<br />287<br />288<br />289<br />290<br />291<br />292<br />293<br />294<br />295<br />296<br />297<br />298<br />299<br />300<br />301<br />302<br />303<br />304<br />305<br />306<br />307<br />308<br />309<br />310<br />311<br />312<br />313<br />314<br />315<br />316<br />317<br />318<br />319<br />320<br />321<br />322<br />323<br />324<br />325<br />326<br />327<br />328<br />329<br />330<br />331<br />332<br />333<br />334<br />335<br />336<br />337<br />338<br />339<br />340<br />341<br />342<br />343<br />344<br />345<br />346<br />347<br />348<br />349<br />350<br />351<br />352<br />353<br />354<br />355<br />356<br />357<br />358<br />359<br />360<br />361<br />362<br />363<br />364<br />365<br />366<br />367<br />368<br />369<br />370<br />371<br />372<br />373<br />374<br />375<br />376<br />377<br />378<br />379<br />380<br />381<br />382<br />383<br />384<br />385<br />386<br />387<br />388<br />389<br />390<br />391<br />392<br />393<br />394<br />395<br />396<br />397<br />398<br />399<br />400<br />401<br />402<br />403<br />404<br />405<br />406<br />407<br />408<br />409<br />410<br />411<br /></div></td><td><div class="cpp codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #339900;">#ifndef _OS_DETECTION_H_</span><br />
<span style="color: #339900;">#define _OS_DETECTION_H_</span><br />
<br />
<span style="color: #339900;">#include &amp;lt;windows.h&amp;gt;</span><br />
<span style="color: #339900;">#include &amp;lt;string&amp;gt;</span><br />
<br />
<span style="color: #0000ff;">typedef</span> <span style="color: #0000ff;">void</span> <span style="color: #008000;">&#40;</span>WINAPI <span style="color: #000040;">*</span>PGNSI<span style="color: #008000;">&#41;</span><span style="color: #008000;">&#40;</span>LPSYSTEM_INFO<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span><br />
<span style="color: #0000ff;">typedef</span> BOOL <span style="color: #008000;">&#40;</span>WINAPI <span style="color: #000040;">*</span>PGPI<span style="color: #008000;">&#41;</span><span style="color: #008000;">&#40;</span>DWORD, DWORD, DWORD, DWORD, PDWORD<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span><br />
<br />
<span style="color: #339900;">#define PRODUCT_PROFESSIONAL 0x00000030</span><br />
<span style="color: #339900;">#define VER_SUITE_WH_SERVER &nbsp;0x00008000</span><br />
<br />
<span style="color: #0000ff;">struct</span> OSINFO<br />
<span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; string<br />
&nbsp; &nbsp; &nbsp; &nbsp; OS_Name,<br />
&nbsp; &nbsp; &nbsp; &nbsp; OS_Edition,<br />
&nbsp; &nbsp; &nbsp; &nbsp; OS_Service_Pack,<br />
&nbsp; &nbsp; &nbsp; &nbsp; OS_Architecture,<br />
&nbsp; &nbsp; &nbsp; &nbsp; OS_Info<span style="color: #008080;">;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #0000ff;">int</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; OS_Build_Number<span style="color: #008080;">;</span><br />
<span style="color: #008000;">&#125;</span><span style="color: #008080;">;</span><br />
<br />
OSINFO getWindowsVersionInfo<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><br />
<span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; OSINFO osInfo<span style="color: #008080;">;</span><br />
<br />
&nbsp; &nbsp; OSVERSIONINFOEX osvi<span style="color: #008080;">;</span><br />
&nbsp; &nbsp; SYSTEM_INFO si<span style="color: #008080;">;</span><br />
&nbsp; &nbsp; BOOL bOsVersionInfoEx<span style="color: #008080;">;</span><br />
&nbsp; &nbsp; DWORD dwType<span style="color: #008080;">;</span><br />
<br />
&nbsp; &nbsp; ZeroMemory<span style="color: #008000;">&#40;</span><span style="color: #000040;">&amp;</span>amp<span style="color: #008080;">;</span>si, <span style="color: #0000dd;">sizeof</span><span style="color: #008000;">&#40;</span>SYSTEM_INFO<span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; ZeroMemory<span style="color: #008000;">&#40;</span><span style="color: #000040;">&amp;</span>amp<span style="color: #008080;">;</span>osvi, <span style="color: #0000dd;">sizeof</span><span style="color: #008000;">&#40;</span>OSVERSIONINFOEX<span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; osvi.<span style="color: #007788;">dwOSVersionInfoSize</span> <span style="color: #000080;">=</span> <span style="color: #0000dd;">sizeof</span><span style="color: #008000;">&#40;</span>OSVERSIONINFOEX<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span><br />
<br />
&nbsp; &nbsp; bOsVersionInfoEx <span style="color: #000080;">=</span> GetVersionEx<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#40;</span>OSVERSIONINFO<span style="color: #000040;">*</span><span style="color: #008000;">&#41;</span> <span style="color: #000040;">&amp;</span>amp<span style="color: #008080;">;</span>osvi<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #0000ff;">if</span> <span style="color: #008000;">&#40;</span><span style="color: #000040;">!</span>bOsVersionInfoEx<span style="color: #008000;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #008000;">&#125;</span><br />
<br />
&nbsp; &nbsp; PGNSI pGNSI <span style="color: #000080;">=</span> <span style="color: #008000;">&#40;</span>PGNSI<span style="color: #008000;">&#41;</span>GetProcAddress<span style="color: #008000;">&#40;</span>GetModuleHandle<span style="color: #008000;">&#40;</span>TEXT<span style="color: #008000;">&#40;</span><span style="color: #FF0000;">&quot;kernel32.dll&quot;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span>, <span style="color: #FF0000;">&quot;GetNativeSystemInfo&quot;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #0000ff;">if</span> <span style="color: #008000;">&#40;</span>pGNSI <span style="color: #000040;">!</span><span style="color: #000080;">=</span> <span style="color: #0000ff;">NULL</span><span style="color: #008000;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; pGNSI<span style="color: #008000;">&#40;</span><span style="color: #000040;">&amp;</span>amp<span style="color: #008080;">;</span>si<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; <span style="color: #008000;">&#125;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #0000ff;">else</span><br />
&nbsp; &nbsp; <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; GetSystemInfo<span style="color: #008000;">&#40;</span><span style="color: #000040;">&amp;</span>amp<span style="color: #008080;">;</span>si<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; <span style="color: #008000;">&#125;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #0000ff;">if</span> <span style="color: #008000;">&#40;</span>VER_PLATFORM_WIN32_NT <span style="color: #000040;">!</span><span style="color: #000080;">=</span> osvi.<span style="color: #007788;">dwPlatformId</span> ¦¦ osvi.<span style="color: #007788;">dwMajorVersion</span> <span style="color: #000040;">&amp;</span>lt<span style="color: #008080;">;</span><span style="color: #000080;">=</span> <span style="color: #0000dd;">4</span> <span style="color: #008000;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #008000;">&#125;</span><br />
<br />
&nbsp; &nbsp; osInfo.<span style="color: #007788;">OS_Info</span> <span style="color: #000040;">+</span><span style="color: #000080;">=</span> <span style="color: #FF0000;">&quot;Microsoft &quot;</span><span style="color: #008080;">;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #0000ff;">if</span><span style="color: #008000;">&#40;</span> osvi.<span style="color: #007788;">dwMinorVersion</span> <span style="color: #000080;">==</span> <span style="color: #0000dd;">0</span> <span style="color: #008000;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">if</span><span style="color: #008000;">&#40;</span> osvi.<span style="color: #007788;">wProductType</span> <span style="color: #000080;">==</span> VER_NT_WORKSTATION <span style="color: #008000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; osInfo.<span style="color: #007788;">OS_Info</span> <span style="color: #000040;">+</span><span style="color: #000080;">=</span> <span style="color: #FF0000;">&quot;Windows Vista &quot;</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; osInfo.<span style="color: #007788;">OS_Name</span> <span style="color: #000080;">=</span> <span style="color: #FF0000;">&quot;Windows Vista&quot;</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#125;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">else</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; osInfo.<span style="color: #007788;">OS_Info</span> <span style="color: #000040;">+</span><span style="color: #000080;">=</span> <span style="color: #FF0000;">&quot;Windows Server 2008 &quot;</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; osInfo.<span style="color: #007788;">OS_Name</span> <span style="color: #000080;">=</span> <span style="color: #FF0000;">&quot;Windows Server 2008&quot;</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #008000;">&#125;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #0000ff;">if</span> <span style="color: #008000;">&#40;</span> osvi.<span style="color: #007788;">dwMinorVersion</span> <span style="color: #000080;">==</span> <span style="color: #0000dd;">1</span> <span style="color: #008000;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">if</span><span style="color: #008000;">&#40;</span> osvi.<span style="color: #007788;">wProductType</span> <span style="color: #000080;">==</span> VER_NT_WORKSTATION <span style="color: #008000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; osInfo.<span style="color: #007788;">OS_Info</span> <span style="color: #000040;">+</span><span style="color: #000080;">=</span> <span style="color: #FF0000;">&quot;Windows 7 &quot;</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; osInfo.<span style="color: #007788;">OS_Name</span> <span style="color: #000080;">=</span> <span style="color: #FF0000;">&quot;Windows 7&quot;</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#125;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">else</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; osInfo.<span style="color: #007788;">OS_Info</span> <span style="color: #000040;">+</span><span style="color: #000080;">=</span> <span style="color: #FF0000;">&quot;Windows Server 2008 R2 &quot;</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; osInfo.<span style="color: #007788;">OS_Name</span> <span style="color: #000080;">=</span> <span style="color: #FF0000;">&quot;Windows Server 2008 R2&quot;</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #008000;">&#125;</span><br />
<br />
&nbsp; &nbsp; PGPI pGPI <span style="color: #000080;">=</span> <span style="color: #008000;">&#40;</span>PGPI<span style="color: #008000;">&#41;</span> GetProcAddress<span style="color: #008000;">&#40;</span>GetModuleHandle<span style="color: #008000;">&#40;</span>TEXT<span style="color: #008000;">&#40;</span><span style="color: #FF0000;">&quot;kernel32.dll&quot;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span>, <span style="color: #FF0000;">&quot;GetProductInfo&quot;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; pGPI<span style="color: #008000;">&#40;</span> osvi.<span style="color: #007788;">dwMajorVersion</span>, osvi.<span style="color: #007788;">dwMinorVersion</span>, <span style="color: #0000dd;">0</span>, <span style="color: #0000dd;">0</span>, <span style="color: #000040;">&amp;</span>amp<span style="color: #008080;">;</span>dwType<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #0000ff;">switch</span><span style="color: #008000;">&#40;</span> dwType <span style="color: #008000;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #008000;">&#123;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #0000ff;">case</span> PRODUCT_ULTIMATE<span style="color: #008080;">:</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; osInfo.<span style="color: #007788;">OS_Info</span> <span style="color: #000040;">+</span><span style="color: #000080;">=</span> <span style="color: #FF0000;">&quot;Ultimate Edition &quot;</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; osInfo.<span style="color: #007788;">OS_Edition</span> <span style="color: #000080;">=</span> <span style="color: #FF0000;">&quot;Ultimate Edition&quot;</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">break</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#125;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #0000ff;">case</span> PRODUCT_PROFESSIONAL<span style="color: #008080;">:</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; osInfo.<span style="color: #007788;">OS_Info</span> <span style="color: #000040;">+</span><span style="color: #000080;">=</span> <span style="color: #FF0000;">&quot;Professional &quot;</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; osInfo.<span style="color: #007788;">OS_Edition</span> <span style="color: #000080;">=</span> <span style="color: #FF0000;">&quot;Professional&quot;</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">break</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#125;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #0000ff;">case</span> PRODUCT_HOME_PREMIUM<span style="color: #008080;">:</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; osInfo.<span style="color: #007788;">OS_Info</span> <span style="color: #000040;">+</span><span style="color: #000080;">=</span> <span style="color: #FF0000;">&quot;Home Premium Edition &quot;</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; osInfo.<span style="color: #007788;">OS_Edition</span> <span style="color: #000080;">=</span> <span style="color: #FF0000;">&quot;Home Premium Edition&quot;</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">break</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#125;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #0000ff;">case</span> PRODUCT_HOME_BASIC<span style="color: #008080;">:</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; osInfo.<span style="color: #007788;">OS_Info</span> <span style="color: #000040;">+</span><span style="color: #000080;">=</span> <span style="color: #FF0000;">&quot;Home Basic Edition &quot;</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; osInfo.<span style="color: #007788;">OS_Edition</span> <span style="color: #000080;">=</span> <span style="color: #FF0000;">&quot;Home Basic Edition&quot;</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">break</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#125;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #0000ff;">case</span> PRODUCT_ENTERPRISE<span style="color: #008080;">:</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; osInfo.<span style="color: #007788;">OS_Info</span> <span style="color: #000040;">+</span><span style="color: #000080;">=</span> <span style="color: #FF0000;">&quot;Enterprise Edition &quot;</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; osInfo.<span style="color: #007788;">OS_Edition</span> <span style="color: #000080;">=</span> <span style="color: #FF0000;">&quot;Enterprise Edition&quot;</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">break</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#125;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #0000ff;">case</span> PRODUCT_BUSINESS<span style="color: #008080;">:</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; osInfo.<span style="color: #007788;">OS_Info</span> <span style="color: #000040;">+</span><span style="color: #000080;">=</span> <span style="color: #FF0000;">&quot;Business Edition &quot;</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; osInfo.<span style="color: #007788;">OS_Edition</span> <span style="color: #000080;">=</span> <span style="color: #FF0000;">&quot;Business Edition&quot;</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">break</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#125;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #0000ff;">case</span> PRODUCT_STARTER<span style="color: #008080;">:</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; osInfo.<span style="color: #007788;">OS_Info</span> <span style="color: #000040;">+</span><span style="color: #000080;">=</span> <span style="color: #FF0000;">&quot;Starter Edition &quot;</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; osInfo.<span style="color: #007788;">OS_Edition</span> <span style="color: #000080;">=</span> <span style="color: #FF0000;">&quot;Starter Edition&quot;</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">break</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#125;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #0000ff;">case</span> PRODUCT_CLUSTER_SERVER<span style="color: #008080;">:</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; osInfo.<span style="color: #007788;">OS_Info</span> <span style="color: #000040;">+</span><span style="color: #000080;">=</span> <span style="color: #FF0000;">&quot;Cluster Server Edition &quot;</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; osInfo.<span style="color: #007788;">OS_Edition</span> <span style="color: #000080;">=</span> <span style="color: #FF0000;">&quot;Cluster Server Edition&quot;</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">break</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#125;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #0000ff;">case</span> PRODUCT_DATACENTER_SERVER<span style="color: #008080;">:</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; osInfo.<span style="color: #007788;">OS_Info</span> <span style="color: #000040;">+</span><span style="color: #000080;">=</span> <span style="color: #FF0000;">&quot;Datacenter Edition &quot;</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; osInfo.<span style="color: #007788;">OS_Edition</span> <span style="color: #000080;">=</span> <span style="color: #FF0000;">&quot;Datacenter Edition&quot;</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">break</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#125;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #0000ff;">case</span> PRODUCT_DATACENTER_SERVER_CORE<span style="color: #008080;">:</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; osInfo.<span style="color: #007788;">OS_Info</span> <span style="color: #000040;">+</span><span style="color: #000080;">=</span> <span style="color: #FF0000;">&quot;Datacenter Edition (core installation) &quot;</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; osInfo.<span style="color: #007788;">OS_Edition</span> <span style="color: #000080;">=</span> <span style="color: #FF0000;">&quot;Datacenter Edition (core installation)&quot;</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">break</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#125;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #0000ff;">case</span> PRODUCT_ENTERPRISE_SERVER<span style="color: #008080;">:</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; osInfo.<span style="color: #007788;">OS_Info</span> <span style="color: #000040;">+</span><span style="color: #000080;">=</span> <span style="color: #FF0000;">&quot;Enterprise Edition &quot;</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; osInfo.<span style="color: #007788;">OS_Edition</span> <span style="color: #000080;">=</span> <span style="color: #FF0000;">&quot;Enterprise Edition&quot;</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">break</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#125;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #0000ff;">case</span> PRODUCT_ENTERPRISE_SERVER_CORE<span style="color: #008080;">:</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; osInfo.<span style="color: #007788;">OS_Info</span> <span style="color: #000040;">+</span><span style="color: #000080;">=</span> <span style="color: #FF0000;">&quot;Enterprise Edition (core installation) &quot;</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; osInfo.<span style="color: #007788;">OS_Edition</span> <span style="color: #000080;">=</span> <span style="color: #FF0000;">&quot;Enterprise Edition (core installation)&quot;</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">break</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#125;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #0000ff;">case</span> PRODUCT_ENTERPRISE_SERVER_IA64<span style="color: #008080;">:</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; osInfo.<span style="color: #007788;">OS_Info</span> <span style="color: #000040;">+</span><span style="color: #000080;">=</span> <span style="color: #FF0000;">&quot;Enterprise Edition for Itanium-based Systems &quot;</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; osInfo.<span style="color: #007788;">OS_Edition</span> <span style="color: #000080;">=</span> <span style="color: #FF0000;">&quot;Enterprise Edition for Itanium-based Systems&quot;</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">break</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#125;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #0000ff;">case</span> PRODUCT_SMALLBUSINESS_SERVER<span style="color: #008080;">:</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; osInfo.<span style="color: #007788;">OS_Info</span> <span style="color: #000040;">+</span><span style="color: #000080;">=</span> <span style="color: #FF0000;">&quot;Small Business Server &quot;</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; osInfo.<span style="color: #007788;">OS_Edition</span> <span style="color: #000080;">=</span> <span style="color: #FF0000;">&quot;Small Business Server&quot;</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">break</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#125;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #0000ff;">case</span> PRODUCT_SMALLBUSINESS_SERVER_PREMIUM<span style="color: #008080;">:</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; osInfo.<span style="color: #007788;">OS_Info</span> <span style="color: #000040;">+</span><span style="color: #000080;">=</span> <span style="color: #FF0000;">&quot;Small Business Server Premium Edition &quot;</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; osInfo.<span style="color: #007788;">OS_Edition</span> <span style="color: #000080;">=</span> <span style="color: #FF0000;">&quot;Small Business Server Premium Edition&quot;</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">break</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#125;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #0000ff;">case</span> PRODUCT_STANDARD_SERVER<span style="color: #008080;">:</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; osInfo.<span style="color: #007788;">OS_Info</span> <span style="color: #000040;">+</span><span style="color: #000080;">=</span> <span style="color: #FF0000;">&quot;Standard Edition &quot;</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; osInfo.<span style="color: #007788;">OS_Edition</span> <span style="color: #000080;">=</span> <span style="color: #FF0000;">&quot;Standard Edition&quot;</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">break</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#125;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #0000ff;">case</span> PRODUCT_STANDARD_SERVER_CORE<span style="color: #008080;">:</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; osInfo.<span style="color: #007788;">OS_Info</span> <span style="color: #000040;">+</span><span style="color: #000080;">=</span> <span style="color: #FF0000;">&quot;Standard Edition (core installation) &quot;</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; osInfo.<span style="color: #007788;">OS_Edition</span> <span style="color: #000080;">=</span> <span style="color: #FF0000;">&quot;Standard Edition (core installation)&quot;</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">break</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#125;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #0000ff;">case</span> PRODUCT_WEB_SERVER<span style="color: #008080;">:</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; osInfo.<span style="color: #007788;">OS_Info</span> <span style="color: #000040;">+</span><span style="color: #000080;">=</span> <span style="color: #FF0000;">&quot;Web Server Edition &quot;</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; osInfo.<span style="color: #007788;">OS_Edition</span> <span style="color: #000080;">=</span> <span style="color: #FF0000;">&quot;Web Server Edition&quot;</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">break</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #008000;">&#125;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #0000ff;">if</span> <span style="color: #008000;">&#40;</span> osvi.<span style="color: #007788;">dwMajorVersion</span> <span style="color: #000080;">==</span> <span style="color: #0000dd;">5</span> <span style="color: #000040;">&amp;</span>amp<span style="color: #008080;">;</span><span style="color: #000040;">&amp;</span>amp<span style="color: #008080;">;</span> osvi.<span style="color: #007788;">dwMinorVersion</span> <span style="color: #000080;">==</span> <span style="color: #0000dd;">2</span> <span style="color: #008000;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">if</span> <span style="color: #008000;">&#40;</span>GetSystemMetrics<span style="color: #008000;">&#40;</span>SM_SERVERR2<span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; osInfo.<span style="color: #007788;">OS_Info</span> <span style="color: #000040;">+</span><span style="color: #000080;">=</span> <span style="color: #FF0000;">&quot;Windows Server 2003 R2, &quot;</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; osInfo.<span style="color: #007788;">OS_Edition</span> <span style="color: #000080;">=</span> <span style="color: #FF0000;">&quot;Windows Server 2003 R2&quot;</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#125;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">else</span> <span style="color: #0000ff;">if</span> <span style="color: #008000;">&#40;</span>osvi.<span style="color: #007788;">wSuiteMask</span> <span style="color: #000040;">&amp;</span>amp<span style="color: #008080;">;</span> VER_SUITE_STORAGE_SERVER<span style="color: #008000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; osInfo.<span style="color: #007788;">OS_Info</span> <span style="color: #000040;">+</span><span style="color: #000080;">=</span> <span style="color: #FF0000;">&quot;Windows Storage Server 2003&quot;</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; osInfo.<span style="color: #007788;">OS_Edition</span> <span style="color: #000080;">=</span> <span style="color: #FF0000;">&quot;Windows Storage Server 2003&quot;</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#125;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">else</span> <span style="color: #0000ff;">if</span> <span style="color: #008000;">&#40;</span>osvi.<span style="color: #007788;">wSuiteMask</span> <span style="color: #000040;">&amp;</span>amp<span style="color: #008080;">;</span> VER_SUITE_WH_SERVER<span style="color: #008000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; osInfo.<span style="color: #007788;">OS_Info</span> <span style="color: #000040;">+</span><span style="color: #000080;">=</span> <span style="color: #FF0000;">&quot;Windows Home Server&quot;</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; osInfo.<span style="color: #007788;">OS_Edition</span> <span style="color: #000080;">=</span> <span style="color: #FF0000;">&quot;Windows Home Server&quot;</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#125;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">else</span> <span style="color: #0000ff;">if</span> <span style="color: #008000;">&#40;</span>osvi.<span style="color: #007788;">wProductType</span> <span style="color: #000080;">==</span> VER_NT_WORKSTATION <span style="color: #000040;">&amp;</span>amp<span style="color: #008080;">;</span><span style="color: #000040;">&amp;</span>amp<span style="color: #008080;">;</span> si.<span style="color: #007788;">wProcessorArchitecture</span><span style="color: #000080;">==</span>PROCESSOR_ARCHITECTURE_AMD64<span style="color: #008000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; osInfo.<span style="color: #007788;">OS_Info</span> <span style="color: #000040;">+</span><span style="color: #000080;">=</span> <span style="color: #FF0000;">&quot;Windows XP Professional x64 Edition&quot;</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; osInfo.<span style="color: #007788;">OS_Edition</span> <span style="color: #000080;">=</span> <span style="color: #FF0000;">&quot;Professional x64 Edition&quot;</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#125;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">else</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; osInfo.<span style="color: #007788;">OS_Info</span> <span style="color: #000040;">+</span><span style="color: #000080;">=</span> <span style="color: #FF0000;">&quot;Windows Server 2003, &quot;</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; osInfo.<span style="color: #007788;">OS_Edition</span> <span style="color: #000080;">=</span> <span style="color: #FF0000;">&quot;Windows Server 2003&quot;</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#125;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">if</span> <span style="color: #008000;">&#40;</span>osvi.<span style="color: #007788;">wProductType</span> <span style="color: #000040;">!</span><span style="color: #000080;">=</span> VER_NT_WORKSTATION<span style="color: #008000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">if</span> <span style="color: #008000;">&#40;</span>si.<span style="color: #007788;">wProcessorArchitecture</span><span style="color: #000080;">==</span>PROCESSOR_ARCHITECTURE_IA64<span style="color: #008000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">if</span> <span style="color: #008000;">&#40;</span>osvi.<span style="color: #007788;">wSuiteMask</span> <span style="color: #000040;">&amp;</span>amp<span style="color: #008080;">;</span> VER_SUITE_DATACENTER<span style="color: #008000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; osInfo.<span style="color: #007788;">OS_Info</span> <span style="color: #000040;">+</span><span style="color: #000080;">=</span> <span style="color: #FF0000;">&quot;Datacenter Edition for Itanium-based Systems&quot;</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; osInfo.<span style="color: #007788;">OS_Edition</span> <span style="color: #000080;">=</span> <span style="color: #FF0000;">&quot;Datacenter Edition for Itanium-based Systems&quot;</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#125;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">else</span> <span style="color: #0000ff;">if</span> <span style="color: #008000;">&#40;</span>osvi.<span style="color: #007788;">wSuiteMask</span> <span style="color: #000040;">&amp;</span>amp<span style="color: #008080;">;</span> VER_SUITE_ENTERPRISE<span style="color: #008000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; osInfo.<span style="color: #007788;">OS_Info</span> <span style="color: #000040;">+</span><span style="color: #000080;">=</span> <span style="color: #FF0000;">&quot;Enterprise Edition for Itanium-based Systems&quot;</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; osInfo.<span style="color: #007788;">OS_Edition</span> <span style="color: #000080;">=</span> <span style="color: #FF0000;">&quot;Enterprise Edition for Itanium-based Systems&quot;</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#125;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">else</span> <span style="color: #0000ff;">if</span> <span style="color: #008000;">&#40;</span>si.<span style="color: #007788;">wProcessorArchitecture</span><span style="color: #000080;">==</span>PROCESSOR_ARCHITECTURE_AMD64<span style="color: #008000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">if</span> <span style="color: #008000;">&#40;</span>osvi.<span style="color: #007788;">wSuiteMask</span> <span style="color: #000040;">&amp;</span>amp<span style="color: #008080;">;</span> VER_SUITE_DATACENTER<span style="color: #008000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; osInfo.<span style="color: #007788;">OS_Info</span> <span style="color: #000040;">+</span><span style="color: #000080;">=</span> <span style="color: #FF0000;">&quot;Datacenter x64 Edition&quot;</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; osInfo.<span style="color: #007788;">OS_Edition</span> <span style="color: #000080;">=</span> <span style="color: #FF0000;">&quot;Datacenter x64 Edition&quot;</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#125;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">else</span> <span style="color: #0000ff;">if</span> <span style="color: #008000;">&#40;</span>osvi.<span style="color: #007788;">wSuiteMask</span> <span style="color: #000040;">&amp;</span>amp<span style="color: #008080;">;</span> VER_SUITE_ENTERPRISE<span style="color: #008000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; osInfo.<span style="color: #007788;">OS_Info</span> <span style="color: #000040;">+</span><span style="color: #000080;">=</span> <span style="color: #FF0000;">&quot;Enterprise x64 Edition&quot;</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; osInfo.<span style="color: #007788;">OS_Edition</span> <span style="color: #000080;">=</span> <span style="color: #FF0000;">&quot;Enterprise x64 Edition&quot;</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#125;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">else</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; osInfo.<span style="color: #007788;">OS_Info</span> <span style="color: #000040;">+</span><span style="color: #000080;">=</span> <span style="color: #FF0000;">&quot;Standard x64 Edition&quot;</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; osInfo.<span style="color: #007788;">OS_Edition</span> <span style="color: #000080;">=</span> <span style="color: #FF0000;">&quot;Standard x64 Edition&quot;</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#125;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">else</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">if</span> <span style="color: #008000;">&#40;</span>osvi.<span style="color: #007788;">wSuiteMask</span> <span style="color: #000040;">&amp;</span>amp<span style="color: #008080;">;</span> VER_SUITE_COMPUTE_SERVER<span style="color: #008000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; osInfo.<span style="color: #007788;">OS_Info</span> <span style="color: #000040;">+</span><span style="color: #000080;">=</span> <span style="color: #FF0000;">&quot;Compute Cluster Edition&quot;</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; osInfo.<span style="color: #007788;">OS_Edition</span> <span style="color: #000080;">=</span> <span style="color: #FF0000;">&quot;Compute Cluster Edition&quot;</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#125;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">else</span> <span style="color: #0000ff;">if</span> <span style="color: #008000;">&#40;</span>osvi.<span style="color: #007788;">wSuiteMask</span> <span style="color: #000040;">&amp;</span>amp<span style="color: #008080;">;</span> VER_SUITE_DATACENTER<span style="color: #008000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; osInfo.<span style="color: #007788;">OS_Info</span> <span style="color: #000040;">+</span><span style="color: #000080;">=</span> <span style="color: #FF0000;">&quot;Datacenter Edition&quot;</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; osInfo.<span style="color: #007788;">OS_Edition</span> <span style="color: #000080;">=</span> <span style="color: #FF0000;">&quot;Datacenter Edition&quot;</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#125;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">else</span> <span style="color: #0000ff;">if</span> <span style="color: #008000;">&#40;</span>osvi.<span style="color: #007788;">wSuiteMask</span> <span style="color: #000040;">&amp;</span>amp<span style="color: #008080;">;</span> VER_SUITE_ENTERPRISE<span style="color: #008000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; osInfo.<span style="color: #007788;">OS_Info</span> <span style="color: #000040;">+</span><span style="color: #000080;">=</span> <span style="color: #FF0000;">&quot;Enterprise Edition&quot;</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; osInfo.<span style="color: #007788;">OS_Edition</span> <span style="color: #000080;">=</span> <span style="color: #FF0000;">&quot;Enterprise Edition&quot;</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#125;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">else</span> <span style="color: #0000ff;">if</span> <span style="color: #008000;">&#40;</span>osvi.<span style="color: #007788;">wSuiteMask</span> <span style="color: #000040;">&amp;</span>amp<span style="color: #008080;">;</span> VER_SUITE_BLADE<span style="color: #008000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; osInfo.<span style="color: #007788;">OS_Info</span> <span style="color: #000040;">+</span><span style="color: #000080;">=</span> <span style="color: #FF0000;">&quot;Web Edition&quot;</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; osInfo.<span style="color: #007788;">OS_Edition</span> <span style="color: #000080;">=</span> <span style="color: #FF0000;">&quot;Web Edition&quot;</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#125;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">else</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; osInfo.<span style="color: #007788;">OS_Info</span> <span style="color: #000040;">+</span><span style="color: #000080;">=</span> <span style="color: #FF0000;">&quot;Standard Edition&quot;</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; osInfo.<span style="color: #007788;">OS_Edition</span> <span style="color: #000080;">=</span> <span style="color: #FF0000;">&quot;Standard Edition&quot;</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #008000;">&#125;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #0000ff;">if</span> <span style="color: #008000;">&#40;</span>osvi.<span style="color: #007788;">dwMajorVersion</span> <span style="color: #000080;">==</span> <span style="color: #0000dd;">5</span> <span style="color: #000040;">&amp;</span>amp<span style="color: #008080;">;</span><span style="color: #000040;">&amp;</span>amp<span style="color: #008080;">;</span> osvi.<span style="color: #007788;">dwMinorVersion</span> <span style="color: #000080;">==</span> <span style="color: #0000dd;">1</span><span style="color: #008000;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; osInfo.<span style="color: #007788;">OS_Info</span> <span style="color: #000040;">+</span><span style="color: #000080;">=</span> <span style="color: #FF0000;">&quot;Windows XP &quot;</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; osInfo.<span style="color: #007788;">OS_Name</span> <span style="color: #000080;">=</span> <span style="color: #FF0000;">&quot;Windows XP&quot;</span><span style="color: #008080;">;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">if</span><span style="color: #008000;">&#40;</span>osvi.<span style="color: #007788;">wSuiteMask</span> <span style="color: #000040;">&amp;</span>amp<span style="color: #008080;">;</span> VER_SUITE_PERSONAL<span style="color: #008000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; osInfo.<span style="color: #007788;">OS_Info</span> <span style="color: #000040;">+</span><span style="color: #000080;">=</span> <span style="color: #FF0000;">&quot;Home Edition&quot;</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; osInfo.<span style="color: #007788;">OS_Edition</span> <span style="color: #000080;">=</span> <span style="color: #FF0000;">&quot;Home Edition&quot;</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#125;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">else</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; osInfo.<span style="color: #007788;">OS_Info</span> <span style="color: #000040;">+</span><span style="color: #000080;">=</span> <span style="color: #FF0000;">&quot;Professional&quot;</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; osInfo.<span style="color: #007788;">OS_Edition</span> <span style="color: #000080;">=</span> <span style="color: #FF0000;">&quot;Professional&quot;</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #008000;">&#125;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #0000ff;">if</span> <span style="color: #008000;">&#40;</span>osvi.<span style="color: #007788;">dwMajorVersion</span> <span style="color: #000080;">==</span> <span style="color: #0000dd;">5</span> <span style="color: #000040;">&amp;</span>amp<span style="color: #008080;">;</span><span style="color: #000040;">&amp;</span>amp<span style="color: #008080;">;</span> osvi.<span style="color: #007788;">dwMinorVersion</span> <span style="color: #000080;">==</span> <span style="color: #0000dd;">0</span><span style="color: #008000;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; osInfo.<span style="color: #007788;">OS_Info</span> <span style="color: #000040;">+</span><span style="color: #000080;">=</span> <span style="color: #FF0000;">&quot;Windows 2000 &quot;</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; osInfo.<span style="color: #007788;">OS_Edition</span> <span style="color: #000080;">=</span> <span style="color: #FF0000;">&quot;Windows 2000&quot;</span><span style="color: #008080;">;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">if</span> <span style="color: #008000;">&#40;</span>osvi.<span style="color: #007788;">wProductType</span> <span style="color: #000080;">==</span> VER_NT_WORKSTATION<span style="color: #008000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; osInfo.<span style="color: #007788;">OS_Info</span> <span style="color: #000040;">+</span><span style="color: #000080;">=</span> <span style="color: #FF0000;">&quot;Professional&quot;</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; osInfo.<span style="color: #007788;">OS_Edition</span> <span style="color: #000080;">=</span> <span style="color: #FF0000;">&quot;Professional&quot;</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#125;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">else</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">if</span> <span style="color: #008000;">&#40;</span>osvi.<span style="color: #007788;">wSuiteMask</span> <span style="color: #000040;">&amp;</span>amp<span style="color: #008080;">;</span> VER_SUITE_DATACENTER<span style="color: #008000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; osInfo.<span style="color: #007788;">OS_Info</span> <span style="color: #000040;">+</span><span style="color: #000080;">=</span> <span style="color: #FF0000;">&quot;Datacenter Server&quot;</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; osInfo.<span style="color: #007788;">OS_Edition</span> <span style="color: #000080;">=</span> <span style="color: #FF0000;">&quot;Datacenter Server&quot;</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#125;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">else</span> <span style="color: #0000ff;">if</span> <span style="color: #008000;">&#40;</span>osvi.<span style="color: #007788;">wSuiteMask</span> <span style="color: #000040;">&amp;</span>amp<span style="color: #008080;">;</span> VER_SUITE_ENTERPRISE<span style="color: #008000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; osInfo.<span style="color: #007788;">OS_Info</span> <span style="color: #000040;">+</span><span style="color: #000080;">=</span> <span style="color: #FF0000;">&quot;Advanced Server&quot;</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; osInfo.<span style="color: #007788;">OS_Edition</span> <span style="color: #000080;">=</span> <span style="color: #FF0000;">&quot;Advanced Server&quot;</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#125;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">else</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; osInfo.<span style="color: #007788;">OS_Info</span> <span style="color: #000040;">+</span><span style="color: #000080;">=</span> <span style="color: #FF0000;">&quot;Server&quot;</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; osInfo.<span style="color: #007788;">OS_Edition</span> <span style="color: #000080;">=</span> <span style="color: #FF0000;">&quot;Server&quot;</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #008000;">&#125;</span><br />
<br />
&nbsp; &nbsp; osInfo.<span style="color: #007788;">OS_Info</span> <span style="color: #000040;">+</span><span style="color: #000080;">=</span> osvi.<span style="color: #007788;">szCSDVersion</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; osInfo.<span style="color: #007788;">OS_Service_Pack</span> <span style="color: #000040;">+</span><span style="color: #000080;">=</span> <span style="color: #FF0000;">&quot; &quot;</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; osInfo.<span style="color: #007788;">OS_Service_Pack</span> <span style="color: #000040;">+</span><span style="color: #000080;">=</span> osvi.<span style="color: #007788;">szCSDVersion</span><span style="color: #008080;">;</span><br />
<br />
&nbsp; &nbsp; osInfo.<span style="color: #007788;">OS_Info</span> <span style="color: #000040;">+</span><span style="color: #000080;">=</span> <span style="color: #FF0000;">&quot; (build &quot;</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; <span style="color: #0000ff;">char</span> strBuild<span style="color: #008000;">&#91;</span><span style="color: #0000dd;">64</span><span style="color: #008000;">&#93;</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; _itoa<span style="color: #008000;">&#40;</span>osvi.<span style="color: #007788;">dwBuildNumber</span>, strBuild, <span style="color: #0000dd;">10</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; osInfo.<span style="color: #007788;">OS_Info</span> <span style="color: #000040;">+</span><span style="color: #000080;">=</span> strBuild<span style="color: #008080;">;</span><br />
&nbsp; &nbsp; osInfo.<span style="color: #007788;">OS_Info</span> <span style="color: #000040;">+</span><span style="color: #000080;">=</span> <span style="color: #FF0000;">&quot;)&quot;</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; osInfo.<span style="color: #007788;">OS_Build_Number</span> <span style="color: #000080;">=</span> osvi.<span style="color: #007788;">dwBuildNumber</span><span style="color: #008080;">;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #0000ff;">if</span> <span style="color: #008000;">&#40;</span>osvi.<span style="color: #007788;">dwMajorVersion</span> <span style="color: #000040;">&amp;</span>gt<span style="color: #008080;">;</span><span style="color: #000080;">=</span> <span style="color: #0000dd;">6</span><span style="color: #008000;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">if</span> <span style="color: #008000;">&#40;</span>si.<span style="color: #007788;">wProcessorArchitecture</span> <span style="color: #000080;">==</span> PROCESSOR_ARCHITECTURE_AMD64<span style="color: #008000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; osInfo.<span style="color: #007788;">OS_Info</span> <span style="color: #000040;">+</span><span style="color: #000080;">=</span> <span style="color: #FF0000;">&quot;, 64-bit&quot;</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; osInfo.<span style="color: #007788;">OS_Architecture</span> <span style="color: #000080;">=</span> <span style="color: #FF0000;">&quot;64-bit&quot;</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#125;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">else</span> <span style="color: #0000ff;">if</span> <span style="color: #008000;">&#40;</span>si.<span style="color: #007788;">wProcessorArchitecture</span> <span style="color: #000080;">==</span> PROCESSOR_ARCHITECTURE_INTEL<span style="color: #008000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; osInfo.<span style="color: #007788;">OS_Info</span> <span style="color: #000040;">+</span><span style="color: #000080;">=</span> <span style="color: #FF0000;">&quot;, 32-bit&quot;</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; osInfo.<span style="color: #007788;">OS_Architecture</span> <span style="color: #000080;">=</span> <span style="color: #FF0000;">&quot;32-bit&quot;</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #008000;">&#125;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #0000ff;">return</span> osInfo<span style="color: #008080;">;</span><br />
<span style="color: #008000;">&#125;</span><br />
<br />
<span style="color: #339900;">#endif</span></div></td></tr></tbody></table></div>
<p>Now, just call the &#8220;getWindowsVersionInfo()&#8221; function like below:</p>
<blockquote><p>OSINFO OperatingSystemInfo = getWindowsVersionInfo();</p></blockquote>
<p>From then on, the version info can be read like such:</p>
<blockquote><p>string strOSname = OperatingSystemInfo.OS_Name;</p></blockquote>
<p>For reference, I have put the structure of OSINFO below:</p>
<div class="codecolorer-container cpp dawn" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br /></div></td><td><div class="cpp codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #0000ff;">struct</span> OSINFO<br />
<span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; string<br />
&nbsp; &nbsp; &nbsp; &nbsp; OS_Name,<br />
&nbsp; &nbsp; &nbsp; &nbsp; OS_Edition,<br />
&nbsp; &nbsp; &nbsp; &nbsp; OS_Service_Pack,<br />
&nbsp; &nbsp; &nbsp; &nbsp; OS_Architecture,<br />
&nbsp; &nbsp; &nbsp; &nbsp; OS_Info<span style="color: #008080;">;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #0000ff;">int</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; OS_Build_Number<span style="color: #008080;">;</span><br />
<span style="color: #008000;">&#125;</span><span style="color: #008080;">;</span></div></td></tr></tbody></table></div>
<h1>Uses</h1>
<p>So what might one use this source code for? Well, perhaps a feature of your application only works with Windows 7, and you don&#8217;t want to have multiple versions of the same application for each Windows version. In that case, you could use the header file to detect the Version of windows and run the specific function that works for that version of windows. You can also use it for:</p>
<ul>
<li>Optimize For Windows Version</li>
<li>Better Application Compatibility</li>
<li>OS Specific Applications</li>
</ul>
 <p><a href="http://infinitylogic.net/?flattrss_redirect&amp;id=89&amp;md5=e495612fa8cd57be0baff8c3fa4c2e3f" title="Flattr" target="_blank"><img src="http://infinitylogic.net/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://infinitylogic.net/c-snippet-detect-windows-version/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<atom:link rel="payment" href="https://flattr.com/submit/auto?user_id=BrockCooper&amp;url=http%3A%2F%2Finfinitylogic.net%2Fc-snippet-detect-windows-version%2F&amp;language=en_GB&amp;category=text&amp;title=C%2B%2B+Snippet%3A+Detect+Windows+Version&amp;description=Summary%0D%0AThis+nicely+put+together+C%2B%2B+header+file+that+will+allow+you+to+detect+which+version+of+windows+your+program+is+currently+running+on.+Currently+it+supports+these+versions+of+Windows%3A%0D%0A%0D%0A%26nbsp%3B%0D%0A%0D%0A%09Windows+7%0D%0A%09Windows+Vista%0D%0A%09Windows+XP%0D%0A%09Windows+2000%0D%0A%09Windows+Server%0D%0A%0D%0AI+hope+to+add+more+support+and+more+functions+at+a+later+date+%3A%29%0D%0AHow+It+Works%0D%0AMost+of+the+details+needed+for+us+to+detect+the+Windows+version+are+in+the+Windows+structure+%22OSVERSIONINFOEX%2C%22+which+can+be+populated+with+data+by+calling+the+%22GetVersionEx%28%29%22+function+found+in+%22Windows.h.%22+However+its+not+as+easy+as+it+seams%2C+there+is+much+more+work+put+into+detecting+the+version+information%2C+such+as%3A%0D%0A%0D%0A%09Service+Pack+Version%0D%0A%09OS+Edition%28+Ultimate%2C+Pro%2C+etc.+%29%0D%0A%09OS+Architecture+%28+x64%2C+x86+%29%0D%0A%09Build+Number%0D%0A%0D%0AHow+To+Use+It%0D%0AUsing+this+code+is+extremely+easy%2C+just+include+the+%22os_detection.h%22+header+file+into+your+C%2B%2B+project+and+don%27t+forget+to+put+%22%23include+%22os_detection.h%22%22+in+your+main.cpp+file+%3AP%0D%0ACode%3A+os_detection.h%0D%0A%5Bcc+lang%3D%22cpp%22%5D%0D%0A%23ifndef+_OS_DETECTION_H_%0D%0A%23define+_OS_DETECTION_H_%0D%0A%0D%0A%23include+%26lt%3Bwindows.h%26gt%3B%0D%0A%23include+%26lt%3Bstring%26gt%3B%0D%0A%0D%0Atypedef+void+%28WINAPI+%2APGNSI%29%28LPSYSTEM_INFO%29%3B%0D%0Atypedef+BOOL+%28WINAPI+%2APGPI%29%28DWORD%2C+DWORD%2C+DWORD%2C+DWORD%2C+PDWORD%29%3B%0D%0A%0D%0A%23define+PRODUCT_PROFESSIONAL+0x00000030%0D%0A%23define+VER_SUITE_WH_SERVER++0x00008000%0D%0A%0D%0Astruct+OSINFO%0D%0A%7B%0D%0A%09string%0D%0A%09%09OS_Name%2C%0D%0A%09%09OS_Edition%2C%0D%0A%09%09OS_Service_Pack%2C%0D%0A%09%09OS_Architecture%2C%0D%0A%09%09OS_Info%3B%0D%0A%0D%0A%09int%0D%0A%09%09OS_Build_Number%3B%0D%0A%7D%3B%0D%0A%0D%0AOSINFO+getWindowsVersionInfo%28%29%0D%0A%7B%0D%0A%09OSINFO+osInfo%3B%0D%0A%0D%0A%09OSVERSIONINFOEX+osvi%3B%0D%0A%09SYSTEM_INFO+si%3B%0D%0A%09BOOL+bOsVersionInfoEx%3B%0D%0A%09DWORD+dwType%3B%0D%0A%0D%0A%09ZeroMemory%28%26amp%3Bsi%2C+sizeof%28SYSTEM_INFO%29%29%3B%0D%0A%09ZeroMemory%28%26amp%3Bosvi%2C+sizeof%28OSVERSIONINFOEX%29%29%3B%0D%0A%09osvi.dwOSVersionInfoSize+%3D+sizeof%28OSVERSIONINFOEX%29%3B%0D%0A%0D%0A%09bOsVersionInfoEx+%3D+GetVersionEx%28%28OSVERSIONINFO%2A%29+%26amp%3Bosvi%29%3B%0D%0A%0D%0A%09if+%28%21bOsVersionInfoEx%29%0D%0A%09%7B%0D%0A%09%7D%0D%0A%0D%0A%09PGNSI+pGNSI+%3D+%28PGNSI%29GetProcAddress%28GetModuleHandle%28TEXT%28%22kernel32.dll%22%29%29%2C+%22GetNativeSystemInfo%22%29%3B%0D%0A%0D%0A%09if+%28pGNSI+%21%3D+NULL%29%0D%0A%09%7B%0D%0A%09%09pGNSI%28%26amp%3Bsi%29%3B%0D%0A%09%7D%0D%0A%0D%0A%09else%0D%0A%09%7B%0D%0A%09%09GetSystemInfo%28%26amp%3Bsi%29%3B%0D%0A%09%7D%0D%0A%0D%0A%09if+%28VER_PLATFORM_WIN32_NT+%21%3D+osvi.dwPlatformId+%C2%A6%C2%A6+osvi.dwMajorVersion+%26lt%3B%3D+4+%29%0D%0A%09%7B%0D%0A%09%7D%0D%0A%0D%0A%09osInfo.OS_Info+%2B%3D+%22Microsoft+%22%3B%0D%0A%0D%0A%09if%28+osvi.dwMinorVersion+%3D%3D+0+%29%0D%0A%09%7B%0D%0A%09%09if%28+osvi.wProductType+%3D%3D+VER_NT_WORKSTATION+%29%0D%0A%09%09%7B%0D%0A%09%09%09osInfo.OS_Info+%2B%3D+%22Windows+Vista+%22%3B%0D%0A%09%09%09osInfo.OS_Name+%3D+%22Windows+Vista%22%3B%0D%0A%09%09%7D%0D%0A%0D%0A%09%09else%0D%0A%09%09%7B%0D%0A%09%09%09osInfo.OS_Info+%2B%3D+%22Windows+Server+2008+%22%3B%0D%0A%09%09%09osInfo.OS_Name+%3D+%22Windows+Server+2008%22%3B%0D%0A%09%09%7D%0D%0A%09%7D%0D%0A%0D%0A%09if+%28+osvi.dwMinorVersion+%3D%3D+1+%29%0D%0A%09%7B%0D%0A%09%09if%28+osvi.wProductType+%3D%3D+VER_NT_WORKSTATION+%29%0D%0A%09%09%7B%0D%0A%09%09%09osInfo.OS_Info+%2B%3D+%22Windows+7+%22%3B%0D%0A%09%09%09osInfo.OS_Name+%3D+%22Windows+7%22%3B%0D%0A%09%09%7D%0D%0A%0D%0A%09%09else%0D%0A%09%09%7B%0D%0A%09%09%09osInfo.OS_Info+%2B%3D+%22Windows+Server+2008+R2+%22%3B%0D%0A%09%09%09osInfo.OS_Name+%3D+%22Windows+Server+2008+R2%22%3B%0D%0A%09%09%7D%0D%0A%09%7D%0D%0A%0D%0A%09PGPI+pGPI+%3D+%28PGPI%29+GetProcAddress%28GetModuleHandle%28TEXT%28%22kernel32.dll%22%29%29%2C+%22GetProductInfo%22%29%3B%0D%0A%09pGPI%28+osvi.dwMajorVersion%2C+osvi.dwMinorVersion%2C+0%2C+0%2C+%26amp%3BdwType%29%3B%0D%0A%0D%0A%09switch%28+dwType+%29%0D%0A%09%7B%0D%0A%0D%0A%09case+PRODUCT_ULTIMATE%3A%0D%0A%09%09%7B%0D%0A%09%09%09osInfo.OS_Info+%2B%3D+%22Ultimate+Edition+%22%3B%0D%0A%09%09%09osInfo.OS_Edition+%3D+%22Ultimate+Edition%22%3B%0D%0A%09%09%09break%3B%0D%0A%09%09%7D%0D%0A%0D%0A%09case+PRODUCT_PROFESSIONAL%3A%0D%0A%09%09%7B%0D%0A%09%09%09osInfo.OS_Info+%2B%3D+%22Professional+%22%3B%0D%0A%09%09%09osInfo.OS_Edition+%3D+%22Professional%22%3B%0D%0A%09%09%09break%3B%0D%0A%09%09%7D%0D%0A%0D%0A%09case+PRODUCT_HOME_PREMIUM%3A%0D%0A%09%09%7B%0D%0A%09%09%09osInfo.OS_Info+%2B%3D+%22Home+Premium+Edition+%22%3B%0D%0A%09%09%09osInfo.OS_Edition+%3D+%22Home+Premium+Edition%22%3B%0D%0A%09%09%09break%3B%0D%0A%09%09%7D%0D%0A%0D%0A%09case+PRODUCT_HOME_BASIC%3A%0D%0A%09%09%7B%0D%0A%09%09%09osInfo.OS_Info+%2B%3D+%22Home+Basic+Edition+%22%3B%0D%0A%09%09%09osInfo.OS_Edition+%3D+%22Home+Basic+Edition%22%3B%0D%0A%09%09%09break%3B%0D%0A%09%09%7D%0D%0A%0D%0A%09case+PRODUCT_ENTERPRISE%3A%0D%0A%09%09%7B%0D%0A%09%09%09osInfo.OS_Info+%2B%3D+%22Enterprise+Edition+%22%3B%0D%0A%09%09%09osInfo.OS_Edition+%3D+%22Enterprise+Edition%22%3B%0D%0A%09%09%09break%3B%0D%0A%09%09%7D%0D%0A%0D%0A%09case+PRODUCT_BUSINESS%3A%0D%0A%09%09%7B%0D%0A%09%09%09osInfo.OS_Info+%2B%3D+%22Business+Edition+%22%3B%0D%0A%09%09%09osInfo.OS_Edition+%3D+%22Business+Edition%22%3B%0D%0A%09%09%09break%3B%0D%0A%09%09%7D%0D%0A%0D%0A%09case+PRODUCT_STARTER%3A%0D%0A%09%09%7B%0D%0A%09%09%09osInfo.OS_Info+%2B%3D+%22Starter+Edition+%22%3B%0D%0A%09%09%09osInfo.OS_Edition+%3D+%22Starter+Edition%22%3B%0D%0A%09%09%09break%3B%0D%0A%09%09%7D%0D%0A%0D%0A%09case+PRODUCT_CLUSTER_SERVER%3A%0D%0A%09%09%7B%0D%0A%09%09%09osInfo.OS_Info+%2B%3D+%22Cluster+Server+Edition+%22%3B%0D%0A%09%09%09osInfo.OS_Edition+%3D+%22Cluster+Server+Edition%22%3B%0D%0A%09%09%09break%3B%0D%0A%09%09%7D%0D%0A%0D%0A%09case+PRODUCT_DATACENTER_SERVER%3A%0D%0A%09%09%7B%0D%0A%09%09%09osInfo.OS_Info+%2B%3D+%22Datacenter+Edition+%22%3B%0D%0A%09%09%09osInfo.OS_Edition+%3D+%22Datacenter+Edition%22%3B%0D%0A%09%09%09break%3B%0D%0A%09%09%7D%0D%0A%0D%0A%09case+PRODUCT_DATACENTER_SERVER_CORE%3A%0D%0A%09%09%7B%0D%0A%09%09%09osInfo.OS_Info+%2B%3D+%22Datacenter+Edition+%28core+installation%29+%22%3B%0D%0A%09%09%09osInfo.OS_Edition+%3D+%22Datacenter+Edition+%28core+installation%29%22%3B%0D%0A%09%09%09break%3B%0D%0A%09%09%7D%0D%0A%0D%0A%09case+PRODUCT_ENTERPRISE_SERVER%3A%0D%0A%09%09%7B%0D%0A%09%09%09osInfo.OS_Info+%2B%3D+%22Enterprise+Edition+%22%3B%0D%0A%09%09%09osInfo.OS_Edition+%3D+%22Enterprise+Edition%22%3B%0D%0A%09%09%09break%3B%0D%0A%09%09%7D%0D%0A%0D%0A%09case+PRODUCT_ENTERPRISE_SERVER_CORE%3A%0D%0A%09%09%7B%0D%0A%09%09%09osInfo.OS_Info+%2B%3D+%22Enterprise+Edition+%28core+installation%29+%22%3B%0D%0A%09%09%09osInfo.OS_Edition+%3D+%22Enterprise+Edition+%28core+installation%29%22%3B%0D%0A%09%09%09break%3B%0D%0A%09%09%7D%0D%0A%0D%0A%09case+PRODUCT_ENTERPRISE_SERVER_IA64%3A%0D%0A%09%09%7B%0D%0A%09%09%09osInfo.OS_Info+%2B%3D+%22Enterprise+Edition+for+Itanium-based+Systems+%22%3B%0D%0A%09%09%09osInfo.OS_Edition+%3D+%22Enterprise+Edition+for+Itanium-based+Systems%22%3B%0D%0A%09%09%09break%3B%0D%0A%09%09%7D%0D%0A%0D%0A%09case+PRODUCT_SMALLBUSINESS_SERVER%3A%0D%0A%09%09%7B%0D%0A%09%09%09osInfo.OS_Info+%2B%3D+%22Small+Business+Server+%22%3B%0D%0A%09%09%09osInfo.OS_Edition+%3D+%22Small+Business+Server%22%3B%0D%0A%09%09%09break%3B%0D%0A%09%09%7D%0D%0A%0D%0A%09case+PRODUCT_SMALLBUSINESS_SERVER_PREMIUM%3A%0D%0A%09%09%7B%0D%0A%09%09%09osInfo.OS_Info+%2B%3D+%22Small+Business+Server+Premium+Edition+%22%3B%0D%0A%09%09%09osInfo.OS_Edition+%3D+%22Small+Business+Server+Premium+Edition%22%3B%0D%0A%09%09%09break%3B%0D%0A%09%09%7D%0D%0A%0D%0A%09case+PRODUCT_STANDARD_SERVER%3A%0D%0A%09%09%7B%0D%0A%09%09%09osInfo.OS_Info+%2B%3D+%22Standard+Edition+%22%3B%0D%0A%09%09%09osInfo.OS_Edition+%3D+%22Standard+Edition%22%3B%0D%0A%09%09%09break%3B%0D%0A%09%09%7D%0D%0A%0D%0A%09case+PRODUCT_STANDARD_SERVER_CORE%3A%0D%0A%09%09%7B%0D%0A%09%09%09osInfo.OS_Info+%2B%3D+%22Standard+Edition+%28core+installation%29+%22%3B%0D%0A%09%09%09osInfo.OS_Edition+%3D+%22Standard+Edition+%28core+installation%29%22%3B%0D%0A%09%09%09break%3B%0D%0A%09%09%7D%0D%0A%0D%0A%09case+PRODUCT_WEB_SERVER%3A%0D%0A%09%09%7B%0D%0A%09%09%09osInfo.OS_Info+%2B%3D+%22Web+Server+Edition+%22%3B%0D%0A%09%09%09osInfo.OS_Edition+%3D+%22Web+Server+Edition%22%3B%0D%0A%09%09%09break%3B%0D%0A%09%09%7D%0D%0A%09%7D%0D%0A%0D%0A%09if+%28+osvi.dwMajorVersion+%3D%3D+5+%26amp%3B%26amp%3B+osvi.dwMinorVersion+%3D%3D+2+%29%0D%0A%09%7B%0D%0A%09%09if+%28GetSystemMetrics%28SM_SERVERR2%29%29%0D%0A%09%09%7B%0D%0A%09%09%09osInfo.OS_Info+%2B%3D+%22Windows+Server+2003+R2%2C+%22%3B%0D%0A%09%09%09osInfo.OS_Edition+%3D+%22Windows+Server+2003+R2%22%3B%0D%0A%09%09%7D%0D%0A%0D%0A%09%09else+if+%28osvi.wSuiteMask+%26amp%3B+VER_SUITE_STORAGE_SERVER%29%0D%0A%09%09%7B%0D%0A%09%09%09osInfo.OS_Info+%2B%3D+%22Windows+Storage+Server+2003%22%3B%0D%0A%09%09%09osInfo.OS_Edition+%3D+%22Windows+Storage+Server+2003%22%3B%0D%0A%09%09%7D%0D%0A%0D%0A%09%09else+if+%28osvi.wSuiteMask+%26amp%3B+VER_SUITE_WH_SERVER%29%0D%0A%09%09%7B%0D%0A%09%09%09osInfo.OS_Info+%2B%3D+%22Windows+Home+Server%22%3B%0D%0A%09%09%09osInfo.OS_Edition+%3D+%22Windows+Home+Server%22%3B%0D%0A%09%09%7D%0D%0A%0D%0A%09%09else+if+%28osvi.wProductType+%3D%3D+VER_NT_WORKSTATION+%26amp%3B%26amp%3B+si.wProcessorArchitecture%3D%3DPROCESSOR_ARCHITECTURE_AMD64%29%0D%0A%09%09%7B%0D%0A%09%09%09osInfo.OS_Info+%2B%3D+%22Windows+XP+Professional+x64+Edition%22%3B%0D%0A%09%09%09osInfo.OS_Edition+%3D+%22Professional+x64+Edition%22%3B%0D%0A%09%09%7D%0D%0A%0D%0A%09%09else%0D%0A%09%09%7B%0D%0A%09%09%09osInfo.OS_Info+%2B%3D+%22Windows+Server+2003%2C+%22%3B%0D%0A%09%09%09osInfo.OS_Edition+%3D+%22Windows+Server+2003%22%3B%0D%0A%09%09%7D%0D%0A%0D%0A%09%09if+%28osvi.wProductType+%21%3D+VER_NT_WORKSTATION%29%0D%0A%09%09%7B%0D%0A%09%09%09if+%28si.wProcessorArchitecture%3D%3DPROCESSOR_ARCHITECTURE_IA64%29%0D%0A%09%09%09%7B%0D%0A%09%09%09%09if+%28osvi.wSuiteMask+%26amp%3B+VER_SUITE_DATACENTER%29%0D%0A%09%09%09%09%7B%0D%0A%09%09%09%09%09osInfo.OS_Info+%2B%3D+%22Datacenter+Edition+for+Itanium-based+Systems%22%3B%0D%0A%09%09%09%09%09osInfo.OS_Edition+%3D+%22Datacenter+Edition+for+Itanium-based+Systems%22%3B%0D%0A%09%09%09%09%7D%0D%0A%0D%0A%09%09%09%09else+if+%28osvi.wSuiteMask+%26amp%3B+VER_SUITE_ENTERPRISE%29%0D%0A%09%09%09%09%7B%0D%0A%09%09%09%09%09osInfo.OS_Info+%2B%3D+%22Enterprise+Edition+for+Itanium-based+Systems%22%3B%0D%0A%09%09%09%09%09osInfo.OS_Edition+%3D+%22Enterprise+Edition+for+Itanium-based+Systems%22%3B%0D%0A%09%09%09%09%7D%0D%0A%09%09%09%7D%0D%0A%0D%0A%09%09%09else+if+%28si.wProcessorArchitecture%3D%3DPROCESSOR_ARCHITECTURE_AMD64%29%0D%0A%09%09%09%7B%0D%0A%09%09%09%09if+%28osvi.wSuiteMask+%26amp%3B+VER_SUITE_DATACENTER%29%0D%0A%09%09%09%09%7B%0D%0A%09%09%09%09%09osInfo.OS_Info+%2B%3D+%22Datacenter+x64+Edition%22%3B%0D%0A%09%09%09%09%09osInfo.OS_Edition+%3D+%22Datacenter+x64+Edition%22%3B%0D%0A%09%09%09%09%7D%0D%0A%0D%0A%09%09%09%09else+if+%28osvi.wSuiteMask+%26amp%3B+VER_SUITE_ENTERPRISE%29%0D%0A%09%09%09%09%7B%0D%0A%09%09%09%09%09osInfo.OS_Info+%2B%3D+%22Enterprise+x64+Edition%22%3B%0D%0A%09%09%09%09%09osInfo.OS_Edition+%3D+%22Enterprise+x64+Edition%22%3B%0D%0A%09%09%09%09%7D%0D%0A%0D%0A%09%09%09%09else%0D%0A%09%09%09%09%7B%0D%0A%09%09%09%09%09osInfo.OS_Info+%2B%3D+%22Standard+x64+Edition%22%3B%0D%0A%09%09%09%09%09osInfo.OS_Edition+%3D+%22Standard+x64+Edition%22%3B%0D%0A%09%09%09%09%7D%0D%0A%09%09%09%7D%0D%0A%0D%0A%09%09%09else%0D%0A%09%09%09%7B%0D%0A%09%09%09%09if+%28osvi.wSuiteMask+%26amp%3B+VER_SUITE_COMPUTE_SERVER%29%0D%0A%09%09%09%09%7B%0D%0A%09%09%09%09%09osInfo.OS_Info+%2B%3D+%22Compute+Cluster+Edition%22%3B%0D%0A%09%09%09%09%09osInfo.OS_Edition+%3D+%22Compute+Cluster+Edition%22%3B%0D%0A%09%09%09%09%7D%0D%0A%0D%0A%09%09%09%09else+if+%28osvi.wSuiteMask+%26amp%3B+VER_SUITE_DATACENTER%29%0D%0A%09%09%09%09%7B%0D%0A%09%09%09%09%09osInfo.OS_Info+%2B%3D+%22Datacenter+Edition%22%3B%0D%0A%09%09%09%09%09osInfo.OS_Edition+%3D+%22Datacenter+Edition%22%3B%0D%0A%09%09%09%09%7D%0D%0A%0D%0A%09%09%09%09else+if+%28osvi.wSuiteMask+%26amp%3B+VER_SUITE_ENTERPRISE%29%0D%0A%09%09%09%09%7B%0D%0A%09%09%09%09%09osInfo.OS_Info+%2B%3D+%22Enterprise+Edition%22%3B%0D%0A%09%09%09%09%09osInfo.OS_Edition+%3D+%22Enterprise+Edition%22%3B%0D%0A%09%09%09%09%7D%0D%0A%0D%0A%09%09%09%09else+if+%28osvi.wSuiteMask+%26amp%3B+VER_SUITE_BLADE%29%0D%0A%09%09%09%09%7B%0D%0A%09%09%09%09%09osInfo.OS_Info+%2B%3D+%22Web+Edition%22%3B%0D%0A%09%09%09%09%09osInfo.OS_Edition+%3D+%22Web+Edition%22%3B%0D%0A%09%09%09%09%7D%0D%0A%0D%0A%09%09%09%09else%0D%0A%09%09%09%09%7B%0D%0A%09%09%09%09%09osInfo.OS_Info+%2B%3D+%22Standard+Edition%22%3B%0D%0A%09%09%09%09%09osInfo.OS_Edition+%3D+%22Standard+Edition%22%3B%0D%0A%09%09%09%09%7D%0D%0A%09%09%09%7D%0D%0A%09%09%7D%0D%0A%09%7D%0D%0A%0D%0A%09if+%28osvi.dwMajorVersion+%3D%3D+5+%26amp%3B%26amp%3B+osvi.dwMinorVersion+%3D%3D+1%29%0D%0A%09%7B%0D%0A%09%09osInfo.OS_Info+%2B%3D+%22Windows+XP+%22%3B%0D%0A%09%09osInfo.OS_Name+%3D+%22Windows+XP%22%3B%0D%0A%0D%0A%09%09if%28osvi.wSuiteMask+%26amp%3B+VER_SUITE_PERSONAL%29%0D%0A%09%09%7B%0D%0A%09%09%09osInfo.OS_Info+%2B%3D+%22Home+Edition%22%3B%0D%0A%09%09%09osInfo.OS_Edition+%3D+%22Home+Edition%22%3B%0D%0A%09%09%7D%0D%0A%0D%0A%09%09else%0D%0A%09%09%7B%0D%0A%09%09%09osInfo.OS_Info+%2B%3D+%22Professional%22%3B%0D%0A%09%09%09osInfo.OS_Edition+%3D+%22Professional%22%3B%0D%0A%09%09%7D%0D%0A%09%7D%0D%0A%0D%0A%09if+%28osvi.dwMajorVersion+%3D%3D+5+%26amp%3B%26amp%3B+osvi.dwMinorVersion+%3D%3D+0%29%0D%0A%09%7B%0D%0A%09%09osInfo.OS_Info+%2B%3D+%22Windows+2000+%22%3B%0D%0A%09%09osInfo.OS_Edition+%3D+%22Windows+2000%22%3B%0D%0A%0D%0A%09%09if+%28osvi.wProductType+%3D%3D+VER_NT_WORKSTATION%29%0D%0A%09%09%7B%0D%0A%09%09%09osInfo.OS_Info+%2B%3D+%22Professional%22%3B%0D%0A%09%09%09osInfo.OS_Edition+%3D+%22Professional%22%3B%0D%0A%09%09%7D%0D%0A%0D%0A%09%09else%0D%0A%09%09%7B%0D%0A%09%09%09if+%28osvi.wSuiteMask+%26amp%3B+VER_SUITE_DATACENTER%29%0D%0A%09%09%09%7B%0D%0A%09%09%09%09osInfo.OS_Info+%2B%3D+%22Datacenter+Server%22%3B%0D%0A%09%09%09%09osInfo.OS_Edition+%3D+%22Datacenter+Server%22%3B%0D%0A%09%09%09%7D%0D%0A%0D%0A%09%09%09else+if+%28osvi.wSuiteMask+%26amp%3B+VER_SUITE_ENTERPRISE%29%0D%0A%09%09%09%7B%0D%0A%09%09%09%09osInfo.OS_Info+%2B%3D+%22Advanced+Server%22%3B%0D%0A%09%09%09%09osInfo.OS_Edition+%3D+%22Advanced+Server%22%3B%0D%0A%09%09%09%7D%0D%0A%0D%0A%09%09%09else%0D%0A%09%09%09%7B%0D%0A%09%09%09%09osInfo.OS_Info+%2B%3D+%22Server%22%3B%0D%0A%09%09%09%09osInfo.OS_Edition+%3D+%22Server%22%3B%0D%0A%09%09%09%7D%0D%0A%09%09%7D%0D%0A%09%7D%0D%0A%0D%0A%09osInfo.OS_Info+%2B%3D+osvi.szCSDVersion%3B%0D%0A%09osInfo.OS_Service_Pack+%2B%3D+%22+%22%3B%0D%0A%09osInfo.OS_Service_Pack+%2B%3D+osvi.szCSDVersion%3B%0D%0A%0D%0A%09osInfo.OS_Info+%2B%3D+%22+%28build+%22%3B%0D%0A%09char+strBuild%5B64%5D%3B%0D%0A%09_itoa%28osvi.dwBuildNumber%2C+strBuild%2C+10%29%3B%0D%0A%09osInfo.OS_Info+%2B%3D+strBuild%3B%0D%0A%09osInfo.OS_Info+%2B%3D+%22%29%22%3B%0D%0A%09osInfo.OS_Build_Number+%3D+osvi.dwBuildNumber%3B%0D%0A%0D%0A%09if+%28osvi.dwMajorVersion+%26gt%3B%3D+6%29%0D%0A%09%7B%0D%0A%09%09if+%28si.wProcessorArchitecture+%3D%3D+PROCESSOR_ARCHITECTURE_AMD64%29%0D%0A%09%09%7B%0D%0A%09%09%09osInfo.OS_Info+%2B%3D+%22%2C+64-bit%22%3B%0D%0A%09%09%09osInfo.OS_Architecture+%3D+%2264-bit%22%3B%0D%0A%09%09%7D%0D%0A%0D%0A%09%09else+if+%28si.wProcessorArchitecture+%3D%3D+PROCESSOR_ARCHITECTURE_INTEL%29%0D%0A%09%09%7B%0D%0A%09%09%09osInfo.OS_Info+%2B%3D+%22%2C+32-bit%22%3B%0D%0A%09%09%09osInfo.OS_Architecture+%3D+%2232-bit%22%3B%0D%0A%09%09%7D%0D%0A%09%7D%0D%0A%0D%0A%09return+osInfo%3B%0D%0A%7D%0D%0A%0D%0A%23endif%0D%0A%5B%2Fcc%5D%0D%0ANow%2C+just+call+the+%22getWindowsVersionInfo%28%29%22+function+like+below%3A%0D%0AOSINFO+OperatingSystemInfo+%3D+getWindowsVersionInfo%28%29%3B%0D%0AFrom+then+on%2C+the+version+info+can+be+read+like+such%3A%0D%0Astring+strOSname+%3D+OperatingSystemInfo.OS_Name%3B%0D%0AFor+reference%2C+I+have+put+the+structure+of+OSINFO+below%3A%0D%0A%5Bcc+lang%3D%22cpp%22%5D%0D%0Astruct+OSINFO%0D%0A%7B%0D%0A%09string%0D%0A%09%09OS_Name%2C%0D%0A%09%09OS_Edition%2C%0D%0A%09%09OS_Service_Pack%2C%0D%0A%09%09OS_Architecture%2C%0D%0A%09%09OS_Info%3B%0D%0A%0D%0A%09int%0D%0A%09%09OS_Build_Number%3B%0D%0A%7D%3B%0D%0A%5B%2Fcc%5D%0D%0AUses%0D%0ASo+what+might+one+use+this+source+code+for%3F+Well%2C+perhaps+a+feature+of+your+application+only+works+with+Windows+7%2C+and+you+don%27t+want+to+have+multiple+versions+of+the+same+application+for+each+Windows+version.+In+that+case%2C+you+could+use+the+header+file+to+detect+the+Version+of+windows+and+run+the+specific+function+that+works+for+that+version+of+windows.+You+can+also+use+it+for%3A%0D%0A%0D%0A%09Optimize+For+Windows+Version%0D%0A%09Better+Application+Compatibility%0D%0A%09OS+Specific+Applications%0D%0A&amp;tags=C%2B%2B%2CCode%2CProgramming%2CSnippet%2CWindows%2Cblog" type="text/html" />
	</item>
		<item>
		<title>Speed Up Opera With RAMDisk</title>
		<link>http://infinitylogic.net/speed-up-opera/</link>
		<comments>http://infinitylogic.net/speed-up-opera/#comments</comments>
		<pubDate>Tue, 03 Jan 2012 07:47:08 +0000</pubDate>
		<dc:creator>Brock Cooper</dc:creator>
				<category><![CDATA[Tips]]></category>
		<category><![CDATA[Benchmark]]></category>
		<category><![CDATA[Browser]]></category>
		<category><![CDATA[Dataram]]></category>
		<category><![CDATA[Faster]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[Opera]]></category>
		<category><![CDATA[RAM]]></category>
		<category><![CDATA[RAMDisk]]></category>
		<category><![CDATA[Speed]]></category>
		<category><![CDATA[Tweak]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://infinitylogic.net/?p=18</guid>
		<description><![CDATA[How It Works? Normally Opera stores and manages all of its browsing cache on disk, which in most cases is just fine for daily use. Nonetheless, we want to squeeze every last ounce of power we can out of our favorite browser So, rather than opting to read and write to that slow IDE hard [...]]]></description>
			<content:encoded><![CDATA[<h1><a href="http://infinitylogic.net/wp-content/uploads/2012/01/Opera-logo-PNG1.png"><img class="alignleft size-medium wp-image-62" title="Opera Logo" src="http://infinitylogic.net/wp-content/uploads/2012/01/Opera-logo-PNG1-e1325654928575.png" alt="" width="300" height="105" /></a>How It Works?</h1>
<p>Normally Opera stores and manages all of its browsing cache on disk, which in most cases is just fine for daily use. Nonetheless, we want to squeeze every last ounce of power we can out of our favorite browser <img src='http://infinitylogic.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  So, rather than opting to read and write to that slow IDE hard drive, or that speedy SATA drive, we chose to relocate where Opera stores its cache. We will be using the utility &#8220;RAMDisk&#8221; to create a fully functional hard drive complete with a FAT32 partition table  all loaded into the computers memory or RAM (Random Access Memory.)  This alone allows us to achieve faster read and write times surpassing by far the speed of any IDE or SATA hard drive currently on the market.</p>
<blockquote><p><strong>NOTE:</strong> although speeding up Operas cache will speed up most users browser, it may not speed up you&#8217;re browser. This is because this speed tip requires that you have a high speed internet connection; Although RAM is fast the cache speed is bottle necked by your network speed.</p></blockquote>
<h2>RAMDisk by Dataram</h2>
<p>To do all of this, we will be using &#8220;RAMDisk&#8221; which is written by <a href="http://www.dataram.com/">Dataram</a>. You can find the download link <a href="http://memory.dataram.com/products-and-services/software/ramdisk">here</a>.</p>
<blockquote><p><em>Dataram</em> &#8211; RAMDisk is Freeware (up to 4GB disk size). It creates a virtual RAM drive, or block of memory, which your computer treats as if it were a disk drive. By storing files and programs into memory, you can speed up internet load times and disk-to-disk activities, accelerate databases and reduce compile times. Save and load features allow RAMDisk to appear as persistent storage, even through reboots.</p></blockquote>
<h2>Uses</h2>
<p>The possible uses for this application appear to be seemingly endless. From speeding up Opera&#8217;s cache time to decreasing the compile time of your favorite IDE, some even go as far as to install an entire game on the RAMDisk drive&#8230; The performance is unbeatable&#8230; provided that you have sufficient RAM for the given task.</p>
<h1>Using RAMDisk</h1>
<p>After downloading and installing the free software from Dataram, open the &#8220;RAMDisk Configuration Utility&#8221; form the start menu. A slightly annoying ad will appear upon the application starting, however this is a small price to pay for such a lightweight and powerful tool. Perhaps someone or myself will conjure up a quick patch for it one day &gt;:) So, for now we will just close it out and continue on configuring it to work with Opera.</p>
<h2></h2>
<h2></h2>
<h2>Setting It Up</h2>
<p>The setup of this application is fairly simple, as most of the options are just check boxes and file dialogues <img src='http://infinitylogic.net/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' />  We don&#8217;t mind simplicity do we?</p>
<ul>
<li>Set the size in megabytes (MB) of RAM to use</li>
<li>Choose &#8220;FAT32&#8243; as the partition type</li>
<li>Select &#8220;Windows boot sector&#8221; as the boot sector type</li>
</ul>
<p><a href="http://infinitylogic.net/wp-content/uploads/2012/01/RAMDisk-Setup.png"><img class="alignnone size-full wp-image-30" title="RAMDisk Settings" src="http://infinitylogic.net/wp-content/uploads/2012/01/RAMDisk-Setup.png" alt="" width="559" height="446" /></a></p>
<p>Now although Opera will run just fine the way we have it configured now, every time you shutdown your computer and close RAMDisk all of your precious web cache is lost, never to be found again in the he void of volatile memory O.o Say what?</p>
<blockquote><p><em>Wikipedia</em><strong> &#8211; Volatile memory</strong>, also known as <strong>volatile storage</strong>, is computer memory that requires power to maintain the stored information&#8230;</p></blockquote>
<p>Solving the dilemma however is no more than a few clicks here and some keystrokes there. Dataram&#8217;s software developers have kindly include the required options to save our memory to file when we don&#8217;t need it.</p>
<ul>
<li>Select and setup both the &#8220;Load&#8221; and &#8220;Save Image Settings&#8221;</li>
<li>Choose a location to save to</li>
</ul>
<p><a href="http://infinitylogic.net/wp-content/uploads/2012/01/RAMDisk-Settings.png"><img class="alignnone size-full wp-image-29" title="RAMDisk Load &amp; Save Settings" src="http://infinitylogic.net/wp-content/uploads/2012/01/RAMDisk-Settings.png" alt="" width="559" height="446" /></a></p>
<h2>Starting RAMDisk</h2>
<p>Everything should be set at this point, regarding the &#8220;RAMDisk Configuration Utility&#8221; that is. All that remains is pressing the &#8220;Start RAMDisk&#8221; button!</p>
<p><a href="http://infinitylogic.net/wp-content/uploads/2012/01/Dataram-Drivers.png"><img class="alignnone size-full wp-image-51" title="Dataram Drivers" src="http://infinitylogic.net/wp-content/uploads/2012/01/Dataram-Drivers.png" alt="" width="458" height="238" /></a></p>
<p>Once the utility has installed its drivers we can now see that it has created a new hard drive and is ready for use. Almost there!</p>
<h2>Configuring Opera</h2>
<p>Now this is the easy part, just either click <a href="opera:config#UserPrefs|CacheDirectory4" target="_blank">here</a> or copy this link &#8220;<strong>opera:config#UserPrefs|CacheDirectory4</strong>&#8221; and browse to it with Opera.</p>
<blockquote><p><strong>FACT:</strong> You can also do it the hard way and just go to &#8220;<strong>opera:config</strong>&#8221; and search for &#8220;cache&#8221;</p></blockquote>
<div id="attachment_47" class="wp-caption alignnone" style="width: 655px"><a href="http://infinitylogic.net/wp-content/uploads/2012/01/Opera-Cache.png"><img class="size-full wp-image-47" title="Opera Cache Directory Setting" src="http://infinitylogic.net/wp-content/uploads/2012/01/Opera-Cache.png" alt="" width="645" height="103" /></a><p class="wp-caption-text">Opera Cache Directory Setting</p></div>
<p>All that&#8217;s left to do now is set the &#8220;Cache Directory4&#8243; location to the location of the RAMDisk Image and enjoy your now even faster Opera web browser! In our case, RAMDisk happened to mount the drive to &#8220;<strong>E:\</strong>.&#8221;</p>
<h2>Success!</h2>
<p>Now, if you&#8217;ve made it this far, I&#8217;m gonna assume that you didn&#8217;t screw things up too much&#8230; Just kidding <img src='http://infinitylogic.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  I&#8217;m sure you all did just fine ( You still haven&#8217;t sent me <a href="mailto:rage@infinitylogic.net">hate mail</a> yet. :p or so I hope&#8230; )  though we probably should still make sure everything is working properly. If it has, you should see you new RAMDisk drive fill with a few files at first, of course you do have to run Opera first for it to generate some cache.</p>
<h1>Performance!</h1>
<p>Perhaps you may be left to ponder how much faster RAM is to a standard hard drive&#8230; Nah, just kidding, just to see how much faster the read and write speeds were I ran a quick little benchmark test of both my hard drive and RAMDisk drive. And as you may have already expected the RAM is unbelievably fast.</p>
<p>RAMDisk drive:</p>
<div id="attachment_48" class="wp-caption alignnone" style="width: 426px"><a href="http://infinitylogic.net/wp-content/uploads/2012/01/RAM-Benchmark1.png"><img class="size-full wp-image-48" title="RAM Benchmark" src="http://infinitylogic.net/wp-content/uploads/2012/01/RAM-Benchmark1.png" alt="" width="416" height="378" /></a><p class="wp-caption-text">RAM Benchmark</p></div>
<p>Hard Drive:</p>
<div id="attachment_49" class="wp-caption alignnone" style="width: 426px"><a href="http://infinitylogic.net/wp-content/uploads/2012/01/HDD-Benchmark1.png"><img class="size-full wp-image-49" title="HDD Benchmark" src="http://infinitylogic.net/wp-content/uploads/2012/01/HDD-Benchmark1.png" alt="" width="416" height="378" /></a><p class="wp-caption-text">HDD Benchmark</p></div>
 <p><a href="http://infinitylogic.net/?flattrss_redirect&amp;id=18&amp;md5=64d850a47bf04e9a9a85634133e1f6d5" title="Flattr" target="_blank"><img src="http://infinitylogic.net/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://infinitylogic.net/speed-up-opera/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<atom:link rel="payment" href="https://flattr.com/submit/auto?user_id=BrockCooper&amp;url=http%3A%2F%2Finfinitylogic.net%2Fspeed-up-opera%2F&amp;language=en_GB&amp;category=text&amp;title=Speed+Up+Opera+With+RAMDisk&amp;description=How+It+Works%3F%0D%0ANormally+Opera+stores+and+manages+all+of+its+browsing+cache+on+disk%2C+which+in+most+cases+is+just+fine+for+daily+use.+Nonetheless%2C+we+want+to+squeeze+every+last+ounce+of+power+we+can+out+of+our+favorite+browser+%3A%29+So%2C+rather+than+opting+to+read+and+write+to+that+slow+IDE+hard+drive%2C+or+that+speedy+SATA+drive%2C+we+chose+to+relocate+where+Opera+stores+its+cache.+We+will+be+using+the+utility+%22RAMDisk%22+to+create+a+fully+functional+hard+drive+complete+with+a+FAT32+partition+table%C2%A0+all+loaded+into+the+computers+memory+or+RAM+%28Random+Access+Memory.%29%C2%A0+This+alone+allows+us+to+achieve+faster+read+and+write+times+surpassing+by+far+the+speed+of+any+IDE+or+SATA+hard+drive+currently+on+the+market.%0D%0ANOTE%3A+although+speeding+up+Operas+cache+will+speed+up+most+users+browser%2C+it+may+not+speed+up+you%27re+browser.+This+is+because+this+speed+tip+requires+that+you+have+a+high+speed+internet+connection%3B+Although+RAM+is+fast+the+cache+speed+is+bottle+necked+by+your+network+speed.%0D%0ARAMDisk+by+Dataram%0D%0ATo+do+all+of+this%2C+we+will+be+using+%22RAMDisk%22+which+is+written+by+Dataram.+You+can+find+the+download+link+here.%0D%0ADataram+-+RAMDisk+is+Freeware+%28up+to+4GB+disk+size%29.+It+creates+a+virtual+RAM+drive%2C+or+block+of+memory%2C+which+your+computer+treats+as+if+it+were+a+disk+drive.+By+storing+files+and+programs+into+memory%2C+you+can+speed+up+internet+load+times+and+disk-to-disk+activities%2C+accelerate+databases+and+reduce+compile+times.+Save+and+load+features+allow+RAMDisk+to+appear+as+persistent+storage%2C+even+through+reboots.%0D%0AUses%0D%0AThe+possible+uses+for+this+application+appear+to+be+seemingly+endless.+From+speeding+up+Opera%27s+cache+time+to+decreasing+the+compile+time+of+your+favorite+IDE%2C+some+even+go+as+far+as+to+install+an+entire+game+on+the+RAMDisk+drive...+The+performance+is+unbeatable...+provided+that+you+have+sufficient+RAM+for+the+given+task.%0D%0AUsing+RAMDisk%0D%0AAfter+downloading+and+installing+the+free+software+from+Dataram%2C+open+the+%22RAMDisk+Configuration+Utility%22+form+the+start+menu.+A+slightly+annoying+ad+will+appear+upon+the+application+starting%2C+however+this+is+a+small+price+to+pay+for+such+a+lightweight+and+powerful+tool.+Perhaps+someone+or+myself+will+conjure+up+a+quick+patch+for+it+one+day+%26gt%3B%3A%29+So%2C+for+now+we+will+just+close+it+out+and+continue+on+configuring+it+to+work+with+Opera.%0D%0A%0D%0A%0D%0ASetting+It+Up%0D%0AThe+setup+of+this+application+is+fairly+simple%2C+as+most+of+the+options+are+just+check+boxes+and+file+dialogues+%3AP+We+don%27t+mind+simplicity+do+we%3F%0D%0A%0D%0A%09Set+the+size+in+megabytes+%28MB%29+of+RAM+to+use%0D%0A%09Choose+%22FAT32%22+as+the+partition+type%0D%0A%09Select+%22Windows+boot+sector%22+as+the+boot+sector+type%0D%0A%0D%0A%0D%0A%0D%0ANow+although+Opera+will+run+just+fine+the+way+we+have+it+configured+now%2C+every+time+you+shutdown+your+computer+and+close+RAMDisk+all+of+your+precious+web+cache+is+lost%2C+never+to+be+found+again+in+the+he+void+of+volatile+memory+O.o+Say+what%3F%0D%0AWikipedia+-+Volatile+memory%2C+also+known+as+volatile+storage%2C+is+computer+memory+that+requires+power+to+maintain+the+stored+information...%0D%0ASolving+the+dilemma+however+is+no+more+than+a+few+clicks+here+and+some+keystrokes+there.+Dataram%27s+software+developers+have+kindly+include+the+required+options+to+save+our+memory+to+file+when+we+don%27t+need+it.%0D%0A%0D%0A%09Select+and+setup+both+the+%22Load%22+and+%22Save+Image+Settings%22%0D%0A%09Choose+a+location+to+save+to%0D%0A%0D%0A%0D%0AStarting+RAMDisk%0D%0AEverything+should+be+set+at+this+point%2C+regarding+the+%22RAMDisk+Configuration+Utility%22+that+is.+All+that+remains+is+pressing+the+%22Start+RAMDisk%22+button%21%0D%0A%0D%0A%0D%0A%0D%0AOnce+the+utility+has+installed+its+drivers+we+can+now+see+that+it+has+created+a+new+hard+drive+and+is+ready+for+use.+Almost+there%21%0D%0AConfiguring+Opera%0D%0ANow+this+is+the+easy+part%2C+just+either+click+here+or+copy+this+link+%22opera%3Aconfig%23UserPrefs%7CCacheDirectory4%22+and+browse+to+it+with+Opera.%0D%0AFACT%3A+You+can+also+do+it+the+hard+way+and+just+go+to+%22opera%3Aconfig%22+and+search+for+%22cache%22%0D%0A%5Bcaption+id%3D%22attachment_47%22+align%3D%22alignnone%22+width%3D%22645%22+caption%3D%22Opera+Cache+Directory+Setting%22%5D%5B%2Fcaption%5D%0D%0A%0D%0AAll+that%27s+left+to+do+now+is+set+the+%22Cache+Directory4%22+location+to+the+location+of+the+RAMDisk+Image+and+enjoy+your+now+even+faster+Opera+web+browser%21+In+our+case%2C+RAMDisk+happened+to+mount+the+drive+to+%22E%3A%5C.%22%0D%0ASuccess%21%0D%0ANow%2C+if+you%27ve+made+it+this+far%2C+I%27m+gonna+assume+that+you+didn%27t+screw+things+up+too+much...+Just+kidding+%3A%29+I%27m+sure+you+all+did+just+fine+%28+You+still+haven%27t+sent+me+hate+mail+yet.+%3Ap+or+so+I+hope...+%29%C2%A0+though+we+probably+should+still+make+sure+everything+is+working+properly.+If+it+has%2C+you+should+see+you+new+RAMDisk+drive+fill+with+a+few+files+at+first%2C+of+course+you+do+have+to+run+Opera+first+for+it+to+generate+some+cache.%0D%0APerformance%21%0D%0APerhaps+you+may+be+left+to+ponder+how+much+faster+RAM+is+to+a+standard+hard+drive...+Nah%2C+just+kidding%2C+just+to+see+how+much+faster+the+read+and+write+speeds+were+I+ran+a+quick+little+benchmark+test+of+both+my+hard+drive+and+RAMDisk+drive.+And+as+you+may+have+already+expected+the+RAM+is+unbelievably+fast.%0D%0A%0D%0ARAMDisk+drive%3A%0D%0A%0D%0A%5Bcaption+id%3D%22attachment_48%22+align%3D%22alignnone%22+width%3D%22416%22+caption%3D%22RAM+Benchmark%22%5D%5B%2Fcaption%5D%0D%0A%0D%0AHard+Drive%3A%0D%0A%0D%0A%5Bcaption+id%3D%22attachment_49%22+align%3D%22alignnone%22+width%3D%22416%22+caption%3D%22HDD+Benchmark%22%5D%5B%2Fcaption%5D&amp;tags=Benchmark%2CBrowser%2CDataram%2CFaster%2CInternet%2COpera%2CRAM%2CRAMDisk%2CSpeed%2CTweak%2CWeb%2Cblog" type="text/html" />
	</item>
	</channel>
</rss>

