Chuyu-Team / YY-Thunks

Fix DecodePointer, EncodePointer,RegDeleteKeyEx etc. APIs not found in Windows XP RTM.
MIT License
497 stars 102 forks source link

[建议] 能否兼容 Winelib #15

Closed taotieren closed 3 years ago

taotieren commented 3 years ago

[建议] 能否兼容 Winelib

Winelib 用户手册 https://wiki.winehq.org/Winelib_User%27s_Guide Winelib 是一个开发工具包,它使您可以在 Unix 上编译 Windows 应用程序。

mingkuang-Chuyu commented 3 years ago

怎么个兼容法? 在Linux上编译Windows程序…… 听起来大概率是不行,我做的OBJ只在msvcrt中有效。

taotieren commented 3 years ago

怎么个兼容法? 在Linux上编译Windows程序…… 听起来大概率是不行,我做的OBJ只在msvcrt中有效。

可以参考 winelib 的使用手册

https://mirrors.bfsu.edu.cn/winehq/wine/docs/en/winelib-guide.pdf

mingkuang-Chuyu commented 3 years ago

@taotieren 使用手册对我来说是没有太大意义的。我关心的是目标CRT的初始化机制。

mingkuang-Chuyu commented 3 years ago

由于我对那个CRT是非常不熟悉的,所以建议你直接告诉我。他的CRT在哪里被初始化…… 然后我才能想办法融入CRT的初始化的过程中

sonyps5201314 commented 3 years ago

其实没必要,此库的目的是为了兼容XP,但是wine的dll中已经实现了win7/vista中新加入的那些新的API,或者说本库应该有些函数的实现也参考了wine及reactos吧。我看ConditionVariable,SRWLockS,Once那些相关的API好像有点相似。

taotieren commented 3 years ago

用 winelib 的库可以在 Linux 下编译 编译后就能直接使用。2021年6月20日 21:30,sonyps5201314 @.***>写道:

其实没必要,此库的目的是为了兼容XP,但是wine的dll中已经实现了win7/vista中新加入的那些新的API,或者说本库应该有些函数的实现也参考了wine及reactos吧。我看ConditionVariable,SRWLockS,Once那些相关的API好像有点相似。

—You are receiving this because you were mentioned.Reply to this email directly, view it on GitHub, or unsubscribe.

sonyps5201314 commented 3 years ago

用 winelib 的库可以在 Linux 下编译 编译后就能直接使用。2021年6月20日 21:30,sonyps5201314 @.***>写道: 其实没必要,此库的目的是为了兼容XP,但是wine的dll中已经实现了win7/vista中新加入的那些新的API,或者说本库应该有些函数的实现也参考了wine及reactos吧。我看ConditionVariable,SRWLockS,Once那些相关的API好像有点相似。 —You are receiving this because you were mentioned.Reply to this email directly, view it on GitHub, or unsubscribe.

那和YY-Thunks有什么关系呢?你直接链接到winelib的库就行了啊,就支持linux了呀,没必要再引用YY-Thunks了呀。

taotieren commented 3 years ago

如果 YY-thunk 库是使用 winelib 开发,我这边直接进行打包就能在 Linux 下使用,不用再去整一遍2021年6月21日 02:27,sonyps5201314 @.***>写道:

用 winelib 的库可以在 Linux 下编译 编译后就能直接使用。2021年6月20日 21:30,sonyps5201314 @.***>写道: 其实没必要,此库的目的是为了兼容XP,但是wine的dll中已经实现了win7/vista中新加入的那些新的API,或者说本库应该有些函数的实现也参考了wine及reactos吧。我看ConditionVariable,SRWLockS,Once那些相关的API好像有点相似。 —You are receiving this because you were mentioned.Reply to this email directly, view it on GitHub, or unsubscribe.

那和YY-Thunks有什么关系呢?你直接链接到winelib的库就行了啊,就支持linux了呀,没必要再引用YY-Thunks了呀。

—You are receiving this because you were mentioned.Reply to this email directly, view it on GitHub, or unsubscribe.

sonyps5201314 commented 3 years ago

@taotieren 你是发现哪个API函数YY-thunk中才有,而wine中没有吗?不然的话是没必要用YY-thunk的。

mingkuang-Chuyu commented 3 years ago

没有参考 wine 或者reactos,准确的说 reactos 看了一点,但是突然发现里面问题太多就放弃。然后自己逆向了微软的做法。后来另外一个人帮忙修订一一下。

嗯?Winelib编译后的程序是在Linux下运行的吗?我看他的介绍看了半天 一直以为是在Linux下编译在Windows里跑的程序……

如果是Linux下运行的程序,那么跟YY-Thunks又有什么关系?YY-Thunks是对Windows API的处理,Winelib缺失那么让Winelib它自己处理好了。

mingkuang-Chuyu commented 3 years ago

YY-Thunks不受理Linux平台中的问题,如果有需要请给Winelib提交 PR。

mingkuang-Chuyu commented 3 years ago
C library
There are two choices available to you regarding which C library to use: the native glibc C library or the msvcrt C
library.
Note that under Wine, the crtdll library is implemented using msvcrt, so there is no benefit in trying to use it.
Using glibc in general has the lowest overhead, but this is really only important for file I/O, as many of the functions
in msvcrt are simply resolved to glibc.
To use glibc, you don’t need to make changes to your application; it should work straight away. There are a few
situations in which using glibc is not possible:
1. Your application uses Win32 and C library unicode functions.
2. Your application uses MS specific calls like beginthread(), loadlibrary(), etc.
3. You rely on the precise semantics of the calls, for example, returning -1 rather than non-zero. More likely, your
application will rely on calls like fopen() taking a Windows path rather than a Unix one.
In these cases you should use msvcrt to provide your C runtime calls.
Add -mno-cygwin to your compiler flags. This will cause winebuild to resolve your C library calls to msvcrt.dll.

这段话为什么要提到 msvcrt.dll?