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
e1c34221
Commit
e1c34221
authored
Aug 19, 2013
by
Alistair Leslie-Hughes
Committed by
Alexandre Julliard
Aug 20, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
oledb32: Implement IErrorRecord::AddErrorRecord.
parent
399bd421
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
68 additions
and
3 deletions
+68
-3
errorinfo.c
dlls/oledb32/errorinfo.c
+28
-3
database.c
dlls/oledb32/tests/database.c
+40
-0
No files found.
dlls/oledb32/errorinfo.c
View file @
e1c34221
...
...
@@ -41,7 +41,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(oledb);
struct
ErrorEntry
{
struct
list
entry
;
ERRORINFO
*
info
;
ERRORINFO
info
;
DISPPARAMS
dispparams
;
IUnknown
*
unknown
;
DWORD
lookupID
;
...
...
@@ -109,6 +109,7 @@ static ULONG WINAPI IErrorInfoImpl_Release(IErrorInfo* iface)
{
ErrorInfoImpl
*
This
=
impl_from_IErrorInfo
(
iface
);
ULONG
ref
=
InterlockedDecrement
(
&
This
->
ref
);
struct
ErrorEntry
*
cursor
,
*
cursor2
;
TRACE
(
"(%p)->%u
\n
"
,
This
,
ref
+
1
);
...
...
@@ -117,6 +118,15 @@ static ULONG WINAPI IErrorInfoImpl_Release(IErrorInfo* iface)
SysFreeString
(
This
->
source
);
SysFreeString
(
This
->
description
);
SysFreeString
(
This
->
help_file
);
LIST_FOR_EACH_ENTRY_SAFE
(
cursor
,
cursor2
,
&
This
->
errors
,
struct
ErrorEntry
,
entry
)
{
list_remove
(
&
cursor
->
entry
);
if
(
cursor
->
unknown
)
IUnknown_Release
(
cursor
->
unknown
);
heap_free
(
cursor
);
}
heap_free
(
This
);
}
return
ref
;
...
...
@@ -226,12 +236,27 @@ static HRESULT WINAPI errorrec_AddErrorRecord(IErrorRecords *iface, ERRORINFO *p
DWORD
dwLookupID
,
DISPPARAMS
*
pdispparams
,
IUnknown
*
punkCustomError
,
DWORD
dwDynamicErrorID
)
{
ErrorInfoImpl
*
This
=
impl_from_IErrorRecords
(
iface
);
struct
ErrorEntry
*
entry
;
FIXM
E
(
"(%p)->(%p %d %p %p %d)
\n
"
,
This
,
pErrorInfo
,
dwLookupID
,
pdispparams
,
punkCustomError
,
dwDynamicErrorID
);
TRAC
E
(
"(%p)->(%p %d %p %p %d)
\n
"
,
This
,
pErrorInfo
,
dwLookupID
,
pdispparams
,
punkCustomError
,
dwDynamicErrorID
);
if
(
pErrorInfo
)
if
(
!
pErrorInfo
)
return
E_INVALIDARG
;
entry
=
heap_alloc
(
sizeof
(
*
entry
));
if
(
!
entry
)
return
E_OUTOFMEMORY
;
entry
->
info
=
*
pErrorInfo
;
if
(
pdispparams
)
entry
->
dispparams
=
*
pdispparams
;
entry
->
unknown
=
punkCustomError
;
if
(
entry
->
unknown
)
IUnknown_AddRef
(
entry
->
unknown
);
entry
->
lookupID
=
dwDynamicErrorID
;
list_add_head
(
&
This
->
errors
,
&
entry
->
entry
);
return
S_OK
;
}
...
...
dlls/oledb32/tests/database.c
View file @
e1c34221
...
...
@@ -31,6 +31,7 @@
#include "shlobj.h"
#include "msdaguid.h"
#include "initguid.h"
#include "oledberr.h"
#include "wine/test.h"
...
...
@@ -159,6 +160,45 @@ static void test_errorinfo(void)
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
if
(
hr
==
S_OK
)
{
ERRORINFO
info
,
info2
,
info3
;
ULONG
cnt
=
0
;
memset
(
&
info
,
0
,
sizeof
(
ERRORINFO
));
info
.
dwMinor
=
1
;
memset
(
&
info2
,
0
,
sizeof
(
ERRORINFO
));
info2
.
dwMinor
=
2
;
memset
(
&
info3
,
0
,
sizeof
(
ERRORINFO
));
hr
=
IErrorRecords_AddErrorRecord
(
errrecs
,
NULL
,
268435456
,
NULL
,
NULL
,
0
);
ok
(
hr
==
E_INVALIDARG
,
"got %08x
\n
"
,
hr
);
hr
=
IErrorRecords_AddErrorRecord
(
errrecs
,
&
info
,
1
,
NULL
,
NULL
,
0
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
hr
=
IErrorRecords_GetRecordCount
(
errrecs
,
&
cnt
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
cnt
==
1
,
"expected 1 got %d
\n
"
,
cnt
);
hr
=
IErrorRecords_AddErrorRecord
(
errrecs
,
&
info2
,
2
,
NULL
,
NULL
,
0
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
hr
=
IErrorRecords_GetRecordCount
(
errrecs
,
&
cnt
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
cnt
==
2
,
"expected 2 got %d
\n
"
,
cnt
);
hr
=
IErrorRecords_GetBasicErrorInfo
(
errrecs
,
0
,
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"got %08x
\n
"
,
hr
);
hr
=
IErrorRecords_GetBasicErrorInfo
(
errrecs
,
100
,
&
info3
);
ok
(
hr
==
DB_E_BADRECORDNUM
,
"got %08x
\n
"
,
hr
);
hr
=
IErrorRecords_GetBasicErrorInfo
(
errrecs
,
0
,
&
info3
);
todo_wine
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
if
(
hr
==
S_OK
)
{
ok
(
info3
.
dwMinor
==
2
,
"expected 2 got %d
\n
"
,
info3
.
dwMinor
);
}
IErrorRecords_Release
(
errrecs
);
}
...
...
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