From ff6cef5d728346c740221e687cc1c9861b864b8f Mon Sep 17 00:00:00 2001 From: Alistair Leslie-Hughes Date: Thu, 13 Oct 2022 08:52:08 +1100 Subject: [PATCH] Rebase against f87ad783e23a2b6f5e9b8cf78dbf99bad4471a25. --- patches/patchinstall.sh | 6 +-- ...pi-Implement-ISpRegDataKey-CreateKey.patch | 49 ------------------ ...plement-ISpRegDataKey-GetStringValue.patch | 51 ------------------- staging/upstream-commit | 2 +- 4 files changed, 3 insertions(+), 105 deletions(-) delete mode 100644 patches/sapi-iteration-tokens/0001-sapi-Implement-ISpRegDataKey-CreateKey.patch delete mode 100644 patches/sapi-iteration-tokens/0003-sapi-Implement-ISpRegDataKey-GetStringValue.patch diff --git a/patches/patchinstall.sh b/patches/patchinstall.sh index 67dbbcbf..5894db2b 100755 --- a/patches/patchinstall.sh +++ b/patches/patchinstall.sh @@ -51,7 +51,7 @@ usage() # Get the upstream commit sha upstream_commit() { - echo "4312be1646cad32548f855e25823857092bf31dc" + echo "f87ad783e23a2b6f5e9b8cf78dbf99bad4471a25" } # Show version information @@ -2545,8 +2545,6 @@ fi # | * dlls/sapi/sapi.rgs, dlls/sapi/token.c # | if test "$enable_sapi_iteration_tokens" -eq 1; then - patch_apply sapi-iteration-tokens/0001-sapi-Implement-ISpRegDataKey-CreateKey.patch - patch_apply sapi-iteration-tokens/0003-sapi-Implement-ISpRegDataKey-GetStringValue.patch patch_apply sapi-iteration-tokens/0004-sapi-EnumTokens-setup-enumeration-members.patch patch_apply sapi-iteration-tokens/0005-sapi-Implement-ISpObjectTokenEnumBuilder-Item.patch patch_apply sapi-iteration-tokens/0007-sapi-Implement-ISpObjectToken-OpenKey.patch @@ -3722,7 +3720,7 @@ fi # | * [#44061] Check Parameter in WTHelperGetProvCertFromChain # | # | Modified files: -# | * dlls/user.exe16/window.c, dlls/wintrust/tests/softpub.c, dlls/wintrust/wintrust_main.c +# | * dlls/wintrust/tests/softpub.c, dlls/wintrust/wintrust_main.c # | if test "$enable_wintrust_WTHelperGetProvCertFromChain" -eq 1; then patch_apply wintrust-WTHelperGetProvCertFromChain/0001-wintrust-Add-parameter-check-in-WTHelperGetProvCertF.patch diff --git a/patches/sapi-iteration-tokens/0001-sapi-Implement-ISpRegDataKey-CreateKey.patch b/patches/sapi-iteration-tokens/0001-sapi-Implement-ISpRegDataKey-CreateKey.patch deleted file mode 100644 index 3bb8033d..00000000 --- a/patches/sapi-iteration-tokens/0001-sapi-Implement-ISpRegDataKey-CreateKey.patch +++ /dev/null @@ -1,49 +0,0 @@ -From 940ec28d5ed0e8d93d844be1a6148a4e63863907 Mon Sep 17 00:00:00 2001 -From: Alistair Leslie-Hughes -Date: Wed, 22 Sep 2021 19:01:44 +1000 -Subject: [PATCH 1/8] sapi: Implement ISpRegDataKey CreateKey - ---- - dlls/sapi/token.c | 26 ++++++++++++++++++++++++-- - 1 file changed, 24 insertions(+), 2 deletions(-) - -diff --git a/dlls/sapi/token.c b/dlls/sapi/token.c -index ba91a425e9e..ffdf62008f5 100644 ---- a/dlls/sapi/token.c -+++ b/dlls/sapi/token.c -@@ -145,8 +145,30 @@ static HRESULT WINAPI data_key_OpenKey( ISpRegDataKey *iface, - static HRESULT WINAPI data_key_CreateKey( ISpRegDataKey *iface, - LPCWSTR name, ISpDataKey **sub_key ) - { -- FIXME( "stub\n" ); -- return E_NOTIMPL; -+ struct data_key *This = impl_from_ISpRegDataKey( iface ); -+ ISpRegDataKey *spregkey; -+ HRESULT hr; -+ HKEY key; -+ LONG res; -+ -+ TRACE( "%p, %s, %p\n", This, debugstr_w(name), sub_key ); -+ -+ if (!This->key) return E_INVALIDARG; /* FIXME */ -+ -+ res = RegCreateKeyExW( This->key, name, 0, NULL, 0, KEY_ALL_ACCESS, NULL, &key, NULL ); -+ if (res != ERROR_SUCCESS) -+ return HRESULT_FROM_WIN32(res); -+ -+ hr = data_key_create(NULL, &IID_ISpRegDataKey, (void**)&spregkey); -+ if (hr == S_OK) -+ { -+ hr = ISpRegDataKey_SetKey(spregkey, key, FALSE); -+ if (hr == S_OK) -+ hr = ISpRegDataKey_QueryInterface(spregkey, &IID_ISpDataKey, (void**)sub_key); -+ ISpRegDataKey_Release(spregkey); -+ } -+ -+ return hr; - } - - static HRESULT WINAPI data_key_DeleteKey( ISpRegDataKey *iface, LPCWSTR name ) --- -2.33.0 - diff --git a/patches/sapi-iteration-tokens/0003-sapi-Implement-ISpRegDataKey-GetStringValue.patch b/patches/sapi-iteration-tokens/0003-sapi-Implement-ISpRegDataKey-GetStringValue.patch deleted file mode 100644 index e2d2a382..00000000 --- a/patches/sapi-iteration-tokens/0003-sapi-Implement-ISpRegDataKey-GetStringValue.patch +++ /dev/null @@ -1,51 +0,0 @@ -From c6d5ef9803d17e35a3ee1a006be1a9b21d838ac9 Mon Sep 17 00:00:00 2001 -From: Alistair Leslie-Hughes -Date: Wed, 22 Sep 2021 19:01:44 +1000 -Subject: [PATCH 3/8] sapi: Implement ISpRegDataKey GetStringValue - ---- - dlls/sapi/token.c | 28 ++++++++++++++++++++++++++-- - 1 file changed, 26 insertions(+), 2 deletions(-) - -diff --git a/dlls/sapi/token.c b/dlls/sapi/token.c -index ffdf62008f5..0a160455d2b 100644 ---- a/dlls/sapi/token.c -+++ b/dlls/sapi/token.c -@@ -117,8 +117,32 @@ static HRESULT WINAPI data_key_SetStringValue( ISpRegDataKey *iface, - static HRESULT WINAPI data_key_GetStringValue( ISpRegDataKey *iface, - LPCWSTR name, LPWSTR *value ) - { -- FIXME( "stub\n" ); -- return E_NOTIMPL; -+ struct data_key *This = impl_from_ISpRegDataKey( iface ); -+ DWORD ret, size; -+ WCHAR *content; -+ -+ FIXME( "%p, %s, %p\n", This, debugstr_w(name), value); -+ -+ if (!This->key) return E_INVALIDARG; /* FIXME */ -+ -+ size = 0; -+ ret = RegGetValueW( This->key, NULL, name, RRF_RT_REG_SZ, NULL, NULL, &size ); -+ if (ret == ERROR_FILE_NOT_FOUND) -+ return SPERR_NOT_FOUND; -+ -+ content = CoTaskMemAlloc(size); -+ if (!content) -+ return E_OUTOFMEMORY; -+ -+ ret = RegGetValueW( This->key, NULL, name, RRF_RT_REG_SZ, NULL, content, &size ); -+ if (ret != ERROR_SUCCESS) -+ { -+ CoTaskMemFree(content); -+ return HRESULT_FROM_WIN32(ret); -+ } -+ -+ *value = content; -+ return S_OK; - } - - static HRESULT WINAPI data_key_SetDWORD( ISpRegDataKey *iface, --- -2.33.0 - diff --git a/staging/upstream-commit b/staging/upstream-commit index 39cda020..9540d207 100644 --- a/staging/upstream-commit +++ b/staging/upstream-commit @@ -1 +1 @@ -4312be1646cad32548f855e25823857092bf31dc +f87ad783e23a2b6f5e9b8cf78dbf99bad4471a25