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
6c94cdc9
Commit
6c94cdc9
authored
Dec 14, 2010
by
Michael Stefaniuc
Committed by
Alexandre Julliard
Dec 14, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
oleaut32/tests: Use an iface instead of an vtbl pointer in IRecordInfoImpl.
parent
26de0e62
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
7 deletions
+13
-7
safearray.c
dlls/oleaut32/tests/safearray.c
+13
-7
No files found.
dlls/oleaut32/tests/safearray.c
View file @
6c94cdc9
...
@@ -25,6 +25,7 @@
...
@@ -25,6 +25,7 @@
#include <float.h>
#include <float.h>
#define COBJMACROS
#define COBJMACROS
#define CONST_VTABLE
#include "wine/test.h"
#include "wine/test.h"
#include "windef.h"
#include "windef.h"
#include "winbase.h"
#include "winbase.h"
...
@@ -76,7 +77,7 @@ static BOOL HAVE_OLEAUT32_INT_PTR;
...
@@ -76,7 +77,7 @@ static BOOL HAVE_OLEAUT32_INT_PTR;
*/
*/
typedef
struct
IRecordInfoImpl
typedef
struct
IRecordInfoImpl
{
{
const
IRecordInfoVtbl
*
lpvtbl
;
IRecordInfo
IRecordInfo_iface
;
LONG
ref
;
LONG
ref
;
DWORD
sizeCalled
;
DWORD
sizeCalled
;
DWORD
clearCalled
;
DWORD
clearCalled
;
...
@@ -84,12 +85,17 @@ typedef struct IRecordInfoImpl
...
@@ -84,12 +85,17 @@ typedef struct IRecordInfoImpl
static
const
IRecordInfoVtbl
IRecordInfoImpl_VTable
;
static
const
IRecordInfoVtbl
IRecordInfoImpl_VTable
;
static
inline
IRecordInfoImpl
*
impl_from_IRecordInfo
(
IRecordInfo
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
IRecordInfoImpl
,
IRecordInfo_iface
);
}
static
IRecordInfoImpl
*
IRecordInfoImpl_Construct
(
void
)
static
IRecordInfoImpl
*
IRecordInfoImpl_Construct
(
void
)
{
{
IRecordInfoImpl
*
rec
;
IRecordInfoImpl
*
rec
;
rec
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
IRecordInfoImpl
));
rec
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
IRecordInfoImpl
));
rec
->
lpv
tbl
=
&
IRecordInfoImpl_VTable
;
rec
->
IRecordInfo_iface
.
lpV
tbl
=
&
IRecordInfoImpl_VTable
;
rec
->
ref
=
START_REF_COUNT
;
rec
->
ref
=
START_REF_COUNT
;
rec
->
clearCalled
=
0
;
rec
->
clearCalled
=
0
;
rec
->
sizeCalled
=
0
;
rec
->
sizeCalled
=
0
;
...
@@ -98,13 +104,13 @@ static IRecordInfoImpl *IRecordInfoImpl_Construct(void)
...
@@ -98,13 +104,13 @@ static IRecordInfoImpl *IRecordInfoImpl_Construct(void)
static
ULONG
CALLBACK
IRecordInfoImpl_AddRef
(
IRecordInfo
*
iface
)
static
ULONG
CALLBACK
IRecordInfoImpl_AddRef
(
IRecordInfo
*
iface
)
{
{
IRecordInfoImpl
*
This
=
(
IRecordInfoImpl
*
)
iface
;
IRecordInfoImpl
*
This
=
impl_from_IRecordInfo
(
iface
)
;
return
InterlockedIncrement
(
&
This
->
ref
);
return
InterlockedIncrement
(
&
This
->
ref
);
}
}
static
ULONG
CALLBACK
IRecordInfoImpl_Release
(
IRecordInfo
*
iface
)
static
ULONG
CALLBACK
IRecordInfoImpl_Release
(
IRecordInfo
*
iface
)
{
{
IRecordInfoImpl
*
This
=
(
IRecordInfoImpl
*
)
iface
;
IRecordInfoImpl
*
This
=
impl_from_IRecordInfo
(
iface
)
;
return
InterlockedDecrement
(
&
This
->
ref
);
return
InterlockedDecrement
(
&
This
->
ref
);
}
}
...
@@ -112,14 +118,14 @@ static BOOL fail_GetSize; /* Whether to fail the GetSize call */
...
@@ -112,14 +118,14 @@ static BOOL fail_GetSize; /* Whether to fail the GetSize call */
static
HRESULT
CALLBACK
IRecordInfoImpl_RecordClear
(
IRecordInfo
*
iface
,
PVOID
pvExisting
)
static
HRESULT
CALLBACK
IRecordInfoImpl_RecordClear
(
IRecordInfo
*
iface
,
PVOID
pvExisting
)
{
{
IRecordInfoImpl
*
This
=
(
IRecordInfoImpl
*
)
iface
;
IRecordInfoImpl
*
This
=
impl_from_IRecordInfo
(
iface
)
;
This
->
clearCalled
++
;
This
->
clearCalled
++
;
return
S_OK
;
return
S_OK
;
}
}
static
HRESULT
CALLBACK
IRecordInfoImpl_GetSize
(
IRecordInfo
*
iface
,
ULONG
*
size
)
static
HRESULT
CALLBACK
IRecordInfoImpl_GetSize
(
IRecordInfo
*
iface
,
ULONG
*
size
)
{
{
IRecordInfoImpl
*
This
=
(
IRecordInfoImpl
*
)
iface
;
IRecordInfoImpl
*
This
=
impl_from_IRecordInfo
(
iface
)
;
This
->
sizeCalled
++
;
This
->
sizeCalled
++
;
*
size
=
17
;
*
size
=
17
;
if
(
fail_GetSize
)
if
(
fail_GetSize
)
...
@@ -1449,7 +1455,7 @@ static void test_SafeArrayCreateEx(void)
...
@@ -1449,7 +1455,7 @@ static void test_SafeArrayCreateEx(void)
hres
=
pSafeArrayGetRecordInfo
(
sa
,
&
saRec
);
hres
=
pSafeArrayGetRecordInfo
(
sa
,
&
saRec
);
ok
(
hres
==
S_OK
,
"GRI failed
\n
"
);
ok
(
hres
==
S_OK
,
"GRI failed
\n
"
);
ok
(
saRec
==
(
IRecordInfo
*
)
iRec
,
"Different saRec
\n
"
);
ok
(
saRec
==
&
iRec
->
IRecordInfo_iface
,
"Different saRec
\n
"
);
ok
(
iRec
->
ref
==
START_REF_COUNT
+
2
,
"Didn't AddRef %d
\n
"
,
iRec
->
ref
);
ok
(
iRec
->
ref
==
START_REF_COUNT
+
2
,
"Didn't AddRef %d
\n
"
,
iRec
->
ref
);
if
(
iRec
->
ref
==
START_REF_COUNT
+
2
)
if
(
iRec
->
ref
==
START_REF_COUNT
+
2
)
IRecordInfo_Release
(
saRec
);
IRecordInfo_Release
(
saRec
);
...
...
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