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
9b0f4926
Commit
9b0f4926
authored
Oct 07, 2012
by
Nikolay Sivov
Committed by
Alexandre Julliard
Oct 08, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dwrite: Implement GetString().
parent
114ef068
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
51 additions
and
5 deletions
+51
-5
main.c
dlls/dwrite/main.c
+15
-2
font.c
dlls/dwrite/tests/font.c
+34
-3
winerror.h
include/winerror.h
+2
-0
No files found.
dlls/dwrite/main.c
View file @
9b0f4926
...
...
@@ -286,8 +286,21 @@ static HRESULT WINAPI localizedstrings_GetStringLength(IDWriteLocalizedStrings *
static
HRESULT
WINAPI
localizedstrings_GetString
(
IDWriteLocalizedStrings
*
iface
,
UINT32
index
,
WCHAR
*
buffer
,
UINT32
size
)
{
struct
localizedstrings
*
This
=
impl_from_IDWriteLocalizedStrings
(
iface
);
FIXME
(
"(%p)->(%u %p %u): stub
\n
"
,
This
,
index
,
buffer
,
size
);
return
E_NOTIMPL
;
TRACE
(
"(%p)->(%u %p %u)
\n
"
,
This
,
index
,
buffer
,
size
);
if
(
index
>=
This
->
count
)
{
if
(
buffer
)
*
buffer
=
0
;
return
E_FAIL
;
}
if
(
size
<
strlenW
(
This
->
data
[
index
].
string
)
+
1
)
{
if
(
buffer
)
*
buffer
=
0
;
return
E_NOT_SUFFICIENT_BUFFER
;
}
strcpyW
(
buffer
,
This
->
data
[
index
].
string
);
return
S_OK
;
}
static
const
IDWriteLocalizedStringsVtbl
localizedstringsvtbl
=
{
...
...
dlls/dwrite/tests/font.c
View file @
9b0f4926
...
...
@@ -320,6 +320,7 @@ static void test_GetFamilyNames(void)
IDWriteGdiInterop
*
interop
;
IDWriteFont
*
font
;
LOGFONTW
logfont
;
WCHAR
buffer
[
100
];
HRESULT
hr
;
UINT32
len
;
...
...
@@ -357,15 +358,45 @@ if (0) /* crashes on native */
if
(
0
)
/* crashes on native */
hr
=
IDWriteLocalizedStrings_GetStringLength
(
names
,
0
,
NULL
);
len
=
100
;
hr
=
IDWriteLocalizedStrings_GetStringLength
(
names
,
10
,
&
len
);
ok
(
hr
==
E_FAIL
,
"got 0x%08x
\n
"
,
hr
);
ok
(
len
==
(
UINT32
)
-
1
,
"got %u
\n
"
,
len
);
len
=
0
;
hr
=
IDWriteLocalizedStrings_GetStringLength
(
names
,
0
,
&
len
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
len
>
0
,
"got %u
\n
"
,
len
);
len
=
100
;
hr
=
IDWriteLocalizedStrings_GetStringLength
(
names
,
10
,
&
len
);
/* GetString */
hr
=
IDWriteLocalizedStrings_GetString
(
names
,
0
,
NULL
,
0
);
ok
(
hr
==
E_NOT_SUFFICIENT_BUFFER
,
"got 0x%08x
\n
"
,
hr
);
hr
=
IDWriteLocalizedStrings_GetString
(
names
,
10
,
NULL
,
0
);
ok
(
hr
==
E_FAIL
,
"got 0x%08x
\n
"
,
hr
);
ok
(
len
==
(
UINT32
)
-
1
,
"got %u
\n
"
,
len
);
if
(
0
)
hr
=
IDWriteLocalizedStrings_GetString
(
names
,
0
,
NULL
,
100
);
buffer
[
0
]
=
1
;
hr
=
IDWriteLocalizedStrings_GetString
(
names
,
10
,
buffer
,
100
);
ok
(
hr
==
E_FAIL
,
"got 0x%08x
\n
"
,
hr
);
ok
(
buffer
[
0
]
==
0
,
"got %x
\n
"
,
buffer
[
0
]);
buffer
[
0
]
=
1
;
hr
=
IDWriteLocalizedStrings_GetString
(
names
,
0
,
buffer
,
len
-
1
);
ok
(
hr
==
E_NOT_SUFFICIENT_BUFFER
,
"got 0x%08x
\n
"
,
hr
);
ok
(
buffer
[
0
]
==
0
,
"got %x
\n
"
,
buffer
[
0
]);
buffer
[
0
]
=
1
;
hr
=
IDWriteLocalizedStrings_GetString
(
names
,
0
,
buffer
,
len
);
ok
(
hr
==
E_NOT_SUFFICIENT_BUFFER
,
"got 0x%08x
\n
"
,
hr
);
ok
(
buffer
[
0
]
==
0
,
"got %x
\n
"
,
buffer
[
0
]);
buffer
[
0
]
=
0
;
hr
=
IDWriteLocalizedStrings_GetString
(
names
,
0
,
buffer
,
len
+
1
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
buffer
[
0
]
!=
0
,
"got %x
\n
"
,
buffer
[
0
]);
IDWriteLocalizedStrings_Release
(
names
);
...
...
include/winerror.h
View file @
9b0f4926
...
...
@@ -1939,6 +1939,8 @@ static inline HRESULT HRESULT_FROM_WIN32(unsigned int x)
/* the codes 4000-40ff are reserved for OLE */
#undef NOERROR
/* arpa/nameser_compat.h defines this */
#define E_NOT_SUFFICIENT_BUFFER HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER)
#ifdef RC_INVOKED
#define _HRESULT_TYPEDEF_(x) (x)
#else
...
...
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