[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) ${CMAKE_CURRENT_BINARY_DIR}/imm32.def)
add_library(imm32 MODULE ${SOURCE} version.rc) 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) 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) 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); BOOL WINAPI User32InitializeImmEntryTable(DWORD);
// Win: ImmDllInitialize BOOL
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpReserved) WINAPI
ImmDllInitialize(
_In_ HANDLE hDll,
_In_ ULONG dwReason,
_In_opt_ PVOID pReserved)
{ {
HKL hKL; HKL hKL;
HIMC hIMC; 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: case DLL_PROCESS_ATTACH:
if (!ImmInitializeGlobals(hinstDLL)) if (!ImmInitializeGlobals(hDll))
{ {
ERR("ImmInitializeGlobals failed\n"); ERR("ImmInitializeGlobals failed\n");
return FALSE; return FALSE;

View file

@ -13,12 +13,11 @@ list(APPEND SOURCE
add_library(lpk MODULE add_library(lpk MODULE
${SOURCE} ${SOURCE}
lpk.rc lpk.rc
${CMAKE_CURRENT_BINARY_DIR}/lpk_stubs.c
${CMAKE_CURRENT_BINARY_DIR}/lpk.def) ${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) target_link_libraries(lpk wine)
add_importlibs(lpk usp10 version user32 gdi32 kernel32 ntdll)
add_importlibs(lpk usp10 version user32 gdi32 msvcrt kernel32 ntdll)
add_pch(lpk ros_lpk.h SOURCE) add_pch(lpk ros_lpk.h SOURCE)
add_cd_file(TARGET lpk DESTINATION reactos/system32 FOR all) add_cd_file(TARGET lpk DESTINATION reactos/system32 FOR all)

View file

@ -159,25 +159,16 @@ done:
SetProcessDefaultLayout(version_layout); SetProcessDefaultLayout(version_layout);
} }
BOOL
WINAPI
DllMain(
HANDLE hDll,
DWORD dwReason,
LPVOID lpReserved)
{
return LpkDllInitialize(hDll,dwReason,lpReserved);
}
BOOL BOOL
WINAPI WINAPI
LpkDllInitialize( LpkDllInitialize(
HANDLE hDll, _In_ HANDLE hDll,
DWORD dwReason, _In_ ULONG dwReason,
LPVOID lpReserved) _In_opt_ PVOID pReserved)
{ {
switch(dwReason) UNREFERENCED_PARAMETER(pReserved);
switch (dwReason)
{ {
case DLL_PROCESS_ATTACH: case DLL_PROCESS_ATTACH:
DisableThreadLibraryCalls(hDll); DisableThreadLibraryCalls(hDll);

View file

@ -1,6 +1,5 @@
@ stdcall LpkInitialize(long) @ stdcall LpkInitialize(long)
@ stdcall LpkTabbedTextOut(long long long long long long long long long long long 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) @ stdcall LpkDrawTextEx(long long long long long long long long long long)
@ extern LpkEditControl @ extern LpkEditControl
@ stdcall LpkExtTextOut(long long long long ptr wstr long ptr long) @ 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 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); 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 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 LpkUseGDIWidthCache(DWORD x1,DWORD x2,DWORD x3,DWORD x4,DWORD x5);
DWORD WINAPI ftsWordBreak(DWORD x1,DWORD x2,DWORD x3,DWORD x4,DWORD x5); DWORD WINAPI ftsWordBreak(DWORD x1,DWORD x2,DWORD x3,DWORD x4,DWORD x5);