Commit fa6de6c7 authored by Vitaly Lipatov's avatar Vitaly Lipatov

commit 12.1.2 upon wine-1.5.15

parent e78ae0f8
......@@ -8750,6 +8750,7 @@ _ACEOF
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <X11/Xlib.h>
#include <X11/extensions/Xrandr.h>
int
main ()
......
......@@ -1094,8 +1094,8 @@ then
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <X11/Xlib.h>
#include <X11/extensions/Xrandr.h>]], [[static typeof(XRRSetScreenConfigAndRate) * func; if (func) return 0;]])],
[WINE_CHECK_SONAME(Xrandr,XRRQueryExtension,
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <X11/extensions/Xrandr.h>]],
[[static typeof(XRRGetScreenResources) *f; if (f) return 0;]])],
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <X11/Xlib.h>
#include <X11/extensions/Xrandr.h>]], [[static typeof(XRRGetScreenResources) *f; if (f) return 0;]])],
[AC_DEFINE(HAVE_XRRGETSCREENRESOURCES, 1,
[Define if Xrandr has the XRRGetScreenResources function])])],,
[$X_LIBS $XLIB $X_EXTRA_LIBS])])
......
......@@ -800,13 +800,25 @@ BOOL WINAPI CreateRestrictedToken(
PSID_AND_ATTRIBUTES restrictSids,
PHANDLE newToken)
{
TOKEN_TYPE type;
SECURITY_IMPERSONATION_LEVEL level = TokenImpersonationLevel;
DWORD size;
FIXME("(%p, 0x%x, %u, %p, %u, %p, %u, %p, %p): stub\n",
baseToken, flags, nDisableSids, disableSids,
nDeletePrivs, deletePrivs,
nRestrictSids, restrictSids,
newToken);
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return FALSE;
size = sizeof(type);
if (!GetTokenInformation( baseToken, TokenType, &type, size, &size )) return FALSE;
if (type == TokenImpersonation)
{
size = sizeof(level);
if (!GetTokenInformation( baseToken, TokenImpersonationLevel, &level, size, &size ))
return FALSE;
}
return DuplicateTokenEx( baseToken, MAXIMUM_ALLOWED, NULL, level, type, newToken );
}
/* ##############################
......
......@@ -3903,6 +3903,8 @@ static void test_CreateRestrictedToken(void)
HANDLE process_token, token, r_token;
PTOKEN_GROUPS token_groups, groups2;
SID_AND_ATTRIBUTES sattr;
SECURITY_IMPERSONATION_LEVEL level;
TOKEN_TYPE type;
BOOL is_member;
DWORD size;
BOOL ret;
......@@ -3953,7 +3955,7 @@ static void test_CreateRestrictedToken(void)
sattr.Attributes = 0;
r_token = NULL;
ret = pCreateRestrictedToken(token, 0, 1, &sattr, 0, NULL, 0, NULL, &r_token);
todo_wine ok(ret, "got error %d\n", GetLastError());
ok(ret, "got error %d\n", GetLastError());
if (ret)
{
......@@ -3961,7 +3963,7 @@ static void test_CreateRestrictedToken(void)
is_member = TRUE;
ret = pCheckTokenMembership(r_token, token_groups->Groups[i].Sid, &is_member);
ok(ret, "got error %d\n", GetLastError());
ok(!is_member, "not a member\n");
todo_wine ok(!is_member, "not a member\n");
ret = GetTokenInformation(r_token, TokenGroups, NULL, 0, &size);
ok(!ret && GetLastError() == ERROR_INSUFFICIENT_BUFFER, "got %d with error %d\n",
......@@ -3976,12 +3978,22 @@ static void test_CreateRestrictedToken(void)
break;
}
ok(groups2->Groups[j].Attributes & SE_GROUP_USE_FOR_DENY_ONLY,
todo_wine ok(groups2->Groups[j].Attributes & SE_GROUP_USE_FOR_DENY_ONLY,
"got wrong attributes\n");
ok((groups2->Groups[j].Attributes & SE_GROUP_ENABLED) == 0,
todo_wine ok((groups2->Groups[j].Attributes & SE_GROUP_ENABLED) == 0,
"got wrong attributes\n");
HeapFree(GetProcessHeap(), 0, groups2);
size = sizeof(type);
ret = GetTokenInformation(r_token, TokenType, &type, size, &size);
ok(ret, "got error %d\n", GetLastError());
ok(type == TokenImpersonation, "got type %u\n", type);
size = sizeof(level);
ret = GetTokenInformation(r_token, TokenImpersonationLevel, &level, size, &size);
ok(ret, "got error %d\n", GetLastError());
ok(level == SecurityImpersonation, "got level %u\n", type);
}
HeapFree(GetProcessHeap(), 0, token_groups);
......
......@@ -9425,6 +9425,7 @@ static LRESULT LISTVIEW_Create(HWND hwnd, const CREATESTRUCTW *lpcs)
/* init item size to avoid division by 0 */
LISTVIEW_UpdateItemSize (infoPtr);
LISTVIEW_UpdateSize (infoPtr);
if (infoPtr->uView == LV_VIEW_DETAILS)
{
......@@ -11595,9 +11596,6 @@ LISTVIEW_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
case WM_SHOWWINDOW:
return LISTVIEW_ShowWindow(infoPtr, wParam, lParam);
case WM_SIZE:
return LISTVIEW_Size(infoPtr, (short)LOWORD(lParam), (short)HIWORD(lParam));
case WM_STYLECHANGED:
return LISTVIEW_StyleChanged(infoPtr, wParam, (LPSTYLESTRUCT)lParam);
......@@ -11623,13 +11621,14 @@ LISTVIEW_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
case WM_WINDOWPOSCHANGED:
if (!(((WINDOWPOS *)lParam)->flags & SWP_NOSIZE))
{
SetWindowPos(infoPtr->hwndSelf, 0, 0, 0, 0, 0, SWP_FRAMECHANGED | SWP_NOACTIVATE |
SWP_NOZORDER | SWP_NOMOVE | SWP_NOSIZE);
SetWindowPos(infoPtr->hwndSelf, 0, 0, 0, 0, 0, SWP_FRAMECHANGED | SWP_NOACTIVATE |
SWP_NOZORDER | SWP_NOMOVE | SWP_NOSIZE);
if ((infoPtr->dwStyle & LVS_OWNERDRAWFIXED) && (infoPtr->uView == LV_VIEW_DETAILS))
{
if (notify_measureitem(infoPtr)) LISTVIEW_InvalidateList(infoPtr);
}
if ((infoPtr->dwStyle & LVS_OWNERDRAWFIXED) && (infoPtr->uView == LV_VIEW_DETAILS))
{
if (notify_measureitem(infoPtr)) LISTVIEW_InvalidateList(infoPtr);
}
LISTVIEW_Size(infoPtr, ((WINDOWPOS *)lParam)->cx, ((WINDOWPOS *)lParam)->cy);
}
return DefWindowProcW(hwnd, uMsg, wParam, lParam);
......
......@@ -566,6 +566,8 @@ static void on_before_navigate2(DocHost *This, LPCWSTR url, SAFEARRAY *post_data
VARIANT var_url, var_flags, var_frame_name, var_post_data, var_post_data2, var_headers;
DISPPARAMS dispparams;
VARIANTARG params[7];
WCHAR file_path[MAX_PATH];
DWORD file_path_len = sizeof(file_path) / sizeof(*file_path);
dispparams.cArgs = 7;
dispparams.cNamedArgs = 0;
......@@ -607,7 +609,10 @@ static void on_before_navigate2(DocHost *This, LPCWSTR url, SAFEARRAY *post_data
V_VT(params+5) = (VT_BYREF|VT_VARIANT);
V_VARIANTREF(params+5) = &var_url;
V_VT(&var_url) = VT_BSTR;
V_BSTR(&var_url) = SysAllocString(url);
if(PathCreateFromUrlW(url, file_path, &file_path_len, 0) == S_OK)
V_BSTR(&var_url) = SysAllocString(file_path);
else
V_BSTR(&var_url) = SysAllocString(url);
V_VT(params+6) = (VT_DISPATCH);
V_DISPATCH(params+6) = (IDispatch*)This->wb;
......
......@@ -2542,6 +2542,7 @@ static void test_ConnectionPoint(IWebBrowser2 *unk, BOOL init)
static void test_Navigate2(IWebBrowser2 *webbrowser, const char *nav_url)
{
VARIANT url;
BOOL is_file;
HRESULT hres;
test_LocationURL(webbrowser, is_first_load ? "" : current_url);
......@@ -2551,6 +2552,9 @@ static void test_Navigate2(IWebBrowser2 *webbrowser, const char *nav_url)
V_VT(&url) = VT_BSTR;
V_BSTR(&url) = a2bstr(current_url = nav_url);
if((is_file = !strncasecmp(nav_url, "file://", 7)))
current_url = nav_url + 7;
if(is_first_load) {
SET_EXPECT(Invoke_AMBIENT_USERMODE);
SET_EXPECT(Invoke_PROPERTYCHANGE);
......@@ -2578,6 +2582,7 @@ static void test_Navigate2(IWebBrowser2 *webbrowser, const char *nav_url)
SET_EXPECT(Invoke_COMMANDSTATECHANGE);
SET_EXPECT(EnableModeless_TRUE);
if (!use_container_olecmd) SET_EXPECT(Invoke_DOWNLOADCOMPLETE);
if (is_file) SET_EXPECT(Invoke_PROGRESSCHANGE);
}
hres = IWebBrowser2_Navigate2(webbrowser, &url, NULL, NULL, NULL, NULL);
......@@ -2609,6 +2614,7 @@ static void test_Navigate2(IWebBrowser2 *webbrowser, const char *nav_url)
todo_wine CHECK_CALLED(Invoke_COMMANDSTATECHANGE);
if (use_container_olecmd) todo_wine CHECK_CALLED(Exec_SETDOWNLOADSTATE_0);
CHECK_CALLED(EnableModeless_TRUE);
if (is_file) todo_wine CHECK_CALLED(Invoke_PROGRESSCHANGE);
}
VariantClear(&url);
......@@ -3511,6 +3517,48 @@ static BOOL is_ie_hardened(void)
return ie_harden != 0;
}
static void test_FileProtocol(void)
{
IWebBrowser2 *webbrowser;
HANDLE file;
ULONG ref;
char file_path[MAX_PATH];
char file_url[MAX_PATH] = "File://";
static const char test_file[] = "wine_test.html";
GetTempPathA(MAX_PATH, file_path);
strcat(file_path, test_file);
GetLongPathNameA(file_path, file_path, sizeof(file_path));
strcat(file_url, file_path);
webbrowser = create_webbrowser();
if(!webbrowser)
return;
init_test(webbrowser, 0);
file = CreateFileA(file_path, GENERIC_WRITE, 0, NULL,
CREATE_NEW, FILE_ATTRIBUTE_NORMAL, NULL);
if(file == INVALID_HANDLE_VALUE && GetLastError() != ERROR_FILE_EXISTS){
ok(0, "CreateFile failed\n");
return;
}
CloseHandle(file);
test_ConnectionPoint(webbrowser, TRUE);
test_ClientSite(webbrowser, &ClientSite, TRUE);
test_DoVerb(webbrowser);
test_Navigate2(webbrowser, file_url);
test_ClientSite(webbrowser, NULL, TRUE);
ref = IWebBrowser2_Release(webbrowser);
ok(ref == 0, "ref=%u, expected 0\n", ref);
if(file != INVALID_HANDLE_VALUE)
DeleteFileA(file_path);
}
START_TEST(webbrowser)
{
OleInitialize(NULL);
......@@ -3536,6 +3584,7 @@ START_TEST(webbrowser)
test_WebBrowser_slim_container();
trace("Testing WebBrowserV1...\n");
test_WebBrowserV1();
test_FileProtocol();
OleUninitialize();
}
......@@ -60,11 +60,14 @@ typedef struct
BOOL is_root; /* is directory the root of the drive? */
UINT data_pos; /* current position in dir data */
UINT data_len; /* length of dir data */
BYTE data[8192]; /* directory data */
UINT data_size; /* size of data buffer, or 0 when everything has been read */
BYTE *data; /* directory data */
} FIND_FIRST_INFO;
#define FIND_FIRST_MAGIC 0xc0ffee11
static const UINT max_entry_size = offsetof( FILE_BOTH_DIRECTORY_INFORMATION, FileName[256] );
static BOOL oem_file_apis;
static const WCHAR wildcardsW[] = { '*','?',0 };
......@@ -1917,6 +1920,8 @@ HANDLE WINAPI FindFirstFileExW( LPCWSTR filename, FINDEX_INFO_LEVELS level,
info->magic = FIND_FIRST_MAGIC;
info->data_pos = 0;
info->data_len = 0;
info->data_size = 0;
info->data = NULL;
info->search_op = search_op;
if (device)
......@@ -1932,16 +1937,44 @@ HANDLE WINAPI FindFirstFileExW( LPCWSTR filename, FINDEX_INFO_LEVELS level,
else
{
IO_STATUS_BLOCK io;
BOOL has_wildcard = strpbrkW( info->mask.Buffer, wildcardsW ) != NULL;
info->data_size = has_wildcard ? 8192 : max_entry_size;
NtQueryDirectoryFile( info->handle, 0, NULL, NULL, &io, info->data, sizeof(info->data),
FileBothDirectoryInformation, FALSE, &info->mask, TRUE );
if (io.u.Status)
while (info->data_size)
{
FindClose( info );
SetLastError( RtlNtStatusToDosError( io.u.Status ) );
return INVALID_HANDLE_VALUE;
if (!(info->data = HeapAlloc( GetProcessHeap(), 0, info->data_size )))
{
FindClose( info );
SetLastError( ERROR_NOT_ENOUGH_MEMORY );
return INVALID_HANDLE_VALUE;
}
NtQueryDirectoryFile( info->handle, 0, NULL, NULL, &io, info->data, info->data_size,
FileBothDirectoryInformation, FALSE, &info->mask, TRUE );
if (io.u.Status)
{
FindClose( info );
SetLastError( RtlNtStatusToDosError( io.u.Status ) );
return INVALID_HANDLE_VALUE;
}
if (io.Information < info->data_size - max_entry_size)
{
info->data_size = 0; /* we read everything */
}
else if (info->data_size < 1024 * 1024)
{
HeapFree( GetProcessHeap(), 0, info->data );
info->data_size *= 2;
}
else break;
}
info->data_len = io.Information;
if (!info->data_size && has_wildcard) /* release unused buffer space */
HeapReAlloc( GetProcessHeap(), HEAP_REALLOC_IN_PLACE_ONLY, info->data, info->data_len );
if (!FindNextFileW( info, data ))
{
TRACE( "%s not found\n", debugstr_w(filename) );
......@@ -1949,11 +1982,12 @@ HANDLE WINAPI FindFirstFileExW( LPCWSTR filename, FINDEX_INFO_LEVELS level,
SetLastError( ERROR_FILE_NOT_FOUND );
return INVALID_HANDLE_VALUE;
}
if (!strpbrkW( info->mask.Buffer, wildcardsW ))
if (!has_wildcard) /* we can't find two files with the same name */
{
/* we can't find two files with the same name */
CloseHandle( info->handle );
HeapFree( GetProcessHeap(), 0, info->data );
info->handle = 0;
info->data = NULL;
}
}
return info;
......@@ -1997,15 +2031,21 @@ BOOL WINAPI FindNextFileW( HANDLE handle, WIN32_FIND_DATAW *data )
{
IO_STATUS_BLOCK io;
NtQueryDirectoryFile( info->handle, 0, NULL, NULL, &io, info->data, sizeof(info->data),
FileBothDirectoryInformation, FALSE, &info->mask, FALSE );
if (info->data_size)
NtQueryDirectoryFile( info->handle, 0, NULL, NULL, &io, info->data, info->data_size,
FileBothDirectoryInformation, FALSE, &info->mask, FALSE );
else
io.u.Status = STATUS_NO_MORE_FILES;
if (io.u.Status)
{
SetLastError( RtlNtStatusToDosError( io.u.Status ) );
if (io.u.Status == STATUS_NO_MORE_FILES)
{
CloseHandle( info->handle );
HeapFree( GetProcessHeap(), 0, info->data );
info->handle = 0;
info->data = NULL;
}
break;
}
......@@ -2088,6 +2128,7 @@ BOOL WINAPI FindClose( HANDLE handle )
RtlFreeUnicodeString( &info->path );
info->data_pos = 0;
info->data_len = 0;
HeapFree( GetProcessHeap(), 0, info->data );
RtlLeaveCriticalSection( &info->cs );
info->cs.DebugInfo->Spare[0] = 0;
RtlDeleteCriticalSection( &info->cs );
......
......@@ -795,13 +795,14 @@ fill_fs_info: /* now fill in the information that depends on the file system ty
{
static const WCHAR unixfsW[] = {'U','N','I','X','F','S',0};
if (fsname) lstrcpynW( fsname, unixfsW, fsname_len );
if (flags) *flags = FILE_CASE_PRESERVED_NAMES;
}
else
{
if (fsname) lstrcpynW( fsname, ntfsW, fsname_len );
if (flags) *flags = FILE_CASE_PRESERVED_NAMES | FILE_PERSISTENT_ACLS;
}
if (filename_len) *filename_len = 255;
if (flags) *flags = FILE_CASE_PRESERVED_NAMES | FILE_PERSISTENT_ACLS;
}
break;
}
......
......@@ -384,6 +384,7 @@ static HRESULT WINAPI HTMLDOMNode_get_nodeType(IHTMLDOMNode *iface, LONG *p)
*p = 3;
break;
case COMMENT_NODE:
case DOCUMENT_TYPE_NODE:
*p = 8;
break;
case DOCUMENT_NODE:
......@@ -1101,6 +1102,8 @@ static HRESULT create_node(HTMLDocumentNode *doc, nsIDOMNode *nsnode, HTMLDOMNod
if(FAILED(hres))
return hres;
break;
/* doctype nodes are represented as comment nodes (at least in quirks mode) */
case DOCUMENT_TYPE_NODE:
case COMMENT_NODE: {
HTMLElement *comment;
hres = HTMLCommentElement_Create(doc, nsnode, &comment);
......
......@@ -968,7 +968,7 @@ static HRESULT nsnode_to_nsstring_rec(nsIContentSerializer *serializer, nsIDOMNo
break;
}
case DOCUMENT_TYPE_NODE:
WARN("Ignoring DOCUMENT_TYPE_NODE\n");
nsIContentSerializer_AppendDoctype(serializer, nscontent, str);
break;
case DOCUMENT_FRAGMENT_NODE:
break;
......
......@@ -85,6 +85,10 @@ static const char emptydiv_str[] =
static const char noscript_str[] =
"<html><head><title>noscript test</title><noscript><style>.body { margin-right: 0px; }</style></noscript></head>"
"<body><noscript><div>test</div></noscript></body></html>";
static const char doctype_str[] =
"<!DOCTYPE html>"
"<html><head><title>emptydiv test</title></head>"
"<body><div id=\"divid\"></div></body></html>";
static WCHAR characterW[] = {'c','h','a','r','a','c','t','e','r',0};
static WCHAR texteditW[] = {'t','e','x','t','e','d','i','t',0};
......@@ -6488,6 +6492,24 @@ static void test_noscript(IHTMLDocument2 *doc)
IHTMLElement_Release(body);
}
static void test_doctype(IHTMLDocument2 *doc)
{
IHTMLDocument2 *doc_node;
IHTMLDOMNode *doctype;
int type;
doc_node = get_doc_node(doc);
doctype = get_first_child((IUnknown*)doc_node);
IHTMLDocument2_Release(doc_node);
type = get_node_type((IUnknown*)doctype);
ok(type == 8, "type = %d\n", type);
test_comment_text((IUnknown*)doctype, "<!DOCTYPE html>");
test_elem_type((IUnknown*)doctype, ET_COMMENT);
IHTMLDOMNode_Release(doctype);
}
static void test_null_write(IHTMLDocument2 *doc)
{
HRESULT hres;
......@@ -7036,7 +7058,7 @@ START_TEST(dom)
run_domtest(frameset_str, test_frameset);
run_domtest(emptydiv_str, test_docfrag);
run_domtest(doc_blank, test_replacechild_elems);
run_domtest(noscript_str, test_noscript);
run_domtest(doctype_str, test_doctype);
CoUninitialize();
}
......@@ -7096,12 +7096,14 @@ static UINT ITERATE_RemoveExistingProducts( MSIRECORD *rec, LPVOID param )
{'m','s','i','e','x','e','c',' ','/','i',' ','%','s',' ','R','E','M','O','V','E','=','%','s',0};
MSIPACKAGE *package = param;
const WCHAR *property = MSI_RecordGetString( rec, 7 );
int attrs = MSI_RecordGetInteger( rec, 5 );
UINT len = sizeof(fmtW)/sizeof(fmtW[0]);
WCHAR *product, *features, *cmd;
STARTUPINFOW si;
PROCESS_INFORMATION info;
BOOL ret;
if (attrs & msidbUpgradeAttributesOnlyDetect) return ERROR_SUCCESS;
if (!(product = msi_dup_property( package->db, property ))) return ERROR_SUCCESS;
deformat_string( package, MSI_RecordGetString( rec, 6 ), &features );
......
......@@ -76,6 +76,73 @@ enum {
};
#endif
#if MAC_OS_X_VERSION_MAX_ALLOWED < 1080
/* Defined in <Security/CipherSuite.h> in the 10.8 SDK or later. */
enum {
TLS_NULL_WITH_NULL_NULL = 0x0000,
TLS_RSA_WITH_NULL_MD5 = 0x0001,
TLS_RSA_WITH_NULL_SHA = 0x0002,
TLS_RSA_WITH_RC4_128_MD5 = 0x0004,
TLS_RSA_WITH_RC4_128_SHA = 0x0005,
TLS_RSA_WITH_3DES_EDE_CBC_SHA = 0x000A,
TLS_RSA_WITH_NULL_SHA256 = 0x003B,
TLS_RSA_WITH_AES_128_CBC_SHA256 = 0x003C,
TLS_RSA_WITH_AES_256_CBC_SHA256 = 0x003D,
TLS_DH_DSS_WITH_3DES_EDE_CBC_SHA = 0x000D,
TLS_DH_RSA_WITH_3DES_EDE_CBC_SHA = 0x0010,
TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA = 0x0013,
TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA = 0x0016,
TLS_DH_DSS_WITH_AES_128_CBC_SHA256 = 0x003E,
TLS_DH_RSA_WITH_AES_128_CBC_SHA256 = 0x003F,
TLS_DHE_DSS_WITH_AES_128_CBC_SHA256 = 0x0040,
TLS_DHE_RSA_WITH_AES_128_CBC_SHA256 = 0x0067,
TLS_DH_DSS_WITH_AES_256_CBC_SHA256 = 0x0068,
TLS_DH_RSA_WITH_AES_256_CBC_SHA256 = 0x0069,
TLS_DHE_DSS_WITH_AES_256_CBC_SHA256 = 0x006A,
TLS_DHE_RSA_WITH_AES_256_CBC_SHA256 = 0x006B,
TLS_DH_anon_WITH_RC4_128_MD5 = 0x0018,
TLS_DH_anon_WITH_3DES_EDE_CBC_SHA = 0x001B,
TLS_DH_anon_WITH_AES_128_CBC_SHA256 = 0x006C,
TLS_DH_anon_WITH_AES_256_CBC_SHA256 = 0x006D,
TLS_RSA_WITH_AES_128_GCM_SHA256 = 0x009C,
TLS_RSA_WITH_AES_256_GCM_SHA384 = 0x009D,
TLS_DHE_RSA_WITH_AES_128_GCM_SHA256 = 0x009E,
TLS_DHE_RSA_WITH_AES_256_GCM_SHA384 = 0x009F,
TLS_DH_RSA_WITH_AES_128_GCM_SHA256 = 0x00A0,
TLS_DH_RSA_WITH_AES_256_GCM_SHA384 = 0x00A1,
TLS_DHE_DSS_WITH_AES_128_GCM_SHA256 = 0x00A2,
TLS_DHE_DSS_WITH_AES_256_GCM_SHA384 = 0x00A3,
TLS_DH_DSS_WITH_AES_128_GCM_SHA256 = 0x00A4,
TLS_DH_DSS_WITH_AES_256_GCM_SHA384 = 0x00A5,
TLS_DH_anon_WITH_AES_128_GCM_SHA256 = 0x00A6,
TLS_DH_anon_WITH_AES_256_GCM_SHA384 = 0x00A7,
TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 = 0xC023,
TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384 = 0xC024,
TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256 = 0xC025,
TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384 = 0xC026,
TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 = 0xC027,
TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384 = 0xC028,
TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256 = 0xC029,
TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384 = 0xC02A,
TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 = 0xC02B,
TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 = 0xC02C,
TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256 = 0xC02D,
TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384 = 0xC02E,
TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 = 0xC02F,
TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 = 0xC030,
TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256 = 0xC031,
TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384 = 0xC032,
TLS_EMPTY_RENEGOTIATION_INFO_SCSV = 0x00FF,
};
/* Defined in <Security/SecureTransport.h> in the 10.8 SDK or later. */
enum {
kTLSProtocol11 = 7, /* TLS 1.1 */
kTLSProtocol12 = 8, /* TLS 1.2 */
};
#endif
struct mac_session {
SSLContextRef context;
struct schan_transport *transport;
......@@ -112,7 +179,9 @@ enum {
enum {
schan_enc_3DES_EDE_CBC,
schan_enc_AES_128_CBC,
schan_enc_AES_128_GCM,
schan_enc_AES_256_CBC,
schan_enc_AES_256_GCM,
schan_enc_DES_CBC,
schan_enc_DES40_CBC,
schan_enc_FORTEZZA_CBC,
......@@ -128,6 +197,8 @@ enum {
schan_mac_MD5,
schan_mac_NULL,
schan_mac_SHA,
schan_mac_SHA256,
schan_mac_SHA384,
};
......@@ -213,6 +284,60 @@ static const struct cipher_suite cipher_suites[] = {
CIPHER_SUITE(TLS, ECDH_anon, AES_128_CBC, SHA),
CIPHER_SUITE(TLS, ECDH_anon, AES_256_CBC, SHA),
CIPHER_SUITE(TLS, NULL, NULL, NULL),
CIPHER_SUITE(TLS, RSA, NULL, MD5),
CIPHER_SUITE(TLS, RSA, NULL, SHA),
CIPHER_SUITE(TLS, RSA, RC4_128, MD5),
CIPHER_SUITE(TLS, RSA, RC4_128, SHA),
CIPHER_SUITE(TLS, RSA, 3DES_EDE_CBC, SHA),
CIPHER_SUITE(TLS, RSA, NULL, SHA256),
CIPHER_SUITE(TLS, RSA, AES_128_CBC, SHA256),
CIPHER_SUITE(TLS, RSA, AES_256_CBC, SHA256),
CIPHER_SUITE(TLS, DH_DSS, 3DES_EDE_CBC, SHA),
CIPHER_SUITE(TLS, DH_RSA, 3DES_EDE_CBC, SHA),
CIPHER_SUITE(TLS, DHE_DSS, 3DES_EDE_CBC, SHA),
CIPHER_SUITE(TLS, DHE_RSA, 3DES_EDE_CBC, SHA),
CIPHER_SUITE(TLS, DH_DSS, AES_128_CBC, SHA256),
CIPHER_SUITE(TLS, DH_RSA, AES_128_CBC, SHA256),
CIPHER_SUITE(TLS, DHE_DSS, AES_128_CBC, SHA256),
CIPHER_SUITE(TLS, DHE_RSA, AES_128_CBC, SHA256),
CIPHER_SUITE(TLS, DH_DSS, AES_256_CBC, SHA256),
CIPHER_SUITE(TLS, DH_RSA, AES_256_CBC, SHA256),
CIPHER_SUITE(TLS, DHE_DSS, AES_256_CBC, SHA256),
CIPHER_SUITE(TLS, DHE_RSA, AES_256_CBC, SHA256),
CIPHER_SUITE(TLS, DH_anon, RC4_128, MD5),
CIPHER_SUITE(TLS, DH_anon, 3DES_EDE_CBC, SHA),
CIPHER_SUITE(TLS, DH_anon, AES_128_CBC, SHA256),
CIPHER_SUITE(TLS, DH_anon, AES_256_CBC, SHA256),
CIPHER_SUITE(TLS, RSA, AES_128_GCM, SHA256),
CIPHER_SUITE(TLS, RSA, AES_256_GCM, SHA384),
CIPHER_SUITE(TLS, DHE_RSA, AES_128_GCM, SHA256),
CIPHER_SUITE(TLS, DHE_RSA, AES_256_GCM, SHA384),
CIPHER_SUITE(TLS, DH_RSA, AES_128_GCM, SHA256),
CIPHER_SUITE(TLS, DH_RSA, AES_256_GCM, SHA384),
CIPHER_SUITE(TLS, DHE_DSS, AES_128_GCM, SHA256),
CIPHER_SUITE(TLS, DHE_DSS, AES_256_GCM, SHA384),
CIPHER_SUITE(TLS, DH_DSS, AES_128_GCM, SHA256),
CIPHER_SUITE(TLS, DH_DSS, AES_256_GCM, SHA384),
CIPHER_SUITE(TLS, DH_anon, AES_128_GCM, SHA256),
CIPHER_SUITE(TLS, DH_anon, AES_256_GCM, SHA384),
CIPHER_SUITE(TLS, ECDHE_ECDSA, AES_128_CBC, SHA256),
CIPHER_SUITE(TLS, ECDHE_ECDSA, AES_256_CBC, SHA384),
CIPHER_SUITE(TLS, ECDH_ECDSA, AES_128_CBC, SHA256),
CIPHER_SUITE(TLS, ECDH_ECDSA, AES_256_CBC, SHA384),
CIPHER_SUITE(TLS, ECDHE_RSA, AES_128_CBC, SHA256),
CIPHER_SUITE(TLS, ECDHE_RSA, AES_256_CBC, SHA384),
CIPHER_SUITE(TLS, ECDH_RSA, AES_128_CBC, SHA256),
CIPHER_SUITE(TLS, ECDH_RSA, AES_256_CBC, SHA384),
CIPHER_SUITE(TLS, ECDHE_ECDSA, AES_128_GCM, SHA256),
CIPHER_SUITE(TLS, ECDHE_ECDSA, AES_256_GCM, SHA384),
CIPHER_SUITE(TLS, ECDH_ECDSA, AES_128_GCM, SHA256),
CIPHER_SUITE(TLS, ECDH_ECDSA, AES_256_GCM, SHA384),
CIPHER_SUITE(TLS, ECDHE_RSA, AES_128_GCM, SHA256),
CIPHER_SUITE(TLS, ECDHE_RSA, AES_256_GCM, SHA384),
CIPHER_SUITE(TLS, ECDH_RSA, AES_128_GCM, SHA256),
CIPHER_SUITE(TLS, ECDH_RSA, AES_256_GCM, SHA384),
CIPHER_SUITE(SSL, RSA, RC2_CBC, MD5),
CIPHER_SUITE(SSL, RSA, IDEA_CBC, MD5),
CIPHER_SUITE(SSL, RSA, DES_CBC, MD5),
......@@ -252,9 +377,11 @@ static DWORD schan_get_session_protocol(struct mac_session* s)
switch (protocol)
{
case kSSLProtocol2: return SP_PROT_SSL2_CLIENT;
case kSSLProtocol3: return SP_PROT_SSL3_CLIENT;
case kTLSProtocol1: return SP_PROT_TLS1_CLIENT;
case kSSLProtocol2: return SP_PROT_SSL2_CLIENT;
case kSSLProtocol3: return SP_PROT_SSL3_CLIENT;
case kTLSProtocol1: return SP_PROT_TLS1_CLIENT;
case kTLSProtocol11: return SP_PROT_TLS1_1_CLIENT;
case kTLSProtocol12: return SP_PROT_TLS1_2_CLIENT;
default:
FIXME("unknown protocol %d\n", protocol);
return 0;
......@@ -278,6 +405,8 @@ static ALG_ID schan_get_cipher_algid(const struct cipher_suite* c)
case schan_enc_RC4_128: return CALG_RC4;
case schan_enc_RC4_40: return CALG_RC4;
case schan_enc_AES_128_GCM:
case schan_enc_AES_256_GCM:
case schan_enc_FORTEZZA_CBC:
case schan_enc_IDEA_CBC:
FIXME("Don't know CALG for encryption algorithm %d, returning 0\n", c->enc_alg);
......@@ -297,7 +426,9 @@ static unsigned int schan_get_cipher_key_size(const struct cipher_suite* c)
{
case schan_enc_3DES_EDE_CBC: return 168;
case schan_enc_AES_128_CBC: return 128;
case schan_enc_AES_128_GCM: return 128;
case schan_enc_AES_256_CBC: return 256;
case schan_enc_AES_256_GCM: return 256;
case schan_enc_DES_CBC: return 56;
case schan_enc_DES40_CBC: return 40;
case schan_enc_NULL: return 0;
......@@ -326,6 +457,8 @@ static ALG_ID schan_get_mac_algid(const struct cipher_suite* c)
case schan_mac_MD5: return CALG_MD5;
case schan_mac_NULL: return 0;
case schan_mac_SHA: return CALG_SHA;
case schan_mac_SHA256: return CALG_SHA_256;
case schan_mac_SHA384: return CALG_SHA_384;
default:
FIXME("Unknown hashing algorithm %d for cipher suite %#x, returning 0\n", c->mac_alg, (unsigned)c->suite);
......@@ -342,6 +475,8 @@ static unsigned int schan_get_mac_key_size(const struct cipher_suite* c)
case schan_mac_MD5: return 128;
case schan_mac_NULL: return 0;
case schan_mac_SHA: return 160;
case schan_mac_SHA256: return 256;
case schan_mac_SHA384: return 384;
default:
FIXME("Unknown hashing algorithm %d for cipher suite %#x, returning 0\n", c->mac_alg, (unsigned)c->suite);
......@@ -637,7 +772,9 @@ unsigned int schan_imp_get_session_cipher_block_size(schan_imp_session session)
{
case schan_enc_3DES_EDE_CBC: return 64;
case schan_enc_AES_128_CBC: return 128;
case schan_enc_AES_128_GCM: return 128;
case schan_enc_AES_256_CBC: return 128;
case schan_enc_AES_256_GCM: return 128;
case schan_enc_DES_CBC: return 64;
case schan_enc_DES40_CBC: return 64;
case schan_enc_NULL: return 0;
......
......@@ -634,6 +634,45 @@ static BOOL match_dx10_capable(const struct wined3d_gl_info *gl_info, const char
return gl_info->limits.glsl_varyings > 44;
}
static BOOL match_apple_broken_uniforms(const struct wined3d_gl_info *gl_info, const char *gl_renderer,
enum wined3d_gl_vendor gl_vendor, enum wined3d_pci_vendor card_vendor, enum wined3d_pci_device device)
{
const char *sysrelease;
unsigned int major, minor, ret;
void (CDECL *my_wine_get_host_version)(const char **sysname, const char **release);
/* MacOS dx9 GPU drivers more GLSL vertex shader uniforms than supported by the hardware, and if
* more are used it falls back to software. While the compiler can detect if the shader uses all
* declared uniforms, the optimization fails if the shader uses relative addressing. So any GLSL
* shader using relative addressing falls back to software.
*
* ARB vp gives the correct amount of uniforms, so use it instead of GLSL.
*
* In addition, AMD Radeon HD GPUs advertise > 256 constants and can support this in HW, but the
* driver nevertheless falls back to software if more than 256 are used. This is fixed in MacOS
* 10.8.3 */
/* Non-Apple GL vendors report uniforms correctly */
if (!match_apple(gl_info, gl_renderer, gl_vendor, card_vendor, device)) return FALSE;
/* All dx9 cards are overreported on OSX */
if (!match_dx10_capable(gl_info, gl_renderer, gl_vendor, card_vendor, device)) return TRUE;
/* Nvidia and Intel DX10 cards support > 256 uniforms */
if (card_vendor != HW_VENDOR_AMD) return FALSE;
/* On OSX 10.8.3 and later, AMD GPUs support more than 256 constants. This OSX version reports
* uname -r "12.3.0" */
my_wine_get_host_version = (void *)GetProcAddress(GetModuleHandleA("ntdll.dll"), "wine_get_host_version");
if (!my_wine_get_host_version) return FALSE;
my_wine_get_host_version(NULL, &sysrelease);
ret = sscanf(sysrelease, "%u.%u", &major, &minor);
if (ret != 2) return FALSE; /* String format changed, assume workaround not needed */
if (major > 12) return FALSE;
if (major == 12 && minor >= 3) return FALSE;
return TRUE;
}
static BOOL match_not_dx10_capable(const struct wined3d_gl_info *gl_info, const char *gl_renderer,
enum wined3d_gl_vendor gl_vendor, enum wined3d_pci_vendor card_vendor, enum wined3d_pci_device device)
{
......@@ -911,9 +950,8 @@ static void quirk_arb_constants(struct wined3d_gl_info *gl_info)
gl_info->limits.glsl_ps_float_constants = gl_info->limits.arb_ps_native_constants;
}
static void quirk_apple_glsl_constants(struct wined3d_gl_info *gl_info)
static void quirk_apple_glsl_uniforms(struct wined3d_gl_info *gl_info)
{
quirk_arb_constants(gl_info);
/* MacOS needs uniforms for relative addressing offsets. This can accumulate to quite a few uniforms.
* Beyond that the general uniform isn't optimal, so reserve a number of uniforms. 12 vec4's should
* allow 48 different offsets or other helper immediate values. */
......@@ -1095,15 +1133,14 @@ static const struct driver_quirk quirk_table[] =
quirk_amd_dx9,
"AMD normalized texrect quirk"
},
/* MacOS advertises more GLSL vertex shader uniforms than supported by the hardware, and if more are
* used it falls back to software. While the compiler can detect if the shader uses all declared
* uniforms, the optimization fails if the shader uses relative addressing. So any GLSL shader
* using relative addressing falls back to software.
*
* ARB vp gives the correct amount of uniforms, so use it instead of GLSL. */
{
match_apple,
quirk_apple_glsl_constants,
quirk_apple_glsl_uniforms,
"Reserving 12 GLSL uniforms on OSX"
},
{
match_apple_broken_uniforms,
quirk_arb_constants,
"Apple GLSL uniform override"
},
/* Additionally to matching the apple vendor this code could try to compile a testing NVvp shader
......
......@@ -1070,10 +1070,10 @@ static void check_fbo_compat(const struct wined3d_gl_info *gl_info, struct wined
&& format->glFormat != GL_LUMINANCE && format->glFormat != GL_LUMINANCE_ALPHA
&& (format->red_size || format->alpha_size))
{
GLuint rb, tex2;
DWORD readback[16 * 16], color, r_range, a_range;
BYTE r, a;
BOOL match = TRUE;
GLuint rb;
if (gl_info->supported[ARB_FRAMEBUFFER_OBJECT]
|| gl_info->supported[EXT_PACKED_DEPTH_STENCIL])
......@@ -1127,10 +1127,9 @@ static void check_fbo_compat(const struct wined3d_gl_info *gl_info, struct wined
gl_info->gl_ops.gl.p_glEnd();
gl_info->gl_ops.gl.p_glDisable(GL_BLEND);
gl_info->gl_ops.gl.p_glGenTextures(1, &tex2);
gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_2D, tex2);
gl_info->gl_ops.gl.p_glCopyTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, 0, 0, 16, 16, 0);
/* Rebinding texture to workaround a fglrx bug. */
gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_2D, tex);
gl_info->gl_ops.gl.p_glGetTexImage(GL_TEXTURE_2D, 0, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV, readback);
checkGLcall("Post-pixelshader blending check");
......@@ -1156,9 +1155,6 @@ static void check_fbo_compat(const struct wined3d_gl_info *gl_info, struct wined
TRACE("Color output: %#x\n", color);
format->flags |= WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING;
}
gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_2D, tex);
gl_info->gl_ops.gl.p_glDeleteTextures(1, &tex2);
}
if (gl_info->supported[ARB_FRAMEBUFFER_OBJECT]
......
......@@ -1451,7 +1451,7 @@ BOOL CDECL macdrv_SetClipboardData(UINT format_id, HANDLE data, BOOL owner)
CFDataRef cfdata = NULL;
check_clipboard_ownership(&hwnd_owner);
window = macdrv_get_cocoa_window(GetAncestor(hwnd_owner, GA_ROOT));
window = macdrv_get_cocoa_window(GetAncestor(hwnd_owner, GA_ROOT), FALSE);
TRACE("format_id %04x data %p owner %d hwnd_owner %p window %p)\n", format_id, data, owner, hwnd_owner, window);
/* Find the "natural" format for this format_id (the one which isn't
......
......@@ -337,9 +337,6 @@ static inline void fix_generic_modifiers_by_device(NSUInteger* modifiers)
[window setContentView:contentView];
if (!NSEqualRects([window contentRectForFrameRect:[window frame]], window_frame))
[window windowDidResize:nil];
return window;
}
......@@ -461,6 +458,11 @@ static inline void fix_generic_modifiers_by_device(NSUInteger* modifiers)
self.latentParentWindow = nil;
}
/* Cocoa may adjust the frame when the window is ordered onto the screen.
Generate a frame-changed event just in case. The back end will ignore
it if nothing actually changed. */
[self windowDidResize:nil];
if (![self isExcludedFromWindowsMenu])
[NSApp addWindowsItem:self title:[self title] filename:NO];
}
......@@ -503,23 +505,33 @@ static inline void fix_generic_modifiers_by_device(NSUInteger* modifiers)
[queue discardEventsMatchingMask:event_mask_for_type(WINDOW_FRAME_CHANGED)
forWindow:self];
oldFrame = [self frame];
frame = [self frameRectForContentRect:contentRect];
if (!NSEqualRects(frame, oldFrame))
{
if (NSEqualSizes(frame.size, oldFrame.size))
[self setFrameOrigin:frame.origin];
else
[self setFrame:frame display:YES];
}
if (self.disabled)
if (!NSIsEmptyRect(contentRect))
{
[self setMaxSize:frame.size];
[self setMinSize:frame.size];
oldFrame = [self frame];
frame = [self frameRectForContentRect:contentRect];
if (!NSEqualRects(frame, oldFrame))
{
if (NSEqualSizes(frame.size, oldFrame.size))
[self setFrameOrigin:frame.origin];
else
[self setFrame:frame display:YES];
}
if (self.disabled)
{
[self setMaxSize:frame.size];
[self setMinSize:frame.size];
}
}
[self adjustForChangedDisplayMode];
if (on_screen)
{
/* In case Cocoa adjusted the frame we tried to set, generate a frame-changed
event. The back end will ignore it if nothing actually changed. */
[self windowDidResize:nil];
}
return on_screen;
}
......@@ -570,6 +582,11 @@ static inline void fix_generic_modifiers_by_device(NSUInteger* modifiers)
}
if (![self isExcludedFromWindowsMenu])
[NSApp addWindowsItem:self title:[self title] filename:NO];
/* Cocoa may adjust the frame when the window is ordered onto the screen.
Generate a frame-changed event just in case. The back end will ignore
it if nothing actually changed. */
[self windowDidResize:nil];
}
- (void) setMacDrvParentWindow:(WineWindow*)parent
......
......@@ -144,7 +144,7 @@ struct macdrv_win_data
extern struct macdrv_win_data *get_win_data(HWND hwnd) DECLSPEC_HIDDEN;
extern void release_win_data(struct macdrv_win_data *data) DECLSPEC_HIDDEN;
extern macdrv_window macdrv_get_cocoa_window(HWND hwnd) DECLSPEC_HIDDEN;
extern macdrv_window macdrv_get_cocoa_window(HWND hwnd, BOOL require_on_screen) DECLSPEC_HIDDEN;
extern RGNDATA *get_region_data(HRGN hrgn, HDC hdc_lptodp) DECLSPEC_HIDDEN;
extern struct window_surface *create_surface(macdrv_window window, const RECT *rect, BOOL use_alpha) DECLSPEC_HIDDEN;
extern void set_surface_use_alpha(struct window_surface *window_surface, BOOL use_alpha) DECLSPEC_HIDDEN;
......
......@@ -154,10 +154,12 @@ static void get_mac_rect_offset(struct macdrv_win_data *data, DWORD style, RECT
*
* Return the Mac window associated with the full area of a window
*/
macdrv_window macdrv_get_cocoa_window(HWND hwnd)
macdrv_window macdrv_get_cocoa_window(HWND hwnd, BOOL require_on_screen)
{
struct macdrv_win_data *data = get_win_data(hwnd);
macdrv_window ret = data ? data->cocoa_window : NULL;
macdrv_window ret = NULL;
if (data && (data->on_screen || !require_on_screen))
ret = data->cocoa_window;
release_win_data(data);
return ret;
}
......@@ -181,7 +183,7 @@ static void set_cocoa_window_properties(struct macdrv_win_data *data)
ex_style = GetWindowLongW(data->hwnd, GWL_EXSTYLE);
owner = GetWindow(data->hwnd, GW_OWNER);
owner_win = macdrv_get_cocoa_window(owner);
owner_win = macdrv_get_cocoa_window(owner, TRUE);
macdrv_set_cocoa_parent_window(data->cocoa_window, owner_win);
get_cocoa_window_features(data, style, ex_style, &wf);
......@@ -200,9 +202,29 @@ void CDECL macdrv_SetFocus(HWND hwnd);
*/
static void show_window(struct macdrv_win_data *data)
{
TRACE("win %p/%p\n", data->hwnd, data->cocoa_window);
HWND prev = NULL;
HWND next = NULL;
macdrv_window prev_window = NULL;
macdrv_window next_window = NULL;
/* find window that this one must be after */
prev = GetWindow(data->hwnd, GW_HWNDPREV);
while (prev && !((GetWindowLongW(prev, GWL_STYLE) & WS_VISIBLE) &&
(prev_window = macdrv_get_cocoa_window(prev, TRUE))))
prev = GetWindow(prev, GW_HWNDPREV);
if (!prev_window)
{
/* find window that this one must be before */
next = GetWindow(data->hwnd, GW_HWNDNEXT);
while (next && !((GetWindowLongW(next, GWL_STYLE) & WS_VISIBLE) &&
(next_window = macdrv_get_cocoa_window(next, TRUE))))
next = GetWindow(next, GW_HWNDNEXT);
}
TRACE("win %p/%p below %p/%p above %p/%p\n",
data->hwnd, data->cocoa_window, prev, prev_window, next, next_window);
data->on_screen = macdrv_order_cocoa_window(data->cocoa_window, NULL, NULL);
data->on_screen = macdrv_order_cocoa_window(data->cocoa_window, prev_window, next_window);
if (data->on_screen)
{
HWND hwndFocus = GetFocus();
......@@ -546,30 +568,7 @@ static void sync_window_position(struct macdrv_win_data *data, UINT swp_flags)
wine_dbgstr_rect(&data->whole_rect));
if (data->on_screen && (!(swp_flags & SWP_NOZORDER) || (swp_flags & SWP_SHOWWINDOW)))
{
HWND next = NULL;
macdrv_window prev_window = NULL;
macdrv_window next_window = NULL;
/* find window that this one must be after */
HWND prev = GetWindow(data->hwnd, GW_HWNDPREV);
while (prev && !((GetWindowLongW(prev, GWL_STYLE) & WS_VISIBLE) &&
(prev_window = macdrv_get_cocoa_window(prev))))
prev = GetWindow(prev, GW_HWNDPREV);
if (!prev_window)
{
/* find window that this one must be before */
next = GetWindow(data->hwnd, GW_HWNDNEXT);
while (next && !((GetWindowLongW(next, GWL_STYLE) & WS_VISIBLE) &&
(next_window = macdrv_get_cocoa_window(next))))
next = GetWindow(next, GW_HWNDNEXT);
}
data->on_screen = macdrv_order_cocoa_window(data->cocoa_window, prev_window, next_window);
TRACE("win %p/%p below %p/%p above %p/%p\n",
data->hwnd, data->cocoa_window, prev, prev_window, next, next_window);
}
show_window(data);
}
......@@ -888,11 +887,10 @@ void CDECL macdrv_SetFocus(HWND hwnd)
if (!(hwnd = GetAncestor(hwnd, GA_ROOT))) return;
if (!(data = get_win_data(hwnd))) return;
if (data->cocoa_window)
if (data->cocoa_window && data->on_screen)
{
/* Set Mac focus */
macdrv_give_cocoa_window_focus(data->cocoa_window);
data->on_screen = TRUE;
}
release_win_data(data);
......@@ -1026,7 +1024,7 @@ void CDECL macdrv_SetWindowText(HWND hwnd, LPCWSTR text)
TRACE("%p, %s\n", hwnd, debugstr_w(text));
if ((win = macdrv_get_cocoa_window(hwnd)))
if ((win = macdrv_get_cocoa_window(hwnd, FALSE)))
macdrv_set_cocoa_window_title(win, text, strlenW(text));
}
......@@ -1422,6 +1420,12 @@ void CDECL macdrv_WindowPosChanged(HWND hwnd, HWND insert_after, UINT swp_flags,
hide_window(data);
}
if (!event_type)
{
sync_window_position(data, swp_flags);
set_cocoa_window_properties(data);
}
if (new_style & WS_VISIBLE)
{
if (!data->on_screen || (swp_flags & (SWP_FRAMECHANGED|SWP_STATECHANGED)))
......@@ -1433,12 +1437,6 @@ void CDECL macdrv_WindowPosChanged(HWND hwnd, HWND insert_after, UINT swp_flags,
show_window(data);
}
if (!event_type)
{
sync_window_position(data, swp_flags);
set_cocoa_window_properties(data);
}
done:
release_win_data(data);
}
......@@ -1508,7 +1506,11 @@ void macdrv_window_frame_changed(HWND hwnd, CGRect frame)
if (!hwnd) return;
if (!(data = get_win_data(hwnd))) return;
if (!data->on_screen) goto done;
if (!data->on_screen)
{
release_win_data(data);
return;
}
/* Get geometry */
......@@ -1537,7 +1539,6 @@ void macdrv_window_frame_changed(HWND hwnd, CGRect frame)
TRACE("%p resizing from (%dx%d) to (%dx%d)\n", hwnd, data->window_rect.right - data->window_rect.left,
data->window_rect.bottom - data->window_rect.top, width, height);
done:
release_win_data(data);
if (!(flags & SWP_NOSIZE) || !(flags & SWP_NOMOVE))
......
......@@ -610,10 +610,15 @@ static DWORD init_openssl(void)
DYNCRYPTO(sk_value);
#undef DYNCRYPTO
#ifdef SSL_OP_NO_TLSv1_2
#define pSSL_CTX_set_options(ctx,op) \
pSSL_CTX_ctrl((ctx),SSL_CTRL_OPTIONS,(op),NULL)
#define pSSL_set_options(ssl,op) \
pSSL_ctrl((ssl),SSL_CTRL_OPTIONS,(op),NULL)
#else
#define pSSL_CTX_set_options(ctx,op)
#define pSSL_set_options(ssl,op)
#endif
pSSL_library_init();
pSSL_load_error_strings();
......
......@@ -610,9 +610,7 @@ static void test_null(void)
ok(r == FALSE, "return wrong\n");
r = InternetSetCookieW(szServer, NULL, szServer);
todo_wine {
ok(GetLastError() == ERROR_INTERNET_UNRECOGNIZED_SCHEME, "wrong error\n");
}
ok(r == FALSE, "return wrong\n");
sz = 0;
......
......@@ -157,6 +157,9 @@ static const crack_url_test_t crack_url_tests[] = {
{"file:///C:/Program%20Files/Atmel/./Asdf.xml",
0, 4, INTERNET_SCHEME_FILE, -1, 0, -1, 0, -1, 0, -1, 0, 7, 36, -1, 0,
"file", "", "", "", "C:\\Program Files\\Atmel\\.\\Asdf.xml", ""},
{"C:\\file.txt",
0, 1, INTERNET_SCHEME_UNKNOWN, -1, 0, -1, 0, -1, 0, -1, 0, 2, 9, -1, 0,
"C", "", "", "", "\\file.txt", ""}
};
static const WCHAR *w_str_of(const char *str)
......@@ -538,6 +541,7 @@ static void InternetCrackUrl_test(void)
SetLastError(0xdeadbeef);
urlComponents.dwStructSize = 0;
ret = InternetCrackUrlA(TEST_URL, 0, 0, &urlComponents);
GLE = GetLastError();
ok(ret == FALSE, "Expected InternetCrackUrl to fail\n");
ok(GLE != 0xdeadbeef && GLE != ERROR_SUCCESS, "Expected GLE to represent a failure\n");
......@@ -548,8 +552,25 @@ static void InternetCrackUrl_test(void)
SetLastError(0xdeadbeef);
urlComponents.dwStructSize = sizeof(urlComponents) + 1;
ret = InternetCrackUrlA(TEST_URL, 0, 0, &urlComponents);
GLE = GetLastError();
ok(ret == FALSE, "Expected InternetCrackUrl to fail\n");
ok(GLE != 0xdeadbeef && GLE != ERROR_SUCCESS, "Expected GLE to represent a failure\n");
SetLastError(0xdeadbeef);
memset(&urlComponents, 0, sizeof(urlComponents));
urlComponents.dwStructSize = sizeof(urlComponents);
ret = InternetCrackUrlA("file.txt", 0, 0, &urlComponents);
GLE = GetLastError();
ok(ret == FALSE, "Expected InternetCrackUrl to fail\n");
ok(GLE == ERROR_INTERNET_UNRECOGNIZED_SCHEME, "Expected GLE to represent a failure\n");
SetLastError(0xdeadbeef);
memset(&urlComponents, 0, sizeof(urlComponents));
urlComponents.dwStructSize = sizeof(urlComponents);
ret = InternetCrackUrlA("www.winehq.org", 0, 0, &urlComponents);
GLE = GetLastError();
ok(ret == FALSE, "Expected InternetCrackUrl to fail\n");
ok(GLE == ERROR_INTERNET_UNRECOGNIZED_SCHEME, "Expected GLE to represent a failure\n");
}
static void InternetCrackUrlW_test(void)
......@@ -687,12 +708,10 @@ static void InternetCrackUrlW_test(void)
comp.dwExtraInfoLength = sizeof(extra)/sizeof(extra[0]);
r = InternetCrackUrlW(url2, 0, 0, &comp);
todo_wine {
ok(!r, "InternetCrackUrl should have failed\n");
ok(GetLastError() == ERROR_INTERNET_UNRECOGNIZED_SCHEME,
"InternetCrackUrl should have failed with error ERROR_INTERNET_UNRECOGNIZED_SCHEME instead of error %d\n",
GetLastError());
}
/* Test to see whether cracking a URL without a filename initializes urlpart */
urlpart[0]=0xba;
......
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