Commit 4a20aa0e authored by Vitaly Lipatov's avatar Vitaly Lipatov

commit 13.1.0 upon wine-1.7.4

parent 4a297352
......@@ -24,6 +24,8 @@
#include "config.h"
#include "wine/port.h"
#include "ntstatus.h"
#define WIN32_NO_STATUS
#include "dbghelp_private.h"
#ifdef HAVE_MACH_O_LOADER_H
......@@ -948,23 +950,52 @@ static BOOL macho_load_file(struct process* pcs, const WCHAR* filename,
*/
if (macho_info->flags & MACHO_INFO_DEBUG_HEADER)
{
static void* dyld_all_image_infos_addr;
PROCESS_BASIC_INFORMATION pbi;
NTSTATUS status;
/* This symbol should be in the same place in all processes. */
if (!dyld_all_image_infos_addr)
ret = FALSE;
/* Get address of PEB */
status = NtQueryInformationProcess(pcs->handle, ProcessBasicInformation,
&pbi, sizeof(pbi), NULL);
if (status == STATUS_SUCCESS)
{
struct nlist nl[2];
memset(nl, 0, sizeof(nl));
nl[0].n_un.n_name = (char*)"_dyld_all_image_infos";
if (!nlist("/usr/lib/dyld", nl))
dyld_all_image_infos_addr = (void*)nl[0].n_value;
ULONG dyld_image_info;
/* Read dyld image info address from PEB */
if (ReadProcessMemory(pcs->handle, &pbi.PebBaseAddress->Reserved,
&dyld_image_info, sizeof(dyld_image_info), NULL))
{
TRACE("got dyld_image_info 0x%08x from PEB %p MacDyldImageInfo %p\n",
dyld_image_info, pbi.PebBaseAddress, &pbi.PebBaseAddress->Reserved);
macho_info->dbg_hdr_addr = dyld_image_info;
ret = TRUE;
}
}
if (dyld_all_image_infos_addr)
macho_info->dbg_hdr_addr = (unsigned long)dyld_all_image_infos_addr;
else
ret = FALSE;
TRACE("dbg_hdr_addr = 0x%08lx\n", macho_info->dbg_hdr_addr);
if (!ret)
{
static void* dyld_all_image_infos_addr;
/* Our next best guess is that dyld was loaded at its base address
and we can find the dyld image infos address by looking up its symbol. */
if (!dyld_all_image_infos_addr)
{
struct nlist nl[2];
memset(nl, 0, sizeof(nl));
nl[0].n_un.n_name = (char*)"_dyld_all_image_infos";
if (!nlist("/usr/lib/dyld", nl))
dyld_all_image_infos_addr = (void*)nl[0].n_value;
}
if (dyld_all_image_infos_addr)
{
TRACE("got dyld_image_info %p from /usr/lib/dyld symbol table\n",
dyld_all_image_infos_addr);
macho_info->dbg_hdr_addr = (unsigned long)dyld_all_image_infos_addr;
ret = TRUE;
}
}
}
if (macho_info->flags & MACHO_INFO_MODULE)
......
......@@ -772,7 +772,7 @@ static BOOL IMM_DestroyContext(HIMC hIMC)
TRACE("Destroying %p\n",hIMC);
if (hIMC)
if (data)
{
IMMThreadData *tdata;
data->immKbd->uSelected --;
......
......@@ -1324,6 +1324,7 @@ void CDECL __wine_kernel_init(void)
{
int fd = atoi(child_pipe);
if (fd) close( fd );
unsetenv("WINE_WAIT_CHILD_PIPE");
}
}
}
......
......@@ -36,6 +36,7 @@
#include "objbase.h"
#include "rpcproxy.h"
#include "mlang.h"
#include "mimeole.h"
#include "wine/unicode.h"
#include "wine/debug.h"
......@@ -44,8 +45,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(mlang);
#include "initguid.h"
#define CP_UNICODE 1200
static HRESULT MultiLanguage_create(IUnknown *pUnkOuter, LPVOID *ppObj);
static HRESULT MLangConvertCharset_create(IUnknown *outer, void **obj);
static HRESULT EnumRfc1766_create(LANGID LangId, IEnumRfc1766 **ppEnum);
......@@ -3484,10 +3483,28 @@ static HRESULT WINAPI fnIMLangLineBreakConsole_BreakLineA(
LONG* pcchLine,
LONG* pcchSkip)
{
LONG i, line = cchSrc, skip = 0;
FIXME("(%p)->%i %i %s %i %i %p %p\n", iface, locale, uCodePage, debugstr_an(pszSrc,cchSrc), cchSrc, cMaxColumns, pcchLine, pcchSkip);
*pcchLine = cchSrc;
*pcchSkip = 0;
if (uCodePage == CP_USASCII && cchSrc > cMaxColumns)
{
for (line = cMaxColumns, i = cMaxColumns - 1; i >= 0; i--)
{
if (pszSrc[i] == ' ')
{
while (i >= 0 && pszSrc[i] == ' ')
{
i--;
line--;
skip++;
}
break;
}
}
}
*pcchLine = line;
*pcchSkip = skip;
return S_OK;
}
......
......@@ -92,6 +92,7 @@ HANDLE CDECL __wine_make_process_system(void)
{
int fd = atoi(child_pipe);
if (fd) close( fd );
unsetenv("WINE_WAIT_CHILD_PIPE");
}
SERVER_START_REQ( make_process_system )
......
......@@ -186,6 +186,23 @@ done:
return status;
}
#ifdef __APPLE__
#include <mach/mach.h>
#include <mach/mach_error.h>
static ULONG get_dyld_image_info_addr(void)
{
ULONG ret = 0;
#ifdef TASK_DYLD_INFO
struct task_dyld_info dyld_info;
mach_msg_type_number_t size = TASK_DYLD_INFO_COUNT;
if (task_info(mach_task_self(), TASK_DYLD_INFO, (task_info_t)&dyld_info, &size) == KERN_SUCCESS)
ret = dyld_info.all_image_info_addr;
#endif
return ret;
}
#endif /* __APPLE__ */
/***********************************************************************
* thread_init
*
......@@ -245,6 +262,9 @@ HANDLE thread_init(void)
InitializeListHead( &ldr.InMemoryOrderModuleList );
InitializeListHead( &ldr.InInitializationOrderModuleList );
InitializeListHead( &tls_links );
#ifdef __APPLE__
peb->Reserved[0] = get_dyld_image_info_addr();
#endif
/* allocate and initialize the initial TEB */
......
......@@ -1391,7 +1391,7 @@ static UINT wined3d_cs_exec_set_vs_consts_i(struct wined3d_cs *cs, const void *d
const struct wined3d_cs_set_consts_i *op = data;
struct wined3d_device *device = cs->device;
memcpy(&cs->state.vs_consts_i[op->start_register], op->constants,
memcpy(&cs->state.vs_consts_i[op->start_register * 4], op->constants,
sizeof(*cs->state.vs_consts_i) * 4 * op->vector4i_count);
device_invalidate_shader_constants(device, WINED3D_SHADER_CONST_VS_I);
......@@ -1404,7 +1404,7 @@ static UINT wined3d_cs_exec_set_ps_consts_i(struct wined3d_cs *cs, const void *d
const struct wined3d_cs_set_consts_i *op = data;
struct wined3d_device *device = cs->device;
memcpy(&cs->state.ps_consts_i[op->start_register], op->constants,
memcpy(&cs->state.ps_consts_i[op->start_register * 4], op->constants,
sizeof(*cs->state.ps_consts_i) * 4 * op->vector4i_count);
device_invalidate_shader_constants(device, WINED3D_SHADER_CONST_PS_I);
......
......@@ -29,6 +29,4 @@ OBJC_SRCS = \
cocoa_status_item.m \
cocoa_window.m
RC_SRCS = winemac.rc
@MAKE_DLL_RULES@
......@@ -2488,20 +2488,20 @@ int macdrv_clip_cursor(CGRect rect)
* color depths from the icon resource. If images is NULL or empty,
* restores the default application image.
*/
void macdrv_set_application_icon(CFArrayRef images, CFDataRef imageData)
void macdrv_set_application_icon(CFArrayRef images, CFURLRef urlRef)
{
NSArray* imageArray = (NSArray*)images;
NSData* data = (NSData*)imageData;
NSURL* url = (NSURL*)urlRef;
OnMainThreadAsync(^{
WineApplicationController* controller = [WineApplicationController sharedController];
if (imageArray || !data)
NSImage* image = nil;
if (!imageArray && url)
image = [[[NSImage alloc] initWithContentsOfURL:url] autorelease];
if (imageArray || ![image isValid])
[controller setApplicationIconFromCGImageArray:imageArray];
else
{
NSImage* image = [[[NSImage alloc] initWithData:data] autorelease];
controller.applicationIcon = image;
}
});
}
......
......@@ -167,7 +167,7 @@ extern int right_option_is_alt DECLSPEC_HIDDEN;
extern int macdrv_start_cocoa_app(unsigned long long tickcount) DECLSPEC_HIDDEN;
extern void macdrv_window_rejected_focus(const struct macdrv_event *event) DECLSPEC_HIDDEN;
extern void macdrv_beep(void) DECLSPEC_HIDDEN;
extern void macdrv_set_application_icon(CFArrayRef images, CFDataRef imageData) DECLSPEC_HIDDEN;
extern void macdrv_set_application_icon(CFArrayRef images, CFURLRef url) DECLSPEC_HIDDEN;
extern void macdrv_quit_reply(int reply) DECLSPEC_HIDDEN;
extern int macdrv_using_input_method(void) DECLSPEC_HIDDEN;
extern void macdrv_set_mouse_capture_window(macdrv_window window) DECLSPEC_HIDDEN;
......
......@@ -95,7 +95,7 @@ const char* debugstr_cf(CFTypeRef t)
/***********************************************************************
* set_app_icon
*/
static void set_app_icon(HINSTANCE instance)
static void set_app_icon(void)
{
CFArrayRef images = create_app_icon_images();
if (images)
......@@ -105,18 +105,39 @@ static void set_app_icon(HINSTANCE instance)
}
else
{
static const WCHAR fallback_icon[] = {'F','A','L','L','B','A','C','K','_','I','C','O','N',0};
HRSRC rsrc = FindResourceW(instance, fallback_icon, (LPCWSTR)RT_RCDATA);
const BYTE *bytes = LockResource(LoadResource(instance, rsrc));
DWORD size = SizeofResource(instance, rsrc);
if (bytes && size)
const char *cx_root;
if ((cx_root = getenv("CX_ROOT")) && cx_root[0])
{
CFDataRef data = CFDataCreateWithBytesNoCopy(NULL, (UInt8*)bytes,
size, kCFAllocatorNull);
if (data)
CFURLRef url, temp;
url = CFURLCreateFromFileSystemRepresentation(NULL, (UInt8*)cx_root, strlen(cx_root), TRUE);
if (url)
{
macdrv_set_application_icon(NULL, data);
CFRelease(data);
temp = CFURLCreateCopyDeletingLastPathComponent(NULL, url);
CFRelease(url);
url = temp;
}
if (url)
{
temp = CFURLCreateCopyDeletingLastPathComponent(NULL, url);
CFRelease(url);
url = temp;
}
if (url)
{
temp = CFURLCreateCopyAppendingPathComponent(NULL, url, CFSTR("Resources"), TRUE);
CFRelease(url);
url = temp;
}
if (url)
{
temp = CFURLCreateCopyAppendingPathComponent(NULL, url, CFSTR("exeIcon.icns"), FALSE);
CFRelease(url);
url = temp;
}
if (url)
{
macdrv_set_application_icon(NULL, url);
CFRelease(url);
}
}
}
......@@ -249,7 +270,7 @@ static BOOL process_attach( HINSTANCE instance )
return FALSE;
}
set_app_icon(instance);
set_app_icon();
macdrv_clipboard_process_attach();
IME_RegisterClasses( instance );
......
/*
* Resource file for Mac driver
*
* Copyright (c) 2007 Alexandre Julliard
* Copyright (c) 2013 Ken Thomases for CodeWeavers Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
FALLBACK_ICON RCDATA ../../../macosx/CrossOver/images/exeIcon.icns
#define WINE_FILEDESCRIPTION_STR "Wine Mac driver"
#define WINE_FILENAME_STR "winemac.drv"
#include "wine/wine_common_ver.rc"
......@@ -767,6 +767,7 @@ int WINAPI wWinMain(HINSTANCE hinstance,
{
close(waitchild_pipeid);
}
unsetenv("WINE_WAIT_CHILD_PIPE");
}
}
......
......@@ -3,7 +3,6 @@ APPMODE = -mconsole
IMPORTS = psapi dbghelp advapi32
DELAYIMPORTS = comdlg32 shell32 comctl32 user32 gdi32
EXTRALIBS = @LIBPOLL@
EXTRAINCL = -I$(top_srcdir)/..
C_SRCS = \
be_arm.c \
......
......@@ -20,7 +20,6 @@
#include <windef.h>
#include <winuser.h>
#include "distversion.h"
#define IDD_CRASH_DLG 100
#define IDD_DETAILS_DLG 101
......
......@@ -50,7 +50,9 @@ BEGIN
LTEXT "The program %s has encountered a serious problem and needs \
to close. We are sorry for the inconvenience.",
IDC_STATIC_TXT1,27,10,224,30
CONTROL WINDEBUG_WHAT_HAPPENED_MESSAGE,
CONTROL "This can be caused by a problem in the program or a deficiency in Wine. \
You may want to check <a href=\"http://www.codeweavers.com/compatibility/\">http://www.codeweavers.com/compatibility/</a> \
for tips about running this application.",
IDC_STATIC_TXT2,"SysLink",0,27,60,224,100
DEFPUSHBUTTON "Close", IDOK, 205, 151, 60, 16, WS_TABSTOP
PUSHBUTTON "Show &Details", ID_DETAILS, 140, 151, 60, 16, WS_TABSTOP
......@@ -62,7 +64,10 @@ CAPTION "Program Error Details"
FONT 8, "MS Shell Dlg"
BEGIN
EDITTEXT IDC_CRASH_TXT, 4, 4, 392, 272, ES_MULTILINE | ES_READONLY | WS_HSCROLL | WS_VSCROLL, WS_TABSTOP
CONTROL WINDEBUG_USER_SUGGESTION_MESSAGE,
CONTROL "If this problem is not present under Windows and has not been reported yet, \
you can save the detailed information to a file using the \"Save As\" button, \
then <a href=\"http://www.codeweavers.com/support/tickets/enter/\">file a bug report</a> \
and attach that file to the report.",
IDC_STATIC_TXT2,"SysLink",0,6,285,388,32
DEFPUSHBUTTON "Close", IDOK, 326, 320, 70, 16, WS_TABSTOP
PUSHBUTTON "&Save As...", ID_SAVEAS, 252, 320, 70, 16, WS_TABSTOP
......
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