About Terminal Server, Citrix, Delphi and other stuff
If you look into the registry in the key HKLM\System\CurrentControlSet\ProductOptions you will find several licensing related Values.
The ProductType and ProductSuite keys contain the OS Suite and Edition, but the ProductPolicy key is much more interesting. So let’s have a closer look at it, open RegEdit and DoubleClick the key, you will something like the screenshot below, a Binary Value:
As you can see the license names are there as a Unicode string and later on I will show you how we can read the values. But because I didn’t want to extract all the names manually I decided to see if I could reverse the used structure because it didn’t look very complicated. Using a Hex Editor I could determine the important part of the structure.
It starts with a header:
then an array of values follows:
The SlDataType is a word value that corresponds to the values of the SLDATATYPE enum:
And we end with an End Marker (of size cbEndMarker).
Then I wrote some code to parse the structure:
{ Read Header }
ms.ReadBuffer(Header, SizeOf(Header));
{ Loop through the Values }
while ms.Size – Header.cbEndMarker > ms.Position do
begin
{ Store current position }
CurPos := ms.Position;
{ Read Value }
ms.ReadBuffer(Value, SizeOf(Value));
{ Set Name length }
SetLength(Name, Value.cbName div SizeOf(WChar));
{ Read Name }
ms.ReadBuffer(Name[1], Value.cbName);
{ Read License Value }
CheckValue(Name);
{ Jump to next Value }
ms.Seek(CurPos + Value.cbSize, soFromBeginning);
end;
finally
ListView1.Items.EndUpdate;
ms.Free;
end;
end;
The procedure that reads the actual value is CheckValue, it uses the SLGetWindowsInformation function:
The results are very interesting, I didn’t know there were so many licensable features in Windows!
You can check your results with the demo project (source included).
License Demo (372)
Here are the results from my Windows 7 Laptop:

Related posts:
Active Directory Altiris bug Citrix Dell Delphi Exchange Exchange2003 Exchange2010 Hewlett-Packard HP iOS Jailbreak Java LinkedIn Linux MSI MySQL Navigation Objects Office Outlook Passat PowerPoint PowerShell referall was returned RNS315 RNS510 SasLibEx script slow Terminal Server ThinApp TSAdmin TSAdminEx VBS VCDS Vista VMWare Volkswagen Windows PE WLAN Wordpress WTSWaitSystemEvent wts_event_flush
WP Cumulus Flash tag cloud by Roy Tanck requires Flash Player 9 or better.
3 Responses for "Having fun with Windows Licensing"
Hi,
Nice tool, although it doesn’t work 100% on my Windows 7 (Ultimate), specially not with dualscreen. I can’t move it on my screen and it is stuck between my two monitors (screenshot added on bottom). I can’t close the application either, I have to end the process to close it.
Screenshot: http://www.imgdumper.nl/uploads3/4c18efa1d889f/4c18efa1bb3da-Untitled.png
Grtz,
Hans
Oh oh Hans, shame on me: I inserted a messagebox displaying all values so I could easily copy them to the clipboard but forgot to remove it.
So what you are seeing is a messagebox with 185 lines or so
I have updated the download.
[...] can directly check this value with the Licensing Demo from my Having fun with Windows Licensing [...]
Leave a reply