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
72f3765a
Commit
72f3765a
authored
Dec 05, 2010
by
Michael Stefaniuc
Committed by
Alexandre Julliard
Dec 05, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
itss: Standardize the COM usage in moniker.c.
parent
577f202d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
15 deletions
+25
-15
moniker.c
dlls/itss/moniker.c
+25
-15
No files found.
dlls/itss/moniker.c
View file @
72f3765a
...
...
@@ -43,19 +43,24 @@ WINE_DEFAULT_DEBUG_CHANNEL(itss);
/*****************************************************************************/
typedef
struct
{
const
IMonikerVtbl
*
vtbl_ITS_IMoniker
;
IMoniker
IMoniker_iface
;
LONG
ref
;
LPWSTR
szHtml
;
WCHAR
szFile
[
1
];
}
ITS_IMonikerImpl
;
static
inline
ITS_IMonikerImpl
*
impl_from_IMoniker
(
IMoniker
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
ITS_IMonikerImpl
,
IMoniker_iface
);
}
/*** IUnknown methods ***/
static
HRESULT
WINAPI
ITS_IMonikerImpl_QueryInterface
(
IMoniker
*
iface
,
REFIID
riid
,
void
**
ppvObject
)
{
ITS_IMonikerImpl
*
This
=
(
ITS_IMonikerImpl
*
)
iface
;
ITS_IMonikerImpl
*
This
=
impl_from_IMoniker
(
iface
)
;
if
(
IsEqualGUID
(
riid
,
&
IID_IUnknown
)
||
IsEqualGUID
(
riid
,
&
IID_IParseDisplayName
))
...
...
@@ -72,7 +77,7 @@ static HRESULT WINAPI ITS_IMonikerImpl_QueryInterface(
static
ULONG
WINAPI
ITS_IMonikerImpl_AddRef
(
IMoniker
*
iface
)
{
ITS_IMonikerImpl
*
This
=
(
ITS_IMonikerImpl
*
)
iface
;
ITS_IMonikerImpl
*
This
=
impl_from_IMoniker
(
iface
)
;
TRACE
(
"%p
\n
"
,
This
);
return
InterlockedIncrement
(
&
This
->
ref
);
}
...
...
@@ -80,7 +85,7 @@ static ULONG WINAPI ITS_IMonikerImpl_AddRef(
static
ULONG
WINAPI
ITS_IMonikerImpl_Release
(
IMoniker
*
iface
)
{
ITS_IMonikerImpl
*
This
=
(
ITS_IMonikerImpl
*
)
iface
;
ITS_IMonikerImpl
*
This
=
impl_from_IMoniker
(
iface
)
;
ULONG
ref
=
InterlockedDecrement
(
&
This
->
ref
);
if
(
ref
==
0
)
{
...
...
@@ -96,7 +101,7 @@ static HRESULT WINAPI ITS_IMonikerImpl_GetClassID(
IMoniker
*
iface
,
CLSID
*
pClassID
)
{
ITS_IMonikerImpl
*
This
=
(
ITS_IMonikerImpl
*
)
iface
;
ITS_IMonikerImpl
*
This
=
impl_from_IMoniker
(
iface
)
;
TRACE
(
"%p %p
\n
"
,
This
,
pClassID
);
*
pClassID
=
CLSID_ITStorage
;
...
...
@@ -155,7 +160,7 @@ static HRESULT WINAPI ITS_IMonikerImpl_BindToStorage(
REFIID
riid
,
void
**
ppvObj
)
{
ITS_IMonikerImpl
*
This
=
(
ITS_IMonikerImpl
*
)
iface
;
ITS_IMonikerImpl
*
This
=
impl_from_IMoniker
(
iface
)
;
DWORD
grfMode
=
STGM_SIMPLE
|
STGM_READ
|
STGM_SHARE_EXCLUSIVE
;
HRESULT
r
;
IStorage
*
stg
=
NULL
;
...
...
@@ -279,7 +284,7 @@ static HRESULT WINAPI ITS_IMonikerImpl_GetDisplayName(
IMoniker
*
pmkToLeft
,
LPOLESTR
*
ppszDisplayName
)
{
ITS_IMonikerImpl
*
This
=
(
ITS_IMonikerImpl
*
)
iface
;
ITS_IMonikerImpl
*
This
=
impl_from_IMoniker
(
iface
)
;
static
const
WCHAR
szFormat
[]
=
{
'm'
,
's'
,
'-'
,
'i'
,
't'
,
's'
,
':'
,
'%'
,
's'
,
':'
,
':'
,
'%'
,
's'
,
0
};
DWORD
len
=
sizeof
szFormat
/
sizeof
(
WCHAR
);
...
...
@@ -352,7 +357,7 @@ static HRESULT ITS_IMoniker_create( IMoniker **ppObj, LPCWSTR name, DWORD n )
sz
=
sizeof
(
ITS_IMonikerImpl
)
+
strlenW
(
name
)
*
sizeof
(
WCHAR
);
itsmon
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sz
);
itsmon
->
vtbl_ITS_IMoniker
=
&
ITS_IMonikerImpl_Vtbl
;
itsmon
->
IMoniker_iface
.
lpVtbl
=
&
ITS_IMonikerImpl_Vtbl
;
itsmon
->
ref
=
1
;
strcpyW
(
itsmon
->
szFile
,
name
);
itsmon
->
szHtml
=
&
itsmon
->
szFile
[
n
];
...
...
@@ -362,7 +367,7 @@ static HRESULT ITS_IMoniker_create( IMoniker **ppObj, LPCWSTR name, DWORD n )
TRACE
(
"-> %p %s %s
\n
"
,
itsmon
,
debugstr_w
(
itsmon
->
szFile
),
debugstr_w
(
itsmon
->
szHtml
)
);
*
ppObj
=
(
IMoniker
*
)
itsmon
;
*
ppObj
=
&
itsmon
->
IMoniker_iface
;
ITSS_LockModule
();
return
S_OK
;
...
...
@@ -371,16 +376,21 @@ static HRESULT ITS_IMoniker_create( IMoniker **ppObj, LPCWSTR name, DWORD n )
/*****************************************************************************/
typedef
struct
{
const
IParseDisplayNameVtbl
*
vtbl_ITS_IParseDisplayNam
e
;
IParseDisplayName
IParseDisplayName_ifac
e
;
LONG
ref
;
}
ITS_IParseDisplayNameImpl
;
static
inline
ITS_IParseDisplayNameImpl
*
impl_from_IParseDisplayName
(
IParseDisplayName
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
ITS_IParseDisplayNameImpl
,
IParseDisplayName_iface
);
}
static
HRESULT
WINAPI
ITS_IParseDisplayNameImpl_QueryInterface
(
IParseDisplayName
*
iface
,
REFIID
riid
,
void
**
ppvObject
)
{
ITS_IParseDisplayNameImpl
*
This
=
(
ITS_IParseDisplayNameImpl
*
)
iface
;
ITS_IParseDisplayNameImpl
*
This
=
impl_from_IParseDisplayName
(
iface
)
;
if
(
IsEqualGUID
(
riid
,
&
IID_IUnknown
)
||
IsEqualGUID
(
riid
,
&
IID_IParseDisplayName
))
...
...
@@ -397,7 +407,7 @@ static HRESULT WINAPI ITS_IParseDisplayNameImpl_QueryInterface(
static
ULONG
WINAPI
ITS_IParseDisplayNameImpl_AddRef
(
IParseDisplayName
*
iface
)
{
ITS_IParseDisplayNameImpl
*
This
=
(
ITS_IParseDisplayNameImpl
*
)
iface
;
ITS_IParseDisplayNameImpl
*
This
=
impl_from_IParseDisplayName
(
iface
)
;
TRACE
(
"%p
\n
"
,
This
);
return
InterlockedIncrement
(
&
This
->
ref
);
}
...
...
@@ -405,7 +415,7 @@ static ULONG WINAPI ITS_IParseDisplayNameImpl_AddRef(
static
ULONG
WINAPI
ITS_IParseDisplayNameImpl_Release
(
IParseDisplayName
*
iface
)
{
ITS_IParseDisplayNameImpl
*
This
=
(
ITS_IParseDisplayNameImpl
*
)
iface
;
ITS_IParseDisplayNameImpl
*
This
=
impl_from_IParseDisplayName
(
iface
)
;
ULONG
ref
=
InterlockedDecrement
(
&
This
->
ref
);
if
(
ref
==
0
)
{
...
...
@@ -428,7 +438,7 @@ static HRESULT WINAPI ITS_IParseDisplayNameImpl_ParseDisplayName(
const
DWORD
prefix_len
=
(
sizeof
szPrefix
/
sizeof
szPrefix
[
0
])
-
1
;
DWORD
n
;
ITS_IParseDisplayNameImpl
*
This
=
(
ITS_IParseDisplayNameImpl
*
)
iface
;
ITS_IParseDisplayNameImpl
*
This
=
impl_from_IParseDisplayName
(
iface
)
;
TRACE
(
"%p %s %p %p
\n
"
,
This
,
debugstr_w
(
pszDisplayName
),
pchEaten
,
ppmkOut
);
...
...
@@ -469,7 +479,7 @@ HRESULT ITS_IParseDisplayName_create(IUnknown *pUnkOuter, LPVOID *ppObj)
return
CLASS_E_NOAGGREGATION
;
its
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
ITS_IParseDisplayNameImpl
)
);
its
->
vtbl_ITS_IParseDisplayName
=
&
ITS_IParseDisplayNameImpl_Vtbl
;
its
->
IParseDisplayName_iface
.
lpVtbl
=
&
ITS_IParseDisplayNameImpl_Vtbl
;
its
->
ref
=
1
;
TRACE
(
"-> %p
\n
"
,
its
);
...
...
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