ole32: add a test for OleInitialize

Austin English austinenglish at gmail.com
Tue Jan 13 03:44:44 CST 2009


On Tue, Jan 13, 2009 at 3:09 AM, Paul Vriens <paul.vriens.wine at gmail.com> wrote:
> Austin English wrote:
>>
>> On Tue, Jan 13, 2009 at 2:20 AM, Paul Vriens <paul.vriens.wine at gmail.com>
>> wrote:
>>>
>>> Austin English wrote:
>>>>
>>>> On Tue, Jan 13, 2009 at 1:28 AM, Paul Vriens
>>>> <paul.vriens.wine at 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
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: ole32_compobj-2.txt
Url: http://www.winehq.org/pipermail/wine-devel/attachments/20090113/d6093f65/attachment.txt 


More information about the wine-devel mailing list