Change 18314 by [EMAIL PROTECTED] on 2002/12/17 01:58:32

        Subject: [PATCH 5.8.1 @oldish-18156] Morphing to PM on OS/2
        From: Ilya Zakharevich <[EMAIL PROTECTED]>
        Date: Fri, 13 Dec 2002 14:00:48 -0800
        Message-ID: <[EMAIL PROTECTED]>

Affected files ...

... //depot/perl/os2/OS2/Process/t/os2_process.t#2 edit
... //depot/perl/os2/os2.c#63 edit

Differences ...

==== //depot/perl/os2/OS2/Process/t/os2_process.t#2 (text) ====
Index: perl/os2/OS2/Process/t/os2_process.t
--- perl/os2/OS2/Process/t/os2_process.t#1~14705~       Fri Feb 15 00:42:55 2002
+++ perl/os2/OS2/Process/t/os2_process.t        Mon Dec 16 17:58:32 2002
@@ -24,7 +24,7 @@
 }
 
 use strict;
-use Test::More tests => 227;
+use Test::More tests => 230;
 use OS2::Process;
 
 sub SWP_flags ($) {
@@ -237,21 +237,25 @@
 # This does not work, the result is the handle of "Window List"
 # is((hWindowPos $k_hwnd)->{behind}, 4, 'kis is at back');
 
-my (@list, $next);
+my (@list, $next, @list1);
 { my $force_PM = OS2::localMorphPM->new(0);
   ok $force_PM, 'morphed to PM locally again';
   $enum_handle = BeginEnumWindows 1;           # HWND_DESKTOP
   ok $enum_handle, 'start enumeration';
   push @list, $next while $next = GetNextWindow $enum_handle;
+  @list1 = ChildWindows;
+  ok 1, 'embedded ChildWindows()';
   ok EndEnumWindows($enum_handle), 'end enumeration';
 
+  is_deeply \@list, \@list1, 'Manual list same as by ChildWindows()';
   # Apparently, the 'Desktop' window is still behind us;
   # Note that this window is *not* what is returned by DesktopWindow
   pop @list if WindowText($list[-1]) eq 'Desktop';
 }
 is ($list[-1], $k_hwnd, 'kid is the last in z-order enumeration');
 # print "# kid=$k_hwnd in @list\n";
-@list = ChildWindows;                          # HWND_DESKTOP
+@list = ChildWindows;
+is_deeply \@list, \@list1, 'Other ChildWindows(), same result';
 ok scalar @list, 'ChildWindows works';
 is $list[-2], $k_hwnd, 'kid is the last but one in ChildWindows';
 

==== //depot/perl/os2/os2.c#63 (text) ====
Index: perl/os2/os2.c
--- perl/os2/os2.c#62~18030~    Sat Oct 19 07:10:21 2002
+++ perl/os2/os2.c      Mon Dec 16 17:58:32 2002
@@ -1429,11 +1429,10 @@
 HMQ
 Perl_Register_MQ(int serve)
 {
+  if (Perl_hmq_refcnt <= 0) {
     PPIB pib;
     PTIB tib;
 
-    if (Perl_hmq_refcnt > 0)
-       return Perl_hmq;
     Perl_hmq_refcnt = 0;               /* Be extra safe */
     DosGetInfoBlocks(&tib, &pib);
     Perl_os2_initial_mode = pib->pib_ultype;
@@ -1451,6 +1450,7 @@
            _exit(188);                 /* Panic can try to create a window. */
        Perl_croak_nocontext("Cannot create a message queue, or morph to a PM 
application");
     }
+  }
     if (serve) {
        if ( Perl_hmq_servers <= 0      /* Safe to inform us on shutdown, */
             && Perl_hmq_refcnt > 0 )   /* this was switched off before... */
End of Patch.

Reply via email to