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
48216541
Commit
48216541
authored
Dec 03, 2010
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
atl: Generate the class registration and use a copy of the standard winecrt0 mechanism.
parent
431e369f
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
81 additions
and
38 deletions
+81
-38
Makefile.in
dlls/atl/Makefile.in
+1
-1
atl.rgs
dlls/atl/atl.rgs
+0
-17
atl_classes.idl
dlls/atl/atl_classes.idl
+10
-3
registrar.c
dlls/atl/registrar.c
+70
-17
No files found.
dlls/atl/Makefile.in
View file @
48216541
...
...
@@ -7,6 +7,6 @@ C_SRCS = \
atl_main.c
\
registrar.c
RC_SRCS
=
rsrc.rc
IDL_R_SRCS
=
atl_classes.idl
@MAKE_DLL_RULES@
dlls/atl/atl.rgs
deleted
100644 → 0
View file @
431e369f
HKCR
{
ATL.Registrar = s 'Registrar Class'
{
CLSID = s '%CLSID_Registrar%'
}
NoRemove CLSID {
ForceRemove '%CLSID_Registrar%' = s 'Registrar Class'
{
ProgID = s 'ATL.Registrar'
InprocServer32 = s '%MODULE%'
{
val ThreadingModel = s 'Both'
}
}
}
}
dlls/atl/
rsrc.rc
→
dlls/atl/
atl_classes.idl
View file @
48216541
/*
* Copyright 2005 Jacek Caban
*
COM
Classes
for
ATL
*
*
Copyright
2010
Alexandre
Julliard
*
*
This
library
is
free
software
; you can redistribute it and/or
*
modify
it
under
the
terms
of
the
GNU
Lesser
General
Public
...
...
@@ -16,5 +18,10 @@
*
Foundation
,
Inc
.
,
51
Franklin
St
,
Fifth
Floor
,
Boston
,
MA
02110
-
1301
,
USA
*/
/* @makedep: atl.rgs */
101 REGISTRY atl.rgs
[
helpstring
(
"Registrar Class"
),
progid
(
"ATL.Registrar"
),
threading
(
both
),
uuid
(
44
ec053a
-
400
f
-
11
d0
-
9
dcd
-
00
a0c90391d3
)
]
coclass
Registrar
{
interface
IRegistrar
; }
dlls/atl/registrar.c
View file @
48216541
...
...
@@ -789,6 +789,58 @@ 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
)
...
...
@@ -820,19 +872,6 @@ static HRESULT do_register_dll_server(IRegistrar *pRegistrar, LPCOLESTR wszDll,
return
hres
;
}
static
HRESULT
do_register_server
(
BOOL
do_register
)
{
static
const
WCHAR
CLSID_RegistrarW
[]
=
{
'C'
,
'L'
,
'S'
,
'I'
,
'D'
,
'_'
,
'R'
,
'e'
,
'g'
,
'i'
,
's'
,
't'
,
'r'
,
'a'
,
'r'
,
0
};
static
const
WCHAR
atl_dllW
[]
=
{
'a'
,
't'
,
'l'
,
'.'
,
'd'
,
'l'
,
'l'
,
0
};
WCHAR
clsid_str
[
40
];
const
struct
_ATL_REGMAP_ENTRY
reg_map
[]
=
{{
CLSID_RegistrarW
,
clsid_str
},
{
NULL
,
NULL
}};
StringFromGUID2
(
&
CLSID_Registrar
,
clsid_str
,
sizeof
(
clsid_str
)
/
sizeof
(
WCHAR
));
return
do_register_dll_server
(
NULL
,
atl_dllW
,
MAKEINTRESOURCEW
(
101
),
do_register
,
reg_map
);
}
/***********************************************************************
* AtlModuleUpdateRegistryFromResourceD [ATL.@]
*
...
...
@@ -858,13 +897,21 @@ HRESULT WINAPI AtlModuleUpdateRegistryFromResourceD(_ATL_MODULEW* pM, LPCOLESTR
return
do_register_dll_server
(
pReg
,
module_name
,
lpszRes
,
bRegister
,
pMapEntries
);
}
static
const
WCHAR
regtypeW
[]
=
{
'W'
,
'I'
,
'N'
,
'E'
,
'_'
,
'R'
,
'E'
,
'G'
,
'I'
,
'S'
,
'T'
,
'R'
,
'Y'
,
0
};
/***********************************************************************
* DllRegisterServer (ATL.@)
*/
HRESULT
WINAPI
DllRegisterServer
(
void
)
{
TRACE
(
"
\n
"
);
return
do_register_server
(
TRUE
);
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
;
}
/***********************************************************************
...
...
@@ -872,8 +919,14 @@ HRESULT WINAPI DllRegisterServer(void)
*/
HRESULT
WINAPI
DllUnregisterServer
(
void
)
{
TRACE
(
"
\n
"
);
return
do_register_server
(
FALSE
);
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
;
}
/***********************************************************************
...
...
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