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
d5f77d6d
Commit
d5f77d6d
authored
Dec 12, 2019
by
Hans Leidekker
Committed by
Alexandre Julliard
Dec 12, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msado15: Implement Field_get_Value and Field_put_Value.
Signed-off-by:
Hans Leidekker
<
hans@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
56e2ac13
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
62 additions
and
5 deletions
+62
-5
recordset.c
dlls/msado15/recordset.c
+62
-5
No files found.
dlls/msado15/recordset.c
View file @
d5f77d6d
...
...
@@ -36,7 +36,12 @@ struct recordset
{
_Recordset
Recordset_iface
;
LONG
refs
;
LONG
state
;
struct
fields
*
fields
;
LONG
count
;
LONG
allocated
;
LONG
index
;
VARIANT
*
data
;
};
struct
fields
...
...
@@ -187,16 +192,51 @@ static HRESULT WINAPI field_get_Type( Field *iface, DataTypeEnum *type )
return
S_OK
;
}
static
LONG
get_column_count
(
struct
recordset
*
recordset
)
{
return
recordset
->
fields
->
count
;
}
static
HRESULT
WINAPI
field_get_Value
(
Field
*
iface
,
VARIANT
*
val
)
{
FIXME
(
"%p, %p
\n
"
,
iface
,
val
);
return
E_NOTIMPL
;
struct
field
*
field
=
impl_from_Field
(
iface
);
ULONG
row
=
field
->
recordset
->
index
,
col
=
field
->
index
,
col_count
;
VARIANT
copy
;
HRESULT
hr
;
TRACE
(
"%p, %p
\n
"
,
field
,
val
);
if
(
field
->
recordset
->
state
==
adStateClosed
)
return
MAKE_ADO_HRESULT
(
adErrObjectClosed
);
if
(
field
->
recordset
->
index
<
0
)
return
MAKE_ADO_HRESULT
(
adErrNoCurrentRecord
);
col_count
=
get_column_count
(
field
->
recordset
);
VariantInit
(
&
copy
);
if
((
hr
=
VariantCopy
(
&
copy
,
&
field
->
recordset
->
data
[
row
*
col_count
+
col
]
))
!=
S_OK
)
return
hr
;
*
val
=
copy
;
return
S_OK
;
}
static
HRESULT
WINAPI
field_put_Value
(
Field
*
iface
,
VARIANT
val
)
{
FIXME
(
"%p, %s
\n
"
,
iface
,
debugstr_variant
(
&
val
)
);
return
E_NOTIMPL
;
struct
field
*
field
=
impl_from_Field
(
iface
);
ULONG
row
=
field
->
recordset
->
index
,
col
=
field
->
index
,
col_count
;
VARIANT
copy
;
HRESULT
hr
;
TRACE
(
"%p, %s
\n
"
,
field
,
debugstr_variant
(
&
val
)
);
if
(
field
->
recordset
->
state
==
adStateClosed
)
return
MAKE_ADO_HRESULT
(
adErrObjectClosed
);
if
(
field
->
recordset
->
index
<
0
)
return
MAKE_ADO_HRESULT
(
adErrNoCurrentRecord
);
col_count
=
get_column_count
(
field
->
recordset
);
VariantInit
(
&
copy
);
if
((
hr
=
VariantCopy
(
&
copy
,
&
val
))
!=
S_OK
)
return
hr
;
field
->
recordset
->
data
[
row
*
col_count
+
col
]
=
copy
;
return
S_OK
;
}
static
HRESULT
WINAPI
field_get_Precision
(
Field
*
iface
,
unsigned
char
*
precision
)
...
...
@@ -614,6 +654,22 @@ static ULONG WINAPI recordset_AddRef( _Recordset *iface )
return
refs
;
}
static
void
close_recordset
(
struct
recordset
*
recordset
)
{
ULONG
row
,
col
,
col_count
=
get_column_count
(
recordset
);
recordset
->
fields
->
recordset
=
NULL
;
Fields_Release
(
&
recordset
->
fields
->
Fields_iface
);
recordset
->
fields
=
NULL
;
for
(
row
=
0
;
row
<
recordset
->
count
;
row
++
)
for
(
col
=
0
;
col
<
col_count
;
col
++
)
VariantClear
(
&
recordset
->
data
[
row
*
col_count
+
col
]
);
recordset
->
count
=
recordset
->
allocated
=
recordset
->
index
=
0
;
heap_free
(
recordset
->
data
);
recordset
->
data
=
NULL
;
}
static
ULONG
WINAPI
recordset_Release
(
_Recordset
*
iface
)
{
struct
recordset
*
recordset
=
impl_from_Recordset
(
iface
);
...
...
@@ -622,7 +678,7 @@ static ULONG WINAPI recordset_Release( _Recordset *iface )
if
(
!
refs
)
{
TRACE
(
"destroying %p
\n
"
,
recordset
);
recordset
->
fields
->
recordset
=
NULL
;
close_recordset
(
recordset
)
;
heap_free
(
recordset
);
}
return
refs
;
...
...
@@ -1264,6 +1320,7 @@ HRESULT Recordset_create( void **obj )
if
(
!
(
recordset
=
heap_alloc_zero
(
sizeof
(
*
recordset
)
)))
return
E_OUTOFMEMORY
;
recordset
->
Recordset_iface
.
lpVtbl
=
&
recordset_vtbl
;
recordset
->
refs
=
1
;
recordset
->
index
=
-
1
;
*
obj
=
&
recordset
->
Recordset_iface
;
TRACE
(
"returning iface %p
\n
"
,
*
obj
);
...
...
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