Author: mjmartin
Date: Mon Oct 12 14:47:54 2009
New Revision: 43396
URL: http://svn.reactos.org/svn/reactos?rev=43396&view=rev
Log:
- Change DIALOG_CreateIndirect location in source to make DEFDLG_SaveFocus available for use.
- DIALOG_CreateIndirect: The current window with focus could have been set in the dialog's procedure, so save the current focused window after sending WM_INITDIALOG and before any other message are sent that modify focus.
- Fixes setting focus on Open and Close dialogs to the FileName edit control in OpenOffice.
Modified:
trunk/reactos/dll/win32/user32/windows/dialog.c
Modified: trunk/reactos/dll/win32/user32/windows/dialog.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/user32/windows/d…
==============================================================================
--- trunk/reactos/dll/win32/user32/windows/dialog.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/user32/windows/dialog.c [iso-8859-1] Mon Oct 12 14:47:54 2009
@@ -682,7 +682,59 @@
return (LPCSTR)((((UINT_PTR)p) + 3) & ~3);
}
- /***********************************************************************
+/***********************************************************************
+ * DEFDLG_SetFocus
+ *
+ * Set the focus to a control of the dialog, selecting the text if
+ * the control is an edit dialog.
+ */
+static void DEFDLG_SetFocus( HWND hwndDlg, HWND hwndCtrl )
+{
+ if (SendMessageW( hwndCtrl, WM_GETDLGCODE, 0, 0 ) & DLGC_HASSETSEL)
+ SendMessageW( hwndCtrl, EM_SETSEL, 0, -1 );
+ SetFocus( hwndCtrl );
+}
+
+
+/***********************************************************************
+ * DEFDLG_SaveFocus
+ */
+static void DEFDLG_SaveFocus( HWND hwnd )
+{
+ DIALOGINFO *infoPtr;
+ HWND hwndFocus = GetFocus();
+
+ if (!hwndFocus || !IsChild( hwnd, hwndFocus )) return;
+ if (!(infoPtr = GETDLGINFO(hwnd))) return;
+ infoPtr->hwndFocus = hwndFocus;
+ /* Remove default button */
+}
+
+
+/***********************************************************************
+ * DEFDLG_RestoreFocus
+ */
+static void DEFDLG_RestoreFocus( HWND hwnd )
+{
+ DIALOGINFO *infoPtr;
+
+ if (IsIconic( hwnd )) return;
+ if (!(infoPtr = GETDLGINFO(hwnd))) return;
+ /* Don't set the focus back to controls if EndDialog is already called.*/
+ if (infoPtr->flags & DF_END) return;
+ if (!IsWindow(infoPtr->hwndFocus) || infoPtr->hwndFocus == hwnd) {
+ /* If no saved focus control exists, set focus to the first visible,
+ non-disabled, WS_TABSTOP control in the dialog */
+ infoPtr->hwndFocus = GetNextDlgTabItem( hwnd, 0, FALSE );
+ if (!IsWindow( infoPtr->hwndFocus )) return;
+ }
+ DEFDLG_SetFocus( hwnd, infoPtr->hwndFocus );
+
+ /* This used to set infoPtr->hwndFocus to NULL for no apparent reason,
+ sometimes losing focus when receiving WM_SETFOCUS messages. */
+}
+
+/***********************************************************************
* DIALOG_CreateIndirect
* Creates a dialog box window
*
@@ -923,6 +975,9 @@
if( dlgInfo->hwndFocus )
SetFocus( dlgInfo->hwndFocus );
}
+//// ReactOS
+ DEFDLG_SaveFocus( hwnd );
+////
}
//// ReactOS Rev 30613 & 30644
if (!(GetWindowLongPtrW( hwnd, GWL_STYLE ) & WS_CHILD))
@@ -938,60 +993,6 @@
if( IsWindow(hwnd) ) DestroyWindow( hwnd );
return 0;
}
-
-
-/***********************************************************************
- * DEFDLG_SetFocus
- *
- * Set the focus to a control of the dialog, selecting the text if
- * the control is an edit dialog.
- */
-static void DEFDLG_SetFocus( HWND hwndDlg, HWND hwndCtrl )
-{
- if (SendMessageW( hwndCtrl, WM_GETDLGCODE, 0, 0 ) & DLGC_HASSETSEL)
- SendMessageW( hwndCtrl, EM_SETSEL, 0, -1 );
- SetFocus( hwndCtrl );
-}
-
-
-/***********************************************************************
- * DEFDLG_SaveFocus
- */
-static void DEFDLG_SaveFocus( HWND hwnd )
-{
- DIALOGINFO *infoPtr;
- HWND hwndFocus = GetFocus();
-
- if (!hwndFocus || !IsChild( hwnd, hwndFocus )) return;
- if (!(infoPtr = GETDLGINFO(hwnd))) return;
- infoPtr->hwndFocus = hwndFocus;
- /* Remove default button */
-}
-
-
-/***********************************************************************
- * DEFDLG_RestoreFocus
- */
-static void DEFDLG_RestoreFocus( HWND hwnd )
-{
- DIALOGINFO *infoPtr;
-
- if (IsIconic( hwnd )) return;
- if (!(infoPtr = GETDLGINFO(hwnd))) return;
- /* Don't set the focus back to controls if EndDialog is already called.*/
- if (infoPtr->flags & DF_END) return;
- if (!IsWindow(infoPtr->hwndFocus) || infoPtr->hwndFocus == hwnd) {
- /* If no saved focus control exists, set focus to the first visible,
- non-disabled, WS_TABSTOP control in the dialog */
- infoPtr->hwndFocus = GetNextDlgTabItem( hwnd, 0, FALSE );
- if (!IsWindow( infoPtr->hwndFocus )) return;
- }
- DEFDLG_SetFocus( hwnd, infoPtr->hwndFocus );
-
- /* This used to set infoPtr->hwndFocus to NULL for no apparent reason,
- sometimes losing focus when receiving WM_SETFOCUS messages. */
-}
-
/***********************************************************************
* DEFDLG_FindDefButton
Author: fireball
Date: Mon Oct 12 12:22:32 2009
New Revision: 43393
URL: http://svn.reactos.org/svn/reactos?rev=43393&view=rev
Log:
[fastfat_new]
- Implement a stub version of basic information query. Fixes an "autochk.exe" not found problem.
Modified:
trunk/reactos/drivers/filesystems/fastfat_new/finfo.c
Modified: trunk/reactos/drivers/filesystems/fastfat_new/finfo.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/fastfa…
==============================================================================
--- trunk/reactos/drivers/filesystems/fastfat_new/finfo.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/fastfat_new/finfo.c [iso-8859-1] Mon Oct 12 12:22:32 2009
@@ -12,6 +12,41 @@
#include "fastfat.h"
/* FUNCTIONS ****************************************************************/
+
+VOID
+NTAPI
+FatiQueryBasicInformation(IN PFAT_IRP_CONTEXT IrpContext,
+ IN PFCB Fcb,
+ IN PFILE_OBJECT FileObject,
+ IN OUT PFILE_BASIC_INFORMATION Buffer,
+ IN OUT PLONG Length)
+{
+ /* Zero the buffer */
+ RtlZeroMemory(Buffer, sizeof(FILE_BASIC_INFORMATION));
+
+ /* Deduct the written length */
+ *Length -= sizeof(FILE_BASIC_INFORMATION);
+
+ /* Check if it's a dir or a file */
+ if (FatNodeType(Fcb) == FAT_NTC_FCB)
+ {
+ // FIXME: Read dirent and get times from there
+ Buffer->LastAccessTime.QuadPart = 0;
+ Buffer->CreationTime.QuadPart = 0;
+ Buffer->LastWriteTime.QuadPart = 0;
+ }
+ else
+ {
+ // FIXME: May not be really correct
+ Buffer->FileAttributes = 0;
+ DPRINT1("Basic info of a directory '%wZ' is requested!\n", &Fcb->FullFileName);
+ }
+
+
+ /* If attribute is 0, set normal */
+ if (Buffer->FileAttributes == 0)
+ Buffer->FileAttributes = FILE_ATTRIBUTE_NORMAL;
+}
VOID
NTAPI
@@ -172,6 +207,9 @@
switch (InfoClass)
{
+ case FileBasicInformation:
+ FatiQueryBasicInformation(IrpContext, Fcb, FileObject, Buffer, &Length);
+ break;
case FileStandardInformation:
FatiQueryStandardInformation(IrpContext, Fcb, FileObject, Buffer, &Length);
break;