Re: sysparams: slight optimisation for IDA 3
"Andrew de Quincey" <adq_dvb(a)lidskialf.net> wrote:
Version 3
+ spi_idx = SPI_GETICONTITLELOGFONT; + + if (!spi_loaded[spi_idx]) + { + memcpy(lpLogFont, &iconTitleLogFont, sizeof(LOGFONTA)); + break; + }
Sorry to bother you again, but probably the comparison statement needs to be reverted... -- Dmitry.
Sorry to bother you again, but probably the comparison statement needs to be reverted...
Doh! You're right. Fixed in yet another patch. Gah As for bothering.. no problems! The sooner I know what coding styles etc are acceptable the better.
Dlls/winmm/lolvldrv.c has a function (MMDRV_Message) shared by the Win16 and the Win32 implementation of mmsystem. Since it is shared by both mmsystem.dll and winmm.dll, all Win16 APIs used in the shared functions will be imported by the Win32 implementation (winmm.dll) also. On ReactOS no such APIs exist so the library will not load. I see two immediate solutions: 1) Check with a preprocessor variable and not compile the Win16 part of the shared Win16/Win32 functions when --disable-win16 is specified. 2) Duplicate the shared code in a Win32 specific file and Win16 specific file. How should it be handled? Casper Hornstrup
Hello Capser, --- Casper Hornstrup <chorns(a)users.sourceforge.net> wrote:
Dlls/winmm/lolvldrv.c has a function (MMDRV_Message) shared by the Win16 and the Win32 implementation of mmsystem. Since it is shared by both mmsystem.dll and winmm.dll, all Win16 APIs used in the shared functions will be imported by the Win32 implementation (winmm.dll) also. On ReactOS no such APIs exist so the library will not load.
Yup there are a few places where you will see this problem, Winmm, comdlg32 and some spots in User and GDI. The User and GDI parts are not that big of a deal for the ReactOS port though. We can pick and chose code snips as needed.
I see two immediate solutions:
1) Check with a preprocessor variable and not compile the Win16 part of the shared Win16/Win32 functions when --disable-win16 is specified.
I like this method but it adds a few more Ugly #ifdefs to the code. We need to keep these changes as small as possible.
2) Duplicate the shared code in a Win32 specific file and Win16 specific file.
It submitted a patch for this problem a while back in comdlg32 and it went to the silent void that is Alexandres patch rejection que.... http://www.winehq.org/hypermail/wine-patches/2003/10/0265.html
How should it be handled?
Alexandre? Thanks Steven __________________________________ Do you Yahoo!? Free Pop-Up Blocker - Get it now http://companion.yahoo.com/
Steven Edwards <steven_ed4153(a)yahoo.com> writes:
It submitted a patch for this problem a while back in comdlg32 and it went to the silent void that is Alexandres patch rejection que.... http://www.winehq.org/hypermail/wine-patches/2003/10/0265.html
Can't say that I remember that patch, I must have dropped it. Could you please resumit?
How should it be handled?
Wherever possible, by having the 16-bit code call the 32-bit code. Where this is really not possible, by duplicating the necessary code, but that should be the last resort. There is no #ifdef we can use for that purpose, and we shouldn't add one. -- Alexandre Julliard julliard(a)winehq.com
On November 29, 2003 03:59 pm, Casper Hornstrup wrote:
2) Duplicate the shared code in a Win32 specific file and Win16 specific file.
I haven't looked if the code can be duplicated, but by the size of the function (it's not big), I'd say duplicating is the way to go (added bonus if by doing so we can simplify a bit each of them). -- Dimi.
Casper Hornstrup wrote:
Dlls/winmm/lolvldrv.c has a function (MMDRV_Message) shared by the Win16 and the Win32 implementation of mmsystem. Since it is shared by both mmsystem.dll and winmm.dll, all Win16 APIs used in the shared functions will be imported by the Win32 implementation (winmm.dll) also. On ReactOS no such APIs exist so the library will not load. I don't see any 16 bit (exported from mmsystem.dll) function called from this MMDRV_Message function. Could you elaborate a bit more ? winmm should be able to be compiled without the mmsystem support (the contrary is not correct, but you don't need it in ROS AFAICT). A+
-- Eric Pouech
-----Oprindelig meddelelse----- Fra: Eric Pouech [mailto:pouech-eric(a)wanadoo.fr] Sendt: 30. november 2003 16:35 Til: Casper Hornstrup Cc: 'wine-devel' Emne: Re: Splitting out shared Win16/Win32 code
Casper Hornstrup wrote:
Dlls/winmm/lolvldrv.c has a function (MMDRV_Message) shared by the Win16 and the Win32 implementation of mmsystem. Since it is shared by both mmsystem.dll and winmm.dll, all Win16 APIs used in the shared functions will be imported by the Win32 implementation (winmm.dll) also. On ReactOS no such APIs exist so the library will not load. I don't see any 16 bit (exported from mmsystem.dll) function called from this MMDRV_Message function. Could you elaborate a bit more ? winmm should be able to be compiled without the mmsystem support (the contrary is not correct, but you don't need it in ROS AFAICT). A+
You're right. I should have written MMDRV_PhysicalFeatures. See attached patch. Casper
You're right. I should have written MMDRV_PhysicalFeatures. See attached patch. ooops, I forgot to submit the fix I had for that back to wine... This should be a better fix, whithout code duplication
A+ -- Eric Pouech Name: mm16 ChangeLog: - move usage of 16 bit specific functions (MapSL) in 16 bit code only License: X11 GenDate: 2003/11/30 19:56:12 UTC ModifiedFiles: dlls/winmm/lolvldrv.c dlls/winmm/mmsystem.c dlls/winmm/winemm.h dlls/winmm/winmm.c =================================================================== RCS file: /home/cvs/cvsroot/wine/wine/dlls/winmm/lolvldrv.c,v retrieving revision 1.53 diff -u -u -r1.53 lolvldrv.c --- dlls/winmm/lolvldrv.c 9 Nov 2003 01:19:58 -0000 1.53 +++ dlls/winmm/lolvldrv.c 9 Nov 2003 10:15:24 -0000 @@ -461,25 +461,19 @@ * MMDRV_PhysicalFeatures [internal] */ UINT MMDRV_PhysicalFeatures(LPWINE_MLD mld, UINT uMsg, DWORD dwParam1, - DWORD dwParam2, BOOL bFrom32) + DWORD dwParam2) { WINE_MM_DRIVER* lpDrv = &MMDrvs[mld->mmdIndex]; - TRACE("(%p, %04x, %08lx, %08lx, %d)\n", mld, uMsg, dwParam1, dwParam2, bFrom32); + TRACE("(%p, %04x, %08lx, %08lx)\n", mld, uMsg, dwParam1, dwParam2); /* all those function calls are undocumented */ switch (uMsg) { case DRV_QUERYDRVENTRY: - if (bFrom32) - lstrcpynA((LPSTR)dwParam1, lpDrv->drvname, LOWORD(dwParam2)); - else - lstrcpynA((LPSTR)MapSL(dwParam1), lpDrv->drvname, LOWORD(dwParam2)); + lstrcpynA((LPSTR)dwParam1, lpDrv->drvname, LOWORD(dwParam2)); break; case DRV_QUERYDEVNODE: - if (bFrom32) - *(LPDWORD)dwParam1 = 0L; /* should be DevNode */ - else - *(DWORD*)MapSL(dwParam1) = 0L; + *(LPDWORD)dwParam1 = 0L; /* should be DevNode */ break; case DRV_QUERYNAME: WARN("NIY QueryName\n"); @@ -496,18 +490,12 @@ case DRVM_MAPPER_PREFERRED_GET: /* FIXME: get from registry someday */ - if (bFrom32) { - *((LPDWORD)dwParam1) = -1; /* No preferred device */ - break; - } - return MMSYSERR_INVALPARAM; + *((LPDWORD)dwParam1) = -1; /* No preferred device */ + break; case DRV_QUERYDEVICEINTERFACE: case DRV_QUERYDEVICEINTERFACESIZE: - if (bFrom32) - return MMDRV_Message(mld, uMsg, dwParam1, dwParam2, TRUE); - - return MMSYSERR_INVALPARAM; + return MMDRV_Message(mld, uMsg, dwParam1, dwParam2, TRUE); case DRV_QUERYDSOUNDIFACE: /* Wine-specific: Retrieve DirectSound interface */ case DRV_QUERYDSOUNDDESC: /* Wine-specific: Retrieve DirectSound driver description*/ Index: dlls/winmm/mmsystem.c =================================================================== RCS file: /home/cvs/cvsroot/wine/wine/dlls/winmm/mmsystem.c,v retrieving revision 1.101 diff -u -u -r1.101 mmsystem.c --- dlls/winmm/mmsystem.c 9 Nov 2003 01:19:58 -0000 1.101 +++ dlls/winmm/mmsystem.c 9 Nov 2003 10:15:26 -0000 @@ -1485,7 +1485,9 @@ if ((wmld = MMDRV_Get(HWAVEOUT_32(hWaveOut), MMDRV_WAVEOUT, FALSE)) == NULL) { if ((wmld = MMDRV_Get(HWAVEOUT_32(hWaveOut), MMDRV_WAVEOUT, TRUE)) != NULL) { - return MMDRV_PhysicalFeatures(wmld, uMessage, dwParam1, dwParam2, FALSE); + if (uMessage == DRV_QUERYDRVENTRY || uMessage == DRV_QUERYDEVNODE) + dwParam1 = (DWORD)MapSL(dwParam1); + return MMDRV_PhysicalFeatures(wmld, uMessage, dwParam1, dwParam2); } return MMSYSERR_INVALHANDLE; } @@ -1726,7 +1728,9 @@ if ((wmld = MMDRV_Get(HWAVEIN_32(hWaveIn), MMDRV_WAVEIN, FALSE)) == NULL) { if ((wmld = MMDRV_Get(HWAVEIN_32(hWaveIn), MMDRV_WAVEIN, TRUE)) != NULL) { - return MMDRV_PhysicalFeatures(wmld, uMessage, dwParam1, dwParam2, FALSE); + if (uMessage == DRV_QUERYDRVENTRY || uMessage == DRV_QUERYDEVNODE) + dwParam1 = (DWORD)MapSL(dwParam1); + return MMDRV_PhysicalFeatures(wmld, uMessage, dwParam1, dwParam2); } return MMSYSERR_INVALHANDLE; } Index: dlls/winmm/winemm.h =================================================================== RCS file: /home/cvs/cvsroot/wine/wine/dlls/winmm/winemm.h,v retrieving revision 1.48 diff -u -u -r1.48 winemm.h --- dlls/winmm/winemm.h 9 Nov 2003 01:19:58 -0000 1.48 +++ dlls/winmm/winemm.h 9 Nov 2003 10:15:27 -0000 @@ -243,7 +243,7 @@ LPWINE_MLD MMDRV_Get(HANDLE hndl, UINT type, BOOL bCanBeID); LPWINE_MLD MMDRV_GetRelated(HANDLE hndl, UINT srcType, BOOL bSrcCanBeID, UINT dstTyped); DWORD MMDRV_Message(LPWINE_MLD mld, WORD wMsg, DWORD dwParam1, DWORD dwParam2, BOOL bFrom32); -UINT MMDRV_PhysicalFeatures(LPWINE_MLD mld, UINT uMsg, DWORD dwParam1, DWORD dwParam2, BOOL bFrom32); +UINT MMDRV_PhysicalFeatures(LPWINE_MLD mld, UINT uMsg, DWORD dwParam1, DWORD dwParam2); BOOL MMDRV_Is32(unsigned int); void MMDRV_InstallMap(unsigned int, MMDRV_MAPFUNC, MMDRV_UNMAPFUNC, MMDRV_MAPFUNC, MMDRV_UNMAPFUNC, LPDRVCALLBACK); Index: dlls/winmm/winmm.c =================================================================== RCS file: /home/cvs/cvsroot/wine/wine/dlls/winmm/winmm.c,v retrieving revision 1.25 diff -u -u -r1.25 winmm.c --- dlls/winmm/winmm.c 26 Nov 2003 03:39:13 -0000 1.25 +++ dlls/winmm/winmm.c 27 Nov 2003 19:32:22 -0000 @@ -1306,7 +1306,7 @@ return 0; } if ((wmld = MMDRV_Get(hMidiOut, MMDRV_MIDIOUT, TRUE)) != NULL) { - return MMDRV_PhysicalFeatures(wmld, uMessage, dwParam1, dwParam2, TRUE); + return MMDRV_PhysicalFeatures(wmld, uMessage, dwParam1, dwParam2); } return MMSYSERR_INVALHANDLE; } @@ -2619,7 +2619,7 @@ if ((wmld = MMDRV_Get(hWaveOut, MMDRV_WAVEOUT, FALSE)) == NULL) { if ((wmld = MMDRV_Get(hWaveOut, MMDRV_WAVEOUT, TRUE)) != NULL) { - return MMDRV_PhysicalFeatures(wmld, uMessage, dwParam1, dwParam2, TRUE); + return MMDRV_PhysicalFeatures(wmld, uMessage, dwParam1, dwParam2); } return MMSYSERR_INVALHANDLE; } @@ -2877,7 +2877,7 @@ if ((wmld = MMDRV_Get(hWaveIn, MMDRV_WAVEIN, FALSE)) == NULL) { if ((wmld = MMDRV_Get(hWaveIn, MMDRV_WAVEIN, TRUE)) != NULL) { - return MMDRV_PhysicalFeatures(wmld, uMessage, dwParam1, dwParam2, TRUE); + return MMDRV_PhysicalFeatures(wmld, uMessage, dwParam1, dwParam2); } return MMSYSERR_INVALHANDLE; }
Great. I have a few more patches at http://212.242.245.122/patches/. Maybe you can review them? Casper
-----Oprindelig meddelelse----- Fra: wine-patches-admin(a)winehq.com [mailto:wine-patches-admin(a)winehq.com] På vegne af Eric Pouech Sendt: 30. november 2003 20:57 Til: Casper Hornstrup Cc: wine-devel(a)winehq.com; wine-patches(a)winehq.com Emne: Re: Splitting out shared Win16/Win32 code
You're right. I should have written MMDRV_PhysicalFeatures. See attached patch. ooops, I forgot to submit the fix I had for that back to wine... This should be a better fix, whithout code duplication
A+ -- Eric Pouech
On December 2, 2003 03:40 am, Casper Hornstrup wrote:
Great. I have a few more patches at http://212.242.245.122/patches/. Maybe you can review them?
It's better to post them on the list. More people get to see them, they get indexed by various search engines, and they get archived for posterity. If you're not sure about them, post them on wine-devel for discussion. If you think they can go it, post them to wine-patches, people who care will see them, and comment if need be. -- Dimi.
participants (7)
-
Alexandre Julliard -
Andrew de Quincey -
Casper Hornstrup -
Dimitrie O. Paun -
Dmitry Timoshkov -
Eric Pouech -
Steven Edwards