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
5622f8f7
Commit
5622f8f7
authored
Aug 03, 2011
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
atl: Use the standard registration mechanism now that the initial registration…
atl: Use the standard registration mechanism now that the initial registration is handled differently.
parent
cde24ec0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
70 deletions
+3
-70
registrar.c
dlls/atl/registrar.c
+3
-70
No files found.
dlls/atl/registrar.c
View file @
5622f8f7
...
...
@@ -27,8 +27,7 @@
#include "winreg.h"
#include "objbase.h"
#include "oaidl.h"
#define ATL_INITGUID
#include "rpcproxy.h"
#include "atliface.h"
#include "atlbase.h"
...
...
@@ -789,58 +788,6 @@ HRESULT WINAPI DllGetClassObject(REFCLSID clsid, REFIID riid, LPVOID *ppvObject)
extern
HINSTANCE
hInst
;
/* this is a copy of the winecrt0 registration code that creates the registrar directly, */
/* since we can't do it through ole32 until it has been registered */
struct
reg_info
{
IRegistrar
*
registrar
;
BOOL
do_register
;
HRESULT
result
;
};
static
IRegistrar
*
create_registrar
(
HMODULE
inst
,
struct
reg_info
*
info
)
{
info
->
result
=
Registrar_create
(
NULL
,
&
IID_IRegistrar
,
(
void
**
)
&
info
->
registrar
);
if
(
SUCCEEDED
(
info
->
result
))
{
static
const
WCHAR
moduleW
[]
=
{
'M'
,
'O'
,
'D'
,
'U'
,
'L'
,
'E'
,
0
};
WCHAR
str
[
MAX_PATH
];
GetModuleFileNameW
(
hInst
,
str
,
MAX_PATH
);
IRegistrar_AddReplacement
(
info
->
registrar
,
moduleW
,
str
);
}
return
info
->
registrar
;
}
static
BOOL
CALLBACK
register_resource
(
HMODULE
module
,
LPCWSTR
type
,
LPWSTR
name
,
LONG_PTR
arg
)
{
struct
reg_info
*
info
=
(
struct
reg_info
*
)
arg
;
WCHAR
*
buffer
;
HRSRC
rsrc
=
FindResourceW
(
module
,
name
,
type
);
char
*
str
=
LoadResource
(
module
,
rsrc
);
DWORD
lenW
,
lenA
=
SizeofResource
(
module
,
rsrc
);
if
(
!
str
)
return
FALSE
;
if
(
!
info
->
registrar
&&
!
create_registrar
(
module
,
info
))
return
FALSE
;
lenW
=
MultiByteToWideChar
(
CP_UTF8
,
0
,
str
,
lenA
,
NULL
,
0
)
+
1
;
if
(
!
(
buffer
=
HeapAlloc
(
GetProcessHeap
(),
0
,
lenW
*
sizeof
(
WCHAR
)
)))
{
info
->
result
=
E_OUTOFMEMORY
;
return
FALSE
;
}
MultiByteToWideChar
(
CP_UTF8
,
0
,
str
,
lenA
,
buffer
,
lenW
);
buffer
[
lenW
-
1
]
=
0
;
if
(
info
->
do_register
)
info
->
result
=
IRegistrar_StringRegister
(
info
->
registrar
,
buffer
);
else
info
->
result
=
IRegistrar_StringUnregister
(
info
->
registrar
,
buffer
);
HeapFree
(
GetProcessHeap
(),
0
,
buffer
);
return
SUCCEEDED
(
info
->
result
);
}
static
HRESULT
do_register_dll_server
(
IRegistrar
*
pRegistrar
,
LPCOLESTR
wszDll
,
LPCOLESTR
wszId
,
BOOL
do_register
,
const
struct
_ATL_REGMAP_ENTRY
*
pMapEntries
)
...
...
@@ -904,14 +851,7 @@ static const WCHAR regtypeW[] = {'W','I','N','E','_','R','E','G','I','S','T','R'
*/
HRESULT
WINAPI
DllRegisterServer
(
void
)
{
struct
reg_info
info
;
info
.
registrar
=
NULL
;
info
.
do_register
=
TRUE
;
info
.
result
=
S_OK
;
EnumResourceNamesW
(
hInst
,
regtypeW
,
register_resource
,
(
LONG_PTR
)
&
info
);
if
(
info
.
registrar
)
IRegistrar_Release
(
info
.
registrar
);
return
info
.
result
;
return
__wine_register_resources
(
hInst
);
}
/***********************************************************************
...
...
@@ -919,14 +859,7 @@ HRESULT WINAPI DllRegisterServer(void)
*/
HRESULT
WINAPI
DllUnregisterServer
(
void
)
{
struct
reg_info
info
;
info
.
registrar
=
NULL
;
info
.
do_register
=
FALSE
;
info
.
result
=
S_OK
;
EnumResourceNamesW
(
hInst
,
regtypeW
,
register_resource
,
(
LONG_PTR
)
&
info
);
if
(
info
.
registrar
)
IRegistrar_Release
(
info
.
registrar
);
return
info
.
result
;
return
__wine_unregister_resources
(
hInst
);
}
/***********************************************************************
...
...
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