mirror of
https://github.com/reactos/reactos.git
synced 2024-12-27 01:24:38 +00:00
Fixed access to non-existent device extension.
svn path=/trunk/; revision=3250
This commit is contained in:
parent
2e467c56a3
commit
fc1193592b
1 changed files with 16 additions and 15 deletions
|
@ -1,4 +1,4 @@
|
|||
/* $Id: beep.c,v 1.10 2001/08/27 01:25:17 ekohl Exp $
|
||||
/* $Id: beep.c,v 1.11 2002/07/18 00:29:19 ekohl Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS kernel
|
||||
|
@ -32,7 +32,6 @@ typedef struct _BEEP_DEVICE_EXTENSION
|
|||
|
||||
/* FUNCTIONS ***************************************************************/
|
||||
|
||||
|
||||
static VOID STDCALL
|
||||
BeepDPC(PKDPC Dpc,
|
||||
PVOID DeferredContext,
|
||||
|
@ -245,26 +244,15 @@ DriverEntry(PDRIVER_OBJECT DriverObject,
|
|||
UNICODE_STRING SymlinkName;
|
||||
NTSTATUS Status;
|
||||
|
||||
DbgPrint("Beep Device Driver 0.0.3\n");
|
||||
DPRINT("Beep Device Driver 0.0.3\n");
|
||||
|
||||
DriverObject->Flags = 0;
|
||||
DriverObject->MajorFunction[IRP_MJ_CREATE] = BeepCreate;
|
||||
DriverObject->MajorFunction[IRP_MJ_CLOSE] = BeepClose;
|
||||
DriverObject->MajorFunction[IRP_MJ_CLEANUP] = BeepCleanup;
|
||||
DriverObject->MajorFunction[IRP_MJ_DEVICE_CONTROL] = BeepDeviceControl;
|
||||
DriverObject->DriverUnload = BeepUnload;
|
||||
|
||||
/* set up device extension */
|
||||
DeviceExtension = DeviceObject->DeviceExtension;
|
||||
DeviceExtension->BeepOn = FALSE;
|
||||
|
||||
KeInitializeDpc(&DeviceExtension->Dpc,
|
||||
BeepDPC,
|
||||
DeviceExtension);
|
||||
KeInitializeTimer(&DeviceExtension->Timer);
|
||||
KeInitializeEvent(&DeviceExtension->Event,
|
||||
SynchronizationEvent,
|
||||
FALSE);
|
||||
|
||||
RtlInitUnicodeString(&DeviceName,
|
||||
L"\\Device\\Beep");
|
||||
Status = IoCreateDevice(DriverObject,
|
||||
|
@ -277,6 +265,19 @@ DriverEntry(PDRIVER_OBJECT DriverObject,
|
|||
if (!NT_SUCCESS(Status))
|
||||
return Status;
|
||||
|
||||
/* set up device extension */
|
||||
DeviceExtension = DeviceObject->DeviceExtension;
|
||||
DeviceExtension->BeepOn = FALSE;
|
||||
|
||||
KeInitializeDpc(&DeviceExtension->Dpc,
|
||||
BeepDPC,
|
||||
DeviceExtension);
|
||||
KeInitializeTimer(&DeviceExtension->Timer);
|
||||
KeInitializeEvent(&DeviceExtension->Event,
|
||||
SynchronizationEvent,
|
||||
FALSE);
|
||||
|
||||
/* Create the dos device link */
|
||||
RtlInitUnicodeString(&SymlinkName,
|
||||
L"\\??\\Beep");
|
||||
IoCreateSymbolicLink(&SymlinkName,
|
||||
|
|
Loading…
Reference in a new issue