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
January 2015
----- 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
302 discussions
Start a n
N
ew thread
Qian Hong : atl: Don't conflict GWLP_USERDATA with user applications.
by Alexandre Julliard
15 Jan '15
15 Jan '15
Module: wine Branch: master Commit: 6756049be4b97de448f4bcbee8757db2cfda5c57 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=6756049be4b97de448f4bcbee…
Author: Qian Hong <qhong(a)codeweavers.com> Date: Thu Jan 15 17:28:50 2015 +0800 atl: Don't conflict GWLP_USERDATA with user applications. --- dlls/atl/atl_ax.c | 12 +++++++----- dlls/atl100/tests/atl.c | 2 +- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/dlls/atl/atl_ax.c b/dlls/atl/atl_ax.c index d7cf074..d16cdfd 100644 --- a/dlls/atl/atl_ax.c +++ b/dlls/atl/atl_ax.c @@ -55,6 +55,8 @@ typedef struct IOCS { BOOL fActive, fInPlace, fWindowless; } IOCS; +static const WCHAR wine_atl_iocsW[] = {'_','_','W','I','N','E','_','A','T','L','_','I','O','C','S','\0'}; + /********************************************************************** * AtlAxWin class window procedure */ @@ -150,7 +152,7 @@ static HRESULT IOCS_Detach( IOCS *This ) /* remove subclassing */ if ( This->hWnd ) { SetWindowLongPtrW( This->hWnd, GWLP_WNDPROC, (ULONG_PTR) This->OrigWndProc ); - SetWindowLongPtrW( This->hWnd, GWLP_USERDATA, 0 ); + RemovePropW( This->hWnd, wine_atl_iocsW); This->hWnd = NULL; } if ( This->control ) @@ -906,7 +908,7 @@ static LRESULT IOCS_OnWndProc( IOCS *This, HWND hWnd, UINT uMsg, WPARAM wParam, static LRESULT CALLBACK AtlHost_wndproc( HWND hWnd, UINT wMsg, WPARAM wParam, LPARAM lParam ) { - IOCS *This = (IOCS*) GetWindowLongPtrW( hWnd, GWLP_USERDATA ); + IOCS *This = (IOCS*) GetPropW( hWnd, wine_atl_iocsW ); return IOCS_OnWndProc( This, hWnd, wMsg, wParam, lParam ); } @@ -915,7 +917,7 @@ static HRESULT IOCS_Attach( IOCS *This, HWND hWnd, IUnknown *pUnkControl ) /* su This->hWnd = hWnd; IUnknown_QueryInterface( pUnkControl, &IID_IOleObject, (void**)&This->control ); IOleObject_SetClientSite( This->control, &This->IOleClientSite_iface ); - SetWindowLongPtrW( hWnd, GWLP_USERDATA, (ULONG_PTR) This ); + SetPropW( hWnd, wine_atl_iocsW, This ); This->OrigWndProc = (WNDPROC)SetWindowLongPtrW( hWnd, GWLP_WNDPROC, (ULONG_PTR) AtlHost_wndproc ); return S_OK; @@ -1328,7 +1330,7 @@ HRESULT WINAPI AtlAxGetHost(HWND hWnd, IUnknown **host) *host = NULL; - This = (IOCS*) GetWindowLongPtrW( hWnd, GWLP_USERDATA ); + This = (IOCS*) GetPropW( hWnd, wine_atl_iocsW ); if ( !This ) { WARN("No container attached to %p\n", hWnd ); @@ -1350,7 +1352,7 @@ HRESULT WINAPI AtlAxGetControl(HWND hWnd, IUnknown **pUnk) *pUnk = NULL; - This = (IOCS*) GetWindowLongPtrW( hWnd, GWLP_USERDATA ); + This = (IOCS*) GetPropW( hWnd, wine_atl_iocsW ); if ( !This || !This->control ) { WARN("No control attached to %p\n", hWnd ); diff --git a/dlls/atl100/tests/atl.c b/dlls/atl100/tests/atl.c index 6a8bbce..8cf0a32 100644 --- a/dlls/atl100/tests/atl.c +++ b/dlls/atl100/tests/atl.c @@ -845,7 +845,7 @@ static void test_AtlAxAttachControl(void) ok(hr == S_OK, "Expected AtlAxAttachControl to return S_OK, got 0x%08x\n", hr); ok(container != NULL, "Expected not NULL!\n"); val = GetWindowLongW(hwnd, GWLP_USERDATA); - todo_wine ok(val == 0xdeadbeef, "Expected unchanged, returned %08x\n", val); + ok(val == 0xdeadbeef, "Expected unchanged, returned %08x\n", val); DestroyWindow(hwnd); IUnknown_Release(control);
1
0
0
0
Qian Hong : atl100/tests: Added tests for AtlAxAttachControl.
by Alexandre Julliard
15 Jan '15
15 Jan '15
Module: wine Branch: master Commit: e1999c2a0eea1b5cbeda28cd6b59945b702b1f6b URL:
http://source.winehq.org/git/wine.git/?a=commit;h=e1999c2a0eea1b5cbeda28cd6…
Author: Qian Hong <qhong(a)codeweavers.com> Date: Thu Jan 15 17:28:14 2015 +0800 atl100/tests: Added tests for AtlAxAttachControl. --- dlls/atl100/tests/atl.c | 98 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 98 insertions(+) diff --git a/dlls/atl100/tests/atl.c b/dlls/atl100/tests/atl.c index dcc199f..6a8bbce 100644 --- a/dlls/atl100/tests/atl.c +++ b/dlls/atl100/tests/atl.c @@ -25,6 +25,7 @@ #include <windef.h> #include <winbase.h> #include <winuser.h> +#include <exdisp.h> #include <atlbase.h> #include <mshtml.h> @@ -757,8 +758,104 @@ static void test_ax_win(void) todo_wine ok(wndproc[0] != wndproc[1], "expected different proc!\n"); } +static ATOM register_class(void) +{ + WNDCLASSA wndclassA; + + wndclassA.style = 0; + wndclassA.lpfnWndProc = DefWindowProcA; + wndclassA.cbClsExtra = 0; + wndclassA.cbWndExtra = 0; + wndclassA.hInstance = GetModuleHandleA(NULL); + wndclassA.hIcon = NULL; + wndclassA.hCursor = LoadCursorA(NULL, (LPSTR)IDC_ARROW); + wndclassA.hbrBackground = (HBRUSH)(COLOR_BTNFACE+1); + wndclassA.lpszMenuName = NULL; + wndclassA.lpszClassName = "WineAtlTestClass"; + + return RegisterClassA(&wndclassA); +} + +static HWND create_container_window(void) +{ + return CreateWindowA("WineAtlTestClass", "Wine ATL Test Window", 0, + CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, + CW_USEDEFAULT, NULL, NULL, NULL, NULL); +} + +static void test_AtlAxAttachControl(void) +{ + HWND hwnd; + HRESULT hr; + IUnknown *control, *container; + LONG val; + + hr = AtlAxAttachControl(NULL, NULL, NULL); + ok(hr == E_INVALIDARG, "Expected AtlAxAttachControl to return E_INVALIDARG, got 0x%08x\n", hr); + + container = (IUnknown *)0xdeadbeef; + hr = AtlAxAttachControl(NULL, NULL, &container); + ok(hr == E_INVALIDARG, "Expected AtlAxAttachControl to return E_INVALIDARG, got 0x%08x\n", hr); + ok(container == (IUnknown *)0xdeadbeef, + "Expected the output container pointer to be untouched, got %p\n", container); + + hwnd = create_container_window(); + hr = AtlAxAttachControl(NULL, hwnd, NULL); + ok(hr == E_INVALIDARG, "Expected AtlAxAttachControl to return E_INVALIDARG, got 0x%08x\n", hr); + DestroyWindow(hwnd); + + hwnd = create_container_window(); + container = (IUnknown *)0xdeadbeef; + hr = AtlAxAttachControl(NULL, hwnd, &container); + ok(hr == E_INVALIDARG, "Expected AtlAxAttachControl to return E_INVALIDARG, got 0x%08x\n", hr); + ok(container == (IUnknown *)0xdeadbeef, "returned %p\n", container); + DestroyWindow(hwnd); + + hr = CoCreateInstance(&CLSID_WebBrowser, NULL, CLSCTX_INPROC_SERVER | CLSCTX_INPROC_HANDLER, + &IID_IOleObject, (void **)&control); + ok(hr == S_OK, "Expected CoCreateInstance to return S_OK, got 0x%08x\n", hr); + + if (FAILED(hr)) + { + skip("Couldn't obtain a test IOleObject instance\n"); + return; + } + + hr = AtlAxAttachControl(control, NULL, NULL); + ok(hr == S_FALSE, "Expected AtlAxAttachControl to return S_FALSE, got 0x%08x\n", hr); + + container = NULL; + hr = AtlAxAttachControl(control, NULL, &container); + ok(hr == S_FALSE, "Expected AtlAxAttachControl to return S_FALSE, got 0x%08x\n", hr); + ok(container != NULL, "got %p\n", container); + IUnknown_Release(container); + + hwnd = create_container_window(); + SetWindowLongW(hwnd, GWLP_USERDATA, 0xdeadbeef); + hr = AtlAxAttachControl(control, hwnd, NULL); + ok(hr == S_OK, "Expected AtlAxAttachControl to return S_OK, got 0x%08x\n", hr); + val = GetWindowLongW(hwnd, GWLP_USERDATA); + ok(val == 0xdeadbeef, "returned %08x\n", val); + DestroyWindow(hwnd); + + hwnd = create_container_window(); + SetWindowLongW(hwnd, GWLP_USERDATA, 0xdeadbeef); + container = NULL; + hr = AtlAxAttachControl(control, hwnd, &container); + ok(hr == S_OK, "Expected AtlAxAttachControl to return S_OK, got 0x%08x\n", hr); + ok(container != NULL, "Expected not NULL!\n"); + val = GetWindowLongW(hwnd, GWLP_USERDATA); + todo_wine ok(val == 0xdeadbeef, "Expected unchanged, returned %08x\n", val); + DestroyWindow(hwnd); + + IUnknown_Release(control); +} + START_TEST(atl) { + if (!register_class()) + return; + CoInitialize(NULL); test_winmodule(); @@ -767,6 +864,7 @@ START_TEST(atl) test_cp(); test_source_iface(); test_ax_win(); + test_AtlAxAttachControl(); CoUninitialize(); }
1
0
0
0
Michael Müller : shlwapi: Correctly treat '.' when enumerating files in PathIsDirectoryEmptyW.
by Alexandre Julliard
15 Jan '15
15 Jan '15
Module: wine Branch: master Commit: 8758a8a671c14d4e4c1303ea9dacd5e7066e5475 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=8758a8a671c14d4e4c1303ea9…
Author: Michael Müller <michael(a)fds-team.de> Date: Sun Sep 28 17:30:45 2014 +0200 shlwapi: Correctly treat '.' when enumerating files in PathIsDirectoryEmptyW. --- dlls/shlwapi/path.c | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/dlls/shlwapi/path.c b/dlls/shlwapi/path.c index a3b462c..dae949a 100644 --- a/dlls/shlwapi/path.c +++ b/dlls/shlwapi/path.c @@ -3872,13 +3872,13 @@ BOOL WINAPI PathIsDirectoryEmptyW(LPCWSTR lpszPath) WCHAR szSearch[MAX_PATH]; DWORD dwLen; HANDLE hfind; - BOOL retVal = FALSE; + BOOL retVal = TRUE; WIN32_FIND_DATAW find_data; TRACE("(%s)\n",debugstr_w(lpszPath)); if (!lpszPath || !PathIsDirectoryW(lpszPath)) - return FALSE; + return FALSE; lstrcpynW(szSearch, lpszPath, MAX_PATH); PathAddBackslashW(szSearch); @@ -3888,14 +3888,23 @@ BOOL WINAPI PathIsDirectoryEmptyW(LPCWSTR lpszPath) strcpyW(szSearch + dwLen, szAllFiles); hfind = FindFirstFileW(szSearch, &find_data); - if (hfind != INVALID_HANDLE_VALUE) + if (hfind == INVALID_HANDLE_VALUE) + return FALSE; + + do { - if (find_data.cFileName[0] == '.' && find_data.cFileName[1] == '.') - /* The only directory entry should be the parent */ - retVal = !FindNextFileW(hfind, &find_data); - FindClose(hfind); + if (find_data.cFileName[0] == '.') + { + if (find_data.cFileName[1] == '\0') continue; + if (find_data.cFileName[1] == '.' && find_data.cFileName[2] == '\0') continue; + } + + retVal = FALSE; + break; } + while (FindNextFileW(hfind, &find_data)); + FindClose(hfind); return retVal; }
1
0
0
0
Sebastian Lackner : ntoskrnl: Initialize irp.Tail.Overlay.OriginalFileObject with stub file object.
by Alexandre Julliard
15 Jan '15
15 Jan '15
Module: wine Branch: master Commit: cffe06af801471584344462e6118c8bc7ab73b6f URL:
http://source.winehq.org/git/wine.git/?a=commit;h=cffe06af801471584344462e6…
Author: Sebastian Lackner <sebastian(a)fds-team.de> Date: Mon Nov 10 23:48:14 2014 +0100 ntoskrnl: Initialize irp.Tail.Overlay.OriginalFileObject with stub file object. --- dlls/ntoskrnl.exe/ntoskrnl.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/dlls/ntoskrnl.exe/ntoskrnl.c b/dlls/ntoskrnl.exe/ntoskrnl.c index c10377a..af1626d 100644 --- a/dlls/ntoskrnl.exe/ntoskrnl.c +++ b/dlls/ntoskrnl.exe/ntoskrnl.c @@ -143,6 +143,7 @@ static NTSTATUS process_ioctl( DEVICE_OBJECT *device, ULONG code, void *in_buff, IRP irp; MDL mdl; IO_STACK_LOCATION irpsp; + FILE_OBJECT file; PDRIVER_DISPATCH dispatch = device->DriverObject->MajorFunction[IRP_MJ_DEVICE_CONTROL]; NTSTATUS status; LARGE_INTEGER count; @@ -153,6 +154,7 @@ static NTSTATUS process_ioctl( DEVICE_OBJECT *device, ULONG code, void *in_buff, memset( &irp, 0x55, sizeof(irp) ); memset( &irpsp, 0x66, sizeof(irpsp) ); memset( &mdl, 0x77, sizeof(mdl) ); + memset( &file, 0x88, sizeof(file) ); irp.RequestorMode = UserMode; if ((code & 3) == METHOD_BUFFERED) @@ -167,6 +169,7 @@ static NTSTATUS process_ioctl( DEVICE_OBJECT *device, ULONG code, void *in_buff, irp.UserBuffer = out_buff; irp.MdlAddress = &mdl; irp.Tail.Overlay.s.u2.CurrentStackLocation = &irpsp; + irp.Tail.Overlay.OriginalFileObject = &file; irp.UserIosb = NULL; irpsp.MajorFunction = IRP_MJ_DEVICE_CONTROL; @@ -183,6 +186,9 @@ static NTSTATUS process_ioctl( DEVICE_OBJECT *device, ULONG code, void *in_buff, mdl.ByteCount = *out_size; mdl.ByteOffset = 0; + file.FsContext = NULL; + file.FsContext2 = NULL; + device->CurrentIrp = &irp; KeQueryTickCount( &count ); /* update the global KeTickCount */
1
0
0
0
Bruno Jesus : ws2_32: Trace getpeername() result.
by Alexandre Julliard
15 Jan '15
15 Jan '15
Module: wine Branch: master Commit: 632de943bed4aa0072c0690dbe903eef8328240b URL:
http://source.winehq.org/git/wine.git/?a=commit;h=632de943bed4aa0072c0690db…
Author: Bruno Jesus <00cpxxx(a)gmail.com> Date: Wed Jan 14 22:51:16 2015 -0200 ws2_32: Trace getpeername() result. --- dlls/ws2_32/socket.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dlls/ws2_32/socket.c b/dlls/ws2_32/socket.c index 5b9a441..0bc9d16 100644 --- a/dlls/ws2_32/socket.c +++ b/dlls/ws2_32/socket.c @@ -2985,7 +2985,10 @@ int WINAPI WS_getpeername(SOCKET s, struct WS_sockaddr *name, int *namelen) /* The buffer was too small */ SetLastError(WSAEFAULT); else + { res = 0; + TRACE("=> %s\n", debugstr_sockaddr(name)); + } } else SetLastError(wsaErrno());
1
0
0
0
Austin English : iphlpapi: Add FreeMibTable implementation.
by Alexandre Julliard
14 Jan '15
14 Jan '15
Module: wine Branch: master Commit: 44933230f63402ad079c8d22c024119f8d5228e6 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=44933230f63402ad079c8d22c…
Author: Austin English <austinenglish(a)gmail.com> Date: Mon Jan 12 14:50:43 2015 -0800 iphlpapi: Add FreeMibTable implementation. --- dlls/iphlpapi/iphlpapi.spec | 2 +- dlls/iphlpapi/iphlpapi_main.c | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/dlls/iphlpapi/iphlpapi.spec b/dlls/iphlpapi/iphlpapi.spec index fcb6d72..228f64f 100644 --- a/dlls/iphlpapi/iphlpapi.spec +++ b/dlls/iphlpapi/iphlpapi.spec @@ -66,7 +66,7 @@ #@ stub FlushIpNetTable2 @ stub FlushIpNetTableFromStack #@ stub FlushIpPathTable -#@ stub FreeMibTable +@ stdcall FreeMibTable( ptr ) @ stdcall GetAdapterIndex( wstr ptr ) @ stub GetAdapterOrderMap @ stdcall GetAdaptersAddresses( long long ptr ptr ptr ) diff --git a/dlls/iphlpapi/iphlpapi_main.c b/dlls/iphlpapi/iphlpapi_main.c index f04e12a..59f3593 100644 --- a/dlls/iphlpapi/iphlpapi_main.c +++ b/dlls/iphlpapi/iphlpapi_main.c @@ -442,6 +442,20 @@ DWORD WINAPI FlushIpNetTable(DWORD dwIfIndex) return ERROR_NOT_SUPPORTED; } +/****************************************************************** + * FreeMibTable (IPHLPAPI.@) + * + * Free buffer allocated by network functions + * + * PARAMS + * ptr [In] pointer to the buffer to free + * + */ +void WINAPI FreeMibTable(void *ptr) +{ + TRACE("(%p)\n", ptr); + HeapFree(GetProcessHeap(), 0, ptr); +} /****************************************************************** * GetAdapterIndex (IPHLPAPI.@)
1
0
0
0
Qian Hong : atl100/tests: Added more tests for class AtlAxWin100 and AtlAxWinLic100.
by Alexandre Julliard
14 Jan '15
14 Jan '15
Module: wine Branch: master Commit: 0486b4368d63aa6cb97727c4d97e6030dfab431f URL:
http://source.winehq.org/git/wine.git/?a=commit;h=0486b4368d63aa6cb97727c4d…
Author: Qian Hong <qhong(a)codeweavers.com> Date: Tue Jan 13 17:01:42 2015 +0800 atl100/tests: Added more tests for class AtlAxWin100 and AtlAxWinLic100. --- dlls/atl100/tests/atl.c | 170 ++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 156 insertions(+), 14 deletions(-) diff --git a/dlls/atl100/tests/atl.c b/dlls/atl100/tests/atl.c index 96abf57..dcc199f 100644 --- a/dlls/atl100/tests/atl.c +++ b/dlls/atl100/tests/atl.c @@ -591,28 +591,170 @@ static void test_source_iface(void) static void test_ax_win(void) { - BOOL ret; + DWORD ret, ret_size, i; + HRESULT res; + HWND hwnd; + HANDLE hfile; + IUnknown *control; + WNDPROC wndproc[2] = {NULL, NULL}; + WCHAR file_uri1W[MAX_PATH], pathW[MAX_PATH]; WNDCLASSEXW wcex; - static const WCHAR AtlAxWin100[] = {'A','t','l','A','x','W','i','n','1','0','0',0}; - static const WCHAR AtlAxWinLic100[] = {'A','t','l','A','x','W','i','n','L','i','c','1','0','0',0}; static HMODULE hinstance = 0; + static const WCHAR emptyW[] = {'\0'}; + static const WCHAR randomW[] = {'r','a','n','d','o','m','\0'}; + static const WCHAR progid1W[] = {'S','h','e','l','l','.','E','x','p','l','o','r','e','r','.','2','\0'}; + static const WCHAR clsid1W[] = {'{','8','8','5','6','f','9','6','1','-','3','4','0','a','-', + '1','1','d','0','-','a','9','6','b','-', + '0','0','c','0','4','f','d','7','0','5','a','2','}','\0'}; + static const WCHAR url1W[] = {'h','t','t','p',':','/','/','t','e','s','t','.','w','i','n','e','h','q', + '.','o','r','g','/','t','e','s','t','s','/','w','i','n','e','h','q','_', + 's','n','a','p','s','h','o','t','/','\0'}; + static const WCHAR mshtml1W[] = {'m','s','h','t','m','l',':','<','h','t','m','l','>','<','b','o','d','y','>', + 't','e','s','t','<','/','b','o','d','y','>','<','/','h','t','m','l','>','\0'}; + static const WCHAR mshtml2W[] = {'M','S','H','T','M','L',':','<','h','t','m','l','>','<','b','o','d','y','>', + 't','e','s','t','<','/','b','o','d','y','>','<','/','h','t','m','l','>','\0'}; + static const WCHAR mshtml3W[] = {'<','h','t','m','l','>','<','b','o','d','y','>', 't','e','s','t', + '<','/','b','o','d','y','>','<','/','h','t','m','l','>','\0'}; + static const WCHAR fileW[] = {'f','i','l','e',':','/','/','/','\0'}; + static const WCHAR html_fileW[] = {'t','e','s','t','.','h','t','m','l','\0'}; + static const char html_str[] = "<html><body>test</body><html>"; + static const WCHAR cls_names[][16] = + { + {'A','t','l','A','x','W','i','n','1','0','0',0}, + {'A','t','l','A','x','W','i','n','L','i','c','1','0','0',0} + }; ret = AtlAxWinInit(); ok(ret, "AtlAxWinInit failed\n"); hinstance = GetModuleHandleA(NULL); - memset(&wcex, 0, sizeof(wcex)); - wcex.cbSize = sizeof(wcex); - ret = GetClassInfoExW(hinstance, AtlAxWin100, &wcex); - ok(ret, "AtlAxWin100 has not registered\n"); - ok(wcex.style == (CS_GLOBALCLASS | CS_DBLCLKS), "wcex.style %08x\n", wcex.style); - - memset(&wcex, 0, sizeof(wcex)); - wcex.cbSize = sizeof(wcex); - ret = GetClassInfoExW(hinstance, AtlAxWinLic100, &wcex); - ok(ret, "AtlAxWinLic100 has not registered\n"); - ok(wcex.style == (CS_GLOBALCLASS | CS_DBLCLKS), "wcex.style %08x\n", wcex.style); + for (i = 0; i < 2; i++) + { + memset(&wcex, 0, sizeof(wcex)); + wcex.cbSize = sizeof(wcex); + ret = GetClassInfoExW(hinstance, cls_names[i], &wcex); + ok(ret, "%s has not registered\n", wine_dbgstr_w(cls_names[i])); + ok(wcex.style == (CS_GLOBALCLASS | CS_DBLCLKS), "wcex.style %08x\n", wcex.style); + wndproc[i] = wcex.lpfnWndProc; + + hwnd = CreateWindowW(cls_names[i], NULL, 0, 100, 100, 100, 100, NULL, NULL, NULL, NULL); + ok(hwnd != NULL, "CreateWindow failed!\n"); + control = (IUnknown *)0xdeadbeef; + res = AtlAxGetControl(hwnd, &control); + todo_wine ok(res == E_FAIL, "Expected E_FAIL, returned %08x\n", res); + todo_wine ok(!control, "returned %p\n", control); + if (control) IUnknown_Release(control); + DestroyWindow(hwnd); + + hwnd = CreateWindowW(cls_names[i], emptyW, 0, 100, 100, 100, 100, NULL, NULL, NULL, NULL); + ok(hwnd != NULL, "CreateWindow failed!\n"); + control = (IUnknown *)0xdeadbeef; + res = AtlAxGetControl(hwnd, &control); + todo_wine ok(res == E_FAIL, "Expected E_FAIL, returned %08x\n", res); + todo_wine ok(!control, "returned %p\n", control); + if (control) IUnknown_Release(control); + DestroyWindow(hwnd); + + hwnd = CreateWindowW(cls_names[i], randomW, 0, 100, 100, 100, 100, NULL, NULL, NULL, NULL); + todo_wine ok(!hwnd, "returned %p\n", hwnd); + if(hwnd) DestroyWindow(hwnd); + + hwnd = CreateWindowW(cls_names[i], progid1W, 0, 100, 100, 100, 100, NULL, NULL, NULL, NULL); + ok(hwnd != NULL, "CreateWindow failed!\n"); + control = NULL; + res = AtlAxGetControl(hwnd, &control); + ok(res == S_OK, "AtlAxGetControl failed with res %08x\n", res); + ok(control != NULL, "AtlAxGetControl failed!\n"); + IUnknown_Release(control); + DestroyWindow(hwnd); + + hwnd = CreateWindowW(cls_names[i], clsid1W, 0, 100, 100, 100, 100, NULL, NULL, NULL, NULL); + ok(hwnd != NULL, "CreateWindow failed!\n"); + control = NULL; + res = AtlAxGetControl(hwnd, &control); + ok(res == S_OK, "AtlAxGetControl failed with res %08x\n", res); + ok(control != NULL, "AtlAxGetControl failed!\n"); + IUnknown_Release(control); + DestroyWindow(hwnd); + + hwnd = CreateWindowW(cls_names[i], url1W, 0, 100, 100, 100, 100, NULL, NULL, NULL, NULL); + ok(hwnd != NULL, "CreateWindow failed!\n"); + control = NULL; + res = AtlAxGetControl(hwnd, &control); + ok(res == S_OK, "AtlAxGetControl failed with res %08x\n", res); + ok(control != NULL, "AtlAxGetControl failed!\n"); + IUnknown_Release(control); + DestroyWindow(hwnd); + + /* test html stream with "MSHTML:" prefix */ + hwnd = CreateWindowW(cls_names[i], mshtml1W, 0, 100, 100, 100, 100, NULL, NULL, NULL, NULL); + ok(hwnd != NULL, "CreateWindow failed!\n"); + control = NULL; + res = AtlAxGetControl(hwnd, &control); + ok(res == S_OK, "AtlAxGetControl failed with res %08x\n", res); + ok(control != NULL, "AtlAxGetControl failed!\n"); + IUnknown_Release(control); + DestroyWindow(hwnd); + + hwnd = CreateWindowW(cls_names[i], mshtml2W, 0, 100, 100, 100, 100, NULL, NULL, NULL, NULL); + ok(hwnd != NULL, "CreateWindow failed!\n"); + control = NULL; + res = AtlAxGetControl(hwnd, &control); + ok(res == S_OK, "AtlAxGetControl failed with res %08x\n", res); + ok(control != NULL, "AtlAxGetControl failed!\n"); + IUnknown_Release(control); + DestroyWindow(hwnd); + + /* test html stream without "MSHTML:" prefix */ + hwnd = CreateWindowW(cls_names[i], mshtml3W, 0, 100, 100, 100, 100, NULL, NULL, NULL, NULL); + todo_wine ok(!hwnd, "returned %p\n", hwnd); + if(hwnd) DestroyWindow(hwnd); + + ret = GetTempPathW(MAX_PATH, pathW); + ok(ret, "GetTempPath failed!\n"); + lstrcatW(pathW, html_fileW); + hfile = CreateFileW(pathW, GENERIC_WRITE, 0, NULL, CREATE_NEW, 0, 0); + ok(hfile != INVALID_HANDLE_VALUE, "failed to create file\n"); + ret = WriteFile(hfile, html_str, sizeof(html_str), &ret_size, NULL); + ok(ret, "WriteFile failed\n"); + CloseHandle(hfile); + + /* test C:// scheme */ + hwnd = CreateWindowW(cls_names[i], pathW, 0, 100, 100, 100, 100, NULL, NULL, NULL, NULL); + ok(hwnd != NULL, "CreateWindow failed!\n"); + control = NULL; + res = AtlAxGetControl(hwnd, &control); + ok(res == S_OK, "AtlAxGetControl failed with res %08x\n", res); + ok(control != NULL, "AtlAxGetControl failed!\n"); + IUnknown_Release(control); + DestroyWindow(hwnd); + + /* test file:// scheme */ + lstrcpyW(file_uri1W, fileW); + lstrcatW(file_uri1W, pathW); + hwnd = CreateWindowW(cls_names[i], file_uri1W, 0, 100, 100, 100, 100, NULL, NULL, NULL, NULL); + ok(hwnd != NULL, "CreateWindow failed!\n"); + control = NULL; + res = AtlAxGetControl(hwnd, &control); + ok(res == S_OK, "AtlAxGetControl failed with res %08x\n", res); + ok(control != NULL, "AtlAxGetControl failed!\n"); + IUnknown_Release(control); + DestroyWindow(hwnd); + + /* test file:// scheme on non-existent file */ + ret = DeleteFileW(pathW); + ok(ret, "DeleteFile failed!\n"); + hwnd = CreateWindowW(cls_names[i], file_uri1W, 0, 100, 100, 100, 100, NULL, NULL, NULL, NULL); + ok(hwnd != NULL, "CreateWindow failed!\n"); + control = NULL; + res = AtlAxGetControl(hwnd, &control); + ok(res == S_OK, "AtlAxGetControl failed with res %08x\n", res); + ok(control != NULL, "AtlAxGetControl failed!\n"); + IUnknown_Release(control); + DestroyWindow(hwnd); + } + todo_wine ok(wndproc[0] != wndproc[1], "expected different proc!\n"); } START_TEST(atl)
1
0
0
0
Marcus Meissner : mshtml: Check for failed allocs (Coverity).
by Alexandre Julliard
14 Jan '15
14 Jan '15
Module: wine Branch: master Commit: 76fef29cd3fc8283819b457882d5a5cf00a05255 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=76fef29cd3fc8283819b45788…
Author: Marcus Meissner <marcus(a)jet.franken.de> Date: Sun Jan 11 23:40:19 2015 +0100 mshtml: Check for failed allocs (Coverity). --- dlls/mshtml/dispex.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/dlls/mshtml/dispex.c b/dlls/mshtml/dispex.c index 7f6d5c5..a97f09d 100644 --- a/dlls/mshtml/dispex.c +++ b/dlls/mshtml/dispex.c @@ -345,9 +345,18 @@ static dispex_data_t *preprocess_dispex_data(DispatchEx *This) } data = heap_alloc(sizeof(dispex_data_t)); + if (!data) { + ERR("Out of memory\n"); + return NULL; + } data->func_cnt = 0; data->func_disp_cnt = 0; data->funcs = heap_alloc_zero(size*sizeof(func_info_t)); + if (!data->funcs) { + heap_free (data); + ERR("Out of memory\n"); + return NULL; + } list_add_tail(&dispex_data_list, &data->entry); while(*tid) {
1
0
0
0
Hans Leidekker : wbemdisp: Implement ISWbemObject::Invoke.
by Alexandre Julliard
14 Jan '15
14 Jan '15
Module: wine Branch: master Commit: 054b260619b41d9375a3091aff39c32f4864313b URL:
http://source.winehq.org/git/wine.git/?a=commit;h=054b260619b41d9375a3091af…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Wed Jan 14 15:37:56 2015 +0100 wbemdisp: Implement ISWbemObject::Invoke. --- dlls/wbemdisp/locator.c | 29 ++++++++++++++++++++--------- dlls/wbemdisp/tests/wbemdisp.c | 40 +++++++++++++++++++++++++++++++++++++++- 2 files changed, 59 insertions(+), 10 deletions(-) diff --git a/dlls/wbemdisp/locator.c b/dlls/wbemdisp/locator.c index 989c610..c604983 100644 --- a/dlls/wbemdisp/locator.c +++ b/dlls/wbemdisp/locator.c @@ -270,6 +270,16 @@ static HRESULT WINAPI object_GetIDsOfNames( return S_OK; } +static BSTR get_member_name( struct object *object, DISPID dispid ) +{ + UINT i; + for (i = 0; i < object->nb_members; i++) + { + if (object->members[i].dispid == dispid) return object->members[i].name; + } + return NULL; +} + static HRESULT WINAPI object_Invoke( ISWbemObject *iface, DISPID member, @@ -282,20 +292,21 @@ static HRESULT WINAPI object_Invoke( UINT *arg_err ) { struct object *object = impl_from_ISWbemObject( iface ); - ITypeInfo *typeinfo; - HRESULT hr; + BSTR name; - TRACE( "%p, %d, %s, %d, %d, %p, %p, %p, %p\n", object, member, debugstr_guid(riid), + TRACE( "%p, %x, %s, %u, %x, %p, %p, %p, %p\n", object, member, debugstr_guid(riid), lcid, flags, params, result, excep_info, arg_err ); - hr = get_typeinfo( ISWbemObject_tid, &typeinfo ); - if (SUCCEEDED(hr)) + if (flags != (DISPATCH_METHOD|DISPATCH_PROPERTYGET)) { - hr = ITypeInfo_Invoke( typeinfo, &object->ISWbemObject_iface, member, flags, - params, result, excep_info, arg_err ); - ITypeInfo_Release( typeinfo ); + FIXME( "flags %x not supported\n", flags ); + return E_NOTIMPL; } - return hr; + if (!(name = get_member_name( object, member ))) + return DISP_E_MEMBERNOTFOUND; + + memset( params, 0, sizeof(*params) ); + return IWbemClassObject_Get( object->object, name, 0, result, NULL, NULL ); } static HRESULT WINAPI object_Put_( diff --git a/dlls/wbemdisp/tests/wbemdisp.c b/dlls/wbemdisp/tests/wbemdisp.c index d91e5b8..e3d432b 100644 --- a/dlls/wbemdisp/tests/wbemdisp.c +++ b/dlls/wbemdisp/tests/wbemdisp.c @@ -130,10 +130,12 @@ static void test_ParseDisplayName(void) if (enumvar) { - VARIANT var; + VARIANT var, res; ULONG fetched; IDispatch *dispatch = NULL; DISPID dispid; + DISPPARAMS params; + UINT arg_err; fetched = 0xdeadbeef; hr = IEnumVARIANT_Next( enumvar, 0, &var, &fetched ); @@ -183,6 +185,42 @@ static void test_ParseDisplayName(void) ok( hr == S_OK, "got %x\n", hr ); ok( dispid == 0x1800001 || dispid == 0x10b /* win2k */, "got %x\n", dispid ); + if (dispid == 0x1800001) /* crashes on win2k */ + { + V_VT( &res ) = VT_ERROR; + V_BSTR( &res ) = (BSTR)0xdeadbeef; + params.rgvarg = (VARIANTARG *)0xdeadbeef; + params.rgdispidNamedArgs = (DISPID *)0xdeadbeef; + params.cArgs = params.cNamedArgs = 0xdeadbeef; + arg_err = 0xdeadbeef; + hr = IDispatch_Invoke( dispatch, DISPID_UNKNOWN, &IID_NULL, english, + DISPATCH_METHOD|DISPATCH_PROPERTYGET, + ¶ms, &res, NULL, &arg_err ); + ok( hr == DISP_E_MEMBERNOTFOUND || hr == S_OK /* winxp */, "got %x\n", hr ); + ok( params.rgvarg == (VARIANTARG *)0xdeadbeef, "got %p\n", params.rgvarg ); + ok( params.rgdispidNamedArgs == (DISPID *)0xdeadbeef, "got %p\n", params.rgdispidNamedArgs ); + ok( params.cArgs == 0xdeadbeef, "got %u\n", params.cArgs ); + ok( params.cNamedArgs == 0xdeadbeef, "got %u\n", params.cNamedArgs ); + ok( V_VT( &res ) == VT_ERROR, "got %u\n", V_VT( &res ) ); + ok( V_ERROR( &res ) == 0xdeadbeef, "got %u\n", V_VT( &res ) ); + ok( arg_err == 0xdeadbeef, "got %u\n", arg_err ); + if (hr == S_OK) VariantClear( &res ); + } + + V_VT( &res ) = VT_ERROR; + V_BSTR( &res ) = (BSTR)0xdeadbeef; + memset( ¶ms, 0, sizeof(params) ); + hr = IDispatch_Invoke( dispatch, dispid, &IID_NULL, english, + DISPATCH_METHOD|DISPATCH_PROPERTYGET, + ¶ms, &res, NULL, NULL ); + ok( hr == S_OK, "got %x\n", hr ); + ok( params.rgvarg == NULL, "got %p\n", params.rgvarg ); + ok( params.rgdispidNamedArgs == NULL, "got %p\n", params.rgdispidNamedArgs ); + ok( !params.cArgs, "got %u\n", params.cArgs ); + ok( !params.cNamedArgs, "got %u\n", params.cNamedArgs ); + ok( V_VT( &res ) == VT_BSTR, "got %u\n", V_VT( &res ) ); + ok( V_BSTR( &res ) != (BSTR)0xdeadbeef, "got %u\n", V_VT( &res ) ); + VariantClear( &res ); VariantClear( &var ); fetched = 0xdeadbeef;
1
0
0
0
Hans Leidekker : wbemdisp: Implement ISwbemObject::GetIDsOfNames.
by Alexandre Julliard
14 Jan '15
14 Jan '15
Module: wine Branch: master Commit: e992df727a9bb5b54fbe4df4f1329bcabbb30bbf URL:
http://source.winehq.org/git/wine.git/?a=commit;h=e992df727a9bb5b54fbe4df4f…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Wed Jan 14 15:37:30 2015 +0100 wbemdisp: Implement ISwbemObject::GetIDsOfNames. --- dlls/wbemdisp/locator.c | 90 ++++++++++++++++++++++++++++++++++++++---- dlls/wbemdisp/tests/wbemdisp.c | 44 ++++++++++++++++++++- 2 files changed, 125 insertions(+), 9 deletions(-) diff --git a/dlls/wbemdisp/locator.c b/dlls/wbemdisp/locator.c index c3103fa..989c610 100644 --- a/dlls/wbemdisp/locator.c +++ b/dlls/wbemdisp/locator.c @@ -93,11 +93,22 @@ static HRESULT get_typeinfo( enum type_id tid, ITypeInfo **ret ) return S_OK; } +#define DISPID_BASE 0x1800000 + +struct member +{ + BSTR name; + DISPID dispid; +}; + struct object { ISWbemObject ISWbemObject_iface; LONG refs; IWbemClassObject *object; + struct member *members; + UINT nb_members; + DISPID last_dispid; }; static inline struct object *impl_from_ISWbemObject( @@ -120,8 +131,12 @@ static ULONG WINAPI object_Release( LONG refs = InterlockedDecrement( &object->refs ); if (!refs) { + UINT i; + TRACE( "destroying %p\n", object ); IWbemClassObject_Release( object->object ); + for (i = 0; i < object->nb_members; i++) SysFreeString( object->members[i].name ); + heap_free( object->members ); heap_free( object ); } return refs; @@ -169,9 +184,63 @@ static HRESULT WINAPI object_GetTypeInfo( ITypeInfo **info ) { struct object *object = impl_from_ISWbemObject( iface ); - TRACE( "%p, %u, %u, %p\n", object, index, lcid, info ); + FIXME( "%p, %u, %u, %p\n", object, index, lcid, info ); + return E_NOTIMPL; +} + +#define DISPID_BASE 0x1800000 + +static HRESULT init_members( struct object *object ) +{ + LONG bound, i; + SAFEARRAY *sa; + HRESULT hr; + + if (object->members) return S_OK; + + hr = IWbemClassObject_GetNames( object->object, NULL, 0, NULL, &sa ); + if (FAILED( hr )) return hr; + hr = SafeArrayGetUBound( sa, 1, &bound ); + if (FAILED( hr )) + { + SafeArrayDestroy( sa ); + return hr; + } + if (!(object->members = heap_alloc( sizeof(struct member) * (bound + 1) ))) + { + SafeArrayDestroy( sa ); + return E_OUTOFMEMORY; + } + for (i = 0; i <= bound; i++) + { + hr = SafeArrayGetElement( sa, &i, &object->members[i].name ); + if (FAILED( hr )) + { + for (i--; i >= 0; i--) SysFreeString( object->members[i].name ); + SafeArrayDestroy( sa ); + heap_free( object->members ); + object->members = NULL; + return E_OUTOFMEMORY; + } + object->members[i].dispid = 0; + } + object->nb_members = bound + 1; + SafeArrayDestroy( sa ); + return S_OK; +} - return get_typeinfo( ISWbemObject_tid, info ); +static DISPID get_member_dispid( struct object *object, const WCHAR *name ) +{ + UINT i; + for (i = 0; i < object->nb_members; i++) + { + if (!strcmpiW( object->members[i].name, name )) + { + if (!object->members[i].dispid) object->members[i].dispid = ++object->last_dispid; + return object->members[i].dispid; + } + } + return DISPID_UNKNOWN; } static HRESULT WINAPI object_GetIDsOfNames( @@ -183,20 +252,22 @@ static HRESULT WINAPI object_GetIDsOfNames( DISPID *dispid ) { struct object *object = impl_from_ISWbemObject( iface ); - ITypeInfo *typeinfo; HRESULT hr; + UINT i; TRACE( "%p, %s, %p, %u, %u, %p\n", object, debugstr_guid(riid), names, count, lcid, dispid ); if (!names || !count || !dispid) return E_INVALIDARG; - hr = get_typeinfo( ISWbemObject_tid, &typeinfo ); - if (SUCCEEDED(hr)) + hr = init_members( object ); + if (FAILED( hr )) return hr; + + for (i = 0; i < count; i++) { - hr = ITypeInfo_GetIDsOfNames( typeinfo, names, count, dispid ); - ITypeInfo_Release( typeinfo ); + if ((dispid[i] = get_member_dispid( object, names[i] )) == DISPID_UNKNOWN) break; } - return hr; + if (i != count) return DISP_E_UNKNOWNNAME; + return S_OK; } static HRESULT WINAPI object_Invoke( @@ -260,6 +331,9 @@ static HRESULT SWbemObject_create( IWbemClassObject *wbem_object, ISWbemObject * object->refs = 1; object->object = wbem_object; IWbemClassObject_AddRef( object->object ); + object->members = NULL; + object->nb_members = 0; + object->last_dispid = DISPID_BASE; *obj = &object->ISWbemObject_iface; TRACE( "returning iface %p\n", *obj ); diff --git a/dlls/wbemdisp/tests/wbemdisp.c b/dlls/wbemdisp/tests/wbemdisp.c index 863115b..d91e5b8 100644 --- a/dlls/wbemdisp/tests/wbemdisp.c +++ b/dlls/wbemdisp/tests/wbemdisp.c @@ -26,10 +26,14 @@ #include "wine/test.h" DEFINE_GUID(CLSID_WINMGMTS,0x172bddf8,0xceea,0x11d1,0x8b,0x05,0x00,0x60,0x08,0x06,0xd9,0xb6); +DEFINE_GUID(GUID_NULL,0,0,0,0,0,0,0,0,0,0,0); static void test_ParseDisplayName(void) { static const WCHAR biosW[] = {'W','i','n','3','2','_','B','i','o','s',0}; + static const WCHAR manufacturerW[] = {'M','a','n','u','f','a','c','t','u','r','e','r',0}; + static const WCHAR versionW[] = {'v','e','r','s','i','o','n',0}; + static const WCHAR nosuchW[] = {'N','o','S','u','c','h',0}; static const WCHAR name1[] = {'w','i','n','m','g','m','t','s',':',0}; static const WCHAR name2[] = @@ -54,12 +58,13 @@ static void test_ParseDisplayName(void) { name3, S_OK, &IID_ISWbemObject, sizeof(name3)/sizeof(name3[0]) - 1 }, { name4, S_OK, &IID_ISWbemObject, sizeof(name4)/sizeof(name4[0]) - 1 } }; + LCID english = MAKELCID(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),SORT_DEFAULT); IParseDisplayName *displayname; IBindCtx *ctx; IMoniker *moniker; IUnknown *obj; BSTR str; - ULONG i, eaten; + ULONG i, eaten, count; HRESULT hr; hr = CoCreateInstance( &CLSID_WINMGMTS, NULL, CLSCTX_INPROC_SERVER, &IID_IParseDisplayName, (void **)&displayname ); @@ -127,6 +132,8 @@ static void test_ParseDisplayName(void) { VARIANT var; ULONG fetched; + IDispatch *dispatch = NULL; + DISPID dispid; fetched = 0xdeadbeef; hr = IEnumVARIANT_Next( enumvar, 0, &var, &fetched ); @@ -141,6 +148,41 @@ static void test_ParseDisplayName(void) ok( fetched == 1, "got %u\n", fetched ); ok( V_VT( &var ) == VT_DISPATCH, "got %u\n", V_VT( &var ) ); ok( V_DISPATCH( &var ) != (IDispatch *)0xdeadbeef, "got %u\n", V_VT( &var ) ); + + dispatch = V_DISPATCH( &var ); + count = 0; + hr = IDispatch_GetTypeInfoCount( dispatch, &count ); + ok( hr == S_OK, "got %x\n", hr ); + ok( count == 1, "got %u\n", count ); + + str = SysAllocString( manufacturerW ); + dispid = 0xdeadbeef; + hr = IDispatch_GetIDsOfNames( dispatch, &IID_NULL, &str, 1, english, &dispid ); + SysFreeString( str ); + ok( hr == S_OK, "got %x\n", hr ); + ok( dispid == 0x1800001 || dispid == 0x10b /* win2k */, "got %x\n", dispid ); + + str = SysAllocString( versionW ); + dispid = 0xdeadbeef; + hr = IDispatch_GetIDsOfNames( dispatch, &IID_NULL, &str, 1, english, &dispid ); + SysFreeString( str ); + ok( hr == S_OK, "got %x\n", hr ); + ok( dispid == 0x1800002 || dispid == 0x119 /* win2k */, "got %x\n", dispid ); + + str = SysAllocString( nosuchW ); + dispid = 0xdeadbeef; + hr = IDispatch_GetIDsOfNames( dispatch, &IID_NULL, &str, 1, english, &dispid ); + SysFreeString( str ); + ok( hr == DISP_E_UNKNOWNNAME, "got %x\n", hr ); + ok( dispid == DISPID_UNKNOWN, "got %x\n", dispid ); + + str = SysAllocString( manufacturerW ); + dispid = 0xdeadbeef; + hr = IDispatch_GetIDsOfNames( dispatch, &IID_NULL, &str, 1, english, &dispid ); + SysFreeString( str ); + ok( hr == S_OK, "got %x\n", hr ); + ok( dispid == 0x1800001 || dispid == 0x10b /* win2k */, "got %x\n", dispid ); + VariantClear( &var ); fetched = 0xdeadbeef;
1
0
0
0
← Newer
1
...
15
16
17
18
19
20
21
...
31
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
Results per page:
10
25
50
100
200