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
239055cf
Commit
239055cf
authored
Nov 05, 2019
by
Nikolay Sivov
Committed by
Alexandre Julliard
Nov 05, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comsvcs: Implement IPersistStream methods for "new" moniker.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
f1123366
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
92 additions
and
11 deletions
+92
-11
main.c
dlls/comsvcs/main.c
+49
-10
comsvcs.c
dlls/comsvcs/tests/comsvcs.c
+43
-1
No files found.
dlls/comsvcs/main.c
View file @
239055cf
...
...
@@ -476,37 +476,76 @@ static ULONG WINAPI new_moniker_Release(IMoniker* iface)
static
HRESULT
WINAPI
new_moniker_GetClassID
(
IMoniker
*
iface
,
CLSID
*
clsid
)
{
FIXM
E
(
"%p, %p.
\n
"
,
iface
,
clsid
);
TRAC
E
(
"%p, %p.
\n
"
,
iface
,
clsid
);
return
E_NOTIMPL
;
if
(
!
clsid
)
return
E_POINTER
;
*
clsid
=
CLSID_NewMoniker
;
return
S_OK
;
}
static
HRESULT
WINAPI
new_moniker_IsDirty
(
IMoniker
*
iface
)
{
FIXM
E
(
"%p.
\n
"
,
iface
);
TRAC
E
(
"%p.
\n
"
,
iface
);
return
E_NOTIMPL
;
return
S_FALSE
;
}
static
HRESULT
WINAPI
new_moniker_Load
(
IMoniker
*
iface
,
IStream
*
stream
)
{
FIXME
(
"%p, %p.
\n
"
,
iface
,
stream
);
struct
new_moniker
*
moniker
=
impl_from_IMoniker
(
iface
);
ULARGE_INTEGER
pad
;
CLSID
clsid
;
HRESULT
hr
;
DWORD
len
;
return
E_NOTIMPL
;
TRACE
(
"%p, %p.
\n
"
,
iface
,
stream
);
hr
=
IStream_Read
(
stream
,
&
clsid
,
sizeof
(
clsid
),
&
len
);
if
(
FAILED
(
hr
))
return
hr
;
pad
.
QuadPart
=
1
;
hr
=
IStream_Read
(
stream
,
&
pad
,
sizeof
(
pad
),
&
len
);
if
(
FAILED
(
hr
))
return
hr
;
if
(
pad
.
QuadPart
!=
0
)
return
E_FAIL
;
moniker
->
clsid
=
clsid
;
return
S_OK
;
}
static
HRESULT
WINAPI
new_moniker_Save
(
IMoniker
*
iface
,
IStream
*
stream
,
BOOL
clear_dirty
)
{
FIXME
(
"%p, %p, %d.
\n
"
,
iface
,
stream
,
clear_dirty
);
struct
new_moniker
*
moniker
=
impl_from_IMoniker
(
iface
);
static
const
ULARGE_INTEGER
pad
;
ULONG
written
;
HRESULT
hr
;
return
E_NOTIMPL
;
TRACE
(
"%p, %p, %d.
\n
"
,
iface
,
stream
,
clear_dirty
);
hr
=
IStream_Write
(
stream
,
&
moniker
->
clsid
,
sizeof
(
moniker
->
clsid
),
&
written
);
if
(
SUCCEEDED
(
hr
))
hr
=
IStream_Write
(
stream
,
&
pad
,
sizeof
(
pad
),
&
written
);
return
hr
;
}
static
HRESULT
WINAPI
new_moniker_GetSizeMax
(
IMoniker
*
iface
,
ULARGE_INTEGER
*
size
)
{
FIXM
E
(
"%p, %p.
\n
"
,
iface
,
size
);
TRAC
E
(
"%p, %p.
\n
"
,
iface
,
size
);
return
E_NOTIMPL
;
if
(
!
size
)
return
E_POINTER
;
size
->
QuadPart
=
sizeof
(
CLSID
)
+
2
*
sizeof
(
DWORD
);
return
S_OK
;
}
static
HRESULT
WINAPI
new_moniker_BindToObject
(
IMoniker
*
iface
,
IBindCtx
*
pbc
,
IMoniker
*
pmkToLeft
,
...
...
dlls/comsvcs/tests/comsvcs.c
View file @
239055cf
...
...
@@ -270,13 +270,17 @@ static void create_dispenser(void)
static
void
test_new_moniker
(
void
)
{
IMoniker
*
moniker
,
*
moniker2
,
*
inverse
,
*
class_moniker
;
IUnknown
*
obj
,
*
obj2
;
ULARGE_INTEGER
size
;
DWORD
moniker_type
;
IBindCtx
*
bindctx
;
FILETIME
filetime
;
DWORD
hash
,
eaten
;
IUnknown
*
obj
,
*
obj2
;
IStream
*
stream
;
HGLOBAL
hglobal
;
CLSID
clsid
;
HRESULT
hr
;
void
*
ptr
;
hr
=
CreateBindCtx
(
0
,
&
bindctx
);
ok
(
hr
==
S_OK
,
"Failed to create bind context, hr %#x.
\n
"
,
hr
);
...
...
@@ -372,6 +376,44 @@ todo_wine
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
ok
(
obj
==
NULL
,
"Unexpected return value.
\n
"
);
/* Serialization. */
hr
=
IMoniker_GetSizeMax
(
moniker
,
NULL
);
ok
(
hr
==
E_POINTER
,
"Unexpected hr %#x.
\n
"
,
hr
);
size
.
QuadPart
=
0
;
hr
=
IMoniker_GetSizeMax
(
moniker
,
&
size
);
ok
(
hr
==
S_OK
,
"Failed to get size, hr %#x.
\n
"
,
hr
);
ok
(
size
.
QuadPart
==
(
sizeof
(
GUID
)
+
2
*
sizeof
(
DWORD
)),
"Unexpected size %s.
\n
"
,
wine_dbgstr_longlong
(
size
.
QuadPart
));
hr
=
CreateStreamOnHGlobal
(
NULL
,
TRUE
,
&
stream
);
ok
(
hr
==
S_OK
,
"Failed to create a stream, hr %#x.
\n
"
,
hr
);
hr
=
IMoniker_Save
(
moniker
,
stream
,
FALSE
);
ok
(
hr
==
S_OK
,
"Failed to save moniker, hr %#x.
\n
"
,
hr
);
hr
=
GetHGlobalFromStream
(
stream
,
&
hglobal
);
ok
(
hr
==
S_OK
,
"Failed to get a handle, hr %#x.
\n
"
,
hr
);
ptr
=
GlobalLock
(
hglobal
);
ok
(
!!
ptr
,
"Failed to get data pointer.
\n
"
);
hr
=
CLSIDFromString
(
L"{20d04fe0-3aea-1069-a2d8-08002b30309d}"
,
&
clsid
);
ok
(
hr
==
S_OK
,
"Failed to get CLSID, hr %#x.
\n
"
,
hr
);
ok
(
IsEqualGUID
((
GUID
*
)
ptr
,
&
clsid
),
"Unexpected buffer content.
\n
"
);
ok
(
*
(
DWORD
*
)((
BYTE
*
)
ptr
+
sizeof
(
GUID
))
==
0
,
"Unexpected buffer content.
\n
"
);
ok
(
*
(
DWORD
*
)((
BYTE
*
)
ptr
+
sizeof
(
GUID
)
+
sizeof
(
DWORD
))
==
0
,
"Unexpected buffer content.
\n
"
);
GlobalUnlock
(
hglobal
);
IStream_Release
(
stream
);
hr
=
IMoniker_IsDirty
(
moniker
);
ok
(
hr
==
S_FALSE
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
IMoniker_GetClassID
(
moniker
,
NULL
);
ok
(
hr
==
E_POINTER
,
"Unexpected hr %#x.
\n
"
,
hr
);
IMoniker_Release
(
moniker
);
IBindCtx_Release
(
bindctx
);
}
...
...
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