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
7bb2c3f8
Commit
7bb2c3f8
authored
Aug 09, 2006
by
Francois Gouget
Committed by
Alexandre Julliard
Aug 09, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ole32: Register the CLSID_Picture_Metafile and CLSID_Picture_Dib ProgIDs.
parent
b28f6e52
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
72 additions
and
2 deletions
+72
-2
regsvr.c
dlls/ole32/regsvr.c
+72
-2
No files found.
dlls/ole32/regsvr.c
View file @
7bb2c3f8
...
...
@@ -68,6 +68,7 @@ struct regsvr_coclass
LPCSTR
ips
;
/* can be NULL to omit */
LPCSTR
ips32
;
/* can be NULL to omit */
LPCSTR
ips32_tmodel
;
/* can be NULL to omit */
LPCSTR
progid
;
/* can be NULL to omit */
};
static
HRESULT
register_coclasses
(
struct
regsvr_coclass
const
*
list
);
...
...
@@ -97,6 +98,8 @@ static WCHAR const ips_keyname[13] = {
static
WCHAR
const
ips32_keyname
[
15
]
=
{
'I'
,
'n'
,
'P'
,
'r'
,
'o'
,
'c'
,
'S'
,
'e'
,
'r'
,
'v'
,
'e'
,
'r'
,
'3'
,
'2'
,
0
};
static
WCHAR
const
progid_keyname
[
7
]
=
{
'P'
,
'r'
,
'o'
,
'g'
,
'I'
,
'D'
,
0
};
static
char
const
tmodel_valuename
[]
=
"ThreadingModel"
;
/***********************************************************************
...
...
@@ -107,7 +110,10 @@ static LONG register_key_defvalueW(HKEY base, WCHAR const *name,
WCHAR
const
*
value
);
static
LONG
register_key_defvalueA
(
HKEY
base
,
WCHAR
const
*
name
,
char
const
*
value
);
static
LONG
register_progid
(
WCHAR
const
*
clsid
,
char
const
*
progid
,
char
const
*
name
);
static
LONG
recursive_delete_key
(
HKEY
key
);
static
LONG
recursive_delete_keyA
(
HKEY
base
,
char
const
*
name
);
/***********************************************************************
...
...
@@ -268,6 +274,15 @@ static HRESULT register_coclasses(struct regsvr_coclass const *list)
if
(
res
!=
ERROR_SUCCESS
)
goto
error_close_clsid_key
;
}
if
(
list
->
progid
)
{
res
=
register_key_defvalueA
(
clsid_key
,
progid_keyname
,
list
->
progid
);
if
(
res
!=
ERROR_SUCCESS
)
goto
error_close_clsid_key
;
res
=
register_progid
(
buf
,
list
->
progid
,
list
->
name
);
if
(
res
!=
ERROR_SUCCESS
)
goto
error_close_clsid_key
;
}
error_close_clsid_key:
RegCloseKey
(
clsid_key
);
}
...
...
@@ -306,6 +321,11 @@ static HRESULT unregister_coclasses(struct regsvr_coclass const *list)
res
=
recursive_delete_key
(
clsid_key
);
RegCloseKey
(
clsid_key
);
if
(
res
!=
ERROR_SUCCESS
)
goto
error_close_coclass_key
;
if
(
list
->
progid
)
{
res
=
recursive_delete_keyA
(
HKEY_CLASSES_ROOT
,
list
->
progid
);
if
(
res
!=
ERROR_SUCCESS
)
goto
error_close_coclass_key
;
}
}
error_close_coclass_key:
...
...
@@ -366,6 +386,38 @@ static LONG register_key_defvalueA(
}
/***********************************************************************
* regsvr_progid
*/
static
LONG
register_progid
(
WCHAR
const
*
clsid
,
char
const
*
progid
,
char
const
*
name
)
{
LONG
res
;
HKEY
progid_key
;
res
=
RegCreateKeyExA
(
HKEY_CLASSES_ROOT
,
progid
,
0
,
NULL
,
0
,
KEY_READ
|
KEY_WRITE
,
NULL
,
&
progid_key
,
NULL
);
if
(
res
!=
ERROR_SUCCESS
)
return
res
;
if
(
name
)
{
res
=
RegSetValueExA
(
progid_key
,
NULL
,
0
,
REG_SZ
,
(
CONST
BYTE
*
)
name
,
strlen
(
name
)
+
1
);
if
(
res
!=
ERROR_SUCCESS
)
goto
error_close_progid_key
;
}
if
(
clsid
)
{
res
=
register_key_defvalueW
(
progid_key
,
clsid_keyname
,
clsid
);
if
(
res
!=
ERROR_SUCCESS
)
goto
error_close_progid_key
;
}
error_close_progid_key:
RegCloseKey
(
progid_key
);
return
res
;
}
/***********************************************************************
* recursive_delete_key
*/
static
LONG
recursive_delete_key
(
HKEY
key
)
...
...
@@ -398,6 +450,22 @@ static LONG recursive_delete_key(HKEY key)
}
/***********************************************************************
* recursive_delete_keyA
*/
static
LONG
recursive_delete_keyA
(
HKEY
base
,
char
const
*
name
)
{
LONG
res
;
HKEY
key
;
res
=
RegOpenKeyExA
(
base
,
name
,
0
,
KEY_READ
|
KEY_WRITE
,
&
key
);
if
(
res
==
ERROR_FILE_NOT_FOUND
)
return
ERROR_SUCCESS
;
if
(
res
!=
ERROR_SUCCESS
)
return
res
;
res
=
recursive_delete_key
(
key
);
RegCloseKey
(
key
);
return
res
;
}
/***********************************************************************
* coclass list
*/
static
GUID
const
CLSID_StdOleLink
=
{
...
...
@@ -465,13 +533,15 @@ static struct regsvr_coclass const coclass_list[] = {
"Picture (Metafile)"
,
NULL
,
"ole32.dll"
,
NULL
NULL
,
"StaticMetafile"
},
{
&
CLSID_Picture_Dib
,
"Picture (Device Independent Bitmap)"
,
NULL
,
"ole32.dll"
,
NULL
NULL
,
"StaticDib"
},
{
&
CLSID_ClassMoniker
,
"ClassMoniker"
,
...
...
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