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
December 2008
----- 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
1225 discussions
Start a n
N
ew thread
James Hawkins : msi: Implement MsiGetPatchInfoExW.
by Alexandre Julliard
15 Dec '08
15 Dec '08
Module: wine Branch: master Commit: 5aac1ec6e5102131c4a5aca742a4b7f4deb10635 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=5aac1ec6e5102131c4a5aca74…
Author: James Hawkins <jhawkins(a)codeweavers.com> Date: Sun Dec 14 21:07:17 2008 -0600 msi: Implement MsiGetPatchInfoExW. --- dlls/msi/msi.c | 143 +++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 141 insertions(+), 2 deletions(-) diff --git a/dlls/msi/msi.c b/dlls/msi/msi.c index 9575459..9a5c54a 100644 --- a/dlls/msi/msi.c +++ b/dlls/msi/msi.c @@ -1250,11 +1250,150 @@ UINT WINAPI MsiGetPatchInfoExW(LPCWSTR szPatchCode, LPCWSTR szProductCode, LPCWSTR szUserSid, MSIINSTALLCONTEXT dwContext, LPCWSTR szProperty, LPWSTR lpValue, DWORD *pcchValue) { - FIXME("(%s, %s, %s, %d, %s, %p, %p): stub!\n", debugstr_w(szPatchCode), + WCHAR squished_pc[GUID_SIZE]; + WCHAR squished_patch[GUID_SIZE]; + HKEY udprod = 0, prod = 0, props = 0; + HKEY patch = 0, patches = 0; + HKEY udpatch = 0, datakey = 0; + HKEY prodpatches = 0; + LPWSTR val = NULL; + UINT r = ERROR_UNKNOWN_PRODUCT; + DWORD len; + LONG res; + + static const WCHAR szEmpty[] = {0}; + static const WCHAR szPatches[] = {'P','a','t','c','h','e','s',0}; + static const WCHAR szInstalled[] = {'I','n','s','t','a','l','l','e','d',0}; + static const WCHAR szManagedPackage[] = {'M','a','n','a','g','e','d', + 'L','o','c','a','l','P','a','c','k','a','g','e',0}; + + TRACE("(%s, %s, %s, %d, %s, %p, %p)\n", debugstr_w(szPatchCode), debugstr_w(szProductCode), debugstr_w(szUserSid), dwContext, debugstr_w(szProperty), lpValue, pcchValue); - return ERROR_CALL_NOT_IMPLEMENTED; + if (!szProductCode || !squash_guid(szProductCode, squished_pc)) + return ERROR_INVALID_PARAMETER; + + if (!szPatchCode || !squash_guid(szPatchCode, squished_patch)) + return ERROR_INVALID_PARAMETER; + + if (!szProperty) + return ERROR_INVALID_PARAMETER; + + if (lpValue && !pcchValue) + return ERROR_INVALID_PARAMETER; + + if (dwContext != MSIINSTALLCONTEXT_USERMANAGED && + dwContext != MSIINSTALLCONTEXT_USERUNMANAGED && + dwContext != MSIINSTALLCONTEXT_MACHINE) + return ERROR_INVALID_PARAMETER; + + if (dwContext == MSIINSTALLCONTEXT_MACHINE && szUserSid) + return ERROR_INVALID_PARAMETER; + + if (!lstrcmpW(szUserSid, szLocalSid)) + return ERROR_INVALID_PARAMETER; + + if (MSIREG_OpenUserDataProductKey(szProductCode, dwContext, NULL, + &udprod, FALSE) != ERROR_SUCCESS) + goto done; + + if (MSIREG_OpenInstallProps(szProductCode, dwContext, NULL, + &props, FALSE) != ERROR_SUCCESS) + goto done; + + r = ERROR_UNKNOWN_PATCH; + + res = RegOpenKeyExW(udprod, szPatches, 0, KEY_READ, &patches); + if (res != ERROR_SUCCESS) + goto done; + + res = RegOpenKeyExW(patches, squished_patch, 0, KEY_READ, &patch); + if (res != ERROR_SUCCESS) + goto done; + + if (!lstrcmpW(szProperty, INSTALLPROPERTY_TRANSFORMSW)) + { + if (MSIREG_OpenProductKey(szProductCode, dwContext, + &prod, FALSE) != ERROR_SUCCESS) + goto done; + + res = RegOpenKeyExW(prod, szPatches, 0, KEY_ALL_ACCESS, &prodpatches); + if (res != ERROR_SUCCESS) + goto done; + + datakey = prodpatches; + szProperty = squished_patch; + } + else + { + if (MSIREG_OpenUserDataPatchKey(szPatchCode, dwContext, + &udpatch, FALSE) != ERROR_SUCCESS) + goto done; + + if (!lstrcmpW(szProperty, INSTALLPROPERTY_LOCALPACKAGEW)) + { + if (dwContext == MSIINSTALLCONTEXT_USERMANAGED) + szProperty = szManagedPackage; + datakey = udpatch; + } + else if (!lstrcmpW(szProperty, INSTALLPROPERTY_INSTALLDATEW)) + { + datakey = patch; + szProperty = szInstalled; + } + else if (!lstrcmpW(szProperty, INSTALLPROPERTY_LOCALPACKAGEW)) + { + datakey = udpatch; + } + else if (!lstrcmpW(szProperty, INSTALLPROPERTY_UNINSTALLABLEW) || + !lstrcmpW(szProperty, INSTALLPROPERTY_PATCHSTATEW) || + !lstrcmpW(szProperty, INSTALLPROPERTY_DISPLAYNAMEW) || + !lstrcmpW(szProperty, INSTALLPROPERTY_MOREINFOURLW)) + { + datakey = patch; + } + else + { + r = ERROR_UNKNOWN_PROPERTY; + goto done; + } + } + + val = msi_reg_get_val_str(datakey, szProperty); + if (!val) + val = strdupW(szEmpty); + + r = ERROR_SUCCESS; + + if (!pcchValue) + goto done; + + if (lpValue) + lstrcpynW(lpValue, val, *pcchValue); + + len = lstrlenW(val); + if ((*val && *pcchValue < len + 1) || !lpValue) + { + if (lpValue) + r = ERROR_MORE_DATA; + + *pcchValue = len * sizeof(WCHAR); + } + + *pcchValue = len; + +done: + msi_free(val); + RegCloseKey(prodpatches); + RegCloseKey(prod); + RegCloseKey(patch); + RegCloseKey(patches); + RegCloseKey(udpatch); + RegCloseKey(props); + RegCloseKey(udprod); + + return r; } UINT WINAPI MsiEnableLogA(DWORD dwLogMode, LPCSTR szLogFile, DWORD attributes)
1
0
0
0
James Hawkins : msi: Add the ability to query a specific context for install properties.
by Alexandre Julliard
15 Dec '08
15 Dec '08
Module: wine Branch: master Commit: b5e3e19a19bf8fdfd4519f594f5fad8c341b2f10 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=b5e3e19a19bf8fdfd4519f594…
Author: James Hawkins <jhawkins(a)codeweavers.com> Date: Sun Dec 14 21:07:14 2008 -0600 msi: Add the ability to query a specific context for install properties. --- dlls/msi/action.c | 24 +++++--------------- dlls/msi/msi.c | 61 ++++++++++++++++---------------------------------- dlls/msi/msipriv.h | 5 +-- dlls/msi/registry.c | 43 ++++++++++++++++-------------------- 4 files changed, 47 insertions(+), 86 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=b5e3e19a19bf8fdfd4519…
1
0
0
0
James Hawkins : msi: Add the ability to query a specific context for a patch.
by Alexandre Julliard
15 Dec '08
15 Dec '08
Module: wine Branch: master Commit: 880b9199a9c54e578d6186b46e6019e1ac970665 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=880b9199a9c54e578d6186b46…
Author: James Hawkins <jhawkins(a)codeweavers.com> Date: Sun Dec 14 21:07:09 2008 -0600 msi: Add the ability to query a specific context for a patch. --- dlls/msi/msipriv.h | 2 ++ dlls/msi/registry.c | 37 +++++++++++++++++++++++-------------- 2 files changed, 25 insertions(+), 14 deletions(-) diff --git a/dlls/msi/msipriv.h b/dlls/msi/msipriv.h index 0eaa9f3..a7dada7 100644 --- a/dlls/msi/msipriv.h +++ b/dlls/msi/msipriv.h @@ -778,6 +778,8 @@ extern UINT MSIREG_OpenUserDataComponentKey(LPCWSTR szComponent, LPCWSTR szUserS extern UINT MSIREG_OpenPatchesKey(LPCWSTR szPatch, HKEY* key, BOOL create); extern UINT MSIREG_OpenUserDataProductKey(LPCWSTR szProduct, MSIINSTALLCONTEXT dwContext, LPCWSTR szUserSid, HKEY *key, BOOL create); +extern UINT MSIREG_OpenUserDataPatchKey(LPCWSTR szPatch, MSIINSTALLCONTEXT dwContext, + HKEY *key, BOOL create); extern UINT MSIREG_OpenCurrentUserInstallProps(LPCWSTR szProduct, HKEY* key, BOOL create); extern UINT MSIREG_OpenInstallProps(LPCWSTR szProduct, LPCWSTR szUserSID, HKEY *key, BOOL create); diff --git a/dlls/msi/registry.c b/dlls/msi/registry.c index a1c3a48..d8411ee 100644 --- a/dlls/msi/registry.c +++ b/dlls/msi/registry.c @@ -837,30 +837,38 @@ UINT MSIREG_OpenUserDataProductKey(LPCWSTR szProduct, MSIINSTALLCONTEXT dwContex return rc; } -UINT MSIREG_OpenUserDataPatchKey(LPWSTR patch, HKEY *key, BOOL create) +UINT MSIREG_OpenUserDataPatchKey(LPCWSTR szPatch, MSIINSTALLCONTEXT dwContext, + HKEY *key, BOOL create) { UINT rc; + WCHAR squished_patch[GUID_SIZE]; WCHAR keypath[0x200]; LPWSTR usersid; - TRACE("\n"); + TRACE("%s\n", debugstr_w(szPatch)); + if (!squash_guid(szPatch, squished_patch)) + return ERROR_FUNCTION_FAILED; + TRACE("squished (%s)\n", debugstr_w(squished_patch)); - rc = get_user_sid(&usersid); - if (rc != ERROR_SUCCESS || !usersid) + if (dwContext == MSIINSTALLCONTEXT_MACHINE) + sprintfW(keypath, szUserDataPatch_fmt, szLocalSid, squished_patch); + else { - ERR("Failed to retrieve user SID: %d\n", rc); - return rc; - } + rc = get_user_sid(&usersid); + if (rc != ERROR_SUCCESS || !usersid) + { + ERR("Failed to retrieve user SID: %d\n", rc); + return rc; + } - sprintfW(keypath, szUserDataPatch_fmt, usersid, patch); + sprintfW(keypath, szUserDataPatch_fmt, usersid, squished_patch); + LocalFree(usersid); + } if (create) - rc = RegCreateKeyW(HKEY_LOCAL_MACHINE, keypath, key); - else - rc = RegOpenKeyW(HKEY_LOCAL_MACHINE, keypath, key); + return RegCreateKeyW(HKEY_LOCAL_MACHINE, keypath, key); - LocalFree(usersid); - return rc; + return RegOpenKeyW(HKEY_LOCAL_MACHINE, keypath, key); } UINT MSIREG_OpenInstallProps(LPCWSTR szProduct, LPCWSTR szUserSID, @@ -1819,7 +1827,8 @@ static UINT msi_check_product_patches(LPCWSTR prodcode, LPCWSTR usersid, } else { - temp = MSIREG_OpenUserDataPatchKey(ptr, &patchkey, FALSE); + temp = MSIREG_OpenUserDataPatchKey(patch, context, + &patchkey, FALSE); RegCloseKey(patchkey); if (temp != ERROR_SUCCESS) continue;
1
0
0
0
James Hawkins : msi: Add the ability to query a specific context for a product key.
by Alexandre Julliard
15 Dec '08
15 Dec '08
Module: wine Branch: master Commit: 4a9f6995aa22097feac6a1e13a29fabc3025f1c0 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=4a9f6995aa22097feac6a1e13…
Author: James Hawkins <jhawkins(a)codeweavers.com> Date: Sun Dec 14 21:07:06 2008 -0600 msi: Add the ability to query a specific context for a product key. --- dlls/msi/action.c | 18 ++++-------------- dlls/msi/msi.c | 3 ++- dlls/msi/msipriv.h | 4 ++-- dlls/msi/registry.c | 17 ++++++++++------- 4 files changed, 18 insertions(+), 24 deletions(-) diff --git a/dlls/msi/action.c b/dlls/msi/action.c index 654a7d0..0a23136 100644 --- a/dlls/msi/action.c +++ b/dlls/msi/action.c @@ -3589,20 +3589,10 @@ static UINT ACTION_PublishProduct(MSIPACKAGE *package) if (rc != ERROR_SUCCESS) goto end; - if (package->Context == MSIINSTALLCONTEXT_MACHINE) - { - rc = MSIREG_OpenUserDataProductKey(package->ProductCode, szLocalSid, - &hudkey, TRUE); - if (rc != ERROR_SUCCESS) - goto end; - } - else - { - rc = MSIREG_OpenUserDataProductKey(package->ProductCode, NULL, - &hudkey, TRUE); - if (rc != ERROR_SUCCESS) - goto end; - } + rc = MSIREG_OpenUserDataProductKey(package->ProductCode, package->Context, + NULL, &hudkey, TRUE); + if (rc != ERROR_SUCCESS) + goto end; rc = msi_publish_upgrade_code(package); if (rc != ERROR_SUCCESS) diff --git a/dlls/msi/msi.c b/dlls/msi/msi.c index c49f86d..e6de69d 100644 --- a/dlls/msi/msi.c +++ b/dlls/msi/msi.c @@ -1988,7 +1988,8 @@ static INSTALLSTATE MSI_GetComponentPath(LPCWSTR szProduct, LPCWSTR szComponent, state = INSTALLSTATE_ABSENT; if ((MSIREG_OpenInstallProps(szProduct, szLocalSid, &hkey, FALSE) == ERROR_SUCCESS || - MSIREG_OpenUserDataProductKey(szProduct, NULL, &hkey, FALSE) == ERROR_SUCCESS) && + MSIREG_OpenUserDataProductKey(szProduct, MSIINSTALLCONTEXT_USERUNMANAGED, + NULL, &hkey, FALSE) == ERROR_SUCCESS) && msi_reg_get_val_dword(hkey, wininstaller, &version) && GetFileAttributesW(path) != INVALID_FILE_ATTRIBUTES) { diff --git a/dlls/msi/msipriv.h b/dlls/msi/msipriv.h index 99eff8f..0eaa9f3 100644 --- a/dlls/msi/msipriv.h +++ b/dlls/msi/msipriv.h @@ -776,8 +776,8 @@ extern UINT MSIREG_OpenUserComponentsKey(LPCWSTR szComponent, HKEY* key, BOOL cr extern UINT MSIREG_OpenUserDataComponentKey(LPCWSTR szComponent, LPCWSTR szUserSid, HKEY *key, BOOL create); extern UINT MSIREG_OpenPatchesKey(LPCWSTR szPatch, HKEY* key, BOOL create); -extern UINT MSIREG_OpenUserDataProductKey(LPCWSTR szProduct, LPCWSTR szUserSid, - HKEY* key, BOOL create); +extern UINT MSIREG_OpenUserDataProductKey(LPCWSTR szProduct, MSIINSTALLCONTEXT dwContext, + LPCWSTR szUserSid, HKEY *key, BOOL create); extern UINT MSIREG_OpenCurrentUserInstallProps(LPCWSTR szProduct, HKEY* key, BOOL create); extern UINT MSIREG_OpenInstallProps(LPCWSTR szProduct, LPCWSTR szUserSID, HKEY *key, BOOL create); diff --git a/dlls/msi/registry.c b/dlls/msi/registry.c index db9ec65..a1c3a48 100644 --- a/dlls/msi/registry.c +++ b/dlls/msi/registry.c @@ -799,8 +799,8 @@ UINT MSIREG_DeleteUserDataComponentKey(LPCWSTR szComponent, LPCWSTR szUserSid) return RegDeleteTreeW(HKEY_LOCAL_MACHINE, keypath); } -UINT MSIREG_OpenUserDataProductKey(LPCWSTR szProduct, LPCWSTR szUserSid, - HKEY *key, BOOL create) +UINT MSIREG_OpenUserDataProductKey(LPCWSTR szProduct, MSIINSTALLCONTEXT dwContext, + LPCWSTR szUserSid, HKEY *key, BOOL create) { UINT rc; WCHAR squished_pc[GUID_SIZE]; @@ -812,7 +812,11 @@ UINT MSIREG_OpenUserDataProductKey(LPCWSTR szProduct, LPCWSTR szUserSid, return ERROR_FUNCTION_FAILED; TRACE("squished (%s)\n", debugstr_w(squished_pc)); - if (!szUserSid) + if (dwContext == MSIINSTALLCONTEXT_MACHINE) + sprintfW(keypath, szUserDataProd_fmt, szLocalSid, squished_pc); + else if (szUserSid) + sprintfW(keypath, szUserDataProd_fmt, usersid, squished_pc); + else { rc = get_user_sid(&usersid); if (rc != ERROR_SUCCESS || !usersid) @@ -824,8 +828,6 @@ UINT MSIREG_OpenUserDataProductKey(LPCWSTR szProduct, LPCWSTR szUserSid, sprintfW(keypath, szUserDataProd_fmt, usersid, squished_pc); LocalFree(usersid); } - else - sprintfW(keypath, szUserDataProd_fmt, szUserSid, squished_pc); if (create) rc = RegCreateKeyW(HKEY_LOCAL_MACHINE, keypath, key); @@ -1679,7 +1681,8 @@ static UINT msi_get_patch_state(LPCWSTR prodcode, LPCWSTR usersid, *state = MSIPATCHSTATE_INVALID; /* FIXME: usersid might not be current user */ - r = MSIREG_OpenUserDataProductKey(prodcode, NULL, &prod, FALSE); + r = MSIREG_OpenUserDataProductKey(prodcode, MSIINSTALLCONTEXT_USERUNMANAGED, + NULL, &prod, FALSE); if (r != ERROR_SUCCESS) return ERROR_NO_MORE_ITEMS; @@ -1826,7 +1829,7 @@ static UINT msi_check_product_patches(LPCWSTR prodcode, LPCWSTR usersid, { usersid = szEmpty; - if (MSIREG_OpenUserDataProductKey(prodcode, szLocalSid, &localprod, FALSE) == ERROR_SUCCESS && + if (MSIREG_OpenUserDataProductKey(prodcode, context, NULL, &localprod, FALSE) == ERROR_SUCCESS && RegOpenKeyExW(localprod, szPatches, 0, KEY_READ, &localpatch) == ERROR_SUCCESS && RegOpenKeyExW(localpatch, ptr, 0, KEY_READ, &patchkey) == ERROR_SUCCESS) {
1
0
0
0
James Hawkins : msi: Forward MsiGetPatchInfoExA to MsiGetPatchInfoExW.
by Alexandre Julliard
15 Dec '08
15 Dec '08
Module: wine Branch: master Commit: d195ee3cc475dd21f4892f3c841c5918d79381ba URL:
http://source.winehq.org/git/wine.git/?a=commit;h=d195ee3cc475dd21f4892f3c8…
Author: James Hawkins <jhawkins(a)codeweavers.com> Date: Sun Dec 14 21:07:02 2008 -0600 msi: Forward MsiGetPatchInfoExA to MsiGetPatchInfoExW. --- dlls/msi/msi.c | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 58 insertions(+), 2 deletions(-) diff --git a/dlls/msi/msi.c b/dlls/msi/msi.c index 7c980ee..c49f86d 100644 --- a/dlls/msi/msi.c +++ b/dlls/msi/msi.c @@ -1194,11 +1194,67 @@ UINT WINAPI MsiGetPatchInfoExA(LPCSTR szPatchCode, LPCSTR szProductCode, LPCSTR szUserSid, MSIINSTALLCONTEXT dwContext, LPCSTR szProperty, LPSTR lpValue, DWORD *pcchValue) { - FIXME("(%s, %s, %s, %d, %s, %p, %p): stub!\n", debugstr_a(szPatchCode), + LPWSTR patch = NULL, product = NULL, usersid = NULL; + LPWSTR property = NULL, val = NULL; + DWORD len; + UINT r; + + TRACE("(%s, %s, %s, %d, %s, %p, %p)\n", debugstr_a(szPatchCode), debugstr_a(szProductCode), debugstr_a(szUserSid), dwContext, debugstr_a(szProperty), lpValue, pcchValue); - return ERROR_CALL_NOT_IMPLEMENTED; + if (lpValue && !pcchValue) + return ERROR_INVALID_PARAMETER; + + if (szPatchCode) patch = strdupAtoW(szPatchCode); + if (szProductCode) product = strdupAtoW(szProductCode); + if (szUserSid) usersid = strdupAtoW(szUserSid); + if (szProperty) property = strdupAtoW(szProperty); + + len = 0; + r = MsiGetPatchInfoExW(patch, product, usersid, dwContext, property, + NULL, &len); + if (r != ERROR_SUCCESS) + goto done; + + val = msi_alloc(++len * sizeof(WCHAR)); + if (!val) + { + r = ERROR_OUTOFMEMORY; + goto done; + } + + r = MsiGetPatchInfoExW(patch, product, usersid, dwContext, property, + val, &len); + if (r != ERROR_SUCCESS || !pcchValue) + goto done; + + if (lpValue) + WideCharToMultiByte(CP_ACP, 0, val, -1, lpValue, + *pcchValue - 1, NULL, NULL); + + len = lstrlenW(val); + if ((*val && *pcchValue < len + 1) || !lpValue) + { + if (lpValue) + { + r = ERROR_MORE_DATA; + lpValue[*pcchValue - 1] = '\0'; + } + + *pcchValue = len * sizeof(WCHAR); + } + else + *pcchValue = len; + +done: + msi_free(val); + msi_free(patch); + msi_free(product); + msi_free(usersid); + msi_free(property); + + return r; } UINT WINAPI MsiGetPatchInfoExW(LPCWSTR szPatchCode, LPCWSTR szProductCode,
1
0
0
0
James Hawkins : msi: Add a stub implementation of MsiGetPatchInfoEx.
by Alexandre Julliard
15 Dec '08
15 Dec '08
Module: wine Branch: master Commit: 199a26c81a4f5c82ea324626976d040c945c8c17 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=199a26c81a4f5c82ea3246269…
Author: James Hawkins <jhawkins(a)codeweavers.com> Date: Sun Dec 14 21:06:55 2008 -0600 msi: Add a stub implementation of MsiGetPatchInfoEx. --- dlls/msi/msi.c | 22 ++++++++++++++++++++++ dlls/msi/msi.spec | 4 ++-- include/msi.h | 4 ++++ 3 files changed, 28 insertions(+), 2 deletions(-) diff --git a/dlls/msi/msi.c b/dlls/msi/msi.c index ef1b871..7c980ee 100644 --- a/dlls/msi/msi.c +++ b/dlls/msi/msi.c @@ -1190,6 +1190,28 @@ done: return r; } +UINT WINAPI MsiGetPatchInfoExA(LPCSTR szPatchCode, LPCSTR szProductCode, + LPCSTR szUserSid, MSIINSTALLCONTEXT dwContext, + LPCSTR szProperty, LPSTR lpValue, DWORD *pcchValue) +{ + FIXME("(%s, %s, %s, %d, %s, %p, %p): stub!\n", debugstr_a(szPatchCode), + debugstr_a(szProductCode), debugstr_a(szUserSid), dwContext, + debugstr_a(szProperty), lpValue, pcchValue); + + return ERROR_CALL_NOT_IMPLEMENTED; +} + +UINT WINAPI MsiGetPatchInfoExW(LPCWSTR szPatchCode, LPCWSTR szProductCode, + LPCWSTR szUserSid, MSIINSTALLCONTEXT dwContext, + LPCWSTR szProperty, LPWSTR lpValue, DWORD *pcchValue) +{ + FIXME("(%s, %s, %s, %d, %s, %p, %p): stub!\n", debugstr_w(szPatchCode), + debugstr_w(szProductCode), debugstr_w(szUserSid), dwContext, + debugstr_w(szProperty), lpValue, pcchValue); + + return ERROR_CALL_NOT_IMPLEMENTED; +} + UINT WINAPI MsiEnableLogA(DWORD dwLogMode, LPCSTR szLogFile, DWORD attributes) { LPWSTR szwLogFile = NULL; diff --git a/dlls/msi/msi.spec b/dlls/msi/msi.spec index db7aa90..017fdbe 100644 --- a/dlls/msi/msi.spec +++ b/dlls/msi/msi.spec @@ -236,8 +236,8 @@ 240 stub MsiApplyMultiplePatchesW 241 stub MsiExtractPatchXMLDataA 242 stub MsiExtractPatchXMLDataW -243 stub MsiGetPatchInfoExA -244 stub MsiGetPatchInfoExW +243 stdcall MsiGetPatchInfoExA(str str str long str ptr ptr) +244 stdcall MsiGetPatchInfoExW(wstr wstr wstr long wstr ptr ptr) 245 stdcall MsiEnumProductsExA(str str long long ptr ptr ptr ptr) 246 stdcall MsiEnumProductsExW(wstr wstr long long ptr ptr ptr ptr) 247 stdcall MsiGetProductInfoExA(str str long str ptr ptr) diff --git a/include/msi.h b/include/msi.h index 2dbe4d3..5564fcd 100644 --- a/include/msi.h +++ b/include/msi.h @@ -497,6 +497,10 @@ UINT WINAPI MsiGetProductInfoExA(LPCSTR, LPCSTR, MSIINSTALLCONTEXT, LPCSTR, LPST UINT WINAPI MsiGetProductInfoExW(LPCWSTR, LPCWSTR, MSIINSTALLCONTEXT, LPCWSTR, LPWSTR, LPDWORD); #define MsiGetProductInfoEx WINELIB_NAME_AW(MsiGetProductInfoEx) +UINT WINAPI MsiGetPatchInfoExA(LPCSTR, LPCSTR, LPCSTR, MSIINSTALLCONTEXT, LPCSTR, LPSTR, LPDWORD); +UINT WINAPI MsiGetPatchInfoExW(LPCWSTR, LPCWSTR, LPCWSTR, MSIINSTALLCONTEXT, LPCWSTR, LPWSTR, LPDWORD); +#define MsiGetPatchInfoEx WINELIB_NAME_AW(MsiGetPatchInfoEx) + UINT WINAPI MsiEnableLogA(DWORD, LPCSTR, DWORD); UINT WINAPI MsiEnableLogW(DWORD, LPCWSTR, DWORD); #define MsiEnableLog WINELIB_NAME_AW(MsiEnableLog)
1
0
0
0
Nikolay Sivov : gdiplus: Added GdipAddPathCurve3/ GdipAddPathCurve3I with tests.
by Alexandre Julliard
15 Dec '08
15 Dec '08
Module: wine Branch: master Commit: 7cddc57989261aaa1ef4a7d066e75505fe28d748 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=7cddc57989261aaa1ef4a7d06…
Author: Nikolay Sivov <bunglehead(a)gmail.com> Date: Mon Dec 15 02:52:35 2008 +0300 gdiplus: Added GdipAddPathCurve3/GdipAddPathCurve3I with tests. --- dlls/gdiplus/gdiplus.spec | 4 +- dlls/gdiplus/graphicspath.c | 22 ++++++++++++++++++++ dlls/gdiplus/tests/graphicspath.c | 40 +++++++++++++++++++++++++++++++++++++ include/gdiplusflat.h | 2 + 4 files changed, 66 insertions(+), 2 deletions(-) diff --git a/dlls/gdiplus/gdiplus.spec b/dlls/gdiplus/gdiplus.spec index 9473f1b..d380d74 100644 --- a/dlls/gdiplus/gdiplus.spec +++ b/dlls/gdiplus/gdiplus.spec @@ -10,8 +10,8 @@ @ stdcall GdipAddPathClosedCurveI(ptr ptr long) @ stdcall GdipAddPathCurve2(ptr ptr long long) @ stdcall GdipAddPathCurve2I(ptr ptr long long) -@ stub GdipAddPathCurve3 -@ stub GdipAddPathCurve3I +@ stdcall GdipAddPathCurve3(ptr ptr long long long long) +@ stdcall GdipAddPathCurve3I(ptr ptr long long long long) @ stdcall GdipAddPathCurve(ptr ptr long) @ stdcall GdipAddPathCurveI(ptr ptr long) @ stdcall GdipAddPathEllipse(ptr long long long long) diff --git a/dlls/gdiplus/graphicspath.c b/dlls/gdiplus/graphicspath.c index 20a3b2c..042d4a2 100644 --- a/dlls/gdiplus/graphicspath.c +++ b/dlls/gdiplus/graphicspath.c @@ -524,6 +524,28 @@ GpStatus WINGDIPAPI GdipAddPathCurve2I(GpPath *path, GDIPCONST GpPoint *points, return stat; } +GpStatus WINGDIPAPI GdipAddPathCurve3(GpPath *path, GDIPCONST GpPointF *points, + INT count, INT offset, INT nseg, REAL tension) +{ + TRACE("(%p, %p, %d, %d, %d, %.2f)\n", path, points, count, offset, nseg, tension); + + if(!path || !points || offset + 1 >= count || count - offset < nseg + 1) + return InvalidParameter; + + return GdipAddPathCurve2(path, &points[offset], nseg + 1, tension); +} + +GpStatus WINGDIPAPI GdipAddPathCurve3I(GpPath *path, GDIPCONST GpPoint *points, + INT count, INT offset, INT nseg, REAL tension) +{ + TRACE("(%p, %p, %d, %d, %d, %.2f)\n", path, points, count, offset, nseg, tension); + + if(!path || !points || offset + 1 >= count || count - offset < nseg + 1) + return InvalidParameter; + + return GdipAddPathCurve2I(path, &points[offset], nseg + 1, tension); +} + GpStatus WINGDIPAPI GdipAddPathEllipse(GpPath *path, REAL x, REAL y, REAL width, REAL height) { diff --git a/dlls/gdiplus/tests/graphicspath.c b/dlls/gdiplus/tests/graphicspath.c index 168c4b5..416d80c 100644 --- a/dlls/gdiplus/tests/graphicspath.c +++ b/dlls/gdiplus/tests/graphicspath.c @@ -726,6 +726,15 @@ static path_test_t addcurve_path2[] = { {23.3, 13.3, PathPointTypeBezier, 0, 0}, /*10*/ {30.0, 10.0, PathPointTypeBezier, 0, 0} /*11*/ }; +static path_test_t addcurve_path3[] = { + {10.0, 10.0, PathPointTypeStart, 0, 0}, /*0*/ + {13.3, 16.7, PathPointTypeBezier, 0, 1}, /*1*/ + {3.3, 20.0, PathPointTypeBezier, 0, 0}, /*2*/ + {10.0, 20.0, PathPointTypeBezier, 0, 0}, /*3*/ + {16.7, 20.0, PathPointTypeBezier, 0, 0}, /*4*/ + {23.3, 13.3, PathPointTypeBezier, 0, 0}, /*5*/ + {30.0, 10.0, PathPointTypeBezier, 0, 0} /*6*/ + }; static void test_addcurve(void) { GpStatus status; @@ -765,6 +774,37 @@ static void test_addcurve(void) status = GdipAddPathCurve2(path, points, 4, 1.0); expect(Ok, status); ok_path(path, addcurve_path2, sizeof(addcurve_path2)/sizeof(path_test_t), FALSE); + + /* NULL args */ + GdipResetPath(path); + status = GdipAddPathCurve3(NULL, NULL, 0, 0, 0, 0.0); + expect(InvalidParameter, status); + status = GdipAddPathCurve3(path, NULL, 0, 0, 0, 0.0); + expect(InvalidParameter, status); + /* wrong count, offset.. */ + status = GdipAddPathCurve3(path, points, 0, 0, 0, 0.0); + expect(InvalidParameter, status); + status = GdipAddPathCurve3(path, points, 4, 0, 0, 0.0); + expect(InvalidParameter, status); + status = GdipAddPathCurve3(path, points, 4, 0, 4, 0.0); + expect(InvalidParameter, status); + status = GdipAddPathCurve3(path, points, 4, 1, 3, 0.0); + expect(InvalidParameter, status); + status = GdipAddPathCurve3(path, points, 4, 1, 0, 0.0); + expect(InvalidParameter, status); + status = GdipAddPathCurve3(path, points, 4, 3, 1, 0.0); + expect(InvalidParameter, status); + + /* use all points */ + status = GdipAddPathCurve3(path, points, 4, 0, 3, 1.0); + expect(Ok, status); + ok_path(path, addcurve_path, sizeof(addcurve_path)/sizeof(path_test_t), FALSE); + GdipResetPath(path); + + status = GdipAddPathCurve3(path, points, 4, 1, 2, 1.0); + expect(Ok, status); + ok_path(path, addcurve_path3, sizeof(addcurve_path3)/sizeof(path_test_t), FALSE); + GdipDeletePath(path); } diff --git a/include/gdiplusflat.h b/include/gdiplusflat.h index 216b2f3..1a39dee 100644 --- a/include/gdiplusflat.h +++ b/include/gdiplusflat.h @@ -256,6 +256,8 @@ GpStatus WINGDIPAPI GdipAddPathCurve(GpPath*,GDIPCONST GpPointF*,INT); GpStatus WINGDIPAPI GdipAddPathCurveI(GpPath*,GDIPCONST GpPoint*,INT); GpStatus WINGDIPAPI GdipAddPathCurve2(GpPath*,GDIPCONST GpPointF*,INT,REAL); GpStatus WINGDIPAPI GdipAddPathCurve2I(GpPath*,GDIPCONST GpPoint*,INT,REAL); +GpStatus WINGDIPAPI GdipAddPathCurve3(GpPath*,GDIPCONST GpPointF*,INT,INT,INT,REAL); +GpStatus WINGDIPAPI GdipAddPathCurve3I(GpPath*,GDIPCONST GpPoint*,INT,INT,INT,REAL); GpStatus WINGDIPAPI GdipAddPathEllipse(GpPath*,REAL,REAL,REAL,REAL); GpStatus WINGDIPAPI GdipAddPathEllipseI(GpPath*,INT,INT,INT,INT); GpStatus WINGDIPAPI GdipAddPathLine(GpPath*,REAL,REAL,REAL,REAL);
1
0
0
0
Christian Costa : amstream: Add stubbed implementation of MediaStreamFilter .
by Alexandre Julliard
15 Dec '08
15 Dec '08
Module: wine Branch: master Commit: 48e213b4d8ccd718a0fe3f9b5f6a8577a5d6f3d4 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=48e213b4d8ccd718a0fe3f9b5…
Author: Christian Costa <titan.costa(a)wanadoo.fr> Date: Sun Dec 14 19:08:17 2008 +0100 amstream: Add stubbed implementation of MediaStreamFilter. --- dlls/amstream/Makefile.in | 1 + dlls/amstream/amstream_private.h | 1 + dlls/amstream/main.c | 1 + dlls/amstream/mediastreamfilter.c | 313 +++++++++++++++++++++++++++++++++++++ include/amstream.idl | 1 + 5 files changed, 317 insertions(+), 0 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=48e213b4d8ccd718a0fe3…
1
0
0
0
Christian Costa : amstream: Some fixes.
by Alexandre Julliard
15 Dec '08
15 Dec '08
Module: wine Branch: master Commit: c4a8ab069ff645598dfa020b89c4a19b2357d82b URL:
http://source.winehq.org/git/wine.git/?a=commit;h=c4a8ab069ff645598dfa020b8…
Author: Christian Costa <titan.costa(a)wanadoo.fr> Date: Sun Dec 14 19:07:32 2008 +0100 amstream: Some fixes. --- dlls/amstream/amstream.c | 30 ++++++++++++++++++------------ dlls/amstream/mediastream.c | 18 ++++++++++++++---- 2 files changed, 32 insertions(+), 16 deletions(-) diff --git a/dlls/amstream/amstream.c b/dlls/amstream/amstream.c index 384b342..7c8a94b 100644 --- a/dlls/amstream/amstream.c +++ b/dlls/amstream/amstream.c @@ -57,6 +57,11 @@ HRESULT AM_create(IUnknown *pUnkOuter, LPVOID *ppObj) return CLASS_E_NOAGGREGATION; object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IAMMultiMediaStreamImpl)); + if (!object) + { + ERR("Out of memory\n"); + return E_OUTOFMEMORY; + } object->lpVtbl.lpVtbl = &AM_Vtbl; object->ref = 1; @@ -71,7 +76,7 @@ static HRESULT WINAPI IAMMultiMediaStreamImpl_QueryInterface(IAMMultiMediaStream { IAMMultiMediaStreamImpl *This = (IAMMultiMediaStreamImpl *)iface; - FIXME("(%p/%p)->(%s,%p)\n", iface, This, debugstr_guid(riid), ppvObject); + TRACE("(%p/%p)->(%s,%p)\n", iface, This, debugstr_guid(riid), ppvObject); if (IsEqualGUID(riid, &IID_IUnknown) || IsEqualGUID(riid, &IID_IAMMultiMediaStream)) @@ -113,7 +118,7 @@ static HRESULT WINAPI IAMMultiMediaStreamImpl_GetInformation(IAMMultiMediaStream { IAMMultiMediaStreamImpl *This = (IAMMultiMediaStreamImpl *)iface; - FIXME("(%p/%p)->(%p,%p) stub!\n", This, iface, pdwFlags, pStreamType); + FIXME("(%p/%p)->(%p,%p) stub!\n", This, iface, pdwFlags, pStreamType); return E_NOTIMPL; } @@ -144,7 +149,7 @@ static HRESULT WINAPI IAMMultiMediaStreamImpl_EnumMediaStreams(IAMMultiMediaStre { IAMMultiMediaStreamImpl *This = (IAMMultiMediaStreamImpl *)iface; - FIXME("(%p/%p)->(%ld,%p) stub!\n", This, iface, Index, ppMediaStream); + FIXME("(%p/%p)->(%ld,%p) stub!\n", This, iface, Index, ppMediaStream); return E_NOTIMPL; } @@ -153,7 +158,7 @@ static HRESULT WINAPI IAMMultiMediaStreamImpl_GetState(IAMMultiMediaStream* ifac { IAMMultiMediaStreamImpl *This = (IAMMultiMediaStreamImpl *)iface; - FIXME("(%p/%p)->(%p) stub!\n", This, iface, pCurrentState); + FIXME("(%p/%p)->(%p) stub!\n", This, iface, pCurrentState); return E_NOTIMPL; } @@ -162,7 +167,7 @@ static HRESULT WINAPI IAMMultiMediaStreamImpl_SetState(IAMMultiMediaStream* ifac { IAMMultiMediaStreamImpl *This = (IAMMultiMediaStreamImpl *)iface; - FIXME("(%p/%p)->() stub!\n", This, iface); + FIXME("(%p/%p)->() stub!\n", This, iface); return E_NOTIMPL; } @@ -171,7 +176,7 @@ static HRESULT WINAPI IAMMultiMediaStreamImpl_GetTime(IAMMultiMediaStream* iface { IAMMultiMediaStreamImpl *This = (IAMMultiMediaStreamImpl *)iface; - FIXME("(%p/%p)->(%p) stub!\n", This, iface, pCurrentTime); + FIXME("(%p/%p)->(%p) stub!\n", This, iface, pCurrentTime); return E_NOTIMPL; } @@ -180,7 +185,7 @@ static HRESULT WINAPI IAMMultiMediaStreamImpl_GetDuration(IAMMultiMediaStream* i { IAMMultiMediaStreamImpl *This = (IAMMultiMediaStreamImpl *)iface; - FIXME("(%p/%p)->(%p) stub!\n", This, iface, pDuration); + FIXME("(%p/%p)->(%p) stub!\n", This, iface, pDuration); return E_NOTIMPL; } @@ -189,7 +194,7 @@ static HRESULT WINAPI IAMMultiMediaStreamImpl_Seek(IAMMultiMediaStream* iface, S { IAMMultiMediaStreamImpl *This = (IAMMultiMediaStreamImpl *)iface; - FIXME("(%p/%p)->() stub!\n", This, iface); + FIXME("(%p/%p)->() stub!\n", This, iface); return E_NOTIMPL; } @@ -198,7 +203,7 @@ static HRESULT WINAPI IAMMultiMediaStreamImpl_GetEndOfStream(IAMMultiMediaStream { IAMMultiMediaStreamImpl *This = (IAMMultiMediaStreamImpl *)iface; - FIXME("(%p/%p)->(%p) stub!\n", This, iface, phEOS); + FIXME("(%p/%p)->(%p) stub!\n", This, iface, phEOS); return E_NOTIMPL; } @@ -233,7 +238,7 @@ static HRESULT WINAPI IAMMultiMediaStreamImpl_GetFilterGraph(IAMMultiMediaStream { IAMMultiMediaStreamImpl *This = (IAMMultiMediaStreamImpl *)iface; - FIXME("(%p/%p)->(%p) stub!\n", This, iface, ppGraphBuilder); + FIXME("(%p/%p)->(%p) stub!\n", This, iface, ppGraphBuilder); return E_NOTIMPL; } @@ -343,7 +348,8 @@ static HRESULT WINAPI IAMMultiMediaStreamImpl_OpenFile(IAMMultiMediaStream* ifac } ret = IGraphBuilder_AddSourceFilter(This->GraphBuilder, pszFileName, pszFileName, &BaseFilter); - end: + +end: IBaseFilter_Release(BaseFilter); IFileSourceFilter_Release(SourceFilter); return ret; @@ -362,7 +368,7 @@ static HRESULT WINAPI IAMMultiMediaStreamImpl_Render(IAMMultiMediaStream* iface, { IAMMultiMediaStreamImpl *This = (IAMMultiMediaStreamImpl *)iface; - FIXME("(%p/%p)->(%x)\n", This, iface, dwFlags); + FIXME("(%p/%p)->(%x) partial stub!\n", This, iface, dwFlags); if(dwFlags != AMMSF_NOCLOCK) return E_INVALIDARG; diff --git a/dlls/amstream/mediastream.c b/dlls/amstream/mediastream.c index 01ee926..39e9a28 100644 --- a/dlls/amstream/mediastream.c +++ b/dlls/amstream/mediastream.c @@ -61,7 +61,12 @@ HRESULT MediaStream_create(IMultiMediaStream* Parent, const MSPID* pPurposeId, S TRACE("(%p,%p,%p)\n", Parent, pPurposeId, ppMediaStream); object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IMediaStreamImpl)); - + if (!object) + { + ERR("Out of memory\n"); + return E_OUTOFMEMORY; + } + object->lpVtbl.lpVtbl = &MediaStream_Vtbl; object->ref = 1; @@ -70,7 +75,7 @@ HRESULT MediaStream_create(IMultiMediaStream* Parent, const MSPID* pPurposeId, S object->StreamType = StreamType; *ppMediaStream = (IMediaStream*)object; - + return S_OK; } @@ -82,7 +87,7 @@ static HRESULT WINAPI IMediaStreamImpl_QueryInterface(IMediaStream* iface, REFII TRACE("(%p/%p)->(%s,%p)\n", iface, This, debugstr_guid(riid), ppvObject); if (IsEqualGUID(riid, &IID_IUnknown) || - IsEqualGUID(riid, &IID_IAMMultiMediaStream)) + IsEqualGUID(riid, &IID_IMediaStream)) { IClassFactory_AddRef(iface); *ppvObject = This; @@ -120,7 +125,7 @@ static HRESULT WINAPI IMediaStreamImpl_GetMultiMediaStream(IMediaStream* iface, { IMediaStreamImpl *This = (IMediaStreamImpl *)iface; - FIXME("(%p/%p)->(%p) stub!\n", This, iface, ppMultiMediaStream); + FIXME("(%p/%p)->(%p) stub!\n", This, iface, ppMultiMediaStream); return S_FALSE; } @@ -196,6 +201,11 @@ HRESULT DirectDrawMediaStream_create(IMultiMediaStream* Parent, const MSPID* pPu TRACE("(%p,%p,%p)\n", Parent, pPurposeId, ppMediaStream); object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IMediaStreamImpl)); + if (!object) + { + ERR("Out of memory\n"); + return E_OUTOFMEMORY; + } object->lpVtbl.lpVtbl = &DirectDrawMediaStream_Vtbl; object->ref = 1;
1
0
0
0
Christian Costa : amstream: Implement IDirectDrawMediaStream.
by Alexandre Julliard
15 Dec '08
15 Dec '08
Module: wine Branch: master Commit: 039c15a60aca2cff966018f87d622515037da038 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=039c15a60aca2cff966018f87…
Author: Christian Costa <titan.costa(a)wanadoo.fr> Date: Sun Dec 14 19:06:49 2008 +0100 amstream: Implement IDirectDrawMediaStream. --- dlls/amstream/amstream.c | 6 ++- dlls/amstream/amstream_private.h | 1 + dlls/amstream/mediastream.c | 125 +++++++++++++++++++++++++++++++++++++- 3 files changed, 130 insertions(+), 2 deletions(-) diff --git a/dlls/amstream/amstream.c b/dlls/amstream/amstream.c index 692403b..384b342 100644 --- a/dlls/amstream/amstream.c +++ b/dlls/amstream/amstream.c @@ -257,7 +257,11 @@ static HRESULT WINAPI IAMMultiMediaStreamImpl_AddMediaStream(IAMMultiMediaStream FIXME("(%p/%p)->(%p,%p,%x,%p) partial stub!\n", This, iface, pStreamObject, PurposeId, dwFlags, ppNewStream); - hr = MediaStream_create((IMultiMediaStream*)iface, PurposeId, This->StreamType, &pStream); + if (IsEqualGUID(PurposeId, &MSPID_PrimaryVideo)) + hr = DirectDrawMediaStream_create((IMultiMediaStream*)iface, PurposeId, This->StreamType, &pStream); + else + hr = MediaStream_create((IMultiMediaStream*)iface, PurposeId, This->StreamType, &pStream); + if (SUCCEEDED(hr)) { pNewStreams = CoTaskMemAlloc((This->nbStreams+1)*sizeof(IMediaStream*)); diff --git a/dlls/amstream/amstream_private.h b/dlls/amstream/amstream_private.h index cb457f9..d5efa6c 100644 --- a/dlls/amstream/amstream_private.h +++ b/dlls/amstream/amstream_private.h @@ -36,5 +36,6 @@ HRESULT AM_create(IUnknown *pUnkOuter, LPVOID *ppObj); HRESULT MediaStream_create(IMultiMediaStream* Parent, const MSPID* pPurposeId, STREAM_TYPE StreamType, IMediaStream** ppMediaStream); +HRESULT DirectDrawMediaStream_create(IMultiMediaStream* Parent, const MSPID* pPurposeId, STREAM_TYPE StreamType, IMediaStream** ppMediaStream); #endif /* __AMSTREAM_PRIVATE_INCLUDED__ */ diff --git a/dlls/amstream/mediastream.c b/dlls/amstream/mediastream.c index 2cb7ce6..01ee926 100644 --- a/dlls/amstream/mediastream.c +++ b/dlls/amstream/mediastream.c @@ -1,7 +1,7 @@ /* * Implementation of IMediaStream Interface * - * Copyright 2005 Christian Costa + * Copyright 2005, 2008 Christian Costa * * This file contains the (internal) driver registration functions, * driver enumeration APIs and DirectDraw creation functions. @@ -31,6 +31,8 @@ #include "amstream_private.h" #include "amstream.h" +#include "ddstream.h" + WINE_DEFAULT_DEBUG_CHANNEL(amstream); typedef struct { @@ -41,7 +43,16 @@ typedef struct { STREAM_TYPE StreamType; } IMediaStreamImpl; +typedef struct { + IDirectDrawMediaStream lpVtbl; + LONG ref; + IMultiMediaStream* Parent; + MSPID PurposeId; + STREAM_TYPE StreamType; +} IDirectDrawMediaStreamImpl; + static const struct IMediaStreamVtbl MediaStream_Vtbl; +static const struct IDirectDrawMediaStreamVtbl DirectDrawMediaStream_Vtbl; HRESULT MediaStream_create(IMultiMediaStream* Parent, const MSPID* pPurposeId, STREAM_TYPE StreamType, IMediaStream** ppMediaStream) { @@ -177,3 +188,115 @@ static const struct IMediaStreamVtbl MediaStream_Vtbl = IMediaStreamImpl_CreateSharedSample, IMediaStreamImpl_SendEndOfStream }; + +HRESULT DirectDrawMediaStream_create(IMultiMediaStream* Parent, const MSPID* pPurposeId, STREAM_TYPE StreamType, IMediaStream** ppMediaStream) +{ + IDirectDrawMediaStreamImpl* object; + + TRACE("(%p,%p,%p)\n", Parent, pPurposeId, ppMediaStream); + + object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IMediaStreamImpl)); + + object->lpVtbl.lpVtbl = &DirectDrawMediaStream_Vtbl; + object->ref = 1; + + object->Parent = Parent; + object->PurposeId = *pPurposeId; + object->StreamType = StreamType; + + *ppMediaStream = (IMediaStream*)object; + + return S_OK; +} + +static HRESULT WINAPI IDirectDrawMediaStreamImpl_QueryInterface(IDirectDrawMediaStream* iface, REFIID riid, void** ppvObject) +{ + IMediaStreamImpl *This = (IMediaStreamImpl *)iface; + + TRACE("(%p/%p)->(%s,%p)\n", iface, This, debugstr_guid(riid), ppvObject); + + if (IsEqualGUID(riid, &IID_IUnknown) || + IsEqualGUID(riid, &IID_IMediaStream) || + IsEqualGUID(riid, &IID_IDirectDrawMediaStream)) + { + IClassFactory_AddRef(iface); + *ppvObject = This; + return S_OK; + } + + ERR("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppvObject); + return E_NOINTERFACE; +} + +static HRESULT WINAPI IDirectDrawMediaStreamImpl_GetFormat(IDirectDrawMediaStream* iface, DDSURFACEDESC *pDDSDCurrent, + IDirectDrawPalette **ppDirectDrawPalette, DDSURFACEDESC *pDDSDDesired, DWORD *pdwFlags) +{ + FIXME("(%p)->(%p,%p,%p,%p) stub!\n", iface, pDDSDCurrent, ppDirectDrawPalette, pDDSDDesired, pdwFlags); + + return E_NOTIMPL; + +} + +static HRESULT WINAPI IDirectDrawMediaStreamImpl_SetFormat(IDirectDrawMediaStream* iface, const DDSURFACEDESC *pDDSurfaceDesc, + IDirectDrawPalette *pDirectDrawPalette) +{ + FIXME("(%p)->(%p,%p) stub!\n", iface, pDDSurfaceDesc, pDirectDrawPalette); + + return E_NOTIMPL; +} + +static HRESULT WINAPI IDirectDrawMediaStreamImpl_GetDirectDraw(IDirectDrawMediaStream* iface, IDirectDraw **ppDirectDraw) +{ + FIXME("(%p)->(%p) stub!\n", iface, ppDirectDraw); + + return E_NOTIMPL; +} + +static HRESULT WINAPI IDirectDrawMediaStreamImpl_SetDirectDraw(IDirectDrawMediaStream* iface, IDirectDraw *pDirectDraw) +{ + FIXME("(%p)->(%p) stub!\n", iface, pDirectDraw); + + return E_NOTIMPL; +} + +static HRESULT WINAPI IDirectDrawMediaStreamImpl_CreateSample(IDirectDrawMediaStream* iface, IDirectDrawSurface *pSurface, const RECT *pRect, + DWORD dwFlags, IDirectDrawStreamSample **ppSample) +{ + FIXME("(%p)->(%p,%p,%x,%p) stub!\n", iface, pSurface, pRect, dwFlags, ppSample); + + return E_NOTIMPL; +} + +static HRESULT WINAPI IDirectDrawMediaStreamImpl_GetTimePerFrame(IDirectDrawMediaStream* iface, STREAM_TIME *pFrameTime) +{ + FIXME("(%p)->(%p) stub!\n", iface, pFrameTime); + + return E_NOTIMPL; +} + +/* Note: Hack so we can reuse the old functions without compiler warnings */ +#if !defined(__STRICT_ANSI__) && defined(__GNUC__) +# define XCAST(fun) (typeof(DirectDrawMediaStream_Vtbl.fun)) +#else +# define XCAST(fun) (void*) +#endif + +static const struct IDirectDrawMediaStreamVtbl DirectDrawMediaStream_Vtbl = +{ + IDirectDrawMediaStreamImpl_QueryInterface, + XCAST(AddRef)IMediaStreamImpl_AddRef, + XCAST(Release)IMediaStreamImpl_Release, + XCAST(GetMultiMediaStream)IMediaStreamImpl_GetMultiMediaStream, + XCAST(GetInformation)IMediaStreamImpl_GetInformation, + XCAST(SetSameFormat)IMediaStreamImpl_SetSameFormat, + XCAST(AllocateSample)IMediaStreamImpl_AllocateSample, + XCAST(CreateSharedSample)IMediaStreamImpl_CreateSharedSample, + XCAST(SendEndOfStream)IMediaStreamImpl_SendEndOfStream, + IDirectDrawMediaStreamImpl_GetFormat, + IDirectDrawMediaStreamImpl_SetFormat, + IDirectDrawMediaStreamImpl_GetDirectDraw, + IDirectDrawMediaStreamImpl_SetDirectDraw, + IDirectDrawMediaStreamImpl_CreateSample, + IDirectDrawMediaStreamImpl_GetTimePerFrame +}; +#undef XCAST
1
0
0
0
← Newer
1
...
57
58
59
60
61
62
63
...
123
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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
Results per page:
10
25
50
100
200