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

epic: windows-upgrades 📲 #9330

Closed
wants to merge 57 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
4e7eaef
feat(windows): test rename for 64 dll
rc-swag Feb 16, 2023
39d36b7
feat(windows): use g_hInstance for module referance in InitHooks
rc-swag Mar 2, 2023
d46daa7
feat(windows): check in premake.in
rc-swag Mar 13, 2023
3e718dd
feat(windows): move keyman32 - keyman32-ver
rc-swag Mar 16, 2023
d0b9103
feat(windows): keyman32 proxy take 1
rc-swag Mar 27, 2023
8c33d8a
feat(windows): hard coded load library version dll
rc-swag Mar 28, 2023
ea98bd6
feat(windows): use win regsitry to store dll name
rc-swag Apr 5, 2023
ccc4ff9
feat(windows): add registry keyname for keyman32
rc-swag Apr 6, 2023
7fb7f06
feat(windows): keyman64 project files
rc-swag Apr 12, 2023
72776f7
feat(windows): proxy dll and load free dll
rc-swag Apr 13, 2023
5ec547a
feat(windows): check in missed updates
rc-swag Apr 13, 2023
4f3a91b
feat(windows): hard code load proxy plus registry look up
rc-swag Apr 18, 2023
2872f03
feat(windows): get proxy library install path pt1
rc-swag Apr 19, 2023
a5c427f
feat(windows): only load proxy dll if imx
rc-swag May 18, 2023
e2e28f5
chore(windows): Merge branch 'master' into feature/windows-online-upd…
rc-swag May 18, 2023
f1bcde7
feat(windows): Merge branch 'master' into feature/windows-online-updates
rc-swag Jun 12, 2023
269b60d
feat: remove etw.man from versioned dll
rc-swag Jun 20, 2023
92ad026
feat: etw.rc
rc-swag Jun 20, 2023
bad8712
feat: update components.wxs with correct etl man file
rc-swag Jun 22, 2023
923c6df
feat(windows): Merge branch 'master' into feature/windows-online-updates
rc-swag Jul 5, 2023
24abdee
feat(windows): some minor tidy up
rc-swag Jul 6, 2023
d26b804
feat(windows): untrack support files
rc-swag Jul 6, 2023
d2f79f3
feat(windows): update gitignore
rc-swag Jul 6, 2023
c19300a
feat(windows): commit review suggestions
rc-swag Jul 11, 2023
086c14a
feat(windows): Address review comments step1
rc-swag Jul 11, 2023
c0b3a18
feat(windows): address review comments step2
rc-swag Jul 12, 2023
ce8fe6e
feat(windows): remove files from tracking
rc-swag Jul 12, 2023
ee334de
feat(windows): add files to gitignore
rc-swag Jul 12, 2023
e792de9
feat(windows): add refcount
rc-swag Jul 12, 2023
a36fc55
feat:(windows) apply suggestions from code review
rc-swag Jul 14, 2023
131c36e
feat(windows): updated loading of the proxy dll
rc-swag Jul 14, 2023
4236ca7
feat(windows): update gitignore
rc-swag Jul 24, 2023
1e80b4d
feat(windows): update reference to keyman-debug-etw.h
rc-swag Jul 24, 2023
9d3589f
chore: Create windows-upgrades.md
mcdurdin Jul 25, 2023
6723f69
feat(windows): review suggestions
rc-swag Jul 27, 2023
efb9fd6
feat: git ignore updates
rc-swag Jul 27, 2023
5ad4548
feat: update engine makefile
rc-swag Jul 27, 2023
b20aaee
feat: remove dependinces on proxy dlls
rc-swag Jul 31, 2023
8ed765f
feat: fix include path unit test keyman32-ver
rc-swag Jul 31, 2023
88de533
feat: use unicode module api calls for proxy dll
rc-swag Jul 31, 2023
743eaa6
feat: tweaks to gitignore
rc-swag Aug 1, 2023
7d4be57
Merge pull request #9202 from keymanapp/feat/versioned-proxy-dll
rc-swag Aug 1, 2023
6cd39c3
Merge pull request #9442 from keymanapp/chore/merge-master-into-epic-…
rc-swag Aug 10, 2023
6af3346
chore: Merge branch 'master' into chore/merge-master-into-epic-window…
rc-swag Aug 21, 2023
05fd82f
chore(windows): icu lib files for version dlls merge
rc-swag Aug 25, 2023
94be8c6
Merge pull request #9498 from keymanapp/chore/merge-master-into-epic-…
rc-swag Sep 13, 2023
6ba5fb4
Merge pull request #9562 from keymanapp/chore/merge-master-into-epic-…
rc-swag Sep 19, 2023
891d321
Merge pull request #9645 from keymanapp/chore/merge-master-into-windo…
rc-swag Sep 29, 2023
f63f369
chore: Merge branch 'epic/windows-upgrades' into chore/merge-master-i…
rc-swag Oct 13, 2023
6269bff
chore: Merge branch 'master' into chore/merge-master-epic-win-upg-cert
rc-swag Oct 16, 2023
f7b7305
Merge pull request #9749 from keymanapp/chore/merge-master-into-windo…
mcdurdin Oct 16, 2023
92abe47
Merge branch 'epic/windows-upgrades' into chore/merge-master-epic-win…
mcdurdin Oct 16, 2023
f53421b
chore: update vcxproj for proxys to include RC info files
rc-swag Oct 17, 2023
46948cc
Merge pull request #9770 from keymanapp/chore/merge-master-epic-win-u…
rc-swag Oct 19, 2023
b2f0182
chore: Merge branch 'epic/windows-upgrades' into chore/merge-master-i…
mcdurdin Oct 27, 2023
d3e774c
Merge pull request #9871 from keymanapp/chore/merge-master-into-windo…
mcdurdin Oct 27, 2023
ff056e7
Merge pull request #9981 from keymanapp/chore/merge-master-into-windo…
mcdurdin Nov 13, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -100,12 +100,6 @@

# /engine/keyman32/
/windows/src/engine/keyman32/Keyman32.opensdf
/windows/src/engine/keyman32/*.obj
/windows/src/engine/keyman32/*.cod
/windows/src/engine/keyman32/*.pdb

# /engine/keymanx64/
/windows/src/engine/keymanx64/x64

# /engine/kmcomapi/
/windows/src/engine/kmcomapi/kmcomapi.tlb
Expand Down
2 changes: 2 additions & 0 deletions common/windows/delphi/general/RegistryKeys.pas
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,8 @@ interface

SRegValue_RootPath = 'root path'; // LM
SRegValue_RegistrationKey = 'registration key'; // LM
SRegValue_Keyman32_Name = 'keyman32 name'; // LM
SRegValue_Keyman64_Name = 'keyman64 name'; // LM

{ Uninstall feedback keyboard list }

Expand Down
28 changes: 28 additions & 0 deletions windows/src/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
# Temporary build files for VC++
**/*.FileListAbsolute.txt


# These files are generated during build
engine/keyman32/KEYMAN32.res
engine/keyman64/Keyman64.res
Expand All @@ -22,6 +23,33 @@ engine/mcompile/Release/
tds_file.txt
global/delphi/cust/MessageIdentifierConsts.pas

engine/keyman32/*.obj
engine/keyman32/*.cod
engine/keyman32/*.pdb
engine/keyman32/exports.h
engine/keyman32/premake.mak

# /engine/keyman32-ver
engine/keyman32-ver/keyman32-ver.def
engine/keyman32-ver/keyman64-build-version.h
engine/keyman32-ver/keyman-engine.pdb
engine/keyman32-ver/MSG00001.bin
engine/keyman32-ver/KEYMAN32-ver.res
engine/keyman32-ver/premake.mak

# /engine/keyman64
engine/keyman64/exports.h
engine/keyman64/MSG00001.bin
engine/keyman64/premake.mak

# /engine/keyman64-ver
engine/keyman64-ver/premake.mak
engine/keyman64-ver/Keyman64-ver.res
engine/keyman64-ver/premake_version.mak

# /engine/keymanx64/
engine/keymanx64/x64

# These are built from corresponding manifest.in and version.in
**/manifest.xml

Expand Down
12 changes: 6 additions & 6 deletions windows/src/engine/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ keyman32/keyman-debug-etw.h
keyman32/keyman-debug-etw.rc
keyman32/keyman-debug-etw.res
keyman32/keyman-debug-etwTEMP.BIN
keyman64/MSG00001.bin
keyman64/keyman-debug-etw.h
keyman64/keyman-debug-etw.rc
keyman64/keyman-debug-etw.res
keyman64/keyman-debug-etwTEMP.BIN
keyman64-ver/MSG00001.bin
keyman64-ver/keyman-debug-etw.h
keyman64-ver/keyman-debug-etw.rc
keyman64-ver/keyman-debug-etw.res
keyman64-ver/keyman-debug-etwTEMP.BIN
mcompile/Debug

# Visual Studio packages for test
packages/
packages/
36 changes: 22 additions & 14 deletions windows/src/engine/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
# ----------------------------------------------------------------------

!ifdef NODELPHI
TARGETS=keymanmc keyman32 keyman64 keymanx64 mcompile kmtip kmrefresh
TARGETS=keymanmc keyman32 keyman32-ver keyman64 keyman64-ver keymanx64 mcompile kmtip kmrefresh
!else
TARGETS=keymanmc keyman32 kmcomapi keyman tsysinfox64 tsysinfo keyman64 keymanx64 mcompile inst kmtip kmrefresh
TARGETS=keymanmc keyman32 keyman32-ver kmcomapi keyman tsysinfox64 tsysinfo keyman64 keyman64-ver keymanx64 mcompile inst kmtip kmrefresh
!endif
MANIFESTS=keyman tsysinfo tsysinfox64 keymanx64 mcompile
CLEANS=clean-engine
Expand All @@ -32,6 +32,10 @@ keyman32: .virtual
cd $(ROOT)\src\engine\keyman32
$(MAKE) $(TARGET)

keyman32-ver: .virtual
cd $(ROOT)\src\engine\keyman32-ver
$(MAKE) $(TARGET)

tsysinfox64: .virtual
cd $(ROOT)\src\engine\tsysinfox64
$(MAKE) $(TARGET)
Expand All @@ -48,6 +52,10 @@ keyman64: .virtual
cd $(ROOT)\src\engine\keyman64
$(MAKE) $(TARGET)

keyman64-ver: .virtual
cd $(ROOT)\src\engine\keyman64-ver
$(MAKE) $(TARGET)

kmrefresh: .virtual
cd $(ROOT)\src\engine\kmrefresh
$(MAKE) $(TARGET)
Expand All @@ -64,28 +72,28 @@ kmtip: .virtual
# Shorthand targets for debug builds
# ----------------------------------------------------------------------

keyman32-build:
cd $(ROOT)\src\engine\keyman32
keyman32-ver-build:
cd $(ROOT)\src\engine\keyman32-ver
$(MAKE) build

keyman32-signcode:
cd $(ROOT)\src\engine\keyman32
keyman32-ver-signcode:
cd $(ROOT)\src\engine\keyman32-ver
$(MAKE) signcode

keyman32-install:
cd $(ROOT)\src\engine\keyman32
keyman32-ver-install:
cd $(ROOT)\src\engine\keyman32-ver
$(MAKE) install

keyman64-build:
cd $(ROOT)\src\engine\keyman64
keyman64-ver-build:
cd $(ROOT)\src\engine\keyman64-ver
$(MAKE) build

keyman64-signcode:
cd $(ROOT)\src\engine\keyman64
keyman64-ver-signcode:
cd $(ROOT)\src\engine\keyman64-ver
$(MAKE) signcode

keyman64-install:
cd $(ROOT)\src\engine\keyman64
keyman64-ver-install:
cd $(ROOT)\src\engine\keyman64-ver
$(MAKE) install

# ----------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion windows/src/engine/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Host application for the Keyman Engine. Shows the Keyman icon, Keyman menu, OSK,

## keymanx64 - keymanx64.exe

64-bit version of keyman.exe. All UI is in keyman.exe, so this is a thin wrapper around the keyman32 build.
64-bit version of keyman.exe. All UI is in keyman.exe, so this is a thin wrapper around the keyman32-ver build.

## kmcomapi - kmcomapi.dll | kmcomapi.x64.dll

Expand Down
24 changes: 20 additions & 4 deletions windows/src/engine/engine.sln
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.31313.79
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Keyman32", "keyman32\Keyman32.vcxproj", "{BD5564FB-35A5-4A3C-B96A-4A6578E2B593}"
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "keyman32-ver", "keyman32-ver\Keyman32-ver.vcxproj", "{BD5564FB-35A5-4A3C-B96A-4A6578E2B593}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "keyman64", "keyman64\keyman64.vcxproj", "{D1115FB2-230D-4FD8-90B9-982E49953D18}"
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "keyman64-ver", "keyman64-ver\keyman64-ver.vcxproj", "{D1115FB2-230D-4FD8-90B9-982E49953D18}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "keymanx64", "keymanx64\keymanx64.vcxproj", "{A34650EA-D6E8-4229-8091-6BF1443565B5}"
EndProject
Expand All @@ -15,12 +15,16 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mcompile", "mcompile\mcompi
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "kmrefresh", "kmrefresh\kmrefresh.vcxproj", "{A3B8F75F-E63E-434E-8A2A-034AD9B66571}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "keyman-engine-tests", "keyman32\tests\keyman-engine-tests\keyman-engine-tests.vcxproj", "{46399ED7-79A1-4E7E-BD96-4B1AEEC838AE}"
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "keyman-engine-tests", "keyman32-ver\tests\keyman-engine-tests\keyman-engine-tests.vcxproj", "{46399ED7-79A1-4E7E-BD96-4B1AEEC838AE}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "keyman-engine", "keyman32\keyman-engine.vcxproj", "{A7069186-5AE7-4504-8926-861B7A34BA9E}"
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "keyman-engine", "keyman32-ver\keyman-engine.vcxproj", "{A7069186-5AE7-4504-8926-861B7A34BA9E}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testhost", "testhost\testhost.vcxproj", "{12818DA3-0472-49A5-96FC-A4808A1A77FA}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "keyman64", "keyman64\keyman64.vcxproj", "{CE480BDD-E112-488D-8684-ECBA8F46FF87}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "keyman32", "keyman32\keyman32.vcxproj", "{FA6F9217-E2BB-4586-ACD3-0DFB6C13A257}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Expand Down Expand Up @@ -91,6 +95,18 @@ Global
{12818DA3-0472-49A5-96FC-A4808A1A77FA}.Release|Win32.Build.0 = Release|Win32
{12818DA3-0472-49A5-96FC-A4808A1A77FA}.Release|x64.ActiveCfg = Release|x64
{12818DA3-0472-49A5-96FC-A4808A1A77FA}.Release|x64.Build.0 = Release|x64
{CE480BDD-E112-488D-8684-ECBA8F46FF87}.Debug|Win32.ActiveCfg = Debug|x64
{CE480BDD-E112-488D-8684-ECBA8F46FF87}.Debug|x64.ActiveCfg = Debug|x64
{CE480BDD-E112-488D-8684-ECBA8F46FF87}.Debug|x64.Build.0 = Debug|x64
{CE480BDD-E112-488D-8684-ECBA8F46FF87}.Release|Win32.ActiveCfg = Release|x64
{CE480BDD-E112-488D-8684-ECBA8F46FF87}.Release|x64.ActiveCfg = Release|x64
{CE480BDD-E112-488D-8684-ECBA8F46FF87}.Release|x64.Build.0 = Release|x64
{FA6F9217-E2BB-4586-ACD3-0DFB6C13A257}.Debug|Win32.ActiveCfg = Debug|Win32
{FA6F9217-E2BB-4586-ACD3-0DFB6C13A257}.Debug|Win32.Build.0 = Debug|Win32
{FA6F9217-E2BB-4586-ACD3-0DFB6C13A257}.Debug|x64.ActiveCfg = Debug|Win32
{FA6F9217-E2BB-4586-ACD3-0DFB6C13A257}.Release|Win32.ActiveCfg = Release|Win32
{FA6F9217-E2BB-4586-ACD3-0DFB6C13A257}.Release|Win32.Build.0 = Release|Win32
{FA6F9217-E2BB-4586-ACD3-0DFB6C13A257}.Release|x64.ActiveCfg = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
13 changes: 13 additions & 0 deletions windows/src/engine/inst/components.wxs
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,10 @@
<File Id="keyman32.dll" Name="keyman32.dll" KeyPath="yes" />
</Component>

<Component Guid="*" SharedDllRefCount="yes">
<File Id="keyman32_ver.dll" Name="keyman32-ver$(var.VERSION_WITH_TAG).dll" KeyPath="yes" Source="..\..\..\bin\engine\keyman32-ver$(var.VERSION_WITH_TAG).dll" />
</Component>

<Component Guid="{1853C94A-0F4C-4D43-AF07-E3F27794FDC9}">
<File Id="keyman.exe" Name="keyman.exe" KeyPath="yes" />
</Component>
Expand Down Expand Up @@ -137,10 +141,19 @@
<File Id="keyman64.dll" Name="keyman64.dll" KeyPath="yes" Source="..\..\..\bin\engine\keyman64.dll" />
</Component>

<Component Guid="*" SharedDllRefCount="yes">
<File Id="keyman64_ver.dll" Name="keyman64-ver$(var.VERSION_WITH_TAG).dll" KeyPath="yes" Source="..\..\..\bin\engine\keyman64-ver$(var.VERSION_WITH_TAG).dll" />
</Component>

<Component Guid="{1D136A8F-BC8C-432F-B82F-822EBBE986F2}">
<File Id="keymanx64.exe" Name='keymanx64.exe' KeyPath="yes" Source="..\..\..\bin\engine\keymanx64.exe" />
</Component>

<Component Id="Reg_KeymanVersion" Guid="*">
<RegistryValue KeyPath="yes" Root="HKLM" Key="Software\Keyman\Keyman Engine" Name="keyman32 name" Type="string" Value="keyman32-ver$(var.VERSION_WITH_TAG).dll" />
<RegistryValue Root="HKLM" Key="Software\Keyman\Keyman Engine" Name="keyman64 name" Type="string" Value="keyman64-ver$(var.VERSION_WITH_TAG).dll" />
</Component>

<Component Guid="{FB88ED52-C8F9-44F8-91F2-D0E377504C0D}">
<File Id="mcompile.exe" Name='mcompile.exe' KeyPath="yes" Source="..\..\..\bin\engine\mcompile.exe" />
</Component>
Expand Down
2 changes: 1 addition & 1 deletion windows/src/engine/inst/download.in
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ clean:
rem

candle:
$(WIXCANDLE) -dVERSION=$VersionWin -dRELEASE=$VersionRelease -ext WixUtilExtension keymanengine.wxs components.wxs
$(WIXCANDLE) -dVERSION=$VersionWin -dRELEASE=$VersionRelease -dVERSION_WITH_TAG=$VersionWithTag -ext WixUtilExtension keymanengine.wxs components.wxs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

#include "pch.h"
#include "keyman-debug-etw.h"
#include "../keyman32/keyman-debug-etw.h"

#ifdef _WIN64
#define DEBUG_PLATFORM_STRING "x64"
Expand Down
52 changes: 52 additions & 0 deletions windows/src/engine/keyman32-ver/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
#
# Keyman32-ver Makefile
#

!include ..\..\Defines.mak

build: version.res dirs pull-core
$(MKVER_U) premake.in premake.mak
$(MKVER_U) $(ROOT)\src\engine\keyman32-ver\keyman64-build-version.in $(ROOT)\src\engine\keyman32-ver\keyman64-build-version.h
$(MKVER_U) keyman32-ver.in keyman32-ver.def
$(MAKE) -fpremake.mak build

clean: def-clean
$(MKVER_U) premake.in premake.mak
$(MAKE) -fpremake.mak clean

signcode:
$(MKVER_U) premake.in premake.mak
$(MAKE) -fpremake.mak signcode

wrap-symbols:
$(MKVER_U) premake.in premake.mak
$(MAKE) -fpremake.mak wrap-symbols

install:
$(MKVER_U) premake.in premake.mak
$(MAKE) -fpremake.mak install

!ifdef DEBUG
CORE_DEBUG=--debug
MESON_TARGET=debug
!else
MESON_TARGET=release
!endif

!ifdef GIT_BASH_FOR_KEYMAN
CALLER=$(GIT_BASH_FOR_KEYMAN)
!else
CALLER=start /wait
!endif
!ifdef DEBUG
BUILD_DEBUG=-d
!else
BUILD_DEBUG=
!endif

pull-core:
cd $(ROOT)\..\core
$(CALLER) ./build.sh --no-tests clean:x86 configure:x86 build:x86 clean:x64 configure:x64 build:x64 $(BUILD_DEBUG)
cd $(ROOT)\src\engine\keyman32-ver

!include ..\..\Target.mak
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@

typedef BOOL (WINAPI *InitDllFunction)(PSTR name);

#ifdef _WIN64
const wchar_t keyman_engine_arch[] = L"keyman64.dll";
#else
const wchar_t keyman_engine_arch[] = L"keyman32.dll";
#endif

/* Add a dll to the list of dlls associated with the keyboard */
// core processor implementation also uses this function
static LPIMDLL AddIMDLL(LPINTKEYBOARDINFO lpkbi, LPSTR kbdpath, LPSTR dllfilename)
Expand Down Expand Up @@ -227,6 +233,15 @@ BOOL UnloadDLLs(LPINTKEYBOARDINFO lpkbi)

if (lpkbi->lpCoreKeyboardState) {
km_core_state_imx_deregister_callback(lpkbi->lpCoreKeyboardState);
PKEYMAN64THREADDATA _td = ThreadGlobals();
if (!_td) {
return FALSE;
}
if (_td->hModuleProxy) {
FreeLibrary(_td->hModuleProxy);
_td->hModuleProxy = NULL;
}

}
return TRUE;
}
Expand Down Expand Up @@ -575,11 +590,46 @@ LoadDLLs(LPINTKEYBOARDINFO lpkbi) {

if (!GetKeyboardFileName(lpkbi->Name, fullname, _MAX_PATH))
return FALSE;
if ((!lpkbi->lpCoreKeyboard) || (!lpkbi->lpCoreKeyboard)){
if (!lpkbi->lpCoreKeyboard){
return FALSE;
}

PKEYMAN64THREADDATA _td = ThreadGlobals();
if (!_td){
return FALSE;
}

km_core_keyboard_imx *imx_list = lpkbi->lpIMXList;
// return early if the list empty avoiding loading the proxy dll into memory
if (!imx_list->library_name) {
return FALSE;
}

if (!_td->hModuleProxy) {
wchar_t module_filename[_MAX_PATH];
if(!GetModuleFileNameW(g_hInstance, module_filename, _MAX_PATH)){
SendDebugMessageFormat(0, sdmKeyboard, 0, "LoadDLLsCore: unable to get handle for loaded keyman versioned dll; error:[%d]", GetLastError());
return FALSE;
}

wchar_t *p = wcsrchr(module_filename, '\\'); // find last occurrence of '\'
if (p != NULL) {
size_t len = wcslen(keyman_engine_arch);
// We know that the arch filename is shorter than the versioned filename so this
// should always be safe, just insure we insert the null character
wcsncpy_s(p, _MAX_PATH - (p - module_filename), keyman_engine_arch, len);
_td->hModuleProxy = LoadLibraryW(module_filename);
if (!_td->hModuleProxy) {
SendDebugMessageFormat(0, sdmKeyboard, 0, "LoadDLLsCore: [%s] not loaded with error:[%d]", module_filename, GetLastError());
return FALSE;
}
}
else {
SendDebugMessageFormat(0, sdmKeyboard, 0, "LoadDLLsCore: unable to find path for keyman versioned dll");
return FALSE;
}
}

BOOL result = false;
for (; imx_list->library_name; ++imx_list) {
LPIMDLL imd = AddIMDLL(lpkbi, fullname, wstrtostr(reinterpret_cast<LPCWSTR>(imx_list->library_name)));
Expand Down
Loading