From bec4ac17fcb6ca89c764a8a555fadf4f57060b45 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Sun, 22 Sep 2013 21:04:06 +0000 Subject: [PATCH] [TELNET] Don't compile it on MSVC [CMAKE] Use the same MSVC build flags for x64 as for x86 [SMLIB] Fix MSVC warnings [MODULES] Don't include optional modules on x64 [NTOSKRNL] Add some missing globals and definitions for x64 [CSRSRV] Fix an MSVC warning svn path=/trunk/; revision=60325 --- reactos/base/applications/network/CMakeLists.txt | 4 +++- reactos/cmake/msvc.cmake | 12 +++++------- reactos/include/reactos/subsys/csr/csrsrv.h | 2 ++ reactos/lib/smlib/lookupss.c | 6 +++--- reactos/modules/CMakeLists.txt | 4 ++++ reactos/ntoskrnl/include/internal/amd64/mm.h | 14 ++++++++++++++ reactos/ntoskrnl/mm/amd64/init.c | 4 ++++ reactos/subsystems/win32/csrsrv/session.c | 4 +++- 8 files changed, 38 insertions(+), 12 deletions(-) diff --git a/reactos/base/applications/network/CMakeLists.txt b/reactos/base/applications/network/CMakeLists.txt index 4f95614999e..4080a29dacc 100644 --- a/reactos/base/applications/network/CMakeLists.txt +++ b/reactos/base/applications/network/CMakeLists.txt @@ -10,7 +10,9 @@ add_subdirectory(netstat) add_subdirectory(nslookup) add_subdirectory(ping) add_subdirectory(route) -add_subdirectory(telnet) +#if(NOT MSVC) + add_subdirectory(telnet) +#endif() add_subdirectory(tracert) add_subdirectory(whois) add_subdirectory(wlanconf) diff --git a/reactos/cmake/msvc.cmake b/reactos/cmake/msvc.cmake index 5bd26c0408b..2c1f4df26b6 100644 --- a/reactos/cmake/msvc.cmake +++ b/reactos/cmake/msvc.cmake @@ -59,11 +59,9 @@ if(MSVC_IDE) endif() endif() -if(${_MACHINE_ARCH_FLAG} MATCHES X86) - set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /MANIFEST:NO /INCREMENTAL:NO /SAFESEH:NO /NODEFAULTLIB /RELEASE") - set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /MANIFEST:NO /INCREMENTAL:NO /SAFESEH:NO /NODEFAULTLIB /RELEASE") - set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} /MANIFEST:NO /INCREMENTAL:NO /SAFESEH:NO /NODEFAULTLIB /RELEASE") -endif() +set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /MANIFEST:NO /INCREMENTAL:NO /SAFESEH:NO /NODEFAULTLIB /RELEASE") +set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /MANIFEST:NO /INCREMENTAL:NO /SAFESEH:NO /NODEFAULTLIB /RELEASE") +set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} /MANIFEST:NO /INCREMENTAL:NO /SAFESEH:NO /NODEFAULTLIB /RELEASE") if(MSVC_IDE AND (CMAKE_VERSION MATCHES "ReactOS")) # for VS builds we'll only have en-US in resource files @@ -160,13 +158,13 @@ function(generate_import_lib _libname _dllname _spec_file) set(_def_file ${CMAKE_CURRENT_BINARY_DIR}/${_libname}_exp.def) set(_asm_stubs_file ${CMAKE_CURRENT_BINARY_DIR}/${_libname}_stubs.asm) - + # Generate the asm stub file and the def file for import library add_custom_command( OUTPUT ${_asm_stubs_file} ${_def_file} COMMAND native-spec2def --ms --kill-at -a=${SPEC2DEF_ARCH} --implib -n=${_dllname} -d=${_def_file} -l=${_asm_stubs_file} ${CMAKE_CURRENT_SOURCE_DIR}/${_spec_file} DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${_spec_file} native-spec2def) - + if(MSVC_IDE) # Compile the generated asm stub file add_custom_command( diff --git a/reactos/include/reactos/subsys/csr/csrsrv.h b/reactos/include/reactos/subsys/csr/csrsrv.h index 055a7429434..2ed03b3b4ba 100644 --- a/reactos/include/reactos/subsys/csr/csrsrv.h +++ b/reactos/include/reactos/subsys/csr/csrsrv.h @@ -225,7 +225,9 @@ typedef struct _CSR_SERVER_DLL PCSR_SHUTDOWNPROCESS_CALLBACK ShutdownProcessCallback; ULONG Unknown2[3]; } CSR_SERVER_DLL, *PCSR_SERVER_DLL; +#ifndef _WIN64 C_ASSERT(FIELD_OFFSET(CSR_SERVER_DLL, SharedSection) == 0x3C); +#endif typedef NTSTATUS diff --git a/reactos/lib/smlib/lookupss.c b/reactos/lib/smlib/lookupss.c index a7bba563181..47862ccde06 100644 --- a/reactos/lib/smlib/lookupss.c +++ b/reactos/lib/smlib/lookupss.c @@ -109,12 +109,12 @@ SmLookupSubsystem (IN PWSTR Name, } else { - Source.Length = kvpi->DataLength; - Source.MaximumLength = kvpi->DataLength; + Source.Length = (USHORT)kvpi->DataLength; + Source.MaximumLength = (USHORT)kvpi->DataLength; Source.Buffer = (PWCHAR) & kvpi->Data; Destination.Length = 0; - Destination.MaximumLength = (2 * KeyValueInformationLength); + Destination.MaximumLength = (USHORT)(2 * KeyValueInformationLength); Destination.Buffer = DestinationBuffer; Status = RtlExpandEnvironmentStrings_U (Environment, diff --git a/reactos/modules/CMakeLists.txt b/reactos/modules/CMakeLists.txt index 22e0cfc6886..2eda3458e1b 100644 --- a/reactos/modules/CMakeLists.txt +++ b/reactos/modules/CMakeLists.txt @@ -1,4 +1,6 @@ +if(NOT ARCH STREQUAL "amd64") + if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/rostests/) add_subdirectory(rostests) endif() @@ -10,3 +12,5 @@ endif() if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/wallpaper/) add_subdirectory(wallpaper) endif() + +endif() diff --git a/reactos/ntoskrnl/include/internal/amd64/mm.h b/reactos/ntoskrnl/include/internal/amd64/mm.h index a15bdd08202..5986da62c62 100644 --- a/reactos/ntoskrnl/include/internal/amd64/mm.h +++ b/reactos/ntoskrnl/include/internal/amd64/mm.h @@ -262,6 +262,20 @@ MiIsPdeForAddressValid(PVOID Address) /* Sign extend 48 bits */ #define MiProtoPteToPte(x) (PMMPTE)(((LONG64)(x)->u.Long) >> 16) +// +// Decodes a Prototype PTE into the underlying PTE +// +#define MiSubsectionPteToSubsection(x) \ + (PMMPTE)((x)->u.Subsect.SubsectionAddress >> 16) + +FORCEINLINE +VOID +MI_MAKE_SUBSECTION_PTE(IN PMMPTE NewPte, + IN PVOID Segment) +{ + ASSERT(FALSE); +} + FORCEINLINE VOID MI_MAKE_PROTOTYPE_PTE(IN PMMPTE NewPte, diff --git a/reactos/ntoskrnl/mm/amd64/init.c b/reactos/ntoskrnl/mm/amd64/init.c index 00e832bf112..64693c7a469 100644 --- a/reactos/ntoskrnl/mm/amd64/init.c +++ b/reactos/ntoskrnl/mm/amd64/init.c @@ -26,6 +26,10 @@ extern PMMPTE MmDebugPte; MMPTE ValidKernelPde = {{PTE_VALID|PTE_READWRITE|PTE_DIRTY|PTE_ACCESSED}}; MMPTE ValidKernelPte = {{PTE_VALID|PTE_READWRITE|PTE_DIRTY|PTE_ACCESSED}}; +/* The same, but for local pages */ +MMPTE ValidKernelPdeLocal = {{PTE_VALID|PTE_READWRITE|PTE_DIRTY|PTE_ACCESSED}}; +MMPTE ValidKernelPteLocal = {{PTE_VALID|PTE_READWRITE|PTE_DIRTY|PTE_ACCESSED}}; + /* Template PDE for a demand-zero page */ MMPDE DemandZeroPde = {{MM_READWRITE << MM_PTE_SOFTWARE_PROTECTION_BITS}}; MMPTE DemandZeroPte = {{MM_READWRITE << MM_PTE_SOFTWARE_PROTECTION_BITS}}; diff --git a/reactos/subsystems/win32/csrsrv/session.c b/reactos/subsystems/win32/csrsrv/session.c index f2d1ccde9ec..a06d94aeccf 100644 --- a/reactos/subsystems/win32/csrsrv/session.c +++ b/reactos/subsystems/win32/csrsrv/session.c @@ -296,7 +296,9 @@ CsrSbCreateSession(IN PSB_API_MSG ApiMessage) CsrDeallocateProcess(CsrProcess); CsrDeallocateThread(CsrThread); CsrReleaseProcessLock(); - return Status; + + /* Strange as it seems, NTSTATUSes are actually returned */ + return (BOOLEAN)Status; } /* Setup Process Data */