mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 19:45:39 +00:00
[USETUP] Do not put ImagePath to the service registry entry
It is supposed to be there already
This commit is contained in:
parent
e5254974d2
commit
e12233daf6
1 changed files with 1 additions and 36 deletions
|
@ -63,10 +63,8 @@ InstallDriver(
|
||||||
IN LPCWSTR DeviceId,
|
IN LPCWSTR DeviceId,
|
||||||
IN LPCWSTR HardwareId)
|
IN LPCWSTR HardwareId)
|
||||||
{
|
{
|
||||||
UNICODE_STRING PathPrefix = RTL_CONSTANT_STRING(L"System32\\DRIVERS\\");
|
|
||||||
UNICODE_STRING ServiceU = RTL_CONSTANT_STRING(L"Service");
|
UNICODE_STRING ServiceU = RTL_CONSTANT_STRING(L"Service");
|
||||||
UNICODE_STRING ErrorControlU = RTL_CONSTANT_STRING(L"ErrorControl");
|
UNICODE_STRING ErrorControlU = RTL_CONSTANT_STRING(L"ErrorControl");
|
||||||
UNICODE_STRING ImagePathU = RTL_CONSTANT_STRING(L"ImagePath");
|
|
||||||
UNICODE_STRING StartU = RTL_CONSTANT_STRING(L"Start");
|
UNICODE_STRING StartU = RTL_CONSTANT_STRING(L"Start");
|
||||||
UNICODE_STRING TypeU = RTL_CONSTANT_STRING(L"Type");
|
UNICODE_STRING TypeU = RTL_CONSTANT_STRING(L"Type");
|
||||||
UNICODE_STRING UpperFiltersU = RTL_CONSTANT_STRING(L"UpperFilters");
|
UNICODE_STRING UpperFiltersU = RTL_CONSTANT_STRING(L"UpperFilters");
|
||||||
|
@ -78,7 +76,6 @@ InstallDriver(
|
||||||
HANDLE hService;
|
HANDLE hService;
|
||||||
INFCONTEXT Context;
|
INFCONTEXT Context;
|
||||||
PCWSTR Driver, ClassGuid, ImagePath;
|
PCWSTR Driver, ClassGuid, ImagePath;
|
||||||
PWSTR FullImagePath;
|
|
||||||
ULONG dwValue;
|
ULONG dwValue;
|
||||||
ULONG Disposition;
|
ULONG Disposition;
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
|
@ -114,20 +111,6 @@ InstallDriver(
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Prepare full driver path */
|
|
||||||
dwValue = PathPrefix.MaximumLength + wcslen(ImagePath) * sizeof(WCHAR);
|
|
||||||
FullImagePath = (PWSTR)RtlAllocateHeap(ProcessHeap, 0, dwValue);
|
|
||||||
if (!FullImagePath)
|
|
||||||
{
|
|
||||||
DPRINT1("RtlAllocateHeap() failed\n");
|
|
||||||
INF_FreeData(ImagePath);
|
|
||||||
INF_FreeData(ClassGuid);
|
|
||||||
INF_FreeData(Driver);
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
RtlCopyMemory(FullImagePath, PathPrefix.Buffer, PathPrefix.MaximumLength);
|
|
||||||
ConcatPaths(FullImagePath, dwValue / sizeof(WCHAR), 1, ImagePath);
|
|
||||||
|
|
||||||
DPRINT1("Using driver '%S' for device '%S'\n", ImagePath, DeviceId);
|
DPRINT1("Using driver '%S' for device '%S'\n", ImagePath, DeviceId);
|
||||||
|
|
||||||
/* Create service key */
|
/* Create service key */
|
||||||
|
@ -137,7 +120,6 @@ InstallDriver(
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
DPRINT1("NtCreateKey('%wZ') failed with status 0x%08x\n", &StringU, Status);
|
DPRINT1("NtCreateKey('%wZ') failed with status 0x%08x\n", &StringU, Status);
|
||||||
RtlFreeHeap(ProcessHeap, 0, FullImagePath);
|
|
||||||
INF_FreeData(ImagePath);
|
INF_FreeData(ImagePath);
|
||||||
INF_FreeData(ClassGuid);
|
INF_FreeData(ClassGuid);
|
||||||
INF_FreeData(Driver);
|
INF_FreeData(Driver);
|
||||||
|
@ -171,15 +153,9 @@ InstallDriver(
|
||||||
&dwValue,
|
&dwValue,
|
||||||
sizeof(dwValue));
|
sizeof(dwValue));
|
||||||
}
|
}
|
||||||
/* HACK: don't put any path in registry */
|
|
||||||
NtSetValueKey(hService,
|
|
||||||
&ImagePathU,
|
|
||||||
0,
|
|
||||||
REG_SZ,
|
|
||||||
(PVOID)ImagePath,
|
|
||||||
(wcslen(ImagePath) + 1) * sizeof(WCHAR));
|
|
||||||
|
|
||||||
INF_FreeData(ImagePath);
|
INF_FreeData(ImagePath);
|
||||||
|
NtClose(hService);
|
||||||
|
|
||||||
/* Add kbdclass and partmgr upper filters */
|
/* Add kbdclass and partmgr upper filters */
|
||||||
if (ClassGuid &&_wcsicmp(ClassGuid, L"{4D36E96B-E325-11CE-BFC1-08002BE10318}") == 0)
|
if (ClassGuid &&_wcsicmp(ClassGuid, L"{4D36E96B-E325-11CE-BFC1-08002BE10318}") == 0)
|
||||||
|
@ -220,17 +196,6 @@ InstallDriver(
|
||||||
|
|
||||||
INF_FreeData(Driver);
|
INF_FreeData(Driver);
|
||||||
|
|
||||||
/* HACK: Update driver path */
|
|
||||||
NtSetValueKey(hService,
|
|
||||||
&ImagePathU,
|
|
||||||
0,
|
|
||||||
REG_SZ,
|
|
||||||
FullImagePath,
|
|
||||||
(wcslen(FullImagePath) + 1) * sizeof(WCHAR));
|
|
||||||
RtlFreeHeap(ProcessHeap, 0, FullImagePath);
|
|
||||||
|
|
||||||
NtClose(hService);
|
|
||||||
|
|
||||||
return deviceInstalled;
|
return deviceInstalled;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue