Re: [PATCH 3/5] [WinMM]: allow 32-bit mciLoadCommandResource to load out of 16 bit module
Eric Pouech <eric.pouech(a)orange.fr> writes:
@@ -1566,7 +1554,41 @@ UINT WINAPI mciLoadCommandResource(HINSTANCE hInst, LPCWSTR resNameW, UINT type) if (!(hRsrc = FindResourceW(hInst, resNameW, (LPWSTR)RT_RCDATA))) { WARN("No command table found in resource\n"); } else if ((hMem = LoadResource(hInst, hRsrc))) { - ret = MCI_SetCommandTable(LockResource(hMem), type); + if (!HIWORD(hInst)) { /* it's a 16bit resource, convert it */ + const BYTE* ptr16 = LockResource(hMem);
Please don't do that. 16-bit resources should always be loaded with 16-bit functions. Support for casting 16-bit instances to 32-bit is a hack that will have to be removed. -- Alexandre Julliard julliard(a)winehq.org
Alexandre Julliard a écrit :
Eric Pouech <eric.pouech(a)orange.fr> writes:
@@ -1566,7 +1554,41 @@ UINT WINAPI mciLoadCommandResource(HINSTANCE hInst, LPCWSTR resNameW, UINT type) if (!(hRsrc = FindResourceW(hInst, resNameW, (LPWSTR)RT_RCDATA))) { WARN("No command table found in resource\n"); } else if ((hMem = LoadResource(hInst, hRsrc))) { - ret = MCI_SetCommandTable(LockResource(hMem), type); + if (!HIWORD(hInst)) { /* it's a 16bit resource, convert it */ + const BYTE* ptr16 = LockResource(hMem);
Please don't do that. 16-bit resources should always be loaded with 16-bit functions. Support for casting 16-bit instances to 32-bit is a hack that will have to be removed.
do you prefer the Wine only 32-bit functions exported out of kernel32.dll (like LoadResource16 and friends ?) won't those have to be removed some time as well ?? or are you saying, loading by hand LoadResource out of krnl386.exe and using WOW* functions ? A+ -- Eric Pouech "The problem with designing something completely foolproof is to underestimate the ingenuity of a complete idiot." (Douglas Adams)
Eric Pouech <eric.pouech(a)orange.fr> writes:
Alexandre Julliard a écrit :
Eric Pouech <eric.pouech(a)orange.fr> writes:
@@ -1566,7 +1554,41 @@ UINT WINAPI mciLoadCommandResource(HINSTANCE hInst, LPCWSTR resNameW, UINT type) if (!(hRsrc = FindResourceW(hInst, resNameW, (LPWSTR)RT_RCDATA))) { WARN("No command table found in resource\n"); } else if ((hMem = LoadResource(hInst, hRsrc))) { - ret = MCI_SetCommandTable(LockResource(hMem), type); + if (!HIWORD(hInst)) { /* it's a 16bit resource, convert it */ + const BYTE* ptr16 = LockResource(hMem);
Please don't do that. 16-bit resources should always be loaded with 16-bit functions. Support for casting 16-bit instances to 32-bit is a hack that will have to be removed.
do you prefer the Wine only 32-bit functions exported out of kernel32.dll (like LoadResource16 and friends ?) won't those have to be removed some time as well ?? or are you saying, loading by hand LoadResource out of krnl386.exe and using WOW* functions ?
They will ultimately be exported out of krnl386, yes. That should be transparent once krnl386 is made into a separate dll, with some winebuild magic to resolve the imports. For now just call the kernel32 ones. -- Alexandre Julliard julliard(a)winehq.org
participants (2)
-
Alexandre Julliard -
Eric Pouech