On Wed, 29 Mar 2000 [EMAIL PROTECTED] wrote:

> On Wed, 29 Mar 2000, Rein Klazes wrote:
> 
> > On Wed, 29 Mar 2000 05:03:34 EST, you wrote:
> >
> > .
> > >
> > > Now, anyone know why comm_notificaction only gets called once, and
> > > lpStat never budges from 0 0 0??  What was calling it before?  :-)
> >
> > I reported the same problem yesterday. Last nights cvs commits have
> > fixed it for me.
> >
> Would some kind soul tell me how I can get at CVS by email, or mail me
> the appropriate patch, or post it to wine-devel?

It should be possible to get at with with CVSWeb at http://www.winehq.com/
(well, when WineHQ is back up again), but in the meantime...

Here's the patch that I think fixed the comm_notification:

From: Alexandre Julliard <[EMAIL PROTECTED]>
Log message:
        Put CLONE_FILES back in, it is still breaking too many things.

Index: scheduler/sysdeps.c
===================================================================
RCS file: /home/wine/wine/scheduler/sysdeps.c,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -r1.22 -r1.23
--- scheduler/sysdeps.c 2000/03/25 19:14:37     1.22
+++ scheduler/sysdeps.c 2000/03/28 18:47:24     1.23
@@ -49,13 +49,8 @@
 #  define CLONE_SIGHAND 0x00000800
 #  define CLONE_PID     0x00001000
 # endif  /* CLONE_VM */
-# define PER_THREAD_FILE_HANDLES
 #endif  /* linux */
 
-#ifdef HAVE_RFORK
-# define PER_THREAD_FILE_HANDLES
-#endif
-
 static int init_done;
 
 #ifndef NO_REENTRANT_LIBC
@@ -130,12 +125,7 @@
  */
 static void SYSDEPS_StartThread( TEB *teb )
 {
-    int parent_socket = -1;
-#ifdef PER_THREAD_FILE_HANDLES
-    parent_socket = NtCurrentTeb()->socket;
-#endif
     SYSDEPS_SetCurThread( teb );
-    if (parent_socket != -1) close( parent_socket );
     CLIENT_InitThread();
     SIGNAL_Init();
     __TRY
@@ -162,20 +152,21 @@
 #ifndef NO_REENTRANT_LIBC
 
 #ifdef linux
-    if (clone( (int (*)(void *))SYSDEPS_StartThread, teb->stack_top,
-               CLONE_VM | CLONE_FS | SIGCHLD, teb ) < 0)
+    const int flags = CLONE_VM | CLONE_FS | CLONE_FILES | SIGCHLD;
+    if (clone( (int (*)(void *))SYSDEPS_StartThread, teb->stack_top, flags, teb ) < 0)
         return -1;
-    close( teb->socket );  /* close the child socket in the parent */
+    if (!(flags & CLONE_FILES)) close( teb->socket );  /* close the child socket in 
+the parent */
     return 0;
 #endif
 
 #ifdef HAVE_RFORK
+    const int flags = RFPROC | RFMEM; /*|RFFDG*/
     void **sp = (void **)teb->stack_top;
     *--sp = teb;
     *--sp = 0;
     *--sp = SYSDEPS_StartThread;
     __asm__ __volatile__(
-    "pushl %2;\n\t"            /* RFPROC|RFMEM|RFFDG */
+    "pushl %2;\n\t"            /* flags */
     "pushl $0;\n\t"            /* 0 ? */
     "movl %1,%%eax;\n\t"       /* SYS_rfork */
     ".byte 0x9a; .long 0; .word 7;\n\t"        /* lcall 7:0... FreeBSD syscall */
@@ -185,9 +176,9 @@
     "ret;\n"
     "1:\n\t"           /* parent -> caller thread */
     "addl $8,%%esp" :
-    : "r" (sp), "g" (SYS_rfork), "g" (RFPROC|RFMEM|RFFDG)
+    : "r" (sp), "g" (SYS_rfork), "g" (flags)
     : "eax", "edx");
-    close( teb->socket );  /* close the child socket in the parent */
+    if (flags & RFFDG) close( teb->socket );  /* close the child socket in the parent 
+*/
     return 0;
 #endif
 
@@ -215,10 +206,9 @@
  */
 void SYSDEPS_ExitThread( int status )
 {
-#ifndef PER_THREAD_FILE_HANDLES
-    /* otherwise it will be closed automagically by _exit */
-    close( NtCurrentTeb()->socket );
-#endif
+    int socket = NtCurrentTeb()->socket;
+    NtCurrentTeb()->socket = -1;
+    close( socket );
 #ifdef HAVE__LWP_CREATE
     _lwp_exit();
 #endif
Index: scheduler/thread.c
===================================================================
RCS file: /home/wine/wine/scheduler/thread.c,v
retrieving revision 1.58
retrieving revision 1.59
diff -u -r1.58 -r1.59
--- scheduler/thread.c  2000/03/25 19:14:37     1.58
+++ scheduler/thread.c  2000/03/28 18:47:24     1.59
@@ -143,6 +143,7 @@
 
     /* Free the associated memory */
 
+    if (teb->socket != -1) close( teb->socket );
     if (teb->stack_sel) SELECTOR_FreeBlock( teb->stack_sel, 1 );
     SELECTOR_FreeBlock( teb->teb_sel, 1 );
     if (teb->buffer) munmap( teb->buffer, teb->buffer_size );

And here's the patch that I think fixes the palette:

From: Alexandre Julliard <[EMAIL PROTECTED]>
Log message:
        Fixed memory allocations.

Index: graphics/x11drv/palette.c
===================================================================
RCS file: /home/wine/wine/graphics/x11drv/palette.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- graphics/x11drv/palette.c   2000/03/25 14:05:06     1.12
+++ graphics/x11drv/palette.c   2000/03/28 20:02:37     1.13
@@ -462,7 +462,7 @@
                      (X11DRV_PALETTE_PaletteFlags & X11DRV_PALETTE_VIRTUAL || 
!(X11DRV_PALETTE_PaletteFlags & X11DRV_PALETTE_FIXED)) ) 
                     ? NB_RESERVED_COLORS/2 : -1;
 
-   COLOR_sysPal = (PALETTEENTRY*)malloc(sizeof(PALETTEENTRY)*256);
+   COLOR_sysPal = 
+(PALETTEENTRY*)HeapAlloc(GetProcessHeap(),0,sizeof(PALETTEENTRY)*256);
    if(COLOR_sysPal == NULL) {
        ERR("Can not allocate system palette!\n");
        return FALSE;
@@ -483,7 +483,7 @@
     * RGB->pixel calculation in X11DRV_PALETTE_ToPhysical(). 
     */
 
-   X11DRV_PALETTE_PaletteToXPixel = (int*)malloc(sizeof(int)*256);
+   X11DRV_PALETTE_PaletteToXPixel = 
+(int*)HeapAlloc(GetProcessHeap(),0,sizeof(int)*256);
    if(X11DRV_PALETTE_PaletteToXPixel == NULL) {
        ERR("Out of memory: PaletteToXPixel!\n");
        return FALSE;
@@ -870,8 +870,8 @@
 
     /* initialize palette mapping table */
  
-    mapping = (int*)realloc(palPtr->mapping, sizeof(int)*
-                            palPtr->logpalette.palNumEntries);
+    mapping = HeapReAlloc( GetProcessHeap(), 0, palPtr->mapping,
+                           sizeof(int)*palPtr->logpalette.palNumEntries);
     if(mapping == NULL) {
         ERR("Can not allocate new mapping -- memory exausted!");
         return 0;
Index: objects/palette.c
===================================================================
RCS file: /home/wine/wine/objects/palette.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- objects/palette.c   2000/03/19 14:29:51     1.17
+++ objects/palette.c   2000/03/28 20:02:37     1.18
@@ -97,7 +97,7 @@
 
 
 /***********************************************************************
- * CreatePalette32 [GDI32.53]  Creates a logical color palette
+ * CreatePalette [GDI32.53]  Creates a logical color palette
  *
  * RETURNS
  *    Success: Handle to logical palette
@@ -145,7 +145,7 @@
 
        
 /***********************************************************************
- * CreateHalftonePalette32 [GDI32.47]  Creates a halftone palette
+ * CreateHalftonePalette [GDI32.47]  Creates a halftone palette
  *
  * RETURNS
  *    Success: Handle to logical halftone palette
@@ -201,7 +201,7 @@
 
 
 /***********************************************************************
- * GetPaletteEntries32 [GDI32.209]  Retrieves palette entries
+ * GetPaletteEntries [GDI32.209]  Retrieves palette entries
  *
  * RETURNS
  *    Success: Number of entries from logical palette
@@ -253,7 +253,7 @@
 
 
 /***********************************************************************
- * SetPaletteEntries32 [GDI32.326]  Sets color values for range in palette
+ * SetPaletteEntries [GDI32.326]  Sets color values for range in palette
  *
  * RETURNS
  *    Success: Number of entries that were set
@@ -284,7 +284,7 @@
            count * sizeof(PALETTEENTRY) );
     PALETTE_ValidateFlags(palPtr->logpalette.palPalEntry, 
                          palPtr->logpalette.palNumEntries);
-    free(palPtr->mapping);
+    HeapFree( GetProcessHeap(), 0, palPtr->mapping );
     palPtr->mapping = NULL;
     GDI_HEAP_UNLOCK( hpalette );
     return count;
@@ -301,7 +301,7 @@
 
 
 /***********************************************************************
- * ResizePalette32 [GDI32.289]  Resizes logical palette
+ * ResizePalette [GDI32.289]  Resizes logical palette
  *
  * RETURNS
  *    Success: TRUE
@@ -372,7 +372,7 @@
 
 
 /***********************************************************************
- * AnimatePalette32 [GDI32.6]  Replaces entries in logical palette
+ * AnimatePalette [GDI32.6]  Replaces entries in logical palette
  *
  * RETURNS
  *    Success: TRUE
@@ -420,7 +420,7 @@
 
 
 /***********************************************************************
- * SetSystemPaletteUse32 [GDI32.335]
+ * SetSystemPaletteUse [GDI32.335]
  *
  * RETURNS
  *    Success: Previous system palette
@@ -447,7 +447,7 @@
 
 
 /***********************************************************************
- * GetSystemPaletteUse32 [GDI32.223]  Gets state of system palette
+ * GetSystemPaletteUse [GDI32.223]  Gets state of system palette
  *
  * RETURNS
  *    Current state of system palette
@@ -470,7 +470,7 @@
 
 
 /***********************************************************************
- * GetSystemPaletteEntries32 [GDI32.222]  Gets range of palette entries
+ * GetSystemPaletteEntries [GDI32.222]  Gets range of palette entries
  *
  * RETURNS
  *    Success: Number of entries retrieved from palette
@@ -518,7 +518,7 @@
 
 
 /***********************************************************************
- * GetNearestPaletteIndex32 [GDI32.203]  Gets palette index for color
+ * GetNearestPaletteIndex [GDI32.203]  Gets palette index for color
  *
  * NOTES
  *    Should index be initialized to CLR_INVALID instead of 0?
@@ -555,7 +555,7 @@
 
 
 /***********************************************************************
- * GetNearestColor32 [GDI32.202]  Gets a system color to match
+ * GetNearestColor [GDI32.202]  Gets a system color to match
  *
  * NOTES
  *    Should this return CLR_INVALID instead of FadeCafe?
@@ -608,7 +608,7 @@
 {
     if (palette->mapping)
     {
-        free( palette->mapping );
+        HeapFree( GetProcessHeap(), 0, palette->mapping );
         palette->mapping = NULL;
     }
     if (hLastRealizedPalette == hpalette) hLastRealizedPalette = 0;
@@ -621,7 +621,7 @@
  */
 BOOL PALETTE_DeleteObject( HPALETTE16 hpalette, PALETTEOBJ *palette )
 {
-    free( palette->mapping );
+    HeapFree( GetProcessHeap(), 0, palette->mapping );
     if (hLastRealizedPalette == hpalette) hLastRealizedPalette = 0;
     return GDI_FreeObject( hpalette );
 }
@@ -755,7 +755,7 @@
 
 
 /***********************************************************************
- * SelectPalette32 [GDI32.300]  Selects logical palette into DC
+ * SelectPalette [GDI32.300]  Selects logical palette into DC
  *
  * RETURNS
  *    Success: Previous logical palette
@@ -800,7 +800,7 @@
 
 
 /***********************************************************************
- * RealizePalette32 [GDI32.280]  Maps palette entries to system palette
+ * RealizePalette [GDI32.280]  Maps palette entries to system palette
  *
  * RETURNS
  *    Success: Number of entries in logical palette
@@ -858,7 +858,7 @@
 
 
 /**********************************************************************
- * UpdateColors32 [GDI32.359]  Remaps current colors to logical palette
+ * UpdateColors [GDI32.359]  Remaps current colors to logical palette
  *
  * RETURNS
  *    Success: TRUE



Reply via email to