From d6cc284435eee971bdd9e9fb1ca03e4cd9113e1e Mon Sep 17 00:00:00 2001 From: Katayama Hirofumi MZ Date: Thu, 23 Apr 2026 22:50:03 +0900 Subject: [PATCH] [SHELL32][SDK] Implement LinkWindow_RegisterClass (#8878) Implementing missing features... JIRA issue: CORE-19278 - Implement LinkWindow_RegisterClass function by using "superclassing". - Add prototype to . --- dll/win32/shell32/utils.cpp | 28 ++++++++++++++++++++++++++++ dll/win32/shell32/wine/shellord.c | 2 ++ sdk/include/reactos/undocshell.h | 3 +++ 3 files changed, 33 insertions(+) diff --git a/dll/win32/shell32/utils.cpp b/dll/win32/shell32/utils.cpp index de7c84184e9..ef461aff193 100644 --- a/dll/win32/shell32/utils.cpp +++ b/dll/win32/shell32/utils.cpp @@ -2189,3 +2189,31 @@ SHELL32_AliasTranslatePidl( { return SHELL32_ReparentAsAliasPidl(NULL, NULL, pidl, ppidlNew, dwFlags) ? S_OK : E_FAIL; } + +/************************************************************************* + * LinkWindow_RegisterClass (SHELL32.258) + * + * https://learn.microsoft.com/en-us/windows/win32/shell/linkwindow-registerclass + */ +EXTERN_C BOOL WINAPI LinkWindow_RegisterClass(VOID) +{ + INITCOMMONCONTROLSEX iccx = { sizeof(iccx), ICC_LINK_CLASS }; + InitCommonControlsEx(&iccx); + + WNDCLASSEXW wcx = { sizeof(wcx) }; + if (!GetClassInfoExW(NULL, L"SysLink", &wcx)) + return FALSE; + + /* Superclassing! */ + wcx.lpszClassName = L"Link Window"; + return RegisterClassExW(&wcx) || (GetLastError() == ERROR_CLASS_ALREADY_EXISTS); +} + +/************************************************************************* + * LinkWindow_UnregisterClass (SHELL32.259) + */ +EXTERN_C BOOL WINAPI LinkWindow_UnregisterClass(_In_ DWORD dwUnused) +{ + /* Do nothing. This is correct. */ + return TRUE; +} diff --git a/dll/win32/shell32/wine/shellord.c b/dll/win32/shell32/wine/shellord.c index db31c9f1134..1a39573a372 100644 --- a/dll/win32/shell32/wine/shellord.c +++ b/dll/win32/shell32/wine/shellord.c @@ -2640,6 +2640,7 @@ HRESULT WINAPI SHSetLocalizedName(LPCWSTR pszPath, LPCWSTR pszResModule, int ids return S_OK; } +#ifndef __REACTOS__ // See ../utils.cpp /************************************************************************* * LinkWindow_RegisterClass (SHELL32.258) */ @@ -2657,6 +2658,7 @@ BOOL WINAPI LinkWindow_UnregisterClass(DWORD dwUnused) FIXME("()\n"); return TRUE; } +#endif /************************************************************************* * SHFlushSFCache (SHELL32.526) diff --git a/sdk/include/reactos/undocshell.h b/sdk/include/reactos/undocshell.h index 82017390187..02660883c71 100644 --- a/sdk/include/reactos/undocshell.h +++ b/sdk/include/reactos/undocshell.h @@ -910,6 +910,9 @@ Activate_RunDLL( BOOL WINAPI SHSettingsChanged(LPCVOID unused, LPCWSTR pszKey); +BOOL WINAPI LinkWindow_RegisterClass(VOID); +BOOL WINAPI LinkWindow_UnregisterClass(_In_ DWORD dwUnused); + /***************************************************************************** * Shell32 resources */