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
0fd3f0a0
Commit
0fd3f0a0
authored
Nov 29, 2010
by
Michael Stefaniuc
Committed by
Alexandre Julliard
Nov 29, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
atl: Use an iface instead of a vtbl pointer in the Registrar object.
parent
8d959c99
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
14 deletions
+19
-14
registrar.c
dlls/atl/registrar.c
+19
-14
No files found.
dlls/atl/registrar.c
View file @
0fd3f0a0
...
...
@@ -78,7 +78,7 @@ typedef struct rep_list_str {
}
rep_list
;
typedef
struct
{
const
IRegistrarVtbl
*
lpVtbl
;
IRegistrar
IRegistrar_iface
;
LONG
ref
;
rep_list
*
rep
;
}
Registrar
;
...
...
@@ -89,6 +89,11 @@ typedef struct {
DWORD
len
;
}
strbuf
;
static
inline
Registrar
*
impl_from_IRegistrar
(
IRegistrar
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
Registrar
,
IRegistrar_iface
);
}
static
void
strbuf_init
(
strbuf
*
buf
)
{
buf
->
str
=
HeapAlloc
(
GetProcessHeap
(),
0
,
128
*
sizeof
(
WCHAR
));
...
...
@@ -549,7 +554,7 @@ static HRESULT WINAPI Registrar_QueryInterface(IRegistrar *iface, REFIID riid, v
static
ULONG
WINAPI
Registrar_AddRef
(
IRegistrar
*
iface
)
{
Registrar
*
This
=
(
Registrar
*
)
iface
;
Registrar
*
This
=
impl_from_IRegistrar
(
iface
)
;
ULONG
ref
=
InterlockedIncrement
(
&
This
->
ref
);
TRACE
(
"(%p) ->%d
\n
"
,
This
,
ref
);
return
ref
;
...
...
@@ -557,7 +562,7 @@ static ULONG WINAPI Registrar_AddRef(IRegistrar *iface)
static
ULONG
WINAPI
Registrar_Release
(
IRegistrar
*
iface
)
{
Registrar
*
This
=
(
Registrar
*
)
iface
;
Registrar
*
This
=
impl_from_IRegistrar
(
iface
)
;
ULONG
ref
=
InterlockedDecrement
(
&
This
->
ref
);
TRACE
(
"(%p) ->%d
\n
"
,
This
,
ref
);
...
...
@@ -571,7 +576,7 @@ static ULONG WINAPI Registrar_Release(IRegistrar *iface)
static
HRESULT
WINAPI
Registrar_AddReplacement
(
IRegistrar
*
iface
,
LPCOLESTR
Key
,
LPCOLESTR
item
)
{
Registrar
*
This
=
(
Registrar
*
)
iface
;
Registrar
*
This
=
impl_from_IRegistrar
(
iface
)
;
int
len
;
rep_list
*
new_rep
;
...
...
@@ -595,7 +600,7 @@ static HRESULT WINAPI Registrar_AddReplacement(IRegistrar *iface, LPCOLESTR Key,
static
HRESULT
WINAPI
Registrar_ClearReplacements
(
IRegistrar
*
iface
)
{
Registrar
*
This
=
(
Registrar
*
)
iface
;
Registrar
*
This
=
impl_from_IRegistrar
(
iface
)
;
rep_list
*
iter
,
*
iter2
;
TRACE
(
"(%p)
\n
"
,
This
);
...
...
@@ -619,7 +624,7 @@ static HRESULT WINAPI Registrar_ClearReplacements(IRegistrar *iface)
static
HRESULT
WINAPI
Registrar_ResourceRegisterSz
(
IRegistrar
*
iface
,
LPCOLESTR
resFileName
,
LPCOLESTR
szID
,
LPCOLESTR
szType
)
{
Registrar
*
This
=
(
Registrar
*
)
iface
;
Registrar
*
This
=
impl_from_IRegistrar
(
iface
)
;
TRACE
(
"(%p)->(%s %s %s)
\n
"
,
This
,
debugstr_w
(
resFileName
),
debugstr_w
(
szID
),
debugstr_w
(
szType
));
return
resource_register
(
This
,
resFileName
,
szID
,
szType
,
TRUE
);
}
...
...
@@ -627,35 +632,35 @@ static HRESULT WINAPI Registrar_ResourceRegisterSz(IRegistrar* iface, LPCOLESTR
static
HRESULT
WINAPI
Registrar_ResourceUnregisterSz
(
IRegistrar
*
iface
,
LPCOLESTR
resFileName
,
LPCOLESTR
szID
,
LPCOLESTR
szType
)
{
Registrar
*
This
=
(
Registrar
*
)
iface
;
Registrar
*
This
=
impl_from_IRegistrar
(
iface
)
;
TRACE
(
"(%p)->(%s %s %s)
\n
"
,
This
,
debugstr_w
(
resFileName
),
debugstr_w
(
szID
),
debugstr_w
(
szType
));
return
resource_register
(
This
,
resFileName
,
szID
,
szType
,
FALSE
);
}
static
HRESULT
WINAPI
Registrar_FileRegister
(
IRegistrar
*
iface
,
LPCOLESTR
fileName
)
{
Registrar
*
This
=
(
Registrar
*
)
iface
;
Registrar
*
This
=
impl_from_IRegistrar
(
iface
)
;
TRACE
(
"(%p)->(%s)
\n
"
,
This
,
debugstr_w
(
fileName
));
return
file_register
(
This
,
fileName
,
TRUE
);
}
static
HRESULT
WINAPI
Registrar_FileUnregister
(
IRegistrar
*
iface
,
LPCOLESTR
fileName
)
{
Registrar
*
This
=
(
Registrar
*
)
iface
;
Registrar
*
This
=
impl_from_IRegistrar
(
iface
)
;
FIXME
(
"(%p)->(%s)
\n
"
,
This
,
debugstr_w
(
fileName
));
return
file_register
(
This
,
fileName
,
FALSE
);
}
static
HRESULT
WINAPI
Registrar_StringRegister
(
IRegistrar
*
iface
,
LPCOLESTR
data
)
{
Registrar
*
This
=
(
Registrar
*
)
iface
;
Registrar
*
This
=
impl_from_IRegistrar
(
iface
)
;
TRACE
(
"(%p)->(%s)
\n
"
,
This
,
debugstr_w
(
data
));
return
string_register
(
This
,
data
,
TRUE
);
}
static
HRESULT
WINAPI
Registrar_StringUnregister
(
IRegistrar
*
iface
,
LPCOLESTR
data
)
{
Registrar
*
This
=
(
Registrar
*
)
iface
;
Registrar
*
This
=
impl_from_IRegistrar
(
iface
)
;
TRACE
(
"(%p)->(%s)
\n
"
,
This
,
debugstr_w
(
data
));
return
string_register
(
This
,
data
,
FALSE
);
}
...
...
@@ -663,7 +668,7 @@ static HRESULT WINAPI Registrar_StringUnregister(IRegistrar* iface, LPCOLESTR da
static
HRESULT
WINAPI
Registrar_ResourceRegister
(
IRegistrar
*
iface
,
LPCOLESTR
resFileName
,
UINT
nID
,
LPCOLESTR
szType
)
{
Registrar
*
This
=
(
Registrar
*
)
iface
;
Registrar
*
This
=
impl_from_IRegistrar
(
iface
)
;
TRACE
(
"(%p)->(%s %d %s)
\n
"
,
iface
,
debugstr_w
(
resFileName
),
nID
,
debugstr_w
(
szType
));
return
resource_register
(
This
,
resFileName
,
MAKEINTRESOURCEW
(
nID
),
szType
,
TRUE
);
}
...
...
@@ -671,7 +676,7 @@ static HRESULT WINAPI Registrar_ResourceRegister(IRegistrar* iface, LPCOLESTR re
static
HRESULT
WINAPI
Registrar_ResourceUnregister
(
IRegistrar
*
iface
,
LPCOLESTR
resFileName
,
UINT
nID
,
LPCOLESTR
szType
)
{
Registrar
*
This
=
(
Registrar
*
)
iface
;
Registrar
*
This
=
impl_from_IRegistrar
(
iface
)
;
TRACE
(
"(%p)->(%s %d %s)
\n
"
,
This
,
debugstr_w
(
resFileName
),
nID
,
debugstr_w
(
szType
));
return
resource_register
(
This
,
resFileName
,
MAKEINTRESOURCEW
(
nID
),
szType
,
FALSE
);
}
...
...
@@ -700,7 +705,7 @@ static HRESULT Registrar_create(const IUnknown *pUnkOuter, REFIID riid, void **p
return
E_NOINTERFACE
;
ret
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
Registrar
));
ret
->
lpVtbl
=
&
RegistrarVtbl
;
ret
->
IRegistrar_iface
.
lpVtbl
=
&
RegistrarVtbl
;
ret
->
ref
=
1
;
ret
->
rep
=
NULL
;
*
ppvObject
=
ret
;
...
...
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