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
June
May
April
March
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
November 2010
----- 2025 -----
June 2025
May 2025
April 2025
March 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
866 discussions
Start a n
N
ew thread
Alexandre Julliard : oleaut32: Convert dll registration to the new IRegistrar mechanism.
by Alexandre Julliard
24 Nov '10
24 Nov '10
Module: wine Branch: master Commit: 7769b05858b27e1fbe3d469253bb2777bbdddbae URL:
http://source.winehq.org/git/wine.git/?a=commit;h=7769b05858b27e1fbe3d46925…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Nov 24 17:29:27 2010 +0100 oleaut32: Convert dll registration to the new IRegistrar mechanism. --- dlls/oleaut32/Makefile.in | 5 +- dlls/oleaut32/oleaut.c | 56 ++++ dlls/oleaut32/oleaut32.rgs | 110 +++++++ dlls/oleaut32/olepicture.c | 1 + dlls/oleaut32/regsvr.c | 556 --------------------------------- dlls/oleaut32/{version.rc => rsrc.rc} | 3 + 6 files changed, 172 insertions(+), 559 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=7769b05858b27e1fbe3d4…
1
0
0
0
Alexandre Julliard : winecrt0: Add a generic mechanism for dll registration through IRegistrar.
by Alexandre Julliard
24 Nov '10
24 Nov '10
Module: wine Branch: master Commit: 4d966be69c0375e31a277cc0a9cf4bf75092038f URL:
http://source.winehq.org/git/wine.git/?a=commit;h=4d966be69c0375e31a277cc0a…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Nov 24 13:13:28 2010 +0100 winecrt0: Add a generic mechanism for dll registration through IRegistrar. --- dlls/winecrt0/Makefile.in | 1 + dlls/winecrt0/register.c | 142 +++++++++++++++++++++++++++++++++++++++++++++ include/rpcproxy.h | 29 ++++++++- tools/wine.inf.in | 2 +- 4 files changed, 170 insertions(+), 4 deletions(-) diff --git a/dlls/winecrt0/Makefile.in b/dlls/winecrt0/Makefile.in index ca95c89..d85fd3c 100644 --- a/dlls/winecrt0/Makefile.in +++ b/dlls/winecrt0/Makefile.in @@ -12,6 +12,7 @@ C_SRCS = \ exe_wentry.c \ exe_wmain.c \ init.c \ + register.c \ stub.c @MAKE_IMPLIB_RULES@ diff --git a/dlls/winecrt0/register.c b/dlls/winecrt0/register.c new file mode 100644 index 0000000..b1e1d17 --- /dev/null +++ b/dlls/winecrt0/register.c @@ -0,0 +1,142 @@ +/* + * Support functions for Wine dll registrations + * + * Copyright (c) 2010 Alexandre Julliard + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include "config.h" +#include <stdarg.h> + +#define COBJMACROS +#define ATL_INITGUID +#include "windef.h" +#include "winbase.h" +#include "winnls.h" +#include "objbase.h" +#include "rpcproxy.h" +#include "atliface.h" + +static const WCHAR ole32W[] = {'o','l','e','3','2','.','d','l','l',0}; +static const WCHAR regtypeW[] = {'W','I','N','E','_','R','E','G','I','S','T','R','Y',0}; +static const WCHAR moduleW[] = {'M','O','D','U','L','E',0}; +static const WCHAR clsidW[] = {'C','L','S','I','D','_','P','S','F','a','c','t','o','r','y','B','u','f','f','e','r',0}; + +struct reg_info +{ + IRegistrar *registrar; + const CLSID *clsid; + BOOL do_register; + BOOL uninit; + HRESULT result; +}; + +static HMODULE ole32; +static HRESULT (WINAPI *pCoInitialize)(LPVOID); +static void (WINAPI *pCoUninitialize)(void); +static HRESULT (WINAPI *pCoCreateInstance)(REFCLSID,LPUNKNOWN,DWORD,REFIID,LPVOID*); +static INT (WINAPI *pStringFromGUID2)(REFGUID,LPOLESTR,INT); + +static IRegistrar *create_registrar( HMODULE inst, struct reg_info *info ) +{ + if (!ole32) + { + if (!(ole32 = LoadLibraryW( ole32W )) || + !(pCoInitialize = (void *)GetProcAddress( ole32, "CoInitialize" )) || + !(pCoUninitialize = (void *)GetProcAddress( ole32, "CoUninitialize" )) || + !(pCoCreateInstance = (void *)GetProcAddress( ole32, "CoCreateInstance" )) || + !(pStringFromGUID2 = (void *)GetProcAddress( ole32, "StringFromGUID2" ))) + { + info->result = E_NOINTERFACE; + return NULL; + } + } + info->uninit = SUCCEEDED( pCoInitialize( NULL )); + + info->result = pCoCreateInstance( &CLSID_Registrar, NULL, CLSCTX_INPROC_SERVER, + &IID_IRegistrar, (void **)&info->registrar ); + if (SUCCEEDED( info->result )) + { + WCHAR str[MAX_PATH]; + + GetModuleFileNameW( inst, str, MAX_PATH ); + IRegistrar_AddReplacement( info->registrar, moduleW, str ); + if (info->clsid) + { + pStringFromGUID2( info->clsid, str, MAX_PATH ); + IRegistrar_AddReplacement( info->registrar, clsidW, str ); + } + } + return info->registrar; +} + +static BOOL CALLBACK register_resource( HMODULE module, LPCWSTR type, LPWSTR name, LONG_PTR arg ) +{ + struct reg_info *info = (struct reg_info *)arg; + WCHAR *buffer; + HRSRC rsrc = FindResourceW( module, name, type ); + char *str = LoadResource( module, rsrc ); + DWORD lenW, lenA = SizeofResource( module, rsrc ); + + if (!str) return FALSE; + if (!info->registrar && !create_registrar( module, info )) return FALSE; + lenW = MultiByteToWideChar( CP_UTF8, 0, str, lenA, NULL, 0 ) + 1; + if (!(buffer = HeapAlloc( GetProcessHeap(), 0, lenW * sizeof(WCHAR) ))) + { + info->result = E_OUTOFMEMORY; + return FALSE; + } + MultiByteToWideChar( CP_UTF8, 0, str, lenA, buffer, lenW ); + buffer[lenW - 1] = 0; + + if (info->do_register) + info->result = IRegistrar_StringRegister( info->registrar, buffer ); + else + info->result = IRegistrar_StringUnregister( info->registrar, buffer ); + + HeapFree( GetProcessHeap(), 0, buffer ); + return SUCCEEDED(info->result); +} + +HRESULT __wine_register_resources( HMODULE module, const CLSID *clsid ) +{ + struct reg_info info; + + info.registrar = NULL; + info.clsid = clsid; + info.do_register = TRUE; + info.uninit = FALSE; + info.result = S_OK; + EnumResourceNamesW( module, regtypeW, register_resource, (LONG_PTR)&info ); + if (info.registrar) IRegistrar_Release( info.registrar ); + if (info.uninit) pCoUninitialize(); + return info.result; +} + +HRESULT __wine_unregister_resources( HMODULE module, const CLSID *clsid ) +{ + struct reg_info info; + + info.registrar = NULL; + info.clsid = clsid; + info.do_register = FALSE; + info.uninit = FALSE; + info.result = S_OK; + EnumResourceNamesW( module, regtypeW, register_resource, (LONG_PTR)&info ); + if (info.registrar) IRegistrar_Release( info.registrar ); + if (info.uninit) pCoUninitialize(); + return info.result; +} diff --git a/include/rpcproxy.h b/include/rpcproxy.h index 76a8812..fe7eb3e 100644 --- a/include/rpcproxy.h +++ b/include/rpcproxy.h @@ -203,6 +203,9 @@ RPCRTAPI HRESULT RPC_ENTRY RPCRTAPI HRESULT RPC_ENTRY NdrDllUnregisterProxy( HMODULE hDll, const ProxyFileInfo **pProxyFileList, const CLSID *pclsid ); +HRESULT __wine_register_resources( HMODULE module, const CLSID *clsid ) DECLSPEC_HIDDEN; +HRESULT __wine_unregister_resources( HMODULE module, const CLSID *clsid ) DECLSPEC_HIDDEN; + #define CSTDSTUBBUFFERRELEASE(pFactory) \ ULONG WINAPI CStdStubBuffer_Release(IRpcStubBuffer *This) \ { return NdrCStdStubBuffer_Release(This, (IPSFactoryBuffer *)pFactory); } @@ -285,6 +288,26 @@ ULONG WINAPI CStdStubBuffer2_Release(IRpcStubBuffer *This) \ # define DLLCANUNLOADNOW_ENTRY DllCanUnloadNow #endif +#ifdef WINE_REGISTER_DLL + +#define WINE_DO_REGISTER_DLL(pfl, clsid) \ + HRESULT hr = NdrDllRegisterProxy( hProxyDll, (pfl), (clsid) ); \ + if (SUCCEEDED(hr)) hr = __wine_register_resources( hProxyDll, clsid ); \ + return hr + +#define WINE_DO_UNREGISTER_DLL(pfl, clsid) \ + HRESULT hr = __wine_unregister_resources( hProxyDll, clsid ); \ + if (SUCCEEDED(hr)) hr = NdrDllUnregisterProxy( hProxyDll, (pfl), (clsid) ); \ + return hr + +#else + +#define WINE_DO_REGISTER_DLL(pfl, clsid) return NdrDllRegisterProxy( hProxyDll, (pfl), (clsid) ) +#define WINE_DO_UNREGISTER_DLL(pfl, clsid) return NdrDllUnregisterProxy( hProxyDll, (pfl), (clsid) ) + +#endif + + #define DLLDATA_GETPROXYDLLINFO(pfl, rclsid) \ void RPC_ENTRY GetProxyDllInfo(const ProxyFileInfo ***ppProxyFileInfo, \ const CLSID **ppClsid) DECLSPEC_HIDDEN; \ @@ -329,16 +352,16 @@ ULONG WINAPI CStdStubBuffer2_Release(IRpcStubBuffer *This) \ HRESULT WINAPI DLLREGISTERSERVER_ENTRY(void) DECLSPEC_HIDDEN; \ HRESULT WINAPI DLLREGISTERSERVER_ENTRY(void) \ { \ - return NdrDllRegisterProxy(hProxyDll, (pfl), (factory_clsid)); \ + WINE_DO_REGISTER_DLL( (pfl), (factory_clsid) ); \ } \ \ HRESULT WINAPI DLLUNREGISTERSERVER_ENTRY(void) DECLSPEC_HIDDEN; \ HRESULT WINAPI DLLUNREGISTERSERVER_ENTRY(void) \ { \ - return NdrDllUnregisterProxy(hProxyDll, (pfl), (factory_clsid)); \ + WINE_DO_UNREGISTER_DLL( (pfl), (factory_clsid) ); \ } -#ifdef REGISTER_PROXY_DLL +#if defined(REGISTER_PROXY_DLL) || defined(WINE_REGISTER_DLL) # define DLLREGISTRY_ROUTINES(pfl, factory_clsid) \ REGISTER_PROXY_DLL_ROUTINES(pfl, factory_clsid) #else diff --git a/tools/wine.inf.in b/tools/wine.inf.in index 52e7810..1ceb2e4 100644 --- a/tools/wine.inf.in +++ b/tools/wine.inf.in @@ -2484,12 +2484,12 @@ HKLM,%CurrentVersion%\Telephony\Country List\998,"SameAreaRule",,"G" [RegisterDllsSection] ;;some dlls have to be registered first 11,,ole32.dll,1 +11,,atl.dll,1 11,,oleaut32.dll,1 11,,shell32.dll,1 11,,actxprxy.dll,1 11,,amstream.dll,1 -11,,atl.dll,1 11,,avifil32.dll,1 11,,browseui.dll,1 11,,comctl32.dll,2
1
0
0
0
Damjan Jovanovic : atl: Add support for binary values in IRegistrar.
by Alexandre Julliard
24 Nov '10
24 Nov '10
Module: wine Branch: master Commit: cd4b9c11274640c3d7ee03ff9de9e4895669b884 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=cd4b9c11274640c3d7ee03ff9…
Author: Damjan Jovanovic <damjan.jov(a)gmail.com> Date: Wed Nov 24 11:10:13 2010 +0200 atl: Add support for binary values in IRegistrar. --- dlls/atl/registrar.c | 35 +++++++++++++++++++++++++++++++++++ dlls/atl/tests/registrar.c | 17 +++++++++++++++++ 2 files changed, 52 insertions(+), 0 deletions(-) diff --git a/dlls/atl/registrar.c b/dlls/atl/registrar.c index 9a1154a..99dfe73 100644 --- a/dlls/atl/registrar.c +++ b/dlls/atl/registrar.c @@ -299,6 +299,41 @@ static HRESULT do_process_key(LPCOLESTR *pstr, HKEY parent_key, strbuf *buf, BOO } break; } + case 'b': { + BYTE *bytes; + DWORD count; + DWORD i; + hres = get_word(&iter, buf); + if(FAILED(hres)) + break; + count = (lstrlenW(buf->str) + 1) / 2; + bytes = HeapAlloc(GetProcessHeap(), 0, count); + if(bytes == NULL) { + hres = E_OUTOFMEMORY; + break; + } + for(i = 0; i < count && buf->str[2*i]; i++) { + WCHAR digits[3]; + if(!isxdigitW(buf->str[2*i]) || !isxdigitW(buf->str[2*i + 1])) { + hres = E_FAIL; + break; + } + digits[0] = buf->str[2*i]; + digits[1] = buf->str[2*i + 1]; + digits[2] = 0; + bytes[i] = (BYTE) strtoulW(digits, NULL, 16); + } + if(SUCCEEDED(hres)) { + lres = RegSetValueExW(hkey, name.len ? name.str : NULL, 0, REG_BINARY, + bytes, count); + if(lres != ERROR_SUCCESS) { + WARN("Could not set value of key: 0x%08x\n", lres); + hres = HRESULT_FROM_WIN32(lres); + } + } + HeapFree(GetProcessHeap(), 0, bytes); + break; + } default: WARN("Wrong resource type: %s\n", debugstr_w(buf->str)); hres = DISP_E_EXCEPTION; diff --git a/dlls/atl/tests/registrar.c b/dlls/atl/tests/registrar.c index cd2b755..422608b 100644 --- a/dlls/atl/tests/registrar.c +++ b/dlls/atl/tests/registrar.c @@ -47,6 +47,8 @@ static const char textA[] = " val 'dword_unquoted_dec' = d 1 \n" " val 'dword_quoted_hex' = d '0xA' \n" " val 'dword_unquoted_hex' = d 0xA \n" +" val 'binary_quoted' = b 'deadbeef' \n" +" val 'binary_unquoted' = b deadbeef \n" " } \n" "}"; @@ -72,6 +74,7 @@ static void test_registrar(void) DWORD size; LONG lret; HKEY key; + BYTE bytes[4]; MultiByteToWideChar(CP_ACP, 0, textA, -1, textW, count); hr = IRegistrar_StringRegister(registrar, textW); @@ -100,6 +103,20 @@ static void test_registrar(void) ok(lret == ERROR_SUCCESS, "RegQueryValueExA failed, error %d\n", lret); ok(dword == 1, "quoted dec is not supposed to be %d\n", dword); + size = 4; + lret = RegQueryValueExA(key, "binary_quoted", NULL, NULL, bytes, &size); + ok(lret == ERROR_SUCCESS, "RegQueryValueA, failed, error %d\n", lret); + ok(bytes[0] = 0xde && bytes[1] == 0xad && bytes[2] == 0xbe && bytes[3] == 0xef, + "binary quoted value was not preserved (it's 0x%02X%02X%02X%02X)\n", + 0xff & bytes[0], 0xff & bytes[1], 0xff & bytes[2], 0xff & bytes[3]); + + size = 4; + lret = RegQueryValueExA(key, "binary_unquoted", NULL, NULL, bytes, &size); + ok(lret == ERROR_SUCCESS, "RegQueryValueA, failed, error %d\n", lret); + ok(bytes[0] = 0xde && bytes[1] == 0xad && bytes[2] == 0xbe && bytes[3] == 0xef, + "binary unquoted value was not preserved (it's 0x%02X%02X%02X%02X)\n", + 0xff & bytes[0], 0xff & bytes[1], 0xff & bytes[2], 0xff & bytes[3]); + hr = IRegistrar_StringUnregister(registrar, textW); ok(SUCCEEDED(hr), "IRegistar_StringUnregister failed, hr = 0x%08X\n", hr); RegCloseKey(key);
1
0
0
0
Damjan Jovanovic : atl: Improve IRegistrar dword parsing.
by Alexandre Julliard
24 Nov '10
24 Nov '10
Module: wine Branch: master Commit: d2a221d2b5d915c2925568f14a97c7566fbca013 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=d2a221d2b5d915c2925568f14…
Author: Damjan Jovanovic <damjan.jov(a)gmail.com> Date: Wed Nov 24 11:09:05 2010 +0200 atl: Improve IRegistrar dword parsing. --- dlls/atl/registrar.c | 12 ++--- dlls/atl/tests/Makefile.in | 3 +- dlls/atl/tests/registrar.c | 120 ++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 126 insertions(+), 9 deletions(-) diff --git a/dlls/atl/registrar.c b/dlls/atl/registrar.c index eb33b3b..9a1154a 100644 --- a/dlls/atl/registrar.c +++ b/dlls/atl/registrar.c @@ -285,15 +285,11 @@ static HRESULT do_process_key(LPCOLESTR *pstr, HKEY parent_key, strbuf *buf, BOO } break; case 'd': { - WCHAR *end; DWORD dw; - if(*iter == '0' && iter[1] == 'x') { - iter += 2; - dw = strtolW(iter, &end, 16); - }else { - dw = strtolW(iter, &end, 10); - } - iter = end; + hres = get_word(&iter, buf); + if(FAILED(hres)) + break; + dw = atoiW(buf->str); lres = RegSetValueExW(hkey, name.len ? name.str : NULL, 0, REG_DWORD, (PBYTE)&dw, sizeof(dw)); if(lres != ERROR_SUCCESS) { diff --git a/dlls/atl/tests/Makefile.in b/dlls/atl/tests/Makefile.in index 5cb209e..b397c85 100644 --- a/dlls/atl/tests/Makefile.in +++ b/dlls/atl/tests/Makefile.in @@ -3,6 +3,7 @@ IMPORTS = uuid atl oleaut32 ole32 rpcrt4 user32 gdi32 advapi32 C_SRCS = \ atl_ax.c \ - module.c + module.c \ + registrar.c @MAKE_TEST_RULES@ diff --git a/dlls/atl/tests/registrar.c b/dlls/atl/tests/registrar.c new file mode 100644 index 0000000..cd2b755 --- /dev/null +++ b/dlls/atl/tests/registrar.c @@ -0,0 +1,120 @@ +/* + * ATL test program + * + * Copyright 2010 Damjan Jovanovic + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include <stdarg.h> +#include <stdio.h> + +#define COBJMACROS + +#include <wine/test.h> +#include <windef.h> +#include <winbase.h> +#include <winuser.h> +#include <wingdi.h> +#include <winnls.h> +#include <winerror.h> +#include <winnt.h> +#include <wtypes.h> +#include <olectl.h> +#include <ocidl.h> +#include <initguid.h> +#include <atliface.h> + +static const char textA[] = +"HKCR \n" +"{ \n" +" ForceRemove eebf73c4-50fd-478f-bbcf-db212221227a \n" +" { \n" +" val 'string' = s 'string' \n" +" val 'dword_quoted_dec' = d '1' \n" +" val 'dword_unquoted_dec' = d 1 \n" +" val 'dword_quoted_hex' = d '0xA' \n" +" val 'dword_unquoted_hex' = d 0xA \n" +" } \n" +"}"; + +static void test_registrar(void) +{ + IRegistrar *registrar = NULL; + HRESULT hr; + INT count; + WCHAR *textW = NULL; + + hr = CoCreateInstance(&CLSID_Registrar, NULL, CLSCTX_INPROC_SERVER, &IID_IRegistrar, (void**)®istrar); + if (FAILED(hr)) + { + skip("creating IRegistrar failed, hr = 0x%08X\n", hr); + return; + } + + count = MultiByteToWideChar(CP_ACP, 0, textA, -1, NULL, 0); + textW = HeapAlloc(GetProcessHeap(), 0, count * sizeof(WCHAR)); + if (textW) + { + DWORD dword; + DWORD size; + LONG lret; + HKEY key; + + MultiByteToWideChar(CP_ACP, 0, textA, -1, textW, count); + hr = IRegistrar_StringRegister(registrar, textW); + ok(SUCCEEDED(hr), "IRegistar_StringRegister failed, hr = 0x%08X\n", hr); + + lret = RegOpenKeyA(HKEY_CLASSES_ROOT, "eebf73c4-50fd-478f-bbcf-db212221227a", &key); + ok(lret == ERROR_SUCCESS, "error %d opening registry key\n", lret); + + size = sizeof(dword); + lret = RegQueryValueExA(key, "dword_unquoted_hex", NULL, NULL, (BYTE*)&dword, &size); + ok(lret == ERROR_SUCCESS, "RegQueryValueExA failed, error %d\n", lret); + ok(dword != 0xA, "unquoted hex is not supposed to be preserved\n"); + + size = sizeof(dword); + lret = RegQueryValueExA(key, "dword_quoted_hex", NULL, NULL, (BYTE*)&dword, &size); + ok(lret == ERROR_SUCCESS, "RegQueryValueExA failed, error %d\n", lret); + ok(dword != 0xA, "quoted hex is not supposed to be preserved\n"); + + size = sizeof(dword); + lret = RegQueryValueExA(key, "dword_unquoted_dec", NULL, NULL, (BYTE*)&dword, &size); + ok(lret == ERROR_SUCCESS, "RegQueryValueExA failed, error %d\n", lret); + ok(dword == 1, "unquoted dec is not supposed to be %d\n", dword); + + size = sizeof(dword); + lret = RegQueryValueExA(key, "dword_quoted_dec", NULL, NULL, (BYTE*)&dword, &size); + ok(lret == ERROR_SUCCESS, "RegQueryValueExA failed, error %d\n", lret); + ok(dword == 1, "quoted dec is not supposed to be %d\n", dword); + + hr = IRegistrar_StringUnregister(registrar, textW); + ok(SUCCEEDED(hr), "IRegistar_StringUnregister failed, hr = 0x%08X\n", hr); + RegCloseKey(key); + } + else + skip("allocating memory failed\n"); + + IRegistrar_Release(registrar); +} + +START_TEST(registrar) +{ + CoInitialize(NULL); + + test_registrar(); + + CoUninitialize(); +}
1
0
0
0
Paul Vriens : advapi32/tests: Add a test for driver services.
by Alexandre Julliard
24 Nov '10
24 Nov '10
Module: wine Branch: master Commit: 10df397871b36d2913d5cb19d7813c4905bf2152 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=10df397871b36d2913d5cb19d…
Author: Paul Vriens <Paul.Vriens.Wine(a)gmail.com> Date: Wed Nov 24 10:00:24 2010 +0100 advapi32/tests: Add a test for driver services. --- dlls/advapi32/tests/service.c | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-) diff --git a/dlls/advapi32/tests/service.c b/dlls/advapi32/tests/service.c index 5a4fabd..48d9386 100644 --- a/dlls/advapi32/tests/service.c +++ b/dlls/advapi32/tests/service.c @@ -335,6 +335,13 @@ static void test_create_delete_svc(void) ok(!svc_handle1, "Expected failure\n"); ok(GetLastError() == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); + /* Test if ServiceType can be a combined one for drivers */ + SetLastError(0xdeadbeef); + svc_handle1 = CreateServiceA(scm_handle, servicename, NULL, 0, SERVICE_KERNEL_DRIVER | SERVICE_FILE_SYSTEM_DRIVER, + SERVICE_BOOT_START, 0, pathname, NULL, NULL, NULL, NULL, NULL); + ok(!svc_handle1, "Expected failure\n"); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); + /* The service already exists (check first, just in case) */ svc_handle1 = OpenServiceA(scm_handle, spooler, GENERIC_READ); if (svc_handle1)
1
0
0
0
Gerald Pfeifer : ntdll/tests: Remove unused variable from test_query_volume_information_file.
by Alexandre Julliard
24 Nov '10
24 Nov '10
Module: wine Branch: master Commit: 8c7164603f0df6d8b0d34be95bc19e7746049115 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=8c7164603f0df6d8b0d34be95…
Author: Gerald Pfeifer <gerald(a)pfeifer.com> Date: Wed Nov 24 00:43:24 2010 +0100 ntdll/tests: Remove unused variable from test_query_volume_information_file. --- dlls/ntdll/tests/file.c | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/dlls/ntdll/tests/file.c b/dlls/ntdll/tests/file.c index 1b73dd9..285d9c5 100644 --- a/dlls/ntdll/tests/file.c +++ b/dlls/ntdll/tests/file.c @@ -1468,11 +1468,10 @@ static void test_query_volume_information_file(void) OBJECT_ATTRIBUTES attr; IO_STATUS_BLOCK io; UNICODE_STRING nameW; - UINT len; FILE_FS_VOLUME_INFORMATION *ffvi; BYTE buf[sizeof(FILE_FS_VOLUME_INFORMATION) + MAX_PATH * sizeof(WCHAR)]; - len = GetWindowsDirectoryW( path, MAX_PATH ); + GetWindowsDirectoryW( path, MAX_PATH ); pRtlDosPathNameToNtPathName_U( path, &nameW, NULL, NULL ); attr.Length = sizeof(attr); attr.RootDirectory = 0;
1
0
0
0
Alexander Morozov : crypt32/tests: Use pCryptAcquireContextA.
by Alexandre Julliard
24 Nov '10
24 Nov '10
Module: wine Branch: master Commit: d8cad3eb1be43c44b5d40dbe92559f4f6c746689 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=d8cad3eb1be43c44b5d40dbe9…
Author: Alexander Morozov <amorozov(a)etersoft.ru> Date: Tue Nov 23 13:50:22 2010 +0300 crypt32/tests: Use pCryptAcquireContextA. --- dlls/crypt32/tests/message.c | 23 +++++++++++++++++++++-- dlls/crypt32/tests/msg.c | 2 +- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/dlls/crypt32/tests/message.c b/dlls/crypt32/tests/message.c index b7114b7..392ec47 100644 --- a/dlls/crypt32/tests/message.c +++ b/dlls/crypt32/tests/message.c @@ -27,6 +27,23 @@ #include "wine/test.h" +static BOOL (WINAPI * pCryptAcquireContextA) + (HCRYPTPROV *, LPCSTR, LPCSTR, DWORD, DWORD); + +static void init_function_pointers(void) +{ + HMODULE hAdvapi32 = GetModuleHandleA("advapi32.dll"); + +#define GET_PROC(dll, func) \ + p ## func = (void *)GetProcAddress(dll, #func); \ + if(!p ## func) \ + trace("GetProcAddress(%s) failed\n", #func); + + GET_PROC(hAdvapi32, CryptAcquireContextA) + +#undef GET_PROC +} + static const BYTE dataEmptyBareContent[] = { 0x04,0x00 }; static const BYTE dataEmptyContent[] = { 0x30,0x0f,0x06,0x09,0x2a,0x86,0x48,0x86,0xf7,0x0d,0x01,0x07,0x01,0xa0,0x02, @@ -1001,7 +1018,7 @@ static void test_sign_message(void) ok(signedBlobSize, "bad size\n"); SetLastError(0xdeadbeef); - ret = CryptAcquireContextA(&hCryptProv, NULL, NULL, PROV_RSA_FULL, + ret = pCryptAcquireContextA(&hCryptProv, NULL, NULL, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT); ok(ret, "CryptAcquireContextA failed: %08x\n", GetLastError()); SetLastError(0xdeadbeef); @@ -1188,7 +1205,7 @@ static void test_encrypt_message(void) DWORD encryptedBlobSize; SetLastError(0xdeadbeef); - ret = CryptAcquireContextA(&hCryptProv, NULL, NULL, PROV_RSA_FULL, + ret = pCryptAcquireContextA(&hCryptProv, NULL, NULL, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT); ok(ret, "CryptAcquireContextA failed: %08x\n", GetLastError()); @@ -1343,6 +1360,8 @@ static void test_encrypt_message(void) START_TEST(message) { + init_function_pointers(); + test_msg_get_signer_count(); test_verify_detached_message_hash(); test_verify_message_hash(); diff --git a/dlls/crypt32/tests/msg.c b/dlls/crypt32/tests/msg.c index 90dd783..898b10c 100644 --- a/dlls/crypt32/tests/msg.c +++ b/dlls/crypt32/tests/msg.c @@ -3100,7 +3100,7 @@ static void test_decode_msg_get_param(void) check_param("enveloped empty content", msg, CMSG_CONTENT_PARAM, NULL, 0); CryptMsgClose(msg); - CryptAcquireContextA(&hCryptProv, NULL, MS_ENHANCED_PROV_A, PROV_RSA_FULL, + pCryptAcquireContextA(&hCryptProv, NULL, MS_ENHANCED_PROV_A, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT); SetLastError(0xdeadbeef); ret = CryptImportKey(hCryptProv, publicPrivateKeyPair,
1
0
0
0
Michael Stefaniuc : msvcrt: Add missing dereference of the time pointer.
by Alexandre Julliard
24 Nov '10
24 Nov '10
Module: wine Branch: master Commit: 33c528188de8b229bccfcf945f2e1d9daf153842 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=33c528188de8b229bccfcf945…
Author: Michael Stefaniuc <mstefani(a)redhat.de> Date: Wed Nov 24 00:37:32 2010 +0100 msvcrt: Add missing dereference of the time pointer. --- dlls/msvcrt/time.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dlls/msvcrt/time.c b/dlls/msvcrt/time.c index 7ccdc7d..4150156 100644 --- a/dlls/msvcrt/time.c +++ b/dlls/msvcrt/time.c @@ -913,7 +913,7 @@ int CDECL MSVCRT__ctime64_s(char *res, MSVCRT_size_t len, const MSVCRT___time64_ return MSVCRT_EINVAL; } res[0] = '\0'; - if( !MSVCRT_CHECK_PMT( time != NULL ) || !MSVCRT_CHECK_PMT( time > 0 ) ) + if( !MSVCRT_CHECK_PMT( time != NULL ) || !MSVCRT_CHECK_PMT( *time > 0 ) ) { *MSVCRT__errno() = MSVCRT_EINVAL; return MSVCRT_EINVAL; @@ -946,7 +946,7 @@ int CDECL MSVCRT__ctime32_s(char *res, MSVCRT_size_t len, const MSVCRT___time32_ return MSVCRT_EINVAL; } res[0] = '\0'; - if( !MSVCRT_CHECK_PMT( time != NULL ) || !MSVCRT_CHECK_PMT( time > 0 ) ) + if( !MSVCRT_CHECK_PMT( time != NULL ) || !MSVCRT_CHECK_PMT( *time > 0 ) ) { *MSVCRT__errno() = MSVCRT_EINVAL; return MSVCRT_EINVAL;
1
0
0
0
Alexander Morozov : crypt32/tests: Fix test failures on WinME and some NT4.
by Alexandre Julliard
24 Nov '10
24 Nov '10
Module: wine Branch: master Commit: 676d5db65a54e7dc661f3634ea96943943d11bb7 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=676d5db65a54e7dc661f3634e…
Author: Alexander Morozov <amorozov(a)etersoft.ru> Date: Tue Nov 23 13:42:10 2010 +0300 crypt32/tests: Fix test failures on WinME and some NT4. --- dlls/crypt32/tests/msg.c | 75 ++++++++++++++++++++++++++++----------------- 1 files changed, 47 insertions(+), 28 deletions(-) diff --git a/dlls/crypt32/tests/msg.c b/dlls/crypt32/tests/msg.c index d560c30..90dd783 100644 --- a/dlls/crypt32/tests/msg.c +++ b/dlls/crypt32/tests/msg.c @@ -2159,7 +2159,9 @@ static void test_enveloped_msg_update(void) SetLastError(0xdeadbeef); ret = CryptMsgUpdate(msg, msgData, sizeof(msgData), TRUE); todo_wine - ok(ret, "CryptMsgUpdate failed: %08x\n", GetLastError()); + ok(ret || + broken(!ret && GetLastError() == NTE_PERM), /* some NT4 */ + "CryptMsgUpdate failed: %08x\n", GetLastError()); SetLastError(0xdeadbeef); ret = CryptMsgUpdate(msg, NULL, 0, TRUE); todo_wine @@ -2204,7 +2206,9 @@ static void test_enveloped_msg_update(void) SetLastError(0xdeadbeef); ret = CryptMsgUpdate(msg, msgData, sizeof(msgData), TRUE); todo_wine - ok(ret, "CryptMsgUpdate failed: %08x\n", GetLastError()); + ok(ret || + broken(!ret && GetLastError() == NTE_PERM), /* some NT4 */ + "CryptMsgUpdate failed: %08x\n", GetLastError()); CryptMsgClose(msg); } SetLastError(0xdeadbeef); @@ -2242,7 +2246,9 @@ static void test_enveloped_msg_update(void) SetLastError(0xdeadbeef); ret = CryptMsgUpdate(msg, msgData, sizeof(msgData), TRUE); todo_wine - ok(ret, "CryptMsgUpdate failed: %08x\n", GetLastError()); + ok(ret || + broken(!ret && GetLastError() == NTE_PERM), /* some NT4 */ + "CryptMsgUpdate failed: %08x\n", GetLastError()); CryptMsgClose(msg); } } @@ -2863,7 +2869,7 @@ static void test_decode_msg_get_param(void) { HCRYPTMSG msg; HCRYPTPROV hCryptProv; - HCRYPTKEY key; + HCRYPTKEY key = 0; BOOL ret; DWORD size = 0, value; LPBYTE buf; @@ -3099,27 +3105,34 @@ static void test_decode_msg_get_param(void) SetLastError(0xdeadbeef); ret = CryptImportKey(hCryptProv, publicPrivateKeyPair, sizeof(publicPrivateKeyPair), 0, 0, &key); - ok(ret, "CryptImportKey failed: %08x\n", GetLastError()); + ok(ret || + broken(!ret && GetLastError() == NTE_PERM), /* WinME and some NT4 */ + "CryptImportKey failed: %08x\n", GetLastError()); msg = CryptMsgOpenToDecode(PKCS_7_ASN_ENCODING, 0, 0, 0, NULL, NULL); CryptMsgUpdate(msg, envelopedMessage, sizeof(envelopedMessage), TRUE); todo_wine check_param("enveloped message before decrypting", msg, CMSG_CONTENT_PARAM, envelopedMessage + sizeof(envelopedMessage) - 4, 4); - decryptPara.hCryptProv = hCryptProv; - SetLastError(0xdeadbeef); - ret = CryptMsgControl(msg, 0, CMSG_CTRL_DECRYPT, &decryptPara); - todo_wine - ok(ret, "CryptMsgControl failed: %08x\n", GetLastError()); - decryptPara.hCryptProv = 0; - SetLastError(0xdeadbeef); - ret = CryptMsgControl(msg, 0, CMSG_CTRL_DECRYPT, &decryptPara); - todo_wine - ok(!ret && GetLastError() == CRYPT_E_ALREADY_DECRYPTED, - "expected CRYPT_E_ALREADY_DECRYPTED, got %08x\n", GetLastError()); - todo_wine - check_param("enveloped message", msg, CMSG_CONTENT_PARAM, msgData, - sizeof(msgData)); + if (key) + { + decryptPara.hCryptProv = hCryptProv; + SetLastError(0xdeadbeef); + ret = CryptMsgControl(msg, 0, CMSG_CTRL_DECRYPT, &decryptPara); + todo_wine + ok(ret, "CryptMsgControl failed: %08x\n", GetLastError()); + decryptPara.hCryptProv = 0; + SetLastError(0xdeadbeef); + ret = CryptMsgControl(msg, 0, CMSG_CTRL_DECRYPT, &decryptPara); + todo_wine + ok(!ret && GetLastError() == CRYPT_E_ALREADY_DECRYPTED, + "expected CRYPT_E_ALREADY_DECRYPTED, got %08x\n", GetLastError()); + todo_wine + check_param("enveloped message", msg, CMSG_CONTENT_PARAM, msgData, + sizeof(msgData)); + } + else + win_skip("failed to import a key, skipping tests\n"); CryptMsgClose(msg); msg = CryptMsgOpenToDecode(PKCS_7_ASN_ENCODING, 0, CMSG_ENVELOPED, 0, NULL, @@ -3130,17 +3143,23 @@ static void test_decode_msg_get_param(void) check_param("enveloped bare message before decrypting", msg, CMSG_CONTENT_PARAM, envelopedBareMessage + sizeof(envelopedBareMessage) - 4, 4); - decryptPara.hCryptProv = hCryptProv; - SetLastError(0xdeadbeef); - ret = CryptMsgControl(msg, 0, CMSG_CTRL_DECRYPT, &decryptPara); - todo_wine - ok(ret, "CryptMsgControl failed: %08x\n", GetLastError()); - todo_wine - check_param("enveloped bare message", msg, CMSG_CONTENT_PARAM, msgData, - sizeof(msgData)); + if (key) + { + decryptPara.hCryptProv = hCryptProv; + SetLastError(0xdeadbeef); + ret = CryptMsgControl(msg, 0, CMSG_CTRL_DECRYPT, &decryptPara); + todo_wine + ok(ret, "CryptMsgControl failed: %08x\n", GetLastError()); + todo_wine + check_param("enveloped bare message", msg, CMSG_CONTENT_PARAM, msgData, + sizeof(msgData)); + } + else + win_skip("failed to import a key, skipping tests\n"); CryptMsgClose(msg); - CryptDestroyKey(key); + if (key) + CryptDestroyKey(key); CryptReleaseContext(hCryptProv, 0); msg = CryptMsgOpenToDecode(PKCS_7_ASN_ENCODING, 0, 0, 0, NULL, NULL);
1
0
0
0
Alexander Morozov : crypt32/tests: Do not crash on some Win98.
by Alexandre Julliard
24 Nov '10
24 Nov '10
Module: wine Branch: master Commit: 113c6145253530e64f7592bdef510fe46c64ca0d URL:
http://source.winehq.org/git/wine.git/?a=commit;h=113c6145253530e64f7592bde…
Author: Alexander Morozov <amorozov(a)etersoft.ru> Date: Tue Nov 23 13:02:22 2010 +0300 crypt32/tests: Do not crash on some Win98. --- dlls/crypt32/tests/msg.c | 21 ++++++++++++--------- 1 files changed, 12 insertions(+), 9 deletions(-) diff --git a/dlls/crypt32/tests/msg.c b/dlls/crypt32/tests/msg.c index 63149e7..d560c30 100644 --- a/dlls/crypt32/tests/msg.c +++ b/dlls/crypt32/tests/msg.c @@ -2081,15 +2081,18 @@ static void test_enveloped_msg_open(void) SetLastError(0xdeadbeef); context = CertCreateCertificateContext(X509_ASN_ENCODING, v1CertWithValidPubKey, sizeof(v1CertWithValidPubKey)); - ok(context != NULL, "CertCreateCertificateContext failed: %08x\n", - GetLastError()); - envelopedInfo.rgpRecipientCert = (PCERT_INFO *)&context->pCertInfo; - SetLastError(0xdeadbeef); - msg = CryptMsgOpenToEncode(PKCS_7_ASN_ENCODING, 0, CMSG_ENVELOPED, - &envelopedInfo, NULL, NULL); - todo_wine - ok(msg != NULL, "CryptMsgOpenToEncode failed: %08x\n", GetLastError()); - CryptMsgClose(msg); + if (context) + { + envelopedInfo.rgpRecipientCert = (PCERT_INFO *)&context->pCertInfo; + SetLastError(0xdeadbeef); + msg = CryptMsgOpenToEncode(PKCS_7_ASN_ENCODING, 0, CMSG_ENVELOPED, + &envelopedInfo, NULL, NULL); + todo_wine + ok(msg != NULL, "CryptMsgOpenToEncode failed: %08x\n", GetLastError()); + CryptMsgClose(msg); + } + else + win_skip("failed to create certificate context, skipping a test\n"); SetLastError(0xdeadbeef); ret = pCryptAcquireContextA(&envelopedInfo.hCryptProv, NULL, NULL,
1
0
0
0
← Newer
1
...
14
15
16
17
18
19
20
...
87
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
85
86
87
Results per page:
10
25
50
100
200