MSHMTL: Added QueryStatus implementation

Jacek Caban jack at itma.pwr.wroc.pl
Sun Aug 14 08:30:19 CDT 2005


Hello.

Saulius Krasuckas wrote:

>* On Tue, 2 Aug 2005, Jacek Caban wrote:
>  
>
>>--- dlls/mshtml/tests/htmldoc.c 26 Jul 2005 10:31:23 -0000      1.5
>>+++ dlls/mshtml/tests/htmldoc.c 1 Aug 2005 22:33:37 -0000
>>@@ -806,12 +806,76 @@ static void test_Persist()
>>     }
>> }
>> 
>>+static OLECMDF expect_cmds[OLECMDID_GETPRINTTEMPLATE+1] = {
>>+    0,
>>+    OLECMDF_SUPPORTED,                  /* OLECMDID_OPEN */
>>+    OLECMDF_SUPPORTED,                  /* OLECMDID_NEW */
>>+    OLECMDF_SUPPORTED,                  /* OLECMDID_SAVE */
>>    
>>
>  ...
>  
>
>>+        OLECMD cmd[2] = {
>>+            {OLECMDID_OPEN, 0xf0f0},
>>+            {OLECMDID_GETPRINTTEMPLATE+1, 0xf0f0}
>>+        };
>>+    
>>+        hres = IOleCommandTarget_QueryStatus(cmdtrg, NULL, 0, NULL, NULL);
>>+        ok(hres == S_OK, "QueryStatus failed: %08lx\n", hres);
>>+    
>>+        hres = IOleCommandTarget_QueryStatus(cmdtrg, NULL, 2, cmd, NULL);
>>+        ok(hres == OLECMDERR_E_NOTSUPPORTED,
>>+                "QueryStatus failed: %08lx, expected OLECMDERR_E_NOTSUPPORTED\n", hres);
>>    
>>
>
>Jacek, OLECMDID_OPEN (equally as OLECMDID_NEW) isn't supported here on 
>winME, AFAICT.  Moreover, calls to IOleCommandTarget_QueryStatus throws an 
>exception of Accesss Violation here.  I tested this with OLECMDID_SAVE and 
>it works OK.
>
>And we have a typo next, right?
>  
>
Right, good catch.

>  
>
>>+        ok(cmd[1].cmdf == 0, "cmd[0].cmdf=%lx, expected 0\n", cmd[0].cmdf);
>>+        ok(cmd[0].cmdf == OLECMDF_SUPPORTED,
>>+                "cmd[1].cmdf=%lx, expected OLECMDF_SUPPORTED\n", cmd[1].cmdf);
>>    
>>
>
>Hence, there goes my try:
>
>Log message:
>        Saulius Krasuckas <saulius.krasuckas at ieee.org>
>	Fix typo in a two checks.  WinME fixes:
>        - OLECMDID_OPEN and OLECMDID_NEW aren't supported.
>	- Ignore unsupported OLECMDs as they throws exceptions.
>
>
>  
>
I'm not sure if it is a correct fix. Although it avoids crashes,
much less functionality of QueryStatus is tested. Before
your patch  all possible commands were tested. But that's
not why the patch may be not correct: it seems to be a case
similar to crashes on xp while HTMLDocument is not active
in place. In this case it is not active in place because UIActivate
fails. Looking at the test results, UIActivate is a problem on
every win 9x and causes most tests to fail. So first UIActivate
should be fixed and then, if this problem remains, we'll be sure
that your fix is correct. Presently if you want to make this test
not to crash, you may disable IOleCommand tests if UIActivate
fails. I'll take a look at these tests, but first I'll have to get win 98
installed. My guess is that it requires to be loaded before a call
to UIActivate, so the attached patch might help (even if so, a few
other tests will fail, but currently the most interesting is
UIActivate), but I haven't tested it yet. Anyway a similar test will
go to the CVS soon.

Thanks,
    Jacek
-------------- next part --------------
Index: dlls/mshtml/tests/htmldoc.c
===================================================================
RCS file: /home/wine/wine/dlls/mshtml/tests/htmldoc.c,v
retrieving revision 1.7
diff -u -p -r1.7 htmldoc.c
--- dlls/mshtml/tests/htmldoc.c	3 Aug 2005 21:26:40 -0000	1.7
+++ dlls/mshtml/tests/htmldoc.c	14 Aug 2005 13:25:08 -0000
@@ -43,6 +43,9 @@
     ok(called_ ## func, "expected " #func "\n"); \
     expect_ ## func = called_ ## func = FALSE
 
+static const WCHAR WINEHQ_URL[] = {'h','t','t','p',':','/','/','w','w','w','.','w','i','n','e','h','q','.',
+    'o','r','g','/',0};
+
 static IUnknown *htmldoc_unk = NULL;
 static IOleDocumentView *view = NULL;
 static HWND container_hwnd = NULL, hwnd = NULL, last_hwnd = NULL;
@@ -776,6 +779,7 @@ static void test_Persist()
 {
     IPersistMoniker *persist_mon;
     IPersistFile *persist_file;
+    IMoniker *mon;
     GUID guid;
     HRESULT hres;
 
@@ -801,6 +805,16 @@ static void test_Persist()
         hres = IPersistMoniker_GetClassID(persist_mon, &guid);
         ok(hres == S_OK, "GetClassID failed: %08lx\n", hres);
         ok(IsEqualGUID(&CLSID_HTMLDocument, &guid), "guid != CLSID_HTMLDocument\n");
+
+        hres = CreateURLMoniker(NULL, WINEHQ_URL, &mon);
+        ok(hres == S_OK, "CreateURLMoniker failed: %08lx\n", hres);
+
+        if(SUCCEEDED(hres)) {
+            hres = IPersistMoniker_Load(persist_mon, FALSE, mon, NULL, 0x12);
+            ok(hres == S_OK, "Load failed: %08lx\n", hres);
+
+            IMoniker_Release(mon);
+        }
 
         IPersistMoniker_Release(persist_mon);
     }


More information about the wine-devel mailing list