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
eb516023
Commit
eb516023
authored
Nov 21, 2012
by
Jacek Caban
Committed by
Alexandre Julliard
Nov 21, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winecrt0: Use atl100.dll directly to create a registrar instance.
parent
f63617ef
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
18 deletions
+7
-18
register.c
dlls/winecrt0/register.c
+7
-18
No files found.
dlls/winecrt0/register.c
View file @
eb516023
...
...
@@ -30,7 +30,7 @@
#include "rpcproxy.h"
#include "atliface.h"
static
const
WCHAR
ole32W
[]
=
{
'o'
,
'l'
,
'e'
,
'3'
,
'2
'
,
'.'
,
'd'
,
'l'
,
'l'
,
0
};
static
const
WCHAR
atl100W
[]
=
{
'a'
,
't'
,
'l'
,
'1'
,
'0'
,
'0
'
,
'.'
,
'd'
,
'l'
,
'l'
,
0
};
static
const
WCHAR
regtypeW
[]
=
{
'W'
,
'I'
,
'N'
,
'E'
,
'_'
,
'R'
,
'E'
,
'G'
,
'I'
,
'S'
,
'T'
,
'R'
,
'Y'
,
0
};
static
const
WCHAR
moduleW
[]
=
{
'M'
,
'O'
,
'D'
,
'U'
,
'L'
,
'E'
,
0
};
...
...
@@ -38,32 +38,25 @@ struct reg_info
{
IRegistrar
*
registrar
;
BOOL
do_register
;
BOOL
uninit
;
HRESULT
result
;
};
static
HMODULE
ole32
;
static
HRESULT
(
WINAPI
*
pCoInitialize
)(
LPVOID
);
static
void
(
WINAPI
*
pCoUninitialize
)(
void
);
static
HRESULT
(
WINAPI
*
pCoCreateInstance
)(
REFCLSID
,
LPUNKNOWN
,
DWORD
,
REFIID
,
LPVOID
*
);
static
HMODULE
atl100
;
static
HRESULT
(
WINAPI
*
pAtlCreateRegistrar
)(
IRegistrar
**
);
static
IRegistrar
*
create_registrar
(
HMODULE
inst
,
struct
reg_info
*
info
)
{
if
(
!
p
CoCreateInstance
)
if
(
!
p
AtlCreateRegistrar
)
{
if
(
!
(
ole32
=
LoadLibraryW
(
ole32W
))
||
!
(
pCoInitialize
=
(
void
*
)
GetProcAddress
(
ole32
,
"CoInitialize"
))
||
!
(
pCoUninitialize
=
(
void
*
)
GetProcAddress
(
ole32
,
"CoUninitialize"
))
||
!
(
pCoCreateInstance
=
(
void
*
)
GetProcAddress
(
ole32
,
"CoCreateInstance"
)))
if
(
!
(
atl100
=
LoadLibraryW
(
atl100W
))
||
!
(
pAtlCreateRegistrar
=
(
void
*
)
GetProcAddress
(
atl100
,
"AtlCreateRegistrar"
)))
{
info
->
result
=
E_NOINTERFACE
;
return
NULL
;
}
}
info
->
uninit
=
SUCCEEDED
(
pCoInitialize
(
NULL
));
info
->
result
=
pCoCreateInstance
(
&
CLSID_Registrar
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IRegistrar
,
(
void
**
)
&
info
->
registrar
);
info
->
result
=
pAtlCreateRegistrar
(
&
info
->
registrar
);
if
(
SUCCEEDED
(
info
->
result
))
{
WCHAR
str
[
MAX_PATH
];
...
...
@@ -108,11 +101,9 @@ HRESULT __wine_register_resources( HMODULE module )
info
.
registrar
=
NULL
;
info
.
do_register
=
TRUE
;
info
.
uninit
=
FALSE
;
info
.
result
=
S_OK
;
EnumResourceNamesW
(
module
,
regtypeW
,
register_resource
,
(
LONG_PTR
)
&
info
);
if
(
info
.
registrar
)
IRegistrar_Release
(
info
.
registrar
);
if
(
info
.
uninit
)
pCoUninitialize
();
return
info
.
result
;
}
...
...
@@ -122,10 +113,8 @@ HRESULT __wine_unregister_resources( HMODULE module )
info
.
registrar
=
NULL
;
info
.
do_register
=
FALSE
;
info
.
uninit
=
FALSE
;
info
.
result
=
S_OK
;
EnumResourceNamesW
(
module
,
regtypeW
,
register_resource
,
(
LONG_PTR
)
&
info
);
if
(
info
.
registrar
)
IRegistrar_Release
(
info
.
registrar
);
if
(
info
.
uninit
)
pCoUninitialize
();
return
info
.
result
;
}
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