mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 04:43:51 +00:00
Fix the HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Linkage\Export value. The GUID needs to be prepended by "Tcpip_"
svn path=/trunk/; revision=18460
This commit is contained in:
parent
901449fbf7
commit
d1509ade59
1 changed files with 17 additions and 6 deletions
|
@ -104,6 +104,7 @@ NetClassInstaller(
|
||||||
LPWSTR UuidRpcString = NULL;
|
LPWSTR UuidRpcString = NULL;
|
||||||
LPWSTR UuidString = NULL;
|
LPWSTR UuidString = NULL;
|
||||||
LPWSTR DeviceName = NULL;
|
LPWSTR DeviceName = NULL;
|
||||||
|
LPWSTR ExportName = NULL;
|
||||||
LONG rc;
|
LONG rc;
|
||||||
HKEY hKey = INVALID_HANDLE_VALUE;
|
HKEY hKey = INVALID_HANDLE_VALUE;
|
||||||
HKEY hLinkageKey = INVALID_HANDLE_VALUE;
|
HKEY hLinkageKey = INVALID_HANDLE_VALUE;
|
||||||
|
@ -152,6 +153,17 @@ NetClassInstaller(
|
||||||
wcscpy(DeviceName, L"\\Device\\");
|
wcscpy(DeviceName, L"\\Device\\");
|
||||||
wcscat(DeviceName, UuidString);
|
wcscat(DeviceName, UuidString);
|
||||||
|
|
||||||
|
/* Create export name */
|
||||||
|
ExportName = HeapAlloc(GetProcessHeap(), 0, (wcslen(L"\\Device\\Tcpip_") + wcslen(UuidString)) * sizeof(WCHAR) + sizeof(UNICODE_NULL));
|
||||||
|
if (!ExportName)
|
||||||
|
{
|
||||||
|
DPRINT("HeapAlloc() failed\n");
|
||||||
|
rc = ERROR_NOT_ENOUGH_MEMORY;
|
||||||
|
goto cleanup;
|
||||||
|
}
|
||||||
|
wcscpy(ExportName, L"\\Device\\Tcpip_");
|
||||||
|
wcscat(ExportName, UuidString);
|
||||||
|
|
||||||
/* Write Tcpip parameters in new service Key */
|
/* Write Tcpip parameters in new service Key */
|
||||||
rc = RegCreateKeyExW(HKEY_LOCAL_MACHINE, L"SYSTEM\\CurrentControlSet\\Services", 0, NULL, REG_OPTION_NON_VOLATILE, 0, NULL, &hKey, NULL);
|
rc = RegCreateKeyExW(HKEY_LOCAL_MACHINE, L"SYSTEM\\CurrentControlSet\\Services", 0, NULL, REG_OPTION_NON_VOLATILE, 0, NULL, &hKey, NULL);
|
||||||
if (rc != ERROR_SUCCESS)
|
if (rc != ERROR_SUCCESS)
|
||||||
|
@ -269,22 +281,21 @@ NetClassInstaller(
|
||||||
rc = AppendStringToMultiSZ(hKey, L"Bind", DeviceName);
|
rc = AppendStringToMultiSZ(hKey, L"Bind", DeviceName);
|
||||||
if (rc != ERROR_SUCCESS)
|
if (rc != ERROR_SUCCESS)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
rc = AppendStringToMultiSZ(hKey, L"Export", DeviceName);
|
rc = AppendStringToMultiSZ(hKey, L"Export", ExportName);
|
||||||
if (rc != ERROR_SUCCESS)
|
if (rc != ERROR_SUCCESS)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
rc = AppendStringToMultiSZ(hKey, L"Route", UuidString);
|
rc = AppendStringToMultiSZ(hKey, L"Route", UuidString);
|
||||||
if (rc != ERROR_SUCCESS)
|
if (rc != ERROR_SUCCESS)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
rc = ERROR_DI_DO_DEFAULT;
|
rc = ERROR_SUCCESS;
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
if (UuidRpcString != NULL)
|
if (UuidRpcString != NULL)
|
||||||
RpcStringFreeW(&UuidRpcString);
|
RpcStringFreeW(&UuidRpcString);
|
||||||
if (UuidString != NULL)
|
|
||||||
HeapFree(GetProcessHeap(), 0, UuidString);
|
HeapFree(GetProcessHeap(), 0, UuidString);
|
||||||
if (DeviceName != NULL)
|
|
||||||
HeapFree(GetProcessHeap(), 0, DeviceName);
|
HeapFree(GetProcessHeap(), 0, DeviceName);
|
||||||
|
HeapFree(GetProcessHeap(), 0, ExportName);
|
||||||
if (hKey != INVALID_HANDLE_VALUE)
|
if (hKey != INVALID_HANDLE_VALUE)
|
||||||
RegCloseKey(hKey);
|
RegCloseKey(hKey);
|
||||||
if (hLinkageKey != INVALID_HANDLE_VALUE)
|
if (hLinkageKey != INVALID_HANDLE_VALUE)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue