Author: hbelusca
Date: Mon Feb 15 01:20:54 2016
New Revision: 70751
URL: http://svn.reactos.org/svn/reactos?rev=70751&view=rev
Log:
[USER32][NTUSER]
Remove some dead code; fix comments; mention that some code is redundant. This is added to help future people in cleaning up that mess called "win32k/user32".
Modified:
trunk/reactos/win32ss/user/ntuser/defwnd.c
trunk/reactos/win32ss/user/user32/windows/defwnd.c
trunk/reactos/win32ss/user/user32/windows/window.c
Modified: trunk/reactos/win32ss/user/ntuser/defwnd.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/defwnd…
==============================================================================
--- trunk/reactos/win32ss/user/ntuser/defwnd.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/user/ntuser/defwnd.c [iso-8859-1] Mon Feb 15 01:20:54 2016
@@ -404,7 +404,7 @@
/*
* When themes are not enabled we can go on and paint the non client area.
* However if we do that with themes enabled we will draw a classic frame.
- * This is sovled by sending a themes specific message to notify the themes
+ * This is solved by sending a themes specific message to notify the themes
* engine that the caption needs to be redrawn
*/
if (gpsi->dwSRVIFlags & SRVINFO_APIHOOK)
Modified: trunk/reactos/win32ss/user/user32/windows/defwnd.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/user32/window…
==============================================================================
--- trunk/reactos/win32ss/user/user32/windows/defwnd.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/user/user32/windows/defwnd.c [iso-8859-1] Mon Feb 15 01:20:54 2016
@@ -299,6 +299,7 @@
return TRUE;
}
+/* WARNING: Redundant with /ntuser/defwnd.c!UserPaintCaption !! */
static void
UserPaintCaption(PWND pwnd, INT Flags)
{
@@ -309,7 +310,7 @@
/*
* When themes are not enabled we can go on and paint the non client area.
* However if we do that with themes enabled we will draw a classic frame.
- * This is sovled by sending a themes specific message to notify the themes
+ * This is solved by sending a themes specific message to notify the themes
* engine that the caption needs to be redrawn
*/
if(gpsi->dwSRVIFlags & SRVINFO_APIHOOK)
Modified: trunk/reactos/win32ss/user/user32/windows/window.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/user32/window…
==============================================================================
--- trunk/reactos/win32ss/user/user32/windows/window.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/user/user32/windows/window.c [iso-8859-1] Mon Feb 15 01:20:54 2016
@@ -15,7 +15,6 @@
#include <wine/debug.h>
WINE_DEFAULT_DEBUG_CHANNEL(user32);
-LRESULT DefWndNCPaint(HWND hWnd, HRGN hRgn, BOOL Active);
void MDI_CalcDefaultChildPos( HWND hwndClient, INT total, LPPOINT lpPos, INT delta, UINT *id );
/* FUNCTIONS *****************************************************************/
Author: pschweitzer
Date: Sun Feb 14 19:53:47 2016
New Revision: 70746
URL: http://svn.reactos.org/svn/reactos?rev=70746&view=rev
Log:
[FLOPPY]
When discovering floppy controlers, immediately probe controlers to check whether they have a disk and if so, what's its geometry.
This avoids waiting for the first read, which will obviously never happen because FSD will try other operations depending on not set geometry.
This implies a modification in RWDetermineMediaType() to avoid infinite wait, in case there's no disk at all in the controler.
Addendum to r70725
Modified:
trunk/reactos/drivers/storage/floppy/floppy.c
trunk/reactos/drivers/storage/floppy/readwrite.c
trunk/reactos/drivers/storage/floppy/readwrite.h
Modified: trunk/reactos/drivers/storage/floppy/floppy.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/storage/floppy/flo…
==============================================================================
--- trunk/reactos/drivers/storage/floppy/floppy.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/storage/floppy/floppy.c [iso-8859-1] Sun Feb 14 19:53:47 2016
@@ -987,6 +987,11 @@
/* 3k: Clear the DO_DEVICE_INITIALIZING flag */
gControllerInfo[i].DriveInfo[j].DeviceObject->Flags &= ~DO_DEVICE_INITIALIZING;
+
+ /* 3l: Attempt to get drive info - if a floppy is already present */
+ StartMotor(&gControllerInfo[i].DriveInfo[j]);
+ RWDetermineMediaType(&gControllerInfo[i].DriveInfo[j], TRUE);
+ StopMotor(gControllerInfo[i].DriveInfo[j].ControllerInfo);
}
}
Modified: trunk/reactos/drivers/storage/floppy/readwrite.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/storage/floppy/rea…
==============================================================================
--- trunk/reactos/drivers/storage/floppy/readwrite.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/storage/floppy/readwrite.c [iso-8859-1] Sun Feb 14 19:53:47 2016
@@ -149,8 +149,8 @@
}
-static NTSTATUS NTAPI
-RWDetermineMediaType(PDRIVE_INFO DriveInfo)
+NTSTATUS NTAPI
+RWDetermineMediaType(PDRIVE_INFO DriveInfo, BOOLEAN OneShot)
/*
* FUNCTION: Determine the media type of the disk in the drive and fill in the geometry
* ARGUMENTS:
@@ -177,8 +177,8 @@
/*
* This algorithm assumes that a 1.44MB floppy is in the drive. If it's not,
- * it works backwards until the read works. Note that only 1.44 has been tested
- * at all.
+ * it works backwards until the read works unless OneShot try is asked.
+ * Note that only 1.44 has been tested at all.
*/
do
@@ -249,7 +249,10 @@
if(HwReadIdResult(DriveInfo->ControllerInfo, NULL, NULL) != STATUS_SUCCESS)
{
WARN_(FLOPPY, "RWDetermineMediaType(): ReadIdResult failed; continuing\n");
- continue;
+ if (OneShot)
+ break;
+ else
+ continue;
}
/* Found the media; populate the geometry now */
@@ -492,7 +495,7 @@
*/
if(DriveInfo->DiskGeometry.MediaType == Unknown)
{
- if(RWDetermineMediaType(DriveInfo) != STATUS_SUCCESS)
+ if(RWDetermineMediaType(DriveInfo, FALSE) != STATUS_SUCCESS)
{
WARN_(FLOPPY, "ReadWritePassive(): unable to determine media type; completing with STATUS_UNSUCCESSFUL\n");
IoCompleteRequest(Irp, IO_NO_INCREMENT);
Modified: trunk/reactos/drivers/storage/floppy/readwrite.h
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/storage/floppy/rea…
==============================================================================
--- trunk/reactos/drivers/storage/floppy/readwrite.h [iso-8859-1] (original)
+++ trunk/reactos/drivers/storage/floppy/readwrite.h [iso-8859-1] Sun Feb 14 19:53:47 2016
@@ -33,3 +33,6 @@
VOID NTAPI
ReadWritePassive(PDRIVE_INFO DriveInfo, PIRP Irp);
+
+NTSTATUS NTAPI
+RWDetermineMediaType(PDRIVE_INFO DriveInfo, BOOLEAN OneShot);