Rebase against 152cda38df79cf04aae589f1d721de3cac1cd49e

This commit is contained in:
Alistair Leslie-Hughes 2019-02-05 09:26:53 +11:00
parent 75e683d877
commit 4f5ec5595c
8 changed files with 70 additions and 368 deletions

View File

@ -1,13 +1,12 @@
From a4d5c33bb2fc98fd0f84ea05575e0d3eeb5a1bcd Mon Sep 17 00:00:00 2001
From ab6be2f28c6a3501a056e890a41b44d49c1e2eb0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Tue, 12 Apr 2016 01:02:34 +0200
Subject: [PATCH] uiautomationcore: Add dll and stub some functions.
---
dlls/uiautomationcore/Makefile.in | 1 +
dlls/uiautomationcore/uia_main.c | 53 +++++++++++++++++++++++++----
dlls/uiautomationcore/uiautomationcore.spec | 6 ++++
3 files changed, 54 insertions(+), 6 deletions(-)
dlls/uiautomationcore/Makefile.in | 1 +
dlls/uiautomationcore/uia_main.c | 53 ++++++++++++++++++++++++++++++++++-----
2 files changed, 48 insertions(+), 6 deletions(-)
diff --git a/dlls/uiautomationcore/Makefile.in b/dlls/uiautomationcore/Makefile.in
index 78d6254..029fc2e 100644
@ -121,41 +120,6 @@ index 31b7d3e..cc4831e 100644
return 0;
}
diff --git a/dlls/uiautomationcore/uiautomationcore.spec b/dlls/uiautomationcore/uiautomationcore.spec
index 48a06b2..8e676ad 100644
--- a/dlls/uiautomationcore/uiautomationcore.spec
+++ b/dlls/uiautomationcore/uiautomationcore.spec
@@ -53,6 +53,8 @@
@ stub TransformPattern_Rotate
@ stub UiaAddEvent
@ stdcall UiaClientsAreListening()
+@ stub UiaDisconnectAllProviders
+@ stub UiaDisconnectProvider
@ stub UiaEventAddWindow
@ stub UiaEventRemoveWindow
@ stub UiaFind
@@ -69,6 +71,7 @@
@ stub UiaHUiaNodeFromVariant
@ stub UiaHasServerSideProvider
@ stub UiaHostProviderFromHwnd
+@ stub UiaIAccessibleFromProvider
@ stdcall UiaLookupId(long ptr)
@ stub UiaNavigate
@ stub UiaNodeFromFocus
@@ -77,10 +80,13 @@
@ stub UiaNodeFromProvider
@ stub UiaNodeRelease
@ stub UiaPatternRelease
+@ stub UiaProviderForNonClient
+@ stub UiaProviderFromIAccessible
@ stub UiaRaiseAsyncContentLoadedEvent
@ stdcall UiaRaiseAutomationEvent(ptr long)
@ stub UiaRaiseAutomationPropertyChangedEvent
@ stub UiaRaiseStructureChangedEvent
+@ stub UiaRaiseTextEditTextChangedEvent
@ stub UiaRegisterProviderCallback
@ stub UiaRemoveEvent
@ stdcall UiaReturnRawElementProvider(long long long ptr)
--
1.9.1

View File

@ -1,44 +1,39 @@
From 3dc821fe683d1e17976ca9367465c1412e1140b4 Mon Sep 17 00:00:00 2001
From 577b48296711a6ad2bd507687a05f3aac9d7a54a Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Sat, 14 Jan 2017 07:50:36 +0100
Subject: d3d8: Improve ValidateVertexShader stub.
Subject: [PATCH] d3d8: Improve ValidateVertexShader stub.
---
dlls/d3d8/d3d8_main.c | 43 ++++++++++++++++++++++---------------------
dlls/d3d8/d3d8_main.c | 39 ++++++++++++++++++++++-----------------
dlls/d3d8/tests/device.c | 40 +++++++++++++++++++++++++---------------
2 files changed, 47 insertions(+), 36 deletions(-)
2 files changed, 47 insertions(+), 32 deletions(-)
diff --git a/dlls/d3d8/d3d8_main.c b/dlls/d3d8/d3d8_main.c
index 8ac704c364c..2ab0414b7f2 100644
index 5fbd165..c48b397 100644
--- a/dlls/d3d8/d3d8_main.c
+++ b/dlls/d3d8/d3d8_main.c
@@ -58,38 +58,39 @@ IDirect3D8 * WINAPI DECLSPEC_HOTPATCH Direct3DCreate8(UINT sdk_version)
/***********************************************************************
* ValidateVertexShader (D3D8.@)
- *
- * I've seen reserved1 and reserved2 always passed as 0's
- * bool seems always passed as 0 or 1, but other values work as well...
- * toto result?
@@ -64,33 +64,38 @@ IDirect3D8 * WINAPI DECLSPEC_HOTPATCH Direct3DCreate8(UINT sdk_version)
* boolean seems always passed as 0 or 1, but other values work as well...
* toto result?
*/
-HRESULT WINAPI ValidateVertexShader(DWORD* vertexshader, DWORD* reserved1, DWORD* reserved2, BOOL bool, DWORD* toto)
-HRESULT WINAPI ValidateVertexShader(DWORD* vertexshader, DWORD* reserved1, DWORD* reserved2, BOOL boolean, DWORD* toto)
+HRESULT WINAPI ValidateVertexShader(DWORD *vertexshader, DWORD *reserved1, DWORD *reserved2,
+ BOOL return_error, char **errors)
{
- HRESULT ret;
- static BOOL warned;
-
- if (TRACE_ON(d3d8) || !warned) {
- FIXME("(%p %p %p %d %p): stub\n", vertexshader, reserved1, reserved2, bool, toto);
- warned = TRUE;
- }
+ const char *message = "";
+ HRESULT hr = E_FAIL;
- if (!vertexshader)
- return E_FAIL;
- if (TRACE_ON(d3d8) || !warned) {
- FIXME("(%p %p %p %d %p): stub\n", vertexshader, reserved1, reserved2, boolean, toto);
- warned = TRUE;
- }
+ TRACE("(%p %p %p %d %p): semi-stub\n", vertexshader, reserved1, reserved2, return_error, errors);
- if (!vertexshader)
- return E_FAIL;
-
- if (reserved1 || reserved2)
- return E_FAIL;
+ if (!vertexshader)
@ -74,10 +69,10 @@ index 8ac704c364c..2ab0414b7f2 100644
/***********************************************************************
diff --git a/dlls/d3d8/tests/device.c b/dlls/d3d8/tests/device.c
index 28c6af32e0c..1368ce3a2cf 100644
index 884cdb1..6b9e70d 100644
--- a/dlls/d3d8/tests/device.c
+++ b/dlls/d3d8/tests/device.c
@@ -50,7 +50,7 @@ struct device_desc
@@ -51,7 +51,7 @@ struct device_desc
static DEVMODEW registry_mode;
@ -86,7 +81,7 @@ index 28c6af32e0c..1368ce3a2cf 100644
static HRESULT (WINAPI *ValidatePixelShader)(DWORD *, DWORD *, int, DWORD *);
static BOOL (WINAPI *pGetCursorInfo)(PCURSORINFO);
@@ -4238,18 +4238,31 @@ static void test_validate_vs(void)
@@ -4369,18 +4369,31 @@ static void test_validate_vs(void)
0x00000009, 0xc0080000, 0x90e40000, 0xa0e40003, /* dp4 oPos.w, v0, c3 */
0x0000ffff, /* end */
};
@ -120,7 +115,7 @@ index 28c6af32e0c..1368ce3a2cf 100644
*vs = 0xfffe0100; /* vs_1_0 */
hr = ValidateVertexShader(vs, 0, 0, 0, 0);
ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
@@ -4257,21 +4270,18 @@ static void test_validate_vs(void)
@@ -4388,21 +4401,18 @@ static void test_validate_vs(void)
*vs = 0xfffe0102; /* bogus version */
hr = ValidateVertexShader(vs, 0, 0, 1, 0);
ok(hr == E_FAIL, "Got unexpected hr %#x.\n", hr);
@ -152,5 +147,5 @@ index 28c6af32e0c..1368ce3a2cf 100644
static void test_validate_ps(void)
--
2.11.0
1.9.1

View File

@ -1,7 +1,7 @@
From 29d2dd7606178f391c8802f8d5767a7bd83c4e30 Mon Sep 17 00:00:00 2001
From f13fda7095a5fa275232f7440d7737a54c1f1c6c Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Sat, 14 Jan 2017 07:54:39 +0100
Subject: d3d8: Improve ValidatePixelShader stub.
Subject: [PATCH] d3d8: Improve ValidatePixelShader stub.
---
dlls/d3d8/d3d8_main.c | 37 +++++++++++++++++--------------------
@ -9,10 +9,10 @@ Subject: d3d8: Improve ValidatePixelShader stub.
2 files changed, 37 insertions(+), 34 deletions(-)
diff --git a/dlls/d3d8/d3d8_main.c b/dlls/d3d8/d3d8_main.c
index a562c1c7e30..41f411c30a8 100644
index c48b397..6feb8e5 100644
--- a/dlls/d3d8/d3d8_main.c
+++ b/dlls/d3d8/d3d8_main.c
@@ -101,39 +101,36 @@ done:
@@ -100,39 +100,36 @@ done:
/***********************************************************************
* ValidatePixelShader (D3D8.@)
@ -20,14 +20,14 @@ index a562c1c7e30..41f411c30a8 100644
- * PARAMS
- * toto result?
*/
-HRESULT WINAPI ValidatePixelShader(DWORD* pixelshader, DWORD* reserved1, BOOL bool, DWORD* toto)
-HRESULT WINAPI ValidatePixelShader(DWORD* pixelshader, DWORD* reserved1, BOOL boolean, DWORD* toto)
+HRESULT WINAPI ValidatePixelShader(DWORD *pixelshader, DWORD *reserved1, BOOL return_error, char **errors)
{
- HRESULT ret;
- static BOOL warned;
-
- if (TRACE_ON(d3d8) || !warned) {
- FIXME("(%p %p %d %p): stub\n", pixelshader, reserved1, bool, toto);
- FIXME("(%p %p %d %p): stub\n", pixelshader, reserved1, boolean, toto);
- warned = TRUE;
- }
+ const char *message = "";
@ -70,10 +70,10 @@ index a562c1c7e30..41f411c30a8 100644
void d3d8_resource_cleanup(struct d3d8_resource *resource)
diff --git a/dlls/d3d8/tests/device.c b/dlls/d3d8/tests/device.c
index 1368ce3a2cf..9ff3be71776 100644
index 6b9e70d..4a4c0e5 100644
--- a/dlls/d3d8/tests/device.c
+++ b/dlls/d3d8/tests/device.c
@@ -51,7 +51,7 @@ struct device_desc
@@ -52,7 +52,7 @@ struct device_desc
static DEVMODEW registry_mode;
static HRESULT (WINAPI *ValidateVertexShader)(DWORD *, DWORD *, DWORD *, BOOL, char **);
@ -82,7 +82,7 @@ index 1368ce3a2cf..9ff3be71776 100644
static BOOL (WINAPI *pGetCursorInfo)(PCURSORINFO);
@@ -4296,33 +4296,39 @@ static void test_validate_ps(void)
@@ -4427,33 +4427,39 @@ static void test_validate_ps(void)
0x00000005, 0x800f0000, 0xb0e40000, 0x80e40000, /* mul r0, t0, r0 */
0x0000ffff, /* end */
};
@ -136,5 +136,5 @@ index 1368ce3a2cf..9ff3be71776 100644
static void test_volume_get_container(void)
--
2.11.0
1.9.1

View File

@ -1,4 +1,4 @@
From 23f0efa72624556184b079814d4b58ea02105b8a Mon Sep 17 00:00:00 2001
From 2e48aae38577a6ed0564ead6e1e1bd8b886177c8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Tue, 6 Jun 2017 21:08:51 +0200
Subject: [PATCH] ntoskrnl.exe: Implement NtBuildNumber.
@ -10,10 +10,10 @@ Subject: [PATCH] ntoskrnl.exe: Implement NtBuildNumber.
3 files changed, 39 insertions(+), 3 deletions(-)
diff --git a/dlls/ntoskrnl.exe/ntoskrnl.c b/dlls/ntoskrnl.exe/ntoskrnl.c
index e030b48..14a6e82 100644
index 6769187..1542c96 100644
--- a/dlls/ntoskrnl.exe/ntoskrnl.c
+++ b/dlls/ntoskrnl.exe/ntoskrnl.c
@@ -57,6 +57,7 @@ WINE_DECLARE_DEBUG_CHANNEL(plugplay);
@@ -60,6 +60,7 @@ WINE_DECLARE_DEBUG_CHANNEL(plugplay);
BOOLEAN KdDebuggerEnabled = FALSE;
ULONG InitSafeBootMode = 0;
@ -21,7 +21,7 @@ index e030b48..14a6e82 100644
extern LONG CALLBACK vectored_handler( EXCEPTION_POINTERS *ptrs );
@@ -2826,6 +2827,13 @@ NTSTATUS WINAPI IoAcquireRemoveLockEx(PIO_REMOVE_LOCK lock, PVOID tag,
@@ -2969,6 +2970,13 @@ NTSTATUS WINAPI IoAcquireRemoveLockEx(PIO_REMOVE_LOCK lock, PVOID tag,
return STATUS_NOT_IMPLEMENTED;
}
@ -35,7 +35,7 @@ index e030b48..14a6e82 100644
/*****************************************************
* DllMain
@@ -2833,7 +2841,6 @@ NTSTATUS WINAPI IoAcquireRemoveLockEx(PIO_REMOVE_LOCK lock, PVOID tag,
@@ -2976,7 +2984,6 @@ NTSTATUS WINAPI IoAcquireRemoveLockEx(PIO_REMOVE_LOCK lock, PVOID tag,
BOOL WINAPI DllMain( HINSTANCE inst, DWORD reason, LPVOID reserved )
{
static void *handler;
@ -43,7 +43,7 @@ index e030b48..14a6e82 100644
switch(reason)
{
@@ -2842,7 +2849,7 @@ BOOL WINAPI DllMain( HINSTANCE inst, DWORD reason, LPVOID reserved )
@@ -2985,7 +2992,7 @@ BOOL WINAPI DllMain( HINSTANCE inst, DWORD reason, LPVOID reserved )
#if defined(__i386__) || defined(__x86_64__)
handler = RtlAddVectoredExceptionHandler( TRUE, vectored_handler );
#endif
@ -53,10 +53,10 @@ index e030b48..14a6e82 100644
case DLL_PROCESS_DETACH:
if (reserved) break;
diff --git a/dlls/ntoskrnl.exe/ntoskrnl.exe.spec b/dlls/ntoskrnl.exe/ntoskrnl.exe.spec
index cbc047f..d0e239e 100644
index 889da07..9b81e26 100644
--- a/dlls/ntoskrnl.exe/ntoskrnl.exe.spec
+++ b/dlls/ntoskrnl.exe/ntoskrnl.exe.spec
@@ -743,7 +743,7 @@
@@ -748,7 +748,7 @@
@ stdcall NtAllocateLocallyUniqueId(ptr)
@ stdcall NtAllocateUuids(ptr ptr ptr ptr)
@ stdcall NtAllocateVirtualMemory(long ptr long ptr long long)
@ -66,12 +66,12 @@ index cbc047f..d0e239e 100644
@ stdcall NtConnectPort(ptr ptr ptr ptr ptr ptr ptr ptr)
@ stdcall NtCreateEvent(ptr long ptr long long)
diff --git a/dlls/ntoskrnl.exe/tests/driver.c b/dlls/ntoskrnl.exe/tests/driver.c
index efd6053..2e1107b 100644
index cbf8bdc..143b86b 100644
--- a/dlls/ntoskrnl.exe/tests/driver.c
+++ b/dlls/ntoskrnl.exe/tests/driver.c
@@ -143,6 +143,22 @@ static void winetest_end_todo(void)
#define todo_wine todo_if(running_under_wine)
@@ -174,6 +174,22 @@ static void winetest_end_todo(void)
#define todo_wine_if(is_todo) todo_if((is_todo) && running_under_wine)
#define win_skip(...) win_skip_(__FILE__, __LINE__, __VA_ARGS__)
+static void *get_proc_address(const char *name)
+{
@ -92,8 +92,8 @@ index efd6053..2e1107b 100644
static void test_currentprocess(void)
{
PEPROCESS current;
@@ -497,6 +513,18 @@ static void test_sync(void)
KeCancelTimer(&timer);
@@ -575,6 +591,18 @@ static void test_stack_callout(void)
else win_skip("KeExpandKernelStackAndCalloutEx is not available\n");
}
+static void test_version(void)
@ -111,14 +111,14 @@ index efd6053..2e1107b 100644
static NTSTATUS main_test(IRP *irp, IO_STACK_LOCATION *stack, ULONG_PTR *info)
{
ULONG length = stack->Parameters.DeviceIoControl.OutputBufferLength;
@@ -526,6 +554,7 @@ static NTSTATUS main_test(IRP *irp, IO_STACK_LOCATION *stack, ULONG_PTR *info)
@@ -604,6 +632,7 @@ static NTSTATUS main_test(IRP *irp, IO_STACK_LOCATION *stack, ULONG_PTR *info)
test_init_funcs();
test_load_driver();
test_sync();
+ test_version();
test_stack_callout();
/* print process report */
if (test_input->winetest_debug)
--
2.7.4
1.9.1

View File

@ -1,4 +1,4 @@
From 3754ff36e69f3d6266ded912de0babfea68cbfed Mon Sep 17 00:00:00 2001
From 38dab0fbe11effe3fd0f3d94f90865cd096da892 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Tue, 6 Jun 2017 23:42:56 +0200
Subject: [PATCH] ntoskrnl.exe: Implement ExInitializeNPagedLookasideList.
@ -11,7 +11,7 @@ Subject: [PATCH] ntoskrnl.exe: Implement ExInitializeNPagedLookasideList.
4 files changed, 127 insertions(+), 7 deletions(-)
diff --git a/dlls/ntoskrnl.exe/ntoskrnl.c b/dlls/ntoskrnl.exe/ntoskrnl.c
index d3c2ea6..7d1fcdb 100644
index 1542c96..a450bf6 100644
--- a/dlls/ntoskrnl.exe/ntoskrnl.c
+++ b/dlls/ntoskrnl.exe/ntoskrnl.c
@@ -2153,7 +2153,24 @@ void WINAPI ExInitializeNPagedLookasideList(PNPAGED_LOOKASIDE_LIST Lookaside,
@ -41,7 +41,7 @@ index d3c2ea6..7d1fcdb 100644
/***********************************************************************
diff --git a/dlls/ntoskrnl.exe/tests/driver.c b/dlls/ntoskrnl.exe/tests/driver.c
index 215e090..70020e0 100644
index 143b86b..13fce71 100644
--- a/dlls/ntoskrnl.exe/tests/driver.c
+++ b/dlls/ntoskrnl.exe/tests/driver.c
@@ -22,6 +22,9 @@
@ -54,7 +54,7 @@ index 215e090..70020e0 100644
#include "ntstatus.h"
#define WIN32_NO_STATUS
#include "windef.h"
@@ -526,6 +529,33 @@ static void test_version(void)
@@ -603,6 +606,33 @@ static void test_version(void)
ok(*pNtBuildNumber == build, "Expected build number %u, got %u\n", build, *pNtBuildNumber);
}
@ -88,15 +88,15 @@ index 215e090..70020e0 100644
static NTSTATUS main_test(IRP *irp, IO_STACK_LOCATION *stack, ULONG_PTR *info)
{
ULONG length = stack->Parameters.DeviceIoControl.OutputBufferLength;
@@ -556,6 +586,7 @@ static NTSTATUS main_test(IRP *irp, IO_STACK_LOCATION *stack, ULONG_PTR *info)
@@ -633,6 +663,7 @@ static NTSTATUS main_test(IRP *irp, IO_STACK_LOCATION *stack, ULONG_PTR *info)
test_load_driver();
test_sync();
test_version();
+ test_lookaside_list();
test_stack_callout();
/* print process report */
if (test_input->winetest_debug)
@@ -607,7 +638,7 @@ static NTSTATUS test_load_driver_ioctl(IRP *irp, IO_STACK_LOCATION *stack, ULONG
@@ -685,7 +716,7 @@ static NTSTATUS test_load_driver_ioctl(IRP *irp, IO_STACK_LOCATION *stack, ULONG
static NTSTATUS WINAPI driver_Create(DEVICE_OBJECT *device, IRP *irp)
{
@ -105,7 +105,7 @@ index 215e090..70020e0 100644
IoCompleteRequest(irp, IO_NO_INCREMENT);
return STATUS_SUCCESS;
}
@@ -632,14 +663,14 @@ static NTSTATUS WINAPI driver_IoControl(DEVICE_OBJECT *device, IRP *irp)
@@ -710,14 +741,14 @@ static NTSTATUS WINAPI driver_IoControl(DEVICE_OBJECT *device, IRP *irp)
break;
}

View File

@ -52,7 +52,7 @@ usage()
# Get the upstream commit sha
upstream_commit()
{
echo "84459ba94b9de2fc32499154aa4591f10d746947"
echo "152cda38df79cf04aae589f1d721de3cac1cd49e"
}
# Show version information
@ -6844,7 +6844,6 @@ if test "$enable_windowscodecs_GIF_Encoder" -eq 1; then
patch_apply windowscodecs-GIF_Encoder/0007-windowscodecs-tests-Add-IWICBitmapEncoderInfo-test.patch
patch_apply windowscodecs-GIF_Encoder/0008-windowscodecs-Add-initial-implementation-of-the-GIF-.patch
patch_apply windowscodecs-GIF_Encoder/0010-windowscodecs-Initialize-empty-property-bag-in-GIF-e.patch
patch_apply windowscodecs-GIF_Encoder/0015-windowscodecs-Add-support-for-converting-to-8bppInde.patch
patch_apply windowscodecs-GIF_Encoder/0016-windowscodecs-WICConvertBitmapSource-should-ask-IWIC.patch
patch_apply windowscodecs-GIF_Encoder/0020-windowscodecs-Add-registration-of-the-GIF-encoder.patch
patch_apply windowscodecs-GIF_Encoder/0021-windowscodecs-Fix-IWICBitmapDecoder-CopyPalette-for-.patch
@ -6859,7 +6858,6 @@ if test "$enable_windowscodecs_GIF_Encoder" -eq 1; then
printf '%s\n' '+ { "Alistair Leslie-Hughes", "windowscodecs/tests: Add IWICBitmapEncoderInfo test.", 1 },';
printf '%s\n' '+ { "Dmitry Timoshkov", "windowscodecs: Add initial implementation of the GIF encoder.", 1 },';
printf '%s\n' '+ { "Dmitry Timoshkov", "windowscodecs: Initialize empty property bag in GIF encoder'\''s CreateNewFrame implementation.", 1 },';
printf '%s\n' '+ { "Dmitry Timoshkov", "windowscodecs: Add support for converting to 8bppIndexed format to IWICFormatConverter.", 1 },';
printf '%s\n' '+ { "Dmitry Timoshkov", "windowscodecs: WICConvertBitmapSource should ask IWICFormatConverter::Initialize to use an optimized palette.", 1 },';
printf '%s\n' '+ { "Dmitry Timoshkov", "windowscodecs: Add registration of the GIF encoder.", 1 },';
printf '%s\n' '+ { "Dmitry Timoshkov", "windowscodecs: Fix IWICBitmapDecoder::CopyPalette for a not initialized case in the GIF decoder.", 1 },';

View File

@ -1,247 +0,0 @@
From 663ca5c7923458a158ede7c01aa23805b5941ecc Mon Sep 17 00:00:00 2001
From: Dmitry Timoshkov <dmitry@baikal.ru>
Date: Thu, 20 Oct 2016 16:56:40 +0800
Subject: windowscodecs: Add support for converting to 8bppIndexed format to
IWICFormatConverter.
---
dlls/windowscodecs/converter.c | 160 ++++++++++++++++++++++++++++++++++++-----
1 file changed, 143 insertions(+), 17 deletions(-)
diff --git a/dlls/windowscodecs/converter.c b/dlls/windowscodecs/converter.c
index 3704060..c6a2514 100644
--- a/dlls/windowscodecs/converter.c
+++ b/dlls/windowscodecs/converter.c
@@ -76,7 +76,7 @@ typedef struct FormatConverter {
const struct pixelformatinfo *dst_format, *src_format;
WICBitmapDitherType dither;
double alpha_threshold;
- WICBitmapPaletteType palette_type;
+ IWICPalette *palette;
CRITICAL_SECTION lock; /* must be held when initialized */
} FormatConverter;
@@ -1187,11 +1187,96 @@ static HRESULT copypixels_to_8bppGray(struct FormatConverter *This, const WICRec
return hr;
}
+static UINT rgb_to_palette_index(BYTE r, BYTE g, BYTE b, WICColor *colors, UINT count)
+{
+ UINT best_diff, best_index, i;
+
+ best_diff = ~0;
+ best_index = 0;
+
+ for (i = 0; i < count; i++)
+ {
+ BYTE pal_r, pal_g, pal_b;
+ DWORD diff_r, diff_g, diff_b, diff;
+
+ pal_r = colors[i] >> 16;
+ pal_g = colors[i] >> 8;
+ pal_b = colors[i];
+
+ diff_r = r - pal_r;
+ diff_g = g - pal_g;
+ diff_b = b - pal_b;
+
+ diff = diff_r * diff_r + diff_g * diff_g + diff_b * diff_b;
+ if (diff == 0) return i;
+
+ if (diff < best_diff)
+ {
+ best_diff = diff;
+ best_index = i;
+ }
+ }
+
+ return best_index;
+}
+
+static HRESULT copypixels_to_8bppIndexed(struct FormatConverter *This, const WICRect *prc,
+ UINT cbStride, UINT cbBufferSize, BYTE *pbBuffer, enum pixelformat source_format)
+{
+ HRESULT hr;
+ BYTE *srcdata;
+ WICColor colors[256];
+ UINT srcstride, srcdatasize, count;
+
+ if (source_format == format_8bppIndexed)
+ {
+ if (prc)
+ return IWICBitmapSource_CopyPixels(This->source, prc, cbStride, cbBufferSize, pbBuffer);
+
+ return S_OK;
+ }
+
+ if (!This->palette) return WINCODEC_ERR_WRONGSTATE;
+
+ hr = IWICPalette_GetColors(This->palette, 256, colors, &count);
+ if (hr != S_OK) return hr;
+ if (!count) return WINCODEC_ERR_WRONGSTATE;
+
+ srcstride = 3 * prc->Width;
+ srcdatasize = srcstride * prc->Height;
+
+ srcdata = HeapAlloc(GetProcessHeap(), 0, srcdatasize);
+ if (!srcdata) return E_OUTOFMEMORY;
+
+ hr = copypixels_to_24bppBGR(This, prc, srcstride, srcdatasize, srcdata, source_format);
+ if (SUCCEEDED(hr) && prc)
+ {
+ INT x, y;
+ BYTE *src = srcdata, *dst = pbBuffer;
+
+ for (y = 0; y < prc->Height; y++)
+ {
+ BYTE *bgr = src;
+
+ for (x = 0; x < prc->Width; x++)
+ {
+ dst[x] = rgb_to_palette_index(bgr[2], bgr[1], bgr[0], colors, count);
+ bgr += 3;
+ }
+ src += srcstride;
+ dst += cbStride;
+ }
+ }
+
+ HeapFree(GetProcessHeap(), 0, srcdata);
+ return hr;
+}
+
static const struct pixelformatinfo supported_formats[] = {
{format_1bppIndexed, &GUID_WICPixelFormat1bppIndexed, NULL},
{format_2bppIndexed, &GUID_WICPixelFormat2bppIndexed, NULL},
{format_4bppIndexed, &GUID_WICPixelFormat4bppIndexed, NULL},
- {format_8bppIndexed, &GUID_WICPixelFormat8bppIndexed, NULL},
+ {format_8bppIndexed, &GUID_WICPixelFormat8bppIndexed, copypixels_to_8bppIndexed},
{format_BlackWhite, &GUID_WICPixelFormatBlackWhite, NULL},
{format_2bppGray, &GUID_WICPixelFormat2bppGray, NULL},
{format_4bppGray, &GUID_WICPixelFormat4bppGray, NULL},
@@ -1268,6 +1353,7 @@ static ULONG WINAPI FormatConverter_Release(IWICFormatConverter *iface)
This->lock.DebugInfo->Spare[0] = 0;
DeleteCriticalSection(&This->lock);
if (This->source) IWICBitmapSource_Release(This->source);
+ if (This->palette) IWICPalette_Release(This->palette);
HeapFree(GetProcessHeap(), 0, This);
}
@@ -1316,10 +1402,16 @@ static HRESULT WINAPI FormatConverter_GetResolution(IWICFormatConverter *iface,
}
static HRESULT WINAPI FormatConverter_CopyPalette(IWICFormatConverter *iface,
- IWICPalette *pIPalette)
+ IWICPalette *palette)
{
- FIXME("(%p,%p): stub\n", iface, pIPalette);
- return E_NOTIMPL;
+ FormatConverter *This = impl_from_IWICFormatConverter(iface);
+
+ TRACE("(%p,%p)\n", iface, palette);
+
+ if (!palette) return E_INVALIDARG;
+ if (!This->palette) return WINCODEC_ERR_WRONGSTATE;
+
+ return IWICPalette_InitializeFromPalette(palette, This->palette);
}
static HRESULT WINAPI FormatConverter_CopyPixels(IWICFormatConverter *iface,
@@ -1352,19 +1444,52 @@ static HRESULT WINAPI FormatConverter_CopyPixels(IWICFormatConverter *iface,
}
static HRESULT WINAPI FormatConverter_Initialize(IWICFormatConverter *iface,
- IWICBitmapSource *pISource, REFWICPixelFormatGUID dstFormat, WICBitmapDitherType dither,
- IWICPalette *pIPalette, double alphaThresholdPercent, WICBitmapPaletteType paletteTranslate)
+ IWICBitmapSource *source, REFWICPixelFormatGUID dstFormat, WICBitmapDitherType dither,
+ IWICPalette *palette, double alpha_threshold, WICBitmapPaletteType palette_type)
{
FormatConverter *This = impl_from_IWICFormatConverter(iface);
const struct pixelformatinfo *srcinfo, *dstinfo;
- static INT fixme=0;
GUID srcFormat;
- HRESULT res=S_OK;
+ HRESULT res;
+
+ TRACE("(%p,%p,%s,%u,%p,%0.3f,%u)\n", iface, source, debugstr_guid(dstFormat),
+ dither, palette, alpha_threshold, palette_type);
+
+ if (!palette)
+ {
+ res = PaletteImpl_Create(&palette);
+ if (res != S_OK) return res;
+
+ switch (palette_type)
+ {
+ case WICBitmapPaletteTypeCustom:
+ IWICPalette_Release(palette);
+ palette = NULL;
+ res = S_OK;
+ break;
+
+ case WICBitmapPaletteTypeMedianCut:
+ {
+ UINT bpp;
+ res = get_pixelformat_bpp(dstFormat, &bpp);
+ if (res == S_OK && bpp <= 8)
+ res = IWICPalette_InitializeFromBitmap(palette, source, 1 << bpp, FALSE);
+ break;
+ }
- TRACE("(%p,%p,%s,%u,%p,%0.1f,%u)\n", iface, pISource, debugstr_guid(dstFormat),
- dither, pIPalette, alphaThresholdPercent, paletteTranslate);
+ default:
+ res = IWICPalette_InitializePredefined(palette, palette_type, FALSE);
+ break;
+ }
- if (pIPalette && !fixme++) FIXME("ignoring palette\n");
+ if (res != S_OK)
+ {
+ IWICPalette_Release(palette);
+ return res;
+ }
+ }
+ else
+ IWICPalette_AddRef(palette);
EnterCriticalSection(&This->lock);
@@ -1374,7 +1499,7 @@ static HRESULT WINAPI FormatConverter_Initialize(IWICFormatConverter *iface,
goto end;
}
- res = IWICBitmapSource_GetPixelFormat(pISource, &srcFormat);
+ res = IWICBitmapSource_GetPixelFormat(source, &srcFormat);
if (FAILED(res)) goto end;
srcinfo = get_formatinfo(&srcFormat);
@@ -1395,13 +1520,13 @@ static HRESULT WINAPI FormatConverter_Initialize(IWICFormatConverter *iface,
if (dstinfo->copy_function)
{
- IWICBitmapSource_AddRef(pISource);
+ IWICBitmapSource_AddRef(source);
This->src_format = srcinfo;
This->dst_format = dstinfo;
This->dither = dither;
- This->alpha_threshold = alphaThresholdPercent;
- This->palette_type = paletteTranslate;
- This->source = pISource;
+ This->alpha_threshold = alpha_threshold;
+ This->palette = palette;
+ This->source = source;
}
else
{
@@ -1480,6 +1605,7 @@ HRESULT FormatConverter_CreateInstance(REFIID iid, void** ppv)
This->IWICFormatConverter_iface.lpVtbl = &FormatConverter_Vtbl;
This->ref = 1;
This->source = NULL;
+ This->palette = NULL;
InitializeCriticalSection(&This->lock);
This->lock.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": FormatConverter.lock");
--
2.9.0

View File

@ -1,27 +1,19 @@
From 1d23775a328b0a6c59db7888e29449625d95c012 Mon Sep 17 00:00:00 2001
From 19d87f547060563a82988d2c17c6a923fc27c6ca Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Thu, 8 Jun 2017 23:50:03 +0200
Subject: [PATCH] programs/winedevice: Load some common drivers and fix ldr
order.
---
dlls/ntoskrnl.exe/tests/driver.c | 52 ++++++++++++++++++++++++++++++++++++++++
dlls/ntoskrnl.exe/tests/driver.c | 51 ++++++++++++++++++++++++++++++++++++++++
programs/winedevice/device.c | 26 ++++++++++++++++++++
2 files changed, 78 insertions(+)
2 files changed, 77 insertions(+)
diff --git a/dlls/ntoskrnl.exe/tests/driver.c b/dlls/ntoskrnl.exe/tests/driver.c
index 4f32c30..efb9b94 100644
index 13fce71..8da13cd 100644
--- a/dlls/ntoskrnl.exe/tests/driver.c
+++ b/dlls/ntoskrnl.exe/tests/driver.c
@@ -31,6 +31,7 @@
#include "winbase.h"
#include "winternl.h"
#include "winioctl.h"
+#include "ddk/ntddk.h"
#include "ddk/wdm.h"
#include "driver.h"
@@ -40,6 +41,8 @@ static const WCHAR driver_device[] = {'\\','D','e','v','i','c','e',
@@ -41,6 +41,8 @@ static const WCHAR driver_device[] = {'\\','D','e','v','i','c','e',
static const WCHAR driver_link[] = {'\\','D','o','s','D','e','v','i','c','e','s',
'\\','W','i','n','e','T','e','s','t','D','r','i','v','e','r',0};
@ -30,7 +22,7 @@ index 4f32c30..efb9b94 100644
static HANDLE okfile;
static LONG successes;
static LONG failures;
@@ -555,6 +558,52 @@ static void test_lookaside_list(void)
@@ -633,6 +635,52 @@ static void test_lookaside_list(void)
ExDeleteNPagedLookasideList(&list);
}
@ -83,15 +75,15 @@ index 4f32c30..efb9b94 100644
static NTSTATUS main_test(IRP *irp, IO_STACK_LOCATION *stack, ULONG_PTR *info)
{
ULONG length = stack->Parameters.DeviceIoControl.OutputBufferLength;
@@ -586,6 +635,7 @@ static NTSTATUS main_test(IRP *irp, IO_STACK_LOCATION *stack, ULONG_PTR *info)
@@ -664,6 +712,7 @@ static NTSTATUS main_test(IRP *irp, IO_STACK_LOCATION *stack, ULONG_PTR *info)
test_sync();
test_version();
test_lookaside_list();
+ test_default_modules();
test_stack_callout();
/* print process report */
if (test_input->winetest_debug)
@@ -694,6 +744,8 @@ NTSTATUS WINAPI DriverEntry(DRIVER_OBJECT *driver, PUNICODE_STRING registry)
@@ -773,6 +822,8 @@ NTSTATUS WINAPI DriverEntry(DRIVER_OBJECT *driver, PUNICODE_STRING registry)
DbgPrint("loading driver\n");
@ -139,5 +131,5 @@ index 201a041..33b332d 100644
if (!(stop_event = CreateEventW( NULL, TRUE, FALSE, NULL )))
return;
--
2.7.4
1.9.1