Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
02ce1008
Commit
02ce1008
authored
Sep 27, 2022
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "oleaut32: Dereference VT_RECORD|VT_BYREF in place.".
This reverts commit
28e0d8ff
. It breaks the tests.
parent
2a4ec7da
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1 addition
and
61 deletions
+1
-61
vartest.c
dlls/oleaut32/tests/vartest.c
+0
-60
variant.c
dlls/oleaut32/variant.c
+1
-1
No files found.
dlls/oleaut32/tests/vartest.c
View file @
02ce1008
...
...
@@ -902,19 +902,6 @@ static void test_VariantClear(void)
ok
(
recinfo
->
recordclear
==
1
,
"got %d
\n
"
,
recinfo
->
recordclear
);
ok
(
recinfo
->
ref
==
1
,
"got %ld
\n
"
,
recinfo
->
ref
);
IRecordInfo_Release
(
&
recinfo
->
IRecordInfo_iface
);
/* RECORD BYREF */
recinfo
=
get_test_recordinfo
();
V_VT
(
&
v
)
=
VT_RECORD
|
VT_BYREF
;
V_RECORDINFO
(
&
v
)
=
&
recinfo
->
IRecordInfo_iface
;
V_RECORD
(
&
v
)
=
recinfo
->
validsrc
;
hres
=
VariantClear
(
&
v
);
ok
(
hres
==
S_OK
,
"ret %08lx
\n
"
,
hres
);
ok
(
V_VT
(
&
v
)
==
VT_EMPTY
,
"got vt = %d"
,
V_VT
(
&
v
));
/* BYREF does not own the pointed-to V_RECORD/INFO, so no RecordClear and no Release */
ok
(
recinfo
->
recordclear
==
0
,
"got %d
\n
"
,
recinfo
->
recordclear
);
ok
(
recinfo
->
ref
==
1
,
"got %ld
\n
"
,
recinfo
->
ref
);
IRecordInfo_Release
(
&
recinfo
->
IRecordInfo_iface
);
}
static
void
test_VariantCopy
(
void
)
...
...
@@ -1082,7 +1069,6 @@ static void test_VariantCopyInd(void)
size_t
i
;
BYTE
buffer
[
64
];
HRESULT
hres
,
hExpected
;
IRecordInfoImpl
*
recinfo
;
memset
(
buffer
,
0
,
sizeof
(
buffer
));
...
...
@@ -1273,52 +1259,6 @@ static void test_VariantCopyInd(void)
hres
=
VariantCopyInd
(
&
vDst
,
&
vSrc
);
ok
(
hres
==
E_INVALIDARG
,
"CopyInd(ref->ref): expected E_INVALIDARG, got 0x%08lx
\n
"
,
hres
);
/* source data for a deep-copy of VT_BYREF|VT_RECORD... */
recinfo
=
get_test_recordinfo
();
V_VT
(
&
vSrc
)
=
VT_RECORD
|
VT_BYREF
;
V_RECORDINFO
(
&
vSrc
)
=
&
recinfo
->
IRecordInfo_iface
;
V_RECORD
(
&
vSrc
)
=
recinfo
->
validsrc
;
/* into a separate vDst */
VariantInit
(
&
vDst
);
hres
=
VariantCopyInd
(
&
vDst
,
&
vSrc
);
ok
(
hres
==
S_OK
,
"VariantCopyInd failed: 0x%08lx
\n
"
,
hres
);
ok
(
V_VT
(
&
vDst
)
==
VT_RECORD
,
"got vt = %d|0x%X
\n
"
,
V_VT
(
&
vDst
)
&
VT_TYPEMASK
,
V_VT
(
&
vDst
)
&
~
VT_TYPEMASK
);
ok
(
V_RECORDINFO
(
&
vDst
)
==
&
recinfo
->
IRecordInfo_iface
,
"got %p
\n
"
,
V_RECORDINFO
(
&
vDst
));
ok
(
recinfo
->
recordclear
==
0
,
"got %d
\n
"
,
recinfo
->
recordclear
);
ok
(
V_RECORD
(
&
vDst
)
!=
recinfo
->
validsrc
,
"expected a newly-allocated deep copy
\n
"
);
ok
(
recinfo
->
getsize
==
1
,
"got %d
\n
"
,
recinfo
->
getsize
);
ok
(
recinfo
->
recordcopy
==
1
,
"got %d
\n
"
,
recinfo
->
recordcopy
);
ok
(
recinfo
->
ref
==
2
,
"got %ld
\n
"
,
recinfo
->
ref
);
VariantClear
(
&
vDst
);
ok
(
recinfo
->
ref
==
1
,
"got %ld
\n
"
,
recinfo
->
ref
);
ok
(
recinfo
->
recordclear
==
1
,
"got %d
\n
"
,
recinfo
->
recordclear
);
recinfo
->
getsize
=
0
;
recinfo
->
recordcopy
=
0
;
recinfo
->
recordclear
=
0
;
/* and also in-place */
hres
=
VariantCopyInd
(
&
vSrc
,
&
vSrc
);
ok
(
V_VT
(
&
vSrc
)
==
VT_RECORD
,
"got vt = %d|0x%X
\n
"
,
V_VT
(
&
vSrc
)
&
VT_TYPEMASK
,
V_VT
(
&
vSrc
)
&
~
VT_TYPEMASK
);
ok
(
V_RECORDINFO
(
&
vSrc
)
==
&
recinfo
->
IRecordInfo_iface
,
"got %p
\n
"
,
V_RECORDINFO
(
&
vSrc
));
/* ++ref and no RecordClear, since the source BYREF does not own the V_RECORD/INFO
* which it pointed to, and thus did not free them when overwritten */
ok
(
recinfo
->
ref
==
2
,
"got %ld
\n
"
,
recinfo
->
ref
);
ok
(
recinfo
->
recordclear
==
0
,
"got %d
\n
"
,
recinfo
->
recordclear
);
ok
(
V_RECORD
(
&
vDst
)
!=
recinfo
->
validsrc
,
"expected a newly-allocated deep copy
\n
"
);
ok
(
recinfo
->
getsize
==
1
,
"got %d
\n
"
,
recinfo
->
getsize
);
ok
(
recinfo
->
recordcopy
==
1
,
"got %d
\n
"
,
recinfo
->
recordcopy
);
/* but the no-longer-BYREF output owns and will free its copies */
VariantClear
(
&
vSrc
);
ok
(
recinfo
->
ref
==
1
,
"got %ld
\n
"
,
recinfo
->
ref
);
ok
(
recinfo
->
recordclear
==
1
,
"got %d
\n
"
,
recinfo
->
recordclear
);
IRecordInfo_Release
(
&
recinfo
->
IRecordInfo_iface
);
}
static
HRESULT
(
WINAPI
*
pVarParseNumFromStr
)(
const
OLECHAR
*
,
LCID
,
ULONG
,
NUMPARSE
*
,
BYTE
*
);
...
...
dlls/oleaut32/variant.c
View file @
02ce1008
...
...
@@ -879,7 +879,7 @@ HRESULT WINAPI VariantCopyInd(VARIANT* pvargDest, const VARIANTARG* pvargSrc)
}
else
if
(
V_VT
(
pSrc
)
==
(
VT_RECORD
|
VT_BYREF
))
{
hres
=
VARIANT_CopyIRecordInfo
(
pvargDest
,
pSrc
);
hres
=
VARIANT_CopyIRecordInfo
(
pvargDest
,
p
varg
Src
);
}
else
if
(
V_VT
(
pSrc
)
==
(
VT_DISPATCH
|
VT_BYREF
)
||
V_VT
(
pSrc
)
==
(
VT_UNKNOWN
|
VT_BYREF
))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment