Re: ole32: add a test for OleInitialize

2009-01-13 Thread Paul Vriens
Austin English wrote:
 On Tue, Jan 13, 2009 at 1:28 AM, Paul Vriens paul.vriens.w...@gmail.com 
 wrote:
 Austin English wrote:
 Pointed out by Anastasius in bug 13011. Tested on XP SP2  2K SP4 (and
 Wine, of course).



 


 Hi Austin,

 The test case that is pointed out in bug 13011 is different though:

 hr = CoInitializeEx(NULL, COINIT_APARTMENTTHREADED);
 ok(hr == S_OK, CoInitializeEx failed with error 0x%08x\n, hr);
 hr = OleInitialize(NULL);
 ok(hr == S_OK, OleInitialize failed with error 0x%08x\n, hr);

 The above succeeds on W2K3 but fails on Wine.

 --
 Cheers,

 Paul.

 
 I was referring to this comment:
 Calling OleInitialize() for the first time should yield S_OK - even with
 apartment already initialized by previous CoInitialize(Ex) calls.
 Calling OleInitialize() more than once yields S_FALSE for the second and
 following calls.
 
 Though that testcase should probably be added as well, in a todo_wine of 
 course.
 
 
 
So maybe we should do

hr = CoInitializeEx(NULL, COINIT_APARTMENTTHREADED);
ok(hr == S_OK, CoInitializeEx failed with error 0x%08x\n, hr);
hr = OleInitialize(NULL);
todo_wine
ok(hr == S_OK, OleInitialize failed with error 0x%08x\n, hr);
hr = OleInitialize(NULL);
ok(hr == S_FALSE, Expected S_FALSE, hr = 0x%08x\n, hr);

and move that to a separate test function? (Maybe in compobj.c?) I mean it's a 
ole32 basic thing that's wrong, not something that should be in a specific test 
I guess?

-- 
Cheers,

Paul.




Re: ole32: add a test for OleInitialize

2009-01-13 Thread Austin English
On Tue, Jan 13, 2009 at 2:20 AM, Paul Vriens paul.vriens.w...@gmail.com wrote:
 Austin English wrote:

 On Tue, Jan 13, 2009 at 1:28 AM, Paul Vriens paul.vriens.w...@gmail.com
 wrote:

 Austin English wrote:

 Pointed out by Anastasius in bug 13011. Tested on XP SP2  2K SP4 (and
 Wine, of course).



 


 Hi Austin,

 The test case that is pointed out in bug 13011 is different though:

 hr = CoInitializeEx(NULL, COINIT_APARTMENTTHREADED);
 ok(hr == S_OK, CoInitializeEx failed with error 0x%08x\n, hr);
 hr = OleInitialize(NULL);
 ok(hr == S_OK, OleInitialize failed with error 0x%08x\n, hr);

 The above succeeds on W2K3 but fails on Wine.

 --
 Cheers,

 Paul.


 I was referring to this comment:
 Calling OleInitialize() for the first time should yield S_OK - even with
 apartment already initialized by previous CoInitialize(Ex) calls.
 Calling OleInitialize() more than once yields S_FALSE for the second and
 following calls.

 Though that testcase should probably be added as well, in a todo_wine of
 course.



 So maybe we should do

 hr = CoInitializeEx(NULL, COINIT_APARTMENTTHREADED);
 ok(hr == S_OK, CoInitializeEx failed with error 0x%08x\n, hr);
 hr = OleInitialize(NULL);
 todo_wine
 ok(hr == S_OK, OleInitialize failed with error 0x%08x\n, hr);
 hr = OleInitialize(NULL);
 ok(hr == S_FALSE, Expected S_FALSE, hr = 0x%08x\n, hr);

 and move that to a separate test function? (Maybe in compobj.c?) I mean it's
 a ole32 basic thing that's wrong, not something that should be in a specific
 test I guess?

 --
 Cheers,

 Paul.


How's this?

-- 
-Austin
diff --git a/dlls/ole32/tests/compobj.c b/dlls/ole32/tests/compobj.c
index 02dc080..4793bd6 100644
--- a/dlls/ole32/tests/compobj.c
+++ b/dlls/ole32/tests/compobj.c
@@ -1017,6 +1017,23 @@ static void test_CoGetObjectContext(void)
 CoUninitialize();
 }
 
+static void test_CoInitializeEx(void)
+{
+HRESULT hr;
+
+hr = CoInitializeEx(NULL, COINIT_APARTMENTTHREADED);
+ok(hr == S_OK, CoInitializeEx failed with error 0x%08x\n, hr);
+
+/* Calling OleInitialize for the first time should yield S_OK even with
+ * apartment already initialized by previous CoInitialize(Ex) calls. */
+hr = OleInitialize(NULL);
+todo_wine ok(hr == S_OK, OleInitialize failed with error 0x%08x\n, hr);
+
+/* Subsequent calls to OleInitialize should return S_FALSE */
+hr = OleInitialize(NULL);
+ok(hr == S_FALSE, Expected S_FALSE, hr = 0x%08x\n, hr);
+}
+
 START_TEST(compobj)
 {
 HMODULE hOle32 = GetModuleHandle(ole32);
@@ -1045,4 +1062,5 @@ START_TEST(compobj)
 test_registered_object_thread_affinity();
 test_CoFreeUnusedLibraries();
 test_CoGetObjectContext();
+test_CoInitializeEx();
 }




Re: ole32: add a test for OleInitialize

2009-01-13 Thread Paul Vriens
Paul Vriens wrote:
 Austin English wrote:
 On Tue, Jan 13, 2009 at 2:20 AM, Paul Vriens 
 paul.vriens.w...@gmail.com wrote:
 Austin English wrote:
 On Tue, Jan 13, 2009 at 1:28 AM, Paul Vriens 
 paul.vriens.w...@gmail.com
 wrote:
 Austin English wrote:
 Pointed out by Anastasius in bug 13011. Tested on XP SP2  2K SP4 
 (and
 Wine, of course).



  



 Hi Austin,

 The test case that is pointed out in bug 13011 is different though:

 hr = CoInitializeEx(NULL, COINIT_APARTMENTTHREADED);
 ok(hr == S_OK, CoInitializeEx failed with error 0x%08x\n, hr);
 hr = OleInitialize(NULL);
 ok(hr == S_OK, OleInitialize failed with error 0x%08x\n, hr);

 The above succeeds on W2K3 but fails on Wine.

 -- 
 Cheers,

 Paul.

 I was referring to this comment:
 Calling OleInitialize() for the first time should yield S_OK - even 
 with
 apartment already initialized by previous CoInitialize(Ex) calls.
 Calling OleInitialize() more than once yields S_FALSE for the second 
 and
 following calls.

 Though that testcase should probably be added as well, in a 
 todo_wine of
 course.



 So maybe we should do

 hr = CoInitializeEx(NULL, COINIT_APARTMENTTHREADED);
 ok(hr == S_OK, CoInitializeEx failed with error 0x%08x\n, hr);
 hr = OleInitialize(NULL);
 todo_wine
 ok(hr == S_OK, OleInitialize failed with error 0x%08x\n, hr);
 hr = OleInitialize(NULL);
 ok(hr == S_FALSE, Expected S_FALSE, hr = 0x%08x\n, hr);

 and move that to a separate test function? (Maybe in compobj.c?) I 
 mean it's
 a ole32 basic thing that's wrong, not something that should be in a 
 specific
 test I guess?

 -- 
 Cheers,

 Paul.


 How's this?


 Looks great :). Two (minor) things though:
 
 - you should maybe use pCoInitializeEx? (there is some remark in that 
 file about it not being present on all platforms, current 
 test.winehq.org doesn't show this though)
 - do some uninitialize to clean things up?
 
I see that moniker.c also uses CoInitializeEx directly and no errors on 
test.winehq.org for that ('not run' would be shown if that was the case).

So maybe we should get rid of the GetProcAddress for CoInitializeEx in all 
files, but that would be another patch(set).

-- 
Cheers,

Paul.




Re: ole32: add a test for OleInitialize

2009-01-13 Thread Paul Vriens
Austin English wrote:
 On Tue, Jan 13, 2009 at 2:20 AM, Paul Vriens paul.vriens.w...@gmail.com 
 wrote:
 Austin English wrote:
 On Tue, Jan 13, 2009 at 1:28 AM, Paul Vriens paul.vriens.w...@gmail.com
 wrote:
 Austin English wrote:
 Pointed out by Anastasius in bug 13011. Tested on XP SP2  2K SP4 (and
 Wine, of course).



 


 Hi Austin,

 The test case that is pointed out in bug 13011 is different though:

 hr = CoInitializeEx(NULL, COINIT_APARTMENTTHREADED);
 ok(hr == S_OK, CoInitializeEx failed with error 0x%08x\n, hr);
 hr = OleInitialize(NULL);
 ok(hr == S_OK, OleInitialize failed with error 0x%08x\n, hr);

 The above succeeds on W2K3 but fails on Wine.

 --
 Cheers,

 Paul.

 I was referring to this comment:
 Calling OleInitialize() for the first time should yield S_OK - even with
 apartment already initialized by previous CoInitialize(Ex) calls.
 Calling OleInitialize() more than once yields S_FALSE for the second and
 following calls.

 Though that testcase should probably be added as well, in a todo_wine of
 course.



 So maybe we should do

 hr = CoInitializeEx(NULL, COINIT_APARTMENTTHREADED);
 ok(hr == S_OK, CoInitializeEx failed with error 0x%08x\n, hr);
 hr = OleInitialize(NULL);
 todo_wine
 ok(hr == S_OK, OleInitialize failed with error 0x%08x\n, hr);
 hr = OleInitialize(NULL);
 ok(hr == S_FALSE, Expected S_FALSE, hr = 0x%08x\n, hr);

 and move that to a separate test function? (Maybe in compobj.c?) I mean it's
 a ole32 basic thing that's wrong, not something that should be in a specific
 test I guess?

 --
 Cheers,

 Paul.

 
 How's this?
 
 
Looks great :). Two (minor) things though:

- you should maybe use pCoInitializeEx? (there is some remark in that file 
about 
it not being present on all platforms, current test.winehq.org doesn't show 
this 
though)
- do some uninitialize to clean things up?

-- 
Cheers,

Paul.




Re: ole32: add a test for OleInitialize

2009-01-13 Thread Austin English
On Tue, Jan 13, 2009 at 3:09 AM, Paul Vriens paul.vriens.w...@gmail.com wrote:
 Austin English wrote:

 On Tue, Jan 13, 2009 at 2:20 AM, Paul Vriens paul.vriens.w...@gmail.com
 wrote:

 Austin English wrote:

 On Tue, Jan 13, 2009 at 1:28 AM, Paul Vriens
 paul.vriens.w...@gmail.com
 wrote:

 Austin English wrote:

 Pointed out by Anastasius in bug 13011. Tested on XP SP2  2K SP4 (and
 Wine, of course).




 


 Hi Austin,

 The test case that is pointed out in bug 13011 is different though:

 hr = CoInitializeEx(NULL, COINIT_APARTMENTTHREADED);
 ok(hr == S_OK, CoInitializeEx failed with error 0x%08x\n, hr);
 hr = OleInitialize(NULL);
 ok(hr == S_OK, OleInitialize failed with error 0x%08x\n, hr);

 The above succeeds on W2K3 but fails on Wine.

 --
 Cheers,

 Paul.

 I was referring to this comment:
 Calling OleInitialize() for the first time should yield S_OK - even
 with
 apartment already initialized by previous CoInitialize(Ex) calls.
 Calling OleInitialize() more than once yields S_FALSE for the second and
 following calls.

 Though that testcase should probably be added as well, in a todo_wine of
 course.



 So maybe we should do

 hr = CoInitializeEx(NULL, COINIT_APARTMENTTHREADED);
 ok(hr == S_OK, CoInitializeEx failed with error 0x%08x\n, hr);
 hr = OleInitialize(NULL);
 todo_wine
 ok(hr == S_OK, OleInitialize failed with error 0x%08x\n, hr);
 hr = OleInitialize(NULL);
 ok(hr == S_FALSE, Expected S_FALSE, hr = 0x%08x\n, hr);

 and move that to a separate test function? (Maybe in compobj.c?) I mean
 it's
 a ole32 basic thing that's wrong, not something that should be in a
 specific
 test I guess?

 --
 Cheers,

 Paul.


 How's this?


 Looks great :). Two (minor) things though:

 - you should maybe use pCoInitializeEx? (there is some remark in that file
 about it not being present on all platforms, current test.winehq.org doesn't
 show this though)
 - do some uninitialize to clean things up?

 --
 Cheers,

 Paul.


I haven't tested on windows though. I can test it later today before
submitting to wine-patches [though I'm sure you'll beat me to it ;-)].
-- 
-Austin
diff --git a/dlls/ole32/tests/compobj.c b/dlls/ole32/tests/compobj.c
index 02dc080..450db78 100644
--- a/dlls/ole32/tests/compobj.c
+++ b/dlls/ole32/tests/compobj.c
@@ -1017,6 +1017,27 @@ static void test_CoGetObjectContext(void)
 CoUninitialize();
 }
 
+static void test_CoInitializeEx(void)
+{
+HRESULT hr;
+
+hr = pCoInitializeEx(NULL, COINIT_APARTMENTTHREADED);
+ok(hr == S_OK, CoInitializeEx failed with error 0x%08x\n, hr);
+
+/* Calling OleInitialize for the first time should yield S_OK even with
+ * apartment already initialized by previous CoInitialize(Ex) calls. */
+hr = OleInitialize(NULL);
+todo_wine ok(hr == S_OK, OleInitialize failed with error 0x%08x\n, hr);
+
+/* Subsequent calls to OleInitialize should return S_FALSE */
+hr = OleInitialize(NULL);
+ok(hr == S_FALSE, Expected S_FALSE, hr = 0x%08x\n, hr);
+
+/* Cleanup */
+CoUninitialize();
+OleUninitialize();
+}
+
 START_TEST(compobj)
 {
 HMODULE hOle32 = GetModuleHandle(ole32);
@@ -1045,4 +1066,5 @@ START_TEST(compobj)
 test_registered_object_thread_affinity();
 test_CoFreeUnusedLibraries();
 test_CoGetObjectContext();
+test_CoInitializeEx();
 }




Re: ole32: add a test for OleInitialize

2009-01-13 Thread Paul Vriens
Austin English wrote:
 On Tue, Jan 13, 2009 at 3:09 AM, Paul Vriens paul.vriens.w...@gmail.com 
 wrote:
 Austin English wrote:
 On Tue, Jan 13, 2009 at 2:20 AM, Paul Vriens paul.vriens.w...@gmail.com
 wrote:
 Austin English wrote:
 On Tue, Jan 13, 2009 at 1:28 AM, Paul Vriens
 paul.vriens.w...@gmail.com
 wrote:
 Austin English wrote:
 Pointed out by Anastasius in bug 13011. Tested on XP SP2  2K SP4 (and
 Wine, of course).




 


 Hi Austin,

 The test case that is pointed out in bug 13011 is different though:

 hr = CoInitializeEx(NULL, COINIT_APARTMENTTHREADED);
 ok(hr == S_OK, CoInitializeEx failed with error 0x%08x\n, hr);
 hr = OleInitialize(NULL);
 ok(hr == S_OK, OleInitialize failed with error 0x%08x\n, hr);

 The above succeeds on W2K3 but fails on Wine.

 --
 Cheers,

 Paul.

 I was referring to this comment:
 Calling OleInitialize() for the first time should yield S_OK - even
 with
 apartment already initialized by previous CoInitialize(Ex) calls.
 Calling OleInitialize() more than once yields S_FALSE for the second and
 following calls.

 Though that testcase should probably be added as well, in a todo_wine of
 course.



 So maybe we should do

 hr = CoInitializeEx(NULL, COINIT_APARTMENTTHREADED);
 ok(hr == S_OK, CoInitializeEx failed with error 0x%08x\n, hr);
 hr = OleInitialize(NULL);
 todo_wine
 ok(hr == S_OK, OleInitialize failed with error 0x%08x\n, hr);
 hr = OleInitialize(NULL);
 ok(hr == S_FALSE, Expected S_FALSE, hr = 0x%08x\n, hr);

 and move that to a separate test function? (Maybe in compobj.c?) I mean
 it's
 a ole32 basic thing that's wrong, not something that should be in a
 specific
 test I guess?

 --
 Cheers,

 Paul.

 How's this?


 Looks great :). Two (minor) things though:

 - you should maybe use pCoInitializeEx? (there is some remark in that file
 about it not being present on all platforms, current test.winehq.org doesn't
 show this though)
 - do some uninitialize to clean things up?

 --
 Cheers,

 Paul.

 
 I haven't tested on windows though. I can test it later today before
 submitting to wine-patches [though I'm sure you'll beat me to it ;-)].
 
Succeeds on Win95, W2K3 and Vista (haven't tested others).

-- 
Cheers,

Paul.




Re: ole32: add a test for OleInitialize

2009-01-13 Thread Nikolay Sivov
Austin English wrote:
 On Tue, Jan 13, 2009 at 3:09 AM, Paul Vriens paul.vriens.w...@gmail.com 
 wrote:
   
 Austin English wrote:
 
 On Tue, Jan 13, 2009 at 2:20 AM, Paul Vriens paul.vriens.w...@gmail.com
 wrote:
   
 Austin English wrote:
 
 On Tue, Jan 13, 2009 at 1:28 AM, Paul Vriens
 paul.vriens.w...@gmail.com
 wrote:
   
 Austin English wrote:
 
 Pointed out by Anastasius in bug 13011. Tested on XP SP2  2K SP4 (and
 Wine, of course).




 


   
 Hi Austin,

 The test case that is pointed out in bug 13011 is different though:

 hr = CoInitializeEx(NULL, COINIT_APARTMENTTHREADED);
 ok(hr == S_OK, CoInitializeEx failed with error 0x%08x\n, hr);
 hr = OleInitialize(NULL);
 ok(hr == S_OK, OleInitialize failed with error 0x%08x\n, hr);

 The above succeeds on W2K3 but fails on Wine.

 --
 Cheers,

 Paul.

 
 I was referring to this comment:
 Calling OleInitialize() for the first time should yield S_OK - even
 with
 apartment already initialized by previous CoInitialize(Ex) calls.
 Calling OleInitialize() more than once yields S_FALSE for the second and
 following calls.

 Though that testcase should probably be added as well, in a todo_wine of
 course.



   
 So maybe we should do

 hr = CoInitializeEx(NULL, COINIT_APARTMENTTHREADED);
 ok(hr == S_OK, CoInitializeEx failed with error 0x%08x\n, hr);
 hr = OleInitialize(NULL);
 todo_wine
 ok(hr == S_OK, OleInitialize failed with error 0x%08x\n, hr);
 hr = OleInitialize(NULL);
 ok(hr == S_FALSE, Expected S_FALSE, hr = 0x%08x\n, hr);

 and move that to a separate test function? (Maybe in compobj.c?) I mean
 it's
 a ole32 basic thing that's wrong, not something that should be in a
 specific
 test I guess?

 --
 Cheers,

 Paul.

 
 How's this?


   
 Looks great :). Two (minor) things though:

 - you should maybe use pCoInitializeEx? (there is some remark in that file
 about it not being present on all platforms, current test.winehq.org doesn't
 show this though)
 - do some uninitialize to clean things up?

 --
 Cheers,

 Paul.

 

 I haven't tested on windows though. I can test it later today before
 submitting to wine-patches [though I'm sure you'll beat me to it ;-)].
   
 


Succeeded on WinXP too.




RE: ole32: add a test for OleInitialize

2009-01-13 Thread Rolf Kalbermatter
Paul Vriens wrote:
 Austin English wrote:
 Paul Vriens wrote:
 - you should maybe use pCoInitializeEx? (there is some
 remark in that file about it not being present on all
 platforms, current test.winehq.org doesn't show this
 though)
 - do some uninitialize to clean things up?
 
 I haven't tested on windows though. I can test it later today before
 submitting to wine-patches [though I'm sure you'll beat me to it ;-)].
 
 Succeeds on Win95, W2K3 and Vista (haven't tested others).

The Ex variant might be something added in one of the Win95 releases.
Posts like this
http://www.experts-exchange.com/OS/Microsoft_Operating_Systems/Windows/Win95
_3x/95/Win95_Setup/Q_10055969.html
seem to indicate so. Of course an IE6 installer or such might have
updated the OLE subsystem too in your case. Most probably there are not
many systems around using an original Win95 installation anymore but
still technically CoInitializeEx() may not be available on all Win95
systems.

Rolf Kalbermatter





Re: ole32: add a test for OleInitialize

2009-01-12 Thread Paul Vriens
Austin English wrote:
 Pointed out by Anastasius in bug 13011. Tested on XP SP2  2K SP4 (and
 Wine, of course).
 
 
 
 
 
 
Hi Austin,

The test case that is pointed out in bug 13011 is different though:

hr = CoInitializeEx(NULL, COINIT_APARTMENTTHREADED);
ok(hr == S_OK, CoInitializeEx failed with error 0x%08x\n, hr);
hr = OleInitialize(NULL);
ok(hr == S_OK, OleInitialize failed with error 0x%08x\n, hr);

The above succeeds on W2K3 but fails on Wine.

-- 
Cheers,

Paul.




Re: ole32: add a test for OleInitialize

2009-01-12 Thread Austin English
On Tue, Jan 13, 2009 at 1:28 AM, Paul Vriens paul.vriens.w...@gmail.com wrote:
 Austin English wrote:

 Pointed out by Anastasius in bug 13011. Tested on XP SP2  2K SP4 (and
 Wine, of course).



 


 Hi Austin,

 The test case that is pointed out in bug 13011 is different though:

 hr = CoInitializeEx(NULL, COINIT_APARTMENTTHREADED);
 ok(hr == S_OK, CoInitializeEx failed with error 0x%08x\n, hr);
 hr = OleInitialize(NULL);
 ok(hr == S_OK, OleInitialize failed with error 0x%08x\n, hr);

 The above succeeds on W2K3 but fails on Wine.

 --
 Cheers,

 Paul.


I was referring to this comment:
Calling OleInitialize() for the first time should yield S_OK - even with
apartment already initialized by previous CoInitialize(Ex) calls.
Calling OleInitialize() more than once yields S_FALSE for the second and
following calls.

Though that testcase should probably be added as well, in a todo_wine of course.



-- 
-Austin