[SHELL32][SHELL32_APITEST][SDK] Implement SHGetUserDisplayName (#7612)

Implemementing missing features...
JIRA issue: CORE-19278
- Add netapi32 and secur32 delay importing.
- Move function definition from stubs.cpp into utils.cpp.
- Include some security headers in utils.cpp.
- Adapt <secext.h> to C++.
- Add prototype to <undocshell.h>.
This commit is contained in:
Katayama Hirofumi MZ 2025-01-17 09:33:52 +09:00 committed by GitHub
parent ee5ff8ce0c
commit fcbcaa10a7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 114 additions and 14 deletions

View file

@ -41,6 +41,7 @@ list(APPEND SOURCE
ShellInfo.cpp
ShellState.cpp
SHGetAttributesFromDataObject.cpp
SHGetUserDisplayName.cpp
SHLimitInputEdit.cpp
menu.cpp
shelltest.cpp)

View file

@ -0,0 +1,30 @@
/*
* PROJECT: ReactOS API tests
* LICENSE: GPL-2.0+ (https://spdx.org/licenses/GPL-2.0+)
* PURPOSE: Test for SHGetUserDisplayName
* COPYRIGHT: Copyright 2025 Katayama Hirofumi MZ (katayama.hirofumi.mz@gmail.com)
*/
#include "shelltest.h"
#include <undocshell.h>
START_TEST(SHGetUserDisplayName)
{
HRESULT hr;
WCHAR szBuf[MAX_PATH];
ULONG cchBuf;
hr = SHGetUserDisplayName(NULL, NULL);
ok_hex(hr, E_INVALIDARG);
hr = SHGetUserDisplayName(szBuf, NULL);
ok_hex(hr, E_INVALIDARG);
cchBuf = _countof(szBuf);
hr = SHGetUserDisplayName(NULL, &cchBuf);
ok_hex(hr, E_INVALIDARG);
cchBuf = _countof(szBuf);
hr = SHGetUserDisplayName(szBuf, &cchBuf);
ok_hex(hr, S_OK);
}

View file

@ -42,6 +42,7 @@ extern void func_ShellHook(void);
extern void func_ShellState(void);
extern void func_SHGetAttributesFromDataObject(void);
extern void func_SHGetFileInfo(void);
extern void func_SHGetUserDisplayName(void);
extern void func_SHLimitInputEdit(void);
extern void func_SHParseDisplayName(void);
extern void func_SHSimpleIDListFromPath(void);
@ -88,6 +89,7 @@ const struct test winetest_testlist[] =
{ "ShellState", func_ShellState },
{ "SHGetAttributesFromDataObject", func_SHGetAttributesFromDataObject },
{ "SHGetFileInfo", func_SHGetFileInfo },
{ "SHGetUserDisplayName", func_SHGetUserDisplayName },
{ "SHLimitInputEdit", func_SHLimitInputEdit },
{ "SHParseDisplayName", func_SHParseDisplayName },
{ "SHSimpleIDListFromPath", func_SHSimpleIDListFromPath },