https://git.reactos.org/?p=reactos.git;a=commitdiff;h=2c244eafe031bf1696d7a…
commit 2c244eafe031bf1696d7a292cca6bf325abc7d82
Author: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
AuthorDate: Wed Oct 5 23:19:48 2022 +0200
Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
CommitDate: Thu Oct 6 15:52:20 2022 +0200
[IMM32][LPK] Remove msvcrt dependency; fix entrypoint. (#4759)
---
dll/win32/imm32/CMakeLists.txt | 4 ++--
dll/win32/imm32/imm.c | 14 +++++++++-----
dll/win32/lpk/CMakeLists.txt | 7 +++----
dll/win32/lpk/lpk.c | 21 ++++++---------------
dll/win32/lpk/lpk.spec | 1 -
dll/win32/lpk/ros_lpk.h | 1 -
6 files changed, 20 insertions(+), 28 deletions(-)
diff --git a/dll/win32/imm32/CMakeLists.txt b/dll/win32/imm32/CMakeLists.txt
index a0c518040aa..ba1f56641c4 100644
--- a/dll/win32/imm32/CMakeLists.txt
+++ b/dll/win32/imm32/CMakeLists.txt
@@ -22,7 +22,7 @@ list(APPEND SOURCE
${CMAKE_CURRENT_BINARY_DIR}/imm32.def)
add_library(imm32 MODULE ${SOURCE} version.rc)
-set_module_type(imm32 win32dll)
+set_module_type(imm32 win32dll UNICODE ENTRYPOINT ImmDllInitialize 12)
target_link_libraries(imm32 wine win32ksys)
-add_importlibs(imm32 advapi32 user32 gdi32 msvcrt kernel32 ntdll)
+add_importlibs(imm32 advapi32 user32 gdi32 kernel32 ntdll)
add_cd_file(TARGET imm32 DESTINATION reactos/system32 FOR all)
diff --git a/dll/win32/imm32/imm.c b/dll/win32/imm32/imm.c
index 2a87fc945ee..8f7f14764d9 100644
--- a/dll/win32/imm32/imm.c
+++ b/dll/win32/imm32/imm.c
@@ -1241,18 +1241,22 @@ BOOL WINAPI ImmSetActiveContextConsoleIME(HWND hwnd, BOOL fFlag)
BOOL WINAPI User32InitializeImmEntryTable(DWORD);
-// Win: ImmDllInitialize
-BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpReserved)
+BOOL
+WINAPI
+ImmDllInitialize(
+ _In_ HANDLE hDll,
+ _In_ ULONG dwReason,
+ _In_opt_ PVOID pReserved)
{
HKL hKL;
HIMC hIMC;
- TRACE("(%p, 0x%X, %p)\n", hinstDLL, fdwReason, lpReserved);
+ TRACE("(%p, 0x%X, %p)\n", hDll, dwReason, pReserved);
- switch (fdwReason)
+ switch (dwReason)
{
case DLL_PROCESS_ATTACH:
- if (!ImmInitializeGlobals(hinstDLL))
+ if (!ImmInitializeGlobals(hDll))
{
ERR("ImmInitializeGlobals failed\n");
return FALSE;
diff --git a/dll/win32/lpk/CMakeLists.txt b/dll/win32/lpk/CMakeLists.txt
index 25fd9339ea7..4ab0fdaf4a4 100644
--- a/dll/win32/lpk/CMakeLists.txt
+++ b/dll/win32/lpk/CMakeLists.txt
@@ -13,12 +13,11 @@ list(APPEND SOURCE
add_library(lpk MODULE
${SOURCE}
lpk.rc
+ ${CMAKE_CURRENT_BINARY_DIR}/lpk_stubs.c
${CMAKE_CURRENT_BINARY_DIR}/lpk.def)
-set_module_type(lpk win32dll UNICODE)
-
+set_module_type(lpk win32dll UNICODE ENTRYPOINT LpkDllInitialize 12)
target_link_libraries(lpk wine)
-
-add_importlibs(lpk usp10 version user32 gdi32 msvcrt kernel32 ntdll)
+add_importlibs(lpk usp10 version user32 gdi32 kernel32 ntdll)
add_pch(lpk ros_lpk.h SOURCE)
add_cd_file(TARGET lpk DESTINATION reactos/system32 FOR all)
diff --git a/dll/win32/lpk/lpk.c b/dll/win32/lpk/lpk.c
index b4291448bfe..09f2282a95f 100644
--- a/dll/win32/lpk/lpk.c
+++ b/dll/win32/lpk/lpk.c
@@ -159,25 +159,16 @@ done:
SetProcessDefaultLayout(version_layout);
}
-BOOL
-WINAPI
-DllMain(
- HANDLE hDll,
- DWORD dwReason,
- LPVOID lpReserved)
-{
-
- return LpkDllInitialize(hDll,dwReason,lpReserved);
-}
-
BOOL
WINAPI
LpkDllInitialize(
- HANDLE hDll,
- DWORD dwReason,
- LPVOID lpReserved)
+ _In_ HANDLE hDll,
+ _In_ ULONG dwReason,
+ _In_opt_ PVOID pReserved)
{
- switch(dwReason)
+ UNREFERENCED_PARAMETER(pReserved);
+
+ switch (dwReason)
{
case DLL_PROCESS_ATTACH:
DisableThreadLibraryCalls(hDll);
diff --git a/dll/win32/lpk/lpk.spec b/dll/win32/lpk/lpk.spec
index 15a913f6435..c089ef0a5ab 100644
--- a/dll/win32/lpk/lpk.spec
+++ b/dll/win32/lpk/lpk.spec
@@ -1,6 +1,5 @@
@ stdcall LpkInitialize(long)
@ stdcall LpkTabbedTextOut(long long long long long long long long long long long long)
-@ stdcall LpkDllInitialize(ptr long ptr)
@ stdcall LpkDrawTextEx(long long long long long long long long long long)
@ extern LpkEditControl
@ stdcall LpkExtTextOut(long long long long ptr wstr long ptr long)
diff --git a/dll/win32/lpk/ros_lpk.h b/dll/win32/lpk/ros_lpk.h
index 1ed69f77274..44fc8669730 100644
--- a/dll/win32/lpk/ros_lpk.h
+++ b/dll/win32/lpk/ros_lpk.h
@@ -66,7 +66,6 @@ DWORD WINAPI EditAdjustCaret(DWORD x1, DWORD x2, DWORD x3, DWORD x5);
DWORD WINAPI LpkInitialize(DWORD x1);
DWORD WINAPI LpkTabbedTextOut(DWORD x1,DWORD x2,DWORD x3,DWORD x4,DWORD x5,DWORD x6,DWORD
x7,DWORD x8,DWORD x9,DWORD x10,DWORD x11,DWORD x12);
-BOOL WINAPI LpkDllInitialize (HANDLE hDll, DWORD dwReason, LPVOID lpReserved);
DWORD WINAPI LpkDrawTextEx(DWORD x1,DWORD x2,DWORD x3,DWORD x4,DWORD x5,DWORD x6,DWORD
x7,DWORD x8,DWORD x9, DWORD x10);
DWORD WINAPI LpkUseGDIWidthCache(DWORD x1,DWORD x2,DWORD x3,DWORD x4,DWORD x5);
DWORD WINAPI ftsWordBreak(DWORD x1,DWORD x2,DWORD x3,DWORD x4,DWORD x5);