Calling msvcp90 (C++) functions from Wine code
Hey, In a patch [1] I ended up recreating a function that practically exists already in msvcp90 as tr2_sys__Equivalent_wchar. However, I'm guessing it's not okay to call tr2_sys__Equivalent_wchar directly, since it's really a C++ function. Is there some valid and portable way to use this tr2_sys__Equivalent_wchar within another part of Wine (in this case, cmd.exe), to avoid duplicate code? [1] http://source.winehq.org/patches/data/128310 -- Lauri Kenttä
Hi, Lauri. I think it is okday to use tr2_sys__Equivalent_wchar here as it is implemented in Wine as C function. IMHO, though it implements C++ tr2 filesystem, you can regard it as a API of Wine. I will be grateful for any opinion you can provide. Have a nice day! On 16/12/6 上午5:35, Lauri Kenttä wrote:
Hey,
In a patch [1] I ended up recreating a function that practically exists already in msvcp90 as tr2_sys__Equivalent_wchar. However, I'm guessing it's not okay to call tr2_sys__Equivalent_wchar directly, since it's really a C++ function.
Is there some valid and portable way to use this tr2_sys__Equivalent_wchar within another part of Wine (in this case, cmd.exe), to avoid duplicate code?
On Mon, 05 Dec 2016 23:35:37 +0200 Lauri Kenttä <lauri.kentta(a)gmail.com> wrote:
Hey,
In a patch [1] I ended up recreating a function that practically exists already in msvcp90 as tr2_sys__Equivalent_wchar. However, I'm guessing it's not okay to call tr2_sys__Equivalent_wchar directly, since it's really a C++ function.
Is there some valid and portable way to use this tr2_sys__Equivalent_wchar within another part of Wine (in this case, cmd.exe), to avoid duplicate code?
In this case just duplicate it. Starting with Windows 10 there's a new API called CompareObjectHandles(), I have no idea if it works with file handles too, but it's worth trying.
On 2016-12-06 11:15, Nikolay Sivov wrote:
On Mon, 05 Dec 2016 23:35:37 +0200 Lauri Kenttä <lauri.kentta(a)gmail.com> wrote:
Hey,
In a patch [1] I ended up recreating a function that practically exists already in msvcp90 as tr2_sys__Equivalent_wchar. However, I'm guessing it's not okay to call tr2_sys__Equivalent_wchar directly, since it's really a C++ function.
Is there some valid and portable way to use this tr2_sys__Equivalent_wchar within another part of Wine (in this case, cmd.exe), to avoid duplicate code?
In this case just duplicate it. Starting with Windows 10 there's a new API called CompareObjectHandles(), I have no idea if it works with file handles too, but it's worth trying.
Ok, thanks. Even linking with msvcp90 seems to be almost impossible without hacks like EXTRALIBS = ../../dlls/msvcp90/msvcp90.dll.so, so clearly it's not meant to be. CompareObjectHandles probably wouldn't work, because the file handles are actually distinct anyway (different modes and positions etc.). -- Lauri Kenttä
participants (3)
-
Lauri Kenttä -
Nikolay Sivov -
YongHao Hu