From: chy chenhaoyang@kylinos.cn
--- dlls/ole32/stg_prop.c | 7 +++++++ dlls/ole32/tests/stg_prop.c | 17 +++++++++++++++++ 2 files changed, 24 insertions(+)
diff --git a/dlls/ole32/stg_prop.c b/dlls/ole32/stg_prop.c index 547d1f82335..9f94efeee3f 100644 --- a/dlls/ole32/stg_prop.c +++ b/dlls/ole32/stg_prop.c @@ -2334,6 +2334,13 @@ static HRESULT PropertyStorage_WritePropertyToStream(PropertyStorage_impl *This, bytesWritten = count + sizeof(DWORD); break; } + case VT_BOOL: + { + hr = IStream_Write(This->stm, &var->boolVal, sizeof(var->boolVal), + &count); + bytesWritten = count; + break; + } case VT_FILETIME: { FILETIME temp; diff --git a/dlls/ole32/tests/stg_prop.c b/dlls/ole32/tests/stg_prop.c index 1b08833adbe..afffd58dc09 100644 --- a/dlls/ole32/tests/stg_prop.c +++ b/dlls/ole32/tests/stg_prop.c @@ -361,6 +361,14 @@ static void testPropsHelper(IPropertySetStorage **propSetStorage) hr = IPropertyStorage_WriteMultiple(propertyStorage, 1, &spec, &var, 0); ok(hr == S_OK, "WriteMultiple failed: 0x%08lx\n", hr);
+ /* set a bool value */ + spec.ulKind = PRSPEC_PROPID; + spec.propid = PIDDSI_LINKSDIRTY; + var.vt = VT_BOOL; + var.boolVal = 23; + hr = IPropertyStorage_WriteMultiple(propertyStorage, 1, &spec, &var, 0); + ok(hr == S_OK, "WriteMultiple failed: 0x%08lx\n", hr); + hr = IPropertyStorage_Commit(propertyStorage, STGC_DEFAULT); ok(hr == S_OK, "Commit failed: 0x%08lx\n", hr);
@@ -403,6 +411,15 @@ static void testPropsHelper(IPropertySetStorage **propSetStorage) "Didn't get expected type or value for property (got type %d, value %ld)\n", var.vt, var.lVal);
+ PropVariantClear(&var); + spec.ulKind = PRSPEC_PROPID; + spec.propid = PIDDSI_LINKSDIRTY; + hr = IPropertyStorage_ReadMultiple(propertyStorage, 1, &spec, &var); + ok(hr == S_OK, "ReadMultiple failed: 0x%08lx\n", hr); + ok(var.vt == VT_BOOL && var.boolVal == 23, + "Didn't get expected type or value for property (got type %d, value %d)\n", + var.vt, var.boolVal); + IPropertyStorage_Release(propertyStorage); if(propSetStorage) IPropertySetStorage_Release(*propSetStorage); IStorage_Release(storage);