Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
a4e0fc95
Commit
a4e0fc95
authored
Feb 24, 2014
by
Nikolay Sivov
Committed by
Alexandre Julliard
Feb 24, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
oleaut32: Fix SafeArrayPutElement() for FADF_RECORD arrays.
parent
2ba5cdd3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
43 additions
and
16 deletions
+43
-16
safearray.c
dlls/oleaut32/safearray.c
+19
-15
safearray.c
dlls/oleaut32/tests/safearray.c
+24
-1
No files found.
dlls/oleaut32/safearray.c
View file @
a4e0fc95
...
@@ -898,23 +898,27 @@ HRESULT WINAPI SafeArrayPutElement(SAFEARRAY *psa, LONG *rgIndices, void *pvData
...
@@ -898,23 +898,27 @@ HRESULT WINAPI SafeArrayPutElement(SAFEARRAY *psa, LONG *rgIndices, void *pvData
if
(
!*
lpDest
)
if
(
!*
lpDest
)
hRet
=
E_OUTOFMEMORY
;
hRet
=
E_OUTOFMEMORY
;
}
}
else
else
if
(
psa
->
fFeatures
&
(
FADF_UNKNOWN
|
FADF_DISPATCH
))
{
{
if
(
psa
->
fFeatures
&
(
FADF_UNKNOWN
|
FADF_DISPATCH
))
IUnknown
*
lpUnknown
=
pvData
;
{
IUnknown
**
lpDest
=
lpvDest
;
LPUNKNOWN
lpUnknown
=
pvData
;
LPUNKNOWN
*
lpDest
=
lpvDest
;
if
(
lpUnknown
)
IUnknown_AddRef
(
lpUnknown
);
if
(
lpUnknown
)
if
(
*
lpDest
)
IUnknown_AddRef
(
lpUnknown
);
IUnknown_Release
(
*
lpDest
);
if
(
*
lpDest
)
*
lpDest
=
lpUnknown
;
IUnknown_Release
(
*
lpDest
);
*
lpDest
=
lpUnknown
;
}
else
{
/* Copy the data over */
memcpy
(
lpvDest
,
pvData
,
psa
->
cbElements
);
}
}
}
else
if
(
psa
->
fFeatures
&
FADF_RECORD
)
{
IRecordInfo
*
record
;
SafeArrayGetRecordInfo
(
psa
,
&
record
);
hRet
=
IRecordInfo_RecordCopy
(
record
,
pvData
,
lpvDest
);
IRecordInfo_Release
(
record
);
}
else
/* Copy the data over */
memcpy
(
lpvDest
,
pvData
,
psa
->
cbElements
);
}
}
SafeArrayUnlock
(
psa
);
SafeArrayUnlock
(
psa
);
}
}
...
...
dlls/oleaut32/tests/safearray.c
View file @
a4e0fc95
...
@@ -1062,10 +1062,11 @@ test_LockUnlock_Vector:
...
@@ -1062,10 +1062,11 @@ test_LockUnlock_Vector:
static
void
test_SafeArrayGetPutElement
(
void
)
static
void
test_SafeArrayGetPutElement
(
void
)
{
{
SAFEARRAYBOUND
sab
[
4
];
SAFEARRAYBOUND
sab
[
4
];
LONG
indices
[
NUM_DIMENSIONS
];
LONG
indices
[
NUM_DIMENSIONS
]
,
index
;
SAFEARRAY
*
sa
;
SAFEARRAY
*
sa
;
HRESULT
hres
;
HRESULT
hres
;
int
value
=
0
,
gotvalue
,
dimension
;
int
value
=
0
,
gotvalue
,
dimension
;
IRecordInfoImpl
*
irec
;
unsigned
int
x
,
y
,
z
,
a
;
unsigned
int
x
,
y
,
z
,
a
;
for
(
dimension
=
0
;
dimension
<
NUM_DIMENSIONS
;
dimension
++
)
for
(
dimension
=
0
;
dimension
<
NUM_DIMENSIONS
;
dimension
++
)
...
@@ -1184,6 +1185,28 @@ static void test_SafeArrayGetPutElement(void)
...
@@ -1184,6 +1185,28 @@ static void test_SafeArrayGetPutElement(void)
}
}
hres
=
SafeArrayDestroy
(
sa
);
hres
=
SafeArrayDestroy
(
sa
);
ok
(
hres
==
S_OK
,
"got 0x%08x
\n
"
,
hres
);
ok
(
hres
==
S_OK
,
"got 0x%08x
\n
"
,
hres
);
/* VT_RECORD array */
irec
=
IRecordInfoImpl_Construct
();
irec
->
ref
=
1
;
sab
[
0
].
lLbound
=
0
;
sab
[
0
].
cElements
=
8
;
sa
=
pSafeArrayCreateEx
(
VT_RECORD
,
1
,
sab
,
&
irec
->
IRecordInfo_iface
);
ok
(
sa
!=
NULL
,
"failed to create array
\n
"
);
ok
(
irec
->
ref
==
2
,
"got %d
\n
"
,
irec
->
ref
);
index
=
0
;
irec
->
recordcopy
=
0
;
hres
=
SafeArrayPutElement
(
sa
,
&
index
,
(
void
*
)
0xdeadbeef
);
ok
(
hres
==
S_OK
,
"got 0x%08x
\n
"
,
hres
);
ok
(
irec
->
recordcopy
==
1
,
"got %d
\n
"
,
irec
->
recordcopy
);
hres
=
SafeArrayDestroy
(
sa
);
ok
(
hres
==
S_OK
,
"got 0x%08x
\n
"
,
hres
);
ok
(
irec
->
ref
==
1
,
"got %d
\n
"
,
irec
->
ref
);
IRecordInfo_Release
(
&
irec
->
IRecordInfo_iface
);
}
}
static
void
test_SafeArrayGetPutElement_BSTR
(
void
)
static
void
test_SafeArrayGetPutElement_BSTR
(
void
)
...
...
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