Author: hbelusca
Date: Sun Oct 18 22:00:29 2015
New Revision: 69608
URL: http://svn.reactos.org/svn/reactos?rev=69608&view=rev
Log:
[KERNEL32]
- GlobalMemoryStatusEx: Correctly compute ullTotalPageFile which should be in bytes, instead of in number of pages. Patch by contributor "kkat". CORE-10361
- GlobalMemoryStatusEx: Fail if the stored length in the data buffer is not what is expected by the API (required by the spec, see MSDN; on the contrary, GlobalMemoryStatus does not require that.)
- GlobalMemoryStatus: Correctly round up the reported total/available memory values, in case they are bigger than ~= 2GB.
Modified:
trunk/reactos/dll/win32/kernel32/client/heapmem.c
Modified: trunk/reactos/dll/win32/kernel32/client/heapmem.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/client/…
==============================================================================
--- trunk/reactos/dll/win32/kernel32/client/heapmem.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/kernel32/client/heapmem.c [iso-8859-1] Sun Oct 18 22:00:29 2015
@@ -1276,6 +1276,12 @@
QUOTA_LIMITS QuotaLimits;
ULONGLONG PageFile, PhysicalMemory;
+ if (lpBuffer->dwLength != sizeof(*lpBuffer))
+ {
+ SetLastError(ERROR_INVALID_PARAMETER);
+ return FALSE;
+ }
+
/* Query performance information */
NtQuerySystemInformation(SystemPerformanceInformation,
&PerformanceInfo,
@@ -1312,6 +1318,7 @@
/* Save the commit limit */
lpBuffer->ullTotalPageFile = min(QuotaLimits.PagefileLimit,
PerformanceInfo.CommitLimit);
+ lpBuffer->ullTotalPageFile *= BaseStaticServerData->SysInfo.PageSize;
/* Calculate how many pages are left */
PageFile = PerformanceInfo.CommitLimit - PerformanceInfo.CommittedPages;
@@ -1327,9 +1334,9 @@
BaseStaticServerData->SysInfo.MinimumUserModeAddress) + 1;
/* And finally the avilable virtual space */
- lpBuffer->ullAvailVirtual = lpBuffer->ullTotalVirtual -
- VmCounters.VirtualSize;
+ lpBuffer->ullAvailVirtual = lpBuffer->ullTotalVirtual - VmCounters.VirtualSize;
lpBuffer->ullAvailExtendedVirtual = 0;
+
return TRUE;
}
@@ -1349,12 +1356,12 @@
/* Reset the right size and fill out the information */
lpBuffer->dwLength = sizeof(MEMORYSTATUS);
lpBuffer->dwMemoryLoad = lpBufferEx.dwMemoryLoad;
- lpBuffer->dwTotalPhys = (SIZE_T)lpBufferEx.ullTotalPhys;
- lpBuffer->dwAvailPhys = (SIZE_T)lpBufferEx.ullAvailPhys;
- lpBuffer->dwTotalPageFile = (SIZE_T)lpBufferEx.ullTotalPageFile;
- lpBuffer->dwAvailPageFile = (SIZE_T)lpBufferEx.ullAvailPageFile;
- lpBuffer->dwTotalVirtual = (SIZE_T)lpBufferEx.ullTotalVirtual;
- lpBuffer->dwAvailVirtual = (SIZE_T)lpBufferEx.ullAvailVirtual;
+ lpBuffer->dwTotalPhys = (SIZE_T)min(lpBufferEx.ullTotalPhys, MAXULONG_PTR);
+ lpBuffer->dwAvailPhys = (SIZE_T)min(lpBufferEx.ullAvailPhys, MAXULONG_PTR);
+ lpBuffer->dwTotalPageFile = (SIZE_T)min(lpBufferEx.ullTotalPageFile, MAXULONG_PTR);
+ lpBuffer->dwAvailPageFile = (SIZE_T)min(lpBufferEx.ullAvailPageFile, MAXULONG_PTR);
+ lpBuffer->dwTotalVirtual = (SIZE_T)min(lpBufferEx.ullTotalVirtual, MAXULONG_PTR);
+ lpBuffer->dwAvailVirtual = (SIZE_T)min(lpBufferEx.ullAvailVirtual, MAXULONG_PTR);
}
}
Author: akhaldi
Date: Sun Oct 18 17:10:38 2015
New Revision: 69605
URL: http://svn.reactos.org/svn/reactos?rev=69605&view=rev
Log:
[MSCONFIG_NEW] C++ is coming. Resistance is futile.
Modified:
trunk/reactos/base/applications/msconfig_new/CMakeLists.txt
Modified: trunk/reactos/base/applications/msconfig_new/CMakeLists.txt
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/msconfig…
==============================================================================
--- trunk/reactos/base/applications/msconfig_new/CMakeLists.txt [iso-8859-1] (original)
+++ trunk/reactos/base/applications/msconfig_new/CMakeLists.txt [iso-8859-1] Sun Oct 18 17:10:38 2015
@@ -1,11 +1,7 @@
PROJECT(msconfig_new)
-# Currently, C++ files are the exception in this project. Therefore we
-# manually set up only what's needed for C++ support. If the project
-# is converted to C++, then we'll need to use the general C++ set-up.
set_cpp(WITH_RUNTIME)
-set(IS_CPP 0) # Disable C++ for PCH
include_directories(
.
@@ -22,25 +18,16 @@
generalpage.c
msconfig.c
stringutils.c
- utils.c
- precomp.h)
+ utils.c)
list(APPEND CPP_SOURCE
toolspage.cpp
- xmldomparser.cpp)
+ xmldomparser.cpp
+ precomp.h)
add_rc_deps(msconfig.rc ${CMAKE_CURRENT_SOURCE_DIR}/res/msconfig.ico)
add_executable(msconfig_new ${C_SOURCE} ${CPP_SOURCE} msconfig.rc)
-
-# Retrieve the COMPILE_FLAGS property for the .cpp files only
-get_property(cpp_file1_flag SOURCE toolspage.cpp PROPERTY COMPILE_FLAGS)
-get_property(cpp_file2_flag SOURCE xmldomparser.cpp PROPERTY COMPILE_FLAGS)
-# Define PCH usage (see 'add_pch' macro code for more information)
-add_pch(msconfig_new precomp.h C_SOURCE)
-# Remove PCH usage for the .cpp files only (set the original COMPILE_FLAGS property)
-set_property(SOURCE toolspage.cpp PROPERTY COMPILE_FLAGS ${cpp_file1_flag})
-set_property(SOURCE xmldomparser.cpp PROPERTY COMPILE_FLAGS ${cpp_file2_flag})
-
+add_pch(msconfig_new precomp.h CPP_SOURCE)
set_module_type(msconfig_new win32gui UNICODE)
target_link_libraries(msconfig_new comsupp)
add_importlibs(msconfig_new user32 advapi32 version comctl32 ole32 oleaut32 msxml3 shell32 shlwapi msvcrt kernel32)
Author: pschweitzer
Date: Sun Oct 18 16:09:11 2015
New Revision: 69602
URL: http://svn.reactos.org/svn/reactos?rev=69602&view=rev
Log:
[NTOSKRNL]
Don't keep spining forever in CcRosFlushDirtyPages() when flushing a dirty VACB fails on a RO volume.
This can be triggered with extX volumes and can prevent shutdown from succeeding
Modified:
trunk/reactos/ntoskrnl/cc/view.c
Modified: trunk/reactos/ntoskrnl/cc/view.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/cc/view.c?rev=696…
==============================================================================
--- trunk/reactos/ntoskrnl/cc/view.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/cc/view.c [iso-8859-1] Sun Oct 18 16:09:11 2015
@@ -235,7 +235,8 @@
KeAcquireGuardedMutex(&ViewLock);
CcRosVacbDecRefCount(current);
- if (!NT_SUCCESS(Status) && (Status != STATUS_END_OF_FILE))
+ if (!NT_SUCCESS(Status) && (Status != STATUS_END_OF_FILE) &&
+ (Status != STATUS_MEDIA_WRITE_PROTECTED))
{
DPRINT1("CC: Failed to flush VACB.\n");
}