ReactOS.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
April
March
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
February 2009
----- 2025 -----
April 2025
March 2025
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
29 participants
559 discussions
Start a n
N
ew thread
[tkreuzer] 39439: merge from amd64 branch: 37868: Add CONTEXT flags for x64 (Timo Kreuzer) 39346: Use intrinsics for rtl byteswap functions for GNUC, too. Only include them if NTOS_MODE_USER. (Timo Kreuzer) 39347: Move rtl byteswap functions to wdm.h and add intrinsic definitions (Timo Kreuzer)
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Fri Feb 6 07:04:18 2009 New Revision: 39439 URL:
http://svn.reactos.org/svn/reactos?rev=39439&view=rev
Log: merge from amd64 branch: 37868: Add CONTEXT flags for x64 (Timo Kreuzer) 39346: Use intrinsics for rtl byteswap functions for GNUC, too. Only include them if NTOS_MODE_USER. (Timo Kreuzer) 39347: Move rtl byteswap functions to wdm.h and add intrinsic definitions (Timo Kreuzer) Modified: trunk/reactos/include/ddk/wdm.h trunk/reactos/include/ddk/winddk.h trunk/reactos/include/ndk/rtlfuncs.h Modified: trunk/reactos/include/ddk/wdm.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ddk/wdm.h?rev=3943…
============================================================================== --- trunk/reactos/include/ddk/wdm.h [iso-8859-1] (original) +++ trunk/reactos/include/ddk/wdm.h [iso-8859-1] Fri Feb 6 07:04:18 2009 @@ -646,5 +646,48 @@ #define QUOTA_LIMITS_USE_DEFAULT_LIMITS 0x00000010 +// +// Byte Swap Functions +// +#if (defined(_M_IX86) && (_MSC_FULL_VER > 13009037)) || \ + ((defined(_M_AMD64) || \ + defined(_M_IA64)) && (_MSC_FULL_VER > 13009175)) + +unsigned short __cdecl _byteswap_ushort(unsigned short); +unsigned long __cdecl _byteswap_ulong (unsigned long); +unsigned __int64 __cdecl _byteswap_uint64(unsigned __int64); +#pragma intrinsic(_byteswap_ushort) +#pragma intrinsic(_byteswap_ulong) +#pragma intrinsic(_byteswap_uint64) +#define RtlUshortByteSwap(_x) _byteswap_ushort((USHORT)(_x)) +#define RtlUlongByteSwap(_x) _byteswap_ulong((_x)) +#define RtlUlonglongByteSwap(_x) _byteswap_uint64((_x)) + +#elif defined(__GNUC__) + +#define RtlUshortByteSwap(_x) _byteswap_ushort((USHORT)(_x)) +#define RtlUlongByteSwap(_x) _byteswap_ulong((_x)) +#define RtlUlonglongByteSwap(_x) _byteswap_uint64((_x)) + +#else + +#if (NTDDI_VERSION >= NTDDI_WIN2K) +NTSYSAPI +USHORT +FASTCALL +RtlUshortByteSwap(IN USHORT Source); + +NTSYSAPI +ULONG +FASTCALL +RtlUlongByteSwap(IN ULONG Source); + +NTSYSAPI +ULONGLONG +FASTCALL +RtlUlonglongByteSwap(IN ULONGLONG Source); +#endif + +#endif #endif // _WDMDDK_ Modified: trunk/reactos/include/ddk/winddk.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ddk/winddk.h?rev=3…
============================================================================== --- trunk/reactos/include/ddk/winddk.h [iso-8859-1] (original) +++ trunk/reactos/include/ddk/winddk.h [iso-8859-1] Fri Feb 6 07:04:18 2009 @@ -5632,6 +5632,23 @@ #elif defined(__x86_64__) +#define CONTEXT_AMD64 0x100000 +#if !defined(RC_INVOKED) +#define CONTEXT_CONTROL (CONTEXT_AMD64 | 0x1L) +#define CONTEXT_INTEGER (CONTEXT_AMD64 | 0x2L) +#define CONTEXT_SEGMENTS (CONTEXT_AMD64 | 0x4L) +#define CONTEXT_FLOATING_POINT (CONTEXT_AMD64 | 0x8L) +#define CONTEXT_DEBUG_REGISTERS (CONTEXT_AMD64 | 0x10L) + +#define CONTEXT_FULL (CONTEXT_CONTROL | CONTEXT_INTEGER | CONTEXT_FLOATING_POINT) +#define CONTEXT_ALL (CONTEXT_CONTROL | CONTEXT_INTEGER | CONTEXT_SEGMENTS | CONTEXT_FLOATING_POINT | CONTEXT_DEBUG_REGISTERS) + +#define CONTEXT_EXCEPTION_ACTIVE 0x8000000 +#define CONTEXT_SERVICE_ACTIVE 0x10000000 +#define CONTEXT_EXCEPTION_REQUEST 0x40000000 +#define CONTEXT_EXCEPTION_REPORTING 0x80000000 +#endif + typedef struct DECLSPEC_ALIGN(16) _M128A { ULONGLONG Low; LONGLONG High; @@ -7166,16 +7183,6 @@ IN PLARGE_INTEGER Time, IN PTIME_FIELDS TimeFields); -ULONG -FASTCALL -RtlUlongByteSwap( - IN ULONG Source); - -ULONGLONG -FASTCALL -RtlUlonglongByteSwap( - IN ULONGLONG Source); - #define RtlUnicodeStringToAnsiSize(STRING) ( \ NLS_MB_CODE_PAGE_TAG ? \ RtlxUnicodeStringToAnsiSize(STRING) : \ @@ -7246,11 +7253,6 @@ RtlUpperString( IN OUT PSTRING DestinationString, IN PSTRING SourceString); - -USHORT -FASTCALL -RtlUshortByteSwap( - IN USHORT Source); NTSYSAPI BOOLEAN Modified: trunk/reactos/include/ndk/rtlfuncs.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ndk/rtlfuncs.h?rev…
============================================================================== --- trunk/reactos/include/ndk/rtlfuncs.h [iso-8859-1] (original) +++ trunk/reactos/include/ndk/rtlfuncs.h [iso-8859-1] Fri Feb 6 07:04:18 2009 @@ -1370,6 +1370,8 @@ // // Byte Swap Functions // +#ifdef NTOS_MODE_USER + #if (defined(_M_IX86) && (_MSC_FULL_VER > 13009037)) || \ ((defined(_M_AMD64) || \ defined(_M_IA64)) && (_MSC_FULL_VER > 13009175)) @@ -1384,8 +1386,15 @@ #define RtlUlongByteSwap(_x) _byteswap_ulong((_x)) #define RtlUlonglongByteSwap(_x) _byteswap_uint64((_x)) +#elif defined (__GNUC__) + +#define RtlUshortByteSwap(_x) _byteswap_ushort((USHORT)(_x)) +#define RtlUlongByteSwap(_x) _byteswap_ulong((_x)) +#define RtlUlonglongByteSwap(_x) _byteswap_uint64((_x)) + #else +#if (NTDDI_VERSION >= NTDDI_WIN2K) NTSYSAPI USHORT FASTCALL @@ -1400,8 +1409,10 @@ ULONGLONG FASTCALL RtlUlonglongByteSwap(IN ULONGLONG Source); - #endif + +#endif +#endif // NTOS_MODE_USER // // Unicode->Ansi String Functions
16 years, 2 months
1
0
0
0
[janderwald] 39438: - Add more error checks
by janderwald@svn.reactos.org
Author: janderwald Date: Fri Feb 6 06:18:47 2009 New Revision: 39438 URL:
http://svn.reactos.org/svn/reactos?rev=39438&view=rev
Log: - Add more error checks Modified: trunk/reactos/dll/win32/advapi32/service/scm.c Modified: trunk/reactos/dll/win32/advapi32/service/scm.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/advapi32/service…
============================================================================== --- trunk/reactos/dll/win32/advapi32/service/scm.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/advapi32/service/scm.c [iso-8859-1] Fri Feb 6 06:18:47 2009 @@ -486,6 +486,12 @@ DWORD dwError; TRACE("CloseServiceHandle() called\n"); + + if (!hSCObject) + { + SetLastError(ERROR_INVALID_HANDLE); + return FALSE; + } RpcTryExcept { @@ -1212,6 +1218,19 @@ TRACE("EnumServicesStatusExA() called\n"); + if (InfoLevel != SC_ENUM_PROCESS_INFO) + { + SetLastError(ERROR_INVALID_LEVEL); + return FALSE; + } + + if (!hSCManager) + { + SetLastError(ERROR_INVALID_HANDLE); + return FALSE; + } + + RpcTryExcept { dwError = REnumServicesStatusExA((SC_RPC_HANDLE)hSCManager,
16 years, 2 months
1
0
0
0
[cwittich] 39437: add a missing Status to ScmRpcStatusToWinError
by cwittich@svn.reactos.org
Author: cwittich Date: Fri Feb 6 05:49:21 2009 New Revision: 39437 URL:
http://svn.reactos.org/svn/reactos?rev=39437&view=rev
Log: add a missing Status to ScmRpcStatusToWinError Modified: trunk/reactos/dll/win32/advapi32/service/scm.c Modified: trunk/reactos/dll/win32/advapi32/service/scm.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/advapi32/service…
============================================================================== --- trunk/reactos/dll/win32/advapi32/service/scm.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/advapi32/service/scm.c [iso-8859-1] Fri Feb 6 05:49:21 2009 @@ -191,6 +191,7 @@ { switch (Status) { + case RPC_S_INVALID_BINDING: case RPC_X_SS_IN_NULL_CONTEXT: return ERROR_INVALID_HANDLE;
16 years, 2 months
1
0
0
0
[cwittich] 39436: fix a nice bug in RGetServiceKeyNameA
by cwittich@svn.reactos.org
Author: cwittich Date: Fri Feb 6 05:18:49 2009 New Revision: 39436 URL:
http://svn.reactos.org/svn/reactos?rev=39436&view=rev
Log: fix a nice bug in RGetServiceKeyNameA Modified: trunk/reactos/base/system/services/rpcserver.c Modified: trunk/reactos/base/system/services/rpcserver.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/services/rpcse…
============================================================================== --- trunk/reactos/base/system/services/rpcserver.c [iso-8859-1] (original) +++ trunk/reactos/base/system/services/rpcserver.c [iso-8859-1] Fri Feb 6 05:18:49 2009 @@ -3950,8 +3950,8 @@ 0, lpService->lpServiceName, wcslen(lpService->lpServiceName), - lpServiceName + 1, - dwLength, + lpServiceName, + dwLength + 1, NULL, NULL); return ERROR_SUCCESS; @@ -4284,11 +4284,13 @@ else { lpServiceDescription->lpDescription = NULL; + goto done; } } else { dwError = ERROR_INSUFFICIENT_BUFFER; + goto done; } } else if (dwInfoLevel & SERVICE_CONFIG_FAILURE_ACTIONS)
16 years, 2 months
1
0
0
0
[dgorbachev] 39435: Fix formatting in muilanguages.h. Patch from Mario Kacmar. Bug #4138.
by dgorbachev@svn.reactos.org
Author: dgorbachev Date: Fri Feb 6 03:00:39 2009 New Revision: 39435 URL:
http://svn.reactos.org/svn/reactos?rev=39435&view=rev
Log: Fix formatting in muilanguages.h. Patch from Mario Kacmar. Bug #4138. Modified: trunk/reactos/base/setup/usetup/muilanguages.h Modified: trunk/reactos/base/setup/usetup/muilanguages.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/usetup/muilangu…
============================================================================== --- trunk/reactos/base/setup/usetup/muilanguages.h [iso-8859-1] (original) +++ trunk/reactos/base/setup/usetup/muilanguages.h [iso-8859-1] Fri Feb 6 03:00:39 2009 @@ -135,144 +135,144 @@ const MUI_LANGUAGE LanguageList[] = { - /* Lang ID, ANSI CP, OEM CP, MAC CP, Language Name, GeoID page strgs,error strings, other strings, fonts, kb layouts */ - {L"00000436", L"1252", L"850", L"10000", L"Afrikaans", L"1", enUSPages, enUSErrorEntries, enUSStrings, LatinFonts, afZALayouts }, - {L"0000041C", L"1250", L"852", L"10029", L"Albanian", L"355", enUSPages, enUSErrorEntries, enUSStrings, LatinFonts, sqALLayouts }, - {L"00000401", L"1256", L"720", L"10004", L"Arabic (Saudi Arabia)", L"966", enUSPages, enUSErrorEntries, enUSStrings, UnicodeFonts, arSALayouts }, - {L"00000801", L"1256", L"720", L"10004", L"Arabic (Iraq)", L"964", enUSPages, enUSErrorEntries, enUSStrings, UnicodeFonts, arIQLayouts }, - {L"00000C01", L"1256", L"720", L"10004", L"Arabic (Egypt)", L"20", enUSPages, enUSErrorEntries, enUSStrings, UnicodeFonts, arEGLayouts }, - {L"00001001", L"1256", L"720", L"10004", L"Arabic (Libya)", L"1", enUSPages, enUSErrorEntries, enUSStrings, UnicodeFonts, arLYLayouts }, - {L"00001401", L"1256", L"720", L"10004", L"Arabic (Algeria)", L"1", enUSPages, enUSErrorEntries, enUSStrings, UnicodeFonts, arDZLayouts }, - {L"00001801", L"1256", L"720", L"10004", L"Arabic (Morocco)", L"1", enUSPages, enUSErrorEntries, enUSStrings, UnicodeFonts, arMALayouts }, - {L"00001C01", L"1256", L"720", L"10004", L"Arabic (Tunisia)", L"1", enUSPages, enUSErrorEntries, enUSStrings, UnicodeFonts, arTNLayouts }, - {L"00002001", L"1256", L"720", L"10004", L"Arabic (Oman)", L"1", enUSPages, enUSErrorEntries, enUSStrings, UnicodeFonts, arOMLayouts }, - {L"00002401", L"1256", L"720", L"10004", L"Arabic (Yemen)", L"1", enUSPages, enUSErrorEntries, enUSStrings, UnicodeFonts, arYELayouts }, - {L"00002801", L"1256", L"720", L"10004", L"Arabic (Syria)", L"1", enUSPages, enUSErrorEntries, enUSStrings, UnicodeFonts, arSYLayouts }, - {L"00002C01", L"1256", L"720", L"10004", L"Arabic (Jordan)", L"1", enUSPages, enUSErrorEntries, enUSStrings, UnicodeFonts, arJOLayouts }, - {L"00003001", L"1256", L"720", L"10004", L"Arabic (Lebanon)", L"1", enUSPages, enUSErrorEntries, enUSStrings, UnicodeFonts, arLBLayouts }, - {L"00003401", L"1256", L"720", L"10004", L"Arabic (Kuwait)", L"1", enUSPages, enUSErrorEntries, enUSStrings, UnicodeFonts, arKWLayouts }, - {L"00003801", L"1256", L"720", L"10004", L"Arabic (U.A.E.)", L"971", enUSPages, enUSErrorEntries, enUSStrings, UnicodeFonts, arAELayouts }, - {L"00003C01", L"1256", L"720", L"10004", L"Arabic (Bahrain)", L"1", enUSPages, enUSErrorEntries, enUSStrings, UnicodeFonts, arBHLayouts }, - {L"00004001", L"1256", L"720", L"10004", L"Arabic (Qatar)", L"974", enUSPages, enUSErrorEntries, enUSStrings, UnicodeFonts, arQALayouts }, - {L"0000042B", L"0", L"1", L"2", L"Armenian", L"374", enUSPages, enUSErrorEntries, enUSStrings, UnicodeFonts, hyAMLayouts }, - {L"0000082C", L"1251", L"866", L"10007", L"Azeri (Cyrillic)", L"1", enUSPages, enUSErrorEntries, enUSStrings, CyrillicFonts, azAZLayouts }, - {L"0000042C", L"1254", L"857", L"10081", L"Azeri (Latin)", L"1", enUSPages, enUSErrorEntries, enUSStrings, LatinFonts, azAZLayouts }, - {L"0000042D", L"1252", L"850", L"10000", L"Basque", L"1", enUSPages, enUSErrorEntries, enUSStrings, LatinFonts, euESLayouts }, - {L"00000423", L"1251", L"866", L"10007", L"Belarusian", L"1", enUSPages, enUSErrorEntries, enUSStrings, CyrillicFonts, beBYLayouts }, - {L"00000402", L"1251", L"866", L"10007", L"Bulgarian", L"359", bgBGPages, bgBGErrorEntries, bgBGStrings, CyrillicFonts, bgBGLayouts }, - {L"00000455", L"0", L"1", L"2", L"Burmese", L"1", enUSPages, enUSErrorEntries, enUSStrings, UnicodeFonts, myMMLayouts }, - {L"00000403", L"1252", L"850", L"10000", L"Catalan", L"1", enUSPages, enUSErrorEntries, enUSStrings, LatinFonts, caESLayouts }, - {L"00000404", L"950", L"950", L"10008", L"Chinese (Taiwan)", L"886", enUSPages, enUSErrorEntries, enUSStrings, UnicodeFonts, zhTWLayouts }, - {L"00000804", L"936", L"936", L"10008", L"Chinese (PRC)", L"86", enUSPages, enUSErrorEntries, enUSStrings, UnicodeFonts, zhCNLayouts }, - {L"00000C04", L"950", L"950", L"10008", L"Chinese (Hong Kong S.A.R.)", L"1", enUSPages, enUSErrorEntries, enUSStrings, UnicodeFonts, zhHKLayouts }, - {L"00001004", L"936", L"936", L"10008", L"Chinese (Singapore)", L"1", enUSPages, enUSErrorEntries, enUSStrings, UnicodeFonts, zhSGLayouts }, - {L"00001404", L"950", L"950", L"10002", L"Chinese (Macau S.A.R.)", L"1", enUSPages, enUSErrorEntries, enUSStrings, UnicodeFonts, zhMOLayouts }, - {L"0000041A", L"1250", L"852", L"10029", L"Croatian", L"385", enUSPages, enUSErrorEntries, enUSStrings, LatinFonts, hrHRLayouts }, - {L"00000405", L"1250", L"852", L"10029", L"Czech", L"420", csCZPages, csCZErrorEntries, csCZStrings, LatinFonts, csCZLayouts }, - {L"00000406", L"1252", L"850", L"10000", L"Danish", L"45", enUSPages, enUSErrorEntries, enUSStrings, LatinFonts, daDKLayouts }, - {L"00000465", L"0", L"1", L"2", L"Divehi (Maldives)", L"960", enUSPages, enUSErrorEntries, enUSStrings, UnicodeFonts, dvMVLayouts }, - {L"00000413", L"1252", L"850", L"10000", L"Dutch (Netherlands)", L"31", enUSPages, enUSErrorEntries, enUSStrings, LatinFonts, nlNLLayouts }, - {L"00000813", L"1252", L"850", L"10000", L"Dutch (Belgium)", L"32", enUSPages, enUSErrorEntries, enUSStrings, LatinFonts, nlBELayouts }, - {L"00000409", L"1252", L"437", L"10000", L"English (United States)", L"1", enUSPages, enUSErrorEntries, enUSStrings, LatinFonts, enUSLayouts }, - {L"00000809", L"1252", L"850", L"10000", L"English (United Kingdom)", L"44", enUSPages, enUSErrorEntries, enUSStrings, LatinFonts, enGBLayouts }, - {L"00000C09", L"1252", L"850", L"10000", L"English (Australia)", L"61", enUSPages, enUSErrorEntries, enUSStrings, LatinFonts, enAULayouts }, - {L"00001009", L"1252", L"850", L"10000", L"English (Canada)", L"107", enUSPages, enUSErrorEntries, enUSStrings, LatinFonts, enCALayouts }, - {L"00001409", L"1252", L"850", L"10000", L"English (New Zealand)", L"64", enUSPages, enUSErrorEntries, enUSStrings, LatinFonts, enNZLayouts }, - {L"00001809", L"1252", L"850", L"10000", L"English (Ireland)", L"353", enUSPages, enUSErrorEntries, enUSStrings, LatinFonts, enIELayouts }, - {L"00001C09", L"1252", L"437", L"10000", L"English (South Africa)", L"27", enUSPages, enUSErrorEntries, enUSStrings, LatinFonts, enZALayouts }, - {L"00002009", L"1252", L"850", L"10000", L"English (Jamaica)", L"1", enUSPages, enUSErrorEntries, enUSStrings, LatinFonts, enJMLayouts }, - {L"00002409", L"1252", L"850", L"10000", L"English (Caribbean)", L"1", enUSPages, enUSErrorEntries, enUSStrings, LatinFonts, enCBLayouts }, - {L"00002809", L"1252", L"850", L"10000", L"English (Belize)", L"1", enUSPages, enUSErrorEntries, enUSStrings, LatinFonts, enBZLayouts }, - {L"00002C09", L"1252", L"850", L"10000", L"English (Trinidad)", L"1", enUSPages, enUSErrorEntries, enUSStrings, LatinFonts, enTTLayouts }, - {L"00003009", L"1252", L"437", L"10000", L"English (Zimbabwe)", L"1", enUSPages, enUSErrorEntries, enUSStrings, LatinFonts, enZWLayouts }, - {L"00003409", L"1252", L"437", L"10000", L"English (Philippines)", L"63", enUSPages, enUSErrorEntries, enUSStrings, LatinFonts, enPHLayouts }, - {L"00000425", L"1257", L"775", L"10029", L"Estonian", L"372", enUSPages, enUSErrorEntries, enUSStrings, LatinFonts, etEELayouts }, - {L"00000438", L"1252", L"850", L"10079", L"Faeroese", L"1", enUSPages, enUSErrorEntries, enUSStrings, LatinFonts, foFOLayouts }, - {L"00000429", L"1256", L"720", L"10004", L"Farsi", L"1", enUSPages, enUSErrorEntries, enUSStrings, UnicodeFonts, faIRLayouts }, - {L"0000040B", L"1252", L"850", L"10000", L"Finnish", L"358", enUSPages, enUSErrorEntries, enUSStrings, LatinFonts, fiFILayouts }, - {L"00000C0C", L"1252", L"850", L"10000", L"French (Canada)", L"107", frFRPages, frFRErrorEntries, frFRStrings, LatinFonts, frCALayouts }, - {L"0000040C", L"1252", L"850", L"10000", L"French (France)", L"33", frFRPages, frFRErrorEntries, frFRStrings, LatinFonts, frFRLayouts }, - {L"0000080C", L"1252", L"850", L"10000", L"French (Belgium)", L"32", frFRPages, frFRErrorEntries, frFRStrings, LatinFonts, frBELayouts }, - {L"0000100C", L"1252", L"850", L"10000", L"French (Switzerland)", L"41", frFRPages, frFRErrorEntries, frFRStrings, LatinFonts, frCHLayouts }, - {L"0000140C", L"1252", L"850", L"10000", L"French (Luxembourg)", L"352", frFRPages, frFRErrorEntries, frFRStrings, LatinFonts, frLULayouts }, - {L"0000180C", L"1252", L"850", L"10000", L"French (Monaco)", L"1", frFRPages, frFRErrorEntries, frFRStrings, LatinFonts, frMCLayouts }, - {L"00000456", L"1252", L"850", L"10000", L"Galician (Spain)", L"34", enUSPages, enUSErrorEntries, enUSStrings, LatinFonts, glESLayouts }, - {L"00000437", L"0", L"1", L"2", L"Georgian", L"1", enUSPages, enUSErrorEntries, enUSStrings, UnicodeFonts, kaGELayouts }, - {L"00000407", L"1252", L"850", L"10000", L"German (Germany)", L"49", deDEPages, deDEErrorEntries, deDEStrings, LatinFonts, deDELayouts }, - {L"00000807", L"1252", L"850", L"10000", L"German (Switzerland)", L"41", deDEPages, deDEErrorEntries, deDEStrings, LatinFonts, deCHLayouts }, - {L"00000C07", L"1252", L"850", L"10000", L"German (Austria)", L"43", deDEPages, deDEErrorEntries, deDEStrings, LatinFonts, deATLayouts }, - {L"00001007", L"1252", L"850", L"10000", L"German (Luxembourg)", L"352", deDEPages, deDEErrorEntries, deDEStrings, LatinFonts, deLULayouts }, - {L"00001407", L"1252", L"850", L"10000", L"German (Liechtenstein)", L"423", deDEPages, deDEErrorEntries, deDEStrings, LatinFonts, deLILayouts }, - {L"00000408", L"1253", L"737", L"10006", L"Greek", L"30", elGRPages, elGRErrorEntries, elGRStrings, GreekFonts, elGRLayouts }, - {L"00000447", L"0", L"1", L"2", L"Gujarati (India)", L"91", enUSPages, enUSErrorEntries, enUSStrings, UnicodeFonts, guINLayouts }, - {L"0000040D", L"1255", L"862", L"10005", L"Hebrew", L"1", enUSPages, enUSErrorEntries, enUSStrings, HebrewFonts, heILLayouts }, - {L"00000439", L"1252", L"437", L"10000", L"Hindi", L"1", enUSPages, enUSErrorEntries, enUSStrings, UnicodeFonts, hiINLayouts }, - {L"0000040E", L"1250", L"852", L"10029", L"Hungarian", L"36", enUSPages, enUSErrorEntries, enUSStrings, LatinFonts, huHULayouts }, - {L"0000040F", L"1252", L"850", L"10079", L"Icelandic", L"354", enUSPages, enUSErrorEntries, enUSStrings, LatinFonts, isISLayouts }, - {L"00000421", L"1252", L"850", L"10079", L"Indonesian", L"62", enUSPages, enUSErrorEntries, enUSStrings, LatinFonts, idIDLayouts }, - {L"00000410", L"1252", L"850", L"10000", L"Italian (Italy)", L"39", itITPages, itITErrorEntries, itITStrings, LatinFonts, itITLayouts }, - {L"00000810", L"1252", L"850", L"10000", L"Italian (Switzerland)", L"41", itITPages, itITErrorEntries, itITStrings, LatinFonts, itCHLayouts }, - {L"00000411", L"932", L"932", L"10001", L"Japanese", L"81", enUSPages, enUSErrorEntries, enUSStrings, UnicodeFonts, jaJPLayouts }, - {L"0000044B", L"1252", L"437", L"10079", L"Kannada (India)", L"91", enUSPages, enUSErrorEntries, enUSStrings, LatinFonts, knINLayouts }, - {L"0000043F", L"1251", L"866", L"10007", L"Kazakh", L"705", enUSPages, enUSErrorEntries, enUSStrings, CyrillicFonts, kkKZLayouts }, - {L"00000457", L"0", L"437", L"2", L"Konkani", L"1", enUSPages, enUSErrorEntries, enUSStrings, UnicodeFonts, kokINLayouts}, - {L"00000412", L"949", L"949", L"10003", L"Korean", L"1", enUSPages, enUSErrorEntries, enUSStrings, UnicodeFonts, koKRLayouts }, - {L"00000440", L"1251", L"866", L"10007", L"Kyrgyz (Kyrgyzstan)", L"1", enUSPages, enUSErrorEntries, enUSStrings, CyrillicFonts, kyKGLayouts }, - {L"00000426", L"1257", L"775", L"10029", L"Latvian", L"371", enUSPages, enUSErrorEntries, enUSStrings, LatinFonts, lvLVLayouts }, - {L"00000427", L"1257", L"775", L"10029", L"Lithuanian", L"370", ltLTPages, ltLTErrorEntries, ltLTStrings, LatinFonts, ltLTLayouts }, - {L"0000042F", L"1251", L"866", L"10007", L"FYRO Macedonian", L"1", enUSPages, enUSErrorEntries, enUSStrings, CyrillicFonts, mkMKLayouts }, - {L"0000083E", L"1252", L"850", L"10000", L"Malay (Brunei Darussalam)", L"1", enUSPages, enUSErrorEntries, enUSStrings, LatinFonts, msBNLayouts }, - {L"0000043E", L"1252", L"850", L"10000", L"Malay (Malaysia)", L"60", enUSPages, enUSErrorEntries, enUSStrings, LatinFonts, msMYLayouts }, - {L"0000044E", L"0", L"1", L"2", L"Marathi", L"1", enUSPages, enUSErrorEntries, enUSStrings, UnicodeFonts, mrINLayouts }, - {L"00000450", L"1251", L"866", L"10007", L"Mongolian (Mongolia)", L"976", enUSPages, enUSErrorEntries, enUSStrings, CyrillicFonts, mnMNLayouts }, - {L"00000414", L"1252", L"850", L"10000", L"Norwegian (Bokmal)", L"47", enUSPages, enUSErrorEntries, enUSStrings, LatinFonts, nnNOLayouts }, - {L"00000814", L"1252", L"850", L"10000", L"Norwegian (Nynorsk)", L"47", enUSPages, enUSErrorEntries, enUSStrings, LatinFonts, nnNOLayouts }, - {L"00000415", L"1250", L"852", L"10029", L"Polish", L"48", plPLPages, plPLErrorEntries, plPLStrings, LatinFonts, plPLLayouts }, - {L"00000816", L"1252", L"850", L"10000", L"Portuguese (Portugal)", L"351", enUSPages, enUSErrorEntries, enUSStrings, LatinFonts, ptPTLayouts }, - {L"00000416", L"1252", L"850", L"10000", L"Portuguese (Brazil)", L"55", enUSPages, enUSErrorEntries, enUSStrings, LatinFonts, ptBRLayouts }, - {L"00000446", L"0", L"1", L"2", L"Punjabi (India)", L"91", enUSPages, enUSErrorEntries, enUSStrings, UnicodeFonts, paINLayouts }, - {L"00000418", L"1250", L"852", L"10029", L"Romanian", L"40", enUSPages, enUSErrorEntries, enUSStrings, LatinFonts, roROLayouts }, - {L"00000419", L"1251", L"866", L"10007", L"Russian", L"7", ruRUPages, ruRUErrorEntries, ruRUStrings, CyrillicFonts, ruRULayouts }, - {L"0000044F", L"0", L"1", L"2", L"Sanskrit", L"1", enUSPages, enUSErrorEntries, enUSStrings, UnicodeFonts, saINLayouts }, - {L"00000C1A", L"1251", L"855", L"10007", L"Serbian (Cyrillic)", L"1", enUSPages, enUSErrorEntries, enUSStrings, CyrillicFonts, srSPLayouts }, - {L"0000081A", L"1250", L"852", L"10029", L"Serbian (Latin)", L"1", enUSPages, enUSErrorEntries, enUSStrings, LatinFonts, srSPLayouts }, - {L"0000041B", L"1250", L"852", L"10029", L"Slovak", L"421", skSKPages, skSKErrorEntries, skSKStrings, LatinFonts, skSKLayouts }, - {L"00000424", L"1250", L"852", L"10029", L"Slovenian", L"386", enUSPages, enUSErrorEntries, enUSStrings, LatinFonts, slSILayouts }, - {L"0000040A", L"1252", L"850", L"10000", L"Spanish (Traditional Sort)", L"1", esESPages, esESErrorEntries, esESStrings, LatinFonts, esESLayouts }, - {L"0000080A", L"1252", L"850", L"10000", L"Spanish (Mexico)", L"52", esESPages, esESErrorEntries, esESStrings, LatinFonts, esMXLayouts }, - {L"00000C0A", L"1252", L"850", L"10000", L"Spanish (International Sort)", L"1", esESPages, esESErrorEntries, esESStrings, LatinFonts, esESLayouts }, - {L"0000100A", L"1252", L"850", L"10000", L"Spanish (Guatemala)", L"1", esESPages, esESErrorEntries, esESStrings, LatinFonts, esGTLayouts }, - {L"0000140A", L"1252", L"850", L"10000", L"Spanish (Costa Rica)", L"1", esESPages, esESErrorEntries, esESStrings, LatinFonts, esCRLayouts }, - {L"0000180A", L"1252", L"850", L"10000", L"Spanish (Panama)", L"1", esESPages, esESErrorEntries, esESStrings, LatinFonts, esPALayouts }, + /* Lang ID, ANSI CP, OEM CP, MAC CP, Language Name, GeoID page strgs,error strings, other strings, fonts, kb layouts */ + {L"00000436", L"1252", L"850", L"10000", L"Afrikaans", L"1", enUSPages, enUSErrorEntries, enUSStrings, LatinFonts, afZALayouts }, + {L"0000041C", L"1250", L"852", L"10029", L"Albanian", L"355", enUSPages, enUSErrorEntries, enUSStrings, LatinFonts, sqALLayouts }, + {L"00000401", L"1256", L"720", L"10004", L"Arabic (Saudi Arabia)", L"966", enUSPages, enUSErrorEntries, enUSStrings, UnicodeFonts, arSALayouts }, + {L"00000801", L"1256", L"720", L"10004", L"Arabic (Iraq)", L"964", enUSPages, enUSErrorEntries, enUSStrings, UnicodeFonts, arIQLayouts }, + {L"00000C01", L"1256", L"720", L"10004", L"Arabic (Egypt)", L"20", enUSPages, enUSErrorEntries, enUSStrings, UnicodeFonts, arEGLayouts }, + {L"00001001", L"1256", L"720", L"10004", L"Arabic (Libya)", L"1", enUSPages, enUSErrorEntries, enUSStrings, UnicodeFonts, arLYLayouts }, + {L"00001401", L"1256", L"720", L"10004", L"Arabic (Algeria)", L"1", enUSPages, enUSErrorEntries, enUSStrings, UnicodeFonts, arDZLayouts }, + {L"00001801", L"1256", L"720", L"10004", L"Arabic (Morocco)", L"1", enUSPages, enUSErrorEntries, enUSStrings, UnicodeFonts, arMALayouts }, + {L"00001C01", L"1256", L"720", L"10004", L"Arabic (Tunisia)", L"1", enUSPages, enUSErrorEntries, enUSStrings, UnicodeFonts, arTNLayouts }, + {L"00002001", L"1256", L"720", L"10004", L"Arabic (Oman)", L"1", enUSPages, enUSErrorEntries, enUSStrings, UnicodeFonts, arOMLayouts }, + {L"00002401", L"1256", L"720", L"10004", L"Arabic (Yemen)", L"1", enUSPages, enUSErrorEntries, enUSStrings, UnicodeFonts, arYELayouts }, + {L"00002801", L"1256", L"720", L"10004", L"Arabic (Syria)", L"1", enUSPages, enUSErrorEntries, enUSStrings, UnicodeFonts, arSYLayouts }, + {L"00002C01", L"1256", L"720", L"10004", L"Arabic (Jordan)", L"1", enUSPages, enUSErrorEntries, enUSStrings, UnicodeFonts, arJOLayouts }, + {L"00003001", L"1256", L"720", L"10004", L"Arabic (Lebanon)", L"1", enUSPages, enUSErrorEntries, enUSStrings, UnicodeFonts, arLBLayouts }, + {L"00003401", L"1256", L"720", L"10004", L"Arabic (Kuwait)", L"1", enUSPages, enUSErrorEntries, enUSStrings, UnicodeFonts, arKWLayouts }, + {L"00003801", L"1256", L"720", L"10004", L"Arabic (U.A.E.)", L"971", enUSPages, enUSErrorEntries, enUSStrings, UnicodeFonts, arAELayouts }, + {L"00003C01", L"1256", L"720", L"10004", L"Arabic (Bahrain)", L"1", enUSPages, enUSErrorEntries, enUSStrings, UnicodeFonts, arBHLayouts }, + {L"00004001", L"1256", L"720", L"10004", L"Arabic (Qatar)", L"974", enUSPages, enUSErrorEntries, enUSStrings, UnicodeFonts, arQALayouts }, + {L"0000042B", L"0", L"1", L"2", L"Armenian", L"374", enUSPages, enUSErrorEntries, enUSStrings, UnicodeFonts, hyAMLayouts }, + {L"0000082C", L"1251", L"866", L"10007", L"Azeri (Cyrillic)", L"1", enUSPages, enUSErrorEntries, enUSStrings, CyrillicFonts, azAZLayouts }, + {L"0000042C", L"1254", L"857", L"10081", L"Azeri (Latin)", L"1", enUSPages, enUSErrorEntries, enUSStrings, LatinFonts, azAZLayouts }, + {L"0000042D", L"1252", L"850", L"10000", L"Basque", L"1", enUSPages, enUSErrorEntries, enUSStrings, LatinFonts, euESLayouts }, + {L"00000423", L"1251", L"866", L"10007", L"Belarusian", L"1", enUSPages, enUSErrorEntries, enUSStrings, CyrillicFonts, beBYLayouts }, + {L"00000402", L"1251", L"866", L"10007", L"Bulgarian", L"359", bgBGPages, bgBGErrorEntries, bgBGStrings, CyrillicFonts, bgBGLayouts }, + {L"00000455", L"0", L"1", L"2", L"Burmese", L"1", enUSPages, enUSErrorEntries, enUSStrings, UnicodeFonts, myMMLayouts }, + {L"00000403", L"1252", L"850", L"10000", L"Catalan", L"1", enUSPages, enUSErrorEntries, enUSStrings, LatinFonts, caESLayouts }, + {L"00000404", L"950", L"950", L"10008", L"Chinese (Taiwan)", L"886", enUSPages, enUSErrorEntries, enUSStrings, UnicodeFonts, zhTWLayouts }, + {L"00000804", L"936", L"936", L"10008", L"Chinese (PRC)", L"86", enUSPages, enUSErrorEntries, enUSStrings, UnicodeFonts, zhCNLayouts }, + {L"00000C04", L"950", L"950", L"10008", L"Chinese (Hong Kong S.A.R.)", L"1", enUSPages, enUSErrorEntries, enUSStrings, UnicodeFonts, zhHKLayouts }, + {L"00001004", L"936", L"936", L"10008", L"Chinese (Singapore)", L"1", enUSPages, enUSErrorEntries, enUSStrings, UnicodeFonts, zhSGLayouts }, + {L"00001404", L"950", L"950", L"10002", L"Chinese (Macau S.A.R.)", L"1", enUSPages, enUSErrorEntries, enUSStrings, UnicodeFonts, zhMOLayouts }, + {L"0000041A", L"1250", L"852", L"10029", L"Croatian", L"385", enUSPages, enUSErrorEntries, enUSStrings, LatinFonts, hrHRLayouts }, + {L"00000405", L"1250", L"852", L"10029", L"Czech", L"420", csCZPages, csCZErrorEntries, csCZStrings, LatinFonts, csCZLayouts }, + {L"00000406", L"1252", L"850", L"10000", L"Danish", L"45", enUSPages, enUSErrorEntries, enUSStrings, LatinFonts, daDKLayouts }, + {L"00000465", L"0", L"1", L"2", L"Divehi (Maldives)", L"960", enUSPages, enUSErrorEntries, enUSStrings, UnicodeFonts, dvMVLayouts }, + {L"00000413", L"1252", L"850", L"10000", L"Dutch (Netherlands)", L"31", enUSPages, enUSErrorEntries, enUSStrings, LatinFonts, nlNLLayouts }, + {L"00000813", L"1252", L"850", L"10000", L"Dutch (Belgium)", L"32", enUSPages, enUSErrorEntries, enUSStrings, LatinFonts, nlBELayouts }, + {L"00000409", L"1252", L"437", L"10000", L"English (United States)", L"1", enUSPages, enUSErrorEntries, enUSStrings, LatinFonts, enUSLayouts }, + {L"00000809", L"1252", L"850", L"10000", L"English (United Kingdom)", L"44", enUSPages, enUSErrorEntries, enUSStrings, LatinFonts, enGBLayouts }, + {L"00000C09", L"1252", L"850", L"10000", L"English (Australia)", L"61", enUSPages, enUSErrorEntries, enUSStrings, LatinFonts, enAULayouts }, + {L"00001009", L"1252", L"850", L"10000", L"English (Canada)", L"107", enUSPages, enUSErrorEntries, enUSStrings, LatinFonts, enCALayouts }, + {L"00001409", L"1252", L"850", L"10000", L"English (New Zealand)", L"64", enUSPages, enUSErrorEntries, enUSStrings, LatinFonts, enNZLayouts }, + {L"00001809", L"1252", L"850", L"10000", L"English (Ireland)", L"353", enUSPages, enUSErrorEntries, enUSStrings, LatinFonts, enIELayouts }, + {L"00001C09", L"1252", L"437", L"10000", L"English (South Africa)", L"27", enUSPages, enUSErrorEntries, enUSStrings, LatinFonts, enZALayouts }, + {L"00002009", L"1252", L"850", L"10000", L"English (Jamaica)", L"1", enUSPages, enUSErrorEntries, enUSStrings, LatinFonts, enJMLayouts }, + {L"00002409", L"1252", L"850", L"10000", L"English (Caribbean)", L"1", enUSPages, enUSErrorEntries, enUSStrings, LatinFonts, enCBLayouts }, + {L"00002809", L"1252", L"850", L"10000", L"English (Belize)", L"1", enUSPages, enUSErrorEntries, enUSStrings, LatinFonts, enBZLayouts }, + {L"00002C09", L"1252", L"850", L"10000", L"English (Trinidad)", L"1", enUSPages, enUSErrorEntries, enUSStrings, LatinFonts, enTTLayouts }, + {L"00003009", L"1252", L"437", L"10000", L"English (Zimbabwe)", L"1", enUSPages, enUSErrorEntries, enUSStrings, LatinFonts, enZWLayouts }, + {L"00003409", L"1252", L"437", L"10000", L"English (Philippines)", L"63", enUSPages, enUSErrorEntries, enUSStrings, LatinFonts, enPHLayouts }, + {L"00000425", L"1257", L"775", L"10029", L"Estonian", L"372", enUSPages, enUSErrorEntries, enUSStrings, LatinFonts, etEELayouts }, + {L"00000438", L"1252", L"850", L"10079", L"Faeroese", L"1", enUSPages, enUSErrorEntries, enUSStrings, LatinFonts, foFOLayouts }, + {L"00000429", L"1256", L"720", L"10004", L"Farsi", L"1", enUSPages, enUSErrorEntries, enUSStrings, UnicodeFonts, faIRLayouts }, + {L"0000040B", L"1252", L"850", L"10000", L"Finnish", L"358", enUSPages, enUSErrorEntries, enUSStrings, LatinFonts, fiFILayouts }, + {L"00000C0C", L"1252", L"850", L"10000", L"French (Canada)", L"107", frFRPages, frFRErrorEntries, frFRStrings, LatinFonts, frCALayouts }, + {L"0000040C", L"1252", L"850", L"10000", L"French (France)", L"33", frFRPages, frFRErrorEntries, frFRStrings, LatinFonts, frFRLayouts }, + {L"0000080C", L"1252", L"850", L"10000", L"French (Belgium)", L"32", frFRPages, frFRErrorEntries, frFRStrings, LatinFonts, frBELayouts }, + {L"0000100C", L"1252", L"850", L"10000", L"French (Switzerland)", L"41", frFRPages, frFRErrorEntries, frFRStrings, LatinFonts, frCHLayouts }, + {L"0000140C", L"1252", L"850", L"10000", L"French (Luxembourg)", L"352", frFRPages, frFRErrorEntries, frFRStrings, LatinFonts, frLULayouts }, + {L"0000180C", L"1252", L"850", L"10000", L"French (Monaco)", L"1", frFRPages, frFRErrorEntries, frFRStrings, LatinFonts, frMCLayouts }, + {L"00000456", L"1252", L"850", L"10000", L"Galician (Spain)", L"34", enUSPages, enUSErrorEntries, enUSStrings, LatinFonts, glESLayouts }, + {L"00000437", L"0", L"1", L"2", L"Georgian", L"1", enUSPages, enUSErrorEntries, enUSStrings, UnicodeFonts, kaGELayouts }, + {L"00000407", L"1252", L"850", L"10000", L"German (Germany)", L"49", deDEPages, deDEErrorEntries, deDEStrings, LatinFonts, deDELayouts }, + {L"00000807", L"1252", L"850", L"10000", L"German (Switzerland)", L"41", deDEPages, deDEErrorEntries, deDEStrings, LatinFonts, deCHLayouts }, + {L"00000C07", L"1252", L"850", L"10000", L"German (Austria)", L"43", deDEPages, deDEErrorEntries, deDEStrings, LatinFonts, deATLayouts }, + {L"00001007", L"1252", L"850", L"10000", L"German (Luxembourg)", L"352", deDEPages, deDEErrorEntries, deDEStrings, LatinFonts, deLULayouts }, + {L"00001407", L"1252", L"850", L"10000", L"German (Liechtenstein)", L"423", deDEPages, deDEErrorEntries, deDEStrings, LatinFonts, deLILayouts }, + {L"00000408", L"1253", L"737", L"10006", L"Greek", L"30", elGRPages, elGRErrorEntries, elGRStrings, GreekFonts, elGRLayouts }, + {L"00000447", L"0", L"1", L"2", L"Gujarati (India)", L"91", enUSPages, enUSErrorEntries, enUSStrings, UnicodeFonts, guINLayouts }, + {L"0000040D", L"1255", L"862", L"10005", L"Hebrew", L"1", enUSPages, enUSErrorEntries, enUSStrings, HebrewFonts, heILLayouts }, + {L"00000439", L"1252", L"437", L"10000", L"Hindi", L"1", enUSPages, enUSErrorEntries, enUSStrings, UnicodeFonts, hiINLayouts }, + {L"0000040E", L"1250", L"852", L"10029", L"Hungarian", L"36", enUSPages, enUSErrorEntries, enUSStrings, LatinFonts, huHULayouts }, + {L"0000040F", L"1252", L"850", L"10079", L"Icelandic", L"354", enUSPages, enUSErrorEntries, enUSStrings, LatinFonts, isISLayouts }, + {L"00000421", L"1252", L"850", L"10079", L"Indonesian", L"62", enUSPages, enUSErrorEntries, enUSStrings, LatinFonts, idIDLayouts }, + {L"00000410", L"1252", L"850", L"10000", L"Italian (Italy)", L"39", itITPages, itITErrorEntries, itITStrings, LatinFonts, itITLayouts }, + {L"00000810", L"1252", L"850", L"10000", L"Italian (Switzerland)", L"41", itITPages, itITErrorEntries, itITStrings, LatinFonts, itCHLayouts }, + {L"00000411", L"932", L"932", L"10001", L"Japanese", L"81", enUSPages, enUSErrorEntries, enUSStrings, UnicodeFonts, jaJPLayouts }, + {L"0000044B", L"1252", L"437", L"10079", L"Kannada (India)", L"91", enUSPages, enUSErrorEntries, enUSStrings, LatinFonts, knINLayouts }, + {L"0000043F", L"1251", L"866", L"10007", L"Kazakh", L"705", enUSPages, enUSErrorEntries, enUSStrings, CyrillicFonts, kkKZLayouts }, + {L"00000457", L"0", L"437", L"2", L"Konkani", L"1", enUSPages, enUSErrorEntries, enUSStrings, UnicodeFonts, kokINLayouts}, + {L"00000412", L"949", L"949", L"10003", L"Korean", L"1", enUSPages, enUSErrorEntries, enUSStrings, UnicodeFonts, koKRLayouts }, + {L"00000440", L"1251", L"866", L"10007", L"Kyrgyz (Kyrgyzstan)", L"1", enUSPages, enUSErrorEntries, enUSStrings, CyrillicFonts, kyKGLayouts }, + {L"00000426", L"1257", L"775", L"10029", L"Latvian", L"371", enUSPages, enUSErrorEntries, enUSStrings, LatinFonts, lvLVLayouts }, + {L"00000427", L"1257", L"775", L"10029", L"Lithuanian", L"370", ltLTPages, ltLTErrorEntries, ltLTStrings, LatinFonts, ltLTLayouts }, + {L"0000042F", L"1251", L"866", L"10007", L"FYRO Macedonian", L"1", enUSPages, enUSErrorEntries, enUSStrings, CyrillicFonts, mkMKLayouts }, + {L"0000083E", L"1252", L"850", L"10000", L"Malay (Brunei Darussalam)", L"1", enUSPages, enUSErrorEntries, enUSStrings, LatinFonts, msBNLayouts }, + {L"0000043E", L"1252", L"850", L"10000", L"Malay (Malaysia)", L"60", enUSPages, enUSErrorEntries, enUSStrings, LatinFonts, msMYLayouts }, + {L"0000044E", L"0", L"1", L"2", L"Marathi", L"1", enUSPages, enUSErrorEntries, enUSStrings, UnicodeFonts, mrINLayouts }, + {L"00000450", L"1251", L"866", L"10007", L"Mongolian (Mongolia)", L"976", enUSPages, enUSErrorEntries, enUSStrings, CyrillicFonts, mnMNLayouts }, + {L"00000414", L"1252", L"850", L"10000", L"Norwegian (Bokmal)", L"47", enUSPages, enUSErrorEntries, enUSStrings, LatinFonts, nnNOLayouts }, + {L"00000814", L"1252", L"850", L"10000", L"Norwegian (Nynorsk)", L"47", enUSPages, enUSErrorEntries, enUSStrings, LatinFonts, nnNOLayouts }, + {L"00000415", L"1250", L"852", L"10029", L"Polish", L"48", plPLPages, plPLErrorEntries, plPLStrings, LatinFonts, plPLLayouts }, + {L"00000816", L"1252", L"850", L"10000", L"Portuguese (Portugal)", L"351", enUSPages, enUSErrorEntries, enUSStrings, LatinFonts, ptPTLayouts }, + {L"00000416", L"1252", L"850", L"10000", L"Portuguese (Brazil)", L"55", enUSPages, enUSErrorEntries, enUSStrings, LatinFonts, ptBRLayouts }, + {L"00000446", L"0", L"1", L"2", L"Punjabi (India)", L"91", enUSPages, enUSErrorEntries, enUSStrings, UnicodeFonts, paINLayouts }, + {L"00000418", L"1250", L"852", L"10029", L"Romanian", L"40", enUSPages, enUSErrorEntries, enUSStrings, LatinFonts, roROLayouts }, + {L"00000419", L"1251", L"866", L"10007", L"Russian", L"7", ruRUPages, ruRUErrorEntries, ruRUStrings, CyrillicFonts, ruRULayouts }, + {L"0000044F", L"0", L"1", L"2", L"Sanskrit", L"1", enUSPages, enUSErrorEntries, enUSStrings, UnicodeFonts, saINLayouts }, + {L"00000C1A", L"1251", L"855", L"10007", L"Serbian (Cyrillic)", L"1", enUSPages, enUSErrorEntries, enUSStrings, CyrillicFonts, srSPLayouts }, + {L"0000081A", L"1250", L"852", L"10029", L"Serbian (Latin)", L"1", enUSPages, enUSErrorEntries, enUSStrings, LatinFonts, srSPLayouts }, + {L"0000041B", L"1250", L"852", L"10029", L"Slovak", L"421", skSKPages, skSKErrorEntries, skSKStrings, LatinFonts, skSKLayouts }, + {L"00000424", L"1250", L"852", L"10029", L"Slovenian", L"386", enUSPages, enUSErrorEntries, enUSStrings, LatinFonts, slSILayouts }, + {L"0000040A", L"1252", L"850", L"10000", L"Spanish (Traditional Sort)", L"1", esESPages, esESErrorEntries, esESStrings, LatinFonts, esESLayouts }, + {L"0000080A", L"1252", L"850", L"10000", L"Spanish (Mexico)", L"52", esESPages, esESErrorEntries, esESStrings, LatinFonts, esMXLayouts }, + {L"00000C0A", L"1252", L"850", L"10000", L"Spanish (International Sort)", L"1", esESPages, esESErrorEntries, esESStrings, LatinFonts, esESLayouts }, + {L"0000100A", L"1252", L"850", L"10000", L"Spanish (Guatemala)", L"1", esESPages, esESErrorEntries, esESStrings, LatinFonts, esGTLayouts }, + {L"0000140A", L"1252", L"850", L"10000", L"Spanish (Costa Rica)", L"1", esESPages, esESErrorEntries, esESStrings, LatinFonts, esCRLayouts }, + {L"0000180A", L"1252", L"850", L"10000", L"Spanish (Panama)", L"1", esESPages, esESErrorEntries, esESStrings, LatinFonts, esPALayouts }, {L"00001C0A", L"1252", L"850", L"10000", L"Spanish (Dominican Republic)", L"110", esESPages, esESErrorEntries, esESStrings, LatinFonts, esDOLayouts }, - {L"0000200A", L"1252", L"850", L"10000", L"Spanish (Venezuela)", L"58", esESPages, esESErrorEntries, esESStrings, LatinFonts, esVELayouts }, - {L"0000240A", L"1252", L"850", L"10000", L"Spanish (Colombia)", L"57", esESPages, esESErrorEntries, esESStrings, LatinFonts, esCOLayouts }, - {L"0000280A", L"1252", L"850", L"10000", L"Spanish (Peru)", L"1", esESPages, esESErrorEntries, esESStrings, LatinFonts, esPELayouts }, - {L"00002C0A", L"1252", L"850", L"10000", L"Spanish (Argentina)", L"54", esESPages, esESErrorEntries, esESStrings, LatinFonts, esARLayouts }, - {L"0000300A", L"1252", L"850", L"10000", L"Spanish (Ecuador)", L"1", esESPages, esESErrorEntries, esESStrings, LatinFonts, esECLayouts }, - {L"0000340A", L"1252", L"850", L"10000", L"Spanish (Chile)", L"56", esESPages, esESErrorEntries, esESStrings, LatinFonts, esCLLayouts }, - {L"0000380A", L"1252", L"850", L"10000", L"Spanish (Uruguay)", L"1", esESPages, esESErrorEntries, esESStrings, LatinFonts, esUYLayouts }, - {L"00003C0A", L"1252", L"850", L"10000", L"Spanish (Paraguay)", L"1", esESPages, esESErrorEntries, esESStrings, LatinFonts, esPYLayouts }, - {L"0000400A", L"1252", L"850", L"10000", L"Spanish (Bolivia)", L"1", esESPages, esESErrorEntries, esESStrings, LatinFonts, esBOLayouts }, - {L"0000440A", L"1252", L"850", L"10000", L"Spanish (El Salvador)", L"1", esESPages, esESErrorEntries, esESStrings, LatinFonts, esSVLayouts }, - {L"0000480A", L"1252", L"850", L"10000", L"Spanish (Honduras)", L"1", esESPages, esESErrorEntries, esESStrings, LatinFonts, esHNLayouts }, - {L"00004C0A", L"1252", L"850", L"10000", L"Spanish (Nicaragua)", L"1", esESPages, esESErrorEntries, esESStrings, LatinFonts, esNILayouts }, - {L"0000500A", L"1252", L"850", L"10000", L"Spanish (Puerto Rico)", L"1", esESPages, esESErrorEntries, esESStrings, LatinFonts, esPRLayouts }, - {L"00000441", L"1252", L"437", L"10000", L"Swahili", L"1", enUSPages, enUSErrorEntries, enUSStrings, LatinFonts, swKELayouts }, - {L"0000041D", L"1252", L"850", L"10000", L"Swedish", L"46", svSEPages, svSEErrorEntries, svSEStrings, LatinFonts, svSELayouts }, - {L"0000081D", L"1252", L"850", L"10000", L"Swedish (Finland)", L"358", svSEPages, svSEErrorEntries, svSEStrings, LatinFonts, svFILayouts }, - {L"0000045A", L"0", L"1", L"2", L"Syriac (Syria)", L"1", enUSPages, enUSErrorEntries, enUSStrings, UnicodeFonts, syrSYLayouts}, - {L"00000449", L"0", L"1", L"2", L"Tamil", L"1", enUSPages, enUSErrorEntries, enUSStrings, UnicodeFonts, taINLayouts }, - {L"00000444", L"1251", L"866", L"10007", L"Tatar", L"1", enUSPages, enUSErrorEntries, enUSStrings, CyrillicFonts, ttTALayouts }, - {L"0000044A", L"0", L"1", L"2", L"Telugu (India)", L"91", enUSPages, enUSErrorEntries, enUSStrings, UnicodeFonts, teINLayouts }, - {L"0000041E", L"874", L"874", L"10021", L"Thai", L"1", enUSPages, enUSErrorEntries, enUSStrings, UnicodeFonts, thTHLayouts }, - {L"0000041F", L"1254", L"857", L"10081", L"Turkish", L"90", enUSPages, enUSErrorEntries, enUSStrings, LatinFonts, trTRLayouts }, - {L"00000422", L"1251", L"866", L"10017", L"Ukrainian", L"380", ukUAPages, ukUAErrorEntries, ukUAStrings, CyrillicFonts, ukUALayouts }, - {L"00000420", L"1256", L"720", L"10004", L"Urdu", L"1", enUSPages, enUSErrorEntries, enUSStrings, UnicodeFonts, urPKLayouts }, - {L"00000443", L"1254", L"857", L"10029", L"Uzbek (Latin)", L"998", enUSPages, enUSErrorEntries, enUSStrings, CyrillicFonts, uzUZLayouts }, - {L"00000843", L"1251", L"866", L"10007", L"Uzbek (Cyrillic)", L"998", enUSPages, enUSErrorEntries, enUSStrings, CyrillicFonts, uzUZLayouts }, - {L"0000042A", L"1258", L"1258",L"10000", L"Vietnamese", L"1", enUSPages, enUSErrorEntries, enUSStrings, UnicodeFonts, viVNLayouts }, - {L"00000435", L"1252", L"850", L"10000", L"Zulu", L"1", enUSPages, enUSErrorEntries, enUSStrings, LatinFonts, enUSLayouts }, + {L"0000200A", L"1252", L"850", L"10000", L"Spanish (Venezuela)", L"58", esESPages, esESErrorEntries, esESStrings, LatinFonts, esVELayouts }, + {L"0000240A", L"1252", L"850", L"10000", L"Spanish (Colombia)", L"57", esESPages, esESErrorEntries, esESStrings, LatinFonts, esCOLayouts }, + {L"0000280A", L"1252", L"850", L"10000", L"Spanish (Peru)", L"1", esESPages, esESErrorEntries, esESStrings, LatinFonts, esPELayouts }, + {L"00002C0A", L"1252", L"850", L"10000", L"Spanish (Argentina)", L"54", esESPages, esESErrorEntries, esESStrings, LatinFonts, esARLayouts }, + {L"0000300A", L"1252", L"850", L"10000", L"Spanish (Ecuador)", L"1", esESPages, esESErrorEntries, esESStrings, LatinFonts, esECLayouts }, + {L"0000340A", L"1252", L"850", L"10000", L"Spanish (Chile)", L"56", esESPages, esESErrorEntries, esESStrings, LatinFonts, esCLLayouts }, + {L"0000380A", L"1252", L"850", L"10000", L"Spanish (Uruguay)", L"1", esESPages, esESErrorEntries, esESStrings, LatinFonts, esUYLayouts }, + {L"00003C0A", L"1252", L"850", L"10000", L"Spanish (Paraguay)", L"1", esESPages, esESErrorEntries, esESStrings, LatinFonts, esPYLayouts }, + {L"0000400A", L"1252", L"850", L"10000", L"Spanish (Bolivia)", L"1", esESPages, esESErrorEntries, esESStrings, LatinFonts, esBOLayouts }, + {L"0000440A", L"1252", L"850", L"10000", L"Spanish (El Salvador)", L"1", esESPages, esESErrorEntries, esESStrings, LatinFonts, esSVLayouts }, + {L"0000480A", L"1252", L"850", L"10000", L"Spanish (Honduras)", L"1", esESPages, esESErrorEntries, esESStrings, LatinFonts, esHNLayouts }, + {L"00004C0A", L"1252", L"850", L"10000", L"Spanish (Nicaragua)", L"1", esESPages, esESErrorEntries, esESStrings, LatinFonts, esNILayouts }, + {L"0000500A", L"1252", L"850", L"10000", L"Spanish (Puerto Rico)", L"1", esESPages, esESErrorEntries, esESStrings, LatinFonts, esPRLayouts }, + {L"00000441", L"1252", L"437", L"10000", L"Swahili", L"1", enUSPages, enUSErrorEntries, enUSStrings, LatinFonts, swKELayouts }, + {L"0000041D", L"1252", L"850", L"10000", L"Swedish", L"46", svSEPages, svSEErrorEntries, svSEStrings, LatinFonts, svSELayouts }, + {L"0000081D", L"1252", L"850", L"10000", L"Swedish (Finland)", L"358", svSEPages, svSEErrorEntries, svSEStrings, LatinFonts, svFILayouts }, + {L"0000045A", L"0", L"1", L"2", L"Syriac (Syria)", L"1", enUSPages, enUSErrorEntries, enUSStrings, UnicodeFonts, syrSYLayouts}, + {L"00000449", L"0", L"1", L"2", L"Tamil", L"1", enUSPages, enUSErrorEntries, enUSStrings, UnicodeFonts, taINLayouts }, + {L"00000444", L"1251", L"866", L"10007", L"Tatar", L"1", enUSPages, enUSErrorEntries, enUSStrings, CyrillicFonts, ttTALayouts }, + {L"0000044A", L"0", L"1", L"2", L"Telugu (India)", L"91", enUSPages, enUSErrorEntries, enUSStrings, UnicodeFonts, teINLayouts }, + {L"0000041E", L"874", L"874", L"10021", L"Thai", L"1", enUSPages, enUSErrorEntries, enUSStrings, UnicodeFonts, thTHLayouts }, + {L"0000041F", L"1254", L"857", L"10081", L"Turkish", L"90", enUSPages, enUSErrorEntries, enUSStrings, LatinFonts, trTRLayouts }, + {L"00000422", L"1251", L"866", L"10017", L"Ukrainian", L"380", ukUAPages, ukUAErrorEntries, ukUAStrings, CyrillicFonts, ukUALayouts }, + {L"00000420", L"1256", L"720", L"10004", L"Urdu", L"1", enUSPages, enUSErrorEntries, enUSStrings, UnicodeFonts, urPKLayouts }, + {L"00000443", L"1254", L"857", L"10029", L"Uzbek (Latin)", L"998", enUSPages, enUSErrorEntries, enUSStrings, CyrillicFonts, uzUZLayouts }, + {L"00000843", L"1251", L"866", L"10007", L"Uzbek (Cyrillic)", L"998", enUSPages, enUSErrorEntries, enUSStrings, CyrillicFonts, uzUZLayouts }, + {L"0000042A", L"1258", L"1258",L"10000", L"Vietnamese", L"1", enUSPages, enUSErrorEntries, enUSStrings, UnicodeFonts, viVNLayouts }, + {L"00000435", L"1252", L"850", L"10000", L"Zulu", L"1", enUSPages, enUSErrorEntries, enUSStrings, LatinFonts, enUSLayouts }, {NULL, NULL, NULL, NULL, NULL, NULL} };
16 years, 2 months
1
0
0
0
[cwittich] 39434: add some more error checking
by cwittich@svn.reactos.org
Author: cwittich Date: Fri Feb 6 02:51:51 2009 New Revision: 39434 URL:
http://svn.reactos.org/svn/reactos?rev=39434&view=rev
Log: add some more error checking Modified: trunk/reactos/dll/win32/advapi32/service/scm.c Modified: trunk/reactos/dll/win32/advapi32/service/scm.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/advapi32/service…
============================================================================== --- trunk/reactos/dll/win32/advapi32/service/scm.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/advapi32/service/scm.c [iso-8859-1] Fri Feb 6 02:51:51 2009 @@ -769,6 +769,12 @@ TRACE("CreateServiceW() called\n"); TRACE("%p %S %S\n", hSCManager, lpServiceName, lpDisplayName); + + if (!hSCManager) + { + SetLastError(ERROR_INVALID_HANDLE); + return NULL; + } /* Calculate the Dependencies length*/ if (lpDependencies != NULL) @@ -1132,6 +1138,12 @@ TRACE("EnumServicesStatusW() called\n"); + if (!hSCManager) + { + SetLastError(ERROR_INVALID_HANDLE); + return FALSE; + } + RpcTryExcept { dwError = REnumServicesStatusW((SC_RPC_HANDLE)hSCManager, @@ -1398,6 +1410,12 @@ TRACE("GetServiceDisplayNameW() called\n"); + if (!hSCManager) + { + SetLastError(ERROR_INVALID_HANDLE); + return FALSE; + } + if (!lpDisplayName) *lpcchBuffer = 0; @@ -1497,7 +1515,22 @@ TRACE("GetServiceKeyNameW() called\n"); + if (!hSCManager) + { + SetLastError(ERROR_INVALID_HANDLE); + return FALSE; + } + if (!lpDisplayName) + { + SetLastError(ERROR_INVALID_ADDRESS); + + if (!lpServiceName) + *lpcchBuffer = 1; + return FALSE; + } + + if (!lpServiceName) *lpcchBuffer = 0; RpcTryExcept @@ -1757,6 +1790,12 @@ TRACE("OpenServiceW(%p, %S, %lx)\n", hSCManager, lpServiceName, dwDesiredAccess); + if (!hSCManager) + { + SetLastError(ERROR_INVALID_HANDLE); + return NULL; + } + RpcTryExcept { /* Call to services.exe using RPC */
16 years, 2 months
1
0
0
0
[cwittich] 39433: fix some QueryServiceConfig2A winetests
by cwittich@svn.reactos.org
Author: cwittich Date: Fri Feb 6 02:51:20 2009 New Revision: 39433 URL:
http://svn.reactos.org/svn/reactos?rev=39433&view=rev
Log: fix some QueryServiceConfig2A winetests Modified: trunk/reactos/base/system/services/rpcserver.c Modified: trunk/reactos/base/system/services/rpcserver.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/services/rpcse…
============================================================================== --- trunk/reactos/base/system/services/rpcserver.c [iso-8859-1] (original) +++ trunk/reactos/base/system/services/rpcserver.c [iso-8859-1] Fri Feb 6 02:51:20 2009 @@ -4209,7 +4209,6 @@ PSERVICE_HANDLE hSvc; PSERVICE lpService = NULL; HKEY hServiceKey = NULL; - DWORD dwRequiredSize; LPWSTR lpDescriptionW = NULL; LPSTR lpDescription = NULL; @@ -4255,39 +4254,42 @@ LPSERVICE_DESCRIPTIONA lpServiceDescription = (LPSERVICE_DESCRIPTIONA)lpBuffer; LPSTR lpStr; + *pcbBytesNeeded = sizeof(SERVICE_DESCRIPTIONA); + dwError = ScmReadString(hServiceKey, L"Description", &lpDescriptionW); - if (dwError != ERROR_SUCCESS) - { - if (cbBufSize < sizeof(SERVICE_DESCRIPTIONA)) + if (dwError == ERROR_SUCCESS) + { + *pcbBytesNeeded += ((wcslen(lpDescriptionW) + 1)); + } + + if (cbBufSize >= *pcbBytesNeeded) + { + + if (dwError == ERROR_SUCCESS) { - *pcbBytesNeeded = sizeof(SERVICE_DESCRIPTIONA); - dwError = ERROR_INSUFFICIENT_BUFFER; + lpStr = (LPSTR)(lpServiceDescription + 1); + + WideCharToMultiByte(CP_ACP, + 0, + lpDescriptionW, + -1, + lpStr, + wcslen(lpDescriptionW), + NULL, + NULL); + lpServiceDescription->lpDescription = (LPSTR)((ULONG_PTR)lpStr - (ULONG_PTR)lpServiceDescription); } - goto done; - } - - dwRequiredSize = sizeof(SERVICE_DESCRIPTIONA) + ((wcslen(lpDescriptionW) + 1)); - - if (cbBufSize < dwRequiredSize) - { - *pcbBytesNeeded = dwRequiredSize; + else + { + lpServiceDescription->lpDescription = NULL; + } + } + else + { dwError = ERROR_INSUFFICIENT_BUFFER; - goto done; - } - - lpStr = (LPSTR)(lpServiceDescription + 1); - - WideCharToMultiByte(CP_ACP, - 0, - lpDescriptionW, - -1, - lpStr, - wcslen(lpDescriptionW), - NULL, - NULL); - lpServiceDescription->lpDescription = (LPSTR)((ULONG_PTR)lpStr - (ULONG_PTR)lpServiceDescription); + } } else if (dwInfoLevel & SERVICE_CONFIG_FAILURE_ACTIONS) {
16 years, 2 months
1
0
0
0
[sedwards] 39432: - Some formating changes - Remove unneeded spec, just use the comments - Syslog interface for my wine usage, disabled in ReactOS tree but included here to reduce my diff.
by sedwards@svn.reactos.org
Author: sedwards Date: Fri Feb 6 02:22:18 2009 New Revision: 39432 URL:
http://svn.reactos.org/svn/reactos?rev=39432&view=rev
Log: - Some formating changes - Remove unneeded spec, just use the comments - Syslog interface for my wine usage, disabled in ReactOS tree but included here to reduce my diff. Added: trunk/rosapps/applications/sysutils/telnetd/syslog.c (with props) trunk/rosapps/applications/sysutils/telnetd/syslog.h (with props) Removed: trunk/rosapps/applications/sysutils/telnetd/spec.txt Modified: trunk/rosapps/applications/sysutils/telnetd/telnetd.c Removed: trunk/rosapps/applications/sysutils/telnetd/spec.txt URL:
http://svn.reactos.org/svn/reactos/trunk/rosapps/applications/sysutils/teln…
============================================================================== --- trunk/rosapps/applications/sysutils/telnetd/spec.txt [iso-8859-1] (original) +++ trunk/rosapps/applications/sysutils/telnetd/spec.txt (removed) @@ -1,8 +1,0 @@ -Here is the short product spec - -1. Fix the service stuff -2. Use the event log -3. Do real authentication (LogonUser[Ex]+CreateProcessAsUser maybe?) -4. Properly Set the environment - - Added: trunk/rosapps/applications/sysutils/telnetd/syslog.c URL:
http://svn.reactos.org/svn/reactos/trunk/rosapps/applications/sysutils/teln…
============================================================================== --- trunk/rosapps/applications/sysutils/telnetd/syslog.c (added) +++ trunk/rosapps/applications/sysutils/telnetd/syslog.c [iso-8859-1] Fri Feb 6 02:22:18 2009 @@ -1,0 +1,308 @@ +/* + * syslog-client.c - syslog client implementation for windows + * + * Created by Alexander Yaworsky + * + * THIS SOFTWARE IS NOT COPYRIGHTED + * + * This source code is offered for use in the public domain. You may + * use, modify or distribute it freely. + * + * This code is distributed in the hope that it will be useful but + * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY + * DISCLAIMED. This includes but is not limited to warranties of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + */ + +/* define SYSLOG_CONF_DIR where syslog.host should be + */ + +#ifndef SYSLOG_CONF_DIR +static const char *syslog_conf_dir = "."; +#else +static const char *syslog_conf_dir = SYSLOG_CONF_DIR; +#endif + +#include <stdio.h> +#include <string.h> +#include <winsock2.h> +#include <ws2tcpip.h> +#include "syslog.h" + +#ifdef TEST +# define SYSLOG_DGRAM_SIZE 80 +#else +# define SYSLOG_DGRAM_SIZE 1024 +#endif + +static BOOL initialized = FALSE; +static int log_mask = 0xFF; +static char *syslog_ident; +static int syslog_facility; +static char str_pid[ 40 ]; +static SOCKADDR_IN sa_logger; +static SOCKET sock; +static char local_hostname[ MAX_COMPUTERNAME_LENGTH + 1 ]; +static char datagramm[ SYSLOG_DGRAM_SIZE ]; +static int datagramm_size; + +/****************************************************************************** + * set_syslog_conf_dir + * + * maybe this function will be useful... + */ +const char* set_syslog_conf_dir( const char* dir ) +{ + const char *ret = syslog_conf_dir; + syslog_conf_dir = dir; + return ret; +} + +/****************************************************************************** + * init_logger_addr + * + * Read configuration file syslog.host. This file should contain host address + * and, optionally, port. Initialize sa_logger. If the configuration file does + * not exist, use localhost:514. + * Returns: 0 - ok, -1 - error. + */ +static void init_logger_addr() +{ + char pathname[ FILENAME_MAX ]; + char *p; + FILE *fd; + char host[256]; + struct hostent * phe; + + memset( &sa_logger, 0, sizeof(SOCKADDR_IN) ); + sa_logger.sin_family = AF_INET; + + if( '\\' == syslog_conf_dir[0] || '/' == syslog_conf_dir[0] || ':' == syslog_conf_dir[1] ) + { + /* absolute path */ + strcpy( pathname, syslog_conf_dir ); + } + else + { + /* relative path */ + char *q; + + strcpy( pathname, __argv[0] ); + p = strrchr( pathname, '\\' ) + 1; + q = strrchr( pathname, '/' ) + 1; + if( p < q ) + *q = 0; + else if( p > q ) + *p = 0; + else + pathname[0] = 0; + strcat( pathname, syslog_conf_dir ); + } + p = &pathname[ strlen( pathname ) - 1 ]; + if( '\\' != *p && '/' != *p ) + { + p++; *p = '/'; + } + strcpy( ++p, "syslog.host" ); + + /* read destination host name */ + fd = fopen( pathname, "r" ); + if( !fd ) + goto use_default; + + if( NULL == fgets( host, sizeof(host), fd ) ) + host[0] = 0; + else + { + p = strchr( host, '\n' ); + if( p ) + *p = 0; + p = strchr( host, '\r' ); + if( p ) + *p = 0; + } + fclose( fd ); + + p = strchr( host, ':' ); + if( p ) + *p++ = 0; + + phe = gethostbyname( host ); + if( !phe ) + goto use_default; + + memcpy( &sa_logger.sin_addr.s_addr, phe->h_addr, phe->h_length ); + + if( p ) + sa_logger.sin_port = htons( (unsigned short) strtoul( p, NULL, 0 ) ); + else + sa_logger.sin_port = htons( SYSLOG_PORT ); + return; + +use_default: + sa_logger.sin_addr.S_un.S_addr = htonl( 0x7F000001 ); + sa_logger.sin_port = htons( SYSLOG_PORT ); +} + +/****************************************************************************** + * closelog + * + * Close desriptor used to write to system logger. + */ +void closelog() +{ + if( !initialized ) + return; + closesocket( sock ); + WSACleanup(); + initialized = FALSE; +} + +/****************************************************************************** + * openlog + * + * Open connection to system logger. + */ +void openlog( char* ident, int option, int facility ) +{ + BOOL failed = TRUE, wsa_initialized = FALSE; + WSADATA wsd; + SOCKADDR_IN sa_local; + DWORD n; + int size; + + if( initialized ) + return; + + syslog_facility = facility? facility : LOG_USER; + + /* FIXME: should we reset logmask? */ + + if( option & LOG_PID ) + snprintf( str_pid, sizeof(str_pid), "[%lu]", GetCurrentProcessId() ); + else + str_pid[0] = 0; + + /* FIXME: handle other options */ + + n = sizeof(local_hostname); + if( !GetComputerName( local_hostname, &n ) ) + goto done; + + sock = INVALID_SOCKET; + if( WSAStartup( MAKEWORD( 2, 2 ), &wsd ) ) + goto done; + wsa_initialized = TRUE; + + init_logger_addr(); + + for( n = 0;; n++ ) + { + sock = socket( AF_INET, SOCK_DGRAM, 0 ); + if( INVALID_SOCKET == sock ) + goto done; + + memset( &sa_local, 0, sizeof(SOCKADDR_IN) ); + sa_local.sin_family = AF_INET; + if( bind( sock, (SOCKADDR*) &sa_local, sizeof(SOCKADDR_IN) ) == 0 ) + break; + closesocket( sock ); + sock = INVALID_SOCKET; + if( n == 100 ) + goto done; + Sleep(0); + } + + /* get size of datagramm */ + size = sizeof(datagramm_size); + if( getsockopt( sock, SOL_SOCKET, SO_MAX_MSG_SIZE, (char*) &datagramm_size, &size ) ) + goto done; + if( datagramm_size - strlen(local_hostname) - (ident? strlen(ident) : 0) < 64 ) + goto done; + if( datagramm_size > sizeof(datagramm) ) + datagramm_size = sizeof(datagramm); + + if( atexit( closelog ) ) + goto done; + + syslog_ident = ident; + syslog_facility = facility; + failed = FALSE; + +done: + if( failed ) + { + if( sock != INVALID_SOCKET ) closesocket( sock ); + if( wsa_initialized ) WSACleanup(); + } + initialized = !failed; +} + +/****************************************************************************** + * setlogmask + * + * Set the log mask level. + */ +int setlogmask( int mask ) +{ + int ret = log_mask; + + if( mask ) + log_mask = mask; + return ret; +} + +/****************************************************************************** + * syslog + * + * Generate a log message using FMT string and option arguments. + */ +void syslog( int pri, char* fmt, ... ) +{ + va_list ap; + + va_start( ap, fmt ); + vsyslog( pri, fmt, ap ); + va_end( ap ); +} + +/****************************************************************************** + * vsyslog + * + * Generate a log message using FMT and using arguments pointed to by AP. + */ +void vsyslog( int pri, char* fmt, va_list ap ) +{ + static char *month[] = {"Jan", "Feb", "Mar", "Apr", "May", "Jun", + "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" }; + SYSTEMTIME stm; + int len; + char *p; + + if( !(LOG_MASK( LOG_PRI( pri )) & log_mask) ) + return; + + openlog( NULL, 0, pri & LOG_FACMASK ); + if( !initialized ) + return; + + if( !(pri & LOG_FACMASK) ) + pri |= syslog_facility; + + GetLocalTime( &stm ); + len = sprintf( datagramm, "<%d>%s %2d %02d:%02d:%02d %s %s%s: ", + pri, + month[ stm.wMonth - 1 ], stm.wDay, stm.wHour, stm.wMinute, stm.wSecond, + local_hostname, syslog_ident? syslog_ident : "", str_pid ); + vsnprintf( datagramm + len, datagramm_size - len, fmt, ap ); + p = strchr( datagramm, '\n' ); + if( p ) + *p = 0; + p = strchr( datagramm, '\r' ); + if( p ) + *p = 0; + + sendto( sock, datagramm, strlen(datagramm), 0, (SOCKADDR*) &sa_logger, sizeof(SOCKADDR_IN) ); +} + Propchange: trunk/rosapps/applications/sysutils/telnetd/syslog.c ------------------------------------------------------------------------------ svn:eol-style = native Propchange: trunk/rosapps/applications/sysutils/telnetd/syslog.c ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: trunk/rosapps/applications/sysutils/telnetd/syslog.h URL:
http://svn.reactos.org/svn/reactos/trunk/rosapps/applications/sysutils/teln…
============================================================================== --- trunk/rosapps/applications/sysutils/telnetd/syslog.h (added) +++ trunk/rosapps/applications/sysutils/telnetd/syslog.h [iso-8859-1] Fri Feb 6 02:22:18 2009 @@ -1,0 +1,197 @@ +/* + * Copyright (c) 1982, 1986, 1988, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)syslog.h 8.1 (Berkeley) 6/2/93 + */ + +#ifndef _SYS_SYSLOG_H +#define _SYS_SYSLOG_H 1 + +#include <stdarg.h> + +/* + * priorities/facilities are encoded into a single 32-bit quantity, where the + * bottom 3 bits are the priority (0-7) and the top 28 bits are the facility + * (0-big number). Both the priorities and the facilities map roughly + * one-to-one to strings in the syslogd(8) source code. This mapping is + * included in this file. + * + * priorities (these are ordered) + */ +#define LOG_EMERG 0 /* system is unusable */ +#define LOG_ALERT 1 /* action must be taken immediately */ +#define LOG_CRIT 2 /* critical conditions */ +#define LOG_ERR 3 /* error conditions */ +#define LOG_WARNING 4 /* warning conditions */ +#define LOG_NOTICE 5 /* normal but significant condition */ +#define LOG_INFO 6 /* informational */ +#define LOG_DEBUG 7 /* debug-level messages */ + +#define LOG_PRIMASK 0x07 /* mask to extract priority part (internal) */ + /* extract priority */ +#define LOG_PRI(p) ((p) & LOG_PRIMASK) +#define LOG_MAKEPRI(fac, pri) (((fac) << 3) | (pri)) + +#ifdef SYSLOG_NAMES +#define INTERNAL_NOPRI 0x10 /* the "no priority" priority */ + /* mark "facility" */ +#define INTERNAL_MARK LOG_MAKEPRI(LOG_NFACILITIES, 0) +typedef struct _code { + char *c_name; + int c_val; +} CODE; + +CODE prioritynames[] = + { + { "alert", LOG_ALERT }, + { "crit", LOG_CRIT }, + { "debug", LOG_DEBUG }, + { "emerg", LOG_EMERG }, + { "err", LOG_ERR }, + { "error", LOG_ERR }, /* DEPRECATED */ + { "info", LOG_INFO }, + { "none", INTERNAL_NOPRI }, /* INTERNAL */ + { "notice", LOG_NOTICE }, + { "panic", LOG_EMERG }, /* DEPRECATED */ + { "warn", LOG_WARNING }, /* DEPRECATED */ + { "warning", LOG_WARNING }, + { NULL, -1 } + }; +#endif + +/* facility codes */ +#define LOG_KERN (0<<3) /* kernel messages */ +#define LOG_USER (1<<3) /* random user-level messages */ +#define LOG_MAIL (2<<3) /* mail system */ +#define LOG_DAEMON (3<<3) /* system daemons */ +#define LOG_AUTH (4<<3) /* security/authorization messages */ +#define LOG_SYSLOG (5<<3) /* messages generated internally by syslogd */ +#define LOG_LPR (6<<3) /* line printer subsystem */ +#define LOG_NEWS (7<<3) /* network news subsystem */ +#define LOG_UUCP (8<<3) /* UUCP subsystem */ +#define LOG_CRON (9<<3) /* clock daemon */ +#define LOG_AUTHPRIV (10<<3) /* security/authorization messages (private) */ +#define LOG_FTP (11<<3) /* ftp daemon */ + + /* other codes through 15 reserved for system use */ +#define LOG_LOCAL0 (16<<3) /* reserved for local use */ +#define LOG_LOCAL1 (17<<3) /* reserved for local use */ +#define LOG_LOCAL2 (18<<3) /* reserved for local use */ +#define LOG_LOCAL3 (19<<3) /* reserved for local use */ +#define LOG_LOCAL4 (20<<3) /* reserved for local use */ +#define LOG_LOCAL5 (21<<3) /* reserved for local use */ +#define LOG_LOCAL6 (22<<3) /* reserved for local use */ +#define LOG_LOCAL7 (23<<3) /* reserved for local use */ + +#define LOG_NFACILITIES 24 /* current number of facilities */ +#define LOG_FACMASK 0x03f8 /* mask to extract facility part */ + /* facility of pri */ +#define LOG_FAC(p) (((p) & LOG_FACMASK) >> 3) + +#ifdef SYSLOG_NAMES +CODE facilitynames[] = + { + { "auth", LOG_AUTH }, + { "authpriv", LOG_AUTHPRIV }, + { "cron", LOG_CRON }, + { "daemon", LOG_DAEMON }, + { "ftp", LOG_FTP }, + { "kern", LOG_KERN }, + { "lpr", LOG_LPR }, + { "mail", LOG_MAIL }, + { "mark", INTERNAL_MARK }, /* INTERNAL */ + { "news", LOG_NEWS }, + { "security", LOG_AUTH }, /* DEPRECATED */ + { "syslog", LOG_SYSLOG }, + { "user", LOG_USER }, + { "uucp", LOG_UUCP }, + { "local0", LOG_LOCAL0 }, + { "local1", LOG_LOCAL1 }, + { "local2", LOG_LOCAL2 }, + { "local3", LOG_LOCAL3 }, + { "local4", LOG_LOCAL4 }, + { "local5", LOG_LOCAL5 }, + { "local6", LOG_LOCAL6 }, + { "local7", LOG_LOCAL7 }, + { NULL, -1 } + }; +#endif + +/* + * arguments to setlogmask. + */ +#define LOG_MASK(pri) (1 << (pri)) /* mask for one priority */ +#define LOG_UPTO(pri) ((1 << ((pri)+1)) - 1) /* all priorities through pri */ + +/* + * Option flags for openlog. + * + * LOG_ODELAY no longer does anything. + * LOG_NDELAY is the inverse of what it used to be. + */ +#define LOG_PID 0x01 /* log the pid with each message */ +#define LOG_CONS 0x02 /* log on the console if errors in sending */ +#define LOG_ODELAY 0x04 /* delay open until first syslog() (default) */ +#define LOG_NDELAY 0x08 /* don't delay open */ +#define LOG_NOWAIT 0x10 /* don't wait for console forks: DEPRECATED */ +#define LOG_PERROR 0x20 /* log to stderr as well */ + +#define SYSLOG_PORT 514 + +#ifdef __cplusplus +extern "C" { +#endif + +/* Close desriptor used to write to system logger. */ +extern void closelog (void); + +/* Open connection to system logger. */ +extern void openlog (char *__ident, int __option, int __facility); + +/* Set the log mask level. */ +extern int setlogmask (int __mask); + +/* Generate a log message using FMT string and option arguments. */ +extern void syslog (int __pri, char *__fmt, ...); + +/* Generate a log message using FMT and using arguments pointed to by AP. */ +extern void vsyslog (int __pri, char *__fmt, va_list __ap); + +/* windows-specific; + set directory from where syslog.host must be read; + this file contains a single line with hostname and port of syslog daemon; + default is localhost:514 +*/ +extern const char* set_syslog_conf_dir( const char* dir ); + + +#ifdef __cplusplus +} +#endif + +#endif /* syslog.h */ Propchange: trunk/rosapps/applications/sysutils/telnetd/syslog.h ------------------------------------------------------------------------------ svn:eol-style = native Propchange: trunk/rosapps/applications/sysutils/telnetd/syslog.h ------------------------------------------------------------------------------ svn:mime-type = text/plain Modified: trunk/rosapps/applications/sysutils/telnetd/telnetd.c URL:
http://svn.reactos.org/svn/reactos/trunk/rosapps/applications/sysutils/teln…
============================================================================== --- trunk/rosapps/applications/sysutils/telnetd/telnetd.c [iso-8859-1] (original) +++ trunk/rosapps/applications/sysutils/telnetd/telnetd.c [iso-8859-1] Fri Feb 6 02:22:18 2009 @@ -22,6 +22,17 @@ #include "telnetd.h" +#define telnetd_printf printf + +#if 0 +extern void syslog (int priority, const char *fmt, ...); + +int telnetd_printf(const char *format, ...) +{ + syslog (6, format); +} +#endif + /* Local data */ static BOOLEAN bShutdown = 0; @@ -41,9 +52,8 @@ { SetConsoleCtrlHandler(Cleanup, 1); - if (!StartSocketInterface()) { + if (!StartSocketInterface()) ErrorExit("Unable to start socket interface\n"); - } CreateSocket(); @@ -59,7 +69,7 @@ static BOOL WINAPI Cleanup(DWORD dwControlType) { if (bSocketInterfaceInitialised) { - printf("Cleanup...\n"); + telnetd_printf("Cleanup...\n"); WSACleanup(); } return 0; @@ -75,82 +85,70 @@ wVersionRequested = MAKEWORD( 2, 0 ); err = WSAStartup(wVersionRequested, &wsaData); if (err != 0) { - printf("requested winsock version not supported\n"); + telnetd_printf("requested winsock version not supported\n"); return 0; } bSocketInterfaceInitialised = 1; /* for ErrorExit function */ - if ( wsaData.wVersion != wVersionRequested) { - printf("requested winsock version not supported\n"); - return 0; - } - printf("TelnetD, using %s\n", wsaData.szDescription); + if ( wsaData.wVersion != wVersionRequested) + ErrorExit("requested winsock version not supported\n"); + + telnetd_printf("TelnetD, using %s\n", wsaData.szDescription); return 1; } -/* -** CreateSocket -*/ +/* CreateSocket */ static void CreateSocket(void) { struct sockaddr_in sa; sock = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); - if (sock < 0) { + if (sock < 0) ErrorExit("Cannot create socket"); - } memset(&sa, 0, sizeof(sa)); sa.sin_family = AF_INET; sa.sin_addr.s_addr = INADDR_ANY; sa.sin_port = htons(TELNET_PORT); - if (bind(sock, (struct sockaddr*) &sa, sizeof(sa)) != 0) { + + if (bind(sock, (struct sockaddr*) &sa, sizeof(sa)) != 0) ErrorExit("Cannot bind address to socket"); - } -} - -/* -** WaitForConnect -*/ +} + +/* WaitForConnect */ static void WaitForConnect(void) { struct sockaddr_in sa; int new_sock; - if (listen(sock, 1) < 0) { + if (listen(sock, 1) < 0) ErrorExit("Cannot listen on socket"); - } if ((new_sock = accept(sock, (struct sockaddr*) &sa, NULL)) < 0) { fprintf(stderr, "Failed to accept incoming call\n"); } else { - printf("user connected on socket %d, port %d, address %lx\n", new_sock, + telnetd_printf("user connected on socket %d, port %d, address %lx\n", new_sock, htons(sa.sin_port), sa.sin_addr.s_addr); UserLogin(new_sock); } } - -/* -** Function: UserLogin -*/ +/* Function: UserLogin */ static void UserLogin(int client_socket) { DWORD threadID; client_t *client = malloc(sizeof(client_t)); - if (client == NULL) { + if (client == NULL) ErrorExit("failed to allocate memory for client"); - } + client->socket = client_socket; CreateThread(NULL, 0, UserLoginThread, client, 0, &threadID); } -/* -** Function: UserLoginThread -*/ +/* Function: UserLoginThread */ static DWORD WINAPI UserLoginThread(LPVOID data) { client_t *client = (client_t *) data; @@ -211,7 +209,7 @@ /* TODO: do authentication here */ - printf("User '%s' logged on\n", userID); + telnetd_printf("User '%p' logged on\n", userID); #if 0 strcpy(client->userID, userID); if (send(client->socket, logonPrompt, strlen(logonPrompt), 0) < 0) { @@ -224,9 +222,7 @@ return 0; } -/* -** Function: DoTelnetHandshake -*/ +/* Function: DoTelnetHandshake */ static int DoTelnetHandshake(int sock) { int retval; @@ -394,7 +390,7 @@ // Create the child process (the shell) - printf("Creating child process...\n"); + telnetd_printf("Creating child process...\n"); ZeroMemory( &si, sizeof(STARTUPINFO) ); si.cb = sizeof(STARTUPINFO); @@ -424,11 +420,12 @@ client->hProcess = piProcInfo.hProcess; client->dwProcessId = piProcInfo.dwProcessId; - printf("New child created (groupid=%lu)\n", client->dwProcessId); + telnetd_printf("New child created (groupid=%lu)\n", client->dwProcessId); // No longer need these in the parent... if (!CloseHandle(hChildStdoutWr)) ErrorExit("Closing handle failed"); + if (!CloseHandle(hChildStdinRd)) ErrorExit("Closing handle failed"); @@ -437,23 +434,22 @@ CreateThread(NULL, 0, MonitorChildThread, client, 0, &threadID); } - /* -** Function: MonitorChildThread -** -** Abstract: Monitor the child (shell) process -*/ + * Function: MonitorChildThread + * + * Abstract: Monitor the child (shell) process + */ static DWORD WINAPI MonitorChildThread(LPVOID data) { DWORD exitCode; client_t *client = (client_t *) data; - printf("Monitor thread running...\n"); + telnetd_printf("Monitor thread running...\n"); WaitForSingleObject(client->hProcess, INFINITE); GetExitCodeProcess(client->hProcess, &exitCode); - printf("Child process terminated with code %lx\n", exitCode); + telnetd_printf("Child process terminated with code %lx\n", exitCode); /* signal the other threads to give up */ client->bTerminate = TRUE; @@ -466,25 +462,25 @@ closesocket(client->socket); - printf("Waiting for all threads to give up..\n"); + telnetd_printf("Waiting for all threads to give up..\n"); while (client->bWriteToPipe || client->bReadFromPipe) { - printf("."); + telnetd_printf("."); fflush(stdout); Sleep(1000); } - printf("Cleanup for user '%s'\n", client->userID); + telnetd_printf("Cleanup for user '%s'\n", client->userID); free(client); return 0; } /* -** Function: WriteToPipeThread -** -** Abstract: read data from the telnet client socket -** and pass it on to the shell process. -*/ + * Function: WriteToPipeThread + * + * Abstract: read data from the telnet client socket + * and pass it on to the shell process. + */ static DWORD WINAPI WriteToPipeThread(LPVOID data) { int iRead; @@ -495,39 +491,38 @@ while (!client->bTerminate) { iRead = ReceiveLine(client->socket, chBuf, BUFSIZE, FALSE); if (iRead < 0) { - printf("Client disconnect\n"); + telnetd_printf("Client disconnect\n"); break; } else if (iRead > 0) { if (strchr(chBuf, CTRLC)) { GenerateConsoleCtrlEvent(CTRL_C_EVENT, client->dwProcessId); } if (send(client->socket, chBuf, iRead, 0) < 0) { - printf("error writing to socket\n"); + telnetd_printf("error writing to socket\n"); break; } if (! WriteFile(client->hChildStdinWr, chBuf, (DWORD) iRead, &dwWritten, NULL)) { - printf("Error writing to pipe\n"); + telnetd_printf("Error writing to pipe\n"); break; } } } - if (!client->bTerminate) { + if (!client->bTerminate) TerminateShell(client); - } - - printf("WriteToPipeThread terminated\n"); + + telnetd_printf("WriteToPipeThread terminated\n"); client->bWriteToPipe = FALSE; return 0; } /* -** Function: ReadFromPipeThread -** -** Abstract: Read data from the shell's stdout handle and -** pass it on to the telnet client socket. -*/ + * Function: ReadFromPipeThread + * + * Abstract: Read data from the shell's stdout handle and + * pass it on to the telnet client socket. + */ static DWORD WINAPI ReadFromPipeThread(LPVOID data) { DWORD dwRead; @@ -542,13 +537,13 @@ while (!client->bTerminate && client->bWriteToPipe) { // Since we do not want to block, first peek... if (PeekNamedPipe(client->hChildStdoutRd, NULL, 0, NULL, &dwAvail, NULL) == 0) { - printf("Failed to peek in pipe\n"); + telnetd_printf("Failed to peek in pipe\n"); break; } if (dwAvail) { if( ! ReadFile( client->hChildStdoutRd, chBuf, BUFSIZE, &dwRead, NULL) || dwRead == 0) { - printf("Failed to read from pipe\n"); + telnetd_printf("Failed to read from pipe\n"); break; } for (from=0, to=0; from<dwRead; from++, to++) { @@ -560,26 +555,23 @@ } } if (send(client->socket, txBuf, to, 0) < 0) { - printf("error writing to socket\n"); + telnetd_printf("error writing to socket\n"); break; } } Sleep(100); /* Hmmm, oh well... what the heck! */ } - if (!client->bTerminate) { + if (!client->bTerminate) TerminateShell(client); - } - - printf("ReadFromPipeThread terminated\n"); + + telnetd_printf("ReadFromPipeThread terminated\n"); client->bReadFromPipe = FALSE; return 0; } -/* -** TerminateShell -*/ +/* TerminateShell */ static void TerminateShell(client_t *client) { DWORD exitCode; @@ -588,42 +580,37 @@ GetExitCodeProcess(client->hProcess, &exitCode); if (exitCode == STILL_ACTIVE) { - printf("user shell still active, send Ctrl-Break to group-id %lu\n", client->dwProcessId ); - - if (!GenerateConsoleCtrlEvent( CTRL_BREAK_EVENT, client->dwProcessId )) { - printf("Failed to send Ctrl_break\n"); - } + telnetd_printf("user shell still active, send Ctrl-Break to group-id %lu\n", client->dwProcessId ); + + if (!GenerateConsoleCtrlEvent( CTRL_BREAK_EVENT, client->dwProcessId )) + telnetd_printf("Failed to send Ctrl_break\n"); Sleep(500); - if (!GenerateConsoleCtrlEvent( CTRL_C_EVENT, client->dwProcessId )) { - printf("Failed to send Ctrl_C\n"); - } + if (!GenerateConsoleCtrlEvent( CTRL_C_EVENT, client->dwProcessId )) + telnetd_printf("Failed to send Ctrl_C\n"); Sleep(500); - if (! WriteFile(client->hChildStdinWr, stop, sizeof(stop), &dwWritten, NULL)) { - printf("Error writing to pipe\n"); - } + if (!WriteFile(client->hChildStdinWr, stop, sizeof(stop), &dwWritten, NULL)) + telnetd_printf("Error writing to pipe\n"); Sleep(500); GetExitCodeProcess(client->hProcess, &exitCode); if (exitCode == STILL_ACTIVE) { - printf("user shell still active, attempt to terminate it now...\n"); + telnetd_printf("user shell still active, attempt to terminate it now...\n"); TerminateProcess(client->hProcess, 0); } } } -/* -** ErrorExit -*/ +/* ErrorExit */ static VOID ErrorExit (LPTSTR lpszMessage) { fprintf(stderr, "%s\n", lpszMessage); if (bSocketInterfaceInitialised) { - printf("WSAGetLastError=%d\n", WSAGetLastError()); + telnetd_printf("WSAGetLastError=%d\n", WSAGetLastError()); WSACleanup(); } ExitProcess(0);
16 years, 2 months
1
0
0
0
[dchapyshev] 39431: - Implement GetVolumePathNameA/W
by dchapyshev@svn.reactos.org
Author: dchapyshev Date: Fri Feb 6 02:13:11 2009 New Revision: 39431 URL:
http://svn.reactos.org/svn/reactos?rev=39431&view=rev
Log: - Implement GetVolumePathNameA/W Modified: trunk/reactos/dll/win32/kernel32/file/volume.c trunk/reactos/dll/win32/kernel32/misc/stubs.c Modified: trunk/reactos/dll/win32/kernel32/file/volume.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/file/vo…
============================================================================== --- trunk/reactos/dll/win32/kernel32/file/volume.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/file/volume.c [iso-8859-1] Fri Feb 6 02:13:11 2009 @@ -1179,4 +1179,142 @@ return RtlFreeHeap(GetProcessHeap(), 0, hFindVolume); } +/* + * @implemented + */ +BOOL +WINAPI +GetVolumePathNameA(LPCSTR lpszFileName, + LPSTR lpszVolumePathName, + DWORD cchBufferLength) +{ + PWCHAR FileNameW = NULL; + WCHAR VolumePathName[MAX_PATH]; + BOOL Result; + + if (lpszFileName) + { + if (!(FileNameW = FilenameA2W(lpszFileName, FALSE))) + return FALSE; + } + + Result = GetVolumePathNameW(FileNameW, VolumePathName, cchBufferLength); + + if (Result) + FilenameW2A_N(lpszVolumePathName, MAX_PATH, VolumePathName, -1); + + return Result; +} + +/* + * @implemented + */ +BOOL +WINAPI +GetVolumePathNameW(LPCWSTR lpszFileName, + LPWSTR lpszVolumePathName, + DWORD cchBufferLength) +{ + DWORD PathLength; + UNICODE_STRING UnicodeFilePath; + LPWSTR FilePart; + PWSTR FullFilePath, FilePathName; + ULONG PathSize; + WCHAR VolumeName[MAX_PATH]; + DWORD ErrorCode; + BOOL Result = FALSE; + + if (!(PathLength = GetFullPathNameW(lpszFileName, 0, NULL, NULL))) + { + return Result; + } + else + { + PathLength = PathLength + 10; + PathSize = PathLength * sizeof(WCHAR); + + if (!(FullFilePath = RtlAllocateHeap(RtlGetProcessHeap(), 0, PathSize))) + { + SetLastError(ERROR_NOT_ENOUGH_MEMORY); + return Result; + } + + if (!GetFullPathNameW(lpszFileName, PathLength, FullFilePath, &FilePart)) + { + RtlFreeHeap(RtlGetProcessHeap(), 0, FullFilePath); + return Result; + } + + RtlInitUnicodeString(&UnicodeFilePath, FullFilePath); + + if (UnicodeFilePath.Buffer[UnicodeFilePath.Length / sizeof(WCHAR) - 1] != '\\') + { + UnicodeFilePath.Length += sizeof(WCHAR); + UnicodeFilePath.Buffer[UnicodeFilePath.Length / sizeof(WCHAR) - 1] = '\\'; + UnicodeFilePath.Buffer[UnicodeFilePath.Length / sizeof(WCHAR)] = '\0'; + } + + if (!(FilePathName = RtlAllocateHeap(RtlGetProcessHeap(), 0, PathSize))) + { + RtlFreeHeap(RtlGetProcessHeap(), 0, FullFilePath); + SetLastError(ERROR_NOT_ENOUGH_MEMORY); + return Result; + } + + while (!GetVolumeNameForVolumeMountPointW(UnicodeFilePath.Buffer, + VolumeName, + MAX_PATH)) + { + if (((UnicodeFilePath.Length == 4) && (UnicodeFilePath.Buffer[0] == '\\') && + (UnicodeFilePath.Buffer[1] == '\\')) || ((UnicodeFilePath.Length == 6) && + (UnicodeFilePath.Buffer[1] == ':'))) + { + break; + } + + UnicodeFilePath.Length -= sizeof(WCHAR); + UnicodeFilePath.Buffer[UnicodeFilePath.Length / sizeof(WCHAR)] = '\0'; + + memcpy(FilePathName, UnicodeFilePath.Buffer, UnicodeFilePath.Length); + FilePathName[UnicodeFilePath.Length / sizeof(WCHAR)] = '\0'; + + if (!GetFullPathNameW(FilePathName, PathLength, FullFilePath, &FilePart)) + { + goto Cleanup2; + } + + if (!FilePart) + { + RtlInitUnicodeString(&UnicodeFilePath, FullFilePath); + UnicodeFilePath.Length += sizeof(WCHAR); + UnicodeFilePath.Buffer[UnicodeFilePath.Length / sizeof(WCHAR) - 1] = '\\'; + UnicodeFilePath.Buffer[UnicodeFilePath.Length / sizeof(WCHAR)] = '\0'; + break; + } + + FilePart[0] = '\0'; + RtlInitUnicodeString(&UnicodeFilePath, FullFilePath); + } + } + + if (UnicodeFilePath.Length > (cchBufferLength * sizeof(WCHAR)) - sizeof(WCHAR)) + { + ErrorCode = ERROR_FILENAME_EXCED_RANGE; + goto Cleanup1; + } + + memcpy(lpszVolumePathName, UnicodeFilePath.Buffer, UnicodeFilePath.Length); + lpszVolumePathName[UnicodeFilePath.Length / sizeof(WCHAR)] = '\0'; + + Result = TRUE; + goto Cleanup2; + +Cleanup1: + SetLastError(ErrorCode); +Cleanup2: + RtlFreeHeap(RtlGetProcessHeap(), 0, FullFilePath); + RtlFreeHeap(RtlGetProcessHeap(), 0, FilePathName); + return Result; +} + /* EOF */ Modified: trunk/reactos/dll/win32/kernel32/misc/stubs.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/misc/st…
============================================================================== --- trunk/reactos/dll/win32/kernel32/misc/stubs.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/misc/stubs.c [iso-8859-1] Fri Feb 6 02:13:11 2009 @@ -629,22 +629,6 @@ */ BOOL WINAPI -GetVolumePathNameW( - LPCWSTR lpszFileName, - LPWSTR lpszVolumePathName, - DWORD cchBufferLength - ) -{ - STUB; - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return 0; -} - -/* - * @unimplemented - */ -BOOL -WINAPI GetVolumePathNamesForVolumeNameW( LPCWSTR lpszVolumeName, LPWSTR lpszVolumePathNames, @@ -771,21 +755,6 @@ */ BOOL WINAPI -GetVolumePathNameA( - LPCSTR lpszFileName, - LPSTR lpszVolumePathName, - DWORD cchBufferLength - ) -{ - STUB; - return 0; -} - -/* - * @unimplemented - */ -BOOL -WINAPI GetVolumePathNamesForVolumeNameA( LPCSTR lpszVolumeName, LPSTR lpszVolumePathNames,
16 years, 2 months
1
0
0
0
[sedwards] 39430: Changed port back to 23
by sedwards@svn.reactos.org
Author: sedwards Date: Fri Feb 6 00:47:54 2009 New Revision: 39430 URL:
http://svn.reactos.org/svn/reactos?rev=39430&view=rev
Log: Changed port back to 23 Modified: trunk/rosapps/applications/sysutils/telnetd/telnetd.h Modified: trunk/rosapps/applications/sysutils/telnetd/telnetd.h URL:
http://svn.reactos.org/svn/reactos/trunk/rosapps/applications/sysutils/teln…
============================================================================== --- trunk/rosapps/applications/sysutils/telnetd/telnetd.h [iso-8859-1] (original) +++ trunk/rosapps/applications/sysutils/telnetd/telnetd.h [iso-8859-1] Fri Feb 6 00:47:54 2009 @@ -12,7 +12,7 @@ /* ** macro definitions */ -#define TELNET_PORT (23003) +#define TELNET_PORT (23) #define BUFSIZE (4096) #define USERID_SIZE (64)
16 years, 2 months
1
0
0
0
← Newer
1
...
36
37
38
39
40
41
42
...
56
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
Results per page:
10
25
50
100
200