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
August 2010
----- 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
14 participants
282 discussions
Start a n
N
ew thread
[sir_richard] 48440: [CMAKE]: NTDLL WIP.
by sir_richard@svn.reactos.org
Author: sir_richard Date: Tue Aug 3 21:39:17 2010 New Revision: 48440 URL:
http://svn.reactos.org/svn/reactos?rev=48440&view=rev
Log: [CMAKE]: NTDLL WIP. Modified: branches/cmake-bringup/dll/ntdll/CMakeLists.txt Modified: branches/cmake-bringup/dll/ntdll/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/branches/cmake-bringup/dll/ntdll/CMakeLi…
============================================================================== --- branches/cmake-bringup/dll/ntdll/CMakeLists.txt [iso-8859-1] (original) +++ branches/cmake-bringup/dll/ntdll/CMakeLists.txt [iso-8859-1] Tue Aug 3 21:39:17 2010 @@ -1,6 +1,11 @@ add_definitions(-D__NTDLL__) add_definitions(-D_NTOSKRNL_) add_definitions(-DCRTDLL) + +SET(CMAKE_INCLUDE_DIRECTORIES_PROJECT_BEFORE 1) + +include_directories(BEFORE ./include) +include_directories(${REACTOS_SOURCE_DIR}/include/reactos/subsys) file(GLOB_RECURSE SOURCE *.c) list(REMOVE_ITEM SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/ldr/elf.c ${CMAKE_CURRENT_SOURCE_DIR}/dispatch/dispatch.c) @@ -10,5 +15,5 @@ add_library(ntdll SHARED ${ARCH_SOURCE} ${SOURCE}) -target_link_libraries(ntdll rtl ntdllsys libcntpr pseh debugsup_ntdll) +target_link_libraries(ntdll rtl ntdllsys libcntpr pseh) add_dependencies(ntdll ntstatus version)
14 years, 4 months
1
0
0
0
[sir_richard] 48439: [CMAKE]: Don't auto-link with Win32 stuff.
by sir_richard@svn.reactos.org
Author: sir_richard Date: Tue Aug 3 21:38:59 2010 New Revision: 48439 URL:
http://svn.reactos.org/svn/reactos?rev=48439&view=rev
Log: [CMAKE]: Don't auto-link with Win32 stuff. Modified: branches/cmake-bringup/toolchain-mingw32.cmake Modified: branches/cmake-bringup/toolchain-mingw32.cmake URL:
http://svn.reactos.org/svn/reactos/branches/cmake-bringup/toolchain-mingw32…
============================================================================== --- branches/cmake-bringup/toolchain-mingw32.cmake [iso-8859-1] (original) +++ branches/cmake-bringup/toolchain-mingw32.cmake [iso-8859-1] Tue Aug 3 21:38:59 2010 @@ -19,6 +19,8 @@ SET(CMAKE_ASM_COMPILER ${MINGW_PREFIX}gcc) set(CMAKE_ASM_COMPILE_OBJECT "<CMAKE_ASM_COMPILER> -x assembler-with-cpp -o <OBJECT> <FLAGS> <DEFINES> -D__ASM__ -c <SOURCE>") +set(CMAKE_STANDARD_LIBRARIES "") + # adjust the default behaviour of the FIND_XXX() commands: # search headers and libraries in the target environment, search # programs in the host environment
14 years, 4 months
1
0
0
0
[sir_richard] 48438: [CMAKE]: Fix CRT.
by sir_richard@svn.reactos.org
Author: sir_richard Date: Tue Aug 3 21:38:39 2010 New Revision: 48438 URL:
http://svn.reactos.org/svn/reactos?rev=48438&view=rev
Log: [CMAKE]: Fix CRT. Modified: branches/cmake-bringup/lib/sdk/crt/CMakeLists.txt Modified: branches/cmake-bringup/lib/sdk/crt/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/branches/cmake-bringup/lib/sdk/crt/CMake…
============================================================================== --- branches/cmake-bringup/lib/sdk/crt/CMakeLists.txt [iso-8859-1] (original) +++ branches/cmake-bringup/lib/sdk/crt/CMakeLists.txt [iso-8859-1] Tue Aug 3 21:38:39 2010 @@ -1,13 +1,14 @@ -include_directories(.) include_directories(./include) + +add_definitions(-D_CRTBLD) file(GLOB_RECURSE CRT_SOURCE "*.c") LIST(REMOVE_ITEM CRT_SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/stdio/findgen.c) LIST(REMOVE_ITEM CRT_SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/string/strtold.c) add_library(crt ${CRT_SOURCE}) -add_definitions(-D__MINGW_IMPORT=extern -DUSE_MSVCRT_PREFIX -D_MSVCRT_LIB_ -D_MSVCRT_ -D_MT -D_CRTBLD) +set_property(TARGET crt PROPERTY COMPILE_DEFINITIONS __MINGW_IMPORT=extern USE_MSVCRT_PREFIX _MSVCRT_LIB_ _MSVCRT_ _MT) add_dependencies(crt psdk) if(ARCH MATCHES i386) @@ -114,6 +115,5 @@ endif() add_library(libcntpr ${LIBCNTPR_SOURCE}) -remove_definitions(-D__MINGW_IMPORT=extern -DUSE_MSVCRT_PREFIX -D_MSVCRT_LIB_ -D_MSVCRT_ -D_MT -D_CRTBLD) -add_definitions(-DNO_RTL_INLINES -D_NTSYSTEM_ -D_NTDLLBUILD_ -D_LIBCNT_ -D__CRT__NO_INLINE) +set_property(TARGET libcntpr PROPERTY COMPILE_DEFINITIONS NO_RTL_INLINES _NTSYSTEM_ _NTDLLBUILD_ _LIBCNT_ __CRT__NO_INLINE) add_dependencies(libcntpr psdk)
14 years, 4 months
1
0
0
0
[tkreuzer] 48437: [WIN32K] Protect access to the result pointer from KeUserModeCallback with SEH. Fixes a possible kernel mode crash.
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Tue Aug 3 21:36:39 2010 New Revision: 48437 URL:
http://svn.reactos.org/svn/reactos?rev=48437&view=rev
Log: [WIN32K] Protect access to the result pointer from KeUserModeCallback with SEH. Fixes a possible kernel mode crash. Modified: trunk/reactos/subsystems/win32/win32k/ntuser/callback.c Modified: trunk/reactos/subsystems/win32/win32k/ntuser/callback.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/ntuser/callback.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/ntuser/callback.c [iso-8859-1] Tue Aug 3 21:36:39 2010 @@ -267,7 +267,16 @@ if (NT_SUCCESS(Status)) { /* Simulate old behaviour: copy into our local buffer */ - Result = *(LRESULT*)ResultPointer; + _SEH2_TRY + { + ProbeForRead(ResultPointer, sizeof(LRESULT), 1); + Result = *(LRESULT*)ResultPointer; + } + _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) + { + Result = 0; + } + _SEH2_END } UserEnterCo();
14 years, 4 months
1
0
0
0
[sir_richard] 48436: [CMAKE]: Use some nice options which will make makefiles simpler regarding includes.
by sir_richard@svn.reactos.org
Author: sir_richard Date: Tue Aug 3 21:12:51 2010 New Revision: 48436 URL:
http://svn.reactos.org/svn/reactos?rev=48436&view=rev
Log: [CMAKE]: Use some nice options which will make makefiles simpler regarding includes. Modified: branches/cmake-bringup/CMakeLists.txt Modified: branches/cmake-bringup/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/branches/cmake-bringup/CMakeLists.txt?re…
============================================================================== --- branches/cmake-bringup/CMakeLists.txt [iso-8859-1] (original) +++ branches/cmake-bringup/CMakeLists.txt [iso-8859-1] Tue Aug 3 21:12:51 2010 @@ -1,5 +1,8 @@ cmake_minimum_required(VERSION 2.8) project(REACTOS) + +set(CMAKE_INCLUDE_CURRENT_DIR ON) +set(CMAKE_INCLUDE_DIRECTORIES_PROJECT_BEFORE ON) add_definitions(-D__REACTOS__)
14 years, 4 months
1
0
0
0
[sir_richard] 48435: [CMAKE]: Cant' have comments in mc files.
by sir_richard@svn.reactos.org
Author: sir_richard Date: Tue Aug 3 21:12:16 2010 New Revision: 48435 URL:
http://svn.reactos.org/svn/reactos?rev=48435&view=rev
Log: [CMAKE]: Cant' have comments in mc files. Modified: branches/cmake-bringup/include/reactos/mc/bugcodes.mc branches/cmake-bringup/include/reactos/mc/errcodes.mc branches/cmake-bringup/include/reactos/mc/netevent.mc branches/cmake-bringup/include/reactos/mc/ntstatus.mc Modified: branches/cmake-bringup/include/reactos/mc/bugcodes.mc URL:
http://svn.reactos.org/svn/reactos/branches/cmake-bringup/include/reactos/m…
============================================================================== --- branches/cmake-bringup/include/reactos/mc/bugcodes.mc [iso-8859-1] (original) +++ branches/cmake-bringup/include/reactos/mc/bugcodes.mc [iso-8859-1] Tue Aug 3 21:12:16 2010 @@ -1,12 +1,3 @@ -; -; Created by : Marc Piulachs. -; This source code is offered for use in the public domain. -; - -; -; ntoskrnl.exe bug codes -; - MessageIdTypedef=ULONG SeverityNames=(Success=0x0:STATUS_SEVERITY_SUCCESS @@ -23,9 +14,6 @@ LanguageNames=(English=0x409:MSG00409) -; -; message definitions -; MessageId=0x7E Severity=Informational Facility=System @@ -1518,5 +1506,3 @@ Language=English An attempt was made to execute to non-executable memory. . - -; EOF Modified: branches/cmake-bringup/include/reactos/mc/errcodes.mc URL:
http://svn.reactos.org/svn/reactos/branches/cmake-bringup/include/reactos/m…
============================================================================== --- branches/cmake-bringup/include/reactos/mc/errcodes.mc [iso-8859-1] (original) +++ branches/cmake-bringup/include/reactos/mc/errcodes.mc [iso-8859-1] Tue Aug 3 21:12:16 2010 @@ -1,7 +1,3 @@ -; -; kernel32.mc MESSAGE resources for kernel32.dll -; - MessageIdTypedef=ULONG SeverityNames=(Success=0x0:STATUS_SEVERITY_SUCCESS @@ -17,13 +13,6 @@ LanguageNames=(English=0x409:MSG00409) - -; -; message definitions -; - -; Facility=System - MessageId=0 Severity=Success Facility=System @@ -17172,8 +17161,6 @@ ERROR_EVT_CHANNEL_PATH_TOO_GENERAL - The specified channel path selects more than one instance of a channel. The operation requires that only one channel be selected. It may be necessary to scope channel path to version / publicKeyToken to select only one instance. . - -; Facility=WIN32 MessageId=0x000E Severity=Warning @@ -17208,8 +17195,6 @@ . -; Facility=ITF - MessageId=0x0000 Severity=Warning Facility=ITF @@ -17489,5 +17474,3 @@ Language=English CLASS_E_NOTLICENSED - Class is not licensed for use . - -; EOF Modified: branches/cmake-bringup/include/reactos/mc/netevent.mc URL:
http://svn.reactos.org/svn/reactos/branches/cmake-bringup/include/reactos/m…
============================================================================== --- branches/cmake-bringup/include/reactos/mc/netevent.mc [iso-8859-1] (original) +++ branches/cmake-bringup/include/reactos/mc/netevent.mc [iso-8859-1] Tue Aug 3 21:12:16 2010 @@ -1,7 +1,3 @@ -; -; netevent.mc MESSAGE resources for netevent.dll -; - MessageIdTypedef=DWORD SeverityNames=(Success=0x0:STATUS_SEVERITY_SUCCESS @@ -14,15 +10,6 @@ ) LanguageNames=(English=0x409:MSG00409) - - -; -; message definitions -; - -; Facility=System - -; Eventlog messages 6xxx- MessageId=6005 Severity=Warning @@ -49,8 +36,6 @@ . -; transport messages - MessageId=9004 Severity=Error Facility=System Modified: branches/cmake-bringup/include/reactos/mc/ntstatus.mc URL:
http://svn.reactos.org/svn/reactos/branches/cmake-bringup/include/reactos/m…
============================================================================== --- branches/cmake-bringup/include/reactos/mc/ntstatus.mc [iso-8859-1] (original) +++ branches/cmake-bringup/include/reactos/mc/ntstatus.mc [iso-8859-1] Tue Aug 3 21:12:16 2010 @@ -20,7 +20,6 @@ ) LanguageNames=(English=0x409:MSG00409) -;#define STATUS_SUCCESS ((NTSTATUS)0x00000000L) MessageId=0x00 Severity=Success Facility=System
14 years, 4 months
1
0
0
0
[sir_richard] 48434: [CMAKE]: Amine doesn't read man pages, nor does he actually review patches :-)
by sir_richard@svn.reactos.org
Author: sir_richard Date: Tue Aug 3 20:51:47 2010 New Revision: 48434 URL:
http://svn.reactos.org/svn/reactos?rev=48434&view=rev
Log: [CMAKE]: Amine doesn't read man pages, nor does he actually review patches :-) Modified: branches/cmake-bringup/include/reactos/mc/CMakeLists.txt Modified: branches/cmake-bringup/include/reactos/mc/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/branches/cmake-bringup/include/reactos/m…
============================================================================== --- branches/cmake-bringup/include/reactos/mc/CMakeLists.txt [iso-8859-1] (original) +++ branches/cmake-bringup/include/reactos/mc/CMakeLists.txt [iso-8859-1] Tue Aug 3 20:51:47 2010 @@ -5,7 +5,7 @@ get_filename_component(FILE ${_in_FILE} NAME_WE) add_custom_command( OUTPUT ${REACTOS_BINARY_DIR}/include/reactos/${FILE}.rc ${REACTOS_BINARY_DIR}/include/reactos/${FILE}.h - COMMAND ${MINGW_PREFIX}windmc ${REACTOS_SOURCE_DIR}/include/reactos/mc/${FILE}.mc -r ${REACTOS_BINARY_DIR}/include/reactos + COMMAND ${MINGW_PREFIX}windmc ${REACTOS_SOURCE_DIR}/include/reactos/mc/${FILE}.mc -r ${REACTOS_BINARY_DIR}/include/reactos -h ${REACTOS_BINARY_DIR}/include/reactos ) set_source_files_properties( ${REACTOS_BINARY_DIR}/include/reactos/${FILE}.h ${REACTOS_BINARY_DIR}/include/reactos/${FILE}.rc
14 years, 4 months
1
0
0
0
[fireball] 48433: [KERNEL32] - Sync lcformat.c to Wine-1.3. This fixes (a number of potential) problems introduced by new nls data files being synced recently and led to crashes on locales having different months genitives. Original issue confirmed by Sergey Gusev <evilslon@mail.ru> and Igor Paliychuk.
by fireball@svn.reactos.org
Author: fireball Date: Tue Aug 3 20:23:43 2010 New Revision: 48433 URL:
http://svn.reactos.org/svn/reactos?rev=48433&view=rev
Log: [KERNEL32] - Sync lcformat.c to Wine-1.3. This fixes (a number of potential) problems introduced by new nls data files being synced recently and led to crashes on locales having different months genitives. Original issue confirmed by Sergey Gusev <evilslon(a)mail.ru> and Igor Paliychuk. Modified: trunk/reactos/dll/win32/kernel32/misc/lang.c trunk/reactos/dll/win32/kernel32/misc/lcformat.c trunk/reactos/media/doc/README.WINE Modified: trunk/reactos/dll/win32/kernel32/misc/lang.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/misc/la…
============================================================================== --- trunk/reactos/dll/win32/kernel32/misc/lang.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/misc/lang.c [iso-8859-1] Tue Aug 3 20:23:43 2010 @@ -155,142 +155,6 @@ } return lcid; -} - - -/************************************************************************** - * EnumDateFormatsExA (KERNEL32.@) - * - * FIXME: MSDN mentions only LOCALE_USE_CP_ACP, should we handle - * LOCALE_NOUSEROVERRIDE here as well? - */ -BOOL -WINAPI -EnumDateFormatsExA( - DATEFMT_ENUMPROCEXA lpDateFmtEnumProcEx, - LCID Locale, - DWORD dwFlags) -{ - CALID cal_id; - char szBuf[256]; - - if (!lpDateFmtEnumProcEx) - { - SetLastError(ERROR_INVALID_PARAMETER); - return FALSE; - } - - if (!GetLocaleInfoW(Locale, - LOCALE_ICALENDARTYPE|LOCALE_RETURN_NUMBER, - (LPWSTR)&cal_id, - sizeof(cal_id)/sizeof(WCHAR))) - { - return FALSE; - } - - switch (dwFlags & ~LOCALE_USE_CP_ACP) - { - case 0: - case DATE_SHORTDATE: - if (GetLocaleInfoA(Locale, - LOCALE_SSHORTDATE | (dwFlags & LOCALE_USE_CP_ACP), - szBuf, 256)) - { - lpDateFmtEnumProcEx(szBuf, cal_id); - } - break; - - case DATE_LONGDATE: - if (GetLocaleInfoA(Locale, - LOCALE_SLONGDATE | (dwFlags & LOCALE_USE_CP_ACP), - szBuf, 256)) - { - lpDateFmtEnumProcEx(szBuf, cal_id); - } - break; - - case DATE_YEARMONTH: - if (GetLocaleInfoA(Locale, - LOCALE_SYEARMONTH | (dwFlags & LOCALE_USE_CP_ACP), - szBuf, 256)) - { - lpDateFmtEnumProcEx(szBuf, cal_id); - } - break; - - default: - SetLastError(ERROR_INVALID_FLAGS); - return FALSE; - } - return TRUE; -} - - -/************************************************************************** - * EnumDateFormatsExW (KERNEL32.@) - */ -BOOL -WINAPI -EnumDateFormatsExW( - DATEFMT_ENUMPROCEXW lpDateFmtEnumProcEx, - LCID Locale, - DWORD dwFlags) -{ - CALID cal_id; - WCHAR wbuf[256]; // FIXME - - if (!lpDateFmtEnumProcEx) - { - SetLastError(ERROR_INVALID_PARAMETER); - return FALSE; - } - - if (!GetLocaleInfoW(Locale, - LOCALE_ICALENDARTYPE | LOCALE_RETURN_NUMBER, - (LPWSTR)&cal_id, - sizeof(cal_id)/sizeof(WCHAR))) - { - return FALSE; - } - - switch (dwFlags & ~LOCALE_USE_CP_ACP) - { - case 0: - case DATE_SHORTDATE: - if (GetLocaleInfoW(Locale, - LOCALE_SSHORTDATE | (dwFlags & LOCALE_USE_CP_ACP), - wbuf, - 256)) - { - lpDateFmtEnumProcEx(wbuf, cal_id); - } - break; - - case DATE_LONGDATE: - if (GetLocaleInfoW(Locale, - LOCALE_SLONGDATE | (dwFlags & LOCALE_USE_CP_ACP), - wbuf, - 256)) - { - lpDateFmtEnumProcEx(wbuf, cal_id); - } - break; - - case DATE_YEARMONTH: - if (GetLocaleInfoW(Locale, - LOCALE_SYEARMONTH | (dwFlags & LOCALE_USE_CP_ACP), - wbuf, - 256)) - { - lpDateFmtEnumProcEx(wbuf, cal_id); - } - break; - - default: - SetLastError(ERROR_INVALID_FLAGS); - return FALSE; - } - return TRUE; } Modified: trunk/reactos/dll/win32/kernel32/misc/lcformat.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/misc/lc…
============================================================================== --- trunk/reactos/dll/win32/kernel32/misc/lcformat.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/misc/lcformat.c [iso-8859-1] Tue Aug 3 20:23:43 2010 @@ -3,8 +3,9 @@ * * Copyright 1995 Martin von Loewis * Copyright 1998 David Lee Lambert - * Copyright 2000 Julio César Gázquez + * Copyright 2000 Julio César Gázquez * Copyright 2003 Jon Griffiths + * Copyright 2005 Dmitry Timoshkov * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -18,7 +19,7 @@ * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ /* @@ -32,13 +33,9 @@ #include "wine/config.h" #include "wine/unicode.h" -#define NDEBUG -#include <debug.h> - -#define TRACE DPRINT -#define WARN DPRINT1 -#define ERR DPRINT1 -#define FIXME DPRINT1 +#include <wine/debug.h> + +WINE_DEFAULT_DEBUG_CHANNEL(nls); #define DATE_DATEVARSONLY 0x0100 /* only date stuff: yMdg */ #define TIME_TIMEVARSONLY 0x0200 /* only time stuff: hHmst */ @@ -52,7 +49,7 @@ * * Our cache takes the form of a singly linked list, whose node is below: */ -#define NLS_NUM_CACHED_STRINGS 45 +#define NLS_NUM_CACHED_STRINGS 57 typedef struct _NLS_FORMAT_NODE { @@ -72,14 +69,15 @@ #define GetLongDate(fmt) fmt->lppszStrings[1] #define GetShortDate(fmt) fmt->lppszStrings[2] #define GetTime(fmt) fmt->lppszStrings[3] -#define GetAM(fmt) fmt->lppszStrings[42] -#define GetPM(fmt) fmt->lppszStrings[43] -#define GetYearMonth(fmt) fmt->lppszStrings[44] - -#define GetLongDay(fmt,day) fmt->lppszStrings[4 + day] -#define GetShortDay(fmt,day) fmt->lppszStrings[11 + day] -#define GetLongMonth(fmt,mth) fmt->lppszStrings[18 + mth] -#define GetShortMonth(fmt,mth) fmt->lppszStrings[30 + mth] +#define GetAM(fmt) fmt->lppszStrings[54] +#define GetPM(fmt) fmt->lppszStrings[55] +#define GetYearMonth(fmt) fmt->lppszStrings[56] + +#define GetLongDay(fmt,day) fmt->lppszStrings[4 + day] +#define GetShortDay(fmt,day) fmt->lppszStrings[11 + day] +#define GetLongMonth(fmt,mth) fmt->lppszStrings[18 + mth] +#define GetGenitiveMonth(fmt,mth) fmt->lppszStrings[30 + mth] +#define GetShortMonth(fmt,mth) fmt->lppszStrings[42 + mth] /* Write access to the cache is protected by this critical section */ static RTL_CRITICAL_SECTION NLS_FormatsCS; @@ -91,53 +89,6 @@ 0, 0, 0, 0, 0 }; static RTL_CRITICAL_SECTION NLS_FormatsCS = { &NLS_FormatsCS_debug, -1, 0, 0, 0, 0 }; - -/************************************************************************** - * NLS_isSystemLocale <internal> - * - * Return TRUE, if locale is system-type - */ -BOOL NLS_isSystemLocale(LCID lcid) -{ - if(lcid == LOCALE_SYSTEM_DEFAULT || - lcid == LOCALE_NEUTRAL || - lcid == LOCALE_USER_DEFAULT) - { - return TRUE; - } - return FALSE; -} - -/************************************************************************** - * NLS_getDefaultLocale <internal> - * - * Return default system or user locale - */ -LCID NLS_getDefaultLocale(LCID lcid) -{ - LCID lcidTmp; - - DPRINT("Called NLS_getDefaultLocale(0x%04lx)\n", lcid); - - switch(lcid) - { - case LOCALE_SYSTEM_DEFAULT: - NtQueryDefaultLocale(FALSE, &lcidTmp); - return lcidTmp; - break; - - case LOCALE_USER_DEFAULT: - case LOCALE_NEUTRAL: - NtQueryDefaultLocale(TRUE, &lcidTmp); - return lcidTmp; - break; - - default: - DPRINT1("FIXME: unknown system lcid\n"); - } - - return lcid; -} /************************************************************************** * NLS_GetLocaleNumber <internal> @@ -184,10 +135,10 @@ } #define GET_LOCALE_NUMBER(num, type) num = NLS_GetLocaleNumber(lcid, type|dwFlags); \ - TRACE( #type ": %ld (%08lx)\n", (DWORD)num, (DWORD)num) + TRACE( #type ": %d (%08x)\n", (DWORD)num, (DWORD)num) #define GET_LOCALE_STRING(str, type) str = NLS_GetLocaleString(lcid, type|dwFlags); \ - TRACE( #type ": '%S'\n", (str)) + TRACE( #type ": %s\n", debugstr_w(str)) /************************************************************************** * NLS_GetFormats <internal> @@ -197,7 +148,7 @@ static const NLS_FORMAT_NODE *NLS_GetFormats(LCID lcid, DWORD dwFlags) { /* GetLocaleInfo() identifiers for cached formatting strings */ - static const USHORT NLS_LocaleIndices[] = { + static const LCTYPE NLS_LocaleIndices[] = { LOCALE_SNEGATIVESIGN, LOCALE_SLONGDATE, LOCALE_SSHORTDATE, LOCALE_STIMEFORMAT, @@ -210,6 +161,18 @@ LOCALE_SMONTHNAME4, LOCALE_SMONTHNAME5, LOCALE_SMONTHNAME6, LOCALE_SMONTHNAME7, LOCALE_SMONTHNAME8, LOCALE_SMONTHNAME9, LOCALE_SMONTHNAME10, LOCALE_SMONTHNAME11, LOCALE_SMONTHNAME12, + LOCALE_SMONTHNAME1 | LOCALE_RETURN_GENITIVE_NAMES, + LOCALE_SMONTHNAME2 | LOCALE_RETURN_GENITIVE_NAMES, + LOCALE_SMONTHNAME3 | LOCALE_RETURN_GENITIVE_NAMES, + LOCALE_SMONTHNAME4 | LOCALE_RETURN_GENITIVE_NAMES, + LOCALE_SMONTHNAME5 | LOCALE_RETURN_GENITIVE_NAMES, + LOCALE_SMONTHNAME6 | LOCALE_RETURN_GENITIVE_NAMES, + LOCALE_SMONTHNAME7 | LOCALE_RETURN_GENITIVE_NAMES, + LOCALE_SMONTHNAME8 | LOCALE_RETURN_GENITIVE_NAMES, + LOCALE_SMONTHNAME9 | LOCALE_RETURN_GENITIVE_NAMES, + LOCALE_SMONTHNAME10 | LOCALE_RETURN_GENITIVE_NAMES, + LOCALE_SMONTHNAME11 | LOCALE_RETURN_GENITIVE_NAMES, + LOCALE_SMONTHNAME12 | LOCALE_RETURN_GENITIVE_NAMES, LOCALE_SABBREVMONTHNAME1, LOCALE_SABBREVMONTHNAME2, LOCALE_SABBREVMONTHNAME3, LOCALE_SABBREVMONTHNAME4, LOCALE_SABBREVMONTHNAME5, LOCALE_SABBREVMONTHNAME6, LOCALE_SABBREVMONTHNAME7, LOCALE_SABBREVMONTHNAME8, LOCALE_SABBREVMONTHNAME9, @@ -222,7 +185,7 @@ dwFlags &= LOCALE_NOUSEROVERRIDE; - TRACE("(0x%04lx,0x%08lx)\n", lcid, dwFlags); + TRACE("(0x%04x,0x%08x)\n", lcid, dwFlags); /* See if we have already cached the locales number format */ while (node && (node->lcid != lcid || node->dwFlags != dwFlags) && node->next) @@ -296,6 +259,16 @@ { GET_LOCALE_STRING(new_node->lppszStrings[i], NLS_LocaleIndices[i]); } + /* Save some memory if month genitive name is the same or not present */ + for (i = 0; i < 12; i++) + { + if (strcmpW(GetLongMonth(new_node, i), GetGenitiveMonth(new_node, i)) == 0) + { + HeapFree(GetProcessHeap(), 0, GetGenitiveMonth(new_node, i)); + GetGenitiveMonth(new_node, i) = NULL; + } + } + new_node->szShortAM[0] = GetAM(new_node)[0]; new_node->szShortAM[1] = '\0'; new_node->szShortPM[0] = GetPM(new_node)[0]; new_node->szShortPM[1] = '\0'; @@ -360,7 +333,7 @@ case LANG_MARATHI: case LANG_PUNJABI: case LANG_SANSKRIT: - TRACE("lcid 0x%08lx: langid 0x%4x is Unicode Only\n", lcid, PRIMARYLANGID(lcid)); + TRACE("lcid 0x%08x: langid 0x%4x is Unicode Only\n", lcid, PRIMARYLANGID(lcid)); return TRUE; default: return FALSE; @@ -399,14 +372,11 @@ INT cchWritten = 0; INT lastFormatPos = 0; BOOL bSkipping = FALSE; /* Skipping text around marker? */ + BOOL d_dd_formatted = FALSE; /* previous formatted part was for d or dd */ /* Verify our arguments */ if ((cchOut && !lpStr) || !(node = NLS_GetFormats(lcid, dwFlags))) - { -NLS_GetDateTimeFormatW_InvalidParameter: - SetLastError(ERROR_INVALID_PARAMETER); - return 0; - } + goto invalid_parameter; if (dwFlags & ~(DATE_DATEVARSONLY|TIME_TIMEVARSONLY)) { @@ -414,15 +384,13 @@ ((dwFlags & DATE_DATEVARSONLY && dwFlags & ~DATE_FORMAT_FLAGS) || (dwFlags & TIME_TIMEVARSONLY && dwFlags & ~TIME_FORMAT_FLAGS))) { -NLS_GetDateTimeFormatW_InvalidFlags: - SetLastError(ERROR_INVALID_FLAGS); - return 0; + goto invalid_flags; } if (dwFlags & DATE_DATEVARSONLY) { if ((dwFlags & (DATE_LTRREADING|DATE_RTLREADING)) == (DATE_LTRREADING|DATE_RTLREADING)) - goto NLS_GetDateTimeFormatW_InvalidFlags; + goto invalid_flags; else if (dwFlags & (DATE_LTRREADING|DATE_RTLREADING)) FIXME("Unsupported flags: DATE_LTRREADING/DATE_RTLREADING\n"); @@ -434,10 +402,10 @@ case DATE_LONGDATE: case DATE_YEARMONTH: if (lpFormat) - goto NLS_GetDateTimeFormatW_InvalidFlags; + goto invalid_flags; break; default: - goto NLS_GetDateTimeFormatW_InvalidFlags; + goto invalid_flags; } } } @@ -476,7 +444,7 @@ st.wDay = lpTime->wDay; if (st.wDay > 31 || st.wMonth > 12 || !SystemTimeToFileTime(&st, &ftTmp)) - goto NLS_GetDateTimeFormatW_InvalidParameter; + goto invalid_parameter; FileTimeToSystemTime(&ftTmp, &st); lpTime = &st; @@ -486,7 +454,7 @@ { /* Verify the time */ if (lpTime->wHour > 24 || lpTime->wMinute > 59 || lpTime->wSecond > 59) - goto NLS_GetDateTimeFormatW_InvalidParameter; + goto invalid_parameter; } } @@ -511,7 +479,7 @@ if (!cchOut) cchWritten++; /* Count size only */ else if (cchWritten >= cchOut) - goto NLS_GetDateTimeFormatW_Overrun; + goto overrun; else if (!bSkipping) { lpStr[cchWritten] = *lpFormat; @@ -523,7 +491,6 @@ else if ((dwFlags & DATE_DATEVARSONLY && IsDateFmtChar(*lpFormat)) || (dwFlags & TIME_TIMEVARSONLY && IsTimeFmtChar(*lpFormat))) { - char buffA[32]; WCHAR buff[32], fmtChar; LPCWSTR szAdd = NULL; DWORD dwVal = 0; @@ -539,6 +506,7 @@ } buff[0] = '\0'; + if (fmtChar != 'M') d_dd_formatted = FALSE; switch(fmtChar) { case 'd': @@ -550,12 +518,59 @@ { dwVal = lpTime->wDay; szAdd = buff; + d_dd_formatted = TRUE; } break; case 'M': if (count >= 4) + { + LPCWSTR genitive = GetGenitiveMonth(node, lpTime->wMonth - 1); + if (genitive) + { + if (d_dd_formatted) + { + szAdd = genitive; + break; + } + else + { + LPCWSTR format = lpFormat; + /* Look forward now, if next format pattern is for day genitive + name should be used */ + while (*format) + { + /* Skip parts within markers */ + if (IsLiteralMarker(*format)) + { + ++format; + while (*format) + { + if (IsLiteralMarker(*format)) + { + ++format; + if (!IsLiteralMarker(*format)) break; + } + } + } + if (*format != ' ') break; + ++format; + } + /* Only numeric day form matters */ + if (*format && *format == 'd') + { + INT dcount = 1; + while (*++format == 'd') dcount++; + if (dcount < 3) + { + szAdd = genitive; + break; + } + } + } + } szAdd = GetLongMonth(node, lpTime->wMonth - 1); + } else if (count == 3) szAdd = GetShortMonth(node, lpTime->wMonth - 1); else @@ -657,9 +672,9 @@ if (szAdd == buff && buff[0] == '\0') { + static const WCHAR fmtW[] = {'%','.','*','d',0}; /* We have a numeric value to add */ - sprintf(buffA, "%.*ld", count, dwVal); - MultiByteToWideChar(CP_ACP, 0, buffA, -1, buff, sizeof(buff)/sizeof(WCHAR)); + snprintfW(buff, sizeof(buff)/sizeof(WCHAR), fmtW, count, dwVal); } dwLen = szAdd ? strlenW(szAdd) : 0; @@ -671,7 +686,7 @@ else { memcpy(lpStr + cchWritten, szAdd, (cchOut - cchWritten) * sizeof(WCHAR)); - goto NLS_GetDateTimeFormatW_Overrun; + goto overrun; } } cchWritten += dwLen; @@ -683,7 +698,7 @@ if (!cchOut) cchWritten++; /* Count size only */ else if (cchWritten >= cchOut) - goto NLS_GetDateTimeFormatW_Overrun; + goto overrun; else if (!bSkipping || *lpFormat == ' ') { lpStr[cchWritten] = *lpFormat; @@ -697,19 +712,27 @@ if (cchOut) { if (cchWritten >= cchOut) - goto NLS_GetDateTimeFormatW_Overrun; + goto overrun; else lpStr[cchWritten] = '\0'; } cchWritten++; /* Include terminating NUL */ - TRACE("returning length=%d, ouput='%S'\n", cchWritten, lpStr); + TRACE("returning length=%d, ouput=%s\n", cchWritten, debugstr_w(lpStr)); return cchWritten; -NLS_GetDateTimeFormatW_Overrun: +overrun: TRACE("returning 0, (ERROR_INSUFFICIENT_BUFFER)\n"); SetLastError(ERROR_INSUFFICIENT_BUFFER); return 0; + +invalid_parameter: + SetLastError(ERROR_INVALID_PARAMETER); + return 0; + +invalid_flags: + SetLastError(ERROR_INVALID_FLAGS); + return 0; } /****************************************************************************** @@ -725,12 +748,11 @@ WCHAR szFormat[128], szOut[128]; INT iRet; - TRACE("(0x%04lx,0x%08lx,%p,%s,%p,%d)\n", lcid, dwFlags, lpTime, - lpFormat, lpStr, cchOut); + TRACE("(0x%04x,0x%08x,%p,%s,%p,%d)\n", lcid, dwFlags, lpTime, + debugstr_a(lpFormat), lpStr, cchOut); if (NLS_IsUnicodeOnlyLcid(lcid)) { -GetDateTimeFormatA_InvalidParameter: SetLastError(ERROR_INVALID_PARAMETER); return 0; } @@ -739,7 +761,11 @@ { const NLS_FORMAT_NODE *node = NLS_GetFormats(lcid, dwFlags); if (!node) - goto GetDateTimeFormatA_InvalidParameter; + { + SetLastError(ERROR_INVALID_PARAMETER); + return 0; + } + cp = node->dwCodePage; } @@ -810,8 +836,8 @@ INT WINAPI GetDateFormatA( LCID lcid, DWORD dwFlags, const SYSTEMTIME* lpTime, LPCSTR lpFormat, LPSTR lpDateStr, INT cchOut) { - TRACE("(0x%04lx,0x%08lx,%p,%s,%p,%d)\n",lcid, dwFlags, lpTime, - lpFormat, lpDateStr, cchOut); + TRACE("(0x%04x,0x%08x,%p,%s,%p,%d)\n",lcid, dwFlags, lpTime, + debugstr_a(lpFormat), lpDateStr, cchOut); return NLS_GetDateTimeFormatA(lcid, dwFlags | DATE_DATEVARSONLY, lpTime, lpFormat, lpDateStr, cchOut); @@ -826,8 +852,8 @@ INT WINAPI GetDateFormatW(LCID lcid, DWORD dwFlags, const SYSTEMTIME* lpTime, LPCWSTR lpFormat, LPWSTR lpDateStr, INT cchOut) { - TRACE("(0x%04lx,0x%08lx,%p,%S,%p,%d)\n", lcid, dwFlags, lpTime, - lpFormat, lpDateStr, cchOut); + TRACE("(0x%04x,0x%08x,%p,%s,%p,%d)\n", lcid, dwFlags, lpTime, + debugstr_w(lpFormat), lpDateStr, cchOut); return NLS_GetDateTimeFormatW(lcid, dwFlags|DATE_DATEVARSONLY, lpTime, lpFormat, lpDateStr, cchOut); @@ -877,8 +903,8 @@ INT WINAPI GetTimeFormatA(LCID lcid, DWORD dwFlags, const SYSTEMTIME* lpTime, LPCSTR lpFormat, LPSTR lpTimeStr, INT cchOut) { - TRACE("(0x%04lx,0x%08lx,%p,%s,%p,%d)\n",lcid, dwFlags, lpTime, - lpFormat, lpTimeStr, cchOut); + TRACE("(0x%04x,0x%08x,%p,%s,%p,%d)\n",lcid, dwFlags, lpTime, + debugstr_a(lpFormat), lpTimeStr, cchOut); return NLS_GetDateTimeFormatA(lcid, dwFlags|TIME_TIMEVARSONLY, lpTime, lpFormat, lpTimeStr, cchOut); @@ -892,8 +918,8 @@ INT WINAPI GetTimeFormatW(LCID lcid, DWORD dwFlags, const SYSTEMTIME* lpTime, LPCWSTR lpFormat, LPWSTR lpTimeStr, INT cchOut) { - TRACE("(0x%04lx,0x%08lx,%p,%S,%p,%d)\n",lcid, dwFlags, lpTime, - lpFormat, lpTimeStr, cchOut); + TRACE("(0x%04x,0x%08x,%p,%s,%p,%d)\n",lcid, dwFlags, lpTime, + debugstr_w(lpFormat), lpTimeStr, cchOut); return NLS_GetDateTimeFormatW(lcid, dwFlags|TIME_TIMEVARSONLY, lpTime, lpFormat, lpTimeStr, cchOut); @@ -936,12 +962,11 @@ const NUMBERFMTW *pfmt = NULL; INT iRet; - TRACE("(0x%04lx,0x%08lx,%s,%p,%p,%d)\n", lcid, dwFlags, lpszValue, + TRACE("(0x%04x,0x%08x,%s,%p,%p,%d)\n", lcid, dwFlags, debugstr_a(lpszValue), lpFormat, lpNumberStr, cchOut); if (NLS_IsUnicodeOnlyLcid(lcid)) { -GetNumberFormatA_InvalidParameter: SetLastError(ERROR_INVALID_PARAMETER); return 0; } @@ -950,7 +975,11 @@ { const NLS_FORMAT_NODE *node = NLS_GetFormats(lcid, dwFlags); if (!node) - goto GetNumberFormatA_InvalidParameter; + { + SetLastError(ERROR_INVALID_PARAMETER); + return 0; + } + cp = node->dwCodePage; } @@ -1013,28 +1042,16 @@ WCHAR szNegBuff[8]; const WCHAR *lpszNeg = NULL, *lpszNegStart, *szSrc; DWORD dwState = 0, dwDecimals = 0, dwGroupCount = 0, dwCurrentGroupCount = 0; - DWORD dwLeadingZeros = 0; INT iRet; - TRACE("(0x%04lx,0x%08lx,%S,%p,%p,%d)\n", lcid, dwFlags, lpszValue, + TRACE("(0x%04x,0x%08x,%s,%p,%p,%d)\n", lcid, dwFlags, debugstr_w(lpszValue), lpFormat, lpNumberStr, cchOut); - if(NLS_isSystemLocale(lcid)) - { - lcid = NLS_getDefaultLocale(lcid); - } - else if(!IsValidLocale(lcid, LCID_INSTALLED)) - { - SetLastError(ERROR_INVALID_PARAMETER); - return 0; - } - if (!lpszValue || cchOut < 0 || (cchOut > 0 && !lpNumberStr) || + !IsValidLocale(lcid, 0) || (lpFormat && (dwFlags || !lpFormat->lpDecimalSep || !lpFormat->lpThousandSep))) { -GetNumberFormatW_Error: - SetLastError(lpFormat && dwFlags ? ERROR_INVALID_FLAGS : ERROR_INVALID_PARAMETER); - return 0; + goto error; } if (!lpFormat) @@ -1042,7 +1059,7 @@ const NLS_FORMAT_NODE *node = NLS_GetFormats(lcid, dwFlags); if (!node) - goto GetNumberFormatW_Error; + goto error; lpFormat = &node->fmt; lpszNegStart = lpszNeg = GetNegative(node); } @@ -1064,11 +1081,7 @@ /* Check the number for validity */ while (*szSrc) { - if (*szSrc == '0' && !(dwState & NF_DIGITS)) - { - dwLeadingZeros++; - } - else if ((*szSrc >= '1' && *szSrc <= '9') || (*szSrc == '0' && (dwState & NF_DIGITS))) + if (*szSrc >= '0' && *szSrc <= '9') { dwState |= NF_DIGITS; if (dwState & NF_ISREAL) @@ -1077,23 +1090,23 @@ else if (*szSrc == '-') { if (dwState) - goto GetNumberFormatW_Error; /* '-' not first character */ + goto error; /* '-' not first character */ dwState |= NF_ISNEGATIVE; } else if (*szSrc == '.') { if (dwState & NF_ISREAL) - goto GetNumberFormatW_Error; /* More than one '.' */ + goto error; /* More than one '.' */ dwState |= NF_ISREAL; } else - goto GetNumberFormatW_Error; /* Invalid char */ + goto error; /* Invalid char */ szSrc++; } szSrc--; /* Point to last character */ if (!(dwState & NF_DIGITS)) - goto GetNumberFormatW_Error; /* No digits */ + goto error; /* No digits */ /* Add any trailing negative sign */ if (dwState & NF_ISNEGATIVE) @@ -1181,7 +1194,7 @@ dwGroupCount = lpFormat->Grouping == 32 ? 3 : lpFormat->Grouping; /* Write the remaining whole number digits, including grouping chars */ - while (szSrc >= (lpszValue + dwLeadingZeros) && *szSrc >= '0' && *szSrc <= '9') + while (szSrc >= lpszValue && *szSrc >= '0' && *szSrc <= '9') { if (dwState & NF_ROUND) { @@ -1199,7 +1212,7 @@ dwState |= NF_DIGITS_OUT; dwCurrentGroupCount++; - if (szSrc >= (lpszValue + dwLeadingZeros) && dwCurrentGroupCount == dwGroupCount && *szSrc != '-') + if (szSrc >= lpszValue && dwCurrentGroupCount == dwGroupCount && *szSrc != '-') { LPWSTR lpszGrp = lpFormat->lpThousandSep + strlenW(lpFormat->lpThousandSep) - 1; @@ -1251,6 +1264,10 @@ } } return iRet; + +error: + SetLastError(lpFormat && dwFlags ? ERROR_INVALID_FLAGS : ERROR_INVALID_PARAMETER); + return 0; } /************************************************************************** @@ -1290,12 +1307,11 @@ const CURRENCYFMTW *pfmt = NULL; INT iRet; - TRACE("(0x%04lx,0x%08lx,%s,%p,%p,%d)\n", lcid, dwFlags, lpszValue, + TRACE("(0x%04x,0x%08x,%s,%p,%p,%d)\n", lcid, dwFlags, debugstr_a(lpszValue), lpFormat, lpCurrencyStr, cchOut); if (NLS_IsUnicodeOnlyLcid(lcid)) { -GetCurrencyFormatA_InvalidParameter: SetLastError(ERROR_INVALID_PARAMETER); return 0; } @@ -1304,7 +1320,11 @@ { const NLS_FORMAT_NODE *node = NLS_GetFormats(lcid, dwFlags); if (!node) - goto GetCurrencyFormatA_InvalidParameter; + { + SetLastError(ERROR_INVALID_PARAMETER); + return 0; + } + cp = node->dwCodePage; } @@ -1395,32 +1415,16 @@ DWORD dwState = 0, dwDecimals = 0, dwGroupCount = 0, dwCurrentGroupCount = 0, dwFmt; INT iRet; - DPRINT1("GetCurrencyFormatW(0x%04lx,0x%08lx,%S,%p,%p,%d)\n", - lcid, - dwFlags, - lpszValue, - lpFormat, - lpCurrencyStr, - cchOut); - - if(NLS_isSystemLocale(lcid)) - { - lcid = NLS_getDefaultLocale(lcid); - } - else if(!IsValidLocale(lcid, LCID_INSTALLED)) - { - SetLastError(ERROR_INVALID_PARAMETER); - return 0; - } + TRACE("(0x%04x,0x%08x,%s,%p,%p,%d)\n", lcid, dwFlags, debugstr_w(lpszValue), + lpFormat, lpCurrencyStr, cchOut); if (!lpszValue || cchOut < 0 || (cchOut > 0 && !lpCurrencyStr) || + !IsValidLocale(lcid, 0) || (lpFormat && (dwFlags || !lpFormat->lpDecimalSep || !lpFormat->lpThousandSep || !lpFormat->lpCurrencySymbol || lpFormat->NegativeOrder > 15 || lpFormat->PositiveOrder > 3))) { -GetCurrencyFormatW_Error: - SetLastError(lpFormat && dwFlags ? ERROR_INVALID_FLAGS : ERROR_INVALID_PARAMETER); - return 0; + goto error; } if (!lpFormat) @@ -1428,7 +1432,8 @@ const NLS_FORMAT_NODE *node = NLS_GetFormats(lcid, dwFlags); if (!node) - goto GetCurrencyFormatW_Error; + goto error; + lpFormat = &node->cyfmt; lpszNegStart = lpszNeg = GetNegative(node); } @@ -1461,23 +1466,23 @@ else if (*szSrc == '-') { if (dwState) - goto GetCurrencyFormatW_Error; /* '-' not first character */ + goto error; /* '-' not first character */ dwState |= NF_ISNEGATIVE; } else if (*szSrc == '.') { if (dwState & NF_ISREAL) - goto GetCurrencyFormatW_Error; /* More than one '.' */ + goto error; /* More than one '.' */ dwState |= NF_ISREAL; } else - goto GetCurrencyFormatW_Error; /* Invalid char */ + goto error; /* Invalid char */ szSrc++; } szSrc--; /* Point to last character */ if (!(dwState & NF_DIGITS)) - goto GetCurrencyFormatW_Error; /* No digits */ + goto error; /* No digits */ if (dwState & NF_ISNEGATIVE) dwFmt = NLS_NegCyFormats[lpFormat->NegativeOrder]; @@ -1652,6 +1657,10 @@ } } return iRet; + +error: + SetLastError(lpFormat && dwFlags ? ERROR_INVALID_FLAGS : ERROR_INVALID_PARAMETER); + return 0; } /* FIXME: Everything below here needs to move somewhere else along with the @@ -1660,40 +1669,132 @@ */ /************************************************************************** - * EnumDateFormatsA (KERNEL32.@) - */ -BOOL WINAPI EnumDateFormatsA(DATEFMT_ENUMPROCA lpDateFmtEnumProc, LCID Locale, DWORD dwFlags) -{ + * EnumDateFormatsExA (KERNEL32.@) + * + * FIXME: MSDN mentions only LOCALE_USE_CP_ACP, should we handle + * LOCALE_NOUSEROVERRIDE here as well? + */ +BOOL WINAPI EnumDateFormatsExA(DATEFMT_ENUMPROCEXA proc, LCID lcid, DWORD flags) +{ + CALID cal_id; char buf[256]; - if (!lpDateFmtEnumProc) + if (!proc) { SetLastError(ERROR_INVALID_PARAMETER); return FALSE; } - switch (dwFlags & ~LOCALE_USE_CP_ACP) - { - case 0: - case DATE_SHORTDATE: - if (GetLocaleInfoA(Locale, LOCALE_SSHORTDATE | (dwFlags & LOCALE_USE_CP_ACP), buf, 256)) - lpDateFmtEnumProc(buf); - break; - - case DATE_LONGDATE: - if (GetLocaleInfoA(Locale, LOCALE_SLONGDATE | (dwFlags & LOCALE_USE_CP_ACP), buf, 256)) - lpDateFmtEnumProc(buf); - break; - - case DATE_YEARMONTH: - if (GetLocaleInfoA(Locale, LOCALE_SYEARMONTH | (dwFlags & LOCALE_USE_CP_ACP), buf, 256)) - lpDateFmtEnumProc(buf); - break; - - default: - FIXME("Unknown date format (%d)\n", dwFlags); - SetLastError(ERROR_INVALID_PARAMETER); - return FALSE; + if (!GetLocaleInfoW(lcid, LOCALE_ICALENDARTYPE|LOCALE_RETURN_NUMBER, (LPWSTR)&cal_id, sizeof(cal_id)/sizeof(WCHAR))) + return FALSE; + + switch (flags & ~LOCALE_USE_CP_ACP) + { + case 0: + case DATE_SHORTDATE: + if (GetLocaleInfoA(lcid, LOCALE_SSHORTDATE | (flags & LOCALE_USE_CP_ACP), buf, 256)) + proc(buf, cal_id); + break; + + case DATE_LONGDATE: + if (GetLocaleInfoA(lcid, LOCALE_SLONGDATE | (flags & LOCALE_USE_CP_ACP), buf, 256)) + proc(buf, cal_id); + break; + + case DATE_YEARMONTH: + if (GetLocaleInfoA(lcid, LOCALE_SYEARMONTH | (flags & LOCALE_USE_CP_ACP), buf, 256)) + proc(buf, cal_id); + break; + + default: + FIXME("Unknown date format (%d)\n", flags); + SetLastError(ERROR_INVALID_PARAMETER); + return FALSE; + } + return TRUE; +} + +/************************************************************************** + * EnumDateFormatsExW (KERNEL32.@) + */ +BOOL WINAPI EnumDateFormatsExW(DATEFMT_ENUMPROCEXW proc, LCID lcid, DWORD flags) +{ + CALID cal_id; + WCHAR buf[256]; + + if (!proc) + { + SetLastError(ERROR_INVALID_PARAMETER); + return FALSE; + } + + if (!GetLocaleInfoW(lcid, LOCALE_ICALENDARTYPE|LOCALE_RETURN_NUMBER, (LPWSTR)&cal_id, sizeof(cal_id)/sizeof(WCHAR))) + return FALSE; + + switch (flags & ~LOCALE_USE_CP_ACP) + { + case 0: + case DATE_SHORTDATE: + if (GetLocaleInfoW(lcid, LOCALE_SSHORTDATE | (flags & LOCALE_USE_CP_ACP), buf, 256)) + proc(buf, cal_id); + break; + + case DATE_LONGDATE: + if (GetLocaleInfoW(lcid, LOCALE_SLONGDATE | (flags & LOCALE_USE_CP_ACP), buf, 256)) + proc(buf, cal_id); + break; + + case DATE_YEARMONTH: + if (GetLocaleInfoW(lcid, LOCALE_SYEARMONTH | (flags & LOCALE_USE_CP_ACP), buf, 256)) + proc(buf, cal_id); + break; + + default: + FIXME("Unknown date format (%d)\n", flags); + SetLastError(ERROR_INVALID_PARAMETER); + return FALSE; + } + return TRUE; +} + +/************************************************************************** + * EnumDateFormatsA (KERNEL32.@) + * + * FIXME: MSDN mentions only LOCALE_USE_CP_ACP, should we handle + * LOCALE_NOUSEROVERRIDE here as well? + */ +BOOL WINAPI EnumDateFormatsA(DATEFMT_ENUMPROCA proc, LCID lcid, DWORD flags) +{ + char buf[256]; + + if (!proc) + { + SetLastError(ERROR_INVALID_PARAMETER); + return FALSE; + } + + switch (flags & ~LOCALE_USE_CP_ACP) + { + case 0: + case DATE_SHORTDATE: + if (GetLocaleInfoA(lcid, LOCALE_SSHORTDATE | (flags & LOCALE_USE_CP_ACP), buf, 256)) + proc(buf); + break; + + case DATE_LONGDATE: + if (GetLocaleInfoA(lcid, LOCALE_SLONGDATE | (flags & LOCALE_USE_CP_ACP), buf, 256)) + proc(buf); + break; + + case DATE_YEARMONTH: + if (GetLocaleInfoA(lcid, LOCALE_SYEARMONTH | (flags & LOCALE_USE_CP_ACP), buf, 256)) + proc(buf); + break; + + default: + FIXME("Unknown date format (%d)\n", flags); + SetLastError(ERROR_INVALID_PARAMETER); + return FALSE; } return TRUE; } @@ -1701,180 +1802,99 @@ /************************************************************************** * EnumDateFormatsW (KERNEL32.@) */ -BOOL WINAPI EnumDateFormatsW(DATEFMT_ENUMPROCW lpDateFmtEnumProc, LCID Locale, DWORD dwFlags) +BOOL WINAPI EnumDateFormatsW(DATEFMT_ENUMPROCW proc, LCID lcid, DWORD flags) { WCHAR buf[256]; - if (!lpDateFmtEnumProc) + if (!proc) { SetLastError(ERROR_INVALID_PARAMETER); return FALSE; } - switch (dwFlags & ~LOCALE_USE_CP_ACP) - { - case 0: - case DATE_SHORTDATE: - if (GetLocaleInfoW(Locale, LOCALE_SSHORTDATE | (dwFlags & LOCALE_USE_CP_ACP), buf, 256)) - lpDateFmtEnumProc(buf); - break; - - case DATE_LONGDATE: - if (GetLocaleInfoW(Locale, LOCALE_SLONGDATE | (dwFlags & LOCALE_USE_CP_ACP), buf, 256)) - lpDateFmtEnumProc(buf); - break; - - case DATE_YEARMONTH: - if (GetLocaleInfoW(Locale, LOCALE_SYEARMONTH | (dwFlags & LOCALE_USE_CP_ACP), buf, 256)) - lpDateFmtEnumProc(buf); - break; - - default: - FIXME("Unknown date format (%d)\n", dwFlags); - SetLastError(ERROR_INVALID_PARAMETER); - return FALSE; + switch (flags & ~LOCALE_USE_CP_ACP) + { + case 0: + case DATE_SHORTDATE: + if (GetLocaleInfoW(lcid, LOCALE_SSHORTDATE | (flags & LOCALE_USE_CP_ACP), buf, 256)) + proc(buf); + break; + + case DATE_LONGDATE: + if (GetLocaleInfoW(lcid, LOCALE_SLONGDATE | (flags & LOCALE_USE_CP_ACP), buf, 256)) + proc(buf); + break; + + case DATE_YEARMONTH: + if (GetLocaleInfoW(lcid, LOCALE_SYEARMONTH | (flags & LOCALE_USE_CP_ACP), buf, 256)) + proc(buf); + break; + + default: + FIXME("Unknown date format (%d)\n", flags); + SetLastError(ERROR_INVALID_PARAMETER); + return FALSE; } return TRUE; } /************************************************************************** * EnumTimeFormatsA (KERNEL32.@) - */ -BOOL WINAPI EnumTimeFormatsA( TIMEFMT_ENUMPROCA lpTimeFmtEnumProc, LCID Locale, DWORD dwFlags ) -{ - LCID Loc = GetUserDefaultLCID(); - if(!lpTimeFmtEnumProc) - { - SetLastError(ERROR_INVALID_PARAMETER); - return FALSE; - } - if(dwFlags) - { - FIXME("Unknown time format (%ld)\n", dwFlags); - } - - switch( Loc ) - { - case 0x00000407: /* (Loc,"de_DE") */ - { - if(!(*lpTimeFmtEnumProc)("HH.mm")) return TRUE; - if(!(*lpTimeFmtEnumProc)("HH:mm:ss")) return TRUE; - if(!(*lpTimeFmtEnumProc)("H:mm:ss")) return TRUE; - if(!(*lpTimeFmtEnumProc)("H.mm")) return TRUE; - if(!(*lpTimeFmtEnumProc)("H.mm'Uhr'")) return TRUE; + * + * FIXME: MSDN mentions only LOCALE_USE_CP_ACP, should we handle + * LOCALE_NOUSEROVERRIDE here as well? + */ +BOOL WINAPI EnumTimeFormatsA(TIMEFMT_ENUMPROCA proc, LCID lcid, DWORD flags) +{ + char buf[256]; + + if (!proc) + { + SetLastError(ERROR_INVALID_PARAMETER); + return FALSE; + } + + switch (flags & ~LOCALE_USE_CP_ACP) + { + case 0: + if (GetLocaleInfoA(lcid, LOCALE_STIMEFORMAT | (flags & LOCALE_USE_CP_ACP), buf, 256)) + proc(buf); + break; + + default: + FIXME("Unknown time format (%d)\n", flags); + SetLastError(ERROR_INVALID_PARAMETER); + return FALSE; + } return TRUE; - } - - case 0x0000040c: /* (Loc,"fr_FR") */ - case 0x00000c0c: /* (Loc,"fr_CA") */ - { - if(!(*lpTimeFmtEnumProc)("H:mm")) return TRUE; - if(!(*lpTimeFmtEnumProc)("HH:mm:ss")) return TRUE; - if(!(*lpTimeFmtEnumProc)("H:mm:ss")) return TRUE; - if(!(*lpTimeFmtEnumProc)("HH.mm")) return TRUE; - if(!(*lpTimeFmtEnumProc)("HH'h'mm")) return TRUE; - return TRUE; - } - - case 0x00000809: /* (Loc,"en_UK") */ - case 0x00000c09: /* (Loc,"en_AU") */ - case 0x00001409: /* (Loc,"en_NZ") */ - case 0x00001809: /* (Loc,"en_IE") */ - { - if(!(*lpTimeFmtEnumProc)("h:mm:ss tt")) return TRUE; - if(!(*lpTimeFmtEnumProc)("HH:mm:ss")) return TRUE; - if(!(*lpTimeFmtEnumProc)("H:mm:ss")) return TRUE; - return TRUE; - } - - case 0x00001c09: /* (Loc,"en_ZA") */ - case 0x00002809: /* (Loc,"en_BZ") */ - case 0x00002c09: /* (Loc,"en_TT") */ - { - if(!(*lpTimeFmtEnumProc)("h:mm:ss tt")) return TRUE; - if(!(*lpTimeFmtEnumProc)("hh:mm:ss tt")) return TRUE; - return TRUE; - } - - default: /* default to US style "en_US" */ - { - if(!(*lpTimeFmtEnumProc)("h:mm:ss tt")) return TRUE; - if(!(*lpTimeFmtEnumProc)("hh:mm:ss tt")) return TRUE; - if(!(*lpTimeFmtEnumProc)("H:mm:ss")) return TRUE; - if(!(*lpTimeFmtEnumProc)("HH:mm:ss")) return TRUE; - return TRUE; - } - } } /************************************************************************** * EnumTimeFormatsW (KERNEL32.@) */ -BOOL WINAPI EnumTimeFormatsW( TIMEFMT_ENUMPROCW lpTimeFmtEnumProc, LCID Locale, DWORD dwFlags ) -{ - LCID Loc = GetUserDefaultLCID(); - if(!lpTimeFmtEnumProc) - { - SetLastError(ERROR_INVALID_PARAMETER); - return FALSE; - } - if(dwFlags) - { - FIXME("Unknown time format (%ld)\n", dwFlags); - } - - switch( Loc ) - { - case 0x00000407: /* (Loc,"de_DE") */ - { - if(!(*lpTimeFmtEnumProc)(L"HH.mm")) return TRUE; - if(!(*lpTimeFmtEnumProc)(L"HH:mm:ss")) return TRUE; - if(!(*lpTimeFmtEnumProc)(L"H:mm:ss")) return TRUE; - if(!(*lpTimeFmtEnumProc)(L"H.mm")) return TRUE; - if(!(*lpTimeFmtEnumProc)(L"H.mm'Uhr'")) return TRUE; +BOOL WINAPI EnumTimeFormatsW(TIMEFMT_ENUMPROCW proc, LCID lcid, DWORD flags) +{ + WCHAR buf[256]; + + if (!proc) + { + SetLastError(ERROR_INVALID_PARAMETER); + return FALSE; + } + + switch (flags & ~LOCALE_USE_CP_ACP) + { + case 0: + if (GetLocaleInfoW(lcid, LOCALE_STIMEFORMAT | (flags & LOCALE_USE_CP_ACP), buf, 256)) + proc(buf); + break; + + default: + FIXME("Unknown time format (%d)\n", flags); + SetLastError(ERROR_INVALID_PARAMETER); + return FALSE; + } return TRUE; - } - - case 0x0000040c: /* (Loc,"fr_FR") */ - case 0x00000c0c: /* (Loc,"fr_CA") */ - { - if(!(*lpTimeFmtEnumProc)(L"H:mm")) return TRUE; - if(!(*lpTimeFmtEnumProc)(L"HH:mm:ss")) return TRUE; - if(!(*lpTimeFmtEnumProc)(L"H:mm:ss")) return TRUE; - if(!(*lpTimeFmtEnumProc)(L"HH.mm")) return TRUE; - if(!(*lpTimeFmtEnumProc)(L"HH'h'mm")) return TRUE; - return TRUE; - } - - case 0x00000809: /* (Loc,"en_UK") */ - case 0x00000c09: /* (Loc,"en_AU") */ - case 0x00001409: /* (Loc,"en_NZ") */ - case 0x00001809: /* (Loc,"en_IE") */ - { - if(!(*lpTimeFmtEnumProc)(L"h:mm:ss tt")) return TRUE; - if(!(*lpTimeFmtEnumProc)(L"HH:mm:ss")) return TRUE; - if(!(*lpTimeFmtEnumProc)(L"H:mm:ss")) return TRUE; - return TRUE; - } - - case 0x00001c09: /* (Loc,"en_ZA") */ - case 0x00002809: /* (Loc,"en_BZ") */ - case 0x00002c09: /* (Loc,"en_TT") */ - { - if(!(*lpTimeFmtEnumProc)(L"h:mm:ss tt")) return TRUE; - if(!(*lpTimeFmtEnumProc)(L"hh:mm:ss tt")) return TRUE; - return TRUE; - } - - default: /* default to US style "en_US" */ - { - if(!(*lpTimeFmtEnumProc)(L"h:mm:ss tt")) return TRUE; - if(!(*lpTimeFmtEnumProc)(L"hh:mm:ss tt")) return TRUE; - if(!(*lpTimeFmtEnumProc)(L"H:mm:ss")) return TRUE; - if(!(*lpTimeFmtEnumProc)(L"HH:mm:ss")) return TRUE; - return TRUE; - } - } } /****************************************************************************** @@ -1940,7 +1960,7 @@ if (opt == NULL) { SetLastError(ERROR_NOT_ENOUGH_MEMORY); - goto NLS_EnumCalendarInfoAW_Cleanup; + goto cleanup; } if (GetLocaleInfoW(locale, LOCALE_IOPTIONALCALENDAR, opt, optSz)) iter = opt; @@ -1967,14 +1987,14 @@ if (bufSz >= newSz) { ERR("Buffer resizing disorder: was %d, requested %d.\n", bufSz, newSz); - goto NLS_EnumCalendarInfoAW_Cleanup; + goto cleanup; } bufSz = newSz; WARN("Buffer too small; resizing to %d bytes.\n", bufSz); buf = HeapReAlloc(GetProcessHeap(), 0, buf, bufSz); if (buf == NULL) - goto NLS_EnumCalendarInfoAW_Cleanup; - } else goto NLS_EnumCalendarInfoAW_Cleanup; + goto cleanup; + } else goto cleanup; } } while (!ret); @@ -2008,7 +2028,7 @@ } } -NLS_EnumCalendarInfoAW_Cleanup: +cleanup: HeapFree(GetProcessHeap(), 0, opt); HeapFree(GetProcessHeap(), 0, buf); return ret; @@ -2016,12 +2036,14 @@ /****************************************************************************** * EnumCalendarInfoA [KERNEL32.@] + * + * See EnumCalendarInfoAW. */ BOOL WINAPI EnumCalendarInfoA( CALINFO_ENUMPROCA calinfoproc,LCID locale, CALID calendar,CALTYPE caltype ) { - FIXME("(%p,0x%04lx,0x%08lx,0x%08lx),stub!\n",calinfoproc,locale,calendar,caltype); - return NLS_EnumCalendarInfoAW(calinfoproc, locale, calendar, caltype, FALSE, FALSE); + TRACE("(%p,0x%08x,0x%08x,0x%08x)\n", calinfoproc, locale, calendar, caltype); + return NLS_EnumCalendarInfoAW(calinfoproc, locale, calendar, caltype, FALSE, FALSE); } /****************************************************************************** Modified: trunk/reactos/media/doc/README.WINE URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=…
============================================================================== --- trunk/reactos/media/doc/README.WINE [iso-8859-1] (original) +++ trunk/reactos/media/doc/README.WINE [iso-8859-1] Tue Aug 3 20:23:43 2010 @@ -218,7 +218,7 @@ kernel32 - reactos/dll/win32/kernel32/misc/errormsg.c # Out of sync reactos/dll/win32/kernel32/misc/profile.c # Out of sync - reactos/dll/win32/kernel32/misc/lcformat.c # Out of sync + reactos/dll/win32/kernel32/misc/lcformat.c # Synced to Wine-1_3 reactos/dll/win32/kernel32/misc/lzexpand.c # Synced to Wine-1_1_23 msvcrt -
14 years, 4 months
1
0
0
0
[tkreuzer] 48432: [CRT] Implement a proper version of _assert. It nows shows a message box with the details and let's the user choose to either abort, debug or ignore the assertion. See bug 5486, bug 5507, bug 5511
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Tue Aug 3 16:09:33 2010 New Revision: 48432 URL:
http://svn.reactos.org/svn/reactos?rev=48432&view=rev
Log: [CRT] Implement a proper version of _assert. It nows shows a message box with the details and let's the user choose to either abort, debug or ignore the assertion. See bug 5486, bug 5507, bug 5511 Modified: trunk/reactos/lib/sdk/crt/misc/assert.c Modified: trunk/reactos/lib/sdk/crt/misc/assert.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/sdk/crt/misc/assert.c?…
============================================================================== --- trunk/reactos/lib/sdk/crt/misc/assert.c [iso-8859-1] (original) +++ trunk/reactos/lib/sdk/crt/misc/assert.c [iso-8859-1] Tue Aug 3 16:09:33 2010 @@ -5,15 +5,68 @@ #include <stdlib.h> #include <signal.h> +static const char formatstr[] = + "Assertion failed!\n\n" + "Program: %s\n" + "File: %s\n" + "Line: %ld\n\n" + "Expression: %s\n" + "Press Retry to debug the application\n"; + /* * @implemented */ -void _assert(const char *msg, const char *file, unsigned line) +void _assert(const char *exp, const char *file, unsigned line) { - /* Assertion failed at foo.c line 45: x<y */ - fprintf(stderr, "Assertion failed at %s line %d: %s\n", file, line, msg); - FIXME("Assertion failed at %s line %d: %s\n", file, line, msg); - raise(SIGABRT); - for(;;); /* eliminate warning by mingw */ + int (WINAPI *pMessageBoxA)(HWND, LPCTSTR, LPCTSTR, UINT); + HMODULE hmodUser32; + char achProgram[40]; + char *pszBuffer; + int len; + int iResult; + + /* Assertion failed at foo.c line 45: x<y */ + fprintf(stderr, "Assertion failed at %s line %d: %s\n", file, line, exp); + FIXME("Assertion failed at %s line %d: %s\n", file, line, exp); + + /* Get MessageBoxA function pointer */ + hmodUser32 = LoadLibrary("user32.dll"); + pMessageBoxA = GetProcAddress(hmodUser32, "MessageBoxA"); + if (!pMessageBoxA) + { + abort(); + } + + /* Get the file name of the module */ + len = GetModuleFileNameA(NULL, achProgram, 40); + + /* Calculate full length of the message */ + len += sizeof(formatstr) + len + strlen(exp) + strlen(file); + + /* Allocate a buffer */ + pszBuffer = malloc(len + 1); + + /* Format a message */ + _snprintf(pszBuffer, len, formatstr, achProgram, file, line, exp); + + /* Display a message box */ + iResult = pMessageBoxA(NULL, + pszBuffer, + "ReactOS C Runtime Library", + MB_ABORTRETRYIGNORE | MB_ICONERROR); + + free(pszBuffer); + + /* Does the user want to abort? */ + if (iResult == IDABORT) + { + abort(); + } + + /* Does the user want to debug? */ + if (iResult == IDRETRY) + { + __debugbreak(); + } }
14 years, 4 months
1
0
0
0
[sir_richard] 48431: [CMAKE]: Forgot to delete this guy.
by sir_richard@svn.reactos.org
Author: sir_richard Date: Tue Aug 3 16:06:10 2010 New Revision: 48431 URL:
http://svn.reactos.org/svn/reactos?rev=48431&view=rev
Log: [CMAKE]: Forgot to delete this guy. Removed: branches/cmake-bringup/lib/debugsup/CMakeLists.txt Removed: branches/cmake-bringup/lib/debugsup/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/branches/cmake-bringup/lib/debugsup/CMak…
============================================================================== --- branches/cmake-bringup/lib/debugsup/CMakeLists.txt [iso-8859-1] (original) +++ branches/cmake-bringup/lib/debugsup/CMakeLists.txt (removed) @@ -1,15 +1,0 @@ - -ADD_CUSTOM_COMMAND( - OUTPUT ${REACTOS_BINARY_DIR}/lib/debugsup/debugsup_ntdll.a - COMMAND native-winebuild -o ${REACTOS_BINARY_DIR}/lib/debugsup/debugsup-ntos_debugsup_ntdll.stubs.c --pedll ${REACTOS_SOURCE_DIR}/lib/debugsup/debugsup-ntos.spec --filename ntdll.dll - COMMAND ${MINGW_PREFIX}gcc -o ${REACTOS_BINARY_DIR}/lib/debugsup/debugsup-ntos_debugsup_ntdll.stubs.o ${CMAKE_C_FLAGS} -c ${REACTOS_BINARY_DIR}/lib/debugsup/debugsup-ntos_debugsup_ntdll.stubs.c - COMMAND native-winebuild -o ${REACTOS_BINARY_DIR}/lib/debugsup/debugsup-ntos_debugsup_ntdll.auto.def --def -E ${REACTOS_SOURCE_DIR}/lib/debugsup/debugsup-ntos.spec --filename ntdll.dll - COMMAND ${MINGW_PREFIX}dlltool --def ${REACTOS_BINARY_DIR}/lib/debugsup/debugsup-ntos_debugsup_ntdll.auto.def --kill-at --output-lib ${REACTOS_BINARY_DIR}/lib/debugsup/debugsup_ntdll.a - COMMAND ${MINGW_PREFIX}ar -rc ${REACTOS_BINARY_DIR}/lib/debugsup/debugsup_ntdll.a ${REACTOS_BINARY_DIR}/lib/debugsup/debugsup-ntos_debugsup_ntdll.stubs.o - DEPENDS native-winebuild -) - -SET_SOURCE_FILES_PROPERTIES(${REACTOS_BINARY_DIR}/lib/debugsup/debugsup_ntdll.a PROPERTIES GENERATED TRUE) - -ADD_CUSTOM_TARGET(debugsup_ntdll ALL DEPENDS ${REACTOS_BINARY_DIR}/lib/debugsup/debugsup_ntdll.a) -
14 years, 4 months
1
0
0
0
← Newer
1
...
21
22
23
24
25
26
27
28
29
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
Results per page:
10
25
50
100
200