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
7fce7580
Commit
7fce7580
authored
Dec 13, 2019
by
Hans Leidekker
Committed by
Alexandre Julliard
Dec 13, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msado15: Implement _Recordset_AddNew.
Signed-off-by:
Hans Leidekker
<
hans@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
b6766167
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
72 additions
and
3 deletions
+72
-3
recordset.c
dlls/msado15/recordset.c
+27
-2
msado15.c
dlls/msado15/tests/msado15.c
+45
-1
No files found.
dlls/msado15/recordset.c
View file @
7fce7580
...
...
@@ -887,10 +887,35 @@ static HRESULT WINAPI recordset_get_Source( _Recordset *iface, VARIANT *source )
return
E_NOTIMPL
;
}
static
BOOL
resize_recordset
(
struct
recordset
*
recordset
,
ULONG
row_count
)
{
ULONG
row_size
=
get_column_count
(
recordset
)
*
sizeof
(
*
recordset
->
data
);
if
(
row_count
>
recordset
->
allocated
)
{
VARIANT
*
tmp
;
ULONG
count
=
max
(
row_count
,
recordset
->
allocated
*
2
);
if
(
!
(
tmp
=
heap_realloc_zero
(
recordset
->
data
,
count
*
row_size
)))
return
FALSE
;
recordset
->
data
=
tmp
;
recordset
->
allocated
=
count
;
}
recordset
->
count
=
row_count
;
return
TRUE
;
}
static
HRESULT
WINAPI
recordset_AddNew
(
_Recordset
*
iface
,
VARIANT
field_list
,
VARIANT
values
)
{
FIXME
(
"%p, %s, %s
\n
"
,
iface
,
debugstr_variant
(
&
field_list
),
debugstr_variant
(
&
values
)
);
return
E_NOTIMPL
;
struct
recordset
*
recordset
=
impl_from_Recordset
(
iface
);
TRACE
(
"%p, %s, %s
\n
"
,
recordset
,
debugstr_variant
(
&
field_list
),
debugstr_variant
(
&
values
)
);
FIXME
(
"ignoring field list and values
\n
"
);
if
(
recordset
->
state
==
adStateClosed
)
return
MAKE_ADO_HRESULT
(
adErrObjectClosed
);
if
(
!
resize_recordset
(
recordset
,
recordset
->
count
+
1
))
return
E_OUTOFMEMORY
;
recordset
->
index
++
;
return
S_OK
;
}
static
HRESULT
WINAPI
recordset_CancelUpdate
(
_Recordset
*
iface
)
...
...
dlls/msado15/tests/msado15.c
View file @
7fce7580
...
...
@@ -47,7 +47,9 @@ static void test_Recordset(void)
{
_Recordset
*
recordset
;
Fields
*
fields
,
*
fields2
;
LONG
refs
,
count
;
LONG
refs
,
count
,
state
;
VARIANT
missing
;
BSTR
name
;
HRESULT
hr
;
hr
=
CoCreateInstance
(
&
CLSID_Recordset
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID__Recordset
,
(
void
**
)
&
recordset
);
...
...
@@ -92,6 +94,48 @@ static void test_Recordset(void)
/* fields object still has a reference */
refs
=
Fields_Release
(
fields2
);
ok
(
refs
==
1
,
"got %d
\n
"
,
refs
);
hr
=
CoCreateInstance
(
&
CLSID_Recordset
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID__Recordset
,
(
void
**
)
&
recordset
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
state
=
-
1
;
hr
=
_Recordset_get_State
(
recordset
,
&
state
);
todo_wine
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
todo_wine
ok
(
state
==
adStateClosed
,
"got %d
\n
"
,
state
);
VariantInit
(
&
missing
);
hr
=
_Recordset_AddNew
(
recordset
,
missing
,
missing
);
ok
(
hr
==
MAKE_ADO_HRESULT
(
adErrObjectClosed
),
"got %08x
\n
"
,
hr
);
V_VT
(
&
missing
)
=
VT_ERROR
;
V_ERROR
(
&
missing
)
=
DISP_E_PARAMNOTFOUND
;
hr
=
_Recordset_Open
(
recordset
,
missing
,
missing
,
adOpenStatic
,
adLockBatchOptimistic
,
adCmdUnspecified
);
todo_wine
ok
(
hr
==
MAKE_ADO_HRESULT
(
adErrInvalidConnection
),
"got %08x
\n
"
,
hr
);
hr
=
_Recordset_get_Fields
(
recordset
,
&
fields
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
name
=
SysAllocString
(
L"field"
);
hr
=
Fields__Append
(
fields
,
name
,
adInteger
,
4
,
adFldUnspecified
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
SysFreeString
(
name
);
hr
=
_Recordset_Open
(
recordset
,
missing
,
missing
,
adOpenStatic
,
adLockBatchOptimistic
,
adCmdUnspecified
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
state
=
-
1
;
hr
=
_Recordset_get_State
(
recordset
,
&
state
);
todo_wine
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
todo_wine
ok
(
state
==
adStateOpen
,
"got %d
\n
"
,
state
);
hr
=
_Recordset_AddNew
(
recordset
,
missing
,
missing
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
hr
=
_Recordset_Close
(
recordset
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
Fields_Release
(
fields
);
_Recordset_Release
(
recordset
);
}
static
void
test_Fields
(
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