Rob Shearman <robertshearman <at> gmail.com> writes:
2008/9/15 Louis Lenders <xerox_xerox2000 <at> yahoo.co.uk>:
Rob Shearman <robertshearman <at> gmail.com> writes:
I suggest you write a test case that replicates what the application does and either send it to wine-patches with appropriate todo_wine's or attach it to the bug.
Well, it looks like the app is only checking if the uuid of the
interface is defined using Context_QueryInterface, and that's about it. It doesn't really seem to try to use anything from it, as Erich's initial hack is already enough to get the apps running as well (this one:http://bugs.winehq.org/attachment.cgi?id=13379)
That's fine. You can still add a test that does the same
as what the app does.
Hi, as there isn't really much activity in the bug (understatement haha) i tried to hack up a test myself. Rob, is the test below more or less what you meant? or am i way off... (The test passes on winxp, and fails in wine, so afaics shows we should support the interface )
diff --git a/dlls/ole32/tests/compobj.c b/dlls/ole32/tests/compobj.c index bdc34d9...49c3276 100644 --- a/dlls/ole32/tests/compobj.c +++ b/dlls/ole32/tests/compobj.c @@ -28,6 +28,7 @@ #include "objbase.h" #include "shlguid..h" #include "urlmon.h" /* for CLSID_FileProtocol */ +//#include "ctxtcall.h"
#include "wine/test.h"
@@ -61,6 +62,15 @@ static const IID IID_IWineTest = 0x4fd0, {0xa1, 0xa2, 0x5d, 0x5a, 0x36, 0x54, 0xd3, 0xbd} }; /* 5201163f-8164-4fd0-a1a2-5d5a3654d3bd */ + +static const IID IID_IContextCallback = +{ + 0x000001da , + 0x0000, + 0x0000, + {0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46 } +}; + static const CLSID CLSID_WineOOPTest = { 0x5201163f, 0x8164, @@ -1022,6 +1032,26 @@ static void test_CoGetObjectContext(void) CoUninitialize(); }
+static void test_ContextCallBack(void) +{ + + HRESULT hr; + IComThreadingInfo *pComThreadingInfo; + + if (!pCoGetObjectContext) + { + skip("CoGetObjectContext not present\n"); + return; + } + + pCoInitializeEx(NULL, COINIT_APARTMENTTHREADED); + + hr = pCoGetObjectContext(&IID_IContextCallback, (void **)&pComThreadingInfo); + + ok_ole_success(hr, "CoGetObjectContext"); + CoUninitialize(); +} + START_TEST(compobj) { HMODULE hOle32 = GetModuleHandle("ole32"); @@ -1050,4 +1080,5 @@ START_TEST(compobj) test_registered_object_thread_affinity(); test_CoFreeUnusedLibraries(); test_CoGetObjectContext(); + test_ContextCallBack(); }
2008/9/28 Louis. Lenders xerox_xerox2000@yahoo.co.uk:
Rob Shearman <robertshearman <at> gmail.com> writes:
2008/9/15 Louis Lenders <xerox_xerox2000 <at> yahoo.co.uk>:
Rob Shearman <robertshearman <at> gmail.com> writes:
I suggest you write a test case that replicates what the application does and either send it to wine-patches with appropriate todo_wine's or attach it to the bug.
Well, it looks like the app is only checking if the uuid of the
interface is defined using Context_QueryInterface, and that's about it. It doesn't really seem to try to use anything from it, as Erich's initial hack is already enough to get the apps running as well (this one:http://bugs.winehq.org/attachment.cgi?id=13379)
That's fine. You can still add a test that does the same
as what the app does.
Hi, as there isn't really much activity in the bug (understatement haha) i tried to hack up a test myself. Rob, is the test below more or less what you meant? or am i way off...
Yes, almost exactly what I meant. Please see some minor comments below.
(The test passes on winxp, and fails in wine, so afaics shows we should support the interface )
diff --git a/dlls/ole32/tests/compobj.c b/dlls/ole32/tests/compobj.c index bdc34d9..49c3276 100644 --- a/dlls/ole32/tests/compobj.c +++ b/dlls/ole32/tests/compobj.c @@ -28,6 +28,7 @@ #include "objbase.h" #include "shlguid.h" #include "urlmon.h" /* for CLSID_FileProtocol */ +//#include "ctxtcall.h"
Please resend the patch adding the IDL file for this generated file and get it in before sending this patch adding the tests.
#include "wine/test.h"
@@ -61,6 +62,15 @@ static const IID IID_IWineTest = 0x4fd0, {0xa1, 0xa2, 0x5d, 0x5a, 0x36, 0x54, 0xd3, 0xbd} }; /* 5201163f-8164-4fd0-a1a2-5d5a3654d3bd */
+static const IID IID_IContextCallback = +{
- 0x000001da ,
- 0x0000,
- 0x0000,
- {0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46 }
+};
static const CLSID CLSID_WineOOPTest = { 0x5201163f, 0x8164, @@ -1022,6 +1032,26 @@ static void test_CoGetObjectContext(void) CoUninitialize(); }
+static void test_ContextCallBack(void) +{
- HRESULT hr;
- IComThreadingInfo *pComThreadingInfo;
- if (!pCoGetObjectContext)
- {
skip("CoGetObjectContext not present\n");
return;
- }
- pCoInitializeEx(NULL, COINIT_APARTMENTTHREADED);
- hr = pCoGetObjectContext(&IID_IContextCallback, (void
**)&pComThreadingInfo);
On success you need to call IContextCallback_Release on the returned object to avoid a memory leak.
- ok_ole_success(hr, "CoGetObjectContext");
- CoUninitialize();
+}
START_TEST(compobj) { HMODULE hOle32 = GetModuleHandle("ole32");
+//#include "ctxtcall.h"
Please resend the patch adding the IDL file for this generated file and get it in before sending this patch adding the tests.
Hi Rob, thanks very much for the comments. I'll do the above , but i have problems when I uncomment the above include, i get:
compobj.c:(.text+0x394b): undefined reference to `IID_IContextCallback' /usr/bin/ld: compobj.o: relocation R_386_GOTOFF against undefined hidden symbol `IID_IContextCallback' can not be used when making a shared object /usr/bin/ld: final link failed: Bad value collect2: ld returned 1 exit status winegcc: gcc failed make[2]: *** [ole32_test.exe.so] Error 2
Adding the two lines below
#define INITGUID #include "guiddef.h"
fixes the compiler error, but i have the feeling something is wrong with my setup or so, or is this a "normal" error?
2008/9/28 Louis Lenders xerox_xerox2000@yahoo.co.uk:
+//#include "ctxtcall.h"
Please resend the patch adding the IDL file for this generated file and get it in before sending this patch adding the tests.
Hi Rob, thanks very much for the comments. I'll do the above , but i have problems when I uncomment the above include, i get:
compobj.c:(.text+0x394b): undefined reference to `IID_IContextCallback' /usr/bin/ld: compobj.o: relocation R_386_GOTOFF against undefined hidden symbol `IID_IContextCallback' can not be used when making a shared object /usr/bin/ld: final link failed: Bad value collect2: ld returned 1 exit status winegcc: gcc failed make[2]: *** [ole32_test.exe.so] Error 2
Adding the two lines below
#define INITGUID #include "guiddef.h"
fixes the compiler error, but i have the feeling something is wrong with my setup or so, or is this a "normal" error?
No, this is normal. However, the proper fix is probably to include ctxtcall.h in dlls/uuid/uuid.c instead.
2008/9/28 Louis Lenders xerox_xerox2000@yahoo.co.uk:
+//#include "ctxtcall.h"
Please resend the patch adding the IDL file for this generated file and get it in before sending this patch adding the tests.
Hi Rob, thanks very much for the comments. I'll do the above , but i have problems when I uncomment the above include, i get:
compobj.c:(.text+0x394b): undefined reference to `IID_IContextCallback' /usr/bin/ld: compobj.o: relocation R_386_GOTOFF against undefined hidden symbol `IID_IContextCallback' can not be used when making a shared object /usr/bin/ld: final link failed: Bad value collect2: ld returned 1 exit status winegcc: gcc failed make[2]: *** [ole32_test.exe.so] Error 2
Adding the two lines below
#define INITGUID #include "guiddef.h"
fixes the compiler error, but i have the feeling something is wrong with my setup or so, or is this a "normal" error?
You'll need to add the .lib file that contains the IContextCallback GUID.
MSDN suggests that this is in ole32.lib (http://msdn.microsoft.com/en-us/library/ms682253(VS.85).aspx), so referencing that should fix it.
If it does not, you'll need to pull in those two lines above.
NOTE: this should be confirmed by building the test with the Windows SDK.
- Reece