10#define WIN32_NO_STATUS
14#define ROSTESTDHCPHOST "testdhcproshost"
15#define ROSTESTDHCPDOMAIN "testrosdomain"
28 "System\\CurrentControlSet\\Services\\Tcpip\\Parameters",
67 "System\\CurrentControlSet\\Services\\Tcpip\\Parameters",
96 "System\\CurrentControlSet\\Services\\Tcpip\\Parameters",
117 CHAR OrigHostname[128];
118 CHAR OrigDomainName[128];
119 CHAR OrigDhcpHostname[128];
120 CHAR OrigDhcpDomainName[128];
121 BOOL OrigHostnameExists;
122 BOOL OrigDomainNameExists;
123 BOOL OrigDhcpHostnameExists;
124 BOOL OrigDhcpDomainNameExists;
128 memset(OrigHostname, 0,
sizeof(OrigHostname));
129 memset(OrigDomainName, 0,
sizeof(OrigDomainName));
130 memset(OrigDhcpHostname, 0,
sizeof(OrigDhcpHostname));
131 memset(OrigDhcpDomainName, 0,
sizeof(OrigDhcpDomainName));
146 trace(
"Starting values:\n");
147 trace(
"Hostname: %s, exists %s\n", OrigHostname, OrigHostnameExists ?
"yes" :
"no");
148 trace(
"Domain: %s, exists %s\n", OrigDomainName, OrigDomainNameExists ?
"yes" :
"no");
149 trace(
"DhcpHostname: %s, exists %s\n", OrigDhcpHostnameExists ? OrigDhcpHostname :
"", OrigDhcpHostnameExists ?
"yes" :
"no");
150 trace(
"DhcpDomain: %s, exists %s\n", OrigDhcpDomainNameExists ? OrigDhcpDomainName :
"", OrigDhcpDomainNameExists ?
"yes" :
"no");
154 "GetNetworkParams returned %ld, expected ERROR_BUFFER_OVERFLOW\n",
157 skip(
"Can't determine size of FIXED_INFO. Can't proceed\n");
159 if (FixedInfo ==
NULL)
160 skip(
"FixedInfo is NULL. Can't proceed\n");
164 "GetNetworkParams(buf, &dwSize) returned %ld, expected NO_ERROR\n",
169 skip(
"GetNetworkParams failed. Can't proceed\n");
175 skip(
"FixedInfo->HostName is NULL. Can't proceed\n");
177 if (OrigDhcpHostnameExists)
183 ok(
strcmp(FixedInfo->
HostName, OrigHostname) == 0,
"FixedInfo->HostName is wrong '%s' != '%s'\n", FixedInfo->
HostName, OrigHostname);
188 skip(
"FixedInfo->DomainName is NULL. Can't proceed\n");
190 if(OrigDhcpDomainNameExists)
191 ok(
strcmp(FixedInfo->
DomainName, OrigDhcpDomainName) == 0,
"FixedInfo->DomainName is wrong '%s' != '%s'\n", FixedInfo->
DomainName, OrigDhcpDomainName);
193 ok(
strcmp(FixedInfo->
DomainName, OrigDomainName) == 0,
"FixedInfo->DomainName is wrong '%s' != '%s'\n", FixedInfo->
DomainName, OrigDomainName);
194 if (!OrigDhcpHostnameExists)
204 if (!OrigDhcpDomainNameExists)
219 "GetNetworkParams returned %ld, expected ERROR_BUFFER_OVERFLOW\n",
222 skip(
"Can't determine size of FIXED_INFO. Can't proceed\n");
224 if (FixedInfo ==
NULL)
225 skip(
"FixedInfo is NULL. Can't proceed\n");
228 "GetNetworkParams(buf, &dwSize) returned %ld, expected NO_ERROR\n",
233 skip(
"GetNetworkParams failed. Can't proceed\n");
237 if (OrigDhcpHostnameExists)
242 if (OrigDhcpDomainNameExists)
249 "GetNetworkParams(buf, &dwSize) returned %ld, expected NO_ERROR\n",
253 skip(
"FixedInfo->HostName is NULL. Can't proceed\n");
254 if (!OrigDhcpHostnameExists)
260 ok(
strcmp(FixedInfo->
HostName, OrigHostname) == 0,
"FixedInfo->HostName is wrong '%s' != '%s'\n", FixedInfo->
HostName, OrigHostname);
263 skip(
"FixedInfo->DomainName is NULL. Can't proceed\n");
264 if (!OrigDhcpDomainNameExists)
267 ok(
strcmp(FixedInfo->
DomainName, OrigDomainName) == 0,
"FixedInfo->DomainName is wrong '%s' != '%s'\n", FixedInfo->
DomainName, OrigDomainName);
static INT ReadRegistryValue(PCHAR ValueName, PCHAR Value)
#define ROSTESTDHCPDOMAIN
static INT WriteRegistryValue(PCHAR ValueName, PCHAR Value)
static VOID test_GetNetworkParams(VOID)
static INT DeleteRegistryValue(PCHAR ValueName)
int strcmp(const char *String1, const char *String2)
#define RegCloseKey(hKey)
LONG WINAPI RegSetValueExA(HKEY hKey, LPCSTR lpValueName, DWORD Reserved, DWORD dwType, CONST BYTE *lpData, DWORD cbData)
LONG WINAPI RegOpenKeyExA(_In_ HKEY hKey, _In_ LPCSTR lpSubKey, _In_ DWORD ulOptions, _In_ REGSAM samDesired, _Out_ PHKEY phkResult)
LONG WINAPI RegDeleteValueA(HKEY hKey, LPCSTR lpValueName)
LONG WINAPI RegQueryValueExA(_In_ HKEY hkeyorg, _In_ LPCSTR name, _In_ LPDWORD reserved, _Out_opt_ LPDWORD type, _Out_opt_ LPBYTE data, _Inout_opt_ LPDWORD count)
#define HeapFree(x, y, z)
DWORD WINAPI GetNetworkParams(PFIXED_INFO pFixedInfo, PULONG pOutBufLen)
int WINAPI lstrlenA(LPCSTR lpString)
#define ERROR_FILE_NOT_FOUND
_In_ NDIS_ERROR_CODE ErrorCode
char HostName[MAX_HOSTNAME_LEN+4]
char DomainName[MAX_DOMAIN_NAME_LEN+4]
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING ValueName
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING _Out_opt_ PUSHORT _Inout_opt_ PUNICODE_STRING Value
#define ERROR_BUFFER_OVERFLOW
#define HKEY_LOCAL_MACHINE