Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

モデルファイル同梱でのdll名指定をなくす #107

Merged
merged 10 commits into from
Mar 26, 2022

Conversation

Oyaki122
Copy link
Member

内容

現在のWindowsでのファイル埋め込みでは、dllファイルからファイルを得るのに必要なhandlerを取得するために、dllファイル名(core)をコード中で指定しています。しかし、これは今後のdll使用の中で、ファイル名を変更する際に支障をきたします
そこで、handlerを取得する関数を GetModuleHandler から GetModuleHandlerEx に変更し、ファイル読み込み関数自身のアドレスからhandlerを取得させることでdll名の指定を不要にします

参考

https://stackoverflow.com/questions/557081/how-do-i-get-the-hmodule-for-the-currently-executing-code
https://gist.github.com/davidruhmann/8008844

Copy link
Contributor

@Yosshi999 Yosshi999 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

良いと思います!

Copy link
Member

@PickledChair PickledChair left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@PickledChair PickledChair merged commit 9553c52 into VOICEVOX:main Mar 26, 2022
@Oyaki122 Oyaki122 deleted the noDllName branch March 26, 2022 05:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants