Author: tfaber
Date: Sun Aug 2 09:15:39 2015
New Revision: 68593
URL: http://svn.reactos.org/svn/reactos?rev=68593&view=rev
Log:
[NTOS:MM]
- Don't accept 64 bit PE files on x86 (will cause use of uninitialized variable ImageBase). CORE-9955
- Remove a pointless check in MmMapViewOfSection
Modified:
trunk/reactos/ntoskrnl/mm/section.c
Modified: trunk/reactos/ntoskrnl/mm/section.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/section.c?rev=…
==============================================================================
--- trunk/reactos/ntoskrnl/mm/section.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/mm/section.c [iso-8859-1] Sun Aug 2 09:15:39 2015
@@ -363,7 +363,9 @@
switch(piohOptHeader->Magic)
{
case IMAGE_NT_OPTIONAL_HDR32_MAGIC:
+#ifdef _WIN64
case IMAGE_NT_OPTIONAL_HDR64_MAGIC:
+#endif // _WIN64
break;
default:
@@ -4609,13 +4611,6 @@
{
MmUnlockAddressSpace(AddressSpace);
return STATUS_SECTION_PROTECTION;
- }
-
- if (ViewSize == NULL)
- {
- /* Following this pointer would lead to us to the dark side */
- /* What to do? Bugcheck? Return status? Do the mambo? */
- KeBugCheck(MEMORY_MANAGEMENT);
}
if (SectionOffset == NULL)
Author: hbelusca
Date: Sat Aug 1 17:30:17 2015
New Revision: 68587
URL: http://svn.reactos.org/svn/reactos?rev=68587&view=rev
Log:
[MSPAINT_NEW]
Fix build on MSVC by rewriting the code in *STANDARD* C++ !! (and not into some strange idiom called "GCC-C++"). I suggest also to write a proper class for dynamically-allocated (resource) strings instead of either having the static arrays of hardcoded sizes, or being tempted to use non-standard constructs as the one I just saw.
(and btw, instead of defining a new "SIZEOF()" macro, there is one which already exists in the PSDK called "ARRAYSIZE()" which just does the correct job).
Modified:
trunk/reactos/base/applications/mspaint_new/winproc.cpp
Modified: trunk/reactos/base/applications/mspaint_new/winproc.cpp
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mspaint_…
==============================================================================
--- trunk/reactos/base/applications/mspaint_new/winproc.cpp [iso-8859-1] (original)
+++ trunk/reactos/base/applications/mspaint_new/winproc.cpp [iso-8859-1] Sat Aug 1 17:30:17 2015
@@ -196,14 +196,11 @@
{
if (!imageModel.IsImageSaved())
{
- TCHAR* tempptr;
- TCHAR programname[LoadString(hProgInstance, IDS_PROGRAMNAME, (LPTSTR)&tempptr, 0) + 1];
- CopyMemory(programname, tempptr, sizeof(programname) - sizeof(TCHAR));
- programname[SIZEOF(programname) - 1] = (TCHAR)'\0';
- TCHAR saveprompttext[LoadString(hProgInstance, IDS_SAVEPROMPTTEXT, (LPTSTR)&tempptr, 0) + 1];
- CopyMemory(saveprompttext, tempptr, sizeof(saveprompttext) - sizeof(TCHAR));
- saveprompttext[SIZEOF(saveprompttext) - 1] = (TCHAR)'\0';
- TCHAR temptext[SIZEOF(saveprompttext) + _tcslen(filename)];
+ TCHAR programname[20];
+ TCHAR saveprompttext[100];
+ TCHAR temptext[500];
+ LoadString(hProgInstance, IDS_PROGRAMNAME, programname, SIZEOF(programname));
+ LoadString(hProgInstance, IDS_SAVEPROMPTTEXT, saveprompttext, SIZEOF(saveprompttext));
_stprintf(temptext, saveprompttext, filename);
switch (MessageBox(temptext, programname, MB_YESNOCANCEL | MB_ICONQUESTION))
{