mirror of
https://gitlab.winehq.org/wine/wine-staging.git
synced 2024-09-13 09:17:20 -07:00
Rebase against 35ac0e7ac0511ef766f3f35220869565ce07906e.
This commit is contained in:
parent
e045af48e8
commit
034a07418d
@ -1,4 +1,4 @@
|
||||
From b58f3bcfd0aa86fbc308fe3834bdf79c20f84876 Mon Sep 17 00:00:00 2001
|
||||
From 10df8c207e3e880bd578392e266a191e6b8ef9dd Mon Sep 17 00:00:00 2001
|
||||
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
|
||||
Date: Tue, 9 Jul 2019 14:13:28 +1000
|
||||
Subject: [PATCH] user32: Do not enumerate the registry in
|
||||
@ -25,11 +25,11 @@ index 8f3cd8acae7..072f1fab23a 100644
|
||||
{
|
||||
SendMessageTimeoutW(handle, WM_DEVICECHANGE, flags, (LPARAM)header, SMTO_ABORTIFHUNG, 2000, NULL);
|
||||
diff --git a/dlls/user32/tests/input.c b/dlls/user32/tests/input.c
|
||||
index 12fa459205a..12fc2652604 100644
|
||||
index d48440a20be..3a5df122ff4 100644
|
||||
--- a/dlls/user32/tests/input.c
|
||||
+++ b/dlls/user32/tests/input.c
|
||||
@@ -5401,6 +5401,40 @@ static void test_ClipCursor( char **argv )
|
||||
if (!EqualRect( &rect, &virtual_rect )) ok_ret( 1, ClipCursor( NULL ) );
|
||||
@@ -5215,6 +5215,40 @@ static void test_keyboard_ll_hook_blocking(void)
|
||||
ok_ret( 1, DestroyWindow( hwnd ) );
|
||||
}
|
||||
|
||||
+static void test_GetKeyboardLayoutList(void)
|
||||
@ -69,7 +69,7 @@ index 12fa459205a..12fc2652604 100644
|
||||
/* run the tests in a separate desktop to avoid interaction with other
|
||||
* tests, current desktop state, or user actions. */
|
||||
static void test_input_desktop( char **argv )
|
||||
@@ -5464,6 +5498,7 @@ START_TEST(input)
|
||||
@@ -5279,6 +5313,7 @@ START_TEST(input)
|
||||
test_GetRawInputBuffer();
|
||||
test_RegisterRawInputDevices();
|
||||
test_rawinput(argv[0]);
|
||||
@ -78,10 +78,10 @@ index 12fa459205a..12fc2652604 100644
|
||||
|
||||
if(pGetMouseMovePointsEx)
|
||||
diff --git a/dlls/win32u/input.c b/dlls/win32u/input.c
|
||||
index 3ee46f0bfcf..a22cc2397d9 100644
|
||||
index aaaac12ce36..85820a74aba 100644
|
||||
--- a/dlls/win32u/input.c
|
||||
+++ b/dlls/win32u/input.c
|
||||
@@ -1282,11 +1282,7 @@ HKL WINAPI NtUserActivateKeyboardLayout( HKL layout, UINT flags )
|
||||
@@ -1280,11 +1280,7 @@ HKL WINAPI NtUserActivateKeyboardLayout( HKL layout, UINT flags )
|
||||
*/
|
||||
UINT WINAPI NtUserGetKeyboardLayoutList( INT size, HKL *layouts )
|
||||
{
|
||||
@ -94,7 +94,7 @@ index 3ee46f0bfcf..a22cc2397d9 100644
|
||||
HKL layout;
|
||||
|
||||
TRACE_(keyboard)( "size %d, layouts %p.\n", size, layouts );
|
||||
@@ -1300,33 +1296,6 @@ UINT WINAPI NtUserGetKeyboardLayoutList( INT size, HKL *layouts )
|
||||
@@ -1298,33 +1294,6 @@ UINT WINAPI NtUserGetKeyboardLayoutList( INT size, HKL *layouts )
|
||||
if (size && layouts)
|
||||
{
|
||||
layouts[count - 1] = layout;
|
||||
|
@ -1,62 +0,0 @@
|
||||
From 89935f2a91305a577da2b08f80ac74235235a0d2 Mon Sep 17 00:00:00 2001
|
||||
From: Dmitry Timoshkov <dmitry@baikal.ru>
|
||||
Date: Sun, 27 Mar 2016 12:30:00 +0800
|
||||
Subject: [PATCH] oleaut32: Do not reimplement OleLoadPicture in
|
||||
OleLoadPicturePath.
|
||||
|
||||
punkCaller is ignored by StdPicture ClassFactory implementation anyway.
|
||||
---
|
||||
dlls/oleaut32/olepicture.c | 26 +-------------------------
|
||||
1 file changed, 1 insertion(+), 25 deletions(-)
|
||||
|
||||
diff --git a/dlls/oleaut32/olepicture.c b/dlls/oleaut32/olepicture.c
|
||||
index 7312adac1dc..373ccd61724 100644
|
||||
--- a/dlls/oleaut32/olepicture.c
|
||||
+++ b/dlls/oleaut32/olepicture.c
|
||||
@@ -2447,9 +2447,7 @@ HRESULT WINAPI OleLoadPicturePath( LPOLESTR szURLorPath, LPUNKNOWN punkCaller,
|
||||
DWORD dwBytesRead;
|
||||
IStream *stream;
|
||||
BOOL bRead;
|
||||
- IPersistStream *pStream;
|
||||
HRESULT hRes;
|
||||
- HRESULT init_res;
|
||||
WCHAR *file_candidate;
|
||||
WCHAR path_buf[MAX_PATH];
|
||||
|
||||
@@ -2526,32 +2524,10 @@ HRESULT WINAPI OleLoadPicturePath( LPOLESTR szURLorPath, LPUNKNOWN punkCaller,
|
||||
return hRes;
|
||||
}
|
||||
|
||||
- init_res = CoInitialize(NULL);
|
||||
-
|
||||
- hRes = CoCreateInstance(&CLSID_StdPicture, punkCaller, CLSCTX_INPROC_SERVER,
|
||||
- &IID_IPicture, (LPVOID*)&ipicture);
|
||||
- if (SUCCEEDED(hRes)) {
|
||||
- hRes = IPicture_QueryInterface(ipicture, &IID_IPersistStream, (LPVOID*)&pStream);
|
||||
-
|
||||
- if (SUCCEEDED(hRes)) {
|
||||
- hRes = IPersistStream_Load(pStream, stream);
|
||||
-
|
||||
- if (SUCCEEDED(hRes)) {
|
||||
- hRes = IPicture_QueryInterface(ipicture, riid, ppvRet);
|
||||
-
|
||||
- if (FAILED(hRes))
|
||||
- ERR("Failed to get interface %s from IPicture.\n", debugstr_guid(riid));
|
||||
- }
|
||||
- IPersistStream_Release(pStream);
|
||||
- }
|
||||
- IPicture_Release(ipicture);
|
||||
- }
|
||||
+ hRes = OleLoadPicture(stream, 0, FALSE, riid, ppvRet);
|
||||
|
||||
IStream_Release(stream);
|
||||
|
||||
- if (SUCCEEDED(init_res))
|
||||
- CoUninitialize();
|
||||
-
|
||||
return hRes;
|
||||
}
|
||||
|
||||
--
|
||||
2.29.2
|
||||
|
@ -1,115 +0,0 @@
|
||||
From b6a510e5397091c59d9fb3a29bf75bc709727cb1 Mon Sep 17 00:00:00 2001
|
||||
From: Dmitry Timoshkov <dmitry@baikal.ru>
|
||||
Date: Sun, 27 Mar 2016 16:26:47 +0800
|
||||
Subject: [PATCH] oleaut32: Factor out stream creation from OleLoadPicturePath.
|
||||
|
||||
---
|
||||
dlls/oleaut32/olepicture.c | 76 ++++++++++++++++++++------------------
|
||||
1 file changed, 41 insertions(+), 35 deletions(-)
|
||||
|
||||
diff --git a/dlls/oleaut32/olepicture.c b/dlls/oleaut32/olepicture.c
|
||||
index 3758b785341..ef564e98164 100644
|
||||
--- a/dlls/oleaut32/olepicture.c
|
||||
+++ b/dlls/oleaut32/olepicture.c
|
||||
@@ -2336,6 +2336,45 @@ HRESULT WINAPI OleLoadPictureFile(VARIANT file, LPDISPATCH *picture)
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
+static HRESULT create_stream(const WCHAR *filename, IStream **stream)
|
||||
+{
|
||||
+ HANDLE hFile;
|
||||
+ DWORD dwFileSize;
|
||||
+ HGLOBAL hGlobal = NULL;
|
||||
+ DWORD dwBytesRead;
|
||||
+ HRESULT hr = S_OK;
|
||||
+
|
||||
+ hFile = CreateFileW(filename, GENERIC_READ, 0, NULL, OPEN_EXISTING, 0, NULL);
|
||||
+ if (hFile == INVALID_HANDLE_VALUE)
|
||||
+ return HRESULT_FROM_WIN32(GetLastError());
|
||||
+
|
||||
+ dwFileSize = GetFileSize(hFile, NULL);
|
||||
+ if (dwFileSize != INVALID_FILE_SIZE)
|
||||
+ {
|
||||
+ hGlobal = GlobalAlloc(GMEM_FIXED, dwFileSize);
|
||||
+ if (!hGlobal)
|
||||
+ hr = E_OUTOFMEMORY;
|
||||
+ else
|
||||
+ {
|
||||
+ if (!ReadFile(hFile, hGlobal, dwFileSize, &dwBytesRead, NULL))
|
||||
+ {
|
||||
+ GlobalFree(hGlobal);
|
||||
+ hr = HRESULT_FROM_WIN32(GetLastError());
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ CloseHandle(hFile);
|
||||
+
|
||||
+ if (FAILED(hr)) return hr;
|
||||
+
|
||||
+ hr = CreateStreamOnHGlobal(hGlobal, TRUE, stream);
|
||||
+ if (FAILED(hr))
|
||||
+ GlobalFree(hGlobal);
|
||||
+
|
||||
+ return hr;
|
||||
+}
|
||||
+
|
||||
/***********************************************************************
|
||||
* OleSavePictureFile (OLEAUT32.423)
|
||||
*/
|
||||
@@ -2352,13 +2391,7 @@ HRESULT WINAPI OleLoadPicturePath( LPOLESTR szURLorPath, LPUNKNOWN punkCaller,
|
||||
DWORD dwReserved, OLE_COLOR clrReserved, REFIID riid,
|
||||
LPVOID *ppvRet )
|
||||
{
|
||||
- IPicture *ipicture;
|
||||
- HANDLE hFile;
|
||||
- DWORD dwFileSize;
|
||||
- HGLOBAL hGlobal = NULL;
|
||||
- DWORD dwBytesRead;
|
||||
IStream *stream;
|
||||
- BOOL bRead;
|
||||
HRESULT hRes;
|
||||
WCHAR *file_candidate;
|
||||
WCHAR path_buf[MAX_PATH];
|
||||
@@ -2387,36 +2420,9 @@ HRESULT WINAPI OleLoadPicturePath( LPOLESTR szURLorPath, LPUNKNOWN punkCaller,
|
||||
|
||||
/* Handle candidate DOS paths separately. */
|
||||
if (file_candidate[1] == ':') {
|
||||
- hFile = CreateFileW(file_candidate, GENERIC_READ, 0, NULL, OPEN_EXISTING,
|
||||
- 0, NULL);
|
||||
- if (hFile == INVALID_HANDLE_VALUE)
|
||||
- return INET_E_RESOURCE_NOT_FOUND;
|
||||
-
|
||||
- dwFileSize = GetFileSize(hFile, NULL);
|
||||
- if (dwFileSize != INVALID_FILE_SIZE )
|
||||
- {
|
||||
- hGlobal = GlobalAlloc(GMEM_FIXED,dwFileSize);
|
||||
- if ( hGlobal)
|
||||
- {
|
||||
- bRead = ReadFile(hFile, hGlobal, dwFileSize, &dwBytesRead, NULL) && dwBytesRead == dwFileSize;
|
||||
- if (!bRead)
|
||||
- {
|
||||
- GlobalFree(hGlobal);
|
||||
- hGlobal = 0;
|
||||
- }
|
||||
- }
|
||||
- }
|
||||
- CloseHandle(hFile);
|
||||
-
|
||||
- if (!hGlobal)
|
||||
+ hRes = create_stream(file_candidate, &stream);
|
||||
+ if (FAILED(hRes))
|
||||
return INET_E_RESOURCE_NOT_FOUND;
|
||||
-
|
||||
- hRes = CreateStreamOnHGlobal(hGlobal, TRUE, &stream);
|
||||
- if (FAILED(hRes))
|
||||
- {
|
||||
- GlobalFree(hGlobal);
|
||||
- return hRes;
|
||||
- }
|
||||
} else {
|
||||
IMoniker *pmnk;
|
||||
IBindCtx *pbc;
|
||||
--
|
||||
2.30.2
|
||||
|
@ -1,172 +0,0 @@
|
||||
From eb7f29d66825c454043b3f68594e5b50412300ed Mon Sep 17 00:00:00 2001
|
||||
From: Dmitry Timoshkov <dmitry@baikal.ru>
|
||||
Date: Sun, 27 Mar 2016 16:28:33 +0800
|
||||
Subject: [PATCH] oleaut32: Implement OleLoadPictureFile. (v2)
|
||||
|
||||
---
|
||||
dlls/oleaut32/olepicture.c | 36 ++++++++++++++++------
|
||||
dlls/oleaut32/tests/olepicture.c | 53 ++++++++++++++++++++++++++++++++
|
||||
2 files changed, 80 insertions(+), 9 deletions(-)
|
||||
|
||||
diff --git a/dlls/oleaut32/olepicture.c b/dlls/oleaut32/olepicture.c
|
||||
index 4a478217997..b5c9e8db271 100644
|
||||
--- a/dlls/oleaut32/olepicture.c
|
||||
+++ b/dlls/oleaut32/olepicture.c
|
||||
@@ -2387,15 +2387,6 @@ HRESULT WINAPI OleLoadPictureEx( LPSTREAM lpstream, LONG lSize, BOOL fRunmode,
|
||||
return hr;
|
||||
}
|
||||
|
||||
-/***********************************************************************
|
||||
- * OleLoadPictureFile (OLEAUT32.422)
|
||||
- */
|
||||
-HRESULT WINAPI OleLoadPictureFile(VARIANT file, LPDISPATCH *picture)
|
||||
-{
|
||||
- FIXME("(%s %p): stub\n", wine_dbgstr_variant(&file), picture);
|
||||
- return E_NOTIMPL;
|
||||
-}
|
||||
-
|
||||
static HRESULT create_stream(const WCHAR *filename, IStream **stream)
|
||||
{
|
||||
HANDLE hFile;
|
||||
@@ -2435,6 +2426,33 @@ static HRESULT create_stream(const WCHAR *filename, IStream **stream)
|
||||
return hr;
|
||||
}
|
||||
|
||||
+/***********************************************************************
|
||||
+ * OleLoadPictureFile (OLEAUT32.422)
|
||||
+ */
|
||||
+HRESULT WINAPI OleLoadPictureFile(VARIANT filename, IDispatch **picture)
|
||||
+{
|
||||
+ IStream *stream;
|
||||
+ HRESULT hr;
|
||||
+
|
||||
+ TRACE("(%s,%p)\n", wine_dbgstr_variant(&filename), picture);
|
||||
+
|
||||
+ if (V_VT(&filename) != VT_BSTR)
|
||||
+ return CTL_E_FILENOTFOUND;
|
||||
+
|
||||
+ hr = create_stream(V_BSTR(&filename), &stream);
|
||||
+ if (hr != S_OK)
|
||||
+ {
|
||||
+ if (hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND))
|
||||
+ return CTL_E_FILENOTFOUND;
|
||||
+
|
||||
+ return CTL_E_PATHFILEACCESSERROR;
|
||||
+ }
|
||||
+
|
||||
+ hr = OleLoadPicture(stream, 0, FALSE, &IID_IDispatch, (void **)picture);
|
||||
+ IStream_Release(stream);
|
||||
+ return hr;
|
||||
+}
|
||||
+
|
||||
/***********************************************************************
|
||||
* OleSavePictureFile (OLEAUT32.423)
|
||||
*/
|
||||
diff --git a/dlls/oleaut32/tests/olepicture.c b/dlls/oleaut32/tests/olepicture.c
|
||||
index 747134e2458..78c2ed5294e 100644
|
||||
--- a/dlls/oleaut32/tests/olepicture.c
|
||||
+++ b/dlls/oleaut32/tests/olepicture.c
|
||||
@@ -958,6 +958,7 @@ static void test_OleLoadPicturePath(void)
|
||||
HANDLE file;
|
||||
DWORD size;
|
||||
WCHAR *ptr;
|
||||
+ VARIANT var;
|
||||
|
||||
const struct
|
||||
{
|
||||
@@ -1024,6 +1025,14 @@ static void test_OleLoadPicturePath(void)
|
||||
if (pic)
|
||||
IPicture_Release(pic);
|
||||
|
||||
+ VariantInit(&var);
|
||||
+ V_VT(&var) = VT_BSTR;
|
||||
+ V_BSTR(&var) = SysAllocString(temp_fileW + 8);
|
||||
+ hres = OleLoadPictureFile(var, (IDispatch **)&pic);
|
||||
+ ok(hres == S_OK, "OleLoadPictureFile error %#x\n", hres);
|
||||
+ IPicture_Release(pic);
|
||||
+ VariantClear(&var);
|
||||
+
|
||||
/* Try a DOS path with tacked on "file:". */
|
||||
hres = OleLoadPicturePath(temp_fileW, NULL, 0, 0, &IID_IPicture, (void **)&pic);
|
||||
ok(hres == S_OK ||
|
||||
@@ -1032,6 +1041,13 @@ static void test_OleLoadPicturePath(void)
|
||||
if (pic)
|
||||
IPicture_Release(pic);
|
||||
|
||||
+ VariantInit(&var);
|
||||
+ V_VT(&var) = VT_BSTR;
|
||||
+ V_BSTR(&var) = SysAllocString(temp_fileW);
|
||||
+ hres = OleLoadPictureFile(var, (IDispatch **)&pic);
|
||||
+ ok(hres == CTL_E_PATHFILEACCESSERROR, "wrong error %#x\n", hres);
|
||||
+ VariantClear(&var);
|
||||
+
|
||||
DeleteFileA(temp_file);
|
||||
|
||||
/* Try with a nonexistent file. */
|
||||
@@ -1041,12 +1057,26 @@ static void test_OleLoadPicturePath(void)
|
||||
broken(hres == E_FAIL), /*Win2k */
|
||||
"Expected OleLoadPicturePath to return INET_E_RESOURCE_NOT_FOUND, got 0x%08lx\n", hres);
|
||||
|
||||
+ VariantInit(&var);
|
||||
+ V_VT(&var) = VT_BSTR;
|
||||
+ V_BSTR(&var) = SysAllocString(temp_fileW + 8);
|
||||
+ hres = OleLoadPictureFile(var, (IDispatch **)&pic);
|
||||
+ ok(hres == CTL_E_FILENOTFOUND, "wrong error %#x\n", hres);
|
||||
+ VariantClear(&var);
|
||||
+
|
||||
hres = OleLoadPicturePath(temp_fileW, NULL, 0, 0, &IID_IPicture, (void **)&pic);
|
||||
ok(hres == INET_E_RESOURCE_NOT_FOUND || /* XP+ */
|
||||
broken(hres == E_UNEXPECTED) || /* NT4 */
|
||||
broken(hres == E_FAIL), /* Win2k */
|
||||
"Expected OleLoadPicturePath to return INET_E_RESOURCE_NOT_FOUND, got 0x%08lx\n", hres);
|
||||
|
||||
+ VariantInit(&var);
|
||||
+ V_VT(&var) = VT_BSTR;
|
||||
+ V_BSTR(&var) = SysAllocString(temp_fileW);
|
||||
+ hres = OleLoadPictureFile(var, (IDispatch **)&pic);
|
||||
+ ok(hres == CTL_E_PATHFILEACCESSERROR, "wrong error %#x\n", hres);
|
||||
+ VariantClear(&var);
|
||||
+
|
||||
file = CreateFileA(temp_file, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS,
|
||||
FILE_ATTRIBUTE_NORMAL, NULL);
|
||||
WriteFile(file, bmpimage, sizeof(bmpimage), &size, NULL);
|
||||
@@ -1068,6 +1098,13 @@ static void test_OleLoadPicturePath(void)
|
||||
if (pic)
|
||||
IPicture_Release(pic);
|
||||
|
||||
+ VariantInit(&var);
|
||||
+ V_VT(&var) = VT_BSTR;
|
||||
+ V_BSTR(&var) = SysAllocString(temp_fileW);
|
||||
+ hres = OleLoadPictureFile(var, (IDispatch **)&pic);
|
||||
+ ok(hres == CTL_E_PATHFILEACCESSERROR, "wrong error %#x\n", hres);
|
||||
+ VariantClear(&var);
|
||||
+
|
||||
DeleteFileA(temp_file);
|
||||
|
||||
/* Try with a nonexistent file. */
|
||||
@@ -1076,6 +1113,22 @@ static void test_OleLoadPicturePath(void)
|
||||
broken(hres == E_UNEXPECTED) || /* NT4 */
|
||||
broken(hres == E_FAIL), /* Win2k */
|
||||
"Expected OleLoadPicturePath to return INET_E_RESOURCE_NOT_FOUND, got 0x%08lx\n", hres);
|
||||
+
|
||||
+ VariantInit(&var);
|
||||
+ V_VT(&var) = VT_BSTR;
|
||||
+ V_BSTR(&var) = SysAllocString(temp_fileW);
|
||||
+ hres = OleLoadPictureFile(var, (IDispatch **)&pic);
|
||||
+ ok(hres == CTL_E_PATHFILEACCESSERROR, "wrong error %#lx\n", hres);
|
||||
+ VariantClear(&var);
|
||||
+
|
||||
+ VariantInit(&var);
|
||||
+ V_VT(&var) = VT_INT;
|
||||
+ V_INT(&var) = 762;
|
||||
+ hres = OleLoadPictureFile(var, (IDispatch **)&pic);
|
||||
+ ok(hres == CTL_E_FILENOTFOUND, "wrong error %#lx\n", hres);
|
||||
+
|
||||
+if (0) /* crashes under Windows */
|
||||
+ hres = OleLoadPictureFile(var, NULL);
|
||||
}
|
||||
|
||||
static void test_himetric(void)
|
||||
--
|
||||
2.35.1
|
||||
|
@ -1 +0,0 @@
|
||||
Fixes: Implement oleaut32.OleLoadPictureFile
|
@ -1 +1 @@
|
||||
1932c3a2516b181291ce430505dcfa8a82eb70bd
|
||||
35ac0e7ac0511ef766f3f35220869565ce07906e
|
||||
|
Loading…
Reference in New Issue
Block a user