[SHELL32][SDK] Implement SHStartNetConnectionDialogA (#5847)

and add SHStartNetConnectionDialog prototype to <shlobj.h>.
This commit is contained in:
Katayama Hirofumi MZ 2023-10-28 22:29:05 +09:00 committed by GitHub
parent a52c713755
commit 128e7f5aea
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 48 additions and 16 deletions

View file

@ -712,22 +712,10 @@ PifMgr_SetProperties(HANDLE hHandle, LPCSTR lpName, LPCVOID lpUnknown, INT iUnkn
*/
EXTERN_C HRESULT
WINAPI
SHStartNetConnectionDialogA(HWND hwnd,
LPCSTR pszRemoteName,
DWORD dwType)
{
FIXME("SHStartNetConnectionDialogA() stub\n");
return E_FAIL;
}
/*
* Unimplemented
*/
EXTERN_C HRESULT
WINAPI
SHStartNetConnectionDialogW(HWND hwnd,
LPCWSTR pszRemoteName,
DWORD dwType)
SHStartNetConnectionDialogW(
_In_ HWND hwnd,
_In_ LPCWSTR pszRemoteName,
_In_ DWORD dwType)
{
FIXME("SHStartNetConnectionDialogW() stub\n");
return E_FAIL;

View file

@ -604,3 +604,29 @@ Activate_RunDLL(
GetWindowThreadProcessId(GetShellWindow(), &dwProcessID);
return AllowSetForegroundWindow(dwProcessID);
}
/*************************************************************************
* SHStartNetConnectionDialogA (SHELL32.12)
*
* @see https://learn.microsoft.com/en-us/windows/win32/api/shlobj_core/nf-shlobj_core-shstartnetconnectiondialoga
*/
EXTERN_C
HRESULT WINAPI
SHStartNetConnectionDialogA(
_In_ HWND hwnd,
_In_ LPCSTR pszRemoteName,
_In_ DWORD dwType)
{
LPCWSTR pszRemoteNameW = NULL;
CStringW strRemoteNameW;
TRACE("(%p, %s, %lu)\n", hwnd, debugstr_a(pszRemoteName), dwType);
if (pszRemoteName)
{
strRemoteNameW = pszRemoteName;
pszRemoteNameW = strRemoteNameW;
}
return SHStartNetConnectionDialogW(hwnd, pszRemoteNameW, dwType);
}

View file

@ -2348,9 +2348,15 @@ BOOL WINAPI SHGetNewLinkInfoW(LPCWSTR pszLinkTo, LPCWSTR pszDir, LPWSTR pszName,
HRESULT WINAPI SHStartNetConnectionDialog(HWND hwnd, LPCSTR pszRemoteName, DWORD dwType)
{
#ifdef __REACTOS__
if (SHELL_OsIsUnicode())
return SHStartNetConnectionDialogW(hwnd, (LPCWSTR)pszRemoteName, dwType);
return SHStartNetConnectionDialogA(hwnd, pszRemoteName, dwType);
#else
FIXME("%p, %s, 0x%08x - stub\n", hwnd, debugstr_a(pszRemoteName), dwType);
return S_OK;
#endif
}
/*************************************************************************
* SHSetLocalizedName (SHELL32.@)

View file

@ -390,6 +390,18 @@ SHOpenPropSheetW(
#define SHOpenPropSheet WINELIB_NAME_AW(SHOpenPropSheet)
HRESULT WINAPI
SHStartNetConnectionDialogA(
_In_ HWND hwnd,
_In_ LPCSTR pszRemoteName,
_In_ DWORD dwType);
HRESULT WINAPI
SHStartNetConnectionDialogW(
_In_ HWND hwnd,
_In_ LPCWSTR pszRemoteName,
_In_ DWORD dwType);
/*****************************************************************************
* IContextMenu interface
*/