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
119501fe
Commit
119501fe
authored
Jul 05, 2015
by
Bernhard Übelacker
Committed by
Alexandre Julliard
Jul 08, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dwrite: Call RegEnumValueW with value and val_count parameters.
parent
f9105eac
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
7 deletions
+28
-7
font.c
dlls/dwrite/font.c
+28
-7
No files found.
dlls/dwrite/font.c
View file @
119501fe
...
...
@@ -1853,8 +1853,8 @@ static ULONG WINAPI systemfontfileenumerator_Release(IDWriteFontFileEnumerator *
static
HRESULT
WINAPI
systemfontfileenumerator_GetCurrentFontFile
(
IDWriteFontFileEnumerator
*
iface
,
IDWriteFontFile
**
file
)
{
struct
system_fontfile_enumerator
*
enumerator
=
impl_from_IDWriteFontFileEnumerator
(
iface
);
DWORD
ret
,
type
,
count
;
WCHAR
*
filename
;
DWORD
ret
,
type
,
val_count
,
count
;
WCHAR
*
value
,
*
filename
;
HRESULT
hr
;
*
file
=
NULL
;
...
...
@@ -1862,14 +1862,22 @@ static HRESULT WINAPI systemfontfileenumerator_GetCurrentFontFile(IDWriteFontFil
if
(
enumerator
->
index
<
0
)
return
E_FAIL
;
if
(
RegEnumValueW
(
enumerator
->
hkey
,
enumerator
->
index
,
NULL
,
NULL
,
NULL
,
&
type
,
NULL
,
&
count
))
ret
=
RegQueryInfoKeyW
(
enumerator
->
hkey
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
&
val_count
,
&
count
,
NULL
,
NULL
);
if
(
ret
!=
ERROR_SUCCESS
)
return
E_FAIL
;
if
(
!
(
filename
=
heap_alloc
(
count
)))
val_count
++
;
value
=
heap_alloc
(
val_count
*
sizeof
(
value
[
0
])
);
filename
=
heap_alloc
(
count
);
if
(
!
value
||
!
filename
)
{
heap_free
(
value
);
heap_free
(
filename
);
return
E_OUTOFMEMORY
;
}
ret
=
RegEnumValueW
(
enumerator
->
hkey
,
enumerator
->
index
,
NULL
,
NULL
,
NULL
,
&
type
,
(
BYTE
*
)
filename
,
&
count
);
ret
=
RegEnumValueW
(
enumerator
->
hkey
,
enumerator
->
index
,
value
,
&
val_count
,
NULL
,
&
type
,
(
BYTE
*
)
filename
,
&
count
);
if
(
ret
)
{
heap_free
(
value
);
heap_free
(
filename
);
return
E_FAIL
;
}
...
...
@@ -1888,6 +1896,7 @@ static HRESULT WINAPI systemfontfileenumerator_GetCurrentFontFile(IDWriteFontFil
else
hr
=
IDWriteFactory2_CreateFontFileReference
(
enumerator
->
factory
,
filename
,
NULL
,
file
);
heap_free
(
value
);
heap_free
(
filename
);
return
hr
;
}
...
...
@@ -1895,14 +1904,25 @@ static HRESULT WINAPI systemfontfileenumerator_GetCurrentFontFile(IDWriteFontFil
static
HRESULT
WINAPI
systemfontfileenumerator_MoveNext
(
IDWriteFontFileEnumerator
*
iface
,
BOOL
*
current
)
{
struct
system_fontfile_enumerator
*
enumerator
=
impl_from_IDWriteFontFileEnumerator
(
iface
);
DWORD
ret
,
max_val_count
;
WCHAR
*
value
;
*
current
=
FALSE
;
enumerator
->
index
++
;
ret
=
RegQueryInfoKeyW
(
enumerator
->
hkey
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
&
max_val_count
,
NULL
,
NULL
,
NULL
);
if
(
ret
!=
ERROR_SUCCESS
)
return
E_FAIL
;
max_val_count
++
;
if
(
!
(
value
=
heap_alloc
(
max_val_count
*
sizeof
(
value
[
0
])
)))
return
E_OUTOFMEMORY
;
/* iterate until we find next string value */
while
(
1
)
{
DWORD
type
=
0
,
count
;
if
(
RegEnumValueW
(
enumerator
->
hkey
,
enumerator
->
index
,
NULL
,
NULL
,
NULL
,
&
type
,
NULL
,
&
count
))
DWORD
type
=
0
,
count
,
val_count
;
val_count
=
max_val_count
;
if
(
RegEnumValueW
(
enumerator
->
hkey
,
enumerator
->
index
,
value
,
&
val_count
,
NULL
,
&
type
,
NULL
,
&
count
))
break
;
if
(
type
==
REG_SZ
)
{
*
current
=
TRUE
;
...
...
@@ -1912,6 +1932,7 @@ static HRESULT WINAPI systemfontfileenumerator_MoveNext(IDWriteFontFileEnumerato
}
TRACE
(
"index = %d, current = %d
\n
"
,
enumerator
->
index
,
*
current
);
heap_free
(
value
);
return
S_OK
;
}
...
...
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