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
89440f58
Commit
89440f58
authored
Mar 01, 2022
by
Eric Pouech
Committed by
Alexandre Julliard
Mar 01, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msado15/tests: Enable compilation with long types.
Signed-off-by:
Eric Pouech
<
eric.pouech@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
1a4ff1e8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
234 additions
and
235 deletions
+234
-235
Makefile.in
dlls/msado15/tests/Makefile.in
+0
-1
msado15.c
dlls/msado15/tests/msado15.c
+234
-234
No files found.
dlls/msado15/tests/Makefile.in
View file @
89440f58
EXTRADEFS
=
-DWINE_NO_LONG_TYPES
TESTDLL
=
msado15.dll
IMPORTS
=
oleaut32 ole32
...
...
dlls/msado15/tests/msado15.c
View file @
89440f58
...
...
@@ -62,7 +62,7 @@ static void test_Recordset(void)
VARIANT
bookmark
;
hr
=
CoCreateInstance
(
&
CLSID_Recordset
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID__Recordset
,
(
void
**
)
&
recordset
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got %08
l
x
\n
"
,
hr
);
hr
=
_Recordset_QueryInterface
(
recordset
,
&
IID_IRunnableObject
,
(
void
**
)
&
runtime
);
ok
(
hr
==
E_NOINTERFACE
,
"Unexpected IRunnableObject interface
\n
"
);
...
...
@@ -71,252 +71,252 @@ static void test_Recordset(void)
/* _Recordset object supports ISupportErrorInfo */
errorinfo
=
NULL
;
hr
=
_Recordset_QueryInterface
(
recordset
,
&
IID_ISupportErrorInfo
,
(
void
**
)
&
errorinfo
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got %08
l
x
\n
"
,
hr
);
if
(
errorinfo
)
ISupportErrorInfo_Release
(
errorinfo
);
hr
=
_Recordset_get_Fields
(
recordset
,
&
fields
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got %08
l
x
\n
"
,
hr
);
/* calling get_Fields again returns the same object */
hr
=
_Recordset_get_Fields
(
recordset
,
&
fields2
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got %08
l
x
\n
"
,
hr
);
ok
(
fields2
==
fields
,
"expected same object
\n
"
);
count
=
-
1
;
hr
=
Fields_get_Count
(
fields2
,
&
count
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
!
count
,
"got %d
\n
"
,
count
);
ok
(
hr
==
S_OK
,
"got %08
l
x
\n
"
,
hr
);
ok
(
!
count
,
"got %
l
d
\n
"
,
count
);
hr
=
_Recordset_Close
(
recordset
);
ok
(
hr
==
MAKE_ADO_HRESULT
(
adErrObjectClosed
),
"got %08x
\n
"
,
hr
);
ok
(
hr
==
MAKE_ADO_HRESULT
(
adErrObjectClosed
),
"got %08
l
x
\n
"
,
hr
);
Fields_Release
(
fields2
);
hr
=
CoCreateInstance
(
&
CLSID_Recordset
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID__Recordset
,
(
void
**
)
&
recordset
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got %08
l
x
\n
"
,
hr
);
state
=
-
1
;
hr
=
_Recordset_get_State
(
recordset
,
&
state
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
state
==
adStateClosed
,
"got %d
\n
"
,
state
);
ok
(
hr
==
S_OK
,
"got %08
l
x
\n
"
,
hr
);
ok
(
state
==
adStateClosed
,
"got %
l
d
\n
"
,
state
);
location
=
-
1
;
hr
=
_Recordset_get_CursorLocation
(
recordset
,
&
location
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got %08
l
x
\n
"
,
hr
);
ok
(
location
==
adUseServer
,
"got %d
\n
"
,
location
);
cursor
=
adOpenUnspecified
;
hr
=
_Recordset_get_CursorType
(
recordset
,
&
cursor
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got %08
l
x
\n
"
,
hr
);
ok
(
cursor
==
adOpenForwardOnly
,
"got %d
\n
"
,
cursor
);
VariantInit
(
&
bookmark
);
hr
=
_Recordset_get_Bookmark
(
recordset
,
&
bookmark
);
ok
(
hr
==
MAKE_ADO_HRESULT
(
adErrObjectClosed
),
"got %08x
\n
"
,
hr
);
ok
(
hr
==
MAKE_ADO_HRESULT
(
adErrObjectClosed
),
"got %08
l
x
\n
"
,
hr
);
VariantInit
(
&
bookmark
);
hr
=
_Recordset_put_Bookmark
(
recordset
,
bookmark
);
ok
(
hr
==
MAKE_ADO_HRESULT
(
adErrObjectClosed
),
"got %08x
\n
"
,
hr
);
ok
(
hr
==
MAKE_ADO_HRESULT
(
adErrObjectClosed
),
"got %08
l
x
\n
"
,
hr
);
VariantInit
(
&
missing
);
hr
=
_Recordset_AddNew
(
recordset
,
missing
,
missing
);
ok
(
hr
==
MAKE_ADO_HRESULT
(
adErrObjectClosed
),
"got %08x
\n
"
,
hr
);
ok
(
hr
==
MAKE_ADO_HRESULT
(
adErrObjectClosed
),
"got %08
l
x
\n
"
,
hr
);
V_VT
(
&
missing
)
=
VT_ERROR
;
V_ERROR
(
&
missing
)
=
DISP_E_PARAMNOTFOUND
;
hr
=
_Recordset_Open
(
recordset
,
missing
,
missing
,
adOpenStatic
,
adLockBatchOptimistic
,
adCmdUnspecified
);
ok
(
hr
==
MAKE_ADO_HRESULT
(
adErrInvalidConnection
),
"got %08x
\n
"
,
hr
);
ok
(
hr
==
MAKE_ADO_HRESULT
(
adErrInvalidConnection
),
"got %08
l
x
\n
"
,
hr
);
hr
=
_Recordset_get_Fields
(
recordset
,
&
fields
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got %08
l
x
\n
"
,
hr
);
name
=
SysAllocString
(
L"field"
);
hr
=
Fields__Append
(
fields
,
name
,
adInteger
,
4
,
adFldUnspecified
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got %08
l
x
\n
"
,
hr
);
V_VT
(
&
index
)
=
VT_I4
;
V_I4
(
&
index
)
=
1000
;
hr
=
Fields_get_Item
(
fields
,
index
,
&
field
);
ok
(
hr
==
MAKE_ADO_HRESULT
(
adErrItemNotFound
),
"got %08x
\n
"
,
hr
);
ok
(
hr
==
MAKE_ADO_HRESULT
(
adErrItemNotFound
),
"got %08
l
x
\n
"
,
hr
);
V_VT
(
&
index
)
=
VT_I4
;
V_I4
(
&
index
)
=
0
;
hr
=
Fields_get_Item
(
fields
,
index
,
&
field
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got %08
l
x
\n
"
,
hr
);
Field_Release
(
field
);
V_VT
(
&
index
)
=
VT_I2
;
V_I4
(
&
index
)
=
0
;
hr
=
Fields_get_Item
(
fields
,
index
,
&
field
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got %08
l
x
\n
"
,
hr
);
Field_Release
(
field
);
V_VT
(
&
index
)
=
VT_I1
;
V_I1
(
&
index
)
=
0
;
hr
=
Fields_get_Item
(
fields
,
index
,
&
field
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got %08
l
x
\n
"
,
hr
);
Field_Release
(
field
);
V_VT
(
&
index
)
=
VT_R8
;
V_R8
(
&
index
)
=
0
.
1
;
hr
=
Fields_get_Item
(
fields
,
index
,
&
field
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got %08
l
x
\n
"
,
hr
);
Field_Release
(
field
);
V_VT
(
&
index
)
=
VT_UNKNOWN
;
V_UNKNOWN
(
&
index
)
=
NULL
;
hr
=
Fields_get_Item
(
fields
,
index
,
&
field
);
ok
(
hr
==
MAKE_ADO_HRESULT
(
adErrItemNotFound
),
"got %08x
\n
"
,
hr
);
ok
(
hr
==
MAKE_ADO_HRESULT
(
adErrItemNotFound
),
"got %08
l
x
\n
"
,
hr
);
V_VT
(
&
index
)
=
VT_BSTR
;
V_BSTR
(
&
index
)
=
name
;
hr
=
Fields_get_Item
(
fields
,
index
,
&
field
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got %08
l
x
\n
"
,
hr
);
SysFreeString
(
name
);
hr
=
Field_QueryInterface
(
field
,
&
IID_Properties
,
(
void
**
)
&
props
);
ok
(
hr
==
E_NOINTERFACE
,
"got %08x
\n
"
,
hr
);
ok
(
hr
==
E_NOINTERFACE
,
"got %08
l
x
\n
"
,
hr
);
hr
=
Field_get_Properties
(
field
,
&
props
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got %08
l
x
\n
"
,
hr
);
count
=
-
1
;
hr
=
Properties_get_Count
(
props
,
&
count
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
!
count
,
"got %d
\n
"
,
count
);
ok
(
hr
==
S_OK
,
"got %08
l
x
\n
"
,
hr
);
ok
(
!
count
,
"got %
l
d
\n
"
,
count
);
V_VT
(
&
index
)
=
VT_I4
;
V_I4
(
&
index
)
=
1000
;
hr
=
Properties_get_Item
(
props
,
index
,
&
prop
);
ok
(
hr
==
MAKE_ADO_HRESULT
(
adErrItemNotFound
),
"got %08x
\n
"
,
hr
);
ok
(
hr
==
MAKE_ADO_HRESULT
(
adErrItemNotFound
),
"got %08
l
x
\n
"
,
hr
);
Properties_Release
(
props
);
hr
=
_Recordset_Open
(
recordset
,
missing
,
missing
,
adOpenStatic
,
adLockBatchOptimistic
,
adCmdUnspecified
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got %08
l
x
\n
"
,
hr
);
ok
(
is_eof
(
recordset
),
"not eof
\n
"
);
ok
(
is_bof
(
recordset
),
"not bof
\n
"
);
hr
=
_Recordset_Open
(
recordset
,
missing
,
missing
,
adOpenStatic
,
adLockBatchOptimistic
,
adCmdUnspecified
);
ok
(
hr
==
MAKE_ADO_HRESULT
(
adErrObjectOpen
),
"got %08x
\n
"
,
hr
);
ok
(
hr
==
MAKE_ADO_HRESULT
(
adErrObjectOpen
),
"got %08
l
x
\n
"
,
hr
);
state
=
-
1
;
hr
=
_Recordset_get_State
(
recordset
,
&
state
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
state
==
adStateOpen
,
"got %d
\n
"
,
state
);
ok
(
hr
==
S_OK
,
"got %08
l
x
\n
"
,
hr
);
ok
(
state
==
adStateOpen
,
"got %
l
d
\n
"
,
state
);
VariantInit
(
&
bookmark
);
hr
=
_Recordset_get_Bookmark
(
recordset
,
&
bookmark
);
ok
(
hr
==
MAKE_ADO_HRESULT
(
adErrNoCurrentRecord
),
"got %08x
\n
"
,
hr
);
ok
(
hr
==
MAKE_ADO_HRESULT
(
adErrNoCurrentRecord
),
"got %08
l
x
\n
"
,
hr
);
VariantInit
(
&
bookmark
);
hr
=
_Recordset_put_Bookmark
(
recordset
,
bookmark
);
ok
(
hr
==
MAKE_ADO_HRESULT
(
adErrInvalidArgument
),
"got %08x
\n
"
,
hr
);
ok
(
hr
==
MAKE_ADO_HRESULT
(
adErrInvalidArgument
),
"got %08
l
x
\n
"
,
hr
);
rec_count
=
-
1
;
hr
=
_Recordset_get_RecordCount
(
recordset
,
&
rec_count
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
!
rec_count
,
"got %
l
d
\n
"
,
rec_count
);
ok
(
hr
==
S_OK
,
"got %08
l
x
\n
"
,
hr
);
ok
(
!
rec_count
,
"got %
I
d
\n
"
,
rec_count
);
hr
=
_Recordset_AddNew
(
recordset
,
missing
,
missing
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got %08
l
x
\n
"
,
hr
);
ok
(
!
is_eof
(
recordset
),
"eof
\n
"
);
ok
(
!
is_bof
(
recordset
),
"bof
\n
"
);
rec_count
=
-
1
;
hr
=
_Recordset_get_RecordCount
(
recordset
,
&
rec_count
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
rec_count
==
1
,
"got %
l
d
\n
"
,
rec_count
);
ok
(
hr
==
S_OK
,
"got %08
l
x
\n
"
,
hr
);
ok
(
rec_count
==
1
,
"got %
I
d
\n
"
,
rec_count
);
/* get_Fields still returns the same object */
hr
=
_Recordset_get_Fields
(
recordset
,
&
fields2
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got %08
l
x
\n
"
,
hr
);
ok
(
fields2
==
fields
,
"expected same object
\n
"
);
Fields_Release
(
fields2
);
count
=
-
1
;
hr
=
Fields_get_Count
(
fields2
,
&
count
);
ok
(
count
==
1
,
"got %d
\n
"
,
count
);
ok
(
count
==
1
,
"got %
l
d
\n
"
,
count
);
hr
=
Field_get_Value
(
field
,
&
val
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got %08
l
x
\n
"
,
hr
);
ok
(
V_VT
(
&
val
)
==
VT_EMPTY
,
"got %u
\n
"
,
V_VT
(
&
val
)
);
V_VT
(
&
val
)
=
VT_I4
;
V_I4
(
&
val
)
=
-
1
;
hr
=
Field_put_Value
(
field
,
val
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got %08
l
x
\n
"
,
hr
);
V_VT
(
&
val
)
=
VT_ERROR
;
V_ERROR
(
&
val
)
=
DISP_E_PARAMNOTFOUND
;
hr
=
Field_get_Value
(
field
,
&
val
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got %08
l
x
\n
"
,
hr
);
ok
(
V_VT
(
&
val
)
==
VT_I4
,
"got %u
\n
"
,
V_VT
(
&
val
)
);
ok
(
V_I4
(
&
val
)
==
-
1
,
"got %d
\n
"
,
V_I4
(
&
val
)
);
ok
(
V_I4
(
&
val
)
==
-
1
,
"got %
l
d
\n
"
,
V_I4
(
&
val
)
);
hr
=
_Recordset_AddNew
(
recordset
,
missing
,
missing
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got %08
l
x
\n
"
,
hr
);
/* field object returns different value after AddNew */
V_VT
(
&
val
)
=
VT_ERROR
;
V_ERROR
(
&
val
)
=
DISP_E_PARAMNOTFOUND
;
hr
=
Field_get_Value
(
field
,
&
val
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got %08
l
x
\n
"
,
hr
);
ok
(
V_VT
(
&
val
)
==
VT_EMPTY
,
"got %u
\n
"
,
V_VT
(
&
val
)
);
ok
(
!
is_eof
(
recordset
),
"eof
\n
"
);
ok
(
!
is_bof
(
recordset
),
"bof
\n
"
);
hr
=
_Recordset_MoveFirst
(
recordset
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got %08
l
x
\n
"
,
hr
);
ok
(
!
is_eof
(
recordset
),
"eof
\n
"
);
ok
(
!
is_bof
(
recordset
),
"bof
\n
"
);
V_VT
(
&
val
)
=
VT_ERROR
;
V_ERROR
(
&
val
)
=
DISP_E_PARAMNOTFOUND
;
hr
=
Field_get_Value
(
field
,
&
val
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got %08
l
x
\n
"
,
hr
);
ok
(
V_VT
(
&
val
)
==
VT_I4
,
"got %u
\n
"
,
V_VT
(
&
val
)
);
ok
(
V_I4
(
&
val
)
==
-
1
,
"got %d
\n
"
,
V_I4
(
&
val
)
);
ok
(
V_I4
(
&
val
)
==
-
1
,
"got %
l
d
\n
"
,
V_I4
(
&
val
)
);
hr
=
_Recordset_MoveNext
(
recordset
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got %08
l
x
\n
"
,
hr
);
ok
(
!
is_eof
(
recordset
),
"eof
\n
"
);
ok
(
!
is_bof
(
recordset
),
"not bof
\n
"
);
hr
=
_Recordset_MoveNext
(
recordset
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got %08
l
x
\n
"
,
hr
);
ok
(
is_eof
(
recordset
),
"not eof
\n
"
);
ok
(
!
is_bof
(
recordset
),
"bof
\n
"
);
hr
=
_Recordset_MoveFirst
(
recordset
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got %08
l
x
\n
"
,
hr
);
ok
(
!
is_eof
(
recordset
),
"eof
\n
"
);
ok
(
!
is_bof
(
recordset
),
"bof
\n
"
);
hr
=
_Recordset_MovePrevious
(
recordset
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got %08
l
x
\n
"
,
hr
);
ok
(
!
is_eof
(
recordset
),
"eof
\n
"
);
ok
(
is_bof
(
recordset
),
"not bof
\n
"
);
/* try get value at BOF */
VariantInit
(
&
val
);
hr
=
Field_get_Value
(
field
,
&
val
);
ok
(
hr
==
MAKE_ADO_HRESULT
(
adErrNoCurrentRecord
),
"got %08x
\n
"
,
hr
);
ok
(
hr
==
MAKE_ADO_HRESULT
(
adErrNoCurrentRecord
),
"got %08
l
x
\n
"
,
hr
);
hr
=
_Recordset_Close
(
recordset
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got %08
l
x
\n
"
,
hr
);
count
=
-
1
;
hr
=
Fields_get_Count
(
fields
,
&
count
);
ok
(
!
count
,
"got %d
\n
"
,
count
);
ok
(
!
count
,
"got %
l
d
\n
"
,
count
);
hr
=
Field_get_Name
(
field
,
&
name
);
todo_wine
ok
(
hr
==
MAKE_ADO_HRESULT
(
adErrObjectNotSet
),
"got %08x
\n
"
,
hr
);
todo_wine
ok
(
hr
==
MAKE_ADO_HRESULT
(
adErrObjectNotSet
),
"got %08
l
x
\n
"
,
hr
);
state
=
-
1
;
hr
=
_Recordset_get_State
(
recordset
,
&
state
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
state
==
adStateClosed
,
"got %d
\n
"
,
state
);
ok
(
hr
==
S_OK
,
"got %08
l
x
\n
"
,
hr
);
ok
(
state
==
adStateClosed
,
"got %
l
d
\n
"
,
state
);
Field_Release
(
field
);
Fields_Release
(
fields
);
...
...
@@ -370,13 +370,13 @@ static ULONG WINAPI rowset_info_Release(IRowsetInfo *iface)
static
HRESULT
WINAPI
rowset_info_GetProperties
(
IRowsetInfo
*
iface
,
const
ULONG
count
,
const
DBPROPIDSET
propertyidsets
[],
ULONG
*
out_count
,
DBPROPSET
**
propertysets1
)
{
ok
(
count
==
2
,
"got %d
\n
"
,
count
);
ok
(
count
==
2
,
"got %
l
d
\n
"
,
count
);
ok
(
IsEqualIID
(
&
DBPROPSET_ROWSET
,
&
propertyidsets
[
0
].
guidPropertySet
),
"got %s
\n
"
,
wine_dbgstr_guid
(
&
propertyidsets
[
0
].
guidPropertySet
));
ok
(
propertyidsets
[
0
].
cPropertyIDs
==
17
,
"got %d
\n
"
,
propertyidsets
[
0
].
cPropertyIDs
);
ok
(
propertyidsets
[
0
].
cPropertyIDs
==
17
,
"got %
l
d
\n
"
,
propertyidsets
[
0
].
cPropertyIDs
);
ok
(
IsEqualIID
(
&
DBPROPSET_PROVIDERROWSET
,
&
propertyidsets
[
1
].
guidPropertySet
),
"got %s
\n
"
,
wine_dbgstr_guid
(
&
propertyidsets
[
1
].
guidPropertySet
));
ok
(
propertyidsets
[
1
].
cPropertyIDs
==
1
,
"got %d
\n
"
,
propertyidsets
[
1
].
cPropertyIDs
);
ok
(
propertyidsets
[
1
].
cPropertyIDs
==
1
,
"got %
l
d
\n
"
,
propertyidsets
[
1
].
cPropertyIDs
);
return
E_NOTIMPL
;
}
...
...
@@ -595,10 +595,10 @@ static void test_ADORecordsetConstruction(void)
LONG
ref
,
count
;
hr
=
CoCreateInstance
(
&
CLSID_Recordset
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID__Recordset
,
(
void
**
)
&
recordset
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got %08
l
x
\n
"
,
hr
);
hr
=
_Recordset_QueryInterface
(
recordset
,
&
IID_ADORecordsetConstruction
,
(
void
**
)
&
construct
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got %08
l
x
\n
"
,
hr
);
if
(
FAILED
(
hr
))
{
goto
done
;
...
...
@@ -612,23 +612,23 @@ static void test_ADORecordsetConstruction(void)
rowset
=
&
testrowset
.
IRowset_iface
;
ref
=
get_refcount
(
rowset
);
ok
(
ref
==
1
,
"got %d
\n
"
,
ref
);
ok
(
ref
==
1
,
"got %
l
d
\n
"
,
ref
);
hr
=
ADORecordsetConstruction_put_Rowset
(
construct
,
(
IUnknown
*
)
rowset
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got %08
l
x
\n
"
,
hr
);
ref
=
get_refcount
(
rowset
);
ok
(
ref
==
2
,
"got %d
\n
"
,
ref
);
ok
(
ref
==
2
,
"got %
l
d
\n
"
,
ref
);
hr
=
_Recordset_get_Fields
(
recordset
,
&
fields
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got %08
l
x
\n
"
,
hr
);
ok
(
fields
!=
NULL
,
"NULL value
\n
"
);
ref
=
get_refcount
(
rowset
);
ok
(
ref
==
2
,
"got %d
\n
"
,
ref
);
ok
(
ref
==
2
,
"got %
l
d
\n
"
,
ref
);
count
=
-
1
;
hr
=
Fields_get_Count
(
fields
,
&
count
);
ok
(
count
==
1
,
"got %d
\n
"
,
count
);
ok
(
count
==
1
,
"got %
l
d
\n
"
,
count
);
if
(
count
>
0
)
{
VARIANT
index
;
...
...
@@ -639,15 +639,15 @@ static void test_ADORecordsetConstruction(void)
V_BSTR
(
&
index
)
=
SysAllocString
(
L"Column1"
);
hr
=
Fields_get_Item
(
fields
,
index
,
&
field
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got %08
l
x
\n
"
,
hr
);
hr
=
Field_get_Type
(
field
,
&
type
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got %08
l
x
\n
"
,
hr
);
ok
(
type
==
adInteger
,
"got %d
\n
"
,
type
);
size
=
-
1
;
hr
=
Field_get_DefinedSize
(
field
,
&
size
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
size
==
5
,
"got %
l
d
\n
"
,
size
);
ok
(
hr
==
S_OK
,
"got %08
l
x
\n
"
,
hr
);
ok
(
size
==
5
,
"got %
I
d
\n
"
,
size
);
VariantClear
(
&
index
);
...
...
@@ -655,7 +655,7 @@ static void test_ADORecordsetConstruction(void)
}
ref
=
get_refcount
(
rowset
);
ok
(
ref
==
2
,
"got %d
\n
"
,
ref
);
ok
(
ref
==
2
,
"got %
l
d
\n
"
,
ref
);
Fields_Release
(
fields
);
...
...
@@ -680,43 +680,43 @@ static void test_Fields(void)
HRESULT
hr
;
hr
=
CoCreateInstance
(
&
CLSID_Recordset
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID__Recordset
,
(
void
**
)
&
recordset
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got %08
l
x
\n
"
,
hr
);
hr
=
_Recordset_QueryInterface
(
recordset
,
&
IID_Fields
,
(
void
**
)
&
fields
);
ok
(
hr
==
E_NOINTERFACE
,
"got %08x
\n
"
,
hr
);
ok
(
hr
==
E_NOINTERFACE
,
"got %08
l
x
\n
"
,
hr
);
hr
=
_Recordset_get_Fields
(
recordset
,
&
fields
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got %08
l
x
\n
"
,
hr
);
/* Fields object supports ISupportErrorInfo */
errorinfo
=
NULL
;
hr
=
Fields_QueryInterface
(
fields
,
&
IID_ISupportErrorInfo
,
(
void
**
)
&
errorinfo
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got %08
l
x
\n
"
,
hr
);
if
(
errorinfo
)
ISupportErrorInfo_Release
(
errorinfo
);
count
=
-
1
;
hr
=
Fields_get_Count
(
fields
,
&
count
);
ok
(
!
count
,
"got %d
\n
"
,
count
);
ok
(
!
count
,
"got %
l
d
\n
"
,
count
);
name
=
SysAllocString
(
L"field"
);
V_VT
(
&
val
)
=
VT_ERROR
;
V_ERROR
(
&
val
)
=
DISP_E_PARAMNOTFOUND
;
hr
=
Fields_Append
(
fields
,
name
,
adInteger
,
4
,
adFldUnspecified
,
val
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got %08
l
x
\n
"
,
hr
);
SysFreeString
(
name
);
count
=
-
1
;
hr
=
Fields_get_Count
(
fields
,
&
count
);
ok
(
count
==
1
,
"got %d
\n
"
,
count
);
ok
(
count
==
1
,
"got %
l
d
\n
"
,
count
);
name
=
SysAllocString
(
L"field2"
);
hr
=
Fields__Append
(
fields
,
name
,
adInteger
,
4
,
adFldUnspecified
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got %08
l
x
\n
"
,
hr
);
SysFreeString
(
name
);
count
=
-
1
;
hr
=
Fields_get_Count
(
fields
,
&
count
);
ok
(
count
==
2
,
"got %d
\n
"
,
count
);
ok
(
count
==
2
,
"got %
l
d
\n
"
,
count
);
/* handing out field object doesn't add reference to fields or recordset object */
name
=
SysAllocString
(
L"field"
);
...
...
@@ -726,7 +726,7 @@ static void test_Fields(void)
/* calling get_Item again returns the same object and adds reference */
hr
=
Fields_get_Item
(
fields
,
index
,
&
field2
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got %08
l
x
\n
"
,
hr
);
ok
(
field2
==
field
,
"expected same object
\n
"
);
Field_Release
(
field2
);
SysFreeString
(
name
);
...
...
@@ -734,26 +734,26 @@ static void test_Fields(void)
/* Field object supports ISupportErrorInfo */
errorinfo
=
NULL
;
hr
=
Field_QueryInterface
(
field
,
&
IID_ISupportErrorInfo
,
(
void
**
)
&
errorinfo
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got %08
l
x
\n
"
,
hr
);
if
(
errorinfo
)
ISupportErrorInfo_Release
(
errorinfo
);
/* verify values set with _Append */
hr
=
Field_get_Name
(
field
,
&
name
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got %08
l
x
\n
"
,
hr
);
ok
(
!
lstrcmpW
(
name
,
L"field"
),
"got %s
\n
"
,
wine_dbgstr_w
(
name
)
);
SysFreeString
(
name
);
type
=
0xdead
;
hr
=
Field_get_Type
(
field
,
&
type
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got %08
l
x
\n
"
,
hr
);
ok
(
type
==
adInteger
,
"got %d
\n
"
,
type
);
size
=
-
1
;
hr
=
Field_get_DefinedSize
(
field
,
&
size
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
size
==
4
,
"got %
l
d
\n
"
,
size
);
ok
(
hr
==
S_OK
,
"got %08
l
x
\n
"
,
hr
);
ok
(
size
==
4
,
"got %
I
d
\n
"
,
size
);
attrs
=
0xdead
;
hr
=
Field_get_Attributes
(
field
,
&
attrs
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
!
attrs
,
"got %d
\n
"
,
attrs
);
ok
(
hr
==
S_OK
,
"got %08
l
x
\n
"
,
hr
);
ok
(
!
attrs
,
"got %
l
d
\n
"
,
attrs
);
Field_Release
(
field
);
Fields_Release
(
fields
);
...
...
@@ -796,237 +796,237 @@ static void test_Stream(void)
HRESULT
hr
;
hr
=
CoCreateInstance
(
&
CLSID_Stream
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID__Stream
,
(
void
**
)
&
stream
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got %08
l
x
\n
"
,
hr
);
hr
=
_Stream_get_Size
(
stream
,
&
size
);
ok
(
hr
==
MAKE_ADO_HRESULT
(
adErrObjectClosed
),
"got %08x
\n
"
,
hr
);
ok
(
hr
==
MAKE_ADO_HRESULT
(
adErrObjectClosed
),
"got %08
l
x
\n
"
,
hr
);
hr
=
_Stream_get_EOS
(
stream
,
&
eos
);
ok
(
hr
==
MAKE_ADO_HRESULT
(
adErrObjectClosed
),
"got %08x
\n
"
,
hr
);
ok
(
hr
==
MAKE_ADO_HRESULT
(
adErrObjectClosed
),
"got %08
l
x
\n
"
,
hr
);
hr
=
_Stream_get_Position
(
stream
,
&
pos
);
ok
(
hr
==
MAKE_ADO_HRESULT
(
adErrObjectClosed
),
"got %08x
\n
"
,
hr
);
ok
(
hr
==
MAKE_ADO_HRESULT
(
adErrObjectClosed
),
"got %08
l
x
\n
"
,
hr
);
hr
=
_Stream_put_Position
(
stream
,
0
);
ok
(
hr
==
MAKE_ADO_HRESULT
(
adErrObjectClosed
),
"got %08x
\n
"
,
hr
);
ok
(
hr
==
MAKE_ADO_HRESULT
(
adErrObjectClosed
),
"got %08
l
x
\n
"
,
hr
);
/* check default type */
type
=
0
;
hr
=
_Stream_get_Type
(
stream
,
&
type
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got %08
l
x
\n
"
,
hr
);
ok
(
type
==
adTypeText
,
"got %u
\n
"
,
type
);
hr
=
_Stream_put_Type
(
stream
,
adTypeBinary
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got %08
l
x
\n
"
,
hr
);
type
=
0
;
hr
=
_Stream_get_Type
(
stream
,
&
type
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got %08
l
x
\n
"
,
hr
);
ok
(
type
==
adTypeBinary
,
"got %u
\n
"
,
type
);
/* revert */
hr
=
_Stream_put_Type
(
stream
,
adTypeText
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got %08
l
x
\n
"
,
hr
);
sep
=
0
;
hr
=
_Stream_get_LineSeparator
(
stream
,
&
sep
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got %08
l
x
\n
"
,
hr
);
ok
(
sep
==
adCRLF
,
"got %d
\n
"
,
sep
);
hr
=
_Stream_put_LineSeparator
(
stream
,
adLF
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got %08
l
x
\n
"
,
hr
);
state
=
0xdeadbeef
;
hr
=
_Stream_get_State
(
stream
,
&
state
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got %08
l
x
\n
"
,
hr
);
ok
(
state
==
adStateClosed
,
"got %u
\n
"
,
state
);
mode
=
0xdeadbeef
;
hr
=
_Stream_get_Mode
(
stream
,
&
mode
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got %08
l
x
\n
"
,
hr
);
ok
(
mode
==
adModeUnknown
,
"got %u
\n
"
,
mode
);
hr
=
_Stream_put_Mode
(
stream
,
adModeReadWrite
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got %08
l
x
\n
"
,
hr
);
hr
=
_Stream_get_Charset
(
stream
,
&
charset
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got %08
l
x
\n
"
,
hr
);
ok
(
!
lstrcmpW
(
charset
,
L"Unicode"
),
"got %s
\n
"
,
wine_dbgstr_w
(
charset
)
);
SysFreeString
(
charset
);
str
=
SysAllocString
(
L"Unicode"
);
hr
=
_Stream_put_Charset
(
stream
,
str
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got %08
l
x
\n
"
,
hr
);
SysFreeString
(
str
);
hr
=
_Stream_Read
(
stream
,
2
,
&
val
);
ok
(
hr
==
MAKE_ADO_HRESULT
(
adErrObjectClosed
),
"got %08x
\n
"
,
hr
);
ok
(
hr
==
MAKE_ADO_HRESULT
(
adErrObjectClosed
),
"got %08
l
x
\n
"
,
hr
);
V_VT
(
&
missing
)
=
VT_ERROR
;
V_ERROR
(
&
missing
)
=
DISP_E_PARAMNOTFOUND
;
hr
=
_Stream_Open
(
stream
,
missing
,
adModeUnknown
,
adOpenStreamUnspecified
,
NULL
,
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got %08
l
x
\n
"
,
hr
);
hr
=
_Stream_Open
(
stream
,
missing
,
adModeUnknown
,
adOpenStreamUnspecified
,
NULL
,
NULL
);
ok
(
hr
==
MAKE_ADO_HRESULT
(
adErrObjectOpen
),
"got %08x
\n
"
,
hr
);
ok
(
hr
==
MAKE_ADO_HRESULT
(
adErrObjectOpen
),
"got %08
l
x
\n
"
,
hr
);
state
=
0xdeadbeef
;
hr
=
_Stream_get_State
(
stream
,
&
state
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got %08
l
x
\n
"
,
hr
);
ok
(
state
==
adStateOpen
,
"got %u
\n
"
,
state
);
size
=
-
1
;
hr
=
_Stream_get_Size
(
stream
,
&
size
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
!
size
,
"got %
l
d
\n
"
,
size
);
ok
(
hr
==
S_OK
,
"got %08
l
x
\n
"
,
hr
);
ok
(
!
size
,
"got %
I
d
\n
"
,
size
);
eos
=
VARIANT_FALSE
;
hr
=
_Stream_get_EOS
(
stream
,
&
eos
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got %08
l
x
\n
"
,
hr
);
ok
(
eos
==
VARIANT_TRUE
,
"got %04x
\n
"
,
eos
);
pos
=
-
1
;
hr
=
_Stream_get_Position
(
stream
,
&
pos
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
!
pos
,
"got %
l
d
\n
"
,
pos
);
ok
(
hr
==
S_OK
,
"got %08
l
x
\n
"
,
hr
);
ok
(
!
pos
,
"got %
I
d
\n
"
,
pos
);
size
=
-
1
;
hr
=
_Stream_get_Size
(
stream
,
&
size
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
!
size
,
"got %
l
d
\n
"
,
size
);
ok
(
hr
==
S_OK
,
"got %08
l
x
\n
"
,
hr
);
ok
(
!
size
,
"got %
I
d
\n
"
,
size
);
hr
=
_Stream_Read
(
stream
,
2
,
&
val
);
ok
(
hr
==
MAKE_ADO_HRESULT
(
adErrIllegalOperation
),
"got %08x
\n
"
,
hr
);
ok
(
hr
==
MAKE_ADO_HRESULT
(
adErrIllegalOperation
),
"got %08
l
x
\n
"
,
hr
);
hr
=
_Stream_ReadText
(
stream
,
2
,
&
str
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got %08
l
x
\n
"
,
hr
);
ok
(
!
str
[
0
],
"got %s
\n
"
,
wine_dbgstr_w
(
str
)
);
SysFreeString
(
str
);
pos
=
-
1
;
hr
=
_Stream_get_Position
(
stream
,
&
pos
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
!
pos
,
"got %
l
d
\n
"
,
pos
);
ok
(
hr
==
S_OK
,
"got %08
l
x
\n
"
,
hr
);
ok
(
!
pos
,
"got %
I
d
\n
"
,
pos
);
str
=
SysAllocString
(
L"test"
);
hr
=
_Stream_WriteText
(
stream
,
str
,
adWriteChar
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got %08
l
x
\n
"
,
hr
);
SysFreeString
(
str
);
hr
=
_Stream_ReadText
(
stream
,
adReadAll
,
&
str
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got %08
l
x
\n
"
,
hr
);
ok
(
!
str
[
0
],
"got %s
\n
"
,
wine_dbgstr_w
(
str
)
);
SysFreeString
(
str
);
hr
=
_Stream_put_Position
(
stream
,
0
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got %08
l
x
\n
"
,
hr
);
hr
=
_Stream_ReadText
(
stream
,
adReadAll
,
&
str
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got %08
l
x
\n
"
,
hr
);
ok
(
!
lstrcmpW
(
str
,
L"test"
),
"got %s
\n
"
,
wine_dbgstr_w
(
str
)
);
SysFreeString
(
str
);
pos
=
-
1
;
hr
=
_Stream_get_Position
(
stream
,
&
pos
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
pos
==
10
,
"got %
l
d
\n
"
,
pos
);
ok
(
hr
==
S_OK
,
"got %08
l
x
\n
"
,
hr
);
ok
(
pos
==
10
,
"got %
I
d
\n
"
,
pos
);
eos
=
VARIANT_FALSE
;
hr
=
_Stream_get_EOS
(
stream
,
&
eos
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got %08
l
x
\n
"
,
hr
);
ok
(
eos
==
VARIANT_TRUE
,
"got %04x
\n
"
,
eos
);
hr
=
_Stream_put_Position
(
stream
,
6
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got %08
l
x
\n
"
,
hr
);
size
=
-
1
;
hr
=
_Stream_get_Size
(
stream
,
&
size
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
size
==
10
,
"got %
l
d
\n
"
,
size
);
ok
(
hr
==
S_OK
,
"got %08
l
x
\n
"
,
hr
);
ok
(
size
==
10
,
"got %
I
d
\n
"
,
size
);
hr
=
_Stream_put_Position
(
stream
,
2
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got %08
l
x
\n
"
,
hr
);
hr
=
_Stream_SetEOS
(
stream
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got %08
l
x
\n
"
,
hr
);
pos
=
-
1
;
hr
=
_Stream_get_Position
(
stream
,
&
pos
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
pos
==
2
,
"got %
l
d
\n
"
,
pos
);
ok
(
hr
==
S_OK
,
"got %08
l
x
\n
"
,
hr
);
ok
(
pos
==
2
,
"got %
I
d
\n
"
,
pos
);
size
=
-
1
;
hr
=
_Stream_get_Size
(
stream
,
&
size
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
size
==
2
,
"got %
l
d
\n
"
,
size
);
ok
(
hr
==
S_OK
,
"got %08
l
x
\n
"
,
hr
);
ok
(
size
==
2
,
"got %
I
d
\n
"
,
size
);
hr
=
_Stream_Close
(
stream
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got %08
l
x
\n
"
,
hr
);
state
=
0xdeadbeef
;
hr
=
_Stream_get_State
(
stream
,
&
state
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got %08
l
x
\n
"
,
hr
);
ok
(
state
==
adStateClosed
,
"got %u
\n
"
,
state
);
hr
=
_Stream_Close
(
stream
);
ok
(
hr
==
MAKE_ADO_HRESULT
(
adErrObjectClosed
),
"got %08x
\n
"
,
hr
);
ok
(
hr
==
MAKE_ADO_HRESULT
(
adErrObjectClosed
),
"got %08
l
x
\n
"
,
hr
);
refs
=
_Stream_Release
(
stream
);
ok
(
!
refs
,
"got %d
\n
"
,
refs
);
ok
(
!
refs
,
"got %
l
d
\n
"
,
refs
);
/* binary type */
hr
=
CoCreateInstance
(
&
CLSID_Stream
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID__Stream
,
(
void
**
)
&
stream
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got %08
l
x
\n
"
,
hr
);
hr
=
_Stream_put_Type
(
stream
,
adTypeBinary
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got %08
l
x
\n
"
,
hr
);
hr
=
_Stream_Open
(
stream
,
missing
,
adModeUnknown
,
adOpenStreamUnspecified
,
NULL
,
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got %08
l
x
\n
"
,
hr
);
hr
=
_Stream_ReadText
(
stream
,
adReadAll
,
&
str
);
ok
(
hr
==
MAKE_ADO_HRESULT
(
adErrIllegalOperation
),
"got %08x
\n
"
,
hr
);
ok
(
hr
==
MAKE_ADO_HRESULT
(
adErrIllegalOperation
),
"got %08
l
x
\n
"
,
hr
);
str
=
SysAllocString
(
L"test"
);
hr
=
_Stream_WriteText
(
stream
,
str
,
adWriteChar
);
ok
(
hr
==
MAKE_ADO_HRESULT
(
adErrIllegalOperation
),
"got %08x
\n
"
,
hr
);
ok
(
hr
==
MAKE_ADO_HRESULT
(
adErrIllegalOperation
),
"got %08
l
x
\n
"
,
hr
);
SysFreeString
(
str
);
VariantInit
(
&
val
);
hr
=
_Stream_Read
(
stream
,
1
,
&
val
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got %08
l
x
\n
"
,
hr
);
ok
(
V_VT
(
&
val
)
==
VT_NULL
,
"got %u
\n
"
,
V_VT
(
&
val
)
);
VariantInit
(
&
val
);
hr
=
_Stream_Write
(
stream
,
val
);
ok
(
hr
==
MAKE_ADO_HRESULT
(
adErrInvalidArgument
),
"got %08x
\n
"
,
hr
);
ok
(
hr
==
MAKE_ADO_HRESULT
(
adErrInvalidArgument
),
"got %08
l
x
\n
"
,
hr
);
hr
=
str_to_byte_array
(
"data"
,
&
val
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got %08
l
x
\n
"
,
hr
);
hr
=
_Stream_Write
(
stream
,
val
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got %08
l
x
\n
"
,
hr
);
VariantClear
(
&
val
);
pos
=
-
1
;
hr
=
_Stream_get_Position
(
stream
,
&
pos
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
pos
==
4
,
"got %
l
d
\n
"
,
pos
);
ok
(
hr
==
S_OK
,
"got %08
l
x
\n
"
,
hr
);
ok
(
pos
==
4
,
"got %
I
d
\n
"
,
pos
);
hr
=
_Stream_put_Position
(
stream
,
0
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got %08
l
x
\n
"
,
hr
);
VariantInit
(
&
val
);
hr
=
_Stream_Read
(
stream
,
adReadAll
,
&
val
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got %08
l
x
\n
"
,
hr
);
ok
(
V_VT
(
&
val
)
==
(
VT_ARRAY
|
VT_UI1
),
"got %04x
\n
"
,
V_VT
(
&
val
)
);
VariantClear
(
&
val
);
pos
=
-
1
;
hr
=
_Stream_get_Position
(
stream
,
&
pos
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
pos
==
4
,
"got %
l
d
\n
"
,
pos
);
ok
(
hr
==
S_OK
,
"got %08
l
x
\n
"
,
hr
);
ok
(
pos
==
4
,
"got %
I
d
\n
"
,
pos
);
refs
=
_Stream_Release
(
stream
);
ok
(
!
refs
,
"got %d
\n
"
,
refs
);
ok
(
!
refs
,
"got %
l
d
\n
"
,
refs
);
}
static
void
test_Connection
(
void
)
...
...
@@ -1043,7 +1043,7 @@ static void test_Connection(void)
CursorLocationEnum
location
;
hr
=
CoCreateInstance
(
&
CLSID_Connection
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID__Connection
,
(
void
**
)
&
connection
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got %08
l
x
\n
"
,
hr
);
hr
=
_Connection_QueryInterface
(
connection
,
&
IID_IRunnableObject
,
(
void
**
)
&
runtime
);
ok
(
hr
==
E_NOINTERFACE
,
"Unexpected IRunnableObject interface
\n
"
);
...
...
@@ -1054,113 +1054,113 @@ static void test_Connection(void)
ISupportErrorInfo_Release
(
errorinfo
);
hr
=
_Connection_QueryInterface
(
connection
,
&
IID_IConnectionPointContainer
,
(
void
**
)
&
pointcontainer
);
ok
(
hr
==
S_OK
,
"Failed to get IConnectionPointContainer interface %08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"Failed to get IConnectionPointContainer interface %08
l
x
\n
"
,
hr
);
IConnectionPointContainer_Release
(
pointcontainer
);
hr
=
_Connection_QueryInterface
(
connection
,
&
IID_ADOConnectionConstruction15
,
(
void
**
)
&
construct
);
ok
(
hr
==
S_OK
,
"Failed to get ADOConnectionConstruction15 interface %08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"Failed to get ADOConnectionConstruction15 interface %08
l
x
\n
"
,
hr
);
if
(
hr
==
S_OK
)
ADOConnectionConstruction15_Release
(
construct
);
if
(
0
)
/* Crashes on windows */
{
hr
=
_Connection_get_State
(
connection
,
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"Unexpected hr 0x%08x
\n
"
,
hr
);
ok
(
hr
==
E_INVALIDARG
,
"Unexpected hr 0x%08
l
x
\n
"
,
hr
);
}
state
=
-
1
;
hr
=
_Connection_get_State
(
connection
,
&
state
);
ok
(
hr
==
S_OK
,
"Failed to get state, hr 0x%08x
\n
"
,
hr
);
ok
(
state
==
adStateClosed
,
"Unexpected state value 0x%08x
\n
"
,
state
);
ok
(
hr
==
S_OK
,
"Failed to get state, hr 0x%08
l
x
\n
"
,
hr
);
ok
(
state
==
adStateClosed
,
"Unexpected state value 0x%08
l
x
\n
"
,
state
);
hr
=
_Connection_Close
(
connection
);
ok
(
hr
==
MAKE_ADO_HRESULT
(
adErrObjectClosed
),
"got %08x
\n
"
,
hr
);
ok
(
hr
==
MAKE_ADO_HRESULT
(
adErrObjectClosed
),
"got %08
l
x
\n
"
,
hr
);
timeout
=
0
;
hr
=
_Connection_get_CommandTimeout
(
connection
,
&
timeout
);
ok
(
hr
==
S_OK
,
"Failed to get state, hr 0x%08x
\n
"
,
hr
);
ok
(
timeout
==
30
,
"Unexpected timeout value %d
\n
"
,
timeout
);
ok
(
hr
==
S_OK
,
"Failed to get state, hr 0x%08
l
x
\n
"
,
hr
);
ok
(
timeout
==
30
,
"Unexpected timeout value %
l
d
\n
"
,
timeout
);
hr
=
_Connection_put_CommandTimeout
(
connection
,
300
);
ok
(
hr
==
S_OK
,
"Failed to get state, hr 0x%08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"Failed to get state, hr 0x%08
l
x
\n
"
,
hr
);
timeout
=
0
;
hr
=
_Connection_get_CommandTimeout
(
connection
,
&
timeout
);
ok
(
hr
==
S_OK
,
"Failed to get state, hr 0x%08x
\n
"
,
hr
);
ok
(
timeout
==
300
,
"Unexpected timeout value %d
\n
"
,
timeout
);
ok
(
hr
==
S_OK
,
"Failed to get state, hr 0x%08
l
x
\n
"
,
hr
);
ok
(
timeout
==
300
,
"Unexpected timeout value %
l
d
\n
"
,
timeout
);
location
=
0
;
hr
=
_Connection_get_CursorLocation
(
connection
,
&
location
);
ok
(
hr
==
S_OK
,
"Failed, hr 0x%08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"Failed, hr 0x%08
l
x
\n
"
,
hr
);
ok
(
location
==
adUseServer
,
"Unexpected location value %d
\n
"
,
location
);
hr
=
_Connection_put_CursorLocation
(
connection
,
adUseClient
);
ok
(
hr
==
S_OK
,
"Failed, hr 0x%08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"Failed, hr 0x%08
l
x
\n
"
,
hr
);
location
=
0
;
hr
=
_Connection_get_CursorLocation
(
connection
,
&
location
);
ok
(
hr
==
S_OK
,
"Failed, hr 0x%08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"Failed, hr 0x%08
l
x
\n
"
,
hr
);
ok
(
location
==
adUseClient
,
"Unexpected location value %d
\n
"
,
location
);
hr
=
_Connection_put_CursorLocation
(
connection
,
adUseServer
);
ok
(
hr
==
S_OK
,
"Failed, hr 0x%08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"Failed, hr 0x%08
l
x
\n
"
,
hr
);
mode
=
0xdeadbeef
;
hr
=
_Connection_get_Mode
(
connection
,
&
mode
);
ok
(
hr
==
S_OK
,
"Failed to get state, hr 0x%08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"Failed to get state, hr 0x%08
l
x
\n
"
,
hr
);
ok
(
mode
==
adModeUnknown
,
"Unexpected mode value %d
\n
"
,
mode
);
hr
=
_Connection_put_Mode
(
connection
,
adModeShareDenyNone
);
ok
(
hr
==
S_OK
,
"Failed to get state, hr 0x%08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"Failed to get state, hr 0x%08
l
x
\n
"
,
hr
);
mode
=
adModeUnknown
;
hr
=
_Connection_get_Mode
(
connection
,
&
mode
);
ok
(
hr
==
S_OK
,
"Failed to get state, hr 0x%08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"Failed to get state, hr 0x%08
l
x
\n
"
,
hr
);
ok
(
mode
==
adModeShareDenyNone
,
"Unexpected mode value %d
\n
"
,
mode
);
hr
=
_Connection_put_Mode
(
connection
,
adModeUnknown
);
ok
(
hr
==
S_OK
,
"Failed to get state, hr 0x%08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"Failed to get state, hr 0x%08
l
x
\n
"
,
hr
);
/* Default */
str
=
(
BSTR
)
0xdeadbeef
;
hr
=
_Connection_get_Provider
(
connection
,
&
str
);
ok
(
hr
==
S_OK
,
"Failed, hr 0x%08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"Failed, hr 0x%08
l
x
\n
"
,
hr
);
ok
(
!
wcscmp
(
str
,
L"MSDASQL"
),
"wrong string %s
\n
"
,
wine_dbgstr_w
(
str
));
SysFreeString
(
str
);
str
=
SysAllocString
(
L"MSDASQL.1"
);
hr
=
_Connection_put_Provider
(
connection
,
str
);
ok
(
hr
==
S_OK
,
"Failed, hr 0x%08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"Failed, hr 0x%08
l
x
\n
"
,
hr
);
SysFreeString
(
str
);
str
=
(
BSTR
)
0xdeadbeef
;
hr
=
_Connection_get_Provider
(
connection
,
&
str
);
ok
(
hr
==
S_OK
,
"Failed, hr 0x%08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"Failed, hr 0x%08
l
x
\n
"
,
hr
);
ok
(
!
wcscmp
(
str
,
L"MSDASQL.1"
),
"wrong string %s
\n
"
,
wine_dbgstr_w
(
str
));
/* Restore default */
str
=
SysAllocString
(
L"MSDASQL"
);
hr
=
_Connection_put_Provider
(
connection
,
str
);
ok
(
hr
==
S_OK
,
"Failed, hr 0x%08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"Failed, hr 0x%08
l
x
\n
"
,
hr
);
SysFreeString
(
str
);
hr
=
_Connection_put_Provider
(
connection
,
NULL
);
ok
(
hr
==
MAKE_ADO_HRESULT
(
adErrInvalidArgument
),
"got 0x%08x
\n
"
,
hr
);
ok
(
hr
==
MAKE_ADO_HRESULT
(
adErrInvalidArgument
),
"got 0x%08
l
x
\n
"
,
hr
);
SysFreeString
(
str
);
str
=
(
BSTR
)
0xdeadbeef
;
hr
=
_Connection_get_ConnectionString
(
connection
,
&
str
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08
l
x
\n
"
,
hr
);
ok
(
str
==
NULL
,
"got %p
\n
"
,
str
);
str
=
SysAllocString
(
L"Provider=MSDASQL.1;Persist Security Info=False;Data Source=wine_test"
);
hr
=
_Connection_put_ConnectionString
(
connection
,
str
);
ok
(
hr
==
S_OK
,
"Failed, hr 0x%08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"Failed, hr 0x%08
l
x
\n
"
,
hr
);
/* Show put_ConnectionString effects Provider */
str3
=
(
BSTR
)
0xdeadbeef
;
hr
=
_Connection_get_Provider
(
connection
,
&
str3
);
ok
(
hr
==
S_OK
,
"Failed, hr 0x%08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"Failed, hr 0x%08
l
x
\n
"
,
hr
);
ok
(
str3
!=
NULL
,
"Expected value got NULL
\n
"
);
todo_wine
ok
(
!
wcscmp
(
str3
,
L"MSDASQL.1"
),
"wrong string %s
\n
"
,
wine_dbgstr_w
(
str3
));
SysFreeString
(
str3
);
...
...
@@ -1168,44 +1168,44 @@ if (0) /* Crashes on windows */
if
(
0
)
/* Crashes on windows */
{
hr
=
_Connection_get_ConnectionString
(
connection
,
NULL
);
ok
(
hr
==
E_POINTER
,
"Failed, hr 0x%08x
\n
"
,
hr
);
ok
(
hr
==
E_POINTER
,
"Failed, hr 0x%08
l
x
\n
"
,
hr
);
}
str2
=
NULL
;
hr
=
_Connection_get_ConnectionString
(
connection
,
&
str2
);
ok
(
hr
==
S_OK
,
"Failed, hr 0x%08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"Failed, hr 0x%08
l
x
\n
"
,
hr
);
ok
(
!
wcscmp
(
str
,
str2
),
"wrong string %s
\n
"
,
wine_dbgstr_w
(
str2
));
hr
=
_Connection_Open
(
connection
,
NULL
,
NULL
,
NULL
,
0
);
ok
(
hr
==
E_FAIL
,
"Failed, hr 0x%08x
\n
"
,
hr
);
ok
(
hr
==
E_FAIL
,
"Failed, hr 0x%08
l
x
\n
"
,
hr
);
/* Open adds trailing ; if it's missing */
str3
=
SysAllocString
(
L"Provider=MSDASQL.1;Persist Security Info=False;Data Source=wine_test;"
);
hr
=
_Connection_Open
(
connection
,
NULL
,
NULL
,
NULL
,
adConnectUnspecified
);
ok
(
hr
==
E_FAIL
,
"Failed, hr 0x%08x
\n
"
,
hr
);
ok
(
hr
==
E_FAIL
,
"Failed, hr 0x%08
l
x
\n
"
,
hr
);
str2
=
NULL
;
hr
=
_Connection_get_ConnectionString
(
connection
,
&
str2
);
ok
(
hr
==
S_OK
,
"Failed, hr 0x%08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"Failed, hr 0x%08
l
x
\n
"
,
hr
);
todo_wine
ok
(
!
wcscmp
(
str3
,
str2
)
||
broken
(
!
wcscmp
(
str
,
str2
))
/* XP */
,
"wrong string %s
\n
"
,
wine_dbgstr_w
(
str2
));
hr
=
_Connection_Open
(
connection
,
str
,
NULL
,
NULL
,
adConnectUnspecified
);
ok
(
hr
==
E_FAIL
,
"Failed, hr 0x%08x
\n
"
,
hr
);
ok
(
hr
==
E_FAIL
,
"Failed, hr 0x%08
l
x
\n
"
,
hr
);
SysFreeString
(
str
);
str2
=
NULL
;
hr
=
_Connection_get_ConnectionString
(
connection
,
&
str2
);
ok
(
hr
==
S_OK
,
"Failed, hr 0x%08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"Failed, hr 0x%08
l
x
\n
"
,
hr
);
todo_wine
ok
(
!
wcscmp
(
str3
,
str2
)
||
broken
(
!
wcscmp
(
str
,
str2
))
/* XP */
,
"wrong string %s
\n
"
,
wine_dbgstr_w
(
str2
));
SysFreeString
(
str2
);
SysFreeString
(
str3
);
hr
=
_Connection_put_ConnectionString
(
connection
,
NULL
);
ok
(
hr
==
S_OK
,
"Failed, hr 0x%08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"Failed, hr 0x%08
l
x
\n
"
,
hr
);
str
=
(
BSTR
)
0xdeadbeef
;
hr
=
_Connection_get_ConnectionString
(
connection
,
&
str
);
ok
(
hr
==
S_OK
,
"Failed, hr 0x%08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"Failed, hr 0x%08
l
x
\n
"
,
hr
);
ok
(
str
==
NULL
,
"got %p
\n
"
,
str
);
_Connection_Release
(
connection
);
}
...
...
@@ -1222,64 +1222,64 @@ static void test_Command(void)
_Connection
*
connection
;
hr
=
CoCreateInstance
(
&
CLSID_Command
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID__Command
,
(
void
**
)
&
command
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got %08
l
x
\n
"
,
hr
);
hr
=
_Command_QueryInterface
(
command
,
&
IID__ADO
,
(
void
**
)
&
ado
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got %08
l
x
\n
"
,
hr
);
_ADO_Release
(
ado
);
hr
=
_Command_QueryInterface
(
command
,
&
IID_Command15
,
(
void
**
)
&
command15
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got %08
l
x
\n
"
,
hr
);
Command15_Release
(
command15
);
hr
=
_Command_QueryInterface
(
command
,
&
IID_Command25
,
(
void
**
)
&
command25
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got %08
l
x
\n
"
,
hr
);
Command25_Release
(
command25
);
hr
=
_Command_get_CommandType
(
command
,
&
cmd_type
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got %08
l
x
\n
"
,
hr
);
ok
(
cmd_type
==
adCmdUnknown
,
"got %08x
\n
"
,
cmd_type
);
_Command_put_CommandType
(
command
,
adCmdText
);
hr
=
_Command_get_CommandType
(
command
,
&
cmd_type
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got %08
l
x
\n
"
,
hr
);
ok
(
cmd_type
==
adCmdText
,
"got %08x
\n
"
,
cmd_type
);
hr
=
_Command_put_CommandType
(
command
,
0xdeadbeef
);
ok
(
hr
==
MAKE_ADO_HRESULT
(
adErrInvalidArgument
),
"got %08x
\n
"
,
hr
);
ok
(
hr
==
MAKE_ADO_HRESULT
(
adErrInvalidArgument
),
"got %08
l
x
\n
"
,
hr
);
hr
=
_Command_get_CommandText
(
command
,
&
cmd_text
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got %08
l
x
\n
"
,
hr
);
ok
(
!
cmd_text
,
"got %s
\n
"
,
wine_dbgstr_w
(
cmd_text
));
hr
=
_Command_put_CommandText
(
command
,
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got %08
l
x
\n
"
,
hr
);
cmd_text
=
SysAllocString
(
L""
);
hr
=
_Command_put_CommandText
(
command
,
cmd_text
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got %08
l
x
\n
"
,
hr
);
SysFreeString
(
cmd_text
);
hr
=
_Command_get_CommandText
(
command
,
&
cmd_text
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got %08
l
x
\n
"
,
hr
);
ok
(
cmd_text
&&
!*
cmd_text
,
"got %p
\n
"
,
cmd_text
);
cmd_text
=
SysAllocString
(
L"test"
);
hr
=
_Command_put_CommandText
(
command
,
cmd_text
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got %08
l
x
\n
"
,
hr
);
SysFreeString
(
cmd_text
);
hr
=
_Command_get_CommandText
(
command
,
&
cmd_text
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got %08
l
x
\n
"
,
hr
);
ok
(
!
wcscmp
(
L"test"
,
cmd_text
),
"got %p
\n
"
,
wine_dbgstr_w
(
cmd_text
)
);
connection
=
(
_Connection
*
)
0xdeadbeef
;
hr
=
_Command_get_ActiveConnection
(
command
,
&
connection
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got %08
l
x
\n
"
,
hr
);
ok
(
connection
==
NULL
,
"got %p
\n
"
,
connection
);
hr
=
_Command_putref_ActiveConnection
(
command
,
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got %08
l
x
\n
"
,
hr
);
_Command_Release
(
command
);
}
...
...
@@ -1435,64 +1435,64 @@ static void test_ConnectionPoint(void)
&
IID_IConnectionPointContainer
,
(
void
**
)
&
pointcontainer
);
hr
=
IConnectionPointContainer_FindConnectionPoint
(
pointcontainer
,
&
DIID_ConnectionEvents
,
NULL
);
ok
(
hr
==
E_POINTER
,
"got %08x
\n
"
,
hr
);
ok
(
hr
==
E_POINTER
,
"got %08
l
x
\n
"
,
hr
);
hr
=
IConnectionPointContainer_FindConnectionPoint
(
pointcontainer
,
&
DIID_RecordsetEvents
,
&
point
);
ok
(
hr
==
CONNECT_E_NOCONNECTION
,
"got %08x
\n
"
,
hr
);
ok
(
hr
==
CONNECT_E_NOCONNECTION
,
"got %08
l
x
\n
"
,
hr
);
hr
=
IConnectionPointContainer_FindConnectionPoint
(
pointcontainer
,
&
DIID_ConnectionEvents
,
&
point
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got %08
l
x
\n
"
,
hr
);
/* nothing advised yet */
hr
=
IConnectionPoint_Unadvise
(
point
,
3
);
ok
(
hr
==
E_FAIL
,
"got %08x
\n
"
,
hr
);
ok
(
hr
==
E_FAIL
,
"got %08
l
x
\n
"
,
hr
);
hr
=
IConnectionPoint_Advise
(
point
,
NULL
,
NULL
);
ok
(
hr
==
E_FAIL
,
"got %08x
\n
"
,
hr
);
ok
(
hr
==
E_FAIL
,
"got %08
l
x
\n
"
,
hr
);
hr
=
IConnectionPoint_Advise
(
point
,
(
void
*
)
&
conn_event
.
conn_event_sink
,
NULL
);
ok
(
hr
==
E_FAIL
,
"got %08x
\n
"
,
hr
);
ok
(
hr
==
E_FAIL
,
"got %08
l
x
\n
"
,
hr
);
cookie
=
0xdeadbeef
;
hr
=
IConnectionPoint_Advise
(
point
,
NULL
,
&
cookie
);
ok
(
hr
==
E_FAIL
,
"got %08x
\n
"
,
hr
);
ok
(
cookie
==
0xdeadbeef
,
"got %08x
\n
"
,
cookie
);
ok
(
hr
==
E_FAIL
,
"got %08
l
x
\n
"
,
hr
);
ok
(
cookie
==
0xdeadbeef
,
"got %08
l
x
\n
"
,
cookie
);
/* unsupported sink */
cookie
=
0xdeadbeef
;
hr
=
IConnectionPoint_Advise
(
point
,
(
void
*
)
&
support_err_sink
,
&
cookie
);
ok
(
hr
==
E_FAIL
,
"got %08x
\n
"
,
hr
);
ok
(
!
cookie
,
"got %08x
\n
"
,
cookie
);
ok
(
hr
==
E_FAIL
,
"got %08
l
x
\n
"
,
hr
);
ok
(
!
cookie
,
"got %08
l
x
\n
"
,
cookie
);
cookie
=
0
;
hr
=
IConnectionPoint_Advise
(
point
,
(
void
*
)
&
conn_event
.
conn_event_sink
,
&
cookie
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
cookie
,
"got %08x
\n
"
,
cookie
);
ok
(
hr
==
S_OK
,
"got %08
l
x
\n
"
,
hr
);
ok
(
cookie
,
"got %08
l
x
\n
"
,
cookie
);
/* invalid cookie */
hr
=
IConnectionPoint_Unadvise
(
point
,
0
);
ok
(
hr
==
E_FAIL
,
"got %08x
\n
"
,
hr
);
ok
(
hr
==
E_FAIL
,
"got %08
l
x
\n
"
,
hr
);
/* wrong cookie */
hr
=
IConnectionPoint_Unadvise
(
point
,
cookie
+
1
);
ok
(
hr
==
E_FAIL
,
"got %08x
\n
"
,
hr
);
ok
(
hr
==
E_FAIL
,
"got %08
l
x
\n
"
,
hr
);
hr
=
IConnectionPoint_Unadvise
(
point
,
cookie
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got %08
l
x
\n
"
,
hr
);
/* sinks are released when the connection is destroyed */
cookie
=
0
;
hr
=
IConnectionPoint_Advise
(
point
,
(
void
*
)
&
conn_event
.
conn_event_sink
,
&
cookie
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
cookie
,
"got %08x
\n
"
,
cookie
);
ok
(
conn_event
.
refs
==
1
,
"got %d
\n
"
,
conn_event
.
refs
);
ok
(
hr
==
S_OK
,
"got %08
l
x
\n
"
,
hr
);
ok
(
cookie
,
"got %08
l
x
\n
"
,
cookie
);
ok
(
conn_event
.
refs
==
1
,
"got %
l
d
\n
"
,
conn_event
.
refs
);
refs
=
IConnectionPoint_Release
(
point
);
ok
(
refs
==
1
,
"got %u"
,
refs
);
ok
(
refs
==
1
,
"got %
l
u"
,
refs
);
IConnectionPointContainer_Release
(
pointcontainer
);
ok
(
!
conn_event
.
refs
,
"got %d
\n
"
,
conn_event
.
refs
);
ok
(
!
conn_event
.
refs
,
"got %
l
d
\n
"
,
conn_event
.
refs
);
}
START_TEST
(
msado15
)
...
...
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