mirror of
https://github.com/reactos/reactos.git
synced 2025-04-05 05:01:03 +00:00
DriverEntry is now called with correct parameters
Minor Fix to new build logic svn path=/trunk/; revision=2188
This commit is contained in:
parent
be1ee02554
commit
d6107fdbb1
5 changed files with 41 additions and 10 deletions
|
@ -1,7 +1,9 @@
|
||||||
# $Id: Makefile,v 1.1 2001/08/21 20:18:26 chorns Exp $
|
# $Id: Makefile,v 1.2 2001/08/22 03:53:51 rex Exp $
|
||||||
|
|
||||||
PATH_TO_TOP = ../..
|
PATH_TO_TOP = ../..
|
||||||
|
|
||||||
|
default: all
|
||||||
|
|
||||||
#
|
#
|
||||||
# Build configuration
|
# Build configuration
|
||||||
#
|
#
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
*/
|
||||||
/* $Id: io.h,v 1.10 2001/05/01 23:08:19 chorns Exp $
|
/* $Id: io.h,v 1.11 2001/08/22 03:53:52 rex Exp $
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
|
@ -111,6 +111,7 @@ IopCreateDriverObject(PDRIVER_OBJECT *DriverObject);
|
||||||
NTSTATUS
|
NTSTATUS
|
||||||
IopInitializeDriver(PDRIVER_INITIALIZE DriverEntry,
|
IopInitializeDriver(PDRIVER_INITIALIZE DriverEntry,
|
||||||
PDEVICE_NODE ParentDeviceNode,
|
PDEVICE_NODE ParentDeviceNode,
|
||||||
|
PUNICODE_STRING Filename,
|
||||||
BOOLEAN BootDriversOnly);
|
BOOLEAN BootDriversOnly);
|
||||||
VOID
|
VOID
|
||||||
IoInitCancelHandling(VOID);
|
IoInitCancelHandling(VOID);
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: device.c,v 1.29 2001/06/16 14:07:30 ekohl Exp $
|
/* $Id: device.c,v 1.30 2001/08/22 03:53:52 rex Exp $
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
|
@ -30,6 +30,8 @@
|
||||||
#define TAG_DRIVER_EXTENSION TAG('D', 'R', 'V', 'E')
|
#define TAG_DRIVER_EXTENSION TAG('D', 'R', 'V', 'E')
|
||||||
#define TAG_DEVICE_EXTENSION TAG('D', 'E', 'X', 'T')
|
#define TAG_DEVICE_EXTENSION TAG('D', 'E', 'X', 'T')
|
||||||
|
|
||||||
|
#define DRIVER_REGISTRY_KEY_BASENAME L"\\Registry\\Machine\\System\\CurrentControlSet\\Services\\"
|
||||||
|
|
||||||
/* FUNCTIONS ***************************************************************/
|
/* FUNCTIONS ***************************************************************/
|
||||||
|
|
||||||
|
|
||||||
|
@ -325,6 +327,7 @@ IopCreateDriverObject(PDRIVER_OBJECT *DriverObject)
|
||||||
NTSTATUS
|
NTSTATUS
|
||||||
IopInitializeDriver(PDRIVER_INITIALIZE DriverEntry,
|
IopInitializeDriver(PDRIVER_INITIALIZE DriverEntry,
|
||||||
PDEVICE_NODE DeviceNode,
|
PDEVICE_NODE DeviceNode,
|
||||||
|
PUNICODE_STRING Filename,
|
||||||
BOOLEAN BootDriversOnly)
|
BOOLEAN BootDriversOnly)
|
||||||
/*
|
/*
|
||||||
* FUNCTION: Called to initalize a loaded driver
|
* FUNCTION: Called to initalize a loaded driver
|
||||||
|
@ -338,6 +341,9 @@ IopInitializeDriver(PDRIVER_INITIALIZE DriverEntry,
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
KEVENT Event;
|
KEVENT Event;
|
||||||
PIRP Irp;
|
PIRP Irp;
|
||||||
|
WCHAR DriverName [MAX_PATH];
|
||||||
|
WCHAR RegistryKeyBuffer [MAX_PATH];
|
||||||
|
UNICODE_STRING RegistryKey;
|
||||||
|
|
||||||
DPRINT("IopInitializeDriver (DriverEntry %08lx, DeviceNode %08lx, "
|
DPRINT("IopInitializeDriver (DriverEntry %08lx, DeviceNode %08lx, "
|
||||||
"BootDriversOnly %d)\n", DriverEntry, DeviceNode, BootDriversOnly);
|
"BootDriversOnly %d)\n", DriverEntry, DeviceNode, BootDriversOnly);
|
||||||
|
@ -348,8 +354,28 @@ IopInitializeDriver(PDRIVER_INITIALIZE DriverEntry,
|
||||||
return(Status);
|
return(Status);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (Filename != 0)
|
||||||
|
{
|
||||||
|
if (wcsrchr (Filename->Buffer, '\\') != 0)
|
||||||
|
{
|
||||||
|
wcscpy (DriverName, wcsrchr (Filename->Buffer, '\\'));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
wcscpy (DriverName, Filename->Buffer);
|
||||||
|
}
|
||||||
|
if (wcsrchr (DriverName, '.') != 0)
|
||||||
|
{
|
||||||
|
*(wcsrchr (DriverName, '.')) = 0;
|
||||||
|
}
|
||||||
|
wcscpy (RegistryKeyBuffer, DRIVER_REGISTRY_KEY_BASENAME);
|
||||||
|
wcscpy (RegistryKeyBuffer, DriverName);
|
||||||
|
RtlInitUnicodeString (&RegistryKey, RegistryKeyBuffer);
|
||||||
|
DPRINT("RegistryKey: %wZ\n", &RegistryKey);
|
||||||
|
}
|
||||||
|
|
||||||
DPRINT("Calling driver entrypoint at %08lx\n", DriverEntry);
|
DPRINT("Calling driver entrypoint at %08lx\n", DriverEntry);
|
||||||
Status = DriverEntry(DriverObject, NULL);
|
Status = DriverEntry(DriverObject, Filename != 0 ? &RegistryKey : 0);
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
ExFreePool(DriverObject->DriverExtension);
|
ExFreePool(DriverObject->DriverExtension);
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: loader.c,v 1.85 2001/08/21 20:13:09 chorns Exp $
|
/* $Id: loader.c,v 1.86 2001/08/22 03:53:52 rex Exp $
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
|
@ -917,6 +917,7 @@ VOID LdrLoadAutoConfigDrivers (VOID)
|
||||||
/*
|
/*
|
||||||
* Mouse drivers
|
* Mouse drivers
|
||||||
*/
|
*/
|
||||||
|
// LdrLoadAutoConfigDriver(L"l8042prt.sys");
|
||||||
LdrLoadAutoConfigDriver(L"psaux.sys");
|
LdrLoadAutoConfigDriver(L"psaux.sys");
|
||||||
LdrLoadAutoConfigDriver(L"mouclass.sys");
|
LdrLoadAutoConfigDriver(L"mouclass.sys");
|
||||||
|
|
||||||
|
@ -995,7 +996,7 @@ NTSTATUS LdrLoadDriver(PUNICODE_STRING Filename,
|
||||||
}
|
}
|
||||||
|
|
||||||
Status = IopInitializeDriver(ModuleObject->EntryPoint,
|
Status = IopInitializeDriver(ModuleObject->EntryPoint,
|
||||||
DeviceNode, BootDriversOnly);
|
DeviceNode, Filename, BootDriversOnly);
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
ObDereferenceObject(ModuleObject);
|
ObDereferenceObject(ModuleObject);
|
||||||
|
@ -1225,7 +1226,7 @@ LdrProcessDriver(PVOID ModuleLoadBase, PCHAR FileName, ULONG ModuleLength)
|
||||||
return(STATUS_UNSUCCESSFUL);
|
return(STATUS_UNSUCCESSFUL);
|
||||||
}
|
}
|
||||||
|
|
||||||
Status = IopInitializeDriver(ModuleObject->EntryPoint, DeviceNode, FALSE);
|
Status = IopInitializeDriver(ModuleObject->EntryPoint, DeviceNode, NULL, FALSE);
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
IopFreeDeviceNode(DeviceNode);
|
IopFreeDeviceNode(DeviceNode);
|
||||||
|
@ -1277,7 +1278,7 @@ LdrOpenModule(PUNICODE_STRING Filename)
|
||||||
RtlInitUnicodeString (&ModuleName, NameBuffer);
|
RtlInitUnicodeString (&ModuleName, NameBuffer);
|
||||||
InitializeObjectAttributes(&ObjectAttributes,
|
InitializeObjectAttributes(&ObjectAttributes,
|
||||||
&ModuleName,
|
&ModuleName,
|
||||||
0,
|
OBJ_CASE_INSENSITIVE,
|
||||||
NULL,
|
NULL,
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# $Id: helper.mk,v 1.1 2001/08/21 20:13:17 chorns Exp $
|
# $Id: helper.mk,v 1.2 2001/08/22 03:53:53 rex Exp $
|
||||||
#
|
#
|
||||||
# Helper makefile for ReactOS modules
|
# Helper makefile for ReactOS modules
|
||||||
# Variables this makefile accepts:
|
# Variables this makefile accepts:
|
||||||
|
@ -219,7 +219,8 @@ ifeq ($(TARGET_TYPE),gdi_driver)
|
||||||
MK_MODE := kernel
|
MK_MODE := kernel
|
||||||
MK_EXETYPE := dll
|
MK_EXETYPE := dll
|
||||||
MK_DEFEXT := .dll
|
MK_DEFEXT := .dll
|
||||||
MK_DEFENTRY := _DriverEntry@8
|
MK_DEFENTRY := _DrvEnableDriver@12
|
||||||
|
# MK_DEFENTRY := _DriverEntry@8
|
||||||
MK_DDKLIBS := ntoskrnl.a hal.a win32k.a
|
MK_DDKLIBS := ntoskrnl.a hal.a win32k.a
|
||||||
MK_SDKLIBS :=
|
MK_SDKLIBS :=
|
||||||
MK_CFLAGS := -D__NTDRIVER__ -I./ -I$(DDK_PATH_INC)
|
MK_CFLAGS := -D__NTDRIVER__ -I./ -I$(DDK_PATH_INC)
|
||||||
|
|
Loading…
Reference in a new issue