Zobrazují se příspěvky se štítkemwindows. Zobrazit všechny příspěvky
Zobrazují se příspěvky se štítkemwindows. Zobrazit všechny příspěvky

pondělí 29. září 2014

Apache httpd 2.4.6 hangs not servicing HTTPS

A lot of pain ... till solution found
# Apparently this fixes an issue with Apache 2.4.6 on Windows hanging
# when serving requests from Internet Explorer 10/11.
# see http://stijndewitt.wordpress.com/2014/01/10/apache-hangs-ie11/
AcceptFilter http none
AcceptFilter https none



pátek 22. srpna 2014

... nssm - non sucking service manager

Seems really usable - new to me.
Why I like it ... it is able to start any command as a service and has several options for service shutdown (Send Ctrl-C, send WM_CLOSE,kill process)

http://nssm.cc/usage


pátek 18. ledna 2013

... a way out of Windows symlink permission hell

For some reasons we needed to create symlinks on a Windows fileshare. Our environment was symlink ready (Win7 & WinServer 2008R2 & SMB2 everywhere). We started to try ... it sometimes worked sometimes not. Sometimes we received "You do not have sufficient privilege to perform this operation". Frustrating.
Finally we managed to make it working. We can now create symlinks from our server app directly in a shared folder.

Prerequisites
  • Windows 7+ and Windows Server 2008 R2 + and SMB2 enabled

Fileserver setup
  • the user willing to create symlinks must be 
    • granted "Create symbolic link" privilege (use Local Security Policy tool on the server)
    • granted modify right for the folder containing the symlink
Client setup
  • the user willing to create symlinks must be granted "Create symbolic link" privilege (use Local Security Policy tool on the client)
  • the right to  create symlinks must not originate from Administrators group -> the right must be granted directly to the user or indirectly via a security group
  • the user should not be a member of the Administrators group or the Administrators group should not bring the Create symlink permission (UAC disables the permission when it comes from the Administrators group --- UAC is EVIL)
  • depending on the link type used, the client computer must be able to resolve symlinks of certain type
    • turn symlink evaluation on using command (enables all kind of symlinks)
      • fsutil behavior set symlinkevaluation L2L:1 L2R:1 R2L:1 R2R:1 
If everything goes well you should be able to invoke following command to create directory symlink:

mklink /d \\server1\links-are-here\this-is-a-link \\server2\data-are-here\this-is-a-link-target

pátek 25. května 2012

Windows ACL hell solution

Error message "Access denied" makes me crazy. Whenever I see this message unexpectedly on windows computer I know that next few minutes/hours will be painful.

Windows access rights apparatus is overcomplicated for most uses. When advanced settings are combined with inheritance. When playing with ACLs man gets easily at the edge madness.

After several tries things are getting worse and worse. You can end up with a folder you can't do anything with. No rights left to you even if you are member of the Administrators group.

Following three steps should help in most cases (There are rare cases it will not help connected mainly to inability in taking ownership). Being administrator is the only prerequisite.

Steps to survive ACL hell:
  1. Taking the ownership - As a member of Administrators group you have all the power to own anything (any object) on a local system. And when there is another owner you can seize the object at your will. 
    • takeown /F file-or-folder 
    • you can use /R to do it recursively 
  2. Reseting rights - After membership is taken it is possible to get rid of all explicitly assigned ACLs using.
    • icacls file-or-folder /reset /T
  1. Test effective rights - using file Properties tab Security button Advanced tab Effective permissions - you can test whatever user you want and get his or here effective permissions.

Good luck!

 

neděle 28. srpna 2011

... exporting windows protected private key

Yes, it is possible to export use private keys and machine private keys. Thanks to mimikatz tool it is easy.http://www.blogger.com/img/blank.gifhttp://www.bloghttp://www.blogger.com/img/blank.gifger.com/img/blank.gif
Just download mimikatz utility from http://www.gentilkiwi.com/outils-s44-t-mimikatz.htm (ZIP direct link).

After downloading extract content of the ZIP file. Run mimikatz utility and in the command prompt enter:

dumpkey /force /medium

All user and machine private keys will be exported in pfx file (password:mimikatz).

Enjoy!

sobota 4. září 2010

Windows 7 sudo alternative

When there is a need to allow unprivileged user to perform certain privileged operation sudo or s-bit are possibilities on UNIX like systems. There is nothing similar on Windows.

Windows 7 (may be even Visto or XP) have EVENT bound scheduled tasks.
The task is scheduled to run under privileged account and is triggered by certain event in event log. The event can be generated by unprivileged account.

How to do it:
As privileged account:

eventcreate /T INFORMATION /L APPLICATION /SO RUN_PRIVILEGED_ACTION
/ID 1 /D "Initial event for source has to be created by privileged account"
schtasks /Create /F /RU SYSTEM /TN PrivilegedTaskRunner /TR c:\windows\system32\privileged-action.cmd
/SC ONEVENT /EC APPLICATION /MO *[System[Provider[@Name='RUN_PRIVILEGED_ACTION']]]


As unprivileged user

eventcreate /T INFORMATION /L APPLICATION
/SO RUN_PRIVILEGED_ACTION /ID 1 /D "running privileged task"

pondělí 4. ledna 2010

... backing up on Amazon S3

During Christmas I successfully migrated my backup procedure to use Amazon AWS. Influenced by Linux/Unix backup solution duplicity I was looking for similar solution for Windows. There is a Windows clone called Duplicati. Duplicati is implemented using C#/.NET runtime. Duplicati is a very fresh product (v1.0) but very promissing. With minor drawbacks Duplicati works as expected. I'm looking forward to future improved releases. And of course it's opensource (I have sources on my disk). A breif summary follows:

  • wide range of back-ends supported (S3 is my choice)

  • incremental delta based backup - no merged view of backups

  • minor problems when connecting to S3 - default setup has to be used - custom settings fail



Using S3 for backups seems to me as a good solution. Initial backup (almost 7GB after packing) takes a lot of time to complete. In fact - the completion required several runs. Incremental backup is pretty fast.

Now I have my files encrypted and stored on Amazon AWS and it costs $0.17*7GB = $1.19 per month.

středa 30. září 2009

Translate LANGID to human readable string from

I needed to display language settings of a Windows system. No utility was available in the wild. Here I present and offer a simple utility which displays language string acquired by GetSystemDefaultLangID() and GetUserDefaultLangID(). Source included for any use.

Well no easy way how to attach file. Just a source for now:
/*
This code is public domain. No restriction to use for any purpose.
*/
#include "stdafx.h"
#include "displaylang.h"
#include

typedef struct _langinfo {
int id;
char *desc;
char *code;
char *scriptTag;
char *ansiCP;
} LangInfo;

LangInfo table[]={
{0x0436,"Afrikaans (South Africa)","af-ZA","Latn","1252"},
{0x041c,"Albanian (Albania)","sq-AL","Latn","1252"},
{0x0484,"Windows Vista and later: Alsatian (France)","gsw-FR"," "," "},
{0x045e,"Windows Vista and later: Amharic (Ethiopia)","am-ET"," ","Unicode only"},
{0x1401,"Arabic (Algeria)","ar-DZ","Arab","1256"},
{0x3c01,"Arabic (Bahrain)","ar-BH","Arab","1256"},
{0x0c01,"Arabic (Egypt)","ar-EG","Arab","1256"},
{0x0801,"Arabic (Iraq)","ar-IQ","Arab","1256"},
{0x2c01,"Arabic (Jordan)","ar-JO","Arab","1256"},
{0x3401,"Arabic (Kuwait)","ar-KW","Arab","1256"},
{0x3001,"Arabic (Lebanon)","ar-LB","Arab","1256"},
{0x1001,"Arabic (Libya)","ar-LY","Arab","1256"},
{0x1801,"Arabic (Morocco)","ar-MA","Arab","1256"},
{0x2001,"Arabic (Oman)","ar-OM","Arab","1256"},
{0x4001,"Arabic (Qatar)","ar-QA","Arab","1256"},
{0x0401,"Arabic (Saudi Arabia)","ar-SA","Arab","1256"},
{0x2801,"Arabic (Syria)","ar-SY","Arab","1256"},
{0x1c01,"Arabic (Tunisia)","ar-TN","Arab","1256"},
{0x3801,"Arabic (U.A.E.)","ar-AE","Arab","1256"},
{0x2401,"Arabic (Yemen)","ar-YE","Arab","1256"},
{0x042b,"Windows 2000 and later: Armenian (Armenia)","hy-AM","Armn","Unicode only"},
{0x044d,"Windows Vista and later: Assamese (India)","as-IN"," ","Unicode only"},
{0x082c,"Azeri (Azerbaijan, Cyrillic)","az-Cyrl-AZ","Cyrl","1251"},
{0x042c,"Azeri (Azerbaijan, Latin)","az-Latn-AZ","Latn","1254"},
{0x046d,"Windows Vista and later: Bashkir (Russia)","ba-RU"," "," "},
{0x042d,"Basque (Basque)","eu-ES","Latn","1252"},
{0x0423,"Belarusian (Belarus)","be-BY","Cyrl","1251"},
{0x0445,"Windows XP SP2 and later: Bengali (India)","bn-IN","Beng","Unicode only"},
{0x201a,"Windows XP SP2 and later (downloadable); Windows Vista and later: Bosnian (Bosnia and Herzegovina, Cyrillic)","bs-Cyrl-BA","Cyrl","1251"},
{0x141a,"Windows XP SP2 and later: Bosnian (Bosnia and Herzegovina, Latin)","bs-Latn-BA","Latn","1250"},
{0x047e,"Breton (France)","br-FR","Latn","1252"},
{0x0402,"Bulgarian (Bulgaria)","bg-BG","Cyrl","1251"},
{0x0455,"Not supported: Burmese"," "," "," "},
{0x0403,"Catalan (Catalan)","ca-ES","Latn","1252"},
{0x0c04,"Chinese (Hong Kong SAR, PRC)","zh-HK","Hant","950"},
{0x1404,"Windows 98/Me, Windows XP and later: Chinese (Macao SAR)","zh-MO","Hant","950"},
{0x0804,"Chinese (PRC)","zh-CN","Hans","936"},
{0x1004,"Chinese (Singapore)","zh-SG","Hans","936"},
{0x0404,"Chinese (Taiwan)","zh-TW","Hant","950"},
{0x101a,"Windows XP SP2 and later: Croatian (Bosnia and Herzegovina, Latin)","hr-BA","Latn","1250"},
{0x041a,"Croatian (Croatia)","hr-HR","Latn","1250"},
{0x0405,"Czech (Czech Republic)","cs-CZ","Latn","1250"},
{0x0406,"Danish (Denmark)","da-DK","Latn","1252"},
{0x048c,"Windows XP and later: Dari (Afghanistan)","gbz-AF","Arab","1256"},
{0x0465,"Windows XP and later: Divehi (Maldives)","dv-MV","Thaa","Unicode only"},
{0x0813,"Dutch (Belgium)","nl-BE","Latn","1252"},
{0x0413,"Dutch (Netherlands)","nl-NL","Latn","1252"},
{0x0c09,"English (Australia)","en-AU","Latn","1252"},
{0x2809,"English (Belize)","en-BZ","Latn","1252"},
{0x1009,"English (Canada)","en-CA","Latn","1252"},
{0x2409,"English (Caribbean)","en-029","Latn","1252"},
{0x4009,"Windows Vista and later: English (India)","en-IN","Latn","1252"},
{0x1809,"English (Ireland)","en-IE","Latn","1252"},
{0x2009,"English (Jamaica)","en-JM","Latn","1252"},
{0x4409,"Windows Vista and later: English (Malaysia)","en-MY","Latn","1252"},
{0x1409,"English (New Zealand)","en-NZ","Latn","1252"},
{0x3409,"Windows 98/Me, Windows 2000 and later: English (Philippines)","en-PH","Latn","1252"},
{0x4809,"Windows Vista and later: English (Singapore)","en-SG","Latn","1252"},
{0x1c09,"English (South Africa)","en-ZA","Latn","1252"},
{0x2c09,"English (Trinidad and Tobago)","en-TT","Latn","1252"},
{0x0809,"English (United Kingdom)","en-GB","Latn","1252"},
{0x0409,"English (United States)","en-US","Latn","1252"},
{0x3009,"Windows 98/Me, Windows 2000 and later: English (Zimbabwe)","en-ZW","Latn","1252"},
{0x0425,"Estonian (Estonia)","et-EE","Latn","1257"},
{0x0438,"Faroese (Faroe Islands)","fo-FO","Latn","1252"},
{0x0464,"Windows XP SP2 and later (downloadable); Windows Vista and later: Filipino (Philippines)","fil-PH","Latn","1252"},
{0x040b,"Finnish (Finland)","fi-FI","Latn","1252"},
{0x080c,"French (Belgium)","fr-BE","Latn","1252"},
{0x0c0c,"French (Canada)","fr-CA","Latn","1252"},
{0x040c,"French (France)","fr-FR","Latn","1252"},
{0x140c,"French (Luxembourg)","fr-LU","Latn","1252"},
{0x180c,"French (Monaco)","fr-MC","Latn","1252"},
{0x100c,"French (Switzerland)","fr-CH","Latn","1252"},
{0x0462,"Windows XP SP2 and later (downloadable); Windows Vista and later: Frisian (Netherlands)","fy-NL","Latn","1252"},
{0x0456,"Windows XP and later: Galician (Spain)","gl-ES","Latn","1252"},
{0x0437,"Windows 2000 and later: Georgian (Georgia)","ka-GE","Geor","Unicode only"},
{0x0c07,"German (Austria)","de-AT","Latn","1252"},
{0x0407,"German (Germany)","de-DE","Latn","1252"},
{0x1407,"German (Liechtenstein)","de-LI","Latn","1252"},
{0x1007,"German (Luxembourg)","de-LU","Latn","1252"},
{0x0807,"German (Switzerland)","de-CH","Latn","1252"},
{0x0408,"Greek (Greece)","el-GR","Grek","1253"},
{0x046f,"Windows Vista and later: Greenlandic (Greenland)","kl-GL","Latn","1252"},
{0x0447,"Windows XP and later: Gujarati (India)","gu-IN","Gujr","Unicode only"},
{0x0468,"Windows Vista and later: Hausa (Nigeria, Latin)","ha-Latn-NG","Latn","1252"},
{0x040d,"Hebrew (Israel)","he-IL","Hebr","1255"},
{0x0439,"Windows 2000 and later: Hindi (India)","hi-IN","Deva","Unicode only"},
{0x040e,"Hungarian (Hungary)","hu-HU","Latn","1250"},
{0x040f,"Icelandic (Iceland)","is-IS","Latn","1252"},
{0x0470,"Igbo (Nigeria)","ig-NG"," "," "},
{0x0421,"Indonesian (Indonesia)","id-ID","Latn","1252"},
{0x085d,"Windows XP and later: Inuktitut (Canada, Latin)","iu-Latn-CA","Latn","1252"},
{0x045d,"Windows XP SP2 and later (downloadable); Windows Vista and later: Inuktitut (Canada, Syllabics)","iu-Cans-CA","Cans","Unicode only"},
{0x083c,"Windows XP SP2 and later (downloadable); Windows Vista and later: Irish (Ireland)","ga-IE","Latn","1252"},
{0x0410,"Italian (Italy)","it-IT","Latn","1252"},
{0x0810,"Italian (Switzerland)","it-CH","Latn","1252"},
{0x0411,"Japanese (Japan)","ja-JP","Hani;Hira;Kana","932"},
{0x044b,"Windows XP and later: Kannada (India)","kn-IN","Knda","Unicode only"},
{0x043f,"Windows 2000 and later: Kazakh (Kazakhstan)","kk-KZ","Cyrl","1251"},
{0x0453,"Windows Vista and later: Khmer (Cambodia)","kh-KH","Khmr","Unicode only"},
{0x0486,"Windows Vista and later: K'iche (Guatemala)","qut-GT","Latn","1252"},
{0x0487,"Windows Vista and later: Kinyarwanda (Rwanda)","rw-RW","Latn","1252"},
{0x0457,"Windows 2000 and later: Konkani (India)","kok-IN","Deva","Unicode only"},
{0x0812,"Windows 95, Windows NT 4.0 only: Korean (Johab)"," "," "," "},
{0x0412,"Korean (Korea)","ko-KR","Hang;Hani","949"},
{0x0440,"Windows XP and later: Kyrgyz (Kyrgyzstan)","ky-KG","Cyrl","1251"},
{0x0454,"Windows Vista and later: Lao (Lao PDR)","lo-LA","Laoo","Unicode only"},
{0x0426,"Latvian (Latvia)","lv-LV","Latn","1257"},
{0x0427,"Lithuanian (Lithuania)","lt-LT","Latn","1257"},
{0x082e,"Windows Vista and later: Lower Sorbian (Germany)","dsb-DE","Latn","1252"},
{0x046e,"Windows XP SP2 and later (downloadable); Windows Vista and later: Luxembourgish (Luxembourg)","lb-LU","Latn","1252"},
{0x042f,"Windows 2000 and later: Macedonian (Macedonia, FYROM)","mk-MK","Cyrl","1251"},
{0x083e,"Windows 2000 and later: Malay (Brunei Darussalam)","ms-BN","Latn","1252"},
{0x043e,"Windows 2000 and later: Malay (Malaysia)","ms-MY","Latn","1252"},
{0x044c,"Windows XP SP2 and later: Malayalam (India)","ml-IN","Mlym","Unicode only"},
{0x043a,"Windows XP SP2 and later: Maltese (Malta)","mt-MT","Latn","1252"},
{0x0481,"Windows XP SP2 and later: Maori (New Zealand)","mi-NZ","Latn","1252"},
{0x047a,"Windows XP SP2 and later (downloadable); Windows Vista and later: Mapudungun (Chile)","arn-CL","Latn","1252"},
{0x044e,"Windows 2000 and later: Marathi (India)","mr-IN","Deva","Unicode only"},
{0x047c,"Windows XP SP2 and later (downloadable); Windows Vista and later: Mohawk (Canada)","moh-CA","Latn","1252"},
{0x0450,"Windows XP and later: Mongolian (Mongolia)","mn-Cyrl-MN","Cyrl","1251"},
{0x0850,"Windows Vista and later: Mongolian (PRC)","mn-Mong-CN","Mong","Unicode only"},
{0x0461,"Windows XP SP2 and later (downloadable); Windows Vista and later: Nepali (Nepal)","ne-NP","Deva","Unicode only"},
{0x0414,"Norwegian (Bokmål, Norway)","nb-NO","Latn","1252"},
{0x0814,"Norwegian (Nynorsk, Norway)","nn-NO","Latn","1252"},
{0x0482,"Occitan (France)","oc-FR","Latn","1252"},
{0x0448,"Oriya (India)","or-IN","Orya","Unicode only"},
{0x0463,"Windows XP SP2 and later (downloadable); Windows Vista and later: Pashto (Afghanistan)","ps-AF"," "," "},
{0x0429,"Persian (Iran)","fa-IR","Arab","1256"},
{0x0415,"Polish (Poland)","pl-PL","Latn","1250"},
{0x0416,"Portuguese (Brazil)","pt-BR","Latn","1252"},
{0x0816,"Portuguese (Portugal)","pt-PT","Latn","1252"},
{0x0446,"Windows XP and later: Punjabi (India)","pa-IN","Guru","Unicode only"},
{0x046b,"Windows XP SP2 and later: Quechua (Bolivia)","quz-BO","Latn","1252"},
{0x086b,"Windows XP SP2 and later: Quechua (Ecuador)","quz-EC","Latn","1252"},
{0x0c6b,"Windows XP SP2 and later: Quechua (Peru)","quz-PE","Latn","1252"},
{0x0418,"Romanian (Romania)","ro-RO","Latn","1250"},
{0x0417,"Windows XP SP2 and later (downloadable); Windows Vista and later: Romansh (Switzerland)","rm-CH","Latn","1252"},
{0x0419,"Russian (Russia)","ru-RU","Cyrl","1251"},
{0x243b,"Windows XP SP2 and later: Sami (Inari, Finland)","smn-FI","Latn","1252"},
{0x103b,"Windows XP SP2 and later: Sami (Lule, Norway)","smj-NO","Latn","1252"},
{0x143b,"Windows XP SP2 and later: Sami (Lule, Sweden)","smj-SE","Latn","1252"},
{0x0c3b,"Windows XP SP2 and later: Sami (Northern, Finland)","se-FI","Latn","1252"},
{0x043b,"Windows XP SP2 and later: Sami (Northern, Norway)","se-NO","Latn","1252"},
{0x083b,"Windows XP SP2 and later: Sami (Northern, Sweden)","se-SE","Latn","1252"},
{0x203b,"Windows XP SP2 and later: Sami (Skolt, Finland)","sms-FI","Latn","1252"},
{0x183b,"Windows XP SP2 and later: Sami (Southern, Norway)","sma-NO","Latn","1252"},
{0x1c3b,"Windows XP SP2 and later: Sami (Southern, Sweden)","sma-SE","Latn","1252"},
{0x044f,"Windows 2000 and later: Sanskrit (India)","sa-IN","Deva","Unicode only"},
{0x1c1a,"Windows XP SP2 and later: Serbian (Bosnia and Herzegovina, Cyrillic)","sr-Cyrl-BA","Cyrl","1251"},
{0x181a,"Windows XP SP2 and later: Serbian (Bosnia and Herzegovina, Latin)","sr-Latn-BA","Latn","1250"},
{0x0c1a,"Serbian (Serbia, Cyrillic)","sr-Cyrl-CS","Cyrl","1251"},
{0x081a,"Serbian (Serbia, Latin)","sr-Latn-CS","Latn","1250"},
{0x046c,"Windows XP SP2 and later: Sesotho sa Leboa/Northern Sotho (South Africa)","ns-ZA","Latn","1252"},
{0x0432,"Windows XP SP2 and later: Setswana/Tswana (South Africa)","tn-ZA","Latn","1252"},
{0x045b,"Windows Vista and later: Sinhala (Sri Lanka)","si-LK","Sinh","Unicode only"},
{0x041b,"Slovak (Slovakia)","sk-SK","Latn","1250"},
{0x0424,"Slovenian (Slovenia)","sl-SI","Latn","1250"},
{0x2c0a,"Spanish (Argentina)","es-AR","Latn","1252"},
{0x400a,"Spanish (Bolivia)","es-BO","Latn","1252"},
{0x340a,"Spanish (Chile)","es-CL","Latn","1252"},
{0x240a,"Spanish (Colombia)","es-CO","Latn","1252"},
{0x140a,"Spanish (Costa Rica)","es-CR","Latn","1252"},
{0x1c0a,"Spanish (Dominican Republic)","es-DO","Latn","1252"},
{0x300a,"Spanish (Ecuador)","es-EC","Latn","1252"},
{0x440a,"Spanish (El Salvador)","es-SV","Latn","1252"},
{0x100a,"Spanish (Guatemala)","es-GT","Latn","1252"},
{0x480a,"Spanish (Honduras)","es-HN","Latn","1252"},
{0x080a,"Spanish (Mexico)","es-MX","Latn","1252"},
{0x4c0a,"Spanish (Nicaragua)","es-NI","Latn","1252"},
{0x180a,"Spanish (Panama)","es-PA","Latn","1252"},
{0x3c0a,"Spanish (Paraguay)","es-PY","Latn","1252"},
{0x280a,"Spanish (Peru)","es-PE","Latn","1252"},
{0x500a,"Spanish (Puerto Rico)","es-PR","Latn","1252"},
{0x0c0a,"Spanish (Spain)","es-ES","Latn","1252"},
{0x040a,"Spanish (Spain, Traditional Sort)","es-ES_tradnl","Latn","1252"},
{0x540a,"Windows Vista and later: Spanish (United States)","es-US"," "," "},
{0x380a,"Spanish (Uruguay)","es-UY","Latn","1252"},
{0x200a,"Spanish (Venezuela)","es-VE","Latn","1252"},
{0x0430,"Not supported: Sutu"," "," "," "},
{0x0441,"Windows 2000 and later: Swahili (Kenya)","sw-KE","Latn","1252"},
{0x081d,"Swedish (Finland)","sv-FI","Latn","1252"},
{0x041d,"Swedish (Sweden)","sv-SE","Latn","1252"},
{0x045a,"Windows XP and later: Syriac (Syria)","syr-SY","Syrc","Unicode only"},
{0x0428,"Windows Vista and later: Tajik (Tajikistan)","tg-Cyrl-TJ","Cyrl","1251"},
{0x085f,"Windows Vista and later: Tamazight (Algeria, Latin)","tmz-Latn-DZ","Latn","1252"},
{0x0449,"Windows 2000 and later: Tamil (India)","ta-IN","Taml","Unicode only"},
{0x0444,"Windows XP and later: Tatar (Russia)","tt-RU","Cyrl","1251"},
{0x044a,"Windows XP and later: Telugu (India)","te-IN","Telu","Unicode only"},
{0x041e,"Thai (Thailand)","th-TH","Thai","874"},
{0x0851,"Windows Vista and later: Tibetan (Bhutan)","bo-BT","Tibt","Unicode only"},
{0x0451,"Windows Vista and later: Tibetan (PRC)","bo-CN","Tibt","Unicode only"},
{0x041f,"Turkish (Turkey)","tr-TR","Latn","1254"},
{0x0442,"Windows Vista and later: Turkmen (Turkmenistan)","tk-TM","Cyrl","1251"},
{0x0480,"Windows Vista and later: Uighur (PRC)","ug-CN","Arab","1256"},
{0x0422,"Ukrainian (Ukraine)","uk-UA","Cyrl","1251"},
{0x042e,"Windows Vista and later: Upper Sorbian (Germany)","wen-DE","Latn","1252"},
{0x0820,"Urdu (India)","tr-IN"," "," "},
{0x0420,"Windows 98/Me, Windows 2000 and later: Urdu (Pakistan)","ur-PK","Arab","1256"},
{0x0843,"Windows 2000 and later: Uzbek (Uzbekistan, Cyrillic)","uz-Cyrl-UZ","Cyrl","1251"},
{0x0443,"Windows 2000 and later: Uzbek (Uzbekistan, Latin)","uz-Latn-UZ","Latn","1254"},
{0x042a,"Windows 98/Me, Windows NT 4.0 and later: Vietnamese (Vietnam)","vi-VN","Latn","1258"},
{0x0452,"Windows XP SP2 and later: Welsh (United Kingdom)","cy-GB","Latn","1252"},
{0x0488,"Windows Vista and later: Wolof (Senegal)","wo-SN","Latn","1252"},
{0x0434,"Windows XP SP2 and later: Xhosa/isiXhosa (South Africa)","xh-ZA","Latn","1252"},
{0x0485,"Windows Vista and later: Yakut (Russia)","sah-RU","Cyrl","1251"},
{0x0478,"Windows Vista and later: Yi (PRC)","ii-CN","Yiii","Unicode only"},
{0x046a,"Windows Vista and later: Yoruba (Nigeria)","yo-NG"," "," "},
{0x0435,"Windows XP SP2 and later: Zulu/isiZulu (South Africa)","zu-ZA","Latn","1252"},
{-1,NULL,NULL,NULL,NULL}};


LangInfo findLangInfo(int id){
int i=0;
for(i=0; table[i].id!=-1 && table[i].id!=id; i++);
return table[i];
}

int APIENTRY _tWinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPTSTR lpCmdLine,
int nCmdShow)
{
UNREFERENCED_PARAMETER(hPrevInstance);
UNREFERENCED_PARAMETER(lpCmdLine);

LangInfo system=findLangInfo(GetSystemDefaultLangID());
LangInfo user=findLangInfo(GetUserDefaultLangID());

MessageBoxA(NULL,system.desc,"System default language", MB_OK);
MessageBoxA(NULL,user.desc,"User default language",MB_OK);
}