Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
wine-mirror
GitHub Repository: wine-mirror/wine
Path: blob/master/dlls/bcp47langs/main.c
8756 views
1
/*
2
* Copyright 2025 Zhiyi Zhang for CodeWeavers
3
*
4
* This library is free software; you can redistribute it and/or
5
* modify it under the terms of the GNU Lesser General Public
6
* License as published by the Free Software Foundation; either
7
* version 2.1 of the License, or (at your option) any later version.
8
*
9
* This library is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12
* Lesser General Public License for more details.
13
*
14
* You should have received a copy of the GNU Lesser General Public
15
* License along with this library; if not, write to the Free Software
16
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
17
*/
18
19
#include <stdarg.h>
20
21
#include "windef.h"
22
#include "winbase.h"
23
#include "winnls.h"
24
#include "winstring.h"
25
26
#include "wine/debug.h"
27
28
WINE_DEFAULT_DEBUG_CHANNEL(bcp47langs);
29
30
HRESULT WINAPI GetFontFallbackLanguageList(const WCHAR *lang, size_t buffer_length, WCHAR *buffer,
31
size_t *required_buffer_length)
32
{
33
WCHAR locale[LOCALE_NAME_MAX_LENGTH];
34
size_t lang_length;
35
36
FIXME("lang %s, buffer_length %Iu, buffer %p, required_buffer_length %p stub!\n",
37
wine_dbgstr_w(lang), buffer_length, buffer, required_buffer_length);
38
39
if (!buffer_length || !buffer)
40
return E_INVALIDARG;
41
42
if (!lang)
43
{
44
if (!GetUserDefaultLocaleName(locale, LOCALE_NAME_MAX_LENGTH))
45
return E_FAIL;
46
47
lang = locale;
48
}
49
50
/* Return the original language as the fallback language list */
51
lang_length = wcslen(lang) + 1;
52
*required_buffer_length = lang_length;
53
if (buffer_length < lang_length)
54
return E_NOT_SUFFICIENT_BUFFER;
55
56
memcpy(buffer, lang, lang_length * sizeof(WCHAR));
57
return S_OK;
58
}
59
60
HRESULT WINAPI GetUserLanguages(WCHAR delim, HSTRING *langs)
61
{
62
FIXME("%lc, %p\n", delim, langs);
63
return S_OK;
64
}
65
66