[IMM32][LPK] Remove msvcrt dependency; fix entrypoint. (#4759)

This commit is contained in:
Hermès Bélusca-Maïto 2022-10-05 23:19:48 +02:00
parent 58740bfbc1
commit 2c244eafe0
No known key found for this signature in database
GPG key ID: 3B2539C65E7B93D0
6 changed files with 20 additions and 28 deletions

View file

@ -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)

View file

@ -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;

View file

@ -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)

View file

@ -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);

View file

@ -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)

View file

@ -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);