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
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
September 2012
----- 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
17 participants
236 discussions
Start a n
N
ew thread
[ekohl] 57397: [LSASRV] - Implement the PolicyDnsDomainInformation class of LsarQueryInformationPolicy and enable the PolicyModificationInformation class. - Add required attributes to the initializ...
by ekohl@svn.reactos.org
Author: ekohl Date: Wed Sep 26 22:51:12 2012 New Revision: 57397 URL:
http://svn.reactos.org/svn/reactos?rev=57397&view=rev
Log: [LSASRV] - Implement the PolicyDnsDomainInformation class of LsarQueryInformationPolicy and enable the PolicyModificationInformation class. - Add required attributes to the initialization code. Modified: trunk/reactos/dll/win32/lsasrv/database.c trunk/reactos/dll/win32/lsasrv/lsarpc.c trunk/reactos/dll/win32/lsasrv/policy.c Modified: trunk/reactos/dll/win32/lsasrv/database.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/lsasrv/database.…
============================================================================== --- trunk/reactos/dll/win32/lsasrv/database.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/lsasrv/database.c [iso-8859-1] Wed Sep 26 22:51:12 2012 @@ -231,7 +231,7 @@ POLICY_MODIFICATION_INFO ModificationInfo; POLICY_AUDIT_FULL_QUERY_INFO AuditFullInfo = {FALSE, FALSE}; POLICY_AUDIT_LOG_INFO AuditLogInfo; - + GUID DnsDomainGuid; PLSA_DB_OBJECT PolicyObject = NULL; PSID AccountDomainSid = NULL; ULONG AuditEventsCount; @@ -255,6 +255,7 @@ AuditLogInfo.TimeToShutdown.QuadPart = 0; // LARGE_INTEGER AuditLogInfo.NextAuditRecordId = 0; // DWORD + /* Initialize the Audit Events attribute */ AuditEventsCount = AuditCategoryAccountLogon - AuditCategorySystem + 1; AuditEventsSize = sizeof(LSAP_POLICY_AUDIT_EVENTS_DATA) + AuditEventsCount * sizeof(DWORD); AuditEventsInfo = RtlAllocateHeap(RtlGetProcessHeap(), @@ -268,6 +269,9 @@ for (i = 0; i < AuditEventsCount; i++) AuditEventsInfo->AuditEvents[i] = 0; + /* Initialize the DNS Domain GUID attribute */ + memset(&DnsDomainGuid, 0, sizeof(GUID)); + /* Initialize the modification attribute */ ModificationInfo.ModifiedId.QuadPart = 0; NtQuerySystemTime(&ModificationInfo.DatabaseCreationTime); @@ -335,6 +339,24 @@ L"PolAdtEv", &AuditEventsInfo, AuditEventsSize); + + /* Set the DNS Domain Name attribute */ + LsapSetObjectAttribute(PolicyObject, + L"PolDnDDN", + NULL, + 0); + + /* Set the DNS Forest Name attribute */ + LsapSetObjectAttribute(PolicyObject, + L"PolDnTrN", + NULL, + 0); + + /* Set the DNS Domain GUID attribute */ + LsapSetObjectAttribute(PolicyObject, + L"PolDnDmG", + &DnsDomainGuid, + sizeof(GUID)); done: if (AuditEventsInfo != NULL) Modified: trunk/reactos/dll/win32/lsasrv/lsarpc.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/lsasrv/lsarpc.c?…
============================================================================== --- trunk/reactos/dll/win32/lsasrv/lsarpc.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/lsasrv/lsarpc.c [iso-8859-1] Wed Sep 26 22:51:12 2012 @@ -212,6 +212,7 @@ case PolicyLsaServerRoleInformation: case PolicyReplicaSourceInformation: case PolicyDefaultQuotaInformation: + case PolicyModificationInformation: case PolicyDnsDomainInformation: case PolicyDnsDomainInformationInt: case PolicyLocalAccountDomainInformation: Modified: trunk/reactos/dll/win32/lsasrv/policy.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/lsasrv/policy.c?…
============================================================================== --- trunk/reactos/dll/win32/lsasrv/policy.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/lsasrv/policy.c [iso-8859-1] Wed Sep 26 22:51:12 2012 @@ -612,42 +612,215 @@ PLSAPR_POLICY_INFORMATION *PolicyInformation) { PLSAPR_POLICY_DNS_DOMAIN_INFO p = NULL; + PUNICODE_STRING DomainName; + ULONG AttributeSize; + NTSTATUS Status; + + *PolicyInformation = NULL; p = MIDL_user_allocate(sizeof(LSAPR_POLICY_DNS_DOMAIN_INFO)); if (p == NULL) return STATUS_INSUFFICIENT_RESOURCES; - p->Name.Length = 0; - p->Name.MaximumLength = 0; - p->Name.Buffer = NULL; -#if 0 - p->Name.Length = wcslen(L"COMPUTERNAME"); - p->Name.MaximumLength = p->Name.Length + sizeof(WCHAR); - p->Name.Buffer = MIDL_user_allocate(p->Name.MaximumLength); + /* Primary Domain Name */ + AttributeSize = 0; + Status = LsapGetObjectAttribute(PolicyObject, + L"PolPrDmN", + NULL, + &AttributeSize); + if (!NT_SUCCESS(Status)) + { + goto done; + } + + if (AttributeSize > 0) + { + DomainName = MIDL_user_allocate(AttributeSize); + if (DomainName == NULL) + { + Status = STATUS_INSUFFICIENT_RESOURCES; + goto done; + } + + Status = LsapGetObjectAttribute(PolicyObject, + L"PolPrDmN", + DomainName, + &AttributeSize); + if (Status == STATUS_SUCCESS) + { + DomainName->Buffer = (LPWSTR)((ULONG_PTR)DomainName + (ULONG_PTR)DomainName->Buffer); + + TRACE("PrimaryDomainName: %wZ\n", DomainName); + + p->Name.Buffer = MIDL_user_allocate(DomainName->MaximumLength); if (p->Name.Buffer == NULL) { - MIDL_user_free(p); - return STATUS_INSUFFICIENT_RESOURCES; + MIDL_user_free(DomainName); + Status = STATUS_INSUFFICIENT_RESOURCES; + goto done; } - wcscpy(p->Name.Buffer, L"COMPUTERNAME"); -#endif - - p->DnsDomainName.Length = 0; - p->DnsDomainName.MaximumLength = 0; - p->DnsDomainName.Buffer = NULL; - - p->DnsForestName.Length = 0; - p->DnsForestName.MaximumLength = 0; - p->DnsForestName.Buffer = 0; - - memset(&p->DomainGuid, 0, sizeof(GUID)); - - p->Sid = NULL; /* no domain, no workgroup */ + p->Name.Length = DomainName->Length; + p->Name.MaximumLength = DomainName->MaximumLength; + memcpy(p->Name.Buffer, + DomainName->Buffer, + DomainName->MaximumLength); + } + + MIDL_user_free(DomainName); + } + + /* Primary Domain SID */ + AttributeSize = 0; + Status = LsapGetObjectAttribute(PolicyObject, + L"PolPrDmS", + NULL, + &AttributeSize); + if (!NT_SUCCESS(Status)) + { + goto done; + } + + if (AttributeSize > 0) + { + p->Sid = MIDL_user_allocate(AttributeSize); + if (p->Sid == NULL) + { + Status = STATUS_INSUFFICIENT_RESOURCES; + goto done; + } + + Status = LsapGetObjectAttribute(PolicyObject, + L"PolPrDmS", + p->Sid, + &AttributeSize); + } + + /* DNS Domain Name */ + AttributeSize = 0; + Status = LsapGetObjectAttribute(PolicyObject, + L"PolDnDDN", + NULL, + &AttributeSize); + if (!NT_SUCCESS(Status)) + goto done; + + if (AttributeSize > 0) + { + DomainName = MIDL_user_allocate(AttributeSize); + if (DomainName == NULL) + { + Status = STATUS_INSUFFICIENT_RESOURCES; + goto done; + } + + Status = LsapGetObjectAttribute(PolicyObject, + L"PolDnDDN", + DomainName, + &AttributeSize); + if (Status == STATUS_SUCCESS) + { + DomainName->Buffer = (LPWSTR)((ULONG_PTR)DomainName + (ULONG_PTR)DomainName->Buffer); + + TRACE("DNS Domain Name: %wZ\n", DomainName); + + p->DnsDomainName.Buffer = MIDL_user_allocate(DomainName->MaximumLength); + if (p->DnsDomainName.Buffer == NULL) + { + MIDL_user_free(DomainName); + Status = STATUS_INSUFFICIENT_RESOURCES; + goto done; + } + + p->DnsDomainName.Length = DomainName->Length; + p->DnsDomainName.MaximumLength = DomainName->MaximumLength; + memcpy(p->DnsDomainName.Buffer, + DomainName->Buffer, + DomainName->MaximumLength); + } + + MIDL_user_free(DomainName); + } + + /* DNS Forest Name */ + AttributeSize = 0; + Status = LsapGetObjectAttribute(PolicyObject, + L"PolDnTrN", + NULL, + &AttributeSize); + if (!NT_SUCCESS(Status)) + goto done; + + if (AttributeSize > 0) + { + DomainName = MIDL_user_allocate(AttributeSize); + if (DomainName == NULL) + { + Status = STATUS_INSUFFICIENT_RESOURCES; + goto done; + } + + Status = LsapGetObjectAttribute(PolicyObject, + L"PolDnTrN", + DomainName, + &AttributeSize); + if (Status == STATUS_SUCCESS) + { + DomainName->Buffer = (LPWSTR)((ULONG_PTR)DomainName + (ULONG_PTR)DomainName->Buffer); + + TRACE("DNS Forest Name: %wZ\n", DomainName); + + p->DnsForestName.Buffer = MIDL_user_allocate(DomainName->MaximumLength); + if (p->DnsForestName.Buffer == NULL) + { + MIDL_user_free(DomainName); + Status = STATUS_INSUFFICIENT_RESOURCES; + goto done; + } + + p->DnsForestName.Length = DomainName->Length; + p->DnsForestName.MaximumLength = DomainName->MaximumLength; + memcpy(p->DnsForestName.Buffer, + DomainName->Buffer, + DomainName->MaximumLength); + } + + MIDL_user_free(DomainName); + } + + /* DNS Domain GUID */ + AttributeSize = sizeof(GUID); + Status = LsapGetObjectAttribute(PolicyObject, + L"PolDnDmG", + &(p->DomainGuid), + &AttributeSize); + if (!NT_SUCCESS(Status)) + goto done; *PolicyInformation = (PLSAPR_POLICY_INFORMATION)p; - return STATUS_SUCCESS; +done: + if (!NT_SUCCESS(Status)) + { + if (p) + { + if (p->Name.Buffer) + MIDL_user_free(p->Name.Buffer); + + if (p->DnsDomainName.Buffer) + MIDL_user_free(p->DnsDomainName.Buffer); + + if (p->DnsForestName.Buffer) + MIDL_user_free(p->DnsForestName.Buffer); + + if (p->Sid) + MIDL_user_free(p->Sid); + + MIDL_user_free(p); + } + } + + return Status; }
12 years, 3 months
1
0
0
0
[fireball] 57396: - Final header files reshuffling. Now it compiles as it should.
by fireball@svn.reactos.org
Author: fireball Date: Wed Sep 26 20:42:12 2012 New Revision: 57396 URL:
http://svn.reactos.org/svn/reactos?rev=57396&view=rev
Log: - Final header files reshuffling. Now it compiles as it should. Added: branches/arwinss/arwinss/include/wine/ (with props) branches/arwinss/arwinss/include/wine/ntrosgdi.h - copied unchanged from r57387, branches/arwinss/arwinss/include/ntrosgdi.h branches/arwinss/arwinss/include/wine/rosuser.h - copied unchanged from r57387, branches/arwinss/arwinss/include/rosuser.h branches/arwinss/arwinss/include/wine/server.h - copied unchanged from r57387, branches/arwinss/arwinss/include/server.h branches/arwinss/arwinss/include/wine/server_protocol.h - copied unchanged from r57387, branches/arwinss/arwinss/include/server_protocol.h Removed: branches/arwinss/arwinss/include/ntrosgdi.h branches/arwinss/arwinss/include/rosuser.h branches/arwinss/arwinss/include/server.h branches/arwinss/arwinss/include/server_protocol.h Modified: branches/arwinss/arwinss/client/gdi32/CMakeLists.txt branches/arwinss/arwinss/client/user32/CMakeLists.txt branches/arwinss/arwinss/client/user32/sysparams.c branches/arwinss/arwinss/client/winent.drv/CMakeLists.txt branches/arwinss/arwinss/server/CMakeLists.txt [This mail would be too long, it was shortened to contain the URLs only.] Modified: branches/arwinss/arwinss/client/gdi32/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/arwinss/client/gdi32/CM…
Modified: branches/arwinss/arwinss/client/user32/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/arwinss/client/user32/C…
Modified: branches/arwinss/arwinss/client/user32/sysparams.c URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/arwinss/client/user32/s…
Modified: branches/arwinss/arwinss/client/winent.drv/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/arwinss/client/winent.d…
Removed: branches/arwinss/arwinss/include/ntrosgdi.h URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/arwinss/include/ntrosgd…
Removed: branches/arwinss/arwinss/include/rosuser.h URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/arwinss/include/rosuser…
Removed: branches/arwinss/arwinss/include/server.h URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/arwinss/include/server.…
Removed: branches/arwinss/arwinss/include/server_protocol.h URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/arwinss/include/server_…
Modified: branches/arwinss/arwinss/server/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/arwinss/server/CMakeLis…
12 years, 3 months
1
0
0
0
[akhaldi] 57395: * Revert r57394 as per Mike's request.
by akhaldi@svn.reactos.org
Author: akhaldi Date: Wed Sep 26 19:38:42 2012 New Revision: 57395 URL:
http://svn.reactos.org/svn/reactos?rev=57395&view=rev
Log: * Revert r57394 as per Mike's request. Removed: trunk/reactos/lib/3rdparty/libwin-iconv/ Modified: trunk/reactos/lib/3rdparty/CMakeLists.txt trunk/reactos/lib/3rdparty/libxml2/CMakeLists.txt Modified: trunk/reactos/lib/3rdparty/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/3rdparty/CMakeLists.tx…
============================================================================== --- trunk/reactos/lib/3rdparty/CMakeLists.txt [iso-8859-1] (original) +++ trunk/reactos/lib/3rdparty/CMakeLists.txt [iso-8859-1] Wed Sep 26 19:38:42 2012 @@ -8,7 +8,6 @@ add_subdirectory(libmpg123) add_subdirectory(libsamplerate) add_subdirectory(libwine) -add_subdirectory(libwin-iconv) add_subdirectory(libxml2) # add_subdirectory(stlport) FIXME: Add proper STL support add_subdirectory(zlib) Modified: trunk/reactos/lib/3rdparty/libxml2/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/3rdparty/libxml2/CMake…
============================================================================== --- trunk/reactos/lib/3rdparty/libxml2/CMakeLists.txt [iso-8859-1] (original) +++ trunk/reactos/lib/3rdparty/libxml2/CMakeLists.txt [iso-8859-1] Wed Sep 26 19:38:42 2012 @@ -1,7 +1,5 @@ -include_directories( - include - ${REACTOS_SOURCE_DIR}/lib/3rdparty/libwin-iconv) +include_directories(include) add_definitions( -D__MINGW32__ @@ -12,8 +10,6 @@ -D_WINDOWS -DWIN32 -DHAVE_CONFIG_H - -DLIBXML_ICONV_ENABLED - -DICONV_CONST=const -D_DLL -D__USE_CRTIMP) list(APPEND SOURCE
12 years, 3 months
1
0
0
0
[mnordell] 57394: [LIB:3RDPARTY] Add iconv.
by mnordell@svn.reactos.org
Author: mnordell Date: Wed Sep 26 19:18:13 2012 New Revision: 57394 URL:
http://svn.reactos.org/svn/reactos?rev=57394&view=rev
Log: [LIB:3RDPARTY] Add iconv. Added: trunk/reactos/lib/3rdparty/libwin-iconv/ trunk/reactos/lib/3rdparty/libwin-iconv/CMakeLists.txt (with props) trunk/reactos/lib/3rdparty/libwin-iconv/ChangeLog trunk/reactos/lib/3rdparty/libwin-iconv/FindWcecompat.cmake trunk/reactos/lib/3rdparty/libwin-iconv/Makefile trunk/reactos/lib/3rdparty/libwin-iconv/iconv.def (with props) trunk/reactos/lib/3rdparty/libwin-iconv/iconv.h (with props) trunk/reactos/lib/3rdparty/libwin-iconv/mlang.def (with props) trunk/reactos/lib/3rdparty/libwin-iconv/mlang.h (with props) trunk/reactos/lib/3rdparty/libwin-iconv/readme.txt (with props) trunk/reactos/lib/3rdparty/libwin-iconv/win_iconv.c (with props) trunk/reactos/lib/3rdparty/libwin-iconv/win_iconv_test.c (with props) Modified: trunk/reactos/lib/3rdparty/CMakeLists.txt trunk/reactos/lib/3rdparty/libxml2/CMakeLists.txt Modified: trunk/reactos/lib/3rdparty/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/3rdparty/CMakeLists.tx…
============================================================================== --- trunk/reactos/lib/3rdparty/CMakeLists.txt [iso-8859-1] (original) +++ trunk/reactos/lib/3rdparty/CMakeLists.txt [iso-8859-1] Wed Sep 26 19:18:13 2012 @@ -8,6 +8,7 @@ add_subdirectory(libmpg123) add_subdirectory(libsamplerate) add_subdirectory(libwine) +add_subdirectory(libwin-iconv) add_subdirectory(libxml2) # add_subdirectory(stlport) FIXME: Add proper STL support add_subdirectory(zlib) Added: trunk/reactos/lib/3rdparty/libwin-iconv/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/3rdparty/libwin-iconv/…
============================================================================== --- trunk/reactos/lib/3rdparty/libwin-iconv/CMakeLists.txt (added) +++ trunk/reactos/lib/3rdparty/libwin-iconv/CMakeLists.txt [iso-8859-1] Wed Sep 26 19:18:13 2012 @@ -1,0 +1,9 @@ + +if(MSVC) + add_definitions(-D_CRT_SECURE_NO_WARNINGS) +endif() + +add_library(iconv-static STATIC win_iconv.c) +set_target_properties(iconv-static PROPERTIES OUTPUT_NAME "iconv") +add_dependencies(iconv-static psdk) + Propchange: trunk/reactos/lib/3rdparty/libwin-iconv/CMakeLists.txt ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/lib/3rdparty/libwin-iconv/ChangeLog URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/3rdparty/libwin-iconv/…
============================================================================== --- trunk/reactos/lib/3rdparty/libwin-iconv/ChangeLog (added) +++ trunk/reactos/lib/3rdparty/libwin-iconv/ChangeLog [iso-8859-1] Wed Sep 26 19:18:13 2012 @@ -1,0 +1,139 @@ +2012-09-19 Yukihiro Nakadaira + + * iconv.h, win_iconv.c, win_iconv_test.c: Change iconv(3) prototype. + "const char **inbuf" -> "char **inbuf" + (Issue 8) + + * win_iconv.c: Change to not use TEXT macro for GetProcAddress. + (Issue 17) (Thanks to EPienkowskia) + + * win_iconv_test.c: Fix for -DUNICODE. Use GetModuleFileNameA. + +2011-10-28 Yukihiro Nakadaira + + * win_iconv.c: Add UCS-2. + (Issue 14) (Thanks to j.g.rennison) + +2011-10-24 Yukihiro Nakadaira + + * win_iconv.c: Add Big5-HKSCS alias. + (Issue 13) (Thanks to timothy.ty.lee) + +2011-09-06 Yukihiro Nakadaira + + * Makefile: Improvement of the creation of the DLL. + (Issue 10) (Thanks to vincent.torri) + +2011-08-19 Yukihiro Nakadaira + + * win_iconv.c: Fixed a bug that assumption that + sizeof(DWORD)==sizeof(void*) in find_imported_module_by_funcname. + (Issue 7) (Thanks to j.g.rennison) + +2011-08-13 Yukihiro Nakadaira + + * win_iconv.c, win_iconv_test.c: Fixed a bug that //translit + flag does not work when transliterating to the default + character. + (Issue 9) (Thanks to j.g.rennison) + +2011-07-26 Yukihiro Nakadaira + + * CMakeLists.txt: fix dll name with mingw. + (Issue 6) (Thanks to kalevlember) + + +2011-05-19 Yukihiro Nakadaira + + * win_iconv.c: Add some more UCS aliases. + Merge from Tor Lillqvist version. + (Issue 4) (Thanks to mkbosmans) + +2011-05-15 Yukihiro Nakadaira + + * Makefile: use variable for tools in Makefile + (Issue 3) (Thanks to mkbosmans) + +2011-01-13 Yukihiro Nakadaira + + * win_iconv_test.c: Removed unused variable. + + * win_iconv_test.c: Added USE_ICONV_H flag to compile with -liconv. + (Issue 2) (Thanks to amorilia.gamebox) + +2010-04-14 Patrick von Reth + + * added c++ support + +2010-03-28 Patrick Spendrin + + * CMakeLists.txt, win_iconv.c: add CMake buildsystem, fix bug from issue tracker + +2009-07-25 Yukihiro Nakadaira + + * win_iconv.c, readme.txt: doc fix + +2009-07-06 Yukihiro Nakadaira + + * win_iconv.c, Makefile, readme.txt: doc fix + +2009-06-19 Yukihiro Nakadaira + + * win_iconv.c: cosmetic change + * win_iconv.c: Change Unicode BOM behavior + 1. Remove the BOM when "fromcode" is utf-16 or utf-32. + 2. Add the BOM when "tocode" is utf-16 or utf-32. + +2009-06-18 Yukihiro Nakadaira + + * win_iconv.c: Fixed a bug that invalid input may cause an + endless loop + +2009-06-18 Yukihiro Nakadaira + + * win_iconv.c: Fixed a bug that libiconv_iconv_open() doesn't + work (Christophe Benoit) + +2008-04-01 Yukihiro Nakadaira + + * win_iconv.c: Added //TRANSLIT option. +
http://bugzilla.gnome.org/show_bug.cgi?id=524314
+ +2008-03-20 Yukihiro Nakadaira + + * win_iconv.c: The dwFlags parameter to MultiByteToWideChars() + must be zero for some code pages (Tor Lillqvist) + +2008-03-19 Yukihiro Nakadaira + + * win_iconv.c: Added support for UCS-2 and GB18030 (Tor Lillqvist) + +2007-12-03 Yukihiro Nakadaira + + * iconv.h: #include <stddef.h> to use size_t + +2007-11-28 Yukihiro Nakadaira + + * win_iconv.c: bug fix for two things (Tor Lillqvist) + 1) This is probably not important: Add a function + must_use_null_useddefaultchar() that checks for those + codepages for which the docs for WideCharToMultiByte() say + one has to use a NULL lpDefaultChar pointer. Don't know if + this is actually needed, but better to be safe than sorry. + 2) This is essential: In kernel_wctomb(), the code should first + check if bufsize is zero, and return the E2BIG error in that + case. + +2007-11-26 Yukihiro Nakadaira + + * win_iconv.c: ISO-8859-1 should be CP28591, not CP1252 (Tor + Lillqvist) + +2007-11-26 Yukihiro Nakadaira + + * win_iconv.c: patch from Tor Lillqvist (with alteration) + +2007-09-04 Yukihiro Nakadaira + + * : Initial import + Added: trunk/reactos/lib/3rdparty/libwin-iconv/FindWcecompat.cmake URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/3rdparty/libwin-iconv/…
============================================================================== --- trunk/reactos/lib/3rdparty/libwin-iconv/FindWcecompat.cmake (added) +++ trunk/reactos/lib/3rdparty/libwin-iconv/FindWcecompat.cmake [iso-8859-1] Wed Sep 26 19:18:13 2012 @@ -1,0 +1,33 @@ +# Try to find Wcecompat functionality +# Once done this will define +# +# WCECOMPAT_FOUND - system has Wcecompat +# WCECOMPAT_INCLUDE_DIR - Wcecompat include directory +# WCECOMPAT_LIBRARIES - Libraries needed to use Wcecompat +# +# Copyright (c) 2010, Andreas Holzammer, <andy(a)kdab.com> +# +# Redistribution and use is allowed according to the terms of the BSD license. + +if(WCECOMPAT_INCLUDE_DIR AND WCECOMPAT_LIB_FOUND) + set(Wcecompat_FIND_QUIETLY TRUE) +endif(WCECOMPAT_INCLUDE_DIR AND WCECOMPAT_LIB_FOUND) + +find_path(WCECOMPAT_INCLUDE_DIR errno.h PATH_SUFFIXES wcecompat) + +set(WCECOMPAT_LIB_FOUND FALSE) + +if(WCECOMPAT_INCLUDE_DIR) + find_library(WCECOMPAT_LIBRARIES NAMES wcecompat wcecompatex ) + if(WCECOMPAT_LIBRARIES) + set(WCECOMPAT_LIB_FOUND TRUE) + endif(WCECOMPAT_LIBRARIES) +endif(WCECOMPAT_INCLUDE_DIR) + +# I have no idea what this is about, but it seems to be used quite often, so I add this here +set(WCECOMPAT_CONST const) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(Wcecompat DEFAULT_MSG WCECOMPAT_LIBRARIES WCECOMPAT_LIB_FOUND) + +mark_as_advanced(WCECOMPAT_INCLUDE_DIR WCECOMPAT_LIBRARIES WCECOMPAT_CONST WCECOMPAT_LIB_FOUND) Added: trunk/reactos/lib/3rdparty/libwin-iconv/Makefile URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/3rdparty/libwin-iconv/…
============================================================================== --- trunk/reactos/lib/3rdparty/libwin-iconv/Makefile (added) +++ trunk/reactos/lib/3rdparty/libwin-iconv/Makefile [iso-8859-1] Wed Sep 26 19:18:13 2012 @@ -1,0 +1,76 @@ +CC ?= gcc +AR ?= ar +RANLIB ?= ranlib +DLLTOOL ?= dlltool + +# comma separated list (e.g. "iconv.dll,libiconv.dll") +DEFAULT_LIBICONV_DLL ?= \"\" + +CFLAGS += -pedantic -Wall +CFLAGS += -DUSE_LIBICONV_DLL +CFLAGS += -DDEFAULT_LIBICONV_DLL=$(DEFAULT_LIBICONV_DLL) + +all: iconv.dll libiconv.a win_iconv.exe + +dist: test win_iconv.zip + +iconv.dll: win_iconv.c + $(CC) $(CFLAGS) -c win_iconv.c -DMAKE_DLL + $(CC) -shared -o iconv.dll -Wl,-s -Wl,--out-implib=libiconv.dll.a -Wl,--export-all-symbols win_iconv.o $(SPECS_FLAGS) + +libiconv.a: win_iconv.c + $(CC) $(CFLAGS) -c win_iconv.c + $(AR) rcs libiconv.a win_iconv.o + $(RANLIB) libiconv.a + +win_iconv.exe: win_iconv.c + $(CC) $(CFLAGS) -s -o win_iconv.exe win_iconv.c -DMAKE_EXE + +libmlang.a: mlang.def + $(DLLTOOL) --kill-at --input-def mlang.def --output-lib libmlang.a + +test: + $(CC) $(CFLAGS) -s -o win_iconv_test.exe win_iconv_test.c + ./win_iconv_test.exe + +win_iconv.zip: msvcrt msvcr70 msvcr71 + rm -rf win_iconv + svn export . win_iconv + cp msvcrt/iconv.dll msvcrt/win_iconv.exe win_iconv/ + mkdir win_iconv/msvcr70 + cp msvcr70/iconv.dll win_iconv/msvcr70/ + mkdir win_iconv/msvcr71 + cp msvcr71/iconv.dll win_iconv/msvcr71/ + zip -r win_iconv.zip win_iconv + +msvcrt: + svn export . msvcrt; \ + cd msvcrt; \ + $(MAKE); + +msvcr70: + svn export . msvcr70; \ + cd msvcr70; \ + gcc -dumpspecs | sed s/-lmsvcrt/-lmsvcr70/ > specs; \ + $(MAKE) "SPECS_FLAGS=-specs=$$PWD/specs"; + +msvcr71: + svn export . msvcr71; \ + cd msvcr71; \ + gcc -dumpspecs | sed s/-lmsvcrt/-lmsvcr71/ > specs; \ + $(MAKE) "SPECS_FLAGS=-specs=$$PWD/specs"; + +clean: + rm -f win_iconv.exe + rm -f win_iconv.o + rm -f iconv.dll* + rm -f libiconv.a + rm -f libiconv.dll + rm -f win_iconv_test.exe + rm -f libmlang.a + rm -rf win_iconv + rm -rf win_iconv.zip + rm -rf msvcrt + rm -rf msvcr70 + rm -rf msvcr71 + Added: trunk/reactos/lib/3rdparty/libwin-iconv/iconv.def URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/3rdparty/libwin-iconv/…
============================================================================== --- trunk/reactos/lib/3rdparty/libwin-iconv/iconv.def (added) +++ trunk/reactos/lib/3rdparty/libwin-iconv/iconv.def [iso-8859-1] Wed Sep 26 19:18:13 2012 @@ -1,0 +1,23 @@ +EXPORTS + iconv + iconv_open + iconv_close + iconvctl + libiconv=iconv + libiconv_open=iconv_open + libiconv_close=iconv_close + libiconvctl=iconvctl +;; libiconv-1.11.dll +;; TODO for binary compatibility +; _libiconv_version @1 +; aliases2_lookup @2 +; aliases_lookup @3 +; iconv_canonicalize @4 +; libiconv @5 +; libiconv_close @6 +; libiconv_open @7 +; libiconv_relocate @8 +; libiconv_set_relocation_prefix @9 +; libiconvctl @10 +; libiconvlist @11 +; locale_charset @12 Propchange: trunk/reactos/lib/3rdparty/libwin-iconv/iconv.def ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/lib/3rdparty/libwin-iconv/iconv.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/3rdparty/libwin-iconv/…
============================================================================== --- trunk/reactos/lib/3rdparty/libwin-iconv/iconv.h (added) +++ trunk/reactos/lib/3rdparty/libwin-iconv/iconv.h [iso-8859-1] Wed Sep 26 19:18:13 2012 @@ -1,0 +1,14 @@ +#ifndef _LIBICONV_H +#define _LIBICONV_H +#include <stddef.h> +#ifdef __cplusplus +extern "C" { +#endif +typedef void* iconv_t; +iconv_t iconv_open(const char *tocode, const char *fromcode); +int iconv_close(iconv_t cd); +size_t iconv(iconv_t cd, char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft); +#ifdef __cplusplus +} +#endif +#endif//_LIBICONV_H Propchange: trunk/reactos/lib/3rdparty/libwin-iconv/iconv.h ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/lib/3rdparty/libwin-iconv/mlang.def URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/3rdparty/libwin-iconv/…
============================================================================== --- trunk/reactos/lib/3rdparty/libwin-iconv/mlang.def (added) +++ trunk/reactos/lib/3rdparty/libwin-iconv/mlang.def [iso-8859-1] Wed Sep 26 19:18:13 2012 @@ -1,0 +1,11 @@ +LIBRARY MLANG.DLL +EXPORTS + ConvertINetMultiByteToUnicode@24 + ;; ConvertINetReset (not documented) + ConvertINetString@28 + ConvertINetUnicodeToMultiByte@24 + IsConvertINetStringAvailable@8 + LcidToRfc1766A@12 + LcidToRfc1766W@12 + Rfc1766ToLcidA@8 + Rfc1766ToLcidW@8 Propchange: trunk/reactos/lib/3rdparty/libwin-iconv/mlang.def ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/lib/3rdparty/libwin-iconv/mlang.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/3rdparty/libwin-iconv/…
============================================================================== --- trunk/reactos/lib/3rdparty/libwin-iconv/mlang.h (added) +++ trunk/reactos/lib/3rdparty/libwin-iconv/mlang.h [iso-8859-1] Wed Sep 26 19:18:13 2012 @@ -1,0 +1,54 @@ +HRESULT WINAPI ConvertINetString( + LPDWORD lpdwMode, + DWORD dwSrcEncoding, + DWORD dwDstEncoding, + LPCSTR lpSrcStr, + LPINT lpnSrcSize, + LPBYTE lpDstStr, + LPINT lpnDstSize +); + +HRESULT WINAPI ConvertINetMultiByteToUnicode( + LPDWORD lpdwMode, + DWORD dwSrcEncoding, + LPCSTR lpSrcStr, + LPINT lpnMultiCharCount, + LPWSTR lpDstStr, + LPINT lpnWideCharCount +); + +HRESULT WINAPI ConvertINetUnicodeToMultiByte( + LPDWORD lpdwMode, + DWORD dwEncoding, + LPCWSTR lpSrcStr, + LPINT lpnWideCharCount, + LPSTR lpDstStr, + LPINT lpnMultiCharCount +); + +HRESULT WINAPI IsConvertINetStringAvailable( + DWORD dwSrcEncoding, + DWORD dwDstEncoding +); + +HRESULT WINAPI LcidToRfc1766A( + LCID Locale, + LPSTR pszRfc1766, + int nChar +); + +HRESULT WINAPI LcidToRfc1766W( + LCID Locale, + LPWSTR pszRfc1766, + int nChar +); + +HRESULT WINAPI Rfc1766ToLcidA( + LCID *pLocale, + LPSTR pszRfc1766 +); + +HRESULT WINAPI Rfc1766ToLcidW( + LCID *pLocale, + LPWSTR pszRfc1766 +); Propchange: trunk/reactos/lib/3rdparty/libwin-iconv/mlang.h ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/lib/3rdparty/libwin-iconv/readme.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/3rdparty/libwin-iconv/…
============================================================================== --- trunk/reactos/lib/3rdparty/libwin-iconv/readme.txt (added) +++ trunk/reactos/lib/3rdparty/libwin-iconv/readme.txt [iso-8859-1] Wed Sep 26 19:18:13 2012 @@ -1,0 +1,20 @@ +win_iconv is a iconv implementation using Win32 API to convert. + +win_iconv is placed in the public domain. + +ENVIRONMENT VARIABLE: + WINICONV_LIBICONV_DLL + If $WINICONV_LIBICONV_DLL is set, win_iconv uses the DLL. If + loading the DLL or iconv_open() failed, falls back to internal + conversion. If a few DLL are specified as comma separated list, + the first loadable DLL is used. The DLL should have + iconv_open(), iconv_close() and iconv(). Or libiconv_open(), + libiconv_close() and libiconv(). + (only available when USE_LIBICONV_DLL is defined at compile time) + +Win32 API does not support strict encoding conversion for some codepage. +And MLang function drop or replace invalid bytes and does not return +useful error status as iconv. This implementation cannot be used for +encoding validation purpose. + +Yukihiro Nakadaira <yukihiro.nakadaira(a)gmail.com> Propchange: trunk/reactos/lib/3rdparty/libwin-iconv/readme.txt ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/lib/3rdparty/libwin-iconv/win_iconv.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/3rdparty/libwin-iconv/…
============================================================================== --- trunk/reactos/lib/3rdparty/libwin-iconv/win_iconv.c (added) +++ trunk/reactos/lib/3rdparty/libwin-iconv/win_iconv.c [iso-8859-1] Wed Sep 26 19:18:13 2012 @@ -1,0 +1,1994 @@ +/* + * iconv implementation using Win32 API to convert. + * + * This file is placed in the public domain. + */ + +/* for WC_NO_BEST_FIT_CHARS */ +#ifndef WINVER +# define WINVER 0x0500 +#endif + +#define STRICT +#include <windows.h> +#include <errno.h> +#include <string.h> +#include <stdlib.h> + +/* WORKAROUND: */ +#ifndef UNDER_CE +#define GetProcAddressA GetProcAddress +#endif + +#if 0 +# define MAKE_EXE +# define MAKE_DLL +# define USE_LIBICONV_DLL +#endif + +#if !defined(DEFAULT_LIBICONV_DLL) +# define DEFAULT_LIBICONV_DLL "" +#endif + +#define MB_CHAR_MAX 16 + +#define UNICODE_MODE_BOM_DONE 1 +#define UNICODE_MODE_SWAPPED 2 + +#define FLAG_USE_BOM 1 +#define FLAG_TRANSLIT 2 /* //TRANSLIT */ +#define FLAG_IGNORE 4 /* //IGNORE (not implemented) */ + +typedef unsigned char uchar; +typedef unsigned short ushort; +typedef unsigned int uint; + +typedef void* iconv_t; + +iconv_t iconv_open(const char *tocode, const char *fromcode); +int iconv_close(iconv_t cd); +size_t iconv(iconv_t cd, char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft); + +/* libiconv interface for vim */ +#if defined(MAKE_DLL) +int +iconvctl (iconv_t cd, int request, void* argument) +{ + /* not supported */ + return 0; +} +#endif + +typedef struct compat_t compat_t; +typedef struct csconv_t csconv_t; +typedef struct rec_iconv_t rec_iconv_t; + +typedef iconv_t (*f_iconv_open)(const char *tocode, const char *fromcode); +typedef int (*f_iconv_close)(iconv_t cd); +typedef size_t (*f_iconv)(iconv_t cd, char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft); +typedef int* (*f_errno)(void); +typedef int (*f_mbtowc)(csconv_t *cv, const uchar *buf, int bufsize, ushort *wbuf, int *wbufsize); +typedef int (*f_wctomb)(csconv_t *cv, ushort *wbuf, int wbufsize, uchar *buf, int bufsize); +typedef int (*f_mblen)(csconv_t *cv, const uchar *buf, int bufsize); +typedef int (*f_flush)(csconv_t *cv, uchar *buf, int bufsize); + +#define COMPAT_IN 1 +#define COMPAT_OUT 2 + +/* unicode mapping for compatibility with other conversion table. */ +struct compat_t { + uint in; + uint out; + uint flag; +}; + +struct csconv_t { + int codepage; + int flags; + f_mbtowc mbtowc; + f_wctomb wctomb; + f_mblen mblen; + f_flush flush; + DWORD mode; + compat_t *compat; +}; + +struct rec_iconv_t { + iconv_t cd; + f_iconv_close iconv_close; + f_iconv iconv; + f_errno _errno; + csconv_t from; + csconv_t to; +#if defined(USE_LIBICONV_DLL) + HMODULE hlibiconv; +#endif +}; + +static int win_iconv_open(rec_iconv_t *cd, const char *tocode, const char *fromcode); +static int win_iconv_close(iconv_t cd); +static size_t win_iconv(iconv_t cd, char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft); + +static int load_mlang(); +static int make_csconv(const char *name, csconv_t *cv); +static int name_to_codepage(const char *name); +static uint utf16_to_ucs4(const ushort *wbuf); +static void ucs4_to_utf16(uint wc, ushort *wbuf, int *wbufsize); +static int mbtowc_flags(int codepage); +static int must_use_null_useddefaultchar(int codepage); +static char *strrstr(const char *str, const char *token); +static char *xstrndup(const char *s, size_t n); +static int seterror(int err); + +#if defined(USE_LIBICONV_DLL) +static int libiconv_iconv_open(rec_iconv_t *cd, const char *tocode, const char *fromcode); +static PVOID MyImageDirectoryEntryToData(LPVOID Base, BOOLEAN MappedAsImage, USHORT DirectoryEntry, PULONG Size); +static HMODULE find_imported_module_by_funcname(HMODULE hModule, const char *funcname); + +static HMODULE hwiniconv; +#endif + +static int sbcs_mblen(csconv_t *cv, const uchar *buf, int bufsize); +static int dbcs_mblen(csconv_t *cv, const uchar *buf, int bufsize); +static int mbcs_mblen(csconv_t *cv, const uchar *buf, int bufsize); +static int utf8_mblen(csconv_t *cv, const uchar *buf, int bufsize); +static int eucjp_mblen(csconv_t *cv, const uchar *buf, int bufsize); + +static int kernel_mbtowc(csconv_t *cv, const uchar *buf, int bufsize, ushort *wbuf, int *wbufsize); +static int kernel_wctomb(csconv_t *cv, ushort *wbuf, int wbufsize, uchar *buf, int bufsize); +static int mlang_mbtowc(csconv_t *cv, const uchar *buf, int bufsize, ushort *wbuf, int *wbufsize); +static int mlang_wctomb(csconv_t *cv, ushort *wbuf, int wbufsize, uchar *buf, int bufsize); +static int utf16_mbtowc(csconv_t *cv, const uchar *buf, int bufsize, ushort *wbuf, int *wbufsize); +static int utf16_wctomb(csconv_t *cv, ushort *wbuf, int wbufsize, uchar *buf, int bufsize); +static int utf32_mbtowc(csconv_t *cv, const uchar *buf, int bufsize, ushort *wbuf, int *wbufsize); +static int utf32_wctomb(csconv_t *cv, ushort *wbuf, int wbufsize, uchar *buf, int bufsize); +static int iso2022jp_mbtowc(csconv_t *cv, const uchar *buf, int bufsize, ushort *wbuf, int *wbufsize); +static int iso2022jp_wctomb(csconv_t *cv, ushort *wbuf, int wbufsize, uchar *buf, int bufsize); +static int iso2022jp_flush(csconv_t *cv, uchar *buf, int bufsize); + +static struct { + int codepage; + const char *name; +} codepage_alias[] = { + {65001, "CP65001"}, + {65001, "UTF8"}, + {65001, "UTF-8"}, + + {1200, "CP1200"}, + {1200, "UTF16LE"}, + {1200, "UTF-16LE"}, + {1200, "UCS2LE"}, + {1200, "UCS-2LE"}, + + {1201, "CP1201"}, + {1201, "UTF16BE"}, + {1201, "UTF-16BE"}, + {1201, "UCS2BE"}, + {1201, "UCS-2BE"}, + {1201, "unicodeFFFE"}, + + {12000, "CP12000"}, + {12000, "UTF32LE"}, + {12000, "UTF-32LE"}, + {12000, "UCS4LE"}, + {12000, "UCS-4LE"}, + + {12001, "CP12001"}, + {12001, "UTF32BE"}, + {12001, "UTF-32BE"}, + {12001, "UCS4BE"}, + {12001, "UCS-4BE"}, + +#ifndef GLIB_COMPILATION + /* + * Default is big endian. + * See rfc2781 4.3 Interpreting text labelled as UTF-16. + */ + {1201, "UTF16"}, + {1201, "UTF-16"}, + {1201, "UCS2"}, + {1201, "UCS-2"}, + {12001, "UTF32"}, + {12001, "UTF-32"}, + {12001, "UCS-4"}, + {12001, "UCS4"}, +#else + /* Default is little endian, because the platform is */ + {1200, "UTF16"}, + {1200, "UTF-16"}, + {1200, "UCS2"}, + {1200, "UCS-2"}, + {12000, "UTF32"}, + {12000, "UTF-32"}, + {12000, "UCS4"}, + {12000, "UCS-4"}, +#endif + + /* copy from libiconv `iconv -l` */ + /* !IsValidCodePage(367) */ + {20127, "ANSI_X3.4-1968"}, + {20127, "ANSI_X3.4-1986"}, + {20127, "ASCII"}, + {20127, "CP367"}, + {20127, "IBM367"}, + {20127, "ISO-IR-6"}, + {20127, "ISO646-US"}, + {20127, "ISO_646.IRV:1991"}, + {20127, "US"}, + {20127, "US-ASCII"}, + {20127, "CSASCII"}, + + /* !IsValidCodePage(819) */ + {1252, "CP819"}, + {1252, "IBM819"}, + {28591, "ISO-8859-1"}, + {28591, "ISO-IR-100"}, + {28591, "ISO8859-1"}, + {28591, "ISO_8859-1"}, + {28591, "ISO_8859-1:1987"}, + {28591, "L1"}, + {28591, "LATIN1"}, + {28591, "CSISOLATIN1"}, + + {1250, "CP1250"}, + {1250, "MS-EE"}, + {1250, "WINDOWS-1250"}, + + {1251, "CP1251"}, + {1251, "MS-CYRL"}, + {1251, "WINDOWS-1251"}, + + {1252, "CP1252"}, + {1252, "MS-ANSI"}, + {1252, "WINDOWS-1252"}, + + {1253, "CP1253"}, + {1253, "MS-GREEK"}, + {1253, "WINDOWS-1253"}, + + {1254, "CP1254"}, + {1254, "MS-TURK"}, + {1254, "WINDOWS-1254"}, + + {1255, "CP1255"}, + {1255, "MS-HEBR"}, + {1255, "WINDOWS-1255"}, + + {1256, "CP1256"}, + {1256, "MS-ARAB"}, + {1256, "WINDOWS-1256"}, + + {1257, "CP1257"}, + {1257, "WINBALTRIM"}, + {1257, "WINDOWS-1257"}, + + {1258, "CP1258"}, + {1258, "WINDOWS-1258"}, + + {850, "850"}, + {850, "CP850"}, + {850, "IBM850"}, + {850, "CSPC850MULTILINGUAL"}, + + /* !IsValidCodePage(862) */ + {862, "862"}, + {862, "CP862"}, + {862, "IBM862"}, + {862, "CSPC862LATINHEBREW"}, + + {866, "866"}, + {866, "CP866"}, + {866, "IBM866"}, + {866, "CSIBM866"}, + + /* !IsValidCodePage(154) */ + {154, "CP154"}, + {154, "CYRILLIC-ASIAN"}, + {154, "PT154"}, + {154, "PTCP154"}, + {154, "CSPTCP154"}, + + /* !IsValidCodePage(1133) */ + {1133, "CP1133"}, + {1133, "IBM-CP1133"}, + + {874, "CP874"}, + {874, "WINDOWS-874"}, + + /* !IsValidCodePage(51932) */ + {51932, "CP51932"}, + {51932, "MS51932"}, + {51932, "WINDOWS-51932"}, + {51932, "EUC-JP"}, + + {932, "CP932"}, + {932, "MS932"}, + {932, "SHIFFT_JIS"}, + {932, "SHIFFT_JIS-MS"}, + {932, "SJIS"}, + {932, "SJIS-MS"}, + {932, "SJIS-OPEN"}, + {932, "SJIS-WIN"}, + {932, "WINDOWS-31J"}, + {932, "WINDOWS-932"}, + {932, "CSWINDOWS31J"}, + + {50221, "CP50221"}, + {50221, "ISO-2022-JP"}, + {50221, "ISO-2022-JP-MS"}, + {50221, "ISO2022-JP"}, + {50221, "ISO2022-JP-MS"}, + {50221, "MS50221"}, + {50221, "WINDOWS-50221"}, + + {936, "CP936"}, + {936, "GBK"}, + {936, "MS936"}, + {936, "WINDOWS-936"}, + + {950, "CP950"}, + {950, "BIG5"}, + {950, "BIG5HKSCS"}, + {950, "BIG5-HKSCS"}, + + {949, "CP949"}, + {949, "UHC"}, + {949, "EUC-KR"}, + + {1361, "CP1361"}, + {1361, "JOHAB"}, + + {437, "437"}, + {437, "CP437"}, + {437, "IBM437"}, + {437, "CSPC8CODEPAGE437"}, + + {737, "CP737"}, + + {775, "CP775"}, + {775, "IBM775"}, + {775, "CSPC775BALTIC"}, + + {852, "852"}, + {852, "CP852"}, + {852, "IBM852"}, + {852, "CSPCP852"}, + + /* !IsValidCodePage(853) */ + {853, "CP853"}, + + {855, "855"}, + {855, "CP855"}, + {855, "IBM855"}, + {855, "CSIBM855"}, + + {857, "857"}, + {857, "CP857"}, + {857, "IBM857"}, + {857, "CSIBM857"}, + + /* !IsValidCodePage(858) */ + {858, "CP858"}, + + {860, "860"}, + {860, "CP860"}, + {860, "IBM860"}, + {860, "CSIBM860"}, + + {861, "861"}, + {861, "CP-IS"}, + {861, "CP861"}, + {861, "IBM861"}, + {861, "CSIBM861"}, + + {863, "863"}, + {863, "CP863"}, + {863, "IBM863"}, + {863, "CSIBM863"}, + + {864, "CP864"}, + {864, "IBM864"}, + {864, "CSIBM864"}, + + {865, "865"}, + {865, "CP865"}, + {865, "IBM865"}, + {865, "CSIBM865"}, + + {869, "869"}, + {869, "CP-GR"}, + {869, "CP869"}, + {869, "IBM869"}, + {869, "CSIBM869"}, + + /* !IsValidCodePage(1152) */ + {1125, "CP1125"}, + + /* + * Code Page Identifiers + *
http://msdn2.microsoft.com/en-us/library/ms776446.aspx
+ */ + {37, "IBM037"}, /* IBM EBCDIC US-Canada */ + {437, "IBM437"}, /* OEM United States */ + {500, "IBM500"}, /* IBM EBCDIC International */ + {708, "ASMO-708"}, /* Arabic (ASMO 708) */ + /* 709 Arabic (ASMO-449+, BCON V4) */ + /* 710 Arabic - Transparent Arabic */ + {720, "DOS-720"}, /* Arabic (Transparent ASMO); Arabic (DOS) */ + {737, "ibm737"}, /* OEM Greek (formerly 437G); Greek (DOS) */ + {775, "ibm775"}, /* OEM Baltic; Baltic (DOS) */ + {850, "ibm850"}, /* OEM Multilingual Latin 1; Western European (DOS) */ + {852, "ibm852"}, /* OEM Latin 2; Central European (DOS) */ + {855, "IBM855"}, /* OEM Cyrillic (primarily Russian) */ + {857, "ibm857"}, /* OEM Turkish; Turkish (DOS) */ + {858, "IBM00858"}, /* OEM Multilingual Latin 1 + Euro symbol */ + {860, "IBM860"}, /* OEM Portuguese; Portuguese (DOS) */ + {861, "ibm861"}, /* OEM Icelandic; Icelandic (DOS) */ + {862, "DOS-862"}, /* OEM Hebrew; Hebrew (DOS) */ + {863, "IBM863"}, /* OEM French Canadian; French Canadian (DOS) */ + {864, "IBM864"}, /* OEM Arabic; Arabic (864) */ + {865, "IBM865"}, /* OEM Nordic; Nordic (DOS) */ + {866, "cp866"}, /* OEM Russian; Cyrillic (DOS) */ + {869, "ibm869"}, /* OEM Modern Greek; Greek, Modern (DOS) */ + {870, "IBM870"}, /* IBM EBCDIC Multilingual/ROECE (Latin 2); IBM EBCDIC Multilingual Latin 2 */ + {874, "windows-874"}, /* ANSI/OEM Thai (same as 28605, ISO 8859-15); Thai (Windows) */ + {875, "cp875"}, /* IBM EBCDIC Greek Modern */ + {932, "shift_jis"}, /* ANSI/OEM Japanese; Japanese (Shift-JIS) */ + {932, "shift-jis"}, /* alternative name for it */ + {936, "gb2312"}, /* ANSI/OEM Simplified Chinese (PRC, Singapore); Chinese Simplified (GB2312) */ + {949, "ks_c_5601-1987"}, /* ANSI/OEM Korean (Unified Hangul Code) */ + {950, "big5"}, /* ANSI/OEM Traditional Chinese (Taiwan; Hong Kong SAR, PRC); Chinese Traditional (Big5) */ + {950, "big5hkscs"}, /* ANSI/OEM Traditional Chinese (Hong Kong SAR); Chinese Traditional (Big5-HKSCS) */ + {950, "big5-hkscs"}, /* alternative name for it */ + {1026, "IBM1026"}, /* IBM EBCDIC Turkish (Latin 5) */ + {1047, "IBM01047"}, /* IBM EBCDIC Latin 1/Open System */ + {1140, "IBM01140"}, /* IBM EBCDIC US-Canada (037 + Euro symbol); IBM EBCDIC (US-Canada-Euro) */ + {1141, "IBM01141"}, /* IBM EBCDIC Germany (20273 + Euro symbol); IBM EBCDIC (Germany-Euro) */ + {1142, "IBM01142"}, /* IBM EBCDIC Denmark-Norway (20277 + Euro symbol); IBM EBCDIC (Denmark-Norway-Euro) */ + {1143, "IBM01143"}, /* IBM EBCDIC Finland-Sweden (20278 + Euro symbol); IBM EBCDIC (Finland-Sweden-Euro) */ + {1144, "IBM01144"}, /* IBM EBCDIC Italy (20280 + Euro symbol); IBM EBCDIC (Italy-Euro) */ + {1145, "IBM01145"}, /* IBM EBCDIC Latin America-Spain (20284 + Euro symbol); IBM EBCDIC (Spain-Euro) */ + {1146, "IBM01146"}, /* IBM EBCDIC United Kingdom (20285 + Euro symbol); IBM EBCDIC (UK-Euro) */ + {1147, "IBM01147"}, /* IBM EBCDIC France (20297 + Euro symbol); IBM EBCDIC (France-Euro) */ + {1148, "IBM01148"}, /* IBM EBCDIC International (500 + Euro symbol); IBM EBCDIC (International-Euro) */ + {1149, "IBM01149"}, /* IBM EBCDIC Icelandic (20871 + Euro symbol); IBM EBCDIC (Icelandic-Euro) */ + {1250, "windows-1250"}, /* ANSI Central European; Central European (Windows) */ + {1251, "windows-1251"}, /* ANSI Cyrillic; Cyrillic (Windows) */ + {1252, "windows-1252"}, /* ANSI Latin 1; Western European (Windows) */ + {1253, "windows-1253"}, /* ANSI Greek; Greek (Windows) */ + {1254, "windows-1254"}, /* ANSI Turkish; Turkish (Windows) */ + {1255, "windows-1255"}, /* ANSI Hebrew; Hebrew (Windows) */ + {1256, "windows-1256"}, /* ANSI Arabic; Arabic (Windows) */ + {1257, "windows-1257"}, /* ANSI Baltic; Baltic (Windows) */ + {1258, "windows-1258"}, /* ANSI/OEM Vietnamese; Vietnamese (Windows) */ + {1361, "Johab"}, /* Korean (Johab) */ + {10000, "macintosh"}, /* MAC Roman; Western European (Mac) */ + {10001, "x-mac-japanese"}, /* Japanese (Mac) */ + {10002, "x-mac-chinesetrad"}, /* MAC Traditional Chinese (Big5); Chinese Traditional (Mac) */ + {10003, "x-mac-korean"}, /* Korean (Mac) */ + {10004, "x-mac-arabic"}, /* Arabic (Mac) */ + {10005, "x-mac-hebrew"}, /* Hebrew (Mac) */ + {10006, "x-mac-greek"}, /* Greek (Mac) */ + {10007, "x-mac-cyrillic"}, /* Cyrillic (Mac) */ + {10008, "x-mac-chinesesimp"}, /* MAC Simplified Chinese (GB 2312); Chinese Simplified (Mac) */ + {10010, "x-mac-romanian"}, /* Romanian (Mac) */ + {10017, "x-mac-ukrainian"}, /* Ukrainian (Mac) */ + {10021, "x-mac-thai"}, /* Thai (Mac) */ + {10029, "x-mac-ce"}, /* MAC Latin 2; Central European (Mac) */ + {10079, "x-mac-icelandic"}, /* Icelandic (Mac) */ + {10081, "x-mac-turkish"}, /* Turkish (Mac) */ + {10082, "x-mac-croatian"}, /* Croatian (Mac) */ + {20000, "x-Chinese_CNS"}, /* CNS Taiwan; Chinese Traditional (CNS) */ + {20001, "x-cp20001"}, /* TCA Taiwan */ + {20002, "x_Chinese-Eten"}, /* Eten Taiwan; Chinese Traditional (Eten) */ + {20003, "x-cp20003"}, /* IBM5550 Taiwan */ + {20004, "x-cp20004"}, /* TeleText Taiwan */ + {20005, "x-cp20005"}, /* Wang Taiwan */ + {20105, "x-IA5"}, /* IA5 (IRV International Alphabet No. 5, 7-bit); Western European (IA5) */ + {20106, "x-IA5-German"}, /* IA5 German (7-bit) */ + {20107, "x-IA5-Swedish"}, /* IA5 Swedish (7-bit) */ + {20108, "x-IA5-Norwegian"}, /* IA5 Norwegian (7-bit) */ + {20127, "us-ascii"}, /* US-ASCII (7-bit) */ + {20261, "x-cp20261"}, /* T.61 */ + {20269, "x-cp20269"}, /* ISO 6937 Non-Spacing Accent */ + {20273, "IBM273"}, /* IBM EBCDIC Germany */ + {20277, "IBM277"}, /* IBM EBCDIC Denmark-Norway */ + {20278, "IBM278"}, /* IBM EBCDIC Finland-Sweden */ + {20280, "IBM280"}, /* IBM EBCDIC Italy */ + {20284, "IBM284"}, /* IBM EBCDIC Latin America-Spain */ + {20285, "IBM285"}, /* IBM EBCDIC United Kingdom */ + {20290, "IBM290"}, /* IBM EBCDIC Japanese Katakana Extended */ + {20297, "IBM297"}, /* IBM EBCDIC France */ + {20420, "IBM420"}, /* IBM EBCDIC Arabic */ + {20423, "IBM423"}, /* IBM EBCDIC Greek */ + {20424, "IBM424"}, /* IBM EBCDIC Hebrew */ + {20833, "x-EBCDIC-KoreanExtended"}, /* IBM EBCDIC Korean Extended */ + {20838, "IBM-Thai"}, /* IBM EBCDIC Thai */ + {20866, "koi8-r"}, /* Russian (KOI8-R); Cyrillic (KOI8-R) */ + {20871, "IBM871"}, /* IBM EBCDIC Icelandic */ + {20880, "IBM880"}, /* IBM EBCDIC Cyrillic Russian */ + {20905, "IBM905"}, /* IBM EBCDIC Turkish */ + {20924, "IBM00924"}, /* IBM EBCDIC Latin 1/Open System (1047 + Euro symbol) */ + {20932, "EUC-JP"}, /* Japanese (JIS 0208-1990 and 0121-1990) */ + {20936, "x-cp20936"}, /* Simplified Chinese (GB2312); Chinese Simplified (GB2312-80) */ + {20949, "x-cp20949"}, /* Korean Wansung */ + {21025, "cp1025"}, /* IBM EBCDIC Cyrillic Serbian-Bulgarian */ + /* 21027 (deprecated) */ + {21866, "koi8-u"}, /* Ukrainian (KOI8-U); Cyrillic (KOI8-U) */ + {28591, "iso-8859-1"}, /* ISO 8859-1 Latin 1; Western European (ISO) */ + {28591, "iso8859-1"}, /* ISO 8859-1 Latin 1; Western European (ISO) */ + {28592, "iso-8859-2"}, /* ISO 8859-2 Central European; Central European (ISO) */ + {28592, "iso8859-2"}, /* ISO 8859-2 Central European; Central European (ISO) */ + {28593, "iso-8859-3"}, /* ISO 8859-3 Latin 3 */ + {28593, "iso8859-3"}, /* ISO 8859-3 Latin 3 */ + {28594, "iso-8859-4"}, /* ISO 8859-4 Baltic */ + {28594, "iso8859-4"}, /* ISO 8859-4 Baltic */ + {28595, "iso-8859-5"}, /* ISO 8859-5 Cyrillic */ + {28595, "iso8859-5"}, /* ISO 8859-5 Cyrillic */ + {28596, "iso-8859-6"}, /* ISO 8859-6 Arabic */ + {28596, "iso8859-6"}, /* ISO 8859-6 Arabic */ + {28597, "iso-8859-7"}, /* ISO 8859-7 Greek */ + {28597, "iso8859-7"}, /* ISO 8859-7 Greek */ + {28598, "iso-8859-8"}, /* ISO 8859-8 Hebrew; Hebrew (ISO-Visual) */ + {28598, "iso8859-8"}, /* ISO 8859-8 Hebrew; Hebrew (ISO-Visual) */ + {28599, "iso-8859-9"}, /* ISO 8859-9 Turkish */ + {28599, "iso8859-9"}, /* ISO 8859-9 Turkish */ + {28603, "iso-8859-13"}, /* ISO 8859-13 Estonian */ + {28603, "iso8859-13"}, /* ISO 8859-13 Estonian */ + {28605, "iso-8859-15"}, /* ISO 8859-15 Latin 9 */ + {28605, "iso8859-15"}, /* ISO 8859-15 Latin 9 */ + {29001, "x-Europa"}, /* Europa 3 */ + {38598, "iso-8859-8-i"}, /* ISO 8859-8 Hebrew; Hebrew (ISO-Logical) */ + {38598, "iso8859-8-i"}, /* ISO 8859-8 Hebrew; Hebrew (ISO-Logical) */ + {50220, "iso-2022-jp"}, /* ISO 2022 Japanese with no halfwidth Katakana; Japanese (JIS) */ + {50221, "csISO2022JP"}, /* ISO 2022 Japanese with halfwidth Katakana; Japanese (JIS-Allow 1 byte Kana) */ + {50222, "iso-2022-jp"}, /* ISO 2022 Japanese JIS X 0201-1989; Japanese (JIS-Allow 1 byte Kana - SO/SI) */ + {50225, "iso-2022-kr"}, /* ISO 2022 Korean */ + {50225, "iso2022-kr"}, /* ISO 2022 Korean */ + {50227, "x-cp50227"}, /* ISO 2022 Simplified Chinese; Chinese Simplified (ISO 2022) */ + /* 50229 ISO 2022 Traditional Chinese */ + /* 50930 EBCDIC Japanese (Katakana) Extended */ + /* 50931 EBCDIC US-Canada and Japanese */ + /* 50933 EBCDIC Korean Extended and Korean */ + /* 50935 EBCDIC Simplified Chinese Extended and Simplified Chinese */ + /* 50936 EBCDIC Simplified Chinese */ + /* 50937 EBCDIC US-Canada and Traditional Chinese */ + /* 50939 EBCDIC Japanese (Latin) Extended and Japanese */ + {51932, "euc-jp"}, /* EUC Japanese */ + {51936, "EUC-CN"}, /* EUC Simplified Chinese; Chinese Simplified (EUC) */ + {51949, "euc-kr"}, /* EUC Korean */ + /* 51950 EUC Traditional Chinese */ + {52936, "hz-gb-2312"}, /* HZ-GB2312 Simplified Chinese; Chinese Simplified (HZ) */ + {54936, "GB18030"}, /* Windows XP and later: GB18030 Simplified Chinese (4 byte); Chinese Simplified (GB18030) */ + {57002, "x-iscii-de"}, /* ISCII Devanagari */ + {57003, "x-iscii-be"}, /* ISCII Bengali */ + {57004, "x-iscii-ta"}, /* ISCII Tamil */ + {57005, "x-iscii-te"}, /* ISCII Telugu */ + {57006, "x-iscii-as"}, /* ISCII Assamese */ + {57007, "x-iscii-or"}, /* ISCII Oriya */ + {57008, "x-iscii-ka"}, /* ISCII Kannada */ + {57009, "x-iscii-ma"}, /* ISCII Malayalam */ + {57010, "x-iscii-gu"}, /* ISCII Gujarati */ + {57011, "x-iscii-pa"}, /* ISCII Punjabi */ + + {0, NULL} +}; + +/* + * SJIS SHIFTJIS table CP932 table + * ---- --------------------------- -------------------------------- + * 5C U+00A5 YEN SIGN U+005C REVERSE SOLIDUS + * 7E U+203E OVERLINE U+007E TILDE + * 815C U+2014 EM DASH U+2015 HORIZONTAL BAR + * 815F U+005C REVERSE SOLIDUS U+FF3C FULLWIDTH REVERSE SOLIDUS + * 8160 U+301C WAVE DASH U+FF5E FULLWIDTH TILDE + * 8161 U+2016 DOUBLE VERTICAL LINE U+2225 PARALLEL TO + * 817C U+2212 MINUS SIGN U+FF0D FULLWIDTH HYPHEN-MINUS + * 8191 U+00A2 CENT SIGN U+FFE0 FULLWIDTH CENT SIGN + * 8192 U+00A3 POUND SIGN U+FFE1 FULLWIDTH POUND SIGN + * 81CA U+00AC NOT SIGN U+FFE2 FULLWIDTH NOT SIGN + * + * EUC-JP and ISO-2022-JP should be compatible with CP932. + * + * Kernel and MLang have different Unicode mapping table. Make sure + * which API is used. + */ +static compat_t cp932_compat[] = { + {0x00A5, 0x005C, COMPAT_OUT}, + {0x203E, 0x007E, COMPAT_OUT}, + {0x2014, 0x2015, COMPAT_OUT}, + {0x301C, 0xFF5E, COMPAT_OUT}, + {0x2016, 0x2225, COMPAT_OUT}, + {0x2212, 0xFF0D, COMPAT_OUT}, + {0x00A2, 0xFFE0, COMPAT_OUT}, + {0x00A3, 0xFFE1, COMPAT_OUT}, + {0x00AC, 0xFFE2, COMPAT_OUT}, + {0, 0, 0} +}; + +static compat_t cp20932_compat[] = { + {0x00A5, 0x005C, COMPAT_OUT}, + {0x203E, 0x007E, COMPAT_OUT}, + {0x2014, 0x2015, COMPAT_OUT}, + {0xFF5E, 0x301C, COMPAT_OUT|COMPAT_IN}, + {0x2225, 0x2016, COMPAT_OUT|COMPAT_IN}, + {0xFF0D, 0x2212, COMPAT_OUT|COMPAT_IN}, + {0xFFE0, 0x00A2, COMPAT_OUT|COMPAT_IN}, + {0xFFE1, 0x00A3, COMPAT_OUT|COMPAT_IN}, + {0xFFE2, 0x00AC, COMPAT_OUT|COMPAT_IN}, + {0, 0, 0} +}; + +static compat_t *cp51932_compat = cp932_compat; + +/* cp20932_compat for kernel. cp932_compat for mlang. */ +static compat_t *cp5022x_compat = cp932_compat; + +typedef HRESULT (WINAPI *CONVERTINETSTRING)( + LPDWORD lpdwMode, + DWORD dwSrcEncoding, + DWORD dwDstEncoding, + LPCSTR lpSrcStr, + LPINT lpnSrcSize, + LPBYTE lpDstStr, + LPINT lpnDstSize +); +typedef HRESULT (WINAPI *CONVERTINETMULTIBYTETOUNICODE)( + LPDWORD lpdwMode, + DWORD dwSrcEncoding, + LPCSTR lpSrcStr, + LPINT lpnMultiCharCount, + LPWSTR lpDstStr, + LPINT lpnWideCharCount +); +typedef HRESULT (WINAPI *CONVERTINETUNICODETOMULTIBYTE)( + LPDWORD lpdwMode, + DWORD dwEncoding, + LPCWSTR lpSrcStr, + LPINT lpnWideCharCount, + LPSTR lpDstStr, + LPINT lpnMultiCharCount +); +typedef HRESULT (WINAPI *ISCONVERTINETSTRINGAVAILABLE)( + DWORD dwSrcEncoding, + DWORD dwDstEncoding +); +typedef HRESULT (WINAPI *LCIDTORFC1766A)( + LCID Locale, + LPSTR pszRfc1766, + int nChar +); +typedef HRESULT (WINAPI *LCIDTORFC1766W)( + LCID Locale, + LPWSTR pszRfc1766, + int nChar +); +typedef HRESULT (WINAPI *RFC1766TOLCIDA)( + LCID *pLocale, + LPSTR pszRfc1766 +); +typedef HRESULT (WINAPI *RFC1766TOLCIDW)( + LCID *pLocale, + LPWSTR pszRfc1766 +); +static CONVERTINETSTRING ConvertINetString; +static CONVERTINETMULTIBYTETOUNICODE ConvertINetMultiByteToUnicode; +static CONVERTINETUNICODETOMULTIBYTE ConvertINetUnicodeToMultiByte; +static ISCONVERTINETSTRINGAVAILABLE IsConvertINetStringAvailable; +static LCIDTORFC1766A LcidToRfc1766A; +static RFC1766TOLCIDA Rfc1766ToLcidA; + +static int +load_mlang() +{ + HMODULE h; + if (ConvertINetString != NULL) + return TRUE; + h = LoadLibrary(TEXT("mlang.dll")); + if (!h) + return FALSE; + ConvertINetString = (CONVERTINETSTRING)GetProcAddressA(h, "ConvertINetString"); + ConvertINetMultiByteToUnicode = (CONVERTINETMULTIBYTETOUNICODE)GetProcAddressA(h, "ConvertINetMultiByteToUnicode"); + ConvertINetUnicodeToMultiByte = (CONVERTINETUNICODETOMULTIBYTE)GetProcAddressA(h, "ConvertINetUnicodeToMultiByte"); + IsConvertINetStringAvailable = (ISCONVERTINETSTRINGAVAILABLE)GetProcAddressA(h, "IsConvertINetStringAvailable"); + LcidToRfc1766A = (LCIDTORFC1766A)GetProcAddressA(h, "LcidToRfc1766A"); + Rfc1766ToLcidA = (RFC1766TOLCIDA)GetProcAddressA(h, "Rfc1766ToLcidA"); + return TRUE; +} + +iconv_t +iconv_open(const char *tocode, const char *fromcode) +{ + rec_iconv_t *cd; + + cd = (rec_iconv_t *)calloc(1, sizeof(rec_iconv_t)); + if (cd == NULL) + return (iconv_t)(-1); + +#if defined(USE_LIBICONV_DLL) + errno = 0; + if (libiconv_iconv_open(cd, tocode, fromcode)) + return (iconv_t)cd; +#endif + + /* reset the errno to prevent reporting wrong error code. + * 0 for unsorted error. */ + errno = 0; + if (win_iconv_open(cd, tocode, fromcode)) + return (iconv_t)cd; + + free(cd); + + return (iconv_t)(-1); +} + +int +iconv_close(iconv_t _cd) +{ + rec_iconv_t *cd = (rec_iconv_t *)_cd; + int r = cd->iconv_close(cd->cd); + int e = *(cd->_errno()); +#if defined(USE_LIBICONV_DLL) + if (cd->hlibiconv != NULL) + FreeLibrary(cd->hlibiconv); +#endif + free(cd); + errno = e; + return r; +} + +size_t +iconv(iconv_t _cd, char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft) +{ + rec_iconv_t *cd = (rec_iconv_t *)_cd; + size_t r = cd->iconv(cd->cd, inbuf, inbytesleft, outbuf, outbytesleft); + errno = *(cd->_errno()); + return r; +} + +static int +win_iconv_open(rec_iconv_t *cd, const char *tocode, const char *fromcode) +{ + if (!make_csconv(fromcode, &cd->from) || !make_csconv(tocode, &cd->to)) + return FALSE; + cd->iconv_close = win_iconv_close; + cd->iconv = win_iconv; + cd->_errno = _errno; + cd->cd = (iconv_t)cd; + return TRUE; +} + +static int +win_iconv_close(iconv_t cd) +{ + return 0; +} + +static size_t +win_iconv(iconv_t _cd, char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft) +{ + rec_iconv_t *cd = (rec_iconv_t *)_cd; + ushort wbuf[MB_CHAR_MAX]; /* enough room for one character */ + int insize; + int outsize; + int wsize; + DWORD frommode; + DWORD tomode; + uint wc; + compat_t *cp; + int i; + + if (inbuf == NULL || *inbuf == NULL) + { + if (outbuf != NULL && *outbuf != NULL && cd->to.flush != NULL) + { + tomode = cd->to.mode; + outsize = cd->to.flush(&cd->to, (uchar *)*outbuf, *outbytesleft); + if (outsize == -1) + { + cd->to.mode = tomode; + return (size_t)(-1); + } + *outbuf += outsize; + *outbytesleft -= outsize; + } + cd->from.mode = 0; + cd->to.mode = 0; + return 0; + } + + while (*inbytesleft != 0) + { + frommode = cd->from.mode; + tomode = cd->to.mode; + wsize = MB_CHAR_MAX; + + insize = cd->from.mbtowc(&cd->from, (const uchar *)*inbuf, *inbytesleft, wbuf, &wsize); + if (insize == -1) + { + cd->from.mode = frommode; + return (size_t)(-1); + } + + if (wsize == 0) + { + *inbuf += insize; + *inbytesleft -= insize; + continue; + } + + if (cd->from.compat != NULL) + { + wc = utf16_to_ucs4(wbuf); + cp = cd->from.compat; + for (i = 0; cp[i].in != 0; ++i) + { + if ((cp[i].flag & COMPAT_IN) && cp[i].out == wc) + { + ucs4_to_utf16(cp[i].in, wbuf, &wsize); + break; + } + } + } + + if (cd->to.compat != NULL) + { + wc = utf16_to_ucs4(wbuf); + cp = cd->to.compat; + for (i = 0; cp[i].in != 0; ++i) + { + if ((cp[i].flag & COMPAT_OUT) && cp[i].in == wc) + { + ucs4_to_utf16(cp[i].out, wbuf, &wsize); + break; + } + } + } + + outsize = cd->to.wctomb(&cd->to, wbuf, wsize, (uchar *)*outbuf, *outbytesleft); + if (outsize == -1) + { + cd->from.mode = frommode; + cd->to.mode = tomode; + return (size_t)(-1); + } + + *inbuf += insize; + *outbuf += outsize; + *inbytesleft -= insize; + *outbytesleft -= outsize; + } + + return 0; +} + +static int +make_csconv(const char *_name, csconv_t *cv) +{ + CPINFO cpinfo; + int use_compat = TRUE; + int flag = 0; + char *name; + char *p; + + name = xstrndup(_name, strlen(_name)); + if (name == NULL) + return FALSE; + + /* check for option "enc_name//opt1//opt2" */ + while ((p = strrstr(name, "//")) != NULL) + { + if (_stricmp(p + 2, "nocompat") == 0) + use_compat = FALSE; + else if (_stricmp(p + 2, "translit") == 0) + flag |= FLAG_TRANSLIT; + else if (_stricmp(p + 2, "ignore") == 0) + flag |= FLAG_IGNORE; + *p = 0; + } + + cv->mode = 0; + cv->flags = flag; + cv->mblen = NULL; + cv->flush = NULL; + cv->compat = NULL; + cv->codepage = name_to_codepage(name); + if (cv->codepage == 1200 || cv->codepage == 1201) + { + cv->mbtowc = utf16_mbtowc; + cv->wctomb = utf16_wctomb; + if (_stricmp(name, "UTF-16") == 0 || _stricmp(name, "UTF16") == 0 || + _stricmp(name, "UCS-2") == 0 || _stricmp(name, "UCS2") == 0) + cv->flags |= FLAG_USE_BOM; + } + else if (cv->codepage == 12000 || cv->codepage == 12001) + { + cv->mbtowc = utf32_mbtowc; + cv->wctomb = utf32_wctomb; + if (_stricmp(name, "UTF-32") == 0 || _stricmp(name, "UTF32") == 0 || + _stricmp(name, "UCS-4") == 0 || _stricmp(name, "UCS4") == 0) + cv->flags |= FLAG_USE_BOM; + } + else if (cv->codepage == 65001) + { + cv->mbtowc = kernel_mbtowc; + cv->wctomb = kernel_wctomb; + cv->mblen = utf8_mblen; + } + else if ((cv->codepage == 50220 || cv->codepage == 50221 || cv->codepage == 50222) && load_mlang()) + { + cv->mbtowc = iso2022jp_mbtowc; + cv->wctomb = iso2022jp_wctomb; + cv->flush = iso2022jp_flush; + } + else if (cv->codepage == 51932 && load_mlang()) + { + cv->mbtowc = mlang_mbtowc; + cv->wctomb = mlang_wctomb; + cv->mblen = eucjp_mblen; + } + else if (IsValidCodePage(cv->codepage) + && GetCPInfo(cv->codepage, &cpinfo) != 0) + { + cv->mbtowc = kernel_mbtowc; + cv->wctomb = kernel_wctomb; + if (cpinfo.MaxCharSize == 1) + cv->mblen = sbcs_mblen; + else if (cpinfo.MaxCharSize == 2) + cv->mblen = dbcs_mblen; + else + cv->mblen = mbcs_mblen; + } + else + { + /* not supported */ + free(name); + errno = EINVAL; + return FALSE; + } + + if (use_compat) + { + switch (cv->codepage) + { + case 932: cv->compat = cp932_compat; break; + case 20932: cv->compat = cp20932_compat; break; + case 51932: cv->compat = cp51932_compat; break; + case 50220: case 50221: case 50222: cv->compat = cp5022x_compat; break; + } + } + + free(name); + + return TRUE; +} + +static int +name_to_codepage(const char *name) +{ + int i; + + if (*name == '\0' || + strcmp(name, "char") == 0) + return GetACP(); + else if (strcmp(name, "wchar_t") == 0) + return 1200; + else if (_strnicmp(name, "cp", 2) == 0) + return atoi(name + 2); /* CP123 */ + else if ('0' <= name[0] && name[0] <= '9') + return atoi(name); /* 123 */ + else if (_strnicmp(name, "xx", 2) == 0) + return atoi(name + 2); /* XX123 for debug */ + + for (i = 0; codepage_alias[i].name != NULL; ++i) + if (_stricmp(name, codepage_alias[i].name) == 0) + return codepage_alias[i].codepage; + return -1; +} + +/* + *
http://www.faqs.org/rfcs/rfc2781.html
+ */ +static uint +utf16_to_ucs4(const ushort *wbuf) +{ + uint wc = wbuf[0]; + if (0xD800 <= wbuf[0] && wbuf[0] <= 0xDBFF) + wc = ((wbuf[0] & 0x3FF) << 10) + (wbuf[1] & 0x3FF) + 0x10000; + return wc; +} + +static void +ucs4_to_utf16(uint wc, ushort *wbuf, int *wbufsize) +{ + if (wc < 0x10000) + { + wbuf[0] = wc; + *wbufsize = 1; + } + else + { + wc -= 0x10000; + wbuf[0] = 0xD800 | ((wc >> 10) & 0x3FF); + wbuf[1] = 0xDC00 | (wc & 0x3FF); + *wbufsize = 2; + } +} + +/* + * Check if codepage is one of those for which the dwFlags parameter + * to MultiByteToWideChar() must be zero. Return zero or + * MB_ERR_INVALID_CHARS. The docs in Platform SDK for for Windows + * Server 2003 R2 claims that also codepage 65001 is one of these, but + * that doesn't seem to be the case. The MSDN docs for MSVS2008 leave + * out 65001 (UTF-8), and that indeed seems to be the case on XP, it + * works fine to pass MB_ERR_INVALID_CHARS in dwFlags when converting + * from UTF-8. + */ +static int +mbtowc_flags(int codepage) +{ + return (codepage == 50220 || codepage == 50221 || + codepage == 50222 || codepage == 50225 || + codepage == 50227 || codepage == 50229 || + codepage == 52936 || codepage == 54936 || + (codepage >= 57002 && codepage <= 57011) || + codepage == 65000 || codepage == 42) ? 0 : MB_ERR_INVALID_CHARS; +} + +/* + * Check if codepage is one those for which the lpUsedDefaultChar + * parameter to WideCharToMultiByte() must be NULL. The docs in + * Platform SDK for for Windows Server 2003 R2 claims that this is the + * list below, while the MSDN docs for MSVS2008 claim that it is only + * for 65000 (UTF-7) and 65001 (UTF-8). This time the earlier Platform + * SDK seems to be correct, at least for XP. + */ +static int +must_use_null_useddefaultchar(int codepage) +{ + return (codepage == 65000 || codepage == 65001 || + codepage == 50220 || codepage == 50221 || + codepage == 50222 || codepage == 50225 || + codepage == 50227 || codepage == 50229 || + codepage == 52936 || codepage == 54936 || + (codepage >= 57002 && codepage <= 57011) || + codepage == 42); +} + +static char * +strrstr(const char *str, const char *token) +{ + int len = strlen(token); + const char *p = str + strlen(str); + + while (str <= --p) + if (p[0] == token[0] && strncmp(p, token, len) == 0) + return (char *)p; + return NULL; +} + +static char * +xstrndup(const char *s, size_t n) +{ + char *p; + + p = malloc(n + 1); + if (p == NULL) + return NULL; + memcpy(p, s, n); + p[n] = '\0'; + return p; +} + +static int +seterror(int err) +{ + errno = err; + return -1; +} + +#if defined(USE_LIBICONV_DLL) +static int +libiconv_iconv_open(rec_iconv_t *cd, const char *tocode, const char *fromcode) +{ + HMODULE hlibiconv = NULL; + HMODULE hmsvcrt = NULL; + char *dllname; + const char *p; + const char *e; + f_iconv_open _iconv_open; + + /* + * always try to load dll, so that we can switch dll in runtime. + */ + + /* XXX: getenv() can't get variable set by SetEnvironmentVariable() */ + p = getenv("WINICONV_LIBICONV_DLL"); + if (p == NULL) + p = DEFAULT_LIBICONV_DLL; + /* parse comma separated value */ + for ( ; *p != 0; p = (*e == ',') ? e + 1 : e) + { + e = strchr(p, ','); + if (p == e) + continue; + else if (e == NULL) + e = p + strlen(p); + dllname = xstrndup(p, e - p); + if (dllname == NULL) + return FALSE; + hlibiconv = LoadLibraryA(dllname); + free(dllname); + if (hlibiconv != NULL) + { + if (hlibiconv == hwiniconv) + { + FreeLibrary(hlibiconv); + hlibiconv = NULL; + continue; + } + break; + } + } + + if (hlibiconv == NULL) + goto failed; + + hmsvcrt = find_imported_module_by_funcname(hlibiconv, "_errno"); + if (hmsvcrt == NULL) + goto failed; + + _iconv_open = (f_iconv_open)GetProcAddressA(hlibiconv, "libiconv_open"); + if (_iconv_open == NULL) + _iconv_open = (f_iconv_open)GetProcAddressA(hlibiconv, "iconv_open"); + cd->iconv_close = (f_iconv_close)GetProcAddressA(hlibiconv, "libiconv_close"); + if (cd->iconv_close == NULL) + cd->iconv_close = (f_iconv_close)GetProcAddressA(hlibiconv, "iconv_close"); + cd->iconv = (f_iconv)GetProcAddressA(hlibiconv, "libiconv"); + if (cd->iconv == NULL) + cd->iconv = (f_iconv)GetProcAddressA(hlibiconv, "iconv"); + cd->_errno = (f_errno)GetProcAddressA(hmsvcrt, "_errno"); + if (_iconv_open == NULL || cd->iconv_close == NULL + || cd->iconv == NULL || cd->_errno == NULL) + goto failed; + + cd->cd = _iconv_open(tocode, fromcode); + if (cd->cd == (iconv_t)(-1)) + goto failed; + + cd->hlibiconv = hlibiconv; + return TRUE; + +failed: + if (hlibiconv != NULL) + FreeLibrary(hlibiconv); + /* do not free hmsvcrt which is obtained by GetModuleHandle() */ + return FALSE; +} + +/* + * Reference: + *
http://forums.belution.com/ja/vc/000/234/78s.shtml
+ *
http://nienie.com/~masapico/api_ImageDirectoryEntryToData.html
+ * + * The formal way is + * imagehlp.h or dbghelp.h + * imagehlp.lib or dbghelp.lib + * ImageDirectoryEntryToData() + */ +#define TO_DOS_HEADER(base) ((PIMAGE_DOS_HEADER)(base)) +#define TO_NT_HEADERS(base) ((PIMAGE_NT_HEADERS)((LPBYTE)(base) + TO_DOS_HEADER(base)->e_lfanew)) +static PVOID +MyImageDirectoryEntryToData(LPVOID Base, BOOLEAN MappedAsImage, USHORT DirectoryEntry, PULONG Size) +{ + /* TODO: MappedAsImage? */ + PIMAGE_DATA_DIRECTORY p; + p = TO_NT_HEADERS(Base)->OptionalHeader.DataDirectory + DirectoryEntry; + if (p->VirtualAddress == 0) { + *Size = 0; + return NULL; + } + *Size = p->Size; + return (PVOID)((LPBYTE)Base + p->VirtualAddress); +} + +static HMODULE +find_imported_module_by_funcname(HMODULE hModule, const char *funcname) +{ + size_t Base; + ULONG Size; + PIMAGE_IMPORT_DESCRIPTOR Imp; + PIMAGE_THUNK_DATA Name; /* Import Name Table */ + PIMAGE_IMPORT_BY_NAME ImpName; + + Base = (size_t)hModule; + Imp = MyImageDirectoryEntryToData( + (LPVOID)Base, + TRUE, + IMAGE_DIRECTORY_ENTRY_IMPORT, + &Size); + if (Imp == NULL) + return NULL; + for ( ; Imp->OriginalFirstThunk != 0; ++Imp) + { + Name = (PIMAGE_THUNK_DATA)(Base + Imp->OriginalFirstThunk); + for ( ; Name->u1.Ordinal != 0; ++Name) + { + if (!IMAGE_SNAP_BY_ORDINAL(Name->u1.Ordinal)) + { + ImpName = (PIMAGE_IMPORT_BY_NAME) + (Base + (size_t)Name->u1.AddressOfData); + if (strcmp((char *)ImpName->Name, funcname) == 0) + return GetModuleHandleA((char *)(Base + Imp->Name)); + } + } + } + return NULL; +} +#endif + +static int +sbcs_mblen(csconv_t *cv, const uchar *buf, int bufsize) +{ + return 1; +} + +static int +dbcs_mblen(csconv_t *cv, const uchar *buf, int bufsize) +{ + int len = IsDBCSLeadByteEx(cv->codepage, buf[0]) ? 2 : 1; + if (bufsize < len) + return seterror(EINVAL); + return len; +} + +static int +mbcs_mblen(csconv_t *cv, const uchar *buf, int bufsize) +{ + int len = 0; + + if (cv->codepage == 54936) { + if (buf[0] <= 0x7F) len = 1; + else if (buf[0] >= 0x81 && buf[0] <= 0xFE && + bufsize >= 2 && + ((buf[1] >= 0x40 && buf[1] <= 0x7E) || + (buf[1] >= 0x80 && buf[1] <= 0xFE))) len = 2; + else if (buf[0] >= 0x81 && buf[0] <= 0xFE && + bufsize >= 4 && + buf[1] >= 0x30 && buf[1] <= 0x39) len = 4; + else + return seterror(EINVAL); + return len; + } + else + return seterror(EINVAL); +} + +static int +utf8_mblen(csconv_t *cv, const uchar *buf, int bufsize) +{ + int len = 0; + + if (buf[0] < 0x80) len = 1; + else if ((buf[0] & 0xE0) == 0xC0) len = 2; + else if ((buf[0] & 0xF0) == 0xE0) len = 3; + else if ((buf[0] & 0xF8) == 0xF0) len = 4; + else if ((buf[0] & 0xFC) == 0xF8) len = 5; + else if ((buf[0] & 0xFE) == 0xFC) len = 6; + + if (len == 0) + return seterror(EILSEQ); + else if (bufsize < len) + return seterror(EINVAL); + return len; +} + +static int +eucjp_mblen(csconv_t *cv, const uchar *buf, int bufsize) +{ + if (buf[0] < 0x80) /* ASCII */ + return 1; + else if (buf[0] == 0x8E) /* JIS X 0201 */ + { + if (bufsize < 2) + return seterror(EINVAL); + else if (!(0xA1 <= buf[1] && buf[1] <= 0xDF)) + return seterror(EILSEQ); + return 2; + } + else if (buf[0] == 0x8F) /* JIS X 0212 */ + { + if (bufsize < 3) + return seterror(EINVAL); + else if (!(0xA1 <= buf[1] && buf[1] <= 0xFE) + || !(0xA1 <= buf[2] && buf[2] <= 0xFE)) + return seterror(EILSEQ); + return 3; + } + else /* JIS X 0208 */ + { + if (bufsize < 2) + return seterror(EINVAL); + else if (!(0xA1 <= buf[0] && buf[0] <= 0xFE) + || !(0xA1 <= buf[1] && buf[1] <= 0xFE)) + return seterror(EILSEQ); + return 2; + } +} + +static int +kernel_mbtowc(csconv_t *cv, const uchar *buf, int bufsize, ushort *wbuf, int *wbufsize) +{ + int len; + + len = cv->mblen(cv, buf, bufsize); + if (len == -1) + return -1; + *wbufsize = MultiByteToWideChar(cv->codepage, mbtowc_flags (cv->codepage), + (const char *)buf, len, (wchar_t *)wbuf, *wbufsize); + if (*wbufsize == 0) + return seterror(EILSEQ); + return len; +} + +static int +kernel_wctomb(csconv_t *cv, ushort *wbuf, int wbufsize, uchar *buf, int bufsize) +{ + BOOL usedDefaultChar = 0; + BOOL *p = NULL; + int flags = 0; + int len; + + if (bufsize == 0) + return seterror(E2BIG); + if (!must_use_null_useddefaultchar(cv->codepage)) + { + p = &usedDefaultChar; +#ifdef WC_NO_BEST_FIT_CHARS + if (!(cv->flags & FLAG_TRANSLIT)) + flags |= WC_NO_BEST_FIT_CHARS; +#endif + } + len = WideCharToMultiByte(cv->codepage, flags, + (const wchar_t *)wbuf, wbufsize, (char *)buf, bufsize, NULL, p); + if (len == 0) + { + if (GetLastError() == ERROR_INSUFFICIENT_BUFFER) + return seterror(E2BIG); + return seterror(EILSEQ); + } + else if (usedDefaultChar && !(cv->flags & FLAG_TRANSLIT)) + return seterror(EILSEQ); + else if (cv->mblen(cv, buf, len) != len) /* validate result */ + return seterror(EILSEQ); + return len; +} + +/* + * It seems that the mode (cv->mode) is fixnum. + * For example, when converting iso-2022-jp(cp50221) to unicode: + * in ascii sequence: mode=0xC42C0000 + * in jisx0208 sequence: mode=0xC42C0001 + * "C42C" is same for each convert session. + * It should be: ((codepage-1)<<16)|state + */ +static int +mlang_mbtowc(csconv_t *cv, const uchar *buf, int bufsize, ushort *wbuf, int *wbufsize) +{ + int len; + int insize; + HRESULT hr; + + len = cv->mblen(cv, buf, bufsize); + if (len == -1) + return -1; + insize = len; + hr = ConvertINetMultiByteToUnicode(&cv->mode, cv->codepage, + (const char *)buf, &insize, (wchar_t *)wbuf, wbufsize); + if (hr != S_OK || insize != len) + return seterror(EILSEQ); + return len; +} + +static int +mlang_wctomb(csconv_t *cv, ushort *wbuf, int wbufsize, uchar *buf, int bufsize) +{ + char tmpbuf[MB_CHAR_MAX]; /* enough room for one character */ + int tmpsize = MB_CHAR_MAX; + int insize = wbufsize; + HRESULT hr; + + hr = ConvertINetUnicodeToMultiByte(&cv->mode, cv->codepage, + (const wchar_t *)wbuf, &wbufsize, tmpbuf, &tmpsize); + if (hr != S_OK || insize != wbufsize) + return seterror(EILSEQ); + else if (bufsize < tmpsize) + return seterror(E2BIG); + else if (cv->mblen(cv, (uchar *)tmpbuf, tmpsize) != tmpsize) + return seterror(EILSEQ); + memcpy(buf, tmpbuf, tmpsize); + return tmpsize; +} + +static int +utf16_mbtowc(csconv_t *cv, const uchar *buf, int bufsize, ushort *wbuf, int *wbufsize) +{ + int codepage = cv->codepage; + + /* swap endian: 1200 <-> 1201 */ + if (cv->mode & UNICODE_MODE_SWAPPED) + codepage ^= 1; + + if (bufsize < 2) + return seterror(EINVAL); + if (codepage == 1200) /* little endian */ + wbuf[0] = (buf[1] << 8) | buf[0]; + else if (codepage == 1201) /* big endian */ + wbuf[0] = (buf[0] << 8) | buf[1]; + + if ((cv->flags & FLAG_USE_BOM) && !(cv->mode & UNICODE_MODE_BOM_DONE)) + { + cv->mode |= UNICODE_MODE_BOM_DONE; + if (wbuf[0] == 0xFFFE) + { + cv->mode |= UNICODE_MODE_SWAPPED; + *wbufsize = 0; + return 2; + } + else if (wbuf[0] == 0xFEFF) + { + *wbufsize = 0; + return 2; + } + } + + if (0xDC00 <= wbuf[0] && wbuf[0] <= 0xDFFF) + return seterror(EILSEQ); + if (0xD800 <= wbuf[0] && wbuf[0] <= 0xDBFF) + { + if (bufsize < 4) + return seterror(EINVAL); + if (codepage == 1200) /* little endian */ + wbuf[1] = (buf[3] << 8) | buf[2]; + else if (codepage == 1201) /* big endian */ + wbuf[1] = (buf[2] << 8) | buf[3]; + if (!(0xDC00 <= wbuf[1] && wbuf[1] <= 0xDFFF)) + return seterror(EILSEQ); + *wbufsize = 2; + return 4; + } + *wbufsize = 1; + return 2; +} + +static int +utf16_wctomb(csconv_t *cv, ushort *wbuf, int wbufsize, uchar *buf, int bufsize) +{ + if ((cv->flags & FLAG_USE_BOM) && !(cv->mode & UNICODE_MODE_BOM_DONE)) + { + int r; + + cv->mode |= UNICODE_MODE_BOM_DONE; + if (bufsize < 2) + return seterror(E2BIG); + if (cv->codepage == 1200) /* little endian */ + memcpy(buf, "\xFF\xFE", 2); + else if (cv->codepage == 1201) /* big endian */ + memcpy(buf, "\xFE\xFF", 2); + + r = utf16_wctomb(cv, wbuf, wbufsize, buf + 2, bufsize - 2); + if (r == -1) + return -1; + return r + 2; + } + + if (bufsize < 2) + return seterror(E2BIG); + if (cv->codepage == 1200) /* little endian */ + { + buf[0] = (wbuf[0] & 0x00FF); + buf[1] = (wbuf[0] & 0xFF00) >> 8; + } + else if (cv->codepage == 1201) /* big endian */ + { + buf[0] = (wbuf[0] & 0xFF00) >> 8; + buf[1] = (wbuf[0] & 0x00FF); + } + if (0xD800 <= wbuf[0] && wbuf[0] <= 0xDBFF) + { + if (bufsize < 4) + return seterror(E2BIG); + if (cv->codepage == 1200) /* little endian */ + { + buf[2] = (wbuf[1] & 0x00FF); + buf[3] = (wbuf[1] & 0xFF00) >> 8; + } + else if (cv->codepage == 1201) /* big endian */ + { + buf[2] = (wbuf[1] & 0xFF00) >> 8; + buf[3] = (wbuf[1] & 0x00FF); + } + return 4; + } + return 2; +} + +static int +utf32_mbtowc(csconv_t *cv, const uchar *buf, int bufsize, ushort *wbuf, int *wbufsize) +{ + int codepage = cv->codepage; + uint wc; + + /* swap endian: 12000 <-> 12001 */ + if (cv->mode & UNICODE_MODE_SWAPPED) + codepage ^= 1; + + if (bufsize < 4) + return seterror(EINVAL); + if (codepage == 12000) /* little endian */ + wc = (buf[3] << 24) | (buf[2] << 16) | (buf[1] << 8) | buf[0]; + else if (codepage == 12001) /* big endian */ + wc = (buf[0] << 24) | (buf[1] << 16) | (buf[2] << 8) | buf[3]; + + if ((cv->flags & FLAG_USE_BOM) && !(cv->mode & UNICODE_MODE_BOM_DONE)) + { + cv->mode |= UNICODE_MODE_BOM_DONE; + if (wc == 0xFFFE0000) + { + cv->mode |= UNICODE_MODE_SWAPPED; + *wbufsize = 0; + return 4; + } + else if (wc == 0x0000FEFF) + { + *wbufsize = 0; + return 4; + } + } + + if ((0xD800 <= wc && wc <= 0xDFFF) || 0x10FFFF < wc) + return seterror(EILSEQ); + ucs4_to_utf16(wc, wbuf, wbufsize); + return 4; +} + +static int +utf32_wctomb(csconv_t *cv, ushort *wbuf, int wbufsize, uchar *buf, int bufsize) +{ + uint wc; + + if ((cv->flags & FLAG_USE_BOM) && !(cv->mode & UNICODE_MODE_BOM_DONE)) + { + int r; + + cv->mode |= UNICODE_MODE_BOM_DONE; + if (bufsize < 4) + return seterror(E2BIG); + if (cv->codepage == 12000) /* little endian */ + memcpy(buf, "\xFF\xFE\x00\x00", 4); + else if (cv->codepage == 12001) /* big endian */ + memcpy(buf, "\x00\x00\xFE\xFF", 4); + + r = utf32_wctomb(cv, wbuf, wbufsize, buf + 4, bufsize - 4); + if (r == -1) + return -1; + return r + 4; + } + + if (bufsize < 4) + return seterror(E2BIG); + wc = utf16_to_ucs4(wbuf); + if (cv->codepage == 12000) /* little endian */ + { + buf[0] = wc & 0x000000FF; + buf[1] = (wc & 0x0000FF00) >> 8; + buf[2] = (wc & 0x00FF0000) >> 16; + buf[3] = (wc & 0xFF000000) >> 24; + } + else if (cv->codepage == 12001) /* big endian */ + { + buf[0] = (wc & 0xFF000000) >> 24; + buf[1] = (wc & 0x00FF0000) >> 16; + buf[2] = (wc & 0x0000FF00) >> 8; + buf[3] = wc & 0x000000FF; + } + return 4; +} + +/* + * 50220: ISO 2022 Japanese with no halfwidth Katakana; Japanese (JIS) + * 50221: ISO 2022 Japanese with halfwidth Katakana; Japanese (JIS-Allow + * 1 byte Kana) + * 50222: ISO 2022 Japanese JIS X 0201-1989; Japanese (JIS-Allow 1 byte + * Kana - SO/SI) + * + * MultiByteToWideChar() and WideCharToMultiByte() behave differently + * depending on Windows version. On XP, WideCharToMultiByte() doesn't + * terminate result sequence with ascii escape. But Vista does. + * Use MLang instead. + */ + +#define ISO2022_MODE(cs, shift) (((cs) << 8) | (shift)) +#define ISO2022_MODE_CS(mode) (((mode) >> 8) & 0xFF) +#define ISO2022_MODE_SHIFT(mode) ((mode) & 0xFF) + +#define ISO2022_SI 0 +#define ISO2022_SO 1 + +/* shift in */ +static const char iso2022_SI_seq[] = "\x0F"; +/* shift out */ +static const char iso2022_SO_seq[] = "\x0E"; + +typedef struct iso2022_esc_t iso2022_esc_t; +struct iso2022_esc_t { + const char *esc; + int esc_len; + int len; + int cs; +}; + +#define ISO2022JP_CS_ASCII 0 +#define ISO2022JP_CS_JISX0201_ROMAN 1 +#define ISO2022JP_CS_JISX0201_KANA 2 +#define ISO2022JP_CS_JISX0208_1978 3 +#define ISO2022JP_CS_JISX0208_1983 4 +#define ISO2022JP_CS_JISX0212 5 + +static iso2022_esc_t iso2022jp_esc[] = { + {"\x1B\x28\x42", 3, 1, ISO2022JP_CS_ASCII}, + {"\x1B\x28\x4A", 3, 1, ISO2022JP_CS_JISX0201_ROMAN}, + {"\x1B\x28\x49", 3, 1, ISO2022JP_CS_JISX0201_KANA}, + {"\x1B\x24\x40", 3, 2, ISO2022JP_CS_JISX0208_1983}, /* unify 1978 with 1983 */ + {"\x1B\x24\x42", 3, 2, ISO2022JP_CS_JISX0208_1983}, + {"\x1B\x24\x28\x44", 4, 2, ISO2022JP_CS_JISX0212}, + {NULL, 0, 0, 0} +}; + +static int +iso2022jp_mbtowc(csconv_t *cv, const uchar *buf, int bufsize, ushort *wbuf, int *wbufsize) +{ + iso2022_esc_t *iesc = iso2022jp_esc; + char tmp[MB_CHAR_MAX]; + int insize; + HRESULT hr; + DWORD dummy = 0; + int len; + int esc_len; + int cs; + int shift; + int i; + + if (buf[0] == 0x1B) + { + for (i = 0; iesc[i].esc != NULL; ++i) + { + esc_len = iesc[i].esc_len; + if (bufsize < esc_len) + { + if (strncmp((char *)buf, iesc[i].esc, bufsize) == 0) + return seterror(EINVAL); + } + else + { + if (strncmp((char *)buf, iesc[i].esc, esc_len) == 0) + { + cv->mode = ISO2022_MODE(iesc[i].cs, ISO2022_SI); + *wbufsize = 0; + return esc_len; + } + } + } + /* not supported escape sequence */ + return seterror(EILSEQ); + } + else if (buf[0] == iso2022_SO_seq[0]) + { + cv->mode = ISO2022_MODE(ISO2022_MODE_CS(cv->mode), ISO2022_SO); + *wbufsize = 0; + return 1; + } + else if (buf[0] == iso2022_SI_seq[0]) + { + cv->mode = ISO2022_MODE(ISO2022_MODE_CS(cv->mode), ISO2022_SI); + *wbufsize = 0; + return 1; + } + + cs = ISO2022_MODE_CS(cv->mode); + shift = ISO2022_MODE_SHIFT(cv->mode); + + /* reset the mode for informal sequence */ + if (buf[0] < 0x20) + { + cs = ISO2022JP_CS_ASCII; + shift = ISO2022_SI; + } + + len = iesc[cs].len; + if (bufsize < len) + return seterror(EINVAL); + for (i = 0; i < len; ++i) + if (!(buf[i] < 0x80)) + return seterror(EILSEQ); + esc_len = iesc[cs].esc_len; + memcpy(tmp, iesc[cs].esc, esc_len); + if (shift == ISO2022_SO) + { + memcpy(tmp + esc_len, iso2022_SO_seq, 1); + esc_len += 1; + } + memcpy(tmp + esc_len, buf, len); + + if ((cv->codepage == 50220 || cv->codepage == 50221 + || cv->codepage == 50222) && shift == ISO2022_SO) + { + /* XXX: shift-out cannot be used for mbtowc (both kernel and + * mlang) */ + esc_len = iesc[ISO2022JP_CS_JISX0201_KANA].esc_len; + memcpy(tmp, iesc[ISO2022JP_CS_JISX0201_KANA].esc, esc_len); + memcpy(tmp + esc_len, buf, len); + } + + insize = len + esc_len; + hr = ConvertINetMultiByteToUnicode(&dummy, cv->codepage, + (const char *)tmp, &insize, (wchar_t *)wbuf, wbufsize); + if (hr != S_OK || insize != len + esc_len) + return seterror(EILSEQ); + + /* Check for conversion error. Assuming defaultChar is 0x3F. */ + /* ascii should be converted from ascii */ + if (wbuf[0] == buf[0] + && cv->mode != ISO2022_MODE(ISO2022JP_CS_ASCII, ISO2022_SI)) + return seterror(EILSEQ); + + /* reset the mode for informal sequence */ + if (cv->mode != ISO2022_MODE(cs, shift)) + cv->mode = ISO2022_MODE(cs, shift); + + return len; +} + +static int +iso2022jp_wctomb(csconv_t *cv, ushort *wbuf, int wbufsize, uchar *buf, int bufsize) +{ + iso2022_esc_t *iesc = iso2022jp_esc; + char tmp[MB_CHAR_MAX]; + int tmpsize = MB_CHAR_MAX; + int insize = wbufsize; + HRESULT hr; + DWORD dummy = 0; + int len; + int esc_len; + int cs; + int shift; + int i; + + /* + * MultiByte = [escape sequence] + character + [escape sequence] + * + * Whether trailing escape sequence is added depends on which API is + * used (kernel or MLang, and its version). + */ + hr = ConvertINetUnicodeToMultiByte(&dummy, cv->codepage, + (const wchar_t *)wbuf, &wbufsize, tmp, &tmpsize); + if (hr != S_OK || insize != wbufsize) + return seterror(EILSEQ); + else if (bufsize < tmpsize) + return seterror(E2BIG); + + if (tmpsize == 1) + { + cs = ISO2022JP_CS_ASCII; + esc_len = 0; + } + else + { + for (i = 1; iesc[i].esc != NULL; ++i) + { + esc_len = iesc[i].esc_len; + if (strncmp(tmp, iesc[i].esc, esc_len) == 0) + { + cs = iesc[i].cs; + break; + } + } + if (iesc[i].esc == NULL) + /* not supported escape sequence */ + return seterror(EILSEQ); + } + + shift = ISO2022_SI; + if (tmp[esc_len] == iso2022_SO_seq[0]) + { + shift = ISO2022_SO; + esc_len += 1; + } + + len = iesc[cs].len; + + /* Check for converting error. Assuming defaultChar is 0x3F. */ + /* ascii should be converted from ascii */ + if (cs == ISO2022JP_CS_ASCII && !(wbuf[0] < 0x80)) + return seterror(EILSEQ); + else if (tmpsize < esc_len + len) + return seterror(EILSEQ); + + if (cv->mode == ISO2022_MODE(cs, shift)) + { + /* remove escape sequence */ + if (esc_len != 0) + memmove(tmp, tmp + esc_len, len); + esc_len = 0; + } + else + { + if (cs == ISO2022JP_CS_ASCII) + { + esc_len = iesc[ISO2022JP_CS_ASCII].esc_len; + memmove(tmp + esc_len, tmp, len); + memcpy(tmp, iesc[ISO2022JP_CS_ASCII].esc, esc_len); + } + if (ISO2022_MODE_SHIFT(cv->mode) == ISO2022_SO) + { + /* shift-in before changing to other mode */ + memmove(tmp + 1, tmp, len + esc_len); + memcpy(tmp, iso2022_SI_seq, 1); + esc_len += 1; + } + } + + if (bufsize < len + esc_len) + return seterror(E2BIG); + memcpy(buf, tmp, len + esc_len); + cv->mode = ISO2022_MODE(cs, shift); + return len + esc_len; +} + +static int +iso2022jp_flush(csconv_t *cv, uchar *buf, int bufsize) +{ + iso2022_esc_t *iesc = iso2022jp_esc; + int esc_len; + + if (cv->mode != ISO2022_MODE(ISO2022JP_CS_ASCII, ISO2022_SI)) + { + esc_len = 0; + if (ISO2022_MODE_SHIFT(cv->mode) != ISO2022_SI) + esc_len += 1; + if (ISO2022_MODE_CS(cv->mode) != ISO2022JP_CS_ASCII) + esc_len += iesc[ISO2022JP_CS_ASCII].esc_len; + if (bufsize < esc_len) + return seterror(E2BIG); + + esc_len = 0; + if (ISO2022_MODE_SHIFT(cv->mode) != ISO2022_SI) + { + memcpy(buf, iso2022_SI_seq, 1); + esc_len += 1; + } + if (ISO2022_MODE_CS(cv->mode) != ISO2022JP_CS_ASCII) + { + memcpy(buf + esc_len, iesc[ISO2022JP_CS_ASCII].esc, + iesc[ISO2022JP_CS_ASCII].esc_len); + esc_len += iesc[ISO2022JP_CS_ASCII].esc_len; + } + return esc_len; + } + return 0; +} + +#if defined(MAKE_DLL) && defined(USE_LIBICONV_DLL) +BOOL WINAPI +DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpReserved) +{ + switch( fdwReason ) + { + case DLL_PROCESS_ATTACH: + hwiniconv = (HMODULE)hinstDLL; + break; + case DLL_THREAD_ATTACH: + case DLL_THREAD_DETACH: + case DLL_PROCESS_DETACH: + break; + } + return TRUE; +} +#endif + +#if defined(MAKE_EXE) +#include <stdio.h> +#include <fcntl.h> +#include <io.h> +int +main(int argc, char **argv) +{ + char *fromcode = NULL; + char *tocode = NULL; + int i; + char inbuf[BUFSIZ]; + char outbuf[BUFSIZ]; + char *pin; + char *pout; + size_t inbytesleft; + size_t outbytesleft; + size_t rest = 0; + iconv_t cd; + size_t r; + FILE *in = stdin; + + _setmode(_fileno(stdin), _O_BINARY); + _setmode(_fileno(stdout), _O_BINARY); + + for (i = 1; i < argc; ++i) + { + if (strcmp(argv[i], "-l") == 0) + { + for (i = 0; codepage_alias[i].name != NULL; ++i) + printf("%s\n", codepage_alias[i].name); + return 0; + } + + if (strcmp(argv[i], "-f") == 0) + fromcode = argv[++i]; + else if (strcmp(argv[i], "-t") == 0) + tocode = argv[++i]; + else + { + in = fopen(argv[i], "rb"); + if (in == NULL) + { + fprintf(stderr, "cannot open %s\n", argv[i]); + return 1; + } + break; + } + } + + if (fromcode == NULL || tocode == NULL) + { + printf("usage: %s -f from-enc -t to-enc [file]\n", argv[0]); + return 0; + } + + cd = iconv_open(tocode, fromcode); + if (cd == (iconv_t)(-1)) + { + perror("iconv_open error"); + return 1; + } + + while ((inbytesleft = fread(inbuf + rest, 1, sizeof(inbuf) - rest, in)) != 0 + || rest != 0) + { + inbytesleft += rest; + pin = inbuf; + pout = outbuf; + outbytesleft = sizeof(outbuf); + r = iconv(cd, &pin, &inbytesleft, &pout, &outbytesleft); + fwrite(outbuf, 1, sizeof(outbuf) - outbytesleft, stdout); + if (r == (size_t)(-1) && errno != E2BIG && (errno != EINVAL || feof(in))) + { + perror("conversion error"); + return 1; + } + memmove(inbuf, pin, inbytesleft); + rest = inbytesleft; + } + pout = outbuf; + outbytesleft = sizeof(outbuf); + r = iconv(cd, NULL, NULL, &pout, &outbytesleft); + fwrite(outbuf, 1, sizeof(outbuf) - outbytesleft, stdout); + if (r == (size_t)(-1)) + { + perror("conversion error"); + return 1; + } + + iconv_close(cd); + + return 0; +} +#endif + Propchange: trunk/reactos/lib/3rdparty/libwin-iconv/win_iconv.c ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/lib/3rdparty/libwin-iconv/win_iconv_test.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/3rdparty/libwin-iconv/…
============================================================================== --- trunk/reactos/lib/3rdparty/libwin-iconv/win_iconv_test.c (added) +++ trunk/reactos/lib/3rdparty/libwin-iconv/win_iconv_test.c [iso-8859-1] Wed Sep 26 19:18:13 2012 @@ -1,0 +1,279 @@ + +#ifdef USE_ICONV_H +#include <iconv.h> +#include <windows.h> +#include <errno.h> +#include <string.h> +#include <stdlib.h> +#else +#include "win_iconv.c" +#endif + +#include <stdio.h> + +const char * +tohex(const char *str, int size) +{ + static char buf[BUFSIZ]; + char *pbuf = buf; + int i; + buf[0] = 0; + for (i = 0; i < size; ++i) + pbuf += sprintf(pbuf, "%02X", str[i] & 0xFF); + return buf; +} + +const char * +errstr(int errcode) +{ + static char buf[BUFSIZ]; + switch (errcode) + { + case 0: return "NOERROR"; + case EINVAL: return "EINVAL"; + case EILSEQ: return "EILSEQ"; + case E2BIG: return "E2BIG"; + } + sprintf(buf, "%d\n", errcode); + return buf; +} + +#ifdef USE_LIBICONV_DLL +int use_dll; + +int +setdll(const char *dllpath) +{ + char buf[BUFSIZ]; + rec_iconv_t cd; + + sprintf(buf, "WINICONV_LIBICONV_DLL=%s", dllpath); + putenv(buf); + if (libiconv_iconv_open(&cd, "ascii", "ascii")) + { + FreeLibrary(cd.hlibiconv); + use_dll = TRUE; + return TRUE; + } + use_dll = FALSE; + return FALSE; +} +#endif + +/* + * We can test the codepage that is installed in the system. + */ +int +check_enc(const char *encname, int codepage) +{ + iconv_t cd; + int cp; + cd = iconv_open("utf-8", encname); + if (cd == (iconv_t)(-1)) + { + printf("%s(%d) IS NOT SUPPORTED: SKIP THE TEST\n", encname, codepage); + return FALSE; + } +#ifndef USE_ICONV_H + cp = ((rec_iconv_t *)cd)->from.codepage; + if (cp != codepage) + { + printf("%s(%d) ALIAS IS MAPPED TO DIFFERENT CODEPAGE (%d)\n", encname, codepage, cp); + exit(1); + } +#endif + iconv_close(cd); + return TRUE; +} + +void +test(const char *from, char *fromstr, int fromsize, const char *to, const char *tostr, int tosize, int errcode, int bufsize, int line) +{ + char outbuf[BUFSIZ]; + char *pin; + char *pout; + size_t inbytesleft; + size_t outbytesleft; + iconv_t cd; + size_t r; +#ifdef USE_LIBICONV_DLL + char dllpath[_MAX_PATH]; +#endif + + cd = iconv_open(to, from); + if (cd == (iconv_t)(-1)) + { + printf("%s -> %s: NG: INVALID ENCODING NAME: line=%d\n", from, to, line); + exit(1); + } + +#ifdef USE_LIBICONV_DLL + if (((rec_iconv_t *)cd)->hlibiconv != NULL) + GetModuleFileNameA(((rec_iconv_t *)cd)->hlibiconv, dllpath, sizeof(dllpath)); + + if (use_dll && ((rec_iconv_t *)cd)->hlibiconv == NULL) + { + printf("%s: %s -> %s: NG: FAILED TO USE DLL: line=%d\n", dllpath, from, to, line); + exit(1); + } + else if (!use_dll && ((rec_iconv_t *)cd)->hlibiconv != NULL) + { + printf("%s: %s -> %s: NG: DLL IS LOADED UNEXPECTEDLY: line=%d\n", dllpath, from, to, line); + exit(1); + } +#endif + + errno = 0; + + pin = fromstr; + pout = outbuf; + inbytesleft = fromsize; + outbytesleft = bufsize; + r = iconv(cd, &pin, &inbytesleft, &pout, &outbytesleft); + if (r != (size_t)(-1)) + r = iconv(cd, NULL, NULL, &pout, &outbytesleft); + *pout = 0; + +#ifdef USE_LIBICONV_DLL + if (use_dll) + printf("%s: ", dllpath); +#endif + printf("%s(%s) -> ", from, tohex(fromstr, fromsize)); + printf("%s(%s%s%s): ", to, tohex(tostr, tosize), + errcode == 0 ? "" : ":", + errcode == 0 ? "" : errstr(errcode)); + if (strcmp(outbuf, tostr) == 0 && errno == errcode) + printf("OK\n"); + else + { + printf("RESULT(%s:%s): ", tohex(outbuf, sizeof(outbuf) - outbytesleft), + errstr(errno)); + printf("NG: line=%d\n", line); + exit(1); + } +} + +#define STATIC_STRLEN(arr) (sizeof(arr) - 1) + +#define success(from, fromstr, to, tostr) test(from, fromstr, STATIC_STRLEN(fromstr), to, tostr, STATIC_STRLEN(tostr), 0, BUFSIZ, __LINE__) +#define einval(from, fromstr, to, tostr) test(from, fromstr, STATIC_STRLEN(fromstr), to, tostr, STATIC_STRLEN(tostr), EINVAL, BUFSIZ, __LINE__) +#define eilseq(from, fromstr, to, tostr) test(from, fromstr, STATIC_STRLEN(fromstr), to, tostr, STATIC_STRLEN(tostr), EILSEQ, BUFSIZ, __LINE__) +#define e2big(from, fromstr, to, tostr, bufsize) test(from, fromstr, STATIC_STRLEN(fromstr), to, tostr, STATIC_STRLEN(tostr), E2BIG, bufsize, __LINE__) + +int +main(int argc, char **argv) +{ +#ifdef USE_LIBICONV_DLL + /* test use of dll if $DEFAULT_LIBICONV_DLL was defined. */ + if (setdll("")) + { + success("ascii", "ABC", "ascii", "ABC"); + success("ascii", "ABC", "utf-16be", "\x00\x41\x00\x42\x00\x43"); + } + else + { + printf("\nDLL TEST IS SKIPPED\n\n"); + } + + setdll("none"); +#endif + + if (check_enc("ascii", 20127)) + { + success("ascii", "ABC", "ascii", "ABC"); + /* MSB is dropped. Hmm... */ + success("ascii", "\x80\xFF", "ascii", "\x00\x7F"); + } + + /* unicode (CP1200 CP1201 CP12000 CP12001 CP65001) */ + if (check_enc("utf-8", 65001) + && check_enc("utf-16be", 1201) && check_enc("utf-16le", 1200) + && check_enc("utf-32be", 12001) && check_enc("utf-32le", 12000) + ) + { + /* Test the BOM behavior + * 1. Remove the BOM when "fromcode" is utf-16 or utf-32. + * 2. Add the BOM when "tocode" is utf-16 or utf-32. */ + success("utf-16", "\xFE\xFF\x01\x02", "utf-16be", "\x01\x02"); + success("utf-16", "\xFF\xFE\x02\x01", "utf-16be", "\x01\x02"); + success("utf-32", "\x00\x00\xFE\xFF\x00\x00\x01\x02", "utf-32be", "\x00\x00\x01\x02"); + success("utf-32", "\xFF\xFE\x00\x00\x02\x01\x00\x00", "utf-32be", "\x00\x00\x01\x02"); + success("utf-16", "\xFE\xFF\x00\x01", "utf-8", "\x01"); +#ifndef GLIB_COMPILATION + success("utf-8", "\x01", "utf-16", "\xFE\xFF\x00\x01"); + success("utf-8", "\x01", "utf-32", "\x00\x00\xFE\xFF\x00\x00\x00\x01"); +#else + success("utf-8", "\x01", "utf-16", "\xFF\xFE\x01\x00"); + success("utf-8", "\x01", "utf-32", "\xFF\xFE\x00\x00\x01\x00\x00\x00"); +#endif + + success("utf-16be", "\xFE\xFF\x01\x02", "utf-16be", "\xFE\xFF\x01\x02"); + success("utf-16le", "\xFF\xFE\x02\x01", "utf-16be", "\xFE\xFF\x01\x02"); + success("utf-32be", "\x00\x00\xFE\xFF\x00\x00\x01\x02", "utf-32be", "\x00\x00\xFE\xFF\x00\x00\x01\x02"); + success("utf-32le", "\xFF\xFE\x00\x00\x02\x01\x00\x00", "utf-32be", "\x00\x00\xFE\xFF\x00\x00\x01\x02"); + success("utf-16be", "\xFE\xFF\x00\x01", "utf-8", "\xEF\xBB\xBF\x01"); + success("utf-8", "\xEF\xBB\xBF\x01", "utf-8", "\xEF\xBB\xBF\x01"); + + success("utf-16be", "\x01\x02", "utf-16le", "\x02\x01"); + success("utf-16le", "\x02\x01", "utf-16be", "\x01\x02"); + success("utf-16be", "\xFE\xFF", "utf-16le", "\xFF\xFE"); + success("utf-16le", "\xFF\xFE", "utf-16be", "\xFE\xFF"); + success("utf-32be", "\x00\x00\x03\x04", "utf-32le", "\x04\x03\x00\x00"); + success("utf-32le", "\x04\x03\x00\x00", "utf-32be", "\x00\x00\x03\x04"); + success("utf-32be", "\x00\x00\xFF\xFF", "utf-16be", "\xFF\xFF"); + success("utf-16be", "\xFF\xFF", "utf-32be", "\x00\x00\xFF\xFF"); + success("utf-32be", "\x00\x01\x00\x00", "utf-16be", "\xD8\x00\xDC\x00"); + success("utf-16be", "\xD8\x00\xDC\x00", "utf-32be", "\x00\x01\x00\x00"); + success("utf-32be", "\x00\x10\xFF\xFF", "utf-16be", "\xDB\xFF\xDF\xFF"); + success("utf-16be", "\xDB\xFF\xDF\xFF", "utf-32be", "\x00\x10\xFF\xFF"); + eilseq("utf-32be", "\x00\x11\x00\x00", "utf-16be", ""); + eilseq("utf-16be", "\xDB\xFF\xE0\x00", "utf-32be", ""); + success("utf-8", "\xE3\x81\x82", "utf-16be", "\x30\x42"); + einval("utf-8", "\xE3", "utf-16be", ""); + } + + /* Japanese (CP932 CP20932 CP50220 CP50221 CP50222 CP51932) */ + if (check_enc("cp932", 932) + && check_enc("cp20932", 20932) && check_enc("euc-jp", 51932) + && check_enc("cp50220", 50220) && check_enc("cp50221", 50221) + && check_enc("cp50222", 50222) && check_enc("iso-2022-jp", 50221)) + { + /* Test the compatibility for each other Japanese codepage. + * And validate the escape sequence handling for iso-2022-jp. */ + success("utf-16be", "\xFF\x5E", "cp932", "\x81\x60"); + success("utf-16be", "\x30\x1C", "cp932", "\x81\x60"); + success("utf-16be", "\xFF\x5E", "cp932//nocompat", "\x81\x60"); + eilseq("utf-16be", "\x30\x1C", "cp932//nocompat", ""); + success("euc-jp", "\xA4\xA2", "utf-16be", "\x30\x42"); + einval("euc-jp", "\xA4\xA2\xA4", "utf-16be", "\x30\x42"); + eilseq("euc-jp", "\xA4\xA2\xFF\xFF", "utf-16be", "\x30\x42"); + success("cp932", "\x81\x60", "iso-2022-jp", "\x1B\x24\x42\x21\x41\x1B\x28\x42"); + success("UTF-16BE", "\xFF\x5E", "iso-2022-jp", "\x1B\x24\x42\x21\x41\x1B\x28\x42"); + eilseq("UTF-16BE", "\x30\x1C", "iso-2022-jp//nocompat", ""); + success("UTF-16BE", "\x30\x42\x30\x44", "iso-2022-jp", "\x1B\x24\x42\x24\x22\x24\x24\x1B\x28\x42"); + success("iso-2022-jp", "\x1B\x24\x42\x21\x41\x1B\x28\x42", "UTF-16BE", "\xFF\x5E"); + } + + /* + * test for //translit + * U+FF41 (FULLWIDTH LATIN SMALL LETTER A) <-> U+0062 (LATIN SMALL LETTER A) + */ + eilseq("UTF-16BE", "\xFF\x41", "iso-8859-1", ""); + success("UTF-16BE", "\xFF\x41", "iso-8859-1//translit", "a"); + + /* + * test for //translit + * Some character, not in "to" encoding -> DEFAULT CHARACTER (maybe "?") + */ + eilseq("UTF-16BE", "\x30\x42", "ascii", ""); + success("UTF-16BE", "\x30\x42", "ascii//translit", "?"); + + /* + * TODO: + * Test for state after iconv() failed. + * Ensure iconv() error is safe and continuable. + */ + + return 0; +} + Propchange: trunk/reactos/lib/3rdparty/libwin-iconv/win_iconv_test.c ------------------------------------------------------------------------------ svn:eol-style = native Modified: trunk/reactos/lib/3rdparty/libxml2/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/3rdparty/libxml2/CMake…
============================================================================== --- trunk/reactos/lib/3rdparty/libxml2/CMakeLists.txt [iso-8859-1] (original) +++ trunk/reactos/lib/3rdparty/libxml2/CMakeLists.txt [iso-8859-1] Wed Sep 26 19:18:13 2012 @@ -1,5 +1,7 @@ -include_directories(include) +include_directories( + include + ${REACTOS_SOURCE_DIR}/lib/3rdparty/libwin-iconv) add_definitions( -D__MINGW32__ @@ -10,6 +12,8 @@ -D_WINDOWS -DWIN32 -DHAVE_CONFIG_H + -DLIBXML_ICONV_ENABLED + -DICONV_CONST=const -D_DLL -D__USE_CRTIMP) list(APPEND SOURCE
12 years, 3 months
1
0
0
0
[tfaber] 57393: [NTDLL_APITEST] - Use GetProcAddress for RtlGetFullPathName_UstrEx to allow running the test on WinXP
by tfaber@svn.reactos.org
Author: tfaber Date: Wed Sep 26 18:15:44 2012 New Revision: 57393 URL:
http://svn.reactos.org/svn/reactos?rev=57393&view=rev
Log: [NTDLL_APITEST] - Use GetProcAddress for RtlGetFullPathName_UstrEx to allow running the test on WinXP Modified: trunk/rostests/apitests/ntdll/RtlGetFullPathName_UstrEx.c Modified: trunk/rostests/apitests/ntdll/RtlGetFullPathName_UstrEx.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/ntdll/RtlGetFull…
============================================================================== --- trunk/rostests/apitests/ntdll/RtlGetFullPathName_UstrEx.c [iso-8859-1] (original) +++ trunk/rostests/apitests/ntdll/RtlGetFullPathName_UstrEx.c [iso-8859-1] Wed Sep 26 18:15:44 2012 @@ -6,6 +6,7 @@ */ #define WIN32_NO_STATUS +#define UNICODE #include <wine/test.h> #include <pseh/pseh2.h> #include <ndk/rtlfuncs.h> @@ -24,6 +25,19 @@ OUT PSIZE_T LengthNeeded OPTIONAL ); */ + +NTSTATUS +(NTAPI +*pRtlGetFullPathName_UstrEx)( + IN PUNICODE_STRING FileName, + IN PUNICODE_STRING StaticString, + IN PUNICODE_STRING DynamicString, + IN PUNICODE_STRING *StringUsed, + IN PSIZE_T FilePartSize OPTIONAL, + OUT PBOOLEAN NameInvalid, + OUT RTL_PATH_TYPE* PathType, + OUT PSIZE_T LengthNeeded OPTIONAL +); #define StartSeh() ExceptionStatus = STATUS_SUCCESS; _SEH2_TRY { #define EndSeh(ExpectedStatus) } _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) { ExceptionStatus = _SEH2_GetExceptionCode(); } _SEH2_END; ok(ExceptionStatus == ExpectedStatus, "Exception %lx, expected %lx\n", ExceptionStatus, ExpectedStatus) @@ -212,7 +226,7 @@ NameInvalid = (BOOLEAN)-1; LengthNeeded = 1234; StartSeh() - Status = RtlGetFullPathName_UstrEx(&FileName, + Status = pRtlGetFullPathName_UstrEx(&FileName, &FullPathName, NULL, &StringUsed, @@ -287,28 +301,35 @@ SIZE_T LengthNeeded; BOOLEAN Okay; + pRtlGetFullPathName_UstrEx = (PVOID)GetProcAddress(GetModuleHandle(L"ntdll"), "RtlGetFullPathName_UstrEx"); + if (!pRtlGetFullPathName_UstrEx) + { + skip("RtlGetFullPathName_UstrEx unavailable\n"); + return; + } + /* NULL parameters */ StartSeh() - RtlGetFullPathName_UstrEx(NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + pRtlGetFullPathName_UstrEx(NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); EndSeh(STATUS_ACCESS_VIOLATION); RtlInitUnicodeString(&FileName, NULL); TempString = FileName; StartSeh() - RtlGetFullPathName_UstrEx(&FileName, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + pRtlGetFullPathName_UstrEx(&FileName, NULL, NULL, NULL, NULL, NULL, NULL, NULL); EndSeh(STATUS_ACCESS_VIOLATION); ok_eq_ustr(&FileName, &TempString); RtlInitUnicodeString(&FileName, L""); TempString = FileName; StartSeh() - RtlGetFullPathName_UstrEx(&FileName, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - EndSeh(STATUS_ACCESS_VIOLATION); - ok_eq_ustr(&FileName, &TempString); - - PathType = RtlPathTypeNotSet; - StartSeh() - RtlGetFullPathName_UstrEx(NULL, NULL, NULL, NULL, NULL, NULL, &PathType, NULL); + pRtlGetFullPathName_UstrEx(&FileName, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + EndSeh(STATUS_ACCESS_VIOLATION); + ok_eq_ustr(&FileName, &TempString); + + PathType = RtlPathTypeNotSet; + StartSeh() + pRtlGetFullPathName_UstrEx(NULL, NULL, NULL, NULL, NULL, NULL, &PathType, NULL); EndSeh(STATUS_ACCESS_VIOLATION); ok(PathType == RtlPathTypeUnknown || broken(PathType == RtlPathTypeNotSet) /* Win7 */, "PathType = %d\n", PathType); @@ -320,7 +341,7 @@ NameInvalid = (BOOLEAN)-1; LengthNeeded = 1234; StartSeh() - RtlGetFullPathName_UstrEx(NULL, NULL, NULL, &StringUsed, &FilePartSize, &NameInvalid, &PathType, &LengthNeeded); + pRtlGetFullPathName_UstrEx(NULL, NULL, NULL, &StringUsed, &FilePartSize, &NameInvalid, &PathType, &LengthNeeded); EndSeh(STATUS_ACCESS_VIOLATION); ok(StringUsed == NULL, "StringUsed = %p\n", StringUsed); ok(FilePartSize == 0, "FilePartSize = %lu\n", (ULONG)FilePartSize); @@ -336,7 +357,7 @@ NameInvalid = (BOOLEAN)-1; LengthNeeded = 1234; StartSeh() - RtlGetFullPathName_UstrEx(&FileName, NULL, NULL, &StringUsed, &FilePartSize, &NameInvalid, NULL, &LengthNeeded); + pRtlGetFullPathName_UstrEx(&FileName, NULL, NULL, &StringUsed, &FilePartSize, &NameInvalid, NULL, &LengthNeeded); EndSeh(STATUS_ACCESS_VIOLATION); ok_eq_ustr(&FileName, &TempString); ok(StringUsed == NULL, "StringUsed = %p\n", StringUsed); @@ -350,7 +371,7 @@ TempString = FileName; PathType = RtlPathTypeNotSet; StartSeh() - Status = RtlGetFullPathName_UstrEx(&FileName, NULL, NULL, NULL, NULL, NULL, &PathType, NULL); + Status = pRtlGetFullPathName_UstrEx(&FileName, NULL, NULL, NULL, NULL, NULL, &PathType, NULL); ok(Status == STATUS_OBJECT_NAME_INVALID, "status = %lx\n", Status); EndSeh(STATUS_SUCCESS); ok_eq_ustr(&FileName, &TempString); @@ -360,7 +381,7 @@ TempString = FileName; PathType = RtlPathTypeNotSet; StartSeh() - Status = RtlGetFullPathName_UstrEx(&FileName, NULL, NULL, NULL, NULL, NULL, &PathType, NULL); + Status = pRtlGetFullPathName_UstrEx(&FileName, NULL, NULL, NULL, NULL, NULL, &PathType, NULL); ok(Status == STATUS_OBJECT_NAME_INVALID, "status = %lx\n", Status); EndSeh(STATUS_SUCCESS); ok_eq_ustr(&FileName, &TempString); @@ -372,7 +393,7 @@ PathType = RtlPathTypeNotSet; RtlFillMemory(NameInvalidArray, sizeof(NameInvalidArray), 0x55); StartSeh() - Status = RtlGetFullPathName_UstrEx(&FileName, NULL, NULL, NULL, NULL, NameInvalidArray, &PathType, NULL); + Status = pRtlGetFullPathName_UstrEx(&FileName, NULL, NULL, NULL, NULL, NameInvalidArray, &PathType, NULL); ok(Status == STATUS_OBJECT_NAME_INVALID, "status = %lx\n", Status); EndSeh(STATUS_SUCCESS); ok_eq_ustr(&FileName, &TempString); @@ -386,7 +407,7 @@ TempString = FileName; PathType = RtlPathTypeNotSet; StartSeh() - Status = RtlGetFullPathName_UstrEx(&FileName, NULL, NULL, NULL, NULL, NULL, &PathType, NULL); + Status = pRtlGetFullPathName_UstrEx(&FileName, NULL, NULL, NULL, NULL, NULL, &PathType, NULL); ok(Status == STATUS_BUFFER_TOO_SMALL, "status = %lx\n", Status); EndSeh(STATUS_SUCCESS); ok_eq_ustr(&FileName, &TempString); @@ -398,7 +419,7 @@ RtlInitUnicodeString(&StaticString, NULL); PathType = RtlPathTypeNotSet; StartSeh() - Status = RtlGetFullPathName_UstrEx(&FileName, &StaticString, NULL, NULL, NULL, NULL, &PathType, NULL); + Status = pRtlGetFullPathName_UstrEx(&FileName, &StaticString, NULL, NULL, NULL, NULL, &PathType, NULL); ok(Status == STATUS_BUFFER_TOO_SMALL, "status = %lx\n", Status); EndSeh(STATUS_SUCCESS); ok_eq_ustr(&FileName, &TempString);
12 years, 3 months
1
0
0
0
[spetreolle] 57392: [KERNEL32] Remove svn:keywords properties.
by spetreolle@svn.reactos.org
Author: spetreolle Date: Wed Sep 26 17:49:14 2012 New Revision: 57392 URL:
http://svn.reactos.org/svn/reactos?rev=57392&view=rev
Log: [KERNEL32] Remove svn:keywords properties. Modified: trunk/reactos/dll/win32/kernel32/client/atom.c (props changed) trunk/reactos/dll/win32/kernel32/client/compname.c (props changed) trunk/reactos/dll/win32/kernel32/client/debugger.c (props changed) trunk/reactos/dll/win32/kernel32/client/dllmain.c (contents, props changed) trunk/reactos/dll/win32/kernel32/client/dosdev.c (contents, props changed) trunk/reactos/dll/win32/kernel32/client/environ.c (contents, props changed) trunk/reactos/dll/win32/kernel32/client/except.c (contents, props changed) trunk/reactos/dll/win32/kernel32/client/fiber.c (props changed) trunk/reactos/dll/win32/kernel32/client/file/backup.c (contents, props changed) trunk/reactos/dll/win32/kernel32/client/file/cnotify.c (contents, props changed) trunk/reactos/dll/win32/kernel32/client/file/console.c (contents, props changed) trunk/reactos/dll/win32/kernel32/client/file/copy.c (contents, props changed) trunk/reactos/dll/win32/kernel32/client/file/create.c (contents, props changed) trunk/reactos/dll/win32/kernel32/client/file/delete.c (contents, props changed) trunk/reactos/dll/win32/kernel32/client/file/deviceio.c (props changed) trunk/reactos/dll/win32/kernel32/client/file/dir.c (contents, props changed) trunk/reactos/dll/win32/kernel32/client/file/fileinfo.c (contents, props changed) trunk/reactos/dll/win32/kernel32/client/file/filemap.c (props changed) trunk/reactos/dll/win32/kernel32/client/file/find.c (contents, props changed) trunk/reactos/dll/win32/kernel32/client/file/hardlink.c (contents, props changed) trunk/reactos/dll/win32/kernel32/client/file/iocompl.c (contents, props changed) trunk/reactos/dll/win32/kernel32/client/file/lfile.c (contents, props changed) trunk/reactos/dll/win32/kernel32/client/file/lock.c (contents, props changed) trunk/reactos/dll/win32/kernel32/client/file/mailslot.c (contents, props changed) trunk/reactos/dll/win32/kernel32/client/file/move.c (contents, props changed) trunk/reactos/dll/win32/kernel32/client/file/npipe.c (props changed) trunk/reactos/dll/win32/kernel32/client/file/rw.c (contents, props changed) trunk/reactos/dll/win32/kernel32/client/file/tape.c (contents, props changed) trunk/reactos/dll/win32/kernel32/client/file/volume.c (contents, props changed) trunk/reactos/dll/win32/kernel32/client/handle.c (props changed) trunk/reactos/dll/win32/kernel32/client/heapmem.c (props changed) trunk/reactos/dll/win32/kernel32/client/i386/fiber.S (props changed) trunk/reactos/dll/win32/kernel32/client/job.c (contents, props changed) trunk/reactos/dll/win32/kernel32/client/loader.c (props changed) trunk/reactos/dll/win32/kernel32/client/perfcnt.c (props changed) trunk/reactos/dll/win32/kernel32/client/proc.c (contents, props changed) trunk/reactos/dll/win32/kernel32/client/resntfy.c (props changed) trunk/reactos/dll/win32/kernel32/client/session.c (props changed) trunk/reactos/dll/win32/kernel32/client/synch.c (props changed) trunk/reactos/dll/win32/kernel32/client/sysinfo.c (props changed) trunk/reactos/dll/win32/kernel32/client/thread.c (props changed) trunk/reactos/dll/win32/kernel32/client/timerqueue.c (props changed) trunk/reactos/dll/win32/kernel32/client/toolhelp.c (contents, props changed) trunk/reactos/dll/win32/kernel32/client/version.c (props changed) trunk/reactos/dll/win32/kernel32/client/virtmem.c (props changed) trunk/reactos/dll/win32/kernel32/include/kernel32.h (props changed) trunk/reactos/dll/win32/kernel32/k32.h (props changed) trunk/reactos/dll/win32/kernel32/kernel32.rc (props changed) trunk/reactos/dll/win32/kernel32/wine/comm.c (props changed) trunk/reactos/dll/win32/kernel32/wine/lzexpand.c (contents, props changed) trunk/reactos/dll/win32/kernel32/wine/muldiv.c (contents, props changed) trunk/reactos/dll/win32/kernel32/wine/profile.c (props changed) trunk/reactos/dll/win32/kernel32/wine/res.c (props changed) trunk/reactos/dll/win32/kernel32/wine/timezone.c (contents, props changed) trunk/reactos/dll/win32/kernel32/winnls/locale_rc.rc (props changed) trunk/reactos/dll/win32/kernel32/winnls/nls/deu.nls (props changed) trunk/reactos/dll/win32/kernel32/winnls/nls/eng.nls (props changed) trunk/reactos/dll/win32/kernel32/winnls/nls/enu.nls (props changed) trunk/reactos/dll/win32/kernel32/winnls/nls/fra.nls (props changed) trunk/reactos/dll/win32/kernel32/winnls/string/lang.c (props changed) trunk/reactos/dll/win32/kernel32/winnls/string/lcformat.c (props changed) trunk/reactos/dll/win32/kernel32/winnls/string/lstring.c (props changed) trunk/reactos/dll/win32/kernel32/winnls/string/nls.c (contents, props changed) Propchange: trunk/reactos/dll/win32/kernel32/client/atom.c ------------------------------------------------------------------------------ --- svn:keywords (original) +++ svn:keywords (removed) @@ -1,1 +1,0 @@ -author date id revision Propchange: trunk/reactos/dll/win32/kernel32/client/compname.c ------------------------------------------------------------------------------ --- svn:keywords (original) +++ svn:keywords (removed) @@ -1,1 +1,0 @@ -author date id revision Propchange: trunk/reactos/dll/win32/kernel32/client/debugger.c ------------------------------------------------------------------------------ --- svn:keywords (original) +++ svn:keywords (removed) @@ -1,1 +1,0 @@ -author date id revision Modified: trunk/reactos/dll/win32/kernel32/client/dllmain.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/client/…
============================================================================== --- trunk/reactos/dll/win32/kernel32/client/dllmain.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/client/dllmain.c [iso-8859-1] Wed Sep 26 17:49:14 2012 @@ -1,4 +1,4 @@ -/* $Id$ +/* $Id: dllmain.c 56414 2012-04-25 10:17:29Z tfaber $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries Propchange: trunk/reactos/dll/win32/kernel32/client/dllmain.c ------------------------------------------------------------------------------ --- svn:keywords (original) +++ svn:keywords (removed) @@ -1,1 +1,0 @@ -author date id revision Modified: trunk/reactos/dll/win32/kernel32/client/dosdev.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/client/…
============================================================================== --- trunk/reactos/dll/win32/kernel32/client/dosdev.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/client/dosdev.c [iso-8859-1] Wed Sep 26 17:49:14 2012 @@ -1,4 +1,4 @@ -/* $Id$ +/* $Id: dosdev.c 54326 2011-11-07 00:18:13Z ion $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries Propchange: trunk/reactos/dll/win32/kernel32/client/dosdev.c ------------------------------------------------------------------------------ --- svn:keywords (original) +++ svn:keywords (removed) @@ -1,1 +1,0 @@ -author date id revision Modified: trunk/reactos/dll/win32/kernel32/client/environ.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/client/…
============================================================================== --- trunk/reactos/dll/win32/kernel32/client/environ.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/client/environ.c [iso-8859-1] Wed Sep 26 17:49:14 2012 @@ -1,4 +1,4 @@ -/* $Id$ +/* $Id: environ.c 54459 2011-11-20 17:00:39Z pschweitzer $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries Propchange: trunk/reactos/dll/win32/kernel32/client/environ.c ------------------------------------------------------------------------------ --- svn:keywords (original) +++ svn:keywords (removed) @@ -1,1 +1,0 @@ -author date id revision Modified: trunk/reactos/dll/win32/kernel32/client/except.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/client/…
============================================================================== --- trunk/reactos/dll/win32/kernel32/client/except.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/client/except.c [iso-8859-1] Wed Sep 26 17:49:14 2012 @@ -1,4 +1,4 @@ -/* $Id$ +/* $Id: except.c 57269 2012-09-11 03:50:20Z mnordell $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries Propchange: trunk/reactos/dll/win32/kernel32/client/except.c ------------------------------------------------------------------------------ --- svn:keywords (original) +++ svn:keywords (removed) @@ -1,1 +1,0 @@ -author date id revision Propchange: trunk/reactos/dll/win32/kernel32/client/fiber.c ------------------------------------------------------------------------------ --- svn:keywords (original) +++ svn:keywords (removed) @@ -1,1 +1,0 @@ -author date id revision Modified: trunk/reactos/dll/win32/kernel32/client/file/backup.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/client/…
============================================================================== --- trunk/reactos/dll/win32/kernel32/client/file/backup.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/client/file/backup.c [iso-8859-1] Wed Sep 26 17:49:14 2012 @@ -1,4 +1,4 @@ -/* $Id$ +/* $Id: backup.c 48475 2010-08-07 05:02:58Z sir_richard $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries Propchange: trunk/reactos/dll/win32/kernel32/client/file/backup.c ------------------------------------------------------------------------------ --- svn:keywords (original) +++ svn:keywords (removed) @@ -1,1 +1,0 @@ -author date id revision Modified: trunk/reactos/dll/win32/kernel32/client/file/cnotify.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/client/…
============================================================================== --- trunk/reactos/dll/win32/kernel32/client/file/cnotify.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/client/file/cnotify.c [iso-8859-1] Wed Sep 26 17:49:14 2012 @@ -1,4 +1,4 @@ -/* $Id$ +/* $Id: cnotify.c 55801 2012-02-21 23:27:45Z ion $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries Propchange: trunk/reactos/dll/win32/kernel32/client/file/cnotify.c ------------------------------------------------------------------------------ --- svn:keywords (original) +++ svn:keywords (removed) @@ -1,1 +1,0 @@ -author date id revision Modified: trunk/reactos/dll/win32/kernel32/client/file/console.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/client/…
============================================================================== --- trunk/reactos/dll/win32/kernel32/client/file/console.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/client/file/console.c [iso-8859-1] Wed Sep 26 17:49:14 2012 @@ -1,4 +1,4 @@ -/* $Id$ +/* $Id: console.c 55081 2012-01-22 22:27:08Z gadamopoulos $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries Propchange: trunk/reactos/dll/win32/kernel32/client/file/console.c ------------------------------------------------------------------------------ --- svn:keywords (original) +++ svn:keywords (removed) @@ -1,1 +1,0 @@ -author date id revision Modified: trunk/reactos/dll/win32/kernel32/client/file/copy.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/client/…
============================================================================== --- trunk/reactos/dll/win32/kernel32/client/file/copy.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/client/file/copy.c [iso-8859-1] Wed Sep 26 17:49:14 2012 @@ -1,4 +1,4 @@ -/* $Id$ +/* $Id: copy.c 55885 2012-02-27 17:10:44Z sir_richard $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries Propchange: trunk/reactos/dll/win32/kernel32/client/file/copy.c ------------------------------------------------------------------------------ --- svn:keywords (original) +++ svn:keywords (removed) @@ -1,1 +1,0 @@ -author date id revision Modified: trunk/reactos/dll/win32/kernel32/client/file/create.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/client/…
============================================================================== --- trunk/reactos/dll/win32/kernel32/client/file/create.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/client/file/create.c [iso-8859-1] Wed Sep 26 17:49:14 2012 @@ -1,4 +1,4 @@ -/* $Id$ +/* $Id: create.c 54326 2011-11-07 00:18:13Z ion $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries Propchange: trunk/reactos/dll/win32/kernel32/client/file/create.c ------------------------------------------------------------------------------ --- svn:keywords (original) +++ svn:keywords (removed) @@ -1,1 +1,0 @@ -author date id revision Modified: trunk/reactos/dll/win32/kernel32/client/file/delete.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/client/…
============================================================================== --- trunk/reactos/dll/win32/kernel32/client/file/delete.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/client/file/delete.c [iso-8859-1] Wed Sep 26 17:49:14 2012 @@ -1,4 +1,4 @@ -/* $Id$ +/* $Id: delete.c 56650 2012-05-23 16:51:22Z ion $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries Propchange: trunk/reactos/dll/win32/kernel32/client/file/delete.c ------------------------------------------------------------------------------ --- svn:keywords (original) +++ svn:keywords (removed) @@ -1,1 +1,0 @@ -author date id revision Propchange: trunk/reactos/dll/win32/kernel32/client/file/deviceio.c ------------------------------------------------------------------------------ --- svn:keywords (original) +++ svn:keywords (removed) @@ -1,1 +1,0 @@ -author date id revision Modified: trunk/reactos/dll/win32/kernel32/client/file/dir.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/client/…
============================================================================== --- trunk/reactos/dll/win32/kernel32/client/file/dir.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/client/file/dir.c [iso-8859-1] Wed Sep 26 17:49:14 2012 @@ -1,4 +1,4 @@ -/* $Id$ +/* $Id: dir.c 55866 2012-02-25 21:09:28Z khornicek $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries Propchange: trunk/reactos/dll/win32/kernel32/client/file/dir.c ------------------------------------------------------------------------------ --- svn:keywords (original) +++ svn:keywords (removed) @@ -1,1 +1,0 @@ -author date id revision Modified: trunk/reactos/dll/win32/kernel32/client/file/fileinfo.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/client/…
============================================================================== --- trunk/reactos/dll/win32/kernel32/client/file/fileinfo.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/client/file/fileinfo.c [iso-8859-1] Wed Sep 26 17:49:14 2012 @@ -1,4 +1,4 @@ -/* $Id$ +/* $Id: fileinfo.c 54326 2011-11-07 00:18:13Z ion $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries Propchange: trunk/reactos/dll/win32/kernel32/client/file/fileinfo.c ------------------------------------------------------------------------------ --- svn:keywords (original) +++ svn:keywords (removed) @@ -1,1 +1,0 @@ -author date id revision Propchange: trunk/reactos/dll/win32/kernel32/client/file/filemap.c ------------------------------------------------------------------------------ --- svn:keywords (original) +++ svn:keywords (removed) @@ -1,1 +1,0 @@ -author date id revision Modified: trunk/reactos/dll/win32/kernel32/client/file/find.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/client/…
============================================================================== --- trunk/reactos/dll/win32/kernel32/client/file/find.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/client/file/find.c [iso-8859-1] Wed Sep 26 17:49:14 2012 @@ -1,4 +1,4 @@ -/* $Id$ +/* $Id: find.c 53068 2011-08-04 22:18:01Z ion $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries Propchange: trunk/reactos/dll/win32/kernel32/client/file/find.c ------------------------------------------------------------------------------ --- svn:keywords (original) +++ svn:keywords (removed) @@ -1,1 +1,0 @@ -author date id revision Modified: trunk/reactos/dll/win32/kernel32/client/file/hardlink.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/client/…
============================================================================== --- trunk/reactos/dll/win32/kernel32/client/file/hardlink.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/client/file/hardlink.c [iso-8859-1] Wed Sep 26 17:49:14 2012 @@ -1,4 +1,4 @@ -/* $Id$ +/* $Id: hardlink.c 55790 2012-02-21 19:18:57Z ion $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries Propchange: trunk/reactos/dll/win32/kernel32/client/file/hardlink.c ------------------------------------------------------------------------------ --- svn:keywords (original) +++ svn:keywords (removed) @@ -1,1 +1,0 @@ -author date id revision Modified: trunk/reactos/dll/win32/kernel32/client/file/iocompl.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/client/…
============================================================================== --- trunk/reactos/dll/win32/kernel32/client/file/iocompl.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/client/file/iocompl.c [iso-8859-1] Wed Sep 26 17:49:14 2012 @@ -1,4 +1,4 @@ -/* $Id$ +/* $Id: iocompl.c 55793 2012-02-21 21:31:01Z ion $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries Propchange: trunk/reactos/dll/win32/kernel32/client/file/iocompl.c ------------------------------------------------------------------------------ --- svn:keywords (original) +++ svn:keywords (removed) @@ -1,1 +1,0 @@ -author date id revision Modified: trunk/reactos/dll/win32/kernel32/client/file/lfile.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/client/…
============================================================================== --- trunk/reactos/dll/win32/kernel32/client/file/lfile.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/client/file/lfile.c [iso-8859-1] Wed Sep 26 17:49:14 2012 @@ -1,4 +1,4 @@ -/* $Id$ +/* $Id: lfile.c 48475 2010-08-07 05:02:58Z sir_richard $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries Propchange: trunk/reactos/dll/win32/kernel32/client/file/lfile.c ------------------------------------------------------------------------------ --- svn:keywords (original) +++ svn:keywords (removed) @@ -1,1 +1,0 @@ -author date id revision Modified: trunk/reactos/dll/win32/kernel32/client/file/lock.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/client/…
============================================================================== --- trunk/reactos/dll/win32/kernel32/client/file/lock.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/client/file/lock.c [iso-8859-1] Wed Sep 26 17:49:14 2012 @@ -1,4 +1,4 @@ -/* $Id$ +/* $Id: lock.c 55795 2012-02-21 21:38:08Z ion $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries Propchange: trunk/reactos/dll/win32/kernel32/client/file/lock.c ------------------------------------------------------------------------------ --- svn:keywords (original) +++ svn:keywords (removed) @@ -1,1 +1,0 @@ -author date id revision Modified: trunk/reactos/dll/win32/kernel32/client/file/mailslot.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/client/…
============================================================================== --- trunk/reactos/dll/win32/kernel32/client/file/mailslot.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/client/file/mailslot.c [iso-8859-1] Wed Sep 26 17:49:14 2012 @@ -1,4 +1,4 @@ -/* $Id$ +/* $Id: mailslot.c 55791 2012-02-21 19:19:44Z ion $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries Propchange: trunk/reactos/dll/win32/kernel32/client/file/mailslot.c ------------------------------------------------------------------------------ --- svn:keywords (original) +++ svn:keywords (removed) @@ -1,1 +1,0 @@ -author date id revision Modified: trunk/reactos/dll/win32/kernel32/client/file/move.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/client/…
============================================================================== --- trunk/reactos/dll/win32/kernel32/client/file/move.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/client/file/move.c [iso-8859-1] Wed Sep 26 17:49:14 2012 @@ -1,4 +1,4 @@ -/* $Id$ +/* $Id: move.c 54326 2011-11-07 00:18:13Z ion $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries Propchange: trunk/reactos/dll/win32/kernel32/client/file/move.c ------------------------------------------------------------------------------ --- svn:keywords (original) +++ svn:keywords (removed) @@ -1,1 +1,0 @@ -author date id revision Propchange: trunk/reactos/dll/win32/kernel32/client/file/npipe.c ------------------------------------------------------------------------------ --- svn:keywords (original) +++ svn:keywords (removed) @@ -1,1 +1,0 @@ -author date id revision Modified: trunk/reactos/dll/win32/kernel32/client/file/rw.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/client/…
============================================================================== --- trunk/reactos/dll/win32/kernel32/client/file/rw.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/client/file/rw.c [iso-8859-1] Wed Sep 26 17:49:14 2012 @@ -1,4 +1,4 @@ -/* $Id$ +/* $Id: rw.c 54326 2011-11-07 00:18:13Z ion $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries Propchange: trunk/reactos/dll/win32/kernel32/client/file/rw.c ------------------------------------------------------------------------------ --- svn:keywords (original) +++ svn:keywords (removed) @@ -1,1 +1,0 @@ -author date id revision Modified: trunk/reactos/dll/win32/kernel32/client/file/tape.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/client/…
============================================================================== --- trunk/reactos/dll/win32/kernel32/client/file/tape.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/client/file/tape.c [iso-8859-1] Wed Sep 26 17:49:14 2012 @@ -1,4 +1,4 @@ -/* $Id$ +/* $Id: tape.c 54334 2011-11-07 07:41:52Z ion $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries Propchange: trunk/reactos/dll/win32/kernel32/client/file/tape.c ------------------------------------------------------------------------------ --- svn:keywords (original) +++ svn:keywords (removed) @@ -1,1 +1,0 @@ -author date id revision Modified: trunk/reactos/dll/win32/kernel32/client/file/volume.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/client/…
============================================================================== --- trunk/reactos/dll/win32/kernel32/client/file/volume.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/client/file/volume.c [iso-8859-1] Wed Sep 26 17:49:14 2012 @@ -1,4 +1,4 @@ -/* $Id$ +/* $Id: volume.c 52819 2011-07-23 18:54:29Z ion $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries Propchange: trunk/reactos/dll/win32/kernel32/client/file/volume.c ------------------------------------------------------------------------------ --- svn:keywords (original) +++ svn:keywords (removed) @@ -1,1 +1,0 @@ -author date id revision Propchange: trunk/reactos/dll/win32/kernel32/client/handle.c ------------------------------------------------------------------------------ --- svn:keywords (original) +++ svn:keywords (removed) @@ -1,1 +1,0 @@ -author date id revision Propchange: trunk/reactos/dll/win32/kernel32/client/heapmem.c ------------------------------------------------------------------------------ --- svn:keywords (original) +++ svn:keywords (removed) @@ -1,1 +1,0 @@ -author date id revision Propchange: trunk/reactos/dll/win32/kernel32/client/i386/fiber.S ------------------------------------------------------------------------------ --- svn:keywords (original) +++ svn:keywords (removed) @@ -1,1 +1,0 @@ -author date id revision Modified: trunk/reactos/dll/win32/kernel32/client/job.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/client/…
============================================================================== --- trunk/reactos/dll/win32/kernel32/client/job.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/client/job.c [iso-8859-1] Wed Sep 26 17:49:14 2012 @@ -1,4 +1,4 @@ -/* $Id$ +/* $Id: job.c 54306 2011-11-06 00:09:33Z pschweitzer $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries Propchange: trunk/reactos/dll/win32/kernel32/client/job.c ------------------------------------------------------------------------------ --- svn:keywords (original) +++ svn:keywords (removed) @@ -1,1 +1,0 @@ -author date id revision Propchange: trunk/reactos/dll/win32/kernel32/client/loader.c ------------------------------------------------------------------------------ --- svn:keywords (original) +++ svn:keywords (removed) @@ -1,1 +1,0 @@ -author date id revision Propchange: trunk/reactos/dll/win32/kernel32/client/perfcnt.c ------------------------------------------------------------------------------ --- svn:keywords (original) +++ svn:keywords (removed) @@ -1,1 +1,0 @@ -author date id revision Modified: trunk/reactos/dll/win32/kernel32/client/proc.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/client/…
============================================================================== --- trunk/reactos/dll/win32/kernel32/client/proc.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/client/proc.c [iso-8859-1] Wed Sep 26 17:49:14 2012 @@ -1,4 +1,4 @@ -/* $Id$ +/* $Id: proc.c 57086 2012-08-16 15:39:40Z akhaldi $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries Propchange: trunk/reactos/dll/win32/kernel32/client/proc.c ------------------------------------------------------------------------------ --- svn:keywords (original) +++ svn:keywords (removed) @@ -1,1 +1,0 @@ -author date id revision Propchange: trunk/reactos/dll/win32/kernel32/client/resntfy.c ------------------------------------------------------------------------------ --- svn:keywords (original) +++ svn:keywords (removed) @@ -1,1 +1,0 @@ -author date id revision Propchange: trunk/reactos/dll/win32/kernel32/client/session.c ------------------------------------------------------------------------------ --- svn:keywords (original) +++ svn:keywords (removed) @@ -1,1 +1,0 @@ -author date id revision Propchange: trunk/reactos/dll/win32/kernel32/client/synch.c ------------------------------------------------------------------------------ --- svn:keywords (original) +++ svn:keywords (removed) @@ -1,1 +1,0 @@ -author date id revision Propchange: trunk/reactos/dll/win32/kernel32/client/sysinfo.c ------------------------------------------------------------------------------ --- svn:keywords (original) +++ svn:keywords (removed) @@ -1,1 +1,0 @@ -author date id revision Propchange: trunk/reactos/dll/win32/kernel32/client/thread.c ------------------------------------------------------------------------------ --- svn:keywords (original) +++ svn:keywords (removed) @@ -1,1 +1,0 @@ -author date id revision Propchange: trunk/reactos/dll/win32/kernel32/client/timerqueue.c ------------------------------------------------------------------------------ --- svn:keywords (original) +++ svn:keywords (removed) @@ -1,1 +1,0 @@ -author date id revision Modified: trunk/reactos/dll/win32/kernel32/client/toolhelp.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/client/…
============================================================================== --- trunk/reactos/dll/win32/kernel32/client/toolhelp.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/client/toolhelp.c [iso-8859-1] Wed Sep 26 17:49:14 2012 @@ -1,4 +1,4 @@ -/* $Id$ +/* $Id: toolhelp.c 54071 2011-10-10 12:14:12Z tfaber $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries Propchange: trunk/reactos/dll/win32/kernel32/client/toolhelp.c ------------------------------------------------------------------------------ --- svn:keywords (original) +++ svn:keywords (removed) @@ -1,1 +1,0 @@ -author date id revision Propchange: trunk/reactos/dll/win32/kernel32/client/version.c ------------------------------------------------------------------------------ --- svn:keywords (original) +++ svn:keywords (removed) @@ -1,1 +1,0 @@ -author date id revision Propchange: trunk/reactos/dll/win32/kernel32/client/virtmem.c ------------------------------------------------------------------------------ --- svn:keywords (original) +++ svn:keywords (removed) @@ -1,1 +1,0 @@ -author date id revision Propchange: trunk/reactos/dll/win32/kernel32/include/kernel32.h ------------------------------------------------------------------------------ --- svn:keywords (original) +++ svn:keywords (removed) @@ -1,1 +1,0 @@ -author date id revision Propchange: trunk/reactos/dll/win32/kernel32/k32.h ------------------------------------------------------------------------------ --- svn:keywords (original) +++ svn:keywords (removed) @@ -1,1 +1,0 @@ -author date id revision Propchange: trunk/reactos/dll/win32/kernel32/kernel32.rc ------------------------------------------------------------------------------ --- svn:keywords (original) +++ svn:keywords (removed) @@ -1,1 +1,0 @@ -author date id revision Propchange: trunk/reactos/dll/win32/kernel32/wine/comm.c ------------------------------------------------------------------------------ --- svn:keywords (original) +++ svn:keywords (removed) @@ -1,1 +1,0 @@ -author date id revision Modified: trunk/reactos/dll/win32/kernel32/wine/lzexpand.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/wine/lz…
============================================================================== --- trunk/reactos/dll/win32/kernel32/wine/lzexpand.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/wine/lzexpand.c [iso-8859-1] Wed Sep 26 17:49:14 2012 @@ -1,4 +1,4 @@ -/* $Id$ +/* $Id: lzexpand.c 52854 2011-07-24 23:42:09Z ion $ * * LZ Decompression functions * Propchange: trunk/reactos/dll/win32/kernel32/wine/lzexpand.c ------------------------------------------------------------------------------ --- svn:keywords (original) +++ svn:keywords (removed) @@ -1,1 +1,0 @@ -author date id revision Modified: trunk/reactos/dll/win32/kernel32/wine/muldiv.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/wine/mu…
============================================================================== --- trunk/reactos/dll/win32/kernel32/wine/muldiv.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/wine/muldiv.c [iso-8859-1] Wed Sep 26 17:49:14 2012 @@ -1,4 +1,4 @@ -/* $Id$ +/* $Id: muldiv.c 37829 2008-12-03 17:33:13Z dgorbachev $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries Propchange: trunk/reactos/dll/win32/kernel32/wine/muldiv.c ------------------------------------------------------------------------------ --- svn:keywords (original) +++ svn:keywords (removed) @@ -1,1 +1,0 @@ -author date id revision Propchange: trunk/reactos/dll/win32/kernel32/wine/profile.c ------------------------------------------------------------------------------ --- svn:keywords (original) +++ svn:keywords (removed) @@ -1,1 +1,0 @@ -author date id revision Propchange: trunk/reactos/dll/win32/kernel32/wine/res.c ------------------------------------------------------------------------------ --- svn:keywords (original) +++ svn:keywords (removed) @@ -1,1 +1,0 @@ -author date id revision Modified: trunk/reactos/dll/win32/kernel32/wine/timezone.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/wine/ti…
============================================================================== --- trunk/reactos/dll/win32/kernel32/wine/timezone.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/wine/timezone.c [iso-8859-1] Wed Sep 26 17:49:14 2012 @@ -1,4 +1,4 @@ -/* $Id$ +/* $Id: timezone.c 52819 2011-07-23 18:54:29Z ion $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries Propchange: trunk/reactos/dll/win32/kernel32/wine/timezone.c ------------------------------------------------------------------------------ --- svn:keywords (original) +++ svn:keywords (removed) @@ -1,1 +1,0 @@ -author date id revision Propchange: trunk/reactos/dll/win32/kernel32/winnls/locale_rc.rc ------------------------------------------------------------------------------ --- svn:keywords (original) +++ svn:keywords (removed) @@ -1,1 +1,0 @@ -author date id revision Propchange: trunk/reactos/dll/win32/kernel32/winnls/nls/deu.nls ------------------------------------------------------------------------------ --- svn:keywords (original) +++ svn:keywords (removed) @@ -1,1 +1,0 @@ -author date id revision Propchange: trunk/reactos/dll/win32/kernel32/winnls/nls/eng.nls ------------------------------------------------------------------------------ --- svn:keywords (original) +++ svn:keywords (removed) @@ -1,1 +1,0 @@ -author date id revision Propchange: trunk/reactos/dll/win32/kernel32/winnls/nls/enu.nls ------------------------------------------------------------------------------ --- svn:keywords (original) +++ svn:keywords (removed) @@ -1,1 +1,0 @@ -author date id revision Propchange: trunk/reactos/dll/win32/kernel32/winnls/nls/fra.nls ------------------------------------------------------------------------------ --- svn:keywords (original) +++ svn:keywords (removed) @@ -1,1 +1,0 @@ -author date id revision Propchange: trunk/reactos/dll/win32/kernel32/winnls/string/lang.c ------------------------------------------------------------------------------ --- svn:keywords (original) +++ svn:keywords (removed) @@ -1,1 +1,0 @@ -author date id revision Propchange: trunk/reactos/dll/win32/kernel32/winnls/string/lcformat.c ------------------------------------------------------------------------------ --- svn:keywords (original) +++ svn:keywords (removed) @@ -1,1 +1,0 @@ -author date id revision Propchange: trunk/reactos/dll/win32/kernel32/winnls/string/lstring.c ------------------------------------------------------------------------------ --- svn:keywords (original) +++ svn:keywords (removed) @@ -1,1 +1,0 @@ -author date id revision Modified: trunk/reactos/dll/win32/kernel32/winnls/string/nls.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/winnls/…
============================================================================== --- trunk/reactos/dll/win32/kernel32/winnls/string/nls.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/winnls/string/nls.c [iso-8859-1] Wed Sep 26 17:49:14 2012 @@ -1,4 +1,4 @@ -/* $Id$ +/* $Id: nls.c 52854 2011-07-24 23:42:09Z ion $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries Propchange: trunk/reactos/dll/win32/kernel32/winnls/string/nls.c ------------------------------------------------------------------------------ --- svn:keywords (original) +++ svn:keywords (removed) @@ -1,1 +1,0 @@ -author date id revision
12 years, 3 months
1
0
0
0
[ekohl] 57391: [LSASRV] - Implement most missing information classes of LsarQueryInformationPolicy. - Add initialization code for new attributes of the policy object. - Implement LsarQueryInformati...
by ekohl@svn.reactos.org
Author: ekohl Date: Wed Sep 26 16:15:29 2012 New Revision: 57391 URL:
http://svn.reactos.org/svn/reactos?rev=57391&view=rev
Log: [LSASRV] - Implement most missing information classes of LsarQueryInformationPolicy. - Add initialization code for new attributes of the policy object. - Implement LsarQueryInformationPolicy2 and LsarSetInformationPolicy2. Modified: trunk/reactos/dll/win32/lsasrv/database.c trunk/reactos/dll/win32/lsasrv/lsarpc.c trunk/reactos/dll/win32/lsasrv/lsasrv.h trunk/reactos/dll/win32/lsasrv/policy.c trunk/reactos/include/reactos/idl/lsa.idl Modified: trunk/reactos/dll/win32/lsasrv/database.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/lsasrv/database.…
============================================================================== --- trunk/reactos/dll/win32/lsasrv/database.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/lsasrv/database.c [iso-8859-1] Wed Sep 26 16:15:29 2012 @@ -226,9 +226,17 @@ static NTSTATUS LsapCreateDatabaseObjects(VOID) { + PLSAP_POLICY_AUDIT_EVENTS_DATA AuditEventsInfo = NULL; POLICY_DEFAULT_QUOTA_INFO QuotaInfo; + POLICY_MODIFICATION_INFO ModificationInfo; + POLICY_AUDIT_FULL_QUERY_INFO AuditFullInfo = {FALSE, FALSE}; + POLICY_AUDIT_LOG_INFO AuditLogInfo; + PLSA_DB_OBJECT PolicyObject = NULL; PSID AccountDomainSid = NULL; + ULONG AuditEventsCount; + ULONG AuditEventsSize; + ULONG i; NTSTATUS Status; /* Initialize the default quota limits */ @@ -239,10 +247,35 @@ QuotaInfo.QuotaLimits.PagefileLimit = 0; QuotaInfo.QuotaLimits.TimeLimit.QuadPart = 0; + /* Initialize the audit log attribute */ + AuditLogInfo.AuditLogPercentFull = 0; + AuditLogInfo.MaximumLogSize = 0; // DWORD + AuditLogInfo.AuditRetentionPeriod.QuadPart = 0; // LARGE_INTEGER + AuditLogInfo.AuditLogFullShutdownInProgress = 0; // BYTE + AuditLogInfo.TimeToShutdown.QuadPart = 0; // LARGE_INTEGER + AuditLogInfo.NextAuditRecordId = 0; // DWORD + + AuditEventsCount = AuditCategoryAccountLogon - AuditCategorySystem + 1; + AuditEventsSize = sizeof(LSAP_POLICY_AUDIT_EVENTS_DATA) + AuditEventsCount * sizeof(DWORD); + AuditEventsInfo = RtlAllocateHeap(RtlGetProcessHeap(), + 0, + AuditEventsSize); + if (AuditEventsInfo == NULL) + return STATUS_INSUFFICIENT_RESOURCES; + + AuditEventsInfo->AuditingMode = FALSE; + AuditEventsInfo->MaximumAuditEventCount = AuditEventsCount; + for (i = 0; i < AuditEventsCount; i++) + AuditEventsInfo->AuditEvents[i] = 0; + + /* Initialize the modification attribute */ + ModificationInfo.ModifiedId.QuadPart = 0; + NtQuerySystemTime(&ModificationInfo.DatabaseCreationTime); + /* Create a random domain SID */ Status = LsapCreateRandomDomainSid(&AccountDomainSid); if (!NT_SUCCESS(Status)) - return Status; + goto done; /* Open the 'Policy' object */ Status = LsapOpenDbObject(NULL, @@ -279,7 +312,34 @@ &QuotaInfo, sizeof(POLICY_DEFAULT_QUOTA_INFO)); + /* Set the modification attribute */ + LsapSetObjectAttribute(PolicyObject, + L"PolMod", + &ModificationInfo, + sizeof(POLICY_MODIFICATION_INFO)); + + /* Set the audit full attribute */ + LsapSetObjectAttribute(PolicyObject, + L"PolAdtFl", + &AuditFullInfo, + sizeof(POLICY_AUDIT_FULL_QUERY_INFO)); + + /* Set the audit log attribute */ + LsapSetObjectAttribute(PolicyObject, + L"PolAdtLg", + &AuditLogInfo, + sizeof(POLICY_AUDIT_LOG_INFO)); + + /* Set the audit events attribute */ + LsapSetObjectAttribute(PolicyObject, + L"PolAdtEv", + &AuditEventsInfo, + AuditEventsSize); + done: + if (AuditEventsInfo != NULL) + RtlFreeHeap(RtlGetProcessHeap(), 0, AuditEventsInfo); + if (PolicyObject != NULL) LsapCloseDbObject(PolicyObject); Modified: trunk/reactos/dll/win32/lsasrv/lsarpc.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/lsasrv/lsarpc.c?…
============================================================================== --- trunk/reactos/dll/win32/lsasrv/lsarpc.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/lsasrv/lsarpc.c [iso-8859-1] Wed Sep 26 16:15:29 2012 @@ -222,7 +222,6 @@ DesiredAccess = POLICY_GET_PRIVATE_INFORMATION; break; - case PolicyLastEntry: default: ERR("Invalid InformationClass!\n"); return STATUS_INVALID_PARAMETER; @@ -237,6 +236,10 @@ switch (InformationClass) { + case PolicyAuditLogInformation: /* 1 */ + Status = LsarQueryAuditLog(PolicyHandle, + PolicyInformation); + case PolicyAuditEventsInformation: /* 2 */ Status = LsarQueryAuditEvents(PolicyHandle, PolicyInformation); @@ -247,35 +250,54 @@ PolicyInformation); break; + case PolicyPdAccountInformation: /* 4 */ + Status = LsarQueryPdAccount(PolicyHandle, + PolicyInformation); + case PolicyAccountDomainInformation: /* 5 */ Status = LsarQueryAccountDomain(PolicyHandle, PolicyInformation); break; - case PolicyDefaultQuotaInformation: /* 8 */ + case PolicyLsaServerRoleInformation: /* 6 */ + Status = LsarQueryServerRole(PolicyHandle, + PolicyInformation); + break; + + case PolicyReplicaSourceInformation: /* 7 */ + Status = LsarQueryReplicaSource(PolicyHandle, + PolicyInformation); + + case PolicyDefaultQuotaInformation: /* 8 */ Status = LsarQueryDefaultQuota(PolicyHandle, PolicyInformation); break; - case PolicyDnsDomainInformation: /* 12 (0xc) */ + case PolicyModificationInformation: /* 9 */ + Status = LsarQueryModification(PolicyHandle, + PolicyInformation); + break; + + case PolicyAuditFullQueryInformation: /* 11 (0xB) */ + Status = LsarQueryAuditFull(PolicyHandle, + PolicyInformation); + break; + + case PolicyDnsDomainInformation: /* 12 (0xC) */ Status = LsarQueryDnsDomain(PolicyHandle, PolicyInformation); break; - case PolicyAuditLogInformation: - case PolicyPdAccountInformation: - case PolicyLsaServerRoleInformation: - case PolicyReplicaSourceInformation: - case PolicyModificationInformation: - case PolicyAuditFullSetInformation: - case PolicyAuditFullQueryInformation: - case PolicyDnsDomainInformationInt: - case PolicyLocalAccountDomainInformation: - FIXME("Information class not implemented\n"); - Status = STATUS_UNSUCCESSFUL; + case PolicyDnsDomainInformationInt: /* 13 (0xD) */ + Status = LsarQueryDnsDomainInt(PolicyHandle, + PolicyInformation); break; - case PolicyLastEntry: + case PolicyLocalAccountDomainInformation: /* 14 (0xE) */ + Status = LsarQueryLocalAccountDomain(PolicyHandle, + PolicyInformation); + break; + default: ERR("Invalid InformationClass!\n"); Status = STATUS_INVALID_PARAMETER; @@ -316,6 +338,9 @@ case PolicyPrimaryDomainInformation: case PolicyAccountDomainInformation: + case PolicyDnsDomainInformation: + case PolicyDnsDomainInformationInt: + case PolicyLocalAccountDomainInformation: DesiredAccess = POLICY_TRUST_ADMIN; break; @@ -1761,10 +1786,11 @@ NTSTATUS WINAPI LsarQueryInformationPolicy2( LSAPR_HANDLE PolicyHandle, POLICY_INFORMATION_CLASS InformationClass, - unsigned long *PolicyInformation) -{ - UNIMPLEMENTED; - return STATUS_NOT_IMPLEMENTED; + PLSAPR_POLICY_INFORMATION *PolicyInformation) +{ + return LsarQueryInformationPolicy(PolicyHandle, + InformationClass, + PolicyInformation); } @@ -1772,10 +1798,11 @@ NTSTATUS WINAPI LsarSetInformationPolicy2( LSAPR_HANDLE PolicyHandle, POLICY_INFORMATION_CLASS InformationClass, - unsigned long PolicyInformation) -{ - UNIMPLEMENTED; - return STATUS_NOT_IMPLEMENTED; + PLSAPR_POLICY_INFORMATION PolicyInformation) +{ + return LsarSetInformationPolicy(PolicyHandle, + InformationClass, + PolicyInformation); } Modified: trunk/reactos/dll/win32/lsasrv/lsasrv.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/lsasrv/lsasrv.h?…
============================================================================== --- trunk/reactos/dll/win32/lsasrv/lsasrv.h [iso-8859-1] (original) +++ trunk/reactos/dll/win32/lsasrv/lsasrv.h [iso-8859-1] Wed Sep 26 16:15:29 2012 @@ -53,6 +53,14 @@ #define LSAP_DB_SIGNATURE 0x12345678 +typedef struct _LSAP_POLICY_AUDIT_EVENTS_DATA +{ + BOOLEAN AuditingMode; + DWORD MaximumAuditEventCount; + DWORD AuditEvents[0]; +} LSAP_POLICY_AUDIT_EVENTS_DATA, *PLSAP_POLICY_AUDIT_EVENTS_DATA; + + /* authport.c */ NTSTATUS StartAuthenticationPort(VOID); @@ -102,6 +110,10 @@ /* policy.c */ NTSTATUS +LsarQueryAuditLog(PLSA_DB_OBJECT PolicyObject, + PLSAPR_POLICY_INFORMATION *PolicyInformation); + +NTSTATUS LsarQueryAuditEvents(PLSA_DB_OBJECT PolicyObject, PLSAPR_POLICY_INFORMATION *PolicyInformation); @@ -110,7 +122,19 @@ PLSAPR_POLICY_INFORMATION *PolicyInformation); NTSTATUS +LsarQueryPdAccount(PLSA_DB_OBJECT PolicyObject, + PLSAPR_POLICY_INFORMATION *PolicyInformation); + +NTSTATUS LsarQueryAccountDomain(PLSA_DB_OBJECT PolicyObject, + PLSAPR_POLICY_INFORMATION *PolicyInformation); + +NTSTATUS +LsarQueryServerRole(PLSA_DB_OBJECT PolicyObject, + PLSAPR_POLICY_INFORMATION *PolicyInformation); + +NTSTATUS +LsarQueryReplicaSource(PLSA_DB_OBJECT PolicyObject, PLSAPR_POLICY_INFORMATION *PolicyInformation); NTSTATUS @@ -118,8 +142,24 @@ PLSAPR_POLICY_INFORMATION *PolicyInformation); NTSTATUS +LsarQueryModification(PLSA_DB_OBJECT PolicyObject, + PLSAPR_POLICY_INFORMATION *PolicyInformation); + +NTSTATUS +LsarQueryAuditFull(PLSA_DB_OBJECT PolicyObject, + PLSAPR_POLICY_INFORMATION *PolicyInformation); + +NTSTATUS LsarQueryDnsDomain(PLSA_DB_OBJECT PolicyObject, PLSAPR_POLICY_INFORMATION *PolicyInformation); + +NTSTATUS +LsarQueryDnsDomainInt(PLSA_DB_OBJECT PolicyObject, + PLSAPR_POLICY_INFORMATION *PolicyInformation); + +NTSTATUS +LsarQueryLocalAccountDomain(PLSA_DB_OBJECT PolicyObject, + PLSAPR_POLICY_INFORMATION *PolicyInformation); NTSTATUS LsarSetPrimaryDomain(PLSA_DB_OBJECT PolicyObject, Modified: trunk/reactos/dll/win32/lsasrv/policy.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/lsasrv/policy.c?…
============================================================================== --- trunk/reactos/dll/win32/lsasrv/policy.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/lsasrv/policy.c [iso-8859-1] Wed Sep 26 16:15:29 2012 @@ -119,20 +119,105 @@ NTSTATUS +LsarQueryAuditLog(PLSA_DB_OBJECT PolicyObject, + PLSAPR_POLICY_INFORMATION *PolicyInformation) +{ + PPOLICY_AUDIT_LOG_INFO AuditLogInfo = NULL; + ULONG AttributeSize; + NTSTATUS Status; + + *PolicyInformation = NULL; + + AttributeSize = sizeof(POLICY_AUDIT_LOG_INFO); + AuditLogInfo = MIDL_user_allocate(AttributeSize); + if (AuditLogInfo == NULL) + return STATUS_INSUFFICIENT_RESOURCES; + + Status = LsapGetObjectAttribute(PolicyObject, + L"PolAdtLg", + AuditLogInfo, + &AttributeSize); + if (!NT_SUCCESS(Status)) + { + MIDL_user_free(AuditLogInfo); + } + else + { + *PolicyInformation = (PLSAPR_POLICY_INFORMATION)AuditLogInfo; + } + + return Status; +} + + +NTSTATUS LsarQueryAuditEvents(PLSA_DB_OBJECT PolicyObject, PLSAPR_POLICY_INFORMATION *PolicyInformation) { + PLSAP_POLICY_AUDIT_EVENTS_DATA AuditData = NULL; PLSAPR_POLICY_AUDIT_EVENTS_INFO p = NULL; - - p = MIDL_user_allocate(sizeof(LSAPR_POLICY_AUDIT_EVENTS_INFO)); - if (p == NULL) - return STATUS_INSUFFICIENT_RESOURCES; - - p->AuditingMode = FALSE; /* no auditing */ - p->EventAuditingOptions = NULL; - p->MaximumAuditEventCount = 0; + ULONG AttributeSize; + NTSTATUS Status = STATUS_SUCCESS; + + *PolicyInformation = NULL; + + AttributeSize = 0; + Status = LsapGetObjectAttribute(PolicyObject, + L"PolAdtEv", + NULL, + &AttributeSize); + if (!NT_SUCCESS(Status)) + return Status; + + if (AttributeSize > 0) + { + AuditData = MIDL_user_allocate(AttributeSize); + if (AuditData == NULL) + return STATUS_INSUFFICIENT_RESOURCES; + + Status = LsapGetObjectAttribute(PolicyObject, + L"PolAdtEv", + AuditData, + &AttributeSize); + if (!NT_SUCCESS(Status)) + goto done; + + p = MIDL_user_allocate(sizeof(LSAPR_POLICY_AUDIT_EVENTS_INFO)); + if (p == NULL) + { + Status = STATUS_INSUFFICIENT_RESOURCES; + goto done; + } + + p->AuditingMode = AuditData->AuditingMode; + p->MaximumAuditEventCount = AuditData->MaximumAuditEventCount; + + p->EventAuditingOptions = MIDL_user_allocate(AuditData->MaximumAuditEventCount * sizeof(DWORD)); + if (p->EventAuditingOptions == NULL) + { + Status = STATUS_INSUFFICIENT_RESOURCES; + goto done; + } + + memcpy(p->EventAuditingOptions, + &(AuditData->AuditEvents[0]), + AuditData->MaximumAuditEventCount * sizeof(DWORD)); + } *PolicyInformation = (PLSAPR_POLICY_INFORMATION)p; + +done: + if (!NT_SUCCESS(Status)) + { + if (p->EventAuditingOptions != NULL) + MIDL_user_free(p->EventAuditingOptions); + + if (p != NULL) + MIDL_user_free(p); + } + + if (AuditData != NULL) + MIDL_user_free(AuditData); return STATUS_SUCCESS; } @@ -249,6 +334,28 @@ NTSTATUS +LsarQueryPdAccount(PLSA_DB_OBJECT PolicyObject, + PLSAPR_POLICY_INFORMATION *PolicyInformation) +{ + PLSAPR_POLICY_PD_ACCOUNT_INFO PdAccountInfo = NULL; + + *PolicyInformation = NULL; + + PdAccountInfo = MIDL_user_allocate(sizeof(LSAPR_POLICY_PD_ACCOUNT_INFO)); + if (PdAccountInfo == NULL) + return STATUS_INSUFFICIENT_RESOURCES; + + PdAccountInfo->Name.Length = 0; + PdAccountInfo->Name.MaximumLength = 0; + PdAccountInfo->Name.Buffer = NULL; + + *PolicyInformation = (PLSAPR_POLICY_INFORMATION)PdAccountInfo; + + return STATUS_SUCCESS; +} + + +NTSTATUS LsarQueryAccountDomain(PLSA_DB_OBJECT PolicyObject, PLSAPR_POLICY_INFORMATION *PolicyInformation) { @@ -358,6 +465,44 @@ NTSTATUS +LsarQueryServerRole(PLSA_DB_OBJECT PolicyObject, + PLSAPR_POLICY_INFORMATION *PolicyInformation) +{ + PPOLICY_LSA_SERVER_ROLE_INFO ServerRoleInfo = NULL; + ULONG AttributeSize; + NTSTATUS Status; + + *PolicyInformation = NULL; + + AttributeSize = sizeof(POLICY_LSA_SERVER_ROLE_INFO); + ServerRoleInfo = MIDL_user_allocate(AttributeSize); + if (ServerRoleInfo == NULL) + return STATUS_INSUFFICIENT_RESOURCES; + + Status = LsapGetObjectAttribute(PolicyObject, + L"PolSrvRo", + ServerRoleInfo, + &AttributeSize); + if (Status == STATUS_OBJECT_NAME_NOT_FOUND) + { + ServerRoleInfo->LsaServerRole = PolicyServerRolePrimary; + Status = STATUS_SUCCESS; + } + + if (!NT_SUCCESS(Status)) + { + MIDL_user_free(ServerRoleInfo); + } + else + { + *PolicyInformation = (PLSAPR_POLICY_INFORMATION)ServerRoleInfo; + } + + return Status; +} + + +NTSTATUS LsarQueryDefaultQuota(PLSA_DB_OBJECT PolicyObject, PLSAPR_POLICY_INFORMATION *PolicyInformation) { @@ -383,6 +528,79 @@ else { *PolicyInformation = (PLSAPR_POLICY_INFORMATION)QuotaInfo; + } + + return Status; +} + + +NTSTATUS +LsarQueryReplicaSource(PLSA_DB_OBJECT PolicyObject, + PLSAPR_POLICY_INFORMATION *PolicyInformation) +{ + *PolicyInformation = NULL; + return STATUS_NOT_IMPLEMENTED; +} + + +NTSTATUS +LsarQueryModification(PLSA_DB_OBJECT PolicyObject, + PLSAPR_POLICY_INFORMATION *PolicyInformation) +{ + PPOLICY_MODIFICATION_INFO Info = NULL; + ULONG AttributeSize; + NTSTATUS Status; + + *PolicyInformation = NULL; + + AttributeSize = sizeof(POLICY_MODIFICATION_INFO); + Info = MIDL_user_allocate(AttributeSize); + if (Info == NULL) + return STATUS_INSUFFICIENT_RESOURCES; + + Status = LsapGetObjectAttribute(PolicyObject, + L"PolMod", + Info, + &AttributeSize); + if (!NT_SUCCESS(Status)) + { + MIDL_user_free(Info); + } + else + { + *PolicyInformation = (PLSAPR_POLICY_INFORMATION)Info; + } + + return Status; +} + + +NTSTATUS +LsarQueryAuditFull(PLSA_DB_OBJECT PolicyObject, + PLSAPR_POLICY_INFORMATION *PolicyInformation) +{ + PPOLICY_AUDIT_FULL_QUERY_INFO AuditFullInfo = NULL; + ULONG AttributeSize; + NTSTATUS Status; + + *PolicyInformation = NULL; + + AttributeSize = sizeof(POLICY_AUDIT_FULL_QUERY_INFO); + AuditFullInfo = MIDL_user_allocate(AttributeSize); + if (AuditFullInfo == NULL) + return STATUS_INSUFFICIENT_RESOURCES; + + Status = LsapGetObjectAttribute(PolicyObject, + L"PolAdtFl", + AuditFullInfo, + &AttributeSize); + if (!NT_SUCCESS(Status)) + { + MIDL_user_free(AuditFullInfo); + } + else + { + *PolicyInformation = (PLSAPR_POLICY_INFORMATION)AuditFullInfo; } return Status; @@ -432,4 +650,22 @@ return STATUS_SUCCESS; } + +NTSTATUS +LsarQueryDnsDomainInt(PLSA_DB_OBJECT PolicyObject, + PLSAPR_POLICY_INFORMATION *PolicyInformation) +{ + *PolicyInformation = NULL; + return STATUS_NOT_IMPLEMENTED; +} + + +NTSTATUS +LsarQueryLocalAccountDomain(PLSA_DB_OBJECT PolicyObject, + PLSAPR_POLICY_INFORMATION *PolicyInformation) +{ + *PolicyInformation = NULL; + return STATUS_NOT_IMPLEMENTED; +} + /* EOF */ Modified: trunk/reactos/include/reactos/idl/lsa.idl URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/idl/lsa.id…
============================================================================== --- trunk/reactos/include/reactos/idl/lsa.idl [iso-8859-1] (original) +++ trunk/reactos/include/reactos/idl/lsa.idl [iso-8859-1] Wed Sep 26 16:15:29 2012 @@ -240,14 +240,14 @@ DWORD AuditLogPercentFull; DWORD MaximumLogSize; LARGE_INTEGER AuditRetentionPeriod; - BYTE AuditLogFullShutdownInProgress; + BOOLEAN AuditLogFullShutdownInProgress; LARGE_INTEGER TimeToShutdown; DWORD NextAuditRecordId; } POLICY_AUDIT_LOG_INFO, *PPOLICY_AUDIT_LOG_INFO; cpp_quote("#endif") typedef struct _LSAPR_POLICY_AUDIT_EVENTS_INFO { - BYTE AuditingMode; + BOOLEAN AuditingMode; [size_is(MaximumAuditEventCount)] DWORD *EventAuditingOptions; DWORD MaximumAuditEventCount; } LSAPR_POLICY_AUDIT_EVENTS_INFO, *PLSAPR_POLICY_AUDIT_EVENTS_INFO; @@ -889,15 +889,13 @@ NTSTATUS __stdcall LsarQueryInformationPolicy2( [in] LSAPR_HANDLE PolicyHandle, [in] POLICY_INFORMATION_CLASS InformationClass, - [out] unsigned long *PolicyInformation); - /* FIXME: should be [out, switch_is(InformationClass)] PLSAPR_POLICY_INFORMATION *PolicyInformation); */ + [out, switch_is(InformationClass)] PLSAPR_POLICY_INFORMATION *PolicyInformation); /* Function 47 */ NTSTATUS __stdcall LsarSetInformationPolicy2( [in] LSAPR_HANDLE PolicyHandle, [in] POLICY_INFORMATION_CLASS InformationClass, - [in] unsigned long PolicyInformation); - /* FIXME: should be [in, switch_is(InformationClass)] PLSAPR_POLICY_INFORMATION PolicyInformation); */ + [in, switch_is(InformationClass)] PLSAPR_POLICY_INFORMATION PolicyInformation); /* Function 48 */ NTSTATUS __stdcall LsarQueryTrustedDomainInfoByName(
12 years, 3 months
1
0
0
0
[mnordell] 57390: [ROSTEST:APITEST:NTDLL] Give RtlDosPathNameToNtPathName_U more descriptive failure messages, and more tests.
by mnordell@svn.reactos.org
Author: mnordell Date: Wed Sep 26 15:06:56 2012 New Revision: 57390 URL:
http://svn.reactos.org/svn/reactos?rev=57390&view=rev
Log: [ROSTEST:APITEST:NTDLL] Give RtlDosPathNameToNtPathName_U more descriptive failure messages, and more tests. Modified: trunk/rostests/apitests/ntdll/RtlDosPathNameToNtPathName_U.c Modified: trunk/rostests/apitests/ntdll/RtlDosPathNameToNtPathName_U.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/ntdll/RtlDosPath…
============================================================================== --- trunk/rostests/apitests/ntdll/RtlDosPathNameToNtPathName_U.c [iso-8859-1] (original) +++ trunk/rostests/apitests/ntdll/RtlDosPathNameToNtPathName_U.c [iso-8859-1] Wed Sep 26 15:06:56 2012 @@ -77,7 +77,7 @@ typedef BOOLEAN (__stdcall *RtlDosPathNameToNtPathName_U_t)(PCWSTR,PUNICODE_STRING,PCWSTR*,PRTL_RELATIVE_NAME_U); -RtlDosPathNameToNtPathName_U_t RtlDosPathNameToNtPathName_U; +static RtlDosPathNameToNtPathName_U_t RtlDosPathNameToNtPathName_U; #endif // !COMPILE_AS_ROSTEST @@ -85,10 +85,10 @@ static void check_result(BOOLEAN bOK, const char* pszErr) { #ifdef COMPILE_AS_ROSTEST - ok(bOK, "%s\n", pszErr); + ok(bOK, "%s.\n", pszErr); #else if (!bOK) { - printf("\a** %s!\n", pszErr); + printf("\a** %s.\n", pszErr); } #endif } @@ -128,12 +128,7 @@ printf("--------------------------\n"); printf("in : \"%S\"\n", pwsz); prucs("NtName", &NtName); - if (PartName) { - printf("PartName : \"%S\"\n", PartName); - } else { - // This is not the place to test that printf handles NULL strings. - printf("PartName : (null)\n"); - } + printf("PartName : \"%S\"\n", PartName ? PartName : L"(null)"); // prucs("RelativeName", &RelativeName.RelativeName); #endif @@ -151,9 +146,10 @@ const size_t lenAct = (NtName.Length - 8) / 2; bOK = (lenExp == lenAct) && memcmp(pwszActual, pwszExpected, lenExp * 2) == 0; - check_result(bOK, "Actual NtName does not match expectations!"); + check_result(bOK, "NtName does not match expected"); if (!bOK) { + printf("input: : %2u chars \"%S\"\n", wcslen(pwsz), pwsz); printf("Expected: %2u chars \"%S\"\n", lenExp, pwszExpected); printf("Actual : %2u chars \"%S\"\n", lenAct, lenAct ? pwszActual : L"(null)"); return; @@ -163,28 +159,29 @@ { PWSTR pwszActual = NtName.Buffer + 4; const size_t lenAct = (NtName.Length - 8) / 2; - check_result(FALSE, "Actual NtName does not match expectations!"); + check_result(FALSE, "Unexpected NtName (expected NULL)"); + printf("input: : %2u chars \"%S\"\n", wcslen(pwsz), pwsz); printf("Actual : %2u chars \"%S\"\n", lenAct, pwszActual); } if (pwszExpectedPartName) { - if (!PartName) { - check_result(FALSE, "Actual PartName is unexpectedly NULL!"); - printf("Expected: \"%S\"\n", pwszExpectedPartName); - return; - } - bOK = wcscmp(PartName, pwszExpectedPartName) == 0; - check_result(bOK, "Actual PartName does not match expected!"); + const size_t lenExp = wcslen(pwszExpectedPartName); + const size_t lenAct = PartName ? wcslen(PartName) : 0; + bOK = (lenExp == lenAct) && + wcscmp(PartName, pwszExpectedPartName) == 0; + check_result(bOK, "PartName does not match expected"); if (!bOK) { - printf("Expected: \"%S\"\n", pwszExpectedPartName); - printf("Actual : \"%S\"\n", PartName); + printf("input: : %2u chars \"%S\"\n", wcslen(pwsz), pwsz); + printf("Expected: %2u chars \"%S\"\n", lenExp, pwszExpectedPartName); + printf("Actual : %2u chars \"%S\"\n", lenAct, lenAct ? PartName : L"(null)"); return; } } else if (PartName) { - check_result(FALSE, "Unexpected PartName (expected NULL)"); - printf("Actual : %S\n", PartName); + check_result(FALSE, "Unexpected PartName (expected NULL)."); + printf("input: : %2u chars \"%S\"\n", wcslen(pwsz), pwsz); + printf("Actual : %2u chars %S\n", wcslen(PartName), PartName); } } @@ -227,30 +224,34 @@ static void InitDirComponents(DirComponents* p) { + /* While the following code seems to work, it's an unholy mess + * and should probably be cleaned up. + */ + BOOLEAN bOK; + p->pszNextLastCDComponent = 0; p->pszPD = 0; p->pszPDPlusSlash = 0; GetCurrentDirectory(sizeof(p->szCD) / sizeof(*p->szCD), p->szCD); - if (strlen(p->szCD) < 2 || p->szCD[1] != ':') { - printf("Expected curdir to be a drive letter. It's not. It's \"%s\"\n", p->szCD); -#ifdef COMPILE_AS_ROSTEST - ok(FALSE, "Expected curdir to be a drive letter. It's not. It's \"%s\"\n", p->szCD); -#endif + bOK = strlen(p->szCD) >= 2 && p->szCD[1] == ':'; + check_result(bOK, "Expected curdir to be a drive letter. It's not"); + + if (!bOK) { + printf("Curdir is \"%s\"\n", p->szCD); exit(1); } - // Note that if executed from the root directory, a slash already - // is appended. Take the opportunity to verify this. - if (p->szCD[2] != '\\') { - printf("CD is missing a slash as its third character! \"%s\"\n", p->szCD); -#ifdef COMPILE_AS_ROSTEST - ok(FALSE, "CD is missing a slash as its third character! \"%s\"\n", p->szCD); -#endif + bOK = p->szCD[2] == '\\'; + check_result(bOK, "CD is missing a slash as its third character"); + if (!bOK) { + printf("CD is \"%s\"\n", p->szCD); exit(1); } + // Note that if executed from the root directory, a backslash is + // already appended. strcpy(p->szCDPlusSlash, p->szCD); if (strlen(p->szCD) > 3) { // Append trailing backslash @@ -320,7 +321,20 @@ exit(1); } } -#endif // !COMPILE_AS_ROSTEST + +# if defined(PRINT_INFO) +static DWORD get_win_ver() +{ +# ifdef COMPILE_AS_ROSTEST + PPEB Peb = NtCurrentPeb(); + const DWORD dwWinVer = (DWORD)(Peb->OSMinorVersion << 8) | Peb->OSMajorVersion; +# else + const DWORD dwWinVer = GetVersion(); +# endif + return dwWinVer; +} +# endif /* PRINT_INFO */ +#endif /* !COMPILE_AS_ROSTEST */ #ifdef COMPILE_AS_ROSTEST @@ -330,12 +344,7 @@ #endif { #if defined(PRINT_INFO) -#ifdef COMPILE_AS_ROSTEST - PPEB Peb = NtCurrentPeb(); - const DWORD dwWinVer = (DWORD)(Peb->OSMinorVersion << 8) | Peb->OSMajorVersion; -#else - const DWORD dwWinVer = GetVersion(); -#endif + const DWORD dwWinVer = get_win_ver(); const BYTE WinVerMaj = (BYTE)dwWinVer; const BYTE WinVerMin = HIBYTE(LOWORD(dwWinVer)); #endif // PRINT_INFO @@ -357,10 +366,9 @@ printf("pszParentDirPlusSlash \"%s\"\n", cd.pszPDPlusSlash); #endif -// TODO: Verify that '.' and '?' namespaces aren't flipped. -#define PREP0 /* The normal, filesystem, namespace. Fully parsed. */ -#define PREP1 "\\\\.\\" /* The Win32 namespace. Only partially parsed. */ -#define PREP2 "\\\\?\\" /* The device namespace. Only partially parsed. */ +#define PREP0 /* The normal Win32 namespace. Fully parsed. */ +#define PREP1 "\\\\.\\" /* The Win32 Device Namespace. Only partially parsed. */ +#define PREP2 "\\\\?\\" /* The Win32 File Namespace. Only partially parsed. */ // input name NtName PartName // volume-absolute paths @@ -381,7 +389,37 @@ test(PREP0 "C:\\foo\\bar\\", "C:\\foo\\bar\\" , NULL); test(PREP1 "C:\\foo\\bar\\", "C:\\foo\\bar\\" , NULL); test(PREP2 "C:\\foo\\bar\\", "C:\\foo\\bar\\" , NULL); + test(PREP0 "C:\\foo\\.." , "C:\\" , NULL); + test(PREP1 "C:\\foo\\.." , "C:" , "C:"); + test(PREP2 "C:\\foo\\.." , "C:\\foo\\.." , ".."); + test(PREP0 "C:\\foo\\..\\" , "C:\\" , NULL); + test(PREP1 "C:\\foo\\..\\" , "C:\\" , NULL); + test(PREP2 "C:\\foo\\..\\" , "C:\\foo\\..\\" , NULL); + + test(PREP0 "C:\\f\\b\\.." , "C:\\f" , "f"); + test(PREP1 "C:\\f\\b\\.." , "C:\\f" , "f"); + test(PREP2 "C:\\f\\b\\.." , "C:\\f\\b\\.." , ".."); + test(PREP0 "C:\\f\\b\\..\\", "C:\\f\\" , NULL); + test(PREP1 "C:\\f\\b\\..\\", "C:\\f\\" , NULL); + test(PREP2 "C:\\f\\b\\..\\", "C:\\f\\b\\..\\" , NULL); + // CD-relative paths + + // RtlDosPathNameToNtPathName_U makes no distinction for + // special device names, such as "PhysicalDisk0", "HarddiskVolume0" + // or "Global??". They all follow the same pattern as a named + // filesystem entry, why they implicitly tested by the following + // "foo" and "foo\" cases. + sprintf(szTmp, "%s%s", cd.szCDPlusSlash, "foo"); + test(PREP0 "foo" , szTmp , "foo"); + test(PREP1 "foo" , "foo" , "foo"); + test(PREP2 "foo" , "foo" , "foo"); + + sprintf(szTmp, "%s%s", cd.szCDPlusSlash , "foo\\"); + test(PREP0 "foo\\" , szTmp , NULL); + test(PREP1 "foo\\" , "foo\\" , NULL); + test(PREP2 "foo\\" , "foo\\" , NULL); + test(PREP0 "." , cd.szCD , cd.pszLastCDComponent); test(PREP1 "." , "" , NULL); test(PREP2 "." , "." , "."); @@ -405,7 +443,7 @@ test(PREP1 "..." , "" , NULL); test(PREP2 "..." , "..." , "..."); - // Test a well-known "special" DOS device name. + // Test well-known "special" DOS device names. test(PREP0 "NUL" , "NUL" , NULL); test(PREP1 "NUL" , "NUL" , "NUL"); test(PREP2 "NUL" , "NUL" , "NUL"); @@ -413,8 +451,8 @@ test(PREP1 "NUL:" , "NUL:" , "NUL:"); test(PREP2 "NUL:" , "NUL:" , "NUL:"); test(PREP0 "CON" , "CON" , NULL); - // NOTE: RtlDosPathNameToNtPathName_U as currently tested fails for - // the input "\\.\CON" on at least Windows XP sp2. + // NOTE: RtlDosPathNameToNtPathName_U (as currently tested) fails for + // the input "\\.\CON" on two widely different Windows versions. // test(PREP1 "CON" , "CON" , "CON"); test(PREP2 "CON" , "CON" , "CON"); test(PREP0 "CON:" , "CON" , NULL); @@ -452,6 +490,7 @@ test(PREP1 "\\..." , "" , NULL); test(PREP2 "\\..." , "\\..." , "..."); + // malformed sprintf(szTmp, "%s%s", cd.szCurDrive, "\\C:"); test(PREP0 "\\C:" , szTmp , "C:"); test(PREP1 "\\C:" , "C:" , "C:"); @@ -491,7 +530,7 @@ test(PREP1 "\\\\f\\b\\.." , "f" , "f"); test(PREP2 "\\\\f\\b\\.." , "\\\\f\\b\\.." , ".."); - // strange border-cases + // strange UNC-paths test(PREP0 "\\\\C:" , "UNC\\C:" , NULL); test(PREP1 "\\\\C:" , "C:" , "C:"); test(PREP2 "\\\\C:" , "\\\\C:" , "C:");
12 years, 3 months
1
0
0
0
[tkreuzer] 57389: [PSDK/DDK/XDK] - Remove duplicated definitions from ntddk.h - Fix annotations in ntifs.h, wdm.h, ntgdi.h, winddi.h [NDK] - Declare most of the heap functions only for user mode - ...
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Wed Sep 26 09:40:44 2012 New Revision: 57389 URL:
http://svn.reactos.org/svn/reactos?rev=57389&view=rev
Log: [PSDK/DDK/XDK] - Remove duplicated definitions from ntddk.h - Fix annotations in ntifs.h, wdm.h, ntgdi.h, winddi.h [NDK] - Declare most of the heap functions only for user mode - Remove duplicate RtlGetNtGlobalFlags() Modified: trunk/reactos/include/ddk/ntddk.h trunk/reactos/include/ddk/ntifs.h trunk/reactos/include/ddk/wdm.h trunk/reactos/include/ndk/rtlfuncs.h trunk/reactos/include/psdk/ntgdi.h trunk/reactos/include/psdk/winddi.h trunk/reactos/include/xdk/iofuncs.h trunk/reactos/include/xdk/kefuncs.h trunk/reactos/include/xdk/mmfuncs.h Modified: trunk/reactos/include/ddk/ntddk.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ddk/ntddk.h?rev=57…
============================================================================== --- trunk/reactos/include/ddk/ntddk.h [iso-8859-1] (original) +++ trunk/reactos/include/ddk/ntddk.h [iso-8859-1] Wed Sep 26 09:40:44 2012 @@ -4680,59 +4680,6 @@ _In_ PPHYSICAL_ADDRESS StartAddress, _Inout_ PLARGE_INTEGER NumberOfBytes); -_Must_inspect_result_ -_IRQL_requires_max_(DISPATCH_LEVEL) -_When_(return != NULL, _Post_writable_byte_size_(NumberOfBytes)) -NTKERNELAPI -PVOID -NTAPI -MmAllocateContiguousMemory( - _In_ SIZE_T NumberOfBytes, - _In_ PHYSICAL_ADDRESS HighestAcceptableAddress); - -_Must_inspect_result_ -_IRQL_requires_max_(DISPATCH_LEVEL) -_When_(return != NULL, _Post_writable_byte_size_(NumberOfBytes)) -NTKERNELAPI -PVOID -NTAPI -MmAllocateContiguousMemorySpecifyCache( - _In_ SIZE_T NumberOfBytes, - _In_ PHYSICAL_ADDRESS LowestAcceptableAddress, - _In_ PHYSICAL_ADDRESS HighestAcceptableAddress, - _In_opt_ PHYSICAL_ADDRESS BoundaryAddressMultiple, - _In_ MEMORY_CACHING_TYPE CacheType); - -_Must_inspect_result_ -_IRQL_requires_max_(DISPATCH_LEVEL) -_When_(return != NULL, _Post_writable_byte_size_(NumberOfBytes)) -NTKERNELAPI -PVOID -NTAPI -MmAllocateContiguousMemorySpecifyCacheNode( - _In_ SIZE_T NumberOfBytes, - _In_ PHYSICAL_ADDRESS LowestAcceptableAddress, - _In_ PHYSICAL_ADDRESS HighestAcceptableAddress, - _In_opt_ PHYSICAL_ADDRESS BoundaryAddressMultiple, - _In_ MEMORY_CACHING_TYPE CacheType, - _In_ NODE_REQUIREMENT PreferredNode); - -_IRQL_requires_max_(DISPATCH_LEVEL) -NTKERNELAPI -VOID -NTAPI -MmFreeContiguousMemory( - _In_ PVOID BaseAddress); - -_IRQL_requires_max_(DISPATCH_LEVEL) -NTKERNELAPI -VOID -NTAPI -MmFreeContiguousMemorySpecifyCache( - _In_reads_bytes_(NumberOfBytes) PVOID BaseAddress, - _In_ SIZE_T NumberOfBytes, - _In_ MEMORY_CACHING_TYPE CacheType); - #endif /* (NTDDI_VERSION >= NTDDI_WIN2K) */ Modified: trunk/reactos/include/ddk/ntifs.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ddk/ntifs.h?rev=57…
============================================================================== --- trunk/reactos/include/ddk/ntifs.h [iso-8859-1] (original) +++ trunk/reactos/include/ddk/ntifs.h [iso-8859-1] Wed Sep 26 09:40:44 2012 @@ -5083,8 +5083,8 @@ _Inout_ PLIST_ENTRY Entry); _IRQL_requires_min_(PASSIVE_LEVEL) -_When_((Timeout==NULL || *Timeout!=0), _IRQL_requires_max_(APC_LEVEL)) -_When_((Timeout!=NULL && *Timeout==0), _IRQL_requires_max_(DISPATCH_LEVEL)) +_When_((Timeout==NULL || Timeout->QuadPart!=0), _IRQL_requires_max_(APC_LEVEL)) +_When_((Timeout!=NULL && Timeout->QuadPart==0), _IRQL_requires_max_(DISPATCH_LEVEL)) NTKERNELAPI PLIST_ENTRY NTAPI Modified: trunk/reactos/include/ddk/wdm.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ddk/wdm.h?rev=5738…
============================================================================== --- trunk/reactos/include/ddk/wdm.h [iso-8859-1] (original) +++ trunk/reactos/include/ddk/wdm.h [iso-8859-1] Wed Sep 26 09:40:44 2012 @@ -11399,8 +11399,8 @@ _In_ MEMORY_CACHING_TYPE CacheType); _Must_inspect_result_ -_When_(AccessMode==0, _IRQL_requires_max_(DISPATCH_LEVEL)) -_When_(AccessMode==1, _Maybe_raises_SEH_exception_ _IRQL_requires_max_(APC_LEVEL)) +_When_(AccessMode==KernelMode, _IRQL_requires_max_(DISPATCH_LEVEL)) +_When_(AccessMode==UserMode, _Maybe_raises_SEH_exception_ _IRQL_requires_max_(APC_LEVEL)) NTKERNELAPI PVOID NTAPI @@ -12618,8 +12618,8 @@ _Outptr_result_nullonfailure_ _At_(*DeviceObject, __drv_allocatesMem(Mem) - _When_((((_In_function_class_(DRIVER_INITIALIZE)) - ||(_In_function_class_(DRIVER_DISPATCH)))), + _When_(((_In_function_class_(DRIVER_INITIALIZE)) + ||(_In_function_class_(DRIVER_DISPATCH))), __drv_aliasesMem)) PDEVICE_OBJECT *DeviceObject); 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] Wed Sep 26 09:40:44 2012 @@ -726,6 +726,7 @@ VOID ); +#ifdef NTOS_MODE_USER // // Heap Functions // @@ -805,13 +806,6 @@ IN PVOID P ); -NTSYSAPI -ULONG -NTAPI -RtlGetNtGlobalFlags( - VOID -); - ULONG NTAPI RtlGetProcessHeaps( @@ -943,6 +937,27 @@ ); NTSYSAPI +BOOLEAN +NTAPI +RtlValidateHeap( + HANDLE Heap, + ULONG Flags, + PVOID P +); + +NTSYSAPI +NTSTATUS +NTAPI +RtlWalkHeap( + IN HANDLE HeapHandle, + IN PVOID HeapEntry +); + +#define RtlGetProcessHeap() (NtCurrentPeb()->ProcessHeap) + +#endif // NTOS_MODE_USER + +NTSYSAPI SIZE_T NTAPI RtlSizeHeap( @@ -951,24 +966,6 @@ IN PVOID MemoryPointer ); -NTSYSAPI -BOOLEAN -NTAPI -RtlValidateHeap( - HANDLE Heap, - ULONG Flags, - PVOID P -); - -NTSYSAPI -NTSTATUS -NTAPI -RtlWalkHeap( - IN HANDLE HeapHandle, - IN PVOID HeapEntry -); - -#define RtlGetProcessHeap() (NtCurrentPeb()->ProcessHeap) // // Security Functions Modified: trunk/reactos/include/psdk/ntgdi.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/ntgdi.h?rev=5…
============================================================================== --- trunk/reactos/include/psdk/ntgdi.h [iso-8859-1] (original) +++ trunk/reactos/include/psdk/ntgdi.h [iso-8859-1] Wed Sep 26 09:40:44 2012 @@ -193,8 +193,9 @@ _Out_opt_ OUTLINETEXTMETRICW *potmw, _Out_ TMDIFF *ptmd); -W32KAPI -BOOL _Success_(return != FALSE) +_Success_(return != FALSE) +W32KAPI +BOOL APIENTRY NtGdiGetAndSetDCDword( _In_ HDC hdc, @@ -404,8 +405,9 @@ OUT FLONG *pflInfo ); -W32KAPI -INT _Success_(return != 0) +_Success_(return != 0) +W32KAPI +INT APIENTRY NtGdiDescribePixelFormat( _In_ HDC hdc, @@ -1646,8 +1648,9 @@ _In_ DWORD dwxScale, _In_ DWORD dwyScale); -W32KAPI -BOOL _Success_(return != FALSE) +_Success_(return != FALSE) +W32KAPI +BOOL APIENTRY NtGdiGetMiterLimit( _In_ HDC hdc, @@ -2357,8 +2360,9 @@ _In_ INT x, _In_ INT y); -W32KAPI -BOOL _Success_(return != FALSE) +_Success_(return != FALSE) +W32KAPI +BOOL APIENTRY NtGdiMoveTo( _In_ HDC hdc, @@ -2405,8 +2409,9 @@ _In_ DWORD dwRop, _In_ DWORD dwBackColor); -W32KAPI -BOOL _Success_(return != FALSE) +_Success_(return != FALSE) +W32KAPI +BOOL APIENTRY NtGdiSetBrushOrg( _In_ HDC hdc, Modified: trunk/reactos/include/psdk/winddi.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/winddi.h?rev=…
============================================================================== --- trunk/reactos/include/psdk/winddi.h [iso-8859-1] (original) +++ trunk/reactos/include/psdk/winddi.h [iso-8859-1] Wed Sep 26 09:40:44 2012 @@ -1256,7 +1256,7 @@ _In_ ULONG ulTag); _Must_inspect_result_ -_Ret_opt_bytecount_(cj) +_Ret_opt_bytecount_(cjMemSize) WIN32KAPI PVOID APIENTRY @@ -1558,6 +1558,7 @@ EngDeleteWnd( _In_ _Post_ptr_invalid_ WNDOBJ *pwo); +_Success_(return==0) WIN32KAPI DWORD APIENTRY Modified: trunk/reactos/include/xdk/iofuncs.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/xdk/iofuncs.h?rev=…
============================================================================== --- trunk/reactos/include/xdk/iofuncs.h [iso-8859-1] (original) +++ trunk/reactos/include/xdk/iofuncs.h [iso-8859-1] Wed Sep 26 09:40:44 2012 @@ -821,8 +821,8 @@ _Outptr_result_nullonfailure_ _At_(*DeviceObject, __drv_allocatesMem(Mem) - _When_((((_In_function_class_(DRIVER_INITIALIZE)) - ||(_In_function_class_(DRIVER_DISPATCH)))), + _When_(((_In_function_class_(DRIVER_INITIALIZE)) + ||(_In_function_class_(DRIVER_DISPATCH))), __drv_aliasesMem)) PDEVICE_OBJECT *DeviceObject); Modified: trunk/reactos/include/xdk/kefuncs.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/xdk/kefuncs.h?rev=…
============================================================================== --- trunk/reactos/include/xdk/kefuncs.h [iso-8859-1] (original) +++ trunk/reactos/include/xdk/kefuncs.h [iso-8859-1] Wed Sep 26 09:40:44 2012 @@ -640,8 +640,8 @@ _Inout_ PLIST_ENTRY Entry); _IRQL_requires_min_(PASSIVE_LEVEL) -_When_((Timeout==NULL || *Timeout!=0), _IRQL_requires_max_(APC_LEVEL)) -_When_((Timeout!=NULL && *Timeout==0), _IRQL_requires_max_(DISPATCH_LEVEL)) +_When_((Timeout==NULL || Timeout->QuadPart!=0), _IRQL_requires_max_(APC_LEVEL)) +_When_((Timeout!=NULL && Timeout->QuadPart==0), _IRQL_requires_max_(DISPATCH_LEVEL)) NTKERNELAPI PLIST_ENTRY NTAPI Modified: trunk/reactos/include/xdk/mmfuncs.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/xdk/mmfuncs.h?rev=…
============================================================================== --- trunk/reactos/include/xdk/mmfuncs.h [iso-8859-1] (original) +++ trunk/reactos/include/xdk/mmfuncs.h [iso-8859-1] Wed Sep 26 09:40:44 2012 @@ -298,8 +298,8 @@ _In_ MEMORY_CACHING_TYPE CacheType); _Must_inspect_result_ -_When_(AccessMode==0, _IRQL_requires_max_(DISPATCH_LEVEL)) -_When_(AccessMode==1, _Maybe_raises_SEH_exception_ _IRQL_requires_max_(APC_LEVEL)) +_When_(AccessMode==KernelMode, _IRQL_requires_max_(DISPATCH_LEVEL)) +_When_(AccessMode==UserMode, _Maybe_raises_SEH_exception_ _IRQL_requires_max_(APC_LEVEL)) NTKERNELAPI PVOID NTAPI @@ -574,59 +574,6 @@ MmAddPhysicalMemory( _In_ PPHYSICAL_ADDRESS StartAddress, _Inout_ PLARGE_INTEGER NumberOfBytes); - -_Must_inspect_result_ -_IRQL_requires_max_(DISPATCH_LEVEL) -_When_(return != NULL, _Post_writable_byte_size_(NumberOfBytes)) -NTKERNELAPI -PVOID -NTAPI -MmAllocateContiguousMemory( - _In_ SIZE_T NumberOfBytes, - _In_ PHYSICAL_ADDRESS HighestAcceptableAddress); - -_Must_inspect_result_ -_IRQL_requires_max_(DISPATCH_LEVEL) -_When_(return != NULL, _Post_writable_byte_size_(NumberOfBytes)) -NTKERNELAPI -PVOID -NTAPI -MmAllocateContiguousMemorySpecifyCache( - _In_ SIZE_T NumberOfBytes, - _In_ PHYSICAL_ADDRESS LowestAcceptableAddress, - _In_ PHYSICAL_ADDRESS HighestAcceptableAddress, - _In_opt_ PHYSICAL_ADDRESS BoundaryAddressMultiple, - _In_ MEMORY_CACHING_TYPE CacheType); - -_Must_inspect_result_ -_IRQL_requires_max_(DISPATCH_LEVEL) -_When_(return != NULL, _Post_writable_byte_size_(NumberOfBytes)) -NTKERNELAPI -PVOID -NTAPI -MmAllocateContiguousMemorySpecifyCacheNode( - _In_ SIZE_T NumberOfBytes, - _In_ PHYSICAL_ADDRESS LowestAcceptableAddress, - _In_ PHYSICAL_ADDRESS HighestAcceptableAddress, - _In_opt_ PHYSICAL_ADDRESS BoundaryAddressMultiple, - _In_ MEMORY_CACHING_TYPE CacheType, - _In_ NODE_REQUIREMENT PreferredNode); - -_IRQL_requires_max_(DISPATCH_LEVEL) -NTKERNELAPI -VOID -NTAPI -MmFreeContiguousMemory( - _In_ PVOID BaseAddress); - -_IRQL_requires_max_(DISPATCH_LEVEL) -NTKERNELAPI -VOID -NTAPI -MmFreeContiguousMemorySpecifyCache( - _In_reads_bytes_(NumberOfBytes) PVOID BaseAddress, - _In_ SIZE_T NumberOfBytes, - _In_ MEMORY_CACHING_TYPE CacheType); $endif (_NTDDK_) $if (_NTIFS_)
12 years, 3 months
1
0
0
0
[mnordell] 57388: [ROSTEST:APITEST:NTDLL]\nFlesh out test for RtlDosPathNameToNtPathName_U.
by mnordell@svn.reactos.org
Author: mnordell Date: Wed Sep 26 02:56:01 2012 New Revision: 57388 URL:
http://svn.reactos.org/svn/reactos?rev=57388&view=rev
Log: [ROSTEST:APITEST:NTDLL]\nFlesh out test for RtlDosPathNameToNtPathName_U. Modified: trunk/rostests/apitests/ntdll/RtlDosPathNameToNtPathName_U.c Modified: trunk/rostests/apitests/ntdll/RtlDosPathNameToNtPathName_U.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/ntdll/RtlDosPath…
============================================================================== --- trunk/rostests/apitests/ntdll/RtlDosPathNameToNtPathName_U.c [iso-8859-1] (original) +++ trunk/rostests/apitests/ntdll/RtlDosPathNameToNtPathName_U.c [iso-8859-1] Wed Sep 26 02:56:01 2012 @@ -24,6 +24,7 @@ * - \??\C:\ * * Caveat: The "\??\*" form behaves different depending on Windows version. + * Some tests will fail if there is no C: volume. * * Code is assumed to be compiled as 32-bit "ANSI" (i.e. with _UNICODE) undefined. */ @@ -214,20 +215,21 @@ char szCDPlusSlash[512]; char* pszLastCDComponent; char szCurDrive[4]; + char szCurDriveSlash[4]; char szParentDir[512]; char szParentDirPlusSlash[512]; char szNextLastCDComponent[260]; const char* pszNextLastCDComponent; - const char* pszParentDir; - const char* pszParentDirPlusSlash; + const char* pszPD; // parent dir + const char* pszPDPlusSlash; } DirComponents; static void InitDirComponents(DirComponents* p) { p->pszNextLastCDComponent = 0; - p->pszParentDir = 0; - p->pszParentDirPlusSlash = 0; + p->pszPD = 0; + p->pszPDPlusSlash = 0; GetCurrentDirectory(sizeof(p->szCD) / sizeof(*p->szCD), p->szCD); @@ -257,6 +259,7 @@ memcpy(p->szCurDrive, p->szCD, 2); p->szCurDrive[2] = 0; + sprintf(p->szCurDriveSlash, "%s\\", p->szCurDrive); p->pszLastCDComponent = strrchr(p->szCD, '\\'); if (p->pszLastCDComponent) @@ -264,7 +267,7 @@ // We have a parent directory memcpy(p->szParentDir, p->szCD, p->pszLastCDComponent - p->szCD); p->szParentDir[p->pszLastCDComponent - p->szCD] = 0; - p->pszParentDir = p->szParentDir; + p->pszPD = p->szParentDir; if (strlen(p->szParentDir) == 2 && p->szParentDir[1] == ':') { // When run from root directory, this is expected to // have a trailing backslash @@ -274,7 +277,7 @@ if (p->szParentDirPlusSlash[strlen(p->szParentDirPlusSlash)-1] != '\\') { strcat(p->szParentDirPlusSlash, "\\"); } - p->pszParentDirPlusSlash = p->szParentDirPlusSlash; + p->pszPDPlusSlash = p->szParentDirPlusSlash; // Check if we have a directory above that too. *p->pszLastCDComponent = 0; @@ -312,7 +315,7 @@ } RtlDosPathNameToNtPathName_U = (RtlDosPathNameToNtPathName_U_t)GetProcAddress(hDll, "RtlDosPathNameToNtPathName_U"); - if (!hDll) { + if (!RtlDosPathNameToNtPathName_U) { printf("Major failure. Couldn't get RtlDosPathNameToNtPathName_U!\n"); exit(1); } @@ -338,6 +341,7 @@ #endif // PRINT_INFO DirComponents cd; + char szTmp[512]; #ifndef COMPILE_AS_ROSTEST InitFunctionPointer(); @@ -349,56 +353,193 @@ printf("WinVer: %d.%d\n", WinVerMaj, WinVerMin); printf("pszLastCDComponent \"%s\"\n", cd.pszLastCDComponent); printf("pszNextLastCDComponent \"%s\"\n", cd.pszNextLastCDComponent); - printf("pszParentDir \"%s\"\n", cd.pszParentDir); - printf("pszParentDirPlusSlash \"%s\"\n", cd.pszParentDirPlusSlash); -#endif - - -#define PREP0 -#define PREP1 "\\\\.\\" -#define PREP2 "\\\\?\\" - - // The following tests shall return strictly defined strings, - // why we can use hard-coded expectations.. - test(PREP1 "C:" , "C:" , "C:"); - test(PREP2 "C:" , "C:" , "C:"); - test(PREP0 "C:\\" , "C:\\" , NULL); - test(PREP1 "C:\\" , "C:\\" , NULL); - test(PREP2 "C:\\" , "C:\\" , NULL); - test(PREP0 "C:\\foo" , "C:\\foo" , "foo"); - test(PREP1 "C:\\foo" , "C:\\foo" , "foo"); - test(PREP2 "C:\\foo" , "C:\\foo" , "foo"); - test(PREP0 "C:\\foo\\" , "C:\\foo\\" , NULL); - test(PREP1 "C:\\foo\\" , "C:\\foo\\" , NULL); - test(PREP2 "C:\\foo\\" , "C:\\foo\\" , NULL); - test(PREP0 "C:\\foo\\bar" , "C:\\foo\\bar" , "bar"); - test(PREP1 "C:\\foo\\bar" , "C:\\foo\\bar" , "bar"); - test(PREP2 "C:\\foo\\bar" , "C:\\foo\\bar" , "bar"); - test(PREP0 "C:\\foo\\bar\\", "C:\\foo\\bar\\" , NULL); - test(PREP1 "C:\\foo\\bar\\", "C:\\foo\\bar\\" , NULL); - test(PREP2 "C:\\foo\\bar\\", "C:\\foo\\bar\\" , NULL); - test(PREP1 "." , "" , NULL); - test(PREP2 "." , "." , "."); - test(PREP1 ".\\" , "" , NULL); - test(PREP2 ".\\" , ".\\" , NULL); - test(PREP1 ".." , "" , NULL); - test(PREP2 ".." , ".." , ".."); - test(PREP1 "..\\" , "" , NULL); - test(PREP2 "..\\" , "..\\" , NULL); - - // The following tests returns results based on current directory. - test(PREP0 "." , cd.szCD , cd.pszLastCDComponent); - test(PREP0 ".\\" , cd.szCDPlusSlash , NULL); - test(PREP0 ".." , cd.pszParentDir , cd.pszNextLastCDComponent); - test(PREP0 "..\\" , cd.pszParentDirPlusSlash, NULL); - test(cd.szCD , cd.szCD , cd.pszLastCDComponent); - test(cd.szCDPlusSlash , cd.szCDPlusSlash , NULL); + printf("pszParentDir \"%s\"\n", cd.pszPD); + printf("pszParentDirPlusSlash \"%s\"\n", cd.pszPDPlusSlash); +#endif + +// TODO: Verify that '.' and '?' namespaces aren't flipped. +#define PREP0 /* The normal, filesystem, namespace. Fully parsed. */ +#define PREP1 "\\\\.\\" /* The Win32 namespace. Only partially parsed. */ +#define PREP2 "\\\\?\\" /* The device namespace. Only partially parsed. */ + + // input name NtName PartName + // volume-absolute paths + test(PREP1 "C:" , "C:" , "C:"); + test(PREP2 "C:" , "C:" , "C:"); + test(PREP0 "C:\\" , "C:\\" , NULL); + test(PREP1 "C:\\" , "C:\\" , NULL); + test(PREP2 "C:\\" , "C:\\" , NULL); + test(PREP0 "C:\\foo" , "C:\\foo" , "foo"); + test(PREP1 "C:\\foo" , "C:\\foo" , "foo"); + test(PREP2 "C:\\foo" , "C:\\foo" , "foo"); + test(PREP0 "C:\\foo\\" , "C:\\foo\\" , NULL); + test(PREP1 "C:\\foo\\" , "C:\\foo\\" , NULL); + test(PREP2 "C:\\foo\\" , "C:\\foo\\" , NULL); + test(PREP0 "C:\\foo\\bar" , "C:\\foo\\bar" , "bar"); + test(PREP1 "C:\\foo\\bar" , "C:\\foo\\bar" , "bar"); + test(PREP2 "C:\\foo\\bar" , "C:\\foo\\bar" , "bar"); + test(PREP0 "C:\\foo\\bar\\", "C:\\foo\\bar\\" , NULL); + test(PREP1 "C:\\foo\\bar\\", "C:\\foo\\bar\\" , NULL); + test(PREP2 "C:\\foo\\bar\\", "C:\\foo\\bar\\" , NULL); + // CD-relative paths + test(PREP0 "." , cd.szCD , cd.pszLastCDComponent); + test(PREP1 "." , "" , NULL); + test(PREP2 "." , "." , "."); + test(PREP0 ".\\" , cd.szCDPlusSlash , NULL); + test(PREP1 ".\\" , "" , NULL); + test(PREP2 ".\\" , ".\\" , NULL); + test(PREP0 ".\\." , cd.szCD , cd.pszLastCDComponent); + test(PREP1 ".\\." , "" , NULL); + test(PREP2 ".\\." , ".\\." , "."); + test(PREP0 ".\\.." , cd.pszPD , cd.pszNextLastCDComponent); + test(PREP1 ".\\.." , "" , NULL); + test(PREP2 ".\\.." , ".\\.." , ".."); + test(PREP0 ".." , cd.pszPD , cd.pszNextLastCDComponent); + test(PREP1 ".." , "" , NULL); + test(PREP2 ".." , ".." , ".."); + test(PREP0 "..\\" , cd.pszPDPlusSlash , NULL); + test(PREP1 "..\\" , "" , NULL); + test(PREP2 "..\\" , "..\\" , NULL); + // malformed + test(PREP0 "..." , cd.szCDPlusSlash , NULL); + test(PREP1 "..." , "" , NULL); + test(PREP2 "..." , "..." , "..."); + + // Test a well-known "special" DOS device name. + test(PREP0 "NUL" , "NUL" , NULL); + test(PREP1 "NUL" , "NUL" , "NUL"); + test(PREP2 "NUL" , "NUL" , "NUL"); + test(PREP0 "NUL:" , "NUL" , NULL); + test(PREP1 "NUL:" , "NUL:" , "NUL:"); + test(PREP2 "NUL:" , "NUL:" , "NUL:"); + test(PREP0 "CON" , "CON" , NULL); + // NOTE: RtlDosPathNameToNtPathName_U as currently tested fails for + // the input "\\.\CON" on at least Windows XP sp2. +// test(PREP1 "CON" , "CON" , "CON"); + test(PREP2 "CON" , "CON" , "CON"); + test(PREP0 "CON:" , "CON" , NULL); + test(PREP1 "CON:" , "CON:" , "CON:"); + test(PREP2 "CON:" , "CON:" , "CON:"); + + sprintf(szTmp, "%s\\%s", cd.szCD, "NUL:\\"); + test(PREP0 "NUL:\\" , szTmp , NULL); + test(PREP1 "NUL:\\" , "NUL:\\" , NULL); + test(PREP2 "NUL:\\" , "NUL:\\" , NULL); + test(PREP0 "C:NUL" , "NUL" , NULL); + test(PREP1 "C:NUL" , "C:NUL" , "C:NUL"); + test(PREP2 "C:NUL" , "C:NUL" , "C:NUL"); + test(PREP0 "C:\\NUL" , "NUL" , NULL); + test(PREP1 "C:\\NUL" , "C:\\NUL" , "NUL"); + test(PREP2 "C:\\NUL" , "C:\\NUL" , "NUL"); + test(PREP0 "C:\\NUL\\" , "C:\\NUL\\" , NULL); + test(PREP1 "C:\\NUL\\" , "C:\\NUL\\" , NULL); + test(PREP2 "C:\\NUL\\" , "C:\\NUL\\" , NULL); + + // root-paths + test(PREP0 "\\" , cd.szCurDriveSlash, NULL); + test(PREP1 "\\" , "" , NULL); + test(PREP2 "\\" , "\\" , NULL); + + test(PREP0 "\\." , cd.szCurDriveSlash, NULL); + test(PREP1 "\\." , "" , NULL); + test(PREP2 "\\." , "\\." , "."); + + test(PREP0 "\\.." , cd.szCurDriveSlash, NULL); + test(PREP1 "\\.." , "" , NULL); + test(PREP2 "\\.." , "\\.." , ".."); + + test(PREP0 "\\..." , cd.szCurDriveSlash, NULL); + test(PREP1 "\\..." , "" , NULL); + test(PREP2 "\\..." , "\\..." , "..."); + + sprintf(szTmp, "%s%s", cd.szCurDrive, "\\C:"); + test(PREP0 "\\C:" , szTmp , "C:"); + test(PREP1 "\\C:" , "C:" , "C:"); + test(PREP2 "\\C:" , "\\C:" , "C:"); + + sprintf(szTmp, "%s%s", cd.szCurDrive, "\\C:\\"); + test(PREP0 "\\C:\\" , szTmp , NULL); + test(PREP1 "\\C:\\" , "C:\\" , NULL); + test(PREP2 "\\C:\\" , "\\C:\\" , NULL); + + // UNC paths + test(PREP0 "\\\\" , "UNC\\" , NULL); + test(PREP1 "\\\\" , "" , NULL); + test(PREP2 "\\\\" , "\\\\" , NULL); + test(PREP0 "\\\\\\" , "UNC\\\\" , NULL); + test(PREP1 "\\\\\\" , "" , NULL); + test(PREP2 "\\\\\\" , "\\\\\\" , NULL); + test(PREP0 "\\\\foo" , "UNC\\foo" , NULL); + test(PREP1 "\\\\foo" , "foo" , "foo"); + test(PREP2 "\\\\foo" , "\\\\foo" , "foo"); + + test(PREP0 "\\\\foo\\.." , "UNC\\foo\\" , NULL); + test(PREP1 "\\\\foo\\.." , "" , NULL); + test(PREP2 "\\\\foo\\.." , "\\\\foo\\.." , ".."); + + test(PREP0 "\\\\foo\\" , "UNC\\foo\\" , NULL); + test(PREP1 "\\\\foo\\" , "foo\\" , NULL); + test(PREP2 "\\\\foo\\" , "\\\\foo\\" , NULL); + test(PREP0 "\\\\f\\b" , "UNC\\f\\b" , NULL); + test(PREP1 "\\\\f\\b" , "f\\b" , "b"); + test(PREP2 "\\\\f\\b" , "\\\\f\\b" , "b"); + test(PREP0 "\\\\f\\b\\" , "UNC\\f\\b\\" , NULL); + test(PREP1 "\\\\f\\b\\" , "f\\b\\" , NULL); + test(PREP2 "\\\\f\\b\\" , "\\\\f\\b\\" , NULL); + + test(PREP0 "\\\\f\\b\\.." , "UNC\\f\\b" , NULL); + test(PREP1 "\\\\f\\b\\.." , "f" , "f"); + test(PREP2 "\\\\f\\b\\.." , "\\\\f\\b\\.." , ".."); + + // strange border-cases + test(PREP0 "\\\\C:" , "UNC\\C:" , NULL); + test(PREP1 "\\\\C:" , "C:" , "C:"); + test(PREP2 "\\\\C:" , "\\\\C:" , "C:"); + test(PREP0 "\\\\C:\\" , "UNC\\C:\\" , NULL); + test(PREP1 "\\\\C:\\" , "C:\\" , NULL); + test(PREP2 "\\\\C:\\" , "\\\\C:\\" , NULL); + test(PREP0 "\\\\NUL" , "UNC\\NUL" , NULL); + test(PREP1 "\\\\NUL" , "NUL" , "NUL"); + test(PREP2 "\\\\NUL" , "\\\\NUL" , "NUL"); + test(PREP0 "\\\\NUL:" , "UNC\\NUL:" , NULL); + test(PREP1 "\\\\NUL:" , "NUL:" , "NUL:"); + test(PREP2 "\\\\NUL:" , "\\\\NUL:" , "NUL:"); + test(PREP0 "\\\\NUL:\\" , "UNC\\NUL:\\" , NULL); + test(PREP1 "\\\\NUL:\\" , "NUL:\\" , NULL); + test(PREP2 "\\\\NUL:\\" , "\\\\NUL:\\" , NULL); + + // UNC + forward slashes + test(PREP0 "//" , "UNC\\" , NULL); + test(PREP1 "//" , "" , NULL); + test(PREP2 "//" , "//" , "//"); + test(PREP0 "//C:" , "UNC\\C:" , NULL); + test(PREP1 "//C:" , "C:" , "C:"); + test(PREP2 "//C:" , "//C:" , "//C:"); + test(PREP0 "//C:/" , "UNC\\C:\\" , NULL); + test(PREP1 "//C:/" , "C:\\" , NULL); + test(PREP2 "//C:/" , "//C:/" , "//C:/"); + test(PREP0 "//." , "" , NULL); + test(PREP1 "//." , "" , NULL); + test(PREP2 "//." , "//." , "//."); + test(PREP0 "//.." , "UNC\\" , NULL); + test(PREP1 "//.." , "" , NULL); + test(PREP2 "//.." , "//.." , "//.."); + test(PREP0 "/./" , cd.szCurDriveSlash, NULL); + test(PREP1 "/./" , "" , NULL); + test(PREP2 "/./" , "/./" , "/./"); + test(PREP0 "//./" , "" , NULL); + test(PREP1 "//./" , "" , NULL); + test(PREP2 "//./" , "//./" , "//./"); + + test(cd.szCD , cd.szCD , cd.pszLastCDComponent); + test(cd.szCDPlusSlash , cd.szCDPlusSlash , NULL); #if 0 - // This following test is "problematic", as it returns results based on + // The following tests are "problematic", as they return results based on // what your CD on C: is, whether or not you actually run the program - // from C:. For that reason, it's currently disabled. - test(PREP0 "C:" , "C:\\" , NULL); + // from C:. For that reason, they are currently disabled. + test(PREP0 "C:" , "C:\\"+C_curdir , C_curdir); + test(PREP0 "C:NUL\\" , "C:\\"+C_curdir+"\\NUL\\" , NULL); #endif #if 0 // Disabled due to... see the comment inside the block. @@ -412,9 +553,11 @@ // a full NT name ("\??\"), why it's not the end of the world // that this test is currently disabled. // - // NOTE: _At least_ XP sp2 prepends this. - // Prepending curdrive like this is most likely a bug, but for - // compatibility it may become a requirement to "shim" this. + // Some versions of Windows prepends driveletter + colon + // for the process' current volume. + // Prepending curdrive is most likely a bug that got fixed in + // later versions of Windows, but for compatibility it may + // become a requirement to "shim" this. // // Known operating systems prepending "Z:\??\" (assuming the // process' CD is on the volume Z:): @@ -426,12 +569,13 @@ sprintf(szPrepend, "%s\\??\\", cd.szCurDrive); } - sprintf(szExp, "%s%s", szPrepend, "C:"); // Win7 64 (as 32-bit) + sprintf(szExp, "%s%s", szPrepend, "C:"); test("\\??\\C:", szExp, "C:"); sprintf(szExp, "%s%s", szPrepend, "C:\\"); test("\\??\\C:\\", szExp, NULL); - } + +} #endif #ifndef COMPILE_AS_ROSTEST
12 years, 3 months
1
0
0
0
← Newer
1
2
3
4
5
6
7
8
9
...
24
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
Results per page:
10
25
50
100
200