PATCH: Convert HTASK to a void*

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

this patch should close bug #502, but I have some questions (that's why
wine-devel is CC'ed):
- is it correct to use the HTASK_{16,32} macros or should I use
  WOWHandle{16,32}? The difference is that the macros include a type
  cast to the right handle.
- GetAppCompatFlags() works internaly with a HTASK16. Can I move the
  implementation to GetAppCompatFlags16()? Would save a handle
  conversion in GetAppCompatFlags16().

I'll close the bug report after the patch get's accepted.

License: LGPL, X11
Changelog:
    Michael Stefaniuc <mstefani@redhat.com>
    - Convert HTASK to a void*
    - Fix HTASK_32 macro


bye
	michael
-- 
Michael Stefaniuc               Tel.: +49-711-96437-199
System Administration           Fax.: +49-711-96437-111
Red Hat GmbH                    Email: mstefani@redhat.com
Hauptstaetterstr. 58            http://www.redhat.de/
D-70178 Stuttgart
Index: dlls/winmm/Makefile.in
===================================================================
RCS file: /home/wine/wine/dlls/winmm/Makefile.in,v
retrieving revision 1.24
diff -u -r1.24 Makefile.in
--- dlls/winmm/Makefile.in	17 May 2002 03:37:15 -0000	1.24
+++ dlls/winmm/Makefile.in	18 Jul 2002 22:46:24 -0000
@@ -4,7 +4,7 @@
 SRCDIR    = @srcdir@
 VPATH     = @srcdir@
 MODULE    = winmm.dll
-IMPORTS   = user32 advapi32 kernel32
+IMPORTS   = user32 advapi32 kernel32 wow32
 ALTNAMES  = mmsystem.dll sound.dll
 
 LDDLLFLAGS = @LDDLLFLAGS@
Index: dlls/winmm/mmsystem.c
===================================================================
RCS file: /home/wine/wine/dlls/winmm/mmsystem.c,v
retrieving revision 1.61
diff -u -r1.61 mmsystem.c
--- dlls/winmm/mmsystem.c	8 Jul 2002 19:35:08 -0000	1.61
+++ dlls/winmm/mmsystem.c	18 Jul 2002 22:46:26 -0000
@@ -43,6 +43,7 @@
 #include "heap.h"
 #include "ntddk.h"
 #include "winemm.h"
+#include "wownt32.h"
 
 #include "wine/debug.h"
 
@@ -1969,7 +1970,7 @@
  */
 HTASK16 WINAPI mciGetCreatorTask16(UINT16 uDeviceID)
 {
-    return mciGetCreatorTask(uDeviceID);
+    return HTASK_16(mciGetCreatorTask(uDeviceID));
 }
 
 /**************************************************************************
@@ -1982,7 +1983,7 @@
 
     TRACE("(%u)\n", uDeviceID);
 
-    ret = (!(wmd = MCI_GetDriver(uDeviceID))) ? 0 : wmd->hCreatorTask;
+    ret = (!(wmd = MCI_GetDriver(uDeviceID))) ? 0 : HTASK_32(wmd->hCreatorTask);
 
     TRACE("=> %04x\n", ret);
     return ret;
Index: include/windef.h
===================================================================
RCS file: /home/wine/wine/include/windef.h,v
retrieving revision 1.64
diff -u -r1.64 windef.h
--- include/windef.h	10 Jul 2002 23:20:49 -0000	1.64
+++ include/windef.h	18 Jul 2002 22:46:26 -0000
@@ -91,7 +91,7 @@
 DECLARE_OLD_HANDLE(HPEN);
 DECLARE_OLD_HANDLE(HRGN);
 DECLARE_OLD_HANDLE(HRSRC);
-DECLARE_OLD_HANDLE(HTASK);
+DECLARE_HANDLE(HTASK);
 DECLARE_HANDLE(HWINEVENTHOOK);
 DECLARE_HANDLE(HWINSTA);
 DECLARE_OLD_HANDLE(HWND);
Index: include/wownt32.h
===================================================================
RCS file: /home/wine/wine/include/wownt32.h,v
retrieving revision 1.4
diff -u -r1.4 wownt32.h
--- include/wownt32.h	31 May 2002 23:06:49 -0000	1.4
+++ include/wownt32.h	18 Jul 2002 22:46:26 -0000
@@ -72,7 +72,7 @@
 #define HPALETTE_32(h16)  ((HPALETTE)  (WOWHandle32(h16, WOW_TYPE_HPALETTE)))
 #define HPEN_32(h16)      ((HPEN)      (WOWHandle32(h16, WOW_TYPE_HPEN)))
 #define HACCEL_32(h16)    ((HACCEL)    (WOWHandle32(h16, WOW_TYPE_HACCEL)))
-#define HTASK_32(h16)     ((DWORD)     (WOWHandle32(h16, WOW_TYPE_HTASK)))
+#define HTASK_32(h16)     ((HTASK)     (WOWHandle32(h16, WOW_TYPE_HTASK)))
 #define FULLHWND_32(h16)  ((HWND)      (WOWHandle32(h16, WOW_TYPE_FULLHWND)))
 
 #define HWND_16(h32)      (WOWHandle16(h32, WOW_TYPE_HWND))
Index: loader/task.c
===================================================================
RCS file: /home/wine/wine/loader/task.c,v
retrieving revision 1.119
diff -u -r1.119 task.c
--- loader/task.c	31 May 2002 23:06:51 -0000	1.119
+++ loader/task.c	18 Jul 2002 22:46:27 -0000
@@ -46,6 +46,7 @@
 #include "task.h"
 #include "thread.h"
 #include "toolhelp.h"
+#include "wownt32.h"
 
 #include "wine/debug.h"
 
@@ -1577,7 +1578,7 @@
  */
 DWORD WINAPI GetAppCompatFlags16( HTASK16 hTask )
 {
-    return GetAppCompatFlags( hTask );
+    return GetAppCompatFlags( HTASK_32(hTask) );
 }
 
 
@@ -1587,9 +1588,11 @@
 DWORD WINAPI GetAppCompatFlags( HTASK hTask )
 {
     TDB *pTask;
+    HTASK16 hTask16;
 
-    if (!hTask) hTask = GetCurrentTask();
-    if (!(pTask=TASK_GetPtr( (HTASK16)hTask ))) return 0;
-    if (GlobalSize16(hTask) < sizeof(TDB)) return 0;
+    hTask16 = HTASK_16(hTask);
+    if (!hTask16) hTask16 = GetCurrentTask();
+    if (!(pTask=TASK_GetPtr(hTask16))) return 0;
+    if (GlobalSize16(hTask16) < sizeof(TDB)) return 0;
     return pTask->compat_flags;
 }

Attachment: pgp00012.pgp
Description: PGP signature


[Index of Archives]     [Gimp for Windows]     [Red Hat]     [Samba]     [Yosemite Camping]     [Graphics Cards]     [Wine Home]

  Powered by Linux