winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
February 2017
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
2 participants
838 discussions
Start a n
N
ew thread
Alexandre Julliard : ole32: Use a HWND_MESSAGE window for the clipboard.
by Alexandre Julliard
02 Feb '17
02 Feb '17
Module: wine Branch: master Commit: e31dd0f384c108e9e07cbcbe043a285c32efe855 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=e31dd0f384c108e9e07cbcbe0…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu Feb 2 18:52:43 2017 +0100 ole32: Use a HWND_MESSAGE window for the clipboard. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ole32/clipboard.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/dlls/ole32/clipboard.c b/dlls/ole32/clipboard.c index b42544a..6e4dd44 100644 --- a/dlls/ole32/clipboard.c +++ b/dlls/ole32/clipboard.c @@ -2098,8 +2098,7 @@ static HWND create_clipbrd_window(void) RegisterClassExW(&class); return CreateWindowW(clipbrd_wndclass, title, WS_POPUP | WS_CLIPSIBLINGS | WS_OVERLAPPED, - CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, - NULL, NULL, hinst, 0); + 0, 0, 0, 0, HWND_MESSAGE, NULL, hinst, 0); } /*********************************************************************
1
0
0
0
Alexandre Julliard : ole32: Only trace a clipboard format name if it has one.
by Alexandre Julliard
02 Feb '17
02 Feb '17
Module: wine Branch: master Commit: c85eaae44c84f9e8b996793445f3807124e7c355 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=c85eaae44c84f9e8b99679344…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu Feb 2 18:51:44 2017 +0100 ole32: Only trace a clipboard format name if it has one. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ole32/clipboard.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/dlls/ole32/clipboard.c b/dlls/ole32/clipboard.c index b547cdf..b42544a 100644 --- a/dlls/ole32/clipboard.c +++ b/dlls/ole32/clipboard.c @@ -1198,9 +1198,11 @@ static HRESULT get_priv_data(ole_priv_data **data) for(cf = 0; (cf = EnumClipboardFormats(cf)) != 0; count++) { - char buf[100]; - GetClipboardFormatNameA(cf, buf, sizeof(buf)); - TRACE("cf %04x %s\n", cf, buf); + WCHAR buf[256]; + if (GetClipboardFormatNameW(cf, buf, sizeof(buf))) + TRACE("cf %04x %s\n", cf, debugstr_w(buf)); + else + TRACE("cf %04x\n", cf); } TRACE("count %d\n", count); size += count * sizeof(ret->entries[0]);
1
0
0
0
Alexandre Julliard : ole32: Don't set zero-size clipboard data, this no longer works.
by Alexandre Julliard
02 Feb '17
02 Feb '17
Module: wine Branch: master Commit: 77e566a3cbd0341ffeff7e8b7f42369622ac240a URL:
http://source.winehq.org/git/wine.git/?a=commit;h=77e566a3cbd0341ffeff7e8b7…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu Feb 2 18:51:10 2017 +0100 ole32: Don't set zero-size clipboard data, this no longer works. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ole32/clipboard.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dlls/ole32/clipboard.c b/dlls/ole32/clipboard.c index e3c93c9..b547cdf 100644 --- a/dlls/ole32/clipboard.c +++ b/dlls/ole32/clipboard.c @@ -1110,7 +1110,7 @@ static HRESULT get_current_dataobject(IDataObject **data) h = GetClipboardData(wine_marshal_clipboard_format); if(!h) return S_FALSE; - if(GlobalSize(h) == 0) return S_FALSE; + if(GlobalSize(h) <= 1) return S_FALSE; ptr = GlobalLock(h); if(!ptr) return S_FALSE; @@ -1957,7 +1957,7 @@ static HRESULT expose_marshalled_dataobject(ole_clipbrd *clipbrd, IDataObject *d dup_global_mem(h_stm, GMEM_DDESHARE|GMEM_MOVEABLE, &h); } else /* flushed */ - h = GlobalAlloc(GMEM_DDESHARE|GMEM_MOVEABLE, 0); + h = GlobalAlloc(GMEM_DDESHARE|GMEM_MOVEABLE, 1); if(!h) return E_OUTOFMEMORY;
1
0
0
0
Aric Stewart : loader: Start winebus service by default.
by Alexandre Julliard
02 Feb '17
02 Feb '17
Module: wine Branch: master Commit: 45d82a2464b535c484b0a6e96f9851f9db573edf URL:
http://source.winehq.org/git/wine.git/?a=commit;h=45d82a2464b535c484b0a6e96…
Author: Aric Stewart <aric(a)codeweavers.com> Date: Thu Feb 2 10:38:55 2017 -0600 loader: Start winebus service by default. Signed-off-by: Aric Stewart <aric(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- loader/wine.inf.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/loader/wine.inf.in b/loader/wine.inf.in index 3f723be..9a55b38 100644 --- a/loader/wine.inf.in +++ b/loader/wine.inf.in @@ -3255,7 +3255,7 @@ DisplayName="Platform Bus Kernel" ServiceBinary="%12%\winebus.sys" LoadOrderGroup="WinePlugPlay" ServiceType=1 -StartType=3 +StartType=2 ErrorControl=1 [WineHIDService]
1
0
0
0
Aric Stewart : hidclass.sys: IOCTL_HID_GET_INPUT_REPORT has report ID as first byte.
by Alexandre Julliard
02 Feb '17
02 Feb '17
Module: wine Branch: master Commit: 1ccb1719cb33c15c7a25854e9fdeef376104a6ec URL:
http://source.winehq.org/git/wine.git/?a=commit;h=1ccb1719cb33c15c7a25854e9…
Author: Aric Stewart <aric(a)codeweavers.com> Date: Thu Feb 2 10:35:55 2017 -0600 hidclass.sys: IOCTL_HID_GET_INPUT_REPORT has report ID as first byte. Signed-off-by: Aric Stewart <aric(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/hid/tests/device.c | 1 + dlls/hidclass.sys/device.c | 27 +++++++++++++++++++-------- 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/dlls/hid/tests/device.c b/dlls/hid/tests/device.c index ff47e30..91fade4 100644 --- a/dlls/hid/tests/device.c +++ b/dlls/hid/tests/device.c @@ -356,6 +356,7 @@ static void test_get_input_report(void) if (rc) { + ok(data[0] == 0, "Report ID (0) is not the first byte of the data\n"); report[0] = 0; for (i = 0; i < Caps.InputReportByteLength && i < Caps.InputReportByteLength; i++) { diff --git a/dlls/hidclass.sys/device.c b/dlls/hidclass.sys/device.c index ff9655e..40d458a 100644 --- a/dlls/hidclass.sys/device.c +++ b/dlls/hidclass.sys/device.c @@ -584,19 +584,30 @@ NTSTATUS WINAPI HID_Device_ioctl(DEVICE_OBJECT *device, IRP *irp) } case IOCTL_HID_GET_INPUT_REPORT: { - HID_XFER_PACKET packet; + HID_XFER_PACKET *packet; + UINT packet_size = sizeof(*packet) + irpsp->Parameters.DeviceIoControl.OutputBufferLength; BYTE *buffer = MmGetSystemAddressForMdlSafe(irp->MdlAddress, NormalPagePriority); + ULONG out_length; + + packet = HeapAlloc(GetProcessHeap(), 0, packet_size); if (extension->preparseData->InputReports[0].reportID) - packet.reportId = buffer[0]; + packet->reportId = buffer[0]; else - packet.reportId = 0; - packet.reportBuffer = buffer; - packet.reportBufferLen = irpsp->Parameters.DeviceIoControl.OutputBufferLength; + packet->reportId = 0; + packet->reportBuffer = (BYTE *)packet + sizeof(*packet); + packet->reportBufferLen = irpsp->Parameters.DeviceIoControl.OutputBufferLength - 1; - call_minidriver(IOCTL_HID_GET_INPUT_REPORT, device, NULL, 0, &packet, sizeof(packet)); - irp->IoStatus.Information = packet.reportBufferLen; - irp->IoStatus.u.Status = STATUS_SUCCESS; + rc = call_minidriver(IOCTL_HID_GET_INPUT_REPORT, device, NULL, 0, packet, sizeof(*packet)); + if (rc == STATUS_SUCCESS) + { + rc = copy_packet_into_buffer(packet, buffer, irpsp->Parameters.DeviceIoControl.OutputBufferLength, &out_length); + irp->IoStatus.Information = out_length; + } + else + irp->IoStatus.Information = 0; + irp->IoStatus.u.Status = rc; + HeapFree(GetProcessHeap(), 0, packet); break; } case IOCTL_SET_NUM_DEVICE_INPUT_BUFFERS:
1
0
0
0
Józef Kucia : comdlg32: Delay OleInitialize() until after file dialog window is created.
by Alexandre Julliard
02 Feb '17
02 Feb '17
Module: wine Branch: master Commit: 1707df3da2ae288897ca60e21d7ec778ef77a184 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=1707df3da2ae288897ca60e21…
Author: Józef Kucia <jkucia(a)codeweavers.com> Date: Thu Feb 2 16:10:06 2017 +0100 comdlg32: Delay OleInitialize() until after file dialog window is created. This fixes a problem exposed by commit f65e04770dc5748521a0de73814cea0b085bf3f8. Signed-off-by: Józef Kucia <jkucia(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/comdlg32/filedlg.c | 12 ++++++------ dlls/comdlg32/filedlgbrowser.h | 1 + dlls/comdlg32/tests/filedlg.c | 1 - 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/dlls/comdlg32/filedlg.c b/dlls/comdlg32/filedlg.c index d0d00b3..8a83163 100644 --- a/dlls/comdlg32/filedlg.c +++ b/dlls/comdlg32/filedlg.c @@ -252,7 +252,6 @@ static BOOL GetFileName95(FileOpenDlgInfos *fodInfos) void *template; HRSRC hRes; HANDLE hDlgTmpl = 0; - HRESULT hr; /* test for missing functionality */ if (fodInfos->ofnInfos->Flags & UNIMPLEMENTED_FLAGS) @@ -297,9 +296,6 @@ static BOOL GetFileName95(FileOpenDlgInfos *fodInfos) fodInfos->HookMsg.sharevistring = RegisterWindowMessageW(SHAREVISTRINGW); } - /* Some shell namespace extensions depend on COM being initialized. */ - hr = OleInitialize(NULL); - if (fodInfos->unicode) lRes = DialogBoxIndirectParamW(COMDLG32_hInstance, template, @@ -312,7 +308,7 @@ static BOOL GetFileName95(FileOpenDlgInfos *fodInfos) fodInfos->ofnInfos->hwndOwner, FileOpenDlgProc95, (LPARAM) fodInfos); - if (SUCCEEDED(hr)) + if (fodInfos->ole_initialized) OleUninitialize(); /* Unable to create the dialog */ @@ -1262,7 +1258,11 @@ INT_PTR CALLBACK FileOpenDlgProc95(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM l int gripx = GetSystemMetrics( SM_CYHSCROLL); int gripy = GetSystemMetrics( SM_CYVSCROLL); - /* Adds the FileOpenDlgInfos in the property list of the dialog + /* Some shell namespace extensions depend on COM being initialized. */ + if (SUCCEEDED(OleInitialize(NULL))) + fodInfos->ole_initialized = TRUE; + + /* Adds the FileOpenDlgInfos in the property list of the dialog so it will be easily accessible through a GetPropA(...) */ SetPropA(hwnd, FileOpenDlgInfosStr, fodInfos); diff --git a/dlls/comdlg32/filedlgbrowser.h b/dlls/comdlg32/filedlgbrowser.h index 60f0e7e..6d108a9 100644 --- a/dlls/comdlg32/filedlgbrowser.h +++ b/dlls/comdlg32/filedlgbrowser.h @@ -92,6 +92,7 @@ typedef struct UINT sharevistring; } HookMsg; + BOOL ole_initialized; } FileOpenDlgInfos; /*********************************************************************** diff --git a/dlls/comdlg32/tests/filedlg.c b/dlls/comdlg32/tests/filedlg.c index 89aa8fa..ff973a7 100644 --- a/dlls/comdlg32/tests/filedlg.c +++ b/dlls/comdlg32/tests/filedlg.c @@ -1296,7 +1296,6 @@ static LRESULT CALLBACK hook_proc(int code, WPARAM wp, LPARAM lp) * after GetOpenFileA() is a file dialog window. Mark Vista+ * behavior as broken. */ hr = OleInitialize(NULL); - todo_wine_if(first_dlg) ok((first_dlg ? hr == S_OK : hr == S_FALSE) || broken(first_dlg && hr == S_FALSE), "OleInitialize() returned %#x (first dialog %#x)\n", hr, first_dlg);
1
0
0
0
Józef Kucia : comdlg32/tests: Add test for OLE initialization in file dialogs.
by Alexandre Julliard
02 Feb '17
02 Feb '17
Module: wine Branch: master Commit: 5dda6495eb9cc6f0d9f35a3720f78d6f963d7070 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=5dda6495eb9cc6f0d9f35a372…
Author: Józef Kucia <jkucia(a)codeweavers.com> Date: Thu Feb 2 16:10:05 2017 +0100 comdlg32/tests: Add test for OLE initialization in file dialogs. Signed-off-by: Józef Kucia <jkucia(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/comdlg32/tests/filedlg.c | 69 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) diff --git a/dlls/comdlg32/tests/filedlg.c b/dlls/comdlg32/tests/filedlg.c index 9270b66..89aa8fa 100644 --- a/dlls/comdlg32/tests/filedlg.c +++ b/dlls/comdlg32/tests/filedlg.c @@ -1266,6 +1266,74 @@ static void test_directory_filename(void) todo_wine ok(!ret, "GetOpenFileNameW returned %#x\n", ret); } +static UINT_PTR WINAPI test_ole_init_wndproc(HWND dlg, UINT msg, WPARAM wParam, LPARAM lParam) +{ + HRESULT hr; + + hr = OleInitialize(NULL); + ok(hr == S_FALSE, "OleInitialize() returned %#x\n", hr); + OleUninitialize(); + + if (msg == WM_NOTIFY) + PostMessageA(GetParent(dlg), WM_COMMAND, IDCANCEL, 0); + return FALSE; +} + +static LRESULT CALLBACK hook_proc(int code, WPARAM wp, LPARAM lp) +{ + static BOOL first_dlg = TRUE; + HRESULT hr; + + if (code == HCBT_CREATEWND) + { + CBT_CREATEWNDW *c = (CBT_CREATEWNDW *)lp; + + if (c->lpcs->lpszClass == (LPWSTR)WC_DIALOG) + { + /* OleInitialize() creates a window for the main apartment. Since + * Vista OleInitialize() is called before the file dialog is + * created. SimCity 2000 expects that the first window created + * after GetOpenFileA() is a file dialog window. Mark Vista+ + * behavior as broken. */ + hr = OleInitialize(NULL); + todo_wine_if(first_dlg) + ok((first_dlg ? hr == S_OK : hr == S_FALSE) + || broken(first_dlg && hr == S_FALSE), + "OleInitialize() returned %#x (first dialog %#x)\n", hr, first_dlg); + OleUninitialize(); + first_dlg = FALSE; + } + } + + return CallNextHookEx(NULL, code, wp, lp); +} + +static void test_ole_initialization(void) +{ + char file[MAX_PATH] = {0}; + OPENFILENAMEA ofn = {0}; + HRESULT hr; + HHOOK hook; + BOOL ret; + + hook = SetWindowsHookExW(WH_CBT, hook_proc, NULL, GetCurrentThreadId()); + + ofn.lStructSize = OPENFILENAME_SIZE_VERSION_400A; + ofn.lpstrFile = file; + ofn.nMaxFile = MAX_PATH; + ofn.lpfnHook = test_ole_init_wndproc; + ofn.Flags = OFN_ENABLEHOOK | OFN_EXPLORER; + ofn.hInstance = GetModuleHandleA(NULL); + ret = GetOpenFileNameA(&ofn); + ok(!ret, "GetOpenFileNameA returned %#x\n", ret); + + hr = OleInitialize(NULL); + ok(hr == S_OK, "OleInitialize() returned %#x\n", hr); + OleUninitialize(); + + UnhookWindowsHookEx(hook); +} + START_TEST(filedlg) { test_DialogCancel(); @@ -1280,4 +1348,5 @@ START_TEST(filedlg) test_extension(); test_null_filename(); test_directory_filename(); + test_ole_initialization(); }
1
0
0
0
Jacek Caban : mshtml/tests: Added COM aggregation tests.
by Alexandre Julliard
02 Feb '17
02 Feb '17
Module: wine Branch: master Commit: fdcd7e60c2c8b8a9e06cd26def7b2a73a058a612 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=fdcd7e60c2c8b8a9e06cd26de…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Thu Feb 2 16:10:13 2017 +0100 mshtml/tests: Added COM aggregation tests. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/mshtml/tests/htmldoc.c | 71 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) diff --git a/dlls/mshtml/tests/htmldoc.c b/dlls/mshtml/tests/htmldoc.c index 90d5b41..cb6c9b0 100644 --- a/dlls/mshtml/tests/htmldoc.c +++ b/dlls/mshtml/tests/htmldoc.c @@ -50,6 +50,7 @@ DEFINE_GUID(GUID_NULL,0,0,0,0,0,0,0,0,0,0,0); DEFINE_GUID(IID_IProxyManager,0x00000008,0x0000,0x0000,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x46); DEFINE_OLEGUID(CGID_DocHostCmdPriv, 0x000214D4L, 0, 0); DEFINE_GUID(SID_SContainerDispatch,0xb722be00,0x4e68,0x101b,0xa2,0xbc,0x00,0xaa,0x00,0x40,0x47,0x70); +DEFINE_GUID(outer_test_iid,0xabcabc00,0,0,0,0,0,0,0,0,0,0x66); #define DEFINE_EXPECT(func) \ static BOOL expect_ ## func = FALSE, called_ ## func = FALSE @@ -203,6 +204,8 @@ DEFINE_EXPECT(EnumConnections); DEFINE_EXPECT(EnumConnections_Next); DEFINE_EXPECT(WindowClosing); DEFINE_EXPECT(NavigateWithBindCtx); +DEFINE_EXPECT(outer_QI_IPersistMoniker); +DEFINE_EXPECT(outer_QI_test); static BOOL is_ie9plus; static IUnknown *doc_unk; @@ -8541,6 +8544,73 @@ static void test_ServiceProvider(void) release_document(doc); } +static HRESULT WINAPI outer_QueryInterface(IUnknown *iface, REFIID riid, void **ppv) +{ + if(IsEqualGUID(riid, &IID_IPersistMoniker)) { + CHECK_EXPECT(outer_QI_IPersistMoniker); + *ppv = NULL; + return E_NOINTERFACE; + } + if(IsEqualGUID(riid, &outer_test_iid)) { + CHECK_EXPECT(outer_QI_test); + *ppv = (IUnknown*)0xdeadbeef; + return S_OK; + } + ok(0, "unexpected call %s\n", wine_dbgstr_guid(riid)); + return E_NOINTERFACE; +} + +static ULONG WINAPI outer_AddRef(IUnknown *iface) +{ + return 2; +} + +static ULONG WINAPI outer_Release(IUnknown *iface) +{ + return 1; +} + +static const IUnknownVtbl outer_vtbl = { + outer_QueryInterface, + outer_AddRef, + outer_Release +}; + +static void test_com_aggregation(const CLSID *clsid) +{ + IUnknown outer = { &outer_vtbl }; + IClassFactory *class_factory; + IUnknown *unk, *unk2, *unk3; + HRESULT hres; + + hres = CoGetClassObject(clsid, CLSCTX_INPROC_SERVER, NULL, &IID_IClassFactory, (void**)&class_factory); + ok(hres == S_OK, "CoGetClassObject failed: %08x\n", hres); + + SET_EXPECT(outer_QI_IPersistMoniker); /* Some IE version QI for that. */ + hres = IClassFactory_CreateInstance(class_factory, &outer, &IID_IUnknown, (void**)&unk); + ok(hres == S_OK, "CreateInstance returned: %08x\n", hres); + SET_CALLED(outer_QI_IPersistMoniker); + + hres = IUnknown_QueryInterface(unk, &IID_IDispatch, (void**)&unk2); + ok(hres == S_OK, "Coult not get IDispatch iface: %08x\n", hres); + + SET_EXPECT(outer_QI_test); + hres = IUnknown_QueryInterface(unk2, &outer_test_iid, (void**)&unk3); + CHECK_CALLED(outer_QI_test); + ok(hres == S_OK, "Coult not get IInternetProtocol iface: %08x\n", hres); + ok(unk3 == (IUnknown*)0xdeadbeef, "unexpected unk2\n"); + + IUnknown_Release(unk2); + IUnknown_Release(unk); + + unk = (void*)0xdeadbeef; + hres = IClassFactory_CreateInstance(class_factory, &outer, &IID_IDispatch, (void**)&unk); + ok(hres == E_INVALIDARG, "CreateInstance returned: %08x\n", hres); + ok(!unk, "unk = %p\n", unk); + + IClassFactory_Release(class_factory); +} + START_TEST(htmldoc) { CoInitialize(NULL); @@ -8578,6 +8648,7 @@ START_TEST(htmldoc) test_UIActivate(TRUE, TRUE, TRUE); test_HTMLDoc_ISupportErrorInfo(); test_ServiceProvider(); + test_com_aggregation(&CLSID_HTMLDocument); DestroyWindow(container_hwnd); CoUninitialize();
1
0
0
0
Jacek Caban : mshtml: Added support for COM aggregation in HTMLDocument object.
by Alexandre Julliard
02 Feb '17
02 Feb '17
Module: wine Branch: master Commit: 6e94b955c229db99910cede9554843e55031a75a URL:
http://source.winehq.org/git/wine.git/?a=commit;h=6e94b955c229db99910cede95…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Thu Feb 2 16:10:05 2017 +0100 mshtml: Added support for COM aggregation in HTMLDocument object. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/mshtml/htmldoc.c | 93 ++++++++++++++++++++++++++++++++------------ dlls/mshtml/mshtml_private.h | 1 + dlls/msxml3/tests/xmlview.c | 2 +- 3 files changed, 70 insertions(+), 26 deletions(-) diff --git a/dlls/mshtml/htmldoc.c b/dlls/mshtml/htmldoc.c index f0b203e..940519a 100644 --- a/dlls/mshtml/htmldoc.c +++ b/dlls/mshtml/htmldoc.c @@ -4886,25 +4886,22 @@ static HRESULT create_document_fragment(nsIDOMNode *nsnode, HTMLDocumentNode *do return S_OK; } -/********************************************************** - * ICustomDoc implementation - */ - -static inline HTMLDocumentObj *impl_from_ICustomDoc(ICustomDoc *iface) +static inline HTMLDocumentObj *impl_from_IUnknown(IUnknown *iface) { - return CONTAINING_RECORD(iface, HTMLDocumentObj, ICustomDoc_iface); + return CONTAINING_RECORD(iface, HTMLDocumentObj, IUnknown_outer); } -static HRESULT WINAPI CustomDoc_QueryInterface(ICustomDoc *iface, REFIID riid, void **ppv) +static HRESULT WINAPI HTMLDocumentObj_QueryInterface(IUnknown *iface, REFIID riid, void **ppv) { - HTMLDocumentObj *This = impl_from_ICustomDoc(iface); + HTMLDocumentObj *This = impl_from_IUnknown(iface); TRACE("(%p)->(%s %p)\n", This, debugstr_mshtml_guid(riid), ppv); - if(htmldoc_qi(&This->basedoc, riid, ppv)) + if(IsEqualGUID(&IID_IUnknown, riid)) { + *ppv = &This->IUnknown_outer; + }else if(htmldoc_qi(&This->basedoc, riid, ppv)) { return *ppv ? S_OK : E_NOINTERFACE; - - if(IsEqualGUID(&IID_ICustomDoc, riid)) { + }else if(IsEqualGUID(&IID_ICustomDoc, riid)) { *ppv = &This->ICustomDoc_iface; }else if(IsEqualGUID(&IID_ITargetContainer, riid)) { *ppv = &This->ITargetContainer_iface; @@ -4920,9 +4917,9 @@ static HRESULT WINAPI CustomDoc_QueryInterface(ICustomDoc *iface, REFIID riid, v return S_OK; } -static ULONG WINAPI CustomDoc_AddRef(ICustomDoc *iface) +static ULONG WINAPI HTMLDocumentObj_AddRef(IUnknown *iface) { - HTMLDocumentObj *This = impl_from_ICustomDoc(iface); + HTMLDocumentObj *This = impl_from_IUnknown(iface); ULONG ref = InterlockedIncrement(&This->ref); TRACE("(%p) ref = %u\n", This, ref); @@ -4930,9 +4927,9 @@ static ULONG WINAPI CustomDoc_AddRef(ICustomDoc *iface) return ref; } -static ULONG WINAPI CustomDoc_Release(ICustomDoc *iface) +static ULONG WINAPI HTMLDocumentObj_Release(IUnknown *iface) { - HTMLDocumentObj *This = impl_from_ICustomDoc(iface); + HTMLDocumentObj *This = impl_from_IUnknown(iface); ULONG ref = InterlockedDecrement(&This->ref); TRACE("(%p) ref = %u\n", This, ref); @@ -4992,6 +4989,42 @@ static ULONG WINAPI CustomDoc_Release(ICustomDoc *iface) return ref; } +static const IUnknownVtbl HTMLDocumentObjVtbl = { + HTMLDocumentObj_QueryInterface, + HTMLDocumentObj_AddRef, + HTMLDocumentObj_Release +}; + +/********************************************************** + * ICustomDoc implementation + */ + +static inline HTMLDocumentObj *impl_from_ICustomDoc(ICustomDoc *iface) +{ + return CONTAINING_RECORD(iface, HTMLDocumentObj, ICustomDoc_iface); +} + +static HRESULT WINAPI CustomDoc_QueryInterface(ICustomDoc *iface, REFIID riid, void **ppv) +{ + HTMLDocumentObj *This = impl_from_ICustomDoc(iface); + + return htmldoc_query_interface(&This->basedoc, riid, ppv); +} + +static ULONG WINAPI CustomDoc_AddRef(ICustomDoc *iface) +{ + HTMLDocumentObj *This = impl_from_ICustomDoc(iface); + + return htmldoc_addref(&This->basedoc); +} + +static ULONG WINAPI CustomDoc_Release(ICustomDoc *iface) +{ + HTMLDocumentObj *This = impl_from_ICustomDoc(iface); + + return htmldoc_release(&This->basedoc); +} + static HRESULT WINAPI CustomDoc_SetUIHandler(ICustomDoc *iface, IDocHostUIHandler *pUIHandler) { HTMLDocumentObj *This = impl_from_ICustomDoc(iface); @@ -5042,7 +5075,7 @@ static dispex_static_data_t HTMLDocumentObj_dispex = { HTMLDocumentObj_iface_tids }; -HRESULT HTMLDocument_Create(IUnknown *pUnkOuter, REFIID riid, void** ppvObject) +HRESULT HTMLDocument_Create(IUnknown *outer, REFIID riid, void **ppv) { mozIDOMWindowProxy *mozwindow; HTMLDocumentObj *doc; @@ -5050,18 +5083,24 @@ HRESULT HTMLDocument_Create(IUnknown *pUnkOuter, REFIID riid, void** ppvObject) nsresult nsres; HRESULT hres; - TRACE("(%p %s %p)\n", pUnkOuter, debugstr_mshtml_guid(riid), ppvObject); + TRACE("(%p %s %p)\n", outer, debugstr_mshtml_guid(riid), ppv); + + if(outer && !IsEqualGUID(&IID_IUnknown, riid)) { + *ppv = NULL; + return E_INVALIDARG; + } doc = heap_alloc_zero(sizeof(HTMLDocumentObj)); if(!doc) return E_OUTOFMEMORY; + doc->ref = 1; + doc->IUnknown_outer.lpVtbl = &HTMLDocumentObjVtbl; + doc->ICustomDoc_iface.lpVtbl = &CustomDocVtbl; + init_dispex(&doc->dispex, (IUnknown*)&doc->ICustomDoc_iface, &HTMLDocumentObj_dispex); - init_doc(&doc->basedoc, (IUnknown*)&doc->ICustomDoc_iface, &doc->dispex.IDispatchEx_iface); + init_doc(&doc->basedoc, outer ? outer : &doc->IUnknown_outer, &doc->dispex.IDispatchEx_iface); TargetContainer_Init(doc); - - doc->ICustomDoc_iface.lpVtbl = &CustomDocVtbl; - doc->ref = 1; doc->basedoc.doc_obj = doc; doc->usermode = UNKNOWN_USERMODE; @@ -5075,10 +5114,14 @@ HRESULT HTMLDocument_Create(IUnknown *pUnkOuter, REFIID riid, void** ppvObject) return hres; } - hres = htmldoc_query_interface(&doc->basedoc, riid, ppvObject); - htmldoc_release(&doc->basedoc); - if(FAILED(hres)) - return hres; + if(IsEqualGUID(&IID_IUnknown, riid)) { + *ppv = &doc->IUnknown_outer; + }else { + hres = htmldoc_query_interface(&doc->basedoc, riid, ppv); + htmldoc_release(&doc->basedoc); + if(FAILED(hres)) + return hres; + } nsres = nsIWebBrowser_GetContentDOMWindow(doc->nscontainer->webbrowser, &mozwindow); if(NS_FAILED(nsres)) diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h index a18ddafe..9c8b94c 100644 --- a/dlls/mshtml/mshtml_private.h +++ b/dlls/mshtml/mshtml_private.h @@ -609,6 +609,7 @@ static inline ULONG htmldoc_release(HTMLDocument *This) struct HTMLDocumentObj { HTMLDocument basedoc; DispatchEx dispex; + IUnknown IUnknown_outer; ICustomDoc ICustomDoc_iface; ITargetContainer ITargetContainer_iface; diff --git a/dlls/msxml3/tests/xmlview.c b/dlls/msxml3/tests/xmlview.c index 3e3bd29..3c1d8d9 100644 --- a/dlls/msxml3/tests/xmlview.c +++ b/dlls/msxml3/tests/xmlview.c @@ -181,7 +181,7 @@ static void test_QueryInterface(void) ok(hres == S_OK, "QueryInterface(IID_IHTMLDocument) returned %x, expected S_OK\n", hres); hres = IHTMLDocument_QueryInterface(htmldoc, &IID_IUnknown, (void**)&unk); ok(hres == S_OK, "QueryInterface(IID_IUnknown) returned %x, expected S_OK\n", hres); - todo_wine ok(unk == xmlview, "Aggregation is not working as expected\n"); + ok(unk == xmlview, "Aggregation is not working as expected\n"); IUnknown_Release(unk); IHTMLDocument_Release(htmldoc);
1
0
0
0
Jacek Caban : mshtml: Renamed unk_imp to outer_unk.
by Alexandre Julliard
02 Feb '17
02 Feb '17
Module: wine Branch: master Commit: 2fb4de7b5e72e859160e5aceb4443e3d46917c71 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=2fb4de7b5e72e859160e5aceb…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Thu Feb 2 16:09:52 2017 +0100 mshtml: Renamed unk_imp to outer_unk. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/mshtml/htmldoc.c | 4 ++-- dlls/mshtml/mshtml_private.h | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/dlls/mshtml/htmldoc.c b/dlls/mshtml/htmldoc.c index b409e7d..f0b203e 100644 --- a/dlls/mshtml/htmldoc.c +++ b/dlls/mshtml/htmldoc.c @@ -4576,7 +4576,7 @@ static const cpc_entry_t HTMLDocument_cpc[] = { {NULL} }; -static void init_doc(HTMLDocument *doc, IUnknown *unk_impl, IDispatchEx *dispex) +static void init_doc(HTMLDocument *doc, IUnknown *outer, IDispatchEx *dispex) { doc->IHTMLDocument2_iface.lpVtbl = &HTMLDocumentVtbl; doc->IHTMLDocument3_iface.lpVtbl = &HTMLDocument3Vtbl; @@ -4589,7 +4589,7 @@ static void init_doc(HTMLDocument *doc, IUnknown *unk_impl, IDispatchEx *dispex) doc->ISupportErrorInfo_iface.lpVtbl = &SupportErrorInfoVtbl; doc->IProvideClassInfo_iface.lpVtbl = &ProvideClassInfoVtbl; - doc->unk_impl = unk_impl; + doc->outer_unk = outer; doc->dispex = dispex; doc->task_magic = get_task_target_magic(); diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h index 5a559ea..a18ddafe 100644 --- a/dlls/mshtml/mshtml_private.h +++ b/dlls/mshtml/mshtml_private.h @@ -577,7 +577,7 @@ struct HTMLDocument { IObjectSafety IObjectSafety_iface; IProvideClassInfo IProvideClassInfo_iface; - IUnknown *unk_impl; + IUnknown *outer_unk; IDispatchEx *dispex; HTMLDocumentObj *doc_obj; @@ -593,17 +593,17 @@ struct HTMLDocument { static inline HRESULT htmldoc_query_interface(HTMLDocument *This, REFIID riid, void **ppv) { - return IUnknown_QueryInterface(This->unk_impl, riid, ppv); + return IUnknown_QueryInterface(This->outer_unk, riid, ppv); } static inline ULONG htmldoc_addref(HTMLDocument *This) { - return IUnknown_AddRef(This->unk_impl); + return IUnknown_AddRef(This->outer_unk); } static inline ULONG htmldoc_release(HTMLDocument *This) { - return IUnknown_Release(This->unk_impl); + return IUnknown_Release(This->outer_unk); } struct HTMLDocumentObj {
1
0
0
0
← Newer
1
...
73
74
75
76
77
78
79
...
84
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
Results per page:
10
25
50
100
200