Rebase against 16c6c249a5134de2422fbd3471ead7425c968301.

This commit is contained in:
Zebediah Figura
2022-10-10 22:27:34 -05:00
parent 0ea57a0262
commit e6f9a449cd
13 changed files with 58 additions and 636 deletions

View File

@@ -1,17 +1,17 @@
From 9642c43791d10664565e11fb11f9e6165eb4cef6 Mon Sep 17 00:00:00 2001
From 8e0713bfe03d37f19c2645a67b05024a86df0af8 Mon Sep 17 00:00:00 2001
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Date: Wed, 22 Sep 2021 19:01:44 +1000
Subject: [PATCH 5/8] sapi: Implement ISpObjectTokenEnumBuilder Item
Subject: [PATCH] sapi: Implement ISpObjectTokenEnumBuilder Item
---
dlls/sapi/token.c | 67 ++++++++++++++++++++++++++++++++++++-----------
1 file changed, 52 insertions(+), 15 deletions(-)
dlls/sapi/token.c | 69 ++++++++++++++++++++++++++++++++++++-----------
1 file changed, 53 insertions(+), 16 deletions(-)
diff --git a/dlls/sapi/token.c b/dlls/sapi/token.c
index 6bf66bc0d5b..d16478d0064 100644
index c16572ff1f2..eb6d746cb04 100644
--- a/dlls/sapi/token.c
+++ b/dlls/sapi/token.c
@@ -64,6 +64,19 @@ static struct token_enum *impl_from_ISpObjectTokenEnumBuilder( ISpObjectTokenEnu
@@ -64,6 +64,20 @@ static struct token_enum *impl_from_ISpObjectTokenEnumBuilder( ISpObjectTokenEnu
return CONTAINING_RECORD( iface, struct token_enum, ISpObjectTokenEnumBuilder_iface );
}
@@ -21,6 +21,7 @@ index 6bf66bc0d5b..d16478d0064 100644
+ LONG ref;
+
+ HKEY token_key;
+ WCHAR *token_id;
+};
+
+static struct object_token *impl_from_ISpObjectToken( ISpObjectToken *iface )
@@ -31,7 +32,7 @@ index 6bf66bc0d5b..d16478d0064 100644
static HRESULT WINAPI data_key_QueryInterface( ISpRegDataKey *iface, REFIID iid, void **obj )
{
struct data_key *This = impl_from_ISpRegDataKey( iface );
@@ -725,8 +738,45 @@ static HRESULT WINAPI token_enum_Clone( ISpObjectTokenEnumBuilder *iface,
@@ -725,8 +739,45 @@ static HRESULT WINAPI token_enum_Clone( ISpObjectTokenEnumBuilder *iface,
static HRESULT WINAPI token_enum_Item( ISpObjectTokenEnumBuilder *iface,
ULONG index, ISpObjectToken **token )
{
@@ -79,7 +80,7 @@ index 6bf66bc0d5b..d16478d0064 100644
}
static HRESULT WINAPI token_enum_GetCount( ISpObjectTokenEnumBuilder *iface,
@@ -837,19 +887,6 @@ HRESULT token_enum_create( IUnknown *outer, REFIID iid, void **obj )
@@ -838,20 +889,6 @@ HRESULT token_enum_create( IUnknown *outer, REFIID iid, void **obj )
return hr;
}
@@ -89,6 +90,7 @@ index 6bf66bc0d5b..d16478d0064 100644
- LONG ref;
-
- HKEY token_key;
- WCHAR *token_id;
-};
-
-static struct object_token *impl_from_ISpObjectToken( ISpObjectToken *iface )
@@ -100,5 +102,5 @@ index 6bf66bc0d5b..d16478d0064 100644
REFIID iid, void **obj )
{
--
2.33.0
2.35.1

View File

@@ -1,114 +0,0 @@
From 614d8a2d74f7b5e7fdd2739741dc0fc42e57eebd Mon Sep 17 00:00:00 2001
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Date: Wed, 22 Sep 2021 19:01:44 +1000
Subject: [PATCH] sapi: Implement ISpObjectToken GetId
---
dlls/sapi/tests/token.c | 7 ++++---
dlls/sapi/token.c | 27 ++++++++++++++++++++++++---
2 files changed, 28 insertions(+), 6 deletions(-)
diff --git a/dlls/sapi/tests/token.c b/dlls/sapi/tests/token.c
index 9473d56b4d1..260e059127d 100644
--- a/dlls/sapi/tests/token.c
+++ b/dlls/sapi/tests/token.c
@@ -185,11 +185,11 @@ static void test_object_token(void)
ok( hr == S_OK, "got %08lx\n", hr );
hr = ISpObjectToken_GetId( token, NULL );
- todo_wine ok( hr == SPERR_UNINITIALIZED, "got %08lx\n", hr );
+ ok( hr == SPERR_UNINITIALIZED, "got %08lx\n", hr );
tempW = (LPWSTR)0xdeadbeef;
hr = ISpObjectToken_GetId( token, &tempW );
- todo_wine ok( hr == SPERR_UNINITIALIZED, "got %08lx\n", hr );
+ ok( hr == SPERR_UNINITIALIZED, "got %08lx\n", hr );
ok( tempW == (LPWSTR)0xdeadbeef, "got %s\n", wine_dbgstr_w(tempW) );
hr = ISpObjectToken_GetCategory( token, NULL );
@@ -220,7 +220,7 @@ static void test_object_token(void)
ok( hr == SPERR_ALREADY_INITIALIZED, "got %08lx\n", hr );
hr = ISpObjectToken_GetId( token, NULL );
- todo_wine ok( hr == E_POINTER, "got %08lx\n", hr );
+ ok( hr == E_POINTER, "got %08lx\n", hr );
hr = ISpObjectToken_GetCategory( token, NULL );
todo_wine ok( hr == E_POINTER, "got %08lx\n", hr );
@@ -297,6 +297,7 @@ static void test_object_token(void)
ISpObjectToken_Release( token );
}
+
START_TEST(token)
{
CoInitialize( NULL );
diff --git a/dlls/sapi/token.c b/dlls/sapi/token.c
index a514b2995b4..e0fbf200d65 100644
--- a/dlls/sapi/token.c
+++ b/dlls/sapi/token.c
@@ -70,6 +70,7 @@ struct object_token
LONG ref;
HKEY token_key;
+ WCHAR *token_id;
};
static struct object_token *impl_from_ISpObjectToken( ISpObjectToken *iface )
@@ -765,7 +766,6 @@ static HRESULT WINAPI token_enum_Item( ISpObjectTokenEnumBuilder *iface,
ret = RegOpenKeyExW (This->key, subkey, 0, KEY_READ, &key);
if (ret != ERROR_SUCCESS)
return HRESULT_FROM_WIN32(ret);
- heap_free(subkey);
hr = token_create( NULL, &IID_ISpObjectToken, (void**)&subtoken );
if (FAILED(hr))
@@ -773,6 +773,7 @@ static HRESULT WINAPI token_enum_Item( ISpObjectTokenEnumBuilder *iface,
object = impl_from_ISpObjectToken( subtoken );
object->token_key = key;
+ object->token_id = subkey;
*token = subtoken;
@@ -927,6 +928,7 @@ static ULONG WINAPI token_Release( ISpObjectToken *iface )
if (!ref)
{
if (This->token_key) RegCloseKey( This->token_key );
+ heap_free(This->token_id);
heap_free( This );
}
@@ -1053,8 +1055,27 @@ static HRESULT WINAPI token_SetId( ISpObjectToken *iface,
static HRESULT WINAPI token_GetId( ISpObjectToken *iface,
LPWSTR *token_id )
{
- FIXME( "stub\n" );
- return E_NOTIMPL;
+ struct object_token *This = impl_from_ISpObjectToken( iface );
+
+ TRACE( "%p, %p\n", This, token_id);
+
+ if (!This->token_key)
+ return SPERR_UNINITIALIZED;
+
+ if (!token_id)
+ return E_POINTER;
+
+ if (!This->token_id)
+ {
+ FIXME("Loading default category not supported.\n");
+ return E_POINTER;
+ }
+ *token_id = CoTaskMemAlloc( (wcslen(This->token_id) + 1) * sizeof(WCHAR));
+ if (!*token_id)
+ return E_OUTOFMEMORY;
+
+ wcscpy(*token_id, This->token_id);
+ return S_OK;
}
static HRESULT WINAPI token_GetCategory( ISpObjectToken *iface,
--
2.34.1