Module: wine
Branch: refs/heads/master
Commit: a37a5014a2f03f4220277aa984490e88a3ea07b2
URL: http://source.winehq.org/git/?p=wine.git;a=commit;h=a37a5014a2f03f4220277aa…
Author: Robert Shearman <rob(a)codeweavers.com>
Date: Mon Feb 20 11:15:57 2006 +0100
ole: Change the Apartment Model field to a boolean.
Change the apartment model field to a boolean that just specifies
whether the apartment is multi-threaded or not and fix up all the
places where this is used.
Fixes a bug where we would return an error if the previous apartment
model passed into CoInitializeEx matches the new apartment model, but
additional optimisation flags are specified.
---
dlls/ole32/compobj.c | 23 +++++++++++++++--------
dlls/ole32/compobj_private.h | 4 ++--
dlls/ole32/rpc.c | 4 ++--
3 files changed, 19 insertions(+), 12 deletions(-)
diff --git a/dlls/ole32/compobj.c b/dlls/ole32/compobj.c
index ab44b20..a757adb 100644
--- a/dlls/ole32/compobj.c
+++ b/dlls/ole32/compobj.c
@@ -229,17 +229,17 @@ static APARTMENT *apartment_construct(DW
InitializeCriticalSection(&apt->cs);
DEBUG_SET_CRITSEC_NAME(&apt->cs, "apartment");
- apt->model = model;
+ apt->multi_threaded = !(model & COINIT_APARTMENTTHREADED);
- if (model & COINIT_APARTMENTTHREADED)
+ if (apt->multi_threaded)
{
/* FIXME: should be randomly generated by in an RPC call to rpcss */
- apt->oxid = ((OXID)GetCurrentProcessId() << 32) | GetCurrentThreadId();
+ apt->oxid = ((OXID)GetCurrentProcessId() << 32) | 0xcafe;
}
else
{
/* FIXME: should be randomly generated by in an RPC call to rpcss */
- apt->oxid = ((OXID)GetCurrentProcessId() << 32) | 0xcafe;
+ apt->oxid = ((OXID)GetCurrentProcessId() << 32) | GetCurrentThreadId();
}
TRACE("Created apartment on OXID %s\n", wine_dbgstr_longlong(apt->oxid));
@@ -292,6 +292,11 @@ static APARTMENT *apartment_get_or_creat
return apt;
}
+static inline BOOL apartment_is_model(APARTMENT *apt, DWORD model)
+{
+ return (apt->multi_threaded == !(model & COINIT_APARTMENTTHREADED));
+}
+
DWORD apartment_addref(struct apartment *apt)
{
DWORD refs = InterlockedIncrement(&apt->refs);
@@ -420,7 +425,7 @@ static LRESULT CALLBACK apartment_wndpro
HRESULT apartment_createwindowifneeded(struct apartment *apt)
{
- if (!(apt->model & COINIT_APARTMENTTHREADED))
+ if (apt->multi_threaded)
return S_OK;
if (!apt->win)
@@ -443,7 +448,7 @@ HRESULT apartment_createwindowifneeded(s
HWND apartment_getwindow(struct apartment *apt)
{
- assert(apt->model & COINIT_APARTMENTTHREADED);
+ assert(!apt->multi_threaded);
return apt->win;
}
@@ -633,11 +638,13 @@ HRESULT WINAPI CoInitializeEx(LPVOID lpR
apt = apartment_get_or_create(dwCoInit);
if (!apt) return E_OUTOFMEMORY;
}
- else if (dwCoInit != apt->model)
+ else if (!apartment_is_model(apt, dwCoInit))
{
/* Changing the threading model after it's been set is illegal. If this warning is triggered by Wine
code then we are probably using the wrong threading model to implement that API. */
- ERR("Attempt to change threading model of this apartment from 0x%lx to 0x%lx\n", apt->model, dwCoInit);
+ ERR("Attempt to change threading model of this apartment from %s to %s\n",
+ apt->multi_threaded ? "multi-threaded" : "apartment threaded",
+ dwCoInit & COINIT_APARTMENTTHREADED ? "apartment threaded" : "multi-threaded");
return RPC_E_CHANGED_MODE;
}
else
diff --git a/dlls/ole32/compobj_private.h b/dlls/ole32/compobj_private.h
index 2e86a99..caa84de 100644
--- a/dlls/ole32/compobj_private.h
+++ b/dlls/ole32/compobj_private.h
@@ -132,10 +132,10 @@ struct proxy_manager
/* this needs to become a COM object that implements IRemUnknown */
struct apartment
{
- struct list entry;
+ struct list entry;
LONG refs; /* refcount of the apartment (LOCK) */
- DWORD model; /* threading model (RO) */
+ BOOL multi_threaded; /* multi-threaded or single-threaded apartment? (RO) */
DWORD tid; /* thread id (RO) */
OXID oxid; /* object exporter ID (RO) */
LONG ipidc; /* interface pointer ID counter, starts at 1 (LOCK) */
diff --git a/dlls/ole32/rpc.c b/dlls/ole32/rpc.c
index 05becb2..806c323 100644
--- a/dlls/ole32/rpc.c
+++ b/dlls/ole32/rpc.c
@@ -277,7 +277,7 @@ static HRESULT WINAPI ClientRpcChannelBu
RpcBindingInqObject(msg->Handle, &ipid);
hr = ipid_get_dispatch_params(&ipid, &apt, ¶ms->stub, ¶ms->chan);
- if ((hr == S_OK) && (apt->model & COINIT_APARTMENTTHREADED))
+ if ((hr == S_OK) && !apt->multi_threaded)
{
params->handle = CreateEventW(NULL, FALSE, FALSE, NULL);
@@ -536,7 +536,7 @@ static void __RPC_STUB dispatch_rpc(RPC_
/* Note: this is the important difference between STAs and MTAs - we
* always execute RPCs to STAs in the thread that originally created the
* apartment (i.e. the one that pumps messages to the window) */
- if (apt->model & COINIT_APARTMENTTHREADED)
+ if (!apt->multi_threaded)
{
params->handle = CreateEventW(NULL, FALSE, FALSE, NULL);
Module: wine
Branch: refs/heads/master
Commit: 7ab5e7c59a4d31348beacdceb3b8a9e57041ffe5
URL: http://source.winehq.org/git/?p=wine.git;a=commit;h=7ab5e7c59a4d31348beacdc…
Author: YunSong Hwang <hys545(a)dreamwiz.com>
Date: Mon Feb 20 11:14:48 2006 +0100
wordpad: Add Korean translation.
---
programs/wordpad/Ko.rc | 67 ++++++++++++++++++++++++++++++++++++++++++++++
programs/wordpad/rsrc.rc | 1 +
2 files changed, 68 insertions(+), 0 deletions(-)
create mode 100644 programs/wordpad/Ko.rc
diff --git a/programs/wordpad/Ko.rc b/programs/wordpad/Ko.rc
new file mode 100644
index 0000000..467b27f
--- /dev/null
+++ b/programs/wordpad/Ko.rc
@@ -0,0 +1,67 @@
+ /*
+ * Copyright 2004 by Krzysztof Foltman
+ * Copyright 2006 by YunSong Hwang
+ *
+ * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+
+LANGUAGE LANG_KOREAN, SUBLANG_DEFAULT
+MAINMENU MENU DISCARDABLE
+BEGIN
+ POPUP "����(&F)"
+ BEGIN
+ MENUITEM "�� ����(&N)", ID_FILE_NEW
+ MENUITEM "����(&O)", ID_FILE_OPEN
+ MENUITEM "����(&S)", ID_FILE_SAVE
+ MENUITEM SEPARATOR
+ MENUITEM "������(&E)", ID_FILE_EXIT
+ END
+ POPUP "����(&E)"
+ BEGIN
+ MENUITEM "�ǵ�����(&U)\tCtrl+Z", ID_EDIT_UNDO
+ MENUITEM "�ٽ� ����(&R)\tCtrl+Y", ID_EDIT_REDO
+ MENUITEM "��� ����(&S)\tCtrl+A", ID_EDIT_SELECTALL
+ MENUITEM SEPARATOR
+ MENUITEM "�߶�(&T)\tCtrl+X", ID_EDIT_CUT
+ MENUITEM "����(&C)\tCtrl+C", ID_EDIT_COPY
+ MENUITEM SEPARATOR
+ MENUITEM "�б� ����(&O)", ID_EDIT_READONLY
+ MENUITEM "���� ����(&M)", ID_EDIT_MODIFIED
+ MENUITEM SEPARATOR
+ POPUP "��Ÿ(&E)"
+ BEGIN
+ MENUITEM "���� ���� ����(&I)", ID_EDIT_SELECTIONINFO
+ MENUITEM "���� ����(&F)", ID_EDIT_CHARFORMAT
+ MENUITEM "���ǵ� ���ڿ� ����(&D)", ID_EDIT_DEFCHARFORMAT
+ MENUITEM "�ܶ� ����(&H)", ID_EDIT_PARAFORMAT
+ MENUITEM "�ؽ�Ʈ ���(&G)", ID_EDIT_GETTEXT
+ END
+ END
+ POPUP "����(&O)"
+ BEGIN
+ POPUP "���(&B)"
+ BEGIN
+ MENUITEM "�ý���(&S)\tCtrl+1", ID_BACK_1
+ MENUITEM "���������(&P)\tCtrl+2", ID_BACK_2
+ END
+ POPUP "����(&A)"
+ BEGIN
+ MENUITEM "����(&L)\tCtrl+L", ID_ALIGN_LEFT
+ MENUITEM "���(&C)\tCtrl+E", ID_ALIGN_CENTER
+ MENUITEM "������(&R)\tCtrl+R", ID_ALIGN_RIGHT
+ END
+ END
+END
diff --git a/programs/wordpad/rsrc.rc b/programs/wordpad/rsrc.rc
index c2e2347..21cbaba 100644
--- a/programs/wordpad/rsrc.rc
+++ b/programs/wordpad/rsrc.rc
@@ -79,5 +79,6 @@ IDB_TOOLBAR BITMAP "toolbar.bmp"
#include "De.rc"
#include "En.rc"
#include "Fr.rc"
+#include "Ko.rc"
#include "Nl.rc"
#include "Ru.rc"