Module: wine
Branch: master
Commit: dd8a736c3fc8ebcbbce1d4c548ac0e57d5c3feff
URL: http://source.winehq.org/git/wine.git/?a=commit;h=dd8a736c3fc8ebcbbce1d4c54…
Author: Rob Shearman <rob(a)codeweavers.com>
Date: Mon May 21 16:45:17 2007 +0100
ole32: The identity functions can be used from apartments other than the one the proxy was unmarshaled into.
In this case, don't use the cached This->remunk and don't cache the
unmarshaled object in This->remunk.
---
dlls/ole32/marshal.c | 19 +++++++++++++++----
dlls/ole32/tests/marshal.c | 38 +++++++++++++++++++++++++++++++++++++-
2 files changed, 52 insertions(+), 5 deletions(-)
diff --git a/dlls/ole32/marshal.c b/dlls/ole32/marshal.c
index 9c7d53c..d918347 100644
--- a/dlls/ole32/marshal.c
+++ b/dlls/ole32/marshal.c
@@ -298,7 +298,7 @@ static HRESULT WINAPI ClientIdentity_QueryMultipleInterfaces(IMultiQI *iface, UL
ULONG index = mapping[i];
HRESULT hrobj = qiresults[i].hResult;
if (hrobj == S_OK)
- hrobj = unmarshal_object(&qiresults[i].std, This->parent,
+ hrobj = unmarshal_object(&qiresults[i].std, COM_CurrentApt(),
This->dest_context,
This->dest_context_data,
pMQIs[index].pIID, &This->oxid_info,
@@ -964,14 +964,25 @@ static void proxy_manager_disconnect(struct proxy_manager * This)
static HRESULT proxy_manager_get_remunknown(struct proxy_manager * This, IRemUnknown **remunk)
{
HRESULT hr = S_OK;
+ struct apartment *apt;
+ BOOL called_in_original_apt;
/* we don't want to try and unmarshal or use IRemUnknown if we don't want
* lifetime management */
if (This->sorflags & SORFP_NOLIFETIMEMGMT)
return S_FALSE;
+ apt = COM_CurrentApt();
+ if (!apt)
+ return CO_E_NOTINITIALIZED;
+
+ called_in_original_apt = This->parent && (This->parent->oxid == apt->oxid);
+
EnterCriticalSection(&This->cs);
- if (This->remunk)
+ /* only return the cached object if called from the original apartment.
+ * in future, we might want to make the IRemUnknown proxy callable from any
+ * apartment to avoid these checks */
+ if (This->remunk && called_in_original_apt)
{
/* already created - return existing object */
*remunk = This->remunk;
@@ -994,10 +1005,10 @@ static HRESULT proxy_manager_get_remunknown(struct proxy_manager * This, IRemUnk
stdobjref.ipid = This->oxid_info.ipidRemUnknown;
/* do the unmarshal */
- hr = unmarshal_object(&stdobjref, This->parent, This->dest_context,
+ hr = unmarshal_object(&stdobjref, COM_CurrentApt(), This->dest_context,
This->dest_context_data, &IID_IRemUnknown,
&This->oxid_info, (void**)remunk);
- if (hr == S_OK)
+ if (hr == S_OK && called_in_original_apt)
{
This->remunk = *remunk;
IRemUnknown_AddRef(This->remunk);
diff --git a/dlls/ole32/tests/marshal.c b/dlls/ole32/tests/marshal.c
index 843b220..e64b9f5 100644
--- a/dlls/ole32/tests/marshal.c
+++ b/dlls/ole32/tests/marshal.c
@@ -1283,6 +1283,24 @@ static DWORD CALLBACK bad_thread_proc(LPVOID p)
HRESULT hr;
IUnknown * proxy = NULL;
+ hr = IClassFactory_CreateInstance(cf, NULL, &IID_IUnknown, (LPVOID*)&proxy);
+ todo_wine
+ ok(hr == CO_E_NOTINITIALIZED,
+ "COM should have failed with CO_E_NOTINITIALIZED on using proxy without apartment, but instead returned 0x%08x\n",
+ hr);
+
+ hr = IClassFactory_QueryInterface(cf, &IID_IMultiQI, (LPVOID *)&proxy);
+ /* Win9x returns S_OK, whilst NT returns RPC_E_WRONG_THREAD */
+ trace("call to proxy's QueryInterface for local interface without apartment returned 0x%08x\n", hr);
+ if (SUCCEEDED(hr))
+ IUnknown_Release(proxy);
+
+ hr = IClassFactory_QueryInterface(cf, &IID_IStream, (LPVOID *)&proxy);
+ /* Win9x returns E_NOINTERFACE, whilst NT returns RPC_E_WRONG_THREAD */
+ trace("call to proxy's QueryInterface without apartment returned 0x%08x\n", hr);
+ if (SUCCEEDED(hr))
+ IUnknown_Release(proxy);
+
pCoInitializeEx(NULL, COINIT_MULTITHREADED);
hr = IClassFactory_CreateInstance(cf, NULL, &IID_IUnknown, (LPVOID*)&proxy);
@@ -1291,6 +1309,19 @@ static DWORD CALLBACK bad_thread_proc(LPVOID p)
"COM should have failed with RPC_E_WRONG_THREAD on using proxy from wrong apartment, but instead returned 0x%08x\n",
hr);
+ hr = IClassFactory_QueryInterface(cf, &IID_IStream, (LPVOID *)&proxy);
+ /* Win9x returns E_NOINTERFACE, whilst NT returns RPC_E_WRONG_THREAD */
+ trace("call to proxy's QueryInterface from wrong apartment returned 0x%08x\n", hr);
+
+ /* this statement causes Win9x DCOM to crash during CoUninitialize of
+ * other apartment, so don't test this on Win9x (signified by NT-only
+ * export of CoRegisterSurrogateEx) */
+ if (GetProcAddress(GetModuleHandle("ole32"), "CoRegisterSurrogateEx"))
+ /* now be really bad and release the proxy from the wrong apartment */
+ IUnknown_Release(cf);
+ else
+ skip("skipping test for releasing proxy from wrong apartment that will succeed, but cause a crash during CoUninitialize\n");
+
CoUninitialize();
return 0;
@@ -1321,13 +1352,18 @@ static void test_proxy_used_in_wrong_thread(void)
ok_more_than_one_lock();
+ /* do a call that will fail, but result in IRemUnknown being used by the proxy */
+ IClassFactory_QueryInterface(pProxy, &IID_IStream, (LPVOID *)&pStream);
+
/* create a thread that we can misbehave in */
thread = CreateThread(NULL, 0, bad_thread_proc, (LPVOID)pProxy, 0, &tid2);
WaitForSingleObject(thread, INFINITE);
CloseHandle(thread);
- IUnknown_Release(pProxy);
+ /* do release statement on Win9x that we should have done above */
+ if (!GetProcAddress(GetModuleHandle("ole32"), "CoRegisterSurrogateEx"))
+ IUnknown_Release(pProxy);
ok_no_locks();
Module: wine
Branch: master
Commit: 4266bf0869f596b180fedbffa8b13baad494da62
URL: http://source.winehq.org/git/wine.git/?a=commit;h=4266bf0869f596b180fedbffa…
Author: Mikołaj Zalewski <mikolaj(a)zalewski.pl>
Date: Mon May 21 22:54:04 2007 +0200
xcopy: Add Polish translation.
---
programs/xcopy/Pl.rc | 79 ++++++++++++++++++++++++++++++++++++++++++++++++
programs/xcopy/rsrc.rc | 1 +
2 files changed, 80 insertions(+), 0 deletions(-)
diff --git a/programs/xcopy/Pl.rc b/programs/xcopy/Pl.rc
new file mode 100644
index 0000000..10176aa
--- /dev/null
+++ b/programs/xcopy/Pl.rc
@@ -0,0 +1,79 @@
+/*
+ * XCOPY - Wine-compatible xcopy program
+ * Polish language support
+ *
+ * Copyright (C) 2007 J. Edmeades
+ * Copyright (C) 2007 Mikolaj Zalewski
+ *
+ * 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
+ */
+
+
+LANGUAGE LANG_POLISH, SUBLANG_DEFAULT
+
+STRINGTABLE
+{
+ STRING_INVPARMS, "Niew�a�ciwa liczba parametr�w - uruchom xcopy /? aby wy�wietli� pomoc\n"
+ STRING_INVPARM, "Nieznany parameter '%s' - uruchom xcopy /? aby wy�wietli� pomoc\n"
+ STRING_PAUSE, "Naci�nij <enter> aby rozpocz�� kopiowanie\n"
+ STRING_SIMCOPY, "%d plik(�w) zosta�oby skopiowanych\n"
+ STRING_COPY, "%d plik(�w) skopiowanych\n"
+ STRING_QISDIR, "Czy '%s' jest nazw� pliku czy katalogu\n" \
+ "docelowego?\n" \
+ "(P - plik, K - katalog)\n"
+ STRING_SRCPROMPT,"%s? (Tak|Nie)\n"
+ STRING_OVERWRITE,"Zast�pi� %s? (Tak|Nie|Wszystkie)\n"
+ STRING_COPYFAIL, "Kopiowanie '%s' do '%s' nie powiod�o si� - kod b��du %d\n"
+ STRING_OPENFAIL, "Nie uda�o si� otworzy� '%s'\n"
+ STRING_READFAIL, "B��d podczas czytania '%s'\n"
+ STRING_YES_CHAR, "T"
+ STRING_NO_CHAR, "N"
+ STRING_ALL_CHAR, "W"
+ STRING_FILE_CHAR,"P"
+ STRING_DIR_CHAR, "K"
+
+ STRING_HELP,
+"XCOPY - kopiuje pliki lub drzewa katalog�w\n\
+\n\
+Sk�adnia:\n\
+XCOPY �r�d�o [cel] [/I] [/S] [/Q] [/F] [/L] [/W] [/T] [/N] [/U] \n\
+\t [/R] [/H] [/C] [/P] [/A] [/M] [/E] [/D] [/Y] [/-Y]\n\
+\n\
+Gdzie:\n\
+\n\
+[/I] Je�eli \"cel\" nie istnieje i kopiowane s� co najmniej dwa pliki,\n\
+\tzak�ada, �e \"cel\" powien by� katalogiem\n\
+[/S] Kopiuje katalogi i podkatalogi\n\
+[/E] Kopiuje katalogi i podkatalogi, ��cznie z pustymi\n\
+[/Q] Nie wypisuje nazw plik�w podczas kopiowania (tryb cichy)\n\
+[/F] Wypisuje pe�ne �cie�ki �r�d�owe i docelowe podczas kopiowania\n\
+[/L] Jedynie symuluje operacj�, pokazuj�c pliki, kt�re by�yby kopiowane\n\
+[/W] Prosi o potwierdzenie przed rozpocz�ciem kopiowania\n\
+[/T] Tworzy puste katalogi, ale nie kopiuje plik�w\n\
+[/Y] Zast�puje pliki bez pro�by o potwierdzenie\n\
+[/-Y] Zawsze prosi o potwierdzenie przed zast�pieniem pliku\n\
+[/P] Prosi o potwierdzenie przed skopiowaniem ka�dego pliku\n\
+[/N] Kopiuje u�ywaj�c kr�tkich nazw plik�w\n\
+[/U] Kopiuje tylko pliki, kt�re ju� istniej� w miejscu docelowym\n\
+[/R] Zast�puje pliki tylko do odczytu\n\
+[/H] Kopiuje r�wnie� pliki ukryte i systemowe\n\
+[/C] Kontynuuje nawet je�eli podczas kopiowania wyst�pi�y b��dy\n\
+[/A] Kopiuje tylko pliki z atrybutem archiwalny\n\
+[/M] Kopiuje tylko pliki z atrybutem archiwalny i usuwa ten atrybut\n\
+[/D | /D:m-d-y] Kopiuje tylko nowe pliki lub te zmodifikowane po podanej dacie.\n\
+\t\tJe�eli nie podano �adnej daty, to kopiowane s� pliki, kt�re s�\n\
+\t\tnowsze ni� w katalogu docelowym\n\n"
+
+}
diff --git a/programs/xcopy/rsrc.rc b/programs/xcopy/rsrc.rc
index 2742d8f..1f7882c 100644
--- a/programs/xcopy/rsrc.rc
+++ b/programs/xcopy/rsrc.rc
@@ -22,4 +22,5 @@
LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
#include "En.rc"
+#include "Pl.rc"
#include "Ru.rc"