22#define COMPUTER_DESCRIPTIONS_KEY \
23 L"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\ComputerDescriptions"
54 cchDescMax *=
sizeof(
WCHAR);
67 if (!pszDescription || !*pszDescription)
98 ok_wstr(szDisplayName, szCompName);
104 ok_wstr(szServerName,
L"DummyServerName");
127 skip(
"Tests on Vista+ will cause exception\n");
136 skip(
"SHGetComputerDisplayNameW not found\n");
143 skip(
"netapi32.dll not found\n");
151 skip(
"NetServerGetInfo or NetApiBufferFree not found\n");
static VOID TEST_SHGetComputerDisplayNameW(VOID)
static HRESULT SHELL_BuildDisplayMachineName(_Out_writes_z_(cchNameMax) PWSTR pszName, _In_ DWORD cchNameMax, _In_ PCWSTR pszServerName, _In_ PCWSTR pszDescription)
static FN_SHGetComputerDisplayNameW s_pSHGetComputerDisplayNameW
static VOID SHELL_CacheComputerDescription(_In_ PCWSTR pszServerName, _In_ PCWSTR pszDesc)
static FN_NetServerGetInfo s_pNetServerGetInfo
HRESULT(WINAPI * FN_SHGetComputerDisplayNameW)(PWSTR, DWORD, PWSTR, DWORD)
NET_API_STATUS(WINAPI * FN_NetApiBufferFree)(PVOID)
static HRESULT SHELL_GetCachedComputerDescription(_Out_writes_z_(cchDescMax) PWSTR pszDesc, _In_ DWORD cchDescMax, _In_ PCWSTR pszServerName)
#define COMPUTER_DESCRIPTIONS_KEY
static FN_NetApiBufferFree s_pNetApiBufferFree
NET_API_STATUS(WINAPI * FN_NetServerGetInfo)(LPWSTR, DWORD, PBYTE *)
static PCWSTR SHELL_SkipServerSlashes(_In_ PCWSTR pszPath)
#define ok_hex(expression, result)
#define ok_int(expression, result)
#define RegCloseKey(hKey)
BOOL WINAPI GetComputerNameW(LPWSTR lpBuffer, LPDWORD lpnSize)
static LSTATUS(WINAPI *pRegDeleteTreeW)(HKEY
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
LONG WINAPI RegDeleteValueW(HKEY hKey, LPCWSTR lpValueName)
#define GetProcAddress(x, y)
HMODULE WINAPI GetModuleHandleW(LPCWSTR lpModuleName)
EXTERN_C HRESULT WINAPI SHGetComputerDisplayNameW(_In_opt_ PWSTR pszServerName, _In_ DWORD dwFlags, _Out_writes_z_(cchNameMax) PWSTR pszName, _In_ DWORD cchNameMax)
DWORD WINAPI SHGetValueW(HKEY hKey, LPCWSTR lpszSubKey, LPCWSTR lpszValue, LPDWORD pwType, LPVOID pvData, LPDWORD pcbData)
DWORD WINAPI SHSetValueW(HKEY hKey, LPCWSTR lpszSubKey, LPCWSTR lpszValue, DWORD dwType, LPCVOID pvData, DWORD cbData)
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define _Out_writes_z_(s)
static const WCHAR szName[]
@ REST_ALLOWCOMMENTTOGGLE
DWORD WINAPI SHRestricted(RESTRICTIONS rest)
STRSAFEAPI StringCchCopyW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszSrc)
VERSIONHELPERAPI IsWindowsVistaOrGreater()
#define FORMAT_MESSAGE_FROM_STRING
#define FORMAT_MESSAGE_ARGUMENT_ARRAY
#define MAX_COMPUTERNAME_LENGTH
#define HRESULT_FROM_WIN32(x)
#define HKEY_CURRENT_USER
#define MAKEINTRESOURCEA(i)