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 2021
----- 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
21 participants
173 discussions
Start a n
N
ew thread
[reactos] 02/03: [PC98VID] Fix clang 12 warning
by Victor Perevertkin
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=959729f6eecc2b23fe5b5…
commit 959729f6eecc2b23fe5b56554cf9c61938dc4c1e Author: Victor Perevertkin <victor.perevertkin(a)reactos.org> AuthorDate: Fri Apr 9 03:54:25 2021 +0300 Commit: Victor Perevertkin <victor.perevertkin(a)reactos.org> CommitDate: Fri Apr 9 03:54:25 2021 +0300 [PC98VID] Fix clang 12 warning --- sdk/include/reactos/drivers/pc98/video.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sdk/include/reactos/drivers/pc98/video.h b/sdk/include/reactos/drivers/pc98/video.h index f6188d2abe7..00db994f68a 100644 --- a/sdk/include/reactos/drivers/pc98/video.h +++ b/sdk/include/reactos/drivers/pc98/video.h @@ -185,10 +185,10 @@ FORCEINLINE VOID WRITE_GDC_CSRFORM(PUCHAR Port, PCSRFORMPARAM CursorParameters) { - WRITE_PORT_UCHAR(Port, ((CursorParameters->Show & 0x01) << 7) | + WRITE_PORT_UCHAR(Port, (((_Bool)CursorParameters->Show) << 7) | (CursorParameters->LinesPerRow - 1)); WRITE_PORT_UCHAR(Port, ((CursorParameters->BlinkRate & 0x03) << 6) | - ((!CursorParameters->Blink & 0x01) << 5) | CursorParameters->StartScanLine); + (((_Bool)CursorParameters->Blink) << 5) | CursorParameters->StartScanLine); WRITE_PORT_UCHAR(Port, (CursorParameters->EndScanLine << 3) | ((CursorParameters->BlinkRate & 0x1C) >> 2)); }
3 years, 8 months
1
0
0
0
[reactos] 01/03: [SDK][NDK] Fix clang 12 compilation
by Victor Perevertkin
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=c7d1ff4a9d95d6596c6c7…
commit c7d1ff4a9d95d6596c6c79684906b00412122e55 Author: Victor Perevertkin <victor.perevertkin(a)reactos.org> AuthorDate: Fri Apr 9 03:51:32 2021 +0300 Commit: Victor Perevertkin <victor.perevertkin(a)reactos.org> CommitDate: Fri Apr 9 03:51:32 2021 +0300 [SDK][NDK] Fix clang 12 compilation --- sdk/cmake/gcc.cmake | 11 +++++++++-- sdk/include/ndk/kefuncs.h | 2 -- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/sdk/cmake/gcc.cmake b/sdk/cmake/gcc.cmake index d5436cea69f..9da30e09008 100644 --- a/sdk/cmake/gcc.cmake +++ b/sdk/cmake/gcc.cmake @@ -47,16 +47,23 @@ add_compile_options("$<$<NOT:$<COMPILE_LANGUAGE:CXX>>:-nostdinc>") add_compile_options(-mstackrealign) -if(NOT CMAKE_C_COMPILER_ID STREQUAL "Clang") +if(CMAKE_C_COMPILER_ID STREQUAL "GNU") add_compile_options(-fno-aggressive-loop-optimizations) if (DBG) add_compile_options("$<$<COMPILE_LANGUAGE:C>:-Wold-style-declaration>") endif() -else() +elseif(CMAKE_C_COMPILER_ID STREQUAL "Clang") add_compile_options("$<$<COMPILE_LANGUAGE:C>:-Wno-microsoft>") add_compile_options(-Wno-pragma-pack) add_compile_options(-fno-associative-math) add_compile_options(-fcommon) + + if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 12.0) + # disable "libcall optimization" + # see
https://mudongliang.github.io/2020/12/02/undefined-reference-to-stpcpy.html
+ add_compile_options(-fno-builtin-stpcpy) + endif() + set(CMAKE_LINK_DEF_FILE_FLAG "") set(CMAKE_STATIC_LIBRARY_SUFFIX ".a") set(CMAKE_LINK_LIBRARY_SUFFIX "") diff --git a/sdk/include/ndk/kefuncs.h b/sdk/include/ndk/kefuncs.h index 5556a79fa56..323f9df6455 100644 --- a/sdk/include/ndk/kefuncs.h +++ b/sdk/include/ndk/kefuncs.h @@ -245,7 +245,6 @@ KeSignalCallDpcSynchronize( // ARC Configuration Functions. Only enabled if you have ARC Support // #ifdef _ARC_ -CODE_SEG("INIT") PCONFIGURATION_COMPONENT_DATA NTAPI KeFindConfigurationNextEntry( @@ -256,7 +255,6 @@ KeFindConfigurationNextEntry( _In_ PCONFIGURATION_COMPONENT_DATA *NextLink ); -CODE_SEG("INIT") PCONFIGURATION_COMPONENT_DATA NTAPI KeFindConfigurationEntry(
3 years, 8 months
1
0
0
0
[reactos] 01/01: [WINSXS] Add some amd64 manifests
by Mark Jansen
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=2587d72ef7c0673a619a7…
commit 2587d72ef7c0673a619a7ad4202a82f926e8a6ab Author: Mark Jansen <mark.jansen(a)reactos.org> AuthorDate: Wed Dec 16 23:09:35 2020 +0100 Commit: Victor Perevertkin <victor(a)perevertkin.ru> CommitDate: Thu Apr 8 20:48:24 2021 +0300 [WINSXS] Add some amd64 manifests Co-authored-by: Timo Kreuzer <timo.kreuzer(a)reactos.org> --- boot/bootdata/packages/reactos.dff.in | 5 + dll/apisets/CMakeLists.txt | 4 +- dll/apisets/CMakeLists.txt.in | 4 +- ...6595b64144ccf1df_1.0.0.0_none_deadbeef.manifest | 220 +++++++++++++++++++++ ...5b64144ccf1df_1.0.0.0_none_deadbeef.manifest.in | 6 + dll/win32/comctl32/CMakeLists.txt | 9 +- ...44ccf1df_5.82.2600.2982_none_deadbeef.manifest} | 2 +- ...144ccf1df_6.0.2600.2982_none_deadbeef.manifest} | 2 +- ...144ccf1df_5.82.2600.2982_none_deadbeef.manifest | 2 +- ...4144ccf1df_6.0.2600.2982_none_deadbeef.manifest | 2 +- dll/win32/gdiplus/CMakeLists.txt | 8 +- ...b64144ccf1df_1.0.14393.0_none_deadbeef.manifest | 5 + ...144ccf1df_1.1.7601.23038_none_deadbeef.manifest | 5 + media/forwardcompatible.manifest | 6 +- media/systemcompatible.manifest | 4 +- sdk/cmake/CMakeMacros.cmake | 10 + 16 files changed, 273 insertions(+), 21 deletions(-) diff --git a/boot/bootdata/packages/reactos.dff.in b/boot/bootdata/packages/reactos.dff.in index 815db8d167c..cf80abab0e6 100644 --- a/boot/bootdata/packages/reactos.dff.in +++ b/boot/bootdata/packages/reactos.dff.in @@ -85,6 +85,11 @@ Signature = "$Windows NT$" 64 = Resources\Themes\Lunar 65 = Resources\Themes\Mizu 66 = system32\spool\prtprocs\x64 +67 = winsxs\amd64_microsoft.windows.common-controls_6595b64144ccf1df_5.82.2600.2982_none_deadbeef +68 = winsxs\amd64_microsoft.windows.common-controls_6595b64144ccf1df_6.0.2600.2982_none_deadbeef +69 = winsxs\amd64_microsoft.windows.gdiplus_6595b64144ccf1df_1.1.7601.23038_none_deadbeef +70 = winsxs\amd64_reactos.apisets_6595b64144ccf1df_1.0.0.0_none_deadbeef +71 = winsxs\amd64_microsoft.windows.gdiplus_6595b64144ccf1df_1.0.14393.0_none_deadbeef .InfEnd diff --git a/dll/apisets/CMakeLists.txt b/dll/apisets/CMakeLists.txt index 348cf2d4acb..3273531b34a 100644 --- a/dll/apisets/CMakeLists.txt +++ b/dll/apisets/CMakeLists.txt @@ -32,10 +32,10 @@ function (add_apiset apiset_name baseaddress) add_importlibs(${apiset_name} ${ARGN} ntdll) - add_cd_file(TARGET ${apiset_name} DESTINATION reactos/winsxs/x86_reactos.apisets_6595b64144ccf1df_1.0.0.0_none_deadbeef FOR all) + add_cd_file(TARGET ${apiset_name} DESTINATION reactos/winsxs/${WINARCH}_reactos.apisets_6595b64144ccf1df_1.0.0.0_none_deadbeef FOR all) endfunction() -add_cd_file(FILE ${CMAKE_CURRENT_SOURCE_DIR}/x86_reactos.apisets_6595b64144ccf1df_1.0.0.0_none_deadbeef.manifest DESTINATION reactos/winsxs/manifests FOR all) +add_cd_file(FILE ${CMAKE_CURRENT_SOURCE_DIR}/${WINARCH}_reactos.apisets_6595b64144ccf1df_1.0.0.0_none_deadbeef.manifest DESTINATION reactos/winsxs/manifests FOR all) # Apisets will be appended diff --git a/dll/apisets/CMakeLists.txt.in b/dll/apisets/CMakeLists.txt.in index 3ec26d4928b..fa5961a32b1 100644 --- a/dll/apisets/CMakeLists.txt.in +++ b/dll/apisets/CMakeLists.txt.in @@ -32,10 +32,10 @@ function (add_apiset apiset_name baseaddress) add_importlibs(${apiset_name} ${ARGN} ntdll) - add_cd_file(TARGET ${apiset_name} DESTINATION reactos/winsxs/x86_reactos.apisets_6595b64144ccf1df_1.0.0.0_none_deadbeef FOR all) + add_cd_file(TARGET ${apiset_name} DESTINATION reactos/winsxs/${WINARCH}_reactos.apisets_6595b64144ccf1df_1.0.0.0_none_deadbeef FOR all) endfunction() -add_cd_file(FILE ${CMAKE_CURRENT_SOURCE_DIR}/x86_reactos.apisets_6595b64144ccf1df_1.0.0.0_none_deadbeef.manifest DESTINATION reactos/winsxs/manifests FOR all) +add_cd_file(FILE ${CMAKE_CURRENT_SOURCE_DIR}/${WINARCH}_reactos.apisets_6595b64144ccf1df_1.0.0.0_none_deadbeef.manifest DESTINATION reactos/winsxs/manifests FOR all) # Apisets will be appended diff --git a/dll/apisets/amd64_reactos.apisets_6595b64144ccf1df_1.0.0.0_none_deadbeef.manifest b/dll/apisets/amd64_reactos.apisets_6595b64144ccf1df_1.0.0.0_none_deadbeef.manifest new file mode 100644 index 00000000000..83a4aaa0b7a --- /dev/null +++ b/dll/apisets/amd64_reactos.apisets_6595b64144ccf1df_1.0.0.0_none_deadbeef.manifest @@ -0,0 +1,220 @@ +<?xml version="1.0" encoding="UTF-8" standalone="yes"?> +<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"> + <!-- Generated from wine-3.20-144-g2ef62f9085 --> + <assemblyIdentity type="win32" name="ReactOS.Apisets" version="1.0.0.0" publicKeyToken="6595b64144ccf1df"/> + <file name="api-ms-win-appmodel-identity-l1-1-0.dll"/> + <file name="api-ms-win-appmodel-runtime-l1-1-1.dll"/> + <file name="api-ms-win-appmodel-runtime-l1-1-2.dll"/> + <file name="api-ms-win-core-apiquery-l1-1-0.dll"/> + <file name="api-ms-win-core-appcompat-l1-1-1.dll"/> + <file name="api-ms-win-core-appinit-l1-1-0.dll"/> + <file name="api-ms-win-core-atoms-l1-1-0.dll"/> + <file name="api-ms-win-core-bem-l1-1-0.dll"/> + <file name="api-ms-win-core-com-l1-1-0.dll"/> + <file name="api-ms-win-core-com-l1-1-1.dll"/> + <file name="api-ms-win-core-com-private-l1-1-0.dll"/> + <file name="api-ms-win-core-comm-l1-1-0.dll"/> + <file name="api-ms-win-core-console-l1-1-0.dll"/> + <file name="api-ms-win-core-console-l2-1-0.dll"/> + <file name="api-ms-win-core-crt-l1-1-0.dll"/> + <file name="api-ms-win-core-crt-l2-1-0.dll"/> + <file name="api-ms-win-core-datetime-l1-1-0.dll"/> + <file name="api-ms-win-core-datetime-l1-1-1.dll"/> + <file name="api-ms-win-core-debug-l1-1-0.dll"/> + <file name="api-ms-win-core-debug-l1-1-1.dll"/> + <file name="api-ms-win-core-delayload-l1-1-0.dll"/> + <file name="api-ms-win-core-delayload-l1-1-1.dll"/> + <file name="api-ms-win-core-errorhandling-l1-1-0.dll"/> + <file name="api-ms-win-core-errorhandling-l1-1-1.dll"/> + <file name="api-ms-win-core-errorhandling-l1-1-2.dll"/> + <file name="api-ms-win-core-errorhandling-l1-1-3.dll"/> + <file name="api-ms-win-core-fibers-l1-1-0.dll"/> + <file name="api-ms-win-core-fibers-l1-1-1.dll"/> + <file name="api-ms-win-core-file-l1-1-0.dll"/> + <file name="api-ms-win-core-file-l1-2-0.dll"/> + <file name="api-ms-win-core-file-l1-2-1.dll"/> + <file name="api-ms-win-core-file-l1-2-2.dll"/> + <file name="api-ms-win-core-file-l2-1-0.dll"/> + <file name="api-ms-win-core-file-l2-1-1.dll"/> + <file name="api-ms-win-core-file-l2-1-2.dll"/> + <file name="api-ms-win-core-handle-l1-1-0.dll"/> + <file name="api-ms-win-core-heap-l1-1-0.dll"/> + <file name="api-ms-win-core-heap-l1-2-0.dll"/> + <file name="api-ms-win-core-heap-l2-1-0.dll"/> + <file name="api-ms-win-core-heap-obsolete-l1-1-0.dll"/> + <file name="api-ms-win-core-interlocked-l1-1-0.dll"/> + <file name="api-ms-win-core-interlocked-l1-2-0.dll"/> + <file name="api-ms-win-core-io-l1-1-0.dll"/> + <file name="api-ms-win-core-io-l1-1-1.dll"/> + <file name="api-ms-win-core-job-l1-1-0.dll"/> + <file name="api-ms-win-core-job-l2-1-0.dll"/> + <file name="api-ms-win-core-kernel32-legacy-l1-1-0.dll"/> + <file name="api-ms-win-core-kernel32-legacy-l1-1-1.dll"/> + <file name="api-ms-win-core-kernel32-private-l1-1-1.dll"/> + <file name="api-ms-win-core-largeinteger-l1-1-0.dll"/> + <file name="api-ms-win-core-libraryloader-l1-1-0.dll"/> + <file name="api-ms-win-core-libraryloader-l1-1-1.dll"/> + <file name="api-ms-win-core-libraryloader-l1-2-0.dll"/> + <file name="api-ms-win-core-libraryloader-l1-2-1.dll"/> + <file name="api-ms-win-core-libraryloader-l1-2-2.dll"/> + <file name="api-ms-win-core-localization-l1-1-0.dll"/> + <file name="api-ms-win-core-localization-l1-2-0.dll"/> + <file name="api-ms-win-core-localization-l1-2-1.dll"/> + <file name="api-ms-win-core-localization-l2-1-0.dll"/> + <file name="api-ms-win-core-localization-obsolete-l1-1-0.dll"/> + <file name="api-ms-win-core-localization-obsolete-l1-2-0.dll"/> + <file name="api-ms-win-core-localization-obsolete-l1-3-0.dll"/> + <file name="api-ms-win-core-localization-private-l1-1-0.dll"/> + <file name="api-ms-win-core-localregistry-l1-1-0.dll"/> + <file name="api-ms-win-core-memory-l1-1-0.dll"/> + <file name="api-ms-win-core-memory-l1-1-1.dll"/> + <file name="api-ms-win-core-memory-l1-1-2.dll"/> + <file name="api-ms-win-core-misc-l1-1-0.dll"/> + <file name="api-ms-win-core-namedpipe-l1-1-0.dll"/> + <file name="api-ms-win-core-namedpipe-l1-2-0.dll"/> + <file name="api-ms-win-core-namespace-l1-1-0.dll"/> + <file name="api-ms-win-core-normalization-l1-1-0.dll"/> + <file name="api-ms-win-core-path-l1-1-0.dll"/> + <file name="api-ms-win-core-privateprofile-l1-1-1.dll"/> + <file name="api-ms-win-core-processenvironment-l1-1-0.dll"/> + <file name="api-ms-win-core-processenvironment-l1-2-0.dll"/> + <file name="api-ms-win-core-processthreads-l1-1-0.dll"/> + <file name="api-ms-win-core-processthreads-l1-1-1.dll"/> + <file name="api-ms-win-core-processthreads-l1-1-2.dll"/> + <file name="api-ms-win-core-processthreads-l1-1-3.dll"/> + <file name="api-ms-win-core-processtopology-obsolete-l1-1-0.dll"/> + <file name="api-ms-win-core-profile-l1-1-0.dll"/> + <file name="api-ms-win-core-psapi-ansi-l1-1-0.dll"/> + <file name="api-ms-win-core-psapi-l1-1-0.dll"/> + <file name="api-ms-win-core-psapi-obsolete-l1-1-0.dll"/> + <file name="api-ms-win-core-quirks-l1-1-0.dll"/> + <file name="api-ms-win-core-realtime-l1-1-0.dll"/> + <file name="api-ms-win-core-registry-l1-1-0.dll"/> + <file name="api-ms-win-core-registry-l2-1-0.dll"/> + <file name="api-ms-win-core-registryuserspecific-l1-1-0.dll"/> + <file name="api-ms-win-core-rtlsupport-l1-1-0.dll"/> + <file name="api-ms-win-core-rtlsupport-l1-2-0.dll"/> + <file name="api-ms-win-core-shlwapi-legacy-l1-1-0.dll"/> + <file name="api-ms-win-core-shlwapi-obsolete-l1-1-0.dll"/> + <file name="api-ms-win-core-shlwapi-obsolete-l1-2-0.dll"/> + <file name="api-ms-win-core-shutdown-l1-1-0.dll"/> + <file name="api-ms-win-core-sidebyside-l1-1-0.dll"/> + <file name="api-ms-win-core-string-l1-1-0.dll"/> + <file name="api-ms-win-core-string-l2-1-0.dll"/> + <file name="api-ms-win-core-string-obsolete-l1-1-0.dll"/> + <file name="api-ms-win-core-stringansi-l1-1-0.dll"/> + <file name="api-ms-win-core-stringloader-l1-1-1.dll"/> + <file name="api-ms-win-core-synch-ansi-l1-1-0.dll"/> + <file name="api-ms-win-core-synch-l1-1-0.dll"/> + <file name="api-ms-win-core-synch-l1-2-0.dll"/> + <file name="api-ms-win-core-synch-l1-2-1.dll"/> + <file name="api-ms-win-core-sysinfo-l1-1-0.dll"/> + <file name="api-ms-win-core-sysinfo-l1-2-0.dll"/> + <file name="api-ms-win-core-sysinfo-l1-2-1.dll"/> + <file name="api-ms-win-core-threadpool-l1-1-0.dll"/> + <file name="api-ms-win-core-threadpool-l1-2-0.dll"/> + <file name="api-ms-win-core-threadpool-legacy-l1-1-0.dll"/> + <file name="api-ms-win-core-threadpool-private-l1-1-0.dll"/> + <file name="api-ms-win-core-timezone-l1-1-0.dll"/> + <file name="api-ms-win-core-toolhelp-l1-1-0.dll"/> + <file name="api-ms-win-core-url-l1-1-0.dll"/> + <file name="api-ms-win-core-util-l1-1-0.dll"/> + <file name="api-ms-win-core-version-l1-1-0.dll"/> + <file name="api-ms-win-core-version-l1-1-1.dll"/> + <file name="api-ms-win-core-version-private-l1-1-0.dll"/> + <file name="api-ms-win-core-versionansi-l1-1-0.dll"/> + <file name="api-ms-win-core-windowserrorreporting-l1-1-0.dll"/> + <file name="api-ms-win-core-winrt-error-l1-1-0.dll"/> + <file name="api-ms-win-core-winrt-error-l1-1-1.dll"/> + <file name="api-ms-win-core-winrt-errorprivate-l1-1-1.dll"/> + <file name="api-ms-win-core-winrt-l1-1-0.dll"/> + <file name="api-ms-win-core-winrt-registration-l1-1-0.dll"/> + <file name="api-ms-win-core-winrt-roparameterizediid-l1-1-0.dll"/> + <file name="api-ms-win-core-winrt-string-l1-1-0.dll"/> + <file name="api-ms-win-core-winrt-string-l1-1-1.dll"/> + <file name="api-ms-win-core-wow64-l1-1-0.dll"/> + <file name="api-ms-win-core-wow64-l1-1-1.dll"/> + <file name="api-ms-win-core-xstate-l1-1-0.dll"/> + <file name="api-ms-win-core-xstate-l2-1-0.dll"/> + <file name="api-ms-win-crt-conio-l1-1-0.dll"/> + <file name="api-ms-win-crt-convert-l1-1-0.dll"/> + <file name="api-ms-win-crt-environment-l1-1-0.dll"/> + <file name="api-ms-win-crt-filesystem-l1-1-0.dll"/> + <file name="api-ms-win-crt-heap-l1-1-0.dll"/> + <file name="api-ms-win-crt-locale-l1-1-0.dll"/> + <file name="api-ms-win-crt-math-l1-1-0.dll"/> + <file name="api-ms-win-crt-multibyte-l1-1-0.dll"/> + <file name="api-ms-win-crt-private-l1-1-0.dll"/> + <file name="api-ms-win-crt-process-l1-1-0.dll"/> + <file name="api-ms-win-crt-runtime-l1-1-0.dll"/> + <file name="api-ms-win-crt-stdio-l1-1-0.dll"/> + <file name="api-ms-win-crt-string-l1-1-0.dll"/> + <file name="api-ms-win-crt-time-l1-1-0.dll"/> + <file name="api-ms-win-crt-utility-l1-1-0.dll"/> + <file name="api-ms-win-devices-config-l1-1-0.dll"/> + <file name="api-ms-win-devices-config-l1-1-1.dll"/> + <file name="api-ms-win-devices-query-l1-1-1.dll"/> + <file name="api-ms-win-downlevel-advapi32-l1-1-0.dll"/> + <file name="api-ms-win-downlevel-advapi32-l2-1-0.dll"/> + <file name="api-ms-win-downlevel-normaliz-l1-1-0.dll"/> + <file name="api-ms-win-downlevel-ole32-l1-1-0.dll"/> + <file name="api-ms-win-downlevel-shell32-l1-1-0.dll"/> + <file name="api-ms-win-downlevel-shlwapi-l1-1-0.dll"/> + <file name="api-ms-win-downlevel-shlwapi-l2-1-0.dll"/> + <file name="api-ms-win-downlevel-user32-l1-1-0.dll"/> + <file name="api-ms-win-downlevel-version-l1-1-0.dll"/> + <file name="api-ms-win-dx-d3dkmt-l1-1-0.dll"/> + <file name="api-ms-win-eventing-classicprovider-l1-1-0.dll"/> + <file name="api-ms-win-eventing-consumer-l1-1-0.dll"/> + <file name="api-ms-win-eventing-controller-l1-1-0.dll"/> + <file name="api-ms-win-eventing-legacy-l1-1-0.dll"/> + <file name="api-ms-win-eventing-provider-l1-1-0.dll"/> + <file name="api-ms-win-eventlog-legacy-l1-1-0.dll"/> + <file name="api-ms-win-gdi-dpiinfo-l1-1-0.dll"/> + <file name="api-ms-win-mm-joystick-l1-1-0.dll"/> + <file name="api-ms-win-mm-misc-l1-1-1.dll"/> + <file name="api-ms-win-mm-mme-l1-1-0.dll"/> + <file name="api-ms-win-mm-time-l1-1-0.dll"/> + <file name="api-ms-win-ntuser-dc-access-l1-1-0.dll"/> + <file name="api-ms-win-ntuser-rectangle-l1-1-0.dll"/> + <file name="api-ms-win-ntuser-sysparams-l1-1-0.dll"/> + <file name="api-ms-win-perf-legacy-l1-1-0.dll"/> + <file name="api-ms-win-power-base-l1-1-0.dll"/> + <file name="api-ms-win-power-setting-l1-1-0.dll"/> + <file name="api-ms-win-rtcore-ntuser-draw-l1-1-0.dll"/> + <file name="api-ms-win-rtcore-ntuser-private-l1-1-0.dll"/> + <file name="api-ms-win-rtcore-ntuser-private-l1-1-4.dll"/> + <file name="api-ms-win-rtcore-ntuser-window-l1-1-0.dll"/> + <file name="api-ms-win-rtcore-ntuser-winevent-l1-1-0.dll"/> + <file name="api-ms-win-rtcore-ntuser-wmpointer-l1-1-0.dll"/> + <file name="api-ms-win-rtcore-ntuser-wmpointer-l1-1-3.dll"/> + <file name="api-ms-win-security-activedirectoryclient-l1-1-0.dll"/> + <file name="api-ms-win-security-audit-l1-1-1.dll"/> + <file name="api-ms-win-security-base-l1-1-0.dll"/> + <file name="api-ms-win-security-base-l1-2-0.dll"/> + <file name="api-ms-win-security-base-private-l1-1-1.dll"/> + <file name="api-ms-win-security-credentials-l1-1-0.dll"/> + <file name="api-ms-win-security-cryptoapi-l1-1-0.dll"/> + <file name="api-ms-win-security-grouppolicy-l1-1-0.dll"/> + <file name="api-ms-win-security-lsalookup-l1-1-0.dll"/> + <file name="api-ms-win-security-lsalookup-l1-1-1.dll"/> + <file name="api-ms-win-security-lsalookup-l2-1-0.dll"/> + <file name="api-ms-win-security-lsalookup-l2-1-1.dll"/> + <file name="api-ms-win-security-lsapolicy-l1-1-0.dll"/> + <file name="api-ms-win-security-provider-l1-1-0.dll"/> + <file name="api-ms-win-security-sddl-l1-1-0.dll"/> + <file name="api-ms-win-security-systemfunctions-l1-1-0.dll"/> + <file name="api-ms-win-service-core-l1-1-0.dll"/> + <file name="api-ms-win-service-core-l1-1-1.dll"/> + <file name="api-ms-win-service-management-l1-1-0.dll"/> + <file name="api-ms-win-service-management-l2-1-0.dll"/> + <file name="api-ms-win-service-private-l1-1-1.dll"/> + <file name="api-ms-win-service-winsvc-l1-1-0.dll"/> + <file name="api-ms-win-service-winsvc-l1-2-0.dll"/> + <file name="api-ms-win-shcore-obsolete-l1-1-0.dll"/> + <file name="api-ms-win-shcore-scaling-l1-1-1.dll"/> + <file name="api-ms-win-shcore-stream-l1-1-0.dll"/> + <file name="api-ms-win-shcore-thread-l1-1-0.dll"/> + <file name="api-ms-win-shell-shellcom-l1-1-0.dll"/> + <file name="api-ms-win-shell-shellfolders-l1-1-0.dll"/> +</assembly> diff --git a/dll/apisets/amd64_reactos.apisets_6595b64144ccf1df_1.0.0.0_none_deadbeef.manifest.in b/dll/apisets/amd64_reactos.apisets_6595b64144ccf1df_1.0.0.0_none_deadbeef.manifest.in new file mode 100644 index 00000000000..8044a2ed96d --- /dev/null +++ b/dll/apisets/amd64_reactos.apisets_6595b64144ccf1df_1.0.0.0_none_deadbeef.manifest.in @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="UTF-8" standalone="yes"?> +<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"> + <!-- Generated from %WINE_GIT_VERSION% --> + <assemblyIdentity type="win32" name="ReactOS.Apisets" version="1.0.0.0" publicKeyToken="6595b64144ccf1df"/> +%MANIFEST_FILE_LIST% +</assembly> diff --git a/dll/win32/comctl32/CMakeLists.txt b/dll/win32/comctl32/CMakeLists.txt index 6675e8f3500..2d963efb7e1 100644 --- a/dll/win32/comctl32/CMakeLists.txt +++ b/dll/win32/comctl32/CMakeLists.txt @@ -75,7 +75,8 @@ add_delay_importlibs(comctl32 winmm uxtheme) add_importlibs(comctl32 user32 gdi32 advapi32 usp10 imm32 msvcrt kernel32 ntdll) add_pch(comctl32 precomp.h "${PCH_SKIP_SOURCE}") add_cd_file(TARGET comctl32 DESTINATION reactos/system32 FOR all) -add_cd_file(TARGET comctl32 DESTINATION reactos/winsxs/x86_microsoft.windows.common-controls_6595b64144ccf1df_5.82.2600.2982_none_deadbeef FOR all) -add_cd_file(TARGET comctl32 DESTINATION reactos/winsxs/x86_microsoft.windows.common-controls_6595b64144ccf1df_6.0.2600.2982_none_deadbeef FOR all) -add_cd_file(FILE ${CMAKE_CURRENT_SOURCE_DIR}/x86_microsoft.windows.common-controls_6595b64144ccf1df_5.82.2600.2982_none_deadbeef.manifest DESTINATION reactos/winsxs/manifests FOR all) -add_cd_file(FILE ${CMAKE_CURRENT_SOURCE_DIR}/x86_microsoft.windows.common-controls_6595b64144ccf1df_6.0.2600.2982_none_deadbeef.manifest DESTINATION reactos/winsxs/manifests FOR all) + +add_cd_file(TARGET comctl32 DESTINATION reactos/winsxs/${WINARCH}_microsoft.windows.common-controls_6595b64144ccf1df_5.82.2600.2982_none_deadbeef FOR all) +add_cd_file(TARGET comctl32 DESTINATION reactos/winsxs/${WINARCH}_microsoft.windows.common-controls_6595b64144ccf1df_6.0.2600.2982_none_deadbeef FOR all) +add_cd_file(FILE ${CMAKE_CURRENT_SOURCE_DIR}/${WINARCH}_microsoft.windows.common-controls_6595b64144ccf1df_5.82.2600.2982_none_deadbeef.manifest DESTINATION reactos/winsxs/manifests FOR all) +add_cd_file(FILE ${CMAKE_CURRENT_SOURCE_DIR}/${WINARCH}_microsoft.windows.common-controls_6595b64144ccf1df_6.0.2600.2982_none_deadbeef.manifest DESTINATION reactos/winsxs/manifests FOR all) diff --git a/dll/win32/comctl32/x86_microsoft.windows.common-controls_6595b64144ccf1df_5.82.2600.2982_none_deadbeef.manifest b/dll/win32/comctl32/amd64_microsoft.windows.common-controls_6595b64144ccf1df_5.82.2600.2982_none_deadbeef.manifest similarity index 94% copy from dll/win32/comctl32/x86_microsoft.windows.common-controls_6595b64144ccf1df_5.82.2600.2982_none_deadbeef.manifest copy to dll/win32/comctl32/amd64_microsoft.windows.common-controls_6595b64144ccf1df_5.82.2600.2982_none_deadbeef.manifest index 8029acbb64c..f272350fdfd 100644 --- a/dll/win32/comctl32/x86_microsoft.windows.common-controls_6595b64144ccf1df_5.82.2600.2982_none_deadbeef.manifest +++ b/dll/win32/comctl32/amd64_microsoft.windows.common-controls_6595b64144ccf1df_5.82.2600.2982_none_deadbeef.manifest @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"> - <assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="5.82.2600.2982" publicKeyToken="6595b64144ccf1df"/> + <assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="5.82.2600.2982" processorArchitecture="amd64" publicKeyToken="6595b64144ccf1df"/> <file name="comctl32.dll"> <windowClass versioned="no">Button</windowClass> <windowClass versioned="no">ButtonListBox</windowClass> diff --git a/dll/win32/comctl32/x86_microsoft.windows.common-controls_6595b64144ccf1df_6.0.2600.2982_none_deadbeef.manifest b/dll/win32/comctl32/amd64_microsoft.windows.common-controls_6595b64144ccf1df_6.0.2600.2982_none_deadbeef.manifest similarity index 93% copy from dll/win32/comctl32/x86_microsoft.windows.common-controls_6595b64144ccf1df_6.0.2600.2982_none_deadbeef.manifest copy to dll/win32/comctl32/amd64_microsoft.windows.common-controls_6595b64144ccf1df_6.0.2600.2982_none_deadbeef.manifest index 5f9aae353ab..6aae024df59 100644 --- a/dll/win32/comctl32/x86_microsoft.windows.common-controls_6595b64144ccf1df_6.0.2600.2982_none_deadbeef.manifest +++ b/dll/win32/comctl32/amd64_microsoft.windows.common-controls_6595b64144ccf1df_6.0.2600.2982_none_deadbeef.manifest @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"> - <assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.2600.2982" publicKeyToken="6595b64144ccf1df"/> + <assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.2600.2982" processorArchitecture="amd64" publicKeyToken="6595b64144ccf1df"/> <file name="comctl32.dll"> <windowClass>Button</windowClass> <windowClass>ButtonListBox</windowClass> diff --git a/dll/win32/comctl32/x86_microsoft.windows.common-controls_6595b64144ccf1df_5.82.2600.2982_none_deadbeef.manifest b/dll/win32/comctl32/x86_microsoft.windows.common-controls_6595b64144ccf1df_5.82.2600.2982_none_deadbeef.manifest index 8029acbb64c..667503808bb 100644 --- a/dll/win32/comctl32/x86_microsoft.windows.common-controls_6595b64144ccf1df_5.82.2600.2982_none_deadbeef.manifest +++ b/dll/win32/comctl32/x86_microsoft.windows.common-controls_6595b64144ccf1df_5.82.2600.2982_none_deadbeef.manifest @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"> - <assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="5.82.2600.2982" publicKeyToken="6595b64144ccf1df"/> + <assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="5.82.2600.2982" processorArchitecture="x86" publicKeyToken="6595b64144ccf1df"/> <file name="comctl32.dll"> <windowClass versioned="no">Button</windowClass> <windowClass versioned="no">ButtonListBox</windowClass> diff --git a/dll/win32/comctl32/x86_microsoft.windows.common-controls_6595b64144ccf1df_6.0.2600.2982_none_deadbeef.manifest b/dll/win32/comctl32/x86_microsoft.windows.common-controls_6595b64144ccf1df_6.0.2600.2982_none_deadbeef.manifest index 5f9aae353ab..0e253694b73 100644 --- a/dll/win32/comctl32/x86_microsoft.windows.common-controls_6595b64144ccf1df_6.0.2600.2982_none_deadbeef.manifest +++ b/dll/win32/comctl32/x86_microsoft.windows.common-controls_6595b64144ccf1df_6.0.2600.2982_none_deadbeef.manifest @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"> - <assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.2600.2982" publicKeyToken="6595b64144ccf1df"/> + <assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.2600.2982" processorArchitecture="x86" publicKeyToken="6595b64144ccf1df"/> <file name="comctl32.dll"> <windowClass>Button</windowClass> <windowClass>ButtonListBox</windowClass> diff --git a/dll/win32/gdiplus/CMakeLists.txt b/dll/win32/gdiplus/CMakeLists.txt index a3ea0e30437..c939dfa9ddb 100644 --- a/dll/win32/gdiplus/CMakeLists.txt +++ b/dll/win32/gdiplus/CMakeLists.txt @@ -40,8 +40,8 @@ add_importlibs(gdiplus msvcrt shlwapi oleaut32 ole32 user32 gdi32 kernel32 ntdll add_pch(gdiplus precomp.h "${PCH_SKIP_SOURCE}") add_cd_file(TARGET gdiplus DESTINATION reactos/system32 FOR all) -add_cd_file(TARGET gdiplus DESTINATION reactos/winsxs/x86_microsoft.windows.gdiplus_6595b64144ccf1df_1.1.7601.23038_none_deadbeef FOR all) -add_cd_file(FILE ${CMAKE_CURRENT_SOURCE_DIR}/x86_microsoft.windows.gdiplus_6595b64144ccf1df_1.1.7601.23038_none_deadbeef.manifest DESTINATION reactos/winsxs/manifests FOR all) +add_cd_file(TARGET gdiplus DESTINATION reactos/winsxs/${WINARCH}_microsoft.windows.gdiplus_6595b64144ccf1df_1.1.7601.23038_none_deadbeef FOR all) +add_cd_file(FILE ${CMAKE_CURRENT_SOURCE_DIR}/${WINARCH}_microsoft.windows.gdiplus_6595b64144ccf1df_1.1.7601.23038_none_deadbeef.manifest DESTINATION reactos/winsxs/manifests FOR all) -add_cd_file(TARGET gdiplus DESTINATION reactos/winsxs/x86_microsoft.windows.gdiplus_6595b64144ccf1df_1.0.14393.0_none_deadbeef FOR all) -add_cd_file(FILE ${CMAKE_CURRENT_SOURCE_DIR}/x86_microsoft.windows.gdiplus_6595b64144ccf1df_1.0.14393.0_none_deadbeef.manifest DESTINATION reactos/winsxs/manifests FOR all) +add_cd_file(TARGET gdiplus DESTINATION reactos/winsxs/${WINARCH}_microsoft.windows.gdiplus_6595b64144ccf1df_1.0.14393.0_none_deadbeef FOR all) +add_cd_file(FILE ${CMAKE_CURRENT_SOURCE_DIR}/${WINARCH}_microsoft.windows.gdiplus_6595b64144ccf1df_1.0.14393.0_none_deadbeef.manifest DESTINATION reactos/winsxs/manifests FOR all) diff --git a/dll/win32/gdiplus/amd64_microsoft.windows.gdiplus_6595b64144ccf1df_1.0.14393.0_none_deadbeef.manifest b/dll/win32/gdiplus/amd64_microsoft.windows.gdiplus_6595b64144ccf1df_1.0.14393.0_none_deadbeef.manifest new file mode 100644 index 00000000000..93b3bf11e2e --- /dev/null +++ b/dll/win32/gdiplus/amd64_microsoft.windows.gdiplus_6595b64144ccf1df_1.0.14393.0_none_deadbeef.manifest @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="UTF-8" standalone="yes"?> +<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"> + <assemblyIdentity type="win32" name="Microsoft.Windows.GdiPlus" version="1.0.14393.0" processorArchitecture="amd64" publicKeyToken="6595b64144ccf1df"/> + <file name="gdiplus.dll"/> +</assembly> diff --git a/dll/win32/gdiplus/amd64_microsoft.windows.gdiplus_6595b64144ccf1df_1.1.7601.23038_none_deadbeef.manifest b/dll/win32/gdiplus/amd64_microsoft.windows.gdiplus_6595b64144ccf1df_1.1.7601.23038_none_deadbeef.manifest new file mode 100644 index 00000000000..fba38187d2d --- /dev/null +++ b/dll/win32/gdiplus/amd64_microsoft.windows.gdiplus_6595b64144ccf1df_1.1.7601.23038_none_deadbeef.manifest @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="UTF-8" standalone="yes"?> +<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"> + <assemblyIdentity type="win32" name="Microsoft.Windows.GdiPlus" version="1.1.7601.23038" processorArchitecture="amd64" publicKeyToken="6595b64144ccf1df"/> + <file name="gdiplus.dll"/> +</assembly> diff --git a/media/forwardcompatible.manifest b/media/forwardcompatible.manifest index 785d62f8dbb..638f7f639cd 100644 --- a/media/forwardcompatible.manifest +++ b/media/forwardcompatible.manifest @@ -2,13 +2,13 @@ <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"> <dependency> <dependentAssembly> - <assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="5.82.0.0" publicKeyToken="6595b64144ccf1df" processorArchitecture="x86" language="*" /> + <assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="5.82.0.0" publicKeyToken="6595b64144ccf1df" processorArchitecture="*" language="*" /> </dependentAssembly> <dependentAssembly> - <assemblyIdentity type="win32" name="Microsoft.Windows.GdiPlus" version="1.1.0.0" publicKeyToken="6595b64144ccf1df" processorArchitecture="x86" language="*" /> + <assemblyIdentity type="win32" name="Microsoft.Windows.GdiPlus" version="1.1.0.0" publicKeyToken="6595b64144ccf1df" processorArchitecture="*" language="*" /> </dependentAssembly> <dependentAssembly> - <assemblyIdentity type="win32" name="ReactOS.Apisets" version="1.0.0.0" publicKeyToken="6595b64144ccf1df" processorArchitecture="x86" language="*" /> + <assemblyIdentity type="win32" name="ReactOS.Apisets" version="1.0.0.0" publicKeyToken="6595b64144ccf1df" processorArchitecture="*" language="*" /> </dependentAssembly> </dependency> </assembly> diff --git a/media/systemcompatible.manifest b/media/systemcompatible.manifest index 8326faa3f98..b1c76c0dac7 100644 --- a/media/systemcompatible.manifest +++ b/media/systemcompatible.manifest @@ -2,10 +2,10 @@ <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"> <dependency> <dependentAssembly> - <assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="5.82.0.0" publicKeyToken="6595b64144ccf1df" processorArchitecture="x86" language="*" /> + <assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="5.82.0.0" publicKeyToken="6595b64144ccf1df" processorArchitecture="*" language="*" /> </dependentAssembly> <dependentAssembly> - <assemblyIdentity type="win32" name="Microsoft.Windows.GdiPlus" version="1.1.0.0" publicKeyToken="6595b64144ccf1df" processorArchitecture="x86" language="*" /> + <assemblyIdentity type="win32" name="Microsoft.Windows.GdiPlus" version="1.1.0.0" publicKeyToken="6595b64144ccf1df" processorArchitecture="*" language="*" /> </dependentAssembly> </dependency> </assembly> diff --git a/sdk/cmake/CMakeMacros.cmake b/sdk/cmake/CMakeMacros.cmake index 537a045f6cd..3f9a5486c9e 100644 --- a/sdk/cmake/CMakeMacros.cmake +++ b/sdk/cmake/CMakeMacros.cmake @@ -225,6 +225,16 @@ macro(dir_to_num dir var) set(${var} 65) elseif(${dir} STREQUAL reactos/system32/spool/prtprocs/x64) set(${var} 66) + elseif(${dir} STREQUAL reactos/winsxs/amd64_microsoft.windows.common-controls_6595b64144ccf1df_5.82.2600.2982_none_deadbeef) + set(${var} 67) + elseif(${dir} STREQUAL reactos/winsxs/amd64_microsoft.windows.common-controls_6595b64144ccf1df_6.0.2600.2982_none_deadbeef) + set(${var} 68) + elseif(${dir} STREQUAL reactos/winsxs/amd64_microsoft.windows.gdiplus_6595b64144ccf1df_1.1.7601.23038_none_deadbeef) + set(${var} 69) + elseif(${dir} STREQUAL reactos/winsxs/amd64_reactos.apisets_6595b64144ccf1df_1.0.0.0_none_deadbeef) + set(${var} 70) + elseif(${dir} STREQUAL reactos/winsxs/amd64_microsoft.windows.gdiplus_6595b64144ccf1df_1.0.14393.0_none_deadbeef) + set(${var} 71) else() message(FATAL_ERROR "Wrong destination: ${dir}") endif()
3 years, 8 months
1
0
0
0
[reactos] 12/12: [NTOS:MM] Fix a bit page fault handler with regard to COW sections
by Jérôme Gardou
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=c48580135df5ef8673254…
commit c48580135df5ef86732546126830a1ab98f71b29 Author: Jérôme Gardou <jerome.gardou(a)reactos.org> AuthorDate: Tue Apr 6 12:58:02 2021 +0200 Commit: Jérôme Gardou <zefklop(a)users.noreply.github.com> CommitDate: Thu Apr 8 15:40:37 2021 +0200 [NTOS:MM] Fix a bit page fault handler with regard to COW sections --- ntoskrnl/mm/section.c | 82 ++++++++++++++++++++++++++++++--------------------- 1 file changed, 48 insertions(+), 34 deletions(-) diff --git a/ntoskrnl/mm/section.c b/ntoskrnl/mm/section.c index 0b6b8e80416..e273c3ac10b 100644 --- a/ntoskrnl/mm/section.c +++ b/ntoskrnl/mm/section.c @@ -1697,8 +1697,7 @@ MmNotPresentFaultSectionView(PMMSUPPORT AddressSpace, * Check if this page needs to be mapped COW */ if ((Segment->WriteCopy) && - (Region->Protect == PAGE_READWRITE || - Region->Protect == PAGE_EXECUTE_READWRITE)) + (Region->Protect == PAGE_READWRITE || Region->Protect == PAGE_EXECUTE_READWRITE)) { Attributes = Region->Protect == PAGE_READWRITE ? PAGE_READONLY : PAGE_EXECUTE_READ; } @@ -1883,32 +1882,70 @@ MmAccessFaultSectionView(PMMSUPPORT AddressSpace, PMM_SECTION_SEGMENT Segment; PFN_NUMBER OldPage; PFN_NUMBER NewPage; - NTSTATUS Status; PVOID PAddress; LARGE_INTEGER Offset; PMM_REGION Region; ULONG_PTR Entry; PEPROCESS Process = MmGetAddressSpaceOwner(AddressSpace); + BOOLEAN Cow = FALSE; + ULONG NewProtect; DPRINT("MmAccessFaultSectionView(%p, %p, %p)\n", AddressSpace, MemoryArea, Address); + /* Get the region for this address */ + Region = MmFindRegion((PVOID)MA_GetStartingAddress(MemoryArea), + &MemoryArea->SectionData.RegionListHead, + Address, NULL); + ASSERT(Region != NULL); + if (!(Region->Protect & PAGE_IS_WRITABLE)) + return STATUS_ACCESS_VIOLATION; + /* Make sure we have a page mapping for this address. */ - Status = MmNotPresentFaultSectionView(AddressSpace, MemoryArea, Address, Locked); - if (!NT_SUCCESS(Status)) + if (!MmIsPagePresent(Process, Address)) { - /* This is invalid access ! */ - return Status; + NTSTATUS Status = MmNotPresentFaultSectionView(AddressSpace, MemoryArea, Address, Locked); + if (!NT_SUCCESS(Status)) + { + /* This is invalid access ! */ + return Status; + } } /* * Check if the page has already been set readwrite */ - if (MmGetPageProtect(Process, Address) & PAGE_READWRITE) + if (MmGetPageProtect(Process, Address) & (PAGE_READWRITE | PAGE_EXECUTE_READWRITE)) { DPRINT("Address 0x%p\n", Address); return STATUS_SUCCESS; } + /* Check if we are doing Copy-On-Write */ + Segment = MemoryArea->SectionData.Segment; + Cow = Segment->WriteCopy || (Region->Protect & PAGE_IS_WRITECOPY); + + if (!Cow) + { + /* Simply update page protection and we're done */ + MmSetPageProtect(Process, Address, Region->Protect); + return STATUS_SUCCESS; + } + + /* Calculate the new protection & check if we should update the region */ + NewProtect = Region->Protect; + if (NewProtect & PAGE_IS_WRITECOPY) + { + NewProtect &= ~PAGE_IS_WRITECOPY; + if (Region->Protect & PAGE_IS_EXECUTABLE) + NewProtect |= PAGE_EXECUTE_READWRITE; + else + NewProtect |= PAGE_READWRITE; + MmAlterRegion(AddressSpace, (PVOID)MA_GetStartingAddress(MemoryArea), + &MemoryArea->SectionData.RegionListHead, + Address, PAGE_SIZE, Region->Type, NewProtect, + MmAlterViewAttributes); + } + /* * Find the offset of the page */ @@ -1916,23 +1953,6 @@ MmAccessFaultSectionView(PMMSUPPORT AddressSpace, Offset.QuadPart = (ULONG_PTR)PAddress - MA_GetStartingAddress(MemoryArea) + MemoryArea->SectionData.ViewOffset; - Segment = MemoryArea->SectionData.Segment; - Region = MmFindRegion((PVOID)MA_GetStartingAddress(MemoryArea), - &MemoryArea->SectionData.RegionListHead, - Address, NULL); - ASSERT(Region != NULL); - - /* - * Check if we are doing COW - */ - if (!((Segment->WriteCopy) && - (Region->Protect == PAGE_READWRITE || - Region->Protect == PAGE_EXECUTE_READWRITE))) - { - DPRINT("Address 0x%p\n", Address); - return STATUS_ACCESS_VIOLATION; - } - /* Get the page mapping this section offset. */ MmLockSectionSegment(Segment); Entry = MmGetPageEntrySectionSegment(Segment, &Offset); @@ -1947,15 +1967,14 @@ MmAccessFaultSectionView(PMMSUPPORT AddressSpace, { MmUnlockSectionSegment(Segment); /* This is a private page. We must only change the page protection. */ - MmSetPageProtect(Process, PAddress, Region->Protect); + MmSetPageProtect(Process, PAddress, NewProtect); return STATUS_SUCCESS; } /* * Allocate a page */ - Status = MmRequestPageMemoryConsumer(MC_USER, TRUE, &NewPage); - if (!NT_SUCCESS(Status)) + if (!NT_SUCCESS(MmRequestPageMemoryConsumer(MC_USER, TRUE, &NewPage))) { KeBugCheck(MEMORY_MANAGEMENT); } @@ -1978,15 +1997,10 @@ MmAccessFaultSectionView(PMMSUPPORT AddressSpace, /* * Set the PTE to point to the new page */ - Status = MmCreateVirtualMapping(Process, - PAddress, - Region->Protect, - NewPage); - if (!NT_SUCCESS(Status)) + if (!NT_SUCCESS(MmCreateVirtualMapping(Process, PAddress, NewProtect, NewPage))) { DPRINT1("MmCreateVirtualMapping failed, unable to create virtual mapping, not out of memory\n"); KeBugCheck(MEMORY_MANAGEMENT); - return Status; } if (Process)
3 years, 8 months
1
0
0
0
[reactos] 11/12: [NTOS:MM] Share "page.c" between i386 & amd64 builds
by Jérôme Gardou
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=a34d9bcfb62b0e26d5361…
commit a34d9bcfb62b0e26d5361671f4324fb2293f5752 Author: Jérôme Gardou <jerome.gardou(a)reactos.org> AuthorDate: Thu Apr 1 14:03:25 2021 +0200 Commit: Jérôme Gardou <zefklop(a)users.noreply.github.com> CommitDate: Thu Apr 8 15:40:37 2021 +0200 [NTOS:MM] Share "page.c" between i386 & amd64 builds --- ntoskrnl/include/internal/amd64/mm.h | 7 - ntoskrnl/mm/amd64/page.c | 621 ----------------------------------- ntoskrnl/ntos.cmake | 2 +- 3 files changed, 1 insertion(+), 629 deletions(-) diff --git a/ntoskrnl/include/internal/amd64/mm.h b/ntoskrnl/include/internal/amd64/mm.h index 1afab8fd17b..e62df71cfe0 100644 --- a/ntoskrnl/include/internal/amd64/mm.h +++ b/ntoskrnl/include/internal/amd64/mm.h @@ -295,13 +295,6 @@ MI_IS_MAPPED_PTE(PMMPTE PointerPte) (PointerPte->u.Hard.PageFrameNumber != 0)); } -FORCEINLINE -VOID -MmInitGlobalKernelPageDirectory(VOID) -{ - /* Nothing to do */ -} - FORCEINLINE BOOLEAN MiIsPdeForAddressValid(PVOID Address) diff --git a/ntoskrnl/mm/amd64/page.c b/ntoskrnl/mm/amd64/page.c deleted file mode 100644 index 3a3c3e4c89a..00000000000 --- a/ntoskrnl/mm/amd64/page.c +++ /dev/null @@ -1,621 +0,0 @@ -/* - * COPYRIGHT: GPL, See COPYING in the top level directory - * PROJECT: ReactOS kernel - * FILE: ntoskrnl/mm/amd64/page.c - * PURPOSE: Low level memory managment manipulation - * - * PROGRAMMER: Timo Kreuzer (timo.kreuzer(a)reactos.org) - * ReactOS Portable Systems Group - */ - -/* INCLUDES ***************************************************************/ - -#include <ntoskrnl.h> -#define NDEBUG -#include <debug.h> -#include <mm/ARM3/miarm.h> - -#undef InterlockedExchangePte -#define InterlockedExchangePte(pte1, pte2) \ - InterlockedExchange64((LONG64*)&pte1->u.Long, pte2.u.Long) - -#define PAGE_EXECUTE_ANY (PAGE_EXECUTE|PAGE_EXECUTE_READ|PAGE_EXECUTE_READWRITE|PAGE_EXECUTE_WRITECOPY) -#define PAGE_WRITE_ANY (PAGE_EXECUTE_READWRITE|PAGE_READWRITE|PAGE_EXECUTE_WRITECOPY|PAGE_WRITECOPY) -#define PAGE_WRITECOPY_ANY (PAGE_EXECUTE_WRITECOPY|PAGE_WRITECOPY) - -extern MMPTE HyperTemplatePte; - -/* GLOBALS *****************************************************************/ - -const -ULONG64 -MmProtectToPteMask[32] = -{ - // - // These are the base MM_ protection flags - // - 0, - PTE_READONLY | PTE_ENABLE_CACHE, - PTE_EXECUTE | PTE_ENABLE_CACHE, - PTE_EXECUTE_READ | PTE_ENABLE_CACHE, - PTE_READWRITE | PTE_ENABLE_CACHE, - PTE_WRITECOPY | PTE_ENABLE_CACHE, - PTE_EXECUTE_READWRITE | PTE_ENABLE_CACHE, - PTE_EXECUTE_WRITECOPY | PTE_ENABLE_CACHE, - // - // These OR in the MM_NOCACHE flag - // - 0, - PTE_READONLY | PTE_DISABLE_CACHE, - PTE_EXECUTE | PTE_DISABLE_CACHE, - PTE_EXECUTE_READ | PTE_DISABLE_CACHE, - PTE_READWRITE | PTE_DISABLE_CACHE, - PTE_WRITECOPY | PTE_DISABLE_CACHE, - PTE_EXECUTE_READWRITE | PTE_DISABLE_CACHE, - PTE_EXECUTE_WRITECOPY | PTE_DISABLE_CACHE, - // - // These OR in the MM_DECOMMIT flag, which doesn't seem supported on x86/64/ARM - // - 0, - PTE_READONLY | PTE_ENABLE_CACHE, - PTE_EXECUTE | PTE_ENABLE_CACHE, - PTE_EXECUTE_READ | PTE_ENABLE_CACHE, - PTE_READWRITE | PTE_ENABLE_CACHE, - PTE_WRITECOPY | PTE_ENABLE_CACHE, - PTE_EXECUTE_READWRITE | PTE_ENABLE_CACHE, - PTE_EXECUTE_WRITECOPY | PTE_ENABLE_CACHE, - // - // These OR in the MM_NOACCESS flag, which seems to enable WriteCombining? - // - 0, - PTE_READONLY | PTE_WRITECOMBINED_CACHE, - PTE_EXECUTE | PTE_WRITECOMBINED_CACHE, - PTE_EXECUTE_READ | PTE_WRITECOMBINED_CACHE, - PTE_READWRITE | PTE_WRITECOMBINED_CACHE, - PTE_WRITECOPY | PTE_WRITECOMBINED_CACHE, - PTE_EXECUTE_READWRITE | PTE_WRITECOMBINED_CACHE, - PTE_EXECUTE_WRITECOPY | PTE_WRITECOMBINED_CACHE, -}; - -const -ULONG MmProtectToValue[32] = -{ - PAGE_NOACCESS, - PAGE_READONLY, - PAGE_EXECUTE, - PAGE_EXECUTE_READ, - PAGE_READWRITE, - PAGE_WRITECOPY, - PAGE_EXECUTE_READWRITE, - PAGE_EXECUTE_WRITECOPY, - PAGE_NOACCESS, - PAGE_NOCACHE | PAGE_READONLY, - PAGE_NOCACHE | PAGE_EXECUTE, - PAGE_NOCACHE | PAGE_EXECUTE_READ, - PAGE_NOCACHE | PAGE_READWRITE, - PAGE_NOCACHE | PAGE_WRITECOPY, - PAGE_NOCACHE | PAGE_EXECUTE_READWRITE, - PAGE_NOCACHE | PAGE_EXECUTE_WRITECOPY, - PAGE_NOACCESS, - PAGE_GUARD | PAGE_READONLY, - PAGE_GUARD | PAGE_EXECUTE, - PAGE_GUARD | PAGE_EXECUTE_READ, - PAGE_GUARD | PAGE_READWRITE, - PAGE_GUARD | PAGE_WRITECOPY, - PAGE_GUARD | PAGE_EXECUTE_READWRITE, - PAGE_GUARD | PAGE_EXECUTE_WRITECOPY, - PAGE_NOACCESS, - PAGE_WRITECOMBINE | PAGE_READONLY, - PAGE_WRITECOMBINE | PAGE_EXECUTE, - PAGE_WRITECOMBINE | PAGE_EXECUTE_READ, - PAGE_WRITECOMBINE | PAGE_READWRITE, - PAGE_WRITECOMBINE | PAGE_WRITECOPY, - PAGE_WRITECOMBINE | PAGE_EXECUTE_READWRITE, - PAGE_WRITECOMBINE | PAGE_EXECUTE_WRITECOPY -}; - -/* PRIVATE FUNCTIONS *******************************************************/ - -BOOLEAN -FORCEINLINE -MiIsHyperspaceAddress(PVOID Address) -{ - return ((ULONG64)Address >= HYPER_SPACE && - (ULONG64)Address <= HYPER_SPACE_END); -} - -VOID -MiFlushTlb(PMMPTE Pte, PVOID Address, KIRQL OldIrql) -{ - if (MiIsHyperspaceAddress(Pte)) - { - MiUnmapPageInHyperSpace(PsGetCurrentProcess(), (PVOID)PAGE_ROUND_DOWN(Pte), OldIrql); - } - else - { - __invlpg(Address); - } -} - -static -PMMPTE -MiGetPteForProcess( - PEPROCESS Process, - PVOID Address, - BOOLEAN Create, - PKIRQL OldIrql -) -{ - PMMPTE Pte; - PMMPDE Pde; - PMMPPE Ppe; - PMMPXE Pxe; - - *OldIrql = 0; - /* Make sure the process is correct */ - if (Address < MmSystemRangeStart) - { - /* FIXME: Implement this case */ - ASSERT(Process == PsGetCurrentProcess()); - } - else - { - ASSERT((Process == NULL) || (Process == PsGetCurrentProcess())); - } - - Pxe = MiAddressToPxe(Address); - Ppe = MiAddressToPpe(Address); - Pde = MiAddressToPde(Address); - Pte = MiAddressToPte(Address); - - if (Create) - { - /* Check the PXE */ - if (Pxe->u.Long == 0) - { - /* Make it demand zero */ - MI_WRITE_INVALID_PDE(Pxe, DemandZeroPde); - } - - /* Check the PPE */ - if (Ppe->u.Long == 0) - { - /* Make it demand zero */ - MI_WRITE_INVALID_PDE(Ppe, DemandZeroPde); - } - - /* Check the PDE */ - if (Pde->u.Long == 0) - { - /* Make it demand zero */ - MI_WRITE_INVALID_PDE(Pde, DemandZeroPde); - } - } - else - { - /* Check the PXE */ - if (!Pxe->u.Hard.Valid) - return NULL; - - /* Check the PPE */ - if (!Ppe->u.Hard.Valid) - return NULL; - - /* Check the PDE */ - if (!Pde->u.Hard.Valid) - return NULL; - } - - return Pte; -} - -static -ULONG64 -MiGetPteValueForProcess( - PEPROCESS Process, - PVOID Address) -{ - PMMPTE Pte; - ULONG64 PteValue; - KIRQL OldIrql; - - Pte = MiGetPteForProcess(Process, Address, FALSE, &OldIrql); - PteValue = Pte ? Pte->u.Long : 0; - - if (MiIsHyperspaceAddress(Pte)) - MiUnmapPageInHyperSpace(PsGetCurrentProcess(), (PVOID)PAGE_ROUND_DOWN(Pte), OldIrql); - - return PteValue; -} - -ULONG -NTAPI -MiGetPteProtection(MMPTE Pte) -{ - ULONG Protect; - - if (!Pte.u.Flush.Valid) - { - Protect = PAGE_NOACCESS; - } - else if (Pte.u.Flush.NoExecute) - { - if (Pte.u.Flush.CopyOnWrite) - Protect = PAGE_WRITECOPY; - else if (Pte.u.Flush.Write) - Protect = PAGE_READWRITE; - else - Protect = PAGE_READONLY; - } - else - { - if (Pte.u.Flush.CopyOnWrite) - Protect = PAGE_EXECUTE_WRITECOPY; - else if (Pte.u.Flush.Write) - Protect = PAGE_EXECUTE_READWRITE; - else - Protect = PAGE_EXECUTE_READ; - } - - if (Pte.u.Flush.CacheDisable) - Protect |= PAGE_NOCACHE; - - if (Pte.u.Flush.WriteThrough) - Protect |= PAGE_WRITETHROUGH; - - // PAGE_GUARD ? - return Protect; -} - -static -VOID -MiSetPteProtection(PMMPTE Pte, ULONG Protection) -{ - Pte->u.Flush.CopyOnWrite = (Protection & PAGE_WRITECOPY_ANY) ? 1 : 0; - Pte->u.Flush.Write = (Protection & PAGE_WRITE_ANY) ? 1 : 0; - Pte->u.Flush.CacheDisable = (Protection & PAGE_NOCACHE) ? 1 : 0; - Pte->u.Flush.WriteThrough = (Protection & PAGE_WRITETHROUGH) ? 1 : 0; - - // FIXME: This doesn't work. Why? - Pte->u.Flush.NoExecute = (Protection & PAGE_EXECUTE_ANY) ? 0 : 1; -} - -/* FUNCTIONS ***************************************************************/ - -PFN_NUMBER -NTAPI -MmGetPfnForProcess(PEPROCESS Process, - PVOID Address) -{ - MMPTE Pte; - Pte.u.Long = MiGetPteValueForProcess(Process, Address); - return Pte.u.Hard.Valid ? Pte.u.Hard.PageFrameNumber : 0; -} - -BOOLEAN -NTAPI -MmIsPagePresent(PEPROCESS Process, PVOID Address) -{ - MMPTE Pte; - Pte.u.Long = MiGetPteValueForProcess(Process, Address); - return (BOOLEAN)Pte.u.Hard.Valid; -} - -BOOLEAN -NTAPI -MmIsDisabledPage(PEPROCESS Process, PVOID Address) -{ - MMPTE Pte; - Pte.u.Long = MiGetPteValueForProcess(Process, Address); - - return (Pte.u.Hard.Valid == 0) && - (Pte.u.Trans.Transition == 0) && - (Pte.u.Hard.PageFrameNumber != 0); -} - -BOOLEAN -NTAPI -MmIsPageSwapEntry(PEPROCESS Process, PVOID Address) -{ - MMPTE Pte; - Pte.u.Long = MiGetPteValueForProcess(Process, Address); - return !Pte.u.Hard.Valid && Pte.u.Soft.Transition; -} - -VOID -NTAPI -MmGetPageFileMapping( - PEPROCESS Process, - PVOID Address, - SWAPENTRY* SwapEntry) -{ - PMMPTE PointerPte; - - ASSERT(Process == PsGetCurrentProcess()); - - PointerPte = MiAddressToPte(Address); - *SwapEntry = PointerPte->u.Long >> 1; -} - -BOOLEAN -NTAPI -MmIsDirtyPage(PEPROCESS Process, PVOID Address) -{ - MMPTE Pte; - Pte.u.Long = MiGetPteValueForProcess(Process, Address); - return Pte.u.Hard.Valid && Pte.u.Hard.Dirty; -} - -ULONG -NTAPI -MmGetPageProtect(PEPROCESS Process, PVOID Address) -{ - MMPTE Pte; - - Pte.u.Long = MiGetPteValueForProcess(Process, Address); - - return MiGetPteProtection(Pte); -} - -VOID -NTAPI -MmSetPageProtect(PEPROCESS Process, PVOID Address, ULONG flProtect) -{ - PMMPTE Pte; - MMPTE NewPte; - KIRQL OldIrql; - - Pte = MiGetPteForProcess(Process, Address, FALSE, &OldIrql); - ASSERT(Pte != NULL); - - NewPte = *Pte; - - MiSetPteProtection(&NewPte, flProtect); - - InterlockedExchangePte(Pte, NewPte); - - MiFlushTlb(Pte, Address, OldIrql); -} - -VOID -NTAPI -MmSetCleanPage(PEPROCESS Process, PVOID Address) -{ - PMMPTE Pte; - KIRQL OldIrql; - - Pte = MiGetPteForProcess(Process, Address, FALSE, &OldIrql); - if (!Pte) - { - KeBugCheckEx(MEMORY_MANAGEMENT, 0x1234, (ULONG64)Address, 0, 0); - } - - /* Ckear the dirty bit */ - if (InterlockedBitTestAndReset64((PVOID)Pte, 6)) - { - if (!MiIsHyperspaceAddress(Pte)) - __invlpg(Address); - } - - MiFlushTlb(Pte, Address, OldIrql); -} - -VOID -NTAPI -MmSetDirtyPage(PEPROCESS Process, PVOID Address) -{ - PMMPTE Pte; - KIRQL OldIrql; - - Pte = MiGetPteForProcess(Process, Address, FALSE, &OldIrql); - if (!Pte) - { - KeBugCheckEx(MEMORY_MANAGEMENT, 0x1234, (ULONG64)Address, 0, 0); - } - - /* Ckear the dirty bit */ - if (InterlockedBitTestAndSet64((PVOID)Pte, 6)) - { - if (!MiIsHyperspaceAddress(Pte)) - __invlpg(Address); - } - - MiFlushTlb(Pte, Address, OldIrql); -} - -VOID -NTAPI -MmDeleteVirtualMapping( - PEPROCESS Process, - PVOID Address, - BOOLEAN* WasDirty, - PPFN_NUMBER Page) -{ - PFN_NUMBER Pfn; - PMMPTE Pte; - MMPTE OldPte; - KIRQL OldIrql; - - Pte = MiGetPteForProcess(Process, Address, FALSE, &OldIrql); - - if (Pte) - { - /* Atomically set the entry to zero and get the old value. */ - OldPte.u.Long = InterlockedExchange64((LONG64*)&Pte->u.Long, 0); - - if (OldPte.u.Hard.Valid) - { - Pfn = OldPte.u.Hard.PageFrameNumber; - } - else - Pfn = 0; - } - else - { - OldPte.u.Long = 0; - Pfn = 0; - } - - /* Return information to the caller */ - if (WasDirty) - *WasDirty = (BOOLEAN)OldPte.u.Hard.Dirty; - - if (Page) - *Page = Pfn; - - MiFlushTlb(Pte, Address, OldIrql); -} - -VOID -NTAPI -MmDeletePageFileMapping(PEPROCESS Process, PVOID Address, - SWAPENTRY* SwapEntry) -{ - PMMPTE Pte; - KIRQL OldIrql; - - Pte = MiGetPteForProcess(Process, Address, FALSE, &OldIrql); - if (Pte == NULL) - { - *SwapEntry = 0; - return; - } - - if (Pte->u.Trans.Valid || !Pte->u.Trans.Transition) - { - DPRINT1("Pte %x (want not 1 and 0x800)\n", Pte); - KeBugCheck(MEMORY_MANAGEMENT); - } - - *SwapEntry = Pte->u.Long >> 1; - MI_ERASE_PTE(Pte); - - if (MiIsHyperspaceAddress(Pte)) - MiUnmapPageInHyperSpace(PsGetCurrentProcess(), (PVOID)PAGE_ROUND_DOWN(Pte), OldIrql); -} - -NTSTATUS -NTAPI -MmCreatePageFileMapping(PEPROCESS Process, - PVOID Address, - SWAPENTRY SwapEntry) -{ - PMMPTE Pte; - MMPTE PteValue; - KIRQL OldIrql; - - if (Process == NULL && Address < MmSystemRangeStart) - { - DPRINT1("No process\n"); - KeBugCheck(MEMORY_MANAGEMENT); - } - if (Process != NULL && Address >= MmSystemRangeStart) - { - DPRINT1("Setting kernel address with process context\n"); - KeBugCheck(MEMORY_MANAGEMENT); - } - - if (SwapEntry & (1ull << 63)) - { - KeBugCheck(MEMORY_MANAGEMENT); - } - - /* Allocate a PTE */ - Pte = MiGetPteForProcess(Process, Address, TRUE, &OldIrql); - if (Pte == NULL) - { - return STATUS_UNSUCCESSFUL; - } - - NT_ASSERT(Pte->u.Long == 0); - PteValue.u.Long = SwapEntry << 1; - MI_WRITE_INVALID_PTE(Pte, PteValue); - - if (MiIsHyperspaceAddress(Pte)) - MiUnmapPageInHyperSpace(PsGetCurrentProcess(), (PVOID)PAGE_ROUND_DOWN(Pte), OldIrql); - - return STATUS_UNSUCCESSFUL; -} - - -NTSTATUS -NTAPI -MmCreateVirtualMappingUnsafe( - PEPROCESS Process, - PVOID Address, - ULONG PageProtection, - PPFN_NUMBER Pages, - ULONG PageCount) -{ - ULONG i; - MMPTE TmplPte, *Pte; - - ASSERT((ULONG_PTR)Address % PAGE_SIZE == 0); - - /* Check if the range is valid */ - if ((Process == NULL && Address < MmSystemRangeStart) || - (Process != NULL && Address > MmHighestUserAddress)) - { - DPRINT1("Address 0x%p is invalid for process %p\n", Address, Process); - ASSERT(FALSE); - } - - TmplPte.u.Long = 0; - TmplPte.u.Hard.Valid = 1; - MiSetPteProtection(&TmplPte, PageProtection); - - TmplPte.u.Flush.Owner = (Address < MmHighestUserAddress) ? 1 : 0; - -//__debugbreak(); - - for (i = 0; i < PageCount; i++) - { - KIRQL OldIrql; - - TmplPte.u.Hard.PageFrameNumber = Pages[i]; - - Pte = MiGetPteForProcess(Process, Address, TRUE, &OldIrql); - -DPRINT("MmCreateVirtualMappingUnsafe, Address=%p, TmplPte=%p, Pte=%p\n", - Address, TmplPte.u.Long, Pte); - - if (InterlockedExchangePte(Pte, TmplPte)) - { - KeInvalidateTlbEntry(Address); - } - - if (MiIsHyperspaceAddress(Pte)) - MiUnmapPageInHyperSpace(PsGetCurrentProcess(), (PVOID)PAGE_ROUND_DOWN(Pte), OldIrql); - - Address = (PVOID)((ULONG64)Address + PAGE_SIZE); - } - - - return STATUS_SUCCESS; -} - -NTSTATUS -NTAPI -MmCreateVirtualMapping(PEPROCESS Process, - PVOID Address, - ULONG Protect, - PPFN_NUMBER Pages, - ULONG PageCount) -{ - ULONG i; - - ASSERT((ULONG_PTR)Address % PAGE_SIZE == 0); - - for (i = 0; i < PageCount; i++) - { - if (!MmIsPageInUse(Pages[i])) - { - DPRINT1("Page %x not in use\n", Pages[i]); - KeBugCheck(MEMORY_MANAGEMENT); - } - } - - return MmCreateVirtualMappingUnsafe(Process, Address, Protect, Pages, PageCount); -} - -/* EOF */ diff --git a/ntoskrnl/ntos.cmake b/ntoskrnl/ntos.cmake index d3349f9f808..c392bcd95ec 100644 --- a/ntoskrnl/ntos.cmake +++ b/ntoskrnl/ntos.cmake @@ -328,6 +328,7 @@ elseif(ARCH STREQUAL "amd64") ${REACTOS_SOURCE_DIR}/ntoskrnl/ke/amd64/usercall_asm.S) list(APPEND SOURCE ${REACTOS_SOURCE_DIR}/ntoskrnl/config/i386/cmhardwr.c + ${REACTOS_SOURCE_DIR}/ntoskrnl/mm/i386/page.c ${REACTOS_SOURCE_DIR}/ntoskrnl/kd64/amd64/kdx64.c ${REACTOS_SOURCE_DIR}/ntoskrnl/ke/amd64/context.c ${REACTOS_SOURCE_DIR}/ntoskrnl/ke/amd64/cpu.c @@ -339,7 +340,6 @@ elseif(ARCH STREQUAL "amd64") ${REACTOS_SOURCE_DIR}/ntoskrnl/ke/amd64/spinlock.c ${REACTOS_SOURCE_DIR}/ntoskrnl/ke/amd64/thrdini.c ${REACTOS_SOURCE_DIR}/ntoskrnl/mm/amd64/init.c - ${REACTOS_SOURCE_DIR}/ntoskrnl/mm/amd64/page.c ${REACTOS_SOURCE_DIR}/ntoskrnl/mm/amd64/procsup.c ${REACTOS_SOURCE_DIR}/ntoskrnl/ps/amd64/psctx.c ${REACTOS_SOURCE_DIR}/ntoskrnl/ke/amd64/stubs.c
3 years, 8 months
1
0
0
0
[reactos] 10/12: [NTOS:MM] Split MmCreateProcessAddressSpace in two parts
by Jérôme Gardou
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=7ea8312617df0219277b7…
commit 7ea8312617df0219277b73e84d4452cb2f9f3caf Author: Jérôme Gardou <jerome.gardou(a)reactos.org> AuthorDate: Thu Apr 1 15:54:19 2021 +0200 Commit: Jérôme Gardou <zefklop(a)users.noreply.github.com> CommitDate: Thu Apr 8 15:40:37 2021 +0200 [NTOS:MM] Split MmCreateProcessAddressSpace in two parts Generic one and arch-specific one. Properly fail if we are out of resources. Restore a lost assert. --- ntoskrnl/include/internal/mm.h | 7 ++ ntoskrnl/mm/ARM3/procsup.c | 141 ++++++++++++----------------------------- ntoskrnl/mm/amd64/page.c | 131 -------------------------------------- ntoskrnl/mm/amd64/procsup.c | 132 ++++++++++++++++++++++++++++++++++++++ ntoskrnl/mm/i386/procsup.c | 98 ++++++++++++++++++++++++++++ ntoskrnl/ntos.cmake | 2 + 6 files changed, 279 insertions(+), 232 deletions(-) diff --git a/ntoskrnl/include/internal/mm.h b/ntoskrnl/include/internal/mm.h index d2cb0123bed..6f9d6f57f40 100644 --- a/ntoskrnl/include/internal/mm.h +++ b/ntoskrnl/include/internal/mm.h @@ -1205,6 +1205,13 @@ MmDeleteVirtualMapping( PPFN_NUMBER Page ); +/* arch/procsup.c ************************************************************/ + +BOOLEAN +MiArchCreateProcessAddressSpace( + _In_ PEPROCESS Process, + _In_ PULONG_PTR DirectoryTableBase); + /* wset.c ********************************************************************/ NTSTATUS diff --git a/ntoskrnl/mm/ARM3/procsup.c b/ntoskrnl/mm/ARM3/procsup.c index eb8e68180d4..23981bcadf1 100644 --- a/ntoskrnl/mm/ARM3/procsup.c +++ b/ntoskrnl/mm/ARM3/procsup.c @@ -999,18 +999,24 @@ MmInitializeProcessAddressSpace(IN PEPROCESS Process, /* Do the same for hyperspace */ PointerPde = MiAddressToPde((PVOID)HYPER_SPACE); PageFrameNumber = PFN_FROM_PTE(PointerPde); - //ASSERT(Process->Pcb.DirectoryTableBase[0] == PageFrameNumber * PAGE_SIZE); // we're not lucky MiInitializePfn(PageFrameNumber, (PMMPTE)PointerPde, TRUE); +#if (_MI_PAGING_LEVELS == 2) + ASSERT(Process->Pcb.DirectoryTableBase[1] == PageFrameNumber * PAGE_SIZE); +#endif #if (_MI_PAGING_LEVELS >= 3) PointerPpe = MiAddressToPpe((PVOID)HYPER_SPACE); PageFrameNumber = PFN_FROM_PTE(PointerPpe); MiInitializePfn(PageFrameNumber, PointerPpe, TRUE); +#if (_MI_PAGING_LEVELS == 3) + ASSERT(Process->Pcb.DirectoryTableBase[1] == PageFrameNumber * PAGE_SIZE); +#endif #endif #if (_MI_PAGING_LEVELS == 4) PointerPxe = MiAddressToPxe((PVOID)HYPER_SPACE); PageFrameNumber = PFN_FROM_PTE(PointerPxe); MiInitializePfn(PageFrameNumber, PointerPxe, TRUE); + ASSERT(Process->Pcb.DirectoryTableBase[1] == PageFrameNumber * PAGE_SIZE); #endif /* Setup the PFN for the PTE for the working set */ @@ -1149,8 +1155,6 @@ MmInitializeHandBuiltProcess2(IN PEPROCESS Process) return STATUS_SUCCESS; } -#ifdef _M_IX86 -/* FIXME: Evaluate ways to make this portable yet arch-specific */ BOOLEAN NTAPI MmCreateProcessAddressSpace(IN ULONG MinWs, @@ -1158,13 +1162,13 @@ MmCreateProcessAddressSpace(IN ULONG MinWs, OUT PULONG_PTR DirectoryTableBase) { KIRQL OldIrql; - PFN_NUMBER PdeIndex, HyperIndex, WsListIndex; - PMMPTE PointerPte; - MMPTE TempPte, PdePte; - ULONG PdeOffset; - PMMPTE SystemTable, HyperTable; + PFN_NUMBER TableBaseIndex, HyperIndex, WsListIndex; ULONG Color; - PMMPFN Pfn1; + + /* Make sure we don't already have a page directory setup */ + ASSERT(Process->Pcb.DirectoryTableBase[0] == 0); + ASSERT(Process->Pcb.DirectoryTableBase[1] == 0); + ASSERT(Process->WorkingSetPage == 0); /* Choose a process color */ Process->NextPageColor = (USHORT)RtlRandom(&MmProcessColorSeed); @@ -1175,22 +1179,25 @@ MmCreateProcessAddressSpace(IN ULONG MinWs, /* Lock PFN database */ OldIrql = MiAcquirePfnLock(); - /* Get a zero page for the PDE, if possible */ + /* + * Get a page for the table base, one for hyper space & one for the working set list. + * The PFNs for these pages will be initialized in MmInitializeProcessAddressSpace, + * when we are already attached to the process. + * The other pages (if any) are allocated in the arch-specific part. + */ Color = MI_GET_NEXT_PROCESS_COLOR(Process); MI_SET_USAGE(MI_USAGE_PAGE_DIRECTORY); - PdeIndex = MiRemoveZeroPageSafe(Color); - if (!PdeIndex) + TableBaseIndex = MiRemoveZeroPageSafe(Color); + if (!TableBaseIndex) { /* No zero pages, grab a free one */ - PdeIndex = MiRemoveAnyPage(Color); + TableBaseIndex = MiRemoveAnyPage(Color); /* Zero it outside the PFN lock */ MiReleasePfnLock(OldIrql); - MiZeroPhysicalPage(PdeIndex); + MiZeroPhysicalPage(TableBaseIndex); OldIrql = MiAcquirePfnLock(); } - - /* Get a zero page for hyperspace, if possible */ MI_SET_USAGE(MI_USAGE_PAGE_DIRECTORY); Color = MI_GET_NEXT_PROCESS_COLOR(Process); HyperIndex = MiRemoveZeroPageSafe(Color); @@ -1204,8 +1211,6 @@ MmCreateProcessAddressSpace(IN ULONG MinWs, MiZeroPhysicalPage(HyperIndex); OldIrql = MiAcquirePfnLock(); } - - /* Get a zero page for the woring set list, if possible */ MI_SET_USAGE(MI_USAGE_PAGE_TABLE); Color = MI_GET_NEXT_PROCESS_COLOR(Process); WsListIndex = MiRemoveZeroPageSafe(Color); @@ -1224,99 +1229,33 @@ MmCreateProcessAddressSpace(IN ULONG MinWs, MiReleasePfnLock(OldIrql); } - /* Switch to phase 1 initialization */ - ASSERT(Process->AddressSpaceInitialized == 0); - Process->AddressSpaceInitialized = 1; - /* Set the base directory pointers */ Process->WorkingSetPage = WsListIndex; - DirectoryTableBase[0] = PdeIndex << PAGE_SHIFT; + DirectoryTableBase[0] = TableBaseIndex << PAGE_SHIFT; DirectoryTableBase[1] = HyperIndex << PAGE_SHIFT; - /* Make sure we don't already have a page directory setup */ - ASSERT(Process->Pcb.DirectoryTableBase[0] == 0); - - /* Get a PTE to map hyperspace */ - PointerPte = MiReserveSystemPtes(1, SystemPteSpace); - ASSERT(PointerPte != NULL); - - /* Build it */ - MI_MAKE_HARDWARE_PTE_KERNEL(&PdePte, - PointerPte, - MM_READWRITE, - HyperIndex); - - /* Set it dirty and map it */ - MI_MAKE_DIRTY_PAGE(&PdePte); - MI_WRITE_VALID_PTE(PointerPte, PdePte); - - /* Now get hyperspace's page table */ - HyperTable = MiPteToAddress(PointerPte); - - /* Now write the PTE/PDE entry for the working set list index itself */ - TempPte = ValidKernelPteLocal; - TempPte.u.Hard.PageFrameNumber = WsListIndex; - PdeOffset = MiAddressToPteOffset(MmWorkingSetList); - HyperTable[PdeOffset] = TempPte; - - /* Let go of the system PTE */ - MiReleaseSystemPtes(PointerPte, 1, SystemPteSpace); - - /* Save the PTE address of the page directory itself */ - Pfn1 = MiGetPfnEntry(PdeIndex); - Pfn1->PteAddress = (PMMPTE)PDE_BASE; - - /* Insert us into the Mm process list */ - OldIrql = MiAcquireExpansionLock(); - InsertTailList(&MmProcessList, &Process->MmProcessLinks); - MiReleaseExpansionLock(OldIrql); - - /* Get a PTE to map the page directory */ - PointerPte = MiReserveSystemPtes(1, SystemPteSpace); - ASSERT(PointerPte != NULL); - - /* Build it */ - MI_MAKE_HARDWARE_PTE_KERNEL(&PdePte, - PointerPte, - MM_READWRITE, - PdeIndex); - - /* Set it dirty and map it */ - MI_MAKE_DIRTY_PAGE(&PdePte); - MI_WRITE_VALID_PTE(PointerPte, PdePte); - - /* Now get the page directory (which we'll double map, so call it a page table */ - SystemTable = MiPteToAddress(PointerPte); - - /* Copy all the kernel mappings */ - PdeOffset = MiGetPdeOffset(MmSystemRangeStart); - RtlCopyMemory(&SystemTable[PdeOffset], - MiAddressToPde(MmSystemRangeStart), - PAGE_SIZE - PdeOffset * sizeof(MMPTE)); - - /* Now write the PTE/PDE entry for hyperspace itself */ - TempPte = ValidKernelPteLocal; - TempPte.u.Hard.PageFrameNumber = HyperIndex; - PdeOffset = MiGetPdeOffset(HYPER_SPACE); - SystemTable[PdeOffset] = TempPte; - - /* Sanity check */ - PdeOffset++; - ASSERT(MiGetPdeOffset(MmHyperSpaceEnd) >= PdeOffset); - - /* Now do the x86 trick of making the PDE a page table itself */ - PdeOffset = MiGetPdeOffset(PTE_BASE); - TempPte.u.Hard.PageFrameNumber = PdeIndex; - SystemTable[PdeOffset] = TempPte; + /* Perform the arch-specific parts */ + if (!MiArchCreateProcessAddressSpace(Process, DirectoryTableBase)) + { + OldIrql = MiAcquirePfnLock(); + MiInsertPageInFreeList(WsListIndex); + MiInsertPageInFreeList(HyperIndex); + MiInsertPageInFreeList(TableBaseIndex); + MiReleasePfnLock(OldIrql); + Process->WorkingSetPage = 0; + DirectoryTableBase[0] = 0; + DirectoryTableBase[1] = 0; + return FALSE; + } - /* Let go of the system PTE */ - MiReleaseSystemPtes(PointerPte, 1, SystemPteSpace); + /* Switch to phase 1 initialization */ + ASSERT(Process->AddressSpaceInitialized == 0); + Process->AddressSpaceInitialized = 1; /* Add the process to the session */ MiSessionAddProcess(Process); return TRUE; } -#endif VOID NTAPI diff --git a/ntoskrnl/mm/amd64/page.c b/ntoskrnl/mm/amd64/page.c index 90a5d74b3b2..3a3c3e4c89a 100644 --- a/ntoskrnl/mm/amd64/page.c +++ b/ntoskrnl/mm/amd64/page.c @@ -618,135 +618,4 @@ MmCreateVirtualMapping(PEPROCESS Process, return MmCreateVirtualMappingUnsafe(Process, Address, Protect, Pages, PageCount); } -BOOLEAN -NTAPI -MmCreateProcessAddressSpace(IN ULONG MinWs, - IN PEPROCESS Process, - OUT PULONG_PTR DirectoryTableBase) -{ - KIRQL OldIrql; - PFN_NUMBER TableBasePfn, HyperPfn, HyperPdPfn, HyperPtPfn, WorkingSetPfn; - PMMPTE SystemPte; - MMPTE TempPte, PdePte; - ULONG TableIndex; - PMMPTE PageTablePointer; - - /* Make sure we don't already have a page directory setup */ - ASSERT(Process->Pcb.DirectoryTableBase[0] == 0); - ASSERT(Process->Pcb.DirectoryTableBase[1] == 0); - ASSERT(Process->WorkingSetPage == 0); - - /* Choose a process color */ - Process->NextPageColor = (USHORT)RtlRandom(&MmProcessColorSeed); - - /* Setup the hyperspace lock */ - KeInitializeSpinLock(&Process->HyperSpaceLock); - - /* Lock PFN database */ - OldIrql = MiAcquirePfnLock(); - - /* Get a page for the table base and one for hyper space. The PFNs for - these pages will be initialized in MmInitializeProcessAddressSpace, - when we are already attached to the process. */ - TableBasePfn = MiRemoveAnyPage(MI_GET_NEXT_PROCESS_COLOR(Process)); - HyperPfn = MiRemoveAnyPage(MI_GET_NEXT_PROCESS_COLOR(Process)); - HyperPdPfn = MiRemoveAnyPage(MI_GET_NEXT_PROCESS_COLOR(Process)); - HyperPtPfn = MiRemoveAnyPage(MI_GET_NEXT_PROCESS_COLOR(Process)); - WorkingSetPfn = MiRemoveAnyPage(MI_GET_NEXT_PROCESS_COLOR(Process)); - - /* Release PFN lock */ - MiReleasePfnLock(OldIrql); - - /* Zero pages */ - MiZeroPhysicalPage(TableBasePfn); - MiZeroPhysicalPage(HyperPfn); - MiZeroPhysicalPage(HyperPdPfn); - MiZeroPhysicalPage(HyperPtPfn); - MiZeroPhysicalPage(WorkingSetPfn); - - /* Set the base directory pointers */ - Process->WorkingSetPage = WorkingSetPfn; - DirectoryTableBase[0] = TableBasePfn << PAGE_SHIFT; - DirectoryTableBase[1] = HyperPfn << PAGE_SHIFT; - - /* Get a PTE to map the page directory */ - SystemPte = MiReserveSystemPtes(1, SystemPteSpace); - ASSERT(SystemPte != NULL); - - /* Get its address */ - PageTablePointer = MiPteToAddress(SystemPte); - - /* Build the PTE for the page directory and map it */ - PdePte = ValidKernelPte; - PdePte.u.Hard.PageFrameNumber = TableBasePfn; - *SystemPte = PdePte; - -/// architecture specific - //MiInitializePageDirectoryForProcess( - - /* Copy the kernel mappings and zero out the rest */ - TableIndex = PXE_PER_PAGE / 2; - RtlZeroMemory(PageTablePointer, TableIndex * sizeof(MMPTE)); - RtlCopyMemory(PageTablePointer + TableIndex, - MiAddressToPxe(0) + TableIndex, - PAGE_SIZE - TableIndex * sizeof(MMPTE)); - - /* Sanity check */ - ASSERT(MiAddressToPxi(MmHyperSpaceEnd) >= TableIndex); - - /* Setup a PTE for the page directory mappings */ - TempPte = ValidKernelPte; - - /* Update the self mapping of the PML4 */ - TableIndex = MiAddressToPxi((PVOID)PXE_SELFMAP); - TempPte.u.Hard.PageFrameNumber = TableBasePfn; - PageTablePointer[TableIndex] = TempPte; - - /* Write the PML4 entry for hyperspace */ - TableIndex = MiAddressToPxi((PVOID)HYPER_SPACE); - TempPte.u.Hard.PageFrameNumber = HyperPfn; - PageTablePointer[TableIndex] = TempPte; - - /* Map the hyperspace PDPT to the system PTE */ - PdePte.u.Hard.PageFrameNumber = HyperPfn; - *SystemPte = PdePte; - __invlpg(PageTablePointer); - - /* Write the hyperspace entry for the first PD */ - TempPte.u.Hard.PageFrameNumber = HyperPdPfn; - PageTablePointer[0] = TempPte; - - /* Map the hyperspace PD to the system PTE */ - PdePte.u.Hard.PageFrameNumber = HyperPdPfn; - *SystemPte = PdePte; - __invlpg(PageTablePointer); - - /* Write the hyperspace entry for the first PT */ - TempPte.u.Hard.PageFrameNumber = HyperPtPfn; - PageTablePointer[0] = TempPte; - - /* Map the hyperspace PT to the system PTE */ - PdePte.u.Hard.PageFrameNumber = HyperPtPfn; - *SystemPte = PdePte; - __invlpg(PageTablePointer); - - /* Write the hyperspace PTE for the working set list index */ - TempPte.u.Hard.PageFrameNumber = WorkingSetPfn; - TableIndex = MiAddressToPti(MmWorkingSetList); - PageTablePointer[TableIndex] = TempPte; - -/// end architecture specific - - /* Release the system PTE */ - MiReleaseSystemPtes(SystemPte, 1, SystemPteSpace); - - /* Switch to phase 1 initialization */ - ASSERT(Process->AddressSpaceInitialized == 0); - Process->AddressSpaceInitialized = 1; - - /* Add the process to the session */ - MiSessionAddProcess(Process); - return TRUE; -} - /* EOF */ diff --git a/ntoskrnl/mm/amd64/procsup.c b/ntoskrnl/mm/amd64/procsup.c new file mode 100644 index 00000000000..4cde151fb9e --- /dev/null +++ b/ntoskrnl/mm/amd64/procsup.c @@ -0,0 +1,132 @@ +/* + * COPYRIGHT: GPL, See COPYING in the top level directory + * PROJECT: ReactOS kernel + * FILE: ntoskrnl/mm/amd64/procsup.c + * PURPOSE: Low level memory managment manipulation + * + * PROGRAMMER: Timo Kreuzer (timo.kreuzer(a)reactos.org) + * ReactOS Portable Systems Group + */ + +/* INCLUDES *******************************************************************/ + +#include <ntoskrnl.h> +#define NDEBUG +#include <debug.h> + +#define MODULE_INVOLVED_IN_ARM3 +#include <mm/ARM3/miarm.h> + +BOOLEAN +MiArchCreateProcessAddressSpace( + _In_ PEPROCESS Process, + _In_ PULONG_PTR DirectoryTableBase) +{ + KIRQL OldIrql; + PFN_NUMBER TableBasePfn, HyperPfn, HyperPdPfn, HyperPtPfn; + PMMPTE SystemPte; + MMPTE TempPte, PdePte; + ULONG TableIndex; + PMMPTE PageTablePointer; + ULONG PageColor; + + /* Non-arch specific code-path allocated those for us */ + TableBasePfn = DirectoryTableBase[0] >> PAGE_SHIFT; + HyperPfn = DirectoryTableBase[1] >> PAGE_SHIFT; + + /* + * Lock PFN database. Try getting zero pages. + * If that doesn't work, we take the slow path + * outside of the PFN lock. + */ + OldIrql = MiAcquirePfnLock(); + PageColor = MI_GET_NEXT_PROCESS_COLOR(Process); + HyperPdPfn = MiRemoveZeroPageSafe(PageColor); + if(!HyperPdPfn) + { + HyperPdPfn = MiRemoveAnyPage(PageColor); + MiReleasePfnLock(OldIrql); + MiZeroPhysicalPage(HyperPdPfn); + OldIrql = MiAcquirePfnLock(); + } + PageColor = MI_GET_NEXT_PROCESS_COLOR(Process); + HyperPtPfn = MiRemoveZeroPageSafe(PageColor); + if(!HyperPtPfn) + { + HyperPtPfn = MiRemoveAnyPage(PageColor); + MiReleasePfnLock(OldIrql); + MiZeroPhysicalPage(HyperPtPfn); + } + else + { + MiReleasePfnLock(OldIrql); + } + + /* Get a PTE to map the page directory */ + SystemPte = MiReserveSystemPtes(1, SystemPteSpace); + if (!SystemPte) + return FALSE; + + /* Get its address */ + PageTablePointer = MiPteToAddress(SystemPte); + + /* Build the PTE for the page directory and map it */ + MI_MAKE_HARDWARE_PTE_KERNEL(&PdePte, SystemPte, MM_READWRITE, TableBasePfn); + MI_WRITE_VALID_PTE(SystemPte, PdePte); + + /* Copy the kernel mappings and zero out the rest */ + TableIndex = PXE_PER_PAGE / 2; + RtlZeroMemory(PageTablePointer, TableIndex * sizeof(MMPTE)); + RtlCopyMemory(PageTablePointer + TableIndex, + MiAddressToPxe(0) + TableIndex, + PAGE_SIZE - TableIndex * sizeof(MMPTE)); + + /* Sanity check */ + ASSERT(MiAddressToPxi(MmHyperSpaceEnd) >= TableIndex); + + /* Setup a PTE for the page directory mappings */ + TempPte = ValidKernelPte; + + /* Update the self mapping of the PML4 */ + TableIndex = MiAddressToPxi((PVOID)PXE_SELFMAP); + TempPte.u.Hard.PageFrameNumber = TableBasePfn; + PageTablePointer[TableIndex] = TempPte; + + /* Write the PML4 entry for hyperspace */ + TableIndex = MiAddressToPxi((PVOID)HYPER_SPACE); + TempPte.u.Hard.PageFrameNumber = HyperPfn; + PageTablePointer[TableIndex] = TempPte; + + /* Map the hyperspace PDPT to the system PTE */ + PdePte.u.Hard.PageFrameNumber = HyperPfn; + *SystemPte = PdePte; + __invlpg(PageTablePointer); + + /* Write the hyperspace entry for the first PD */ + TempPte.u.Hard.PageFrameNumber = HyperPdPfn; + PageTablePointer[0] = TempPte; + + /* Map the hyperspace PD to the system PTE */ + PdePte.u.Hard.PageFrameNumber = HyperPdPfn; + *SystemPte = PdePte; + __invlpg(PageTablePointer); + + /* Write the hyperspace entry for the first PT */ + TempPte.u.Hard.PageFrameNumber = HyperPtPfn; + PageTablePointer[0] = TempPte; + + /* Map the hyperspace PT to the system PTE */ + PdePte.u.Hard.PageFrameNumber = HyperPtPfn; + *SystemPte = PdePte; + __invlpg(PageTablePointer); + + /* Write the hyperspace PTE for the working set list index */ + TempPte.u.Hard.PageFrameNumber = Process->WorkingSetPage; + TableIndex = MiAddressToPti(MmWorkingSetList); + PageTablePointer[TableIndex] = TempPte; + + /* Release the system PTE */ + MiReleaseSystemPtes(SystemPte, 1, SystemPteSpace); + + return TRUE; +} diff --git a/ntoskrnl/mm/i386/procsup.c b/ntoskrnl/mm/i386/procsup.c new file mode 100644 index 00000000000..8ffaec103c6 --- /dev/null +++ b/ntoskrnl/mm/i386/procsup.c @@ -0,0 +1,98 @@ +/* + * PROJECT: ReactOS Kernel + * LICENSE: BSD-3-Clause (
https://spdx.org/licenses/BSD-3-Clause.html
) + * FILE: ntoskrnl/mm/i386/procsup.c + * PURPOSE: Process handling for i386 architecture + * PROGRAMMERS: Jérôme Gardou + */ + +/* INCLUDES *******************************************************************/ + +#include <ntoskrnl.h> +#define NDEBUG +#include <debug.h> + +#define MODULE_INVOLVED_IN_ARM3 +#include <mm/ARM3/miarm.h> + +BOOLEAN +MiArchCreateProcessAddressSpace( + _In_ PEPROCESS Process, + _In_ PULONG_PTR DirectoryTableBase) +{ + PFN_NUMBER PdeIndex = DirectoryTableBase[0] >> PAGE_SHIFT; + PFN_NUMBER HyperIndex = DirectoryTableBase[1] >> PAGE_SHIFT; + PMMPTE PointerPte; + MMPTE PdePte, TempPte; + PMMPTE PteTable; + ULONG PdeOffset; + KIRQL OldIrql; + + /* Get a PTE */ + PointerPte = MiReserveSystemPtes(1, SystemPteSpace); + if (!PointerPte) + return FALSE; + PteTable = MiPteToAddress(PointerPte); + + /* Build a page table for hyper space */ + MI_MAKE_HARDWARE_PTE_KERNEL(&PdePte, + PointerPte, + MM_READWRITE, + HyperIndex); + + /* Set it dirty and map it */ + MI_MAKE_DIRTY_PAGE(&PdePte); + MI_WRITE_VALID_PTE(PointerPte, PdePte); + + /* Now write the PTE/PDE entry for the working set list index itself */ + TempPte = ValidKernelPteLocal; + TempPte.u.Hard.PageFrameNumber = Process->WorkingSetPage; + PdeOffset = MiAddressToPteOffset(MmWorkingSetList); + PteTable[PdeOffset] = TempPte; + + /* Now we map the page directory */ + MI_MAKE_HARDWARE_PTE_KERNEL(&PdePte, + PointerPte, + MM_READWRITE, + PdeIndex); + + /* Set it dirty and map it */ + MI_MAKE_DIRTY_PAGE(&PdePte); + *PointerPte = PdePte; + /* We changed the page! */ + __invlpg(PteTable); + + /* Now get the page directory (which we'll double map, so call it a page table) */ + PteTable = MiPteToAddress(PointerPte); + + /* Copy all the kernel mappings */ + PdeOffset = MiGetPdeOffset(MmSystemRangeStart); + RtlCopyMemory(&PteTable[PdeOffset], + MiAddressToPde(MmSystemRangeStart), + PAGE_SIZE - PdeOffset * sizeof(MMPTE)); + + /* Now write the PTE/PDE entry for hyperspace itself */ + TempPte = ValidKernelPteLocal; + TempPte.u.Hard.PageFrameNumber = HyperIndex; + PdeOffset = MiGetPdeOffset(HYPER_SPACE); + PteTable[PdeOffset] = TempPte; + + /* Sanity check */ + PdeOffset++; + ASSERT(MiGetPdeOffset(MmHyperSpaceEnd) >= PdeOffset); + + /* Now do the x86 trick of making the PDE a page table itself */ + PdeOffset = MiGetPdeOffset(PTE_BASE); + TempPte.u.Hard.PageFrameNumber = PdeIndex; + PteTable[PdeOffset] = TempPte; + + /* Let go of the system PTE */ + MiReleaseSystemPtes(PointerPte, 1, SystemPteSpace); + + /* Insert us into the Mm process list */ + OldIrql = MiAcquireExpansionLock(); + InsertTailList(&MmProcessList, &Process->MmProcessLinks); + MiReleaseExpansionLock(OldIrql); + + return TRUE; +} diff --git a/ntoskrnl/ntos.cmake b/ntoskrnl/ntos.cmake index 2a098336288..d3349f9f808 100644 --- a/ntoskrnl/ntos.cmake +++ b/ntoskrnl/ntos.cmake @@ -314,6 +314,7 @@ if(ARCH STREQUAL "i386") ${REACTOS_SOURCE_DIR}/ntoskrnl/ke/i386/usercall.c ${REACTOS_SOURCE_DIR}/ntoskrnl/ke/i386/v86vdm.c ${REACTOS_SOURCE_DIR}/ntoskrnl/mm/i386/page.c + ${REACTOS_SOURCE_DIR}/ntoskrnl/mm/i386/procsup.c ${REACTOS_SOURCE_DIR}/ntoskrnl/mm/ARM3/i386/init.c ${REACTOS_SOURCE_DIR}/ntoskrnl/ps/i386/psctx.c ${REACTOS_SOURCE_DIR}/ntoskrnl/ps/i386/psldt.c @@ -339,6 +340,7 @@ elseif(ARCH STREQUAL "amd64") ${REACTOS_SOURCE_DIR}/ntoskrnl/ke/amd64/thrdini.c ${REACTOS_SOURCE_DIR}/ntoskrnl/mm/amd64/init.c ${REACTOS_SOURCE_DIR}/ntoskrnl/mm/amd64/page.c + ${REACTOS_SOURCE_DIR}/ntoskrnl/mm/amd64/procsup.c ${REACTOS_SOURCE_DIR}/ntoskrnl/ps/amd64/psctx.c ${REACTOS_SOURCE_DIR}/ntoskrnl/ke/amd64/stubs.c ${REACTOS_SOURCE_DIR}/ntoskrnl/ke/amd64/usercall.c)
3 years, 8 months
1
0
0
0
[reactos] 09/12: [NTOS:MM] Properly track system process hyper space PDE page
by Jérôme Gardou
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=6c027d28f95fdbdc09ada…
commit 6c027d28f95fdbdc09ada6c0c7f5dc63b4cbe00b Author: Jérôme Gardou <jerome.gardou(a)reactos.org> AuthorDate: Thu Apr 8 14:36:50 2021 +0200 Commit: Jérôme Gardou <zefklop(a)users.noreply.github.com> CommitDate: Thu Apr 8 15:40:37 2021 +0200 [NTOS:MM] Properly track system process hyper space PDE page --- ntoskrnl/mm/ARM3/i386/init.c | 1 + 1 file changed, 1 insertion(+) diff --git a/ntoskrnl/mm/ARM3/i386/init.c b/ntoskrnl/mm/ARM3/i386/init.c index fce53bee2ee..4ad52cf2b80 100644 --- a/ntoskrnl/mm/ARM3/i386/init.c +++ b/ntoskrnl/mm/ARM3/i386/init.c @@ -498,6 +498,7 @@ MiInitMachineDependent(IN PLOADER_PARAMETER_BLOCK LoaderBlock) TempPde = ValidKernelPdeLocal; TempPde.u.Hard.PageFrameNumber = PageFrameIndex; MI_WRITE_VALID_PTE(StartPde, TempPde); + PsGetCurrentProcess()->Pcb.DirectoryTableBase[1] = PageFrameIndex << PAGE_SHIFT; /* Flush the TLB */ KeFlushCurrentTb();
3 years, 8 months
1
0
0
0
[reactos] 08/12: [NTOS:MM] Make i386/page.c usable for all x86 variants
by Jérôme Gardou
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=370982aa1d75240282b97…
commit 370982aa1d75240282b9778b4916342b63984cac Author: Jérôme Gardou <jerome.gardou(a)reactos.org> AuthorDate: Wed Apr 7 08:49:26 2021 +0200 Commit: Jérôme Gardou <zefklop(a)users.noreply.github.com> CommitDate: Thu Apr 8 15:40:37 2021 +0200 [NTOS:MM] Make i386/page.c usable for all x86 variants This includes PAE & amd64 --- ntoskrnl/mm/i386/page.c | 197 ++++++++++++++++++++++-------------------------- 1 file changed, 92 insertions(+), 105 deletions(-) diff --git a/ntoskrnl/mm/i386/page.c b/ntoskrnl/mm/i386/page.c index 8b3ed370e94..3e5f5797218 100644 --- a/ntoskrnl/mm/i386/page.c +++ b/ntoskrnl/mm/i386/page.c @@ -15,35 +15,13 @@ #include <mm/ARM3/miarm.h> -/* GLOBALS *****************************************************************/ - -#define PA_BIT_PRESENT (0) -#define PA_BIT_READWRITE (1) -#define PA_BIT_USER (2) -#define PA_BIT_WT (3) -#define PA_BIT_CD (4) -#define PA_BIT_ACCESSED (5) -#define PA_BIT_DIRTY (6) -#define PA_BIT_GLOBAL (8) - -#define PA_PRESENT (1 << PA_BIT_PRESENT) -#define PA_READWRITE (1 << PA_BIT_READWRITE) -#define PA_USER (1 << PA_BIT_USER) -#define PA_DIRTY (1 << PA_BIT_DIRTY) -#define PA_WT (1 << PA_BIT_WT) -#define PA_CD (1 << PA_BIT_CD) -#define PA_ACCESSED (1 << PA_BIT_ACCESSED) -#define PA_GLOBAL (1 << PA_BIT_GLOBAL) - -#define IS_HYPERSPACE(v) (((ULONG)(v) >= HYPER_SPACE && (ULONG)(v) <= HYPER_SPACE_END)) - -#define PTE_TO_PFN(X) ((X) >> PAGE_SHIFT) -#define PFN_TO_PTE(X) ((X) << PAGE_SHIFT) - -#define PAGE_MASK(x) ((x)&(~0xfff)) +#ifndef _MI_PAGING_LEVELS +#error "Dude, fix your stuff before using this file" +#endif +/* GLOBALS *****************************************************************/ const -ULONG +ULONG_PTR MmProtectToPteMask[32] = { // @@ -179,7 +157,7 @@ MmDeleteVirtualMapping(PEPROCESS Process, PVOID Address, */ { PMMPTE PointerPte; - ULONG Pte; + MMPTE OldPte; DPRINT("MmDeleteVirtualMapping(%p, %p, %p, %p)\n", Process, Address, WasDirty, Page); @@ -196,8 +174,11 @@ MmDeleteVirtualMapping(PEPROCESS Process, PVOID Address, DPRINT1("NULL process given for user-mode mapping at %p\n", Address); KeBugCheck(MEMORY_MANAGEMENT); } - +#if (_MI_PAGING_LEVELS == 2) if (!MiSynchronizeSystemPde(MiAddressToPde(Address))) +#else + if (!MiIsPdeForAddressValid(Address)) +#endif { /* There can't be a page if there is no PDE */ if (WasDirty) @@ -234,9 +215,9 @@ MmDeleteVirtualMapping(PEPROCESS Process, PVOID Address, } PointerPte = MiAddressToPte(Address); - Pte = InterlockedExchangePte(PointerPte, 0); + OldPte.u.Long = InterlockedExchangePte(PointerPte, 0); - if (Pte == 0) + if (OldPte.u.Long == 0) { /* There was nothing here */ if (Address < MmSystemRangeStart) @@ -249,9 +230,9 @@ MmDeleteVirtualMapping(PEPROCESS Process, PVOID Address, } /* It must have been present, or not a swap entry */ - ASSERT(FlagOn(Pte, PA_PRESENT) || !FlagOn(Pte, 0x800)); + ASSERT(OldPte.u.Hard.Valid || !FlagOn(OldPte.u.Long, 0x800)); - if (FlagOn(Pte, PA_PRESENT)) + if (OldPte.u.Hard.Valid) KeInvalidateTlbEntry(Address); if (Address < MmSystemRangeStart) @@ -269,9 +250,9 @@ MmDeleteVirtualMapping(PEPROCESS Process, PVOID Address, } if (WasDirty) - *WasDirty = FlagOn(Pte, PA_DIRTY); + *WasDirty = !!OldPte.u.Hard.Dirty; if (Page) - *Page = PTE_TO_PFN(Pte); + *Page = OldPte.u.Hard.PageFrameNumber; } @@ -283,7 +264,7 @@ MmDeletePageFileMapping( SWAPENTRY* SwapEntry) { PMMPTE PointerPte; - ULONG Pte; + MMPTE OldPte; /* This should not be called for kernel space anymore */ ASSERT(Process != NULL); @@ -304,10 +285,11 @@ MmDeletePageFileMapping( MiMakePdeExistAndMakeValid(MiAddressToPde(Address), Process, MM_NOIRQL); PointerPte = MiAddressToPte(Address); - Pte = InterlockedExchangePte(PointerPte, 0); - if (!FlagOn(Pte, 0x800) || FlagOn(Pte, PA_PRESENT)) + OldPte.u.Long = InterlockedExchangePte(PointerPte, 0); + /* This must be a swap entry ! */ + if (!FlagOn(OldPte.u.Long, 0x800) || OldPte.u.Hard.Valid) { - KeBugCheckEx(MEMORY_MANAGEMENT, Pte, (ULONG_PTR)Process, (ULONG_PTR)Address, 0); + KeBugCheckEx(MEMORY_MANAGEMENT, OldPte.u.Long, (ULONG_PTR)Process, (ULONG_PTR)Address, 0); } /* This used to be a non-zero PTE, now we can let the PDE go. */ @@ -322,22 +304,7 @@ MmDeletePageFileMapping( MiUnlockProcessWorkingSetUnsafe(Process, PsGetCurrentThread()); - *SwapEntry = Pte >> 1; -} - -BOOLEAN -Mmi386MakeKernelPageTableGlobal(PVOID Address) -{ - PMMPDE PointerPde = MiAddressToPde(Address); - PMMPTE PointerPte = MiAddressToPte(Address); - - if (PointerPde->u.Hard.Valid == 0) - { - if(!MiSynchronizeSystemPde(PointerPde)) - return FALSE; - return PointerPte->u.Hard.Valid != 0; - } - return FALSE; + *SwapEntry = OldPte.u.Long >> 1; } BOOLEAN @@ -349,7 +316,11 @@ MmIsPagePresent(PEPROCESS Process, PVOID Address) if (Address >= MmSystemRangeStart) { ASSERT(Process == NULL); +#if _MI_PAGING_LEVELS == 2 if (!MiSynchronizeSystemPde(MiAddressToPde(Address))) +#else + if (!MiIsPdeForAddressValid(Address)) +#endif { /* It can't be present if there is no PDE */ return FALSE; @@ -384,18 +355,20 @@ NTAPI MmIsDisabledPage(PEPROCESS Process, PVOID Address) { BOOLEAN Ret; - ULONG Pte; + PMMPTE PointerPte; if (Address >= MmSystemRangeStart) { ASSERT(Process == NULL); +#if _MI_PAGING_LEVELS == 2 if (!MiSynchronizeSystemPde(MiAddressToPde(Address))) +#else + if (!MiIsPdeForAddressValid(Address)) +#endif { /* It's not disabled if it's not present */ return FALSE; } - - Pte = MiAddressToPte(Address)->u.Long; } else { @@ -412,11 +385,12 @@ MmIsDisabledPage(PEPROCESS Process, PVOID Address) } MiMakePdeExistAndMakeValid(MiAddressToPde(Address), Process, MM_NOIRQL); - - Pte = MiAddressToPte(Address)->u.Long; } - Ret = !FlagOn(Pte, PA_PRESENT) && !FlagOn(Pte, 0x800) && (PAGE_MASK(Pte) != 0); + PointerPte = MiAddressToPte(Address); + Ret = !PointerPte->u.Hard.Valid + && !FlagOn(PointerPte->u.Long, 0x800) + && (PointerPte->u.Hard.PageFrameNumber != 0); if (Address < MmSystemRangeStart) MiUnlockProcessWorkingSetShared(Process, PsGetCurrentThread()); @@ -429,7 +403,7 @@ NTAPI MmIsPageSwapEntry(PEPROCESS Process, PVOID Address) { BOOLEAN Ret; - ULONG Pte; + PMMPTE PointerPte; /* We never set swap entries for kernel addresses */ if (Address >= MmSystemRangeStart) @@ -452,8 +426,8 @@ MmIsPageSwapEntry(PEPROCESS Process, PVOID Address) MiMakePdeExistAndMakeValid(MiAddressToPde(Address), Process, MM_NOIRQL); - Pte = MiAddressToPte(Address)->u.Long; - Ret = !FlagOn(Pte, PA_PRESENT) && FlagOn(Pte, 0x800); + PointerPte = MiAddressToPte(Address); + Ret = !PointerPte->u.Hard.Valid && FlagOn(PointerPte->u.Long, 0x800); MiUnlockProcessWorkingSetShared(Process, PsGetCurrentThread()); @@ -464,7 +438,7 @@ VOID NTAPI MmGetPageFileMapping(PEPROCESS Process, PVOID Address, SWAPENTRY* SwapEntry) { - ULONG Pte; + PMMPTE PointerPte; /* We never set swap entries for kernel addresses */ if (Address >= MmSystemRangeStart) @@ -489,9 +463,9 @@ MmGetPageFileMapping(PEPROCESS Process, PVOID Address, SWAPENTRY* SwapEntry) MiMakePdeExistAndMakeValid(MiAddressToPde(Address), Process, MM_NOIRQL); - Pte = MiAddressToPte(Address)->u.Long; - if (!FlagOn(Pte, PA_PRESENT) && FlagOn(Pte, 0x800)) - *SwapEntry = Pte >> 1; + PointerPte = MiAddressToPte(Address); + if (!PointerPte->u.Hard.Valid && FlagOn(PointerPte->u.Long, 0x800)) + *SwapEntry = PointerPte->u.Long >> 1; else *SwapEntry = 0; @@ -505,7 +479,7 @@ MmCreatePageFileMapping(PEPROCESS Process, SWAPENTRY SwapEntry) { PMMPTE PointerPte; - ULONG Pte; + ULONG_PTR Pte; /* This should not be called for kernel space anymore */ ASSERT(Process != NULL); @@ -571,8 +545,10 @@ MmCreateVirtualMappingUnsafe(PEPROCESS Process, DPRINT1("NULL process given for user-mode mapping at %p\n", Address); KeBugCheck(MEMORY_MANAGEMENT); } +#if _MI_PAGING_LEVELS == 2 if (!MiSynchronizeSystemPde(MiAddressToPde(Address))) MiFillSystemPageDirectory(Address, PAGE_SIZE); +#endif } else { @@ -631,7 +607,7 @@ MmCreateVirtualMapping(PEPROCESS Process, ASSERT((ULONG_PTR)Address % PAGE_SIZE == 0); if (!MmIsPageInUse(Page)) { - DPRINT1("Page at address %x not in use\n", PFN_TO_PTE(Page)); + DPRINT1("Page %lx is not in use\n", Page); KeBugCheck(MEMORY_MANAGEMENT); } @@ -642,15 +618,21 @@ ULONG NTAPI MmGetPageProtect(PEPROCESS Process, PVOID Address) { - ULONG_PTR Pte; + PMMPTE PointerPte; ULONG Protect; if (Address >= MmSystemRangeStart) { ASSERT(Process == NULL); +#if _MI_PAGING_LEVELS == 2 if (!MiSynchronizeSystemPde(MiAddressToPde(Address))) +#else + if (!MiIsPdeForAddressValid(Address)) +#endif + { return PAGE_NOACCESS; + } } else { @@ -671,34 +653,29 @@ MmGetPageProtect(PEPROCESS Process, PVOID Address) MiMakePdeExistAndMakeValid(MiAddressToPde(Address), Process, MM_NOIRQL); } - Pte = MiAddressToPte(Address)->u.Long; + PointerPte = MiAddressToPte(Address); - if (!(Pte & PA_PRESENT)) + if (!PointerPte->u.Flush.Valid) { Protect = PAGE_NOACCESS; } else { - if (Pte & PA_READWRITE) - { + if (PointerPte->u.Flush.CopyOnWrite) + Protect = PAGE_WRITECOPY; + else if (PointerPte->u.Flush.Write) Protect = PAGE_READWRITE; - } else - { - Protect = PAGE_EXECUTE_READ; - } - if (Pte & PA_CD) - { + Protect = PAGE_READONLY; +#if _MI_PAGING_LEVELS >= 3 + /* PAE & AMD64 long mode support NoExecute bit */ + if (!PointerPte->u.Flush.NoExecute) + Protect <<= 4; +#endif + if (PointerPte->u.Flush.CacheDisable) Protect |= PAGE_NOCACHE; - } - if (Pte & PA_WT) - { + if (PointerPte->u.Flush.WriteThrough) Protect |= PAGE_WRITETHROUGH; - } - if (!(Pte & PA_USER)) - { - Protect |= PAGE_SYSTEM; - } } if (Address < MmSystemRangeStart) @@ -713,8 +690,7 @@ MmSetPageProtect(PEPROCESS Process, PVOID Address, ULONG flProtect) { ULONG ProtectionMask; PMMPTE PointerPte; - MMPTE TempPte; - ULONG_PTR Pte; + MMPTE TempPte, OldPte; DPRINT("MmSetPageProtect(Process %p Address %p flProtect %x)\n", Process, Address, flProtect); @@ -739,16 +715,16 @@ MmSetPageProtect(PEPROCESS Process, PVOID Address, ULONG flProtect) TempPte.u.Hard.Accessed = PointerPte->u.Hard.Accessed; TempPte.u.Hard.Dirty = PointerPte->u.Hard.Dirty; - Pte = InterlockedExchangePte(PointerPte, TempPte.u.Long); + OldPte.u.Long = InterlockedExchangePte(PointerPte, TempPte.u.Long); // We should be able to bring a page back from PAGE_NOACCESS - if ((Pte & 0x800) || !(Pte >> PAGE_SHIFT)) + if (!OldPte.u.Hard.Valid && (FlagOn(OldPte.u.Long, 0x800) || (OldPte.u.Hard.PageFrameNumber == 0))) { - DPRINT1("Invalid Pte %lx\n", Pte); + DPRINT1("Invalid Pte %lx\n", OldPte.u.Long); KeBugCheck(MEMORY_MANAGEMENT); } - if (Pte != TempPte.u.Long) + if (OldPte.u.Long != TempPte.u.Long) KeInvalidateTlbEntry(Address); MiUnlockProcessWorkingSetUnsafe(Process, PsGetCurrentThread()); @@ -759,7 +735,6 @@ NTAPI MmSetDirtyBit(PEPROCESS Process, PVOID Address, BOOLEAN Bit) { PMMPTE PointerPte; - ULONG Pte; DPRINT("MmSetDirtyBit(Process %p Address %p Bit %x)\n", Process, Address, Bit); @@ -774,20 +749,15 @@ MmSetDirtyBit(PEPROCESS Process, PVOID Address, BOOLEAN Bit) MiMakePdeExistAndMakeValid(MiAddressToPde(Address), Process, MM_NOIRQL); PointerPte = MiAddressToPte(Address); - Pte = PointerPte->u.Long; - if (Bit) - Pte |= PA_DIRTY; - else - Pte &= ~PA_DIRTY; - Pte = InterlockedExchangePte(PointerPte, Pte); - // We shouldnl't set dirty bit on non-mapped adresses - if ((Pte & 0x800) || !(Pte >> PAGE_SHIFT)) + if (!PointerPte->u.Hard.Valid && (FlagOn(PointerPte->u.Long, 0x800) || (PointerPte->u.Hard.PageFrameNumber == 0))) { - DPRINT1("Invalid Pte %lx\n", Pte); + DPRINT1("Invalid Pte %lx\n", PointerPte->u.Long); KeBugCheck(MEMORY_MANAGEMENT); } + PointerPte->u.Hard.Dirty = !!Bit; + if (!Bit) KeInvalidateTlbEntry(Address); @@ -802,4 +772,21 @@ MmInitGlobalKernelPageDirectory(VOID) /* Nothing to do here */ } +#ifdef _M_IX86 +BOOLEAN +Mmi386MakeKernelPageTableGlobal(PVOID Address) +{ + PMMPDE PointerPde = MiAddressToPde(Address); + PMMPTE PointerPte = MiAddressToPte(Address); + + if (PointerPde->u.Hard.Valid == 0) + { + if (!MiSynchronizeSystemPde(PointerPde)) + return FALSE; + return PointerPte->u.Hard.Valid != 0; + } + return FALSE; +} +#endif + /* EOF */
3 years, 8 months
1
0
0
0
[reactos] 07/12: [NDK] Define NX bit in X86PAE PTE struct
by Jérôme Gardou
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=6d957d69583972489a950…
commit 6d957d69583972489a9506c678821abe017d676d Author: Jérôme Gardou <jerome.gardou(a)reactos.org> AuthorDate: Wed Apr 7 08:49:07 2021 +0200 Commit: Jérôme Gardou <zefklop(a)users.noreply.github.com> CommitDate: Thu Apr 8 15:40:37 2021 +0200 [NDK] Define NX bit in X86PAE PTE struct --- sdk/include/ndk/i386/mmtypes.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sdk/include/ndk/i386/mmtypes.h b/sdk/include/ndk/i386/mmtypes.h index 1b52d06de4b..e11a2da1b65 100644 --- a/sdk/include/ndk/i386/mmtypes.h +++ b/sdk/include/ndk/i386/mmtypes.h @@ -183,7 +183,8 @@ typedef struct _HARDWARE_PTE_X86 ULONGLONG Prototype:1; ULONGLONG reserved0:1; ULONGLONG PageFrameNumber:26; - ULONGLONG reserved1:26; + ULONGLONG reserved1:25; + ULONGLONG NoExecute:1; }; struct {
3 years, 8 months
1
0
0
0
[reactos] 06/12: [NTOS:MM] Use MI_MAKE_HARDWARE_PTE & friends in legacy Mm
by Jérôme Gardou
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=b10d92a16c6985b8063b9…
commit b10d92a16c6985b8063b954d9211864bf8114052 Author: Jérôme Gardou <jerome.gardou(a)reactos.org> AuthorDate: Thu Apr 1 11:45:10 2021 +0200 Commit: Jérôme Gardou <zefklop(a)users.noreply.github.com> CommitDate: Thu Apr 8 15:40:37 2021 +0200 [NTOS:MM] Use MI_MAKE_HARDWARE_PTE & friends in legacy Mm --- ntoskrnl/mm/i386/page.c | 91 +++++++++++++++---------------------------------- 1 file changed, 28 insertions(+), 63 deletions(-) diff --git a/ntoskrnl/mm/i386/page.c b/ntoskrnl/mm/i386/page.c index 35b0921d0ae..8b3ed370e94 100644 --- a/ntoskrnl/mm/i386/page.c +++ b/ntoskrnl/mm/i386/page.c @@ -15,9 +15,6 @@ #include <mm/ARM3/miarm.h> -#define ADDR_TO_PDE_OFFSET MiAddressToPdeOffset -#define ADDR_TO_PAGE_TABLE(v) (((ULONG)(v)) / (1024 * PAGE_SIZE)) - /* GLOBALS *****************************************************************/ #define PA_BIT_PRESENT (0) @@ -134,47 +131,6 @@ ULONG MmProtectToValue[32] = /* FUNCTIONS ***************************************************************/ -static ULONG -ProtectToPTE(ULONG flProtect) -{ - ULONG Attributes = 0; - - if (flProtect & (PAGE_NOACCESS|PAGE_GUARD)) - { - Attributes = 0; - } - else if (flProtect & PAGE_IS_WRITABLE) - { - Attributes = PA_PRESENT | PA_READWRITE; - } - else if (flProtect & (PAGE_IS_READABLE | PAGE_IS_EXECUTABLE)) - { - Attributes = PA_PRESENT; - } - else - { - DPRINT1("Unknown main protection type.\n"); - KeBugCheck(MEMORY_MANAGEMENT); - } - - if (flProtect & PAGE_SYSTEM) - { - } - else - { - Attributes = Attributes | PA_USER; - } - if (flProtect & PAGE_NOCACHE) - { - Attributes = Attributes | PA_CD; - } - if (flProtect & PAGE_WRITETHROUGH) - { - Attributes = Attributes | PA_WT; - } - return(Attributes); -} - NTSTATUS NTAPI MiFillSystemPageDirectory(IN PVOID Base, @@ -591,15 +547,22 @@ MmCreateVirtualMappingUnsafe(PEPROCESS Process, ULONG flProtect, PFN_NUMBER Page) { - ULONG Attributes; + ULONG ProtectionMask; PMMPTE PointerPte; - ULONG Pte; + MMPTE TempPte; + ULONG_PTR Pte; DPRINT("MmCreateVirtualMappingUnsafe(%p, %p, %lu, %x)\n", Process, Address, flProtect, Page); ASSERT(((ULONG_PTR)Address % PAGE_SIZE) == 0); + ProtectionMask = MiMakeProtectionMask(flProtect); + /* Caller must have checked ! */ + ASSERT(ProtectionMask != MM_INVALID_PROTECTION); + ASSERT(ProtectionMask != MM_NOACCESS); + ASSERT(ProtectionMask != MM_ZERO_ACCESS); + /* Make sure our PDE is valid, and that everything is going fine */ if (Process == NULL) { @@ -626,22 +589,18 @@ MmCreateVirtualMappingUnsafe(PEPROCESS Process, MiMakePdeExistAndMakeValid(MiAddressToPde(Address), Process, MM_NOIRQL); } - Attributes = ProtectToPTE(flProtect); - Attributes &= 0xfff; + PointerPte = MiAddressToPte(Address); + if (Address >= MmSystemRangeStart) { - Attributes &= ~PA_USER; + MI_MAKE_HARDWARE_PTE_KERNEL(&TempPte, PointerPte, ProtectionMask, Page); } else { - Attributes |= PA_USER; + MI_MAKE_HARDWARE_PTE_USER(&TempPte, PointerPte, ProtectionMask, Page); } - /* This must be for a valid address */ - ASSERT(FlagOn(Attributes, PA_PRESENT)); - - PointerPte = MiAddressToPte(Address); - Pte = InterlockedExchangePte(PointerPte, PFN_TO_PTE(Page) | Attributes); + Pte = InterlockedExchangePte(PointerPte, TempPte.u.Long); /* There should not have been anything valid here */ if (Pte != 0) { @@ -752,9 +711,10 @@ VOID NTAPI MmSetPageProtect(PEPROCESS Process, PVOID Address, ULONG flProtect) { - ULONG Attributes = 0; + ULONG ProtectionMask; PMMPTE PointerPte; - ULONG Pte; + MMPTE TempPte; + ULONG_PTR Pte; DPRINT("MmSetPageProtect(Process %p Address %p flProtect %x)\n", Process, Address, flProtect); @@ -764,17 +724,22 @@ MmSetPageProtect(PEPROCESS Process, PVOID Address, ULONG flProtect) ASSERT(Process == PsGetCurrentProcess()); + ProtectionMask = MiMakeProtectionMask(flProtect); + /* Caller must have checked ! */ + ASSERT(ProtectionMask != MM_INVALID_PROTECTION); + MiLockProcessWorkingSetUnsafe(Process, PsGetCurrentThread()); MiMakePdeExistAndMakeValid(MiAddressToPde(Address), Process, MM_NOIRQL); - Attributes = ProtectToPTE(flProtect); + PointerPte = MiAddressToPte(Address); - Attributes &= 0xfff; - Attributes |= PA_USER; + MI_MAKE_HARDWARE_PTE_USER(&TempPte, PointerPte, ProtectionMask, PFN_FROM_PTE(PointerPte)); + /* Keep dirty & accessed bits */ + TempPte.u.Hard.Accessed = PointerPte->u.Hard.Accessed; + TempPte.u.Hard.Dirty = PointerPte->u.Hard.Dirty; - PointerPte = MiAddressToPte(Address); - Pte = InterlockedExchangePte(PointerPte, PAGE_MASK(PointerPte->u.Long) | Attributes | (PointerPte->u.Long & (PA_ACCESSED|PA_DIRTY))); + Pte = InterlockedExchangePte(PointerPte, TempPte.u.Long); // We should be able to bring a page back from PAGE_NOACCESS if ((Pte & 0x800) || !(Pte >> PAGE_SHIFT)) @@ -783,7 +748,7 @@ MmSetPageProtect(PEPROCESS Process, PVOID Address, ULONG flProtect) KeBugCheck(MEMORY_MANAGEMENT); } - if ((Pte & 0xFFF) != Attributes) + if (Pte != TempPte.u.Long) KeInvalidateTlbEntry(Address); MiUnlockProcessWorkingSetUnsafe(Process, PsGetCurrentThread());
3 years, 8 months
1
0
0
0
← Newer
1
...
10
11
12
13
14
15
16
17
18
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
Results per page:
10
25
50
100
200