Rebase against 1582ae6b045bb1658f6d5bc83efc5f6ce042c06e

This commit is contained in:
Alistair Leslie-Hughes 2018-11-29 08:49:50 +11:00
parent d792ec8a45
commit 3fe5e9d97b
12 changed files with 14 additions and 615 deletions

View File

@ -4,4 +4,3 @@ Fixes: Implement ntoskrnl.NtBuildNumber
Fixes: Implement ntoskrnl.ExInitializeNPagedLookasideList
# ExInitializeNPagedLookasideList() is wanted by sfvfs02.sys, used by World Racing.
Depends: Compiler_Warnings
Depends: ntoskrnl-Synchronization

View File

@ -1,86 +0,0 @@
From c0897350d30abc3cfa7ee691ff99be58eb5c7456 Mon Sep 17 00:00:00 2001
From: Zebediah Figura <z.figura12@gmail.com>
Date: Sun, 19 Aug 2018 22:30:05 -0500
Subject: [PATCH 13/17] ntoskrnl.exe: Implement KeInitializeTimerEx().
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
---
dlls/ntoskrnl.exe/ntoskrnl.c | 21 ---------------------
dlls/ntoskrnl.exe/sync.c | 25 +++++++++++++++++++++++++
2 files changed, 25 insertions(+), 21 deletions(-)
diff --git a/dlls/ntoskrnl.exe/ntoskrnl.c b/dlls/ntoskrnl.exe/ntoskrnl.c
index 5034c5d..24afdb6 100644
--- a/dlls/ntoskrnl.exe/ntoskrnl.c
+++ b/dlls/ntoskrnl.exe/ntoskrnl.c
@@ -2093,27 +2093,6 @@ void WINAPI KeInitializeSpinLock( PKSPIN_LOCK SpinLock )
FIXME( "stub: %p\n", SpinLock );
}
-
-/***********************************************************************
- * KeInitializeTimerEx (NTOSKRNL.EXE.@)
- */
-void WINAPI KeInitializeTimerEx( PKTIMER Timer, TIMER_TYPE Type )
-{
- FIXME( "stub: %p %d\n", Timer, Type );
-
- RtlZeroMemory(Timer, sizeof(KTIMER));
- Timer->Header.Type = Type ? 9 : 8;
-}
-
-
-/***********************************************************************
- * KeInitializeTimer (NTOSKRNL.EXE.@)
- */
-void WINAPI KeInitializeTimer( PKTIMER Timer )
-{
- KeInitializeTimerEx(Timer, NotificationTimer);
-}
-
/***********************************************************************
* KeInsertQueue (NTOSKRNL.EXE.@)
*/
diff --git a/dlls/ntoskrnl.exe/sync.c b/dlls/ntoskrnl.exe/sync.c
index acbbe3b..998cdf1 100644
--- a/dlls/ntoskrnl.exe/sync.c
+++ b/dlls/ntoskrnl.exe/sync.c
@@ -40,6 +40,8 @@ enum object_type
TYPE_AUTO_EVENT = 1,
TYPE_MUTEX = 2,
TYPE_SEMAPHORE = 5,
+ TYPE_MANUAL_TIMER = 8,
+ TYPE_AUTO_TIMER = 9,
};
static CRITICAL_SECTION sync_cs;
@@ -292,3 +294,26 @@ LONG WINAPI KeReleaseMutex( PRKMUTEX mutex, BOOLEAN wait )
return ret;
}
+
+/***********************************************************************
+ * KeInitializeTimerEx (NTOSKRNL.EXE.@)
+ */
+void WINAPI KeInitializeTimerEx( KTIMER *timer, TIMER_TYPE type )
+{
+ TRACE("timer %p, type %u.\n", timer, type);
+
+ RtlZeroMemory(timer, sizeof(KTIMER));
+ timer->Header.Type = (type == NotificationTimer) ? TYPE_MANUAL_TIMER : TYPE_AUTO_TIMER;
+ timer->Header.SignalState = FALSE;
+ timer->Header.Inserted = FALSE;
+ timer->Header.WaitListHead.Blink = NULL;
+ timer->Header.WaitListHead.Flink = NULL;
+}
+
+/***********************************************************************
+ * KeInitializeTimer (NTOSKRNL.EXE.@)
+ */
+void WINAPI KeInitializeTimer( KTIMER *timer )
+{
+ KeInitializeTimerEx(timer, NotificationTimer);
+}
--
2.7.4

View File

@ -1,101 +0,0 @@
From fc0b6eb91c49485a5f85e1df4f78e58e5e92fc93 Mon Sep 17 00:00:00 2001
From: Zebediah Figura <z.figura12@gmail.com>
Date: Sun, 19 Aug 2018 22:52:48 -0500
Subject: [PATCH 14/17] ntoskrnl.exe: Implement KeSetTimerEx() and waiting on
timers.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
---
dlls/ntoskrnl.exe/ntoskrnl.c | 9 ---------
dlls/ntoskrnl.exe/sync.c | 31 +++++++++++++++++++++++++++++++
include/ddk/wdm.h | 1 +
3 files changed, 32 insertions(+), 9 deletions(-)
diff --git a/dlls/ntoskrnl.exe/ntoskrnl.c b/dlls/ntoskrnl.exe/ntoskrnl.c
index 24afdb6..a7638c9 100644
--- a/dlls/ntoskrnl.exe/ntoskrnl.c
+++ b/dlls/ntoskrnl.exe/ntoskrnl.c
@@ -3625,15 +3625,6 @@ void WINAPI IoInvalidateDeviceRelations( DEVICE_OBJECT *device_object, DEVICE_RE
}
/***********************************************************************
- * KeSetTimerEx (NTOSKRNL.EXE.@)
- */
-BOOL WINAPI KeSetTimerEx( KTIMER *timer, LARGE_INTEGER duetime, LONG period, KDPC *dpc )
-{
- FIXME("stub: %p %s %u %p\n", timer, wine_dbgstr_longlong(duetime.QuadPart), period, dpc);
- return TRUE;
-}
-
-/***********************************************************************
* IoCreateFile (NTOSKRNL.EXE.@)
*/
NTSTATUS WINAPI IoCreateFile(HANDLE *handle, ACCESS_MASK access, OBJECT_ATTRIBUTES *attr,
diff --git a/dlls/ntoskrnl.exe/sync.c b/dlls/ntoskrnl.exe/sync.c
index 998cdf1..46c214c 100644
--- a/dlls/ntoskrnl.exe/sync.c
+++ b/dlls/ntoskrnl.exe/sync.c
@@ -96,6 +96,9 @@ NTSTATUS WINAPI KeWaitForMultipleObjects(ULONG count, void *pobjs[],
semaphore->Header.SignalState, semaphore->Limit, NULL );
break;
}
+ case TYPE_MANUAL_TIMER:
+ case TYPE_AUTO_TIMER:
+ break;
}
}
@@ -113,6 +116,7 @@ NTSTATUS WINAPI KeWaitForMultipleObjects(ULONG count, void *pobjs[],
switch (objs[i]->Type)
{
case TYPE_AUTO_EVENT:
+ case TYPE_AUTO_TIMER:
objs[i]->SignalState = FALSE;
break;
case TYPE_MUTEX:
@@ -317,3 +321,30 @@ void WINAPI KeInitializeTimer( KTIMER *timer )
{
KeInitializeTimerEx(timer, NotificationTimer);
}
+
+/***********************************************************************
+ * KeSetTimerEx (NTOSKRNL.EXE.@)
+ */
+BOOLEAN WINAPI KeSetTimerEx( KTIMER *timer, LARGE_INTEGER duetime, LONG period, KDPC *dpc )
+{
+ BOOL manual = timer->Header.Type == TYPE_MANUAL_TIMER;
+ BOOL ret;
+
+ TRACE("timer %p, duetime %s, period %d, dpc %p.\n",
+ timer, wine_dbgstr_longlong(duetime.QuadPart), period, dpc);
+
+ if (dpc)
+ {
+ FIXME("Unhandled DPC %p.\n", dpc);
+ return FALSE;
+ }
+
+ EnterCriticalSection( &sync_cs );
+ ret = timer->Header.Inserted;
+ timer->Header.Inserted = TRUE;
+ timer->Header.WaitListHead.Blink = CreateWaitableTimerW( NULL, manual, NULL );
+ SetWaitableTimer( timer->Header.WaitListHead.Blink, &duetime, period, NULL, NULL, FALSE );
+ LeaveCriticalSection( &sync_cs );
+
+ return ret;
+}
diff --git a/include/ddk/wdm.h b/include/ddk/wdm.h
index c8adc7d..483ee9f 100644
--- a/include/ddk/wdm.h
+++ b/include/ddk/wdm.h
@@ -1433,6 +1433,7 @@ LONG WINAPI KeResetEvent(PRKEVENT);
LONG WINAPI KeSetEvent(PRKEVENT,KPRIORITY,BOOLEAN);
KPRIORITY WINAPI KeSetPriorityThread(PKTHREAD,KPRIORITY);
void WINAPI KeSetSystemAffinityThread(KAFFINITY);
+BOOLEAN WINAPI KeSetTimerEx(KTIMER*,LARGE_INTEGER,LONG,KDPC*);
NTSTATUS WINAPI KeWaitForMultipleObjects(ULONG,void*[],WAIT_TYPE,KWAIT_REASON,KPROCESSOR_MODE,BOOLEAN,LARGE_INTEGER*,KWAIT_BLOCK*);
NTSTATUS WINAPI KeWaitForSingleObject(void*,KWAIT_REASON,KPROCESSOR_MODE,BOOLEAN,LARGE_INTEGER*);
--
2.7.4

View File

@ -1,64 +0,0 @@
From 5ed6dd1e495351cb271ea302ad90689c76790f03 Mon Sep 17 00:00:00 2001
From: Zebediah Figura <z.figura12@gmail.com>
Date: Sun, 19 Aug 2018 23:26:07 -0500
Subject: [PATCH 15/17] ntoskrnl.exe: Implement KeCancelTimer().
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
---
dlls/ntoskrnl.exe/ntoskrnl.exe.spec | 2 +-
dlls/ntoskrnl.exe/sync.c | 16 ++++++++++++++++
include/ddk/wdm.h | 1 +
3 files changed, 18 insertions(+), 1 deletion(-)
diff --git a/dlls/ntoskrnl.exe/ntoskrnl.exe.spec b/dlls/ntoskrnl.exe/ntoskrnl.exe.spec
index f089f41..a22acf6 100644
--- a/dlls/ntoskrnl.exe/ntoskrnl.exe.spec
+++ b/dlls/ntoskrnl.exe/ntoskrnl.exe.spec
@@ -517,7 +517,7 @@
@ stub KeAttachProcess
@ stub KeBugCheck
@ stub KeBugCheckEx
-@ stub KeCancelTimer
+@ stdcall KeCancelTimer(ptr)
@ stub KeCapturePersistentThreadState
@ stdcall KeClearEvent(ptr)
@ stub KeConnectInterrupt
diff --git a/dlls/ntoskrnl.exe/sync.c b/dlls/ntoskrnl.exe/sync.c
index 46c214c..1b7650d 100644
--- a/dlls/ntoskrnl.exe/sync.c
+++ b/dlls/ntoskrnl.exe/sync.c
@@ -348,3 +348,19 @@ BOOLEAN WINAPI KeSetTimerEx( KTIMER *timer, LARGE_INTEGER duetime, LONG period,
return ret;
}
+
+BOOLEAN WINAPI KeCancelTimer( KTIMER *timer )
+{
+ BOOL ret;
+
+ TRACE("timer %p.\n", timer);
+
+ EnterCriticalSection( &sync_cs );
+ ret = timer->Header.Inserted;
+ timer->Header.Inserted = FALSE;
+ CloseHandle(timer->Header.WaitListHead.Blink);
+ timer->Header.WaitListHead.Blink = NULL;
+ LeaveCriticalSection( &sync_cs );
+
+ return ret;
+}
diff --git a/include/ddk/wdm.h b/include/ddk/wdm.h
index 483ee9f..6be07b2 100644
--- a/include/ddk/wdm.h
+++ b/include/ddk/wdm.h
@@ -1418,6 +1418,7 @@ void WINAPI IoReleaseCancelSpinLock(KIRQL);
NTSTATUS WINAPI IoSetDeviceInterfaceState(UNICODE_STRING*,BOOLEAN);
NTSTATUS WINAPI IoWMIRegistrationControl(PDEVICE_OBJECT,ULONG);
+BOOLEAN WINAPI KeCancelTimer(KTIMER*);
void WINAPI KeClearEvent(PRKEVENT);
PKTHREAD WINAPI KeGetCurrentThread(void);
void WINAPI KeInitializeEvent(PRKEVENT,EVENT_TYPE,BOOLEAN);
--
2.7.4

View File

@ -1,82 +0,0 @@
From 3a663c622c17698fb567767ad15bb2e4d7e87671 Mon Sep 17 00:00:00 2001
From: Zebediah Figura <z.figura12@gmail.com>
Date: Sun, 19 Aug 2018 23:44:44 -0500
Subject: [PATCH 16/17] ntoskrnl.exe/tests: Add tests for waiting on timers.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
---
dlls/ntoskrnl.exe/tests/driver.c | 51 ++++++++++++++++++++++++++++++++++++++++
1 file changed, 51 insertions(+)
diff --git a/dlls/ntoskrnl.exe/tests/driver.c b/dlls/ntoskrnl.exe/tests/driver.c
index e758e3f..efd6053 100644
--- a/dlls/ntoskrnl.exe/tests/driver.c
+++ b/dlls/ntoskrnl.exe/tests/driver.c
@@ -260,6 +260,8 @@ static void test_sync(void)
{
KSEMAPHORE semaphore, semaphore2;
KEVENT manual_event, auto_event;
+ KTIMER timer;
+ LARGE_INTEGER timeout;
void *objs[2];
NTSTATUS ret;
int i;
@@ -444,6 +446,55 @@ static void test_sync(void)
ok(ret == 0, "got %#x\n", ret);
run_thread(mutex_thread, (void *)0);
+
+ /* test timers */
+ KeInitializeTimerEx(&timer, NotificationTimer);
+
+ timeout.QuadPart = -100;
+ KeSetTimerEx(&timer, timeout, 0, NULL);
+
+ ret = wait_single(&timer, 0);
+ ok(ret == WAIT_TIMEOUT, "got %#x\n", ret);
+
+ ret = wait_single(&timer, -200);
+ ok(ret == 0, "got %#x\n", ret);
+
+ ret = wait_single(&timer, 0);
+ ok(ret == 0, "got %#x\n", ret);
+
+ KeCancelTimer(&timer);
+ KeInitializeTimerEx(&timer, SynchronizationTimer);
+
+ KeSetTimerEx(&timer, timeout, 0, NULL);
+
+ ret = wait_single(&timer, 0);
+ ok(ret == WAIT_TIMEOUT, "got %#x\n", ret);
+
+ ret = wait_single(&timer, -200);
+ ok(ret == 0, "got %#x\n", ret);
+
+ ret = wait_single(&timer, 0);
+ ok(ret == WAIT_TIMEOUT, "got %#x\n", ret);
+
+ KeCancelTimer(&timer);
+ KeSetTimerEx(&timer, timeout, 10, NULL);
+
+ ret = wait_single(&timer, 0);
+ ok(ret == WAIT_TIMEOUT, "got %#x\n", ret);
+
+ ret = wait_single(&timer, -200);
+ ok(ret == 0, "got %#x\n", ret);
+
+ ret = wait_single(&timer, 0);
+ ok(ret == WAIT_TIMEOUT, "got %#x\n", ret);
+
+ ret = wait_single(&timer, -20 * 10000);
+ ok(ret == 0, "got %#x\n", ret);
+
+ ret = wait_single(&timer, -20 * 10000);
+ ok(ret == 0, "got %#x\n", ret);
+
+ KeCancelTimer(&timer);
}
static NTSTATUS main_test(IRP *irp, IO_STACK_LOCATION *stack, ULONG_PTR *info)
--
2.7.4

View File

@ -1,64 +0,0 @@
From 0f4c4d67760fc31cbb92112be492f9ede35a6170 Mon Sep 17 00:00:00 2001
From: Zebediah Figura <z.figura12@gmail.com>
Date: Wed, 22 Aug 2018 13:29:56 -0500
Subject: [PATCH 17/17] ntoskrnl.exe: Implement KeDelayExecutionThread().
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
---
dlls/ntoskrnl.exe/ntoskrnl.c | 9 ---------
dlls/ntoskrnl.exe/sync.c | 9 +++++++++
include/ddk/wdm.h | 1 +
3 files changed, 10 insertions(+), 9 deletions(-)
diff --git a/dlls/ntoskrnl.exe/ntoskrnl.c b/dlls/ntoskrnl.exe/ntoskrnl.c
index a7638c9..32fd1d0 100644
--- a/dlls/ntoskrnl.exe/ntoskrnl.c
+++ b/dlls/ntoskrnl.exe/ntoskrnl.c
@@ -2998,15 +2998,6 @@ NTSTATUS WINAPI CmUnRegisterCallback(LARGE_INTEGER cookie)
}
/***********************************************************************
- * KeDelayExecutionThread (NTOSKRNL.EXE.@)
- */
-NTSTATUS WINAPI KeDelayExecutionThread(KPROCESSOR_MODE waitmode, BOOLEAN alertable, PLARGE_INTEGER interval)
-{
- FIXME("(%u, %u, %p): stub\n", waitmode, alertable, interval);
- return STATUS_NOT_IMPLEMENTED;
-}
-
-/***********************************************************************
* IoAttachDevice (NTOSKRNL.EXE.@)
*/
NTSTATUS WINAPI IoAttachDevice(DEVICE_OBJECT *source, UNICODE_STRING *target, DEVICE_OBJECT *attached)
diff --git a/dlls/ntoskrnl.exe/sync.c b/dlls/ntoskrnl.exe/sync.c
index 1b7650d..21778a3 100644
--- a/dlls/ntoskrnl.exe/sync.c
+++ b/dlls/ntoskrnl.exe/sync.c
@@ -364,3 +364,12 @@ BOOLEAN WINAPI KeCancelTimer( KTIMER *timer )
return ret;
}
+
+/***********************************************************************
+ * KeDelayExecutionThread (NTOSKRNL.EXE.@)
+ */
+NTSTATUS WINAPI KeDelayExecutionThread( KPROCESSOR_MODE mode, BOOLEAN alertable, LARGE_INTEGER *timeout )
+{
+ TRACE("mode %d, alertable %u, timeout %p.\n", mode, alertable, timeout);
+ return NtDelayExecution( alertable, timeout );
+}
diff --git a/include/ddk/wdm.h b/include/ddk/wdm.h
index 6be07b2..b5e4424 100644
--- a/include/ddk/wdm.h
+++ b/include/ddk/wdm.h
@@ -1420,6 +1420,7 @@ NTSTATUS WINAPI IoWMIRegistrationControl(PDEVICE_OBJECT,ULONG);
BOOLEAN WINAPI KeCancelTimer(KTIMER*);
void WINAPI KeClearEvent(PRKEVENT);
+NTSTATUS WINAPI KeDelayExecutionThread(KPROCESSOR_MODE,BOOLEAN,LARGE_INTEGER*);
PKTHREAD WINAPI KeGetCurrentThread(void);
void WINAPI KeInitializeEvent(PRKEVENT,EVENT_TYPE,BOOLEAN);
void WINAPI KeInitializeMutex(PRKMUTEX,ULONG);
--
2.7.4

View File

@ -1,2 +0,0 @@
Fixes: Implement ntoskrnl.KeInitializeMutex
Fixes: [44588] Multiple kernel drivers need ntoskrnl.exe.KeWaitForMultipleObjects semi-stub (Franson VSerial service 'bizvserialnt.sys')

View File

@ -52,7 +52,7 @@ usage()
# Get the upstream commit sha
upstream_commit()
{
echo "00b08fad99745db326ef060627c3e9dc668a734a"
echo "1582ae6b045bb1658f6d5bc83efc5f6ce042c06e"
}
# Show version information
@ -242,7 +242,6 @@ patch_enable_all ()
enable_ntdll_futex_condition_var="$1"
enable_ntdll_set_full_cpu_context="$1"
enable_ntoskrnl_Stubs="$1"
enable_ntoskrnl_Synchronization="$1"
enable_ntoskrnl_exe_Fix_Relocation="$1"
enable_nvapi_Stub_DLL="$1"
enable_nvcuda_CUDA_Support="$1"
@ -306,7 +305,6 @@ patch_enable_all ()
enable_taskmgr_Memory_Usage="$1"
enable_uianimation_stubs="$1"
enable_user32_DM_SETDEFID="$1"
enable_user32_Dialog_Focus="$1"
enable_user32_Dialog_Paint_Event="$1"
enable_user32_DrawMenuItem="$1"
enable_user32_DrawTextExW="$1"
@ -887,9 +885,6 @@ patch_enable ()
ntoskrnl-Stubs)
enable_ntoskrnl_Stubs="$2"
;;
ntoskrnl-Synchronization)
enable_ntoskrnl_Synchronization="$2"
;;
ntoskrnl.exe-Fix_Relocation)
enable_ntoskrnl_exe_Fix_Relocation="$2"
;;
@ -1079,9 +1074,6 @@ patch_enable ()
user32-DM_SETDEFID)
enable_user32_DM_SETDEFID="$2"
;;
user32-Dialog_Focus)
enable_user32_Dialog_Focus="$2"
;;
user32-Dialog_Paint_Event)
enable_user32_Dialog_Paint_Event="$2"
;;
@ -1978,11 +1970,7 @@ if test "$enable_ntoskrnl_Stubs" -eq 1; then
if test "$enable_Compiler_Warnings" -gt 1; then
abort "Patchset Compiler_Warnings disabled, but ntoskrnl-Stubs depends on that."
fi
if test "$enable_ntoskrnl_Synchronization" -gt 1; then
abort "Patchset ntoskrnl-Synchronization disabled, but ntoskrnl-Stubs depends on that."
fi
enable_Compiler_Warnings=1
enable_ntoskrnl_Synchronization=1
fi
if test "$enable_ntdll_SystemRoot_Symlink" -eq 1; then
@ -5243,35 +5231,10 @@ if test "$enable_ntdll_set_full_cpu_context" -eq 1; then
) >> "$patchlist"
fi
# Patchset ntoskrnl-Synchronization
# |
# | This patchset fixes the following Wine bugs:
# | * [#44588] Multiple kernel drivers need ntoskrnl.exe.KeWaitForMultipleObjects semi-stub (Franson VSerial service
# | 'bizvserialnt.sys')
# |
# | Modified files:
# | * dlls/ntoskrnl.exe/ntoskrnl.c, dlls/ntoskrnl.exe/ntoskrnl.exe.spec, dlls/ntoskrnl.exe/sync.c,
# | dlls/ntoskrnl.exe/tests/driver.c, include/ddk/wdm.h
# |
if test "$enable_ntoskrnl_Synchronization" -eq 1; then
patch_apply ntoskrnl-Synchronization/0013-ntoskrnl.exe-Implement-KeInitializeTimerEx.patch
patch_apply ntoskrnl-Synchronization/0014-ntoskrnl.exe-Implement-KeSetTimerEx-and-waiting-on-t.patch
patch_apply ntoskrnl-Synchronization/0015-ntoskrnl.exe-Implement-KeCancelTimer.patch
patch_apply ntoskrnl-Synchronization/0016-ntoskrnl.exe-tests-Add-tests-for-waiting-on-timers.patch
patch_apply ntoskrnl-Synchronization/0017-ntoskrnl.exe-Implement-KeDelayExecutionThread.patch
(
printf '%s\n' '+ { "Zebediah Figura", "ntoskrnl.exe: Implement KeInitializeTimerEx().", 1 },';
printf '%s\n' '+ { "Zebediah Figura", "ntoskrnl.exe: Implement KeSetTimerEx() and waiting on timers.", 1 },';
printf '%s\n' '+ { "Zebediah Figura", "ntoskrnl.exe: Implement KeCancelTimer().", 1 },';
printf '%s\n' '+ { "Zebediah Figura", "ntoskrnl.exe/tests: Add tests for waiting on timers.", 1 },';
printf '%s\n' '+ { "Zebediah Figura", "ntoskrnl.exe: Implement KeDelayExecutionThread().", 1 },';
) >> "$patchlist"
fi
# Patchset ntoskrnl-Stubs
# |
# | This patchset has the following (direct or indirect) dependencies:
# | * Compiler_Warnings, ntoskrnl-Synchronization
# | * Compiler_Warnings
# |
# | Modified files:
# | * dlls/ntoskrnl.exe/ntoskrnl.c, dlls/ntoskrnl.exe/ntoskrnl.exe.spec, dlls/ntoskrnl.exe/tests/driver.c, include/ddk/wdm.h,
@ -6401,23 +6364,6 @@ if test "$enable_user32_DM_SETDEFID" -eq 1; then
) >> "$patchlist"
fi
# Patchset user32-Dialog_Focus
# |
# | This patchset fixes the following Wine bugs:
# | * [#5402] Set focus to dialog itself when it has no controls
# |
# | Modified files:
# | * dlls/user32/dialog.c, dlls/user32/tests/msg.c
# |
if test "$enable_user32_Dialog_Focus" -eq 1; then
patch_apply user32-Dialog_Focus/0001-user32-tests-Add-a-focus-test-for-an-empty-dialog-th.patch
patch_apply user32-Dialog_Focus/0002-user32-If-there-is-no-dialog-controls-to-set-focus-t.patch
(
printf '%s\n' '+ { "Dmitry Timoshkov", "user32/tests: Add a focus test for an empty dialog that returns TRUE in WM_INITDIALOG.", 1 },';
printf '%s\n' '+ { "Dmitry Timoshkov", "user32: If there is no dialog controls to set focus to then set focus to dialog itself.", 1 },';
) >> "$patchlist"
fi
# Patchset user32-Dialog_Paint_Event
# |
# | This patchset fixes the following Wine bugs:
@ -7361,7 +7307,7 @@ fi
# Patchset winedevice-Default_Drivers
# |
# | This patchset has the following (direct or indirect) dependencies:
# | * dxva2-Video_Decoder, Compiler_Warnings, ntoskrnl-Synchronization, ntoskrnl-Stubs
# | * dxva2-Video_Decoder, Compiler_Warnings, ntoskrnl-Stubs
# |
# | Modified files:
# | * configure.ac, dlls/dxgkrnl.sys/Makefile.in, dlls/dxgkrnl.sys/dxgkrnl.sys.spec, dlls/dxgkrnl.sys/main.c,

View File

@ -1,89 +0,0 @@
From 49eb0726c01fea7c23da79baef3624a71830b65b Mon Sep 17 00:00:00 2001
From: Dmitry Timoshkov <dmitry@baikal.ru>
Date: Tue, 31 Jan 2017 18:21:22 +0800
Subject: user32/tests: Add a focus test for an empty dialog that returns TRUE
in WM_INITDIALOG.
---
dlls/user32/tests/msg.c | 42 +++++++++++++++++++++++++++++++++++++++++-
1 file changed, 41 insertions(+), 1 deletion(-)
diff --git a/dlls/user32/tests/msg.c b/dlls/user32/tests/msg.c
index c608c11c223..39093a528e1 100644
--- a/dlls/user32/tests/msg.c
+++ b/dlls/user32/tests/msg.c
@@ -12169,6 +12169,8 @@ static INT_PTR WINAPI test_dlg_proc(HWND hwnd, UINT message, WPARAM wParam, LPAR
switch (message)
{
case WM_INITDIALOG:
+ return lParam;
+
case WM_GETDLGCODE:
return 0;
}
@@ -12277,6 +12279,20 @@ static const struct message WmDefDlgSetFocus_2[] = {
{ 0 }
};
/* Creation of a dialog */
+static const struct message WmCreateDialogParamSeq_0[] = {
+ { HCBT_CREATEWND, hook },
+ { WM_NCCREATE, sent },
+ { WM_NCCALCSIZE, sent|wparam, 0 },
+ { WM_CREATE, sent },
+ { EVENT_OBJECT_CREATE, winevent_hook|wparam|lparam, 0, 0 },
+ { WM_SIZE, sent|wparam, SIZE_RESTORED },
+ { WM_MOVE, sent },
+ { WM_SETFONT, sent },
+ { WM_INITDIALOG, sent },
+ { WM_CHANGEUISTATE, sent|optional },
+ { 0 }
+};
+/* Creation of a dialog */
static const struct message WmCreateDialogParamSeq_1[] = {
{ HCBT_CREATEWND, hook },
{ WM_NCCREATE, sent },
@@ -12287,6 +12303,14 @@ static const struct message WmCreateDialogParamSeq_1[] = {
{ WM_MOVE, sent },
{ WM_SETFONT, sent },
{ WM_INITDIALOG, sent },
+ { WM_GETDLGCODE, sent|wparam|lparam, 0, 0 },
+ { HCBT_SETFOCUS, hook },
+ { HCBT_ACTIVATE, hook },
+ { WM_WINDOWPOSCHANGING, sent|wparam, SWP_NOSIZE|SWP_NOMOVE },
+ { WM_ACTIVATEAPP, sent|wparam, 1 },
+ { WM_NCACTIVATE, sent },
+ { WM_ACTIVATE, sent|wparam, 1 },
+ { WM_SETFOCUS, sent },
{ WM_CHANGEUISTATE, sent|optional },
{ 0 }
};
@@ -12450,9 +12474,25 @@ static void test_dialog_messages(void)
cls.lpfnWndProc = test_dlg_proc;
if (!RegisterClassA(&cls)) assert(0);
+ SetFocus(0);
+ flush_sequence();
hdlg = CreateDialogParamA(0, "CLASS_TEST_DIALOG_2", 0, test_dlg_proc, 0);
ok(IsWindow(hdlg), "CreateDialogParam failed\n");
- ok_sequence(WmCreateDialogParamSeq_1, "CreateDialogParam_1", FALSE);
+ ok_sequence(WmCreateDialogParamSeq_0, "CreateDialogParam_0", FALSE);
+ hfocus = GetFocus();
+ ok(hfocus == 0, "wrong focus %p\n", hfocus);
+ EndDialog(hdlg, 0);
+ DestroyWindow(hdlg);
+ flush_sequence();
+
+ SetFocus(0);
+ flush_sequence();
+ hdlg = CreateDialogParamA(0, "CLASS_TEST_DIALOG_2", 0, test_dlg_proc, 1);
+ ok(IsWindow(hdlg), "CreateDialogParam failed\n");
+ ok_sequence(WmCreateDialogParamSeq_1, "CreateDialogParam_1", TRUE);
+ hfocus = GetFocus();
+todo_wine
+ ok(hfocus == hdlg, "wrong focus %p\n", hfocus);
EndDialog(hdlg, 0);
DestroyWindow(hdlg);
flush_sequence();
--
2.11.0

View File

@ -1,57 +0,0 @@
From 502fd4e2b80cd483ad3db0ed39a92998b4860777 Mon Sep 17 00:00:00 2001
From: Dmitry Timoshkov <dmitry@baikal.ru>
Date: Tue, 31 Jan 2017 18:50:38 +0800
Subject: user32: If there is no dialog controls to set focus to then set focus
to dialog itself.
---
dlls/user32/dialog.c | 2 ++
dlls/user32/tests/msg.c | 9 +++++----
2 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/dlls/user32/dialog.c b/dlls/user32/dialog.c
index 8b77ae2158b..61aa6d3eff3 100644
--- a/dlls/user32/dialog.c
+++ b/dlls/user32/dialog.c
@@ -690,6 +690,8 @@ static HWND DIALOG_CreateIndirect( HINSTANCE hInst, LPCVOID dlgTemplate,
SendMessageW( focus, EM_SETSEL, 0, MAXLONG );
SetFocus( focus );
}
+ else
+ SetFocus( hwnd );
}
}
diff --git a/dlls/user32/tests/msg.c b/dlls/user32/tests/msg.c
index 39093a528e1..6f835f9f6cd 100644
--- a/dlls/user32/tests/msg.c
+++ b/dlls/user32/tests/msg.c
@@ -12303,10 +12303,12 @@ static const struct message WmCreateDialogParamSeq_1[] = {
{ WM_MOVE, sent },
{ WM_SETFONT, sent },
{ WM_INITDIALOG, sent },
- { WM_GETDLGCODE, sent|wparam|lparam, 0, 0 },
+ { WM_GETDLGCODE, sent|wparam|lparam|optional, 0, 0 }, /* FIXME: Wine doesn't send it */
{ HCBT_SETFOCUS, hook },
{ HCBT_ACTIVATE, hook },
- { WM_WINDOWPOSCHANGING, sent|wparam, SWP_NOSIZE|SWP_NOMOVE },
+ { WM_QUERYNEWPALETTE, sent|optional },
+ { WM_PALETTEISCHANGING, sent|optional },
+ { WM_WINDOWPOSCHANGING, sent|wparam|optional, SWP_NOSIZE|SWP_NOMOVE },
{ WM_ACTIVATEAPP, sent|wparam, 1 },
{ WM_NCACTIVATE, sent },
{ WM_ACTIVATE, sent|wparam, 1 },
@@ -12489,9 +12491,8 @@ static void test_dialog_messages(void)
flush_sequence();
hdlg = CreateDialogParamA(0, "CLASS_TEST_DIALOG_2", 0, test_dlg_proc, 1);
ok(IsWindow(hdlg), "CreateDialogParam failed\n");
- ok_sequence(WmCreateDialogParamSeq_1, "CreateDialogParam_1", TRUE);
+ ok_sequence(WmCreateDialogParamSeq_1, "CreateDialogParam_1", FALSE);
hfocus = GetFocus();
-todo_wine
ok(hfocus == hdlg, "wrong focus %p\n", hfocus);
EndDialog(hdlg, 0);
DestroyWindow(hdlg);
--
2.11.0

View File

@ -1 +0,0 @@
Fixes: [5402] Set focus to dialog itself when it has no controls

View File

@ -1,4 +1,4 @@
From cc82aea8b29379273e5b9d4aca4ff935f302f073 Mon Sep 17 00:00:00 2001
From ed6651ff72258e25be02809cfacbcfe342b59567 Mon Sep 17 00:00:00 2001
From: Dmitry Timoshkov <dmitry@baikal.ru>
Date: Mon, 28 Nov 2016 21:17:59 +0800
Subject: [PATCH] windowscodecs/tests: Add a test for 8bpp indexed TIFF format.
@ -8,10 +8,10 @@ Subject: [PATCH] windowscodecs/tests: Add a test for 8bpp indexed TIFF format.
1 file changed, 157 insertions(+), 23 deletions(-)
diff --git a/dlls/windowscodecs/tests/tiffformat.c b/dlls/windowscodecs/tests/tiffformat.c
index a7b6f5b594..e93d03ad68 100644
index 36de69e..b04b5a9 100644
--- a/dlls/windowscodecs/tests/tiffformat.c
+++ b/dlls/windowscodecs/tests/tiffformat.c
@@ -136,6 +136,49 @@ static const struct tiff_8bpp_alpha
@@ -145,6 +145,49 @@ static const struct tiff_8bpp_alpha
{ 0x11,0x22,0x33,0x44,0x55,0x66,0x77,0x88 }
};
@ -61,7 +61,7 @@ index a7b6f5b594..e93d03ad68 100644
static const struct tiff_resolution_test_data
{
struct IFD_rational resx;
@@ -235,29 +278,41 @@ static IStream *create_stream(const void *data, int data_size)
@@ -244,29 +287,41 @@ static IStream *create_stream(const void *data, int data_size)
return stream;
}
@ -116,7 +116,7 @@ index a7b6f5b594..e93d03ad68 100644
{
HRESULT hr;
IWICBitmapDecoder *decoder;
@@ -265,9 +320,9 @@ static void test_tiff_palette(void)
@@ -274,9 +329,9 @@ static void test_tiff_palette(void)
IWICPalette *palette;
GUID format;
@ -129,7 +129,7 @@ index a7b6f5b594..e93d03ad68 100644
hr = IWICBitmapDecoder_GetFrame(decoder, 0, &frame);
ok(hr == S_OK, "GetFrame error %#x\n", hr);
@@ -399,9 +454,9 @@ static void test_tiff_8bpp_alpha(void)
@@ -408,9 +463,9 @@ static void test_tiff_8bpp_alpha(void)
static const BYTE expected_data[16] = { 0x11,0x11,0x11,0x22,0x33,0x33,0x33,0x44,
0x55,0x55,0x55,0x66,0x77,0x77,0x77,0x88 };
@ -142,8 +142,8 @@ index a7b6f5b594..e93d03ad68 100644
hr = IWICBitmapDecoder_GetFrameCount(decoder, &frame_count);
ok(hr == S_OK, "GetFrameCount error %#x\n", hr);
@@ -446,6 +501,84 @@ static void test_tiff_8bpp_alpha(void)
IWICBitmapDecoder_Release(decoder);
@@ -457,6 +512,84 @@ static void test_tiff_8bpp_alpha(void)
IWICBitmapFrameDecode_Release(frame);
}
+static void generate_tiff_palette(void *buf, unsigned count)
@ -227,7 +227,7 @@ index a7b6f5b594..e93d03ad68 100644
static void test_tiff_resolution(void)
{
HRESULT hr;
@@ -461,9 +594,9 @@ static void test_tiff_resolution(void)
@@ -472,9 +605,9 @@ static void test_tiff_resolution(void)
tiff_resolution_image_data.resy = test_data->resy;
tiff_resolution_image_data.entry[12].value = test_data->resolution_unit;
@ -240,7 +240,7 @@ index a7b6f5b594..e93d03ad68 100644
hr = IWICBitmapDecoder_GetFrame(decoder, 0, &frame);
ok(hr == S_OK, "%d: GetFrame error %#x\n", i, hr);
@@ -509,7 +642,8 @@ START_TEST(tiffformat)
@@ -520,7 +653,8 @@ START_TEST(tiffformat)
ok(hr == S_OK, "CoCreateInstance error %#x\n", hr);
if (FAILED(hr)) return;
@ -251,5 +251,5 @@ index a7b6f5b594..e93d03ad68 100644
test_tiff_8bpp_alpha();
test_tiff_resolution();
--
2.16.1
1.9.1