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
April 2019
----- 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
32 participants
240 discussions
Start a n
N
ew thread
[reactos] 04/06: [EXT2] Add __REACTOS__ check around changes done in 76910c358f7197a6b8e283ea267faf7b5c1812ff
by Hervé Poussineau
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=4c1cbd2b53d599cb23c16…
commit 4c1cbd2b53d599cb23c167f52b1c80befb65e1b3 Author: Hervé Poussineau <hpoussin(a)reactos.org> AuthorDate: Sun Apr 7 08:58:46 2019 +0200 Commit: Hervé Poussineau <hpoussin(a)reactos.org> CommitDate: Sun Apr 7 18:32:29 2019 +0200 [EXT2] Add __REACTOS__ check around changes done in 76910c358f7197a6b8e283ea267faf7b5c1812ff --- drivers/filesystems/ext2/src/memory.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/filesystems/ext2/src/memory.c b/drivers/filesystems/ext2/src/memory.c index cf569f40cd..f0eaac5e12 100644 --- a/drivers/filesystems/ext2/src/memory.c +++ b/drivers/filesystems/ext2/src/memory.c @@ -2072,9 +2072,15 @@ Ext2ParseRegistryVolumeParams( USHORT i, j, k; +#ifdef __REACTOS__ RtlZeroMemory(Codepage, sizeof(WCHAR) * CODEPAGE_MAXLEN); RtlZeroMemory(Prefix, sizeof(WCHAR) * HIDINGPAT_LEN); RtlZeroMemory(Suffix, sizeof(WCHAR) * HIDINGPAT_LEN); +#else + RtlZeroMemory(Codepage, CODEPAGE_MAXLEN); + RtlZeroMemory(Prefix, HIDINGPAT_LEN); + RtlZeroMemory(Suffix, HIDINGPAT_LEN); +#endif RtlZeroMemory(MountPoint, sizeof(USHORT) * 4); RtlZeroMemory(DrvLetter, sizeof(CHAR) * 4);
5 years, 8 months
1
0
0
0
[reactos] 03/06: [CMAKE] Prevent out-of-bound accesses in parser/lexer files
by Hervé Poussineau
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=09c4d0a74b2362e2c9d29…
commit 09c4d0a74b2362e2c9d29ec87c54ecc3bddd5b79 Author: Hervé Poussineau <hpoussin(a)reactos.org> AuthorDate: Sat Apr 6 23:35:37 2019 +0200 Commit: Hervé Poussineau <hpoussin(a)reactos.org> CommitDate: Sun Apr 7 18:32:29 2019 +0200 [CMAKE] Prevent out-of-bound accesses in parser/lexer files which try to remove path prefix from them. --- base/applications/winhlp32/CMakeLists.txt | 3 +++ dll/directx/wine/d3dcompiler_43/CMakeLists.txt | 8 ++++++++ dll/win32/jscript/CMakeLists.txt | 3 +++ dll/win32/msi/CMakeLists.txt | 3 +++ dll/win32/msxml3/CMakeLists.txt | 3 +++ dll/win32/vbscript/CMakeLists.txt | 3 +++ dll/win32/wbemprox/CMakeLists.txt | 3 +++ 7 files changed, 26 insertions(+) diff --git a/base/applications/winhlp32/CMakeLists.txt b/base/applications/winhlp32/CMakeLists.txt index cb4ee2e72a..9a17ba1a13 100644 --- a/base/applications/winhlp32/CMakeLists.txt +++ b/base/applications/winhlp32/CMakeLists.txt @@ -15,6 +15,9 @@ list(APPEND SOURCE winhelp.c precomp.h) +# macro.lex.yy.c has been generated with relative file paths... +set_source_files_properties(macro.lex.yy.c PROPERTIES COMPILE_FLAGS "-UREACTOS_SOURCE_DIR -DREACTOS_SOURCE_DIR=\"\\\".\\\"\"") + add_rc_deps(rsrc.rc ${CMAKE_CURRENT_SOURCE_DIR}/res/winhelp.ico) add_executable(winhlp32 ${SOURCE} string.c rsrc.rc) set_module_type(winhlp32 win32gui) diff --git a/dll/directx/wine/d3dcompiler_43/CMakeLists.txt b/dll/directx/wine/d3dcompiler_43/CMakeLists.txt index 49d18b0b07..7091dc22cf 100644 --- a/dll/directx/wine/d3dcompiler_43/CMakeLists.txt +++ b/dll/directx/wine/d3dcompiler_43/CMakeLists.txt @@ -26,6 +26,14 @@ add_library(d3dcompiler_43 MODULE version.rc ${CMAKE_CURRENT_BINARY_DIR}/d3dcompiler_43.def) +# some files have been generated with relative file paths... +set_source_files_properties( + asmshader.tab.c + asmshader.yy.c + hlsl.tab.c + hlsl.yy.c + PROPERTIES COMPILE_FLAGS "-UREACTOS_SOURCE_DIR -DREACTOS_SOURCE_DIR=\"\\\".\\\"\"") + set_module_type(d3dcompiler_43 win32dll) target_link_libraries(d3dcompiler_43 dx10guid uuid wine wpp) add_importlibs(d3dcompiler_43 msvcrt kernel32 ntdll) diff --git a/dll/win32/jscript/CMakeLists.txt b/dll/win32/jscript/CMakeLists.txt index 40a48d570b..7f0a036af5 100644 --- a/dll/win32/jscript/CMakeLists.txt +++ b/dll/win32/jscript/CMakeLists.txt @@ -35,6 +35,9 @@ list(APPEND SOURCE vbarray.c precomp.h) +# cc_parser.tab.c/parser.tab.c have been generated with relative file paths... +set_source_files_properties(cc_parser.tab.c parser.tab.c PROPERTIES COMPILE_FLAGS "-UREACTOS_SOURCE_DIR -DREACTOS_SOURCE_DIR=\"\\\".\\\"\"") + list(APPEND jscript_rc_deps ${CMAKE_CURRENT_SOURCE_DIR}/jscript.rgs ${CMAKE_CURRENT_SOURCE_DIR}/jscript_classes.rgs diff --git a/dll/win32/msi/CMakeLists.txt b/dll/win32/msi/CMakeLists.txt index b2e6bf72f7..10d1fb1797 100644 --- a/dll/win32/msi/CMakeLists.txt +++ b/dll/win32/msi/CMakeLists.txt @@ -51,6 +51,9 @@ list(APPEND SOURCE where.c precomp.h) +# cond.tab.c/sql.tab.c have been generated with relative file paths... +set_source_files_properties(cond.tab.c sql.tab.c PROPERTIES COMPILE_FLAGS "-UREACTOS_SOURCE_DIR -DREACTOS_SOURCE_DIR=\"\\\".\\\"\"") + add_library(msi MODULE ${SOURCE} ${CMAKE_CURRENT_BINARY_DIR}/msiserver_i.c diff --git a/dll/win32/msxml3/CMakeLists.txt b/dll/win32/msxml3/CMakeLists.txt index 7abb691b21..a5cb75b295 100644 --- a/dll/win32/msxml3/CMakeLists.txt +++ b/dll/win32/msxml3/CMakeLists.txt @@ -52,6 +52,9 @@ list(APPEND SOURCE precomp.h ${CMAKE_CURRENT_BINARY_DIR}/msxml3_stubs.c) +# xslpattern.tab.c/xslpattern.yy.c have been generated with relative file paths... +set_source_files_properties(xslpattern.tab.c xslpattern.yy.c PROPERTIES COMPILE_FLAGS "-UREACTOS_SOURCE_DIR -DREACTOS_SOURCE_DIR=\"\\\".\\\"\"") + list(APPEND msxml3_rc_deps ${CMAKE_CURRENT_SOURCE_DIR}/msxml3.manifest ${CMAKE_CURRENT_SOURCE_DIR}/msxml3_v1.rgs diff --git a/dll/win32/vbscript/CMakeLists.txt b/dll/win32/vbscript/CMakeLists.txt index d562befb46..999d7edceb 100644 --- a/dll/win32/vbscript/CMakeLists.txt +++ b/dll/win32/vbscript/CMakeLists.txt @@ -17,6 +17,9 @@ list(APPEND SOURCE vbscript_main.c precomp.h) +# parser.tab.c has been generated with relative file paths... +set_source_files_properties(parser.tab.c PROPERTIES COMPILE_FLAGS "-UREACTOS_SOURCE_DIR -DREACTOS_SOURCE_DIR=\"\\\".\\\"\"") + list(APPEND vbscript_rc_deps ${CMAKE_CURRENT_SOURCE_DIR}/vbscript_classes.rgs ${CMAKE_CURRENT_SOURCE_DIR}/vbsglobal.rgs diff --git a/dll/win32/wbemprox/CMakeLists.txt b/dll/win32/wbemprox/CMakeLists.txt index d11bb0da53..a59647739e 100644 --- a/dll/win32/wbemprox/CMakeLists.txt +++ b/dll/win32/wbemprox/CMakeLists.txt @@ -22,6 +22,9 @@ list(APPEND SOURCE wql.tab.c precomp.h) +# wql.tab.c has been generated with relative file paths... +set_source_files_properties(wql.tab.c PROPERTIES COMPILE_FLAGS "-UREACTOS_SOURCE_DIR -DREACTOS_SOURCE_DIR=\"\\\".\\\"\"") + add_library(wbemprox MODULE ${SOURCE} guid.c
5 years, 8 months
1
0
0
0
[reactos] 02/06: [DHCPCSVC] Eliminate unused code and associated parameters
by Hervé Poussineau
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=15a828c86d1d68a9dabaa…
commit 15a828c86d1d68a9dabaaa77bb6bb9d5e7104f42 Author: Hervé Poussineau <hpoussin(a)reactos.org> AuthorDate: Sat Apr 6 23:11:53 2019 +0200 Commit: Hervé Poussineau <hpoussin(a)reactos.org> CommitDate: Sun Apr 7 18:32:28 2019 +0200 [DHCPCSVC] Eliminate unused code and associated parameters This is mostly the same as OpenBSD commit b4e4f16f2ae0ddf1e786bb12c99b8c51170a1a33 --- base/services/dhcpcsvc/dhcp/dhclient.c | 6 +-- base/services/dhcpcsvc/dhcp/options.c | 70 +++++----------------------------- base/services/dhcpcsvc/include/dhcpd.h | 2 +- 3 files changed, 13 insertions(+), 65 deletions(-) diff --git a/base/services/dhcpcsvc/dhcp/dhclient.c b/base/services/dhcpcsvc/dhcp/dhclient.c index ab28782bf8..f840f5b876 100644 --- a/base/services/dhcpcsvc/dhcp/dhclient.c +++ b/base/services/dhcpcsvc/dhcp/dhclient.c @@ -1288,7 +1288,7 @@ make_discover(struct interface_info *ip, struct client_lease *lease) /* Set up the option buffer... */ ip->client->packet_length = cons_options(NULL, &ip->client->packet, 0, - options, 0, 0, 0, NULL, 0); + options); if (ip->client->packet_length < BOOTP_MIN_LEN) ip->client->packet_length = BOOTP_MIN_LEN; @@ -1380,7 +1380,7 @@ make_request(struct interface_info *ip, struct client_lease * lease) /* Set up the option buffer... */ ip->client->packet_length = cons_options(NULL, &ip->client->packet, 0, - options, 0, 0, 0, NULL, 0); + options); if (ip->client->packet_length < BOOTP_MIN_LEN) ip->client->packet_length = BOOTP_MIN_LEN; @@ -1464,7 +1464,7 @@ make_decline(struct interface_info *ip, struct client_lease *lease) /* Set up the option buffer... */ ip->client->packet_length = cons_options(NULL, &ip->client->packet, 0, - options, 0, 0, 0, NULL, 0); + options); if (ip->client->packet_length < BOOTP_MIN_LEN) ip->client->packet_length = BOOTP_MIN_LEN; diff --git a/base/services/dhcpcsvc/dhcp/options.c b/base/services/dhcpcsvc/dhcp/options.c index d7572fbee7..9763bb29c3 100644 --- a/base/services/dhcpcsvc/dhcp/options.c +++ b/base/services/dhcpcsvc/dhcp/options.c @@ -49,7 +49,7 @@ int bad_options_max = 5; void parse_options(struct packet *); void parse_option_buffer(struct packet *, unsigned char *, int); int store_options(unsigned char *, int, struct tree_cache **, - unsigned char *, int, int, int, int); + unsigned char *, int, int, int); /* @@ -197,12 +197,10 @@ parse_option_buffer(struct packet *packet, */ int cons_options(struct packet *inpacket, struct dhcp_packet *outpacket, - int mms, struct tree_cache **options, - int overload, /* Overload flags that may be set. */ - int terminate, int bootpp, u_int8_t *prl, int prl_len) + int mms, struct tree_cache **options) { unsigned char priority_list[300], buffer[4096]; - int priority_len, main_buffer_size, mainbufix, bufix; + int priority_len, main_buffer_size, mainbufix; int option_size, length; /* @@ -223,8 +221,6 @@ cons_options(struct packet *inpacket, struct dhcp_packet *outpacket, if (mms) main_buffer_size = mms - DHCP_FIXED_LEN; - else if (bootpp) - main_buffer_size = 64; else main_buffer_size = 576 - DHCP_FIXED_LEN; @@ -254,14 +250,6 @@ cons_options(struct packet *inpacket, struct dhcp_packet *outpacket, inpacket->options[DHO_DHCP_PARAMETER_REQUEST_LIST].data, prlen); priority_len += prlen; - prl = priority_list; - } else if (prl) { - if (prl_len + priority_len > sizeof(priority_list)) - prl_len = sizeof(priority_list) - priority_len; - - memcpy(&priority_list[priority_len], prl, prl_len); - priority_len += prl_len; - prl = priority_list; } else { memcpy(&priority_list[priority_len], dhcp_option_default_priority_list, @@ -272,11 +260,9 @@ cons_options(struct packet *inpacket, struct dhcp_packet *outpacket, /* Copy the options into the big buffer... */ option_size = store_options( buffer, - (main_buffer_size - 7 + ((overload & 1) ? DHCP_FILE_LEN : 0) + - ((overload & 2) ? DHCP_SNAME_LEN : 0)), + main_buffer_size - 7, options, priority_list, priority_len, main_buffer_size, - (main_buffer_size + ((overload & 1) ? DHCP_FILE_LEN : 0)), - terminate); + main_buffer_size); /* Put the cookie up front... */ memcpy(outpacket->options, DHCP_OPTIONS_COOKIE, 4); @@ -305,33 +291,7 @@ cons_options(struct packet *inpacket, struct dhcp_packet *outpacket, memcpy(&outpacket->options[mainbufix], buffer, main_buffer_size - mainbufix); - bufix = main_buffer_size - mainbufix; length = DHCP_FIXED_NON_UDP + mainbufix; - if (overload & 1) { - if (option_size - bufix <= DHCP_FILE_LEN) { - memcpy(outpacket->file, - &buffer[bufix], option_size - bufix); - mainbufix = option_size - bufix; - if (mainbufix < DHCP_FILE_LEN) - outpacket->file[mainbufix++] = (char)DHO_END; - while (mainbufix < DHCP_FILE_LEN) - outpacket->file[mainbufix++] = (char)DHO_PAD; - } else { - memcpy(outpacket->file, - &buffer[bufix], DHCP_FILE_LEN); - bufix += DHCP_FILE_LEN; - } - } - if ((overload & 2) && option_size < bufix) { - memcpy(outpacket->sname, - &buffer[bufix], option_size - bufix); - - mainbufix = option_size - bufix; - if (mainbufix < DHCP_SNAME_LEN) - outpacket->file[mainbufix++] = (char)DHO_END; - while (mainbufix < DHCP_SNAME_LEN) - outpacket->file[mainbufix++] = (char)DHO_PAD; - } } return (length); } @@ -342,9 +302,9 @@ cons_options(struct packet *inpacket, struct dhcp_packet *outpacket, int store_options(unsigned char *buffer, int buflen, struct tree_cache **options, unsigned char *priority_list, int priority_len, int first_cutoff, - int second_cutoff, int terminate) + int second_cutoff) { - int bufix = 0, option_stored[256], i, ix, tto; + int bufix = 0, option_stored[256], i, ix; /* Zero out the stored-lengths array. */ memset(option_stored, 0, sizeof(option_stored)); @@ -380,13 +340,6 @@ store_options(unsigned char *buffer, int buflen, struct tree_cache **options, /* We should now have a constant length for the option. */ length = options[code]->len; - /* Do we add a NUL? */ - if (terminate && dhcp_options[code].format[0] == 't') { - length++; - tto = 1; - } else - tto = 0; - /* Try to store the option. */ /* @@ -426,13 +379,8 @@ store_options(unsigned char *buffer, int buflen, struct tree_cache **options, /* Everything looks good - copy it in! */ buffer[bufix] = code; buffer[bufix + 1] = incr; - if (tto && incr == length) { - memcpy(buffer + bufix + 2, - options[code]->value + ix, incr - 1); - buffer[bufix + 2 + incr - 1] = 0; - } else - memcpy(buffer + bufix + 2, - options[code]->value + ix, incr); + memcpy(buffer + bufix + 2, + options[code]->value + ix, incr); length -= incr; ix += incr; bufix += 2 + incr; diff --git a/base/services/dhcpcsvc/include/dhcpd.h b/base/services/dhcpcsvc/include/dhcpd.h index b7b01b4e00..4cf5b6e160 100644 --- a/base/services/dhcpcsvc/include/dhcpd.h +++ b/base/services/dhcpcsvc/include/dhcpd.h @@ -282,7 +282,7 @@ struct hash_table { /* options.c */ int cons_options(struct packet *, struct dhcp_packet *, int, - struct tree_cache **, int, int, int, u_int8_t *, int); + struct tree_cache **); char *pretty_print_option(unsigned int, unsigned char *, int, int, int); void do_packet(struct interface_info *, struct dhcp_packet *,
5 years, 8 months
1
0
0
0
[reactos] 01/06: [SDK] Remove double declaration of _alloca
by Hervé Poussineau
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=a3e870be510b9e650351d…
commit a3e870be510b9e650351daa25524bc64bbbfd926 Author: Hervé Poussineau <hpoussin(a)reactos.org> AuthorDate: Thu Apr 4 14:19:27 2019 +0200 Commit: Hervé Poussineau <hpoussin(a)reactos.org> CommitDate: Sun Apr 7 18:32:28 2019 +0200 [SDK] Remove double declaration of _alloca _alloca() is already defined in sdk/include/crt/malloc.h --- sdk/include/crt/mingw32/intrin_x86.h | 5 ----- 1 file changed, 5 deletions(-) diff --git a/sdk/include/crt/mingw32/intrin_x86.h b/sdk/include/crt/mingw32/intrin_x86.h index 368dab73d6..25f5831670 100644 --- a/sdk/include/crt/mingw32/intrin_x86.h +++ b/sdk/include/crt/mingw32/intrin_x86.h @@ -82,11 +82,6 @@ __INTRIN_INLINE void* __cdecl memcpy(void* dest, const void* source, size_t num) #define _AddressOfReturnAddress() (&(((void **)(__builtin_frame_address(0)))[1])) /* TODO: __getcallerseflags but how??? */ -/* Maybe the same for x86? */ -#ifdef __x86_64__ -#define _alloca(s) __builtin_alloca(s) -#endif - /*** Memory barriers ***/ #if !HAS_BUILTIN(_ReadWriteBarrier)
5 years, 8 months
1
0
0
0
[reactos] 01/01: [NTOSKRNL] Use global power capabilities and report button presence
by Eric Kohl
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=626aaf227c692e91be395…
commit 626aaf227c692e91be395751c7b5e2c108edd270 Author: Eric Kohl <eric.kohl(a)reactos.org> AuthorDate: Sun Apr 7 16:41:56 2019 +0200 Commit: Eric Kohl <eric.kohl(a)reactos.org> CommitDate: Sun Apr 7 16:42:58 2019 +0200 [NTOSKRNL] Use global power capabilities and report button presence - Add and initialize a global power capabilities variable. - Return the global power capabilities via NtPowerInformation.SystemPowerCapabilities. - Report the presence of power button, sleep button and lid. --- ntoskrnl/include/internal/po.h | 1 + ntoskrnl/po/events.c | 22 ++++++++++++++++------ ntoskrnl/po/power.c | 13 ++++++++++--- 3 files changed, 27 insertions(+), 9 deletions(-) diff --git a/ntoskrnl/include/internal/po.h b/ntoskrnl/include/internal/po.h index f9d57e3e59..0d72234738 100644 --- a/ntoskrnl/include/internal/po.h +++ b/ntoskrnl/include/internal/po.h @@ -365,4 +365,5 @@ extern KGUARDED_MUTEX PopVolumeLock; extern LIST_ENTRY PopVolumeDevices; extern KSPIN_LOCK PopDopeGlobalLock; extern POP_POWER_ACTION PopAction; +extern SYSTEM_POWER_CAPABILITIES PopCapabilities; diff --git a/ntoskrnl/po/events.c b/ntoskrnl/po/events.c index e79f6df12e..b6392bd931 100644 --- a/ntoskrnl/po/events.c +++ b/ntoskrnl/po/events.c @@ -242,13 +242,23 @@ PopAddRemoveSysCapsCallback(IN PVOID NotificationStructure, return STATUS_INSUFFICIENT_RESOURCES; } - /* FIXME: What do do with the capabilities? */ + DPRINT("Device capabilities: 0x%x\n", Caps); + if (Caps & SYS_BUTTON_POWER) { - DPRINT("Device capabilities: 0x%x (", Caps); - if (Caps & SYS_BUTTON_POWER) DPRINT(" POWER"); - if (Caps & SYS_BUTTON_SLEEP) DPRINT(" SLEEP"); - if (Caps & SYS_BUTTON_LID) DPRINT(" LID"); - DPRINT(" )\n"); + DPRINT("POWER button present\n"); + PopCapabilities.PowerButtonPresent = TRUE; + } + + if (Caps & SYS_BUTTON_SLEEP) + { + DPRINT("SLEEP button present\n"); + PopCapabilities.SleepButtonPresent = TRUE; + } + + if (Caps & SYS_BUTTON_LID) + { + DPRINT("LID present\n"); + PopCapabilities.LidPresent = TRUE; } SysButtonContext = ExAllocatePoolWithTag(NonPagedPool, diff --git a/ntoskrnl/po/power.c b/ntoskrnl/po/power.c index a0dd4fb3af..f249d0eb1a 100644 --- a/ntoskrnl/po/power.c +++ b/ntoskrnl/po/power.c @@ -26,6 +26,7 @@ PDEVICE_NODE PopSystemPowerDeviceNode = NULL; BOOLEAN PopAcpiPresent = FALSE; POP_POWER_ACTION PopAction; WORK_QUEUE_ITEM PopShutdownWorkItem; +SYSTEM_POWER_CAPABILITIES PopCapabilities; /* PRIVATE FUNCTIONS *********************************************************/ @@ -323,6 +324,9 @@ PoInitSystem(IN ULONG BootPhase) return TRUE; } + /* Initialize the power capabilities */ + RtlZeroMemory(&PopCapabilities, sizeof(SYSTEM_POWER_CAPABILITIES)); + /* Get the Command Line */ CommandLine = KeLoaderBlock->LoadOptions; @@ -343,6 +347,9 @@ PoInitSystem(IN ULONG BootPhase) PopAcpiPresent = KeLoaderBlock->Extension->AcpiTable != NULL ? TRUE : FALSE; } + /* Enable shutdown by power button */ + if (PopAcpiPresent) + PopCapabilities.SystemS5 = TRUE; /* Initialize volume support */ InitializeListHead(&PopVolumeDevices); @@ -720,9 +727,9 @@ NtPowerInformation(IN POWER_INFORMATION_LEVEL PowerInformationLevel, _SEH2_TRY { - /* Just zero the struct (and thus set PowerCapabilities->SystemBatteriesPresent = FALSE) */ - RtlZeroMemory(PowerCapabilities, sizeof(SYSTEM_POWER_CAPABILITIES)); - //PowerCapabilities->SystemBatteriesPresent = 0; + RtlCopyMemory(PowerCapabilities, + &PopCapabilities, + sizeof(SYSTEM_POWER_CAPABILITIES)); Status = STATUS_SUCCESS; }
5 years, 8 months
1
0
0
0
[reactos] 01/01: [COMCTL32] Improve status bar margin for unthemed and themed CORE-15834
by Joachim Henze
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=b71429059a79942f655c1…
commit b71429059a79942f655c134b343be06b5632d8c7 Author: Joachim Henze <Joachim.Henze(a)reactos.org> AuthorDate: Sun Apr 7 15:15:25 2019 +0200 Commit: Joachim Henze <Joachim.Henze(a)reactos.org> CommitDate: Sun Apr 7 15:15:25 2019 +0200 [COMCTL32] Improve status bar margin for unthemed and themed CORE-15834 Improve further what was recently committed in 0.4.12-dev-361-g da9accfba6e8eb769dcd317185a9b57d161275b7 --- dll/win32/comctl32/status.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/dll/win32/comctl32/status.c b/dll/win32/comctl32/status.c index cfee259cd8..26e9d3a1c6 100644 --- a/dll/win32/comctl32/status.c +++ b/dll/win32/comctl32/status.c @@ -201,12 +201,17 @@ STATUSBAR_DrawPart (const STATUS_INFO *infoPtr, HDC hdc, const STATUSWINDOWPART } else { r.left += x; #ifdef __REACTOS__ - r.left += 3; - r.right -= 3; if (!theme) + { + r.left -= 2; DrawStatusTextW (hdc, &r, part->text, SBT_NOBORDERS); + } else + { + r.left += 2; + r.right -= 2; DrawThemeText(theme, hdc, SP_PANE, 0, part->text, -1, DT_VCENTER|DT_SINGLELINE|DT_NOPREFIX, 0, &r); + } #else DrawStatusTextW (hdc, &r, part->text, SBT_NOBORDERS); #endif
5 years, 8 months
1
0
0
0
[reactos] 01/01: [SHELL32] Fix explorer file item label background CORE-15937
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=f762aa3dd22ea271f004d…
commit f762aa3dd22ea271f004ddb94339522e2344719b Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Sun Apr 7 21:38:00 2019 +0900 Commit: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> CommitDate: Sun Apr 7 21:38:00 2019 +0900 [SHELL32] Fix explorer file item label background CORE-15937 --- dll/win32/shell32/CDefView.cpp | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/dll/win32/shell32/CDefView.cpp b/dll/win32/shell32/CDefView.cpp index 1485e1677a..334e0b3613 100644 --- a/dll/win32/shell32/CDefView.cpp +++ b/dll/win32/shell32/CDefView.cpp @@ -633,19 +633,16 @@ void CDefView::UpdateListColors() else { // text background color - COLORREF clrTextBack = GetSysColor(COLOR_WINDOW); - if (m_viewinfo_data.clrTextBack != CLR_INVALID) - { - clrTextBack = m_viewinfo_data.clrTextBack; - } + COLORREF clrTextBack = m_viewinfo_data.clrTextBack; m_ListView.SetTextBkColor(clrTextBack); // text color - COLORREF clrText = GetSysColor(COLOR_WINDOWTEXT); + COLORREF clrText; if (m_viewinfo_data.clrText != CLR_INVALID) - { clrText = m_viewinfo_data.clrText; - } + else + clrText = GetSysColor(COLOR_WINDOWTEXT); + m_ListView.SetTextColor(clrText); // Background is painted by the parent via WM_PRINTCLIENT.
5 years, 8 months
1
0
0
0
[reactos] 01/01: [KERNEL32] Support Japanese calendar (#1482)
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=15537c3bbe30a80641bc5…
commit 15537c3bbe30a80641bc5f42c7375dafe6643572 Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Sun Apr 7 20:20:23 2019 +0900 Commit: GitHub <noreply(a)github.com> CommitDate: Sun Apr 7 20:20:23 2019 +0900 [KERNEL32] Support Japanese calendar (#1482) Implement the Japanese calendar in kernel32. Locale info and date formatting. CORE-15920 --- dll/win32/kernel32/CMakeLists.txt | 1 + dll/win32/kernel32/winnls/string/japanese.c | 229 ++++++++++++++++++++++++++++ dll/win32/kernel32/winnls/string/japanese.h | 21 +++ dll/win32/kernel32/winnls/string/lang.c | 14 ++ dll/win32/kernel32/winnls/string/lcformat.c | 200 ++++++++++++++++++++++++ 5 files changed, 465 insertions(+) diff --git a/dll/win32/kernel32/CMakeLists.txt b/dll/win32/kernel32/CMakeLists.txt index 22409a7605..f2a4e0f029 100644 --- a/dll/win32/kernel32/CMakeLists.txt +++ b/dll/win32/kernel32/CMakeLists.txt @@ -76,6 +76,7 @@ list(APPEND SOURCE winnls/string/digitmap.c winnls/string/fold.c winnls/string/format_msg.c + winnls/string/japanese.c winnls/string/lang.c winnls/string/lcformat.c winnls/string/lstring.c diff --git a/dll/win32/kernel32/winnls/string/japanese.c b/dll/win32/kernel32/winnls/string/japanese.c new file mode 100644 index 0000000000..c3719f51f2 --- /dev/null +++ b/dll/win32/kernel32/winnls/string/japanese.c @@ -0,0 +1,229 @@ +/* + * PROJECT: ReactOS system libraries + * LICENSE: GPL-2.0-or-later (
https://spdx.org/licenses/GPL-2.0-or-later
) + * PURPOSE: Japanese era support + * COPYRIGHT: Copyright 2019 Katayama Hirofumi MZ (katayama.hirofumi.mz(a)gmail.com) + */ +#include <k32.h> + +#define NDEBUG +#include <debug.h> +#include "japanese.h" + +#define JAPANESE_ERA_MAX 16 + +/* #define DONT_USE_REGISTRY */ + +static DWORD s_JapaneseEraCount = 0; +static JAPANESE_ERA s_JapaneseEraTable[JAPANESE_ERA_MAX] +#ifdef DONT_USE_REGISTRY += +{ + {1868, 1, 1, {0x660E, 0x6CBB}, {0x660E, 0}, L"Meiji", L"M"}, + {1912, 7, 30, {0x5927, 0x6B63}, {0x5927, 0}, L"Taisho", L"T"}, + {1926, 12, 25, {0x662D, 0x548C}, {0x662D, 0}, L"Showa", L"S"}, + {1989, 1, 8, {0x5E73, 0x6210}, {0x5E73, 0}, L"Heisei", L"H"}, + {2019, 5, 1, {0x4EE4, 0x548C}, {0x4EE4, 0}, L"Reiwa", L"R"}, +} +#endif +; + +HANDLE NLS_RegOpenKey(HANDLE hRootKey, LPCWSTR szKeyName); + +BOOL NLS_RegEnumValue(HANDLE hKey, UINT ulIndex, + LPWSTR szValueName, ULONG valueNameSize, + LPWSTR szValueData, ULONG valueDataSize); + +static INT JapaneseEra_Compare(const void *e1, const void *e2) +{ + PCJAPANESE_ERA pEra1 = (PCJAPANESE_ERA)e1; + PCJAPANESE_ERA pEra2 = (PCJAPANESE_ERA)e2; + if (pEra1->wYear < pEra2->wYear) + return -1; + if (pEra1->wYear > pEra2->wYear) + return 1; + if (pEra1->wMonth < pEra2->wMonth) + return -1; + if (pEra1->wMonth > pEra2->wMonth) + return 1; + if (pEra1->wDay < pEra2->wDay) + return -1; + if (pEra1->wDay > pEra2->wDay) + return 1; + return 0; +} + +/* + * SEE ALSO: + *
https://en.wikipedia.org/wiki/Japanese_era_name
+ *
https://docs.microsoft.com/en-us/windows/desktop/Intl/era-handling-for-the-…
+ */ +static PCJAPANESE_ERA JapaneseEra_Load(DWORD *pdwCount) +{ +#ifndef DONT_USE_REGISTRY + HANDLE KeyHandle = NULL; + DWORD dwIndex; + WCHAR szName[128], szValue[128]; + JAPANESE_ERA *pEntry; + LPWSTR pch1, pch2, pch3, pch4; +#endif + + ASSERT(pdwCount != NULL); + + /* return cache if any */ + if (s_JapaneseEraCount != 0) + { + *pdwCount = s_JapaneseEraCount; + return s_JapaneseEraTable; + } + +#ifdef DONT_USE_REGISTRY + s_JapaneseEraCount = ARRAYSIZE(s_JapaneseEraTable); +#else + /* init */ + *pdwCount = 0; + RtlZeroMemory(&s_JapaneseEraTable, sizeof(s_JapaneseEraTable)); + + /* open registry key */ + KeyHandle = NLS_RegOpenKey(NULL, L"\\Registry\\Machine\\System\\" + L"CurrentControlSet\\Control\\Nls\\Calendars\\Japanese\\Eras"); + if (!KeyHandle) + return NULL; + + /* for all values */ + for (dwIndex = 0; dwIndex < JAPANESE_ERA_MAX; ++dwIndex) + { + pEntry = &s_JapaneseEraTable[dwIndex]; + + /* get name and data */ + if (!NLS_RegEnumValue(KeyHandle, dwIndex, szName, sizeof(szName), + szValue, sizeof(szValue))) + { + break; + } + + /* split fields */ + pch1 = szName; + pch2 = wcschr(pch1, L' '); + if (pch2 == NULL) + { + break; + } + *pch2++ = UNICODE_NULL; + + pch3 = wcschr(pch2, L' '); + if (pch3 == NULL) + { + break; + } + *pch3++ = UNICODE_NULL; + + pEntry->wYear = _wtoi(pch1); + pEntry->wMonth = _wtoi(pch2); + pEntry->wDay = _wtoi(pch3); + if (pEntry->wYear == 0 || pEntry->wMonth == 0 || pEntry->wDay == 0) + { + break; + } + + /* split fields */ + pch1 = szValue; + pch2 = wcschr(pch1, L'_'); + if (pch2 == NULL) + { + break; + } + *pch2++ = UNICODE_NULL; + + pch3 = wcschr(pch2, L'_'); + if (pch3 == NULL) + { + break; + } + *pch3++ = UNICODE_NULL; + + pch4 = wcschr(pch3, L'_'); + if (pch4 == NULL) + { + break; + } + *pch4++ = UNICODE_NULL; + + /* store */ + RtlStringCbCopyW(pEntry->szEraName, sizeof(pEntry->szEraName), pch1); + RtlStringCbCopyW(pEntry->szEraAbbrev, sizeof(pEntry->szEraAbbrev), pch2); + RtlStringCbCopyW(pEntry->szEnglishEraName, sizeof(pEntry->szEnglishEraName), pch3); + RtlStringCbCopyW(pEntry->szEnglishEraAbbrev, sizeof(pEntry->szEnglishEraAbbrev), pch4); + } + + /* close key */ + NtClose(KeyHandle); + + /* sort */ + qsort(s_JapaneseEraTable, s_JapaneseEraCount, sizeof(JAPANESE_ERA), + JapaneseEra_Compare); + + /* make cache */ + s_JapaneseEraCount = dwIndex; +#endif + + *pdwCount = s_JapaneseEraCount; + + return s_JapaneseEraTable; +} + +static BOOL JapaneseEra_ToSystemTime(PCJAPANESE_ERA pEra, LPSYSTEMTIME pst) +{ + ASSERT(pEra != NULL); + ASSERT(pst != NULL); + + ZeroMemory(pst, sizeof(*pst)); + pst->wYear = pEra->wYear; + pst->wMonth = pEra->wMonth; + pst->wDay = pEra->wDay; + return TRUE; +} + +PCJAPANESE_ERA JapaneseEra_Find(const SYSTEMTIME *pst OPTIONAL) +{ + DWORD dwIndex, dwCount = 0; + PCJAPANESE_ERA pTable, pEntry, pPrevEntry = NULL; + SYSTEMTIME st1, st2; + FILETIME ft1, ft2; + LONG nCompare; + + /* pst --> ft1 */ + if (pst == NULL) + { + GetLocalTime(&st1); + pst = &st1; + } + SystemTimeToFileTime(pst, &ft1); + + /* load era table */ + pTable = JapaneseEra_Load(&dwCount); + if (pTable == NULL || dwCount == 0 || dwCount > JAPANESE_ERA_MAX) + { + return NULL; + } + + /* for all eras */ + for (dwIndex = 0; dwIndex < dwCount; dwIndex++) + { + pEntry = &pTable[dwIndex]; + + /* pEntry --> st2 --> ft2 */ + JapaneseEra_ToSystemTime(pEntry, &st2); + SystemTimeToFileTime(&st2, &ft2); + + /* ft1 <=> ft2 */ + nCompare = CompareFileTime(&ft1, &ft2); + if (nCompare == 0) + return pEntry; + if (nCompare < 0) + return pPrevEntry; + pPrevEntry = pEntry; + } + + return pPrevEntry; +} diff --git a/dll/win32/kernel32/winnls/string/japanese.h b/dll/win32/kernel32/winnls/string/japanese.h new file mode 100644 index 0000000000..747ee136ed --- /dev/null +++ b/dll/win32/kernel32/winnls/string/japanese.h @@ -0,0 +1,21 @@ +/* + * PROJECT: ReactOS system libraries + * LICENSE: GPL-2.0-or-later (
https://spdx.org/licenses/GPL-2.0-or-later
) + * PURPOSE: Japanese era support + * COPYRIGHT: Copyright 2019 Katayama Hirofumi MZ (katayama.hirofumi.mz(a)gmail.com) + */ +#define JAPANESE_MAX_TWODIGITYEAR 99 + +typedef struct JAPANESE_ERA +{ + WORD wYear; + WORD wMonth; + WORD wDay; + WCHAR szEraName[16]; + WCHAR szEraAbbrev[5]; + WCHAR szEnglishEraName[24]; + WCHAR szEnglishEraAbbrev[5]; +} JAPANESE_ERA, *PJAPANESE_ERA; +typedef const JAPANESE_ERA *PCJAPANESE_ERA; + +PCJAPANESE_ERA JapaneseEra_Find(const SYSTEMTIME *pst OPTIONAL); diff --git a/dll/win32/kernel32/winnls/string/lang.c b/dll/win32/kernel32/winnls/string/lang.c index 42c57d1aef..7d13980511 100644 --- a/dll/win32/kernel32/winnls/string/lang.c +++ b/dll/win32/kernel32/winnls/string/lang.c @@ -2366,14 +2366,22 @@ INT WINAPI CompareStringA(LCID lcid, DWORD flags, return ret; } +#ifdef __REACTOS__ +HANDLE NLS_RegOpenKey(HANDLE hRootKey, LPCWSTR szKeyName) +#else static HANDLE NLS_RegOpenKey(HANDLE hRootKey, LPCWSTR szKeyName) +#endif { UNICODE_STRING keyName; OBJECT_ATTRIBUTES attr; HANDLE hkey; RtlInitUnicodeString( &keyName, szKeyName ); +#ifdef __REACTOS__ + InitializeObjectAttributes(&attr, &keyName, OBJ_CASE_INSENSITIVE, hRootKey, NULL); +#else InitializeObjectAttributes(&attr, &keyName, 0, hRootKey, NULL); +#endif if (NtOpenKey( &hkey, KEY_READ, &attr ) != STATUS_SUCCESS) hkey = 0; @@ -2381,9 +2389,15 @@ static HANDLE NLS_RegOpenKey(HANDLE hRootKey, LPCWSTR szKeyName) return hkey; } +#ifdef __REACTOS__ +BOOL NLS_RegEnumValue(HANDLE hKey, UINT ulIndex, + LPWSTR szValueName, ULONG valueNameSize, + LPWSTR szValueData, ULONG valueDataSize) +#else static BOOL NLS_RegEnumValue(HANDLE hKey, UINT ulIndex, LPWSTR szValueName, ULONG valueNameSize, LPWSTR szValueData, ULONG valueDataSize) +#endif { BYTE buffer[80]; KEY_VALUE_FULL_INFORMATION *info = (KEY_VALUE_FULL_INFORMATION *)buffer; diff --git a/dll/win32/kernel32/winnls/string/lcformat.c b/dll/win32/kernel32/winnls/string/lcformat.c index a4088cb9b2..8d85351190 100644 --- a/dll/win32/kernel32/winnls/string/lcformat.c +++ b/dll/win32/kernel32/winnls/string/lcformat.c @@ -25,6 +25,7 @@ #ifdef __REACTOS__ #include <k32.h> +#include "japanese.h" /* Japanese eras */ #define NDEBUG #include <debug.h> @@ -34,6 +35,12 @@ DEBUG_CHANNEL(nls); #define CRITICAL_SECTION_DEBUG RTL_CRITICAL_SECTION_DEBUG #define CALINFO_MAX_YEAR 2029 +#define IS_LCID_JAPANESE(lcid) PRIMARYLANGID(LANGIDFROMLCID(lcid)) == LANG_JAPANESE + +#ifndef CAL_SABBREVERASTRING + #define CAL_SABBREVERASTRING 0x00000039 +#endif + #else /* __REACTOS__ */ #include "config.h" @@ -372,7 +379,11 @@ BOOL NLS_IsUnicodeOnlyLcid(LCID lcid) #define IsTimeFmtChar(p) (p == 'H'||p == 'h'||p == 'm'||p == 's'||p == 't') /* Only the following flags can be given if a date/time format is specified */ +#ifdef __REACTOS__ +#define DATE_FORMAT_FLAGS (DATE_DATEVARSONLY | DATE_USE_ALT_CALENDAR) +#else #define DATE_FORMAT_FLAGS (DATE_DATEVARSONLY) +#endif #define TIME_FORMAT_FLAGS (TIME_TIMEVARSONLY|TIME_FORCE24HOURFORMAT| \ TIME_NOMINUTESORSECONDS|TIME_NOSECONDS| \ TIME_NOTIMEMARKER) @@ -604,6 +615,24 @@ static INT NLS_GetDateTimeFormatW(LCID lcid, DWORD dwFlags, break; case 'y': +#ifdef __REACTOS__ + if (IS_LCID_JAPANESE(lcid) && (dwFlags & DATE_USE_ALT_CALENDAR)) + { + PCJAPANESE_ERA pEra = JapaneseEra_Find(lpTime); + if (pEra) + { + if (count >= 2) + { + count = 2; + } + dwVal = lpTime->wYear - pEra->wYear + 1; + szAdd = buff; + break; + } + SetLastError(ERROR_INVALID_PARAMETER); + return 0; + } +#endif if (count >= 4) { count = 4; @@ -618,6 +647,32 @@ static INT NLS_GetDateTimeFormatW(LCID lcid, DWORD dwFlags, break; case 'g': +#ifdef __REACTOS__ + if (IS_LCID_JAPANESE(lcid)) + { + if (dwFlags & DATE_USE_ALT_CALENDAR) + { + PCJAPANESE_ERA pEra = JapaneseEra_Find(lpTime); + if (pEra) + { + RtlStringCbCopyW(buff, sizeof(buff), pEra->szEraName); + szAdd = buff; + break; + } + SetLastError(ERROR_INVALID_PARAMETER); + return 0; + } + else + { + /* Seireki */ + buff[0] = 0x897F; + buff[1] = 0x66A6; + buff[2] = 0; + szAdd = buff; + break; + } + } +#endif if (count == 2) { /* FIXME: Our GetCalendarInfo() does not yet support CAL_SERASTRING. @@ -2367,6 +2422,26 @@ int WINAPI GetCalendarInfoA(LCID lcid, CALID Calendar, CALTYPE CalType, { int ret, cchDataW = cchData; LPWSTR lpCalDataW = NULL; +#ifdef __REACTOS__ + DWORD cp = CP_ACP; + if (!(CalType & CAL_USE_CP_ACP)) + { + DWORD dwFlags = ((CalType & CAL_NOUSEROVERRIDE) ? LOCALE_NOUSEROVERRIDE : 0); + const NLS_FORMAT_NODE *node = NLS_GetFormats(lcid, dwFlags); + if (!node) + { + SetLastError(ERROR_INVALID_PARAMETER); + return 0; + } + cp = node->dwCodePage; + } + if ((CalType & 0xFFFF) == CAL_SABBREVERASTRING) + { + /* NOTE: CAL_SABBREVERASTRING is not supported in GetCalendarInfoA */ + SetLastError(ERROR_INVALID_PARAMETER); + return 0; + } +#endif if (NLS_IsUnicodeOnlyLcid(lcid)) { @@ -2381,7 +2456,11 @@ int WINAPI GetCalendarInfoA(LCID lcid, CALID Calendar, CALTYPE CalType, ret = GetCalendarInfoW(lcid, Calendar, CalType, lpCalDataW, cchDataW, lpValue); if(ret && lpCalDataW && lpCalData) +#ifdef __REACTOS__ + ret = WideCharToMultiByte(cp, 0, lpCalDataW, -1, lpCalData, cchData, NULL, NULL); +#else ret = WideCharToMultiByte(CP_ACP, 0, lpCalDataW, -1, lpCalData, cchData, NULL, NULL); +#endif else if (CalType & CAL_RETURN_NUMBER) ret *= sizeof(WCHAR); HeapFree(GetProcessHeap(), 0, lpCalDataW); @@ -2495,18 +2574,101 @@ int WINAPI GetCalendarInfoW(LCID Locale, CALID Calendar, CALTYPE CalType, switch (calinfo) { case CAL_ICALINTVALUE: +#ifdef __REACTOS__ + if (IS_LCID_JAPANESE(Locale)) + { + if (CalType & CAL_RETURN_NUMBER) + { + *lpValue = CAL_JAPAN; + return sizeof(DWORD) / sizeof(WCHAR); + } + else + { + static const WCHAR fmtW[] = {'%','u',0}; + WCHAR buffer[10]; + int ret = snprintfW( buffer, 10, fmtW, CAL_JAPAN ) + 1; + if (!lpCalData) return ret; + if (ret <= cchData) + { + strcpyW( lpCalData, buffer ); + return ret; + } + SetLastError( ERROR_INSUFFICIENT_BUFFER ); + return 0; + } + } +#endif if (CalType & CAL_RETURN_NUMBER) return GetLocaleInfoW(Locale, LOCALE_RETURN_NUMBER | LOCALE_ICALENDARTYPE, (LPWSTR)lpValue, 2); return GetLocaleInfoW(Locale, LOCALE_ICALENDARTYPE, lpCalData, cchData); case CAL_SCALNAME: +#ifdef __REACTOS__ + if (IS_LCID_JAPANESE(Locale) && Calendar == CAL_JAPAN) + { + // Wareki + lpCalData[0] = 0x548C; + lpCalData[1] = 0x66A6; + lpCalData[2] = 0; + return 3; + } +#endif FIXME("Unimplemented caltype %d\n", calinfo); if (lpCalData) *lpCalData = 0; return 1; case CAL_IYEAROFFSETRANGE: +#ifdef __REACTOS__ + if (IS_LCID_JAPANESE(Locale) && Calendar == CAL_JAPAN) + { + PCJAPANESE_ERA pEra = JapaneseEra_Find(NULL); + if (pEra) + { + if (CalType & CAL_RETURN_NUMBER) + { + *lpValue = pEra->wYear; + return sizeof(DWORD) / sizeof(WCHAR); + } + else + { + static const WCHAR fmtW[] = {'%','u',0}; + WCHAR buffer[10]; + int ret = snprintfW( buffer, 10, fmtW, pEra->wYear ) + 1; + if (!lpCalData) return ret; + if (ret <= cchData) + { + strcpyW( lpCalData, buffer ); + return ret; + } + SetLastError( ERROR_INSUFFICIENT_BUFFER ); + return 0; + } + } + else + { + SetLastError(ERROR_INVALID_PARAMETER); + return 0; + } + } +#endif FIXME("Unimplemented caltype %d\n", calinfo); return 0; case CAL_SERASTRING: +#ifdef __REACTOS__ + if (IS_LCID_JAPANESE(Locale) && Calendar == CAL_JAPAN) + { + PCJAPANESE_ERA pEra = JapaneseEra_Find(NULL); + if (pEra) + { + RtlStringCchCopyW(lpCalData, cchData, pEra->szEraName); + return strlenW(lpCalData) + 1; + } + else + { + SetLastError(ERROR_INVALID_PARAMETER); + return 0; + } + } +#endif FIXME("Unimplemented caltype %d\n", calinfo); return 0; case CAL_SSHORTDATE: @@ -2554,6 +2716,30 @@ int WINAPI GetCalendarInfoW(LCID Locale, CALID Calendar, CALTYPE CalType, case CAL_SYEARMONTH: return GetLocaleInfoW(Locale, caltype_lctype_map[calinfo] | localeflags, lpCalData, cchData); case CAL_ITWODIGITYEARMAX: +#ifdef __REACTOS__ + if (IS_LCID_JAPANESE(Locale) && Calendar == CAL_JAPAN) + { + if (CalType & CAL_RETURN_NUMBER) + { + *lpValue = JAPANESE_MAX_TWODIGITYEAR; + return sizeof(DWORD) / sizeof(WCHAR); + } + else + { + static const WCHAR fmtW[] = {'%','u',0}; + WCHAR buffer[10]; + int ret = snprintfW( buffer, 10, fmtW, JAPANESE_MAX_TWODIGITYEAR ) + 1; + if (!lpCalData) return ret; + if (ret <= cchData) + { + strcpyW( lpCalData, buffer ); + return ret; + } + SetLastError( ERROR_INSUFFICIENT_BUFFER ); + return 0; + } + } +#endif if (CalType & CAL_RETURN_NUMBER) { *lpValue = CALINFO_MAX_YEAR; @@ -2574,6 +2760,20 @@ int WINAPI GetCalendarInfoW(LCID Locale, CALID Calendar, CALTYPE CalType, return 0; } break; +#ifdef __REACTOS__ + case CAL_SABBREVERASTRING: + if (IS_LCID_JAPANESE(Locale) && Calendar == CAL_JAPAN) + { + PCJAPANESE_ERA pEra = JapaneseEra_Find(NULL); + if (pEra) + { + RtlStringCchCopyW(lpCalData, cchData, pEra->szEraAbbrev); + return strlenW(lpCalData) + 1; + } + } + SetLastError(ERROR_INVALID_PARAMETER); + return 0; +#endif default: FIXME("Unknown caltype %d\n", calinfo); SetLastError(ERROR_INVALID_FLAGS);
5 years, 8 months
1
0
0
0
[reactos] 01/01: [KERNEL32_APITEST] Improve one-character Heisei tests (#1483)
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=a008bf8ef26b1afb29307…
commit a008bf8ef26b1afb29307f5fe11062bdc1864c0a Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Sun Apr 7 18:35:52 2019 +0900 Commit: GitHub <noreply(a)github.com> CommitDate: Sun Apr 7 18:35:52 2019 +0900 [KERNEL32_APITEST] Improve one-character Heisei tests (#1483) One-character Heisei for CAL_SABBREVERASTRING locale info can be U+337B or U+5E73. And one-character Reiwa U+32FF, U+4EE4, and U+F9A8 are also added. Improve kernel32_apitest testcase. Thanks @ThFabba CORE-15920 --- modules/rostests/apitests/kernel32/JapaneseCalendar.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/modules/rostests/apitests/kernel32/JapaneseCalendar.c b/modules/rostests/apitests/kernel32/JapaneseCalendar.c index b3f551659c..b4fbe1180b 100644 --- a/modules/rostests/apitests/kernel32/JapaneseCalendar.c +++ b/modules/rostests/apitests/kernel32/JapaneseCalendar.c @@ -37,7 +37,11 @@ START_TEST(JapaneseCalendar) static const WCHAR s_szSeireki19[] = {0x897F, 0x66A6, '1', '9', 0}; // L"\u897F\u66A6" L"19" static const WCHAR s_szHeisei[] = {0x5E73, 0x6210, 0}; // L"\u5E73\u6210" static const WCHAR s_szHeisei31[] = {0x5E73, 0x6210, '3', '1', 0}; // L"\u5E73\u6210" L"31" - static const WCHAR s_szOneCharHeisei[] = {0x5E73, 0}; // L"\u5E73" + static const WCHAR s_szOneCharHeisei1[] = {0x337B, 0}; // L"\u337B" + static const WCHAR s_szOneCharHeisei2[] = {0x5E73, 0}; // L"\u5E73" + static const WCHAR s_szOneCharReiwa1[] = {0x32FF, 0}; // L"\u32FF" + static const WCHAR s_szOneCharReiwa2[] = {0x4EE4, 0}; // L"\u4EE4" + static const WCHAR s_szOneCharReiwa3[] = {0xF9A8, 0}; // L"\uF9A8" static const WCHAR s_szWareki[] = {0x548C, 0x66A6, 0}; // L"\u548C\u66A6" static const WCHAR s_szNen[] = {0x5E74, 0}; // L"\u5E74" @@ -192,7 +196,11 @@ START_TEST(JapaneseCalendar) ret = GetCalendarInfoW(lcid, CAL_JAPAN, type, szTextW, ARRAYSIZE(szTextW), NULL); ok(/* WinXP */ ret == 0 || /* Win10 */ ret != 0, "ret: %d\n", ret); ok(/* WinXP */ (szTextW[0] == 0x7F && szTextW[1] == 0) || - /* Win10 */ lstrcmpiW(szTextW, s_szOneCharHeisei) == 0, + /* Win10? */ lstrcmpiW(szTextW, s_szOneCharHeisei1) == 0 || + /* Win10? */ lstrcmpiW(szTextW, s_szOneCharHeisei2) == 0 || + /* Win10? */ lstrcmpiW(szTextW, s_szOneCharReiwa1) == 0 || + /* Win10? */ lstrcmpiW(szTextW, s_szOneCharReiwa2) == 0 || + /* Win10? */ lstrcmpiW(szTextW, s_szOneCharReiwa3) == 0, "szTextW: %04X %04X %04X\n", szTextW[0], szTextW[1], szTextW[2]); szTextW[0] = 0x7F;
5 years, 8 months
1
0
0
0
[reactos] 01/01: [ACPICA] Update to version 20190405. CORE-15926
by Thomas Faber
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=89a587169b65773f18c5c…
commit 89a587169b65773f18c5c0d5cd2ec27b7f8b1ffe Author: Thomas Faber <thomas.faber(a)reactos.org> AuthorDate: Sat Apr 6 15:21:35 2019 +0200 Commit: Thomas Faber <thomas.faber(a)reactos.org> CommitDate: Sun Apr 7 10:59:52 2019 +0200 [ACPICA] Update to version 20190405. CORE-15926 --- drivers/bus/acpi/acpica/events/evgpe.c | 8 ++++++++ drivers/bus/acpi/acpica/include/acpixf.h | 2 +- drivers/bus/acpi/acpica/namespace/nsalloc.c | 5 +++++ 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/drivers/bus/acpi/acpica/events/evgpe.c b/drivers/bus/acpi/acpica/events/evgpe.c index 7527a0031b..b293aee346 100644 --- a/drivers/bus/acpi/acpica/events/evgpe.c +++ b/drivers/bus/acpi/acpica/events/evgpe.c @@ -132,6 +132,14 @@ AcpiEvEnableGpe ( ACPI_FUNCTION_TRACE (EvEnableGpe); + /* Clear the GPE (of stale events) */ + + Status = AcpiHwClearGpe(GpeEventInfo); + if (ACPI_FAILURE(Status)) + { + return_ACPI_STATUS(Status); + } + /* Enable the requested GPE */ Status = AcpiHwLowSetGpe (GpeEventInfo, ACPI_GPE_ENABLE); diff --git a/drivers/bus/acpi/acpica/include/acpixf.h b/drivers/bus/acpi/acpica/include/acpixf.h index d700786dc3..75533de5e9 100644 --- a/drivers/bus/acpi/acpica/include/acpixf.h +++ b/drivers/bus/acpi/acpica/include/acpixf.h @@ -46,7 +46,7 @@ /* Current ACPICA subsystem version in YYYYMMDD format */ -#define ACPI_CA_VERSION 0x20190329 +#define ACPI_CA_VERSION 0x20190405 #include "acconfig.h" #include "actypes.h" diff --git a/drivers/bus/acpi/acpica/namespace/nsalloc.c b/drivers/bus/acpi/acpica/namespace/nsalloc.c index 8f079c3e9f..fb5cc71d00 100644 --- a/drivers/bus/acpi/acpica/namespace/nsalloc.c +++ b/drivers/bus/acpi/acpica/namespace/nsalloc.c @@ -124,6 +124,11 @@ AcpiNsDeleteNode ( ACPI_FUNCTION_NAME (NsDeleteNode); + if (!Node) + { + return_VOID; + } + /* Detach an object if there is one */ AcpiNsDetachObject (Node);
5 years, 8 months
1
0
0
0
← Newer
1
...
14
15
16
17
18
19
20
...
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