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
July
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
January 2006
----- 2025 -----
July 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
4 participants
617 discussions
Start a n
N
ew thread
Jacek Caban : shdocvw: Deactivate document in SetClientSite if ClientSite is NULL.
by Alexandre Julliard
18 Jan '06
18 Jan '06
Module: wine Branch: refs/heads/master Commit: 47f796c6293c8a174006b2ab6de1316c407ab29e URL:
http://source.winehq.org/git/?p=wine.git;a=commit;h=47f796c6293c8a174006b2a…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Wed Jan 18 13:22:52 2006 +0100 shdocvw: Deactivate document in SetClientSite if ClientSite is NULL. Fix ref counting. --- dlls/shdocvw/client.c | 1 + dlls/shdocvw/dochost.c | 52 ++++++++++++++++++++++++++++++++++++++++++++++ dlls/shdocvw/events.c | 1 + dlls/shdocvw/oleobject.c | 16 +++++++++++--- dlls/shdocvw/shdocvw.h | 1 + 5 files changed, 67 insertions(+), 4 deletions(-) diff --git a/dlls/shdocvw/client.c b/dlls/shdocvw/client.c index 170a9a9..842c184 100644 --- a/dlls/shdocvw/client.c +++ b/dlls/shdocvw/client.c @@ -204,6 +204,7 @@ static HRESULT WINAPI InPlaceSite_GetWin TRACE("(%p)->(%p %p %p %p %p)\n", This, ppFrame, ppDoc, lprcPosRect, lprcClipRect, lpFrameInfo); + IOleInPlaceFrame_AddRef(INPLACEFRAME(This)); *ppFrame = INPLACEFRAME(This); *ppDoc = NULL; diff --git a/dlls/shdocvw/dochost.c b/dlls/shdocvw/dochost.c index d5dc95c..57b8660 100644 --- a/dlls/shdocvw/dochost.c +++ b/dlls/shdocvw/dochost.c @@ -154,6 +154,58 @@ void create_doc_view_hwnd(WebBrowser *Th NULL, shdocvw_hinstance, This); } +void deactivate_document(WebBrowser *This) +{ + IOleInPlaceObjectWindowless *winobj; + IOleObject *oleobj = NULL; + IHlinkTarget *hlink = NULL; + HRESULT hres; + + if(This->view) + IOleDocumentView_UIActivate(This->view, FALSE); + + hres = IUnknown_QueryInterface(This->client, &IID_IOleInPlaceObjectWindowless, + (void**)&winobj); + if(SUCCEEDED(hres)) { + IOleInPlaceObjectWindowless_InPlaceDeactivate(winobj); + IOleInPlaceObjectWindowless_Release(winobj); + } + + if(This->view) { + IOleDocumentView_Show(This->view, FALSE); + IOleDocumentView_CloseView(This->view, 0); + IOleDocumentView_SetInPlaceSite(This->view, NULL); + IOleDocumentView_Release(This->view); + This->view = NULL; + } + + hres = IUnknown_QueryInterface(This->document, &IID_IOleObject, (void**)&oleobj); + if(SUCCEEDED(hres)) + IOleObject_Close(oleobj, OLECLOSE_NOSAVE); + + hres = IUnknown_QueryInterface(This->document, &IID_IHlinkTarget, (void**)&hlink); + if(SUCCEEDED(hres)) { + IHlinkTarget_SetBrowseContext(hlink, NULL); + IHlinkTarget_Release(hlink); + } + + if(oleobj) { + IOleClientSite *client_site = NULL; + + IOleObject_GetClientSite(oleobj, &client_site); + if(client_site) { + if(client_site == CLIENTSITE(This)) + IOleObject_SetClientSite(oleobj, NULL); + IOleClientSite_Release(client_site); + } + + IOleObject_Release(oleobj); + } + + IUnknown_Release(This->document); + This->document = NULL; +} + #define DOCHOSTUI_THIS(iface) DEFINE_THIS(WebBrowser, DocHostUIHandler, iface) static HRESULT WINAPI DocHostUIHandler_QueryInterface(IDocHostUIHandler2 *iface, diff --git a/dlls/shdocvw/events.c b/dlls/shdocvw/events.c index 5733447..b7f93b7 100644 --- a/dlls/shdocvw/events.c +++ b/dlls/shdocvw/events.c @@ -177,6 +177,7 @@ static HRESULT WINAPI ConnectionPoint_Ge TRACE("(%p)->(%p)\n", This, ppCPC); *ppCPC = CONPTCONT(This->webbrowser); + IConnectionPointContainer_AddRef(CONPTCONT(This->webbrowser)); return S_OK; } diff --git a/dlls/shdocvw/oleobject.c b/dlls/shdocvw/oleobject.c index a20678a..58eb6ef 100644 --- a/dlls/shdocvw/oleobject.c +++ b/dlls/shdocvw/oleobject.c @@ -130,18 +130,26 @@ static HRESULT WINAPI OleObject_SetClien if(This->client == pClientSite) return S_OK; - if(This->doc_view_hwnd) + if(This->doc_view_hwnd) { DestroyWindow(This->doc_view_hwnd); - if(This->shell_embedding_hwnd) + This->doc_view_hwnd = NULL; + } + if(This->shell_embedding_hwnd) { DestroyWindow(This->shell_embedding_hwnd); + This->shell_embedding_hwnd = NULL; + } if(This->client) IOleClientSite_Release(This->client); - This->client = pClientSite; - if(!pClientSite) + if(!pClientSite) { + if(This->document) + deactivate_document(This); + This->client = NULL; return S_OK; + } + This->client = pClientSite; IOleClientSite_AddRef(pClientSite); create_shell_embedding_hwnd(This); diff --git a/dlls/shdocvw/shdocvw.h b/dlls/shdocvw/shdocvw.h index 735c1c4..49508b8 100644 --- a/dlls/shdocvw/shdocvw.h +++ b/dlls/shdocvw/shdocvw.h @@ -158,6 +158,7 @@ void WebBrowser_ClientSite_Destroy(WebBr HRESULT WebBrowser_Create(IUnknown*,REFIID,void**); void create_doc_view_hwnd(WebBrowser *This); +void deactivate_document(WebBrowser*); void call_sink(ConnectionPoint*,DISPID,DISPPARAMS*); #define WB_WM_NAVIGATE2 (WM_USER+100)
1
0
0
0
Detlef Riekenberg : winspool: Printing environment support for GetPrinterDriverDirectory.
by Alexandre Julliard
18 Jan '06
18 Jan '06
Module: wine Branch: refs/heads/master Commit: 23ead2b174129297f4b4e5e9738fc9b3fac603cc URL:
http://source.winehq.org/git/?p=wine.git;a=commit;h=23ead2b174129297f4b4e5e…
Author: Detlef Riekenberg <wine.dev(a)web.de> Date: Wed Jan 18 12:26:32 2006 +0100 winspool: Printing environment support for GetPrinterDriverDirectory. --- dlls/winspool/info.c | 127 +++++++++++++++++++++++++++++++++++++------- dlls/winspool/tests/info.c | 11 +--- 2 files changed, 111 insertions(+), 27 deletions(-) diff --git a/dlls/winspool/info.c b/dlls/winspool/info.c index 9b1771d..d0f51aa 100644 --- a/dlls/winspool/info.c +++ b/dlls/winspool/info.c @@ -96,6 +96,14 @@ typedef struct { WCHAR *document_title; } job_t; + +typedef struct { + LPCWSTR envname; + LPCWSTR subdir; +} printenv_t; + +/* ############################### */ + static opened_printer_t **printer_handles; static int nb_printer_handles; static LONG next_job_id = 1; @@ -131,6 +139,12 @@ static const WCHAR user_printers_reg_key 'D','e','v','i','c','e','s',0}; static const WCHAR DefaultEnvironmentW[] = {'W','i','n','e',0}; +static const WCHAR envname_win40W[] = {'W','i','n','d','o','w','s',' ','4','.','0',0}; +static const WCHAR envname_x86W[] = {'W','i','n','d','o','w','s',' ','N','T',' ','x','8','6',0}; +static const WCHAR subdir_win40W[] = {'w','i','n','4','0',0}; +static const WCHAR subdir_x86W[] = {'w','3','2','x','8','6',0}; + +static const WCHAR spooldriversW[] = {'\\','s','p','o','o','l','\\','d','r','i','v','e','r','s','\\',0}; static const WCHAR Configuration_FileW[] = {'C','o','n','f','i','g','u','r','a','t', 'i','o','n',' ','F','i','l','e',0}; @@ -179,6 +193,58 @@ static BOOL WINSPOOL_GetPrinterDriver(HA BOOL unicode); static DWORD WINSPOOL_GetOpenedPrinterRegKey(HANDLE hPrinter, HKEY *phkey); +/****************************************************************** + * validate the user-supplied printing-environment [internal] + * + * PARAMS + * env [I] PTR to Environment-String or NULL + * + * RETURNS + * Failure: NULL + * Success: PTR to printenv_t + * + * NOTES + * SetLastEror(ERROR_INVALID_ENVIRONMENT) is called on Failure + * + */ + +static const printenv_t * validate_envW(LPCWSTR env) +{ + static const printenv_t env_x86 = {envname_x86W, subdir_x86W}; + static const printenv_t env_win40 = {envname_win40W, subdir_win40W}; + static const printenv_t * const all_printenv[]={&env_x86, &env_win40}; + + const printenv_t *result = NULL; + unsigned int i; + + TRACE("testing %s\n", debugstr_w(env)); + if (env) + { + for (i = 0; i < sizeof(all_printenv)/sizeof(all_printenv[0]); i++) + { + if (lstrcmpiW(env, all_printenv[i]->envname) == 0) + { + result = all_printenv[i]; + break; + } + } + + if (result == NULL) { + FIXME("unsupported Environment: %s\n", debugstr_w(env)); + SetLastError(ERROR_INVALID_ENVIRONMENT); + } + /* on win9x, only "Windows 4.0" is allowed, but we ignore this */ + } + else + { + result = (GetVersion() & 0x80000000) ? &env_win40 : &env_x86; + } + TRACE("using %p: %s\n", result, debugstr_w(result ? result->envname : NULL)); + + return result; +} + + /* RtlCreateUnicodeStringFromAsciiz will return an empty string in the buffer if passed a NULL string. This returns NULLs to the result. */ @@ -3343,37 +3409,55 @@ BOOL WINAPI GetPrinterDriverDirectoryW(L DWORD cbBuf, LPDWORD pcbNeeded) { DWORD needed; + const printenv_t * env; TRACE("(%s, %s, %ld, %p, %ld, %p)\n", debugstr_w(pName), debugstr_w(pEnvironment), Level, pDriverDirectory, cbBuf, pcbNeeded); if(pName != NULL) { - FIXME("pName = `%s' - unsupported\n", debugstr_w(pName)); - SetLastError(ERROR_INVALID_PARAMETER); - return FALSE; + FIXME("pName unsupported: %s\n", debugstr_w(pName)); + SetLastError(ERROR_INVALID_PARAMETER); + return FALSE; } - if(pEnvironment != NULL) { - FIXME("pEnvironment = `%s' - unsupported\n", debugstr_w(pEnvironment)); - SetLastError(ERROR_INVALID_ENVIRONMENT); - return FALSE; + + env = validate_envW(pEnvironment); + if(!env) return FALSE; /* pEnvironment invalid or unsupported */ + + if(Level != 1) { + WARN("(Level: %ld) is ignored in win9x\n", Level); + SetLastError(ERROR_INVALID_LEVEL); + return FALSE; } - if(Level != 1) /* win95 ignores this so we just carry on */ - WARN("Level = %ld - assuming 1\n", Level); - /* FIXME should read from registry */ - needed = GetSystemDirectoryW( (LPWSTR)pDriverDirectory, cbBuf/sizeof(WCHAR)); - /* GetSystemDirectoryW returns number of TCHAR without '\0' - * adjust this now - */ - needed++; - needed*=sizeof(WCHAR); + /* GetSystemDirectoryW returns number of WCHAR including the '\0' */ + needed = GetSystemDirectoryW(NULL, 0); + /* add the Size for the Subdirectories */ + needed += lstrlenW(spooldriversW); + needed += lstrlenW(env->subdir); + needed *= sizeof(WCHAR); /* return-value is size in Bytes */ if(pcbNeeded) *pcbNeeded = needed; - TRACE("required <%08lx>\n", *pcbNeeded); + TRACE("required: 0x%lx/%ld\n", needed, needed); if(needed > cbBuf) { SetLastError(ERROR_INSUFFICIENT_BUFFER); - return FALSE; + return FALSE; + } + if(pcbNeeded == NULL) { + WARN("(pcbNeeded == NULL) is ignored in win9x\n"); + SetLastError(RPC_X_NULL_REF_POINTER); + return FALSE; } + if(pDriverDirectory == NULL) { + /* ERROR_INVALID_USER_BUFFER is NT, ERROR_INVALID_PARAMETER is win9x */ + SetLastError(ERROR_INVALID_USER_BUFFER); + return FALSE; + } + + GetSystemDirectoryW((LPWSTR) pDriverDirectory, cbBuf/sizeof(WCHAR)); + /* add the Subdirectories */ + lstrcatW((LPWSTR) pDriverDirectory, spooldriversW); + lstrcatW((LPWSTR) pDriverDirectory, env->subdir); + TRACE(" => %s\n", debugstr_w((LPWSTR) pDriverDirectory)); return TRUE; } @@ -3399,6 +3483,9 @@ BOOL WINAPI GetPrinterDriverDirectoryA(L INT len = cbBuf * sizeof(WCHAR)/sizeof(CHAR); WCHAR *driverDirectoryW = NULL; + TRACE("(%s, %s, %ld, %p, %ld, %p)\n", debugstr_a(pName), + debugstr_a(pEnvironment), Level, pDriverDirectory, cbBuf, pcbNeeded); + if (len) driverDirectoryW = HeapAlloc( GetProcessHeap(), 0, len ); if(pName) RtlCreateUnicodeStringFromAsciiz(&nameW, pName); @@ -3410,7 +3497,7 @@ BOOL WINAPI GetPrinterDriverDirectoryA(L (LPBYTE)driverDirectoryW, len, &pcbNeededW ); if (ret) { DWORD needed; - needed = 1 + WideCharToMultiByte( CP_ACP, 0, driverDirectoryW, -1, + needed = WideCharToMultiByte( CP_ACP, 0, driverDirectoryW, -1, (LPSTR)pDriverDirectory, cbBuf, NULL, NULL); if(pcbNeeded) *pcbNeeded = needed; @@ -3418,7 +3505,7 @@ BOOL WINAPI GetPrinterDriverDirectoryA(L } else if(pcbNeeded) *pcbNeeded = pcbNeededW * sizeof(CHAR)/sizeof(WCHAR); - TRACE("provided<%ld> required <%ld>\n", cbBuf, *pcbNeeded); + TRACE("required: 0x%lx/%ld\n", pcbNeeded ? *pcbNeeded : 0, pcbNeeded ? *pcbNeeded : 0); HeapFree( GetProcessHeap(), 0, driverDirectoryW ); RtlFreeUnicodeString(&environmentW); diff --git a/dlls/winspool/tests/info.c b/dlls/winspool/tests/info.c index 2218ef4..4b11829 100644 --- a/dlls/winspool/tests/info.c +++ b/dlls/winspool/tests/info.c @@ -213,12 +213,11 @@ static void test_printer_directory(void) ok( !res , "expected result == 0, got %d\n", res); ok( cbBuf == pcbNeeded, "pcbNeeded set to %ld instead of %ld\n", pcbNeeded, cbBuf); - todo_wine { + ok( ERROR_INSUFFICIENT_BUFFER == GetLastError(), "last error set to %ld instead of ERROR_INSUFFICIENT_BUFFER\n", GetLastError()); - } - + SetLastError(0x00dead00); res = GetPrinterDriverDirectoryA( NULL, NULL, 1, NULL, cbBuf, &pcbNeeded); ok( (!res && ERROR_INVALID_USER_BUFFER == GetLastError()) || @@ -278,12 +277,10 @@ static void test_printer_directory(void) res = GetPrinterDriverDirectoryA(NULL, env_win9x_case, 1, buffer, cbBuf*2, &pcbNeeded); } - - todo_wine{ + ok(res && buffer[0], "returned %d with " \ - "lasterror=%ld and len=%d (expected '0' with 'len > 0')\n", + "lasterror=%ld and len=%d (expected '1' with 'len > 0')\n", res, GetLastError(), lstrlenA((char *)buffer)); - } buffer[0] = '\0'; SetLastError(0x00dead00);
1
0
0
0
Alex Villacís Lasso : msacm: acmDriverAdd() support for ACM_DRIVERADDF_FUNCTION, implemented
by Alexandre Julliard
18 Jan '06
18 Jan '06
Module: wine Branch: refs/heads/master Commit: 6c3707661bedc6bc4df8bcc826401157e235d9c1 URL:
http://source.winehq.org/git/?p=wine.git;a=commit;h=6c3707661bedc6bc4df8bcc…
Author: Alex Villacís Lasso <a_villacis(a)palosanto.com> Date: Wed Jan 18 12:16:57 2006 +0100 msacm: acmDriverAdd() support for ACM_DRIVERADDF_FUNCTION, implemented local drivers. --- dlls/msacm/driver.c | 49 +++++++- dlls/msacm/internal.c | 298 +++++++++++++++++++++++++++++++++++++++++++++++-- dlls/msacm/wineacm.h | 34 +++++- 3 files changed, 359 insertions(+), 22 deletions(-)
1
0
0
0
Alex Villacís Lasso : msacm: reroute all SendDriverMessage() calls to MSACM_Message.
by Alexandre Julliard
18 Jan '06
18 Jan '06
Module: wine Branch: refs/heads/master Commit: 07dc3c54037af005f9b2711b91080ae7bacc1830 URL:
http://source.winehq.org/git/?p=wine.git;a=commit;h=07dc3c54037af005f9b2711…
Author: Alex Villacís Lasso <a_villacis(a)palosanto.com> Date: Wed Jan 18 12:13:51 2006 +0100 msacm: reroute all SendDriverMessage() calls to MSACM_Message. --- dlls/msacm/driver.c | 2 +- dlls/msacm/stream.c | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/dlls/msacm/driver.c b/dlls/msacm/driver.c index 633c8bd..5cb56c5 100644 --- a/dlls/msacm/driver.c +++ b/dlls/msacm/driver.c @@ -447,7 +447,7 @@ LRESULT WINAPI acmDriverMessage(HACMDRIV if (padid) { /* Handle is really an HACMDRIVERID, must have an open session to get an HACMDRIVER */ if (padid->pACMDriverList != NULL) { - lResult = SendDriverMessage(padid->pACMDriverList->hDrvr, uMsg, lParam1, lParam2); + lResult = MSACM_Message((HACMDRIVER)padid->pACMDriverList, uMsg, lParam1, lParam2); } else { MMRESULT mmr = acmDriverOpen(&had, (HACMDRIVERID)padid, 0); if (mmr != MMSYSERR_NOERROR) { diff --git a/dlls/msacm/stream.c b/dlls/msacm/stream.c index cde8e4d..3c9ecf2 100644 --- a/dlls/msacm/stream.c +++ b/dlls/msacm/stream.c @@ -64,7 +64,7 @@ MMRESULT WINAPI acmStreamClose(HACMSTREA WARN("invalid handle\n"); return MMSYSERR_INVALHANDLE; } - ret = SendDriverMessage(was->pDrv->hDrvr, ACMDM_STREAM_CLOSE, (LPARAM)&was->drvInst, 0); + ret = MSACM_Message((HACMDRIVER)was->pDrv, ACMDM_STREAM_CLOSE, (LPARAM)&was->drvInst, 0); if (ret == MMSYSERR_NOERROR) { if (was->hAcmDriver) acmDriverClose(was->hAcmDriver, 0L); @@ -119,7 +119,7 @@ MMRESULT WINAPI acmStreamConvert(HACMSTR padsh->fdwConvert = fdwConvert; - ret = SendDriverMessage(was->pDrv->hDrvr, ACMDM_STREAM_CONVERT, (LPARAM)&was->drvInst, (LPARAM)padsh); + ret = MSACM_Message((HACMDRIVER)was->pDrv, ACMDM_STREAM_CONVERT, (LPARAM)&was->drvInst, (LPARAM)padsh); if (ret == MMSYSERR_NOERROR) { padsh->fdwStatus |= ACMSTREAMHEADER_STATUSF_DONE; } @@ -231,7 +231,7 @@ MMRESULT WINAPI acmStreamOpen(PHACMSTREA was->pDrv = wad; was->hAcmDriver = 0; /* not to close it in acmStreamClose */ - ret = SendDriverMessage(wad->hDrvr, ACMDM_STREAM_OPEN, (LPARAM)&was->drvInst, 0L); + ret = MSACM_Message((HACMDRIVER)wad, ACMDM_STREAM_OPEN, (LPARAM)&was->drvInst, 0L); if (ret != MMSYSERR_NOERROR) goto errCleanUp; } else { @@ -252,7 +252,7 @@ MMRESULT WINAPI acmStreamOpen(PHACMSTREA was->pDrv = wad; was->hAcmDriver = had; - ret = SendDriverMessage(wad->hDrvr, ACMDM_STREAM_OPEN, (LPARAM)&was->drvInst, 0L); + ret = MSACM_Message((HACMDRIVER)wad, ACMDM_STREAM_OPEN, (LPARAM)&was->drvInst, 0L); TRACE("%s => %08x\n", debugstr_w(wadi->pszDriverAlias), ret); if (ret == MMSYSERR_NOERROR) { if (fdwOpen & ACM_STREAMOPENF_QUERY) { @@ -329,7 +329,7 @@ MMRESULT WINAPI acmStreamPrepareHeader(H padsh->pbPreparedDst = 0; padsh->cbPreparedDstLength = 0; - ret = SendDriverMessage(was->pDrv->hDrvr, ACMDM_STREAM_PREPARE, (LPARAM)&was->drvInst, (DWORD)padsh); + ret = MSACM_Message((HACMDRIVER)was->pDrv, ACMDM_STREAM_PREPARE, (LPARAM)&was->drvInst, (DWORD)padsh); if (ret == MMSYSERR_NOERROR || ret == MMSYSERR_NOTSUPPORTED) { ret = MMSYSERR_NOERROR; padsh->fdwStatus &= ~(ACMSTREAMHEADER_STATUSF_DONE|ACMSTREAMHEADER_STATUSF_INQUEUE); @@ -369,7 +369,7 @@ MMRESULT WINAPI acmStreamReset(HACMSTREA WARN("invalid handle\n"); return MMSYSERR_INVALHANDLE; } else if (was->drvInst.fdwOpen & ACM_STREAMOPENF_ASYNC) { - ret = SendDriverMessage(was->pDrv->hDrvr, ACMDM_STREAM_RESET, (LPARAM)&was->drvInst, 0); + ret = MSACM_Message((HACMDRIVER)was->pDrv, ACMDM_STREAM_RESET, (LPARAM)&was->drvInst, 0); } TRACE("=> (%d)\n", ret); return ret; @@ -414,7 +414,7 @@ MMRESULT WINAPI acmStreamSize(HACMSTREAM adss.cbStruct = sizeof(adss); adss.fdwSize = fdwSize; - ret = SendDriverMessage(was->pDrv->hDrvr, ACMDM_STREAM_SIZE, + ret = MSACM_Message((HACMDRIVER)was->pDrv, ACMDM_STREAM_SIZE, (LPARAM)&was->drvInst, (LPARAM)&adss); if (ret == MMSYSERR_NOERROR) { switch (fdwSize & ACM_STREAMSIZEF_QUERYMASK) { @@ -472,7 +472,7 @@ MMRESULT WINAPI acmStreamUnprepareHeader padsh->fdwConvert = fdwUnprepare; - ret = SendDriverMessage(was->pDrv->hDrvr, ACMDM_STREAM_UNPREPARE, (LPARAM)&was->drvInst, (LPARAM)padsh); + ret = MSACM_Message((HACMDRIVER)was->pDrv, ACMDM_STREAM_UNPREPARE, (LPARAM)&was->drvInst, (LPARAM)padsh); if (ret == MMSYSERR_NOERROR || ret == MMSYSERR_NOTSUPPORTED) { ret = MMSYSERR_NOERROR; padsh->fdwStatus &= ~(ACMSTREAMHEADER_STATUSF_DONE|ACMSTREAMHEADER_STATUSF_INQUEUE|ACMSTREAMHEADER_STATUSF_PREPARED);
1
0
0
0
Alex Villacís Lasso : msacm: acmDriverMessage() with proper support for DRV_CONFIGURE.
by Alexandre Julliard
18 Jan '06
18 Jan '06
Module: wine Branch: refs/heads/master Commit: d20addf418fd1b99ea56f399924abdda735fc0aa URL:
http://source.winehq.org/git/?p=wine.git;a=commit;h=d20addf418fd1b99ea56f39…
Author: Alex Villacís Lasso <a_villacis(a)palosanto.com> Date: Wed Jan 18 12:13:36 2006 +0100 msacm: acmDriverMessage() with proper support for DRV_CONFIGURE. Allocate and supply a DRVCONFIGINFO structure for DRV_CONFIGURE when application does not supply one. --- dlls/msacm/driver.c | 89 ++++++++++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 88 insertions(+), 1 deletions(-) diff --git a/dlls/msacm/driver.c b/dlls/msacm/driver.c index 50c07e0..633c8bd 100644 --- a/dlls/msacm/driver.c +++ b/dlls/msacm/driver.c @@ -40,6 +40,7 @@ #include "msacmdrv.h" #include "wineacm.h" #include "wine/debug.h" +#include "wine/unicode.h" WINE_DEFAULT_DEBUG_CHANNEL(msacm); @@ -369,6 +370,15 @@ MMRESULT WINAPI acmDriverID(HACMOBJ hao, /*********************************************************************** * acmDriverMessage (MSACM32.@) * + * Note: MSDN documentation (July 2001) is incomplete. This function + * accepts sending messages to an HACMDRIVERID in addition to the + * documented HACMDRIVER. In fact, for DRV_QUERYCONFIGURE and DRV_CONFIGURE, + * this might actually be the required mode of operation. + * + * Note: For DRV_CONFIGURE, msacm supplies its own DRVCONFIGINFO structure + * when the application fails to supply one. Some native drivers depend on + * this and refuse to display unless a valid DRVCONFIGINFO structure is + * built and supplied. */ LRESULT WINAPI acmDriverMessage(HACMDRIVER had, UINT uMsg, LPARAM lParam1, LPARAM lParam2) { @@ -378,8 +388,85 @@ LRESULT WINAPI acmDriverMessage(HACMDRIV uMsg == ACMDM_DRIVER_ABOUT || uMsg == DRV_QUERYCONFIGURE || uMsg == DRV_CONFIGURE) - return MSACM_Message(had, uMsg, lParam1, lParam2); + { + PWINE_ACMDRIVERID padid; + LRESULT lResult; + LPDRVCONFIGINFO pConfigInfo = NULL; + /* Check whether handle is an HACMDRIVERID */ + padid = MSACM_GetDriverID((HACMDRIVERID)had); + + /* If the message is DRV_CONFIGURE, and the application provides no + DRVCONFIGINFO structure, msacm must supply its own. + */ + if (uMsg == DRV_CONFIGURE && lParam2 == 0) { + LPWSTR pAlias; + + /* Get the alias from the HACMDRIVERID */ + if (padid) { + pAlias = padid->pszDriverAlias; + if (pAlias == NULL) { + WARN("DRV_CONFIGURE: no alias for this driver, cannot self-supply alias\n"); + } + } else { + FIXME("DRV_CONFIGURE: reverse lookup HACMDRIVER -> HACMDRIVERID not implemented\n"); + pAlias = NULL; + } + + if (pAlias != NULL) { + unsigned int iStructSize = 16; + /* This verification is required because DRVCONFIGINFO is 12 bytes + long, yet native msacm reports a 16-byte structure to codecs. + */ + if (iStructSize < sizeof(DRVCONFIGINFO)) iStructSize = sizeof(DRVCONFIGINFO); + pConfigInfo = HeapAlloc(MSACM_hHeap, 0, iStructSize); + if (!pConfigInfo) { + ERR("OOM while supplying DRVCONFIGINFO for DRV_CONFIGURE, using NULL\n"); + } else { + static const WCHAR drivers32[] = {'D','r','i','v','e','r','s','3','2','\0'}; + pConfigInfo->dwDCISize = iStructSize; + + pConfigInfo->lpszDCISectionName = HeapAlloc(MSACM_hHeap, 0, (strlenW(drivers32) + 1) * sizeof(WCHAR)); + if (pConfigInfo->lpszDCISectionName) strcpyW((WCHAR *)pConfigInfo->lpszDCISectionName, drivers32); + pConfigInfo->lpszDCIAliasName = HeapAlloc(MSACM_hHeap, 0, (strlenW(pAlias) + 1) * sizeof(WCHAR)); + if (pConfigInfo->lpszDCIAliasName) strcpyW((WCHAR *)pConfigInfo->lpszDCIAliasName, pAlias); + + if (pConfigInfo->lpszDCISectionName == NULL || pConfigInfo->lpszDCIAliasName == NULL) { + HeapFree(MSACM_hHeap, 0, (void *)pConfigInfo->lpszDCIAliasName); + HeapFree(MSACM_hHeap, 0, (void *)pConfigInfo->lpszDCISectionName); + HeapFree(MSACM_hHeap, 0, pConfigInfo); + pConfigInfo = NULL; + ERR("OOM while supplying DRVCONFIGINFO for DRV_CONFIGURE, using NULL\n"); + } + } + } + + lParam2 = (LPARAM)pConfigInfo; + } + + if (padid) { + /* Handle is really an HACMDRIVERID, must have an open session to get an HACMDRIVER */ + if (padid->pACMDriverList != NULL) { + lResult = SendDriverMessage(padid->pACMDriverList->hDrvr, uMsg, lParam1, lParam2); + } else { + MMRESULT mmr = acmDriverOpen(&had, (HACMDRIVERID)padid, 0); + if (mmr != MMSYSERR_NOERROR) { + lResult = MMSYSERR_INVALPARAM; + } else { + lResult = acmDriverMessage(had, uMsg, lParam1, lParam2); + acmDriverClose(had, 0); + } + } + } else { + lResult = MSACM_Message(had, uMsg, lParam1, lParam2); + } + if (pConfigInfo) { + HeapFree(MSACM_hHeap, 0, (void *)pConfigInfo->lpszDCIAliasName); + HeapFree(MSACM_hHeap, 0, (void *)pConfigInfo->lpszDCISectionName); + HeapFree(MSACM_hHeap, 0, pConfigInfo); + } + return lResult; + } WARN("invalid parameter\n"); return MMSYSERR_INVALPARAM; }
1
0
0
0
Alex Villacís Lasso : msacm: acmDriverAdd[AW] support for ACM_DRIVERADDF_NOTIFYHWND.
by Alexandre Julliard
18 Jan '06
18 Jan '06
Module: wine Branch: refs/heads/master Commit: e3851bc7f7551b181abed2482362edd7e8793402 URL:
http://source.winehq.org/git/?p=wine.git;a=commit;h=e3851bc7f7551b181abed24…
Author: Alex Villacís Lasso <a_villacis(a)palosanto.com> Date: Wed Jan 18 12:10:59 2006 +0100 msacm: acmDriverAdd[AW] support for ACM_DRIVERADDF_NOTIFYHWND. Broadcast notifications are fleshed out and are now fully functional. --- dlls/msacm/driver.c | 100 +++++++++++++++++++++++++++++++------------------ dlls/msacm/internal.c | 72 +++++++++++++++++++++++++++++++++++ dlls/msacm/wineacm.h | 15 +++++++ 3 files changed, 150 insertions(+), 37 deletions(-)
1
0
0
0
Alex Villacís Lasso : MSACM: acmDriverAddW skeleton, implementation of ACM_DRIVERADDF_NAME.
by Alexandre Julliard
18 Jan '06
18 Jan '06
Module: wine Branch: refs/heads/master Commit: 72f7170e06179a392b320e15f846dadc29f7ab9a URL:
http://source.winehq.org/git/?p=wine.git;a=commit;h=72f7170e06179a392b320e1…
Author: Alex Villacís Lasso <a_villacis(a)palosanto.com> Date: Wed Jan 18 12:07:42 2006 +0100 MSACM: acmDriverAddW skeleton, implementation of ACM_DRIVERADDF_NAME. - Rework acmDriverAddA to call acmDriverAddW. - Implement stub for acmDriverAddW with switch for the 3 known cases of driver add. - Implementation for case ACM_DRIVERADDF_NAME, which loads driver name & alias from registry (similar to msacm32 load). --- dlls/msacm/driver.c | 97 ++++++++++++++++++++++++++++++++++++++++++------- dlls/msacm/internal.c | 37 +++++++++++++++++++ dlls/msacm/wineacm.h | 2 + 3 files changed, 122 insertions(+), 14 deletions(-) diff --git a/dlls/msacm/driver.c b/dlls/msacm/driver.c index 302cfee..4356273 100644 --- a/dlls/msacm/driver.c +++ b/dlls/msacm/driver.c @@ -49,6 +49,10 @@ WINE_DEFAULT_DEBUG_CHANNEL(msacm); MMRESULT WINAPI acmDriverAddA(PHACMDRIVERID phadid, HINSTANCE hinstModule, LPARAM lParam, DWORD dwPriority, DWORD fdwAdd) { + MMRESULT resultW; + WCHAR * driverW = NULL; + LPARAM lParamW = lParam; + TRACE("(%p, %p, %08lx, %08lx, %08lx)\n", phadid, hinstModule, lParam, dwPriority, fdwAdd); @@ -72,30 +76,95 @@ MMRESULT WINAPI acmDriverAddA(PHACMDRIVE return MMSYSERR_INVALFLAG; } - /* FIXME: in fact, should GetModuleFileName(hinstModule) and do a - * LoadDriver on it, to be sure we can call SendDriverMessage on the - * hDrvr handle. - */ - *phadid = (HACMDRIVERID) MSACM_RegisterDriver(NULL, NULL, hinstModule); - - /* FIXME: lParam, dwPriority and fdwAdd ignored */ + /* A->W translation of name */ + if ((fdwAdd & ACM_DRIVERADDF_TYPEMASK) == ACM_DRIVERADDF_NAME) { + unsigned long len; + + if (lParam == 0) return MMSYSERR_INVALPARAM; + len = MultiByteToWideChar(CP_ACP, 0, (LPSTR)lParam, -1, NULL, 0); + driverW = HeapAlloc(MSACM_hHeap, 0, len * sizeof(WCHAR)); + if (!driverW) return MMSYSERR_NOMEM; + MultiByteToWideChar(CP_ACP, 0, (LPSTR)lParam, -1, driverW, len); + lParamW = (LPARAM)driverW; + } - return MMSYSERR_NOERROR; + resultW = acmDriverAddW(phadid, hinstModule, lParamW, dwPriority, fdwAdd); + HeapFree(MSACM_hHeap, 0, driverW); + return resultW; } /*********************************************************************** * acmDriverAddW (MSACM32.@) - * FIXME - * Not implemented + * */ MMRESULT WINAPI acmDriverAddW(PHACMDRIVERID phadid, HINSTANCE hinstModule, LPARAM lParam, DWORD dwPriority, DWORD fdwAdd) { - FIXME("(%p, %p, %ld, %ld, %ld): stub\n", - phadid, hinstModule, lParam, dwPriority, fdwAdd); + TRACE("(%p, %p, %08lx, %08lx, %08lx)\n", + phadid, hinstModule, lParam, dwPriority, fdwAdd); + + if (!phadid) { + WARN("invalid parameter\n"); + return MMSYSERR_INVALPARAM; + } + + /* Check if any unknown flags */ + if (fdwAdd & + ~(ACM_DRIVERADDF_FUNCTION|ACM_DRIVERADDF_NOTIFYHWND| + ACM_DRIVERADDF_GLOBAL)) { + WARN("invalid flag\n"); + return MMSYSERR_INVALFLAG; + } + + /* Check if any incompatible flags */ + if ((fdwAdd & ACM_DRIVERADDF_FUNCTION) && + (fdwAdd & ACM_DRIVERADDF_NOTIFYHWND)) { + WARN("invalid flag\n"); + return MMSYSERR_INVALFLAG; + } + + switch (fdwAdd & ACM_DRIVERADDF_TYPEMASK) { + case ACM_DRIVERADDF_NAME: + /* + hInstModule (unused) + lParam name of value in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Drivers32 + dwPriority (unused, set to 0) + */ + *phadid = (HACMDRIVERID) MSACM_RegisterDriverFromRegistry((LPCWSTR)lParam); + if (!*phadid) { + ERR("Unable to register driver via ACM_DRIVERADDF_NAME\n"); + return MMSYSERR_INVALPARAM; + } + break; + case ACM_DRIVERADDF_FUNCTION: + /* + hInstModule Handle of module which contains driver entry proc + lParam Driver function address + dwPriority (unused, set to 0) + */ + fdwAdd &= ~ACM_DRIVERADDF_TYPEMASK; + + *phadid = 0; + FIXME("(%p, %p, %ld, %ld, %ld): ACM_DRIVERADDF_FUNCTION: stub\n", phadid, hinstModule, lParam, dwPriority, fdwAdd); + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return MMSYSERR_ERROR; + case ACM_DRIVERADDF_NOTIFYHWND: + /* + hInstModule (unused) + lParam Handle of notification window + dwPriority Window message to send for notification broadcasts + */ + *phadid = 0; + FIXME("(%p, %p, %ld, %ld, %ld): ACM_DRIVERADDF_NOTIFYHWND: stub\n", phadid, hinstModule, lParam, dwPriority, fdwAdd); + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return MMSYSERR_ERROR; + default: + ERR("invalid flag value 0x%08lx for fdwAdd\n", fdwAdd & ACM_DRIVERADDF_TYPEMASK); + return MMSYSERR_INVALFLAG; + } - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return MMSYSERR_ERROR; + MSACM_BroadcastNotification(); + return MMSYSERR_NOERROR; } /*********************************************************************** diff --git a/dlls/msacm/internal.c b/dlls/msacm/internal.c index a5eb350..b83f632 100644 --- a/dlls/msacm/internal.c +++ b/dlls/msacm/internal.c @@ -51,6 +51,43 @@ static BOOL MSACM_pendingBroadcast = FAL static void MSACM_ReorderDriversByPriority(void); +/*********************************************************************** + * MSACM_RegisterDriverFromRegistry() + */ +PWINE_ACMDRIVERID MSACM_RegisterDriverFromRegistry(LPCWSTR pszRegEntry) +{ + static const WCHAR msacmW[] = {'M','S','A','C','M','.'}; + static const WCHAR drvkey[] = {'S','o','f','t','w','a','r','e','\\', + 'M','i','c','r','o','s','o','f','t','\\', + 'W','i','n','d','o','w','s',' ','N','T','\\', + 'C','u','r','r','e','n','t','V','e','r','s','i','o','n','\\', + 'D','r','i','v','e','r','s','3','2','\0'}; + WCHAR buf[2048]; + DWORD bufLen, lRet; + HKEY hKey; + PWINE_ACMDRIVERID padid = NULL; + + /* The requested registry entry must have the format msacm.XXXXX in order to + be recognized in any future sessions of msacm + */ + if (0 == strncmpiW(buf, msacmW, sizeof(msacmW)/sizeof(WCHAR))) { + lRet = RegOpenKeyExW(HKEY_LOCAL_MACHINE, drvkey, 0, KEY_QUERY_VALUE, &hKey); + if (lRet != ERROR_SUCCESS) { + WARN("unable to open registry key - 0x%08lx\n", lRet); + } else { + bufLen = sizeof(buf); + lRet = RegQueryValueExW(hKey, pszRegEntry, NULL, NULL, (LPBYTE)buf, &bufLen); + if (lRet != ERROR_SUCCESS) { + WARN("unable to query requested subkey %s - 0x%08lx\n", debugstr_w(pszRegEntry), lRet); + } else { + MSACM_RegisterDriver(pszRegEntry, buf, 0); + } + RegCloseKey( hKey ); + } + } + return padid; +} + #if 0 /*********************************************************************** * MSACM_DumpCache diff --git a/dlls/msacm/wineacm.h b/dlls/msacm/wineacm.h index 0a3af41..e9b9247 100644 --- a/dlls/msacm/wineacm.h +++ b/dlls/msacm/wineacm.h @@ -354,6 +354,8 @@ extern void MSACM_BroadcastNotification( extern void MSACM_DisableNotifications(void); extern void MSACM_EnableNotifications(void); +extern PWINE_ACMDRIVERID MSACM_RegisterDriverFromRegistry(LPCWSTR pszRegEntry); + /* From msacm32.c */ extern HINSTANCE MSACM_hInstance32;
1
0
0
0
Alex Villacís Lasso : msacm: Implement acmDriverPriority with driver priority/enabled saving.
by Alexandre Julliard
18 Jan '06
18 Jan '06
Module: wine Branch: refs/heads/master Commit: cb37c43d7833705760c8d0bee462baf0a343381e URL:
http://source.winehq.org/git/?p=wine.git;a=commit;h=cb37c43d7833705760c8d0b…
Author: Alex Villacís Lasso <a_villacis(a)palosanto.com> Date: Wed Jan 18 12:06:56 2006 +0100 msacm: Implement acmDriverPriority with driver priority/enabled saving. Foundation for notification broadcasts with support for deferred notification. --- dlls/msacm/driver.c | 124 ++++++++++++++++++++++++++------------ dlls/msacm/internal.c | 160 +++++++++++++++++++++++++++++++++++++++++++++++++ dlls/msacm/wineacm.h | 6 ++ 3 files changed, 251 insertions(+), 39 deletions(-)
1
0
0
0
Alex Villacís Lasso : msacm: Implement honouring of driver priority and enabled status at
by Alexandre Julliard
18 Jan '06
18 Jan '06
Module: wine Branch: refs/heads/master Commit: 8d52016114e67ce2b194bdb58c82f2503489aed9 URL:
http://source.winehq.org/git/?p=wine.git;a=commit;h=8d52016114e67ce2b194bdb…
Author: Alex Villacís Lasso <a_villacis(a)palosanto.com> Date: Wed Jan 18 11:44:26 2006 +0100 msacm: Implement honouring of driver priority and enabled status at load time. --- dlls/msacm/internal.c | 116 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 115 insertions(+), 1 deletions(-) diff --git a/dlls/msacm/internal.c b/dlls/msacm/internal.c index 9aec278..19b64cb 100644 --- a/dlls/msacm/internal.c +++ b/dlls/msacm/internal.c @@ -46,6 +46,8 @@ HANDLE MSACM_hHeap = NULL; PWINE_ACMDRIVERID MSACM_pFirstACMDriverID = NULL; PWINE_ACMDRIVERID MSACM_pLastACMDriverID = NULL; +static void MSACM_ReorderDriversByPriority(void); + #if 0 /*********************************************************************** * MSACM_DumpCache @@ -327,11 +329,123 @@ void MSACM_RegisterAllDrivers(void) *name = '='; } } - + MSACM_ReorderDriversByPriority(); MSACM_RegisterDriver(msacm32, msacm32, 0); } /*********************************************************************** + * MSACM_ReorderDriversByPriority() + * Reorders all drivers based on the priority list indicated by the registry key: + * HKCU\\Software\\Microsoft\\Multimedia\\Audio Compression Manager\\Priority v4.00 + */ +static void MSACM_ReorderDriversByPriority(void) +{ + PWINE_ACMDRIVERID padid; + unsigned int iNumDrivers; + PWINE_ACMDRIVERID * driverList = NULL; + HKEY hPriorityKey = NULL; + + TRACE("\n"); + + /* Count drivers && alloc corresponding memory for list */ + iNumDrivers = 0; + for (padid = MSACM_pFirstACMDriverID; padid; padid = padid->pNextACMDriverID) iNumDrivers++; + if (iNumDrivers > 1) + { + LONG lError; + static const WCHAR basePriorityKey[] = { + 'S','o','f','t','w','a','r','e','\\', + 'M','i','c','r','o','s','o','f','t','\\', + 'M','u','l','t','i','m','e','d','i','a','\\', + 'A','u','d','i','o',' ','C','o','m','p','r','e','s','s','i','o','n',' ','M','a','n','a','g','e','r','\\', + 'P','r','i','o','r','i','t','y',' ','v','4','.','0','0','\0' + }; + unsigned int i; + LONG lBufferLength; + WCHAR szBuffer[256]; + + driverList = HeapAlloc(MSACM_hHeap, 0, iNumDrivers * sizeof(PWINE_ACMDRIVERID)); + if (!driverList) + { + ERR("out of memory\n"); + goto errCleanUp; + } + + lError = RegOpenKeyW(HKEY_CURRENT_USER, basePriorityKey, &hPriorityKey); + if (lError != ERROR_SUCCESS) { + TRACE("RegOpenKeyW failed, possibly key does not exist yet\n"); + hPriorityKey = NULL; + goto errCleanUp; + } + + /* Copy drivers into list to simplify linked list modification */ + for (i = 0, padid = MSACM_pFirstACMDriverID; padid; padid = padid->pNextACMDriverID, i++) + { + driverList[i] = padid; + } + + /* Query each of the priorities in turn. Alias key is in lowercase. + The general form of the priority record is the following: + "PriorityN" --> "1, msacm.driveralias" + where N is an integer, and the value is a string of the driver + alias, prefixed by "1, " for an enabled driver, or "0, " for a + disabled driver. + */ + for (i = 0; i < iNumDrivers; i++) + { + static const WCHAR priorityTmpl[] = {'P','r','i','o','r','i','t','y','%','l','d','\0'}; + WCHAR szSubKey[17]; + unsigned int iTargetPosition; + unsigned int iCurrentPosition; + WCHAR * pAlias; + static const WCHAR sPrefix[] = {'m','s','a','c','m','.','\0'}; + + /* Build expected entry name */ + snprintfW(szSubKey, 17, priorityTmpl, i + 1); + lBufferLength = sizeof(szBuffer); + lError = RegQueryValueExW(hPriorityKey, szSubKey, NULL, NULL, (LPBYTE)szBuffer, (LPDWORD)&lBufferLength); + if (lError != ERROR_SUCCESS) continue; + + /* Recovered driver alias should be at this position */ + iTargetPosition = i; + + /* Locate driver alias in driver list */ + pAlias = strstrW(szBuffer, sPrefix); + if (pAlias == NULL) continue; + + for (iCurrentPosition = 0; iCurrentPosition < iNumDrivers; iCurrentPosition++) { + if (strcmpiW(driverList[iCurrentPosition]->pszDriverAlias, pAlias) == 0) + break; + } + if (iCurrentPosition < iNumDrivers && iTargetPosition != iCurrentPosition) { + padid = driverList[iTargetPosition]; + driverList[iTargetPosition] = driverList[iCurrentPosition]; + driverList[iCurrentPosition] = padid; + + /* Locate enabled status */ + if (szBuffer[0] == '1') { + driverList[iTargetPosition]->fdwSupport &= ~ACMDRIVERDETAILS_SUPPORTF_DISABLED; + } else if (szBuffer[0] == '0') { + driverList[iTargetPosition]->fdwSupport |= ACMDRIVERDETAILS_SUPPORTF_DISABLED; + } + } + } + + /* Re-assign pointers so that linked list traverses the ordered array */ + for (i = 0; i < iNumDrivers; i++) { + driverList[i]->pPrevACMDriverID = (i > 0) ? driverList[i - 1] : NULL; + driverList[i]->pNextACMDriverID = (i < iNumDrivers - 1) ? driverList[i + 1] : NULL; + } + MSACM_pFirstACMDriverID = driverList[0]; + MSACM_pLastACMDriverID = driverList[iNumDrivers - 1]; + } + +errCleanUp: + if (hPriorityKey != NULL) RegCloseKey(hPriorityKey); + if (driverList != NULL) HeapFree(MSACM_hHeap, 0, driverList); +} + +/*********************************************************************** * MSACM_UnregisterDriver() */ PWINE_ACMDRIVERID MSACM_UnregisterDriver(PWINE_ACMDRIVERID p)
1
0
0
0
Michael Stefaniuc : oleaut: Add missing SysFreeString to the Var{Mul, Add, Cmp} tests.
by Alexandre Julliard
18 Jan '06
18 Jan '06
Module: wine Branch: refs/heads/master Commit: ba23adba41b897afb9688086c7123582655061a2 URL:
http://source.winehq.org/git/?p=wine.git;a=commit;h=ba23adba41b897afb968808…
Author: Michael Stefaniuc <mstefani(a)redhat.de> Date: Wed Jan 18 11:30:23 2006 +0100 oleaut: Add missing SysFreeString to the Var{Mul,Add,Cmp} tests. --- dlls/oleaut32/tests/vartest.c | 17 +++++++++++++++++ 1 files changed, 17 insertions(+), 0 deletions(-) diff --git a/dlls/oleaut32/tests/vartest.c b/dlls/oleaut32/tests/vartest.c index 85fb76e..65c5cfd 100644 --- a/dlls/oleaut32/tests/vartest.c +++ b/dlls/oleaut32/tests/vartest.c @@ -4731,6 +4731,9 @@ static void test_VarMul(void) ok(hres == S_OK && V_VT(&result) == VT_DECIMAL, "VarMul: expected coerced type VT_DECIMAL, got %s!\n", vtstr(V_VT(&result))); hres = VarR8FromDec(&V_DECIMAL(&result), &r); ok(hres == S_OK && EQ_DOUBLE(r, 46.2), "VarMul: DECIMAL value %f, expected %f\n", r, (double)46.2); + + SysFreeString(lbstr); + SysFreeString(rbstr); } static HRESULT (WINAPI *pVarAdd)(LPVARIANT,LPVARIANT,LPVARIANT); @@ -4928,6 +4931,9 @@ static void test_VarAdd(void) ok(hres == S_OK && V_VT(&result) == VT_DECIMAL, "VarAdd: expected coerced type VT_DECIMAL, got %s!\n", vtstr(V_VT(&result))); hres = VarR8FromDec(&V_DECIMAL(&result), &r); ok(hres == S_OK && EQ_DOUBLE(r, -15.2), "VarAdd: DECIMAL value %f, expected %f\n", r, (double)-15.2); + + SysFreeString(lbstr); + SysFreeString(rbstr); } static HRESULT (WINAPI *pVarCmp)(LPVARIANT,LPVARIANT,LCID,ULONG); @@ -5180,6 +5186,17 @@ static void test_VarCmp(void) VARCMP(R4,1,BSTR,bstr1few,VARCMP_LT); /* bstr1few == 1+1e-8 */ SETDEC(dec,8,0,0,0x5F5E101); /* 1+1e-8 */ VARCMP(R4,1,DECIMAL,dec,VARCMP_LT); + + SysFreeString(bstrhuh); + SysFreeString(bstrempty); + SysFreeString(bstr0); + SysFreeString(bstr1); + SysFreeString(bstr7); + SysFreeString(bstr42); + SysFreeString(bstr1neg); + SysFreeString(bstr666neg); + SysFreeString(bstr2cents); + SysFreeString(bstr1few); } START_TEST(vartest)
1
0
0
0
← Newer
1
...
24
25
26
27
28
29
30
...
62
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
Results per page:
10
25
50
100
200