Author: mjmartin
Date: Thu Mar 10 10:36:49 2011
New Revision: 51006
URL: http://svn.reactos.org/svn/reactos?rev=51006&view=rev
Log:
[syssetup]
- EnableUserModePnpManager: StartServiceW can fail due to the service already running. Check last error for such a case. Should fix bug #5846.
Modified:
trunk/reactos/dll/win32/syssetup/install.c
Modified: trunk/reactos/dll/win32/syssetup/install.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/syssetup/install…
==============================================================================
--- trunk/reactos/dll/win32/syssetup/install.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/syssetup/install.c [iso-8859-1] Thu Mar 10 10:36:49 2011
@@ -506,7 +506,7 @@
}
ret = StartServiceW(hService, 0, NULL);
- if (!ret)
+ if ((!ret) && (GetLastError() != ERROR_SERVICE_ALREADY_RUNNING))
{
DPRINT1("Unable to start service\n");
goto cleanup;
Author: pschweitzer
Date: Wed Mar 9 10:33:13 2011
New Revision: 51002
URL: http://svn.reactos.org/svn/reactos?rev=51002&view=rev
Log:
[NTOSKRNL]
Implemented FstubFixupEfiPartition():
Purpose is to let ReactOS handle realistic partitions length in case of an EFI/GPT protective MBR.
Indeed, when formatting a disk to GPT, you add a protective MBR that contains a fake partition entry, with type 0xEE having the following property: its size is set to maximum allocatable size in MBR.
In that case, if disk is small, you may go beyond disk size.
This is why a fix to partition length may be needed when re-reading partition entry.
This is the way ReactOS creates protective MBR.
You may find some more information here: http://msdn.microsoft.com/en-us/windows/hardware/gg463525
Fixed xHalIoReadPartitionTable():
- Allocate a buffer that has the proper size (instead of allocating a buffer which is too big). Especially since this leads to partial init only some lines after.
- Remove redundant & useless affectation.
- Check/fix 0xEE partition length in case of an EFI/GPT protective MBR (see upper point).
Modified:
trunk/reactos/ntoskrnl/fstub/disksup.c
Modified: trunk/reactos/ntoskrnl/fstub/disksup.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/fstub/disksup.c?r…
==============================================================================
--- trunk/reactos/ntoskrnl/fstub/disksup.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/fstub/disksup.c [iso-8859-1] Wed Mar 9 10:33:13 2011
@@ -23,6 +23,8 @@
#define AUTO_DRIVE MAXULONG
#define PARTITION_MAGIC 0xaa55
+
+#define EFI_PMBR_OSTYPE_EFI 0xEE
#include <pshpack1.h>
@@ -1355,6 +1357,24 @@
ASSERT(PartitionDescriptor->PartitionType == 0x55);
}
}
+ }
+}
+
+VOID
+NTAPI
+FstubFixupEfiPartition(IN PPARTITION_DESCRIPTOR PartitionDescriptor,
+ IN ULONGLONG MaxOffset)
+{
+ ULONG PartitionLength;
+ PAGED_CODE();
+
+ /* Compute partition length (according to MBR entry) */
+ PartitionLength = PartitionDescriptor->StartingSectorLsb0 + PartitionDescriptor->PartitionLengthLsb0;
+ /* In case the partition length goes beyond disk size... */
+ if (PartitionLength > MaxOffset)
+ {
+ /* Resize partition to its maximum real length */
+ PartitionDescriptor->PartitionLengthLsb0 = MaxOffset - PartitionDescriptor->StartingSectorLsb0;
}
}
@@ -1425,7 +1445,7 @@
MaxOffset, MaxSector);
/* Allocate our buffer */
- Buffer = ExAllocatePoolWithTag(NonPagedPool, PAGE_SIZE, TAG_FILE_SYSTEM);
+ Buffer = ExAllocatePoolWithTag(NonPagedPool, InputSize, TAG_FILE_SYSTEM);
if (!Buffer)
{
/* Fail, free the input buffer */
@@ -1503,9 +1523,6 @@
PartitionDescriptor = (PPARTITION_DESCRIPTOR)
&(((PUSHORT)Buffer)[PARTITION_TABLE_OFFSET]);
- /* Get the partition type */
- PartitionType = PartitionDescriptor->PartitionType;
-
/* Start looping partitions */
j++;
DPRINT("FSTUB: Partition Table %d:\n", j);
@@ -1523,6 +1540,14 @@
DPRINT("\tOffset %#08lx for %#08lx Sectors\n",
GET_STARTING_SECTOR(PartitionDescriptor),
GET_PARTITION_LENGTH(PartitionDescriptor));
+
+ /* Check whether we're facing a protective MBR */
+ if (PartitionType == EFI_PMBR_OSTYPE_EFI)
+ {
+ /* Partition length might be bigger than disk size */
+ FstubFixupEfiPartition(PartitionDescriptor,
+ MaxOffset);
+ }
/* Make sure that the partition is valid, unless it's the first */
if (!(HalpIsValidPartitionEntry(PartitionDescriptor,
Author: tkreuzer
Date: Mon Mar 7 22:00:19 2011
New Revision: 50998
URL: http://svn.reactos.org/svn/reactos?rev=50998&view=rev
Log:
[WIN32K]
clip the destination rect against the bounds of the destination and source surface. Fixes a crash of gdi32_winetest bitmap that occurs as soon as IntCreateCompatibleBitmap is fixed. Other Eng* code needs to be checked as well.
Modified:
trunk/reactos/subsystems/win32/win32k/eng/copybits.c
Modified: trunk/reactos/subsystems/win32/win32k/eng/copybits.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/en…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/eng/copybits.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/eng/copybits.c [iso-8859-1] Mon Mar 7 22:00:19 2011
@@ -49,12 +49,28 @@
BLTINFO BltInfo;
SURFACE *psurfDest;
SURFACE *psurfSource;
+ RECTL rclDest = *DestRect;
+ POINTL ptlSrc = *SourcePoint;
ASSERT(psoDest != NULL && psoSource != NULL && DestRect != NULL && SourcePoint != NULL);
psurfSource = CONTAINING_RECORD(psoSource, SURFACE, SurfObj);
psurfDest = CONTAINING_RECORD(psoDest, SURFACE, SurfObj);
+ /* Clip dest rect against source surface size / source point */
+ if (psoSource->sizlBitmap.cx - ptlSrc.x < rclDest.right - rclDest.left)
+ rclDest.right = rclDest.left + psoSource->sizlBitmap.cx - ptlSrc.x;
+ if (psoSource->sizlBitmap.cy - ptlSrc.y < rclDest.bottom - rclDest.top)
+ rclDest.bottom = rclDest.top + psoSource->sizlBitmap.cy - ptlSrc.y;
+
+ /* Clip dest rect against target surface size */
+ if (rclDest.right > psoDest->sizlBitmap.cx)
+ rclDest.right = psoDest->sizlBitmap.cx;
+ if (rclDest.bottom > psoDest->sizlBitmap.cy)
+ rclDest.bottom = psoDest->sizlBitmap.cy;
+ if (RECTL_bIsEmptyRect(&rclDest)) return TRUE;
+ DestRect = &rclDest;
+
// FIXME: Don't punt to the driver's DrvCopyBits immediately. Instead,
// mark the copy block function to be DrvCopyBits instead of the
// GDI's copy bit function so as to remove clipping from the