Commit f7a89b35 authored by Vitaly Lipatov's avatar Vitaly Lipatov

commit 16.1.0 upon wine-1.9.21

parent a40bbd20
......@@ -359,6 +359,18 @@ static UINT find_charset( const WCHAR *name )
return 0;
}
static WORD get_default_sublang(LCID lang)
{
switch (PRIMARYLANGID(lang))
{
case LANG_SPANISH:
return SUBLANG_SPANISH_MODERN;
case LANG_CHINESE:
return SUBLANG_CHINESE_SIMPLIFIED;
default:
return SUBLANG_DEFAULT;
}
}
/***********************************************************************
* find_locale_id_callback
......@@ -378,7 +390,7 @@ static BOOL CALLBACK find_locale_id_callback( HMODULE hModule, LPCWSTR type,
GetLocaleInfoW( lcid, LOCALE_SNAME | LOCALE_NOUSEROVERRIDE,
buffer, sizeof(buffer)/sizeof(WCHAR) ))
{
if (!strcmpW( data->win_name, buffer ))
if (!strcmpiW( data->win_name, buffer ))
{
matches = 4; /* everything matches */
goto done;
......@@ -388,7 +400,7 @@ static BOOL CALLBACK find_locale_id_callback( HMODULE hModule, LPCWSTR type,
if (!GetLocaleInfoW( lcid, LOCALE_SISO639LANGNAME | LOCALE_NOUSEROVERRIDE,
buffer, sizeof(buffer)/sizeof(WCHAR) ))
return TRUE;
if (strcmpW( buffer, data->lang )) return TRUE;
if (strcmpiW( buffer, data->lang )) return TRUE;
matches++; /* language name matched */
if (data->country)
......@@ -396,13 +408,13 @@ static BOOL CALLBACK find_locale_id_callback( HMODULE hModule, LPCWSTR type,
if (GetLocaleInfoW( lcid, LOCALE_SISO3166CTRYNAME|LOCALE_NOUSEROVERRIDE,
buffer, sizeof(buffer)/sizeof(WCHAR) ))
{
if (strcmpW( buffer, data->country )) goto done;
if (strcmpiW( buffer, data->country )) goto done;
matches++; /* country name matched */
}
}
else /* match default language */
{
if (SUBLANGID(LangID) == SUBLANG_DEFAULT) matches++;
if (SUBLANGID(LangID) == get_default_sublang( LangID )) matches++;
}
if (data->codepage)
......@@ -1645,7 +1657,7 @@ INT WINAPI GetLocaleInfoW( LCID lcid, LCTYPE lctype, LPWSTR buffer, INT len )
/* replace SUBLANG_NEUTRAL by SUBLANG_DEFAULT */
if (SUBLANGID(lang_id) == SUBLANG_NEUTRAL)
lang_id = MAKELANGID(PRIMARYLANGID(lang_id), SUBLANG_DEFAULT);
lang_id = MAKELANGID(PRIMARYLANGID(lang_id), get_default_sublang( lang_id ));
if (!(hrsrc = FindResourceExW( kernel32_handle, (LPWSTR)RT_STRING,
ULongToPtr((lctype >> 4) + 1), lang_id )))
......@@ -2754,7 +2766,7 @@ LCID WINAPI ConvertDefaultLocale( LCID lcid )
langid = LANGIDFROMLCID(lcid);
if (SUBLANGID(langid) == SUBLANG_NEUTRAL)
{
langid = MAKELANGID(PRIMARYLANGID(langid), SUBLANG_DEFAULT);
langid = MAKELANGID(PRIMARYLANGID(langid), get_default_sublang( langid ));
lcid = MAKELCID(langid, SORTIDFROMLCID(lcid));
}
}
......@@ -4190,7 +4202,7 @@ static BOOL NLS_GetLanguageGroupName(LGRPID lgrpid, LPWSTR szName, ULONG nameSiz
langId = GetSystemDefaultLangID();
if (SUBLANGID(langId) == SUBLANG_NEUTRAL)
langId = MAKELANGID( PRIMARYLANGID(langId), SUBLANG_DEFAULT );
langId = MAKELANGID(PRIMARYLANGID(langId), get_default_sublang( langId ));
hResource = FindResourceExW( kernel32_handle, (LPWSTR)RT_STRING, szResourceName, langId );
......
......@@ -123,7 +123,7 @@ STRINGTABLE LANGUAGE LANG_SPANISH, SUBLANG_SPANISH_MODERN
LOCALE_SMONTHNAME12 "diciembre"
LOCALE_SMONTHNAME13 ""
LOCALE_SMONTHOUSANDSEP "."
LOCALE_SNAME "es-ES_modern"
LOCALE_SNAME "es-ES"
LOCALE_SNATIVECTRYNAME "España"
LOCALE_SNATIVECURRNAME "euro"
LOCALE_SNATIVEDIGITS "0123456789"
......
......@@ -123,7 +123,7 @@ STRINGTABLE LANGUAGE LANG_SPANISH, SUBLANG_SPANISH
LOCALE_SMONTHNAME12 "diciembre"
LOCALE_SMONTHNAME13 ""
LOCALE_SMONTHOUSANDSEP "."
LOCALE_SNAME "es-ES"
LOCALE_SNAME "es-ES_tradnl"
LOCALE_SNATIVECTRYNAME "España"
LOCALE_SNATIVECURRNAME "euro"
LOCALE_SNATIVEDIGITS "0123456789"
......
......@@ -252,7 +252,7 @@ static const struct neutralsublang_name2_t neutralsublang_names2[] = {
{ {'e','s',0}, {'e','s','-','E','S',0},
MAKELCID(MAKELANGID(LANG_SPANISH, SUBLANG_SPANISH_MODERN), SORT_DEFAULT),
MAKELCID(MAKELANGID(LANG_SPANISH, SUBLANG_SPANISH), SORT_DEFAULT) /* vista */,
{'e','s','-','E','S','_','t','r','a','d','n','l',0}, 0x1 },
{'e','s','-','E','S','_','t','r','a','d','n','l',0} },
{ {'g','a',0}, {'g','a','-','I','E',0},
MAKELCID(MAKELANGID(LANG_IRISH, SUBLANG_IRISH_IRELAND), SORT_DEFAULT), 0, {0}, 0x3 },
{ {'i','t',0}, {'i','t','-','I','T',0},
......@@ -270,7 +270,7 @@ static const struct neutralsublang_name2_t neutralsublang_names2[] = {
{ {'u','z',0}, {'u','z','-','L','a','t','n','-','U','Z',0},
MAKELCID(MAKELANGID(LANG_UZBEK, SUBLANG_UZBEK_LATIN), SORT_DEFAULT) },
{ {'z','h',0}, {'z','h','-','C','N',0},
MAKELCID(MAKELANGID(LANG_CHINESE, SUBLANG_CHINESE_SIMPLIFIED), SORT_DEFAULT), 0, {0}, 0x3 },
MAKELCID(MAKELANGID(LANG_CHINESE, SUBLANG_CHINESE_SIMPLIFIED), SORT_DEFAULT) },
{ {0} }
};
......@@ -2681,7 +2681,7 @@ static const struct neutralsublang_name_t neutralsublang_names[] = {
{ {'a','z',0}, MAKELCID(MAKELANGID(LANG_AZERI, SUBLANG_AZERI_LATIN), SORT_DEFAULT) },
{ {'d','e',0}, MAKELCID(MAKELANGID(LANG_GERMAN, SUBLANG_GERMAN), SORT_DEFAULT) },
{ {'e','n',0}, MAKELCID(MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), SORT_DEFAULT) },
{ {'e','s',0}, MAKELCID(MAKELANGID(LANG_SPANISH, SUBLANG_SPANISH_MODERN), SORT_DEFAULT), 1 },
{ {'e','s',0}, MAKELCID(MAKELANGID(LANG_SPANISH, SUBLANG_SPANISH_MODERN), SORT_DEFAULT) },
{ {'g','a',0}, MAKELCID(MAKELANGID(LANG_IRISH, SUBLANG_IRISH_IRELAND), SORT_DEFAULT) },
{ {'i','t',0}, MAKELCID(MAKELANGID(LANG_ITALIAN, SUBLANG_ITALIAN), SORT_DEFAULT) },
{ {'m','s',0}, MAKELCID(MAKELANGID(LANG_MALAY, SUBLANG_MALAY_MALAYSIA), SORT_DEFAULT) },
......@@ -2690,7 +2690,7 @@ static const struct neutralsublang_name_t neutralsublang_names[] = {
{ {'s','r',0}, MAKELCID(MAKELANGID(LANG_SERBIAN, SUBLANG_SERBIAN_SERBIA_LATIN), SORT_DEFAULT), 1 },
{ {'s','v',0}, MAKELCID(MAKELANGID(LANG_SWEDISH, SUBLANG_SWEDISH), SORT_DEFAULT) },
{ {'u','z',0}, MAKELCID(MAKELANGID(LANG_UZBEK, SUBLANG_UZBEK_LATIN), SORT_DEFAULT) },
{ {'z','h',0}, MAKELCID(MAKELANGID(LANG_CHINESE, SUBLANG_CHINESE_SIMPLIFIED), SORT_DEFAULT), 1 },
{ {'z','h',0}, MAKELCID(MAKELANGID(LANG_CHINESE, SUBLANG_CHINESE_SIMPLIFIED), SORT_DEFAULT) },
{ {0} }
};
......@@ -2700,6 +2700,7 @@ static void test_LocaleNameToLCID(void)
INT ret;
WCHAR buffer[LOCALE_NAME_MAX_LENGTH];
static const WCHAR enW[] = {'e','n',0};
static const WCHAR esesW[] = {'e','s','-','e','s',0};
if (!pLocaleNameToLCID)
{
......@@ -2740,6 +2741,10 @@ static void test_LocaleNameToLCID(void)
ok(!lcid && GetLastError() == ERROR_INVALID_PARAMETER,
"Expected lcid == 0, got %08x, error %d\n", lcid, GetLastError());
/* lower-case */
lcid = pLocaleNameToLCID(esesW, 0);
ok(lcid == MAKELCID(MAKELANGID(LANG_SPANISH, SUBLANG_SPANISH_MODERN), SORT_DEFAULT), "Got wrong lcid for es-es: 0x%x\n", lcid);
/* english neutral name */
lcid = pLocaleNameToLCID(enW, 0);
ok(lcid == MAKELCID(MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), SORT_DEFAULT) ||
......
......@@ -1153,6 +1153,31 @@ NTSTATUS WINAPI NtQueryInformationThread( HANDLE handle, THREADINFOCLASS class,
}
}
return status;
case ThreadIsIoPending:
{ /* CrossOver hack for bug 14503 */
LDR_MODULE *pldr;
FIXME( "ThreadIsIoPending info class not supported yet\n" );
status = LdrFindEntryForAddress( NtCurrentTeb()->Peb->ImageBaseAddress, &pldr );
if (status == STATUS_SUCCESS)
{
static const WCHAR qwexe[] = {'q','w','.','e','x','e'};
int i, len = pldr->FullDllName.Length/sizeof(WCHAR);
for (i = 0; i < len; i++)
if (pldr->FullDllName.Buffer[len-i-1] == '\\') break;
if (i >= sizeof(qwexe)/sizeof(WCHAR) && !memcmp(pldr->FullDllName.Buffer+len-i, qwexe, sizeof(qwexe)))
{
FIXME("Quicken ThreadIsIoPending hack\n");
if (length != sizeof(BOOL)) return STATUS_INFO_LENGTH_MISMATCH;
*(BOOL*)data = FALSE;
if (ret_len) *ret_len = sizeof(BOOL);
return STATUS_SUCCESS;
}
}
return STATUS_NOT_IMPLEMENTED;
}
case ThreadPriority:
case ThreadBasePriority:
case ThreadImpersonationToken:
......@@ -1163,7 +1188,6 @@ NTSTATUS WINAPI NtQueryInformationThread( HANDLE handle, THREADINFOCLASS class,
case ThreadIdealProcessor:
case ThreadPriorityBoost:
case ThreadSetTlsArrayAddress:
case ThreadIsIoPending:
default:
FIXME( "info class %d not supported yet\n", class );
return STATUS_NOT_IMPLEMENTED;
......
......@@ -174,6 +174,9 @@ BOOL schan_imp_create_session(schan_imp_session *session, schan_credentials *cre
return FALSE;
}
/* HACK for CrossOver bug 12357 */
if (pgnutls_cipher_get_block_size == compat_cipher_get_block_size) strcpy(priority, "NORMAL");
p = priority + strlen(priority);
for(i=0; i < sizeof(protocol_priority_flags)/sizeof(*protocol_priority_flags); i++) {
*p++ = ':';
......
......@@ -714,11 +714,13 @@ static HRESULT WINAPI ISF_MyComputer_fnGetDisplayNameOf (IShellFolder2 *iface,
if (unix_path)
{
char real_unix_path[PATH_MAX];
int len;
realpath(unix_path, real_unix_path);
HeapFree( GetProcessHeap(), 0, unix_path );
MultiByteToWideChar(CP_UNIXCP, 0, real_unix_path, -1,
wszDrive, sizeof(wszDrive)/sizeof(wszDrive[0]));
wszDrive[sizeof(wszDrive)/sizeof(wszDrive[0])-1] = '\0';
len = MultiByteToWideChar(CP_UNIXCP, 0, real_unix_path, -1,
wszDrive, sizeof(wszDrive)/sizeof(wszDrive[0]) - 6);
wszDrive[len] = '\0';
}
}
......
......@@ -257,7 +257,7 @@ static HRESULT copypixels_to_32bppBGRA(struct FormatConverter *This, const WICRe
*dstpixel++ = colors[srcval>>6];
if (x+1 < prc->Width) *dstpixel++ = colors[srcval>>4&0x3];
if (x+2 < prc->Width) *dstpixel++ = colors[srcval>>2&0x3];
if (x+1 < prc->Width) *dstpixel++ = colors[srcval&0x3];
if (x+3 < prc->Width) *dstpixel++ = colors[srcval&0x3];
}
srcrow += srcstride;
dstrow += cbStride;
......
......@@ -2506,10 +2506,9 @@ static void *wined3d_cs_queue_require_space(struct wined3d_cs_queue *queue, unsi
unsigned int nop_size = remaining - FIELD_OFFSET(struct wined3d_cs_packet, data[0]);
struct wined3d_cs_nop *nop;
TRACE("Inserting a nop for %u + %u bytes.\n", remaining - nop_size, nop_size);
packet = (struct wined3d_cs_packet *)&queue->data[queue->head];
packet->size = nop_size;
nop = (struct wined3d_cs_nop *)packet->data;
TRACE("No room at the end of the buffer for a packet large %u bytes, inserting a NOP for %u + %u bytes.\n",
packet_size, remaining - nop_size, nop_size);
nop = wined3d_cs_queue_require_space(queue, nop_size, cs);
if (nop_size)
nop->opcode = WINED3D_CS_OP_NOP;
......
......@@ -1358,6 +1358,16 @@ static void shader_glsl_clip_plane_uniform(const struct wined3d_context *context
const struct wined3d_gl_info *gl_info = context->gl_info;
struct wined3d_vec4 plane;
/* With macOS clip planes emulation, the generated shader
* hardcodes the enabled clip planes. That means the compiler
* might optimize away clip_planes[] elements known not to be
* used. Trying to upload unused clip plane uniforms is thus a bad
* idea, since the computed uniform location will either be
* unused, thus invalid, or used by some other uniform, which is
* potentially dangerous. */
if (!(state->render_states[WINED3D_RS_CLIPPLANEENABLE] & 1 << index))
return;
/* Clip planes are affected by the view transform in d3d for FFP draws. */
if (!use_vs(state))
multiply_vector_matrix(&plane, &state->clip_planes[index], &state->transforms[WINED3D_TS_VIEW]);
......@@ -1365,6 +1375,7 @@ static void shader_glsl_clip_plane_uniform(const struct wined3d_context *context
plane = state->clip_planes[index];
GL_EXTCALL(glUniform4fv(prog->vs.clip_planes_location + index, 1, &plane.x));
checkGLcall("glUniform4fv");
}
/* Context activation is done by the caller (state handler). */
......
......@@ -445,7 +445,7 @@ static int bitmap_info_size(const BITMAPINFO *info, WORD coloruse)
}
else /* assume BITMAPINFOHEADER */
{
colors = MIN(info->bmiHeader.biClrUsed, 256);
colors = min(info->bmiHeader.biClrUsed, 256);
if (!colors && (info->bmiHeader.biBitCount <= 8))
colors = 1 << info->bmiHeader.biBitCount;
if (info->bmiHeader.biCompression == BI_BITFIELDS) masks = 3;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment