Wine-Devel
By thread
wine-devel@list.winehq.org
By month
Messages by month
- ----- 2026 -----
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- 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
June 2018
- 68 participants
- 1149 messages
[PATCH 4/4] widl: Generate correct size and alignment for all types.
by Zebediah Figura
Using type_memsize_and_alignment() directly instead of reimplementing it.
Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com>
---
dlls/oleaut32/tests/typelib.c | 13 ------
tools/widl/typegen.c | 5 +--
tools/widl/typegen.h | 1 +
tools/widl/write_msft.c | 95 +++++++++----------------------------------
4 files changed, 23 insertions(+), 91 deletions(-)
diff --git a/dlls/oleaut32/tests/typelib.c b/dlls/oleaut32/tests/typelib.c
index 7c35e87..4d5314e 100644
--- a/dlls/oleaut32/tests/typelib.c
+++ b/dlls/oleaut32/tests/typelib.c
@@ -4724,21 +4724,8 @@ static void test_dump_typelib(const char *name)
ole_check(ITypeInfo_GetTypeAttr(typeinfo, &typeattr));
expect_int(typeattr->typekind, ti->type);
expect_hex(typeattr->wTypeFlags, ti->wTypeFlags);
- /* FIXME: remove once widl is fixed */
- if (typeattr->typekind == TKIND_ALIAS && typeattr->cbAlignment != ti->cbAlignment)
- {
-todo_wine /* widl generates broken typelib and typeattr just reflects that */
- ok(typeattr->cbAlignment == ti->cbAlignment || broken(typeattr->cbAlignment == 1),
- "expected %d, got %d\n", ti->cbAlignment, typeattr->cbAlignment);
-todo_wine /* widl generates broken typelib and typeattr just reflects that */
- ok(typeattr->cbSizeInstance == ti->cbSizeInstance || broken(typeattr->cbSizeInstance == 0),
- "expected %d, got %d\n", ti->cbSizeInstance, typeattr->cbSizeInstance);
- }
- else
- {
expect_int(typeattr->cbAlignment, ti->cbAlignment);
expect_int(typeattr->cbSizeInstance, ti->cbSizeInstance);
- }
expect_int(help_ctx, ti->help_ctx);
expect_int(MAKELONG(typeattr->wMinorVerNum, typeattr->wMajorVerNum), ti->version);
expect_int(typeattr->cbSizeVft, ti->cbSizeVft * sizeof(void*));
diff --git a/tools/widl/typegen.c b/tools/widl/typegen.c
index 9f62589..38cbfa0 100644
--- a/tools/widl/typegen.c
+++ b/tools/widl/typegen.c
@@ -84,7 +84,6 @@ static const unsigned short IsSimpleRef = 0x0100;
static unsigned int field_memsize(const type_t *type, unsigned int *offset);
static unsigned int fields_memsize(const var_list_t *fields, unsigned int *align);
-static unsigned int type_memsize_and_alignment(const type_t *t, unsigned int *align);
static unsigned int write_array_tfs(FILE *file, const attr_list_t *attrs, type_t *type,
const char *name, unsigned int *typestring_offset);
static unsigned int write_struct_tfs(FILE *file, type_t *type, const char *name, unsigned int *tfsoff);
@@ -1841,7 +1840,7 @@ static unsigned int union_memsize(const var_list_t *fields, unsigned int *pmaxa)
return maxs;
}
-static unsigned int type_memsize_and_alignment(const type_t *t, unsigned int *align)
+unsigned int type_memsize_and_alignment(const type_t *t, unsigned int *align)
{
unsigned int size = 0;
@@ -1910,6 +1909,7 @@ static unsigned int type_memsize_and_alignment(const type_t *t, unsigned int *al
size = union_memsize(type_union_get_cases(t), align);
break;
case TYPE_POINTER:
+ case TYPE_INTERFACE:
assert( pointer_size );
size = pointer_size;
if (size > *align) *align = size;
@@ -1933,7 +1933,6 @@ static unsigned int type_memsize_and_alignment(const type_t *t, unsigned int *al
if (size > *align) *align = size;
}
break;
- case TYPE_INTERFACE:
case TYPE_ALIAS:
case TYPE_VOID:
case TYPE_COCLASS:
diff --git a/tools/widl/typegen.h b/tools/widl/typegen.h
index b6540e2..95ad601 100644
--- a/tools/widl/typegen.h
+++ b/tools/widl/typegen.h
@@ -100,3 +100,4 @@ unsigned char get_basic_fc(const type_t *type);
unsigned char get_pointer_fc(const type_t *type, const attr_list_t *attrs, int toplevel_param);
unsigned char get_struct_fc(const type_t *type);
enum typegen_type typegen_detect_type(const type_t *type, const attr_list_t *attrs, unsigned int flags);
+unsigned int type_memsize_and_alignment(const type_t *t, unsigned int *align);
diff --git a/tools/widl/write_msft.c b/tools/widl/write_msft.c
index f7e53e4..b1f467d 100644
--- a/tools/widl/write_msft.c
+++ b/tools/widl/write_msft.c
@@ -52,6 +52,7 @@
#include "hash.h"
#include "typetree.h"
#include "parser.h"
+#include "typegen.h"
enum MSFT_segment_index {
MSFT_SEG_TYPEINFO = 0, /* type information */
@@ -780,8 +781,6 @@ static int encode_type(
int vt, /* [I] vt to encode */
type_t *type, /* [I] type */
int *encoded_type, /* [O] The encoded type description. */
- int *width, /* [O] The width of the type, or NULL. */
- int *alignment, /* [O] The alignment of the type, or NULL. */
int *decoded_size) /* [O] The total size of the unencoded TYPEDESCs, including nested descs. */
{
int default_type;
@@ -794,8 +793,6 @@ static int encode_type(
chat("encode_type vt %d type %p\n", vt, type);
default_type = 0x80000000 | (vt << 16) | vt;
- if (!width) width = &scratch;
- if (!alignment) alignment = &scratch;
if (!decoded_size) decoded_size = &scratch;
*decoded_size = 0;
@@ -804,38 +801,20 @@ static int encode_type(
case VT_I1:
case VT_UI1:
*encoded_type = default_type;
- *width = 1;
- *alignment = 1;
break;
case VT_INT:
*encoded_type = 0x80000000 | (VT_I4 << 16) | VT_INT;
- if ((typelib->typelib_header.varflags & 0x0f) == SYS_WIN16) {
- *width = 2;
- *alignment = 2;
- } else {
- *width = 4;
- *alignment = 4;
- }
break;
case VT_UINT:
*encoded_type = 0x80000000 | (VT_UI4 << 16) | VT_UINT;
- if ((typelib->typelib_header.varflags & 0x0f) == SYS_WIN16) {
- *width = 2;
- *alignment = 2;
- } else {
- *width = 4;
- *alignment = 4;
- }
break;
case VT_UI2:
case VT_I2:
case VT_BOOL:
*encoded_type = default_type;
- *width = 2;
- *alignment = 2;
break;
case VT_I4:
@@ -844,56 +823,40 @@ static int encode_type(
case VT_ERROR:
case VT_HRESULT:
*encoded_type = default_type;
- *width = 4;
- *alignment = 4;
break;
case VT_R8:
case VT_I8:
case VT_UI8:
*encoded_type = default_type;
- *width = 8;
- *alignment = 8;
break;
case VT_CY:
case VT_DATE:
*encoded_type = default_type;
- *width = 8;
- *alignment = 8;
break;
case VT_DECIMAL:
*encoded_type = default_type;
- *width = 16;
- *alignment = 8;
break;
case VT_VOID:
*encoded_type = 0x80000000 | (VT_EMPTY << 16) | vt;
- *width = 0;
- *alignment = 1;
break;
case VT_UNKNOWN:
case VT_DISPATCH:
case VT_BSTR:
*encoded_type = default_type;
- *width = pointer_size;
- *alignment = 4;
break;
case VT_VARIANT:
*encoded_type = default_type;
- *width = 8 + 2 * pointer_size;
- *alignment = 8;
break;
case VT_LPSTR:
case VT_LPWSTR:
*encoded_type = 0xfffe0000 | vt;
- *width = pointer_size;
- *alignment = 4;
break;
case VT_PTR:
@@ -909,14 +872,12 @@ static int encode_type(
next_vt = VT_VOID;
encode_type(typelib, next_vt, type_pointer_get_ref(type),
- &target_type, NULL, NULL, &child_size);
+ &target_type, &child_size);
/* these types already have an implicit pointer, so we don't need to
* add another */
if(next_vt == VT_DISPATCH || next_vt == VT_UNKNOWN) {
chat("encode_type: skipping ptr\n");
*encoded_type = target_type;
- *width = pointer_size;
- *alignment = 4;
*decoded_size = child_size;
break;
}
@@ -945,8 +906,6 @@ static int encode_type(
*encoded_type = typeoffset;
- *width = pointer_size;
- *alignment = 4;
*decoded_size = 8 /*sizeof(TYPEDESC)*/ + child_size;
break;
}
@@ -956,7 +915,8 @@ static int encode_type(
type_t *element_type = type_alias_get_aliasee(type_array_get_element(type));
int next_vt = get_type_vt(element_type);
- encode_type(typelib, next_vt, type_alias_get_aliasee(type_array_get_element(type)), &target_type, NULL, NULL, &child_size);
+ encode_type(typelib, next_vt, type_alias_get_aliasee(type_array_get_element(type)),
+ &target_type, &child_size);
for (typeoffset = 0; typeoffset < typelib->typelib_segdir[MSFT_SEG_TYPEDESC].length; typeoffset += 8) {
typedata = (void *)&typelib->typelib_segment_data[MSFT_SEG_TYPEDESC][typeoffset];
@@ -982,8 +942,6 @@ static int encode_type(
*encoded_type = typeoffset;
- *width = pointer_size;
- *alignment = 4;
*decoded_size = 8 /*sizeof(TYPEDESC)*/ + child_size;
break;
}
@@ -1053,16 +1011,12 @@ static int encode_type(
}
*encoded_type = typeoffset;
- *width = 0;
- *alignment = 1;
break;
}
default:
error("encode_type: unrecognized type %d.\n", vt);
*encoded_type = default_type;
- *width = 0;
- *alignment = 1;
break;
}
@@ -1079,8 +1033,6 @@ static int encode_var(
type_t *type, /* [I] The type description to encode. */
var_t *var, /* [I] The var to encode. */
int *encoded_type, /* [O] The encoded type description. */
- int *width, /* [O] The width of the type, or NULL. */
- int *alignment, /* [O] The alignment of the type, or NULL. */
int *decoded_size) /* [O] The total size of the unencoded TYPEDESCs, including nested descs. */
{
int typeoffset;
@@ -1090,8 +1042,6 @@ static int encode_var(
int vt;
int scratch;
- if (!width) width = &scratch;
- if (!alignment) alignment = &scratch;
if (!decoded_size) decoded_size = &scratch;
*decoded_size = 0;
@@ -1110,7 +1060,7 @@ static int encode_var(
++num_dims;
chat("array with %d dimensions\n", num_dims);
- encode_var(typelib, atype, var, &target_type, width, alignment, NULL);
+ encode_var(typelib, atype, var, &target_type, NULL);
arrayoffset = ctl2_alloc_segment(typelib, MSFT_SEG_ARRAYDESC, (2 + 2 * num_dims) * sizeof(int), 0);
arraydata = (void *)&typelib->typelib_segment_data[MSFT_SEG_ARRAYDESC][arrayoffset];
@@ -1136,7 +1086,6 @@ static int encode_var(
typedata[1] = arrayoffset;
*encoded_type = typeoffset;
- *width = *width * elements;
*decoded_size = 20 /*sizeof(ARRAYDESC)*/ + (num_dims - 1) * 8 /*sizeof(SAFEARRAYBOUND)*/;
return 0;
}
@@ -1145,15 +1094,12 @@ static int encode_var(
if (vt == VT_PTR) {
type_t *ref = is_ptr(type) ?
type_pointer_get_ref(type) : type_array_get_element(type);
- int skip_ptr = encode_var(typelib, ref, var,
- &target_type, NULL, NULL, &child_size);
+ int skip_ptr = encode_var(typelib, ref, var, &target_type, &child_size);
if(skip_ptr == 2) {
chat("encode_var: skipping ptr\n");
*encoded_type = target_type;
*decoded_size = child_size;
- *width = pointer_size;
- *alignment = 4;
return 0;
}
@@ -1184,15 +1130,13 @@ static int encode_var(
*encoded_type = typeoffset;
- *width = pointer_size;
- *alignment = 4;
*decoded_size = 8 /*sizeof(TYPEDESC)*/ + child_size;
return 0;
}
dump_type(type);
- encode_type(typelib, vt, type, encoded_type, width, alignment, decoded_size);
+ encode_type(typelib, vt, type, encoded_type, decoded_size);
/* these types already have an implicit pointer, so we don't need to
* add another */
if(vt == VT_DISPATCH || vt == VT_UNKNOWN) return 2;
@@ -1504,7 +1448,8 @@ static HRESULT add_func_desc(msft_typeinfo_t* typeinfo, var_t *func, int index)
/* fill out the basic type information */
typedata[0] = typedata_size | (index << 16);
- encode_var(typeinfo->typelib, type_function_get_rettype(func->type), func, &typedata[1], NULL, NULL, &decoded_size);
+ encode_var(typeinfo->typelib, type_function_get_rettype(func->type), func,
+ &typedata[1], &decoded_size);
typedata[2] = funcflags;
typedata[3] = ((52 /*sizeof(FUNCDESC)*/ + decoded_size) << 16) | typeinfo->typeinfo->cbSizeVft;
typedata[4] = (next_idx << 16) | (callconv << 8) | (invokekind << 3) | funckind;
@@ -1541,7 +1486,7 @@ static HRESULT add_func_desc(msft_typeinfo_t* typeinfo, var_t *func, int index)
if(defaultdata) *defaultdata = -1;
- encode_var(typeinfo->typelib, arg->type, arg, paramdata, NULL, NULL, &decoded_size);
+ encode_var(typeinfo->typelib, arg->type, arg, paramdata, &decoded_size);
if (arg->attrs) LIST_FOR_EACH_ENTRY( attr, arg->attrs, const attr_t, entry ) {
switch(attr->type) {
case ATTR_DEFAULTVALUE:
@@ -1667,8 +1612,7 @@ static HRESULT add_var_desc(msft_typeinfo_t *typeinfo, UINT index, var_t* var)
int offset, id;
unsigned int typedata_size;
INT *typedata;
- int var_datawidth;
- int var_alignment;
+ unsigned int var_datawidth, var_alignment = 0;
int var_type_size, var_kind = 0 /* VAR_PERINSTANCE */;
int alignment;
int varflags = 0;
@@ -1770,8 +1714,8 @@ static HRESULT add_var_desc(msft_typeinfo_t *typeinfo, UINT index, var_t* var)
typeinfo->var_offsets[var_num] = offset;
/* figure out type widths and whatnot */
- encode_var(typeinfo->typelib, var->type, var, &typedata[1], &var_datawidth,
- &var_alignment, &var_type_size);
+ var_datawidth = type_memsize_and_alignment(var->type, &var_alignment);
+ encode_var(typeinfo->typelib, var->type, var, &typedata[1], &var_type_size);
/* pad out starting position to data width */
typeinfo->datawidth += var_alignment - 1;
@@ -1795,7 +1739,6 @@ static HRESULT add_var_desc(msft_typeinfo_t *typeinfo, UINT index, var_t* var)
case TKIND_DISPATCH:
var_kind = 3; /* VAR_DISPATCH */
typeinfo->datawidth = pointer_size;
- var_alignment = 4;
break;
default:
error("add_var_desc: unhandled type kind %d\n", typeinfo->typekind);
@@ -2073,7 +2016,7 @@ static void add_dispinterface_typeinfo(msft_typelib_t *typelib, type_t *dispinte
dispinterface->attrs);
msft_typeinfo->typeinfo->size = pointer_size;
- msft_typeinfo->typeinfo->typekind |= 0x2100;
+ msft_typeinfo->typeinfo->typekind |= pointer_size << 11 | pointer_size << 6;
msft_typeinfo->typeinfo->flags |= 0x1000; /* TYPEFLAG_FDISPATCHABLE */
add_dispatch(typelib);
@@ -2162,7 +2105,8 @@ static void add_interface_typeinfo(msft_typelib_t *typelib, type_t *interface)
interface->typelib_idx = typelib->typelib_header.nrtypeinfos;
msft_typeinfo = create_msft_typeinfo(typelib, TKIND_INTERFACE, interface->name, interface->attrs);
msft_typeinfo->typeinfo->size = pointer_size;
- msft_typeinfo->typeinfo->typekind |= 0x2200;
+ msft_typeinfo->typeinfo->typekind |= 0x0200;
+ msft_typeinfo->typeinfo->typekind |= pointer_size << 11;
for (derived = inherit; derived; derived = type_iface_get_inherit(derived))
if (derived->name && !strcmp(derived->name, "IDispatch"))
@@ -2247,7 +2191,8 @@ static void add_union_typeinfo(msft_typelib_t *typelib, type_t *tunion)
static void add_typedef_typeinfo(msft_typelib_t *typelib, type_t *tdef)
{
msft_typeinfo_t *msft_typeinfo = NULL;
- int alignment, datatype1, datatype2, size, duplicate = 0;
+ int datatype1, datatype2, duplicate = 0;
+ unsigned int size, alignment = 0;
type_t *type;
if (-1 < tdef->typelib_idx)
@@ -2263,8 +2208,8 @@ static void add_typedef_typeinfo(msft_typelib_t *typelib, type_t *tdef)
else
duplicate = 1;
- encode_type(typelib, get_type_vt(type), type,
- &datatype1, &size, &alignment, &datatype2);
+ encode_type(typelib, get_type_vt(type), type, &datatype1, &datatype2);
+ size = type_memsize_and_alignment(type, &alignment);
if (msft_typeinfo)
{
--
2.7.4
June 3, 2018
[PATCH 3/4] stdole2.idl: Use more accurate sizes for Automation types.
by Zebediah Figura
Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com>
---
include/stdole2.idl | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/include/stdole2.idl b/include/stdole2.idl
index 18c402a..d372384 100644
--- a/include/stdole2.idl
+++ b/include/stdole2.idl
@@ -32,15 +32,15 @@
]
library stdole
{
- /* typedefs aren't stored in the type library.
- These type names are known by the type compiler so it
- doesn't really matter what we define them as. */
-
+ /* These typedefs need to have the same size as their real counterparts. */
typedef short VARIANT_BOOL;
- typedef long BSTR;
+ typedef void *BSTR;
typedef double CURRENCY;
typedef unsigned long HRESULT;
- typedef void *VARIANT;
+ typedef struct {
+ short word1, word2, word3, word4;
+ void *ptr1, *ptr2;
+ } VARIANT;
typedef unsigned long SCODE;
typedef struct GUID {
--
2.7.4
June 3, 2018
[PATCH 2/4] oleaut32/tests: Fix size and alignment for typedefs on 64-bit.
by Zebediah Figura
Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com>
---
dlls/oleaut32/tests/typelib.c | 30 ++++++++++++++++++------------
1 file changed, 18 insertions(+), 12 deletions(-)
diff --git a/dlls/oleaut32/tests/typelib.c b/dlls/oleaut32/tests/typelib.c
index e4fe91e..7c35e87 100644
--- a/dlls/oleaut32/tests/typelib.c
+++ b/dlls/oleaut32/tests/typelib.c
@@ -3951,8 +3951,11 @@ static char *print_size(BSTR name, TYPEATTR *attr)
sprintf(buf, "sizeof(union %s)", dump_string(name));
break;
- case TKIND_ENUM:
case TKIND_ALIAS:
+ sprintf(buf, "sizeof(%s)", dump_string(name));
+ break;
+
+ case TKIND_ENUM:
sprintf(buf, "4");
break;
@@ -3983,8 +3986,11 @@ static char *print_align(BSTR name, TYPEATTR *attr)
sprintf(buf, "TYPE_ALIGNMENT(union %s)", dump_string(name));
break;
- case TKIND_ENUM:
case TKIND_ALIAS:
+ sprintf(buf, "TYPE_ALIGNMENT(%s)", dump_string(name));
+ break;
+
+ case TKIND_ENUM:
sprintf(buf, "4");
break;
@@ -4283,13 +4289,13 @@ static const type_info info[] = {
{
"n",
"{016fe2ec-b2c8-45f8-b23b-39e53a753902}",
- /*kind*/ TKIND_ALIAS, /*flags*/ TYPEFLAG_FHIDDEN, /*align*/ 4, /*size*/ 4,
+ /*kind*/ TKIND_ALIAS, /*flags*/ TYPEFLAG_FHIDDEN, /*align*/ TYPE_ALIGNMENT(n), /*size*/ sizeof(n),
/*helpctx*/ 0x0000, /*version*/ 0x00000000, /*#vtbl*/ 0, /*#func*/ 0
},
{
"nn",
"{00000000-0000-0000-0000-000000000000}",
- /*kind*/ TKIND_ALIAS, /*flags*/ 0, /*align*/ 4, /*size*/ 4,
+ /*kind*/ TKIND_ALIAS, /*flags*/ 0, /*align*/ TYPE_ALIGNMENT(nn), /*size*/ sizeof(nn),
/*helpctx*/ 0x0003, /*version*/ 0x00010002, /*#vtbl*/ 0, /*#func*/ 0
},
{
@@ -4301,13 +4307,13 @@ static const type_info info[] = {
{
"m",
"{016fe2ec-b2c8-45f8-b23b-39e53a753905}",
- /*kind*/ TKIND_ALIAS, /*flags*/ TYPEFLAG_FHIDDEN, /*align*/ 4, /*size*/ 4,
+ /*kind*/ TKIND_ALIAS, /*flags*/ TYPEFLAG_FHIDDEN, /*align*/ TYPE_ALIGNMENT(m), /*size*/ sizeof(m),
/*helpctx*/ 0x0000, /*version*/ 0x00010002, /*#vtbl*/ 0, /*#func*/ 0
},
{
"mm",
"{00000000-0000-0000-0000-000000000000}",
- /*kind*/ TKIND_ALIAS, /*flags*/ 0, /*align*/ 4, /*size*/ 4,
+ /*kind*/ TKIND_ALIAS, /*flags*/ 0, /*align*/ TYPE_ALIGNMENT(mm), /*size*/ sizeof(mm),
/*helpctx*/ 0x0003, /*version*/ 0x00000000, /*#vtbl*/ 0, /*#func*/ 0
},
{
@@ -4487,13 +4493,13 @@ static const type_info info[] = {
{
"t_INT",
"{016fe2ec-b2c8-45f8-b23b-39e53a75396a}",
- /*kind*/ TKIND_ALIAS, /*flags*/ TYPEFLAG_FRESTRICTED, /*align*/ 4, /*size*/ 4,
+ /*kind*/ TKIND_ALIAS, /*flags*/ TYPEFLAG_FRESTRICTED, /*align*/ TYPE_ALIGNMENT(t_INT), /*size*/ sizeof(t_INT),
/*helpctx*/ 0x0000, /*version*/ 0x00000000, /*#vtbl*/ 0, /*#func*/ 0
},
{
"a",
"{00000000-0000-0000-0000-000000000000}",
- /*kind*/ TKIND_ALIAS, /*flags*/ 0, /*align*/ 4, /*size*/ 4,
+ /*kind*/ TKIND_ALIAS, /*flags*/ 0, /*align*/ TYPE_ALIGNMENT(a), /*size*/ sizeof(a),
/*helpctx*/ 0x0000, /*version*/ 0x00000000, /*#vtbl*/ 0, /*#func*/ 0
},
{
@@ -4523,7 +4529,7 @@ static const type_info info[] = {
{
"c",
"{016fe2ec-b2c8-45f8-b23b-39e53a75396b}",
- /*kind*/ TKIND_ALIAS, /*flags*/ 0, /*align*/ 4, /*size*/ 4,
+ /*kind*/ TKIND_ALIAS, /*flags*/ 0, /*align*/ TYPE_ALIGNMENT(c), /*size*/ sizeof(c),
/*helpctx*/ 0x0000, /*version*/ 0x00000000, /*#vtbl*/ 0, /*#func*/ 0
},
{
@@ -4541,7 +4547,7 @@ static const type_info info[] = {
{
"d",
"{016fe2ec-b2c8-45f8-b23b-39e53a75396d}",
- /*kind*/ TKIND_ALIAS, /*flags*/ TYPEFLAG_FRESTRICTED|TYPEFLAG_FHIDDEN, /*align*/ 4, /*size*/ 4,
+ /*kind*/ TKIND_ALIAS, /*flags*/ TYPEFLAG_FRESTRICTED|TYPEFLAG_FHIDDEN, /*align*/ TYPE_ALIGNMENT(d), /*size*/ sizeof(d),
/*helpctx*/ 0x0000, /*version*/ 0x00000000, /*#vtbl*/ 0, /*#func*/ 0
},
{
@@ -4559,7 +4565,7 @@ static const type_info info[] = {
{
"e",
"{016fe2ec-b2c8-45f8-b23b-39e53a753970}",
- /*kind*/ TKIND_ALIAS, /*flags*/ TYPEFLAG_FRESTRICTED|TYPEFLAG_FHIDDEN, /*align*/ 4, /*size*/ 4,
+ /*kind*/ TKIND_ALIAS, /*flags*/ TYPEFLAG_FRESTRICTED|TYPEFLAG_FHIDDEN, /*align*/ TYPE_ALIGNMENT(e), /*size*/ sizeof(e),
/*helpctx*/ 0x0000, /*version*/ 0x00000000, /*#vtbl*/ 0, /*#func*/ 0
},
{
@@ -4577,7 +4583,7 @@ static const type_info info[] = {
{
"f",
"{016fe2ec-b2c8-45f8-b23b-39e53a753972}",
- /*kind*/ TKIND_ALIAS, /*flags*/ TYPEFLAG_FRESTRICTED|TYPEFLAG_FHIDDEN, /*align*/ 4, /*size*/ 4,
+ /*kind*/ TKIND_ALIAS, /*flags*/ TYPEFLAG_FRESTRICTED|TYPEFLAG_FHIDDEN, /*align*/ TYPE_ALIGNMENT(f), /*size*/ sizeof(f),
/*helpctx*/ 0x0000, /*version*/ 0x00000000, /*#vtbl*/ 0, /*#func*/ 0
},
{
--
2.7.4
June 3, 2018
[PATCH 1/4] oleaut32/tests: Fix alignment for generated tests on 64-bit.
by Zebediah Figura
Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com>
---
dlls/oleaut32/tests/typelib.c | 66 ++++++++++++++++++++++++++++++++-----------
1 file changed, 49 insertions(+), 17 deletions(-)
diff --git a/dlls/oleaut32/tests/typelib.c b/dlls/oleaut32/tests/typelib.c
index f4ad8f9..e4fe91e 100644
--- a/dlls/oleaut32/tests/typelib.c
+++ b/dlls/oleaut32/tests/typelib.c
@@ -3964,6 +3964,38 @@ static char *print_size(BSTR name, TYPEATTR *attr)
return buf;
}
+static char *print_align(BSTR name, TYPEATTR *attr)
+{
+ static char buf[256];
+
+ switch (attr->typekind)
+ {
+ case TKIND_DISPATCH:
+ case TKIND_INTERFACE:
+ sprintf(buf, "TYPE_ALIGNMENT(%s*)", dump_string(name));
+ break;
+
+ case TKIND_RECORD:
+ sprintf(buf, "TYPE_ALIGNMENT(struct %s)", dump_string(name));
+ break;
+
+ case TKIND_UNION:
+ sprintf(buf, "TYPE_ALIGNMENT(union %s)", dump_string(name));
+ break;
+
+ case TKIND_ENUM:
+ case TKIND_ALIAS:
+ sprintf(buf, "4");
+ break;
+
+ default:
+ assert(0);
+ return NULL;
+ }
+
+ return buf;
+}
+
static const char *dump_param_flags(DWORD flags)
{
static char buf[256];
@@ -4072,10 +4104,10 @@ static void test_dump_typelib(const char *name)
printf(" \"%s\",\n", wine_dbgstr_guid(&attr->guid));
- printf(" /*kind*/ %s, /*flags*/ %s, /*align*/ %d, /*size*/ %s,\n"
+ printf(" /*kind*/ %s, /*flags*/ %s, /*align*/ %s, /*size*/ %s,\n"
" /*helpctx*/ 0x%04x, /*version*/ 0x%08x, /*#vtbl*/ %d, /*#func*/ %d",
map_value(attr->typekind, tkind_map), dump_type_flags(attr->wTypeFlags),
- attr->cbAlignment, print_size(name, attr),
+ print_align(name, attr), print_size(name, attr),
help_ctx, MAKELONG(attr->wMinorVerNum, attr->wMajorVerNum),
attr->cbSizeVft/sizeof(void*), attr->cFuncs);
@@ -4175,13 +4207,13 @@ static const type_info info[] = {
{
"g",
"{b14b6bb5-904e-4ff9-b247-bd361f7a0001}",
- /*kind*/ TKIND_RECORD, /*flags*/ 0, /*align*/ 4, /*size*/ sizeof(struct g),
+ /*kind*/ TKIND_RECORD, /*flags*/ 0, /*align*/ TYPE_ALIGNMENT(struct g), /*size*/ sizeof(struct g),
/*helpctx*/ 0x0000, /*version*/ 0x00000000, /*#vtbl*/ 0, /*#func*/ 0
},
{
"test_iface",
"{b14b6bb5-904e-4ff9-b247-bd361f7a0002}",
- /*kind*/ TKIND_INTERFACE, /*flags*/ 0, /*align*/ 4, /*size*/ sizeof(test_iface*),
+ /*kind*/ TKIND_INTERFACE, /*flags*/ 0, /*align*/ TYPE_ALIGNMENT(test_iface*), /*size*/ sizeof(test_iface*),
/*helpctx*/ 0x0000, /*version*/ 0x00000000, /*#vtbl*/ 4, /*#func*/ 1,
{
{
@@ -4203,7 +4235,7 @@ static const type_info info[] = {
{
"parent_iface",
"{b14b6bb5-904e-4ff9-b247-bd361f7aa001}",
- /*kind*/ TKIND_INTERFACE, /*flags*/ 0, /*align*/ 4, /*size*/ sizeof(parent_iface*),
+ /*kind*/ TKIND_INTERFACE, /*flags*/ 0, /*align*/ TYPE_ALIGNMENT(parent_iface*), /*size*/ sizeof(parent_iface*),
/*helpctx*/ 0x0000, /*version*/ 0x00000000, /*#vtbl*/ 4, /*#func*/ 1,
{
{
@@ -4225,7 +4257,7 @@ static const type_info info[] = {
{
"child_iface",
"{b14b6bb5-904e-4ff9-b247-bd361f7aa002}",
- /*kind*/ TKIND_INTERFACE, /*flags*/ 0, /*align*/ 4, /*size*/ sizeof(child_iface*),
+ /*kind*/ TKIND_INTERFACE, /*flags*/ 0, /*align*/ TYPE_ALIGNMENT(child_iface*), /*size*/ sizeof(child_iface*),
/*helpctx*/ 0x0000, /*version*/ 0x00000000, /*#vtbl*/ 5, /*#func*/ 1,
{
{
@@ -4245,7 +4277,7 @@ static const type_info info[] = {
{
"_n",
"{016fe2ec-b2c8-45f8-b23b-39e53a753903}",
- /*kind*/ TKIND_RECORD, /*flags*/ 0, /*align*/ 4, /*size*/ sizeof(struct _n),
+ /*kind*/ TKIND_RECORD, /*flags*/ 0, /*align*/ TYPE_ALIGNMENT(struct _n), /*size*/ sizeof(struct _n),
/*helpctx*/ 0x0003, /*version*/ 0x00010002, /*#vtbl*/ 0, /*#func*/ 0
},
{
@@ -4263,7 +4295,7 @@ static const type_info info[] = {
{
"_m",
"{016fe2ec-b2c8-45f8-b23b-39e53a753906}",
- /*kind*/ TKIND_RECORD, /*flags*/ 0, /*align*/ 4, /*size*/ sizeof(struct _m),
+ /*kind*/ TKIND_RECORD, /*flags*/ 0, /*align*/ TYPE_ALIGNMENT(struct _m), /*size*/ sizeof(struct _m),
/*helpctx*/ 0x0003, /*version*/ 0x00000000, /*#vtbl*/ 0, /*#func*/ 0
},
{
@@ -4281,7 +4313,7 @@ static const type_info info[] = {
{
"IDualIface",
"{b14b6bb5-904e-4ff9-b247-bd361f7aaedd}",
- /*kind*/ TKIND_DISPATCH, /*flags*/ TYPEFLAG_FDISPATCHABLE|TYPEFLAG_FDUAL, /*align*/ 4, /*size*/ sizeof(IDualIface*),
+ /*kind*/ TKIND_DISPATCH, /*flags*/ TYPEFLAG_FDISPATCHABLE|TYPEFLAG_FDUAL, /*align*/ TYPE_ALIGNMENT(IDualIface*), /*size*/ sizeof(IDualIface*),
/*helpctx*/ 0x0000, /*version*/ 0x00000000, /*#vtbl*/ 7, /*#func*/ 8,
{
{
@@ -4423,7 +4455,7 @@ static const type_info info[] = {
{
"ISimpleIface",
"{ec5dfcd6-eeb0-4cd6-b51e-8030e1dac009}",
- /*kind*/ TKIND_INTERFACE, /*flags*/ TYPEFLAG_FDISPATCHABLE, /*align*/ 4, /*size*/ sizeof(ISimpleIface*),
+ /*kind*/ TKIND_INTERFACE, /*flags*/ TYPEFLAG_FDISPATCHABLE, /*align*/ TYPE_ALIGNMENT(ISimpleIface*), /*size*/ sizeof(ISimpleIface*),
/*helpctx*/ 0x0000, /*version*/ 0x00000000, /*#vtbl*/ 8, /*#func*/ 1,
{
{
@@ -4443,13 +4475,13 @@ static const type_info info[] = {
{
"test_struct",
"{4029f190-ca4a-4611-aeb9-673983cb96dd}",
- /*kind*/ TKIND_RECORD, /*flags*/ 0, /*align*/ 4, /*size*/ sizeof(struct test_struct),
+ /*kind*/ TKIND_RECORD, /*flags*/ 0, /*align*/ TYPE_ALIGNMENT(struct test_struct), /*size*/ sizeof(struct test_struct),
/*helpctx*/ 0x0000, /*version*/ 0x00000000, /*#vtbl*/ 0, /*#func*/ 0
},
{
"test_struct2",
"{4029f190-ca4a-4611-aeb9-673983cb96de}",
- /*kind*/ TKIND_RECORD, /*flags*/ 0, /*align*/ 4, /*size*/ sizeof(struct test_struct2),
+ /*kind*/ TKIND_RECORD, /*flags*/ 0, /*align*/ TYPE_ALIGNMENT(struct test_struct2), /*size*/ sizeof(struct test_struct2),
/*helpctx*/ 0x0000, /*version*/ 0x00000000, /*#vtbl*/ 0, /*#func*/ 0
},
{
@@ -4533,13 +4565,13 @@ static const type_info info[] = {
{
"_e",
"{00000000-0000-0000-0000-000000000000}",
- /*kind*/ TKIND_RECORD, /*flags*/ TYPEFLAG_FRESTRICTED|TYPEFLAG_FHIDDEN, /*align*/ 4, /*size*/ sizeof(struct _e),
+ /*kind*/ TKIND_RECORD, /*flags*/ TYPEFLAG_FRESTRICTED|TYPEFLAG_FHIDDEN, /*align*/ TYPE_ALIGNMENT(struct _e), /*size*/ sizeof(struct _e),
/*helpctx*/ 0x0000, /*version*/ 0x00000000, /*#vtbl*/ 0, /*#func*/ 0
},
{
"ee",
"{016fe2ec-b2c8-45f8-b23b-39e53a753971}",
- /*kind*/ TKIND_RECORD, /*flags*/ TYPEFLAG_FRESTRICTED|TYPEFLAG_FHIDDEN, /*align*/ 4, /*size*/ sizeof(struct ee),
+ /*kind*/ TKIND_RECORD, /*flags*/ TYPEFLAG_FRESTRICTED|TYPEFLAG_FHIDDEN, /*align*/ TYPE_ALIGNMENT(struct ee), /*size*/ sizeof(struct ee),
/*helpctx*/ 0x0000, /*version*/ 0x00000000, /*#vtbl*/ 0, /*#func*/ 0
},
{
@@ -4551,19 +4583,19 @@ static const type_info info[] = {
{
"_f",
"{00000000-0000-0000-0000-000000000000}",
- /*kind*/ TKIND_UNION, /*flags*/ TYPEFLAG_FRESTRICTED|TYPEFLAG_FHIDDEN, /*align*/ 4, /*size*/ sizeof(union _f),
+ /*kind*/ TKIND_UNION, /*flags*/ TYPEFLAG_FRESTRICTED|TYPEFLAG_FHIDDEN, /*align*/ TYPE_ALIGNMENT(union _f), /*size*/ sizeof(union _f),
/*helpctx*/ 0x0000, /*version*/ 0x00000000, /*#vtbl*/ 0, /*#func*/ 0
},
{
"ff",
"{016fe2ec-b2c8-45f8-b23b-39e53a753973}",
- /*kind*/ TKIND_UNION, /*flags*/ TYPEFLAG_FRESTRICTED|TYPEFLAG_FHIDDEN, /*align*/ 4, /*size*/ sizeof(union ff),
+ /*kind*/ TKIND_UNION, /*flags*/ TYPEFLAG_FRESTRICTED|TYPEFLAG_FHIDDEN, /*align*/ TYPE_ALIGNMENT(union ff), /*size*/ sizeof(union ff),
/*helpctx*/ 0x0000, /*version*/ 0x00000000, /*#vtbl*/ 0, /*#func*/ 0
},
{
"ITestIface",
"{ec5dfcd6-eeb0-4cd6-b51e-8030e1dac00a}",
- /*kind*/ TKIND_INTERFACE, /*flags*/ TYPEFLAG_FDISPATCHABLE, /*align*/ 4, /*size*/ sizeof(ITestIface*),
+ /*kind*/ TKIND_INTERFACE, /*flags*/ TYPEFLAG_FDISPATCHABLE, /*align*/ TYPE_ALIGNMENT(ITestIface*), /*size*/ sizeof(ITestIface*),
/*helpctx*/ 0x0000, /*version*/ 0x00000000, /*#vtbl*/ 13, /*#func*/ 6,
{
{
--
2.7.4
June 3, 2018
[PATCH] testbot: Check for 32/64 bit VMs before creating the WineTest Job.
by Francois Gouget
Signed-off-by: Francois Gouget <fgouget(a)codeweavers.com>
---
testbot/bin/CheckForWinetestUpdate.pl | 46 +++++++++++++--------------
1 file changed, 22 insertions(+), 24 deletions(-)
diff --git a/testbot/bin/CheckForWinetestUpdate.pl b/testbot/bin/CheckForWinetestUpdate.pl
index ff8c30c23..20eacec63 100755
--- a/testbot/bin/CheckForWinetestUpdate.pl
+++ b/testbot/bin/CheckForWinetestUpdate.pl
@@ -65,6 +65,28 @@ sub AddJob($$$)
{
my ($BaseJob, $LatestBaseName, $Bits) = @_;
+ my $VMs = CreateVMs();
+ if ($Bits == 64)
+ {
+ $VMs->AddFilter("Type", ["win64"]);
+ $VMs->AddFilter("Role", ["base", "winetest"]);
+ }
+ elsif ($BaseJob)
+ {
+ $VMs->AddFilter("Type", ["win32", "win64"]);
+ $VMs->AddFilter("Role", ["base"]);
+ }
+ else
+ {
+ $VMs->AddFilter("Type", ["win32", "win64"]);
+ $VMs->AddFilter("Role", ["winetest"]);
+ }
+ if ($VMs->GetItemsCount() == 0)
+ {
+ # There is nothing to do
+ return 1;
+ }
+
# Create a hard link in staging so it can then be moved into the job
# directory. This is ok because the latest file is never overwritten.
my $StagingFileName = CreateNewLink("$DataDir/latest/$LatestBaseName",
@@ -90,38 +112,14 @@ sub AddJob($$$)
# Add a task for each VM
my $Tasks = $NewStep->Tasks;
- my $HasTasks = !1;
- my $VMs = CreateVMs();
- if ($Bits == 64)
- {
- $VMs->AddFilter("Type", ["win64"]);
- $VMs->AddFilter("Role", ["base", "winetest"]);
- }
- elsif ($BaseJob)
- {
- $VMs->AddFilter("Type", ["win32", "win64"]);
- $VMs->AddFilter("Role", ["base"]);
- }
- else
- {
- $VMs->AddFilter("Type", ["win32", "win64"]);
- $VMs->AddFilter("Role", ["winetest"]);
- }
foreach my $VMKey (@{$VMs->SortKeysBySortOrder($VMs->GetKeys())})
{
my $Task = $Tasks->Add();
$Task->VM($VMs->GetItem($VMKey));
$Task->Timeout($SuiteTimeout);
- $HasTasks = 1;
}
# Now save the whole thing
- if (!$HasTasks)
- {
- unlink($StagingFileName);
- return 1;
- }
-
my ($ErrKey, $ErrProperty, $ErrMessage) = $Jobs->Save();
if (defined $ErrMessage)
{
--
2.17.0
June 3, 2018
Re: [PATCH 2/2] d2d1: Add ID2D1DeviceContext stub.
by Henri Verbeet
On 29 May 2018 at 22:09, Nikolay Sivov <bunglehead(a)gmail.com> wrote:
> Context can render in two ways - populating command list, or rendering to a
> bitmap object. I was thinking we should create a dxgi target when rendering
> to a bitmap and forward calls to it. For command lists we don’t need to
> create a real target.
>
Yeah, but I think we'd still like things to work in essentially the
same way. When rendering to a command list, we'd record commands for
later execution. When rendering to a surface we'd do the same, but
also start execution (more or less) immediately, potentially on a
different thread.
June 3, 2018
Help with running Wine
by mrt303xx@aol.com
I installed Wine, built and compiled Wine 3.9, and ran Winetricks to add the MS dependencies but nothing runs, not even a basic "Hello World" Windows app with NO MFC. Can somebody point me in the right direction?
June 2, 2018
Re: [PATCH 3/3] msi/tests: Test deferral of WriteRegistryValues.
by Marvin
Hi,
While running your changed tests on Windows, I think I found new failures.
Being a bot and all I'm not very good at pattern recognition, so I might be
wrong, but could you please double-check?
Full results can be found at
https://testbot.winehq.org/JobDetails.pl?Key=38907
Your paranoid android.
=== w7u (32 bit action) ===
The task timed out
June 2, 2018
[PATCH 3/3] msi/tests: Test deferral of WriteRegistryValues.
by Zebediah Figura
Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com>
---
dlls/msi/tests/action.c | 14 ++++++++++++++
dlls/msi/tests/custom.c | 28 ++++++++++++++++++++++++++++
dlls/msi/tests/custom.spec | 2 ++
3 files changed, 44 insertions(+)
diff --git a/dlls/msi/tests/action.c b/dlls/msi/tests/action.c
index 5162018..2e464c4 100644
--- a/dlls/msi/tests/action.c
+++ b/dlls/msi/tests/action.c
@@ -695,12 +695,25 @@ static const char wrv_install_exec_seq_dat[] =
"InstallInitialize\t\t1500\n"
"ProcessComponents\t\t1600\n"
"RemoveRegistryValues\t\t4900\n"
+ "rrv_immediate\tREMOVE\t4901\n"
+ "rrv_deferred\tREMOVE\t4902\n"
"WriteRegistryValues\t\t5000\n"
+ "wrv_immediate\tNOT REMOVE\t5001\n"
+ "wrv_deferred\tNOT REMOVE\t5002\n"
"RegisterProduct\t\t6100\n"
"PublishFeatures\t\t6200\n"
"PublishProduct\t\t6300\n"
"InstallFinalize\t\t6600\n";
+static const char wrv_custom_action_dat[] =
+ "Action\tType\tSource\tTarget\n"
+ "s72\ti2\tS64\tS0\n"
+ "CustomAction\tAction\n"
+ "wrv_immediate\t1\tcustom.dll\twrv_absent\n"
+ "wrv_deferred\t1025\tcustom.dll\twrv_present\n"
+ "rrv_immediate\t1\tcustom.dll\twrv_present\n"
+ "rrv_deferred\t1025\tcustom.dll\twrv_absent\n";
+
static const char cf_directory_dat[] =
"Directory\tDirectory_Parent\tDefaultDir\n"
"s72\tS72\tl255\n"
@@ -2025,6 +2038,7 @@ static const msi_table wrv_tables[] =
ADD_TABLE(wrv_feature),
ADD_TABLE(wrv_feature_comp),
ADD_TABLE(wrv_install_exec_seq),
+ ADD_TABLE(wrv_custom_action),
ADD_TABLE(property),
ADD_TABLE(media),
ADD_TABLE(wrv_registry),
diff --git a/dlls/msi/tests/custom.c b/dlls/msi/tests/custom.c
index 3e742e3..7f6aa65 100644
--- a/dlls/msi/tests/custom.c
+++ b/dlls/msi/tests/custom.c
@@ -1922,3 +1922,31 @@ todo_wine_if(!MsiGetMode(hinst, MSIRUNMODE_SCHEDULED))
return ERROR_SUCCESS;
}
+
+UINT WINAPI wrv_present(MSIHANDLE hinst)
+{
+ HKEY key;
+ LONG res;
+
+ res = RegOpenKeyA(HKEY_CURRENT_USER, "msitest", &key);
+ ok(hinst, !res, "got %u\n", res);
+todo_wine_if(!MsiGetMode(hinst, MSIRUNMODE_SCHEDULED))
+ check_reg_str(hinst, key, "sz", "string");
+ RegCloseKey(key);
+
+ return ERROR_SUCCESS;
+}
+
+UINT WINAPI wrv_absent(MSIHANDLE hinst)
+{
+ HKEY key;
+ LONG res;
+
+ res = RegOpenKeyA(HKEY_CURRENT_USER, "msitest", &key);
+ ok(hinst, !res, "got %u\n", res);
+todo_wine_if(!MsiGetMode(hinst, MSIRUNMODE_SCHEDULED))
+ check_reg_str(hinst, key, "sz", NULL);
+ RegCloseKey(key);
+
+ return ERROR_SUCCESS;
+}
diff --git a/dlls/msi/tests/custom.spec b/dlls/msi/tests/custom.spec
index bfd8392..b94f6cc 100644
--- a/dlls/msi/tests/custom.spec
+++ b/dlls/msi/tests/custom.spec
@@ -53,3 +53,5 @@
@ stdcall sss_stopped(long)
@ stdcall tl_present(long)
@ stdcall tl_absent(long)
+@ stdcall wrv_present(long)
+@ stdcall wrv_absent(long)
--
2.7.4
June 2, 2018
[PATCH 2/3] msi/tests: Simplify and clarify WriteRegistryValues and RemoveRegistryValues tests.
by Zebediah Figura
Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com>
---
dlls/msi/tests/action.c | 614 ++++++++++++++----------------------------------
1 file changed, 182 insertions(+), 432 deletions(-)
diff --git a/dlls/msi/tests/action.c b/dlls/msi/tests/action.c
index b6aa8e6..5162018 100644
--- a/dlls/msi/tests/action.c
+++ b/dlls/msi/tests/action.c
@@ -183,7 +183,7 @@ static const char property_dat[] =
"SERVDISP\tTestServiceDisp\n"
"SERVDISP2\tTestServiceDisp2\n"
"MSIFASTINSTALL\t1\n"
- "regdata15\t#x01\n";
+ "regdata17\t#1\n";
static const char env_install_exec_seq_dat[] =
"Action\tCondition\tSequence\n"
@@ -634,8 +634,8 @@ static const char wrv_component_dat[] =
"Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
"s72\tS38\ts72\ti2\tS255\tS72\n"
"Component\tComponent\n"
- "augustus\t\tMSITESTDIR\t0\t\taugustus\n"
- "caesar\t\tMSITESTDIR\t1\t\t\n";
+ "augustus\t{bafe0297-cbcc-4e08-8a78-7e9b83456eef}\tMSITESTDIR\t0\t\t\n"
+ "caesar\t{bafe0298-cbcc-4e08-8a78-7e9b83456eef}\tMSITESTDIR\t1\t\t\n";
static const char wrv_feature_dat[] =
"Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
@@ -655,23 +655,51 @@ static const char wrv_registry_dat[] =
"Registry\tRoot\tKey\tName\tValue\tComponent_\n"
"s72\ti2\tl255\tL255\tL0\ts72\n"
"Registry\tRegistry\n"
- "regdata\t2\tSOFTWARE\\Wine\\msitest\tValue\t[~]one[~]two[~]three\taugustus\n"
- "regdata1\t2\tSOFTWARE\\Wine\\msitest\t*\t\taugustus\n"
- "regdata2\t2\tSOFTWARE\\Wine\\msitest\t*\t#%\taugustus\n"
- "regdata3\t2\tSOFTWARE\\Wine\\msitest\t*\t#x\taugustus\n"
- "regdata4\t2\tSOFTWARE\\Wine\\msitest\\VisualStudio\\10.0\\AD7Metrics\\Exception\\{049EC4CC-30D2-4032-9256-EE18EB41B62B}\\Common Language Runtime Exceptions\\System.Workflow.ComponentModel.Serialization\\System.Workflow.ComponentModel.Serialization.WorkflowMarkupSerializationException\tlong\tkey\taugustus\n"
- "regdata5\t2\tSOFTWARE\\Wine\\msitest\tValue1\t[~]one[~]\taugustus\n"
- "regdata6\t2\tSOFTWARE\\Wine\\msitest\tValue2\t[~]two\taugustus\n"
- "regdata7\t2\tSOFTWARE\\Wine\\msitest\tValue3\tone[~]\taugustus\n"
- "regdata8\t2\tSOFTWARE\\Wine\\msitest\tValue4\tone[~]two\taugustus\n"
- "regdata9\t2\tSOFTWARE\\Wine\\msitest\tValue5\t[~]one[~]two[~]three\taugustus\n"
- "regdata10\t2\tSOFTWARE\\Wine\\msitest\tValue6\t[~]\taugustus\n"
- "regdata11\t2\tSOFTWARE\\Wine\\msitest\tValue7\t[~]two\taugustus\n"
- "regdata12\t2\tSOFTWARE\\Wine\\msitest\tValue8\t#1\taugustus\n"
- "regdata13\t2\tSOFTWARE\\Wine\\msitest\tValue9\t#x1\taugustus\n"
- "regdata14\t2\tSOFTWARE\\Wine\\msitest\tValue10\t#x01\taugustus\n"
- "regdata15\t2\tSOFTWARE\\Wine\\msitest\tValue11\t[regdata15]\taugustus\n"
- "regdata16\t2\tSOFTWARE\\Wine\\msitest\tValue12\t#1\tcaesar\n";
+ "regdata0\t1\tmsitest\tsz\tstring\taugustus\n"
+ "regdata1\t1\tmsitest\tmultisz\tone[~]two[~]three\taugustus\n"
+ "regdata2\t1\tmsitest\texpandsz\t#%string\taugustus\n"
+ "regdata3\t1\tmsitest\tdword\t#123\taugustus\n"
+ "regdata4\t1\tmsitest\tbinary\t#x01234567\taugustus\n"
+ "regdata5\t1\tmsitest\t\tdefault\taugustus\n"
+ "regdata6\t1\tmsitest\\subkey\t*\t\taugustus\n"
+ "regdata7\t1\tmsitest\\subkey\t*\t#%\taugustus\n"
+ "regdata8\t1\tmsitest\\subkey\t*\t#x\taugustus\n"
+ "regdata9\t1\tmsitest\\VisualStudio\\10.0\\AD7Metrics\\Exception\\{049EC4CC-30D2-4032-9256-EE18EB41B62B}\\Common Language Runtime Exceptions\\System.Workflow.ComponentModel.Serialization\\System.Workflow.ComponentModel.Serialization.WorkflowMarkupSerializationException\tlong\tkey\taugustus\n"
+ "regdata10\t1\tmsitest\tValue1\t[~]one[~]\taugustus\n"
+ "regdata11\t1\tmsitest\tValue2\t[~]two\taugustus\n"
+ "regdata12\t1\tmsitest\tValue3\tone[~]\taugustus\n"
+ "regdata13\t1\tmsitest\tValue4\tone[~]two\taugustus\n"
+ "regdata14\t1\tmsitest\tValue5\t[~]one[~]two[~]three\taugustus\n"
+ "regdata15\t1\tmsitest\tValue6\t[~]\taugustus\n"
+ "regdata16\t1\tmsitest\tValue7\t[~]two\taugustus\n"
+ "regdata17\t1\tmsitest\tformat\t[regdata17]\taugustus\n"
+ "regdata18\t1\tmsitest\tsource\t#1\tcaesar\n"
+ "regdata19\t1\tmsitest\\create\t+\t\taugustus\n"
+ "regdata20\t1\tmsitest\\delete\t-\t\taugustus\n";
+
+static const char wrv_remove_registry_dat[] =
+ "RemoveRegistry\tRoot\tKey\tName\tComponent_\n"
+ "s72\ti2\tl255\tL255\ts72\n"
+ "RemoveRegistry\tRemoveRegistry\n"
+ "regdata0\t1\tmsitest\tinstremove\taugustus\n"
+ "regdata1\t1\tmsitest\\instremove\t-\taugustus\n";
+
+static const char wrv_install_exec_seq_dat[] =
+ "Action\tCondition\tSequence\n"
+ "s72\tS255\tI2\n"
+ "InstallExecuteSequence\tAction\n"
+ "CostInitialize\t\t800\n"
+ "FileCost\t\t900\n"
+ "CostFinalize\t\t1000\n"
+ "InstallValidate\t\t1400\n"
+ "InstallInitialize\t\t1500\n"
+ "ProcessComponents\t\t1600\n"
+ "RemoveRegistryValues\t\t4900\n"
+ "WriteRegistryValues\t\t5000\n"
+ "RegisterProduct\t\t6100\n"
+ "PublishFeatures\t\t6200\n"
+ "PublishProduct\t\t6300\n"
+ "InstallFinalize\t\t6600\n";
static const char cf_directory_dat[] =
"Directory\tDirectory_Parent\tDefaultDir\n"
@@ -1289,65 +1317,6 @@ static const char rd_custom_action_dat[] =
"rd_immediate\t1\tcustom.dll\trd_present\n"
"rd_deferred\t1025\tcustom.dll\trd_absent\n";
-static const char rrv_file_dat[] =
- "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
- "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
- "File\tFile\n"
- "registry.txt\tregistry\tregistry.txt\t1000\t\t\t8192\t1\n";
-
-static const char rrv_feature_dat[] =
- "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n"
- "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n"
- "Feature\tFeature\n"
- "registry\t\t\tregistry feature\t1\t2\tMSITESTDIR\t0\n";
-
-static const char rrv_feature_comp_dat[] =
- "Feature_\tComponent_\n"
- "s38\ts72\n"
- "FeatureComponents\tFeature_\tComponent_\n"
- "registry\tregistry\n";
-
-static const char rrv_component_dat[] =
- "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
- "s72\tS38\ts72\ti2\tS255\tS72\n"
- "Component\tComponent\n"
- "registry\t{DA97585B-962D-45EB-AD32-DA15E60CA9EE}\tMSITESTDIR\t0\t\tregistry.txt\n";
-
-static const char rrv_registry_dat[] =
- "Registry\tRoot\tKey\tName\tValue\tComponent_\n"
- "s72\ti2\tl255\tL255\tL0\ts72\n"
- "Registry\tRegistry\n"
- "reg1\t2\tSOFTWARE\\Wine\\keyA\t\tA\tregistry\n"
- "reg2\t2\tSOFTWARE\\Wine\\keyA\tvalueA\tA\tregistry\n"
- "reg3\t2\tSOFTWARE\\Wine\\key1\t-\t\tregistry\n";
-
-static const char rrv_remove_registry_dat[] =
- "RemoveRegistry\tRoot\tKey\tName\tComponent_\n"
- "s72\ti2\tl255\tL255\ts72\n"
- "RemoveRegistry\tRemoveRegistry\n"
- "reg1\t2\tSOFTWARE\\Wine\\keyB\t\tregistry\n"
- "reg2\t2\tSOFTWARE\\Wine\\keyB\tValueB\tregistry\n"
- "reg3\t2\tSOFTWARE\\Wine\\key2\t-\tregistry\n";
-
-static const char rrv_install_exec_seq_dat[] =
- "Action\tCondition\tSequence\n"
- "s72\tS255\tI2\n"
- "InstallExecuteSequence\tAction\n"
- "LaunchConditions\t\t100\n"
- "CostInitialize\t\t800\n"
- "FileCost\t\t900\n"
- "CostFinalize\t\t1000\n"
- "InstallValidate\t\t1400\n"
- "InstallInitialize\t\t1500\n"
- "ProcessComponents\t\t1600\n"
- "RemoveFiles\t\t1700\n"
- "InstallFiles\t\t2000\n"
- "RemoveRegistryValues\t\t3000\n"
- "RegisterProduct\t\t5000\n"
- "PublishFeatures\t\t5100\n"
- "PublishProduct\t\t5200\n"
- "InstallFinalize\t\t6000\n";
-
static const char frp_file_dat[] =
"File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n"
"s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n"
@@ -2055,11 +2024,11 @@ static const msi_table wrv_tables[] =
ADD_TABLE(directory),
ADD_TABLE(wrv_feature),
ADD_TABLE(wrv_feature_comp),
- ADD_TABLE(ci2_file),
- ADD_TABLE(install_exec_seq),
- ADD_TABLE(rof_media),
+ ADD_TABLE(wrv_install_exec_seq),
ADD_TABLE(property),
+ ADD_TABLE(media),
ADD_TABLE(wrv_registry),
+ ADD_TABLE(wrv_remove_registry),
};
static const msi_table cf_tables[] =
@@ -2232,20 +2201,6 @@ static const msi_table rd_tables[] =
ADD_TABLE(property)
};
-static const msi_table rrv_tables[] =
-{
- ADD_TABLE(directory),
- ADD_TABLE(rrv_component),
- ADD_TABLE(rrv_feature),
- ADD_TABLE(rrv_feature_comp),
- ADD_TABLE(rrv_file),
- ADD_TABLE(rrv_registry),
- ADD_TABLE(rrv_remove_registry),
- ADD_TABLE(rrv_install_exec_seq),
- ADD_TABLE(media),
- ADD_TABLE(property)
-};
-
static const msi_table frp_tables[] =
{
ADD_TABLE(directory),
@@ -2368,75 +2323,6 @@ static const msi_table rep_tables[] =
ADD_TABLE(media)
};
-/* based on RegDeleteTreeW from dlls/advapi32/registry.c */
-static LSTATUS action_RegDeleteTreeA(HKEY hKey, LPCSTR lpszSubKey, REGSAM access)
-{
- LONG ret;
- DWORD dwMaxSubkeyLen, dwMaxValueLen;
- DWORD dwMaxLen, dwSize;
- char szNameBuf[MAX_PATH], *lpszName = szNameBuf;
- HKEY hSubKey = hKey;
-
- if(lpszSubKey)
- {
- ret = RegOpenKeyExA(hKey, lpszSubKey, 0, access, &hSubKey);
- if (ret) return ret;
- }
-
- ret = RegQueryInfoKeyA(hSubKey, NULL, NULL, NULL, NULL,
- &dwMaxSubkeyLen, NULL, NULL, &dwMaxValueLen, NULL, NULL, NULL);
- if (ret) goto cleanup;
-
- dwMaxSubkeyLen++;
- dwMaxValueLen++;
- dwMaxLen = max(dwMaxSubkeyLen, dwMaxValueLen);
- if (dwMaxLen > sizeof(szNameBuf))
- {
- /* Name too big: alloc a buffer for it */
- if (!(lpszName = HeapAlloc( GetProcessHeap(), 0, dwMaxLen)))
- {
- ret = ERROR_NOT_ENOUGH_MEMORY;
- goto cleanup;
- }
- }
-
- /* Recursively delete all the subkeys */
- while (TRUE)
- {
- dwSize = dwMaxLen;
- if (RegEnumKeyExA(hSubKey, 0, lpszName, &dwSize, NULL,
- NULL, NULL, NULL)) break;
-
- ret = action_RegDeleteTreeA(hSubKey, lpszName, access);
- if (ret) goto cleanup;
- }
-
- if (lpszSubKey)
- {
- if (pRegDeleteKeyExA)
- ret = pRegDeleteKeyExA(hKey, lpszSubKey, access, 0);
- else
- ret = RegDeleteKeyA(hKey, lpszSubKey);
- }
- else
- while (TRUE)
- {
- dwSize = dwMaxLen;
- if (RegEnumValueA(hKey, 0, lpszName, &dwSize,
- NULL, NULL, NULL, NULL)) break;
-
- ret = RegDeleteValueA(hKey, lpszName);
- if (ret) goto cleanup;
- }
-
-cleanup:
- if (lpszName != szNameBuf)
- HeapFree(GetProcessHeap(), 0, lpszName);
- if(lpszSubKey)
- RegCloseKey(hSubKey);
- return ret;
-}
-
/* cabinet definitions */
/* make the max size large so there is only one cab file */
@@ -2608,6 +2494,25 @@ static void check_reg_str(HKEY prodkey, LPCSTR name, LPCSTR expected, BOOL bcase
}
}
+static void check_reg_multi(HKEY prodkey, const char *name, const char *expect, DWORD line)
+{
+ char val[MAX_PATH];
+ DWORD size, type;
+ LONG res;
+
+ size = MAX_PATH;
+ val[0] = '\0';
+ res = RegQueryValueExA(prodkey, name, NULL, &type, (BYTE *)val, &size);
+
+ if (res != ERROR_SUCCESS || type != REG_MULTI_SZ)
+ {
+ ok_(__FILE__, line)(FALSE, "Key doesn't exist or wrong type\n");
+ return;
+ }
+
+ ok_(__FILE__, line)(!memcmp(val, expect, size), "wrong data\n");
+}
+
static void check_reg_dword(HKEY prodkey, LPCSTR name, DWORD expected, DWORD line)
{
DWORD val, size, type;
@@ -2643,6 +2548,9 @@ static void check_reg_dword(HKEY prodkey, LPCSTR name, DWORD expected, DWORD lin
RegDeleteValueA(prodkey, name); \
} while(0)
+#define CHECK_REG_MULTI(key, name, expect) \
+ check_reg_multi(key, name, expect, __LINE__);
+
#define CHECK_REG_DWORD(prodkey, name, expected) \
check_reg_dword(prodkey, name, expected, __LINE__);
@@ -4737,12 +4645,11 @@ error:
static void test_write_registry_values(void)
{
- UINT r;
- LONG res;
- HKEY hkey;
+ HKEY hkey, subkey;
DWORD type, size;
- CHAR path[MAX_PATH];
- BYTE buf[8];
+ char buf[20];
+ LONG res;
+ UINT r;
if (is_process_limited())
{
@@ -4751,18 +4658,12 @@ static void test_write_registry_values(void)
}
CreateDirectoryA("msitest", NULL);
- create_file("msitest\\augustus", 500);
create_database(msifile, wrv_tables, sizeof(wrv_tables) / sizeof(msi_table));
MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
- if (is_64bit)
- res = RegCreateKeyExA(HKEY_LOCAL_MACHINE, "SOFTWARE\\Wow6432Node\\Wine\\msitest", 0, NULL, 0,
- KEY_ALL_ACCESS, NULL, &hkey, NULL);
- else
- res = RegCreateKeyExA(HKEY_LOCAL_MACHINE, "SOFTWARE\\Wine\\msitest", 0, NULL, 0, KEY_ALL_ACCESS,
- NULL, &hkey, NULL);
+ res = RegCreateKeyA(HKEY_CURRENT_USER, "msitest", &hkey);
ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
res = RegSetValueExA(hkey, "Value1", 0, REG_MULTI_SZ, (const BYTE *)"two\0", 5);
@@ -4779,7 +4680,13 @@ static void test_write_registry_values(void)
ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
res = RegSetValueExA(hkey, "Value7", 0, REG_SZ, (const BYTE *)"one", 4);
ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
- RegCloseKey(hkey);
+
+ res = RegSetValueExA(hkey, "instremove", 0, REG_SZ, (const BYTE *)"val", 3);
+ ok(!res, "got %u\n", res);
+
+ res = RegCreateKeyA(hkey, "instremove", &subkey);
+ ok(!res, "got %u\n", res);
+ RegCloseKey(subkey);
r = MsiInstallProductA(msifile, NULL);
if (r == ERROR_INSTALL_PACKAGE_REJECTED)
@@ -4788,157 +4695,120 @@ static void test_write_registry_values(void)
goto error;
}
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
- ok(delete_pf("msitest\\augustus", TRUE), "File not installed\n");
- ok(delete_pf("msitest", FALSE), "Directory not created\n");
- if (is_64bit)
- res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, "SOFTWARE\\Wow6432Node\\Wine\\msitest", 0, KEY_ALL_ACCESS, &hkey);
- else
- res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, "SOFTWARE\\Wine\\msitest", 0, KEY_ALL_ACCESS, &hkey);
+ CHECK_REG_STR(hkey, "sz", "string");
+ CHECK_REG_MULTI(hkey, "multisz", "one\0two\0three\0");
+ CHECK_REG_DWORD(hkey, "dword", 123);
+
+ size = sizeof(buf);
+ res = RegQueryValueExA(hkey, "expandsz", NULL, &type, (BYTE *)buf, &size);
+ ok(!res, "got %u\n", res);
+ ok(type == REG_EXPAND_SZ, "got %d\n", type);
+ ok(!strcmp(buf, "string"), "got %s\n", buf);
+
+ size = sizeof(buf);
+ res = RegQueryValueExA(hkey, "binary", NULL, &type, (BYTE *)buf, &size);
+ ok(!res, "got %u\n", res);
+ ok(type == REG_BINARY, "got %d\n", type);
+ ok(size == 4, "got size %u\n", size);
+ ok(!memcmp(buf, "\x01\x23\x45\x67", 4), "wrong data\n");
+
+ CHECK_REG_STR(hkey, "", "default");
+
+ res = RegOpenKeyA(hkey, "VisualStudio", &subkey);
ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
+ RegCloseKey(subkey);
- size = MAX_PATH;
- type = 0xdeadbeef;
- memset(path, 'a', MAX_PATH);
- res = RegQueryValueExA(hkey, "Value", NULL, &type, (LPBYTE)path, &size);
- ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
- ok(!memcmp(path, "one\0two\0three\0\0", size), "Wrong multi-sz data\n");
- ok(size == 15, "Expected 15, got %d\n", size);
- ok(type == REG_MULTI_SZ, "Expected REG_MULTI_SZ, got %d\n", type);
+ CHECK_REG_MULTI(hkey, "Value1", "one\0");
+ CHECK_REG_MULTI(hkey, "Value2", "one\0two\0");
+ CHECK_REG_MULTI(hkey, "Value3", "one\0two\0");
+ CHECK_REG_MULTI(hkey, "Value4", "one\0two\0");
+ CHECK_REG_MULTI(hkey, "Value5", "one\0two\0three\0");
+ CHECK_REG_MULTI(hkey, "Value6", "");
+ CHECK_REG_MULTI(hkey, "Value7", "two\0");
+ CHECK_REG_DWORD(hkey, "format", 1);
+ CHECK_REG_DWORD(hkey, "source", 1);
+
+ res = RegOpenKeyA(hkey, "subkey", &subkey);
+ ok(!res, "got %u\n", res);
+ res = RegQueryValueExA(subkey, "", NULL, NULL, NULL, NULL);
+ ok(res == ERROR_FILE_NOT_FOUND, "got %u\n", res);
+ RegCloseKey(subkey);
+
+ res = RegOpenKeyA(hkey, "create", &subkey);
+ ok(!res, "got %u\n", res);
+ RegCloseKey(subkey);
+
+ res = RegOpenKeyA(hkey, "delete", &subkey);
+ ok(res == ERROR_FILE_NOT_FOUND, "got %u\n", res);
+ res = RegCreateKeyA(hkey, "delete", &subkey);
+ ok(!res, "got %u\n", res);
+ RegCloseKey(subkey);
+
+ res = RegQueryValueExA(hkey, "instremove", NULL, NULL, NULL, NULL);
+ ok(res == ERROR_FILE_NOT_FOUND, "got %u\n", res);
+ res = RegOpenKeyA(hkey, "instremove", &subkey);
+ ok(res == ERROR_FILE_NOT_FOUND, "got %u\n", res);
+
+ r = MsiInstallProductA(msifile, "REMOVE=ALL");
+ ok(!r, "got %u\n", r);
+
+ res = RegQueryValueExA(hkey, "sz", NULL, NULL, NULL, NULL);
+ ok(res == ERROR_FILE_NOT_FOUND, "got %u\n", res);
+ res = RegQueryValueExA(hkey, "multisz", NULL, NULL, NULL, NULL);
+ ok(res == ERROR_FILE_NOT_FOUND, "got %u\n", res);
+ res = RegQueryValueExA(hkey, "dword", NULL, NULL, NULL, NULL);
+ ok(res == ERROR_FILE_NOT_FOUND, "got %u\n", res);
+ res = RegQueryValueExA(hkey, "expandsz", NULL, NULL, NULL, NULL);
+ ok(res == ERROR_FILE_NOT_FOUND, "got %u\n", res);
+ res = RegQueryValueExA(hkey, "binary", NULL, NULL, NULL, NULL);
+ ok(res == ERROR_FILE_NOT_FOUND, "got %u\n", res);
res = RegQueryValueExA(hkey, "", NULL, NULL, NULL, NULL);
- ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
+ ok(res == ERROR_FILE_NOT_FOUND, "got %u\n", res);
- res = action_RegDeleteTreeA(hkey, "VisualStudio", KEY_ALL_ACCESS);
- ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
+ res = RegOpenKeyA(hkey, "VisualStudio", &subkey);
+ ok(res == ERROR_FILE_NOT_FOUND, "got %u\n", res);
- size = MAX_PATH;
- type = 0xdeadbeef;
- memset(path, 'a', MAX_PATH);
- res = RegQueryValueExA(hkey, "Value1", NULL, &type, (LPBYTE)path, &size);
- ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
- ok(!memcmp(path, "one\0", size), "Wrong multi-sz data\n");
- ok(size == 5, "Expected 5, got %d\n", size);
- ok(type == REG_MULTI_SZ, "Expected REG_MULTI_SZ, got %d\n", type);
+ res = RegQueryValueExA(hkey, "Value1", NULL, NULL, NULL, NULL);
+ ok(res == ERROR_FILE_NOT_FOUND, "got %u\n", res);
+ res = RegQueryValueExA(hkey, "Value4", NULL, NULL, NULL, NULL);
+ ok(res == ERROR_FILE_NOT_FOUND, "got %u\n", res);
+ res = RegQueryValueExA(hkey, "Value5", NULL, NULL, NULL, NULL);
+ ok(res == ERROR_FILE_NOT_FOUND, "got %u\n", res);
+ res = RegQueryValueExA(hkey, "Value6", NULL, NULL, NULL, NULL);
+ ok(res == ERROR_FILE_NOT_FOUND, "got %u\n", res);
+ res = RegQueryValueExA(hkey, "Value7", NULL, NULL, NULL, NULL);
+ ok(res == ERROR_FILE_NOT_FOUND, "got %u\n", res);
- size = MAX_PATH;
- type = 0xdeadbeef;
- memset(path, 'a', MAX_PATH);
- res = RegQueryValueExA(hkey, "Value2", NULL, &type, (LPBYTE)path, &size);
- ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
- ok(!memcmp(path, "one\0two\0", size), "Wrong multi-sz data\n");
- ok(size == 9, "Expected 9, got %d\n", size);
- ok(type == REG_MULTI_SZ, "Expected REG_MULTI_SZ, got %d\n", type);
+todo_wine {
+ CHECK_REG_MULTI(hkey, "Value2", "one\0");
+ CHECK_REG_MULTI(hkey, "Value3", "two\0");
+}
- size = MAX_PATH;
- type = 0xdeadbeef;
- memset(path, 'a', MAX_PATH);
- res = RegQueryValueExA(hkey, "Value3", NULL, &type, (LPBYTE)path, &size);
- ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
- ok(!memcmp(path, "one\0two\0", size), "Wrong multi-sz data\n");
- ok(size == 9, "Expected 9, got %d\n", size);
- ok(type == REG_MULTI_SZ, "Expected REG_MULTI_SZ, got %d\n", type);
+ res = RegQueryValueExA(hkey, "format", NULL, NULL, NULL, NULL);
+ ok(res == ERROR_FILE_NOT_FOUND, "got %u\n", res);
+ res = RegQueryValueExA(hkey, "source", NULL, NULL, NULL, NULL);
+ ok(res == ERROR_FILE_NOT_FOUND, "got %u\n", res);
- size = MAX_PATH;
- type = 0xdeadbeef;
- memset(path, 'a', MAX_PATH);
- res = RegQueryValueExA(hkey, "Value4", NULL, &type, (LPBYTE)path, &size);
- ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
- ok(!memcmp(path, "one\0two\0", size), "Wrong multi-sz data\n");
- ok(size == 9, "Expected 9, got %d\n", size);
- ok(type == REG_MULTI_SZ, "Expected REG_MULTI_SZ, got %d\n", type);
+ res = RegOpenKeyA(hkey, "subkey", &subkey);
+ ok(res == ERROR_FILE_NOT_FOUND, "got %u\n", res);
- size = MAX_PATH;
- type = 0xdeadbeef;
- memset(path, 'a', MAX_PATH);
- res = RegQueryValueExA(hkey, "Value5", NULL, &type, (LPBYTE)path, &size);
- ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
- ok(!memcmp(path, "one\0two\0three\0", size), "Wrong multi-sz data\n");
- ok(size == 15, "Expected 15, got %d\n", size);
- ok(type == REG_MULTI_SZ, "Expected REG_MULTI_SZ, got %d\n", type);
+ res = RegOpenKeyA(hkey, "create", &subkey);
+ ok(!res, "got %u\n", res);
+ RegCloseKey(subkey);
+ res = RegDeleteKeyA(hkey, "create");
+ ok(!res, "got %u\n", res);
- size = MAX_PATH;
- type = 0xdeadbeef;
- memset(path, 'a', MAX_PATH);
- res = RegQueryValueExA(hkey, "Value6", NULL, &type, (LPBYTE)path, &size);
- ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
- ok(!memcmp(path, "", size), "Wrong multi-sz data\n");
- ok(size == 1, "Expected 1, got %d\n", size);
- ok(type == REG_MULTI_SZ, "Expected REG_MULTI_SZ, got %d\n", type);
+ res = RegOpenKeyA(hkey, "delete", &subkey);
+ ok(res == ERROR_FILE_NOT_FOUND, "got %u\n", res);
- size = MAX_PATH;
- type = 0xdeadbeef;
- memset(path, 'a', MAX_PATH);
- res = RegQueryValueExA(hkey, "Value7", NULL, &type, (LPBYTE)path, &size);
- ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
- ok(!memcmp(path, "two\0", size), "Wrong multi-sz data\n");
- ok(size == 5, "Expected 5, got %d\n", size);
- ok(type == REG_MULTI_SZ, "Expected REG_MULTI_SZ, got %d\n", type);
-
- size = sizeof(buf);
- type = 0xdeadbeef;
- memset(buf, 0, size);
- res = RegQueryValueExA(hkey, "Value8", NULL, &type, buf, &size);
- ok(res == ERROR_SUCCESS, "got %u\n", res);
- ok(*(DWORD *)buf == 1, "got %u\n", *(DWORD *)buf);
- ok(size == 4, "got %u\n", size);
- ok(type == REG_DWORD, "got %u\n", type);
-
- size = sizeof(buf);
- type = 0xdeadbeef;
- memset(buf, 0, size);
- res = RegQueryValueExA(hkey, "Value9", NULL, &type, buf, &size);
- ok(res == ERROR_SUCCESS, "got %u\n", res);
- ok(buf[0] == 1, "got %u\n", buf[0]);
- ok(size == 1, "got %u\n", size);
- ok(type == REG_BINARY, "got %u\n", type);
-
- size = sizeof(buf);
- type = 0xdeadbeef;
- memset(buf, 0, size);
- res = RegQueryValueExA(hkey, "Value10", NULL, &type, buf, &size);
- ok(res == ERROR_SUCCESS, "got %u\n", res);
- ok(buf[0] == 1, "got %u\n", buf[0]);
- ok(size == 1, "got %u\n", size);
- ok(type == REG_BINARY, "got %u\n", type);
-
- size = sizeof(buf);
- type = 0xdeadbeef;
- memset(buf, 0, size);
- res = RegQueryValueExA(hkey, "Value11", NULL, &type, buf, &size);
- ok(res == ERROR_SUCCESS, "got %u\n", res);
- ok(buf[0] == 1, "got %u\n", buf[0]);
- ok(size == 1, "got %u\n", size);
- ok(type == REG_BINARY, "got %u\n", type);
-
- size = sizeof(buf);
- type = 0xdeadbeef;
- memset(buf, 0, size);
- res = RegQueryValueExA(hkey, "Value12", NULL, &type, buf, &size);
- ok(res == ERROR_SUCCESS, "got %u\n", res);
- ok(*(DWORD *)buf == 1, "got %u\n", *(DWORD *)buf);
- ok(size == 4, "got %u\n", size);
- ok(type == REG_DWORD, "got %u\n", type);
-
- RegDeleteValueA(hkey, "Value");
- RegDeleteValueA(hkey, "Value1");
- RegDeleteValueA(hkey, "Value2");
- RegDeleteValueA(hkey, "Value3");
- RegDeleteValueA(hkey, "Value4");
- RegDeleteValueA(hkey, "Value5");
- RegDeleteValueA(hkey, "Value6");
- RegDeleteValueA(hkey, "Value7");
- RegDeleteValueA(hkey, "Value8");
- RegDeleteValueA(hkey, "Value9");
- RegDeleteValueA(hkey, "Value10");
- RegDeleteValueA(hkey, "Value11");
- RegDeleteValueA(hkey, "Value12");
RegCloseKey(hkey);
- RegDeleteKeyA(HKEY_LOCAL_MACHINE, "SOFTWARE\\Wine\\msitest");
+ res = RegDeleteKeyA(HKEY_CURRENT_USER, "msitest");
+ ok(!res, "got %u\n", res);
error:
DeleteFileA(msifile);
- DeleteFileA("msitest\\augustus");
RemoveDirectoryA("msitest");
}
@@ -5840,125 +5710,6 @@ error:
DeleteFileA(msifile);
}
-static void test_remove_registry_values(void)
-{
- UINT r;
- LONG res;
- HKEY key;
- REGSAM access = KEY_ALL_ACCESS;
-
- if (is_process_limited())
- {
- skip("process is limited\n");
- return;
- }
-
- create_test_files();
- create_file("msitest\\registry.txt", 1000);
- create_database(msifile, rrv_tables, sizeof(rrv_tables) / sizeof(msi_table));
-
- if (is_wow64)
- access |= KEY_WOW64_64KEY;
-
- MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
-
- RegCreateKeyExA(HKEY_LOCAL_MACHINE, "Software\\Wine\\key1", 0, NULL, 0, access, NULL, &key, NULL);
- RegSetValueExA(key, "value1", 0, REG_SZ, (const BYTE *)"1", 2);
- RegCloseKey(key);
-
- RegCreateKeyExA(HKEY_LOCAL_MACHINE, "Software\\Wine\\key2", 0, NULL, 0, access, NULL, &key, NULL);
- RegSetValueExA(key, "value2", 0, REG_SZ, (const BYTE *)"2", 2);
- RegCloseKey(key);
-
- RegCreateKeyExA(HKEY_LOCAL_MACHINE, "Software\\Wine\\keyA", 0, NULL, 0, access, NULL, &key, NULL);
- RegSetValueExA(key, "", 0, REG_SZ, (const BYTE *)"default", 8);
- RegSetValueExA(key, "valueA", 0, REG_SZ, (const BYTE *)"A", 2);
- RegSetValueExA(key, "valueB", 0, REG_SZ, (const BYTE *)"B", 2);
- RegCloseKey(key);
-
- RegCreateKeyExA(HKEY_LOCAL_MACHINE, "Software\\Wine\\keyB", 0, NULL, 0, access, NULL, &key, NULL);
- RegSetValueExA(key, "", 0, REG_SZ, (const BYTE *)"default", 8);
- RegSetValueExA(key, "valueB", 0, REG_SZ, (const BYTE *)"B", 2);
- RegCloseKey(key);
-
- r = MsiInstallProductA(msifile, NULL);
- if (r == ERROR_INSTALL_PACKAGE_REJECTED)
- {
- skip("Not enough rights to perform tests\n");
- goto error;
- }
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
-
- res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, "Software\\Wine\\key1", 0, access, &key);
- ok(res == ERROR_SUCCESS, "key removed\n");
- RegCloseKey(key);
-
- if (is_64bit)
- {
- res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, "Software\\Wow6432Node\\Wine\\key2", 0, KEY_ALL_ACCESS, &key);
- ok(res == ERROR_FILE_NOT_FOUND, "key not removed\n");
- }
- else
- {
- res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, "Software\\Wine\\key2", 0, KEY_ALL_ACCESS, &key);
- ok(res == ERROR_FILE_NOT_FOUND, "key not removed\n");
- }
-
- res = RegCreateKeyExA(HKEY_LOCAL_MACHINE, "Software\\Wine\\key2", 0, NULL, 0, access, NULL, &key, NULL);
- ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
- RegCloseKey(key);
-
- r = MsiInstallProductA(msifile, "REMOVE=ALL");
- ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
-
- if (is_64bit)
- {
- res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, "Software\\Wow6432Node\\Wine\\key1", 0, KEY_ALL_ACCESS, &key);
- ok(res == ERROR_FILE_NOT_FOUND, "key not removed\n");
- }
- else
- {
- res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, "Software\\Wine\\key1", 0, KEY_ALL_ACCESS, &key);
- ok(res == ERROR_FILE_NOT_FOUND, "key not removed\n");
- }
-
- res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, "Software\\Wine\\key2", 0, access, &key);
- ok(res == ERROR_SUCCESS, "key removed\n");
- RegCloseKey(key);
-
- res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, "Software\\Wine\\keyA", 0, access, &key);
- ok(res == ERROR_SUCCESS, "key removed\n");
- RegCloseKey(key);
-
- if (is_64bit)
- {
- res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, "Software\\Wow6432Node\\Wine\\keyB", 0, KEY_ALL_ACCESS, &key);
- ok(res == ERROR_FILE_NOT_FOUND, "key not removed\n");
- }
- else
- {
- res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, "Software\\Wine\\keyB", 0, KEY_ALL_ACCESS, &key);
- ok(res == ERROR_FILE_NOT_FOUND, "key not removed\n");
- }
-
- delete_key(HKEY_LOCAL_MACHINE, "Software\\Wine\\keyA", access);
- delete_key(HKEY_LOCAL_MACHINE, "Software\\Wine\\key2", access);
- delete_key(HKEY_LOCAL_MACHINE, "Software\\Wine", access);
-
- ok(!delete_pf("msitest\\registry.txt", TRUE), "file not removed\n");
- ok(!delete_pf("msitest", FALSE), "directory not removed\n");
-
-error:
- delete_key(HKEY_LOCAL_MACHINE, "Software\\Wine\\key1", access);
- delete_key(HKEY_LOCAL_MACHINE, "Software\\Wine\\key2", access);
- delete_key(HKEY_LOCAL_MACHINE, "Software\\Wine\\keyA", access);
- delete_key(HKEY_LOCAL_MACHINE, "Software\\Wine\\keyB", access);
-
- DeleteFileA("msitest\\registry.txt");
- delete_test_files();
- DeleteFileA(msifile);
-}
-
static void test_find_related_products(void)
{
UINT r;
@@ -6669,7 +6420,6 @@ START_TEST(action)
test_create_remove_shortcut();
test_publish_components();
test_remove_duplicate_files();
- test_remove_registry_values();
test_find_related_products();
test_ini_values();
test_register_class_info();
--
2.7.4
June 2, 2018