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
May 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
17 participants
165 discussions
Start a n
N
ew thread
[reactos] 07/13: [LIBXSLT] Disable misleading-indentation warnings
by Timo Kreuzer
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=51fbf9e8c0087ddcdc23b…
commit 51fbf9e8c0087ddcdc23bdd347ecad88ee5fc771 Author: Timo Kreuzer <timo.kreuzer(a)reactos.org> AuthorDate: Sun Apr 28 21:35:13 2019 +0200 Commit: Hervé Poussineau <hpoussin(a)reactos.org> CommitDate: Mon May 27 13:22:40 2019 +0200 [LIBXSLT] Disable misleading-indentation warnings Fixes GCC 8 warning: dll/3rdparty/libxslt/security.c:358:5: error: this 'else' clause does not guard... [-Werror=misleading-indentation] else ^~~~ dll/3rdparty/libxslt/security.c:365:2: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'else' if (ret <= 0) { ^~ --- dll/3rdparty/libxslt/CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dll/3rdparty/libxslt/CMakeLists.txt b/dll/3rdparty/libxslt/CMakeLists.txt index 336b1df899..1ff2571361 100644 --- a/dll/3rdparty/libxslt/CMakeLists.txt +++ b/dll/3rdparty/libxslt/CMakeLists.txt @@ -1,4 +1,8 @@ +if(NOT MSVC AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 7.0) + add_compile_flags("-Wno-misleading-indentation") +endif() + include_directories(${REACTOS_SOURCE_DIR}/sdk/include/reactos/libs/libxslt ${REACTOS_SOURCE_DIR}/sdk/lib/3rdparty/libwin-iconv)
5 years, 7 months
1
0
0
0
[reactos] 06/13: [RSAENH] Use StringCbPrintfA instead of sprintf
by Timo Kreuzer
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=089d59bc6c40813430a64…
commit 089d59bc6c40813430a641f850f97c6b215858ec Author: Timo Kreuzer <timo.kreuzer(a)reactos.org> AuthorDate: Sun Apr 28 18:01:11 2019 +0200 Commit: Hervé Poussineau <hpoussin(a)reactos.org> CommitDate: Mon May 27 13:22:40 2019 +0200 [RSAENH] Use StringCbPrintfA instead of sprintf Fixes GCC 8 warning: dll/win32/rsaenh/rsaenh.c:161:23: error: '%s' directive writing up to 259 bytes into a region of size 235 [-Werror=format-overflow=] #define RSAENH_REGKEY "Software\\Wine\\Crypto\\RSA\\%s" ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ dll/win32/rsaenh/rsaenh.c:161:23: note: in definition of macro 'RSAENH_REGKEY' #define RSAENH_REGKEY "Software\\Wine\\Crypto\\RSA\\%s" ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ dll/win32/rsaenh/rsaenh.c:1107:5: note: 'sprintf' output between 26 and 285 bytes into a destination of size 260 sprintf(szRSABase, RSAENH_REGKEY, pKeyContainer->szName); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --- dll/win32/rsaenh/rsaenh.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dll/win32/rsaenh/rsaenh.c b/dll/win32/rsaenh/rsaenh.c index bb28c999ae..f23c8d8bc9 100644 --- a/dll/win32/rsaenh/rsaenh.c +++ b/dll/win32/rsaenh/rsaenh.c @@ -43,6 +43,7 @@ #include <objbase.h> #include <rpcproxy.h> #include <aclapi.h> +#include <strsafe.h> WINE_DEFAULT_DEBUG_CHANNEL(crypt); @@ -1104,7 +1105,7 @@ static BOOL create_container_key(KEYCONTAINER *pKeyContainer, REGSAM sam, HKEY * CHAR szRSABase[MAX_PATH]; HKEY hRootKey; - sprintf(szRSABase, RSAENH_REGKEY, pKeyContainer->szName); + StringCbPrintfA(szRSABase, sizeof(szRSABase), RSAENH_REGKEY, pKeyContainer->szName); if (pKeyContainer->dwFlags & CRYPT_MACHINE_KEYSET) hRootKey = HKEY_LOCAL_MACHINE;
5 years, 7 months
1
0
0
0
[reactos] 05/13: [USETUP] Use RtlStringCbPrintfA instead of sprintf
by Timo Kreuzer
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=6129fbaf1eb936bff9ef4…
commit 6129fbaf1eb936bff9ef49c5a28b854b62dc96d1 Author: Timo Kreuzer <timo.kreuzer(a)reactos.org> AuthorDate: Sun Apr 28 21:03:35 2019 +0200 Commit: Hervé Poussineau <hpoussin(a)reactos.org> CommitDate: Mon May 27 13:22:40 2019 +0200 [USETUP] Use RtlStringCbPrintfA instead of sprintf Fixes GCC 8 warning: base/setup/usetup/usetup.c:3407:78: error: '%S' directive writing up to 521 bytes into a region of size 200 [-Werror=format-overflow=] "Setup is currently unable to check a partition formatted in %S.\n" ^~ base/setup/usetup/usetup.c:3406:9: note: 'sprintf' output between 128 and 649 bytes into a destination of size 260 sprintf(Buffer, ^~~~~~~~~~~~~~~ "Setup is currently unable to check a partition formatted in %S.\n" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ "\n" ~~~~ " \x07 Press ENTER to continue Setup.\n" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ " \x07 Press F3 to quit Setup.", ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PartEntry->FileSystem); ~~~~~~~~~~~~~~~~~~~~~~ --- base/setup/usetup/usetup.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/base/setup/usetup/usetup.c b/base/setup/usetup/usetup.c index 82716f61b5..239fd3465c 100644 --- a/base/setup/usetup/usetup.c +++ b/base/setup/usetup/usetup.c @@ -27,6 +27,7 @@ #include <usetup.h> #include <math.h> +#include <ntstrsafe.h> #include "bootsup.h" #include "chkdsk.h" @@ -3403,12 +3404,13 @@ CheckFileSystemPage(PINPUT_RECORD Ir) */ PartEntry->NeedsCheck = FALSE; - sprintf(Buffer, - "Setup is currently unable to check a partition formatted in %S.\n" - "\n" - " \x07 Press ENTER to continue Setup.\n" - " \x07 Press F3 to quit Setup.", - PartEntry->FileSystem); + RtlStringCbPrintfA(Buffer, + sizeof(Buffer), + "Setup is currently unable to check a partition formatted in %S.\n" + "\n" + " \x07 Press ENTER to continue Setup.\n" + " \x07 Press F3 to quit Setup.", + PartEntry->FileSystem); PopupError(Buffer, MUIGetString(STRING_QUITCONTINUE),
5 years, 7 months
1
0
0
0
[reactos] 04/13: [MINGW32] Add some definitions to fix building with GLIBCXX
by Timo Kreuzer
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=ead2156a29d507c8c942f…
commit ead2156a29d507c8c942f637f1210bc68568556a Author: Timo Kreuzer <timo.kreuzer(a)reactos.org> AuthorDate: Sat Apr 27 23:31:03 2019 +0200 Commit: Hervé Poussineau <hpoussin(a)reactos.org> CommitDate: Mon May 27 13:22:40 2019 +0200 [MINGW32] Add some definitions to fix building with GLIBCXX --- sdk/include/crt/_mingw.h | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/sdk/include/crt/_mingw.h b/sdk/include/crt/_mingw.h index 7aa8c21cb7..1d79edaff1 100644 --- a/sdk/include/crt/_mingw.h +++ b/sdk/include/crt/_mingw.h @@ -130,6 +130,22 @@ #define __MINGW_ATTRIB_DEPRECATED #endif +#if __MINGW_GNUC_PREREQ (3, 1) +#define __MINGW_ATTRIB_DEPRECATED_SEC_WARN //__attribute__ ((__deprecated__)) +#elif __MINGW_MSC_PREREQ(12, 0) +#define __MINGW_ATTRIB_DEPRECATED_SEC_WARN //__declspec(deprecated) +#else +#define __MINGW_ATTRIB_DEPRECATED_SEC_WARN +#endif + +#if __MINGW_GNUC_PREREQ (3, 1) +#define __MINGW_ATTRIB_DEPRECATED_MSVC2005 //__attribute__ ((__deprecated__)) +#elif __MINGW_MSC_PREREQ(12, 0) +#define __MINGW_ATTRIB_DEPRECATED_MSVC2005 //__declspec(deprecated) +#else +#define __MINGW_ATTRIB_DEPRECATED_MSVC2005 +#endif + #if __MINGW_GNUC_PREREQ (3, 3) #define __MINGW_NOTHROW __attribute__ ((__nothrow__)) #elif __MINGW_MSC_PREREQ(12, 0) && defined (__cplusplus) @@ -225,6 +241,15 @@ allow GCC to optimize away some EH unwind code, at least in DW2 case. */ #endif #endif /* DECLSPEC_HOTPATCH */ +#ifdef __cplusplus +# define __mingw_ovr inline __cdecl +#elif defined (__GNUC__) +# define __mingw_ovr static \ + __attribute__ ((__unused__)) __inline__ __cdecl +#else +# define __mingw_ovr static __cdecl +#endif /* __cplusplus */ + #include "_mingw_mac.h" #endif /* !_INC_MINGW */
5 years, 7 months
1
0
0
0
[reactos] 03/13: [CRT] Add missing posix error codes
by Timo Kreuzer
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=81bdf4e36023aa9cd7d71…
commit 81bdf4e36023aa9cd7d71ccdb9a6d1d09666406f Author: Timo Kreuzer <timo.kreuzer(a)reactos.org> AuthorDate: Sun Apr 28 11:28:24 2019 +0200 Commit: Hervé Poussineau <hpoussin(a)reactos.org> CommitDate: Mon May 27 13:22:40 2019 +0200 [CRT] Add missing posix error codes These are required by latest mingw-w64 stl and we are mixing this with our crt headers. Define _CRT_NO_POSIX_ERROR_CODES in all modules that define their own constants. --- dll/win32/dnsapi/CMakeLists.txt | 2 +- dll/win32/iphlpapi/CMakeLists.txt | 5 +++- drivers/filesystems/ext2/CMakeLists.txt | 2 +- drivers/filesystems/reiserfs/CMakeLists.txt | 2 +- sdk/include/crt/errno.h | 44 +++++++++++++++++++++++++++++ sdk/lib/3rdparty/adns/CMakeLists.txt | 3 +- sdk/lib/3rdparty/libmpg123/CMakeLists.txt | 3 +- 7 files changed, 55 insertions(+), 6 deletions(-) diff --git a/dll/win32/dnsapi/CMakeLists.txt b/dll/win32/dnsapi/CMakeLists.txt index 89b47e370c..2dcfaa0a84 100644 --- a/dll/win32/dnsapi/CMakeLists.txt +++ b/dll/win32/dnsapi/CMakeLists.txt @@ -4,7 +4,7 @@ include_directories( ${REACTOS_SOURCE_DIR}/sdk/lib/3rdparty/adns/src ${REACTOS_SOURCE_DIR}/sdk/lib/3rdparty/adns/adns_win32) -add_definitions(-DADNS_JGAA_WIN32) +add_definitions(-DADNS_JGAA_WIN32 -D_CRT_NO_POSIX_ERROR_CODES) spec2def(dnsapi.dll dnsapi.spec ADD_IMPORTLIB) list(APPEND SOURCE diff --git a/dll/win32/iphlpapi/CMakeLists.txt b/dll/win32/iphlpapi/CMakeLists.txt index 61f9112d76..4bd60a87ca 100644 --- a/dll/win32/iphlpapi/CMakeLists.txt +++ b/dll/win32/iphlpapi/CMakeLists.txt @@ -6,7 +6,10 @@ include_directories( spec2def(iphlpapi.dll iphlpapi.spec ADD_IMPORTLIB) -add_definitions(-DGetAdaptersAddressesV2) +add_definitions( + -DGetAdaptersAddressesV2 + -D_CRT_NO_POSIX_ERROR_CODES) + list(APPEND SOURCE address.c dhcp_reactos.c diff --git a/drivers/filesystems/ext2/CMakeLists.txt b/drivers/filesystems/ext2/CMakeLists.txt index 62541e1c34..f5bb339ca9 100644 --- a/drivers/filesystems/ext2/CMakeLists.txt +++ b/drivers/filesystems/ext2/CMakeLists.txt @@ -109,7 +109,7 @@ else() endif() target_link_libraries(ext2fs memcmp ${PSEH_LIB}) -add_definitions(-D__KERNEL__) +add_definitions(-D__KERNEL__ -D_CRT_NO_POSIX_ERROR_CODES) set_module_type(ext2fs kernelmodedriver) add_importlibs(ext2fs ntoskrnl hal) diff --git a/drivers/filesystems/reiserfs/CMakeLists.txt b/drivers/filesystems/reiserfs/CMakeLists.txt index 60429d9812..e9e4603f3c 100644 --- a/drivers/filesystems/reiserfs/CMakeLists.txt +++ b/drivers/filesystems/reiserfs/CMakeLists.txt @@ -91,7 +91,7 @@ else() endif() target_link_libraries(reiserfs memcmp ${PSEH_LIB}) -add_definitions(-D__KERNEL__) +add_definitions(-D__KERNEL__ -D_CRT_NO_POSIX_ERROR_CODES) set_module_type(reiserfs kernelmodedriver) add_importlibs(reiserfs ntoskrnl hal) add_pch(reiserfs inc/rfsd.h SOURCE) diff --git a/sdk/include/crt/errno.h b/sdk/include/crt/errno.h index 48f749f6d6..a0522428a3 100644 --- a/sdk/include/crt/errno.h +++ b/sdk/include/crt/errno.h @@ -57,6 +57,50 @@ extern "C" { #define ENOSYS 40 #define ENOTEMPTY 41 +#ifndef _CRT_NO_POSIX_ERROR_CODES + #define EADDRINUSE 100 + #define EADDRNOTAVAIL 101 + #define EAFNOSUPPORT 102 + #define EALREADY 103 + #define EBADMSG 104 + #define ECANCELED 105 + #define ECONNABORTED 106 + #define ECONNREFUSED 107 + #define ECONNRESET 108 + #define EDESTADDRREQ 109 + #define EHOSTUNREACH 110 + #define EIDRM 111 + #define EINPROGRESS 112 + #define EISCONN 113 + #define ELOOP 114 + #define EMSGSIZE 115 + #define ENETDOWN 116 + #define ENETRESET 117 + #define ENETUNREACH 118 + #define ENOBUFS 119 + #define ENODATA 120 + #define ENOLINK 121 + #define ENOMSG 122 + #define ENOPROTOOPT 123 + #define ENOSR 124 + #define ENOSTR 125 + #define ENOTCONN 126 + #define ENOTRECOVERABLE 127 + #define ENOTSOCK 128 + #define ENOTSUP 129 + #define EOPNOTSUPP 130 + #define EOTHER 131 + #define EOVERFLOW 132 + #define EOWNERDEAD 133 + #define EPROTO 134 + #define EPROTONOSUPPORT 135 + #define EPROTOTYPE 136 + #define ETIME 137 + #define ETIMEDOUT 138 + #define ETXTBSY 139 + #define EWOULDBLOCK 140 +#endif + #ifndef RC_INVOKED #if !defined(_SECURECRT_ERRCODE_VALUES_DEFINED) #define _SECURECRT_ERRCODE_VALUES_DEFINED diff --git a/sdk/lib/3rdparty/adns/CMakeLists.txt b/sdk/lib/3rdparty/adns/CMakeLists.txt index 058cf73f62..ff18daf5db 100644 --- a/sdk/lib/3rdparty/adns/CMakeLists.txt +++ b/sdk/lib/3rdparty/adns/CMakeLists.txt @@ -5,7 +5,8 @@ include_directories( add_definitions( -D_DLL -D__USE_CRTIMP - -DADNS_JGAA_WIN32) + -DADNS_JGAA_WIN32 + -D_CRT_NO_POSIX_ERROR_CODES) list(APPEND SOURCE adns_win32/adns_unix_calls.c diff --git a/sdk/lib/3rdparty/libmpg123/CMakeLists.txt b/sdk/lib/3rdparty/libmpg123/CMakeLists.txt index 32b24ebebf..867e928691 100644 --- a/sdk/lib/3rdparty/libmpg123/CMakeLists.txt +++ b/sdk/lib/3rdparty/libmpg123/CMakeLists.txt @@ -9,7 +9,8 @@ add_definitions( -Dread=_read -Dstrdup=_strdup -D_CRT_NONSTDC_NO_DEPRECATE - -D_DLL -D__USE_CRTIMP) + -D_DLL -D__USE_CRTIMP + -D_CRT_NO_POSIX_ERROR_CODES) include_directories(BEFORE ${REACTOS_SOURCE_DIR}/sdk/include/reactos/libs/libmpg123)
5 years, 7 months
1
0
0
0
[reactos] 02/13: [CMAKE] Disable unused-const-variable warning
by Hervé Poussineau
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=8eb7a1a2f4a9cce5a70a9…
commit 8eb7a1a2f4a9cce5a70a9c48efb30cdfa59bf56f Author: Hervé Poussineau <hpoussin(a)reactos.org> AuthorDate: Mon May 27 12:54:01 2019 +0200 Commit: Hervé Poussineau <hpoussin(a)reactos.org> CommitDate: Mon May 27 13:22:40 2019 +0200 [CMAKE] Disable unused-const-variable warning This prevents some errors like this one: In file included from ../dll/win32/wldap32/ber.c:27:0: ../sdk/include/reactos/wine/debug.h:378:48: error: '__wine_dbch___default' defined but not used [-Werror=unused-const-variable=] static struct __wine_debug_channel * const __wine_dbch___default = &__wine_dbch_##ch ^ ../dll/win32/wldap32/ber.c:29:1: note: in expansion of macro 'WINE_DEFAULT_DEBUG_CHANNEL' WINE_DEFAULT_DEBUG_CHANNEL(wldap32); ^~~~~~~~~~~~~~~~~~~~~~~~~~ --- sdk/cmake/gcc.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/sdk/cmake/gcc.cmake b/sdk/cmake/gcc.cmake index 7716f545e4..f5c1ec10c6 100644 --- a/sdk/cmake/gcc.cmake +++ b/sdk/cmake/gcc.cmake @@ -113,6 +113,7 @@ endif() add_compile_flags("-Wall -Wpointer-arith") add_compile_flags("-Wno-char-subscripts -Wno-multichar -Wno-unused-value") +add_compile_flags("-Wno-unused-const-variable") if(NOT CMAKE_C_COMPILER_ID STREQUAL "Clang") add_compile_flags("-Wno-maybe-uninitialized")
5 years, 7 months
1
0
0
0
[reactos] 01/13: [CMAKE] Disable --compress-debug-sections on GCC >= 7.0
by Hervé Poussineau
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=5fe74532afbd5be15591b…
commit 5fe74532afbd5be15591bac95b40d8d2c9621d32 Author: Hervé Poussineau <hpoussin(a)reactos.org> AuthorDate: Mon May 27 12:20:47 2019 +0200 Commit: Hervé Poussineau <hpoussin(a)reactos.org> CommitDate: Mon May 27 13:22:40 2019 +0200 [CMAKE] Disable --compress-debug-sections on GCC >= 7.0 This leads to 'bad reloc address in section .zdebug_info' --- sdk/cmake/gcc.cmake | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sdk/cmake/gcc.cmake b/sdk/cmake/gcc.cmake index 71971f2b6f..7716f545e4 100644 --- a/sdk/cmake/gcc.cmake +++ b/sdk/cmake/gcc.cmake @@ -253,7 +253,9 @@ set(CMAKE_EXE_LINKER_FLAGS "-nostdlib -Wl,--enable-auto-image-base,--disable-aut set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS_INIT} -Wl,--disable-stdcall-fixup") set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS_INIT} -Wl,--disable-stdcall-fixup") -if((NOT CMAKE_C_COMPILER_ID STREQUAL "Clang") AND (NOT CMAKE_BUILD_TYPE STREQUAL "Release")) +if((CMAKE_C_COMPILER_ID STREQUAL "GNU") AND + (NOT CMAKE_BUILD_TYPE STREQUAL "Release") AND + (NOT CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 7.0)) # FIXME: Set this once Clang toolchain works with it set(_compress_debug_sections_flag "-Wa,--compress-debug-sections") endif()
5 years, 7 months
1
0
0
0
[reactos] 01/01: [WIN32SS][NTGDI] Don't use FLOAT in ftGdiGetGlyphOutline (#1576)
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=86046a9bf4af575513083…
commit 86046a9bf4af57551308331631447c7ccfa87fe9 Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Mon May 27 18:35:43 2019 +0900 Commit: GitHub <noreply(a)github.com> CommitDate: Mon May 27 18:35:43 2019 +0900 [WIN32SS][NTGDI] Don't use FLOAT in ftGdiGetGlyphOutline (#1576) Don't use FLOAT variable in ftGdiGetGlyphOutline function. CORE-15838 --- win32ss/gdi/ntgdi/freetype.c | 61 +++++++++++++++++++++++++------------------- 1 file changed, 35 insertions(+), 26 deletions(-) diff --git a/win32ss/gdi/ntgdi/freetype.c b/win32ss/gdi/ntgdi/freetype.c index 94c1413071..3b65327071 100644 --- a/win32ss/gdi/ntgdi/freetype.c +++ b/win32ss/gdi/ntgdi/freetype.c @@ -347,18 +347,6 @@ static __inline void FTVectorToPOINTFX(FT_Vector *vec, POINTFX *pt) pt->y.fract |= ((pt->y.fract >> 6) | (pt->y.fract >> 12)); } -/* - This function builds an FT_Fixed from a float. It puts the integer part - in the highest 16 bits and the decimal part in the lowest 16 bits of the FT_Fixed. - It fails if the integer part of the float number is greater than SHORT_MAX. -*/ -static __inline FT_Fixed FT_FixedFromFloat(FLOAT f) -{ - short value = f; - unsigned short fract = (f - value) * 0xFFFF; - return (FT_Fixed)((long)value << 16 | (unsigned long)fract); -} - /* This function builds an FT_Fixed from a FIXED. It simply put f.value in the highest 16 bits and f.fract in the lowest 16 bits of the FT_Fixed. @@ -3479,14 +3467,15 @@ ftGdiGetGlyphOutline( FT_Error error; INT left, right, top = 0, bottom = 0; FT_Int load_flags = FT_LOAD_DEFAULT | FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH; - FLOAT eM11, widthRatio = 1.0; + FLOATOBJ eM11, widthRatio, eTemp; FT_Matrix transMat = identityMat; BOOL needsTransform = FALSE; INT orientation; LONG aveWidth; INT adv, lsb, bbx; /* These three hold to widths of the unrotated chars */ OUTLINETEXTMETRICW *potm; - XFORM xForm; + XFORMOBJ xo; + XFORML xform; LOGFONTW *plf; DPRINT("%u, %08x, %p, %08lx, %p, %p\n", wch, iFormat, pgm, @@ -3494,8 +3483,9 @@ ftGdiGetGlyphOutline( pdcattr = dc->pdcattr; - MatrixS2XForm(&xForm, &dc->pdcattr->mxWorldToDevice); - eM11 = xForm.eM11; + XFORMOBJ_vInit(&xo, &dc->pdcattr->mxWorldToDevice); + XFORMOBJ_iGetXform(&xo, &xform); + FLOATOBJ_SetFloat(&eM11, xform.eM11); hFont = pdcattr->hlfntNew; TextObj = RealizeFontInit(hFont); @@ -3557,17 +3547,33 @@ ftGdiGetGlyphOutline( } IntUnLockFreeType(); + FLOATOBJ_Set1(&widthRatio); if (aveWidth && potm) { - widthRatio = (FLOAT)aveWidth * eM11 / - (FLOAT)potm->otmTextMetrics.tmAveCharWidth; + // widthRatio = aveWidth * eM11 / potm->otmTextMetrics.tmAveCharWidth + FLOATOBJ_SetLong(&widthRatio, aveWidth); + FLOATOBJ_Mul(&widthRatio, &eM11); + FLOATOBJ_DivLong(&widthRatio, potm->otmTextMetrics.tmAveCharWidth); } - left = (INT)(ft_face->glyph->metrics.horiBearingX * widthRatio) & -64; - right = (INT)((ft_face->glyph->metrics.horiBearingX + - ft_face->glyph->metrics.width) * widthRatio + 63) & -64; + //left = (INT)(ft_face->glyph->metrics.horiBearingX * widthRatio) & -64; + FLOATOBJ_SetLong(&eTemp, ft_face->glyph->metrics.horiBearingX); + FLOATOBJ_Mul(&eTemp, &widthRatio); + left = FLOATOBJ_GetLong(&eTemp) & -64; + + //right = (INT)((ft_face->glyph->metrics.horiBearingX + + // ft_face->glyph->metrics.width) * widthRatio + 63) & -64; + FLOATOBJ_SetLong(&eTemp, ft_face->glyph->metrics.horiBearingX * ft_face->glyph->metrics.width); + FLOATOBJ_Mul(&eTemp, &widthRatio); + FLOATOBJ_AddLong(&eTemp, 63); + right = FLOATOBJ_GetLong(&eTemp) & -64; + + //adv = (INT)((ft_face->glyph->metrics.horiAdvance * widthRatio) + 63) >> 6; + FLOATOBJ_SetLong(&eTemp, ft_face->glyph->metrics.horiAdvance); + FLOATOBJ_Mul(&eTemp, &widthRatio); + FLOATOBJ_AddLong(&eTemp, 63); + adv = FLOATOBJ_GetLong(&eTemp) >> 6; - adv = (INT)((ft_face->glyph->metrics.horiAdvance * widthRatio) + 63) >> 6; lsb = left >> 6; bbx = (right - left) >> 6; @@ -3576,14 +3582,17 @@ ftGdiGetGlyphOutline( IntLockFreeType(); /* Width scaling transform */ - if (widthRatio != 1.0) + if (!FLOATOBJ_Equal1(&widthRatio)) { FT_Matrix scaleMat; - scaleMat.xx = FT_FixedFromFloat(widthRatio); + + eTemp = widthRatio; + FLOATOBJ_MulLong(&eTemp, 1 << 16); + + scaleMat.xx = FLOATOBJ_GetLong(&eTemp); scaleMat.xy = 0; scaleMat.yx = 0; - scaleMat.yy = FT_FixedFromFloat(1.0); - + scaleMat.yy = INT_TO_FIXED(1); FT_Matrix_Multiply(&scaleMat, &transMat); needsTransform = TRUE; }
5 years, 7 months
1
0
0
0
[reactos] 01/01: [WIN32SS][NTGDI] Avoid allocation of zero size in NtGdiGetGlyphIndicesW (#1577)
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=c52b8288d1deabe8be9dc…
commit c52b8288d1deabe8be9dc92c0499526de3be693f Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Mon May 27 16:52:45 2019 +0900 Commit: GitHub <noreply(a)github.com> CommitDate: Mon May 27 16:52:45 2019 +0900 [WIN32SS][NTGDI] Avoid allocation of zero size in NtGdiGetGlyphIndicesW (#1577) In NtGdiGetGlyphIndicesW function, allocation of zero size had caused fatal failures. Avoid allocation of zero size in ExAllocatePoolWithTag calls. Optimize for cwc == 0. CORE-12825 --- win32ss/gdi/ntgdi/freetype.c | 82 +++++++++++++++++++++++++++++--------------- 1 file changed, 54 insertions(+), 28 deletions(-) diff --git a/win32ss/gdi/ntgdi/freetype.c b/win32ss/gdi/ntgdi/freetype.c index 60f8c5669c..94c1413071 100644 --- a/win32ss/gdi/ntgdi/freetype.c +++ b/win32ss/gdi/ntgdi/freetype.c @@ -6890,37 +6890,32 @@ NtGdiGetGlyphIndicesW( PWSTR Safepwc = NULL; LPCWSTR UnSafepwc = pwc; LPWORD UnSafepgi = pgi; + FT_Face Face; + TT_OS2 *pOS2; - /* Check for integer overflow */ - if (cwc & 0x80000000) // (INT_MAX + 1) == INT_MIN - return GDI_ERROR; - - if (!UnSafepwc && !UnSafepgi) - return cwc; - - if (!UnSafepwc || !UnSafepgi) + if (cwc < 0) { - DPRINT1("UnSafepwc == %p, UnSafepgi = %p\n", UnSafepwc, UnSafepgi); + DPRINT1("cwc < 0\n"); return GDI_ERROR; } - // TODO: Special undocumented case! - if (!pwc && !pgi && (cwc == 0)) + if (!UnSafepwc && !UnSafepgi && cwc > 0) { - DPRINT1("ERR: NtGdiGetGlyphIndicesW with (!pwc && !pgi && (cwc == 0)) is UNIMPLEMENTED!\n"); - return 0; + DPRINT1("!UnSafepwc && !UnSafepgi && cwc > 0\n"); + return GDI_ERROR; } - // FIXME: This is a hack!! (triggered by e.g. Word 2010). See CORE-12825 - if (cwc == 0) + if (!UnSafepwc != !UnSafepgi) { - DPRINT1("ERR: NtGdiGetGlyphIndicesW with (cwc == 0) is UNIMPLEMENTED!\n"); + DPRINT1("UnSafepwc == %p, UnSafepgi = %p\n", UnSafepwc, UnSafepgi); return GDI_ERROR; } + /* Get FontGDI */ dc = DC_LockDc(hdc); if (!dc) { + DPRINT1("!DC_LockDC\n"); return GDI_ERROR; } pdcattr = dc->pdcattr; @@ -6929,29 +6924,43 @@ NtGdiGetGlyphIndicesW( DC_UnlockDc(dc); if (!TextObj) { + DPRINT1("!TextObj\n"); return GDI_ERROR; } - FontGDI = ObjToGDI(TextObj->Font, FONT); TEXTOBJ_UnlockText(TextObj); - Buffer = ExAllocatePoolWithTag(PagedPool, cwc*sizeof(WORD), GDITAG_TEXT); + if (cwc == 0) + { + if (!UnSafepwc && !UnSafepgi) + { + Face = FontGDI->SharedFace->Face; + return Face->num_glyphs; + } + else + { + Status = STATUS_UNSUCCESSFUL; + goto ErrorRet; + } + } + + Buffer = ExAllocatePoolWithTag(PagedPool, cwc * sizeof(WORD), GDITAG_TEXT); if (!Buffer) { + DPRINT1("ExAllocatePoolWithTag\n"); return GDI_ERROR; } + /* Get DefChar */ if (iMode & GGI_MARK_NONEXISTING_GLYPHS) { DefChar = 0xffff; } else { - FT_Face Face = FontGDI->SharedFace->Face; + Face = FontGDI->SharedFace->Face; if (FT_IS_SFNT(Face)) { - TT_OS2 *pOS2; - IntLockFreeType(); pOS2 = FT_Get_Sfnt_Table(Face, ft_sfnt_os2); DefChar = (pOS2->usDefaultChar ? get_glyph_index(Face, pOS2->usDefaultChar) : 0); @@ -6960,10 +6969,17 @@ NtGdiGetGlyphIndicesW( else { Size = IntGetOutlineTextMetrics(FontGDI, 0, NULL); + if (!Size) + { + Status = STATUS_UNSUCCESSFUL; + DPRINT1("!Size\n"); + goto ErrorRet; + } potm = ExAllocatePoolWithTag(PagedPool, Size, GDITAG_TEXT); if (!potm) { - cwc = GDI_ERROR; + Status = STATUS_INSUFFICIENT_RESOURCES; + DPRINT1("!potm\n"); goto ErrorRet; } Size = IntGetOutlineTextMetrics(FontGDI, Size, potm); @@ -6973,12 +6989,13 @@ NtGdiGetGlyphIndicesW( } } + /* Allocate for Safepwc */ pwcSize = cwc * sizeof(WCHAR); Safepwc = ExAllocatePoolWithTag(PagedPool, pwcSize, GDITAG_TEXT); - if (!Safepwc) { Status = STATUS_NO_MEMORY; + DPRINT1("!Safepwc\n"); goto ErrorRet; } @@ -6993,10 +7010,14 @@ NtGdiGetGlyphIndicesW( } _SEH2_END; - if (!NT_SUCCESS(Status)) goto ErrorRet; + if (!NT_SUCCESS(Status)) + { + DPRINT1("Status: %08lX\n", Status); + goto ErrorRet; + } + /* Get glyph indeces */ IntLockFreeType(); - for (i = 0; i < cwc; i++) { Buffer[i] = get_glyph_index(FontGDI->SharedFace->Face, Safepwc[i]); @@ -7005,7 +7026,6 @@ NtGdiGetGlyphIndicesW( Buffer[i] = DefChar; } } - IntUnLockFreeType(); _SEH2_TRY @@ -7020,12 +7040,18 @@ NtGdiGetGlyphIndicesW( _SEH2_END; ErrorRet: - ExFreePoolWithTag(Buffer, GDITAG_TEXT); + if (Buffer != NULL) + { + ExFreePoolWithTag(Buffer, GDITAG_TEXT); + } if (Safepwc != NULL) { ExFreePoolWithTag(Safepwc, GDITAG_TEXT); } - if (NT_SUCCESS(Status)) return cwc; + + if (NT_SUCCESS(Status)) + return cwc; + return GDI_ERROR; }
5 years, 7 months
1
0
0
0
[reactos] 01/01: [NET] Implement a parser for the '/times' option of the 'user' command.
by Eric Kohl
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=ccd95b9880c777723e352…
commit ccd95b9880c777723e352a21f3d2829f61053355 Author: Eric Kohl <eric.kohl(a)reactos.org> AuthorDate: Mon May 27 09:27:03 2019 +0200 Commit: Eric Kohl <eric.kohl(a)reactos.org> CommitDate: Mon May 27 09:27:53 2019 +0200 [NET] Implement a parser for the '/times' option of the 'user' command. Work in progress: - Does not obey to the users time zone. - Accepts english abbreviations of the days of week only. --- base/applications/network/net/cmdUser.c | 281 +++++++++++++++++++++++++++++--- 1 file changed, 262 insertions(+), 19 deletions(-) diff --git a/base/applications/network/net/cmdUser.c b/base/applications/network/net/cmdUser.c index 81506ea6ce..919a919caf 100644 --- a/base/applications/network/net/cmdUser.c +++ b/base/applications/network/net/cmdUser.c @@ -12,6 +12,8 @@ #define SECONDS_PER_DAY (60 * 60 * 24) #define SECONDS_PER_HOUR (60 * 60) +#define HOURS_PER_DAY 24 +#define DAYS_PER_WEEK 7 typedef struct _COUNTY_TABLE { @@ -48,6 +50,8 @@ static COUNTRY_TABLE CountryTable[] = {785, 5103}, // Arabic {972, 5104} }; // Hebrew +//static PWSTR DaysArray[] = {L"So", L"Mo", L"Di", L"Mi", L"Do", L"Fr", L"Sa"}; +static PWSTR DaysArray[] = {L"Sun", L"Mon", L"Tue", L"Wed", L"Thu", L"Fri", L"Sat"}; static int @@ -226,14 +230,27 @@ GetCountryFromCountryCode( static BOOL -BitValue( - PBYTE pLogonHours, +GetBitValue( + PBYTE pBitmap, DWORD dwBitNumber) { DWORD dwIndex = dwBitNumber / 8; BYTE Mask = 1 << (dwBitNumber & 7); - return ((pLogonHours[dwIndex] & Mask) != 0); + return ((pBitmap[dwIndex] & Mask) != 0); +} + + +static +VOID +SetBitValue( + PBYTE pBitmap, + DWORD dwBitNumber) +{ + DWORD dwIndex = dwBitNumber / 8; + BYTE Mask = 1 << (dwBitNumber & 7); + + pBitmap[dwIndex] |= Mask; } @@ -262,7 +279,7 @@ PrintLogonHours( for (dwBitNumber = 0; dwBitNumber < dwUnitsPerWeek; dwBitNumber++) { - bBitValue = BitValue(pLogonHours, dwBitNumber); + bBitValue = GetBitValue(pLogonHours, dwBitNumber); if (bBitValue) { dwStartTime = dwSecondsPerUnit * dwBitNumber; @@ -271,7 +288,7 @@ PrintLogonHours( { dwBitNumber++; if (dwBitNumber < dwUnitsPerWeek) - bBitValue = BitValue(pLogonHours, dwBitNumber); + bBitValue = GetBitValue(pLogonHours, dwBitNumber); } dwEndTime = dwSecondsPerUnit * dwBitNumber; @@ -291,6 +308,8 @@ PrintLogonHours( PrintMessageString(4307 + dwStartDay); ConPuts(StdOut, L" "); + + // FIXME: Check if this is a converion from GMT to local timezone PrintLocalTime((dwStartTime % SECONDS_PER_DAY) + SECONDS_PER_HOUR); ConPrintf(StdOut, L" - "); @@ -300,6 +319,7 @@ PrintLogonHours( ConPuts(StdOut, L" "); } + // FIXME: Check if this is a converion from GMT to local timezone PrintLocalTime((dwEndTime % SECONDS_PER_DAY) + SECONDS_PER_HOUR); ConPuts(StdOut, L"\n"); } @@ -809,20 +829,100 @@ ParseDate( } +static +BOOL +ParseHour( + PWSTR pszString, + PDWORD pdwHour) +{ + PWCHAR pChar; + DWORD dwHour = 0; + + if (!iswdigit(pszString[0])) + return FALSE; + + pChar = pszString; + while (iswdigit(*pChar)) + { + dwHour = dwHour * 10 + *pChar - L'0'; + pChar++; + } + + if (dwHour > 24) + return FALSE; + + if (dwHour == 24) + dwHour = 0; + + if ((*pChar != UNICODE_NULL) && + (dwHour >= 1) && + (dwHour <= 12)) + { + if ((_wcsicmp(pChar, L"am") == 0) || + (_wcsicmp(pChar, L"a.m.") == 0)) + { + if (dwHour == 12) + dwHour = 0; + } + else if ((_wcsicmp(pChar, L"pm") == 0) || + (_wcsicmp(pChar, L"p.m.") == 0)) + { + if (dwHour != 12) + dwHour += 12; + } + else + { + return FALSE; + } + } + + *pdwHour = dwHour; + + return TRUE; +} + + +static +BOOL +ParseDay( + PWSTR pszString, + PDWORD pdwDay) +{ + DWORD i; + + for (i = 0; i < ARRAYSIZE(DaysArray); i++) + { + if (_wcsicmp(pszString, DaysArray[i]) == 0) + { + *pdwDay = i; + return TRUE; + } + } + + return FALSE; +} + + static DWORD ParseLogonHours( PWSTR pszParams, - PBYTE *ppLogonHours, + PBYTE *ppLogonBitmap, PDWORD pdwUnitsPerWeek) { - PBYTE pLogonHours = NULL; + PBYTE pLogonBitmap = NULL; DWORD dwError = ERROR_SUCCESS; - - pLogonHours = HeapAlloc(GetProcessHeap(), - HEAP_ZERO_MEMORY, - UNITS_PER_WEEK / 8); - if (pLogonHours == NULL) + WCHAR szBuffer[32]; + PWSTR ptr1, ptr2; + WCHAR prevSep, nextSep; + DWORD dwStartHour, dwEndHour, dwStartDay, dwEndDay, i, j; + BYTE DayBitmap; + BYTE HourBitmap[6]; + + pLogonBitmap = HeapAlloc(GetProcessHeap(), + HEAP_ZERO_MEMORY, + UNITS_PER_WEEK / 8); + if (pLogonBitmap == NULL) return ERROR_OUTOFMEMORY; if (*pszParams == UNICODE_NULL) @@ -832,24 +932,167 @@ ParseLogonHours( if (wcsicmp(pszParams, L"all") == 0) { - FillMemory(pLogonHours, UNITS_PER_WEEK / 8, 0xFF); + FillMemory(pLogonBitmap, UNITS_PER_WEEK / 8, 0xFF); goto done; } - /* FIXME */ - /* Mockup error because we do not parse the line yet */ - dwError = 3768; + ZeroMemory(&DayBitmap, sizeof(DayBitmap)); + ZeroMemory(HourBitmap, sizeof(HourBitmap)); + + ZeroMemory(szBuffer, sizeof(szBuffer)); + ptr1 = pszParams; + ptr2 = szBuffer; + prevSep = UNICODE_NULL; + nextSep = UNICODE_NULL; + for (;;) + { + if (*ptr1 != L'-' && *ptr1 != L',' && *ptr1 != L';' && *ptr1 != UNICODE_NULL) + { + *ptr2 = *ptr1; + ptr2++; + } + else + { + prevSep = nextSep; + nextSep = *ptr1; + +// printf("Token: '%S'\n", szBuffer); + if (*ptr1 != UNICODE_NULL) + printf("Separator: '%C'\n", *ptr1); + + if (prevSep != L'-') + { + // Set first value + if (iswdigit(szBuffer[0])) + { + // parse hour + if (!ParseHour(szBuffer, &dwStartHour)) + { + dwError = 3769; + break; + } + + // FIXME: Check if this is a converion from local timezone to GMT + if (dwStartHour > 0) + dwStartHour--; + else + dwStartHour = UNITS_PER_WEEK - 1; + + SetBitValue(HourBitmap, dwStartHour); + } + else + { + // parse day + if (!ParseDay(szBuffer, &dwStartDay)) + { + dwError = 3768; + break; + } + + SetBitValue(&DayBitmap, dwStartDay); + } + } + else + { + // Set second value + if (iswdigit(szBuffer[0])) + { + // parse hour + if (!ParseHour(szBuffer, &dwEndHour)) + { + dwError = 3769; + break; + } + + if (dwEndHour < dwStartHour) + dwEndHour += HOURS_PER_DAY; + else if (dwEndHour == dwStartHour) + dwEndHour = dwStartHour + HOURS_PER_DAY; + + // FIXME: Check if this is a converion from local timezone to GMT + if (dwEndHour > 0) + dwEndHour--; + else + dwEndHour = UNITS_PER_WEEK - 1; + + for (i = dwStartHour; i < dwEndHour; i++) + SetBitValue(HourBitmap, i); + } + else + { + // parse day + if (!ParseDay(szBuffer, &dwEndDay)) + { + dwError = 3768; + break; + } + + if (dwEndDay <= dwStartDay) + dwEndDay += DAYS_PER_WEEK; + + for (i = dwStartDay; i <= dwEndDay; i++) + SetBitValue(&DayBitmap, i % DAYS_PER_WEEK); + } + } + + if (*ptr1 == L';' || *ptr1 == UNICODE_NULL) + { + // Process the data +// printf("DayBitmap: %02x HourBitmap: %02x%02x%02x%02x%02x%02x\n", +// DayBitmap, HourBitmap[5], HourBitmap[4], HourBitmap[3], HourBitmap[2], HourBitmap[1], HourBitmap[0]); + + for (i = 0; i < DAYS_PER_WEEK; i++) + { + if (GetBitValue(&DayBitmap, i)) + { + for (j = 0; j < 48; j++) + { + if (GetBitValue(HourBitmap, j)) + SetBitValue(pLogonBitmap, ((i * HOURS_PER_DAY) + j) % UNITS_PER_WEEK); + } + } + } + + // Reset the Bitmaps + ZeroMemory(&DayBitmap, sizeof(DayBitmap)); + ZeroMemory(HourBitmap, sizeof(HourBitmap)); + } + + if (*ptr1 == UNICODE_NULL) + { +// printf("Done\n"); + break; + } + + ZeroMemory(szBuffer, sizeof(szBuffer)); + ptr2 = szBuffer; + } + + ptr1++; + } + +#if 0 + printf("LogonBitmap:\n"); + for (i = 0; i < DAYS_PER_WEEK; i++) + { + j = i * 3; + printf("%lu: %02x%02x%02x\n", i, pLogonHours[j + 2], pLogonHours[j + 1], pLogonHours[j + 0]); + } + printf("\n"); +#endif done: if (dwError == ERROR_SUCCESS) { - *ppLogonHours = pLogonHours; + *ppLogonBitmap = pLogonBitmap; *pdwUnitsPerWeek = UNITS_PER_WEEK; } else { - if (pLogonHours != NULL) - HeapFree(GetProcessHeap(), 0, pLogonHours); + if (pLogonBitmap != NULL) + HeapFree(GetProcessHeap(), 0, pLogonBitmap); + *ppLogonBitmap = NULL; + *pdwUnitsPerWeek = 0; } return dwError;
5 years, 7 months
1
0
0
0
← Newer
1
2
3
4
5
6
7
...
17
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
Results per page:
10
25
50
100
200