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
025d84e6
Commit
025d84e6
authored
Mar 07, 2008
by
Huw Davies
Committed by
Alexandre Julliard
Mar 10, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Update both winnt and win9x font keys and factor out the cleanup code.
parent
af7172c1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
72 additions
and
43 deletions
+72
-43
freetype.c
dlls/gdi32/freetype.c
+72
-43
No files found.
dlls/gdi32/freetype.c
View file @
025d84e6
...
...
@@ -1760,10 +1760,9 @@ static void load_system_fonts(void)
*/
static
void
update_reg_entries
(
void
)
{
HKEY
win
key
=
0
,
external
key
=
0
;
HKEY
win
nt_key
=
0
,
win9x_key
=
0
,
external_
key
=
0
;
LPWSTR
valueW
;
LPVOID
data
;
DWORD
dlen
,
vlen
,
datalen
,
valuelen
,
i
,
type
,
len
,
len_fam
;
DWORD
len
,
len_fam
;
Family
*
family
;
Face
*
face
;
struct
list
*
family_elem_ptr
,
*
face_elem_ptr
;
...
...
@@ -1772,47 +1771,20 @@ static void update_reg_entries(void)
static
const
WCHAR
spaceW
[]
=
{
' '
,
'\0'
};
char
*
path
;
if
(
RegCreateKeyExW
(
HKEY_LOCAL_MACHINE
,
is_win9x
()
?
win9x_font_reg_key
:
winnt_font_reg_key
,
0
,
NULL
,
0
,
KEY_ALL_ACCESS
,
NULL
,
&
winkey
,
NULL
)
!=
ERROR_SUCCESS
)
{
if
(
RegCreateKeyExW
(
HKEY_LOCAL_MACHINE
,
winnt_font_reg_key
,
0
,
NULL
,
0
,
KEY_ALL_ACCESS
,
NULL
,
&
win
nt_
key
,
NULL
)
!=
ERROR_SUCCESS
)
{
ERR
(
"Can't create Windows font reg key
\n
"
);
goto
end
;
}
/* @@ Wine registry key: HKCU\Software\Wine\Fonts\ExternalFonts */
if
(
RegCreateKeyW
(
HKEY_CURRENT_USER
,
external_fonts_reg_key
,
&
externalkey
)
!=
ERROR_SUCCESS
)
{
ERR
(
"Can't create external font reg key
\n
"
);
goto
end
;
}
/* Delete all external fonts added last time */
RegQueryInfoKeyW
(
externalkey
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
&
valuelen
,
&
datalen
,
NULL
,
NULL
);
valuelen
++
;
/* returned value doesn't include room for '\0' */
valueW
=
HeapAlloc
(
GetProcessHeap
(),
0
,
valuelen
*
sizeof
(
WCHAR
));
data
=
HeapAlloc
(
GetProcessHeap
(),
0
,
datalen
*
sizeof
(
WCHAR
));
dlen
=
datalen
*
sizeof
(
WCHAR
);
vlen
=
valuelen
;
i
=
0
;
while
(
RegEnumValueW
(
externalkey
,
i
++
,
valueW
,
&
vlen
,
NULL
,
&
type
,
data
,
&
dlen
)
==
ERROR_SUCCESS
)
{
RegDeleteValueW
(
winkey
,
valueW
);
/* reset dlen and vlen */
dlen
=
datalen
;
vlen
=
valuelen
;
if
(
RegCreateKeyExW
(
HKEY_LOCAL_MACHINE
,
win9x_font_reg_key
,
0
,
NULL
,
0
,
KEY_ALL_ACCESS
,
NULL
,
&
win9x_key
,
NULL
)
!=
ERROR_SUCCESS
)
{
ERR
(
"Can't create Windows font reg key
\n
"
);
goto
end
;
}
HeapFree
(
GetProcessHeap
(),
0
,
data
);
HeapFree
(
GetProcessHeap
(),
0
,
valueW
);
/* Delete the old external fonts key */
RegCloseKey
(
externalkey
);
externalkey
=
0
;
RegDeleteKeyW
(
HKEY_CURRENT_USER
,
external_fonts_reg_key
);
/* @@ Wine registry key: HKCU\Software\Wine\Fonts\ExternalFonts */
if
(
RegCreateKeyExW
(
HKEY_CURRENT_USER
,
external_fonts_reg_key
,
0
,
NULL
,
0
,
KEY_ALL_ACCESS
,
NULL
,
&
externalkey
,
NULL
)
!=
ERROR_SUCCESS
)
{
0
,
NULL
,
0
,
KEY_ALL_ACCESS
,
NULL
,
&
external
_
key
,
NULL
)
!=
ERROR_SUCCESS
)
{
ERR
(
"Can't create external font reg key
\n
"
);
goto
end
;
}
...
...
@@ -1843,21 +1815,76 @@ static void update_reg_entries(void)
file
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
*
sizeof
(
WCHAR
));
MultiByteToWideChar
(
CP_ACP
,
0
,
path
,
-
1
,
file
,
len
);
RegSetValueExW
(
winkey
,
valueW
,
0
,
REG_SZ
,
(
BYTE
*
)
file
,
len
*
sizeof
(
WCHAR
));
RegSetValueExW
(
externalkey
,
valueW
,
0
,
REG_SZ
,
(
BYTE
*
)
file
,
len
*
sizeof
(
WCHAR
));
RegSetValueExW
(
winnt_key
,
valueW
,
0
,
REG_SZ
,
(
BYTE
*
)
file
,
len
*
sizeof
(
WCHAR
));
RegSetValueExW
(
win9x_key
,
valueW
,
0
,
REG_SZ
,
(
BYTE
*
)
file
,
len
*
sizeof
(
WCHAR
));
RegSetValueExW
(
external_key
,
valueW
,
0
,
REG_SZ
,
(
BYTE
*
)
file
,
len
*
sizeof
(
WCHAR
));
HeapFree
(
GetProcessHeap
(),
0
,
file
);
HeapFree
(
GetProcessHeap
(),
0
,
valueW
);
}
}
end:
if
(
externalkey
)
RegCloseKey
(
externalkey
);
if
(
winkey
)
RegCloseKey
(
winkey
);
if
(
external_key
)
RegCloseKey
(
external_key
);
if
(
win9x_key
)
RegCloseKey
(
win9x_key
);
if
(
winnt_key
)
RegCloseKey
(
winnt_key
);
return
;
}
static
void
delete_external_font_keys
(
void
)
{
HKEY
winnt_key
=
0
,
win9x_key
=
0
,
external_key
=
0
;
DWORD
dlen
,
vlen
,
datalen
,
valuelen
,
i
,
type
;
LPWSTR
valueW
;
LPVOID
data
;
if
(
RegCreateKeyExW
(
HKEY_LOCAL_MACHINE
,
winnt_font_reg_key
,
0
,
NULL
,
0
,
KEY_ALL_ACCESS
,
NULL
,
&
winnt_key
,
NULL
)
!=
ERROR_SUCCESS
)
{
ERR
(
"Can't create Windows font reg key
\n
"
);
goto
end
;
}
if
(
RegCreateKeyExW
(
HKEY_LOCAL_MACHINE
,
win9x_font_reg_key
,
0
,
NULL
,
0
,
KEY_ALL_ACCESS
,
NULL
,
&
win9x_key
,
NULL
)
!=
ERROR_SUCCESS
)
{
ERR
(
"Can't create Windows font reg key
\n
"
);
goto
end
;
}
if
(
RegCreateKeyW
(
HKEY_CURRENT_USER
,
external_fonts_reg_key
,
&
external_key
)
!=
ERROR_SUCCESS
)
{
ERR
(
"Can't create external font reg key
\n
"
);
goto
end
;
}
/* Delete all external fonts added last time */
RegQueryInfoKeyW
(
external_key
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
&
valuelen
,
&
datalen
,
NULL
,
NULL
);
valuelen
++
;
/* returned value doesn't include room for '\0' */
valueW
=
HeapAlloc
(
GetProcessHeap
(),
0
,
valuelen
*
sizeof
(
WCHAR
));
data
=
HeapAlloc
(
GetProcessHeap
(),
0
,
datalen
*
sizeof
(
WCHAR
));
dlen
=
datalen
*
sizeof
(
WCHAR
);
vlen
=
valuelen
;
i
=
0
;
while
(
RegEnumValueW
(
external_key
,
i
++
,
valueW
,
&
vlen
,
NULL
,
&
type
,
data
,
&
dlen
)
==
ERROR_SUCCESS
)
{
RegDeleteValueW
(
winnt_key
,
valueW
);
RegDeleteValueW
(
win9x_key
,
valueW
);
/* reset dlen and vlen */
dlen
=
datalen
;
vlen
=
valuelen
;
}
HeapFree
(
GetProcessHeap
(),
0
,
data
);
HeapFree
(
GetProcessHeap
(),
0
,
valueW
);
/* Delete the old external fonts key */
RegCloseKey
(
external_key
);
RegDeleteKeyW
(
HKEY_CURRENT_USER
,
external_fonts_reg_key
);
end:
if
(
win9x_key
)
RegCloseKey
(
win9x_key
);
if
(
winnt_key
)
RegCloseKey
(
winnt_key
);
}
/*************************************************************
* WineEngAddFontResourceEx
...
...
@@ -2229,6 +2256,8 @@ BOOL WineEngInit(void)
}
WaitForSingleObject
(
font_mutex
,
INFINITE
);
delete_external_font_keys
();
/* load the system bitmap fonts */
load_system_fonts
();
...
...
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